@hyperfixi/core 2.10.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/ast-utils/index.js +109 -8
  2. package/dist/ast-utils/index.mjs +109 -8
  3. package/dist/behaviors/index.js +2 -1
  4. package/dist/behaviors/index.mjs +2 -1
  5. package/dist/chunks/{bridge-CPNAPYAo.js → bridge-De7lnU_9.js} +2 -2
  6. package/dist/chunks/browser-modular-DpHHlmJ0.js +2 -0
  7. package/dist/chunks/{index-BQkkNlzO.js → index-D6-8bcsy.js} +2 -2
  8. package/dist/commands/helpers/dom-mutation.d.ts +3 -2
  9. package/dist/commands/helpers/index.d.ts +1 -1
  10. package/dist/commands/index.js +74 -8
  11. package/dist/commands/index.mjs +74 -8
  12. package/dist/hyperfixi-browser-classic-i18n.js +1 -1
  13. package/dist/hyperfixi-browser-minimal.js +1 -1
  14. package/dist/hyperfixi-browser-standard.js +1 -1
  15. package/dist/hyperfixi-browser.js +1 -1
  16. package/dist/hyperfixi-classic-i18n.js +1 -1
  17. package/dist/hyperfixi-hx-v4.js +1 -1
  18. package/dist/hyperfixi-minimal.js +1 -1
  19. package/dist/hyperfixi-multilingual.js +1 -1
  20. package/dist/hyperfixi-standard.js +1 -1
  21. package/dist/hyperfixi.js +1 -1
  22. package/dist/hyperfixi.mjs +1 -1
  23. package/dist/index.js +224 -33
  24. package/dist/index.min.js +1 -1
  25. package/dist/index.mjs +224 -33
  26. package/dist/lokascript-browser-classic-i18n.js +1 -1
  27. package/dist/lokascript-browser-minimal.js +1 -1
  28. package/dist/lokascript-browser-standard.js +1 -1
  29. package/dist/lokascript-browser.js +1 -1
  30. package/dist/lokascript-multilingual.js +1 -1
  31. package/dist/lsp-metadata.js +2 -2
  32. package/dist/lsp-metadata.mjs +2 -2
  33. package/dist/metadata.d.ts +1 -1
  34. package/dist/metadata.js +13 -11
  35. package/dist/metadata.mjs +13 -11
  36. package/dist/reference/index.js +7 -2
  37. package/dist/reference/index.mjs +7 -2
  38. package/dist/registry/index.js +6 -4
  39. package/dist/registry/index.mjs +6 -4
  40. package/dist/utils/element-check.d.ts +1 -0
  41. package/dist/version.d.ts +2 -0
  42. package/package.json +5 -5
  43. package/dist/chunks/browser-modular-B0lGdcoP.js +0 -2
@@ -1,2 +1,2 @@
1
- var hyperfixi=function(){"use strict";const e="then",t="else",r="end",n="and",i="for",a="while",s="until",o="forever",l="times",c="index",u="in",d="to",m="from",p="with",h="of",f="on",y="event",g="behavior",v="global",b="the",w="start",k=new Set(["add","append","async","beep","blur","break","breakpoint","call","clear","close","continue","copy","decrement","default","empty","exit","fetch","focus","get","go","halt","hide","if","increment","install","js","log","make","measure","morph","open","pick","prepend","process","pseudo-command","push","put","remove","render","repeat","replace","reset","return","scroll","select","send","set","settle","show","start","swap","take","tell","throw","toggle","transition","trigger","unless","wait","for"]),E=new Set(["put","trigger","send","remove","take","toggle","set","show","hide","add","halt","measure","js","go","tell","pick","start","swap","morph","push","replace","process"]),x=(new Set(["if","unless","repeat","wait","for","while"]),"at start of"),C="at end of",A=["into","before","after","at",x,C,"at the start of","at the end of"],S=new Set(["if","else","unless","for","while","until","end","and","or","not","in","to","from","into","with","without","as","matches","contains","then","on","when","every","init","def","behavior","the","of","first","last"]),T=e=>k.has(e.toLowerCase()),L=e=>E.has(e.toLowerCase()),O=e=>S.has(e.toLowerCase()),j=e=>P.has(e.toLowerCase()),P=new Set(["hsl","hsla","rgb","rgba","hwb","lab","lch","oklch","oklab","color","color-mix","calc","min","max","clamp","var","url","linear-gradient","radial-gradient","conic-gradient","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient"]),I=new Set(["me","it","you","result","my","its","your"]),q=new Set(["and","or","not","no"]),N=new Set(["==","!=","===","!==","<",">","<=",">=","is","is not","am","is a","is an","is not a","is not an","precedes","does not precede","follows","does not follow","contains","starts with","ends with","does not start with","does not end with","has","have","does not contain","include","includes","does not include","match","matches","exists","does not exist","is empty","is not empty","is in","is not in","is between","is not between","equals","in","is equal to","is really equal to","is not equal to","is not really equal to","is greater than","is less than","is greater than or equal to","is less than or equal to","really equals","am in","am not in","am between","am not between","is really","is not really","is equal","is not equal","contain","do not contain","does not contains","do not match","does not match","ignoring case","sorted by","mapped to","split by","joined by"]),R=new Set(["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","focus","blur","change","input","submit","reset","select","load","unload","resize","scroll","keydown","keyup","keypress","touchstart","touchend","touchmove","touchcancel","drag","drop","dragover","dragenter","dragleave","cut","copy","paste","toggle"]),M=new Set(["on","init","behavior","def","if","else","unless","for","while","until","end","and","or","not","in","to","from","into","with","as","then","when","where","after","before","by","at","between","async","no","start","of","the","new","global","local","equal","equals","greater","less","than","really","catch","finally","throw","return"]);var $;!function(e){e.IDENTIFIER="identifier",e.STRING="string",e.NUMBER="number",e.SELECTOR="selector",e.OPERATOR="operator",e.TIME="time",e.TEMPLATE="template",e.COMMENT="comment",e.SYMBOL="symbol",e.UNKNOWN="unknown"}($||($={}));const _=new Set(["+","-","*","/","mod"]),z=new Set(["ms","s","seconds","minutes","hours","days"]);function V(e,t=1){const r=e.position+t;return e.input.length>r?e.input[r]:""}function H(e){const t=e.input[e.position];return e.position++,"\n"===t?(e.line++,e.column=1):"\r"===t?("\n"===(e.input.length>e.position?e.input[e.position]:"")&&e.position++,e.line++,e.column=1):e.column++,t}function B(e){const t=e.input,r=t.length;for(;r>e.position;){const r=t[e.position];if(" "!==r&&"\t"!==r&&"\r"!==r&&"\n"!==r)break;H(e)}}function W(e,t,r,n,i){const a=n??e.position-r.length,s=e.position;let o=e.column-r.length;if(void 0!==n){o=1;let t=-1;for(let r=0;n>r;r++)"\n"!==e.input[r]&&"\r"!==e.input[r]||(t=r);o=n-t}const l={kind:t,value:r,start:a,end:s,line:D(e,a),column:o};e.tokens.push(l)}function D(e,t){let r=1;for(let n=0;t>n&&e.input.length>n;n++){const t=e.input[n];"\n"===t?r++:"\r"===t&&(r++,e.input.length>n+1&&"\n"===e.input[n+1]&&n++)}return r}function F(e){const t=e.position;let r="";for(H(e),H(e);e.input.length>e.position&&"\n"!==e.input[e.position];)r+=H(e);W(e,$.COMMENT,"--"+r,t)}function U(e){const t=e.position,r=H(e);let n=r;for(;e.input.length>e.position;){const t=H(e);if(n+=t,t===r)break;"\\"===t&&e.input.length>e.position&&(n+=H(e))}W(e,$.STRING,n,t)}function K(e){const t=e.position;H(e);let r="";for(;e.input.length>e.position;){const t=e.input[e.position];if("`"===t){H(e);break}if("\\"===t){if(H(e),e.input.length>e.position){const t=H(e);switch(t){case"n":r+="\n";break;case"t":r+="\t";break;case"r":r+="\r";break;case"\\":r+="\\";break;case"`":r+="`";break;default:r+=t}}}else r+=H(e)}if(e.position>=e.input.length&&!e.input.endsWith("`"))throw Error(`Unterminated template literal at line ${e.line}, column ${e.column-r.length}`);W(e,$.TEMPLATE,r,t)}function Z(e){const t=e.position;let r=H(e);if(e.input.length>e.position&&"{"===e.input[e.position]){for(r+=H(e);e.input.length>e.position;){const t=e.input[e.position];if(r+=H(e),"}"===t)break}W(e,$.SELECTOR,r,t)}else{for(;e.input.length>e.position;){const t=e.input[e.position];if("\\"===t)H(e),e.input.length>e.position&&(r+=H(e));else{if(!re(t)&&"-"!==t&&"_"!==t&&":"!==t)break;r+=H(e)}}W(e,$.SELECTOR,r,t)}}function X(e){const t=e.position;if(ne(e))return void function(e,t){const r=e.input;let n="",i=0,a="";for(;r.length>e.position;){const t=r[e.position];if(a)n+=H(e),t===a&&(a="");else if('"'!==t&&"'"!==t){if("<"===t){if("/"===r[e.position+1]){for(;r.length>e.position&&">"!==r[e.position];)n+=H(e);if(r.length>e.position&&(n+=H(e)),i--,0>=i)break;continue}let t=!1,a="";for(;r.length>e.position;){const i=r[e.position];if(a)n+=H(e),i===a&&(a="");else if('"'!==i&&"'"!==i){if(">"===i){t="/"===r[e.position-1],n+=H(e);break}n+=H(e)}else a=i,n+=H(e)}if(t||i++,0>=i)break;continue}n+=H(e)}else a=t,n+=H(e)}W(e,$.SELECTOR,n,t)}(e,t);let r="";for(r+=H(e);e.input.length-1>e.position;){const t=e.input[e.position],n=e.input[e.position+1];if(r+=H(e),"/"===t&&">"===n){r+=H(e);break}}W(e,$.SELECTOR,r,t)}function G(e){const t=e.position;let r=H(e);for(;e.input.length>e.position;){const t=e.input[e.position];if(!re(t)&&"_"!==t&&"-"!==t)break;r+=H(e)}W(e,$.SYMBOL,r,t)}function J(e){const t=e.position;let r="";const n=e.input[e.position];if(("'"===n||"'"===n)&&"s"===V(e,1))return r="'s",H(e),H(e),void W(e,$.OPERATOR,r,t);const i=e.input.substring(e.position,e.position+2),a=e.input.substring(e.position,e.position+3);["===","!=="].includes(a)?(r=a,H(e),H(e),H(e)):["==","!=","<=",">=","&&","||","**","~=","|=","^=","$=","*=","?."].includes(i)?(r=i,H(e),H(e)):r=H(e),W(e,$.OPERATOR,r,t)}function Y(e){const t=e.position,r=e.input,n=r.length;let i="";for(;n>e.position;){const t=r[e.position];if("0">t||t>"9")break;i+=H(e)}if(n>e.position&&"."===r[e.position]&&(e.position+1>=n||"."!==r[e.position+1]))for(i+=H(e);n>e.position;){const t=r[e.position];if("0">t||t>"9")break;i+=H(e)}if(n>e.position){const t=r[e.position];if("e"===t||"E"===t){const t=n>e.position+1?r[e.position+1]:"",a=n>e.position+2?r[e.position+2]:"";if(t>="0"&&"9">=t||!("+"!==t&&"-"!==t||"0">a||a>"9"))for(i+=H(e),"+"!==r[e.position]&&"-"!==r[e.position]||(i+=H(e));n>e.position;){const t=r[e.position];if("0">t||t>"9")break;i+=H(e)}}}const a=e.position;let s="";for(;n>e.position;){const t=r[e.position];if(("a">t||t>"z")&&("A">t||t>"Z"))break;s+=H(e)}z.has(s)?W(e,$.TIME,i+s,t):(e.position=a,W(e,$.NUMBER,i,t))}function Q(e){const t=e.position,r=e.input,n=r.length;let i="";for(;n>e.position;){const t=r[e.position];if(("a">t||t>"z")&&("A">t||t>"Z")&&("0">t||t>"9")&&"_"!==t&&"-"!==t)break;i+=H(e)}const a=function(e,t,r){const n=t.toLowerCase(),i=e.position;if("'s"===t||"'s"===t)return!1;const a=e.tokens[e.tokens.length-1];if(a&&(a.kind===$.IDENTIFIER||a.kind===$.SELECTOR)){const t=e.input.length>e.position?e.input[e.position]:"";if("'"===t||"'"===t)return!1}B(e);let s="";for(;e.input.length>e.position;){const t=e.input[e.position];if(("a">t||t>"z")&&("A">t||t>"Z")&&("0">t||t>"9")&&"_"!==t&&"-"!==t)break;s+=H(e)}if(s){const t=s.toLowerCase(),i=`${n} ${t}`,a=function(e,t,r,n){const i=t.toLowerCase(),a=r.toLowerCase();if("at"===i){const t=e.position;if("the"===a){B(e);let r="";for(;e.input.length>e.position;){const t=e.input[e.position];if(("a">t||t>"z")&&("A">t||t>"Z")&&("0">t||t>"9")&&"_"!==t&&"-"!==t)break;r+=H(e)}const i=r.toLowerCase();if("start"===i||"end"===i){B(e);let t="";for(;e.input.length>e.position;){const r=e.input[e.position];if(("a">r||r>"z")&&("A">r||r>"Z")&&("0">r||r>"9")&&"_"!==r&&"-"!==r)break;t+=H(e)}if("of"===t.toLowerCase())return W(e,$.IDENTIFIER,`at the ${i} of`,n),!0}return e.position=t,!1}if("start"===a||"end"===a){B(e);let r="";for(;e.input.length>e.position;){const t=e.input[e.position];if(("a">t||t>"z")&&("A">t||t>"Z")&&("0">t||t>"9")&&"_"!==t&&"-"!==t)break;r+=H(e)}return"of"===r.toLowerCase()?(W(e,$.IDENTIFIER,`at ${a} of`,n),!0):(e.position=t,!1)}}return!1}(e,n,t,r);if(a)return!0;const o=function(e,t,r){const n=e.position;let i=`${t} ${r}`,a=e.position;const s=[t,r];for(;8>s.length&&(B(e),e.input.length>e.position);){let t="";for(;e.input.length>e.position;){const r=e.input[e.position];if(("a">r||r>"z")&&("A">r||r>"Z"))break;t+=H(e)}if(!t)break;s.push(t.toLowerCase());const r=s.join(" ");N.has(r)&&(i=r,a=e.position)}return N.has(i)&&i!==`${t} ${r}`?(e.position=a,i):(e.position=n,null)}(e,n,t);if(o)return W(e,$.OPERATOR,o,r),!0;if(N.has(i))return W(e,$.OPERATOR,i,r),!0}return N.has(n)?(e.position=i,W(e,$.OPERATOR,t,r),!0):(e.position=i,!1)}(e,i,t);if(a)return;const s=function(e){const t=e.toLowerCase();return"include"===t||"includes"===t||q.has(t)||_.has(e)||_.has(t)||N.has(t)?$.OPERATOR:$.IDENTIFIER}(i);W(e,s,i,t)}function ee(e){const t=e.position,r=e.input,n=r.length;H(e);let i="$";for(;n>e.position;){const t=r[e.position];if(("a">t||t>"z")&&("A">t||t>"Z")&&("0">t||t>"9")&&"_"!==t)break;i+=H(e)}W(e,$.IDENTIFIER,i,t)}function te(e){return/[a-zA-Z]/.test(e)}function re(e){return/[a-zA-Z0-9]/.test(e)}function ne(e){const t=e.input,r=t[e.position+1];if(!r||!/[a-zA-Z]/.test(r))return!1;let n=e.position+1,i="";for(;t.length>n&&/[a-zA-Z0-9-]/.test(t[n]);)i+=t[n],n++;return i.length>0&&-1!==t.indexOf("</"+i+">",n)}function ie(e){if(ne(e))return!0;let t=e.position+1,r=!1;for(;e.input.length>t;){const n=e.input[t];if("/"===n&&e.input.length>t+1&&">"===e.input[t+1])return r;if(re(n)||"."===n||"#"===n||"["===n||"]"===n||":"===n||"-"===n||"_"===n||" "===n||"="===n||'"'===n||"'"===n||"("===n||")"===n||"*"===n||"^"===n||"$"===n||"~"===n||"|"===n||">"===n||"+"===n||","===n||"{"===n||"}"===n)r=!0,t++;else{if(" "!==n&&"\t"!==n)return!1;t++}if(t-e.position>50)return!1}return!1}function ae(e){return"+-*/^%=!<>&|(){}[],.;:?''~$".includes(e)}const se=function(){if("undefined"!=typeof localStorage)try{const e=localStorage,t=e.getItem("hyperfixi:debug")||e.getItem("lokascript:debug");if("*"===t||"true"===t)return!0}catch{}return!("undefined"==typeof window||!window.__HYPERFIXI_DEBUG__)||"undefined"!=typeof process&&"true"===process.env?.HYPERFIXI_DEBUG}(),oe=se,le=se,ce=se,ue=se,de=(...e)=>{oe&&console.log("\ud83d\udd27",...e)},me=(...e)=>{le&&console.log("\ud83c\udfaf",...e)},pe=(...e)=>{ce&&console.log("\ud83d\udcdd",...e)},he=(...e)=>{ue&&console.log("\ud83d\ude80",...e)};let fe=!1,ye=null;if("undefined"!=typeof window&&"undefined"!=typeof URLSearchParams)try{"semantic"===new URLSearchParams(window.location.search).get("debug")&&(fe=!0,ye=window,console.log("%c[HyperFixi] Semantic debug auto-enabled via URL param","color: #667eea; font-weight: bold"))}catch{}let ge={totalParses:0,semanticSuccesses:0,semanticFallbacks:0,traditionalParses:0,averageConfidence:0,confidenceHistory:[]};class ve{constructor(e){this.analyzer=e.analyzer,this.language=e.language,this.confidenceThreshold=e.confidenceThreshold??.5,this.debugEnabled=e.debug??!1}isAvailable(){return this.analyzer.supportsLanguage(this.language)}shouldSkipSemantic(e){const t=e.trim().split(/\s+/)[0]?.toLowerCase();if(ve.SKIP_SEMANTIC_COMMANDS.has(t))return!0;const r=e.toLowerCase();return!!/\bjs\b/.test(r)||!!/\btell\b/.test(r)||!!/\*[a-zA-Z]/.test(e)}trySemanticParse(e){const t=performance.now();if(this.shouldSkipSemantic(e))return{success:!1,confidence:0,errors:["Command skipped for semantic parsing - using traditional parser"]};if(!this.isAvailable())return{success:!1,confidence:0,errors:[`Semantic parsing not available for language '${this.language}'`]};try{const n=this.analyzer.analyze(e,this.language),i=performance.now()-t;this.debugEnabled&&console.log("[SemanticIntegration] Analysis result:",{input:e,language:this.language,confidence:n.confidence,command:n.command?.name,threshold:this.confidenceThreshold});const a=n.confidence>=this.confidenceThreshold&&!!n.command,s=!a&&n.confidence>0;if(fe){const t={};if(n.command?.roles)for(const[e,r]of n.command.roles)t[e]=r.value;const o={input:e.substring(0,100),language:this.language,confidence:n.confidence,threshold:this.confidenceThreshold,semanticSuccess:a,fallbackTriggered:s,command:n.command?.name,roles:Object.keys(t).length>0?t:void 0,errors:n.errors,timestamp:Date.now(),duration:i};!function(e){if(!fe)return;const t=e.semanticSuccess?"semantic":e.fallbackTriggered?"fallback":"traditional",r=Math.round(100*e.confidence),n=Math.round(100*e.threshold),i=e.semanticSuccess?"color: #4caf50; font-weight: bold":e.fallbackTriggered?"color: #ff9800; font-weight: bold":"color: #9e9e9e";if(console.groupCollapsed(`%c[Semantic] ${t.toUpperCase()} %c${e.input.substring(0,50)}${e.input.length>50?"...":""}`,i,"color: #888"),console.log(`Confidence: ${r}% (threshold: ${n}%)`),e.command&&console.log("Command: "+e.command),e.roles&&Object.keys(e.roles).length>0&&console.log("Roles:",e.roles),e.duration&&console.log(`Duration: ${e.duration.toFixed(2)}ms`),e.errors?.length&&console.log("Errors:",e.errors),console.groupEnd(),ye){const t=new CustomEvent("lokascript:semantic:parse",{detail:e,bubbles:!0});ye.dispatchEvent(t)}}(o),r=o,ge.totalParses++,r.semanticSuccess?ge.semanticSuccesses++:r.fallbackTriggered?ge.semanticFallbacks++:ge.traditionalParses++,ge.confidenceHistory.push(r.confidence),ge.confidenceHistory.length>100&&ge.confidenceHistory.shift(),ge.averageConfidence=ge.confidenceHistory.reduce((e,t)=>e+t,0)/ge.confidenceHistory.length}return a?{success:!0,node:this.buildCommandNode(n),confidence:n.confidence,tokensConsumed:n.tokensConsumed}:{success:!1,confidence:n.confidence,tokensConsumed:n.tokensConsumed,errors:n.errors}}catch(e){return{success:!1,confidence:0,errors:[e instanceof Error?e.message:e+""]}}var r}buildCommandNode(e){const{command:t}=e;if(!t)throw Error("Cannot build command node without command data");if("repeat"===t.name)return this.buildRepeatCommandNode(t);if("for"===t.name)return this.buildRepeatCommandNode(t);if("set"===t.name)return this.buildSetCommandNode(t);if("if"===t.name||"unless"===t.name)return this.buildIfCommandNode(t);const r=this.analyzer.buildCommandNode?.(t);if(!r)throw Error(`Semantic analyzer cannot build an AST node for '${t.name}' (no buildCommandNode wired \u2014 see createSemanticAdapter's buildAST dep)`);return r}buildRepeatCommandNode(e){const t=[],r={},n=e.roles.get("loopType");n&&t.push({type:"identifier",name:n.value+"",start:0,end:0,line:1,column:0});const i=e.roles.get("patient");"for"==(n?n.value+"":"")&&i&&t.push({type:"identifier",name:"expression"===i.type&&i.raw||i.value+"",start:0,end:0,line:1,column:0});const a=e.roles.get("event");a&&t.push({type:"string",value:a.value+"",start:0,end:0,line:1,column:0});const s=e.roles.get("source");s&&t.push(this.semanticValueToExpression(s));const o=e.roles.get("quantity");o&&t.push(this.semanticValueToExpression(o));const l=e.roles.get("condition");return l&&(r.condition=this.semanticValueToExpression(l)),{type:"command",name:"repeat",args:t,modifiers:Object.keys(r).length>0?r:void 0,isBlocking:!1,start:0,end:0,line:1,column:0}}buildSetCommandNode(e){const t=[],r=e.roles.get("destination");if(r)if("property-path"===r.type){const e=r;t.push({type:"possessiveExpression",object:this.semanticValueToExpression(e.object),property:this.createPropertyNode(e.property),start:0,end:0,line:1,column:0})}else t.push(this.semanticValueToExpression(r));t.push({type:"identifier",name:"to",start:0,end:0,line:1,column:0});const n=e.roles.get("patient");return n&&t.push(this.semanticValueToExpression(n)),{type:"command",name:"set",args:t,isBlocking:!1,start:0,end:0,line:1,column:0}}createPropertyNode(e){return e.startsWith("*")?{type:"cssProperty",name:e.substring(1),start:0,end:0,line:1,column:0}:{type:"identifier",name:e,start:0,end:0,line:1,column:0}}buildIfCommandNode(e){const t=[],r=e.roles.get("condition");return r&&t.push(this.semanticValueToExpression(r)),{type:"command",name:e.name,args:t,isBlocking:!1,start:0,end:0,line:1,column:0}}semanticValueToExpression(e){switch(e.type){case"selector":return{type:"selector",value:e.value,start:0,end:0,line:1,column:0};case"reference":return{type:"identifier",name:e.value,start:0,end:0,line:1,column:0};case"literal":return"string"==typeof e.value&&e.value.includes("${")&&e.value.includes("}")?{type:"templateLiteral",value:e.value,start:0,end:0,line:1,column:0}:{type:"literal",value:e.value,raw:e.raw??e.value,start:0,end:0,line:1,column:0};case"property-path":{const t=e;return{type:"memberExpression",object:this.semanticValueToExpression(t.object),property:{type:"identifier",name:t.property,start:0,end:0,line:1,column:0},computed:!1,start:0,end:0,line:1,column:0}}default:return this.parseExpressionString(e.raw||"")}}parseExpressionString(e){let t=0;const r=()=>{for(;e.length>t&&/\s/.test(e[t]);)t++},n=()=>{r();const n=t;for(;e.length>t&&/[a-zA-Z0-9_$]/.test(e[t]);)t++;return e.slice(n,t)},i=()=>{const n=[];if(t++,r(),")"!==e[t])for(n.push(a()),r();","===e[t];)t++,r(),n.push(a()),r();return")"===e[t]&&t++,n},a=()=>{r();const a=n();if(!a)return{type:"identifier",name:e.trim(),start:0,end:0,line:1,column:0};let s={type:"identifier",name:a,start:0,end:0,line:1,column:0};for(;e.length>t;){r();const a=e[t];if("."===a){t++;const e=n();e&&(s={type:"memberExpression",object:s,property:{type:"identifier",name:e,start:0,end:0,line:1,column:0},computed:!1,start:0,end:0,line:1,column:0})}else{if("("!==a)break;s={type:"callExpression",callee:s,arguments:i(),start:0,end:0,line:1,column:0}}}return s};return a()}getLanguage(){return this.language}getConfidenceThreshold(){return this.confidenceThreshold}}ve.SKIP_SEMANTIC_COMMANDS=new Set(["swap","morph","js","tell"]);const be=new Set(["then","end","to","into","on","with","from","in","by","for","while","until","unless","else","catch","finally"]),we=new Set([")","]","}",","]);function ke(e,t){return{infix:{bp:[e,e+1],handler:t??((t,r,n)=>{const i=n.parseExpr(e+1);return{type:"binaryExpression",operator:r.value,left:t,right:i,start:t.start,end:i.end??r.end,line:t.line??r.line,column:t.column??r.column}})}}}function Ee(e,t){return{infix:{bp:[e+1,e],handler:(t,r,n)=>{const i=n.parseExpr(e);return{type:"binaryExpression",operator:r.value,left:t,right:i,start:t.start,end:i.end??r.end,line:t.line??r.line,column:t.column??r.column}}}}}function xe(e,t){return{prefix:{bp:e,handler:t??((t,r)=>{const n=r.parseExpr(e);return{type:"unaryExpression",operator:t.value,operand:n,argument:n,prefix:!0,start:t.start,end:n.end??t.end,line:t.line,column:t.column}})}}}function Ce(e){return(t,r,n)=>{const i=n.advance();if(!i||!i.value)throw Error(`Type check requires a type name after 'is ${e?"not ":""}a/an', got: <end>`);let a=!0;const s=n.peek();return s&&"!"===s.value&&(n.advance(),a=!1),{type:"typeCheckExpression",value:t,typeName:i.value,nullOk:a,negated:e,start:t.start,end:i.end}}}const Ae=function(...e){const t=new Map;for(const r of e)for(const[e,n]of r){const r=t.get(e);t.set(e,r?{prefix:n.prefix??r.prefix,infix:n.infix??r.infix}:{...n})}return t}(new Map([["or",ke(10)],["||",ke(10)],["and",ke(20)],["&&",ke(20)],["==",ke(30)],["!=",ke(30)],["<",ke(30)],[">",ke(30)],["<=",ke(30)],[">=",ke(30)],["is",ke(30)],["matches",ke(30)],["contains",ke(30)],["starts with",ke(30)],["ends with",ke(30)],["does not start with",ke(30)],["does not end with",ke(30)],["is between",ke(30,(e,t,r)=>{const n=r.parseExpr(31),i=r.peek();if(!i||"and"!==i.value.toLowerCase())throw Error("between requires 'and' between min and max operands, got: "+(i?.value??"<end>"));r.advance();const a=r.parseExpr(31);return{type:"betweenExpression",value:e,min:n,max:a,negated:!1,start:e.start,end:a.end}})],["is not between",ke(30,(e,t,r)=>{const n=r.parseExpr(31),i=r.peek();if(!i||"and"!==i.value.toLowerCase())throw Error("between requires 'and' between min and max operands, got: "+(i?.value??"<end>"));r.advance();const a=r.parseExpr(31);return{type:"betweenExpression",value:e,min:n,max:a,negated:!0,start:e.start,end:a.end}})],["am between",ke(30,(e,t,r)=>{const n=r.parseExpr(31),i=r.peek();if(!i||"and"!==i.value.toLowerCase())throw Error("between requires 'and' between min and max operands, got: "+(i?.value??"<end>"));r.advance();const a=r.parseExpr(31);return{type:"betweenExpression",value:e,min:n,max:a,negated:!1,start:e.start,end:a.end}})],["am not between",ke(30,(e,t,r)=>{const n=r.parseExpr(31),i=r.peek();if(!i||"and"!==i.value.toLowerCase())throw Error("between requires 'and' between min and max operands, got: "+(i?.value??"<end>"));r.advance();const a=r.parseExpr(31);return{type:"betweenExpression",value:e,min:n,max:a,negated:!0,start:e.start,end:a.end}})],["ignoring case",{infix:{bp:[25,26],handler:(e,t,r)=>(e.ignoringCase=!0,e)}}],["where",ke(28,(e,t,r)=>{const n=r.parseExpr(29);return{type:"collectionExpression",operator:"where",collection:e,right:n,start:e.start,end:n.end}})],["sorted by",ke(28,(e,t,r)=>{const n=r.parseExpr(29);let i="asc";const a=r.peek();if(a&&"string"==typeof a.value){const e=a.value.toLowerCase();"asc"===e||"ascending"===e?(r.advance(),i="asc"):"desc"!==e&&"descending"!==e||(r.advance(),i="desc")}return{type:"collectionExpression",operator:"sorted by",collection:e,right:n,order:i,start:e.start,end:n.end}})],["mapped to",ke(28,(e,t,r)=>{const n=r.parseExpr(29);return{type:"collectionExpression",operator:"mapped to",collection:e,right:n,start:e.start,end:n.end}})],["split by",ke(28,(e,t,r)=>{const n=r.parseExpr(29);return{type:"collectionExpression",operator:"split by",collection:e,right:n,start:e.start,end:n.end}})],["joined by",ke(28,(e,t,r)=>{const n=r.parseExpr(29);return{type:"collectionExpression",operator:"joined by",collection:e,right:n,start:e.start,end:n.end}})],["+",{...ke(40),...xe(80)}],["-",{...ke(40),...xe(80)}],["*",ke(50)],["/",ke(50)],["%",ke(50)],["mod",ke(50)],["^",Ee(60)],["**",Ee(60)],["as",ke(70,(e,t,r)=>{const n=()=>{const e=r.peek();!e||"a"!==e.value&&"an"!==e.value||r.advance();const t=r.parseExpr(71),n=r.peek();if(n&&":"===n.value&&t&&"identifier"===t.type){r.advance();const e=r.advance();e&&void 0!==e.value&&(t.name=`${t.name}:${e.value}`,t.end=e.end)}return t};let i=n(),a={type:"asExpression",expression:e,targetType:i,start:e.start,end:i.end??t.end,line:e.line??t.line,column:e.column??t.column};for(;r.peek()&&"|"===r.peek().value;){r.advance();const e=n();a={type:"asExpression",expression:a,targetType:e,start:a.start,end:e.end??a.end,line:a.line,column:a.column}}return a})],["not",xe(80)],["!",xe(80)],["no",xe(27)]]),new Map([["===",ke(30)],["!==",ke(30)],["is not",ke(30)],["am",ke(30)],["is in",ke(30)],["is not in",ke(30)],["precedes",ke(30)],["does not precede",ke(30)],["follows",ke(30)],["does not follow",ke(30)],["is a",ke(30,Ce(!1))],["is an",ke(30,Ce(!1))],["is not a",ke(30,Ce(!0))],["is not an",ke(30,Ce(!0))],["has",ke(30)],["have",ke(30)],["match",ke(30)],["include",ke(30)],["includes",ke(30)],["equals",ke(30)],["does not contain",ke(30)],["does not include",ke(30)],["am in",ke(30)],["am not in",ke(30)],["is really",ke(30)],["is not really",ke(30)],["is equal",ke(30)],["is not equal",ke(30)],["contain",ke(30)],["do not contain",ke(30)],["does not contains",ke(30)],["do not match",ke(30)],["does not match",ke(30)],["is equal to",ke(30)],["is not equal to",ke(30)],["is really equal to",ke(30)],["is not really equal to",ke(30)],["really equals",ke(30)],["is greater than",ke(30)],["is less than",ke(30)],["is greater than or equal to",ke(30)],["is less than or equal to",ke(30)],["in",ke(30)],["of",Ee(30)],["really",ke(30)],["exists",{prefix:{bp:80,handler:(e,t)=>({type:"unaryExpression",operator:e.value,operand:t.parseExpr(80),start:e.start})},infix:{bp:[30,31],handler:(e,t)=>({type:"unaryExpression",operator:t.value,operand:e,prefix:!1,start:e.start})}}],["does not exist",{infix:{bp:[30,31],handler:(e,t)=>({type:"unaryExpression",operator:t.value,operand:e,prefix:!1,start:e.start})}}],["is empty",{infix:{bp:[30,31],handler:(e,t)=>({type:"unaryExpression",operator:t.value,operand:e,prefix:!1,start:e.start})}}],["is not empty",{infix:{bp:[30,31],handler:(e,t)=>({type:"unaryExpression",operator:t.value,operand:e,prefix:!1,start:e.start})}}],["some",xe(80)]]),new Map([["=",Ee(5)]])),Se=new Map,Te=new Map,Le=new Map,Oe=new Set,je=new Set,Pe=new Set,Ie=new Set;function qe(e){return Se.get(e.toLowerCase())}function Ne(e){return Le.get(e)}function Re(e,t){if(0!==je.size)for(const r of je)try{r(e,t)}catch(e){void 0!==console&&console.error("[hyperfixi] globalReadHook threw:",e)}}function Me(e,t,r){if(0!==Pe.size)for(const n of Pe)try{n(e,t,r)}catch(e){void 0!==console&&console.error("[hyperfixi] localWriteHook threw:",e)}}function $e(e,t){if(0!==Ie.size)for(const r of Ie)try{r(e,t)}catch(e){void 0!==console&&console.error("[hyperfixi] localReadHook threw:",e)}}function _e(e,t,r){if(e.globals.set(t,r),0!==Oe.size)for(const n of Oe)try{n(t,r,e)}catch(e){void 0!==console&&console.error("[hyperfixi] globalWriteHook threw:",e)}}function ze(e){return e.kind===$.IDENTIFIER&&k.has(e.value.toLowerCase())}function Ve(e){return e.kind===$.IDENTIFIER&&M.has(e.value.toLowerCase())}function He(e){return e.kind===$.IDENTIFIER&&R.has(e.value.toLowerCase())}function Be(e){return e.kind===$.IDENTIFIER&&I.has(e.value.toLowerCase())}function We(e){return N.has(e.value.toLowerCase())}function De(e){return e.kind===$.IDENTIFIER}function Fe(e){return e.kind===$.SELECTOR}function Ue(e){return e.kind===$.SELECTOR&&!e.value.startsWith("<")}function Ke(e){return e.kind===$.STRING||e.kind===$.NUMBER||e.kind===$.TEMPLATE}function Ze(e){return e.kind===$.IDENTIFIER}function Xe(e){return e.kind===$.TIME}function Ge(e){return e.kind===$.SYMBOL}function Je(e){return e.kind===$.COMMENT}function Ye(e){if(e.kind!==$.IDENTIFIER)return!1;const t=e.value.toLowerCase();return!(k.has(t)||M.has(t)||R.has(t)||I.has(t))}function Qe(e){return e.kind===$.STRING}function et(e){return e.kind===$.NUMBER}function tt(e){if(e.kind===$.IDENTIFIER){const t=e.value;return"true"===t||"false"===t||"null"===t||"undefined"===t}return!1}function rt(e){return e.kind===$.TEMPLATE}function nt(e){return e.kind===$.SELECTOR&&e.value.startsWith("<")}function it(e){return e.kind===$.SELECTOR&&e.value.startsWith("#")}function at(e){return e.kind===$.SELECTOR&&e.value.startsWith(".")}function st(e){return e.kind===$.SELECTOR&&!e.value.startsWith("#")&&!e.value.startsWith(".")}function ot(e){if(e.kind!==$.OPERATOR)return!1;const t=e.value.toLowerCase();return!q.has(t)&&!N.has(t)}function lt(e){const t=e.value.toLowerCase();return"then"===t||"and"===t||"else"===t||"end"===t||"on"===t}function ct(e,t,r){return{type:"literal",value:e,raw:t,start:r.start,end:r.end,line:r.line,column:r.column}}function ut(e,t){return{type:"identifier",name:e,start:t.start,end:t.end,line:t.line,column:t.column}}function dt(e,t,r,n){return{type:"binaryExpression",operator:e,left:t,right:r,start:n.start,end:n.end,line:n.line,column:n.column}}function mt(e,t){return{type:"block",commands:e,start:t.start,end:t.end,line:t.line,column:t.column}}function pt(e,t){return{type:"string",value:e,start:t.start,end:t.end,line:t.line,column:t.column}}function ht(e,t){return{type:"objectLiteral",properties:e,start:t.start,end:t.end,line:t.line,column:t.column}}function ft(e,t){return{type:"arrayLiteral",elements:e,start:t.start,end:t.end,line:t.line,column:t.column}}function yt(e,t,r){return{type:"propertyOfExpression",property:e,target:t,start:r.start,end:r.end,line:r.line,column:r.column}}function gt(e,t,r){return{type:"command",name:"__ERROR__",args:[],diagnostics:[{message:t,severity:"error",code:"parse-error",line:e.line,column:e.column,...r&&{source:r}}],start:e.start,end:e.end,line:e.line,column:e.column}}const vt=[{command:"append",keywords:["to"],syntax:"append <value> [to <target>]"},{command:"prepend",keywords:["to"],syntax:"prepend <value> [to <target>]"},{command:"make",keywords:["a","an","from","called"],syntax:"make (a|an) <type> [from <args>] [called <name>]"},{command:"throw",keywords:[],syntax:"throw <error>"}];function bt(e,t){return!!e&&t.some(t=>e.value===t||e.value.toLowerCase()===t)}const wt=[e,n,t,r];function kt(e,t=[]){if(e.isAtEnd())return!0;for(const t of wt)if(e.check(t))return!0;for(const r of t)if(e.check(r))return!0;return!!e.checkIsCommand()}function Et(e,t=[]){if(!kt(e,t))return e.parseExpression()}function xt(e,t,r){return!!e.check(t)&&(e.advance(),r.push(e.createIdentifier(t)),!0)}function Ct(e,t,r){for(const n of t)if(e.check(n))return e.advance(),r.push(e.createIdentifier(n)),n;return null}function At(e,t){return!!e.check(t)&&(e.advance(),!0)}function St(e){const t=e.savePosition();let r;if(e.checkIdentifierLike()){const n=e.peek().value;e.advance(),e.check(":")?(e.advance(),r=n):e.restorePosition(t)}const n=e.parseExpression();return void 0!==r?{name:r,value:n}:{value:n}}class Tt{constructor(e){this.args=[],this.isBlocking=!1,this.name=e}static from(e){const t=new Tt(e.value);return t.startPos={start:e.start??0,end:e.end??0,line:e.line??1,column:e.column??1},t}static fromIdentifier(e){const t=new Tt(e.name);return void 0!==e.start&&(t.startPos={start:e.start,end:e.end??0,line:e.line??1,column:e.column??1}),t}static named(e){return new Tt(e)}withArgs(...e){return this.args.push(...e),this}withBody(e){return this.body=e,this}withImplicitTarget(e){return this.implicitTarget=e,this}withModifier(e,t){return this.modifiers||(this.modifiers={}),this.modifiers[e]=t,this}withModifiers(e){return this.modifiers={...this.modifiers,...e},this}withName(e){return this.name=e,this}withOriginalCommand(e){return this.originalCmd=e,this}blocking(e=!0){return this.isBlocking=e,this}startingAt(e){return this.startPos={start:e.start??0,end:e.end??0,line:e.line??1,column:e.column??1},this}endingAt(e){return this.endPos={start:e.start??this.startPos?.start??0,end:e.end,line:e.line??this.startPos?.line??1,column:e.column??this.startPos?.column??1},this}build(){const e={type:"command",name:this.name,args:this.args,isBlocking:this.isBlocking,start:this.startPos?.start??0,end:this.endPos?.end??this.startPos?.end??0,line:this.startPos?.line??1,column:this.startPos?.column??1};return this.body&&(e.body=this.body),this.implicitTarget&&(e.implicitTarget=this.implicitTarget),this.modifiers&&(e.modifiers=this.modifiers),this.originalCmd&&(e.originalCommand=this.originalCmd),e}clone(){const e=new Tt(this.name);return e.args=[...this.args],e.body=this.body?[...this.body]:void 0,e.implicitTarget=this.implicitTarget,e.isBlocking=this.isBlocking,e.modifiers=this.modifiers?{...this.modifiers}:void 0,e.originalCmd=this.originalCmd,e.startPos=this.startPos?{...this.startPos}:void 0,e.endPos=this.endPos?{...this.endPos}:void 0,e}}function Lt(e,t){const r=[];let n="";const i=e.peek().start||0,a=e.peek().line||1,s=e.peek().column||1;if(e.checkIdentifierLike()){for(n=e.advance().value;e.check(":")&&!e.isAtEnd();)e.advance(),n+=":",e.checkIdentifierLike()&&(n+=e.advance().value);if(e.check("(")){e.advance();const t=[];for(;!e.isAtEnd()&&!e.check(")");){const{name:r,value:n}=St(e);if(t.push(void 0!==r?{type:"objectLiteral",properties:[{key:{type:"identifier",name:r},value:n}],start:n.start,end:n.end,line:n.line,column:n.column}:n),e.check(","))e.advance();else if(!e.check(")"))break}e.check(")")&&e.advance(),r.push({type:"functionCall",name:n,args:t,start:i,end:e.getPosition().end,line:a,column:s})}else r.push({type:"string",value:n,start:i,end:e.getPosition().end,line:a,column:s})}const o=[...r];for(;!kt(e);){if(e.check("on")||e.check("to")){const t=e.advance().value;o.push(e.createIdentifier(t));continue}const t=e.savePosition(),r=e.parsePrimary();r&&o.push(r),e.savePosition()===t&&e.advance()}return Tt.fromIdentifier(t).withArgs(...o).endingAt(e.getPosition()).build()}function Ot(e,t){const r=[];if(e.check(b)){const t=e.advance();if(r.push({type:"identifier",name:b,start:t.start,end:t.end,line:t.line,column:t.column}),e.check(y)){const t=e.advance();r.push({type:"identifier",name:y,start:t.start,end:t.end,line:t.line,column:t.column})}}return Tt.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}function jt(i,a){const s=[],o=()=>i.check(r)||a&&i.check(t);for(;!i.isAtEnd()&&!o();){if(Je(i.peek())){i.advance();continue}if(!i.checkIsCommand()&&!i.isCommand(i.peek().value))break;i.advance();const t=i.parseCommand();t&&s.push(t),(i.check(e)||i.check(n)||i.check(","))&&i.advance()}return s}const Pt=new Set(["is","am","are","not","no","and","or","==","===","!=","!==","<",">","<=",">=","+","-","*","/","mod"]);function It(e,t,r){return null!==t&&!Pt.has(t.value?.toLowerCase?.()??"")&&(e.checkIsCommand()||e.isCommand(r.value?.toLowerCase()))}function qt(n,i){const a=[];let s=!1;const o=n.savePosition();let l=null;for(let t=0;500>t&&!n.isAtEnd();t++){const t=n.peek();if(t.value===e){s=!0;break}if(t.value===r||t.value===g||"def"===t.value||t.value===f)break;if(void 0!==t.line&&t.line!==i.line&&It(n,l,t))break;Je(t)||(l=t),n.advance()}n.restorePosition(o);let c=!1;if(!s){const e=n.savePosition(),a=i.line,s=100;let o=!1,l=null;for(;!n.isAtEnd()&&s>n.current-e;){const e=n.peek(),i=e.value?.toLowerCase();if(o&&void 0!==e.line&&e.line!==a)break;if(i===g||"def"===i||i===f)break;if(i===t||i===r){e.line===a&&(c=!0);break}if(It(n,l,e)){if(void 0!==e.line&&e.line!==a){c=!0;break}o=!0}Je(e)||(l=e),n.advance()}n.restorePosition(e)}const u=s||c;let d;if(u)d=n.parseExpression();else{const t=[],r=20;let a=0,s=!0;for(;!n.isAtEnd()&&!n.check(e)&&(s||!n.checkIsCommand()&&!n.isCommand(n.peek().value))&&r>a;){s=!1;const e=n.savePosition();t.push(n.parseLogicalAnd()),n.savePosition()===e&&n.advance(),a++}if(0===t.length)throw Error("Expected condition after if/unless");d=1===t.length?t[0]:{type:"expression",tokens:t,start:t[0].start,end:t[t.length-1].end,line:i.line,column:i.column}}if(a.push(d),u){At(n,e);const s=jt(n,!0);if(0===s.length&&n.isAtEnd())throw Error("Expected command after 'then' in if statement - incomplete conditional");a.push(mt(s,{start:i.start,end:n.getPosition().end,line:i.line,column:i.column}));let o=!1;if(n.check(t))if(n.advance(),n.check("if")){const e=n.peek();n.advance();const t=qt(n,e);a.push(mt([t],{start:e.start,end:n.getPosition().end,line:e.line,column:e.column})),o=!0}else{const e=jt(n,!1);a.push(mt(e,{start:i.start,end:n.getPosition().end,line:i.line,column:i.column}))}o||n.consume(r,"Expected 'end' after if block")}else{if(!n.checkIsCommand()&&!n.isCommand(n.peek().value))throw Error("Expected command after if condition in single-line form");{n.advance();const e=n.parseCommand();a.push(mt([e],{start:i.start,end:n.getPosition().end,line:i.line,column:i.column}))}}return Tt.from(i).withArgs(...a).endingAt(n.getPosition()).build()}function Nt(e,t){const r=[],n={};if(e.checkAnySelector()||e.checkContextVar()||e.match("<")){const t=e.parsePrimary();if(r.push(t),e.match("*")){if(e.checkIdentifierLike()){const t=e.advance();r.push({type:"identifier",name:"*"+t.value,start:t.start-1,end:t.end,line:t.line,column:t.column})}}else if(e.checkIdentifierLike()){const t=e.parsePrimary();r.push(t)}}else if(e.checkIdentifierLike()){const t=e.parsePrimary();r.push(t)}if(e.match("and")&&e.match("set")&&e.checkIdentifierLike()){const t=e.advance();n.set={type:"identifier",name:t.value,start:t.start,end:t.end,line:t.line,column:t.column}}const i=Tt.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition());return Object.keys(n).length>0&&i.withModifiers(n),i.build()}const Rt=new Set(["my","its","your"]);function Mt(e){const t={};if(At(e,i)){const r=e.parseExpression();return r&&(t.for=r),t}if(!e.check(s))return t;e.advance();const r=e.peek();if(!r||!De(r))return t;e.advance();let n=r.value;if(e.check(":")){e.advance();const t=e.peek();t&&De(t)&&(e.advance(),n=`${n}:${t.value}`)}if(t.until={type:"literal",value:n,raw:n},At(e,m)){const r=Et(e);r&&(t.from=r)}return t}function $t(e,t){const r=[],n=Et(e,[m]);n&&r.push(n),xt(e,m,r);const i=Et(e);return i&&r.push(i),Tt.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}function _t(e,t){const r=[];if(e.check("between")){e.advance(),r.push(e.createIdentifier("between"));const a=Et(e,[n]);if(a&&"binaryExpression"===a.type&&"and"===a.operator)a.left&&r.push(a.left),r.push(e.createIdentifier("and")),a.right&&r.push(a.right);else{a&&r.push(a),xt(e,n,r);const t=Et(e,[m,f,i]);t&&r.push(t)}if(Ct(e,[m,f],r)){const t=Et(e);t&&r.push(t)}return Tt.fromIdentifier(t).withArgs(...r).withModifiers(Mt(e)).endingAt(e.getPosition()).build()}const a=Et(e,[m,f]);if(a&&r.push(a),Ct(e,[m,f],r)){const t=Et(e);t&&r.push(t)}return e.check("modal")&&(e.advance(),r.push({type:"literal",value:"modal",raw:"modal"})),Tt.fromIdentifier(t).withArgs(...r).withModifiers(Mt(e)).endingAt(e.getPosition()).build()}function zt(e,t){if(!e.check("using"))return!1;if(e.advance(),!e.match("view"))throw Error("expected 'view transition' after 'using'");if(!e.match("transition"))throw Error("expected 'transition' after 'using view'");return t.push(e.createIdentifier("using")),t.push(e.createIdentifier("view")),t.push(e.createIdentifier("transition")),!0}function Vt(e,t){const n=e.parseExpression();if(!n)return e.addError("Put command requires content expression"),null;const i=e.peek();if(!i||!A.includes(i.value))return e.addError(`Expected operation keyword (${A.join(", ")}) after put expression, got: ${i?.value}`),null;let a=e.advance().value;const s=a.toLowerCase();"at start of"===s||"at the start of"===s?a=x:"at end of"===s||"at the end of"===s?a=C:"at"===a&&(e.check(w)||e.check(b)?(At(e,b),e.check(w)&&(e.advance(),e.check(h)&&(e.advance(),a=x))):e.check(r)&&(e.advance(),e.check(h)&&(e.advance(),a=C)));const o=e.parseExpression();return o?Tt.fromIdentifier(t).withArgs(n,e.createIdentifier(a),o).endingAt(e.getPosition()).build():(e.addError("Put command requires target expression after operation keyword"),null)}const Ht=["innerhtml","outerhtml","into","over","delete","morph","morphouter"];function Bt(i,a){const s=i.savePosition();let o=null,l=[];try{o=function(e){if(!e.check(":"))return null;if(e.advance(),e.check(":")){e.advance();const t=e.advance();return{type:"identifier",name:t.value,scope:"global",start:t.start-2,end:t.end}}const t=e.advance();return{type:"identifier",name:t.value,scope:"element",start:t.start-1,end:t.end}}(i)??function(e){if(!e.check(v)&&!e.check("local"))return null;const t=e.advance(),r=e.advance();return{type:"identifier",name:r.value,scope:t.value,start:t.start,end:r.end}}(i)??function(e){if(!e.check(b))return null;const t=e.savePosition();e.advance();const r=e.parseExpression();if(!r)return e.restorePosition(t),null;if("binaryExpression"===r.type&&r.operator===h){const e=r.left,t=r.right;return yt(e,t,{start:e.start??0,end:t.end??0,line:e.line??1,column:e.column??1})}return e.check(d)?r:(e.restorePosition(t),null)}(i),o||(o=i.parseExpression())}catch{i.restorePosition(s),o=null}if(!o){const a=function(i){if(i.match(":")){const e=i.advance();return{expression:{type:"identifier",name:e.value,scope:"element",start:e.start,end:e.end},tokens:[]}}const a=[];for(;!(i.isAtEnd()||i.check(d)||i.check(e)||i.check(n)||i.check(t)||i.check(r));)a.push(i.parsePrimary());if(0===a.length)return{expression:null,tokens:[]};if(a.length>=4){const e=(e,t)=>e[t];if(e(a[0],"value")===b&&e(a[2],"value")===h){const t=a[1],r=a[3];return{expression:yt(ut(e(t,"value")||e(t,"name")||"",{start:t.start??0,end:t.end??0,line:t.line??1,column:t.column??1}),{type:"idSelector"===r.type?"idSelector":"cssSelector",value:e(r,"value")||e(r,"name")||"",start:r.start??0,end:r.end??0,line:r.line,column:r.column},{start:a[0].start??0,end:r.end??0,line:a[0].line??1,column:a[0].column??1}),tokens:[]}}}return 1===a.length?{expression:a[0],tokens:[]}:{expression:null,tokens:a}}(i);o=a.expression,l=a.tokens}if(!i.check(d)){const e=i.isAtEnd()?"end of input":i.peek().value;throw Error("Expected 'to' in set command, found: "+e)}i.advance();const c=i.parseExpression()??i.parsePrimary();let u;var m;i.check(f)&&(m=i.peekAt(1))&&("selector"===m.kind||m.value.startsWith("<")||Wt.has(m.value))&&(i.advance(),u=Et(i));const p=[];o?p.push(o):l.length>0&&p.push(...l),p.push(i.createIdentifier(d)),c&&p.push(c);const y=Tt.fromIdentifier(a).withArgs(...p);return u&&y.withModifier("on",u),y.endingAt(i.getPosition()).build()}const Wt=new Set(["me","my","it","its","you","your","yourself"]),Dt=new Set(["to","the","url","of","in","new","window","top","middle","bottom","left","center","right","smoothly","instantly","back","forward"]);function Ft(e,t){return{type:"string",value:e,start:t.start,end:t.end,line:t.line,column:t.column}}function Ut(e,t){const r=[];for(;!kt(e,["catch","finally"])&&(e.checkIdentifierLike()||e.checkSelector()||e.checkLiteral()||e.checkTimeExpression()||e.match("<"));)r.push(e.parsePrimary());return Tt.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}function Kt(e){const t=e.peek();if("/"===t.value)return!0;if(e.checkIdentifierLike()){const r=e.peekAt(1);return!!r&&":"===r.value&&r.start===t.end}return!1}const Zt=new Set(["{",")"]);function Xt(e){const t=e.savePosition(),r=e.peek();let n="",i=null;for(;!e.isAtEnd();){const t=e.peek();if(i&&t.start!==i.end)break;if("$"===t.value&&"{"===e.peekAt(1)?.value){e.advance();let r=e.advance(),a=1;for(;!e.isAtEnd()&&a>0;)r=e.advance(),"{"===r.value?a++:"}"===r.value&&a--;n+=e.getInputSlice(t.start,r.end),i=r;continue}if(Zt.has(t.value))break;i=e.advance(),n+=i.value}if(!n||"/"===n)return e.restorePosition(t),null;const a={start:r.start,end:i?i.end:r.end,line:r.line,column:r.column};return n.includes("${")?{type:"templateLiteral",value:n,...a}:{type:"literal",value:n,raw:n,...a}}function Gt(e){if(e.check("{"))return!1;if(!e.checkIdentifierLike())return!1;const t=e.peekAt(1);return null!==t&&":"===t.value}function Jt(e){const t=[],r=e.getPosition();do{if(!e.checkIdentifierLike())break;const r=e.advance(),n={type:"identifier",name:r.value,start:r.start,end:r.end,line:r.line,column:r.column};e.consume(":","Expected ':' after property name in fetch named arguments");const i=e.parsePrimary();i&&t.push({key:n,value:i})}while(e.match(",")&&!e.isAtEnd());const n=e.getPosition();return{type:"objectLiteral",properties:t,start:r.start,end:n.end,line:r.line,column:r.column}}const Yt=new Set(["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","pc","pt","px"]);class Qt{constructor(e,t,r){this.current=0,this.errors=[],this.warnings=[],this.prattCache=new Map,this.tokens=e,this.keywordResolver=t?.keywords,this.registryIntegration=t?.registryIntegration,t?.semanticAnalyzer&&t?.language&&(this.semanticAdapter=new ve({analyzer:t.semanticAnalyzer,language:t.language,confidenceThreshold:t.semanticConfidenceThreshold??.5})),this.originalInput=r||e.map(e=>e.value).join(" ")}resolveKeyword(e){return this.keywordResolver?this.keywordResolver.resolve(e)??e:e}addWarning(e){this.warnings.push(e)}parse(){this.prattCache.clear();const e=this.parseInternal();return this.errors.length>0&&(e.errors=[...this.errors],e.recovered=!0),e}parseInternal(){try{if(0===this.tokens.length)return this.addError("Cannot parse empty input"),{success:!1,node:this.createErrorNode(),tokens:this.tokens,error:this.error,warnings:this.warnings};if(this.check("behavior")){const e=[];for(;this.check("behavior");){this.advance();const t=this.parseBehaviorDefinition();if(t&&e.push(t),this.error)break}return this.error?{success:!1,node:1===e.length?e[0]:this.createProgramNode(e),tokens:this.tokens,error:this.error,warnings:this.warnings}:{success:!0,node:1===e.length?e[0]:this.createProgramNode(e),tokens:this.tokens,warnings:this.warnings}}const e=this.peek(),t=e&&qe(e.value)?e.value:null;if(this.check("init")||this.check("on")||this.check("def")||this.checkComment()||null!==t){const e=[];for(;!this.isAtEnd();)if(this.checkComment())this.advance();else{if(this.check("then")){const e=this.peekAt(1);if(null!==e&&("init"===e.value||"on"===e.value||"def"===e.value||void 0!==qe(e.value))){this.advance();continue}}if(this.check("init")){this.advance();const t=this.parseTopLevelInitBlock();t&&e.push(t)}else if(this.check("on")){this.advance();const t=this.parseEventHandler();t&&e.push(t)}else{if(!this.check("def")){const t=this.peek(),r=t?qe(t.value):void 0;if(r){const t=this.advance(),n=r(this.getContext(),t);n&&e.push(n);continue}break}{this.advance();const t=this.parseDefFeature();t&&e.push(t)}}}return this.isAtEnd()?this.error?{success:!1,node:this.createProgramNode(e),tokens:this.tokens,error:this.error,warnings:this.warnings}:{success:!0,node:this.createProgramNode(e),tokens:this.tokens,warnings:this.warnings}:(this.addError("Unexpected token: "+this.peek().value),{success:!1,node:this.createProgramNode(e),tokens:this.tokens,error:this.error,warnings:this.warnings})}if(this.checkIsCommand()||this.isCommand(this.peek().value)&&!this.isKeyword(this.peek().value)){const e=this.parseCommandSequence();if(e){if(!this.isAtEnd()&&this.check("on")){pe("\u2705 PARSER: Found event handlers after command sequence, parsing as program");const t=[e];pe(`\u2705 PARSER: Starting with ${t.length} statement(s) from command sequence`);let r=0;for(;!this.isAtEnd()&&this.check("on");){pe(`\u2705 PARSER: Parsing event handler #${r+1}, current token: ${this.peek().value}`),this.advance();const e=this.parseEventHandler();if(pe("\u2705 PARSER: parseEventHandler returned:",e?`type=${e.type}, event=${e.event}`:"null"),e&&(t.push(e),r++,pe(`\u2705 PARSER: Added event handler, now have ${t.length} statements total`)),pe(`\u2705 PARSER: After parsing event handler, current token: ${this.isAtEnd()?"END":this.peek().value}, isAtEnd=${this.isAtEnd()}, check('on')=${this.check("on")}`),!this.isAtEnd()&&!this.check("on")){if(!this.isAtEnd())return pe("\u26a0\ufe0f PARSER: Unexpected token after event handlers: "+this.peek().value),this.addError("Unexpected token after event handlers: "+this.peek().value),{success:!1,node:this.createProgramNode(t),tokens:this.tokens,error:this.error};pe("\u2705 PARSER: No more event handlers, at end of input");break}}return pe(`\u2705 PARSER: Finished parsing, creating Program node with ${t.length} statements`),this.error?{success:!1,node:this.createProgramNode(t),tokens:this.tokens,error:this.error,warnings:this.warnings}:{success:!0,node:this.createProgramNode(t),tokens:this.tokens,warnings:this.warnings}}return this.isAtEnd()?this.error?{success:!1,node:e,tokens:this.tokens,error:this.error,warnings:this.warnings}:{success:!0,node:e,tokens:this.tokens,warnings:this.warnings}:(this.addError("Unexpected token: "+this.peek().value),{success:!1,node:e||this.createErrorNode(),tokens:this.tokens,error:this.error})}}const r=this.parseExpression();if(this.error)return{success:!1,node:r||this.createErrorNode(),tokens:this.tokens,error:this.error};if(!this.isAtEnd()){const e=this.peek();return r&&["number","string","identifier"].includes(e.kind)?this.addError(`Unexpected token: ${e.value} (missing operator between values? expected one of +, -, *, /, etc.)`):this.addError("Unexpected token: "+e.value),{success:!1,node:r||this.createErrorNode(),tokens:this.tokens,error:this.error,warnings:this.warnings}}return{success:!0,node:r,tokens:this.tokens,warnings:this.warnings}}catch(e){return this.addError(e instanceof Error?e.message:"Unknown parsing error"),{success:!1,node:this.createErrorNode(),tokens:this.tokens,error:this.error,warnings:this.warnings}}}parseExpression(){return this.parseExpressionPratt(0)}parseExpressionPratt(e){const t=`${this.current}:${e}`,r=this.prattCache.get(t);if(r)return this.current=r.endPos,r.node;if(this.isAtEnd())return this.addError("Unexpected end of expression"),this.createErrorNode();const n=this.peek(),i=Qt.PRATT_TABLE.get(n.value);let a;if(i?.prefix){const e=this.advance();if(this.isAtEnd())return this.addError(`Expected expression after '${e.value}' operator`),this.createErrorNode();a=i.prefix.handler(e,this.makePrattContext())}else a=this.parseCall();for(;!this.isAtEnd();){const t=this.peek();if(60>=e){const e=this.tryParseStringPostfix(a,t);if(e){a=e;continue}}const r=Qt.PRATT_TABLE.get(t.value);if(!r?.infix){if(be.has(t.value)||we.has(t.value))break;break}const[n]=r.infix.bp;if(e>n)break;if("="===t.value&&this.tokens.length>this.current+1&&">"===this.tokens[this.current+1].value){if(this.advance(),this.advance(),this.addError('Arrow functions (=>) are not supported in hyperscript. Use "js ... end" blocks for JavaScript callbacks.'),!this.isAtEnd())try{this.parseExpressionPratt(0)}catch(e){pe("arrow body discarded after error:",e instanceof Error?e.message:e+"")}return this.createErrorNode()}if("+"===t.value||"-"===t.value){const e=this.tokens.length>this.current+1?this.tokens[this.current+1]:null;if(e&&("+"===e.value||"-"===e.value))return this.addError(`Invalid operator combination: ${t.value}${e.value}`),a}if("*"===t.value||"/"===t.value||"%"===t.value){const e=this.tokens.length>this.current+1?this.tokens[this.current+1]:null;if(e&&("*"===e.value||"/"===e.value||"%"===e.value||"+"===e.value||"-"===e.value))return this.addError("*"===t.value&&"*"===e.value?"Unexpected token: "+e.value:`Invalid operator combination: ${t.value}${e.value}`),a}const i=this.advance();if(this.isAtEnd()&&!Qt.POSTFIX_UNARY_OPERATORS.has(i.value))return this.addError(`Expected expression after '${i.value}' operator`),a;a=r.infix.handler(a,i,this.makePrattContext())}return this.prattCache.set(t,{node:a,endPos:this.current}),a}tryParseStringPostfix(e,t){const r=t.value;let n=null;if(Yt.has(r)?n=r:"%"===r&&(this.canStartOperand(this.tokens.length>this.current+1?this.tokens[this.current+1]:null)||(n="%")),null==n)return null;const i=this.advance();return{type:"stringPostfix",expression:e,unit:n,start:e.start,end:i.end,line:e.line,column:e.column}}canStartOperand(e){if(!e)return!1;const t=e.value;return!be.has(t)&&!we.has(t)&&("number"===e.kind||"string"===e.kind||"identifier"===e.kind||"symbol"===e.kind||["(","[","{","-","+","!","#",".","<","$","@"].includes(t))}makePrattContext(){const e=this;return{peek:()=>e.tokens.length>e.current?e.tokens[e.current]:void 0,advance:()=>{const t=e.tokens[e.current];return e.current++,t},parseExpr:t=>e.parseExpressionPratt(t),isStopToken:()=>{const t=e.tokens[e.current];return!t||be.has(t.value)||we.has(t.value)},atEnd:()=>e.current>=e.tokens.length}}parseLogicalAnd(){return this.parseExpressionPratt(11)}parseImplicitBinary(){let e=this.parseCall();for(;!(this.isAtEnd()||this.checkBasicOperator()||this.check("then")||this.check("and")||this.check("else")||this.check(")")||this.check("]")||this.check(","));){if("identifier"!==e.type){if("literal"===e.type&&(this.checkNumber()||this.checkIdentifier())){const t=this.peek();return this.addError(`Missing operator between '${e.raw||e.value}' and '${t.value}'`),e}break}if(this.isCommand(e.name))if(this.isCompoundCommand(e.name.toLowerCase())){if(!(this.checkCssSelector()||this.checkIdSelector()||this.checkClassSelector()||this.checkTimeExpression()||this.checkString()||this.checkNumber()||this.checkContextVar()||this.checkIdentifier()||this.checkKeyword()))break;{const t=this.createCommandFromIdentifier(e);t&&(e=t)}}else if("wait"===e.name.toLowerCase()&&(this.checkTimeExpression()||this.checkNumber()||this.checkIdentifier()||this.checkContextVar()||this.check("("))){const t=this.createCommandFromIdentifier(e);t&&(e=t)}else{if(!this.checkSelector())break;{const t=this.parseCall();e=this.createBinaryExpression(" ",e,t)}}else{if(!this.checkSelector())break;{const t=this.parseCall();e=this.createBinaryExpression(" ",e,t)}}}return e}isCommand(e){return this.keywordResolver?this.keywordResolver.isCommand(e):T(e)}isKeyword(e){return this.keywordResolver?this.keywordResolver.isKeyword(e):O(e)}createCommandFromIdentifier(e){const t=[],r=this.resolveKeyword(e.name.toLowerCase());if(this.isCompoundCommand(r))return this.parseCompoundCommand(e);for(;!(this.isAtEnd()||this.check("then")||this.check("and")||this.check("else")||this.checkIsCommand())&&(this.checkContextVar()||this.checkIdentifier()||this.checkKeyword()||this.checkEvent()||this.checkCssSelector()||this.checkIdSelector()||this.checkClassSelector()||this.checkString()||this.checkNumber()||this.checkTimeExpression()||this.match("<"));)t.push(this.parsePrimary());return{type:"command",name:e.name,args:t,isBlocking:!1,...void 0!==e.start&&{start:e.start},end:this.getPosition().end,...void 0!==e.line&&{line:e.line},...void 0!==e.column&&{column:e.column}}}isCompoundCommand(e){return L(e)}parseCompoundCommand(a){return function(a,s){switch(s.name.toLowerCase()){case"put":return Vt(a,s);case"trigger":case"send":return Lt(a,s);case"remove":return $t(a,s);case"take":return function(e,t){const r=[],n={},a=Et(e,[m,i]);if(a&&r.push(a),e.check(m)){xt(e,m,r);const t=Et(e,[i]);t&&r.push(t)}if(At(e,i)){const t=Et(e);t&&(n.for=t)}return Tt.fromIdentifier(t).withArgs(...r).withModifiers(n).endingAt(e.getPosition()).build()}(a,s);case"toggle":return _t(a,s);case"set":return Bt(a,s);case"halt":return Ot(a,s);case"measure":return Nt(a,s);case"js":return function(e,t){const n=[];if(e.match("(")){for(;!e.check(")")&&!e.isAtEnd();)e.checkIdentifierLike()&&n.push(e.advance().value),e.match(",");e.consume(")","Expected ) after js parameters")}const i=e.peek().start,a=function(e,t){const r=e.getInputSlice(t);if(!r)return t;let n=0;for(;r.length>n;){const e=r[n];if("'"!==e&&"\u2019"!==e&&"\u2018"!==e)if('"'!==e)if("`"!==e)if("/"===e&&r.length>n+1&&"/"===r[n+1])for(n+=2;r.length>n&&"\n"!==r[n];)n++;else if("/"===e&&r.length>n+1&&"*"===r[n+1]){for(n+=2;r.length>n&&("*"!==r[n]||n+1>=r.length||"/"!==r[n+1]);)n++;n+=2}else{if(!("e"!==e&&"E"!==e||n+3>r.length||"end"!==r.slice(n,n+3).toLowerCase()||0!==n&&/[a-zA-Z0-9_]/.test(r[n-1])||r.length>n+3&&/[a-zA-Z0-9_]/.test(r[n+3])))return t+n;n++}else{for(n++;r.length>n&&"`"!==r[n];)"\\"===r[n]&&n++,n++;n++}else{for(n++;r.length>n&&'"'!==r[n];)"\\"===r[n]&&n++,n++;n++}else{for(n++;r.length>n&&r[n]!==e;)"\\"===r[n]&&n++,n++;n++}}return t+r.length}(e,i);for(;!e.isAtEnd()&&!e.check(r)&&e.peek().start<a;)e.advance();e.consume(r,"Expected end after js code body");const s={type:"literal",value:e.getInputSlice(i,a).trim(),start:t.start,end:e.getPosition().end},o={type:"arrayLiteral",elements:n.map(e=>({type:"literal",value:e,start:t.start,end:t.end})),start:t.start,end:e.getPosition().end};return Tt.fromIdentifier(t).withArgs(s,o).endingAt(e.getPosition()).build()}(a,s);case"go":return function(e,t){const r=[];for(;!kt(e,["when","where","catch","finally"]);){const t=e.peek(),n=e.resolveKeyword(t.value).toLowerCase();if(Dt.has(n)){e.advance(),r.push(Ft(n,t));continue}if(Kt(e)){const n=Xt(e);if(n){r.push(n);continue}e.advance(),r.push(Ft(t.value,t));continue}if("+"===t.value||"-"===t.value){e.advance(),r.push(Ft(t.value,t));continue}if("number"===t.kind){e.advance();const n=e.peek();if(e.isAtEnd()||"px"!==n.value||n.start!==t.end)r.push({type:"literal",value:Number(t.value),raw:t.value,start:t.start,end:t.end,line:t.line,column:t.column});else{const n=e.advance();r.push(Ft(t.value+"px",{...t,end:n.end}))}continue}const i=e.current;if(r.push(e.parsePrimary()),e.current===i)break}return Tt.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}(a,s);case"tell":return function(i,a){const s=i.parseExpression();if(!s)throw Error("tell command requires a target expression");i.check(d)&&i.advance();const o=[];for(;!i.isAtEnd();){if(i.checkIsCommand()){try{i.advance();const e=i.parseCommand();if(!e)break;o.push(e)}catch{break}if(i.match(n)||i.match(e))continue;if(i.check(t))break;if(i.check(r)){i.advance();break}if(i.checkIsCommand())continue;break}break}if(0===o.length)throw Error("tell command requires at least one command after the target");return Tt.fromIdentifier(a).withArgs(s,...o).endingAt(i.getPosition()).build()}(a,s);case"pick":return function(e,t){const r=Tt.fromIdentifier(t);At(e,b);const n=e.peek().value,i=e=>({type:"literal",value:e,start:t.start,end:t.end}),a=()=>{if(!e.match("of","from"))throw Error("pick: expected 'of' or 'from' before source expression");return e.parseExpression()};if("first"===n){e.advance();const t=e.parsePrimary(),n=a();return r.withArgs(n).withModifier("variant",i("first")).withModifier("count",t).endingAt(e.getPosition()).build()}if("last"===n){e.advance();const t=e.parsePrimary(),n=a();return r.withArgs(n).withModifier("variant",i("last")).withModifier("count",t).endingAt(e.getPosition()).build()}if("random"===n){let t;e.advance(),e.check("of")||e.check("from")||(t=e.parsePrimary());const n=a(),s=r.withArgs(n).withModifier("variant",i("random"));return t&&s.withModifier("count",t),s.endingAt(e.getPosition()).build()}if("item"===n||"items"===n||"character"===n||"characters"===n){let t,n;e.advance(),e.match("at","from"),t=e.match("start")?i("start"):e.parsePrimary();let s=!1;(e.match("to")||e.match(".."))&&(e.match("end")?s=!0:n=e.parsePrimary());let o="default";e.match("inclusive")?o="inclusive":e.match("exclusive")&&(o="exclusive");const l=a(),c=r.withArgs(l).withModifier("variant",i("range")).withModifier("rangeStart",t).withModifier("rangeMode",i(o));return s?c.withModifier("rangeEnd",i("end")):n&&c.withModifier("rangeEnd",n),c.endingAt(e.getPosition()).build()}if("match"===n||"matches"===n){e.advance(),e.match("of");const t=e.parsePrimary();let s;e.matchOperator("|")&&(s=e.advance().value);const o=a(),l=r.withArgs(o).withModifier("variant",i("match"===n?"match":"matches")).withModifier("regex",t);return s&&l.withModifier("flags",i(s)),l.endingAt(e.getPosition()).build()}return Ut(e,t)}(a,s);case"start":return function(e,t){if(!e.match("view"))throw Error("start: expected 'view transition' (only `start view transition ... end` is supported)");if(!e.match("transition"))throw Error("start view: expected 'transition'");const r={};if(e.match("using")){const t=e.parsePrimary();r.transitionName=t}const n=e.parseCommandListUntilEnd("start view transition");return Tt.fromIdentifier(t).withArgs(...n).withModifiers(r).endingAt(e.getPosition()).build()}(a,s);case"swap":case"morph":return function(e,t){const r=[];let n=null;if(!e.isAtEnd()){const t=e.peek();if(t&&t.value){const i=t.value.toLowerCase();Ht.includes(i)&&(n=i,e.advance(),r.push(e.createIdentifier(n)))}}if("delete"===n){const n=e.parseExpression();return n&&r.push(n),Tt.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}!e.isAtEnd()&&e.check(h)&&(e.advance(),r.push(e.createIdentifier("of")));const i=e.parseExpression();if(i&&r.push(i),!e.isAtEnd()&&e.check(p)){e.advance(),r.push(e.createIdentifier("with"));const t=e.parseExpression();t&&r.push(t)}return zt(e,r),Tt.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}(a,s);case"process":return function(e,t){if(!e.check("partials"))return null;const r=[];if(xt(e,"partials",r),xt(e,u,r)){const t=Et(e,["using"]);t&&r.push(t)}return zt(e,r),Tt.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}(a,s)??Ut(a,s);default:return Ut(a,s)}}(this.getContext(),a)}parsePutCommand(e){return Vt(this.getContext(),e)}parseSetCommand(e){return Bt(this.getContext(),e)}parseHaltCommand(e){return Ot(this.getContext(),e)}parseMeasureCommand(e){return Nt(this.getContext(),e)}parseTriggerCommand(e){return Lt(this.getContext(),e)}parseCommandListUntilTerminator(e){const t=[],r=()=>this.check("end")||e.some(e=>this.check(e));for(pe("\ud83d\udd04 parseCommandListUntilTerminator: Starting (extraStops:",e.join(","),")");!this.isAtEnd()&&!r();){pe("\ud83d\udccd Loop iteration, current token:",this.peek().value,"kind:",this.peek().kind);let e=!1;const n=this.checkIsCommand(),i=!n&&this.checkIdentifier()&&this.isCommand(this.peek().value);if(n||i){pe(n?"\u2705 Found COMMAND token:":"\u2705 Found IDENTIFIER that is a command:",this.peek().value),this.advance();const r=this.error;try{const n=this.parseCommand();this.error&&this.error!==r&&(pe("\u26a0\ufe0f parseCommandListUntilTerminator: Command parsing added error, restoring. Error was:",this.error.message),this.error=r),n&&(pe("\u2705 Parsed command:",n.name),t.push(n),e=!0)}catch(e){pe("\u26a0\ufe0f parseCommandListUntilTerminator: Command parsing threw, restoring:",e instanceof Error?e.message:e+""),this.error=r}}else this.checkIdentifier()&&pe("\u274c IDENTIFIER is not a command:",this.peek().value);if(!e){pe("\u274c No command parsed, breaking. Current token:",this.peek().value);break}for(pe("\ud83d\udccd After parsing command, current token:",this.peek().value);!(this.isAtEnd()||r()||this.checkIsCommand()||this.isCommand(this.peek().value)||this.check("then")||this.check("and")||this.check(","));)pe("\u26a0\ufe0f Skipping unexpected token:",this.peek().value),this.advance();if(this.match("then","and",","))pe("\u2705 Found separator, continuing");else{if(!this.checkIsCommand()&&!this.isCommand(this.peek().value)){pe("\ud83d\udccd No separator and no command, breaking. Current token:",this.peek().value);break}pe("\u2705 Next token is a command, continuing without separator")}}let n="end";for(const t of e)if(this.check(t)){n=t;break}return this.check("end")||e.some(e=>this.check(e))||(n=""),pe("\u2705 parseCommandListUntilTerminator: parsed",t.length,"commands (terminator:",n,")"),{commands:t,terminator:n}}parseCommandListUntilEnd(e="repeat"){const{commands:t}=this.parseCommandListUntilTerminator([]);if(pe('\ud83d\udd0d After loop, checking for "end". Current token:',this.peek().value),!this.check("end"))throw pe('\u274c ERROR: Expected "end" but got:',this.peek().value,"at position:",this.peek().start),Error(`Expected "end" to close ${e} block`);return pe('\u2705 Found "end", consuming it'),this.advance(),t}parseCommandListUntilEndOrElse(){const{commands:e,terminator:t}=this.parseCommandListUntilTerminator(["else"]),r="else"===t;if(!r){if(!this.check("end"))throw Error('Expected "end" to close repeat block');this.advance()}return{commands:e,hasElse:r}}parseRepeatBody(){const{commands:e,terminator:t}=this.parseCommandListUntilTerminator(["else","until","while"]);if("end"===t)this.advance();else if(""===t)throw Error('Expected "end", "else", "until", or "while" to close repeat block');return{commands:e,terminator:t}}parseRepeatCommand(e){return function(e,t){const r=[];let n="forever",d=null,h=null,f=null,g=null,v=null,w=null;if(e.check(i)){e.advance(),n=i;const t=e.peek();De(t)&&(v=t.value,e.advance()),e.check(u)&&(e.advance(),g=e.parseExpression())}else if(e.check(u))e.advance(),n=i,v="it",g=e.parseExpression();else if(e.check(a))e.advance(),n=a,f=e.parseExpression();else if(e.check(s))if(e.advance(),n=s,e.check(y)){e.advance(),n="until-event";const t=e.peek();if(pe("\ud83d\udccd Parsing event name, current token:",{value:t.value,kind:t.kind}),!De(t)&&!He(t))throw Error('Expected event name after "event"');if(d=t.value,e.advance(),pe("\u2705 Got event name:",d,"Next token:",e.peek().value),pe('\ud83d\udd0d Checking for "from", current token:',e.peek().value),e.check(m)){pe('\u2705 Found "from", advancing...'),e.advance(),pe('\ud83d\udccd After consuming "from", current token:',e.peek().value),At(e,b)&&pe('\u2705 Found "the", advancing...');const t=e.peek();pe("\ud83d\udd0d Before parsePrimary for event target:",{value:t.value,kind:t.kind,position:t.start}),h=e.parsePrimary(),pe("\u2705 After parsePrimary, eventTarget:",h)}else pe('\u274c No "from" found, skipping target parsing')}else f=e.parseExpression();else e.check(o)?(e.advance(),n=o):(w=e.parseExpression(),e.check(l)&&(e.advance(),n=l));let k,E=null;if(e.check(p)){const t=e.peekAt(1);t&&t.value.toLowerCase()===c&&(e.advance(),e.advance(),E=c)}else if(e.check(c)){e.advance();const t=e.peek();De(t)?(E=t.value,e.advance()):E=c}let x=null,C=!1;if(n===o){const t=e.parseRepeatBody();if(k=t.commands,"else"===t.terminator)e.advance(),x=e.parseCommandListUntilEnd();else if("until"===t.terminator||"while"===t.terminator){if(C=!0,n=t.terminator,e.advance(),f=e.parseExpression(),!e.check("end"))throw Error('Expected "end" to close repeat block');e.advance()}}else{const t=e.parseCommandListUntilEndOrElse();k=t.commands,t.hasElse&&(e.advance(),x=e.parseCommandListUntilEnd())}r.push({type:"identifier",name:n,start:t.start,end:t.end,line:t.line,column:t.column});const A={start:t.start,end:t.end,line:t.line,column:t.column};v&&r.push(pt(v,A)),g&&r.push(g),f&&r.push(f),w&&r.push(w),d&&r.push(pt(d,A)),h&&r.push(h),E&&r.push(pt(E,A)),r.push(mt(k,{...A,end:A.end||0})),null!==x&&r.push(mt(x,{...A,end:A.end||0}));const S=Tt.from(t).withArgs(...r);return C&&S.withModifier("bottomTested",{type:"literal",value:!0,...A}),S.endingAt(e.getPosition()).build()}(this.getContext(),e)}parseForCommand(e){return function(e,t){const r=[];let n=null,i=null;e.check("each")&&e.advance();const a=e.peek();if(!De(a))throw Error('Expected variable name after "for"');if(n=a.value,e.advance(),!e.check(u))throw Error('Expected "in" after variable name in for loop');if(e.advance(),i=e.parseExpression(),!i)throw Error('Expected collection expression after "in"');let s=null;if(e.check(p)){const t=e.peekAt(1);t&&t.value.toLowerCase()===c&&(e.advance(),e.advance(),s=c)}else if(e.check(c)){e.advance();const t=e.peek();De(t)?(s=t.value,e.advance()):s=c}const o=e.parseCommandListUntilEnd("for");r.push({type:"identifier",name:"for",start:t.start,end:t.end,line:t.line,column:t.column});const l={start:t.start,end:t.end,line:t.line,column:t.column};return r.push(pt(n,l)),r.push(i),s&&r.push(pt(s,l)),r.push(mt(o,{...l,end:l.end||0})),Tt.from({...t,value:"repeat"}).withArgs(...r).endingAt(e.getPosition()).build()}(this.getContext(),e)}parseWaitCommand(e){return function(e,t){const r=[];if(e.checkTimeExpression()||e.checkLiteral()||e.checkContextVar()||e.check("(")||e.checkIdentifierLike()&&!e.check("for")&&!kt(e)){const n=e.parseExpression();return r.push(n),Tt.from(t).withArgs(...r).blocking().endingAt(e.getPosition()).build()}if(e.check("for")){e.advance();const n=[];do{if(e.checkTimeExpression()||e.checkLiteral()||e.check("(")){if(n.push({kind:"duration",expr:e.parseExpression()}),e.check("or")){e.advance();continue}break}const t=e.peek();if(!De(t))throw Error('Expected event name or duration after "for"');const r=t.value;e.advance();const i=[];if(e.check("(")){for(e.advance();!e.isAtEnd()&&!e.check(")");){const t=e.peek();if(!De(t))break;i.push(t.value),e.advance(),e.check(",")&&e.advance()}if(!e.check(")"))throw Error('Expected ")" after event parameters');e.advance()}if(n.push({kind:"event",name:r,params:i}),!e.check("or"))break;e.advance()}while(!e.isAtEnd());let i=null;e.check(m)&&(e.advance(),At(e,b),i=e.parsePrimary());const a={start:t.start,end:e.getPosition().end,line:t.line,column:t.column};r.push(ft(n.map(e=>ht("duration"===e.kind?[{key:ut("duration",a),value:e.expr}]:[{key:ut("name",a),value:ct(e.name,`"${e.name}"`,a)},{key:ut("args",a),value:ft(e.params.map(e=>ct(e,`"${e}"`,a)),a)}],a)),a)),i&&r.push(i)}return Tt.from(t).withArgs(...r).blocking().endingAt(e.getPosition()).build()}(this.getContext(),e)}parseInstallCommand(e){return function(e,t){const r=[];if(!e.checkIdentifierLike())throw Error('Expected behavior name after "install"');const n=e.advance().value,i=e.previous();if(r.push(ut(n,{start:i.start,end:i.end,line:i.line,column:i.column})),e.check("(")){e.advance();const n=[];for(;!e.isAtEnd()&&!e.check(")");)if(n.push(St(e)),e.check(","))e.advance();else if(!e.check(")"))break;if(!e.check(")"))throw Error('Expected ")" after behavior parameters');if(e.advance(),n.length>0){const i={start:t.start,end:e.getPosition().end,line:t.line,column:t.column};r.push(ht(n.map(e=>({key:e.name?ut(e.name,i):ct("_positional","_positional",i),value:e.value})),i))}}return Tt.from(t).withArgs(...r).endingAt(e.getPosition()).build()}(this.getContext(),e)}parseTransitionCommand(e){return function(e,t){const r=[],n={};let i=null,a=null;const s=e.peek();if(e.checkAnySelector()||e.checkContextVar()||e.check("<")||De(s)&&Rt.has(s.value)){const t=e.parsePrimary();("possessiveExpression"===t.type||"memberExpression"===t.type&&!t.computed)&&t.object&&t.property?.name?(a=t.object,i={type:"string",value:t.property.name,start:s.start||0,end:e.getPosition().end,line:s.line,column:s.column}):(a=t,e.check("'s")&&e.advance())}const o=e.peek();if(!i&&(De(o)||"*"===o.value)){let t="";e.check("*")&&(t="*",e.advance());const r=function(e){if(!e.checkIdentifierLike())return"";let t=e.advance().value;for(;e.check("-")&&!e.isAtEnd();)t+="-",e.advance(),e.checkIdentifierLike()&&(t+=e.advance().value);return t}(e);r&&(t+=r,i={type:"string",value:t,start:o.start||0,end:e.getPosition().end,line:o.line,column:o.column})}if(!i)throw Error("Transition command requires a CSS property");if(a&&r.push(a),r.push(i),!e.check(d))throw Error('Expected "to" keyword after property in transition command');e.advance();const l=e.parsePrimary();if(n.to=l,e.check("over")){e.advance();const t=e.parsePrimary();n.over=t}if(e.check(p)){e.advance();const t=e.parsePrimary();n.with=t}return Tt.from(t).withArgs(...r).withModifiers(n).endingAt(e.getPosition()).build()}(this.getContext(),e)}parseAddCommand(e){return function(e,t){const r=[];if(e.match("{"))r.push(e.parseCSSObjectLiteral());else{const t=Et(e,[d]);t&&r.push(t)}if(e.check(d)){e.advance();const t=Et(e);t&&r.push(t)}return Tt.from(t).withArgs(...r).endingAt(e.getPosition()).build()}(this.getContext(),e)}parseIfCommand(e){return qt(this.getContext(),e)}parseRemoveCommand(e){return $t(this.getContext(),e)}parseToggleCommand(e){return _t(this.getContext(),e)}parseRegularCommand(e){return Ut(this.getContext(),e)}parseCall(){let e=this.parsePrimary();for(;;)if(this.match("("))e=this.finishCall(e);else if(this.match(".")){const t=this.consumeIdentifierLike("Expected property name after '.' - malformed member access");e=this.createMemberExpression(e,this.createIdentifier(t.value),!1)}else if(this.match("?.")){const t=this.consumeIdentifierLike("Expected property name after '?.' - malformed optional access"),r=this.createMemberExpression(e,this.createIdentifier(t.value),!1);r.optional=!0,e=r}else if(this.match("[")){const t=this.parseExpression();this.consume("]","Expected ']' after array index"),e=this.createMemberExpression(e,t,!0)}else{if(!this.check("'s"))break;{let t;this.advance(),this.check("*")?(this.advance(),t="*"+this.consumeIdentifier("Expected property name after * in CSS property syntax").value):Ge(this.peek())&&this.peek().value.startsWith("@")?t=this.advance().value:this.check("[")&&this.tokens[this.current+1]?.value?.startsWith("@")?(this.advance(),t=this.advance().value,this.consume("]","Expected ']' after attribute reference")):t=this.consumeIdentifierLike("Expected property name after possessive").value,e=this.createPossessiveExpression(e,this.createIdentifier(t))}}return e}parsePrimary(){if(this.check("*")){const e=this.current;if(this.advance(),!this.isAtEnd()&&De(this.peek())){const e=this.advance().value;return this.createSelector("*"+e)}this.current=e}if(this.check("*")||this.check("/")||this.check("%")||this.check("mod")){const e=this.peek();return this.addError(`Binary operator '${e.value}' requires a left operand`),this.createErrorNode()}if(this.matchNumber()){const e=parseFloat(this.previous().value);return this.createLiteral(e,this.previous().value)}if(this.matchString()){const e=this.previous().value;if(2>e.length||e.startsWith('"')&&!e.endsWith('"')||e.startsWith("'")&&!e.endsWith("'"))return this.addError("Unclosed string literal - string not properly closed"),this.createErrorNode();const t=e.slice(1,-1),r=this.processEscapeSequences(t);return this.createLiteral(r,e)}if(this.matchTemplateLiteral()){const e=this.previous();return{type:"templateLiteral",value:e.value,start:e.start||0,end:e.end||0,line:e.line,column:e.column}}if(this.matchBoolean()){const e=this.previous().value;let t;switch(e){case"true":t=!0;break;case"false":t=!1;break;case"null":t=null;break;case"undefined":t=void 0;break;default:t="true"===e}return this.createLiteral(t,e)}if(this.matchTimeExpression()){const e=this.previous().value;return this.createLiteral(e,e)}if(this.matchQueryReference()){const e=this.previous().value,t=e.slice(1,-2).trim(),r=this.createSelector(t);return r.fromQuery=!0,r.raw=e,r}if(this.matchSelector())return this.createSelector(this.previous().value);if(this.match("<"))return this.parseHyperscriptSelector();if(this.match("(")){if(this.isAtEnd())return this.addError("Expected expression inside parentheses"),this.createErrorNode();const e=this.parseExpression();return this.consume(")","Expected closing parenthesis ')' after expression - unclosed parentheses"),e}if(this.match("{"))return this.parseObjectLiteral();if(this.match("["))return this.parseAttributeOrArrayLiteral();if(this.check(":")){if(this.advance(),this.check(":")){this.advance();const e=this.advance();return{type:"identifier",name:e.value,scope:"global",start:e.start-2,end:e.end,line:e.line,column:e.column}}{const e=this.advance();return{type:"identifier",name:e.value,scope:"element",start:e.start-1,end:e.end,line:e.line,column:e.column}}}if(this.matchBasicOperator()){const e=this.previous();return this.createIdentifier(e.value)}const e=this.peek();if((!e||"end"!==e.value&&"else"!==e.value&&"then"!==e.value)&&(this.matchPredicate(Ye)||this.matchPredicate(Ve)||this.matchPredicate(Be)||this.matchPredicate(ze)||this.matchPredicate(He))){const e=this.previous();if("new"===e.value)return this.parseConstructorCall();if("on"===e.value)return this.parseEventHandler();if("if"===e.value)return this.parseConditional();if("closest"===e.value||"first"===e.value||"last"===e.value||"previous"===e.value||"next"===e.value){if(this.check("(")||this.checkCssSelector()||this.checkClassSelector()||this.checkIdSelector()||this.check("<")||this.checkQueryReference())return this.parseNavigationFunction(e.value);if(this.check(".")){const t=this.current;if(this.advance(),this.checkIdentifier()){const t=this.advance().value,r=this.createSelector("."+t);return this.createCallExpression(this.createIdentifier(e.value),[r])}this.current=t}if(this.check("#")){const t=this.current;if(this.advance(),this.checkIdentifier()){const t=this.advance().value,r=this.createSelector("#"+t);return this.createCallExpression(this.createIdentifier(e.value),[r])}this.current=t}return this.isAtEnd()||this.checkBasicOperator()||this.check("then")||this.check("else")||this.check("end")?this.createIdentifier(e.value):this.parseNavigationFunction(e.value)}const t=this.check(".")||this.check("?.");return"my"!==e.value||t?"its"!==e.value||t?"your"!==e.value||t?"the"===e.value?this.parseTheXofY():"values"===e.value&&this.check("of")?(this.advance(),{type:"propertyOfExpression",property:{type:"identifier",name:"values"},target:this.parsePrimary(),line:e.line,column:e.column}):this.createIdentifier(e.value):this.parseContextPropertyAccess("you"):this.parseContextPropertyAccess("it"):this.parseContextPropertyAccess("me")}if(this.match("$"))return this.parseDollarExpression();if("\\"===this.peek().value)return this.parseBlockLiteral();if(Ge(this.peek())&&this.peek().value.startsWith("@")){const e=this.advance();return{type:"attributeAccess",attributeName:e.value.substring(1),start:e.start,end:e.end,line:e.line,column:e.column}}const t=this.peek();return this.addError(`Unexpected token: ${t.value} at line ${t.line}, column ${t.column}`),this.advance(),this.createErrorNode()}parseBlockLiteral(){const e=this.peek().start;this.advance();const t=[];for(;!(this.isAtEnd()||this.check("-")&&">"===this.tokens[this.current+1]?.value);){if(!this.checkIdentifier()){this.addError("Unexpected token in block literal parameters: "+this.peek().value);break}t.push(this.advance().value),this.match(",")}return this.check("-")&&">"===this.tokens[this.current+1]?.value?(this.advance(),this.advance(),{type:"blockLiteral",parameters:t,body:this.parseExpression(),start:e,end:this.previous().end,line:this.previous().line,column:this.previous().column}):(this.addError("Expected '->' in block literal"),this.createErrorNode())}parseDollarExpression(){if(this.checkNumber()){const e=this.advance().value;return this.createLiteral(e,"$"+e)}if(this.checkIdentifier()){const e=this.advance();let t=this.createIdentifier(e.value);for(;this.match(".");){if(!this.checkIdentifier())return this.addError("Expected property name after '.' in dollar expression"),this.createErrorNode();{const e=this.advance();t=this.createMemberExpression(t,this.createIdentifier(e.value),!1)}}return{type:"dollarExpression",expression:t,raw:`$${e.value}${this.previous().value||""}`,line:e.line,column:e.column-1}}return this.addError("Expected identifier or number after '$'"),this.createErrorNode()}parseHyperscriptSelector(){let e="";for(;!this.check("/")&&!this.isAtEnd();)e+=this.advance().value;return this.consume("/","Expected '/' in hyperscript selector"),this.consume(">","Expected '>' after '/' in hyperscript selector"),this.createSelector(e)}parseObjectLiteral(){const e=[],t=this.getPosition();if(this.check("}"))return this.advance(),{type:"objectLiteral",properties:e,start:t.start,end:this.getPosition().end,line:t.line,column:t.column};do{let t;if(this.check("["))this.advance(),t=this.parseExpression(),this.consume("]","Expected ']' after computed property name in object literal");else if(this.matchString()){const e=this.previous().value,r=e.slice(1,-1);t=this.createLiteral(r,e)}else{if(!this.check("-")&&!this.checkPredicate(Ye))return this.addError("Expected property name in object literal"),this.createErrorNode();{let e="",r=!1;for(;this.check("-");)this.advance(),e+="-",r=!0;for(this.checkPredicate(Ye)&&(e+=this.advance().value);this.check("-");)this.advance(),e+="-",r=!0,this.checkPredicate(Ye)&&(e+=this.advance().value);if(""===e||"-"===e)return this.addError("Expected property name in object literal"),this.createErrorNode();t=r?this.createLiteral(e,e):this.createIdentifier(e)}}this.consume(":","Expected ':' after property name in object literal");const r=this.parseExpression();if(e.push({key:t,value:r}),!this.match(","))break;if(this.check("}"))break}while(!this.isAtEnd());return this.consume("}","Expected '}' after object literal properties"),{type:"objectLiteral",properties:e,start:t.start,end:this.getPosition().end,line:t.line,column:t.column}}parseCSSObjectLiteral(){const e=this.getPosition(),t=[];do{if(this.check("}"))break;let r;if(this.matchPredicate(Ye))r=this.createIdentifier(this.previous().value);else{if(!this.matchString())return this.addError("Expected CSS property name"),this.createErrorNode();{const e=this.previous().value,t=e.slice(1,-1);r=this.createLiteral(t,e)}}if(!this.consume(":","Expected ':' after CSS property name"))return this.createErrorNode();const n=[];let i=!1,a=0,s=-1,o=-1;for(;!this.isAtEnd()&&(0!==a||!this.check(";")&&!this.check("}"));){const e=this.advance();n.push(e.value),0>s&&"number"==typeof e.start&&(s=e.start),"number"==typeof e.end&&(o=e.end),"$"===e.value&&this.check("{")&&(i=!0),"{"===e.value&&a++,"}"===e.value&&a--}const l=this.originalInput&&s>=0&&o>s?this.originalInput.slice(s,o):n.join(""),c=i?{type:"templateLiteral",value:l,start:e.start,end:this.getPosition().end,line:e.line,column:e.column}:this.createLiteral(l,l);if(t.push({key:r,value:c}),this.check(";")&&this.advance(),this.check("}"))break}while(!this.isAtEnd());return this.consume("}","Expected '}' after CSS object literal properties"),{type:"objectLiteral",properties:t,start:e.start,end:this.getPosition().end,line:e.line,column:e.column}}parseConstructorCall(){const e=this.previous();if(!this.checkIdentifier())return this.addError('Expected constructor name after "new"'),this.createErrorNode();const t=this.advance(),r=t.value;if(!this.check("("))return this.addError('Expected "(" after constructor name'),this.createErrorNode();this.advance();const n=[];if(!this.check(")"))do{n.push(this.parseExpression())}while(this.match(","));return this.consume(")","Expected ')' after constructor arguments"),{type:"callExpression",callee:{type:"identifier",name:r,start:t.start,end:t.end,line:t.line,column:t.column},arguments:n,isConstructor:!0,start:e.start,end:this.previous().end,line:e.line,column:e.column}}parseTopLevelInitBlock(){const e=this.getPosition(),t=this.parseCommandBlock(["end"]);return this.consume("end","Expected 'end' after init block"),{type:"initBlock",commands:t,start:e.start,end:this.getPosition().end,line:e.line,column:e.column}}parseDefFeature(){const e=this.getPosition();let t="";if(!this.checkIdentifier())return this.addError("Expected function name after 'def'"),{type:"def",name:"",params:[],body:[],start:e.start,end:this.getPosition().end,line:e.line,column:e.column};for(t=this.advance().value;this.check(".");)this.advance(),this.checkIdentifier()&&(t+="."+this.advance().value);const r=[];if(this.check("(")){if(this.advance(),!this.check(")"))for(this.checkIdentifier()&&r.push(this.advance().value);this.check(",");)this.advance(),this.checkIdentifier()&&r.push(this.advance().value);this.consume(")","Expected ')' after parameter list")}const n=this.parseCommandBlock(["end","catch","finally"]),{errorSymbol:i,errorHandler:a,finallyHandler:s}=this.parseErrorAndFinallyBlocks();return this.consume("end","Expected 'end' after function definition"),{type:"def",name:t,params:r,body:n,...void 0!==i&&{errorSymbol:i},...void 0!==a&&{errorHandler:a},...void 0!==s&&{finallyHandler:s},start:e.start,end:this.getPosition().end,line:e.line,column:e.column}}parseErrorAndFinallyBlocks(){let e,t,r;return this.check("catch")&&(this.advance(),this.checkIdentifier()&&(e=this.advance().value),t=this.parseCommandBlock(["end","finally"])),this.check("finally")&&(this.advance(),r=this.parseCommandBlock(["end"])),{...void 0!==e&&{errorSymbol:e},...void 0!==t&&{errorHandler:t},...void 0!==r&&{finallyHandler:r}}}parseEventNameWithNamespace(e){let t;t=this.checkEvent()||this.checkIdentifier()||this.checkIsCommand()||this.checkIdentifierLike()?this.advance():this.consumeEvent(e);let r=t.value;return this.check(":")&&(this.advance(),r=`${r}:${this.advance().value}`),r}callExprToCommandNode(e,t){return{type:"command",name:e.callee.name,args:e.arguments,isBlocking:!1,...void 0!==t.start&&{start:t.start},...void 0!==t.end&&{end:t.end},...void 0!==t.line&&{line:t.line},...void 0!==t.column&&{column:t.column}}}createPseudoCommandNode(e,t,r,n,i){return{type:"command",name:"pseudo-command",args:[{type:"objectLiteral",properties:[{key:{type:"identifier",name:"methodName"},value:{type:"literal",value:e,raw:`"${e}"`}},{key:{type:"identifier",name:"methodArgs"},value:{type:"literal",value:t.arguments,raw:JSON.stringify(t.arguments)}},...r?[{key:{type:"identifier",name:"preposition"},value:{type:"literal",value:r,raw:`"${r}"`}}]:[],{key:{type:"identifier",name:"targetExpression"},value:n}]}],isBlocking:!1,...void 0!==i.start&&{start:i.start},...void 0!==i.end&&{end:i.end},...void 0!==i.line&&{line:i.line},...void 0!==i.column&&{column:i.column}}}tryParsePseudoCommand(e,t){const r=e.callee.name,n=this.peek();if(!(Qt.PSEUDO_COMMAND_PREPOSITIONS.includes(n.value.toLowerCase())||Ye(n)&&!this.isCommand(n.value)||Be(n)))return{node:this.callExprToCommandNode(e,t),isPseudo:!1,targetFailed:!1};let i,a;this.isCommand(r)&&this.addWarning({type:"command-shadow",message:`Method '${r}' shadows hyperscript command`,suggestions:[`Rename method to avoid confusion (e.g., '${r}Fn', 'my${r.charAt(0).toUpperCase()+r.slice(1)}')`,`Use 'call' command instead: call ${r}(...)`,"This works but may cause ambiguity"],severity:"warning",code:"PSEUDO_CMD_SHADOW",...void 0!==t.line&&{line:t.line},...void 0!==t.column&&{column:t.column}}),Qt.PSEUDO_COMMAND_PREPOSITIONS.includes(this.peek().value.toLowerCase())&&(i=this.advance().value.toLowerCase());try{a=this.parseExpression()}catch{return{node:this.callExprToCommandNode(e,t),isPseudo:!1,targetFailed:!0}}return{node:this.createPseudoCommandNode(r,e,i,a,t),isPseudo:!0,targetFailed:!1}}parseCommandWithErrorRecovery(){this.advance();const e=this.error;try{const t=this.parseCommand();return this.error&&this.error!==e&&(pe("\u26a0\ufe0f Command parsing added error, restoring error state. Error was:",this.error.message),this.error=e),t}catch(t){return pe("\u26a0\ufe0f Command parsing threw exception, restoring error state:",t instanceof Error?t.message:t+""),this.error=e,null}}parseTemporalKeywordModifiers(e){if(!this.check("debounced")&&!this.check("throttled"))return;const t=this.advance().value.toLowerCase(),r="debounced"===t?"debounce":"throttle";if(this.match("at"))if(this.checkTimeExpression()){const i=this.advance(),a=(n=i.value).endsWith("ms")?parseInt(n,10):n.endsWith("seconds")||n.endsWith("s")?1e3*parseFloat(n):n.endsWith("minutes")?6e4*parseFloat(n):n.endsWith("hours")?36e5*parseFloat(n):n.endsWith("days")?864e5*parseFloat(n):parseInt(n,10);e[r]=a,pe(`\ud83d\udd27 parseEventHandler: Parsed '${t} at ${i.value}' (${a}ms)`)}else if(this.matchNumber()){const n=parseInt(this.previous().value,10);e[r]=n,pe(`\ud83d\udd27 parseEventHandler: Parsed '${t} at ${n}'`)}else this.addError(`Expected time expression after '${t} at', got: ${this.peek().value}`);else this.addError(`Expected 'at' after '${t}'`);var n}parseEventHandler(){pe("\ud83d\udd27 parseEventHandler: ENTRY - parsing event handler");const e=[];let t=!1;if(this.check("first")&&!this.checkIsCommand()&&this.tokens.length>this.current+1){const e=this.tokens[this.current+1],r=e?.value?.toLowerCase();r&&"of"!==r&&"in"!==r&&"from"!==r&&(this.advance(),t=!0,pe("\ud83d\udd27 parseEventHandler: Parsed 'first' as .once alias"))}const r=this.parseEventNameWithNamespace("Expected event name after 'on'");for(e.push(r),pe("\ud83d\udd27 parseEventHandler: Parsed first event name: "+r);this.check("or");){this.advance(),pe("\ud83d\udd27 parseEventHandler: Found 'or', parsing additional event name");const t=this.parseEventNameWithNamespace("Expected event name after 'or'");e.push(t),pe("\ud83d\udd27 parseEventHandler: Parsed additional event name: "+t)}let n;if(pe("\ud83d\udd27 parseEventHandler: Total events parsed: "+e.join(", ")),this.registryIntegration){const t=e[0];if(this.registryIntegration.hasEventSource(t)){const e=this.registryIntegration.getEventSource(t);n=e?.name,pe(`\ud83d\udd27 parseEventHandler: Detected custom event source '${n}' for event '${t}'`)}}const i=[];if(this.match("(")){if(!this.check(")"))do{const e=this.advance();i.push(e.value)}while(this.match(","));this.consume(")","Expected ')' after event parameters"),pe("\ud83d\udd27 parseEventHandler: Parsed event parameters: "+i.join(", "))}const a={};for(;this.check(".");){this.advance();const e=this.advance().value.toLowerCase();if("once"===e)a.once=!0,pe("\ud83d\udd27 parseEventHandler: Parsed modifier '.once'");else if("prevent"===e)a.prevent=!0,pe("\ud83d\udd27 parseEventHandler: Parsed modifier '.prevent'");else if("stop"===e)a.stop=!0,pe("\ud83d\udd27 parseEventHandler: Parsed modifier '.stop'");else if("debounce"===e||"throttle"===e){if(!this.check("("))throw Error(`Expected '(' after '.${e}'`);{this.advance();const t=this.advance(),r=parseInt(t.value,10);if(isNaN(r))throw Error(`Expected number for ${e} delay, got: ${t.value}`);"debounce"===e?(a.debounce=r,pe(`\ud83d\udd27 parseEventHandler: Parsed modifier '.debounce(${r})'`)):(a.throttle=r,pe(`\ud83d\udd27 parseEventHandler: Parsed modifier '.throttle(${r})'`)),this.consume(")",`Expected ')' after ${e} delay`)}}else pe(`\ud83d\udd27 parseEventHandler: Warning - unknown modifier '.${e}'`)}let s,o,l,c;if(this.parseTemporalKeywordModifiers(a),t&&(a.once=!0),Object.keys(a).length>0&&pe("\ud83d\udd27 parseEventHandler: Parsed modifiers:",a),this.match("[")&&(s=this.parseExpression(),this.consume("]","Expected ']' after event condition")),this.match("from")){const e=this.advance();o=e.value,pe(`\ud83d\udd27 parseEventHandler: Parsed 'from' target: ${o} (kind: ${e.kind})`),this.parseTemporalKeywordModifiers(a)}if(this.match("of")){const e=this.advance();l=e.value.startsWith("@")?e.value.substring(1):e.value,pe("\ud83d\udd27 parseEventHandler: Parsed attribute name: "+l)}this.match("in")&&(pe("\ud83d\udd27 parseEventHandler: Found 'in' keyword, parsing watch target"),c=this.parseExpression(),pe("\ud83d\udd27 parseEventHandler: Parsed watch target expression"));const u=[];for(pe(`\u2705 parseEventHandler: About to parse commands, current token: ${this.isAtEnd()?"END":this.peek().value}, isAtEnd: ${this.isAtEnd()}`);!this.isAtEnd();){if(pe(`\u2705 parseEventHandler: Loop iteration, current token: ${this.peek().value}, kind: ${this.peek().kind}`),this.check("on")){pe("\u2705 parseEventHandler: Stopping command parsing, found next event handler 'on'");break}if(this.checkComment())pe("\u2705 parseEventHandler: Skipping comment token: "+this.peek().value),this.advance();else{if(this.check("end")){pe("\u2705 parseEventHandler: Stopping command parsing, found 'end' keyword"),this.advance();break}if(this.check("catch")||this.check("finally")){pe(`\u2705 parseEventHandler: Stopping command parsing, found '${this.peek().value}'`);break}if(this.checkIsCommand()){const e="("===this.tokens[this.current+1]?.value,t=this.peek().value.toLowerCase();if(e&&"js"!==t&&"tell"!==t){let e;const t=this.error;try{e=this.parseExpression()}catch(e){this.error=t,this.advance();const r=this.parseCommand();u.push(r);continue}if(e&&"callExpression"===e.type){const t=this.tryParsePseudoCommand(e,e);if(u.push(t.node),t.isPseudo||t.targetFailed)continue}}else{const e=this.parseCommandWithErrorRecovery();e&&(u.push(e),pe("\u2705 parseEventHandler: Parsed command, next token: "+(this.isAtEnd()?"END":this.peek().value)))}}else{if(!this.checkIdentifier())break;{const e=this.peek();if(this.isCommand(e.value)){const e=this.parseCommandWithErrorRecovery();e&&u.push(e)}else{let e;const t=this.error;try{e=this.parseExpression()}catch(e){pe("\u26a0\ufe0f Expression parsing error, restoring error state:",e instanceof Error?e.message:e+""),this.error=t;break}if(e&&"callExpression"===e.type){const t=this.tryParsePseudoCommand(e,e);if(u.push(t.node),t.targetFailed)continue}else{if(!e||"binaryExpression"!==e.type||" "!==e.operator)break;{const t=e;if(!t.left||"identifier"!==t.left.type||!this.isCommand(t.left.name))break;{const r={type:"command",name:t.left.name,args:[t.right],isBlocking:!1,...void 0!==e.start&&{start:e.start},...void 0!==e.end&&{end:e.end},...void 0!==e.line&&{line:e.line},...void 0!==e.column&&{column:e.column}};u.push(r)}}}}}}for(;!(this.isAtEnd()||this.checkIsCommand()||this.isCommand(this.peek().value)||this.check("then")||this.check("and")||this.check(",")||this.check("on")||this.check("catch")||this.check("finally"));)this.advance();if(!this.match("then","and",",")&&!this.checkIsCommand()&&!this.isCommand(this.peek().value))break}}let d,m,p;this.isAtEnd()||!this.check("catch")&&!this.check("finally")||(({errorSymbol:d,errorHandler:m,finallyHandler:p}=this.parseErrorAndFinallyBlocks()),this.check("end")&&this.advance());const h=this.getPosition(),f={type:"eventHandler",event:1===e.length?e[0]:e.join("|"),events:e,commands:u,...void 0!==d&&{errorSymbol:d},...void 0!==m&&{errorHandler:m},...void 0!==p&&{finallyHandler:p},...i.length>0&&{args:i},...s&&{condition:s},...o&&{target:o},...l&&{attributeName:l},...c&&{watchTarget:c},...n&&{customEventSource:n},...Object.keys(a).length>0&&{modifiers:a},start:h.start,end:h.end,line:h.line,column:h.column};return pe(`\ud83d\udd27 parseEventHandler: Created node with events: ${e.join(", ")}, attributeName: ${l||"none"}, watchTarget: ${c?"yes":"none"}`),f}parseBehaviorDefinition(){const e=this.getPosition(),t=this.consumeIdentifier("Expected behavior name after 'behavior' keyword").value;/^[A-Z]/.test(t)||this.addError(`Behavior name must start with uppercase letter (got "${t}")`);const r=[];if(this.match("(")){if(!this.check(")"))do{const e=this.consumeIdentifierLike("Expected parameter name");r.push(e.value)}while(this.match(","));this.consume(")","Expected ')' after behavior parameters")}const n=new Set(r),i=[];let a;for(;!this.isAtEnd()&&!this.check("end");)if(this.match("on")){const e=this.getPosition(),t=this.parseEventNameWithNamespace("Expected event name after 'on'"),r=[];if(this.check("(")){for(this.advance();!this.isAtEnd()&&!this.check(")");){const e=this.peek();Ye(e)?(r.push(e.value),this.advance(),this.check(",")&&this.advance()):this.advance()}this.check(")")&&this.advance()}let a;if(this.check("from")){this.advance();const e=[];if(this.check("the")&&this.advance(),!this.isAtEnd()){const t=this.peek(),r=n.has(t.value);this.checkIsCommand()&&!r||(e.push(t.value),a=t.value,this.advance())}}const{commands:s,terminator:o}=this.parseCommandListUntilTerminator(["catch","finally"]);let l,c,u;if("catch"!==o&&"finally"!==o||({errorSymbol:l,errorHandler:c,finallyHandler:u}=this.parseErrorAndFinallyBlocks()),!this.check("end"))throw Error('Expected "end" to close behavior event handler');this.advance();const d={type:"eventHandler",event:t,commands:s,...void 0!==l&&{errorSymbol:l},...void 0!==c&&{errorHandler:c},...void 0!==u&&{finallyHandler:u},...void 0!==a&&{target:a},...r.length>0&&{args:r},start:e.start,end:this.getPosition().end,line:e.line,column:e.column};i.push(d)}else{if(!this.match("init")){this.addError("Unexpected token in behavior body: "+this.peek().value);break}a={type:"initBlock",commands:this.parseCommandBlock(["end"]),start:e.start,end:this.getPosition().end,line:e.line,column:e.column},this.consume("end","Expected 'end' after init block")}return this.consume("end","Expected 'end' to close behavior definition"),{type:"behavior",name:t,parameters:r,eventHandlers:i,...void 0!==a?{initBlock:a}:{},start:e.start,end:this.getPosition().end,line:e.line,column:e.column}}parseCommandSequence(){const e=[];for(;!this.isAtEnd();){if(this.checkIsCommand()||this.isCommand(this.peek().value)&&!this.isKeyword(this.peek().value)){this.advance();const t=this.error,r=this.parseCommand();for(this.error&&this.error!==t&&(this.error.message.includes("Expected closing parenthesis")||this.error.message.includes("Expected ')'")||this.error.message.includes("unclosed parenthes")||this.error.message.includes("Unclosed parenthes")||(pe("\u26a0\ufe0f parseCommandSequence: Command parsing added non-critical error, restoring error state. Error was:",this.error.message),this.error=t)),e.push(r);!(this.isAtEnd()||this.checkIsCommand()||this.isCommand(this.peek().value)||this.check("then")||this.check("on"));)pe("\u26a0\ufe0f parseCommandSequence: Skipping unexpected token:",this.peek().value),this.advance();if(this.check("on")){pe('\u2705 parseCommandSequence: Found "on" token, stopping command sequence to allow event handler parsing');break}if(this.match("then"))continue;if(this.checkIsCommand()||this.isCommand(this.peek().value)&&!this.isKeyword(this.peek().value))continue;break}{const t=this.peek(),r=this.getPosition(),n="Expected command, got: "+t.value;this.addError(n);const i=gt(r,n,t.value);if(e.push(i),this.synchronizeToCommandBoundary(),this.isAtEnd())break;if(this.match("then"))continue;if(this.check("end")||this.check("on"))break;if(this.checkIsCommand()||this.isCommand(this.peek().value)&&!this.isKeyword(this.peek().value))continue;break}}return 1===e.length?e[0]:function(e){return{type:"CommandSequence",commands:e,start:e[0]?.start||0,end:e[e.length-1]?.end||0,line:e[0]?.line||1,column:e[0]?.column||1}}(e)}getMultiWordPattern(e){return function(e){return vt.find(t=>t.command===e.toLowerCase())||null}(e)}isTokenKeyword(e,t){return bt(e,t)}parseMultiWordCommand(e,t){return function(e,t,r){const n=e.getMultiWordPattern(r);if(!n)return null;const i=[],a={};for(;!kt(e,["catch","finally",...n.keywords])&&!bt(e.peek(),n.keywords);){const t=e.parsePrimary();if(!t)break;if(i.push(t),!e.match(",")&&bt(e.peek(),n.keywords))break}for(;!e.isAtEnd()&&bt(e.peek(),n.keywords);){const t=e.advance().value,r=e.parseExpression();if(r&&(a[t]=r),!bt(e.peek(),n.keywords))break}const s=Tt.from(t).withArgs(...i).endingAt(e.getPosition());return Object.keys(a).length>0&&s.withModifiers(a),s.build()}(this.getContext(),e,t)}parseCommandBlock(e){const t=[];for(;!this.isAtEnd()&&!e.some(e=>this.check(e));)if(this.checkComment())this.advance();else{if(!this.checkIsCommand()&&!this.isCommand(this.peek().value))break;{this.advance();const e=this.parseCommand();if(t.push(e),this.match("then","and",","))continue}}return t}trySemanticParse(e){if(!this.semanticAdapter||!this.semanticAdapter.isAvailable())return null;try{const t=this.semanticAdapter.trySemanticParse(e);return t.success&&t.node?(pe(`[Semantic] Successfully parsed with confidence ${t.confidence}:`,t.node.name),t.node):(pe(`[Semantic] Low confidence (${t.confidence}), falling back to traditional parser`),null)}catch(e){return pe("[Semantic] Error during semantic parse:",e),null}}getRemainingInput(){if(!this.originalInput)return this.tokens.slice(this.current>0?this.current-1:0).map(e=>e.value).join(" ");const e=this.current>0?this.tokens[this.current-1]:this.tokens[0];return e&&void 0!==e.start?this.originalInput.slice(e.start):this.originalInput}skipToCommandBoundary(){const e=["then","and","else","end"];for(;!this.isAtEnd();){const t=this.peek(),r=t.value.toLowerCase();if(e.includes(r))break;if(ze(t))break;this.advance()}}parseCommand(){const e=this.parseCommandCore();if(e&&"command"===e.type&&!e.body&&(this.check("when")||this.check("where"))){const t=this.peek().value.toLowerCase();this.advance();const r=this.parseExpression();r&&(e.modifiers={...e.modifiers??{},[t]:r})}return e}parseCommandCore(){const e=this.previous();let t=e.value;if(this.semanticAdapter&&!["install","wait","repeat","for","set","put","increment","decrement","add","append","prepend","toggle","take","if","unless","make","measure","trigger","halt","remove","exit","return","closest","js","tell","fetch","process"].includes(t.toLowerCase())){const e=this.getRemainingInput(),t=this.trySemanticParse(e);if(t)return this.skipToCommandBoundary(),t}if("beep"===t&&this.check("!")&&(this.advance(),t="beep!"),"fetch"===t)return function(e,t){const r={};let n=null;if(!e.isAtEnd()&&Kt(e)&&(n=Xt(e)),n||(n=e.parsePrimary()),!n)return e.addError("fetch requires a URL"),Tt.from(t).endingAt(e.getPosition()).build();!e.isAtEnd()&&e.check("{")&&(r.with=e.parsePrimary());for(let t=0;3>t&&!e.isAtEnd();t++)if(!e.check("as")||r.as){if(!e.check("with")||r.with){if(e.check("do")&&!r.doNotThrow){const t=e.peekAt(1),n=e.peekAt(2);if("not"===t?.value&&"throw"===n?.value){const t=e.advance();e.advance();const n=e.advance();r.doNotThrow={type:"literal",value:!0,start:t.start,end:n.end,line:t.line,column:t.column};continue}}break}e.advance(),r.with=Gt(e)?Jt(e):e.parsePrimary()}else e.advance(),e.isAtEnd()||At(e,"a")||At(e,"an"),r.as=e.parsePrimary();const i=Tt.from(t).withArgs(n).endingAt(e.getPosition());return Object.keys(r).length>0&&i.withModifiers(r),i.build()}(this.getContext(),e);const r=this.parseMultiWordCommand(e,t);if(r)return r;const n=t.toLowerCase();if("repeat"===n)return this.parseRepeatCommand(e);if("for"===n)return this.parseForCommand(e);if("if"===n||"unless"===n)return this.parseIfCommand(e);if("wait"===n)return this.parseWaitCommand(e);if("install"===n)return this.parseInstallCommand(e);if("transition"===n)return this.parseTransitionCommand(e);if("add"===n)return this.parseAddCommand(e);if(this.isCompoundCommand(n))return this.parseCompoundCommand({type:"identifier",name:n,start:e.start||0,end:e.end||0,line:e.line,column:e.column})||function(e,t){return{type:"command",name:e,args:[],partial:!0,start:t.start,end:t.end,line:t.line,column:t.column}}(n,this.getPosition());const i=[];if(("increment"===t||"decrement"===t)&&!this.isAtEnd())return function(e,t){const r=t.value,n="increment"===r?"+":"-";let i=!1;e.check(v)&&(i=!0,e.advance());const a=e.parseExpression();if(!a)throw Error("Expected variable or expression after "+r);let s;if(e.check("by")){e.advance();const t=e.parseExpression();if(!t)throw Error(`Expected amount after 'by' in ${r} command`);s=t}else s=ct(1,"1",{start:t.start,end:e.previous().end,line:t.line,column:t.column});let o=a;i&&"identifier"===a.type&&(o={...a,scope:"global"});const l={start:t.start,end:e.previous().end,line:t.line,column:t.column},c=dt(n,a,s,l);c.coerceNumeric=!0;const u=[o,ut(d,l),c];return Tt.from(t).withName("set").withArgs(...u).withOriginalCommand(r).endingAt({end:e.previous().end}).build()}(this.getContext(),e);for(;!(this.isAtEnd()||this.check("then")||this.check("and")||this.check("else")||this.check("end")||this.checkIsCommand());){const e=this.parseExpression();if(i.push(e||this.parsePrimary()),this.match(","))continue;const t=["into","from","to","with","by","at","before","after","over"];if(t.some(e=>this.check(e)))continue;const r=i[i.length-1];if(!r||"identifier"!==r.type&&"keyword"!==r.type||!t.includes(r.name??r.value))break}const a=this.getPosition();return{type:"command",name:t,args:i,isBlocking:!1,start:a.start,end:a.end,line:a.line,column:a.column}}parseConditional(){const e=this.parseExpression();this.consume("then","Expected 'then' after if condition");const t=this.parseConditionalBranch();let r;this.match("else")&&(r=this.parseConditionalBranch());const n=this.getPosition();return{type:"conditionalExpression",test:e,consequent:t,alternate:r,start:n.start,end:n.end,line:n.line,column:n.column}}parseConditionalBranch(){if(this.checkIsCommand()){const e=this.advance(),t=this.createIdentifier(e.value);return this.createCommandFromIdentifier(t)||t}if(this.checkIdentifier()||this.checkKeyword()){const e=this.peek();if(this.isCommand(e.value)){const e=this.advance(),t=this.createIdentifier(e.value);return this.createCommandFromIdentifier(t)||t}}return this.parseExpression()}parseNavigationFunction(e){const t=[];if(this.match("of"))t.push(this.parseExpression());else{if(this.check("("))return this.finishCall(this.createIdentifier(e));this.isAtEnd()||this.checkBasicOperator()||this.check("then")||this.check("else")||t.push(this.parsePrimary())}const r=this.createCallExpression(this.createIdentifier(e),t);if("next"===e||"previous"===e){const e=this.parseRelativePositionalModifiers();e&&(r.relativePositional=e)}return r}parseRelativePositionalModifiers(){if(!(this.check("from")||this.check("within")||this.check("in")||this.check("with")))return null;let e,t,r,n=!1,i=!1;return this.match("from")&&(e=this.parseRelativePositionalOperand()),this.match("in")?(n=!0,r=this.parseRelativePositionalOperand()):this.match("within")&&(t=this.parseRelativePositionalOperand()),this.match("with")&&(this.match("wrapping"),i=!0),{from:e,within:t,inElt:r,inSearch:n,wrapping:i}}parseRelativePositionalOperand(){return this.match("the"),this.parsePrimary()}parseTheXofY(){if(!this.checkIdentifier())return this.createIdentifier("the");const e=this.peek(),t=e.value;return["first","last","next","previous","random","closest"].includes(t)?(this.advance(),this.parseNavigationFunction(t)):(this.advance(),this.check("of")?(this.advance(),{type:"propertyOfExpression",property:{type:"identifier",name:t},target:this.parseCall(),line:e.line,column:e.column}):this.createIdentifier(t))}parseContextPropertyAccess(e){if(this.match("*")){let t="";if(!this.checkIdentifier())return this.addError("Expected property name after 'my *'"),this.createMemberExpression(this.createIdentifier(e),this.createIdentifier(""),!1);for(t=this.advance().value;this.check("-")&&!this.isAtEnd();){if(t+="-",this.advance(),!this.checkIdentifier()){this.addError("Expected identifier after hyphen in CSS property name");break}t+=this.advance().value}const r="*"+t;return this.createMemberExpression(this.createIdentifier(e),this.createIdentifier(r),!1)}{if(this.check("[")&&this.tokens[this.current+1]?.value?.startsWith("@")){this.advance();const t=this.advance();return this.consume("]","Expected ']' after attribute reference"),this.createMemberExpression(this.createIdentifier(e),{type:"attributeAccess",attributeName:t.value.substring(1),start:t.start,end:t.end,line:t.line,column:t.column},!0)}if(Ge(this.peek())&&this.peek().value.startsWith("@")){const t=this.advance();return this.createMemberExpression(this.createIdentifier(e),this.createIdentifier(t.value),!1)}const t=this.consumeIdentifierLike(`Expected property name after '${{me:"my",it:"its",you:"your"}[e]}'`);return this.createMemberExpression(this.createIdentifier(e),this.createIdentifier(t.value),!1)}}parseMyPropertyAccess(){return this.parseContextPropertyAccess("me")}finishCall(e){const t=[];if(!this.check(")"))do{if(this.check(","))return this.addError("Unexpected token in function arguments"),this.createCallExpression(e,[this.createErrorNode()]);t.push(this.parseExpression())}while(this.match(","));if(!this.check(")")&&"identifier"===e.type){const t=e.name;j(t)&&pe(`\ud83d\udca1 Tip: CSS functions like ${t}() should be quoted for clean parsing. Use '${t}(...)' or \`${t}(...)\` instead.`)}return this.consume(")","Expected ')' after arguments"),this.createCallExpression(e,t)}createLiteral(e,t){return ct(e,t,this.getPosition())}createIdentifier(e){return ut(e,this.getPosition())}createBinaryExpression(e,t,r){return dt(e,t,r,this.getPosition())}createUnaryExpression(e,t,r){return function(e,t,r,n){return{type:"unaryExpression",operator:e,argument:t,prefix:r,start:n.start,end:n.end,line:n.line,column:n.column}}(e,t,r,this.getPosition())}createCallExpression(e,t){return function(e,t,r){return{type:"callExpression",callee:e,arguments:t,start:r.start,end:r.end,line:r.line,column:r.column}}(e,t,this.getPosition())}createMemberExpression(e,t,r){return function(e,t,r,n){return{type:"memberExpression",object:e,property:t,computed:r,start:n.start,end:n.end,line:n.line,column:n.column}}(e,t,r,this.getPosition())}createSelector(e){return function(e,t){return{type:"selector",value:e,start:t.start,end:t.end,line:t.line,column:t.column}}(e,this.getPosition())}createPossessiveExpression(e,t){return function(e,t,r){return{type:"possessiveExpression",object:e,property:t,start:r.start,end:r.end,line:r.line,column:r.column}}(e,t,this.getPosition())}createErrorNode(){return{type:"identifier",name:"__ERROR__",start:(e=this.getPosition()).start,end:e.end,line:e.line,column:e.column};var e}processEscapeSequences(e){return e.replace(/\\(.)/g,(e,t)=>{switch(t){case"n":return"\n";case"t":return"\t";case"r":return"\r";case"b":return"\b";case"f":return"\f";case"v":return"\v";case"0":return"\0";case"\\":return"\\";case'"':return'"';case"'":return"'";default:return t}})}createProgramNode(e){return function(e){if(pe(`\u2705 createProgramNode: Called with ${e.length} statements`),0===e.length)return pe("\u2705 createProgramNode: Returning error node (0 statements)"),{type:"identifier",name:"__ERROR__",start:0,end:0,line:1,column:1};if(1===e.length)return pe(`\u2705 createProgramNode: Returning single statement (type=${e[0].type})`),e[0];const t={type:"Program",statements:e,start:e[0]?.start||0,end:e[e.length-1]?.end||0,line:e[0]?.line||1,column:e[0]?.column||1};return pe(`\u2705 createProgramNode: Returning Program node with ${e.length} statements, type=${t.type}`),t}(e)}match(...e){for(const t of e)if(this.check(t))return this.advance(),!0;return!1}matchOperator(e){if(this.isAtEnd())return!1;const t=this.peek();return!(!ot(t)||t.value!==e||(this.advance(),0))}check(e){if(this.isAtEnd())return!1;const t=this.peek().value;return this.resolveKeyword(t)===e}checkPredicate(e){return!this.isAtEnd()&&e(this.peek())}matchPredicate(e){return!!this.checkPredicate(e)&&(this.advance(),!0)}checkSelector(){return this.checkPredicate(Ue)}matchSelector(){return this.matchPredicate(Ue)}checkAnySelector(){return this.checkPredicate(Fe)}checkLiteral(){return this.checkPredicate(Ke)}checkIdentifierLike(){return this.checkPredicate(De)}checkIsCommand(){return this.checkPredicate(ze)}checkCommandTerminator(){return this.checkPredicate(lt)}checkReference(){return this.checkPredicate(Ze)}checkTimeExpression(){return this.checkPredicate(Xe)}checkEvent(){return this.checkPredicate(He)}checkContextVar(){return this.checkPredicate(Be)}checkComment(){return this.checkPredicate(Je)}checkIdentifier(){return this.checkPredicate(Ye)}checkKeyword(){return this.checkPredicate(Ve)}checkString(){return this.checkPredicate(Qe)}matchString(){return this.matchPredicate(Qe)}checkNumber(){return this.checkPredicate(et)}matchNumber(){return this.matchPredicate(et)}checkBoolean(){return this.checkPredicate(tt)}matchBoolean(){return this.matchPredicate(tt)}checkTemplateLiteral(){return this.checkPredicate(rt)}matchTemplateLiteral(){return this.matchPredicate(rt)}checkQueryReference(){return this.checkPredicate(nt)}matchQueryReference(){return this.matchPredicate(nt)}checkIdSelector(){return this.checkPredicate(it)}checkClassSelector(){return this.checkPredicate(at)}checkCssSelector(){return this.checkPredicate(st)}checkBasicOperator(){return this.checkPredicate(ot)}matchBasicOperator(){return this.matchPredicate(ot)}matchTimeExpression(){return this.matchPredicate(Xe)}matchIdentifierLike(){return this.matchPredicate(De)}matchComparisonOperator(){return this.matchPredicate(We)}consumePredicate(e,t){return this.checkPredicate(e)?this.advance():(this.addError(t),this.peek())}consumeIdentifier(e){return this.consumePredicate(Ye,e)}consumeIdentifierLike(e){return this.consumePredicate(De,e)}consumeEvent(e){return this.consumePredicate(He,e)}advance(){return this.isAtEnd()||this.current++,this.previous()}isAtEnd(){return this.current>=this.tokens.length}peek(){return this.isAtEnd()?{kind:"unknown",value:"",start:0,end:0,line:1,column:1}:this.tokens[this.current]}peekAt(e){const t=this.current+e;return t>=0&&this.tokens.length>t?this.tokens[t]:null}previous(){return this.tokens[this.current-1]}consume(e,t){return this.check(e)?this.advance():(this.addError(t),this.peek())}addError(e){const t=this.peek();let r=t.start||0,n=t.line||1,i=t.column||1;if(e.includes("property name after '.'")){const e=this.current>0?this.previous():t;r=e.end||e.start||0,n=e.line||1,i=e.column||1}if(e.includes("parenthes")){const e=this.current>0?this.previous():t;r=e.end||e.start||0,n=e.line||1,i=e.column||1,0===r&&this.current>0&&(r=this.current)}if(e.includes("Expected expression after")){const e=this.current>0?this.previous():t;r=e.start||0,n=e.line||1,i=e.column||1,0===r&&(r=Math.max(1,this.current-1))}if(e.includes("Missing operand")){let e=t;for(let t=this.current-1;t>=0;t--){const r=this.tokens[t];if(r&&("+"===r.value||"-"===r.value)){e=r;break}}r=e.start||0,n=e.line||1,i=e.column||1}this.error={message:e,line:Math.max(1,n),column:Math.max(1,i),position:Math.max(0,r)},this.errors.push(this.error)}synchronizeToCommandBoundary(){for(;!this.isAtEnd();){const e=this.peek();if("then"===e.value||"end"===e.value||"on"===e.value)return;if(this.checkIsCommand()||this.isCommand(e.value)&&!this.isKeyword(e.value))return;pe("\u26a0\ufe0f synchronize: Skipping token:",e.value),this.advance()}}parseAttributeOrArrayLiteral(){const e=this.previous().start,t=this.previous().line,r=this.previous().column;if(!this.isAtEnd()&&this.peek().value.startsWith("@")){const n=[];for(;!this.check("]")&&!this.isAtEnd();){const e=this.advance();n.push(e.value)}this.consume("]","Expected ']' after attribute literal");const i=n.join("");if(!i.includes("="))return{type:"attributeAccess",attributeName:i.replace(/^@/,""),start:e,end:this.previous().end,line:t,column:r};const a="["+i+"]";return{type:"literal",value:a,raw:a,start:e,end:this.previous().end,line:t,column:r}}const n=new Set(["=","~=","|=","^=","$=","*="]),i=this.tokens[this.current],a=this.tokens[this.current+1];if("identifier"===i?.kind&&("]"===a?.value||a&&n.has(a.value)&&"string"===this.tokens[this.current+2]?.kind)){let e="["+this.advance().value;if(this.check("]"))this.advance(),e+="]";else{const t=this.advance().value,r=this.advance().value;e+=t+'"'+(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r)+'"',this.consume("]","Expected ']' after attribute selector"),e+="]"}return this.createSelector(e)}const s=[];if(!this.check("]"))do{if(this.check("]"))break;s.push(this.parseExpression())}while(this.match(","));return this.consume("]","Expected ']' after array elements"),{type:"arrayLiteral",elements:s,start:e,end:this.previous().end,line:t,column:r}}getPosition(){const e=this.current>0?this.previous():this.peek();return{start:e.start||0,end:e.end||0,line:e.line||1,column:e.column||1}}getContext(){const e=this,t={tokens:this.tokens,advance:this.advance.bind(this),peek:this.peek.bind(this),previous:this.previous.bind(this),consume:this.consume.bind(this),check:this.check.bind(this),checkIdentifierLike:this.checkIdentifierLike.bind(this),checkSelector:this.checkSelector.bind(this),checkAnySelector:this.checkAnySelector.bind(this),checkLiteral:this.checkLiteral.bind(this),checkReference:this.checkReference.bind(this),checkTimeExpression:this.checkTimeExpression.bind(this),checkEvent:this.checkEvent.bind(this),checkIsCommand:this.checkIsCommand.bind(this),checkContextVar:this.checkContextVar.bind(this),match:this.match.bind(this),matchOperator:this.matchOperator.bind(this),isAtEnd:this.isAtEnd.bind(this),createIdentifier:this.createIdentifier.bind(this),parseExpression:this.parseExpression.bind(this),parsePrimary:this.parsePrimary.bind(this),parseLogicalAnd:this.parseLogicalAnd.bind(this),parseCSSObjectLiteral:this.parseCSSObjectLiteral.bind(this),parseCommand:this.parseCommand.bind(this),parseCommandSequence:this.parseCommandSequence.bind(this),parseCommandListUntilEnd:this.parseCommandListUntilEnd.bind(this),parseCommandListUntilEndOrElse:this.parseCommandListUntilEndOrElse.bind(this),parseRepeatBody:this.parseRepeatBody.bind(this),getPosition:this.getPosition.bind(this),addError:this.addError.bind(this),addWarning:this.addWarning.bind(this),isCommand:this.isCommand.bind(this),isCompoundCommand:this.isCompoundCommand.bind(this),isKeyword:this.isKeyword.bind(this),getMultiWordPattern:this.getMultiWordPattern.bind(this),resolveKeyword:this.resolveKeyword.bind(this),savePosition:()=>e.current,restorePosition:t=>{e.current=t},peekAt:t=>e.peekAt(t),getInputSlice:(e,t)=>this.originalInput?0>e||e>=this.originalInput.length?"":void 0!==t?this.originalInput.slice(e,t):this.originalInput.slice(e):""};return Object.defineProperty(t,"current",{get:()=>e.current,set:t=>{e.current=t},enumerable:!0,configurable:!0}),t}}function er(e,t){const r=function(e){const t={input:"",position:0,line:1,column:1,tokens:[]};t.input=e;const r=e.length;for(;r>t.position&&(B(t),r>t.position);){const r=e[t.position];if("-"!==r||"-"!==V(t,1))if('"'!==r){if("'"===r||"'"===r){const e=V(t,1),r=t.tokens[t.tokens.length-1];if("s"!==e||!r||/\s/.test(t.input[t.position-1]??" ")||r.kind!==$.IDENTIFIER&&r.kind!==$.SELECTOR&&"]"!==r.value&&")"!==r.value&&"}"!==r.value)U(t);else{const e=t.position;H(t),H(t),W(t,$.OPERATOR,"'s",e)}continue}if("`"!==r)if("<"!==r)if("#"!==r){if("."===r){if("."===V(t,1)){const e=t.position;H(t),H(t),W(t,$.OPERATOR,"..",e);continue}const e=t.tokens[t.tokens.length-1],r=new Set(["from","to","into","on","in","at","between","first","last","next","previous","closest","random","of","some","no"]),n=e&&e.kind===$.IDENTIFIER&&k.has(e.value.toLowerCase()),i=e&&e.kind===$.IDENTIFIER&&r.has(e.value.toLowerCase());if((!e||e.kind===$.OPERATOR&&")"!==e.value&&"]"!==e.value||n||i||"("===e.value||"["===e.value||"{"===e.value||","===e.value||";"===e.value)&&(!e||e.end!==t.position)&&(te(V(t))||"{"===V(t)||"-"===V(t))){Z(t);continue}}if("@"!==r)if("{"!==r)if("}"!==r){if("["===r){const e=t.tokens[t.tokens.length-1],r=e&&e.kind===$.IDENTIFIER&&R.has(e.value)&&t.tokens.length>=2&&"on"===t.tokens[t.tokens.length-2]?.value;(!e||e.kind!==$.IDENTIFIER&&")"!==e.value&&"]"!==e.value||r)&&r?(H(t),W(t,$.SYMBOL,"[")):(H(t),W(t,$.OPERATOR,"["));continue}if("]"!==r){if("$"===r){const e=V(t,1);if(e>="a"&&"z">=e||e>="A"&&"Z">=e||"_"===e){ee(t);continue}}ae(r)?J(t):"0">r||r>"9"?("a">r||r>"z")&&("A">r||r>"Z")&&"_"!==r?(W(t,$.UNKNOWN,r),H(t)):Q(t):Y(t)}else H(t),W(t,$.OPERATOR,"]")}else H(t),W(t,$.OPERATOR,"}");else H(t),W(t,$.OPERATOR,"{");else G(t)}else Z(t);else ie(t)?X(t):J(t);else K(t)}else U(t);else F(t)}return t.tokens}(e);return new Qt(r,t,e).parse()}Qt.POSTFIX_UNARY_OPERATORS=new Set(["exists","does not exist","is empty","is not empty","ignoring case"]),Qt.PRATT_TABLE=Ae,Qt.PSEUDO_COMMAND_PREPOSITIONS=["from","on","with","into","at","to"];class tr{constructor(){this.hooks=new Map,this.beforeExecuteHooks=[],this.afterExecuteHooks=[],this.onErrorHooks=[],this.interceptCommandHooks=[]}register(e,t){this.unregister(e),this.hooks.set(e,t),t.beforeExecute&&this.beforeExecuteHooks.push(t.beforeExecute),t.afterExecute&&this.afterExecuteHooks.push(t.afterExecute),t.onError&&this.onErrorHooks.push(t.onError),t.interceptCommand&&this.interceptCommandHooks.push(t.interceptCommand)}unregister(e){const t=this.hooks.get(e);if(!t)return!1;if(t.beforeExecute){const e=this.beforeExecuteHooks.indexOf(t.beforeExecute);e>-1&&this.beforeExecuteHooks.splice(e,1)}if(t.afterExecute){const e=this.afterExecuteHooks.indexOf(t.afterExecute);e>-1&&this.afterExecuteHooks.splice(e,1)}if(t.onError){const e=this.onErrorHooks.indexOf(t.onError);e>-1&&this.onErrorHooks.splice(e,1)}if(t.interceptCommand){const e=this.interceptCommandHooks.indexOf(t.interceptCommand);e>-1&&this.interceptCommandHooks.splice(e,1)}return this.hooks.delete(e)}has(e){return this.hooks.has(e)}async runBeforeExecute(e){for(const t of this.beforeExecuteHooks)await t(e)}async runAfterExecute(e,t){for(const r of this.afterExecuteHooks)await r(e,t)}async runOnError(e,t){let r=t;for(const t of this.onErrorHooks){const n=await t(e,r);n instanceof Error&&(r=n)}return r}shouldIntercept(e,t){for(const r of this.interceptCommandHooks)if(r(e,t))return!0;return!1}getRegisteredNames(){return Array.from(this.hooks.keys())}clear(){this.hooks.clear(),this.beforeExecuteHooks=[],this.afterExecuteHooks=[],this.onErrorHooks=[],this.interceptCommandHooks=[]}}function rr(e){return e instanceof Error&&("isHalt"in e||"isExit"in e||"isBreak"in e||"isContinue"in e||"isReturn"in e)?e:null}function nr(e){return{ok:!0,value:e}}function ir(e){return{ok:!1,error:e}}function ar(e){return!0===e.ok}const sr=new Map,or=new WeakMap;function lr(e){let t=or.get(e);return t||(t=new Map,or.set(e,t)),t}function cr(e){return e.owner||(e.me instanceof Element?e.me:null)}function ur(e,t){const r=cr(e);if(r)return $e(t,e),lr(r).get(t)}function dr(e,t,r){const n=cr(e);n&&(lr(n).set(t,r),Me(t,r,e))}function mr(e,t){return{me:e??null,owner:e??null,it:null,you:null,result:null,locals:new Map,globals:t||sr,flags:{halted:!1,breaking:!1,continuing:!1,returning:!1,async:!1}}}function pr(e){if(!e)return mr();if(e.locals instanceof Map&&e.globals instanceof Map&&e.flags)return e;const t=mr(e.me instanceof Element?e.me:null);return void 0!==e.it&&(t.it=e.it),void 0!==e.you&&(t.you=e.you),void 0!==e.result&&(t.result=e.result),void 0!==e.event&&Object.assign(t,{event:e.event}),t}function hr(e){return null!==e&&"object"==typeof e&&"nodeType"in e&&1===e.nodeType&&"tagName"in e&&"string"==typeof e.tagName&&"classList"in e}function fr(e){return null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(Symbol.iterator in e||"function"==typeof e.item)}function yr(e){if(null==e)return 0;if("number"==typeof e)return isFinite(e)?e:0;if("string"==typeof e)return parseFloat(e);if("boolean"==typeof e)return e?1:0;if(Array.isArray(e))return e.length;if("object"==typeof e){if("length"in e&&"number"==typeof e.length)return e.length;if("function"==typeof e.valueOf){const t=e.valueOf();if("number"==typeof t)return t}return NaN}return 0}function gr(e,t,r){return"element"===r?ur(t,e):"global"===r&&t.globals&&t.globals.has(e)?t.globals.get(e):"global"!==r&&t.locals&&t.locals.has(e)?($e(e,t),t.locals.get(e)):t.globals&&t.globals.has(e)?t.globals.get(e):t.variables&&t.variables.has(e)?t.variables.get(e):"global"===r&&t.locals&&t.locals.has(e)?($e(e,t),t.locals.get(e)):"undefined"!=typeof window&&e in window?window[e]:"undefined"!=typeof globalThis&&e in globalThis?globalThis[e]:void 0}function vr(e,t,r,n){if("element"!==n){if("global"===n)return _e(r,e,t),void("undefined"!=typeof window&&(window[e]=t));if(e.startsWith("$"))return void _e(r,e.slice(1),t);if(r.locals&&r.locals.has(e))return r.locals.set(e,t),void Me(e,t,r);if(r.globals&&r.globals.has(e))return _e(r,e,t),void("undefined"!=typeof window&&e in window&&(window[e]=t));if(r.variables&&r.variables.has(e))r.variables.set(e,t);else{if("undefined"!=typeof window&&e in window)return window[e]=t,void _e(r,e,t);r.locals.set(e,t),Me(e,t,r)}}else dr(r,e,t)}function br(e,t){return"me"===e?t.me:"it"===e?t.it:"you"===e?t.you:gr(e,t)}function wr(e,t,r){return r||"string"!=typeof t||!t.startsWith("#")?e:Array.isArray(e)?e[0]??null:e}function kr(e){if("undefined"==typeof document)throw Error("DOM not available");const t=Array.from(document.querySelectorAll(e)).filter(e=>hr(e));if(!t.length)throw Error(`No elements: "${e}"`);return t}function Er(e){if(hr(e))return[e];if(Array.isArray(e)){const t=e.filter(hr);return t.length>0?t:null}if("undefined"!=typeof NodeList&&e instanceof NodeList){const t=Array.from(e).filter(hr);return t.length>0?t:null}return null}const xr=new class{constructor(e={}){this.types=new Map,this.coercionCache=new Map,this.config={strictMode:!1,cacheCoercions:!0,...e},this.registerBuiltinTypes()}register(e){this.types.has(e.name)&&console.warn(`ExpressionTypeRegistry: Overwriting existing type '${e.name}'`),this.types.set(e.name,e)}get(e){return this.types.get(e)}has(e){return this.types.has(e)}getTypeNames(){return Array.from(this.types.keys())}inferType(e){for(const[t,r]of this.types)if(r.isType(e))return t;return"Unknown"}getHyperScriptType(e){const t=this.inferType(e),r=this.types.get(t);return r?.hyperscriptType??"unknown"}coerce(e,t,r){const n=this.types.get(t);if(!n){if(this.config.strictMode)throw Error("Unknown target type: "+t);return null}if(n.isType(e))return e;if(this.config.cacheCoercions){const r=`${this.inferType(e)}:${t}:${JSON.stringify(e)}`;if(this.coercionCache.has(r))return this.coercionCache.get(r)}const i=this.inferType(e),a=n.coerceFrom?.[i];if(a){const n=a(e,r);if(this.config.cacheCoercions&&null!==n){const r=`${i}:${t}:${JSON.stringify(e)}`;this.coercionCache.set(r,n)}return n}return n.defaultValue}canCoerce(e,t){const r=this.types.get(t);if(!r)return!1;if(r.isType(e))return!0;const n=this.inferType(e);return void 0!==r.coerceFrom?.[n]}getCoercionInfo(e,t){const r=this.types.get(t);return r&&(e===t||r.coerceFrom?.[e])?{possible:!0,direct:!0}:{possible:!1,direct:!1}}clearCache(){this.coercionCache.clear()}getStats(){return{typeCount:this.types.size,cacheSize:this.coercionCache.size,typeNames:this.getTypeNames()}}registerBuiltinTypes(){this.register({name:"String",hyperscriptType:"string",tsType:"string",isType:e=>"string"==typeof e,defaultValue:"",description:"Text string value",examples:["hello","world",""],coerceFrom:{Number:e=>e+"",Boolean:e=>e+"",Null:()=>"",Undefined:()=>"",Array:e=>Array.isArray(e)?e.join(", "):null,Object:e=>{try{return JSON.stringify(e)}catch{return e+""}},Element:e=>e instanceof Element?e.textContent??e.outerHTML:null}}),this.register({name:"Number",hyperscriptType:"number",tsType:"number",isType:e=>"number"==typeof e&&!isNaN(e),defaultValue:0,description:"Numeric value (integer or float)",examples:[0,1,3.14,-42],coerceFrom:{String:e=>{const t=parseFloat(e);return isNaN(t)?null:t},Boolean:e=>e?1:0,Null:()=>0,Undefined:()=>null}}),this.register({name:"Boolean",hyperscriptType:"boolean",tsType:"boolean",isType:e=>"boolean"==typeof e,defaultValue:!1,description:"True or false value",examples:[!0,!1],coerceFrom:{String:e=>{const t=e.toLowerCase().trim();return"true"===t||"yes"===t||"1"===t||"false"!==t&&"no"!==t&&"0"!==t&&""!==t&&t.length>0},Number:e=>0!==e,Null:()=>!1,Undefined:()=>!1,Array:e=>!!Array.isArray(e)&&e.length>0,Element:e=>e instanceof Element,ElementList:e=>Array.isArray(e)&&e.length>0}}),this.register({name:"Element",hyperscriptType:"element",tsType:"Element | HTMLElement",isType:e=>e instanceof Element,defaultValue:null,description:"DOM Element",coerceFrom:{String:(e,t)=>{const r=e;if(r.startsWith("#")||r.startsWith(".")||r.match(/^[\w-]+$/))try{return document.querySelector(r)}catch{return null}return null},ElementList:e=>Array.isArray(e)&&e.length>0?e[0]:null,NodeList:e=>e.length>0?e[0]:null}}),this.register({name:"ElementList",hyperscriptType:"element-list",tsType:"Element[]",isType:e=>Array.isArray(e)&&e.length>0&&e.every(e=>e instanceof Element),defaultValue:[],description:"Array of DOM Elements",coerceFrom:{Element:e=>e instanceof Element?[e]:[],NodeList:e=>Array.from(e),String:e=>{try{return Array.from(document.querySelectorAll(e))}catch{return[]}},Array:e=>{const t=e;return t.every(e=>e instanceof Element)?t:[]}}}),this.register({name:"Array",hyperscriptType:"array",tsType:"unknown[]",isType:e=>Array.isArray(e),defaultValue:[],description:"Array of values",coerceFrom:{String:e=>{const t=e;try{const e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return t.split(",").map(e=>e.trim())},ElementList:e=>e,NodeList:e=>Array.from(e),Object:e=>Object.values(e)}}),this.register({name:"Object",hyperscriptType:"object",tsType:"Record<string, unknown>",isType:e=>!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof Element),defaultValue:{},description:"Plain JavaScript object",coerceFrom:{String:e=>{try{const t=JSON.parse(e);if("object"==typeof t&&null!==t&&!Array.isArray(t))return t}catch{}return null},Array:e=>{const t={};return e.forEach((e,r)=>{t[r+""]=e}),t}}}),this.register({name:"Null",hyperscriptType:"null",tsType:"null",isType:e=>null===e,defaultValue:null,description:"Null value"}),this.register({name:"Undefined",hyperscriptType:"undefined",tsType:"undefined",isType:e=>void 0===e,defaultValue:void 0,description:"Undefined value"}),this.register({name:"Function",hyperscriptType:"function",tsType:"Function",isType:e=>"function"==typeof e,defaultValue:null,description:"JavaScript function"}),this.register({name:"Event",hyperscriptType:"event",tsType:"Event",isType:e=>e instanceof Event,defaultValue:null,description:"DOM Event"}),this.register({name:"NodeList",hyperscriptType:"element-list",tsType:"NodeList",isType:e=>e instanceof NodeList,defaultValue:null,description:"DOM NodeList (typically from querySelectorAll)",coerceFrom:{Array:e=>null}}),this.register({name:"Unknown",hyperscriptType:"unknown",tsType:"unknown",isType:e=>!0,defaultValue:null,description:"Unknown/any value type"})}};function Cr(e){const t=xr.get("String");return t?t.isType(e):"string"==typeof e}function Ar(e){const t=xr.get("Number");return t?t.isType(e):"number"==typeof e}function Sr(e){const t=xr.get("Boolean");return t?t.isType(e):"boolean"==typeof e}function Tr(e){const t=xr.get("Object");return t?t.isType(e):"object"==typeof e&&null!==e}function Lr(e){const t=xr.get("Function");return t?t.isType(e):"function"==typeof e}function Or(e){return null!==e&&"object"==typeof e&&"nodeType"in e&&1===e.nodeType&&"style"in e}function jr(e){return e instanceof Element}function Pr(e){return e instanceof HTMLElement}const Ir=new Set(["disabled","readonly","required","checked","selected","hidden","open","autofocus","autoplay","controls","loop","muted","multiple","reversed","defer","async","novalidate","formnovalidate","ismap"]);function qr(e,t){return Ir.has(t.toLowerCase())?e.hasAttribute(t):e.getAttribute(t)}const Nr={id:e=>e.id,classname:e=>e.className,class:e=>e.className,tagname:e=>e.tagName.toLowerCase(),innertext:e=>e.textContent?.trim(),innerHTML:e=>e.innerHTML,outerhtml:e=>e.outerHTML,value:e=>function(e){if(null===e||"object"!=typeof e||!("tagName"in e))return!1;const t=e.tagName;return"INPUT"===t||"SELECT"===t||"TEXTAREA"===t}(e)?e.value:void 0,checked:e=>function(e){return null!==e&&"object"==typeof e&&"tagName"in e&&"INPUT"===e.tagName}(e)?e.checked:void 0,disabled:e=>"disabled"in e?e.disabled:void 0,selected:e=>function(e){return null!=e&&"object"==typeof e&&"tagName"in e&&"OPTION"===e.tagName}(e)?e.selected:void 0,tabindex:e=>Or(e)?e.tabIndex:void 0,hidden:e=>Or(e)?e.hidden:void 0,style:e=>getComputedStyle(e),children:e=>Array.from(e.children),parent:e=>e.parentElement,firstchild:e=>e.firstElementChild,lastchild:e=>e.lastElementChild,nextsibling:e=>e.nextElementSibling,previoussibling:e=>e.previousElementSibling,next:e=>e.nextElementSibling,previous:e=>e.previousElementSibling,values:e=>function(e){if(e instanceof HTMLFormElement)return new FormData(e);const t=new FormData;return e.querySelectorAll("input, select, textarea").forEach(e=>{const r=e.getAttribute("name");r&&"value"in e&&t.append(r,e.value)}),t}(e)};function Rr(e,t){if(t.startsWith("*"))return function(e,t){if(!Pr(e))return;if(t.startsWith("computed-"))return getComputedStyle(e).getPropertyValue(t.slice(9))||"";const r=t.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());return e.style[r]}(e,t.slice(1));if(t.startsWith("computed-")){const r=t.slice(9);return Pr(e)?getComputedStyle(e).getPropertyValue(r):void 0}if(t.startsWith("@"))return qr(e,t.slice(1));const r=Nr[t.toLowerCase()];if(r)return r(e);if(function(e,t){return e.hasAttribute(t)}(e,t))return qr(e,t);const n=e[t];return Lr(n)?n.bind(e):n}const Mr={1:"one",2:"two",3:"three",4:"four",5:"five"};function $r(e,t,r,n){if(e.length!==t){return`${r} requires exactly ${i=t,Mr[i]??i+""} argument${1===t?"":"s"}${n?` (${n})`:""}`}var i;return null}function _r(e,t,r,n){return"string"!=typeof e[t]?`${r} ${n||"argument "+(t+1)} must be a string`:null}function zr(e,t,r){return $r(e,1,t,r)??_r(e,0,t,r)}function Vr(e,t){return $r(e,2,t,"left, right")}function Hr(){return null}function Br(e,t,r,n){return e.length>t?`${r} expression takes at most ${1===t?"one":t+""} argument${1===t?"":"s"}${n?` (${n})`:""}`:null}function Wr(e,t,r,n,i){return t>e.length||e.length>r?`${n} requires ${t}-${r} arguments${i?` (${i})`:""}`:null}const Dr={conversions:{dynamicResolvers:[]}},Fr={Array:e=>Array.isArray(e)?e:e instanceof NodeList?Array.from(e):null==e?[]:[e],String:e=>null==e?"":Cr(e)?e:Tr(e)?JSON.stringify(e):e+"",Boolean:e=>{if(Sr(e))return e;if(null==e)return!1;if(Cr(e)){const t=e.toLowerCase().trim();return"false"!==t&&"0"!==t&&""!==t}return Ar(e)?0!==e&&!isNaN(e):!!e},Number:e=>{if(Ar(e))return e;if(null==e)return 0;const t=Number(e);return isNaN(t)?0:t},Math:e=>{if(Ar(e))return e;if(null==e)return 0;const t=(e+"").trim();if(!t)return 0;try{return function(e){if(e=e.replace(/\s/g,""),!/^[0-9+\-*/().]+$/.test(e))throw Error("Invalid characters in math expression");try{const t=Function(`"use strict"; return (${e})`)();if(!Ar(t)||!isFinite(t))throw Error("Expression did not evaluate to a finite number");return t}catch(e){throw Error("Math expression evaluation failed: "+(e instanceof Error?e.message:e+""))}}(t)}catch(e){return console.warn("Math conversion failed:",e),0}},Int:e=>{const t=Fr.Number(e);return Math.trunc(t)},Float:e=>{const t=Fr.Number(e);return parseFloat(""+t)},Date:e=>{if(e instanceof Date)return e;if(null==e)return new Date(NaN);if(Cr(e)&&/^\d{4}-\d{2}-\d{2}$/.test(e)){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}return new Date(e)},JSON:e=>{if(!Cr(e))return e;try{return JSON.parse(e)}catch{return e}},JSONString:e=>{try{return JSON.stringify(e)}catch{return"{}"}},Object:e=>{if(Tr(e))return e;if(Cr(e))try{return JSON.parse(e)}catch(e){return{}}return{}},Fragment:e=>{const t=document.createDocumentFragment(),r=Array.isArray(e)||e instanceof NodeList?Array.from(e):[e];for(const e of r)if(e instanceof Node)t.append(e);else{const r=document.createElement("template");r.innerHTML=null==e?"":e+"",t.append(r.content)}return t},HTML:e=>Cr(e)?e:e instanceof NodeList?Array.from(e).map(e=>e instanceof Element?e.outerHTML:e.textContent||"").join(""):Array.isArray(e)?e.map(e=>e instanceof Element?e.outerHTML:Fr.String(e)).join(""):e instanceof Element?e.outerHTML:Fr.String(e),Values:(e,t)=>{if(e instanceof HTMLFormElement)return function(e){const t={};return e.querySelectorAll("input, select, textarea").forEach(e=>{const r=e;if(r.name){const e=Ur(r);void 0!==e&&(void 0!==t[r.name]?(Array.isArray(t[r.name])||(t[r.name]=[t[r.name]]),t[r.name].push(e)):t[r.name]=e)}}),t}(e);if(e instanceof HTMLElement){const t=e.querySelectorAll("input, select, textarea"),r={};return t.forEach(e=>{e.name&&(r[e.name]=Ur(e))}),r}return{}},FormEncoded:(e,t)=>{const r=e instanceof HTMLElement?Fr.Values(e,t):e;if(!Tr(r))return"";const n=new URLSearchParams;for(const[e,t]of Object.entries(r))if(null!=t)if(Array.isArray(t))for(const r of t)n.append(e,r+"");else n.append(e,t+"");return""+n},Set:e=>new Set(e),Map:e=>new Map(Object.entries(e??{})),Keys:e=>e instanceof Map?Array.from(e.keys()):Object.keys(e??{}),Entries:e=>e instanceof Map?Array.from(e.entries()):Object.entries(e??{}),Reversed:e=>Array.from(e).reverse(),Unique:e=>[...new Set(e)],Flat:e=>Array.from(e).flat(),"Values:Form":(e,t)=>{const r=Fr.Values(e,t);return Fr.FormEncoded(r,t)},"Values:JSON":(e,t)=>{const r=Fr.Values(e,t);return JSON.stringify(r)}};function Ur(e){if(e instanceof HTMLInputElement)switch(e.type){case"checkbox":return e.checked;case"radio":return e.checked?e.value:void 0;case"number":case"range":return e.valueAsNumber;case"date":case"datetime-local":return e.valueAsDate;case"file":return e.files;default:return e.value}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions).map(e=>e.value):e.value}const Kr={boolean:"Boolean",bool:"Boolean",string:"String",str:"String",number:"Number",num:"Number",int:"Int",integer:"Int",float:"Float",array:"Array",object:"Object",obj:"Object",date:"Date",json:"JSON",jsonstring:"JSONString",formencoded:"FormEncoded"};function Zr(e,t,r){if("string"!=typeof t)throw Error("Conversion type must be a string");if(t.startsWith("Fixed")){const{precision:r}=function(e){const t=e.match(/^Fixed(?::(\d+))?$/);return t?{precision:t[1]?parseInt(t[1],10):0}:{}}(t);return Fr.Number(e).toFixed(r??0)}if(null==e)return e;let n=Fr[t];if(n)return n(e,r);const i=Kr[t.toLowerCase()];if(i&&(n=Fr[i],n))return n(e,r);const a=Dr.conversions[t];if("function"==typeof a)return a(e,r);for(const r of Dr.conversions.dynamicResolvers){const n=r(t,e);if(void 0!==n)return n}return console.warn("Unknown conversion type: "+t),e}const Xr={as:{name:"as",category:"Conversion",evaluatesTo:"Any",precedence:20,associativity:"Left",operators:["as"],async evaluate(e,...t){const[r,n]=t;return Zr(r,n,e)},validate:e=>$r(e,2,"as","value, type")??_r(e,1,"as","conversion type")},is:{name:"is",category:"Conversion",evaluatesTo:"Boolean",precedence:10,associativity:"Left",operators:["is a","is an"],async evaluate(e,...t){const[r,n]=t;if(!Cr(n))throw Error("Type check requires a string type");switch(n.toLowerCase()){case"null":return null===r;case"undefined":return void 0===r;case"string":return Cr(r);case"number":return Ar(r)&&!isNaN(r);case"boolean":return Sr(r);case"object":return Tr(r);case"array":return Array.isArray(r);case"function":return Lr(r);case"date":return r instanceof Date;case"element":return r instanceof Element;case"node":return r instanceof Node;case"nodelist":return r instanceof NodeList;case"empty":return null==r||""===r||Array.isArray(r)&&0===r.length||Tr(r)&&0===Object.keys(r).length;default:return r?.constructor?.name?.toLowerCase()===n.toLowerCase()}},validate:e=>$r(e,2,"is","value, type")??_r(e,1,"is","type")},async:{name:"async",category:"Conversion",evaluatesTo:"Any",precedence:25,associativity:"Right",operators:["async"],evaluate:async(e,t)=>t,validate:e=>$r(e,1,"async","expression")}},Gr=new Set(["__proto__","constructor","prototype"]);function Jr(e,t){if(e instanceof Element)return Rr(e,t);if(Tr(e)){if(Gr.has(t))return;return e[t]}return e[t]}function Yr(e){let t;if(Array.isArray(e))t=e;else{if(!("undefined"!=typeof NodeList&&e instanceof NodeList||"undefined"!=typeof HTMLCollection&&e instanceof HTMLCollection))return!1;t=Array.from(e)}return 0!==t.length&&t.every(e=>e instanceof Element||null!=e&&"object"==typeof e&&e.constructor!==Object&&!Array.isArray(e))}const Qr={possessive:{name:"possessive",category:"Reference",evaluatesTo:"Any",operators:["'s","s"],async evaluate(e,...t){const[r,n]=t;if(null!=r){if("string"!=typeof n)throw Error("Property name must be a string");return Yr(r)&&!(n in r)?Array.from(r,e=>Jr(e,n)):Jr(r,n)}},validate:e=>$r(e,2,"possessive","element, property")??_r(e,1,"possessive","property name")},my:{name:"my",category:"Reference",evaluatesTo:"Any",operators:["my"],async evaluate(e,...t){const[r]=t;if(e.me){if("string"!=typeof r)throw Error("Property name must be a string");if(e.me instanceof Element)return Rr(e.me,r);if(Tr(e.me)){if(Gr.has(r))return;return e.me[r]}return e.me[r]}},validate:e=>zr(e,"my","property")},its:{name:"its",category:"Reference",evaluatesTo:"Any",operators:["its"],async evaluate(e,...t){const[r]=t;if(null==e.it)return;if("string"!=typeof r)throw Error("Property name must be a string");const n=e.it;if(n instanceof Element)return Rr(n,r);if(Tr(n)){if(Gr.has(r))return;return n[r]}return n[r]},validate:e=>zr(e,"its","property")},your:{name:"your",category:"Reference",evaluatesTo:"Any",operators:["your"],async evaluate(e,...t){const[r]=t;if(e.you){if("string"!=typeof r)throw Error("Property name must be a string");if(e.you instanceof Element)return Rr(e.you,r);if(Tr(e.you)){if(Gr.has(r))return;return e.you[r]}return e.you[r]}},validate:e=>zr(e,"your","property")},of:{name:"of",category:"Reference",evaluatesTo:"Any",operators:["of"],async evaluate(e,...t){const[r,n]=t;if(null!=n){if("string"!=typeof r)throw Error("Property name must be a string");if(n instanceof Element)return Rr(n,r);if(Tr(n)){if(Gr.has(r))return;return n[r]}return n[r]}},validate:e=>$r(e,2,"of","property, object")??_r(e,0,"of","property name")},attribute:{name:"attribute",category:"Reference",evaluatesTo:"String",operators:["@"],async evaluate(e,...t){const[r,n]=t;if("string"!=typeof r)throw Error("Attribute name must be a string");const i=n||e.me;return i&&i instanceof Element?i.getAttribute(r):null},validate:e=>Wr(e,1,2,"attribute","attributeName, optional element")??_r(e,0,"attribute","attribute name")??(2>e.length||null==e[1]||e[1]instanceof Element?null:"attribute element must be an Element")},attributeWithValue:{name:"attributeWithValue",category:"Reference",evaluatesTo:"Boolean",operators:["@="],async evaluate(e,...t){const[r,n,i]=t;if("string"!=typeof r)throw Error("Attribute name must be a string");if("string"!=typeof n)throw Error("Expected value must be a string");const a=i||e.me;return!!(a&&a instanceof Element)&&a.getAttribute(r)===n},validate:e=>Wr(e,2,3,"attributeWithValue","attributeName, expectedValue, optional element")??_r(e,0,"attributeWithValue","attribute name")??_r(e,1,"attributeWithValue","expected value")??(3>e.length||null==e[2]||e[2]instanceof Element?null:"attributeWithValue element must be an Element")},classReference:{name:"classReference",category:"Reference",evaluatesTo:"Array",operators:["."],async evaluate(e,...t){const[r]=t;if("string"!=typeof r)throw Error("Class name must be a string");const n=r.startsWith(".")?r.slice(1):r,i=document.getElementsByClassName(n);return Array.from(i)},validate:e=>zr(e,"classReference","className")},idReference:{name:"idReference",category:"Reference",evaluatesTo:"Element",operators:["#"],async evaluate(e,...t){const[r]=t;if("string"!=typeof r)throw Error("ID value must be a string");const n=r.startsWith("#")?r.slice(1):r;return document.getElementById(n)},validate:e=>zr(e,"idReference","idValue")}};function en(e){return Array.isArray(e)?e:null==e?[]:"string"==typeof e?[e]:e instanceof NodeList||e instanceof HTMLCollection||"number"==typeof e.length?Array.from(e):[e]}function tn(e,t){const r=e.registry?.get(t);if(!r)throw Error(`Expression '${t}' not in ExecutionContext.registry. The bundle's ExpressionRegistry must include this expression's category. Use createExpressionRegistry() with the relevant category objects (referencesExpressions, logicalExpressions, conversionExpressions, positionalExpressions, propertiesExpressions, specialExpressions, mathematicalExpressions).`);return r}function rn(e){if(e&&"object"==typeof e&&"success"in e){if(e.success)return"value"in e?e.value:void 0;const t=e.errors||[];throw Error(t.length>0?t[0].message:"Expression evaluation failed")}return e}async function nn(e,t){if(!e)throw Error("Cannot evaluate null or undefined AST node");if("literal"===e.type)return e.value;if("identifier"===e.type)return dn(e,t);const r=e;switch(e.type){case"literal":return function(e){return e.value}(r);case"identifier":return dn(r,t);case"binaryExpression":return async function(e,t){const r=e.operator,n=e.right,i=e.left;if("="===r){const r=await nn(e.right,t);if("identifier"===i?.type&&"string"==typeof i.name){const e=i.name;return e.startsWith("$")?_e(t,e.slice(1),r):"global"===i.scope?_e(t,e,r):"element"===i.scope?dr(t,e,r):(t.locals||(t.locals=new Map),t.locals.set(e,r)),r}throw Error(`Assignment target must be a variable identifier (got '${i?.type??"undefined"}')`)}if("has"===r||"have"===r){const r=await nn(e.left,t);return!!(r instanceof Element&&"selector"===n.type&&"string"==typeof n.value&&n.value.startsWith("."))&&r.classList.contains(n.value.slice(1))}if("in"===r||"is in"===r){const r="callExpression"===i?.type&&"identifier"===i.callee?.type?i.callee.name:null;if(("first"===r||"last"===r)&&Array.isArray(i.arguments)){const n=i.arguments[0];if("selector"===n?.type&&"string"==typeof n.value){const i=await nn(e.right,t);if(i&&"function"==typeof i.querySelectorAll){const e=Array.from(i.querySelectorAll(n.value));return 0===e.length?null:"first"===r?e[0]:e[e.length-1]}}}if("selector"===i?.type&&i.fromQuery&&"string"==typeof i.value){const r=await nn(e.right,t),n=r&&"function"==typeof r.querySelectorAll?r:null;if(n)return Array.from(n.querySelectorAll(i.value))}}if("of"===r&&"selector"===i?.type&&"string"==typeof i.value&&/^\*[a-zA-Z][\w-]*$/.test(i.value)){const r=await nn(e.right,t);return tn(t,"styleRef").evaluate(t,i.value.slice(1),r)}if("of"===r){const r=mn(e.left);if(r){const n=await nn(e.right,t);let i=n;for(const e of r){if(null==i)return;i=jr(i)?Rr(i,e):i[e]}return"function"==typeof i?i.bind(n):i}}const a=await nn(e.left,t);if("and"===r){if(!a)return a;const r=await nn(e.right,t);return tn(t,"and").evaluate(t,a,r)}if("or"===r){if(a)return a;const r=await nn(e.right,t);return tn(t,"or").evaluate(t,a,r)}const s=await nn(e.right,t),o=e=>"string"==typeof e?e.toLowerCase():e,l=e.ignoringCase?o(a):a,c=e.ignoringCase?o(s):s;switch(r){case"+":{let r=a,n=s;return e.coerceNumeric&&("string"==typeof r&&(r=yr(r)),"string"==typeof n&&(n=yr(n))),"string"==typeof r||"string"==typeof n?(r??"")+""+(n??""):Array.isArray(r)?Array.isArray(n)?[...r,...n]:[...r,n]:rn(await tn(t,"addition").evaluate(t,{left:r,right:n}))}case"-":return rn(await tn(t,"subtraction").evaluate(t,{left:a,right:s}));case"*":return rn(await tn(t,"multiplication").evaluate(t,{left:a,right:s}));case"/":return rn(await tn(t,"division").evaluate(t,{left:a,right:s}));case"%":case"mod":return rn(await tn(t,"modulo").evaluate(t,{left:a,right:s}));case"^":case"**":return rn(await tn(t,"power").evaluate(t,{left:a,right:s}));case">":case"is greater than":return tn(t,"greaterThan").evaluate(t,a,s);case"<":case"is less than":return tn(t,"lessThan").evaluate(t,a,s);case">=":case"is greater than or equal to":return tn(t,"greaterThanOrEqual").evaluate(t,a,s);case"<=":case"is less than or equal to":return tn(t,"lessThanOrEqual").evaluate(t,a,s);case"==":return tn(t,"equals").evaluate(t,l,c);case"is":case"am":case"equals":case"is equal":case"is equal to":{const r=fn(e,a,s);return void 0!==r?r:tn(t,"equals").evaluate(t,l,c)}case"!=":return tn(t,"notEquals").evaluate(t,l,c);case"is not":case"is not equal":case"is not equal to":{const r=fn(e,a,s);return void 0!==r?!r:tn(t,"notEquals").evaluate(t,l,c)}case"===":case"really equals":case"is really":case"is really equal to":return tn(t,"strictEquals").evaluate(t,l,c);case"!==":case"is not really":case"is not really equal to":return tn(t,"strictNotEquals").evaluate(t,l,c);case"as":return tn(t,"as").evaluate(t,a,gn(s));case"contains":case"contain":case"includes":case"include":return tn(t,"contains").evaluate(t,l,c);case"does not contain":case"do not contain":case"does not contains":case"does not include":return tn(t,"doesNotContain").evaluate(t,l,c);case"starts with":return tn(t,"startsWith").evaluate(t,l,c);case"ends with":return tn(t,"endsWith").evaluate(t,l,c);case"does not start with":return!await tn(t,"startsWith").evaluate(t,l,c);case"does not end with":return!await tn(t,"endsWith").evaluate(t,l,c);case"match":case"matches":return tn(t,"matches").evaluate(t,l,hn(e.right,c));case"does not match":case"do not match":return!await tn(t,"matches").evaluate(t,l,hn(e.right,c));case"in":case"is in":case"am in":return pn(a,s);case"is not in":case"am not in":return!pn(a,s);case"of":return s&&"object"==typeof s?s[a]:void 0;case"precedes":return yn(a,s,Node.DOCUMENT_POSITION_FOLLOWING);case"does not precede":return!yn(a,s,Node.DOCUMENT_POSITION_FOLLOWING);case"follows":return yn(a,s,Node.DOCUMENT_POSITION_PRECEDING);case"does not follow":return!yn(a,s,Node.DOCUMENT_POSITION_PRECEDING);default:throw Error("Unknown binary operator: "+r)}}(r,t);case"asExpression":return async function(e,t){const r=await nn(e.expression,t),n=gn(e.targetType);return tn(t,"as").evaluate(t,r,n)}(r,t);case"betweenExpression":return async function(e,t){const r=await nn(e.value,t),n=await nn(e.min,t),i=await nn(e.max,t),a=e=>"string"==typeof e?e.toLowerCase():e,[s,o,l]=e.ignoringCase?[a(r),a(n),a(i)]:[r,n,i],c=await tn(t,"between").evaluate(t,s,o,l);return e.negated?!c:c}(r,t);case"typeCheckExpression":return async function(e,t){const r=function(e,t,r){if(null==e&&r)return!0;if(Object.prototype.toString.call(e).slice(8,-1)===t)return!0;const n=globalThis[t];return"function"==typeof n&&e instanceof n}(await nn(e.value,t),e.typeName+"",!1!==e.nullOk);return e.negated?!r:r}(r,t);case"collectionExpression":return async function(e,t){const r=await nn(e.collection,t);if(null==r)return r;const n=async(e,r)=>nn(e,{...t,it:r});switch(e.operator){case"where":return async function(e,t,r){const n=en(e),i=[];for(const e of n)await r(t,e)&&i.push(e);return i}(r,e.right,n);case"sorted by":return async function(e,t,r,n){const i=[...en(e)],a=await Promise.all(i.map(e=>n(t,e))),s=i.map((e,t)=>t);s.sort((e,t)=>{const r=a[e],n=a[t];return r===n?0:null==r?1:null==n||n>r?-1:1});const o=s.map(e=>i[e]);return"desc"===r?o.reverse():o}(r,e.right,e.order??"asc",n);case"mapped to":return async function(e,t,r){const n=en(e);return Promise.all(n.map(e=>r(t,e)))}(r,e.right,n);case"split by":return a=await nn(e.right,t),null==(i=r)?[]:(i+"").split(null==a?"":a+"");case"joined by":return function(e,t){const r=null==t?"":t+"";return en(e).map(e=>null==e?"":e+"").join(r)}(r,await nn(e.right,t));default:throw Error("Unknown collection operator: "+e.operator)}var i,a}(r,t);case"unaryExpression":return async function(e,t){const r=e.operand??e.argument;if(!r)throw Error(`Unary expression has no operand (operator: ${e.operator})`);const n=await nn(r,t);switch(e.operator){case"not":case"!":return tn(t,"not").evaluate(t,n);case"no":return tn(t,"no").evaluate(t,n);case"-":return-n;case"+":return+n;case"exists":case"some":return tn(t,"exists").evaluate(t,n);case"does not exist":return tn(t,"doesNotExist").evaluate(t,n);case"is empty":return tn(t,"isEmpty").evaluate(t,n);case"is not empty":return tn(t,"isNotEmpty").evaluate(t,n);default:throw Error("Unknown unary operator: "+e.operator)}}(r,t);case"memberExpression":return async function(e,t){const r=await nn(e.object,t);if(e.computed){const n=await nn(e.property,t);return Array.isArray(r)&&"number"==typeof n&&0>n?r[r.length+n]:r?.[n]}return kn(r,e.property.name,t)}(r,t);case"propertyAccess":return async function(e,t){let r=await nn(e.object,t);for(const n of(e.property+"").split(".")){if(null==r)return;r=await kn(r,n,t)}return r}(r,t);case"callExpression":return async function(e,t){const r=await nn(e.callee,t);if(e.isConstructor&&"function"==typeof r)return new r(...await Promise.all(e.arguments.map(e=>nn(e,t))));if("identifier"===e.callee.type){const n=e.callee.name,i=await async function(e,t,r){return En.has(t)?Promise.all(e.map(e=>"identifier"===e.type&&e.name?e.name:"selector"===e.type&&e.value?e.value:nn(e,r))):Promise.all(e.map(e=>nn(e,r)))}(e.arguments,n,t);switch(n){case"closest":return tn(t,"closest").evaluate(t,...i);case"previous":case"next":{const r=e.relativePositional;if(r){const e=r.from?xn(await nn(r.from,t)):t.me,a=r.within?xn(await nn(r.within,t)):void 0,s=r.inElt?await nn(r.inElt,t):void 0;return tn(t,n).evaluate(t,i[0],e,{within:a,inElt:s,inSearch:r.inSearch,wrapping:r.wrapping})}return tn(t,n).evaluate(t,...i)}case"first":return tn(t,"first").evaluate(t,...i);case"last":return tn(t,"last").evaluate(t,...i);default:if("function"==typeof r)return r(...i);throw Error("Cannot call non-function: "+n)}}if("function"==typeof r){const n=await Promise.all(e.arguments.map(e=>nn(e,t)));if("memberExpression"===e.callee.type&&e.callee.object){const i=await nn(e.callee.object,t);return r.apply(i,n)}return r(...n)}throw Error("Cannot call non-function")}(r,t);case"selector":return async function(e,t){let r=e.value;if("string"==typeof r&&!e.fromQuery&&/^\*[a-zA-Z][\w-]*$/.test(r))return tn(t,"styleRef").evaluate(t,r.slice(1));if("string"==typeof r&&e.fromQuery&&/\$[^=]/.test(r)){const{selector:n,elements:i}=await async function(e,t){const r=Ln(e),n=await Promise.all(r.filter(e=>"expr"in e).map(e=>ln(e.expr,t)));return On(r,n)}(r,t),a=Sn(e,n);i.forEach((e,t)=>e.setAttribute("data-hs-query-id",t+""));try{return await tn(t,"elementWithSelector").evaluate(t,a)}finally{i.forEach(e=>e.removeAttribute("data-hs-query-id"))}}"string"==typeof r&&!e.fromQuery&&r.includes("{")&&(r=await function(e,t){return wn(e,/\{([^}]*)\}/g,async(e,r)=>(await ln(r.trim(),t)??"")+"")}(r,t));const n="string"==typeof r?Sn(e,r):r;return wr(await tn(t,"elementWithSelector").evaluate(t,n),r,e.fromQuery)}(r,t);case"contextReference":return async function(e,t){switch(e.contextType){case"me":case"you":case"it":return tn(t,e.contextType).evaluate(t);case"my":case"myself":case"I":return tn(t,"me").evaluate(t);case"your":case"yourself":return tn(t,"you").evaluate(t);case"its":return tn(t,"it").evaluate(t);case"event":return t.event;case"target":return t.target??t.event?.target??tn(t,"me").evaluate(t);case"body":return"undefined"!=typeof document?document.body:void 0;case"document":return tn(t,"document").evaluate(t);case"window":return tn(t,"window").evaluate(t);default:return}}(r,t);case"possessiveExpression":return async function(e,t){const r=await nn(e.object,t),n=e.property.name;return tn(t,"possessive").evaluate(t,r,n)}(r,t);case"eventHandler":return async function(e,t){return{event:e.event,selector:e.selector,commands:e.commands,handler:async r=>{const n={...t,event:r,target:r.target,currentTarget:r.currentTarget};for(const t of e.commands)await nn(t,n)}}}(r,t);case"conditionalExpression":return async function(e,t){return await nn(e.test,t)?nn(e.consequent,t):e.alternate?nn(e.alternate,t):void 0}(r,t);case"string":return r.value;case"arrayLiteral":return async function(e,t){const r=[];for(const n of e.elements)r.push(await nn(n,t));return r}(r,t);case"objectLiteral":return async function(e,t){const r={};for(const n of e.properties){const e=n.key;let i;i="identifier"===e.type?e.name:"literal"===e.type&&"string"===e.valueType?e.value:await nn(e,t)+"",r[i]=await nn(n.value,t)}return r}(r,t);case"attributeAccess":return async function(e,t){const r=e.attributeName;return t.me&&t.me instanceof Element?t.me.getAttribute(r):"@"+r}(r,t);case"propertyOfExpression":return async function(e,t){const r=e.property;if("identifier"!==r?.type)throw Error('Property name must be an identifier in "the X of Y" pattern');const n=r.name,i=await nn(e.target,t);if(null==i)throw Error(`Cannot access property "${n}" of ${i}`);return tn(t,"possessive").evaluate(t,i,n)}(r,t);case"templateLiteral":return async function(e,t){let r=e.value;return r=await wn(r,/\$([a-zA-Z_$][a-zA-Z0-9_.$]*|\d+)/g,async(e,r)=>{try{if(/^\d+$/.test(r))return r;if(r.includes(".")){const e=r.split(".");let n=bn(e[0],t);for(let t=1;e.length>t&&null!=n;t++)n=n[e[t]];return(n??"")+""}return(bn(r,t)??"")+""}catch{return""}}),r=await wn(r,/\$(?:\{([^}]+)\}|\(([^)]+)\))/g,async(e,r,n)=>{const i=r||n;try{return await ln(i,t)+""}catch{return"undefined"}}),r}(r,t);case"stringPostfix":return async function(e,t){return`${await nn(e.expression,t)}${e.unit}`}(r,t);case"blockLiteral":return vn(r,t);default:{const r=Te.get(e.type);if(r)return r(e,t);throw Error("Unknown AST node type: "+e.type)}}}class an extends Error{constructor(e){super(`Expression node "${e}" is not synchronously evaluable`),this.name="NotSyncEvaluable"}}function sn(e,t){const r=e;switch(r?.type){case"literal":case"string":return r.value;case"selector":return function(e,t){const r=e.value;if("string"!=typeof r)throw new an("selector");if(!e.fromQuery&&/^\*[a-zA-Z][\w-]*$/.test(r))throw new an("selector");if(e.fromQuery&&/\$[^=]/.test(r)){const{selector:n,elements:i}=function(e,t){const r=Ln(e),n=r.filter(e=>"expr"in e).map(e=>on(e.expr,t));return On(r,n)}(r,t),a=Sn(e,n),s=t?.me?.ownerDocument??("undefined"!=typeof document?document:null);if(!s)throw new an("selector");i.forEach((e,t)=>e.setAttribute("data-hs-query-id",t+""));try{return Array.from(s.querySelectorAll(a))}finally{i.forEach(e=>e.removeAttribute("data-hs-query-id"))}}const n=!e.fromQuery&&r.includes("{")?function(e,t){return e.replace(/\{([^}]*)\}/g,(e,r)=>(on(r.trim(),t)??"")+"")}(r,t):r,i=Sn(e,n),a=t?.me?.ownerDocument??("undefined"!=typeof document?document:null);if(!a)throw new an("selector");return wr(Array.from(a.querySelectorAll(i)),n,e.fromQuery)}(r,t);case"identifier":return function(e,t,r){return"me"===e||"my"===e||"I"===e?t.me:"you"===e||"your"===e||"yourself"===e?t.you:"it"===e||"its"===e?t.it??t.result:"result"===e?t.result??t.it:"window"===e?"undefined"!=typeof window?window:globalThis:"document"===e?"undefined"!=typeof document?document:void 0:"element"===r?ur(t,e):t.locals?.has(e)?t.locals.get(e):t.globals?.has(e)?t.globals.get(e):e.startsWith("$")&&t.globals?.has(e.slice(1))?t.globals.get(e.slice(1)):void 0!==t[e]?t[e]:"undefined"!=typeof globalThis&&e in globalThis?globalThis[e]:void 0}(r.name,t,r.scope);case"contextReference":return function(e,t){switch(e){case"me":return t.me;case"you":return t.you;case"it":return t.it??t.result;case"event":return t.event;case"target":return t.target??t.event?.target??t.me;default:throw new an("contextReference")}}(r.contextType,t);case"arrayLiteral":return r.elements.map(e=>sn(e,t));case"objectLiteral":return function(e,t){const r={};for(const n of e.properties){const e=n.key;let i;i="identifier"===e.type?e.name:"literal"===e.type&&"string"===e.valueType?e.value:sn(e,t)+"",r[i]=sn(n.value,t)}return r}(r,t);case"asExpression":return Zr(sn(r.expression,t),gn(r.targetType),t);case"stringPostfix":return`${sn(r.expression,t)}${r.unit}`;case"blockLiteral":return vn(r,t);case"memberExpression":{const e=sn(r.object,t);if(null==e)return;if(e instanceof Element||Array.isArray(e)||"undefined"!=typeof Node&&e instanceof Node)throw new an("memberExpression");const n=e[r.computed?sn(r.property,t)+"":r.property?.name];return"function"==typeof n?n.bind(e):n}default:throw new an(r?.type??"unknown")}}function on(e,t){const r=er(e);if(!r.success||!r.node){const e=r.error??r.errors?.[0];throw Error("Failed to parse expression: "+(e?.message??"unknown error"))}return sn(r.node,t)}async function ln(e,t){const r=er(e);if(!r.success||!r.node){const e=r.error??r.errors?.[0];throw Error("Failed to parse expression: "+(e?.message??"unknown error"))}const n=t.registry?t:{...t,registry:await un()};return nn(r.node,n)}let cn=null;async function un(){if(!cn){const e=await Promise.resolve().then(function(){return iu});cn=e.createFullExpressionRegistry()}return cn}async function dn(e,t){const r=e.name;return"me"===r||"my"===r||"I"===r?tn(t,"me").evaluate(t):"you"===r||"your"===r||"yourself"===r?tn(t,"you").evaluate(t):"it"===r||"its"===r?tn(t,"it").evaluate(t):"result"===r?tn(t,"result").evaluate(t):"window"===r?tn(t,"window").evaluate(t):"document"===r?tn(t,"document").evaluate(t):"global"===e.scope&&t.globals?.has(r)?(Re(r,t),t.globals.get(r)):"element"===e.scope?ur(t,r):t.locals&&t.locals.has(r)?($e(r,t),t.locals.get(r)):t.globals&&t.globals.has(r)?(r.startsWith("$")&&Re(r.slice(1),t),t.globals.get(r)):r.startsWith("$")&&t.globals&&t.globals.has(r.slice(1))?(Re(r.slice(1),t),t.globals.get(r.slice(1))):void 0!==t[r]?t[r]:"undefined"!=typeof globalThis&&r in globalThis?globalThis[r]:void 0}function mn(e){const t=e;if(!t)return null;if("identifier"===t.type&&"string"==typeof t.name)return[t.name];if("memberExpression"===t.type&&!t.computed){const e=mn(t.object);if(!e)return null;const r=t.property,n="identifier"===r?.type&&"string"==typeof r.name?r.name:"string"==typeof r?.value?r.value:null;return null==n?null:[...e,n]}return null}function pn(e,t){return Array.isArray(t)?t.includes(e):"string"==typeof t?t.includes(e+""):e instanceof Node&&t instanceof Node?e===t||t.contains(e):null!=t&&"object"==typeof t&&e in t}function hn(e,t){return e&&"selector"===e.type&&"string"==typeof e.value?e.value:t}function fn(e,t,r){if(void 0!==r)return;const n=e.right;if(!n||"identifier"!==n.type||"string"!=typeof n.name)return;if(null==t||"object"!=typeof t)return;const i=t[n.name];return"boolean"==typeof i?!0===i:void 0}function yn(e,t,r){return e instanceof Node&&t instanceof Node&&0!==(e.compareDocumentPosition(t)&r)}function gn(e){if("string"==typeof e)return e;if(e&&"object"==typeof e){if("string"==typeof e.name)return e.name;if("string"==typeof e.value)return e.value}return e+""}function vn(e,t){const r=e.parameters??[];return(...n)=>{const i=new Map(t.locals??new Map);r.forEach((e,t)=>i.set(e,n[t]));const a={...t,locals:i};try{return sn(e.body,a)}catch(t){if(t instanceof an)return nn(e.body,a);throw t}}}function bn(e,t){if(t.locals?.has(e))return $e(e,t),t.locals.get(e);if("me"===e&&t.me)return t.me;if("you"===e&&t.you)return t.you;if("it"===e){const e=t.it??t.result;if(e)return e}if("result"===e){const e=t.result??t.it;if(e)return e}return"undefined"!=typeof window&&"window"===e?window:t.globals?.has(e)?t.globals.get(e):void 0}async function wn(e,t,r){const n=[];let i;for(;null!==(i=t.exec(e));)n.push({index:i.index,length:i[0].length,replacement:await r(i[0],...i.slice(1))});let a=e;for(let e=n.length-1;e>=0;e--){const{index:t,length:r,replacement:i}=n[e];a=a.substring(0,t)+i+a.substring(t+r)}return a}function kn(e,t,r){if("string"==typeof t&&t.startsWith("@")){const r=t.substring(1);return e&&"function"==typeof e.getAttribute?e.getAttribute(r):void 0}return e instanceof Element&&"string"==typeof t?Rr(e,t):Yr(e)&&!(t in e)?tn(r,"possessive").evaluate(r,e,t):e?.[t]}const En=new Set(["closest","previous","next"]);function xn(e){return e instanceof Element?e:Array.isArray(e)&&e[0]instanceof Element?e[0]:void 0}const Cn=RegExp("(\\.[a-zA-Z0-9_-]+):(?!(hover|active|focus|visited|link|focus-within|focus-visible|first-child|last-child|only-child|nth-child|nth-last-child|nth-of-type|nth-last-of-type|first-of-type|last-of-type|only-of-type|empty|root|target|lang|dir|not|has|is|where|matches|before|after|first-letter|first-line|selection|placeholder|marker|backdrop|enabled|disabled|checked|indeterminate|required|optional|valid|invalid|in-range|out-of-range|read-only|read-write|default|defined|fullscreen|modal|picture-in-picture|autofill)(?![a-zA-Z0-9_-]))","g"),An=/[:&()[\]/]/g;function Sn(e,t){return e.fromQuery||!t.startsWith(".")||t.includes("{")?function(e){return e.replace(Cn,"$1\\:")}(t):function(e){return e[0]+e.slice(1).replace(An,"\\$&")}(t)}const Tn=/\$\{([^}]+)\}|\$([a-zA-Z_$][a-zA-Z0-9_.$]*)/g;function Ln(e){const t=[];let r,n=0;for(Tn.lastIndex=0;null!==(r=Tn.exec(e));)r.index>n&&t.push({lit:e.slice(n,r.index)}),t.push({expr:r[1]??r[2]}),n=r.index+r[0].length;return e.length>n&&t.push({lit:e.slice(n)}),t}function On(e,t){let r="";const n=[];let i=0;for(const a of e){if("lit"in a){r+=a.lit;continue}const e=t[i++];jr(e)?(r+=`[data-hs-query-id='${n.length}']`,n.push(e)):r+=(e??"")+""}return{selector:r,elements:n}}class jn{constructor(e){this.elementCleanups=new WeakMap,this.elementCount=0,this.typeCounts={listener:0,observer:0,interval:0,timeout:0,custom:0},this.globalCleanups=[],this.debugMode=e?.debug??!1}registerListener(e,t,r,n,i){this.addCleanup(e,{type:"listener",target:t,eventName:r,cleanup:()=>{t.removeEventListener(r,n,i),this.debugMode&&he(`CleanupRegistry: Removed listener '${r}'`)},description:r+" listener"})}registerObserver(e,t){this.addCleanup(e,{type:"observer",cleanup:()=>{t.disconnect(),this.debugMode&&he("CleanupRegistry: Disconnected MutationObserver")},description:"MutationObserver"})}registerInterval(e,t){this.addCleanup(e,{type:"interval",cleanup:()=>{clearInterval(t),this.debugMode&&he("CleanupRegistry: Cleared interval")},description:"Interval"})}registerTimeout(e,t){this.addCleanup(e,{type:"timeout",cleanup:()=>{clearTimeout(t),this.debugMode&&he("CleanupRegistry: Cleared timeout")},description:"Timeout"})}registerCustom(e,t,r){this.addCleanup(e,{type:"custom",cleanup:t,description:r||"Custom cleanup"})}registerGlobal(e,t="custom",r){this.globalCleanups.push({type:t,cleanup:e,description:r||"Global cleanup"}),this.debugMode&&he("CleanupRegistry: Registered global cleanup: "+(r||t))}addCleanup(e,t){const r=this.elementCleanups.get(e);r?r.push(t):(this.elementCleanups.set(e,[t]),this.elementCount++),this.typeCounts[t.type]++,this.debugMode&&he(`CleanupRegistry: Registered ${t.type} for element`,e)}cleanupElement(e){const t=this.elementCleanups.get(e);if(!t||0===t.length)return 0;let r=0;for(const e of t){try{e.cleanup(),r++}catch(e){this.debugMode&&he("CleanupRegistry: Error during cleanup:",e)}this.typeCounts[e.type]--}return this.elementCleanups.delete(e),this.elementCount--,this.debugMode&&he(`CleanupRegistry: Cleaned up ${r} resources for element`),r}cleanupElementTree(e){let t=this.cleanupElement(e);const r=e.querySelectorAll("*");for(const e of r)t+=this.cleanupElement(e);return t}cleanupGlobal(){let e=0;for(const t of this.globalCleanups)try{t.cleanup(),e++}catch(e){this.debugMode&&he("CleanupRegistry: Error during global cleanup:",e)}return this.globalCleanups=[],this.debugMode&&he(`CleanupRegistry: Cleaned up ${e} global resources`),e}cleanupAll(){return this.cleanupGlobal()}hasCleanups(e){const t=this.elementCleanups.get(e);return void 0!==t&&t.length>0}getCleanupCount(e){const t=this.elementCleanups.get(e);return t?.length??0}getStats(){let e=0,t=0,r=0,n=0,i=0;for(const a of this.globalCleanups)switch(a.type){case"listener":e++;break;case"observer":t++;break;case"interval":r++;break;case"timeout":n++;break;case"custom":i++}return{elementsTracked:this.elementCount,listeners:this.typeCounts.listener+e,observers:this.typeCounts.observer+t,intervals:this.typeCounts.interval+r,timeouts:this.typeCounts.timeout+n,custom:this.typeCounts.custom+i,global:this.globalCleanups.length}}setDebugMode(e){this.debugMode=e}}class Pn{constructor(){this.sources=new Map,this.subscriptions=new Map,this.nextId=1}register(e,t){const r=e.toLowerCase();this.sources.has(r)&&he("[EventSourceRegistry] Overwriting existing event source: "+e),this.sources.set(r,t)}unregister(e){const t=e.toLowerCase(),r=this.sources.get(t);if(r){for(const[e,r]of this.subscriptions.entries())r.source===t&&(r.unsubscribe(),this.subscriptions.delete(e));return r.destroy?.(),this.sources.delete(t)}return!1}get(e){return this.sources.get(e.toLowerCase())}has(e){return this.sources.has(e.toLowerCase())}subscribe(e,t,r){const n=this.get(e);if(!n)return void he("[EventSourceRegistry] Unknown event source: "+e);n.initialize?.();const i=n.subscribe(t,r);return this.subscriptions.set(i.id,i),i}unsubscribe(e){const t=this.subscriptions.get(e);return!!t&&(t.unsubscribe(),this.subscriptions.delete(e))}getSourceNames(){return Array.from(this.sources.keys())}getSubscriptions(){return Array.from(this.subscriptions.values())}findSourceForEvent(e){for(const[t,r]of this.sources.entries())if(r.supports?.(e)??r.supportedEvents?.includes(e))return t}generateId(){return`sub_${this.nextId++}_${Date.now().toString(36)}`}destroy(){for(const e of this.subscriptions.values())e.unsubscribe();this.subscriptions.clear();for(const e of this.sources.values())e.destroy?.();this.sources.clear()}}class In{constructor(){this.providers=new Map,this.globalProviders=new Map}register(e,t,r){const n=e.toLowerCase();this.providers.set(n,"function"==typeof t?{name:n,provide:t,cache:r?.cache??!0,description:r?.description,dependencies:r?.dependencies}:t)}registerGlobal(e,t,r){const n=e.toLowerCase();this.globalProviders.set(n,"function"==typeof t?{name:n,provide:t,cache:r?.cache??!0,description:r?.description,dependencies:r?.dependencies}:t)}unregister(e){return this.providers.delete(e.toLowerCase())}unregisterGlobal(e){return this.globalProviders.delete(e.toLowerCase())}get(e){const t=e.toLowerCase();return this.providers.get(t)??this.globalProviders.get(t)}has(e){const t=e.toLowerCase();return this.providers.has(t)||this.globalProviders.has(t)}async resolve(e,t,r){const n=this.get(e);if(!n)return;const i="__provider_"+n.name;if(n.cache&&r?.has(i))return r.get(i);if(n.dependencies)for(const e of n.dependencies)await this.resolve(e,t,r);const a=await n.provide(t);return n.cache&&r&&r.set(i,a),a}resolveSync(e,t,r){const n=this.get(e);if(!n)return;const i="__provider_"+n.name;if(n.cache&&r?.has(i))return r.get(i);const a=n.provide(t);if(a instanceof Promise)throw Error(`Context provider '${e}' is async. Use resolve() instead of resolveSync().`);return n.cache&&r&&r.set(i,a),a}enhance(e){const t=this,r=new Map;return new Proxy(e,{get(e,n,i){if("string"==typeof n&&t.get(n))try{return t.resolveSync(n,e,r)}catch{return t.resolve(n,e,r)}return Reflect.get(e,n,i)},has:(e,r)=>!("string"!=typeof r||!t.has(r))||Reflect.has(e,r)})}async resolveAll(e){const t=new Map,r={},n=[...this.globalProviders.entries(),...this.providers.entries()];for(const[i,a]of n)try{r[i]=await this.resolve(i,e,t)}catch(e){he(`[ContextProviderRegistry] Failed to resolve '${i}':`,e),r[i]=void 0}return r}getProviderNames(){return[...new Set([...this.globalProviders.keys(),...this.providers.keys()])]}clear(){this.providers.clear(),this.globalProviders.clear()}}const qn={evaluate:(e,t)=>nn(e,t)};class Nn{static toTyped(e){return{me:e.me,...void 0!==e.owner&&{owner:e.owner},it:e.it,you:e.you,result:e.result,...void 0!==e.event&&{event:e.event},variables:e.variables||new Map,locals:e.locals||new Map,globals:e.globals||new Map,...void 0!==e.events&&{events:e.events},meta:e.meta||{},...void 0!==e.registry&&{registry:e.registry},expressionStack:[],evaluationDepth:0,validationMode:"strict",evaluationHistory:[]}}static fromTyped(e,t){return{...t,me:e.me,it:e.it,you:e.you,result:e.result,...void 0!==e.event&&{event:e.event},...void 0!==e.variables&&{variables:e.variables},locals:e.locals,globals:e.globals,...void 0!==e.events&&{events:e.events},...void 0!==e.meta&&{meta:e.meta}}}}class Rn{constructor(e,t,r){this.impl=e,this.hookRegistry=r??null}setHookRegistry(e){this.hookRegistry=e}createHookContext(e,t,r={}){return{commandName:this.name,element:e.me instanceof Element?e.me:null,args:t,modifiers:r,event:e.event??void 0,executionContext:e}}get name(){const e=this.impl.name;if(e)return e;const t=this.impl.metadata?.name;return"string"==typeof t?t:""}get metadata(){const e=this.impl.metadata?.syntax;return{description:this.impl.metadata?.description||"",examples:this.impl.metadata?.examples||[],syntax:"string"==typeof e?e:e?e.join(" | "):""}}async execute(e,...t){const r=t[0],n=this.createHookContext(e,t,r&&"object"==typeof r&&"modifiers"in r&&r.modifiers||{});try{if(de(`CommandAdapterV2: Executing '${this.name}' with args:`,t),this.hookRegistry&&await this.hookRegistry.runBeforeExecute(n),this.hookRegistry?.shouldIntercept(this.name,n))return void de(`CommandAdapterV2: '${this.name}' intercepted by hook`);const i=Nn.toTyped(e);let a,s;if(this.impl.parseInput&&"function"==typeof this.impl.parseInput)if(de(`CommandAdapterV2: '${this.name}' has parseInput(), calling it`),r&&"object"==typeof r&&("args"in r||"modifiers"in r)){const t=r.modifiers,n=t?.when||t?.where;if(n&&!await nn(n,e))return void de(`CommandAdapterV2: '${this.name}' skipped - when/where condition evaluated to false`);a=await this.impl.parseInput({args:r.args||[],modifiers:t||{},commandName:r.commandName},qn,e)}else a=t;else de(`CommandAdapterV2: '${this.name}' has no parseInput(), using args as-is`),a=t;if(de("CommandAdapterV2: Calling execute with parsed input:",a),2===this.impl.execute.length)s=await this.impl.execute(a,i);else{const e=Array.isArray(a)?a:[a];s=await this.impl.execute(i,...e)}return de("CommandAdapterV2: Command result:",s),Object.assign(e,Nn.fromTyped(i,e)),this.hookRegistry&&await this.hookRegistry.runAfterExecute(n,s),s}catch(e){if(Hn(e)||de(`CommandAdapterV2: Error executing '${this.name}':`,e),this.hookRegistry&&e instanceof Error)throw await this.hookRegistry.runOnError(n,e);throw e}}validate(e){return{isValid:!this.impl.validate||this.impl.validate(e),errors:[],suggestions:[]}}}class Mn{constructor(e,t){this.adapters=new Map,this.implementations=new Map,this.hookRegistry=t}setHookRegistry(e){this.hookRegistry=e;for(const t of this.adapters.values())t.setHookRegistry(e);he(`CommandRegistryV2: Hook registry set and propagated to ${this.adapters.size} adapters`)}getHookRegistry(){return this.hookRegistry}register(e){const t=e.name||e.metadata?.name;if(!t||"string"!=typeof t)throw Error("Cannot register command: no name found. Provide a 'name' property or 'metadata.name' on the implementation.");const r=t.toLowerCase();he(`CommandRegistryV2: Registering command '${r}'`),this.implementations.set(r,e);const n=new Rn(e,void 0,this.hookRegistry);this.adapters.set(r,n),k.add(r);const i=e.metadata?.aliases;if(i&&Array.isArray(i))for(const t of i){const r=t.toLowerCase();this.implementations.set(r,e),this.adapters.set(r,n),k.add(r)}}getAdapter(e){return this.adapters.get(e.toLowerCase())}has(e){return this.adapters.has(e.toLowerCase())}getCommandNames(){return Array.from(this.adapters.keys())}getImplementation(e){return this.implementations.get(e.toLowerCase())}getAdapters(){return new Map(this.adapters)}validateCommand(e,t){const r=this.getAdapter(e);return r?r.validate(t):{isValid:!1,errors:[{type:"runtime-error",message:"Unknown command: "+e,suggestions:["Available commands: "+this.getCommandNames().join(", ")]}],suggestions:["Available commands: "+this.getCommandNames().join(", ")]}}}let $n=null;function _n(){return $n||($n=function(e){const t=e?.commands??new Mn,r=e?.eventSources??new Pn,n=e?.context??new In,i=new Set,a={commands:t,eventSources:r,context:n,use(e){if(i.has(e.name))he(`[LokaScriptRegistry] Plugin '${e.name}' is already installed`);else{if(e.commands)for(const r of e.commands)t.register(r);if(e.eventSources)for(const t of e.eventSources)r.register(t.name,t);if(e.contextProviders)for(const{name:t,provide:r,options:i}of e.contextProviders)n.register(t,r,i);e.setup?.(a),i.add(e.name)}},reset(){i.clear()}};return a}()),$n}class zn{constructor(e={}){this.contextCache=new WeakMap;const t=_n();this.options={enableContextProviders:e.enableContextProviders??!0,enableEventSources:e.enableEventSources??!0,registry:e.registry??{}},this.contextRegistry=this.options.registry.context??t.context,this.eventSourceRegistry=this.options.registry.eventSources??t.eventSources,he(`[RegistryIntegration] Initialized (context=${this.options.enableContextProviders}, events=${this.options.enableEventSources})`)}enhanceContext(e){if(!this.options.enableContextProviders)return e;const t=this.contextCache.get(e);if(t)return t;try{const t=this.contextRegistry.enhance(e);return this.contextCache.set(e,t),he(`[RegistryIntegration] Enhanced context with ${this.contextRegistry.getProviderNames().length} providers`),t}catch(t){return he("[RegistryIntegration] Failed to enhance context: "+(t instanceof Error?t.message:t+"")),e}}getEventSource(e){if(!this.options.enableEventSources)return;const t=this.eventSourceRegistry.get(e);if(t)return he(`[RegistryIntegration] Found event source for '${e}'`),t;const r=this.eventSourceRegistry.findSourceForEvent(e);if(r){const t=this.eventSourceRegistry.get(r);return he(`[RegistryIntegration] Found event source '${r}' supporting '${e}'`),t}}hasEventSource(e){return void 0!==this.getEventSource(e)}subscribeToEventSource(e,t,r){if(!this.options.enableEventSources)throw Error("Event sources are disabled in this runtime");const n=this.eventSourceRegistry.subscribe(e,t,r);if(!n)throw Error(`Failed to subscribe to event source '${e}'`);return he(`[RegistryIntegration] Subscribed to '${e}' event '${t.event}' (id: ${n.id})`),n}getEventSourceNames(){return this.eventSourceRegistry.getSourceNames()}getContextProviderNames(){return this.contextRegistry.getProviderNames()}destroy(){this.eventSourceRegistry.destroy(),this.contextCache=new WeakMap,he("[RegistryIntegration] Destroyed")}}function Vn(e){const t=Error(e.type.toUpperCase()+"_EXECUTION");return t["is"+e.type.charAt(0).toUpperCase()+e.type.slice(1)]=!0,"returnValue"in e&&(t.returnValue=e.returnValue),t}function Hn(e){return e instanceof Error&&(null!==rr(e)||"HALT_EXECUTION"===e.message||"EXIT_COMMAND"===e.message||"EXIT_EXECUTION"===e.message)}function Bn(e){return null!==e&&"object"==typeof e&&"command"in e&&"selector"in e}const Wn=new WeakMap;function Dn(e,t=new Set){if(null===e||"object"!=typeof e)return t;if(Array.isArray(e)){for(const r of e)Dn(r,t);return t}const r=e;"identifier"===r.type&&"string"==typeof r.name&&t.add(r.name);for(const e of Object.keys(r))"start"!==e&&"end"!==e&&"line"!==e&&"column"!==e&&Dn(r[e],t);return t}class Fn{constructor(e){this.autoCleanupObserver=null,this.registryIntegration=null,this.runtimeWarnings=[],this.options={commandTimeout:1e4,enableErrorReporting:!0,enableResultPattern:!0,enableAutoCleanup:!0,...e},this.registry=e.registry,this.expressionRegistry=e.expressionRegistry,this.behaviorRegistry=new Map,this.globalVariables=sr,this.hookRegistry=new tr,e.hooks&&this.hookRegistry.register("default",e.hooks),this.registry.setHookRegistry(this.hookRegistry),this.cleanupRegistry=new jn,this.options.enableAutoCleanup&&this.setupAutoCleanup(),!1!==e.registryIntegration&&(this.registryIntegration=new zn("object"==typeof e.registryIntegration?e.registryIntegration:{}),he("RuntimeBase: Registry integration enabled")),this.behaviorAPI={has:e=>this.behaviorRegistry.has(e),get:e=>this.behaviorRegistry.get(e),set:(e,t)=>this.behaviorRegistry.set(e,t),resolve:null,install:async(e,t,r)=>await this.installBehaviorOnElement(e,t,r)}}setupAutoCleanup(){"undefined"!=typeof MutationObserver&&"undefined"!=typeof document&&(this.autoCleanupObserver=new MutationObserver(e=>{const t=[];for(const r of e)for(const e of r.removedNodes)e instanceof Element&&t.push(e);t.length>0&&queueMicrotask(()=>{for(const e of t)if(!e.isConnected){const t=this.cleanupRegistry.cleanupElementTree(e);t>0&&he(`RuntimeBase: Auto-cleaned ${t} resources for removed element`)}})}),document.body?this.autoCleanupObserver.observe(document.body,{childList:!0,subtree:!0}):document.addEventListener("DOMContentLoaded",()=>{this.autoCleanupObserver?.observe(document.body,{childList:!0,subtree:!0})},{once:!0}))}registerHooks(e,t){this.hookRegistry.register(e,t)}unregisterHooks(e){return this.hookRegistry.unregister(e)}getRegisteredHooks(){return this.hookRegistry.getRegisteredNames()}cleanup(e){return this.cleanupRegistry.cleanupElement(e)}trackListener(e,t,r,n,i){this.cleanupRegistry.registerListener(e,t,r,n,i)}cleanupTree(e){return this.cleanupRegistry.cleanupElementTree(e)}getCleanupStats(){return this.cleanupRegistry.getStats()}getCleanupRegistry(){return this.cleanupRegistry}logError(...e){this.options.enableErrorReporting&&console.error(...e)}logWarn(...e){this.options.enableErrorReporting&&console.warn(...e)}destroy(){this.autoCleanupObserver&&(this.autoCleanupObserver.disconnect(),this.autoCleanupObserver=null),this.cleanupRegistry.cleanupAll(),this.hookRegistry.clear(),this.behaviorRegistry.clear(),he("RuntimeBase: Destroyed")}hasErrorDiagnostics(e){const t=e.diagnostics;return!!t?.some(e=>"error"===e.severity)}getWarnings(){return this.runtimeWarnings}async execute(e,t){he(`RUNTIME BASE: execute() called with node type: '${e.type}'`),t.registry||(t.registry=this.expressionRegistry),t.locals.has("_behaviors")||t.locals.set("_behaviors",this.behaviorAPI),t.locals.has("_runtimeExecute")||t.locals.set("_runtimeExecute",(e,r)=>this.execute(e,r||t));try{if(this.hasErrorDiagnostics(e)){const t=e.diagnostics?.[0];return he("\u26a0\ufe0f RUNTIME: Skipping error node: "+(t?.message||"unknown error")),void this.runtimeWarnings.push(t?.message||"Skipped error node")}switch(e.type){case"command":if(this.options.enableResultPattern){const r=await this.processCommandWithResult(e,t);if(!ar(r)){if("return"===r.error.type){const e=r.error.returnValue;return void 0!==e&&Object.assign(t,{it:e,result:e}),e}throw Vn(r.error)}return r.value}try{return await this.processCommand(e,t)}catch(e){const r=rr(e);if(r?.isReturn){const e=r.returnValue;return void 0!==e&&Object.assign(t,{it:e,result:e}),e}throw e}case"eventHandler":return await this.executeEventHandler(e,t);case"event":{const r={type:"eventHandler",event:e.event,events:[e.event],commands:e.body||[],target:e.filter,modifiers:e.modifiers||{}};return await this.executeEventHandler(r,t)}case"behavior":return await this.executeBehaviorDefinition(e,t);case"def":return this.installFunction(e,t);case"Program":return await this.executeProgram(e,t);case"initBlock":case"block":return await this.executeBlock(e,t);case"sequence":case"CommandSequence":if(this.options.enableResultPattern){const r=e,n=await this.executeCommandSequenceWithResult(r.commands||[],t);if(!ar(n))throw Vn(n.error);return n.value}return await this.executeCommandSequence(e,t);case"objectLiteral":return await this.executeObjectLiteral(e,t);default:if(this.options.enableResultPattern){const r=await this.evaluateExpressionWithResult(e,t);if(!ar(r))throw Vn(r.error);return r.value}return await this.evaluateExpression(e,t)}}catch(e){throw e}}async processCommand(e,t){const{name:r,args:n,modifiers:i}=e,a=r.toLowerCase();if(de(`RUNTIME BASE: Processing command '${a}'`),this.registry.has(a)){const e=await this.registry.getAdapter(a);if(!e)throw Error(`Command '${a}' is registered but failed to load adapter.`);try{return await e.execute(t,{args:n||[],modifiers:i||{},commandName:a,runtime:this})}catch(e){throw Hn(e)||this.logError(`Error executing command '${a}':`,e),e}}const s=`Unknown command: ${r}. Ensure it is registered in the Runtime options.`;throw this.logWarn(s),Error(s)}toSignal(e){const t=rr(e);if(t){if(t.isHalt||"HALT_EXECUTION"===t.message)return{type:"halt"};if(t.isExit||"EXIT_COMMAND"===t.message)return{type:"exit",returnValue:t.returnValue};if(t.isBreak)return{type:"break"};if(t.isContinue)return{type:"continue"};if(t.isReturn)return{type:"return",returnValue:t.returnValue}}if(e instanceof Error){if("HALT_EXECUTION"===e.message)return{type:"halt"};if("EXIT_COMMAND"===e.message)return{type:"exit"}}return null}async processCommandWithResult(e,t){const{name:r,args:n,modifiers:i}=e,a=r.toLowerCase();if(de(`RUNTIME BASE (Result): Processing command '${a}'`),!this.registry.has(a)){const e=`Unknown command: ${r}. Ensure it is registered in the Runtime options.`;throw this.logWarn(e),Error(e)}const s=await this.registry.getAdapter(a);if(!s)throw Error(`Command '${a}' is registered but failed to load adapter.`);try{return nr(await s.execute(t,{args:n||[],modifiers:i||{},commandName:a,runtime:this}))}catch(e){const t=this.toSignal(e);if(t)return ir(t);throw this.logError(`Error executing command '${a}':`,e),e}}async executeCommandSequenceWithResult(e,t){let r;for(const n of e){if(this.hasErrorDiagnostics(n)){const e=n.diagnostics?.[0];he("\u26a0\ufe0f RUNTIME: Skipping error node: "+(e?.message||"unknown error")),this.runtimeWarnings.push(e?.message||"Skipped error node");continue}if("command"===n.type){const e=await this.processCommandWithResult(n,t);if(!ar(e)){const r=e.error;switch(r.type){case"halt":case"exit":case"break":case"continue":return e;case"return":return void 0!==r.returnValue&&Object.assign(t,{it:r.returnValue,result:r.returnValue}),nr(r.returnValue)}}r=e.value}else{const e=await this.evaluateExpressionWithResult(n,t);if(!ar(e))return e;r=e.value}}return nr(r)}async evaluateExpression(e,t){const r=t.registry?t:{...t,registry:this.expressionRegistry},n=await nn(e,r);return Bn(n)?await this.executeCommandFromPattern(n.command,n.selector,t):n}async evaluateExpressionWithResult(e,t){const r=t.registry?t:{...t,registry:this.expressionRegistry},n=await async function(e,t){try{return nr(await nn(e,t))}catch(e){if(e instanceof Error){const t=e;if(t.isHalt||"HALT_EXECUTION"===t.message)return ir({type:"halt"});if(t.isExit||"EXIT_COMMAND"===t.message)return ir({type:"exit",returnValue:t.returnValue});if(t.isBreak)return ir({type:"break"});if(t.isContinue)return ir({type:"continue"});if(t.isReturn)return ir({type:"return",returnValue:t.returnValue})}throw e}}(e,r);if(!ar(n))return n;const i=n.value;if(Bn(i)){if(this.options.enableResultPattern)return this.processCommandWithResult({type:"command",name:i.command,args:[{type:"literal",value:i.selector}]},t);try{return nr(await this.executeCommandFromPattern(i.command,i.selector,t))}catch(e){const t=this.toSignal(e);if(t)return ir(t);throw e}}return nr(i)}async executeCommandFromPattern(e,t,r){return this.processCommand({type:"command",name:e,args:[{type:"literal",value:t}]},r)}installFunction(e,t){const r=this,n=e.params??[],i=e.body??[],a=e.errorHandler,s=e.finallyHandler,o=e.errorSymbol;t.globals.set(e.name,async(...e)=>{const l={...t,locals:new Map(t.locals)};n.forEach((t,r)=>{t&&l.locals.set(t,e[r])});const c=async e=>{const t=await r.executeCommandSequenceWithResult(e,l);if(!ar(t))throw rr(t.error);return t.value};if(!a&&!s)return await c(i);try{return await c(i)}catch(e){if(!a||Hn(e))throw e;return o&&l.locals.set(o,e),await c(a)}finally{s&&await c(s)}})}async executeProgram(e,t){if(!e.statements||!Array.isArray(e.statements))return;let r;const n=[],i=[],a=[],s=[];for(const t of e.statements)"eventHandler"===t.type?n.push(t):"def"===t.type?i.push(t):"initBlock"===t.type?a.push(t):s.push(t);for(const e of i)this.execute(e,t);for(const e of n)try{await this.execute(e,t)}catch(e){if(Hn(e)&&(e.isHalt||e.isExit))break;throw e}for(const e of a)try{r=await this.execute(e,t)}catch(e){if(Hn(e)&&(e.isHalt||e.isExit))break;throw e}for(const e of s)try{r=await this.execute(e,t)}catch(e){if(Hn(e)&&(e.isHalt||e.isExit))break;throw e}return r}async executeBlock(e,t){if(e.commands&&Array.isArray(e.commands))for(const r of e.commands)try{await this.execute(r,t)}catch(e){if(Hn(e)&&e.isHalt)break;throw e}}async executeCommandSequence(e,t){if(!e.commands||!Array.isArray(e.commands))return;let r;for(const n of e.commands)try{r=await this.execute(n,t)}catch(e){if(Hn(e)){if(e.isHalt||e.isExit)break;if(e.isReturn){if(void 0!==e.returnValue)return Object.assign(t,{it:e.returnValue,result:e.returnValue}),e.returnValue;break}if(e.isBreak)throw e}throw e}return r}async executeObjectLiteral(e,t){const r={};if(!e.properties)return r;for(const n of e.properties){let e;e="identifier"===n.key.type?n.key.name:"literal"===n.key.type?n.key.value+"":await this.execute(n.key,t)+"";const i=await this.execute(n.value,t);r[e]=i}return r}enhanceContext(e){return this.registryIntegration?this.registryIntegration.enhanceContext(e):e}async executeBehaviorDefinition(e,t){const{name:r,parameters:n=[],eventHandlers:i=[],initBlock:a}=e,s=e.imperativeInstaller;"function"==typeof s?(this.behaviorRegistry.set(r,{name:r,parameters:n,type:"imperative",install:s}),he(`RUNTIME BASE: Registered imperative behavior '${r}'`)):(this.behaviorRegistry.set(r,{name:r,parameters:n,eventHandlers:i,initBlock:a}),he(`RUNTIME BASE: Registered behavior '${r}'`))}async installBehaviorOnElement(e,t,r){he("BEHAVIOR: installBehaviorOnElement called: "+e);let n=this.behaviorRegistry.get(e);if(!n&&(this.behaviorAPI.resolve&&this.behaviorAPI.resolve(e)&&(n=this.behaviorRegistry.get(e)),!n))throw Error(`Behavior "${e}" not found`);if("imperative"===n.type)return void("function"==typeof n.install&&(he(`BEHAVIOR: Installing imperative behavior '${e}'`),n.install(t,r),he(`BEHAVIOR: Finished installing imperative behavior '${e}'`)));he("BEHAVIOR: Found behavior, eventHandlers count: "+(n.eventHandlers?.length||0));const i={me:t,owner:t,you:null,it:null,result:null,locals:new Map,globals:this.globalVariables,registry:this.expressionRegistry,halted:!1,returned:!1,broke:!1,continued:!1,async:!1},a=this.enhanceContext(i);if(n.parameters)for(const e of n.parameters)a.locals.set(e,e in r?r[e]:void 0);for(const[e,t]of Object.entries(r))n.parameters?.includes(e)||a.locals.set(e,t);if(n.initBlock){he("BEHAVIOR: Running init block for "+e);const t=this.options.commandTimeout??1e4;try{await Promise.race([this.execute(n.initBlock,a),new Promise((r,n)=>setTimeout(()=>n(Error(`Behavior "${e}" init block timed out after ${t}ms`)),t))]),he("BEHAVIOR: Init block completed for "+e)}catch(t){if(he(`BEHAVIOR: Init block error for ${e}:`,t),!(t instanceof Error&&Hn(t)))throw t}}if(he(`BEHAVIOR: About to attach ${n.eventHandlers?.length||0} handlers for ${e}`),n.eventHandlers){const t=this.options.commandTimeout??1e4;for(const r of n.eventHandlers)await Promise.race([this.executeEventHandler(r,a),new Promise((r,n)=>setTimeout(()=>n(Error(`Behavior "${e}" handler attachment timed out after ${t}ms`)),t))])}he("BEHAVIOR: Finished installing "+e)}async executeEventHandler(e,t){const{event:r,events:n,commands:i,target:a,args:s,selector:o,condition:l,attributeName:c,watchTarget:u,modifiers:d,errorSymbol:m,errorHandler:p,finallyHandler:h}=e,f=n&&n.length>0?n:[r];he(`BEHAVIOR: executeEventHandler: event='${r}', target='${a}'`);let y=[],g=null;if(a){const e="string"==typeof a?a.toLowerCase():"";if("window"===e||"the window"===e)g=window;else if("document"===e||"the document"===e||"body"===e)g=document;else if("me"===e||"myself"===e)y=t.me?[t.me]:[];else if("string"==typeof a&&t.locals.has(a)){const e=t.locals.get(a);he(`BEHAVIOR: Target resolution: found local '${a}', isElement: ${this.isElement(e)}`),this.isElement(e)?y=[e]:Array.isArray(e)?y=e.filter(e=>this.isElement(e)):"string"==typeof e&&(y=this.queryElements(e,t))}else he(`BEHAVIOR: Target resolution: querying for '${a}'`),y=this.queryElements(a,t)}else y=t.me?[t.me]:[];if(0===y.length&&!g)return void he(`BEHAVIOR: executeEventHandler - No targets found for event '${r}', returning early`);if("mutation"===r&&c)return void this.setupMutationObserver(y,c,i,t);if("change"===r&&u)return void this.setupChangeObserver(u,i,t);const v=e.customEventSource;if(v&&this.registryIntegration){he(`BEHAVIOR: executeEventHandler - Using custom event source '${v}' for event '${r}'`);const e=async e=>{const n=new Map(t.locals),a={...t,locals:n,it:e,event:e},s=this.enhanceContext(a);he(`CUSTOM EVENT: Executing commands for event '${r}'`);try{await this.execute({type:"program",commands:i},s)}catch(e){this.logError(`[HyperFixi] Error executing commands for custom event '${r}':`,e)}};try{const n=this.registryIntegration.subscribeToEventSource(v,{event:r,handler:e,target:a,selector:o},t);he(`BEHAVIOR: Subscribed to custom event source '${v}' (id: ${n.id})`),this.cleanupRegistry.registerGlobal(()=>n.unsubscribe(),"listener",`Custom event source '${v}' subscription ${n.id}`)}catch(e){this.logError(`[HyperFixi] Failed to subscribe to custom event source '${v}':`,e)}return}const b=Fn.createEventHandler(this,i,t,o,s,{errorSymbol:m,errorHandler:p,finallyHandler:h},1===f.length?l:void 0);let w,k=null;if(d){let e=b;if(d.prevent){const t=e;e=async e=>(e.preventDefault(),t(e))}if(d.stop){const t=e;e=async e=>(e.stopPropagation(),t(e))}if(d.debounce){const t=d.debounce;let r;w=n=>{r&&clearTimeout(r),r=setTimeout(()=>e(n),t)},k=()=>{r&&(clearTimeout(r),r=void 0)}}else if(d.throttle){const t=d.throttle;let r=0;w=n=>{const i=Date.now();t>i-r||(r=i,e(n))}}else w=e}else w=b;const E=d?.once?{once:!0}:void 0;if(g){for(const e of f)g.addEventListener(e,w,E),y.length>0?this.cleanupRegistry.registerListener(y[0],g,e,w):this.cleanupRegistry.registerGlobal(()=>g.removeEventListener(e,w),"listener",`Global ${e} listener`);k&&(y.length>0?this.cleanupRegistry.registerCustom(y[0],k,"debounce-timeout"):this.cleanupRegistry.registerGlobal(k,"timeout","debounce-timeout"))}else for(const e of y){for(const t of f){if("resize"===t&&"undefined"!=typeof ResizeObserver){const t=new ResizeObserver(e=>{for(const r of e){const e=new CustomEvent("resize",{detail:r,bubbles:!1,cancelable:!1});if(e.synthetic=!0,w(e),E?.once){t.disconnect();break}}});t.observe(e),this.cleanupRegistry.registerCustom(e,()=>t.disconnect(),"resize-observer");continue}e.addEventListener(t,w,E),this.cleanupRegistry.registerListener(e,e,t,w)}k&&this.cleanupRegistry.registerCustom(e,k,"debounce-timeout")}}static createEventHandler(e,t,r,n,i,a,s){return async o=>{const l=Wn.get(o)??0;if(l>=100)return;if(Wn.set(o,l+1),n&&o.target instanceof Element)try{if(!o.target.matches(n)&&!o.target.closest(n))return}catch{he(`Event delegation: invalid CSS selector '${n}', skipping filter`)}const c=new Map(r.locals),u={...r,locals:c,it:o,event:o};c.has("target")||u.locals.set("target",o.target);const d=e.enhanceContext(u);if(i&&i.length>0){const e=o,t=e.detail;for(const r of i)d.locals.set(r,e[r]??t?.[r]??null)}if(s){const t=o;for(const e of Dn(s))!d.locals.has(e)&&e in t&&d.locals.set(e,t[e]);let r;try{r=await e.evaluateExpression(s,d)}catch(e){return void he("Event filter threw; skipping handler body:",e)}if(!r)return}const m=async t=>{for(const r of t)try{await e.execute(r,d)}catch(t){if(Hn(t)){if(t.isHalt||t.isExit)break;if(t.isReturn){void 0!==t.returnValue&&Object.assign(d,{it:t.returnValue,result:t.returnValue});break}}throw e.logError("COMMAND FAILED:",t),t}},p=a?.errorHandler,h=a?.finallyHandler;if(p||h)try{await m(t)}catch(e){if(!p||Hn(e))throw e;a?.errorSymbol&&d.locals.set(a.errorSymbol,e),await m(p)}finally{h&&await m(h)}else await m(t)}}setupMutationObserver(e,t,r,n){he(`RUNTIME BASE: Setting up MutationObserver for attribute '${t}' on ${e.length} elements`);for(const i of e){const e=new MutationObserver(async e=>{for(const a of e)if("attributes"===a.type&&a.attributeName===t){me(`MUTATION DETECTED: attribute '${t}' changed on`,i);const e={...n,me:i,it:a,locals:new Map(n.locals)},s=a.oldValue,o=i.getAttribute(t);e.locals.set("oldValue",s),e.locals.set("newValue",o);const l=this.enhanceContext(e);for(const e of r)try{await this.execute(e,l)}catch(e){if(Hn(e)){if(e.isHalt||e.isExit||e.isReturn)break}else this.logError("Error executing mutation handler command:",e)}}});e.observe(i,{attributes:!0,attributeOldValue:!0,attributeFilter:[t]}),this.cleanupRegistry.registerObserver(i,e),he("RUNTIME BASE: MutationObserver attached to",i,`for attribute '${t}'`)}}async setupChangeObserver(e,t,r){he("RUNTIME BASE: Setting up MutationObserver for content changes on watch target");const n=await this.execute(e,r);let i=[];this.isElement(n)?i=[n]:Array.isArray(n)&&(i=n.filter(e=>this.isElement(e))),he(`RUNTIME BASE: Watching ${i.length} target elements for content changes`);for(const e of i){const n=new MutationObserver(async n=>{for(const i of n)if("childList"===i.type||"characterData"===i.type){me("CONTENT CHANGE DETECTED on",e,"mutation type:",i.type);const n={...r,me:r.me,it:i,locals:new Map(r.locals)};n.locals.set("target",e);const a=i.oldValue,s=e.textContent;null!==a&&n.locals.set("oldValue",a),n.locals.set("newValue",s);const o=this.enhanceContext(n);for(const e of t)try{await this.execute(e,o)}catch(e){if(Hn(e)){if(e.isHalt||e.isExit||e.isReturn)break}else this.logError("Error executing change handler command:",e)}}});n.observe(e,{childList:!0,characterData:!0,subtree:!0,characterDataOldValue:!0}),this.cleanupRegistry.registerObserver(e,n),he("RUNTIME BASE: MutationObserver attached to",e,"for content changes")}}queryElements(e,t){const r=t.me,n=(r instanceof Element?r.ownerDocument:null)??("undefined"!=typeof document?document:null);if(!n)return[];let i=e;i.startsWith("<")&&i.endsWith("/>")&&(i=i.slice(1,-2).trim());try{return Array.from(n.querySelectorAll(i))}catch{return he(`queryElements: invalid CSS selector '${i}'`),[]}}isElement(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement||!(!e||"object"!=typeof e)&&(!!e.style&&!!e.classList)}}function Un(...e){const t=new Map;for(const r of e)for(const[e,n]of Object.entries(r))t.set(e,n);return t}class Kn{constructor(e){this.observer=null,this.initialized=!1,this.runtime=e}init(){"undefined"!=typeof document&&(this.initialized||(this.initialized=!0,this.scanDocument(),this.observer=new MutationObserver(e=>{for(const t of e)"childList"===t.type?t.addedNodes.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&(this.processElement(e),this.scanElement(e))}):"attributes"===t.type&&"_"===t.attributeName&&this.processElement(t.target)}),this.observer.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["_"]})))}destroy(){this.observer&&(this.observer.disconnect(),this.observer=null),this.initialized=!1}reset(){this.destroy()}scanAndProcessAll(){this.scanDocument()}scanDocument(){document.body&&this.scanElement(document.body)}scanElement(e){e.hasAttribute("_")&&this.processElement(e),e.querySelectorAll("[_]").forEach(e=>this.processElement(e))}processElement(e){const t=e.getAttribute("_");if(!t)return;const r=mr(e);this.runtime.execute(t,r).catch(r=>{console.error('[HyperFixi] Error executing _="" attribute:',r),console.error("Element:",e),console.error("Code:",t)})}}const Zn={name:"me",category:"Reference",evaluatesTo:"Element",evaluate:async e=>e.me??null,validate:Hr},Xn={name:"you",category:"Reference",evaluatesTo:"Element",evaluate:async e=>e.you??null,validate:Hr},Gn={name:"it",category:"Reference",evaluatesTo:"Any",evaluate:async e=>e.it??e.result,validate:Hr},Jn={name:"its",category:"Reference",evaluatesTo:"Any",evaluate:async e=>e.it??e.result,validate:Hr},Yn={name:"result",category:"Reference",evaluatesTo:"Any",evaluate:async e=>e.result??e.it,validate:Hr},Qn={name:"querySelector",category:"Reference",evaluatesTo:"Element",async evaluate(e,...t){const[r]=t;if("string"!=typeof r)throw Error("querySelector requires a string selector");return document.querySelector(r)},validate:e=>zr(e,"querySelector","selector")},ei={name:"querySelectorAll",category:"Reference",evaluatesTo:"Array",async evaluate(e,...t){const r=t[0];if("string"!=typeof r)throw Error("querySelectorAll requires a string selector");const n=document.querySelectorAll(r);return Array.from(n)},validate:e=>zr(e,"querySelectorAll","selector")},ti={name:"getElementById",category:"Reference",evaluatesTo:"Element",async evaluate(e,...t){const r=t[0];if("string"!=typeof r)throw Error("getElementById requires a string ID");return document.getElementById(r)},validate:e=>zr(e,"getElementById","ID")};function ri(e,t){if(t.startsWith("computed-")){const r=t.substring(9);return getComputedStyle(e).getPropertyValue(r)||""}const r=t.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());return e.style[r]}const ni={me:Zn,you:Xn,it:Gn,its:Jn,result:Yn,querySelector:Qn,querySelectorAll:ei,getElementById:ti,getElementsByClassName:{name:"getElementsByClassName",category:"Reference",evaluatesTo:"Array",async evaluate(e,...t){const r=t[0];if("string"!=typeof r)throw Error("getElementsByClassName requires a string class name");const n=document.getElementsByClassName(r);return Array.from(n)},validate:e=>zr(e,"getElementsByClassName","className")},closest:{name:"closest",category:"Reference",evaluatesTo:"Element",async evaluate(e,...t){let r=t[0];if(r&&"object"==typeof r&&"type"in r){const e=r;"identifier"===e.type&&e.name?r=e.name:"literal"===e.type&&"string"==typeof e.value&&(r=e.value)}if("string"!=typeof r)throw Error("closest requires a string selector");return e.me?e.me.closest(r):null},validate(e){if(1!==e.length)return"closest requires exactly 1 argument (selector)";const t=e[0];return"string"==typeof t||t&&"object"==typeof t&&"type"in t&&("identifier"===t.type||"literal"===t.type)?null:"closest selector must be a string or identifier"}},parent:{name:"parent",category:"Reference",evaluatesTo:"Element",evaluate:async e=>e.me?e.me.parentElement:null,validate:Hr},window:{name:"window",category:"Reference",evaluatesTo:"Object",evaluate:async e=>window,validate:Hr},document:{name:"document",category:"Reference",evaluatesTo:"Object",evaluate:async e=>document,validate:Hr},elementWithSelector:{name:"elementWithSelector",category:"Reference",evaluatesTo:"Array",async evaluate(e,...t){const r=t[0];if("string"!=typeof r)throw Error("Selector must be a string");const n=e?.me?.ownerDocument??("undefined"!=typeof document?document:null);if(!n)throw Error("DOM not available - cannot resolve element selector");const i=n.querySelectorAll(r);return Array.from(i)},validate:e=>zr(e,"elementWithSelector","selector")},styleRef:{name:"styleRef",category:"Reference",evaluatesTo:"String",async evaluate(e,...t){const r=t[0],n=t[1];if("string"!=typeof r)throw Error("StyleRef requires a string property name");const i=n||e.me;if(i&&i instanceof HTMLElement)return ri(i,r)},validate:e=>Wr(e,1,2,"styleRef","property, optional element")??_r(e,0,"styleRef","property")??(2===e.length&&e[1]&&"object"!=typeof e[1]?"styleRef element must be an HTMLElement":null)},possessiveStyleRef:{name:"possessiveStyleRef",category:"Reference",evaluatesTo:"String",async evaluate(e,...t){const r=t[0],n=t[1];if("string"!=typeof r||"string"!=typeof n)throw Error("Possessive styleRef requires possessor and property strings");let i=null;if("my"===r&&e.me?i=e.me instanceof HTMLElement?e.me:null:"its"===r&&e.it&&(i=e.it instanceof HTMLElement?e.it:null),i)return ri(i,n)},validate:e=>$r(e,2,"possessiveStyleRef","possessor, property")??_r(e,0,"possessiveStyleRef","possessor")??_r(e,1,"possessiveStyleRef","property")},ofStyleRef:{name:"ofStyleRef",category:"Reference",evaluatesTo:"String",async evaluate(e,...t){const r=t[0],n=t[1];if("string"!=typeof r||"string"!=typeof n)throw Error("Of styleRef requires property and reference strings");let i=null;if("me"===n&&e.me?i=e.me instanceof HTMLElement?e.me:null:"it"===n&&e.it&&(i=e.it instanceof HTMLElement?e.it:null),i)return ri(i,r)},validate:e=>$r(e,2,"ofStyleRef","property, reference")??_r(e,0,"ofStyleRef","property")??_r(e,1,"ofStyleRef","reference")}};function ii(e,t,r,n=[]){return{type:e,message:t,suggestions:n,...r&&{path:r}}}const ai="undefined"!=typeof process&&"production"===process.env.NODE_ENV||"undefined"!=typeof process&&"true"===process.env.HYPERFIXI_SKIP_VALIDATION||"undefined"!=typeof globalThis&&"true"===globalThis.HYPERFIXI_SKIP_VALIDATION;let si;function oi(){return si({validate:e=>({success:!0,data:e})})}function li(e,t){if(ai)return oi();const r=si({validate:r=>{if("object"!=typeof r||null===r||Array.isArray(r))return{success:!1,error:ii("type-mismatch","Expected object, received "+typeof r)};const n=r,i={};if(t?.strict){const t=Object.keys(e),r=Object.keys(n).filter(e=>!t.includes(e));if(r.length>0)return{success:!1,error:ii("runtime-error","Unexpected properties: "+r.join(", "))}}for(const[t,r]of Object.entries(e)){const e=n[t];if(!(t in n)&&!r._isOptional)return{success:!1,error:ii("missing-argument",`Required field "${t}" is missing`,t)};const a=r.validate(e);if(!a.success)return{success:!1,error:ii("validation-error",a.error.message||`Field "${t}" validation failed`,a.error.path?`${t}.${a.error.path}`:t)};void 0!==a.data&&(i[t]=a.data)}return{success:!0,data:i}}});return r.strict=()=>li(e,{strict:!0}),r}si=function(e){return e.describe||(e.describe=function(e){return this.description=e,this}),e.safeParse||(e.safeParse=function(e){const t=this.validate(e);return t.success?{success:!0,data:t.data}:{success:!1,error:{errors:t.error?[t.error]:[]}}}),e.parse||(e.parse=function(e){const t=this.validate(e);if(t.success&&void 0!==t.data)return t.data;throw Error(t.error?.message||"Validation failed")}),e.optional||(e.optional=function(){const e=this.validate.bind(this),t={...this,_isOptional:!0,validate:t=>null==t?{success:!0,data:void 0}:e(t)};return si(t)}),e.min||(e.min=function(e){const t=this.validate.bind(this),r={...this,validate:r=>{const n=t(r);return n.success&&"string"==typeof n.data&&e>n.data.length?{success:!1,error:ii("runtime-error",`String must be at least ${e} characters long`)}:n}};return si(r)}),e.max||(e.max=function(e){const t=this.validate.bind(this),r={...this,validate:r=>{const n=t(r);return n.success&&"string"==typeof n.data&&n.data.length>e?{success:!1,error:ii("runtime-error",`String must be at most ${e} characters long`)}:n}};return si(r)}),e.default||(e.default=function(e){const t=this.validate.bind(this),r={...this,_defaultValue:e,_hasDefault:!0,validate:r=>void 0===r?{success:!0,data:e}:t(r)};return si(r)}),e.rest||(e.rest=function(e){return this}),e.refine||(e.refine=function(e,t){const r=this.validate.bind(this),n={...this,validate:n=>{const i=r(n);return i.success?e(i.data)?i:{success:!1,error:ii("runtime-error",t||"Refinement validation failed")}:i}};return si(n)}),new Proxy(e,{get:(e,t,r)=>t in e||"string"!=typeof t||t.startsWith("_")||"constructor"===t||"validate"===t||"then"===t?Reflect.get(e,t,r):function(...e){return r}})};const ci=e=>function(e={}){return ai?oi():si({validate:t=>e.optional&&null==t?{success:!0,data:void 0}:"string"!=typeof t?{success:!1,error:ii("type-mismatch","Expected string, received "+typeof t)}:void 0!==e.minLength&&e.minLength>t.length?{success:!1,error:ii("runtime-error",`String must be at least ${e.minLength} characters long`)}:void 0!==e.maxLength&&t.length>e.maxLength?{success:!1,error:ii("runtime-error",`String must be at most ${e.maxLength} characters long`)}:e.pattern&&!e.pattern.test(t)?e.pattern.source.startsWith("^")&&e.pattern.source.endsWith("$")?{success:!1,error:ii("runtime-error",`Expected "${e.pattern.source.slice(1,-1)}", received "${t}"`)}:{success:!1,error:ii("missing-argument","String does not match required pattern")}:{success:!0,data:t},...e.description&&{description:e.description}})}(e||{}),ui=e=>li(e),di=e=>function(e){return ai?oi():si({validate:t=>{if(!Array.isArray(t))return{success:!1,error:ii("type-mismatch","Expected array, received "+typeof t)};if(t.length!==e.length)return{success:!1,error:ii("runtime-error",`Expected tuple of length ${e.length}, received length ${t.length}`)};const r=[];for(let n=0;e.length>n;n++){const i=e[n].validate(t[n]);if(!i.success)return{success:!1,error:ii("runtime-error",i.error.message,i.error.path?`${n}.${i.error.path}`:""+n)};r.push(i.data)}return{success:!0,data:r}}})}(e),mi=()=>oi();class pi{constructor(e=100,t=5e3){this.maxSize=e,this.ttl=t,this.cache=new Map,this.accessOrder=new Map,this.accessCounter=0}get(e){const t=this.cache.get(e);if(t){if(this.ttl>=Date.now()-t.timestamp)return t.accessCount++,this.accessOrder.set(e,++this.accessCounter),t.result;this.delete(e)}}set(e,t){this.maxSize>this.cache.size||this.cache.has(e)||this.evictLRU(),this.cache.set(e,{result:t,timestamp:Date.now(),accessCount:1}),this.accessOrder.set(e,++this.accessCounter)}delete(e){return this.accessOrder.delete(e),this.cache.delete(e)}clear(){this.cache.clear(),this.accessOrder.clear(),this.accessCounter=0}size(){return this.cache.size}evictLRU(){let e,t=1/0;for(const[r,n]of this.accessOrder)t>n&&(t=n,e=r);void 0!==e&&this.delete(e)}getStats(){const e=Array.from(this.cache.values()),t=Date.now();return{size:this.cache.size,maxSize:this.maxSize,hitRate:e.length>0?e.filter(e=>e.accessCount>1).length/e.length:0,avgAge:e.length>0?e.reduce((e,r)=>e+(t-r.timestamp),0)/e.length:0,totalAccesses:e.reduce((e,t)=>e+t.accessCount,0)}}}const hi=new class{constructor(){this.domQueryCache=new pi(200,3e3),this.exprResultCache=new pi(500,2e3),this.cssMatchCache=new pi(100,5e3),this.formValueCache=new pi(50,1e3),this.hits=0,this.misses=0}querySelector(e){const t="querySelector:"+e,r=this.domQueryCache.get(t);if(void 0!==r)return this.hits++,r;this.misses++;const n=document.querySelector(e);return this.domQueryCache.set(t,n),n}querySelectorAll(e){const t="querySelectorAll:"+e,r=this.domQueryCache.get(t);if(void 0!==r)return this.hits++,r;this.misses++;const n=Array.from(document.querySelectorAll(e));return this.domQueryCache.set(t,n),n}getElementById(e){const t="getElementById:"+e,r=this.domQueryCache.get(t);if(void 0!==r)return this.hits++,r;this.misses++;const n=document.getElementById(e);return this.domQueryCache.set(t,n),n}getElementsByClassName(e){const t="getElementsByClassName:"+e,r=this.domQueryCache.get(t);if(void 0!==r)return this.hits++,r;this.misses++;const n=Array.from(document.getElementsByClassName(e));return this.domQueryCache.set(t,n),n}matches(e,t){const r=`matches:${this.getElementCacheKey(e)}:${t}`,n=this.cssMatchCache.get(r);if(void 0!==n)return this.hits++,n;this.misses++;const i=e.matches(t);return this.cssMatchCache.set(r,i),i}getExpressionResult(e){const t=this.exprResultCache.get(e);if(void 0!==t)return this.hits++,t;this.misses++}setExpressionResult(e,t){this.exprResultCache.set(e,t)}getFormValue(e){const t=this.getElementCacheKey(e),r=this.formValueCache.get("formValue:"+t);if(void 0!==r)return this.hits++,r;this.misses++}setFormValue(e,t){const r=this.getElementCacheKey(e);this.formValueCache.set("formValue:"+r,t)}invalidateElementCache(e){const t=this.getElementCacheKey(e);for(const e of[this.domQueryCache,this.cssMatchCache,this.formValueCache])for(const r of Array.from(e.cache.keys()))"string"==typeof r&&r.includes(t)&&e.delete(r)}invalidateAll(){this.domQueryCache.clear(),this.exprResultCache.clear(),this.cssMatchCache.clear(),this.formValueCache.clear(),this.hits=0,this.misses=0}getElementCacheKey(e){if(e.id)return"#"+e.id;const t=Array.from(e.classList).sort().join("."),r=this.getElementPosition(e);return`${e.tagName.toLowerCase()}${t?"."+t:""}@${r}`}getElementPosition(e){return""+Array.from(e.parentElement?.children||[]).indexOf(e)}getPerformanceStats(){const e=this.hits+this.misses;return{hits:this.hits,misses:this.misses,hitRate:Math.round(100*(e>0?this.hits/e*100:0))/100,domQueryCache:this.domQueryCache.getStats(),exprResultCache:this.exprResultCache.getStats(),cssMatchCache:this.cssMatchCache.getStats(),formValueCache:this.formValueCache.getStats()}}cleanup(){const e=Date.now();[this.domQueryCache,this.exprResultCache,this.cssMatchCache,this.formValueCache].forEach(t=>{Array.from(t.cache.entries()).forEach(([r,n])=>{e-n.timestamp>t.ttl&&t.delete(r)})})}};"undefined"!=typeof window&&setInterval(()=>{hi.cleanup()},1e4);const fi=new class{constructor(){this.metrics={tokenizationTime:0,evaluationTime:0,cacheHitRate:0,memoryUsage:0,domOperations:0},this.startTimes=new Map}startTimer(e){this.startTimes.set(e,performance.now())}endTimer(e){const t=this.startTimes.get(e);if(t){const r=performance.now()-t;return this.startTimes.delete(e),r}return 0}recordTokenization(e){this.metrics.tokenizationTime+=e}recordEvaluation(e){this.metrics.evaluationTime+=e}updateCacheMetrics(){const e=hi.getPerformanceStats();this.metrics.cacheHitRate=e.hitRate}getMetrics(){return this.updateCacheMetrics(),{...this.metrics}}reset(){this.metrics={tokenizationTime:0,evaluationTime:0,cacheHitRate:0,memoryUsage:0,domOperations:0}}};function yi(){hi.cleanup(),fi.getMetrics().memoryUsage>52428800&&fi.reset()}let gi=null;function vi(e,t){if("number"==typeof e){if(!Number.isFinite(e))throw Error(`${t} must be a finite number, got ${e}`);return e}if("string"==typeof e){const r=e.trim();if(""===r)return 0;const n=parseFloat(r);if(isNaN(n))throw Error(`${t} cannot be converted to number: "${e}"`);return n}if("boolean"==typeof e)return e?1:0;if(null==e)return 0;if("object"==typeof e&&null!==e){if(Array.isArray(e)&&1===e.length){const r=e[0];if(Array.isArray(r))throw Error(t+" is a nested array, cannot convert to number");return vi(r,t)}if("string"==typeof e.textContent||"value"in e){const t=e.value??e.textContent;if(null!=t){const e=(t+"").trim();if(""===e)return 0;const r=parseFloat(e);if(!isNaN(r))return r}}const r=e.valueOf();if("number"==typeof r&&Number.isFinite(r))return r}throw Error(`${t} cannot be converted to number: ${typeof e}`)}function bi(e){if("number"==typeof e)return Number.isFinite(e)?e:null;if("string"==typeof e){const t=e.trim();if(""===t)return 0;const r=parseFloat(t);return isNaN(r)?null:r}return"boolean"==typeof e?e?1:0:null==e?0:null}function wi(e,t){if(!Number.isFinite(e)){if(Number.isNaN(e))throw Error(t+" resulted in non-finite value: NaN");throw Error(`${t} resulted in non-finite value: ${e>0?"Infinity":"-Infinity"}`)}return e}function ki(e){try{return vi(e,"_"),!0}catch{return!1}}function Ei(e,t,r){if("==="===r)return e===t;if("!=="===r)return e!==t;if(null==e||null==t)return function(e,t,r){if(null==e&&null==t)switch(r){case"==":case">=":case"<=":return!0;default:return!1}switch(r){case"==":case">":case"<":case">=":case"<=":default:return!1;case"!=":return!0}}(e,t,r);const[n,i]=function(e,t){if("number"==typeof e&&"number"==typeof t)return[e,t];if("string"==typeof e&&"string"==typeof t){const r=parseFloat(e),n=parseFloat(t);return isNaN(r)||isNaN(n)?[e,t]:[r,n]}const r=bi(e),n=bi(t);return null!==r&&null!==n?[r,n]:[e+"",t+""]}(e,t);switch(r){case">":return n>i;case"<":return i>n;case">=":return n>=i;case"<=":return i>=n;case"==":return xi(e,t);case"!=":return!xi(e,t);default:return!1}}function xi(e,t){if(e===t)return!0;if(typeof e==typeof t)return("string"==typeof e||"number"==typeof e)&&e===t;if("number"==typeof e&&"string"==typeof t){const r=parseFloat(t);return!isNaN(r)&&e===r}if("string"==typeof e&&"number"==typeof t){const r=parseFloat(e);return!isNaN(r)&&r===t}return"boolean"==typeof e?xi(e?1:0,t):"boolean"==typeof t?xi(e,t?1:0):e+""==t+""}function Ci(e,t=[]){return{isValid:!1,errors:e,suggestions:t}}function Ai(e,t,r=[],n="error"){return{type:e,message:t,suggestions:r,severity:n}}function Si(e,t,r,n,i,a=!0,s){return t&&"object"==typeof t&&"evaluationHistory"in t&&Array.isArray(t.evaluationHistory)&&t.evaluationHistory.push({expressionName:e.name,category:e.category,input:r,output:n,timestamp:i,duration:Date.now()-i,success:a,...void 0!==s&&{error:s}}),n}function Ti(e){return null!==e&&"object"==typeof e&&"nodeType"in e&&1===e.nodeType}"undefined"!=typeof window&&function(e=3e4){gi&&clearInterval(gi),gi=setInterval(yi,e)}();const Li=di([mi(),mi()]),Oi=di([mi(),ci()]),ji={name:"equals",category:"Comparison",evaluatesTo:"Boolean",precedence:10,associativity:"Left",operators:["is","==","equals"],async evaluate(e,t,r){const n=Date.now();try{return Si(this,e,[t,r],t==r,n)}catch(i){throw Si(this,e,[t,r],!1,n,!1,i instanceof Error?i:Error(i+"")),i}},validate:e=>Vr(e,"equals"),inputSchema:Li,metadata:{category:"Logical",complexity:"simple",sideEffects:[],dependencies:[],returnTypes:["Boolean"],examples:[{input:"value is 5",description:"Check if value equals 5 using loose equality",expectedOutput:!0,context:{result:5}},{input:'"5" == 5',description:'String "5" equals number 5 with type coercion',expectedOutput:!0}],relatedExpressions:["strictEquals","notEquals"],performance:{averageTime:.001,complexity:"O(1)"}},documentation:{summary:"Compares two values for loose equality, allowing type coercion",parameters:[{name:"left",type:"unknown",description:"Left operand for comparison",optional:!1,examples:["5",'"hello"',"true","null"]},{name:"right",type:"unknown",description:"Right operand for comparison",optional:!1,examples:["5",'"hello"',"true","null"]}],returns:{type:"Boolean",description:"True if values are loosely equal, false otherwise",examples:["true","false"]},examples:[{title:"Basic equality check",code:"if my.value is 10",explanation:"Check if element value equals 10",output:"Boolean result"},{title:"Type coercion",code:'if "5" == 5',explanation:'String "5" equals number 5 with automatic type conversion',output:"true"},{title:"Null checks",code:"if value is null",explanation:"Check if value is null or undefined",output:"Boolean result"}],seeAlso:["strictEquals","notEquals","matches"],tags:["comparison","equality","logic","type-coercion"]}},Pi={name:"strictEquals",category:"Comparison",evaluatesTo:"Boolean",precedence:10,associativity:"Left",operators:["==="],async evaluate(e,t,r){const n=e.evaluationHistory,i=t===r;return n&&Si(this,e,[t,r],i,n?Date.now():0),i},validate:e=>Vr(e,"strictEquals")},Ii={name:"notEquals",category:"Comparison",evaluatesTo:"Boolean",precedence:10,associativity:"Left",operators:["!=","is not","does not equal"],async evaluate(e,t,r){const n=e.evaluationHistory,i=t!=r;return n&&Si(this,e,[t,r],i,n?Date.now():0),i},validate:e=>Vr(e,"notEquals")},qi={name:"strictNotEquals",category:"Comparison",evaluatesTo:"Boolean",precedence:10,associativity:"Left",operators:["!=="],async evaluate(e,t,r){const n=e.evaluationHistory,i=t!==r;return n&&Si(this,e,[t,r],i,n?Date.now():0),i},validate:e=>Vr(e,"strictNotEquals")},Ni={name:"lessThan",category:"Comparison",evaluatesTo:"Boolean",precedence:12,associativity:"Left",operators:["<","is less than"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0,a=Ei(t,r,"<");return n&&Si(this,e,[t,r],a,i),a},validate:e=>Vr(e,"lessThan")},Ri={name:"lessThanOrEqual",category:"Comparison",evaluatesTo:"Boolean",precedence:12,associativity:"Left",operators:["<=","is less than or equal to"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0,a=Ei(t,r,"<=");return n&&Si(this,e,[t,r],a,i),a},validate:e=>Vr(e,"lessThanOrEqual")},Mi={name:"greaterThan",category:"Comparison",evaluatesTo:"Boolean",precedence:12,associativity:"Left",operators:[">","is greater than"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0,a=Ei(t,r,">");return n&&Si(this,e,[t,r],a,i),a},validate:e=>Vr(e,"greaterThan")},$i={name:"greaterThanOrEqual",category:"Comparison",evaluatesTo:"Boolean",precedence:12,associativity:"Left",operators:[">=","is greater than or equal to"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0,a=Ei(t,r,">=");return n&&Si(this,e,[t,r],a,i),a},validate:e=>Vr(e,"greaterThanOrEqual")},_i={name:"and",category:"Logical",evaluatesTo:"Boolean",precedence:6,associativity:"Left",operators:["and","&&"],async evaluate(e,t,r){const n=Date.now();try{return Si(this,e,[t,r],t&&r,n)}catch(i){throw Si(this,e,[t,r],!1,n,!1,i instanceof Error?i:Error(i+"")),i}},validate:e=>Vr(e,"and"),inputSchema:Li,metadata:{category:"Logical",complexity:"simple",sideEffects:[],dependencies:[],returnTypes:["Boolean"],examples:[{input:"true and false",description:"Logical AND of boolean values",expectedOutput:!1},{input:"name and age",description:"Both name and age must be truthy",expectedOutput:!0,context:{variables:new Map([["name","John"],["age",25]])}}],relatedExpressions:["or","not"],performance:{averageTime:.001,complexity:"O(1)"}},documentation:{summary:"Logical AND operation that returns true only if both operands are truthy",parameters:[{name:"left",type:"unknown",description:"Left operand (evaluated for truthiness)",optional:!1,examples:["true","name","5",'"hello"']},{name:"right",type:"unknown",description:"Right operand (evaluated for truthiness)",optional:!1,examples:["false","age","0",'""']}],returns:{type:"Boolean",description:"True if both operands are truthy, false otherwise",examples:["true","false"]},examples:[{title:"Form validation",code:"if name and email",explanation:"Check if both name and email have values",output:"Boolean result"},{title:"Multiple conditions",code:"if age > 18 and hasLicense",explanation:"Combine multiple conditions",output:"Boolean result"},{title:"Short-circuit evaluation",code:"if element and element.value",explanation:"Check element exists before accessing properties",output:"Boolean result"}],seeAlso:["or","not","exists"],tags:["logic","boolean","conditions","validation"]}},zi={name:"or",category:"Logical",evaluatesTo:"Boolean",precedence:5,associativity:"Left",operators:["or","||"],async evaluate(e,t,r){const n=e.evaluationHistory,i=t||r;return n&&Si(this,e,[t,r],i,n?Date.now():0),i},validate:e=>Vr(e,"or")},Vi={name:"not",category:"Logical",evaluatesTo:"Boolean",precedence:15,associativity:"Right",operators:["not","!"],async evaluate(e,t){const r=e.evaluationHistory,n=!t;return r&&Si(this,e,[t],n,r?Date.now():0),n},validate:e=>$r(e,1,"not","operand")},Hi={name:"isEmpty",category:"Logical",evaluatesTo:"Boolean",operators:["is empty","isEmpty"],async evaluate(e,t){const r=e.evaluationHistory,n=r?Date.now():0;let i;return i=null==t||(Cr(t)||Array.isArray(t)||t instanceof NodeList?0===t.length:!(t instanceof Node||t instanceof Element||!Tr(t)||0!==Object.keys(t).length)),r&&Si(this,e,[t],i,n),i},validate:e=>$r(e,1,"isEmpty","value")},Bi={name:"no",category:"Logical",evaluatesTo:"Boolean",operators:["no"],async evaluate(e,t){const r=e.evaluationHistory,n=r?Date.now():0;let i;return i=null==t||!1===t||(Array.isArray(t)||t instanceof NodeList?0===t.length:(Cr(t),!1)),r&&Si(this,e,[t],i,n),i},validate:e=>$r(e,1,"no","value")},Wi={name:"isNotEmpty",category:"Logical",evaluatesTo:"Boolean",operators:["is not empty","isNotEmpty"],async evaluate(e,t){const r=e.evaluationHistory,n=r?Date.now():0,i=!await Hi.evaluate(e,t);return r&&Si(this,e,[t],i,n),i},validate:e=>$r(e,1,"isNotEmpty","value")},Di={name:"exists",category:"Logical",evaluatesTo:"Boolean",operators:["exists"],async evaluate(e,t){const r=e.evaluationHistory,n=r?Date.now():0,i=Fi(t);return r&&Si(this,e,[t],i,n),i},validate:e=>$r(e,1,"exists","value")};function Fi(e){return null!=e&&(Array.isArray(e)?e.length>0:!("undefined"!=typeof NodeList&&e instanceof NodeList)||e.length>0)}const Ui={name:"doesNotExist",category:"Logical",evaluatesTo:"Boolean",operators:["does not exist","doesNotExist"],async evaluate(e,t){const r=e.evaluationHistory,n=r?Date.now():0,i=!Fi(t);return r&&Si(this,e,[t],i,n),i},validate:e=>$r(e,1,"doesNotExist","value")},Ki={name:"contains",category:"Logical",evaluatesTo:"Boolean",operators:["contains","includes","include"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0;let a;if(t&&r){if(Ti(t)&&Ti(r))return a=t.contains(r),n&&Si(this,e,[t,r],a,i),a;if(Cr(t)&&t.match(/^[.#][\w-]+$/)){const s=document.querySelector(t);if(s&&Ti(r))return a=s.contains(r),n&&Si(this,e,[t,r],a,i),a;if(s&&Cr(r)&&r.match(/^[.#][\w-]+$/)){const o=document.querySelector(r);return a=!!o&&s.contains(o),n&&Si(this,e,[t,r],a,i),a}}if(Cr(r)&&r.match(/^[.#][\w-]+$/)&&Ti(t)){const s=document.querySelector(r);return a=!!s&&t.contains(s),n&&Si(this,e,[t,r],a,i),a}}if(Cr(t)&&Cr(r))a=t.includes(r);else if(Array.isArray(t)||"undefined"!=typeof NodeList&&t instanceof NodeList){const e=Array.from(t);a=e.includes(r)||r instanceof Node&&e.some(e=>e instanceof Node&&e.contains(r))}else a=!(!Tr(t)||!Cr(r))&&r in t;return n&&Si(this,e,[t,r],a,i),a},validate:e=>$r(e,2,"contains","container, value")},Zi={name:"doesNotContain",category:"Logical",evaluatesTo:"Boolean",operators:["does not contain","doesNotContain","does not include","doesNotInclude"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0,a=!await Ki.evaluate(e,t,r);return n&&Si(this,e,[t,r],a,i),a},validate:e=>$r(e,2,"doesNotContain","container, value")},Xi={name:"startsWith",category:"Logical",evaluatesTo:"Boolean",operators:["starts with","startsWith"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0,a=null!=t&&null!=r&&(t+"").startsWith(r+"");return n&&Si(this,e,[t,r],a,i),a},validate:e=>$r(e,2,"startsWith","str, prefix")},Gi={name:"endsWith",category:"Logical",evaluatesTo:"Boolean",operators:["ends with","endsWith"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0,a=null!=t&&null!=r&&(t+"").endsWith(r+"");return n&&Si(this,e,[t,r],a,i),a},validate:e=>$r(e,2,"endsWith","str, suffix")},Ji={name:"between",category:"Logical",evaluatesTo:"Boolean",operators:["is between","between"],async evaluate(e,t,r,n){const i=e.evaluationHistory;let a=r,s=n;if(null!=a&&null!=s&&a>s){const e=a;a=s,s=e}const o=null!=a&&null!=s&&t>=a&&s>=t;return i&&Si(this,e,[t,r,n],o,i?Date.now():0),o},validate:e=>$r(e,3,"between","value, min, max")},Yi={name:"matches",category:"Logical",evaluatesTo:"Boolean",operators:["matches"],async evaluate(e,t,r){const n=Date.now();try{let i;if(t instanceof Element&&Cr(r)){const e=r;if(e.startsWith(".")||e.startsWith("#")||e.startsWith(":")||e.startsWith("[")||/^[a-zA-Z][\w-]*$/.test(e))try{i=function(e,t){return hi.matches(e,t)}(t,e)}catch(e){i=!1}else i=!1}else if(Cr(t)&&Cr(r)){const e=t,n=r;try{i=(n.startsWith("/")&&n.endsWith("/")?RegExp(n.slice(1,-1)):RegExp(n)).test(e)}catch(t){i=e.includes(n)}}else i=!1;return Si(this,e,[t,r],i,n)}catch(i){throw Si(this,e,[t,r],!1,n,!1,i instanceof Error?i:Error(i+"")),i}},validate:e=>$r(e,2,"matches","element, selector"),inputSchema:Oi,metadata:{category:"Logical",complexity:"medium",sideEffects:["dom-query"],dependencies:[],returnTypes:["Boolean"],examples:[{input:'element matches ".active"',description:"Check if element has active class",expectedOutput:!0},{input:'text matches "/^hello/"',description:'Check if text starts with "hello" using regex',expectedOutput:!0,context:{variables:new Map([["text","hello world"]])}}],relatedExpressions:["contains","startsWith","endsWith"],performance:{averageTime:.5,complexity:"O(n)"}},documentation:{summary:"Tests if element matches CSS selector or string matches regex pattern",parameters:[{name:"element",type:"Element | string",description:"DOM element or string to test",optional:!1,examples:["<div>",'"hello world"',"me","target"]},{name:"selector",type:"string",description:"CSS selector or regex pattern to match against",optional:!1,examples:['".active"','"#navbar"','"/^hello/"','"\\\\d+"']}],returns:{type:"Boolean",description:"True if element matches selector/pattern",examples:["true","false"]},examples:[{title:"CSS class matching",code:'if me matches ".active"',explanation:'Check if current element has "active" class',output:"Boolean result"},{title:"Attribute matching",code:'if target matches "[data-role=\\"button\\"]"',explanation:"Check if element has specific data attribute",output:"Boolean result"},{title:"Regex pattern matching",code:'if email matches "/^[^@]+@[^@]+\\\\.[^@]+$/"',explanation:"Validate email format with regex",output:"Boolean result"},{title:"Complex CSS selector",code:'if element matches ".card:hover .button"',explanation:"Match complex CSS selector with pseudo-classes",output:"Boolean result"}],seeAlso:["contains","startsWith","endsWith","querySelector"],tags:["pattern","css","regex","validation","dom"]}},Qi={name:"has",category:"Logical",evaluatesTo:"Boolean",operators:["has","have"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0;let a=!1;if(t instanceof Element&&Cr(r)){const e=r;e.startsWith(".")?a=t.classList.contains(e.slice(1)):e.startsWith("[")&&e.endsWith("]")&&(a=t.hasAttribute(e.slice(1,-1)))}return n&&Si(this,e,[t,r],a,i),a},validate:e=>$r(e,2,"has","element, selector")},ea={name:"doesNotHave",category:"Logical",evaluatesTo:"Boolean",operators:["does not have"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0,a=!await Qi.evaluate(e,t,r);return n&&Si(this,e,[t,r],a,i),a},validate:e=>$r(e,2,"doesNotHave","element, selector")},ta={equals:ji,strictEquals:Pi,notEquals:Ii,strictNotEquals:qi,lessThan:Ni,lessThanOrEqual:Ri,greaterThan:Mi,greaterThanOrEqual:$i,and:_i,or:zi,not:Vi,no:Bi,isEmpty:Hi,isNotEmpty:Wi,exists:Di,doesNotExist:Ui,contains:Ki,doesNotContain:Zi,startsWith:Xi,endsWith:Gi,between:Ji,matches:Yi,has:Qi,doesNotHave:ea};class ra{trackPerformance(e,t,r,n){e.evaluationHistory&&e.evaluationHistory.push({expressionName:this.name,category:this.category,input:t,output:r.success?r.value:r.error,timestamp:n,duration:Date.now()-n,success:r.success})}trackSimple(e,t,r,n=(r?"success":"error")){e.evaluationHistory&&e.evaluationHistory.push({expressionName:this.name,category:this.category,input:"operation",output:n,timestamp:t,duration:Date.now()-t,success:r})}toBoolean(e){return!(!1===e||0===e||0n===e||""===e||null==e||Ar(e)&&isNaN(e))}success(e,t){return{success:!0,value:e,type:t}}failure(e,t,r,n,i=[]){return{success:!1,error:{name:e,type:t,message:r,code:n,suggestions:i}}}validationSuccess(){return{isValid:!0,errors:[],suggestions:[]}}validationFailure(e,t,r=[]){return{isValid:!1,errors:[{type:e,message:t,suggestions:r}],suggestions:r}}isElement(e){return null!==e&&"object"==typeof e&&"nodeType"in e&&1===e.nodeType&&"tagName"in e&&"string"==typeof e.tagName}inferType(e){return null===e?"null":void 0===e?"undefined":this.isElement(e)?"element":Array.isArray(e)?"array":Tr(e)?"object":typeof e}inferEvaluationType(e){return void 0===e?"Undefined":null===e?"Null":Cr(e)?"String":Ar(e)?"Number":Sr(e)?"Boolean":Array.isArray(e)?"Array":this.isElement(e)?"Element":"Object"}normalizeCollection(e){return Array.isArray(e)?e:e instanceof NodeList?Array.from(e):Cr(e)?e.split(""):null==e?[]:Tr(e)&&Symbol.iterator in e?Array.from(e):[]}toNumber(e){if(Ar(e)&&Number.isFinite(e))return e;if(Cr(e)){const t=Number(e);return Number.isFinite(t)?t:null}return Sr(e)?e?1:0:null}}const na=ui({value:ci().describe("String literal value")}).strict(),ia=ui({value:function(e={}){return ai?oi():si({validate:t=>{const r=Number(t);return isNaN(r)?{success:!1,error:ii("type-mismatch","Expected number, received "+typeof t)}:void 0!==e.min&&e.min>r?{success:!1,error:ii("runtime-error","Number must be at least "+e.min)}:void 0!==e.max&&r>e.max?{success:!1,error:ii("runtime-error","Number must be at most "+e.max)}:{success:!0,data:r}}})}(oa||{}).describe("Number literal value")}).strict(),aa=ui({value:(ai?oi():si({validate:e=>"boolean"!=typeof e?{success:!1,error:ii("type-mismatch","Expected boolean, received "+typeof e)}:{success:!0,data:e}})).describe("Boolean literal value")}).strict(),sa=ui({left:mi().describe("Left operand"),right:mi().describe("Right operand")}).strict();var oa;const la={stringLiteral:new class extends ra{constructor(){super(...arguments),this.name="stringLiteral",this.category="Special",this.syntax="\"string\" or 'string'",this.description="String literals with template interpolation support",this.outputType="String",this.inputSchema=na,this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=Date.now();try{const n=this.validate(t);if(!n.isValid){const t=this.failure("ValidationError","validation-error",n.errors.map(e=>e.message).join(", "),"VALIDATION_FAILED",n.suggestions);return this.trackSimple(e,r,!1),t}let i=t.value;(i.includes("${")||i.includes("$"))&&(i=this.interpolateString(i,e));const a=this.success(i,"string");return this.trackSimple(e,r,!0,i),a}catch(t){return this.trackSimple(e,r,!1),this.failure("StringEvaluationError","runtime-error","String literal evaluation failed: "+(t instanceof Error?t.message:t+""),"STRING_EVALUATION_FAILED")}}validate(e){try{const t=this.inputSchema.safeParse(e);return t.success?this.validationSuccess():this.validationFailure("type-mismatch",t.error?.errors.map(e=>e.message).join(", ")||"Invalid string literal input",["Provide a value parameter","Ensure value is a string"])}catch(e){return this.validationFailure("runtime-error","Validation failed with exception",["Check input structure and types"])}}interpolateString(e,t){let r=e.replace(/\$\{([^}]+)\}/g,(e,r)=>{try{const e=this.resolveExpression(r.trim(),t);return void 0!==e?e+"":""}catch(e){return""}});return r=r.replace(/\$([a-zA-Z_$][a-zA-Z0-9_.$]*)/g,(e,r)=>{try{const e=this.resolveVariable(r,t);return void 0!==e?e+"":""}catch(e){return""}}),r}resolveExpression(e,t){if(e.includes(".")){const r=e.split(".");let n=this.resolveVariable(r[0],t);for(let e=1;r.length>e&&null!=n;e++)n=n[r[e]];return n}return this.resolveVariable(e,t)}resolveVariable(e,t){return"me"===e&&t.me?t.me:"you"===e&&t.you?t.you:"it"===e&&t.it?t.it:"result"===e&&t.result?t.result:t.locals?.has(e)?($e(e,t),t.locals.get(e)):t.globals?.has(e)?t.globals.get(e):void 0}},numberLiteral:new class extends ra{constructor(){super(...arguments),this.name="numberLiteral",this.category="Special",this.syntax="123 or 3.14",this.description="Numeric literal with validation",this.inputSchema=ia,this.outputType="Number",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=Date.now();try{const n=this.validate(t);return n.isValid?Number.isFinite(t.value)?(this.trackSimple(e,r,!0,t.value),this.success(t.value,"number")):(this.trackSimple(e,r,!1),this.failure("NumberValidationError","invalid-argument","Number literal must be finite","NUMBER_NOT_FINITE")):(this.trackSimple(e,r,!1),this.failure("ValidationError","validation-error",n.errors.map(e=>e.message).join(", "),"VALIDATION_FAILED",n.suggestions))}catch(t){return this.trackSimple(e,r,!1),this.failure("NumberEvaluationError","runtime-error","Number literal evaluation failed: "+(t instanceof Error?t.message:t+""),"NUMBER_EVALUATION_FAILED")}}validate(e){try{const t=this.inputSchema.safeParse(e);return t.success?Number.isFinite(t.data.value)?this.validationSuccess():this.validationFailure("invalid-argument","Number literal value must be finite",["Use finite numbers only","Avoid Infinity and NaN values"]):this.validationFailure("type-mismatch",t.error?.errors.map(e=>e.message).join(", ")||"Invalid number literal input",["Provide a value parameter","Ensure value is a number"])}catch(e){return this.validationFailure("runtime-error","Validation failed with exception",["Check input structure and types"])}}},booleanLiteral:new class extends ra{constructor(){super(...arguments),this.name="booleanLiteral",this.category="Special",this.syntax="true or false",this.description="Boolean literal values",this.inputSchema=aa,this.outputType="Boolean",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=Date.now();try{const n=this.validate(t);return n.isValid?(this.trackSimple(e,r,!0,t.value),this.success(t.value,"boolean")):(this.trackSimple(e,r,!1),this.failure("ValidationError","validation-error",n.errors.map(e=>e.message).join(", "),"VALIDATION_FAILED",n.suggestions))}catch(t){return this.trackSimple(e,r,!1),this.failure("BooleanEvaluationError","runtime-error","Boolean literal evaluation failed: "+(t instanceof Error?t.message:t+""),"BOOLEAN_EVALUATION_FAILED")}}validate(e){try{const t=this.inputSchema.safeParse(e);return t.success?this.validationSuccess():this.validationFailure("type-mismatch",t.error?.errors.map(e=>e.message).join(", ")||"Invalid boolean literal input",["Provide a value parameter","Ensure value is a boolean"])}catch(e){return this.validationFailure("runtime-error","Validation failed with exception",["Check input structure and types"])}}},addition:new class extends ra{constructor(){super(...arguments),this.name="addition",this.category="Special",this.syntax="left + right",this.description="Addition of two numeric values",this.inputSchema=sa,this.outputType="Number",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=Date.now();try{const n=this.validate(t);if(!n.isValid)return this.trackSimple(e,r,!1),this.failure("ValidationError","validation-error",n.errors.map(e=>e.message).join(", "),"VALIDATION_FAILED",n.suggestions);const i=vi(t.left,"left operand")+vi(t.right,"right operand");return this.trackSimple(e,r,!0,i),this.success(i,"number")}catch(t){return this.trackSimple(e,r,!1),this.failure("AdditionError","runtime-error","Addition failed: "+(t instanceof Error?t.message:t+""),"ADDITION_FAILED")}}validate(e){try{const t=this.inputSchema.safeParse(e);return t.success?this.validationSuccess():this.validationFailure("type-mismatch",t.error?.errors.map(e=>e.message).join(", ")||"Invalid addition input",["Provide left and right operands"])}catch(e){return this.validationFailure("runtime-error","Validation failed with exception",["Check input structure and types"])}}},stringConcatenation:new class extends ra{constructor(){super(...arguments),this.name="stringConcatenation",this.category="Special",this.syntax="left + right (string concatenation)",this.description="Concatenation of two values into a string",this.inputSchema=sa,this.outputType="String",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=Date.now();try{const n=this.validate(t);if(!n.isValid)return this.trackSimple(e,r,!1),this.failure("ValidationError","validation-error",n.errors[0]?.message||"Invalid input","STRING_CONCATENATION_VALIDATION_FAILED",n.suggestions);const i=this.convertToString(t.left)+this.convertToString(t.right);return this.trackSimple(e,r,!0,i),this.success(i,"string")}catch(t){return this.trackSimple(e,r,!1),this.failure("StringConcatenationError","runtime-error",t instanceof Error?t.message:"String concatenation failed","STRING_CONCATENATION_ERROR",["Check that operands can be converted to strings"])}}validate(e){const t=sa.safeParse(e);return t.success?this.validationSuccess():this.validationFailure("type-mismatch",t.error?.errors.map(e=>e.message).join(", ")||"Invalid string concatenation input",["Provide left and right operands for concatenation"])}convertToString(e){if(null===e)return"null";if(void 0===e)return"undefined";if(Cr(e))return e;if(Ar(e))return""+e;if(Sr(e))return""+e;if(e instanceof Date)return""+e;try{return e+""}catch{return"[object Object]"}}},multiplication:new class extends ra{constructor(){super(...arguments),this.name="multiplication",this.category="Special",this.syntax="left * right",this.description="Multiplication of two numeric values",this.inputSchema=sa,this.outputType="Number",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=Date.now();try{const n=this.validate(t);if(!n.isValid)return this.trackSimple(e,r,!1),this.failure("ValidationError","validation-error",n.errors.map(e=>e.message).join(", "),"VALIDATION_FAILED",n.suggestions);const i=vi(t.left,"left operand")*vi(t.right,"right operand");return this.trackSimple(e,r,!0,i),this.success(i,"number")}catch(t){return this.trackSimple(e,r,!1),this.failure("MultiplicationError","runtime-error","Multiplication failed: "+(t instanceof Error?t.message:t+""),"MULTIPLICATION_FAILED")}}validate(e){try{const t=this.inputSchema.safeParse(e);return t.success?this.validationSuccess():this.validationFailure("type-mismatch",t.error?.errors.map(e=>e.message).join(", ")||"Invalid multiplication input",["Provide left and right operands"])}catch(e){return this.validationFailure("runtime-error","Validation failed with exception",["Check input structure and types"])}}}},ca={name:"first",category:"Reference",evaluatesTo:"Any",operators:["first"],async evaluate(e,t){const r=void 0!==t?t:e.it;return null==r?null:Array.isArray(r)||r instanceof NodeList||r instanceof HTMLCollection?r.length>0?r[0]:null:r instanceof Element?r.children.length>0?r.children[0]:null:Cr(r)?r.length>0?r[0]:null:Tr(r)&&"length"in r&&Ar(r.length)&&r.length>0?r[0]:null},validate:e=>Br(e,1,"first","collection")},ua={name:"last",category:"Reference",evaluatesTo:"Any",operators:["last"],async evaluate(e,t){const r=void 0!==t?t:e.it;if(null==r)return null;if(Array.isArray(r))return r.length>0?r[r.length-1]:null;if(r instanceof NodeList||r instanceof HTMLCollection)return r.length>0?r[r.length-1]:null;if(r instanceof Element){const e=r.children;return e.length>0?e[e.length-1]:null}return Cr(r)?r.length>0?r[r.length-1]:null:Tr(r)&&"length"in r&&Ar(r.length)&&r.length>0?r[r.length-1]:null},validate:e=>Br(e,1,"last","collection")},da={name:"at",category:"Reference",evaluatesTo:"Any",operators:["at"],async evaluate(e,...t){const[r,n]=t;if(!Ar(r))throw Error("Index must be a number");const i=r,a=void 0!==n?n:e.it;if(null==a)return null;if(Array.isArray(a)){const e=0>i?a.length+i:i;return e>=0&&a.length>e?a[e]:null}if(a instanceof NodeList||a instanceof HTMLCollection){const e=0>i?a.length+i:i;return e>=0&&a.length>e?a[e]:null}if(a instanceof Element){const e=a.children,t=0>i?e.length+i:i;return t>=0&&e.length>t?e[t]:null}if(Cr(a)){const e=0>i?a.length+i:i;return e>=0&&a.length>e?a[e]:null}if(Tr(a)&&"length"in a&&Ar(a.length)){const e=0>i?a.length+i:i;return e>=0&&a.length>e?a[e]:null}return null},validate:e=>Wr(e,1,2,"at","index, optional collection")??function(e){return"number"!=typeof e[0]?"at index must be a number":null}(e)};function ma(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;const e=r.querySelector(t);if(e)return e;r=r.nextElementSibling}const n=e.parentElement;return n&&n!==document.documentElement?ma(n,t):null}function pa(e,t){let r=e.previousElementSibling;for(;r;){const e=Array.from(r.querySelectorAll(t)).reverse();if(e.length>0)return e[0];if(r.matches(t))return r;r=r.previousElementSibling}const n=e.parentElement;return n&&n!==document.documentElement?pa(n,t):null}function ha(e,t,r,n){if(r.inSearch){if(null==r.inElt)return;return function(e,t,r,n){const i=Array.from(t??[]),a=[];for(const t of i)(t.matches&&t.matches(r)||t===e)&&a.push(t);for(let t=0;a.length-1>t;t++)if(a[t]===e)return a[t+1];if(n){const e=a[0];if(e&&e.matches&&e.matches(r))return e}}(e,n?Array.from(r.inElt):Array.from(r.inElt).reverse(),t,!!r.wrapping)}const i=r.within??("undefined"!=typeof document?document.body:null);if(i)return n?function(e,t,r,n){const i=t.querySelectorAll(r);for(let t=0;i.length>t;t++){const r=i[t];if(2===r.compareDocumentPosition(e))return r}return n?i[0]:void 0}(e,i,t,!!r.wrapping):function(e,t,r,n){const i=t.querySelectorAll(r);for(let t=i.length-1;t>=0;t--){const r=i[t];if(4===r.compareDocumentPosition(e))return r}return n?i[i.length-1]:void 0}(e,i,t,!!r.wrapping)}function fa(e){let t=0,r=e;for(;r&&r.parentElement;)t+=Array.from(r.parentElement.children).indexOf(r),r=r.parentElement,t+=1e3;return t}const ya={first:ca,last:ua,at:da,next:{name:"next",category:"Reference",evaluatesTo:"Element",operators:["next"],async evaluate(e,...t){const[r,n,i]=t,a=n||e.me;return a&&a instanceof Element?r?i?ha(a,r,i,!0):ma(a,r):a.nextElementSibling:null},validate:e=>Br(e,3,"next","optional selector, optional fromElement, optional modifiers")||(1>e.length||null==e[0]||"string"==typeof e[0]?2>e.length||null==e[1]||e[1]instanceof Element?null:"fromElement must be an Element":"selector must be a string")},previous:{name:"previous",category:"Reference",evaluatesTo:"Element",operators:["previous","prev"],async evaluate(e,...t){const[r,n,i]=t,a=n||e.me;return a&&a instanceof Element?r?i?ha(a,r,i,!1):pa(a,r):a.previousElementSibling:null},validate:e=>Br(e,3,"previous","optional selector, optional fromElement, optional modifiers")||(1>e.length||null==e[0]||"string"==typeof e[0]?2>e.length||null==e[1]||e[1]instanceof Element?null:"fromElement must be an Element":"selector must be a string")},nextWithin:{name:"nextWithin",category:"Reference",evaluatesTo:"Element",operators:["next within"],async evaluate(e,...t){const[r,n,i]=t,a=i||e.me;if(!(a&&a instanceof Element))return null;const s=a.closest(n);return s?function(e,t,r){const n=Array.from(r.querySelectorAll(t)),i=fa(e);for(const e of n)if(fa(e)>i)return e;return null}(a,r,s):null},validate:e=>Wr(e,2,3,"nextWithin","selector, withinSelector, optional fromElement")||("string"!=typeof e[0]?"selector must be a string":"string"!=typeof e[1]?"withinSelector must be a string":3>e.length||null==e[2]||e[2]instanceof Element?null:"fromElement must be an Element")},previousWithin:{name:"previousWithin",category:"Reference",evaluatesTo:"Element",operators:["previous within"],async evaluate(e,...t){const[r,n,i]=t,a=i||e.me;if(!(a&&a instanceof Element))return null;const s=a.closest(n);return s?function(e,t,r){const n=Array.from(r.querySelectorAll(t)),i=fa(e);for(let e=n.length-1;e>=0;e--){const t=n[e];if(i>fa(t))return t}return null}(a,r,s):null},validate:e=>Wr(e,2,3,"previousWithin","selector, withinSelector, optional fromElement")||("string"!=typeof e[0]?"selector must be a string":"string"!=typeof e[1]?"withinSelector must be a string":3>e.length||null==e[2]||e[2]instanceof Element?null:"fromElement must be an Element")}};function ga(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?n.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),m=!1,p=r.length-1;p>=0;p--){var h={};for(var f in n)h[f]="access"===f?{}:n[f];for(var f in n.access)h.access[f]=n.access[f];h.addInitializer=function(e){if(m)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var y=(0,r[p])("accessor"===l?{get:d.get,set:d.set}:d[c],h);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(o=s(y.get))&&(d.get=o),(o=s(y.set))&&(d.set=o),(o=s(y.init))&&i.unshift(o)}else(o=s(y))&&("field"===l?i.unshift(o):d[c]=o)}u&&Object.defineProperty(u,n.name,d),m=!0}function va(e,t,r){for(var n=arguments.length>2,i=0;t.length>i;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0}function ba(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function wa(e){const t=e.trim();return!(!t.startsWith("[@")||!t.endsWith("]"))||!!t.startsWith("@")}function ka(e){const t=e.trim();if(t.startsWith("[@")&&t.endsWith("]")){const e=t.slice(2,-1),r=e.indexOf("=");if(-1===r)return{name:e.trim()};const n=e.slice(0,r).trim();let i=e.slice(r+1).trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1)),{name:n,value:i}}if(t.startsWith("@"))return{name:t.substring(1).trim()};throw Error("Invalid attribute syntax: "+e)}function Ea(e,t){for(const r of e)t(r);return e}function xa(e,t,r){for(const n of e)for(const e of t)r(n,e);return e}function Ca(e,t,r){const n=e.hasAttribute(t);void 0!==r?n&&e.getAttribute(t)===r?e.removeAttribute(t):e.setAttribute(t,r):n?e.removeAttribute(t):e.setAttribute(t,"")}function Aa(e){if(!e)return[];if("string"==typeof e)return e.trim().split(/[\s,]+/).map(e=>{const t=e.trim();return t.startsWith(".")?t.substring(1):t}).filter(e=>e.length>0&&Ta(e));if(Array.isArray(e))return e.map(e=>{const t=(e+"").trim();return t.startsWith(".")?t.substring(1):t}).filter(e=>e.length>0&&Ta(e));const t=(e+"").trim(),r=t.startsWith(".")?t.substring(1):t;return r.length>0&&Ta(r)?[r]:[]}function Sa(e){const t=e.trim();return/^\{[^}]+\}$/.test(t)}function Ta(e){if(!e||0===e.trim().length)return!1;const t=e.trim();return!!Sa(t)||/^[a-zA-Z_-][a-zA-Z0-9_-]*$/.test(t)}function La(e,t){return e.map(e=>{if(Sa(e)){const r=function(e){const t=e.trim(),r=t.match(/^\{(.+)\}$/);return r?r[1].trim():t}(e),n=t.locals.get(r)??t.globals.get(r);return null!=n?n+"":(de(`Dynamic class variable '${r}' not found in context`),"")}return e}).filter(e=>e.length>0)}function Oa(e){return function(t,r){Object.defineProperty(t.prototype,"name",{value:e.name,writable:!1,enumerable:!0})}}function ja(e){return{...e}}function Pa(e){return()=>new e}function Ia(e,t){return e?`[${e}] ${t}`:t}function qa(e,t,r){if(hr(e))return e;if(!e){const e=t.me;if(!e)throw Error(Ia(r,"No target element \u2014 provide explicit target or ensure context.me is set"));return Ra(e)}if("string"==typeof e){const n=e.trim();if("me"===n){if(!t.me)throw Error(Ia(r,'Context reference "me" is not available'));return Ra(t.me)}if("it"===n){if(!hr(t.it))throw Error(Ia(r,'Context reference "it" is not an HTMLElement'));return t.it}if("you"===n){if(!t.you)throw Error(Ia(r,'Context reference "you" is not available'));return Ra(t.you)}const i=t.me?.ownerDocument??("undefined"!=typeof document?document:null);if(!i)throw Error(Ia(r,"DOM not available \u2014 cannot resolve element selector"));const a=i.querySelector(n);if(!a)throw Error(Ia(r,"Element not found with selector: "+n));if(!hr(a))throw Error(Ia(r,"Element found but is not an HTMLElement: "+n));return a}throw Error(Ia(r,"Invalid target type: "+typeof e))}function Na(e,t){if(Array.isArray(e))return e.filter(hr);if(fr(e))return Array.from(e).filter(hr);if(hr(e))return[e];if(!e){const e=t.me;return e&&hr(e)?[e]:[]}if("string"==typeof e){const r=e.trim();if("me"===r)return t.me&&hr(t.me)?[t.me]:[];if("it"===r)return hr(t.it)?[t.it]:[];if("you"===r)return t.you&&hr(t.you)?[t.you]:[];const n=t.me?.ownerDocument??("undefined"!=typeof document?document:null);if(n){let e=r;e.startsWith("<")&&e.endsWith("/>")&&(e=e.slice(1,-2).trim());const t=n.querySelectorAll(e);return Array.from(t).filter(hr)}}return[]}function Ra(e){if(hr(e))return e;throw Error("Value is not an HTMLElement")}function Ma(e,t,r){switch(e.toLowerCase()){case"my":case"me":if(!t.me)throw Error(Ia(r,'No "me" element in context'));if(!hr(t.me))throw Error(Ia(r,"context.me is not an HTMLElement"));return t.me;case"its":case"it":if(!t.it)throw Error(Ia(r,'No "it" value in context'));if(!hr(t.it))throw Error(Ia(r,"context.it is not an HTMLElement"));return t.it;case"your":case"you":if(!t.you)throw Error(Ia(r,'No "you" element in context'));if(!hr(t.you))throw Error(Ia(r,"context.you is not an HTMLElement"));return t.you;default:throw Error(Ia(r,"Unknown possessive: "+e))}}"function"==typeof SuppressedError&&SuppressedError;const $a=["on","from","to","in","with","at"];async function _a(e,t,r,n,i={},a){let s=e;if(i.filterPrepositions&&e&&(s=e.filter(e=>{const t=e;return"identifier"!==t?.type||"string"!=typeof t.name||!$a.includes(t.name.toLowerCase())})),(!s||0===s.length)&&i.fallbackModifierKey&&a){const e=a[i.fallbackModifierKey];e&&(s=[e])}if(!s||0===s.length){if(!r.me)throw Error(n+" command: no target specified and context.me is null");if(!hr(r.me))throw Error(n+" command: context.me must be an HTMLElement");return[r.me]}const o=[];for(const e of s){const i=await t.evaluate(e,r);if(""!==i&&("string"!=typeof i||""!==i.trim()))if(hr(i))o.push(i);else if(fr(i)){const e=Array.from(i).filter(hr);o.push(...e)}else if(Array.isArray(i)){const e=i.filter(hr);o.push(...e)}else{if("string"!=typeof i){if(null==i)continue;throw Error(`Invalid ${n} target: expected HTMLElement or CSS selector, got ${typeof i}`)}try{let e=i;e.startsWith("<")&&e.endsWith("/>")&&(e=e.slice(1,-2).trim());const t=r.me?.ownerDocument??("undefined"!=typeof document?document:null);if(!t)throw Error("DOM not available - cannot resolve element selector");const n=t.querySelectorAll(e),a=Array.from(n).filter(hr);o.push(...a)}catch(e){throw Error(`Invalid CSS selector: "${i}" - ${e instanceof Error?e.message:e+""}`)}}}if(0===o.length){if(!r.me)throw Error(n+" command: no target specified and context.me is null");if(!hr(r.me))throw Error(n+" command: context.me must be an HTMLElement");return[r.me]}return o}function za(e){return"string"==typeof e&&e.trim().startsWith("*")}function Va(e){const t=function(e){const t=e.trim();if(!t.startsWith("*"))return null;const r=t.substring(1).trim();return r?{property:r}:null}(e);if(!t)return null;const r=t.property.toLowerCase();return["display","visibility","opacity"].includes(r)?r:null}function Ha(e,t,r){e.style.setProperty(t,r)}const Ba=["dialog","details","summary","select"];function Wa(e){return e&&"object"==typeof e?"string"==typeof e.selector?e.selector:"string"==typeof e.value?e.value:"string"==typeof e.name?e.name:null:null}async function Da(e,t,r){return function(e){if(!e||"object"!=typeof e)return!1;const t=e.type;if("selector"!==t&&"cssSelector"!==t&&"classSelector"!==t)return!1;const r=Wa(e);return"string"==typeof r&&r.startsWith(".")}(e)||function(e){if(!e||"object"!=typeof e)return!1;const t=e.type;if("selector"!==t&&"cssSelector"!==t&&"cssProperty"!==t)return!1;const r=Wa(e);return"string"==typeof r&&r.startsWith("*")}(e)?{value:Wa(e),extractedFromNode:!0}:function(e){if(!e||"object"!=typeof e)return!1;if("attributeAccess"===e.type)return!0;if("selector"===e.type||"cssSelector"===e.type){const t=Wa(e);return"string"==typeof t&&t.startsWith("@")}return!1}(e)?{value:(n=e,"attributeAccess"===n.type?"@"+n.attributeName:Wa(n)),extractedFromNode:!0}:{value:await t.evaluate(e,r),extractedFromNode:!1};var n}class Fa{async resolveTargets(e,t,r,n){return _a(e,t,r,this.mode,{filterPrepositions:!0,fallbackModifierKey:this.preposition},n)}async evaluateFirst(e,t,r){return Da(e,t,r)}parseClassNames(e){return Aa(e)}isAttribute(e){return wa(e.trim())}isCSSProperty(e){return za(e.trim())}validateTargets(e){return Array.isArray(e)&&function(e){return Array.isArray(e)&&e.length>0&&e.every(e=>hr(e))}(e)}validateType(e,t){return function(e,t){return"string"==typeof e&&t.includes(e)}(e,t)}validateStringArray(e,t=1){return Array.isArray(e)&&function(e,t=1){return Array.isArray(e)&&e.length>=t&&e.every(e=>"string"==typeof e&&e.length>0)}(e,t)}}let Ua=(()=>{let e,t,r=[Oa({name:"add"})],n=[],i=Fa;var a=t=class extends i{constructor(){super(...arguments),this.mode="add",this.preposition="to"}get metadata(){return a.metadata}async parseInput(e,t,r){if(!e.args||0===e.args.length)throw Error("add command requires an argument");const{value:n}=await this.evaluateFirst(e.args[0],t,r);if("object"==typeof n&&null!==n&&!Array.isArray(n))return{type:"styles",styles:n,targets:await this.resolveTargets(e.args.slice(1),t,r,e.modifiers)};if("string"==typeof n){const i=n.trim();if(this.isAttribute(i)){const{name:n,value:a}=function(e){const t=ka(e);return{name:t.name,value:t.value??""}}(i);return{type:"attribute",name:n,value:a,targets:await this.resolveTargets(e.args.slice(1),t,r,e.modifiers)}}if(this.isCSSProperty(i)){const n=i.substring(1).trim();if(2>e.args.length)throw Error("add *property requires a value argument");const a=await t.evaluate(e.args[1],r);return{type:"styles",styles:{[n]:a+""},targets:await this.resolveTargets(e.args.slice(2),t,r,e.modifiers)}}}const i=this.parseClassNames(n);if(0===i.length)throw Error("add command: no valid class names found");return{type:"classes",classes:i,targets:await this.resolveTargets(e.args.slice(1),t,r,e.modifiers)}}async execute(e,t){switch(e.type){case"classes":{const r=La(e.classes,t);r.length>0&&xa(e.targets,r,(e,t)=>{e.classList.contains(t)||e.classList.add(t)});break}case"attribute":r=e.name,n=e.value,Ea(e.targets,e=>{e.setAttribute(r,n)});break;case"styles":!function(e,t){xa(e,Object.entries(t),(e,[t,r])=>{e.style.setProperty(t,r)})}(e.targets,e.styles)}var r,n}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;if(!this.validateType(t.type,["classes","attribute","styles"]))return!1;if(!this.validateTargets(t.targets))return!1;if("classes"===t.type){if(!this.validateStringArray(e.classes,1))return!1}else if("attribute"===t.type){if("string"!=typeof e.name||0===e.name.length)return!1;if("string"!=typeof e.value)return!1}else if("styles"===t.type){const t=e;if("object"!=typeof t.styles||null===t.styles)return!1;if(Array.isArray(t.styles))return!1;const r=t.styles;if(0===Object.keys(r).length)return!1;if(!Object.values(r).every(e=>"string"==typeof e))return!1}return!0}};return ba(t,"AddCommand"),(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),a=t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),t.metadata=ja({description:"Add CSS classes, attributes, or styles to elements",syntax:"add <classes|@attr|{styles}> [to <target>]",examples:["add .active to me",'add "active selected" to <button/>',"add .highlighted to #modal",'add [@data-test="value"] to #element'],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),va(t,n),a=t})();const Ka=Pa(Ua),Za={before:"beforebegin",prepend:"afterbegin",append:"beforeend",after:"afterend",into:"replace"};function Xa(e){return e.includes("<")&&e.includes(">")}function Ga(e,t,r){!function(e,t,r){"replace"!==r?hr(t)?function(e,t,r){switch(r){case"beforebegin":e.parentElement?.insertBefore(t,e);break;case"afterbegin":e.insertBefore(t,e.firstChild);break;case"beforeend":e.appendChild(t);break;case"afterend":e.parentElement?.insertBefore(t,e.nextSibling)}}(e,t,r):function(e,t,r){const n=r,i=["beforebegin","afterbegin","beforeend","afterend"];if(!i.includes(n))throw Error(`Invalid insert position '${r}'. Expected one of ${i.join(", ")} (or 'replace').`);Xa(t)?e.insertAdjacentHTML(n,t):e.insertAdjacentText(n,t)}(e,t,r):function(e,t){hr(t)?(e.innerHTML="",e.appendChild(t)):Xa(t)?e.innerHTML=t:e.textContent=t}(e,t)}(e,t,function(e){const t=Za[e];if(void 0===t)throw Error(`Unknown semantic position '${e}'. Valid positions: ${Object.keys(Za).join(", ")}.`);return t}(r))}function Ja(e){return!!e.parentNode&&(e.remove(),!0)}let Ya=(()=>{let e,t,r=[Oa({name:"remove"})],n=[],i=Fa;var a=t=class extends i{constructor(){super(...arguments),this.mode="remove",this.preposition="from"}get metadata(){return a.metadata}async parseInput(e,t,r){if(!e.args||0===e.args.length)throw Error("remove command requires an argument");const{value:n}=await this.evaluateFirst(e.args[0],t,r);if(hr(n))return{type:"element",targets:[n]};if(Array.isArray(n)&&n.length>0&&hr(n[0]))return{type:"element",targets:n.filter(e=>hr(e))};if("string"==typeof n){const i=n.trim();if(this.isAttribute(i))return{type:"attribute",name:ka(i).name,targets:await this.resolveTargets(e.args.slice(1),t,r,e.modifiers)};if(this.isCSSProperty(i))return{type:"styles",properties:[i.substring(1).trim()],targets:await this.resolveTargets(e.args.slice(1),t,r,e.modifiers)}}const i=this.parseClassNames(n);if(0===i.length)throw Error("remove command: no valid class names found");return{type:"classes",classes:i,targets:await this.resolveTargets(e.args.slice(1),t,r,e.modifiers)}}execute(e,t){switch(e.type){case"classes":{const r=La(e.classes,t);r.length>0&&xa(e.targets,r,(e,t)=>{e.classList.remove(t)});break}case"attribute":r=e.name,Ea(e.targets,e=>{e.removeAttribute(r)});break;case"styles":!function(e,t){xa(e,t,(e,t)=>{e.style.removeProperty(t)})}(e.targets,e.properties);break;case"element":for(const t of e.targets)Ja(t)}var r}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;if(!this.validateType(t.type,["classes","attribute","styles","element"]))return!1;if(!this.validateTargets(t.targets))return!1;if("classes"===t.type){if(!this.validateStringArray(e.classes,1))return!1}else if("attribute"===t.type){if("string"!=typeof e.name||0===e.name.length)return!1}else if("styles"===t.type&&!this.validateStringArray(e.properties,1))return!1;return!0}};return ba(t,"RemoveCommand"),(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),a=t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),t.metadata=ja({description:"Remove CSS classes, attributes, styles, or elements from the DOM",syntax:"remove <classes|@attr|*prop|element> [from <target>]",examples:["remove .active from me",'remove "active selected" from <button/>',"remove .highlighted from #modal","remove me","remove closest .item"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),va(t,n),a=t})();const Qa=Pa(Ya);function es(e){const t=e.trim().match(/^(\d+(?:\.\d+)?)\s*(s|ms|sec|seconds?|milliseconds?)?$/i);if(!t)return null;const r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();return"ms"===n||"millisecond"===n||"milliseconds"===n?{number:r,milliseconds:Math.floor(r)}:"s"===n||"sec"===n||"second"===n||"seconds"===n?{number:r,milliseconds:Math.floor(1e3*r)}:null}function ts(e,t=300){if("number"==typeof e)return Math.max(0,Math.floor(e));if("string"==typeof e){const r=es(e);return r?r.milliseconds:t}return t}function rs(e){if("number"==typeof e){if(0>e)throw Error("Duration must be >= 0");return Math.floor(e)}if("string"==typeof e){const t=es(e);if(!t)throw Error(`Invalid duration format: "${e}"`);return t.milliseconds}throw Error("Invalid duration type: "+typeof e)}function ns(e){return e&&"none"!==e?e.split(",").map(e=>{const t=parseFloat(e.trim());return isNaN(t)?0:e.includes("s")&&!e.includes("ms")?1e3*t:t}):[0]}function is(e,t){let r=0;for(let n=0;e.length>n;n++)r=Math.max(r,(e[n]||0)+(t[n]||0));return r}function as(e){return 0===e.length?[]:"SUMMARY"===e[0].tagName?e.map(e=>e.closest("details")).filter(e=>null!==e):e}function ss(e){return"DIALOG"===e.tagName}function os(e){return"DETAILS"===e.tagName}function ls(e,t,r){return()=>{"class"===t?e.classList.toggle(r):"attribute"===t&&Ca(e,r)}}function cs(e,t,r,n){const i=ls(e,t,r),a=setTimeout(i,n);return()=>{clearTimeout(a)}}function us(e,t,r,n){const i=ls(e,t,r),a=()=>{i(),e.removeEventListener(n,a)};return e.addEventListener(n,a,{once:!0}),()=>{e.removeEventListener(n,a)}}function ds(e,t,r){if(t.startsWith("@")){const n=t.substring(1);return void(!1===r?e.removeAttribute(n):e.setAttribute(n,!0===r?"":r+""))}const n=r+"";switch(t){case"textContent":return void(e.textContent=n);case"innerHTML":return void(e.innerHTML=n);case"innerText":return void(e.innerText=n);case"id":return void(e.id=n);case"className":return void(e.className=n);case"value":return void("value"in e&&(e.value=n));case"checked":return void("checked"in e&&(e.checked=!!r))}if(t.includes(".")){const n=t.split(".");let i=e;for(let e=0;n.length-1>e;e++)if(i=i[n[e]],null==i)return;return void(i[n[n.length-1]]=r)}if(t.includes("-")||t in e.style)e.style.setProperty(t,n);else try{e[t]=r}catch(e){if(!(e instanceof TypeError&&(e.message.includes("only a getter")||e.message.includes("read only"))))throw Error(`Cannot set property '${t}': ${e instanceof Error?e.message:"Unknown error"}`)}}function ms(e){return null==e||""===e}const ps=/^the\s+(.+?)\s+of\s+(.+)$/i,hs=new Set(["disabled","checked","hidden","readOnly","readonly","required","multiple","selected","autofocus","autoplay","controls","loop","muted","open","reversed","async","defer","noValidate","novalidate","formNoValidate","formnovalidate","draggable","spellcheck","contentEditable"]);function fs(e){return"string"==typeof e&&ps.test(e)}function ys(e,t){const r=e.match(ps);if(!r)return null;try{return{element:qa(r[2].trim(),t),property:r[1].trim()}}catch{return null}}async function gs(e,t,r){if(function(e){return!(!e||"object"!=typeof e)&&"propertyOfExpression"===e.type&&"object"==typeof e.property&&null!==e.property}(e))return async function(e,t,r){const n=e.property?.name;if(!n)return null;let i=await t.evaluate(e.target,r);return Array.isArray(i)&&(i=i[0]),hr(i)?{element:i,property:n}:null}(e,t,r);if(function(e){return!(!e||"object"!=typeof e)&&"propertyAccess"===e.type&&("string"==typeof e.property||"object"==typeof e.property&&null!==e.property&&"string"==typeof e.property.name)}(e))return async function(e,t,r){const n="string"==typeof e.property?e.property:e.property?.name;if(!n)return null;let i=await t.evaluate(e.object,r);return Array.isArray(i)&&(i=i[0]),hr(i)?{element:i,property:n}:null}(e,t,r);const n=e;if("possessiveExpression"===n?.type||"memberExpression"===n?.type){const e=n.object,i=n.property;let a=await t.evaluate(e,r);if(Array.isArray(a)&&(a=a[0]),!hr(a))return null;const s=i?.name||i?.value;return s?{element:a,property:s}:null}return null}function vs(e){const{element:t,property:r}=e;return r.startsWith("*")?function(e,t){return window.getComputedStyle(e).getPropertyValue(t)}(t,r.substring(1)):Rr(t,r)}function bs(e,t){const{element:r,property:n}=e;n.startsWith("*")?Ha(r,n.substring(1),t+""):ds(r,n,t)}async function ws(e,t,r){let n,i;if(e?.for){const i=await t.evaluate(e.for,r);n="number"==typeof i?i:"string"==typeof i?ts(i):void 0}if(e?.until){const n=await t.evaluate(e.until,r);"string"==typeof n&&(i=n)}return{duration:n,untilEvent:i}}function ks(e,t){const r=t?.name,n=function(e){if(!e||"object"!=typeof e)return!1;if("identifier"!==e.type)return!1;const t=e.name;return"string"==typeof t&&function(e){if("string"!=typeof e)return!1;const t=e.toLowerCase();return Ba.includes(t)}(t)}(t);if(hr(e)||Array.isArray(e)&&e.every(e=>hr(e)))return{type:"element",expression:""};if(n&&r)return{type:"element",expression:r};if("string"==typeof e){const t=e.trim();return t.startsWith("@")||t.startsWith("[@")?{type:"attribute",expression:t}:t.startsWith("*")?{type:"css-property",expression:t}:t.startsWith(".")?{type:"class",expression:t}:t.startsWith("#")||function(e){if("string"!=typeof e)return!1;const t=e.toLowerCase();return Ba.some(e=>t.includes(e))}(t)?{type:"element",expression:t}:{type:"class",expression:t}}return{type:"class",expression:""}}const Es=Pa((()=>{let e,t,r=[Oa({name:"toggle"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args?.length)throw Error("toggle command requires an argument");let n=!1;if(function(e){if(!e||"asExpression"!==e.type)return!1;const t=e.targetType,r="string"==typeof t?t:t?.name;return"string"==typeof r&&"modal"===r.toLowerCase()}(e.args[0])){n=!0;const t=e.args[0].expression;e={...e,args:[t,...e.args.slice(1)]}}const i=e.args[0],a=i?.name;if("between"===a&&e.args.length>=4){const{duration:n,untilEvent:i}=await ws(e.modifiers,t,r),a=async e=>{const n=e;return"selector"===n?.type?n.value:t.evaluate(e,r)},s=await a(e.args[1]),o=await a(e.args[3]),l=[];for(let t=4;e.args.length>t;t++){const r=e.args[t]?.name;"on"!==r&&"from"!==r&&l.push(e.args[t])}const c={filterPrepositions:!0,fallbackModifierKey:"on"},u=await _a(l,t,r,"toggle",c,e.modifiers);return{type:"classes-between",classA:(s+"").replace(/^\./,""),classB:(o+"").replace(/^\./,""),targets:u,duration:n,untilEvent:i}}const s=await gs(i,t,r);if(s)return{type:"property",target:s};if("selector"===i.type&&"string"==typeof i.value&&i.value.startsWith("*")){let n=i.value,a=1;if("*"===n&&e.args.length>1&&"identifier"===e.args[1].type&&(n="*"+e.args[1].name,a=2),"*"===n&&e.modifiers?.on){const i=e.modifiers.on?.name;if(i&&["display","visibility","opacity"].includes(i)){n="*"+i;const{duration:a,untilEvent:s}=await ws(e.modifiers,t,r),o=Va(n);if(o){const e=r.me;return{type:"css-property",property:o,targets:e?[e]:[],duration:a,untilEvent:s}}}}const s=Va(n);if(s){const{duration:n,untilEvent:i}=await ws(e.modifiers,t,r),o={filterPrepositions:!0,fallbackModifierKey:"on"};return{type:"css-property",property:s,targets:await _a(e.args.slice(a),t,r,"toggle",o,e.modifiers),duration:n,untilEvent:i}}}const{duration:o,untilEvent:l}=await ws(e.modifiers,t,r),{value:c}=await Da(i,t,r);if(fs(c)){const e=ys(c,r);if(e)return{type:"property",target:e}}const{type:u,expression:d}=ks(c,i),m={filterPrepositions:!0,fallbackModifierKey:"on"};switch(u){case"attribute":{const{name:n,value:i}=ka(d);return{type:"attribute",name:n,value:i,targets:await _a(e.args.slice(1),t,r,"toggle",m,e.modifiers),duration:o,untilEvent:l}}case"css-property":{const n=Va(d);if(!n)throw Error("Invalid CSS property: "+d);return{type:"css-property",property:n,targets:await _a(e.args.slice(1),t,r,"toggle",m,e.modifiers)}}case"element":{let a;if(hr(c))a=[c];else if(Array.isArray(c)&&c.every(e=>hr(e)))a=c;else if(d){const e=document.querySelectorAll(d);a=Array.from(e).filter(e=>hr(e))}else a=await _a([i],t,r,"toggle",m,e.modifiers);const s=function(e){if(0===e.length)return null;const t=e[0].tagName;if(!e.every(e=>e.tagName===t))return null;switch(t){case"DIALOG":return"dialog";case"DETAILS":return"details";case"SELECT":return"select";case"SUMMARY":return e.map(e=>e.closest("details")).filter(e=>null!==e).length>0?"details":null;default:return null}}(a);if("dialog"===s){const i=n?"modal":await async function(e,t,r,n){if(t?.as){const e=await r.evaluate(t.as,n);if("string"==typeof e&&"modal"===e.toLowerCase())return"modal"}if(e.length>=2){const t=await r.evaluate(e[1],n);if("string"==typeof t){const i=t.toLowerCase();if("modal"===i||"as modal"===i)return"modal";if("as"===i&&e.length>=3){const t=await r.evaluate(e[2],n);if("string"==typeof t&&"modal"===t.toLowerCase())return"modal"}}}return"non-modal"}(e.args,e.modifiers,t,r);return{type:"dialog",mode:i,targets:a}}return"details"===s?{type:"details",targets:as(a)}:"select"===s?{type:"select",targets:a}:{type:"classes",classes:Aa(d),targets:a,duration:o,untilEvent:l}}default:{const n=Aa(d||c);if(!n.length)throw Error("toggle command: no valid class names found");return{type:"classes",classes:n,targets:await _a(e.args.slice(1),t,r,"toggle",m,e.modifiers),duration:o,untilEvent:l}}}}async execute(e,t){switch(e.type){case"classes":{const r=La(e.classes,t);if(0===r.length)return[...e.targets];if(xa(e.targets,r,(e,t)=>{e.classList.toggle(t)}),(e.duration||e.untilEvent)&&r.length)for(const t of e.targets)e.duration&&cs(t,"class",r[0],e.duration),e.untilEvent&&us(t,"class",r[0],e.untilEvent);return[...e.targets]}case"attribute":if(r=e.name,n=e.value,Ea(e.targets,e=>{Ca(e,r,n)}),e.duration||e.untilEvent)for(const t of e.targets)e.duration&&cs(t,"attribute",e.name,e.duration),e.untilEvent&&us(t,"attribute",e.name,e.untilEvent);return[...e.targets];case"css-property":return Ea(e.targets,t=>function(e,t){const r=window.getComputedStyle(e);switch(t){case"display":"none"===r.display?(e.style.display=e.dataset.previousDisplay||"block",delete e.dataset.previousDisplay):(e.dataset.previousDisplay=r.display,e.style.display="none");break;case"visibility":e.style.visibility="hidden"===r.visibility?"visible":"hidden";break;case"opacity":e.style.opacity=0===parseFloat(r.opacity)?"1":"0"}}(t,e.property));case"property":return function(e){const t=vs(e),r=e.property,n=r.startsWith("@")?r.substring(1):r;if("boolean"==typeof t||hs.has(n)||hs.has(n.toLowerCase())){const r=!t;return bs(e,r),r}if("number"==typeof t){const r=0===t?1:0;return bs(e,r),r}if("string"==typeof t){const n="__ht_"+r,i=e.element[n];return""===t&&void 0!==i?(bs(e,i),i):(e.element[n]=t,bs(e,""),"")}bs(e,!t)}(e.target),[e.target.element];case"dialog":return Ea(e.targets,t=>{return n=e.mode,void((r=t).open?r.close():"modal"===n?r.showModal():r.show());var r,n});case"details":return Ea(e.targets,e=>{var t;(t=e).open=!t.open});case"select":return Ea(e.targets,e=>function(e){if(document.activeElement===e)e.blur();else{if(e.focus(),"showPicker"in e&&"function"==typeof e.showPicker)try{return void e.showPicker()}catch{}const t=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});e.dispatchEvent(t)}}(e));case"classes-between":for(const t of e.targets){const r=t.classList.contains(e.classA),n=t.classList.contains(e.classB);r?(t.classList.remove(e.classA),t.classList.add(e.classB)):n?(t.classList.remove(e.classB),t.classList.add(e.classA)):t.classList.add(e.classA)}if(e.duration||e.untilEvent)for(const t of e.targets)e.duration&&cs(t,"class",e.classA,e.duration),e.untilEvent&&us(t,"class",e.classA,e.untilEvent);return[...e.targets]}var r,n}};return ba(t,"ToggleCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Toggle classes, attributes, or interactive elements",syntax:["toggle <class> [on <target>]","toggle @attr","toggle <element> [as modal]","toggle <expr> for <duration>"],examples:["toggle .active on me","toggle @disabled","toggle #myDialog as modal","toggle .loading for 2s"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),va(t,n),i=t})());const xs=Pa((()=>{let e,t,r=[Oa({name:"put"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args?.length)throw Error("put requires arguments");const n=e=>e?.type||"unknown",i=["into","before","after","at","at start of","at end of"];let a=-1,s=null;for(let t=0;e.args.length>t;t++){const r=e.args[t],o=n(r),l="literal"===o?r.value:r.name;if(("literal"===o||"identifier"===o)&&i.includes(l)){a=t,s=l;break}}let o=null,l=null;if(-1===a){const t=i.find(t=>e.modifiers[t]);if(t)o=e.args[0],s=t,l=e.modifiers[t];else if(3>e.args.length){if(2>e.args.length)throw Error("put requires content and position");o=e.args[0],s=e.args[1]?.value||e.args[1]?.name||"into"}else o=e.args[0],s=e.args[1]?.value||e.args[1]?.name||null,l=e.args[2]}else o=e.args.slice(0,a)[0]||null,l=e.args.slice(a+1)[0]||null;if(!o)throw Error("put requires content");if(!s)throw Error("put requires position keyword");const c=await t.evaluate(o,r),u=this.mapPosition(s);let d,m,p=null;if(l){const e=n(l),i=await gs(l,t,r);if(i)return{value:c,targets:[i.element],position:"into",memberPath:i.property};if("memberExpression"===e){const e=l.object,n=l.property;if("selector"===e?.type)p=e.value;else if("identifier"===e?.type){const i=e.name;if("my"===i||"me"===i||"I"===i){if(r.me&&n?.name)return{value:c,targets:[r.me],position:"into",memberPath:n.name}}else if("its"===i||"it"===i){const e=await t.evaluate(l,r);"string"==typeof e&&(p=e)}else p=i}if(p&&n?.name)d=n.name;else if(!p&&!d){const e=await t.evaluate(l,r);"string"==typeof e&&(p=e)}}else if("identifier"===e&&"me"===l.name)p=null;else if("selector"===e||"cssSelector"===e)p=l.value||l.selector;else if("literal"===e){const e=l.value;if("string"==typeof e&&fs(e)){const t=ys(e,r);if(t)return{value:c,targets:[t.element],position:"into",memberPath:t.property}}"string"==typeof e&&this.looksLikeCss(e)?p=e:m=e+""}else if("identifier"===e){const e=l.name;if(this.looksLikeCss(e))p=e;else{const n=Er(await t.evaluate(l,r));if(n)return{value:c,targets:n,position:u,memberPath:d};m=e}}else{const e=await t.evaluate(l,r),n=Er(e);if(n)return{value:c,targets:n,position:u,memberPath:d};"string"==typeof e&&(this.looksLikeCss(e)?p=e:m=e)}}return m?{value:c,targets:[],position:u,memberPath:d,variableName:m}:{value:c,targets:await this.resolveTargets(p,r),position:u,memberPath:d}}async execute(e,t){const{value:r,targets:n,position:i,memberPath:a,variableName:s}=e;if(s)return t.locals&&t.locals.set(s,r),t[s]=r,void Object.assign(t,{it:r});if(a)for(const e of n)this.setProperty(e,a,r);else for(const e of n)Ga(e,this.parseValue(r),i);return n}mapPosition(e){switch(e){case"into":return"into";case"before":return"before";case"after":return"after";case"at start of":return"prepend";case"at end of":return"append";default:throw Error("Invalid position: "+e)}}async resolveTargets(e,t){if(!e||"me"===e){if(!t.me||!hr(t.me))throw Error("put: no target and context.me is null");return[t.me]}return kr(e)}parseValue(e){return hr(e)?e:null==e?"":e+""}looksLikeCss(e){return!!e&&(!!/^[#.\[]/.test(e)||(!(!/[>+~\s]/.test(e)||1>=e.length)||["div","span","p","a","button","input","form","ul","li","ol","table","tr","td","th","img","h1","h2","h3","h4","h5","h6","section","article","header","footer","nav","main","aside","dialog","label","select","option","textarea"].includes(e.toLowerCase())))}setProperty(e,t,r){const n=t.split(".");let i=e;for(let e=0;n.length-1>e;e++){if(!i[n[e]])throw Error(`Property path "${t}" does not exist`);i=i[n[e]]}i[n[n.length-1]]=r}};return ba(t,"PutCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Insert content into elements or properties",syntax:["put <value> into <target>","put <value> before <target>","put <value> after <target>"],examples:['put "Hello World" into me',"put <div>Content</div> before #target","put value into #elem's innerHTML"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),va(t,n),i=t})());class Cs{async parseInput(e,t,r){const{targets:n}=await async function(e,t,r,n){return{targets:await _a(e.args,t,r,n)}}(e,t,r,this.mode);return{targets:n,mode:this.mode,defaultDisplay:"show"===this.mode?"block":void 0}}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!(!Array.isArray(t.targets)||!t.targets.every(e=>hr(e))||"show"!==t.mode&&"hide"!==t.mode||"show"===t.mode&&"string"!=typeof t.defaultDisplay)}showElement(e,t="block"){const r=e.dataset.originalDisplay;void 0!==r?(e.style.display=r||t,delete e.dataset.originalDisplay):"none"===e.style.display&&(e.style.display=t),e.classList.add("show")}hideElement(e){if(!e.dataset.originalDisplay){const t=e.style.display;e.dataset.originalDisplay="none"===t?"":t}e.style.display="none",e.classList.remove("show")}}let As=(()=>{let e,t,r=[Oa({name:"hide"})],n=[],i=Cs;var a=t=class extends i{constructor(){super(...arguments),this.mode="hide"}get metadata(){return a.metadata}async execute(e,t){for(const t of e.targets)this.hideElement(t)}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!!Array.isArray(t.targets)&&!!t.targets.every(e=>hr(e))}};return ba(t,"HideCommand"),(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),a=t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),t.metadata=ja({description:"Hide elements by setting display to none",syntax:"hide [<target>]",examples:["hide me","hide #modal","hide .warnings","hide <button/>"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),va(t,n),a=t})();const Ss=Pa(As);let Ts=(()=>{let e,t,r=[Oa({name:"show"})],n=[],i=Cs;var a=t=class extends i{constructor(){super(...arguments),this.mode="show"}get metadata(){return a.metadata}async execute(e,t){const r=e.defaultDisplay||"block";for(const t of e.targets)this.showElement(t,r)}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!!Array.isArray(t.targets)&&!!t.targets.every(e=>hr(e))&&"string"==typeof t.defaultDisplay}};return ba(t,"ShowCommand"),(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),a=t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),t.metadata=ja({description:"Show elements by restoring display property",syntax:"show [<target>]",examples:["show me","show #modal","show .hidden","show <button/>"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),va(t,n),a=t})();const Ls=Pa(Ts),Os={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function js(e){return e.replace(/[&<>"']/g,e=>Os[e])}let Ps=(()=>{let e,t,r=[Oa({name:"make"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n=e.modifiers.an??e.modifiers.a??e.args[0];if(!n)throw Error("Make command requires class name or DOM element expression");const i=n.raw;let a="string"==typeof i&&i.startsWith("<")?i:await t.evaluate(n,r);if(null==a)throw Error("Make command requires class name or DOM element expression");"string"==typeof a&&a.startsWith("<")&&(a=await async function(e,t){if(!e.includes("{"))return e;const r=/\{([^{}]+)\}/g,n=[];let i;for(;null!==(i=r.exec(e));){let e=i[0];try{const r=await ln(i[1].trim(),t);null!=r&&(e=js(r+""))}catch{}n.push({index:i.index,length:i[0].length,text:e})}let a=e;for(let e=n.length-1;e>=0;e--){const{index:t,length:r,text:i}=n[e];a=a.slice(0,t)+i+a.slice(t+r)}return a}(a,r));const s=void 0!==e.modifiers.an?"an":"a",o=await async function(e,t,r){if(!e)return[];if("arrayLiteral"===e.type&&Array.isArray(e.args)){const n=[];for(const i of e.args)n.push(await t.evaluate(i,r));return n}const n=await t.evaluate(e,r);return Array.isArray(n)?n:[n]}(e.modifiers.from,t,r),l=await async function(e,t,r){if(!e)return;if(("symbol"===e.type||"identifier"===e.type)&&"string"==typeof e.name)return e.name;const n=await t.evaluate(e,r);return"string"==typeof n?n:void 0}(e.modifiers.called,t,r);return{article:s,expression:a,constructorArgs:o,variableName:l}}async execute(e,t){const{expression:r,constructorArgs:n=[],variableName:i}=e,a="string"==typeof r&&r.startsWith("<"),s=a&&r.endsWith("/>")?function(e){const t=e.slice(1,-2);let r="div",n=t;const i=t.match(/^([a-zA-Z][a-zA-Z0-9]*)/);i&&(r=i[1],n=t.slice(i[0].length));const a=document.createElement(r),s=n.split(/(?=[.#])/);for(const e of s)if(e.startsWith("#")){const t=e.slice(1);t&&(a.id=t)}else if(e.startsWith(".")){const t=e.slice(1);t&&a.classList.add(t)}return a}(r):a&&/<\/[a-zA-Z]/.test(r)?function(e){const t=document.createElement("template");t.innerHTML=e.trim();const r=t.content.firstElementChild;if(r&&hr(r))return r;const n=document.createElement("div");n.innerHTML=e.trim();const i=n.firstElementChild;return i&&hr(i)?i:n}(r):function(e,t,r){if(hr(e))return e;const n=e+"";let i;if("undefined"!=typeof window&&(i=window[n]),i||"undefined"==typeof global||(i=global[n]),!i&&r.variables?.has(n)&&(i=r.variables.get(n)),!i||"function"!=typeof i)throw Error(`Constructor '${n}' not found or is not a function`);return 0===t.length?new i:new i(...t)}(r,n,t);return Object.assign(t,{it:s}),i&&vr(i,s,t),s}};return ba(t,"MakeCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Create DOM elements or class instances",syntax:["make a <tag#id.class1.class2/>","make a <ClassName> from <args> called <identifier>"],examples:["make an <a.navlink/> called linkElement",'make a URL from "/path/", "https://origin.example.com"'],sideEffects:["dom-creation","data-mutation"],category:"dom",compatibility:"standard"}),va(t,n),i=t})();const Is=Pa(Ps),qs=Pa((()=>{let e,t,r=[Oa({name:"empty"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{targets:await _a(e.args,t,r,"empty",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers)}}async execute(e,t){for(const t of e.targets)t.innerHTML=""}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!!Array.isArray(t.targets)&&t.targets.every(e=>hr(e))}};return ba(t,"EmptyCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Remove all children from an element (sets innerHTML to empty)",syntax:["empty","empty <target>","empty the <target>"],examples:["empty me","empty #list","empty .results"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),va(t,n),i=t})());function Ns(e){if("string"!=typeof e)return;const t=e.toLowerCase().trim();return"non-modal"===t||"nonmodal"===t?"non-modal":"modal"===t?"modal":void 0}function Rs(e){return e.hasAttribute("popover")}const Ms=Pa((()=>{let e,t,r=[Oa({name:"open"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n=(e.args??[]).filter(e=>{const t=e;if("identifier"!==t?.type)return!0;const r=t.name?.toLowerCase();return"as"!==r&&"modal"!==r&&"non-modal"!==r&&"nonmodal"!==r}),i=as(await _a(n,t,r,"open",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers)),a=await async function(e,t,r,n){if(t?.as){const e=Ns(await r.evaluate(t.as,n));if(e)return e}for(const t of e){const e=t;if("asExpression"!==e?.type)continue;const r=e.targetType,n=Ns(r?.name??r?.value);if(n)return n}for(let t=0;e.length-1>t;t++){const i=e[t];if("identifier"===i?.type&&"as"===i.name?.toLowerCase()){const i=await r.evaluate(e[t+1],n);if("string"==typeof i){const e=i.toLowerCase().trim();if("non-modal"===e||"nonmodal"===e)return"non-modal";if("modal"===e)return"modal"}}}return"modal"}(e.args??[],e.modifiers??{},t,r);return{targets:i,dialogMode:a}}async execute(e,t){for(const t of e.targets)if(ss(t))t.open||("modal"===e.dialogMode?t.showModal():t.show());else if(os(t))t.open=!0;else if(Rs(t)){const e=t;if("function"==typeof e.showPopover)try{e.showPopover()}catch{}}}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!(!Array.isArray(t.targets)||!t.targets.every(e=>hr(e))||"modal"!==t.dialogMode&&"non-modal"!==t.dialogMode)}};return ba(t,"OpenCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Open a dialog, details element, or popover",syntax:["open [<target>]","open <dialog> as modal","open <dialog> as non-modal"],examples:["open","open #myDialog","open #details","open #popup as non-modal"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),va(t,n),i=t})());function $s(e){return e.hasAttribute("popover")}const _s=Pa((()=>{let e,t,r=[Oa({name:"close"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{targets:as(await _a(e.args,t,r,"close",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers))}}async execute(e,t){for(const t of e.targets)if(ss(t))t.open&&t.close();else if(os(t))t.open=!1;else if($s(t)){const e=t;if("function"==typeof e.hidePopover)try{e.hidePopover()}catch{}}}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!!Array.isArray(t.targets)&&t.targets.every(e=>hr(e))}};return ba(t,"CloseCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Close a dialog, details element, or popover",syntax:["close","close <target>"],examples:["close","close #myDialog","close #details","close #popup"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),va(t,n),i=t})());function zs(e){const t=e.tagName;return"INPUT"===t||"TEXTAREA"===t}const Vs=Pa((()=>{let e,t,r=[Oa({name:"select"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{targets:await _a(e.args,t,r,"select",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers)}}async execute(e,t){if(0!==e.targets.length)for(const t of e.targets){if(zs(t)){t.select();continue}const e=t.ownerDocument??("undefined"!=typeof document?document:null),r=e?.defaultView;if(!e||!r)continue;const n=r.getSelection?.();if(n)try{const r=e.createRange();r.selectNodeContents(t),n.removeAllRanges(),n.addRange(r)}catch{}}}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!!Array.isArray(t.targets)&&t.targets.every(e=>hr(e))}};return ba(t,"SelectCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Select the contents of a text field, or select the contents of a DOM element",syntax:["select","select <target>"],examples:["select #search","select <textarea/>","select me"],sideEffects:["focus","dom-mutation"],category:"dom",compatibility:"standard"}),va(t,n),i=t})());function Hs(e){return"FORM"===e.tagName}const Bs=Pa((()=>{let e,t,r=[Oa({name:"reset"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{targets:await _a(e.args,t,r,"reset",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers)}}async execute(e,t){for(const t of e.targets)Hs(t)&&t.reset()}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!!Array.isArray(t.targets)&&t.targets.every(e=>hr(e))}};return ba(t,"ResetCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Reset a <form> element to its default values (HTMLFormElement.reset())",syntax:["reset","reset <target>"],examples:["reset","reset #myForm","reset <form/>"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),va(t,n),i=t})());function Ws(e,t){if("boolean"==typeof e)return e;if("function"==typeof e)return!0;if(e instanceof Promise)throw Error("Condition must be awaited - use await in the condition expression");if("string"==typeof e){if("me"===e)return!!t.me;if("it"===e)return!!t.it;if("you"===e)return!!t.you;const r=gr(e,t);return void 0!==r?!!r:!!e}return!!e}const Ds=Pa((()=>{let e,t,r=[Oa({name:"if"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n="unless"===e.commandName?.toLowerCase()?"unless":"if";if(!e.args||0===e.args.length)throw Error(n+" command requires a condition to evaluate");let i,a;if("unless"===n){if(2>e.args.length)throw Error("unless command requires a condition and at least one command");i=e.args[1]}else if(e.args.length>=2&&e.args[1]?(i=e.args[1],a=3>e.args.length?void 0:e.args[2]):e.modifiers?.then&&(i=e.modifiers.then,a=e.modifiers.else),!i)throw Error('if command requires "then" branch with commands');return{mode:n,condition:await t.evaluate(e.args[0],r),thenCommands:i,elseCommands:a}}async execute(e,t){const{mode:r,condition:n,thenCommands:i,elseCommands:a}=e,s=Ws(n,t);let o,l;return("unless"===r?!s:s)?(o="then",l=await this.executeCommandsOrBlock(i,t)):a&&"if"===r?(o="else",l=await this.executeCommandsOrBlock(a,t)):o="none",{mode:r,conditionResult:s,executedBranch:o,result:l}}async executeCommandsOrBlock(e,t){return"block"===e?.type?this.executeBlock(e,t):this.executeCommands(Array.isArray(e)?e:[e],t)}async executeBlock(e,t){const r=t.locals.get("_runtimeExecute");if(!r)throw Error("Runtime execute function not available");let n;if(e.commands?.length)for(const i of e.commands)n=await r(i,t);return n}async executeCommands(e,t){let r;for(const n of e)if(n?.execute)r=await n.execute(t);else if("function"==typeof n)r=await n();else if(n&&"object"==typeof n&&"string"==typeof n.type){const e=t.locals.get("_runtimeExecute");if(!e)throw Error("Runtime execute function not available");r=await e(n,t)}else r=n;return r}};return ba(t,"ConditionalCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Conditional execution based on boolean expressions",syntax:["if <condition> then <commands>","if <condition> then <commands> else <commands>","unless <condition> <commands>"],examples:["if x > 5 then add .active","if user.isAdmin then show #adminPanel else hide #adminPanel","unless user.isLoggedIn showLoginForm"],sideEffects:["conditional-execution"],aliases:["unless"],category:"control-flow",compatibility:"standard"}),va(t,n),i=t})()),Fs=Ds,Us=Ds;let Ks=(()=>{let e,t,r=[Oa({name:"repeat"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){let n;if(e.modifiers?.index){const i=await t.evaluate(e.modifiers.index,r);"string"==typeof i&&(n=i)}let i,a=e.modifiers?.block||e.modifiers?.commands;if(!a){const t=[];for(let r=e.args.length-1;r>=0;r--){const n=e.args[r];if("block"===n?.type&&n.commands&&(t.unshift(n),2===t.length))break}2===t.length?(a=t[0],i=t[1]):1===t.length&&(a=t[0])}const s=e.args[0],o="identifier"===s?.type?s.name:null,l=!!e.modifiers?.bottomTested&&await t.evaluate(e.modifiers.bottomTested,r);if("for"===o||e.modifiers?.for){const s=e.args[1],o=s?.value||s?.name,l=e.args[2]?await t.evaluate(e.args[2],r):void 0;if(!o||void 0===l)throw Error("for loops require variable and collection");return{type:"for",variable:o,collection:Array.isArray(l)?l:[l],indexVariable:n,commands:a,elseCommands:i}}if("times"===o||e.modifiers?.times){const s=e.args[1],o=s?await t.evaluate(s,r):void 0,l="number"==typeof o?o:parseInt(o+"",10);if(isNaN(l))throw Error("times loops require a count number");return{type:"times",count:l,indexVariable:n,commands:a,elseCommands:i}}if("while"===o||e.modifiers?.while){const t=e.args[1]||e.modifiers?.while;if(!t)throw Error("while loops require a condition");return{type:"while",condition:t,indexVariable:n,commands:a,elseCommands:i,bottomTested:l}}if("until"===o&&e.modifiers?.from||"until-event"===o){const s=e.args[1],o=s?.value||s?.name;if(!o)throw Error("until-event loops require an event name");let l=r.me;if(e.args[2]){const n=e.args[2];if("identifier"===n?.type&&"document"===n.name)l=document;else if("identifier"===n?.type&&"window"===n.name&&"undefined"!=typeof window)l=window;else{const n=await t.evaluate(e.args[2],r);n instanceof EventTarget?l=n:"document"===n?l=document:"undefined"!=typeof window&&n===window&&(l=window)}}return{type:"until-event",eventName:o,eventTarget:l,indexVariable:n,commands:a,elseCommands:i}}if("until"===o||e.modifiers?.until){const t=e.args[1]||e.modifiers?.until;if(!t)throw Error("until loops require a condition");return{type:"until",condition:t,indexVariable:n,commands:a,elseCommands:i,bottomTested:l}}if("forever"===o||e.modifiers?.forever)return{type:"forever",indexVariable:n,commands:a,elseCommands:i};throw Error("repeat command requires a loop type (for/times/while/until/forever)")}async execute(e,t){const{type:r,variable:n,collection:i,condition:a,count:s,indexVariable:o,commands:l,elseCommands:c,bottomTested:u,eventName:d,eventTarget:m}=e;let p,h;switch(r){case"for":({config:p,iterCtx:h}=function(e,t,r){return{config:{type:"for",shouldContinue:e=>(e.collection?.length??0)>e.index,beforeIteration:(e,t)=>{e.item=e.collection?.[e.index],e.itemVariable&&t.locals&&t.locals.set(e.itemVariable,e.item)}},iterCtx:{index:0,collection:e,itemVariable:t,indexVariable:r}}}(i,n,o));break;case"times":({config:p,iterCtx:h}=function(e,t){return{config:{type:"times",shouldContinue:e=>(e.count??0)>e.index,beforeIteration:(e,t)=>{Object.assign(t,{it:e.index+1})}},iterCtx:{index:0,count:e,indexVariable:t}}}(s,o));break;case"while":({config:p,iterCtx:h}=function(e,t,r,n){return{config:{type:"while",shouldContinue:()=>t(e,r)},iterCtx:{index:0,conditionExpr:e,indexVariable:n}}}(a,Ws,t,o));break;case"until":({config:p,iterCtx:h}=function(e,t,r,n){return{config:{type:"until",shouldContinue:()=>!t(e,r)},iterCtx:{index:0,conditionExpr:e,indexVariable:n}}}(a,Ws,t,o));break;case"until-event":({config:p,iterCtx:h}=function(e,t,r){const n={index:0,eventFired:!1,indexVariable:r};return{config:{type:"until-event",shouldContinue:e=>!e.eventFired,eventSetup:{eventName:e,target:t,onEvent:()=>{n.eventFired=!0}}},iterCtx:n}}(d,m,o));break;case"forever":({config:p,iterCtx:h}=function(e,t=1e4){return{config:{type:"forever",maxIterations:t,shouldContinue:()=>!0},iterCtx:{index:0,indexVariable:e}}}(o));break;default:throw Error("Unknown repeat type: "+r)}if(u){const e=p.shouldContinue;p.shouldContinue=async t=>0===t.index||await e(t)}try{const e=await async function(e,t,r,n,i){const a=e.maxIterations??1e4;let s,o=0,l=!1;e.eventSetup&&e.eventSetup.target.addEventListener(e.eventSetup.eventName,e.eventSetup.onEvent,{once:!0});try{for(;a>o&&await e.shouldContinue(n);){e.beforeIteration&&await e.beforeIteration(n,r),n.indexVariable&&r.locals&&r.locals.set(n.indexVariable,o);try{s=await i(t,r)}catch(t){if(t instanceof Error){if(t.message.includes("BREAK")){l=!0;break}if(t.message.includes("CONTINUE")){o++,n.index=o,"until-event"===e.type&&await new Promise(e=>setTimeout(e,0));continue}}throw t}o++,n.index=o,"until-event"===e.type&&await new Promise(e=>setTimeout(e,0))}}finally{e.eventSetup&&!n.eventFired&&e.eventSetup.target.removeEventListener(e.eventSetup.eventName,e.eventSetup.onEvent)}return{iterations:o,lastResult:s,interrupted:l}}(p,l,t,h,this.executeCommands.bind(this));if(0===e.iterations&&!e.interrupted&&c){const e=await this.executeCommands(c,t);return Object.assign(t,{it:e}),{type:r,iterations:0,completed:!0,lastResult:e}}return Object.assign(t,{it:e.lastResult}),{type:r,iterations:e.iterations,completed:!e.interrupted,lastResult:e.lastResult,interrupted:e.interrupted}}catch(e){if(e instanceof Error&&(e.message.includes("BREAK")||e.message.includes("CONTINUE")))return{type:r,iterations:0,completed:!0,interrupted:e.message.includes("BREAK")};throw e}}async executeCommands(e,t){if(e&&"object"==typeof e&&"block"===e.type){const r=e,n=t.locals.get("_runtimeExecute");if(!n)throw Error("Runtime execute function not available");let i;if(r.commands)for(const e of r.commands)i=await n(e,t);return i}if(Array.isArray(e)){let r;for(const n of e)r="function"==typeof n?await n(t):n&&"function"==typeof n.execute?await n.execute(t):n;return r}return"function"==typeof e?await e(t):e}};return ba(t,"RepeatCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Iteration in hyperscript - for-in, counted, conditional, event-driven, and infinite loops",syntax:["repeat for <var> in <collection> { <commands> }","repeat <count> times { <commands> }","repeat while <condition> { <commands> }","repeat until <condition> { <commands> }","repeat forever { <commands> }"],examples:["repeat for item in items { log item }",'repeat 5 times { log "hello" }'],sideEffects:["iteration","conditional-execution"],category:"control-flow",compatibility:"standard"}),va(t,n),i=t})();const Zs=Pa(Ks);class Xs{async parseInput(e,t,r){return{signalType:this.signalType}}async execute(e,t){const r=Error(this.errorMessage);throw r[this.errorFlag]=!0,"exit"===this.signalType&&(r.returnValue=void 0,r.timestamp=Date.now()),r}}let Gs=(()=>{let e,t,r=[Oa({name:"break"})],n=[],i=Xs;var a=t=class extends i{constructor(){super(...arguments),this.signalType="break",this.errorMessage="BREAK_LOOP",this.errorFlag="isBreak"}get metadata(){return a.metadata}};return ba(t,"BreakCommand"),(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),a=t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),t.metadata=ja({description:"Exit from the current loop (repeat, for, while, until)",syntax:["break"],examples:["break","if found then break","repeat for item in items { if item == target then break }"],sideEffects:["control-flow"],category:"control-flow",compatibility:"standard"}),va(t,n),a=t})();const Js=Pa(Gs);let Ys=(()=>{let e,t,r=[Oa({name:"continue"})],n=[],i=Xs;var a=t=class extends i{constructor(){super(...arguments),this.signalType="continue",this.errorMessage="CONTINUE_LOOP",this.errorFlag="isContinue"}get metadata(){return a.metadata}};return ba(t,"ContinueCommand"),(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),a=t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),t.metadata=ja({description:"Skip to the next iteration of the current loop",syntax:["continue"],examples:["continue","if item.isInvalid then continue","repeat for item in items { if item.skip then continue; process item }"],sideEffects:["control-flow"],category:"control-flow",compatibility:"standard"}),va(t,n),a=t})();const Qs=Pa(Ys),eo=Pa((()=>{let e,t,r=[Oa({name:"halt"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(e.args&&e.args.length>0){const n=e.args[0];return!n||"the"!==n.name&&"the"!==n.value?{target:await t.evaluate(e.args[0],r)}:{target:r.event}}return{}}async execute(e,t){let r=e.target;if(("the"===r&&t.event||"object"==typeof r&&null!==r&&"the"===r.target&&t.event)&&(r=t.event),this.isEvent(r)){const e=r;return e.preventDefault(),e.stopPropagation(),{halted:!0,timestamp:Date.now(),eventHalted:!0}}"halted"in t&&(t.halted=!0);const n=Error("HALT_EXECUTION");throw n.isHalt=!0,n}isEvent(e){return null!==e&&"object"==typeof e&&"preventDefault"in e&&"stopPropagation"in e}};return ba(t,"HaltCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Stop command execution or prevent event defaults",syntax:["halt","halt the event"],examples:["halt","halt the event","if error then halt",'on click halt the event then log "clicked"'],sideEffects:["control-flow","event-prevention"],category:"control-flow",compatibility:"standard"}),va(t,n),i=t})()),to=Pa((()=>{let e,t,r=[Oa({name:"return"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return e.args&&0!==e.args.length?{value:await t.evaluate(e.args[0],r)}:{value:void 0}}async execute(e,t){const{value:r}=e;"returnValue"in t&&(t.returnValue=r),Object.assign(t,{it:r});const n=Error("RETURN_VALUE");throw n.isReturn=!0,n.returnValue=r,n}};return ba(t,"ReturnCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Return a value from a command sequence or function, terminating execution",syntax:["return","return <value>"],examples:["return","return 42","return user.name","if found then return result"],sideEffects:["control-flow","context-mutation"],category:"control-flow",compatibility:"standard"}),va(t,n),i=t})());let ro=(()=>{let e,t,r=[Oa({name:"exit"})],n=[],i=Xs;var a=t=class extends i{constructor(){super(...arguments),this.signalType="exit",this.errorMessage="EXIT_COMMAND",this.errorFlag="isExit"}get metadata(){return a.metadata}};return ba(t,"ExitCommand"),(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),a=t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),t.metadata=ja({description:"Immediately terminate execution of the current event handler or behavior",syntax:["exit"],examples:["exit","if no draggedItem exit","on click if disabled exit"],sideEffects:["control-flow"],category:"control-flow",compatibility:"standard"}),va(t,n),a=t})();const no=Pa(ro),io=Pa((()=>{let e,t,r=[Oa({name:"throw"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(1>e.args.length)throw Error("throw command requires a message or error object");return{message:await t.evaluate(e.args[0],r)}}async execute(e,t){const{message:r}=e;let n;throw n=r instanceof Error?r:Error("string"==typeof r?r:r+""),n}};return ba(t,"ThrowCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Throw an error with a specified message",syntax:["throw <message>"],examples:['throw "Invalid input"','if not valid then throw "Validation failed"'],sideEffects:["error-throwing","execution-termination"],category:"control-flow",compatibility:"standard"}),va(t,n),i=t})());async function ao(e,t,r){const n=await t.evaluate(e,r),i=Array.isArray(n)?n[0]:n;return hr(i)?i:null}async function so(e,t,r,n){if(!e)return null;const i=e,a=i.type;if(n.nodeWriters&&a){const t=Ne(a);if(t)return{kind:"node-write",node:e,writer:t}}if(n.selectorSource&&"selector"===a&&"string"==typeof i.value)return{kind:"selector",selector:i.value};const s=await async function(e,t,r,n){const i=e;if("attributeAccess"===i?.type)return{elements:await n(),name:i.attributeName};if("binaryExpression"===i?.type&&"of"===i.operator&&"attributeAccess"===i.left?.type){const e=await ao(i.right,t,r);if(e)return{elements:[e],name:i.left.attributeName}}if("memberExpression"===i?.type&&"attributeAccess"===i.property?.type){const e=await ao(i.object,t,r);if(e)return{elements:[e],name:i.property.attributeName}}return null}(e,t,r,n.scopeElements);if(s)return{kind:"attribute",elements:s.elements,name:s.name};const o=await gs(e,t,r);if(o)return n.styleSplit&&o.property.startsWith("*")?{kind:"style",element:o.element,property:o.property.substring(1)}:{kind:"property",target:o};if(n.bareReference&&("identifier"===a||"variable"===a||"symbol"===a)&&"string"==typeof i.name){const e=i.scope;return{kind:"variable",name:i.name,scope:"element"===e||"global"===e?e:void 0}}return null}const oo=Pa((()=>{let e,t,r=[Oa({name:"set"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args?.length)throw Error("set command requires a target");const n=e.args[0],i=n?.name||n?.value,a=n?.scope,s=await so(n,t,r,{scopeElements:()=>this.resolveTargets(e.modifiers.on,t,r),nodeWriters:!0,styleSplit:!0});if(s)return function(e,t){switch(e.kind){case"node-write":return{type:"node-write",node:e.node,value:t,writer:e.writer};case"attribute":return{type:"attribute",elements:e.elements,name:e.name,value:t};case"style":return{type:"style",element:e.element,property:e.property,value:t+""};case"property":return{type:"property",element:e.target.element,property:e.target.property,value:t};default:throw Error(`set: unrequested write-target rung '${e.kind}'`)}}(s,await this.extractValue(e,t,r));if("memberExpression"===n?.type||"propertyAccess"===n?.type){const i=await this.tryParseMemberExpression(n,e,t,r);if(i)return i}let o;if(o="identifier"!==n?.type&&"variable"!==n?.type||"string"!=typeof i?await t.evaluate(n,r):i,function(e){if("object"!=typeof e||null===e||Array.isArray(e))return!1;if(hr(e)||e instanceof Node)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(o))return{type:"object-literal",properties:o,targets:await this.resolveTargets(e.modifiers.on,t,r)};if(fs(o)){const n=ys(o,r);if(n){const i=await this.extractValue(e,t,r);return{type:"property",element:n.element,property:n.property,value:i}}return this.parseTheXofY(o,e,t,r)}if("string"==typeof o&&za(o)){const n=o.substring(1).trim(),i=await this.extractValue(e,t,r);return{type:"style",element:await this.resolveElement(e.modifiers.on,t,r),property:n,value:i+""}}if("string"==typeof o&&wa(o)){const n=o.substring(1).trim(),i=await this.extractValue(e,t,r);return{type:"attribute",elements:await this.resolveTargets(e.modifiers.on,t,r),name:n,value:i}}if("string"==typeof o){const n=o.match(/^(my|me|its?|your?)\s+(.+)$/i);if(n){const i=Ma(n[1],r),a=await this.extractValue(e,t,r);return{type:"property",element:i,property:n[2],value:a}}}if(hr(o))return{type:"property",element:o,property:"textContent",value:await this.extractValue(e,t,r)};if(Array.isArray(o)&&o.length>0&&hr(o[0])){const n=await this.extractValue(e,t,r);return{type:"property",element:o[0],property:"textContent",value:n}}if("string"!=typeof o)throw Error("set command target must be a string or object literal"+("memberExpression"===n?.type||"propertyAccess"===n?.type?` (a property chain evaluated to ${null===o?"null":typeof o} \u2014 check that all intermediate objects exist)`:""));return{type:"variable",name:o,value:await this.extractValue(e,t,r),scope:"element"===a||"global"===a?a:void 0}}async execute(e,t){switch(e.type){case"variable":return"element"===e.scope?dr(t,e.name,e.value):"global"===e.scope?vr(e.name,e.value,t,"global"):vr(e.name,e.value,t),"result"!==e.name&&"it"!==e.name||Object.assign(t,{[e.name]:e.value}),Object.assign(t,{it:e.value}),{target:e.name,value:e.value,targetType:"variable"};case"attribute":for(const t of e.elements)t.setAttribute(e.name,e.value+"");return Object.assign(t,{it:e.value}),{target:"@"+e.name,value:e.value,targetType:"attribute"};case"property":return ds(e.element,e.property,e.value),Object.assign(t,{it:e.value}),{target:e.element,value:e.value,targetType:"property"};case"style":return Ha(e.element,e.property,e.value),Object.assign(t,{it:e.value}),{target:e.element,value:e.value,targetType:"property"};case"object-literal":for(const t of e.targets)for(const[r,n]of Object.entries(e.properties))ds(t,r,n);return Object.assign(t,{it:e.properties}),{target:e.targets[0]||"unknown",value:e.properties,targetType:"property"};case"member-assignment":return e.container[e.property]=e.value,Object.assign(t,{it:e.value}),{target:e.property,value:e.value,targetType:"property"};case"node-write":return await e.writer(e.node,e.value,t),Object.assign(t,{it:e.value}),{target:e.node.name??"",value:e.value,targetType:"variable"};default:throw Error("Unknown input type: "+e.type)}}async tryParseMemberExpression(e,t,r,n){const i=e.object,a=e.property;if(i?.name&&a?.name){const e=i.name.toLowerCase();if(["me","my","it","its","you","your"].includes(e)){const i=Ma(e,n),s=await this.extractValue(t,r,n);return{type:"property",element:i,property:a.name,value:s}}}const s=e.object,o=e.computed;if(s){const i=s;let l;if("memberExpression"===i.type&&!i.computed&&"style"===i.property?.name&&i.object){const e=await r.evaluate(i.object,n);l=(e&&"object"==typeof e&&"style"in e?e.style:void 0)??await r.evaluate(s,n)}else l=await r.evaluate(s,n);if(null!=l&&"object"==typeof l){const i=o?await r.evaluate(e.property,n)+"":a?.name||"";if(i)return{type:"member-assignment",container:l,property:i,value:await this.extractValue(t,r,n)}}}return null}async extractValue(e,t,r){if(e.modifiers.to)return t.evaluate(e.modifiers.to,r);const n=e.args.findIndex(e=>"identifier"===e.type&&"to"===e.name);if(n>=0&&e.args.length>n+1)return t.evaluate(e.args[n+1],r);if(e.args.length>=2)return t.evaluate(e.args[1],r);throw Error('set command requires a value (use "to" keyword)')}async resolveElement(e,t,r){return qa(e?await t.evaluate(e,r):void 0,r)}async resolveTargets(e,t,r){return Na(e?await t.evaluate(e,r):void 0,r)}async parseTheXofY(e,t,r,n){const i=e.match(/^the\s+(.+?)\s+of\s+(.+)$/i);if(!i)throw Error('Invalid "the X of Y" syntax');const[,a,s]=i,o=qa(s,n),l=await this.extractValue(t,r,n);return{type:"property",element:o,property:a.trim(),value:l}}validate(e){if(!e||"object"!=typeof e)return!1;const t=e;if(!t.type||"string"!=typeof t.type)return!1;if(!["variable","attribute","property","style","object-literal"].includes(t.type))return!1;switch(t.type){case"variable":return"string"==typeof t.name&&"value"in t;case"attribute":return"string"==typeof t.name&&Array.isArray(t.elements)&&t.elements.every(hr)&&"value"in t;case"property":return"string"==typeof t.property&&hr(t.element)&&"value"in t;case"style":return"string"==typeof t.property&&""!==t.property&&hr(t.element)&&"string"==typeof t.value;case"object-literal":return null!==t.properties&&"object"==typeof t.properties&&Array.isArray(t.targets)&&t.targets.length>0;default:return!1}}};return ba(t,"SetCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Set values to variables, attributes, or properties",syntax:["set <target> to <value>"],examples:['set myVar to "value"','set @data-theme to "dark"','set my innerHTML to "content"'],sideEffects:["state-mutation","dom-mutation"],category:"data",compatibility:"standard"}),va(t,n),i=t})()),lo=Pa((()=>{let e,t,r=[Oa({name:"get"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args||0===e.args.length)throw Error("get command requires an expression argument");const n=e.args[0],i=await t.evaluate(n,r);return i instanceof NodeList&&1===i.length||Array.isArray(i)&&1===i.length?{value:i[0]}:{value:i}}execute(e,t){return t.it=e.value,Object.assign(t,{result:e.value}),{value:e.value}}validate(e){return"object"==typeof e&&null!==e&&"value"in e}};return ba(t,"GetCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Evaluate an expression and store the result in it",syntax:"get <expression>",examples:["get #my-dialog","get <button/>","get me.parentElement"],sideEffects:["context-mutation"],category:"data",compatibility:"standard"}),va(t,n),i=t})());function co(e){return e&&"object"==typeof e&&e.type||"unknown"}let uo=(()=>{let e,t,r=[Oa({name:"increment"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n="decrement"===e.commandName?.toLowerCase()?"decrement":"increment",i=await async function(e,t,r,n){if(!e.args||0===e.args.length)throw Error(n+" command requires a target");const i=e.args[0];let a,s,o;const l=co(i);if("identifier"===l)a=i.name,i.scope&&(s=i.scope);else if("literal"===l)a=i.value;else{const e=Ne(l);if(e){const n=await t.evaluate(i,r),s="number"==typeof n?n:null==n?0:Number(n)||0;a=s,o={node:i,writer:e,currentValue:s}}else{const e=await t.evaluate(i,r);a=Array.isArray(e)&&e.length>0?e[0]:e}}let c=1,u=s;for(let n=1;e.args.length>n;n++){const i=e.args[n];if(i&&"literal"===i.type){const e=i.value;"global"===e?u="global":"number"==typeof e&&(c=e)}else if(i&&"literal"!==i.type){const e=await t.evaluate(i,r);"number"==typeof e&&(c=e)}}const d=e.modifiers?.by;if(d){const e=d.value;if("literal"===co(d)&&"number"==typeof e)c=e;else if("literal"!==co(d)){const e=await t.evaluate(d,r);"number"==typeof e&&(c=e)}}return{target:a,amount:c,...u&&{scope:u},...o&&{customWrite:o}}}(e,t,r,n);return{...i,operation:n}}async execute(e,t){const{target:r,property:n,scope:i,amount:a=1,operation:s="increment",customWrite:o}=e;if(o){const e=isFinite(a)?a:1,r="increment"===s?o.currentValue+e:o.currentValue-e;return await o.writer(o.node,r,t),Object.assign(t,{it:r}),r}const l=function(e,t,r,n){if("number"==typeof e)return e;if(hr(e)){const r=e;return t?t.startsWith("data-")||["id","class","title","alt","src","href"].includes(t)?yr(r.getAttribute(t)):yr(r[t]):yr(r.value||r.textContent)}return"string"==typeof e?"element"===r?yr(gr(e,n,"element")):"global"===r?yr(gr(e,n,"global")):e.includes(".")?function(e,t){const r=e.split("."),n=r[1],i=br(r[0],t);return i?yr(i[n]):0}(e,n):yr("me"===e&&n.me?n.me.value||0:"it"===e?n.it||0:"you"===e&&n.you?n.you.value||0:gr(e,n)):yr(e)}(r,n,i,t);let c;if(isNaN(l))c=NaN;else{const e=isFinite(a)?a:1;c="increment"===s?l+e:l-e}return function(e,t,r,n,i){if(hr(e)){const r=e;return void(t?t.startsWith("data-")||["id","class","title","alt","src","href"].includes(t)?r.setAttribute(t,n+""):r[t]=n:"value"in r&&void 0!==r.value?r.value=n+"":r.textContent=n+"")}if("string"==typeof e){if("element"===r)return void vr(e,n,i,"element");if("global"===r)return void vr(e,n,i,"global");if(e.includes("."))return void function(e,t,r){const n=e.split("."),i=n[1],a=br(n[0],r);a&&(a[i]=t)}(e,n,i);if("me"===e&&i.me)return void(i.me.value=n);if("it"===e)return void Object.assign(i,{it:n});if("you"===e&&i.you)return void(i.you.value=n);vr(e,n,i)}}(r,n,i,c,t),Object.assign(t,{it:c}),c}};return ba(t,"NumericModifyCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Modify a variable or property by a specified amount (default: 1)",syntax:["increment <target> [by <number>]","decrement <target> [by <number>]"],examples:["increment counter","increment counter by 5","decrement counter","decrement counter by 5"],sideEffects:["data-mutation","context-modification"],aliases:["decrement"],category:"data",compatibility:"standard"}),va(t,n),i=t})();const mo=Pa(uo),po=Pa(uo),ho=Pa((()=>{let e,t,r=[Oa({name:"default"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(1>e.args.length)throw Error("default command requires a target");const n=await this.extractValue(e,t,r),i=e.args[0],a=function(e){if("contextReference"!==e?.type)return null;const t=e.name;return"string"!=typeof t?null:t.startsWith(":")?{name:t.slice(1),scope:"element"}:t.startsWith("$")?{name:t.slice(1),scope:"global"}:null}(i);if(a)return{type:"variable",name:a.name,value:n,scope:a.scope};const s=await so(i,t,r,{scopeElements:async()=>r.me?[r.me]:[],bareReference:!0});if(s)return function(e,t){switch(e.kind){case"attribute":return{type:"attribute",elements:e.elements,name:e.name,value:t};case"property":return{type:"property",element:e.target.element,property:e.target.property,value:t};case"variable":{const r=e.name.startsWith("$"),n=r?e.name.slice(1):e.name,i=r?"global":e.scope;return{type:"variable",name:n,value:t,...i?{scope:i}:{}}}default:throw Error(`default: unrequested write-target rung '${e.kind}'`)}}(s,n);const o=await t.evaluate(e.args[0],r);if(hr(o))return{type:"element",element:o,value:n};if(Array.isArray(o)&&hr(o[0]))return{type:"element",element:o[0],value:n};if("string"==typeof o)return{type:"variable",name:o,value:n};throw Error("Invalid target type: "+typeof o)}async extractValue(e,t,r){if(e.modifiers?.to)return t.evaluate(e.modifiers.to,r);const n=e.args[1],i="identifier"===n?.type&&"to"===(n.name+"").toLowerCase();if(i&&e.args.length>=3)return t.evaluate(e.args[2],r);if(!i&&e.args.length>=2)return t.evaluate(e.args[1],r);throw Error('default command requires a value (use "to <value>")')}async execute(e,t){switch(e.type){case"variable":return this.defaultVariable(t,e.name,e.value,e.scope);case"attribute":return this.defaultAttribute(t,e.elements,e.name,e.value);case"property":return this.defaultElementProperty(t,e.element,e.property,e.value);case"element":return this.defaultElementValue(t,e.element,e.value)}}defaultVariable(e,t,r,n){const i=gr(t,e,n);return null!=i?{target:t,value:r,wasSet:!1,existingValue:i,targetType:"variable"}:(vr(t,r,e,n),Object.assign(e,{it:r}),{target:t,value:r,wasSet:!0,targetType:"variable"})}defaultAttribute(e,t,r,n){if(0===t.length)throw Error("No element context available for attribute default");const i=t.filter(e=>null===e.getAttribute(r));if(0===i.length)return{target:"@"+r,value:n,wasSet:!1,existingValue:t[0].getAttribute(r),targetType:"attribute"};for(const e of i)e.setAttribute(r,n+"");return Object.assign(e,{it:n}),{target:"@"+r,value:n,wasSet:!0,targetType:"attribute"}}defaultElementProperty(e,t,r,n){const i=function(e,t){if(t.startsWith("@"))return e.getAttribute(t.substring(1));switch(t){case"textContent":return e.textContent;case"innerHTML":return e.innerHTML;case"innerText":return e.innerText;case"id":return e.id;case"className":return e.className;case"value":return"value"in e?e.value:void 0;case"checked":return"checked"in e?e.checked:void 0}if(t.includes(".")){const r=t.split(".");let n=e;for(const e of r){if(null==n)break;n=n[e]}return n}return t.includes("-")||t in e.style?e.style.getPropertyValue(t)||e.style[t]:e[t]}(t,r);return ms(i)?(ds(t,r,n),Object.assign(e,{it:n}),{target:r,value:n,wasSet:!0,targetType:"property"}):{target:r,value:n,wasSet:!1,existingValue:i,targetType:"property"}}defaultElementValue(e,t,r){const n=function(e){return"value"in e?e.value:e.textContent}(t);return ms(n)?(function(e,t){"value"in e?e.value=t+"":e.textContent=t+""}(t,r),Object.assign(e,{it:r}),{target:"element",value:r,wasSet:!0,targetType:"element"}):{target:"element",value:r,wasSet:!1,existingValue:n,targetType:"element"}}};return ba(t,"DefaultCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Set a value only if it doesn't already exist",syntax:["default <expression> to <expression>"],examples:['default myVar to "fallback"','default @data-theme to "light"','default my innerHTML to "No content"'],sideEffects:["data-mutation","dom-mutation"],category:"data",compatibility:"standard"}),va(t,n),i=t})());function fo(e){const t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}const yo=Pa((()=>{let e,t,r=[Oa({name:"clear"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n=e.args?.[0],i=n?.type,a=n?.name;if(n&&("variable"===i||"identifier"===i&&"string"==typeof a))try{const e=await t.evaluate(n,r);if(!hr(e)&&!Array.isArray(e))return{type:"variable",name:a}}catch{return{type:"variable",name:a}}return{type:"form-fields",targets:await _a(e.args,t,r,"clear",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers)}}async execute(e,t){if("variable"===e.type)return t.locals.set(e.name,null),void Object.assign(t,{it:null});for(const t of e.targets)fo(t)&&("SELECT"===t.tagName?t.selectedIndex=-1:t.value="")}validate(e){if("object"!=typeof e||null===e)return!1;if("variable"===e.type)return"string"==typeof e.name;if("form-fields"===e.type){const t=e.targets;return Array.isArray(t)&&t.every(e=>hr(e))}return!1}};return ba(t,"ClearCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Reset a variable to null or clear the value of a form field (<input>, <textarea>, <select>)",syntax:["clear <var>","clear :var","clear <target>"],examples:["clear :count","clear myVar","clear #search","clear <textarea/>"],sideEffects:["state-mutation","dom-mutation"],category:"data",compatibility:"standard"}),va(t,n),i=t})());function go(e,t,r,n){return e?new Promise(r=>{const i=()=>{a({event:null,timedOut:!1,cancelled:!0})},a=bo(()=>{e.removeEventListener(t,s),n&&n.removeEventListener("abort",i)},r),s=e=>{a({event:e,timedOut:!1,cancelled:!1})};n?.aborted?r({event:null,timedOut:!1,cancelled:!0}):(e.addEventListener(t,s),n&&n.addEventListener("abort",i))}):Promise.reject(Error("waitForEvent: no target provided"))}function vo(e){return new Promise(t=>setTimeout(t,e))}function bo(e,t){let r=!1;return n=>{r||(r=!0,e(),t(n))}}const wo=Pa((()=>{let e,t,r=[Oa({name:"wait"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args?.length)throw Error("wait command requires an argument");if(e.modifiers.or)return this.parseRaceCondition(e,t,r);if(e.modifiers.for)return this.parseEventWait(e.modifiers.for,e.modifiers.from,t,r);const n=e.args[0];return"arrayLiteral"===n.type&&n.elements?this.parseEventArrayWait(n.elements,e.args[1],t,r):this.parseTimeWait(e.args[0],t,r)}async execute(e,t){const r=Date.now();if("time"===e.type)return await vo(e.milliseconds),{type:"time",result:e.milliseconds,duration:Date.now()-r};if("event"===e.type){const n=e.target??t.me??document,i=(await go(n,e.eventName)).event;if(Object.assign(t,{it:i}),e.destructure)for(const r of e.destructure)r in i&&t.locals.set(r,i[r]);return{type:"event",result:i,duration:Date.now()-r}}const{result:n,winningCondition:i}=await this.executeRace(e.conditions,t);if(Object.assign(t,{it:n}),n instanceof Event&&"event"===i?.type&&i.destructure)for(const e of i.destructure)e in n&&t.locals.set(e,n[e]);return{type:n instanceof Event?"event":"time",result:n,duration:Date.now()-r}}async parseTimeWait(e,t,r){return{type:"time",milliseconds:rs(await t.evaluate(e,r))}}async parseEventWait(e,t,r,n){const i=await r.evaluate(e,n);if("string"!=typeof i)throw Error("wait for: event name must be a string");const a=i.match(/^(\w+)\(([^)]+)\)$/),s=a?a[1]:i,o=a?a[2].split(",").map(e=>e.trim()):void 0;let l;if(t){const e=await r.evaluate(t,n);if(!e||"object"!=typeof e||!("addEventListener"in e))throw Error("wait for from: target must be an EventTarget");l=e}else l=n.me??void 0;return{type:"event",eventName:s,target:l,destructure:o}}async parseEventArrayWait(e,t,r,n){let i;if(t){const e=await r.evaluate(t,n);e&&"object"==typeof e&&"addEventListener"in e&&(i=e)}i||(i=n.me??void 0);const a=[];for(const t of e){const e=t;if("objectLiteral"!==e.type||!e.properties)continue;let s,o="",l=[];for(const t of e.properties){const e=t.key?.name||t.key?.value;"name"===e&&t.value?o=t.value.value||"":"args"===e&&t.value?.elements?l=t.value.elements.map(e=>e.value||e.name||""):"duration"===e&&t.value&&(s=t.value)}if(s){const e=await r.evaluate(s,n);a.push({type:"time",milliseconds:rs(e)})}else o&&a.push({type:"event",eventName:o,target:i,destructure:l.length>0?l:void 0})}return 1===a.length?a[0]:{type:"race",conditions:a}}async parseRaceCondition(e,t,r){const n=[];e.modifiers.for?n.push(await this.parseEventWait(e.modifiers.for,e.modifiers.from,t,r)):e.args[0]&&n.push(await this.parseTimeWait(e.args[0],t,r));const i=await t.evaluate(e.modifiers.or,r),a=Array.isArray(i)?i:[i];for(const e of a)try{n.push({type:"time",milliseconds:rs(e)})}catch{if("string"==typeof e){const t=e.match(/^(\w+)\(([^)]+)\)$/);n.push(t?{type:"event",eventName:t[1],target:r.me??void 0,destructure:t[2].split(",").map(e=>e.trim())}:{type:"event",eventName:e,target:r.me??void 0})}}if(2>n.length)throw Error("wait: race requires at least 2 conditions");return{type:"race",conditions:n}}async executeRace(e,t){const r=new AbortController,n=r.signal,i=e.map(e=>"time"===e.type?vo(e.milliseconds).then(()=>({result:e.milliseconds,winningCondition:e})):go(e.target??t.me??document,e.eventName,0,n).then(t=>({result:t.event,winningCondition:e})));try{return await Promise.race(i)}finally{r.abort()}}};return ba(t,"WaitCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Wait for time delay, event, or race condition",syntax:["wait <time>","wait for <event>","wait for <event> or <condition>"],examples:["wait 2s","wait for click","wait for click or 1s","wait for mousemove(clientX, clientY)"],sideEffects:["time","event-listening"],category:"async",compatibility:"standard"}),va(t,n),i=t})()),ko=new Map;let Eo=[/^4\d{2}$/,/^5\d{2}$/],xo=(()=>{let e,t,r=[Oa({name:"fetch"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args?.length)throw Error("fetch requires a URL");const n=await this.parseURL(e.args[0],t,r),i=this.parseResponseType(e.modifiers.as);return{url:n,responseType:i,options:await this.parseRequestOptions(e.modifiers.with,t,r),throwOnError:!e.modifiers.doNotThrow&&"response"!==i}}async execute(e,t){const r=Date.now(),{url:n,responseType:i,options:a}=e,s=new AbortController;let o;t.me&&(o=()=>s.abort(),t.me.addEventListener("fetch:abort",o,{once:!0}));const l={...a,signal:s.signal},c=ko.get(i);if(c?.accept){const e=new Headers(l.headers);e.has("Accept")||e.set("Accept",c.accept),l.headers=e}if(t.me){const e={...l,sender:t.me,headers:l.headers||{}};this.dispatchEvent(t.me,"fetch:beforeRequest",e),l.headers=e.headers}let u;a.timeout&&(u=setTimeout(()=>s.abort(),a.timeout));try{let a=await fetch(n,l);if(t.me){const e={response:a};this.dispatchEvent(t.me,"fetch:afterResponse",e),a=e.response}if(e.throwOnError&&function(e){const t=e+"";return Eo.some(e=>e.test(t))}(a.status)){const e=Error(`Fetch failed for ${n}: HTTP ${a.status} ${a.statusText}`.trim());throw e.response=a,e.isFetchStatusError=!0,e}const s=await this.handleResponse(a,i,t);t.me&&this.dispatchEvent(t.me,"fetch:afterRequest",{result:s});const o={status:a.status,statusText:a.statusText,headers:a.headers,data:s,url:a.url,duration:Date.now()-r};return Object.assign(t,{it:s}),o}catch(e){if(t.me&&this.dispatchEvent(t.me,"fetch:error",{reason:e instanceof Error?e.message:e+"",error:e}),e instanceof Error&&"AbortError"===e.name)throw Error("Fetch aborted for "+n);if(e instanceof Error&&!0===e.isFetchStatusError)throw e;throw Error(`Fetch failed for ${n}: ${e instanceof Error?e.message:e+""}`)}finally{u&&clearTimeout(u),t.me&&o&&t.me.removeEventListener("fetch:abort",o)}}async parseURL(e,t,r){const n=await t.evaluate(e,r);if("string"!=typeof n||!n){const t=e;if(null==n&&"identifier"===t?.type&&t.name)throw Error(`fetch: URL expression "${t.name}" evaluated to ${n+""} \u2014 check the variable is set, or quote it if you meant a literal URL (fetch 'https://example.com/path')`);throw Error("fetch: URL must be a non-empty string")}return n}parseResponseType(e){if(!e)return"text";if(("identifier"===e.type||"expression"===e.type)&&e.name){const t=e.name.toLowerCase();if("object"===t)return"json";if(["text","json","html","response","blob","arraybuffer"].includes(t))return"arraybuffer"===t?"arrayBuffer":t;if(ko.has(t))return t;throw Error(`fetch: invalid response type "${t}"`)}return"text"}async parseRequestOptions(e,t,r){if(!e)return{};const n=await t.evaluate(e,r);if("object"!=typeof n||null===n)throw Error('fetch: "with" options must be an object');const i={};return"method"in n&&(i.method=(n.method+"").toUpperCase()),"headers"in n&&(i.headers=this.parseHeaders(n.headers)),"body"in n&&(i.body=this.parseBody(n.body)),"credentials"in n&&(i.credentials=n.credentials),"mode"in n&&(i.mode=n.mode),"cache"in n&&(i.cache=n.cache),i}parseHeaders(e){if(e instanceof Headers)return e;const t=new Headers;if("object"==typeof e&&null!==e)for(const[r,n]of Object.entries(e))t.set(r,n+"");return t}parseBody(e){return null==e?null:e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||e instanceof URLSearchParams||"string"==typeof e?e:"object"==typeof e?JSON.stringify(e):e+""}async handleResponse(e,t,r){switch(t){case"response":return e;case"json":return e.json();case"html":return this.parseHTML(await e.text());case"blob":return e.blob();case"arrayBuffer":return e.arrayBuffer();case"text":return e.text();default:{const n=ko.get(t);return n?n.handler(e,r):e.text()}}}parseHTML(e){const t=(new DOMParser).parseFromString(e,"text/html"),r=document.createDocumentFragment();return Array.from(t.body.childNodes).forEach(e=>r.appendChild(e.cloneNode(!0))),1===r.childNodes.length&&hr(r.firstChild)?r.firstChild:r}dispatchEvent(e,t,r){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}))}};return ba(t,"FetchCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Make HTTP requests with lifecycle event support",syntax:["fetch <url>","fetch <url> as <type>","fetch <url> with <options>"],examples:['fetch "/api/data"','fetch "/api/users" as json','fetch "/api/save" with { method:"POST" }'],sideEffects:["network","event-dispatching"],category:"async",compatibility:"standard"}),va(t,n),i=t})();const Co=Pa(xo);function Ao(e){const t=e.trim();return/^\d+$/.test(t)?parseInt(t,10):/^\d*\.\d+$/.test(t)?parseFloat(t):"true"===t||"false"!==t&&("null"===t?null:"undefined"!==t?t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):t:void 0)}let So=(()=>{let e,t,r=[Oa({name:"trigger"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n="send"===e.commandName?.toLowerCase()?"send":"trigger",i=n;if(!e.args?.length)throw Error(i+" command requires an event name");const a=e=>e?.type||"unknown",s=e.args[0];let o,l,c;if("functionCall"===a(s)||"callExpression"===a(s)){o=s.name||s.callee?.name;const e=s.args||s.arguments;e?.length&&(l=await this.parseEventDetail(e,t,r))}else if("identifier"===a(s)||"keyword"===a(s))o=s.name;else{const e=await t.evaluate(s,r);o="string"==typeof e?e:e+""}const u=e.modifiers?.on||e.modifiers?.to;if(u)c=await this.resolveTargets([u],t,r,i);else{const n=e.args.findIndex((e,t)=>{if(0===t)return!1;const r=e.name||e.value;return"on"===r||"to"===r});if(-1!==n&&e.args.length-1>n){const a=e.args.slice(n+1),s=a.findIndex(e=>"with"===(e.name||e.value)),o=-1===s?a:a.slice(0,s);c=await this.resolveTargets(o,t,r,i)}else{if(!r.me)throw Error(i+": no target specified and context.me is null");c=[r.me]}}return{eventName:o,detail:l,targets:c,options:await this.parseEventOptions(e.args,t,r),mode:n}}async execute(e,t){const r=function(e,t,r={}){return new CustomEvent(e,{detail:void 0!==t?t:{},bubbles:void 0===r.bubbles||r.bubbles,cancelable:void 0===r.cancelable||r.cancelable,composed:void 0!==r.composed&&r.composed})}(e.eventName,e.detail,e.options);for(const t of e.targets)t.dispatchEvent(r);t.it=r}async resolveTargets(e,t,r,n){const i=[];for(const n of e){const e=await t.evaluate(n,r);if("window"!==e&&e!==window)if("document"!==e&&e!==document)if("me"===e&&r.me)i.push(r.me);else if("you"===e&&r.you)i.push(r.you);else if("it"===e&&r.it)i.push(r.it);else if(hr(e))i.push(e);else if(e instanceof NodeList)i.push(...Array.from(e).filter(hr));else if(Array.isArray(e))i.push(...e.filter(hr));else{if("string"==typeof e){const t=document.querySelectorAll(e);if(0===t.length)throw Error(`No elements found: "${e}"`);i.push(...Array.from(t).filter(hr));continue}if(!e||"object"!=typeof e||!("addEventListener"in e))throw Error("Invalid target: "+typeof e);i.push(e)}else i.push(document);else i.push(window)}if(!i.length)throw Error(n+": no valid targets");return i}async parseEventDetail(e,t,r){if(!e?.length)return;if(1===e.length){const n=e[0];if("objectLiteral"!==n?.type)return await t.evaluate(n,r)}const n={};for(const i of e){const e=await t.evaluate(i,r);if("object"!=typeof e||null===e||Array.isArray(e)){if("string"==typeof e&&e.includes(":")){const[t,r]=e.split(":",2);n[t.trim()]=Ao(r.trim())}}else Object.assign(n,e)}return Object.keys(n).length?n:void 0}async parseEventOptions(e,t,r){const n={bubbles:!0,cancelable:!0,composed:!1},i=e.findIndex(e=>"with"===(e.name||e.value));if(-1===i)return n;for(const a of e.slice(i+1)){const e=await t.evaluate(a,r);if("string"==typeof e){const t=e.toLowerCase();"bubbles"===t?n.bubbles=!0:"nobubbles"===t?n.bubbles=!1:"cancelable"===t?n.cancelable=!0:"nocancelable"===t?n.cancelable=!1:"composed"===t&&(n.composed=!0)}}return n}};return ba(t,"EventDispatchCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Dispatch events on elements",syntax:["trigger <event> on <target>","trigger <event>(<detail>) on <target>","send <event> to <target>","send <event>(<detail>) to <target>"],examples:["trigger click on #button","trigger customEvent on me","send dataEvent to #target","send myEvent(count: 42) to me"],sideEffects:["event-dispatch"],aliases:["send"],category:"event",compatibility:"standard"}),va(t,n),i=t})();const To=Pa(So),Lo=Pa(So),Oo=Pa((()=>{let e,t,r=[Oa({name:"transition"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args?.length)throw Error("transition requires property and value");let n,i;const a=await t.evaluate(e.args[0],r),s=(e=>Array.isArray(e)||fr(e)?e[0]:e)(a);if(hr(s)||"string"==typeof a&&/^[#.]|^(?:me|it|you)$/.test(a))i=s,n=await t.evaluate(e.args[1],r)+"";else{if(e.args.length>=2)throw Error("transition: target element not found");n=a+""}if(!n)throw Error("transition requires a CSS property");if(!e.modifiers?.to)throw Error('transition requires "to <value>"');let o=await t.evaluate(e.modifiers.to,r);void 0===o&&"identifier"===e.modifiers.to.type&&(o=e.modifiers.to.name);const l={property:n,value:o};return void 0!==i&&(l.target=i),e.modifiers?.over&&(l.duration=await t.evaluate(e.modifiers.over,r)),e.modifiers?.with&&(l.timingFunction=await t.evaluate(e.modifiers.with,r)+""),l}async execute(e,t){let{property:r}=e;const{target:n,value:i,duration:a,timingFunction:s}=e;r.startsWith("*")&&(r=r.substring(1)),r=r.replace(/([A-Z])/g,"-$1").toLowerCase();const o=qa(n,t,"transition"),l=ts(a,300),c=getComputedStyle(o).getPropertyValue(r),u=o.style.transition,d=`${r} ${l}ms ${s||"ease"}`;o.style.transition=u?`${u}, ${d}`:d;let m=i+"",p=!1;if("initial"===m||"inherit"===m||"unset"===m||"revert"===m){const e=o.style.getPropertyValue(r);o.style.removeProperty(r),m=getComputedStyle(o).getPropertyValue(r),e&&o.style.setProperty(r,e),p=!0}o.style.setProperty(r,m);const h=await function(e,t,r){return new Promise(n=>{const i=r=>{r.target===e&&r.propertyName===t&&s({completed:!0,cancelled:!1})},a=r=>{r.target===e&&r.propertyName===t&&s({completed:!1,cancelled:!0})},s=bo(()=>{e.removeEventListener("transitionend",i),e.removeEventListener("transitioncancel",a),clearTimeout(o)},n);e.addEventListener("transitionend",i),e.addEventListener("transitioncancel",a);const o=setTimeout(()=>{s({completed:!0,cancelled:!1})},r+50)})}(o,r,l);return o.style.transition=u,p&&o.style.removeProperty(r),{element:o,property:r,fromValue:c,toValue:m,duration:l,completed:h.completed}}};return ba(t,"TransitionCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Animate CSS properties using CSS transitions",syntax:"transition [<target>] <property> to <value> [over <duration>] [with <timing>]",examples:["transition opacity to 0.5","transition my *opacity to 0 over 200ms","transition #box's *opacity to 0 over 200ms","transition left to 100px over 500ms","transition background-color to red over 1s with ease-in-out"],sideEffects:["style-change","timing"],category:"animation",compatibility:"standard"}),va(t,n),i=t})()),jo=Pa((()=>{let e,t,r=[Oa({name:"measure"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){let n,i,a;if(e.args?.length){const a=e.args[0];if("identifier"===a.type&&a.name){const s=a.name.toLowerCase();if("me"===s||"it"===s||"you"===s){const s=await t.evaluate(a,r);if(hr(s)&&(n=s,e.args.length>1)){const n=e.args[1];i="identifier"===n.type?n.name:await t.evaluate(n,r)+""}}else i=a.name}else{const s=await t.evaluate(a,r);if(hr(s)||"string"==typeof s&&/^[#.]/.test(s)){if(n=s,e.args.length>1){const n=e.args[1];i="identifier"===n.type?n.name:await t.evaluate(n,r)+""}}else"string"==typeof s&&(i=s)}}e.modifiers?.set&&(a=await t.evaluate(e.modifiers.set,r)+"");const s={};return void 0!==n&&(s.target=n),void 0!==i&&(s.property=i),void 0!==a&&(s.variable=a),s}async execute(e,t){const r=qa(e.target,t,"measure"),n=e.property||"width",i=this.getMeasurement(r,n);return e.variable&&t.locals&&t.locals.set(e.variable,i.value),Object.assign(t,{it:i.value}),{result:i.value,wasAsync:!1,element:r,property:n,value:i.value,unit:i.unit,stored:!!e.variable}}getMeasurement(e,t){const r=getComputedStyle(e);if(t.startsWith("*")){const e=r.getPropertyValue(t.substring(1)),n=parseFloat(e);if(!isNaN(n)){const t=e.match(/([a-zA-Z%]+)$/);return{value:n,unit:t?t[1]:""}}return{value:e,unit:""}}const n=t.toLowerCase(),i=e.getBoundingClientRect(),a={width:()=>i.width,height:()=>i.height,top:()=>i.top,left:()=>i.left,right:()=>i.right,bottom:()=>i.bottom,x:()=>e.offsetLeft,y:()=>e.offsetTop,clientwidth:()=>e.clientWidth,"client-width":()=>e.clientWidth,clientheight:()=>e.clientHeight,"client-height":()=>e.clientHeight,offsetwidth:()=>e.offsetWidth,"offset-width":()=>e.offsetWidth,offsetheight:()=>e.offsetHeight,"offset-height":()=>e.offsetHeight,scrollwidth:()=>e.scrollWidth,"scroll-width":()=>e.scrollWidth,scrollheight:()=>e.scrollHeight,"scroll-height":()=>e.scrollHeight,scrolltop:()=>e.scrollTop,"scroll-top":()=>e.scrollTop,scrollleft:()=>e.scrollLeft,"scroll-left":()=>e.scrollLeft,offsettop:()=>e.offsetTop,"offset-top":()=>e.offsetTop,offsetleft:()=>e.offsetLeft,"offset-left":()=>e.offsetLeft};if(a[n])return{value:a[n](),unit:"px"};const s=r.getPropertyValue(t),o=parseFloat(s);if(!isNaN(o)){const e=s.match(/([a-zA-Z%]+)$/);return{value:o,unit:e?e[1]:"px"}}return{value:0,unit:"px"}}};return ba(t,"MeasureCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Measure DOM element dimensions, positions, and properties",syntax:["measure","measure <property>","measure <target> <property>"],examples:["measure","measure width","measure #element height","measure x and set dragX"],sideEffects:["data-mutation"],category:"animation",compatibility:"standard"}),va(t,n),i=t})()),Po=Pa((()=>{let e,t,r=[Oa({name:"settle"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){let n,i;if(e.args&&e.args.length>0){const i=await t.evaluate(e.args[0],r);(hr(i)||"string"==typeof i&&(i.startsWith("#")||i.startsWith(".")||"me"===i||"it"===i||"you"===i))&&(n=i)}e.modifiers?.for&&(i=await t.evaluate(e.modifiers.for,r));const a={};return void 0!==n&&(a.target=n),void 0!==i&&(a.timeout=i),a}async execute(e,t){const{target:r,timeout:n}=e,i=qa(r,t,"settle"),a=ts(n,5e3),s=Date.now(),o=getComputedStyle(i),l=ns(o.transitionDuration),c=ns(o.transitionDelay),u=ns(o.animationDuration),d=ns(o.animationDelay),m=is(l,c),p=is(u,d),h=Math.max(m,p);var f,y,g;return{element:i,settled:(await(f=i,y=h,g=a,y>0?new Promise(e=>{const t=e=>{e.target===f&&n({completed:!0,type:"transition"})},r=e=>{e.target===f&&n({completed:!0,type:"animation"})},n=bo(()=>{f.removeEventListener("transitionend",t),f.removeEventListener("animationend",r),clearTimeout(i),clearTimeout(a)},e);f.addEventListener("transitionend",t),f.addEventListener("animationend",r);const i=setTimeout(()=>{n({completed:!0,type:"timeout"})},y+50),a=setTimeout(()=>{n({completed:!1,type:"timeout"})},g)}):Promise.resolve({completed:!0,type:"timeout"}))).completed,timeout:a,duration:Date.now()-s}}};return ba(t,"SettleCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Wait for CSS transitions and animations to complete",syntax:"settle [<target>] [for <timeout>]",examples:["settle","settle #animated-element","settle for 3000"],sideEffects:["timing"],category:"animation",compatibility:"standard"}),va(t,n),i=t})());const Io=Pa((()=>{let e,t,r=[Oa({name:"take"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args||0===e.args.length)throw Error('take requires property, "from", and source');const{value:n}=await Da(e.args[0],t,r),i=n+"";let a;if(2>e.args.length)e.modifiers?.from&&(a=await t.evaluate(e.modifiers.from,r));else{if(!(s=e.args[1])||("identifier"!==s.type||"from"!==s.name)&&"from"!==s.value)throw Error("take syntax: take <property> from <source>");e.args[2]&&(a=await t.evaluate(e.args[2],r))}var s;let o;if(8>e.args.length)e.args.length>3&&(o=await t.evaluate(e.args[3],r));else{const n=[3,4,5,6].map(t=>e.args[t]),i=e=>e?.name??e?.value;"and"===i(n[0])&&"put"===i(n[1])&&"it"===i(n[2])&&"on"===i(n[3])&&e.args[7]&&(o=await t.evaluate(e.args[7],r))}if(!o&&e.modifiers?.on&&(o=await t.evaluate(e.modifiers.on,r)),!o&&e.modifiers?.for&&(o=await t.evaluate(e.modifiers.for,r)),void 0===a&&!i.startsWith("."))throw Error('take requires property, "from", and source');return{property:i,source:a,target:o}}async execute(e,t){const r=e.property.trim();if(r.startsWith(".")){const n=r.substring(1);let i;if(null!=e.source)i=Na(e.source,t);else{const e=t.me?.ownerDocument??("undefined"!=typeof document?document:null);i=e?Array.from(e.querySelectorAll("."+n)):[]}for(const e of i)e.classList.remove(n);const a=Na(e.target,t);if(0===a.length)throw Error("take: no recipient element found");for(const e of a)e.classList.add(n);return{targetElement:a[0],property:e.property,value:n}}const n=qa(this.firstOf(e.source),t,"take"),i=qa(e.target?this.firstOf(e.target):void 0,t,"take"),a=this.takeProperty(n,e.property);return this.putProperty(i,e.property,a),{targetElement:i,property:e.property,value:a}}firstOf(e){const t=null!==e&&"object"==typeof e&&"number"==typeof e.length&&"function"==typeof e.item;if(Array.isArray(e)||t){const t=e[0];if(void 0===t)throw Error("take: no matching elements");return t}return e}takeProperty(e,t){const r=t.trim(),n=r.toLowerCase();if("class"===n||"classes"===n){const t=Array.from(e.classList);return e.className="",t}if(r.startsWith(".")){const t=r.substring(1);return e.classList.contains(t)?(e.classList.remove(t),t):null}if(r.startsWith("@")){const t=r.substring(1),n=e.getAttribute(t);return e.removeAttribute(t),n}if(r.startsWith("data-")){const t=e.getAttribute(r);return e.removeAttribute(r),t}if("id"===n){const t=e.id;return e.id="",t}if("title"===n){const t=e.title;return e.title="",t}if("value"===n&&"value"in e){const t=e.value;return e.value="",t}const i=r.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());if(r.includes("-")||i in e.style||r in e.style){let t;return i in e.style?(t=e.style[i],e.style[i]=""):r in e.style?(t=e.style[r],e.style[r]=""):(t=e.style.getPropertyValue(r),e.style.removeProperty(r)),t}const a=e.getAttribute(t);return null!==a?(e.removeAttribute(t),a):null}putProperty(e,t,r){if(null==r)return;const n=t.trim(),i=n.toLowerCase();if("class"===i||"classes"===i)return void(Array.isArray(r)?r.forEach(t=>t&&"string"==typeof t&&e.classList.add(t)):"string"==typeof r&&(e.className=r));if(n.startsWith("."))return void(r&&e.classList.add(n.substring(1)));if(n.startsWith("@"))return void e.setAttribute(n.substring(1),r+"");if(n.startsWith("data-"))return void e.setAttribute(n,r+"");if("id"===i)return void(e.id=r+"");if("title"===i)return void(e.title=r+"");if("value"===i&&"value"in e)return void(e.value=r+"");const a=n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());n.includes("-")||a in e.style||n in e.style?a in e.style?e.style[a]=r+"":n in e.style?e.style[n]=r+"":e.style.setProperty(n,r+""):e.setAttribute(t,r+"")}};return ba(t,"TakeCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Move classes, attributes, and properties from one element to another",syntax:["take <class> [from <source>] [for <recipient>]","take <property> from <source>","take <property> from <source> and put it on <target>"],examples:["take .active from .tab for me","take class from <#source/>","take @data-value from <.source/> and put it on <#target/>"],sideEffects:["dom-mutation","property-transfer"],category:"animation",compatibility:"standard"}),va(t,n),i=t})()),qo=Pa((()=>{let e,t,r=[Oa({name:"log"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return e.args&&0!==e.args.length?{values:await Promise.all(e.args.map(e=>t.evaluate(e,r)))}:{values:[]}}async execute(e,t){const r="undefined"!=typeof window?window.console:console;0===e.values.length?r.log():r.log(...e.values)}validate(e){return"object"==typeof e&&null!==e&&Array.isArray(e.values)}};return ba(t,"LogCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Log values to the console",syntax:"log [<values...>]",examples:['log "Hello World"',"log me.value","log x y z",'log "Result:" result'],sideEffects:["console-output"],category:"utility",compatibility:"standard"}),va(t,n),i=t})()),No=Pa((()=>{let e,t,r=[Oa({name:"tell"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(2>e.args.length)throw Error("tell command requires a target and at least one command");return{target:await t.evaluate(e.args[0],r),commands:e.args.slice(1)}}async execute(e,t){const{target:r,commands:n}=e,i=Na(r,t);if(0===i.length)throw Error("tell command found no target elements");const a=t.locals.get("_runtimeExecute"),s=[];for(const e of i){const r={...t,me:e,you:e};for(const e of n)try{const t=await this.executeCommand(e,r,a);s.push(t),Object.assign(r,{it:t})}catch(e){throw Error("Command execution failed in tell block: "+(e instanceof Error?e.message:"Unknown error"))}}return{targetElements:i,commandResults:s,executionCount:i.length*n.length}}async executeCommand(e,t,r){if(e&&"object"==typeof e&&"command"===e.type&&r)return await r(e,t);if("function"==typeof e)return await e(t);if(e&&"object"==typeof e&&"function"==typeof e.execute)return await e.execute(t);throw Error("Invalid command: must be a function or object with execute method")}};return ba(t,"TellCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Execute commands in the context of target elements",syntax:["tell <target> <command> [<command> ...]"],examples:["tell #sidebar hide","tell .buttons add .disabled","tell closest <form/> submit"],sideEffects:["context-switching","command-execution"],category:"utility",compatibility:"standard"}),va(t,n),i=t})()),Ro=Pa((()=>{let e,t,r=[Oa({name:"call"})],n=[];var i=t=class{get metadata(){return i.metadata}parseInput(e,t,r){if(!e.args?.length)throw Error("call command requires an expression");return Promise.resolve({expression:e.args[0]})}async execute(e,t){const{expression:r}=e,n=t.locals?.get("__evaluator"),i=n?await n.evaluate(r,t):await nn(r,t);let a,s,o=!1;return"function"==typeof i?(s="function",a=i(),a instanceof Promise&&(o=!0,a=await a)):i instanceof Promise?(s="promise",o=!0,a=await i):(s="value",a=i),Object.assign(t,{it:a,result:a}),{result:a,wasAsync:o,expressionType:s}}};return ba(t,"CallCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Evaluate an expression and store the result in the it variable",syntax:["call <expression>"],examples:["call myFunction()",'call fetch("/api/data")',"call element.focus()"],sideEffects:["function-execution","context-mutation"],category:"execution",compatibility:"standard"}),va(t,n),i=t})()),Mo=Pa((()=>{let e,t,r=[Oa({name:"focus"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{targets:await _a(e.args,t,r,"focus",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers)}}async execute(e,t){for(const t of e.targets)t.focus()}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!!Array.isArray(t.targets)&&t.targets.every(e=>hr(e))}};return ba(t,"FocusCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Focus an element (calls HTMLElement.focus())",syntax:["focus","focus <target>","focus on <target>"],examples:["focus","focus #search","focus on <input/>"],sideEffects:["focus"],category:"execution",compatibility:"standard"}),va(t,n),i=t})()),$o=Pa((()=>{let e,t,r=[Oa({name:"blur"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{targets:await _a(e.args,t,r,"blur",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers)}}async execute(e,t){for(const t of e.targets)t.blur()}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!!Array.isArray(t.targets)&&t.targets.every(e=>hr(e))}};return ba(t,"BlurCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Remove focus from an element (calls HTMLElement.blur())",syntax:["blur","blur <target>","blur on <target>"],examples:["blur","blur #search","blur on <input/>"],sideEffects:["focus"],category:"execution",compatibility:"standard"}),va(t,n),i=t})()),_o=Pa((()=>{let e,t,r=[Oa({name:"copy"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(1>e.args.length)throw Error("copy command requires a source (text or element)");const n=await t.evaluate(e.args[0],r);let i="text";if(e.modifiers?.format){const n=await t.evaluate(e.modifiers.format,r);"html"!==n&&"text"!==n||(i=n)}return{source:n,format:i}}async execute(e,t){const{source:r,format:n="text"}=e,i=this.extractText(r,n,t);if("undefined"!=typeof navigator&&navigator.clipboard)try{return await navigator.clipboard.writeText(i),this.dispatchCopyEvent(t,"copy:success",{text:i,method:"clipboard-api"}),{success:!0,text:i,format:n,method:"clipboard-api"}}catch{}try{if(this.copyUsingExecCommand(i))return this.dispatchCopyEvent(t,"copy:success",{text:i,method:"execCommand"}),{success:!0,text:i,format:n,method:"execCommand"}}catch{}return this.dispatchCopyEvent(t,"copy:error",{text:i,error:"All copy methods failed"}),{success:!1,text:i,format:n,method:"fallback"}}extractText(e,t,r){if("string"==typeof e)return e;if(hr(e))return"html"===t?e.outerHTML:e.textContent||"";if(e===r.me&&hr(r.me)){const e=r.me;return"html"===t?e.outerHTML:e.textContent||""}return e+""}copyUsingExecCommand(e){if("undefined"==typeof document)return!1;const t=document.createElement("textarea");t.value=e,t.style.cssText="position:fixed;top:0;left:-9999px",t.setAttribute("readonly",""),document.body.appendChild(t);try{t.select(),t.setSelectionRange(0,e.length);const r=document.execCommand("copy");return document.body.removeChild(t),r}catch{return t.parentNode?.removeChild(t),!1}}dispatchCopyEvent(e,t,r){if(hr(e.me)){const n=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!1});e.me.dispatchEvent(n)}}};return ba(t,"CopyCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Copy text or element content to the clipboard",syntax:["copy <source>","copy <source> to clipboard"],examples:['copy "Hello World"',"copy #code-snippet","copy my textContent"],sideEffects:["clipboard-write","custom-events"],category:"utility",compatibility:"lokascript-extension"}),va(t,n),i=t})());const zo=Pa((()=>{let e,t,r=[Oa({name:"pick"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n=e.modifiers?.variant,i=n?.value;if("first"===i||"last"===i){const n=await t.evaluate(e.args[0],r),a=await t.evaluate(e.modifiers.count,r);if(!Array.isArray(n))throw Error(`pick ${i}: source must be an array, got ${typeof n}`);if("number"!=typeof a||!Number.isFinite(a))throw Error(`pick ${i}: count must be a number, got ${typeof a}`);return{variant:i,array:n,count:a}}if("random"===i){const n=await t.evaluate(e.args[0],r);if(!Array.isArray(n))throw Error("pick random: source must be an array");let i;if(e.modifiers.count){const n=await t.evaluate(e.modifiers.count,r);if("number"!=typeof n||!Number.isFinite(n))throw Error("pick random: count must be a number, got "+typeof n);i=n}return{variant:"random",array:n,count:i}}if("range"===i){const n=await t.evaluate(e.args[0],r);if(!Array.isArray(n)&&"string"!=typeof n)throw Error("pick items: source must be an array or string");const i=e.modifiers.rangeStart,a="start"===i?.value?"start":await t.evaluate(e.modifiers.rangeStart,r),s="start"===a?"start":Number(a);let o;if(e.modifiers.rangeEnd)if("end"===e.modifiers.rangeEnd.value)o="end";else{const n=await t.evaluate(e.modifiers.rangeEnd,r);o=Number(n)}const l=e.modifiers.rangeMode;return{variant:"range",array:n,rangeStart:s,rangeEnd:o,rangeMode:l?.value??"default"}}if("match"===i||"matches"===i){const n=await t.evaluate(e.args[0],r);if("string"!=typeof n)throw Error(`pick ${i}: source must be a string, got ${typeof n}`);const a=await t.evaluate(e.modifiers.regex,r),s="string"==typeof a?a:a+"",o=e.modifiers.flags,l=o?.value;return{variant:i,source:n,regex:s,flags:l}}if(e.modifiers?.from){const n=await t.evaluate(e.modifiers.from,r);if(!Array.isArray(n))throw Error("pick from requires an array");if(0===n.length)throw Error("Cannot pick from empty array");return{variant:"random",array:n}}if(0===e.args.length)throw Error("pick command requires items to choose from");return{variant:"random",items:await Promise.all(e.args.map(e=>t.evaluate(e,r)))}}async execute(e,t){const r=e.variant??"random";if("first"===r){const r=e.array??[],n=r.slice(0,e.count??0);return Object.assign(t,{it:n}),{selectedItem:n,sourceLength:r.length,sourceType:"array",variant:"first"}}if("last"===r){const r=e.array??[],n=e.count??0,i=n>0?r.slice(-n):[];return Object.assign(t,{it:i}),{selectedItem:i,sourceLength:r.length,sourceType:"array",variant:"last"}}if("range"===r){const r=e.array??[];let n="start"===e.rangeStart?0:e.rangeStart??0,i=void 0===e.rangeEnd?n+1:"end"===e.rangeEnd?r.length:e.rangeEnd;"inclusive"===e.rangeMode?i++:"exclusive"===e.rangeMode&&n++;const a=r.slice(n,i);return Object.assign(t,{it:a}),{selectedItem:a,sourceLength:r.length,sourceType:"array",variant:"range"}}if("match"===r){const r=e.source??"",n=RegExp(e.regex??"",e.flags).exec(r);return Object.assign(t,{it:n}),{selectedItem:n,sourceLength:r.length,sourceType:"string",variant:"match"}}if("matches"===r){const r=e.source??"",n=e.flags??"g",i=RegExp(e.regex??"",n.includes("g")?n:"g"+n),a=Array.from(r.matchAll(i));return Object.assign(t,{it:a}),{selectedItem:a,sourceLength:r.length,sourceType:"string",variant:"matches"}}const n=e.items??e.array??[];if(0===n.length)throw Error("Cannot pick from empty collection");if(void 0===e.count){const r=Math.floor(Math.random()*n.length),i=n[r];return Object.assign(t,{it:i}),{selectedItem:i,selectedIndex:r,sourceLength:n.length,sourceType:e.items?"items":"array",variant:"random"}}const i=n.slice(),a=[];for(let t=0;e.count>t&&i.length>0;t++){const e=Math.floor(Math.random()*i.length);a.push(i.splice(e,1)[0])}return Object.assign(t,{it:a}),{selectedItem:a,sourceLength:n.length,sourceType:e.items?"items":"array",variant:"random"}}};return ba(t,"PickCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Select from a collection (first/last/random/range/regex match)",syntax:["pick first <count> of <expr>","pick last <count> of <expr>","pick random [<count>] of <expr>","pick items <i> to <j> of <expr>","pick match of <regex> from <expr>","pick from <array>","pick <item1>, <item2>, ..."],examples:["pick first 3 of items","pick last 2 of items","pick random 2 of items","pick items 1 to 3 of items",'pick match of "[0-9]+" from text',"pick from colors",'pick "red", "green", "blue"'],sideEffects:["random-selection"],category:"utility",compatibility:"standard"}),va(t,n),i=t})());const Vo=Pa((()=>{let e,t,r=[Oa({name:"beep"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return 0===e.args.length?{expressions:[]}:{expressions:await Promise.all(e.args.map(e=>t.evaluate(e,r)))}}async execute(e,t){const r=e.expressions||[];if(0===r.length)return this.debugContext(t),{expressionCount:0,debugged:!0,outputs:[]};const n=[];console.group("\ud83d\udd14 beep! Debug Output");for(const e of r){const t=this.debugExpression(e);n.push(t),console.log("Value:",e),console.log("Type:",t.type),console.log("Representation:",t.representation),console.log("---")}return console.groupEnd(),{expressionCount:r.length,debugged:!0,outputs:n}}debugContext(e){console.group("\ud83d\udd14 beep! Context Debug"),console.log("me:",e.me),console.log("it:",e.it),console.log("you:",e.you),console.log("locals:",e.locals),console.log("globals:",e.globals),console.log("variables:",e.variables),console.groupEnd()}debugExpression(e){return{value:e,type:this.getType(e),representation:this.getRepresentation(e)}}getType(e){return null===e?"null":void 0===e?"undefined":Array.isArray(e)?"array":hr(e)?"HTMLElement":e instanceof Element?"Element":e instanceof Node?"Node":e instanceof Error?"Error":e instanceof Date?"Date":e instanceof RegExp?"RegExp":typeof e}getRepresentation(e){if(null===e)return"null";if(void 0===e)return"undefined";if(Array.isArray(e))return`Array(${e.length}) [${e.slice(0,3).map(e=>this.getRepresentation(e)).join(", ")}${e.length>3?"...":""}]`;if(hr(e)){const t=e;return`<${t.tagName.toLowerCase()}${t.id?"#"+t.id:""}${t.className?"."+t.className.split(" ").join("."):""}/>`}if(e instanceof Error)return"Error: "+e.message;if("string"==typeof e)return e.length>50?`"${e.substring(0,47)}..."`:`"${e}"`;if("object"==typeof e)try{const t=Object.keys(e);return`Object {${t.slice(0,3).join(", ")}${t.length>3?"...":""}}`}catch{return"[Object]"}return e+""}};return ba(t,"BeepCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Debug output for expressions with type information",syntax:["beep!","beep! <expression>","beep! <expression>, <expression>, ..."],examples:["beep!","beep! myValue","beep! me.id, me.className"],sideEffects:["console-output","debugging"],category:"utility",compatibility:"lokascript-extension"}),va(t,n),i=t})()),Ho=Pa((()=>{let e,t,r=[Oa({name:"breakpoint"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{}}async execute(e,t){}validate(e){return"object"==typeof e&&null!==e}};return ba(t,"BreakpointCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Drop into the debugger (emits a debugger; statement)",syntax:["breakpoint"],examples:["breakpoint","on click breakpoint"],sideEffects:["debugging"],category:"utility",compatibility:"standard"}),va(t,n),i=t})()),Bo=Pa((()=>{let e,t,r=[Oa({name:"js"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){let n,i;if(0===e.args.length)throw Error("js command requires JavaScript code");const a=e.args[0],s=e.args[1];if(a&&"literal"===a.type&&"string"==typeof a.value)n=a.value;else{if(!a||void 0===a.value)throw Error("js command requires JavaScript code");n=a.value+""}s&&"arrayLiteral"===s.type&&Array.isArray(s.elements)&&(i=s.elements.map(e=>"string"==typeof e.value?e.value:e.value+"").filter(e=>e&&e.length>0));const o={code:n};return i&&i.length>0&&(o.parameters=i),o}async execute(e,t){const{code:r,parameters:n=[]}=e;if(!r.trim())return{result:void 0,executed:!1,codeLength:r.length,parameters:n,preserveArrayResult:!0};try{const e=this.createExecutionContext(t,n),i=Function(...Object.keys(e),r),a=await i(...Object.values(e));return void 0!==a&&Object.assign(t,{it:a}),{result:a,executed:!0,codeLength:r.length,parameters:n,preserveArrayResult:!0}}catch(e){throw Error("JavaScript execution failed: "+(e instanceof Error?e.message:"Unknown error"))}}createExecutionContext(e,t){return{me:e.me,it:e.it,you:e.you,locals:e.locals,globals:e.globals,variables:e.variables,console:console,document:"undefined"!=typeof document?document:void 0,window:"undefined"!=typeof window?window:void 0,...t.reduce((t,r)=>{let n=e.locals?.get(r);return void 0===n&&(n=e.variables?.get(r)),void 0===n&&(n=e[r]),t[r]=n,t},{})}}};return ba(t,"JsCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Execute inline JavaScript code with access to hyperscript context",syntax:["js <code> end","js(param1, param2) <code> end"],examples:['js console.log("Hello") end',"js(x, y) return x + y end",'js me.style.color = "red" end'],sideEffects:["code-execution","data-mutation"],category:"advanced",compatibility:"standard"}),va(t,n),i=t})()),Wo=Pa((()=>{let e,t,r=[Oa({name:"async"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(1>e.args.length)throw Error("async command requires at least one command to execute");return{commands:e.args}}async execute(e,t){const{commands:r}=e,n=Date.now();try{const e=await this.executeCommandsAsync(t,r),i=Date.now()-n;return e.length>0&&Object.assign(t,{it:e[e.length-1]}),{commandCount:r.length,results:e,executed:!0,duration:i}}catch(e){throw Error("Async command execution failed: "+(e instanceof Error?e.message:"Unknown error"))}}async executeCommandsAsync(e,t){const r=[];for(let n=0;t.length>n;n++){const i=t[n];try{const t=await this.executeCommand(i,e);r.push(t),Object.assign(e,{it:t})}catch(e){const r=this.getCommandName(i);throw Error(`Command '${r}' (${n+1}/${t.length}) failed: ${e instanceof Error?e.message:"Unknown error"}`)}}return r}async executeCommand(e,t){if("function"==typeof e)return await e(t);if(e&&"object"==typeof e&&"execute"in e&&"function"==typeof e.execute)return await e.execute(t);throw Error("Invalid command: must be a function or object with execute method")}getCommandName(e){return"function"==typeof e?e.name||"anonymous function":e&&"object"==typeof e?e.name||"unnamed command":"unknown"}};return ba(t,"AsyncCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Execute commands asynchronously without blocking",syntax:["async <command> [<command> ...]"],examples:["async command1 command2","async fetchData processData","async animateIn showContent"],sideEffects:["async-execution"],category:"advanced",compatibility:"lokascript-extension"}),va(t,n),i=t})()),Do=Pa((()=>{let e,t,r=[Oa({name:"go"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return e.args&&0!==e.args.length?{args:await Promise.all(e.args.map(e=>t.evaluate(e,r)))}:{args:[]}}async execute(e,t){const{args:r}=e;if(0===r.length)throw Error("Go command requires arguments");if("string"==typeof r[0]&&"back"===r[0].toLowerCase())return await this.goBack(),{result:"back",type:"back"};if(this.isUrlNavigation(r))return{result:await this.navigateToUrl(r,t),type:"url"};const n=this.findBareUrl(r);return null!==n?{result:await this.navigateToBareUrl(n,r),type:"url"}:{result:await this.scrollToElement(r,t),type:"scroll"}}isUrlNavigation(e){return-1!==e.findIndex(e=>"url"===e)}isBareUrl(e){return!!e.startsWith("/")||/^[a-z][a-z0-9+.-]*:/i.test(e)}findBareUrl(e){for(const t of e)if("to"!==t&&"the"!==t)return"string"==typeof t&&this.isBareUrl(t)?t:null;return null}async navigateToBareUrl(e,t){if(t.includes("new")&&t.includes("window")){if("undefined"!=typeof window&&window.open){const t=window.open(e,"_blank");t?.focus&&t.focus()}}else e.startsWith("#")?"undefined"!=typeof window&&(window.location.hash=e):"undefined"!=typeof window&&(window.location.assign?.(e)??(window.location.href=e));return e}async goBack(){if("undefined"==typeof window||!window.history)throw Error("Browser history API not available");window.history.back()}async navigateToUrl(e,t){const r=e.findIndex(e=>"url"===e),n=e[r+1];if(!n)throw Error('URL is required after "url" keyword');const i="string"==typeof n?n:n+"",a=e.includes("new")&&e.includes("window");if(!this.isValidUrl(i))throw Error(`Invalid URL: "${i}"`);if(a){if("undefined"!=typeof window&&window.open){const e=window.open(i,"_blank");e?.focus&&e.focus()}}else i.startsWith("#")?"undefined"!=typeof window&&(window.location.hash=i):"undefined"!=typeof window&&(window.location.assign?.(i)??(window.location.href=i));return i}isValidUrl(e){try{return e.startsWith("/")||e.startsWith("#")||new URL(e),!0}catch{return!1}}async scrollToElement(e,t){const r=this.parseScrollPosition(e),n=this.parseScrollTarget(e),i=this.parseScrollOffset(e),a=!e.includes("instantly"),s=this.resolveScrollTarget(n,t);if(!s)throw Error("Target element not found: "+n);if("undefined"!=typeof window){const e=a?"smooth":"instant",t=this.mapVerticalPosition(r.vertical),n=this.mapHorizontalPosition(r.horizontal);if(0!==i){s.scrollIntoView?.({behavior:e,block:t,inline:n});const{x:a,y:o}=this.calculateScrollPosition(s,r,i);window.scrollTo?.({left:a,top:o,behavior:e})}else s.scrollIntoView?.({behavior:e,block:t,inline:n})}return s}mapVerticalPosition(e){return{top:"start",middle:"center",bottom:"end",nearest:"nearest"}[e]||"start"}mapHorizontalPosition(e){return{left:"start",center:"center",right:"end",nearest:"nearest"}[e]||"nearest"}parseScrollPosition(e){const t={vertical:"top",horizontal:"nearest"},r=["top","middle","bottom"],n=["left","center","right"];let i=!1,a=!1;for(const s of e)"string"==typeof s&&(r.includes(s)?(t.vertical=s,i=!0):n.includes(s)&&(t.horizontal=s,a=!0));return a&&!i&&(t.vertical="nearest"),t}parseScrollTarget(e){const t=e.findIndex(e=>"of"===e);if(-1!==t&&e.length>t+1){let r=e[t+1];return"the"===r&&e.length>t+2&&(r=e[t+2]),r}for(const t of e)if("object"==typeof t&&t&&t.nodeType)return t;const r=["top","middle","bottom","left","center","right","of","the","to","smoothly","instantly"];for(const t of e)if("string"==typeof t&&!r.includes(t)&&(t.startsWith("#")||t.startsWith(".")||t.includes("[")||/^[a-zA-Z][a-zA-Z0-9-]*$/.test(t)))return t;return"body"}parseScrollOffset(e){for(let t=0;e.length>t;t++){const r=e[t];if("string"==typeof r){const e=r.match(/^([+-]?\d+)(px)?$/);if(e)return parseInt(e[1],10)}if(("+"===r||"-"===r)&&e.length>t+1){const n=e[t+1],i="number"==typeof n?n:parseInt((n+"").replace("px",""),10);if(!isNaN(i))return"-"===r?-i:i}}return 0}resolveScrollTarget(e,t){if("object"==typeof e&&e&&e.nodeType)return e;const r="string"==typeof e?e:e+"";if("body"===r&&"undefined"!=typeof document)return document.body;if("html"===r&&"undefined"!=typeof document)return document.documentElement;if("me"===r&&hr(t.me))return t.me;if("it"===r&&hr(t.it))return t.it;if("you"===r&&hr(t.you))return t.you;const n=gr(r,t);if(hr(n))return n;if("undefined"!=typeof document)try{const e=document.querySelector(r);if(e)return e}catch{try{const e=document.getElementsByTagName(r);if(e.length>0)return e[0]}catch{}}return null}calculateScrollPosition(e,t,r){if("undefined"==typeof window||!e.getBoundingClientRect)return{x:0,y:0};const n=e.getBoundingClientRect(),i=window.pageXOffset||document.documentElement?.scrollLeft||0,a=window.pageYOffset||document.documentElement?.scrollTop||0,s=window.innerWidth||800,o=window.innerHeight||600;let l=i,c=a;switch(t.horizontal){case"left":l=n.left+i;break;case"center":l=n.left+i+n.width/2-s/2;break;case"right":l=n.right+i-s}switch(t.vertical){case"top":c=n.top+a+r;break;case"middle":c=n.top+a+n.height/2-o/2+r;break;case"bottom":c=n.bottom+a-o+r}return{x:Math.max(0,l),y:Math.max(0,c)}}};return ba(t,"GoCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=ja({description:"Navigation functionality including URL navigation, element scrolling, and browser history",syntax:["go back","go to url <url> [in new window]","go to [position] [of] <element>"],examples:["go back",'go to url "https://example.com"',"go to top of #header"],sideEffects:["navigation","scrolling"],category:"navigation",compatibility:"standard"}),va(t,n),i=t})());class Fo{constructor(){this.name="install"}get metadata(){return Fo.metadata}async parseInput(e,t,r){if(1>e.args.length)throw Error("install command requires a behavior name");const n=e.args[0];let i,a,s;if(i="identifier"===n?.type&&"string"==typeof n.name?n.name:await t.evaluate(n,r)+"",!/^[A-Z][a-zA-Z0-9_]*$/.test(i))throw Error(`Behavior name must be PascalCase (start with uppercase): "${i}"`);if(e.args.length>=2){const n=await t.evaluate(e.args[1],r);if(n&&"object"==typeof n&&!Array.isArray(n)){a=n;for(const e of Object.keys(a))if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(e))throw Error(`Invalid parameter name: "${e}"`)}}return e.modifiers?.on&&(s=await t.evaluate(e.modifiers.on,r)),{behaviorName:i,parameters:a,target:s}}async execute(e,t){const{behaviorName:r,parameters:n={},target:i}=e;try{const e=this.resolveTarget(i,t);if(0===e.length)throw Error("No target elements found to install behavior on");if(!this.behaviorExists(r,t))throw Error(`Behavior "${r}" is not defined. Define it using the 'behavior' keyword before installing.`);const a=[];for(const i of e){const e=await this.installBehavior(r,i,n,t);a.push(e)}return{success:!0,behaviorName:r,installedCount:a.length,instances:a}}catch(e){throw Error(`Failed to install behavior "${r}": ${e instanceof Error?e.message:e+""}`)}}resolveTarget(e,t){if(null==e){const e=t.me||t.locals.get("me");if(hr(e))return[e];throw Error('No target specified and "me" is not available in context')}if(hr(e))return[e];if(Array.isArray(e)){const t=e.filter(e=>hr(e));if(0===t.length)throw Error("Target array contains no valid HTMLElements");return t}if("string"==typeof e){if("me"===e){const e=t.me||t.locals.get("me");if(hr(e))return[e];throw Error('"me" is not available in context')}if("undefined"!=typeof document){const t=document.querySelectorAll(e),r=Array.from(t).filter(e=>hr(e));if(0===r.length)throw Error(`No elements found matching selector: "${e}"`);return r}throw Error("document is not available (not in browser environment)")}if(e&&"object"==typeof e&&"length"in e){const t=Array.from(e).filter(e=>hr(e));if(0===t.length)throw Error("Target collection contains no valid HTMLElements");return t}if("object"==typeof e&&"element"in e){const t=e.element;if(hr(t))return[t]}throw Error("Cannot resolve target to HTMLElement(s): "+e)}behaviorExists(e,t){const r=t.locals.get("_behaviors");if(r&&"object"==typeof r){const t=r;if(t.has(e))return!0;if(t.resolve&&t.resolve(e))return!0}if("undefined"!=typeof globalThis){const t=globalThis._hyperscript;if(t?.behaviors){if(t.behaviors.has(e))return!0;if(t.behaviors.resolve&&t.behaviors.resolve(e))return!0}}return!1}async installBehavior(e,t,r,n){const i=n.locals.get("_behaviors");if(i&&"object"==typeof i){const n=i;if(n.install&&"function"==typeof n.install)return await n.install(e,t,r)}if("undefined"!=typeof globalThis){const n=globalThis._hyperscript;if(n?.behaviors?.install)return await n.behaviors.install(e,t,r)}throw Error("Behavior system not available in context")}}function Uo(e){return hr(e)?e:e+""}Fo.metadata=ja({description:"Install a behavior on an element with optional parameters",syntax:["install <BehaviorName>","install <BehaviorName> on <element>","install <BehaviorName>(param: value)","install <BehaviorName>(param: value) on <element>"],examples:["install Removable","install Draggable on #box",'install Tooltip(text: "Help", position: "top")','install Sortable(axis: "y") on .list',"install MyBehavior(foo: 42) on the first <div/>"],category:"behaviors",compatibility:"standard",sideEffects:["behavior-installation","element-modification"]});class Ko{constructor(e){this.position=e}concat(e,t){const r=null==e?"":e+"",n=t+"";return"append"===this.position?r+n:n+r}pushInto(e,t){return"append"===this.position?e.push(t):e.unshift(t),e}async parseInput(e,t,r){if(!e.args?.length)throw Error(this.name+" requires content");const n=await t.evaluate(e.args[0],r),i=e.modifiers?.to??e.target;if(!i)return{kind:"implicit",content:n};const a=await so(i,t,r,{scopeElements:async()=>hr(r.me)?[r.me]:[],selectorSource:!0,bareReference:!0});if(a)return function(e,t){switch(e.kind){case"selector":return{kind:"selector",selector:e.selector,content:t};case"attribute":return{kind:"attribute",elements:e.elements,name:e.name,content:t};case"property":return{kind:"property",property:e.target,content:t};case"variable":return{kind:"variable",name:e.name,scope:e.scope,content:t};default:throw Error(`unrequested write-target rung '${e.kind}'`)}}(a,n);const s=await t.evaluate(i,r),o=function(e){if(hr(e))return[e];if(Array.isArray(e)&&e.length>0&&e.every(e=>hr(e)))return e;if(e&&"object"==typeof e&&"number"==typeof e.length&&"function"==typeof e.item){const t=Array.from(e).filter(e=>hr(e));return t.length?t:null}return null}(s);return o?{kind:"elements",elements:o,content:n}:{kind:"value",target:s,content:n}}async execute(e,t){switch(e.kind){case"selector":return this.done(t,this.insertIntoSelector(e.selector,e.content));case"elements":return this.done(t,this.insertIntoEach(e.elements,e.content));case"attribute":{for(const t of e.elements)t.setAttribute(e.name,this.concat(t.getAttribute(e.name),e.content));const r=e.elements[0]?.getAttribute(e.name)??this.concat(null,e.content);return Object.assign(t,{it:r}),{target:"@"+e.name,value:r,targetType:"attribute"}}case"property":{const r=vs(e.property),n=this.combineValue(r,e.content);return hr(r)||bs(e.property,n),Object.assign(t,{it:n}),{target:e.property.element,value:n,targetType:"property"}}case"variable":return this.executeVariable(e,t);case"value":{const r=this.combineValue(e.target,e.content,!0);return Object.assign(t,{it:r}),{target:e.target,value:r,targetType:this.targetTypeOf(e.target)}}case"implicit":return this.execImplicit(t,e.content)}}insertIntoSelector(e,t){return this.insertIntoEach(kr(e),t)}insertIntoEach(e,t){const r=Uo(t);for(const t of e)Ga(t,r,this.position);return e}combineValue(e,t,r=!1){if(Array.isArray(e))return this.pushInto(e,t);if(e instanceof Set)return e.add(t),e;if(hr(e))return Ga(e,Uo(t),this.position),e;if(r&&null!=e&&"string"!=typeof e&&"number"!=typeof e)throw Error(`Unable to ${this.name} a value!`);return this.concat(e,t)}targetTypeOf(e){return Array.isArray(e)?"array":e instanceof Set?"set":hr(e)?"element":"result"}executeVariable(e,t){if("me"===e.name||"you"===e.name){const r="me"===e.name?t.me:t.you;if(hr(r))return Ga(r,Uo(e.content),this.position),Object.assign(t,{it:r}),{target:r,value:r,targetType:"element"}}if("it"===e.name||"result"===e.name)return this.execImplicit(t,e.content);const r=gr(e.name,t,e.scope),n=this.combineValue(r,e.content);return Array.isArray(r)||r instanceof Set||hr(r)||vr(e.name,n,t,e.scope),Object.assign(t,{it:n}),{target:e.name,value:n,targetType:this.targetTypeOf(r)}}execImplicit(e,t){const r=e.it??e.result,n=this.combineValue(r,t);return Object.assign(e,{it:n,result:n}),{target:"result",value:n,targetType:this.targetTypeOf(r)}}done(e,t){const r=1===t.length?t[0]:t;return Object.assign(e,{it:r}),{target:r,value:r,targetType:"element"}}}const Zo=Pa((()=>{let e,t,r=[Oa({name:"append"})],n=[],i=Ko;var a=t=class extends i{get metadata(){return a.metadata}constructor(){super("append")}};return ba(t,"AppendCommand"),(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),a=t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),t.metadata=ja({description:"Add content to the end of a string, array, Set, or HTML element",syntax:["append <content>","append <content> to <target>"],examples:['append "Hello"','append "World" to greeting',"append item to myArray",'append "<p>New</p>" to #content','append " (edited)" to #title\'s textContent'],sideEffects:["data-mutation","dom-mutation"],category:"content",compatibility:"standard"}),va(t,n),a=t})()),Xo=Pa((()=>{let e,t,r=[Oa({name:"prepend"})],n=[],i=Ko;var a=t=class extends i{get metadata(){return a.metadata}constructor(){super("prepend")}};return ba(t,"PrependCommand"),(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;ga(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),a=t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),t.metadata=ja({description:"Add content to the start of a string, array, Set, or HTML element",syntax:["prepend <content>","prepend <content> to <target>"],examples:['prepend "Hello"','prepend "World" to greeting',"prepend item to myArray",'prepend "<p>First</p>" to #content'],sideEffects:["data-mutation","dom-mutation"],category:"content",compatibility:"lokascript-extension"}),va(t,n),a=t})());class Go{constructor(){this.name="render"}get metadata(){return Go.metadata}async parseInput(e,t,r){if(1>e.args.length)throw Error("render command requires a template");const n=await t.evaluate(e.args[0],r);let i;if(e.args.length>=3&&"with"===await t.evaluate(e.args[1],r)){const n=await t.evaluate(e.args[2],r);n&&"object"==typeof n&&(i=n)}if(!i&&e.modifiers?.with){const n=await t.evaluate(e.modifiers.with,r);n&&"object"==typeof n&&(i=n)}return{template:n,variables:i}}async execute(e,t){const{template:r,variables:n={}}=e,i=this.extractTemplateContent(r,t),a=this.createTemplateContext(t,n),s=[],o=await this.processTemplate(i,a,s),l=this.createDOMElement(o);return Object.assign(t,{it:l}),{element:l,rendered:o,directivesProcessed:s}}extractTemplateContent(e,t){if(e instanceof HTMLTemplateElement)return e.innerHTML;if("string"==typeof e){let r=e;if(!r.includes("<")&&!r.includes("$")){const e=this.resolveVariable(r,t);if(e instanceof HTMLTemplateElement)return e.innerHTML;"string"==typeof e&&(r=e)}const n=r.match(/<template[^>]*>([\s\S]*?)<\/template>/i);return n?n[1]:r}if(e&&"object"==typeof e&&"innerHTML"in e)return e.innerHTML;throw Error("Invalid template format")}createTemplateContext(e,t){return{...e,locals:new Map([...Array.from(e.locals.entries()),...Object.entries(t)])}}async processTemplate(e,t,r){const n=e.split("\n"),i=[];let a=0;for(;n.length>a;){const e=n[a].trim();if(e.startsWith("@repeat ")){const{nextIndex:e,rendered:s}=await this.processRepeatDirective(n,a,t);i.push(s),a=e,r.push("@repeat")}else if(e.startsWith("@if ")){const{nextIndex:e,rendered:s}=await this.processIfDirective(n,a,t,r);i.push(s),a=e,r.push("@if")}else if("@else"===e||"@end"===e)a++;else{const r=this.processVariableInterpolation(e,t);i.push(r),a++}}return i.join("\n")}async processRepeatDirective(e,t,r){const n=e[t].trim(),i=n.match(/^@repeat\s+in\s+(.+)$/);if(!i)throw Error("Invalid @repeat syntax: "+n);const a=this.evaluateExpression(i[1],r),{endIndex:s,blockContent:o}=this.extractDirectiveBlock(e,t+1),l=[];if(Array.isArray(a))for(const e of a){const t={...r,locals:new Map([...r.locals.entries(),["it",e]])},n=await this.processTemplate(o.join("\n"),t,[]);l.push(n)}return{nextIndex:s+1,rendered:l.join("\n")}}async processIfDirective(e,t,r,n){const i=e[t].trim(),a=i.match(/^@if\s+(.+)$/);if(!a)throw Error("Invalid @if syntax: "+i);const s=!!this.evaluateExpression(a[1],r),{endIndex:o,blockContent:l,elseContent:c}=this.extractIfElseBlock(e,t+1);let u="";return s?u=await this.processTemplate(l.join("\n"),r,[]):c.length>0&&(u=await this.processTemplate(c.join("\n"),r,[]),n.push("@else")),{nextIndex:o+1,rendered:u}}extractDirectiveBlock(e,t){const r=[];let n=1,i=t;for(;e.length>i&&n>0;){const t=e[i].trim();t.startsWith("@repeat ")||t.startsWith("@if ")?(n++,r.push(e[i])):"@end"===t?(n--,n>0&&r.push(e[i])):r.push(e[i]),i++}return{endIndex:i-1,blockContent:r}}extractIfElseBlock(e,t){const r=[],n=[];let i=1,a=t,s=!1;for(;e.length>a&&i>0;){const t=e[a].trim();if(t.startsWith("@if "))i++;else{if("@else"===t&&1===i){s=!0,a++;continue}if("@end"===t&&(i--,0===i))break}s?n.push(e[a]):r.push(e[a]),a++}return{endIndex:a,blockContent:r,elseContent:n}}processVariableInterpolation(e,t){return e.replace(/\$\{([^}]+)\}/g,(e,r)=>{try{const e=r.trim();if(e.startsWith("unescaped ")){const r=e.substring(10).trim();return(this.evaluateExpression(r,t)||"")+""}const n=this.evaluateExpression(e,t);return this.escapeHtml((n||"")+"")}catch(t){return de(`render: template interpolation error for ${r}:`,t),e}})}evaluateExpression(e,t){if("true"===e)return!0;if("false"===e)return!1;if("null"===e)return null;if("undefined"===e)return;const r=Number(e);if(!isNaN(r)&&""!==e.trim())return r;if(e.startsWith("[")&&e.endsWith("]"))try{return JSON.parse(e)}catch{}if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);if(e.includes(".")){const r=e.split(".");let n=this.resolveVariable(r[0],t);for(let e=1;r.length>e&&null!=n;e++){if("object"!=typeof n||null===n)return;n=n[r[e]]}return n}return this.resolveVariable(e,t)}resolveVariable(e,t){return t.locals?.has(e)?t.locals.get(e):"me"===e?t.me:"it"===e?t.it??t.result:"you"===e?t.you:"result"===e?t.result??t.it:t.globals?.has(e)?t.globals.get(e):void 0}escapeHtml(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}createDOMElement(e){if("undefined"==typeof document)return null;const t=document.createElement("div");return t.innerHTML=e,1===t.children.length?t.firstElementChild:t}}Go.metadata=ja({description:"Render templates with @if, @else, and @repeat directives",syntax:["render <template>","render <template> with <variables>","render <template> with (key: value, ...)"],examples:["render myTemplate",'render myTemplate with (name: "Alice")','render "<template>Hello ${name}!</template>" with (name: "World")',"render template with (items: data)"],category:"templates",compatibility:"standard",sideEffects:["dom-creation","template-execution"]});class Jo{constructor(){this.name="pseudo-command"}get metadata(){return Jo.metadata}async parseInput(e,t,r){if(1===e.args.length&&"objectLiteral"===e.args[0].type){const n=e.args[0].properties||[];let i,a,s="",o=[];for(const e of n){const n=e.value;switch(e.key?.name||e.key?.value){case"methodName":s=n?.value||await t.evaluate(n,r)+"";break;case"methodArgs":"arrayLiteral"===n?.type&&n.elements?o=await Promise.all(n.elements.map(e=>t.evaluate(e,r))):"literal"===n?.type&&Array.isArray(n.value)&&(o=await Promise.all(n.value.map(e=>t.evaluate(e,r))));break;case"preposition":const e=n?.value;e&&"null"!==e&&(i=e);break;case"target":case"targetExpression":a=await t.evaluate(n,r)}}if(!s)throw Error("pseudo-command requires method name");if(null==a)throw Error("pseudo-command requires a target expression");return{methodName:s,methodArgs:o,preposition:i,targetExpression:a}}if(2>e.args.length)throw Error("pseudo-command requires method name and target expression");const n=await t.evaluate(e.args[0],r)+"",i=Array.isArray(e.args[1])?await Promise.all(e.args[1].map(e=>t.evaluate(e,r))):[];let a,s;const o=["from","on","with","into","at","to"];for(const n of o)if(e.modifiers?.[n]){s=n,a=await t.evaluate(e.modifiers[n],r);break}if(a||3>e.args.length||(a=await t.evaluate(e.args[2],r)),!a)throw Error("pseudo-command requires a target expression");return{methodName:n,methodArgs:i,preposition:s,targetExpression:a}}async execute(e,t){const{methodName:r,methodArgs:n,targetExpression:i}=e;try{const e=await this.resolveTarget(i,t);if(null==e)throw Error("Target expression resolved to "+e);const a=this.resolveMethod(e,r);if(!a)throw Error(`Method "${r}" not found on target object`);if("function"!=typeof a)throw Error(`"${r}" is not a function (it's a ${typeof a})`);const s=await this.executeMethod(a,e,n);return t.locals.set("result",s),Object.assign(t,{it:s}),{result:s,methodName:r,target:e}}catch(e){throw Error("Pseudo-command failed: "+(e instanceof Error?e.message:e+""))}}async resolveTarget(e,t){return"object"==typeof e&&null!==e?e:"string"==typeof e?t.locals.has(e)?t.locals.get(e):t.variables?.has(e)?t.variables.get(e):t.globals.has(e)?t.globals.get(e):"me"===e&&t.me?t.me:"it"===e&&t.it?t.it:"document"===e?"undefined"!=typeof document?document:null:"window"===e?"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:null:this.resolvePropertyPath(e,t):e}resolvePropertyPath(e,t){const r=e.split(".");let n="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:null;t.locals.has(r[0])?(n=t.locals.get(r[0]),r.shift()):t.variables?.has(r[0])?(n=t.variables.get(r[0]),r.shift()):t.globals.has(r[0])&&(n=t.globals.get(r[0]),r.shift());for(const e of r){if(null==n)return null;n=n[e]}return n}resolveMethod(e,t){if(!e)return null;if(t in e)return e[t];const r=t.split(".");let n=e;for(let e=0;r.length>e;e++){const t=r[e];if(null==n)return null;if(!(t in n))return null;if(n=n[t],e===r.length-1&&"function"==typeof n)return n}return null}async executeMethod(e,t,r){try{const n=e.apply(t,r);return n&&"object"==typeof n&&"then"in n?await n:n}catch(e){throw Error("Method execution failed: "+(e instanceof Error?e.message:e+""))}}}Jo.metadata=ja({description:"Treat a method on an object as a top-level command",syntax:["<method>(<args>) [(to|on|with|into|from|at)] <expression>"],examples:['getElementById("d1") from the document',"reload() the location of the window",'setAttribute("foo", "bar") on me',"foo() on me"],category:"execution",compatibility:"standard",sideEffects:["method-execution"]});var Yo={to:"destination",into:"destination",from:"source",with:"style",by:"quantity",as:"method",on:"event",over:"duration",for:"duration"},Qo={set:"destination",on:"event",trigger:"event",send:"event",wait:"duration",fetch:"source",get:"source",if:"condition",unless:"condition",while:"condition",repeat:"loopType",go:"destination",scroll:"destination",tell:"destination",default:"destination",swap:"destination",bind:"destination"},el=new Set(["to","from","into","with","at","in","of","as","by","before","after","without"]),tl=new Set(["add","append","async","beep","blur","break","breakpoint","call","clear","close","continue","decrement","default","empty","exit","fetch","focus","for","get","go","halt","hide","if","increment","install","js","log","make","measure","morph","open","pick","process","push","put","remove","render","repeat","replace","reset","return","select","send","set","settle","show","swap","take","tell","throw","toggle","transition","trigger","unless","wait","live","bind","eventsource","socket","worker","intercept"]),rl=new Set(["then","else","end","and","or","not","if","unless","for","while","until","forever","times","each","index","in","to","from","into","with","without","of","at","by","as","matches","contains","is","exists","on","when","every","event","init","def","behavior","global","local","the","a","an","first","last","start","before","after"]),nl=new Set(["click","dblclick","mousedown","mouseup","mouseenter","mouseleave","mouseover","mouseout","mousemove","keydown","keyup","keypress","focus","blur","change","input","submit","reset","load","unload","resize","scroll","touchstart","touchend","touchmove","touchcancel","dragstart","dragend","dragenter","dragleave","dragover","drop","contextmenu","wheel","pointerdown","pointerup","pointermove","ms","s"]),il=new Set(["and","or","not","is","exists","matches","contains","then","else"]),al=new Set(["true","false","null","undefined","it","me","my","result"]),sl=new Set(["first","last","next","previous","prev","at","random","closest","parent","children","within","no","empty","some","starts with","ends with"]),ol=new Set(["if","unless","when","where","\u3082\u3057","\u6642\u306b","\u3068\u304d\u306b","\u3069\u3053\u3067","\u5982\u679c","\u5f53","\u0625\u0630\u0627","\u0639\u0646\u062f\u0645\u0627","\u062d\u064a\u062b","si","cuando","donde","wenn","wann","wo","quand","lorsque","o\u00f9","quando","onde","e\u011fer","zaman","nerede","ketika","saat","dimana","\ub54c","\uc5b4\ub514\uc11c","maypi","wakati","wapi"]),ll=new Set(["then","\u305d\u308c\u304b\u3089","\u90a3\u4e48","\u062b\u0645","entonces","alors","dann","sonra","lalu","chayqa","kisha"]);function cl(e,t,r={}){const{allowEnglishFallback:n=!0}=r,i=new Map,a=new Map,s=new Map,o=new Map,l=new Map,c=new Map,u=new Map,d=new Map,m=new Map,p=new Map;function h(e,t,r=!1){for(const[n,i]of Object.entries(e)){const e=i.toLowerCase();t.set(e,n.toLowerCase()),!r&&m.has(e)||m.set(e,n.toLowerCase()),p.set(n.toLowerCase(),i.toLowerCase())}}e.commands&&h(e.commands,i,!0),e.logical&&h(e.logical,o,!0),e.events&&h(e.events,s),e.values&&h(e.values,c),e.temporal&&h(e.temporal,l),e.modifiers&&h(e.modifiers,a),e.attributes&&h(e.attributes,u),e.expressions&&h(e.expressions,d);const f=new Set(i.keys()),y=new Set(m.keys());if(n){for(const e of tl)f.add(e);for(const e of rl)y.add(e);for(const e of nl)y.add(e)}return{locale:t,resolve(e){const t=e.toLowerCase(),r=m.get(t);if(void 0!==r)return r;if(n){if(tl.has(t)||rl.has(t))return t;if(nl.has(t))return t}},isCommand(e){const t=e.toLowerCase();return!!i.has(t)||!(!n||!tl.has(t))},isKeyword(e){const t=e.toLowerCase();return!!(a.has(t)||o.has(t)||l.has(t)||c.has(t))||!(!n||!rl.has(t))},isEvent(e){const t=e.toLowerCase();return!!s.has(t)||!!nl.has(t)},isModifier(e){const t=e.toLowerCase();return a.has(t)||n&&el.has(t)},isLogical(e){const t=e.toLowerCase();return o.has(t)||n&&il.has(t)},isValue(e){const t=e.toLowerCase();return c.has(t)||n&&al.has(t)},isExpression(e){const t=e.toLowerCase();return d.has(t)||n&&sl.has(t)},getCommands:()=>Array.from(f),getKeywords:()=>Array.from(y),toLocale:e=>p.get(e.toLowerCase())}}function ul(){return{locale:"en",resolve(e){const t=e.toLowerCase();if(tl.has(t)||rl.has(t)||nl.has(t))return t},isCommand:e=>tl.has(e.toLowerCase()),isKeyword:e=>rl.has(e.toLowerCase()),isEvent:e=>nl.has(e.toLowerCase()),isModifier:e=>el.has(e.toLowerCase()),isLogical:e=>il.has(e.toLowerCase()),isValue:e=>al.has(e.toLowerCase()),isExpression:e=>sl.has(e.toLowerCase()),getCommands:()=>Array.from(tl),getKeywords:()=>Array.from(rl),toLocale:e=>e.toLowerCase()}}var dl={commands:{on:"en",tell:"decir",trigger:"disparar",send:"enviar",take:"tomar",put:"poner",set:"establecer",get:"obtener",add:"agregar",remove:"quitar",toggle:"alternar",hide:"ocultar",show:"mostrar",if:"si",unless:"menos",repeat:"repetir",for:"para",while:"mientras",until:"hasta",continue:"continuar",break:"romper",halt:"detener",wait:"esperar",fetch:"buscar",call:"llamar",return:"retornar",make:"hacer",log:"registrar",throw:"lanzar",catch:"atrapar",measure:"medir",transition:"transici\u00f3n",increment:"incrementar",decrement:"decrementar",default:"predeterminar",go:"ir",pushUrl:"pushUrl",replaceUrl:"reemplazarUrl",copy:"copiar",pick:"escoger",beep:"pitido",js:"js",async:"as\u00edncrono",render:"renderizar",swap:"intercambiar",morph:"transformar",settle:"estabilizar",append:"anexar",exit:"salir",install:"instalar",breakpoint:"punto-interrupci\u00f3n",clear:"limpiar",close:"cerrar",open:"abrir",select:"seleccionar",clone:"clonar",prepend:"anteponer"},modifiers:{to:"a",from:"de",into:"en",with:"con",at:"en",in:"en",of:"de",as:"como",by:"por",before:"antes",after:"despu\u00e9s",over:"sobre",under:"bajo",between:"entre",through:"trav\u00e9s",without:"sin"},events:{click:"clic",dblclick:"dobleclic",mouseenter:"rat\u00f3nentrar",mouseleave:"rat\u00f3nsalir",mousedown:"rat\u00f3n abajo",mouseup:"rat\u00f3n arriba",mouseover:"rat\u00f3n encima",mouseout:"rat\u00f3n fuera",mousemove:"rat\u00f3nmover",keydown:"tecla abajo",keyup:"tecla arriba",keypress:"teclapresar",focus:"enfocar",blur:"desenfocar",change:"cambiar",input:"entrada",submit:"env\u00edo",reset:"reiniciar",load:"cargar",unload:"descargar",resize:"redimensionar",scroll:"desplazar",touchstart:"toqueempezar",touchend:"toqueterminar",touchmove:"toquemover",touchcancel:"toquecancelar"},logical:{when:"cuando",where:"donde",and:"y",or:"o",not:"no",is:"es",exists:"existe",matches:"coincide",contains:"contiene",includes:"incluye",equals:"iguala",has:"tiene",have:"tengo",then:"entonces",else:"sino",otherwise:"delocontrario",end:"fin",live:"vivo",changes:"cambia"},temporal:{seconds:"segundos",second:"segundo",milliseconds:"milisegundos",millisecond:"milisegundo",minutes:"minutos",minute:"minuto",hours:"horas",hour:"hora",ms:"ms",s:"s",min:"min",h:"h"},values:{true:"verdadero",false:"falso",null:"nulo",undefined:"indefinido",it:"ello",its:"su",me:"yo",my:"mi",you:"tu",your:"tu",yourself:"ti mismo",myself:"yo mismo",element:"elemento",target:"objetivo",detail:"detalle",event:"evento",window:"ventana",document:"documento",body:"cuerpo",result:"resultado",value:"valor"},attributes:{class:"clase",classes:"clases",style:"estilo",styles:"estilos",attribute:"atributo",attributes:"atributos",property:"propiedad",properties:"propiedades"},expressions:{characters:"caracteres",inclusive:"inclusivo",exclusive:"exclusivo",first:"primero",last:"\u00faltimo",next:"siguiente",previous:"anterior",prev:"ant",at:"en",random:"aleatorio",closest:"cercano",parent:"padre",children:"hijos",within:"dentro",no:"ning\u00fan",empty:"vac\u00edo",some:"alg\u00fan","starts with":"empieza con","ends with":"termina con","ignoring case":"ignorando may\u00fasculas","sorted by":"ordenado por","mapped to":"transformado a","split by":"dividido por","joined by":"unido por"}},ml=cl(dl,"es",{allowEnglishFallback:!0}),pl={commands:{on:"\u3067",tell:"\u4f1d\u3048\u308b",trigger:"\u5f15\u304d\u91d1",send:"\u9001\u308b",take:"\u53d6\u308b",put:"\u7f6e\u304f",set:"\u8a2d\u5b9a",get:"\u53d6\u5f97",add:"\u8ffd\u52a0",remove:"\u524a\u9664",toggle:"\u5207\u308a\u66ff\u3048",hide:"\u96a0\u3059",show:"\u8868\u793a",if:"\u3082\u3057",unless:"\u306a\u3044\u9650\u308a",repeat:"\u7e70\u308a\u8fd4\u3057",for:"\u305f\u3081\u306b",while:"\u306e\u9593",until:"\u307e\u3067",continue:"\u7d9a\u3051\u308b",break:"\u4e2d\u65ad",halt:"\u505c\u6b62",wait:"\u5f85\u3064",fetch:"\u30d5\u30a7\u30c3\u30c1",call:"\u547c\u3073\u51fa\u3057",return:"\u623b\u308b",make:"\u4f5c\u308b",log:"\u8a18\u9332",throw:"\u6295\u3052\u308b",catch:"\u6355\u307e\u3048\u308b",measure:"\u6e2c\u5b9a",transition:"\u9077\u79fb",increment:"\u5897\u52a0",decrement:"\u6e1b\u5c11",default:"\u65e2\u5b9a",go:"\u79fb\u52d5",pushUrl:"URL\u30d7\u30c3\u30b7\u30e5",replaceUrl:"URL\u7f6e\u63db",copy:"\u30b3\u30d4\u30fc",pick:"\u9078\u629e",beep:"\u30d3\u30fc\u30d7",js:"JS\u5b9f\u884c",async:"\u975e\u540c\u671f",render:"\u63cf\u753b",swap:"\u4ea4\u63db",morph:"\u5909\u5f62",settle:"\u5b89\u5b9a",append:"\u672b\u5c3e\u8ffd\u52a0",exit:"\u9000\u51fa",install:"\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb",breakpoint:"\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8",clear:"\u30af\u30ea\u30a2",close:"\u9589\u3058\u308b",open:"\u958b\u304f",select:"\u9078\u3076",clone:"\u8907\u88fd",prepend:"\u5148\u982d\u8ffd\u52a0",socket:"\u30bd\u30b1\u30c3\u30c8"},modifiers:{to:"\u306b",from:"\u304b\u3089",into:"\u3078",with:"\u3068",at:"\u3067",in:"\u306e\u4e2d",of:"\u306e",as:"\u3068\u3057\u3066",by:"\u306b\u3088\u3063\u3066",before:"\u524d\u306b",after:"\u5f8c\u306b",over:"\u4e0a\u306b",under:"\u4e0b\u306b",between:"\u9593\u306b",through:"\u901a\u3057\u3066",without:"\u306a\u3057\u3067"},events:{click:"\u30af\u30ea\u30c3\u30af",dblclick:"dblclick",mousedown:"\u30de\u30a6\u30b9\u62bc\u4e0b",mouseup:"\u30de\u30a6\u30b9\u89e3\u653e",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"\u30de\u30a6\u30b9\u30aa\u30fc\u30d0\u30fc",mouseout:"\u30de\u30a6\u30b9\u30a2\u30a6\u30c8",mousemove:"mousemove",keydown:"\u30ad\u30fc\u30c0\u30a6\u30f3",keyup:"\u30ad\u30fc\u30a2\u30c3\u30d7",keypress:"\u30ad\u30fc\u30d7\u30ec\u30b9",focus:"\u30d5\u30a9\u30fc\u30ab\u30b9",blur:"\u307c\u304b\u3057",change:"\u5909\u66f4",input:"\u5165\u529b",submit:"\u9001\u4fe1",reset:"\u30ea\u30bb\u30c3\u30c8",load:"\u8aad\u307f\u8fbc\u307f",unload:"unload",resize:"\u30b5\u30a4\u30ba\u5909\u66f4",scroll:"\u30b9\u30af\u30ed\u30fc\u30eb",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",touchcancel:"touchcancel"},logical:{when:"\u6642",where:"\u3069\u3053",and:"\u305d\u3057\u3066",or:"\u307e\u305f\u306f",not:"\u3067\u306f\u306a\u3044",is:"\u3067\u3042\u308b",exists:"\u5b58\u5728\u3059\u308b",matches:"\u4e00\u81f4\u3059\u308b",contains:"\u542b\u3080",includes:"\u542b\u3081\u308b",equals:"\u7b49\u3057\u3044",has:"\u3042\u308b",have:"\u3042\u308b",then:"\u305d\u308c\u304b\u3089",else:"\u305d\u3046\u3067\u306a\u3051\u308c\u3070",otherwise:"\u305d\u3046\u3067\u306a\u3051\u308c\u3070",end:"\u7d42\u308f\u308a",live:"\u30e9\u30a4\u30d6",bind:"\u30d0\u30a4\u30f3\u30c9",changes:"\u5909\u308f\u3063\u305f\u3089"},temporal:{seconds:"\u79d2",second:"\u79d2",milliseconds:"\u30df\u30ea\u79d2",millisecond:"\u30df\u30ea\u79d2",minutes:"\u5206",minute:"\u5206",hours:"\u6642\u9593",hour:"\u6642\u9593",ms:"ms",s:"\u79d2",min:"\u5206",h:"\u6642"},values:{true:"\u771f",false:"\u507d",null:"null",undefined:"\u672a\u5b9a\u7fa9",it:"\u305d\u308c",its:"\u305d\u306e",me:"\u79c1",my:"\u79c1\u306e",you:"\u3042\u306a\u305f",your:"\u3042\u306a\u305f\u306e",yourself:"\u3042\u306a\u305f\u81ea\u8eab",myself:"\u79c1\u81ea\u8eab",element:"\u8981\u7d20",target:"\u5bfe\u8c61",detail:"\u8a73\u7d30",event:"\u30a4\u30d9\u30f3\u30c8",window:"\u30a6\u30a3\u30f3\u30c9\u30a6",document:"\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8",body:"\u30dc\u30c7\u30a3",result:"\u7d50\u679c",value:"\u5024"},attributes:{class:"\u30af\u30e9\u30b9",classes:"\u30af\u30e9\u30b9\u7fa4",style:"\u30b9\u30bf\u30a4\u30eb",styles:"\u30b9\u30bf\u30a4\u30eb\u7fa4",attribute:"\u5c5e\u6027",attributes:"\u5c5e\u6027\u7fa4",property:"\u30d7\u30ed\u30d1\u30c6\u30a3",properties:"\u30d7\u30ed\u30d1\u30c6\u30a3\u7fa4"},expressions:{characters:"\u6587\u5b57",inclusive:"\u542b\u3080",exclusive:"\u9664\u304f",first:"\u6700\u521d",last:"\u6700\u5f8c",next:"\u6b21",previous:"\u524d",prev:"\u524d",at:"\u3067",random:"\u30e9\u30f3\u30c0\u30e0",closest:"\u6700\u3082\u8fd1\u3044",parent:"\u89aa",children:"\u5b50",within:"\u4ee5\u5185",no:"\u306a\u3044",empty:"\u7a7a",some:"\u3044\u304f\u3064\u304b","starts with":"\u3067\u59cb\u307e\u308b","ends with":"\u3067\u7d42\u308f\u308b","ignoring case":"\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u7121\u8996","sorted by":"\u3067\u30bd\u30fc\u30c8","mapped to":"\u306b\u5909\u63db","split by":"\u3067\u5206\u5272","joined by":"\u3067\u7d50\u5408"}},hl=cl(pl,"ja",{allowEnglishFallback:!0}),fl={commands:{on:"sur",tell:"dire",trigger:"d\u00e9clencher",send:"envoyer",take:"prendre",put:"mettre",set:"d\u00e9finir",get:"obtenir",add:"ajouter",remove:"supprimer",toggle:"basculer",blur:"d\u00e9focaliser",hide:"cacher",show:"montrer",if:"si",unless:"saufsi",repeat:"r\u00e9p\u00e9ter",for:"pour",while:"tantque",until:"jusqu\u00e0",continue:"continuer",break:"arr\u00eater",halt:"stopper",wait:"attendre",fetch:"r\u00e9cup\u00e9rer",call:"appeler",return:"retourner",make:"cr\u00e9er",log:"enregistrer",throw:"lancer",catch:"attraper",measure:"mesurer",transition:"transition",increment:"incr\u00e9menter",decrement:"d\u00e9cr\u00e9menter",default:"d\u00e9faut",go:"aller",pushUrl:"pousserUrl",replaceUrl:"remplacerUrl",copy:"copier",pick:"choisir",beep:"bip",js:"js",async:"asynchrone",render:"rendu",swap:"\u00e9changer",morph:"transformer",settle:"stabiliser",append:"annexer",exit:"sortir",install:"installer",breakpoint:"point-arr\u00eat",clear:"effacer",close:"fermer",open:"ouvrir",select:"s\u00e9lectionner",clone:"cloner",prepend:"pr\u00e9fixer",focus:"focaliser"},modifiers:{to:"\u00e0",from:"de",into:"dans",with:"avec",at:"\u00e0",in:"en",of:"de",as:"comme",by:"par",before:"avant",after:"apr\u00e8s",over:"sur",under:"sous",between:"entre",through:"\u00e0 travers",without:"sans"},events:{click:"clic",dblclick:"doubleclic",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"sourisentrer",mouseleave:"sourissortir",mouseover:"souris dessus",mouseout:"souris dehors",mousemove:"sourisbouger",keydown:"touche bas",keyup:"touche haut",keypress:"touchepress\u00e9e",focus:"focus",blur:"flou",change:"changer",input:"saisie",submit:"soumettre",reset:"r\u00e9initialiser",load:"charger",unload:"d\u00e9charger",resize:"redimensionner",scroll:"d\u00e9filer",touchstart:"touchercommencer",touchend:"toucherfin",touchmove:"toucherbouger",touchcancel:"toucherannuler"},logical:{when:"quand",where:"o\u00f9",and:"et",or:"ou",not:"non",is:"est",exists:"existe",matches:"correspond",contains:"contient",includes:"inclut",equals:"\u00e9gale",has:"a",have:"ai",then:"alors",else:"sinon",otherwise:"autrement",end:"fin",live:"vif",changes:"change"},temporal:{seconds:"secondes",second:"seconde",milliseconds:"millisecondes",millisecond:"milliseconde",minutes:"minutes",minute:"minute",hours:"heures",hour:"heure",ms:"ms",s:"s",min:"min",h:"h"},values:{true:"vrai",false:"faux",null:"nul",undefined:"ind\u00e9fini",it:"\u00e7a",its:"son",me:"moi",my:"mon",you:"tu",your:"ton",yourself:"toi-m\u00eame",myself:"moi-m\u00eame",element:"\u00e9l\u00e9ment",target:"cible",detail:"d\u00e9tail",event:"\u00e9v\u00e9nement",window:"fen\u00eatre",document:"document",body:"corps",result:"r\u00e9sultat",value:"valeur"},attributes:{class:"classe",classes:"classes",style:"style",styles:"styles",attribute:"attribut",attributes:"attributs",property:"propri\u00e9t\u00e9",properties:"propri\u00e9t\u00e9s"},expressions:{characters:"caract\u00e8res",inclusive:"inclusif",exclusive:"exclusif",first:"premier",last:"dernier",next:"suivant",previous:"pr\u00e9c\u00e9dent",prev:"pr\u00e9c",at:"\u00e0",random:"al\u00e9atoire",closest:"proche",parent:"parent",children:"enfants",within:"dans",no:"aucun",empty:"vide",some:"quelques","starts with":"commence par","ends with":"finit par","ignoring case":"en ignorant la casse","sorted by":"tri\u00e9 par","mapped to":"transform\u00e9 en","split by":"divis\u00e9 par","joined by":"joint par"}},yl=cl(fl,"fr",{allowEnglishFallback:!0}),gl={commands:{on:"bei",tell:"sagen",trigger:"ausl\u00f6sen",send:"senden",take:"nehmen",put:"setzen",set:"festlegen",get:"erhalten",add:"hinzuf\u00fcgen",remove:"entfernen",toggle:"umschalten",blur:"defokussieren",hide:"verstecken",show:"zeigen",if:"falls",unless:"wennnicht",repeat:"wiederholen",for:"f\u00fcr",while:"w\u00e4hrend",until:"bis",continue:"weiter",break:"unterbrechen",halt:"anhalten",wait:"warten",fetch:"abrufen",call:"aufrufen",return:"zur\u00fcckgeben",make:"erstellen",log:"protokollieren",throw:"werfen",catch:"fangen",measure:"messen",transition:"\u00fcbergang",increment:"erh\u00f6hen",decrement:"verringern",default:"standard",go:"gehen",pushUrl:"urlHinzuf\u00fcgen",replaceUrl:"urlErsetzen",copy:"kopieren",pick:"ausw\u00e4hlen",beep:"piepton",js:"js",async:"asynchron",render:"rendern",swap:"tauschen",morph:"verwandeln",settle:"stabilisieren",append:"anh\u00e4ngen",exit:"beenden",install:"installieren",breakpoint:"haltepunkt",clear:"bereinigen",close:"schlie\u00dfen",open:"\u00f6ffnen",select:"markieren",clone:"klonen",prepend:"voranstellen",focus:"fokussieren"},modifiers:{to:"zu",from:"von",into:"in",with:"mit",at:"bei",in:"in",of:"von",as:"als",by:"durch",before:"vor",after:"nach",over:"\u00fcber",under:"unter",between:"zwischen",through:"durch",without:"ohne"},events:{click:"klick",dblclick:"doppelklick",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"mauseintreten",mouseleave:"mausverlassen",mouseover:"maus dr\u00fcber",mouseout:"maus weg",mousemove:"mausbewegen",keydown:"taste unten",keyup:"taste oben",keypress:"tastedr\u00fccken",focus:"fokus",blur:"defokussieren",change:"\u00e4ndern",input:"eingabe",submit:"absenden",reset:"zur\u00fccksetzen",load:"laden",unload:"entladen",resize:"gr\u00f6\u00dfen\u00e4nderung",scroll:"scrollen",touchstart:"ber\u00fchrungstart",touchend:"ber\u00fchrungend",touchmove:"ber\u00fchrungbewegen",touchcancel:"ber\u00fchrungabbrechen"},logical:{when:"wenn",where:"wo",and:"und",or:"oder",not:"nicht",is:"ist",exists:"existiert",matches:"passt",contains:"enth\u00e4lt",includes:"beinhaltet",equals:"gleicht",has:"hat",have:"habe",then:"dann",else:"sonst",otherwise:"andernfalls",end:"ende",live:"live",changes:"\u00e4ndert"},temporal:{seconds:"sekunden",second:"sekunde",milliseconds:"millisekunden",millisecond:"millisekunde",minutes:"minuten",minute:"minute",hours:"stunden",hour:"stunde",ms:"ms",s:"s",min:"min",h:"std"},values:{true:"wahr",false:"falsch",null:"null",undefined:"undefiniert",it:"es",its:"sein",me:"ich",my:"mein",you:"du",your:"dein",yourself:"dich selbst",myself:"ich selbst",element:"element",target:"ziel",detail:"detail",event:"ereignis",window:"fenster",document:"dokument",body:"k\u00f6rper",result:"ergebnis",value:"wert"},attributes:{class:"klasse",classes:"klassen",style:"stil",styles:"stile",attribute:"attribut",attributes:"attribute",property:"eigenschaft",properties:"eigenschaften"},expressions:{characters:"Zeichen",inclusive:"inklusiv",exclusive:"exklusiv",first:"erste",last:"letzte",next:"n\u00e4chste",previous:"vorherige",prev:"vorh",at:"bei",random:"zuf\u00e4llig",closest:"n\u00e4chstgelegene",parent:"elternteil",children:"kinder",within:"innerhalb",no:"kein",empty:"leer",some:"einige","starts with":"beginnt mit","ends with":"endet mit","ignoring case":"ohne Gro\u00df-/Kleinschreibung","sorted by":"sortiert nach","mapped to":"zugeordnet zu","split by":"geteilt durch","joined by":"verbunden mit"}},vl=cl(gl,"de",{allowEnglishFallback:!0}),bl={commands:{on:"\u0639\u0644\u0649",tell:"\u0623\u062e\u0628\u0631",trigger:"\u062a\u0634\u063a\u064a\u0644",send:"\u0623\u0631\u0633\u0644",take:"\u062e\u0630",put:"\u0636\u0639",set:"\u0627\u0636\u0628\u0637",get:"\u0627\u062d\u0635\u0644",add:"\u0623\u0636\u0641",remove:"\u0627\u062d\u0630\u0641",toggle:"\u0628\u062f\u0644",hide:"\u0627\u062e\u0641",show:"\u0627\u0638\u0647\u0631",if:"\u0625\u0630\u0627",unless:"\u0625\u0644\u0627",repeat:"\u0643\u0631\u0631",for:"\u0644\u0643\u0644",while:"\u0628\u064a\u0646\u0645\u0627",until:"\u062d\u062a\u0649",continue:"\u0648\u0627\u0635\u0644",break:"\u062a\u0648\u0642\u0641",halt:"\u0623\u0648\u0642\u0641",wait:"\u0627\u0646\u062a\u0638\u0631",fetch:"\u0627\u062d\u0636\u0631",call:"\u0627\u0633\u062a\u062f\u0639",return:"\u0627\u0631\u062c\u0639",make:"\u0627\u0635\u0646\u0639",log:"\u0633\u062c\u0644",throw:"\u0627\u0631\u0645",catch:"\u0627\u0644\u062a\u0642\u0637",measure:"\u0642\u0633",transition:"\u0627\u0646\u062a\u0642\u0627\u0644",increment:"\u0632\u0650\u062f",decrement:"\u0623\u0646\u0642\u0635",default:"\u0627\u0641\u062a\u0631\u0627\u0636\u064a",go:"\u0627\u0630\u0647\u0628",pushUrl:"\u0627\u062f\u0641\u0639 \u0631\u0627\u0628\u0637",replaceUrl:"\u0627\u0633\u062a\u0628\u062f\u0644 \u0631\u0627\u0628\u0637",copy:"\u0627\u0646\u0633\u062e",pick:"\u0627\u062e\u062a\u0631",beep:"\u0635\u0641\u0651\u0631",js:"\u062c\u0627\u0641\u0627\u0633\u0643\u0631\u0628\u062a",async:"\u0645\u062a\u0632\u0627\u0645\u0646",render:"\u0627\u0631\u0633\u0645",swap:"\u0627\u0633\u062a\u0628\u062f\u0644",morph:"\u062d\u0648\u0651\u0644",settle:"\u0627\u0633\u062a\u0642\u0631",append:"\u0623\u0644\u062d\u0642",exit:"\u0627\u062e\u0631\u062c",install:"\u062b\u0628\u0651\u062a",breakpoint:"\u0646\u0642\u0637\u0629-\u062a\u0648\u0642\u0641",clear:"\u0646\u0638\u0651\u0641",close:"\u0623\u063a\u0644\u0642",open:"\u0627\u0641\u062a\u062d",select:"\u0638\u0644\u0644",clone:"\u0627\u0633\u062a\u0646\u0633\u062e",prepend:"\u0633\u0628\u0642",socket:"\u0645\u0642\u0628\u0633"},modifiers:{to:"\u0625\u0644\u0649",from:"\u0645\u0646",into:"\u0641\u064a",with:"\u0645\u0639",at:"\u0639\u0646\u062f",in:"\u0641\u064a",of:"\u0645\u0646",as:"\u0643\u0640",by:"\u0628\u0648\u0627\u0633\u0637\u0629",before:"\u0642\u0628\u0644",after:"\u0628\u0639\u062f",over:"\u0641\u0648\u0642",under:"\u062a\u062d\u062a",between:"\u0628\u064a\u0646",through:"\u0639\u0628\u0631",without:"\u0628\u062f\u0648\u0646"},events:{click:"\u0646\u0642\u0631",dblclick:"dblclick",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"\u0641\u0623\u0631\u0629 \u0641\u0648\u0642",mouseout:"mouseout",mousemove:"mousemove",keydown:"\u0645\u0641\u062a\u0627\u062d \u0623\u0633\u0641\u0644",keyup:"\u0645\u0641\u062a\u0627\u062d \u0623\u0639\u0644\u0649",keypress:"keypress",focus:"\u062a\u0631\u0643\u064a\u0632",blur:"\u0636\u0628\u0627\u0628\u064a\u0629",change:"\u062a\u063a\u064a\u064a\u0631",input:"\u0625\u062f\u062e\u0627\u0644",submit:"\u0625\u0631\u0633\u0627\u0644",reset:"reset",load:"\u062a\u062d\u0645\u064a\u0644",unload:"unload",resize:"\u062a\u063a\u064a\u064a\u0631 \u062d\u062c\u0645",scroll:"\u062a\u0645\u0631\u064a\u0631",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",touchcancel:"touchcancel"},logical:{when:"\u0639\u0646\u062f\u0645\u0627",where:"\u0623\u064a\u0646",and:"\u0648",or:"\u0623\u0648",not:"\u0644\u064a\u0633",is:"\u0647\u0648",exists:"\u0645\u0648\u062c\u0648\u062f",matches:"\u064a\u0637\u0627\u0628\u0642",contains:"\u064a\u062d\u062a\u0648\u064a",includes:"\u064a\u0634\u0645\u0644",equals:"\u064a\u0633\u0627\u0648\u064a",has:"\u0644\u062f\u064a\u0647",have:"\u0644\u062f\u064a",then:"\u062b\u0645",else:"\u0648\u0625\u0644\u0627",otherwise:"\u062e\u0644\u0627\u0641 \u0630\u0644\u0643",end:"\u0627\u0644\u0646\u0647\u0627\u064a\u0629",live:"\u062d\u064a",bind:"\u0627\u0631\u0628\u0637",changes:"\u064a\u062a\u063a\u064a\u0631"},temporal:{seconds:"\u062b\u0648\u0627\u0646\u0650",second:"\u062b\u0627\u0646\u064a\u0629",milliseconds:"\u0645\u064a\u0644\u064a \u062b\u0627\u0646\u064a\u0629",millisecond:"\u0645\u064a\u0644\u064a \u062b\u0627\u0646\u064a\u0629",minutes:"\u062f\u0642\u0627\u0626\u0642",minute:"\u062f\u0642\u064a\u0642\u0629",hours:"\u0633\u0627\u0639\u0627\u062a",hour:"\u0633\u0627\u0639\u0629",ms:"\u0645.\u062b",s:"\u062b",min:"\u062f",h:"\u0633"},values:{true:"\u0635\u062d\u064a\u062d",false:"\u062e\u0637\u0623",null:"\u0641\u0627\u0631\u063a",undefined:"\u063a\u064a\u0631 \u0645\u0639\u0631\u0641",it:"\u0647\u0648",its:"\u0644\u0647",me:"\u0623\u0646\u0627",my:"\u0644\u064a",myself:"\u0646\u0641\u0633\u064a",you:"\u0623\u0646\u062a",your:"\u0644\u0643",yourself:"\u0646\u0641\u0633\u0643",element:"\u0639\u0646\u0635\u0631",target:"\u0647\u062f\u0641",detail:"\u062a\u0641\u0627\u0635\u064a\u0644",event:"\u062d\u062f\u062b",window:"\u0646\u0627\u0641\u0630\u0629",document:"\u0648\u062b\u064a\u0642\u0629",body:"\u062c\u0633\u0645",result:"\u0646\u062a\u064a\u062c\u0629",value:"\u0642\u064a\u0645\u0629"},attributes:{class:"\u0641\u0626\u0629",classes:"\u0641\u0626\u0627\u062a",style:"\u0623\u0633\u0644\u0648\u0628",styles:"\u0623\u0633\u0627\u0644\u064a\u0628",attribute:"\u062e\u0627\u0635\u064a\u0629",attributes:"\u062e\u0635\u0627\u0626\u0635",property:"\u062e\u0627\u0635\u064a\u0629",properties:"\u062e\u0635\u0627\u0626\u0635"},expressions:{characters:"\u062d\u0631\u0648\u0641",inclusive:"\u0634\u0627\u0645\u0644",exclusive:"\u062d\u0635\u0631\u064a",first:"\u0623\u0648\u0644",last:"\u0622\u062e\u0631",next:"\u0627\u0644\u062a\u0627\u0644\u064a",previous:"\u0627\u0644\u0633\u0627\u0628\u0642",prev:"\u0633\u0627\u0628\u0642",at:"\u0639\u0646\u062f",random:"\u0639\u0634\u0648\u0627\u0626\u064a",closest:"\u0627\u0644\u0623\u0642\u0631\u0628",parent:"\u0648\u0627\u0644\u062f",children:"\u0623\u0637\u0641\u0627\u0644",within:"\u062f\u0627\u062e\u0644",no:"\u0644\u0627 \u064a\u0648\u062c\u062f",empty:"\u0641\u0627\u0631\u063a",some:"\u0628\u0639\u0636","starts with":"\u064a\u0628\u062f\u0623 \u0628\u0640","ends with":"\u064a\u0646\u062a\u0647\u064a \u0628\u0640","ignoring case":"\u0645\u0639 \u062a\u062c\u0627\u0647\u0644 \u0627\u0644\u062d\u0627\u0644\u0629","sorted by":"\u0645\u0631\u062a\u0628 \u062d\u0633\u0628","mapped to":"\u0645\u062d\u0648\u0644 \u0625\u0644\u0649","split by":"\u0645\u0642\u0633\u0645 \u0628\u0648\u0627\u0633\u0637\u0629","joined by":"\u0645\u062f\u0645\u0648\u062c \u0628\u0648\u0627\u0633\u0637\u0629"}},wl=cl(bl,"ar",{allowEnglishFallback:!0}),kl={commands:{on:"\uc5d0",tell:"\ub9d0\ud558\ub2e4",trigger:"\ud2b8\ub9ac\uac70",send:"\ubcf4\ub0b4\ub2e4",take:"\uac00\uc838\uc624\ub2e4",put:"\ub123\ub2e4",set:"\uc124\uc815",get:"\uc5bb\ub2e4",add:"\ucd94\uac00",remove:"\uc81c\uac70",toggle:"\ud1a0\uae00",hide:"\uc228\uae30\ub2e4",show:"\ubcf4\uc774\ub2e4",if:"\ub9cc\uc57d",unless:"\uc544\ub2c8\ub77c\uba74",repeat:"\ubc18\ubcf5",for:"\uac01\uac01",while:"\ub3d9\uc548",until:"\uae4c\uc9c0",continue:"\uacc4\uc18d",break:"\uc911\ub2e8",halt:"\uc815\uc9c0",wait:"\ub300\uae30",fetch:"\uac00\uc838\uc624\uae30",call:"\ud638\ucd9c",return:"\ubc18\ud658",make:"\ub9cc\ub4e4\ub2e4",log:"\ub85c\uadf8",throw:"\ub358\uc9c0\ub2e4",catch:"\uc7a1\ub2e4",measure:"\uce21\uc815",transition:"\uc804\ud658",increment:"\uc99d\uac00",decrement:"\uac10\uc18c",default:"\uae30\ubcf8\uac12",go:"\uc774\ub3d9",pushUrl:"URL\ud478\uc2dc",replaceUrl:"URL\uad50\uccb4",copy:"\ubcf5\uc0ac",pick:"\uc120\ud0dd",beep:"\ube44\ud504",js:"JS\uc2e4\ud589",async:"\ube44\ub3d9\uae30",render:"\ub80c\ub354\ub9c1",swap:"\uad50\ud658",morph:"\ubcc0\ud615",settle:"\uc548\uc815",append:"\ub367\ubd99\uc774\ub2e4",exit:"\ub098\uac00\uae30",install:"\uc124\uce58",breakpoint:"\uc911\ub2e8\uc810",clear:"\uc9c0\uc6b0\uae30",close:"\ub2eb\uae30",open:"\uc5f4\uae30",select:"\uace0\ub974\uae30",clone:"\ubcf5\uc81c",prepend:"\uc55e\uc5d0\ucd94\uac00",socket:"\uc18c\ucf13"},modifiers:{to:"\uc5d0",from:"\uc5d0\uc11c",into:"\uc73c\ub85c",with:"\uc640",at:"\uc5d0",in:"\uc548\uc5d0",of:"\uc758",as:"\ub85c",by:"\uc5d0\uc758\ud574",before:"\uc804\uc5d0",after:"\ud6c4\uc5d0",over:"\uc704\uc5d0",under:"\uc544\ub798",between:"\uc0ac\uc774",through:"\ud1b5\ud574",without:"\uc5c6\uc774"},events:{click:"\ud074\ub9ad",dblclick:"\ub354\ube14\ud074\ub9ad",mousedown:"\ub9c8\uc6b0\uc2a4\ub2e4\uc6b4",mouseup:"\ub9c8\uc6b0\uc2a4\uc5c5",mouseenter:"\ub9c8\uc6b0\uc2a4\uc5d4\ud130",mouseleave:"\ub9c8\uc6b0\uc2a4\ub9ac\ube0c",mouseover:"\ub9c8\uc6b0\uc2a4\uc624\ubc84",mouseout:"\ub9c8\uc6b0\uc2a4\uc544\uc6c3",mousemove:"\ub9c8\uc6b0\uc2a4\ubb34\ube0c",keydown:"\ud0a4\ub2e4\uc6b4",keyup:"\ud0a4\uc5c5",keypress:"\ud0a4\ud504\ub808\uc2a4",focus:"\ud3ec\ucee4\uc2a4",blur:"\ube14\ub7ec",change:"\ubcc0\uacbd",input:"\uc785\ub825",submit:"\uc81c\ucd9c",reset:"\uc7ac\uc124\uc815",load:"\ub85c\ub4dc",unload:"unload",resize:"\ub9ac\uc0ac\uc774\uc988",scroll:"\uc2a4\ud06c\ub864",touchstart:"touchstart",touchend:"\ud130\uce58\uc885\ub8cc",touchmove:"touchmove",touchcancel:"\ud130\uce58\ucde8\uc18c"},logical:{when:"\ub54c",where:"\uc5b4\ub514",and:"\uadf8\ub9ac\uace0",or:"\ub610\ub294",not:"\uc544\ub2c8",is:"\uc774\ub2e4",exists:"\uc874\uc7ac",matches:"\uc77c\uce58",contains:"\ud3ec\ud568",includes:"\ud3ec\ud568\ud558\ub2e4",equals:"\uac19\ub2e4",has:"\uc788\ub2e4",have:"\uc788\ub2e4",then:"\uadf8\ub7ec\uba74",else:"\uc544\ub2c8\uba74",otherwise:"\uadf8\ub807\uc9c0\uc54a\uc73c\uba74",end:"\ub05d",live:"\ub77c\uc774\ube0c",bind:"\ubc14\uc778\ub4dc",changes:"\ubcc0\uacbd\ub418\uba74"},temporal:{seconds:"\ucd08",second:"\ucd08",milliseconds:"\ubc00\ub9ac\ucd08",millisecond:"\ubc00\ub9ac\ucd08",minutes:"\ubd84",minute:"\ubd84",hours:"\uc2dc\uac04",hour:"\uc2dc\uac04",ms:"ms",s:"\ucd08",min:"\ubd84",h:"\uc2dc"},values:{true:"\ucc38",false:"\uac70\uc9d3",null:"\ub110",undefined:"\uc815\uc758\uc548\ub428",it:"\uadf8\uac83",its:"\uadf8\uac83\uc758",me:"\ub098",my:"\ub0b4",myself:"\ub098\uc790\uc2e0",you:"\ub108",your:"\ub124",yourself:"\ub108\uc790\uc2e0",element:"\uc694\uc18c",target:"\ub300\uc0c1",detail:"\uc138\ubd80",event:"\uc774\ubca4\ud2b8",window:"\ucc3d",document:"\ubb38\uc11c",body:"\ubc14\ub514",result:"\uacb0\uacfc",value:"\uac12"},attributes:{class:"\ud074\ub798\uc2a4",classes:"\ud074\ub798\uc2a4\ub4e4",style:"\uc2a4\ud0c0\uc77c",styles:"\uc2a4\ud0c0\uc77c\ub4e4",attribute:"\uc18d\uc131",attributes:"\uc18d\uc131\ub4e4",property:"\ud504\ub85c\ud37c\ud2f0",properties:"\ud504\ub85c\ud37c\ud2f0\ub4e4"},expressions:{characters:"\ubb38\uc790",inclusive:"\ud3ec\ud568",exclusive:"\uc81c\uc678",first:"\uccab\ubc88\uc9f8",last:"\ub9c8\uc9c0\ub9c9",next:"\ub2e4\uc74c",previous:"\uc774\uc804",prev:"\uc774\uc804",at:"\uc5d0\uc11c",random:"\ubb34\uc791\uc704",closest:"\uac00\uc7a5\uac00\uae4c\uc6b4",parent:"\ubd80\ubaa8",children:"\uc790\uc2dd",within:"\uc774\ub0b4",no:"\uc5c6\uc74c",empty:"\ube44\uc5b4\uc788\ub294",some:"\uc77c\ubd80","starts with":"\ub85c\uc2dc\uc791","ends with":"\ub85c\ub05d\ub098\ub294","ignoring case":"\ub300\uc18c\ubb38\uc790_\ubb34\uc2dc","sorted by":"\ub85c_\uc815\ub82c","mapped to":"\ub85c_\ubcc0\ud658","split by":"\ub85c_\ubd84\ud560","joined by":"\ub85c_\uacb0\ud569"}},El=cl(kl,"ko",{allowEnglishFallback:!0}),xl={commands:{on:"\u5f53",tell:"\u544a\u8bc9",trigger:"\u89e6\u53d1",send:"\u53d1\u9001",take:"\u62ff\u53d6",put:"\u653e\u7f6e",set:"\u8bbe\u7f6e",get:"\u83b7\u5f97",add:"\u6dfb\u52a0",remove:"\u79fb\u9664",toggle:"\u5207\u6362",hide:"\u9690\u85cf",show:"\u663e\u793a",if:"\u5982\u679c",unless:"\u9664\u975e",repeat:"\u91cd\u590d",for:"\u4e3a",while:"\u5f53",until:"\u76f4\u5230",continue:"\u7ee7\u7eed",break:"\u4e2d\u65ad",halt:"\u505c\u6b62",wait:"\u7b49\u5f85",fetch:"\u6293\u53d6",call:"\u8c03\u7528",return:"\u8fd4\u56de",make:"\u5236\u4f5c",log:"\u65e5\u5fd7",throw:"\u629b\u51fa",catch:"\u6355\u83b7",measure:"\u6d4b\u91cf",transition:"\u8fc7\u6e21",increment:"\u589e\u52a0",decrement:"\u51cf\u5c11",default:"\u9ed8\u8ba4",go:"\u524d\u5f80",pushUrl:"\u63a8\u9001\u7f51\u5740",replaceUrl:"\u66ff\u6362\u7f51\u5740",copy:"\u590d\u5236",pick:"\u9009\u53d6",beep:"\u8702\u9e23",js:"JS\u6267\u884c",async:"\u5f02\u6b65",render:"\u6e32\u67d3",swap:"\u4ea4\u6362",morph:"\u53d8\u5f62",settle:"\u7a33\u5b9a",append:"\u8ffd\u52a0",exit:"\u9000\u51fa",install:"\u5b89\u88c5",breakpoint:"\u65ad\u70b9",clear:"\u6e05\u9664",close:"\u5173\u95ed",open:"\u6253\u5f00",select:"\u9009\u62e9",clone:"\u514b\u9686",prepend:"\u524d\u7f6e"},modifiers:{to:"\u5230",from:"\u4ece",into:"\u8fdb\u5165",with:"\u4e0e",at:"\u5728",in:"\u5728",of:"\u7684",as:"\u4f5c\u4e3a",by:"\u901a\u8fc7",before:"\u4e4b\u524d",after:"\u4e4b\u540e",over:"\u5728\u4e0a",under:"\u5728\u4e0b",between:"\u4e4b\u95f4",through:"\u901a\u8fc7",without:"\u6ca1\u6709"},events:{click:"\u70b9\u51fb",dblclick:"\u53cc\u51fb",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"\u9f20\u6807\u79fb\u5165",mouseout:"\u9f20\u6807\u79fb\u51fa",mousemove:"\u9f20\u6807\u79fb\u52a8",keydown:"\u6309\u952e\u6309\u4e0b",keyup:"\u677e\u952e",keypress:"keypress",focus:"\u805a\u7126",blur:"\u5931\u7126",change:"\u6539\u53d8",input:"\u8f93\u5165",submit:"\u63d0\u4ea4",reset:"\u91cd\u7f6e",load:"\u52a0\u8f7d",unload:"\u5378\u8f7d",resize:"\u8c03\u6574\u5927\u5c0f",scroll:"\u6eda\u52a8",touchstart:"\u89e6\u6478\u5f00\u59cb",touchend:"touchend",touchmove:"\u89e6\u6478\u79fb\u52a8",touchcancel:"touchcancel"},logical:{when:"\u5f53",where:"\u54ea\u91cc",and:"\u548c",or:"\u6216",not:"\u975e",is:"\u662f",exists:"\u5b58\u5728",matches:"\u5339\u914d",contains:"\u5305\u542b",includes:"\u5305\u62ec",equals:"\u7b49\u4e8e",has:"\u6709",have:"\u6709",then:"\u90a3\u4e48",else:"\u5426\u5219",otherwise:"\u8981\u4e0d\u7136",end:"\u7ed3\u675f",live:"\u5b9e\u65f6",bind:"\u7ed1\u5b9a",changes:"\u6539\u53d8\u65f6"},temporal:{seconds:"\u79d2",second:"\u79d2",milliseconds:"\u6beb\u79d2",millisecond:"\u6beb\u79d2",minutes:"\u5206\u949f",minute:"\u5206\u949f",hours:"\u5c0f\u65f6",hour:"\u5c0f\u65f6",ms:"\u6beb\u79d2",s:"\u79d2",min:"\u5206",h:"\u65f6"},values:{true:"\u771f",false:"\u5047",null:"\u7a7a",undefined:"\u672a\u5b9a\u4e49",it:"\u5b83",its:"\u5b83\u7684",me:"\u6211",my:"\u6211\u7684",myself:"\u6211\u81ea\u5df1",you:"\u4f60",your:"\u4f60\u7684",yourself:"\u4f60\u81ea\u5df1",element:"\u5143\u7d20",target:"\u76ee\u6807",detail:"\u8be6\u60c5",event:"\u4e8b\u4ef6",window:"\u7a97\u53e3",document:"\u6587\u6863",body:"\u4e3b\u4f53",result:"\u7ed3\u679c",value:"\u503c"},attributes:{class:"\u7c7b",classes:"\u7c7b\u522b",style:"\u6837\u5f0f",styles:"\u6837\u5f0f\u96c6",attribute:"\u5c5e\u6027",attributes:"\u5c5e\u6027\u96c6",property:"\u7279\u6027",properties:"\u7279\u6027\u96c6"},expressions:{characters:"\u5b57\u7b26",inclusive:"\u5305\u542b",exclusive:"\u6392\u9664",first:"\u7b2c\u4e00\u4e2a",last:"\u6700\u540e\u4e00\u4e2a",next:"\u4e0b\u4e00\u4e2a",previous:"\u4e0a\u4e00\u4e2a",prev:"\u4e0a\u4e2a",at:"\u5728",random:"\u968f\u673a",closest:"\u6700\u8fd1\u7684",parent:"\u7236\u7ea7",children:"\u5b50\u7ea7",within:"\u4e4b\u5185",no:"\u6ca1\u6709",empty:"\u7a7a\u7684",some:"\u4e00\u4e9b","starts with":"\u4ee5\u5f00\u5934","ends with":"\u4ee5\u7ed3\u5c3e","ignoring case":"\u5ffd\u7565\u5927\u5c0f\u5199","sorted by":"\u6309_\u6392\u5e8f","mapped to":"\u6620\u5c04\u4e3a","split by":"\u6309_\u5206\u5272","joined by":"\u7528_\u8fde\u63a5"}},Cl=cl(xl,"zh",{allowEnglishFallback:!0}),Al={commands:{on:"\u00fczerinde",tell:"s\u00f6yle",trigger:"tetikle",send:"g\u00f6nder",take:"tut",put:"koy",set:"ayarla",get:"al",add:"ekle",remove:"kald\u0131r",toggle:"de\u011fi\u015ftir",hide:"gizle",show:"g\u00f6ster",if:"e\u011fer",unless:"de\u011filse",repeat:"tekrarla",for:"i\u00e7in",while:"s\u00fcresince",until:"kadar",continue:"devam",break:"dur",halt:"durdur",wait:"bekle",fetch:"getir",call:"\u00e7a\u011f\u0131r",return:"d\u00f6n",make:"yap",log:"kaydet",throw:"f\u0131rlat",catch:"yakala",measure:"\u00f6l\u00e7",transition:"ge\u00e7i\u015f",increment:"art\u0131r",decrement:"azalt",default:"varsay\u0131lan",go:"git",pushUrl:"urlEkle",replaceUrl:"urlDe\u011fi\u015ftir",copy:"kopyala",pick:"se\u00e7",beep:"bip",js:"js",async:"asenkron",render:"render",swap:"takas",morph:"d\u00f6n\u00fc\u015ft\u00fcr",settle:"sabitlen",append:"ili\u015ftir",exit:"\u00e7\u0131k",install:"kur",breakpoint:"kesme-noktas\u0131",clear:"temizle",close:"kapat",open:"a\u00e7",select:"vurgula",clone:"klonla",prepend:"ba\u015f\u0131naekle",socket:"soket"},modifiers:{to:"e",from:"den",into:"i\u00e7ine",with:"ile",at:"de",in:"i\u00e7inde",of:"nin",as:"olarak",by:"taraf\u0131ndan",before:"\u00f6nce",after:"sonra",over:"\u00fczerinde",under:"alt\u0131nda",between:"aras\u0131nda",through:"boyunca",without:"olmadan"},events:{click:"t\u0131klama",dblclick:"dblclick",mousedown:"farebas",mouseup:"fareb\u0131rak",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"farei\u00e7inde",mouseout:"fared\u0131\u015f\u0131nda",mousemove:"mousemove",keydown:"tu\u015fbasma",keyup:"tu\u015fb\u0131rakma",keypress:"keypress",focus:"odak",blur:"bulan\u0131k",change:"de\u011fi\u015fim",input:"giri\u015f",submit:"g\u00f6nderme",reset:"s\u0131f\u0131rla",load:"y\u00fckle",unload:"unload",resize:"boyutland\u0131rma",scroll:"kayd\u0131r",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",touchcancel:"touchcancel"},logical:{when:"iken",where:"nerede",and:"ve",or:"veya",not:"de\u011fil",is:"dir",exists:"var",matches:"e\u015fle\u015fir",contains:"i\u00e7erir",includes:"dahil",equals:"e\u015fittir",has:"var",have:"var",then:"ard\u0131ndan",else:"yoksa",otherwise:"aksi_halde",end:"son",live:"canl\u0131",changes:"de\u011fi\u015fti\u011finde"},temporal:{seconds:"saniye",second:"saniye",milliseconds:"milisaniye",millisecond:"milisaniye",minutes:"dakika",minute:"dakika",hours:"saat",hour:"saat",ms:"ms",s:"s",min:"dk",h:"sa"},values:{true:"do\u011fru",false:"yanl\u0131\u015f",null:"bo\u015f",undefined:"tan\u0131ms\u0131z",it:"o",its:"onun",me:"ben",my:"benim",myself:"kendim",you:"sen",your:"senin",yourself:"kendin",element:"\u00f6\u011fe",target:"hedef",detail:"detay",event:"olay",window:"pencere",document:"belge",body:"g\u00f6vde",result:"sonu\u00e7",value:"de\u011fer"},attributes:{class:"s\u0131n\u0131f",classes:"s\u0131n\u0131flar",style:"stil",styles:"stiller",attribute:"\u00f6zellik",attributes:"\u00f6zellikler",property:"\u00f6zellik",properties:"\u00f6zellikler"},expressions:{characters:"karakterler",inclusive:"dahil",exclusive:"hari\u00e7",first:"ilk",last:"sonuncu",next:"sonraki",previous:"\u00f6nceki",prev:"\u00f6nc",at:"de",random:"rastgele",closest:"enyak\u0131n",parent:"ebeveyn",children:"\u00e7ocuklar",within:"i\u00e7inde",no:"yok",empty:"bo\u015f",some:"baz\u0131","starts with":"ile ba\u015flar","ends with":"ile biter","ignoring case":"b\u00fcy\u00fck k\u00fc\u00e7\u00fck harf duyars\u0131z","sorted by":"g\u00f6re s\u0131ral\u0131","mapped to":"ye d\u00f6n\u00fc\u015ft\u00fcr\u00fclm\u00fc\u015f","split by":"ile b\u00f6l\u00fcnm\u00fc\u015f","joined by":"ile birle\u015ftirilmi\u015f"}},Sl=cl(Al,"tr",{allowEnglishFallback:!0}),Tl={commands:{on:"pada",tell:"katakan",trigger:"picu",send:"kirim",take:"ambil",put:"taruh",set:"atur",get:"dapatkan",add:"tambah",remove:"hapus",toggle:"alihkan",hide:"sembunyikan",show:"tampilkan",if:"jika",unless:"kecuali",repeat:"ulangi",for:"untuk",while:"selama",until:"sampai",continue:"lanjutkan",break:"hentikan",halt:"berhenti",wait:"tunggu",fetch:"muat",call:"panggil",return:"kembali",make:"buat",log:"catat",throw:"lempar",catch:"tangkap",measure:"ukur",transition:"transisi",increment:"naikkan",decrement:"kurangi",default:"bawaan",go:"pergi",pushUrl:"tambahUrl",replaceUrl:"gantiUrl",copy:"salin",pick:"pilih",beep:"bunyi",js:"js",async:"asinkron",render:"olah",swap:"tukar",morph:"ubah",settle:"stabilkan",append:"sisipkan",exit:"keluar",install:"pasang",breakpoint:"titik-henti",clear:"bersihkan",close:"tutupkan",open:"buka",select:"tandai",clone:"klon",prepend:"awali"},modifiers:{to:"ke",from:"dari",into:"ke_dalam",with:"dengan",at:"di",in:"dalam",of:"dari",as:"sebagai",by:"oleh",before:"sebelum",after:"setelah",over:"di_atas",under:"di_bawah",between:"antara",through:"melalui",without:"tanpa"},events:{click:"klik",dblclick:"dblclick",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"arahkan",mouseout:"tinggalkan",mousemove:"mousemove",keydown:"tekan_tombol",keyup:"keyup",keypress:"keypress",focus:"fokus",blur:"blur",change:"ubah",input:"masukan",submit:"kirim",reset:"reset",load:"muat",unload:"bongkar",resize:"ubah_ukuran",scroll:"gulir",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",touchcancel:"touchcancel"},logical:{when:"ketika",where:"di_mana",and:"dan",or:"atau",not:"bukan",is:"adalah",exists:"ada",matches:"cocok",contains:"berisi",includes:"termasuk",equals:"sama",has:"punya",have:"punya",then:"lalu",else:"lainnya",otherwise:"sebaliknya",end:"akhir",live:"langsung",changes:"berubah"},temporal:{seconds:"detik",second:"detik",milliseconds:"milidetik",millisecond:"milidetik",minutes:"menit",minute:"menit",hours:"jam",hour:"jam",ms:"ms",s:"d",min:"mnt",h:"j"},values:{true:"benar",false:"salah",null:"kosong",undefined:"tidak_terdefinisi",it:"itu",its:"miliknya",me:"saya",my:"saya punya",myself:"saya sendiri",you:"kamu",your:"kamu punya",yourself:"kamu sendiri",element:"elemen",target:"target",detail:"detail",event:"peristiwa",window:"jendela",document:"dokumen",body:"badan",result:"hasil",value:"nilai"},attributes:{class:"kelas",classes:"kelas_kelas",style:"gaya",styles:"gaya_gaya",attribute:"atribut",attributes:"atribut_atribut",property:"properti",properties:"properti_properti"},expressions:{characters:"karakter",inclusive:"inklusif",exclusive:"eksklusif",first:"pertama",last:"terakhir",next:"berikutnya",previous:"sebelumnya",prev:"sblm",at:"di",random:"acak",closest:"terdekat",parent:"induk",children:"anak_anak",within:"dalam",no:"tidak_ada",empty:"kosong",some:"beberapa","starts with":"dimulai dengan","ends with":"diakhiri dengan","ignoring case":"abaikan kapital","sorted by":"diurutkan berdasarkan","mapped to":"dipetakan ke","split by":"dipisah oleh","joined by":"digabung oleh"}},Ll=cl(Tl,"id",{allowEnglishFallback:!0}),Ol={commands:{on:"kaqpi",tell:"niy",trigger:"kichay",send:"kachay",take:"hapiy",put:"churay",set:"churanay",get:"taripay",add:"yapay",remove:"qichuy",toggle:"tikray",hide:"pakay",show:"rikuchiy",if:"sichus",unless:"mana sichus",repeat:"kutipay",for:"sapankaq",while:"kaykamaqa",until:"hayk_akama",continue:"purichiy",break:"p_akiy",halt:"sayay",wait:"suyay",fetch:"apamuy",call:"qayay",return:"kutimuy",make:"ruray",log:"qillqakuy",throw:"wikchuy",catch:"hapsiy",measure:"tupuy",transition:"pasay",increment:"yapachiy",decrement:"pisiyachiy",default:"\u00f1awpaq_kaq",go:"riy",pushUrl:"url_tanqay",replaceUrl:"url_tikray",copy:"qillqay",pick:"akllay",beep:"waqay",js:"js",async:"mana_suyaspa",render:"rikurichiy",swap:"t'inkuy",morph:"tukunay",settle:"tiyakuy",append:"qatichiy",exit:"lluqsiy",install:"tarpuy",breakpoint:"sayachinay",clear:"pichay",close:"wichqay",open:"paskay",select:"marcay",clone:"kikinchay",prepend:"\u00f1awpachiy",socket:"tinkina"},modifiers:{to:"man",from:"manta",into:"ukupi",with:"wan",at:"pi",in:"ukupi",of:"pa",as:"hina",by:"rayku",before:"\u00f1awpaqpi",after:"qhepapi",over:"hawapi",under:"urapi",between:"chawpipi",through:"pasaspa",without:"mana"},events:{click:"\u00f1itiy",dblclick:"dblclick",mousedown:"rat\u00f1itiy",mouseup:"rathuqariy",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"mouseover",mouseout:"mouseout",mousemove:"mousemove",keydown:"llave uray",keyup:"llave hawa",keypress:"keypress",focus:"qhaway",blur:"paqariy",change:"kambiay",input:"yaykuchiy",submit:"apaykachay",reset:"musuqchay",load:"apakuy",unload:"unload",resize:"hatun_kay",scroll:"kunray",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",touchcancel:"touchcancel"},logical:{when:"maykama",where:"maypi",and:"chaymanta",or:"utaq",not:"mana",is:"kanqa",exists:"tiyan",matches:"tupan",contains:"ukupi_kan",includes:"churasqa",equals:"kikin",has:"kachkan",have:"kachkani",then:"chayqa",else:"manachus",otherwise:"huk_kaqpi",end:"tukuy",live:"kawsay",changes:"tukurikun"},temporal:{seconds:"sikundukuna",second:"sikundu",milliseconds:"iskay_paqta_sikundukuna",millisecond:"iskay_paqta_sikundu",minutes:"minutukuna",minute:"minutu",hours:"horakuna",hour:"hora",ms:"ms",s:"s",min:"m",h:"h"},values:{true:"cheqaq",false:"llulla",null:"chusaq",undefined:"mana_riqsisqa",it:"chay",its:"chaypaq",me:"noqa",my:"noqaq",myself:"noqa killa",you:"qam",your:"qampaq",yourself:"qam killa",element:"raku",target:"punta",detail:"sut_iy",event:"ruway",window:"k_iri",document:"qillqa",body:"kurku",result:"lluqsiy",value:"chanin"},attributes:{class:"ayllu",classes:"ayllukuna",style:"sami",styles:"samikuna",attribute:"kaq",attributes:"kaqkuna",property:"kanay",properties:"kanaykuna"},expressions:{characters:"sanampa",first:"\u00f1awpaq",last:"qhipa",next:"qhipantin",previous:"\u00f1awpaqnin",prev:"\u00f1awpaq",at:"pi",random:"imaymanata",closest:"kaylla",parent:"mama_tayta",children:"wawakuna",within:"ukupi",no:"mana_kanchu",empty:"chusaq",some:"wakin","starts with":"qallarisqa wan","ends with":"tukusqa wan","ignoring case":"hatun-huchuy qillqata-saqiy","sorted by":"niqpi ruwasqa","mapped to":"kay kaqman","split by":"rakisqa","joined by":"hu\u00f1usqa"}},jl=cl(Ol,"qu",{allowEnglishFallback:!0}),Pl={commands:{on:"kwenye",tell:"ambia",trigger:"chochea",send:"tuma",take:"chukua",put:"weka",set:"seti",get:"pata",add:"ongeza",remove:"ondoa",toggle:"badilisha",blur:"blur",hide:"ficha",show:"onyesha",if:"kama",unless:"isipokuwa",repeat:"rudia",for:"kwa",while:"wakati",until:"hadi",continue:"endelea",break:"vunja",halt:"simama",wait:"ngoja",fetch:"leta",call:"ita",return:"rudisha",make:"tengeneza",log:"andika",throw:"tupa",catch:"shika",measure:"pima",transition:"mpito",increment:"ongezeko",decrement:"punguza",default:"msingi",go:"nenda",pushUrl:"sukumaUrl",replaceUrl:"badilishaUrl",copy:"nakala",pick:"chagua",beep:"lia",js:"js",async:"sainkroni",render:"chora",swap:"badilishana",morph:"geuza",settle:"tulia",append:"ambatanisha",exit:"toka",install:"sakinisha",breakpoint:"nukta-simama",clear:"safisha",close:"funga",open:"fungua",select:"alama",clone:"nakili",prepend:"tanguliza",focus:"lenga",socket:"soketi"},modifiers:{to:"kwa",from:"kutoka",into:"ndani",with:"na",at:"katika",in:"ndani",of:"ya",as:"kuwa",by:"na",before:"kabla",after:"baada",over:"juu",under:"chini",between:"kati",through:"kupitia",without:"bila"},events:{click:"bonyeza",dblclick:"dblclick",mousedown:"panya_shuka",mouseup:"panya_juu",mouseenter:"panya_ingia",mouseleave:"panya_toka",mouseover:"sogeza juu",mouseout:"panya_nje",mousemove:"panya_sogea",keydown:"kitufe_shuka",keyup:"kitufe_juu",keypress:"keypress",focus:"lenga",blur:"blur",change:"kubadilisha",input:"ingizo",submit:"wasilisha",reset:"reset",load:"pakia",unload:"shuka",resize:"badilisha_ukubwa",scroll:"sogeza",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",touchcancel:"touchcancel"},logical:{when:"wakati",where:"wapi",and:"na",or:"au",not:"si",is:"ni",exists:"ipo",matches:"inafanana",contains:"ina",includes:"pamoja",equals:"sawa",has:"ana",have:"nina",then:"kisha",else:"sivyo",otherwise:"vinginevyo",end:"mwisho",live:"mubashara",changes:"inabadilika"},temporal:{seconds:"sekunde",second:"sekunde",milliseconds:"millisekunde",millisecond:"millisekunde",minutes:"dakika",minute:"dakika",hours:"masaa",hour:"saa",ms:"ms",s:"s",min:"dk",h:"sa"},values:{true:"kweli",false:"uongo",null:"tupu",undefined:"haijafafanuliwa",it:"hiyo",its:"yake",me:"mimi",my:"yangu",myself:"mimi mwenyewe",you:"wewe",your:"yako",yourself:"wewe mwenyewe",element:"kipengele",target:"lengo",detail:"maelezo",event:"tukio",window:"dirisha",document:"hati",body:"mwili",result:"matokeo",value:"thamani"},attributes:{class:"darasa",classes:"madarasa",style:"mtindo",styles:"mitindo",attribute:"sifa",attributes:"sifa",property:"mali",properties:"mali"},expressions:{characters:"herufi",first:"kwanza",last:"wamwisho",next:"ijayo",previous:"iliyopita",prev:"awali",at:"katika",random:"nasibu",closest:"karibu",parent:"mzazi",children:"watoto",within:"ndani_ya",no:"hakuna",empty:"tupu",some:"baadhi","starts with":"huanza na","ends with":"huisha na","ignoring case":"puuza herufi kubwa ndogo","sorted by":"kupangwa kwa","mapped to":"kubadilishwa kuwa","split by":"kugawanywa kwa","joined by":"kuunganishwa kwa"}},Il=cl(Pl,"sw",{allowEnglishFallback:!0}),ql={commands:{on:"em",tell:"dizer",trigger:"disparar",send:"enviar",take:"pegar",put:"colocar",set:"definir",get:"obter",add:"adicionar",remove:"remover",toggle:"alternar",blur:"desfocar",hide:"esconder",show:"mostrar",if:"se",unless:"salvo",repeat:"repetir",for:"para",while:"enquanto",until:"at\u00e9",continue:"continuar",break:"interromper",halt:"parar",wait:"esperar",fetch:"buscar",call:"chamar",return:"retornar",make:"fazer",log:"registrar",throw:"lan\u00e7ar",catch:"capturar",measure:"medir",transition:"transi\u00e7\u00e3o",increment:"incrementar",decrement:"decrementar",default:"padr\u00e3o",go:"ir",pushUrl:"pushUrl",replaceUrl:"substituirUrl",copy:"copiar",pick:"escolher",beep:"apitar",js:"js",async:"ass\u00edncrono",render:"renderizar",swap:"trocar",morph:"transformar",settle:"estabilizar",append:"anexar",exit:"sair",install:"instalar",breakpoint:"ponto-interrup\u00e7\u00e3o",clear:"limpar",close:"fechar",open:"abrir",select:"selecionar",clone:"clonar",prepend:"preceder",focus:"focar",socket:"soquete"},modifiers:{to:"para",from:"de",into:"em",with:"com",at:"em",in:"dentro",of:"de",as:"como",by:"por",before:"antes",after:"depois",over:"sobre",under:"sob",between:"entre",through:"atrav\u00e9s",without:"sem"},events:{click:"clique",dblclick:"duploClique",mouseenter:"mouseEntrar",mouseleave:"mouseSair",mousedown:"mouse pressionado",mouseup:"mouse solto",mouseover:"mouse sobre",mouseout:"mouse fora",mousemove:"mouseMover",keydown:"tecla baixo",keyup:"tecla cima",keypress:"teclaPressionar",focus:"foco",blur:"desfoque",change:"mudan\u00e7a",input:"entrada",submit:"envio",reset:"redefinir",load:"carregar",unload:"descarregar",resize:"redimensionar",scroll:"rolar",touchstart:"toqueIn\u00edcio",touchend:"toqueFim",touchmove:"toqueMover",touchcancel:"toqueCancelar"},logical:{when:"quando",where:"onde",and:"e",or:"ou",not:"n\u00e3o",is:"\u00e9",exists:"existe",matches:"corresponde",contains:"cont\u00e9m",includes:"inclui",equals:"igual",has:"tem",have:"tenho",then:"ent\u00e3o",else:"sen\u00e3o",otherwise:"caso_contr\u00e1rio",end:"fim",live:"vivo",changes:"muda"},temporal:{seconds:"segundos",second:"segundo",milliseconds:"milissegundos",millisecond:"milissegundo",minutes:"minutos",minute:"minuto",hours:"horas",hour:"hora",ms:"ms",s:"s",min:"min",h:"h"},values:{true:"verdadeiro",false:"falso",null:"nulo",undefined:"indefinido",it:"isso",its:"seu",me:"eu",my:"meu",myself:"eu mesmo",you:"voc\u00ea",your:"seu",yourself:"voc\u00ea mesmo",element:"elemento",target:"alvo",detail:"detalhe",event:"evento",window:"janela",document:"documento",body:"corpo",result:"resultado",value:"valor"},attributes:{class:"classe",classes:"classes",style:"estilo",styles:"estilos",attribute:"atributo",attributes:"atributos",property:"propriedade",properties:"propriedades"},expressions:{characters:"caracteres",inclusive:"inclusivo",exclusive:"exclusivo",first:"primeiro",last:"\u00faltimo",next:"pr\u00f3ximo",previous:"anterior",prev:"ant",at:"em",random:"aleat\u00f3rio",closest:"maispr\u00f3ximo",parent:"pai",children:"filhos",within:"dentro",no:"nenhum",empty:"vazio",some:"algum","starts with":"come\u00e7a com","ends with":"termina com","ignoring case":"ignorando mai\u00fasculas","sorted by":"ordenado por","mapped to":"mapeado para","split by":"dividido por","joined by":"unido por"}},Nl=cl(ql,"pt",{allowEnglishFallback:!0}),Rl={commands:{on:"su",tell:"dire",trigger:"scatenare",send:"inviare",take:"prendere",put:"mettere",set:"impostare",get:"ottenere",add:"aggiungere",remove:"rimuovere",toggle:"commutare",hide:"nascondere",show:"mostrare",if:"se",unless:"salvo",repeat:"ripetere",for:"per",while:"mentre",until:"fino",continue:"continuare",break:"interrompere",halt:"fermare",wait:"aspettare",fetch:"recuperare",call:"chiamare",return:"ritornare",make:"fare",log:"registrare",throw:"lanciare",catch:"catturare",measure:"misurare",transition:"transizione",increment:"incrementare",decrement:"decrementare",default:"predefinito",go:"andare",pushUrl:"pushUrl",replaceUrl:"sostituireUrl",copy:"copiare",pick:"scegliere",beep:"beep",js:"js",async:"asincrono",render:"renderizzare",swap:"scambiare",morph:"trasformare",settle:"stabilizzare",append:"accodare",exit:"uscire",install:"installare",breakpoint:"punto-interruzione",clear:"cancellare",close:"chiudere",open:"aprire",select:"selezionare",clone:"clonare",prepend:"anteporre",focus:"focalizzare"},modifiers:{to:"a",from:"da",into:"in",with:"con",at:"a",in:"in",of:"di",as:"come",by:"per",before:"prima",after:"dopo",over:"sopra",under:"sotto",between:"tra",through:"attraverso",without:"senza"},events:{click:"clic",dblclick:"doppioclic",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"mouseentra",mouseleave:"mouseesce",mouseover:"mousesopra",mouseout:"mousefuori",mousemove:"mousemuovi",keydown:"tastogi\u00f9",keyup:"tastosu",keypress:"tastopremi",focus:"fuoco",blur:"sfuocare",change:"cambio",input:"input",submit:"invio",reset:"reimpostare",load:"carica",unload:"scarica",resize:"ridimensiona",scroll:"scorrimento",touchstart:"toccoinizia",touchend:"toccofine",touchmove:"toccomuovi",touchcancel:"toccoannulla"},logical:{when:"quando",where:"dove",and:"e",or:"o",not:"non",is:"\u00e8",exists:"esiste",matches:"corrisponde",contains:"contiene",includes:"include",equals:"uguale",has:"ha",have:"ho",then:"allora",else:"altrimenti",otherwise:"altrimenti",end:"fine",live:"vivo",changes:"cambia"},temporal:{seconds:"secondi",second:"secondo",milliseconds:"millisecondi",millisecond:"millisecondo",minutes:"minuti",minute:"minuto",hours:"ore",hour:"ora",ms:"ms",s:"s",min:"min",h:"h"},values:{true:"vero",false:"falso",null:"nullo",undefined:"indefinito",it:"esso",its:"suo",me:"io",my:"mio",you:"tu",your:"tuo",yourself:"te stesso",myself:"me stesso",element:"elemento",target:"obiettivo",detail:"dettaglio",event:"evento",window:"finestra",document:"documento",body:"corpo",result:"risultato",value:"valore"},attributes:{class:"classe",classes:"classi",style:"stile",styles:"stili",attribute:"attributo",attributes:"attributi",property:"propriet\u00e0",properties:"propriet\u00e0"},expressions:{characters:"caratteri",inclusive:"inclusivo",exclusive:"esclusivo",first:"primo",last:"ultimo",next:"prossimo",previous:"precedente",prev:"prec",at:"a",random:"casuale",closest:"vicino",parent:"genitore",children:"figli",within:"dentro",no:"nessun",empty:"vuoto",some:"qualche","starts with":"inizia con","ends with":"finisce con","ignoring case":"ignorando maiuscole","sorted by":"ordinato per","mapped to":"trasformato in","split by":"diviso per","joined by":"unito per"}};cl(Rl,"it",{allowEnglishFallback:!0});var Ml={commands:{on:"khi",tell:"n\u00f3i v\u1edbi",trigger:"k\u00edch ho\u1ea1t",send:"g\u1eedi",take:"l\u1ea5y",put:"\u0111\u1eb7t",set:"g\u00e1n",get:"l\u1ea5y gi\u00e1 tr\u1ecb",add:"th\u00eam",remove:"x\u00f3a",toggle:"chuy\u1ec3n \u0111\u1ed5i",hide:"\u1ea9n",show:"hi\u1ec3n th\u1ecb",if:"n\u1ebfu",unless:"tr\u1eeb khi",repeat:"l\u1eb7p l\u1ea1i",for:"v\u1edbi m\u1ed7i",while:"trong khi",until:"cho \u0111\u1ebfn khi",continue:"ti\u1ebfp t\u1ee5c",break:"d\u1eebng",halt:"d\u1eebng l\u1ea1i",wait:"ch\u1edd",fetch:"t\u1ea3i",call:"g\u1ecdi",return:"tr\u1ea3 v\u1ec1",make:"t\u1ea1o",log:"in ra",throw:"n\u00e9m",catch:"b\u1eaft",measure:"\u0111o l\u01b0\u1eddng",transition:"chuy\u1ec3n ti\u1ebfp",increment:"t\u0103ng",decrement:"gi\u1ea3m",default:"m\u1eb7c \u0111\u1ecbnh",go:"\u0111i \u0111\u1ebfn",pushUrl:"pushUrl",replaceUrl:"thayTh\u1ebfUrl",copy:"sao ch\u00e9p",pick:"ch\u1ecdn",beep:"beep",js:"js",async:"b\u1ea5t \u0111\u1ed3ng b\u1ed9",render:"k\u1ebft xu\u1ea5t",swap:"ho\u00e1n \u0111\u1ed5i",morph:"bi\u1ebfn \u0111\u1ed5i",settle:"\u1ed5n \u0111\u1ecbnh",append:"n\u1ed1i",exit:"tho\u00e1t",focus:"t\u1eadp trung",blur:"m\u1ea5t t\u1eadp trung",init:"kh\u1edfi t\u1ea1o",behavior:"h\u00e0nh vi",install:"c\u00e0i \u0111\u1eb7t",clone:"nh\u00e2n b\u1ea3n",prepend:"th\u00eam v\u00e0o \u0111\u1ea7u",else:"kh\u00f4ng th\u00ec",breakpoint:"\u0111i\u1ec3m-d\u1eebng",clear:"t\u1ea9y",close:"\u0111\u00f3ng",open:"m\u1edf",select:"\u0111\u00e1nh-d\u1ea5u"},modifiers:{into:"v\u00e0o",before:"tr\u01b0\u1edbc",after:"sau",then:"r\u1ed3i",end:"k\u1ebft th\u00fac",from:"t\u1eeb",to:"\u0111\u1ebfn",with:"v\u1edbi",as:"nh\u01b0",by:"b\u1edfi",on:"tr\u00ean",in:"trong",at:"t\u1ea1i",of:"c\u1ee7a",between:"gi\u1eefa",the:"",times:"l\u1ea7n"},events:{click:"nh\u1ea5p",dblclick:"dblclick",input:"nh\u1eadp",change:"change",submit:"n\u1ed9p",keydown:"keydown",keyup:"keyup",keypress:"keypress",mouseover:"mouseover",mouseout:"mouseout",mouseenter:"mouseenter",mouseleave:"mouseleave",focus:"focus",blur:"blur",reset:"reset",load:"load",scroll:"cu\u1ed9n",resize:"\u0111\u1ed5i k\u00edch th\u01b0\u1edbc"},logical:{when:"khi",where:"\u1edf_\u0111\u00e2u",and:"v\u00e0",or:"ho\u1eb7c",not:"kh\u00f4ng",is:"l\u00e0",equals:"b\u1eb1ng",contains:"ch\u1ee9a",matches:"kh\u1edbp",exists:"t\u1ed3n t\u1ea1i",has:"c\u00f3",have:"c\u00f3",empty:"tr\u1ed1ng",true:"\u0111\u00fang",false:"sai",null:"r\u1ed7ng",else:"kh\u00f4ng th\u00ec",end:"k\u1ebft th\u00fac",then:"r\u1ed3i",live:"live",changes:"thay \u0111\u1ed5i"},temporal:{now:"b\u00e2y gi\u1edd",today:"h\u00f4m nay",tomorrow:"ng\u00e0y mai",yesterday:"h\u00f4m qua",always:"lu\u00f4n lu\u00f4n",never:"kh\u00f4ng bao gi\u1edd",sometimes:"\u0111\u00f4i khi",once:"m\u1ed9t l\u1ea7n",twice:"hai l\u1ea7n",forever:"m\u00e3i m\u00e3i"},values:{true:"\u0111\u00fang",false:"sai",null:"r\u1ed7ng",undefined:"kh\u00f4ng x\u00e1c \u0111\u1ecbnh",none:"kh\u00f4ng c\u00f3",all:"t\u1ea5t c\u1ea3",any:"b\u1ea5t k\u1ef3",some:"m\u1ed9t s\u1ed1",each:"m\u1ed7i",every:"t\u1ea5t c\u1ea3",body:"body",event:"s\u1ef1 ki\u1ec7n",it:"n\u00f3",its:"c\u1ee7a n\u00f3",me:"t\u00f4i",my:"c\u1ee7a t\u00f4i",result:"k\u1ebft qu\u1ea3",target:"m\u1ee5c ti\u00eau",you:"b\u1ea1n",your:"c\u1ee7a b\u1ea1n"},attributes:{id:"id",class:"l\u1edbp",style:"ki\u1ec3u",value:"gi\u00e1 tr\u1ecb",text:"v\u0103n b\u1ea3n",html:"html",src:"ngu\u1ed3n",href:"li\u00ean k\u1ebft",disabled:"v\u00f4 hi\u1ec7u",hidden:"\u1ea9n",checked:"\u0111\u01b0\u1ee3c ch\u1ecdn",selected:"\u0111\u01b0\u1ee3c ch\u1ecdn"},expressions:{random:"ng\u1eabu nhi\u00ean",characters:"k\u00fd t\u1ef1",inclusive:"bao g\u1ed3m",exclusive:"lo\u1ea1i tr\u1eeb",me:"t\u00f4i",my:"c\u1ee7a t\u00f4i",it:"n\u00f3",its:"c\u1ee7a n\u00f3",result:"k\u1ebft qu\u1ea3",event:"s\u1ef1 ki\u1ec7n",target:"m\u1ee5c ti\u00eau",first:"\u0111\u1ea7u ti\u00ean",last:"cu\u1ed1i c\u00f9ng",next:"ti\u1ebfp theo",previous:"tr\u01b0\u1edbc \u0111\u00f3",parent:"cha",children:"con",closest:"g\u1ea7n nh\u1ea5t",empty:"l\u00e0m-r\u1ed7ng","starts with":"b\u1eaft \u0111\u1ea7u b\u1eb1ng","ends with":"k\u1ebft th\u00fac b\u1eb1ng","ignoring case":"kh\u00f4ng ph\u00e2n bi\u1ec7t hoa th\u01b0\u1eddng","sorted by":"s\u1eafp x\u1ebfp theo","mapped to":"\u00e1nh x\u1ea1 th\u00e0nh","split by":"t\u00e1ch b\u1edfi","joined by":"n\u1ed1i b\u1edfi"}};cl(Ml,"vi",{allowEnglishFallback:!0});var $l={commands:{on:"gdy",tell:"powiedz",trigger:"wyzw\u00f3l",send:"wy\u015blij",take:"we\u017a",put:"umie\u015b\u0107",set:"ustaw",get:"uzyskaj",add:"dodaj",remove:"usu\u0144",toggle:"prze\u0142\u0105cz",blur:"rozmyj",hide:"ukryj",show:"poka\u017c",if:"je\u015bli",unless:"chyba",repeat:"powt\u00f3rz",for:"dla",while:"dop\u00f3ki",until:"a\u017c",continue:"kontynuuj",break:"przerwij",halt:"zatrzymaj",wait:"czekaj",fetch:"pobierz",call:"wywo\u0142aj",return:"zwr\u00f3\u0107",make:"utw\u00f3rz",log:"loguj",throw:"rzu\u0107",catch:"z\u0142ap",measure:"zmierz",transition:"animuj",increment:"zwi\u0119ksz",decrement:"zmniejsz",default:"domy\u015blnie",go:"id\u017a",pushUrl:"dodajUrl",replaceUrl:"zamie\u0144Url",copy:"kopiuj",pick:"wybierz",beep:"sygna\u0142",js:"js",async:"async",render:"renderuj",swap:"zamie\u0144",morph:"przekszta\u0142\u0107",settle:"ustabilizuj",append:"do\u0142\u0105cz",exit:"wyjd\u017a",install:"zainstaluj",breakpoint:"punkt-przerwania",clear:"zeruj",close:"zamknij",open:"otw\u00f3rz",select:"zaznacz",clone:"sklonuj",prepend:"poprzed\u017a",focus:"skup"},modifiers:{to:"do",from:"z",into:"do",with:"z",at:"przy",in:"w",of:"z",as:"jako",by:"przez",before:"przed",after:"po",over:"nad",under:"pod",between:"mi\u0119dzy",through:"przez",without:"bez"},events:{click:"klikni\u0119cie",dblclick:"podw\u00f3jneklikni\u0119cie",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"myszwej\u015bcie",mouseleave:"myszwyj\u015bcie",mouseover:"mysznad",mouseout:"myszpoza",mousemove:"myszruch",keydown:"klawiszd\u00f3\u0142",keyup:"klawiszg\u00f3ra",keypress:"klawisznaci\u015bni\u0119cie",focus:"fokus",blur:"rozmycie",change:"zmiana",input:"wej\u015bcie",submit:"wys\u0142aniu",reset:"zresetuj",load:"za\u0142aduj",unload:"wy\u0142aduj",resize:"zmiana rozmiaru",scroll:"przewi\u0144",touchstart:"dotykstart",touchend:"dotykkoniec",touchmove:"dotykruch",touchcancel:"dotykanuluj"},logical:{when:"kiedy",where:"gdzie",and:"i",or:"lub",not:"nie",is:"jest",exists:"istnieje",matches:"pasuje",contains:"zawiera",includes:"obejmuje",equals:"r\u00f3wna si\u0119",has:"ma",have:"mam",then:"wtedy",else:"inaczej",otherwise:"wpp",end:"koniec",live:"\u017cywy",changes:"zmienia"},temporal:{seconds:"sekundy",second:"sekunda",milliseconds:"milisekundy",millisecond:"milisekunda",minutes:"minuty",minute:"minuta",hours:"godziny",hour:"godzina",ms:"ms",s:"s",min:"min",h:"godz"},values:{true:"prawda",false:"fa\u0142sz",null:"null",undefined:"niezdefiniowane",it:"to",its:"jego",me:"ja",my:"m\u00f3j",you:"ty",your:"tw\u00f3j",yourself:"ty sam",myself:"ja sam",element:"element",target:"cel",detail:"szczeg\u00f3\u0142",event:"zdarzenie",window:"okno",document:"dokument",body:"body",result:"wynik",value:"warto\u015b\u0107"},attributes:{class:"klasa",classes:"klasy",style:"styl",styles:"style",attribute:"atrybut",attributes:"atrybuty",property:"w\u0142a\u015bciwo\u015b\u0107",properties:"w\u0142a\u015bciwo\u015bci"},expressions:{characters:"znaki",inclusive:"w\u0142\u0105cznie",exclusive:"wy\u0142\u0105cznie",first:"pierwszy",last:"ostatni",next:"nast\u0119pny",previous:"poprzedni",prev:"poprz",at:"przy",random:"losowy",closest:"najbli\u017cszy",parent:"rodzic",children:"dzieci",within:"wewn\u0105trz",no:"brak",empty:"pusty",some:"jaki\u015b","starts with":"zaczyna si\u0119 od","ends with":"ko\u0144czy si\u0119 na","ignoring case":"ignoruj\u0105c wielko\u015b\u0107 liter","sorted by":"sortowane wed\u0142ug","mapped to":"przekszta\u0142cone na","split by":"podzielone przez","joined by":"po\u0142\u0105czone przez"}};cl($l,"pl",{allowEnglishFallback:!0});var _l={commands:{on:"\u043f\u0440\u0438",tell:"\u0441\u043a\u0430\u0437\u0430\u0442\u044c",trigger:"\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c",send:"\u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c",take:"\u0432\u0437\u044f\u0442\u044c",put:"\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c",set:"\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c",get:"\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c",add:"\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c",remove:"\u0443\u0434\u0430\u043b\u0438\u0442\u044c",toggle:"\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c",hide:"\u0441\u043a\u0440\u044b\u0442\u044c",show:"\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c",scroll:"\u043f\u0440\u043e\u043a\u0440\u0443\u0442\u0438\u0442\u044c",if:"\u0435\u0441\u043b\u0438",unless:"\u043a\u0440\u043e\u043c\u0435",repeat:"\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",for:"\u0434\u043b\u044f",while:"\u043f\u043e\u043a\u0430",until:"\u0434\u043e",continue:"\u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c",break:"\u043f\u0440\u0435\u0440\u0432\u0430\u0442\u044c",halt:"\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c",wait:"\u0436\u0434\u0430\u0442\u044c",fetch:"\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c",call:"\u0432\u044b\u0437\u0432\u0430\u0442\u044c",return:"\u0432\u0435\u0440\u043d\u0443\u0442\u044c",make:"\u0441\u043e\u0437\u0434\u0430\u0442\u044c",log:"\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c",throw:"\u0431\u0440\u043e\u0441\u0438\u0442\u044c",catch:"\u043f\u043e\u0439\u043c\u0430\u0442\u044c",measure:"\u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c",transition:"\u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c",increment:"\u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c",decrement:"\u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c",default:"\u043f\u043e_\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e",go:"\u043f\u0435\u0440\u0435\u0439\u0442\u0438",pushUrl:"\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c_url",replaceUrl:"\u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c_url",copy:"\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c",pick:"\u0432\u044b\u0431\u0440\u0430\u0442\u044c",beep:"\u0437\u0432\u0443\u043a",js:"js",async:"\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e",render:"\u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c",swap:"\u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c",morph:"\u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c",settle:"\u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c",append:"\u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c",exit:"\u0432\u044b\u0439\u0442\u0438",else:"\u0438\u043d\u0430\u0447\u0435",install:"\u0438\u043d\u0441\u0442\u0430\u043b\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c",init:"\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c",behavior:"\u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435",focus:"\u0441\u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c",blur:"\u0440\u0430\u0437\u043c\u044b\u0442\u044c",clone:"\u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c",prepend:"\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043d\u0430\u0447\u0430\u043b\u043e",breakpoint:"\u0442\u043e\u0447\u043a\u0430-\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0430",clear:"\u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c",close:"\u0437\u0430\u043a\u0440\u044b\u0442\u044c",open:"\u043e\u0442\u043a\u0440\u044b\u0442\u044c",select:"\u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c"},modifiers:{to:"\u043a",from:"\u0438\u0437",into:"\u0432",with:"\u0441",at:"\u0443",in:"\u0432",of:"\u0438\u0437",as:"\u043a\u0430\u043a",by:"\u043d\u0430",before:"\u0434\u043e",after:"\u043f\u043e\u0441\u043b\u0435",over:"\u043d\u0430\u0434",under:"\u043f\u043e\u0434",between:"\u043c\u0435\u0436\u0434\u0443",through:"\u0447\u0435\u0440\u0435\u0437",without:"\u0431\u0435\u0437",on:"\u043d\u0430"},events:{click:"\u043a\u043b\u0438\u043a",dblclick:"\u0434\u0432\u043e\u0439\u043d\u043e\u0439_\u043a\u043b\u0438\u043a",mousedown:"\u043c\u044b\u0448\u044c\u0432\u043d\u0438\u0437",mouseup:"\u043c\u044b\u0448\u044c\u0432\u0432\u0435\u0440\u0445",mouseenter:"\u043c\u044b\u0448\u044c_\u0432\u0445\u043e\u0434",mouseleave:"\u043c\u044b\u0448\u044c_\u0432\u044b\u0445\u043e\u0434",mouseover:"\u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0435",mouseout:"\u0443\u0445\u043e\u0434",mousemove:"\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435_\u043c\u044b\u0448\u0438",keydown:"\u043a\u043b\u0430\u0432\u0438\u0448\u0430_\u0432\u043d\u0438\u0437",keyup:"\u043a\u043b\u0430\u0432\u0438\u0448\u0430_\u0432\u0432\u0435\u0440\u0445",keypress:"\u043d\u0430\u0436\u0430\u0442\u0438\u0435_\u043a\u043b\u0430\u0432\u0438\u0448\u0438",focus:"\u0444\u043e\u043a\u0443\u0441",blur:"\u043f\u043e\u0442\u0435\u0440\u044f_\u0444\u043e\u043a\u0443\u0441\u0430",change:"\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435",input:"\u0432\u0432\u043e\u0434",submit:"\u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430",reset:"\u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c",load:"\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430",unload:"\u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430",resize:"\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u0440\u0430\u0437\u043c\u0435\u0440\u0430",scroll:"\u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430",touchstart:"\u043a\u0430\u0441\u0430\u043d\u0438\u0435_\u043d\u0430\u0447\u0430\u043b\u043e",touchend:"\u043a\u0430\u0441\u0430\u043d\u0438\u0435_\u043a\u043e\u043d\u0435\u0446",touchmove:"\u043a\u0430\u0441\u0430\u043d\u0438\u0435_\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435",touchcancel:"\u043a\u0430\u0441\u0430\u043d\u0438\u0435_\u043e\u0442\u043c\u0435\u043d\u0430"},logical:{when:"\u043a\u043e\u0433\u0434\u0430",where:"\u0433\u0434\u0435",and:"\u0438",or:"\u0438\u043b\u0438",not:"\u043d\u0435",is:"\u0435\u0441\u0442\u044c",exists:"\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442",matches:"\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442",contains:"\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442",includes:"\u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442",equals:"\u0440\u0430\u0432\u043d\u043e",then:"\u0437\u0430\u0442\u0435\u043c",else:"\u0438\u043d\u0430\u0447\u0435",otherwise:"\u0432_\u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c_\u0441\u043b\u0443\u0447\u0430\u0435",end:"\u043a\u043e\u043d\u0435\u0446",live:"\u0436\u0438\u0432\u043e\u0439",changes:"\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f",has:"\u0438\u043c\u0435\u0435\u0442",have:"\u0438\u043c\u0435\u044e",isNot:"\u043d\u0435_\u0435\u0441\u0442\u044c",empty:"\u043f\u0443\u0441\u0442\u043e\u0439"},temporal:{seconds:"\u0441\u0435\u043a\u0443\u043d\u0434",second:"\u0441\u0435\u043a\u0443\u043d\u0434\u0430",milliseconds:"\u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434",millisecond:"\u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u0430",minutes:"\u043c\u0438\u043d\u0443\u0442",minute:"\u043c\u0438\u043d\u0443\u0442\u0430",hours:"\u0447\u0430\u0441\u043e\u0432",hour:"\u0447\u0430\u0441",ms:"\u043c\u0441",s:"\u0441",min:"\u043c\u0438\u043d",h:"\u0447",forever:"\u0432\u0441\u0435\u0433\u0434\u0430",once:"\u043e\u0434\u043d\u0430\u0436\u0434\u044b",every:"\u043a\u0430\u0436\u0434\u044b\u0439",until:"\u0434\u043e"},values:{true:"\u0438\u0441\u0442\u0438\u043d\u0430",false:"\u043b\u043e\u0436\u044c",null:"\u043d\u0438\u0447\u0435\u0433\u043e",undefined:"\u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e",it:"\u044d\u0442\u043e",its:"\u0435\u0433\u043e",me:"\u044f",my:"\u043c\u043e\u0439",you:"\u0442\u044b",your:"\u0442\u0432\u043e\u0439",yourself:"\u0441\u0430\u043c",myself:"\u044f_\u0441\u0430\u043c",element:"\u044d\u043b\u0435\u043c\u0435\u043d\u0442",target:"\u0446\u0435\u043b\u044c",detail:"\u0434\u0435\u0442\u0430\u043b\u0438",event:"\u0441\u043e\u0431\u044b\u0442\u0438\u0435",window:"\u043e\u043a\u043d\u043e",document:"\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442",body:"\u0442\u0435\u043b\u043e",result:"\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442",value:"\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435",first:"\u043f\u0435\u0440\u0432\u044b\u0439",last:"\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439",next:"\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439",previous:"\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439",closest:"\u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439",parent:"\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c"},attributes:{class:"\u043a\u043b\u0430\u0441\u0441",classes:"\u043a\u043b\u0430\u0441\u0441\u044b",style:"\u0441\u0442\u0438\u043b\u044c",styles:"\u0441\u0442\u0438\u043b\u0438",attribute:"\u0430\u0442\u0440\u0438\u0431\u0443\u0442",attributes:"\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b",property:"\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e",properties:"\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430",disabled:"\u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043e",hidden:"\u0441\u043a\u0440\u044b\u0442\u043e",checked:"\u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043e",selected:"\u0432\u044b\u0431\u0440\u0430\u043d\u043e",readonly:"\u0442\u043e\u043b\u044c\u043a\u043e_\u0447\u0442\u0435\u043d\u0438\u0435",required:"\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e",text:"\u0442\u0435\u043a\u0441\u0442",html:"html"},expressions:{characters:"\u0441\u0438\u043c\u0432\u043e\u043b\u044b",inclusive:"\u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e",exclusive:"\u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e",first:"\u043f\u0435\u0440\u0432\u044b\u0439",last:"\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439",next:"\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439",previous:"\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439",prev:"\u043f\u0440\u0435\u0434",at:"\u0432",random:"\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439",closest:"\u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439",parent:"\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c",children:"\u0434\u0435\u0442\u0438",within:"\u0432\u043d\u0443\u0442\u0440\u0438",no:"\u043d\u0435\u0442",empty:"\u043f\u0443\u0441\u0442\u043e\u0439",some:"\u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435","starts with":"\u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f_\u0441","ends with":"\u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f_\u043d\u0430","ignoring case":"\u0431\u0435\u0437_\u0443\u0447\u0451\u0442\u0430_\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430","sorted by":"\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e_\u043f\u043e","mapped to":"\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043e_\u0432","split by":"\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043e_\u043f\u043e","joined by":"\u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043e_\u0447\u0435\u0440\u0435\u0437"}};cl(_l,"ru",{allowEnglishFallback:!0});var zl={commands:{on:"\u043f\u0440\u0438",tell:"\u0441\u043a\u0430\u0437\u0430\u0442\u0438",trigger:"\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0438",send:"\u043d\u0430\u0434\u0456\u0441\u043b\u0430\u0442\u0438",take:"\u0432\u0437\u044f\u0442\u0438",put:"\u043f\u043e\u043a\u043b\u0430\u0441\u0442\u0438",set:"\u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0438",get:"\u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438",add:"\u0434\u043e\u0434\u0430\u0442\u0438",remove:"\u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438",toggle:"\u043f\u0435\u0440\u0435\u043c\u043a\u043d\u0443\u0442\u0438",hide:"\u0441\u0445\u043e\u0432\u0430\u0442\u0438",show:"\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0438",scroll:"\u043f\u0440\u043e\u043a\u0440\u0443\u0442\u0438\u0442\u0438",if:"\u044f\u043a\u0449\u043e",unless:"\u043a\u0440\u0456\u043c",repeat:"\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0438",for:"\u0434\u043b\u044f",while:"\u043f\u043e\u043a\u0438",until:"\u0434\u043e",continue:"\u043f\u0440\u043e\u0434\u043e\u0432\u0436\u0438\u0442\u0438",break:"\u043f\u0435\u0440\u0435\u0440\u0432\u0430\u0442\u0438",halt:"\u0437\u0443\u043f\u0438\u043d\u0438\u0442\u0438",wait:"\u0447\u0435\u043a\u0430\u0442\u0438",fetch:"\u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438",call:"\u0432\u0438\u043a\u043b\u0438\u043a\u0430\u0442\u0438",return:"\u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u0438",make:"\u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438",log:"\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u0438",throw:"\u043a\u0438\u043d\u0443\u0442\u0438",catch:"\u0437\u043b\u043e\u0432\u0438\u0442\u0438",measure:"\u0432\u0438\u043c\u0456\u0440\u044f\u0442\u0438",transition:"\u0430\u043d\u0456\u043c\u0443\u0432\u0430\u0442\u0438",increment:"\u0437\u0431\u0456\u043b\u044c\u0448\u0438\u0442\u0438",decrement:"\u0437\u043c\u0435\u043d\u0448\u0438\u0442\u0438",default:"\u0437\u0430_\u0437\u0430\u043c\u043e\u0432\u0447\u0443\u0432\u0430\u043d\u043d\u044f\u043c",go:"\u043f\u0435\u0440\u0435\u0439\u0442\u0438",pushUrl:"\u0434\u043e\u0434\u0430\u0442\u0438_url",replaceUrl:"\u0437\u0430\u043c\u0456\u043d\u0438\u0442\u0438_url",copy:"\u043a\u043e\u043f\u0456\u044e\u0432\u0430\u0442\u0438",pick:"\u0432\u0438\u0431\u0440\u0430\u0442\u0438",beep:"\u0437\u0432\u0443\u043a",js:"js",async:"\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e",render:"\u0432\u0456\u0434\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0438",swap:"\u043f\u043e\u043c\u0456\u043d\u044f\u0442\u0438",morph:"\u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0443\u0432\u0430\u0442\u0438",settle:"\u0441\u0442\u0430\u0431\u0456\u043b\u0456\u0437\u0443\u0432\u0430\u0442\u0438",append:"\u0434\u043e\u043f\u0438\u0441\u0430\u0442\u0438",exit:"\u0432\u0438\u0439\u0442\u0438",else:"\u0456\u043d\u0430\u043a\u0448\u0435",install:"\u0456\u043d\u0441\u0442\u0430\u043b\u044e\u0432\u0430\u0442\u0438",init:"\u0456\u043d\u0456\u0446\u0456\u0430\u043b\u0456\u0437\u0443\u0432\u0430\u0442\u0438",behavior:"\u043f\u043e\u0432\u0435\u0434\u0456\u043d\u043a\u0430",focus:"\u0441\u0444\u043e\u043a\u0443\u0441\u0443\u0432\u0430\u0442\u0438",blur:"\u0440\u043e\u0437\u0444\u043e\u043a\u0443\u0441\u0443\u0432\u0430\u0442\u0438",clone:"\u043a\u043b\u043e\u043d\u0443\u0432\u0430\u0442\u0438",prepend:"\u0434\u043e\u0434\u0430\u0442\u0438 \u043d\u0430 \u043f\u043e\u0447\u0430\u0442\u043e\u043a",breakpoint:"\u0442\u043e\u0447\u043a\u0430-\u0437\u0443\u043f\u0438\u043d\u043a\u0438",clear:"\u043e\u0447\u0438\u0441\u0442\u0438\u0442\u0438",close:"\u0437\u0430\u043a\u0440\u0438\u0442\u0438",open:"\u0432\u0456\u0434\u043a\u0440\u0438\u0442\u0438",select:"\u0432\u0438\u0434\u0456\u043b\u0438\u0442\u0438"},modifiers:{to:"\u0434\u043e",from:"\u0437",into:"\u0432",with:"\u0437",at:"\u0432",in:"\u0443",of:"\u0437",as:"\u044f\u043a",by:"\u043d\u0430",before:"\u0434\u043e",after:"\u043f\u0456\u0441\u043b\u044f",over:"\u043d\u0430\u0434",under:"\u043f\u0456\u0434",between:"\u043c\u0456\u0436",through:"\u0447\u0435\u0440\u0435\u0437",without:"\u0431\u0435\u0437",on:"\u043d\u0430"},events:{click:"\u043a\u043b\u0456\u043a",dblclick:"\u043f\u043e\u0434\u0432\u0456\u0439\u043d\u0438\u0439_\u043a\u043b\u0456\u043a",mousedown:"\u043c\u0438\u0448\u0430\u0432\u043d\u0438\u0437",mouseup:"\u043c\u0438\u0448\u0430\u0432\u0433\u043e\u0440\u0443",mouseenter:"\u043c\u0438\u0448\u0430_\u0432\u0445\u0456\u0434",mouseleave:"\u043c\u0438\u0448\u0430_\u0432\u0438\u0445\u0456\u0434",mouseover:"\u043d\u0430\u0432\u0435\u0434\u0435\u043d\u043d\u044f",mouseout:"\u0432\u0456\u0434\u0432\u0435\u0434\u0435\u043d\u043d\u044f",mousemove:"\u0440\u0443\u0445_\u043c\u0438\u0448\u0456",keydown:"\u043a\u043b\u0430\u0432\u0456\u0448\u0430_\u0432\u043d\u0438\u0437",keyup:"\u043a\u043b\u0430\u0432\u0456\u0448\u0430_\u0432\u0433\u043e\u0440\u0443",keypress:"\u043d\u0430\u0442\u0438\u0441\u043a\u0430\u043d\u043d\u044f_\u043a\u043b\u0430\u0432\u0456\u0448\u0456",focus:"\u0444\u043e\u043a\u0443\u0441",blur:"\u0440\u043e\u0437\u0444\u043e\u043a\u0443\u0441",change:"\u0437\u043c\u0456\u043d\u0430",input:"\u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044f",submit:"\u043d\u0430\u0434\u0441\u0438\u043b\u0430\u043d\u043d\u044f",reset:"\u0441\u043a\u0438\u043d\u0443\u0442\u0438",load:"\u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f",unload:"\u0432\u0438\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f",resize:"\u0437\u043c\u0456\u043d\u0430\u0440\u043e\u0437\u043c\u0456\u0440\u0443",scroll:"\u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430",touchstart:"\u0434\u043e\u0442\u0438\u043a_\u043f\u043e\u0447\u0430\u0442\u043e\u043a",touchend:"\u0434\u043e\u0442\u0438\u043a_\u043a\u0456\u043d\u0435\u0446\u044c",touchmove:"\u0434\u043e\u0442\u0438\u043a_\u0440\u0443\u0445",touchcancel:"\u0434\u043e\u0442\u0438\u043a_\u0441\u043a\u0430\u0441\u0443\u0432\u0430\u043d\u043d\u044f"},logical:{when:"\u043a\u043e\u043b\u0438",where:"\u0434\u0435",and:"\u0456",or:"\u0430\u0431\u043e",not:"\u043d\u0435",is:"\u0454",exists:"\u0456\u0441\u043d\u0443\u0454",matches:"\u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u0430\u0454",contains:"\u043c\u0456\u0441\u0442\u0438\u0442\u044c",includes:"\u0432\u043a\u043b\u044e\u0447\u0430\u0454",equals:"\u0434\u043e\u0440\u0456\u0432\u043d\u044e\u0454",then:"\u0442\u043e\u0434\u0456",else:"\u0456\u043d\u0430\u043a\u0448\u0435",otherwise:"\u0432_\u0456\u043d\u0448\u043e\u043c\u0443_\u0432\u0438\u043f\u0430\u0434\u043a\u0443",end:"\u043a\u0456\u043d\u0435\u0446\u044c",live:"\u0436\u0438\u0432\u0438\u0439",changes:"\u0437\u043c\u0456\u043d\u044e\u0454\u0442\u044c\u0441\u044f",has:"\u043c\u0430\u0454",have:"\u043c\u0430\u044e",isNot:"\u043d\u0435_\u0454",empty:"\u043f\u043e\u0440\u043e\u0436\u043d\u0456\u0439"},temporal:{seconds:"\u0441\u0435\u043a\u0443\u043d\u0434",second:"\u0441\u0435\u043a\u0443\u043d\u0434\u0430",milliseconds:"\u043c\u0456\u043b\u0456\u0441\u0435\u043a\u0443\u043d\u0434",millisecond:"\u043c\u0456\u043b\u0456\u0441\u0435\u043a\u0443\u043d\u0434\u0430",minutes:"\u0445\u0432\u0438\u043b\u0438\u043d",minute:"\u0445\u0432\u0438\u043b\u0438\u043d\u0430",hours:"\u0433\u043e\u0434\u0438\u043d",hour:"\u0433\u043e\u0434\u0438\u043d\u0430",ms:"\u043c\u0441",s:"\u0441",min:"\u0445\u0432",h:"\u0433\u043e\u0434",forever:"\u0437\u0430\u0432\u0436\u0434\u0438",once:"\u043e\u0434\u0438\u043d_\u0440\u0430\u0437",every:"\u043a\u043e\u0436\u043d\u0438\u0439",until:"\u0434\u043e"},values:{true:"\u0456\u0441\u0442\u0438\u043d\u0430",false:"\u0445\u0438\u0431\u043d\u0456\u0441\u0442\u044c",null:"\u043d\u0456\u0447\u043e\u0433\u043e",undefined:"\u043d\u0435\u0432\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043e",it:"\u0446\u0435",its:"\u0439\u043e\u0433\u043e",me:"\u044f",my:"\u043c\u0456\u0439",you:"\u0442\u0438",your:"\u0442\u0432\u0456\u0439",yourself:"\u0441\u0430\u043c",myself:"\u044f_\u0441\u0430\u043c",element:"\u0435\u043b\u0435\u043c\u0435\u043d\u0442",target:"\u0446\u0456\u043b\u044c",detail:"\u0434\u0435\u0442\u0430\u043b\u0456",event:"\u043f\u043e\u0434\u0456\u044f",window:"\u0432\u0456\u043a\u043d\u043e",document:"\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442",body:"\u0442\u0456\u043b\u043e",result:"\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442",value:"\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f",first:"\u043f\u0435\u0440\u0448\u0438\u0439",last:"\u043e\u0441\u0442\u0430\u043d\u043d\u0456\u0439",next:"\u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0438\u0439",previous:"\u043f\u043e\u043f\u0435\u0440\u0435\u0434\u043d\u0456\u0439",closest:"\u043d\u0430\u0439\u0431\u043b\u0438\u0436\u0447\u0438\u0439",parent:"\u0431\u0430\u0442\u044c\u043a\u0456\u0432\u0441\u044c\u043a\u0438\u0439"},attributes:{class:"\u043a\u043b\u0430\u0441",classes:"\u043a\u043b\u0430\u0441\u0438",style:"\u0441\u0442\u0438\u043b\u044c",styles:"\u0441\u0442\u0438\u043b\u0456",attribute:"\u0430\u0442\u0440\u0438\u0431\u0443\u0442",attributes:"\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0438",property:"\u0432\u043b\u0430\u0441\u0442\u0438\u0432\u0456\u0441\u0442\u044c",properties:"\u0432\u043b\u0430\u0441\u0442\u0438\u0432\u043e\u0441\u0442\u0456",disabled:"\u0432\u0438\u043c\u043a\u043d\u0435\u043d\u043e",hidden:"\u043f\u0440\u0438\u0445\u043e\u0432\u0430\u043d\u043e",checked:"\u043f\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u043e",selected:"\u0432\u0438\u0431\u0440\u0430\u043d\u043e",readonly:"\u043b\u0438\u0448\u0435_\u0447\u0438\u0442\u0430\u043d\u043d\u044f",required:"\u043e\u0431\u043e\u0432'\u044f\u0437\u043a\u043e\u0432\u043e",text:"\u0442\u0435\u043a\u0441\u0442",html:"html"},expressions:{characters:"\u0441\u0438\u043c\u0432\u043e\u043b\u0438",inclusive:"\u0432\u043a\u043b\u044e\u0447\u043d\u043e",exclusive:"\u0432\u0438\u043a\u043b\u044e\u0447\u043d\u043e",first:"\u043f\u0435\u0440\u0448\u0438\u0439",last:"\u043e\u0441\u0442\u0430\u043d\u043d\u0456\u0439",next:"\u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0438\u0439",previous:"\u043f\u043e\u043f\u0435\u0440\u0435\u0434\u043d\u0456\u0439",prev:"\u043f\u043e\u043f\u0435\u0440",at:"\u0432",random:"\u0432\u0438\u043f\u0430\u0434\u043a\u043e\u0432\u0438\u0439",closest:"\u043d\u0430\u0439\u0431\u043b\u0438\u0436\u0447\u0438\u0439",parent:"\u0431\u0430\u0442\u044c\u043a\u0456\u0432\u0441\u044c\u043a\u0438\u0439",children:"\u0434\u0456\u0442\u0438",within:"\u0432\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0456",no:"\u043d\u0456",empty:"\u043f\u043e\u0440\u043e\u0436\u043d\u0456\u0439",some:"\u0434\u0435\u044f\u043a\u0456","starts with":"\u043f\u043e\u0447\u0438\u043d\u0430\u0454\u0442\u044c\u0441\u044f_\u0437","ends with":"\u0437\u0430\u043a\u0456\u043d\u0447\u0443\u0454\u0442\u044c\u0441\u044f_\u043d\u0430","ignoring case":"\u0431\u0435\u0437_\u0443\u0440\u0430\u0445\u0443\u0432\u0430\u043d\u043d\u044f_\u0440\u0435\u0433\u0456\u0441\u0442\u0440\u0443","sorted by":"\u0432\u0456\u0434\u0441\u043e\u0440\u0442\u043e\u0432\u0430\u043d\u043e_\u0437\u0430","mapped to":"\u043f\u0435\u0440\u0435\u0442\u0432\u043e\u0440\u0435\u043d\u043e_\u043d\u0430","split by":"\u0440\u043e\u0437\u0434\u0456\u043b\u0435\u043d\u043e_\u0437\u0430","joined by":"\u043e\u0431'\u0454\u0434\u043d\u0430\u043d\u043e_\u0447\u0435\u0440\u0435\u0437"}};cl(zl,"uk",{allowEnglishFallback:!0});var Vl={commands:{on:"\u092a\u0930",tell:"\u092c\u0924\u093e\u090f\u0902",trigger:"\u091f\u094d\u0930\u093f\u0917\u0930",send:"\u092d\u0947\u091c\u0947\u0902",take:"\u0932\u0947\u0902",put:"\u0930\u0916\u0947\u0902",set:"\u0938\u0947\u091f",get:"\u092a\u094d\u0930\u093e\u092a\u094d\u0924",add:"\u091c\u094b\u0921\u093c\u0947\u0902",remove:"\u0939\u091f\u093e\u090f\u0902",toggle:"\u091f\u0949\u0917\u0932",hide:"\u091b\u093f\u092a\u093e\u090f\u0902",show:"\u0926\u093f\u0916\u093e\u090f\u0902",if:"\u0905\u0917\u0930",unless:"\u091c\u092c \u0924\u0915 \u0928\u0939\u0940\u0902",repeat:"\u0926\u094b\u0939\u0930\u093e\u090f\u0902",for:"\u0939\u0947\u0924\u0941",while:"\u091c\u092c \u0924\u0915",until:"\u0924\u0915",continue:"\u091c\u093e\u0930\u0940",break:"\u0930\u094b\u0915\u0947\u0902",halt:"\u0930\u094b\u0915\u0947\u0902",wait:"\u092a\u094d\u0930\u0924\u0940\u0915\u094d\u0937\u093e",fetch:"\u0932\u093e\u090f\u0902",call:"\u0915\u0949\u0932",return:"\u0932\u094c\u091f\u093e\u090f\u0902",make:"\u092c\u0928\u093e\u090f\u0902",log:"\u0932\u0949\u0917",throw:"\u092b\u0947\u0902\u0915\u0947\u0902",catch:"\u092a\u0915\u0921\u093c\u0947\u0902",measure:"\u092e\u093e\u092a\u0947\u0902",transition:"\u0938\u0902\u0915\u094d\u0930\u092e\u0923",increment:"\u092c\u0922\u093c\u093e\u090f\u0902",decrement:"\u0918\u091f\u093e\u090f\u0902",default:"\u0921\u093f\u092b\u093c\u0949\u0932\u094d\u091f",go:"\u091c\u093e\u090f\u0902",pushUrl:"url_\u091c\u094b\u0921\u093c\u0947\u0902",replaceUrl:"url_\u092c\u0926\u0932\u0947\u0902",copy:"\u0915\u0949\u092a\u0940",pick:"\u091a\u0941\u0928\u0947\u0902",beep:"\u092c\u0940\u092a",js:"\u091c\u0947\u090f\u0938",async:"\u0905\u0938\u093f\u0902\u0915",render:"\u0930\u0947\u0902\u0921\u0930",swap:"\u0935\u093f\u0928\u093f\u092e\u092f",morph:"\u0930\u0942\u092a\u093e\u0902\u0924\u0930",settle:"\u0938\u094d\u0925\u093f\u0930",append:"\u0938\u0902\u0932\u0917\u094d\u0928",exit:"\u092c\u093e\u0939\u0930",else:"\u0935\u0930\u0928\u093e",install:"\u0907\u0902\u0938\u094d\u091f\u0949\u0932",init:"\u092a\u094d\u0930\u093e\u0930\u0902\u092d",behavior:"\u0935\u094d\u092f\u0935\u0939\u093e\u0930",focus:"\u092b\u094b\u0915\u0938",blur:"\u0927\u0941\u0902\u0927\u0932\u093e",clone:"\u0915\u094d\u0932\u094b\u0928",prepend:"\u091c\u094b\u0921\u093c\u0947\u0902_\u0936\u0941\u0930\u0942",breakpoint:"\u092c\u094d\u0930\u0947\u0915\u092a\u094d\u0935\u093e\u0907\u0902\u091f",clear:"\u0938\u093e\u092b\u093c-\u0915\u0930\u0947\u0902",close:"\u092c\u0902\u0926-\u0915\u0930\u0947\u0902",open:"\u0916\u094b\u0932\u0947\u0902",select:"\u091a\u093f\u0939\u094d\u0928\u093f\u0924-\u0915\u0930\u0947\u0902",socket:"\u0938\u0949\u0915\u0947\u091f"},modifiers:{to:"\u0915\u094b",from:"\u0938\u0947",into:"\u092e\u0947\u0902",with:"\u0915\u0947_\u0938\u093e\u0925",at:"\u092a\u0930",in:"\u092e\u0947\u0902",of:"\u0915\u093e",as:"\u0915\u0947_\u0930\u0942\u092a_\u092e\u0947\u0902",by:"\u0926\u094d\u0935\u093e\u0930\u093e",before:"\u0938\u0947 \u092a\u0939\u0932\u0947",after:"\u0915\u0947 \u092c\u093e\u0926",over:"\u0915\u0947_\u090a\u092a\u0930",under:"\u0915\u0947_\u0928\u0940\u091a\u0947",between:"\u0915\u0947_\u092c\u0940\u091a",through:"\u0915\u0947_\u092e\u093e\u0927\u094d\u092f\u092e_\u0938\u0947",without:"\u0915\u0947_\u092c\u093f\u0928\u093e",on:"\u092a\u0930"},events:{click:"\u0915\u094d\u0932\u093f\u0915",dblclick:"\u0921\u092c\u0932_\u0915\u094d\u0932\u093f\u0915",mousedown:"\u092e\u093e\u0909\u0938\u0928\u0940\u091a\u0947",mouseup:"\u092e\u093e\u0909\u0938\u090a\u092a\u0930",mouseenter:"\u092e\u093e\u0909\u0938_\u092a\u094d\u0930\u0935\u0947\u0936",mouseleave:"\u092e\u093e\u0909\u0938_\u092c\u093e\u0939\u0930",mouseover:"\u092e\u093e\u0909\u0938_\u0913\u0935\u0930",mouseout:"\u092e\u093e\u0909\u0938_\u0906\u0909\u091f",mousemove:"\u092e\u093e\u0909\u0938_\u092e\u0942\u0935",keydown:"\u0915\u0940_\u0928\u0940\u091a\u0947",keyup:"\u0915\u0940_\u090a\u092a\u0930",keypress:"\u0915\u0940_\u092a\u094d\u0930\u0947\u0938",focus:"\u092b\u094b\u0915\u0938",blur:"\u0927\u0941\u0902\u0927\u0932\u093e",change:"\u092a\u0930\u093f\u0935\u0930\u094d\u0924\u0928",input:"\u0907\u0928\u092a\u0941\u091f",submit:"\u091c\u092e\u093e",reset:"\u0930\u0940\u0938\u0947\u091f",load:"\u0932\u094b\u0921",unload:"\u0905\u0928\u0932\u094b\u0921",resize:"\u0906\u0915\u093e\u0930_\u092c\u0926\u0932\u0947\u0902",scroll:"\u0938\u094d\u0915\u094d\u0930\u0949\u0932",touchstart:"\u091f\u091a_\u0936\u0941\u0930\u0942",touchend:"\u091f\u091a_\u0938\u092e\u093e\u092a\u094d\u0924",touchmove:"\u091f\u091a_\u092e\u0942\u0935",touchcancel:"\u091f\u091a_\u0930\u0926\u094d\u0926"},logical:{when:"\u091c\u092c",where:"\u0915\u0939\u093e\u0901",and:"\u0914\u0930",or:"\u092f\u093e",not:"\u0928\u0939\u0940\u0902",is:"\u0939\u0948",exists:"\u092e\u094c\u091c\u0942\u0926",matches:"\u092e\u0947\u0932 \u0916\u093e\u0924\u093e",contains:"\u0936\u093e\u092e\u093f\u0932",includes:"\u092e\u0947\u0902_\u0939\u0948",equals:"\u092c\u0930\u093e\u092c\u0930",then:"\u092b\u093f\u0930",else:"\u0935\u0930\u0928\u093e",otherwise:"\u0905\u0928\u094d\u092f\u0925\u093e",end:"\u0938\u092e\u093e\u092a\u094d\u0924",live:"\u0932\u093e\u0907\u0935",changes:"\u092c\u0926\u0932\u0928\u0947 \u092a\u0930",has:"\u0939\u0948",have:"\u0939\u0948",isNot:"\u0928\u0939\u0940\u0902_\u0939\u0948",empty:"\u0916\u093e\u0932\u0940"},temporal:{seconds:"\u0938\u0947\u0915\u0902\u0921",second:"\u0938\u0947\u0915\u0902\u0921",milliseconds:"\u092e\u093f\u0932\u0940\u0938\u0947\u0915\u0902\u0921",millisecond:"\u092e\u093f\u0932\u0940\u0938\u0947\u0915\u0902\u0921",minutes:"\u092e\u093f\u0928\u091f",minute:"\u092e\u093f\u0928\u091f",hours:"\u0918\u0902\u091f\u0947",hour:"\u0918\u0902\u091f\u093e",ms:"\u092e\u093f\u0938\u0947",s:"\u0938\u0947",min:"\u092e\u093f",h:"\u0918\u0902",forever:"\u0939\u092e\u0947\u0936\u093e",once:"\u090f\u0915_\u092c\u093e\u0930",every:"\u0939\u0930",until:"\u0924\u0915"},values:{true:"\u0938\u091a",false:"\u091d\u0942\u0920",null:"\u0916\u093e\u0932\u0940",undefined:"\u0905\u092a\u0930\u093f\u092d\u093e\u0937\u093f\u0924",it:"\u092f\u0939",its:"\u0907\u0938\u0915\u093e",me:"\u092e\u0948\u0902",my:"\u092e\u0947\u0930\u093e",you:"\u0906\u092a",your:"\u0906\u092a\u0915\u093e",yourself:"\u0938\u094d\u0935\u092f\u0902",myself:"\u092e\u0948\u0902_\u0938\u094d\u0935\u092f\u0902",element:"\u0924\u0924\u094d\u0935",target:"\u0932\u0915\u094d\u0937\u094d\u092f",detail:"\u0935\u093f\u0935\u0930\u0923",event:"\u0918\u091f\u0928\u093e",window:"\u0935\u093f\u0902\u0921\u094b",document:"\u0926\u0938\u094d\u0924\u093e\u0935\u0947\u091c\u093c",body:"\u092c\u0949\u0921\u0940",result:"\u092a\u0930\u093f\u0923\u093e\u092e",value:"\u092e\u093e\u0928",first:"\u092a\u0939\u0932\u093e",last:"\u0905\u0902\u0924\u093f\u092e",next:"\u0905\u0917\u0932\u093e",previous:"\u092a\u093f\u091b\u0932\u093e",closest:"\u0928\u093f\u0915\u091f\u0924\u092e",parent:"\u092e\u0942\u0932"},attributes:{class:"\u0915\u094d\u0932\u093e\u0938",classes:"\u0915\u094d\u0932\u093e\u0938\u0947\u0938",style:"\u0938\u094d\u091f\u093e\u0907\u0932",styles:"\u0938\u094d\u091f\u093e\u0907\u0932\u094d\u0938",attribute:"\u0917\u0941\u0923",attributes:"\u0917\u0941\u0923",property:"\u0938\u0902\u092a\u0924\u094d\u0924\u093f",properties:"\u0938\u0902\u092a\u0924\u094d\u0924\u093f\u092f\u093e\u0901",disabled:"\u0905\u0915\u094d\u0937\u092e",hidden:"\u091b\u093f\u092a\u093e",checked:"\u091a\u0947\u0915",selected:"\u091a\u092f\u0928\u093f\u0924",readonly:"\u0915\u0947\u0935\u0932_\u092a\u0922\u093c\u0928\u0947",required:"\u0906\u0935\u0936\u094d\u092f\u0915",text:"\u092a\u093e\u0920",html:"html"},expressions:{characters:"\u0905\u0915\u094d\u0937\u0930",first:"\u092a\u0939\u0932\u093e",last:"\u0905\u0902\u0924\u093f\u092e",next:"\u0905\u0917\u0932\u093e",previous:"\u092a\u093f\u091b\u0932\u093e",prev:"\u092a\u093f\u091b",at:"\u092a\u0930",random:"\u092f\u093e\u0926\u0943\u091a\u094d\u091b\u093f\u0915",closest:"\u0928\u093f\u0915\u091f\u0924\u092e",parent:"\u092e\u0942\u0932",children:"\u092c\u091a\u094d\u091a\u0947",within:"\u0915\u0947_\u0905\u0902\u0926\u0930",no:"\u0928\u0939\u0940\u0902",empty:"\u0916\u093e\u0932\u0940",some:"\u0915\u0941\u091b","starts with":"\u0938\u0947_\u0936\u0941\u0930\u0942","ends with":"\u092a\u0930_\u0938\u092e\u093e\u092a\u094d\u0924","ignoring case":"\u0915\u0947\u0938_\u0905\u0928\u0926\u0947\u0916\u093e","sorted by":"\u0926\u094d\u0935\u093e\u0930\u093e_\u0915\u094d\u0930\u092e\u092c\u0926\u094d\u0927","mapped to":"\u092e\u0947\u0902_\u092a\u0930\u093f\u0935\u0930\u094d\u0924\u093f\u0924","split by":"\u0926\u094d\u0935\u093e\u0930\u093e_\u0935\u093f\u092d\u093e\u091c\u093f\u0924","joined by":"\u0926\u094d\u0935\u093e\u0930\u093e_\u091c\u0941\u0921\u093c\u093e"}};cl(Vl,"hi",{allowEnglishFallback:!0});var Hl={commands:{on:"\u09a4\u09c7",toggle:"\u099f\u0997\u09b2",add:"\u09af\u09cb\u0997",remove:"\u09b8\u09b0\u09be\u09a8",set:"\u09b8\u09c7\u099f",get:"\u09aa\u09be\u09a8",put:"\u09b0\u09be\u0996\u09c1\u09a8",take:"\u09a8\u09bf\u09a8",show:"\u09a6\u09c7\u0996\u09be\u09a8",hide:"\u09b2\u09c1\u0995\u09be\u09a8",increment:"\u09ac\u09c3\u09a6\u09cd\u09a7\u09bf",decrement:"\u09b9\u09cd\u09b0\u09be\u09b8",if:"\u09af\u09a6\u09bf",else:"\u09a8\u09a4\u09c1\u09ac\u09be",repeat:"\u09aa\u09c1\u09a8\u09b0\u09be\u09ac\u09c3\u09a4\u09cd\u09a4\u09bf",for:"\u099c\u09a8\u09cd\u09af",while:"\u09af\u09a4\u0995\u09cd\u09b7\u09a3",wait:"\u0985\u09aa\u09c7\u0995\u09cd\u09b7\u09be",fetch:"\u0986\u09a8\u09c1\u09a8",call:"\u0995\u09b2",return:"\u09ab\u09bf\u09b0\u09c1\u09a8",log:"\u09b2\u0997",trigger:"\u099f\u09cd\u09b0\u09bf\u0997\u09be\u09b0",send:"\u09aa\u09be\u09a0\u09be\u09a8",go:"\u09af\u09be\u09a8",halt:"\u09a5\u09be\u09ae\u09c1\u09a8",throw:"\u09a8\u09bf\u0995\u09cd\u09b7\u09c7\u09aa",continue:"\u099a\u09be\u09b2\u09bf\u09af\u09bc\u09c7 \u09af\u09be\u09a8",make:"\u09a4\u09c8\u09b0\u09bf \u0995\u09b0\u09c1\u09a8",append:"\u099c\u09c1\u09a1\u09bc\u09c1\u09a8",prepend:"\u09b6\u09c1\u09b0\u09c1\u09a4\u09c7 \u09af\u09cb\u0997",focus:"\u09ab\u09cb\u0995\u09be\u09b8",blur:"\u099d\u09be\u09aa\u09b8\u09be",transition:"\u09b8\u0982\u0995\u09cd\u09b0\u09ae\u09a3",settle:"\u09b8\u09cd\u09a5\u09bf\u09b0",measure:"\u09ae\u09be\u09aa\u09c1\u09a8",async:"\u0985\u09cd\u09af\u09be\u09b8\u09bf\u0999\u09cd\u0995",tell:"\u09ac\u09b2\u09c1\u09a8",default:"\u09a1\u09bf\u09ab\u09b2\u09cd\u099f",init:"\u09b6\u09c1\u09b0\u09c1",behavior:"\u0986\u099a\u09b0\u09a3",install:"\u0987\u09a8\u09b8\u09cd\u099f\u09b2",clone:"\u0995\u09cd\u09b2\u09cb\u09a8",swap:"\u09ac\u09a6\u09b2",morph:"\u09b0\u09c2\u09aa\u09be\u09a8\u09cd\u09a4\u09b0",beep:"\u09ac\u09c0\u09aa",break:"\u09ad\u09be\u0999\u09c1\u09a8",copy:"\u0995\u09aa\u09bf",exit:"\u09ac\u09c7\u09b0",js:"\u099c\u09c7\u098f\u09b8",pick:"\u09ac\u09be\u099b\u09c1\u09a8",render:"\u09b0\u09c7\u09a8\u09cd\u09a1\u09be\u09b0",until:"\u09aa\u09b0\u09cd\u09af\u09a8\u09cd\u09a4",breakpoint:"\u09ac\u09cd\u09b0\u09c7\u0995\u09aa\u09af\u09bc\u09c7\u09a8\u09cd\u099f",clear:"\u09aa\u09b0\u09bf\u09b7\u09cd\u0995\u09be\u09b0",close:"\u09ac\u09a8\u09cd\u09a7",open:"\u0996\u09c1\u09b2\u09c1\u09a8",select:"\u09a8\u09bf\u09b0\u09cd\u09ac\u09be\u099a\u09a8",socket:"\u09b8\u0995\u09c7\u099f"},modifiers:{to:"\u0995\u09c7",from:"\u09a5\u09c7\u0995\u09c7",into:"\u09a4\u09c7",on:"\u09a4\u09c7",with:"\u09b8\u09be\u09a5\u09c7",by:"\u09a6\u09cd\u09ac\u09be\u09b0\u09be",as:"\u09b9\u09bf\u09b8\u09be\u09ac\u09c7",before:"\u0986\u0997\u09c7",after:"\u09aa\u09b0\u09c7",at:"\u098f",in:"\u098f",over:"\u0989\u09aa\u09b0",between:"\u09ae\u09a7\u09cd\u09af\u09c7",then:"\u09a4\u09be\u09b0\u09aa\u09b0",and:"\u098f\u09ac\u0982",end:"\u09b6\u09c7\u09b7",until:"\u09aa\u09b0\u09cd\u09af\u09a8\u09cd\u09a4",of:"\u09b0"},events:{click:"\u0995\u09cd\u09b2\u09bf\u0995",change:"\u09aa\u09b0\u09bf\u09ac\u09b0\u09cd\u09a4\u09a8",input:"\u0987\u09a8\u09aa\u09c1\u099f",submit:"\u099c\u09ae\u09be",load:"\u09b2\u09cb\u09a1",focus:"\u09ab\u09cb\u0995\u09be\u09b8",blur:"\u099d\u09be\u09aa\u09b8\u09be",reset:"\u09b0\u09bf\u09b8\u09c7\u099f",keydown:"keydown",keyup:"keyup",mouseover:"mouseover",mouseout:"mouseout",scroll:"\u09b8\u09cd\u0995\u09cd\u09b0\u09cb\u09b2",resize:"\u09b0\u09bf\u09b8\u09be\u0987\u099c",every:"\u09aa\u09cd\u09b0\u09a4\u09bf"},logical:{if:"\u09af\u09a6\u09bf",when:"\u09af\u0996\u09a8",where:"\u0995\u09cb\u09a5\u09be\u09af\u09bc",else:"\u09a8\u09a4\u09c1\u09ac\u09be",not:"\u09a8\u09be",and:"\u098f\u09ac\u0982",or:"\u0985\u09a5\u09ac\u09be",is:"\u09b9\u09af\u09bc",exists:"\u0986\u099b\u09c7",has:"\u0986\u099b\u09c7",have:"\u0986\u099b\u09bf",empty:"\u0996\u09be\u09b2\u09bf",true:"\u09b8\u09a4\u09cd\u09af",false:"\u09ae\u09bf\u09a5\u09cd\u09af\u09be",null:"\u09b6\u09c2\u09a8\u09cd\u09af",undefined:"\u0985\u09a8\u09bf\u09b0\u09cd\u09a7\u09be\u09b0\u09bf\u09a4",end:"\u09b6\u09c7\u09b7",then:"\u09a4\u09be\u09b0\u09aa\u09b0",live:"\u09b2\u09be\u0987\u09ad",bind:"\u09ac\u09be\u0987\u09a8\u09cd\u09a1",changes:"\u09aa\u09b0\u09bf\u09ac\u09b0\u09cd\u09a4\u09bf\u09a4 \u09b9\u09b2\u09c7"},temporal:{now:"\u098f\u0996\u09a8",seconds:"\u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1",milliseconds:"\u09ae\u09bf\u09b2\u09bf\u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1",minutes:"\u09ae\u09bf\u09a8\u09bf\u099f",hours:"\u0998\u09a3\u09cd\u099f\u09be",forever:"\u099a\u09bf\u09b0\u0995\u09be\u09b2",times:"\u09ac\u09be\u09b0",s:"\u09b8\u09c7",ms:"\u09ae\u09bf\u09b8\u09c7"},values:{me:"\u0986\u09ae\u09bf",my:"\u0986\u09ae\u09be\u09b0",it:"\u098f\u099f\u09bf",its:"\u098f\u09b0",result:"\u09ab\u09b2\u09be\u09ab\u09b2",event:"\u0998\u099f\u09a8\u09be",target:"\u09b2\u0995\u09cd\u09b7\u09cd\u09af",body:"\u09ac\u09a1\u09bf",you:"\u0986\u09aa\u09a8\u09bf",your:"\u09a4\u09cb\u09ae\u09be\u09b0"},attributes:{class:"\u09b6\u09cd\u09b0\u09c7\u09a3\u09bf",id:"\u0986\u0987\u09a1\u09bf",style:"\u09b6\u09c8\u09b2\u09c0",value:"\u09ae\u09be\u09a8",text:"\u09aa\u09be\u09a0\u09cd\u09af",html:"\u098f\u0987\u099a\u099f\u09bf\u098f\u09ae\u098f\u09b2",disabled:"\u0985\u0995\u09cd\u09b7\u09ae",checked:"\u099a\u09c7\u0995 \u0995\u09b0\u09be"},expressions:{characters:"\u0985\u0995\u09cd\u09b7\u09b0",inclusive:"\u0985\u09a8\u09cd\u09a4\u09b0\u09cd\u09ad\u09c1\u0995\u09cd\u09a4",exclusive:"\u09ac\u09be\u09a6",first:"\u09aa\u09cd\u09b0\u09a5\u09ae",last:"\u09b6\u09c7\u09b7",next:"\u09aa\u09b0\u09ac\u09b0\u09cd\u09a4\u09c0",previous:"\u0986\u0997\u09c7\u09b0",closest:"\u09a8\u09bf\u0995\u099f\u09a4\u09ae",parent:"\u09ae\u09c2\u09b2",children:"\u09b8\u09a8\u09cd\u09a4\u09be\u09a8",random:"\u098f\u09b2\u09cb\u09ae\u09c7\u09b2\u09cb",length:"\u09a6\u09c8\u09b0\u09cd\u0998\u09cd\u09af",index:"\u09b8\u09c2\u099a\u0995",empty:"\u0996\u09be\u09b2\u09bf-\u0995\u09b0\u09c1\u09a8","starts with":"\u09a6\u09bf\u09af\u09bc\u09c7_\u09b6\u09c1\u09b0\u09c1","ends with":"\u09a6\u09bf\u09af\u09bc\u09c7_\u09b6\u09c7\u09b7","ignoring case":"\u0995\u09c7\u09b8_\u0989\u09aa\u09c7\u0995\u09cd\u09b7\u09be","sorted by":"\u09a6\u09cd\u09ac\u09be\u09b0\u09be_\u09b8\u09be\u099c\u09be\u09a8\u09cb","mapped to":"\u09a4\u09c7_\u09b0\u09c2\u09aa\u09be\u09a8\u09cd\u09a4\u09b0\u09bf\u09a4","split by":"\u09a6\u09cd\u09ac\u09be\u09b0\u09be_\u09ac\u09bf\u09ad\u0995\u09cd\u09a4","joined by":"\u09a6\u09cd\u09ac\u09be\u09b0\u09be_\u09af\u09c1\u0995\u09cd\u09a4"}};cl(Hl,"bn",{allowEnglishFallback:!0});var Bl={commands:{on:"\u0e40\u0e21\u0e37\u0e48\u0e2d",toggle:"\u0e2a\u0e25\u0e31\u0e1a",add:"\u0e40\u0e1e\u0e34\u0e48\u0e21",remove:"\u0e25\u0e1a",set:"\u0e15\u0e31\u0e49\u0e07",get:"\u0e23\u0e31\u0e1a\u0e04\u0e48\u0e32",put:"\u0e43\u0e2a\u0e48",take:"\u0e23\u0e31\u0e1a",show:"\u0e41\u0e2a\u0e14\u0e07",hide:"\u0e0b\u0e48\u0e2d\u0e19",increment:"\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e04\u0e48\u0e32",decrement:"\u0e25\u0e14\u0e04\u0e48\u0e32",if:"\u0e16\u0e49\u0e32",else:"\u0e44\u0e21\u0e48\u0e07\u0e31\u0e49\u0e19",repeat:"\u0e17\u0e33\u0e0b\u0e49\u0e33",for:"\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a",while:"\u0e43\u0e19\u0e02\u0e13\u0e30\u0e17\u0e35\u0e48",wait:"\u0e23\u0e2d",fetch:"\u0e14\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25",call:"\u0e40\u0e23\u0e35\u0e22\u0e01",return:"\u0e04\u0e37\u0e19\u0e04\u0e48\u0e32",log:"\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01",trigger:"\u0e17\u0e23\u0e34\u0e01\u0e40\u0e01\u0e2d\u0e23\u0e4c",send:"\u0e2a\u0e48\u0e07",go:"\u0e44\u0e1b",halt:"\u0e2b\u0e22\u0e38\u0e14",throw:"\u0e42\u0e22\u0e19",continue:"\u0e15\u0e48\u0e2d\u0e44\u0e1b",make:"\u0e2a\u0e23\u0e49\u0e32\u0e07",append:"\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e17\u0e49\u0e32\u0e22",prepend:"\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e2b\u0e19\u0e49\u0e32",focus:"\u0e42\u0e1f\u0e01\u0e31\u0e2a",blur:"\u0e40\u0e1a\u0e25\u0e2d",transition:"\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e1c\u0e48\u0e32\u0e19",settle:"\u0e04\u0e07\u0e17\u0e35\u0e48",measure:"\u0e27\u0e31\u0e14",async:"\u0e2d\u0e30\u0e0b\u0e34\u0e07\u0e04\u0e4c",tell:"\u0e1a\u0e2d\u0e01",default:"\u0e04\u0e48\u0e32\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19",init:"\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19",behavior:"\u0e1e\u0e24\u0e15\u0e34\u0e01\u0e23\u0e23\u0e21",install:"\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07",clone:"\u0e42\u0e04\u0e25\u0e19",swap:"\u0e2a\u0e25\u0e31\u0e1a\u0e17\u0e35\u0e48",morph:"\u0e41\u0e1b\u0e25\u0e07\u0e23\u0e48\u0e32\u0e07",beep:"\u0e1a\u0e35\u0e4a\u0e1a",break:"\u0e02\u0e31\u0e14\u0e08\u0e31\u0e07\u0e2b\u0e27\u0e30",copy:"\u0e04\u0e31\u0e14\u0e25\u0e2d\u0e01",exit:"\u0e2d\u0e2d\u0e01",js:"\u0e40\u0e08\u0e40\u0e2d\u0e2a",pick:"\u0e40\u0e25\u0e37\u0e2d\u0e01",render:"\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25",until:"\u0e08\u0e19\u0e16\u0e36\u0e07",breakpoint:"\u0e08\u0e38\u0e14\u0e1e\u0e31\u0e01",clear:"\u0e40\u0e04\u0e25\u0e35\u0e22\u0e23\u0e4c",close:"\u0e1b\u0e34\u0e14",open:"\u0e40\u0e1b\u0e34\u0e14",select:"\u0e17\u0e33\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e2b\u0e21\u0e32\u0e22"},modifiers:{to:"\u0e44\u0e1b\u0e22\u0e31\u0e07",from:"\u0e08\u0e32\u0e01",into:"\u0e43\u0e19",on:"\u0e40\u0e21\u0e37\u0e48\u0e2d",with:"\u0e14\u0e49\u0e27\u0e22",by:"\u0e42\u0e14\u0e22",as:"\u0e40\u0e1b\u0e47\u0e19",before:"\u0e01\u0e48\u0e2d\u0e19",after:"\u0e2b\u0e25\u0e31\u0e07",at:"\u0e17\u0e35\u0e48",in:"\u0e43\u0e19",over:"\u0e40\u0e2b\u0e19\u0e37\u0e2d",between:"\u0e23\u0e30\u0e2b\u0e27\u0e48\u0e32\u0e07",then:"\u0e41\u0e25\u0e49\u0e27",and:"\u0e41\u0e25\u0e30",end:"\u0e08\u0e1a",until:"\u0e08\u0e19\u0e16\u0e36\u0e07",of:"\u0e02\u0e2d\u0e07"},events:{click:"\u0e04\u0e25\u0e34\u0e01",change:"\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e41\u0e1b\u0e25\u0e07",input:"\u0e2d\u0e34\u0e19\u0e1e\u0e38\u0e15",submit:"\u0e2a\u0e48\u0e07",load:"\u0e42\u0e2b\u0e25\u0e14",focus:"\u0e42\u0e1f\u0e01\u0e31\u0e2a",blur:"\u0e40\u0e1a\u0e25\u0e2d",reset:"\u0e23\u0e35\u0e40\u0e0b\u0e47\u0e15",keydown:"\u0e01\u0e14\u0e04\u0e35\u0e22\u0e4c",keyup:"\u0e1b\u0e25\u0e48\u0e2d\u0e22\u0e04\u0e35\u0e22\u0e4c",mouseover:"\u0e40\u0e21\u0e32\u0e2a\u0e4c\u0e40\u0e02\u0e49\u0e32",mouseout:"\u0e40\u0e21\u0e32\u0e2a\u0e4c\u0e2d\u0e2d\u0e01",scroll:"\u0e40\u0e25\u0e37\u0e48\u0e2d\u0e19",resize:"\u0e1b\u0e23\u0e31\u0e1a\u0e02\u0e19\u0e32\u0e14",every:"\u0e17\u0e38\u0e01"},logical:{if:"\u0e16\u0e49\u0e32",when:"\u0e40\u0e21\u0e37\u0e48\u0e2d",where:"\u0e17\u0e35\u0e48\u0e44\u0e2b\u0e19",else:"\u0e44\u0e21\u0e48\u0e07\u0e31\u0e49\u0e19",not:"\u0e44\u0e21\u0e48",and:"\u0e41\u0e25\u0e30",or:"\u0e2b\u0e23\u0e37\u0e2d",is:"\u0e40\u0e1b\u0e47\u0e19",exists:"\u0e21\u0e35\u0e2d\u0e22\u0e39\u0e48",has:"\u0e21\u0e35",have:"\u0e21\u0e35",empty:"\u0e27\u0e48\u0e32\u0e07",true:"\u0e08\u0e23\u0e34\u0e07",false:"\u0e40\u0e17\u0e47\u0e08",null:"\u0e27\u0e48\u0e32\u0e07",undefined:"\u0e44\u0e21\u0e48\u0e01\u0e33\u0e2b\u0e19\u0e14",end:"\u0e08\u0e1a",then:"\u0e41\u0e25\u0e49\u0e27",live:"\u0e2a\u0e14",changes:"\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19"},temporal:{now:"\u0e15\u0e2d\u0e19\u0e19\u0e35\u0e49",seconds:"\u0e27\u0e34\u0e19\u0e32\u0e17\u0e35",milliseconds:"\u0e21\u0e34\u0e25\u0e25\u0e34\u0e27\u0e34\u0e19\u0e32\u0e17\u0e35",minutes:"\u0e19\u0e32\u0e17\u0e35",hours:"\u0e0a\u0e31\u0e48\u0e27\u0e42\u0e21\u0e07",forever:"\u0e15\u0e25\u0e2d\u0e14\u0e44\u0e1b",times:"\u0e04\u0e23\u0e31\u0e49\u0e07",s:"\u0e27\u0e34",ms:"\u0e21\u0e27"},values:{me:"\u0e09\u0e31\u0e19",my:"\u0e02\u0e2d\u0e07\u0e09\u0e31\u0e19",it:"\u0e21\u0e31\u0e19",its:"\u0e02\u0e2d\u0e07\u0e21\u0e31\u0e19",result:"\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c",event:"\u0e40\u0e2b\u0e15\u0e38\u0e01\u0e32\u0e23\u0e13\u0e4c",target:"\u0e40\u0e1b\u0e49\u0e32\u0e2b\u0e21\u0e32\u0e22",body:"\u0e1a\u0e2d\u0e14\u0e35\u0e49",you:"\u0e04\u0e38\u0e13",your:"\u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13"},attributes:{class:"\u0e04\u0e25\u0e32\u0e2a",id:"\u0e44\u0e2d\u0e14\u0e35",style:"\u0e2a\u0e44\u0e15\u0e25\u0e4c",value:"\u0e04\u0e48\u0e32",text:"\u0e02\u0e49\u0e2d\u0e04\u0e27\u0e32\u0e21",html:"\u0e40\u0e2d\u0e0a\u0e17\u0e35\u0e40\u0e2d\u0e47\u0e21\u0e41\u0e2d\u0e25",disabled:"\u0e1b\u0e34\u0e14\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19",checked:"\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e41\u0e25\u0e49\u0e27"},expressions:{characters:"\u0e2d\u0e31\u0e01\u0e02\u0e23\u0e30",inclusive:"\u0e23\u0e27\u0e21",exclusive:"\u0e22\u0e01\u0e40\u0e27\u0e49\u0e19",first:"\u0e41\u0e23\u0e01",last:"\u0e2a\u0e38\u0e14\u0e17\u0e49\u0e32\u0e22",next:"\u0e16\u0e31\u0e14\u0e44\u0e1b",previous:"\u0e01\u0e48\u0e2d\u0e19\u0e2b\u0e19\u0e49\u0e32",closest:"\u0e43\u0e01\u0e25\u0e49\u0e2a\u0e38\u0e14",parent:"\u0e15\u0e49\u0e19\u0e17\u0e32\u0e07",children:"\u0e25\u0e39\u0e01",random:"\u0e2a\u0e38\u0e48\u0e21",length:"\u0e04\u0e27\u0e32\u0e21\u0e22\u0e32\u0e27",index:"\u0e14\u0e31\u0e0a\u0e19\u0e35",empty:"\u0e25\u0e49\u0e32\u0e07","starts with":"\u0e02\u0e36\u0e49\u0e19\u0e15\u0e49\u0e19\u0e14\u0e49\u0e27\u0e22","ends with":"\u0e25\u0e07\u0e17\u0e49\u0e32\u0e22\u0e14\u0e49\u0e27\u0e22","ignoring case":"\u0e44\u0e21\u0e48\u0e2a\u0e19\u0e15\u0e31\u0e27\u0e1e\u0e34\u0e21\u0e1e\u0e4c","sorted by":"\u0e40\u0e23\u0e35\u0e22\u0e07\u0e15\u0e32\u0e21","mapped to":"\u0e41\u0e1b\u0e25\u0e07\u0e40\u0e1b\u0e47\u0e19","split by":"\u0e41\u0e22\u0e01\u0e14\u0e49\u0e27\u0e22","joined by":"\u0e23\u0e27\u0e21\u0e14\u0e49\u0e27\u0e22"}};cl(Bl,"th",{allowEnglishFallback:!0});var Wl={commands:{on:"apabila",tell:"beritahu",trigger:"cetuskan",send:"hantar",take:"ambil",put:"letak",set:"tetapkan",get:"dapatkan",add:"tambah",remove:"buang",toggle:"togol",hide:"sembunyi",show:"tunjuk",if:"jika",unless:"kecuali",repeat:"ulang",for:"untuk",while:"selagi",until:"sehingga",continue:"teruskan",break:"henti",halt:"henti",wait:"tunggu",fetch:"ambil_dari",call:"panggil",return:"pulang",make:"buat",log:"catat",throw:"lempar",catch:"tangkap",measure:"ukur",transition:"peralihan",increment:"tambah_satu",decrement:"kurang_satu",default:"lalai",go:"pergi",pushUrl:"tolak_url",replaceUrl:"ganti_url",copy:"salin",pick:"pilih",beep:"bunyi",js:"js",async:"tak_segerak",render:"papar",swap:"tukar_tempat",morph:"ubah_bentuk",settle:"selesai",append:"tambah_hujung",prepend:"tambah_mula",exit:"keluar",else:"kalau_tidak",focus:"fokus",blur:"kabur",install:"pasang",behavior:"kelakuan",init:"mula",clone:"klon",breakpoint:"titik-henti",clear:"bersihkan",close:"tutup",open:"buka",select:"tandai",socket:"soket"},modifiers:{to:"ke",from:"dari",into:"ke_dalam",with:"dengan",at:"di",in:"dalam",of:"daripada",as:"sebagai",by:"oleh",before:"sebelum",after:"selepas",over:"atas",under:"bawah",between:"antara",through:"melalui",without:"tanpa",on:"pada",then:"kemudian",and:"dan",end:"tamat",until:"sehingga"},events:{click:"click",dblclick:"dblclick",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"mouseover",mouseout:"mouseout",mousemove:"mousemove",keydown:"keydown",keyup:"keyup",keypress:"keypress",focus:"focus",blur:"blur",change:"change",input:"input",submit:"submit",reset:"reset",load:"load",unload:"unload",resize:"resize",scroll:"scroll",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",touchcancel:"touchcancel",every:"setiap"},logical:{when:"apabila",where:"di_mana",and:"dan",or:"atau",not:"bukan",is:"adalah",exists:"wujud",matches:"sepadan",contains:"mengandungi",includes:"termasuk",equals:"sama",has:"ada",have:"ada",then:"kemudian",else:"kalau_tidak",otherwise:"jika_tidak",end:"tamat",live:"langsung",changes:"berubah",if:"jika",empty:"kosong",true:"benar",false:"salah",null:"null",undefined:"tidak_ditakrifkan"},temporal:{seconds:"saat",second:"saat",milliseconds:"milisaat",millisecond:"milisaat",minutes:"minit",minute:"minit",hours:"jam",hour:"jam",ms:"ms",s:"s",min:"min",h:"j",now:"sekarang",forever:"selamanya",times:"kali"},values:{true:"benar",false:"salah",null:"null",undefined:"tidak_ditakrifkan",it:"ia",its:"nya",me:"saya",my:"saya_punya",myself:"diri_saya",you:"kamu",your:"kamu_punya",yourself:"diri_kamu",element:"elemen",target:"sasaran",detail:"perincian",event:"peristiwa",window:"tetingkap",document:"dokumen",body:"badan",result:"hasil",value:"nilai"},attributes:{class:"kelas",classes:"kelas_kelas",style:"gaya",styles:"gaya_gaya",attribute:"atribut",attributes:"atribut_atribut",property:"sifat",properties:"sifat_sifat",id:"id",value:"nilai",text:"teks",html:"html",disabled:"dilumpuhkan",checked:"ditanda"},expressions:{characters:"aksara",inclusive:"inklusif",exclusive:"eksklusif",first:"pertama",last:"terakhir",next:"seterusnya",previous:"sebelumnya",prev:"sebelum",at:"di",random:"rawak",closest:"terdekat",parent:"induk",children:"anak_anak",within:"dalam",no:"tiada",empty:"kosong",some:"beberapa","starts with":"bermula_dengan","ends with":"berakhir_dengan","ignoring case":"abaikan_huruf_besar_kecil","sorted by":"disusun_mengikut","mapped to":"dipetakan_ke","split by":"dipecah_oleh","joined by":"digabung_oleh",length:"panjang",index:"indeks"}};cl(Wl,"ms",{allowEnglishFallback:!0});var Dl={commands:{on:"kapag",tell:"sabihin",trigger:"palitawin",send:"ipadala",take:"kumuha",put:"ilagay",set:"itakda",get:"kunin",add:"idagdag",remove:"alisin",toggle:"palitan",hide:"itago",show:"ipakita",if:"kung",unless:"maliban_kung",repeat:"ulitin",for:"para_sa",while:"habang",until:"hanggang",continue:"magpatuloy",break:"itigil",halt:"huminto",wait:"maghintay",fetch:"kuhanin_mula",call:"tawagin",return:"ibalik",make:"gumawa",log:"itala",throw:"ihagis",catch:"hulihin",measure:"sukatin",transition:"lumipat",increment:"dagdagan",decrement:"bawasan",default:"pamantayan",go:"pumunta",pushUrl:"itulak_url",replaceUrl:"palitan_url",copy:"kopyahin",pick:"pumili",beep:"tunog",js:"js",async:"sabay",render:"irender",swap:"palitan_pwesto",morph:"baguhin",settle:"magpatahimik",append:"idagdag_sa_dulo",prepend:"idagdag_sa_simula",exit:"lumabas",else:"kung_hindi",focus:"ituon",blur:"alisin_tuon",install:"ikabit",behavior:"ugali",init:"simulan",clone:"i-clone",breakpoint:"breakpoint",clear:"burahin",close:"isara",open:"buksan",select:"piliin"},modifiers:{to:"sa",from:"mula_sa",into:"papasok_sa",with:"kasama",at:"sa",in:"sa_loob",of:"ng",as:"bilang",by:"sa_pamamagitan_ng",before:"bago",after:"matapos",over:"sa_ibabaw",under:"sa_ilalim",between:"sa_pagitan",through:"sa_pamamagitan",without:"walang",on:"sa",then:"pagkatapos",and:"at",end:"wakas",until:"hanggang"},events:{click:"click",dblclick:"dblclick",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"mouseover",mouseout:"mouseout",mousemove:"mousemove",keydown:"keydown",keyup:"keyup",keypress:"keypress",focus:"focus",blur:"blur",change:"change",input:"input",submit:"submit",reset:"reset",load:"load",unload:"unload",resize:"resize",scroll:"scroll",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",touchcancel:"touchcancel",every:"bawat"},logical:{when:"kapag",where:"kung_saan",and:"at",or:"o",not:"hindi",is:"ay",exists:"may",matches:"tumutugma",contains:"naglalaman",includes:"kasama",equals:"katumbas",has:"may",have:"may",then:"pagkatapos",else:"kung_hindi",otherwise:"kung_hindi_man",end:"wakas",live:"live",changes:"nagbabago",if:"kung",empty:"walang_laman",true:"totoo",false:"mali",null:"wala",undefined:"hindi_tinukoy"},temporal:{seconds:"segundo",second:"segundo",milliseconds:"milisegundo",millisecond:"milisegundo",minutes:"minuto",minute:"minuto",hours:"oras",hour:"oras",ms:"ms",s:"s",min:"min",h:"h",now:"ngayon",forever:"magpakailanman",times:"beses"},values:{true:"totoo",false:"mali",null:"wala",undefined:"hindi_tinukoy",it:"ito",its:"nito",me:"ako",my:"aking",myself:"sarili_ko",you:"ikaw",your:"iyong",yourself:"sarili_mo",element:"elemento",target:"target",detail:"detalye",event:"pangyayari",window:"bintana",document:"dokumento",body:"katawan",result:"resulta",value:"halaga"},attributes:{class:"klase",classes:"mga_klase",style:"estilo",styles:"mga_estilo",attribute:"katangian",attributes:"mga_katangian",property:"ari_arian",properties:"mga_ari_arian",id:"id",value:"halaga",text:"teksto",html:"html",disabled:"hindi_pinagana",checked:"naka_tsek"},expressions:{characters:"karakter",inclusive:"kasama",exclusive:"bukod",first:"una",last:"huli",next:"susunod",previous:"nakaraan",prev:"nakaraan",at:"sa",random:"random",closest:"pinakamalapit",parent:"magulang",children:"mga_anak",within:"sa_loob_ng",no:"walang",empty:"walang_laman",some:"ilan","starts with":"nagsisimula_sa","ends with":"nagtatapos_sa","ignoring case":"huwag_pansinin_ang_case","sorted by":"nakaayos_ayon_sa","mapped to":"binago_sa","split by":"hinati_sa","joined by":"pinagsama_sa",length:"haba",index:"indeks"}};cl(Dl,"tl",{allowEnglishFallback:!0});var Fl={commands:{add:"\u05d4\u05d5\u05e1\u05e3",append:"\u05e6\u05e8\u05e3",async:"\u05d0\u05e1\u05d9\u05e0\u05db\u05e8\u05d5\u05e0\u05d9",beep:"\u05d1\u05d9\u05e4",break:"\u05e9\u05d1\u05d5\u05e8",call:"\u05e7\u05e8\u05d0",clear:"\u05e0\u05e7\u05d4",continue:"\u05d4\u05de\u05e9\u05da",copy:"\u05d4\u05e2\u05ea\u05e7",decrement:"\u05d4\u05e7\u05d8\u05df",default:"\u05d1\u05e8\u05d9\u05e8\u05ea \u05de\u05d7\u05d3\u05dc",exit:"\u05e6\u05d0",fetch:"\u05d4\u05d1\u05d0",for:"\u05e2\u05d1\u05d5\u05e8",get:"\u05e7\u05d1\u05dc",go:"\u05dc\u05da",halt:"\u05e2\u05e6\u05d5\u05e8",hide:"\u05d4\u05e1\u05ea\u05e8",if:"\u05d0\u05dd",unless:"\u05d0\u05dc\u05d0",increment:"\u05d4\u05d2\u05d3\u05dc",install:"\u05d4\u05ea\u05e7\u05df",js:"js",log:"\u05e8\u05e9\u05d5\u05dd",make:"\u05e6\u05d5\u05e8",measure:"\u05de\u05d3\u05d5\u05d3",morph:"\u05d4\u05e4\u05d5\u05da",on:"\u05d1",pick:"\u05d1\u05d7\u05e8",put:"\u05e9\u05d9\u05dd",remove:"\u05d4\u05e1\u05e8",render:"\u05e8\u05e0\u05d3\u05e8",repeat:"\u05d7\u05d6\u05d5\u05e8",return:"\u05d4\u05d7\u05d6\u05e8",scroll:"\u05d2\u05dc\u05d5\u05dc",send:"\u05e9\u05dc\u05d7",set:"\u05e7\u05d1\u05e2",settle:"\u05d4\u05ea\u05d9\u05d9\u05e6\u05d1",show:"\u05d4\u05e8\u05d0\u05d4",swap:"\u05d4\u05d7\u05dc\u05e3",take:"\u05e7\u05d7",tell:"\u05d0\u05de\u05d5\u05e8",throw:"\u05d6\u05e8\u05d5\u05e7",toggle:"\u05de\u05ea\u05d2",transition:"\u05de\u05e2\u05d1\u05e8",trigger:"\u05d4\u05e4\u05e2\u05dc",until:"\u05e2\u05d3",wait:"\u05d7\u05db\u05d4",while:"\u05db\u05dc \u05e2\u05d5\u05d3"},modifiers:{after:"\u05d0\u05d7\u05e8\u05d9",before:"\u05dc\u05e4\u05e0\u05d9",from:"\u05de",into:"\u05dc\u05ea\u05d5\u05da",to:"\u05e2\u05dc",with:"\u05e2\u05dd"},events:{blur:"\u05d8\u05e9\u05d8\u05e9",change:"\u05e9\u05d9\u05e0\u05d5\u05d9",click:"\u05dc\u05d7\u05d9\u05e6\u05d4",focus:"\u05de\u05e7\u05d3",input:"\u05e7\u05dc\u05d8",submit:"\u05e9\u05dc\u05d9\u05d7\u05d4"},logical:{and:"\u05d5\u05d2\u05dd",else:"\u05d0\u05d7\u05e8\u05ea",end:"\u05e1\u05d5\u05e3",then:"\u05d0\u05d6",live:"\u05d7\u05d9",bind:"\u05e7\u05e9\u05d5\u05e8",changes:"\u05de\u05e9\u05ea\u05e0\u05d4",when:"\u05db\u05d0\u05e9\u05e8",where:"\u05d0\u05d9\u05e4\u05d4"},temporal:{},values:{body:"\u05d2\u05d5\u05e3",event:"\u05d0\u05d9\u05e8\u05d5\u05e2",it:"\u05d6\u05d4",its:"\u05e9\u05dc\u05d5",me:"\u05d0\u05e0\u05d9",my:"\u05e9\u05dc\u05d9",result:"\u05ea\u05d5\u05e6\u05d0\u05d4",target:"\u05d9\u05e2\u05d3",you:"\u05d0\u05ea\u05d4",your:"\u05e9\u05dc\u05da"},attributes:{},expressions:{random:"\u05d0\u05e7\u05e8\u05d0\u05d9",characters:"\u05ea\u05d5\u05d5\u05d9\u05dd",inclusive:"\u05db\u05d5\u05dc\u05dc",exclusive:"\u05d1\u05dc\u05e2\u05d3\u05d9",last:"\u05d0\u05d7\u05e8\u05d5\u05df"}};cl(Fl,"he",{allowEnglishFallback:!0});var Ul=class e{static register(t,r){e.providers.set(t.toLowerCase(),r)}static unregister(t){e.providers.delete(t.toLowerCase())}static setDefault(t){const r=t.toLowerCase();if("en"!==r&&!e.providers.has(r))throw Error(`Locale '${t}' is not registered. Available locales: ${e.getAvailable().join(", ")}`);e.defaultLocale=r}static getDefault(){return e.defaultLocale}static get(t){const r=(t||e.defaultLocale).toLowerCase();if("en"===r)return e.englishProvider;const n=e.providers.get(r);if(!n)throw Error(`Locale '${r}' is not registered. Available locales: ${e.getAvailable().join(", ")}`);return n}static has(t){const r=t.toLowerCase();return"en"===r||e.providers.has(r)}static getAvailable(){return["en",...Array.from(e.providers.keys())]}static reset(){e.providers.clear(),e.defaultLocale="en"}static registerAll(t){for(const[r,n]of Object.entries(t))e.register(r,n)}};Ul.providers=new Map,Ul.defaultLocale="en",Ul.englishProvider=ul();var Kl=Ul;function Zl(e,t){const r=[],n=new Set;for(const i of t){const t=e.get(i);t&&(r.push(t),n.add(i))}for(const[t,i]of e)n.has(t)||r.push(i);return r}function Xl(e,t,r){const n=[];for(const i of e){let e=t.find(e=>e.role===i.role);"event"===e?.role&&/^[#.<@[]/.test(i.translated||i.value)&&(e=void 0),"duration"===e?.role&&/^(me|you|it)$/i.test(i.value)&&(e=void 0),e?"preposition"===r?(e.form&&n.push(e.form),n.push(i.translated||i.value)):"postposition"===r?(n.push(i.translated||i.value),e.form&&n.push(e.form)):n.push(i.translated||i.value):n.push(i.translated||i.value)}return n}function Gl(e){if(0===e.length)return"";let t="";for(let r=0;e.length>r;r++){const n=e[r],i=e[r+1],a=n.endsWith("-"),s=n.startsWith("-");let o=n;if(a&&(o=n.slice(0,-1)),s&&(o=n.substring(1)),t+=o,i){const e=i.startsWith("-");a||e||(t+=" ")}}return t}function Jl(e){return{name:"halt-call-fused-verb-final",description:"Split the swept `halt <operand> call <args>` blob; both verbs clause-final",priority:95,match:{commands:["halt"],requiredRoles:["action","event","patient"],predicate:t=>{const r=t.roles.get("patient");return!!r&&/\bcall\b/.test(r.value)&&!!r.translated&&r.translated.includes(e.callVerb)}},transform:{roleOrder:[],custom:t=>{const r=t.roles.get("patient"),n=t.roles.get("event"),i=t.roles.get("action");let a=(r.translated??r.value).trim();const s="EVENTBLOCKPLACEHOLDER";let o="";a.endsWith(s)&&(a=a.slice(0,-21).trim(),o=" "+s);const l=a.indexOf(e.callVerb),c=a.slice(0,l).trim(),u=a.slice(l+e.callVerb.length).trim();return[c,e.patientMarker,n.translated??n.value,e.eventMarker,i.translated??i.value,e.connective,u,e.patientMarker,e.callVerb].join(" ")+o}}}}function Yl(e){return{name:"pick-range-verb-final",description:"Reassemble the pick range (unit + endpoints + root) adjacent, verb-final",priority:95,match:{commands:["pick"],requiredRoles:["action","patient","destination"],predicate:e=>{const t=e.roles.get("patient"),r=e.roles.get("destination");return!!t&&!!r&&/^\S+\s+\d+$/.test(t.value.trim())&&/^\d+\s+of\s+\S+$/.test(r.value.trim())}},transform:{roleOrder:[],custom:t=>{const r=t.roles.get("patient"),n=t.roles.get("destination"),i=t.roles.get("action"),a=t.roles.get("event"),s=(r.translated??r.value).trim().split(/\s+/),o=s[s.length-1],l=s.slice(0,-1).join(" "),c=n.value.trim().match(/^(\d+)\s+of\s+(\S+)$/);return[c[2],e.genitive,l,o,e.rangeSep,c[1],e.patientMarker,...a?[a.translated??a.value,e.eventMarker]:[],i.translated??i.value].join(" ")}}}}var Ql={en:{code:"en",name:"English",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"ltr",canonicalOrder:["event","action","patient","source","destination","quantity","duration","method","style"],markers:[{form:"on",role:"event",position:"preposition",required:!0},{form:"to",role:"destination",position:"preposition",required:!1},{form:"into",role:"destination",position:"preposition",required:!1},{form:"from",role:"source",position:"preposition",required:!1},{form:"with",role:"style",position:"preposition",required:!1},{form:"by",role:"quantity",position:"preposition",required:!1},{form:"as",role:"method",position:"preposition",required:!1},{form:"over",role:"duration",position:"preposition",required:!1},{form:"for",role:"duration",position:"preposition",required:!1}]},ja:{code:"ja",name:"\u65e5\u672c\u8a9e",wordOrder:"SOV",adpositionType:"postposition",morphology:"agglutinative",direction:"ltr",canonicalOrder:["patient","event","action"],markers:[{form:"\u3092",role:"patient",position:"postposition",required:!0},{form:"\u306b",role:"destination",position:"postposition",required:!0},{form:"\u304b\u3089",role:"source",position:"postposition",required:!0},{form:"\u3067",role:"event",position:"postposition",required:!0},{form:"\u3067",role:"style",position:"postposition",required:!1},{form:"\u3068",role:"style",position:"postposition",required:!1},{form:"\u3078",role:"destination",position:"postposition",required:!1}],rules:[{name:"event-handler",description:"Transform event handlers to Japanese SOV order",priority:100,match:{commands:["on"],requiredRoles:["event","action"],optionalRoles:["patient"]},transform:{roleOrder:["patient","event","action"],insertMarkers:!0}},{name:"put-into",description:"Transform put X into Y to Japanese order",priority:90,match:{commands:["put","\u7f6e\u304f"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"set-to",description:"Transform set X to Y to Japanese verb-final order",priority:90,match:{commands:["set","\u8a2d\u5b9a"],requiredRoles:["action","patient","destination"],predicate:e=>!/(^|\s)end$/i.test((e.original??"").trim())},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"bind-to",description:"Transform bind $var to #el to Japanese verb-final order",priority:90,match:{commands:["bind","\u30d0\u30a4\u30f3\u30c9"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},Jl({callVerb:"\u547c\u3073\u51fa\u3057",patientMarker:"\u3092",eventMarker:"\u3067",connective:"\u305d\u308c\u304b\u3089"}),Yl({genitive:"\u306e",rangeSep:"\u304b\u3089",patientMarker:"\u3092",eventMarker:"\u3067"})]},ko:{code:"ko",name:"\ud55c\uad6d\uc5b4",wordOrder:"SOV",adpositionType:"postposition",morphology:"agglutinative",direction:"ltr",canonicalOrder:["patient","event","action"],markers:[{form:"\ub97c",role:"patient",position:"postposition",required:!0,alternatives:["\uc744"]},{form:"\uc5d0",role:"destination",position:"postposition",required:!0},{form:"\uc5d0\uc11c",role:"source",position:"postposition",required:!0},{form:"\ud560 \ub54c",role:"event",position:"postposition",required:!0},{form:"\ub85c",role:"style",position:"postposition",required:!1,alternatives:["\uc73c\ub85c"]},{form:"\uc640",role:"style",position:"postposition",required:!1,alternatives:["\uacfc"]},{form:"\ub85c",role:"method",position:"postposition",required:!1,alternatives:["\uc73c\ub85c"]}],rules:[{name:"event-handler",description:"Transform event handlers to Korean SOV order",priority:100,match:{commands:["on"],requiredRoles:["event","action"]},transform:{roleOrder:["patient","event","action"],insertMarkers:!0}},{name:"put-into",description:"Transform put X into Y to Korean verb-final order",priority:90,match:{commands:["put","\ub123\ub2e4"],requiredRoles:["action","patient","destination"],predicate:e=>!e.roles.has("event")},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"set-to",description:"Transform set X to Y to Korean verb-final order",priority:90,match:{commands:["set","\uc124\uc815"],requiredRoles:["action","patient","destination"],predicate:e=>!/(^|\s)end$/i.test((e.original??"").trim())},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"bind-to",description:"Transform bind $var to #el to Korean verb-final order",priority:90,match:{commands:["bind","\ubc14\uc778\ub4dc"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},Jl({callVerb:"\ud638\ucd9c",patientMarker:"\ub97c",eventMarker:"\ud560 \ub54c",connective:"\uadf8\ub7ec\uba74"}),Yl({genitive:"\uc758",rangeSep:"\ubd80\ud130",patientMarker:"\ub97c",eventMarker:"\ud560 \ub54c"})]},zh:{code:"zh",name:"\u4e2d\u6587",wordOrder:"SVO",adpositionType:"preposition",morphology:"isolating",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"\u5f53",role:"event",position:"preposition",required:!0},{form:"\u65f6",role:"event",position:"postposition",required:!0},{form:"\u628a",role:"patient",position:"preposition",required:!1},{form:"\u5230",role:"destination",position:"preposition",required:!1},{form:"\u4ece",role:"source",position:"preposition",required:!1},{form:"\u7528",role:"style",position:"preposition",required:!1},{form:"\u7684",role:"method",position:"postposition",required:!1}],rules:[{name:"event-handler-standard",description:"Standard event handler: \u5f53 X \u65f6 Y",priority:100,match:{requiredRoles:["event","action"]},transform:{roleOrder:["event","action","patient"],insertMarkers:!0,custom:(e,t)=>{const r=e.roles.get("event"),n=e.roles.get("action"),i=new Map(e.roles);i.delete("event"),i.delete("action");const a=Xl(Zl(i,(t.canonicalOrder||[]).filter(e=>"event"!==e&&"action"!==e)),t.markers,t.adpositionType),s=["\u5f53",r?.translated||r?.value||"","\u65f6"];return n&&s.push(n.translated||n.value),s.push(...a),s.filter(Boolean).join(" ")}}},{name:"ba-construction",description:"BA construction for object-fronting: \u628a X Y",priority:80,match:{commands:["put","set","move"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["patient","action","destination"],insertMarkers:!0}},{name:"bind-to",description:"Bind binds a variable to an element: \u7ed1\u5b9a X \u5230 Y (no \u628a)",priority:90,match:{commands:["bind","\u7ed1\u5b9a"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["action","patient","destination"],custom:e=>{const t=e.roles.get("action"),r=e.roles.get("patient"),n=e.roles.get("destination");return[t?.translated||t?.value||"",r?.translated||r?.value||"","\u5230",n?.translated||n?.value||""].filter(Boolean).join(" ")}}}]},ar:{code:"ar",name:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629",wordOrder:"VSO",adpositionType:"preposition",morphology:"fusional",direction:"rtl",canonicalOrder:["action","agent","patient","destination","source"],markers:[{form:"\u0639\u0646\u062f",role:"event",position:"preposition",required:!0},{form:"\u0625\u0644\u0649",role:"destination",position:"preposition",required:!1},{form:"\u0641\u064a",role:"destination",position:"preposition",required:!1},{form:"\u0645\u0646",role:"source",position:"preposition",required:!1},{form:"\u0628\u0640-",role:"style",position:"preposition",required:!1},{form:"\u0645\u0639",role:"style",position:"preposition",required:!1},{form:"\u0643\u0640-",role:"method",position:"preposition",required:!1}],rules:[{name:"event-handler-vso",description:"VSO event handler: VERB TARGET \u0639\u0646\u062f EVENT",priority:100,match:{commands:["on"],requiredRoles:["event","action"]},transform:{roleOrder:["action","patient","event"],insertMarkers:!0}}]},tr:{code:"tr",name:"T\u00fcrk\u00e7e",wordOrder:"SOV",adpositionType:"postposition",morphology:"agglutinative",direction:"ltr",canonicalOrder:["patient","event","action"],markers:[{form:"i",role:"patient",position:"postposition",required:!0,alternatives:["\u0131","u","\u00fc"]},{form:"e",role:"destination",position:"postposition",required:!0,alternatives:["a"]},{form:"den",role:"source",position:"postposition",required:!0,alternatives:["dan"]},{form:"de",role:"event",position:"postposition",required:!0,alternatives:["da"]},{form:"ile",role:"style",position:"postposition",required:!1},{form:"olarak",role:"method",position:"postposition",required:!1}],rules:[{name:"event-handler-sov",description:"SOV event handler",priority:100,match:{commands:["on"],requiredRoles:["event","action"]},transform:{roleOrder:["patient","event","action"],insertMarkers:!0}},{name:"put-into",description:"Transform put X into Y to Turkish verb-final order",priority:90,match:{commands:["put","koy"],requiredRoles:["action","patient","destination"],predicate:e=>!e.roles.has("event")},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"set-to",description:"Transform set X to Y to Turkish verb-final order",priority:90,match:{commands:["set","ayarla"],requiredRoles:["action","patient","destination"],predicate:e=>!/(^|\s)end$/i.test((e.original??"").trim())},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"bind-to",description:"Transform bind $var to #el to Turkish verb-final order",priority:90,match:{commands:["bind"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"wait-oblique-verb-final",description:"Keep wait's from-phrase and or-run inside the clause, verb-final",priority:90,match:{commands:["wait","bekle"],requiredRoles:["action","duration","source"],predicate:e=>!e.roles.has("event")},transform:{roleOrder:["patient","source","duration","action"],insertMarkers:!0}},{name:"repeat-until-event-verb-final",description:"Keep repeat-until-event's from-phrase before the verb",priority:90,match:{commands:["repeat","tekrarla"],requiredRoles:["action","patient","source"],predicate:e=>/^repeat\s+until\s+event\b/i.test((e.original??"").trim())},transform:{roleOrder:["patient","source","action"],insertMarkers:!0}},Jl({callVerb:"\u00e7a\u011f\u0131r",patientMarker:"i",eventMarker:"de",connective:"ard\u0131ndan"}),Yl({genitive:"nin",rangeSep:"ile",patientMarker:"i",eventMarker:"de"})]},es:{code:"es",name:"Espa\u00f1ol",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"en",role:"event",position:"preposition",required:!0},{form:"a",role:"destination",position:"preposition",required:!1},{form:"hacia",role:"destination",position:"preposition",required:!1},{form:"de",role:"source",position:"preposition",required:!1},{form:"con",role:"style",position:"preposition",required:!1},{form:"por",role:"quantity",position:"preposition",required:!1},{form:"como",role:"method",position:"preposition",required:!1}]},de:{code:"de",name:"Deutsch",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"bei",role:"event",position:"preposition",required:!0},{form:"zu",role:"destination",position:"preposition",required:!1},{form:"in",role:"destination",position:"preposition",required:!1},{form:"von",role:"source",position:"preposition",required:!1},{form:"aus",role:"source",position:"preposition",required:!1},{form:"mit",role:"style",position:"preposition",required:!1},{form:"um",role:"quantity",position:"preposition",required:!1},{form:"als",role:"method",position:"preposition",required:!1}]},fr:{code:"fr",name:"Fran\u00e7ais",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"sur",role:"event",position:"preposition",required:!0},{form:"\u00e0",role:"destination",position:"preposition",required:!1},{form:"dans",role:"destination",position:"preposition",required:!1},{form:"de",role:"source",position:"preposition",required:!1},{form:"avec",role:"style",position:"preposition",required:!1},{form:"par",role:"quantity",position:"preposition",required:!1},{form:"comme",role:"method",position:"preposition",required:!1}]},pt:{code:"pt",name:"Portugu\u00eas",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"em",role:"event",position:"preposition",required:!0},{form:"para",role:"destination",position:"preposition",required:!1},{form:"em",role:"destination",position:"preposition",required:!1},{form:"de",role:"source",position:"preposition",required:!1},{form:"com",role:"style",position:"preposition",required:!1},{form:"por",role:"quantity",position:"preposition",required:!1},{form:"como",role:"method",position:"preposition",required:!1}]},id:{code:"id",name:"Bahasa Indonesia",wordOrder:"SVO",adpositionType:"preposition",morphology:"agglutinative",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"pada",role:"event",position:"preposition",required:!0},{form:"ke",role:"destination",position:"preposition",required:!1},{form:"dari",role:"source",position:"preposition",required:!1},{form:"dengan",role:"style",position:"preposition",required:!1},{form:"sebagai",role:"method",position:"preposition",required:!1}]},ms:{code:"ms",name:"Bahasa Melayu",wordOrder:"SVO",adpositionType:"preposition",morphology:"agglutinative",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"apabila",role:"event",position:"preposition",required:!0},{form:"ke",role:"destination",position:"preposition",required:!1},{form:"dari",role:"source",position:"preposition",required:!1},{form:"dengan",role:"style",position:"preposition",required:!1},{form:"sebagai",role:"method",position:"preposition",required:!1}]},qu:{code:"qu",name:"Runasimi",wordOrder:"SOV",adpositionType:"postposition",morphology:"agglutinative",direction:"ltr",canonicalOrder:["patient","source","destination","event","action"],markers:[{form:"ta",role:"patient",position:"postposition",required:!0},{form:"man",role:"destination",position:"postposition",required:!0},{form:"manta",role:"source",position:"postposition",required:!0},{form:"pi",role:"event",position:"postposition",required:!0},{form:"wan",role:"style",position:"postposition",required:!1},{form:"hina",role:"method",position:"postposition",required:!1}],rules:[{name:"wait-oblique-verb-final",description:"Keep wait's from-phrase and or-run inside the clause, verb-final",priority:90,match:{commands:["wait","suyay"],requiredRoles:["action","duration","source"],predicate:e=>!e.roles.has("event")},transform:{roleOrder:["patient","source","duration","action"],insertMarkers:!0}},Jl({callVerb:"qayay",patientMarker:"ta",eventMarker:"pi",connective:"chayqa"}),Yl({genitive:"pa",rangeSep:"kama",patientMarker:"ta",eventMarker:"pi"})]},sw:{code:"sw",name:"Kiswahili",wordOrder:"SVO",adpositionType:"preposition",morphology:"agglutinative",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"kwenye",role:"event",position:"preposition",required:!0},{form:"kwa",role:"destination",position:"preposition",required:!1},{form:"kutoka",role:"source",position:"preposition",required:!1},{form:"na",role:"style",position:"preposition",required:!1},{form:"kuwa",role:"method",position:"preposition",required:!1}]},bn:{code:"bn",name:"\u09ac\u09be\u0982\u09b2\u09be",wordOrder:"SOV",adpositionType:"postposition",morphology:"agglutinative",direction:"ltr",canonicalOrder:["patient","event","action"],markers:[{form:"\u0995\u09c7",role:"patient",position:"postposition",required:!0},{form:"\u09a4\u09c7",role:"destination",position:"postposition",required:!0},{form:"\u098f",role:"event",position:"postposition",required:!0},{form:"\u09a5\u09c7\u0995\u09c7",role:"source",position:"postposition",required:!0},{form:"\u09a6\u09bf\u09af\u09bc\u09c7",role:"style",position:"postposition",required:!1},{form:"\u099c\u09a8\u09cd\u09af",role:"duration",position:"postposition",required:!1}],rules:[{name:"event-handler",description:"Transform event handlers to Bengali SOV order",priority:100,match:{commands:["on"],requiredRoles:["event","action"],optionalRoles:["patient"]},transform:{roleOrder:["patient","event","action"],insertMarkers:!0}},{name:"put-into",description:"Transform put X into Y to Bengali verb-final order",priority:90,match:{commands:["put","\u09b0\u09be\u0996\u09c1\u09a8"],requiredRoles:["action","patient","destination"],predicate:e=>!e.roles.has("event")},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"set-to",description:"Transform set X to Y to Bengali verb-final order",priority:90,match:{commands:["set","\u09b8\u09c7\u099f"],requiredRoles:["action","patient","destination"],predicate:e=>!/(^|\s)end$/i.test((e.original??"").trim())},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"bind-to",description:"Transform bind $var to #el to Bengali verb-final order",priority:90,match:{commands:["bind","\u09ac\u09be\u0987\u09a8\u09cd\u09a1"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},Jl({callVerb:"\u0995\u09b2",patientMarker:"\u0995\u09c7",eventMarker:"\u098f",connective:"\u09a4\u09be\u09b0\u09aa\u09b0"}),Yl({genitive:"\u09b0",rangeSep:"\u09a5\u09c7\u0995\u09c7",patientMarker:"\u0995\u09c7",eventMarker:"\u098f"})]},it:{code:"it",name:"Italiano",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"su",role:"event",position:"preposition",required:!0},{form:"in",role:"destination",position:"preposition",required:!1},{form:"a",role:"destination",position:"preposition",required:!1},{form:"da",role:"source",position:"preposition",required:!1},{form:"di",role:"source",position:"preposition",required:!1},{form:"con",role:"style",position:"preposition",required:!1},{form:"come",role:"method",position:"preposition",required:!1}]},ru:{code:"ru",name:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"\u043f\u0440\u0438",role:"event",position:"preposition",required:!0},{form:"\u0432",role:"destination",position:"preposition",required:!1},{form:"\u043d\u0430",role:"destination",position:"preposition",required:!1},{form:"\u043a",role:"destination",position:"preposition",required:!1},{form:"\u0438\u0437",role:"source",position:"preposition",required:!1},{form:"\u043e\u0442",role:"source",position:"preposition",required:!1},{form:"\u0441",role:"source",position:"preposition",required:!1},{form:"\u0441",role:"style",position:"preposition",required:!1},{form:"\u0441\u043e",role:"style",position:"preposition",required:!1},{form:"\u043a\u0430\u043a",role:"method",position:"preposition",required:!1}]},uk:{code:"uk",name:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"\u043f\u0440\u0438",role:"event",position:"preposition",required:!0},{form:"\u0432",role:"destination",position:"preposition",required:!1},{form:"\u043d\u0430",role:"destination",position:"preposition",required:!1},{form:"\u0434\u043e",role:"destination",position:"preposition",required:!1},{form:"\u0437",role:"source",position:"preposition",required:!1},{form:"\u0432\u0456\u0434",role:"source",position:"preposition",required:!1},{form:"\u0456\u0437",role:"source",position:"preposition",required:!1},{form:"\u0437",role:"style",position:"preposition",required:!1},{form:"\u0456\u0437",role:"style",position:"preposition",required:!1},{form:"\u044f\u043a",role:"method",position:"preposition",required:!1}]},vi:{code:"vi",name:"Ti\u1ebfng Vi\u1ec7t",wordOrder:"SVO",adpositionType:"preposition",morphology:"isolating",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"khi",role:"event",position:"preposition",required:!0},{form:"v\u00e0o",role:"destination",position:"preposition",required:!1},{form:"cho",role:"destination",position:"preposition",required:!1},{form:"\u0111\u1ebfn",role:"destination",position:"preposition",required:!1},{form:"t\u1eeb",role:"source",position:"preposition",required:!1},{form:"kh\u1ecfi",role:"source",position:"preposition",required:!1},{form:"v\u1edbi",role:"style",position:"preposition",required:!1},{form:"nh\u01b0",role:"method",position:"preposition",required:!1}]},hi:{code:"hi",name:"\u0939\u093f\u0928\u094d\u0926\u0940",wordOrder:"SOV",adpositionType:"postposition",morphology:"fusional",direction:"ltr",canonicalOrder:["patient","event","action"],markers:[{form:"\u0915\u094b",role:"patient",position:"postposition",required:!0},{form:"\u092e\u0947\u0902",role:"destination",position:"postposition",required:!0},{form:"\u092a\u0930",role:"destination",position:"postposition",required:!1},{form:"\u092a\u0930",role:"event",position:"postposition",required:!0},{form:"\u0938\u0947",role:"source",position:"postposition",required:!0},{form:"\u0938\u0947",role:"style",position:"postposition",required:!1},{form:"\u0938\u093e\u0925",role:"style",position:"postposition",required:!1},{form:"\u0915\u0947 \u0930\u0942\u092a \u092e\u0947\u0902",role:"method",position:"postposition",required:!1}],rules:[{name:"event-handler",description:"Transform event handlers to Hindi SOV order",priority:100,match:{commands:["on"],requiredRoles:["event","action"],optionalRoles:["patient"]},transform:{roleOrder:["patient","event","action"],insertMarkers:!0}},{name:"put-into",description:"Transform put X into Y to Hindi verb-final order",priority:90,match:{commands:["put","\u0930\u0916\u0947\u0902"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"set-to",description:"Transform set X to Y to Hindi verb-final order",priority:90,match:{commands:["set","\u0938\u0947\u091f"],requiredRoles:["action","patient","destination"],predicate:e=>!/(^|\s)end$/i.test((e.original??"").trim())},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"bind-to",description:"Transform bind $var to #el to Hindi verb-final order",priority:90,match:{commands:["bind","\u092c\u093e\u0907\u0902\u0921","\u092c\u093e\u0902\u0927\u0947\u0902"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},Jl({callVerb:"\u0915\u0949\u0932",patientMarker:"\u0915\u094b",eventMarker:"\u092a\u0930",connective:"\u092b\u093f\u0930"}),Yl({genitive:"\u0915\u093e",rangeSep:"\u0938\u0947",patientMarker:"\u0915\u094b",eventMarker:"\u092a\u0930"})]},tl:{code:"tl",name:"Tagalog",wordOrder:"VSO",adpositionType:"preposition",morphology:"agglutinative",direction:"ltr",canonicalOrder:["action","agent","patient","destination","source"],markers:[{form:"kapag",role:"event",position:"preposition",required:!0},{form:"sa",role:"destination",position:"preposition",required:!1},{form:"mula_sa",role:"source",position:"preposition",required:!1},{form:"nang",role:"style",position:"preposition",required:!1},{form:"bilang",role:"method",position:"preposition",required:!1}],rules:[{name:"event-handler-vso",description:"VSO event handler: VERB TARGET kapag EVENT",priority:100,match:{commands:["on"],requiredRoles:["event","action"]},transform:{roleOrder:["action","patient","event"],insertMarkers:!0}}]},th:{code:"th",name:"\u0e44\u0e17\u0e22",wordOrder:"SVO",adpositionType:"preposition",morphology:"isolating",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"\u0e40\u0e21\u0e37\u0e48\u0e2d",role:"event",position:"preposition",required:!0},{form:"\u0e43\u0e19",role:"destination",position:"preposition",required:!1},{form:"\u0e44\u0e1b\u0e22\u0e31\u0e07",role:"destination",position:"preposition",required:!1},{form:"\u0e08\u0e32\u0e01",role:"source",position:"preposition",required:!1},{form:"\u0e14\u0e49\u0e27\u0e22",role:"style",position:"preposition",required:!1},{form:"\u0e40\u0e1b\u0e47\u0e19",role:"method",position:"preposition",required:!1}]},pl:{code:"pl",name:"Polski",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"gdy",role:"event",position:"preposition",required:!0},{form:"przy",role:"event",position:"preposition",required:!1},{form:"do",role:"destination",position:"preposition",required:!1},{form:"w",role:"destination",position:"preposition",required:!1},{form:"na",role:"destination",position:"preposition",required:!1},{form:"z",role:"source",position:"preposition",required:!1},{form:"od",role:"source",position:"preposition",required:!1},{form:"ze",role:"source",position:"preposition",required:!1},{form:"z",role:"style",position:"preposition",required:!1},{form:"ze",role:"style",position:"preposition",required:!1},{form:"jako",role:"method",position:"preposition",required:!1}]},he:{code:"he",name:"\u05e2\u05d1\u05e8\u05d9\u05ea",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"rtl",canonicalOrder:["event","action","patient","destination"],markers:[{form:"\u05d1",role:"event",position:"preposition",required:!0},{form:"\u05e2\u05dc",role:"destination",position:"preposition",required:!1},{form:"\u05d0\u05dc",role:"destination",position:"preposition",required:!1},{form:"\u05dc",role:"destination",position:"preposition",required:!1},{form:"\u05d0\u05ea",role:"patient",position:"preposition",required:!1},{form:"\u05de",role:"source",position:"preposition",required:!1},{form:"\u05de\u05df",role:"source",position:"preposition",required:!1},{form:"\u05e2\u05dd",role:"style",position:"preposition",required:!1},{form:"\u05db",role:"method",position:"preposition",required:!1}],rules:[{name:"bind-to",description:"Bind binds a variable to an element: \u05e7\u05e9\u05d5\u05e8 X \u05dc Y",priority:90,match:{commands:["bind","\u05e7\u05e9\u05d5\u05e8"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["action","patient","destination"],custom:e=>{const t=e.roles.get("action"),r=e.roles.get("patient"),n=e.roles.get("destination");return[t?.translated||t?.value||"",r?.translated||r?.value||"","\u05dc",n?.translated||n?.value||""].filter(Boolean).join(" ")}}}]}};function ec(e){return Ql[e]}function tc(e){const t={};for(const[r,n]of Object.entries(e.words))t[n]=r;const r={};if(e.categories)for(const[t,n]of Object.entries(e.categories)){r[t]={};for(const[e,i]of Object.entries(n))r[t][i]=e}const n={source:e.target,target:e.source,words:t};return Object.keys(r).length>0&&(n.categories=r),n}function rc(e,t,r,n){const i={},a={};for(const r of["commands","modifiers","events","logical","temporal","values","attributes"]){const n=e[r],s=t[r];if(n&&s){a[r]={};for(const[e,t]of Object.entries(n)){const n=s[e];n&&t!==n&&(i[t]=n,a[r][t]=n)}}}return{source:r,target:n,words:i,categories:a}}var nc=rc(pl,xl,"ja","zh"),ic=tc(nc),ac=rc(kl,pl,"ko","ja"),sc=tc(ac),oc={source:"es",target:"pt",words:{en:"em",decir:"dizer",disparar:"disparar",enviar:"enviar",tomar:"pegar",poner:"colocar",establecer:"definir",obtener:"obter",agregar:"adicionar",quitar:"remover",alternar:"alternar",ocultar:"esconder",mostrar:"mostrar",si:"se",menos:"a menos",repetir:"repetir",para:"para",mientras:"enquanto",hasta:"at\u00e9",continuar:"continuar",romper:"parar",detener:"parar",esperar:"esperar",buscar:"buscar",llamar:"chamar",retornar:"retornar",hacer:"fazer",registrar:"registrar",lanzar:"lan\u00e7ar",atrapar:"capturar",medir:"medir","transici\u00f3n":"transi\u00e7\u00e3o",incrementar:"incrementar",decrementar:"decrementar",predeterminar:"padr\u00e3o",ir:"ir",copiar:"copiar",escoger:"escolher",intercambiar:"trocar",transformar:"transformar","a\u00f1adir":"anexar",salir:"sair",a:"para",de:"de",dentro:"em",con:"com",como:"como",por:"por",clic:"clique",cambio:"mudan\u00e7a",entrada:"entrada","env\u00edo":"envio",carga:"carregar",enfoque:"foco",desenfoque:"desfoque",verdadero:"verdadeiro",falso:"falso",y:"e",o:"ou",no:"n\u00e3o",es:"\u00e9",segundos:"segundos",milisegundos:"milissegundos",nulo:"nulo",indefinido:"indefinido","vac\u00edo":"vazio"},categories:{commands:{en:"em",decir:"dizer",tomar:"pegar",poner:"colocar",establecer:"definir",obtener:"obter",agregar:"adicionar",quitar:"remover",ocultar:"esconder",si:"se",mientras:"enquanto",hasta:"at\u00e9",romper:"parar",detener:"parar",llamar:"chamar",hacer:"fazer",lanzar:"lan\u00e7ar",atrapar:"capturar",escoger:"escolher",intercambiar:"trocar","a\u00f1adir":"anexar",salir:"sair"},events:{clic:"clique",cambio:"mudan\u00e7a",carga:"carregar",enfoque:"foco",desenfoque:"desfoque"},logical:{verdadero:"verdadeiro",y:"e",o:"ou",no:"n\u00e3o",es:"\u00e9"}}},lc=tc(oc),cc=new Map([["ja->zh",nc],["zh->ja",ic],["ko->ja",ac],["ja->ko",sc],["es->pt",oc],["pt->es",lc]]),uc={en:{commands:{on:"on",tell:"tell",trigger:"trigger",send:"send",take:"take",put:"put",set:"set",get:"get",add:"add",remove:"remove",toggle:"toggle",hide:"hide",show:"show",if:"if",unless:"unless",repeat:"repeat",for:"for",while:"while",until:"until",continue:"continue",break:"break",halt:"halt",wait:"wait",fetch:"fetch",call:"call",return:"return",make:"make",log:"log",throw:"throw",catch:"catch",measure:"measure",transition:"transition",increment:"increment",decrement:"decrement",default:"default",bind:"bind",eventsource:"eventsource",socket:"socket",worker:"worker",intercept:"intercept",go:"go",pushUrl:"pushUrl",replaceUrl:"replaceUrl",copy:"copy",pick:"pick",beep:"beep",js:"js",async:"async",render:"render",swap:"swap",morph:"morph",settle:"settle",append:"append",exit:"exit",install:"install",open:"open",close:"close",select:"select",clear:"clear",breakpoint:"breakpoint",prepend:"prepend",clone:"clone",scroll:"scroll",push:"push",replace:"replace",process:"process"},modifiers:{to:"to",from:"from",into:"into",with:"with",at:"at",in:"in",of:"of",as:"as",by:"by",before:"before",after:"after",over:"over",under:"under",between:"between",through:"through",without:"without"},events:{click:"click",dblclick:"dblclick",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"mouseover",mouseout:"mouseout",mousemove:"mousemove",keydown:"keydown",keyup:"keyup",keypress:"keypress",focus:"focus",blur:"blur",change:"change",input:"input",submit:"submit",reset:"reset",load:"load",unload:"unload",resize:"resize",scroll:"scroll",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",touchcancel:"touchcancel"},logical:{when:"when",where:"where",and:"and",or:"or",not:"not",is:"is",exists:"exists",matches:"matches",contains:"contains",includes:"includes",equals:"equals",has:"has",have:"have",then:"then",else:"else",otherwise:"otherwise",end:"end",live:"live",changes:"changes"},temporal:{seconds:"seconds",second:"second",milliseconds:"milliseconds",millisecond:"millisecond",minutes:"minutes",minute:"minute",hours:"hours",hour:"hour",ms:"ms",s:"s",min:"min",h:"h"},values:{true:"true",false:"false",null:"null",undefined:"undefined",it:"it",its:"its",me:"me",my:"my",myself:"myself",you:"you",your:"your",yourself:"yourself",element:"element",target:"target",detail:"detail",event:"event",window:"window",document:"document",body:"body",result:"result",value:"value"},attributes:{class:"class",classes:"classes",style:"style",styles:"styles",attribute:"attribute",attributes:"attributes",property:"property",properties:"properties"},expressions:{first:"first",last:"last",next:"next",previous:"previous",prev:"prev",at:"at",random:"random",closest:"closest",parent:"parent",children:"children",within:"within",no:"no",empty:"empty",some:"some","starts with":"starts with","ends with":"ends with","ignoring case":"ignoring case","sorted by":"sorted by","mapped to":"mapped to","split by":"split by","joined by":"joined by"}},es:dl,ko:kl,zh:xl,fr:fl,de:gl,ja:pl,ar:bl,tr:Al,id:Tl,qu:Ol,sw:Pl,pt:ql,it:Rl,vi:Ml,pl:$l,ru:_l,uk:zl,hi:Vl,bn:Hl,th:Bl,ms:Wl,tl:Dl,he:Fl},dc=["commands","modifiers","events","logical","temporal","values","attributes","expressions"];function mc(e){const t=new Set(tl),r=uc[e];return r?.commands&&Object.values(r.commands).forEach(e=>{"string"==typeof e&&t.add(e.toLowerCase())}),t}var pc=["is","are","was","were","am","be"];function hc(e){const t=new Set(pc);if("en"!==e)for(const r of pc)t.add(Rc(r,"en",e).toLowerCase());return t}function fc(e,t,r){const n=e[t-1]?.toLowerCase();return!!n&&r.has(n)}function yc(e,t,r,n){for(let i=t+1;e.length>i;i++){const t=e[i].toLowerCase();if(r.has(t))return!0;if(n.has(t))return!1}return!1}function gc(e){const t=e.filter(e=>!e.isBlank&&e.originalIndent.length>0);if(0===t.length)return e.map(()=>"");const r=t.map(e=>e.originalIndent.replace(/\t/g," ").length),n=Math.min(...r),i=n>0?n:4;return e.map(e=>{if(e.isBlank)return"";if(0===e.originalIndent.length)return"";const t=e.originalIndent.replace(/\t/g," ");return" ".repeat(Math.round(t.length/i))})}var vc=new Set(["to","into","from","with","by","as","at","in","on","of","over"]),bc=new Map,wc=new Set(["toggle","add","remove","trigger","send"]);function kc(e,t){for(const r of e){const e=r.toLowerCase();if(t.has(e)&&!vc.has(e)&&!Tc.has(e))return e}return null}var Ec=new Set(["live","when","unless"]),xc=new Set(["if","repeat","unless","while","for"]),Cc=new Set(["he","zh"]);function Ac(e,t){const r=mc(t),n=function(e){const t=bc.get(e);if(t)return t;const r=new Set(vc),n=ec(e);return n?.markers.forEach(e=>{const t=e.form.replace(/^-|-$/g,"").toLowerCase();t&&r.add(t),e.alternatives?.forEach(e=>{const t=e.replace(/^-|-$/g,"").toLowerCase();t&&r.add(t)})}),bc.set(e,r),r}(t),{forWords:i,inWords:a}=function(e){const t=new Set(["for"]),r=new Set(["in"]);return"en"!==e&&(t.add(Rc("for","en",e).toLowerCase()),r.add(Rc("in","en",e).toLowerCase())),{forWords:t,inWords:r}}(t),s=e.split(/\s+/);if(0===s.length)return[e];const o=[];let l=[];const c=s[0]?.toLowerCase();let u=!Tc.has(c),d=0;for(let e=0;s.length>e;e++){const t=s[e],c=t.toLowerCase();if(Ec.has(c)?d++:"end"===c&&d>0&&d--,r.has(c)&&l.length>0){const m=l[l.length-1].toLowerCase();if(!u){u=!0,l.push(t);continue}if(d>0){l.push(t);continue}if(i.has(c)&&!yc(s,e,a,r)){l.push(t);continue}if(vc.has(c)){const n=kc(l,r);if(n&&wc.has(n)){l.push(t);continue}if("on"===c&&"set"===n){const r=s[e+1],n=r?.toLowerCase();if(r&&(/^[#.<@[]/.test(r)||"me"===n||"it"===n||"you"===n)){l.push(t);continue}}}if(!n.has(m)&&!r.has(m)){o.push(l.join(" ")),l=[t];continue}}l.push(t)}return l.length>0&&o.push(l.join(" ")),o.filter(e=>e.length>0)}function Sc(e,t){const r=Array.from(ll),n="en"===t?null:uc[t];n?.modifiers?.then&&r.push(n.modifiers.then),n?.logical?.then&&r.push((n?.logical).then);const i=r.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),a=RegExp(`\\s+(${i.join("|")})\\s+`,"gi");return e.split(a).filter(e=>{const t=e.toLowerCase().trim();return t&&!r.some(e=>e.toLowerCase()===t)}).map(e=>e.trim()).filter(e=>e.length>0)}var Tc=function(){const e=new Set;e.add("on");for(const t of Object.values(Ql))for(const r of t.markers)if("event"===r.role){const t=r.form.replace(/^-|-$/g,"").toLowerCase();t&&e.add(t),r.alternatives?.forEach(t=>{const r=t.replace(/^-|-$/g,"").toLowerCase();r&&e.add(r)})}return e}(),Lc=new Set(["or"]),Oc=new Set(["async","once","debounced","debounce","throttled","throttle"]);function jc(e,t){const r=function(e){const t={};e.markers.forEach(e=>{const r=e.form.replace(/^-|-$/g,"").toLowerCase();r&&(t[r]=e.role),e.alternatives?.forEach(r=>{const n=r.replace(/^-|-$/g,"").toLowerCase();n&&(t[n]=e.role)})});for(const[e,r]of Object.entries(Yo))e in t||(t[e]=r);return t}(e),n=t?.toLowerCase();if("SVO"!==e.wordOrder||!n||!wc.has(n))return r;const i={};for(const[e,t]of Object.entries(r))i[e]="event"===t?"destination":t;return i}var Pc={zh:["\u65f6","\u7684","\u5730","\u5f97"],ja:[],ko:[]},Ic={zh:["\u5f53"],ar:["\u0628\u0640","\u0643\u0640","\u0648"]};function qc(e,t){const r=[];let n="",i=!1,a=0,s=0,o=0;for(let t=0;e.length>t;t++){const l=e[t];"<"===l?(i=!0,a++):">"===l&&i&&(a--,0===a&&(i=!1)),"["===l?s++:"]"===l&&s>0&&s--,"("===l?o++:")"===l&&o>0&&o--,/\s/.test(l)&&!i&&0===s&&0===o?n&&(r.push(n),n=""):n+=l}return n&&r.push(n),function(e,t){const r=Pc[t]||[],n=Ic[t]||[];if(0===r.length&&0===n.length)return e;const i=[];for(const t of e){if(/^[#.<@]/.test(t)||/^\d+/.test(t)){i.push(t);continue}let e=t,a="",s="";for(const t of n)if(e.startsWith(t)&&e.length>t.length){a=t,e=e.slice(t.length);break}for(const t of r)if(e.endsWith(t)&&e.length>t.length){s=t,e=e.slice(0,-t.length);break}a&&i.push(a),e&&i.push(e),s&&i.push(s)}return i}(r,t.code)}var Nc=new Set(["duration","quantity"]);function Rc(e,t,r){if(/^[#.<@]/.test(e))return e;if(/^\d+/.test(e))return e;if(/\s/.test(e)&&e.startsWith("("))return e.split(/\s+/).map(e=>Rc(e,t,r)).join(" ");if(e.length>1&&(e.startsWith("(")||e.endsWith(")"))){const n=e.match(/^(\(*)([^()]+)(\)*)$/);if(n&&(n[1]||n[3]))return n[1]+Rc(n[2],t,r)+n[3]}const n="en"===t?null:uc[t],i=uc[r];if(!i)return e;let a=e;if(n){const t=function(e,t){const r=t.toLowerCase();for(const t of dc){const n=e[t];for(const[e,i]of Object.entries(n))if(i.toLowerCase()===r)return{category:t,englishKey:e}}}(n,e);t&&(a=t.englishKey)}const s=function(e,t){const r=t.toLowerCase();for(const t of dc){const n=e[t][r];if(n)return n}}(i,a);return s??e}var Mc={en:{type:"suffix",marker:"'s"},es:{type:"preposition",marker:"de"},pt:{type:"preposition",marker:"de"},fr:{type:"preposition",marker:"de"},de:{type:"preposition",marker:"von"},ja:{type:"suffix",marker:"\u306e"},ko:{type:"suffix",marker:"\uc758"},zh:{type:"suffix",marker:"\u7684"},ar:{type:"preposition",marker:"\u0644\u0640"},tr:{type:"particle",marker:"\u0131n"},id:{type:"preposition",marker:"dari"},qu:{type:"particle",marker:"pa"},bn:{type:"suffix",marker:"\u09b0"},sw:{type:"preposition",marker:"ya"}};function $c(e,t,r){const n=e.match(/^(.+)'s$/i);if(!n)return e;const i=n[1],a=Mc[r]||Mc.en,s={me:"my",it:"its",you:"your"},o=i.toLowerCase();if(s[o])return Rc(s[o],"en",r);const l=Rc(i,t,r);switch(a.type){case"suffix":return`${l}${a.marker}`;case"particle":return`${l} ${a.marker}`;case"preposition":return`__POSS__${a.marker}__${l}__POSS__`;default:return l+"'s"}}var _c=/^(my|its|your|me|it|you)(\??\..+)$/i,zc={me:"my",it:"its",you:"your",my:"my",its:"its",your:"your"};function Vc(e,t,r){const n=e.match(_c);if(!n)return null;const i=n[1].toLowerCase(),a=n[2],s=zc[i]||i,o=Rc(s,t,r);if(o.includes(" "))return null;if(o!==s)return o+a;if(i!==s){const e=Rc(i,t,r);if(e!==i&&!e.includes(" "))return e+a}return null}function Hc(e,t,r){if(e.includes("[")){const n=[],i=e.replace(/\[[^\]]*\]/g,e=>(n.push(e),`\ue000${n.length-1}\ue001`));if(n.length>0)return Hc(i,t,r).replace(/\ue000(\d+)\ue001/g,(e,t)=>n[Number(t)])}if(!e.includes(" ")){if(e.includes("'s"))return $c(e,t,r);const n=Vc(e,t,r);return null!==n?n:Rc(e,t,r)}const n=e.split(/\s+/),i=[];let a=0;for(;n.length>a;){const e=n[a];if(e.includes("'s")){const s=$c(e,t,r),o=s.match(/^__POSS__(.+)__(.+)__POSS__$/);if(o&&n.length>a+1){const e=o[1],s=o[2],l=Rc(n[a+1],t,r);i.push(`${l} ${e} ${s}`),a+=2;continue}if(o){i.push(`${o[1]} ${o[2]}`),a++;continue}i.push(s),a++;continue}if(/^[#.<@]/.test(e)||/^\d+/.test(e)){i.push(e),a++;continue}if(/^["'].*["']$/.test(e)){i.push(e),a++;continue}const s=Vc(e,t,r);null===s?(i.push(Rc(e,t,r)),a++):(i.push(s),a++)}return i.join(" ")}var Bc=/(\^[A-Za-z_][\w-]*)(\s+on\s+(?:[#.][\w-]+|<[^>]*\/>|\[[^\]]+\]))/g,Wc=/\busing\s+view\b(?:\s+(?!then\b)[A-Za-z][\w-]*)?/gi,Dc=RegExp("^\ue002(\\d+)\ue003$"),Fc=class{constructor(e="en",t){const r=ec(e),n=ec(t);if(!r)throw Error("Unknown source locale: "+e);if(!n)throw Error("Unknown target locale: "+t);this.sourceProfile=r,this.targetProfile=n}transform(e){const t=this.transformInternal(e);return"he"===this.targetProfile.code?function(e){const t=mc("he"),r=e.split(/\s+/);let n=!1;for(let e=0;r.length>e+1;e++)"\u05d0\u05ea"===r[e]&&t.has(r[e+1].toLowerCase())&&([r[e],r[e+1]]=[r[e+1],r[e]],n=!0,e++);return n?r.join(" "):e}(t):t}transformInternal(e){const t=function(e){const t=[],r=e.replace(Wc,e=>{const r=t.length;return t.push(e),`\ue002${r}\ue003`});return t.length>0?{masked:r,tails:t}:null}(e);if(t)return function(e,t){return e.replace(RegExp("\ue002(\\d+)\ue003","g"),(e,r)=>t[Number(r)]??"")}(this.transformInternal(t.masked),t.tails);const r=function(e){const t=[],r=e.replace(Bc,(e,r,n)=>{const i=t.length;return t.push(n),`${r}\ue000${i}\ue001`});return t.length>0?{masked:r,scopes:t}:null}(e);if(r)return function(e,t){return e.replace(RegExp("\ue000(\\d+)\ue001","g"),(e,r)=>t[Number(r)]??"")}(this.transform(r.masked),r.scopes);const n=function(e){if("en"===e)return"then";const t=uc[e];return t&&(t.modifiers?.then||t.logical?.then)||"then"}(this.targetProfile.code);if(!e.includes("\n")){const t=this.tryTransformJsBlock(e);if(null!==t)return t;const r=this.tryTransformEventWithModifierBody(e);if(null!==r)return r;const n=this.tryTransformEventWithBlockBody(e);if(null!==n)return n;const i=this.tryTransformEventWithUnlessGuard(e);if(null!==i)return i}if(e.includes("\n")){const{parts:t,lineMetadata:r,partToLineIndex:i}=function(e,t){const r=e.split("\n"),n=[],i=[],a=[];for(let e=0;r.length>e;e++){const s=r[e],o=s.match(/^(\s*)/),l=o?o[1]:"",c=s.trim();if(n.push({content:c,originalIndent:l,isBlank:0===c.length}),c.length>0){const r=Sc(c,t);for(const n of r){const r=Ac(n,t);for(const t of r)i.push(t),a.push(e)}}}return{parts:i,lineMetadata:n,partToLineIndex:a}}(e,this.sourceProfile.code);return function(e,t,r,n){if(1>=t.filter(e=>!e.isBlank).length&&1>=e.length){const r=gc(t),n=[];for(let i=0;t.length>i;i++)t[i].isBlank?n.push(""):e.length>0&&n.push(r[i]+e[0]);return n.join("\n")}const i=gc(t),a=new Map;for(let t=0;e.length>t;t++){const n=r[t];a.has(n)||a.set(n,[]),a.get(n).push(e[t])}const s=[];for(let e=0;t.length>e;e++){const r=i[e];if(t[e].isBlank)s.push("");else{const t=a.get(e)||[];if(t.length>0){const e=t.join(` ${n} `);s.push(r+e)}}}return s.join("\n")}(t.map(e=>this.transformSingle(e)),r,i,n)}const i=function(e,t){const r=e.split(/\n/).map(e=>e.trim()).filter(e=>e.length>0),n=[];for(const e of r){const r=Sc(e,t);for(const e of r){const r=Ac(e,t);n.push(...r)}}return n}(e,this.sourceProfile.code);return i.length>1?i.map(e=>this.transformSingle(e)).join(` ${n} `):this.transformSingle(e)}transformSingle(e){const t=function(e,t){const r=e.split(/\s+/),n=r[0]?.toLowerCase();if(!n||!Ec.has(n))return null;let i=1,a=-1;for(let e=1;r.length>e;e++){const t=r[e].toLowerCase();if(Ec.has(t))i++;else if("end"===t&&(i--,0===i)){a=e;break}}if(-1!==a&&a!==r.length-1)return null;const s=-1!==a?r.slice(1,a):r.slice(1),o={headKeyword:r[0],body:""};if(-1!==a&&(o.tailKeyword=r[a]),"live"===n)return{...o,body:s.join(" ")};if("when"===n){const e=s.findIndex(e=>"changes"===e.toLowerCase());return 0>e?null:{...o,prefixExpr:s.slice(0,e).join(" "),connector:s[e],body:s.slice(e+1).join(" ")}}const l=mc(t),c=hc(t);let u=-1;for(let e=0;s.length>e;e++)if(l.has(s[e].toLowerCase())&&!fc(s,e,c)){u=e;break}return u>0?{...o,prefixExpr:s.slice(0,u).join(" "),body:s.slice(u).join(" ")}:null}(e,this.sourceProfile.code);if(t)return this.transformBlock(t);const r=this.transformWithTrailingEnd(e);if(null!==r)return r;const n=this.transformSetWithScope(e);if(null!==n)return n;const i=this.transformWithViewTransitionTail(e);if(null!==i)return i;const a=function(e,t="en"){const r=ec(t);if(!r)return null;const n=qc(e,r),i=function(e,t){if(0===e.length)return"unknown";const r=e[0].toLowerCase(),n=t.markers.find(e=>"event"===e.role&&"preposition"===e.position);return n&&r===n.form.toLowerCase()||Tc.has(r)?"event-handler":ol.has(r)?"conditional":"command"}(n,r);switch(i){case"event-handler":return function(e,t){const r=new Map;let n=Tc.has(e[0]?.toLowerCase())?1:0;if(e[n]){const t=[e[n]];for(n++;e[n]&&Lc.has(e[n].toLowerCase())&&e[n+1];)t.push(e[n],e[n+1]),n+=2;r.set("event",{role:"event",value:t.join(" ")})}if(e[n]&&"from"===e[n].toLowerCase()&&e[n+1]){n++;const t=[];for(;e[n]&&!tl.has(e[n].toLowerCase());)t.push(e[n]),n++;if(t.length>0){const e=t.join(" ");r.set("source",{role:"source",value:e,isSelector:/^[#.<@]/.test(e)})}}if(e[n]&&(r.set("action",{role:"action",value:e[n]}),n++),e[n]){const i=jc(t,r.get("action")?.value);let a="patient",s=[];for(let t=n;e.length>t;t++){const n=e[t],o=i[n.toLowerCase()];if(o){if(s.length>0){const e=s.join(" ");r.set(a,{role:a,value:e,isSelector:/^[#.<@]/.test(e)})}a=o,s=[]}else s.push(n)}if(s.length>0){const e=s.join(" ");r.set(a,{role:a,value:e,isSelector:/^[#.<@]/.test(e)})}}return{type:"event-handler",roles:r,original:e.join(" ")}}(n,r);case"command":return function(e,t){const r=new Map;if(0===e.length)return{type:"command",roles:r,original:""};r.set("action",{role:"action",value:e[0]});const n=jc(t,e[0]);let i="patient",a=[];for(let t=1;e.length>t;t++){const s=e[t],o=n[s.toLowerCase()];if(o){if(a.length>0){const e=a.join(" ");r.set(i,{role:i,value:e,isSelector:/^[#.<@]/.test(e)})}i=o,a=[]}else a.push(s)}if(a.length>0){const e=a.join(" ");r.set(i,{role:i,value:e,isSelector:/^[#.<@]/.test(e)})}return{type:"command",roles:r,original:e.join(" ")}}(n,r);case"conditional":return function(e){const t=new Map;t.set("action",{role:"action",value:e[0]});const r=e.findIndex(e=>ll.has(e.toLowerCase()));if(r>1){const n=e.slice(1,r).join(" ");t.set("condition",{role:"condition",value:n})}else-1===r&&e.length>1&&t.set("condition",{role:"condition",value:e.slice(1).join(" ")});return{type:"conditional",roles:t,original:e.join(" ")}}(n);default:return null}}(e,this.sourceProfile.code);if(!a)return e;!function(e,t){if("command"!==e.type)return;const r=e.roles.get("action")?.value;if(!r)return;const n=Qo[r.toLowerCase()];if(!n||!Nc.has(n))return;const i=e.roles.get("patient");i&&!e.roles.has(n)&&(t.markers.some(e=>e.role===n)||(e.roles.delete("patient"),e.roles.set(n,{...i,role:n})))}(a,this.targetProfile),function(e,t,r){for(const[n,i]of e.roles)i.translated=i.value.includes("'s")?Hc(i.value,t,r):i.isSelector||i.isLiteral?i.value:Hc(i.value,t,r)}(a,this.sourceProfile.code,this.targetProfile.code);const s=this.findRule(a);if(s?.transform.custom)return s.transform.custom(a,this.targetProfile);const o=Zl(a.roles,s?.transform.roleOrder||this.targetProfile.canonicalOrder);return Gl(s?.transform.insertMarkers??1?Xl(o,this.targetProfile.markers,this.targetProfile.adpositionType):o.map(e=>e.translated||e.value))}transformWithViewTransitionTail(e){const t=e.trim().split(/\s+/);if(2>t.length)return null;if(!Dc.test(t[t.length-1]))return null;const r=t[t.length-1],n=t.slice(0,-1).join(" ");return`${this.transformSingle(n)} ${r}`}transformWithTrailingEnd(e){const t=this.sourceProfile.code,r=e.trim().split(/\s+/);if(2>r.length)return null;const n=Rc("end","en",t).toLowerCase();if(r[r.length-1].toLowerCase()!==n)return null;const i=new Set(["if","repeat","unless","while","when","live","js"].map(e=>Rc(e,"en",t).toLowerCase()));return r.slice(0,-1).some(e=>i.has(e.toLowerCase()))?null:`${this.transformSingle(r.slice(0,-1).join(" "))} ${Rc(r[r.length-1],t,this.targetProfile.code)}`}tryTransformJsBlock(e){const t=this.sourceProfile.code,r=this.targetProfile.code,n=Rc("js","en",t),i=Rc("end","en",t).toLowerCase(),a=e.split(/\s+/).filter(e=>e.length>0),s=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=RegExp(`^${s}(\\(.*\\))?$`,"i"),l=a.findIndex(e=>o.test(e));if(-1===l)return null;let c=-1;for(let e=l+1;a.length>e;e++)if(a[e].toLowerCase()===i){c=e;break}if(-1===c)return null;if(c!==a.length-1)return null;const u=a[l],d=u.match(o)?.[1]??"",m=d?u.slice(0,u.length-d.length):u,p=a.slice(l+1,c).join(" "),h=[Rc(m,t,r)+d,p,Rc(a[c],t,r)].filter(e=>e.length>0).join(" "),f=a.slice(0,l);if(0===f.length)return h;const y="JSBLOCKPLACEHOLDER",g=this.transformSingle([...f,y].join(" "));return g.includes(y)?g.replace(y,h):null}tryTransformEventWithBlockBody(e){const t=qc(e,this.sourceProfile);if(0===t.length)return null;if(!Tc.has(t[0]?.toLowerCase()))return null;let r=-1;for(let e=1;t.length>e;e++)if(xc.has(t[e].toLowerCase())){r=e;break}if(0>=r)return null;if("end"!==t[t.length-1].toLowerCase())return null;const n=t.slice(0,r),i=t.slice(r);if("VSO"===this.targetProfile.wordOrder&&n.some(e=>"from"===e.toLowerCase()))return null;const a="EVENTBLOCKPLACEHOLDER",s=this.transformSingle([...n,a].join(" "));if(!s.includes(a))return null;const o=this.transformBlockBody(i);return[s.replace(a,"").replace(/\s+/g," ").trim(),o].filter(e=>e.length>0).join(" ")}tryTransformEventWithUnlessGuard(e){if(!Cc.has(this.targetProfile.code))return null;const t=qc(e,this.sourceProfile);if(0===t.length)return null;if(!Tc.has(t[0]?.toLowerCase()))return null;let r=-1;for(let e=1;t.length>e;e++)if("unless"===t[e].toLowerCase()){r=e;break}if(0>=r)return null;if("end"===t[t.length-1].toLowerCase())return null;const n=t.slice(0,r),i=t.slice(r).join(" "),a=this.transform(i);if(!a)return null;const s="EVENTGUARDPLACEHOLDER",o=this.transformSingle([...n,s].join(" "));return o.includes(s)?[o.replace(s,"").replace(/\s+/g," ").trim(),a].filter(e=>e.length>0).join(" "):null}tryTransformEventWithModifierBody(e){if("SOV"!==this.targetProfile.wordOrder)return null;const t=qc(e,this.sourceProfile);if(0===t.length)return null;if(!Tc.has(t[0]?.toLowerCase()))return null;let r=1;if(!t[r])return null;for(r++;t[r]&&Lc.has(t[r].toLowerCase())&&t[r+1];)r+=2;if("from"===t[r]?.toLowerCase()&&t[r+1])for(r++;t[r]&&!tl.has(t[r].toLowerCase())&&!Oc.has(t[r].toLowerCase());)r++;const n=t[r]?.toLowerCase();if(!n||!Oc.has(n))return null;const i=r;let a=r+1;"async"!==n&&"once"!==n&&("at"===t[a]?.toLowerCase()&&a++,t[a]&&/^\d+(ms|s|m)?$/.test(t[a])&&a++);const s=t.slice(i,a).join(" "),o=[...t.slice(0,i),...t.slice(a)].join(" ");return t.length-(a-i)>2?[s,this.transform(o)].filter(e=>e.length>0).join(" "):null}transformSetWithScope(e){const t=this.sourceProfile.code,r=this.targetProfile.code,n=e.match(/^(.*\bset\b.*\S)\s+on\s+([#.<@[]\S*|me|it|you)\s*$/i);if(!n)return null;const i=n[2],a=this.transformSingle(n[1]),s=/^[#.<@[]/.test(i)?i:Rc(i,t,r);if("SOV"===this.targetProfile.wordOrder){const t=Rc("set","en",r),n=e.trim().split(/\s+/)[0]?.toLowerCase(),i=!!n&&Tc.has(n),o=a.split(/\s+/).filter(Boolean);if(i){if(o.length>0&&o[o.length-1]===t)return o.splice(o.length-1,0,"on",s),o.join(" ")}else{const e=o.indexOf(t);if(e>=0)return o.splice(e,1),o.push("on",s,t),o.join(" ")}return`${a} on ${s}`}return`${a} on ${s}`}transformBlockBody(e){const t=this.sourceProfile.code,r=this.targetProfile.code,n=e[0],i="end"===e[e.length-1]?.toLowerCase(),a=i?e[e.length-1]:"",s=e.slice(1,i?-1:void 0),o=mc(t),l=hc(t);let c=s.findIndex((e,t)=>o.has(e.toLowerCase())&&!fc(s,t,l));0>c&&(c=s.length);const u=s.slice(0,c).join(" "),d=s.slice(c),m=Rc(n,t,r),p=a?Rc(a,t,r):"",h=u?Hc(u,t,r):"",f=this.transformConditionalBody(d);return[m,h,"SOV"===this.targetProfile.wordOrder&&h&&new Set(["first","last","next","previous","closest"]).has(d[1]?.toLowerCase())&&"then"!==s[c-1]?.toLowerCase()?Rc("then",t,r):"",f,p].filter(e=>e.length>0).join(" ")}transformConditionalBody(e){const t=this.sourceProfile.code,r=this.targetProfile.code,n=Rc("else","en",t).toLowerCase();let i=0,a=-1;for(let t=0;e.length>t;t++){const r=e[t].toLowerCase();if(xc.has(r))i++;else if("end"===r&&i>0)i--;else if(r===n&&0===i){a=t;break}}if(-1===a){const t=e.join(" ");return t?this.transform(t):""}const s=e.slice(0,a).join(" "),o=e.slice(a+1).join(" "),l=Rc(e[a],t,r);return[s?this.transform(s):"",l,o?this.transform(o):""].filter(e=>e.length>0).join(" ")}transformBlock(e){const t=this.sourceProfile.code,r=this.targetProfile.code,n=Rc(e.headKeyword,t,r),i=e.tailKeyword?Rc(e.tailKeyword,t,r):"",a=e.connector?Rc(e.connector,t,r):"";return[n,e.prefixExpr?Hc(e.prefixExpr,t,r):"",a,this.transform(e.body),i].filter(e=>e.length>0).join(" ")}findRule(e){if(this.targetProfile.rules)return this.targetProfile.rules.filter(t=>this.matchesRule(e,t)).sort((e,t)=>t.priority-e.priority)[0]}matchesRule(e,t){const{match:r}=t;for(const t of r.requiredRoles)if(!e.roles.has(t))return!1;if(r.commands&&r.commands.length>0){const t=e.roles.get("action");if(!t)return!1;const n=t.value.toLowerCase();if(!r.commands.some(e=>e.toLowerCase()===n))return!1}return!(r.predicate&&!r.predicate(e))}};function Uc(e,t){return new Fc("en",t).transform(e)}function Kc(e,t){return new Fc(t,"en").transform(e)}Kl.register("en",ul()),Kl.register("es",ml),Kl.register("ja",hl),Kl.register("fr",yl),Kl.register("de",vl),Kl.register("ar",wl),Kl.register("ko",El),Kl.register("zh",Cl),Kl.register("tr",Sl),Kl.register("id",Ll),Kl.register("pt",Nl),Kl.register("qu",jl),Kl.register("sw",Il);let Zc="en";const Xc=Un(ni,ta,la,Qr,Xr,ya),Gc=function(e,t){const r=new Mn(null);for(const t of e)r.register(t);return new Fn({registry:r,expressionRegistry:t.expressionRegistry,enableAsyncCommands:t.enableAsyncCommands??!0,commandTimeout:t.commandTimeout??1e4,enableErrorReporting:t.enableErrorReporting??!0,enableResultPattern:t.enableResultPattern??!0})}([Ka(),Qa(),Es(),xs(),Ss(),Ls(),Is(),qs(),Ms(),_s(),Vs(),Bs(),Fs(),Us(),Zs(),Js(),Qs(),eo(),to(),no(),io(),oo(),lo(),mo(),po(),ho(),yo(),wo(),Co(),To(),Lo(),Oo(),jo(),Po(),Io(),qo(),No(),Ro(),_o(),zo(),Vo(),Ho(),Mo(),$o(),Bo(),Wo(),Do(),new Fo,Zo(),Xo(),new Go,new Jo],{expressionRegistry:Xc});function Jc(e){const t=function(){if("en"!==Zc)return Kl.get(Zc)}();return er(e,t?{keywords:t}:void 0)}const Yc={parse:e=>Jc(e),execute:async(e,t)=>{const r=pr(t),n=Jc(e);if(!n.success||!n.node)throw Error(n.error?.message||"Parse failed");return await Gc.execute(n.node,r)}},Qc=function(e){return new Kn(e)}(Yc),eu={getLocale:()=>Zc,setLocale(e){if(Kl.has(e)){if(Zc=e,Kl.setDefault(e),"undefined"!=typeof document){document.documentElement.setAttribute("lang",e);const t=ec(e);"rtl"===t?.direction?document.documentElement.setAttribute("dir","rtl"):document.documentElement.setAttribute("dir","ltr")}}else console.warn(`Locale '${e}' not registered. Available: ${Kl.getAvailable().join(", ")}`)},getAvailableLocales:()=>Kl.getAvailable(),detectAndSetLocale(){if("undefined"==typeof navigator)return"en";const e=navigator.languages||[navigator.language];for(const t of e){const e=t.split("-")[0].toLowerCase();if(Kl.has(e))return this.setLocale(e),e}return"en"},registerLocale(e,t){Kl.register(e,t)},toLocale:(e,t)=>Uc(e,t||Zc),toEnglish:(e,t)=>Kc(e,t||Zc),translate:function(e,t,r){return t===r?e:"en"===t?Uc(e,r):"en"===r?Kc(e,t):cc.has(`${t}->${r}`)?function(e,t,r){const n=cc.get(`${t}->${r}`);if(!n)return Uc(Kc(e,t),r);return e.split(/\s+/).map(e=>{if(e.startsWith("#")||e.startsWith(".")||e.startsWith("@"))return e;if(e.startsWith('"')||e.startsWith("'"))return e;const t=n.words[e];if(t)return t;const r=e.match(/^(.+?)(-.+)$/);if(r){const[,e,t]=r;return(n.words[e]||e)+t}return e}).join(" ")}(e,t,r):Uc(Kc(e,t),r)},createTransformer:(e,t)=>new Fc(e,t),getProfile:ec,getSupportedGrammarLocales:function(){return Object.keys(Ql)},profiles:Ql,dictionaries:{en:{},es:dl,ja:pl,fr:fl,de:gl,ar:bl,ko:kl,zh:xl,tr:Al,id:Tl,pt:ql,qu:Ol,sw:Pl},createKeywordProvider:cl},tu={runtime:Yc,parse:e=>Jc(e),compile:e=>{const t=performance.now();try{const r=Jc(e);return{success:r.success,ast:r.node,errors:r.errors??(r.error?[r.error]:[]),tokens:r.tokens||[],compilationTime:performance.now()-t}}catch(e){return{success:!1,ast:void 0,errors:[{message:e instanceof Error?e.message:e+"",line:1,column:1}],tokens:[],compilationTime:performance.now()-t}}},execute:async(e,t)=>{const r=pr(t);if("string"==typeof e){const t=Jc(e);if(!t.success||!t.node)throw Error(t.error?.message||"Parse failed");return await Gc.execute(t.node,r)}if(e&&"object"==typeof e)return await Gc.execute(e,r);throw Error("execute() requires a code string or compiled AST")},run:async(e,t)=>{const r=pr(t),n=Jc(e);if(!n.success||!n.node)throw Error(n.error?.message||"Parse failed");return await Gc.execute(n.node,r)},evaluate:async(e,t)=>tu.run(e,t),processNode:e=>{e===document?Qc.scanAndProcessAll():e instanceof HTMLElement&&Qc.processElement(e)},process:e=>tu.processNode(e),createContext:mr,attributeProcessor:Qc,version:"1.1.0-classic-i18n",i18n:eu,commands:["add","remove","toggle","put","hide","show","make","if","unless","repeat","break","continue","halt","return","exit","throw","set","get","increment","decrement","default","wait","fetch","trigger","send","transition","measure","settle","take","log","tell","call","copy","pick","beep","js","async","go","install","append","prepend","render","pseudo-command"],locales:["en","es","ja","fr","de","ar","ko","zh","tr","id","pt","qu","sw"],eval:async(e,t)=>Yc.execute(e,t),init:e=>{!1!==e?.autoDetectLocale&&eu.detectAndSetLocale(),Qc.init()}};"undefined"!=typeof window&&(window.hyperfixi=tu,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{tu.init()}):tu.init());class ru{constructor(){this.name="addition",this.category="Special",this.syntax="left + right",this.outputType="number",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=this.validate(t);if(!r.isValid)return{success:!1,errors:r.errors,suggestions:r.suggestions};try{const{left:e,right:r}=t,n=vi(e,"left operand");return{success:!0,value:wi(n+vi(r,"right operand"),"addition"),type:"number"}}catch(e){return{success:!1,errors:[Ai("runtime-error","Addition failed: "+(e instanceof Error?e.message:e+""))],suggestions:["Ensure both operands are numeric"]}}}validate(e){const t=function(e){if(null==e)return Ci([Ai("missing-argument","Input is null or undefined")],["Provide an object with left and right operands"]);if("object"!=typeof e)return Ci([Ai("type-mismatch","Expected object, got "+typeof e)],["Provide an object with left and right operands"]);const t=e;if(!("left"in t)||!("right"in t)){const e=[];return"left"in t||e.push("left"),"right"in t||e.push("right"),Ci([Ai("missing-argument",`Missing ${e.join(" and ")} operand${e.length>1?"s":""}`)],["Provide { left: value, right: value }"])}return{isValid:!0,errors:[],suggestions:[]}}(e);if(!t.isValid)return t;const{left:r,right:n}=e;return ki(r)?ki(n)?{isValid:!0,errors:[],suggestions:[]}:{isValid:!1,errors:[Ai("type-mismatch","Right operand cannot be converted to number: "+n)],suggestions:["Provide a numeric value for right operand"]}:{isValid:!1,errors:[Ai("type-mismatch","Left operand cannot be converted to number: "+r)],suggestions:["Provide a numeric value for left operand"]}}}const nu={addition:new ru,subtraction:new class{constructor(){this.name="subtraction",this.category="Special",this.syntax="left - right",this.outputType="number",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=this.validate(t);if(!r.isValid)return{success:!1,errors:r.errors,suggestions:r.suggestions};try{const{left:e,right:r}=t,n=vi(e,"left operand");return{success:!0,value:wi(n-vi(r,"right operand"),"subtraction"),type:"number"}}catch(e){return{success:!1,errors:[Ai("runtime-error","Subtraction failed: "+(e instanceof Error?e.message:e+""))],suggestions:["Ensure both operands are numeric"]}}}validate(e){return(new ru).validate(e)}},multiplication:new class{constructor(){this.name="multiplication",this.category="Special",this.syntax="left * right",this.outputType="number",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=this.validate(t);if(!r.isValid)return{success:!1,errors:r.errors,suggestions:r.suggestions};try{const{left:e,right:r}=t,n=vi(e,"left operand");return{success:!0,value:wi(n*vi(r,"right operand"),"multiplication"),type:"number"}}catch(e){return{success:!1,errors:[Ai("runtime-error","Multiplication failed: "+(e instanceof Error?e.message:e+""))],suggestions:["Ensure both operands are numeric"]}}}validate(e){return(new ru).validate(e)}},division:new class{constructor(){this.name="division",this.category="Special",this.syntax="left / right",this.outputType="number",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=this.validate(t);if(!r.isValid)return{success:!1,errors:r.errors,suggestions:r.suggestions};try{const{left:e,right:r}=t,n=function(e,t,r=!0){if(0===t){if(r)return 0===e?NaN:e>0?1/0:-1/0;throw Error("Division by zero")}return e/t}(vi(e,"left operand"),vi(r,"right operand"),!0);return{success:!0,value:n,type:"number"}}catch(e){return{success:!1,errors:[Ai("runtime-error","Division failed: "+(e instanceof Error?e.message:e+""))],suggestions:["Ensure both operands are numeric"]}}}validate(e){return(new ru).validate(e)}},modulo:new class{constructor(){this.name="modulo",this.category="Special",this.syntax="left mod right",this.outputType="number",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=this.validate(t);if(!r.isValid)return{success:!1,errors:r.errors,suggestions:r.suggestions};try{const{left:e,right:r}=t,n=function(e,t){if(0===t)throw Error("Modulo by zero");return e%t}(vi(e,"left operand"),vi(r,"right operand"));return{success:!0,value:n,type:"number"}}catch(e){return{success:!1,errors:[Ai("runtime-error","Modulo failed: "+(e instanceof Error?e.message:e+""))],suggestions:["Ensure both operands are numeric and divisor is not zero"]}}}validate(e){return(new ru).validate(e)}},power:new class{constructor(){this.name="power",this.category="Special",this.syntax="left ** right",this.outputType="number",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=this.validate(t);if(!r.isValid)return{success:!1,errors:r.errors,suggestions:r.suggestions};try{const{left:e,right:r}=t,n=vi(e,"left operand"),i=vi(r,"right operand");return{success:!0,value:wi(Math.pow(n,i),"power"),type:"number"}}catch(e){return{success:!1,errors:[Ai("runtime-error","Power failed: "+(e instanceof Error?e.message:e+""))],suggestions:["Ensure both operands are numeric"]}}}validate(e){return(new ru).validate(e)}}};var iu=Object.freeze({__proto__:null,conversion:Xr,conversionExpressions:Xr,createCommonRegistry:function(){return Un(ni,ta,la,Xr,ya)},createCoreRegistry:function(){return Un(ni,ta,la)},createExpressionRegistry:Un,createFullExpressionRegistry:function(){return Un(ni,ta,Xr,ya,Qr,la,nu)},createFullRegistry:function(){return Un(ni,ta,la,Xr,ya,Qr)},logical:ta,logicalExpressions:ta,positional:ya,positionalExpressions:ya,properties:Qr,propertiesExpressions:Qr,references:ni,referencesExpressions:ni,special:la,specialExpressions:la});return tu}();
1
+ var hyperfixi=function(){"use strict";const e="then",t="else",r="end",n="and",i="for",a="while",s="until",o="forever",l="times",c="index",u="in",d="to",m="from",p="with",h="of",f="on",y="event",g="behavior",v="global",b="the",w="start",k=new Set(["add","append","async","beep","blur","break","breakpoint","call","clear","close","continue","copy","decrement","default","empty","exit","fetch","focus","get","go","halt","hide","if","increment","install","js","log","make","measure","morph","open","pick","prepend","process","pseudo-command","push","put","remove","render","repeat","replace","reset","return","scroll","select","send","set","settle","show","start","swap","take","tell","throw","toggle","transition","trigger","unless","wait","for"]),E=new Set(["put","trigger","send","remove","take","toggle","set","show","hide","add","halt","measure","js","go","tell","pick","start","swap","morph","push","replace","process"]),x=(new Set(["if","unless","repeat","wait","for","while"]),"at start of"),C="at end of",A=["into","before","after","at",x,C,"at the start of","at the end of"],S=new Set(["if","else","unless","for","while","until","end","and","or","not","in","to","from","into","with","without","as","matches","contains","then","on","when","every","init","def","behavior","the","of","first","last"]),T=e=>k.has(e.toLowerCase()),L=e=>E.has(e.toLowerCase()),O=e=>S.has(e.toLowerCase()),j=e=>P.has(e.toLowerCase()),P=new Set(["hsl","hsla","rgb","rgba","hwb","lab","lch","oklch","oklab","color","color-mix","calc","min","max","clamp","var","url","linear-gradient","radial-gradient","conic-gradient","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient"]),I=new Set(["me","it","you","result","my","its","your"]),q=new Set(["and","or","not","no"]),N=new Set(["==","!=","===","!==","<",">","<=",">=","is","is not","am","is a","is an","is not a","is not an","precedes","does not precede","follows","does not follow","contains","starts with","ends with","does not start with","does not end with","has","have","does not contain","include","includes","does not include","match","matches","exists","does not exist","is empty","is not empty","is in","is not in","is between","is not between","equals","in","is equal to","is really equal to","is not equal to","is not really equal to","is greater than","is less than","is greater than or equal to","is less than or equal to","really equals","am in","am not in","am between","am not between","is really","is not really","is equal","is not equal","contain","do not contain","does not contains","do not match","does not match","ignoring case","sorted by","mapped to","split by","joined by"]),R=new Set(["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","focus","blur","change","input","submit","reset","select","load","unload","resize","scroll","keydown","keyup","keypress","touchstart","touchend","touchmove","touchcancel","drag","drop","dragover","dragenter","dragleave","cut","copy","paste","toggle"]),M=new Set(["on","init","behavior","def","if","else","unless","for","while","until","end","and","or","not","in","to","from","into","with","as","then","when","where","after","before","by","at","between","async","no","start","of","the","new","global","local","equal","equals","greater","less","than","really","catch","finally","throw","return"]);var $;!function(e){e.IDENTIFIER="identifier",e.STRING="string",e.NUMBER="number",e.SELECTOR="selector",e.OPERATOR="operator",e.TIME="time",e.TEMPLATE="template",e.COMMENT="comment",e.SYMBOL="symbol",e.UNKNOWN="unknown"}($||($={}));const _=new Set(["+","-","*","/","mod"]),z=new Set(["ms","s","seconds","minutes","hours","days"]);function V(e,t=1){const r=e.position+t;return e.input.length>r?e.input[r]:""}function H(e){const t=e.input[e.position];return e.position++,"\n"===t?(e.line++,e.column=1):"\r"===t?("\n"===(e.input.length>e.position?e.input[e.position]:"")&&e.position++,e.line++,e.column=1):e.column++,t}function B(e){const t=e.input,r=t.length;for(;r>e.position;){const r=t[e.position];if(" "!==r&&"\t"!==r&&"\r"!==r&&"\n"!==r)break;H(e)}}function W(e,t,r,n,i){const a=n??e.position-r.length,s=e.position;let o=e.column-r.length;if(void 0!==n){o=1;let t=-1;for(let r=0;n>r;r++)"\n"!==e.input[r]&&"\r"!==e.input[r]||(t=r);o=n-t}const l={kind:t,value:r,start:a,end:s,line:D(e,a),column:o};e.tokens.push(l)}function D(e,t){let r=1;for(let n=0;t>n&&e.input.length>n;n++){const t=e.input[n];"\n"===t?r++:"\r"===t&&(r++,e.input.length>n+1&&"\n"===e.input[n+1]&&n++)}return r}function F(e){const t=e.position;let r="";for(H(e),H(e);e.input.length>e.position&&"\n"!==e.input[e.position];)r+=H(e);W(e,$.COMMENT,"--"+r,t)}function U(e){const t=e.position,r=H(e);let n=r;for(;e.input.length>e.position;){const t=H(e);if(n+=t,t===r)break;"\\"===t&&e.input.length>e.position&&(n+=H(e))}W(e,$.STRING,n,t)}function K(e){const t=e.position;H(e);let r="";for(;e.input.length>e.position;){const t=e.input[e.position];if("`"===t){H(e);break}if("\\"===t){if(H(e),e.input.length>e.position){const t=H(e);switch(t){case"n":r+="\n";break;case"t":r+="\t";break;case"r":r+="\r";break;case"\\":r+="\\";break;case"`":r+="`";break;default:r+=t}}}else r+=H(e)}if(e.position>=e.input.length&&!e.input.endsWith("`"))throw Error(`Unterminated template literal at line ${e.line}, column ${e.column-r.length}`);W(e,$.TEMPLATE,r,t)}function Z(e){const t=e.position;let r=H(e);if(e.input.length>e.position&&"{"===e.input[e.position]){for(r+=H(e);e.input.length>e.position;){const t=e.input[e.position];if(r+=H(e),"}"===t)break}W(e,$.SELECTOR,r,t)}else{for(;e.input.length>e.position;){const t=e.input[e.position];if("\\"===t)H(e),e.input.length>e.position&&(r+=H(e));else{if(!re(t)&&"-"!==t&&"_"!==t&&":"!==t)break;r+=H(e)}}W(e,$.SELECTOR,r,t)}}function X(e){const t=e.position;if(ne(e))return void function(e,t){const r=e.input;let n="",i=0,a="";for(;r.length>e.position;){const t=r[e.position];if(a)n+=H(e),t===a&&(a="");else if('"'!==t&&"'"!==t){if("<"===t){if("/"===r[e.position+1]){for(;r.length>e.position&&">"!==r[e.position];)n+=H(e);if(r.length>e.position&&(n+=H(e)),i--,0>=i)break;continue}let t=!1,a="";for(;r.length>e.position;){const i=r[e.position];if(a)n+=H(e),i===a&&(a="");else if('"'!==i&&"'"!==i){if(">"===i){t="/"===r[e.position-1],n+=H(e);break}n+=H(e)}else a=i,n+=H(e)}if(t||i++,0>=i)break;continue}n+=H(e)}else a=t,n+=H(e)}W(e,$.SELECTOR,n,t)}(e,t);let r="";for(r+=H(e);e.input.length-1>e.position;){const t=e.input[e.position],n=e.input[e.position+1];if(r+=H(e),"/"===t&&">"===n){r+=H(e);break}}W(e,$.SELECTOR,r,t)}function G(e){const t=e.position;let r=H(e);for(;e.input.length>e.position;){const t=e.input[e.position];if(!re(t)&&"_"!==t&&"-"!==t)break;r+=H(e)}W(e,$.SYMBOL,r,t)}function J(e){const t=e.position;let r="";const n=e.input[e.position];if(("'"===n||"'"===n)&&"s"===V(e,1))return r="'s",H(e),H(e),void W(e,$.OPERATOR,r,t);const i=e.input.substring(e.position,e.position+2),a=e.input.substring(e.position,e.position+3);["===","!=="].includes(a)?(r=a,H(e),H(e),H(e)):["==","!=","<=",">=","&&","||","**","~=","|=","^=","$=","*=","?."].includes(i)?(r=i,H(e),H(e)):r=H(e),W(e,$.OPERATOR,r,t)}function Y(e){const t=e.position,r=e.input,n=r.length;let i="";for(;n>e.position;){const t=r[e.position];if("0">t||t>"9")break;i+=H(e)}if(n>e.position&&"."===r[e.position]&&(e.position+1>=n||"."!==r[e.position+1]))for(i+=H(e);n>e.position;){const t=r[e.position];if("0">t||t>"9")break;i+=H(e)}if(n>e.position){const t=r[e.position];if("e"===t||"E"===t){const t=n>e.position+1?r[e.position+1]:"",a=n>e.position+2?r[e.position+2]:"";if(t>="0"&&"9">=t||!("+"!==t&&"-"!==t||"0">a||a>"9"))for(i+=H(e),"+"!==r[e.position]&&"-"!==r[e.position]||(i+=H(e));n>e.position;){const t=r[e.position];if("0">t||t>"9")break;i+=H(e)}}}const a=e.position;let s="";for(;n>e.position;){const t=r[e.position];if(("a">t||t>"z")&&("A">t||t>"Z"))break;s+=H(e)}z.has(s)?W(e,$.TIME,i+s,t):(e.position=a,W(e,$.NUMBER,i,t))}function Q(e){const t=e.position,r=e.input,n=r.length;let i="";for(;n>e.position;){const t=r[e.position];if(("a">t||t>"z")&&("A">t||t>"Z")&&("0">t||t>"9")&&"_"!==t&&"-"!==t)break;i+=H(e)}const a=function(e,t,r){const n=t.toLowerCase(),i=e.position;if("'s"===t||"'s"===t)return!1;const a=e.tokens[e.tokens.length-1];if(a&&(a.kind===$.IDENTIFIER||a.kind===$.SELECTOR)){const t=e.input.length>e.position?e.input[e.position]:"";if("'"===t||"'"===t)return!1}B(e);let s="";for(;e.input.length>e.position;){const t=e.input[e.position];if(("a">t||t>"z")&&("A">t||t>"Z")&&("0">t||t>"9")&&"_"!==t&&"-"!==t)break;s+=H(e)}if(s){const t=s.toLowerCase(),i=`${n} ${t}`,a=function(e,t,r,n){const i=t.toLowerCase(),a=r.toLowerCase();if("at"===i){const t=e.position;if("the"===a){B(e);let r="";for(;e.input.length>e.position;){const t=e.input[e.position];if(("a">t||t>"z")&&("A">t||t>"Z")&&("0">t||t>"9")&&"_"!==t&&"-"!==t)break;r+=H(e)}const i=r.toLowerCase();if("start"===i||"end"===i){B(e);let t="";for(;e.input.length>e.position;){const r=e.input[e.position];if(("a">r||r>"z")&&("A">r||r>"Z")&&("0">r||r>"9")&&"_"!==r&&"-"!==r)break;t+=H(e)}if("of"===t.toLowerCase())return W(e,$.IDENTIFIER,`at the ${i} of`,n),!0}return e.position=t,!1}if("start"===a||"end"===a){B(e);let r="";for(;e.input.length>e.position;){const t=e.input[e.position];if(("a">t||t>"z")&&("A">t||t>"Z")&&("0">t||t>"9")&&"_"!==t&&"-"!==t)break;r+=H(e)}return"of"===r.toLowerCase()?(W(e,$.IDENTIFIER,`at ${a} of`,n),!0):(e.position=t,!1)}}return!1}(e,n,t,r);if(a)return!0;const o=function(e,t,r){const n=e.position;let i=`${t} ${r}`,a=e.position;const s=[t,r];for(;8>s.length&&(B(e),e.input.length>e.position);){let t="";for(;e.input.length>e.position;){const r=e.input[e.position];if(("a">r||r>"z")&&("A">r||r>"Z"))break;t+=H(e)}if(!t)break;s.push(t.toLowerCase());const r=s.join(" ");N.has(r)&&(i=r,a=e.position)}return N.has(i)&&i!==`${t} ${r}`?(e.position=a,i):(e.position=n,null)}(e,n,t);if(o)return W(e,$.OPERATOR,o,r),!0;if(N.has(i))return W(e,$.OPERATOR,i,r),!0}return N.has(n)?(e.position=i,W(e,$.OPERATOR,t,r),!0):(e.position=i,!1)}(e,i,t);if(a)return;const s=function(e){const t=e.toLowerCase();return"include"===t||"includes"===t||q.has(t)||_.has(e)||_.has(t)||N.has(t)?$.OPERATOR:$.IDENTIFIER}(i);W(e,s,i,t)}function ee(e){const t=e.position,r=e.input,n=r.length;H(e);let i="$";for(;n>e.position;){const t=r[e.position];if(("a">t||t>"z")&&("A">t||t>"Z")&&("0">t||t>"9")&&"_"!==t)break;i+=H(e)}W(e,$.IDENTIFIER,i,t)}function te(e){return/[a-zA-Z]/.test(e)}function re(e){return/[a-zA-Z0-9]/.test(e)}function ne(e){const t=e.input,r=t[e.position+1];if(!r||!/[a-zA-Z]/.test(r))return!1;let n=e.position+1,i="";for(;t.length>n&&/[a-zA-Z0-9-]/.test(t[n]);)i+=t[n],n++;return i.length>0&&-1!==t.indexOf("</"+i+">",n)}function ie(e){if(ne(e))return!0;let t=e.position+1,r=!1;for(;e.input.length>t;){const n=e.input[t];if("/"===n&&e.input.length>t+1&&">"===e.input[t+1])return r;if(re(n)||"."===n||"#"===n||"["===n||"]"===n||":"===n||"-"===n||"_"===n||" "===n||"="===n||'"'===n||"'"===n||"("===n||")"===n||"*"===n||"^"===n||"$"===n||"~"===n||"|"===n||">"===n||"+"===n||","===n||"{"===n||"}"===n)r=!0,t++;else{if(" "!==n&&"\t"!==n)return!1;t++}if(t-e.position>50)return!1}return!1}function ae(e){return"+-*/^%=!<>&|(){}[],.;:?''~$".includes(e)}const se=function(){if("undefined"!=typeof localStorage)try{const e=localStorage,t=e.getItem("hyperfixi:debug")||e.getItem("lokascript:debug");if("*"===t||"true"===t)return!0}catch{}return!("undefined"==typeof window||!window.__HYPERFIXI_DEBUG__)||"undefined"!=typeof process&&"true"===process.env?.HYPERFIXI_DEBUG}(),oe=se,le=se,ce=se,ue=se,de=(...e)=>{oe&&console.log("\ud83d\udd27",...e)},me=(...e)=>{le&&console.log("\ud83c\udfaf",...e)},pe=(...e)=>{ce&&console.log("\ud83d\udcdd",...e)},he=(...e)=>{ue&&console.log("\ud83d\ude80",...e)};let fe=!1,ye=null;if("undefined"!=typeof window&&"undefined"!=typeof URLSearchParams)try{"semantic"===new URLSearchParams(window.location.search).get("debug")&&(fe=!0,ye=window,console.log("%c[HyperFixi] Semantic debug auto-enabled via URL param","color: #667eea; font-weight: bold"))}catch{}let ge={totalParses:0,semanticSuccesses:0,semanticFallbacks:0,traditionalParses:0,averageConfidence:0,confidenceHistory:[]};class ve{constructor(e){this.analyzer=e.analyzer,this.language=e.language,this.confidenceThreshold=e.confidenceThreshold??.5,this.debugEnabled=e.debug??!1}isAvailable(){return this.analyzer.supportsLanguage(this.language)}shouldSkipSemantic(e){const t=e.trim().split(/\s+/)[0]?.toLowerCase();if(ve.SKIP_SEMANTIC_COMMANDS.has(t))return!0;const r=e.toLowerCase();return!!/\bjs\b/.test(r)||!!/\btell\b/.test(r)||!!/\*[a-zA-Z]/.test(e)}trySemanticParse(e){const t=performance.now();if(this.shouldSkipSemantic(e))return{success:!1,confidence:0,errors:["Command skipped for semantic parsing - using traditional parser"]};if(!this.isAvailable())return{success:!1,confidence:0,errors:[`Semantic parsing not available for language '${this.language}'`]};try{const n=this.analyzer.analyze(e,this.language),i=performance.now()-t;this.debugEnabled&&console.log("[SemanticIntegration] Analysis result:",{input:e,language:this.language,confidence:n.confidence,command:n.command?.name,threshold:this.confidenceThreshold});const a=n.confidence>=this.confidenceThreshold&&!!n.command,s=!a&&n.confidence>0;if(fe){const t={};if(n.command?.roles)for(const[e,r]of n.command.roles)t[e]=r.value;const o={input:e.substring(0,100),language:this.language,confidence:n.confidence,threshold:this.confidenceThreshold,semanticSuccess:a,fallbackTriggered:s,command:n.command?.name,roles:Object.keys(t).length>0?t:void 0,errors:n.errors,timestamp:Date.now(),duration:i};!function(e){if(!fe)return;const t=e.semanticSuccess?"semantic":e.fallbackTriggered?"fallback":"traditional",r=Math.round(100*e.confidence),n=Math.round(100*e.threshold),i=e.semanticSuccess?"color: #4caf50; font-weight: bold":e.fallbackTriggered?"color: #ff9800; font-weight: bold":"color: #9e9e9e";if(console.groupCollapsed(`%c[Semantic] ${t.toUpperCase()} %c${e.input.substring(0,50)}${e.input.length>50?"...":""}`,i,"color: #888"),console.log(`Confidence: ${r}% (threshold: ${n}%)`),e.command&&console.log("Command: "+e.command),e.roles&&Object.keys(e.roles).length>0&&console.log("Roles:",e.roles),e.duration&&console.log(`Duration: ${e.duration.toFixed(2)}ms`),e.errors?.length&&console.log("Errors:",e.errors),console.groupEnd(),ye){const t=new CustomEvent("lokascript:semantic:parse",{detail:e,bubbles:!0});ye.dispatchEvent(t)}}(o),r=o,ge.totalParses++,r.semanticSuccess?ge.semanticSuccesses++:r.fallbackTriggered?ge.semanticFallbacks++:ge.traditionalParses++,ge.confidenceHistory.push(r.confidence),ge.confidenceHistory.length>100&&ge.confidenceHistory.shift(),ge.averageConfidence=ge.confidenceHistory.reduce((e,t)=>e+t,0)/ge.confidenceHistory.length}return a?{success:!0,node:this.buildCommandNode(n),confidence:n.confidence,tokensConsumed:n.tokensConsumed}:{success:!1,confidence:n.confidence,tokensConsumed:n.tokensConsumed,errors:n.errors}}catch(e){return{success:!1,confidence:0,errors:[e instanceof Error?e.message:e+""]}}var r}buildCommandNode(e){const{command:t}=e;if(!t)throw Error("Cannot build command node without command data");if("repeat"===t.name)return this.buildRepeatCommandNode(t);if("for"===t.name)return this.buildRepeatCommandNode(t);if("set"===t.name)return this.buildSetCommandNode(t);if("if"===t.name||"unless"===t.name)return this.buildIfCommandNode(t);const r=this.analyzer.buildCommandNode?.(t);if(!r)throw Error(`Semantic analyzer cannot build an AST node for '${t.name}' (no buildCommandNode wired \u2014 see createSemanticAdapter's buildAST dep)`);return r}buildRepeatCommandNode(e){const t=[],r={},n=e.roles.get("loopType");n&&t.push({type:"identifier",name:n.value+"",start:0,end:0,line:1,column:0});const i=e.roles.get("patient");"for"==(n?n.value+"":"")&&i&&t.push({type:"identifier",name:"expression"===i.type&&i.raw||i.value+"",start:0,end:0,line:1,column:0});const a=e.roles.get("event");a&&t.push({type:"string",value:a.value+"",start:0,end:0,line:1,column:0});const s=e.roles.get("source");s&&t.push(this.semanticValueToExpression(s));const o=e.roles.get("quantity");o&&t.push(this.semanticValueToExpression(o));const l=e.roles.get("condition");return l&&(r.condition=this.semanticValueToExpression(l)),{type:"command",name:"repeat",args:t,modifiers:Object.keys(r).length>0?r:void 0,isBlocking:!1,start:0,end:0,line:1,column:0}}buildSetCommandNode(e){const t=[],r=e.roles.get("destination");if(r)if("property-path"===r.type){const e=r;t.push({type:"possessiveExpression",object:this.semanticValueToExpression(e.object),property:this.createPropertyNode(e.property),start:0,end:0,line:1,column:0})}else t.push(this.semanticValueToExpression(r));t.push({type:"identifier",name:"to",start:0,end:0,line:1,column:0});const n=e.roles.get("patient");return n&&t.push(this.semanticValueToExpression(n)),{type:"command",name:"set",args:t,isBlocking:!1,start:0,end:0,line:1,column:0}}createPropertyNode(e){return e.startsWith("*")?{type:"cssProperty",name:e.substring(1),start:0,end:0,line:1,column:0}:{type:"identifier",name:e,start:0,end:0,line:1,column:0}}buildIfCommandNode(e){const t=[],r=e.roles.get("condition");return r&&t.push(this.semanticValueToExpression(r)),{type:"command",name:e.name,args:t,isBlocking:!1,start:0,end:0,line:1,column:0}}semanticValueToExpression(e){switch(e.type){case"selector":return{type:"selector",value:e.value,start:0,end:0,line:1,column:0};case"reference":return{type:"identifier",name:e.value,start:0,end:0,line:1,column:0};case"literal":return"string"==typeof e.value&&e.value.includes("${")&&e.value.includes("}")?{type:"templateLiteral",value:e.value,start:0,end:0,line:1,column:0}:{type:"literal",value:e.value,raw:e.raw??e.value,start:0,end:0,line:1,column:0};case"property-path":{const t=e;return{type:"memberExpression",object:this.semanticValueToExpression(t.object),property:{type:"identifier",name:t.property,start:0,end:0,line:1,column:0},computed:!1,start:0,end:0,line:1,column:0}}default:return this.parseExpressionString(e.raw||"")}}parseExpressionString(e){let t=0;const r=()=>{for(;e.length>t&&/\s/.test(e[t]);)t++},n=()=>{r();const n=t;for(;e.length>t&&/[a-zA-Z0-9_$]/.test(e[t]);)t++;return e.slice(n,t)},i=()=>{const n=[];if(t++,r(),")"!==e[t])for(n.push(a()),r();","===e[t];)t++,r(),n.push(a()),r();return")"===e[t]&&t++,n},a=()=>{r();const a=n();if(!a)return{type:"identifier",name:e.trim(),start:0,end:0,line:1,column:0};let s={type:"identifier",name:a,start:0,end:0,line:1,column:0};for(;e.length>t;){r();const a=e[t];if("."===a){t++;const e=n();e&&(s={type:"memberExpression",object:s,property:{type:"identifier",name:e,start:0,end:0,line:1,column:0},computed:!1,start:0,end:0,line:1,column:0})}else{if("("!==a)break;s={type:"callExpression",callee:s,arguments:i(),start:0,end:0,line:1,column:0}}}return s};return a()}getLanguage(){return this.language}getConfidenceThreshold(){return this.confidenceThreshold}}ve.SKIP_SEMANTIC_COMMANDS=new Set(["swap","morph","js","tell"]);const be=new Set(["then","end","to","into","on","with","from","in","by","for","while","until","unless","else","catch","finally"]),we=new Set([")","]","}",","]);function ke(e,t){return{infix:{bp:[e,e+1],handler:t??((t,r,n)=>{const i=n.parseExpr(e+1);return{type:"binaryExpression",operator:r.value,left:t,right:i,start:t.start,end:i.end??r.end,line:t.line??r.line,column:t.column??r.column}})}}}function Ee(e,t){return{infix:{bp:[e+1,e],handler:(t,r,n)=>{const i=n.parseExpr(e);return{type:"binaryExpression",operator:r.value,left:t,right:i,start:t.start,end:i.end??r.end,line:t.line??r.line,column:t.column??r.column}}}}}function xe(e,t){return{prefix:{bp:e,handler:t??((t,r)=>{const n=r.parseExpr(e);return{type:"unaryExpression",operator:t.value,operand:n,argument:n,prefix:!0,start:t.start,end:n.end??t.end,line:t.line,column:t.column}})}}}function Ce(e){return(t,r,n)=>{const i=n.advance();if(!i||!i.value)throw Error(`Type check requires a type name after 'is ${e?"not ":""}a/an', got: <end>`);let a=!0;const s=n.peek();return s&&"!"===s.value&&(n.advance(),a=!1),{type:"typeCheckExpression",value:t,typeName:i.value,nullOk:a,negated:e,start:t.start,end:i.end}}}const Ae=function(...e){const t=new Map;for(const r of e)for(const[e,n]of r){const r=t.get(e);t.set(e,r?{prefix:n.prefix??r.prefix,infix:n.infix??r.infix}:{...n})}return t}(new Map([["or",ke(10)],["||",ke(10)],["and",ke(20)],["&&",ke(20)],["==",ke(30)],["!=",ke(30)],["<",ke(30)],[">",ke(30)],["<=",ke(30)],[">=",ke(30)],["is",ke(30)],["matches",ke(30)],["contains",ke(30)],["starts with",ke(30)],["ends with",ke(30)],["does not start with",ke(30)],["does not end with",ke(30)],["is between",ke(30,(e,t,r)=>{const n=r.parseExpr(31),i=r.peek();if(!i||"and"!==i.value.toLowerCase())throw Error("between requires 'and' between min and max operands, got: "+(i?.value??"<end>"));r.advance();const a=r.parseExpr(31);return{type:"betweenExpression",value:e,min:n,max:a,negated:!1,start:e.start,end:a.end}})],["is not between",ke(30,(e,t,r)=>{const n=r.parseExpr(31),i=r.peek();if(!i||"and"!==i.value.toLowerCase())throw Error("between requires 'and' between min and max operands, got: "+(i?.value??"<end>"));r.advance();const a=r.parseExpr(31);return{type:"betweenExpression",value:e,min:n,max:a,negated:!0,start:e.start,end:a.end}})],["am between",ke(30,(e,t,r)=>{const n=r.parseExpr(31),i=r.peek();if(!i||"and"!==i.value.toLowerCase())throw Error("between requires 'and' between min and max operands, got: "+(i?.value??"<end>"));r.advance();const a=r.parseExpr(31);return{type:"betweenExpression",value:e,min:n,max:a,negated:!1,start:e.start,end:a.end}})],["am not between",ke(30,(e,t,r)=>{const n=r.parseExpr(31),i=r.peek();if(!i||"and"!==i.value.toLowerCase())throw Error("between requires 'and' between min and max operands, got: "+(i?.value??"<end>"));r.advance();const a=r.parseExpr(31);return{type:"betweenExpression",value:e,min:n,max:a,negated:!0,start:e.start,end:a.end}})],["ignoring case",{infix:{bp:[25,26],handler:(e,t,r)=>(e.ignoringCase=!0,e)}}],["where",ke(28,(e,t,r)=>{const n=r.parseExpr(29);return{type:"collectionExpression",operator:"where",collection:e,right:n,start:e.start,end:n.end}})],["sorted by",ke(28,(e,t,r)=>{const n=r.parseExpr(29);let i="asc";const a=r.peek();if(a&&"string"==typeof a.value){const e=a.value.toLowerCase();"asc"===e||"ascending"===e?(r.advance(),i="asc"):"desc"!==e&&"descending"!==e||(r.advance(),i="desc")}return{type:"collectionExpression",operator:"sorted by",collection:e,right:n,order:i,start:e.start,end:n.end}})],["mapped to",ke(28,(e,t,r)=>{const n=r.parseExpr(29);return{type:"collectionExpression",operator:"mapped to",collection:e,right:n,start:e.start,end:n.end}})],["split by",ke(28,(e,t,r)=>{const n=r.parseExpr(29);return{type:"collectionExpression",operator:"split by",collection:e,right:n,start:e.start,end:n.end}})],["joined by",ke(28,(e,t,r)=>{const n=r.parseExpr(29);return{type:"collectionExpression",operator:"joined by",collection:e,right:n,start:e.start,end:n.end}})],["+",{...ke(40),...xe(80)}],["-",{...ke(40),...xe(80)}],["*",ke(50)],["/",ke(50)],["%",ke(50)],["mod",ke(50)],["^",Ee(60)],["**",Ee(60)],["as",ke(70,(e,t,r)=>{const n=()=>{const e=r.peek();!e||"a"!==e.value&&"an"!==e.value||r.advance();const t=r.parseExpr(71),n=r.peek();if(n&&":"===n.value&&t&&"identifier"===t.type){r.advance();const e=r.advance();e&&void 0!==e.value&&(t.name=`${t.name}:${e.value}`,t.end=e.end)}return t};let i=n(),a={type:"asExpression",expression:e,targetType:i,start:e.start,end:i.end??t.end,line:e.line??t.line,column:e.column??t.column};for(;r.peek()&&"|"===r.peek().value;){r.advance();const e=n();a={type:"asExpression",expression:a,targetType:e,start:a.start,end:e.end??a.end,line:a.line,column:a.column}}return a})],["not",xe(80)],["!",xe(80)],["no",xe(27)]]),new Map([["===",ke(30)],["!==",ke(30)],["is not",ke(30)],["am",ke(30)],["is in",ke(30)],["is not in",ke(30)],["precedes",ke(30)],["does not precede",ke(30)],["follows",ke(30)],["does not follow",ke(30)],["is a",ke(30,Ce(!1))],["is an",ke(30,Ce(!1))],["is not a",ke(30,Ce(!0))],["is not an",ke(30,Ce(!0))],["has",ke(30)],["have",ke(30)],["match",ke(30)],["include",ke(30)],["includes",ke(30)],["equals",ke(30)],["does not contain",ke(30)],["does not include",ke(30)],["am in",ke(30)],["am not in",ke(30)],["is really",ke(30)],["is not really",ke(30)],["is equal",ke(30)],["is not equal",ke(30)],["contain",ke(30)],["do not contain",ke(30)],["does not contains",ke(30)],["do not match",ke(30)],["does not match",ke(30)],["is equal to",ke(30)],["is not equal to",ke(30)],["is really equal to",ke(30)],["is not really equal to",ke(30)],["really equals",ke(30)],["is greater than",ke(30)],["is less than",ke(30)],["is greater than or equal to",ke(30)],["is less than or equal to",ke(30)],["in",ke(30)],["of",Ee(30)],["really",ke(30)],["exists",{prefix:{bp:80,handler:(e,t)=>({type:"unaryExpression",operator:e.value,operand:t.parseExpr(80),start:e.start})},infix:{bp:[30,31],handler:(e,t)=>({type:"unaryExpression",operator:t.value,operand:e,prefix:!1,start:e.start})}}],["does not exist",{infix:{bp:[30,31],handler:(e,t)=>({type:"unaryExpression",operator:t.value,operand:e,prefix:!1,start:e.start})}}],["is empty",{infix:{bp:[30,31],handler:(e,t)=>({type:"unaryExpression",operator:t.value,operand:e,prefix:!1,start:e.start})}}],["is not empty",{infix:{bp:[30,31],handler:(e,t)=>({type:"unaryExpression",operator:t.value,operand:e,prefix:!1,start:e.start})}}],["some",xe(80)]]),new Map([["=",Ee(5)]])),Se=new Map,Te=new Map,Le=new Map,Oe=new Set,je=new Set,Pe=new Set,Ie=new Set;function qe(e){return Se.get(e.toLowerCase())}function Ne(e){return Le.get(e)}function Re(e,t){if(0!==je.size)for(const r of je)try{r(e,t)}catch(e){void 0!==console&&console.error("[hyperfixi] globalReadHook threw:",e)}}function Me(e,t,r){if(0!==Pe.size)for(const n of Pe)try{n(e,t,r)}catch(e){void 0!==console&&console.error("[hyperfixi] localWriteHook threw:",e)}}function $e(e,t){if(0!==Ie.size)for(const r of Ie)try{r(e,t)}catch(e){void 0!==console&&console.error("[hyperfixi] localReadHook threw:",e)}}function _e(e,t,r){if(e.globals.set(t,r),0!==Oe.size)for(const n of Oe)try{n(t,r,e)}catch(e){void 0!==console&&console.error("[hyperfixi] globalWriteHook threw:",e)}}function ze(e){return e.kind===$.IDENTIFIER&&k.has(e.value.toLowerCase())}function Ve(e){return e.kind===$.IDENTIFIER&&M.has(e.value.toLowerCase())}function He(e){return e.kind===$.IDENTIFIER&&R.has(e.value.toLowerCase())}function Be(e){return e.kind===$.IDENTIFIER&&I.has(e.value.toLowerCase())}function We(e){return N.has(e.value.toLowerCase())}function De(e){return e.kind===$.IDENTIFIER}function Fe(e){return e.kind===$.SELECTOR}function Ue(e){return e.kind===$.SELECTOR&&!e.value.startsWith("<")}function Ke(e){return e.kind===$.STRING||e.kind===$.NUMBER||e.kind===$.TEMPLATE}function Ze(e){return e.kind===$.IDENTIFIER}function Xe(e){return e.kind===$.TIME}function Ge(e){return e.kind===$.SYMBOL}function Je(e){return e.kind===$.COMMENT}function Ye(e){if(e.kind!==$.IDENTIFIER)return!1;const t=e.value.toLowerCase();return!(k.has(t)||M.has(t)||R.has(t)||I.has(t))}function Qe(e){return e.kind===$.STRING}function et(e){return e.kind===$.NUMBER}function tt(e){if(e.kind===$.IDENTIFIER){const t=e.value;return"true"===t||"false"===t||"null"===t||"undefined"===t}return!1}function rt(e){return e.kind===$.TEMPLATE}function nt(e){return e.kind===$.SELECTOR&&e.value.startsWith("<")}function it(e){return e.kind===$.SELECTOR&&e.value.startsWith("#")}function at(e){return e.kind===$.SELECTOR&&e.value.startsWith(".")}function st(e){return e.kind===$.SELECTOR&&!e.value.startsWith("#")&&!e.value.startsWith(".")}function ot(e){if(e.kind!==$.OPERATOR)return!1;const t=e.value.toLowerCase();return!q.has(t)&&!N.has(t)}function lt(e){const t=e.value.toLowerCase();return"then"===t||"and"===t||"else"===t||"end"===t||"on"===t}function ct(e,t,r){return{type:"literal",value:e,raw:t,start:r.start,end:r.end,line:r.line,column:r.column}}function ut(e,t){return{type:"identifier",name:e,start:t.start,end:t.end,line:t.line,column:t.column}}function dt(e,t,r,n){return{type:"binaryExpression",operator:e,left:t,right:r,start:n.start,end:n.end,line:n.line,column:n.column}}function mt(e,t){return{type:"block",commands:e,start:t.start,end:t.end,line:t.line,column:t.column}}function pt(e,t){return{type:"string",value:e,start:t.start,end:t.end,line:t.line,column:t.column}}function ht(e,t){return{type:"objectLiteral",properties:e,start:t.start,end:t.end,line:t.line,column:t.column}}function ft(e,t){return{type:"arrayLiteral",elements:e,start:t.start,end:t.end,line:t.line,column:t.column}}function yt(e,t,r){return{type:"propertyOfExpression",property:e,target:t,start:r.start,end:r.end,line:r.line,column:r.column}}function gt(e,t,r){return{type:"command",name:"__ERROR__",args:[],diagnostics:[{message:t,severity:"error",code:"parse-error",line:e.line,column:e.column,...r&&{source:r}}],start:e.start,end:e.end,line:e.line,column:e.column}}const vt=[{command:"append",keywords:["to"],syntax:"append <value> [to <target>]"},{command:"prepend",keywords:["to"],syntax:"prepend <value> [to <target>]"},{command:"make",keywords:["a","an","from","called"],syntax:"make (a|an) <type> [from <args>] [called <name>]"},{command:"throw",keywords:[],syntax:"throw <error>"}];function bt(e,t){return!!e&&t.some(t=>e.value===t||e.value.toLowerCase()===t)}const wt=[e,n,t,r];function kt(e,t=[]){if(e.isAtEnd())return!0;for(const t of wt)if(e.check(t))return!0;for(const r of t)if(e.check(r))return!0;return!!e.checkIsCommand()}function Et(e,t=[]){if(!kt(e,t))return e.parseExpression()}function xt(e,t,r){return!!e.check(t)&&(e.advance(),r.push(e.createIdentifier(t)),!0)}function Ct(e,t,r){for(const n of t)if(e.check(n))return e.advance(),r.push(e.createIdentifier(n)),n;return null}function At(e,t){return!!e.check(t)&&(e.advance(),!0)}function St(e){const t=e.savePosition();let r;if(e.checkIdentifierLike()){const n=e.peek().value;e.advance(),e.check(":")?(e.advance(),r=n):e.restorePosition(t)}const n=e.parseExpression();return void 0!==r?{name:r,value:n}:{value:n}}class Tt{constructor(e){this.args=[],this.isBlocking=!1,this.name=e}static from(e){const t=new Tt(e.value);return t.startPos={start:e.start??0,end:e.end??0,line:e.line??1,column:e.column??1},t}static fromIdentifier(e){const t=new Tt(e.name);return void 0!==e.start&&(t.startPos={start:e.start,end:e.end??0,line:e.line??1,column:e.column??1}),t}static named(e){return new Tt(e)}withArgs(...e){return this.args.push(...e),this}withBody(e){return this.body=e,this}withImplicitTarget(e){return this.implicitTarget=e,this}withModifier(e,t){return this.modifiers||(this.modifiers={}),this.modifiers[e]=t,this}withModifiers(e){return this.modifiers={...this.modifiers,...e},this}withName(e){return this.name=e,this}withOriginalCommand(e){return this.originalCmd=e,this}blocking(e=!0){return this.isBlocking=e,this}startingAt(e){return this.startPos={start:e.start??0,end:e.end??0,line:e.line??1,column:e.column??1},this}endingAt(e){return this.endPos={start:e.start??this.startPos?.start??0,end:e.end,line:e.line??this.startPos?.line??1,column:e.column??this.startPos?.column??1},this}build(){const e={type:"command",name:this.name,args:this.args,isBlocking:this.isBlocking,start:this.startPos?.start??0,end:this.endPos?.end??this.startPos?.end??0,line:this.startPos?.line??1,column:this.startPos?.column??1};return this.body&&(e.body=this.body),this.implicitTarget&&(e.implicitTarget=this.implicitTarget),this.modifiers&&(e.modifiers=this.modifiers),this.originalCmd&&(e.originalCommand=this.originalCmd),e}clone(){const e=new Tt(this.name);return e.args=[...this.args],e.body=this.body?[...this.body]:void 0,e.implicitTarget=this.implicitTarget,e.isBlocking=this.isBlocking,e.modifiers=this.modifiers?{...this.modifiers}:void 0,e.originalCmd=this.originalCmd,e.startPos=this.startPos?{...this.startPos}:void 0,e.endPos=this.endPos?{...this.endPos}:void 0,e}}function Lt(e,t){const r=[];let n="";const i=e.peek().start||0,a=e.peek().line||1,s=e.peek().column||1;if(e.checkIdentifierLike()){for(n=e.advance().value;e.check(":")&&!e.isAtEnd();)e.advance(),n+=":",e.checkIdentifierLike()&&(n+=e.advance().value);if(e.check("(")){e.advance();const t=[];for(;!e.isAtEnd()&&!e.check(")");){const{name:r,value:n}=St(e);if(t.push(void 0!==r?{type:"objectLiteral",properties:[{key:{type:"identifier",name:r},value:n}],start:n.start,end:n.end,line:n.line,column:n.column}:n),e.check(","))e.advance();else if(!e.check(")"))break}e.check(")")&&e.advance(),r.push({type:"functionCall",name:n,args:t,start:i,end:e.getPosition().end,line:a,column:s})}else r.push({type:"string",value:n,start:i,end:e.getPosition().end,line:a,column:s})}const o=[...r];for(;!kt(e);){if(e.check("on")||e.check("to")){const t=e.advance().value;o.push(e.createIdentifier(t));continue}const t=e.savePosition(),r=e.parsePrimary();r&&o.push(r),e.savePosition()===t&&e.advance()}return Tt.fromIdentifier(t).withArgs(...o).endingAt(e.getPosition()).build()}function Ot(e,t){const r=[];if(e.check(b)){const t=e.advance();if(r.push({type:"identifier",name:b,start:t.start,end:t.end,line:t.line,column:t.column}),e.check(y)){const t=e.advance();r.push({type:"identifier",name:y,start:t.start,end:t.end,line:t.line,column:t.column})}}return Tt.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}function jt(i,a){const s=[],o=()=>i.check(r)||a&&i.check(t);for(;!i.isAtEnd()&&!o();){if(Je(i.peek())){i.advance();continue}if(!i.checkIsCommand()&&!i.isCommand(i.peek().value))break;i.advance();const t=i.parseCommand();t&&s.push(t),(i.check(e)||i.check(n)||i.check(","))&&i.advance()}return s}const Pt=new Set(["is","am","are","not","no","and","or","==","===","!=","!==","<",">","<=",">=","+","-","*","/","mod"]);function It(e,t,r){return null!==t&&!Pt.has(t.value?.toLowerCase?.()??"")&&(e.checkIsCommand()||e.isCommand(r.value?.toLowerCase()))}function qt(n,i){const a=[];let s=!1;const o=n.savePosition();let l=null;for(let t=0;500>t&&!n.isAtEnd();t++){const t=n.peek();if(t.value===e){s=!0;break}if(t.value===r||t.value===g||"def"===t.value||t.value===f)break;if(void 0!==t.line&&t.line!==i.line&&It(n,l,t))break;Je(t)||(l=t),n.advance()}n.restorePosition(o);let c=!1;if(!s){const e=n.savePosition(),a=i.line,s=100;let o=!1,l=null;for(;!n.isAtEnd()&&s>n.current-e;){const e=n.peek(),i=e.value?.toLowerCase();if(o&&void 0!==e.line&&e.line!==a)break;if(i===g||"def"===i||i===f)break;if(i===t||i===r){e.line===a&&(c=!0);break}if(It(n,l,e)){if(void 0!==e.line&&e.line!==a){c=!0;break}o=!0}Je(e)||(l=e),n.advance()}n.restorePosition(e)}const u=s||c;let d;if(u)d=n.parseExpression();else{const t=[],r=20;let a=0,s=!0;for(;!n.isAtEnd()&&!n.check(e)&&(s||!n.checkIsCommand()&&!n.isCommand(n.peek().value))&&r>a;){s=!1;const e=n.savePosition();t.push(n.parseLogicalAnd()),n.savePosition()===e&&n.advance(),a++}if(0===t.length)throw Error("Expected condition after if/unless");d=1===t.length?t[0]:{type:"expression",tokens:t,start:t[0].start,end:t[t.length-1].end,line:i.line,column:i.column}}if(a.push(d),u){At(n,e);const s=jt(n,!0);if(0===s.length&&n.isAtEnd())throw Error("Expected command after 'then' in if statement - incomplete conditional");a.push(mt(s,{start:i.start,end:n.getPosition().end,line:i.line,column:i.column}));let o=!1;if(n.check(t))if(n.advance(),n.check("if")){const e=n.peek();n.advance();const t=qt(n,e);a.push(mt([t],{start:e.start,end:n.getPosition().end,line:e.line,column:e.column})),o=!0}else{const e=jt(n,!1);a.push(mt(e,{start:i.start,end:n.getPosition().end,line:i.line,column:i.column}))}o||n.consume(r,"Expected 'end' after if block")}else{if(!n.checkIsCommand()&&!n.isCommand(n.peek().value))throw Error("Expected command after if condition in single-line form");{n.advance();const e=n.parseCommand();a.push(mt([e],{start:i.start,end:n.getPosition().end,line:i.line,column:i.column}))}}return Tt.from(i).withArgs(...a).endingAt(n.getPosition()).build()}function Nt(e,t){const r=[],n={};if(e.checkAnySelector()||e.checkContextVar()||e.match("<")){const t=e.parsePrimary();if(r.push(t),e.match("*")){if(e.checkIdentifierLike()){const t=e.advance();r.push({type:"identifier",name:"*"+t.value,start:t.start-1,end:t.end,line:t.line,column:t.column})}}else if(e.checkIdentifierLike()){const t=e.parsePrimary();r.push(t)}}else if(e.checkIdentifierLike()){const t=e.parsePrimary();r.push(t)}if(e.match("and")&&e.match("set")&&e.checkIdentifierLike()){const t=e.advance();n.set={type:"identifier",name:t.value,start:t.start,end:t.end,line:t.line,column:t.column}}const i=Tt.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition());return Object.keys(n).length>0&&i.withModifiers(n),i.build()}const Rt=new Set(["my","its","your"]);function Mt(e){const t={};if(At(e,i)){const r=e.parseExpression();return r&&(t.for=r),t}if(!e.check(s))return t;e.advance();const r=e.peek();if(!r||!De(r))return t;e.advance();let n=r.value;if(e.check(":")){e.advance();const t=e.peek();t&&De(t)&&(e.advance(),n=`${n}:${t.value}`)}if(t.until={type:"literal",value:n,raw:n},At(e,m)){const r=Et(e);r&&(t.from=r)}return t}function $t(e,t){const r=[],n=Et(e,[m]);n&&r.push(n),xt(e,m,r);const i=Et(e);return i&&r.push(i),Tt.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}function _t(e,t){const r=[];if(e.check("between")){e.advance(),r.push(e.createIdentifier("between"));const a=Et(e,[n]);if(a&&"binaryExpression"===a.type&&"and"===a.operator)a.left&&r.push(a.left),r.push(e.createIdentifier("and")),a.right&&r.push(a.right);else{a&&r.push(a),xt(e,n,r);const t=Et(e,[m,f,i]);t&&r.push(t)}if(Ct(e,[m,f],r)){const t=Et(e);t&&r.push(t)}return Tt.fromIdentifier(t).withArgs(...r).withModifiers(Mt(e)).endingAt(e.getPosition()).build()}const a=Et(e,[m,f]);if(a&&r.push(a),Ct(e,[m,f],r)){const t=Et(e);t&&r.push(t)}return e.check("modal")&&(e.advance(),r.push({type:"literal",value:"modal",raw:"modal"})),Tt.fromIdentifier(t).withArgs(...r).withModifiers(Mt(e)).endingAt(e.getPosition()).build()}function zt(e,t){if(!e.check("using"))return!1;if(e.advance(),!e.match("view"))throw Error("expected 'view transition' after 'using'");if(!e.match("transition"))throw Error("expected 'transition' after 'using view'");return t.push(e.createIdentifier("using")),t.push(e.createIdentifier("view")),t.push(e.createIdentifier("transition")),!0}function Vt(e,t){const n=e.parseExpression();if(!n)return e.addError("Put command requires content expression"),null;const i=e.peek();if(!i||!A.includes(i.value))return e.addError(`Expected operation keyword (${A.join(", ")}) after put expression, got: ${i?.value}`),null;let a=e.advance().value;const s=a.toLowerCase();"at start of"===s||"at the start of"===s?a=x:"at end of"===s||"at the end of"===s?a=C:"at"===a&&(e.check(w)||e.check(b)?(At(e,b),e.check(w)&&(e.advance(),e.check(h)&&(e.advance(),a=x))):e.check(r)&&(e.advance(),e.check(h)&&(e.advance(),a=C)));const o=e.parseExpression();return o?Tt.fromIdentifier(t).withArgs(n,e.createIdentifier(a),o).endingAt(e.getPosition()).build():(e.addError("Put command requires target expression after operation keyword"),null)}const Ht=["innerhtml","outerhtml","into","over","delete","morph","morphouter"];function Bt(i,a){const s=i.savePosition();let o=null,l=[];try{o=function(e){if(!e.check(":"))return null;if(e.advance(),e.check(":")){e.advance();const t=e.advance();return{type:"identifier",name:t.value,scope:"global",start:t.start-2,end:t.end}}const t=e.advance();return{type:"identifier",name:t.value,scope:"element",start:t.start-1,end:t.end}}(i)??function(e){if(!e.check(v)&&!e.check("local"))return null;const t=e.advance(),r=e.advance();return{type:"identifier",name:r.value,scope:t.value,start:t.start,end:r.end}}(i)??function(e){if(!e.check(b))return null;const t=e.savePosition();e.advance();const r=e.parseExpression();if(!r)return e.restorePosition(t),null;if("binaryExpression"===r.type&&r.operator===h){const e=r.left,t=r.right;return yt(e,t,{start:e.start??0,end:t.end??0,line:e.line??1,column:e.column??1})}return e.check(d)?r:(e.restorePosition(t),null)}(i),o||(o=i.parseExpression())}catch{i.restorePosition(s),o=null}if(!o){const a=function(i){if(i.match(":")){const e=i.advance();return{expression:{type:"identifier",name:e.value,scope:"element",start:e.start,end:e.end},tokens:[]}}const a=[];for(;!(i.isAtEnd()||i.check(d)||i.check(e)||i.check(n)||i.check(t)||i.check(r));)a.push(i.parsePrimary());if(0===a.length)return{expression:null,tokens:[]};if(a.length>=4){const e=(e,t)=>e[t];if(e(a[0],"value")===b&&e(a[2],"value")===h){const t=a[1],r=a[3];return{expression:yt(ut(e(t,"value")||e(t,"name")||"",{start:t.start??0,end:t.end??0,line:t.line??1,column:t.column??1}),{type:"idSelector"===r.type?"idSelector":"cssSelector",value:e(r,"value")||e(r,"name")||"",start:r.start??0,end:r.end??0,line:r.line,column:r.column},{start:a[0].start??0,end:r.end??0,line:a[0].line??1,column:a[0].column??1}),tokens:[]}}}return 1===a.length?{expression:a[0],tokens:[]}:{expression:null,tokens:a}}(i);o=a.expression,l=a.tokens}if(!i.check(d)){const e=i.isAtEnd()?"end of input":i.peek().value;throw Error("Expected 'to' in set command, found: "+e)}i.advance();const c=i.parseExpression()??i.parsePrimary();let u;var m;i.check(f)&&(m=i.peekAt(1))&&("selector"===m.kind||m.value.startsWith("<")||Wt.has(m.value))&&(i.advance(),u=Et(i));const p=[];o?p.push(o):l.length>0&&p.push(...l),p.push(i.createIdentifier(d)),c&&p.push(c);const y=Tt.fromIdentifier(a).withArgs(...p);return u&&y.withModifier("on",u),y.endingAt(i.getPosition()).build()}const Wt=new Set(["me","my","it","its","you","your","yourself"]),Dt=new Set(["to","the","url","of","in","new","window","top","middle","bottom","left","center","right","smoothly","instantly","back","forward"]);function Ft(e,t){return{type:"string",value:e,start:t.start,end:t.end,line:t.line,column:t.column}}function Ut(e,t){const r=[];for(;!kt(e,["catch","finally"])&&(e.checkIdentifierLike()||e.checkSelector()||e.checkLiteral()||e.checkTimeExpression()||e.match("<"));)r.push(e.parsePrimary());return Tt.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}function Kt(e){const t=e.peek();if("/"===t.value)return!0;if(e.checkIdentifierLike()){const r=e.peekAt(1);return!!r&&":"===r.value&&r.start===t.end}return!1}const Zt=new Set(["{",")"]);function Xt(e){const t=e.savePosition(),r=e.peek();let n="",i=null;for(;!e.isAtEnd();){const t=e.peek();if(i&&t.start!==i.end)break;if("$"===t.value&&"{"===e.peekAt(1)?.value){e.advance();let r=e.advance(),a=1;for(;!e.isAtEnd()&&a>0;)r=e.advance(),"{"===r.value?a++:"}"===r.value&&a--;n+=e.getInputSlice(t.start,r.end),i=r;continue}if(Zt.has(t.value))break;i=e.advance(),n+=i.value}if(!n||"/"===n)return e.restorePosition(t),null;const a={start:r.start,end:i?i.end:r.end,line:r.line,column:r.column};return n.includes("${")?{type:"templateLiteral",value:n,...a}:{type:"literal",value:n,raw:n,...a}}function Gt(e){if(e.check("{"))return!1;if(!e.checkIdentifierLike())return!1;const t=e.peekAt(1);return null!==t&&":"===t.value}function Jt(e){const t=[],r=e.getPosition();do{if(!e.checkIdentifierLike())break;const r=e.advance(),n={type:"identifier",name:r.value,start:r.start,end:r.end,line:r.line,column:r.column};e.consume(":","Expected ':' after property name in fetch named arguments");const i=e.parsePrimary();i&&t.push({key:n,value:i})}while(e.match(",")&&!e.isAtEnd());const n=e.getPosition();return{type:"objectLiteral",properties:t,start:r.start,end:n.end,line:r.line,column:r.column}}const Yt=new Set(["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","pc","pt","px"]);class Qt{constructor(e,t,r){this.current=0,this.errors=[],this.warnings=[],this.prattCache=new Map,this.tokens=e,this.keywordResolver=t?.keywords,this.registryIntegration=t?.registryIntegration,t?.semanticAnalyzer&&t?.language&&(this.semanticAdapter=new ve({analyzer:t.semanticAnalyzer,language:t.language,confidenceThreshold:t.semanticConfidenceThreshold??.5})),this.originalInput=r||e.map(e=>e.value).join(" ")}resolveKeyword(e){return this.keywordResolver?this.keywordResolver.resolve(e)??e:e}addWarning(e){this.warnings.push(e)}parse(){this.prattCache.clear();const e=this.parseInternal();return this.errors.length>0&&(e.errors=[...this.errors],e.recovered=!0),e}parseInternal(){try{if(0===this.tokens.length)return this.addError("Cannot parse empty input"),{success:!1,node:this.createErrorNode(),tokens:this.tokens,error:this.error,warnings:this.warnings};if(this.check("behavior")){const e=[];for(;this.check("behavior");){this.advance();const t=this.parseBehaviorDefinition();if(t&&e.push(t),this.error)break}return this.error?{success:!1,node:1===e.length?e[0]:this.createProgramNode(e),tokens:this.tokens,error:this.error,warnings:this.warnings}:{success:!0,node:1===e.length?e[0]:this.createProgramNode(e),tokens:this.tokens,warnings:this.warnings}}const e=this.peek(),t=e&&qe(e.value)?e.value:null;if(this.check("init")||this.check("on")||this.check("def")||this.checkComment()||null!==t){const e=[];for(;!this.isAtEnd();)if(this.checkComment())this.advance();else{if(this.check("then")){const e=this.peekAt(1);if(null!==e&&("init"===e.value||"on"===e.value||"def"===e.value||void 0!==qe(e.value))){this.advance();continue}}if(this.check("init")){this.advance();const t=this.parseTopLevelInitBlock();t&&e.push(t)}else if(this.check("on")){this.advance();const t=this.parseEventHandler();t&&e.push(t)}else{if(!this.check("def")){const t=this.peek(),r=t?qe(t.value):void 0;if(r){const t=this.advance(),n=r(this.getContext(),t);n&&e.push(n);continue}break}{this.advance();const t=this.parseDefFeature();t&&e.push(t)}}}return this.isAtEnd()?this.error?{success:!1,node:this.createProgramNode(e),tokens:this.tokens,error:this.error,warnings:this.warnings}:{success:!0,node:this.createProgramNode(e),tokens:this.tokens,warnings:this.warnings}:(this.addError("Unexpected token: "+this.peek().value),{success:!1,node:this.createProgramNode(e),tokens:this.tokens,error:this.error,warnings:this.warnings})}if(this.checkIsCommand()||this.isCommand(this.peek().value)&&!this.isKeyword(this.peek().value)){const e=this.parseCommandSequence();if(e){if(!this.isAtEnd()&&this.check("on")){pe("\u2705 PARSER: Found event handlers after command sequence, parsing as program");const t=[e];pe(`\u2705 PARSER: Starting with ${t.length} statement(s) from command sequence`);let r=0;for(;!this.isAtEnd()&&this.check("on");){pe(`\u2705 PARSER: Parsing event handler #${r+1}, current token: ${this.peek().value}`),this.advance();const e=this.parseEventHandler();if(pe("\u2705 PARSER: parseEventHandler returned:",e?`type=${e.type}, event=${e.event}`:"null"),e&&(t.push(e),r++,pe(`\u2705 PARSER: Added event handler, now have ${t.length} statements total`)),pe(`\u2705 PARSER: After parsing event handler, current token: ${this.isAtEnd()?"END":this.peek().value}, isAtEnd=${this.isAtEnd()}, check('on')=${this.check("on")}`),!this.isAtEnd()&&!this.check("on")){if(!this.isAtEnd())return pe("\u26a0\ufe0f PARSER: Unexpected token after event handlers: "+this.peek().value),this.addError("Unexpected token after event handlers: "+this.peek().value),{success:!1,node:this.createProgramNode(t),tokens:this.tokens,error:this.error};pe("\u2705 PARSER: No more event handlers, at end of input");break}}return pe(`\u2705 PARSER: Finished parsing, creating Program node with ${t.length} statements`),this.error?{success:!1,node:this.createProgramNode(t),tokens:this.tokens,error:this.error,warnings:this.warnings}:{success:!0,node:this.createProgramNode(t),tokens:this.tokens,warnings:this.warnings}}return this.isAtEnd()?this.error?{success:!1,node:e,tokens:this.tokens,error:this.error,warnings:this.warnings}:{success:!0,node:e,tokens:this.tokens,warnings:this.warnings}:(this.addError("Unexpected token: "+this.peek().value),{success:!1,node:e||this.createErrorNode(),tokens:this.tokens,error:this.error})}}const r=this.parseExpression();if(this.error)return{success:!1,node:r||this.createErrorNode(),tokens:this.tokens,error:this.error};if(!this.isAtEnd()){const e=this.peek();return r&&["number","string","identifier"].includes(e.kind)?this.addError(`Unexpected token: ${e.value} (missing operator between values? expected one of +, -, *, /, etc.)`):this.addError("Unexpected token: "+e.value),{success:!1,node:r||this.createErrorNode(),tokens:this.tokens,error:this.error,warnings:this.warnings}}return{success:!0,node:r,tokens:this.tokens,warnings:this.warnings}}catch(e){return this.addError(e instanceof Error?e.message:"Unknown parsing error"),{success:!1,node:this.createErrorNode(),tokens:this.tokens,error:this.error,warnings:this.warnings}}}parseExpression(){return this.parseExpressionPratt(0)}parseExpressionPratt(e){const t=`${this.current}:${e}`,r=this.prattCache.get(t);if(r)return this.current=r.endPos,r.node;if(this.isAtEnd())return this.addError("Unexpected end of expression"),this.createErrorNode();const n=this.peek(),i=Qt.PRATT_TABLE.get(n.value);let a;if(i?.prefix){const e=this.advance();if(this.isAtEnd())return this.addError(`Expected expression after '${e.value}' operator`),this.createErrorNode();a=i.prefix.handler(e,this.makePrattContext())}else a=this.parseCall();for(;!this.isAtEnd();){const t=this.peek();if(60>=e){const e=this.tryParseStringPostfix(a,t);if(e){a=e;continue}}const r=Qt.PRATT_TABLE.get(t.value);if(!r?.infix){if(be.has(t.value)||we.has(t.value))break;break}const[n]=r.infix.bp;if(e>n)break;if("="===t.value&&this.tokens.length>this.current+1&&">"===this.tokens[this.current+1].value){if(this.advance(),this.advance(),this.addError('Arrow functions (=>) are not supported in hyperscript. Use "js ... end" blocks for JavaScript callbacks.'),!this.isAtEnd())try{this.parseExpressionPratt(0)}catch(e){pe("arrow body discarded after error:",e instanceof Error?e.message:e+"")}return this.createErrorNode()}if("+"===t.value||"-"===t.value){const e=this.tokens.length>this.current+1?this.tokens[this.current+1]:null;if(e&&("+"===e.value||"-"===e.value))return this.addError(`Invalid operator combination: ${t.value}${e.value}`),a}if("*"===t.value||"/"===t.value||"%"===t.value){const e=this.tokens.length>this.current+1?this.tokens[this.current+1]:null;if(e&&("*"===e.value||"/"===e.value||"%"===e.value||"+"===e.value||"-"===e.value))return this.addError("*"===t.value&&"*"===e.value?"Unexpected token: "+e.value:`Invalid operator combination: ${t.value}${e.value}`),a}const i=this.advance();if(this.isAtEnd()&&!Qt.POSTFIX_UNARY_OPERATORS.has(i.value))return this.addError(`Expected expression after '${i.value}' operator`),a;a=r.infix.handler(a,i,this.makePrattContext())}return this.prattCache.set(t,{node:a,endPos:this.current}),a}tryParseStringPostfix(e,t){const r=t.value;let n=null;if(Yt.has(r)?n=r:"%"===r&&(this.canStartOperand(this.tokens.length>this.current+1?this.tokens[this.current+1]:null)||(n="%")),null==n)return null;const i=this.advance();return{type:"stringPostfix",expression:e,unit:n,start:e.start,end:i.end,line:e.line,column:e.column}}canStartOperand(e){if(!e)return!1;const t=e.value;return!be.has(t)&&!we.has(t)&&("number"===e.kind||"string"===e.kind||"identifier"===e.kind||"symbol"===e.kind||["(","[","{","-","+","!","#",".","<","$","@"].includes(t))}makePrattContext(){const e=this;return{peek:()=>e.tokens.length>e.current?e.tokens[e.current]:void 0,advance:()=>{const t=e.tokens[e.current];return e.current++,t},parseExpr:t=>e.parseExpressionPratt(t),isStopToken:()=>{const t=e.tokens[e.current];return!t||be.has(t.value)||we.has(t.value)},atEnd:()=>e.current>=e.tokens.length}}parseLogicalAnd(){return this.parseExpressionPratt(11)}parseImplicitBinary(){let e=this.parseCall();for(;!(this.isAtEnd()||this.checkBasicOperator()||this.check("then")||this.check("and")||this.check("else")||this.check(")")||this.check("]")||this.check(","));){if("identifier"!==e.type){if("literal"===e.type&&(this.checkNumber()||this.checkIdentifier())){const t=this.peek();return this.addError(`Missing operator between '${e.raw||e.value}' and '${t.value}'`),e}break}if(this.isCommand(e.name))if(this.isCompoundCommand(e.name.toLowerCase())){if(!(this.checkCssSelector()||this.checkIdSelector()||this.checkClassSelector()||this.checkTimeExpression()||this.checkString()||this.checkNumber()||this.checkContextVar()||this.checkIdentifier()||this.checkKeyword()))break;{const t=this.createCommandFromIdentifier(e);t&&(e=t)}}else if("wait"===e.name.toLowerCase()&&(this.checkTimeExpression()||this.checkNumber()||this.checkIdentifier()||this.checkContextVar()||this.check("("))){const t=this.createCommandFromIdentifier(e);t&&(e=t)}else{if(!this.checkSelector())break;{const t=this.parseCall();e=this.createBinaryExpression(" ",e,t)}}else{if(!this.checkSelector())break;{const t=this.parseCall();e=this.createBinaryExpression(" ",e,t)}}}return e}isCommand(e){return this.keywordResolver?this.keywordResolver.isCommand(e):T(e)}isKeyword(e){return this.keywordResolver?this.keywordResolver.isKeyword(e):O(e)}createCommandFromIdentifier(e){const t=[],r=this.resolveKeyword(e.name.toLowerCase());if(this.isCompoundCommand(r))return this.parseCompoundCommand(e);for(;!(this.isAtEnd()||this.check("then")||this.check("and")||this.check("else")||this.checkIsCommand())&&(this.checkContextVar()||this.checkIdentifier()||this.checkKeyword()||this.checkEvent()||this.checkCssSelector()||this.checkIdSelector()||this.checkClassSelector()||this.checkString()||this.checkNumber()||this.checkTimeExpression()||this.match("<"));)t.push(this.parsePrimary());return{type:"command",name:e.name,args:t,isBlocking:!1,...void 0!==e.start&&{start:e.start},end:this.getPosition().end,...void 0!==e.line&&{line:e.line},...void 0!==e.column&&{column:e.column}}}isCompoundCommand(e){return L(e)}parseCompoundCommand(a){return function(a,s){switch(s.name.toLowerCase()){case"put":return Vt(a,s);case"trigger":case"send":return Lt(a,s);case"remove":return $t(a,s);case"take":return function(e,t){const r=[],n={},a=Et(e,[m,i]);if(a&&r.push(a),e.check(m)){xt(e,m,r);const t=Et(e,[i]);t&&r.push(t)}if(At(e,i)){const t=Et(e);t&&(n.for=t)}return Tt.fromIdentifier(t).withArgs(...r).withModifiers(n).endingAt(e.getPosition()).build()}(a,s);case"toggle":return _t(a,s);case"set":return Bt(a,s);case"halt":return Ot(a,s);case"measure":return Nt(a,s);case"js":return function(e,t){const n=[];if(e.match("(")){for(;!e.check(")")&&!e.isAtEnd();)e.checkIdentifierLike()&&n.push(e.advance().value),e.match(",");e.consume(")","Expected ) after js parameters")}const i=e.peek().start,a=function(e,t){const r=e.getInputSlice(t);if(!r)return t;let n=0;for(;r.length>n;){const e=r[n];if("'"!==e&&"\u2019"!==e&&"\u2018"!==e)if('"'!==e)if("`"!==e)if("/"===e&&r.length>n+1&&"/"===r[n+1])for(n+=2;r.length>n&&"\n"!==r[n];)n++;else if("/"===e&&r.length>n+1&&"*"===r[n+1]){for(n+=2;r.length>n&&("*"!==r[n]||n+1>=r.length||"/"!==r[n+1]);)n++;n+=2}else{if(!("e"!==e&&"E"!==e||n+3>r.length||"end"!==r.slice(n,n+3).toLowerCase()||0!==n&&/[a-zA-Z0-9_]/.test(r[n-1])||r.length>n+3&&/[a-zA-Z0-9_]/.test(r[n+3])))return t+n;n++}else{for(n++;r.length>n&&"`"!==r[n];)"\\"===r[n]&&n++,n++;n++}else{for(n++;r.length>n&&'"'!==r[n];)"\\"===r[n]&&n++,n++;n++}else{for(n++;r.length>n&&r[n]!==e;)"\\"===r[n]&&n++,n++;n++}}return t+r.length}(e,i);for(;!e.isAtEnd()&&!e.check(r)&&e.peek().start<a;)e.advance();e.consume(r,"Expected end after js code body");const s={type:"literal",value:e.getInputSlice(i,a).trim(),start:t.start,end:e.getPosition().end},o={type:"arrayLiteral",elements:n.map(e=>({type:"literal",value:e,start:t.start,end:t.end})),start:t.start,end:e.getPosition().end};return Tt.fromIdentifier(t).withArgs(s,o).endingAt(e.getPosition()).build()}(a,s);case"go":return function(e,t){const r=[];for(;!kt(e,["when","where","catch","finally"]);){const t=e.peek(),n=e.resolveKeyword(t.value).toLowerCase();if(Dt.has(n)){e.advance(),r.push(Ft(n,t));continue}if(Kt(e)){const n=Xt(e);if(n){r.push(n);continue}e.advance(),r.push(Ft(t.value,t));continue}if("+"===t.value||"-"===t.value){e.advance(),r.push(Ft(t.value,t));continue}if("number"===t.kind){e.advance();const n=e.peek();if(e.isAtEnd()||"px"!==n.value||n.start!==t.end)r.push({type:"literal",value:Number(t.value),raw:t.value,start:t.start,end:t.end,line:t.line,column:t.column});else{const n=e.advance();r.push(Ft(t.value+"px",{...t,end:n.end}))}continue}const i=e.current;if(r.push(e.parsePrimary()),e.current===i)break}return Tt.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}(a,s);case"tell":return function(i,a){const s=i.parseExpression();if(!s)throw Error("tell command requires a target expression");i.check(d)&&i.advance();const o=[];for(;!i.isAtEnd();){if(i.checkIsCommand()){try{i.advance();const e=i.parseCommand();if(!e)break;o.push(e)}catch{break}if(i.match(n)||i.match(e))continue;if(i.check(t))break;if(i.check(r)){i.advance();break}if(i.checkIsCommand())continue;break}break}if(0===o.length)throw Error("tell command requires at least one command after the target");return Tt.fromIdentifier(a).withArgs(s,...o).endingAt(i.getPosition()).build()}(a,s);case"pick":return function(e,t){const r=Tt.fromIdentifier(t);At(e,b);const n=e.peek().value,i=e=>({type:"literal",value:e,start:t.start,end:t.end}),a=()=>{if(!e.match("of","from"))throw Error("pick: expected 'of' or 'from' before source expression");return e.parseExpression()};if("first"===n){e.advance();const t=e.parsePrimary(),n=a();return r.withArgs(n).withModifier("variant",i("first")).withModifier("count",t).endingAt(e.getPosition()).build()}if("last"===n){e.advance();const t=e.parsePrimary(),n=a();return r.withArgs(n).withModifier("variant",i("last")).withModifier("count",t).endingAt(e.getPosition()).build()}if("random"===n){let t;e.advance(),e.check("of")||e.check("from")||(t=e.parsePrimary());const n=a(),s=r.withArgs(n).withModifier("variant",i("random"));return t&&s.withModifier("count",t),s.endingAt(e.getPosition()).build()}if("item"===n||"items"===n||"character"===n||"characters"===n){let t,n;e.advance(),e.match("at","from"),t=e.match("start")?i("start"):e.parsePrimary();let s=!1;(e.match("to")||e.match(".."))&&(e.match("end")?s=!0:n=e.parsePrimary());let o="default";e.match("inclusive")?o="inclusive":e.match("exclusive")&&(o="exclusive");const l=a(),c=r.withArgs(l).withModifier("variant",i("range")).withModifier("rangeStart",t).withModifier("rangeMode",i(o));return s?c.withModifier("rangeEnd",i("end")):n&&c.withModifier("rangeEnd",n),c.endingAt(e.getPosition()).build()}if("match"===n||"matches"===n){e.advance(),e.match("of");const t=e.parsePrimary();let s;e.matchOperator("|")&&(s=e.advance().value);const o=a(),l=r.withArgs(o).withModifier("variant",i("match"===n?"match":"matches")).withModifier("regex",t);return s&&l.withModifier("flags",i(s)),l.endingAt(e.getPosition()).build()}return Ut(e,t)}(a,s);case"start":return function(e,t){if(!e.match("view"))throw Error("start: expected 'view transition' (only `start view transition ... end` is supported)");if(!e.match("transition"))throw Error("start view: expected 'transition'");const r={};if(e.match("using")){const t=e.parsePrimary();r.transitionName=t}const n=e.parseCommandListUntilEnd("start view transition");return Tt.fromIdentifier(t).withArgs(...n).withModifiers(r).endingAt(e.getPosition()).build()}(a,s);case"swap":case"morph":return function(e,t){const r=[];let n=null;if(!e.isAtEnd()){const t=e.peek();if(t&&t.value){const i=t.value.toLowerCase();Ht.includes(i)&&(n=i,e.advance(),r.push(e.createIdentifier(n)))}}if("delete"===n){const n=e.parseExpression();return n&&r.push(n),Tt.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}!e.isAtEnd()&&e.check(h)&&(e.advance(),r.push(e.createIdentifier("of")));const i=e.parseExpression();if(i&&r.push(i),!e.isAtEnd()&&e.check(p)){e.advance(),r.push(e.createIdentifier("with"));const t=e.parseExpression();t&&r.push(t)}return zt(e,r),Tt.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}(a,s);case"process":return function(e,t){if(!e.check("partials"))return null;const r=[];if(xt(e,"partials",r),xt(e,u,r)){const t=Et(e,["using"]);t&&r.push(t)}return zt(e,r),Tt.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}(a,s)??Ut(a,s);default:return Ut(a,s)}}(this.getContext(),a)}parsePutCommand(e){return Vt(this.getContext(),e)}parseSetCommand(e){return Bt(this.getContext(),e)}parseHaltCommand(e){return Ot(this.getContext(),e)}parseMeasureCommand(e){return Nt(this.getContext(),e)}parseTriggerCommand(e){return Lt(this.getContext(),e)}parseCommandListUntilTerminator(e){const t=[],r=()=>this.check("end")||e.some(e=>this.check(e));for(pe("\ud83d\udd04 parseCommandListUntilTerminator: Starting (extraStops:",e.join(","),")");!this.isAtEnd()&&!r();){pe("\ud83d\udccd Loop iteration, current token:",this.peek().value,"kind:",this.peek().kind);let e=!1;const n=this.checkIsCommand(),i=!n&&this.checkIdentifier()&&this.isCommand(this.peek().value);if(n||i){pe(n?"\u2705 Found COMMAND token:":"\u2705 Found IDENTIFIER that is a command:",this.peek().value),this.advance();const r=this.error;try{const n=this.parseCommand();this.error&&this.error!==r&&(pe("\u26a0\ufe0f parseCommandListUntilTerminator: Command parsing added error, restoring. Error was:",this.error.message),this.error=r),n&&(pe("\u2705 Parsed command:",n.name),t.push(n),e=!0)}catch(e){pe("\u26a0\ufe0f parseCommandListUntilTerminator: Command parsing threw, restoring:",e instanceof Error?e.message:e+""),this.error=r}}else this.checkIdentifier()&&pe("\u274c IDENTIFIER is not a command:",this.peek().value);if(!e){pe("\u274c No command parsed, breaking. Current token:",this.peek().value);break}for(pe("\ud83d\udccd After parsing command, current token:",this.peek().value);!(this.isAtEnd()||r()||this.checkIsCommand()||this.isCommand(this.peek().value)||this.check("then")||this.check("and")||this.check(","));)pe("\u26a0\ufe0f Skipping unexpected token:",this.peek().value),this.advance();if(this.match("then","and",","))pe("\u2705 Found separator, continuing");else{if(!this.checkIsCommand()&&!this.isCommand(this.peek().value)){pe("\ud83d\udccd No separator and no command, breaking. Current token:",this.peek().value);break}pe("\u2705 Next token is a command, continuing without separator")}}let n="end";for(const t of e)if(this.check(t)){n=t;break}return this.check("end")||e.some(e=>this.check(e))||(n=""),pe("\u2705 parseCommandListUntilTerminator: parsed",t.length,"commands (terminator:",n,")"),{commands:t,terminator:n}}parseCommandListUntilEnd(e="repeat"){const{commands:t}=this.parseCommandListUntilTerminator([]);if(pe('\ud83d\udd0d After loop, checking for "end". Current token:',this.peek().value),!this.check("end"))throw pe('\u274c ERROR: Expected "end" but got:',this.peek().value,"at position:",this.peek().start),Error(`Expected "end" to close ${e} block`);return pe('\u2705 Found "end", consuming it'),this.advance(),t}parseCommandListUntilEndOrElse(){const{commands:e,terminator:t}=this.parseCommandListUntilTerminator(["else"]),r="else"===t;if(!r){if(!this.check("end"))throw Error('Expected "end" to close repeat block');this.advance()}return{commands:e,hasElse:r}}parseRepeatBody(){const{commands:e,terminator:t}=this.parseCommandListUntilTerminator(["else","until","while"]);if("end"===t)this.advance();else if(""===t)throw Error('Expected "end", "else", "until", or "while" to close repeat block');return{commands:e,terminator:t}}parseRepeatCommand(e){return function(e,t){const r=[];let n="forever",d=null,h=null,f=null,g=null,v=null,w=null;if(e.check(i)){e.advance(),n=i;const t=e.peek();De(t)&&(v=t.value,e.advance()),e.check(u)&&(e.advance(),g=e.parseExpression())}else if(e.check(u))e.advance(),n=i,v="it",g=e.parseExpression();else if(e.check(a))e.advance(),n=a,f=e.parseExpression();else if(e.check(s))if(e.advance(),n=s,e.check(y)){e.advance(),n="until-event";const t=e.peek();if(pe("\ud83d\udccd Parsing event name, current token:",{value:t.value,kind:t.kind}),!De(t)&&!He(t))throw Error('Expected event name after "event"');if(d=t.value,e.advance(),pe("\u2705 Got event name:",d,"Next token:",e.peek().value),pe('\ud83d\udd0d Checking for "from", current token:',e.peek().value),e.check(m)){pe('\u2705 Found "from", advancing...'),e.advance(),pe('\ud83d\udccd After consuming "from", current token:',e.peek().value),At(e,b)&&pe('\u2705 Found "the", advancing...');const t=e.peek();pe("\ud83d\udd0d Before parsePrimary for event target:",{value:t.value,kind:t.kind,position:t.start}),h=e.parsePrimary(),pe("\u2705 After parsePrimary, eventTarget:",h)}else pe('\u274c No "from" found, skipping target parsing')}else f=e.parseExpression();else e.check(o)?(e.advance(),n=o):(w=e.parseExpression(),e.check(l)&&(e.advance(),n=l));let k,E=null;if(e.check(p)){const t=e.peekAt(1);t&&t.value.toLowerCase()===c&&(e.advance(),e.advance(),E=c)}else if(e.check(c)){e.advance();const t=e.peek();De(t)?(E=t.value,e.advance()):E=c}let x=null,C=!1;if(n===o){const t=e.parseRepeatBody();if(k=t.commands,"else"===t.terminator)e.advance(),x=e.parseCommandListUntilEnd();else if("until"===t.terminator||"while"===t.terminator){if(C=!0,n=t.terminator,e.advance(),f=e.parseExpression(),!e.check("end"))throw Error('Expected "end" to close repeat block');e.advance()}}else{const t=e.parseCommandListUntilEndOrElse();k=t.commands,t.hasElse&&(e.advance(),x=e.parseCommandListUntilEnd())}r.push({type:"identifier",name:n,start:t.start,end:t.end,line:t.line,column:t.column});const A={start:t.start,end:t.end,line:t.line,column:t.column};v&&r.push(pt(v,A)),g&&r.push(g),f&&r.push(f),w&&r.push(w),d&&r.push(pt(d,A)),h&&r.push(h),E&&r.push(pt(E,A)),r.push(mt(k,{...A,end:A.end||0})),null!==x&&r.push(mt(x,{...A,end:A.end||0}));const S=Tt.from(t).withArgs(...r);return C&&S.withModifier("bottomTested",{type:"literal",value:!0,...A}),S.endingAt(e.getPosition()).build()}(this.getContext(),e)}parseForCommand(e){return function(e,t){const r=[];let n=null,i=null;e.check("each")&&e.advance();const a=e.peek();if(!De(a))throw Error('Expected variable name after "for"');if(n=a.value,e.advance(),!e.check(u))throw Error('Expected "in" after variable name in for loop');if(e.advance(),i=e.parseExpression(),!i)throw Error('Expected collection expression after "in"');let s=null;if(e.check(p)){const t=e.peekAt(1);t&&t.value.toLowerCase()===c&&(e.advance(),e.advance(),s=c)}else if(e.check(c)){e.advance();const t=e.peek();De(t)?(s=t.value,e.advance()):s=c}const o=e.parseCommandListUntilEnd("for");r.push({type:"identifier",name:"for",start:t.start,end:t.end,line:t.line,column:t.column});const l={start:t.start,end:t.end,line:t.line,column:t.column};return r.push(pt(n,l)),r.push(i),s&&r.push(pt(s,l)),r.push(mt(o,{...l,end:l.end||0})),Tt.from({...t,value:"repeat"}).withArgs(...r).endingAt(e.getPosition()).build()}(this.getContext(),e)}parseWaitCommand(e){return function(e,t){const r=[];if(e.checkTimeExpression()||e.checkLiteral()||e.checkContextVar()||e.check("(")||e.checkIdentifierLike()&&!e.check("for")&&!kt(e)){const n=e.parseExpression();return r.push(n),Tt.from(t).withArgs(...r).blocking().endingAt(e.getPosition()).build()}if(e.check("for")){e.advance();const n=[];do{if(e.checkTimeExpression()||e.checkLiteral()||e.check("(")){if(n.push({kind:"duration",expr:e.parseExpression()}),e.check("or")){e.advance();continue}break}const t=e.peek();if(!De(t))throw Error('Expected event name or duration after "for"');const r=t.value;e.advance();const i=[];if(e.check("(")){for(e.advance();!e.isAtEnd()&&!e.check(")");){const t=e.peek();if(!De(t))break;i.push(t.value),e.advance(),e.check(",")&&e.advance()}if(!e.check(")"))throw Error('Expected ")" after event parameters');e.advance()}if(n.push({kind:"event",name:r,params:i}),!e.check("or"))break;e.advance()}while(!e.isAtEnd());let i=null;e.check(m)&&(e.advance(),At(e,b),i=e.parsePrimary());const a={start:t.start,end:e.getPosition().end,line:t.line,column:t.column};r.push(ft(n.map(e=>ht("duration"===e.kind?[{key:ut("duration",a),value:e.expr}]:[{key:ut("name",a),value:ct(e.name,`"${e.name}"`,a)},{key:ut("args",a),value:ft(e.params.map(e=>ct(e,`"${e}"`,a)),a)}],a)),a)),i&&r.push(i)}return Tt.from(t).withArgs(...r).blocking().endingAt(e.getPosition()).build()}(this.getContext(),e)}parseInstallCommand(e){return function(e,t){const r=[];if(!e.checkIdentifierLike())throw Error('Expected behavior name after "install"');const n=e.advance().value,i=e.previous();if(r.push(ut(n,{start:i.start,end:i.end,line:i.line,column:i.column})),e.check("(")){e.advance();const n=[];for(;!e.isAtEnd()&&!e.check(")");)if(n.push(St(e)),e.check(","))e.advance();else if(!e.check(")"))break;if(!e.check(")"))throw Error('Expected ")" after behavior parameters');if(e.advance(),n.length>0){const i={start:t.start,end:e.getPosition().end,line:t.line,column:t.column};r.push(ht(n.map(e=>({key:e.name?ut(e.name,i):ct("_positional","_positional",i),value:e.value})),i))}}return Tt.from(t).withArgs(...r).endingAt(e.getPosition()).build()}(this.getContext(),e)}parseTransitionCommand(e){return function(e,t){const r=[],n={};let i=null,a=null;const s=e.peek();if(e.checkAnySelector()||e.checkContextVar()||e.check("<")||De(s)&&Rt.has(s.value)){const t=e.parsePrimary();("possessiveExpression"===t.type||"memberExpression"===t.type&&!t.computed)&&t.object&&t.property?.name?(a=t.object,i={type:"string",value:t.property.name,start:s.start||0,end:e.getPosition().end,line:s.line,column:s.column}):(a=t,e.check("'s")&&e.advance())}const o=e.peek();if(!i&&(De(o)||"*"===o.value)){let t="";e.check("*")&&(t="*",e.advance());const r=function(e){if(!e.checkIdentifierLike())return"";let t=e.advance().value;for(;e.check("-")&&!e.isAtEnd();)t+="-",e.advance(),e.checkIdentifierLike()&&(t+=e.advance().value);return t}(e);r&&(t+=r,i={type:"string",value:t,start:o.start||0,end:e.getPosition().end,line:o.line,column:o.column})}if(!i)throw Error("Transition command requires a CSS property");if(a&&r.push(a),r.push(i),!e.check(d))throw Error('Expected "to" keyword after property in transition command');e.advance();const l=e.parsePrimary();if(n.to=l,e.check("over")){e.advance();const t=e.parsePrimary();n.over=t}if(e.check(p)){e.advance();const t=e.parsePrimary();n.with=t}return Tt.from(t).withArgs(...r).withModifiers(n).endingAt(e.getPosition()).build()}(this.getContext(),e)}parseAddCommand(e){return function(e,t){const r=[];if(e.match("{"))r.push(e.parseCSSObjectLiteral());else{const t=Et(e,[d]);t&&r.push(t)}if(e.check(d)){e.advance();const t=Et(e);t&&r.push(t)}return Tt.from(t).withArgs(...r).endingAt(e.getPosition()).build()}(this.getContext(),e)}parseIfCommand(e){return qt(this.getContext(),e)}parseRemoveCommand(e){return $t(this.getContext(),e)}parseToggleCommand(e){return _t(this.getContext(),e)}parseRegularCommand(e){return Ut(this.getContext(),e)}parseCall(){let e=this.parsePrimary();for(;;)if(this.match("("))e=this.finishCall(e);else if(this.match(".")){const t=this.consumeIdentifierLike("Expected property name after '.' - malformed member access");e=this.createMemberExpression(e,this.createIdentifier(t.value),!1)}else if(this.match("?.")){const t=this.consumeIdentifierLike("Expected property name after '?.' - malformed optional access"),r=this.createMemberExpression(e,this.createIdentifier(t.value),!1);r.optional=!0,e=r}else if(this.match("[")){const t=this.parseExpression();this.consume("]","Expected ']' after array index"),e=this.createMemberExpression(e,t,!0)}else{if(!this.check("'s"))break;{let t;this.advance(),this.check("*")?(this.advance(),t="*"+this.consumeIdentifier("Expected property name after * in CSS property syntax").value):Ge(this.peek())&&this.peek().value.startsWith("@")?t=this.advance().value:this.check("[")&&this.tokens[this.current+1]?.value?.startsWith("@")?(this.advance(),t=this.advance().value,this.consume("]","Expected ']' after attribute reference")):t=this.consumeIdentifierLike("Expected property name after possessive").value,e=this.createPossessiveExpression(e,this.createIdentifier(t))}}return e}parsePrimary(){if(this.check("*")){const e=this.current;if(this.advance(),!this.isAtEnd()&&De(this.peek())){const e=this.advance().value;return this.createSelector("*"+e)}this.current=e}if(this.check("*")||this.check("/")||this.check("%")||this.check("mod")){const e=this.peek();return this.addError(`Binary operator '${e.value}' requires a left operand`),this.createErrorNode()}if(this.matchNumber()){const e=parseFloat(this.previous().value);return this.createLiteral(e,this.previous().value)}if(this.matchString()){const e=this.previous().value;if(2>e.length||e.startsWith('"')&&!e.endsWith('"')||e.startsWith("'")&&!e.endsWith("'"))return this.addError("Unclosed string literal - string not properly closed"),this.createErrorNode();const t=e.slice(1,-1),r=this.processEscapeSequences(t);return this.createLiteral(r,e)}if(this.matchTemplateLiteral()){const e=this.previous();return{type:"templateLiteral",value:e.value,start:e.start||0,end:e.end||0,line:e.line,column:e.column}}if(this.matchBoolean()){const e=this.previous().value;let t;switch(e){case"true":t=!0;break;case"false":t=!1;break;case"null":t=null;break;case"undefined":t=void 0;break;default:t="true"===e}return this.createLiteral(t,e)}if(this.matchTimeExpression()){const e=this.previous().value;return this.createLiteral(e,e)}if(this.matchQueryReference()){const e=this.previous().value,t=e.slice(1,-2).trim(),r=this.createSelector(t);return r.fromQuery=!0,r.raw=e,r}if(this.matchSelector())return this.createSelector(this.previous().value);if(this.match("<"))return this.parseHyperscriptSelector();if(this.match("(")){if(this.isAtEnd())return this.addError("Expected expression inside parentheses"),this.createErrorNode();const e=this.parseExpression();return this.consume(")","Expected closing parenthesis ')' after expression - unclosed parentheses"),e}if(this.match("{"))return this.parseObjectLiteral();if(this.match("["))return this.parseAttributeOrArrayLiteral();if(this.check(":")){if(this.advance(),this.check(":")){this.advance();const e=this.advance();return{type:"identifier",name:e.value,scope:"global",start:e.start-2,end:e.end,line:e.line,column:e.column}}{const e=this.advance();return{type:"identifier",name:e.value,scope:"element",start:e.start-1,end:e.end,line:e.line,column:e.column}}}if(this.matchBasicOperator()){const e=this.previous();return this.createIdentifier(e.value)}const e=this.peek();if((!e||"end"!==e.value&&"else"!==e.value&&"then"!==e.value)&&(this.matchPredicate(Ye)||this.matchPredicate(Ve)||this.matchPredicate(Be)||this.matchPredicate(ze)||this.matchPredicate(He))){const e=this.previous();if("new"===e.value)return this.parseConstructorCall();if("on"===e.value)return this.parseEventHandler();if("if"===e.value)return this.parseConditional();if("closest"===e.value||"first"===e.value||"last"===e.value||"previous"===e.value||"next"===e.value){if(this.check("(")||this.checkCssSelector()||this.checkClassSelector()||this.checkIdSelector()||this.check("<")||this.checkQueryReference())return this.parseNavigationFunction(e.value);if(this.check(".")){const t=this.current;if(this.advance(),this.checkIdentifier()){const t=this.advance().value,r=this.createSelector("."+t);return this.createCallExpression(this.createIdentifier(e.value),[r])}this.current=t}if(this.check("#")){const t=this.current;if(this.advance(),this.checkIdentifier()){const t=this.advance().value,r=this.createSelector("#"+t);return this.createCallExpression(this.createIdentifier(e.value),[r])}this.current=t}return this.isAtEnd()||this.checkBasicOperator()||this.check("then")||this.check("else")||this.check("end")?this.createIdentifier(e.value):this.parseNavigationFunction(e.value)}const t=this.check(".")||this.check("?.");return"my"!==e.value||t?"its"!==e.value||t?"your"!==e.value||t?"the"===e.value?this.parseTheXofY():"values"===e.value&&this.check("of")?(this.advance(),{type:"propertyOfExpression",property:{type:"identifier",name:"values"},target:this.parsePrimary(),line:e.line,column:e.column}):this.createIdentifier(e.value):this.parseContextPropertyAccess("you"):this.parseContextPropertyAccess("it"):this.parseContextPropertyAccess("me")}if(this.match("$"))return this.parseDollarExpression();if("\\"===this.peek().value)return this.parseBlockLiteral();if(Ge(this.peek())&&this.peek().value.startsWith("@")){const e=this.advance();return{type:"attributeAccess",attributeName:e.value.substring(1),start:e.start,end:e.end,line:e.line,column:e.column}}const t=this.peek();return this.addError(`Unexpected token: ${t.value} at line ${t.line}, column ${t.column}`),this.advance(),this.createErrorNode()}parseBlockLiteral(){const e=this.peek().start;this.advance();const t=[];for(;!(this.isAtEnd()||this.check("-")&&">"===this.tokens[this.current+1]?.value);){if(!this.checkIdentifier()){this.addError("Unexpected token in block literal parameters: "+this.peek().value);break}t.push(this.advance().value),this.match(",")}return this.check("-")&&">"===this.tokens[this.current+1]?.value?(this.advance(),this.advance(),{type:"blockLiteral",parameters:t,body:this.parseExpression(),start:e,end:this.previous().end,line:this.previous().line,column:this.previous().column}):(this.addError("Expected '->' in block literal"),this.createErrorNode())}parseDollarExpression(){if(this.checkNumber()){const e=this.advance().value;return this.createLiteral(e,"$"+e)}if(this.checkIdentifier()){const e=this.advance();let t=this.createIdentifier(e.value);for(;this.match(".");){if(!this.checkIdentifier())return this.addError("Expected property name after '.' in dollar expression"),this.createErrorNode();{const e=this.advance();t=this.createMemberExpression(t,this.createIdentifier(e.value),!1)}}return{type:"dollarExpression",expression:t,raw:`$${e.value}${this.previous().value||""}`,line:e.line,column:e.column-1}}return this.addError("Expected identifier or number after '$'"),this.createErrorNode()}parseHyperscriptSelector(){let e="";for(;!this.check("/")&&!this.isAtEnd();)e+=this.advance().value;return this.consume("/","Expected '/' in hyperscript selector"),this.consume(">","Expected '>' after '/' in hyperscript selector"),this.createSelector(e)}parseObjectLiteral(){const e=[],t=this.getPosition();if(this.check("}"))return this.advance(),{type:"objectLiteral",properties:e,start:t.start,end:this.getPosition().end,line:t.line,column:t.column};do{let t;if(this.check("["))this.advance(),t=this.parseExpression(),this.consume("]","Expected ']' after computed property name in object literal");else if(this.matchString()){const e=this.previous().value,r=e.slice(1,-1);t=this.createLiteral(r,e)}else{if(!this.check("-")&&!this.checkPredicate(Ye))return this.addError("Expected property name in object literal"),this.createErrorNode();{let e="",r=!1;for(;this.check("-");)this.advance(),e+="-",r=!0;for(this.checkPredicate(Ye)&&(e+=this.advance().value);this.check("-");)this.advance(),e+="-",r=!0,this.checkPredicate(Ye)&&(e+=this.advance().value);if(""===e||"-"===e)return this.addError("Expected property name in object literal"),this.createErrorNode();t=r?this.createLiteral(e,e):this.createIdentifier(e)}}this.consume(":","Expected ':' after property name in object literal");const r=this.parseExpression();if(e.push({key:t,value:r}),!this.match(","))break;if(this.check("}"))break}while(!this.isAtEnd());return this.consume("}","Expected '}' after object literal properties"),{type:"objectLiteral",properties:e,start:t.start,end:this.getPosition().end,line:t.line,column:t.column}}parseCSSObjectLiteral(){const e=this.getPosition(),t=[];do{if(this.check("}"))break;let r;if(this.matchPredicate(Ye))r=this.createIdentifier(this.previous().value);else{if(!this.matchString())return this.addError("Expected CSS property name"),this.createErrorNode();{const e=this.previous().value,t=e.slice(1,-1);r=this.createLiteral(t,e)}}if(!this.consume(":","Expected ':' after CSS property name"))return this.createErrorNode();const n=[];let i=!1,a=0,s=-1,o=-1;for(;!this.isAtEnd()&&(0!==a||!this.check(";")&&!this.check("}"));){const e=this.advance();n.push(e.value),0>s&&"number"==typeof e.start&&(s=e.start),"number"==typeof e.end&&(o=e.end),"$"===e.value&&this.check("{")&&(i=!0),"{"===e.value&&a++,"}"===e.value&&a--}const l=this.originalInput&&s>=0&&o>s?this.originalInput.slice(s,o):n.join(""),c=i?{type:"templateLiteral",value:l,start:e.start,end:this.getPosition().end,line:e.line,column:e.column}:this.createLiteral(l,l);if(t.push({key:r,value:c}),this.check(";")&&this.advance(),this.check("}"))break}while(!this.isAtEnd());return this.consume("}","Expected '}' after CSS object literal properties"),{type:"objectLiteral",properties:t,start:e.start,end:this.getPosition().end,line:e.line,column:e.column}}parseConstructorCall(){const e=this.previous();if(!this.checkIdentifier())return this.addError('Expected constructor name after "new"'),this.createErrorNode();const t=this.advance(),r=t.value;if(!this.check("("))return this.addError('Expected "(" after constructor name'),this.createErrorNode();this.advance();const n=[];if(!this.check(")"))do{n.push(this.parseExpression())}while(this.match(","));return this.consume(")","Expected ')' after constructor arguments"),{type:"callExpression",callee:{type:"identifier",name:r,start:t.start,end:t.end,line:t.line,column:t.column},arguments:n,isConstructor:!0,start:e.start,end:this.previous().end,line:e.line,column:e.column}}parseTopLevelInitBlock(){const e=this.getPosition(),t=this.parseCommandBlock(["end"]);return this.consume("end","Expected 'end' after init block"),{type:"initBlock",commands:t,start:e.start,end:this.getPosition().end,line:e.line,column:e.column}}parseDefFeature(){const e=this.getPosition();let t="";if(!this.checkIdentifier())return this.addError("Expected function name after 'def'"),{type:"def",name:"",params:[],body:[],start:e.start,end:this.getPosition().end,line:e.line,column:e.column};for(t=this.advance().value;this.check(".");)this.advance(),this.checkIdentifier()&&(t+="."+this.advance().value);const r=[];if(this.check("(")){if(this.advance(),!this.check(")"))for(this.checkIdentifier()&&r.push(this.advance().value);this.check(",");)this.advance(),this.checkIdentifier()&&r.push(this.advance().value);this.consume(")","Expected ')' after parameter list")}const n=this.parseCommandBlock(["end","catch","finally"]),{errorSymbol:i,errorHandler:a,finallyHandler:s}=this.parseErrorAndFinallyBlocks();return this.consume("end","Expected 'end' after function definition"),{type:"def",name:t,params:r,body:n,...void 0!==i&&{errorSymbol:i},...void 0!==a&&{errorHandler:a},...void 0!==s&&{finallyHandler:s},start:e.start,end:this.getPosition().end,line:e.line,column:e.column}}parseErrorAndFinallyBlocks(){let e,t,r;return this.check("catch")&&(this.advance(),this.checkIdentifier()&&(e=this.advance().value),t=this.parseCommandBlock(["end","finally"])),this.check("finally")&&(this.advance(),r=this.parseCommandBlock(["end"])),{...void 0!==e&&{errorSymbol:e},...void 0!==t&&{errorHandler:t},...void 0!==r&&{finallyHandler:r}}}parseEventNameWithNamespace(e){let t;t=this.checkEvent()||this.checkIdentifier()||this.checkIsCommand()||this.checkIdentifierLike()?this.advance():this.consumeEvent(e);let r=t.value;return this.check(":")&&(this.advance(),r=`${r}:${this.advance().value}`),r}callExprToCommandNode(e,t){return{type:"command",name:e.callee.name,args:e.arguments,isBlocking:!1,...void 0!==t.start&&{start:t.start},...void 0!==t.end&&{end:t.end},...void 0!==t.line&&{line:t.line},...void 0!==t.column&&{column:t.column}}}createPseudoCommandNode(e,t,r,n,i){return{type:"command",name:"pseudo-command",args:[{type:"objectLiteral",properties:[{key:{type:"identifier",name:"methodName"},value:{type:"literal",value:e,raw:`"${e}"`}},{key:{type:"identifier",name:"methodArgs"},value:{type:"literal",value:t.arguments,raw:JSON.stringify(t.arguments)}},...r?[{key:{type:"identifier",name:"preposition"},value:{type:"literal",value:r,raw:`"${r}"`}}]:[],{key:{type:"identifier",name:"targetExpression"},value:n}]}],isBlocking:!1,...void 0!==i.start&&{start:i.start},...void 0!==i.end&&{end:i.end},...void 0!==i.line&&{line:i.line},...void 0!==i.column&&{column:i.column}}}tryParsePseudoCommand(e,t){const r=e.callee.name,n=this.peek();if(!(Qt.PSEUDO_COMMAND_PREPOSITIONS.includes(n.value.toLowerCase())||Ye(n)&&!this.isCommand(n.value)||Be(n)))return{node:this.callExprToCommandNode(e,t),isPseudo:!1,targetFailed:!1};let i,a;this.isCommand(r)&&this.addWarning({type:"command-shadow",message:`Method '${r}' shadows hyperscript command`,suggestions:[`Rename method to avoid confusion (e.g., '${r}Fn', 'my${r.charAt(0).toUpperCase()+r.slice(1)}')`,`Use 'call' command instead: call ${r}(...)`,"This works but may cause ambiguity"],severity:"warning",code:"PSEUDO_CMD_SHADOW",...void 0!==t.line&&{line:t.line},...void 0!==t.column&&{column:t.column}}),Qt.PSEUDO_COMMAND_PREPOSITIONS.includes(this.peek().value.toLowerCase())&&(i=this.advance().value.toLowerCase());try{a=this.parseExpression()}catch{return{node:this.callExprToCommandNode(e,t),isPseudo:!1,targetFailed:!0}}return{node:this.createPseudoCommandNode(r,e,i,a,t),isPseudo:!0,targetFailed:!1}}parseCommandWithErrorRecovery(){this.advance();const e=this.error;try{const t=this.parseCommand();return this.error&&this.error!==e&&(pe("\u26a0\ufe0f Command parsing added error, restoring error state. Error was:",this.error.message),this.error=e),t}catch(t){return pe("\u26a0\ufe0f Command parsing threw exception, restoring error state:",t instanceof Error?t.message:t+""),this.error=e,null}}parseTemporalKeywordModifiers(e){if(!this.check("debounced")&&!this.check("throttled"))return;const t=this.advance().value.toLowerCase(),r="debounced"===t?"debounce":"throttle";if(this.match("at"))if(this.checkTimeExpression()){const i=this.advance(),a=(n=i.value).endsWith("ms")?parseInt(n,10):n.endsWith("seconds")||n.endsWith("s")?1e3*parseFloat(n):n.endsWith("minutes")?6e4*parseFloat(n):n.endsWith("hours")?36e5*parseFloat(n):n.endsWith("days")?864e5*parseFloat(n):parseInt(n,10);e[r]=a,pe(`\ud83d\udd27 parseEventHandler: Parsed '${t} at ${i.value}' (${a}ms)`)}else if(this.matchNumber()){const n=parseInt(this.previous().value,10);e[r]=n,pe(`\ud83d\udd27 parseEventHandler: Parsed '${t} at ${n}'`)}else this.addError(`Expected time expression after '${t} at', got: ${this.peek().value}`);else this.addError(`Expected 'at' after '${t}'`);var n}parseEventHandler(){pe("\ud83d\udd27 parseEventHandler: ENTRY - parsing event handler");const e=[];let t=!1;if(this.check("first")&&!this.checkIsCommand()&&this.tokens.length>this.current+1){const e=this.tokens[this.current+1],r=e?.value?.toLowerCase();r&&"of"!==r&&"in"!==r&&"from"!==r&&(this.advance(),t=!0,pe("\ud83d\udd27 parseEventHandler: Parsed 'first' as .once alias"))}const r=this.parseEventNameWithNamespace("Expected event name after 'on'");for(e.push(r),pe("\ud83d\udd27 parseEventHandler: Parsed first event name: "+r);this.check("or");){this.advance(),pe("\ud83d\udd27 parseEventHandler: Found 'or', parsing additional event name");const t=this.parseEventNameWithNamespace("Expected event name after 'or'");e.push(t),pe("\ud83d\udd27 parseEventHandler: Parsed additional event name: "+t)}let n;if(pe("\ud83d\udd27 parseEventHandler: Total events parsed: "+e.join(", ")),this.registryIntegration){const t=e[0];if(this.registryIntegration.hasEventSource(t)){const e=this.registryIntegration.getEventSource(t);n=e?.name,pe(`\ud83d\udd27 parseEventHandler: Detected custom event source '${n}' for event '${t}'`)}}const i=[];if(this.match("(")){if(!this.check(")"))do{const e=this.advance();i.push(e.value)}while(this.match(","));this.consume(")","Expected ')' after event parameters"),pe("\ud83d\udd27 parseEventHandler: Parsed event parameters: "+i.join(", "))}const a={};for(;this.check(".");){this.advance();const e=this.advance().value.toLowerCase();if("once"===e)a.once=!0,pe("\ud83d\udd27 parseEventHandler: Parsed modifier '.once'");else if("prevent"===e)a.prevent=!0,pe("\ud83d\udd27 parseEventHandler: Parsed modifier '.prevent'");else if("stop"===e)a.stop=!0,pe("\ud83d\udd27 parseEventHandler: Parsed modifier '.stop'");else if("debounce"===e||"throttle"===e){if(!this.check("("))throw Error(`Expected '(' after '.${e}'`);{this.advance();const t=this.advance(),r=parseInt(t.value,10);if(isNaN(r))throw Error(`Expected number for ${e} delay, got: ${t.value}`);"debounce"===e?(a.debounce=r,pe(`\ud83d\udd27 parseEventHandler: Parsed modifier '.debounce(${r})'`)):(a.throttle=r,pe(`\ud83d\udd27 parseEventHandler: Parsed modifier '.throttle(${r})'`)),this.consume(")",`Expected ')' after ${e} delay`)}}else pe(`\ud83d\udd27 parseEventHandler: Warning - unknown modifier '.${e}'`)}let s,o,l,c;if(this.parseTemporalKeywordModifiers(a),t&&(a.once=!0),Object.keys(a).length>0&&pe("\ud83d\udd27 parseEventHandler: Parsed modifiers:",a),this.match("[")&&(s=this.parseExpression(),this.consume("]","Expected ']' after event condition")),this.match("from")){const e=this.advance();o=e.value,pe(`\ud83d\udd27 parseEventHandler: Parsed 'from' target: ${o} (kind: ${e.kind})`),this.parseTemporalKeywordModifiers(a)}if(this.match("of")){const e=this.advance();l=e.value.startsWith("@")?e.value.substring(1):e.value,pe("\ud83d\udd27 parseEventHandler: Parsed attribute name: "+l)}this.match("in")&&(pe("\ud83d\udd27 parseEventHandler: Found 'in' keyword, parsing watch target"),c=this.parseExpression(),pe("\ud83d\udd27 parseEventHandler: Parsed watch target expression"));const u=[];for(pe(`\u2705 parseEventHandler: About to parse commands, current token: ${this.isAtEnd()?"END":this.peek().value}, isAtEnd: ${this.isAtEnd()}`);!this.isAtEnd();){if(pe(`\u2705 parseEventHandler: Loop iteration, current token: ${this.peek().value}, kind: ${this.peek().kind}`),this.check("on")){pe("\u2705 parseEventHandler: Stopping command parsing, found next event handler 'on'");break}if(this.checkComment())pe("\u2705 parseEventHandler: Skipping comment token: "+this.peek().value),this.advance();else{if(this.check("end")){pe("\u2705 parseEventHandler: Stopping command parsing, found 'end' keyword"),this.advance();break}if(this.check("catch")||this.check("finally")){pe(`\u2705 parseEventHandler: Stopping command parsing, found '${this.peek().value}'`);break}if(this.checkIsCommand()){const e="("===this.tokens[this.current+1]?.value,t=this.peek().value.toLowerCase();if(e&&"js"!==t&&"tell"!==t){let e;const t=this.error;try{e=this.parseExpression()}catch(e){this.error=t,this.advance();const r=this.parseCommand();u.push(r);continue}if(e&&"callExpression"===e.type){const t=this.tryParsePseudoCommand(e,e);if(u.push(t.node),t.isPseudo||t.targetFailed)continue}}else{const e=this.parseCommandWithErrorRecovery();e&&(u.push(e),pe("\u2705 parseEventHandler: Parsed command, next token: "+(this.isAtEnd()?"END":this.peek().value)))}}else{if(!this.checkIdentifier())break;{const e=this.peek();if(this.isCommand(e.value)){const e=this.parseCommandWithErrorRecovery();e&&u.push(e)}else{let e;const t=this.error;try{e=this.parseExpression()}catch(e){pe("\u26a0\ufe0f Expression parsing error, restoring error state:",e instanceof Error?e.message:e+""),this.error=t;break}if(e&&"callExpression"===e.type){const t=this.tryParsePseudoCommand(e,e);if(u.push(t.node),t.targetFailed)continue}else{if(!e||"binaryExpression"!==e.type||" "!==e.operator)break;{const t=e;if(!t.left||"identifier"!==t.left.type||!this.isCommand(t.left.name))break;{const r={type:"command",name:t.left.name,args:[t.right],isBlocking:!1,...void 0!==e.start&&{start:e.start},...void 0!==e.end&&{end:e.end},...void 0!==e.line&&{line:e.line},...void 0!==e.column&&{column:e.column}};u.push(r)}}}}}}for(;!(this.isAtEnd()||this.checkIsCommand()||this.isCommand(this.peek().value)||this.check("then")||this.check("and")||this.check(",")||this.check("on")||this.check("catch")||this.check("finally"));)this.advance();if(!this.match("then","and",",")&&!this.checkIsCommand()&&!this.isCommand(this.peek().value))break}}let d,m,p;this.isAtEnd()||!this.check("catch")&&!this.check("finally")||(({errorSymbol:d,errorHandler:m,finallyHandler:p}=this.parseErrorAndFinallyBlocks()),this.check("end")&&this.advance());const h=this.getPosition(),f={type:"eventHandler",event:1===e.length?e[0]:e.join("|"),events:e,commands:u,...void 0!==d&&{errorSymbol:d},...void 0!==m&&{errorHandler:m},...void 0!==p&&{finallyHandler:p},...i.length>0&&{args:i},...s&&{condition:s},...o&&{target:o},...l&&{attributeName:l},...c&&{watchTarget:c},...n&&{customEventSource:n},...Object.keys(a).length>0&&{modifiers:a},start:h.start,end:h.end,line:h.line,column:h.column};return pe(`\ud83d\udd27 parseEventHandler: Created node with events: ${e.join(", ")}, attributeName: ${l||"none"}, watchTarget: ${c?"yes":"none"}`),f}parseBehaviorDefinition(){const e=this.getPosition(),t=this.consumeIdentifier("Expected behavior name after 'behavior' keyword").value;/^[A-Z]/.test(t)||this.addError(`Behavior name must start with uppercase letter (got "${t}")`);const r=[];if(this.match("(")){if(!this.check(")"))do{const e=this.consumeIdentifierLike("Expected parameter name");r.push(e.value)}while(this.match(","));this.consume(")","Expected ')' after behavior parameters")}const n=new Set(r),i=[];let a;for(;!this.isAtEnd()&&!this.check("end");)if(this.match("on")){const e=this.getPosition(),t=this.parseEventNameWithNamespace("Expected event name after 'on'"),r=[];if(this.check("(")){for(this.advance();!this.isAtEnd()&&!this.check(")");){const e=this.peek();Ye(e)?(r.push(e.value),this.advance(),this.check(",")&&this.advance()):this.advance()}this.check(")")&&this.advance()}let a;if(this.check("from")){this.advance();const e=[];if(this.check("the")&&this.advance(),!this.isAtEnd()){const t=this.peek(),r=n.has(t.value);this.checkIsCommand()&&!r||(e.push(t.value),a=t.value,this.advance())}}const{commands:s,terminator:o}=this.parseCommandListUntilTerminator(["catch","finally"]);let l,c,u;if("catch"!==o&&"finally"!==o||({errorSymbol:l,errorHandler:c,finallyHandler:u}=this.parseErrorAndFinallyBlocks()),!this.check("end"))throw Error('Expected "end" to close behavior event handler');this.advance();const d={type:"eventHandler",event:t,commands:s,...void 0!==l&&{errorSymbol:l},...void 0!==c&&{errorHandler:c},...void 0!==u&&{finallyHandler:u},...void 0!==a&&{target:a},...r.length>0&&{args:r},start:e.start,end:this.getPosition().end,line:e.line,column:e.column};i.push(d)}else{if(!this.match("init")){this.addError("Unexpected token in behavior body: "+this.peek().value);break}a={type:"initBlock",commands:this.parseCommandBlock(["end"]),start:e.start,end:this.getPosition().end,line:e.line,column:e.column},this.consume("end","Expected 'end' after init block")}return this.consume("end","Expected 'end' to close behavior definition"),{type:"behavior",name:t,parameters:r,eventHandlers:i,...void 0!==a?{initBlock:a}:{},start:e.start,end:this.getPosition().end,line:e.line,column:e.column}}parseCommandSequence(){const e=[];for(;!this.isAtEnd();){if(this.checkIsCommand()||this.isCommand(this.peek().value)&&!this.isKeyword(this.peek().value)){this.advance();const t=this.error,r=this.parseCommand();for(this.error&&this.error!==t&&(this.error.message.includes("Expected closing parenthesis")||this.error.message.includes("Expected ')'")||this.error.message.includes("unclosed parenthes")||this.error.message.includes("Unclosed parenthes")||(pe("\u26a0\ufe0f parseCommandSequence: Command parsing added non-critical error, restoring error state. Error was:",this.error.message),this.error=t)),e.push(r);!(this.isAtEnd()||this.checkIsCommand()||this.isCommand(this.peek().value)||this.check("then")||this.check("on"));)pe("\u26a0\ufe0f parseCommandSequence: Skipping unexpected token:",this.peek().value),this.advance();if(this.check("on")){pe('\u2705 parseCommandSequence: Found "on" token, stopping command sequence to allow event handler parsing');break}if(this.match("then"))continue;if(this.checkIsCommand()||this.isCommand(this.peek().value)&&!this.isKeyword(this.peek().value))continue;break}{const t=this.peek(),r=this.getPosition(),n="Expected command, got: "+t.value;this.addError(n);const i=gt(r,n,t.value);if(e.push(i),this.synchronizeToCommandBoundary(),this.isAtEnd())break;if(this.match("then"))continue;if(this.check("end")||this.check("on"))break;if(this.checkIsCommand()||this.isCommand(this.peek().value)&&!this.isKeyword(this.peek().value))continue;break}}return 1===e.length?e[0]:function(e){return{type:"CommandSequence",commands:e,start:e[0]?.start||0,end:e[e.length-1]?.end||0,line:e[0]?.line||1,column:e[0]?.column||1}}(e)}getMultiWordPattern(e){return function(e){return vt.find(t=>t.command===e.toLowerCase())||null}(e)}isTokenKeyword(e,t){return bt(e,t)}parseMultiWordCommand(e,t){return function(e,t,r){const n=e.getMultiWordPattern(r);if(!n)return null;const i=[],a={};for(;!kt(e,["catch","finally",...n.keywords])&&!bt(e.peek(),n.keywords);){const t=e.parsePrimary();if(!t)break;if(i.push(t),!e.match(",")&&bt(e.peek(),n.keywords))break}for(;!e.isAtEnd()&&bt(e.peek(),n.keywords);){const t=e.advance().value,r=e.parseExpression();if(r&&(a[t]=r),!bt(e.peek(),n.keywords))break}const s=Tt.from(t).withArgs(...i).endingAt(e.getPosition());return Object.keys(a).length>0&&s.withModifiers(a),s.build()}(this.getContext(),e,t)}parseCommandBlock(e){const t=[];for(;!this.isAtEnd()&&!e.some(e=>this.check(e));)if(this.checkComment())this.advance();else{if(!this.checkIsCommand()&&!this.isCommand(this.peek().value))break;{this.advance();const e=this.parseCommand();if(t.push(e),this.match("then","and",","))continue}}return t}trySemanticParse(e){if(!this.semanticAdapter||!this.semanticAdapter.isAvailable())return null;try{const t=this.semanticAdapter.trySemanticParse(e);return t.success&&t.node?(pe(`[Semantic] Successfully parsed with confidence ${t.confidence}:`,t.node.name),t.node):(pe(`[Semantic] Low confidence (${t.confidence}), falling back to traditional parser`),null)}catch(e){return pe("[Semantic] Error during semantic parse:",e),null}}getRemainingInput(){if(!this.originalInput)return this.tokens.slice(this.current>0?this.current-1:0).map(e=>e.value).join(" ");const e=this.current>0?this.tokens[this.current-1]:this.tokens[0];return e&&void 0!==e.start?this.originalInput.slice(e.start):this.originalInput}skipToCommandBoundary(){const e=["then","and","else","end"];for(;!this.isAtEnd();){const t=this.peek(),r=t.value.toLowerCase();if(e.includes(r))break;if(ze(t))break;this.advance()}}parseCommand(){const e=this.parseCommandCore();if(e&&"command"===e.type&&!e.body&&(this.check("when")||this.check("where"))){const t=this.peek().value.toLowerCase();this.advance();const r=this.parseExpression();r&&(e.modifiers={...e.modifiers??{},[t]:r})}return e}parseCommandCore(){const e=this.previous();let t=e.value;if(this.semanticAdapter&&!["install","wait","repeat","for","set","put","increment","decrement","add","append","prepend","toggle","take","if","unless","make","measure","trigger","halt","remove","exit","return","closest","js","tell","fetch","process"].includes(t.toLowerCase())){const e=this.getRemainingInput(),t=this.trySemanticParse(e);if(t)return this.skipToCommandBoundary(),t}if("beep"===t&&this.check("!")&&(this.advance(),t="beep!"),"fetch"===t)return function(e,t){const r={};let n=null;if(!e.isAtEnd()&&Kt(e)&&(n=Xt(e)),n||(n=e.parsePrimary()),!n)return e.addError("fetch requires a URL"),Tt.from(t).endingAt(e.getPosition()).build();!e.isAtEnd()&&e.check("{")&&(r.with=e.parsePrimary());for(let t=0;3>t&&!e.isAtEnd();t++)if(!e.check("as")||r.as){if(!e.check("with")||r.with){if(e.check("do")&&!r.doNotThrow){const t=e.peekAt(1),n=e.peekAt(2);if("not"===t?.value&&"throw"===n?.value){const t=e.advance();e.advance();const n=e.advance();r.doNotThrow={type:"literal",value:!0,start:t.start,end:n.end,line:t.line,column:t.column};continue}}break}e.advance(),r.with=Gt(e)?Jt(e):e.parsePrimary()}else e.advance(),e.isAtEnd()||At(e,"a")||At(e,"an"),r.as=e.parsePrimary();const i=Tt.from(t).withArgs(n).endingAt(e.getPosition());return Object.keys(r).length>0&&i.withModifiers(r),i.build()}(this.getContext(),e);const r=this.parseMultiWordCommand(e,t);if(r)return r;const n=t.toLowerCase();if("repeat"===n)return this.parseRepeatCommand(e);if("for"===n)return this.parseForCommand(e);if("if"===n||"unless"===n)return this.parseIfCommand(e);if("wait"===n)return this.parseWaitCommand(e);if("install"===n)return this.parseInstallCommand(e);if("transition"===n)return this.parseTransitionCommand(e);if("add"===n)return this.parseAddCommand(e);if(this.isCompoundCommand(n))return this.parseCompoundCommand({type:"identifier",name:n,start:e.start||0,end:e.end||0,line:e.line,column:e.column})||function(e,t){return{type:"command",name:e,args:[],partial:!0,start:t.start,end:t.end,line:t.line,column:t.column}}(n,this.getPosition());const i=[];if(("increment"===t||"decrement"===t)&&!this.isAtEnd())return function(e,t){const r=t.value,n="increment"===r?"+":"-";let i=!1;e.check(v)&&(i=!0,e.advance());const a=e.parseExpression();if(!a)throw Error("Expected variable or expression after "+r);let s;if(e.check("by")){e.advance();const t=e.parseExpression();if(!t)throw Error(`Expected amount after 'by' in ${r} command`);s=t}else s=ct(1,"1",{start:t.start,end:e.previous().end,line:t.line,column:t.column});let o=a;i&&"identifier"===a.type&&(o={...a,scope:"global"});const l={start:t.start,end:e.previous().end,line:t.line,column:t.column},c=dt(n,a,s,l);c.coerceNumeric=!0;const u=[o,ut(d,l),c];return Tt.from(t).withName("set").withArgs(...u).withOriginalCommand(r).endingAt({end:e.previous().end}).build()}(this.getContext(),e);for(;!(this.isAtEnd()||this.check("then")||this.check("and")||this.check("else")||this.check("end")||this.checkIsCommand());){const e=this.parseExpression();if(i.push(e||this.parsePrimary()),this.match(","))continue;const t=["into","from","to","with","by","at","before","after","over"];if(t.some(e=>this.check(e)))continue;const r=i[i.length-1];if(!r||"identifier"!==r.type&&"keyword"!==r.type||!t.includes(r.name??r.value))break}const a=this.getPosition();return{type:"command",name:t,args:i,isBlocking:!1,start:a.start,end:a.end,line:a.line,column:a.column}}parseConditional(){const e=this.parseExpression();this.consume("then","Expected 'then' after if condition");const t=this.parseConditionalBranch();let r;this.match("else")&&(r=this.parseConditionalBranch());const n=this.getPosition();return{type:"conditionalExpression",test:e,consequent:t,alternate:r,start:n.start,end:n.end,line:n.line,column:n.column}}parseConditionalBranch(){if(this.checkIsCommand()){const e=this.advance(),t=this.createIdentifier(e.value);return this.createCommandFromIdentifier(t)||t}if(this.checkIdentifier()||this.checkKeyword()){const e=this.peek();if(this.isCommand(e.value)){const e=this.advance(),t=this.createIdentifier(e.value);return this.createCommandFromIdentifier(t)||t}}return this.parseExpression()}parseNavigationFunction(e){const t=[];if(this.match("of"))t.push(this.parseExpression());else{if(this.check("("))return this.finishCall(this.createIdentifier(e));this.isAtEnd()||this.checkBasicOperator()||this.check("then")||this.check("else")||t.push(this.parsePrimary())}const r=this.createCallExpression(this.createIdentifier(e),t);if("next"===e||"previous"===e){const e=this.parseRelativePositionalModifiers();e&&(r.relativePositional=e)}return r}parseRelativePositionalModifiers(){if(!(this.check("from")||this.check("within")||this.check("in")||this.check("with")))return null;let e,t,r,n=!1,i=!1;return this.match("from")&&(e=this.parseRelativePositionalOperand()),this.match("in")?(n=!0,r=this.parseRelativePositionalOperand()):this.match("within")&&(t=this.parseRelativePositionalOperand()),this.match("with")&&(this.match("wrapping"),i=!0),{from:e,within:t,inElt:r,inSearch:n,wrapping:i}}parseRelativePositionalOperand(){return this.match("the"),this.parsePrimary()}parseTheXofY(){if(!this.checkIdentifier())return this.createIdentifier("the");const e=this.peek(),t=e.value;return["first","last","next","previous","random","closest"].includes(t)?(this.advance(),this.parseNavigationFunction(t)):(this.advance(),this.check("of")?(this.advance(),{type:"propertyOfExpression",property:{type:"identifier",name:t},target:this.parseCall(),line:e.line,column:e.column}):this.createIdentifier(t))}parseContextPropertyAccess(e){if(this.match("*")){let t="";if(!this.checkIdentifier())return this.addError("Expected property name after 'my *'"),this.createMemberExpression(this.createIdentifier(e),this.createIdentifier(""),!1);for(t=this.advance().value;this.check("-")&&!this.isAtEnd();){if(t+="-",this.advance(),!this.checkIdentifier()){this.addError("Expected identifier after hyphen in CSS property name");break}t+=this.advance().value}const r="*"+t;return this.createMemberExpression(this.createIdentifier(e),this.createIdentifier(r),!1)}{if(this.check("[")&&this.tokens[this.current+1]?.value?.startsWith("@")){this.advance();const t=this.advance();return this.consume("]","Expected ']' after attribute reference"),this.createMemberExpression(this.createIdentifier(e),{type:"attributeAccess",attributeName:t.value.substring(1),start:t.start,end:t.end,line:t.line,column:t.column},!0)}if(Ge(this.peek())&&this.peek().value.startsWith("@")){const t=this.advance();return this.createMemberExpression(this.createIdentifier(e),this.createIdentifier(t.value),!1)}const t=this.consumeIdentifierLike(`Expected property name after '${{me:"my",it:"its",you:"your"}[e]}'`);return this.createMemberExpression(this.createIdentifier(e),this.createIdentifier(t.value),!1)}}parseMyPropertyAccess(){return this.parseContextPropertyAccess("me")}finishCall(e){const t=[];if(!this.check(")"))do{if(this.check(","))return this.addError("Unexpected token in function arguments"),this.createCallExpression(e,[this.createErrorNode()]);t.push(this.parseExpression())}while(this.match(","));if(!this.check(")")&&"identifier"===e.type){const t=e.name;j(t)&&pe(`\ud83d\udca1 Tip: CSS functions like ${t}() should be quoted for clean parsing. Use '${t}(...)' or \`${t}(...)\` instead.`)}return this.consume(")","Expected ')' after arguments"),this.createCallExpression(e,t)}createLiteral(e,t){return ct(e,t,this.getPosition())}createIdentifier(e){return ut(e,this.getPosition())}createBinaryExpression(e,t,r){return dt(e,t,r,this.getPosition())}createUnaryExpression(e,t,r){return function(e,t,r,n){return{type:"unaryExpression",operator:e,argument:t,prefix:r,start:n.start,end:n.end,line:n.line,column:n.column}}(e,t,r,this.getPosition())}createCallExpression(e,t){return function(e,t,r){return{type:"callExpression",callee:e,arguments:t,start:r.start,end:r.end,line:r.line,column:r.column}}(e,t,this.getPosition())}createMemberExpression(e,t,r){return function(e,t,r,n){return{type:"memberExpression",object:e,property:t,computed:r,start:n.start,end:n.end,line:n.line,column:n.column}}(e,t,r,this.getPosition())}createSelector(e){return function(e,t){return{type:"selector",value:e,start:t.start,end:t.end,line:t.line,column:t.column}}(e,this.getPosition())}createPossessiveExpression(e,t){return function(e,t,r){return{type:"possessiveExpression",object:e,property:t,start:r.start,end:r.end,line:r.line,column:r.column}}(e,t,this.getPosition())}createErrorNode(){return{type:"identifier",name:"__ERROR__",start:(e=this.getPosition()).start,end:e.end,line:e.line,column:e.column};var e}processEscapeSequences(e){return e.replace(/\\(.)/g,(e,t)=>{switch(t){case"n":return"\n";case"t":return"\t";case"r":return"\r";case"b":return"\b";case"f":return"\f";case"v":return"\v";case"0":return"\0";case"\\":return"\\";case'"':return'"';case"'":return"'";default:return t}})}createProgramNode(e){return function(e){if(pe(`\u2705 createProgramNode: Called with ${e.length} statements`),0===e.length)return pe("\u2705 createProgramNode: Returning error node (0 statements)"),{type:"identifier",name:"__ERROR__",start:0,end:0,line:1,column:1};if(1===e.length)return pe(`\u2705 createProgramNode: Returning single statement (type=${e[0].type})`),e[0];const t={type:"Program",statements:e,start:e[0]?.start||0,end:e[e.length-1]?.end||0,line:e[0]?.line||1,column:e[0]?.column||1};return pe(`\u2705 createProgramNode: Returning Program node with ${e.length} statements, type=${t.type}`),t}(e)}match(...e){for(const t of e)if(this.check(t))return this.advance(),!0;return!1}matchOperator(e){if(this.isAtEnd())return!1;const t=this.peek();return!(!ot(t)||t.value!==e||(this.advance(),0))}check(e){if(this.isAtEnd())return!1;const t=this.peek().value;return this.resolveKeyword(t)===e}checkPredicate(e){return!this.isAtEnd()&&e(this.peek())}matchPredicate(e){return!!this.checkPredicate(e)&&(this.advance(),!0)}checkSelector(){return this.checkPredicate(Ue)}matchSelector(){return this.matchPredicate(Ue)}checkAnySelector(){return this.checkPredicate(Fe)}checkLiteral(){return this.checkPredicate(Ke)}checkIdentifierLike(){return this.checkPredicate(De)}checkIsCommand(){return this.checkPredicate(ze)}checkCommandTerminator(){return this.checkPredicate(lt)}checkReference(){return this.checkPredicate(Ze)}checkTimeExpression(){return this.checkPredicate(Xe)}checkEvent(){return this.checkPredicate(He)}checkContextVar(){return this.checkPredicate(Be)}checkComment(){return this.checkPredicate(Je)}checkIdentifier(){return this.checkPredicate(Ye)}checkKeyword(){return this.checkPredicate(Ve)}checkString(){return this.checkPredicate(Qe)}matchString(){return this.matchPredicate(Qe)}checkNumber(){return this.checkPredicate(et)}matchNumber(){return this.matchPredicate(et)}checkBoolean(){return this.checkPredicate(tt)}matchBoolean(){return this.matchPredicate(tt)}checkTemplateLiteral(){return this.checkPredicate(rt)}matchTemplateLiteral(){return this.matchPredicate(rt)}checkQueryReference(){return this.checkPredicate(nt)}matchQueryReference(){return this.matchPredicate(nt)}checkIdSelector(){return this.checkPredicate(it)}checkClassSelector(){return this.checkPredicate(at)}checkCssSelector(){return this.checkPredicate(st)}checkBasicOperator(){return this.checkPredicate(ot)}matchBasicOperator(){return this.matchPredicate(ot)}matchTimeExpression(){return this.matchPredicate(Xe)}matchIdentifierLike(){return this.matchPredicate(De)}matchComparisonOperator(){return this.matchPredicate(We)}consumePredicate(e,t){return this.checkPredicate(e)?this.advance():(this.addError(t),this.peek())}consumeIdentifier(e){return this.consumePredicate(Ye,e)}consumeIdentifierLike(e){return this.consumePredicate(De,e)}consumeEvent(e){return this.consumePredicate(He,e)}advance(){return this.isAtEnd()||this.current++,this.previous()}isAtEnd(){return this.current>=this.tokens.length}peek(){return this.isAtEnd()?{kind:"unknown",value:"",start:0,end:0,line:1,column:1}:this.tokens[this.current]}peekAt(e){const t=this.current+e;return t>=0&&this.tokens.length>t?this.tokens[t]:null}previous(){return this.tokens[this.current-1]}consume(e,t){return this.check(e)?this.advance():(this.addError(t),this.peek())}addError(e){const t=this.peek();let r=t.start||0,n=t.line||1,i=t.column||1;if(e.includes("property name after '.'")){const e=this.current>0?this.previous():t;r=e.end||e.start||0,n=e.line||1,i=e.column||1}if(e.includes("parenthes")){const e=this.current>0?this.previous():t;r=e.end||e.start||0,n=e.line||1,i=e.column||1,0===r&&this.current>0&&(r=this.current)}if(e.includes("Expected expression after")){const e=this.current>0?this.previous():t;r=e.start||0,n=e.line||1,i=e.column||1,0===r&&(r=Math.max(1,this.current-1))}if(e.includes("Missing operand")){let e=t;for(let t=this.current-1;t>=0;t--){const r=this.tokens[t];if(r&&("+"===r.value||"-"===r.value)){e=r;break}}r=e.start||0,n=e.line||1,i=e.column||1}this.error={message:e,line:Math.max(1,n),column:Math.max(1,i),position:Math.max(0,r)},this.errors.push(this.error)}synchronizeToCommandBoundary(){for(;!this.isAtEnd();){const e=this.peek();if("then"===e.value||"end"===e.value||"on"===e.value)return;if(this.checkIsCommand()||this.isCommand(e.value)&&!this.isKeyword(e.value))return;pe("\u26a0\ufe0f synchronize: Skipping token:",e.value),this.advance()}}parseAttributeOrArrayLiteral(){const e=this.previous().start,t=this.previous().line,r=this.previous().column;if(!this.isAtEnd()&&this.peek().value.startsWith("@")){const n=[];for(;!this.check("]")&&!this.isAtEnd();){const e=this.advance();n.push(e.value)}this.consume("]","Expected ']' after attribute literal");const i=n.join("");if(!i.includes("="))return{type:"attributeAccess",attributeName:i.replace(/^@/,""),start:e,end:this.previous().end,line:t,column:r};const a="["+i+"]";return{type:"literal",value:a,raw:a,start:e,end:this.previous().end,line:t,column:r}}const n=new Set(["=","~=","|=","^=","$=","*="]),i=this.tokens[this.current],a=this.tokens[this.current+1];if("identifier"===i?.kind&&("]"===a?.value||a&&n.has(a.value)&&"string"===this.tokens[this.current+2]?.kind)){let e="["+this.advance().value;if(this.check("]"))this.advance(),e+="]";else{const t=this.advance().value,r=this.advance().value;e+=t+'"'+(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r)+'"',this.consume("]","Expected ']' after attribute selector"),e+="]"}return this.createSelector(e)}const s=[];if(!this.check("]"))do{if(this.check("]"))break;s.push(this.parseExpression())}while(this.match(","));return this.consume("]","Expected ']' after array elements"),{type:"arrayLiteral",elements:s,start:e,end:this.previous().end,line:t,column:r}}getPosition(){const e=this.current>0?this.previous():this.peek();return{start:e.start||0,end:e.end||0,line:e.line||1,column:e.column||1}}getContext(){const e=this,t={tokens:this.tokens,advance:this.advance.bind(this),peek:this.peek.bind(this),previous:this.previous.bind(this),consume:this.consume.bind(this),check:this.check.bind(this),checkIdentifierLike:this.checkIdentifierLike.bind(this),checkSelector:this.checkSelector.bind(this),checkAnySelector:this.checkAnySelector.bind(this),checkLiteral:this.checkLiteral.bind(this),checkReference:this.checkReference.bind(this),checkTimeExpression:this.checkTimeExpression.bind(this),checkEvent:this.checkEvent.bind(this),checkIsCommand:this.checkIsCommand.bind(this),checkContextVar:this.checkContextVar.bind(this),match:this.match.bind(this),matchOperator:this.matchOperator.bind(this),isAtEnd:this.isAtEnd.bind(this),createIdentifier:this.createIdentifier.bind(this),parseExpression:this.parseExpression.bind(this),parsePrimary:this.parsePrimary.bind(this),parseLogicalAnd:this.parseLogicalAnd.bind(this),parseCSSObjectLiteral:this.parseCSSObjectLiteral.bind(this),parseCommand:this.parseCommand.bind(this),parseCommandSequence:this.parseCommandSequence.bind(this),parseCommandListUntilEnd:this.parseCommandListUntilEnd.bind(this),parseCommandListUntilEndOrElse:this.parseCommandListUntilEndOrElse.bind(this),parseRepeatBody:this.parseRepeatBody.bind(this),getPosition:this.getPosition.bind(this),addError:this.addError.bind(this),addWarning:this.addWarning.bind(this),isCommand:this.isCommand.bind(this),isCompoundCommand:this.isCompoundCommand.bind(this),isKeyword:this.isKeyword.bind(this),getMultiWordPattern:this.getMultiWordPattern.bind(this),resolveKeyword:this.resolveKeyword.bind(this),savePosition:()=>e.current,restorePosition:t=>{e.current=t},peekAt:t=>e.peekAt(t),getInputSlice:(e,t)=>this.originalInput?0>e||e>=this.originalInput.length?"":void 0!==t?this.originalInput.slice(e,t):this.originalInput.slice(e):""};return Object.defineProperty(t,"current",{get:()=>e.current,set:t=>{e.current=t},enumerable:!0,configurable:!0}),t}}function er(e,t){const r=function(e){const t={input:"",position:0,line:1,column:1,tokens:[]};t.input=e;const r=e.length;for(;r>t.position&&(B(t),r>t.position);){const r=e[t.position];if("-"!==r||"-"!==V(t,1))if('"'!==r){if("'"===r||"'"===r){const e=V(t,1),r=t.tokens[t.tokens.length-1];if("s"!==e||!r||/\s/.test(t.input[t.position-1]??" ")||r.kind!==$.IDENTIFIER&&r.kind!==$.SELECTOR&&"]"!==r.value&&")"!==r.value&&"}"!==r.value)U(t);else{const e=t.position;H(t),H(t),W(t,$.OPERATOR,"'s",e)}continue}if("`"!==r)if("<"!==r)if("#"!==r){if("."===r){if("."===V(t,1)){const e=t.position;H(t),H(t),W(t,$.OPERATOR,"..",e);continue}const e=t.tokens[t.tokens.length-1],r=new Set(["from","to","into","on","in","at","between","first","last","next","previous","closest","random","of","some","no"]),n=e&&e.kind===$.IDENTIFIER&&k.has(e.value.toLowerCase()),i=e&&e.kind===$.IDENTIFIER&&r.has(e.value.toLowerCase());if((!e||e.kind===$.OPERATOR&&")"!==e.value&&"]"!==e.value||n||i||"("===e.value||"["===e.value||"{"===e.value||","===e.value||";"===e.value)&&(!e||e.end!==t.position)&&(te(V(t))||"{"===V(t)||"-"===V(t))){Z(t);continue}}if("@"!==r)if("{"!==r)if("}"!==r){if("["===r){const e=t.tokens[t.tokens.length-1],r=e&&e.kind===$.IDENTIFIER&&R.has(e.value)&&t.tokens.length>=2&&"on"===t.tokens[t.tokens.length-2]?.value;(!e||e.kind!==$.IDENTIFIER&&")"!==e.value&&"]"!==e.value||r)&&r?(H(t),W(t,$.SYMBOL,"[")):(H(t),W(t,$.OPERATOR,"["));continue}if("]"!==r){if("$"===r){const e=V(t,1);if(e>="a"&&"z">=e||e>="A"&&"Z">=e||"_"===e){ee(t);continue}}ae(r)?J(t):"0">r||r>"9"?("a">r||r>"z")&&("A">r||r>"Z")&&"_"!==r?(W(t,$.UNKNOWN,r),H(t)):Q(t):Y(t)}else H(t),W(t,$.OPERATOR,"]")}else H(t),W(t,$.OPERATOR,"}");else H(t),W(t,$.OPERATOR,"{");else G(t)}else Z(t);else ie(t)?X(t):J(t);else K(t)}else U(t);else F(t)}return t.tokens}(e);return new Qt(r,t,e).parse()}Qt.POSTFIX_UNARY_OPERATORS=new Set(["exists","does not exist","is empty","is not empty","ignoring case"]),Qt.PRATT_TABLE=Ae,Qt.PSEUDO_COMMAND_PREPOSITIONS=["from","on","with","into","at","to"];class tr{constructor(){this.hooks=new Map,this.beforeExecuteHooks=[],this.afterExecuteHooks=[],this.onErrorHooks=[],this.interceptCommandHooks=[]}register(e,t){this.unregister(e),this.hooks.set(e,t),t.beforeExecute&&this.beforeExecuteHooks.push(t.beforeExecute),t.afterExecute&&this.afterExecuteHooks.push(t.afterExecute),t.onError&&this.onErrorHooks.push(t.onError),t.interceptCommand&&this.interceptCommandHooks.push(t.interceptCommand)}unregister(e){const t=this.hooks.get(e);if(!t)return!1;if(t.beforeExecute){const e=this.beforeExecuteHooks.indexOf(t.beforeExecute);e>-1&&this.beforeExecuteHooks.splice(e,1)}if(t.afterExecute){const e=this.afterExecuteHooks.indexOf(t.afterExecute);e>-1&&this.afterExecuteHooks.splice(e,1)}if(t.onError){const e=this.onErrorHooks.indexOf(t.onError);e>-1&&this.onErrorHooks.splice(e,1)}if(t.interceptCommand){const e=this.interceptCommandHooks.indexOf(t.interceptCommand);e>-1&&this.interceptCommandHooks.splice(e,1)}return this.hooks.delete(e)}has(e){return this.hooks.has(e)}async runBeforeExecute(e){for(const t of this.beforeExecuteHooks)await t(e)}async runAfterExecute(e,t){for(const r of this.afterExecuteHooks)await r(e,t)}async runOnError(e,t){let r=t;for(const t of this.onErrorHooks){const n=await t(e,r);n instanceof Error&&(r=n)}return r}shouldIntercept(e,t){for(const r of this.interceptCommandHooks)if(r(e,t))return!0;return!1}getRegisteredNames(){return Array.from(this.hooks.keys())}clear(){this.hooks.clear(),this.beforeExecuteHooks=[],this.afterExecuteHooks=[],this.onErrorHooks=[],this.interceptCommandHooks=[]}}function rr(e){return e instanceof Error&&("isHalt"in e||"isExit"in e||"isBreak"in e||"isContinue"in e||"isReturn"in e)?e:null}function nr(e){return{ok:!0,value:e}}function ir(e){return{ok:!1,error:e}}function ar(e){return!0===e.ok}const sr=new Map,or=new WeakMap;function lr(e){let t=or.get(e);return t||(t=new Map,or.set(e,t)),t}function cr(e){return e.owner||(e.me instanceof Element?e.me:null)}function ur(e,t){const r=cr(e);if(r)return $e(t,e),lr(r).get(t)}function dr(e,t,r){const n=cr(e);n&&(lr(n).set(t,r),Me(t,r,e))}function mr(e,t){return{me:e??null,owner:e??null,it:null,you:null,result:null,locals:new Map,globals:t||sr,flags:{halted:!1,breaking:!1,continuing:!1,returning:!1,async:!1}}}function pr(e){if(!e)return mr();if(e.locals instanceof Map&&e.globals instanceof Map&&e.flags)return e;const t=mr(e.me instanceof Element?e.me:null);return void 0!==e.it&&(t.it=e.it),void 0!==e.you&&(t.you=e.you),void 0!==e.result&&(t.result=e.result),void 0!==e.event&&Object.assign(t,{event:e.event}),t}function hr(e){return null!==e&&"object"==typeof e&&"nodeType"in e&&1===e.nodeType&&"tagName"in e&&"string"==typeof e.tagName&&"classList"in e}function fr(e){if(null===e||"object"!=typeof e)return!1;const t=e.nodeType;return 1===t||3===t||11===t}function yr(e){return null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(Symbol.iterator in e||"function"==typeof e.item)}function gr(e){if(null==e)return 0;if("number"==typeof e)return isFinite(e)?e:0;if("string"==typeof e)return parseFloat(e);if("boolean"==typeof e)return e?1:0;if(Array.isArray(e))return e.length;if("object"==typeof e){if("length"in e&&"number"==typeof e.length)return e.length;if("function"==typeof e.valueOf){const t=e.valueOf();if("number"==typeof t)return t}return NaN}return 0}function vr(e,t,r){return"element"===r?ur(t,e):"global"===r&&t.globals&&t.globals.has(e)?t.globals.get(e):"global"!==r&&t.locals&&t.locals.has(e)?($e(e,t),t.locals.get(e)):t.globals&&t.globals.has(e)?t.globals.get(e):t.variables&&t.variables.has(e)?t.variables.get(e):"global"===r&&t.locals&&t.locals.has(e)?($e(e,t),t.locals.get(e)):"undefined"!=typeof window&&e in window?window[e]:"undefined"!=typeof globalThis&&e in globalThis?globalThis[e]:void 0}function br(e,t,r,n){if("element"!==n){if("global"===n)return _e(r,e,t),void("undefined"!=typeof window&&(window[e]=t));if(e.startsWith("$"))return void _e(r,e.slice(1),t);if(r.locals&&r.locals.has(e))return r.locals.set(e,t),void Me(e,t,r);if(r.globals&&r.globals.has(e))return _e(r,e,t),void("undefined"!=typeof window&&e in window&&(window[e]=t));if(r.variables&&r.variables.has(e))r.variables.set(e,t);else{if("undefined"!=typeof window&&e in window)return window[e]=t,void _e(r,e,t);r.locals.set(e,t),Me(e,t,r)}}else dr(r,e,t)}function wr(e,t){return"me"===e?t.me:"it"===e?t.it:"you"===e?t.you:vr(e,t)}function kr(e,t,r){return r||"string"!=typeof t||!t.startsWith("#")?e:Array.isArray(e)?e[0]??null:e}function Er(e){if("undefined"==typeof document)throw Error("DOM not available");const t=Array.from(document.querySelectorAll(e)).filter(e=>hr(e));if(!t.length)throw Error(`No elements: "${e}"`);return t}function xr(e){if(hr(e))return[e];if(Array.isArray(e)){const t=e.filter(hr);return t.length>0?t:null}if("undefined"!=typeof NodeList&&e instanceof NodeList){const t=Array.from(e).filter(hr);return t.length>0?t:null}return null}const Cr=new class{constructor(e={}){this.types=new Map,this.coercionCache=new Map,this.config={strictMode:!1,cacheCoercions:!0,...e},this.registerBuiltinTypes()}register(e){this.types.has(e.name)&&console.warn(`ExpressionTypeRegistry: Overwriting existing type '${e.name}'`),this.types.set(e.name,e)}get(e){return this.types.get(e)}has(e){return this.types.has(e)}getTypeNames(){return Array.from(this.types.keys())}inferType(e){for(const[t,r]of this.types)if(r.isType(e))return t;return"Unknown"}getHyperScriptType(e){const t=this.inferType(e),r=this.types.get(t);return r?.hyperscriptType??"unknown"}coerce(e,t,r){const n=this.types.get(t);if(!n){if(this.config.strictMode)throw Error("Unknown target type: "+t);return null}if(n.isType(e))return e;if(this.config.cacheCoercions){const r=`${this.inferType(e)}:${t}:${JSON.stringify(e)}`;if(this.coercionCache.has(r))return this.coercionCache.get(r)}const i=this.inferType(e),a=n.coerceFrom?.[i];if(a){const n=a(e,r);if(this.config.cacheCoercions&&null!==n){const r=`${i}:${t}:${JSON.stringify(e)}`;this.coercionCache.set(r,n)}return n}return n.defaultValue}canCoerce(e,t){const r=this.types.get(t);if(!r)return!1;if(r.isType(e))return!0;const n=this.inferType(e);return void 0!==r.coerceFrom?.[n]}getCoercionInfo(e,t){const r=this.types.get(t);return r&&(e===t||r.coerceFrom?.[e])?{possible:!0,direct:!0}:{possible:!1,direct:!1}}clearCache(){this.coercionCache.clear()}getStats(){return{typeCount:this.types.size,cacheSize:this.coercionCache.size,typeNames:this.getTypeNames()}}registerBuiltinTypes(){this.register({name:"String",hyperscriptType:"string",tsType:"string",isType:e=>"string"==typeof e,defaultValue:"",description:"Text string value",examples:["hello","world",""],coerceFrom:{Number:e=>e+"",Boolean:e=>e+"",Null:()=>"",Undefined:()=>"",Array:e=>Array.isArray(e)?e.join(", "):null,Object:e=>{try{return JSON.stringify(e)}catch{return e+""}},Element:e=>e instanceof Element?e.textContent??e.outerHTML:null}}),this.register({name:"Number",hyperscriptType:"number",tsType:"number",isType:e=>"number"==typeof e&&!isNaN(e),defaultValue:0,description:"Numeric value (integer or float)",examples:[0,1,3.14,-42],coerceFrom:{String:e=>{const t=parseFloat(e);return isNaN(t)?null:t},Boolean:e=>e?1:0,Null:()=>0,Undefined:()=>null}}),this.register({name:"Boolean",hyperscriptType:"boolean",tsType:"boolean",isType:e=>"boolean"==typeof e,defaultValue:!1,description:"True or false value",examples:[!0,!1],coerceFrom:{String:e=>{const t=e.toLowerCase().trim();return"true"===t||"yes"===t||"1"===t||"false"!==t&&"no"!==t&&"0"!==t&&""!==t&&t.length>0},Number:e=>0!==e,Null:()=>!1,Undefined:()=>!1,Array:e=>!!Array.isArray(e)&&e.length>0,Element:e=>e instanceof Element,ElementList:e=>Array.isArray(e)&&e.length>0}}),this.register({name:"Element",hyperscriptType:"element",tsType:"Element | HTMLElement",isType:e=>e instanceof Element,defaultValue:null,description:"DOM Element",coerceFrom:{String:(e,t)=>{const r=e;if(r.startsWith("#")||r.startsWith(".")||r.match(/^[\w-]+$/))try{return document.querySelector(r)}catch{return null}return null},ElementList:e=>Array.isArray(e)&&e.length>0?e[0]:null,NodeList:e=>e.length>0?e[0]:null}}),this.register({name:"ElementList",hyperscriptType:"element-list",tsType:"Element[]",isType:e=>Array.isArray(e)&&e.length>0&&e.every(e=>e instanceof Element),defaultValue:[],description:"Array of DOM Elements",coerceFrom:{Element:e=>e instanceof Element?[e]:[],NodeList:e=>Array.from(e),String:e=>{try{return Array.from(document.querySelectorAll(e))}catch{return[]}},Array:e=>{const t=e;return t.every(e=>e instanceof Element)?t:[]}}}),this.register({name:"Array",hyperscriptType:"array",tsType:"unknown[]",isType:e=>Array.isArray(e),defaultValue:[],description:"Array of values",coerceFrom:{String:e=>{const t=e;try{const e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return t.split(",").map(e=>e.trim())},ElementList:e=>e,NodeList:e=>Array.from(e),Object:e=>Object.values(e)}}),this.register({name:"Object",hyperscriptType:"object",tsType:"Record<string, unknown>",isType:e=>!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof Element),defaultValue:{},description:"Plain JavaScript object",coerceFrom:{String:e=>{try{const t=JSON.parse(e);if("object"==typeof t&&null!==t&&!Array.isArray(t))return t}catch{}return null},Array:e=>{const t={};return e.forEach((e,r)=>{t[r+""]=e}),t}}}),this.register({name:"Null",hyperscriptType:"null",tsType:"null",isType:e=>null===e,defaultValue:null,description:"Null value"}),this.register({name:"Undefined",hyperscriptType:"undefined",tsType:"undefined",isType:e=>void 0===e,defaultValue:void 0,description:"Undefined value"}),this.register({name:"Function",hyperscriptType:"function",tsType:"Function",isType:e=>"function"==typeof e,defaultValue:null,description:"JavaScript function"}),this.register({name:"Event",hyperscriptType:"event",tsType:"Event",isType:e=>e instanceof Event,defaultValue:null,description:"DOM Event"}),this.register({name:"NodeList",hyperscriptType:"element-list",tsType:"NodeList",isType:e=>e instanceof NodeList,defaultValue:null,description:"DOM NodeList (typically from querySelectorAll)",coerceFrom:{Array:e=>null}}),this.register({name:"Unknown",hyperscriptType:"unknown",tsType:"unknown",isType:e=>!0,defaultValue:null,description:"Unknown/any value type"})}};function Ar(e){const t=Cr.get("String");return t?t.isType(e):"string"==typeof e}function Sr(e){const t=Cr.get("Number");return t?t.isType(e):"number"==typeof e}function Tr(e){const t=Cr.get("Boolean");return t?t.isType(e):"boolean"==typeof e}function Lr(e){const t=Cr.get("Object");return t?t.isType(e):"object"==typeof e&&null!==e}function Or(e){const t=Cr.get("Function");return t?t.isType(e):"function"==typeof e}function jr(e){return null!==e&&"object"==typeof e&&"nodeType"in e&&1===e.nodeType&&"style"in e}function Pr(e){return e instanceof Element}function Ir(e){return e instanceof HTMLElement}const qr=new Set(["disabled","readonly","required","checked","selected","hidden","open","autofocus","autoplay","controls","loop","muted","multiple","reversed","defer","async","novalidate","formnovalidate","ismap"]);function Nr(e,t){return qr.has(t.toLowerCase())?e.hasAttribute(t):e.getAttribute(t)}const Rr={id:e=>e.id,classname:e=>e.className,class:e=>e.className,tagname:e=>e.tagName.toLowerCase(),innertext:e=>e.textContent?.trim(),innerHTML:e=>e.innerHTML,outerhtml:e=>e.outerHTML,value:e=>function(e){if(null===e||"object"!=typeof e||!("tagName"in e))return!1;const t=e.tagName;return"INPUT"===t||"SELECT"===t||"TEXTAREA"===t}(e)?e.value:void 0,checked:e=>function(e){return null!==e&&"object"==typeof e&&"tagName"in e&&"INPUT"===e.tagName}(e)?e.checked:void 0,disabled:e=>"disabled"in e?e.disabled:void 0,selected:e=>function(e){return null!=e&&"object"==typeof e&&"tagName"in e&&"OPTION"===e.tagName}(e)?e.selected:void 0,tabindex:e=>jr(e)?e.tabIndex:void 0,hidden:e=>jr(e)?e.hidden:void 0,style:e=>getComputedStyle(e),children:e=>Array.from(e.children),parent:e=>e.parentElement,firstchild:e=>e.firstElementChild,lastchild:e=>e.lastElementChild,nextsibling:e=>e.nextElementSibling,previoussibling:e=>e.previousElementSibling,next:e=>e.nextElementSibling,previous:e=>e.previousElementSibling,values:e=>function(e){if(e instanceof HTMLFormElement)return new FormData(e);const t=new FormData;return e.querySelectorAll("input, select, textarea").forEach(e=>{const r=e.getAttribute("name");r&&"value"in e&&t.append(r,e.value)}),t}(e)};function Mr(e,t){if(t.startsWith("*"))return function(e,t){if(!Ir(e))return;if(t.startsWith("computed-"))return getComputedStyle(e).getPropertyValue(t.slice(9))||"";const r=t.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());return e.style[r]}(e,t.slice(1));if(t.startsWith("computed-")){const r=t.slice(9);return Ir(e)?getComputedStyle(e).getPropertyValue(r):void 0}if(t.startsWith("@"))return Nr(e,t.slice(1));const r=Rr[t.toLowerCase()];if(r)return r(e);if(function(e,t){return e.hasAttribute(t)}(e,t))return Nr(e,t);const n=e[t];return Or(n)?n.bind(e):n}const $r={1:"one",2:"two",3:"three",4:"four",5:"five"};function _r(e,t,r,n){if(e.length!==t){return`${r} requires exactly ${i=t,$r[i]??i+""} argument${1===t?"":"s"}${n?` (${n})`:""}`}var i;return null}function zr(e,t,r,n){return"string"!=typeof e[t]?`${r} ${n||"argument "+(t+1)} must be a string`:null}function Vr(e,t,r){return _r(e,1,t,r)??zr(e,0,t,r)}function Hr(e,t){return _r(e,2,t,"left, right")}function Br(){return null}function Wr(e,t,r,n){return e.length>t?`${r} expression takes at most ${1===t?"one":t+""} argument${1===t?"":"s"}${n?` (${n})`:""}`:null}function Dr(e,t,r,n,i){return t>e.length||e.length>r?`${n} requires ${t}-${r} arguments${i?` (${i})`:""}`:null}const Fr={conversions:{dynamicResolvers:[]}},Ur={Array:e=>Array.isArray(e)?e:e instanceof NodeList?Array.from(e):null==e?[]:[e],String:e=>null==e?"":Ar(e)?e:Lr(e)?JSON.stringify(e):e+"",Boolean:e=>{if(Tr(e))return e;if(null==e)return!1;if(Ar(e)){const t=e.toLowerCase().trim();return"false"!==t&&"0"!==t&&""!==t}return Sr(e)?0!==e&&!isNaN(e):!!e},Number:e=>{if(Sr(e))return e;if(null==e)return 0;const t=Number(e);return isNaN(t)?0:t},Math:e=>{if(Sr(e))return e;if(null==e)return 0;const t=(e+"").trim();if(!t)return 0;try{return function(e){if(e=e.replace(/\s/g,""),!/^[0-9+\-*/().]+$/.test(e))throw Error("Invalid characters in math expression");try{const t=Function(`"use strict"; return (${e})`)();if(!Sr(t)||!isFinite(t))throw Error("Expression did not evaluate to a finite number");return t}catch(e){throw Error("Math expression evaluation failed: "+(e instanceof Error?e.message:e+""))}}(t)}catch(e){return console.warn("Math conversion failed:",e),0}},Int:e=>{const t=Ur.Number(e);return Math.trunc(t)},Float:e=>{const t=Ur.Number(e);return parseFloat(""+t)},Date:e=>{if(e instanceof Date)return e;if(null==e)return new Date(NaN);if(Ar(e)&&/^\d{4}-\d{2}-\d{2}$/.test(e)){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}return new Date(e)},JSON:e=>{if(!Ar(e))return e;try{return JSON.parse(e)}catch{return e}},JSONString:e=>{try{return JSON.stringify(e)}catch{return"{}"}},Object:e=>{if(Lr(e))return e;if(Ar(e))try{return JSON.parse(e)}catch(e){return{}}return{}},Fragment:e=>{const t=document.createDocumentFragment(),r=Array.isArray(e)||e instanceof NodeList?Array.from(e):[e];for(const e of r)if(e instanceof Node)t.append(e);else{const r=document.createElement("template");r.innerHTML=null==e?"":e+"",t.append(r.content)}return t},HTML:e=>Ar(e)?e:e instanceof NodeList?Array.from(e).map(e=>e instanceof Element?e.outerHTML:e.textContent||"").join(""):Array.isArray(e)?e.map(e=>e instanceof Element?e.outerHTML:Ur.String(e)).join(""):e instanceof Element?e.outerHTML:Ur.String(e),Values:(e,t)=>{if(e instanceof HTMLFormElement)return function(e){const t={};return e.querySelectorAll("input, select, textarea").forEach(e=>{const r=e;if(r.name){const e=Kr(r);void 0!==e&&(void 0!==t[r.name]?(Array.isArray(t[r.name])||(t[r.name]=[t[r.name]]),t[r.name].push(e)):t[r.name]=e)}}),t}(e);if(e instanceof HTMLElement){const t=e.querySelectorAll("input, select, textarea"),r={};return t.forEach(e=>{e.name&&(r[e.name]=Kr(e))}),r}return{}},FormEncoded:(e,t)=>{const r=e instanceof HTMLElement?Ur.Values(e,t):e;if(!Lr(r))return"";const n=new URLSearchParams;for(const[e,t]of Object.entries(r))if(null!=t)if(Array.isArray(t))for(const r of t)n.append(e,r+"");else n.append(e,t+"");return""+n},Set:e=>new Set(e),Map:e=>new Map(Object.entries(e??{})),Keys:e=>e instanceof Map?Array.from(e.keys()):Object.keys(e??{}),Entries:e=>e instanceof Map?Array.from(e.entries()):Object.entries(e??{}),Reversed:e=>Array.from(e).reverse(),Unique:e=>[...new Set(e)],Flat:e=>Array.from(e).flat(),"Values:Form":(e,t)=>{const r=Ur.Values(e,t);return Ur.FormEncoded(r,t)},"Values:JSON":(e,t)=>{const r=Ur.Values(e,t);return JSON.stringify(r)}};function Kr(e){if(e instanceof HTMLInputElement)switch(e.type){case"checkbox":return e.checked;case"radio":return e.checked?e.value:void 0;case"number":case"range":return e.valueAsNumber;case"date":case"datetime-local":return e.valueAsDate;case"file":return e.files;default:return e.value}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions).map(e=>e.value):e.value}const Zr={boolean:"Boolean",bool:"Boolean",string:"String",str:"String",number:"Number",num:"Number",int:"Int",integer:"Int",float:"Float",array:"Array",object:"Object",obj:"Object",date:"Date",json:"JSON",jsonstring:"JSONString",formencoded:"FormEncoded"};function Xr(e,t,r){if("string"!=typeof t)throw Error("Conversion type must be a string");if(t.startsWith("Fixed")){const{precision:r}=function(e){const t=e.match(/^Fixed(?::(\d+))?$/);return t?{precision:t[1]?parseInt(t[1],10):0}:{}}(t);return Ur.Number(e).toFixed(r??0)}if(null==e)return e;let n=Ur[t];if(n)return n(e,r);const i=Zr[t.toLowerCase()];if(i&&(n=Ur[i],n))return n(e,r);const a=Fr.conversions[t];if("function"==typeof a)return a(e,r);for(const r of Fr.conversions.dynamicResolvers){const n=r(t,e);if(void 0!==n)return n}return console.warn("Unknown conversion type: "+t),e}const Gr={as:{name:"as",category:"Conversion",evaluatesTo:"Any",precedence:20,associativity:"Left",operators:["as"],async evaluate(e,...t){const[r,n]=t;return Xr(r,n,e)},validate:e=>_r(e,2,"as","value, type")??zr(e,1,"as","conversion type")},is:{name:"is",category:"Conversion",evaluatesTo:"Boolean",precedence:10,associativity:"Left",operators:["is a","is an"],async evaluate(e,...t){const[r,n]=t;if(!Ar(n))throw Error("Type check requires a string type");switch(n.toLowerCase()){case"null":return null===r;case"undefined":return void 0===r;case"string":return Ar(r);case"number":return Sr(r)&&!isNaN(r);case"boolean":return Tr(r);case"object":return Lr(r);case"array":return Array.isArray(r);case"function":return Or(r);case"date":return r instanceof Date;case"element":return r instanceof Element;case"node":return r instanceof Node;case"nodelist":return r instanceof NodeList;case"empty":return null==r||""===r||Array.isArray(r)&&0===r.length||Lr(r)&&0===Object.keys(r).length;default:return r?.constructor?.name?.toLowerCase()===n.toLowerCase()}},validate:e=>_r(e,2,"is","value, type")??zr(e,1,"is","type")},async:{name:"async",category:"Conversion",evaluatesTo:"Any",precedence:25,associativity:"Right",operators:["async"],evaluate:async(e,t)=>t,validate:e=>_r(e,1,"async","expression")}},Jr=new Set(["__proto__","constructor","prototype"]);function Yr(e,t){if(e instanceof Element)return Mr(e,t);if(Lr(e)){if(Jr.has(t))return;return e[t]}return e[t]}function Qr(e){let t;if(Array.isArray(e))t=e;else{if(!("undefined"!=typeof NodeList&&e instanceof NodeList||"undefined"!=typeof HTMLCollection&&e instanceof HTMLCollection))return!1;t=Array.from(e)}return 0!==t.length&&t.every(e=>e instanceof Element||null!=e&&"object"==typeof e&&e.constructor!==Object&&!Array.isArray(e))}const en={possessive:{name:"possessive",category:"Reference",evaluatesTo:"Any",operators:["'s","s"],async evaluate(e,...t){const[r,n]=t;if(null!=r){if("string"!=typeof n)throw Error("Property name must be a string");return Qr(r)&&!(n in r)?Array.from(r,e=>Yr(e,n)):Yr(r,n)}},validate:e=>_r(e,2,"possessive","element, property")??zr(e,1,"possessive","property name")},my:{name:"my",category:"Reference",evaluatesTo:"Any",operators:["my"],async evaluate(e,...t){const[r]=t;if(e.me){if("string"!=typeof r)throw Error("Property name must be a string");if(e.me instanceof Element)return Mr(e.me,r);if(Lr(e.me)){if(Jr.has(r))return;return e.me[r]}return e.me[r]}},validate:e=>Vr(e,"my","property")},its:{name:"its",category:"Reference",evaluatesTo:"Any",operators:["its"],async evaluate(e,...t){const[r]=t;if(null==e.it)return;if("string"!=typeof r)throw Error("Property name must be a string");const n=e.it;if(n instanceof Element)return Mr(n,r);if(Lr(n)){if(Jr.has(r))return;return n[r]}return n[r]},validate:e=>Vr(e,"its","property")},your:{name:"your",category:"Reference",evaluatesTo:"Any",operators:["your"],async evaluate(e,...t){const[r]=t;if(e.you){if("string"!=typeof r)throw Error("Property name must be a string");if(e.you instanceof Element)return Mr(e.you,r);if(Lr(e.you)){if(Jr.has(r))return;return e.you[r]}return e.you[r]}},validate:e=>Vr(e,"your","property")},of:{name:"of",category:"Reference",evaluatesTo:"Any",operators:["of"],async evaluate(e,...t){const[r,n]=t;if(null!=n){if("string"!=typeof r)throw Error("Property name must be a string");if(n instanceof Element)return Mr(n,r);if(Lr(n)){if(Jr.has(r))return;return n[r]}return n[r]}},validate:e=>_r(e,2,"of","property, object")??zr(e,0,"of","property name")},attribute:{name:"attribute",category:"Reference",evaluatesTo:"String",operators:["@"],async evaluate(e,...t){const[r,n]=t;if("string"!=typeof r)throw Error("Attribute name must be a string");const i=n||e.me;return i&&i instanceof Element?i.getAttribute(r):null},validate:e=>Dr(e,1,2,"attribute","attributeName, optional element")??zr(e,0,"attribute","attribute name")??(2>e.length||null==e[1]||e[1]instanceof Element?null:"attribute element must be an Element")},attributeWithValue:{name:"attributeWithValue",category:"Reference",evaluatesTo:"Boolean",operators:["@="],async evaluate(e,...t){const[r,n,i]=t;if("string"!=typeof r)throw Error("Attribute name must be a string");if("string"!=typeof n)throw Error("Expected value must be a string");const a=i||e.me;return!!(a&&a instanceof Element)&&a.getAttribute(r)===n},validate:e=>Dr(e,2,3,"attributeWithValue","attributeName, expectedValue, optional element")??zr(e,0,"attributeWithValue","attribute name")??zr(e,1,"attributeWithValue","expected value")??(3>e.length||null==e[2]||e[2]instanceof Element?null:"attributeWithValue element must be an Element")},classReference:{name:"classReference",category:"Reference",evaluatesTo:"Array",operators:["."],async evaluate(e,...t){const[r]=t;if("string"!=typeof r)throw Error("Class name must be a string");const n=r.startsWith(".")?r.slice(1):r,i=document.getElementsByClassName(n);return Array.from(i)},validate:e=>Vr(e,"classReference","className")},idReference:{name:"idReference",category:"Reference",evaluatesTo:"Element",operators:["#"],async evaluate(e,...t){const[r]=t;if("string"!=typeof r)throw Error("ID value must be a string");const n=r.startsWith("#")?r.slice(1):r;return document.getElementById(n)},validate:e=>Vr(e,"idReference","idValue")}};function tn(e){return Array.isArray(e)?e:null==e?[]:"string"==typeof e?[e]:e instanceof NodeList||e instanceof HTMLCollection||"number"==typeof e.length?Array.from(e):[e]}function rn(e,t){const r=e.registry?.get(t);if(!r)throw Error(`Expression '${t}' not in ExecutionContext.registry. The bundle's ExpressionRegistry must include this expression's category. Use createExpressionRegistry() with the relevant category objects (referencesExpressions, logicalExpressions, conversionExpressions, positionalExpressions, propertiesExpressions, specialExpressions, mathematicalExpressions).`);return r}function nn(e){if(e&&"object"==typeof e&&"success"in e){if(e.success)return"value"in e?e.value:void 0;const t=e.errors||[];throw Error(t.length>0?t[0].message:"Expression evaluation failed")}return e}async function an(e,t){if(!e)throw Error("Cannot evaluate null or undefined AST node");if("literal"===e.type)return e.value;if("identifier"===e.type)return mn(e,t);const r=e;switch(e.type){case"literal":return function(e){return e.value}(r);case"identifier":return mn(r,t);case"binaryExpression":return async function(e,t){const r=e.operator,n=e.right,i=e.left;if("="===r){const r=await an(e.right,t);if("identifier"===i?.type&&"string"==typeof i.name){const e=i.name;return e.startsWith("$")?_e(t,e.slice(1),r):"global"===i.scope?_e(t,e,r):"element"===i.scope?dr(t,e,r):(t.locals||(t.locals=new Map),t.locals.set(e,r)),r}throw Error(`Assignment target must be a variable identifier (got '${i?.type??"undefined"}')`)}if("has"===r||"have"===r){const r=await an(e.left,t);return!!(r instanceof Element&&"selector"===n.type&&"string"==typeof n.value&&n.value.startsWith("."))&&r.classList.contains(n.value.slice(1))}if("in"===r||"is in"===r){const r="callExpression"===i?.type&&"identifier"===i.callee?.type?i.callee.name:null;if(("first"===r||"last"===r)&&Array.isArray(i.arguments)){const n=i.arguments[0];if("selector"===n?.type&&"string"==typeof n.value){const i=await an(e.right,t);if(i&&"function"==typeof i.querySelectorAll){const e=Array.from(i.querySelectorAll(n.value));return 0===e.length?null:"first"===r?e[0]:e[e.length-1]}}}if("selector"===i?.type&&i.fromQuery&&"string"==typeof i.value){const r=await an(e.right,t),n=r&&"function"==typeof r.querySelectorAll?r:null;if(n)return Array.from(n.querySelectorAll(i.value))}}if("of"===r&&"selector"===i?.type&&"string"==typeof i.value&&/^\*[a-zA-Z][\w-]*$/.test(i.value)){const r=await an(e.right,t);return rn(t,"styleRef").evaluate(t,i.value.slice(1),r)}if("of"===r){const r=pn(e.left);if(r){const n=await an(e.right,t);let i=n;for(const e of r){if(null==i)return;i=Pr(i)?Mr(i,e):i[e]}return"function"==typeof i?i.bind(n):i}}const a=await an(e.left,t);if("and"===r){if(!a)return a;const r=await an(e.right,t);return rn(t,"and").evaluate(t,a,r)}if("or"===r){if(a)return a;const r=await an(e.right,t);return rn(t,"or").evaluate(t,a,r)}const s=await an(e.right,t),o=e=>"string"==typeof e?e.toLowerCase():e,l=e.ignoringCase?o(a):a,c=e.ignoringCase?o(s):s;switch(r){case"+":{let r=a,n=s;return e.coerceNumeric&&("string"==typeof r&&(r=gr(r)),"string"==typeof n&&(n=gr(n))),"string"==typeof r||"string"==typeof n?(r??"")+""+(n??""):Array.isArray(r)?Array.isArray(n)?[...r,...n]:[...r,n]:nn(await rn(t,"addition").evaluate(t,{left:r,right:n}))}case"-":return nn(await rn(t,"subtraction").evaluate(t,{left:a,right:s}));case"*":return nn(await rn(t,"multiplication").evaluate(t,{left:a,right:s}));case"/":return nn(await rn(t,"division").evaluate(t,{left:a,right:s}));case"%":case"mod":return nn(await rn(t,"modulo").evaluate(t,{left:a,right:s}));case"^":case"**":return nn(await rn(t,"power").evaluate(t,{left:a,right:s}));case">":case"is greater than":return rn(t,"greaterThan").evaluate(t,a,s);case"<":case"is less than":return rn(t,"lessThan").evaluate(t,a,s);case">=":case"is greater than or equal to":return rn(t,"greaterThanOrEqual").evaluate(t,a,s);case"<=":case"is less than or equal to":return rn(t,"lessThanOrEqual").evaluate(t,a,s);case"==":return rn(t,"equals").evaluate(t,l,c);case"is":case"am":case"equals":case"is equal":case"is equal to":{const r=yn(e,a,s);return void 0!==r?r:rn(t,"equals").evaluate(t,l,c)}case"!=":return rn(t,"notEquals").evaluate(t,l,c);case"is not":case"is not equal":case"is not equal to":{const r=yn(e,a,s);return void 0!==r?!r:rn(t,"notEquals").evaluate(t,l,c)}case"===":case"really equals":case"is really":case"is really equal to":return rn(t,"strictEquals").evaluate(t,l,c);case"!==":case"is not really":case"is not really equal to":return rn(t,"strictNotEquals").evaluate(t,l,c);case"as":return rn(t,"as").evaluate(t,a,vn(s));case"contains":case"contain":case"includes":case"include":return rn(t,"contains").evaluate(t,l,c);case"does not contain":case"do not contain":case"does not contains":case"does not include":return rn(t,"doesNotContain").evaluate(t,l,c);case"starts with":return rn(t,"startsWith").evaluate(t,l,c);case"ends with":return rn(t,"endsWith").evaluate(t,l,c);case"does not start with":return!await rn(t,"startsWith").evaluate(t,l,c);case"does not end with":return!await rn(t,"endsWith").evaluate(t,l,c);case"match":case"matches":return rn(t,"matches").evaluate(t,l,fn(e.right,c));case"does not match":case"do not match":return!await rn(t,"matches").evaluate(t,l,fn(e.right,c));case"in":case"is in":case"am in":return hn(a,s);case"is not in":case"am not in":return!hn(a,s);case"of":return s&&"object"==typeof s?s[a]:void 0;case"precedes":return gn(a,s,Node.DOCUMENT_POSITION_FOLLOWING);case"does not precede":return!gn(a,s,Node.DOCUMENT_POSITION_FOLLOWING);case"follows":return gn(a,s,Node.DOCUMENT_POSITION_PRECEDING);case"does not follow":return!gn(a,s,Node.DOCUMENT_POSITION_PRECEDING);default:throw Error("Unknown binary operator: "+r)}}(r,t);case"asExpression":return async function(e,t){const r=await an(e.expression,t),n=vn(e.targetType);return rn(t,"as").evaluate(t,r,n)}(r,t);case"betweenExpression":return async function(e,t){const r=await an(e.value,t),n=await an(e.min,t),i=await an(e.max,t),a=e=>"string"==typeof e?e.toLowerCase():e,[s,o,l]=e.ignoringCase?[a(r),a(n),a(i)]:[r,n,i],c=await rn(t,"between").evaluate(t,s,o,l);return e.negated?!c:c}(r,t);case"typeCheckExpression":return async function(e,t){const r=function(e,t,r){if(null==e&&r)return!0;if(Object.prototype.toString.call(e).slice(8,-1)===t)return!0;const n=globalThis[t];return"function"==typeof n&&e instanceof n}(await an(e.value,t),e.typeName+"",!1!==e.nullOk);return e.negated?!r:r}(r,t);case"collectionExpression":return async function(e,t){const r=await an(e.collection,t);if(null==r)return r;const n=async(e,r)=>an(e,{...t,it:r});switch(e.operator){case"where":return async function(e,t,r){const n=tn(e),i=[];for(const e of n)await r(t,e)&&i.push(e);return i}(r,e.right,n);case"sorted by":return async function(e,t,r,n){const i=[...tn(e)],a=await Promise.all(i.map(e=>n(t,e))),s=i.map((e,t)=>t);s.sort((e,t)=>{const r=a[e],n=a[t];return r===n?0:null==r?1:null==n||n>r?-1:1});const o=s.map(e=>i[e]);return"desc"===r?o.reverse():o}(r,e.right,e.order??"asc",n);case"mapped to":return async function(e,t,r){const n=tn(e);return Promise.all(n.map(e=>r(t,e)))}(r,e.right,n);case"split by":return a=await an(e.right,t),null==(i=r)?[]:(i+"").split(null==a?"":a+"");case"joined by":return function(e,t){const r=null==t?"":t+"";return tn(e).map(e=>null==e?"":e+"").join(r)}(r,await an(e.right,t));default:throw Error("Unknown collection operator: "+e.operator)}var i,a}(r,t);case"unaryExpression":return async function(e,t){const r=e.operand??e.argument;if(!r)throw Error(`Unary expression has no operand (operator: ${e.operator})`);const n=await an(r,t);switch(e.operator){case"not":case"!":return rn(t,"not").evaluate(t,n);case"no":return rn(t,"no").evaluate(t,n);case"-":return-n;case"+":return+n;case"exists":case"some":return rn(t,"exists").evaluate(t,n);case"does not exist":return rn(t,"doesNotExist").evaluate(t,n);case"is empty":return rn(t,"isEmpty").evaluate(t,n);case"is not empty":return rn(t,"isNotEmpty").evaluate(t,n);default:throw Error("Unknown unary operator: "+e.operator)}}(r,t);case"memberExpression":return async function(e,t){const r=await an(e.object,t);if(e.computed){const n=await an(e.property,t);return Array.isArray(r)&&"number"==typeof n&&0>n?r[r.length+n]:r?.[n]}return En(r,e.property.name,t)}(r,t);case"propertyAccess":return async function(e,t){let r=await an(e.object,t);for(const n of(e.property+"").split(".")){if(null==r)return;r=await En(r,n,t)}return r}(r,t);case"callExpression":return async function(e,t){const r=await an(e.callee,t);if(e.isConstructor&&"function"==typeof r)return new r(...await Promise.all(e.arguments.map(e=>an(e,t))));if("identifier"===e.callee.type){const n=e.callee.name,i=await async function(e,t,r){return xn.has(t)?Promise.all(e.map(e=>"identifier"===e.type&&e.name?e.name:"selector"===e.type&&e.value?e.value:an(e,r))):Promise.all(e.map(e=>an(e,r)))}(e.arguments,n,t);switch(n){case"closest":return rn(t,"closest").evaluate(t,...i);case"previous":case"next":{const r=e.relativePositional;if(r){const e=r.from?Cn(await an(r.from,t)):t.me,a=r.within?Cn(await an(r.within,t)):void 0,s=r.inElt?await an(r.inElt,t):void 0;return rn(t,n).evaluate(t,i[0],e,{within:a,inElt:s,inSearch:r.inSearch,wrapping:r.wrapping})}return rn(t,n).evaluate(t,...i)}case"first":return rn(t,"first").evaluate(t,...i);case"last":return rn(t,"last").evaluate(t,...i);default:if("function"==typeof r)return r(...i);throw Error("Cannot call non-function: "+n)}}if("function"==typeof r){const n=await Promise.all(e.arguments.map(e=>an(e,t)));if("memberExpression"===e.callee.type&&e.callee.object){const i=await an(e.callee.object,t);return r.apply(i,n)}return r(...n)}throw Error("Cannot call non-function")}(r,t);case"selector":return async function(e,t){let r=e.value;if("string"==typeof r&&!e.fromQuery&&/^\*[a-zA-Z][\w-]*$/.test(r))return rn(t,"styleRef").evaluate(t,r.slice(1));if("string"==typeof r&&e.fromQuery&&/\$[^=]/.test(r)){const{selector:n,elements:i}=await async function(e,t){const r=On(e),n=await Promise.all(r.filter(e=>"expr"in e).map(e=>cn(e.expr,t)));return jn(r,n)}(r,t),a=Tn(e,n);i.forEach((e,t)=>e.setAttribute("data-hs-query-id",t+""));try{return await rn(t,"elementWithSelector").evaluate(t,a)}finally{i.forEach(e=>e.removeAttribute("data-hs-query-id"))}}"string"==typeof r&&!e.fromQuery&&r.includes("{")&&(r=await function(e,t){return kn(e,/\{([^}]*)\}/g,async(e,r)=>(await cn(r.trim(),t)??"")+"")}(r,t));const n="string"==typeof r?Tn(e,r):r;return kr(await rn(t,"elementWithSelector").evaluate(t,n),r,e.fromQuery)}(r,t);case"contextReference":return async function(e,t){switch(e.contextType){case"me":case"you":case"it":return rn(t,e.contextType).evaluate(t);case"my":case"myself":case"I":return rn(t,"me").evaluate(t);case"your":case"yourself":return rn(t,"you").evaluate(t);case"its":return rn(t,"it").evaluate(t);case"event":return t.event;case"target":return t.target??t.event?.target??rn(t,"me").evaluate(t);case"body":return"undefined"!=typeof document?document.body:void 0;case"document":return rn(t,"document").evaluate(t);case"window":return rn(t,"window").evaluate(t);default:return}}(r,t);case"possessiveExpression":return async function(e,t){const r=await an(e.object,t),n=e.property.name;return rn(t,"possessive").evaluate(t,r,n)}(r,t);case"eventHandler":return async function(e,t){return{event:e.event,selector:e.selector,commands:e.commands,handler:async r=>{const n={...t,event:r,target:r.target,currentTarget:r.currentTarget};for(const t of e.commands)await an(t,n)}}}(r,t);case"conditionalExpression":return async function(e,t){return await an(e.test,t)?an(e.consequent,t):e.alternate?an(e.alternate,t):void 0}(r,t);case"string":return r.value;case"arrayLiteral":return async function(e,t){const r=[];for(const n of e.elements)r.push(await an(n,t));return r}(r,t);case"objectLiteral":return async function(e,t){const r={};for(const n of e.properties){const e=n.key;let i;i="identifier"===e.type?e.name:"literal"===e.type&&"string"===e.valueType?e.value:await an(e,t)+"",r[i]=await an(n.value,t)}return r}(r,t);case"attributeAccess":return async function(e,t){const r=e.attributeName;return t.me&&t.me instanceof Element?t.me.getAttribute(r):"@"+r}(r,t);case"propertyOfExpression":return async function(e,t){const r=e.property;if("identifier"!==r?.type)throw Error('Property name must be an identifier in "the X of Y" pattern');const n=r.name,i=await an(e.target,t);if(null==i)throw Error(`Cannot access property "${n}" of ${i}`);return rn(t,"possessive").evaluate(t,i,n)}(r,t);case"templateLiteral":return async function(e,t){let r=e.value;return r=await kn(r,/\$([a-zA-Z_$][a-zA-Z0-9_.$]*|\d+)/g,async(e,r)=>{try{if(/^\d+$/.test(r))return r;if(r.includes(".")){const e=r.split(".");let n=wn(e[0],t);for(let t=1;e.length>t&&null!=n;t++)n=n[e[t]];return(n??"")+""}return(wn(r,t)??"")+""}catch{return""}}),r=await kn(r,/\$(?:\{([^}]+)\}|\(([^)]+)\))/g,async(e,r,n)=>{const i=r||n;try{return await cn(i,t)+""}catch{return"undefined"}}),r}(r,t);case"stringPostfix":return async function(e,t){return`${await an(e.expression,t)}${e.unit}`}(r,t);case"blockLiteral":return bn(r,t);default:{const r=Te.get(e.type);if(r)return r(e,t);throw Error("Unknown AST node type: "+e.type)}}}class sn extends Error{constructor(e){super(`Expression node "${e}" is not synchronously evaluable`),this.name="NotSyncEvaluable"}}function on(e,t){const r=e;switch(r?.type){case"literal":case"string":return r.value;case"selector":return function(e,t){const r=e.value;if("string"!=typeof r)throw new sn("selector");if(!e.fromQuery&&/^\*[a-zA-Z][\w-]*$/.test(r))throw new sn("selector");if(e.fromQuery&&/\$[^=]/.test(r)){const{selector:n,elements:i}=function(e,t){const r=On(e),n=r.filter(e=>"expr"in e).map(e=>ln(e.expr,t));return jn(r,n)}(r,t),a=Tn(e,n),s=t?.me?.ownerDocument??("undefined"!=typeof document?document:null);if(!s)throw new sn("selector");i.forEach((e,t)=>e.setAttribute("data-hs-query-id",t+""));try{return Array.from(s.querySelectorAll(a))}finally{i.forEach(e=>e.removeAttribute("data-hs-query-id"))}}const n=!e.fromQuery&&r.includes("{")?function(e,t){return e.replace(/\{([^}]*)\}/g,(e,r)=>(ln(r.trim(),t)??"")+"")}(r,t):r,i=Tn(e,n),a=t?.me?.ownerDocument??("undefined"!=typeof document?document:null);if(!a)throw new sn("selector");return kr(Array.from(a.querySelectorAll(i)),n,e.fromQuery)}(r,t);case"identifier":return function(e,t,r){return"me"===e||"my"===e||"I"===e?t.me:"you"===e||"your"===e||"yourself"===e?t.you:"it"===e||"its"===e?t.it??t.result:"result"===e?t.result??t.it:"window"===e?"undefined"!=typeof window?window:globalThis:"document"===e?"undefined"!=typeof document?document:void 0:"element"===r?ur(t,e):t.locals?.has(e)?t.locals.get(e):t.globals?.has(e)?t.globals.get(e):e.startsWith("$")&&t.globals?.has(e.slice(1))?t.globals.get(e.slice(1)):void 0!==t[e]?t[e]:"undefined"!=typeof globalThis&&e in globalThis?globalThis[e]:void 0}(r.name,t,r.scope);case"contextReference":return function(e,t){switch(e){case"me":return t.me;case"you":return t.you;case"it":return t.it??t.result;case"event":return t.event;case"target":return t.target??t.event?.target??t.me;default:throw new sn("contextReference")}}(r.contextType,t);case"arrayLiteral":return r.elements.map(e=>on(e,t));case"objectLiteral":return function(e,t){const r={};for(const n of e.properties){const e=n.key;let i;i="identifier"===e.type?e.name:"literal"===e.type&&"string"===e.valueType?e.value:on(e,t)+"",r[i]=on(n.value,t)}return r}(r,t);case"asExpression":return Xr(on(r.expression,t),vn(r.targetType),t);case"stringPostfix":return`${on(r.expression,t)}${r.unit}`;case"blockLiteral":return bn(r,t);case"memberExpression":{const e=on(r.object,t);if(null==e)return;if(e instanceof Element||Array.isArray(e)||"undefined"!=typeof Node&&e instanceof Node)throw new sn("memberExpression");const n=e[r.computed?on(r.property,t)+"":r.property?.name];return"function"==typeof n?n.bind(e):n}default:throw new sn(r?.type??"unknown")}}function ln(e,t){const r=er(e);if(!r.success||!r.node){const e=r.error??r.errors?.[0];throw Error("Failed to parse expression: "+(e?.message??"unknown error"))}return on(r.node,t)}async function cn(e,t){const r=er(e);if(!r.success||!r.node){const e=r.error??r.errors?.[0];throw Error("Failed to parse expression: "+(e?.message??"unknown error"))}const n=t.registry?t:{...t,registry:await dn()};return an(r.node,n)}let un=null;async function dn(){if(!un){const e=await Promise.resolve().then(function(){return lu});un=e.createFullExpressionRegistry()}return un}async function mn(e,t){const r=e.name;return r.startsWith("$")?Re(r.slice(1),t):"global"===e.scope&&Re(r,t),"me"===r||"my"===r||"I"===r?rn(t,"me").evaluate(t):"you"===r||"your"===r||"yourself"===r?rn(t,"you").evaluate(t):"it"===r||"its"===r?rn(t,"it").evaluate(t):"result"===r?rn(t,"result").evaluate(t):"window"===r?rn(t,"window").evaluate(t):"document"===r?rn(t,"document").evaluate(t):"global"===e.scope&&t.globals?.has(r)?t.globals.get(r):"element"===e.scope?ur(t,r):t.locals&&t.locals.has(r)?($e(r,t),t.locals.get(r)):t.globals&&t.globals.has(r)?t.globals.get(r):r.startsWith("$")&&t.globals&&t.globals.has(r.slice(1))?t.globals.get(r.slice(1)):void 0!==t[r]?t[r]:"undefined"!=typeof globalThis&&r in globalThis?globalThis[r]:void 0}function pn(e){const t=e;if(!t)return null;if("identifier"===t.type&&"string"==typeof t.name)return[t.name];if("memberExpression"===t.type&&!t.computed){const e=pn(t.object);if(!e)return null;const r=t.property,n="identifier"===r?.type&&"string"==typeof r.name?r.name:"string"==typeof r?.value?r.value:null;return null==n?null:[...e,n]}return null}function hn(e,t){return Array.isArray(t)?t.includes(e):"string"==typeof t?t.includes(e+""):e instanceof Node&&t instanceof Node?e===t||t.contains(e):null!=t&&"object"==typeof t&&e in t}function fn(e,t){return e&&"selector"===e.type&&"string"==typeof e.value?e.value:t}function yn(e,t,r){if(void 0!==r)return;const n=e.right;if(!n||"identifier"!==n.type||"string"!=typeof n.name)return;if(null==t||"object"!=typeof t)return;const i=t[n.name];return"boolean"==typeof i?!0===i:void 0}function gn(e,t,r){return e instanceof Node&&t instanceof Node&&0!==(e.compareDocumentPosition(t)&r)}function vn(e){if("string"==typeof e)return e;if(e&&"object"==typeof e){if("string"==typeof e.name)return e.name;if("string"==typeof e.value)return e.value}return e+""}function bn(e,t){const r=e.parameters??[];return(...n)=>{const i=new Map(t.locals??new Map);r.forEach((e,t)=>i.set(e,n[t]));const a={...t,locals:i};try{return on(e.body,a)}catch(t){if(t instanceof sn)return an(e.body,a);throw t}}}function wn(e,t){if(t.locals?.has(e))return $e(e,t),t.locals.get(e);if("me"===e&&t.me)return t.me;if("you"===e&&t.you)return t.you;if("it"===e){const e=t.it??t.result;if(e)return e}if("result"===e){const e=t.result??t.it;if(e)return e}return"undefined"!=typeof window&&"window"===e?window:t.globals?.has(e)?t.globals.get(e):void 0}async function kn(e,t,r){const n=[];let i;for(;null!==(i=t.exec(e));)n.push({index:i.index,length:i[0].length,replacement:await r(i[0],...i.slice(1))});let a=e;for(let e=n.length-1;e>=0;e--){const{index:t,length:r,replacement:i}=n[e];a=a.substring(0,t)+i+a.substring(t+r)}return a}function En(e,t,r){if("string"==typeof t&&t.startsWith("@")){const r=t.substring(1);return e&&"function"==typeof e.getAttribute?e.getAttribute(r):void 0}return e instanceof Element&&"string"==typeof t?Mr(e,t):Qr(e)&&!(t in e)?rn(r,"possessive").evaluate(r,e,t):e?.[t]}const xn=new Set(["closest","previous","next"]);function Cn(e){return e instanceof Element?e:Array.isArray(e)&&e[0]instanceof Element?e[0]:void 0}const An=RegExp("(\\.[a-zA-Z0-9_-]+):(?!(hover|active|focus|visited|link|focus-within|focus-visible|first-child|last-child|only-child|nth-child|nth-last-child|nth-of-type|nth-last-of-type|first-of-type|last-of-type|only-of-type|empty|root|target|lang|dir|not|has|is|where|matches|before|after|first-letter|first-line|selection|placeholder|marker|backdrop|enabled|disabled|checked|indeterminate|required|optional|valid|invalid|in-range|out-of-range|read-only|read-write|default|defined|fullscreen|modal|picture-in-picture|autofill)(?![a-zA-Z0-9_-]))","g"),Sn=/[:&()[\]/]/g;function Tn(e,t){return e.fromQuery||!t.startsWith(".")||t.includes("{")?function(e){return e.replace(An,"$1\\:")}(t):function(e){return e[0]+e.slice(1).replace(Sn,"\\$&")}(t)}const Ln=/\$\{([^}]+)\}|\$([a-zA-Z_$][a-zA-Z0-9_.$]*)/g;function On(e){const t=[];let r,n=0;for(Ln.lastIndex=0;null!==(r=Ln.exec(e));)r.index>n&&t.push({lit:e.slice(n,r.index)}),t.push({expr:r[1]??r[2]}),n=r.index+r[0].length;return e.length>n&&t.push({lit:e.slice(n)}),t}function jn(e,t){let r="";const n=[];let i=0;for(const a of e){if("lit"in a){r+=a.lit;continue}const e=t[i++];Pr(e)?(r+=`[data-hs-query-id='${n.length}']`,n.push(e)):r+=(e??"")+""}return{selector:r,elements:n}}class Pn{constructor(e){this.elementCleanups=new WeakMap,this.elementCount=0,this.typeCounts={listener:0,observer:0,interval:0,timeout:0,custom:0},this.globalCleanups=[],this.debugMode=e?.debug??!1}registerListener(e,t,r,n,i){this.addCleanup(e,{type:"listener",target:t,eventName:r,cleanup:()=>{t.removeEventListener(r,n,i),this.debugMode&&he(`CleanupRegistry: Removed listener '${r}'`)},description:r+" listener"})}registerObserver(e,t){this.addCleanup(e,{type:"observer",cleanup:()=>{t.disconnect(),this.debugMode&&he("CleanupRegistry: Disconnected MutationObserver")},description:"MutationObserver"})}registerInterval(e,t){this.addCleanup(e,{type:"interval",cleanup:()=>{clearInterval(t),this.debugMode&&he("CleanupRegistry: Cleared interval")},description:"Interval"})}registerTimeout(e,t){this.addCleanup(e,{type:"timeout",cleanup:()=>{clearTimeout(t),this.debugMode&&he("CleanupRegistry: Cleared timeout")},description:"Timeout"})}registerCustom(e,t,r){this.addCleanup(e,{type:"custom",cleanup:t,description:r||"Custom cleanup"})}registerGlobal(e,t="custom",r){this.globalCleanups.push({type:t,cleanup:e,description:r||"Global cleanup"}),this.debugMode&&he("CleanupRegistry: Registered global cleanup: "+(r||t))}addCleanup(e,t){const r=this.elementCleanups.get(e);r?r.push(t):(this.elementCleanups.set(e,[t]),this.elementCount++),this.typeCounts[t.type]++,this.debugMode&&he(`CleanupRegistry: Registered ${t.type} for element`,e)}cleanupElement(e){const t=this.elementCleanups.get(e);if(!t||0===t.length)return 0;let r=0;for(const e of t){try{e.cleanup(),r++}catch(e){this.debugMode&&he("CleanupRegistry: Error during cleanup:",e)}this.typeCounts[e.type]--}return this.elementCleanups.delete(e),this.elementCount--,this.debugMode&&he(`CleanupRegistry: Cleaned up ${r} resources for element`),r}cleanupElementTree(e){let t=this.cleanupElement(e);const r=e.querySelectorAll("*");for(const e of r)t+=this.cleanupElement(e);return t}cleanupGlobal(){let e=0;for(const t of this.globalCleanups)try{t.cleanup(),e++}catch(e){this.debugMode&&he("CleanupRegistry: Error during global cleanup:",e)}return this.globalCleanups=[],this.debugMode&&he(`CleanupRegistry: Cleaned up ${e} global resources`),e}cleanupAll(){return this.cleanupGlobal()}hasCleanups(e){const t=this.elementCleanups.get(e);return void 0!==t&&t.length>0}getCleanupCount(e){const t=this.elementCleanups.get(e);return t?.length??0}getStats(){let e=0,t=0,r=0,n=0,i=0;for(const a of this.globalCleanups)switch(a.type){case"listener":e++;break;case"observer":t++;break;case"interval":r++;break;case"timeout":n++;break;case"custom":i++}return{elementsTracked:this.elementCount,listeners:this.typeCounts.listener+e,observers:this.typeCounts.observer+t,intervals:this.typeCounts.interval+r,timeouts:this.typeCounts.timeout+n,custom:this.typeCounts.custom+i,global:this.globalCleanups.length}}setDebugMode(e){this.debugMode=e}}class In{constructor(){this.sources=new Map,this.subscriptions=new Map,this.nextId=1}register(e,t){const r=e.toLowerCase();this.sources.has(r)&&he("[EventSourceRegistry] Overwriting existing event source: "+e),this.sources.set(r,t)}unregister(e){const t=e.toLowerCase(),r=this.sources.get(t);if(r){for(const[e,r]of this.subscriptions.entries())r.source===t&&(r.unsubscribe(),this.subscriptions.delete(e));return r.destroy?.(),this.sources.delete(t)}return!1}get(e){return this.sources.get(e.toLowerCase())}has(e){return this.sources.has(e.toLowerCase())}subscribe(e,t,r){const n=this.get(e);if(!n)return void he("[EventSourceRegistry] Unknown event source: "+e);n.initialize?.();const i=n.subscribe(t,r);return this.subscriptions.set(i.id,i),i}unsubscribe(e){const t=this.subscriptions.get(e);return!!t&&(t.unsubscribe(),this.subscriptions.delete(e))}getSourceNames(){return Array.from(this.sources.keys())}getSubscriptions(){return Array.from(this.subscriptions.values())}findSourceForEvent(e){for(const[t,r]of this.sources.entries())if(r.supports?.(e)??r.supportedEvents?.includes(e))return t}generateId(){return`sub_${this.nextId++}_${Date.now().toString(36)}`}destroy(){for(const e of this.subscriptions.values())e.unsubscribe();this.subscriptions.clear();for(const e of this.sources.values())e.destroy?.();this.sources.clear()}}class qn{constructor(){this.providers=new Map,this.globalProviders=new Map}register(e,t,r){const n=e.toLowerCase();this.providers.set(n,"function"==typeof t?{name:n,provide:t,cache:r?.cache??!0,description:r?.description,dependencies:r?.dependencies}:t)}registerGlobal(e,t,r){const n=e.toLowerCase();this.globalProviders.set(n,"function"==typeof t?{name:n,provide:t,cache:r?.cache??!0,description:r?.description,dependencies:r?.dependencies}:t)}unregister(e){return this.providers.delete(e.toLowerCase())}unregisterGlobal(e){return this.globalProviders.delete(e.toLowerCase())}get(e){const t=e.toLowerCase();return this.providers.get(t)??this.globalProviders.get(t)}has(e){const t=e.toLowerCase();return this.providers.has(t)||this.globalProviders.has(t)}async resolve(e,t,r){const n=this.get(e);if(!n)return;const i="__provider_"+n.name;if(n.cache&&r?.has(i))return r.get(i);if(n.dependencies)for(const e of n.dependencies)await this.resolve(e,t,r);const a=await n.provide(t);return n.cache&&r&&r.set(i,a),a}resolveSync(e,t,r){const n=this.get(e);if(!n)return;const i="__provider_"+n.name;if(n.cache&&r?.has(i))return r.get(i);const a=n.provide(t);if(a instanceof Promise)throw Error(`Context provider '${e}' is async. Use resolve() instead of resolveSync().`);return n.cache&&r&&r.set(i,a),a}enhance(e){const t=this,r=new Map;return new Proxy(e,{get(e,n,i){if("string"==typeof n&&t.get(n))try{return t.resolveSync(n,e,r)}catch{return t.resolve(n,e,r)}return Reflect.get(e,n,i)},has:(e,r)=>!("string"!=typeof r||!t.has(r))||Reflect.has(e,r)})}async resolveAll(e){const t=new Map,r={},n=[...this.globalProviders.entries(),...this.providers.entries()];for(const[i,a]of n)try{r[i]=await this.resolve(i,e,t)}catch(e){he(`[ContextProviderRegistry] Failed to resolve '${i}':`,e),r[i]=void 0}return r}getProviderNames(){return[...new Set([...this.globalProviders.keys(),...this.providers.keys()])]}clear(){this.providers.clear(),this.globalProviders.clear()}}const Nn={evaluate:(e,t)=>an(e,t)};class Rn{static toTyped(e){return{me:e.me,...void 0!==e.owner&&{owner:e.owner},it:e.it,you:e.you,result:e.result,...void 0!==e.event&&{event:e.event},variables:e.variables||new Map,locals:e.locals||new Map,globals:e.globals||new Map,...void 0!==e.events&&{events:e.events},meta:e.meta||{},...void 0!==e.registry&&{registry:e.registry},expressionStack:[],evaluationDepth:0,validationMode:"strict",evaluationHistory:[]}}static fromTyped(e,t){return{...t,me:e.me,it:e.it,you:e.you,result:e.result,...void 0!==e.event&&{event:e.event},...void 0!==e.variables&&{variables:e.variables},locals:e.locals,globals:e.globals,...void 0!==e.events&&{events:e.events},...void 0!==e.meta&&{meta:e.meta}}}}class Mn{constructor(e,t,r){this.impl=e,this.hookRegistry=r??null}setHookRegistry(e){this.hookRegistry=e}createHookContext(e,t,r={}){return{commandName:this.name,element:e.me instanceof Element?e.me:null,args:t,modifiers:r,event:e.event??void 0,executionContext:e}}get name(){const e=this.impl.name;if(e)return e;const t=this.impl.metadata?.name;return"string"==typeof t?t:""}get metadata(){const e=this.impl.metadata?.syntax;return{description:this.impl.metadata?.description||"",examples:this.impl.metadata?.examples||[],syntax:"string"==typeof e?e:e?e.join(" | "):""}}async execute(e,...t){const r=t[0],n=this.createHookContext(e,t,r&&"object"==typeof r&&"modifiers"in r&&r.modifiers||{});try{if(de(`CommandAdapterV2: Executing '${this.name}' with args:`,t),this.hookRegistry&&await this.hookRegistry.runBeforeExecute(n),this.hookRegistry?.shouldIntercept(this.name,n))return void de(`CommandAdapterV2: '${this.name}' intercepted by hook`);const i=Rn.toTyped(e);let a,s;if(this.impl.parseInput&&"function"==typeof this.impl.parseInput)if(de(`CommandAdapterV2: '${this.name}' has parseInput(), calling it`),r&&"object"==typeof r&&("args"in r||"modifiers"in r)){const t=r.modifiers,n=t?.when||t?.where;if(n&&!await an(n,e))return void de(`CommandAdapterV2: '${this.name}' skipped - when/where condition evaluated to false`);a=await this.impl.parseInput({args:r.args||[],modifiers:t||{},commandName:r.commandName},Nn,e)}else a=t;else de(`CommandAdapterV2: '${this.name}' has no parseInput(), using args as-is`),a=t;if(de("CommandAdapterV2: Calling execute with parsed input:",a),2===this.impl.execute.length)s=await this.impl.execute(a,i);else{const e=Array.isArray(a)?a:[a];s=await this.impl.execute(i,...e)}return de("CommandAdapterV2: Command result:",s),Object.assign(e,Rn.fromTyped(i,e)),this.hookRegistry&&await this.hookRegistry.runAfterExecute(n,s),s}catch(e){if(Bn(e)||de(`CommandAdapterV2: Error executing '${this.name}':`,e),this.hookRegistry&&e instanceof Error)throw await this.hookRegistry.runOnError(n,e);throw e}}validate(e){return{isValid:!this.impl.validate||this.impl.validate(e),errors:[],suggestions:[]}}}class $n{constructor(e,t){this.adapters=new Map,this.implementations=new Map,this.hookRegistry=t}setHookRegistry(e){this.hookRegistry=e;for(const t of this.adapters.values())t.setHookRegistry(e);he(`CommandRegistryV2: Hook registry set and propagated to ${this.adapters.size} adapters`)}getHookRegistry(){return this.hookRegistry}register(e){const t=e.name||e.metadata?.name;if(!t||"string"!=typeof t)throw Error("Cannot register command: no name found. Provide a 'name' property or 'metadata.name' on the implementation.");const r=t.toLowerCase();he(`CommandRegistryV2: Registering command '${r}'`),this.implementations.set(r,e);const n=new Mn(e,void 0,this.hookRegistry);this.adapters.set(r,n),k.add(r);const i=e.metadata?.aliases;if(i&&Array.isArray(i))for(const t of i){const r=t.toLowerCase();this.implementations.set(r,e),this.adapters.set(r,n),k.add(r)}}getAdapter(e){return this.adapters.get(e.toLowerCase())}has(e){return this.adapters.has(e.toLowerCase())}getCommandNames(){return Array.from(this.adapters.keys())}getImplementation(e){return this.implementations.get(e.toLowerCase())}getAdapters(){return new Map(this.adapters)}validateCommand(e,t){const r=this.getAdapter(e);return r?r.validate(t):{isValid:!1,errors:[{type:"runtime-error",message:"Unknown command: "+e,suggestions:["Available commands: "+this.getCommandNames().join(", ")]}],suggestions:["Available commands: "+this.getCommandNames().join(", ")]}}}let _n=null;function zn(){return _n||(_n=function(e){const t=e?.commands??new $n,r=e?.eventSources??new In,n=e?.context??new qn,i=new Set,a={commands:t,eventSources:r,context:n,use(e){if(i.has(e.name))he(`[LokaScriptRegistry] Plugin '${e.name}' is already installed`);else{if(e.commands)for(const r of e.commands)t.register(r);if(e.eventSources)for(const t of e.eventSources)r.register(t.name,t);if(e.contextProviders)for(const{name:t,provide:r,options:i}of e.contextProviders)n.register(t,r,i);e.setup?.(a),i.add(e.name)}},reset(){i.clear()}};return a}()),_n}class Vn{constructor(e={}){this.contextCache=new WeakMap;const t=zn();this.options={enableContextProviders:e.enableContextProviders??!0,enableEventSources:e.enableEventSources??!0,registry:e.registry??{}},this.contextRegistry=this.options.registry.context??t.context,this.eventSourceRegistry=this.options.registry.eventSources??t.eventSources,he(`[RegistryIntegration] Initialized (context=${this.options.enableContextProviders}, events=${this.options.enableEventSources})`)}enhanceContext(e){if(!this.options.enableContextProviders)return e;const t=this.contextCache.get(e);if(t)return t;try{const t=this.contextRegistry.enhance(e);return this.contextCache.set(e,t),he(`[RegistryIntegration] Enhanced context with ${this.contextRegistry.getProviderNames().length} providers`),t}catch(t){return he("[RegistryIntegration] Failed to enhance context: "+(t instanceof Error?t.message:t+"")),e}}getEventSource(e){if(!this.options.enableEventSources)return;const t=this.eventSourceRegistry.get(e);if(t)return he(`[RegistryIntegration] Found event source for '${e}'`),t;const r=this.eventSourceRegistry.findSourceForEvent(e);if(r){const t=this.eventSourceRegistry.get(r);return he(`[RegistryIntegration] Found event source '${r}' supporting '${e}'`),t}}hasEventSource(e){return void 0!==this.getEventSource(e)}subscribeToEventSource(e,t,r){if(!this.options.enableEventSources)throw Error("Event sources are disabled in this runtime");const n=this.eventSourceRegistry.subscribe(e,t,r);if(!n)throw Error(`Failed to subscribe to event source '${e}'`);return he(`[RegistryIntegration] Subscribed to '${e}' event '${t.event}' (id: ${n.id})`),n}getEventSourceNames(){return this.eventSourceRegistry.getSourceNames()}getContextProviderNames(){return this.contextRegistry.getProviderNames()}destroy(){this.eventSourceRegistry.destroy(),this.contextCache=new WeakMap,he("[RegistryIntegration] Destroyed")}}function Hn(e){const t=Error(e.type.toUpperCase()+"_EXECUTION");return t["is"+e.type.charAt(0).toUpperCase()+e.type.slice(1)]=!0,"returnValue"in e&&(t.returnValue=e.returnValue),t}function Bn(e){return e instanceof Error&&(null!==rr(e)||"HALT_EXECUTION"===e.message||"EXIT_COMMAND"===e.message||"EXIT_EXECUTION"===e.message)}function Wn(e){return null!==e&&"object"==typeof e&&"command"in e&&"selector"in e}const Dn=new WeakMap;function Fn(e,t=new Set){if(null===e||"object"!=typeof e)return t;if(Array.isArray(e)){for(const r of e)Fn(r,t);return t}const r=e;"identifier"===r.type&&"string"==typeof r.name&&t.add(r.name);for(const e of Object.keys(r))"start"!==e&&"end"!==e&&"line"!==e&&"column"!==e&&Fn(r[e],t);return t}class Un{constructor(e){this.autoCleanupObserver=null,this.registryIntegration=null,this.runtimeWarnings=[],this.options={commandTimeout:1e4,enableErrorReporting:!0,enableResultPattern:!0,enableAutoCleanup:!0,...e},this.registry=e.registry,this.expressionRegistry=e.expressionRegistry,this.behaviorRegistry=new Map,this.globalVariables=sr,this.hookRegistry=new tr,e.hooks&&this.hookRegistry.register("default",e.hooks),this.registry.setHookRegistry(this.hookRegistry),this.cleanupRegistry=new Pn,this.options.enableAutoCleanup&&this.setupAutoCleanup(),!1!==e.registryIntegration&&(this.registryIntegration=new Vn("object"==typeof e.registryIntegration?e.registryIntegration:{}),he("RuntimeBase: Registry integration enabled")),this.behaviorAPI={has:e=>this.behaviorRegistry.has(e),get:e=>this.behaviorRegistry.get(e),set:(e,t)=>this.behaviorRegistry.set(e,t),resolve:null,install:async(e,t,r)=>await this.installBehaviorOnElement(e,t,r)}}setupAutoCleanup(){"undefined"!=typeof MutationObserver&&"undefined"!=typeof document&&(this.autoCleanupObserver=new MutationObserver(e=>{const t=[];for(const r of e)for(const e of r.removedNodes)e instanceof Element&&t.push(e);t.length>0&&queueMicrotask(()=>{for(const e of t)if(!e.isConnected){const t=this.cleanupRegistry.cleanupElementTree(e);t>0&&he(`RuntimeBase: Auto-cleaned ${t} resources for removed element`)}})}),document.body?this.autoCleanupObserver.observe(document.body,{childList:!0,subtree:!0}):document.addEventListener("DOMContentLoaded",()=>{this.autoCleanupObserver?.observe(document.body,{childList:!0,subtree:!0})},{once:!0}))}registerHooks(e,t){this.hookRegistry.register(e,t)}unregisterHooks(e){return this.hookRegistry.unregister(e)}getRegisteredHooks(){return this.hookRegistry.getRegisteredNames()}cleanup(e){return this.cleanupRegistry.cleanupElement(e)}trackListener(e,t,r,n,i){this.cleanupRegistry.registerListener(e,t,r,n,i)}cleanupTree(e){return this.cleanupRegistry.cleanupElementTree(e)}getCleanupStats(){return this.cleanupRegistry.getStats()}getCleanupRegistry(){return this.cleanupRegistry}logError(...e){this.options.enableErrorReporting&&console.error(...e)}logWarn(...e){this.options.enableErrorReporting&&console.warn(...e)}destroy(){this.autoCleanupObserver&&(this.autoCleanupObserver.disconnect(),this.autoCleanupObserver=null),this.cleanupRegistry.cleanupAll(),this.hookRegistry.clear(),this.behaviorRegistry.clear(),he("RuntimeBase: Destroyed")}hasErrorDiagnostics(e){const t=e.diagnostics;return!!t?.some(e=>"error"===e.severity)}getWarnings(){return this.runtimeWarnings}async execute(e,t){he(`RUNTIME BASE: execute() called with node type: '${e.type}'`),t.registry||(t.registry=this.expressionRegistry),t.locals.has("_behaviors")||t.locals.set("_behaviors",this.behaviorAPI),t.locals.has("_runtimeExecute")||t.locals.set("_runtimeExecute",(e,r)=>this.execute(e,r||t));try{if(this.hasErrorDiagnostics(e)){const t=e.diagnostics?.[0];return he("\u26a0\ufe0f RUNTIME: Skipping error node: "+(t?.message||"unknown error")),void this.runtimeWarnings.push(t?.message||"Skipped error node")}switch(e.type){case"command":if(this.options.enableResultPattern){const r=await this.processCommandWithResult(e,t);if(!ar(r)){if("return"===r.error.type){const e=r.error.returnValue;return void 0!==e&&Object.assign(t,{it:e,result:e}),e}throw Hn(r.error)}return r.value}try{return await this.processCommand(e,t)}catch(e){const r=rr(e);if(r?.isReturn){const e=r.returnValue;return void 0!==e&&Object.assign(t,{it:e,result:e}),e}throw e}case"eventHandler":return await this.executeEventHandler(e,t);case"event":{const r={type:"eventHandler",event:e.event,events:[e.event],commands:e.body||[],target:e.filter,modifiers:e.modifiers||{}};return await this.executeEventHandler(r,t)}case"behavior":return await this.executeBehaviorDefinition(e,t);case"def":return this.installFunction(e,t);case"Program":return await this.executeProgram(e,t);case"initBlock":case"block":return await this.executeBlock(e,t);case"sequence":case"CommandSequence":if(this.options.enableResultPattern){const r=e,n=await this.executeCommandSequenceWithResult(r.commands||[],t);if(!ar(n))throw Hn(n.error);return n.value}return await this.executeCommandSequence(e,t);case"objectLiteral":return await this.executeObjectLiteral(e,t);default:if(this.options.enableResultPattern){const r=await this.evaluateExpressionWithResult(e,t);if(!ar(r))throw Hn(r.error);return r.value}return await this.evaluateExpression(e,t)}}catch(e){throw e}}async processCommand(e,t){const{name:r,args:n,modifiers:i}=e,a=r.toLowerCase();if(de(`RUNTIME BASE: Processing command '${a}'`),this.registry.has(a)){const e=await this.registry.getAdapter(a);if(!e)throw Error(`Command '${a}' is registered but failed to load adapter.`);try{return await e.execute(t,{args:n||[],modifiers:i||{},commandName:a,runtime:this})}catch(e){throw Bn(e)||this.logError(`Error executing command '${a}':`,e),e}}const s=`Unknown command: ${r}. Ensure it is registered in the Runtime options.`;throw this.logWarn(s),Error(s)}toSignal(e){const t=rr(e);if(t){if(t.isHalt||"HALT_EXECUTION"===t.message)return{type:"halt"};if(t.isExit||"EXIT_COMMAND"===t.message)return{type:"exit",returnValue:t.returnValue};if(t.isBreak)return{type:"break"};if(t.isContinue)return{type:"continue"};if(t.isReturn)return{type:"return",returnValue:t.returnValue}}if(e instanceof Error){if("HALT_EXECUTION"===e.message)return{type:"halt"};if("EXIT_COMMAND"===e.message)return{type:"exit"}}return null}async processCommandWithResult(e,t){const{name:r,args:n,modifiers:i}=e,a=r.toLowerCase();if(de(`RUNTIME BASE (Result): Processing command '${a}'`),!this.registry.has(a)){const e=`Unknown command: ${r}. Ensure it is registered in the Runtime options.`;throw this.logWarn(e),Error(e)}const s=await this.registry.getAdapter(a);if(!s)throw Error(`Command '${a}' is registered but failed to load adapter.`);try{return nr(await s.execute(t,{args:n||[],modifiers:i||{},commandName:a,runtime:this}))}catch(e){const t=this.toSignal(e);if(t)return ir(t);throw this.logError(`Error executing command '${a}':`,e),e}}async executeCommandSequenceWithResult(e,t){let r;for(const n of e){if(this.hasErrorDiagnostics(n)){const e=n.diagnostics?.[0];he("\u26a0\ufe0f RUNTIME: Skipping error node: "+(e?.message||"unknown error")),this.runtimeWarnings.push(e?.message||"Skipped error node");continue}if("command"===n.type){const e=await this.processCommandWithResult(n,t);if(!ar(e)){const r=e.error;switch(r.type){case"halt":case"exit":case"break":case"continue":return e;case"return":return void 0!==r.returnValue&&Object.assign(t,{it:r.returnValue,result:r.returnValue}),nr(r.returnValue)}}r=e.value}else{const e=await this.evaluateExpressionWithResult(n,t);if(!ar(e))return e;r=e.value}}return nr(r)}async evaluateExpression(e,t){const r=t.registry?t:{...t,registry:this.expressionRegistry},n=await an(e,r);return Wn(n)?await this.executeCommandFromPattern(n.command,n.selector,t):n}async evaluateExpressionWithResult(e,t){const r=t.registry?t:{...t,registry:this.expressionRegistry},n=await async function(e,t){try{return nr(await an(e,t))}catch(e){if(e instanceof Error){const t=e;if(t.isHalt||"HALT_EXECUTION"===t.message)return ir({type:"halt"});if(t.isExit||"EXIT_COMMAND"===t.message)return ir({type:"exit",returnValue:t.returnValue});if(t.isBreak)return ir({type:"break"});if(t.isContinue)return ir({type:"continue"});if(t.isReturn)return ir({type:"return",returnValue:t.returnValue})}throw e}}(e,r);if(!ar(n))return n;const i=n.value;if(Wn(i)){if(this.options.enableResultPattern)return this.processCommandWithResult({type:"command",name:i.command,args:[{type:"literal",value:i.selector}]},t);try{return nr(await this.executeCommandFromPattern(i.command,i.selector,t))}catch(e){const t=this.toSignal(e);if(t)return ir(t);throw e}}return nr(i)}async executeCommandFromPattern(e,t,r){return this.processCommand({type:"command",name:e,args:[{type:"literal",value:t}]},r)}installFunction(e,t){const r=this,n=e.params??[],i=e.body??[],a=e.errorHandler,s=e.finallyHandler,o=e.errorSymbol;t.globals.set(e.name,async(...e)=>{const l={...t,locals:new Map(t.locals)};n.forEach((t,r)=>{t&&l.locals.set(t,e[r])});const c=async e=>{const t=await r.executeCommandSequenceWithResult(e,l);if(!ar(t))throw rr(t.error);return t.value};if(!a&&!s)return await c(i);try{return await c(i)}catch(e){if(!a||Bn(e))throw e;return o&&l.locals.set(o,e),await c(a)}finally{s&&await c(s)}})}async executeProgram(e,t){if(!e.statements||!Array.isArray(e.statements))return;let r;const n=[],i=[],a=[],s=[];for(const t of e.statements)"eventHandler"===t.type?n.push(t):"def"===t.type?i.push(t):"initBlock"===t.type?a.push(t):s.push(t);for(const e of i)this.execute(e,t);for(const e of n)try{await this.execute(e,t)}catch(e){if(Bn(e)&&(e.isHalt||e.isExit))break;throw e}for(const e of a)try{r=await this.execute(e,t)}catch(e){if(Bn(e)&&(e.isHalt||e.isExit))break;throw e}for(const e of s)try{r=await this.execute(e,t)}catch(e){if(Bn(e)&&(e.isHalt||e.isExit))break;throw e}return r}async executeBlock(e,t){if(e.commands&&Array.isArray(e.commands))for(const r of e.commands)try{await this.execute(r,t)}catch(e){if(Bn(e)&&e.isHalt)break;throw e}}async executeCommandSequence(e,t){if(!e.commands||!Array.isArray(e.commands))return;let r;for(const n of e.commands)try{r=await this.execute(n,t)}catch(e){if(Bn(e)){if(e.isHalt||e.isExit)break;if(e.isReturn){if(void 0!==e.returnValue)return Object.assign(t,{it:e.returnValue,result:e.returnValue}),e.returnValue;break}if(e.isBreak)throw e}throw e}return r}async executeObjectLiteral(e,t){const r={};if(!e.properties)return r;for(const n of e.properties){let e;e="identifier"===n.key.type?n.key.name:"literal"===n.key.type?n.key.value+"":await this.execute(n.key,t)+"";const i=await this.execute(n.value,t);r[e]=i}return r}enhanceContext(e){return this.registryIntegration?this.registryIntegration.enhanceContext(e):e}async executeBehaviorDefinition(e,t){const{name:r,parameters:n=[],eventHandlers:i=[],initBlock:a}=e,s=e.imperativeInstaller;"function"==typeof s?(this.behaviorRegistry.set(r,{name:r,parameters:n,type:"imperative",install:s}),he(`RUNTIME BASE: Registered imperative behavior '${r}'`)):(this.behaviorRegistry.set(r,{name:r,parameters:n,eventHandlers:i,initBlock:a}),he(`RUNTIME BASE: Registered behavior '${r}'`))}async installBehaviorOnElement(e,t,r){he("BEHAVIOR: installBehaviorOnElement called: "+e);let n=this.behaviorRegistry.get(e);if(!n&&(this.behaviorAPI.resolve&&this.behaviorAPI.resolve(e)&&(n=this.behaviorRegistry.get(e)),!n))throw Error(`Behavior "${e}" not found`);if("imperative"===n.type)return void("function"==typeof n.install&&(he(`BEHAVIOR: Installing imperative behavior '${e}'`),n.install(t,r),he(`BEHAVIOR: Finished installing imperative behavior '${e}'`)));he("BEHAVIOR: Found behavior, eventHandlers count: "+(n.eventHandlers?.length||0));const i={me:t,owner:t,you:null,it:null,result:null,locals:new Map,globals:this.globalVariables,registry:this.expressionRegistry,halted:!1,returned:!1,broke:!1,continued:!1,async:!1},a=this.enhanceContext(i);if(n.parameters)for(const e of n.parameters)a.locals.set(e,e in r?r[e]:void 0);for(const[e,t]of Object.entries(r))n.parameters?.includes(e)||a.locals.set(e,t);if(n.initBlock){he("BEHAVIOR: Running init block for "+e);const t=this.options.commandTimeout??1e4;try{await Promise.race([this.execute(n.initBlock,a),new Promise((r,n)=>setTimeout(()=>n(Error(`Behavior "${e}" init block timed out after ${t}ms`)),t))]),he("BEHAVIOR: Init block completed for "+e)}catch(t){if(he(`BEHAVIOR: Init block error for ${e}:`,t),!(t instanceof Error&&Bn(t)))throw t}}if(he(`BEHAVIOR: About to attach ${n.eventHandlers?.length||0} handlers for ${e}`),n.eventHandlers){const t=this.options.commandTimeout??1e4;for(const r of n.eventHandlers)await Promise.race([this.executeEventHandler(r,a),new Promise((r,n)=>setTimeout(()=>n(Error(`Behavior "${e}" handler attachment timed out after ${t}ms`)),t))])}he("BEHAVIOR: Finished installing "+e)}async executeEventHandler(e,t){const{event:r,events:n,commands:i,target:a,args:s,selector:o,condition:l,attributeName:c,watchTarget:u,modifiers:d,errorSymbol:m,errorHandler:p,finallyHandler:h}=e,f=n&&n.length>0?n:[r];he(`BEHAVIOR: executeEventHandler: event='${r}', target='${a}'`);let y=[],g=null;if(a){const e="string"==typeof a?a.toLowerCase():"";if("window"===e||"the window"===e)g=window;else if("document"===e||"the document"===e||"body"===e)g=document;else if("me"===e||"myself"===e)y=t.me?[t.me]:[];else if("string"==typeof a&&t.locals.has(a)){const e=t.locals.get(a);he(`BEHAVIOR: Target resolution: found local '${a}', isElement: ${this.isElement(e)}`),this.isElement(e)?y=[e]:Array.isArray(e)?y=e.filter(e=>this.isElement(e)):"string"==typeof e&&(y=this.queryElements(e,t))}else he(`BEHAVIOR: Target resolution: querying for '${a}'`),y=this.queryElements(a,t)}else y=t.me?[t.me]:[];if(0===y.length&&!g)return void he(`BEHAVIOR: executeEventHandler - No targets found for event '${r}', returning early`);if("mutation"===r&&c)return void this.setupMutationObserver(y,c,i,t);if("change"===r&&u)return void this.setupChangeObserver(u,i,t);const v=e.customEventSource;if(v&&this.registryIntegration){he(`BEHAVIOR: executeEventHandler - Using custom event source '${v}' for event '${r}'`);const e=async e=>{const n=new Map(t.locals),a={...t,locals:n,it:e,event:e},s=this.enhanceContext(a);he(`CUSTOM EVENT: Executing commands for event '${r}'`);try{await this.execute({type:"program",commands:i},s)}catch(e){this.logError(`[HyperFixi] Error executing commands for custom event '${r}':`,e)}};try{const n=this.registryIntegration.subscribeToEventSource(v,{event:r,handler:e,target:a,selector:o},t);he(`BEHAVIOR: Subscribed to custom event source '${v}' (id: ${n.id})`),this.cleanupRegistry.registerGlobal(()=>n.unsubscribe(),"listener",`Custom event source '${v}' subscription ${n.id}`)}catch(e){this.logError(`[HyperFixi] Failed to subscribe to custom event source '${v}':`,e)}return}const b=Un.createEventHandler(this,i,t,o,s,{errorSymbol:m,errorHandler:p,finallyHandler:h},1===f.length?l:void 0);let w,k=null;if(d){let e=b;if(d.prevent){const t=e;e=async e=>(e.preventDefault(),t(e))}if(d.stop){const t=e;e=async e=>(e.stopPropagation(),t(e))}if(d.debounce){const t=d.debounce;let r;w=n=>{r&&clearTimeout(r),r=setTimeout(()=>e(n),t)},k=()=>{r&&(clearTimeout(r),r=void 0)}}else if(d.throttle){const t=d.throttle;let r=0;w=n=>{const i=Date.now();t>i-r||(r=i,e(n))}}else w=e}else w=b;const E=d?.once?{once:!0}:void 0;if(g){for(const e of f)g.addEventListener(e,w,E),y.length>0?this.cleanupRegistry.registerListener(y[0],g,e,w):this.cleanupRegistry.registerGlobal(()=>g.removeEventListener(e,w),"listener",`Global ${e} listener`);k&&(y.length>0?this.cleanupRegistry.registerCustom(y[0],k,"debounce-timeout"):this.cleanupRegistry.registerGlobal(k,"timeout","debounce-timeout"))}else for(const e of y){for(const t of f){if("resize"===t&&"undefined"!=typeof ResizeObserver){const t=new ResizeObserver(e=>{for(const r of e){const e=new CustomEvent("resize",{detail:r,bubbles:!1,cancelable:!1});if(e.synthetic=!0,w(e),E?.once){t.disconnect();break}}});t.observe(e),this.cleanupRegistry.registerCustom(e,()=>t.disconnect(),"resize-observer");continue}e.addEventListener(t,w,E),this.cleanupRegistry.registerListener(e,e,t,w)}k&&this.cleanupRegistry.registerCustom(e,k,"debounce-timeout")}}static createEventHandler(e,t,r,n,i,a,s){return async o=>{const l=Dn.get(o)??0;if(l>=100)return;if(Dn.set(o,l+1),n&&o.target instanceof Element)try{if(!o.target.matches(n)&&!o.target.closest(n))return}catch{he(`Event delegation: invalid CSS selector '${n}', skipping filter`)}const c=new Map(r.locals),u={...r,locals:c,it:o,event:o};c.has("target")||u.locals.set("target",o.target);const d=e.enhanceContext(u);if(i&&i.length>0){const e=o,t=e.detail;for(const r of i)d.locals.set(r,e[r]??t?.[r]??null)}if(s){const t=o;for(const e of Fn(s))!d.locals.has(e)&&e in t&&d.locals.set(e,t[e]);let r;try{r=await e.evaluateExpression(s,d)}catch(e){return void he("Event filter threw; skipping handler body:",e)}if(!r)return}const m=async t=>{for(const r of t)try{await e.execute(r,d)}catch(t){if(Bn(t)){if(t.isHalt||t.isExit)break;if(t.isReturn){void 0!==t.returnValue&&Object.assign(d,{it:t.returnValue,result:t.returnValue});break}}throw e.logError("COMMAND FAILED:",t),t}},p=a?.errorHandler,h=a?.finallyHandler;if(p||h)try{await m(t)}catch(e){if(!p||Bn(e))throw e;a?.errorSymbol&&d.locals.set(a.errorSymbol,e),await m(p)}finally{h&&await m(h)}else await m(t)}}setupMutationObserver(e,t,r,n){he(`RUNTIME BASE: Setting up MutationObserver for attribute '${t}' on ${e.length} elements`);for(const i of e){const e=new MutationObserver(async e=>{for(const a of e)if("attributes"===a.type&&a.attributeName===t){me(`MUTATION DETECTED: attribute '${t}' changed on`,i);const e={...n,me:i,it:a,locals:new Map(n.locals)},s=a.oldValue,o=i.getAttribute(t);e.locals.set("oldValue",s),e.locals.set("newValue",o);const l=this.enhanceContext(e);for(const e of r)try{await this.execute(e,l)}catch(e){if(Bn(e)){if(e.isHalt||e.isExit||e.isReturn)break}else this.logError("Error executing mutation handler command:",e)}}});e.observe(i,{attributes:!0,attributeOldValue:!0,attributeFilter:[t]}),this.cleanupRegistry.registerObserver(i,e),he("RUNTIME BASE: MutationObserver attached to",i,`for attribute '${t}'`)}}async setupChangeObserver(e,t,r){he("RUNTIME BASE: Setting up MutationObserver for content changes on watch target");const n=await this.execute(e,r);let i=[];this.isElement(n)?i=[n]:Array.isArray(n)&&(i=n.filter(e=>this.isElement(e))),he(`RUNTIME BASE: Watching ${i.length} target elements for content changes`);for(const e of i){const n=new MutationObserver(async n=>{for(const i of n)if("childList"===i.type||"characterData"===i.type){me("CONTENT CHANGE DETECTED on",e,"mutation type:",i.type);const n={...r,me:r.me,it:i,locals:new Map(r.locals)};n.locals.set("target",e);const a=i.oldValue,s=e.textContent;null!==a&&n.locals.set("oldValue",a),n.locals.set("newValue",s);const o=this.enhanceContext(n);for(const e of t)try{await this.execute(e,o)}catch(e){if(Bn(e)){if(e.isHalt||e.isExit||e.isReturn)break}else this.logError("Error executing change handler command:",e)}}});n.observe(e,{childList:!0,characterData:!0,subtree:!0,characterDataOldValue:!0}),this.cleanupRegistry.registerObserver(e,n),he("RUNTIME BASE: MutationObserver attached to",e,"for content changes")}}queryElements(e,t){const r=t.me,n=(r instanceof Element?r.ownerDocument:null)??("undefined"!=typeof document?document:null);if(!n)return[];let i=e;i.startsWith("<")&&i.endsWith("/>")&&(i=i.slice(1,-2).trim());try{return Array.from(n.querySelectorAll(i))}catch{return he(`queryElements: invalid CSS selector '${i}'`),[]}}isElement(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement||!(!e||"object"!=typeof e)&&(!!e.style&&!!e.classList)}}function Kn(...e){const t=new Map;for(const r of e)for(const[e,n]of Object.entries(r))t.set(e,n);return t}class Zn{constructor(e){this.observer=null,this.initialized=!1,this.runtime=e}init(){"undefined"!=typeof document&&(this.initialized||(this.initialized=!0,this.scanDocument(),this.observer=new MutationObserver(e=>{for(const t of e)"childList"===t.type?t.addedNodes.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&(this.processElement(e),this.scanElement(e))}):"attributes"===t.type&&"_"===t.attributeName&&this.processElement(t.target)}),this.observer.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["_"]})))}destroy(){this.observer&&(this.observer.disconnect(),this.observer=null),this.initialized=!1}reset(){this.destroy()}scanAndProcessAll(){this.scanDocument()}scanDocument(){document.body&&this.scanElement(document.body)}scanElement(e){e.hasAttribute("_")&&this.processElement(e),e.querySelectorAll("[_]").forEach(e=>this.processElement(e))}processElement(e){const t=e.getAttribute("_");if(!t)return;const r=mr(e);this.runtime.execute(t,r).catch(r=>{console.error('[HyperFixi] Error executing _="" attribute:',r),console.error("Element:",e),console.error("Code:",t)})}}const Xn={name:"me",category:"Reference",evaluatesTo:"Element",evaluate:async e=>e.me??null,validate:Br},Gn={name:"you",category:"Reference",evaluatesTo:"Element",evaluate:async e=>e.you??null,validate:Br},Jn={name:"it",category:"Reference",evaluatesTo:"Any",evaluate:async e=>e.it??e.result,validate:Br},Yn={name:"its",category:"Reference",evaluatesTo:"Any",evaluate:async e=>e.it??e.result,validate:Br},Qn={name:"result",category:"Reference",evaluatesTo:"Any",evaluate:async e=>e.result??e.it,validate:Br},ei={name:"querySelector",category:"Reference",evaluatesTo:"Element",async evaluate(e,...t){const[r]=t;if("string"!=typeof r)throw Error("querySelector requires a string selector");return document.querySelector(r)},validate:e=>Vr(e,"querySelector","selector")},ti={name:"querySelectorAll",category:"Reference",evaluatesTo:"Array",async evaluate(e,...t){const r=t[0];if("string"!=typeof r)throw Error("querySelectorAll requires a string selector");const n=document.querySelectorAll(r);return Array.from(n)},validate:e=>Vr(e,"querySelectorAll","selector")},ri={name:"getElementById",category:"Reference",evaluatesTo:"Element",async evaluate(e,...t){const r=t[0];if("string"!=typeof r)throw Error("getElementById requires a string ID");return document.getElementById(r)},validate:e=>Vr(e,"getElementById","ID")};function ni(e,t){if(t.startsWith("computed-")){const r=t.substring(9);return getComputedStyle(e).getPropertyValue(r)||""}const r=t.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());return e.style[r]}const ii={me:Xn,you:Gn,it:Jn,its:Yn,result:Qn,querySelector:ei,querySelectorAll:ti,getElementById:ri,getElementsByClassName:{name:"getElementsByClassName",category:"Reference",evaluatesTo:"Array",async evaluate(e,...t){const r=t[0];if("string"!=typeof r)throw Error("getElementsByClassName requires a string class name");const n=document.getElementsByClassName(r);return Array.from(n)},validate:e=>Vr(e,"getElementsByClassName","className")},closest:{name:"closest",category:"Reference",evaluatesTo:"Element",async evaluate(e,...t){let r=t[0];if(r&&"object"==typeof r&&"type"in r){const e=r;"identifier"===e.type&&e.name?r=e.name:"literal"===e.type&&"string"==typeof e.value&&(r=e.value)}if("string"!=typeof r)throw Error("closest requires a string selector");return e.me?e.me.closest(r):null},validate(e){if(1!==e.length)return"closest requires exactly 1 argument (selector)";const t=e[0];return"string"==typeof t||t&&"object"==typeof t&&"type"in t&&("identifier"===t.type||"literal"===t.type)?null:"closest selector must be a string or identifier"}},parent:{name:"parent",category:"Reference",evaluatesTo:"Element",evaluate:async e=>e.me?e.me.parentElement:null,validate:Br},window:{name:"window",category:"Reference",evaluatesTo:"Object",evaluate:async e=>window,validate:Br},document:{name:"document",category:"Reference",evaluatesTo:"Object",evaluate:async e=>document,validate:Br},elementWithSelector:{name:"elementWithSelector",category:"Reference",evaluatesTo:"Array",async evaluate(e,...t){const r=t[0];if("string"!=typeof r)throw Error("Selector must be a string");const n=e?.me?.ownerDocument??("undefined"!=typeof document?document:null);if(!n)throw Error("DOM not available - cannot resolve element selector");const i=n.querySelectorAll(r);return Array.from(i)},validate:e=>Vr(e,"elementWithSelector","selector")},styleRef:{name:"styleRef",category:"Reference",evaluatesTo:"String",async evaluate(e,...t){const r=t[0],n=t[1];if("string"!=typeof r)throw Error("StyleRef requires a string property name");const i=n||e.me;if(i&&i instanceof HTMLElement)return ni(i,r)},validate:e=>Dr(e,1,2,"styleRef","property, optional element")??zr(e,0,"styleRef","property")??(2===e.length&&e[1]&&"object"!=typeof e[1]?"styleRef element must be an HTMLElement":null)},possessiveStyleRef:{name:"possessiveStyleRef",category:"Reference",evaluatesTo:"String",async evaluate(e,...t){const r=t[0],n=t[1];if("string"!=typeof r||"string"!=typeof n)throw Error("Possessive styleRef requires possessor and property strings");let i=null;if("my"===r&&e.me?i=e.me instanceof HTMLElement?e.me:null:"its"===r&&e.it&&(i=e.it instanceof HTMLElement?e.it:null),i)return ni(i,n)},validate:e=>_r(e,2,"possessiveStyleRef","possessor, property")??zr(e,0,"possessiveStyleRef","possessor")??zr(e,1,"possessiveStyleRef","property")},ofStyleRef:{name:"ofStyleRef",category:"Reference",evaluatesTo:"String",async evaluate(e,...t){const r=t[0],n=t[1];if("string"!=typeof r||"string"!=typeof n)throw Error("Of styleRef requires property and reference strings");let i=null;if("me"===n&&e.me?i=e.me instanceof HTMLElement?e.me:null:"it"===n&&e.it&&(i=e.it instanceof HTMLElement?e.it:null),i)return ni(i,r)},validate:e=>_r(e,2,"ofStyleRef","property, reference")??zr(e,0,"ofStyleRef","property")??zr(e,1,"ofStyleRef","reference")}};function ai(e,t,r,n=[]){return{type:e,message:t,suggestions:n,...r&&{path:r}}}const si="undefined"!=typeof process&&"production"===process.env.NODE_ENV||"undefined"!=typeof process&&"true"===process.env.HYPERFIXI_SKIP_VALIDATION||"undefined"!=typeof globalThis&&"true"===globalThis.HYPERFIXI_SKIP_VALIDATION;let oi;function li(){return oi({validate:e=>({success:!0,data:e})})}function ci(e,t){if(si)return li();const r=oi({validate:r=>{if("object"!=typeof r||null===r||Array.isArray(r))return{success:!1,error:ai("type-mismatch","Expected object, received "+typeof r)};const n=r,i={};if(t?.strict){const t=Object.keys(e),r=Object.keys(n).filter(e=>!t.includes(e));if(r.length>0)return{success:!1,error:ai("runtime-error","Unexpected properties: "+r.join(", "))}}for(const[t,r]of Object.entries(e)){const e=n[t];if(!(t in n)&&!r._isOptional)return{success:!1,error:ai("missing-argument",`Required field "${t}" is missing`,t)};const a=r.validate(e);if(!a.success)return{success:!1,error:ai("validation-error",a.error.message||`Field "${t}" validation failed`,a.error.path?`${t}.${a.error.path}`:t)};void 0!==a.data&&(i[t]=a.data)}return{success:!0,data:i}}});return r.strict=()=>ci(e,{strict:!0}),r}oi=function(e){return e.describe||(e.describe=function(e){return this.description=e,this}),e.safeParse||(e.safeParse=function(e){const t=this.validate(e);return t.success?{success:!0,data:t.data}:{success:!1,error:{errors:t.error?[t.error]:[]}}}),e.parse||(e.parse=function(e){const t=this.validate(e);if(t.success&&void 0!==t.data)return t.data;throw Error(t.error?.message||"Validation failed")}),e.optional||(e.optional=function(){const e=this.validate.bind(this),t={...this,_isOptional:!0,validate:t=>null==t?{success:!0,data:void 0}:e(t)};return oi(t)}),e.min||(e.min=function(e){const t=this.validate.bind(this),r={...this,validate:r=>{const n=t(r);return n.success&&"string"==typeof n.data&&e>n.data.length?{success:!1,error:ai("runtime-error",`String must be at least ${e} characters long`)}:n}};return oi(r)}),e.max||(e.max=function(e){const t=this.validate.bind(this),r={...this,validate:r=>{const n=t(r);return n.success&&"string"==typeof n.data&&n.data.length>e?{success:!1,error:ai("runtime-error",`String must be at most ${e} characters long`)}:n}};return oi(r)}),e.default||(e.default=function(e){const t=this.validate.bind(this),r={...this,_defaultValue:e,_hasDefault:!0,validate:r=>void 0===r?{success:!0,data:e}:t(r)};return oi(r)}),e.rest||(e.rest=function(e){return this}),e.refine||(e.refine=function(e,t){const r=this.validate.bind(this),n={...this,validate:n=>{const i=r(n);return i.success?e(i.data)?i:{success:!1,error:ai("runtime-error",t||"Refinement validation failed")}:i}};return oi(n)}),new Proxy(e,{get:(e,t,r)=>t in e||"string"!=typeof t||t.startsWith("_")||"constructor"===t||"validate"===t||"then"===t?Reflect.get(e,t,r):function(...e){return r}})};const ui=e=>function(e={}){return si?li():oi({validate:t=>e.optional&&null==t?{success:!0,data:void 0}:"string"!=typeof t?{success:!1,error:ai("type-mismatch","Expected string, received "+typeof t)}:void 0!==e.minLength&&e.minLength>t.length?{success:!1,error:ai("runtime-error",`String must be at least ${e.minLength} characters long`)}:void 0!==e.maxLength&&t.length>e.maxLength?{success:!1,error:ai("runtime-error",`String must be at most ${e.maxLength} characters long`)}:e.pattern&&!e.pattern.test(t)?e.pattern.source.startsWith("^")&&e.pattern.source.endsWith("$")?{success:!1,error:ai("runtime-error",`Expected "${e.pattern.source.slice(1,-1)}", received "${t}"`)}:{success:!1,error:ai("missing-argument","String does not match required pattern")}:{success:!0,data:t},...e.description&&{description:e.description}})}(e||{}),di=e=>ci(e),mi=e=>function(e){return si?li():oi({validate:t=>{if(!Array.isArray(t))return{success:!1,error:ai("type-mismatch","Expected array, received "+typeof t)};if(t.length!==e.length)return{success:!1,error:ai("runtime-error",`Expected tuple of length ${e.length}, received length ${t.length}`)};const r=[];for(let n=0;e.length>n;n++){const i=e[n].validate(t[n]);if(!i.success)return{success:!1,error:ai("runtime-error",i.error.message,i.error.path?`${n}.${i.error.path}`:""+n)};r.push(i.data)}return{success:!0,data:r}}})}(e),pi=()=>li();class hi{constructor(e=100,t=5e3){this.maxSize=e,this.ttl=t,this.cache=new Map,this.accessOrder=new Map,this.accessCounter=0}get(e){const t=this.cache.get(e);if(t){if(this.ttl>=Date.now()-t.timestamp)return t.accessCount++,this.accessOrder.set(e,++this.accessCounter),t.result;this.delete(e)}}set(e,t){this.maxSize>this.cache.size||this.cache.has(e)||this.evictLRU(),this.cache.set(e,{result:t,timestamp:Date.now(),accessCount:1}),this.accessOrder.set(e,++this.accessCounter)}delete(e){return this.accessOrder.delete(e),this.cache.delete(e)}clear(){this.cache.clear(),this.accessOrder.clear(),this.accessCounter=0}size(){return this.cache.size}evictLRU(){let e,t=1/0;for(const[r,n]of this.accessOrder)t>n&&(t=n,e=r);void 0!==e&&this.delete(e)}getStats(){const e=Array.from(this.cache.values()),t=Date.now();return{size:this.cache.size,maxSize:this.maxSize,hitRate:e.length>0?e.filter(e=>e.accessCount>1).length/e.length:0,avgAge:e.length>0?e.reduce((e,r)=>e+(t-r.timestamp),0)/e.length:0,totalAccesses:e.reduce((e,t)=>e+t.accessCount,0)}}}const fi=new class{constructor(){this.domQueryCache=new hi(200,3e3),this.exprResultCache=new hi(500,2e3),this.cssMatchCache=new hi(100,5e3),this.formValueCache=new hi(50,1e3),this.hits=0,this.misses=0}querySelector(e){const t="querySelector:"+e,r=this.domQueryCache.get(t);if(void 0!==r)return this.hits++,r;this.misses++;const n=document.querySelector(e);return this.domQueryCache.set(t,n),n}querySelectorAll(e){const t="querySelectorAll:"+e,r=this.domQueryCache.get(t);if(void 0!==r)return this.hits++,r;this.misses++;const n=Array.from(document.querySelectorAll(e));return this.domQueryCache.set(t,n),n}getElementById(e){const t="getElementById:"+e,r=this.domQueryCache.get(t);if(void 0!==r)return this.hits++,r;this.misses++;const n=document.getElementById(e);return this.domQueryCache.set(t,n),n}getElementsByClassName(e){const t="getElementsByClassName:"+e,r=this.domQueryCache.get(t);if(void 0!==r)return this.hits++,r;this.misses++;const n=Array.from(document.getElementsByClassName(e));return this.domQueryCache.set(t,n),n}matches(e,t){const r=`matches:${this.getElementCacheKey(e)}:${t}`,n=this.cssMatchCache.get(r);if(void 0!==n)return this.hits++,n;this.misses++;const i=e.matches(t);return this.cssMatchCache.set(r,i),i}getExpressionResult(e){const t=this.exprResultCache.get(e);if(void 0!==t)return this.hits++,t;this.misses++}setExpressionResult(e,t){this.exprResultCache.set(e,t)}getFormValue(e){const t=this.getElementCacheKey(e),r=this.formValueCache.get("formValue:"+t);if(void 0!==r)return this.hits++,r;this.misses++}setFormValue(e,t){const r=this.getElementCacheKey(e);this.formValueCache.set("formValue:"+r,t)}invalidateElementCache(e){const t=this.getElementCacheKey(e);for(const e of[this.domQueryCache,this.cssMatchCache,this.formValueCache])for(const r of Array.from(e.cache.keys()))"string"==typeof r&&r.includes(t)&&e.delete(r)}invalidateAll(){this.domQueryCache.clear(),this.exprResultCache.clear(),this.cssMatchCache.clear(),this.formValueCache.clear(),this.hits=0,this.misses=0}getElementCacheKey(e){if(e.id)return"#"+e.id;const t=Array.from(e.classList).sort().join("."),r=this.getElementPosition(e);return`${e.tagName.toLowerCase()}${t?"."+t:""}@${r}`}getElementPosition(e){return""+Array.from(e.parentElement?.children||[]).indexOf(e)}getPerformanceStats(){const e=this.hits+this.misses;return{hits:this.hits,misses:this.misses,hitRate:Math.round(100*(e>0?this.hits/e*100:0))/100,domQueryCache:this.domQueryCache.getStats(),exprResultCache:this.exprResultCache.getStats(),cssMatchCache:this.cssMatchCache.getStats(),formValueCache:this.formValueCache.getStats()}}cleanup(){const e=Date.now();[this.domQueryCache,this.exprResultCache,this.cssMatchCache,this.formValueCache].forEach(t=>{Array.from(t.cache.entries()).forEach(([r,n])=>{e-n.timestamp>t.ttl&&t.delete(r)})})}};"undefined"!=typeof window&&setInterval(()=>{fi.cleanup()},1e4);const yi=new class{constructor(){this.metrics={tokenizationTime:0,evaluationTime:0,cacheHitRate:0,memoryUsage:0,domOperations:0},this.startTimes=new Map}startTimer(e){this.startTimes.set(e,performance.now())}endTimer(e){const t=this.startTimes.get(e);if(t){const r=performance.now()-t;return this.startTimes.delete(e),r}return 0}recordTokenization(e){this.metrics.tokenizationTime+=e}recordEvaluation(e){this.metrics.evaluationTime+=e}updateCacheMetrics(){const e=fi.getPerformanceStats();this.metrics.cacheHitRate=e.hitRate}getMetrics(){return this.updateCacheMetrics(),{...this.metrics}}reset(){this.metrics={tokenizationTime:0,evaluationTime:0,cacheHitRate:0,memoryUsage:0,domOperations:0}}};function gi(){fi.cleanup(),yi.getMetrics().memoryUsage>52428800&&yi.reset()}let vi=null;function bi(e,t){if("number"==typeof e){if(!Number.isFinite(e))throw Error(`${t} must be a finite number, got ${e}`);return e}if("string"==typeof e){const r=e.trim();if(""===r)return 0;const n=parseFloat(r);if(isNaN(n))throw Error(`${t} cannot be converted to number: "${e}"`);return n}if("boolean"==typeof e)return e?1:0;if(null==e)return 0;if("object"==typeof e&&null!==e){if(Array.isArray(e)&&1===e.length){const r=e[0];if(Array.isArray(r))throw Error(t+" is a nested array, cannot convert to number");return bi(r,t)}if("string"==typeof e.textContent||"value"in e){const t=e.value??e.textContent;if(null!=t){const e=(t+"").trim();if(""===e)return 0;const r=parseFloat(e);if(!isNaN(r))return r}}const r=e.valueOf();if("number"==typeof r&&Number.isFinite(r))return r}throw Error(`${t} cannot be converted to number: ${typeof e}`)}function wi(e){if("number"==typeof e)return Number.isFinite(e)?e:null;if("string"==typeof e){const t=e.trim();if(""===t)return 0;const r=parseFloat(t);return isNaN(r)?null:r}return"boolean"==typeof e?e?1:0:null==e?0:null}function ki(e,t){if(!Number.isFinite(e)){if(Number.isNaN(e))throw Error(t+" resulted in non-finite value: NaN");throw Error(`${t} resulted in non-finite value: ${e>0?"Infinity":"-Infinity"}`)}return e}function Ei(e){try{return bi(e,"_"),!0}catch{return!1}}function xi(e,t,r){if("==="===r)return e===t;if("!=="===r)return e!==t;if(null==e||null==t)return function(e,t,r){if(null==e&&null==t)switch(r){case"==":case">=":case"<=":return!0;default:return!1}switch(r){case"==":case">":case"<":case">=":case"<=":default:return!1;case"!=":return!0}}(e,t,r);const[n,i]=function(e,t){if("number"==typeof e&&"number"==typeof t)return[e,t];if("string"==typeof e&&"string"==typeof t){const r=parseFloat(e),n=parseFloat(t);return isNaN(r)||isNaN(n)?[e,t]:[r,n]}const r=wi(e),n=wi(t);return null!==r&&null!==n?[r,n]:[e+"",t+""]}(e,t);switch(r){case">":return n>i;case"<":return i>n;case">=":return n>=i;case"<=":return i>=n;case"==":return Ci(e,t);case"!=":return!Ci(e,t);default:return!1}}function Ci(e,t){if(e===t)return!0;if(typeof e==typeof t)return("string"==typeof e||"number"==typeof e)&&e===t;if("number"==typeof e&&"string"==typeof t){const r=parseFloat(t);return!isNaN(r)&&e===r}if("string"==typeof e&&"number"==typeof t){const r=parseFloat(e);return!isNaN(r)&&r===t}return"boolean"==typeof e?Ci(e?1:0,t):"boolean"==typeof t?Ci(e,t?1:0):e+""==t+""}function Ai(e,t=[]){return{isValid:!1,errors:e,suggestions:t}}function Si(e,t,r=[],n="error"){return{type:e,message:t,suggestions:r,severity:n}}function Ti(e,t,r,n,i,a=!0,s){return t&&"object"==typeof t&&"evaluationHistory"in t&&Array.isArray(t.evaluationHistory)&&t.evaluationHistory.push({expressionName:e.name,category:e.category,input:r,output:n,timestamp:i,duration:Date.now()-i,success:a,...void 0!==s&&{error:s}}),n}function Li(e){return null!==e&&"object"==typeof e&&"nodeType"in e&&1===e.nodeType}"undefined"!=typeof window&&function(e=3e4){vi&&clearInterval(vi),vi=setInterval(gi,e)}();const Oi=mi([pi(),pi()]),ji=mi([pi(),ui()]),Pi={name:"equals",category:"Comparison",evaluatesTo:"Boolean",precedence:10,associativity:"Left",operators:["is","==","equals"],async evaluate(e,t,r){const n=Date.now();try{return Ti(this,e,[t,r],t==r,n)}catch(i){throw Ti(this,e,[t,r],!1,n,!1,i instanceof Error?i:Error(i+"")),i}},validate:e=>Hr(e,"equals"),inputSchema:Oi,metadata:{category:"Logical",complexity:"simple",sideEffects:[],dependencies:[],returnTypes:["Boolean"],examples:[{input:"value is 5",description:"Check if value equals 5 using loose equality",expectedOutput:!0,context:{result:5}},{input:'"5" == 5',description:'String "5" equals number 5 with type coercion',expectedOutput:!0}],relatedExpressions:["strictEquals","notEquals"],performance:{averageTime:.001,complexity:"O(1)"}},documentation:{summary:"Compares two values for loose equality, allowing type coercion",parameters:[{name:"left",type:"unknown",description:"Left operand for comparison",optional:!1,examples:["5",'"hello"',"true","null"]},{name:"right",type:"unknown",description:"Right operand for comparison",optional:!1,examples:["5",'"hello"',"true","null"]}],returns:{type:"Boolean",description:"True if values are loosely equal, false otherwise",examples:["true","false"]},examples:[{title:"Basic equality check",code:"if my.value is 10",explanation:"Check if element value equals 10",output:"Boolean result"},{title:"Type coercion",code:'if "5" == 5',explanation:'String "5" equals number 5 with automatic type conversion',output:"true"},{title:"Null checks",code:"if value is null",explanation:"Check if value is null or undefined",output:"Boolean result"}],seeAlso:["strictEquals","notEquals","matches"],tags:["comparison","equality","logic","type-coercion"]}},Ii={name:"strictEquals",category:"Comparison",evaluatesTo:"Boolean",precedence:10,associativity:"Left",operators:["==="],async evaluate(e,t,r){const n=e.evaluationHistory,i=t===r;return n&&Ti(this,e,[t,r],i,n?Date.now():0),i},validate:e=>Hr(e,"strictEquals")},qi={name:"notEquals",category:"Comparison",evaluatesTo:"Boolean",precedence:10,associativity:"Left",operators:["!=","is not","does not equal"],async evaluate(e,t,r){const n=e.evaluationHistory,i=t!=r;return n&&Ti(this,e,[t,r],i,n?Date.now():0),i},validate:e=>Hr(e,"notEquals")},Ni={name:"strictNotEquals",category:"Comparison",evaluatesTo:"Boolean",precedence:10,associativity:"Left",operators:["!=="],async evaluate(e,t,r){const n=e.evaluationHistory,i=t!==r;return n&&Ti(this,e,[t,r],i,n?Date.now():0),i},validate:e=>Hr(e,"strictNotEquals")},Ri={name:"lessThan",category:"Comparison",evaluatesTo:"Boolean",precedence:12,associativity:"Left",operators:["<","is less than"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0,a=xi(t,r,"<");return n&&Ti(this,e,[t,r],a,i),a},validate:e=>Hr(e,"lessThan")},Mi={name:"lessThanOrEqual",category:"Comparison",evaluatesTo:"Boolean",precedence:12,associativity:"Left",operators:["<=","is less than or equal to"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0,a=xi(t,r,"<=");return n&&Ti(this,e,[t,r],a,i),a},validate:e=>Hr(e,"lessThanOrEqual")},$i={name:"greaterThan",category:"Comparison",evaluatesTo:"Boolean",precedence:12,associativity:"Left",operators:[">","is greater than"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0,a=xi(t,r,">");return n&&Ti(this,e,[t,r],a,i),a},validate:e=>Hr(e,"greaterThan")},_i={name:"greaterThanOrEqual",category:"Comparison",evaluatesTo:"Boolean",precedence:12,associativity:"Left",operators:[">=","is greater than or equal to"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0,a=xi(t,r,">=");return n&&Ti(this,e,[t,r],a,i),a},validate:e=>Hr(e,"greaterThanOrEqual")},zi={name:"and",category:"Logical",evaluatesTo:"Boolean",precedence:6,associativity:"Left",operators:["and","&&"],async evaluate(e,t,r){const n=Date.now();try{return Ti(this,e,[t,r],t&&r,n)}catch(i){throw Ti(this,e,[t,r],!1,n,!1,i instanceof Error?i:Error(i+"")),i}},validate:e=>Hr(e,"and"),inputSchema:Oi,metadata:{category:"Logical",complexity:"simple",sideEffects:[],dependencies:[],returnTypes:["Boolean"],examples:[{input:"true and false",description:"Logical AND of boolean values",expectedOutput:!1},{input:"name and age",description:"Both name and age must be truthy",expectedOutput:!0,context:{variables:new Map([["name","John"],["age",25]])}}],relatedExpressions:["or","not"],performance:{averageTime:.001,complexity:"O(1)"}},documentation:{summary:"Logical AND operation that returns true only if both operands are truthy",parameters:[{name:"left",type:"unknown",description:"Left operand (evaluated for truthiness)",optional:!1,examples:["true","name","5",'"hello"']},{name:"right",type:"unknown",description:"Right operand (evaluated for truthiness)",optional:!1,examples:["false","age","0",'""']}],returns:{type:"Boolean",description:"True if both operands are truthy, false otherwise",examples:["true","false"]},examples:[{title:"Form validation",code:"if name and email",explanation:"Check if both name and email have values",output:"Boolean result"},{title:"Multiple conditions",code:"if age > 18 and hasLicense",explanation:"Combine multiple conditions",output:"Boolean result"},{title:"Short-circuit evaluation",code:"if element and element.value",explanation:"Check element exists before accessing properties",output:"Boolean result"}],seeAlso:["or","not","exists"],tags:["logic","boolean","conditions","validation"]}},Vi={name:"or",category:"Logical",evaluatesTo:"Boolean",precedence:5,associativity:"Left",operators:["or","||"],async evaluate(e,t,r){const n=e.evaluationHistory,i=t||r;return n&&Ti(this,e,[t,r],i,n?Date.now():0),i},validate:e=>Hr(e,"or")},Hi={name:"not",category:"Logical",evaluatesTo:"Boolean",precedence:15,associativity:"Right",operators:["not","!"],async evaluate(e,t){const r=e.evaluationHistory,n=!t;return r&&Ti(this,e,[t],n,r?Date.now():0),n},validate:e=>_r(e,1,"not","operand")},Bi={name:"isEmpty",category:"Logical",evaluatesTo:"Boolean",operators:["is empty","isEmpty"],async evaluate(e,t){const r=e.evaluationHistory,n=r?Date.now():0;let i;return i=null==t||(Ar(t)||Array.isArray(t)||t instanceof NodeList?0===t.length:!(t instanceof Node||t instanceof Element||!Lr(t)||0!==Object.keys(t).length)),r&&Ti(this,e,[t],i,n),i},validate:e=>_r(e,1,"isEmpty","value")},Wi={name:"no",category:"Logical",evaluatesTo:"Boolean",operators:["no"],async evaluate(e,t){const r=e.evaluationHistory,n=r?Date.now():0;let i;return i=null==t||!1===t||(Array.isArray(t)||t instanceof NodeList?0===t.length:(Ar(t),!1)),r&&Ti(this,e,[t],i,n),i},validate:e=>_r(e,1,"no","value")},Di={name:"isNotEmpty",category:"Logical",evaluatesTo:"Boolean",operators:["is not empty","isNotEmpty"],async evaluate(e,t){const r=e.evaluationHistory,n=r?Date.now():0,i=!await Bi.evaluate(e,t);return r&&Ti(this,e,[t],i,n),i},validate:e=>_r(e,1,"isNotEmpty","value")},Fi={name:"exists",category:"Logical",evaluatesTo:"Boolean",operators:["exists"],async evaluate(e,t){const r=e.evaluationHistory,n=r?Date.now():0,i=Ui(t);return r&&Ti(this,e,[t],i,n),i},validate:e=>_r(e,1,"exists","value")};function Ui(e){return null!=e&&(Array.isArray(e)?e.length>0:!("undefined"!=typeof NodeList&&e instanceof NodeList)||e.length>0)}const Ki={name:"doesNotExist",category:"Logical",evaluatesTo:"Boolean",operators:["does not exist","doesNotExist"],async evaluate(e,t){const r=e.evaluationHistory,n=r?Date.now():0,i=!Ui(t);return r&&Ti(this,e,[t],i,n),i},validate:e=>_r(e,1,"doesNotExist","value")},Zi={name:"contains",category:"Logical",evaluatesTo:"Boolean",operators:["contains","includes","include"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0;let a;if(t&&r){if(Li(t)&&Li(r))return a=t.contains(r),n&&Ti(this,e,[t,r],a,i),a;if(Ar(t)&&t.match(/^[.#][\w-]+$/)){const s=document.querySelector(t);if(s&&Li(r))return a=s.contains(r),n&&Ti(this,e,[t,r],a,i),a;if(s&&Ar(r)&&r.match(/^[.#][\w-]+$/)){const o=document.querySelector(r);return a=!!o&&s.contains(o),n&&Ti(this,e,[t,r],a,i),a}}if(Ar(r)&&r.match(/^[.#][\w-]+$/)&&Li(t)){const s=document.querySelector(r);return a=!!s&&t.contains(s),n&&Ti(this,e,[t,r],a,i),a}}if(Ar(t)&&Ar(r))a=t.includes(r);else if(Array.isArray(t)||"undefined"!=typeof NodeList&&t instanceof NodeList){const e=Array.from(t);a=e.includes(r)||r instanceof Node&&e.some(e=>e instanceof Node&&e.contains(r))}else a=!(!Lr(t)||!Ar(r))&&r in t;return n&&Ti(this,e,[t,r],a,i),a},validate:e=>_r(e,2,"contains","container, value")},Xi={name:"doesNotContain",category:"Logical",evaluatesTo:"Boolean",operators:["does not contain","doesNotContain","does not include","doesNotInclude"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0,a=!await Zi.evaluate(e,t,r);return n&&Ti(this,e,[t,r],a,i),a},validate:e=>_r(e,2,"doesNotContain","container, value")},Gi={name:"startsWith",category:"Logical",evaluatesTo:"Boolean",operators:["starts with","startsWith"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0,a=null!=t&&null!=r&&(t+"").startsWith(r+"");return n&&Ti(this,e,[t,r],a,i),a},validate:e=>_r(e,2,"startsWith","str, prefix")},Ji={name:"endsWith",category:"Logical",evaluatesTo:"Boolean",operators:["ends with","endsWith"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0,a=null!=t&&null!=r&&(t+"").endsWith(r+"");return n&&Ti(this,e,[t,r],a,i),a},validate:e=>_r(e,2,"endsWith","str, suffix")},Yi={name:"between",category:"Logical",evaluatesTo:"Boolean",operators:["is between","between"],async evaluate(e,t,r,n){const i=e.evaluationHistory;let a=r,s=n;if(null!=a&&null!=s&&a>s){const e=a;a=s,s=e}const o=null!=a&&null!=s&&t>=a&&s>=t;return i&&Ti(this,e,[t,r,n],o,i?Date.now():0),o},validate:e=>_r(e,3,"between","value, min, max")},Qi={name:"matches",category:"Logical",evaluatesTo:"Boolean",operators:["matches"],async evaluate(e,t,r){const n=Date.now();try{let i;if(t instanceof Element&&Ar(r)){const e=r;if(e.startsWith(".")||e.startsWith("#")||e.startsWith(":")||e.startsWith("[")||/^[a-zA-Z][\w-]*$/.test(e))try{i=function(e,t){return fi.matches(e,t)}(t,e)}catch(e){i=!1}else i=!1}else if(Ar(t)&&Ar(r)){const e=t,n=r;try{i=(n.startsWith("/")&&n.endsWith("/")?RegExp(n.slice(1,-1)):RegExp(n)).test(e)}catch(t){i=e.includes(n)}}else i=!1;return Ti(this,e,[t,r],i,n)}catch(i){throw Ti(this,e,[t,r],!1,n,!1,i instanceof Error?i:Error(i+"")),i}},validate:e=>_r(e,2,"matches","element, selector"),inputSchema:ji,metadata:{category:"Logical",complexity:"medium",sideEffects:["dom-query"],dependencies:[],returnTypes:["Boolean"],examples:[{input:'element matches ".active"',description:"Check if element has active class",expectedOutput:!0},{input:'text matches "/^hello/"',description:'Check if text starts with "hello" using regex',expectedOutput:!0,context:{variables:new Map([["text","hello world"]])}}],relatedExpressions:["contains","startsWith","endsWith"],performance:{averageTime:.5,complexity:"O(n)"}},documentation:{summary:"Tests if element matches CSS selector or string matches regex pattern",parameters:[{name:"element",type:"Element | string",description:"DOM element or string to test",optional:!1,examples:["<div>",'"hello world"',"me","target"]},{name:"selector",type:"string",description:"CSS selector or regex pattern to match against",optional:!1,examples:['".active"','"#navbar"','"/^hello/"','"\\\\d+"']}],returns:{type:"Boolean",description:"True if element matches selector/pattern",examples:["true","false"]},examples:[{title:"CSS class matching",code:'if me matches ".active"',explanation:'Check if current element has "active" class',output:"Boolean result"},{title:"Attribute matching",code:'if target matches "[data-role=\\"button\\"]"',explanation:"Check if element has specific data attribute",output:"Boolean result"},{title:"Regex pattern matching",code:'if email matches "/^[^@]+@[^@]+\\\\.[^@]+$/"',explanation:"Validate email format with regex",output:"Boolean result"},{title:"Complex CSS selector",code:'if element matches ".card:hover .button"',explanation:"Match complex CSS selector with pseudo-classes",output:"Boolean result"}],seeAlso:["contains","startsWith","endsWith","querySelector"],tags:["pattern","css","regex","validation","dom"]}},ea={name:"has",category:"Logical",evaluatesTo:"Boolean",operators:["has","have"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0;let a=!1;if(t instanceof Element&&Ar(r)){const e=r;e.startsWith(".")?a=t.classList.contains(e.slice(1)):e.startsWith("[")&&e.endsWith("]")&&(a=t.hasAttribute(e.slice(1,-1)))}return n&&Ti(this,e,[t,r],a,i),a},validate:e=>_r(e,2,"has","element, selector")},ta={name:"doesNotHave",category:"Logical",evaluatesTo:"Boolean",operators:["does not have"],async evaluate(e,t,r){const n=e.evaluationHistory,i=n?Date.now():0,a=!await ea.evaluate(e,t,r);return n&&Ti(this,e,[t,r],a,i),a},validate:e=>_r(e,2,"doesNotHave","element, selector")},ra={equals:Pi,strictEquals:Ii,notEquals:qi,strictNotEquals:Ni,lessThan:Ri,lessThanOrEqual:Mi,greaterThan:$i,greaterThanOrEqual:_i,and:zi,or:Vi,not:Hi,no:Wi,isEmpty:Bi,isNotEmpty:Di,exists:Fi,doesNotExist:Ki,contains:Zi,doesNotContain:Xi,startsWith:Gi,endsWith:Ji,between:Yi,matches:Qi,has:ea,doesNotHave:ta};class na{trackPerformance(e,t,r,n){e.evaluationHistory&&e.evaluationHistory.push({expressionName:this.name,category:this.category,input:t,output:r.success?r.value:r.error,timestamp:n,duration:Date.now()-n,success:r.success})}trackSimple(e,t,r,n=(r?"success":"error")){e.evaluationHistory&&e.evaluationHistory.push({expressionName:this.name,category:this.category,input:"operation",output:n,timestamp:t,duration:Date.now()-t,success:r})}toBoolean(e){return!(!1===e||0===e||0n===e||""===e||null==e||Sr(e)&&isNaN(e))}success(e,t){return{success:!0,value:e,type:t}}failure(e,t,r,n,i=[]){return{success:!1,error:{name:e,type:t,message:r,code:n,suggestions:i}}}validationSuccess(){return{isValid:!0,errors:[],suggestions:[]}}validationFailure(e,t,r=[]){return{isValid:!1,errors:[{type:e,message:t,suggestions:r}],suggestions:r}}isElement(e){return null!==e&&"object"==typeof e&&"nodeType"in e&&1===e.nodeType&&"tagName"in e&&"string"==typeof e.tagName}inferType(e){return null===e?"null":void 0===e?"undefined":this.isElement(e)?"element":Array.isArray(e)?"array":Lr(e)?"object":typeof e}inferEvaluationType(e){return void 0===e?"Undefined":null===e?"Null":Ar(e)?"String":Sr(e)?"Number":Tr(e)?"Boolean":Array.isArray(e)?"Array":this.isElement(e)?"Element":"Object"}normalizeCollection(e){return Array.isArray(e)?e:e instanceof NodeList?Array.from(e):Ar(e)?e.split(""):null==e?[]:Lr(e)&&Symbol.iterator in e?Array.from(e):[]}toNumber(e){if(Sr(e)&&Number.isFinite(e))return e;if(Ar(e)){const t=Number(e);return Number.isFinite(t)?t:null}return Tr(e)?e?1:0:null}}const ia=di({value:ui().describe("String literal value")}).strict(),aa=di({value:function(e={}){return si?li():oi({validate:t=>{const r=Number(t);return isNaN(r)?{success:!1,error:ai("type-mismatch","Expected number, received "+typeof t)}:void 0!==e.min&&e.min>r?{success:!1,error:ai("runtime-error","Number must be at least "+e.min)}:void 0!==e.max&&r>e.max?{success:!1,error:ai("runtime-error","Number must be at most "+e.max)}:{success:!0,data:r}}})}(la||{}).describe("Number literal value")}).strict(),sa=di({value:(si?li():oi({validate:e=>"boolean"!=typeof e?{success:!1,error:ai("type-mismatch","Expected boolean, received "+typeof e)}:{success:!0,data:e}})).describe("Boolean literal value")}).strict(),oa=di({left:pi().describe("Left operand"),right:pi().describe("Right operand")}).strict();var la;const ca={stringLiteral:new class extends na{constructor(){super(...arguments),this.name="stringLiteral",this.category="Special",this.syntax="\"string\" or 'string'",this.description="String literals with template interpolation support",this.outputType="String",this.inputSchema=ia,this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=Date.now();try{const n=this.validate(t);if(!n.isValid){const t=this.failure("ValidationError","validation-error",n.errors.map(e=>e.message).join(", "),"VALIDATION_FAILED",n.suggestions);return this.trackSimple(e,r,!1),t}let i=t.value;(i.includes("${")||i.includes("$"))&&(i=this.interpolateString(i,e));const a=this.success(i,"string");return this.trackSimple(e,r,!0,i),a}catch(t){return this.trackSimple(e,r,!1),this.failure("StringEvaluationError","runtime-error","String literal evaluation failed: "+(t instanceof Error?t.message:t+""),"STRING_EVALUATION_FAILED")}}validate(e){try{const t=this.inputSchema.safeParse(e);return t.success?this.validationSuccess():this.validationFailure("type-mismatch",t.error?.errors.map(e=>e.message).join(", ")||"Invalid string literal input",["Provide a value parameter","Ensure value is a string"])}catch(e){return this.validationFailure("runtime-error","Validation failed with exception",["Check input structure and types"])}}interpolateString(e,t){let r=e.replace(/\$\{([^}]+)\}/g,(e,r)=>{try{const e=this.resolveExpression(r.trim(),t);return void 0!==e?e+"":""}catch(e){return""}});return r=r.replace(/\$([a-zA-Z_$][a-zA-Z0-9_.$]*)/g,(e,r)=>{try{const e=this.resolveVariable(r,t);return void 0!==e?e+"":""}catch(e){return""}}),r}resolveExpression(e,t){if(e.includes(".")){const r=e.split(".");let n=this.resolveVariable(r[0],t);for(let e=1;r.length>e&&null!=n;e++)n=n[r[e]];return n}return this.resolveVariable(e,t)}resolveVariable(e,t){return"me"===e&&t.me?t.me:"you"===e&&t.you?t.you:"it"===e&&t.it?t.it:"result"===e&&t.result?t.result:t.locals?.has(e)?($e(e,t),t.locals.get(e)):t.globals?.has(e)?t.globals.get(e):void 0}},numberLiteral:new class extends na{constructor(){super(...arguments),this.name="numberLiteral",this.category="Special",this.syntax="123 or 3.14",this.description="Numeric literal with validation",this.inputSchema=aa,this.outputType="Number",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=Date.now();try{const n=this.validate(t);return n.isValid?Number.isFinite(t.value)?(this.trackSimple(e,r,!0,t.value),this.success(t.value,"number")):(this.trackSimple(e,r,!1),this.failure("NumberValidationError","invalid-argument","Number literal must be finite","NUMBER_NOT_FINITE")):(this.trackSimple(e,r,!1),this.failure("ValidationError","validation-error",n.errors.map(e=>e.message).join(", "),"VALIDATION_FAILED",n.suggestions))}catch(t){return this.trackSimple(e,r,!1),this.failure("NumberEvaluationError","runtime-error","Number literal evaluation failed: "+(t instanceof Error?t.message:t+""),"NUMBER_EVALUATION_FAILED")}}validate(e){try{const t=this.inputSchema.safeParse(e);return t.success?Number.isFinite(t.data.value)?this.validationSuccess():this.validationFailure("invalid-argument","Number literal value must be finite",["Use finite numbers only","Avoid Infinity and NaN values"]):this.validationFailure("type-mismatch",t.error?.errors.map(e=>e.message).join(", ")||"Invalid number literal input",["Provide a value parameter","Ensure value is a number"])}catch(e){return this.validationFailure("runtime-error","Validation failed with exception",["Check input structure and types"])}}},booleanLiteral:new class extends na{constructor(){super(...arguments),this.name="booleanLiteral",this.category="Special",this.syntax="true or false",this.description="Boolean literal values",this.inputSchema=sa,this.outputType="Boolean",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=Date.now();try{const n=this.validate(t);return n.isValid?(this.trackSimple(e,r,!0,t.value),this.success(t.value,"boolean")):(this.trackSimple(e,r,!1),this.failure("ValidationError","validation-error",n.errors.map(e=>e.message).join(", "),"VALIDATION_FAILED",n.suggestions))}catch(t){return this.trackSimple(e,r,!1),this.failure("BooleanEvaluationError","runtime-error","Boolean literal evaluation failed: "+(t instanceof Error?t.message:t+""),"BOOLEAN_EVALUATION_FAILED")}}validate(e){try{const t=this.inputSchema.safeParse(e);return t.success?this.validationSuccess():this.validationFailure("type-mismatch",t.error?.errors.map(e=>e.message).join(", ")||"Invalid boolean literal input",["Provide a value parameter","Ensure value is a boolean"])}catch(e){return this.validationFailure("runtime-error","Validation failed with exception",["Check input structure and types"])}}},addition:new class extends na{constructor(){super(...arguments),this.name="addition",this.category="Special",this.syntax="left + right",this.description="Addition of two numeric values",this.inputSchema=oa,this.outputType="Number",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=Date.now();try{const n=this.validate(t);if(!n.isValid)return this.trackSimple(e,r,!1),this.failure("ValidationError","validation-error",n.errors.map(e=>e.message).join(", "),"VALIDATION_FAILED",n.suggestions);const i=bi(t.left,"left operand")+bi(t.right,"right operand");return this.trackSimple(e,r,!0,i),this.success(i,"number")}catch(t){return this.trackSimple(e,r,!1),this.failure("AdditionError","runtime-error","Addition failed: "+(t instanceof Error?t.message:t+""),"ADDITION_FAILED")}}validate(e){try{const t=this.inputSchema.safeParse(e);return t.success?this.validationSuccess():this.validationFailure("type-mismatch",t.error?.errors.map(e=>e.message).join(", ")||"Invalid addition input",["Provide left and right operands"])}catch(e){return this.validationFailure("runtime-error","Validation failed with exception",["Check input structure and types"])}}},stringConcatenation:new class extends na{constructor(){super(...arguments),this.name="stringConcatenation",this.category="Special",this.syntax="left + right (string concatenation)",this.description="Concatenation of two values into a string",this.inputSchema=oa,this.outputType="String",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=Date.now();try{const n=this.validate(t);if(!n.isValid)return this.trackSimple(e,r,!1),this.failure("ValidationError","validation-error",n.errors[0]?.message||"Invalid input","STRING_CONCATENATION_VALIDATION_FAILED",n.suggestions);const i=this.convertToString(t.left)+this.convertToString(t.right);return this.trackSimple(e,r,!0,i),this.success(i,"string")}catch(t){return this.trackSimple(e,r,!1),this.failure("StringConcatenationError","runtime-error",t instanceof Error?t.message:"String concatenation failed","STRING_CONCATENATION_ERROR",["Check that operands can be converted to strings"])}}validate(e){const t=oa.safeParse(e);return t.success?this.validationSuccess():this.validationFailure("type-mismatch",t.error?.errors.map(e=>e.message).join(", ")||"Invalid string concatenation input",["Provide left and right operands for concatenation"])}convertToString(e){if(null===e)return"null";if(void 0===e)return"undefined";if(Ar(e))return e;if(Sr(e))return""+e;if(Tr(e))return""+e;if(e instanceof Date)return""+e;try{return e+""}catch{return"[object Object]"}}},multiplication:new class extends na{constructor(){super(...arguments),this.name="multiplication",this.category="Special",this.syntax="left * right",this.description="Multiplication of two numeric values",this.inputSchema=oa,this.outputType="Number",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=Date.now();try{const n=this.validate(t);if(!n.isValid)return this.trackSimple(e,r,!1),this.failure("ValidationError","validation-error",n.errors.map(e=>e.message).join(", "),"VALIDATION_FAILED",n.suggestions);const i=bi(t.left,"left operand")*bi(t.right,"right operand");return this.trackSimple(e,r,!0,i),this.success(i,"number")}catch(t){return this.trackSimple(e,r,!1),this.failure("MultiplicationError","runtime-error","Multiplication failed: "+(t instanceof Error?t.message:t+""),"MULTIPLICATION_FAILED")}}validate(e){try{const t=this.inputSchema.safeParse(e);return t.success?this.validationSuccess():this.validationFailure("type-mismatch",t.error?.errors.map(e=>e.message).join(", ")||"Invalid multiplication input",["Provide left and right operands"])}catch(e){return this.validationFailure("runtime-error","Validation failed with exception",["Check input structure and types"])}}}},ua={name:"first",category:"Reference",evaluatesTo:"Any",operators:["first"],async evaluate(e,t){const r=void 0!==t?t:e.it;return null==r?null:Array.isArray(r)||r instanceof NodeList||r instanceof HTMLCollection?r.length>0?r[0]:null:r instanceof Element?r.children.length>0?r.children[0]:null:Ar(r)?r.length>0?r[0]:null:Lr(r)&&"length"in r&&Sr(r.length)&&r.length>0?r[0]:null},validate:e=>Wr(e,1,"first","collection")},da={name:"last",category:"Reference",evaluatesTo:"Any",operators:["last"],async evaluate(e,t){const r=void 0!==t?t:e.it;if(null==r)return null;if(Array.isArray(r))return r.length>0?r[r.length-1]:null;if(r instanceof NodeList||r instanceof HTMLCollection)return r.length>0?r[r.length-1]:null;if(r instanceof Element){const e=r.children;return e.length>0?e[e.length-1]:null}return Ar(r)?r.length>0?r[r.length-1]:null:Lr(r)&&"length"in r&&Sr(r.length)&&r.length>0?r[r.length-1]:null},validate:e=>Wr(e,1,"last","collection")},ma={name:"at",category:"Reference",evaluatesTo:"Any",operators:["at"],async evaluate(e,...t){const[r,n]=t;if(!Sr(r))throw Error("Index must be a number");const i=r,a=void 0!==n?n:e.it;if(null==a)return null;if(Array.isArray(a)){const e=0>i?a.length+i:i;return e>=0&&a.length>e?a[e]:null}if(a instanceof NodeList||a instanceof HTMLCollection){const e=0>i?a.length+i:i;return e>=0&&a.length>e?a[e]:null}if(a instanceof Element){const e=a.children,t=0>i?e.length+i:i;return t>=0&&e.length>t?e[t]:null}if(Ar(a)){const e=0>i?a.length+i:i;return e>=0&&a.length>e?a[e]:null}if(Lr(a)&&"length"in a&&Sr(a.length)){const e=0>i?a.length+i:i;return e>=0&&a.length>e?a[e]:null}return null},validate:e=>Dr(e,1,2,"at","index, optional collection")??function(e){return"number"!=typeof e[0]?"at index must be a number":null}(e)};function pa(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;const e=r.querySelector(t);if(e)return e;r=r.nextElementSibling}const n=e.parentElement;return n&&n!==document.documentElement?pa(n,t):null}function ha(e,t){let r=e.previousElementSibling;for(;r;){const e=Array.from(r.querySelectorAll(t)).reverse();if(e.length>0)return e[0];if(r.matches(t))return r;r=r.previousElementSibling}const n=e.parentElement;return n&&n!==document.documentElement?ha(n,t):null}function fa(e,t,r,n){if(r.inSearch){if(null==r.inElt)return;return function(e,t,r,n){const i=Array.from(t??[]),a=[];for(const t of i)(t.matches&&t.matches(r)||t===e)&&a.push(t);for(let t=0;a.length-1>t;t++)if(a[t]===e)return a[t+1];if(n){const e=a[0];if(e&&e.matches&&e.matches(r))return e}}(e,n?Array.from(r.inElt):Array.from(r.inElt).reverse(),t,!!r.wrapping)}const i=r.within??("undefined"!=typeof document?document.body:null);if(i)return n?function(e,t,r,n){const i=t.querySelectorAll(r);for(let t=0;i.length>t;t++){const r=i[t];if(2===r.compareDocumentPosition(e))return r}return n?i[0]:void 0}(e,i,t,!!r.wrapping):function(e,t,r,n){const i=t.querySelectorAll(r);for(let t=i.length-1;t>=0;t--){const r=i[t];if(4===r.compareDocumentPosition(e))return r}return n?i[i.length-1]:void 0}(e,i,t,!!r.wrapping)}function ya(e){let t=0,r=e;for(;r&&r.parentElement;)t+=Array.from(r.parentElement.children).indexOf(r),r=r.parentElement,t+=1e3;return t}const ga={first:ua,last:da,at:ma,next:{name:"next",category:"Reference",evaluatesTo:"Element",operators:["next"],async evaluate(e,...t){const[r,n,i]=t,a=n||e.me;return a&&a instanceof Element?r?i?fa(a,r,i,!0):pa(a,r):a.nextElementSibling:null},validate:e=>Wr(e,3,"next","optional selector, optional fromElement, optional modifiers")||(1>e.length||null==e[0]||"string"==typeof e[0]?2>e.length||null==e[1]||e[1]instanceof Element?null:"fromElement must be an Element":"selector must be a string")},previous:{name:"previous",category:"Reference",evaluatesTo:"Element",operators:["previous","prev"],async evaluate(e,...t){const[r,n,i]=t,a=n||e.me;return a&&a instanceof Element?r?i?fa(a,r,i,!1):ha(a,r):a.previousElementSibling:null},validate:e=>Wr(e,3,"previous","optional selector, optional fromElement, optional modifiers")||(1>e.length||null==e[0]||"string"==typeof e[0]?2>e.length||null==e[1]||e[1]instanceof Element?null:"fromElement must be an Element":"selector must be a string")},nextWithin:{name:"nextWithin",category:"Reference",evaluatesTo:"Element",operators:["next within"],async evaluate(e,...t){const[r,n,i]=t,a=i||e.me;if(!(a&&a instanceof Element))return null;const s=a.closest(n);return s?function(e,t,r){const n=Array.from(r.querySelectorAll(t)),i=ya(e);for(const e of n)if(ya(e)>i)return e;return null}(a,r,s):null},validate:e=>Dr(e,2,3,"nextWithin","selector, withinSelector, optional fromElement")||("string"!=typeof e[0]?"selector must be a string":"string"!=typeof e[1]?"withinSelector must be a string":3>e.length||null==e[2]||e[2]instanceof Element?null:"fromElement must be an Element")},previousWithin:{name:"previousWithin",category:"Reference",evaluatesTo:"Element",operators:["previous within"],async evaluate(e,...t){const[r,n,i]=t,a=i||e.me;if(!(a&&a instanceof Element))return null;const s=a.closest(n);return s?function(e,t,r){const n=Array.from(r.querySelectorAll(t)),i=ya(e);for(let e=n.length-1;e>=0;e--){const t=n[e];if(i>ya(t))return t}return null}(a,r,s):null},validate:e=>Dr(e,2,3,"previousWithin","selector, withinSelector, optional fromElement")||("string"!=typeof e[0]?"selector must be a string":"string"!=typeof e[1]?"withinSelector must be a string":3>e.length||null==e[2]||e[2]instanceof Element?null:"fromElement must be an Element")}};function va(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?n.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),m=!1,p=r.length-1;p>=0;p--){var h={};for(var f in n)h[f]="access"===f?{}:n[f];for(var f in n.access)h.access[f]=n.access[f];h.addInitializer=function(e){if(m)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var y=(0,r[p])("accessor"===l?{get:d.get,set:d.set}:d[c],h);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(o=s(y.get))&&(d.get=o),(o=s(y.set))&&(d.set=o),(o=s(y.init))&&i.unshift(o)}else(o=s(y))&&("field"===l?i.unshift(o):d[c]=o)}u&&Object.defineProperty(u,n.name,d),m=!0}function ba(e,t,r){for(var n=arguments.length>2,i=0;t.length>i;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0}function wa(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function ka(e){const t=e.trim();return!(!t.startsWith("[@")||!t.endsWith("]"))||!!t.startsWith("@")}function Ea(e){const t=e.trim();if(t.startsWith("[@")&&t.endsWith("]")){const e=t.slice(2,-1),r=e.indexOf("=");if(-1===r)return{name:e.trim()};const n=e.slice(0,r).trim();let i=e.slice(r+1).trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1)),{name:n,value:i}}if(t.startsWith("@"))return{name:t.substring(1).trim()};throw Error("Invalid attribute syntax: "+e)}function xa(e,t){for(const r of e)t(r);return e}function Ca(e,t,r){for(const n of e)for(const e of t)r(n,e);return e}function Aa(e,t,r){const n=e.hasAttribute(t);void 0!==r?n&&e.getAttribute(t)===r?e.removeAttribute(t):e.setAttribute(t,r):n?e.removeAttribute(t):e.setAttribute(t,"")}function Sa(e){if(!e)return[];if("string"==typeof e)return e.trim().split(/[\s,]+/).map(e=>{const t=e.trim();return t.startsWith(".")?t.substring(1):t}).filter(e=>e.length>0&&La(e));if(Array.isArray(e))return e.map(e=>{const t=(e+"").trim();return t.startsWith(".")?t.substring(1):t}).filter(e=>e.length>0&&La(e));const t=(e+"").trim(),r=t.startsWith(".")?t.substring(1):t;return r.length>0&&La(r)?[r]:[]}function Ta(e){const t=e.trim();return/^\{[^}]+\}$/.test(t)}function La(e){if(!e||0===e.trim().length)return!1;const t=e.trim();return!!Ta(t)||/^[a-zA-Z_-][a-zA-Z0-9_-]*$/.test(t)}function Oa(e,t){return e.map(e=>{if(Ta(e)){const r=function(e){const t=e.trim(),r=t.match(/^\{(.+)\}$/);return r?r[1].trim():t}(e),n=t.locals.get(r)??t.globals.get(r);return null!=n?n+"":(de(`Dynamic class variable '${r}' not found in context`),"")}return e}).filter(e=>e.length>0)}function ja(e){return function(t,r){Object.defineProperty(t.prototype,"name",{value:e.name,writable:!1,enumerable:!0})}}function Pa(e){return{...e}}function Ia(e){return()=>new e}function qa(e,t){return e?`[${e}] ${t}`:t}function Na(e,t,r){if(hr(e))return e;if(!e){const e=t.me;if(!e)throw Error(qa(r,"No target element \u2014 provide explicit target or ensure context.me is set"));return Ma(e)}if("string"==typeof e){const n=e.trim();if("me"===n){if(!t.me)throw Error(qa(r,'Context reference "me" is not available'));return Ma(t.me)}if("it"===n){if(!hr(t.it))throw Error(qa(r,'Context reference "it" is not an HTMLElement'));return t.it}if("you"===n){if(!t.you)throw Error(qa(r,'Context reference "you" is not available'));return Ma(t.you)}const i=t.me?.ownerDocument??("undefined"!=typeof document?document:null);if(!i)throw Error(qa(r,"DOM not available \u2014 cannot resolve element selector"));const a=i.querySelector(n);if(!a)throw Error(qa(r,"Element not found with selector: "+n));if(!hr(a))throw Error(qa(r,"Element found but is not an HTMLElement: "+n));return a}throw Error(qa(r,"Invalid target type: "+typeof e))}function Ra(e,t){if(Array.isArray(e))return e.filter(hr);if(yr(e))return Array.from(e).filter(hr);if(hr(e))return[e];if(!e){const e=t.me;return e&&hr(e)?[e]:[]}if("string"==typeof e){const r=e.trim();if("me"===r)return t.me&&hr(t.me)?[t.me]:[];if("it"===r)return hr(t.it)?[t.it]:[];if("you"===r)return t.you&&hr(t.you)?[t.you]:[];const n=t.me?.ownerDocument??("undefined"!=typeof document?document:null);if(n){let e=r;e.startsWith("<")&&e.endsWith("/>")&&(e=e.slice(1,-2).trim());const t=n.querySelectorAll(e);return Array.from(t).filter(hr)}}return[]}function Ma(e){if(hr(e))return e;throw Error("Value is not an HTMLElement")}function $a(e,t,r){switch(e.toLowerCase()){case"my":case"me":if(!t.me)throw Error(qa(r,'No "me" element in context'));if(!hr(t.me))throw Error(qa(r,"context.me is not an HTMLElement"));return t.me;case"its":case"it":if(!t.it)throw Error(qa(r,'No "it" value in context'));if(!hr(t.it))throw Error(qa(r,"context.it is not an HTMLElement"));return t.it;case"your":case"you":if(!t.you)throw Error(qa(r,'No "you" element in context'));if(!hr(t.you))throw Error(qa(r,"context.you is not an HTMLElement"));return t.you;default:throw Error(qa(r,"Unknown possessive: "+e))}}"function"==typeof SuppressedError&&SuppressedError;const _a=["on","from","to","in","with","at"];async function za(e,t,r,n,i={},a){let s=e;if(i.filterPrepositions&&e&&(s=e.filter(e=>{const t=e;return"identifier"!==t?.type||"string"!=typeof t.name||!_a.includes(t.name.toLowerCase())})),(!s||0===s.length)&&i.fallbackModifierKey&&a){const e=a[i.fallbackModifierKey];e&&(s=[e])}if(!s||0===s.length){if(!r.me)throw Error(n+" command: no target specified and context.me is null");if(!hr(r.me))throw Error(n+" command: context.me must be an HTMLElement");return[r.me]}const o=[];for(const e of s){const i=await t.evaluate(e,r);if(""!==i&&("string"!=typeof i||""!==i.trim()))if(hr(i))o.push(i);else if(yr(i)){const e=Array.from(i).filter(hr);o.push(...e)}else if(Array.isArray(i)){const e=i.filter(hr);o.push(...e)}else{if("string"!=typeof i){if(null==i)continue;throw Error(`Invalid ${n} target: expected HTMLElement or CSS selector, got ${typeof i}`)}try{let e=i;e.startsWith("<")&&e.endsWith("/>")&&(e=e.slice(1,-2).trim());const t=r.me?.ownerDocument??("undefined"!=typeof document?document:null);if(!t)throw Error("DOM not available - cannot resolve element selector");const n=t.querySelectorAll(e),a=Array.from(n).filter(hr);o.push(...a)}catch(e){throw Error(`Invalid CSS selector: "${i}" - ${e instanceof Error?e.message:e+""}`)}}}if(0===o.length){if(!r.me)throw Error(n+" command: no target specified and context.me is null");if(!hr(r.me))throw Error(n+" command: context.me must be an HTMLElement");return[r.me]}return o}function Va(e){return"string"==typeof e&&e.trim().startsWith("*")}function Ha(e){const t=function(e){const t=e.trim();if(!t.startsWith("*"))return null;const r=t.substring(1).trim();return r?{property:r}:null}(e);if(!t)return null;const r=t.property.toLowerCase();return["display","visibility","opacity"].includes(r)?r:null}function Ba(e,t,r){e.style.setProperty(t,r)}const Wa=["dialog","details","summary","select"];function Da(e){return e&&"object"==typeof e?"string"==typeof e.selector?e.selector:"string"==typeof e.value?e.value:"string"==typeof e.name?e.name:null:null}async function Fa(e,t,r){return function(e){if(!e||"object"!=typeof e)return!1;const t=e.type;if("selector"!==t&&"cssSelector"!==t&&"classSelector"!==t)return!1;const r=Da(e);return"string"==typeof r&&r.startsWith(".")}(e)||function(e){if(!e||"object"!=typeof e)return!1;const t=e.type;if("selector"!==t&&"cssSelector"!==t&&"cssProperty"!==t)return!1;const r=Da(e);return"string"==typeof r&&r.startsWith("*")}(e)?{value:Da(e),extractedFromNode:!0}:function(e){if(!e||"object"!=typeof e)return!1;if("attributeAccess"===e.type)return!0;if("selector"===e.type||"cssSelector"===e.type){const t=Da(e);return"string"==typeof t&&t.startsWith("@")}return!1}(e)?{value:(n=e,"attributeAccess"===n.type?"@"+n.attributeName:Da(n)),extractedFromNode:!0}:{value:await t.evaluate(e,r),extractedFromNode:!1};var n}class Ua{async resolveTargets(e,t,r,n){return za(e,t,r,this.mode,{filterPrepositions:!0,fallbackModifierKey:this.preposition},n)}async evaluateFirst(e,t,r){return Fa(e,t,r)}parseClassNames(e){return Sa(e)}isAttribute(e){return ka(e.trim())}isCSSProperty(e){return Va(e.trim())}validateTargets(e){return Array.isArray(e)&&function(e){return Array.isArray(e)&&e.length>0&&e.every(e=>hr(e))}(e)}validateType(e,t){return function(e,t){return"string"==typeof e&&t.includes(e)}(e,t)}validateStringArray(e,t=1){return Array.isArray(e)&&function(e,t=1){return Array.isArray(e)&&e.length>=t&&e.every(e=>"string"==typeof e&&e.length>0)}(e,t)}}let Ka=(()=>{let e,t,r=[ja({name:"add"})],n=[],i=Ua;var a=t=class extends i{constructor(){super(...arguments),this.mode="add",this.preposition="to"}get metadata(){return a.metadata}async parseInput(e,t,r){if(!e.args||0===e.args.length)throw Error("add command requires an argument");const{value:n}=await this.evaluateFirst(e.args[0],t,r);if("object"==typeof n&&null!==n&&!Array.isArray(n))return{type:"styles",styles:n,targets:await this.resolveTargets(e.args.slice(1),t,r,e.modifiers)};if("string"==typeof n){const i=n.trim();if(this.isAttribute(i)){const{name:n,value:a}=function(e){const t=Ea(e);return{name:t.name,value:t.value??""}}(i);return{type:"attribute",name:n,value:a,targets:await this.resolveTargets(e.args.slice(1),t,r,e.modifiers)}}if(this.isCSSProperty(i)){const n=i.substring(1).trim();if(2>e.args.length)throw Error("add *property requires a value argument");const a=await t.evaluate(e.args[1],r);return{type:"styles",styles:{[n]:a+""},targets:await this.resolveTargets(e.args.slice(2),t,r,e.modifiers)}}}const i=this.parseClassNames(n);if(0===i.length)throw Error("add command: no valid class names found");return{type:"classes",classes:i,targets:await this.resolveTargets(e.args.slice(1),t,r,e.modifiers)}}async execute(e,t){switch(e.type){case"classes":{const r=Oa(e.classes,t);r.length>0&&Ca(e.targets,r,(e,t)=>{e.classList.contains(t)||e.classList.add(t)});break}case"attribute":r=e.name,n=e.value,xa(e.targets,e=>{e.setAttribute(r,n)});break;case"styles":!function(e,t){Ca(e,Object.entries(t),(e,[t,r])=>{e.style.setProperty(t,r)})}(e.targets,e.styles)}var r,n}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;if(!this.validateType(t.type,["classes","attribute","styles"]))return!1;if(!this.validateTargets(t.targets))return!1;if("classes"===t.type){if(!this.validateStringArray(e.classes,1))return!1}else if("attribute"===t.type){if("string"!=typeof e.name||0===e.name.length)return!1;if("string"!=typeof e.value)return!1}else if("styles"===t.type){const t=e;if("object"!=typeof t.styles||null===t.styles)return!1;if(Array.isArray(t.styles))return!1;const r=t.styles;if(0===Object.keys(r).length)return!1;if(!Object.values(r).every(e=>"string"==typeof e))return!1}return!0}};return wa(t,"AddCommand"),(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),a=t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),t.metadata=Pa({description:"Add CSS classes, attributes, or styles to elements",syntax:"add <classes|@attr|{styles}> [to <target>]",examples:["add .active to me",'add "active selected" to <button/>',"add .highlighted to #modal",'add [@data-test="value"] to #element'],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),ba(t,n),a=t})();const Za=Ia(Ka),Xa={before:"beforebegin",prepend:"afterbegin",append:"beforeend",after:"afterend",into:"replace"};function Ga(e){const t=Xa[e];if(void 0===t)throw Error(`Unknown semantic position '${e}'. Valid positions: ${Object.keys(Xa).join(", ")}.`);return t}function Ja(e){return e.includes("<")&&e.includes(">")}function Ya(e,t,r){!function(e,t,r){"replace"!==r?fr(t)?function(e,t,r){switch(r){case"beforebegin":e.parentElement?.insertBefore(t,e);break;case"afterbegin":e.insertBefore(t,e.firstChild);break;case"beforeend":e.appendChild(t);break;case"afterend":e.parentElement?.insertBefore(t,e.nextSibling)}}(e,t,r):function(e,t,r){const n=r,i=["beforebegin","afterbegin","beforeend","afterend"];if(!i.includes(n))throw Error(`Invalid insert position '${r}'. Expected one of ${i.join(", ")} (or 'replace').`);Ja(t)?e.insertAdjacentHTML(n,t):e.insertAdjacentText(n,t)}(e,t,r):function(e,t){fr(t)?(e.innerHTML="",e.appendChild(t)):Ja(t)?e.innerHTML=t:e.textContent=t}(e,t)}(e,t,Ga(r))}function Qa(e,t,r){const n=e;if("function"==typeof n.moveBefore&&t.isConnected&&e.isConnected)try{return void n.moveBefore(t,r)}catch{}e.insertBefore(t,r)}function es(e,t,r){switch(r){case"beforeend":for(const r of t)Qa(e,r,null);break;case"afterbegin":for(let r=t.length-1;r>=0;r--)Qa(e,t[r],e.firstChild);break;case"beforebegin":{const r=e.parentElement;if(!r)return;for(const n of t)Qa(r,n,e);break}case"afterend":{const r=e.parentElement;if(!r)return;for(let n=t.length-1;n>=0;n--)Qa(r,t[n],e.nextSibling);break}case"replace":e.innerHTML="";for(const r of t)Qa(e,r,null)}}function ts(e){return!!e.parentNode&&(e.remove(),!0)}let rs=(()=>{let e,t,r=[ja({name:"remove"})],n=[],i=Ua;var a=t=class extends i{constructor(){super(...arguments),this.mode="remove",this.preposition="from"}get metadata(){return a.metadata}async parseInput(e,t,r){if(!e.args||0===e.args.length)throw Error("remove command requires an argument");const{value:n}=await this.evaluateFirst(e.args[0],t,r);if(hr(n))return{type:"element",targets:[n]};if(Array.isArray(n)&&n.length>0&&hr(n[0]))return{type:"element",targets:n.filter(e=>hr(e))};if("string"==typeof n){const i=n.trim();if(this.isAttribute(i))return{type:"attribute",name:Ea(i).name,targets:await this.resolveTargets(e.args.slice(1),t,r,e.modifiers)};if(this.isCSSProperty(i))return{type:"styles",properties:[i.substring(1).trim()],targets:await this.resolveTargets(e.args.slice(1),t,r,e.modifiers)}}const i=this.parseClassNames(n);if(0===i.length)throw Error("remove command: no valid class names found");return{type:"classes",classes:i,targets:await this.resolveTargets(e.args.slice(1),t,r,e.modifiers)}}execute(e,t){switch(e.type){case"classes":{const r=Oa(e.classes,t);r.length>0&&Ca(e.targets,r,(e,t)=>{e.classList.remove(t)});break}case"attribute":r=e.name,xa(e.targets,e=>{e.removeAttribute(r)});break;case"styles":!function(e,t){Ca(e,t,(e,t)=>{e.style.removeProperty(t)})}(e.targets,e.properties);break;case"element":for(const t of e.targets)ts(t)}var r}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;if(!this.validateType(t.type,["classes","attribute","styles","element"]))return!1;if(!this.validateTargets(t.targets))return!1;if("classes"===t.type){if(!this.validateStringArray(e.classes,1))return!1}else if("attribute"===t.type){if("string"!=typeof e.name||0===e.name.length)return!1}else if("styles"===t.type&&!this.validateStringArray(e.properties,1))return!1;return!0}};return wa(t,"RemoveCommand"),(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),a=t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),t.metadata=Pa({description:"Remove CSS classes, attributes, styles, or elements from the DOM",syntax:"remove <classes|@attr|*prop|element> [from <target>]",examples:["remove .active from me",'remove "active selected" from <button/>',"remove .highlighted from #modal","remove me","remove closest .item"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),ba(t,n),a=t})();const ns=Ia(rs);function is(e){const t=e.trim().match(/^(\d+(?:\.\d+)?)\s*(s|ms|sec|seconds?|milliseconds?)?$/i);if(!t)return null;const r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();return"ms"===n||"millisecond"===n||"milliseconds"===n?{number:r,milliseconds:Math.floor(r)}:"s"===n||"sec"===n||"second"===n||"seconds"===n?{number:r,milliseconds:Math.floor(1e3*r)}:null}function as(e,t=300){if("number"==typeof e)return Math.max(0,Math.floor(e));if("string"==typeof e){const r=is(e);return r?r.milliseconds:t}return t}function ss(e){if("number"==typeof e){if(0>e)throw Error("Duration must be >= 0");return Math.floor(e)}if("string"==typeof e){const t=is(e);if(!t)throw Error(`Invalid duration format: "${e}"`);return t.milliseconds}throw Error("Invalid duration type: "+typeof e)}function os(e){return e&&"none"!==e?e.split(",").map(e=>{const t=parseFloat(e.trim());return isNaN(t)?0:e.includes("s")&&!e.includes("ms")?1e3*t:t}):[0]}function ls(e,t){let r=0;for(let n=0;e.length>n;n++)r=Math.max(r,(e[n]||0)+(t[n]||0));return r}function cs(e){return 0===e.length?[]:"SUMMARY"===e[0].tagName?e.map(e=>e.closest("details")).filter(e=>null!==e):e}function us(e){return"DIALOG"===e.tagName}function ds(e){return"DETAILS"===e.tagName}function ms(e,t,r){return()=>{"class"===t?e.classList.toggle(r):"attribute"===t&&Aa(e,r)}}function ps(e,t,r,n){const i=ms(e,t,r),a=setTimeout(i,n);return()=>{clearTimeout(a)}}function hs(e,t,r,n){const i=ms(e,t,r),a=()=>{i(),e.removeEventListener(n,a)};return e.addEventListener(n,a,{once:!0}),()=>{e.removeEventListener(n,a)}}function fs(e,t,r){if(t.startsWith("@")){const n=t.substring(1);return void(!1===r?e.removeAttribute(n):e.setAttribute(n,!0===r?"":r+""))}const n=r+"";switch(t){case"textContent":return void(e.textContent=n);case"innerHTML":return void(e.innerHTML=n);case"innerText":return void(e.innerText=n);case"id":return void(e.id=n);case"className":return void(e.className=n);case"value":return void("value"in e&&(e.value=n));case"checked":return void("checked"in e&&(e.checked=!!r))}if(t.includes(".")){const n=t.split(".");let i=e;for(let e=0;n.length-1>e;e++)if(i=i[n[e]],null==i)return;return void(i[n[n.length-1]]=r)}if(t.includes("-")||t in e.style)e.style.setProperty(t,n);else try{e[t]=r}catch(e){if(!(e instanceof TypeError&&(e.message.includes("only a getter")||e.message.includes("read only"))))throw Error(`Cannot set property '${t}': ${e instanceof Error?e.message:"Unknown error"}`)}}function ys(e){return null==e||""===e}const gs=/^the\s+(.+?)\s+of\s+(.+)$/i,vs=new Set(["disabled","checked","hidden","readOnly","readonly","required","multiple","selected","autofocus","autoplay","controls","loop","muted","open","reversed","async","defer","noValidate","novalidate","formNoValidate","formnovalidate","draggable","spellcheck","contentEditable"]);function bs(e){return"string"==typeof e&&gs.test(e)}function ws(e,t){const r=e.match(gs);if(!r)return null;try{return{element:Na(r[2].trim(),t),property:r[1].trim()}}catch{return null}}async function ks(e,t,r){if(function(e){return!(!e||"object"!=typeof e)&&"propertyOfExpression"===e.type&&"object"==typeof e.property&&null!==e.property}(e))return async function(e,t,r){const n=e.property?.name;if(!n)return null;let i=await t.evaluate(e.target,r);return Array.isArray(i)&&(i=i[0]),hr(i)?{element:i,property:n}:null}(e,t,r);if(function(e){return!(!e||"object"!=typeof e)&&"propertyAccess"===e.type&&("string"==typeof e.property||"object"==typeof e.property&&null!==e.property&&"string"==typeof e.property.name)}(e))return async function(e,t,r){const n="string"==typeof e.property?e.property:e.property?.name;if(!n)return null;let i=await t.evaluate(e.object,r);return Array.isArray(i)&&(i=i[0]),hr(i)?{element:i,property:n}:null}(e,t,r);const n=e;if("possessiveExpression"===n?.type||"memberExpression"===n?.type){const e=n.object,i=n.property;let a=await t.evaluate(e,r);if(Array.isArray(a)&&(a=a[0]),!hr(a))return null;const s=i?.name||i?.value;return s?{element:a,property:s}:null}return null}function Es(e){const{element:t,property:r}=e;return r.startsWith("*")?function(e,t){return window.getComputedStyle(e).getPropertyValue(t)}(t,r.substring(1)):Mr(t,r)}function xs(e,t){const{element:r,property:n}=e;n.startsWith("*")?Ba(r,n.substring(1),t+""):fs(r,n,t)}async function Cs(e,t,r){let n,i;if(e?.for){const i=await t.evaluate(e.for,r);n="number"==typeof i?i:"string"==typeof i?as(i):void 0}if(e?.until){const n=await t.evaluate(e.until,r);"string"==typeof n&&(i=n)}return{duration:n,untilEvent:i}}function As(e,t){const r=t?.name,n=function(e){if(!e||"object"!=typeof e)return!1;if("identifier"!==e.type)return!1;const t=e.name;return"string"==typeof t&&function(e){if("string"!=typeof e)return!1;const t=e.toLowerCase();return Wa.includes(t)}(t)}(t);if(hr(e)||Array.isArray(e)&&e.every(e=>hr(e)))return{type:"element",expression:""};if(n&&r)return{type:"element",expression:r};if("string"==typeof e){const t=e.trim();return t.startsWith("@")||t.startsWith("[@")?{type:"attribute",expression:t}:t.startsWith("*")?{type:"css-property",expression:t}:t.startsWith(".")?{type:"class",expression:t}:t.startsWith("#")||function(e){if("string"!=typeof e)return!1;const t=e.toLowerCase();return Wa.some(e=>t.includes(e))}(t)?{type:"element",expression:t}:{type:"class",expression:t}}return{type:"class",expression:""}}const Ss=Ia((()=>{let e,t,r=[ja({name:"toggle"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args?.length)throw Error("toggle command requires an argument");let n=!1;if(function(e){if(!e||"asExpression"!==e.type)return!1;const t=e.targetType,r="string"==typeof t?t:t?.name;return"string"==typeof r&&"modal"===r.toLowerCase()}(e.args[0])){n=!0;const t=e.args[0].expression;e={...e,args:[t,...e.args.slice(1)]}}const i=e.args[0],a=i?.name;if("between"===a&&e.args.length>=4){const{duration:n,untilEvent:i}=await Cs(e.modifiers,t,r),a=async e=>{const n=e;return"selector"===n?.type?n.value:t.evaluate(e,r)},s=await a(e.args[1]),o=await a(e.args[3]),l=[];for(let t=4;e.args.length>t;t++){const r=e.args[t]?.name;"on"!==r&&"from"!==r&&l.push(e.args[t])}const c={filterPrepositions:!0,fallbackModifierKey:"on"},u=await za(l,t,r,"toggle",c,e.modifiers);return{type:"classes-between",classA:(s+"").replace(/^\./,""),classB:(o+"").replace(/^\./,""),targets:u,duration:n,untilEvent:i}}const s=await ks(i,t,r);if(s)return{type:"property",target:s};if("selector"===i.type&&"string"==typeof i.value&&i.value.startsWith("*")){let n=i.value,a=1;if("*"===n&&e.args.length>1&&"identifier"===e.args[1].type&&(n="*"+e.args[1].name,a=2),"*"===n&&e.modifiers?.on){const i=e.modifiers.on?.name;if(i&&["display","visibility","opacity"].includes(i)){n="*"+i;const{duration:a,untilEvent:s}=await Cs(e.modifiers,t,r),o=Ha(n);if(o){const e=r.me;return{type:"css-property",property:o,targets:e?[e]:[],duration:a,untilEvent:s}}}}const s=Ha(n);if(s){const{duration:n,untilEvent:i}=await Cs(e.modifiers,t,r),o={filterPrepositions:!0,fallbackModifierKey:"on"};return{type:"css-property",property:s,targets:await za(e.args.slice(a),t,r,"toggle",o,e.modifiers),duration:n,untilEvent:i}}}const{duration:o,untilEvent:l}=await Cs(e.modifiers,t,r),{value:c}=await Fa(i,t,r);if(bs(c)){const e=ws(c,r);if(e)return{type:"property",target:e}}const{type:u,expression:d}=As(c,i),m={filterPrepositions:!0,fallbackModifierKey:"on"};switch(u){case"attribute":{const{name:n,value:i}=Ea(d);return{type:"attribute",name:n,value:i,targets:await za(e.args.slice(1),t,r,"toggle",m,e.modifiers),duration:o,untilEvent:l}}case"css-property":{const n=Ha(d);if(!n)throw Error("Invalid CSS property: "+d);return{type:"css-property",property:n,targets:await za(e.args.slice(1),t,r,"toggle",m,e.modifiers)}}case"element":{let a;if(hr(c))a=[c];else if(Array.isArray(c)&&c.every(e=>hr(e)))a=c;else if(d){const e=document.querySelectorAll(d);a=Array.from(e).filter(e=>hr(e))}else a=await za([i],t,r,"toggle",m,e.modifiers);const s=function(e){if(0===e.length)return null;const t=e[0].tagName;if(!e.every(e=>e.tagName===t))return null;switch(t){case"DIALOG":return"dialog";case"DETAILS":return"details";case"SELECT":return"select";case"SUMMARY":return e.map(e=>e.closest("details")).filter(e=>null!==e).length>0?"details":null;default:return null}}(a);if("dialog"===s){const i=n?"modal":await async function(e,t,r,n){if(t?.as){const e=await r.evaluate(t.as,n);if("string"==typeof e&&"modal"===e.toLowerCase())return"modal"}if(e.length>=2){const t=await r.evaluate(e[1],n);if("string"==typeof t){const i=t.toLowerCase();if("modal"===i||"as modal"===i)return"modal";if("as"===i&&e.length>=3){const t=await r.evaluate(e[2],n);if("string"==typeof t&&"modal"===t.toLowerCase())return"modal"}}}return"non-modal"}(e.args,e.modifiers,t,r);return{type:"dialog",mode:i,targets:a}}return"details"===s?{type:"details",targets:cs(a)}:"select"===s?{type:"select",targets:a}:{type:"classes",classes:Sa(d),targets:a,duration:o,untilEvent:l}}default:{const n=Sa(d||c);if(!n.length)throw Error("toggle command: no valid class names found");return{type:"classes",classes:n,targets:await za(e.args.slice(1),t,r,"toggle",m,e.modifiers),duration:o,untilEvent:l}}}}async execute(e,t){switch(e.type){case"classes":{const r=Oa(e.classes,t);if(0===r.length)return[...e.targets];if(Ca(e.targets,r,(e,t)=>{e.classList.toggle(t)}),(e.duration||e.untilEvent)&&r.length)for(const t of e.targets)e.duration&&ps(t,"class",r[0],e.duration),e.untilEvent&&hs(t,"class",r[0],e.untilEvent);return[...e.targets]}case"attribute":if(r=e.name,n=e.value,xa(e.targets,e=>{Aa(e,r,n)}),e.duration||e.untilEvent)for(const t of e.targets)e.duration&&ps(t,"attribute",e.name,e.duration),e.untilEvent&&hs(t,"attribute",e.name,e.untilEvent);return[...e.targets];case"css-property":return xa(e.targets,t=>function(e,t){const r=window.getComputedStyle(e);switch(t){case"display":"none"===r.display?(e.style.display=e.dataset.previousDisplay||"block",delete e.dataset.previousDisplay):(e.dataset.previousDisplay=r.display,e.style.display="none");break;case"visibility":e.style.visibility="hidden"===r.visibility?"visible":"hidden";break;case"opacity":e.style.opacity=0===parseFloat(r.opacity)?"1":"0"}}(t,e.property));case"property":return function(e){const t=Es(e),r=e.property,n=r.startsWith("@")?r.substring(1):r;if("boolean"==typeof t||vs.has(n)||vs.has(n.toLowerCase())){const r=!t;return xs(e,r),r}if("number"==typeof t){const r=0===t?1:0;return xs(e,r),r}if("string"==typeof t){const n="__ht_"+r,i=e.element[n];return""===t&&void 0!==i?(xs(e,i),i):(e.element[n]=t,xs(e,""),"")}xs(e,!t)}(e.target),[e.target.element];case"dialog":return xa(e.targets,t=>{return n=e.mode,void((r=t).open?r.close():"modal"===n?r.showModal():r.show());var r,n});case"details":return xa(e.targets,e=>{var t;(t=e).open=!t.open});case"select":return xa(e.targets,e=>function(e){if(document.activeElement===e)e.blur();else{if(e.focus(),"showPicker"in e&&"function"==typeof e.showPicker)try{return void e.showPicker()}catch{}const t=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});e.dispatchEvent(t)}}(e));case"classes-between":for(const t of e.targets){const r=t.classList.contains(e.classA),n=t.classList.contains(e.classB);r?(t.classList.remove(e.classA),t.classList.add(e.classB)):n?(t.classList.remove(e.classB),t.classList.add(e.classA)):t.classList.add(e.classA)}if(e.duration||e.untilEvent)for(const t of e.targets)e.duration&&ps(t,"class",e.classA,e.duration),e.untilEvent&&hs(t,"class",e.classA,e.untilEvent);return[...e.targets]}var r,n}};return wa(t,"ToggleCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Toggle classes, attributes, or interactive elements",syntax:["toggle <class> [on <target>]","toggle @attr","toggle <element> [as modal]","toggle <expr> for <duration>"],examples:["toggle .active on me","toggle @disabled","toggle #myDialog as modal","toggle .loading for 2s"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),ba(t,n),i=t})());const Ts=Ia((()=>{let e,t,r=[ja({name:"put"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args?.length)throw Error("put requires arguments");const n=e=>e?.type||"unknown",i=["into","before","after","at","at start of","at end of"];let a=-1,s=null;for(let t=0;e.args.length>t;t++){const r=e.args[t],o=n(r),l="literal"===o?r.value:r.name;if(("literal"===o||"identifier"===o)&&i.includes(l)){a=t,s=l;break}}let o=null,l=null;if(-1===a){const t=i.find(t=>e.modifiers[t]);if(t)o=e.args[0],s=t,l=e.modifiers[t];else if(3>e.args.length){if(2>e.args.length)throw Error("put requires content and position");o=e.args[0],s=e.args[1]?.value||e.args[1]?.name||"into"}else o=e.args[0],s=e.args[1]?.value||e.args[1]?.name||null,l=e.args[2]}else o=e.args.slice(0,a)[0]||null,l=e.args.slice(a+1)[0]||null;if(!o)throw Error("put requires content");if(!s)throw Error("put requires position keyword");const c=await t.evaluate(o,r),u=this.mapPosition(s);let d,m,p=null;if(l){const e=n(l),i=await ks(l,t,r);if(i)return{value:c,targets:[i.element],position:"into",memberPath:i.property};if("memberExpression"===e){const e=l.object,n=l.property;if("selector"===e?.type)p=e.value;else if("identifier"===e?.type){const i=e.name;if("my"===i||"me"===i||"I"===i){if(r.me&&n?.name)return{value:c,targets:[r.me],position:"into",memberPath:n.name}}else if("its"===i||"it"===i){const e=await t.evaluate(l,r);"string"==typeof e&&(p=e)}else p=i}if(p&&n?.name)d=n.name;else if(!p&&!d){const e=await t.evaluate(l,r);"string"==typeof e&&(p=e)}}else if("identifier"===e&&"me"===l.name)p=null;else if("selector"===e||"cssSelector"===e)p=l.value||l.selector;else if("literal"===e){const e=l.value;if("string"==typeof e&&bs(e)){const t=ws(e,r);if(t)return{value:c,targets:[t.element],position:"into",memberPath:t.property}}"string"==typeof e&&this.looksLikeCss(e)?p=e:m=e+""}else if("identifier"===e){const e=l.name;if(this.looksLikeCss(e))p=e;else{const n=xr(await t.evaluate(l,r));if(n)return{value:c,targets:n,position:u,memberPath:d};m=e}}else{const e=await t.evaluate(l,r),n=xr(e);if(n)return{value:c,targets:n,position:u,memberPath:d};"string"==typeof e&&(this.looksLikeCss(e)?p=e:m=e)}}return m?{value:c,targets:[],position:u,memberPath:d,variableName:m}:{value:c,targets:await this.resolveTargets(p,r),position:u,memberPath:d}}async execute(e,t){const{value:r,targets:n,position:i,memberPath:a,variableName:s}=e;if(s)return t.locals&&t.locals.set(s,r),t[s]=r,void Object.assign(t,{it:r});if(a)for(const e of n)this.setProperty(e,a,r);else for(const e of n){const t=this.parseValue(r);Array.isArray(t)?es(e,t,Ga(i)):Ya(e,t,i)}return n}mapPosition(e){switch(e){case"into":return"into";case"before":return"before";case"after":return"after";case"at start of":return"prepend";case"at end of":return"append";default:throw Error("Invalid position: "+e)}}async resolveTargets(e,t){if(!e||"me"===e){if(!t.me||!hr(t.me))throw Error("put: no target and context.me is null");return[t.me]}return Er(e)}parseValue(e){return hr(e)||Array.isArray(e)&&e.length>0&&e.every(hr)||fr(e)?e:null==e?"":e+""}looksLikeCss(e){return!!e&&(!!/^[#.\[]/.test(e)||(!(!/[>+~\s]/.test(e)||1>=e.length)||["div","span","p","a","button","input","form","ul","li","ol","table","tr","td","th","img","h1","h2","h3","h4","h5","h6","section","article","header","footer","nav","main","aside","dialog","label","select","option","textarea"].includes(e.toLowerCase())))}setProperty(e,t,r){const n=t.split(".");let i=e;for(let e=0;n.length-1>e;e++){if(!i[n[e]])throw Error(`Property path "${t}" does not exist`);i=i[n[e]]}i[n[n.length-1]]=r}};return wa(t,"PutCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Insert content into elements or properties",syntax:["put <value> into <target>","put <value> before <target>","put <value> after <target>"],examples:['put "Hello World" into me',"put <div>Content</div> before #target","put value into #elem's innerHTML"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),ba(t,n),i=t})());class Ls{async parseInput(e,t,r){const{targets:n}=await async function(e,t,r,n){return{targets:await za(e.args,t,r,n)}}(e,t,r,this.mode);return{targets:n,mode:this.mode,defaultDisplay:"show"===this.mode?"block":void 0}}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!(!Array.isArray(t.targets)||!t.targets.every(e=>hr(e))||"show"!==t.mode&&"hide"!==t.mode||"show"===t.mode&&"string"!=typeof t.defaultDisplay)}showElement(e,t="block"){const r=e.dataset.originalDisplay;void 0!==r?(e.style.display=r||t,delete e.dataset.originalDisplay):"none"===e.style.display&&(e.style.display=t),e.classList.add("show")}hideElement(e){if(!e.dataset.originalDisplay){const t=e.style.display;e.dataset.originalDisplay="none"===t?"":t}e.style.display="none",e.classList.remove("show")}}let Os=(()=>{let e,t,r=[ja({name:"hide"})],n=[],i=Ls;var a=t=class extends i{constructor(){super(...arguments),this.mode="hide"}get metadata(){return a.metadata}async execute(e,t){for(const t of e.targets)this.hideElement(t)}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!!Array.isArray(t.targets)&&!!t.targets.every(e=>hr(e))}};return wa(t,"HideCommand"),(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),a=t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),t.metadata=Pa({description:"Hide elements by setting display to none",syntax:"hide [<target>]",examples:["hide me","hide #modal","hide .warnings","hide <button/>"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),ba(t,n),a=t})();const js=Ia(Os);let Ps=(()=>{let e,t,r=[ja({name:"show"})],n=[],i=Ls;var a=t=class extends i{constructor(){super(...arguments),this.mode="show"}get metadata(){return a.metadata}async execute(e,t){const r=e.defaultDisplay||"block";for(const t of e.targets)this.showElement(t,r)}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!!Array.isArray(t.targets)&&!!t.targets.every(e=>hr(e))&&"string"==typeof t.defaultDisplay}};return wa(t,"ShowCommand"),(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),a=t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),t.metadata=Pa({description:"Show elements by restoring display property",syntax:"show [<target>]",examples:["show me","show #modal","show .hidden","show <button/>"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),ba(t,n),a=t})();const Is=Ia(Ps),qs={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Ns(e){return e.replace(/[&<>"']/g,e=>qs[e])}let Rs=(()=>{let e,t,r=[ja({name:"make"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n=e.modifiers.an??e.modifiers.a??e.args[0];if(!n)throw Error("Make command requires class name or DOM element expression");const i=n.raw;let a="string"==typeof i&&i.startsWith("<")?i:await t.evaluate(n,r);if(null==a)throw Error("Make command requires class name or DOM element expression");"string"==typeof a&&a.startsWith("<")&&(a=await async function(e,t){if(!e.includes("{"))return e;const r=/\{([^{}]+)\}/g,n=[];let i;for(;null!==(i=r.exec(e));){let e=i[0];try{const r=await cn(i[1].trim(),t);null!=r&&(e=Ns(r+""))}catch{}n.push({index:i.index,length:i[0].length,text:e})}let a=e;for(let e=n.length-1;e>=0;e--){const{index:t,length:r,text:i}=n[e];a=a.slice(0,t)+i+a.slice(t+r)}return a}(a,r));const s=void 0!==e.modifiers.an?"an":"a",o=await async function(e,t,r){if(!e)return[];if("arrayLiteral"===e.type&&Array.isArray(e.args)){const n=[];for(const i of e.args)n.push(await t.evaluate(i,r));return n}const n=await t.evaluate(e,r);return Array.isArray(n)?n:[n]}(e.modifiers.from,t,r),l=await async function(e,t,r){if(!e)return;if(("symbol"===e.type||"identifier"===e.type)&&"string"==typeof e.name)return e.name;const n=await t.evaluate(e,r);return"string"==typeof n?n:void 0}(e.modifiers.called,t,r);return{article:s,expression:a,constructorArgs:o,variableName:l}}async execute(e,t){const{expression:r,constructorArgs:n=[],variableName:i}=e,a="string"==typeof r&&r.startsWith("<"),s=a&&r.endsWith("/>")?function(e){const t=e.slice(1,-2);let r="div",n=t;const i=t.match(/^([a-zA-Z][a-zA-Z0-9]*)/);i&&(r=i[1],n=t.slice(i[0].length));const a=document.createElement(r),s=n.split(/(?=[.#])/);for(const e of s)if(e.startsWith("#")){const t=e.slice(1);t&&(a.id=t)}else if(e.startsWith(".")){const t=e.slice(1);t&&a.classList.add(t)}return a}(r):a&&/<\/[a-zA-Z]/.test(r)?function(e){const t=document.createElement("template");t.innerHTML=e.trim();const r=t.content.firstElementChild;if(r&&hr(r))return r;const n=document.createElement("div");n.innerHTML=e.trim();const i=n.firstElementChild;return i&&hr(i)?i:n}(r):function(e,t,r){if(hr(e))return e;const n=e+"";let i;if("undefined"!=typeof window&&(i=window[n]),i||"undefined"==typeof global||(i=global[n]),!i&&r.variables?.has(n)&&(i=r.variables.get(n)),!i||"function"!=typeof i)throw Error(`Constructor '${n}' not found or is not a function`);return 0===t.length?new i:new i(...t)}(r,n,t);return Object.assign(t,{it:s}),i&&br(i,s,t),s}};return wa(t,"MakeCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Create DOM elements or class instances",syntax:["make a <tag#id.class1.class2/>","make a <ClassName> from <args> called <identifier>"],examples:["make an <a.navlink/> called linkElement",'make a URL from "/path/", "https://origin.example.com"'],sideEffects:["dom-creation","data-mutation"],category:"dom",compatibility:"standard"}),ba(t,n),i=t})();const Ms=Ia(Rs),$s=Ia((()=>{let e,t,r=[ja({name:"empty"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{targets:await za(e.args,t,r,"empty",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers)}}async execute(e,t){for(const t of e.targets)t.innerHTML=""}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!!Array.isArray(t.targets)&&t.targets.every(e=>hr(e))}};return wa(t,"EmptyCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Remove all children from an element (sets innerHTML to empty)",syntax:["empty","empty <target>","empty the <target>"],examples:["empty me","empty #list","empty .results"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),ba(t,n),i=t})());function _s(e){if("string"!=typeof e)return;const t=e.toLowerCase().trim();return"non-modal"===t||"nonmodal"===t?"non-modal":"modal"===t?"modal":void 0}function zs(e){return e.hasAttribute("popover")}const Vs=Ia((()=>{let e,t,r=[ja({name:"open"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n=(e.args??[]).filter(e=>{const t=e;if("identifier"!==t?.type)return!0;const r=t.name?.toLowerCase();return"as"!==r&&"modal"!==r&&"non-modal"!==r&&"nonmodal"!==r}),i=cs(await za(n,t,r,"open",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers)),a=await async function(e,t,r,n){if(t?.as){const e=_s(await r.evaluate(t.as,n));if(e)return e}for(const t of e){const e=t;if("asExpression"!==e?.type)continue;const r=e.targetType,n=_s(r?.name??r?.value);if(n)return n}for(let t=0;e.length-1>t;t++){const i=e[t];if("identifier"===i?.type&&"as"===i.name?.toLowerCase()){const i=await r.evaluate(e[t+1],n);if("string"==typeof i){const e=i.toLowerCase().trim();if("non-modal"===e||"nonmodal"===e)return"non-modal";if("modal"===e)return"modal"}}}return"modal"}(e.args??[],e.modifiers??{},t,r);return{targets:i,dialogMode:a}}async execute(e,t){for(const t of e.targets)if(us(t))t.open||("modal"===e.dialogMode?t.showModal():t.show());else if(ds(t))t.open=!0;else if(zs(t)){const e=t;if("function"==typeof e.showPopover)try{e.showPopover()}catch{}}}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!(!Array.isArray(t.targets)||!t.targets.every(e=>hr(e))||"modal"!==t.dialogMode&&"non-modal"!==t.dialogMode)}};return wa(t,"OpenCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Open a dialog, details element, or popover",syntax:["open [<target>]","open <dialog> as modal","open <dialog> as non-modal"],examples:["open","open #myDialog","open #details","open #popup as non-modal"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),ba(t,n),i=t})());function Hs(e){return e.hasAttribute("popover")}const Bs=Ia((()=>{let e,t,r=[ja({name:"close"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{targets:cs(await za(e.args,t,r,"close",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers))}}async execute(e,t){for(const t of e.targets)if(us(t))t.open&&t.close();else if(ds(t))t.open=!1;else if(Hs(t)){const e=t;if("function"==typeof e.hidePopover)try{e.hidePopover()}catch{}}}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!!Array.isArray(t.targets)&&t.targets.every(e=>hr(e))}};return wa(t,"CloseCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Close a dialog, details element, or popover",syntax:["close","close <target>"],examples:["close","close #myDialog","close #details","close #popup"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),ba(t,n),i=t})());function Ws(e){const t=e.tagName;return"INPUT"===t||"TEXTAREA"===t}const Ds=Ia((()=>{let e,t,r=[ja({name:"select"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{targets:await za(e.args,t,r,"select",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers)}}async execute(e,t){if(0!==e.targets.length)for(const t of e.targets){if(Ws(t)){t.select();continue}const e=t.ownerDocument??("undefined"!=typeof document?document:null),r=e?.defaultView;if(!e||!r)continue;const n=r.getSelection?.();if(n)try{const r=e.createRange();r.selectNodeContents(t),n.removeAllRanges(),n.addRange(r)}catch{}}}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!!Array.isArray(t.targets)&&t.targets.every(e=>hr(e))}};return wa(t,"SelectCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Select the contents of a text field, or select the contents of a DOM element",syntax:["select","select <target>"],examples:["select #search","select <textarea/>","select me"],sideEffects:["focus","dom-mutation"],category:"dom",compatibility:"standard"}),ba(t,n),i=t})());function Fs(e){return"FORM"===e.tagName}const Us=Ia((()=>{let e,t,r=[ja({name:"reset"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{targets:await za(e.args,t,r,"reset",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers)}}async execute(e,t){for(const t of e.targets)Fs(t)&&t.reset()}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!!Array.isArray(t.targets)&&t.targets.every(e=>hr(e))}};return wa(t,"ResetCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Reset a <form> element to its default values (HTMLFormElement.reset())",syntax:["reset","reset <target>"],examples:["reset","reset #myForm","reset <form/>"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),ba(t,n),i=t})());function Ks(e,t){if("boolean"==typeof e)return e;if("function"==typeof e)return!0;if(e instanceof Promise)throw Error("Condition must be awaited - use await in the condition expression");if("string"==typeof e){if("me"===e)return!!t.me;if("it"===e)return!!t.it;if("you"===e)return!!t.you;const r=vr(e,t);return void 0!==r?!!r:!!e}return!!e}const Zs=Ia((()=>{let e,t,r=[ja({name:"if"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n="unless"===e.commandName?.toLowerCase()?"unless":"if";if(!e.args||0===e.args.length)throw Error(n+" command requires a condition to evaluate");let i,a;if("unless"===n){if(2>e.args.length)throw Error("unless command requires a condition and at least one command");i=e.args[1]}else if(e.args.length>=2&&e.args[1]?(i=e.args[1],a=3>e.args.length?void 0:e.args[2]):e.modifiers?.then&&(i=e.modifiers.then,a=e.modifiers.else),!i)throw Error('if command requires "then" branch with commands');return{mode:n,condition:await t.evaluate(e.args[0],r),thenCommands:i,elseCommands:a}}async execute(e,t){const{mode:r,condition:n,thenCommands:i,elseCommands:a}=e,s=Ks(n,t);let o,l;return("unless"===r?!s:s)?(o="then",l=await this.executeCommandsOrBlock(i,t)):a&&"if"===r?(o="else",l=await this.executeCommandsOrBlock(a,t)):o="none",{mode:r,conditionResult:s,executedBranch:o,result:l}}async executeCommandsOrBlock(e,t){return"block"===e?.type?this.executeBlock(e,t):this.executeCommands(Array.isArray(e)?e:[e],t)}async executeBlock(e,t){const r=t.locals.get("_runtimeExecute");if(!r)throw Error("Runtime execute function not available");let n;if(e.commands?.length)for(const i of e.commands)n=await r(i,t);return n}async executeCommands(e,t){let r;for(const n of e)if(n?.execute)r=await n.execute(t);else if("function"==typeof n)r=await n();else if(n&&"object"==typeof n&&"string"==typeof n.type){const e=t.locals.get("_runtimeExecute");if(!e)throw Error("Runtime execute function not available");r=await e(n,t)}else r=n;return r}};return wa(t,"ConditionalCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Conditional execution based on boolean expressions",syntax:["if <condition> then <commands>","if <condition> then <commands> else <commands>","unless <condition> <commands>"],examples:["if x > 5 then add .active","if user.isAdmin then show #adminPanel else hide #adminPanel","unless user.isLoggedIn showLoginForm"],sideEffects:["conditional-execution"],aliases:["unless"],category:"control-flow",compatibility:"standard"}),ba(t,n),i=t})()),Xs=Zs,Gs=Zs;let Js=(()=>{let e,t,r=[ja({name:"repeat"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){let n;if(e.modifiers?.index){const i=await t.evaluate(e.modifiers.index,r);"string"==typeof i&&(n=i)}let i,a=e.modifiers?.block||e.modifiers?.commands;if(!a){const t=[];for(let r=e.args.length-1;r>=0;r--){const n=e.args[r];if("block"===n?.type&&n.commands&&(t.unshift(n),2===t.length))break}2===t.length?(a=t[0],i=t[1]):1===t.length&&(a=t[0])}const s=e.args[0],o="identifier"===s?.type?s.name:null,l=!!e.modifiers?.bottomTested&&await t.evaluate(e.modifiers.bottomTested,r);if("for"===o||e.modifiers?.for){const s=e.args[1],o=s?.value||s?.name,l=e.args[2]?await t.evaluate(e.args[2],r):void 0;if(!o||void 0===l)throw Error("for loops require variable and collection");return{type:"for",variable:o,collection:Array.isArray(l)?l:[l],indexVariable:n,commands:a,elseCommands:i}}if("times"===o||e.modifiers?.times){const s=e.args[1],o=s?await t.evaluate(s,r):void 0,l="number"==typeof o?o:parseInt(o+"",10);if(isNaN(l))throw Error("times loops require a count number");return{type:"times",count:l,indexVariable:n,commands:a,elseCommands:i}}if("while"===o||e.modifiers?.while){const t=e.args[1]||e.modifiers?.while;if(!t)throw Error("while loops require a condition");return{type:"while",condition:t,indexVariable:n,commands:a,elseCommands:i,bottomTested:l}}if("until"===o&&e.modifiers?.from||"until-event"===o){const s=e.args[1],o=s?.value||s?.name;if(!o)throw Error("until-event loops require an event name");let l=r.me;if(e.args[2]){const n=e.args[2];if("identifier"===n?.type&&"document"===n.name)l=document;else if("identifier"===n?.type&&"window"===n.name&&"undefined"!=typeof window)l=window;else{const n=await t.evaluate(e.args[2],r);n instanceof EventTarget?l=n:"document"===n?l=document:"undefined"!=typeof window&&n===window&&(l=window)}}return{type:"until-event",eventName:o,eventTarget:l,indexVariable:n,commands:a,elseCommands:i}}if("until"===o||e.modifiers?.until){const t=e.args[1]||e.modifiers?.until;if(!t)throw Error("until loops require a condition");return{type:"until",condition:t,indexVariable:n,commands:a,elseCommands:i,bottomTested:l}}if("forever"===o||e.modifiers?.forever)return{type:"forever",indexVariable:n,commands:a,elseCommands:i};throw Error("repeat command requires a loop type (for/times/while/until/forever)")}async execute(e,t){const{type:r,variable:n,collection:i,condition:a,count:s,indexVariable:o,commands:l,elseCommands:c,bottomTested:u,eventName:d,eventTarget:m}=e;let p,h;switch(r){case"for":({config:p,iterCtx:h}=function(e,t,r){return{config:{type:"for",shouldContinue:e=>(e.collection?.length??0)>e.index,beforeIteration:(e,t)=>{e.item=e.collection?.[e.index],e.itemVariable&&t.locals&&t.locals.set(e.itemVariable,e.item)}},iterCtx:{index:0,collection:e,itemVariable:t,indexVariable:r}}}(i,n,o));break;case"times":({config:p,iterCtx:h}=function(e,t){return{config:{type:"times",shouldContinue:e=>(e.count??0)>e.index,beforeIteration:(e,t)=>{Object.assign(t,{it:e.index+1})}},iterCtx:{index:0,count:e,indexVariable:t}}}(s,o));break;case"while":({config:p,iterCtx:h}=function(e,t,r,n){return{config:{type:"while",shouldContinue:()=>t(e,r)},iterCtx:{index:0,conditionExpr:e,indexVariable:n}}}(a,Ks,t,o));break;case"until":({config:p,iterCtx:h}=function(e,t,r,n){return{config:{type:"until",shouldContinue:()=>!t(e,r)},iterCtx:{index:0,conditionExpr:e,indexVariable:n}}}(a,Ks,t,o));break;case"until-event":({config:p,iterCtx:h}=function(e,t,r){const n={index:0,eventFired:!1,indexVariable:r};return{config:{type:"until-event",shouldContinue:e=>!e.eventFired,eventSetup:{eventName:e,target:t,onEvent:()=>{n.eventFired=!0}}},iterCtx:n}}(d,m,o));break;case"forever":({config:p,iterCtx:h}=function(e,t=1e4){return{config:{type:"forever",maxIterations:t,shouldContinue:()=>!0},iterCtx:{index:0,indexVariable:e}}}(o));break;default:throw Error("Unknown repeat type: "+r)}if(u){const e=p.shouldContinue;p.shouldContinue=async t=>0===t.index||await e(t)}try{const e=await async function(e,t,r,n,i){const a=e.maxIterations??1e4;let s,o=0,l=!1;e.eventSetup&&e.eventSetup.target.addEventListener(e.eventSetup.eventName,e.eventSetup.onEvent,{once:!0});try{for(;a>o&&await e.shouldContinue(n);){e.beforeIteration&&await e.beforeIteration(n,r),n.indexVariable&&r.locals&&r.locals.set(n.indexVariable,o);try{s=await i(t,r)}catch(t){if(t instanceof Error){if(t.message.includes("BREAK")){l=!0;break}if(t.message.includes("CONTINUE")){o++,n.index=o,"until-event"===e.type&&await new Promise(e=>setTimeout(e,0));continue}}throw t}o++,n.index=o,"until-event"===e.type&&await new Promise(e=>setTimeout(e,0))}}finally{e.eventSetup&&!n.eventFired&&e.eventSetup.target.removeEventListener(e.eventSetup.eventName,e.eventSetup.onEvent)}return{iterations:o,lastResult:s,interrupted:l}}(p,l,t,h,this.executeCommands.bind(this));if(0===e.iterations&&!e.interrupted&&c){const e=await this.executeCommands(c,t);return Object.assign(t,{it:e}),{type:r,iterations:0,completed:!0,lastResult:e}}return Object.assign(t,{it:e.lastResult}),{type:r,iterations:e.iterations,completed:!e.interrupted,lastResult:e.lastResult,interrupted:e.interrupted}}catch(e){if(e instanceof Error&&(e.message.includes("BREAK")||e.message.includes("CONTINUE")))return{type:r,iterations:0,completed:!0,interrupted:e.message.includes("BREAK")};throw e}}async executeCommands(e,t){if(e&&"object"==typeof e&&"block"===e.type){const r=e,n=t.locals.get("_runtimeExecute");if(!n)throw Error("Runtime execute function not available");let i;if(r.commands)for(const e of r.commands)i=await n(e,t);return i}if(Array.isArray(e)){let r;for(const n of e)r="function"==typeof n?await n(t):n&&"function"==typeof n.execute?await n.execute(t):n;return r}return"function"==typeof e?await e(t):e}};return wa(t,"RepeatCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Iteration in hyperscript - for-in, counted, conditional, event-driven, and infinite loops",syntax:["repeat for <var> in <collection> { <commands> }","repeat <count> times { <commands> }","repeat while <condition> { <commands> }","repeat until <condition> { <commands> }","repeat forever { <commands> }"],examples:["repeat for item in items { log item }",'repeat 5 times { log "hello" }'],sideEffects:["iteration","conditional-execution"],category:"control-flow",compatibility:"standard"}),ba(t,n),i=t})();const Ys=Ia(Js);class Qs{async parseInput(e,t,r){return{signalType:this.signalType}}async execute(e,t){const r=Error(this.errorMessage);throw r[this.errorFlag]=!0,"exit"===this.signalType&&(r.returnValue=void 0,r.timestamp=Date.now()),r}}let eo=(()=>{let e,t,r=[ja({name:"break"})],n=[],i=Qs;var a=t=class extends i{constructor(){super(...arguments),this.signalType="break",this.errorMessage="BREAK_LOOP",this.errorFlag="isBreak"}get metadata(){return a.metadata}};return wa(t,"BreakCommand"),(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),a=t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),t.metadata=Pa({description:"Exit from the current loop (repeat, for, while, until)",syntax:["break"],examples:["break","if found then break","repeat for item in items { if item == target then break }"],sideEffects:["control-flow"],category:"control-flow",compatibility:"standard"}),ba(t,n),a=t})();const to=Ia(eo);let ro=(()=>{let e,t,r=[ja({name:"continue"})],n=[],i=Qs;var a=t=class extends i{constructor(){super(...arguments),this.signalType="continue",this.errorMessage="CONTINUE_LOOP",this.errorFlag="isContinue"}get metadata(){return a.metadata}};return wa(t,"ContinueCommand"),(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),a=t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),t.metadata=Pa({description:"Skip to the next iteration of the current loop",syntax:["continue"],examples:["continue","if item.isInvalid then continue","repeat for item in items { if item.skip then continue; process item }"],sideEffects:["control-flow"],category:"control-flow",compatibility:"standard"}),ba(t,n),a=t})();const no=Ia(ro),io=Ia((()=>{let e,t,r=[ja({name:"halt"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(e.args&&e.args.length>0){const n=e.args[0];return!n||"the"!==n.name&&"the"!==n.value?{target:await t.evaluate(e.args[0],r)}:{target:r.event}}return{}}async execute(e,t){let r=e.target;if(("the"===r&&t.event||"object"==typeof r&&null!==r&&"the"===r.target&&t.event)&&(r=t.event),this.isEvent(r)){const e=r;return e.preventDefault(),e.stopPropagation(),{halted:!0,timestamp:Date.now(),eventHalted:!0}}"halted"in t&&(t.halted=!0);const n=Error("HALT_EXECUTION");throw n.isHalt=!0,n}isEvent(e){return null!==e&&"object"==typeof e&&"preventDefault"in e&&"stopPropagation"in e}};return wa(t,"HaltCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Stop command execution or prevent event defaults",syntax:["halt","halt the event"],examples:["halt","halt the event","if error then halt",'on click halt the event then log "clicked"'],sideEffects:["control-flow","event-prevention"],category:"control-flow",compatibility:"standard"}),ba(t,n),i=t})()),ao=Ia((()=>{let e,t,r=[ja({name:"return"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return e.args&&0!==e.args.length?{value:await t.evaluate(e.args[0],r)}:{value:void 0}}async execute(e,t){const{value:r}=e;"returnValue"in t&&(t.returnValue=r),Object.assign(t,{it:r});const n=Error("RETURN_VALUE");throw n.isReturn=!0,n.returnValue=r,n}};return wa(t,"ReturnCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Return a value from a command sequence or function, terminating execution",syntax:["return","return <value>"],examples:["return","return 42","return user.name","if found then return result"],sideEffects:["control-flow","context-mutation"],category:"control-flow",compatibility:"standard"}),ba(t,n),i=t})());let so=(()=>{let e,t,r=[ja({name:"exit"})],n=[],i=Qs;var a=t=class extends i{constructor(){super(...arguments),this.signalType="exit",this.errorMessage="EXIT_COMMAND",this.errorFlag="isExit"}get metadata(){return a.metadata}};return wa(t,"ExitCommand"),(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),a=t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),t.metadata=Pa({description:"Immediately terminate execution of the current event handler or behavior",syntax:["exit"],examples:["exit","if no draggedItem exit","on click if disabled exit"],sideEffects:["control-flow"],category:"control-flow",compatibility:"standard"}),ba(t,n),a=t})();const oo=Ia(so),lo=Ia((()=>{let e,t,r=[ja({name:"throw"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(1>e.args.length)throw Error("throw command requires a message or error object");return{message:await t.evaluate(e.args[0],r)}}async execute(e,t){const{message:r}=e;let n;throw n=r instanceof Error?r:Error("string"==typeof r?r:r+""),n}};return wa(t,"ThrowCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Throw an error with a specified message",syntax:["throw <message>"],examples:['throw "Invalid input"','if not valid then throw "Validation failed"'],sideEffects:["error-throwing","execution-termination"],category:"control-flow",compatibility:"standard"}),ba(t,n),i=t})());async function co(e,t,r){const n=await t.evaluate(e,r),i=Array.isArray(n)?n[0]:n;return hr(i)?i:null}async function uo(e,t,r,n){if(!e)return null;const i=e,a=i.type;if(n.nodeWriters&&a){const t=Ne(a);if(t)return{kind:"node-write",node:e,writer:t}}if(n.selectorSource&&"selector"===a&&"string"==typeof i.value)return{kind:"selector",selector:i.value};const s=await async function(e,t,r,n){const i=e;if("attributeAccess"===i?.type)return{elements:await n(),name:i.attributeName};if("binaryExpression"===i?.type&&"of"===i.operator&&"attributeAccess"===i.left?.type){const e=await co(i.right,t,r);if(e)return{elements:[e],name:i.left.attributeName}}if("memberExpression"===i?.type&&"attributeAccess"===i.property?.type){const e=await co(i.object,t,r);if(e)return{elements:[e],name:i.property.attributeName}}return null}(e,t,r,n.scopeElements);if(s)return{kind:"attribute",elements:s.elements,name:s.name};const o=await ks(e,t,r);if(o)return n.styleSplit&&o.property.startsWith("*")?{kind:"style",element:o.element,property:o.property.substring(1)}:{kind:"property",target:o};if(n.bareReference&&("identifier"===a||"variable"===a||"symbol"===a)&&"string"==typeof i.name){const e=i.scope;return{kind:"variable",name:i.name,scope:"element"===e||"global"===e?e:void 0}}return null}const mo=Ia((()=>{let e,t,r=[ja({name:"set"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args?.length)throw Error("set command requires a target");const n=e.args[0],i=n?.name||n?.value,a=n?.scope,s=await uo(n,t,r,{scopeElements:()=>this.resolveTargets(e.modifiers.on,t,r),nodeWriters:!0,styleSplit:!0});if(s)return function(e,t){switch(e.kind){case"node-write":return{type:"node-write",node:e.node,value:t,writer:e.writer};case"attribute":return{type:"attribute",elements:e.elements,name:e.name,value:t};case"style":return{type:"style",element:e.element,property:e.property,value:t+""};case"property":return{type:"property",element:e.target.element,property:e.target.property,value:t};default:throw Error(`set: unrequested write-target rung '${e.kind}'`)}}(s,await this.extractValue(e,t,r));if("memberExpression"===n?.type||"propertyAccess"===n?.type){const i=await this.tryParseMemberExpression(n,e,t,r);if(i)return i}let o;if(o="identifier"!==n?.type&&"variable"!==n?.type||"string"!=typeof i?await t.evaluate(n,r):i,function(e){if("object"!=typeof e||null===e||Array.isArray(e))return!1;if(hr(e)||e instanceof Node)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(o))return{type:"object-literal",properties:o,targets:await this.resolveTargets(e.modifiers.on,t,r)};if(bs(o)){const n=ws(o,r);if(n){const i=await this.extractValue(e,t,r);return{type:"property",element:n.element,property:n.property,value:i}}return this.parseTheXofY(o,e,t,r)}if("string"==typeof o&&Va(o)){const n=o.substring(1).trim(),i=await this.extractValue(e,t,r);return{type:"style",element:await this.resolveElement(e.modifiers.on,t,r),property:n,value:i+""}}if("string"==typeof o&&ka(o)){const n=o.substring(1).trim(),i=await this.extractValue(e,t,r);return{type:"attribute",elements:await this.resolveTargets(e.modifiers.on,t,r),name:n,value:i}}if("string"==typeof o){const n=o.match(/^(my|me|its?|your?)\s+(.+)$/i);if(n){const i=$a(n[1],r),a=await this.extractValue(e,t,r);return{type:"property",element:i,property:n[2],value:a}}}if(hr(o))return{type:"property",element:o,property:"textContent",value:await this.extractValue(e,t,r)};if(Array.isArray(o)&&o.length>0&&hr(o[0])){const n=await this.extractValue(e,t,r);return{type:"property",element:o[0],property:"textContent",value:n}}if("string"!=typeof o)throw Error("set command target must be a string or object literal"+("memberExpression"===n?.type||"propertyAccess"===n?.type?` (a property chain evaluated to ${null===o?"null":typeof o} \u2014 check that all intermediate objects exist)`:""));return{type:"variable",name:o,value:await this.extractValue(e,t,r),scope:"element"===a||"global"===a?a:void 0}}async execute(e,t){switch(e.type){case"variable":return"element"===e.scope?dr(t,e.name,e.value):"global"===e.scope?br(e.name,e.value,t,"global"):br(e.name,e.value,t),"result"!==e.name&&"it"!==e.name||Object.assign(t,{[e.name]:e.value}),Object.assign(t,{it:e.value}),{target:e.name,value:e.value,targetType:"variable"};case"attribute":for(const t of e.elements)t.setAttribute(e.name,e.value+"");return Object.assign(t,{it:e.value}),{target:"@"+e.name,value:e.value,targetType:"attribute"};case"property":return fs(e.element,e.property,e.value),Object.assign(t,{it:e.value}),{target:e.element,value:e.value,targetType:"property"};case"style":return Ba(e.element,e.property,e.value),Object.assign(t,{it:e.value}),{target:e.element,value:e.value,targetType:"property"};case"object-literal":for(const t of e.targets)for(const[r,n]of Object.entries(e.properties))fs(t,r,n);return Object.assign(t,{it:e.properties}),{target:e.targets[0]||"unknown",value:e.properties,targetType:"property"};case"member-assignment":return e.container[e.property]=e.value,Object.assign(t,{it:e.value}),{target:e.property,value:e.value,targetType:"property"};case"node-write":return await e.writer(e.node,e.value,t),Object.assign(t,{it:e.value}),{target:e.node.name??"",value:e.value,targetType:"variable"};default:throw Error("Unknown input type: "+e.type)}}async tryParseMemberExpression(e,t,r,n){const i=e.object,a=e.property;if(i?.name&&a?.name){const e=i.name.toLowerCase();if(["me","my","it","its","you","your"].includes(e)){const i=$a(e,n),s=await this.extractValue(t,r,n);return{type:"property",element:i,property:a.name,value:s}}}const s=e.object,o=e.computed;if(s){const i=s;let l;if("memberExpression"===i.type&&!i.computed&&"style"===i.property?.name&&i.object){const e=await r.evaluate(i.object,n);l=(e&&"object"==typeof e&&"style"in e?e.style:void 0)??await r.evaluate(s,n)}else l=await r.evaluate(s,n);if(null!=l&&"object"==typeof l){const i=o?await r.evaluate(e.property,n)+"":a?.name||"";if(i)return{type:"member-assignment",container:l,property:i,value:await this.extractValue(t,r,n)}}}return null}async extractValue(e,t,r){if(e.modifiers.to)return t.evaluate(e.modifiers.to,r);const n=e.args.findIndex(e=>"identifier"===e.type&&"to"===e.name);if(n>=0&&e.args.length>n+1)return t.evaluate(e.args[n+1],r);if(e.args.length>=2)return t.evaluate(e.args[1],r);throw Error('set command requires a value (use "to" keyword)')}async resolveElement(e,t,r){return Na(e?await t.evaluate(e,r):void 0,r)}async resolveTargets(e,t,r){return Ra(e?await t.evaluate(e,r):void 0,r)}async parseTheXofY(e,t,r,n){const i=e.match(/^the\s+(.+?)\s+of\s+(.+)$/i);if(!i)throw Error('Invalid "the X of Y" syntax');const[,a,s]=i,o=Na(s,n),l=await this.extractValue(t,r,n);return{type:"property",element:o,property:a.trim(),value:l}}validate(e){if(!e||"object"!=typeof e)return!1;const t=e;if(!t.type||"string"!=typeof t.type)return!1;if(!["variable","attribute","property","style","object-literal"].includes(t.type))return!1;switch(t.type){case"variable":return"string"==typeof t.name&&"value"in t;case"attribute":return"string"==typeof t.name&&Array.isArray(t.elements)&&t.elements.every(hr)&&"value"in t;case"property":return"string"==typeof t.property&&hr(t.element)&&"value"in t;case"style":return"string"==typeof t.property&&""!==t.property&&hr(t.element)&&"string"==typeof t.value;case"object-literal":return null!==t.properties&&"object"==typeof t.properties&&Array.isArray(t.targets)&&t.targets.length>0;default:return!1}}};return wa(t,"SetCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Set values to variables, attributes, or properties",syntax:["set <target> to <value>"],examples:['set myVar to "value"','set @data-theme to "dark"','set my innerHTML to "content"'],sideEffects:["state-mutation","dom-mutation"],category:"data",compatibility:"standard"}),ba(t,n),i=t})()),po=Ia((()=>{let e,t,r=[ja({name:"get"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args||0===e.args.length)throw Error("get command requires an expression argument");const n=e.args[0],i=await t.evaluate(n,r);return i instanceof NodeList&&1===i.length||Array.isArray(i)&&1===i.length?{value:i[0]}:{value:i}}execute(e,t){return t.it=e.value,Object.assign(t,{result:e.value}),{value:e.value}}validate(e){return"object"==typeof e&&null!==e&&"value"in e}};return wa(t,"GetCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Evaluate an expression and store the result in it",syntax:"get <expression>",examples:["get #my-dialog","get <button/>","get me.parentElement"],sideEffects:["context-mutation"],category:"data",compatibility:"standard"}),ba(t,n),i=t})());function ho(e){return e&&"object"==typeof e&&e.type||"unknown"}let fo=(()=>{let e,t,r=[ja({name:"increment"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n="decrement"===e.commandName?.toLowerCase()?"decrement":"increment",i=await async function(e,t,r,n){if(!e.args||0===e.args.length)throw Error(n+" command requires a target");const i=e.args[0];let a,s,o;const l=ho(i);if("identifier"===l)a=i.name,i.scope&&(s=i.scope);else if("literal"===l)a=i.value;else{const e=Ne(l);if(e){const n=await t.evaluate(i,r),s="number"==typeof n?n:null==n?0:Number(n)||0;a=s,o={node:i,writer:e,currentValue:s}}else{const e=await t.evaluate(i,r);a=Array.isArray(e)&&e.length>0?e[0]:e}}let c=1,u=s;for(let n=1;e.args.length>n;n++){const i=e.args[n];if(i&&"literal"===i.type){const e=i.value;"global"===e?u="global":"number"==typeof e&&(c=e)}else if(i&&"literal"!==i.type){const e=await t.evaluate(i,r);"number"==typeof e&&(c=e)}}const d=e.modifiers?.by;if(d){const e=d.value;if("literal"===ho(d)&&"number"==typeof e)c=e;else if("literal"!==ho(d)){const e=await t.evaluate(d,r);"number"==typeof e&&(c=e)}}return{target:a,amount:c,...u&&{scope:u},...o&&{customWrite:o}}}(e,t,r,n);return{...i,operation:n}}async execute(e,t){const{target:r,property:n,scope:i,amount:a=1,operation:s="increment",customWrite:o}=e;if(o){const e=isFinite(a)?a:1,r="increment"===s?o.currentValue+e:o.currentValue-e;return await o.writer(o.node,r,t),Object.assign(t,{it:r}),r}const l=function(e,t,r,n){if("number"==typeof e)return e;if(hr(e)){const r=e;return t?t.startsWith("data-")||["id","class","title","alt","src","href"].includes(t)?gr(r.getAttribute(t)):gr(r[t]):gr(r.value||r.textContent)}return"string"==typeof e?"element"===r?gr(vr(e,n,"element")):"global"===r?gr(vr(e,n,"global")):e.includes(".")?function(e,t){const r=e.split("."),n=r[1],i=wr(r[0],t);return i?gr(i[n]):0}(e,n):gr("me"===e&&n.me?n.me.value||0:"it"===e?n.it||0:"you"===e&&n.you?n.you.value||0:vr(e,n)):gr(e)}(r,n,i,t);let c;if(isNaN(l))c=NaN;else{const e=isFinite(a)?a:1;c="increment"===s?l+e:l-e}return function(e,t,r,n,i){if(hr(e)){const r=e;return void(t?t.startsWith("data-")||["id","class","title","alt","src","href"].includes(t)?r.setAttribute(t,n+""):r[t]=n:"value"in r&&void 0!==r.value?r.value=n+"":r.textContent=n+"")}if("string"==typeof e){if("element"===r)return void br(e,n,i,"element");if("global"===r)return void br(e,n,i,"global");if(e.includes("."))return void function(e,t,r){const n=e.split("."),i=n[1],a=wr(n[0],r);a&&(a[i]=t)}(e,n,i);if("me"===e&&i.me)return void(i.me.value=n);if("it"===e)return void Object.assign(i,{it:n});if("you"===e&&i.you)return void(i.you.value=n);br(e,n,i)}}(r,n,i,c,t),Object.assign(t,{it:c}),c}};return wa(t,"NumericModifyCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Modify a variable or property by a specified amount (default: 1)",syntax:["increment <target> [by <number>]","decrement <target> [by <number>]"],examples:["increment counter","increment counter by 5","decrement counter","decrement counter by 5"],sideEffects:["data-mutation","context-modification"],aliases:["decrement"],category:"data",compatibility:"standard"}),ba(t,n),i=t})();const yo=Ia(fo),go=Ia(fo),vo=Ia((()=>{let e,t,r=[ja({name:"default"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(1>e.args.length)throw Error("default command requires a target");const n=await this.extractValue(e,t,r),i=e.args[0],a=function(e){if("contextReference"!==e?.type)return null;const t=e.name;return"string"!=typeof t?null:t.startsWith(":")?{name:t.slice(1),scope:"element"}:t.startsWith("$")?{name:t.slice(1),scope:"global"}:null}(i);if(a)return{type:"variable",name:a.name,value:n,scope:a.scope};const s=await uo(i,t,r,{scopeElements:async()=>r.me?[r.me]:[],bareReference:!0});if(s)return function(e,t){switch(e.kind){case"attribute":return{type:"attribute",elements:e.elements,name:e.name,value:t};case"property":return{type:"property",element:e.target.element,property:e.target.property,value:t};case"variable":{const r=e.name.startsWith("$"),n=r?e.name.slice(1):e.name,i=r?"global":e.scope;return{type:"variable",name:n,value:t,...i?{scope:i}:{}}}default:throw Error(`default: unrequested write-target rung '${e.kind}'`)}}(s,n);const o=await t.evaluate(e.args[0],r);if(hr(o))return{type:"element",element:o,value:n};if(Array.isArray(o)&&hr(o[0]))return{type:"element",element:o[0],value:n};if("string"==typeof o)return{type:"variable",name:o,value:n};throw Error("Invalid target type: "+typeof o)}async extractValue(e,t,r){if(e.modifiers?.to)return t.evaluate(e.modifiers.to,r);const n=e.args[1],i="identifier"===n?.type&&"to"===(n.name+"").toLowerCase();if(i&&e.args.length>=3)return t.evaluate(e.args[2],r);if(!i&&e.args.length>=2)return t.evaluate(e.args[1],r);throw Error('default command requires a value (use "to <value>")')}async execute(e,t){switch(e.type){case"variable":return this.defaultVariable(t,e.name,e.value,e.scope);case"attribute":return this.defaultAttribute(t,e.elements,e.name,e.value);case"property":return this.defaultElementProperty(t,e.element,e.property,e.value);case"element":return this.defaultElementValue(t,e.element,e.value)}}defaultVariable(e,t,r,n){const i=vr(t,e,n);return null!=i?{target:t,value:r,wasSet:!1,existingValue:i,targetType:"variable"}:(br(t,r,e,n),Object.assign(e,{it:r}),{target:t,value:r,wasSet:!0,targetType:"variable"})}defaultAttribute(e,t,r,n){if(0===t.length)throw Error("No element context available for attribute default");const i=t.filter(e=>null===e.getAttribute(r));if(0===i.length)return{target:"@"+r,value:n,wasSet:!1,existingValue:t[0].getAttribute(r),targetType:"attribute"};for(const e of i)e.setAttribute(r,n+"");return Object.assign(e,{it:n}),{target:"@"+r,value:n,wasSet:!0,targetType:"attribute"}}defaultElementProperty(e,t,r,n){const i=function(e,t){if(t.startsWith("@"))return e.getAttribute(t.substring(1));switch(t){case"textContent":return e.textContent;case"innerHTML":return e.innerHTML;case"innerText":return e.innerText;case"id":return e.id;case"className":return e.className;case"value":return"value"in e?e.value:void 0;case"checked":return"checked"in e?e.checked:void 0}if(t.includes(".")){const r=t.split(".");let n=e;for(const e of r){if(null==n)break;n=n[e]}return n}return t.includes("-")||t in e.style?e.style.getPropertyValue(t)||e.style[t]:e[t]}(t,r);return ys(i)?(fs(t,r,n),Object.assign(e,{it:n}),{target:r,value:n,wasSet:!0,targetType:"property"}):{target:r,value:n,wasSet:!1,existingValue:i,targetType:"property"}}defaultElementValue(e,t,r){const n=function(e){return"value"in e?e.value:e.textContent}(t);return ys(n)?(function(e,t){"value"in e?e.value=t+"":e.textContent=t+""}(t,r),Object.assign(e,{it:r}),{target:"element",value:r,wasSet:!0,targetType:"element"}):{target:"element",value:r,wasSet:!1,existingValue:n,targetType:"element"}}};return wa(t,"DefaultCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Set a value only if it doesn't already exist",syntax:["default <expression> to <expression>"],examples:['default myVar to "fallback"','default @data-theme to "light"','default my innerHTML to "No content"'],sideEffects:["data-mutation","dom-mutation"],category:"data",compatibility:"standard"}),ba(t,n),i=t})());function bo(e){const t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}const wo=Ia((()=>{let e,t,r=[ja({name:"clear"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n=e.args?.[0],i=n?.type,a=n?.name;if(n&&("variable"===i||"identifier"===i&&"string"==typeof a))try{const e=await t.evaluate(n,r);if(!hr(e)&&!Array.isArray(e))return{type:"variable",name:a}}catch{return{type:"variable",name:a}}return{type:"form-fields",targets:await za(e.args,t,r,"clear",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers)}}async execute(e,t){if("variable"===e.type)return t.locals.set(e.name,null),void Object.assign(t,{it:null});for(const t of e.targets)bo(t)&&("SELECT"===t.tagName?t.selectedIndex=-1:t.value="")}validate(e){if("object"!=typeof e||null===e)return!1;if("variable"===e.type)return"string"==typeof e.name;if("form-fields"===e.type){const t=e.targets;return Array.isArray(t)&&t.every(e=>hr(e))}return!1}};return wa(t,"ClearCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Reset a variable to null or clear the value of a form field (<input>, <textarea>, <select>)",syntax:["clear <var>","clear :var","clear <target>"],examples:["clear :count","clear myVar","clear #search","clear <textarea/>"],sideEffects:["state-mutation","dom-mutation"],category:"data",compatibility:"standard"}),ba(t,n),i=t})());function ko(e,t,r,n){return e?new Promise(r=>{const i=()=>{a({event:null,timedOut:!1,cancelled:!0})},a=xo(()=>{e.removeEventListener(t,s),n&&n.removeEventListener("abort",i)},r),s=e=>{a({event:e,timedOut:!1,cancelled:!1})};n?.aborted?r({event:null,timedOut:!1,cancelled:!0}):(e.addEventListener(t,s),n&&n.addEventListener("abort",i))}):Promise.reject(Error("waitForEvent: no target provided"))}function Eo(e){return new Promise(t=>setTimeout(t,e))}function xo(e,t){let r=!1;return n=>{r||(r=!0,e(),t(n))}}const Co=Ia((()=>{let e,t,r=[ja({name:"wait"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args?.length)throw Error("wait command requires an argument");if(e.modifiers.or)return this.parseRaceCondition(e,t,r);if(e.modifiers.for)return this.parseEventWait(e.modifiers.for,e.modifiers.from,t,r);const n=e.args[0];return"arrayLiteral"===n.type&&n.elements?this.parseEventArrayWait(n.elements,e.args[1],t,r):this.parseTimeWait(e.args[0],t,r)}async execute(e,t){const r=Date.now();if("time"===e.type)return await Eo(e.milliseconds),{type:"time",result:e.milliseconds,duration:Date.now()-r};if("event"===e.type){const n=e.target??t.me??document,i=(await ko(n,e.eventName)).event;if(Object.assign(t,{it:i}),e.destructure)for(const r of e.destructure)r in i&&t.locals.set(r,i[r]);return{type:"event",result:i,duration:Date.now()-r}}const{result:n,winningCondition:i}=await this.executeRace(e.conditions,t);if(Object.assign(t,{it:n}),n instanceof Event&&"event"===i?.type&&i.destructure)for(const e of i.destructure)e in n&&t.locals.set(e,n[e]);return{type:n instanceof Event?"event":"time",result:n,duration:Date.now()-r}}async parseTimeWait(e,t,r){return{type:"time",milliseconds:ss(await t.evaluate(e,r))}}async parseEventWait(e,t,r,n){const i=await r.evaluate(e,n);if("string"!=typeof i)throw Error("wait for: event name must be a string");const a=i.match(/^(\w+)\(([^)]+)\)$/),s=a?a[1]:i,o=a?a[2].split(",").map(e=>e.trim()):void 0;let l;if(t){const e=await r.evaluate(t,n);if(!e||"object"!=typeof e||!("addEventListener"in e))throw Error("wait for from: target must be an EventTarget");l=e}else l=n.me??void 0;return{type:"event",eventName:s,target:l,destructure:o}}async parseEventArrayWait(e,t,r,n){let i;if(t){const e=await r.evaluate(t,n);e&&"object"==typeof e&&"addEventListener"in e&&(i=e)}i||(i=n.me??void 0);const a=[];for(const t of e){const e=t;if("objectLiteral"!==e.type||!e.properties)continue;let s,o="",l=[];for(const t of e.properties){const e=t.key?.name||t.key?.value;"name"===e&&t.value?o=t.value.value||"":"args"===e&&t.value?.elements?l=t.value.elements.map(e=>e.value||e.name||""):"duration"===e&&t.value&&(s=t.value)}if(s){const e=await r.evaluate(s,n);a.push({type:"time",milliseconds:ss(e)})}else o&&a.push({type:"event",eventName:o,target:i,destructure:l.length>0?l:void 0})}return 1===a.length?a[0]:{type:"race",conditions:a}}async parseRaceCondition(e,t,r){const n=[];e.modifiers.for?n.push(await this.parseEventWait(e.modifiers.for,e.modifiers.from,t,r)):e.args[0]&&n.push(await this.parseTimeWait(e.args[0],t,r));const i=await t.evaluate(e.modifiers.or,r),a=Array.isArray(i)?i:[i];for(const e of a)try{n.push({type:"time",milliseconds:ss(e)})}catch{if("string"==typeof e){const t=e.match(/^(\w+)\(([^)]+)\)$/);n.push(t?{type:"event",eventName:t[1],target:r.me??void 0,destructure:t[2].split(",").map(e=>e.trim())}:{type:"event",eventName:e,target:r.me??void 0})}}if(2>n.length)throw Error("wait: race requires at least 2 conditions");return{type:"race",conditions:n}}async executeRace(e,t){const r=new AbortController,n=r.signal,i=e.map(e=>"time"===e.type?Eo(e.milliseconds).then(()=>({result:e.milliseconds,winningCondition:e})):ko(e.target??t.me??document,e.eventName,0,n).then(t=>({result:t.event,winningCondition:e})));try{return await Promise.race(i)}finally{r.abort()}}};return wa(t,"WaitCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Wait for time delay, event, or race condition",syntax:["wait <time>","wait for <event>","wait for <event> or <condition>"],examples:["wait 2s","wait for click","wait for click or 1s","wait for mousemove(clientX, clientY)"],sideEffects:["time","event-listening"],category:"async",compatibility:"standard"}),ba(t,n),i=t})()),Ao=new Map;let So=[/^4\d{2}$/,/^5\d{2}$/],To=(()=>{let e,t,r=[ja({name:"fetch"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args?.length)throw Error("fetch requires a URL");const n=await this.parseURL(e.args[0],t,r),i=this.parseResponseType(e.modifiers.as);return{url:n,responseType:i,options:await this.parseRequestOptions(e.modifiers.with,t,r),throwOnError:!e.modifiers.doNotThrow&&"response"!==i}}async execute(e,t){const r=Date.now(),{url:n,responseType:i,options:a}=e,s=new AbortController;let o;t.me&&(o=()=>s.abort(),t.me.addEventListener("fetch:abort",o,{once:!0}));const l={...a,signal:s.signal},c=Ao.get(i);if(c?.accept){const e=new Headers(l.headers);e.has("Accept")||e.set("Accept",c.accept),l.headers=e}if(t.me){const e={...l,sender:t.me,headers:l.headers||{}};this.dispatchEvent(t.me,"fetch:beforeRequest",e),l.headers=e.headers}let u;a.timeout&&(u=setTimeout(()=>s.abort(),a.timeout));try{let a=await fetch(n,l);if(t.me){const e={response:a};this.dispatchEvent(t.me,"fetch:afterResponse",e),a=e.response}if(e.throwOnError&&function(e){const t=e+"";return So.some(e=>e.test(t))}(a.status)){const e=Error(`Fetch failed for ${n}: HTTP ${a.status} ${a.statusText}`.trim());throw e.response=a,e.isFetchStatusError=!0,e}const s=await this.handleResponse(a,i,t);t.me&&this.dispatchEvent(t.me,"fetch:afterRequest",{result:s});const o={status:a.status,statusText:a.statusText,headers:a.headers,data:s,url:a.url,duration:Date.now()-r};return Object.assign(t,{it:s}),o}catch(e){if(t.me&&this.dispatchEvent(t.me,"fetch:error",{reason:e instanceof Error?e.message:e+"",error:e}),e instanceof Error&&"AbortError"===e.name)throw Error("Fetch aborted for "+n);if(e instanceof Error&&!0===e.isFetchStatusError)throw e;throw Error(`Fetch failed for ${n}: ${e instanceof Error?e.message:e+""}`)}finally{u&&clearTimeout(u),t.me&&o&&t.me.removeEventListener("fetch:abort",o)}}async parseURL(e,t,r){const n=await t.evaluate(e,r);if("string"!=typeof n||!n){const t=e;if(null==n&&"identifier"===t?.type&&t.name)throw Error(`fetch: URL expression "${t.name}" evaluated to ${n+""} \u2014 check the variable is set, or quote it if you meant a literal URL (fetch 'https://example.com/path')`);throw Error("fetch: URL must be a non-empty string")}return n}parseResponseType(e){if(!e)return"text";if(("identifier"===e.type||"expression"===e.type)&&e.name){const t=e.name.toLowerCase();if("object"===t)return"json";if(["text","json","html","response","blob","arraybuffer"].includes(t))return"arraybuffer"===t?"arrayBuffer":t;if(Ao.has(t))return t;throw Error(`fetch: invalid response type "${t}"`)}return"text"}async parseRequestOptions(e,t,r){if(!e)return{};const n=await t.evaluate(e,r);if("object"!=typeof n||null===n)throw Error('fetch: "with" options must be an object');const i={};return"method"in n&&(i.method=(n.method+"").toUpperCase()),"headers"in n&&(i.headers=this.parseHeaders(n.headers)),"body"in n&&(i.body=this.parseBody(n.body)),"credentials"in n&&(i.credentials=n.credentials),"mode"in n&&(i.mode=n.mode),"cache"in n&&(i.cache=n.cache),i}parseHeaders(e){if(e instanceof Headers)return e;const t=new Headers;if("object"==typeof e&&null!==e)for(const[r,n]of Object.entries(e))t.set(r,n+"");return t}parseBody(e){return null==e?null:e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||e instanceof URLSearchParams||"string"==typeof e?e:"object"==typeof e?JSON.stringify(e):e+""}async handleResponse(e,t,r){switch(t){case"response":return e;case"json":return e.json();case"html":return this.parseHTML(await e.text());case"blob":return e.blob();case"arrayBuffer":return e.arrayBuffer();case"text":return e.text();default:{const n=Ao.get(t);return n?n.handler(e,r):e.text()}}}parseHTML(e){const t=(new DOMParser).parseFromString(e,"text/html"),r=document.createDocumentFragment();return Array.from(t.body.childNodes).forEach(e=>r.appendChild(e.cloneNode(!0))),1===r.childNodes.length&&hr(r.firstChild)?r.firstChild:r}dispatchEvent(e,t,r){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}))}};return wa(t,"FetchCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Make HTTP requests with lifecycle event support",syntax:["fetch <url>","fetch <url> as <type>","fetch <url> with <options>"],examples:['fetch "/api/data"','fetch "/api/users" as json','fetch "/api/save" with { method:"POST" }'],sideEffects:["network","event-dispatching"],category:"async",compatibility:"standard"}),ba(t,n),i=t})();const Lo=Ia(To);function Oo(e){const t=e.trim();return/^\d+$/.test(t)?parseInt(t,10):/^\d*\.\d+$/.test(t)?parseFloat(t):"true"===t||"false"!==t&&("null"===t?null:"undefined"!==t?t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):t:void 0)}let jo=(()=>{let e,t,r=[ja({name:"trigger"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n="send"===e.commandName?.toLowerCase()?"send":"trigger",i=n;if(!e.args?.length)throw Error(i+" command requires an event name");const a=e=>e?.type||"unknown",s=e.args[0];let o,l,c;if("functionCall"===a(s)||"callExpression"===a(s)){o=s.name||s.callee?.name;const e=s.args||s.arguments;e?.length&&(l=await this.parseEventDetail(e,t,r))}else if("identifier"===a(s)||"keyword"===a(s))o=s.name;else{const e=await t.evaluate(s,r);o="string"==typeof e?e:e+""}const u=e.modifiers?.on||e.modifiers?.to;if(u)c=await this.resolveTargets([u],t,r,i);else{const n=e.args.findIndex((e,t)=>{if(0===t)return!1;const r=e.name||e.value;return"on"===r||"to"===r});if(-1!==n&&e.args.length-1>n){const a=e.args.slice(n+1),s=a.findIndex(e=>"with"===(e.name||e.value)),o=-1===s?a:a.slice(0,s);c=await this.resolveTargets(o,t,r,i)}else{if(!r.me)throw Error(i+": no target specified and context.me is null");c=[r.me]}}return{eventName:o,detail:l,targets:c,options:await this.parseEventOptions(e.args,t,r),mode:n}}async execute(e,t){const r=function(e,t,r={}){return new CustomEvent(e,{detail:void 0!==t?t:{},bubbles:void 0===r.bubbles||r.bubbles,cancelable:void 0===r.cancelable||r.cancelable,composed:void 0!==r.composed&&r.composed})}(e.eventName,e.detail,e.options);for(const t of e.targets)t.dispatchEvent(r);t.it=r}async resolveTargets(e,t,r,n){const i=[];for(const n of e){const e=await t.evaluate(n,r);if("window"!==e&&e!==window)if("document"!==e&&e!==document)if("me"===e&&r.me)i.push(r.me);else if("you"===e&&r.you)i.push(r.you);else if("it"===e&&r.it)i.push(r.it);else if(hr(e))i.push(e);else if(e instanceof NodeList)i.push(...Array.from(e).filter(hr));else if(Array.isArray(e))i.push(...e.filter(hr));else{if("string"==typeof e){const t=document.querySelectorAll(e);if(0===t.length)throw Error(`No elements found: "${e}"`);i.push(...Array.from(t).filter(hr));continue}if(!e||"object"!=typeof e||!("addEventListener"in e))throw Error("Invalid target: "+typeof e);i.push(e)}else i.push(document);else i.push(window)}if(!i.length)throw Error(n+": no valid targets");return i}async parseEventDetail(e,t,r){if(!e?.length)return;if(1===e.length){const n=e[0];if("objectLiteral"!==n?.type)return await t.evaluate(n,r)}const n={};for(const i of e){const e=await t.evaluate(i,r);if("object"!=typeof e||null===e||Array.isArray(e)){if("string"==typeof e&&e.includes(":")){const[t,r]=e.split(":",2);n[t.trim()]=Oo(r.trim())}}else Object.assign(n,e)}return Object.keys(n).length?n:void 0}async parseEventOptions(e,t,r){const n={bubbles:!0,cancelable:!0,composed:!1},i=e.findIndex(e=>"with"===(e.name||e.value));if(-1===i)return n;for(const a of e.slice(i+1)){const e=await t.evaluate(a,r);if("string"==typeof e){const t=e.toLowerCase();"bubbles"===t?n.bubbles=!0:"nobubbles"===t?n.bubbles=!1:"cancelable"===t?n.cancelable=!0:"nocancelable"===t?n.cancelable=!1:"composed"===t&&(n.composed=!0)}}return n}};return wa(t,"EventDispatchCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Dispatch events on elements",syntax:["trigger <event> on <target>","trigger <event>(<detail>) on <target>","send <event> to <target>","send <event>(<detail>) to <target>"],examples:["trigger click on #button","trigger customEvent on me","send dataEvent to #target","send myEvent(count: 42) to me"],sideEffects:["event-dispatch"],aliases:["send"],category:"event",compatibility:"standard"}),ba(t,n),i=t})();const Po=Ia(jo),Io=Ia(jo),qo=Ia((()=>{let e,t,r=[ja({name:"transition"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args?.length)throw Error("transition requires property and value");let n,i;const a=await t.evaluate(e.args[0],r),s=(e=>Array.isArray(e)||yr(e)?e[0]:e)(a);if(hr(s)||"string"==typeof a&&/^[#.]|^(?:me|it|you)$/.test(a))i=s,n=await t.evaluate(e.args[1],r)+"";else{if(e.args.length>=2)throw Error("transition: target element not found");n=a+""}if(!n)throw Error("transition requires a CSS property");if(!e.modifiers?.to)throw Error('transition requires "to <value>"');let o=await t.evaluate(e.modifiers.to,r);void 0===o&&"identifier"===e.modifiers.to.type&&(o=e.modifiers.to.name);const l={property:n,value:o};return void 0!==i&&(l.target=i),e.modifiers?.over&&(l.duration=await t.evaluate(e.modifiers.over,r)),e.modifiers?.with&&(l.timingFunction=await t.evaluate(e.modifiers.with,r)+""),l}async execute(e,t){let{property:r}=e;const{target:n,value:i,duration:a,timingFunction:s}=e;r.startsWith("*")&&(r=r.substring(1)),r=r.replace(/([A-Z])/g,"-$1").toLowerCase();const o=Na(n,t,"transition"),l=as(a,300),c=getComputedStyle(o).getPropertyValue(r),u=o.style.transition,d=`${r} ${l}ms ${s||"ease"}`;o.style.transition=u?`${u}, ${d}`:d;let m=i+"",p=!1;if("initial"===m||"inherit"===m||"unset"===m||"revert"===m){const e=o.style.getPropertyValue(r);o.style.removeProperty(r),m=getComputedStyle(o).getPropertyValue(r),e&&o.style.setProperty(r,e),p=!0}o.style.setProperty(r,m);const h=await function(e,t,r){return new Promise(n=>{const i=r=>{r.target===e&&r.propertyName===t&&s({completed:!0,cancelled:!1})},a=r=>{r.target===e&&r.propertyName===t&&s({completed:!1,cancelled:!0})},s=xo(()=>{e.removeEventListener("transitionend",i),e.removeEventListener("transitioncancel",a),clearTimeout(o)},n);e.addEventListener("transitionend",i),e.addEventListener("transitioncancel",a);const o=setTimeout(()=>{s({completed:!0,cancelled:!1})},r+50)})}(o,r,l);return o.style.transition=u,p&&o.style.removeProperty(r),{element:o,property:r,fromValue:c,toValue:m,duration:l,completed:h.completed}}};return wa(t,"TransitionCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Animate CSS properties using CSS transitions",syntax:"transition [<target>] <property> to <value> [over <duration>] [with <timing>]",examples:["transition opacity to 0.5","transition my *opacity to 0 over 200ms","transition #box's *opacity to 0 over 200ms","transition left to 100px over 500ms","transition background-color to red over 1s with ease-in-out"],sideEffects:["style-change","timing"],category:"animation",compatibility:"standard"}),ba(t,n),i=t})()),No=Ia((()=>{let e,t,r=[ja({name:"measure"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){let n,i,a;if(e.args?.length){const a=e.args[0];if("identifier"===a.type&&a.name){const s=a.name.toLowerCase();if("me"===s||"it"===s||"you"===s){const s=await t.evaluate(a,r);if(hr(s)&&(n=s,e.args.length>1)){const n=e.args[1];i="identifier"===n.type?n.name:await t.evaluate(n,r)+""}}else i=a.name}else{const s=await t.evaluate(a,r);if(hr(s)||"string"==typeof s&&/^[#.]/.test(s)){if(n=s,e.args.length>1){const n=e.args[1];i="identifier"===n.type?n.name:await t.evaluate(n,r)+""}}else"string"==typeof s&&(i=s)}}e.modifiers?.set&&(a=await t.evaluate(e.modifiers.set,r)+"");const s={};return void 0!==n&&(s.target=n),void 0!==i&&(s.property=i),void 0!==a&&(s.variable=a),s}async execute(e,t){const r=Na(e.target,t,"measure"),n=e.property||"width",i=this.getMeasurement(r,n);return e.variable&&t.locals&&t.locals.set(e.variable,i.value),Object.assign(t,{it:i.value}),{result:i.value,wasAsync:!1,element:r,property:n,value:i.value,unit:i.unit,stored:!!e.variable}}getMeasurement(e,t){const r=getComputedStyle(e);if(t.startsWith("*")){const e=r.getPropertyValue(t.substring(1)),n=parseFloat(e);if(!isNaN(n)){const t=e.match(/([a-zA-Z%]+)$/);return{value:n,unit:t?t[1]:""}}return{value:e,unit:""}}const n=t.toLowerCase(),i=e.getBoundingClientRect(),a={width:()=>i.width,height:()=>i.height,top:()=>i.top,left:()=>i.left,right:()=>i.right,bottom:()=>i.bottom,x:()=>e.offsetLeft,y:()=>e.offsetTop,clientwidth:()=>e.clientWidth,"client-width":()=>e.clientWidth,clientheight:()=>e.clientHeight,"client-height":()=>e.clientHeight,offsetwidth:()=>e.offsetWidth,"offset-width":()=>e.offsetWidth,offsetheight:()=>e.offsetHeight,"offset-height":()=>e.offsetHeight,scrollwidth:()=>e.scrollWidth,"scroll-width":()=>e.scrollWidth,scrollheight:()=>e.scrollHeight,"scroll-height":()=>e.scrollHeight,scrolltop:()=>e.scrollTop,"scroll-top":()=>e.scrollTop,scrollleft:()=>e.scrollLeft,"scroll-left":()=>e.scrollLeft,offsettop:()=>e.offsetTop,"offset-top":()=>e.offsetTop,offsetleft:()=>e.offsetLeft,"offset-left":()=>e.offsetLeft};if(a[n])return{value:a[n](),unit:"px"};const s=r.getPropertyValue(t),o=parseFloat(s);if(!isNaN(o)){const e=s.match(/([a-zA-Z%]+)$/);return{value:o,unit:e?e[1]:"px"}}return{value:0,unit:"px"}}};return wa(t,"MeasureCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Measure DOM element dimensions, positions, and properties",syntax:["measure","measure <property>","measure <target> <property>"],examples:["measure","measure width","measure #element height","measure x and set dragX"],sideEffects:["data-mutation"],category:"animation",compatibility:"standard"}),ba(t,n),i=t})()),Ro=Ia((()=>{let e,t,r=[ja({name:"settle"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){let n,i;if(e.args&&e.args.length>0){const i=await t.evaluate(e.args[0],r);(hr(i)||"string"==typeof i&&(i.startsWith("#")||i.startsWith(".")||"me"===i||"it"===i||"you"===i))&&(n=i)}e.modifiers?.for&&(i=await t.evaluate(e.modifiers.for,r));const a={};return void 0!==n&&(a.target=n),void 0!==i&&(a.timeout=i),a}async execute(e,t){const{target:r,timeout:n}=e,i=Na(r,t,"settle"),a=as(n,5e3),s=Date.now(),o=getComputedStyle(i),l=os(o.transitionDuration),c=os(o.transitionDelay),u=os(o.animationDuration),d=os(o.animationDelay),m=ls(l,c),p=ls(u,d),h=Math.max(m,p);var f,y,g;return{element:i,settled:(await(f=i,y=h,g=a,y>0?new Promise(e=>{const t=e=>{e.target===f&&n({completed:!0,type:"transition"})},r=e=>{e.target===f&&n({completed:!0,type:"animation"})},n=xo(()=>{f.removeEventListener("transitionend",t),f.removeEventListener("animationend",r),clearTimeout(i),clearTimeout(a)},e);f.addEventListener("transitionend",t),f.addEventListener("animationend",r);const i=setTimeout(()=>{n({completed:!0,type:"timeout"})},y+50),a=setTimeout(()=>{n({completed:!1,type:"timeout"})},g)}):Promise.resolve({completed:!0,type:"timeout"}))).completed,timeout:a,duration:Date.now()-s}}};return wa(t,"SettleCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Wait for CSS transitions and animations to complete",syntax:"settle [<target>] [for <timeout>]",examples:["settle","settle #animated-element","settle for 3000"],sideEffects:["timing"],category:"animation",compatibility:"standard"}),ba(t,n),i=t})());const Mo=Ia((()=>{let e,t,r=[ja({name:"take"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args||0===e.args.length)throw Error('take requires property, "from", and source');const{value:n}=await Fa(e.args[0],t,r),i=n+"";let a;if(2>e.args.length)e.modifiers?.from&&(a=await t.evaluate(e.modifiers.from,r));else{if(!(s=e.args[1])||("identifier"!==s.type||"from"!==s.name)&&"from"!==s.value)throw Error("take syntax: take <property> from <source>");e.args[2]&&(a=await t.evaluate(e.args[2],r))}var s;let o;if(8>e.args.length)e.args.length>3&&(o=await t.evaluate(e.args[3],r));else{const n=[3,4,5,6].map(t=>e.args[t]),i=e=>e?.name??e?.value;"and"===i(n[0])&&"put"===i(n[1])&&"it"===i(n[2])&&"on"===i(n[3])&&e.args[7]&&(o=await t.evaluate(e.args[7],r))}if(!o&&e.modifiers?.on&&(o=await t.evaluate(e.modifiers.on,r)),!o&&e.modifiers?.for&&(o=await t.evaluate(e.modifiers.for,r)),void 0===a&&!i.startsWith("."))throw Error('take requires property, "from", and source');return{property:i,source:a,target:o}}async execute(e,t){const r=e.property.trim();if(r.startsWith(".")){const n=r.substring(1);let i;if(null!=e.source)i=Ra(e.source,t);else{const e=t.me?.ownerDocument??("undefined"!=typeof document?document:null);i=e?Array.from(e.querySelectorAll("."+n)):[]}for(const e of i)e.classList.remove(n);const a=Ra(e.target,t);if(0===a.length)throw Error("take: no recipient element found");for(const e of a)e.classList.add(n);return{targetElement:a[0],property:e.property,value:n}}const n=Na(this.firstOf(e.source),t,"take"),i=Na(e.target?this.firstOf(e.target):void 0,t,"take"),a=this.takeProperty(n,e.property);return this.putProperty(i,e.property,a),{targetElement:i,property:e.property,value:a}}firstOf(e){const t=null!==e&&"object"==typeof e&&"number"==typeof e.length&&"function"==typeof e.item;if(Array.isArray(e)||t){const t=e[0];if(void 0===t)throw Error("take: no matching elements");return t}return e}takeProperty(e,t){const r=t.trim(),n=r.toLowerCase();if("class"===n||"classes"===n){const t=Array.from(e.classList);return e.className="",t}if(r.startsWith(".")){const t=r.substring(1);return e.classList.contains(t)?(e.classList.remove(t),t):null}if(r.startsWith("@")){const t=r.substring(1),n=e.getAttribute(t);return e.removeAttribute(t),n}if(r.startsWith("data-")){const t=e.getAttribute(r);return e.removeAttribute(r),t}if("id"===n){const t=e.id;return e.id="",t}if("title"===n){const t=e.title;return e.title="",t}if("value"===n&&"value"in e){const t=e.value;return e.value="",t}const i=r.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());if(r.includes("-")||i in e.style||r in e.style){let t;return i in e.style?(t=e.style[i],e.style[i]=""):r in e.style?(t=e.style[r],e.style[r]=""):(t=e.style.getPropertyValue(r),e.style.removeProperty(r)),t}const a=e.getAttribute(t);return null!==a?(e.removeAttribute(t),a):null}putProperty(e,t,r){if(null==r)return;const n=t.trim(),i=n.toLowerCase();if("class"===i||"classes"===i)return void(Array.isArray(r)?r.forEach(t=>t&&"string"==typeof t&&e.classList.add(t)):"string"==typeof r&&(e.className=r));if(n.startsWith("."))return void(r&&e.classList.add(n.substring(1)));if(n.startsWith("@"))return void e.setAttribute(n.substring(1),r+"");if(n.startsWith("data-"))return void e.setAttribute(n,r+"");if("id"===i)return void(e.id=r+"");if("title"===i)return void(e.title=r+"");if("value"===i&&"value"in e)return void(e.value=r+"");const a=n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());n.includes("-")||a in e.style||n in e.style?a in e.style?e.style[a]=r+"":n in e.style?e.style[n]=r+"":e.style.setProperty(n,r+""):e.setAttribute(t,r+"")}};return wa(t,"TakeCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Move classes, attributes, and properties from one element to another",syntax:["take <class> [from <source>] [for <recipient>]","take <property> from <source>","take <property> from <source> and put it on <target>"],examples:["take .active from .tab for me","take class from <#source/>","take @data-value from <.source/> and put it on <#target/>"],sideEffects:["dom-mutation","property-transfer"],category:"animation",compatibility:"standard"}),ba(t,n),i=t})()),$o=Ia((()=>{let e,t,r=[ja({name:"log"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return e.args&&0!==e.args.length?{values:await Promise.all(e.args.map(e=>t.evaluate(e,r)))}:{values:[]}}async execute(e,t){const r="undefined"!=typeof window?window.console:console;0===e.values.length?r.log():r.log(...e.values)}validate(e){return"object"==typeof e&&null!==e&&Array.isArray(e.values)}};return wa(t,"LogCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Log values to the console",syntax:"log [<values...>]",examples:['log "Hello World"',"log me.value","log x y z",'log "Result:" result'],sideEffects:["console-output"],category:"utility",compatibility:"standard"}),ba(t,n),i=t})()),_o=Ia((()=>{let e,t,r=[ja({name:"tell"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(2>e.args.length)throw Error("tell command requires a target and at least one command");return{target:await t.evaluate(e.args[0],r),commands:e.args.slice(1)}}async execute(e,t){const{target:r,commands:n}=e,i=Ra(r,t);if(0===i.length)throw Error("tell command found no target elements");const a=t.locals.get("_runtimeExecute"),s=[];for(const e of i){const r={...t,me:e,you:e};for(const e of n)try{const t=await this.executeCommand(e,r,a);s.push(t),Object.assign(r,{it:t})}catch(e){throw Error("Command execution failed in tell block: "+(e instanceof Error?e.message:"Unknown error"))}}return{targetElements:i,commandResults:s,executionCount:i.length*n.length}}async executeCommand(e,t,r){if(e&&"object"==typeof e&&"command"===e.type&&r)return await r(e,t);if("function"==typeof e)return await e(t);if(e&&"object"==typeof e&&"function"==typeof e.execute)return await e.execute(t);throw Error("Invalid command: must be a function or object with execute method")}};return wa(t,"TellCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Execute commands in the context of target elements",syntax:["tell <target> <command> [<command> ...]"],examples:["tell #sidebar hide","tell .buttons add .disabled","tell closest <form/> submit"],sideEffects:["context-switching","command-execution"],category:"utility",compatibility:"standard"}),ba(t,n),i=t})()),zo=Ia((()=>{let e,t,r=[ja({name:"call"})],n=[];var i=t=class{get metadata(){return i.metadata}parseInput(e,t,r){if(!e.args?.length)throw Error("call command requires an expression");return Promise.resolve({expression:e.args[0]})}async execute(e,t){const{expression:r}=e,n=t.locals?.get("__evaluator"),i=n?await n.evaluate(r,t):await an(r,t);let a,s,o=!1;return"function"==typeof i?(s="function",a=i(),a instanceof Promise&&(o=!0,a=await a)):i instanceof Promise?(s="promise",o=!0,a=await i):(s="value",a=i),Object.assign(t,{it:a,result:a}),{result:a,wasAsync:o,expressionType:s}}};return wa(t,"CallCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Evaluate an expression and store the result in the it variable",syntax:["call <expression>"],examples:["call myFunction()",'call fetch("/api/data")',"call element.focus()"],sideEffects:["function-execution","context-mutation"],category:"execution",compatibility:"standard"}),ba(t,n),i=t})()),Vo=Ia((()=>{let e,t,r=[ja({name:"focus"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{targets:await za(e.args,t,r,"focus",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers)}}async execute(e,t){for(const t of e.targets)t.focus()}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!!Array.isArray(t.targets)&&t.targets.every(e=>hr(e))}};return wa(t,"FocusCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Focus an element (calls HTMLElement.focus())",syntax:["focus","focus <target>","focus on <target>"],examples:["focus","focus #search","focus on <input/>"],sideEffects:["focus"],category:"execution",compatibility:"standard"}),ba(t,n),i=t})()),Ho=Ia((()=>{let e,t,r=[ja({name:"blur"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{targets:await za(e.args,t,r,"blur",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers)}}async execute(e,t){for(const t of e.targets)t.blur()}validate(e){if("object"!=typeof e||null===e)return!1;const t=e;return!!Array.isArray(t.targets)&&t.targets.every(e=>hr(e))}};return wa(t,"BlurCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Remove focus from an element (calls HTMLElement.blur())",syntax:["blur","blur <target>","blur on <target>"],examples:["blur","blur #search","blur on <input/>"],sideEffects:["focus"],category:"execution",compatibility:"standard"}),ba(t,n),i=t})()),Bo=Ia((()=>{let e,t,r=[ja({name:"copy"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(1>e.args.length)throw Error("copy command requires a source (text or element)");const n=await t.evaluate(e.args[0],r);let i="text";if(e.modifiers?.format){const n=await t.evaluate(e.modifiers.format,r);"html"!==n&&"text"!==n||(i=n)}return{source:n,format:i}}async execute(e,t){const{source:r,format:n="text"}=e,i=this.extractText(r,n,t);if("undefined"!=typeof navigator&&navigator.clipboard)try{return await navigator.clipboard.writeText(i),this.dispatchCopyEvent(t,"copy:success",{text:i,method:"clipboard-api"}),{success:!0,text:i,format:n,method:"clipboard-api"}}catch{}try{if(this.copyUsingExecCommand(i))return this.dispatchCopyEvent(t,"copy:success",{text:i,method:"execCommand"}),{success:!0,text:i,format:n,method:"execCommand"}}catch{}return this.dispatchCopyEvent(t,"copy:error",{text:i,error:"All copy methods failed"}),{success:!1,text:i,format:n,method:"fallback"}}extractText(e,t,r){if("string"==typeof e)return e;if(hr(e))return"html"===t?e.outerHTML:e.textContent||"";if(e===r.me&&hr(r.me)){const e=r.me;return"html"===t?e.outerHTML:e.textContent||""}return e+""}copyUsingExecCommand(e){if("undefined"==typeof document)return!1;const t=document.createElement("textarea");t.value=e,t.style.cssText="position:fixed;top:0;left:-9999px",t.setAttribute("readonly",""),document.body.appendChild(t);try{t.select(),t.setSelectionRange(0,e.length);const r=document.execCommand("copy");return document.body.removeChild(t),r}catch{return t.parentNode?.removeChild(t),!1}}dispatchCopyEvent(e,t,r){if(hr(e.me)){const n=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!1});e.me.dispatchEvent(n)}}};return wa(t,"CopyCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Copy text or element content to the clipboard",syntax:["copy <source>","copy <source> to clipboard"],examples:['copy "Hello World"',"copy #code-snippet","copy my textContent"],sideEffects:["clipboard-write","custom-events"],category:"utility",compatibility:"lokascript-extension"}),ba(t,n),i=t})());const Wo=Ia((()=>{let e,t,r=[ja({name:"pick"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n=e.modifiers?.variant,i=n?.value;if("first"===i||"last"===i){const n=await t.evaluate(e.args[0],r),a=await t.evaluate(e.modifiers.count,r);if(!Array.isArray(n))throw Error(`pick ${i}: source must be an array, got ${typeof n}`);if("number"!=typeof a||!Number.isFinite(a))throw Error(`pick ${i}: count must be a number, got ${typeof a}`);return{variant:i,array:n,count:a}}if("random"===i){const n=await t.evaluate(e.args[0],r);if(!Array.isArray(n))throw Error("pick random: source must be an array");let i;if(e.modifiers.count){const n=await t.evaluate(e.modifiers.count,r);if("number"!=typeof n||!Number.isFinite(n))throw Error("pick random: count must be a number, got "+typeof n);i=n}return{variant:"random",array:n,count:i}}if("range"===i){const n=await t.evaluate(e.args[0],r);if(!Array.isArray(n)&&"string"!=typeof n)throw Error("pick items: source must be an array or string");const i=e.modifiers.rangeStart,a="start"===i?.value?"start":await t.evaluate(e.modifiers.rangeStart,r),s="start"===a?"start":Number(a);let o;if(e.modifiers.rangeEnd)if("end"===e.modifiers.rangeEnd.value)o="end";else{const n=await t.evaluate(e.modifiers.rangeEnd,r);o=Number(n)}const l=e.modifiers.rangeMode;return{variant:"range",array:n,rangeStart:s,rangeEnd:o,rangeMode:l?.value??"default"}}if("match"===i||"matches"===i){const n=await t.evaluate(e.args[0],r);if("string"!=typeof n)throw Error(`pick ${i}: source must be a string, got ${typeof n}`);const a=await t.evaluate(e.modifiers.regex,r),s="string"==typeof a?a:a+"",o=e.modifiers.flags,l=o?.value;return{variant:i,source:n,regex:s,flags:l}}if(e.modifiers?.from){const n=await t.evaluate(e.modifiers.from,r);if(!Array.isArray(n))throw Error("pick from requires an array");if(0===n.length)throw Error("Cannot pick from empty array");return{variant:"random",array:n}}if(0===e.args.length)throw Error("pick command requires items to choose from");return{variant:"random",items:await Promise.all(e.args.map(e=>t.evaluate(e,r)))}}async execute(e,t){const r=e.variant??"random";if("first"===r){const r=e.array??[],n=r.slice(0,e.count??0);return Object.assign(t,{it:n}),{selectedItem:n,sourceLength:r.length,sourceType:"array",variant:"first"}}if("last"===r){const r=e.array??[],n=e.count??0,i=n>0?r.slice(-n):[];return Object.assign(t,{it:i}),{selectedItem:i,sourceLength:r.length,sourceType:"array",variant:"last"}}if("range"===r){const r=e.array??[];let n="start"===e.rangeStart?0:e.rangeStart??0,i=void 0===e.rangeEnd?n+1:"end"===e.rangeEnd?r.length:e.rangeEnd;"inclusive"===e.rangeMode?i++:"exclusive"===e.rangeMode&&n++;const a=r.slice(n,i);return Object.assign(t,{it:a}),{selectedItem:a,sourceLength:r.length,sourceType:"array",variant:"range"}}if("match"===r){const r=e.source??"",n=RegExp(e.regex??"",e.flags).exec(r);return Object.assign(t,{it:n}),{selectedItem:n,sourceLength:r.length,sourceType:"string",variant:"match"}}if("matches"===r){const r=e.source??"",n=e.flags??"g",i=RegExp(e.regex??"",n.includes("g")?n:"g"+n),a=Array.from(r.matchAll(i));return Object.assign(t,{it:a}),{selectedItem:a,sourceLength:r.length,sourceType:"string",variant:"matches"}}const n=e.items??e.array??[];if(0===n.length)throw Error("Cannot pick from empty collection");if(void 0===e.count){const r=Math.floor(Math.random()*n.length),i=n[r];return Object.assign(t,{it:i}),{selectedItem:i,selectedIndex:r,sourceLength:n.length,sourceType:e.items?"items":"array",variant:"random"}}const i=n.slice(),a=[];for(let t=0;e.count>t&&i.length>0;t++){const e=Math.floor(Math.random()*i.length);a.push(i.splice(e,1)[0])}return Object.assign(t,{it:a}),{selectedItem:a,sourceLength:n.length,sourceType:e.items?"items":"array",variant:"random"}}};return wa(t,"PickCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Select from a collection (first/last/random/range/regex match)",syntax:["pick first <count> of <expr>","pick last <count> of <expr>","pick random [<count>] of <expr>","pick items <i> to <j> of <expr>","pick match of <regex> from <expr>","pick from <array>","pick <item1>, <item2>, ..."],examples:["pick first 3 of items","pick last 2 of items","pick random 2 of items","pick items 1 to 3 of items",'pick match of "[0-9]+" from text',"pick from colors",'pick "red", "green", "blue"'],sideEffects:["random-selection"],category:"utility",compatibility:"standard"}),ba(t,n),i=t})());const Do=Ia((()=>{let e,t,r=[ja({name:"beep"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return 0===e.args.length?{expressions:[]}:{expressions:await Promise.all(e.args.map(e=>t.evaluate(e,r)))}}async execute(e,t){const r=e.expressions||[];if(0===r.length)return this.debugContext(t),{expressionCount:0,debugged:!0,outputs:[]};const n=[];console.group("\ud83d\udd14 beep! Debug Output");for(const e of r){const t=this.debugExpression(e);n.push(t),console.log("Value:",e),console.log("Type:",t.type),console.log("Representation:",t.representation),console.log("---")}return console.groupEnd(),{expressionCount:r.length,debugged:!0,outputs:n}}debugContext(e){console.group("\ud83d\udd14 beep! Context Debug"),console.log("me:",e.me),console.log("it:",e.it),console.log("you:",e.you),console.log("locals:",e.locals),console.log("globals:",e.globals),console.log("variables:",e.variables),console.groupEnd()}debugExpression(e){return{value:e,type:this.getType(e),representation:this.getRepresentation(e)}}getType(e){return null===e?"null":void 0===e?"undefined":Array.isArray(e)?"array":hr(e)?"HTMLElement":e instanceof Element?"Element":e instanceof Node?"Node":e instanceof Error?"Error":e instanceof Date?"Date":e instanceof RegExp?"RegExp":typeof e}getRepresentation(e){if(null===e)return"null";if(void 0===e)return"undefined";if(Array.isArray(e))return`Array(${e.length}) [${e.slice(0,3).map(e=>this.getRepresentation(e)).join(", ")}${e.length>3?"...":""}]`;if(hr(e)){const t=e;return`<${t.tagName.toLowerCase()}${t.id?"#"+t.id:""}${t.className?"."+t.className.split(" ").join("."):""}/>`}if(e instanceof Error)return"Error: "+e.message;if("string"==typeof e)return e.length>50?`"${e.substring(0,47)}..."`:`"${e}"`;if("object"==typeof e)try{const t=Object.keys(e);return`Object {${t.slice(0,3).join(", ")}${t.length>3?"...":""}}`}catch{return"[Object]"}return e+""}};return wa(t,"BeepCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Debug output for expressions with type information",syntax:["beep!","beep! <expression>","beep! <expression>, <expression>, ..."],examples:["beep!","beep! myValue","beep! me.id, me.className"],sideEffects:["console-output","debugging"],category:"utility",compatibility:"lokascript-extension"}),ba(t,n),i=t})()),Fo=Ia((()=>{let e,t,r=[ja({name:"breakpoint"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{}}async execute(e,t){}validate(e){return"object"==typeof e&&null!==e}};return wa(t,"BreakpointCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Drop into the debugger (emits a debugger; statement)",syntax:["breakpoint"],examples:["breakpoint","on click breakpoint"],sideEffects:["debugging"],category:"utility",compatibility:"standard"}),ba(t,n),i=t})()),Uo=Ia((()=>{let e,t,r=[ja({name:"js"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){let n,i;if(0===e.args.length)throw Error("js command requires JavaScript code");const a=e.args[0],s=e.args[1];if(a&&"literal"===a.type&&"string"==typeof a.value)n=a.value;else{if(!a||void 0===a.value)throw Error("js command requires JavaScript code");n=a.value+""}s&&"arrayLiteral"===s.type&&Array.isArray(s.elements)&&(i=s.elements.map(e=>"string"==typeof e.value?e.value:e.value+"").filter(e=>e&&e.length>0));const o={code:n};return i&&i.length>0&&(o.parameters=i),o}async execute(e,t){const{code:r,parameters:n=[]}=e;if(!r.trim())return{result:void 0,executed:!1,codeLength:r.length,parameters:n,preserveArrayResult:!0};try{const e=this.createExecutionContext(t,n),i=Function(...Object.keys(e),r),a=await i(...Object.values(e));return void 0!==a&&Object.assign(t,{it:a}),{result:a,executed:!0,codeLength:r.length,parameters:n,preserveArrayResult:!0}}catch(e){throw Error("JavaScript execution failed: "+(e instanceof Error?e.message:"Unknown error"))}}createExecutionContext(e,t){return{me:e.me,it:e.it,you:e.you,locals:e.locals,globals:e.globals,variables:e.variables,console:console,document:"undefined"!=typeof document?document:void 0,window:"undefined"!=typeof window?window:void 0,...t.reduce((t,r)=>{let n=e.locals?.get(r);return void 0===n&&(n=e.variables?.get(r)),void 0===n&&(n=e[r]),t[r]=n,t},{})}}};return wa(t,"JsCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Execute inline JavaScript code with access to hyperscript context",syntax:["js <code> end","js(param1, param2) <code> end"],examples:['js console.log("Hello") end',"js(x, y) return x + y end",'js me.style.color = "red" end'],sideEffects:["code-execution","data-mutation"],category:"advanced",compatibility:"standard"}),ba(t,n),i=t})()),Ko=Ia((()=>{let e,t,r=[ja({name:"async"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(1>e.args.length)throw Error("async command requires at least one command to execute");return{commands:e.args}}async execute(e,t){const{commands:r}=e,n=Date.now();try{const e=await this.executeCommandsAsync(t,r),i=Date.now()-n;return e.length>0&&Object.assign(t,{it:e[e.length-1]}),{commandCount:r.length,results:e,executed:!0,duration:i}}catch(e){throw Error("Async command execution failed: "+(e instanceof Error?e.message:"Unknown error"))}}async executeCommandsAsync(e,t){const r=[];for(let n=0;t.length>n;n++){const i=t[n];try{const t=await this.executeCommand(i,e);r.push(t),Object.assign(e,{it:t})}catch(e){const r=this.getCommandName(i);throw Error(`Command '${r}' (${n+1}/${t.length}) failed: ${e instanceof Error?e.message:"Unknown error"}`)}}return r}async executeCommand(e,t){if("function"==typeof e)return await e(t);if(e&&"object"==typeof e&&"execute"in e&&"function"==typeof e.execute)return await e.execute(t);throw Error("Invalid command: must be a function or object with execute method")}getCommandName(e){return"function"==typeof e?e.name||"anonymous function":e&&"object"==typeof e?e.name||"unnamed command":"unknown"}};return wa(t,"AsyncCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Execute commands asynchronously without blocking",syntax:["async <command> [<command> ...]"],examples:["async command1 command2","async fetchData processData","async animateIn showContent"],sideEffects:["async-execution"],category:"advanced",compatibility:"lokascript-extension"}),ba(t,n),i=t})()),Zo=Ia((()=>{let e,t,r=[ja({name:"go"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return e.args&&0!==e.args.length?{args:await Promise.all(e.args.map(e=>t.evaluate(e,r)))}:{args:[]}}async execute(e,t){const{args:r}=e;if(0===r.length)throw Error("Go command requires arguments");if("string"==typeof r[0]&&"back"===r[0].toLowerCase())return await this.goBack(),{result:"back",type:"back"};if(this.isUrlNavigation(r))return{result:await this.navigateToUrl(r,t),type:"url"};const n=this.findBareUrl(r);return null!==n?{result:await this.navigateToBareUrl(n,r),type:"url"}:{result:await this.scrollToElement(r,t),type:"scroll"}}isUrlNavigation(e){return-1!==e.findIndex(e=>"url"===e)}isBareUrl(e){return!!e.startsWith("/")||/^[a-z][a-z0-9+.-]*:/i.test(e)}findBareUrl(e){for(const t of e)if("to"!==t&&"the"!==t)return"string"==typeof t&&this.isBareUrl(t)?t:null;return null}async navigateToBareUrl(e,t){if(t.includes("new")&&t.includes("window")){if("undefined"!=typeof window&&window.open){const t=window.open(e,"_blank");t?.focus&&t.focus()}}else e.startsWith("#")?"undefined"!=typeof window&&(window.location.hash=e):"undefined"!=typeof window&&(window.location.assign?.(e)??(window.location.href=e));return e}async goBack(){if("undefined"==typeof window||!window.history)throw Error("Browser history API not available");window.history.back()}async navigateToUrl(e,t){const r=e.findIndex(e=>"url"===e),n=e[r+1];if(!n)throw Error('URL is required after "url" keyword');const i="string"==typeof n?n:n+"",a=e.includes("new")&&e.includes("window");if(!this.isValidUrl(i))throw Error(`Invalid URL: "${i}"`);if(a){if("undefined"!=typeof window&&window.open){const e=window.open(i,"_blank");e?.focus&&e.focus()}}else i.startsWith("#")?"undefined"!=typeof window&&(window.location.hash=i):"undefined"!=typeof window&&(window.location.assign?.(i)??(window.location.href=i));return i}isValidUrl(e){try{return e.startsWith("/")||e.startsWith("#")||new URL(e),!0}catch{return!1}}async scrollToElement(e,t){const r=this.parseScrollPosition(e),n=this.parseScrollTarget(e),i=this.parseScrollOffset(e),a=!e.includes("instantly"),s=this.resolveScrollTarget(n,t);if(!s)throw Error("Target element not found: "+n);if("undefined"!=typeof window){const e=a?"smooth":"instant",t=this.mapVerticalPosition(r.vertical),n=this.mapHorizontalPosition(r.horizontal);if(0!==i){s.scrollIntoView?.({behavior:e,block:t,inline:n});const{x:a,y:o}=this.calculateScrollPosition(s,r,i);window.scrollTo?.({left:a,top:o,behavior:e})}else s.scrollIntoView?.({behavior:e,block:t,inline:n})}return s}mapVerticalPosition(e){return{top:"start",middle:"center",bottom:"end",nearest:"nearest"}[e]||"start"}mapHorizontalPosition(e){return{left:"start",center:"center",right:"end",nearest:"nearest"}[e]||"nearest"}parseScrollPosition(e){const t={vertical:"top",horizontal:"nearest"},r=["top","middle","bottom"],n=["left","center","right"];let i=!1,a=!1;for(const s of e)"string"==typeof s&&(r.includes(s)?(t.vertical=s,i=!0):n.includes(s)&&(t.horizontal=s,a=!0));return a&&!i&&(t.vertical="nearest"),t}parseScrollTarget(e){const t=e.findIndex(e=>"of"===e);if(-1!==t&&e.length>t+1){let r=e[t+1];return"the"===r&&e.length>t+2&&(r=e[t+2]),r}for(const t of e)if("object"==typeof t&&t&&t.nodeType)return t;const r=["top","middle","bottom","left","center","right","of","the","to","smoothly","instantly"];for(const t of e)if("string"==typeof t&&!r.includes(t)&&(t.startsWith("#")||t.startsWith(".")||t.includes("[")||/^[a-zA-Z][a-zA-Z0-9-]*$/.test(t)))return t;return"body"}parseScrollOffset(e){for(let t=0;e.length>t;t++){const r=e[t];if("string"==typeof r){const e=r.match(/^([+-]?\d+)(px)?$/);if(e)return parseInt(e[1],10)}if(("+"===r||"-"===r)&&e.length>t+1){const n=e[t+1],i="number"==typeof n?n:parseInt((n+"").replace("px",""),10);if(!isNaN(i))return"-"===r?-i:i}}return 0}resolveScrollTarget(e,t){if("object"==typeof e&&e&&e.nodeType)return e;const r="string"==typeof e?e:e+"";if("body"===r&&"undefined"!=typeof document)return document.body;if("html"===r&&"undefined"!=typeof document)return document.documentElement;if("me"===r&&hr(t.me))return t.me;if("it"===r&&hr(t.it))return t.it;if("you"===r&&hr(t.you))return t.you;const n=vr(r,t);if(hr(n))return n;if("undefined"!=typeof document)try{const e=document.querySelector(r);if(e)return e}catch{try{const e=document.getElementsByTagName(r);if(e.length>0)return e[0]}catch{}}return null}calculateScrollPosition(e,t,r){if("undefined"==typeof window||!e.getBoundingClientRect)return{x:0,y:0};const n=e.getBoundingClientRect(),i=window.pageXOffset||document.documentElement?.scrollLeft||0,a=window.pageYOffset||document.documentElement?.scrollTop||0,s=window.innerWidth||800,o=window.innerHeight||600;let l=i,c=a;switch(t.horizontal){case"left":l=n.left+i;break;case"center":l=n.left+i+n.width/2-s/2;break;case"right":l=n.right+i-s}switch(t.vertical){case"top":c=n.top+a+r;break;case"middle":c=n.top+a+n.height/2-o/2+r;break;case"bottom":c=n.bottom+a-o+r}return{x:Math.max(0,l),y:Math.max(0,c)}}};return wa(t,"GoCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:a},null,n),i=t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),t.metadata=Pa({description:"Navigation functionality including URL navigation, element scrolling, and browser history",syntax:["go back","go to url <url> [in new window]","go to [position] [of] <element>"],examples:["go back",'go to url "https://example.com"',"go to top of #header"],sideEffects:["navigation","scrolling"],category:"navigation",compatibility:"standard"}),ba(t,n),i=t})());class Xo{constructor(){this.name="install"}get metadata(){return Xo.metadata}async parseInput(e,t,r){if(1>e.args.length)throw Error("install command requires a behavior name");const n=e.args[0];let i,a,s;if(i="identifier"===n?.type&&"string"==typeof n.name?n.name:await t.evaluate(n,r)+"",!/^[A-Z][a-zA-Z0-9_]*$/.test(i))throw Error(`Behavior name must be PascalCase (start with uppercase): "${i}"`);if(e.args.length>=2){const n=await t.evaluate(e.args[1],r);if(n&&"object"==typeof n&&!Array.isArray(n)){a=n;for(const e of Object.keys(a))if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(e))throw Error(`Invalid parameter name: "${e}"`)}}return e.modifiers?.on&&(s=await t.evaluate(e.modifiers.on,r)),{behaviorName:i,parameters:a,target:s}}async execute(e,t){const{behaviorName:r,parameters:n={},target:i}=e;try{const e=this.resolveTarget(i,t);if(0===e.length)throw Error("No target elements found to install behavior on");if(!this.behaviorExists(r,t))throw Error(`Behavior "${r}" is not defined. Define it using the 'behavior' keyword before installing.`);const a=[];for(const i of e){const e=await this.installBehavior(r,i,n,t);a.push(e)}return{success:!0,behaviorName:r,installedCount:a.length,instances:a}}catch(e){throw Error(`Failed to install behavior "${r}": ${e instanceof Error?e.message:e+""}`)}}resolveTarget(e,t){if(null==e){const e=t.me||t.locals.get("me");if(hr(e))return[e];throw Error('No target specified and "me" is not available in context')}if(hr(e))return[e];if(Array.isArray(e)){const t=e.filter(e=>hr(e));if(0===t.length)throw Error("Target array contains no valid HTMLElements");return t}if("string"==typeof e){if("me"===e){const e=t.me||t.locals.get("me");if(hr(e))return[e];throw Error('"me" is not available in context')}if("undefined"!=typeof document){const t=document.querySelectorAll(e),r=Array.from(t).filter(e=>hr(e));if(0===r.length)throw Error(`No elements found matching selector: "${e}"`);return r}throw Error("document is not available (not in browser environment)")}if(e&&"object"==typeof e&&"length"in e){const t=Array.from(e).filter(e=>hr(e));if(0===t.length)throw Error("Target collection contains no valid HTMLElements");return t}if("object"==typeof e&&"element"in e){const t=e.element;if(hr(t))return[t]}throw Error("Cannot resolve target to HTMLElement(s): "+e)}behaviorExists(e,t){const r=t.locals.get("_behaviors");if(r&&"object"==typeof r){const t=r;if(t.has(e))return!0;if(t.resolve&&t.resolve(e))return!0}if("undefined"!=typeof globalThis){const t=globalThis._hyperscript;if(t?.behaviors){if(t.behaviors.has(e))return!0;if(t.behaviors.resolve&&t.behaviors.resolve(e))return!0}}return!1}async installBehavior(e,t,r,n){const i=n.locals.get("_behaviors");if(i&&"object"==typeof i){const n=i;if(n.install&&"function"==typeof n.install)return await n.install(e,t,r)}if("undefined"!=typeof globalThis){const n=globalThis._hyperscript;if(n?.behaviors?.install)return await n.behaviors.install(e,t,r)}throw Error("Behavior system not available in context")}}function Go(e){return hr(e)?e:e+""}Xo.metadata=Pa({description:"Install a behavior on an element with optional parameters",syntax:["install <BehaviorName>","install <BehaviorName> on <element>","install <BehaviorName>(param: value)","install <BehaviorName>(param: value) on <element>"],examples:["install Removable","install Draggable on #box",'install Tooltip(text: "Help", position: "top")','install Sortable(axis: "y") on .list',"install MyBehavior(foo: 42) on the first <div/>"],category:"behaviors",compatibility:"standard",sideEffects:["behavior-installation","element-modification"]});class Jo{constructor(e){this.position=e}concat(e,t){const r=null==e?"":e+"",n=t+"";return"append"===this.position?r+n:n+r}pushInto(e,t){return"append"===this.position?e.push(t):e.unshift(t),e}async parseInput(e,t,r){if(!e.args?.length)throw Error(this.name+" requires content");const n=await t.evaluate(e.args[0],r),i=e.modifiers?.to??e.target;if(!i)return{kind:"implicit",content:n};const a=await uo(i,t,r,{scopeElements:async()=>hr(r.me)?[r.me]:[],selectorSource:!0,bareReference:!0});if(a)return function(e,t){switch(e.kind){case"selector":return{kind:"selector",selector:e.selector,content:t};case"attribute":return{kind:"attribute",elements:e.elements,name:e.name,content:t};case"property":return{kind:"property",property:e.target,content:t};case"variable":return{kind:"variable",name:e.name,scope:e.scope,content:t};default:throw Error(`unrequested write-target rung '${e.kind}'`)}}(a,n);const s=await t.evaluate(i,r),o=function(e){if(hr(e))return[e];if(Array.isArray(e)&&e.length>0&&e.every(e=>hr(e)))return e;if(e&&"object"==typeof e&&"number"==typeof e.length&&"function"==typeof e.item){const t=Array.from(e).filter(e=>hr(e));return t.length?t:null}return null}(s);return o?{kind:"elements",elements:o,content:n}:{kind:"value",target:s,content:n}}async execute(e,t){switch(e.kind){case"selector":return this.done(t,this.insertIntoSelector(e.selector,e.content));case"elements":return this.done(t,this.insertIntoEach(e.elements,e.content));case"attribute":{for(const t of e.elements)t.setAttribute(e.name,this.concat(t.getAttribute(e.name),e.content));const r=e.elements[0]?.getAttribute(e.name)??this.concat(null,e.content);return Object.assign(t,{it:r}),{target:"@"+e.name,value:r,targetType:"attribute"}}case"property":{const r=Es(e.property),n=this.combineValue(r,e.content);return hr(r)||xs(e.property,n),Object.assign(t,{it:n}),{target:e.property.element,value:n,targetType:"property"}}case"variable":return this.executeVariable(e,t);case"value":{const r=this.combineValue(e.target,e.content,!0);return Object.assign(t,{it:r}),{target:e.target,value:r,targetType:this.targetTypeOf(e.target)}}case"implicit":return this.execImplicit(t,e.content)}}insertIntoSelector(e,t){return this.insertIntoEach(Er(e),t)}insertIntoEach(e,t){const r=Go(t);for(const t of e)Ya(t,r,this.position);return e}combineValue(e,t,r=!1){if(Array.isArray(e))return this.pushInto(e,t);if(e instanceof Set)return e.add(t),e;if(hr(e))return Ya(e,Go(t),this.position),e;if(r&&null!=e&&"string"!=typeof e&&"number"!=typeof e)throw Error(`Unable to ${this.name} a value!`);return this.concat(e,t)}targetTypeOf(e){return Array.isArray(e)?"array":e instanceof Set?"set":hr(e)?"element":"result"}executeVariable(e,t){if("me"===e.name||"you"===e.name){const r="me"===e.name?t.me:t.you;if(hr(r))return Ya(r,Go(e.content),this.position),Object.assign(t,{it:r}),{target:r,value:r,targetType:"element"}}if("it"===e.name||"result"===e.name)return this.execImplicit(t,e.content);const r=vr(e.name,t,e.scope),n=this.combineValue(r,e.content);return Array.isArray(r)||r instanceof Set||hr(r)||br(e.name,n,t,e.scope),Object.assign(t,{it:n}),{target:e.name,value:n,targetType:this.targetTypeOf(r)}}execImplicit(e,t){const r=e.it??e.result,n=this.combineValue(r,t);return Object.assign(e,{it:n,result:n}),{target:"result",value:n,targetType:this.targetTypeOf(r)}}done(e,t){const r=1===t.length?t[0]:t;return Object.assign(e,{it:r}),{target:r,value:r,targetType:"element"}}}const Yo=Ia((()=>{let e,t,r=[ja({name:"append"})],n=[],i=Jo;var a=t=class extends i{get metadata(){return a.metadata}constructor(){super("append")}};return wa(t,"AppendCommand"),(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),a=t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),t.metadata=Pa({description:"Add content to the end of a string, array, Set, or HTML element",syntax:["append <content>","append <content> to <target>"],examples:['append "Hello"','append "World" to greeting',"append item to myArray",'append "<p>New</p>" to #content','append " (edited)" to #title\'s textContent'],sideEffects:["data-mutation","dom-mutation"],category:"content",compatibility:"standard"}),ba(t,n),a=t})()),Qo=Ia((()=>{let e,t,r=[ja({name:"prepend"})],n=[],i=Jo;var a=t=class extends i{get metadata(){return a.metadata}constructor(){super("prepend")}};return wa(t,"PrependCommand"),(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;va(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),a=t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),t.metadata=Pa({description:"Add content to the start of a string, array, Set, or HTML element",syntax:["prepend <content>","prepend <content> to <target>"],examples:['prepend "Hello"','prepend "World" to greeting',"prepend item to myArray",'prepend "<p>First</p>" to #content'],sideEffects:["data-mutation","dom-mutation"],category:"content",compatibility:"lokascript-extension"}),ba(t,n),a=t})());class el{constructor(){this.name="render"}get metadata(){return el.metadata}async parseInput(e,t,r){if(1>e.args.length)throw Error("render command requires a template");const n=await t.evaluate(e.args[0],r);let i;if(e.args.length>=3&&"with"===await t.evaluate(e.args[1],r)){const n=await t.evaluate(e.args[2],r);n&&"object"==typeof n&&(i=n)}if(!i&&e.modifiers?.with){const n=await t.evaluate(e.modifiers.with,r);n&&"object"==typeof n&&(i=n)}return{template:n,variables:i}}async execute(e,t){const{template:r,variables:n={}}=e,i=this.extractTemplateContent(r,t),a=this.createTemplateContext(t,n),s=[],o=await this.processTemplate(i,a,s),l=this.createDOMElement(o);return Object.assign(t,{it:l}),{element:l,rendered:o,directivesProcessed:s}}extractTemplateContent(e,t){if(e instanceof HTMLTemplateElement)return e.innerHTML;if("string"==typeof e){let r=e;if(!r.includes("<")&&!r.includes("$")){const e=this.resolveVariable(r,t);if(e instanceof HTMLTemplateElement)return e.innerHTML;"string"==typeof e&&(r=e)}const n=r.match(/<template[^>]*>([\s\S]*?)<\/template>/i);return n?n[1]:r}if(e&&"object"==typeof e&&"innerHTML"in e)return e.innerHTML;throw Error("Invalid template format")}createTemplateContext(e,t){return{...e,locals:new Map([...Array.from(e.locals.entries()),...Object.entries(t)])}}async processTemplate(e,t,r){const n=e.split("\n"),i=[];let a=0;for(;n.length>a;){const e=n[a].trim();if(e.startsWith("@repeat ")){const{nextIndex:e,rendered:s}=await this.processRepeatDirective(n,a,t);i.push(s),a=e,r.push("@repeat")}else if(e.startsWith("@if ")){const{nextIndex:e,rendered:s}=await this.processIfDirective(n,a,t,r);i.push(s),a=e,r.push("@if")}else if("@else"===e||"@end"===e)a++;else{const r=this.processVariableInterpolation(e,t);i.push(r),a++}}return i.join("\n")}async processRepeatDirective(e,t,r){const n=e[t].trim(),i=n.match(/^@repeat\s+in\s+(.+)$/);if(!i)throw Error("Invalid @repeat syntax: "+n);const a=this.evaluateExpression(i[1],r),{endIndex:s,blockContent:o}=this.extractDirectiveBlock(e,t+1),l=[];if(Array.isArray(a))for(const e of a){const t={...r,locals:new Map([...r.locals.entries(),["it",e]])},n=await this.processTemplate(o.join("\n"),t,[]);l.push(n)}return{nextIndex:s+1,rendered:l.join("\n")}}async processIfDirective(e,t,r,n){const i=e[t].trim(),a=i.match(/^@if\s+(.+)$/);if(!a)throw Error("Invalid @if syntax: "+i);const s=!!this.evaluateExpression(a[1],r),{endIndex:o,blockContent:l,elseContent:c}=this.extractIfElseBlock(e,t+1);let u="";return s?u=await this.processTemplate(l.join("\n"),r,[]):c.length>0&&(u=await this.processTemplate(c.join("\n"),r,[]),n.push("@else")),{nextIndex:o+1,rendered:u}}extractDirectiveBlock(e,t){const r=[];let n=1,i=t;for(;e.length>i&&n>0;){const t=e[i].trim();t.startsWith("@repeat ")||t.startsWith("@if ")?(n++,r.push(e[i])):"@end"===t?(n--,n>0&&r.push(e[i])):r.push(e[i]),i++}return{endIndex:i-1,blockContent:r}}extractIfElseBlock(e,t){const r=[],n=[];let i=1,a=t,s=!1;for(;e.length>a&&i>0;){const t=e[a].trim();if(t.startsWith("@if "))i++;else{if("@else"===t&&1===i){s=!0,a++;continue}if("@end"===t&&(i--,0===i))break}s?n.push(e[a]):r.push(e[a]),a++}return{endIndex:a,blockContent:r,elseContent:n}}processVariableInterpolation(e,t){return e.replace(/\$\{([^}]+)\}/g,(e,r)=>{try{const e=r.trim();if(e.startsWith("unescaped ")){const r=e.substring(10).trim();return(this.evaluateExpression(r,t)||"")+""}const n=this.evaluateExpression(e,t);return this.escapeHtml((n||"")+"")}catch(t){return de(`render: template interpolation error for ${r}:`,t),e}})}evaluateExpression(e,t){if("true"===e)return!0;if("false"===e)return!1;if("null"===e)return null;if("undefined"===e)return;const r=Number(e);if(!isNaN(r)&&""!==e.trim())return r;if(e.startsWith("[")&&e.endsWith("]"))try{return JSON.parse(e)}catch{}if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);if(e.includes(".")){const r=e.split(".");let n=this.resolveVariable(r[0],t);for(let e=1;r.length>e&&null!=n;e++){if("object"!=typeof n||null===n)return;n=n[r[e]]}return n}return this.resolveVariable(e,t)}resolveVariable(e,t){return t.locals?.has(e)?t.locals.get(e):"me"===e?t.me:"it"===e?t.it??t.result:"you"===e?t.you:"result"===e?t.result??t.it:t.globals?.has(e)?t.globals.get(e):void 0}escapeHtml(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}createDOMElement(e){if("undefined"==typeof document)return null;const t=document.createElement("div");return t.innerHTML=e,1===t.children.length?t.firstElementChild:t}}el.metadata=Pa({description:"Render templates with @if, @else, and @repeat directives",syntax:["render <template>","render <template> with <variables>","render <template> with (key: value, ...)"],examples:["render myTemplate",'render myTemplate with (name: "Alice")','render "<template>Hello ${name}!</template>" with (name: "World")',"render template with (items: data)"],category:"templates",compatibility:"standard",sideEffects:["dom-creation","template-execution"]});class tl{constructor(){this.name="pseudo-command"}get metadata(){return tl.metadata}async parseInput(e,t,r){if(1===e.args.length&&"objectLiteral"===e.args[0].type){const n=e.args[0].properties||[];let i,a,s="",o=[];for(const e of n){const n=e.value;switch(e.key?.name||e.key?.value){case"methodName":s=n?.value||await t.evaluate(n,r)+"";break;case"methodArgs":"arrayLiteral"===n?.type&&n.elements?o=await Promise.all(n.elements.map(e=>t.evaluate(e,r))):"literal"===n?.type&&Array.isArray(n.value)&&(o=await Promise.all(n.value.map(e=>t.evaluate(e,r))));break;case"preposition":const e=n?.value;e&&"null"!==e&&(i=e);break;case"target":case"targetExpression":a=await t.evaluate(n,r)}}if(!s)throw Error("pseudo-command requires method name");if(null==a)throw Error("pseudo-command requires a target expression");return{methodName:s,methodArgs:o,preposition:i,targetExpression:a}}if(2>e.args.length)throw Error("pseudo-command requires method name and target expression");const n=await t.evaluate(e.args[0],r)+"",i=Array.isArray(e.args[1])?await Promise.all(e.args[1].map(e=>t.evaluate(e,r))):[];let a,s;const o=["from","on","with","into","at","to"];for(const n of o)if(e.modifiers?.[n]){s=n,a=await t.evaluate(e.modifiers[n],r);break}if(a||3>e.args.length||(a=await t.evaluate(e.args[2],r)),!a)throw Error("pseudo-command requires a target expression");return{methodName:n,methodArgs:i,preposition:s,targetExpression:a}}async execute(e,t){const{methodName:r,methodArgs:n,targetExpression:i}=e;try{const e=await this.resolveTarget(i,t);if(null==e)throw Error("Target expression resolved to "+e);const a=this.resolveMethod(e,r);if(!a)throw Error(`Method "${r}" not found on target object`);if("function"!=typeof a)throw Error(`"${r}" is not a function (it's a ${typeof a})`);const s=await this.executeMethod(a,e,n);return t.locals.set("result",s),Object.assign(t,{it:s}),{result:s,methodName:r,target:e}}catch(e){throw Error("Pseudo-command failed: "+(e instanceof Error?e.message:e+""))}}async resolveTarget(e,t){return"object"==typeof e&&null!==e?e:"string"==typeof e?t.locals.has(e)?t.locals.get(e):t.variables?.has(e)?t.variables.get(e):t.globals.has(e)?t.globals.get(e):"me"===e&&t.me?t.me:"it"===e&&t.it?t.it:"document"===e?"undefined"!=typeof document?document:null:"window"===e?"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:null:this.resolvePropertyPath(e,t):e}resolvePropertyPath(e,t){const r=e.split(".");let n="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:null;t.locals.has(r[0])?(n=t.locals.get(r[0]),r.shift()):t.variables?.has(r[0])?(n=t.variables.get(r[0]),r.shift()):t.globals.has(r[0])&&(n=t.globals.get(r[0]),r.shift());for(const e of r){if(null==n)return null;n=n[e]}return n}resolveMethod(e,t){if(!e)return null;if(t in e)return e[t];const r=t.split(".");let n=e;for(let e=0;r.length>e;e++){const t=r[e];if(null==n)return null;if(!(t in n))return null;if(n=n[t],e===r.length-1&&"function"==typeof n)return n}return null}async executeMethod(e,t,r){try{const n=e.apply(t,r);return n&&"object"==typeof n&&"then"in n?await n:n}catch(e){throw Error("Method execution failed: "+(e instanceof Error?e.message:e+""))}}}tl.metadata=Pa({description:"Treat a method on an object as a top-level command",syntax:["<method>(<args>) [(to|on|with|into|from|at)] <expression>"],examples:['getElementById("d1") from the document',"reload() the location of the window",'setAttribute("foo", "bar") on me',"foo() on me"],category:"execution",compatibility:"standard",sideEffects:["method-execution"]});var rl={to:"destination",into:"destination",from:"source",with:"style",by:"quantity",as:"method",on:"event",over:"duration",for:"duration"},nl={set:"destination",on:"event",trigger:"event",send:"event",wait:"duration",fetch:"source",get:"source",if:"condition",unless:"condition",while:"condition",repeat:"loopType",go:"destination",scroll:"destination",tell:"destination",default:"destination",swap:"destination",bind:"destination"},il=new Set(["to","from","into","with","at","in","of","as","by","before","after","without"]),al=new Set(["add","append","async","beep","blur","break","breakpoint","call","clear","close","continue","decrement","default","empty","exit","fetch","focus","for","get","go","halt","hide","if","increment","install","js","log","make","measure","morph","open","pick","process","push","put","remove","render","repeat","replace","reset","return","select","send","set","settle","show","swap","take","tell","throw","toggle","transition","trigger","unless","wait","live","bind","eventsource","socket","worker","intercept"]),sl=new Set(["then","else","end","and","or","not","if","unless","for","while","until","forever","times","each","index","in","to","from","into","with","without","of","at","by","as","matches","contains","is","exists","on","when","every","event","init","def","behavior","global","local","the","a","an","first","last","start","before","after"]),ol=new Set(["click","dblclick","mousedown","mouseup","mouseenter","mouseleave","mouseover","mouseout","mousemove","keydown","keyup","keypress","focus","blur","change","input","submit","reset","load","unload","resize","scroll","touchstart","touchend","touchmove","touchcancel","dragstart","dragend","dragenter","dragleave","dragover","drop","contextmenu","wheel","pointerdown","pointerup","pointermove","ms","s"]),ll=new Set(["and","or","not","is","exists","matches","contains","then","else"]),cl=new Set(["true","false","null","undefined","it","me","my","result"]),ul=new Set(["first","last","next","previous","prev","at","random","closest","parent","children","within","no","empty","some","starts with","ends with"]),dl=new Set(["if","unless","when","where","\u3082\u3057","\u6642\u306b","\u3068\u304d\u306b","\u3069\u3053\u3067","\u5982\u679c","\u5f53","\u0625\u0630\u0627","\u0639\u0646\u062f\u0645\u0627","\u062d\u064a\u062b","si","cuando","donde","wenn","wann","wo","quand","lorsque","o\u00f9","quando","onde","e\u011fer","zaman","nerede","ketika","saat","dimana","\ub54c","\uc5b4\ub514\uc11c","maypi","wakati","wapi"]),ml=new Set(["then","\u305d\u308c\u304b\u3089","\u90a3\u4e48","\u062b\u0645","entonces","alors","dann","sonra","lalu","chayqa","kisha"]);function pl(e,t,r={}){const{allowEnglishFallback:n=!0}=r,i=new Map,a=new Map,s=new Map,o=new Map,l=new Map,c=new Map,u=new Map,d=new Map,m=new Map,p=new Map;function h(e,t,r=!1){for(const[n,i]of Object.entries(e)){const e=i.toLowerCase();t.set(e,n.toLowerCase()),!r&&m.has(e)||m.set(e,n.toLowerCase()),p.set(n.toLowerCase(),i.toLowerCase())}}e.commands&&h(e.commands,i,!0),e.logical&&h(e.logical,o,!0),e.events&&h(e.events,s),e.values&&h(e.values,c),e.temporal&&h(e.temporal,l),e.modifiers&&h(e.modifiers,a),e.attributes&&h(e.attributes,u),e.expressions&&h(e.expressions,d);const f=new Set(i.keys()),y=new Set(m.keys());if(n){for(const e of al)f.add(e);for(const e of sl)y.add(e);for(const e of ol)y.add(e)}return{locale:t,resolve(e){const t=e.toLowerCase(),r=m.get(t);if(void 0!==r)return r;if(n){if(al.has(t)||sl.has(t))return t;if(ol.has(t))return t}},isCommand(e){const t=e.toLowerCase();return!!i.has(t)||!(!n||!al.has(t))},isKeyword(e){const t=e.toLowerCase();return!!(a.has(t)||o.has(t)||l.has(t)||c.has(t))||!(!n||!sl.has(t))},isEvent(e){const t=e.toLowerCase();return!!s.has(t)||!!ol.has(t)},isModifier(e){const t=e.toLowerCase();return a.has(t)||n&&il.has(t)},isLogical(e){const t=e.toLowerCase();return o.has(t)||n&&ll.has(t)},isValue(e){const t=e.toLowerCase();return c.has(t)||n&&cl.has(t)},isExpression(e){const t=e.toLowerCase();return d.has(t)||n&&ul.has(t)},getCommands:()=>Array.from(f),getKeywords:()=>Array.from(y),toLocale:e=>p.get(e.toLowerCase())}}function hl(){return{locale:"en",resolve(e){const t=e.toLowerCase();if(al.has(t)||sl.has(t)||ol.has(t))return t},isCommand:e=>al.has(e.toLowerCase()),isKeyword:e=>sl.has(e.toLowerCase()),isEvent:e=>ol.has(e.toLowerCase()),isModifier:e=>il.has(e.toLowerCase()),isLogical:e=>ll.has(e.toLowerCase()),isValue:e=>cl.has(e.toLowerCase()),isExpression:e=>ul.has(e.toLowerCase()),getCommands:()=>Array.from(al),getKeywords:()=>Array.from(sl),toLocale:e=>e.toLowerCase()}}var fl={commands:{on:"en",tell:"decir",trigger:"disparar",send:"enviar",take:"tomar",put:"poner",set:"establecer",get:"obtener",add:"agregar",remove:"quitar",toggle:"alternar",hide:"ocultar",show:"mostrar",if:"si",unless:"menos",repeat:"repetir",for:"para",while:"mientras",until:"hasta",continue:"continuar",break:"romper",halt:"detener",wait:"esperar",fetch:"buscar",call:"llamar",return:"retornar",make:"hacer",log:"registrar",throw:"lanzar",catch:"atrapar",measure:"medir",transition:"transici\u00f3n",increment:"incrementar",decrement:"decrementar",default:"predeterminar",go:"ir",pushUrl:"pushUrl",replaceUrl:"reemplazarUrl",copy:"copiar",pick:"escoger",beep:"pitido",js:"js",async:"as\u00edncrono",render:"renderizar",swap:"intercambiar",morph:"transformar",settle:"estabilizar",append:"anexar",exit:"salir",install:"instalar",breakpoint:"punto-interrupci\u00f3n",clear:"limpiar",close:"cerrar",open:"abrir",select:"seleccionar",clone:"clonar",prepend:"anteponer"},modifiers:{to:"a",from:"de",into:"en",with:"con",at:"en",in:"en",of:"de",as:"como",by:"por",before:"antes",after:"despu\u00e9s",over:"sobre",under:"bajo",between:"entre",through:"trav\u00e9s",without:"sin"},events:{click:"clic",dblclick:"dobleclic",mouseenter:"rat\u00f3nentrar",mouseleave:"rat\u00f3nsalir",mousedown:"rat\u00f3n abajo",mouseup:"rat\u00f3n arriba",mouseover:"rat\u00f3n encima",mouseout:"rat\u00f3n fuera",mousemove:"rat\u00f3nmover",keydown:"tecla abajo",keyup:"tecla arriba",keypress:"teclapresar",focus:"enfocar",blur:"desenfocar",change:"cambiar",input:"entrada",submit:"env\u00edo",reset:"reiniciar",load:"cargar",unload:"descargar",resize:"redimensionar",scroll:"desplazar",touchstart:"toqueempezar",touchend:"toqueterminar",touchmove:"toquemover",touchcancel:"toquecancelar"},logical:{when:"cuando",where:"donde",and:"y",or:"o",not:"no",is:"es",exists:"existe",matches:"coincide",contains:"contiene",includes:"incluye",equals:"iguala",has:"tiene",have:"tengo",then:"entonces",else:"sino",otherwise:"delocontrario",end:"fin",live:"vivo",changes:"cambia"},temporal:{seconds:"segundos",second:"segundo",milliseconds:"milisegundos",millisecond:"milisegundo",minutes:"minutos",minute:"minuto",hours:"horas",hour:"hora",ms:"ms",s:"s",min:"min",h:"h"},values:{true:"verdadero",false:"falso",null:"nulo",undefined:"indefinido",it:"ello",its:"su",me:"yo",my:"mi",you:"tu",your:"tu",yourself:"ti mismo",myself:"yo mismo",element:"elemento",target:"objetivo",detail:"detalle",event:"evento",window:"ventana",document:"documento",body:"cuerpo",result:"resultado",value:"valor"},attributes:{class:"clase",classes:"clases",style:"estilo",styles:"estilos",attribute:"atributo",attributes:"atributos",property:"propiedad",properties:"propiedades"},expressions:{characters:"caracteres",inclusive:"inclusivo",exclusive:"exclusivo",first:"primero",last:"\u00faltimo",next:"siguiente",previous:"anterior",prev:"ant",at:"en",random:"aleatorio",closest:"cercano",parent:"padre",children:"hijos",within:"dentro",no:"ning\u00fan",empty:"vac\u00edo",some:"alg\u00fan","starts with":"empieza con","ends with":"termina con","ignoring case":"ignorando may\u00fasculas","sorted by":"ordenado por","mapped to":"transformado a","split by":"dividido por","joined by":"unido por"}},yl=pl(fl,"es",{allowEnglishFallback:!0}),gl={commands:{on:"\u3067",tell:"\u4f1d\u3048\u308b",trigger:"\u5f15\u304d\u91d1",send:"\u9001\u308b",take:"\u53d6\u308b",put:"\u7f6e\u304f",set:"\u8a2d\u5b9a",get:"\u53d6\u5f97",add:"\u8ffd\u52a0",remove:"\u524a\u9664",toggle:"\u5207\u308a\u66ff\u3048",hide:"\u96a0\u3059",show:"\u8868\u793a",if:"\u3082\u3057",unless:"\u306a\u3044\u9650\u308a",repeat:"\u7e70\u308a\u8fd4\u3057",for:"\u305f\u3081\u306b",while:"\u306e\u9593",until:"\u307e\u3067",continue:"\u7d9a\u3051\u308b",break:"\u4e2d\u65ad",halt:"\u505c\u6b62",wait:"\u5f85\u3064",fetch:"\u30d5\u30a7\u30c3\u30c1",call:"\u547c\u3073\u51fa\u3057",return:"\u623b\u308b",make:"\u4f5c\u308b",log:"\u8a18\u9332",throw:"\u6295\u3052\u308b",catch:"\u6355\u307e\u3048\u308b",measure:"\u6e2c\u5b9a",transition:"\u9077\u79fb",increment:"\u5897\u52a0",decrement:"\u6e1b\u5c11",default:"\u65e2\u5b9a",go:"\u79fb\u52d5",pushUrl:"URL\u30d7\u30c3\u30b7\u30e5",replaceUrl:"URL\u7f6e\u63db",copy:"\u30b3\u30d4\u30fc",pick:"\u9078\u629e",beep:"\u30d3\u30fc\u30d7",js:"JS\u5b9f\u884c",async:"\u975e\u540c\u671f",render:"\u63cf\u753b",swap:"\u4ea4\u63db",morph:"\u5909\u5f62",settle:"\u5b89\u5b9a",append:"\u672b\u5c3e\u8ffd\u52a0",exit:"\u9000\u51fa",install:"\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb",breakpoint:"\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8",clear:"\u30af\u30ea\u30a2",close:"\u9589\u3058\u308b",open:"\u958b\u304f",select:"\u9078\u3076",clone:"\u8907\u88fd",prepend:"\u5148\u982d\u8ffd\u52a0",socket:"\u30bd\u30b1\u30c3\u30c8"},modifiers:{to:"\u306b",from:"\u304b\u3089",into:"\u3078",with:"\u3068",at:"\u3067",in:"\u306e\u4e2d",of:"\u306e",as:"\u3068\u3057\u3066",by:"\u306b\u3088\u3063\u3066",before:"\u524d\u306b",after:"\u5f8c\u306b",over:"\u4e0a\u306b",under:"\u4e0b\u306b",between:"\u9593\u306b",through:"\u901a\u3057\u3066",without:"\u306a\u3057\u3067"},events:{click:"\u30af\u30ea\u30c3\u30af",dblclick:"dblclick",mousedown:"\u30de\u30a6\u30b9\u62bc\u4e0b",mouseup:"\u30de\u30a6\u30b9\u89e3\u653e",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"\u30de\u30a6\u30b9\u30aa\u30fc\u30d0\u30fc",mouseout:"\u30de\u30a6\u30b9\u30a2\u30a6\u30c8",mousemove:"mousemove",keydown:"\u30ad\u30fc\u30c0\u30a6\u30f3",keyup:"\u30ad\u30fc\u30a2\u30c3\u30d7",keypress:"\u30ad\u30fc\u30d7\u30ec\u30b9",focus:"\u30d5\u30a9\u30fc\u30ab\u30b9",blur:"\u307c\u304b\u3057",change:"\u5909\u66f4",input:"\u5165\u529b",submit:"\u9001\u4fe1",reset:"\u30ea\u30bb\u30c3\u30c8",load:"\u8aad\u307f\u8fbc\u307f",unload:"unload",resize:"\u30b5\u30a4\u30ba\u5909\u66f4",scroll:"\u30b9\u30af\u30ed\u30fc\u30eb",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",touchcancel:"touchcancel"},logical:{when:"\u6642",where:"\u3069\u3053",and:"\u305d\u3057\u3066",or:"\u307e\u305f\u306f",not:"\u3067\u306f\u306a\u3044",is:"\u3067\u3042\u308b",exists:"\u5b58\u5728\u3059\u308b",matches:"\u4e00\u81f4\u3059\u308b",contains:"\u542b\u3080",includes:"\u542b\u3081\u308b",equals:"\u7b49\u3057\u3044",has:"\u3042\u308b",have:"\u3042\u308b",then:"\u305d\u308c\u304b\u3089",else:"\u305d\u3046\u3067\u306a\u3051\u308c\u3070",otherwise:"\u305d\u3046\u3067\u306a\u3051\u308c\u3070",end:"\u7d42\u308f\u308a",live:"\u30e9\u30a4\u30d6",bind:"\u30d0\u30a4\u30f3\u30c9",changes:"\u5909\u308f\u3063\u305f\u3089"},temporal:{seconds:"\u79d2",second:"\u79d2",milliseconds:"\u30df\u30ea\u79d2",millisecond:"\u30df\u30ea\u79d2",minutes:"\u5206",minute:"\u5206",hours:"\u6642\u9593",hour:"\u6642\u9593",ms:"ms",s:"\u79d2",min:"\u5206",h:"\u6642"},values:{true:"\u771f",false:"\u507d",null:"null",undefined:"\u672a\u5b9a\u7fa9",it:"\u305d\u308c",its:"\u305d\u306e",me:"\u79c1",my:"\u79c1\u306e",you:"\u3042\u306a\u305f",your:"\u3042\u306a\u305f\u306e",yourself:"\u3042\u306a\u305f\u81ea\u8eab",myself:"\u79c1\u81ea\u8eab",element:"\u8981\u7d20",target:"\u5bfe\u8c61",detail:"\u8a73\u7d30",event:"\u30a4\u30d9\u30f3\u30c8",window:"\u30a6\u30a3\u30f3\u30c9\u30a6",document:"\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8",body:"\u30dc\u30c7\u30a3",result:"\u7d50\u679c",value:"\u5024"},attributes:{class:"\u30af\u30e9\u30b9",classes:"\u30af\u30e9\u30b9\u7fa4",style:"\u30b9\u30bf\u30a4\u30eb",styles:"\u30b9\u30bf\u30a4\u30eb\u7fa4",attribute:"\u5c5e\u6027",attributes:"\u5c5e\u6027\u7fa4",property:"\u30d7\u30ed\u30d1\u30c6\u30a3",properties:"\u30d7\u30ed\u30d1\u30c6\u30a3\u7fa4"},expressions:{characters:"\u6587\u5b57",inclusive:"\u542b\u3080",exclusive:"\u9664\u304f",first:"\u6700\u521d",last:"\u6700\u5f8c",next:"\u6b21",previous:"\u524d",prev:"\u524d",at:"\u3067",random:"\u30e9\u30f3\u30c0\u30e0",closest:"\u6700\u3082\u8fd1\u3044",parent:"\u89aa",children:"\u5b50",within:"\u4ee5\u5185",no:"\u306a\u3044",empty:"\u7a7a",some:"\u3044\u304f\u3064\u304b","starts with":"\u3067\u59cb\u307e\u308b","ends with":"\u3067\u7d42\u308f\u308b","ignoring case":"\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u7121\u8996","sorted by":"\u3067\u30bd\u30fc\u30c8","mapped to":"\u306b\u5909\u63db","split by":"\u3067\u5206\u5272","joined by":"\u3067\u7d50\u5408"}},vl=pl(gl,"ja",{allowEnglishFallback:!0}),bl={commands:{on:"sur",tell:"dire",trigger:"d\u00e9clencher",send:"envoyer",take:"prendre",put:"mettre",set:"d\u00e9finir",get:"obtenir",add:"ajouter",remove:"supprimer",toggle:"basculer",blur:"d\u00e9focaliser",hide:"cacher",show:"montrer",if:"si",unless:"saufsi",repeat:"r\u00e9p\u00e9ter",for:"pour",while:"tantque",until:"jusqu\u00e0",continue:"continuer",break:"arr\u00eater",halt:"stopper",wait:"attendre",fetch:"r\u00e9cup\u00e9rer",call:"appeler",return:"retourner",make:"cr\u00e9er",log:"enregistrer",throw:"lancer",catch:"attraper",measure:"mesurer",transition:"transition",increment:"incr\u00e9menter",decrement:"d\u00e9cr\u00e9menter",default:"d\u00e9faut",go:"aller",pushUrl:"pousserUrl",replaceUrl:"remplacerUrl",copy:"copier",pick:"choisir",beep:"bip",js:"js",async:"asynchrone",render:"rendu",swap:"\u00e9changer",morph:"transformer",settle:"stabiliser",append:"annexer",exit:"sortir",install:"installer",breakpoint:"point-arr\u00eat",clear:"effacer",close:"fermer",open:"ouvrir",select:"s\u00e9lectionner",clone:"cloner",prepend:"pr\u00e9fixer",focus:"focaliser"},modifiers:{to:"\u00e0",from:"de",into:"dans",with:"avec",at:"\u00e0",in:"en",of:"de",as:"comme",by:"par",before:"avant",after:"apr\u00e8s",over:"sur",under:"sous",between:"entre",through:"\u00e0 travers",without:"sans"},events:{click:"clic",dblclick:"doubleclic",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"sourisentrer",mouseleave:"sourissortir",mouseover:"souris dessus",mouseout:"souris dehors",mousemove:"sourisbouger",keydown:"touche bas",keyup:"touche haut",keypress:"touchepress\u00e9e",focus:"focus",blur:"flou",change:"changer",input:"saisie",submit:"soumettre",reset:"r\u00e9initialiser",load:"charger",unload:"d\u00e9charger",resize:"redimensionner",scroll:"d\u00e9filer",touchstart:"touchercommencer",touchend:"toucherfin",touchmove:"toucherbouger",touchcancel:"toucherannuler"},logical:{when:"quand",where:"o\u00f9",and:"et",or:"ou",not:"non",is:"est",exists:"existe",matches:"correspond",contains:"contient",includes:"inclut",equals:"\u00e9gale",has:"a",have:"ai",then:"alors",else:"sinon",otherwise:"autrement",end:"fin",live:"vif",changes:"change"},temporal:{seconds:"secondes",second:"seconde",milliseconds:"millisecondes",millisecond:"milliseconde",minutes:"minutes",minute:"minute",hours:"heures",hour:"heure",ms:"ms",s:"s",min:"min",h:"h"},values:{true:"vrai",false:"faux",null:"nul",undefined:"ind\u00e9fini",it:"\u00e7a",its:"son",me:"moi",my:"mon",you:"tu",your:"ton",yourself:"toi-m\u00eame",myself:"moi-m\u00eame",element:"\u00e9l\u00e9ment",target:"cible",detail:"d\u00e9tail",event:"\u00e9v\u00e9nement",window:"fen\u00eatre",document:"document",body:"corps",result:"r\u00e9sultat",value:"valeur"},attributes:{class:"classe",classes:"classes",style:"style",styles:"styles",attribute:"attribut",attributes:"attributs",property:"propri\u00e9t\u00e9",properties:"propri\u00e9t\u00e9s"},expressions:{characters:"caract\u00e8res",inclusive:"inclusif",exclusive:"exclusif",first:"premier",last:"dernier",next:"suivant",previous:"pr\u00e9c\u00e9dent",prev:"pr\u00e9c",at:"\u00e0",random:"al\u00e9atoire",closest:"proche",parent:"parent",children:"enfants",within:"dans",no:"aucun",empty:"vide",some:"quelques","starts with":"commence par","ends with":"finit par","ignoring case":"en ignorant la casse","sorted by":"tri\u00e9 par","mapped to":"transform\u00e9 en","split by":"divis\u00e9 par","joined by":"joint par"}},wl=pl(bl,"fr",{allowEnglishFallback:!0}),kl={commands:{on:"bei",tell:"sagen",trigger:"ausl\u00f6sen",send:"senden",take:"nehmen",put:"setzen",set:"festlegen",get:"erhalten",add:"hinzuf\u00fcgen",remove:"entfernen",toggle:"umschalten",blur:"defokussieren",hide:"verstecken",show:"zeigen",if:"falls",unless:"wennnicht",repeat:"wiederholen",for:"f\u00fcr",while:"w\u00e4hrend",until:"bis",continue:"weiter",break:"unterbrechen",halt:"anhalten",wait:"warten",fetch:"abrufen",call:"aufrufen",return:"zur\u00fcckgeben",make:"erstellen",log:"protokollieren",throw:"werfen",catch:"fangen",measure:"messen",transition:"\u00fcbergang",increment:"erh\u00f6hen",decrement:"verringern",default:"standard",go:"gehen",pushUrl:"urlHinzuf\u00fcgen",replaceUrl:"urlErsetzen",copy:"kopieren",pick:"ausw\u00e4hlen",beep:"piepton",js:"js",async:"asynchron",render:"rendern",swap:"tauschen",morph:"verwandeln",settle:"stabilisieren",append:"anh\u00e4ngen",exit:"beenden",install:"installieren",breakpoint:"haltepunkt",clear:"bereinigen",close:"schlie\u00dfen",open:"\u00f6ffnen",select:"markieren",clone:"klonen",prepend:"voranstellen",focus:"fokussieren"},modifiers:{to:"zu",from:"von",into:"in",with:"mit",at:"bei",in:"in",of:"von",as:"als",by:"durch",before:"vor",after:"nach",over:"\u00fcber",under:"unter",between:"zwischen",through:"durch",without:"ohne"},events:{click:"klick",dblclick:"doppelklick",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"mauseintreten",mouseleave:"mausverlassen",mouseover:"maus dr\u00fcber",mouseout:"maus weg",mousemove:"mausbewegen",keydown:"taste unten",keyup:"taste oben",keypress:"tastedr\u00fccken",focus:"fokus",blur:"defokussieren",change:"\u00e4ndern",input:"eingabe",submit:"absenden",reset:"zur\u00fccksetzen",load:"laden",unload:"entladen",resize:"gr\u00f6\u00dfen\u00e4nderung",scroll:"scrollen",touchstart:"ber\u00fchrungstart",touchend:"ber\u00fchrungend",touchmove:"ber\u00fchrungbewegen",touchcancel:"ber\u00fchrungabbrechen"},logical:{when:"wenn",where:"wo",and:"und",or:"oder",not:"nicht",is:"ist",exists:"existiert",matches:"passt",contains:"enth\u00e4lt",includes:"beinhaltet",equals:"gleicht",has:"hat",have:"habe",then:"dann",else:"sonst",otherwise:"andernfalls",end:"ende",live:"live",changes:"\u00e4ndert"},temporal:{seconds:"sekunden",second:"sekunde",milliseconds:"millisekunden",millisecond:"millisekunde",minutes:"minuten",minute:"minute",hours:"stunden",hour:"stunde",ms:"ms",s:"s",min:"min",h:"std"},values:{true:"wahr",false:"falsch",null:"null",undefined:"undefiniert",it:"es",its:"sein",me:"ich",my:"mein",you:"du",your:"dein",yourself:"dich selbst",myself:"ich selbst",element:"element",target:"ziel",detail:"detail",event:"ereignis",window:"fenster",document:"dokument",body:"k\u00f6rper",result:"ergebnis",value:"wert"},attributes:{class:"klasse",classes:"klassen",style:"stil",styles:"stile",attribute:"attribut",attributes:"attribute",property:"eigenschaft",properties:"eigenschaften"},expressions:{characters:"Zeichen",inclusive:"inklusiv",exclusive:"exklusiv",first:"erste",last:"letzte",next:"n\u00e4chste",previous:"vorherige",prev:"vorh",at:"bei",random:"zuf\u00e4llig",closest:"n\u00e4chstgelegene",parent:"elternteil",children:"kinder",within:"innerhalb",no:"kein",empty:"leer",some:"einige","starts with":"beginnt mit","ends with":"endet mit","ignoring case":"ohne Gro\u00df-/Kleinschreibung","sorted by":"sortiert nach","mapped to":"zugeordnet zu","split by":"geteilt durch","joined by":"verbunden mit"}},El=pl(kl,"de",{allowEnglishFallback:!0}),xl={commands:{on:"\u0639\u0644\u0649",tell:"\u0623\u062e\u0628\u0631",trigger:"\u062a\u0634\u063a\u064a\u0644",send:"\u0623\u0631\u0633\u0644",take:"\u062e\u0630",put:"\u0636\u0639",set:"\u0627\u0636\u0628\u0637",get:"\u0627\u062d\u0635\u0644",add:"\u0623\u0636\u0641",remove:"\u0627\u062d\u0630\u0641",toggle:"\u0628\u062f\u0644",hide:"\u0627\u062e\u0641",show:"\u0627\u0638\u0647\u0631",if:"\u0625\u0630\u0627",unless:"\u0625\u0644\u0627",repeat:"\u0643\u0631\u0631",for:"\u0644\u0643\u0644",while:"\u0628\u064a\u0646\u0645\u0627",until:"\u062d\u062a\u0649",continue:"\u0648\u0627\u0635\u0644",break:"\u062a\u0648\u0642\u0641",halt:"\u0623\u0648\u0642\u0641",wait:"\u0627\u0646\u062a\u0638\u0631",fetch:"\u0627\u062d\u0636\u0631",call:"\u0627\u0633\u062a\u062f\u0639",return:"\u0627\u0631\u062c\u0639",make:"\u0627\u0635\u0646\u0639",log:"\u0633\u062c\u0644",throw:"\u0627\u0631\u0645",catch:"\u0627\u0644\u062a\u0642\u0637",measure:"\u0642\u0633",transition:"\u0627\u0646\u062a\u0642\u0627\u0644",increment:"\u0632\u0650\u062f",decrement:"\u0623\u0646\u0642\u0635",default:"\u0627\u0641\u062a\u0631\u0627\u0636\u064a",go:"\u0627\u0630\u0647\u0628",pushUrl:"\u0627\u062f\u0641\u0639 \u0631\u0627\u0628\u0637",replaceUrl:"\u0627\u0633\u062a\u0628\u062f\u0644 \u0631\u0627\u0628\u0637",copy:"\u0627\u0646\u0633\u062e",pick:"\u0627\u062e\u062a\u0631",beep:"\u0635\u0641\u0651\u0631",js:"\u062c\u0627\u0641\u0627\u0633\u0643\u0631\u0628\u062a",async:"\u0645\u062a\u0632\u0627\u0645\u0646",render:"\u0627\u0631\u0633\u0645",swap:"\u0627\u0633\u062a\u0628\u062f\u0644",morph:"\u062d\u0648\u0651\u0644",settle:"\u0627\u0633\u062a\u0642\u0631",append:"\u0623\u0644\u062d\u0642",exit:"\u0627\u062e\u0631\u062c",install:"\u062b\u0628\u0651\u062a",breakpoint:"\u0646\u0642\u0637\u0629-\u062a\u0648\u0642\u0641",clear:"\u0646\u0638\u0651\u0641",close:"\u0623\u063a\u0644\u0642",open:"\u0627\u0641\u062a\u062d",select:"\u0638\u0644\u0644",clone:"\u0627\u0633\u062a\u0646\u0633\u062e",prepend:"\u0633\u0628\u0642",socket:"\u0645\u0642\u0628\u0633"},modifiers:{to:"\u0625\u0644\u0649",from:"\u0645\u0646",into:"\u0641\u064a",with:"\u0645\u0639",at:"\u0639\u0646\u062f",in:"\u0641\u064a",of:"\u0645\u0646",as:"\u0643\u0640",by:"\u0628\u0648\u0627\u0633\u0637\u0629",before:"\u0642\u0628\u0644",after:"\u0628\u0639\u062f",over:"\u0641\u0648\u0642",under:"\u062a\u062d\u062a",between:"\u0628\u064a\u0646",through:"\u0639\u0628\u0631",without:"\u0628\u062f\u0648\u0646"},events:{click:"\u0646\u0642\u0631",dblclick:"dblclick",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"\u0641\u0623\u0631\u0629 \u0641\u0648\u0642",mouseout:"mouseout",mousemove:"mousemove",keydown:"\u0645\u0641\u062a\u0627\u062d \u0623\u0633\u0641\u0644",keyup:"\u0645\u0641\u062a\u0627\u062d \u0623\u0639\u0644\u0649",keypress:"keypress",focus:"\u062a\u0631\u0643\u064a\u0632",blur:"\u0636\u0628\u0627\u0628\u064a\u0629",change:"\u062a\u063a\u064a\u064a\u0631",input:"\u0625\u062f\u062e\u0627\u0644",submit:"\u0625\u0631\u0633\u0627\u0644",reset:"reset",load:"\u062a\u062d\u0645\u064a\u0644",unload:"unload",resize:"\u062a\u063a\u064a\u064a\u0631 \u062d\u062c\u0645",scroll:"\u062a\u0645\u0631\u064a\u0631",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",touchcancel:"touchcancel"},logical:{when:"\u0639\u0646\u062f\u0645\u0627",where:"\u0623\u064a\u0646",and:"\u0648",or:"\u0623\u0648",not:"\u0644\u064a\u0633",is:"\u0647\u0648",exists:"\u0645\u0648\u062c\u0648\u062f",matches:"\u064a\u0637\u0627\u0628\u0642",contains:"\u064a\u062d\u062a\u0648\u064a",includes:"\u064a\u0634\u0645\u0644",equals:"\u064a\u0633\u0627\u0648\u064a",has:"\u0644\u062f\u064a\u0647",have:"\u0644\u062f\u064a",then:"\u062b\u0645",else:"\u0648\u0625\u0644\u0627",otherwise:"\u062e\u0644\u0627\u0641 \u0630\u0644\u0643",end:"\u0627\u0644\u0646\u0647\u0627\u064a\u0629",live:"\u062d\u064a",bind:"\u0627\u0631\u0628\u0637",changes:"\u064a\u062a\u063a\u064a\u0631"},temporal:{seconds:"\u062b\u0648\u0627\u0646\u0650",second:"\u062b\u0627\u0646\u064a\u0629",milliseconds:"\u0645\u064a\u0644\u064a \u062b\u0627\u0646\u064a\u0629",millisecond:"\u0645\u064a\u0644\u064a \u062b\u0627\u0646\u064a\u0629",minutes:"\u062f\u0642\u0627\u0626\u0642",minute:"\u062f\u0642\u064a\u0642\u0629",hours:"\u0633\u0627\u0639\u0627\u062a",hour:"\u0633\u0627\u0639\u0629",ms:"\u0645.\u062b",s:"\u062b",min:"\u062f",h:"\u0633"},values:{true:"\u0635\u062d\u064a\u062d",false:"\u062e\u0637\u0623",null:"\u0641\u0627\u0631\u063a",undefined:"\u063a\u064a\u0631 \u0645\u0639\u0631\u0641",it:"\u0647\u0648",its:"\u0644\u0647",me:"\u0623\u0646\u0627",my:"\u0644\u064a",myself:"\u0646\u0641\u0633\u064a",you:"\u0623\u0646\u062a",your:"\u0644\u0643",yourself:"\u0646\u0641\u0633\u0643",element:"\u0639\u0646\u0635\u0631",target:"\u0647\u062f\u0641",detail:"\u062a\u0641\u0627\u0635\u064a\u0644",event:"\u062d\u062f\u062b",window:"\u0646\u0627\u0641\u0630\u0629",document:"\u0648\u062b\u064a\u0642\u0629",body:"\u062c\u0633\u0645",result:"\u0646\u062a\u064a\u062c\u0629",value:"\u0642\u064a\u0645\u0629"},attributes:{class:"\u0641\u0626\u0629",classes:"\u0641\u0626\u0627\u062a",style:"\u0623\u0633\u0644\u0648\u0628",styles:"\u0623\u0633\u0627\u0644\u064a\u0628",attribute:"\u062e\u0627\u0635\u064a\u0629",attributes:"\u062e\u0635\u0627\u0626\u0635",property:"\u062e\u0627\u0635\u064a\u0629",properties:"\u062e\u0635\u0627\u0626\u0635"},expressions:{characters:"\u062d\u0631\u0648\u0641",inclusive:"\u0634\u0627\u0645\u0644",exclusive:"\u062d\u0635\u0631\u064a",first:"\u0623\u0648\u0644",last:"\u0622\u062e\u0631",next:"\u0627\u0644\u062a\u0627\u0644\u064a",previous:"\u0627\u0644\u0633\u0627\u0628\u0642",prev:"\u0633\u0627\u0628\u0642",at:"\u0639\u0646\u062f",random:"\u0639\u0634\u0648\u0627\u0626\u064a",closest:"\u0627\u0644\u0623\u0642\u0631\u0628",parent:"\u0648\u0627\u0644\u062f",children:"\u0623\u0637\u0641\u0627\u0644",within:"\u062f\u0627\u062e\u0644",no:"\u0644\u0627 \u064a\u0648\u062c\u062f",empty:"\u0641\u0627\u0631\u063a",some:"\u0628\u0639\u0636","starts with":"\u064a\u0628\u062f\u0623 \u0628\u0640","ends with":"\u064a\u0646\u062a\u0647\u064a \u0628\u0640","ignoring case":"\u0645\u0639 \u062a\u062c\u0627\u0647\u0644 \u0627\u0644\u062d\u0627\u0644\u0629","sorted by":"\u0645\u0631\u062a\u0628 \u062d\u0633\u0628","mapped to":"\u0645\u062d\u0648\u0644 \u0625\u0644\u0649","split by":"\u0645\u0642\u0633\u0645 \u0628\u0648\u0627\u0633\u0637\u0629","joined by":"\u0645\u062f\u0645\u0648\u062c \u0628\u0648\u0627\u0633\u0637\u0629"}},Cl=pl(xl,"ar",{allowEnglishFallback:!0}),Al={commands:{on:"\uc5d0",tell:"\ub9d0\ud558\ub2e4",trigger:"\ud2b8\ub9ac\uac70",send:"\ubcf4\ub0b4\ub2e4",take:"\uac00\uc838\uc624\ub2e4",put:"\ub123\ub2e4",set:"\uc124\uc815",get:"\uc5bb\ub2e4",add:"\ucd94\uac00",remove:"\uc81c\uac70",toggle:"\ud1a0\uae00",hide:"\uc228\uae30\ub2e4",show:"\ubcf4\uc774\ub2e4",if:"\ub9cc\uc57d",unless:"\uc544\ub2c8\ub77c\uba74",repeat:"\ubc18\ubcf5",for:"\uac01\uac01",while:"\ub3d9\uc548",until:"\uae4c\uc9c0",continue:"\uacc4\uc18d",break:"\uc911\ub2e8",halt:"\uc815\uc9c0",wait:"\ub300\uae30",fetch:"\uac00\uc838\uc624\uae30",call:"\ud638\ucd9c",return:"\ubc18\ud658",make:"\ub9cc\ub4e4\ub2e4",log:"\ub85c\uadf8",throw:"\ub358\uc9c0\ub2e4",catch:"\uc7a1\ub2e4",measure:"\uce21\uc815",transition:"\uc804\ud658",increment:"\uc99d\uac00",decrement:"\uac10\uc18c",default:"\uae30\ubcf8\uac12",go:"\uc774\ub3d9",pushUrl:"URL\ud478\uc2dc",replaceUrl:"URL\uad50\uccb4",copy:"\ubcf5\uc0ac",pick:"\uc120\ud0dd",beep:"\ube44\ud504",js:"JS\uc2e4\ud589",async:"\ube44\ub3d9\uae30",render:"\ub80c\ub354\ub9c1",swap:"\uad50\ud658",morph:"\ubcc0\ud615",settle:"\uc548\uc815",append:"\ub367\ubd99\uc774\ub2e4",exit:"\ub098\uac00\uae30",install:"\uc124\uce58",breakpoint:"\uc911\ub2e8\uc810",clear:"\uc9c0\uc6b0\uae30",close:"\ub2eb\uae30",open:"\uc5f4\uae30",select:"\uace0\ub974\uae30",clone:"\ubcf5\uc81c",prepend:"\uc55e\uc5d0\ucd94\uac00",socket:"\uc18c\ucf13"},modifiers:{to:"\uc5d0",from:"\uc5d0\uc11c",into:"\uc73c\ub85c",with:"\uc640",at:"\uc5d0",in:"\uc548\uc5d0",of:"\uc758",as:"\ub85c",by:"\uc5d0\uc758\ud574",before:"\uc804\uc5d0",after:"\ud6c4\uc5d0",over:"\uc704\uc5d0",under:"\uc544\ub798",between:"\uc0ac\uc774",through:"\ud1b5\ud574",without:"\uc5c6\uc774"},events:{click:"\ud074\ub9ad",dblclick:"\ub354\ube14\ud074\ub9ad",mousedown:"\ub9c8\uc6b0\uc2a4\ub2e4\uc6b4",mouseup:"\ub9c8\uc6b0\uc2a4\uc5c5",mouseenter:"\ub9c8\uc6b0\uc2a4\uc5d4\ud130",mouseleave:"\ub9c8\uc6b0\uc2a4\ub9ac\ube0c",mouseover:"\ub9c8\uc6b0\uc2a4\uc624\ubc84",mouseout:"\ub9c8\uc6b0\uc2a4\uc544\uc6c3",mousemove:"\ub9c8\uc6b0\uc2a4\ubb34\ube0c",keydown:"\ud0a4\ub2e4\uc6b4",keyup:"\ud0a4\uc5c5",keypress:"\ud0a4\ud504\ub808\uc2a4",focus:"\ud3ec\ucee4\uc2a4",blur:"\ube14\ub7ec",change:"\ubcc0\uacbd",input:"\uc785\ub825",submit:"\uc81c\ucd9c",reset:"\uc7ac\uc124\uc815",load:"\ub85c\ub4dc",unload:"unload",resize:"\ub9ac\uc0ac\uc774\uc988",scroll:"\uc2a4\ud06c\ub864",touchstart:"touchstart",touchend:"\ud130\uce58\uc885\ub8cc",touchmove:"touchmove",touchcancel:"\ud130\uce58\ucde8\uc18c"},logical:{when:"\ub54c",where:"\uc5b4\ub514",and:"\uadf8\ub9ac\uace0",or:"\ub610\ub294",not:"\uc544\ub2c8",is:"\uc774\ub2e4",exists:"\uc874\uc7ac",matches:"\uc77c\uce58",contains:"\ud3ec\ud568",includes:"\ud3ec\ud568\ud558\ub2e4",equals:"\uac19\ub2e4",has:"\uc788\ub2e4",have:"\uc788\ub2e4",then:"\uadf8\ub7ec\uba74",else:"\uc544\ub2c8\uba74",otherwise:"\uadf8\ub807\uc9c0\uc54a\uc73c\uba74",end:"\ub05d",live:"\ub77c\uc774\ube0c",bind:"\ubc14\uc778\ub4dc",changes:"\ubcc0\uacbd\ub418\uba74"},temporal:{seconds:"\ucd08",second:"\ucd08",milliseconds:"\ubc00\ub9ac\ucd08",millisecond:"\ubc00\ub9ac\ucd08",minutes:"\ubd84",minute:"\ubd84",hours:"\uc2dc\uac04",hour:"\uc2dc\uac04",ms:"ms",s:"\ucd08",min:"\ubd84",h:"\uc2dc"},values:{true:"\ucc38",false:"\uac70\uc9d3",null:"\ub110",undefined:"\uc815\uc758\uc548\ub428",it:"\uadf8\uac83",its:"\uadf8\uac83\uc758",me:"\ub098",my:"\ub0b4",myself:"\ub098\uc790\uc2e0",you:"\ub108",your:"\ub124",yourself:"\ub108\uc790\uc2e0",element:"\uc694\uc18c",target:"\ub300\uc0c1",detail:"\uc138\ubd80",event:"\uc774\ubca4\ud2b8",window:"\ucc3d",document:"\ubb38\uc11c",body:"\ubc14\ub514",result:"\uacb0\uacfc",value:"\uac12"},attributes:{class:"\ud074\ub798\uc2a4",classes:"\ud074\ub798\uc2a4\ub4e4",style:"\uc2a4\ud0c0\uc77c",styles:"\uc2a4\ud0c0\uc77c\ub4e4",attribute:"\uc18d\uc131",attributes:"\uc18d\uc131\ub4e4",property:"\ud504\ub85c\ud37c\ud2f0",properties:"\ud504\ub85c\ud37c\ud2f0\ub4e4"},expressions:{characters:"\ubb38\uc790",inclusive:"\ud3ec\ud568",exclusive:"\uc81c\uc678",first:"\uccab\ubc88\uc9f8",last:"\ub9c8\uc9c0\ub9c9",next:"\ub2e4\uc74c",previous:"\uc774\uc804",prev:"\uc774\uc804",at:"\uc5d0\uc11c",random:"\ubb34\uc791\uc704",closest:"\uac00\uc7a5\uac00\uae4c\uc6b4",parent:"\ubd80\ubaa8",children:"\uc790\uc2dd",within:"\uc774\ub0b4",no:"\uc5c6\uc74c",empty:"\ube44\uc5b4\uc788\ub294",some:"\uc77c\ubd80","starts with":"\ub85c\uc2dc\uc791","ends with":"\ub85c\ub05d\ub098\ub294","ignoring case":"\ub300\uc18c\ubb38\uc790_\ubb34\uc2dc","sorted by":"\ub85c_\uc815\ub82c","mapped to":"\ub85c_\ubcc0\ud658","split by":"\ub85c_\ubd84\ud560","joined by":"\ub85c_\uacb0\ud569"}},Sl=pl(Al,"ko",{allowEnglishFallback:!0}),Tl={commands:{on:"\u5f53",tell:"\u544a\u8bc9",trigger:"\u89e6\u53d1",send:"\u53d1\u9001",take:"\u62ff\u53d6",put:"\u653e\u7f6e",set:"\u8bbe\u7f6e",get:"\u83b7\u5f97",add:"\u6dfb\u52a0",remove:"\u79fb\u9664",toggle:"\u5207\u6362",hide:"\u9690\u85cf",show:"\u663e\u793a",if:"\u5982\u679c",unless:"\u9664\u975e",repeat:"\u91cd\u590d",for:"\u4e3a",while:"\u5f53",until:"\u76f4\u5230",continue:"\u7ee7\u7eed",break:"\u4e2d\u65ad",halt:"\u505c\u6b62",wait:"\u7b49\u5f85",fetch:"\u6293\u53d6",call:"\u8c03\u7528",return:"\u8fd4\u56de",make:"\u5236\u4f5c",log:"\u65e5\u5fd7",throw:"\u629b\u51fa",catch:"\u6355\u83b7",measure:"\u6d4b\u91cf",transition:"\u8fc7\u6e21",increment:"\u589e\u52a0",decrement:"\u51cf\u5c11",default:"\u9ed8\u8ba4",go:"\u524d\u5f80",pushUrl:"\u63a8\u9001\u7f51\u5740",replaceUrl:"\u66ff\u6362\u7f51\u5740",copy:"\u590d\u5236",pick:"\u9009\u53d6",beep:"\u8702\u9e23",js:"JS\u6267\u884c",async:"\u5f02\u6b65",render:"\u6e32\u67d3",swap:"\u4ea4\u6362",morph:"\u53d8\u5f62",settle:"\u7a33\u5b9a",append:"\u8ffd\u52a0",exit:"\u9000\u51fa",install:"\u5b89\u88c5",breakpoint:"\u65ad\u70b9",clear:"\u6e05\u9664",close:"\u5173\u95ed",open:"\u6253\u5f00",select:"\u9009\u62e9",clone:"\u514b\u9686",prepend:"\u524d\u7f6e"},modifiers:{to:"\u5230",from:"\u4ece",into:"\u8fdb\u5165",with:"\u4e0e",at:"\u5728",in:"\u5728",of:"\u7684",as:"\u4f5c\u4e3a",by:"\u901a\u8fc7",before:"\u4e4b\u524d",after:"\u4e4b\u540e",over:"\u5728\u4e0a",under:"\u5728\u4e0b",between:"\u4e4b\u95f4",through:"\u901a\u8fc7",without:"\u6ca1\u6709"},events:{click:"\u70b9\u51fb",dblclick:"\u53cc\u51fb",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"\u9f20\u6807\u79fb\u5165",mouseout:"\u9f20\u6807\u79fb\u51fa",mousemove:"\u9f20\u6807\u79fb\u52a8",keydown:"\u6309\u952e\u6309\u4e0b",keyup:"\u677e\u952e",keypress:"keypress",focus:"\u805a\u7126",blur:"\u5931\u7126",change:"\u6539\u53d8",input:"\u8f93\u5165",submit:"\u63d0\u4ea4",reset:"\u91cd\u7f6e",load:"\u52a0\u8f7d",unload:"\u5378\u8f7d",resize:"\u8c03\u6574\u5927\u5c0f",scroll:"\u6eda\u52a8",touchstart:"\u89e6\u6478\u5f00\u59cb",touchend:"touchend",touchmove:"\u89e6\u6478\u79fb\u52a8",touchcancel:"touchcancel"},logical:{when:"\u5f53",where:"\u54ea\u91cc",and:"\u548c",or:"\u6216",not:"\u975e",is:"\u662f",exists:"\u5b58\u5728",matches:"\u5339\u914d",contains:"\u5305\u542b",includes:"\u5305\u62ec",equals:"\u7b49\u4e8e",has:"\u6709",have:"\u6709",then:"\u90a3\u4e48",else:"\u5426\u5219",otherwise:"\u8981\u4e0d\u7136",end:"\u7ed3\u675f",live:"\u5b9e\u65f6",bind:"\u7ed1\u5b9a",changes:"\u6539\u53d8\u65f6"},temporal:{seconds:"\u79d2",second:"\u79d2",milliseconds:"\u6beb\u79d2",millisecond:"\u6beb\u79d2",minutes:"\u5206\u949f",minute:"\u5206\u949f",hours:"\u5c0f\u65f6",hour:"\u5c0f\u65f6",ms:"\u6beb\u79d2",s:"\u79d2",min:"\u5206",h:"\u65f6"},values:{true:"\u771f",false:"\u5047",null:"\u7a7a",undefined:"\u672a\u5b9a\u4e49",it:"\u5b83",its:"\u5b83\u7684",me:"\u6211",my:"\u6211\u7684",myself:"\u6211\u81ea\u5df1",you:"\u4f60",your:"\u4f60\u7684",yourself:"\u4f60\u81ea\u5df1",element:"\u5143\u7d20",target:"\u76ee\u6807",detail:"\u8be6\u60c5",event:"\u4e8b\u4ef6",window:"\u7a97\u53e3",document:"\u6587\u6863",body:"\u4e3b\u4f53",result:"\u7ed3\u679c",value:"\u503c"},attributes:{class:"\u7c7b",classes:"\u7c7b\u522b",style:"\u6837\u5f0f",styles:"\u6837\u5f0f\u96c6",attribute:"\u5c5e\u6027",attributes:"\u5c5e\u6027\u96c6",property:"\u7279\u6027",properties:"\u7279\u6027\u96c6"},expressions:{characters:"\u5b57\u7b26",inclusive:"\u5305\u542b",exclusive:"\u6392\u9664",first:"\u7b2c\u4e00\u4e2a",last:"\u6700\u540e\u4e00\u4e2a",next:"\u4e0b\u4e00\u4e2a",previous:"\u4e0a\u4e00\u4e2a",prev:"\u4e0a\u4e2a",at:"\u5728",random:"\u968f\u673a",closest:"\u6700\u8fd1\u7684",parent:"\u7236\u7ea7",children:"\u5b50\u7ea7",within:"\u4e4b\u5185",no:"\u6ca1\u6709",empty:"\u7a7a\u7684",some:"\u4e00\u4e9b","starts with":"\u4ee5\u5f00\u5934","ends with":"\u4ee5\u7ed3\u5c3e","ignoring case":"\u5ffd\u7565\u5927\u5c0f\u5199","sorted by":"\u6309_\u6392\u5e8f","mapped to":"\u6620\u5c04\u4e3a","split by":"\u6309_\u5206\u5272","joined by":"\u7528_\u8fde\u63a5"}},Ll=pl(Tl,"zh",{allowEnglishFallback:!0}),Ol={commands:{on:"\u00fczerinde",tell:"s\u00f6yle",trigger:"tetikle",send:"g\u00f6nder",take:"tut",put:"koy",set:"ayarla",get:"al",add:"ekle",remove:"kald\u0131r",toggle:"de\u011fi\u015ftir",hide:"gizle",show:"g\u00f6ster",if:"e\u011fer",unless:"de\u011filse",repeat:"tekrarla",for:"i\u00e7in",while:"s\u00fcresince",until:"kadar",continue:"devam",break:"dur",halt:"durdur",wait:"bekle",fetch:"getir",call:"\u00e7a\u011f\u0131r",return:"d\u00f6n",make:"yap",log:"kaydet",throw:"f\u0131rlat",catch:"yakala",measure:"\u00f6l\u00e7",transition:"ge\u00e7i\u015f",increment:"art\u0131r",decrement:"azalt",default:"varsay\u0131lan",go:"git",pushUrl:"urlEkle",replaceUrl:"urlDe\u011fi\u015ftir",copy:"kopyala",pick:"se\u00e7",beep:"bip",js:"js",async:"asenkron",render:"render",swap:"takas",morph:"d\u00f6n\u00fc\u015ft\u00fcr",settle:"sabitlen",append:"ili\u015ftir",exit:"\u00e7\u0131k",install:"kur",breakpoint:"kesme-noktas\u0131",clear:"temizle",close:"kapat",open:"a\u00e7",select:"vurgula",clone:"klonla",prepend:"ba\u015f\u0131naekle",socket:"soket"},modifiers:{to:"e",from:"den",into:"i\u00e7ine",with:"ile",at:"de",in:"i\u00e7inde",of:"nin",as:"olarak",by:"taraf\u0131ndan",before:"\u00f6nce",after:"sonra",over:"\u00fczerinde",under:"alt\u0131nda",between:"aras\u0131nda",through:"boyunca",without:"olmadan"},events:{click:"t\u0131klama",dblclick:"dblclick",mousedown:"farebas",mouseup:"fareb\u0131rak",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"farei\u00e7inde",mouseout:"fared\u0131\u015f\u0131nda",mousemove:"mousemove",keydown:"tu\u015fbasma",keyup:"tu\u015fb\u0131rakma",keypress:"keypress",focus:"odak",blur:"bulan\u0131k",change:"de\u011fi\u015fim",input:"giri\u015f",submit:"g\u00f6nderme",reset:"s\u0131f\u0131rla",load:"y\u00fckle",unload:"unload",resize:"boyutland\u0131rma",scroll:"kayd\u0131r",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",touchcancel:"touchcancel"},logical:{when:"iken",where:"nerede",and:"ve",or:"veya",not:"de\u011fil",is:"dir",exists:"var",matches:"e\u015fle\u015fir",contains:"i\u00e7erir",includes:"dahil",equals:"e\u015fittir",has:"var",have:"var",then:"ard\u0131ndan",else:"yoksa",otherwise:"aksi_halde",end:"son",live:"canl\u0131",changes:"de\u011fi\u015fti\u011finde"},temporal:{seconds:"saniye",second:"saniye",milliseconds:"milisaniye",millisecond:"milisaniye",minutes:"dakika",minute:"dakika",hours:"saat",hour:"saat",ms:"ms",s:"s",min:"dk",h:"sa"},values:{true:"do\u011fru",false:"yanl\u0131\u015f",null:"bo\u015f",undefined:"tan\u0131ms\u0131z",it:"o",its:"onun",me:"ben",my:"benim",myself:"kendim",you:"sen",your:"senin",yourself:"kendin",element:"\u00f6\u011fe",target:"hedef",detail:"detay",event:"olay",window:"pencere",document:"belge",body:"g\u00f6vde",result:"sonu\u00e7",value:"de\u011fer"},attributes:{class:"s\u0131n\u0131f",classes:"s\u0131n\u0131flar",style:"stil",styles:"stiller",attribute:"\u00f6zellik",attributes:"\u00f6zellikler",property:"\u00f6zellik",properties:"\u00f6zellikler"},expressions:{characters:"karakterler",inclusive:"dahil",exclusive:"hari\u00e7",first:"ilk",last:"sonuncu",next:"sonraki",previous:"\u00f6nceki",prev:"\u00f6nc",at:"de",random:"rastgele",closest:"enyak\u0131n",parent:"ebeveyn",children:"\u00e7ocuklar",within:"i\u00e7inde",no:"yok",empty:"bo\u015f",some:"baz\u0131","starts with":"ile ba\u015flar","ends with":"ile biter","ignoring case":"b\u00fcy\u00fck k\u00fc\u00e7\u00fck harf duyars\u0131z","sorted by":"g\u00f6re s\u0131ral\u0131","mapped to":"ye d\u00f6n\u00fc\u015ft\u00fcr\u00fclm\u00fc\u015f","split by":"ile b\u00f6l\u00fcnm\u00fc\u015f","joined by":"ile birle\u015ftirilmi\u015f"}},jl=pl(Ol,"tr",{allowEnglishFallback:!0}),Pl={commands:{on:"pada",tell:"katakan",trigger:"picu",send:"kirim",take:"ambil",put:"taruh",set:"atur",get:"dapatkan",add:"tambah",remove:"hapus",toggle:"alihkan",hide:"sembunyikan",show:"tampilkan",if:"jika",unless:"kecuali",repeat:"ulangi",for:"untuk",while:"selama",until:"sampai",continue:"lanjutkan",break:"hentikan",halt:"berhenti",wait:"tunggu",fetch:"muat",call:"panggil",return:"kembali",make:"buat",log:"catat",throw:"lempar",catch:"tangkap",measure:"ukur",transition:"transisi",increment:"naikkan",decrement:"kurangi",default:"bawaan",go:"pergi",pushUrl:"tambahUrl",replaceUrl:"gantiUrl",copy:"salin",pick:"pilih",beep:"bunyi",js:"js",async:"asinkron",render:"olah",swap:"tukar",morph:"ubah",settle:"stabilkan",append:"sisipkan",exit:"keluar",install:"pasang",breakpoint:"titik-henti",clear:"bersihkan",close:"tutupkan",open:"buka",select:"tandai",clone:"klon",prepend:"awali"},modifiers:{to:"ke",from:"dari",into:"ke_dalam",with:"dengan",at:"di",in:"dalam",of:"dari",as:"sebagai",by:"oleh",before:"sebelum",after:"setelah",over:"di_atas",under:"di_bawah",between:"antara",through:"melalui",without:"tanpa"},events:{click:"klik",dblclick:"dblclick",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"arahkan",mouseout:"tinggalkan",mousemove:"mousemove",keydown:"tekan_tombol",keyup:"keyup",keypress:"keypress",focus:"fokus",blur:"blur",change:"ubah",input:"masukan",submit:"kirim",reset:"reset",load:"muat",unload:"bongkar",resize:"ubah_ukuran",scroll:"gulir",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",touchcancel:"touchcancel"},logical:{when:"ketika",where:"di_mana",and:"dan",or:"atau",not:"bukan",is:"adalah",exists:"ada",matches:"cocok",contains:"berisi",includes:"termasuk",equals:"sama",has:"punya",have:"punya",then:"lalu",else:"lainnya",otherwise:"sebaliknya",end:"akhir",live:"langsung",changes:"berubah"},temporal:{seconds:"detik",second:"detik",milliseconds:"milidetik",millisecond:"milidetik",minutes:"menit",minute:"menit",hours:"jam",hour:"jam",ms:"ms",s:"d",min:"mnt",h:"j"},values:{true:"benar",false:"salah",null:"kosong",undefined:"tidak_terdefinisi",it:"itu",its:"miliknya",me:"saya",my:"saya punya",myself:"saya sendiri",you:"kamu",your:"kamu punya",yourself:"kamu sendiri",element:"elemen",target:"target",detail:"detail",event:"peristiwa",window:"jendela",document:"dokumen",body:"badan",result:"hasil",value:"nilai"},attributes:{class:"kelas",classes:"kelas_kelas",style:"gaya",styles:"gaya_gaya",attribute:"atribut",attributes:"atribut_atribut",property:"properti",properties:"properti_properti"},expressions:{characters:"karakter",inclusive:"inklusif",exclusive:"eksklusif",first:"pertama",last:"terakhir",next:"berikutnya",previous:"sebelumnya",prev:"sblm",at:"di",random:"acak",closest:"terdekat",parent:"induk",children:"anak_anak",within:"dalam",no:"tidak_ada",empty:"kosong",some:"beberapa","starts with":"dimulai dengan","ends with":"diakhiri dengan","ignoring case":"abaikan kapital","sorted by":"diurutkan berdasarkan","mapped to":"dipetakan ke","split by":"dipisah oleh","joined by":"digabung oleh"}},Il=pl(Pl,"id",{allowEnglishFallback:!0}),ql={commands:{on:"kaqpi",tell:"niy",trigger:"kichay",send:"kachay",take:"hapiy",put:"churay",set:"churanay",get:"taripay",add:"yapay",remove:"qichuy",toggle:"tikray",hide:"pakay",show:"rikuchiy",if:"sichus",unless:"mana sichus",repeat:"kutipay",for:"sapankaq",while:"kaykamaqa",until:"hayk_akama",continue:"purichiy",break:"p_akiy",halt:"sayay",wait:"suyay",fetch:"apamuy",call:"qayay",return:"kutimuy",make:"ruray",log:"qillqakuy",throw:"wikchuy",catch:"hapsiy",measure:"tupuy",transition:"pasay",increment:"yapachiy",decrement:"pisiyachiy",default:"\u00f1awpaq_kaq",go:"riy",pushUrl:"url_tanqay",replaceUrl:"url_tikray",copy:"qillqay",pick:"akllay",beep:"waqay",js:"js",async:"mana_suyaspa",render:"rikurichiy",swap:"t'inkuy",morph:"tukunay",settle:"tiyakuy",append:"qatichiy",exit:"lluqsiy",install:"tarpuy",breakpoint:"sayachinay",clear:"pichay",close:"wichqay",open:"paskay",select:"marcay",clone:"kikinchay",prepend:"\u00f1awpachiy",socket:"tinkina"},modifiers:{to:"man",from:"manta",into:"ukupi",with:"wan",at:"pi",in:"ukupi",of:"pa",as:"hina",by:"rayku",before:"\u00f1awpaqpi",after:"qhepapi",over:"hawapi",under:"urapi",between:"chawpipi",through:"pasaspa",without:"mana"},events:{click:"\u00f1itiy",dblclick:"dblclick",mousedown:"rat\u00f1itiy",mouseup:"rathuqariy",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"mouseover",mouseout:"mouseout",mousemove:"mousemove",keydown:"llave uray",keyup:"llave hawa",keypress:"keypress",focus:"qhaway",blur:"paqariy",change:"kambiay",input:"yaykuchiy",submit:"apaykachay",reset:"musuqchay",load:"apakuy",unload:"unload",resize:"hatun_kay",scroll:"kunray",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",touchcancel:"touchcancel"},logical:{when:"maykama",where:"maypi",and:"chaymanta",or:"utaq",not:"mana",is:"kanqa",exists:"tiyan",matches:"tupan",contains:"ukupi_kan",includes:"churasqa",equals:"kikin",has:"kachkan",have:"kachkani",then:"chayqa",else:"manachus",otherwise:"huk_kaqpi",end:"tukuy",live:"kawsay",changes:"tukurikun"},temporal:{seconds:"sikundukuna",second:"sikundu",milliseconds:"iskay_paqta_sikundukuna",millisecond:"iskay_paqta_sikundu",minutes:"minutukuna",minute:"minutu",hours:"horakuna",hour:"hora",ms:"ms",s:"s",min:"m",h:"h"},values:{true:"cheqaq",false:"llulla",null:"chusaq",undefined:"mana_riqsisqa",it:"chay",its:"chaypaq",me:"noqa",my:"noqaq",myself:"noqa killa",you:"qam",your:"qampaq",yourself:"qam killa",element:"raku",target:"punta",detail:"sut_iy",event:"ruway",window:"k_iri",document:"qillqa",body:"kurku",result:"lluqsiy",value:"chanin"},attributes:{class:"ayllu",classes:"ayllukuna",style:"sami",styles:"samikuna",attribute:"kaq",attributes:"kaqkuna",property:"kanay",properties:"kanaykuna"},expressions:{characters:"sanampa",first:"\u00f1awpaq",last:"qhipa",next:"qhipantin",previous:"\u00f1awpaqnin",prev:"\u00f1awpaq",at:"pi",random:"imaymanata",closest:"kaylla",parent:"mama_tayta",children:"wawakuna",within:"ukupi",no:"mana_kanchu",empty:"chusaq",some:"wakin","starts with":"qallarisqa wan","ends with":"tukusqa wan","ignoring case":"hatun-huchuy qillqata-saqiy","sorted by":"niqpi ruwasqa","mapped to":"kay kaqman","split by":"rakisqa","joined by":"hu\u00f1usqa"}},Nl=pl(ql,"qu",{allowEnglishFallback:!0}),Rl={commands:{on:"kwenye",tell:"ambia",trigger:"chochea",send:"tuma",take:"chukua",put:"weka",set:"seti",get:"pata",add:"ongeza",remove:"ondoa",toggle:"badilisha",blur:"blur",hide:"ficha",show:"onyesha",if:"kama",unless:"isipokuwa",repeat:"rudia",for:"kwa",while:"wakati",until:"hadi",continue:"endelea",break:"vunja",halt:"simama",wait:"ngoja",fetch:"leta",call:"ita",return:"rudisha",make:"tengeneza",log:"andika",throw:"tupa",catch:"shika",measure:"pima",transition:"mpito",increment:"ongezeko",decrement:"punguza",default:"msingi",go:"nenda",pushUrl:"sukumaUrl",replaceUrl:"badilishaUrl",copy:"nakala",pick:"chagua",beep:"lia",js:"js",async:"sainkroni",render:"chora",swap:"badilishana",morph:"geuza",settle:"tulia",append:"ambatanisha",exit:"toka",install:"sakinisha",breakpoint:"nukta-simama",clear:"safisha",close:"funga",open:"fungua",select:"alama",clone:"nakili",prepend:"tanguliza",focus:"lenga",socket:"soketi"},modifiers:{to:"kwa",from:"kutoka",into:"ndani",with:"na",at:"katika",in:"ndani",of:"ya",as:"kuwa",by:"na",before:"kabla",after:"baada",over:"juu",under:"chini",between:"kati",through:"kupitia",without:"bila"},events:{click:"bonyeza",dblclick:"dblclick",mousedown:"panya_shuka",mouseup:"panya_juu",mouseenter:"panya_ingia",mouseleave:"panya_toka",mouseover:"sogeza juu",mouseout:"panya_nje",mousemove:"panya_sogea",keydown:"kitufe_shuka",keyup:"kitufe_juu",keypress:"keypress",focus:"lenga",blur:"blur",change:"kubadilisha",input:"ingizo",submit:"wasilisha",reset:"reset",load:"pakia",unload:"shuka",resize:"badilisha_ukubwa",scroll:"sogeza",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",touchcancel:"touchcancel"},logical:{when:"wakati",where:"wapi",and:"na",or:"au",not:"si",is:"ni",exists:"ipo",matches:"inafanana",contains:"ina",includes:"pamoja",equals:"sawa",has:"ana",have:"nina",then:"kisha",else:"sivyo",otherwise:"vinginevyo",end:"mwisho",live:"mubashara",changes:"inabadilika"},temporal:{seconds:"sekunde",second:"sekunde",milliseconds:"millisekunde",millisecond:"millisekunde",minutes:"dakika",minute:"dakika",hours:"masaa",hour:"saa",ms:"ms",s:"s",min:"dk",h:"sa"},values:{true:"kweli",false:"uongo",null:"tupu",undefined:"haijafafanuliwa",it:"hiyo",its:"yake",me:"mimi",my:"yangu",myself:"mimi mwenyewe",you:"wewe",your:"yako",yourself:"wewe mwenyewe",element:"kipengele",target:"lengo",detail:"maelezo",event:"tukio",window:"dirisha",document:"hati",body:"mwili",result:"matokeo",value:"thamani"},attributes:{class:"darasa",classes:"madarasa",style:"mtindo",styles:"mitindo",attribute:"sifa",attributes:"sifa",property:"mali",properties:"mali"},expressions:{characters:"herufi",first:"kwanza",last:"wamwisho",next:"ijayo",previous:"iliyopita",prev:"awali",at:"katika",random:"nasibu",closest:"karibu",parent:"mzazi",children:"watoto",within:"ndani_ya",no:"hakuna",empty:"tupu",some:"baadhi","starts with":"huanza na","ends with":"huisha na","ignoring case":"puuza herufi kubwa ndogo","sorted by":"kupangwa kwa","mapped to":"kubadilishwa kuwa","split by":"kugawanywa kwa","joined by":"kuunganishwa kwa"}},Ml=pl(Rl,"sw",{allowEnglishFallback:!0}),$l={commands:{on:"em",tell:"dizer",trigger:"disparar",send:"enviar",take:"pegar",put:"colocar",set:"definir",get:"obter",add:"adicionar",remove:"remover",toggle:"alternar",blur:"desfocar",hide:"esconder",show:"mostrar",if:"se",unless:"salvo",repeat:"repetir",for:"para",while:"enquanto",until:"at\u00e9",continue:"continuar",break:"interromper",halt:"parar",wait:"esperar",fetch:"buscar",call:"chamar",return:"retornar",make:"fazer",log:"registrar",throw:"lan\u00e7ar",catch:"capturar",measure:"medir",transition:"transi\u00e7\u00e3o",increment:"incrementar",decrement:"decrementar",default:"padr\u00e3o",go:"ir",pushUrl:"pushUrl",replaceUrl:"substituirUrl",copy:"copiar",pick:"escolher",beep:"apitar",js:"js",async:"ass\u00edncrono",render:"renderizar",swap:"trocar",morph:"transformar",settle:"estabilizar",append:"anexar",exit:"sair",install:"instalar",breakpoint:"ponto-interrup\u00e7\u00e3o",clear:"limpar",close:"fechar",open:"abrir",select:"selecionar",clone:"clonar",prepend:"preceder",focus:"focar",socket:"soquete"},modifiers:{to:"para",from:"de",into:"em",with:"com",at:"em",in:"dentro",of:"de",as:"como",by:"por",before:"antes",after:"depois",over:"sobre",under:"sob",between:"entre",through:"atrav\u00e9s",without:"sem"},events:{click:"clique",dblclick:"duploClique",mouseenter:"mouseEntrar",mouseleave:"mouseSair",mousedown:"mouse pressionado",mouseup:"mouse solto",mouseover:"mouse sobre",mouseout:"mouse fora",mousemove:"mouseMover",keydown:"tecla baixo",keyup:"tecla cima",keypress:"teclaPressionar",focus:"foco",blur:"desfoque",change:"mudan\u00e7a",input:"entrada",submit:"envio",reset:"redefinir",load:"carregar",unload:"descarregar",resize:"redimensionar",scroll:"rolar",touchstart:"toqueIn\u00edcio",touchend:"toqueFim",touchmove:"toqueMover",touchcancel:"toqueCancelar"},logical:{when:"quando",where:"onde",and:"e",or:"ou",not:"n\u00e3o",is:"\u00e9",exists:"existe",matches:"corresponde",contains:"cont\u00e9m",includes:"inclui",equals:"igual",has:"tem",have:"tenho",then:"ent\u00e3o",else:"sen\u00e3o",otherwise:"caso_contr\u00e1rio",end:"fim",live:"vivo",changes:"muda"},temporal:{seconds:"segundos",second:"segundo",milliseconds:"milissegundos",millisecond:"milissegundo",minutes:"minutos",minute:"minuto",hours:"horas",hour:"hora",ms:"ms",s:"s",min:"min",h:"h"},values:{true:"verdadeiro",false:"falso",null:"nulo",undefined:"indefinido",it:"isso",its:"seu",me:"eu",my:"meu",myself:"eu mesmo",you:"voc\u00ea",your:"seu",yourself:"voc\u00ea mesmo",element:"elemento",target:"alvo",detail:"detalhe",event:"evento",window:"janela",document:"documento",body:"corpo",result:"resultado",value:"valor"},attributes:{class:"classe",classes:"classes",style:"estilo",styles:"estilos",attribute:"atributo",attributes:"atributos",property:"propriedade",properties:"propriedades"},expressions:{characters:"caracteres",inclusive:"inclusivo",exclusive:"exclusivo",first:"primeiro",last:"\u00faltimo",next:"pr\u00f3ximo",previous:"anterior",prev:"ant",at:"em",random:"aleat\u00f3rio",closest:"maispr\u00f3ximo",parent:"pai",children:"filhos",within:"dentro",no:"nenhum",empty:"vazio",some:"algum","starts with":"come\u00e7a com","ends with":"termina com","ignoring case":"ignorando mai\u00fasculas","sorted by":"ordenado por","mapped to":"mapeado para","split by":"dividido por","joined by":"unido por"}},_l=pl($l,"pt",{allowEnglishFallback:!0}),zl={commands:{on:"su",tell:"dire",trigger:"scatenare",send:"inviare",take:"prendere",put:"mettere",set:"impostare",get:"ottenere",add:"aggiungere",remove:"rimuovere",toggle:"commutare",hide:"nascondere",show:"mostrare",if:"se",unless:"salvo",repeat:"ripetere",for:"per",while:"mentre",until:"fino",continue:"continuare",break:"interrompere",halt:"fermare",wait:"aspettare",fetch:"recuperare",call:"chiamare",return:"ritornare",make:"fare",log:"registrare",throw:"lanciare",catch:"catturare",measure:"misurare",transition:"transizione",increment:"incrementare",decrement:"decrementare",default:"predefinito",go:"andare",pushUrl:"pushUrl",replaceUrl:"sostituireUrl",copy:"copiare",pick:"scegliere",beep:"beep",js:"js",async:"asincrono",render:"renderizzare",swap:"scambiare",morph:"trasformare",settle:"stabilizzare",append:"accodare",exit:"uscire",install:"installare",breakpoint:"punto-interruzione",clear:"cancellare",close:"chiudere",open:"aprire",select:"selezionare",clone:"clonare",prepend:"anteporre",focus:"focalizzare"},modifiers:{to:"a",from:"da",into:"in",with:"con",at:"a",in:"in",of:"di",as:"come",by:"per",before:"prima",after:"dopo",over:"sopra",under:"sotto",between:"tra",through:"attraverso",without:"senza"},events:{click:"clic",dblclick:"doppioclic",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"mouseentra",mouseleave:"mouseesce",mouseover:"mousesopra",mouseout:"mousefuori",mousemove:"mousemuovi",keydown:"tastogi\u00f9",keyup:"tastosu",keypress:"tastopremi",focus:"fuoco",blur:"sfuocare",change:"cambio",input:"input",submit:"invio",reset:"reimpostare",load:"carica",unload:"scarica",resize:"ridimensiona",scroll:"scorrimento",touchstart:"toccoinizia",touchend:"toccofine",touchmove:"toccomuovi",touchcancel:"toccoannulla"},logical:{when:"quando",where:"dove",and:"e",or:"o",not:"non",is:"\u00e8",exists:"esiste",matches:"corrisponde",contains:"contiene",includes:"include",equals:"uguale",has:"ha",have:"ho",then:"allora",else:"altrimenti",otherwise:"altrimenti",end:"fine",live:"vivo",changes:"cambia"},temporal:{seconds:"secondi",second:"secondo",milliseconds:"millisecondi",millisecond:"millisecondo",minutes:"minuti",minute:"minuto",hours:"ore",hour:"ora",ms:"ms",s:"s",min:"min",h:"h"},values:{true:"vero",false:"falso",null:"nullo",undefined:"indefinito",it:"esso",its:"suo",me:"io",my:"mio",you:"tu",your:"tuo",yourself:"te stesso",myself:"me stesso",element:"elemento",target:"obiettivo",detail:"dettaglio",event:"evento",window:"finestra",document:"documento",body:"corpo",result:"risultato",value:"valore"},attributes:{class:"classe",classes:"classi",style:"stile",styles:"stili",attribute:"attributo",attributes:"attributi",property:"propriet\u00e0",properties:"propriet\u00e0"},expressions:{characters:"caratteri",inclusive:"inclusivo",exclusive:"esclusivo",first:"primo",last:"ultimo",next:"prossimo",previous:"precedente",prev:"prec",at:"a",random:"casuale",closest:"vicino",parent:"genitore",children:"figli",within:"dentro",no:"nessun",empty:"vuoto",some:"qualche","starts with":"inizia con","ends with":"finisce con","ignoring case":"ignorando maiuscole","sorted by":"ordinato per","mapped to":"trasformato in","split by":"diviso per","joined by":"unito per"}};pl(zl,"it",{allowEnglishFallback:!0});var Vl={commands:{on:"khi",tell:"n\u00f3i v\u1edbi",trigger:"k\u00edch ho\u1ea1t",send:"g\u1eedi",take:"l\u1ea5y",put:"\u0111\u1eb7t",set:"g\u00e1n",get:"l\u1ea5y gi\u00e1 tr\u1ecb",add:"th\u00eam",remove:"x\u00f3a",toggle:"chuy\u1ec3n \u0111\u1ed5i",hide:"\u1ea9n",show:"hi\u1ec3n th\u1ecb",if:"n\u1ebfu",unless:"tr\u1eeb khi",repeat:"l\u1eb7p l\u1ea1i",for:"v\u1edbi m\u1ed7i",while:"trong khi",until:"cho \u0111\u1ebfn khi",continue:"ti\u1ebfp t\u1ee5c",break:"d\u1eebng",halt:"d\u1eebng l\u1ea1i",wait:"ch\u1edd",fetch:"t\u1ea3i",call:"g\u1ecdi",return:"tr\u1ea3 v\u1ec1",make:"t\u1ea1o",log:"in ra",throw:"n\u00e9m",catch:"b\u1eaft",measure:"\u0111o l\u01b0\u1eddng",transition:"chuy\u1ec3n ti\u1ebfp",increment:"t\u0103ng",decrement:"gi\u1ea3m",default:"m\u1eb7c \u0111\u1ecbnh",go:"\u0111i \u0111\u1ebfn",pushUrl:"pushUrl",replaceUrl:"thayTh\u1ebfUrl",copy:"sao ch\u00e9p",pick:"ch\u1ecdn",beep:"beep",js:"js",async:"b\u1ea5t \u0111\u1ed3ng b\u1ed9",render:"k\u1ebft xu\u1ea5t",swap:"ho\u00e1n \u0111\u1ed5i",morph:"bi\u1ebfn \u0111\u1ed5i",settle:"\u1ed5n \u0111\u1ecbnh",append:"n\u1ed1i",exit:"tho\u00e1t",focus:"t\u1eadp trung",blur:"m\u1ea5t t\u1eadp trung",init:"kh\u1edfi t\u1ea1o",behavior:"h\u00e0nh vi",install:"c\u00e0i \u0111\u1eb7t",clone:"nh\u00e2n b\u1ea3n",prepend:"th\u00eam v\u00e0o \u0111\u1ea7u",else:"kh\u00f4ng th\u00ec",breakpoint:"\u0111i\u1ec3m-d\u1eebng",clear:"t\u1ea9y",close:"\u0111\u00f3ng",open:"m\u1edf",select:"\u0111\u00e1nh-d\u1ea5u"},modifiers:{into:"v\u00e0o",before:"tr\u01b0\u1edbc",after:"sau",then:"r\u1ed3i",end:"k\u1ebft th\u00fac",from:"t\u1eeb",to:"\u0111\u1ebfn",with:"v\u1edbi",as:"nh\u01b0",by:"b\u1edfi",on:"tr\u00ean",in:"trong",at:"t\u1ea1i",of:"c\u1ee7a",between:"gi\u1eefa",the:"",times:"l\u1ea7n"},events:{click:"nh\u1ea5p",dblclick:"dblclick",input:"nh\u1eadp",change:"change",submit:"n\u1ed9p",keydown:"keydown",keyup:"keyup",keypress:"keypress",mouseover:"mouseover",mouseout:"mouseout",mouseenter:"mouseenter",mouseleave:"mouseleave",focus:"focus",blur:"blur",reset:"reset",load:"load",scroll:"cu\u1ed9n",resize:"\u0111\u1ed5i k\u00edch th\u01b0\u1edbc"},logical:{when:"khi",where:"\u1edf_\u0111\u00e2u",and:"v\u00e0",or:"ho\u1eb7c",not:"kh\u00f4ng",is:"l\u00e0",equals:"b\u1eb1ng",contains:"ch\u1ee9a",matches:"kh\u1edbp",exists:"t\u1ed3n t\u1ea1i",has:"c\u00f3",have:"c\u00f3",empty:"tr\u1ed1ng",true:"\u0111\u00fang",false:"sai",null:"r\u1ed7ng",else:"kh\u00f4ng th\u00ec",end:"k\u1ebft th\u00fac",then:"r\u1ed3i",live:"live",changes:"thay \u0111\u1ed5i"},temporal:{now:"b\u00e2y gi\u1edd",today:"h\u00f4m nay",tomorrow:"ng\u00e0y mai",yesterday:"h\u00f4m qua",always:"lu\u00f4n lu\u00f4n",never:"kh\u00f4ng bao gi\u1edd",sometimes:"\u0111\u00f4i khi",once:"m\u1ed9t l\u1ea7n",twice:"hai l\u1ea7n",forever:"m\u00e3i m\u00e3i"},values:{true:"\u0111\u00fang",false:"sai",null:"r\u1ed7ng",undefined:"kh\u00f4ng x\u00e1c \u0111\u1ecbnh",none:"kh\u00f4ng c\u00f3",all:"t\u1ea5t c\u1ea3",any:"b\u1ea5t k\u1ef3",some:"m\u1ed9t s\u1ed1",each:"m\u1ed7i",every:"t\u1ea5t c\u1ea3",body:"body",event:"s\u1ef1 ki\u1ec7n",it:"n\u00f3",its:"c\u1ee7a n\u00f3",me:"t\u00f4i",my:"c\u1ee7a t\u00f4i",result:"k\u1ebft qu\u1ea3",target:"m\u1ee5c ti\u00eau",you:"b\u1ea1n",your:"c\u1ee7a b\u1ea1n"},attributes:{id:"id",class:"l\u1edbp",style:"ki\u1ec3u",value:"gi\u00e1 tr\u1ecb",text:"v\u0103n b\u1ea3n",html:"html",src:"ngu\u1ed3n",href:"li\u00ean k\u1ebft",disabled:"v\u00f4 hi\u1ec7u",hidden:"\u1ea9n",checked:"\u0111\u01b0\u1ee3c ch\u1ecdn",selected:"\u0111\u01b0\u1ee3c ch\u1ecdn"},expressions:{random:"ng\u1eabu nhi\u00ean",characters:"k\u00fd t\u1ef1",inclusive:"bao g\u1ed3m",exclusive:"lo\u1ea1i tr\u1eeb",me:"t\u00f4i",my:"c\u1ee7a t\u00f4i",it:"n\u00f3",its:"c\u1ee7a n\u00f3",result:"k\u1ebft qu\u1ea3",event:"s\u1ef1 ki\u1ec7n",target:"m\u1ee5c ti\u00eau",first:"\u0111\u1ea7u ti\u00ean",last:"cu\u1ed1i c\u00f9ng",next:"ti\u1ebfp theo",previous:"tr\u01b0\u1edbc \u0111\u00f3",parent:"cha",children:"con",closest:"g\u1ea7n nh\u1ea5t",empty:"l\u00e0m-r\u1ed7ng","starts with":"b\u1eaft \u0111\u1ea7u b\u1eb1ng","ends with":"k\u1ebft th\u00fac b\u1eb1ng","ignoring case":"kh\u00f4ng ph\u00e2n bi\u1ec7t hoa th\u01b0\u1eddng","sorted by":"s\u1eafp x\u1ebfp theo","mapped to":"\u00e1nh x\u1ea1 th\u00e0nh","split by":"t\u00e1ch b\u1edfi","joined by":"n\u1ed1i b\u1edfi"}};pl(Vl,"vi",{allowEnglishFallback:!0});var Hl={commands:{on:"gdy",tell:"powiedz",trigger:"wyzw\u00f3l",send:"wy\u015blij",take:"we\u017a",put:"umie\u015b\u0107",set:"ustaw",get:"uzyskaj",add:"dodaj",remove:"usu\u0144",toggle:"prze\u0142\u0105cz",blur:"rozmyj",hide:"ukryj",show:"poka\u017c",if:"je\u015bli",unless:"chyba",repeat:"powt\u00f3rz",for:"dla",while:"dop\u00f3ki",until:"a\u017c",continue:"kontynuuj",break:"przerwij",halt:"zatrzymaj",wait:"czekaj",fetch:"pobierz",call:"wywo\u0142aj",return:"zwr\u00f3\u0107",make:"utw\u00f3rz",log:"loguj",throw:"rzu\u0107",catch:"z\u0142ap",measure:"zmierz",transition:"animuj",increment:"zwi\u0119ksz",decrement:"zmniejsz",default:"domy\u015blnie",go:"id\u017a",pushUrl:"dodajUrl",replaceUrl:"zamie\u0144Url",copy:"kopiuj",pick:"wybierz",beep:"sygna\u0142",js:"js",async:"async",render:"renderuj",swap:"zamie\u0144",morph:"przekszta\u0142\u0107",settle:"ustabilizuj",append:"do\u0142\u0105cz",exit:"wyjd\u017a",install:"zainstaluj",breakpoint:"punkt-przerwania",clear:"zeruj",close:"zamknij",open:"otw\u00f3rz",select:"zaznacz",clone:"sklonuj",prepend:"poprzed\u017a",focus:"skup"},modifiers:{to:"do",from:"z",into:"do",with:"z",at:"przy",in:"w",of:"z",as:"jako",by:"przez",before:"przed",after:"po",over:"nad",under:"pod",between:"mi\u0119dzy",through:"przez",without:"bez"},events:{click:"klikni\u0119cie",dblclick:"podw\u00f3jneklikni\u0119cie",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"myszwej\u015bcie",mouseleave:"myszwyj\u015bcie",mouseover:"mysznad",mouseout:"myszpoza",mousemove:"myszruch",keydown:"klawiszd\u00f3\u0142",keyup:"klawiszg\u00f3ra",keypress:"klawisznaci\u015bni\u0119cie",focus:"fokus",blur:"rozmycie",change:"zmiana",input:"wej\u015bcie",submit:"wys\u0142aniu",reset:"zresetuj",load:"za\u0142aduj",unload:"wy\u0142aduj",resize:"zmiana rozmiaru",scroll:"przewi\u0144",touchstart:"dotykstart",touchend:"dotykkoniec",touchmove:"dotykruch",touchcancel:"dotykanuluj"},logical:{when:"kiedy",where:"gdzie",and:"i",or:"lub",not:"nie",is:"jest",exists:"istnieje",matches:"pasuje",contains:"zawiera",includes:"obejmuje",equals:"r\u00f3wna si\u0119",has:"ma",have:"mam",then:"wtedy",else:"inaczej",otherwise:"wpp",end:"koniec",live:"\u017cywy",changes:"zmienia"},temporal:{seconds:"sekundy",second:"sekunda",milliseconds:"milisekundy",millisecond:"milisekunda",minutes:"minuty",minute:"minuta",hours:"godziny",hour:"godzina",ms:"ms",s:"s",min:"min",h:"godz"},values:{true:"prawda",false:"fa\u0142sz",null:"null",undefined:"niezdefiniowane",it:"to",its:"jego",me:"ja",my:"m\u00f3j",you:"ty",your:"tw\u00f3j",yourself:"ty sam",myself:"ja sam",element:"element",target:"cel",detail:"szczeg\u00f3\u0142",event:"zdarzenie",window:"okno",document:"dokument",body:"body",result:"wynik",value:"warto\u015b\u0107"},attributes:{class:"klasa",classes:"klasy",style:"styl",styles:"style",attribute:"atrybut",attributes:"atrybuty",property:"w\u0142a\u015bciwo\u015b\u0107",properties:"w\u0142a\u015bciwo\u015bci"},expressions:{characters:"znaki",inclusive:"w\u0142\u0105cznie",exclusive:"wy\u0142\u0105cznie",first:"pierwszy",last:"ostatni",next:"nast\u0119pny",previous:"poprzedni",prev:"poprz",at:"przy",random:"losowy",closest:"najbli\u017cszy",parent:"rodzic",children:"dzieci",within:"wewn\u0105trz",no:"brak",empty:"pusty",some:"jaki\u015b","starts with":"zaczyna si\u0119 od","ends with":"ko\u0144czy si\u0119 na","ignoring case":"ignoruj\u0105c wielko\u015b\u0107 liter","sorted by":"sortowane wed\u0142ug","mapped to":"przekszta\u0142cone na","split by":"podzielone przez","joined by":"po\u0142\u0105czone przez"}};pl(Hl,"pl",{allowEnglishFallback:!0});var Bl={commands:{on:"\u043f\u0440\u0438",tell:"\u0441\u043a\u0430\u0437\u0430\u0442\u044c",trigger:"\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c",send:"\u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c",take:"\u0432\u0437\u044f\u0442\u044c",put:"\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c",set:"\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c",get:"\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c",add:"\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c",remove:"\u0443\u0434\u0430\u043b\u0438\u0442\u044c",toggle:"\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c",hide:"\u0441\u043a\u0440\u044b\u0442\u044c",show:"\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c",scroll:"\u043f\u0440\u043e\u043a\u0440\u0443\u0442\u0438\u0442\u044c",if:"\u0435\u0441\u043b\u0438",unless:"\u043a\u0440\u043e\u043c\u0435",repeat:"\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",for:"\u0434\u043b\u044f",while:"\u043f\u043e\u043a\u0430",until:"\u0434\u043e",continue:"\u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c",break:"\u043f\u0440\u0435\u0440\u0432\u0430\u0442\u044c",halt:"\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c",wait:"\u0436\u0434\u0430\u0442\u044c",fetch:"\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c",call:"\u0432\u044b\u0437\u0432\u0430\u0442\u044c",return:"\u0432\u0435\u0440\u043d\u0443\u0442\u044c",make:"\u0441\u043e\u0437\u0434\u0430\u0442\u044c",log:"\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c",throw:"\u0431\u0440\u043e\u0441\u0438\u0442\u044c",catch:"\u043f\u043e\u0439\u043c\u0430\u0442\u044c",measure:"\u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c",transition:"\u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c",increment:"\u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c",decrement:"\u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c",default:"\u043f\u043e_\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e",go:"\u043f\u0435\u0440\u0435\u0439\u0442\u0438",pushUrl:"\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c_url",replaceUrl:"\u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c_url",copy:"\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c",pick:"\u0432\u044b\u0431\u0440\u0430\u0442\u044c",beep:"\u0437\u0432\u0443\u043a",js:"js",async:"\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e",render:"\u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c",swap:"\u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c",morph:"\u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c",settle:"\u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c",append:"\u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c",exit:"\u0432\u044b\u0439\u0442\u0438",else:"\u0438\u043d\u0430\u0447\u0435",install:"\u0438\u043d\u0441\u0442\u0430\u043b\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c",init:"\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c",behavior:"\u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435",focus:"\u0441\u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c",blur:"\u0440\u0430\u0437\u043c\u044b\u0442\u044c",clone:"\u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c",prepend:"\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043d\u0430\u0447\u0430\u043b\u043e",breakpoint:"\u0442\u043e\u0447\u043a\u0430-\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0430",clear:"\u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c",close:"\u0437\u0430\u043a\u0440\u044b\u0442\u044c",open:"\u043e\u0442\u043a\u0440\u044b\u0442\u044c",select:"\u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c"},modifiers:{to:"\u043a",from:"\u0438\u0437",into:"\u0432",with:"\u0441",at:"\u0443",in:"\u0432",of:"\u0438\u0437",as:"\u043a\u0430\u043a",by:"\u043d\u0430",before:"\u0434\u043e",after:"\u043f\u043e\u0441\u043b\u0435",over:"\u043d\u0430\u0434",under:"\u043f\u043e\u0434",between:"\u043c\u0435\u0436\u0434\u0443",through:"\u0447\u0435\u0440\u0435\u0437",without:"\u0431\u0435\u0437",on:"\u043d\u0430"},events:{click:"\u043a\u043b\u0438\u043a",dblclick:"\u0434\u0432\u043e\u0439\u043d\u043e\u0439_\u043a\u043b\u0438\u043a",mousedown:"\u043c\u044b\u0448\u044c\u0432\u043d\u0438\u0437",mouseup:"\u043c\u044b\u0448\u044c\u0432\u0432\u0435\u0440\u0445",mouseenter:"\u043c\u044b\u0448\u044c_\u0432\u0445\u043e\u0434",mouseleave:"\u043c\u044b\u0448\u044c_\u0432\u044b\u0445\u043e\u0434",mouseover:"\u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0435",mouseout:"\u0443\u0445\u043e\u0434",mousemove:"\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435_\u043c\u044b\u0448\u0438",keydown:"\u043a\u043b\u0430\u0432\u0438\u0448\u0430_\u0432\u043d\u0438\u0437",keyup:"\u043a\u043b\u0430\u0432\u0438\u0448\u0430_\u0432\u0432\u0435\u0440\u0445",keypress:"\u043d\u0430\u0436\u0430\u0442\u0438\u0435_\u043a\u043b\u0430\u0432\u0438\u0448\u0438",focus:"\u0444\u043e\u043a\u0443\u0441",blur:"\u043f\u043e\u0442\u0435\u0440\u044f_\u0444\u043e\u043a\u0443\u0441\u0430",change:"\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435",input:"\u0432\u0432\u043e\u0434",submit:"\u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430",reset:"\u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c",load:"\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430",unload:"\u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430",resize:"\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u0440\u0430\u0437\u043c\u0435\u0440\u0430",scroll:"\u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430",touchstart:"\u043a\u0430\u0441\u0430\u043d\u0438\u0435_\u043d\u0430\u0447\u0430\u043b\u043e",touchend:"\u043a\u0430\u0441\u0430\u043d\u0438\u0435_\u043a\u043e\u043d\u0435\u0446",touchmove:"\u043a\u0430\u0441\u0430\u043d\u0438\u0435_\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435",touchcancel:"\u043a\u0430\u0441\u0430\u043d\u0438\u0435_\u043e\u0442\u043c\u0435\u043d\u0430"},logical:{when:"\u043a\u043e\u0433\u0434\u0430",where:"\u0433\u0434\u0435",and:"\u0438",or:"\u0438\u043b\u0438",not:"\u043d\u0435",is:"\u0435\u0441\u0442\u044c",exists:"\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442",matches:"\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442",contains:"\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442",includes:"\u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442",equals:"\u0440\u0430\u0432\u043d\u043e",then:"\u0437\u0430\u0442\u0435\u043c",else:"\u0438\u043d\u0430\u0447\u0435",otherwise:"\u0432_\u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c_\u0441\u043b\u0443\u0447\u0430\u0435",end:"\u043a\u043e\u043d\u0435\u0446",live:"\u0436\u0438\u0432\u043e\u0439",changes:"\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f",has:"\u0438\u043c\u0435\u0435\u0442",have:"\u0438\u043c\u0435\u044e",isNot:"\u043d\u0435_\u0435\u0441\u0442\u044c",empty:"\u043f\u0443\u0441\u0442\u043e\u0439"},temporal:{seconds:"\u0441\u0435\u043a\u0443\u043d\u0434",second:"\u0441\u0435\u043a\u0443\u043d\u0434\u0430",milliseconds:"\u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434",millisecond:"\u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u0430",minutes:"\u043c\u0438\u043d\u0443\u0442",minute:"\u043c\u0438\u043d\u0443\u0442\u0430",hours:"\u0447\u0430\u0441\u043e\u0432",hour:"\u0447\u0430\u0441",ms:"\u043c\u0441",s:"\u0441",min:"\u043c\u0438\u043d",h:"\u0447",forever:"\u0432\u0441\u0435\u0433\u0434\u0430",once:"\u043e\u0434\u043d\u0430\u0436\u0434\u044b",every:"\u043a\u0430\u0436\u0434\u044b\u0439",until:"\u0434\u043e"},values:{true:"\u0438\u0441\u0442\u0438\u043d\u0430",false:"\u043b\u043e\u0436\u044c",null:"\u043d\u0438\u0447\u0435\u0433\u043e",undefined:"\u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e",it:"\u044d\u0442\u043e",its:"\u0435\u0433\u043e",me:"\u044f",my:"\u043c\u043e\u0439",you:"\u0442\u044b",your:"\u0442\u0432\u043e\u0439",yourself:"\u0441\u0430\u043c",myself:"\u044f_\u0441\u0430\u043c",element:"\u044d\u043b\u0435\u043c\u0435\u043d\u0442",target:"\u0446\u0435\u043b\u044c",detail:"\u0434\u0435\u0442\u0430\u043b\u0438",event:"\u0441\u043e\u0431\u044b\u0442\u0438\u0435",window:"\u043e\u043a\u043d\u043e",document:"\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442",body:"\u0442\u0435\u043b\u043e",result:"\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442",value:"\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435",first:"\u043f\u0435\u0440\u0432\u044b\u0439",last:"\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439",next:"\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439",previous:"\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439",closest:"\u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439",parent:"\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c"},attributes:{class:"\u043a\u043b\u0430\u0441\u0441",classes:"\u043a\u043b\u0430\u0441\u0441\u044b",style:"\u0441\u0442\u0438\u043b\u044c",styles:"\u0441\u0442\u0438\u043b\u0438",attribute:"\u0430\u0442\u0440\u0438\u0431\u0443\u0442",attributes:"\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b",property:"\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e",properties:"\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430",disabled:"\u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043e",hidden:"\u0441\u043a\u0440\u044b\u0442\u043e",checked:"\u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043e",selected:"\u0432\u044b\u0431\u0440\u0430\u043d\u043e",readonly:"\u0442\u043e\u043b\u044c\u043a\u043e_\u0447\u0442\u0435\u043d\u0438\u0435",required:"\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e",text:"\u0442\u0435\u043a\u0441\u0442",html:"html"},expressions:{characters:"\u0441\u0438\u043c\u0432\u043e\u043b\u044b",inclusive:"\u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e",exclusive:"\u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e",first:"\u043f\u0435\u0440\u0432\u044b\u0439",last:"\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439",next:"\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439",previous:"\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439",prev:"\u043f\u0440\u0435\u0434",at:"\u0432",random:"\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439",closest:"\u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439",parent:"\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c",children:"\u0434\u0435\u0442\u0438",within:"\u0432\u043d\u0443\u0442\u0440\u0438",no:"\u043d\u0435\u0442",empty:"\u043f\u0443\u0441\u0442\u043e\u0439",some:"\u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435","starts with":"\u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f_\u0441","ends with":"\u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f_\u043d\u0430","ignoring case":"\u0431\u0435\u0437_\u0443\u0447\u0451\u0442\u0430_\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430","sorted by":"\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e_\u043f\u043e","mapped to":"\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043e_\u0432","split by":"\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043e_\u043f\u043e","joined by":"\u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043e_\u0447\u0435\u0440\u0435\u0437"}};pl(Bl,"ru",{allowEnglishFallback:!0});var Wl={commands:{on:"\u043f\u0440\u0438",tell:"\u0441\u043a\u0430\u0437\u0430\u0442\u0438",trigger:"\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0438",send:"\u043d\u0430\u0434\u0456\u0441\u043b\u0430\u0442\u0438",take:"\u0432\u0437\u044f\u0442\u0438",put:"\u043f\u043e\u043a\u043b\u0430\u0441\u0442\u0438",set:"\u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0438",get:"\u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438",add:"\u0434\u043e\u0434\u0430\u0442\u0438",remove:"\u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438",toggle:"\u043f\u0435\u0440\u0435\u043c\u043a\u043d\u0443\u0442\u0438",hide:"\u0441\u0445\u043e\u0432\u0430\u0442\u0438",show:"\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0438",scroll:"\u043f\u0440\u043e\u043a\u0440\u0443\u0442\u0438\u0442\u0438",if:"\u044f\u043a\u0449\u043e",unless:"\u043a\u0440\u0456\u043c",repeat:"\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0438",for:"\u0434\u043b\u044f",while:"\u043f\u043e\u043a\u0438",until:"\u0434\u043e",continue:"\u043f\u0440\u043e\u0434\u043e\u0432\u0436\u0438\u0442\u0438",break:"\u043f\u0435\u0440\u0435\u0440\u0432\u0430\u0442\u0438",halt:"\u0437\u0443\u043f\u0438\u043d\u0438\u0442\u0438",wait:"\u0447\u0435\u043a\u0430\u0442\u0438",fetch:"\u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438",call:"\u0432\u0438\u043a\u043b\u0438\u043a\u0430\u0442\u0438",return:"\u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u0438",make:"\u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438",log:"\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u0438",throw:"\u043a\u0438\u043d\u0443\u0442\u0438",catch:"\u0437\u043b\u043e\u0432\u0438\u0442\u0438",measure:"\u0432\u0438\u043c\u0456\u0440\u044f\u0442\u0438",transition:"\u0430\u043d\u0456\u043c\u0443\u0432\u0430\u0442\u0438",increment:"\u0437\u0431\u0456\u043b\u044c\u0448\u0438\u0442\u0438",decrement:"\u0437\u043c\u0435\u043d\u0448\u0438\u0442\u0438",default:"\u0437\u0430_\u0437\u0430\u043c\u043e\u0432\u0447\u0443\u0432\u0430\u043d\u043d\u044f\u043c",go:"\u043f\u0435\u0440\u0435\u0439\u0442\u0438",pushUrl:"\u0434\u043e\u0434\u0430\u0442\u0438_url",replaceUrl:"\u0437\u0430\u043c\u0456\u043d\u0438\u0442\u0438_url",copy:"\u043a\u043e\u043f\u0456\u044e\u0432\u0430\u0442\u0438",pick:"\u0432\u0438\u0431\u0440\u0430\u0442\u0438",beep:"\u0437\u0432\u0443\u043a",js:"js",async:"\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e",render:"\u0432\u0456\u0434\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0438",swap:"\u043f\u043e\u043c\u0456\u043d\u044f\u0442\u0438",morph:"\u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0443\u0432\u0430\u0442\u0438",settle:"\u0441\u0442\u0430\u0431\u0456\u043b\u0456\u0437\u0443\u0432\u0430\u0442\u0438",append:"\u0434\u043e\u043f\u0438\u0441\u0430\u0442\u0438",exit:"\u0432\u0438\u0439\u0442\u0438",else:"\u0456\u043d\u0430\u043a\u0448\u0435",install:"\u0456\u043d\u0441\u0442\u0430\u043b\u044e\u0432\u0430\u0442\u0438",init:"\u0456\u043d\u0456\u0446\u0456\u0430\u043b\u0456\u0437\u0443\u0432\u0430\u0442\u0438",behavior:"\u043f\u043e\u0432\u0435\u0434\u0456\u043d\u043a\u0430",focus:"\u0441\u0444\u043e\u043a\u0443\u0441\u0443\u0432\u0430\u0442\u0438",blur:"\u0440\u043e\u0437\u0444\u043e\u043a\u0443\u0441\u0443\u0432\u0430\u0442\u0438",clone:"\u043a\u043b\u043e\u043d\u0443\u0432\u0430\u0442\u0438",prepend:"\u0434\u043e\u0434\u0430\u0442\u0438 \u043d\u0430 \u043f\u043e\u0447\u0430\u0442\u043e\u043a",breakpoint:"\u0442\u043e\u0447\u043a\u0430-\u0437\u0443\u043f\u0438\u043d\u043a\u0438",clear:"\u043e\u0447\u0438\u0441\u0442\u0438\u0442\u0438",close:"\u0437\u0430\u043a\u0440\u0438\u0442\u0438",open:"\u0432\u0456\u0434\u043a\u0440\u0438\u0442\u0438",select:"\u0432\u0438\u0434\u0456\u043b\u0438\u0442\u0438"},modifiers:{to:"\u0434\u043e",from:"\u0437",into:"\u0432",with:"\u0437",at:"\u0432",in:"\u0443",of:"\u0437",as:"\u044f\u043a",by:"\u043d\u0430",before:"\u0434\u043e",after:"\u043f\u0456\u0441\u043b\u044f",over:"\u043d\u0430\u0434",under:"\u043f\u0456\u0434",between:"\u043c\u0456\u0436",through:"\u0447\u0435\u0440\u0435\u0437",without:"\u0431\u0435\u0437",on:"\u043d\u0430"},events:{click:"\u043a\u043b\u0456\u043a",dblclick:"\u043f\u043e\u0434\u0432\u0456\u0439\u043d\u0438\u0439_\u043a\u043b\u0456\u043a",mousedown:"\u043c\u0438\u0448\u0430\u0432\u043d\u0438\u0437",mouseup:"\u043c\u0438\u0448\u0430\u0432\u0433\u043e\u0440\u0443",mouseenter:"\u043c\u0438\u0448\u0430_\u0432\u0445\u0456\u0434",mouseleave:"\u043c\u0438\u0448\u0430_\u0432\u0438\u0445\u0456\u0434",mouseover:"\u043d\u0430\u0432\u0435\u0434\u0435\u043d\u043d\u044f",mouseout:"\u0432\u0456\u0434\u0432\u0435\u0434\u0435\u043d\u043d\u044f",mousemove:"\u0440\u0443\u0445_\u043c\u0438\u0448\u0456",keydown:"\u043a\u043b\u0430\u0432\u0456\u0448\u0430_\u0432\u043d\u0438\u0437",keyup:"\u043a\u043b\u0430\u0432\u0456\u0448\u0430_\u0432\u0433\u043e\u0440\u0443",keypress:"\u043d\u0430\u0442\u0438\u0441\u043a\u0430\u043d\u043d\u044f_\u043a\u043b\u0430\u0432\u0456\u0448\u0456",focus:"\u0444\u043e\u043a\u0443\u0441",blur:"\u0440\u043e\u0437\u0444\u043e\u043a\u0443\u0441",change:"\u0437\u043c\u0456\u043d\u0430",input:"\u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044f",submit:"\u043d\u0430\u0434\u0441\u0438\u043b\u0430\u043d\u043d\u044f",reset:"\u0441\u043a\u0438\u043d\u0443\u0442\u0438",load:"\u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f",unload:"\u0432\u0438\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f",resize:"\u0437\u043c\u0456\u043d\u0430\u0440\u043e\u0437\u043c\u0456\u0440\u0443",scroll:"\u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430",touchstart:"\u0434\u043e\u0442\u0438\u043a_\u043f\u043e\u0447\u0430\u0442\u043e\u043a",touchend:"\u0434\u043e\u0442\u0438\u043a_\u043a\u0456\u043d\u0435\u0446\u044c",touchmove:"\u0434\u043e\u0442\u0438\u043a_\u0440\u0443\u0445",touchcancel:"\u0434\u043e\u0442\u0438\u043a_\u0441\u043a\u0430\u0441\u0443\u0432\u0430\u043d\u043d\u044f"},logical:{when:"\u043a\u043e\u043b\u0438",where:"\u0434\u0435",and:"\u0456",or:"\u0430\u0431\u043e",not:"\u043d\u0435",is:"\u0454",exists:"\u0456\u0441\u043d\u0443\u0454",matches:"\u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u0430\u0454",contains:"\u043c\u0456\u0441\u0442\u0438\u0442\u044c",includes:"\u0432\u043a\u043b\u044e\u0447\u0430\u0454",equals:"\u0434\u043e\u0440\u0456\u0432\u043d\u044e\u0454",then:"\u0442\u043e\u0434\u0456",else:"\u0456\u043d\u0430\u043a\u0448\u0435",otherwise:"\u0432_\u0456\u043d\u0448\u043e\u043c\u0443_\u0432\u0438\u043f\u0430\u0434\u043a\u0443",end:"\u043a\u0456\u043d\u0435\u0446\u044c",live:"\u0436\u0438\u0432\u0438\u0439",changes:"\u0437\u043c\u0456\u043d\u044e\u0454\u0442\u044c\u0441\u044f",has:"\u043c\u0430\u0454",have:"\u043c\u0430\u044e",isNot:"\u043d\u0435_\u0454",empty:"\u043f\u043e\u0440\u043e\u0436\u043d\u0456\u0439"},temporal:{seconds:"\u0441\u0435\u043a\u0443\u043d\u0434",second:"\u0441\u0435\u043a\u0443\u043d\u0434\u0430",milliseconds:"\u043c\u0456\u043b\u0456\u0441\u0435\u043a\u0443\u043d\u0434",millisecond:"\u043c\u0456\u043b\u0456\u0441\u0435\u043a\u0443\u043d\u0434\u0430",minutes:"\u0445\u0432\u0438\u043b\u0438\u043d",minute:"\u0445\u0432\u0438\u043b\u0438\u043d\u0430",hours:"\u0433\u043e\u0434\u0438\u043d",hour:"\u0433\u043e\u0434\u0438\u043d\u0430",ms:"\u043c\u0441",s:"\u0441",min:"\u0445\u0432",h:"\u0433\u043e\u0434",forever:"\u0437\u0430\u0432\u0436\u0434\u0438",once:"\u043e\u0434\u0438\u043d_\u0440\u0430\u0437",every:"\u043a\u043e\u0436\u043d\u0438\u0439",until:"\u0434\u043e"},values:{true:"\u0456\u0441\u0442\u0438\u043d\u0430",false:"\u0445\u0438\u0431\u043d\u0456\u0441\u0442\u044c",null:"\u043d\u0456\u0447\u043e\u0433\u043e",undefined:"\u043d\u0435\u0432\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043e",it:"\u0446\u0435",its:"\u0439\u043e\u0433\u043e",me:"\u044f",my:"\u043c\u0456\u0439",you:"\u0442\u0438",your:"\u0442\u0432\u0456\u0439",yourself:"\u0441\u0430\u043c",myself:"\u044f_\u0441\u0430\u043c",element:"\u0435\u043b\u0435\u043c\u0435\u043d\u0442",target:"\u0446\u0456\u043b\u044c",detail:"\u0434\u0435\u0442\u0430\u043b\u0456",event:"\u043f\u043e\u0434\u0456\u044f",window:"\u0432\u0456\u043a\u043d\u043e",document:"\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442",body:"\u0442\u0456\u043b\u043e",result:"\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442",value:"\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f",first:"\u043f\u0435\u0440\u0448\u0438\u0439",last:"\u043e\u0441\u0442\u0430\u043d\u043d\u0456\u0439",next:"\u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0438\u0439",previous:"\u043f\u043e\u043f\u0435\u0440\u0435\u0434\u043d\u0456\u0439",closest:"\u043d\u0430\u0439\u0431\u043b\u0438\u0436\u0447\u0438\u0439",parent:"\u0431\u0430\u0442\u044c\u043a\u0456\u0432\u0441\u044c\u043a\u0438\u0439"},attributes:{class:"\u043a\u043b\u0430\u0441",classes:"\u043a\u043b\u0430\u0441\u0438",style:"\u0441\u0442\u0438\u043b\u044c",styles:"\u0441\u0442\u0438\u043b\u0456",attribute:"\u0430\u0442\u0440\u0438\u0431\u0443\u0442",attributes:"\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0438",property:"\u0432\u043b\u0430\u0441\u0442\u0438\u0432\u0456\u0441\u0442\u044c",properties:"\u0432\u043b\u0430\u0441\u0442\u0438\u0432\u043e\u0441\u0442\u0456",disabled:"\u0432\u0438\u043c\u043a\u043d\u0435\u043d\u043e",hidden:"\u043f\u0440\u0438\u0445\u043e\u0432\u0430\u043d\u043e",checked:"\u043f\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u043e",selected:"\u0432\u0438\u0431\u0440\u0430\u043d\u043e",readonly:"\u043b\u0438\u0448\u0435_\u0447\u0438\u0442\u0430\u043d\u043d\u044f",required:"\u043e\u0431\u043e\u0432'\u044f\u0437\u043a\u043e\u0432\u043e",text:"\u0442\u0435\u043a\u0441\u0442",html:"html"},expressions:{characters:"\u0441\u0438\u043c\u0432\u043e\u043b\u0438",inclusive:"\u0432\u043a\u043b\u044e\u0447\u043d\u043e",exclusive:"\u0432\u0438\u043a\u043b\u044e\u0447\u043d\u043e",first:"\u043f\u0435\u0440\u0448\u0438\u0439",last:"\u043e\u0441\u0442\u0430\u043d\u043d\u0456\u0439",next:"\u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0438\u0439",previous:"\u043f\u043e\u043f\u0435\u0440\u0435\u0434\u043d\u0456\u0439",prev:"\u043f\u043e\u043f\u0435\u0440",at:"\u0432",random:"\u0432\u0438\u043f\u0430\u0434\u043a\u043e\u0432\u0438\u0439",closest:"\u043d\u0430\u0439\u0431\u043b\u0438\u0436\u0447\u0438\u0439",parent:"\u0431\u0430\u0442\u044c\u043a\u0456\u0432\u0441\u044c\u043a\u0438\u0439",children:"\u0434\u0456\u0442\u0438",within:"\u0432\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0456",no:"\u043d\u0456",empty:"\u043f\u043e\u0440\u043e\u0436\u043d\u0456\u0439",some:"\u0434\u0435\u044f\u043a\u0456","starts with":"\u043f\u043e\u0447\u0438\u043d\u0430\u0454\u0442\u044c\u0441\u044f_\u0437","ends with":"\u0437\u0430\u043a\u0456\u043d\u0447\u0443\u0454\u0442\u044c\u0441\u044f_\u043d\u0430","ignoring case":"\u0431\u0435\u0437_\u0443\u0440\u0430\u0445\u0443\u0432\u0430\u043d\u043d\u044f_\u0440\u0435\u0433\u0456\u0441\u0442\u0440\u0443","sorted by":"\u0432\u0456\u0434\u0441\u043e\u0440\u0442\u043e\u0432\u0430\u043d\u043e_\u0437\u0430","mapped to":"\u043f\u0435\u0440\u0435\u0442\u0432\u043e\u0440\u0435\u043d\u043e_\u043d\u0430","split by":"\u0440\u043e\u0437\u0434\u0456\u043b\u0435\u043d\u043e_\u0437\u0430","joined by":"\u043e\u0431'\u0454\u0434\u043d\u0430\u043d\u043e_\u0447\u0435\u0440\u0435\u0437"}};pl(Wl,"uk",{allowEnglishFallback:!0});var Dl={commands:{on:"\u092a\u0930",tell:"\u092c\u0924\u093e\u090f\u0902",trigger:"\u091f\u094d\u0930\u093f\u0917\u0930",send:"\u092d\u0947\u091c\u0947\u0902",take:"\u0932\u0947\u0902",put:"\u0930\u0916\u0947\u0902",set:"\u0938\u0947\u091f",get:"\u092a\u094d\u0930\u093e\u092a\u094d\u0924",add:"\u091c\u094b\u0921\u093c\u0947\u0902",remove:"\u0939\u091f\u093e\u090f\u0902",toggle:"\u091f\u0949\u0917\u0932",hide:"\u091b\u093f\u092a\u093e\u090f\u0902",show:"\u0926\u093f\u0916\u093e\u090f\u0902",if:"\u0905\u0917\u0930",unless:"\u091c\u092c \u0924\u0915 \u0928\u0939\u0940\u0902",repeat:"\u0926\u094b\u0939\u0930\u093e\u090f\u0902",for:"\u0939\u0947\u0924\u0941",while:"\u091c\u092c \u0924\u0915",until:"\u0924\u0915",continue:"\u091c\u093e\u0930\u0940",break:"\u0930\u094b\u0915\u0947\u0902",halt:"\u0930\u094b\u0915\u0947\u0902",wait:"\u092a\u094d\u0930\u0924\u0940\u0915\u094d\u0937\u093e",fetch:"\u0932\u093e\u090f\u0902",call:"\u0915\u0949\u0932",return:"\u0932\u094c\u091f\u093e\u090f\u0902",make:"\u092c\u0928\u093e\u090f\u0902",log:"\u0932\u0949\u0917",throw:"\u092b\u0947\u0902\u0915\u0947\u0902",catch:"\u092a\u0915\u0921\u093c\u0947\u0902",measure:"\u092e\u093e\u092a\u0947\u0902",transition:"\u0938\u0902\u0915\u094d\u0930\u092e\u0923",increment:"\u092c\u0922\u093c\u093e\u090f\u0902",decrement:"\u0918\u091f\u093e\u090f\u0902",default:"\u0921\u093f\u092b\u093c\u0949\u0932\u094d\u091f",go:"\u091c\u093e\u090f\u0902",pushUrl:"url_\u091c\u094b\u0921\u093c\u0947\u0902",replaceUrl:"url_\u092c\u0926\u0932\u0947\u0902",copy:"\u0915\u0949\u092a\u0940",pick:"\u091a\u0941\u0928\u0947\u0902",beep:"\u092c\u0940\u092a",js:"\u091c\u0947\u090f\u0938",async:"\u0905\u0938\u093f\u0902\u0915",render:"\u0930\u0947\u0902\u0921\u0930",swap:"\u0935\u093f\u0928\u093f\u092e\u092f",morph:"\u0930\u0942\u092a\u093e\u0902\u0924\u0930",settle:"\u0938\u094d\u0925\u093f\u0930",append:"\u0938\u0902\u0932\u0917\u094d\u0928",exit:"\u092c\u093e\u0939\u0930",else:"\u0935\u0930\u0928\u093e",install:"\u0907\u0902\u0938\u094d\u091f\u0949\u0932",init:"\u092a\u094d\u0930\u093e\u0930\u0902\u092d",behavior:"\u0935\u094d\u092f\u0935\u0939\u093e\u0930",focus:"\u092b\u094b\u0915\u0938",blur:"\u0927\u0941\u0902\u0927\u0932\u093e",clone:"\u0915\u094d\u0932\u094b\u0928",prepend:"\u091c\u094b\u0921\u093c\u0947\u0902_\u0936\u0941\u0930\u0942",breakpoint:"\u092c\u094d\u0930\u0947\u0915\u092a\u094d\u0935\u093e\u0907\u0902\u091f",clear:"\u0938\u093e\u092b\u093c-\u0915\u0930\u0947\u0902",close:"\u092c\u0902\u0926-\u0915\u0930\u0947\u0902",open:"\u0916\u094b\u0932\u0947\u0902",select:"\u091a\u093f\u0939\u094d\u0928\u093f\u0924-\u0915\u0930\u0947\u0902",socket:"\u0938\u0949\u0915\u0947\u091f"},modifiers:{to:"\u0915\u094b",from:"\u0938\u0947",into:"\u092e\u0947\u0902",with:"\u0915\u0947_\u0938\u093e\u0925",at:"\u092a\u0930",in:"\u092e\u0947\u0902",of:"\u0915\u093e",as:"\u0915\u0947_\u0930\u0942\u092a_\u092e\u0947\u0902",by:"\u0926\u094d\u0935\u093e\u0930\u093e",before:"\u0938\u0947 \u092a\u0939\u0932\u0947",after:"\u0915\u0947 \u092c\u093e\u0926",over:"\u0915\u0947_\u090a\u092a\u0930",under:"\u0915\u0947_\u0928\u0940\u091a\u0947",between:"\u0915\u0947_\u092c\u0940\u091a",through:"\u0915\u0947_\u092e\u093e\u0927\u094d\u092f\u092e_\u0938\u0947",without:"\u0915\u0947_\u092c\u093f\u0928\u093e",on:"\u092a\u0930"},events:{click:"\u0915\u094d\u0932\u093f\u0915",dblclick:"\u0921\u092c\u0932_\u0915\u094d\u0932\u093f\u0915",mousedown:"\u092e\u093e\u0909\u0938\u0928\u0940\u091a\u0947",mouseup:"\u092e\u093e\u0909\u0938\u090a\u092a\u0930",mouseenter:"\u092e\u093e\u0909\u0938_\u092a\u094d\u0930\u0935\u0947\u0936",mouseleave:"\u092e\u093e\u0909\u0938_\u092c\u093e\u0939\u0930",mouseover:"\u092e\u093e\u0909\u0938_\u0913\u0935\u0930",mouseout:"\u092e\u093e\u0909\u0938_\u0906\u0909\u091f",mousemove:"\u092e\u093e\u0909\u0938_\u092e\u0942\u0935",keydown:"\u0915\u0940_\u0928\u0940\u091a\u0947",keyup:"\u0915\u0940_\u090a\u092a\u0930",keypress:"\u0915\u0940_\u092a\u094d\u0930\u0947\u0938",focus:"\u092b\u094b\u0915\u0938",blur:"\u0927\u0941\u0902\u0927\u0932\u093e",change:"\u092a\u0930\u093f\u0935\u0930\u094d\u0924\u0928",input:"\u0907\u0928\u092a\u0941\u091f",submit:"\u091c\u092e\u093e",reset:"\u0930\u0940\u0938\u0947\u091f",load:"\u0932\u094b\u0921",unload:"\u0905\u0928\u0932\u094b\u0921",resize:"\u0906\u0915\u093e\u0930_\u092c\u0926\u0932\u0947\u0902",scroll:"\u0938\u094d\u0915\u094d\u0930\u0949\u0932",touchstart:"\u091f\u091a_\u0936\u0941\u0930\u0942",touchend:"\u091f\u091a_\u0938\u092e\u093e\u092a\u094d\u0924",touchmove:"\u091f\u091a_\u092e\u0942\u0935",touchcancel:"\u091f\u091a_\u0930\u0926\u094d\u0926"},logical:{when:"\u091c\u092c",where:"\u0915\u0939\u093e\u0901",and:"\u0914\u0930",or:"\u092f\u093e",not:"\u0928\u0939\u0940\u0902",is:"\u0939\u0948",exists:"\u092e\u094c\u091c\u0942\u0926",matches:"\u092e\u0947\u0932 \u0916\u093e\u0924\u093e",contains:"\u0936\u093e\u092e\u093f\u0932",includes:"\u092e\u0947\u0902_\u0939\u0948",equals:"\u092c\u0930\u093e\u092c\u0930",then:"\u092b\u093f\u0930",else:"\u0935\u0930\u0928\u093e",otherwise:"\u0905\u0928\u094d\u092f\u0925\u093e",end:"\u0938\u092e\u093e\u092a\u094d\u0924",live:"\u0932\u093e\u0907\u0935",changes:"\u092c\u0926\u0932\u0928\u0947 \u092a\u0930",has:"\u0939\u0948",have:"\u0939\u0948",isNot:"\u0928\u0939\u0940\u0902_\u0939\u0948",empty:"\u0916\u093e\u0932\u0940"},temporal:{seconds:"\u0938\u0947\u0915\u0902\u0921",second:"\u0938\u0947\u0915\u0902\u0921",milliseconds:"\u092e\u093f\u0932\u0940\u0938\u0947\u0915\u0902\u0921",millisecond:"\u092e\u093f\u0932\u0940\u0938\u0947\u0915\u0902\u0921",minutes:"\u092e\u093f\u0928\u091f",minute:"\u092e\u093f\u0928\u091f",hours:"\u0918\u0902\u091f\u0947",hour:"\u0918\u0902\u091f\u093e",ms:"\u092e\u093f\u0938\u0947",s:"\u0938\u0947",min:"\u092e\u093f",h:"\u0918\u0902",forever:"\u0939\u092e\u0947\u0936\u093e",once:"\u090f\u0915_\u092c\u093e\u0930",every:"\u0939\u0930",until:"\u0924\u0915"},values:{true:"\u0938\u091a",false:"\u091d\u0942\u0920",null:"\u0916\u093e\u0932\u0940",undefined:"\u0905\u092a\u0930\u093f\u092d\u093e\u0937\u093f\u0924",it:"\u092f\u0939",its:"\u0907\u0938\u0915\u093e",me:"\u092e\u0948\u0902",my:"\u092e\u0947\u0930\u093e",you:"\u0906\u092a",your:"\u0906\u092a\u0915\u093e",yourself:"\u0938\u094d\u0935\u092f\u0902",myself:"\u092e\u0948\u0902_\u0938\u094d\u0935\u092f\u0902",element:"\u0924\u0924\u094d\u0935",target:"\u0932\u0915\u094d\u0937\u094d\u092f",detail:"\u0935\u093f\u0935\u0930\u0923",event:"\u0918\u091f\u0928\u093e",window:"\u0935\u093f\u0902\u0921\u094b",document:"\u0926\u0938\u094d\u0924\u093e\u0935\u0947\u091c\u093c",body:"\u092c\u0949\u0921\u0940",result:"\u092a\u0930\u093f\u0923\u093e\u092e",value:"\u092e\u093e\u0928",first:"\u092a\u0939\u0932\u093e",last:"\u0905\u0902\u0924\u093f\u092e",next:"\u0905\u0917\u0932\u093e",previous:"\u092a\u093f\u091b\u0932\u093e",closest:"\u0928\u093f\u0915\u091f\u0924\u092e",parent:"\u092e\u0942\u0932"},attributes:{class:"\u0915\u094d\u0932\u093e\u0938",classes:"\u0915\u094d\u0932\u093e\u0938\u0947\u0938",style:"\u0938\u094d\u091f\u093e\u0907\u0932",styles:"\u0938\u094d\u091f\u093e\u0907\u0932\u094d\u0938",attribute:"\u0917\u0941\u0923",attributes:"\u0917\u0941\u0923",property:"\u0938\u0902\u092a\u0924\u094d\u0924\u093f",properties:"\u0938\u0902\u092a\u0924\u094d\u0924\u093f\u092f\u093e\u0901",disabled:"\u0905\u0915\u094d\u0937\u092e",hidden:"\u091b\u093f\u092a\u093e",checked:"\u091a\u0947\u0915",selected:"\u091a\u092f\u0928\u093f\u0924",readonly:"\u0915\u0947\u0935\u0932_\u092a\u0922\u093c\u0928\u0947",required:"\u0906\u0935\u0936\u094d\u092f\u0915",text:"\u092a\u093e\u0920",html:"html"},expressions:{characters:"\u0905\u0915\u094d\u0937\u0930",first:"\u092a\u0939\u0932\u093e",last:"\u0905\u0902\u0924\u093f\u092e",next:"\u0905\u0917\u0932\u093e",previous:"\u092a\u093f\u091b\u0932\u093e",prev:"\u092a\u093f\u091b",at:"\u092a\u0930",random:"\u092f\u093e\u0926\u0943\u091a\u094d\u091b\u093f\u0915",closest:"\u0928\u093f\u0915\u091f\u0924\u092e",parent:"\u092e\u0942\u0932",children:"\u092c\u091a\u094d\u091a\u0947",within:"\u0915\u0947_\u0905\u0902\u0926\u0930",no:"\u0928\u0939\u0940\u0902",empty:"\u0916\u093e\u0932\u0940",some:"\u0915\u0941\u091b","starts with":"\u0938\u0947_\u0936\u0941\u0930\u0942","ends with":"\u092a\u0930_\u0938\u092e\u093e\u092a\u094d\u0924","ignoring case":"\u0915\u0947\u0938_\u0905\u0928\u0926\u0947\u0916\u093e","sorted by":"\u0926\u094d\u0935\u093e\u0930\u093e_\u0915\u094d\u0930\u092e\u092c\u0926\u094d\u0927","mapped to":"\u092e\u0947\u0902_\u092a\u0930\u093f\u0935\u0930\u094d\u0924\u093f\u0924","split by":"\u0926\u094d\u0935\u093e\u0930\u093e_\u0935\u093f\u092d\u093e\u091c\u093f\u0924","joined by":"\u0926\u094d\u0935\u093e\u0930\u093e_\u091c\u0941\u0921\u093c\u093e"}};pl(Dl,"hi",{allowEnglishFallback:!0});var Fl={commands:{on:"\u09a4\u09c7",toggle:"\u099f\u0997\u09b2",add:"\u09af\u09cb\u0997",remove:"\u09b8\u09b0\u09be\u09a8",set:"\u09b8\u09c7\u099f",get:"\u09aa\u09be\u09a8",put:"\u09b0\u09be\u0996\u09c1\u09a8",take:"\u09a8\u09bf\u09a8",show:"\u09a6\u09c7\u0996\u09be\u09a8",hide:"\u09b2\u09c1\u0995\u09be\u09a8",increment:"\u09ac\u09c3\u09a6\u09cd\u09a7\u09bf",decrement:"\u09b9\u09cd\u09b0\u09be\u09b8",if:"\u09af\u09a6\u09bf",else:"\u09a8\u09a4\u09c1\u09ac\u09be",repeat:"\u09aa\u09c1\u09a8\u09b0\u09be\u09ac\u09c3\u09a4\u09cd\u09a4\u09bf",for:"\u099c\u09a8\u09cd\u09af",while:"\u09af\u09a4\u0995\u09cd\u09b7\u09a3",wait:"\u0985\u09aa\u09c7\u0995\u09cd\u09b7\u09be",fetch:"\u0986\u09a8\u09c1\u09a8",call:"\u0995\u09b2",return:"\u09ab\u09bf\u09b0\u09c1\u09a8",log:"\u09b2\u0997",trigger:"\u099f\u09cd\u09b0\u09bf\u0997\u09be\u09b0",send:"\u09aa\u09be\u09a0\u09be\u09a8",go:"\u09af\u09be\u09a8",halt:"\u09a5\u09be\u09ae\u09c1\u09a8",throw:"\u09a8\u09bf\u0995\u09cd\u09b7\u09c7\u09aa",continue:"\u099a\u09be\u09b2\u09bf\u09af\u09bc\u09c7 \u09af\u09be\u09a8",make:"\u09a4\u09c8\u09b0\u09bf \u0995\u09b0\u09c1\u09a8",append:"\u099c\u09c1\u09a1\u09bc\u09c1\u09a8",prepend:"\u09b6\u09c1\u09b0\u09c1\u09a4\u09c7 \u09af\u09cb\u0997",focus:"\u09ab\u09cb\u0995\u09be\u09b8",blur:"\u099d\u09be\u09aa\u09b8\u09be",transition:"\u09b8\u0982\u0995\u09cd\u09b0\u09ae\u09a3",settle:"\u09b8\u09cd\u09a5\u09bf\u09b0",measure:"\u09ae\u09be\u09aa\u09c1\u09a8",async:"\u0985\u09cd\u09af\u09be\u09b8\u09bf\u0999\u09cd\u0995",tell:"\u09ac\u09b2\u09c1\u09a8",default:"\u09a1\u09bf\u09ab\u09b2\u09cd\u099f",init:"\u09b6\u09c1\u09b0\u09c1",behavior:"\u0986\u099a\u09b0\u09a3",install:"\u0987\u09a8\u09b8\u09cd\u099f\u09b2",clone:"\u0995\u09cd\u09b2\u09cb\u09a8",swap:"\u09ac\u09a6\u09b2",morph:"\u09b0\u09c2\u09aa\u09be\u09a8\u09cd\u09a4\u09b0",beep:"\u09ac\u09c0\u09aa",break:"\u09ad\u09be\u0999\u09c1\u09a8",copy:"\u0995\u09aa\u09bf",exit:"\u09ac\u09c7\u09b0",js:"\u099c\u09c7\u098f\u09b8",pick:"\u09ac\u09be\u099b\u09c1\u09a8",render:"\u09b0\u09c7\u09a8\u09cd\u09a1\u09be\u09b0",until:"\u09aa\u09b0\u09cd\u09af\u09a8\u09cd\u09a4",breakpoint:"\u09ac\u09cd\u09b0\u09c7\u0995\u09aa\u09af\u09bc\u09c7\u09a8\u09cd\u099f",clear:"\u09aa\u09b0\u09bf\u09b7\u09cd\u0995\u09be\u09b0",close:"\u09ac\u09a8\u09cd\u09a7",open:"\u0996\u09c1\u09b2\u09c1\u09a8",select:"\u09a8\u09bf\u09b0\u09cd\u09ac\u09be\u099a\u09a8",socket:"\u09b8\u0995\u09c7\u099f"},modifiers:{to:"\u0995\u09c7",from:"\u09a5\u09c7\u0995\u09c7",into:"\u09a4\u09c7",on:"\u09a4\u09c7",with:"\u09b8\u09be\u09a5\u09c7",by:"\u09a6\u09cd\u09ac\u09be\u09b0\u09be",as:"\u09b9\u09bf\u09b8\u09be\u09ac\u09c7",before:"\u0986\u0997\u09c7",after:"\u09aa\u09b0\u09c7",at:"\u098f",in:"\u098f",over:"\u0989\u09aa\u09b0",between:"\u09ae\u09a7\u09cd\u09af\u09c7",then:"\u09a4\u09be\u09b0\u09aa\u09b0",and:"\u098f\u09ac\u0982",end:"\u09b6\u09c7\u09b7",until:"\u09aa\u09b0\u09cd\u09af\u09a8\u09cd\u09a4",of:"\u09b0"},events:{click:"\u0995\u09cd\u09b2\u09bf\u0995",change:"\u09aa\u09b0\u09bf\u09ac\u09b0\u09cd\u09a4\u09a8",input:"\u0987\u09a8\u09aa\u09c1\u099f",submit:"\u099c\u09ae\u09be",load:"\u09b2\u09cb\u09a1",focus:"\u09ab\u09cb\u0995\u09be\u09b8",blur:"\u099d\u09be\u09aa\u09b8\u09be",reset:"\u09b0\u09bf\u09b8\u09c7\u099f",keydown:"keydown",keyup:"keyup",mouseover:"mouseover",mouseout:"mouseout",scroll:"\u09b8\u09cd\u0995\u09cd\u09b0\u09cb\u09b2",resize:"\u09b0\u09bf\u09b8\u09be\u0987\u099c",every:"\u09aa\u09cd\u09b0\u09a4\u09bf"},logical:{if:"\u09af\u09a6\u09bf",when:"\u09af\u0996\u09a8",where:"\u0995\u09cb\u09a5\u09be\u09af\u09bc",else:"\u09a8\u09a4\u09c1\u09ac\u09be",not:"\u09a8\u09be",and:"\u098f\u09ac\u0982",or:"\u0985\u09a5\u09ac\u09be",is:"\u09b9\u09af\u09bc",exists:"\u0986\u099b\u09c7",has:"\u0986\u099b\u09c7",have:"\u0986\u099b\u09bf",empty:"\u0996\u09be\u09b2\u09bf",true:"\u09b8\u09a4\u09cd\u09af",false:"\u09ae\u09bf\u09a5\u09cd\u09af\u09be",null:"\u09b6\u09c2\u09a8\u09cd\u09af",undefined:"\u0985\u09a8\u09bf\u09b0\u09cd\u09a7\u09be\u09b0\u09bf\u09a4",end:"\u09b6\u09c7\u09b7",then:"\u09a4\u09be\u09b0\u09aa\u09b0",live:"\u09b2\u09be\u0987\u09ad",bind:"\u09ac\u09be\u0987\u09a8\u09cd\u09a1",changes:"\u09aa\u09b0\u09bf\u09ac\u09b0\u09cd\u09a4\u09bf\u09a4 \u09b9\u09b2\u09c7"},temporal:{now:"\u098f\u0996\u09a8",seconds:"\u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1",milliseconds:"\u09ae\u09bf\u09b2\u09bf\u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1",minutes:"\u09ae\u09bf\u09a8\u09bf\u099f",hours:"\u0998\u09a3\u09cd\u099f\u09be",forever:"\u099a\u09bf\u09b0\u0995\u09be\u09b2",times:"\u09ac\u09be\u09b0",s:"\u09b8\u09c7",ms:"\u09ae\u09bf\u09b8\u09c7"},values:{me:"\u0986\u09ae\u09bf",my:"\u0986\u09ae\u09be\u09b0",it:"\u098f\u099f\u09bf",its:"\u098f\u09b0",result:"\u09ab\u09b2\u09be\u09ab\u09b2",event:"\u0998\u099f\u09a8\u09be",target:"\u09b2\u0995\u09cd\u09b7\u09cd\u09af",body:"\u09ac\u09a1\u09bf",you:"\u0986\u09aa\u09a8\u09bf",your:"\u09a4\u09cb\u09ae\u09be\u09b0"},attributes:{class:"\u09b6\u09cd\u09b0\u09c7\u09a3\u09bf",id:"\u0986\u0987\u09a1\u09bf",style:"\u09b6\u09c8\u09b2\u09c0",value:"\u09ae\u09be\u09a8",text:"\u09aa\u09be\u09a0\u09cd\u09af",html:"\u098f\u0987\u099a\u099f\u09bf\u098f\u09ae\u098f\u09b2",disabled:"\u0985\u0995\u09cd\u09b7\u09ae",checked:"\u099a\u09c7\u0995 \u0995\u09b0\u09be"},expressions:{characters:"\u0985\u0995\u09cd\u09b7\u09b0",inclusive:"\u0985\u09a8\u09cd\u09a4\u09b0\u09cd\u09ad\u09c1\u0995\u09cd\u09a4",exclusive:"\u09ac\u09be\u09a6",first:"\u09aa\u09cd\u09b0\u09a5\u09ae",last:"\u09b6\u09c7\u09b7",next:"\u09aa\u09b0\u09ac\u09b0\u09cd\u09a4\u09c0",previous:"\u0986\u0997\u09c7\u09b0",closest:"\u09a8\u09bf\u0995\u099f\u09a4\u09ae",parent:"\u09ae\u09c2\u09b2",children:"\u09b8\u09a8\u09cd\u09a4\u09be\u09a8",random:"\u098f\u09b2\u09cb\u09ae\u09c7\u09b2\u09cb",length:"\u09a6\u09c8\u09b0\u09cd\u0998\u09cd\u09af",index:"\u09b8\u09c2\u099a\u0995",empty:"\u0996\u09be\u09b2\u09bf-\u0995\u09b0\u09c1\u09a8","starts with":"\u09a6\u09bf\u09af\u09bc\u09c7_\u09b6\u09c1\u09b0\u09c1","ends with":"\u09a6\u09bf\u09af\u09bc\u09c7_\u09b6\u09c7\u09b7","ignoring case":"\u0995\u09c7\u09b8_\u0989\u09aa\u09c7\u0995\u09cd\u09b7\u09be","sorted by":"\u09a6\u09cd\u09ac\u09be\u09b0\u09be_\u09b8\u09be\u099c\u09be\u09a8\u09cb","mapped to":"\u09a4\u09c7_\u09b0\u09c2\u09aa\u09be\u09a8\u09cd\u09a4\u09b0\u09bf\u09a4","split by":"\u09a6\u09cd\u09ac\u09be\u09b0\u09be_\u09ac\u09bf\u09ad\u0995\u09cd\u09a4","joined by":"\u09a6\u09cd\u09ac\u09be\u09b0\u09be_\u09af\u09c1\u0995\u09cd\u09a4"}};pl(Fl,"bn",{allowEnglishFallback:!0});var Ul={commands:{on:"\u0e40\u0e21\u0e37\u0e48\u0e2d",toggle:"\u0e2a\u0e25\u0e31\u0e1a",add:"\u0e40\u0e1e\u0e34\u0e48\u0e21",remove:"\u0e25\u0e1a",set:"\u0e15\u0e31\u0e49\u0e07",get:"\u0e23\u0e31\u0e1a\u0e04\u0e48\u0e32",put:"\u0e43\u0e2a\u0e48",take:"\u0e23\u0e31\u0e1a",show:"\u0e41\u0e2a\u0e14\u0e07",hide:"\u0e0b\u0e48\u0e2d\u0e19",increment:"\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e04\u0e48\u0e32",decrement:"\u0e25\u0e14\u0e04\u0e48\u0e32",if:"\u0e16\u0e49\u0e32",else:"\u0e44\u0e21\u0e48\u0e07\u0e31\u0e49\u0e19",repeat:"\u0e17\u0e33\u0e0b\u0e49\u0e33",for:"\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a",while:"\u0e43\u0e19\u0e02\u0e13\u0e30\u0e17\u0e35\u0e48",wait:"\u0e23\u0e2d",fetch:"\u0e14\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25",call:"\u0e40\u0e23\u0e35\u0e22\u0e01",return:"\u0e04\u0e37\u0e19\u0e04\u0e48\u0e32",log:"\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01",trigger:"\u0e17\u0e23\u0e34\u0e01\u0e40\u0e01\u0e2d\u0e23\u0e4c",send:"\u0e2a\u0e48\u0e07",go:"\u0e44\u0e1b",halt:"\u0e2b\u0e22\u0e38\u0e14",throw:"\u0e42\u0e22\u0e19",continue:"\u0e15\u0e48\u0e2d\u0e44\u0e1b",make:"\u0e2a\u0e23\u0e49\u0e32\u0e07",append:"\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e17\u0e49\u0e32\u0e22",prepend:"\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e2b\u0e19\u0e49\u0e32",focus:"\u0e42\u0e1f\u0e01\u0e31\u0e2a",blur:"\u0e40\u0e1a\u0e25\u0e2d",transition:"\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e1c\u0e48\u0e32\u0e19",settle:"\u0e04\u0e07\u0e17\u0e35\u0e48",measure:"\u0e27\u0e31\u0e14",async:"\u0e2d\u0e30\u0e0b\u0e34\u0e07\u0e04\u0e4c",tell:"\u0e1a\u0e2d\u0e01",default:"\u0e04\u0e48\u0e32\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19",init:"\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19",behavior:"\u0e1e\u0e24\u0e15\u0e34\u0e01\u0e23\u0e23\u0e21",install:"\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07",clone:"\u0e42\u0e04\u0e25\u0e19",swap:"\u0e2a\u0e25\u0e31\u0e1a\u0e17\u0e35\u0e48",morph:"\u0e41\u0e1b\u0e25\u0e07\u0e23\u0e48\u0e32\u0e07",beep:"\u0e1a\u0e35\u0e4a\u0e1a",break:"\u0e02\u0e31\u0e14\u0e08\u0e31\u0e07\u0e2b\u0e27\u0e30",copy:"\u0e04\u0e31\u0e14\u0e25\u0e2d\u0e01",exit:"\u0e2d\u0e2d\u0e01",js:"\u0e40\u0e08\u0e40\u0e2d\u0e2a",pick:"\u0e40\u0e25\u0e37\u0e2d\u0e01",render:"\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25",until:"\u0e08\u0e19\u0e16\u0e36\u0e07",breakpoint:"\u0e08\u0e38\u0e14\u0e1e\u0e31\u0e01",clear:"\u0e40\u0e04\u0e25\u0e35\u0e22\u0e23\u0e4c",close:"\u0e1b\u0e34\u0e14",open:"\u0e40\u0e1b\u0e34\u0e14",select:"\u0e17\u0e33\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e2b\u0e21\u0e32\u0e22"},modifiers:{to:"\u0e44\u0e1b\u0e22\u0e31\u0e07",from:"\u0e08\u0e32\u0e01",into:"\u0e43\u0e19",on:"\u0e40\u0e21\u0e37\u0e48\u0e2d",with:"\u0e14\u0e49\u0e27\u0e22",by:"\u0e42\u0e14\u0e22",as:"\u0e40\u0e1b\u0e47\u0e19",before:"\u0e01\u0e48\u0e2d\u0e19",after:"\u0e2b\u0e25\u0e31\u0e07",at:"\u0e17\u0e35\u0e48",in:"\u0e43\u0e19",over:"\u0e40\u0e2b\u0e19\u0e37\u0e2d",between:"\u0e23\u0e30\u0e2b\u0e27\u0e48\u0e32\u0e07",then:"\u0e41\u0e25\u0e49\u0e27",and:"\u0e41\u0e25\u0e30",end:"\u0e08\u0e1a",until:"\u0e08\u0e19\u0e16\u0e36\u0e07",of:"\u0e02\u0e2d\u0e07"},events:{click:"\u0e04\u0e25\u0e34\u0e01",change:"\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e41\u0e1b\u0e25\u0e07",input:"\u0e2d\u0e34\u0e19\u0e1e\u0e38\u0e15",submit:"\u0e2a\u0e48\u0e07",load:"\u0e42\u0e2b\u0e25\u0e14",focus:"\u0e42\u0e1f\u0e01\u0e31\u0e2a",blur:"\u0e40\u0e1a\u0e25\u0e2d",reset:"\u0e23\u0e35\u0e40\u0e0b\u0e47\u0e15",keydown:"\u0e01\u0e14\u0e04\u0e35\u0e22\u0e4c",keyup:"\u0e1b\u0e25\u0e48\u0e2d\u0e22\u0e04\u0e35\u0e22\u0e4c",mouseover:"\u0e40\u0e21\u0e32\u0e2a\u0e4c\u0e40\u0e02\u0e49\u0e32",mouseout:"\u0e40\u0e21\u0e32\u0e2a\u0e4c\u0e2d\u0e2d\u0e01",scroll:"\u0e40\u0e25\u0e37\u0e48\u0e2d\u0e19",resize:"\u0e1b\u0e23\u0e31\u0e1a\u0e02\u0e19\u0e32\u0e14",every:"\u0e17\u0e38\u0e01"},logical:{if:"\u0e16\u0e49\u0e32",when:"\u0e40\u0e21\u0e37\u0e48\u0e2d",where:"\u0e17\u0e35\u0e48\u0e44\u0e2b\u0e19",else:"\u0e44\u0e21\u0e48\u0e07\u0e31\u0e49\u0e19",not:"\u0e44\u0e21\u0e48",and:"\u0e41\u0e25\u0e30",or:"\u0e2b\u0e23\u0e37\u0e2d",is:"\u0e40\u0e1b\u0e47\u0e19",exists:"\u0e21\u0e35\u0e2d\u0e22\u0e39\u0e48",has:"\u0e21\u0e35",have:"\u0e21\u0e35",empty:"\u0e27\u0e48\u0e32\u0e07",true:"\u0e08\u0e23\u0e34\u0e07",false:"\u0e40\u0e17\u0e47\u0e08",null:"\u0e27\u0e48\u0e32\u0e07",undefined:"\u0e44\u0e21\u0e48\u0e01\u0e33\u0e2b\u0e19\u0e14",end:"\u0e08\u0e1a",then:"\u0e41\u0e25\u0e49\u0e27",live:"\u0e2a\u0e14",changes:"\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19"},temporal:{now:"\u0e15\u0e2d\u0e19\u0e19\u0e35\u0e49",seconds:"\u0e27\u0e34\u0e19\u0e32\u0e17\u0e35",milliseconds:"\u0e21\u0e34\u0e25\u0e25\u0e34\u0e27\u0e34\u0e19\u0e32\u0e17\u0e35",minutes:"\u0e19\u0e32\u0e17\u0e35",hours:"\u0e0a\u0e31\u0e48\u0e27\u0e42\u0e21\u0e07",forever:"\u0e15\u0e25\u0e2d\u0e14\u0e44\u0e1b",times:"\u0e04\u0e23\u0e31\u0e49\u0e07",s:"\u0e27\u0e34",ms:"\u0e21\u0e27"},values:{me:"\u0e09\u0e31\u0e19",my:"\u0e02\u0e2d\u0e07\u0e09\u0e31\u0e19",it:"\u0e21\u0e31\u0e19",its:"\u0e02\u0e2d\u0e07\u0e21\u0e31\u0e19",result:"\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c",event:"\u0e40\u0e2b\u0e15\u0e38\u0e01\u0e32\u0e23\u0e13\u0e4c",target:"\u0e40\u0e1b\u0e49\u0e32\u0e2b\u0e21\u0e32\u0e22",body:"\u0e1a\u0e2d\u0e14\u0e35\u0e49",you:"\u0e04\u0e38\u0e13",your:"\u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13"},attributes:{class:"\u0e04\u0e25\u0e32\u0e2a",id:"\u0e44\u0e2d\u0e14\u0e35",style:"\u0e2a\u0e44\u0e15\u0e25\u0e4c",value:"\u0e04\u0e48\u0e32",text:"\u0e02\u0e49\u0e2d\u0e04\u0e27\u0e32\u0e21",html:"\u0e40\u0e2d\u0e0a\u0e17\u0e35\u0e40\u0e2d\u0e47\u0e21\u0e41\u0e2d\u0e25",disabled:"\u0e1b\u0e34\u0e14\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19",checked:"\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e41\u0e25\u0e49\u0e27"},expressions:{characters:"\u0e2d\u0e31\u0e01\u0e02\u0e23\u0e30",inclusive:"\u0e23\u0e27\u0e21",exclusive:"\u0e22\u0e01\u0e40\u0e27\u0e49\u0e19",first:"\u0e41\u0e23\u0e01",last:"\u0e2a\u0e38\u0e14\u0e17\u0e49\u0e32\u0e22",next:"\u0e16\u0e31\u0e14\u0e44\u0e1b",previous:"\u0e01\u0e48\u0e2d\u0e19\u0e2b\u0e19\u0e49\u0e32",closest:"\u0e43\u0e01\u0e25\u0e49\u0e2a\u0e38\u0e14",parent:"\u0e15\u0e49\u0e19\u0e17\u0e32\u0e07",children:"\u0e25\u0e39\u0e01",random:"\u0e2a\u0e38\u0e48\u0e21",length:"\u0e04\u0e27\u0e32\u0e21\u0e22\u0e32\u0e27",index:"\u0e14\u0e31\u0e0a\u0e19\u0e35",empty:"\u0e25\u0e49\u0e32\u0e07","starts with":"\u0e02\u0e36\u0e49\u0e19\u0e15\u0e49\u0e19\u0e14\u0e49\u0e27\u0e22","ends with":"\u0e25\u0e07\u0e17\u0e49\u0e32\u0e22\u0e14\u0e49\u0e27\u0e22","ignoring case":"\u0e44\u0e21\u0e48\u0e2a\u0e19\u0e15\u0e31\u0e27\u0e1e\u0e34\u0e21\u0e1e\u0e4c","sorted by":"\u0e40\u0e23\u0e35\u0e22\u0e07\u0e15\u0e32\u0e21","mapped to":"\u0e41\u0e1b\u0e25\u0e07\u0e40\u0e1b\u0e47\u0e19","split by":"\u0e41\u0e22\u0e01\u0e14\u0e49\u0e27\u0e22","joined by":"\u0e23\u0e27\u0e21\u0e14\u0e49\u0e27\u0e22"}};pl(Ul,"th",{allowEnglishFallback:!0});var Kl={commands:{on:"apabila",tell:"beritahu",trigger:"cetuskan",send:"hantar",take:"ambil",put:"letak",set:"tetapkan",get:"dapatkan",add:"tambah",remove:"buang",toggle:"togol",hide:"sembunyi",show:"tunjuk",if:"jika",unless:"kecuali",repeat:"ulang",for:"untuk",while:"selagi",until:"sehingga",continue:"teruskan",break:"henti",halt:"henti",wait:"tunggu",fetch:"ambil_dari",call:"panggil",return:"pulang",make:"buat",log:"catat",throw:"lempar",catch:"tangkap",measure:"ukur",transition:"peralihan",increment:"tambah_satu",decrement:"kurang_satu",default:"lalai",go:"pergi",pushUrl:"tolak_url",replaceUrl:"ganti_url",copy:"salin",pick:"pilih",beep:"bunyi",js:"js",async:"tak_segerak",render:"papar",swap:"tukar_tempat",morph:"ubah_bentuk",settle:"selesai",append:"tambah_hujung",prepend:"tambah_mula",exit:"keluar",else:"kalau_tidak",focus:"fokus",blur:"kabur",install:"pasang",behavior:"kelakuan",init:"mula",clone:"klon",breakpoint:"titik-henti",clear:"bersihkan",close:"tutup",open:"buka",select:"tandai",socket:"soket"},modifiers:{to:"ke",from:"dari",into:"ke_dalam",with:"dengan",at:"di",in:"dalam",of:"daripada",as:"sebagai",by:"oleh",before:"sebelum",after:"selepas",over:"atas",under:"bawah",between:"antara",through:"melalui",without:"tanpa",on:"pada",then:"kemudian",and:"dan",end:"tamat",until:"sehingga"},events:{click:"click",dblclick:"dblclick",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"mouseover",mouseout:"mouseout",mousemove:"mousemove",keydown:"keydown",keyup:"keyup",keypress:"keypress",focus:"focus",blur:"blur",change:"change",input:"input",submit:"submit",reset:"reset",load:"load",unload:"unload",resize:"resize",scroll:"scroll",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",touchcancel:"touchcancel",every:"setiap"},logical:{when:"apabila",where:"di_mana",and:"dan",or:"atau",not:"bukan",is:"adalah",exists:"wujud",matches:"sepadan",contains:"mengandungi",includes:"termasuk",equals:"sama",has:"ada",have:"ada",then:"kemudian",else:"kalau_tidak",otherwise:"jika_tidak",end:"tamat",live:"langsung",changes:"berubah",if:"jika",empty:"kosong",true:"benar",false:"salah",null:"null",undefined:"tidak_ditakrifkan"},temporal:{seconds:"saat",second:"saat",milliseconds:"milisaat",millisecond:"milisaat",minutes:"minit",minute:"minit",hours:"jam",hour:"jam",ms:"ms",s:"s",min:"min",h:"j",now:"sekarang",forever:"selamanya",times:"kali"},values:{true:"benar",false:"salah",null:"null",undefined:"tidak_ditakrifkan",it:"ia",its:"nya",me:"saya",my:"saya_punya",myself:"diri_saya",you:"kamu",your:"kamu_punya",yourself:"diri_kamu",element:"elemen",target:"sasaran",detail:"perincian",event:"peristiwa",window:"tetingkap",document:"dokumen",body:"badan",result:"hasil",value:"nilai"},attributes:{class:"kelas",classes:"kelas_kelas",style:"gaya",styles:"gaya_gaya",attribute:"atribut",attributes:"atribut_atribut",property:"sifat",properties:"sifat_sifat",id:"id",value:"nilai",text:"teks",html:"html",disabled:"dilumpuhkan",checked:"ditanda"},expressions:{characters:"aksara",inclusive:"inklusif",exclusive:"eksklusif",first:"pertama",last:"terakhir",next:"seterusnya",previous:"sebelumnya",prev:"sebelum",at:"di",random:"rawak",closest:"terdekat",parent:"induk",children:"anak_anak",within:"dalam",no:"tiada",empty:"kosong",some:"beberapa","starts with":"bermula_dengan","ends with":"berakhir_dengan","ignoring case":"abaikan_huruf_besar_kecil","sorted by":"disusun_mengikut","mapped to":"dipetakan_ke","split by":"dipecah_oleh","joined by":"digabung_oleh",length:"panjang",index:"indeks"}};pl(Kl,"ms",{allowEnglishFallback:!0});var Zl={commands:{on:"kapag",tell:"sabihin",trigger:"palitawin",send:"ipadala",take:"kumuha",put:"ilagay",set:"itakda",get:"kunin",add:"idagdag",remove:"alisin",toggle:"palitan",hide:"itago",show:"ipakita",if:"kung",unless:"maliban_kung",repeat:"ulitin",for:"para_sa",while:"habang",until:"hanggang",continue:"magpatuloy",break:"itigil",halt:"huminto",wait:"maghintay",fetch:"kuhanin_mula",call:"tawagin",return:"ibalik",make:"gumawa",log:"itala",throw:"ihagis",catch:"hulihin",measure:"sukatin",transition:"lumipat",increment:"dagdagan",decrement:"bawasan",default:"pamantayan",go:"pumunta",pushUrl:"itulak_url",replaceUrl:"palitan_url",copy:"kopyahin",pick:"pumili",beep:"tunog",js:"js",async:"sabay",render:"irender",swap:"palitan_pwesto",morph:"baguhin",settle:"magpatahimik",append:"idagdag_sa_dulo",prepend:"idagdag_sa_simula",exit:"lumabas",else:"kung_hindi",focus:"ituon",blur:"alisin_tuon",install:"ikabit",behavior:"ugali",init:"simulan",clone:"i-clone",breakpoint:"breakpoint",clear:"burahin",close:"isara",open:"buksan",select:"piliin"},modifiers:{to:"sa",from:"mula_sa",into:"papasok_sa",with:"kasama",at:"sa",in:"sa_loob",of:"ng",as:"bilang",by:"sa_pamamagitan_ng",before:"bago",after:"matapos",over:"sa_ibabaw",under:"sa_ilalim",between:"sa_pagitan",through:"sa_pamamagitan",without:"walang",on:"sa",then:"pagkatapos",and:"at",end:"wakas",until:"hanggang"},events:{click:"click",dblclick:"dblclick",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"mouseover",mouseout:"mouseout",mousemove:"mousemove",keydown:"keydown",keyup:"keyup",keypress:"keypress",focus:"focus",blur:"blur",change:"change",input:"input",submit:"submit",reset:"reset",load:"load",unload:"unload",resize:"resize",scroll:"scroll",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",touchcancel:"touchcancel",every:"bawat"},logical:{when:"kapag",where:"kung_saan",and:"at",or:"o",not:"hindi",is:"ay",exists:"may",matches:"tumutugma",contains:"naglalaman",includes:"kasama",equals:"katumbas",has:"may",have:"may",then:"pagkatapos",else:"kung_hindi",otherwise:"kung_hindi_man",end:"wakas",live:"live",changes:"nagbabago",if:"kung",empty:"walang_laman",true:"totoo",false:"mali",null:"wala",undefined:"hindi_tinukoy"},temporal:{seconds:"segundo",second:"segundo",milliseconds:"milisegundo",millisecond:"milisegundo",minutes:"minuto",minute:"minuto",hours:"oras",hour:"oras",ms:"ms",s:"s",min:"min",h:"h",now:"ngayon",forever:"magpakailanman",times:"beses"},values:{true:"totoo",false:"mali",null:"wala",undefined:"hindi_tinukoy",it:"ito",its:"nito",me:"ako",my:"aking",myself:"sarili_ko",you:"ikaw",your:"iyong",yourself:"sarili_mo",element:"elemento",target:"target",detail:"detalye",event:"pangyayari",window:"bintana",document:"dokumento",body:"katawan",result:"resulta",value:"halaga"},attributes:{class:"klase",classes:"mga_klase",style:"estilo",styles:"mga_estilo",attribute:"katangian",attributes:"mga_katangian",property:"ari_arian",properties:"mga_ari_arian",id:"id",value:"halaga",text:"teksto",html:"html",disabled:"hindi_pinagana",checked:"naka_tsek"},expressions:{characters:"karakter",inclusive:"kasama",exclusive:"bukod",first:"una",last:"huli",next:"susunod",previous:"nakaraan",prev:"nakaraan",at:"sa",random:"random",closest:"pinakamalapit",parent:"magulang",children:"mga_anak",within:"sa_loob_ng",no:"walang",empty:"walang_laman",some:"ilan","starts with":"nagsisimula_sa","ends with":"nagtatapos_sa","ignoring case":"huwag_pansinin_ang_case","sorted by":"nakaayos_ayon_sa","mapped to":"binago_sa","split by":"hinati_sa","joined by":"pinagsama_sa",length:"haba",index:"indeks"}};pl(Zl,"tl",{allowEnglishFallback:!0});var Xl={commands:{add:"\u05d4\u05d5\u05e1\u05e3",append:"\u05e6\u05e8\u05e3",async:"\u05d0\u05e1\u05d9\u05e0\u05db\u05e8\u05d5\u05e0\u05d9",beep:"\u05d1\u05d9\u05e4",break:"\u05e9\u05d1\u05d5\u05e8",call:"\u05e7\u05e8\u05d0",clear:"\u05e0\u05e7\u05d4",continue:"\u05d4\u05de\u05e9\u05da",copy:"\u05d4\u05e2\u05ea\u05e7",decrement:"\u05d4\u05e7\u05d8\u05df",default:"\u05d1\u05e8\u05d9\u05e8\u05ea \u05de\u05d7\u05d3\u05dc",exit:"\u05e6\u05d0",fetch:"\u05d4\u05d1\u05d0",for:"\u05e2\u05d1\u05d5\u05e8",get:"\u05e7\u05d1\u05dc",go:"\u05dc\u05da",halt:"\u05e2\u05e6\u05d5\u05e8",hide:"\u05d4\u05e1\u05ea\u05e8",if:"\u05d0\u05dd",unless:"\u05d0\u05dc\u05d0",increment:"\u05d4\u05d2\u05d3\u05dc",install:"\u05d4\u05ea\u05e7\u05df",js:"js",log:"\u05e8\u05e9\u05d5\u05dd",make:"\u05e6\u05d5\u05e8",measure:"\u05de\u05d3\u05d5\u05d3",morph:"\u05d4\u05e4\u05d5\u05da",on:"\u05d1",pick:"\u05d1\u05d7\u05e8",put:"\u05e9\u05d9\u05dd",remove:"\u05d4\u05e1\u05e8",render:"\u05e8\u05e0\u05d3\u05e8",repeat:"\u05d7\u05d6\u05d5\u05e8",return:"\u05d4\u05d7\u05d6\u05e8",scroll:"\u05d2\u05dc\u05d5\u05dc",send:"\u05e9\u05dc\u05d7",set:"\u05e7\u05d1\u05e2",settle:"\u05d4\u05ea\u05d9\u05d9\u05e6\u05d1",show:"\u05d4\u05e8\u05d0\u05d4",swap:"\u05d4\u05d7\u05dc\u05e3",take:"\u05e7\u05d7",tell:"\u05d0\u05de\u05d5\u05e8",throw:"\u05d6\u05e8\u05d5\u05e7",toggle:"\u05de\u05ea\u05d2",transition:"\u05de\u05e2\u05d1\u05e8",trigger:"\u05d4\u05e4\u05e2\u05dc",until:"\u05e2\u05d3",wait:"\u05d7\u05db\u05d4",while:"\u05db\u05dc \u05e2\u05d5\u05d3"},modifiers:{after:"\u05d0\u05d7\u05e8\u05d9",before:"\u05dc\u05e4\u05e0\u05d9",from:"\u05de",into:"\u05dc\u05ea\u05d5\u05da",to:"\u05e2\u05dc",with:"\u05e2\u05dd"},events:{blur:"\u05d8\u05e9\u05d8\u05e9",change:"\u05e9\u05d9\u05e0\u05d5\u05d9",click:"\u05dc\u05d7\u05d9\u05e6\u05d4",focus:"\u05de\u05e7\u05d3",input:"\u05e7\u05dc\u05d8",submit:"\u05e9\u05dc\u05d9\u05d7\u05d4"},logical:{and:"\u05d5\u05d2\u05dd",else:"\u05d0\u05d7\u05e8\u05ea",end:"\u05e1\u05d5\u05e3",then:"\u05d0\u05d6",live:"\u05d7\u05d9",bind:"\u05e7\u05e9\u05d5\u05e8",changes:"\u05de\u05e9\u05ea\u05e0\u05d4",when:"\u05db\u05d0\u05e9\u05e8",where:"\u05d0\u05d9\u05e4\u05d4"},temporal:{},values:{body:"\u05d2\u05d5\u05e3",event:"\u05d0\u05d9\u05e8\u05d5\u05e2",it:"\u05d6\u05d4",its:"\u05e9\u05dc\u05d5",me:"\u05d0\u05e0\u05d9",my:"\u05e9\u05dc\u05d9",result:"\u05ea\u05d5\u05e6\u05d0\u05d4",target:"\u05d9\u05e2\u05d3",you:"\u05d0\u05ea\u05d4",your:"\u05e9\u05dc\u05da"},attributes:{},expressions:{random:"\u05d0\u05e7\u05e8\u05d0\u05d9",characters:"\u05ea\u05d5\u05d5\u05d9\u05dd",inclusive:"\u05db\u05d5\u05dc\u05dc",exclusive:"\u05d1\u05dc\u05e2\u05d3\u05d9",last:"\u05d0\u05d7\u05e8\u05d5\u05df"}};pl(Xl,"he",{allowEnglishFallback:!0});var Gl=class e{static register(t,r){e.providers.set(t.toLowerCase(),r)}static unregister(t){e.providers.delete(t.toLowerCase())}static setDefault(t){const r=t.toLowerCase();if("en"!==r&&!e.providers.has(r))throw Error(`Locale '${t}' is not registered. Available locales: ${e.getAvailable().join(", ")}`);e.defaultLocale=r}static getDefault(){return e.defaultLocale}static get(t){const r=(t||e.defaultLocale).toLowerCase();if("en"===r)return e.englishProvider;const n=e.providers.get(r);if(!n)throw Error(`Locale '${r}' is not registered. Available locales: ${e.getAvailable().join(", ")}`);return n}static has(t){const r=t.toLowerCase();return"en"===r||e.providers.has(r)}static getAvailable(){return["en",...Array.from(e.providers.keys())]}static reset(){e.providers.clear(),e.defaultLocale="en"}static registerAll(t){for(const[r,n]of Object.entries(t))e.register(r,n)}};Gl.providers=new Map,Gl.defaultLocale="en",Gl.englishProvider=hl();var Jl=Gl;function Yl(e,t){const r=[],n=new Set;for(const i of t){const t=e.get(i);t&&(r.push(t),n.add(i))}for(const[t,i]of e)n.has(t)||r.push(i);return r}function Ql(e,t,r){const n=[];for(const i of e){let e=t.find(e=>e.role===i.role);"event"===e?.role&&/^[#.<@[]/.test(i.translated||i.value)&&(e=void 0),"duration"===e?.role&&/^(me|you|it)$/i.test(i.value)&&(e=void 0),e?"preposition"===r?(e.form&&n.push(e.form),n.push(i.translated||i.value)):"postposition"===r?(n.push(i.translated||i.value),e.form&&n.push(e.form)):n.push(i.translated||i.value):n.push(i.translated||i.value)}return n}function ec(e){if(0===e.length)return"";let t="";for(let r=0;e.length>r;r++){const n=e[r],i=e[r+1],a=n.endsWith("-"),s=n.startsWith("-");let o=n;if(a&&(o=n.slice(0,-1)),s&&(o=n.substring(1)),t+=o,i){const e=i.startsWith("-");a||e||(t+=" ")}}return t}function tc(e){return{name:"halt-call-fused-verb-final",description:"Split the swept `halt <operand> call <args>` blob; both verbs clause-final",priority:95,match:{commands:["halt"],requiredRoles:["action","event","patient"],predicate:t=>{const r=t.roles.get("patient");return!!r&&/\bcall\b/.test(r.value)&&!!r.translated&&r.translated.includes(e.callVerb)}},transform:{roleOrder:[],custom:t=>{const r=t.roles.get("patient"),n=t.roles.get("event"),i=t.roles.get("action");let a=(r.translated??r.value).trim();const s="EVENTBLOCKPLACEHOLDER";let o="";a.endsWith(s)&&(a=a.slice(0,-21).trim(),o=" "+s);const l=a.indexOf(e.callVerb),c=a.slice(0,l).trim(),u=a.slice(l+e.callVerb.length).trim();return[c,e.patientMarker,n.translated??n.value,e.eventMarker,i.translated??i.value,e.connective,u,e.patientMarker,e.callVerb].join(" ")+o}}}}function rc(e){return{name:"pick-range-verb-final",description:"Reassemble the pick range (unit + endpoints + root) adjacent, verb-final",priority:95,match:{commands:["pick"],requiredRoles:["action","patient","destination"],predicate:e=>{const t=e.roles.get("patient"),r=e.roles.get("destination");return!!t&&!!r&&/^\S+\s+\d+$/.test(t.value.trim())&&/^\d+\s+of\s+\S+$/.test(r.value.trim())}},transform:{roleOrder:[],custom:t=>{const r=t.roles.get("patient"),n=t.roles.get("destination"),i=t.roles.get("action"),a=t.roles.get("event"),s=(r.translated??r.value).trim().split(/\s+/),o=s[s.length-1],l=s.slice(0,-1).join(" "),c=n.value.trim().match(/^(\d+)\s+of\s+(\S+)$/);return[c[2],e.genitive,l,o,e.rangeSep,c[1],e.patientMarker,...a?[a.translated??a.value,e.eventMarker]:[],i.translated??i.value].join(" ")}}}}var nc={en:{code:"en",name:"English",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"ltr",canonicalOrder:["event","action","patient","source","destination","quantity","duration","method","style"],markers:[{form:"on",role:"event",position:"preposition",required:!0},{form:"to",role:"destination",position:"preposition",required:!1},{form:"into",role:"destination",position:"preposition",required:!1},{form:"from",role:"source",position:"preposition",required:!1},{form:"with",role:"style",position:"preposition",required:!1},{form:"by",role:"quantity",position:"preposition",required:!1},{form:"as",role:"method",position:"preposition",required:!1},{form:"over",role:"duration",position:"preposition",required:!1},{form:"for",role:"duration",position:"preposition",required:!1}]},ja:{code:"ja",name:"\u65e5\u672c\u8a9e",wordOrder:"SOV",adpositionType:"postposition",morphology:"agglutinative",direction:"ltr",canonicalOrder:["patient","event","action"],markers:[{form:"\u3092",role:"patient",position:"postposition",required:!0},{form:"\u306b",role:"destination",position:"postposition",required:!0},{form:"\u304b\u3089",role:"source",position:"postposition",required:!0},{form:"\u3067",role:"event",position:"postposition",required:!0},{form:"\u3067",role:"style",position:"postposition",required:!1},{form:"\u3068",role:"style",position:"postposition",required:!1},{form:"\u3078",role:"destination",position:"postposition",required:!1}],rules:[{name:"event-handler",description:"Transform event handlers to Japanese SOV order",priority:100,match:{commands:["on"],requiredRoles:["event","action"],optionalRoles:["patient"]},transform:{roleOrder:["patient","event","action"],insertMarkers:!0}},{name:"put-into",description:"Transform put X into Y to Japanese order",priority:90,match:{commands:["put","\u7f6e\u304f"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"set-to",description:"Transform set X to Y to Japanese verb-final order",priority:90,match:{commands:["set","\u8a2d\u5b9a"],requiredRoles:["action","patient","destination"],predicate:e=>!/(^|\s)end$/i.test((e.original??"").trim())},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"bind-to",description:"Transform bind $var to #el to Japanese verb-final order",priority:90,match:{commands:["bind","\u30d0\u30a4\u30f3\u30c9"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},tc({callVerb:"\u547c\u3073\u51fa\u3057",patientMarker:"\u3092",eventMarker:"\u3067",connective:"\u305d\u308c\u304b\u3089"}),rc({genitive:"\u306e",rangeSep:"\u304b\u3089",patientMarker:"\u3092",eventMarker:"\u3067"})]},ko:{code:"ko",name:"\ud55c\uad6d\uc5b4",wordOrder:"SOV",adpositionType:"postposition",morphology:"agglutinative",direction:"ltr",canonicalOrder:["patient","event","action"],markers:[{form:"\ub97c",role:"patient",position:"postposition",required:!0,alternatives:["\uc744"]},{form:"\uc5d0",role:"destination",position:"postposition",required:!0},{form:"\uc5d0\uc11c",role:"source",position:"postposition",required:!0},{form:"\ud560 \ub54c",role:"event",position:"postposition",required:!0},{form:"\ub85c",role:"style",position:"postposition",required:!1,alternatives:["\uc73c\ub85c"]},{form:"\uc640",role:"style",position:"postposition",required:!1,alternatives:["\uacfc"]},{form:"\ub85c",role:"method",position:"postposition",required:!1,alternatives:["\uc73c\ub85c"]}],rules:[{name:"event-handler",description:"Transform event handlers to Korean SOV order",priority:100,match:{commands:["on"],requiredRoles:["event","action"]},transform:{roleOrder:["patient","event","action"],insertMarkers:!0}},{name:"put-into",description:"Transform put X into Y to Korean verb-final order",priority:90,match:{commands:["put","\ub123\ub2e4"],requiredRoles:["action","patient","destination"],predicate:e=>!e.roles.has("event")},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"set-to",description:"Transform set X to Y to Korean verb-final order",priority:90,match:{commands:["set","\uc124\uc815"],requiredRoles:["action","patient","destination"],predicate:e=>!/(^|\s)end$/i.test((e.original??"").trim())},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"bind-to",description:"Transform bind $var to #el to Korean verb-final order",priority:90,match:{commands:["bind","\ubc14\uc778\ub4dc"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},tc({callVerb:"\ud638\ucd9c",patientMarker:"\ub97c",eventMarker:"\ud560 \ub54c",connective:"\uadf8\ub7ec\uba74"}),rc({genitive:"\uc758",rangeSep:"\ubd80\ud130",patientMarker:"\ub97c",eventMarker:"\ud560 \ub54c"})]},zh:{code:"zh",name:"\u4e2d\u6587",wordOrder:"SVO",adpositionType:"preposition",morphology:"isolating",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"\u5f53",role:"event",position:"preposition",required:!0},{form:"\u65f6",role:"event",position:"postposition",required:!0},{form:"\u628a",role:"patient",position:"preposition",required:!1},{form:"\u5230",role:"destination",position:"preposition",required:!1},{form:"\u4ece",role:"source",position:"preposition",required:!1},{form:"\u7528",role:"style",position:"preposition",required:!1},{form:"\u7684",role:"method",position:"postposition",required:!1}],rules:[{name:"event-handler-standard",description:"Standard event handler: \u5f53 X \u65f6 Y",priority:100,match:{requiredRoles:["event","action"]},transform:{roleOrder:["event","action","patient"],insertMarkers:!0,custom:(e,t)=>{const r=e.roles.get("event"),n=e.roles.get("action"),i=new Map(e.roles);i.delete("event"),i.delete("action");const a=Ql(Yl(i,(t.canonicalOrder||[]).filter(e=>"event"!==e&&"action"!==e)),t.markers,t.adpositionType),s=["\u5f53",r?.translated||r?.value||"","\u65f6"];return n&&s.push(n.translated||n.value),s.push(...a),s.filter(Boolean).join(" ")}}},{name:"ba-construction",description:"BA construction for object-fronting: \u628a X Y",priority:80,match:{commands:["put","set","move"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["patient","action","destination"],insertMarkers:!0}},{name:"bind-to",description:"Bind binds a variable to an element: \u7ed1\u5b9a X \u5230 Y (no \u628a)",priority:90,match:{commands:["bind","\u7ed1\u5b9a"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["action","patient","destination"],custom:e=>{const t=e.roles.get("action"),r=e.roles.get("patient"),n=e.roles.get("destination");return[t?.translated||t?.value||"",r?.translated||r?.value||"","\u5230",n?.translated||n?.value||""].filter(Boolean).join(" ")}}}]},ar:{code:"ar",name:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629",wordOrder:"VSO",adpositionType:"preposition",morphology:"fusional",direction:"rtl",canonicalOrder:["action","agent","patient","destination","source"],markers:[{form:"\u0639\u0646\u062f",role:"event",position:"preposition",required:!0},{form:"\u0625\u0644\u0649",role:"destination",position:"preposition",required:!1},{form:"\u0641\u064a",role:"destination",position:"preposition",required:!1},{form:"\u0645\u0646",role:"source",position:"preposition",required:!1},{form:"\u0628\u0640-",role:"style",position:"preposition",required:!1},{form:"\u0645\u0639",role:"style",position:"preposition",required:!1},{form:"\u0643\u0640-",role:"method",position:"preposition",required:!1}],rules:[{name:"event-handler-vso",description:"VSO event handler: VERB TARGET \u0639\u0646\u062f EVENT",priority:100,match:{commands:["on"],requiredRoles:["event","action"]},transform:{roleOrder:["action","patient","event"],insertMarkers:!0}}]},tr:{code:"tr",name:"T\u00fcrk\u00e7e",wordOrder:"SOV",adpositionType:"postposition",morphology:"agglutinative",direction:"ltr",canonicalOrder:["patient","event","action"],markers:[{form:"i",role:"patient",position:"postposition",required:!0,alternatives:["\u0131","u","\u00fc"]},{form:"e",role:"destination",position:"postposition",required:!0,alternatives:["a"]},{form:"den",role:"source",position:"postposition",required:!0,alternatives:["dan"]},{form:"de",role:"event",position:"postposition",required:!0,alternatives:["da"]},{form:"ile",role:"style",position:"postposition",required:!1},{form:"olarak",role:"method",position:"postposition",required:!1}],rules:[{name:"event-handler-sov",description:"SOV event handler",priority:100,match:{commands:["on"],requiredRoles:["event","action"]},transform:{roleOrder:["patient","event","action"],insertMarkers:!0}},{name:"put-into",description:"Transform put X into Y to Turkish verb-final order",priority:90,match:{commands:["put","koy"],requiredRoles:["action","patient","destination"],predicate:e=>!e.roles.has("event")},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"set-to",description:"Transform set X to Y to Turkish verb-final order",priority:90,match:{commands:["set","ayarla"],requiredRoles:["action","patient","destination"],predicate:e=>!/(^|\s)end$/i.test((e.original??"").trim())},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"bind-to",description:"Transform bind $var to #el to Turkish verb-final order",priority:90,match:{commands:["bind"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"wait-oblique-verb-final",description:"Keep wait's from-phrase and or-run inside the clause, verb-final",priority:90,match:{commands:["wait","bekle"],requiredRoles:["action","duration","source"],predicate:e=>!e.roles.has("event")},transform:{roleOrder:["patient","source","duration","action"],insertMarkers:!0}},{name:"repeat-until-event-verb-final",description:"Keep repeat-until-event's from-phrase before the verb",priority:90,match:{commands:["repeat","tekrarla"],requiredRoles:["action","patient","source"],predicate:e=>/^repeat\s+until\s+event\b/i.test((e.original??"").trim())},transform:{roleOrder:["patient","source","action"],insertMarkers:!0}},tc({callVerb:"\u00e7a\u011f\u0131r",patientMarker:"i",eventMarker:"de",connective:"ard\u0131ndan"}),rc({genitive:"nin",rangeSep:"ile",patientMarker:"i",eventMarker:"de"})]},es:{code:"es",name:"Espa\u00f1ol",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"en",role:"event",position:"preposition",required:!0},{form:"a",role:"destination",position:"preposition",required:!1},{form:"hacia",role:"destination",position:"preposition",required:!1},{form:"de",role:"source",position:"preposition",required:!1},{form:"con",role:"style",position:"preposition",required:!1},{form:"por",role:"quantity",position:"preposition",required:!1},{form:"como",role:"method",position:"preposition",required:!1}]},de:{code:"de",name:"Deutsch",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"bei",role:"event",position:"preposition",required:!0},{form:"zu",role:"destination",position:"preposition",required:!1},{form:"in",role:"destination",position:"preposition",required:!1},{form:"von",role:"source",position:"preposition",required:!1},{form:"aus",role:"source",position:"preposition",required:!1},{form:"mit",role:"style",position:"preposition",required:!1},{form:"um",role:"quantity",position:"preposition",required:!1},{form:"als",role:"method",position:"preposition",required:!1}]},fr:{code:"fr",name:"Fran\u00e7ais",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"sur",role:"event",position:"preposition",required:!0},{form:"\u00e0",role:"destination",position:"preposition",required:!1},{form:"dans",role:"destination",position:"preposition",required:!1},{form:"de",role:"source",position:"preposition",required:!1},{form:"avec",role:"style",position:"preposition",required:!1},{form:"par",role:"quantity",position:"preposition",required:!1},{form:"comme",role:"method",position:"preposition",required:!1}]},pt:{code:"pt",name:"Portugu\u00eas",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"em",role:"event",position:"preposition",required:!0},{form:"para",role:"destination",position:"preposition",required:!1},{form:"em",role:"destination",position:"preposition",required:!1},{form:"de",role:"source",position:"preposition",required:!1},{form:"com",role:"style",position:"preposition",required:!1},{form:"por",role:"quantity",position:"preposition",required:!1},{form:"como",role:"method",position:"preposition",required:!1}]},id:{code:"id",name:"Bahasa Indonesia",wordOrder:"SVO",adpositionType:"preposition",morphology:"agglutinative",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"pada",role:"event",position:"preposition",required:!0},{form:"ke",role:"destination",position:"preposition",required:!1},{form:"dari",role:"source",position:"preposition",required:!1},{form:"dengan",role:"style",position:"preposition",required:!1},{form:"sebagai",role:"method",position:"preposition",required:!1}]},ms:{code:"ms",name:"Bahasa Melayu",wordOrder:"SVO",adpositionType:"preposition",morphology:"agglutinative",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"apabila",role:"event",position:"preposition",required:!0},{form:"ke",role:"destination",position:"preposition",required:!1},{form:"dari",role:"source",position:"preposition",required:!1},{form:"dengan",role:"style",position:"preposition",required:!1},{form:"sebagai",role:"method",position:"preposition",required:!1}]},qu:{code:"qu",name:"Runasimi",wordOrder:"SOV",adpositionType:"postposition",morphology:"agglutinative",direction:"ltr",canonicalOrder:["patient","source","destination","event","action"],markers:[{form:"ta",role:"patient",position:"postposition",required:!0},{form:"man",role:"destination",position:"postposition",required:!0},{form:"manta",role:"source",position:"postposition",required:!0},{form:"pi",role:"event",position:"postposition",required:!0},{form:"wan",role:"style",position:"postposition",required:!1},{form:"hina",role:"method",position:"postposition",required:!1}],rules:[{name:"wait-oblique-verb-final",description:"Keep wait's from-phrase and or-run inside the clause, verb-final",priority:90,match:{commands:["wait","suyay"],requiredRoles:["action","duration","source"],predicate:e=>!e.roles.has("event")},transform:{roleOrder:["patient","source","duration","action"],insertMarkers:!0}},tc({callVerb:"qayay",patientMarker:"ta",eventMarker:"pi",connective:"chayqa"}),rc({genitive:"pa",rangeSep:"kama",patientMarker:"ta",eventMarker:"pi"})]},sw:{code:"sw",name:"Kiswahili",wordOrder:"SVO",adpositionType:"preposition",morphology:"agglutinative",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"kwenye",role:"event",position:"preposition",required:!0},{form:"kwa",role:"destination",position:"preposition",required:!1},{form:"kutoka",role:"source",position:"preposition",required:!1},{form:"na",role:"style",position:"preposition",required:!1},{form:"kuwa",role:"method",position:"preposition",required:!1}]},bn:{code:"bn",name:"\u09ac\u09be\u0982\u09b2\u09be",wordOrder:"SOV",adpositionType:"postposition",morphology:"agglutinative",direction:"ltr",canonicalOrder:["patient","event","action"],markers:[{form:"\u0995\u09c7",role:"patient",position:"postposition",required:!0},{form:"\u09a4\u09c7",role:"destination",position:"postposition",required:!0},{form:"\u098f",role:"event",position:"postposition",required:!0},{form:"\u09a5\u09c7\u0995\u09c7",role:"source",position:"postposition",required:!0},{form:"\u09a6\u09bf\u09af\u09bc\u09c7",role:"style",position:"postposition",required:!1},{form:"\u099c\u09a8\u09cd\u09af",role:"duration",position:"postposition",required:!1}],rules:[{name:"event-handler",description:"Transform event handlers to Bengali SOV order",priority:100,match:{commands:["on"],requiredRoles:["event","action"],optionalRoles:["patient"]},transform:{roleOrder:["patient","event","action"],insertMarkers:!0}},{name:"put-into",description:"Transform put X into Y to Bengali verb-final order",priority:90,match:{commands:["put","\u09b0\u09be\u0996\u09c1\u09a8"],requiredRoles:["action","patient","destination"],predicate:e=>!e.roles.has("event")},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"set-to",description:"Transform set X to Y to Bengali verb-final order",priority:90,match:{commands:["set","\u09b8\u09c7\u099f"],requiredRoles:["action","patient","destination"],predicate:e=>!/(^|\s)end$/i.test((e.original??"").trim())},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"bind-to",description:"Transform bind $var to #el to Bengali verb-final order",priority:90,match:{commands:["bind","\u09ac\u09be\u0987\u09a8\u09cd\u09a1"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},tc({callVerb:"\u0995\u09b2",patientMarker:"\u0995\u09c7",eventMarker:"\u098f",connective:"\u09a4\u09be\u09b0\u09aa\u09b0"}),rc({genitive:"\u09b0",rangeSep:"\u09a5\u09c7\u0995\u09c7",patientMarker:"\u0995\u09c7",eventMarker:"\u098f"})]},it:{code:"it",name:"Italiano",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"su",role:"event",position:"preposition",required:!0},{form:"in",role:"destination",position:"preposition",required:!1},{form:"a",role:"destination",position:"preposition",required:!1},{form:"da",role:"source",position:"preposition",required:!1},{form:"di",role:"source",position:"preposition",required:!1},{form:"con",role:"style",position:"preposition",required:!1},{form:"come",role:"method",position:"preposition",required:!1}]},ru:{code:"ru",name:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"\u043f\u0440\u0438",role:"event",position:"preposition",required:!0},{form:"\u0432",role:"destination",position:"preposition",required:!1},{form:"\u043d\u0430",role:"destination",position:"preposition",required:!1},{form:"\u043a",role:"destination",position:"preposition",required:!1},{form:"\u0438\u0437",role:"source",position:"preposition",required:!1},{form:"\u043e\u0442",role:"source",position:"preposition",required:!1},{form:"\u0441",role:"source",position:"preposition",required:!1},{form:"\u0441",role:"style",position:"preposition",required:!1},{form:"\u0441\u043e",role:"style",position:"preposition",required:!1},{form:"\u043a\u0430\u043a",role:"method",position:"preposition",required:!1}]},uk:{code:"uk",name:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"\u043f\u0440\u0438",role:"event",position:"preposition",required:!0},{form:"\u0432",role:"destination",position:"preposition",required:!1},{form:"\u043d\u0430",role:"destination",position:"preposition",required:!1},{form:"\u0434\u043e",role:"destination",position:"preposition",required:!1},{form:"\u0437",role:"source",position:"preposition",required:!1},{form:"\u0432\u0456\u0434",role:"source",position:"preposition",required:!1},{form:"\u0456\u0437",role:"source",position:"preposition",required:!1},{form:"\u0437",role:"style",position:"preposition",required:!1},{form:"\u0456\u0437",role:"style",position:"preposition",required:!1},{form:"\u044f\u043a",role:"method",position:"preposition",required:!1}]},vi:{code:"vi",name:"Ti\u1ebfng Vi\u1ec7t",wordOrder:"SVO",adpositionType:"preposition",morphology:"isolating",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"khi",role:"event",position:"preposition",required:!0},{form:"v\u00e0o",role:"destination",position:"preposition",required:!1},{form:"cho",role:"destination",position:"preposition",required:!1},{form:"\u0111\u1ebfn",role:"destination",position:"preposition",required:!1},{form:"t\u1eeb",role:"source",position:"preposition",required:!1},{form:"kh\u1ecfi",role:"source",position:"preposition",required:!1},{form:"v\u1edbi",role:"style",position:"preposition",required:!1},{form:"nh\u01b0",role:"method",position:"preposition",required:!1}]},hi:{code:"hi",name:"\u0939\u093f\u0928\u094d\u0926\u0940",wordOrder:"SOV",adpositionType:"postposition",morphology:"fusional",direction:"ltr",canonicalOrder:["patient","event","action"],markers:[{form:"\u0915\u094b",role:"patient",position:"postposition",required:!0},{form:"\u092e\u0947\u0902",role:"destination",position:"postposition",required:!0},{form:"\u092a\u0930",role:"destination",position:"postposition",required:!1},{form:"\u092a\u0930",role:"event",position:"postposition",required:!0},{form:"\u0938\u0947",role:"source",position:"postposition",required:!0},{form:"\u0938\u0947",role:"style",position:"postposition",required:!1},{form:"\u0938\u093e\u0925",role:"style",position:"postposition",required:!1},{form:"\u0915\u0947 \u0930\u0942\u092a \u092e\u0947\u0902",role:"method",position:"postposition",required:!1}],rules:[{name:"event-handler",description:"Transform event handlers to Hindi SOV order",priority:100,match:{commands:["on"],requiredRoles:["event","action"],optionalRoles:["patient"]},transform:{roleOrder:["patient","event","action"],insertMarkers:!0}},{name:"put-into",description:"Transform put X into Y to Hindi verb-final order",priority:90,match:{commands:["put","\u0930\u0916\u0947\u0902"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"set-to",description:"Transform set X to Y to Hindi verb-final order",priority:90,match:{commands:["set","\u0938\u0947\u091f"],requiredRoles:["action","patient","destination"],predicate:e=>!/(^|\s)end$/i.test((e.original??"").trim())},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},{name:"bind-to",description:"Transform bind $var to #el to Hindi verb-final order",priority:90,match:{commands:["bind","\u092c\u093e\u0907\u0902\u0921","\u092c\u093e\u0902\u0927\u0947\u0902"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["patient","destination","action"],insertMarkers:!0}},tc({callVerb:"\u0915\u0949\u0932",patientMarker:"\u0915\u094b",eventMarker:"\u092a\u0930",connective:"\u092b\u093f\u0930"}),rc({genitive:"\u0915\u093e",rangeSep:"\u0938\u0947",patientMarker:"\u0915\u094b",eventMarker:"\u092a\u0930"})]},tl:{code:"tl",name:"Tagalog",wordOrder:"VSO",adpositionType:"preposition",morphology:"agglutinative",direction:"ltr",canonicalOrder:["action","agent","patient","destination","source"],markers:[{form:"kapag",role:"event",position:"preposition",required:!0},{form:"sa",role:"destination",position:"preposition",required:!1},{form:"mula_sa",role:"source",position:"preposition",required:!1},{form:"nang",role:"style",position:"preposition",required:!1},{form:"bilang",role:"method",position:"preposition",required:!1}],rules:[{name:"event-handler-vso",description:"VSO event handler: VERB TARGET kapag EVENT",priority:100,match:{commands:["on"],requiredRoles:["event","action"]},transform:{roleOrder:["action","patient","event"],insertMarkers:!0}}]},th:{code:"th",name:"\u0e44\u0e17\u0e22",wordOrder:"SVO",adpositionType:"preposition",morphology:"isolating",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"\u0e40\u0e21\u0e37\u0e48\u0e2d",role:"event",position:"preposition",required:!0},{form:"\u0e43\u0e19",role:"destination",position:"preposition",required:!1},{form:"\u0e44\u0e1b\u0e22\u0e31\u0e07",role:"destination",position:"preposition",required:!1},{form:"\u0e08\u0e32\u0e01",role:"source",position:"preposition",required:!1},{form:"\u0e14\u0e49\u0e27\u0e22",role:"style",position:"preposition",required:!1},{form:"\u0e40\u0e1b\u0e47\u0e19",role:"method",position:"preposition",required:!1}]},pl:{code:"pl",name:"Polski",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"ltr",canonicalOrder:["event","action","patient","destination"],markers:[{form:"gdy",role:"event",position:"preposition",required:!0},{form:"przy",role:"event",position:"preposition",required:!1},{form:"do",role:"destination",position:"preposition",required:!1},{form:"w",role:"destination",position:"preposition",required:!1},{form:"na",role:"destination",position:"preposition",required:!1},{form:"z",role:"source",position:"preposition",required:!1},{form:"od",role:"source",position:"preposition",required:!1},{form:"ze",role:"source",position:"preposition",required:!1},{form:"z",role:"style",position:"preposition",required:!1},{form:"ze",role:"style",position:"preposition",required:!1},{form:"jako",role:"method",position:"preposition",required:!1}]},he:{code:"he",name:"\u05e2\u05d1\u05e8\u05d9\u05ea",wordOrder:"SVO",adpositionType:"preposition",morphology:"fusional",direction:"rtl",canonicalOrder:["event","action","patient","destination"],markers:[{form:"\u05d1",role:"event",position:"preposition",required:!0},{form:"\u05e2\u05dc",role:"destination",position:"preposition",required:!1},{form:"\u05d0\u05dc",role:"destination",position:"preposition",required:!1},{form:"\u05dc",role:"destination",position:"preposition",required:!1},{form:"\u05d0\u05ea",role:"patient",position:"preposition",required:!1},{form:"\u05de",role:"source",position:"preposition",required:!1},{form:"\u05de\u05df",role:"source",position:"preposition",required:!1},{form:"\u05e2\u05dd",role:"style",position:"preposition",required:!1},{form:"\u05db",role:"method",position:"preposition",required:!1}],rules:[{name:"bind-to",description:"Bind binds a variable to an element: \u05e7\u05e9\u05d5\u05e8 X \u05dc Y",priority:90,match:{commands:["bind","\u05e7\u05e9\u05d5\u05e8"],requiredRoles:["action","patient","destination"]},transform:{roleOrder:["action","patient","destination"],custom:e=>{const t=e.roles.get("action"),r=e.roles.get("patient"),n=e.roles.get("destination");return[t?.translated||t?.value||"",r?.translated||r?.value||"","\u05dc",n?.translated||n?.value||""].filter(Boolean).join(" ")}}}]}};function ic(e){return nc[e]}function ac(e){const t={};for(const[r,n]of Object.entries(e.words))t[n]=r;const r={};if(e.categories)for(const[t,n]of Object.entries(e.categories)){r[t]={};for(const[e,i]of Object.entries(n))r[t][i]=e}const n={source:e.target,target:e.source,words:t};return Object.keys(r).length>0&&(n.categories=r),n}function sc(e,t,r,n){const i={},a={};for(const r of["commands","modifiers","events","logical","temporal","values","attributes"]){const n=e[r],s=t[r];if(n&&s){a[r]={};for(const[e,t]of Object.entries(n)){const n=s[e];n&&t!==n&&(i[t]=n,a[r][t]=n)}}}return{source:r,target:n,words:i,categories:a}}var oc=sc(gl,Tl,"ja","zh"),lc=ac(oc),cc=sc(Al,gl,"ko","ja"),uc=ac(cc),dc={source:"es",target:"pt",words:{en:"em",decir:"dizer",disparar:"disparar",enviar:"enviar",tomar:"pegar",poner:"colocar",establecer:"definir",obtener:"obter",agregar:"adicionar",quitar:"remover",alternar:"alternar",ocultar:"esconder",mostrar:"mostrar",si:"se",menos:"a menos",repetir:"repetir",para:"para",mientras:"enquanto",hasta:"at\u00e9",continuar:"continuar",romper:"parar",detener:"parar",esperar:"esperar",buscar:"buscar",llamar:"chamar",retornar:"retornar",hacer:"fazer",registrar:"registrar",lanzar:"lan\u00e7ar",atrapar:"capturar",medir:"medir","transici\u00f3n":"transi\u00e7\u00e3o",incrementar:"incrementar",decrementar:"decrementar",predeterminar:"padr\u00e3o",ir:"ir",copiar:"copiar",escoger:"escolher",intercambiar:"trocar",transformar:"transformar","a\u00f1adir":"anexar",salir:"sair",a:"para",de:"de",dentro:"em",con:"com",como:"como",por:"por",clic:"clique",cambio:"mudan\u00e7a",entrada:"entrada","env\u00edo":"envio",carga:"carregar",enfoque:"foco",desenfoque:"desfoque",verdadero:"verdadeiro",falso:"falso",y:"e",o:"ou",no:"n\u00e3o",es:"\u00e9",segundos:"segundos",milisegundos:"milissegundos",nulo:"nulo",indefinido:"indefinido","vac\u00edo":"vazio"},categories:{commands:{en:"em",decir:"dizer",tomar:"pegar",poner:"colocar",establecer:"definir",obtener:"obter",agregar:"adicionar",quitar:"remover",ocultar:"esconder",si:"se",mientras:"enquanto",hasta:"at\u00e9",romper:"parar",detener:"parar",llamar:"chamar",hacer:"fazer",lanzar:"lan\u00e7ar",atrapar:"capturar",escoger:"escolher",intercambiar:"trocar","a\u00f1adir":"anexar",salir:"sair"},events:{clic:"clique",cambio:"mudan\u00e7a",carga:"carregar",enfoque:"foco",desenfoque:"desfoque"},logical:{verdadero:"verdadeiro",y:"e",o:"ou",no:"n\u00e3o",es:"\u00e9"}}},mc=ac(dc),pc=new Map([["ja->zh",oc],["zh->ja",lc],["ko->ja",cc],["ja->ko",uc],["es->pt",dc],["pt->es",mc]]),hc={en:{commands:{on:"on",tell:"tell",trigger:"trigger",send:"send",take:"take",put:"put",set:"set",get:"get",add:"add",remove:"remove",toggle:"toggle",hide:"hide",show:"show",if:"if",unless:"unless",repeat:"repeat",for:"for",while:"while",until:"until",continue:"continue",break:"break",halt:"halt",wait:"wait",fetch:"fetch",call:"call",return:"return",make:"make",log:"log",throw:"throw",catch:"catch",measure:"measure",transition:"transition",increment:"increment",decrement:"decrement",default:"default",bind:"bind",eventsource:"eventsource",socket:"socket",worker:"worker",intercept:"intercept",go:"go",pushUrl:"pushUrl",replaceUrl:"replaceUrl",copy:"copy",pick:"pick",beep:"beep",js:"js",async:"async",render:"render",swap:"swap",morph:"morph",settle:"settle",append:"append",exit:"exit",install:"install",open:"open",close:"close",select:"select",clear:"clear",breakpoint:"breakpoint",prepend:"prepend",clone:"clone",scroll:"scroll",push:"push",replace:"replace",process:"process"},modifiers:{to:"to",from:"from",into:"into",with:"with",at:"at",in:"in",of:"of",as:"as",by:"by",before:"before",after:"after",over:"over",under:"under",between:"between",through:"through",without:"without"},events:{click:"click",dblclick:"dblclick",mousedown:"mousedown",mouseup:"mouseup",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"mouseover",mouseout:"mouseout",mousemove:"mousemove",keydown:"keydown",keyup:"keyup",keypress:"keypress",focus:"focus",blur:"blur",change:"change",input:"input",submit:"submit",reset:"reset",load:"load",unload:"unload",resize:"resize",scroll:"scroll",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",touchcancel:"touchcancel"},logical:{when:"when",where:"where",and:"and",or:"or",not:"not",is:"is",exists:"exists",matches:"matches",contains:"contains",includes:"includes",equals:"equals",has:"has",have:"have",then:"then",else:"else",otherwise:"otherwise",end:"end",live:"live",changes:"changes"},temporal:{seconds:"seconds",second:"second",milliseconds:"milliseconds",millisecond:"millisecond",minutes:"minutes",minute:"minute",hours:"hours",hour:"hour",ms:"ms",s:"s",min:"min",h:"h"},values:{true:"true",false:"false",null:"null",undefined:"undefined",it:"it",its:"its",me:"me",my:"my",myself:"myself",you:"you",your:"your",yourself:"yourself",element:"element",target:"target",detail:"detail",event:"event",window:"window",document:"document",body:"body",result:"result",value:"value"},attributes:{class:"class",classes:"classes",style:"style",styles:"styles",attribute:"attribute",attributes:"attributes",property:"property",properties:"properties"},expressions:{first:"first",last:"last",next:"next",previous:"previous",prev:"prev",at:"at",random:"random",closest:"closest",parent:"parent",children:"children",within:"within",no:"no",empty:"empty",some:"some","starts with":"starts with","ends with":"ends with","ignoring case":"ignoring case","sorted by":"sorted by","mapped to":"mapped to","split by":"split by","joined by":"joined by"}},es:fl,ko:Al,zh:Tl,fr:bl,de:kl,ja:gl,ar:xl,tr:Ol,id:Pl,qu:ql,sw:Rl,pt:$l,it:zl,vi:Vl,pl:Hl,ru:Bl,uk:Wl,hi:Dl,bn:Fl,th:Ul,ms:Kl,tl:Zl,he:Xl},fc=["commands","modifiers","events","logical","temporal","values","attributes","expressions"];function yc(e){const t=new Set(al),r=hc[e];return r?.commands&&Object.values(r.commands).forEach(e=>{"string"==typeof e&&t.add(e.toLowerCase())}),t}var gc=["is","are","was","were","am","be"];function vc(e){const t=new Set(gc);if("en"!==e)for(const r of gc)t.add(zc(r,"en",e).toLowerCase());return t}function bc(e,t,r){const n=e[t-1]?.toLowerCase();return!!n&&r.has(n)}function wc(e,t,r,n){for(let i=t+1;e.length>i;i++){const t=e[i].toLowerCase();if(r.has(t))return!0;if(n.has(t))return!1}return!1}function kc(e){const t=e.filter(e=>!e.isBlank&&e.originalIndent.length>0);if(0===t.length)return e.map(()=>"");const r=t.map(e=>e.originalIndent.replace(/\t/g," ").length),n=Math.min(...r),i=n>0?n:4;return e.map(e=>{if(e.isBlank)return"";if(0===e.originalIndent.length)return"";const t=e.originalIndent.replace(/\t/g," ");return" ".repeat(Math.round(t.length/i))})}var Ec=new Set(["to","into","from","with","by","as","at","in","on","of","over"]),xc=new Map,Cc=new Set(["toggle","add","remove","trigger","send"]);function Ac(e,t){for(const r of e){const e=r.toLowerCase();if(t.has(e)&&!Ec.has(e)&&!Pc.has(e))return e}return null}var Sc=new Set(["live","when","unless"]),Tc=new Set(["if","repeat","unless","while","for"]),Lc=new Set(["he","zh"]);function Oc(e,t){const r=yc(t),n=function(e){const t=xc.get(e);if(t)return t;const r=new Set(Ec),n=ic(e);return n?.markers.forEach(e=>{const t=e.form.replace(/^-|-$/g,"").toLowerCase();t&&r.add(t),e.alternatives?.forEach(e=>{const t=e.replace(/^-|-$/g,"").toLowerCase();t&&r.add(t)})}),xc.set(e,r),r}(t),{forWords:i,inWords:a}=function(e){const t=new Set(["for"]),r=new Set(["in"]);return"en"!==e&&(t.add(zc("for","en",e).toLowerCase()),r.add(zc("in","en",e).toLowerCase())),{forWords:t,inWords:r}}(t),s=e.split(/\s+/);if(0===s.length)return[e];const o=[];let l=[];const c=s[0]?.toLowerCase();let u=!Pc.has(c),d=0;for(let e=0;s.length>e;e++){const t=s[e],c=t.toLowerCase();if(Sc.has(c)?d++:"end"===c&&d>0&&d--,r.has(c)&&l.length>0){const m=l[l.length-1].toLowerCase();if(!u){u=!0,l.push(t);continue}if(d>0){l.push(t);continue}if(i.has(c)&&!wc(s,e,a,r)){l.push(t);continue}if(Ec.has(c)){const n=Ac(l,r);if(n&&Cc.has(n)){l.push(t);continue}if("on"===c&&"set"===n){const r=s[e+1],n=r?.toLowerCase();if(r&&(/^[#.<@[]/.test(r)||"me"===n||"it"===n||"you"===n)){l.push(t);continue}}}if(!n.has(m)&&!r.has(m)){o.push(l.join(" ")),l=[t];continue}}l.push(t)}return l.length>0&&o.push(l.join(" ")),o.filter(e=>e.length>0)}function jc(e,t){const r=Array.from(ml),n="en"===t?null:hc[t];n?.modifiers?.then&&r.push(n.modifiers.then),n?.logical?.then&&r.push((n?.logical).then);const i=r.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),a=RegExp(`\\s+(${i.join("|")})\\s+`,"gi");return e.split(a).filter(e=>{const t=e.toLowerCase().trim();return t&&!r.some(e=>e.toLowerCase()===t)}).map(e=>e.trim()).filter(e=>e.length>0)}var Pc=function(){const e=new Set;e.add("on");for(const t of Object.values(nc))for(const r of t.markers)if("event"===r.role){const t=r.form.replace(/^-|-$/g,"").toLowerCase();t&&e.add(t),r.alternatives?.forEach(t=>{const r=t.replace(/^-|-$/g,"").toLowerCase();r&&e.add(r)})}return e}(),Ic=new Set(["or"]),qc=new Set(["async","once","debounced","debounce","throttled","throttle"]);function Nc(e,t){const r=function(e){const t={};e.markers.forEach(e=>{const r=e.form.replace(/^-|-$/g,"").toLowerCase();r&&(t[r]=e.role),e.alternatives?.forEach(r=>{const n=r.replace(/^-|-$/g,"").toLowerCase();n&&(t[n]=e.role)})});for(const[e,r]of Object.entries(rl))e in t||(t[e]=r);return t}(e),n=t?.toLowerCase();if("SVO"!==e.wordOrder||!n||!Cc.has(n))return r;const i={};for(const[e,t]of Object.entries(r))i[e]="event"===t?"destination":t;return i}var Rc={zh:["\u65f6","\u7684","\u5730","\u5f97"],ja:[],ko:[]},Mc={zh:["\u5f53"],ar:["\u0628\u0640","\u0643\u0640","\u0648"]};function $c(e,t){const r=[];let n="",i=!1,a=0,s=0,o=0;for(let t=0;e.length>t;t++){const l=e[t];"<"===l?(i=!0,a++):">"===l&&i&&(a--,0===a&&(i=!1)),"["===l?s++:"]"===l&&s>0&&s--,"("===l?o++:")"===l&&o>0&&o--,/\s/.test(l)&&!i&&0===s&&0===o?n&&(r.push(n),n=""):n+=l}return n&&r.push(n),function(e,t){const r=Rc[t]||[],n=Mc[t]||[];if(0===r.length&&0===n.length)return e;const i=[];for(const t of e){if(/^[#.<@]/.test(t)||/^\d+/.test(t)){i.push(t);continue}let e=t,a="",s="";for(const t of n)if(e.startsWith(t)&&e.length>t.length){a=t,e=e.slice(t.length);break}for(const t of r)if(e.endsWith(t)&&e.length>t.length){s=t,e=e.slice(0,-t.length);break}a&&i.push(a),e&&i.push(e),s&&i.push(s)}return i}(r,t.code)}var _c=new Set(["duration","quantity"]);function zc(e,t,r){if(/^[#.<@]/.test(e))return e;if(/^\d+/.test(e))return e;if(/\s/.test(e)&&e.startsWith("("))return e.split(/\s+/).map(e=>zc(e,t,r)).join(" ");if(e.length>1&&(e.startsWith("(")||e.endsWith(")"))){const n=e.match(/^(\(*)([^()]+)(\)*)$/);if(n&&(n[1]||n[3]))return n[1]+zc(n[2],t,r)+n[3]}const n="en"===t?null:hc[t],i=hc[r];if(!i)return e;let a=e;if(n){const t=function(e,t){const r=t.toLowerCase();for(const t of fc){const n=e[t];for(const[e,i]of Object.entries(n))if(i.toLowerCase()===r)return{category:t,englishKey:e}}}(n,e);t&&(a=t.englishKey)}const s=function(e,t){const r=t.toLowerCase();for(const t of fc){const n=e[t][r];if(n)return n}}(i,a);return s??e}var Vc={en:{type:"suffix",marker:"'s"},es:{type:"preposition",marker:"de"},pt:{type:"preposition",marker:"de"},fr:{type:"preposition",marker:"de"},de:{type:"preposition",marker:"von"},ja:{type:"suffix",marker:"\u306e"},ko:{type:"suffix",marker:"\uc758"},zh:{type:"suffix",marker:"\u7684"},ar:{type:"preposition",marker:"\u0644\u0640"},tr:{type:"particle",marker:"\u0131n"},id:{type:"preposition",marker:"dari"},qu:{type:"particle",marker:"pa"},bn:{type:"suffix",marker:"\u09b0"},sw:{type:"preposition",marker:"ya"}};function Hc(e,t,r){const n=e.match(/^(.+)'s$/i);if(!n)return e;const i=n[1],a=Vc[r]||Vc.en,s={me:"my",it:"its",you:"your"},o=i.toLowerCase();if(s[o])return zc(s[o],"en",r);const l=zc(i,t,r);switch(a.type){case"suffix":return`${l}${a.marker}`;case"particle":return`${l} ${a.marker}`;case"preposition":return`__POSS__${a.marker}__${l}__POSS__`;default:return l+"'s"}}var Bc=/^(my|its|your|me|it|you)(\??\..+)$/i,Wc={me:"my",it:"its",you:"your",my:"my",its:"its",your:"your"};function Dc(e,t,r){const n=e.match(Bc);if(!n)return null;const i=n[1].toLowerCase(),a=n[2],s=Wc[i]||i,o=zc(s,t,r);if(o.includes(" "))return null;if(o!==s)return o+a;if(i!==s){const e=zc(i,t,r);if(e!==i&&!e.includes(" "))return e+a}return null}function Fc(e,t,r){if(e.includes("[")){const n=[],i=e.replace(/\[[^\]]*\]/g,e=>(n.push(e),`\ue000${n.length-1}\ue001`));if(n.length>0)return Fc(i,t,r).replace(/\ue000(\d+)\ue001/g,(e,t)=>n[Number(t)])}if(!e.includes(" ")){if(e.includes("'s"))return Hc(e,t,r);const n=Dc(e,t,r);return null!==n?n:zc(e,t,r)}const n=e.split(/\s+/),i=[];let a=0;for(;n.length>a;){const e=n[a];if(e.includes("'s")){const s=Hc(e,t,r),o=s.match(/^__POSS__(.+)__(.+)__POSS__$/);if(o&&n.length>a+1){const e=o[1],s=o[2],l=zc(n[a+1],t,r);i.push(`${l} ${e} ${s}`),a+=2;continue}if(o){i.push(`${o[1]} ${o[2]}`),a++;continue}i.push(s),a++;continue}if(/^[#.<@]/.test(e)||/^\d+/.test(e)){i.push(e),a++;continue}if(/^["'].*["']$/.test(e)){i.push(e),a++;continue}const s=Dc(e,t,r);null===s?(i.push(zc(e,t,r)),a++):(i.push(s),a++)}return i.join(" ")}var Uc=/(\^[A-Za-z_][\w-]*)(\s+on\s+(?:[#.][\w-]+|<[^>]*\/>|\[[^\]]+\]))/g,Kc=/\busing\s+view\b(?:\s+(?!then\b)[A-Za-z][\w-]*)?/gi,Zc=RegExp("^\ue002(\\d+)\ue003$"),Xc=class{constructor(e="en",t){const r=ic(e),n=ic(t);if(!r)throw Error("Unknown source locale: "+e);if(!n)throw Error("Unknown target locale: "+t);this.sourceProfile=r,this.targetProfile=n}transform(e){const t=this.transformInternal(e);return"he"===this.targetProfile.code?function(e){const t=yc("he"),r=e.split(/\s+/);let n=!1;for(let e=0;r.length>e+1;e++)"\u05d0\u05ea"===r[e]&&t.has(r[e+1].toLowerCase())&&([r[e],r[e+1]]=[r[e+1],r[e]],n=!0,e++);return n?r.join(" "):e}(t):t}transformInternal(e){const t=function(e){const t=[],r=e.replace(Kc,e=>{const r=t.length;return t.push(e),`\ue002${r}\ue003`});return t.length>0?{masked:r,tails:t}:null}(e);if(t)return function(e,t){return e.replace(RegExp("\ue002(\\d+)\ue003","g"),(e,r)=>t[Number(r)]??"")}(this.transformInternal(t.masked),t.tails);const r=function(e){const t=[],r=e.replace(Uc,(e,r,n)=>{const i=t.length;return t.push(n),`${r}\ue000${i}\ue001`});return t.length>0?{masked:r,scopes:t}:null}(e);if(r)return function(e,t){return e.replace(RegExp("\ue000(\\d+)\ue001","g"),(e,r)=>t[Number(r)]??"")}(this.transform(r.masked),r.scopes);const n=function(e){if("en"===e)return"then";const t=hc[e];return t&&(t.modifiers?.then||t.logical?.then)||"then"}(this.targetProfile.code);if(!e.includes("\n")){const t=this.tryTransformJsBlock(e);if(null!==t)return t;const r=this.tryTransformEventWithModifierBody(e);if(null!==r)return r;const n=this.tryTransformEventWithBlockBody(e);if(null!==n)return n;const i=this.tryTransformEventWithUnlessGuard(e);if(null!==i)return i}if(e.includes("\n")){const{parts:t,lineMetadata:r,partToLineIndex:i}=function(e,t){const r=e.split("\n"),n=[],i=[],a=[];for(let e=0;r.length>e;e++){const s=r[e],o=s.match(/^(\s*)/),l=o?o[1]:"",c=s.trim();if(n.push({content:c,originalIndent:l,isBlank:0===c.length}),c.length>0){const r=jc(c,t);for(const n of r){const r=Oc(n,t);for(const t of r)i.push(t),a.push(e)}}}return{parts:i,lineMetadata:n,partToLineIndex:a}}(e,this.sourceProfile.code);return function(e,t,r,n){if(1>=t.filter(e=>!e.isBlank).length&&1>=e.length){const r=kc(t),n=[];for(let i=0;t.length>i;i++)t[i].isBlank?n.push(""):e.length>0&&n.push(r[i]+e[0]);return n.join("\n")}const i=kc(t),a=new Map;for(let t=0;e.length>t;t++){const n=r[t];a.has(n)||a.set(n,[]),a.get(n).push(e[t])}const s=[];for(let e=0;t.length>e;e++){const r=i[e];if(t[e].isBlank)s.push("");else{const t=a.get(e)||[];if(t.length>0){const e=t.join(` ${n} `);s.push(r+e)}}}return s.join("\n")}(t.map(e=>this.transformSingle(e)),r,i,n)}const i=function(e,t){const r=e.split(/\n/).map(e=>e.trim()).filter(e=>e.length>0),n=[];for(const e of r){const r=jc(e,t);for(const e of r){const r=Oc(e,t);n.push(...r)}}return n}(e,this.sourceProfile.code);return i.length>1?i.map(e=>this.transformSingle(e)).join(` ${n} `):this.transformSingle(e)}transformSingle(e){const t=function(e,t){const r=e.split(/\s+/),n=r[0]?.toLowerCase();if(!n||!Sc.has(n))return null;let i=1,a=-1;for(let e=1;r.length>e;e++){const t=r[e].toLowerCase();if(Sc.has(t))i++;else if("end"===t&&(i--,0===i)){a=e;break}}if(-1!==a&&a!==r.length-1)return null;const s=-1!==a?r.slice(1,a):r.slice(1),o={headKeyword:r[0],body:""};if(-1!==a&&(o.tailKeyword=r[a]),"live"===n)return{...o,body:s.join(" ")};if("when"===n){const e=s.findIndex(e=>"changes"===e.toLowerCase());return 0>e?null:{...o,prefixExpr:s.slice(0,e).join(" "),connector:s[e],body:s.slice(e+1).join(" ")}}const l=yc(t),c=vc(t);let u=-1;for(let e=0;s.length>e;e++)if(l.has(s[e].toLowerCase())&&!bc(s,e,c)){u=e;break}return u>0?{...o,prefixExpr:s.slice(0,u).join(" "),body:s.slice(u).join(" ")}:null}(e,this.sourceProfile.code);if(t)return this.transformBlock(t);const r=this.transformWithTrailingEnd(e);if(null!==r)return r;const n=this.transformSetWithScope(e);if(null!==n)return n;const i=this.transformWithViewTransitionTail(e);if(null!==i)return i;const a=function(e,t="en"){const r=ic(t);if(!r)return null;const n=$c(e,r),i=function(e,t){if(0===e.length)return"unknown";const r=e[0].toLowerCase(),n=t.markers.find(e=>"event"===e.role&&"preposition"===e.position);return n&&r===n.form.toLowerCase()||Pc.has(r)?"event-handler":dl.has(r)?"conditional":"command"}(n,r);switch(i){case"event-handler":return function(e,t){const r=new Map;let n=Pc.has(e[0]?.toLowerCase())?1:0;if(e[n]){const t=[e[n]];for(n++;e[n]&&Ic.has(e[n].toLowerCase())&&e[n+1];)t.push(e[n],e[n+1]),n+=2;r.set("event",{role:"event",value:t.join(" ")})}if(e[n]&&"from"===e[n].toLowerCase()&&e[n+1]){n++;const t=[];for(;e[n]&&!al.has(e[n].toLowerCase());)t.push(e[n]),n++;if(t.length>0){const e=t.join(" ");r.set("source",{role:"source",value:e,isSelector:/^[#.<@]/.test(e)})}}if(e[n]&&(r.set("action",{role:"action",value:e[n]}),n++),e[n]){const i=Nc(t,r.get("action")?.value);let a="patient",s=[];for(let t=n;e.length>t;t++){const n=e[t],o=i[n.toLowerCase()];if(o){if(s.length>0){const e=s.join(" ");r.set(a,{role:a,value:e,isSelector:/^[#.<@]/.test(e)})}a=o,s=[]}else s.push(n)}if(s.length>0){const e=s.join(" ");r.set(a,{role:a,value:e,isSelector:/^[#.<@]/.test(e)})}}return{type:"event-handler",roles:r,original:e.join(" ")}}(n,r);case"command":return function(e,t){const r=new Map;if(0===e.length)return{type:"command",roles:r,original:""};r.set("action",{role:"action",value:e[0]});const n=Nc(t,e[0]);let i="patient",a=[];for(let t=1;e.length>t;t++){const s=e[t],o=n[s.toLowerCase()];if(o){if(a.length>0){const e=a.join(" ");r.set(i,{role:i,value:e,isSelector:/^[#.<@]/.test(e)})}i=o,a=[]}else a.push(s)}if(a.length>0){const e=a.join(" ");r.set(i,{role:i,value:e,isSelector:/^[#.<@]/.test(e)})}return{type:"command",roles:r,original:e.join(" ")}}(n,r);case"conditional":return function(e){const t=new Map;t.set("action",{role:"action",value:e[0]});const r=e.findIndex(e=>ml.has(e.toLowerCase()));if(r>1){const n=e.slice(1,r).join(" ");t.set("condition",{role:"condition",value:n})}else-1===r&&e.length>1&&t.set("condition",{role:"condition",value:e.slice(1).join(" ")});return{type:"conditional",roles:t,original:e.join(" ")}}(n);default:return null}}(e,this.sourceProfile.code);if(!a)return e;!function(e,t){if("command"!==e.type)return;const r=e.roles.get("action")?.value;if(!r)return;const n=nl[r.toLowerCase()];if(!n||!_c.has(n))return;const i=e.roles.get("patient");i&&!e.roles.has(n)&&(t.markers.some(e=>e.role===n)||(e.roles.delete("patient"),e.roles.set(n,{...i,role:n})))}(a,this.targetProfile),function(e,t,r){for(const[n,i]of e.roles)i.translated=i.value.includes("'s")?Fc(i.value,t,r):i.isSelector||i.isLiteral?i.value:Fc(i.value,t,r)}(a,this.sourceProfile.code,this.targetProfile.code);const s=this.findRule(a);if(s?.transform.custom)return s.transform.custom(a,this.targetProfile);const o=Yl(a.roles,s?.transform.roleOrder||this.targetProfile.canonicalOrder);return ec(s?.transform.insertMarkers??1?Ql(o,this.targetProfile.markers,this.targetProfile.adpositionType):o.map(e=>e.translated||e.value))}transformWithViewTransitionTail(e){const t=e.trim().split(/\s+/);if(2>t.length)return null;if(!Zc.test(t[t.length-1]))return null;const r=t[t.length-1],n=t.slice(0,-1).join(" ");return`${this.transformSingle(n)} ${r}`}transformWithTrailingEnd(e){const t=this.sourceProfile.code,r=e.trim().split(/\s+/);if(2>r.length)return null;const n=zc("end","en",t).toLowerCase();if(r[r.length-1].toLowerCase()!==n)return null;const i=new Set(["if","repeat","unless","while","when","live","js"].map(e=>zc(e,"en",t).toLowerCase()));return r.slice(0,-1).some(e=>i.has(e.toLowerCase()))?null:`${this.transformSingle(r.slice(0,-1).join(" "))} ${zc(r[r.length-1],t,this.targetProfile.code)}`}tryTransformJsBlock(e){const t=this.sourceProfile.code,r=this.targetProfile.code,n=zc("js","en",t),i=zc("end","en",t).toLowerCase(),a=e.split(/\s+/).filter(e=>e.length>0),s=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=RegExp(`^${s}(\\(.*\\))?$`,"i"),l=a.findIndex(e=>o.test(e));if(-1===l)return null;let c=-1;for(let e=l+1;a.length>e;e++)if(a[e].toLowerCase()===i){c=e;break}if(-1===c)return null;if(c!==a.length-1)return null;const u=a[l],d=u.match(o)?.[1]??"",m=d?u.slice(0,u.length-d.length):u,p=a.slice(l+1,c).join(" "),h=[zc(m,t,r)+d,p,zc(a[c],t,r)].filter(e=>e.length>0).join(" "),f=a.slice(0,l);if(0===f.length)return h;const y="JSBLOCKPLACEHOLDER",g=this.transformSingle([...f,y].join(" "));return g.includes(y)?g.replace(y,h):null}tryTransformEventWithBlockBody(e){const t=$c(e,this.sourceProfile);if(0===t.length)return null;if(!Pc.has(t[0]?.toLowerCase()))return null;let r=-1;for(let e=1;t.length>e;e++)if(Tc.has(t[e].toLowerCase())){r=e;break}if(0>=r)return null;if("end"!==t[t.length-1].toLowerCase())return null;const n=t.slice(0,r),i=t.slice(r);if("VSO"===this.targetProfile.wordOrder&&n.some(e=>"from"===e.toLowerCase()))return null;const a="EVENTBLOCKPLACEHOLDER",s=this.transformSingle([...n,a].join(" "));if(!s.includes(a))return null;const o=this.transformBlockBody(i);return[s.replace(a,"").replace(/\s+/g," ").trim(),o].filter(e=>e.length>0).join(" ")}tryTransformEventWithUnlessGuard(e){if(!Lc.has(this.targetProfile.code))return null;const t=$c(e,this.sourceProfile);if(0===t.length)return null;if(!Pc.has(t[0]?.toLowerCase()))return null;let r=-1;for(let e=1;t.length>e;e++)if("unless"===t[e].toLowerCase()){r=e;break}if(0>=r)return null;if("end"===t[t.length-1].toLowerCase())return null;const n=t.slice(0,r),i=t.slice(r).join(" "),a=this.transform(i);if(!a)return null;const s="EVENTGUARDPLACEHOLDER",o=this.transformSingle([...n,s].join(" "));return o.includes(s)?[o.replace(s,"").replace(/\s+/g," ").trim(),a].filter(e=>e.length>0).join(" "):null}tryTransformEventWithModifierBody(e){if("SOV"!==this.targetProfile.wordOrder)return null;const t=$c(e,this.sourceProfile);if(0===t.length)return null;if(!Pc.has(t[0]?.toLowerCase()))return null;let r=1;if(!t[r])return null;for(r++;t[r]&&Ic.has(t[r].toLowerCase())&&t[r+1];)r+=2;if("from"===t[r]?.toLowerCase()&&t[r+1])for(r++;t[r]&&!al.has(t[r].toLowerCase())&&!qc.has(t[r].toLowerCase());)r++;const n=t[r]?.toLowerCase();if(!n||!qc.has(n))return null;const i=r;let a=r+1;"async"!==n&&"once"!==n&&("at"===t[a]?.toLowerCase()&&a++,t[a]&&/^\d+(ms|s|m)?$/.test(t[a])&&a++);const s=t.slice(i,a).join(" "),o=[...t.slice(0,i),...t.slice(a)].join(" ");return t.length-(a-i)>2?[s,this.transform(o)].filter(e=>e.length>0).join(" "):null}transformSetWithScope(e){const t=this.sourceProfile.code,r=this.targetProfile.code,n=e.match(/^(.*\bset\b.*\S)\s+on\s+([#.<@[]\S*|me|it|you)\s*$/i);if(!n)return null;const i=n[2],a=this.transformSingle(n[1]),s=/^[#.<@[]/.test(i)?i:zc(i,t,r);if("SOV"===this.targetProfile.wordOrder){const t=zc("set","en",r),n=e.trim().split(/\s+/)[0]?.toLowerCase(),i=!!n&&Pc.has(n),o=a.split(/\s+/).filter(Boolean);if(i){if(o.length>0&&o[o.length-1]===t)return o.splice(o.length-1,0,"on",s),o.join(" ")}else{const e=o.indexOf(t);if(e>=0)return o.splice(e,1),o.push("on",s,t),o.join(" ")}return`${a} on ${s}`}return`${a} on ${s}`}transformBlockBody(e){const t=this.sourceProfile.code,r=this.targetProfile.code,n=e[0],i="end"===e[e.length-1]?.toLowerCase(),a=i?e[e.length-1]:"",s=e.slice(1,i?-1:void 0),o=yc(t),l=vc(t);let c=s.findIndex((e,t)=>o.has(e.toLowerCase())&&!bc(s,t,l));0>c&&(c=s.length);const u=s.slice(0,c).join(" "),d=s.slice(c),m=zc(n,t,r),p=a?zc(a,t,r):"",h=u?Fc(u,t,r):"",f=this.transformConditionalBody(d);return[m,h,"SOV"===this.targetProfile.wordOrder&&h&&new Set(["first","last","next","previous","closest"]).has(d[1]?.toLowerCase())&&"then"!==s[c-1]?.toLowerCase()?zc("then",t,r):"",f,p].filter(e=>e.length>0).join(" ")}transformConditionalBody(e){const t=this.sourceProfile.code,r=this.targetProfile.code,n=zc("else","en",t).toLowerCase();let i=0,a=-1;for(let t=0;e.length>t;t++){const r=e[t].toLowerCase();if(Tc.has(r))i++;else if("end"===r&&i>0)i--;else if(r===n&&0===i){a=t;break}}if(-1===a){const t=e.join(" ");return t?this.transform(t):""}const s=e.slice(0,a).join(" "),o=e.slice(a+1).join(" "),l=zc(e[a],t,r);return[s?this.transform(s):"",l,o?this.transform(o):""].filter(e=>e.length>0).join(" ")}transformBlock(e){const t=this.sourceProfile.code,r=this.targetProfile.code,n=zc(e.headKeyword,t,r),i=e.tailKeyword?zc(e.tailKeyword,t,r):"",a=e.connector?zc(e.connector,t,r):"";return[n,e.prefixExpr?Fc(e.prefixExpr,t,r):"",a,this.transform(e.body),i].filter(e=>e.length>0).join(" ")}findRule(e){if(this.targetProfile.rules)return this.targetProfile.rules.filter(t=>this.matchesRule(e,t)).sort((e,t)=>t.priority-e.priority)[0]}matchesRule(e,t){const{match:r}=t;for(const t of r.requiredRoles)if(!e.roles.has(t))return!1;if(r.commands&&r.commands.length>0){const t=e.roles.get("action");if(!t)return!1;const n=t.value.toLowerCase();if(!r.commands.some(e=>e.toLowerCase()===n))return!1}return!(r.predicate&&!r.predicate(e))}};function Gc(e,t){return new Xc("en",t).transform(e)}function Jc(e,t){return new Xc(t,"en").transform(e)}Jl.register("en",hl()),Jl.register("es",yl),Jl.register("ja",vl),Jl.register("fr",wl),Jl.register("de",El),Jl.register("ar",Cl),Jl.register("ko",Sl),Jl.register("zh",Ll),Jl.register("tr",jl),Jl.register("id",Il),Jl.register("pt",_l),Jl.register("qu",Nl),Jl.register("sw",Ml);let Yc="en";const Qc=Kn(ii,ra,ca,en,Gr,ga),eu=function(e,t){const r=new $n(null);for(const t of e)r.register(t);return new Un({registry:r,expressionRegistry:t.expressionRegistry,enableAsyncCommands:t.enableAsyncCommands??!0,commandTimeout:t.commandTimeout??1e4,enableErrorReporting:t.enableErrorReporting??!0,enableResultPattern:t.enableResultPattern??!0})}([Za(),ns(),Ss(),Ts(),js(),Is(),Ms(),$s(),Vs(),Bs(),Ds(),Us(),Xs(),Gs(),Ys(),to(),no(),io(),ao(),oo(),lo(),mo(),po(),yo(),go(),vo(),wo(),Co(),Lo(),Po(),Io(),qo(),No(),Ro(),Mo(),$o(),_o(),zo(),Bo(),Wo(),Do(),Fo(),Vo(),Ho(),Uo(),Ko(),Zo(),new Xo,Yo(),Qo(),new el,new tl],{expressionRegistry:Qc});function tu(e){const t=function(){if("en"!==Yc)return Jl.get(Yc)}();return er(e,t?{keywords:t}:void 0)}const ru={parse:e=>tu(e),execute:async(e,t)=>{const r=pr(t),n=tu(e);if(!n.success||!n.node)throw Error(n.error?.message||"Parse failed");return await eu.execute(n.node,r)}},nu=function(e){return new Zn(e)}(ru),iu={getLocale:()=>Yc,setLocale(e){if(Jl.has(e)){if(Yc=e,Jl.setDefault(e),"undefined"!=typeof document){document.documentElement.setAttribute("lang",e);const t=ic(e);"rtl"===t?.direction?document.documentElement.setAttribute("dir","rtl"):document.documentElement.setAttribute("dir","ltr")}}else console.warn(`Locale '${e}' not registered. Available: ${Jl.getAvailable().join(", ")}`)},getAvailableLocales:()=>Jl.getAvailable(),detectAndSetLocale(){if("undefined"==typeof navigator)return"en";const e=navigator.languages||[navigator.language];for(const t of e){const e=t.split("-")[0].toLowerCase();if(Jl.has(e))return this.setLocale(e),e}return"en"},registerLocale(e,t){Jl.register(e,t)},toLocale:(e,t)=>Gc(e,t||Yc),toEnglish:(e,t)=>Jc(e,t||Yc),translate:function(e,t,r){return t===r?e:"en"===t?Gc(e,r):"en"===r?Jc(e,t):pc.has(`${t}->${r}`)?function(e,t,r){const n=pc.get(`${t}->${r}`);if(!n)return Gc(Jc(e,t),r);return e.split(/\s+/).map(e=>{if(e.startsWith("#")||e.startsWith(".")||e.startsWith("@"))return e;if(e.startsWith('"')||e.startsWith("'"))return e;const t=n.words[e];if(t)return t;const r=e.match(/^(.+?)(-.+)$/);if(r){const[,e,t]=r;return(n.words[e]||e)+t}return e}).join(" ")}(e,t,r):Gc(Jc(e,t),r)},createTransformer:(e,t)=>new Xc(e,t),getProfile:ic,getSupportedGrammarLocales:function(){return Object.keys(nc)},profiles:nc,dictionaries:{en:{},es:fl,ja:gl,fr:bl,de:kl,ar:xl,ko:Al,zh:Tl,tr:Ol,id:Pl,pt:$l,qu:ql,sw:Rl},createKeywordProvider:pl},au={runtime:ru,parse:e=>tu(e),compile:e=>{const t=performance.now();try{const r=tu(e);return{success:r.success,ast:r.node,errors:r.errors??(r.error?[r.error]:[]),tokens:r.tokens||[],compilationTime:performance.now()-t}}catch(e){return{success:!1,ast:void 0,errors:[{message:e instanceof Error?e.message:e+"",line:1,column:1}],tokens:[],compilationTime:performance.now()-t}}},execute:async(e,t)=>{const r=pr(t);if("string"==typeof e){const t=tu(e);if(!t.success||!t.node)throw Error(t.error?.message||"Parse failed");return await eu.execute(t.node,r)}if(e&&"object"==typeof e)return await eu.execute(e,r);throw Error("execute() requires a code string or compiled AST")},run:async(e,t)=>{const r=pr(t),n=tu(e);if(!n.success||!n.node)throw Error(n.error?.message||"Parse failed");return await eu.execute(n.node,r)},evaluate:async(e,t)=>au.run(e,t),processNode:e=>{e===document?nu.scanAndProcessAll():e instanceof HTMLElement&&nu.processElement(e)},process:e=>au.processNode(e),createContext:mr,attributeProcessor:nu,version:"1.1.0-classic-i18n",i18n:iu,commands:["add","remove","toggle","put","hide","show","make","if","unless","repeat","break","continue","halt","return","exit","throw","set","get","increment","decrement","default","wait","fetch","trigger","send","transition","measure","settle","take","log","tell","call","copy","pick","beep","js","async","go","install","append","prepend","render","pseudo-command"],locales:["en","es","ja","fr","de","ar","ko","zh","tr","id","pt","qu","sw"],eval:async(e,t)=>ru.execute(e,t),init:e=>{!1!==e?.autoDetectLocale&&iu.detectAndSetLocale(),nu.init()}};"undefined"!=typeof window&&(window.hyperfixi=au,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{au.init()}):au.init());class su{constructor(){this.name="addition",this.category="Special",this.syntax="left + right",this.outputType="number",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=this.validate(t);if(!r.isValid)return{success:!1,errors:r.errors,suggestions:r.suggestions};try{const{left:e,right:r}=t,n=bi(e,"left operand");return{success:!0,value:ki(n+bi(r,"right operand"),"addition"),type:"number"}}catch(e){return{success:!1,errors:[Si("runtime-error","Addition failed: "+(e instanceof Error?e.message:e+""))],suggestions:["Ensure both operands are numeric"]}}}validate(e){const t=function(e){if(null==e)return Ai([Si("missing-argument","Input is null or undefined")],["Provide an object with left and right operands"]);if("object"!=typeof e)return Ai([Si("type-mismatch","Expected object, got "+typeof e)],["Provide an object with left and right operands"]);const t=e;if(!("left"in t)||!("right"in t)){const e=[];return"left"in t||e.push("left"),"right"in t||e.push("right"),Ai([Si("missing-argument",`Missing ${e.join(" and ")} operand${e.length>1?"s":""}`)],["Provide { left: value, right: value }"])}return{isValid:!0,errors:[],suggestions:[]}}(e);if(!t.isValid)return t;const{left:r,right:n}=e;return Ei(r)?Ei(n)?{isValid:!0,errors:[],suggestions:[]}:{isValid:!1,errors:[Si("type-mismatch","Right operand cannot be converted to number: "+n)],suggestions:["Provide a numeric value for right operand"]}:{isValid:!1,errors:[Si("type-mismatch","Left operand cannot be converted to number: "+r)],suggestions:["Provide a numeric value for left operand"]}}}const ou={addition:new su,subtraction:new class{constructor(){this.name="subtraction",this.category="Special",this.syntax="left - right",this.outputType="number",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=this.validate(t);if(!r.isValid)return{success:!1,errors:r.errors,suggestions:r.suggestions};try{const{left:e,right:r}=t,n=bi(e,"left operand");return{success:!0,value:ki(n-bi(r,"right operand"),"subtraction"),type:"number"}}catch(e){return{success:!1,errors:[Si("runtime-error","Subtraction failed: "+(e instanceof Error?e.message:e+""))],suggestions:["Ensure both operands are numeric"]}}}validate(e){return(new su).validate(e)}},multiplication:new class{constructor(){this.name="multiplication",this.category="Special",this.syntax="left * right",this.outputType="number",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=this.validate(t);if(!r.isValid)return{success:!1,errors:r.errors,suggestions:r.suggestions};try{const{left:e,right:r}=t,n=bi(e,"left operand");return{success:!0,value:ki(n*bi(r,"right operand"),"multiplication"),type:"number"}}catch(e){return{success:!1,errors:[Si("runtime-error","Multiplication failed: "+(e instanceof Error?e.message:e+""))],suggestions:["Ensure both operands are numeric"]}}}validate(e){return(new su).validate(e)}},division:new class{constructor(){this.name="division",this.category="Special",this.syntax="left / right",this.outputType="number",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=this.validate(t);if(!r.isValid)return{success:!1,errors:r.errors,suggestions:r.suggestions};try{const{left:e,right:r}=t,n=function(e,t,r=!0){if(0===t){if(r)return 0===e?NaN:e>0?1/0:-1/0;throw Error("Division by zero")}return e/t}(bi(e,"left operand"),bi(r,"right operand"),!0);return{success:!0,value:n,type:"number"}}catch(e){return{success:!1,errors:[Si("runtime-error","Division failed: "+(e instanceof Error?e.message:e+""))],suggestions:["Ensure both operands are numeric"]}}}validate(e){return(new su).validate(e)}},modulo:new class{constructor(){this.name="modulo",this.category="Special",this.syntax="left mod right",this.outputType="number",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=this.validate(t);if(!r.isValid)return{success:!1,errors:r.errors,suggestions:r.suggestions};try{const{left:e,right:r}=t,n=function(e,t){if(0===t)throw Error("Modulo by zero");return e%t}(bi(e,"left operand"),bi(r,"right operand"));return{success:!0,value:n,type:"number"}}catch(e){return{success:!1,errors:[Si("runtime-error","Modulo failed: "+(e instanceof Error?e.message:e+""))],suggestions:["Ensure both operands are numeric and divisor is not zero"]}}}validate(e){return(new su).validate(e)}},power:new class{constructor(){this.name="power",this.category="Special",this.syntax="left ** right",this.outputType="number",this.metadata={category:"Special",complexity:"simple"}}async evaluate(e,t){const r=this.validate(t);if(!r.isValid)return{success:!1,errors:r.errors,suggestions:r.suggestions};try{const{left:e,right:r}=t,n=bi(e,"left operand"),i=bi(r,"right operand");return{success:!0,value:ki(Math.pow(n,i),"power"),type:"number"}}catch(e){return{success:!1,errors:[Si("runtime-error","Power failed: "+(e instanceof Error?e.message:e+""))],suggestions:["Ensure both operands are numeric"]}}}validate(e){return(new su).validate(e)}}};var lu=Object.freeze({__proto__:null,conversion:Gr,conversionExpressions:Gr,createCommonRegistry:function(){return Kn(ii,ra,ca,Gr,ga)},createCoreRegistry:function(){return Kn(ii,ra,ca)},createExpressionRegistry:Kn,createFullExpressionRegistry:function(){return Kn(ii,ra,Gr,ga,en,ca,ou)},createFullRegistry:function(){return Kn(ii,ra,ca,Gr,ga,en)},logical:ra,logicalExpressions:ra,positional:ga,positionalExpressions:ga,properties:en,propertiesExpressions:en,references:ii,referencesExpressions:ii,special:ca,specialExpressions:ca});return au}();
2
2
  //# sourceMappingURL=hyperfixi-classic-i18n.js.map