@hyperfixi/core 2.10.0 → 2.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ast-utils/index.js +109 -8
- package/dist/ast-utils/index.mjs +109 -8
- package/dist/behaviors/index.js +2 -1
- package/dist/behaviors/index.mjs +2 -1
- package/dist/chunks/{bridge-CPNAPYAo.js → bridge-qaAHXV7X.js} +2 -2
- package/dist/chunks/browser-modular-DqXN1HOD.js +2 -0
- package/dist/chunks/{index-BQkkNlzO.js → index-CbRUhmE7.js} +2 -2
- package/dist/commands/helpers/dom-mutation.d.ts +3 -2
- package/dist/commands/helpers/index.d.ts +1 -1
- package/dist/commands/index.js +74 -8
- package/dist/commands/index.mjs +74 -8
- package/dist/hyperfixi-browser-classic-i18n.js +1 -1
- package/dist/hyperfixi-browser-minimal.js +1 -1
- package/dist/hyperfixi-browser-standard.js +1 -1
- package/dist/hyperfixi-browser.js +1 -1
- package/dist/hyperfixi-classic-i18n.js +1 -1
- package/dist/hyperfixi-hx-v4.js +1 -1
- package/dist/hyperfixi-minimal.js +1 -1
- package/dist/hyperfixi-multilingual.js +1 -1
- package/dist/hyperfixi-standard.js +1 -1
- package/dist/hyperfixi.js +1 -1
- package/dist/hyperfixi.mjs +1 -1
- package/dist/index.js +224 -33
- package/dist/index.min.js +1 -1
- package/dist/index.mjs +224 -33
- package/dist/lokascript-browser-classic-i18n.js +1 -1
- package/dist/lokascript-browser-minimal.js +1 -1
- package/dist/lokascript-browser-standard.js +1 -1
- package/dist/lokascript-browser.js +1 -1
- package/dist/lokascript-multilingual.js +1 -1
- package/dist/lsp-metadata.js +2 -2
- package/dist/lsp-metadata.mjs +2 -2
- package/dist/metadata.d.ts +1 -1
- package/dist/metadata.js +13 -11
- package/dist/metadata.mjs +13 -11
- package/dist/reference/index.js +7 -2
- package/dist/reference/index.mjs +7 -2
- package/dist/registry/index.js +6 -4
- package/dist/registry/index.mjs +6 -4
- package/dist/utils/element-check.d.ts +1 -0
- package/dist/version.d.ts +2 -0
- package/package.json +5 -5
- package/dist/chunks/browser-modular-B0lGdcoP.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{v as e}from"./feature-sockets-CcTxD5sT.js";function t(e){return e instanceof Error&&("isHalt"in e||"isExit"in e||"isBreak"in e||"isContinue"in e||"isReturn"in e)?e:null}function r(e){return{ok:!0,value:e}}function n(e){return{ok:!1,error:e}}function i(e){return!0===e.ok}const a=[{name:"add",category:"dom",tier:"lite",upstreamOrExtension:"upstream",multiword:!0},{name:"append",category:"content",tier:"hybrid",upstreamOrExtension:"upstream",multiword:!1},{name:"async",category:"advanced",tier:"hybrid",upstreamOrExtension:"extension",multiword:!1},{name:"beep",category:"utility",tier:"full",upstreamOrExtension:"extension",multiword:!1},{name:"blur",category:"execution",tier:"lite-plus",upstreamOrExtension:"upstream",multiword:!1},{name:"break",category:"control-flow",tier:"hybrid",upstreamOrExtension:"upstream",multiword:!1},{name:"breakpoint",category:"utility",tier:"full",upstreamOrExtension:"upstream",multiword:!1},{name:"call",category:"execution",tier:"hybrid",upstreamOrExtension:"upstream",multiword:!1},{name:"clear",category:"data",tier:"full",upstreamOrExtension:"upstream",multiword:!1},{name:"close",category:"dom",tier:"full",upstreamOrExtension:"upstream",multiword:!1},{name:"continue",category:"control-flow",tier:"hybrid",upstreamOrExtension:"upstream",multiword:!1},{name:"copy",category:"utility",tier:"full",upstreamOrExtension:"extension",multiword:!1},{name:"decrement",category:"data",tier:"lite-plus",upstreamOrExtension:"upstream",consolidationAliasOf:"increment",multiword:!1},{name:"default",category:"data",tier:"full",upstreamOrExtension:"upstream",multiword:!1},{name:"empty",category:"dom",tier:"lite-plus",upstreamOrExtension:"upstream",multiword:!1},{name:"exit",category:"control-flow",tier:"full",upstreamOrExtension:"upstream",multiword:!1},{name:"fetch",category:"async",tier:"hybrid",upstreamOrExtension:"upstream",multiword:!1},{name:"focus",category:"execution",tier:"lite-plus",upstreamOrExtension:"upstream",multiword:!1},{name:"get",category:"data",tier:"lite-plus",upstreamOrExtension:"upstream",multiword:!1},{name:"go",category:"navigation",tier:"lite-plus",upstreamOrExtension:"upstream",multiword:!0},{name:"halt",category:"control-flow",tier:"full",upstreamOrExtension:"upstream",multiword:!0},{name:"hide",category:"dom",tier:"lite",upstreamOrExtension:"upstream",multiword:!0},{name:"if",category:"control-flow",tier:"hybrid",upstreamOrExtension:"upstream",multiword:!1},{name:"increment",category:"data",tier:"lite-plus",upstreamOrExtension:"upstream",multiword:!1},{name:"install",category:"behaviors",tier:"full",upstreamOrExtension:"upstream",multiword:!1},{name:"js",category:"advanced",tier:"full",upstreamOrExtension:"upstream",multiword:!0},{name:"log",category:"utility",tier:"lite-plus",upstreamOrExtension:"upstream",multiword:!1},{name:"make",category:"dom",tier:"hybrid",upstreamOrExtension:"upstream",multiword:!1},{name:"measure",category:"animation",tier:"full",upstreamOrExtension:"upstream",multiword:!0},{name:"morph",category:"dom",tier:"full",upstreamOrExtension:"upstream",multiword:!0},{name:"open",category:"dom",tier:"full",upstreamOrExtension:"upstream",multiword:!1},{name:"pick",category:"utility",tier:"full",upstreamOrExtension:"upstream",multiword:!0},{name:"prepend",category:"content",tier:"hybrid",upstreamOrExtension:"extension",multiword:!1},{name:"process",category:"dom",tier:"full",upstreamOrExtension:"extension",multiword:!0},{name:"pseudo-command",category:"execution",tier:"full",upstreamOrExtension:"upstream",multiword:!1},{name:"push",category:"navigation",tier:"hybrid",upstreamOrExtension:"extension",multiword:!0},{name:"put",category:"dom",tier:"lite",upstreamOrExtension:"upstream",multiword:!0},{name:"remove",category:"dom",tier:"lite",upstreamOrExtension:"upstream",multiword:!0},{name:"render",category:"templates",tier:"full",upstreamOrExtension:"upstream",multiword:!1},{name:"repeat",category:"control-flow",tier:"hybrid",upstreamOrExtension:"upstream",multiword:!1},{name:"replace",category:"navigation",tier:"hybrid",upstreamOrExtension:"extension",consolidationAliasOf:"push",multiword:!0},{name:"reset",category:"dom",tier:"full",upstreamOrExtension:"upstream",multiword:!1},{name:"return",category:"control-flow",tier:"full",upstreamOrExtension:"upstream",multiword:!1},{name:"scroll",category:"navigation",tier:"full",upstreamOrExtension:"upstream",multiword:!1},{name:"select",category:"dom",tier:"full",upstreamOrExtension:"upstream",multiword:!1},{name:"send",category:"event",tier:"hybrid",upstreamOrExtension:"upstream",consolidationAliasOf:"trigger",multiword:!0},{name:"set",category:"data",tier:"lite",upstreamOrExtension:"upstream",multiword:!0},{name:"settle",category:"animation",tier:"full",upstreamOrExtension:"upstream",multiword:!1},{name:"show",category:"dom",tier:"lite",upstreamOrExtension:"upstream",multiword:!0},{name:"start",category:"animation",tier:"full",upstreamOrExtension:"upstream",multiword:!0},{name:"swap",category:"dom",tier:"hybrid",upstreamOrExtension:"upstream",multiword:!0},{name:"take",category:"animation",tier:"full",upstreamOrExtension:"upstream",multiword:!0},{name:"tell",category:"utility",tier:"full",upstreamOrExtension:"upstream",multiword:!0},{name:"throw",category:"control-flow",tier:"full",upstreamOrExtension:"upstream",multiword:!1},{name:"toggle",category:"dom",tier:"lite",upstreamOrExtension:"upstream",multiword:!0},{name:"transition",category:"animation",tier:"full",upstreamOrExtension:"upstream",multiword:!1},{name:"trigger",category:"event",tier:"lite-plus",upstreamOrExtension:"upstream",multiword:!0},{name:"unless",category:"control-flow",tier:"full",upstreamOrExtension:"extension",consolidationAliasOf:"if",multiword:!1},{name:"wait",category:"async",tier:"lite-plus",upstreamOrExtension:"upstream",multiword:!1}],o="then",s="else",l="end",c="and",u="if",p="for",d="while",m="until",f="forever",h="times",y="each",v="index",g="in",k="to",w="from",b="with",z="of",x="by",E="between",T="on",S="event",C="def",A="behavior",L="global",j="local",P="the",O="start",N=[o,c,s,l,T],R=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"]),M=new Set(["put","trigger","send","remove","take","toggle","set","show","hide","add","halt","measure","js","go","tell","pick","start","swap","morph","push","replace","process"]),I=new Set(["if","unless","repeat","wait","for","while"]),W="at",_="at start of",q="at end of",$=["into","before","after",W,_,q,"at the start of","at the end of"],V=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"]),D={isCommand:e=>R.has(e.toLowerCase()),isCompoundCommand:e=>M.has(e.toLowerCase()),isControlFlowCommand:e=>I.has(e.toLowerCase()),isKeyword:e=>V.has(e.toLowerCase()),isTerminator:e=>N.includes(e),isPutOperation:e=>$.includes(e),isCSSFunction:e=>B.has(e.toLowerCase())},B=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"]),H=new Set(["me","it","you","result","my","its","your"]),K=new Set(["and","or","not","no"]),F=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"]),U=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"]),G=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"]),Z=new Set(["then","end","to","into","on","with","from","in","by","for","while","until","unless","else","catch","finally"]),Y=new Set([")","]","}",","]);function X(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 J(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 Q(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}})}}}const ee=new Map([["or",X(10)],["||",X(10)],["and",X(20)],["&&",X(20)],["==",X(30)],["!=",X(30)],["<",X(30)],[">",X(30)],["<=",X(30)],[">=",X(30)],["is",X(30)],["matches",X(30)],["contains",X(30)],["starts with",X(30)],["ends with",X(30)],["does not start with",X(30)],["does not end with",X(30)],["is between",X(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",X(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",X(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",X(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",X(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",X(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",X(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",X(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",X(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}})],["+",{...X(40),...Q(80)}],["-",{...X(40),...Q(80)}],["*",X(50)],["/",X(50)],["%",X(50)],["mod",X(50)],["^",J(60)],["**",J(60)],["as",X(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",Q(80)],["!",Q(80)],["no",Q(27)]]);function te(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 o=n.peek();return o&&"!"===o.value&&(n.advance(),a=!1),{type:"typeCheckExpression",value:t,typeName:i.value,nullOk:a,negated:e,start:t.start,end:i.end}}}const re=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}(ee,new Map([["===",X(30)],["!==",X(30)],["is not",X(30)],["am",X(30)],["is in",X(30)],["is not in",X(30)],["precedes",X(30)],["does not precede",X(30)],["follows",X(30)],["does not follow",X(30)],["is a",X(30,te(!1))],["is an",X(30,te(!1))],["is not a",X(30,te(!0))],["is not an",X(30,te(!0))],["has",X(30)],["have",X(30)],["match",X(30)],["include",X(30)],["includes",X(30)],["equals",X(30)],["does not contain",X(30)],["does not include",X(30)],["am in",X(30)],["am not in",X(30)],["is really",X(30)],["is not really",X(30)],["is equal",X(30)],["is not equal",X(30)],["contain",X(30)],["do not contain",X(30)],["does not contains",X(30)],["do not match",X(30)],["does not match",X(30)],["is equal to",X(30)],["is not equal to",X(30)],["is really equal to",X(30)],["is not really equal to",X(30)],["really equals",X(30)],["is greater than",X(30)],["is less than",X(30)],["is greater than or equal to",X(30)],["is less than or equal to",X(30)],["in",X(30)],["of",J(30)],["really",X(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",Q(80)]]),new Map([["=",J(5)]])),ne=new Map,ie=new Map,ae=new Map,oe=new Set,se=new Set,le=new Set,ce=new Set;function ue(e){return ne.get(e.toLowerCase())}function pe(e){return ae.get(e)}function de(e,t){if(0!==se.size)for(const r of se)try{r(e,t)}catch(e){void 0!==console&&console.error("[hyperfixi] globalReadHook threw:",e)}}function me(e,t,r){if(0!==le.size)for(const n of le)try{n(e,t,r)}catch(e){void 0!==console&&console.error("[hyperfixi] localWriteHook threw:",e)}}function fe(e,t){if(0!==ce.size)for(const r of ce)try{r(e,t)}catch(e){void 0!==console&&console.error("[hyperfixi] localReadHook threw:",e)}}function he(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)}}const ye=new Map,ve=new WeakMap;function ge(e){let t=ve.get(e);return t||(t=new Map,ve.set(e,t)),t}function ke(e){const t=e.owner;return t||(e.me instanceof Element?e.me:null)}function we(e,t){const r=ke(e);if(r)return fe(t,e),ge(r).get(t)}function be(e,t,r){const n=ke(e);n&&(ge(n).set(t,r),me(t,r,e))}function ze(e,t){return{me:e??null,owner:e??null,it:null,you:null,result:null,locals:new Map,globals:ye,flags:{halted:!1,breaking:!1,continuing:!1,returning:!1,async:!1}}}function xe(){return ye}function Ee(e){return null!==e&&"object"==typeof e&&"nodeType"in e&&1===e.nodeType&&"tagName"in e&&"string"==typeof e.tagName&&"classList"in e}function Te(e){if(null===e||"object"!=typeof e)return!1;const t=e.nodeType;return 1===t||3===t||11===t}function Se(e){return null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(Symbol.iterator in e||"function"==typeof e.item)}function Ce(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 Ae(e,t,r){return"element"===r?we(t,e):"global"===r&&t.globals&&t.globals.has(e)?t.globals.get(e):"global"!==r&&t.locals&&t.locals.has(e)?(fe(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)?(fe(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 Le(e,t,r,n){if("element"!==n){if("global"===n)return he(r,e,t),void("undefined"!=typeof window&&(window[e]=t));if(e.startsWith("$")){return void he(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 he(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 he(r,e,t);r.locals.set(e,t),me(e,t,r)}}else be(r,e,t)}function je(e,t){return"me"===e?t.me:"it"===e?t.it:"you"===e?t.you:Ae(e,t)}function Pe(e,t,r,n){if("number"==typeof e)return e;if(Ee(e)){const r=e;if(t){if(t.startsWith("data-")||["id","class","title","alt","src","href"].includes(t)){return Ce(r.getAttribute(t))}return Ce(r[t])}return Ce(r.value||r.textContent)}if("string"==typeof e){if("element"===r)return Ce(Ae(e,n,"element"));if("global"===r){return Ce(Ae(e,n,"global"))}if(e.includes("."))return function(e,t){const r=e.split("."),n=r[1],i=je(r[0],t);return i?Ce(i[n]):0}(e,n);if("me"===e&&n.me)return Ce(n.me.value||0);if("it"===e)return Ce(n.it||0);if("you"===e&&n.you)return Ce(n.you.value||0);return Ce(Ae(e,n))}return Ce(e)}function Oe(e,t,r,n,i){if(Ee(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 Le(e,n,i,"element");if("global"===r)return void Le(e,n,i,"global");if(e.includes("."))return void function(e,t,r){const n=e.split("."),i=n[1],a=je(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);Le(e,n,i)}}function Ne(e,t,r){return r||"string"!=typeof t||!t.startsWith("#")?e:Array.isArray(e)?e[0]??null:e}function Re(e){if("undefined"==typeof document)throw Error("DOM not available");const t=Array.from(document.querySelectorAll(e)).filter(e=>Ee(e));if(!t.length)throw Error(`No elements: "${e}"`);return t}function Me(e){if(Ee(e))return[e];if(Array.isArray(e)){const t=e.filter(Ee);return t.length>0?t:null}if("undefined"!=typeof NodeList&&e instanceof NodeList){const t=Array.from(e).filter(Ee);return t.length>0?t:null}return null}const Ie=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 We(e){const t=Ie.get("String");return t?t.isType(e):"string"==typeof e}function _e(e){const t=Ie.get("Number");return t?t.isType(e):"number"==typeof e}function qe(e){const t=Ie.get("Boolean");return t?t.isType(e):"boolean"==typeof e}function $e(e){const t=Ie.get("Object");return t?t.isType(e):"object"==typeof e&&null!==e}function Ve(e){const t=Ie.get("Function");return t?t.isType(e):"function"==typeof e}function De(e){return null!==e&&"object"==typeof e&&"nodeType"in e&&1===e.nodeType&&"style"in e}function Be(e){return e instanceof Element}function He(e){return e instanceof HTMLElement}const Ke=new Set(["disabled","readonly","required","checked","selected","hidden","open","autofocus","autoplay","controls","loop","muted","multiple","reversed","defer","async","novalidate","formnovalidate","ismap"]);function Fe(e,t){return Ke.has(t.toLowerCase())?e.hasAttribute(t):e.getAttribute(t)}const Ue={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=>De(e)?e.tabIndex:void 0,hidden:e=>De(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 Ge(e,t){if(t.startsWith("*"))return function(e,t){if(!He(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);if(He(e)){return getComputedStyle(e).getPropertyValue(r)}return}if(t.startsWith("@")){return Fe(e,t.slice(1))}const r=Ue[t.toLowerCase()];if(r)return r(e);if(function(e,t){return e.hasAttribute(t)}(e,t))return Fe(e,t);const n=e[t];return Ve(n)?n.bind(e):n}const Ze={1:"one",2:"two",3:"three",4:"four",5:"five"};function Ye(e,t,r,n){if(e.length!==t){const e=n?` (${n})`:"";return`${r} requires exactly ${i=t,Ze[i]??i+""} argument${1===t?"":"s"}${e}`}var i;return null}function Xe(e,t,r,n){if("string"!=typeof e[t]){return`${r} ${n||"argument "+(t+1)} must be a string`}return null}function Je(e,t,r){return Ye(e,1,t,r)??Xe(e,0,t,r)}function Qe(e,t){return Ye(e,2,t,"left, right")}function et(){return null}function tt(e,t,r,n){if(e.length>t){return`${r} expression takes at most ${1===t?"one":t+""} argument${1===t?"":"s"}${n?` (${n})`:""}`}return null}function rt(e,t,r,n,i){if(t>e.length||e.length>r){return`${n} requires ${t}-${r} arguments${i?` (${i})`:""}`}return null}const nt={conversions:{dynamicResolvers:[]}},it={Array:e=>Array.isArray(e)?e:e instanceof NodeList?Array.from(e):null==e?[]:[e],String:e=>null==e?"":We(e)?e:$e(e)?JSON.stringify(e):e+"",Boolean:e=>{if(qe(e))return e;if(null==e)return!1;if(We(e)){const t=e.toLowerCase().trim();return"false"!==t&&"0"!==t&&""!==t}return _e(e)?0!==e&&!isNaN(e):!!e},Number:e=>{if(_e(e))return e;if(null==e)return 0;const t=Number(e);return isNaN(t)?0:t},Math:e=>{if(_e(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(!_e(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=it.Number(e);return Math.trunc(t)},Float:e=>{const t=it.Number(e);return parseFloat(""+t)},Date:e=>{if(e instanceof Date)return e;if(null==e)return new Date(NaN);if(We(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(!We(e))return e;try{return JSON.parse(e)}catch{return e}},JSONString:e=>{try{return JSON.stringify(e)}catch{return"{}"}},Object:e=>{if($e(e))return e;if(We(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=>We(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:it.String(e)).join(""):e instanceof Element?e.outerHTML:it.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=at(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]=at(e))}),r}return{}},FormEncoded:(e,t)=>{const r=e instanceof HTMLElement?it.Values(e,t):e;if(!$e(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=it.Values(e,t);return it.FormEncoded(r,t)},"Values:JSON":(e,t)=>{const r=it.Values(e,t);return JSON.stringify(r)}};function at(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 ot={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 st(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 it.Number(e).toFixed(r??0)}if(null==e)return e;let n=it[t];if(n)return n(e,r);const i=ot[t.toLowerCase()];if(i&&(n=it[i],n))return n(e,r);const a=nt.conversions[t];if("function"==typeof a)return a(e,r);for(const r of nt.conversions.dynamicResolvers){const n=r(t,e);if(void 0!==n)return n}return console.warn("Unknown conversion type: "+t),e}const lt={as:{name:"as",category:"Conversion",evaluatesTo:"Any",precedence:20,associativity:"Left",operators:["as"],async evaluate(e,...t){const[r,n]=t;return st(r,n,e)},validate:e=>Ye(e,2,"as","value, type")??Xe(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(!We(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 We(r);case"number":return _e(r)&&!isNaN(r);case"boolean":return qe(r);case"object":return $e(r);case"array":return Array.isArray(r);case"function":return Ve(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||$e(r)&&0===Object.keys(r).length;default:return r?.constructor?.name?.toLowerCase()===n.toLowerCase()}},validate:e=>Ye(e,2,"is","value, type")??Xe(e,1,"is","type")},async:{name:"async",category:"Conversion",evaluatesTo:"Any",precedence:25,associativity:"Right",operators:["async"],evaluate:async(e,t)=>t,validate:e=>Ye(e,1,"async","expression")}},ct=new Set(["__proto__","constructor","prototype"]);function ut(e,t){if(e instanceof Element)return Ge(e,t);if($e(e)){if(ct.has(t))return;return e[t]}return e[t]}function pt(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 dt={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 pt(r)&&!(n in r)?Array.from(r,e=>ut(e,n)):ut(r,n)}},validate:e=>Ye(e,2,"possessive","element, property")??Xe(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 Ge(e.me,r);if($e(e.me)){if(ct.has(r))return;return e.me[r]}return e.me[r]}},validate:e=>Je(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 Ge(n,r);if($e(n)){if(ct.has(r))return;return n[r]}return n[r]},validate:e=>Je(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 Ge(e.you,r);if($e(e.you)){if(ct.has(r))return;return e.you[r]}return e.you[r]}},validate:e=>Je(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 Ge(n,r);if($e(n)){if(ct.has(r))return;return n[r]}return n[r]}},validate:e=>Ye(e,2,"of","property, object")??Xe(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=>rt(e,1,2,"attribute","attributeName, optional element")??Xe(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;if(!(a&&a instanceof Element))return!1;return a.getAttribute(r)===n},validate:e=>rt(e,2,3,"attributeWithValue","attributeName, expectedValue, optional element")??Xe(e,0,"attributeWithValue","attribute name")??Xe(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=>Je(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=>Je(e,"idReference","idValue")}};function mt(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]}var ft;!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"}(ft||(ft={}));const ht=new Set(["+","-","*","/","mod"]),yt=new Set(["ms","s","seconds","minutes","hours","days"]);function vt(e){const t={input:"",position:0,line:1,column:1,tokens:[]};t.input=e;const r=e.length;for(;r>t.position&&(wt(t),r>t.position);){const r=e[t.position];if("-"!==r||"-"!==gt(t,1))if('"'!==r){if("'"===r||"'"===r){const e=gt(t,1),r=t.tokens[t.tokens.length-1];if("s"===e&&r&&!/\s/.test(t.input[t.position-1]??" ")&&(r.kind===ft.IDENTIFIER||r.kind===ft.SELECTOR||"]"===r.value||")"===r.value||"}"===r.value)){const e=t.position;kt(t),kt(t),bt(t,ft.OPERATOR,"'s",e)}else Et(t);continue}if("`"!==r)if("<"!==r)if("#"!==r){if("."===r){if("."===gt(t,1)){const e=t.position;kt(t),kt(t),bt(t,ft.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===ft.IDENTIFIER&&R.has(e.value.toLowerCase()),i=e&&e.kind===ft.IDENTIFIER&&r.has(e.value.toLowerCase());if((!e||e.kind===ft.OPERATOR&&")"!==e.value&&"]"!==e.value||n||i||"("===e.value||"["===e.value||"{"===e.value||","===e.value||";"===e.value)&&!(e&&e.end===t.position)&&(Nt(gt(t))||"{"===gt(t)||"-"===gt(t))){St(t);continue}}if("@"!==r)if("{"!==r)if("}"!==r){if("["===r){const e=t.tokens[t.tokens.length-1],r=e&&e.kind===ft.IDENTIFIER&&U.has(e.value)&&t.tokens.length>=2&&"on"===t.tokens[t.tokens.length-2]?.value;e&&(e.kind===ft.IDENTIFIER||")"===e.value||"]"===e.value)&&!r?(kt(t),bt(t,ft.OPERATOR,"[")):r?(kt(t),bt(t,ft.SYMBOL,"[")):(kt(t),bt(t,ft.OPERATOR,"["));continue}if("]"!==r){if("$"===r){const e=gt(t,1);if(e>="a"&&"z">=e||e>="A"&&"Z">=e||"_"===e){Ot(t);continue}}Wt(r)?Lt(t):"0">r||r>"9"?("a">r||r>"z")&&("A">r||r>"Z")&&"_"!==r?(bt(t,ft.UNKNOWN,r),kt(t)):Pt(t):jt(t)}else kt(t),bt(t,ft.OPERATOR,"]")}else kt(t),bt(t,ft.OPERATOR,"}");else kt(t),bt(t,ft.OPERATOR,"{");else At(t)}else St(t);else It(t)?Ct(t):Lt(t);else Tt(t)}else Et(t);else xt(t)}return t.tokens}function gt(e,t=1){const r=e.position+t;return e.input.length>r?e.input[r]:""}function kt(e){const t=e.input[e.position];if(e.position++,"\n"===t)e.line++,e.column=1;else if("\r"===t){"\n"===(e.input.length>e.position?e.input[e.position]:"")&&e.position++,e.line++,e.column=1}else e.column++;return t}function wt(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;kt(e)}}function bt(e,t,r,n,i){const a=n??e.position-r.length,o=e.position;let s=e.column-r.length;if(void 0!==n){s=1;let t=-1;for(let r=0;n>r;r++)"\n"!==e.input[r]&&"\r"!==e.input[r]||(t=r);s=n-t}const l={kind:t,value:r,start:a,end:o,line:zt(e,a),column:s};e.tokens.push(l)}function zt(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 xt(e){const t=e.position;let r="";for(kt(e),kt(e);e.input.length>e.position;){if("\n"===e.input[e.position])break;r+=kt(e)}bt(e,ft.COMMENT,"--"+r,t)}function Et(e){const t=e.position,r=kt(e);let n=r;for(;e.input.length>e.position;){const t=kt(e);if(n+=t,t===r)break;"\\"===t&&e.input.length>e.position&&(n+=kt(e))}bt(e,ft.STRING,n,t)}function Tt(e){const t=e.position;kt(e);let r="";for(;e.input.length>e.position;){const t=e.input[e.position];if("`"===t){kt(e);break}if("\\"===t){if(kt(e),e.input.length>e.position){const t=kt(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+=kt(e)}if(e.position>=e.input.length&&!e.input.endsWith("`"))throw Error(`Unterminated template literal at line ${e.line}, column ${e.column-r.length}`);bt(e,ft.TEMPLATE,r,t)}function St(e){const t=e.position;let r=kt(e);if(e.position<e.input.length&&"{"===e.input[e.position]){for(r+=kt(e);e.input.length>e.position;){const t=e.input[e.position];if(r+=kt(e),"}"===t)break}bt(e,ft.SELECTOR,r,t)}else{for(;e.input.length>e.position;){const t=e.input[e.position];if("\\"===t)kt(e),e.input.length>e.position&&(r+=kt(e));else{if(!Rt(t)&&"-"!==t&&"_"!==t&&":"!==t)break;r+=kt(e)}}bt(e,ft.SELECTOR,r,t)}}function Ct(e){const t=e.position;if(Mt(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+=kt(e),t===a&&(a="");else if('"'!==t&&"'"!==t){if("<"===t){if("/"===r[e.position+1]){for(;r.length>e.position&&">"!==r[e.position];)n+=kt(e);if(r.length>e.position&&(n+=kt(e)),i--,0>=i)break;continue}let t=!1,a="";for(;r.length>e.position;){const i=r[e.position];if(a)n+=kt(e),i===a&&(a="");else if('"'!==i&&"'"!==i){if(">"===i){t="/"===r[e.position-1],n+=kt(e);break}n+=kt(e)}else a=i,n+=kt(e)}if(t||i++,0>=i)break;continue}n+=kt(e)}else a=t,n+=kt(e)}bt(e,ft.SELECTOR,n,t)}(e,t);let r="";for(r+=kt(e);e.input.length-1>e.position;){const t=e.input[e.position],n=e.input[e.position+1];if(r+=kt(e),"/"===t&&">"===n){r+=kt(e);break}}bt(e,ft.SELECTOR,r,t)}function At(e){const t=e.position;let r=kt(e);for(;e.input.length>e.position;){const t=e.input[e.position];if(!Rt(t)&&"_"!==t&&"-"!==t)break;r+=kt(e)}bt(e,ft.SYMBOL,r,t)}function Lt(e){const t=e.position;let r="";const n=e.input[e.position];if(("'"===n||"'"===n)&&"s"===gt(e,1))return r="'s",kt(e),kt(e),void bt(e,ft.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,kt(e),kt(e),kt(e)):["==","!=","<=",">=","&&","||","**","~=","|=","^=","$=","*=","?."].includes(i)?(r=i,kt(e),kt(e)):r=kt(e),bt(e,ft.OPERATOR,r,t)}function jt(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+=kt(e)}if(n>e.position&&"."===r[e.position]&&(e.position+1>=n||"."!==r[e.position+1]))for(i+=kt(e);n>e.position;){const t=r[e.position];if("0">t||t>"9")break;i+=kt(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+=kt(e),"+"!==r[e.position]&&"-"!==r[e.position]||(i+=kt(e));n>e.position;){const t=r[e.position];if("0">t||t>"9")break;i+=kt(e)}}}const a=e.position;let o="";for(;n>e.position;){const t=r[e.position];if(("a">t||t>"z")&&("A">t||t>"Z"))break;o+=kt(e)}yt.has(o)?bt(e,ft.TIME,i+o,t):(e.position=a,bt(e,ft.NUMBER,i,t))}function Pt(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+=kt(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===ft.IDENTIFIER||a.kind===ft.SELECTOR)){const t=e.input.length>e.position?e.input[e.position]:"";if("'"===t||"'"===t)return!1}wt(e);let o="";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;o+=kt(e)}if(o){const t=o.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){wt(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+=kt(e)}const i=r.toLowerCase();if("start"===i||"end"===i){wt(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+=kt(e)}if("of"===t.toLowerCase()){return bt(e,ft.IDENTIFIER,`at the ${i} of`,n),!0}}return e.position=t,!1}if("start"===a||"end"===a){wt(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+=kt(e)}if("of"===r.toLowerCase()){return bt(e,ft.IDENTIFIER,`at ${a} of`,n),!0}return e.position=t,!1}}return!1}(e,n,t,r);if(a)return!0;const s=function(e,t,r){const n=e.position;let i=`${t} ${r}`,a=e.position;const o=[t,r],s=8;for(;s>o.length&&(wt(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+=kt(e)}if(!t)break;o.push(t.toLowerCase());const r=o.join(" ");F.has(r)&&(i=r,a=e.position)}if(F.has(i)&&i!==`${t} ${r}`)return e.position=a,i;return e.position=n,null}(e,n,t);if(s)return bt(e,ft.OPERATOR,s,r),!0;if(F.has(i))return bt(e,ft.OPERATOR,i,r),!0}if(F.has(n))return e.position=i,bt(e,ft.OPERATOR,t,r),!0;return e.position=i,!1}(e,i,t);if(a)return;const o=function(e){const t=e.toLowerCase();if("include"===t||"includes"===t)return ft.OPERATOR;if(K.has(t))return ft.OPERATOR;if(ht.has(e)||ht.has(t))return ft.OPERATOR;if(F.has(t))return ft.OPERATOR;return ft.IDENTIFIER}(i);bt(e,o,i,t)}function Ot(e){const t=e.position,r=e.input,n=r.length;kt(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+=kt(e)}bt(e,ft.IDENTIFIER,i,t)}function Nt(e){return/[a-zA-Z]/.test(e)}function Rt(e){return/[a-zA-Z0-9]/.test(e)}function Mt(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 It(e){if(Mt(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(Rt(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 Wt(e){return"+-*/^%=!<>&|(){}[],.;:?''~$".includes(e)}!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{}!("undefined"==typeof window||!window.__HYPERFIXI_DEBUG__)||"undefined"!=typeof process&&process}();const _t={command:(...e)=>{},event:(...e)=>{},parse:(...e)=>{},expr:(...e)=>{},expressions:(...e)=>{},style:(...e)=>{},runtime:(...e)=>{},loop:(...e)=>{},async:(...e)=>{}};let qt=!1,$t=null;if("undefined"!=typeof window&&"undefined"!=typeof URLSearchParams)try{"semantic"===new URLSearchParams(window.location.search).get("debug")&&(qt=!0,$t=window)}catch{}let Vt={totalParses:0,semanticSuccesses:0,semanticFallbacks:0,traditionalParses:0,averageConfidence:0,confidenceHistory:[]};class Dt{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(Dt.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,a=n.confidence>=this.confidenceThreshold&&!!n.command,o=!a&&n.confidence>0;if(qt){const t={};if(n.command?.roles)for(const[e,r]of n.command.roles)t[e]=r.value;const s={input:e.substring(0,100),language:this.language,confidence:n.confidence,threshold:this.confidenceThreshold,semanticSuccess:a,fallbackTriggered:o,command:n.command?.name,roles:Object.keys(t).length>0?t:void 0,errors:n.errors,timestamp:Date.now(),duration:i};!function(e){if(!qt)return;const t=e.semanticSuccess?"color: #4caf50; font-weight: bold":e.fallbackTriggered?"color: #ff9800; font-weight: bold":"color: #9e9e9e";if(console.groupCollapsed(`%c[Semantic] ${(e.semanticSuccess?"semantic":e.fallbackTriggered?"fallback":"traditional").toUpperCase()} %c${e.input.substring(0,50)}${e.input.length>50?"...":""}`,t,"color: #888"),e.roles&&Object.keys(e.roles),console.groupEnd(),$t){const t=new CustomEvent("lokascript:semantic:parse",{detail:e,bubbles:!0});$t.dispatchEvent(t)}}(s),r=s,Vt.totalParses++,r.semanticSuccess?Vt.semanticSuccesses++:r.fallbackTriggered?Vt.semanticFallbacks++:Vt.traditionalParses++,Vt.confidenceHistory.push(r.confidence),Vt.confidenceHistory.length>100&&Vt.confidenceHistory.shift(),Vt.averageConfidence=Vt.confidenceHistory.reduce((e,t)=>e+t,0)/Vt.confidenceHistory.length}if(!a)return{success:!1,confidence:n.confidence,tokensConsumed:n.tokensConsumed,errors:n.errors};return{success:!0,node:this.buildCommandNode(n),confidence:n.confidence,tokensConsumed:n.tokensConsumed}}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 o=e.roles.get("source");o&&t.push(this.semanticValueToExpression(o));const s=e.roles.get("quantity");s&&t.push(this.semanticValueToExpression(s));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 o={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&&(o={type:"memberExpression",object:o,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;o={type:"callExpression",callee:o,arguments:i(),start:0,end:0,line:1,column:0}}}return o};return a()}getLanguage(){return this.language}getConfidenceThreshold(){return this.confidenceThreshold}}function Bt(e){const{buildAST:t}=e;return{...t?{buildCommandNode(e){try{const{ast:r}=t({kind:"command",action:e.name,roles:e.roles});return function(e){if(!e||"object"!=typeof e)return;const t=e;return"command"===t.type&&"string"==typeof t.name?{start:0,end:0,line:1,column:0,...t,isBlocking:!0===t.isBlocking,args:Array.isArray(t.args)?t.args:[]}:void 0}(r)}catch{return}}}:{},analyze(t,r){if(!e.isRegistered(r))return{confidence:0,errors:[`Language '${r}' is not supported for semantic parsing`]};const n=e.parse(t,r);return{confidence:n.confidence,...void 0!==n.tokensConsumed?{tokensConsumed:n.tokensConsumed}:{},...n.node&&(null!==n.node&&(void 0===n.node.kind||"command"===n.node.kind))?{command:{name:n.node.action,roles:n.node.roles}}:{},...n.error?{errors:[n.error]}:{}}},supportsLanguage:t=>e.isRegistered(t),supportedLanguages:()=>e.registered()}}function Ht(e){return e.kind===ft.IDENTIFIER&&R.has(e.value.toLowerCase())}function Kt(e){return e.kind===ft.IDENTIFIER&&G.has(e.value.toLowerCase())}function Ft(e){return e.kind===ft.IDENTIFIER&&U.has(e.value.toLowerCase())}function Ut(e){return e.kind===ft.IDENTIFIER&&H.has(e.value.toLowerCase())}function Gt(e){return F.has(e.value.toLowerCase())}function Zt(e){return e.kind===ft.IDENTIFIER}function Yt(e){return e.kind===ft.SELECTOR}function Xt(e){return e.kind===ft.SELECTOR&&!e.value.startsWith("<")}function Jt(e){return e.kind===ft.STRING||e.kind===ft.NUMBER||e.kind===ft.TEMPLATE}function Qt(e){return e.kind===ft.IDENTIFIER}function er(e){return e.kind===ft.TIME}function tr(e){return e.kind===ft.SYMBOL}function rr(e){return e.kind===ft.COMMENT}function nr(e){if(e.kind!==ft.IDENTIFIER)return!1;const t=e.value.toLowerCase();return!(R.has(t)||G.has(t)||U.has(t)||H.has(t))}function ir(e){return e.kind===ft.STRING}function ar(e){return e.kind===ft.NUMBER}function or(e){if(e.kind===ft.IDENTIFIER){const t=e.value;return"true"===t||"false"===t||"null"===t||"undefined"===t}return!1}function sr(e){return e.kind===ft.TEMPLATE}function lr(e){return e.kind===ft.SELECTOR&&e.value.startsWith("<")}function cr(e){return e.kind===ft.SELECTOR&&e.value.startsWith("#")}function ur(e){return e.kind===ft.SELECTOR&&e.value.startsWith(".")}function pr(e){return e.kind===ft.SELECTOR&&(!e.value.startsWith("#")&&!e.value.startsWith("."))}function dr(e){if(e.kind!==ft.OPERATOR)return!1;const t=e.value.toLowerCase();return!K.has(t)&&!F.has(t)}function mr(e){const t=e.value.toLowerCase();return"then"===t||"and"===t||"else"===t||"end"===t||"on"===t}function fr(e,t,r){return{type:"literal",value:e,raw:t,start:r.start,end:r.end,line:r.line,column:r.column}}function hr(e,t){return{type:"identifier",name:e,start:t.start,end:t.end,line:t.line,column:t.column}}function yr(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 vr(e,t){return{type:"block",commands:e,start:t.start,end:t.end,line:t.line,column:t.column}}function gr(e,t){return{type:"string",value:e,start:t.start,end:t.end,line:t.line,column:t.column}}function kr(e,t){return{type:"objectLiteral",properties:e,start:t.start,end:t.end,line:t.line,column:t.column}}function wr(e,t){return{type:"arrayLiteral",elements:e,start:t.start,end:t.end,line:t.line,column:t.column}}function br(e,t,r){return{type:"propertyOfExpression",property:e,target:t,start:r.start,end:r.end,line:r.line,column:r.column}}function zr(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}}Dt.SKIP_SEMANTIC_COMMANDS=new Set(["swap","morph","js","tell"]);const xr=[{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 Er(e,t){return!!e&&t.some(t=>e.value===t||e.value.toLowerCase()===t)}const Tr=[o,c,s,l];function Sr(e,t=[]){if(e.isAtEnd())return!0;for(const t of Tr)if(e.check(t))return!0;for(const r of t)if(e.check(r))return!0;return!!e.checkIsCommand()}function Cr(e,t=[]){if(!Sr(e,t))return e.parseExpression()}function Ar(e,t,r){return!!e.check(t)&&(e.advance(),r.push(e.createIdentifier(t)),!0)}function Lr(e,t,r){for(const n of t)if(e.check(n))return e.advance(),r.push(e.createIdentifier(n)),n;return null}function jr(e,t){return!!e.check(t)&&(e.advance(),!0)}function Pr(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 Or{constructor(e){this.args=[],this.isBlocking=!1,this.name=e}static from(e){const t=new Or(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 Or(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 Or(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 Or(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 Nr(e,t){const r=[];let n="";const i=e.peek().start||0,a=e.peek().line||1,o=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}=Pr(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:o})}else r.push({type:"string",value:n,start:i,end:e.getPosition().end,line:a,column:o})}const s=[...r];for(;!Sr(e);){if(e.check("on")||e.check("to")){const t=e.advance().value;s.push(e.createIdentifier(t));continue}const t=e.savePosition(),r=e.parsePrimary();r&&s.push(r),e.savePosition()===t&&e.advance()}return Or.fromIdentifier(t).withArgs(...s).endingAt(e.getPosition()).build()}function Rr(e,t){const r=[];if(e.check(P)){const t=e.advance();if(r.push({type:"identifier",name:P,start:t.start,end:t.end,line:t.line,column:t.column}),e.check(S)){const t=e.advance();r.push({type:"identifier",name:S,start:t.start,end:t.end,line:t.line,column:t.column})}}return Or.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}function Mr(e,t){const r=[],n=()=>e.check(l)||t&&e.check(s);for(;!e.isAtEnd()&&!n();){if(rr(e.peek())){e.advance();continue}if(!e.checkIsCommand()&&!e.isCommand(e.peek().value))break;e.advance();const t=e.parseCommand();t&&r.push(t),(e.check(o)||e.check(c)||e.check(","))&&e.advance()}return r}const Ir=new Set(["is","am","are","not","no","and","or","==","===","!=","!==","<",">","<=",">=","+","-","*","/","mod"]);function Wr(e,t,r){return null!==t&&(!Ir.has(t.value?.toLowerCase?.()??"")&&(e.checkIsCommand()||e.isCommand(r.value?.toLowerCase())))}function _r(e,t){const r=[];let n=!1;const i=e.savePosition();let a=null;for(let r=0;500>r&&!e.isAtEnd();r++){const r=e.peek();if(r.value===o){n=!0;break}if(r.value===l||r.value===A||r.value===C||r.value===T)break;if(void 0!==r.line&&r.line!==t.line&&Wr(e,a,r))break;rr(r)||(a=r),e.advance()}e.restorePosition(i);let c=!1;if(!n){const r=e.savePosition(),n=t.line,i=100;let a=!1,o=null;for(;!e.isAtEnd()&&i>e.current-r;){const t=e.peek(),r=t.value?.toLowerCase();if(a&&void 0!==t.line&&t.line!==n)break;if(r===A||r===C||r===T)break;if(r===s||r===l){t.line===n&&(c=!0);break}if(Wr(e,o,t)){if(void 0!==t.line&&t.line!==n){c=!0;break}a=!0}rr(t)||(o=t),e.advance()}e.restorePosition(r)}const p=n||c;let d;if(p)d=e.parseExpression();else{const r=[],n=20;let i=0,a=!0;for(;!e.isAtEnd()&&!e.check(o)&&(a||!e.checkIsCommand()&&!e.isCommand(e.peek().value))&&n>i;){a=!1;const t=e.savePosition();r.push(e.parseLogicalAnd()),e.savePosition()===t&&e.advance(),i++}if(0===r.length)throw Error("Expected condition after if/unless");d=1===r.length?r[0]:{type:"expression",tokens:r,start:r[0].start,end:r[r.length-1].end,line:t.line,column:t.column}}if(r.push(d),p){jr(e,o);const n=Mr(e,!0);if(0===n.length&&e.isAtEnd())throw Error("Expected command after 'then' in if statement - incomplete conditional");r.push(vr(n,{start:t.start,end:e.getPosition().end,line:t.line,column:t.column}));let i=!1;if(e.check(s))if(e.advance(),e.check(u)){const t=e.peek();e.advance();const n=_r(e,t);r.push(vr([n],{start:t.start,end:e.getPosition().end,line:t.line,column:t.column})),i=!0}else{const n=Mr(e,!1);r.push(vr(n,{start:t.start,end:e.getPosition().end,line:t.line,column:t.column}))}i||e.consume(l,"Expected 'end' after if block")}else{if(!e.checkIsCommand()&&!e.isCommand(e.peek().value))throw Error("Expected command after if condition in single-line form");{e.advance();const n=e.parseCommand();r.push(vr([n],{start:t.start,end:e.getPosition().end,line:t.line,column:t.column}))}}return Or.from(t).withArgs(...r).endingAt(e.getPosition()).build()}function qr(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=Or.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition());return Object.keys(n).length>0&&i.withModifiers(n),i.build()}const $r=new Set(["my","its","your"]);function Vr(e){const t={};if(jr(e,p)){const r=e.parseExpression();return r&&(t.for=r),t}if(!e.check(m))return t;e.advance();const r=e.peek();if(!r||!Zt(r))return t;e.advance();let n=r.value;if(e.check(":")){e.advance();const t=e.peek();t&&Zt(t)&&(e.advance(),n=`${n}:${t.value}`)}if(t.until={type:"literal",value:n,raw:n},jr(e,w)){const r=Cr(e);r&&(t.from=r)}return t}function Dr(e,t){const r=[],n=Cr(e,[w]);n&&r.push(n),Ar(e,w,r);const i=Cr(e);return i&&r.push(i),Or.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}function Br(e,t){const r=[];if(e.check(E)){e.advance(),r.push(e.createIdentifier("between"));const n=Cr(e,[c]);if(n&&"binaryExpression"===n.type&&"and"===n.operator)n.left&&r.push(n.left),r.push(e.createIdentifier("and")),n.right&&r.push(n.right);else{n&&r.push(n),Ar(e,c,r);const t=Cr(e,[w,T,p]);t&&r.push(t)}if(Lr(e,[w,T],r)){const t=Cr(e);t&&r.push(t)}return Or.fromIdentifier(t).withArgs(...r).withModifiers(Vr(e)).endingAt(e.getPosition()).build()}const n=Cr(e,[w,T]);n&&r.push(n);if(Lr(e,[w,T],r)){const t=Cr(e);t&&r.push(t)}return e.check("modal")&&(e.advance(),r.push({type:"literal",value:"modal",raw:"modal"})),Or.fromIdentifier(t).withArgs(...r).withModifiers(Vr(e)).endingAt(e.getPosition()).build()}function Hr(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 Kr(e,t){const r=e.parseExpression();if(!r)return e.addError("Put command requires content expression"),null;const n=e.peek();if(!n||!$.includes(n.value))return e.addError(`Expected operation keyword (${$.join(", ")}) after put expression, got: ${n?.value}`),null;let i=e.advance().value;const a=i.toLowerCase();"at start of"===a||"at the start of"===a?i=_:"at end of"===a||"at the end of"===a?i=q:i===W&&(e.check(O)||e.check(P)?(jr(e,P),e.check(O)&&(e.advance(),e.check(z)&&(e.advance(),i=_))):e.check(l)&&(e.advance(),e.check(z)&&(e.advance(),i=q)));const o=e.parseExpression();return o?Or.fromIdentifier(t).withArgs(r,e.createIdentifier(i),o).endingAt(e.getPosition()).build():(e.addError("Put command requires target expression after operation keyword"),null)}const Fr=["innerhtml","outerhtml","into","over","delete","morph","morphouter"];function Ur(e,t){const r=e.savePosition();let n=null,i=[];try{n=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}}(e)??function(e){if(!e.check(L)&&!e.check(j))return null;const t=e.advance(),r=e.advance();return{type:"identifier",name:r.value,scope:t.value,start:t.start,end:r.end}}(e)??function(e){if(!e.check(P))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===z){const e=r.left,t=r.right;return br(e,t,{start:e.start??0,end:t.end??0,line:e.line??1,column:e.column??1})}return e.check(k)?r:(e.restorePosition(t),null)}(e),n||(n=e.parseExpression())}catch{e.restorePosition(r),n=null}if(!n){const t=function(e){if(e.match(":")){const t=e.advance();return{expression:{type:"identifier",name:t.value,scope:"element",start:t.start,end:t.end},tokens:[]}}const t=[];for(;!(e.isAtEnd()||e.check(k)||e.check(o)||e.check(c)||e.check(s)||e.check(l));)t.push(e.parsePrimary());if(0===t.length)return{expression:null,tokens:[]};if(t.length>=4){const e=(e,t)=>e[t];if(e(t[0],"value")===P&&e(t[2],"value")===z){const r=t[1],n=t[3];return{expression:br(hr(e(r,"value")||e(r,"name")||"",{start:r.start??0,end:r.end??0,line:r.line??1,column:r.column??1}),{type:"idSelector"===n.type?"idSelector":"cssSelector",value:e(n,"value")||e(n,"name")||"",start:n.start??0,end:n.end??0,line:n.line,column:n.column},{start:t[0].start??0,end:n.end??0,line:t[0].line??1,column:t[0].column??1}),tokens:[]}}}return 1===t.length?{expression:t[0],tokens:[]}:{expression:null,tokens:t}}(e);n=t.expression,i=t.tokens}if(!e.check(k)){const t=e.isAtEnd()?"end of input":e.peek().value;throw Error("Expected 'to' in set command, found: "+t)}e.advance();const a=e.parseExpression()??e.parsePrimary();let u;var p;e.check(T)&&((p=e.peekAt(1))&&("selector"===p.kind||p.value.startsWith("<")||Gr.has(p.value)))&&(e.advance(),u=Cr(e));const d=[];n?d.push(n):i.length>0&&d.push(...i),d.push(e.createIdentifier(k)),a&&d.push(a);const m=Or.fromIdentifier(t).withArgs(...d);return u&&m.withModifier("on",u),m.endingAt(e.getPosition()).build()}const Gr=new Set(["me","my","it","its","you","your","yourself"]);const Zr=new Set(["to","the","url","of","in","new","window","top","middle","bottom","left","center","right","smoothly","instantly","back","forward"]);function Yr(e,t){return{type:"string",value:e,start:t.start,end:t.end,line:t.line,column:t.column}}function Xr(e,t){switch(t.name.toLowerCase()){case"put":return Kr(e,t);case"trigger":case"send":return Nr(e,t);case"remove":return Dr(e,t);case"take":return function(e,t){const r=[],n={},i=Cr(e,[w,p]);if(i&&r.push(i),e.check(w)){Ar(e,w,r);const t=Cr(e,[p]);t&&r.push(t)}if(jr(e,p)){const t=Cr(e);t&&(n.for=t)}return Or.fromIdentifier(t).withArgs(...r).withModifiers(n).endingAt(e.getPosition()).build()}(e,t);case"toggle":return Br(e,t);case"set":return Ur(e,t);case"halt":return Rr(e,t);case"measure":return qr(e,t);case"js":return function(e,t){const r=[];if(e.match("(")){for(;!e.check(")")&&!e.isAtEnd();)e.checkIdentifierLike()&&r.push(e.advance().value),e.match(",");e.consume(")","Expected ) after js parameters")}const n=e.peek().start,i=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&&n+1<r.length&&"/"===r[n+1])for(n+=2;r.length>n&&"\n"!==r[n];)n++;else if("/"===e&&n+1<r.length&&"*"===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)&&r.length>=n+3&&"end"===r.slice(n,n+3).toLowerCase()){if((0===n||!/[a-zA-Z0-9_]/.test(r[n-1]))&&(n+3>=r.length||!/[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,n);for(;!e.isAtEnd()&&!e.check(l)&&e.peek().start<i;)e.advance();e.consume(l,"Expected end after js code body");const a=e.getInputSlice(n,i),o={type:"literal",value:a.trim(),start:t.start,end:e.getPosition().end},s={type:"arrayLiteral",elements:r.map(e=>({type:"literal",value:e,start:t.start,end:t.end})),start:t.start,end:e.getPosition().end};return Or.fromIdentifier(t).withArgs(o,s).endingAt(e.getPosition()).build()}(e,t);case"go":return function(e,t){const r=[];for(;!Sr(e,["when","where","catch","finally"]);){const t=e.peek(),n=e.resolveKeyword(t.value).toLowerCase();if(Zr.has(n)){e.advance(),r.push(Yr(n,t));continue}if(Qr(e)){const n=tn(e);if(n){r.push(n);continue}e.advance(),r.push(Yr(t.value,t));continue}if("+"===t.value||"-"===t.value){e.advance(),r.push(Yr(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(Yr(t.value+"px",{...t,end:n.end}))}continue}const i=e.current;if(r.push(e.parsePrimary()),e.current===i)break}return Or.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}(e,t);case"tell":return function(e,t){const r=e.parseExpression();if(!r)throw Error("tell command requires a target expression");e.check(k)&&e.advance();const n=[];for(;!e.isAtEnd();){if(e.checkIsCommand()){try{e.advance();const t=e.parseCommand();if(!t)break;n.push(t)}catch{break}if(e.match(c)||e.match(o))continue;if(e.check(s))break;if(e.check(l)){e.advance();break}if(e.checkIsCommand())continue;break}break}if(0===n.length)throw Error("tell command requires at least one command after the target");return Or.fromIdentifier(t).withArgs(r,...n).endingAt(e.getPosition()).build()}(e,t);case"pick":return function(e,t){const r=Or.fromIdentifier(t);jr(e,P);const n=e.peek(),i=n.value,a=e=>({type:"literal",value:e,start:t.start,end:t.end}),o=()=>{if(!e.match("of","from"))throw Error("pick: expected 'of' or 'from' before source expression");return e.parseExpression()};if("first"===i){e.advance();const t=e.parsePrimary(),n=o();return r.withArgs(n).withModifier("variant",a("first")).withModifier("count",t).endingAt(e.getPosition()).build()}if("last"===i){e.advance();const t=e.parsePrimary(),n=o();return r.withArgs(n).withModifier("variant",a("last")).withModifier("count",t).endingAt(e.getPosition()).build()}if("random"===i){let t;e.advance(),e.check("of")||e.check("from")||(t=e.parsePrimary());const n=o(),i=r.withArgs(n).withModifier("variant",a("random"));return t&&i.withModifier("count",t),i.endingAt(e.getPosition()).build()}if("item"===i||"items"===i||"character"===i||"characters"===i){let t,n;e.advance(),e.match("at","from"),t=e.match("start")?a("start"):e.parsePrimary();let i=!1;(e.match("to")||e.match(".."))&&(e.match("end")?i=!0:n=e.parsePrimary());let s="default";e.match("inclusive")?s="inclusive":e.match("exclusive")&&(s="exclusive");const l=o(),c=r.withArgs(l).withModifier("variant",a("range")).withModifier("rangeStart",t).withModifier("rangeMode",a(s));return i?c.withModifier("rangeEnd",a("end")):n&&c.withModifier("rangeEnd",n),c.endingAt(e.getPosition()).build()}if("match"===i||"matches"===i){e.advance(),e.match("of");const t=e.parsePrimary();let n;e.matchOperator("|")&&(n=e.advance().value);const s=o(),l=r.withArgs(s).withModifier("variant",a("match"===i?"match":"matches")).withModifier("regex",t);return n&&l.withModifier("flags",a(n)),l.endingAt(e.getPosition()).build()}return Jr(e,t)}(e,t);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 Or.fromIdentifier(t).withArgs(...n).withModifiers(r).endingAt(e.getPosition()).build()}(e,t);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();Fr.includes(i)&&(n=i,e.advance(),r.push(e.createIdentifier(n)))}}if("delete"===n){const n=e.parseExpression();return n&&r.push(n),Or.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}!e.isAtEnd()&&e.check(z)&&(e.advance(),r.push(e.createIdentifier("of")));const i=e.parseExpression();if(i&&r.push(i),!e.isAtEnd()&&e.check(b)){e.advance(),r.push(e.createIdentifier("with"));const t=e.parseExpression();t&&r.push(t)}return Hr(e,r),Or.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}(e,t);case"process":return function(e,t){if(!e.check("partials"))return null;const r=[];if(Ar(e,"partials",r),Ar(e,g,r)){const t=Cr(e,["using"]);t&&r.push(t)}return Hr(e,r),Or.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}(e,t)??Jr(e,t);default:return Jr(e,t)}}function Jr(e,t){const r=[];for(;!Sr(e,["catch","finally"])&&(e.checkIdentifierLike()||e.checkSelector()||e.checkLiteral()||e.checkTimeExpression()||e.match("<"));)r.push(e.parsePrimary());return Or.fromIdentifier(t).withArgs(...r).endingAt(e.getPosition()).build()}function Qr(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 en=new Set(["{",")"]);function tn(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(en.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 rn(e){if(e.check("{"))return!1;if(!e.checkIdentifierLike())return!1;const t=e.peekAt(1);return null!==t&&":"===t.value}function nn(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 an=new Set(["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","pc","pt","px"]);class on{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 Dt({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&&ue(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!==ue(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?ue(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")){const t=[e];let r=0;for(;!this.isAtEnd()&&this.check("on");){this.peek(),this.advance();const e=this.parseEventHandler();if(e&&(t.push(e),r++),this.isAtEnd()||this.peek(),this.isAtEnd(),this.check("on"),!this.isAtEnd()&&!this.check("on")){if(!this.isAtEnd())return this.peek(),this.addError("Unexpected token after event handlers: "+this.peek().value),{success:!1,node:this.createProgramNode(t),tokens:this.tokens,error:this.error};break}}return 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=on.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=on.PRATT_TABLE.get(t.value);if(!r?.infix){if(Z.has(t.value)||Y.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){}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()&&!on.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(an.has(r))n=r;else if("%"===r){this.canStartOperand(this.tokens.length>this.current+1?this.tokens[this.current+1]:null)||(n="%")}if(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!Z.has(t)&&!Y.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||(Z.has(t.value)||Y.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):D.isCommand(e)}isKeyword(e){return this.keywordResolver?this.keywordResolver.isKeyword(e):D.isKeyword(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 D.isCompoundCommand(e)}parseCompoundCommand(e){return Xr(this.getContext(),e)}parsePutCommand(e){return Kr(this.getContext(),e)}parseSetCommand(e){return Ur(this.getContext(),e)}parseHaltCommand(e){return Rr(this.getContext(),e)}parseMeasureCommand(e){return qr(this.getContext(),e)}parseTriggerCommand(e){return Nr(this.getContext(),e)}parseCommandListUntilTerminator(e){const t=[],r=()=>this.check("end")||e.some(e=>this.check(e));for(e.join(",");!this.isAtEnd()&&!r();){this.peek(),this.peek();let e=!1;const n=this.checkIsCommand(),i=!n&&this.checkIdentifier()&&this.isCommand(this.peek().value);if(n||i){this.peek(),this.advance();const r=this.error;try{const n=this.parseCommand();this.error&&this.error!==r&&(this.error=r),n&&(t.push(n),e=!0)}catch(e){this.error=r}}else this.checkIdentifier()&&this.peek();if(!e){this.peek();break}for(this.peek();!(this.isAtEnd()||r()||this.checkIsCommand()||this.isCommand(this.peek().value)||this.check("then")||this.check("and")||this.check(","));)this.peek(),this.advance();if(!this.match("then","and",",")&&(!this.checkIsCommand()&&!this.isCommand(this.peek().value))){this.peek();break}}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=""),{commands:t,terminator:n}}parseCommandListUntilEnd(e="repeat"){const{commands:t}=this.parseCommandListUntilTerminator([]);if(this.peek(),!this.check("end"))throw this.peek(),this.peek(),Error(`Expected "end" to close ${e} block`);return 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",i=null,a=null,o=null,s=null,l=null,c=null;if(e.check(p)){e.advance(),n=p;const t=e.peek();Zt(t)&&(l=t.value,e.advance()),e.check(g)&&(e.advance(),s=e.parseExpression())}else if(e.check(g))e.advance(),n=p,l="it",s=e.parseExpression();else if(e.check(d))e.advance(),n=d,o=e.parseExpression();else if(e.check(m))if(e.advance(),n=m,e.check(S)){e.advance(),n="until-event";const t=e.peek();if(!Zt(t)&&!Ft(t))throw Error('Expected event name after "event"');i=t.value,e.advance(),e.peek(),e.peek(),e.check(w)&&(e.advance(),e.peek(),jr(e,P),e.peek(),a=e.parsePrimary())}else o=e.parseExpression();else e.check(f)?(e.advance(),n=f):(c=e.parseExpression(),e.check(h)&&(e.advance(),n=h));let u,y=null;if(e.check(b)){const t=e.peekAt(1);t&&t.value.toLowerCase()===v&&(e.advance(),e.advance(),y=v)}else if(e.check(v)){e.advance();const t=e.peek();Zt(t)?(y=t.value,e.advance()):y=v}let k=null,z=!1;if(n===f){const t=e.parseRepeatBody();if(u=t.commands,"else"===t.terminator)e.advance(),k=e.parseCommandListUntilEnd();else if("until"===t.terminator||"while"===t.terminator){if(z=!0,n=t.terminator,e.advance(),o=e.parseExpression(),!e.check("end"))throw Error('Expected "end" to close repeat block');e.advance()}}else{const t=e.parseCommandListUntilEndOrElse();u=t.commands,t.hasElse&&(e.advance(),k=e.parseCommandListUntilEnd())}r.push({type:"identifier",name:n,start:t.start,end:t.end,line:t.line,column:t.column});const x={start:t.start,end:t.end,line:t.line,column:t.column};l&&r.push(gr(l,x)),s&&r.push(s),o&&r.push(o),c&&r.push(c),i&&r.push(gr(i,x)),a&&r.push(a),y&&r.push(gr(y,x)),r.push(vr(u,{...x,end:x.end||0})),null!==k&&r.push(vr(k,{...x,end:x.end||0}));const E=Or.from(t).withArgs(...r);return z&&E.withModifier("bottomTested",{type:"literal",value:!0,...x}),E.endingAt(e.getPosition()).build()}(this.getContext(),e)}parseForCommand(e){return function(e,t){const r=[];let n=null,i=null;e.check(y)&&e.advance();const a=e.peek();if(!Zt(a))throw Error('Expected variable name after "for"');if(n=a.value,e.advance(),!e.check(g))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 o=null;if(e.check(b)){const t=e.peekAt(1);t&&t.value.toLowerCase()===v&&(e.advance(),e.advance(),o=v)}else if(e.check(v)){e.advance();const t=e.peek();Zt(t)?(o=t.value,e.advance()):o=v}const s=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(gr(n,l)),r.push(i),o&&r.push(gr(o,l)),r.push(vr(s,{...l,end:l.end||0})),Or.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")&&!Sr(e)){const n=e.parseExpression();return r.push(n),Or.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(!Zt(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(!Zt(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(w)&&(e.advance(),jr(e,P),i=e.parsePrimary());const a={start:t.start,end:e.getPosition().end,line:t.line,column:t.column};r.push(wr(n.map(e=>kr("duration"===e.kind?[{key:hr("duration",a),value:e.expr}]:[{key:hr("name",a),value:fr(e.name,`"${e.name}"`,a)},{key:hr("args",a),value:wr(e.params.map(e=>fr(e,`"${e}"`,a)),a)}],a)),a)),i&&r.push(i)}return Or.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(hr(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(Pr(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(kr(n.map(e=>({key:e.name?hr(e.name,i):fr("_positional","_positional",i),value:e.value})),i))}}return Or.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 o=e.peek();if(e.checkAnySelector()||e.checkContextVar()||e.check("<")||Zt(o)&&$r.has(o.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:o.start||0,end:e.getPosition().end,line:o.line,column:o.column}):(a=t,e.check("'s")&&e.advance())}const s=e.peek();if(!i&&(Zt(s)||"*"===s.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:s.start||0,end:e.getPosition().end,line:s.line,column:s.column})}if(!i)throw Error("Transition command requires a CSS property");if(a&&r.push(a),r.push(i),!e.check(k))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(b)){e.advance();const t=e.parsePrimary();n.with=t}return Or.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=Cr(e,[k]);t&&r.push(t)}if(e.check(k)){e.advance();const t=Cr(e);t&&r.push(t)}return Or.from(t).withArgs(...r).endingAt(e.getPosition()).build()}(this.getContext(),e)}parseIfCommand(e){return _r(this.getContext(),e)}parseRemoveCommand(e){return Dr(this.getContext(),e)}parseToggleCommand(e){return Br(this.getContext(),e)}parseRegularCommand(e){return Jr(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;if(this.advance(),this.check("*")){this.advance();t="*"+this.consumeIdentifier("Expected property name after * in CSS property syntax").value}else if(tr(this.peek())&&this.peek().value.startsWith("@"))t=this.advance().value;else if(this.check("[")&&this.tokens[this.current+1]?.value?.startsWith("@"))this.advance(),t=this.advance().value,this.consume("]","Expected ']' after attribute reference");else{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()&&Zt(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(nr)||this.matchPredicate(Kt)||this.matchPredicate(Ut)||this.matchPredicate(Ht)||this.matchPredicate(Ft))){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("?.");if("my"===e.value&&!t)return this.parseContextPropertyAccess("me");if("its"===e.value&&!t)return this.parseContextPropertyAccess("it");if("your"===e.value&&!t)return this.parseContextPropertyAccess("you");if("the"===e.value)return this.parseTheXofY();if("values"===e.value&&this.check("of")){this.advance();return{type:"propertyOfExpression",property:{type:"identifier",name:"values"},target:this.parsePrimary(),line:e.line,column:e.column}}return this.createIdentifier(e.value)}if(this.match("$"))return this.parseDollarExpression();if("\\"===this.peek().value)return this.parseBlockLiteral();if(tr(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(",")}if(!this.check("-")||">"!==this.tokens[this.current+1]?.value)return this.addError("Expected '->' in block literal"),this.createErrorNode();this.advance(),this.advance();return{type:"blockLiteral",parameters:t,body:this.parseExpression(),start:e,end:this.previous().end,line:this.previous().line,column:this.previous().column}}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(nr))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(nr)&&(e+=this.advance().value);this.check("-");)this.advance(),e+="-",r=!0,this.checkPredicate(nr)&&(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(nr))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,o=-1,s=-1;for(;!this.isAtEnd()&&(0!==a||!this.check(";")&&!this.check("}"));){const e=this.advance();n.push(e.value),0>o&&"number"==typeof e.start&&(o=e.start),"number"==typeof e.end&&(s=e.end),"$"===e.value&&this.check("{")&&(i=!0),"{"===e.value&&a++,"}"===e.value&&a--}const l=this.originalInput&&o>=0&&s>o?this.originalInput.slice(o,s):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:o}=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!==o&&{finallyHandler:o},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;if(this.check(":")){this.advance();r=`${r}:${this.advance().value}`}return 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(!(on.PSEUDO_COMMAND_PREPOSITIONS.includes(n.value.toLowerCase())||nr(n)&&!this.isCommand(n.value)||Ut(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}}),on.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&&(this.error=e),t}catch(t){return 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 t=this.advance(),i=(n=t.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]=i}else if(this.matchNumber()){const t=parseInt(this.previous().value,10);e[r]=t}else this.addError(`Expected time expression after '${t} at', got: ${this.peek().value}`);else this.addError(`Expected 'at' after '${t}'`);var n}parseEventHandler(){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)}const r=this.parseEventNameWithNamespace("Expected event name after 'on'");for(e.push(r);this.check("or");){this.advance();const t=this.parseEventNameWithNamespace("Expected event name after 'or'");e.push(t)}let n;if(e.join(", "),this.registryIntegration){const t=e[0];if(this.registryIntegration.hasEventSource(t)){const e=this.registryIntegration.getEventSource(t);n=e?.name}}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"),i.join(", ")}const a={};for(;this.check(".");){this.advance();const e=this.advance().value.toLowerCase();if("once"===e)a.once=!0;else if("prevent"===e)a.prevent=!0;else if("stop"===e)a.stop=!0;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:a.throttle=r,this.consume(")",`Expected ')' after ${e} delay`)}}}let o,s,l,c;if(this.parseTemporalKeywordModifiers(a),t&&(a.once=!0),Object.keys(a),this.match("[")&&(o=this.parseExpression(),this.consume("]","Expected ']' after event condition")),this.match("from")){const e=this.advance();s=e.value,this.parseTemporalKeywordModifiers(a)}if(this.match("of")){const e=this.advance();l=e.value.startsWith("@")?e.value.substring(1):e.value}this.match("in")&&(c=this.parseExpression());const u=[];for(this.isAtEnd()||this.peek(),this.isAtEnd();!this.isAtEnd()&&(this.peek(),this.peek(),!this.check("on"));)if(this.checkComment())this.peek(),this.advance();else{if(this.check("end")){this.advance();break}if(this.check("catch")||this.check("finally")){this.peek();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),this.isAtEnd()||this.peek())}}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){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 p,d,m;this.isAtEnd()||!this.check("catch")&&!this.check("finally")||(({errorSymbol:p,errorHandler:d,finallyHandler:m}=this.parseErrorAndFinallyBlocks()),this.check("end")&&this.advance());const f=this.getPosition(),h={type:"eventHandler",event:1===e.length?e[0]:e.join("|"),events:e,commands:u,...void 0!==p&&{errorSymbol:p},...void 0!==d&&{errorHandler:d},...void 0!==m&&{finallyHandler:m},...i.length>0&&{args:i},...o&&{condition:o},...s&&{target:s},...l&&{attributeName:l},...c&&{watchTarget:c},...n&&{customEventSource:n},...Object.keys(a).length>0&&{modifiers:a},start:f.start,end:f.end,line:f.line,column:f.column};return e.join(", "),h}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();nr(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:o,terminator:s}=this.parseCommandListUntilTerminator(["catch","finally"]);let l,c,u;if("catch"!==s&&"finally"!==s||({errorSymbol:l,errorHandler:c,finallyHandler:u}=this.parseErrorAndFinallyBlocks()),!this.check("end"))throw Error('Expected "end" to close behavior event handler');this.advance();const p={type:"eventHandler",event:t,commands:o,...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(p)}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")}this.consume("end","Expected 'end' to close behavior definition");return{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();if(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")||(this.error=t)}for(e.push(r);!(this.isAtEnd()||this.checkIsCommand()||this.isCommand(this.peek().value)||this.check("then")||this.check("on"));)this.peek(),this.advance();if(this.check("on"))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=zr(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 xr.find(t=>t.command===e.toLowerCase())||null}(e)}isTokenKeyword(e,t){return Er(e,t)}parseMultiWordCommand(e,t){return function(e,t,r){const n=e.getMultiWordPattern(r);if(!n)return null;const i=[],a={};for(;!Sr(e,["catch","finally",...n.keywords])&&!Er(e.peek(),n.keywords);){const t=e.parsePrimary();if(!t)break;if(i.push(t),!e.match(",")&&Er(e.peek(),n.keywords))break}for(;!e.isAtEnd()&&Er(e.peek(),n.keywords);){const t=e.advance().value,r=e.parseExpression();if(r&&(a[t]=r),!Er(e.peek(),n.keywords))break}const o=Or.from(t).withArgs(...i).endingAt(e.getPosition());return Object.keys(a).length>0&&o.withModifiers(a),o.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?t.node:null}catch(e){return 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(Ht(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()&&Qr(e)&&(n=tn(e)),n||(n=e.parsePrimary()),!n)return e.addError("fetch requires a URL"),Or.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=rn(e)?nn(e):e.parsePrimary()}else e.advance(),e.isAtEnd()||jr(e,"a")||jr(e,"an"),r.as=e.parsePrimary();const i=Or.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(L)&&(i=!0,e.advance());const a=e.parseExpression();if(!a)throw Error("Expected variable or expression after "+r);let o;if(e.check(x)){e.advance();const t=e.parseExpression();if(!t)throw Error(`Expected amount after 'by' in ${r} command`);o=t}else o=fr(1,"1",{start:t.start,end:e.previous().end,line:t.line,column:t.column});let s=a;i&&"identifier"===a.type&&(s={...a,scope:"global"});const l={start:t.start,end:e.previous().end,line:t.line,column:t.column},c=yr(n,a,o,l);c.coerceNumeric=!0;const u=[s,hr(k,l),c];return Or.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;if(["first","last","next","previous","random","closest"].includes(t))return this.advance(),this.parseNavigationFunction(t);if(this.advance(),!this.check("of"))return this.createIdentifier(t);this.advance();return{type:"propertyOfExpression",property:{type:"identifier",name:t},target:this.parseCall(),line:e.line,column:e.column}}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(tr(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;D.isCSSFunction(t)}return this.consume(")","Expected ')' after arguments"),this.createCallExpression(e,t)}createLiteral(e,t){return fr(e,t,this.getPosition())}createIdentifier(e){return hr(e,this.getPosition())}createBinaryExpression(e,t,r){return yr(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 function(e){return{type:"identifier",name:"__ERROR__",start:e.start,end:e.end,line:e.line,column:e.column}}(this.getPosition())}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(0===e.length)return{type:"identifier",name:"__ERROR__",start:0,end:0,line:1,column:1};if(1===e.length)return 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 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!(!dr(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(Xt)}matchSelector(){return this.matchPredicate(Xt)}checkAnySelector(){return this.checkPredicate(Yt)}checkLiteral(){return this.checkPredicate(Jt)}checkIdentifierLike(){return this.checkPredicate(Zt)}checkIsCommand(){return this.checkPredicate(Ht)}checkCommandTerminator(){return this.checkPredicate(mr)}checkReference(){return this.checkPredicate(Qt)}checkTimeExpression(){return this.checkPredicate(er)}checkEvent(){return this.checkPredicate(Ft)}checkContextVar(){return this.checkPredicate(Ut)}checkComment(){return this.checkPredicate(rr)}checkIdentifier(){return this.checkPredicate(nr)}checkKeyword(){return this.checkPredicate(Kt)}checkString(){return this.checkPredicate(ir)}matchString(){return this.matchPredicate(ir)}checkNumber(){return this.checkPredicate(ar)}matchNumber(){return this.matchPredicate(ar)}checkBoolean(){return this.checkPredicate(or)}matchBoolean(){return this.matchPredicate(or)}checkTemplateLiteral(){return this.checkPredicate(sr)}matchTemplateLiteral(){return this.matchPredicate(sr)}checkQueryReference(){return this.checkPredicate(lr)}matchQueryReference(){return this.matchPredicate(lr)}checkIdSelector(){return this.checkPredicate(cr)}checkClassSelector(){return this.checkPredicate(ur)}checkCssSelector(){return this.checkPredicate(pr)}checkBasicOperator(){return this.checkPredicate(dr)}matchBasicOperator(){return this.matchPredicate(dr)}matchTimeExpression(){return this.matchPredicate(er)}matchIdentifierLike(){return this.matchPredicate(Zt)}matchComparisonOperator(){return this.matchPredicate(Gt)}consumePredicate(e,t){return this.checkPredicate(e)?this.advance():(this.addError(t),this.peek())}consumeIdentifier(e){return this.consumePredicate(nr,e)}consumeIdentifierLike(e){return this.consumePredicate(Zt,e)}consumeEvent(e){return this.consumePredicate(Ft,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;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 o=[];if(!this.check("]"))do{if(this.check("]"))break;o.push(this.parseExpression())}while(this.match(","));return this.consume("]","Expected ']' after array elements"),{type:"arrayLiteral",elements:o,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 sn(e,t){const r=vt(e);return new on(r,t,e).parse()}function ln(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 cn(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 un(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 vn(e,t);const r=e;switch(e.type){case"literal":return function(e){return e.value}(r);case"identifier":return vn(r,t);case"binaryExpression":return async function(e,t){const r=e.operator,n=e.right,i=e.left;if("="===r){const r=await un(e.right,t);if("identifier"===i?.type&&"string"==typeof i.name){const e=i.name;return e.startsWith("$")?he(t,e.slice(1),r):"global"===i.scope?he(t,e,r):"element"===i.scope?be(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 un(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 un(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 un(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 un(e.right,t);return ln(t,"styleRef").evaluate(t,i.value.slice(1),r)}if("of"===r){const r=gn(e.left);if(r){const n=await un(e.right,t);let i=n;for(const e of r){if(null==i)return;i=Be(i)?Ge(i,e):i[e]}return"function"==typeof i?i.bind(n):i}}const a=await un(e.left,t);if("and"===r){if(!a)return a;const r=await un(e.right,t);return ln(t,"and").evaluate(t,a,r)}if("or"===r){if(a)return a;const r=await un(e.right,t);return ln(t,"or").evaluate(t,a,r)}const o=await un(e.right,t),s=e=>"string"==typeof e?e.toLowerCase():e,l=e.ignoringCase?s(a):a,c=e.ignoringCase?s(o):o;switch(r){case"+":{let r=a,n=o;return e.coerceNumeric&&("string"==typeof r&&(r=Ce(r)),"string"==typeof n&&(n=Ce(n))),"string"==typeof r||"string"==typeof n?(r??"")+""+(n??""):Array.isArray(r)?Array.isArray(n)?[...r,...n]:[...r,n]:cn(await ln(t,"addition").evaluate(t,{left:r,right:n}))}case"-":return cn(await ln(t,"subtraction").evaluate(t,{left:a,right:o}));case"*":return cn(await ln(t,"multiplication").evaluate(t,{left:a,right:o}));case"/":return cn(await ln(t,"division").evaluate(t,{left:a,right:o}));case"%":case"mod":return cn(await ln(t,"modulo").evaluate(t,{left:a,right:o}));case"^":case"**":return cn(await ln(t,"power").evaluate(t,{left:a,right:o}));case">":case"is greater than":return ln(t,"greaterThan").evaluate(t,a,o);case"<":case"is less than":return ln(t,"lessThan").evaluate(t,a,o);case">=":case"is greater than or equal to":return ln(t,"greaterThanOrEqual").evaluate(t,a,o);case"<=":case"is less than or equal to":return ln(t,"lessThanOrEqual").evaluate(t,a,o);case"==":return ln(t,"equals").evaluate(t,l,c);case"is":case"am":case"equals":case"is equal":case"is equal to":{const r=bn(e,a,o);return void 0!==r?r:ln(t,"equals").evaluate(t,l,c)}case"!=":return ln(t,"notEquals").evaluate(t,l,c);case"is not":case"is not equal":case"is not equal to":{const r=bn(e,a,o);return void 0!==r?!r:ln(t,"notEquals").evaluate(t,l,c)}case"===":case"really equals":case"is really":case"is really equal to":return ln(t,"strictEquals").evaluate(t,l,c);case"!==":case"is not really":case"is not really equal to":return ln(t,"strictNotEquals").evaluate(t,l,c);case"as":return ln(t,"as").evaluate(t,a,xn(o));case"contains":case"contain":case"includes":case"include":return ln(t,"contains").evaluate(t,l,c);case"does not contain":case"do not contain":case"does not contains":case"does not include":return ln(t,"doesNotContain").evaluate(t,l,c);case"starts with":return ln(t,"startsWith").evaluate(t,l,c);case"ends with":return ln(t,"endsWith").evaluate(t,l,c);case"does not start with":return!await ln(t,"startsWith").evaluate(t,l,c);case"does not end with":return!await ln(t,"endsWith").evaluate(t,l,c);case"match":case"matches":return ln(t,"matches").evaluate(t,l,wn(e.right,c));case"does not match":case"do not match":return!await ln(t,"matches").evaluate(t,l,wn(e.right,c));case"in":case"is in":case"am in":return kn(a,o);case"is not in":case"am not in":return!kn(a,o);case"of":return o&&"object"==typeof o?o[a]:void 0;case"precedes":return zn(a,o,Node.DOCUMENT_POSITION_FOLLOWING);case"does not precede":return!zn(a,o,Node.DOCUMENT_POSITION_FOLLOWING);case"follows":return zn(a,o,Node.DOCUMENT_POSITION_PRECEDING);case"does not follow":return!zn(a,o,Node.DOCUMENT_POSITION_PRECEDING);default:throw Error("Unknown binary operator: "+r)}}(r,t);case"asExpression":return async function(e,t){const r=await un(e.expression,t),n=xn(e.targetType);return ln(t,"as").evaluate(t,r,n)}(r,t);case"betweenExpression":return async function(e,t){const r=await un(e.value,t),n=await un(e.min,t),i=await un(e.max,t),a=e=>"string"==typeof e?e.toLowerCase():e,[o,s,l]=e.ignoringCase?[a(r),a(n),a(i)]:[r,n,i],c=await ln(t,"between").evaluate(t,o,s,l);return e.negated?!c:c}(r,t);case"typeCheckExpression":return async function(e,t){const r=await un(e.value,t),n=e.typeName+"",i=!1!==e.nullOk,a=function(e,t,r){if(null==e&&r)return!0;const n=Object.prototype.toString.call(e).slice(8,-1);if(n===t)return!0;const i=globalThis[t];return"function"==typeof i&&e instanceof i}(r,n,i);return e.negated?!a:a}(r,t);case"collectionExpression":return async function(e,t){const r=await un(e.collection,t);if(null==r)return r;const n=async(e,r)=>un(e,{...t,it:r});switch(e.operator){case"where":return async function(e,t,r){const n=mt(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=[...mt(e)],a=await Promise.all(i.map(e=>n(t,e))),o=i.map((e,t)=>t);o.sort((e,t)=>{const r=a[e],n=a[t];return r===n?0:null==r?1:null==n||n>r?-1:1});const s=o.map(e=>i[e]);return"desc"===r?s.reverse():s}(r,e.right,e.order??"asc",n);case"mapped to":return async function(e,t,r){const n=mt(e);return Promise.all(n.map(e=>r(t,e)))}(r,e.right,n);case"split by":{const n=await un(e.right,t);return a=n,null==(i=r)?[]:(i+"").split(null==a?"":a+"")}case"joined by":return function(e,t){const r=null==t?"":t+"";return mt(e).map(e=>null==e?"":e+"").join(r)}(r,await un(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 un(r,t);switch(e.operator){case"not":case"!":return ln(t,"not").evaluate(t,n);case"no":return ln(t,"no").evaluate(t,n);case"-":return-n;case"+":return+n;case"exists":case"some":return ln(t,"exists").evaluate(t,n);case"does not exist":return ln(t,"doesNotExist").evaluate(t,n);case"is empty":return ln(t,"isEmpty").evaluate(t,n);case"is not empty":return ln(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 un(e.object,t);if(e.computed){const n=await un(e.property,t);return Array.isArray(r)&&"number"==typeof n&&0>n?r[r.length+n]:r?.[n]}return Cn(r,e.property.name,t)}(r,t);case"propertyAccess":return async function(e,t){let r=await un(e.object,t);for(const n of(e.property+"").split(".")){if(null==r)return;r=await Cn(r,n,t)}return r}(r,t);case"callExpression":return async function(e,t){const r=await un(e.callee,t);if(e.isConstructor&&"function"==typeof r){return new r(...await Promise.all(e.arguments.map(e=>un(e,t))))}if("identifier"===e.callee.type){const n=e.callee.name,i=await async function(e,t,r){if(!An.has(t))return Promise.all(e.map(e=>un(e,r)));return Promise.all(e.map(e=>"identifier"===e.type&&e.name?e.name:"selector"===e.type&&e.value?e.value:un(e,r)))}(e.arguments,n,t);switch(n){case"closest":return ln(t,"closest").evaluate(t,...i);case"previous":case"next":{const r=e.relativePositional;if(r){const e=r.from?Ln(await un(r.from,t)):t.me,a=r.within?Ln(await un(r.within,t)):void 0,o=r.inElt?await un(r.inElt,t):void 0;return ln(t,n).evaluate(t,i[0],e,{within:a,inElt:o,inSearch:r.inSearch,wrapping:r.wrapping})}return ln(t,n).evaluate(t,...i)}case"first":return ln(t,"first").evaluate(t,...i);case"last":return ln(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=>un(e,t)));if("memberExpression"===e.callee.type&&e.callee.object){const i=await un(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 ln(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=Rn(e),n=await Promise.all(r.filter(e=>"expr"in e).map(e=>fn(e.expr,t)));return Mn(r,n)}(r,t),a=On(e,n);i.forEach((e,t)=>e.setAttribute("data-hs-query-id",t+""));try{return await ln(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 Sn(e,/\{([^}]*)\}/g,async(e,r)=>(await fn(r.trim(),t)??"")+"")}(r,t));const n="string"==typeof r?On(e,r):r,i=await ln(t,"elementWithSelector").evaluate(t,n);return Ne(i,r,e.fromQuery)}(r,t);case"contextReference":return async function(e,t){switch(e.contextType){case"me":case"you":case"it":return ln(t,e.contextType).evaluate(t);case"my":case"myself":case"I":return ln(t,"me").evaluate(t);case"your":case"yourself":return ln(t,"you").evaluate(t);case"its":return ln(t,"it").evaluate(t);case"event":return t.event;case"target":return t.target??t.event?.target??ln(t,"me").evaluate(t);case"body":return"undefined"!=typeof document?document.body:void 0;case"document":return ln(t,"document").evaluate(t);case"window":return ln(t,"window").evaluate(t);default:return}}(r,t);case"possessiveExpression":return async function(e,t){const r=await un(e.object,t),n=e.property.name;return ln(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 un(t,n)}}}(r,t);case"conditionalExpression":return async function(e,t){const r=await un(e.test,t);if(r)return un(e.consequent,t);if(e.alternate)return un(e.alternate,t);return}(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 un(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 un(e,t)+"",r[i]=await un(n.value,t)}return r}(r,t);case"attributeAccess":return async function(e,t){const r=e.attributeName;if(t.me&&t.me instanceof Element)return t.me.getAttribute(r);return"@"+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 un(e.target,t);if(null==i)throw Error(`Cannot access property "${n}" of ${i}`);return ln(t,"possessive").evaluate(t,i,n)}(r,t);case"templateLiteral":return async function(e,t){let r=e.value;return r=await Sn(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=Tn(e[0],t);for(let t=1;e.length>t&&null!=n;t++)n=n[e[t]];return(n??"")+""}return(Tn(r,t)??"")+""}catch{return""}}),r=await Sn(r,/\$(?:\{([^}]+)\}|\(([^)]+)\))/g,async(e,r,n)=>{const i=r||n;try{return await fn(i,t)+""}catch{return"undefined"}}),r}(r,t);case"stringPostfix":return async function(e,t){const r=await un(e.expression,t);return`${r}${e.unit}`}(r,t);case"blockLiteral":return En(r,t);default:{const r=ie.get(e.type);if(r)return r(e,t);throw Error("Unknown AST node type: "+e.type)}}}on.POSTFIX_UNARY_OPERATORS=new Set(["exists","does not exist","is empty","is not empty","ignoring case"]),on.PRATT_TABLE=re,on.PSEUDO_COMMAND_PREPOSITIONS=["from","on","with","into","at","to"];class pn extends Error{constructor(e){super(`Expression node "${e}" is not synchronously evaluable`),this.name="NotSyncEvaluable"}}function dn(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 pn("selector");if(!e.fromQuery&&/^\*[a-zA-Z][\w-]*$/.test(r))throw new pn("selector");if(e.fromQuery&&/\$[^=]/.test(r)){const{selector:n,elements:i}=function(e,t){const r=Rn(e),n=r.filter(e=>"expr"in e).map(e=>mn(e.expr,t));return Mn(r,n)}(r,t),a=On(e,n),o=t?.me?.ownerDocument??("undefined"!=typeof document?document:null);if(!o)throw new pn("selector");i.forEach((e,t)=>e.setAttribute("data-hs-query-id",t+""));try{return Array.from(o.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)=>(mn(r.trim(),t)??"")+"")}(r,t):r,i=On(e,n),a=t?.me?.ownerDocument??("undefined"!=typeof document?document:null);if(!a)throw new pn("selector");return Ne(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?we(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 pn("contextReference")}}(r.contextType,t);case"arrayLiteral":return r.elements.map(e=>dn(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:dn(e,t)+"",r[i]=dn(n.value,t)}return r}(r,t);case"asExpression":return st(dn(r.expression,t),xn(r.targetType),t);case"stringPostfix":return`${dn(r.expression,t)}${r.unit}`;case"blockLiteral":return En(r,t);case"memberExpression":{const e=dn(r.object,t);if(null==e)return;if(e instanceof Element||Array.isArray(e)||"undefined"!=typeof Node&&e instanceof Node)throw new pn("memberExpression");const n=e[r.computed?dn(r.property,t)+"":r.property?.name];return"function"==typeof n?n.bind(e):n}default:throw new pn(r?.type??"unknown")}}function mn(e,t){const r=sn(e);if(!r.success||!r.node){const e=r.error??r.errors?.[0];throw Error("Failed to parse expression: "+(e?.message??"unknown error"))}return dn(r.node,t)}async function fn(e,t){const r=sn(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 yn()};return un(r.node,n)}let hn=null;async function yn(){if(!hn){const e=await Promise.resolve().then(function(){return za});hn=e.createFullExpressionRegistry()}return hn}async function vn(e,t){const r=e.name;return r.startsWith("$")?de(r.slice(1),t):"global"===e.scope&&de(r,t),"me"===r||"my"===r||"I"===r?ln(t,"me").evaluate(t):"you"===r||"your"===r||"yourself"===r?ln(t,"you").evaluate(t):"it"===r||"its"===r?ln(t,"it").evaluate(t):"result"===r?ln(t,"result").evaluate(t):"window"===r?ln(t,"window").evaluate(t):"document"===r?ln(t,"document").evaluate(t):"global"===e.scope&&t.globals?.has(r)?t.globals.get(r):"element"===e.scope?we(t,r):t.locals&&t.locals.has(r)?(fe(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 gn(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=gn(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 kn(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 wn(e,t){return e&&"selector"===e.type&&"string"==typeof e.value?e.value:t}function bn(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 zn(e,t,r){return e instanceof Node&&t instanceof Node&&0!==(e.compareDocumentPosition(t)&r)}function xn(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 En(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 dn(e.body,a)}catch(t){if(t instanceof pn)return un(e.body,a);throw t}}}function Tn(e,t){if(t.locals?.has(e))return fe(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 Sn(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 Cn(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?Ge(e,t):pt(e)&&!(t in e)?ln(r,"possessive").evaluate(r,e,t):e?.[t]}const An=new Set(["closest","previous","next"]);function Ln(e){return e instanceof Element?e:Array.isArray(e)&&e[0]instanceof Element?e[0]:void 0}const jn=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");const Pn=/[:&()[\]/]/g;function On(e,t){return e.fromQuery||!t.startsWith(".")||t.includes("{")?function(e){return e.replace(jn,"$1\\:")}(t):function(e){return e[0]+e.slice(1).replace(Pn,"\\$&")}(t)}const Nn=/\$\{([^}]+)\}|\$([a-zA-Z_$][a-zA-Z0-9_.$]*)/g;function Rn(e){const t=[];let r,n=0;for(Nn.lastIndex=0;null!==(r=Nn.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 Mn(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++];Be(e)?(r+=`[data-hs-query-id='${n.length}']`,n.push(e)):r+=(e??"")+""}return{selector:r,elements:n}}class In{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=[]}}class Wn{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)},description:r+" listener"})}registerObserver(e,t){this.addCleanup(e,{type:"observer",cleanup:()=>{t.disconnect()},description:"MutationObserver"})}registerInterval(e,t){this.addCleanup(e,{type:"interval",cleanup:()=>{clearInterval(t)},description:"Interval"})}registerTimeout(e,t){this.addCleanup(e,{type:"timeout",cleanup:()=>{clearTimeout(t)},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"})}addCleanup(e,t){const r=this.elementCleanups.get(e);r?r.push(t):(this.elementCleanups.set(e,[t]),this.elementCount++),this.typeCounts[t.type]++}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.typeCounts[e.type]--}return this.elementCleanups.delete(e),this.elementCount--,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){}return this.globalCleanups=[],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 _n{constructor(){this.sources=new Map,this.subscriptions=new Map,this.nextId=1}register(e,t){const r=e.toLowerCase();this.sources.has(r),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;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){if(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){r[i]=void 0}return r}getProviderNames(){return[...new Set([...this.globalProviders.keys(),...this.providers.keys()])]}clear(){this.providers.clear(),this.globalProviders.clear()}}const $n={evaluate:(e,t)=>un(e,t)};class Vn{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 Dn{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(this.hookRegistry&&await this.hookRegistry.runBeforeExecute(n),this.hookRegistry?.shouldIntercept(this.name,n))return;const i=Vn.toTyped(e);let a,o;if(this.impl.parseInput&&"function"==typeof this.impl.parseInput)if(r&&"object"==typeof r&&("args"in r||"modifiers"in r)){const t=r.modifiers,n=t?.when||t?.where;if(n){if(!await un(n,e))return}a=await this.impl.parseInput({args:r.args||[],modifiers:t||{},commandName:r.commandName},$n,e)}else a=t;else a=t;if(2===this.impl.execute.length)o=await this.impl.execute(a,i);else{const e=Array.isArray(a)?a:[a];o=await this.impl.execute(i,...e)}return Object.assign(e,Vn.fromTyped(i,e)),this.hookRegistry&&await this.hookRegistry.runAfterExecute(n,o),o}catch(e){if(Zn(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 Bn{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)}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();this.implementations.set(r,e);const n=new Dn(e,void 0,this.hookRegistry);this.adapters.set(r,n),R.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),R.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(", ")]}}}function Hn(e){const t=e?.commands??new Bn,r=e?.eventSources??new _n,n=e?.context??new qn,i=new Set,a={commands:t,eventSources:r,context:n,use(e){if(!i.has(e.name)){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}let Kn=null;function Fn(){return Kn||(Kn=Hn()),Kn}class Un{constructor(e={}){this.contextCache=new WeakMap;const t=Fn();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}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),this.contextRegistry.getProviderNames(),t}catch(t){return e}}getEventSource(e){if(!this.options.enableEventSources)return;const t=this.eventSourceRegistry.get(e);if(t)return t;const r=this.eventSourceRegistry.findSourceForEvent(e);if(r){return this.eventSourceRegistry.get(r)}}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 n}getEventSourceNames(){return this.eventSourceRegistry.getSourceNames()}getContextProviderNames(){return this.contextRegistry.getProviderNames()}destroy(){this.eventSourceRegistry.destroy(),this.contextCache=new WeakMap}}function Gn(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 Zn(e){return e instanceof Error&&(null!==t(e)||"HALT_EXECUTION"===e.message||"EXIT_COMMAND"===e.message||"EXIT_EXECUTION"===e.message)}function Yn(e){return null!==e&&"object"==typeof e&&"command"in e&&"selector"in e}const Xn=new WeakMap;function Jn(e,t=new Set){if(null===e||"object"!=typeof e)return t;if(Array.isArray(e)){for(const r of e)Jn(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&&Jn(r[e],t);return t}class Qn{constructor(e){if(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=xe(),this.hookRegistry=new In,e.hooks&&this.hookRegistry.register("default",e.hooks),this.registry.setHookRegistry(this.hookRegistry),this.cleanupRegistry=new Wn,this.options.enableAutoCleanup&&this.setupAutoCleanup(),!1!==e.registryIntegration){this.registryIntegration=new Un("object"==typeof e.registryIntegration?e.registryIntegration:{})}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){this.cleanupRegistry.cleanupElementTree(e)}})}),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()}hasErrorDiagnostics(e){const t=e.diagnostics;return!!t?.some(e=>"error"===e.severity)}getWarnings(){return this.runtimeWarnings}async execute(e,r){r.registry||(r.registry=this.expressionRegistry),r.locals.has("_behaviors")||r.locals.set("_behaviors",this.behaviorAPI),r.locals.has("_runtimeExecute")||r.locals.set("_runtimeExecute",(e,t)=>this.execute(e,t||r));try{if(this.hasErrorDiagnostics(e)){const t=e.diagnostics?.[0];return void this.runtimeWarnings.push(t?.message||"Skipped error node")}switch(e.type){case"command":if(this.options.enableResultPattern){const t=await this.processCommandWithResult(e,r);if(!i(t)){if("return"===t.error.type){const e=t.error.returnValue;return void 0!==e&&Object.assign(r,{it:e,result:e}),e}throw Gn(t.error)}return t.value}try{return await this.processCommand(e,r)}catch(e){const n=t(e);if(n?.isReturn){const e=n.returnValue;return void 0!==e&&Object.assign(r,{it:e,result:e}),e}throw e}case"eventHandler":return await this.executeEventHandler(e,r);case"event":{const t={type:"eventHandler",event:e.event,events:[e.event],commands:e.body||[],target:e.filter,modifiers:e.modifiers||{}};return await this.executeEventHandler(t,r)}case"behavior":return await this.executeBehaviorDefinition(e,r);case"def":return this.installFunction(e,r);case"Program":return await this.executeProgram(e,r);case"initBlock":case"block":return await this.executeBlock(e,r);case"sequence":case"CommandSequence":if(this.options.enableResultPattern){const t=e,n=await this.executeCommandSequenceWithResult(t.commands||[],r);if(!i(n))throw Gn(n.error);return n.value}return await this.executeCommandSequence(e,r);case"objectLiteral":return await this.executeObjectLiteral(e,r);default:if(this.options.enableResultPattern){const t=await this.evaluateExpressionWithResult(e,r);if(!i(t))throw Gn(t.error);return t.value}return await this.evaluateExpression(e,r)}}catch(e){throw e}}async processCommand(e,t){const{name:r,args:n,modifiers:i}=e,a=r.toLowerCase();if(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 Zn(e)||this.logError(`Error executing command '${a}':`,e),e}}const o=`Unknown command: ${r}. Ensure it is registered in the Runtime options.`;throw this.logWarn(o),Error(o)}toSignal(e){const r=t(e);if(r){if(r.isHalt||"HALT_EXECUTION"===r.message)return{type:"halt"};if(r.isExit||"EXIT_COMMAND"===r.message)return{type:"exit",returnValue:r.returnValue};if(r.isBreak)return{type:"break"};if(r.isContinue)return{type:"continue"};if(r.isReturn)return{type:"return",returnValue:r.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:i,args:a,modifiers:o}=e,s=i.toLowerCase();if(!this.registry.has(s)){const e=`Unknown command: ${i}. Ensure it is registered in the Runtime options.`;throw this.logWarn(e),Error(e)}const l=await this.registry.getAdapter(s);if(!l)throw Error(`Command '${s}' is registered but failed to load adapter.`);try{return r(await l.execute(t,{args:a||[],modifiers:o||{},commandName:s,runtime:this}))}catch(e){const t=this.toSignal(e);if(t)return n(t);throw this.logError(`Error executing command '${s}':`,e),e}}async executeCommandSequenceWithResult(e,t){let n;for(const a of e){if(this.hasErrorDiagnostics(a)){const e=a.diagnostics?.[0];this.runtimeWarnings.push(e?.message||"Skipped error node");continue}if("command"===a.type){const e=await this.processCommandWithResult(a,t);if(!i(e)){const n=e.error;switch(n.type){case"halt":case"exit":case"break":case"continue":return e;case"return":return void 0!==n.returnValue&&Object.assign(t,{it:n.returnValue,result:n.returnValue}),r(n.returnValue)}}n=e.value}else{const e=await this.evaluateExpressionWithResult(a,t);if(!i(e))return e;n=e.value}}return r(n)}async evaluateExpression(e,t){const r=t.registry?t:{...t,registry:this.expressionRegistry},n=await un(e,r);return Yn(n)?await this.executeCommandFromPattern(n.command,n.selector,t):n}async evaluateExpressionWithResult(e,t){const a=t.registry?t:{...t,registry:this.expressionRegistry},o=await async function(e,t){try{return r(await un(e,t))}catch(e){if(e instanceof Error){const t=e;if(t.isHalt||"HALT_EXECUTION"===t.message)return n({type:"halt"});if(t.isExit||"EXIT_COMMAND"===t.message)return n({type:"exit",returnValue:t.returnValue});if(t.isBreak)return n({type:"break"});if(t.isContinue)return n({type:"continue"});if(t.isReturn)return n({type:"return",returnValue:t.returnValue})}throw e}}(e,a);if(!i(o))return o;const s=o.value;if(Yn(s)){if(this.options.enableResultPattern){return this.processCommandWithResult({type:"command",name:s.command,args:[{type:"literal",value:s.selector}]},t)}try{return r(await this.executeCommandFromPattern(s.command,s.selector,t))}catch(e){const t=this.toSignal(e);if(t)return n(t);throw e}}return r(s)}async executeCommandFromPattern(e,t,r){return this.processCommand({type:"command",name:e,args:[{type:"literal",value:t}]},r)}installFunction(e,r){const n=this,a=e.params??[],o=e.body??[],s=e.errorHandler,l=e.finallyHandler,c=e.errorSymbol;r.globals.set(e.name,async(...e)=>{const u={...r,locals:new Map(r.locals)};a.forEach((t,r)=>{t&&u.locals.set(t,e[r])});const p=async e=>{const r=await n.executeCommandSequenceWithResult(e,u);if(!i(r))throw t(r.error);return r.value};if(!s&&!l)return await p(o);try{return await p(o)}catch(e){if(!s||Zn(e))throw e;return c&&u.locals.set(c,e),await p(s)}finally{l&&await p(l)}})}async executeProgram(e,t){if(!e.statements||!Array.isArray(e.statements))return;let r;const n=[],i=[],a=[],o=[];for(const t of e.statements)"eventHandler"===t.type?n.push(t):"def"===t.type?i.push(t):"initBlock"===t.type?a.push(t):o.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(Zn(e)&&(e.isHalt||e.isExit))break;throw e}for(const e of a)try{r=await this.execute(e,t)}catch(e){if(Zn(e)&&(e.isHalt||e.isExit))break;throw e}for(const e of o)try{r=await this.execute(e,t)}catch(e){if(Zn(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(Zn(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(Zn(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;if("identifier"===n.key.type)e=n.key.name;else if("literal"===n.key.type)e=n.key.value+"";else{e=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,o=e.imperativeInstaller;this.behaviorRegistry.set(r,"function"==typeof o?{name:r,parameters:n,type:"imperative",install:o}:{name:r,parameters:n,eventHandlers:i,initBlock:a})}async installBehaviorOnElement(e,t,r){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&&n.install(t,r));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){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))])}catch(e){if(!(e instanceof Error&&Zn(e)))throw e}}if(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))])}}async executeEventHandler(e,t){const{event:r,events:n,commands:i,target:a,args:o,selector:s,condition:l,attributeName:c,watchTarget:u,modifiers:p,errorSymbol:d,errorHandler:m,finallyHandler:f}=e,h=n&&n.length>0?n:[r];let y=[],v=null;if(a){const e="string"==typeof a?a.toLowerCase():"";if("window"===e||"the window"===e)v=window;else if("document"===e||"the document"===e||"body"===e)v=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);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 y=this.queryElements(a,t)}else y=t.me?[t.me]:[];if(0===y.length&&!v)return;if("mutation"===r&&c)return void this.setupMutationObserver(y,c,i,t);if("change"===r&&u)return void this.setupChangeObserver(u,i,t);const g=e.customEventSource;if(g&&this.registryIntegration){const e=async e=>{const n=new Map(t.locals),a={...t,locals:n,it:e,event:e},o=this.enhanceContext(a);try{await this.execute({type:"program",commands:i},o)}catch(e){this.logError(`[HyperFixi] Error executing commands for custom event '${r}':`,e)}};try{const n=this.registryIntegration.subscribeToEventSource(g,{event:r,handler:e,target:a,selector:s},t);this.cleanupRegistry.registerGlobal(()=>n.unsubscribe(),"listener",`Custom event source '${g}' subscription ${n.id}`)}catch(e){this.logError(`[HyperFixi] Failed to subscribe to custom event source '${g}':`,e)}return}const k=Qn.createEventHandler(this,i,t,s,o,{errorSymbol:d,errorHandler:m,finallyHandler:f},1===h.length?l:void 0);let w,b=null;if(p){let e=k;if(p.prevent){const t=e;e=async e=>(e.preventDefault(),t(e))}if(p.stop){const t=e;e=async e=>(e.stopPropagation(),t(e))}if(p.debounce){const t=p.debounce;let r;w=n=>{r&&clearTimeout(r),r=setTimeout(()=>e(n),t)},b=()=>{r&&(clearTimeout(r),r=void 0)}}else if(p.throttle){const t=p.throttle;let r=0;w=n=>{const i=Date.now();t>i-r||(r=i,e(n))}}else w=e}else w=k;const z=p?.once?{once:!0}:void 0;if(v){for(const e of h)v.addEventListener(e,w,z),y.length>0?this.cleanupRegistry.registerListener(y[0],v,e,w):this.cleanupRegistry.registerGlobal(()=>v.removeEventListener(e,w),"listener",`Global ${e} listener`);b&&(y.length>0?this.cleanupRegistry.registerCustom(y[0],b,"debounce-timeout"):this.cleanupRegistry.registerGlobal(b,"timeout","debounce-timeout"))}else for(const e of y){for(const t of h){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),z?.once){t.disconnect();break}}});t.observe(e),this.cleanupRegistry.registerCustom(e,()=>t.disconnect(),"resize-observer");continue}e.addEventListener(t,w,z),this.cleanupRegistry.registerListener(e,e,t,w)}b&&this.cleanupRegistry.registerCustom(e,b,"debounce-timeout")}}static createEventHandler(e,t,r,n,i,a,o){return async s=>{const l=Xn.get(s)??0;if(l>=100)return;if(Xn.set(s,l+1),n&&s.target instanceof Element)try{if(!s.target.matches(n)&&!s.target.closest(n))return}catch{}const c=new Map(r.locals),u={...r,locals:c,it:s,event:s};c.has("target")||u.locals.set("target",s.target);const p=e.enhanceContext(u);if(i&&i.length>0){const e=s,t=e.detail;for(const r of i){p.locals.set(r,e[r]??t?.[r]??null)}}if(o){const t=s;for(const e of Jn(o))!p.locals.has(e)&&e in t&&p.locals.set(e,t[e]);let r;try{r=await e.evaluateExpression(o,p)}catch(e){return}if(!r)return}const d=async t=>{for(const r of t)try{await e.execute(r,p)}catch(t){if(Zn(t)){if(t.isHalt||t.isExit)break;if(t.isReturn){void 0!==t.returnValue&&Object.assign(p,{it:t.returnValue,result:t.returnValue});break}}throw e.logError("COMMAND FAILED:",t),t}},m=a?.errorHandler,f=a?.finallyHandler;if(m||f)try{await d(t)}catch(e){if(!m||Zn(e))throw e;a?.errorSymbol&&p.locals.set(a.errorSymbol,e),await d(m)}finally{f&&await d(f)}else await d(t)}}setupMutationObserver(e,t,r,n){for(const i of e){const e=new MutationObserver(async e=>{for(const a of e)if("attributes"===a.type&&a.attributeName===t){const e={...n,me:i,it:a,locals:new Map(n.locals)},o=a.oldValue,s=i.getAttribute(t);e.locals.set("oldValue",o),e.locals.set("newValue",s);const l=this.enhanceContext(e);for(const e of r)try{await this.execute(e,l)}catch(e){if(Zn(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)}}async setupChangeObserver(e,t,r){const n=await this.execute(e,r);let i=[];this.isElement(n)?i=[n]:Array.isArray(n)&&(i=n.filter(e=>this.isElement(e)));for(const e of i){const n=new MutationObserver(async n=>{for(const i of n)if("childList"===i.type||"characterData"===i.type){const n={...r,me:r.me,it:i,locals:new Map(r.locals)};n.locals.set("target",e);const a=i.oldValue,o=e.textContent;null!==a&&n.locals.set("oldValue",a),n.locals.set("newValue",o);const s=this.enhanceContext(n);for(const e of t)try{await this.execute(e,s)}catch(e){if(Zn(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)}}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[]}}isElement(e){if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;if(e&&"object"==typeof e){return!!e.style&&!!e.classList}return!1}}function ei(...e){const t=new Map;for(const r of e)for(const[e,n]of Object.entries(r))t.set(e,n);return t}function ti(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 ri={me:{name:"me",category:"Reference",evaluatesTo:"Element",evaluate:async e=>e.me??null,validate:et},you:{name:"you",category:"Reference",evaluatesTo:"Element",evaluate:async e=>e.you??null,validate:et},it:{name:"it",category:"Reference",evaluatesTo:"Any",evaluate:async e=>e.it??e.result,validate:et},its:{name:"its",category:"Reference",evaluatesTo:"Any",evaluate:async e=>e.it??e.result,validate:et},result:{name:"result",category:"Reference",evaluatesTo:"Any",evaluate:async e=>e.result??e.it,validate:et},querySelector:{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=>Je(e,"querySelector","selector")},querySelectorAll:{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=>Je(e,"querySelectorAll","selector")},getElementById:{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=>Je(e,"getElementById","ID")},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=>Je(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];if("string"==typeof t)return null;if(t&&"object"==typeof t&&"type"in t){if("identifier"===t.type||"literal"===t.type)return null}return"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:et},window:{name:"window",category:"Reference",evaluatesTo:"Object",evaluate:async e=>window,validate:et},document:{name:"document",category:"Reference",evaluatesTo:"Object",evaluate:async e=>document,validate:et},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=>Je(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 ti(i,r)},validate:e=>rt(e,1,2,"styleRef","property, optional element")??Xe(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 ti(i,n)},validate:e=>Ye(e,2,"possessiveStyleRef","possessor, property")??Xe(e,0,"possessiveStyleRef","possessor")??Xe(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 ti(i,r)},validate:e=>Ye(e,2,"ofStyleRef","property, reference")??Xe(e,0,"ofStyleRef","property")??Xe(e,1,"ofStyleRef","reference")}};class ni{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 ii=new class{constructor(){this.domQueryCache=new ni(200,3e3),this.exprResultCache=new ni(500,2e3),this.cssMatchCache=new ni(100,5e3),this.formValueCache=new ni(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(()=>{ii.cleanup()},1e4);const ai=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=ii.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 oi(){ii.cleanup();ai.getMetrics().memoryUsage>52428800&&ai.reset()}let si=null;function li(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 li(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 ci(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 ui(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 pi(e){try{return li(e,"_"),!0}catch{return!1}}function di(e,t,r){if("==="===r)return e===t;if("!=="===r)return e!==t;if(null==e||null==t)return function(e,t,r){const n=null==e,i=null==t;if(n&&i)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=ci(e),n=ci(t);if(null!==r&&null!==n)return[r,n];return[e+"",t+""]}(e,t);switch(r){case">":return n>i;case"<":return i>n;case">=":return n>=i;case"<=":return i>=n;case"==":return mi(e,t);case"!=":return!mi(e,t);default:return!1}}function mi(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?mi(e?1:0,t):"boolean"==typeof t?mi(e,t?1:0):e+""==t+""}function fi(e,t=[]){return{isValid:!1,errors:e,suggestions:t}}function hi(e,t,r=[],n="error"){return{type:e,message:t,suggestions:r,severity:n}}function yi(e,t,r,n,i,a=!0,o){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!==o&&{error:o}}),n}function vi(e){return null!==e&&"object"==typeof e&&"nodeType"in e&&1===e.nodeType}"undefined"!=typeof window&&function(e=3e4){si&&clearInterval(si),si=setInterval(oi,e)}();const gi=e.tuple([e.unknown(),e.unknown()]),ki=e.tuple([e.unknown(),e.string()]),wi={name:"equals",category:"Comparison",evaluatesTo:"Boolean",precedence:10,associativity:"Left",operators:["is","==","equals"],async evaluate(e,t,r){const n=Date.now();try{return yi(this,e,[t,r],t==r,n)}catch(i){throw yi(this,e,[t,r],!1,n,!1,i instanceof Error?i:Error(i+"")),i}},validate:e=>Qe(e,"equals"),inputSchema:gi,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"]}},bi={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&&yi(this,e,[t,r],i,n?Date.now():0),i},validate:e=>Qe(e,"strictEquals")},zi={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&&yi(this,e,[t,r],i,n?Date.now():0),i},validate:e=>Qe(e,"notEquals")},xi={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&&yi(this,e,[t,r],i,n?Date.now():0),i},validate:e=>Qe(e,"strictNotEquals")},Ei={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=di(t,r,"<");return n&&yi(this,e,[t,r],a,i),a},validate:e=>Qe(e,"lessThan")},Ti={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=di(t,r,"<=");return n&&yi(this,e,[t,r],a,i),a},validate:e=>Qe(e,"lessThanOrEqual")},Si={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=di(t,r,">");return n&&yi(this,e,[t,r],a,i),a},validate:e=>Qe(e,"greaterThan")},Ci={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=di(t,r,">=");return n&&yi(this,e,[t,r],a,i),a},validate:e=>Qe(e,"greaterThanOrEqual")},Ai={name:"and",category:"Logical",evaluatesTo:"Boolean",precedence:6,associativity:"Left",operators:["and","&&"],async evaluate(e,t,r){const n=Date.now();try{return yi(this,e,[t,r],t&&r,n)}catch(i){throw yi(this,e,[t,r],!1,n,!1,i instanceof Error?i:Error(i+"")),i}},validate:e=>Qe(e,"and"),inputSchema:gi,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"]}},Li={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&&yi(this,e,[t,r],i,n?Date.now():0),i},validate:e=>Qe(e,"or")},ji={name:"not",category:"Logical",evaluatesTo:"Boolean",precedence:15,associativity:"Right",operators:["not","!"],async evaluate(e,t){const r=e.evaluationHistory,n=!t;return r&&yi(this,e,[t],n,r?Date.now():0),n},validate:e=>Ye(e,1,"not","operand")},Pi={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||(We(t)||Array.isArray(t)||t instanceof NodeList?0===t.length:!(t instanceof Node||t instanceof Element)&&(!!$e(t)&&0===Object.keys(t).length)),r&&yi(this,e,[t],i,n),i},validate:e=>Ye(e,1,"isEmpty","value")},Oi={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:(We(t),!1))),r&&yi(this,e,[t],i,n),i},validate:e=>Ye(e,1,"no","value")},Ni={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 Pi.evaluate(e,t);return r&&yi(this,e,[t],i,n),i},validate:e=>Ye(e,1,"isNotEmpty","value")},Ri={name:"exists",category:"Logical",evaluatesTo:"Boolean",operators:["exists"],async evaluate(e,t){const r=e.evaluationHistory,n=r?Date.now():0,i=Mi(t);return r&&yi(this,e,[t],i,n),i},validate:e=>Ye(e,1,"exists","value")};function Mi(e){return null!=e&&(Array.isArray(e)?e.length>0:!("undefined"!=typeof NodeList&&e instanceof NodeList)||e.length>0)}const Ii={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=!Mi(t);return r&&yi(this,e,[t],i,n),i},validate:e=>Ye(e,1,"doesNotExist","value")},Wi={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(vi(t)&&vi(r))return a=t.contains(r),n&&yi(this,e,[t,r],a,i),a;if(We(t)&&t.match(/^[.#][\w-]+$/)){const o=document.querySelector(t);if(o&&vi(r))return a=o.contains(r),n&&yi(this,e,[t,r],a,i),a;if(o&&We(r)&&r.match(/^[.#][\w-]+$/)){const s=document.querySelector(r);return a=!!s&&o.contains(s),n&&yi(this,e,[t,r],a,i),a}}if(We(r)&&r.match(/^[.#][\w-]+$/)&&vi(t)){const o=document.querySelector(r);return a=!!o&&t.contains(o),n&&yi(this,e,[t,r],a,i),a}}if(We(t)&&We(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=!(!$e(t)||!We(r))&&r in t;return n&&yi(this,e,[t,r],a,i),a},validate:e=>Ye(e,2,"contains","container, value")},_i={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 Wi.evaluate(e,t,r);return n&&yi(this,e,[t,r],a,i),a},validate:e=>Ye(e,2,"doesNotContain","container, value")},qi={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&&yi(this,e,[t,r],a,i),a},validate:e=>Ye(e,2,"startsWith","str, prefix")},$i={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&&yi(this,e,[t,r],a,i),a},validate:e=>Ye(e,2,"endsWith","str, suffix")},Vi={name:"between",category:"Logical",evaluatesTo:"Boolean",operators:["is between","between"],async evaluate(e,t,r,n){const i=e.evaluationHistory;let a=r,o=n;if(null!=a&&null!=o&&a>o){const e=a;a=o,o=e}const s=null!=a&&null!=o&&t>=a&&o>=t;return i&&yi(this,e,[t,r,n],s,i?Date.now():0),s},validate:e=>Ye(e,3,"between","value, min, max")},Di={name:"matches",category:"Logical",evaluatesTo:"Boolean",operators:["matches"],async evaluate(e,t,r){const n=Date.now();try{let i;if(t instanceof Element&&We(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 ii.matches(e,t)}(t,e)}catch(e){i=!1}else i=!1}else if(We(t)&&We(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 yi(this,e,[t,r],i,n)}catch(i){throw yi(this,e,[t,r],!1,n,!1,i instanceof Error?i:Error(i+"")),i}},validate:e=>Ye(e,2,"matches","element, selector"),inputSchema:ki,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"]}},Bi={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&&We(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&&yi(this,e,[t,r],a,i),a},validate:e=>Ye(e,2,"has","element, selector")},Hi={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 Bi.evaluate(e,t,r);return n&&yi(this,e,[t,r],a,i),a},validate:e=>Ye(e,2,"doesNotHave","element, selector")},Ki={equals:wi,strictEquals:bi,notEquals:zi,strictNotEquals:xi,lessThan:Ei,lessThanOrEqual:Ti,greaterThan:Si,greaterThanOrEqual:Ci,and:Ai,or:Li,not:ji,no:Oi,isEmpty:Pi,isNotEmpty:Ni,exists:Ri,doesNotExist:Ii,contains:Wi,doesNotContain:_i,startsWith:qi,endsWith:$i,between:Vi,matches:Di,has:Bi,doesNotHave:Hi};class Fi{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&&(!_e(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":$e(e)?"object":typeof e}inferEvaluationType(e){return void 0===e?"Undefined":null===e?"Null":We(e)?"String":_e(e)?"Number":qe(e)?"Boolean":Array.isArray(e)?"Array":this.isElement(e)?"Element":"Object"}normalizeCollection(e){return Array.isArray(e)?e:e instanceof NodeList?Array.from(e):We(e)?e.split(""):null==e?[]:$e(e)&&Symbol.iterator in e?Array.from(e):[]}toNumber(e){if(_e(e)&&Number.isFinite(e))return e;if(We(e)){const t=Number(e);return Number.isFinite(t)?t:null}return qe(e)?e?1:0:null}}const Ui=e.object({value:e.string().describe("String literal value")}).strict(),Gi=e.object({value:e.number().describe("Number literal value")}).strict(),Zi=e.object({value:e.boolean().describe("Boolean literal value")}).strict(),Yi=e.object({left:e.unknown().describe("Left operand"),right:e.unknown().describe("Right operand")}).strict();class Xi extends Fi{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=Ui,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)?(fe(e,t),t.locals.get(e)):t.globals?.has(e)?t.globals.get(e):void 0}}class Ji extends Fi{constructor(){super(...arguments),this.name="numberLiteral",this.category="Special",this.syntax="123 or 3.14",this.description="Numeric literal with validation",this.inputSchema=Gi,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"])}}}class Qi extends Fi{constructor(){super(...arguments),this.name="booleanLiteral",this.category="Special",this.syntax="true or false",this.description="Boolean literal values",this.inputSchema=Zi,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"])}}}let ea=class extends Fi{constructor(){super(...arguments),this.name="addition",this.category="Special",this.syntax="left + right",this.description="Addition of two numeric values",this.inputSchema=Yi,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=li(t.left,"left operand"),a=i+li(t.right,"right operand");return this.trackSimple(e,r,!0,a),this.success(a,"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"])}}};class ta extends Fi{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=Yi,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),a=i+this.convertToString(t.right);return this.trackSimple(e,r,!0,a),this.success(a,"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=Yi.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(We(e))return e;if(_e(e))return""+e;if(qe(e))return""+e;if(e instanceof Date)return""+e;try{return e+""}catch{return"[object Object]"}}}let ra=class extends Fi{constructor(){super(...arguments),this.name="multiplication",this.category="Special",this.syntax="left * right",this.description="Multiplication of two numeric values",this.inputSchema=Yi,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=li(t.left,"left operand"),a=i*li(t.right,"right operand");return this.trackSimple(e,r,!0,a),this.success(a,"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"])}}};const na={stringLiteral:new Xi,numberLiteral:new Ji,booleanLiteral:new Qi,addition:new ea,stringConcatenation:new ta,multiplication:new ra};const ia={name:"first",category:"Reference",evaluatesTo:"Any",operators:["first"],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[0]:null;if(r instanceof NodeList||r instanceof HTMLCollection)return r.length>0?r[0]:null;if(r instanceof Element)return r.children.length>0?r.children[0]:null;if(We(r)){return r.length>0?r[0]:null}if($e(r)&&"length"in r&&_e(r.length)){return r.length>0?r[0]:null}return null},validate:e=>tt(e,1,"first","collection")},aa={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}if(We(r)){return r.length>0?r[r.length-1]:null}if($e(r)&&"length"in r&&_e(r.length)){return r.length>0?r[r.length-1]:null}return null},validate:e=>tt(e,1,"last","collection")},oa={name:"at",category:"Reference",evaluatesTo:"Any",operators:["at"],async evaluate(e,...t){const[r,n]=t;if(!_e(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(We(a)){const e=0>i?a.length+i:i;return e>=0&&a.length>e?a[e]:null}if($e(a)&&"length"in a&&_e(a.length)){const e=0>i?a.length+i:i;return e>=0&&a.length>e?a[e]:null}return null},validate:e=>rt(e,1,2,"at","index, optional collection")??function(e,t,r,n){if("number"!=typeof e[t])return`${r} ${n} must be a number`;return null}(e,0,"at","index")};function sa(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?sa(n,t):null}function la(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?la(n,t):null}const ca=2,ua=4;function pa(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(r.compareDocumentPosition(e)===ca)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(r.compareDocumentPosition(e)===ua)return r}return n?i[i.length-1]:void 0}(e,i,t,!!r.wrapping)}function da(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 ma={first:ia,last:aa,at:oa,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?pa(a,r,i,!0):sa(a,r):a.nextElementSibling:null},validate(e){const t=tt(e,3,"next","optional selector, optional fromElement, optional modifiers");return t||(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?pa(a,r,i,!1):la(a,r):a.previousElementSibling:null},validate(e){const t=tt(e,3,"previous","optional selector, optional fromElement, optional modifiers");return t||(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 o=a.closest(n);return o?function(e,t,r){const n=Array.from(r.querySelectorAll(t)),i=da(e);for(const e of n){if(da(e)>i)return e}return null}(a,r,o):null},validate(e){const t=rt(e,2,3,"nextWithin","selector, withinSelector, optional fromElement");return t||("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 o=a.closest(n);return o?function(e,t,r){const n=Array.from(r.querySelectorAll(t)),i=da(e);for(let e=n.length-1;e>=0;e--){const t=n[e];if(i>da(t))return t}return null}(a,r,o):null},validate(e){const t=rt(e,2,3,"previousWithin","selector, withinSelector, optional fromElement");return t||("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")}}};class fa{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=li(e,"left operand"),i=li(r,"right operand");return{success:!0,value:ui(n+i,"addition"),type:"number"}}catch(e){return{success:!1,errors:[hi("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 fi([hi("missing-argument","Input is null or undefined")],["Provide an object with left and right operands"]);if("object"!=typeof e)return fi([hi("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"),fi([hi("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 pi(r)?pi(n)?{isValid:!0,errors:[],suggestions:[]}:{isValid:!1,errors:[hi("type-mismatch","Right operand cannot be converted to number: "+(n+""))],suggestions:["Provide a numeric value for right operand"]}:{isValid:!1,errors:[hi("type-mismatch","Left operand cannot be converted to number: "+(r+""))],suggestions:["Provide a numeric value for left operand"]}}}class ha{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=li(e,"left operand"),i=li(r,"right operand");return{success:!0,value:ui(n-i,"subtraction"),type:"number"}}catch(e){return{success:!1,errors:[hi("runtime-error","Subtraction failed: "+(e instanceof Error?e.message:e+""))],suggestions:["Ensure both operands are numeric"]}}}validate(e){return(new fa).validate(e)}}class ya{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=li(e,"left operand"),i=li(r,"right operand");return{success:!0,value:ui(n*i,"multiplication"),type:"number"}}catch(e){return{success:!1,errors:[hi("runtime-error","Multiplication failed: "+(e instanceof Error?e.message:e+""))],suggestions:["Ensure both operands are numeric"]}}}validate(e){return(new fa).validate(e)}}class va{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=li(e,"left operand"),i=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}(n,li(r,"right operand"),!0);return{success:!0,value:i,type:"number"}}catch(e){return{success:!1,errors:[hi("runtime-error","Division failed: "+(e instanceof Error?e.message:e+""))],suggestions:["Ensure both operands are numeric"]}}}validate(e){return(new fa).validate(e)}}class ga{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=li(e,"left operand"),i=function(e,t){if(0===t)throw Error("Modulo by zero");return e%t}(n,li(r,"right operand"));return{success:!0,value:i,type:"number"}}catch(e){return{success:!1,errors:[hi("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 fa).validate(e)}}class ka{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=li(e,"left operand"),i=li(r,"right operand");return{success:!0,value:ui(Math.pow(n,i),"power"),type:"number"}}catch(e){return{success:!1,errors:[hi("runtime-error","Power failed: "+(e instanceof Error?e.message:e+""))],suggestions:["Ensure both operands are numeric"]}}}validate(e){return(new fa).validate(e)}}const wa={addition:new fa,subtraction:new ha,multiplication:new ya,division:new va,modulo:new ga,power:new ka};function ba(){return ei(ri,Ki,lt,ma,dt,na,wa)}var za=Object.freeze({__proto__:null,conversion:lt,conversionExpressions:lt,createCommonRegistry:function(){return ei(ri,Ki,na,lt,ma)},createCoreRegistry:function(){return ei(ri,Ki,na)},createExpressionRegistry:ei,createFullExpressionRegistry:ba,createFullRegistry:function(){return ei(ri,Ki,na,lt,ma,dt)},logical:Ki,logicalExpressions:Ki,positional:ma,positionalExpressions:ma,properties:dt,propertiesExpressions:dt,references:ri,referencesExpressions:ri,special:na,specialExpressions:na});function xa(e,t,r,n,i,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?n.static?e:e.prototype:null,p=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),d=!1,m=r.length-1;m>=0;m--){var f={};for(var h in n)f[h]="access"===h?{}:n[h];for(var h in n.access)f.access[h]=n.access[h];f.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var y=(0,r[m])("accessor"===l?{get:p.get,set:p.set}:p[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=o(y.get))&&(p.get=s),(s=o(y.set))&&(p.set=s),(s=o(y.init))&&i.unshift(s)}else(s=o(y))&&("field"===l?i.unshift(s):p[c]=s)}u&&Object.defineProperty(u,n.name,p),d=!0}function Ea(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 Ta(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 Sa(e){return function(t,r){Object.defineProperty(t.prototype,"name",{value:e.name,writable:!1,enumerable:!0})}}function Ca(e){return{...e}}function Aa(e){return()=>new e}function La(e,t){return e?`[${e}] ${t}`:t}function ja(e,t,r){if(Ee(e))return e;if(!e){const e=t.me;if(!e)throw Error(La(r,"No target element \u2014 provide explicit target or ensure context.me is set"));return Oa(e)}if("string"==typeof e){const n=e.trim();if("me"===n){if(!t.me)throw Error(La(r,'Context reference "me" is not available'));return Oa(t.me)}if("it"===n){if(!Ee(t.it))throw Error(La(r,'Context reference "it" is not an HTMLElement'));return t.it}if("you"===n){if(!t.you)throw Error(La(r,'Context reference "you" is not available'));return Oa(t.you)}const i=t.me?.ownerDocument??("undefined"!=typeof document?document:null);if(!i)throw Error(La(r,"DOM not available \u2014 cannot resolve element selector"));const a=i.querySelector(n);if(!a)throw Error(La(r,"Element not found with selector: "+n));if(!Ee(a))throw Error(La(r,"Element found but is not an HTMLElement: "+n));return a}throw Error(La(r,"Invalid target type: "+typeof e))}function Pa(e,t){if(Array.isArray(e))return e.filter(Ee);if(Se(e))return Array.from(e).filter(Ee);if(Ee(e))return[e];if(!e){const e=t.me;return e&&Ee(e)?[e]:[]}if("string"==typeof e){const r=e.trim();if("me"===r)return t.me&&Ee(t.me)?[t.me]:[];if("it"===r)return Ee(t.it)?[t.it]:[];if("you"===r)return t.you&&Ee(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(Ee)}}return[]}function Oa(e){if(Ee(e))return e;throw Error("Value is not an HTMLElement")}function Na(e,t,r){switch(e.toLowerCase()){case"my":case"me":if(!t.me)throw Error(La(r,'No "me" element in context'));if(!Ee(t.me))throw Error(La(r,"context.me is not an HTMLElement"));return t.me;case"its":case"it":if(!t.it)throw Error(La(r,'No "it" value in context'));if(!Ee(t.it))throw Error(La(r,"context.it is not an HTMLElement"));return t.it;case"your":case"you":if(!t.you)throw Error(La(r,'No "you" element in context'));if(!Ee(t.you))throw Error(La(r,"context.you is not an HTMLElement"));return t.you;default:throw Error(La(r,"Unknown possessive: "+e))}}"function"==typeof SuppressedError&&SuppressedError;const Ra=["on","from","to","in","with","at"];async function Ma(e,t,r,n,i={},a){let o=e;if(i.filterPrepositions&&e&&(o=e.filter(e=>{const t=e;return"identifier"!==t?.type||"string"!=typeof t.name||!Ra.includes(t.name.toLowerCase())})),(!o||0===o.length)&&i.fallbackModifierKey&&a){const e=a[i.fallbackModifierKey];e&&(o=[e])}if(!o||0===o.length){if(!r.me)throw Error(n+" command: no target specified and context.me is null");if(!Ee(r.me))throw Error(n+" command: context.me must be an HTMLElement");return[r.me]}const s=[];for(const e of o){const i=await t.evaluate(e,r);if(""!==i&&("string"!=typeof i||""!==i.trim()))if(Ee(i))s.push(i);else if(Se(i)){const e=Array.from(i).filter(Ee);s.push(...e)}else if(Array.isArray(i)){const e=i.filter(Ee);s.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(Ee);s.push(...a)}catch(e){throw Error(`Invalid CSS selector: "${i}" - ${e instanceof Error?e.message:e+""}`)}}}if(0===s.length){if(!r.me)throw Error(n+" command: no target specified and context.me is null");if(!Ee(r.me))throw Error(n+" command: context.me must be an HTMLElement");return[r.me]}return s}class Ia{async parseInput(e,t,r){const{targets:n}=await async function(e,t,r,n){return{targets:await Ma(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=>Ee(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")}}const Wa=Aa((()=>{let e,t,r=[Sa({name:"hide"})],n=[],i=Ia;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=>Ee(e))}};return Ta(t,"HideCommand"),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;xa(null,e={value:t},r,{kind:"class",name:t.name,metadata:o},null,n),a=t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),t.metadata=Ca({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"}),Ea(t,n),a=t})());const _a=Aa((()=>{let e,t,r=[Sa({name:"show"})],n=[],i=Ia;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=>Ee(e))&&"string"==typeof t.defaultDisplay)}};return Ta(t,"ShowCommand"),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;xa(null,e={value:t},r,{kind:"class",name:t.name,metadata:o},null,n),a=t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),t.metadata=Ca({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"}),Ea(t,n),a=t})());function qa(e){const t=e.trim();return!(!t.startsWith("[@")||!t.endsWith("]"))||!!t.startsWith("@")}function $a(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 Va(e,t){for(const r of e)t(r);return e}function Da(e,t,r){for(const n of e)for(const e of t)r(n,e);return e}function Ba(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 Ha(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&&Fa(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&&Fa(e));const t=(e+"").trim(),r=t.startsWith(".")?t.substring(1):t;return r.length>0&&Fa(r)?[r]:[]}function Ka(e){const t=e.trim();return/^\{[^}]+\}$/.test(t)}function Fa(e){if(!e||0===e.trim().length)return!1;const t=e.trim();if(Ka(t))return!0;return/^[a-zA-Z_-][a-zA-Z0-9_-]*$/.test(t)}function Ua(e,t){return e.map(e=>{if(Ka(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+"":""}return e}).filter(e=>e.length>0)}function Ga(e){return"string"==typeof e&&e.trim().startsWith("*")}function Za(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 Ya(e,t,r){e.style.setProperty(t,r)}const Xa=["dialog","details","summary","select"];function Ja(e){if(!e||"object"!=typeof e)return null;return"string"==typeof e.selector?e.selector:"string"==typeof e.value?e.value:"string"==typeof e.name?e.name:null}function Qa(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 Xa.includes(t)}(t)}async function eo(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=Ja(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=Ja(e);return"string"==typeof r&&r.startsWith("*")}(e)?{value:Ja(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=Ja(e);return"string"==typeof t&&t.startsWith("@")}return!1}(e)?{value:(n=e,"attributeAccess"===n.type?"@"+n.attributeName:Ja(n)),extractedFromNode:!0}:{value:await t.evaluate(e,r),extractedFromNode:!1};var n}class to{async resolveTargets(e,t,r,n){return Ma(e,t,r,this.mode,{filterPrepositions:!0,fallbackModifierKey:this.preposition},n)}async evaluateFirst(e,t,r){return eo(e,t,r)}parseClassNames(e){return Ha(e)}isAttribute(e){return qa(e.trim())}isCSSProperty(e){return Ga(e.trim())}validateTargets(e){return Array.isArray(e)&&function(e){return Array.isArray(e)&&e.length>0&&e.every(e=>Ee(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 ro=(()=>{let e,t,r=[Sa({name:"add"})],n=[],i=to;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=$a(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=Ua(e.classes,t);r.length>0&&Da(e.targets,r,(e,t)=>{e.classList.contains(t)||e.classList.add(t)});break}case"attribute":!function(e,t,r){Va(e,e=>{e.setAttribute(t,r)})}(e.targets,e.name,e.value);break;case"styles":!function(e,t){Da(e,Object.entries(t),(e,[t,r])=>{e.style.setProperty(t,r)})}(e.targets,e.styles)}}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 Ta(t,"AddCommand"),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;xa(null,e={value:t},r,{kind:"class",name:t.name,metadata:o},null,n),a=t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),t.metadata=Ca({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"}),Ea(t,n),a=t})();const no=Aa(ro),io={before:"beforebegin",prepend:"afterbegin",append:"beforeend",after:"afterend",into:"replace"};function ao(e){const t=io[e];if(void 0===t)throw Error(`Unknown semantic position '${e}'. Valid positions: ${Object.keys(io).join(", ")}.`);return t}function oo(e){return e.includes("<")&&e.includes(">")}function so(e,t,r){"replace"!==r?Te(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').`);oo(t)?e.insertAdjacentHTML(n,t):e.insertAdjacentText(n,t)}(e,t,r):function(e,t){Te(t)?(e.innerHTML="",e.appendChild(t)):oo(t)?e.innerHTML=t:e.textContent=t}(e,t)}function lo(e,t,r){so(e,t,ao(r))}function co(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 uo(e,t,r){switch(r){case"beforeend":for(const r of t)co(e,r,null);break;case"afterbegin":for(let r=t.length-1;r>=0;r--)co(e,t[r],e.firstChild);break;case"beforebegin":{const r=e.parentElement;if(!r)return;for(const n of t)co(r,n,e);break}case"afterend":{const r=e.parentElement;if(!r)return;for(let n=t.length-1;n>=0;n--)co(r,t[n],e.nextSibling);break}case"replace":e.innerHTML="";for(const r of t)co(e,r,null)}}function po(e){return!!e.parentNode&&(e.remove(),!0)}const mo=Aa((()=>{let e,t,r=[Sa({name:"remove"})],n=[],i=to;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(Ee(n))return{type:"element",targets:[n]};if(Array.isArray(n)&&n.length>0&&Ee(n[0]))return{type:"element",targets:n.filter(e=>Ee(e))};if("string"==typeof n){const i=n.trim();if(this.isAttribute(i)){return{type:"attribute",name:$a(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=Ua(e.classes,t);r.length>0&&Da(e.targets,r,(e,t)=>{e.classList.remove(t)});break}case"attribute":!function(e,t){Va(e,e=>{e.removeAttribute(t)})}(e.targets,e.name);break;case"styles":!function(e,t){Da(e,t,(e,t)=>{e.style.removeProperty(t)})}(e.targets,e.properties);break;case"element":for(const t of e.targets)po(t)}}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){if(!this.validateStringArray(e.properties,1))return!1}return!0}};return Ta(t,"RemoveCommand"),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;xa(null,e={value:t},r,{kind:"class",name:t.name,metadata:o},null,n),a=t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),t.metadata=Ca({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"}),Ea(t,n),a=t})());function fo(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 ho(e,t=300){if("number"==typeof e)return Math.max(0,Math.floor(e));if("string"==typeof e){const r=fo(e);return r?r.milliseconds:t}return t}function yo(e){if("number"==typeof e){if(0>e)throw Error("Duration must be >= 0");return Math.floor(e)}if("string"==typeof e){const t=fo(e);if(!t)throw Error(`Invalid duration format: "${e}"`);return t.milliseconds}throw Error("Invalid duration type: "+typeof e)}function vo(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 go(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 ko(e){if(0===e.length)return[];return"SUMMARY"===e[0].tagName?e.map(e=>e.closest("details")).filter(e=>null!==e):e}function wo(e){return"DIALOG"===e.tagName}function bo(e){return"DETAILS"===e.tagName}function zo(e,t,r){return()=>{"class"===t?e.classList.toggle(r):"attribute"===t&&Ba(e,r)}}function xo(e,t,r,n){const i=zo(e,t,r),a=setTimeout(i,n);return()=>{clearTimeout(a)}}function Eo(e,t,r,n){const i=zo(e,t,r),a=()=>{i(),e.removeEventListener(n,a)};return e.addEventListener(n,a,{once:!0}),()=>{e.removeEventListener(n,a)}}function To(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 So(e){return null==e||""===e}const Co=/^the\s+(.+?)\s+of\s+(.+)$/i,Ao=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 Lo(e){return"string"==typeof e&&Co.test(e)}function jo(e,t){const r=e.match(Co);if(!r)return null;try{return{element:ja(r[2].trim(),t),property:r[1].trim()}}catch{return null}}async function Po(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]),Ee(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]),Ee(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]),!Ee(a))return null;const o=i?.name||i?.value;return o?{element:a,property:o}:null}return null}function Oo(e){const{element:t,property:r}=e;if(r.startsWith("*")){return function(e,t){return window.getComputedStyle(e).getPropertyValue(t)}(t,r.substring(1))}return Ge(t,r)}function No(e,t){const{element:r,property:n}=e;if(n.startsWith("*")){return void Ya(r,n.substring(1),t+"")}To(r,n,t)}async function Ro(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?ho(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 Mo(e,t){const r=t?.name,n=Qa(t);if(Ee(e)||Array.isArray(e)&&e.every(e=>Ee(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 Xa.some(e=>t.includes(e))}(t)?{type:"element",expression:t}:{type:"class",expression:t}}return{type:"class",expression:""}}let Io=(()=>{let e,t,r=[Sa({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 Ro(e.modifiers,t,r),a=async e=>{const n=e;return"selector"===n?.type?n.value:t.evaluate(e,r)},o=await a(e.args[1]),s=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 Ma(l,t,r,"toggle",c,e.modifiers);return{type:"classes-between",classA:(o+"").replace(/^\./,""),classB:(s+"").replace(/^\./,""),targets:u,duration:n,untilEvent:i}}const o=await Po(i,t,r);if(o)return{type:"property",target:o};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:o}=await Ro(e.modifiers,t,r),s=Za(n);if(s){const e=r.me;return{type:"css-property",property:s,targets:e?[e]:[],duration:a,untilEvent:o}}}}const o=Za(n);if(o){const{duration:n,untilEvent:i}=await Ro(e.modifiers,t,r),s={filterPrepositions:!0,fallbackModifierKey:"on"};return{type:"css-property",property:o,targets:await Ma(e.args.slice(a),t,r,"toggle",s,e.modifiers),duration:n,untilEvent:i}}}const{duration:s,untilEvent:l}=await Ro(e.modifiers,t,r),{value:c}=await eo(i,t,r);if(Lo(c)){const e=jo(c,r);if(e)return{type:"property",target:e}}const{type:u,expression:p}=Mo(c,i),d={filterPrepositions:!0,fallbackModifierKey:"on"};switch(u){case"attribute":{const{name:n,value:i}=$a(p);return{type:"attribute",name:n,value:i,targets:await Ma(e.args.slice(1),t,r,"toggle",d,e.modifiers),duration:s,untilEvent:l}}case"css-property":{const n=Za(p);if(!n)throw Error("Invalid CSS property: "+p);return{type:"css-property",property:n,targets:await Ma(e.args.slice(1),t,r,"toggle",d,e.modifiers)}}case"element":{let a;if(Ee(c))a=[c];else if(Array.isArray(c)&&c.every(e=>Ee(e)))a=c;else if(p){const e=document.querySelectorAll(p);a=Array.from(e).filter(e=>Ee(e))}else a=await Ma([i],t,r,"toggle",d,e.modifiers);const o=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"===o){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}}if("details"===o)return{type:"details",targets:ko(a)};if("select"===o)return{type:"select",targets:a};return{type:"classes",classes:Ha(p),targets:a,duration:s,untilEvent:l}}default:{const n=Ha(p||c);if(!n.length)throw Error("toggle command: no valid class names found");return{type:"classes",classes:n,targets:await Ma(e.args.slice(1),t,r,"toggle",d,e.modifiers),duration:s,untilEvent:l}}}}async execute(e,t){switch(e.type){case"classes":{const r=Ua(e.classes,t);if(0===r.length)return[...e.targets];if(Da(e.targets,r,(e,t)=>{e.classList.toggle(t)}),(e.duration||e.untilEvent)&&r.length)for(const t of e.targets)e.duration&&xo(t,"class",r[0],e.duration),e.untilEvent&&Eo(t,"class",r[0],e.untilEvent);return[...e.targets]}case"attribute":if(function(e,t,r){Va(e,e=>{Ba(e,t,r)})}(e.targets,e.name,e.value),e.duration||e.untilEvent)for(const t of e.targets)e.duration&&xo(t,"attribute",e.name,e.duration),e.untilEvent&&Eo(t,"attribute",e.name,e.untilEvent);return[...e.targets];case"css-property":return Va(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=Oo(e),r=e.property,n=r.startsWith("@")?r.substring(1):r;if("boolean"==typeof t||Ao.has(n)||Ao.has(n.toLowerCase())){const r=!t;return No(e,r),r}if("number"==typeof t){const r=0===t?1:0;return No(e,r),r}if("string"==typeof t){const n="__ht_"+r,i=e.element[n];return""===t&&void 0!==i?(No(e,i),i):(e.element[n]=t,No(e,""),"")}const i=!t;No(e,i)}(e.target),[e.target.element];case"dialog":return Va(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 Va(e.targets,e=>{var t;(t=e).open=!t.open});case"select":return Va(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&&xo(t,"class",e.classA,e.duration),e.untilEvent&&Eo(t,"class",e.classA,e.untilEvent);return[...e.targets]}}};return Ta(t,"ToggleCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})();const Wo=Aa(Io);let _o=(()=>{let e,t,r=[Sa({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,o=null;for(let t=0;e.args.length>t;t++){const r=e.args[t],s=n(r),l="literal"===s?r.value:r.name;if(("literal"===s||"identifier"===s)&&i.includes(l)){a=t,o=l;break}}let s=null,l=null;if(-1===a){const t=i.find(t=>e.modifiers[t]);if(t)s=e.args[0],o=t,l=e.modifiers[t];else if(e.args.length<3){if(2>e.args.length)throw Error("put requires content and position");s=e.args[0],o=e.args[1]?.value||e.args[1]?.name||"into"}else s=e.args[0],o=e.args[1]?.value||e.args[1]?.name||null,l=e.args[2]}else s=e.args.slice(0,a)[0]||null,l=e.args.slice(a+1)[0]||null;if(!s)throw Error("put requires content");if(!o)throw Error("put requires position keyword");const c=await t.evaluate(s,r),u=this.mapPosition(o);let p,d,m=null;if(l){const e=n(l),i=await Po(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)m=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&&(m=e)}else m=i}if(m&&n?.name)p=n.name;else if(!m&&!p){const e=await t.evaluate(l,r);"string"==typeof e&&(m=e)}}else if("identifier"===e&&"me"===l.name)m=null;else if("selector"===e||"cssSelector"===e)m=l.value||l.selector;else if("literal"===e){const e=l.value;if("string"==typeof e&&Lo(e)){const t=jo(e,r);if(t)return{value:c,targets:[t.element],position:"into",memberPath:t.property}}"string"==typeof e&&this.looksLikeCss(e)?m=e:d=e+""}else if("identifier"===e){const e=l.name;if(this.looksLikeCss(e))m=e;else{const n=Me(await t.evaluate(l,r));if(n)return{value:c,targets:n,position:u,memberPath:p};d=e}}else{const e=await t.evaluate(l,r),n=Me(e);if(n)return{value:c,targets:n,position:u,memberPath:p};"string"==typeof e&&(this.looksLikeCss(e)?m=e:d=e)}}if(d)return{value:c,targets:[],position:u,memberPath:p,variableName:d};return{value:c,targets:await this.resolveTargets(m,r),position:u,memberPath:p}}async execute(e,t){const{value:r,targets:n,position:i,memberPath:a,variableName:o}=e;if(o)return t.locals&&t.locals.set(o,r),t[o]=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)?uo(e,t,ao(i)):lo(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||!Ee(t.me))throw Error("put: no target and context.me is null");return[t.me]}return Re(e)}parseValue(e){return Ee(e)||Array.isArray(e)&&e.length>0&&e.every(Ee)||Te(e)?e:null==e?"":e+""}looksLikeCss(e){if(!e)return!1;if(/^[#.\[]/.test(e))return!0;if(/[>+~\s]/.test(e)&&e.length>1)return!0;return["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 Ta(t,"PutCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})();const qo=Aa(_o),$o={"&":"&","<":"<",">":">",'"':""","'":"'"};function Vo(e){return e.replace(/[&<>"']/g,e=>$o[e])}let Do=(()=>{let e,t,r=[Sa({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 fn(i[1].trim(),t);null!=r&&(e=Vo(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 o=void 0!==e.modifiers.an?"an":"a",s=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:o,expression:a,constructorArgs:s,variableName:l}}async execute(e,t){const{expression:r,constructorArgs:n=[],variableName:i}=e,a="string"==typeof r&&r.startsWith("<"),o=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),o=n.split(/(?=[.#])/);for(const e of o)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&&Ee(r))return r;const n=document.createElement("div");n.innerHTML=e.trim();const i=n.firstElementChild;return i&&Ee(i)?i:n}(r):function(e,t,r){if(Ee(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:o}),i&&Le(i,o,t),o}};return Ta(t,"MakeCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})();const Bo=Aa(Do);const Ho=Aa((()=>{let e,t,r=[Sa({name:"empty"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{targets:await Ma(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=>Ee(e))}};return Ta(t,"EmptyCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());function Ko(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 Fo(e){return e.hasAttribute("popover")}let Uo=(()=>{let e,t,r=[Sa({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=ko(await Ma(n,t,r,"open",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers)),a=await async function(e,t,r,n){if(t?.as){const e=Ko(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=Ko(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(wo(t))t.open||("modal"===e.dialogMode?t.showModal():t.show());else if(bo(t))t.open=!0;else if(Fo(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=>Ee(e))&&("modal"===t.dialogMode||"non-modal"===t.dialogMode))}};return Ta(t,"OpenCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})();const Go=Aa(Uo);function Zo(e){return e.hasAttribute("popover")}const Yo=Aa((()=>{let e,t,r=[Sa({name:"close"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{targets:ko(await Ma(e.args,t,r,"close",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers))}}async execute(e,t){for(const t of e.targets)if(wo(t))t.open&&t.close();else if(bo(t))t.open=!1;else if(Zo(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=>Ee(e))}};return Ta(t,"CloseCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());function Xo(e){const t=e.tagName;return"INPUT"===t||"TEXTAREA"===t}const Jo=Aa((()=>{let e,t,r=[Sa({name:"select"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{targets:await Ma(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(Xo(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=>Ee(e))}};return Ta(t,"SelectCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());function Qo(e){return"FORM"===e.tagName}const es=Aa((()=>{let e,t,r=[Sa({name:"reset"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{targets:await Ma(e.args,t,r,"reset",{filterPrepositions:!0,fallbackModifierKey:"on"},e.modifiers)}}async execute(e,t){for(const t of e.targets)Qo(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=>Ee(e))}};return Ta(t,"ResetCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());void 0===globalThis.Element&&(globalThis.Element=class{});var ts="moveBefore"in Element.prototype,rs=[0,1,0,0,0,0,0,0,0,1,0,1,0],ns=0,is=1,as=2,os=new Set,ss=new Set,ls=new Set,cs=new Set,us=new Set,ps=new Set;function ds(e){for(const t of e.querySelectorAll("input"))(t.name&&t.value!==t.defaultValue||t.checked!==t.defaultChecked)&&t.setAttribute("morphlex-dirty","");for(const t of e.querySelectorAll("option"))t.value&&t.selected!==t.defaultSelected&&t.setAttribute("morphlex-dirty","");for(const t of e.querySelectorAll("textarea"))t.value!==t.defaultValue&&t.setAttribute("morphlex-dirty","")}function ms(e){const t=document.createElement("template");return t.innerHTML=e.trim(),t.content}function fs(e,t,r){if(t!==r){if(t.parentNode===e){if(t.nextSibling===r)return;if(ts)return void e.moveBefore(t,r)}e.insertBefore(t,r)}}class hs{#e=new WeakMap;#t=new WeakMap;#r;constructor(e={}){this.#r=e}morph(e,t){gs(e)&&this.#n(e),t instanceof NodeList?(this.#i(t),this.#a(e,t)):gs(t)&&(this.#o(t),this.#s(e,t))}#a(e,t){const r=t.length;if(0===r)this.#l(e);else if(1===r)this.#s(e,t[0]);else if(r>1){const r=[...t];this.#s(e,r.shift());const n=e.nextSibling,i=e.parentNode||document;for(let e=0;r.length>e;e++){const t=r[e];(this.#r.beforeNodeAdded?.(i,t,n)??1)&&(i.insertBefore(t,n),this.#r.afterNodeAdded?.(t))}}}#s(e,t){e!==t&&(e.isEqualNode(t)||(1===e.nodeType&&1===t.nodeType?e.localName===t.localName?this.#c(e,t):this.#u(e,t):this.#p(e,t)))}#c(e,t){(this.#r.beforeNodeVisited?.(e,t)??1)&&((e.hasAttributes()||t.hasAttributes())&&this.#d(e,t),"textarea"===e.localName&&"textarea"===t.localName?this.#m(e,t):(e.hasChildNodes()||t.hasChildNodes())&&this.visitChildNodes(e,t),this.#r.afterNodeVisited?.(e,t))}#u(e,t){(this.#r.beforeNodeVisited?.(e,t)??1)&&(this.#f(e,t),this.#r.afterNodeVisited?.(e,t))}#p(e,t){(this.#r.beforeNodeVisited?.(e,t)??1)&&(e.nodeType===t.nodeType&&null!==e.nodeValue&&null!==t.nodeValue?e.nodeValue=t.nodeValue:this.#f(e,t),this.#r.afterNodeVisited?.(e,t))}#d(e,t){e.hasAttribute("morphlex-dirty")&&e.removeAttribute("morphlex-dirty");for(const{name:r,value:n}of t.attributes){"value"===r&&ys(e)&&e.value!==n&&(this.#r.preserveChanges&&e.value!==e.defaultValue||(e.value=n)),"selected"===r&&vs(e)&&!e.selected&&(this.#r.preserveChanges&&e.selected!==e.defaultSelected||(e.selected=!0)),"checked"===r&&ys(e)&&!e.checked&&(this.#r.preserveChanges&&e.checked!==e.defaultChecked||(e.checked=!0));const t=e.getAttribute(r);t!==n&&(this.#r.beforeAttributeUpdated?.(e,r,n)??1)&&(e.setAttribute(r,n),this.#r.afterAttributeUpdated?.(e,r,t))}for(const{name:r,value:n}of e.attributes)t.hasAttribute(r)||("selected"===r&&vs(e)&&e.selected&&(this.#r.preserveChanges&&e.selected!==e.defaultSelected||(e.selected=!1)),"checked"===r&&ys(e)&&e.checked&&(this.#r.preserveChanges&&e.checked!==e.defaultChecked||(e.checked=!1)),(this.#r.beforeAttributeUpdated?.(e,r,null)??1)&&(e.removeAttribute(r),this.#r.afterAttributeUpdated?.(e,r,n)))}#m(e,t){const r=t.textContent||"",n=e.value!==e.defaultValue;e.textContent!==r&&(e.textContent=r),this.#r.preserveChanges&&n||(e.value=e.defaultValue)}visitChildNodes(e,t){if(!(this.#r.beforeChildrenVisited?.(e)??1))return;const r=e,n=[...e.childNodes],i=[...t.childNodes];os.clear(),ss.clear(),ls.clear(),cs.clear(),us.clear(),ps.clear();const a=[],o=[],s=[],l=[],c=[],u=[];for(let e=0;n.length>e;e++){const t=n[e],r=t.nodeType;l[e]=r,1===r?(u[e]=t.localName,""!==t.id?ls.add(e):ss.add(e)):3===r&&""===t.textContent?.trim()?ps.add(e):os.add(e)}for(let e=0;i.length>e;e++){const t=i[e],r=t.nodeType;if(s[e]=r,1===r)c[e]=t.localName,us.add(e);else{if(3===r&&""===t.textContent?.trim())continue;cs.add(e)}}for(const e of us){const t=c[e],r=i[e];for(const i of ss){if(t!==u[i])continue;if(n[i].isEqualNode(r)){a[e]=i,o[e]=ns,ss.delete(i),us.delete(e);break}}}for(const e of us){const t=i[e],r=t.id,s=this.#e.get(t);if(""!==r||s)e:for(const t of ls){const i=n[t];if(c[e]===u[t]){if(""!==r&&r===i.id){a[e]=t,o[e]=is,ls.delete(t),us.delete(e);break e}if(s){const r=this.#t.get(i);if(r)for(let n=0;s.length>n;n++){if(r.has(s[n])){a[e]=t,o[e]=is,ls.delete(t),us.delete(e);break e}}}}}}for(const e of us){const t=i[e],r=t.getAttribute("name"),s=t.getAttribute("href"),l=t.getAttribute("src");for(const t of ss){const i=n[t];if(c[e]===u[t]&&(r&&r===i.getAttribute("name")||s&&s===i.getAttribute("href")||l&&l===i.getAttribute("src"))){a[e]=t,o[e]=is,ss.delete(t),us.delete(e);break}}}for(const e of us){const t=i[e],r=c[e];for(const i of ss){if(r===u[i]){if("input"===r&&n[i].type!==t.type)continue;a[e]=i,o[e]=is,ss.delete(i),us.delete(e);break}}}for(const e of cs){const t=i[e];for(const r of os){if(n[r].isEqualNode(t)){a[e]=r,o[e]=ns,os.delete(r),cs.delete(e);break}}}for(const e of cs){const t=s[e];for(const r of os)if(t===l[r]){a[e]=r,o[e]=as,os.delete(r),cs.delete(e);break}}for(const e of os)this.#l(n[e]);for(const e of ps)this.#l(n[e]);for(const e of ss)this.#l(n[e]);for(const e of ls)this.#l(n[e]);const p=function(e){const t=e.length;if(0===t)return[];const r=[],n=[],i=Array(t);for(let a=0;t>a;a++){const t=e[a];if(void 0===t)continue;let o=0,s=r.length;for(;s>o;){const e=Math.floor((o+s)/2);t>r[e]?o=e+1:s=e}i[a]=o>0?n[o-1]:-1,o===r.length?(r.push(t),n.push(a)):(r[o]=t,n[o]=a)}const a=[];if(0===n.length)return a;let o=n[n.length-1];for(;void 0!==o&&-1!==o;)a.unshift(o),o=i[o];return a}(a),d=Array(n.length);for(let e=0;p.length>e;e++)d[a[p[e]]]=!0;let m=r.firstChild;for(let e=0;i.length>e;e++){const t=i[e],s=a[e];if(void 0!==s){const i=n[s],a=o[e];d[s]||fs(r,i,m),a===ns||(a===is?this.#c(i,t):this.#s(i,t)),m=i.nextSibling}else(this.#r.beforeNodeAdded?.(r,t,m)??1)&&(r.insertBefore(t,m),this.#r.afterNodeAdded?.(t),m=t.nextSibling)}this.#r.afterChildrenVisited?.(e)}#f(e,t){const r=e.parentNode||document,n=e;(this.#r.beforeNodeRemoved?.(e)??1)&&(this.#r.beforeNodeAdded?.(r,t,n)??1)&&(r.insertBefore(t,n),this.#r.afterNodeAdded?.(t),e.remove(),this.#r.afterNodeRemoved?.(e))}#l(e){(this.#r.beforeNodeRemoved?.(e)??1)&&(e.remove(),this.#r.afterNodeRemoved?.(e))}#i(e){for(const t of e)gs(t)&&this.#o(t)}#o(e){const t=this.#e;for(const r of e.querySelectorAll("[id]")){const n=r.id;if(""===n)continue;let i=r;for(;i;){const r=t.get(i);if(r?r.push(n):t.set(i,[n]),i===e)break;i=i.parentElement}}}#n(e){const t=this.#t;for(const r of e.querySelectorAll("[id]")){const n=r.id;if(""===n)continue;let i=r;for(;i;){const r=t.get(i);if(r?r.add(n):t.set(i,new Set([n])),i===e)break;i=i.parentElement}}}}function ys(e){return"input"===e.localName}function vs(e){return"option"===e.localName}function gs(e){return!!rs[e.nodeType]}function ks(e){return{preserveChanges:e?.preserveChanges??!0}}const ws={morph(e,t,r){!function(e,t,r={}){"string"==typeof t&&(t=ms(t).childNodes),!r.preserveChanges&&gs(e)&&ds(e),new hs(r).morph(e,t)}(e,t,ks(r))},morphInner(e,t,r){let n;if("string"==typeof t){const r=document.createElement(e.tagName);r.innerHTML=t,n=r}else n=t;!function(e,t,r={}){if("string"==typeof t){const e=ms(t);if(!e.firstChild||1!==e.childNodes.length||1!==e.firstChild.nodeType)throw Error("[Morphlex] The string was not a valid HTML element.");t=e.firstChild}if(1!==e.nodeType||1!==t.nodeType||e.localName!==t.localName)throw Error("[Morphlex] You can only do an inner morph with matching elements.");gs(e)&&ds(e),new hs(r).visitChildNodes(e,t)}(e,n,ks(r))}};function bs(){if("undefined"==typeof document)return;const e=document.startViewTransition;return"function"==typeof e?e.bind(document):void 0}function zs(){return"function"==typeof bs()}const xs=[];let Es=!1;async function Ts(e,t){const r=bs();if(!r)return void await e();const n=async()=>{await e()};let i;if(t?.transitionName)try{i=r({update:n,types:[t.transitionName]})}catch{i=r(n)}else i=r(n);await i.finished}function Ss(e,t){return new Promise((r,n)=>{xs.push({callback:e,options:t,resolve:r,reject:n}),async function(){if(!Es){Es=!0;try{for(;xs.length>0;){const e=xs.shift();try{await Ts(e.callback,e.options),e.resolve()}catch(t){e.reject(t)}}}finally{Es=!1}}}().catch(n)})}const Cs={into:"innerHTML",over:"outerHTML",innerhtml:"innerHTML",outerhtml:"outerHTML",beforebegin:"beforeBegin",afterbegin:"afterBegin",beforeend:"beforeEnd",afterend:"afterEnd",delete:"delete",none:"none",morph:"morph",innermorph:"morph",outermorph:"morphOuter"};function As(e,t,r,n){const i=null===t||Ee(t)?"":t,a=Ee(t)?t:null;switch(r){case"morph":if(null!==t)try{ws.morphInner(e,a||i,n)}catch(t){console.warn("[HyperFixi] Morph failed, falling back to innerHTML:",t),a?(e.innerHTML="",e.appendChild(a)):e.innerHTML=i}break;case"morphOuter":if(null!==t)try{ws.morph(e,a||i,n)}catch(t){console.warn("[HyperFixi] Morph failed, falling back to outerHTML:",t),a?e.replaceWith(a):e.outerHTML=i}break;case"innerHTML":a?(e.innerHTML="",e.appendChild(a)):e.innerHTML=i;break;case"outerHTML":a?e.replaceWith(a):e.outerHTML=i;break;case"beforeBegin":a?e.parentElement?.insertBefore(a,e):e.insertAdjacentHTML("beforebegin",i);break;case"afterBegin":a?e.insertBefore(a,e.firstChild):e.insertAdjacentHTML("afterbegin",i);break;case"beforeEnd":a?e.appendChild(a):e.insertAdjacentHTML("beforeend",i);break;case"afterEnd":a?e.parentElement?.insertBefore(a,e.nextSibling):e.insertAdjacentHTML("afterend",i);break;case"delete":e.remove();break;case"none":break;default:throw Error(`[HyperFixi] swap: unknown strategy "${r}"`)}}async function Ls(e,t,r,n={}){const{morphOptions:i,useViewTransition:a=!1}=n,o=()=>{for(const n of e)As(n,t,r,i)};a&&zs()?await Ss(o):o()}function js(e){if(null==e)return null;if(Ee(e))return e;if(function(e){return null!==e&&"object"==typeof e&&"nodeType"in e&&11===e.nodeType&&"childNodes"in e}(e)){const t=e,r=document.createElement("div");return r.appendChild(t.cloneNode(!0)),r.innerHTML}return e+""}async function Ps(e,t){const r=Pa(e||void 0,t);if(0===r.length){throw Error("[HyperFixi] swap: no elements found"+(e?` matching "${e}"`:""))}return r}let Os=(()=>{let e,t,r=[Sa({name:"swap"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n=e.args;if(!n||0===n.length)throw Error("[HyperFixi] swap: command requires arguments");const i=n.map(e=>{if(!e||"object"!=typeof e)return null;const t=e,r=t.type;return"literal"===r&&"string"==typeof t.value?t.value.toLowerCase():"identifier"===r&&"string"==typeof t.name?t.name.toLowerCase():null}),a=i.findIndex(e=>"with"===e),o=i.findIndex(e=>"of"===e),s=i.findIndex(e=>"delete"===e),l=i.findIndex(e=>"using"===e);if(3===n.length&&1===a&&-1===o&&-1===s&&-1===l){const e=n[0],t=n[2],r="identifier"===e?.type&&"string"==typeof e.name,i="identifier"===t?.type&&"string"==typeof t.name,a=new Set(["me","you","it","result","window","document"]);if(r&&i&&!a.has(e.name.toLowerCase())&&!a.has(t.name.toLowerCase())&&!Cs[e.name.toLowerCase()])return{variant:"variable",leftName:e.name,rightName:t.name}}let c=void 0!==e.modifiers?.viewTransition;if(-1!==l){const e=i.slice(l+1);e.includes("view")&&e.includes("transition")&&(c=!0)}let u="morph",p=null,d=null;if(-1!==s)u="delete",p=n[s+1],d=null;else if(-1!==o&&-1!==a){const e=i[0];e&&Cs[e]&&(u=Cs[e]),p=n[o+1],d=n[a+1]}else if(-1!==a){const e=i.slice(0,a),t=e.findIndex(e=>"into"===e),r=e.findIndex(e=>"over"===e);if(-1!==t)u="innerHTML",p=n[t+1];else if(-1!==r)u="outerHTML",p=n[r+1];else{const e=i[0];e&&Cs[e]?(u=Cs[e],p=n[1]||n[a-1]):p=n[a-1]}d=n[a+1]}else{if(2>n.length)throw Error('[HyperFixi] swap: could not parse arguments. Expected "swap <target> with <content>"');{const e=i[0];e&&Cs[e]&&(u=Cs[e]),p=n[n.length-2],d=n[n.length-1]}}let m=null,f=null;if(p){const e=p.type,n=p.value;if("selector"===e&&"string"==typeof n)m=n;else if("binaryExpression"===e&&"of"===p.operator){const e=p.left,n=p.right;if(e&&"identifier"===e.type&&"string"==typeof e.name){const t=e.name.toLowerCase();Cs[t]&&(u=Cs[t])}n&&"selector"===n.type&&"string"==typeof n.value?m=n.value:n&&(m=await t.evaluate(n,r))}else m=await t.evaluate(p,r)}d&&(f=await t.evaluate(d,r));let h=null;if("string"==typeof m)h=m;else if(Ee(m))return{targets:[m],content:js(f),strategy:u,morphOptions:{preserveChanges:!0},useViewTransition:c};return{targets:await Ps(h,r),content:js(f),strategy:u,morphOptions:{preserveChanges:!0},useViewTransition:c}}async execute(e,t){if("variable"===e.variant){const{leftName:r,rightName:n}=e,i=e=>t.locals?.has(e)?t.locals.get(e):t.globals?.has(e)?t.globals.get(e):void 0,a=(e,r)=>{t.locals?.has(e)?t.locals.set(e,r):t.globals?.has(e)?t.globals.set(e,r):t.locals&&t.locals.set(e,r)},o=i(r);return a(r,i(n)),void a(n,o)}const{targets:r,content:n,strategy:i,morphOptions:a,useViewTransition:o}=e;if(!r||!i)throw Error("[HyperFixi] swap: DOM swap requires targets and strategy");await Ls(r,n??null,i,{morphOptions:a,useViewTransition:o})}};return Ta(t,"SwapCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({description:"Swap content into target elements with intelligent morphing support",syntax:["swap <target> with <content>","swap [strategy] of <target> with <content>","swap into <target> with <content>","swap over <target> with <content>","swap delete <target>","swap <target> with <content> using view transition"],examples:["swap #target with it","swap innerHTML of #target with it","swap over #modal with fetchedContent","swap delete #notification"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),Ea(t,n),i=t})(),Ns=(()=>{let e,t,r=[Sa({name:"morph"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n=e.args;if(!n||0===n.length)throw Error("[HyperFixi] morph: command requires arguments");const i=n.map(e=>"identifier"===e.type&&"string"==typeof e.name?e.name.toLowerCase():null),a=i.findIndex(e=>"with"===e),o=i.findIndex(e=>"over"===e),s=i.findIndex(e=>"using"===e);let l=void 0!==e.modifiers?.viewTransition;if(-1!==s){const e=i.slice(s+1);e.includes("view")&&e.includes("transition")&&(l=!0)}let c="morph",u=null,p=null;if(-1!==o&&(-1===a?1/0:a)>o?(c="morphOuter",u=n[o+1],-1!==a&&(p=n[a+1])):-1!==a?(u=n[a-1],p=n[a+1]):2>n.length||(u=n[0],p=n[1]),!u)throw Error("[HyperFixi] morph: could not determine target");let d=null;d="selector"===u.type&&"string"==typeof u.value?u.value:await t.evaluate(u,r);let m,f=null;if(p&&(f=await t.evaluate(p,r)),!d)throw Error("[HyperFixi] morph: could not determine target");if("string"==typeof d)m=await Ps(d,r);else{if(!Ee(d))throw Error("[HyperFixi] morph: target must be a selector or element");m=[d]}return{targets:m,content:js(f),strategy:c,morphOptions:{preserveChanges:!0},useViewTransition:l}}async execute(e,t){const{targets:r,content:n,strategy:i,morphOptions:a,useViewTransition:o}=e;if(!r||!i)throw Error("[HyperFixi] morph: requires targets and strategy");await Ls(r,n??null,i,{morphOptions:a,useViewTransition:o})}};return Ta(t,"MorphCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({description:"Morph content into target elements (intelligent diffing, preserves state)",syntax:["morph <target> with <content>","morph over <target> with <content>","morph <target> with <content> using view transition"],examples:["morph #target with it","morph over #modal with fetchedContent"],sideEffects:["dom-mutation"],category:"dom",compatibility:"standard"}),Ea(t,n),i=t})();const Rs=Aa(Os),Ms=Aa(Ns);Rs(),Ms();const Is={html:{category:"document-root",message:"The <html> element is the document root and cannot be part of a partial",suggestion:"Remove the <html> element. Return only the content that should replace the target."},body:{category:"document-root",message:"The <body> element is the document body and cannot be part of a partial",suggestion:"Remove the <body> element. Return only the content for the target."},head:{category:"document-root",message:"The <head> element contains document metadata and cannot be part of a partial",suggestion:"Remove the <head> element. Styles/scripts should be loaded separately."}},Ws={header:{category:"semantic-landmark",message:"The <header> element is a semantic landmark. Swapping may create duplicate landmarks.",suggestion:"Consider if <header> is appropriate in this partial, or if the page already has this landmark."},footer:{category:"semantic-landmark",message:"The <footer> element is a semantic landmark. Swapping may create duplicate landmarks.",suggestion:"Consider if <footer> is appropriate in this partial, or if the page already has this landmark."},main:{category:"semantic-landmark",message:"The <main> element should be unique per page. Swapping may create duplicates.",suggestion:"Consider if <main> is appropriate. Pages should have exactly one <main> element."},nav:{category:"semantic-landmark",message:"The <nav> element is a semantic landmark. Consider if navigation should be in a partial.",suggestion:"Consider if <nav> is appropriate in this partial, or if navigation should be static."},aside:{category:"semantic-landmark",message:"The <aside> element is a semantic landmark. Swapping may affect accessibility.",suggestion:"Consider if <aside> is appropriate in this partial."}},_s={title:{category:"metadata",message:"The <title> element should only appear in <head>. This may be ignored by browsers.",suggestion:"Move <title> to the document <head> or remove from partial."},meta:{category:"metadata",message:"The <meta> element should only appear in <head>. This may be ignored by browsers.",suggestion:"Move <meta> to the document <head> or remove from partial."},link:{category:"metadata",message:"The <link> element for stylesheets should typically be in <head>.",suggestion:"Consider if <link> should be in document <head> for proper loading order."},base:{category:"metadata",message:"The <base> element should only appear once in <head>.",suggestion:"Remove <base> from partial. It must be in document <head>."}};let qs={...{enabled:!("undefined"!=typeof window&&window.__HYPERFIXI_PROD__||"undefined"!=typeof process&&"production"===process.env?.NODE_ENV),showWarnings:!0,strictness:"standard",additionalCriticalElements:[],additionalStructuralElements:[],ignoredElements:[],ignoredTargets:[],targetOverrides:[]}};function $s(e,t){if("*"===t)return!0;if(t.includes("*")){const r=t.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return RegExp("^"+r+"$").test(e)}return e===t}function Vs(e,t=""){const r=function(e){const t={...qs};if(qs.targetOverrides)for(const r of qs.targetOverrides)if($s(e,r.target))return{...t,...r.config};return t}(t);if(!r.enabled)return{valid:!0,issues:[],bySeverity:{critical:[],structural:[],warning:[]},totalIssues:0,shouldProceed:!0};if(r.ignoredTargets?.some(e=>$s(t,e)))return{valid:!0,issues:[],bySeverity:{critical:[],structural:[],warning:[]},totalIssues:0,shouldProceed:!0};const n=[];if(e.match(/<!DOCTYPE[^>]*>/i)&&!r.ignoredElements?.includes("doctype")&&n.push({severity:"critical",category:"document-root",element:"DOCTYPE",message:"DOCTYPE declarations cannot be part of a partial",suggestion:"Remove DOCTYPE declaration. Partials should only contain content fragments.",targetSelector:t,count:1}),"undefined"==typeof document)return function(e,t,r){const n=[];for(const[i,a]of Object.entries(Is)){if(r.ignoredElements?.includes(i))continue;const o=RegExp(`<${i}[\\s>]`,"gi"),s=e.match(o),l=s?.length||0;l>0&&n.push({severity:"critical",category:a.category,element:i,message:a.message,suggestion:a.suggestion||`Remove the <${i}> element from the partial.`,targetSelector:t,count:l})}if("relaxed"!==r.strictness)for(const[i,a]of Object.entries(Ws)){if(r.ignoredElements?.includes(i))continue;const o=RegExp(`<${i}[\\s>]`,"gi"),s=e.match(o),l=s?.length||0;l>0&&n.push({severity:"strict"===r.strictness?"critical":"structural",category:a.category,element:i,message:a.message,suggestion:a.suggestion||`Consider if <${i}> is appropriate in this partial.`,targetSelector:t,count:l})}return Ds(n)}(e,t,r);for(const[i,a]of Object.entries(Is)){if(r.ignoredElements?.includes(i))continue;const o=RegExp(`<${i}[\\s>]`,"gi"),s=e.match(o),l=s?.length||0;l>0&&n.push({severity:"critical",category:a.category,element:i,message:a.message,suggestion:a.suggestion||`Remove the <${i}> element from the partial.`,targetSelector:t,count:l})}const i=document.createElement("div");if(i.innerHTML=e,"relaxed"!==r.strictness)for(const[e,a]of Object.entries(Ws)){if(r.ignoredElements?.includes(e))continue;const o=i.querySelectorAll(e).length;o>0&&n.push({severity:"strict"===r.strictness?"critical":"structural",category:a.category,element:e,message:a.message,suggestion:a.suggestion||`Consider if <${e}> is appropriate in this partial.`,targetSelector:t,count:o})}if("strict"===r.strictness)for(const[e,a]of Object.entries(_s)){if(r.ignoredElements?.includes(e))continue;const o=i.querySelectorAll(e).length;o>0&&n.push({severity:"warning",category:a.category,element:e,message:a.message,suggestion:a.suggestion||`Move <${e}> to document <head> or remove from partial.`,targetSelector:t,count:o})}if(r.additionalCriticalElements)for(const e of r.additionalCriticalElements){if(r.ignoredElements?.includes(e))continue;const a=i.querySelectorAll(e).length;a>0&&n.push({severity:"critical",category:"document-root",element:e,message:`The <${e}> element is configured as a critical layout element.`,suggestion:`Remove <${e}> from the partial content.`,targetSelector:t,count:a})}if(r.additionalStructuralElements)for(const e of r.additionalStructuralElements){if(r.ignoredElements?.includes(e))continue;const a=i.querySelectorAll(e).length;a>0&&n.push({severity:"structural",category:"semantic-landmark",element:e,message:`The <${e}> element is configured as a structural element.`,suggestion:`Consider if <${e}> is appropriate in this partial.`,targetSelector:t,count:a})}if(r.customValidator){const i=r.customValidator(e,t);n.push(...i)}return Ds(n)}function Ds(e){const t={critical:e.filter(e=>"critical"===e.severity),structural:e.filter(e=>"structural"===e.severity),warning:e.filter(e=>"warning"===e.severity)};return{valid:0===t.critical.length,issues:e,bySeverity:t,totalIssues:e.length,shouldProceed:!0}}const Bs="font-weight: bold; font-size: 13px; color: #6366f1;",Hs="color: #dc2626; font-weight: bold;",Ks="color: #ea580c; font-weight: bold;",Fs="color: #ca8a04; font-weight: bold;",Us="color: inherit;",Gs={critical:"\ud83d\udea8",structural:"\u26a0\ufe0f",warning:"\ud83d\udca1"},Zs={critical:"CRITICAL",structural:"STRUCTURAL",warning:"WARNING"};function Ys(e){0!==e.totalIssues&&("undefined"!=typeof window&&void 0!==console?function(e){if(console.groupCollapsed(`%c[HyperFixi] Partial Template Validation: ${e.totalIssues} issue(s) found`,Bs),function(e){const t=[],r=[];e.bySeverity.critical.length>0&&(t.push(`%c${e.bySeverity.critical.length} critical%c`),r.push(Hs,Us));e.bySeverity.structural.length>0&&(t.length>0&&t.push(", "),t.push(`%c${e.bySeverity.structural.length} structural%c`),r.push(Ks,Us));e.bySeverity.warning.length>0&&(t.length>0&&t.push(", "),t.push(`%c${e.bySeverity.warning.length} warning(s)%c`),r.push(Fs,Us))}(e),e.bySeverity.critical.length>0){console.group(`%c${Gs.critical} Critical Issues (${e.bySeverity.critical.length})`,Hs);for(const t of e.bySeverity.critical)Xs(t);console.groupEnd()}if(e.bySeverity.structural.length>0){console.group(`%c${Gs.structural} Structural Issues (${e.bySeverity.structural.length})`,Ks);for(const t of e.bySeverity.structural)Xs(t);console.groupEnd()}if(e.bySeverity.warning.length>0){console.group(`%c${Gs.warning} Warnings (${e.bySeverity.warning.length})`,Fs);for(const t of e.bySeverity.warning)Xs(t);console.groupEnd()}console.groupEnd()}(e):function(e){console.warn(`[HyperFixi] Partial Template Validation: ${e.totalIssues} issue(s) found`);const t=[];e.bySeverity.critical.length>0&&t.push(e.bySeverity.critical.length+" critical");e.bySeverity.structural.length>0&&t.push(e.bySeverity.structural.length+" structural");e.bySeverity.warning.length>0&&t.push(e.bySeverity.warning.length+" warning(s)");console.warn(" Found: "+t.join(", "));for(const t of e.issues){console.warn(` ${Gs[t.severity]} [${Zs[t.severity]}] <${t.element}>${t.count>1?` (${t.count}x)`:""}${t.targetSelector?` [target: ${t.targetSelector}]`:""}`),console.warn(" "+t.message),console.warn(" Fix: "+t.suggestion)}}(e))}function Xs(e){}function Js(e){return`${Gs[e.severity]} [${Zs[e.severity]}] <${e.element}>${e.count>1?` (${e.count}x)`:""}${e.targetSelector?` [target: ${e.targetSelector}]`:""}: ${e.message}`}function Qs(e){return e.issues.map(Js)}function el(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})}function tl(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)}function rl(e,t,r={},n={}){const i=el(t,r,n);return e.dispatchEvent(i),i}function nl(e,t,r={},n={}){return{lokascript:rl(e,"lokascript:"+t,r,n),hyperfixi:rl(e,"hyperfixi:"+t,r,n)}}const il={morph:"morph",morphouter:"morphOuter",innerhtml:"innerHTML",outerhtml:"outerHTML",beforebegin:"beforeBegin",afterbegin:"afterBegin",beforeend:"beforeEnd",afterend:"afterEnd",delete:"delete",none:"none"};function al(e,t){const{target:r,strategy:n,content:i}=e,a=document.querySelector(r);if(!a||!Ee(a))return{success:!1,error:`Target "${r}" not found`};try{switch(n){case"morph":ws.morphInner(a,i,t);break;case"morphOuter":ws.morph(a,i,t);break;case"innerHTML":a.innerHTML=i;break;case"outerHTML":a.outerHTML=i;break;case"beforeBegin":a.insertAdjacentHTML("beforebegin",i);break;case"afterBegin":a.insertAdjacentHTML("afterbegin",i);break;case"beforeEnd":a.insertAdjacentHTML("beforeend",i);break;case"afterEnd":a.insertAdjacentHTML("afterend",i);break;case"delete":a.remove();break;case"none":break;default:return{success:!1,error:`Unknown strategy "${n}"`}}return{success:!0}}catch(e){return{success:!1,error:e+""}}}function ol(e,t){const r=function(e){const t=[],r=document.createElement("div");r.innerHTML=e;const n=r.querySelectorAll("hx-partial");for(const e of n){const r=e.getAttribute("target");if(!r)continue;const n=e.getAttribute("strategy")?.toLowerCase()||"morph";t.push({target:r,strategy:il[n]||"morph",content:e.innerHTML})}return t}(e),n={...qs},i={count:0,targets:[],errors:[],validationWarnings:[],validationDetails:{}};for(const e of r){if(n.enabled){const t=Vs(e.content,e.target);t.totalIssues>0&&(n.showWarnings&&Ys(t),i.validationWarnings.push(...Qs(t)),i.validationDetails[e.target]=t)}const r=al(e,t);r.success?(i.count++,i.targets.push(e.target)):r.error&&i.errors.push(`${e.target}: ${r.error}`)}return i}const sl=Aa((()=>{let e,t,r=[Sa({name:"process"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n=e.args;if(!n||0===n.length)throw Error("process partials command requires content argument");const i=n.map(e=>{const t=e;return t&&"object"==typeof t?"identifier"===t.type&&"string"==typeof t.name?t.name.toLowerCase():"literal"===t.type&&"string"==typeof t.value?t.value.toLowerCase():null:null}),a=i.indexOf("partials"),o=i.indexOf("in");let s;if(-1===a){if(-1!==o)throw Error('process command expects "partials" keyword: process partials in <content>');s=n[0]}else{if(-1===o||a>=o)throw Error('process partials command expects "in" keyword: process partials in <content>');s=n[o+1]}const l=s?await t.evaluate(s,r):void 0;let c;if("string"==typeof l)c=l;else if(Ee(l))c=l.outerHTML;else{if(!l||"function"!=typeof l.text)throw Error("process partials: content must be an HTML string or element");c=await l.text()}let u=void 0!==e.modifiers?.viewTransition;const p=i.indexOf("using");if(-1!==p){const e=i.slice(p+1);e.includes("view")&&e.includes("transition")&&(u=!0)}return{html:c,useViewTransition:u,morphOptions:{preserveChanges:!0}}}async execute(e,t){const{html:r,useViewTransition:n,morphOptions:i}=e,a=()=>ol(r,i);let o;return n&&zs()?await Ss(()=>{o=a()}):o=a(),t.it=o,nl(window,"partials",o),o}};return Ta(t,"ProcessPartialsCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({description:"Process <hx-partial> elements for multi-target swaps",syntax:["process partials in <content>","process partials in <content> using view transition"],examples:["process partials in it","process partials in fetchedHtml","process partials in it using view transition"],sideEffects:["dom-mutation"],category:"dom",compatibility:"lokascript-extension"}),Ea(t,n),i=t})());function ll(e,t,r,n){return e?new Promise(r=>{const i=()=>{a({event:null,timedOut:!1,cancelled:!0})},a=ul(()=>{e.removeEventListener(t,o),n&&n.removeEventListener("abort",i)},r),o=e=>{a({event:e,timedOut:!1,cancelled:!1})};n?.aborted?r({event:null,timedOut:!1,cancelled:!0}):(e.addEventListener(t,o),n&&n.addEventListener("abort",i))}):Promise.reject(Error("waitForEvent: no target provided"))}function cl(e){return new Promise(t=>setTimeout(t,e))}function ul(e,t){let r=!1;return n=>{r||(r=!0,e(),t(n))}}sl();let pl=(()=>{let e,t,r=[Sa({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 cl(e.milliseconds),{type:"time",result:e.milliseconds,duration:Date.now()-r};if("event"===e.type){const n=e.target??t.me??document,i=(await ll(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:yo(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+)\(([^)]+)\)$/),o=a?a[1]:i,s=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:o,target:l,destructure:s}}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 o,s="",l=[];for(const t of e.properties){const e=t.key?.name||t.key?.value;"name"===e&&t.value?s=t.value.value||"":"args"===e&&t.value?.elements?l=t.value.elements.map(e=>e.value||e.name||""):"duration"===e&&t.value&&(o=t.value)}if(o){const e=await r.evaluate(o,n);a.push({type:"time",milliseconds:yo(e)})}else s&&a.push({type:"event",eventName:s,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:yo(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=>{if("time"===e.type)return cl(e.milliseconds).then(()=>({result:e.milliseconds,winningCondition:e}));return ll(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 Ta(t,"WaitCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})();const dl=Aa(pl),ml=new Map;let fl=[/^4\d{2}$/,/^5\d{2}$/];let hl=(()=>{let e,t,r=[Sa({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,o=new AbortController;let s;t.me&&(s=()=>o.abort(),t.me.addEventListener("fetch:abort",s,{once:!0}));const l={...a,signal:o.signal},c=ml.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(()=>o.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 fl.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 o=await this.handleResponse(a,i,t);t.me&&this.dispatchEvent(t.me,"fetch:afterRequest",{result:o});const s={status:a.status,statusText:a.statusText,headers:a.headers,data:o,url:a.url,duration:Date.now()-r};return Object.assign(t,{it:o}),s}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&&s&&t.me.removeEventListener("fetch:abort",s)}}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(ml.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=ml.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&&Ee(r.firstChild)?r.firstChild:r}dispatchEvent(e,t,r){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}))}};return Ta(t,"FetchCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})();const yl=Aa(hl);async function vl(e,t,r){const n=await t.evaluate(e,r),i=Array.isArray(n)?n[0]:n;return Ee(i)?i:null}async function gl(e,t,r,n){if(!e)return null;const i=e,a=i.type;if(n.nodeWriters&&a){const t=pe(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 o=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 vl(i.right,t,r);if(e)return{elements:[e],name:i.left.attributeName}}if("memberExpression"===i?.type&&"attributeAccess"===i.property?.type){const e=await vl(i.object,t,r);if(e)return{elements:[e],name:i.property.attributeName}}return null}(e,t,r,n.scopeElements);if(o)return{kind:"attribute",elements:o.elements,name:o.name};const s=await Po(e,t,r);if(s)return n.styleSplit&&s.property.startsWith("*")?{kind:"style",element:s.element,property:s.property.substring(1)}:{kind:"property",target:s};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 kl=Aa((()=>{let e,t,r=[Sa({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,o=await gl(n,t,r,{scopeElements:()=>this.resolveTargets(e.modifiers.on,t,r),nodeWriters:!0,styleSplit:!0});if(o)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}'`)}}(o,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 s;if(s="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(Ee(e)||e instanceof Node)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(s)){return{type:"object-literal",properties:s,targets:await this.resolveTargets(e.modifiers.on,t,r)}}if(Lo(s)){const n=jo(s,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(s,e,t,r)}if("string"==typeof s&&Ga(s)){const n=s.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 s&&qa(s)){const n=s.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 s){const n=s.match(/^(my|me|its?|your?)\s+(.+)$/i);if(n){const i=Na(n[1],r),a=await this.extractValue(e,t,r);return{type:"property",element:i,property:n[2],value:a}}}if(Ee(s)){return{type:"property",element:s,property:"textContent",value:await this.extractValue(e,t,r)}}if(Array.isArray(s)&&s.length>0&&Ee(s[0])){const n=await this.extractValue(e,t,r);return{type:"property",element:s[0],property:"textContent",value:n}}if("string"!=typeof s){throw Error("set command target must be a string or object literal"+("memberExpression"===n?.type||"propertyAccess"===n?.type?` (a property chain evaluated to ${null===s?"null":typeof s} \u2014 check that all intermediate objects exist)`:""))}return{type:"variable",name:s,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?be(t,e.name,e.value):"global"===e.scope?Le(e.name,e.value,t,"global"):Le(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 To(e.element,e.property,e.value),Object.assign(t,{it:e.value}),{target:e.element,value:e.value,targetType:"property"};case"style":return Ya(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))To(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=Na(e,n),o=await this.extractValue(t,r,n);return{type:"property",element:i,property:a.name,value:o}}}const o=e.object,s=e.computed;if(o){const i=o;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(o,n)}else l=await r.evaluate(o,n);if(null!=l&&"object"==typeof l){const i=s?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){if(!e)return ja(void 0,r);return ja(await t.evaluate(e,r),r)}async resolveTargets(e,t,r){if(!e)return Pa(void 0,r);return Pa(await t.evaluate(e,r),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,o]=i,s=ja(o,n),l=await this.extractValue(t,r,n);return{type:"property",element:s,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(Ee)&&"value"in t;case"property":return"string"==typeof t.property&&Ee(t.element)&&"value"in t;case"style":return"string"==typeof t.property&&""!==t.property&&Ee(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 Ta(t,"SetCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());const wl=Aa((()=>{let e,t,r=[Sa({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 Ta(t,"GetCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());function bl(e){return e&&"object"==typeof e&&e.type||"unknown"}const zl=Aa((()=>{let e,t,r=[Sa({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,o,s;const l=bl(i);if("identifier"===l)a=i.name,i.scope&&(o=i.scope);else if("literal"===l)a=i.value;else{const e=pe(l);if(e){const n=await t.evaluate(i,r),o="number"==typeof n?n:null==n?0:Number(n)||0;a=o,s={node:i,writer:e,currentValue:o}}else{const e=await t.evaluate(i,r);a=Array.isArray(e)&&e.length>0?e[0]:e}}let c=1,u=o;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 p=e.modifiers?.by;if(p){const e=p.value;if("literal"===bl(p)&&"number"==typeof e)c=e;else if("literal"!==bl(p)){const e=await t.evaluate(p,r);"number"==typeof e&&(c=e)}}return{target:a,amount:c,...u&&{scope:u},...s&&{customWrite:s}}}(e,t,r,n);return{...i,operation:n}}async execute(e,t){const{target:r,property:n,scope:i,amount:a=1,operation:o="increment",customWrite:s}=e;if(s){const e=isFinite(a)?a:1,r="increment"===o?s.currentValue+e:s.currentValue-e;return await s.writer(s.node,r,t),Object.assign(t,{it:r}),r}const l=Pe(r,n,i,t);let c;if(isNaN(l))c=NaN;else{const e=isFinite(a)?a:1;c="increment"===o?l+e:l-e}return Oe(r,n,i,c,t),Object.assign(t,{it:c}),c}};return Ta(t,"NumericModifyCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());function xl(e){const t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}const El=Aa((()=>{let e,t,r=[Sa({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(!Ee(e)&&!Array.isArray(e))return{type:"variable",name:a}}catch{return{type:"variable",name:a}}return{type:"form-fields",targets:await Ma(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)xl(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=>Ee(e))}return!1}};return Ta(t,"ClearCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());const Tl=Aa((()=>{let e,t,r=[Sa({name:"log"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args||0===e.args.length)return{values:[]};return{values:await Promise.all(e.args.map(e=>t.evaluate(e,r)))}}async execute(e,t){const r="undefined"!=typeof window?window.console:console;0===e.values.length?r.log():r.log(...e.values)}validate(e){if("object"!=typeof e||null===e)return!1;return Array.isArray(e.values)}};return Ta(t,"LogCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());let Sl=(()=>{let e,t,r=[Sa({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",o=e.args[0];let s,l,c;if("functionCall"===a(o)||"callExpression"===a(o)){s=o.name||o.callee?.name;const e=o.args||o.arguments;e?.length&&(l=await this.parseEventDetail(e,t,r))}else if("identifier"===a(o)||"keyword"===a(o))s=o.name;else{const e=await t.evaluate(o,r);s="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&&n<e.args.length-1){const a=e.args.slice(n+1),o=a.findIndex(e=>"with"===(e.name||e.value)),s=-1===o?a:a.slice(0,o);c=await this.resolveTargets(s,t,r,i)}else{if(!r.me)throw Error(i+": no target specified and context.me is null");c=[r.me]}}return{eventName:s,detail:l,targets:c,options:await this.parseEventOptions(e.args,t,r),mode:n}}async execute(e,t){const r=el(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(Ee(e))i.push(e);else if(e instanceof NodeList)i.push(...Array.from(e).filter(Ee));else if(Array.isArray(e))i.push(...e.filter(Ee));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(Ee));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()]=tl(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 Ta(t,"EventDispatchCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})();const Cl=Aa(Sl);let Al=(()=>{let e,t,r=[Sa({name:"go"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args||0===e.args.length)return{args:[]};return{args:await Promise.all(e.args.map(e=>t.evaluate(e,r)))}}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);if(null!==n){return{result:await this.navigateToBareUrl(n,r),type:"url"}}return{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"),o=this.resolveScrollTarget(n,t);if(!o)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){o.scrollIntoView?.({behavior:e,block:t,inline:n});const{x:a,y:s}=this.calculateScrollPosition(o,r,i);window.scrollTo?.({left:a,top:s,behavior:e})}else o.scrollIntoView?.({behavior:e,block:t,inline:n})}return o}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 o of e)"string"==typeof o&&(r.includes(o)?(t.vertical=o,i=!0):n.includes(o)&&(t.horizontal=o,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&&Ee(t.me))return t.me;if("it"===r&&Ee(t.it))return t.it;if("you"===r&&Ee(t.you))return t.you;const n=Ae(r,t);if(Ee(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,o=window.innerWidth||800,s=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-o/2;break;case"right":l=n.right+i-o}switch(t.vertical){case"top":c=n.top+a+r;break;case"middle":c=n.top+a+n.height/2-s/2+r;break;case"bottom":c=n.bottom+a-s+r}return{x:Math.max(0,l),y:Math.max(0,c)}}};return Ta(t,"GoCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})();const Ll=Aa(Al);const jl=["url","with","title"];async function Pl(e,t,r,n){if(!e||0===e.length)throw Error(n+" command requires a URL argument");const i=[],a=[];for(let n=0;e.length>n;n++){const o=e[n],s=o,l=s?.type||"unknown",c=s?.name;if("identifier"===l&&c&&jl.includes(c.toLowerCase()))i.push(c.toLowerCase()),a.push(c.toLowerCase());else{const e=await t.evaluate(o,r);i.push(e),"string"==typeof e&&a.push(e.toLowerCase())}}const o=a.findIndex(e=>"url"===e),s=a.findIndex(e=>"with"===e),l=a.findIndex(e=>"title"===e),c=`urlKeywordIndex=${o}, argCount=${i.length}`;let u,p;if(-1!==o&&i.length>o+1)u=i[o+1]+"";else{if(1>i.length)throw Error(`${n} command: URL is required. Debug: ${c}`);u=i[0]+""}-1!==s&&-1!==l&&l>s&&i.length>l+1&&(p=i[l+1]+"");const d=function(e,t,r){const n=r?" Debug: "+r:"";if(null==e)throw Error(`[HyperFixi] ${t}: URL is required.${n}`);if("string"!=typeof e)throw Error(`[HyperFixi] ${t}: URL must be a string (got ${typeof e}: ${e+""}).${n}`);if(""===e.trim())throw Error(`[HyperFixi] ${t}: URL cannot be empty.${n}`);if("undefined"===e)throw Error(`[HyperFixi] ${t}: URL evaluated to string 'undefined' - check your expression.${n}`);if("null"===e)throw Error(`[HyperFixi] ${t}: URL evaluated to string 'null' - check your expression.${n}`);return e}(u,n,c);return{url:d,title:p}}const Ol=Aa((()=>{let e,t,r=[Sa({name:"push"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n=e.commandName?.toLowerCase().includes("replace")?"replace":"push";return{...await Pl(e.args,t,r,n+" url"),mode:n}}async execute(e,t){const{url:r,title:n,state:i,mode:a}=e;"push"===a?window.history.pushState(i||null,"",r):window.history.replaceState(i||null,"",r),n&&(document.title=n);return nl(window,"push"===a?"pushurl":"replaceurl",{url:r,title:n,state:i}),{url:r,title:n,mode:a}}};return Ta(t,"HistoryCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({description:"Modify browser history URL without page reload",syntax:["push url <url>","push url <url> with title <title>","replace url <url>","replace url <url> with title <title>"],examples:['push url "/page/2"','push url "/search" with title "Search Results"','replace url "/search?q=test"','replace url "/page" with title "Updated Page"'],sideEffects:["navigation"],aliases:["replace"],category:"navigation",compatibility:"lokascript-extension"}),Ea(t,n),i=t})());const Nl=Aa((()=>{let e,t,r=[Sa({name:"scroll"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args||0===e.args.length)throw Error("scroll command requires a target");return{args:await Promise.all(e.args.map(e=>t.evaluate(e,r)))}}async execute(e,t){const{args:r}=e,n=this.parsePosition(r),i=!r.includes("instantly"),a=this.resolveTarget(r,t);if(!a)throw Error("scroll: target element not found");return"function"==typeof a.scrollIntoView&&a.scrollIntoView({block:n,behavior:i?"smooth":"instant"}),{element:a,position:n,smooth:i}}parsePosition(e){for(const t of e){if("top"===t)return"start";if("bottom"===t)return"end";if("middle"===t||"center"===t)return"center";if("nearest"===t)return"nearest"}return"start"}resolveTarget(e,t){const r=new Set(["to","of","the","top","bottom","middle","center","left","right","nearest","smoothly","instantly"]);for(const n of e){if("object"==typeof n&&n&&n.nodeType)return n;if("string"!=typeof n||r.has(n))continue;if("me"===n&&Ee(t.me))return t.me;if("it"===n&&Ee(t.it))return t.it;if("you"===n&&Ee(t.you))return t.you;if("body"===n&&"undefined"!=typeof document)return document.body;if("html"===n&&"undefined"!=typeof document)return document.documentElement;const e=Ae(n,t);if(Ee(e))return e;if("undefined"!=typeof document)try{const e=document.querySelector(n);if(e)return e}catch{try{const e=document.getElementsByTagName(n);if(e.length>0)return e[0]}catch{}}}return null}};return Ta(t,"ScrollCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({description:"Scroll an element into view (upstream _hyperscript 0.9.90)",syntax:["scroll to <target>","scroll to top of <target>","scroll to <target> smoothly"],examples:["scroll to #top","scroll to bottom of #chat","scroll to me smoothly"],sideEffects:["scrolling"],category:"navigation",compatibility:"standard"}),Ea(t,n),i=t})());function Rl(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=Ae(e,t);return void 0!==r?!!r:!!e}return!!e}const Ml=Aa((()=>{let e,t,r=[Sa({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,o=Rl(n,t);let s,l;return("unless"===r?!o:o)?(s="then",l=await this.executeCommandsOrBlock(i,t)):a&&"if"===r?(s="else",l=await this.executeCommandsOrBlock(a,t)):s="none",{mode:r,conditionResult:o,executedBranch:s,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 Ta(t,"ConditionalCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());let Il=(()=>{let e,t,r=[Sa({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 o=e.args[0],s="identifier"===o?.type?o.name:null,l=!!e.modifiers?.bottomTested&&await t.evaluate(e.modifiers.bottomTested,r);if("for"===s||e.modifiers?.for){const o=e.args[1],s=o?.value||o?.name,l=e.args[2]?await t.evaluate(e.args[2],r):void 0;if(!s||void 0===l)throw Error("for loops require variable and collection");return{type:"for",variable:s,collection:Array.isArray(l)?l:[l],indexVariable:n,commands:a,elseCommands:i}}if("times"===s||e.modifiers?.times){const o=e.args[1],s=o?await t.evaluate(o,r):void 0,l="number"==typeof s?s:parseInt(s+"",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"===s||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"===s&&e.modifiers?.from||"until-event"===s){const o=e.args[1],s=o?.value||o?.name;if(!s)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:s,eventTarget:l,indexVariable:n,commands:a,elseCommands:i}}if("until"===s||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"===s||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:o,indexVariable:s,commands:l,elseCommands:c,bottomTested:u,eventName:p,eventTarget:d}=e;let m,f;switch(r){case"for":({config:m,iterCtx:f}=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,s));break;case"times":({config:m,iterCtx:f}=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}}}(o,s));break;case"while":({config:m,iterCtx:f}=function(e,t,r,n){return{config:{type:"while",shouldContinue:()=>t(e,r)},iterCtx:{index:0,conditionExpr:e,indexVariable:n}}}(a,Rl,t,s));break;case"until":({config:m,iterCtx:f}=function(e,t,r,n){return{config:{type:"until",shouldContinue:()=>!t(e,r)},iterCtx:{index:0,conditionExpr:e,indexVariable:n}}}(a,Rl,t,s));break;case"until-event":({config:m,iterCtx:f}=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}}(p,d,s));break;case"forever":({config:m,iterCtx:f}=function(e,t=1e4){return{config:{type:"forever",maxIterations:t,shouldContinue:()=>!0},iterCtx:{index:0,indexVariable:e}}}(s));break;default:throw Error("Unknown repeat type: "+r)}if(u){const e=m.shouldContinue;m.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 o,s=0,l=!1;e.eventSetup&&e.eventSetup.target.addEventListener(e.eventSetup.eventName,e.eventSetup.onEvent,{once:!0});try{for(;a>s&&await e.shouldContinue(n);){e.beforeIteration&&await e.beforeIteration(n,r),n.indexVariable&&r.locals&&r.locals.set(n.indexVariable,s);try{o=await i(t,r)}catch(t){if(t instanceof Error){if(t.message.includes("BREAK")){l=!0;break}if(t.message.includes("CONTINUE")){s++,n.index=s,"until-event"===e.type&&await new Promise(e=>setTimeout(e,0));continue}}throw t}s++,n.index=s,"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:s,lastResult:o,interrupted:l}}(m,l,t,f,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 Ta(t,"RepeatCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})();const Wl=Aa(Il);class _l{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}}const ql=Aa((()=>{let e,t,r=[Sa({name:"break"})],n=[],i=_l;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 Ta(t,"BreakCommand"),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;xa(null,e={value:t},r,{kind:"class",name:t.name,metadata:o},null,n),a=t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),t.metadata=Ca({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"}),Ea(t,n),a=t})());const $l=Aa((()=>{let e,t,r=[Sa({name:"continue"})],n=[],i=_l;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 Ta(t,"ContinueCommand"),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;xa(null,e={value:t},r,{kind:"class",name:t.name,metadata:o},null,n),a=t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),t.metadata=Ca({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"}),Ea(t,n),a=t})());const Vl=Aa((()=>{let e,t,r=[Sa({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];if(n&&("the"===n.name||"the"===n.value))return{target:r.event};return{target:await t.evaluate(e.args[0],r)}}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 Ta(t,"HaltCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());const Dl=Aa((()=>{let e,t,r=[Sa({name:"return"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(!e.args||0===e.args.length)return{value:void 0};return{value:await t.evaluate(e.args[0],r)}}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 Ta(t,"ReturnCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());const Bl=Aa((()=>{let e,t,r=[Sa({name:"exit"})],n=[],i=_l;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 Ta(t,"ExitCommand"),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;xa(null,e={value:t},r,{kind:"class",name:t.name,metadata:o},null,n),a=t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),t.metadata=Ca({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"}),Ea(t,n),a=t})());const Hl=Aa((()=>{let e,t,r=[Sa({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 Ta(t,"ThrowCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());const Kl=Aa((()=>{let e,t,r=[Sa({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 un(r,t);let a,o,s=!1;return"function"==typeof i?(o="function",a=i(),a instanceof Promise&&(s=!0,a=await a)):i instanceof Promise?(o="promise",s=!0,a=await i):(o="value",a=i),Object.assign(t,{it:a,result:a}),{result:a,wasAsync:s,expressionType:o}}};return Ta(t,"CallCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());const Fl=Aa((()=>{let e,t,r=[Sa({name:"focus"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{targets:await Ma(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=>Ee(e))}};return Ta(t,"FocusCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());const Ul=Aa((()=>{let e,t,r=[Sa({name:"blur"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){return{targets:await Ma(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=>Ee(e))}};return Ta(t,"BlurCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());class Gl{constructor(){this.name="pseudo-command"}get metadata(){return Gl.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,o="",s=[];for(const e of n){const n=e.value;switch(e.key?.name||e.key?.value){case"methodName":o=n?.value||await t.evaluate(n,r)+"";break;case"methodArgs":"arrayLiteral"===n?.type&&n.elements?s=await Promise.all(n.elements.map(e=>t.evaluate(e,r))):"literal"===n?.type&&Array.isArray(n.value)&&(s=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(!o)throw Error("pseudo-command requires method name");if(null==a)throw Error("pseudo-command requires a target expression");return{methodName:o,methodArgs:s,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,o;const s=["from","on","with","into","at","to"];for(const n of s)if(e.modifiers?.[n]){o=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:o,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 o=await this.executeMethod(a,e,n);return t.locals.set("result",o),Object.assign(t,{it:o}),{result:o,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+""))}}}function Zl(e){return Ee(e)?e:e+""}Gl.metadata=Ca({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"]});class Yl{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 gl(i,t,r,{scopeElements:async()=>Ee(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 o=await t.evaluate(i,r),s=function(e){if(Ee(e))return[e];if(Array.isArray(e)&&e.length>0&&e.every(e=>Ee(e)))return e;if(e&&"object"==typeof e&&"number"==typeof e.length&&"function"==typeof e.item){const t=Array.from(e).filter(e=>Ee(e));return t.length?t:null}return null}(o);return s?{kind:"elements",elements:s,content:n}:{kind:"value",target:o,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=Oo(e.property),n=this.combineValue(r,e.content);return Ee(r)||No(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(Re(e),t)}insertIntoEach(e,t){const r=Zl(t);for(const t of e)lo(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(Ee(e))return lo(e,Zl(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":Ee(e)?"element":"result"}executeVariable(e,t){if("me"===e.name||"you"===e.name){const r="me"===e.name?t.me:t.you;if(Ee(r))return lo(r,Zl(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=Ae(e.name,t,e.scope),n=this.combineValue(r,e.content);return Array.isArray(r)||r instanceof Set||Ee(r)||Le(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 Xl=Aa((()=>{let e,t,r=[Sa({name:"append"})],n=[],i=Yl;var a=t=class extends i{get metadata(){return a.metadata}constructor(){super("append")}};return Ta(t,"AppendCommand"),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;xa(null,e={value:t},r,{kind:"class",name:t.name,metadata:o},null,n),a=t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),t.metadata=Ca({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"}),Ea(t,n),a=t})());const Jl=Aa((()=>{let e,t,r=[Sa({name:"prepend"})],n=[],i=Yl;var a=t=class extends i{get metadata(){return a.metadata}constructor(){super("prepend")}};return Ta(t,"PrependCommand"),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;xa(null,e={value:t},r,{kind:"class",name:t.name,metadata:o},null,n),a=t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),t.metadata=Ca({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"}),Ea(t,n),a=t})());const Ql=Aa((()=>{let e,t,r=[Sa({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),o=(e=>Array.isArray(e)||Se(e)?e[0]:e)(a);if(Ee(o)||"string"==typeof a&&/^[#.]|^(?:me|it|you)$/.test(a))i=o,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 s=await t.evaluate(e.modifiers.to,r);void 0===s&&"identifier"===e.modifiers.to.type&&(s=e.modifiers.to.name);const l={property:n,value:s};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:o}=e;r.startsWith("*")&&(r=r.substring(1)),r=r.replace(/([A-Z])/g,"-$1").toLowerCase();const s=ja(n,t,"transition"),l=ho(a,300),c=getComputedStyle(s).getPropertyValue(r),u=s.style.transition,p=`${r} ${l}ms ${o||"ease"}`;s.style.transition=u?`${u}, ${p}`:p;let d=i+"",m=!1;if("initial"===d||"inherit"===d||"unset"===d||"revert"===d){const e=s.style.getPropertyValue(r);s.style.removeProperty(r),d=getComputedStyle(s).getPropertyValue(r),e&&s.style.setProperty(r,e),m=!0}s.style.setProperty(r,d);const f=await function(e,t,r){return new Promise(n=>{const i=r=>{r.target===e&&r.propertyName===t&&o({completed:!0,cancelled:!1})},a=r=>{r.target===e&&r.propertyName===t&&o({completed:!1,cancelled:!0})},o=ul(()=>{e.removeEventListener("transitionend",i),e.removeEventListener("transitioncancel",a),clearTimeout(s)},n);e.addEventListener("transitionend",i),e.addEventListener("transitioncancel",a);const s=setTimeout(()=>{o({completed:!0,cancelled:!1})},r+50)})}(s,r,l);return s.style.transition=u,m&&s.style.removeProperty(r),{element:s,property:r,fromValue:c,toValue:d,duration:l,completed:f.completed}}};return Ta(t,"TransitionCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());const ec=Aa((()=>{let e,t,r=[Sa({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 o=a.name.toLowerCase();if("me"===o||"it"===o||"you"===o){const o=await t.evaluate(a,r);if(Ee(o)&&(n=o,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 o=await t.evaluate(a,r);if(Ee(o)||"string"==typeof o&&/^[#.]/.test(o)){if(n=o,e.args.length>1){const n=e.args[1];i="identifier"===n.type?n.name:await t.evaluate(n,r)+""}}else"string"==typeof o&&(i=o)}}e.modifiers?.set&&(a=await t.evaluate(e.modifiers.set,r)+"");const o={};return void 0!==n&&(o.target=n),void 0!==i&&(o.property=i),void 0!==a&&(o.variable=a),o}async execute(e,t){const r=ja(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 o=r.getPropertyValue(t),s=parseFloat(o);if(!isNaN(s)){const e=o.match(/([a-zA-Z%]+)$/);return{value:s,unit:e?e[1]:"px"}}return{value:0,unit:"px"}}};return Ta(t,"MeasureCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());const tc=Aa((()=>{let e,t,r=[Sa({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);(Ee(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=ja(r,t,"settle"),a=ho(n,5e3),o=Date.now(),s=getComputedStyle(i),l=vo(s.transitionDuration),c=vo(s.transitionDelay),u=vo(s.animationDuration),p=vo(s.animationDelay),d=go(l,c),m=go(u,p),f=Math.max(d,m);var h,y,v;return{element:i,settled:(await(h=i,y=f,v=a,y>0?new Promise(e=>{const t=e=>{e.target===h&&n({completed:!0,type:"transition"})},r=e=>{e.target===h&&n({completed:!0,type:"animation"})},n=ul(()=>{h.removeEventListener("transitionend",t),h.removeEventListener("animationend",r),clearTimeout(i),clearTimeout(a)},e);h.addEventListener("transitionend",t),h.addEventListener("animationend",r);const i=setTimeout(()=>{n({completed:!0,type:"timeout"})},y+50),a=setTimeout(()=>{n({completed:!1,type:"timeout"})},v)}):Promise.resolve({completed:!0,type:"timeout"}))).completed,timeout:a,duration:Date.now()-o}}};return Ta(t,"SettleCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());const rc=Aa((()=>{let e,t,r=[Sa({name:"start"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){const n=e.args??[];let i;if(e.modifiers?.transitionName){const n=await t.evaluate(e.modifiers.transitionName,r);i="string"==typeof n?n:(n??"")+""}return{transitionName:i,body:n}}async execute(e,t){const r=t.locals.get("_runtimeExecute");let n=0;const i=async()=>{for(const i of e.body)r?await r(i,t):i&&"function"==typeof i.execute?await i.execute(t):"function"==typeof i&&await i(t),n++};if(!zs())return await i(),{usedViewTransition:!1,commandsExecuted:n};const a=e.transitionName?{transitionName:e.transitionName}:void 0;return await Ss(i,a),{usedViewTransition:!0,commandsExecuted:n}}};return Ta(t,"StartViewTransitionCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({description:"Wrap a block of commands in document.startViewTransition()",syntax:["start view transition [using <type>] <body> end"],examples:["start view transition add .highlight to me end",'start view transition using "slide" then put result into #panel end'],sideEffects:["animation","dom-mutation"],category:"animation",compatibility:"standard"}),Ea(t,n),i=t})());let nc=(()=>{let e,t,r=[Sa({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 eo(e.args[0],t,r),i=n+"";let a;if(e.args.length<2)e.modifiers?.from&&(a=await t.evaluate(e.modifiers.from,r));else{if(!(o=e.args[1])||("identifier"!==o.type||"from"!==o.name)&&"from"!==o.value)throw Error("take syntax: take <property> from <source>");e.args[2]&&(a=await t.evaluate(e.args[2],r))}var o;let s;if(e.args.length<8)e.args.length>3&&(s=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]&&(s=await t.evaluate(e.args[7],r))}if(!s&&e.modifiers?.on&&(s=await t.evaluate(e.modifiers.on,r)),!s&&e.modifiers?.for&&(s=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:s}}async execute(e,t){const r=e.property.trim();if(r.startsWith(".")){const n=r.substring(1);let i;if(null!=e.source)i=Pa(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=Pa(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=ja(this.firstOf(e.source),t,"take"),i=ja(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 Ta(t,"TakeCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})();const ic=Aa(nc);const ac=Aa((()=>{let e,t,r=[Sa({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],o=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+""}o&&"arrayLiteral"===o.type&&Array.isArray(o.elements)&&(i=o.elements.map(e=>"string"==typeof e.value?e.value:e.value+"").filter(e=>e&&e.length>0));const s={code:n};return i&&i.length>0&&(s.parameters=i),s}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 Ta(t,"JsCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());const oc=Aa((()=>{let e,t,r=[Sa({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 Ta(t,"AsyncCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());const sc=Aa((()=>{let e,t,r=[Sa({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 o=await gl(i,t,r,{scopeElements:async()=>r.me?[r.me]:[],bareReference:!0});if(o)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}'`)}}(o,n);const s=await t.evaluate(e.args[0],r);if(Ee(s))return{type:"element",element:s,value:n};if(Array.isArray(s)&&Ee(s[0]))return{type:"element",element:s[0],value:n};if("string"==typeof s)return{type:"variable",name:s,value:n};throw Error("Invalid target type: "+typeof s)}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=Ae(t,e,n);return null!=i?{target:t,value:r,wasSet:!1,existingValue:i,targetType:"variable"}:(Le(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 So(i)?(To(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 So(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 Ta(t,"DefaultCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());const lc=Aa((()=>{let e,t,r=[Sa({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=Pa(r,t);if(0===i.length)throw Error("tell command found no target elements");const a=t.locals.get("_runtimeExecute"),o=[];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);o.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:o,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 Ta(t,"TellCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());const cc=Aa((()=>{let e,t,r=[Sa({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(Ee(e))return"html"===t?e.outerHTML:e.textContent||"";if(e===r.me&&Ee(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(Ee(e.me)){const n=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!1});e.me.dispatchEvent(n)}}};return Ta(t,"CopyCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})());let uc=(()=>{let e,t,r=[Sa({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),o="start"===a?"start":Number(a);let s;if(e.modifiers.rangeEnd){if("end"===e.modifiers.rangeEnd.value)s="end";else{const n=await t.evaluate(e.modifiers.rangeEnd,r);s=Number(n)}}const l=e.modifiers.rangeMode;return{variant:"range",array:n,rangeStart:o,rangeEnd:s,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),o="string"==typeof a?a:a+"",s=e.modifiers.flags,l=s?.value;return{variant:i,source:n,regex:o,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 Ta(t,"PickCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})();const pc=Aa(uc);let dc=(()=>{let e,t,r=[Sa({name:"beep"})],n=[];var i=t=class{get metadata(){return i.metadata}async parseInput(e,t,r){if(0===e.args.length)return{expressions:[]};return{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)}return console.groupEnd(),{expressionCount:r.length,debugged:!0,outputs:n}}debugContext(e){console.group("\ud83d\udd14 beep! Context Debug"),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":Ee(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(Ee(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 Ta(t,"BeepCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({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"}),Ea(t,n),i=t})();const mc=Aa(dc);const fc=Aa((()=>{let e,t,r=[Sa({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 Ta(t,"BreakpointCommand"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;xa(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=Ca({description:"Drop into the debugger (emits a debugger; statement)",syntax:["breakpoint"],examples:["breakpoint","on click breakpoint"],sideEffects:["debugging"],category:"utility",compatibility:"standard"}),Ea(t,n),i=t})());class hc{constructor(){this.name="install"}get metadata(){return hc.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,o;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&&(o=await t.evaluate(e.modifiers.on,r)),{behaviorName:i,parameters:a,target:o}}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(Ee(e))return[e];throw Error('No target specified and "me" is not available in context')}if(Ee(e))return[e];if(Array.isArray(e)){const t=e.filter(e=>Ee(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(Ee(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=>Ee(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=>Ee(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(Ee(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")}}hc.metadata=Ca({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 yc{constructor(){this.name="render"}get metadata(){return yc.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){if("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),o=[],s=await this.processTemplate(i,a,o),l=this.createDOMElement(s);return Object.assign(t,{it:l}),{element:l,rendered:s,directivesProcessed:o}}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:o}=await this.processRepeatDirective(n,a,t);i.push(o),a=e,r.push("@repeat")}else if(e.startsWith("@if ")){const{nextIndex:e,rendered:o}=await this.processIfDirective(n,a,t,r);i.push(o),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:o,blockContent:s}=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(s.join("\n"),t,[]);l.push(n)}return{nextIndex:o+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 o=!!this.evaluateExpression(a[1],r),{endIndex:s,blockContent:l,elseContent:c}=this.extractIfElseBlock(e,t+1);let u="";return o?u=await this.processTemplate(l.join("\n"),r,[]):c.length>0&&(u=await this.processTemplate(c.join("\n"),r,[]),n.push("@else")),{nextIndex:s+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,o=!1;for(;e.length>a&&i>0;){const t=e[a].trim();if(t.startsWith("@if "))i++;else{if("@else"===t&&1===i){o=!0,a++;continue}if("@end"===t&&(i--,0===i))break}o?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 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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}createDOMElement(e){if("undefined"==typeof document)return null;const t=document.createElement("div");return t.innerHTML=e,1===t.children.length?t.firstElementChild:t}}yc.metadata=Ca({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"]});const vc={hide:Wa,show:_a,add:no,remove:mo,toggle:Wo,put:qo,make:Bo,empty:Ho,open:Go,close:Yo,select:Jo,reset:es,swap:Rs,morph:Ms,process:sl,wait:dl,fetch:yl,set:kl,get:wl,increment:zl,clear:El,default:sc,trigger:Cl,go:Ll,push:Ol,scroll:Nl,if:Ml,repeat:Wl,break:ql,continue:$l,halt:Vl,return:Dl,exit:Bl,throw:Hl,call:Kl,focus:Fl,blur:Ul,"pseudo-command":function(){return new Gl},append:Xl,prepend:Jl,transition:Ql,measure:ec,settle:tc,start:rc,take:ic,js:ac,async:oc,log:Tl,tell:lc,copy:cc,pick:pc,beep:mc,breakpoint:fc,install:function(){return new hc},render:function(){return new yc}};class gc extends Qn{constructor(e={}){const t=e.registry||new Bn;e.registry||function(e){for(const t of a){if(t.consolidationAliasOf)continue;const r=vc[t.name];if(!r)throw Error(`Command manifest names '${t.name}' but runtime.ts has no factory for it. Add it to COMMAND_FACTORIES, or give the manifest row a consolidationAliasOf.`);e.register(r())}}(t);const r={registry:t,expressionRegistry:e.expressionRegistry??ba()};void 0!==e.enableAsyncCommands&&(r.enableAsyncCommands=e.enableAsyncCommands),void 0!==e.commandTimeout&&(r.commandTimeout=e.commandTimeout),void 0!==e.enableErrorReporting&&(r.enableErrorReporting=e.enableErrorReporting),super(r)}getRegistry(){return this.registry}}function kc(e,t){return t?{type:"literal",value:e,dataType:t}:{type:"literal",value:e}}function wc(e,t){return t?{type:"selector",value:e,selectorKind:t}:{type:"selector",value:e}}function bc(e){return{type:"reference",value:e}}function zc(e,t){return{type:"property-path",object:e,property:t}}function xc(e){return{type:"expression",raw:e}}function Ec(e,t=!0){return{type:"flag",name:e,enabled:t}}function Tc(e,t,r){const n={kind:"command",action:e,roles:t instanceof Map?t:new Map(Object.entries(t))};return r?{...n,metadata:r}:n}function Sc(e,t,r,n,i){return{kind:"event-handler",action:e,roles:t instanceof Map?t:new Map(Object.entries(t)),body:r,...i&&{eventModifiers:i},...n&&{metadata:n}}}function Cc(e,t,r,n,i){return{kind:"conditional",action:e,roles:t instanceof Map?t:new Map(Object.entries(t)),thenBranch:r,...n&&{elseBranch:n},...i&&{metadata:i}}}function Ac(e,t="sequential",r){const n={kind:"compound",action:"compound",roles:new Map,statements:e,chainType:t};return r?{...n,metadata:r}:n}function Lc(e,t,r,n,i,a,o){return{kind:"loop",action:e,roles:t instanceof Map?t:new Map(Object.entries(t)),loopVariant:r,body:n,...i&&{loopVariable:i},...a&&{indexVariable:a},...o&&{metadata:o}}}function jc(e,t,r,n){return{kind:"command",action:"try",roles:new Map,body:e,...t&&t.length>0?{catchBranch:t}:{},...r&&r.length>0?{finallyBranch:r}:{},...n?{metadata:n}:{}}}function Pc(e,t,r){return{kind:"command",action:e,roles:new Map,asyncVariant:e,asyncBody:t,...r?{metadata:r}:{}}}function Oc(e,t,r,n){return{kind:"command",action:"match",roles:e instanceof Map?e:new Map(Object.entries(e)),arms:t,...r&&r.length>0?{defaultArm:r}:{},...n?{metadata:n}:{}}}function Nc(e){return"flag"===e.type?e.name:"raw"in e&&void 0!==e.raw?e.raw+"":"value"in e&&void 0!==e.value?e.value+"":"property-path"===e.type?`${Nc(e.object)}.${e.property}`:""}function Rc(e,t){const r=e.roles.get(t);return r?Nc(r):""}function Mc(e){return null===e?"null":Array.isArray(e)?"an array of length "+e.length:"string"==typeof e?"the string "+JSON.stringify(e):"object"==typeof e?"an object":void 0===e?"undefined":e+""}var Ic=new Set(["me","you","it","result","event","target","body","document","window","detail"]);function Wc(e,t=Ic){return t.has(e)}var _c=new Set(["body","then","else","condition","loop-body","variable","catch","finally"]);function qc(e,t={}){const r=e.trim(),n=!0===t.collectDiagnostics,i=[];if(!r.startsWith("[")||!r.endsWith("]"))throw Error("Explicit syntax must be wrapped in brackets: [command role:value ...]");const a=r.slice(1,-1).trim();if(!a)throw Error("Empty explicit statement");const o=function(e){const t=[];let r="",n=!1,i="",a=!1,o=0;for(let s=0;e.length>s;s++){const l=e[s];if(n){if(r+=l,l===i){let t=0;for(let r=s-1;r>=0&&"\\"===e[r];r--)t++;t%2==0&&(n=!1)}}else'"'!==l&&"'"!==l?a?(r+=l,">"===l&&r.endsWith("/>")&&(a=!1)):"<"!==l||""!==r&&!r.endsWith(":")?"["!==l?"]"!==l?" "!==l||0!==o?r+=l:r&&(t.push(r),r=""):(o--,r+=l):(o++,r+=l):(a=!0,r+=l):(n=!0,i=l,r+=l)}r&&t.push(r);return t}(a);if(0===o.length)throw Error("No command specified in explicit statement");const s=o[0].toLowerCase(),l=new Map,c=t.referenceSet??Ic,u=t.schemaLookup?.getSchema(s),p=u?new Set(u.roles.map(e=>e.role)):null;for(let e=1;o.length>e;e++){const t=o[e];if(t.startsWith("+")||t.startsWith("~")){const e=t.startsWith("+"),r=t.slice(1);if(!r){if(n){i.push({severity:"error",code:"EMPTY_FLAG",message:`Empty flag name: "${t}"`,source:"schema"});continue}throw Error(`Empty flag name: "${t}"`)}if(p&&!p.has(r)){if(n){i.push({severity:"error",code:"UNKNOWN_FLAG",message:`Unknown flag "${r}" for command "${s}"`,source:"schema",suggestions:[...p].map(e=>"+"+e)}),l.set(r,Ec(r,e));continue}throw Error(`Unknown flag "${r}" for command "${s}". Valid roles: ${[...p].join(", ")}`)}l.set(r,Ec(r,e));continue}const r=t.indexOf(":");if(-1===r){if(n){i.push({severity:"error",code:"INVALID_ROLE_FORMAT",message:`Invalid role format: "${t}". Expected role:value or +flag`,source:"schema"});continue}throw Error(`Invalid role format: "${t}". Expected role:value or +flag`)}const a=t.slice(0,r);if(p&&!_c.has(a)&&!p.has(a)){if(!n)throw Error(`Unknown role "${a}" for command "${s}". Valid roles: ${[...p].join(", ")}`);i.push({severity:"error",code:"UNKNOWN_ROLE",message:`Unknown role "${a}" for command "${s}"`,source:"schema",suggestions:[...p]})}const u=a,d=t.slice(r+1);if(_c.has(a)&&d.startsWith("[")){const e=Gc(t,r+1),n=t.slice(r+1,e+1);l.set(u,{type:"expression",raw:n});continue}const m=Uc(d,c);l.set(u,m)}if(u&&"on"!==s)for(const e of u.roles)if(e.required&&!l.has(e.role)&&!e.default){if(!n)throw Error(`Missing required role "${e.role}" for command "${s}": ${e.description}`);i.push({severity:"error",code:"MISSING_REQUIRED_ROLE",message:`Missing required role "${e.role}" for command "${s}": ${e.description}`,source:"schema"})}const d=e=>0===i.length?e:{...e,diagnostics:i};switch(s){case"on":{if(!l.get("event")){if(n)return i.push({severity:"error",code:"MISSING_EVENT_ROLE",message:"Event handler requires event role: [on event:click ...]",source:"schema"}),d(Sc("on",l,[],{sourceLanguage:"explicit"}));throw Error("Event handler requires event role: [on event:click ...]")}const e=Kc(l,"body",t);return l.delete("body"),d(Sc("on",l,e,{sourceLanguage:"explicit"}))}case"if":{const e=Kc(l,"then",t),r=Kc(l,"else",t);return l.delete("then"),l.delete("else"),d(Cc(s,l,e,r.length>0?r:void 0,{sourceLanguage:"explicit"}))}case"repeat":{const e=Kc(l,"loop-body",t),r=l.get("loop-variant"),n=l.get("variable"),i=l.get("index-variable");let a;l.delete("loop-body"),l.delete("loop-variant"),l.delete("variable"),l.delete("index-variable"),a=r&&"literal"===r.type&&"string"==typeof r.value?r.value:l.has("quantity")?"times":l.has("source")?"for":l.has("condition")?"while":"forever";return d(Lc(s,l,a,e,"literal"===n?.type&&"string"==typeof n.value?n.value:"expression"===n?.type?n.raw:void 0,"literal"===i?.type&&"string"==typeof i.value?i.value:void 0,{sourceLanguage:"explicit"}))}default:return d(Tc(s,l,{sourceLanguage:"explicit"}))}}function $c(e){const t=e.trim();return t.startsWith("[")&&t.endsWith("]")}var Vc=new Set(["then","and","async","sequential"]);function Dc(e){const t=[];let r=null,n="",i=0,a=!1,o="";for(let s=0;e.length>s;s++){const l=e[s];if(a)n+=l,l===o&&"\\"!==e[s-1]&&(a=!1);else if('"'!==l&&"'"!==l)if("["!==l){if("]"!==l)n+=l;else if(i--,n+=l,0===i){const i=e.slice(s+1),a=i.match(/^\s*\|>\s*/);if(a){t.push(n.trim()),n="",r??(r="pipe"),s+=a[0].length;continue}const o=i.match(/^\s+(then|and|async|sequential)\s+/);if(o&&Vc.has(o[1])){t.push(n.trim()),n="",r??(r=o[1]),s+=o[0].length;continue}}}else i++,n+=l;else a=!0,o=l,n+=l}return n.trim()&&t.push(n.trim()),{segments:t,chainType:r}}function Bc(e,t){const r=e.trim(),{annotations:n,remainder:i}=function(e){const t=[];let r=0;for(;e.length>r;){for(;e.length>r&&(" "===e[r]||"\t"===e[r]);)r++;if(r>=e.length||"@"!==e[r])break;r++;const n=r;for(;e.length>r&&/[A-Za-z0-9\-_]/.test(e[r]);)r++;const i=e.slice(n,r);if(!i)break;let a;if(e.length>r&&"("===e[r]){r++;const t=r;if(e.length<=r||'"'!==e[r]&&"'"!==e[r]){for(;e.length>r&&")"!==e[r];)r++;a=e.slice(t,r)}else{const n=e[r];for(r++;e.length>r&&e[r]!==n;)"\\"===e[r]&&r++,r++;r++,a=e.slice(t+1,r-1)}e.length>r&&")"===e[r]&&r++}t.push(void 0!==a?{name:i,value:a}:{name:i})}return{annotations:t,remainder:e.slice(r).trim()}}(r),{segments:a,chainType:o}=Dc(i);let s;if(1<a.length){s=Ac(a.map(e=>qc(e,t)),o??"sequential")}else s=qc(a[0]||i,t);return n.length>0?{...s,annotations:n}:s}var Hc=/^#!lse\s+(\d+\.\d+(?:\.\d+)?)\s*$/;function Kc(e,t,r){const n=e.get(t);return n&&"expression"===n.type?[qc(n.raw,r)]:[]}function Fc(e){if(e)return function(e){let t="";for(const r of e)if(t)r===t&&(t="");else if('"'!==r&&"'"!==r){if(" "===r||">"===r||"+"===r||"~"===r||","===r)return!0}else t=r;return!1}(e)?"complex":e.startsWith("#")?"id":e.startsWith(".")?"class":e.startsWith("[")?"attribute":e.startsWith("*")?"element":void 0}function Uc(e,t){if(e.startsWith("<")){if(!e.endsWith("/>"))throw Error(`Unterminated selector literal: "${e}". Expected a closing "/>"`);const t=e.slice(1,-2);if(!t)throw Error(`Empty selector literal: "${e}"`);return wc(t,Fc(t))}if(e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("@")||e.startsWith("*"))return wc(e,Fc(e));if(e.startsWith('"')||e.startsWith("'"))return kc(function(e){if(!e.includes("\\"))return e;let t="";for(let r=0;e.length>r;r++){if("\\"===e[r]&&e.length>r+1){const n=e[r+1],i="\\"===n?"\\":'"'===n?'"':"'"===n?"'":"n"===n?"\n":"r"===n?"\r":"t"===n?"\t":"";if(i){t+=i,r++;continue}}t+=e[r]}return t}(e.slice(1,-1)),"string");if("true"===e)return kc(!0,"boolean");if("false"===e)return kc(!1,"boolean");const r=e.toLowerCase();if(Wc(r,t))return bc(r);const n=e.match(/^(-?\d+(?:\.\d+)?)(ms|s|m|h)?$/);if(n){const t=parseFloat(n[1]);return n[2]?kc(e,"duration"):kc(t,"number")}return kc(e)}function Gc(e,t){let r=0;for(let n=t;e.length>n;n++)if("["===e[n])r++;else if("]"===e[n]&&(r--,0===r))return n;return e.length-1}function Zc(e){let t;if("compound"===e.kind){const r=e;t=r.statements.map(e=>Zc(e)).join(` ${r.chainType} `)}else t=function(e){const t=[e.action];for(const[r,n]of e.roles)t.push("flag"===n.type?n.enabled?"+"+n.name:"~"+n.name:`${r}:${Yc(n)}`);if("event-handler"===e.kind){e.body&&e.body.length>0&&t.push("body:"+e.body.map(e=>Zc(e)).join(" "))}if("conditional"===e.kind){const r=e;r.thenBranch&&r.thenBranch.length>0&&t.push("then:"+r.thenBranch.map(e=>Zc(e)).join(" ")),r.elseBranch&&r.elseBranch.length>0&&t.push("else:"+r.elseBranch.map(e=>Zc(e)).join(" "))}if("loop"===e.kind){const r=e;r.loopVariant&&t.push("loop-variant:"+r.loopVariant),r.loopVariable&&t.push("variable:"+r.loopVariable),r.indexVariable&&t.push("index-variable:"+r.indexVariable),r.body&&r.body.length>0&&t.push("loop-body:"+r.body.map(e=>Zc(e)).join(" "))}if("command"===e.kind){const r=e;r.body&&r.body.length>0&&t.push("body:"+r.body.map(e=>Zc(e)).join(" ")),r.catchBranch&&r.catchBranch.length>0&&t.push("catch:"+r.catchBranch.map(e=>Zc(e)).join(" ")),r.finallyBranch&&r.finallyBranch.length>0&&t.push("finally:"+r.finallyBranch.map(e=>Zc(e)).join(" ")),r.asyncVariant&&t.push("async-variant:"+r.asyncVariant),r.asyncBody&&r.asyncBody.length>0&&t.push("async-body:"+r.asyncBody.map(e=>Zc(e)).join(" "))}return`[${t.join(" ")}]`}(e);if(e.annotations&&e.annotations.length>0){return e.annotations.map(e=>void 0!==e.value?`@${e.name}(${e.value})`:"@"+e.name).join(" ")+" "+t}return t}function Yc(e){switch(e.type){case"literal":return"string"==typeof e.value?"string"===e.dataType||/\s/.test(e.value)?JSON.stringify(e.value):e.value:e.value+"";case"selector":return e.value&&function(e){if(e.includes(" "))return!0;const t=e[0];return!("#"===t||"."===t||"@"===t||"*"===t)}(e.value)?`<${e.value}/>`:e.value;case"reference":return e.value;case"property-path":return`${Yc(e.object)}'s ${e.property}`;case"expression":return e.raw;case"flag":return e.name}}function Xc(e){const t=Jc(e.roles);let r;switch(e.kind){case"command":{const n=e;r={kind:"command",action:e.action,roles:t},n.body&&n.body.length>0&&(r.body=n.body.map(Xc)),n.catchBranch&&n.catchBranch.length>0&&(r.catchBranch=n.catchBranch.map(Xc)),n.finallyBranch&&n.finallyBranch.length>0&&(r.finallyBranch=n.finallyBranch.map(Xc)),n.asyncVariant&&(r.asyncVariant=n.asyncVariant),n.asyncBody&&n.asyncBody.length>0&&(r.asyncBody=n.asyncBody.map(Xc)),n.arms&&n.arms.length>0&&(r.arms=n.arms.map(e=>({pattern:Qc(e.pattern),body:e.body.map(Xc)}))),n.defaultArm&&n.defaultArm.length>0&&(r.defaultArm=n.defaultArm.map(Xc));break}case"event-handler":{const n=e;if(function(e){if(!e.body||1!==e.body.length)return!1;const t=e.body[0];if("command"!==t.kind)return!1;const r=t;if(r.body&&r.body.length>0)return!1;if(r.catchBranch&&r.catchBranch.length>0)return!1;if(r.finallyBranch&&r.finallyBranch.length>0)return!1;if(r.asyncVariant)return!1;if(r.asyncBody&&r.asyncBody.length>0)return!1;if(r.arms&&r.arms.length>0)return!1;if(r.defaultArm&&r.defaultArm.length>0)return!1;const n=e.roles.get("event");return!(!n||"literal"!==n.type)&&("string"==typeof n.value&&(!r.roles.has("event")&&((!e.additionalEvents||0>=e.additionalEvents.length)&&((!e.parameterNames||0>=e.parameterNames.length)&&((!e.annotations||0>=e.annotations.length)&&((!e.diagnostics||0>=e.diagnostics.length)&&((!r.annotations||0>=r.annotations.length)&&(!r.diagnostics||0>=r.diagnostics.length))))))))}(n)){const e=n.body[0],t={event:n.roles.get("event").value},i=function(e){if(!e)return;const t={};e.once&&(t.once=!0);"number"==typeof e.debounce&&(t.debounce=e.debounce);"number"==typeof e.throttle&&(t.throttle=e.throttle);e.queue&&(t.queue=e.queue);return Object.keys(t).length>0?t:void 0}(n.eventModifiers);i&&(t.modifiers=i),r={action:e.action,roles:Jc(e.roles),trigger:t};break}r={kind:"event-handler",action:e.action,roles:t,body:n.body.map(Xc)};break}case"compound":{const t=e;r={kind:"compound",action:"compound",statements:t.statements.map(Xc),chainType:t.chainType};break}case"conditional":{const n=e;r={kind:"command",action:e.action,roles:t},r.thenBranch=n.thenBranch.map(Xc),n.elseBranch&&n.elseBranch.length>0&&(r.elseBranch=n.elseBranch.map(Xc));break}case"loop":{const n=e;r={kind:"command",action:e.action,roles:t},r.loopVariant=n.loopVariant,r.loopBody=n.body.map(Xc),n.loopVariable&&(r.loopVariable=n.loopVariable),n.indexVariable&&(r.indexVariable=n.indexVariable);break}}return e.annotations&&e.annotations.length>0&&(r.annotations=e.annotations.map(e=>void 0!==e.value?{name:e.name,value:e.value}:{name:e.name})),e.diagnostics&&e.diagnostics.length>0&&(r.diagnostics=e.diagnostics.map(e=>{const t={level:e.severity,message:e.message};return e.role&&(t.role=e.role),e.code&&(t.code=e.code),e.source&&(t.source=e.source),e.suggestions&&e.suggestions.length>0&&(t.suggestions=[...e.suggestions]),t})),r}function Jc(e){const t={};for(const[r,n]of e)t[r]=Qc(n);return t}function Qc(e){switch(e.type){case"selector":{const t="selectorKind"in e?e.selectorKind:void 0,r={type:"selector",value:e.value};return t&&new Set(["id","class","attribute","element","complex"]).has(t)&&(r.selectorKind=t),r}case"literal":return e.dataType?{type:"literal",value:e.value,dataType:e.dataType}:{type:"literal",value:e.value};case"reference":return{type:"reference",value:e.value};case"expression":return{type:"expression",raw:e.raw};case"property-path":return{type:"expression",raw:Nc(e)};case"flag":return{type:"flag",name:e.name,enabled:e.enabled}}}function eu(e){const t=new Map(Object.entries(e.roles??{}).map(([e,t])=>[e,ru(t)])),r=e.annotations?.map(e=>void 0!==e.value?{name:e.name,value:e.value}:{name:e.name}),n=e.diagnostics?.map(e=>({severity:e.level,message:e.message,...e.role?{role:e.role}:{},...e.code?{code:e.code}:{},...e.source?{source:e.source}:{},...e.suggestions&&e.suggestions.length>0?{suggestions:e.suggestions}:{}}));if(e.trigger){t.set("event",kc(e.trigger.event,"string"));const i=new Map(t);i.delete("event");return tu(Sc("on",t,[Tc(e.action,i)],{sourceLanguage:"json"},e.trigger.modifiers??{}),r,n)}const i=e.kind??"command";if("event-handler"===i){const i=(e.body??[]).map(eu);return tu(Sc(e.action,t,i),r,n)}if("compound"===i){return tu(Ac((e.statements??[]).map(eu),e.chainType??"sequential"),r,n)}if(e.thenBranch&&e.thenBranch.length>0){const i=e.thenBranch.map(eu),a=e.elseBranch?e.elseBranch.map(eu):void 0;return tu(Cc(e.action,t,i,a),r,n)}if(e.loopVariant){const i=(e.loopBody??[]).map(eu);return tu(Lc(e.action,t,e.loopVariant,i,e.loopVariable,e.indexVariable),r,n)}if(e.catchBranch||e.finallyBranch){return tu(jc((e.body??[]).map(eu),e.catchBranch?e.catchBranch.map(eu):void 0,e.finallyBranch?e.finallyBranch.map(eu):void 0),r,n)}if(e.asyncVariant){const t=(e.asyncBody??[]).map(eu);return tu(Pc(e.asyncVariant,t),r,n)}if(e.arms&&e.arms.length>0){return tu(Oc(t,e.arms.map(e=>({pattern:ru(e.pattern),body:e.body.map(eu)})),e.defaultArm?e.defaultArm.map(eu):void 0),r,n)}return tu(e.body&&e.body.length>0&&"command"===i?jc(e.body.map(eu)):Tc(e.action,t),r,n)}function tu(e,t,r){return t&&0!==t.length||r&&0!==r.length?{...e,...t&&t.length>0?{annotations:t}:{},...r&&r.length>0?{diagnostics:r}:{}}:e}function ru(e){switch(e.type){case"selector":return wc((e.value??"")+"",e.selectorKind);case"literal":return kc(void 0!==e.value?e.value:"",e.dataType);case"reference":return bc((e.value??"")+"");case"expression":return xc(e.raw??(e.value??"")+"");case"flag":return Ec(e.name??(e.value??"")+"",e.enabled??("boolean"!=typeof e.value||e.value));case"property-path":return xc((e.value??e.raw??"")+"")}}var nu=new Set(["command","event-handler","compound"]),iu=new Set(["selector","literal","reference","expression","property-path","flag"]),au=new Set(["then","and","async","sequential","pipe"]),ou=new Set(["all","race"]),su=new Set(["error","warning","info"]);var lu=class{constructor(e){this.namespace=e,this.enabled=this.checkEnabled()}checkEnabled(){if("undefined"!=typeof process&&process.env){const e=process.env.DEBUG||"";return"*"===e||e.includes("framework:*")||e.includes("framework:"+this.namespace)}return!1}log(e,t,...r){if(!this.enabled)return;const n=`[framework:${this.namespace}]`,i=(new Date).toISOString();switch(e){case"debug":case"info":break;case"warn":console.warn(`${i} ${n} WARN:`,t,...r);break;case"error":console.error(`${i} ${n} ERROR:`,t,...r)}}debug(e,...t){this.log("debug",e,...t)}info(e,...t){this.log("info",e,...t)}warn(e,...t){this.log("warn",e,...t)}error(e,...t){this.log("error",e,...t)}isEnabled(){return this.enabled}enable(){this.enabled=!0}disable(){this.enabled=!1}};function cu(e,t){return!t||0===t.length||(!!t.includes(e)||(!!t.includes("expression")||"property-path"===e&&t.some(e=>["selector","reference","expression"].includes(e))))}function uu(e,t){return e?.possessive?.keywords?.[t]}var pu=class e{constructor(){this.logger=new lu("pattern-matcher"),this.stemMatchCount=0,this.totalKeywordMatches=0}safeToLowerCase(e){return"string"==typeof e?e.toLowerCase():null==e?"":(e+"").toLowerCase()}matchPattern(e,t,r){const n=e.mark(),i=new Map;if(this.logger.debug("========================================"),this.logger.debug("matchPattern ENTRY"),this.logger.debug("Pattern ID:",t.id),this.logger.debug("Pattern command:",t.command),this.logger.debug("Pattern language:",t.language),this.logger.debug("Pattern template:",JSON.stringify(t.template,null,2)),this.logger.isEnabled()){const t=[];for(let r=0;10>r;r++){const n=e.peek(r);if(!n)break;t.push({type:n.type,value:n.value,kind:n.kind})}this.logger.debug("Input tokens (first 10):",t),this.logger.debug("Profile code:",r?.code)}this.currentProfile=r,this.stemMatchCount=0,this.totalKeywordMatches=0,this.logger.debug("--- Calling matchTokenSequence ---"),this.logger.debug("Pattern tokens to match:",JSON.stringify(t.template.tokens,null,2));const a=this.matchTokenSequence(e,t.template.tokens,i);if(this.logger.debug("matchTokenSequence returned:",a),this.logger.debug("Captured roles:",Array.from(i.entries()).map(([e,t])=>[e,JSON.stringify(t)])),!a)return this.logger.debug(">>> MATCH FAILED - resetting token position"),e.reset(n),null;const o=this.calculateConfidence(t,i);return this.applyExtractionRules(t,i),{pattern:t,captured:i,consumedTokens:e.position()-n.position,confidence:o}}matchBest(e,t,r){const n=[];for(const i of t){const t=e.mark(),a=this.matchPattern(e,i,r);a&&n.push(a),e.reset(t)}if(0===n.length)return null;n.sort((e,t)=>{const r=t.pattern.priority-e.pattern.priority;if(0!==r)return r;const n=t.confidence-e.confidence;return Math.abs(n)>.001?n:t.consumedTokens-e.consumedTokens});const i=n[0];return this.matchPattern(e,i.pattern),i}matchTokenSequence(e,t,r,n){const i=t[0],a="literal"===i?.type&&("and"===i.value||"then"===i.value||i.alternatives?.includes("and")||i.alternatives?.includes("then"));if("ar"===this.currentProfile?.code&&!a)for(;"conjunction"===e.peek()?.kind;)e.advance();let o=null,s=null;for(let i=0;t.length>i;i++){const a=t[i];this.logger.debug(" >> Matching pattern token:",JSON.stringify(a,null,2));const l=e.peek();if(this.logger.debug(" >> Current input token:",l?JSON.stringify({type:l.type,value:l.value,kind:l.kind}):"EOF"),"role"===a.type&&a.greedy){const l=this.collectStopMarkers(t,i+1);if(n)for(const e of n)l.add(e);const c=[];for(;!e.isAtEnd();){const t=e.peek();if(!t)break;if(this.isStopMarker(t,l))break;c.push(t.value),e.advance()}if(c.length>0){r.set(a.role,{type:"expression",raw:c.join(" ")}),o=null,s=null;continue}if(a.optional)continue;return!1}if("group"===a.type){const l=this.collectStopMarkers(t,i+1);if(n)for(const e of n)l.add(e);if(this.matchGroupToken(e,a,r,l)){o=null,s=null;continue}if(this.isOptional(a))continue;return!1}const c="role"===a.type&&!0===a.optional,u=c?e.mark():null;if("role"===a.type&&!c){const n=t.length>i+1?t[i+1]:null;if("literal"===n?.type){const t=e.peek();if(t&&"none"!==this.getMatchType(t,n.value)){if(this.logger.debug(" >> MARKER-STEAL GUARD: current token matches next literal, skipping role"),this.logger.debug(" >> Token match FAILED"),this.isOptional(a))continue;if(o&&s){this.logger.debug(" >> BACKTRACKING: undoing optional role",s),e.reset(o),r.delete(s),o=null,s=null;const t=this.matchPatternToken(e,a,r);if(this.logger.debug(" >> Backtrack retry result:",t),t)continue}return!1}}}const p=this.matchPatternToken(e,a,r);if(this.logger.debug(" >> Match result:",p),p)c?(o=u,s=a.role):(o=null,s=null);else if(this.logger.debug(" >> Token match FAILED"),!this.isOptional(a)){if(o&&s){this.logger.debug(" >> BACKTRACKING: undoing optional role",s),e.reset(o),r.delete(s),o=null,s=null;const t=this.matchPatternToken(e,a,r);if(this.logger.debug(" >> Backtrack retry result:",t),t)continue}return!1}}return!0}matchPatternToken(e,t,r){switch(t.type){case"literal":return this.matchLiteralToken(e,t);case"role":return this.matchRoleToken(e,t,r);case"group":return this.matchGroupToken(e,t,r);default:return!1}}matchLiteralToken(e,t){const r=e.peek();if(this.logger.debug(" >>> matchLiteralToken: expecting",t.value),this.logger.debug(" >>> matchLiteralToken: got token",r?JSON.stringify({type:r.type,value:r.value,kind:r.kind}):"null"),!r)return this.logger.debug(" >>> matchLiteralToken: FAIL - no token"),!1;const n=this.getMatchType(r,t.value);if(this.logger.debug(" >>> matchType for",r.value,"vs",t.value,":",n),"none"!==n)return this.totalKeywordMatches++,"stem"===n&&this.stemMatchCount++,e.advance(),!0;if(t.alternatives)for(const n of t.alternatives){const t=this.getMatchType(r,n);if("none"!==t)return this.totalKeywordMatches++,"stem"===t&&this.stemMatchCount++,e.advance(),!0}return!1}matchRoleToken(e,t,r){this.logger.debug(" >>> matchRoleToken ENTRY: capturing role",t.role),this.logger.debug(" >>> matchRoleToken: expected types",t.expectedTypes),this.logger.debug(" >>> matchRoleToken: optional?",t.optional),this.skipNoiseWords(e);const n=e.peek();if(this.logger.debug(" >>> After skipNoiseWords, current token:",n?JSON.stringify({value:n.value,kind:n.kind}):"null"),!n)return t.optional||!1;const i=this.tryMatchPossessiveExpression(e);if(i)return t.expectedTypes&&t.expectedTypes.length>0&&!cu(i.type,t.expectedTypes)?t.optional||!1:(r.set(t.role,i),!0);const a=this.tryMatchMethodCallExpression(e);if(a)return t.expectedTypes&&t.expectedTypes.length>0&&!cu(a.type,t.expectedTypes)?t.optional||!1:(r.set(t.role,a),!0);const o=this.tryMatchPossessiveSelectorExpression(e);if(o)return t.expectedTypes&&t.expectedTypes.length>0&&!cu(o.type,t.expectedTypes)?t.optional||!1:(r.set(t.role,o),!0);const s=this.tryMatchPropertyAccessExpression(e);if(s)return t.expectedTypes&&t.expectedTypes.length>0&&!cu(s.type,t.expectedTypes)?t.optional||!1:(r.set(t.role,s),!0);const l=this.tryMatchSelectorPropertyExpression(e);if(l)return t.expectedTypes&&t.expectedTypes.length>0&&!cu(l.type,t.expectedTypes)?t.optional||!1:(r.set(t.role,l),!0);this.logger.debug(" >>> Trying tokenToSemanticValue for token:",n?JSON.stringify({value:n.value,kind:n.kind}):"null");const c=this.tokenToSemanticValue(n);return this.logger.debug(" >>> tokenToSemanticValue returned:",c?JSON.stringify(c):"null"),c?(this.logger.debug(" >>> Validating type:",c.type,"against expected:",t.expectedTypes),t.expectedTypes&&t.expectedTypes.length>0&&!cu(c.type,t.expectedTypes)?(this.logger.debug(" >>> TYPE MISMATCH - returning",t.optional||!1),t.optional||!1):(this.logger.debug(" >>> Type validation PASSED"),r.set(t.role,c),e.advance(),!0)):t.optional||!1}tryMatchPossessiveExpression(e){const t=e.peek();if(!t)return null;if(!this.currentProfile)return null;const r=this.safeToLowerCase(t.normalized||t.value),n=uu(this.currentProfile,r);if(!n)return null;const i=e.mark();e.advance();const a=e.peek();if(!a)return e.reset(i),null;if("identifier"===a.kind||"keyword"===a.kind&&!this.isStructuralKeyword(a.value)||"selector"===a.kind&&a.value.startsWith("*")||"selector"===a.kind&&a.value.startsWith("@")||"selector"===a.kind&&a.value.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(a.value)){e.advance();let t=a.value;"selector"===a.kind&&t.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(t)&&(t=t.substring(1));let r=t;for(;"selector"===e.peek()?.kind&&e.peek().value.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(e.peek().value);)r+=e.peek().value,e.advance();const i=e.peek();return"literal"===i?.kind&&i.value.startsWith("(")&&(r+=i.value,e.advance()),zc(bc(n),r)}return e.reset(i),null}isStructuralKeyword(e){return new Set(["into","in","to","from","at","by","with","without","before","after","of","as","on","then","end","else","if","repeat","while","for","toggle","add","remove","put","set","show","hide","increment","decrement","send","trigger","call"]).has(e.toLowerCase())}tryMatchMethodCallExpression(t){const r=t.peek();if(!r||"selector"!==r.kind)return null;const n=t.mark();t.advance();const i=t.peek();if(!i||"operator"!==i.kind||"."!==i.value)return t.reset(n),null;t.advance();const a=t.peek();if(!a||"identifier"!==a.kind)return t.reset(n),null;t.advance();const o=t.peek();if(!o||"punctuation"!==o.kind||"("!==o.value)return t.reset(n),null;t.advance();const s=[];for(;!t.isAtEnd()&&e.MAX_METHOD_ARGS>s.length;){const e=t.peek();if(!e)break;if("punctuation"===e.kind&&")"===e.value){t.advance();break}"punctuation"!==e.kind||","!==e.value?(s.push(e.value),t.advance()):t.advance()}return{type:"expression",raw:`${r.value}.${a.value}(${s.join(", ")})`}}tryMatchPropertyAccessExpression(t){const r=t.peek();if(!r)return null;if("identifier"!==r.kind&&"keyword"!==r.kind)return null;const n=t.mark();t.advance();const i=t.peek();if(!i||"operator"!==i.kind||"."!==i.value)return t.reset(n),null;t.advance();const a=t.peek();if(!a||"identifier"!==a.kind)return t.reset(n),null;t.advance();let o=`${r.value}.${a.value}`,s=1;for(;!t.isAtEnd()&&e.MAX_PROPERTY_DEPTH>s;){const e=t.peek();if(!e||"operator"!==e.kind||"."!==e.value)break;t.advance();const r=t.peek();if(!r||"identifier"!==r.kind)break;t.advance(),o+="."+r.value,s++}const l=t.peek();if(l&&"punctuation"===l.kind&&"("===l.value){t.advance();const r=[];let n=0;for(;!t.isAtEnd()&&e.MAX_METHOD_ARGS>r.length;){const e=t.peek();if(!e)break;if("punctuation"===e.kind&&")"===e.value){if(0===n){t.advance();break}n--}"punctuation"===e.kind&&"("===e.value&&n++,"punctuation"!==e.kind||","!==e.value?(r.push(e.value),t.advance()):t.advance()}return{type:"expression",raw:`${o}(${r.join(", ")})`}}return{type:"expression",raw:o}}tryMatchPossessiveSelectorExpression(e){const t=e.peek();if(!t||"selector"!==t.kind)return null;const r=e.mark();e.advance();const n=e.peek();if(!n||"punctuation"!==n.kind||"'s"!==n.value)return e.reset(r),null;e.advance();const i=e.peek();return i?"selector"!==i.kind&&"identifier"!==i.kind?(e.reset(r),null):(e.advance(),zc(wc(t.value),i.value)):(e.reset(r),null)}tryMatchSelectorPropertyExpression(e){const t=e.peek();if(!t||"selector"!==t.kind)return null;if("string"!=typeof t.value||!t.value.startsWith("#"))return null;const r=e.mark();e.advance();const n=e.peek();if(!n||"selector"!==n.kind)return e.reset(r),null;if(!n.value.startsWith("."))return e.reset(r),null;e.peek(1);e.advance();const i=n.value.slice(1);return zc(wc(t.value),i)}matchGroupToken(t,r,n,i){const a=t.mark(),o=new Set(n.keys());if(this.matchTokenSequence(t,r.tokens,n,i))return!0;t.reset(a);for(const e of n.keys())o.has(e)||n.delete(e);if(!r.optional)return!1;const s=this.getGroupLeadingMarker(r);if(s)for(let l=1;e.MAX_MARKER_SCAN>=l;l++){const e=t.peek(l);if(!e)break;if((e.normalized||e.value).toLowerCase()===s){this.logger.debug(" >> MARKER SCAN: found",s,"at offset",l,"- skipping intervening tokens");for(let e=0;l>e;e++)t.advance();if(this.matchTokenSequence(t,r.tokens,n,i))return!0;t.reset(a);for(const e of n.keys())o.has(e)||n.delete(e);break}}return!0}getGroupLeadingMarker(e){const t=e.tokens[0];return"literal"===t?.type?t.value.toLowerCase():null}getMatchType(e,t){return e.value===t?"exact":e.normalized===t?"normalized":e.stem!==t||void 0===e.stemConfidence||.7>e.stemConfidence?"keyword"===e.kind&&this.safeToLowerCase(e.value)===t.toLowerCase()?"case-insensitive":"none":"stem"}collectStopMarkers(e,t){const r=new Set;for(let n=t;e.length>n;n++){const t=e[n];if("literal"===t.type){if(r.add(t.value.toLowerCase()),t.alternatives)for(const e of t.alternatives)r.add(e.toLowerCase());break}if("group"===t.type){for(const e of t.tokens)if("literal"===e.type){if(r.add(e.value.toLowerCase()),e.alternatives)for(const t of e.alternatives)r.add(t.toLowerCase());break}if(!t.optional)break}}return r}isStopMarker(e,t){return 0!==t.size&&(!!t.has(e.value.toLowerCase())||!(!e.normalized||!t.has(e.normalized.toLowerCase())))}tokenToSemanticValue(e){switch(e.kind){case"selector":return wc(e.value);case"literal":return this.parseLiteralValue(e.value);case"keyword":return this.safeToLowerCase(e.normalized||e.value),kc(e.normalized||e.value);case"identifier":return"string"==typeof e.value&&e.value.startsWith(":")?bc(e.value):(this.safeToLowerCase(e.value),{type:"expression",raw:e.value});case"url":return kc(e.value,"string");default:return null}}parseLiteralValue(e){if(e.startsWith('"')||e.startsWith("'")||e.startsWith("`")||e.startsWith("\u300c")){return kc(e.slice(1,-1),"string")}if("true"===e)return kc(!0,"boolean");if("false"===e)return kc(!1,"boolean");const t=e.match(/^(\d+(?:\.\d+)?)(ms|s|m|h)?$/);if(t){const r=parseFloat(t[1]);return t[2]?kc(e,"duration"):kc(r,"number")}const r=parseFloat(e);return isNaN(r)?kc(e,"string"):kc(r,"number")}applyExtractionRules(e,t){for(const[r,n]of Object.entries(e.extraction))t.has(r)||(void 0!==n.value?t.set(r,{type:"literal",value:n.value}):n.default&&t.set(r,n.default))}isOptional(e){return"literal"!==e.type&&!0===e.optional}calculateConfidence(e,t){let r=0,n=0;const i=t=>void 0!==e.extraction?.[t]?.default;for(const a of e.template.tokens)if("role"===a.type)n+=1,t.has(a.role)&&(r+=1);else if("group"===a.type)for(const e of a.tokens)if("role"===e.type){const a=i(e.role),o=.8;n+=o,t.has(e.role)?r+=o:a&&(r+=.6*o)}let a=n>0?r/n:1;if(this.stemMatchCount>0&&this.totalKeywordMatches>0){a=Math.max(.5,a-this.stemMatchCount/this.totalKeywordMatches*.15)}const o=this.calculateVSOConfidenceBoost(e);a=Math.min(1,a+o);const s=this.arabicPrepositionDisambiguation(e,t);return a=Math.max(0,Math.min(1,a+s)),a}calculateVSOConfidenceBoost(e){if("ar"!==e.language)return 0;const t=e.template.tokens[0];if(!t||"literal"!==t.type)return 0;const r=new Set(["\u0628\u062f\u0644","\u063a\u064a\u0631","\u0623\u0636\u0641","\u0623\u0632\u0644","\u0636\u0639","\u0627\u062c\u0639\u0644","\u0639\u064a\u0646","\u0632\u062f","\u0627\u0646\u0642\u0635","\u0633\u062c\u0644","\u0623\u0638\u0647\u0631","\u0623\u062e\u0641","\u0634\u063a\u0644","\u0623\u0631\u0633\u0644","\u0631\u0643\u0632","\u0634\u0648\u0634","\u062a\u0648\u0642\u0641","\u0627\u0646\u0633\u062e","\u0627\u062d\u0630\u0641","\u0627\u0635\u0646\u0639","\u0627\u0646\u062a\u0638\u0631","\u0627\u0646\u062a\u0642\u0627\u0644","\u0623\u0648"]);if(r.has(t.value))return.15;if(t.alternatives)for(const e of t.alternatives)if(r.has(e))return.15;return 0}arabicPrepositionDisambiguation(e,t){if("ar"!==e.language)return 0;let r=0;const n={patient:["\u0639\u0644\u0649"],destination:["\u0625\u0644\u0649","\u0627\u0644\u0649"],source:["\u0645\u0646"],agent:["\u0645\u0646"],manner:["\u0628"],style:["\u0628"],goal:["\u0625\u0644\u0649","\u0627\u0644\u0649"],method:["\u0628"]};for(const[e,i]of t.entries()){const t=n[e];if(!t||0===t.length)continue;const a="metadata"in i?i.metadata:void 0;if(a&&"string"==typeof a.prepositionValue){t.includes(a.prepositionValue)?r+=.1:r-=.1}}return Math.max(-.1,Math.min(.1,r))}skipNoiseWords(t){const r=t.peek();if(!r)return;const n=this.safeToLowerCase(r.value);if(e.ENGLISH_NOISE_WORDS.has(n)){const e=t.mark();t.advance();const r=t.peek();if(r&&"selector"===r.kind)return;t.reset(e)}"class"===n&&t.advance()}extractEventModifiers(e){const t={};let r=!1;for(;!e.isAtEnd();){const n=e.peek();if(!n||"event-modifier"!==n.kind)break;const i=n.metadata;if(!i)break;switch(r=!0,i.modifierName){case"once":t.once=!0;break;case"debounce":"number"==typeof i.value&&(t.debounce=i.value);break;case"throttle":"number"==typeof i.value&&(t.throttle=i.value);break;case"queue":"first"!==i.value&&"last"!==i.value&&"all"!==i.value&&"none"!==i.value||(t.queue=i.value)}e.advance()}return r?t:void 0}};pu.MAX_MARKER_SCAN=3,pu.MAX_PROPERTY_DEPTH=10,pu.MAX_METHOD_ARGS=20,pu.ENGLISH_NOISE_WORDS=new Set(["the","a","an"]);var du=pu,mu=new du;var fu={basePriority:100,includeOptionalVariants:!0};function hu(e,t,r=fu){const n=`${e.action}-${t.code}-generated`,i=r.basePriority??100,a=t.keywords[e.action];if(!a)throw Error(`No keyword translation for '${e.action}' in ${t.code}`);const o=function(e,t,r,n){const i=[],a={type:"literal",value:r,...n?.length&&{alternatives:n}},o=gu(e.roles,t.wordOrder);if("SVO"===t.wordOrder){i.push(a);for(const e of o)yu(i,e,t)}else if("SOV"===t.wordOrder){const e=[],r=[];for(const n of o)yu("postVerb"===n.sovSlot?r:e,n,t);i.push(...e,a,...r)}else if("VSO"===t.wordOrder){i.push(a);for(const e of o)yu(i,e,t)}else{i.push(a);for(const e of o)yu(i,e,t)}return i}(e,t,a.primary,a.alternatives),s=function(e,t){const r={};for(const n of e.roles){const e=vu(n,t),i={...void 0!==n.default&&{default:n.default},...e&&{marker:e}};r[n.role]=i}return r}(e,t),l=function(e,t,r){const n="SOV"===t.wordOrder,i=[],a=[],o=gu(e.roles,t.wordOrder);for(const e of o){const r=vu(e,t),o=`{${e.role}}`,s=n&&"postVerb"===e.sovSlot?a:i;if(r){const n=t.roleMarkers?.[e.role];s.push("after"===n?.position?`${o} ${r}`:`${r} ${o}`)}else s.push(o)}return(n?[...i,r,...a]:[r,...i,...a]).join(" ")}(e,t,a.primary);return{id:n,language:t.code,command:e.action,priority:i,template:{format:l,tokens:o},extraction:s}}function yu(e,t,r){const n=vu(t,r),i=!t.required,a={type:"role",role:t.role,optional:i,expectedTypes:t.expectedTypes,...t.greedy&&{greedy:!0}};if(n){const o=r.roleMarkers?.[t.role],s="SOV"===r.wordOrder?"after":"before",l=t.markerPosition??o?.position??s;i?e.push("before"===l?{type:"group",optional:!0,tokens:[{type:"literal",value:n},a]}:{type:"group",optional:!0,tokens:[a,{type:"literal",value:n}]}):"before"===l?(e.push({type:"literal",value:n}),e.push(a)):(e.push(a),e.push({type:"literal",value:n}))}else e.push(a)}function vu(e,t){return e.markerOverride?.[t.code]?e.markerOverride[t.code]:t.roleMarkers?.[e.role]?.primary}function gu(e,t){const r=[...e];return"SVO"===t?r.sort((e,t)=>(t.svoPosition??0)-(e.svoPosition??0)):"SOV"===t&&r.sort((e,t)=>(t.sovPosition??0)-(e.sovPosition??0)),r}function ku(e,t,r){return e[t]?.[r]??t}function wu(...e){return e.filter(Boolean).join(" ")}function bu(e,t){const r={},n={};for(const e of t)for(const[t,n]of Object.entries(e.keywords))r[t]||(r[t]={}),r[t][e.code]=n.primary;for(const t of e)for(const e of t.roles)if(e.markerOverride){const t=e.role;n[t]||(n[t]={});for(const[r,i]of Object.entries(e.markerOverride))n[t][r]=i}for(const e of t)if(e.roleMarkers)for(const[t,r]of Object.entries(e.roleMarkers))n[t]||(n[t]={}),n[t][e.code]=r.primary;return{keywords:r,markers:n}}function zu(e){const t=new Set,r=new Set;for(const n of e)"SOV"===n.wordOrder&&t.add(n.code),"VSO"===n.wordOrder&&r.add(n.code);return{sovLanguages:t,vsoLanguages:r}}function xu(e){const{schemas:t,profiles:r,overrides:n}=e;let i;return(e,a)=>{const o=n?.[e.action];return o?o(e,a):(i??(i=Eu(t,r)),Tu(e,a,i))}}function Eu(e,t){const{keywords:r,markers:n}=bu(e,t),{sovLanguages:i}=zu(t),a={};for(const e of t)for(const[t,r]of Object.entries(e.roleMarkers??{}))r.position&&(a[t]??(a[t]={}),a[t][e.code]=r.position);const o=new Map;for(const t of e)o.set(t.action,t);return{keywords:r,markers:n,markerPositions:a,sovLanguages:i,schemaMap:o}}function Tu(e,t,r){const n=r.schemaMap.get(e.action);if(!n)return null;const i=ku(r.keywords,e.action,t),a=r.sovLanguages.has(t),o=gu([...n.roles],a?"SOV":"SVO"),s=[],l=[];for(const n of o){let i=Rc(e,n.role);if(i||void 0===n.default||(i=Nc(n.default)+""),!i)continue;n.quoteMultiword&&/\s/.test(i)&&!/^(["']).*\1$/.test(i)&&(i=`"${i}"`);const o=n.renderOverride?.[t]??n.markerOverride?.[t]??n.renderOverride?.["*"]??r.markers[n.role]?.[t],c=a&&"postVerb"===n.sovSlot?l:s;o&&"before"===(n.markerPositionOverride?.[t]??n.markerPosition??r.markerPositions[n.role]?.[t]??(a?"after":"before"))?c.push(o,i):o?c.push(i,o):c.push(i)}return a?wu(...s,i,...l):wu(i,...s,...l)}function Su(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 Cu(e,t,r){const n=[];for(const i of e){const e=t.find(e=>e.role===i.role);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 Au(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("-"),o=n.startsWith("-");let s=n;if(a&&(s=n.slice(0,-1)),o&&(s=n.substring(1)),t+=s,i){const e=i.startsWith("-");a||e||(t+=" ")}}return t}var Lu=class{constructor(e){this.dictionary=e.dictionary,this.profileProvider=e.profileProvider}transform(e,t,r){const n=this.profileProvider.getProfile(t),i=this.profileProvider.getProfile(r);if(!n)throw Error("No profile found for language: "+t);if(!i)throw Error("No profile found for language: "+r);const a=this.parseStatement(e,t,n);return Au(Cu(Su(this.translateRoles(a,t,r),i.canonicalOrder),i.markers,i.adpositionType))}parseStatement(e,t,r){const n=new Map,i=e.split(/\s+/);let a=0;for(;i.length>a;){const e=i[a],o=r.markers.find(t=>t.form===e);if(o)i.length>a+1?(n.set(o.role,i[a+1]),a+=2):a++;else{const r=this.dictionary.lookup(e,t);r?n.set("action",r):(e.startsWith("#")||e.startsWith("."),n.set("patient",e)),a++}}return n}translateRoles(e,t,r){const n=new Map;for(const[t,i]of e){const e=this.dictionary.translate(i,r);n.set(t,{role:t,value:i,translated:e??i})}return n}},ju=class{constructor(e){this.translations=e}lookup(e,t){const r=this.translations[t];if(!r)return;const n=e.toLowerCase();for(const[e,t]of Object.entries(r))if(t.toLowerCase()===n)return e}translate(e,t){return this.translations[t]?.[e]}getAllTranslations(e,t){const r=this.lookup(e,t);if(!r)return{};const n={};for(const[e,t]of Object.entries(this.translations)){const i=t[r];i&&(n[e]=i)}return n}},Pu=class{constructor(e){this.profiles=e}getProfile(e){return this.profiles[e]}getSupportedLanguages(){return Object.keys(this.profiles)}hasLanguage(e){return e in this.profiles}},Ou=class{constructor(){this.name="string-literal"}canExtract(e,t){const r=e[t];return'"'===r||"'"===r||"`"===r||"\u201c"===r||"\u2018"===r}extract(e,t){const r=e[t];if("\u201c"===r){let r=1;for(;e.length>t+r;){if("\u201d"===e[t+r])return r++,{value:e.substring(t,t+r),length:r};r++}return null}if("\u2018"===r){let r=1;for(;e.length>t+r;){if("\u2019"===e[t+r])return r++,{value:e.substring(t,t+r),length:r};r++}return null}let n=1,i=!1;for(;e.length>t+n;){const a=e[t+n];if(i)i=!1,n++;else if("\\"!==a){if(a===r)return n++,{value:e.substring(t,t+n),length:n};n++}else i=!0,n++}return null}},Nu=class{constructor(){this.name="number"}canExtract(e,t){return/\d/.test(e[t])}extract(e,t){let r=0,n=!1;for(;e.length>t+r;){const i=e[t+r];if(/\d/.test(i))r++;else{if("."!==i||n)break;n=!0,r++}}if(0===r)return null;const i=e.substring(t,t+r),a=t+r;if(e.length>a){const t=e.slice(a),n=[{pattern:"\u6beb\u79d2",suffix:"ms"},{pattern:"\u5206\u949f",suffix:"m"},{pattern:"\u5c0f\u65f6",suffix:"h"},{pattern:"\u30df\u30ea\u79d2",suffix:"ms"},{pattern:"\u6642\u9593",suffix:"h"}];for(const e of n)if(t.startsWith(e.pattern))return{value:i+e.suffix,length:r+e.pattern.length,metadata:{hasTimeUnit:!0}};if(t.startsWith("ms"))return{value:i+"ms",length:r+2,metadata:{hasTimeUnit:!0}};const o=[{pattern:"\u79d2",suffix:"s"},{pattern:"\u5206",suffix:"m"}];for(const e of o)if(t.startsWith(e.pattern))return{value:i+e.suffix,length:r+1,metadata:{hasTimeUnit:!0}};if(/^[smh](?![a-zA-Z])/.test(t))return{value:i+t[0],length:r+1,metadata:{hasTimeUnit:!0}}}return{value:i,length:r}}},Ru=class{constructor(){this.name="identifier"}canExtract(e,t){return/[a-zA-Z_]/.test(e[t])}extract(e,t){let r=0;for(;e.length>t+r;){if(!/[a-zA-Z0-9_]/.test(e[t+r]))break;r++}return r>0?{value:e.substring(t,t+r),length:r}:null}},Mu=class{constructor(){this.name="unicode-identifier"}canExtract(e,t){return e.charCodeAt(t)>=128&&/\p{L}/u.test(e[t])}extract(e,t){let r=0;for(;e.length>t+r;){if(!/[\p{L}\p{N}\p{M}]/u.test(e[t+r]))break;r++}return r>0?{value:e.substring(t,t+r),length:r}:null}},Iu=class{constructor(){this.name="latin-extended-identifier"}canExtract(e,t){return/\p{L}/u.test(e[t])}extract(e,t){let r=t;for(;e.length>r&&/[\p{L}\p{N}_-]/u.test(e[r]);)r++;return r===t?null:{value:e.slice(t,r),length:r-t}}},Wu=/[\p{L}\p{N}_-]/u,_u=/[\p{sc=Han}\p{sc=Hiragana}\p{sc=Katakana}\p{sc=Hangul}]/u;function qu(e){return Wu.test(e)&&!_u.test(e)}function $u(e){return"setContext"in e&&"function"==typeof e.setContext}function Vu(e){const t={language:e.language,direction:e.direction,lookupKeyword:e.lookupKeyword.bind(e),isKeyword:e.isKeyword.bind(e),isKeywordStart:e.isKeywordStart.bind(e),...e.isKeywordStartAtBoundary?{isKeywordStartAtBoundary:e.isKeywordStartAtBoundary.bind(e)}:{}};return e.normalizer?{...t,normalizer:e.normalizer}:t}var Du=new Set(["selector","literal","reference","expression","property-path","flag"]);function Bu(e){switch(e.type){case"selector":return wc(e.value+"",(t=e.value+"").startsWith("#")?"id":t.startsWith(".")?"class":t.startsWith("[")?"attribute":"complex");case"literal":return kc(e.value,"number"==typeof e.value?"number":"boolean"==typeof e.value?"boolean":"string");case"reference":return bc(e.value+"");case"expression":case"property-path":return xc(e.value+"");case"flag":return Ec(e.value+"",!0);default:return kc(e.value+"","string")}var t}function Hu(e){switch(e.type){case"selector":return{type:"selector",value:e.value};case"literal":return{type:"literal",value:e.value};case"reference":return{type:"reference",value:e.value};case"expression":return{type:"expression",value:e.raw};case"property-path":return{type:"property-path",value:`${Hu(e.object).value}.${e.property}`};case"flag":return{type:"flag",value:e.enabled}}}function Ku(e){if(!e||"object"!=typeof e)return Tc("unknown",{});switch(e.type){case"event":return function(e){const t=(e.event??"click")+"",r=Array.isArray(e.body)?e.body:[],n=r.map(Ku),i={event:kc(t)};e.target&&"object"==typeof e.target&&(i.source=Uu(e.target));const a=e.modifiers;let o;a&&(o=function(e){const t=!0===e.once||void 0,r="number"==typeof e.debounce?e.debounce:void 0,n="number"==typeof e.throttle?e.throttle:void 0,i="string"==typeof e.from?function(e){if(Ic.has(e))return bc(e);const t=Qu(e);return t?wc(e,t):kc(e)}(e.from):void 0;if(void 0===t&&void 0===r&&void 0===n&&void 0===i)return;return{...void 0!==t?{once:t}:{},...void 0!==r?{debounce:r}:{},...void 0!==n?{throttle:n}:{},...void 0!==i?{from:i}:{}}}(a),a.prevent&&(i.prevent=kc(!0)),a.stop&&(i.stop=kc(!0)),a.passive&&(i.passive=kc(!0)),a.capture&&(i.capture=kc(!0)));return Sc("on",i,n,void 0,o)}(e);case"command":return function(e){const t=(e.name??"unknown")+"",r=Array.isArray(e.args)?e.args:[],n=e.target&&"object"==typeof e.target?e.target:void 0,i=e.roles,a=e.modifiers;let o;if(i&&"object"==typeof i&&Object.keys(i).length>0){o={};for(const[e,t]of Object.entries(i))t&&"object"==typeof t&&"type"in t&&(o[e]=Uu(t))}else o=function(e,t,r,n){const i={};switch(e){case"set":{t[0]&&(i.destination=Uu(t[0]));const e=r?.to;e&&"object"==typeof e&&"type"in e?i.patient=Uu(e):t[1]&&(i.patient=Uu(t[1]));break}case"put":if(t[0]&&(i.patient=Uu(t[0])),r)for(const e of["into","before","after"]){const t=r[e];if(t&&"object"==typeof t&&"type"in t){i.destination=Uu(t),i.method=kc(e);break}}!i.destination&&n&&(i.destination=Uu(n));break;case"increment":case"decrement":{t[0]&&(i.destination=Uu(t[0]));const e=r?.by;e&&"object"==typeof e&&"type"in e?i.quantity=Uu(e):t[1]&&(i.quantity=Uu(t[1]));break}case"fetch":{t[0]&&(i.source=Uu(t[0]));const e=r?.as;e&&"object"==typeof e&&"type"in e?i.responseType=Uu(e):"string"==typeof e&&(i.responseType=kc(e));break}case"wait":case"settle":t[0]&&(i.duration=Uu(t[0]));break;case"toggle":case"add":case"show":case"hide":case"send":case"trigger":default:t[0]&&(i.patient=Uu(t[0])),n&&(i.destination=Uu(n));break;case"remove":t[0]&&(i.patient=Uu(t[0])),n&&(i.source=Uu(n));break;case"log":t[0]&&(i.patient=Uu(t[0]));break;case"scroll":{const e=Ju(t,Zu);e&&(i.destination=Uu(e));break}case"push":case"replace":{const e=Ju(t,Yu);e&&(i.patient=Uu(e));break}case"process":{const e=Ju(t,Xu);e&&(i.patient=Uu(e));break}}return i}(t,r,a,n);return Tc(t,o)}(e);case"if":return function(e){const t=e.condition&&"object"==typeof e.condition?Uu(e.condition):xc("true"),r=Array.isArray(e.thenBranch)?e.thenBranch:[],n=r.map(Ku);let i;const a=e.elseIfBranches;a&&a.length>0?i=[Fu(a,e.elseBranch)]:Array.isArray(e.elseBranch)&&e.elseBranch.length>0&&(i=e.elseBranch.map(Ku));return Cc("if",{condition:t},n,i)}(e);case"repeat":return function(e){const t=Array.isArray(e.body)?e.body:[],r=t.map(Ku),n={};let i;null!=e.count?(i="times","number"==typeof e.count?n.quantity=kc(e.count,"number"):"object"==typeof e.count&&(n.quantity=Uu(e.count))):e.whileCondition&&"object"==typeof e.whileCondition?(i="while",n.condition=Uu(e.whileCondition)):"string"==typeof e.untilEvent?(i="until",n.condition=kc(e.untilEvent)):i="forever";return Lc("repeat",n,i,r)}(e);case"foreach":return function(e){const t=Array.isArray(e.body)?e.body:[],r=t.map(Ku),n={};e.collection&&"object"==typeof e.collection&&(n.source=Uu(e.collection));const i="string"==typeof e.itemName?e.itemName:void 0,a="string"==typeof e.indexName?e.indexName:void 0;return Lc("repeat",n,"for",r,i,a)}(e);case"while":return function(e){const t=Array.isArray(e.body)?e.body:[],r=t.map(Ku),n={};e.condition&&"object"==typeof e.condition&&(n.condition=Uu(e.condition));return Lc("repeat",n,"while",r)}(e);default:return Tc("get",{patient:Uu(e)})}}function Fu(e,t){const[r,...n]=e,i=Uu(r.condition),a=r.body.map(Ku);let o;return n.length>0?o=[Fu(n,t)]:t&&t.length>0&&(o=t.map(Ku)),Cc("if",{condition:i},a,o)}function Uu(e){switch(e.type){case"literal":return function(e){const t=e.value;if(null==t)return kc("null");return kc(t,"number"==typeof t?"number":"boolean"==typeof t?"boolean":void 0)}(e);case"selector":return wc((e.value??"")+"",Qu((e.value??"")+""));case"identifier":return function(e){const t=(e.value??"")+"";if(Ic.has(t))return bc(t);return kc(t)}(e);case"variable":return function(e){const t=(e.name??"")+"";switch((e.scope??"local")+""){case"element":return xc(":"+t);case"global":return xc("$"+t);default:return xc(t)}}(e);case"possessive":return zc(e.object&&"object"==typeof e.object?Uu(e.object):bc("me"),(e.property??"")+"");case"binary":case"unary":case"member":case"call":case"positional":return xc(Gu(e));default:return"value"in e?kc((e.value??"")+""):xc(Gu(e))}}function Gu(e){if(!e||"object"!=typeof e)return"";switch(e.type){case"literal":{const t=e.value;return null==t?"null":"string"==typeof t?/\s/.test(t)?`"${t}"`:t:t+""}case"identifier":case"selector":return(e.value??"")+"";case"variable":{const t=(e.name??"")+"",r=(e.scope??"local")+"";return"element"===r?":"+t:"global"===r?"$"+t:t}case"binary":{const t=e.left&&"object"==typeof e.left?Gu(e.left):"",r=e.right&&"object"==typeof e.right?Gu(e.right):"";return`${t} ${e.operator??""} ${r}`}case"unary":{const t=e.operand&&"object"==typeof e.operand?Gu(e.operand):"";return`${e.operator??""} ${t}`}case"member":{const t=e.object&&"object"==typeof e.object?Gu(e.object):"";if(e.computed&&e.property&&"object"==typeof e.property)return`${t}[${Gu(e.property)}]`;return`${t}.${"string"==typeof e.property?e.property:e.property&&"object"==typeof e.property?Gu(e.property):""}`}case"possessive":return`${e.object&&"object"==typeof e.object?Gu(e.object):""}'s ${e.property??""}`;case"call":return`${e.callee&&"object"==typeof e.callee?Gu(e.callee):""}(${Array.isArray(e.args)?e.args.map(e=>Gu(e)).join(", "):""})`;case"positional":{const t=e.target&&"object"==typeof e.target?Gu(e.target):"";return t?`${e.position??""} ${t}`:(e.position??"")+""}default:return"value"in e?(e.value??"")+"":""}}var Zu=new Set(["to","of","the","top","bottom","middle","center","nearest","left","right","smoothly","instantly"]),Yu=new Set(["url"]),Xu=new Set(["partials","in"]);function Ju(e,t){for(const r of e){if("identifier"===r.type){const e="string"==typeof r.name?r.name:r.value;if("string"==typeof e&&t.has(e))continue}return r}}function Qu(e){if(e)return e.startsWith("#")?"id":e.startsWith(".")?"class":e.startsWith("[")?"attribute":e.startsWith("<")||e.startsWith("*")?"element":/[>\+~ ]/.test(e)&&e.length>1?"complex":void 0}function ep(e){switch(e.kind){case"event-handler":return function(e){const t=e.roles.get("event"),r=t&&"value"in t?t.value+"":"click",n={};e.eventModifiers&&(e.eventModifiers.once&&(n.once=!0),e.eventModifiers.debounce&&(n.debounce=e.eventModifiers.debounce),e.eventModifiers.throttle&&(n.throttle=e.eventModifiers.throttle),e.eventModifiers.queue&&(n.queue=e.eventModifiers.queue));return{type:"event",event:r,modifiers:n,body:(e.body??[]).map(ep)}}(e);case"conditional":return function(e){const t=e.roles.get("condition");return{type:"command",name:"if",args:t?[tp(t)]:[],condition:t?tp(t):void 0,thenBranch:(e.thenBranch??[]).map(ep),elseBranch:(e.elseBranch??[]).map(ep)}}(e);case"loop":return function(e){const t=e.roles.get("patient")||e.roles.get("count");return{type:"command",name:"repeat",args:t?[tp(t)]:[],loopVariant:e.loopVariant??"forever",body:(e.body??[]).map(ep),loopVariable:e.loopVariable,indexVariable:e.indexVariable}}(e);case"compound":return{type:"CommandSequence",commands:(e.statements??[]).map(ep)};default:return function(e){const t={},r=[];for(const[n,i]of e.roles){const e=tp(i);t[n]=e,r.push(e)}return{type:"command",name:e.action,args:r,roles:t}}(e)}}function tp(e){switch(e.type){case"selector":return{type:"selector",value:e.value};case"reference":return{type:"identifier",value:e.value};case"literal":{const t=e;if("duration"===t.dataType){const e=/^(\d+(?:\.\d+)?)(ms|s)$/.exec(t.value+"");if(e){return{type:"literal",value:"s"===e[2]?1e3*parseFloat(e[1]):parseFloat(e[1])}}}return{type:"literal",value:t.value}}case"property-path":{const t=e;return{type:"member",object:tp(t.object),property:t.property}}case"expression":return{type:"expression",value:e.raw};case"flag":return{type:"literal",value:e.enabled};default:return{type:"literal",value:(e.value??"")+""}}}var rp=class{constructor(e,t=new Set){this.patterns=new Map,this.tokenizers=new Map,this.schemas=e.schemas,this.partiallyTranslatedActions=t;for(const t of e.languages)this.registerLanguage(t)}registerLanguage(e){this.tokenizers.set(e.code,e.tokenizer);const t=[];for(const r of this.schemas){if(this.partiallyTranslatedActions.has(r.action)&&!e.patternProfile.keywords[r.action])continue;const n=hu(r,e.patternProfile);t.push(n)}this.patterns.set(e.code,t)}getPatterns(e){return this.patterns.get(e)||[]}getTokenizer(e){return this.tokenizers.get(e)}getSupportedLanguages(){return Array.from(this.patterns.keys())}},np=class{constructor(e,t,r,n){this.registry=t,this.matcher=new du,this.transformer=r,this.profileProvider=n,e.codeGenerator&&(this.codeGenerator=e.codeGenerator),e.renderer&&(this.domainRenderer=e.renderer),this.extensionRenderers=new Map;for(const t of e.extensions??[])t.render&&this.extensionRenderers.set(t.schema.action,t.render);this.schemaFallbackRenderer=xu({schemas:e.schemas,profiles:e.languages.map(e=>e.patternProfile)});const i=new Map(e.schemas.map(e=>[e.action,e]));this.schemaLookup={getSchema:e=>i.get(e)}}parse(e,t){return this.parseWithConfidence(e,t).node}parseWithConfidence(e,t){if($c(e)){const t=qc(e,{schemaLookup:this.schemaLookup});if(!this.schemaLookup.getSchema(t.action))throw Error(`No schema for action "${t.action}" in this DSL`);return{node:t,confidence:1}}const r=this.registry.getTokenizer(t);if(!r)throw Error("No tokenizer registered for language: "+t);const n=r.tokenize(e),i=this.registry.getPatterns(t),a={code:t};for(const r of i){const i=this.matcher.matchPattern(n,r,a);if(i){return{node:{kind:"command",action:r.command,roles:i.captured,metadata:{sourceLanguage:t,sourceText:e,patternId:r.id,confidence:i.confidence}},confidence:i.confidence}}}throw Error("No pattern matched for input: "+e)}validate(e,t){try{return{valid:!0,node:this.parseWithConfidence(e,t).node}}catch(e){return{valid:!1,errors:[e instanceof Error?e.message:e+""]}}}translate(e,t,r){if($c(e))return e;let n;try{n=this.parseWithConfidence(e,t).node}catch(n){if(this.hasGrammarProfile(t)&&this.hasGrammarProfile(r))return this.transformer.transform(e,t,r);throw n}const i=this.registry.getSupportedLanguages().includes(r)?this.render(n,r):null;if(null!=i)return i;if(this.hasGrammarProfile(t)&&this.hasGrammarProfile(r))return this.transformer.transform(e,t,r);throw Error(`translate() could not render action "${n.action}" in language "${r}": no custom renderer, domain renderer, or schema pattern covers it, and no grammar profile is configured for the transformer fallback. Either add "${r}" to the DSL's languages/renderer, or set 'grammarProfile' on its LanguageConfig in createMultilingualDSL() (parse/validate/compile do not need it).`)}hasGrammarProfile(e){return null!=this.profileProvider.getProfile(e)}compile(e,t){if(!this.codeGenerator)return{ok:!1,errors:["No code generator configured for this DSL"]};try{const r=this.parseWithConfidence(e,t);return{ok:!0,code:this.codeGenerator.generate(r.node),node:r.node,metadata:{parser:"semantic",confidence:r.confidence}}}catch(e){return{ok:!1,errors:[e instanceof Error?e.message:e+""]}}}render(e,t){const r=this.extensionRenderers.get(e.action);if(r){const n=r(e,t);if(null!=n)return n}if(this.domainRenderer){const r=this.domainRenderer(e,t);if(null!=r)return r}return this.schemaFallbackRenderer(e,t)}getSupportedLanguages(){return this.registry.getSupportedLanguages()}};function ip(e){const t=e.outputFormat??"both",r=e.examplesPerCommand??2,n=[op(),sp(),lp(e.schemas,t,r),cp(t),up()];let i=n;e.maxTokens&&e.maxTokens>0&&(i=function(e,t){const r=[];let n=t;for(const t of e){if(t.approximateTokens>n){const e=t.content.slice(0,Math.max(4*n,40))+"\n\n*(truncated)*";r.push({...t,content:e,approximateTokens:yp(e)});break}r.push(t),n-=t.approximateTokens}return r}(n,e.maxTokens));const a=i.map(e=>`## ${e.title}\n\n${e.content}`).join("\n\n---\n\n"),o=e.schemas.reduce((e,t)=>e+t.roles.length,0),s=yp(a);return{text:a,sections:i,metadata:{domain:e.domain,commandCount:e.schemas.length,roleCount:o,approximateTokens:s}}}function ap(e,t=2){const r=function(e){const t=e.roles.filter(e=>e.required),r=e.roles.filter(e=>!e.required),n=[];t.length>0&&n.push(t);for(const e of r)n.push([...t,e]);2>r.length||n.push([...t,...r]);0===n.length&&n.push(e.roles.slice());return n}(e),n=[];for(let i=0;Math.min(t,r.length)>i;i++){const t=r[i],a=new Map;for(const e of t){const t=mp(e);a.set(e.role,t)}const o=new Map;for(const[e,t]of a)o.set(e,fp(t));const s=Zc(Tc(e.action,o)),l={};for(const[e,t]of a)l[e]=t;n.push({explicit:s,json:{action:e.action,roles:l}})}return n}function op(){const e='LokaScript Explicit Syntax (LSE) is a bracket-based format for imperative commands.\n\n### Syntax\n\n```\n[command role1:value1 role2:value2 +flag1 ~flag2]\n```\n\n- **Command**: The first token inside brackets (lowercased)\n- **Role pair**: `name:value` \u2014 a named semantic role with a typed value (no space around colon)\n- **Enabled flag**: `+name` \u2014 boolean attribute present\n- **Disabled flag**: `~name` \u2014 boolean attribute negated\n- **Nested body**: `body:[command ...]` \u2014 a bracket command inside a role value\n\n### Rules\n\n1. Commands are always lowercased\n2. Role names preserve their original case\n3. No spaces around the colon in role:value pairs\n4. Strings with spaces must be quoted: `patient:"hello world"`\n5. Selectors start with `#`, `.`, `[`, `@`, or `*`\n6. A selector containing a space, a combinator (`>` `+` `~`), or a comma must use a selector literal: `patient:<ul > li/>`, `patient:<.a, .b/>`\n7. Inside a structural role (`body`, `then`, `else`, `condition`, `loop-body`, `variable`, `catch`, `finally`) a `[...]` value is always a nested command. Write an attribute selector there as `condition:<[data-active]/>`\n8. Output must be valid bracket syntax: `[action role:value ...]`';return{id:"protocol",title:"LSE Protocol",content:e,approximateTokens:yp(e)}}function sp(){const e="Values in LSE are classified by their syntactic form (first match wins):\n\n| Type | Syntax | Example |\n|------|--------|---------|\n| Selector literal | Delimited by `<` and `/>` | `<ul > li/>`, `<.a, .b/>`, `<[data-id]/>` |\n| Selector | Starts with `#` `.` `[` `@` `*` | `#button`, `.active`, `[data-id]` |\n| String | Quoted with `\"` or `'` | `\"hello world\"`, `'json'` |\n| Boolean | Exact: `true` / `false` | `visible:true` |\n| Reference | Built-in name | `me`, `you`, `it`, `result`, `event`, `target`, `body` |\n| Duration | Number + suffix | `500ms`, `2s`, `1m`, `1h` |\n| Number | Digits with optional decimal | `5`, `3.14`, `-1` |\n| Plain | Fallback (any non-whitespace) | `/api/users`, `json`, `production` |\n\n**Important**: Classification is by prefix, not by intent. `#true` is a selector (not boolean). `event` as a value is a reference (not plain text).";return{id:"value-types",title:"Value Types",content:e,approximateTokens:yp(e)}}function lp(e,t,r){const n=[];for(const i of e)n.push(pp(i,t,r));const i=n.join("\n\n");return{id:"commands",title:"Available Commands",content:i,approximateTokens:yp(i)}}function cp(e){let t;return t="explicit"===e?"Output valid LSE bracket syntax. Each command must be wrapped in brackets:\n\n```\n[command role:value ...]\n```\n\nDo NOT output JSON. Only use bracket syntax.":"json"===e?'Output valid JSON in the LLM-simplified format:\n\n```json\n{\n "action": "command-name",\n "roles": {\n "roleName": { "type": "valueType", "value": "theValue" }\n }\n}\n```\n\nValid value types: `selector`, `literal`, `reference`, `expression`.\nDo NOT output bracket syntax. Only use JSON.':'You may output EITHER format:\n\n**Bracket syntax** (preferred for single commands):\n```\n[command role:value ...]\n```\n\n**JSON format** (preferred when structured data is needed):\n```json\n{\n "action": "command-name",\n "roles": {\n "roleName": { "type": "valueType", "value": "theValue" }\n }\n}\n```\n\nBoth formats are equally valid. Use whichever is more natural for the context.',{id:"output-format",title:"Output Format",content:t,approximateTokens:yp(t)}}function up(){const e="If you're unsure about a command or role:\n\n1. **Unknown command**: Use the closest matching command from the Available Commands section. Do not invent commands.\n2. **Unknown role**: Use only the roles listed for each command. Do not add roles not in the schema.\n3. **Ambiguous value type**: When in doubt, use `expression` type (it's the most permissive).\n4. **Missing required role**: Always include all required roles. Check the Required/Optional labels.\n5. **Selector vs plain value**: If a value starts with `#`, `.`, `[`, `@`, or `*`, it's a selector. URLs like `/api/data` are plain values.\n\nWhen generating LSE, prefer explicit role labeling over positional guessing. Every value should have a role name.";return{id:"error-recovery",title:"Error Recovery",content:e,approximateTokens:yp(e)}}function pp(e,t,r){const n=[];n.push(`### \`${e.action}\` \u2014 ${e.description}`),n.push("");const i=e.roles.filter(e=>e.required),a=e.roles.filter(e=>!e.required);if(i.length>0){n.push("**Required roles:**");for(const e of i)n.push(`- \`${e.role}\`: ${e.description} (type: ${dp(e)})`)}if(a.length>0){n.push("**Optional roles:**");for(const e of a)n.push(`- \`${e.role}\`: ${e.description} (type: ${dp(e)})`)}const o=ap(e,r);if(o.length>0){if(n.push(""),"explicit"===t||"both"===t){n.push("**Bracket syntax:**");for(const e of o)n.push(`\`\`\`\n${e.explicit}\n\`\`\``)}if("json"===t||"both"===t){n.push("**JSON format:**");for(const e of o)n.push(`\`\`\`json\n${JSON.stringify(e.json,null,2)}\n\`\`\``)}}return n.join("\n")}function dp(e){return e.expectedTypes.join(" | ")}function mp(e){switch(e.expectedTypes[0]||"expression"){case"selector":return{type:"selector",value:{patient:".active",destination:"#output",source:"#input",target:"#target"}[t=e.role]||"#"+t};case"literal":return function(e){return{type:"literal",value:{duration:"30s",interval:"5s",delay:"500ms",timeout:"10s",quantity:5,limit:10,style:"json",manner:"rolling",format:"html"}[e]||e}}(e.role);case"reference":return{type:"reference",value:"me"};case"expression":return function(e){return{type:"expression",value:{source:"/api/data",destination:"#output",patient:".active",instrument:"toUpperCase",condition:"age > 18",style:"json",duration:"5s",url:"/api/users"}[e]||"/api/"+e}}(e.role);case"flag":return{type:"flag",value:!0};default:return{type:"literal",value:"example"}}var t}function fp(e){switch(e.type){case"selector":return{type:"selector",value:e.value+"",selectorKind:hp(e.value+"")};case"literal":return{type:"literal",value:e.value,dataType:"number"==typeof e.value?"number":"boolean"==typeof e.value?"boolean":"string"};case"reference":return{type:"reference",value:e.value+""};case"expression":return{type:"expression",value:e.value+"",raw:e.value+""};case"flag":return{type:"flag",value:e.value};default:return{type:"literal",value:e.value+"",dataType:"string"}}}function hp(e){return e.startsWith("#")?"id":e.startsWith(".")?"class":e.startsWith("[")?"attribute":"complex"}function yp(e){return Math.ceil(e.length/4)}function vp(e,t){const r=t.maxPairsPerCommand??5,n=t.minQuality??.5,i=t.shuffleRoles??!0,a=t.languages??["en"],o=[];let s=0;for(const l of e){const e=gp(l);for(const c of a){let a=0;for(const u of e){if(a>=r)break;const e=kp(l,u,c,t.domain,`${t.domain}-synth-${s++}`);if(n>e.quality||(o.push(e),a++),i&&u.length>=2&&r>a){const e=kp(l,[...u].reverse(),c,t.domain,`${t.domain}-synth-${s++}`);n>e.quality||(o.push(e),a++)}}}}return{pairs:o,metadata:{domain:t.domain,commandCount:e.length,pairCount:o.length,bySource:{synthetic:o.length},languages:a}}}function gp(e){const t=e.roles.filter(e=>e.required),r=e.roles.filter(e=>!e.required),n=[];t.length>0&&n.push(t);for(const e of r)n.push([...t,e]);return 2>r.length||n.push([...t,...r]),0===n.length&&n.push(e.roles.slice()),n}function kp(e,t,r,n,i){const a=new Map;for(const e of t)a.set(e.role,wp(e));const o=new Map;for(const[e,t]of a)o.set(e,bp(t));const s=Zc(Tc(e.action,o)),l={};for(const[e,t]of a)l[e]=t;const c={action:e.action,roles:l},u=function(e,t,r){const n=[e.action];for(const i of e.roles){const e=t.get(i.role);if(!e)continue;const a=i.markerOverride?.[r];a&&n.push(a),n.push(e.value+"")}return n.join(" ")}(e,a,r),p=e.roles.filter(e=>e.required).length,d=t.filter(e=>e.required).length;return{id:i,natural:u,language:r,explicit:s,json:c,domain:n,action:e.action,source:"synthetic",quality:p>0?d/p:.8}}function wp(e){switch(e.expectedTypes[0]||"expression"){case"selector":return{type:"selector",value:{patient:".active",destination:"#output",source:"#input",target:"#target"}[t=e.role]||"#"+t};case"literal":return function(e){return{type:"literal",value:{duration:"30s",interval:"5s",delay:"500ms",timeout:"10s",quantity:5,limit:10,style:"json",manner:"rolling",format:"html"}[e]||e}}(e.role);case"reference":return{type:"reference",value:"me"};case"expression":return function(e){return{type:"expression",value:{source:"/api/data",destination:"#output",patient:".active",instrument:"toUpperCase",condition:"age > 18",style:"json",duration:"5s",url:"/api/users"}[e]||"/api/"+e}}(e.role);case"flag":return{type:"flag",value:!0};default:return{type:"literal",value:"example"}}var t}function bp(e){switch(e.type){case"selector":return{type:"selector",value:e.value+"",selectorKind:zp(e.value+"")};case"literal":return{type:"literal",value:e.value,dataType:"number"==typeof e.value?"number":"boolean"==typeof e.value?"boolean":"string"};case"reference":return{type:"reference",value:e.value+""};case"expression":return{type:"expression",value:e.value+"",raw:e.value+""};case"flag":return{type:"flag",value:e.value};default:return{type:"literal",value:e.value+"",dataType:"string"}}}function zp(e){return e.startsWith("#")?"id":e.startsWith(".")?"class":e.startsWith("[")?"attribute":"complex"}function xp(e,t,r,n,i){const a=r.some(e=>"error"===e.severity),o=r.map(e=>function(e){const t=function(e){const t=(e.code||"").toLowerCase(),r=e.message.toLowerCase();if(t.includes("missing-role")||t.includes("missing_role")||r.includes("required role")||r.includes("missing role"))return"missing_role";if(t.includes("invalid-type")||t.includes("invalid_type")||t.includes("type-mismatch")||r.includes("invalid type")||r.includes("expected type"))return"invalid_type";if(t.includes("unknown-command")||t.includes("unknown_command")||r.includes("unknown command")||r.includes("not recognized")&&r.includes("command"))return"unknown_command";if(t.includes("unknown-role")||t.includes("unknown_role")||r.includes("unknown role")||r.includes("not recognized")&&r.includes("role"))return"unknown_role";if(t.includes("parse")||t.includes("syntax")||r.includes("syntax error")||r.includes("parse error")||r.includes("unexpected"))return"syntax_error";return}(e);return{severity:e.severity,code:e.code||"unknown",message:e.message,...e.suggestions?.[0]&&{suggestion:e.suggestions[0]},...t&&{fixType:t}}}(e)),s=function(e,t,r){const n=[],i=r&&t?t.getSchema(r):void 0;for(const t of e)if("error"===t.severity)switch(t.fixType){case"missing_role":if(i){const e=i.roles.filter(e=>e.required).map(e=>`'${e.role}' (${e.description}, type: ${e.expectedTypes.join("|")})`).join(", ");n.push(`Required roles for '${r}': ${e}`)}else n.push("Check that all required roles are present.");break;case"unknown_command":n.push("Command not recognized. Ensure you're using a valid command from the domain schema.");break;case"unknown_role":if(i){const e=i.roles.map(e=>`'${e.role}'`).join(", ");n.push(`Valid roles for '${r}': ${e}`)}else n.push("Use only roles defined in the command schema.");break;case"invalid_type":n.push("Check value types: selectors start with #.[@*, strings use quotes, numbers are plain digits.");break;case"syntax_error":n.push("Ensure bracket syntax: [command role:value ...]. No spaces around the colon.");break;default:t.suggestion&&n.push(t.suggestion)}return[...new Set(n)]}(o,n,i);let l,c;if(i&&n){const e=n.getSchema(i);e&&(l=function(e){const t=[],r=[],n={};for(const i of e.roles)i.required?t.push(i.role):r.push(i.role),n[i.role]=i.description;return{action:e.action,requiredRoles:t,optionalRoles:r,roleDescriptions:n}}(e),a&&(c=function(e){const t=new Map,r={};for(const n of e.roles){if(!n.required)continue;const e=Ep(n.role,n.expectedTypes[0]||"expression");t.set(n.role,Tp(e)),r[n.role]=e}const n=Tc(e.action,t),i=Zc(n),a={action:e.action,roles:r};return{explicit:i,json:a}}(e)))}return{accepted:!a,input:{format:t,text:e},diagnostics:o,hints:s,...l&&{schema:l},...c&&{correctedExample:c}}}function Ep(e,t){switch(t){case"selector":return{type:"selector",value:"#"+e};case"expression":default:return{type:"expression",value:`<${e}-value>`};case"literal":return{type:"literal",value:`<${e}-value>`};case"reference":return{type:"reference",value:"me"}}}function Tp(e){switch(e.type){case"selector":return{type:"selector",value:e.value,selectorKind:"id"};case"expression":return{type:"expression",value:e.value,raw:e.value};case"literal":default:return{type:"literal",value:e.value,dataType:"string"};case"reference":return{type:"reference",value:e.value}}}function Sp(e){const t=[],r=e.tools??["parse","compile","validate","translate"],n=e.languages.join(", ");for(const i of r)switch(i){case"parse":t.push({name:"parse_"+e.name,description:`Parse a ${e.description} input into a semantic representation (action, roles, confidence). Supports: ${n}.`,inputSchema:{type:"object",properties:{[e.inputLabel]:{type:"string",description:e.inputDescription},language:{type:"string",description:"Language code: "+n,default:"en"}},required:[e.inputLabel]}});break;case"compile":t.push({name:"compile_"+e.name,description:`Compile a ${e.description} input to ${e.outputDescription??"target code"}. Supports: ${n}.`,inputSchema:{type:"object",properties:{[e.inputLabel]:{type:"string",description:e.inputDescription},language:{type:"string",description:"Language code: "+n,default:"en"}},required:[e.inputLabel]}});break;case"validate":t.push({name:"validate_"+e.name,description:`Check ${e.description} syntax for errors. Returns {valid, errors[]}. Supports: ${n}.`,inputSchema:{type:"object",properties:{[e.inputLabel]:{type:"string",description:e.inputDescription+" to validate"},language:{type:"string",description:"Language code: "+n,default:"en"}},required:[e.inputLabel]}});break;case"translate":t.push({name:"translate_"+e.name,description:`Translate ${e.description} input between natural languages (requires 'from' and 'to' codes). Supports: ${n}.`,inputSchema:{type:"object",properties:{[e.inputLabel]:{type:"string",description:e.inputDescription+" to translate"},from:{type:"string",description:"Source language code: "+n},to:{type:"string",description:"Target language code: "+n}},required:[e.inputLabel,"from","to"]}})}return t}function Cp(e){const t=e.match(/^(parse|compile|validate|translate)_(.+)$/);return t?{operation:t[1],domain:t[2]}:null}function Ap(e,t,r=""){const n=e[t];return"string"==typeof n?n:r}function Lp(e,t){return{content:[{type:"text",text:JSON.stringify(e,null,2)}],...t&&{isError:!0}}}function jp(e){return Lp({error:"Missing required parameter: "+e},!0)}var Pp=/^\s*(\/\/|--|#)/;function Op(e){const t=e.trim();return""===t||Pp.test(t)}function Np(e){const t=[];for(const r of e){const e=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t.push(RegExp(e+'\\s*=\\s*"([^"]+)"',"g")),t.push(RegExp(e+"\\s*=\\s*'([^']+)'","g")),t.push(RegExp(e+"\\s*=\\s*`([^`]+)`","g"))}return t}function Rp(e){return e.map(e=>{const t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return RegExp(`<script[^>]*type=["']?${t}["']?[^>]*>([\\s\\S]*?)<\\/script>`,"gi")})}function Mp(e,t){let r=1;for(let n=0;t>n&&e.length>n;n++)"\n"===e[n]&&r++;return r}function Ip(e,t){const r=e.lastIndexOf("<",t);if(-1===r)return;const n=e.slice(r,t+200).match(/\bid=["']([^"']+)["']/);return n?.[1]}function Wp(e,t){const r=e.lastIndexOf("<",t);if(-1===r)return;const n=e.slice(r,t+200).match(/\blang=["']([^"']+)["']/);return n?.[1]}var _p=class{constructor(e){this.configs=e}extract(e,t){const r=[];for(const n of this.configs){const i=n.defaultLanguage??"en",a=Np(n.attributes);for(const o of a){let a;for(o.lastIndex=0;a=o.exec(e);){const o=a[1].trim();if(!o)continue;const s=Mp(e,a.index),l=Ip(e,a.index),c=Wp(e,a.index);r.push({domain:n.domain,code:o,language:c??i,file:t,line:s,column:1,...null!=l&&{elementId:l}})}}if(n.scriptTypes){const a=Rp(n.scriptTypes);for(const o of a){let a;for(o.lastIndex=0;a=o.exec(e);){const o=a[1].trim();if(!o)continue;const s=Mp(e,a.index);r.push({domain:n.domain,code:o,language:i,file:t,line:s,column:1})}}}}return r}async extractFromFiles(e,t){const r=[];for(const n of e)try{const e=await t(n),i=this.extract(e,n);r.push(...i)}catch{}return r}};var qp=class{constructor(e,t){this.pos=0,this.tokens=e,this.language=t}peek(e=0){const t=this.pos+e;return 0>t||t>=this.tokens.length?null:this.tokens[t]}advance(){if(this.isAtEnd())throw Error("Unexpected end of token stream");return this.tokens[this.pos++]}isAtEnd(){return this.pos>=this.tokens.length}mark(){return{position:this.pos}}reset(e){this.pos=e.position}position(){return this.pos}remaining(){return this.tokens.slice(this.pos)}takeWhile(e){const t=[];for(;!this.isAtEnd()&&e(this.peek());)t.push(this.advance());return t}skipWhile(e){for(;!this.isAtEnd()&&e(this.peek());)this.advance()}};function $p(e,t){return{start:e,end:t}}function Vp(e,t,r,n){if("object"==typeof e){const{value:t,kind:r,position:n,normalized:i,stem:a,stemConfidence:o,metadata:s}=e;return{value:t,kind:r,position:n,...void 0!==i&&{normalized:i},...void 0!==a&&{stem:a},...void 0!==o&&{stemConfidence:o},...void 0!==s&&{metadata:s}}}const i=e;if(!t||!r)throw Error("createToken requires kind and position parameters");if("string"==typeof n)return{value:i,kind:t,position:r,normalized:n};if(n){const{normalized:e,stem:a,stemConfidence:o,metadata:s}=n;return{value:i,kind:t,position:r,...void 0!==e&&{normalized:e},...void 0!==a&&{stem:a},...void 0!==o&&{stemConfidence:o},...void 0!==s&&{metadata:s}}}return{value:i,kind:t,position:r}}function Dp(e){return/\s/.test(e)}function Bp(e){return"#"===e||"."===e||"["===e||"@"===e||"*"===e||"<"===e}function Hp(e){return'"'===e||"'"===e||"`"===e||"\u300c"===e||"\u300d"===e}function Kp(e){return/\d/.test(e)}function Fp(e){return e.replace(/[\u064b-\u0652\u0670]/g,"")}function Up(e){return/[a-zA-Z]/.test(e)}function Gp(e){return/[a-zA-Z0-9_-]/.test(e)}function Zp(e,t){if(t>=e.length)return null;const r=e[t];if(!Bp(r))return null;let n=t,i="";if("#"===r||"."===r){for(i+=e[n++];e.length>n&&Gp(e[n]);)i+=e[n++];if(1>=i.length)return null;if(e.length>n&&"."===e[n]&&"#"===r){let t=n+1;for(;e.length>t&&Gp(e[t]);)t++;if(e.length>t&&"("===e[t])return i}}else if("["===r){let t=1,r=!1,a=null,o=!1;for(i+=e[n++];e.length>n&&t>0;){const s=e[n];i+=s,o?o=!1:"\\"===s?o=!0:r?s===a&&(r=!1,a=null):'"'===s||"'"===s||"`"===s?(r=!0,a=s):"["===s?t++:"]"===s&&t--,n++}if(0!==t)return null}else if("@"===r){for(i+=e[n++];e.length>n&&Gp(e[n]);)i+=e[n++];if(1>=i.length)return null}else if("*"===r){for(i+=e[n++];e.length>n&&Gp(e[n]);)i+=e[n++];if(1>=i.length)return null}else if("<"===r){if(i+=e[n++],n>=e.length||!Up(e[n]))return null;for(;e.length>n&&Gp(e[n]);)i+=e[n++];for(;e.length>n;){const t=e[n];if("."===t){if(i+=e[n++],n>=e.length||!Gp(e[n]))return null;for(;e.length>n&&Gp(e[n]);)i+=e[n++]}else if("#"===t){if(i+=e[n++],n>=e.length||!Gp(e[n]))return null;for(;e.length>n&&Gp(e[n]);)i+=e[n++]}else{if("["!==t)break;{let t=1,r=!1,a=null,o=!1;for(i+=e[n++];e.length>n&&t>0;){const s=e[n];i+=s,o?o=!1:"\\"===s?o=!0:r?s===a&&(r=!1,a=null):'"'===s||"'"===s||"`"===s?(r=!0,a=s):"["===s?t++:"]"===s&&t--,n++}if(0!==t)return null}}}for(;e.length>n&&Dp(e[n]);)i+=e[n++];if(e.length>n&&"/"===e[n])for(i+=e[n++];e.length>n&&Dp(e[n]);)i+=e[n++];if(n>=e.length||">"!==e[n])return null;i+=e[n++]}return i||null}function Yp(e,t){if(t>=e.length||"'"!==e[t])return!1;if(t+1>=e.length)return!1;if("s"!==e[t+1].toLowerCase())return!1;if(t+2>=e.length)return!0;const r=e[t+2];return Dp(r)||"*"===r||!Gp(r)}function Xp(e,t){if(t>=e.length)return null;const r=e[t];if(!Hp(r))return null;if("'"===r&&Yp(e,t))return null;const n={'"':'"',"'":"'","`":"`","\u300c":"\u300d"}[r];if(!n)return null;let i=t+1,a=r,o=!1;for(;e.length>i;){const t=e[i];if(a+=t,o)o=!1;else if("\\"===t)o=!0;else if(t===n)return a;i++}return a}function Jp(e,t){if(t>=e.length)return!1;const r=e[t],n=e[t+1]||"",i=e[t+2]||"";if("/"===r&&"/"!==n&&/[a-zA-Z0-9._-]/.test(n))return!0;if("/"===r&&"/"===n&&/[a-zA-Z]/.test(i))return!0;if("."===r&&("/"===n||"."===n&&"/"===i))return!0;const a=e.slice(t,t+8).toLowerCase();return!(!a.startsWith("http://")&&!a.startsWith("https://"))}function Qp(e,t){if(!Jp(e,t))return null;let r=t,n="";const i=/[a-zA-Z0-9/:._\-?&=%@+~!$'()*,;[\]]/;for(;e.length>r;){const t=e[r];if("#"===t){if(n.length>0&&/[a-zA-Z0-9/.]$/.test(n))for(n+=t,r++;e.length>r&&/[a-zA-Z0-9_-]/.test(e[r]);)n+=e[r++];break}if(!i.test(t))break;n+=t,r++}return 2>n.length?null:n}function ed(e,t){if(t>=e.length)return null;const r=e[t];if(!Kp(r)&&"-"!==r&&"+"!==r)return null;let n=t,i="";if("-"!==e[n]&&"+"!==e[n]||(i+=e[n++]),n>=e.length||!Kp(e[n]))return null;for(;e.length>n&&Kp(e[n]);)i+=e[n++];if(e.length>n&&"."===e[n])for(i+=e[n++];e.length>n&&Kp(e[n]);)i+=e[n++];if(e.length>n){"ms"===e.slice(n,n+2)?i+="ms":"s"!==e[n]&&"m"!==e[n]&&"h"!==e[n]||(i+=e[n])}return i}var td=["===","!==","->","==","!=","<=",">=","&&","||","**","+=","-=","*=","/=","+","-","*","/","=",">","<","!","&","|","%","^","~"],rd=class{constructor(e=td){this.operators=e,this.name="operator",this.operators=[...e].sort((e,t)=>t.length-e.length)}canExtract(e,t){return this.operators.some(r=>e.startsWith(r,t))}extract(e,t){for(const r of this.operators)if(e.startsWith(r,t))return{value:r,length:r.length};return null}},nd="()[]{},:;",id=class{constructor(e=nd){this.punctuation=e,this.name="punctuation"}canExtract(e,t){return this.punctuation.includes(e[t])}extract(e,t){const r=e[t];return this.punctuation.includes(r)?{value:r,length:1}:null}};function ad(){return[new Ou,new Nu,new rd,new id,new Ru,new Mu]}var od=new Set(td),sd=new Set(["patient","destination","source","style","event","eventMarker","agent","goal","manner","into","from","to","with","at","of","as","by","in","on","over","under","between","through","without"]),ld=["click","dblclick","input","change","submit","keydown","keyup","keypress","mousedown","mouseup","mouseover","mouseout","mouseenter","mouseleave","mousemove","pointerdown","pointerup","pointermove","focus","blur","load","resize","scroll"],cd=class e{constructor(){this.profileKeywords=[],this.multiWordKeywords=[],this.profileKeywordMap=new Map,this.rawExtraEntries=[],this.extractors=[]}getExtraKeywordEntries(){return this.rawExtraEntries}tokenize(e){if(this.isUsingExtractors())return this.tokenizeWithExtractors(e);throw Error(this.constructor.name+": tokenize() not implemented and no extractors registered. Either register extractors or override tokenize() method.")}registerExtractor(e){$u(e)&&e.setContext(Vu(this)),this.extractors.push(e)}registerExtractors(e){for(const t of e)this.registerExtractor(t)}clearExtractors(){this.extractors=[]}isUsingExtractors(){return this.extractors.length>0}tokenizeWithExtractors(e){const t=[];let r=0;for(;e.length>r;){for(;e.length>r&&Dp(e[r]);)r++;if(r>=e.length)break;const n=this.tryMultiWordKeyword(e,r);if(n){t.push(n),r=n.position.end;continue}let i=!1;for(const n of this.extractors)if(n.canExtract(e,r)){const a=n.extract(e,r);if(a){const e=a.metadata?.normalized,n=a.metadata?.stem,o=a.metadata?.stemConfidence,s={};if(a.metadata)for(const[e,t]of Object.entries(a.metadata))"normalized"!==e&&"stem"!==e&&"stemConfidence"!==e&&(s[e]=t);const l={};e&&(l.normalized=e),n&&(l.stem=n),void 0!==o&&(l.stemConfidence=o),Object.keys(s).length>0&&(l.metadata=s),t.push(Vp(a.value,this.classifyToken(a.value),$p(r,r+a.length),Object.keys(l).length>0?l:void 0)),r+=a.length,i=!0;break}}if(!i){const n=e[r],i=this.classifyUnknownChar(n);t.push(Vp(n,i,$p(r,r+1))),r++}}return new qp(this.mergeColonQualifiedNames(t),this.language)}mergeColonQualifiedNames(t){const r=[];for(const n of t){const t=r[r.length-1];if(t&&e.ASCII_WORD.test(t.value)&&e.COLON_QUALIFIER.test(n.value)&&t.position.end===n.position.start){const e=t.value+n.value;r[r.length-1]=Vp(e,this.classifyToken(e),$p(t.position.start,n.position.end));continue}r.push(n)}return r}classifyUnknownChar(e){return"()[]{},:;".includes(e)?"punctuation":"+-*/<>=!&|".includes(e)?"operator":"identifier"}tryPropertyAccess(e,t,r){if("."!==e[t])return!1;const n=r[r.length-1];if(n&&!(n&&t>n.position.end)&&("identifier"===n.kind||"keyword"===n.kind||"selector"===n.kind))return r.push(Vp(".","operator",$p(t,t+1))),!0;let i=t+1;for(;e.length>i&&Gp(e[i]);)i++;return e.length>i&&"("===e[i]&&(r.push(Vp(".","operator",$p(t,t+1))),!0)}initializeKeywordsFromProfile(e,t=[]){const r=new Map;if(this.rawExtraEntries=t,e.keywords)for(const[t,n]of Object.entries(e.keywords))if(r.set(n.primary,{native:n.primary,normalized:n.normalized||t}),n.alternatives)for(const e of n.alternatives)r.set(e,{native:e,normalized:n.normalized||t});if(e.references){for(const[t,n]of Object.entries(e.references))r.set(n,{native:n,normalized:t});for(const t of Object.keys(e.references))r.has(t)||r.set(t,{native:t,normalized:t})}if(e.roleMarkers)for(const[t,n]of Object.entries(e.roleMarkers))if(n.primary&&r.set(n.primary,{native:n.primary,normalized:t}),n.alternatives)for(const e of n.alternatives)r.set(e,{native:e,normalized:t});if(e.possessive?.keywords)for(const[t,n]of Object.entries(e.possessive.keywords))r.set(t,{native:t,normalized:n});for(const e of ld)r.has(e)||r.set(e,{native:e,normalized:e});for(const e of t)r.set(e.native,e);this.profileKeywords=Array.from(r.values()).sort((e,t)=>t.native.length-e.native.length),this.multiWordKeywords=this.profileKeywords.filter(e=>e.native.includes(" ")&&!sd.has(e.normalized)),this.profileKeywordMap=new Map;for(const e of this.profileKeywords){this.profileKeywordMap.set(e.native.toLowerCase(),e);const t=this.removeDiacritics(e.native);t===e.native||this.profileKeywordMap.has(t.toLowerCase())||this.profileKeywordMap.set(t.toLowerCase(),e)}}removeDiacritics(e){return Fp(e)}tryProfileKeyword(e,t){for(const r of this.profileKeywords)if(e.slice(t).startsWith(r.native))return Vp(r.native,"keyword",$p(t,t+r.native.length),r.normalized);return null}tryMultiWordKeyword(e,t,r=e=>/[\p{L}\p{N}_]/u.test(e)){if(0===this.multiWordKeywords.length)return null;const n=e.slice(t);for(const i of this.multiWordKeywords){if(!n.startsWith(i.native))continue;const a=e[t+i.native.length];if(void 0===a||!r(a))return Vp(i.native,"keyword",$p(t,t+i.native.length),i.normalized)}return null}isKeywordStart(e,t){const r=e.slice(t);return this.profileKeywords.some(e=>r.startsWith(e.native))}isKeywordStartAtBoundary(e,t,r=e=>/[\p{L}\p{N}_]/u.test(e)){const n=e.slice(t);return this.profileKeywords.some(i=>{if(!n.startsWith(i.native))return!1;const a=e[t+i.native.length];return void 0===a||!r(a)})}lookupKeyword(e){const t=this.profileKeywordMap.get(e.toLowerCase());if(t)return t;const r=this.removeDiacritics(e);return r!==e?this.profileKeywordMap.get(r.toLowerCase()):void 0}isKeyword(e){return void 0!==this.lookupKeyword(e)}setNormalizer(e){this.normalizer=e}tryNormalize(e){if(!this.normalizer)return null;const t=this.normalizer.normalize(e);return t.stem===e||.7>t.confidence?null:t}tryMorphKeywordMatch(e,t,r){const n=this.tryNormalize(e);if(!n)return null;const i=this.lookupKeyword(n.stem);if(!i)return null;const a={normalized:i.normalized,stem:n.stem,stemConfidence:n.confidence};return Vp(e,"keyword",$p(t,r),a)}trySelector(e,t){const r=Zp(e,t);return r?Vp(r,"selector",$p(t,t+r.length)):null}tryEventModifier(e,t){if("."!==e[t])return null;const r=e.slice(t).match(/^\.(?:once|debounce|throttle|queue)(?:\(([^)]+)\))?(?:\s|$|\.)/);if(!r)return null;const n=r[0].replace(/(\s|\.)$/,""),i=n.slice(1).split("(")[0],a=r[1];return{...Vp(n,"event-modifier",$p(t,t+n.length)),metadata:{modifierName:i,value:a?"queue"===i?a:parseInt(a,10):void 0}}}tryString(e,t){const r=Xp(e,t);return r?Vp(r,"literal",$p(t,t+r.length)):null}tryNumber(e,t){const r=ed(e,t);return r?Vp(r,"literal",$p(t,t+r.length)):null}tryMatchTimeUnit(e,t,r,n=!1){let i=t;if(n)for(;e.length>i&&Dp(e[i]);)i++;const a=e.slice(i);for(const e of r){const t=a.slice(0,e.length);if(e.caseInsensitive?t.toLowerCase()===e.pattern.toLowerCase():t===e.pattern){if(e.notFollowedBy){if((a[e.length]||"")===e.notFollowedBy)continue}if(e.checkBoundary){if(Gp(a[e.length]||""))continue}return{suffix:e.suffix,endPos:i+e.length}}}return null}parseBaseNumber(e,t,r=!0){let n=t,i="";if(!r||"-"!==e[n]&&"+"!==e[n]||(i+=e[n++]),n>=e.length||!Kp(e[n]))return null;for(;e.length>n&&Kp(e[n]);)i+=e[n++];if(e.length>n&&"."===e[n])for(i+=e[n++];e.length>n&&Kp(e[n]);)i+=e[n++];return i&&"-"!==i&&"+"!==i?{number:i,endPos:n}:null}tryNumberWithTimeUnits(t,r,n,i={}){const{allowSign:a=!0,skipWhitespace:o=!1}=i,s=this.parseBaseNumber(t,r,a);if(!s)return null;let{number:l,endPos:c}=s;const u=[...n,...e.STANDARD_TIME_UNITS],p=this.tryMatchTimeUnit(t,c,u,o);return p&&(l+=p.suffix,c=p.endPos),Vp(l,"literal",$p(r,c))}tryUrl(e,t){const r=Qp(e,t);return r?Vp(r,"url",$p(t,t+r.length)):null}tryVariableRef(e,t){if(":"!==e[t])return null;if(t+1>=e.length)return null;if(!Gp(e[t+1]))return null;let r=t+1;for(;e.length>r&&Gp(e[r]);)r++;return Vp(e.slice(t,r),"identifier",$p(t,r))}tryOperator(e,t){const r=e.slice(t,t+2);if(["==","!=","<=",">=","&&","||","->"].includes(r))return Vp(r,"operator",$p(t,t+2));const n=e[t];return["<",">","!","+","-","*","/","="].includes(n)?Vp(n,"operator",$p(t,t+1)):["(",")","{","}",",",";",":"].includes(n)?Vp(n,"punctuation",$p(t,t+1)):null}tryMultiCharParticle(e,t,r){for(const n of r)if(e.slice(t,t+n.length)===n)return Vp(n,"particle",$p(t,t+n.length));return null}};cd.ASCII_WORD=/^[A-Za-z_][A-Za-z0-9_]*$/,cd.COLON_QUALIFIER=/^:[A-Za-z_][A-Za-z0-9_]*$/,cd.STANDARD_TIME_UNITS=[{pattern:"ms",suffix:"ms",length:2},{pattern:"s",suffix:"s",length:1,checkBoundary:!0},{pattern:"m",suffix:"m",length:1,checkBoundary:!0,notFollowedBy:"s"},{pattern:"h",suffix:"h",length:1,checkBoundary:!0}];var ud=cd;function pd(e){const{language:t,direction:r="ltr",keywords:n,keywordExtras:i,keywordProfile:a,includeOperators:o=!1,caseInsensitive:s=!0,customExtractors:l}=e,c=new Set(s?n.map(e=>e.toLowerCase()):n);return new class extends ud{constructor(){super(),this.language=t,this.direction=r,l&&this.registerExtractors(l),this.registerExtractors(ad()),a&&this.initializeKeywordsFromProfile(a,i)}classifyToken(e){const t=s?e.toLowerCase():e;return c.has(t)||this.isKeyword(e)?"keyword":/^\d/.test(e)||/^['"]/.test(e)?"literal":o&&od.has(e)?"operator":"identifier"}}}function dd(e,t){const r={},n=(e,t)=>{t?.primary?r[e]={primary:t.primary,...t.alternatives?.length&&{alternatives:[...t.alternatives]},...t.position&&{position:t.position}}:delete r[e]};for(const[t,r]of Object.entries(e.roleMarkers??{}))n(t,r);for(const[e,r]of Object.entries(t.roleMarkerOverrides??{}))n(e,r);return r}function md(e,t){const r={};for(const[e,n]of Object.entries(t.keywords))r[e]={primary:n.primary,...n.alternatives?.length&&{alternatives:[...n.alternatives]}};const n=dd(e,t);return{code:e.code,wordOrder:e.wordOrder,keywords:r,...Object.keys(n).length>0&&{roleMarkers:n}}}function fd(e,t,r={}){const n=dd(e,t),i=new Set;for(const e of Object.values(t.keywords)){i.add(e.primary);for(const t of e.alternatives??[])i.add(t)}for(const e of Object.values(n)){i.add(e.primary);for(const t of e.alternatives??[])i.add(t)}for(const t of e.tokenization?.particles??[])i.add(t);for(const e of t.tokenizerKeywords??[])i.add(e);const a={};for(const[e,r]of Object.entries(t.keywords))a[e]={primary:r.primary,...r.alternatives?.length&&{alternatives:[...r.alternatives]},normalized:r.normalized??e};const o={keywords:a,...Object.keys(n).length>0&&{roleMarkers:n}},s=[...r.customExtractors??[],..."latin"===e.script?[new Iu]:[]];return pd({language:e.code,direction:e.direction??"ltr",keywords:[...i],...t.keywordExtras?.length&&{keywordExtras:t.keywordExtras.map(e=>({...e}))},keywordProfile:o,includeOperators:r.includeOperators??!1,caseInsensitive:r.caseInsensitive??(l=e.script,void 0===l||"latin"===l||"cyrillic"===l),...s.length>0&&{customExtractors:s}});var l}function hd(e){return t=>{const r=t.charCodeAt(0);return e.some(([e,t])=>r>=e&&t>=r)}}function yd(e){return{stem:e,confidence:1}}function vd(e,t,r){return r?{stem:e,confidence:t,metadata:r}:{stem:e,confidence:t}}var gd=class{constructor(e){this.language=e.language,this.config={minWordLength:3,minStemLength:2,...e}}normalize(e){const t=e.toLowerCase();if(this.isAlreadyNormalized(t))return yd(e);if(this.config.reflexiveSuffixes){const e=this.tryReflexiveNormalization(t);if(e)return e}if(this.config.endings){const e=this.tryConjugationEndings(t);if(e)return e}if(this.config.suffixRules){const e=this.trySuffixRules(t);if(e)return e}if(this.config.prefixRules){const e=this.tryPrefixRules(t);if(e)return e}return yd(e)}isAlreadyNormalized(e){return!!this.config.infinitiveEndings&&this.config.infinitiveEndings.some(t=>e.endsWith(t))}tryReflexiveNormalization(e){const t=this.config.reflexiveSuffixes;if(!t)return null;for(const r of t){if(!e.endsWith(r))continue;const t=e.slice(0,-r.length);if(this.isAlreadyNormalized(t))return vd(t,.88,{removedSuffixes:[r],conjugationType:"reflexive"});const n=this.tryConjugationEndings(t)||this.trySuffixRules(t);if(n&&n.stem!==t)return vd(n.stem,.95*n.confidence,{removedSuffixes:[r,...n.metadata?.removedSuffixes||[]],conjugationType:"reflexive"})}return null}tryConjugationEndings(e){const t=this.config.endings;if(!t)return null;const r=this.config.minStemLength??2;for(const n of t){if(!e.endsWith(n.ending))continue;const t=e.slice(0,-n.ending.length);if(r>t.length)continue;return vd(t+n.stem,n.confidence,{removedSuffixes:[n.ending],conjugationType:n.type})}return null}trySuffixRules(e){const t=this.config.suffixRules;if(!t)return null;const r=this.config.minStemLength??2;for(const n of t){if(!e.endsWith(n.pattern))continue;const t=e.slice(0,-n.pattern.length);if((n.minStemLength??r)>t.length)continue;return vd(t+(n.replacement||""),n.confidence,{removedSuffixes:[n.pattern],...n.conjugationType&&{conjugationType:n.conjugationType}})}return null}tryPrefixRules(e){const t=this.config.prefixRules;if(!t)return null;for(const r of t){if(!e.startsWith(r.pattern))continue;const t=e.slice(r.pattern.length);if(t.length>=(r.minRemaining??this.config.minStemLength??2))return vd(t,1-r.confidencePenalty,{removedPrefixes:[r.pattern]})}return null}};function kd(e){return{id:e.id,prompt:e.natural,completion:e.explicit,metadata:{domain:e.domain,action:e.action,language:e.language,source:e.source,quality:e.quality,...void 0!==e.confidence&&{confidence:e.confidence}}}}var wd=class{constructor(e,t){this.dsl=e,this.config=t}parse(e,t){const r=this.splitStatements(e,t),n=[],i=[];let a;for(const e of r){const r=this.classifyLine(e.text,t);let o=e.text;if(this.config.continuation){const r=this.resolveContinuation(e.text,t,a?.category);null!==r&&(o=r)}if(this.config.preprocessor){const n=this.config.preprocessor(o,r,t,{...null!=a&&{previous:a},lineNumber:e.line,indent:e.indent});if(null===n)continue;o=n}try{const i={node:this.dsl.parse(o,t),source:e.text,line:e.line,...null!=r&&{category:r},indent:e.indent};n.push(i),a=i}catch(t){i.push({message:t instanceof Error?t.message:t+"",line:e.line,source:e.text,code:"parse-error"})}}return{statements:n,errors:i}}splitStatements(e,t){const{mode:r,trim:n=!0,commentPrefixes:i=["--","//"]}=this.config.split;if("delimiter"===r)return this.splitByDelimiter(e,t,n,i);const a=e.split("\n"),o=[];for(let e=0;a.length>e;e++){const t=a[e],r=t.length-t.trimStart().length,s=n?t.trim():t;s&&(i.some(e=>s.startsWith(e))||o.push({text:s,line:e+1,indent:r}))}return o}splitByDelimiter(e,t,r,n){const i=e.split(this.config.split.delimiters?.[t]??this.config.split.defaultDelimiter??/,\s*|\n\s*/),a=[];for(let e=0;i.length>e;e++){const t=i[e],o=r?t.trim():t;o&&(n.some(e=>o.startsWith(e))||a.push({text:o,line:e+1,indent:0}))}return a}classifyLine(e,t){if(!this.config.keywords)return;const r=e.toLowerCase(),n=this.config.keywords.wordOrders?.[t]??"SVO";for(const[e,i]of Object.entries(this.config.keywords.categories)){const a=i[t]??i.en??[];for(const t of a){const i=t.toLowerCase();if("SOV"===n){if(r.endsWith(i)||r.startsWith(i))return e}else if(r.startsWith(i))return e}}}resolveContinuation(e,t,r){if(!this.config.continuation||!r)return null;const n=this.config.continuation.keywords[t]??this.config.continuation.keywords.en??[],i=e.toLowerCase();for(const a of n){const n=a.toLowerCase();if(i.startsWith(n)){const n=e.slice(a.length).trim();if(!n)return null;if(this.config.continuation.resolve)return this.config.continuation.resolve(n,r,t,this.config.keywords?.categories??{});const i=this.config.keywords?.categories[r]?.[t]??this.config.keywords?.categories[r]?.en;return i?.[0]?i[0]+" "+n:null}}return null}};var bd,zd,xd,Ed=Object.freeze({__proto__:null,AOTOrchestrator:class{constructor(e){this.backends=new Map,this.options={confidenceThreshold:e?.confidenceThreshold??.7,continueOnError:e?.continueOnError??!0,debug:e?.debug??!1}}registerBackend(e){if(this.backends.has(e.domain))throw Error("Backend already registered for domain: "+e.domain);this.backends.set(e.domain,e)}async compileFiles(e,t){const r=Array.from(this.backends.values()).map(e=>e.scanConfig),n=new _p(r),i=await n.extractFromFiles(e,t),a=[],o=[],s={};for(const e of i){s[e.domain]=(s[e.domain]??0)+1;const t=this.compileSnippet(e);if("error"in t){if(o.push({domain:e.domain,source:e.code,file:e.file,line:e.line,message:t.error}),!this.options.continueOnError)break}else a.push(t)}return{compiled:a,errors:o,stats:{totalSnippets:i.length,compiledCount:a.length,errorCount:o.length,domainBreakdown:s}}}compileSnippet(e){const t=this.backends.get(e.domain);if(!t)return{error:"No backend registered for domain: "+e.domain};try{const r=t.dsl.compile(e.code,e.language);return r.ok&&r.code?{domain:e.domain,source:e.code,compiled:r.code,language:e.language,file:e.file,line:e.line}:{error:r.errors?.join("; ")??"Compilation failed"}}catch(e){return{error:e instanceof Error?e.message:e+""}}}generateOutput(e,t){const r=t?.format??"esm",n=t?.includeComments??!0,i=t?.groupByDomain??!0,a=[];if(n&&(a.push("// Generated by @lokascript/framework AOT compiler"),a.push(`// ${e.stats.compiledCount} snippets compiled, ${e.stats.errorCount} errors`),a.push("")),i){const t=new Map;for(const r of e.compiled){const e=t.get(r.domain)??[];e.push(r),t.set(r.domain,e)}for(const[e,r]of t){n&&(a.push(`// === Domain: ${e} ===`),a.push(""));for(const e of r)n&&(a.push(`// Source: ${e.file}:${e.line}`),a.push("// Language: "+e.language)),a.push(e.compiled),a.push("")}}else for(const t of e.compiled)n&&a.push(`// [${t.domain}] ${t.file}:${t.line}`),a.push(t.compiled),a.push("");const o=a.join("\n").trimEnd();switch(r){case"cjs":return`'use strict';\n\n${o}\n`;case"iife":return`(function() {\n${o}\n})();\n`;default:return o+"\n"}}},BaseMorphologicalNormalizer:gd,BaseTokenizer:ud,CrossDomainDispatcher:class{constructor(e,t){this.registry=e,this.minConfidence=t?.minConfidence??.5,this.priority=t?.priority??[]}async detect(e,t="en"){const r=this.registry.getDomainNames();if(0===r.length)return null;const n=[];for(const i of r)try{const r=await this.registry.getDSLForDomain(i);if(!r)continue;const{node:a,confidence:o}=r.parseWithConfidence(e,t);this.minConfidence>o||n.push({domain:i,node:a,confidence:o,dsl:r})}catch{}return 0===n.length?null:(n.sort(this.priority.length>0?(e,t)=>{const r=this.getPriorityIndex(e.domain),n=this.getPriorityIndex(t.domain);return r!==n?r-n:t.confidence-e.confidence}:(e,t)=>t.confidence-e.confidence),n[0])}async parseComposite(e,t="en"){const r=e.split("\n"),n=[],i=[];for(let e=0;r.length>e;e++){const a=r[e];if(Op(a))continue;const o=a.trim(),s=await this.detect(o,t);s?n.push({line:e+1,input:o,domain:s.domain,node:s.node,confidence:s.confidence}):i.push({line:e+1,input:o,message:"No domain matched this input"})}return{statements:n,errors:i}}async compile(e,t="en"){const r=await this.detect(e,t);if(!r)return null;return{...r.dsl.compile(e,t),domain:r.domain}}async compileComposite(e,t="en"){const r=e.split("\n"),n=[],i=[];for(let e=0;r.length>e;e++){const a=r[e];if(Op(a))continue;const o=a.trim(),s=await this.detect(o,t);if(s){const r=s.dsl.compile(o,t);n.push({line:e+1,input:o,domain:s.domain,ok:r.ok,code:r.code,errors:r.errors})}else i.push({line:e+1,input:o,message:"No domain matched this input"})}return{statements:n,errors:i}}async validate(e,t="en"){const r=await this.detect(e,t);if(!r)return{valid:!1,errors:["No domain matched this input"]};return{...r.dsl.validate(e,t),domain:r.domain}}getPriorityIndex(e){const t=this.priority.indexOf(e);return-1===t?this.priority.length:t}},CssSelectorExtractor:class{constructor(){this.name="css-selector"}canExtract(e,t){const r=e[t];if("#"!==r&&"."!==r)return!1;const n=e[t+1];return void 0!==n&&("_"===n||"-"===n||/\p{L}/u.test(n)&&!_u.test(n))}extract(e,t){let r=t+1;for(;e.length>r&&qu(e[r]);)r++;return r===t+1?null:{value:e.slice(t,r),length:r-t}}},DEFAULT_OPERATORS:td,DEFAULT_PUNCTUATION:nd,DEFAULT_REFERENCES:Ic,DomainAwareScanner:_p,DomainRegistry:class{constructor(){this.descriptors=new Map,this.dslCache=new Map,this.rendererCache=new Map}register(e){if(this.descriptors.has(e.name))throw Error("Domain already registered: "+e.name);this.descriptors.set(e.name,e)}setSchemas(e,t){const r=this.descriptors.get(e);if(!r)throw Error("Domain not registered: "+e);this.descriptors.set(e,{...r,schemas:t})}getDomainNames(){return Array.from(this.descriptors.keys())}getDescriptor(e){return this.descriptors.get(e)}getToolDefinitions(){const e=[];for(const t of this.descriptors.values())e.push(...Sp(t));return e}canHandle(e){const t=Cp(e);return!!t&&this.descriptors.has(t.domain)}async handleToolCall(e,t){const r=Cp(e);if(!r)return null;const n=this.descriptors.get(r.domain);if(!n)return null;try{const e=await this.getDSL(n);switch(r.operation){case"parse":return await this.handleParse(n,e,t);case"compile":return await this.handleCompile(n,e,t);case"validate":return await this.handleValidate(n,e,t);case"translate":return await this.handleTranslate(n,e,t);default:return Lp({error:"Unknown operation: "+r.operation},!0)}}catch(e){return Lp({error:`${n.name} tool error: ${e instanceof Error?e.message:e+""}`},!0)}}async getDSLForDomain(e){const t=this.descriptors.get(e);return t?this.getDSL(t):null}generatePrompt(e,t){const r=this.descriptors.get(e);return r?.schemas&&0!==r.schemas.length?ip({domain:e,description:r.description,schemas:r.schemas,...t}):null}generateTrainingData(e,t){const r=this.descriptors.get(e);return r?.schemas&&0!==r.schemas.length?vp(r.schemas,{domain:e,...t}):null}buildFeedback(e,t,r,n){const i=this.descriptors.get(e);if(!i?.schemas||0===i.schemas.length)return null;const a=this.createSchemaLookup(i.schemas);let o;try{if("explicit"===r){o=qc(t,{schemaLookup:a}).action}}catch{}return xp(t,r,n,a,o)}getSchemas(e){const t=this.descriptors.get(e);return t?.schemas?t.schemas:null}createSchemaLookup(e){const t=new Map;for(const r of e)t.set(r.action,r);return{getSchema:e=>t.get(e)}}async getDSL(e){const t=this.dslCache.get(e.name);if(t)return t;const r=await e.getDSL();return this.dslCache.set(e.name,r),r}async getRenderer(e){if(!e.getRenderer)return null;const t=this.rendererCache.get(e.name);if(t)return t;const r=await e.getRenderer();return this.rendererCache.set(e.name,r),r}async handleParse(e,t,r){const n=Ap(r,e.inputLabel);if(!n)return jp(e.inputLabel);const i=Ap(r,"language","en"),a=t.parse(n,i),o={};for(const[e,t]of a.roles)o[e]=t;return Lp({action:a.action,roles:o,language:i,[e.inputLabel]:n})}async handleCompile(e,t,r){const n=Ap(r,e.inputLabel);if(!n)return jp(e.inputLabel);const i=Ap(r,"language","en"),a=t.compile(n,i);return Lp({ok:a.ok,code:a.code,errors:a.errors,language:i,input:n})}async handleValidate(e,t,r){const n=Ap(r,e.inputLabel);if(!n)return jp(e.inputLabel);const i=Ap(r,"language","en"),a=t.validate(n,i);return Lp({valid:a.valid,errors:a.errors,language:i,[e.inputLabel]:n})}async handleTranslate(e,t,r){const n=Ap(r,e.inputLabel);if(!n)return jp(e.inputLabel);const i=Ap(r,"from");if(!i)return jp("from");const a=Ap(r,"to");if(!a)return jp("to");const o=t.parse(n,i),s=t.compile(n,i);let l=null;const c=await this.getRenderer(e);if(c)try{l="function"==typeof c?c(o,a):c.render(o,a)}catch{}else if(t.render)try{l=t.render(o,a)}catch{}const u={};for(const[e,t]of o.roles)u[e]=t;return Lp({input:{[e.inputLabel]:n,language:i},...null!=l&&{rendered:{text:l,language:a}},semantic:{action:o.action,roles:u},...s.ok&&null!=s.code&&{compiled:s.code}})}},GrammarTransformer:Lu,IdentifierExtractor:Ru,InMemoryDictionary:ju,InMemoryProfileProvider:Pu,LatinExtendedIdentifierExtractor:Iu,NullDictionary:class{lookup(e,t){return e}translate(e,t){return e}getAllTranslations(e,t){return{en:e}}},NullProfileProvider:class{getProfile(e){}getSupportedLanguages(){return[]}hasLanguage(e){return!1}},NumberExtractor:Nu,OperatorExtractor:rd,PatternMatcher:du,PatternTracker:class{constructor(e=1e3){this.events=[],this.maxEvents=e}record(e){this.events.push(e),this.events.length>this.maxEvents&&(this.events=this.events.slice(this.events.length-this.maxEvents))}getHitRateByCommand(){return this.computeHitRate(e=>e.action)}getHitRateByLanguage(){return this.computeHitRate(e=>e.language)}getTopFailures(e=10){const t=new Map;for(const e of this.events)if("rejected"===e.outcome&&e.diagnosticCodes)for(const r of e.diagnosticCodes){const n=t.get(r)||{count:0,actions:new Set};n.count++,n.actions.add(e.action),t.set(r,n)}return Array.from(t.entries()).map(([e,{count:t,actions:r}])=>({code:e,count:t,actions:Array.from(r)})).sort((e,t)=>t.count-e.count).slice(0,e)}getSummary(){const e={};for(const t of this.events)e[t.outcome]=(e[t.outcome]||0)+1;return{totalEvents:this.events.length,byOutcome:e,byCommand:this.getHitRateByCommand(),byLanguage:this.getHitRateByLanguage(),topFailures:this.getTopFailures()}}exportJSONL(){return this.events.map(e=>JSON.stringify(e)).join("\n")}get size(){return this.events.length}clear(){this.events=[]}computeHitRate(e){const t=new Map;for(const r of this.events){const n=e(r),i=t.get(n)||{attempts:0,successes:0};i.attempts++,"accepted"===r.outcome&&i.successes++,t.set(n,i)}const r={};for(const[e,{attempts:n,successes:i}]of t)r[e]={attempts:n,successes:i,rate:n>0?i/n:0};return r}},PunctuationExtractor:id,StringLiteralExtractor:Ou,TokenStreamImpl:qp,UnicodeIdentifierExtractor:Mu,WhitespaceExtractor:class{constructor(){this.name="whitespace"}canExtract(e,t){return/\s/.test(e[t])}extract(e,t){let r=0;for(;e.length>t+r&&/\s/.test(e[t+r]);)r++;return r>0?{value:e.substring(t,t+r),length:r}:null}},accumulateBlocks:function(e,t){return"flat"===t.nesting?function(e,t){const r=[],n=[];let i=null;const a=()=>{i&&(r.push({type:i.type,...null!=i.name&&{name:i.name},statements:i.stmts,children:[],line:i.line,indent:i.indent}),i=null)};for(const r of e)if(r.category&&t.blockTypes.includes(r.category)){a();const e=t.extractName?.(r.source,r.category);i={type:r.category,...null!=e&&{name:e},stmts:[r],line:r.line,indent:r.indent}}else i?i.stmts.push(r):n.push(r);return a(),{blocks:r,orphans:n}}(e,t):function(e,t){const r=[],n=[],i=[],a=e=>{for(;i.length>0;){const t=i[i.length-1];if(e>t.indent)break;{i.pop();const e={type:t.type,...null!=t.name&&{name:t.name},statements:t.stmts,children:t.children,line:t.line,indent:t.indent};i.length>0?i[i.length-1].children.push(e):r.push(e)}}};for(const r of e)if(r.category&&t.blockTypes.includes(r.category)){a(r.indent);const e=t.extractName?.(r.source,r.category);i.push({type:r.category,...null!=e&&{name:e},stmts:[r],children:[],line:r.line,indent:r.indent})}else i.length>0?i[i.length-1].stmts.push(r):n.push(r);return a(-1),{blocks:r,orphans:n}}(e,t)},buildDisambiguation:function(e,t){const r=[...t].sort((e,t)=>t.confidence-e.confidence),n=r.map((e,t)=>({action:e.action,confidence:e.confidence,explicit:Zc(e.node),description:e.description||`${e.action} (option ${String.fromCharCode(97+t)})`})),i=n.map((e,t)=>` (${String.fromCharCode(97+t)}) ${e.explicit} \u2014 ${e.description} (conf: ${e.confidence.toFixed(2)})`);return{input:e,candidates:n,question:[`Your input parsed with confidence ${r[0]?.confidence.toFixed(2)??"?"}.`,...i,"Which did you mean?"].join("\n")}},buildDomainTokenizer:fd,buildFeedback:xp,buildLanguageConfig:function(e,t,r={}){const n=r.name??e.name??e.code;return{code:e.code,name:n,nativeName:r.nativeName??e.nativeName??n,tokenizer:r.tokenizer??fd(e,t,r.tokenizerOptions),patternProfile:md(e,t),...r.grammarProfile&&{grammarProfile:r.grammarProfile}}},buildPatternProfile:md,buildPhrase:wu,buildTablesFromProfiles:bu,combineClassifiers:function(...e){return t=>e.some(e=>e(t))},convertValue:Uu,createAsyncNode:Pc,createCommandNode:Tc,createCompoundNode:Ac,createConditionalNode:Cc,createDiagnosticCollector:function(){const e=[];function t(t,r,n){const i={message:r,severity:t,...null!=n?.code&&{code:n.code},...null!=n?.line&&{line:n.line},...null!=n?.column&&{column:n.column},...null!=n?.source&&{source:n.source},...null!=n?.suggestions&&n.suggestions.length>0&&{suggestions:n.suggestions}};e.push(i)}return{error(e,r,n){"string"==typeof r?t("error",r,{...n,code:e}):t("error",e,r)},warning(e,r){t("warning",e,r)},info(e,r){t("info",e,r)},add(t){e.push(t)},hasErrors:()=>e.some(e=>"error"===e.severity),getDiagnostics:()=>e,toResult(){let t=0,r=0,n=0;for(const i of e)"error"===i.severity?t++:"warning"===i.severity?r++:n++;return{ok:0===t,diagnostics:e,summary:{errors:t,warnings:r,infos:n}}}}},createDomainRenderer:xu,createEventHandlerNode:Sc,createExpression:xc,createFlag:Ec,createLatinCharClassifiers:function(e){const t=t=>e.test(t);return{isLetter:t,isIdentifierChar:e=>t(e)||/[0-9_-]/.test(e)}},createLiteral:kc,createLoopNode:Lc,createMatchNode:Oc,createMultiStatementParser:function(e,t){return new wd(e,t)},createMultilingualDSL:function(e){const t=function(e){const t=e.extensions;if(!t||0===t.length)return e;const r=new Set(e.languages.map(e=>e.code)),n=new Set(e.schemas.map(e=>e.action));for(const e of t){const{action:t}=e.schema;if(n.has(t))throw Error(`Extension command "${t}" collides with a command this DSL already defines. Pick a different action name.`);n.add(t);for(const n of Object.keys(e.vocabulary))if(!r.has(n))throw Error(`Extension command "${t}" supplies vocabulary for language "${n}", which is not configured on this DSL. Configured languages: ${[...r].join(", ")}.`)}const i=[...e.schemas,...t.map(e=>e.schema)],a=e.languages.map(e=>{const r={...e.patternProfile.keywords};let n=e.patternProfile.roleMarkers;for(const i of t){const t=i.vocabulary[e.code];t&&(r[i.schema.action]={...t.keyword},t.roleMarkers&&(n={...n,...t.roleMarkers}))}return{...e,patternProfile:{...e.patternProfile,keywords:r,...void 0!==n&&{roleMarkers:n}}}}),o=new Map(t.filter(e=>e.generate).map(e=>[e.schema.action,e.generate])),s=e.codeGenerator,l=o.size>0?{generate(e){const t=o.get(e.action);if(t)return t(e);if(!s)throw Error(`No code generator for action "${e.action}"`);return s.generate(e)}}:s;return{...e,schemas:i,languages:a,...void 0!==l&&{codeGenerator:l}}}(e),r=new Set((e.extensions??[]).map(e=>e.schema.action)),n=t.dictionary??function(e){const t={};for(const r of e.languages){const e={};for(const[t,n]of Object.entries(r.patternProfile.keywords))e[t]=n.primary;t[r.code]=e}return new ju(t)}(t),i=t.profileProvider??function(e){const t={};for(const r of e.languages)r.grammarProfile&&(t[r.code]=r.grammarProfile);return new Pu(t)}(t),a=new Lu({dictionary:n,profileProvider:i}),o=new rp(t,r);return new np(t,o,a,i)},createPosition:$p,createPropertyPath:zc,createReference:bc,createSchemaRenderer:function(e,t){const r=Eu(e,t);return{render:(e,t)=>Tu(e,t,r)??e.action}},createSelector:wc,createSimpleTokenizer:pd,createToken:Vp,createTokenizerContext:Vu,createTryNode:jc,createUnicodeRangeClassifier:hd,defineCommand:function(e){if("object"!=typeof e||null===e)throw new TypeError(`defineCommand: expected a schema object, got ${Mc(e)}.`);if("string"!=typeof e.action||0===e.action.length)throw new TypeError(`defineCommand: 'action' must be a non-empty string (got ${Mc(e.action)}).`);if(!Array.isArray(e.roles))throw new TypeError(`defineCommand("${e.action}"): 'roles' must be an array of RoleSpec (got ${Mc(e.roles)}). Build entries with defineRole().`);for(const[t,r]of e.roles.entries())if("object"!=typeof r||null===r||"string"!=typeof r.role)throw new TypeError(`defineCommand("${e.action}"): roles[${t}] must be a RoleSpec with a string 'role' field (got ${Mc(r)}). Build it with defineRole().`);return{description:e.description||e.action+" command",category:e.category||"general",primaryRole:e.primaryRole||e.roles[0]?.role||"patient",...e,action:e.action,roles:e.roles}},defineRole:function(e){return{description:e.description||e.role+" role",...e,role:e.role,required:e.required,expectedTypes:e.expectedTypes}},deriveRoleMarkers:function(e,t){const r={};for(const[n,i]of Object.entries(t)){const t=e.roleMarkers?.[i];t?.primary&&(r[n]=t.primary)}return r},detectWordOrders:zu,extractCssSelector:Zp,extractNumber:ed,extractRoleValue:Rc,extractStringLiteral:Xp,extractUrl:Qp,extractValue:Nc,filterBySeverity:function(e,t){return e.filter(e=>e.severity===t)},fromEnvelopeJSON:function(e){return{lseVersion:e.lseVersion,...e.features&&e.features.length>0?{features:e.features}:{},nodes:e.nodes.map(eu)}},fromError:function(e,t){return{message:e instanceof Error?e.message:e+"",severity:"error",...null!=t?.code&&{code:t.code},...null!=t?.line&&{line:t.line},...null!=t?.column&&{column:t.column},...null!=t?.source&&{source:t.source},...null!=t?.suggestions&&t.suggestions.length>0&&{suggestions:t.suggestions}}},fromInterchangeNode:Ku,fromProtocolJSON:eu,generateExamples:ap,generatePattern:hu,generatePatternVariants:function(e,t,r=fu){const n=[];return n.push(hu(e,t,r)),n},generatePrompt:ip,generateProtocolReference:function(){const e=op(),t=sp();return`# LokaScript Explicit Syntax (LSE) Quick Reference\n\n${e.content}\n\n${t.content}`},getAllPossessiveKeywords:function(e){return e?.possessive?.keywords??{}},getDefaultExtractors:ad,getPossessiveReference:uu,getRoleSpec:function(e,t){if(e&&Array.isArray(e.roles))return e.roles.find(e=>e.role===t)},getRoleValue:function(e,t){return e.roles.get(t)},insertMarkers:Cu,isAsciiIdentifierChar:Gp,isAsciiLetter:Up,isBuiltInReference:function(e){return new Set(["me","you","it","result","event","target","body"]).has(e.toLowerCase())},isCSSPropertyRef:function(e){return e.startsWith("*")},isCSSSelector:function(e){return e.startsWith(".")||e.startsWith("#")||e.startsWith("<")},isClassName:function(e){return e.startsWith(".")},isCompoundSyntax:function(e){const{segments:t}=Dc(e.trim());return t.length>1},isContextAwareExtractor:$u,isDigit:Kp,isDocumentSyntax:function(e){const t=e.trim();return!!t.includes("\n")||(!!Hc.test(t)||!!(t.startsWith("//")||t.startsWith("#")&&!t.startsWith("#!")))},isEnvelope:function(e){return"object"==typeof e&&null!==e&&"lseVersion"in e&&"nodes"in e&&Array.isArray(e.nodes)},isExplicitSyntax:$c,isIdSelector:function(e){return e.startsWith("#")},isNumericValue:function(e){if(e.match(/^(\d+(?:\.\d+)?)(ms|s|m|h)?$/))return!0;const t=parseFloat(e);return!isNaN(t)&&isFinite(t)},isPossessiveKeyword:function(e,t){return void 0!==e?.possessive?.keywords?.[t]},isPossessiveMarker:Yp,isPropertyName:function(e){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e)},isQuote:Hp,isSelectorStart:Bp,isTypeCompatible:cu,isUrlStart:Jp,isValidReference:Wc,isVariableRef:function(e){return e.startsWith(":")},isWhitespace:Dp,joinTokens:Au,jsonToSemanticNode:function(e){const t=new Map;if(e.roles)for(const[r,n]of Object.entries(e.roles))t.set(r,Bu(n));if(e.trigger){t.set("event",kc(e.trigger.event,"string"));const r=new Map(t);r.delete("event");return Sc("on",t,[Tc(e.action,r)],{sourceLanguage:"json"},e.trigger.modifiers??{})}return Tc(e.action,t,{sourceLanguage:"json"})},lookupKeyword:ku,lookupMarker:function(e,t,r){return e[t]?.[r]??t},matchBest:function(e,t){return mu.matchBest(e,t)},matchPattern:function(e,t){return mu.matchPattern(e,t)},needsDisambiguation:function(e,t=.5,r=.7){return e>=t&&r>e},noChange:yd,normalized:vd,parseCompound:Bc,parseDocument:function(e,t){const r=e.split("\n");let n="1.0";const i=[];let a=0;for(let e=0;r.length>e;e++){const t=r[e].trim();if(!t)continue;const i=t.match(Hc);i&&(n=i[1],a=e+1);break}for(let e=a;r.length>e;e++){const n=r[e].trim();n&&(n.startsWith("//")||n.startsWith("#")&&!n.startsWith("#!")||i.push(Bc(n,t)))}return{lseVersion:n,nodes:i}},parseExplicit:qc,parseJSONL:function(e){return e.split("\n").filter(e=>e.trim().length>0).map(e=>JSON.parse(e))},patternMatcher:mu,registryToAOTBackends:async function(e){const t=[];for(const r of e.getDomainNames()){const n=e.getDescriptor(r);if(!n?.scanConfig)continue;const i=await e.getDSLForDomain(r);if(!i)continue;const a={domain:r,attributes:[...n.scanConfig.attributes],...n.scanConfig.scriptTypes?{scriptTypes:[...n.scanConfig.scriptTypes]}:{},defaultLanguage:n.scanConfig.defaultLanguage??"en"};t.push({domain:r,dsl:i,codeGenerator:{generate:e=>JSON.stringify({action:e.action,roles:Object.fromEntries(e.roles)})},scanConfig:a})}return t},renderDocument:function(e){const t=[];e.lseVersion&&"1.0"!==e.lseVersion&&t.push("#!lse "+e.lseVersion);for(const r of e.nodes)t.push(Zc(r));return t.join("\n")},renderExplicit:Zc,renderExpr:Gu,reorderRoles:Su,semanticNodeToJSON:function e(t){if("compound"===t.kind){return t.statements.length>0?e(t.statements[0]):{action:"compound",roles:{}}}if("event-handler"===t.kind){const e=t,r=e.body?.[0]?.action??t.action,n={};if(e.body?.[0])for(const[t,r]of e.body[0].roles)n[t]=Hu(r);const i=t.roles.get("event"),a=i?"value"in i?i.value+"":"raw"in i?i.raw:"unknown":"unknown",o={action:"on"===r?e.body?.[0]?.action??"on":r,roles:n,trigger:{event:a}};return e.eventModifiers&&Object.keys(e.eventModifiers).length>0&&(o.trigger.modifiers=e.eventModifiers),o}const r={};for(const[e,n]of t.roles)r[e]=Hu(n);return{action:t.action,roles:r}},semanticNodeToRuntimeAST:ep,semanticValueToAST:tp,sortRolesByWordOrder:gu,stripOptionalDiacritics:Fp,synthesizeFromSchemas:vp,toEnvelopeJSON:function(e){const t={lseVersion:e.lseVersion,nodes:e.nodes.map(Xc)};return e.features&&e.features.length>0&&(t.features=[...e.features]),t},toJSONL:function(e){return e.map(e=>JSON.stringify(kd(e))).join("\n")},toJSONLRow:kd,toProtocolJSON:Xc,validateProtocolJSON:function(e){const t=[];if("object"!=typeof e||null===e)return[{severity:"error",code:"INVALID_ROOT",message:"Root must be a JSON object"}];const r=e,n="kind"in r?r.kind+"":"command";if("kind"in r&&!nu.has(n)&&t.push({severity:"error",code:"INVALID_KIND",message:`Invalid kind "${r.kind}". Must be one of: command, event-handler, compound`}),"action"in r?"string"==typeof r.action&&0!==r.action.length||t.push({severity:"error",code:"INVALID_ACTION",message:"action must be a non-empty string"}):t.push({severity:"error",code:"MISSING_ACTION",message:"Missing required field: action"}),"roles"in r||"compound"===n){if("roles"in r&&("object"!=typeof r.roles||null===r.roles||Array.isArray(r.roles)))t.push({severity:"error",code:"INVALID_ROLES",message:"roles must be a plain object"});else if("roles"in r&&r.roles)for(const[e,n]of Object.entries(r.roles)){if("object"!=typeof n||null===n){t.push({severity:"error",code:"INVALID_ROLE_VALUE",message:`Role "${e}" value must be an object`});continue}const r=n;"type"in r&&iu.has(r.type+"")||t.push({severity:"error",code:"INVALID_VALUE_TYPE",message:`Role "${e}" has invalid type "${r.type}"`}),"flag"===r.type&&("string"==typeof r.name||"value"in r||t.push({severity:"error",code:"MISSING_FLAG_NAME",message:`Flag role "${e}" missing required field: name (or value)`}),"boolean"==typeof r.enabled||"value"in r||t.push({severity:"error",code:"MISSING_FLAG_ENABLED",message:`Flag role "${e}" missing required field: enabled (or value)`})),"expression"!==r.type||"string"==typeof r.raw||"value"in r||t.push({severity:"error",code:"MISSING_EXPRESSION_RAW",message:`Expression role "${e}" missing required field: raw (or value)`})}}else t.push({severity:"error",code:"MISSING_ROLES",message:"Missing required field: roles"});if("trigger"in r&&r.trigger){const e=r.trigger;"object"!=typeof e||null===e?t.push({severity:"error",code:"INVALID_TRIGGER",message:"trigger must be an object"}):e.event&&"string"==typeof e.event||t.push({severity:"error",code:"INVALID_TRIGGER",message:"trigger.event is required and must be a non-empty string"})}if("event-handler"!==n||"trigger"in r||"body"in r&&Array.isArray(r.body)||t.push({severity:"error",code:"MISSING_BODY",message:"event-handler node requires a body array"}),"compound"===n&&("statements"in r&&Array.isArray(r.statements)||t.push({severity:"error",code:"MISSING_STATEMENTS",message:"compound node requires a statements array"}),"chainType"in r&&!au.has(r.chainType+"")&&t.push({severity:"error",code:"INVALID_CHAIN_TYPE",message:`Invalid chainType "${r.chainType}"`})),"diagnostics"in r&&!Array.isArray(r.diagnostics)&&t.push({severity:"error",code:"INVALID_DIAGNOSTICS",message:"diagnostics must be an array"}),"annotations"in r)if(Array.isArray(r.annotations))for(let e=0;r.annotations.length>e;e++){const n=r.annotations[e];n&&"object"==typeof n?"string"==typeof n.name&&0!==n.name.length||t.push({severity:"error",code:"MISSING_ANNOTATION_NAME",message:`annotations[${e}] missing required field: name`}):t.push({severity:"error",code:"INVALID_ANNOTATION_ENTRY",message:`annotations[${e}] must be an object`})}else t.push({severity:"error",code:"INVALID_ANNOTATIONS",message:"annotations must be an array"});if("asyncVariant"in r&&!ou.has(r.asyncVariant+"")&&t.push({severity:"error",code:"INVALID_ASYNC_VARIANT",message:`Invalid asyncVariant "${r.asyncVariant}". Must be "all" or "race"`}),"arms"in r)if(Array.isArray(r.arms))for(let e=0;r.arms.length>e;e++){const n=r.arms[e];n&&"object"==typeof n?(n.pattern&&"object"==typeof n.pattern||t.push({severity:"error",code:"MISSING_ARM_PATTERN",message:`arms[${e}] missing required field: pattern`}),Array.isArray(n.body)||t.push({severity:"error",code:"MISSING_ARM_BODY",message:`arms[${e}] missing required field: body (array)`})):t.push({severity:"error",code:"INVALID_ARM_ENTRY",message:`arms[${e}] must be an object`})}else t.push({severity:"error",code:"INVALID_ARMS",message:"arms must be an array"});if("diagnostics"in r&&Array.isArray(r.diagnostics))for(let e=0;r.diagnostics.length>e;e++){const n=r.diagnostics[e];n&&"object"==typeof n?(su.has(n.level+"")||t.push({severity:"error",code:"INVALID_DIAGNOSTIC_LEVEL",message:`diagnostics[${e}].level must be "error", "warning", or "info"`}),"string"!=typeof n.message&&t.push({severity:"error",code:"MISSING_DIAGNOSTIC_MESSAGE",message:`diagnostics[${e}] missing required field: message`})):t.push({severity:"error",code:"INVALID_DIAGNOSTIC_ENTRY",message:`diagnostics[${e}] must be an object`})}return t},validateSemanticJSON:function(e){const t=[];if(!e.action||"string"!=typeof e.action)return t.push({severity:"error",code:"INVALID_ACTION",message:'Field "action" is required and must be a string.',suggestion:'Provide a command name like "toggle", "add", "set", etc.'}),t;if(e.roles&&"object"==typeof e.roles)for(const[r,n]of Object.entries(e.roles)){if(!n||"object"!=typeof n){t.push({severity:"error",code:"INVALID_ROLE_VALUE",message:`Role "${r}" must be an object with "type" and "value" fields.`,suggestion:'Use: { "type": "selector", "value": ".active" }'});continue}const e=n;Du.has(e.type)||t.push({severity:"error",code:"INVALID_VALUE_TYPE",message:`Role "${r}" has invalid type "${e.type}".`,suggestion:"Valid types: selector, literal, reference, expression, property-path."}),null==e.value&&t.push({severity:"error",code:"MISSING_VALUE",message:`Role "${r}" is missing the "value" field.`})}return e.trigger&&(e.trigger.event&&"string"==typeof e.trigger.event||t.push({severity:"error",code:"INVALID_TRIGGER",message:'Trigger "event" is required and must be a string.',suggestion:'Use an event name like "click", "mouseover", "keydown".'})),t},validateValueType:function(e,t){return!t||0===t.length||cu(e.type,t)},withDefaultExtractors:function(e){return e.registerExtractors(ad()),e}}),Td=Object.defineProperty,Sd=Object.getOwnPropertyNames,Cd=(e,t)=>function(){return e&&(t=(0,e[Sd(e)[0]])(e=0)),t},Ad=(e,t)=>{for(var r in t)Td(e,r,{get:t[r],enumerable:!0})};function Ld(e,t){return e.replace(/\{(\w+)\}/g,(e,r)=>(t[r]??`{${r}}`)+"")}function jd(e,t,r={},n){const i=Ld(zd[e],r),a=xd[e],o=a?Ld(a,r):void 0;return{code:e,message:i,severity:t,...n&&{role:n},...o&&{suggestion:o}}}var Pd,Od,Nd=Cd({"src/generators/schema-error-codes.ts"(){bd={AMBIGUOUS_TYPE_LITERAL_SELECTOR:"SCHEMA_AMBIGUOUS_TYPE_LITERAL_SELECTOR",TOO_MANY_EXPECTED_TYPES:"SCHEMA_TOO_MANY_EXPECTED_TYPES",MULTI_TYPE_PATIENT_EXPECTED:"SCHEMA_MULTI_TYPE_PATIENT_EXPECTED",NO_REQUIRED_ROLES:"SCHEMA_NO_REQUIRED_ROLES",NO_REQUIRED_ROLES_EXPECTED:"SCHEMA_NO_REQUIRED_ROLES_EXPECTED",TRANSITION_PATIENT_ACCEPTS_SELECTOR:"SCHEMA_TRANSITION_PATIENT_ACCEPTS_SELECTOR",TRANSITION_MISSING_GOAL:"SCHEMA_TRANSITION_MISSING_GOAL",EVENT_HANDLER_MISSING_EVENT:"SCHEMA_EVENT_HANDLER_MISSING_EVENT",EVENT_HANDLER_EVENT_NOT_REQUIRED:"SCHEMA_EVENT_HANDLER_EVENT_NOT_REQUIRED",CONDITIONAL_MISSING_CONDITION:"SCHEMA_CONDITIONAL_MISSING_CONDITION",CONDITIONAL_CONDITION_NOT_REQUIRED:"SCHEMA_CONDITIONAL_CONDITION_NOT_REQUIRED",FOR_LOOP_MISSING_SOURCE:"SCHEMA_FOR_LOOP_MISSING_SOURCE",WHILE_LOOP_MISSING_CONDITION:"SCHEMA_WHILE_LOOP_MISSING_CONDITION",VALUE_TYPE_MISMATCH:"SCHEMA_VALUE_TYPE_MISMATCH",SELECTOR_KIND_MISMATCH:"SCHEMA_SELECTOR_KIND_MISMATCH",SELECTOR_KINDS_WITHOUT_SELECTOR_TYPE:"SCHEMA_SELECTOR_KINDS_WITHOUT_SELECTOR_TYPE",KEYWORD_COLLISION:"PROFILE_KEYWORD_COLLISION"},zd={[bd.AMBIGUOUS_TYPE_LITERAL_SELECTOR]:"Role '{role}' accepts both 'literal' and 'selector'. This may cause ambiguous type inference for values starting with special characters (* . # etc.).",[bd.TOO_MANY_EXPECTED_TYPES]:"Role '{role}' accepts {count} different types. This may make type inference unreliable.",[bd.MULTI_TYPE_PATIENT_EXPECTED]:"Role '{role}' accepts multiple types (expected for {command} command).",[bd.NO_REQUIRED_ROLES]:"Command has no required roles. Is this intentional?",[bd.NO_REQUIRED_ROLES_EXPECTED]:"Command has no required roles (expected for {command}).",[bd.TRANSITION_PATIENT_ACCEPTS_SELECTOR]:"Transition command 'patient' role (CSS property name) should only accept 'literal', not 'selector'. CSS property names like 'background-color' are strings, not CSS selectors.",[bd.TRANSITION_MISSING_GOAL]:"Transition command requires a 'goal' role for the target value (to <value>). Without it, there's no way to specify what value to transition to.",[bd.EVENT_HANDLER_MISSING_EVENT]:"Event handler command should have an 'event' role to specify which event to listen for.",[bd.EVENT_HANDLER_EVENT_NOT_REQUIRED]:"Event role should be required - every event handler needs an event to listen for.",[bd.CONDITIONAL_MISSING_CONDITION]:"Conditional command should have a 'condition' role for the boolean expression.",[bd.CONDITIONAL_CONDITION_NOT_REQUIRED]:"Condition role should be required - conditionals need a condition to evaluate.",[bd.FOR_LOOP_MISSING_SOURCE]:"For-loop should have a 'source' role for the collection to iterate over.",[bd.WHILE_LOOP_MISSING_CONDITION]:"While-loop should have a 'condition' role for the loop condition.",[bd.VALUE_TYPE_MISMATCH]:"Role '{role}' of command '{command}' expects type [{expectedTypes}], got '{actualType}'.",[bd.SELECTOR_KIND_MISMATCH]:"Role '{role}' of command '{command}' expects selector kind [{selectorKinds}], got '{actualKind}'.",[bd.SELECTOR_KINDS_WITHOUT_SELECTOR_TYPE]:"Role '{role}' has selectorKinds but expectedTypes does not include 'selector'.",[bd.KEYWORD_COLLISION]:"Keyword '{keyword}' is used by multiple commands: {commands}. Only the first-registered command will be reachable."},xd={[bd.AMBIGUOUS_TYPE_LITERAL_SELECTOR]:"Consider being more specific about which type is expected, or use explicit type markers.",[bd.TOO_MANY_EXPECTED_TYPES]:"Consider narrowing the accepted types to improve type inference reliability.",[bd.TRANSITION_PATIENT_ACCEPTS_SELECTOR]:"Remove 'selector' from expectedTypes and only accept 'literal'.",[bd.TRANSITION_MISSING_GOAL]:"Add a 'goal' role with expectedTypes ['literal', 'variable'].",[bd.EVENT_HANDLER_MISSING_EVENT]:"Add an 'event' role with expectedTypes ['literal'].",[bd.EVENT_HANDLER_EVENT_NOT_REQUIRED]:"Set required: true on the 'event' role.",[bd.CONDITIONAL_MISSING_CONDITION]:"Add a 'condition' role with expectedTypes ['expression'].",[bd.CONDITIONAL_CONDITION_NOT_REQUIRED]:"Set required: true on the 'condition' role.",[bd.FOR_LOOP_MISSING_SOURCE]:"Add a 'source' role for the collection to iterate over.",[bd.WHILE_LOOP_MISSING_CONDITION]:"Add a 'condition' role for the loop continuation condition.",[bd.VALUE_TYPE_MISMATCH]:"Ensure the value matches one of the expected types: [{expectedTypes}].",[bd.SELECTOR_KIND_MISMATCH]:"Use a selector of the correct kind: [{selectorKinds}].",[bd.SELECTOR_KINDS_WITHOUT_SELECTOR_TYPE]:"Either add 'selector' to expectedTypes or remove selectorKinds.",[bd.KEYWORD_COLLISION]:"Give each command a unique keyword. Move the shared keyword to alternatives on one command, or use a more specific translation."}}}),Rd={};function Md(e){const t=[];for(const r of e.roles)r.expectedTypes.includes("literal")&&r.expectedTypes.includes("selector")&&("patient"===r.role&&Pd.has(e.action)?t.push(jd(bd.MULTI_TYPE_PATIENT_EXPECTED,"note",{role:r.role,command:e.action},r.role)):t.push(jd(bd.AMBIGUOUS_TYPE_LITERAL_SELECTOR,"warning",{role:r.role},r.role))),r.expectedTypes.length>3&&!Pd.has(e.action)&&t.push(jd(bd.TOO_MANY_EXPECTED_TYPES,"warning",{role:r.role,count:r.expectedTypes.length},r.role));for(const r of e.roles)r.selectorKinds&&r.selectorKinds.length>0&&(r.expectedTypes.includes("selector")||t.push(jd(bd.SELECTOR_KINDS_WITHOUT_SELECTOR_TYPE,"warning",{role:r.role},r.role)));switch(e.action){case"transition":!function(e,t){const r=e.roles.find(e=>"patient"===e.role),n=e.roles.find(e=>"goal"===e.role);r&&!n&&t.push(jd(bd.TRANSITION_MISSING_GOAL,"error",{}))}(e,t);break;case"on":!function(e,t){const r=e.roles.find(e=>"event"===e.role);r||t.push(jd(bd.EVENT_HANDLER_MISSING_EVENT,"warning",{}));r&&!r.required&&t.push(jd(bd.EVENT_HANDLER_EVENT_NOT_REQUIRED,"warning",{}))}(e,t);break;case"if":case"unless":!function(e,t){const r=e.roles.find(e=>"condition"===e.role);r||t.push(jd(bd.CONDITIONAL_MISSING_CONDITION,"warning",{}));r&&!r.required&&t.push(jd(bd.CONDITIONAL_CONDITION_NOT_REQUIRED,"warning",{}))}(e,t);break;case"repeat":case"for":case"while":!function(e,t){if("for"===e.action){e.roles.find(e=>"source"===e.role)||t.push(jd(bd.FOR_LOOP_MISSING_SOURCE,"warning",{}))}else if("while"===e.action){e.roles.find(e=>"condition"===e.role)||t.push(jd(bd.WHILE_LOOP_MISSING_CONDITION,"warning",{}))}}(e,t)}return 0===e.roles.filter(e=>e.required).length&&(Od.has(e.action)?t.push(jd(bd.NO_REQUIRED_ROLES_EXPECTED,"note",{command:e.action})):t.push(jd(bd.NO_REQUIRED_ROLES,"warning",{}))),function(e,t){return{action:e,items:t}}(e.action,t)}function Id(e,t={}){const r=new Map,{includeNotes:n=!1}=t;for(const[t,i]of Object.entries(e)){const e=Md(i),a=e.items.some(e=>"warning"===e.severity||"error"===e.severity),o=n&&e.items.some(e=>"note"===e.severity);(a||o)&&r.set(t,e)}return r}function Wd(e,t={}){const r=[],{showNotes:n=!1,showCodes:i=!0}=t;for(const[t,a]of e){const e=a.items.filter(e=>"error"===e.severity),o=a.items.filter(e=>"warning"===e.severity),s=a.items.filter(e=>"note"===e.severity);if(e.length>0){r.push(` \u274c ${t}:`);for(const t of e){r.push(` ERROR${i?` [${t.code}]`:""}: ${t.message}`),t.suggestion&&r.push(" \ud83d\udca1 Suggestion: "+t.suggestion)}}if(o.length>0){r.push(` \u26a0\ufe0f ${t}:`);for(const e of o){r.push(` ${(i?` [${e.code}]`:"")?e.code+": ":""}${e.message}`),e.suggestion&&r.push(" \ud83d\udca1 "+e.suggestion)}}if(n&&s.length>0){r.push(` \u2139\ufe0f ${t}:`);for(const e of s){r.push(` ${(i?` [${e.code}]`:"")?e.code+": ":""}${e.message}`)}}}return r.join("\n")}function _d(e){let t=0,r=0,n=0;const i={};for(const a of e.values())for(const e of a.items)"error"===e.severity?t++:"warning"===e.severity?r++:"note"===e.severity&&n++,i[e.code]=(i[e.code]||0)+1;return{totalCommands:e.size,errors:t,warnings:r,notes:n,byCode:i}}function qd(e,t){const r=[];for(const n of t){const t=e.roles.find(e=>e.role===n.role);t&&(t.expectedTypes.length>0&&!t.expectedTypes.includes(n.type)&&(t.expectedTypes.includes("expression")||r.push({level:"error",role:n.role,message:`${e.action}.${n.role} expects type [${t.expectedTypes.join(", ")}], got '${n.type}'`,code:bd.VALUE_TYPE_MISMATCH})),"selector"===n.type&&n.selectorKind&&t.selectorKinds&&t.selectorKinds.length>0&&(t.selectorKinds.includes(n.selectorKind)||r.push({level:"error",role:n.role,message:`${e.action}.${n.role} expects selector kind [${t.selectorKinds.join(", ")}], got '${n.selectorKind}'`,code:bd.SELECTOR_KIND_MISMATCH})))}return r}function $d(e){const t=[];if(!e.keywords)return{language:e.code,collisions:t};const r=new Map;for(const[t,n]of Object.entries(e.keywords)){if(!n||!n.primary)continue;const e=r.get(n.primary)||[];if(e.push({command:t,isPrimary:!0}),r.set(n.primary,e),n.alternatives)for(const e of n.alternatives){const n=r.get(e)||[];n.push({command:t,isPrimary:!1}),r.set(e,n)}}for(const[e,n]of r){const r=[...new Set(n.map(e=>e.command))];if(1>=r.length)continue;const i=n.filter(e=>e.isPrimary).length;let a;a=2>i?1===i?"primary-alternative":"alternative-alternative":"primary-primary",t.push({keyword:e,commands:r.sort(),type:a})}const n={"primary-primary":0,"primary-alternative":1,"alternative-alternative":2};return t.sort((e,t)=>n[e.type]-n[t.type]),{language:e.code,collisions:t}}function Vd(e){const t=[];for(const[,r]of Object.entries(e)){const e=$d(r);e.collisions.length>0&&t.push(e)}return t.sort((e,t)=>e.language.localeCompare(t.language))}Ad(Rd,{SchemaErrorCodes:()=>bd,formatValidationResults:()=>Wd,getValidationStats:()=>_d,validateAllKeywordCollisions:()=>Vd,validateAllSchemas:()=>Id,validateCommandSchema:()=>Md,validateKeywordCollisions:()=>$d,validateRoleValues:()=>qd});var Dd,Bd,Hd,Kd,Fd,Ud,Gd,Zd,Yd,Xd,Jd,Qd,em,tm,rm,nm,im,am,om,sm,lm,cm,um,pm,dm,mm,fm,hm,ym,vm,gm,km,wm,bm,zm,xm,Em,Tm,Sm,Cm,Am,Lm,jm,Pm,Om,Nm,Rm,Mm,Im,Wm,_m,qm,$m,Vm,Dm,Bm,Hm,Km,Fm,Um,Gm,Zm,Ym,Xm,Jm,Qm,ef,tf,rf,nf,af,of,sf=Cd({"src/generators/schema-validator.ts"(){Nd(),Pd=new Set(["put","append","prepend","log","throw","make","measure","return","swap","morph","beep","copy"]),Od=new Set(["compound","else","halt","continue","async","init","settle","focus","blur","return","js","measure","break","exit","beep","empty","open","close","select","clear","reset","breakpoint","live","eventsource","socket","worker","intercept"])}});function lf(e){const t=e.roles.find(e=>"destination"===e.role);return t?{destination:t.default?{fromRole:"destination",default:t.default}:{fromRole:"destination"}}:{}}function cf(e){const t=e.roles.find(e=>"source"===e.role);return t?{source:t.default?{fromRole:"source",default:t.default}:{fromRole:"source"}}:{}}function uf(e,t){return df(e,t,"source")}function pf(e,t){return df(e,t,"destination")}function df(e,t,r){if(!t||!e.roles.some(e=>e.role===r))return[];const n=t.alternatives?{type:"literal",value:t.primary,alternatives:[...t.alternatives]}:{type:"literal",value:t.primary},i={type:"role",role:r,optional:!0};return[{type:"group",optional:!0,tokens:"after"===t.position?[i,n]:[n,i]}]}function mf(e){return of[e]}function ff(){return Object.values(of).filter(e=>e.roles.length>0||!0===e.bareKeyword)}var hf,yf,vf,gf,kf,wf=Cd({"src/generators/command-schemas.ts"(){Dd={action:"toggle",description:"Toggle a class or attribute on/off",category:"dom-class",primaryRole:"patient",ast:{args:["patient"],modifiers:{on:"destination",for:"duration"}},roles:[{role:"patient",description:"The class or attribute to toggle",required:!0,expectedTypes:["selector"],selectorKinds:["class","attribute"],svoPosition:1,sovPosition:2,markerOptional:{zh:!0}},{role:"destination",description:"The target element (defaults to me)",required:!1,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1,markerVariants:{ko:["\uc5d0\uc11c"]}},{role:"duration",description:"How long the class stays on before reverting (`toggle .a for 2s`)",required:!1,expectedTypes:["literal"],svoPosition:3,sovPosition:3,valueShape:"time",markerOverride:{en:"for",ja:"\u9593",ko:"\ub3d9\uc548"}}],errorCodes:["MISSING_ARGUMENT","NO_VALID_CLASS_NAMES","INVALID_CSS_PROPERTY"],preconditions:[{condition:"Command has at least one argument",errorCode:"MISSING_ARGUMENT",message:"toggle command requires an argument"},{condition:"Class names are valid CSS identifiers",errorCode:"NO_VALID_CLASS_NAMES",message:"toggle command: no valid class names found"}],recoveryHints:{MISSING_ARGUMENT:"Add a class selector (.classname) or attribute to toggle",NO_VALID_CLASS_NAMES:"Ensure class names start with a dot (.) and are valid CSS identifiers",INVALID_CSS_PROPERTY:"Check CSS property name syntax (use kebab-case)"}},Bd={action:"add",description:"Add a class or attribute to an element",category:"dom-class",primaryRole:"patient",ast:{args:["patient"],modifiers:{to:"destination"}},roles:[{role:"patient",description:"The class or attribute to add",required:!0,expectedTypes:["selector","literal"],svoPosition:1,sovPosition:2},{role:"destination",description:"The target element (defaults to me)",required:!1,expectedTypes:["selector","reference","expression"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1,markerOverride:{en:"to",es:"a",ar:"\u0625\u0644\u0649",zh:"\u5230",fr:"\u00e0",de:"zu",pt:"a",he:"\u05d0\u05dc",id:"ke",it:"a",sw:"kwa"},markerLegacy:{es:["en","sobre","hacia"],ar:["\u0639\u0644\u0649","\u0641\u064a","\u0628"],zh:["\u5728","\u4e8e"],fr:["sur","dans"],de:["auf","in"],pt:["em","para"],he:["\u05e2\u05dc","\u05d1","\u05dc"],id:["pada","di"],it:["in","su"],sw:["kwenye"]}}],errorCodes:["MISSING_ARGUMENT","NO_VALID_CLASS_NAMES","PROPERTY_REQUIRES_VALUE"],preconditions:[{condition:"Command has at least one argument",errorCode:"MISSING_ARGUMENT",message:"add command requires an argument"}],recoveryHints:{MISSING_ARGUMENT:"Add a class selector (.classname) or attribute to add",NO_VALID_CLASS_NAMES:"Ensure class names start with a dot (.) and are valid CSS identifiers",PROPERTY_REQUIRES_VALUE:"When adding a property (*prop), provide a value argument"}},Hd={action:"remove",description:"Remove a class or attribute from an element",category:"dom-class",primaryRole:"patient",ast:{args:["patient"],modifiers:{from:"source"}},targetRole:"source",roles:[{role:"patient",description:"The class/attribute to remove, or the element to remove",required:!0,expectedTypes:["selector","reference"],svoPosition:1,sovPosition:2},{role:"source",description:"The element to remove from (defaults to me)",required:!1,expectedTypes:["selector","reference","expression"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}],errorCodes:["MISSING_ARGUMENT","NO_VALID_CLASS_NAMES"],preconditions:[{condition:"Command has at least one argument",errorCode:"MISSING_ARGUMENT",message:"remove command requires an argument"}],recoveryHints:{MISSING_ARGUMENT:"Add a class selector (.classname) or attribute to remove",NO_VALID_CLASS_NAMES:"Ensure class names start with a dot (.) and are valid CSS identifiers"}},Kd={action:"put",description:"Put content into a target element or variable",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The content to put",required:!0,expectedTypes:["literal","selector","reference","expression"],svoPosition:1,sovPosition:1},{role:"destination",description:"Where to put the content",required:!0,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:2,markerOverride:{en:"into",ar:"\u0641\u064a",zh:"\u5230",fr:"dans",de:"in",he:"\u05d1",id:"ke",sw:"kwa"},markerVariants:{en:["before","after"]},markerLegacy:{ar:["\u0639\u0644\u0649","\u0625\u0644\u0649","\u0628"],zh:["\u5728","\u4e8e"],fr:["sur","\u00e0"],de:["auf","zu"],he:["\u05e2\u05dc","\u05d0\u05dc","\u05dc"],id:["pada","di"],sw:["kwenye"]},methodCarrier:"method"}],errorCodes:["MISSING_ARGUMENTS","MISSING_CONTENT","MISSING_POSITION","INVALID_POSITION","NO_TARGET","NO_ELEMENTS"],preconditions:[{condition:"Command has content and position arguments",errorCode:"MISSING_ARGUMENTS",message:"put requires arguments"},{condition:"Content to put is specified",errorCode:"MISSING_CONTENT",message:"put requires content"},{condition:"Position keyword is specified (into, before, after, etc.)",errorCode:"MISSING_POSITION",message:"put requires position keyword"}],recoveryHints:{MISSING_ARGUMENTS:"Use syntax: put <content> into/before/after <target>",MISSING_CONTENT:"Add content to put (string, element, or expression)",MISSING_POSITION:"Add position keyword: into, before, after, at start of, at end of",INVALID_POSITION:"Valid positions: into, before, after, at start of, at end of",NO_TARGET:'Ensure target element exists or use "me" reference',NO_ELEMENTS:"Check that the selector matches existing elements"}},Fd={action:"set",description:"Set a property or variable to a value",category:"variable",primaryRole:"destination",ast:{args:["destination"],modifiers:{to:"patient",on:"scope"}},roles:[{role:"destination",description:"The property or variable to set",required:!0,expectedTypes:["selector","reference","expression","property-path"],svoPosition:1,sovPosition:1,markerOverride:{en:"",es:"",ja:"\u3092",ko:"\ub97c",tr:"i",ar:"",sw:"",tl:"",bn:"\u0995\u09c7",qu:"ta",hi:"\u0915\u094b",zh:"\u628a"},markerOptional:{zh:!0}},{role:"patient",description:"The value to set",required:!0,expectedTypes:["literal","expression","reference"],svoPosition:2,sovPosition:2,markerOverride:{en:"to",es:"a",pt:"para",fr:"\u00e0",de:"auf",id:"ke",ja:"\u306b",ko:"\uc5d0",tr:"e",ar:"\u0625\u0644\u0649",sw:"kwenye",tl:"sa",bn:"\u09a4\u09c7",qu:"man",hi:"\u092e\u0947\u0902",zh:"\u5230"},markerVariants:{tr:["e","a","ye","ya"],zh:["\u4e3a","\u70ba","\u6210"]}},{role:"scope",description:"The element(s) the attribute/property is set on (defaults to me)",required:!1,expectedTypes:["selector","reference"],svoPosition:3,sovPosition:3,markerOverride:{en:"on",es:"on",pt:"on",fr:"on",de:"on",it:"on",id:"on",ms:"on",sw:"on",tl:"on",zh:"on",vi:"on",ru:"on",uk:"on",pl:"on",th:"on",he:"on",ar:"on",ja:"on",ko:"on",tr:"on",hi:"on",bn:"on",qu:"on"}}],errorCodes:["MISSING_TARGET","INVALID_TARGET","MISSING_VALUE","INVALID_SYNTAX"],preconditions:[{condition:"Command has a target variable or property",errorCode:"MISSING_TARGET",message:"set command requires a target"},{condition:"Target is a valid variable or property reference",errorCode:"INVALID_TARGET",message:"set command target must be a string or object literal"},{condition:'Value is specified with "to" keyword',errorCode:"MISSING_VALUE",message:'set command requires a value (use "to" keyword)'}],recoveryHints:{MISSING_TARGET:"Add a target: set :variable to value OR set element.property to value",INVALID_TARGET:'Use local variable (:name), element property (el.prop), or "the X of Y" syntax',MISSING_VALUE:'Add "to <value>" to specify what to set',INVALID_SYNTAX:"Use syntax: set <target> to <value>"}},Ud={action:"bind",description:"Reactively bind a variable to an element or property value",category:"variable",primaryRole:"destination",roles:[{role:"destination",description:"The variable to bind",required:!0,expectedTypes:["reference","expression"],svoPosition:1,sovPosition:1,markerOverride:{en:"",es:"",pt:"",fr:"",de:"",it:"",id:"",ms:"",vi:"",ru:"",uk:"",pl:"",th:"",zh:"",he:"",ar:"",sw:"",tl:"",ja:"\u3092",ko:"\ub97c",tr:"i",bn:"\u0995\u09c7",qu:"ta",hi:"\u0915\u094b"}},{role:"source",description:"The element or property to bind to",required:!0,expectedTypes:["selector","reference","expression","property-path"],svoPosition:2,sovPosition:2,markerOverride:{en:"to",es:"a",pt:"para",fr:"\u00e0",de:"zu",it:"in",id:"ke",ms:"ke",vi:"v\u00e0o",ru:"\u0432",uk:"\u0432",pl:"do",ja:"\u306b",ko:"\uc5d0",tr:"e",ar:"\u0625\u0644\u0649",zh:"\u5230",he:"\u05dc",sw:"kwa",th:"\u0e43\u0e19",tl:"sa",bn:"\u09a4\u09c7",qu:"man",hi:"\u092e\u0947\u0902"}}],errorCodes:["MISSING_TARGET","MISSING_VALUE","INVALID_SYNTAX"],recoveryHints:{MISSING_TARGET:"Add a variable to bind: bind $name to #input",MISSING_VALUE:'Add "to <element>" to specify the binding source',INVALID_SYNTAX:"Use syntax: bind <variable> to <element>"}},Gd={action:"live",description:"Reactive block: re-run the body when its dependencies change",category:"control-flow",primaryRole:"patient",hasBody:!0,bareKeyword:!0,roles:[]},Zd={action:"eventsource",description:"Open a Server-Sent Events stream and handle its events",category:"async",primaryRole:"patient",hasBody:!0,bareKeyword:!0,roles:[]},Yd={action:"socket",description:"Open a WebSocket and handle its messages",category:"async",primaryRole:"patient",hasBody:!0,bareKeyword:!0,roles:[]},Xd={action:"worker",description:"Define a Web Worker with inline methods",category:"async",primaryRole:"patient",hasBody:!0,bareKeyword:!0,roles:[]},Jd={action:"intercept",description:"Service-worker fetch interception / caching strategies",category:"async",primaryRole:"patient",hasBody:!0,bareKeyword:!0,roles:[]},Qd={action:"show",description:"Make an element visible",category:"dom-visibility",primaryRole:"patient",ast:{args:[["destination","patient"]],modifiers:{with:"duration"}},roles:[{role:"patient",description:"The element to show",required:!0,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1},{role:"style",description:"Animation style (fade, slide, etc.)",required:!1,expectedTypes:["literal"],svoPosition:2,sovPosition:2}]},em={action:"hide",description:"Make an element invisible",category:"dom-visibility",primaryRole:"patient",ast:{args:[["destination","patient"]],modifiers:{with:"duration"}},roles:[{role:"patient",description:"The element to hide",required:!0,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1},{role:"style",description:"Animation style (fade, slide, etc.)",required:!1,expectedTypes:["literal"],svoPosition:2,sovPosition:2}]},tm={action:"on",description:"Handle an event",category:"event",primaryRole:"event",ast:{args:["event"],modifiers:{from:"source"}},hasBody:!0,roles:[{role:"event",description:"The event to handle",required:!0,expectedTypes:["literal"],svoPosition:1,sovPosition:2},{role:"source",description:"The element to listen on (defaults to me)",required:!1,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}]},rm={action:"trigger",description:"Trigger/dispatch an event",category:"event",primaryRole:"event",ast:{args:["event"],modifiers:{on:"destination"}},roles:[{role:"event",description:"The event to trigger (supports namespaced events like draggable:start)",required:!0,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:2,markerVariants:{hi:["\u0915\u094b"],qu:["ta"],bn:["\u0995\u09c7"]}},{role:"destination",description:"The target element (defaults to me)",required:!1,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}]},nm={action:"wait",description:"Wait for a duration or event",category:"async",primaryRole:"duration",roles:[{role:"duration",description:"Duration or event to wait for",required:!0,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1}]},im={action:"fetch",description:"Fetch data from a URL",category:"async",primaryRole:"source",ast:{args:["source"],modifiers:{with:["style","method"],as:"responseType",body:"patient"},isBlocking:!0},roles:[{role:"source",description:"The URL to fetch from",required:!0,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1,renderOverride:{en:""}},{role:"style",description:"Request options object (method, headers, body, credentials\u2026)",required:!1,expectedTypes:["expression"],svoPosition:2,sovPosition:2},{role:"responseType",description:"Response format (json, text, html, blob, etc.)",required:!1,expectedTypes:["literal","expression"],svoPosition:3,sovPosition:3,markerOverride:{en:"as",ja:"\u3068\u3057\u3066"}},{role:"method",description:"HTTP method (GET, POST, etc.)",required:!1,expectedTypes:["literal"],svoPosition:4,sovPosition:4},{role:"destination",description:"Where to store the result",required:!1,expectedTypes:["selector","reference"],svoPosition:5,sovPosition:5}]},am={action:"increment",description:"Increment a numeric value",category:"variable",primaryRole:"patient",ast:{args:[["destination","patient"]],modifiers:{by:"quantity"}},roles:[{role:"patient",description:"The value to increment",required:!0,expectedTypes:["selector","reference","expression"],svoPosition:1,sovPosition:1},{role:"quantity",description:"Amount to increment by (defaults to 1)",required:!1,expectedTypes:["literal"],default:{type:"literal",value:1,dataType:"number"},svoPosition:2,sovPosition:2,markerOverride:{en:"by",es:"por",pt:"por",fr:"par",de:"um"}}]},om={action:"decrement",description:"Decrement a numeric value",category:"variable",primaryRole:"patient",ast:{args:[["destination","patient"]],modifiers:{by:"quantity"}},roles:[{role:"patient",description:"The value to decrement",required:!0,expectedTypes:["selector","reference","expression"],svoPosition:1,sovPosition:1},{role:"quantity",description:"Amount to decrement by (defaults to 1)",required:!1,expectedTypes:["literal"],default:{type:"literal",value:1,dataType:"number"},svoPosition:2,sovPosition:2,markerOverride:{en:"by",es:"por",pt:"por",fr:"par",de:"um"}}]},sm={action:"append",description:"Append content to an element",category:"dom-content",primaryRole:"patient",ast:{args:["patient"],modifiers:{to:"destination"}},omitRoleVariants:["destination"],roles:[{role:"patient",description:"The content to append",required:!0,expectedTypes:["literal","selector","reference","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"The element to append to",required:!0,expectedTypes:["selector","reference","expression"],svoPosition:2,sovPosition:1,markerOverride:{en:"to"}}]},lm={action:"prepend",description:"Prepend content to an element",category:"dom-content",primaryRole:"patient",ast:{args:["patient"],modifiers:{to:"destination"}},omitRoleVariants:["destination"],roles:[{role:"patient",description:"The content to prepend",required:!0,expectedTypes:["literal","selector","reference","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"The element to prepend to",required:!0,expectedTypes:["selector","reference","expression"],svoPosition:2,sovPosition:1,markerOverride:{en:"to"}}]},cm={action:"log",description:"Log a value to the console",category:"variable",primaryRole:"patient",ast:{args:["patient"]},roles:[{role:"patient",description:"The value to log",required:!0,expectedTypes:["literal","selector","reference","expression"],svoPosition:1,sovPosition:1}]},um={action:"get",description:"Get a value from a source",category:"variable",primaryRole:"source",ast:{args:[["source","patient"]]},roles:[{role:"source",description:"The source to get from",required:!0,expectedTypes:["selector","reference","expression"],svoPosition:1,sovPosition:2,markerOverride:{en:"",es:"",pt:"",fr:"",de:"",ja:"\u3092",zh:"",ko:"\ub97c",ar:"\u0639\u0644\u0649",tr:"i",id:"",he:"\u05d0\u05ea",sw:"",tl:"",bn:"\u0995\u09c7",qu:"ta"}},{role:"destination",description:"Where to store the result (optional)",required:!1,expectedTypes:["reference"],svoPosition:2,sovPosition:1}]},pm={action:"take",description:"Take content from a source element",category:"dom-content",primaryRole:"patient",ast:{args:["patient"],modifiers:{from:"source",for:"recipient"}},roles:[{role:"patient",description:"The class or element to take",required:!0,expectedTypes:["selector"],svoPosition:1,sovPosition:2},{role:"source",description:"The element to take from (defaults to all current holders)",required:!1,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:1},{role:"recipient",description:"The element the class moves ONTO (`take .active from .tab for me`)",required:!1,expectedTypes:["reference"],svoPosition:3,sovPosition:3,valueShape:"reference",markerOverride:{en:"for"}}]},dm={action:"make",description:"Create a new element",category:"dom-content",primaryRole:"patient",ast:{args:["patient"]},roles:[{role:"patient",description:"The element type or selector to create",required:!0,expectedTypes:["literal","selector"],svoPosition:1,sovPosition:1}]},mm={action:"halt",description:"Halt/stop execution or event propagation",category:"control-flow",primaryRole:"patient",ast:{args:["patient"]},roles:[{role:"patient",description:"What to halt (event, default, bubbling, etc.)",required:!1,expectedTypes:["literal","reference","expression"],svoPosition:1,sovPosition:1}]},fm={action:"settle",description:"Wait for animations/transitions to settle",category:"async",primaryRole:"patient",ast:{args:[["destination","patient"]],isBlocking:!0},roles:[{role:"patient",description:"The element to settle (defaults to me)",required:!1,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},hm={action:"throw",description:"Throw an error",category:"control-flow",primaryRole:"patient",ast:{args:["patient"]},roles:[{role:"patient",description:"The error message or object to throw",required:!0,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1}]},ym={action:"send",description:"Send an event to an element",category:"event",primaryRole:"event",ast:{args:["event"],modifiers:{to:"destination",detail:"patient"}},roles:[{role:"event",description:"The event to send",required:!0,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"The target element (defaults to me)",required:!1,expectedTypes:["selector","reference","expression"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1,markerOverride:{en:"to",ja:"\u306b",ar:"\u0625\u0644\u0649",es:"a",ko:"\uc5d0\uac8c",zh:"\u5230",tr:"-e",pt:"para",fr:"\u00e0",de:"an",id:"ke",qu:"-man",sw:"kwa"}}]},vm={action:"if",description:"Conditional execution",category:"control-flow",primaryRole:"condition",ast:{args:["condition"]},hasBody:!0,roles:[{role:"condition",description:"The condition to evaluate",required:!0,expectedTypes:["expression","reference","selector"],svoPosition:1,sovPosition:1}]},gm={action:"unless",description:"Negated conditional execution (executes when condition is false)",category:"control-flow",primaryRole:"condition",ast:{args:["condition"]},hasBody:!0,roles:[{role:"condition",description:"The condition to evaluate (body executes when false)",required:!0,expectedTypes:["expression","reference","selector"],svoPosition:1,sovPosition:1}]},km={action:"else",description:"Else branch of conditional",category:"control-flow",primaryRole:"patient",hasBody:!0,roles:[]},wm={action:"repeat",description:"Repeat a block of commands",category:"control-flow",primaryRole:"loopType",ast:{args:[["quantity","patient"]]},hasBody:!0,roles:[{role:"loopType",description:"Loop variant: forever, times, for, while, until, until-event",required:!0,expectedTypes:["literal"],svoPosition:0,sovPosition:0},{role:"quantity",description:"Number of times to repeat",required:!1,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1},{role:"event",description:"Event to wait for (terminates loop)",required:!1,expectedTypes:["literal","expression"],svoPosition:2,sovPosition:2},{role:"source",description:"Element to listen for event on",required:!1,expectedTypes:["selector","reference"],svoPosition:3,sovPosition:3}],notes:'Can also use "repeat forever", "repeat until condition", or "repeat until event X from Y"'},bm={action:"for",description:"Iterate over a collection",category:"control-flow",primaryRole:"patient",ast:{args:["patient"],modifiers:{in:"source"}},hasBody:!0,roles:[{role:"patient",description:"The iteration variable",required:!0,expectedTypes:["reference","expression"],svoPosition:1,sovPosition:2},{role:"source",description:"The collection to iterate over",required:!0,expectedTypes:["selector","reference","expression"],svoPosition:2,sovPosition:1,markerOverride:{en:"in",es:"en",fr:"en",de:"in",it:"in",pt:"dentro",id:"dalam",ms:"dalam",pl:"w",ru:"\u0432",uk:"\u0443",sw:"ndani",th:"\u0e43\u0e19",vi:"trong",ar:"\u0641\u064a",tl:"sa_loob",he:"in",zh:"\u5728"}}]},zm={action:"while",description:"Loop while condition is true",category:"control-flow",primaryRole:"condition",ast:{args:["condition"]},hasBody:!0,roles:[{role:"condition",description:"The condition to check",required:!0,expectedTypes:["expression"],svoPosition:1,sovPosition:1}]},xm={action:"continue",description:"Continue to next loop iteration",category:"control-flow",primaryRole:"patient",ast:{},roles:[]},Tm={action:"go",description:"Navigate to a URL",category:"navigation",primaryRole:"destination",roles:[{role:"destination",description:"The URL to navigate to",required:!0,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1,markerOverride:{en:"to",es:"a",ar:"\u0625\u0644\u0649",fr:"\u00e0",de:"zu",pt:"para",he:"\u05d0\u05dc",hi:"\u092a\u0930",id:"ke",it:"a",ru:"\u043d\u0430",sw:"kwa",uk:"\u043d\u0430"},renderOverride:{en:"",zh:"",vi:"",th:""},markerOptional:{en:!0,zh:!0,vi:!0,th:!0},markerVariants:{zh:["\u628a"]},markerLegacy:{es:["en","sobre","hacia"],ar:["\u0639\u0644\u0649","\u0641\u064a","\u0628"],fr:["sur","dans"],de:["auf","in"],pt:["em","a"],he:["\u05e2\u05dc","\u05d1","\u05dc","\u05d0\u05ea"],hi:["\u092e\u0947\u0902"],id:["pada","di"],it:["in","su"],ru:["\u0432","\u043a"],sw:["kwenye"],uk:["\u0432","\u0434\u043e"]}}],rolePrefixLiteralVariants:[{role:"destination",literal:Em={en:"url",es:"url",pt:"url",fr:"url",de:"url",it:"url",ja:"url",ko:"url",zh:"url",ar:"url",he:"url",hi:"url",bn:"url",tr:"url",ru:"url",uk:"url",pl:"url",id:"url",vi:"url",th:"url",ms:"url",tl:"url",sw:"url",qu:"url"},idSuffix:"url",priorityDelta:5,methodCarrier:"method"}]},Sm={action:"transition",description:"Transition an element with animation",category:"dom-visibility",primaryRole:"patient",ast:{args:["patient"],modifiers:{to:"goal",over:"duration",on:"destination"}},omitRoleVariants:["goal"],roles:[{role:"patient",description:"The property to transition (opacity, *background-color, etc.)",required:!0,expectedTypes:["literal","expression","selector"],svoPosition:1,sovPosition:2,markerOverride:{en:"",ar:"",tl:"",sw:""}},{role:"goal",description:"The target value to transition to",required:!0,expectedTypes:["literal","expression"],svoPosition:2,sovPosition:3,markerOverride:{en:"to",ar:"\u0625\u0644\u0649",tl:"sa",sw:"kwa",bn:"\u09a4\u09c7",qu:"man",es:"a",pt:"para",fr:"\u00e0",de:"zu",he:"\u05e2\u05dc",it:"in",ja:"\u306b",ko:"\uc5d0",ms:"ke",pl:"do",ru:"\u0432",th:"\u0e43\u0e19",tr:"e",uk:"\u0432",vi:"v\u00e0o",zh:"\u5230",id:"ke"}},{role:"destination",description:"The target element (defaults to me)",required:!1,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:3,sovPosition:1},{role:"duration",description:"Transition duration (over 500ms, for 2 seconds)",required:!1,expectedTypes:["literal"],svoPosition:4,sovPosition:4,markerOverride:{en:"over"}},{role:"style",description:"Easing function (ease-in, linear, etc.)",required:!1,expectedTypes:["literal"],svoPosition:5,sovPosition:5}]},Cm={action:"clone",description:"Clone an element",category:"dom-content",primaryRole:"patient",ast:{args:[["source","patient"]],modifiers:{into:"destination"}},roles:[{role:"patient",description:"The element to clone",required:!0,expectedTypes:["selector","reference"],svoPosition:1,sovPosition:2},{role:"destination",description:"Where to put the clone",required:!1,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:1,markerOverride:{en:"into"}}]},Am={action:"focus",description:"Focus an element",category:"dom-content",primaryRole:"patient",ast:{args:[["destination","patient"]]},roles:[{role:"patient",description:"The element to focus (defaults to me)",required:!1,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},Lm={action:"blur",description:"Remove focus from an element",category:"dom-content",primaryRole:"patient",ast:{args:[["destination","patient"]]},roles:[{role:"patient",description:"The element to blur (defaults to me)",required:!1,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},jm={action:"empty",description:"Remove all children from an element (sets innerHTML to empty)",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element to empty (defaults to me)",required:!1,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},Pm={action:"open",description:"Open a dialog, details element, or popover",category:"dom-content",primaryRole:"patient",ast:{args:["patient"],modifiers:{as:"style"}},roles:[{role:"patient",description:"The element to open (defaults to me)",required:!1,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:2},{role:"style",description:"Open-mode variant (modal / non-modal) for <dialog>",required:!1,expectedTypes:["literal","expression"],svoPosition:2,sovPosition:1,markerOverride:{en:"as",ja:"\u3068\u3057\u3066"}}]},Om={action:"close",description:"Close a dialog, details element, or popover",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element to close (defaults to me)",required:!1,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},Nm={action:"select",description:"Select the contents of a text field or DOM element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element whose contents to select (defaults to me)",required:!1,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},Rm={action:"clear",description:"Clear a variable, local, or input element",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The variable or element to clear (defaults to me)",required:!1,expectedTypes:["selector","reference","expression"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},Mm={action:"reset",description:"Reset a <form> element to its default values",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The form element to reset (defaults to me)",required:!1,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},Im={action:"breakpoint",description:"Drop into the debugger",category:"control-flow",primaryRole:"patient",roles:[],bareKeyword:!0},Wm={action:"call",description:"Call a function",category:"control-flow",primaryRole:"patient",ast:{args:["patient"]},roles:[{role:"patient",description:"The function to call",required:!0,expectedTypes:["expression","reference"],markerOptional:{he:!0,zh:!0},svoPosition:1,sovPosition:1}]},_m={action:"return",description:"Return a value from a function",category:"control-flow",primaryRole:"patient",ast:{args:["patient"]},roles:[{role:"patient",description:"The value to return",required:!1,expectedTypes:["literal","expression","reference"],svoPosition:1,sovPosition:1}]},qm={action:"js",description:"Execute raw JavaScript code",category:"control-flow",primaryRole:"patient",ast:{args:["patient"]},hasBody:!0,roles:[{role:"patient",description:"The JavaScript code to execute",required:!1,expectedTypes:["expression"],svoPosition:1,sovPosition:1}]},$m={action:"async",description:"Execute commands asynchronously",category:"async",primaryRole:"patient",ast:{},hasBody:!0,roles:[]},Vm={action:"tell",description:"Execute commands in context of another element",category:"control-flow",primaryRole:"destination",ast:{args:[["destination","patient"]]},hasBody:!0,roles:[{role:"destination",description:"The element to tell",required:!0,expectedTypes:["selector","reference"],svoPosition:1,sovPosition:1,markerOverride:{en:"",he:"\u05d0\u05ea",zh:"\u628a"}}]},Dm={action:"default",description:"Set a default value for a variable",category:"variable",primaryRole:"destination",ast:{args:["destination"],modifiers:{to:"patient"}},roles:[{role:"destination",description:"The variable to set default for",required:!0,expectedTypes:["selector","reference","expression","property-path"],svoPosition:1,sovPosition:1,markerOverride:{en:"",ar:"",tl:"",sw:"",bn:"\u0995\u09c7",qu:"ta",ja:"\u3092",ko:"\ub97c",tr:"i",hi:"\u0915\u094b",de:"",es:"",fr:"",it:"",pt:"",pl:"",ru:"",uk:"",vi:"",id:"",ms:"",th:"",zh:"\u628a",he:"\u05d0\u05ea"}},{role:"patient",description:"The default value",required:!0,expectedTypes:["literal","expression"],svoPosition:2,sovPosition:2,markerOverride:{en:"to",ar:"\u0625\u0644\u0649",tl:"sa",sw:"kwa",bn:"\u09a4\u09c7",qu:"man",ja:"\u306b",ko:"\uc5d0",tr:"e",hi:"\u092e\u0947\u0902",de:"zu",es:"a",fr:"\u00e0",it:"in",pt:"para",pl:"do",ru:"\u0432",uk:"\u0432",vi:"v\u00e0o",id:"ke",ms:"ke",th:"\u0e43\u0e19",zh:"\u5230",he:"\u05e2\u05dc"}}]},Bm={action:"init",description:"Initialization block that runs once",category:"control-flow",primaryRole:"patient",ast:{},hasBody:!0,roles:[]},Hm={action:"behavior",description:"Define a reusable behavior",category:"control-flow",primaryRole:"patient",ast:{args:["patient"]},hasBody:!0,roles:[{role:"patient",description:"The behavior name (PascalCase identifier)",required:!0,expectedTypes:["literal","reference","expression"],svoPosition:1,sovPosition:1}]},Km={action:"install",description:"Install a behavior on an element",category:"control-flow",primaryRole:"patient",ast:{args:["patient"],modifiers:{on:"destination"}},roles:[{role:"patient",description:"The behavior name to install",required:!0,expectedTypes:["literal","reference","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"Element to install on (defaults to me)",required:!1,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}]},Fm={action:"measure",description:"Measure element dimensions (x, y, width, height, etc.)",category:"dom-content",primaryRole:"patient",ast:{args:["patient"],modifiers:{of:["destination","source"]}},roles:[{role:"patient",description:"Property to measure (x, y, width, height, top, left, etc.)",required:!1,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1},{role:"source",description:"Element to measure (defaults to me)",required:!1,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:2,markerOverride:{en:"of"}}]},Um={role:"manner",description:"Run the swap inside a `document.startViewTransition()` (`using view transition`)",required:!1,expectedTypes:["literal","expression"],valueShape:"keyword",markerOverride:{en:"using view",es:"using view",pt:"using view",fr:"using view",de:"using view",it:"using view",ja:"using view",ko:"using view",zh:"using view",ar:"using view",he:"using view",hi:"using view",bn:"using view",tr:"using view",ru:"using view",uk:"using view",pl:"using view",id:"using view",vi:"using view",th:"using view",ms:"using view",tl:"using view",sw:"using view",qu:"using view"}},Gm={action:"swap",description:"Swap DOM content using various strategies (innerHTML, outerHTML, delete, etc.)",category:"dom-content",primaryRole:"destination",ast:{args:["method","destination","patient"],modifiers:{viewTransition:"manner"}},roles:[{role:"method",description:"The swap strategy (innerHTML, outerHTML, beforebegin, afterend, delete)",required:!1,expectedTypes:["literal"],svoPosition:1,sovPosition:3,markerOverride:{en:""}},{role:"destination",description:"The element to swap content in/for",required:!0,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:1,markerOverride:{en:"of",es:"",fr:"",pt:"",it:"",de:"",pl:"",ru:"",uk:"",id:"",ms:"",sw:"",th:"",vi:"",he:"\u05d0\u05ea",zh:"\u628a"}},{role:"patient",description:"The content to swap in (optional for delete)",required:!1,expectedTypes:["literal","expression","selector"],svoPosition:3,sovPosition:2,markerOverride:{en:"with",es:"con",fr:"avec",pt:"com",it:"con",de:"mit",pl:"z",ru:"\u0441",uk:"\u0437",id:"dengan",ms:"dengan",sw:"na",th:"\u0e14\u0e49\u0e27\u0e22",vi:"v\u1edbi",he:"\u05e2\u05dd",zh:"\u7528",hi:"\u0938\u0947",bn:"\u09a6\u09bf\u09af\u09bc\u09c7",tr:"ile",qu:"wan",ar:"\u0628\u0640",tl:"nang"}},{...Um,svoPosition:4,sovPosition:4}]},Zm={action:"morph",description:"Morph an element into another using DOM diffing",category:"dom-content",primaryRole:"patient",ast:{args:[["source","destination"]],modifiers:{on:"patient",viewTransition:"manner"}},roles:[{role:"patient",description:"The element to morph",required:!0,expectedTypes:["selector","reference"],svoPosition:1,sovPosition:1,markerOverride:{en:""}},{role:"destination",description:"The target content/element to morph into",required:!0,expectedTypes:["literal","expression","selector","reference"],svoPosition:2,sovPosition:2,markerOverride:{en:"to"}},{...Um,svoPosition:3,sovPosition:3}]},Ym={action:"beep",description:"Debug output for expressions with type information",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The expression(s) to debug",required:!1,expectedTypes:["literal","selector","reference","expression"],svoPosition:1,sovPosition:1}]},Xm={action:"break",description:"Exit from the current loop",category:"control-flow",primaryRole:"patient",roles:[]},Jm={action:"copy",description:"Copy text or element content to the clipboard",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The text or element to copy",required:!0,expectedTypes:["literal","selector","reference","expression"],svoPosition:1,sovPosition:1}]},Qm={action:"exit",description:"Exit from the current event handler",category:"control-flow",primaryRole:"patient",roles:[],bareKeyword:!0},ef={action:"pick",description:"Select item(s), character(s), a range, first/last/random N, or regex matches from a root",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The range/count/index/regex argument to pick",required:!0,expectedTypes:["literal","expression","reference"],svoPosition:1,sovPosition:1},{role:"source",description:'The root to pick from (with "of"/"from" keyword)',required:!1,expectedTypes:["reference","expression"],svoPosition:2,sovPosition:2}]},tf={action:"scroll",description:"Scroll the viewport to a target element",category:"navigation",primaryRole:"destination",ast:{args:["destination"]},argSkipTokens:["of","the","top","bottom","middle","center","nearest","left","right","smoothly","instantly"],roles:[{role:"destination",description:"The element to scroll to",required:!0,expectedTypes:["selector","reference","expression"],svoPosition:1,sovPosition:1,markerOverride:{en:"to"}}]},rf={action:"push",description:"Push a URL onto the browser history",category:"navigation",primaryRole:"patient",roles:[{role:"patient",description:"The URL to push (after the `url` keyword)",required:!0,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1,markerOverride:Em}]},nf={action:"replace",description:"Replace the current browser history entry with a URL",category:"navigation",primaryRole:"patient",roles:[{role:"patient",description:"The URL to replace with (after the `url` keyword)",required:!0,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1,markerOverride:Em}]},af={action:"process",description:"Process hx-partial markup in HTML content",category:"dom-content",primaryRole:"patient",ast:{args:["patient"],modifiers:{viewTransition:"manner"}},roles:[{role:"patient",description:"The HTML content (string, element, or response) to process",required:!0,expectedTypes:["literal","reference","expression"],svoPosition:1,sovPosition:1,markerOverride:{en:"partials in",es:"partials in",pt:"partials in",fr:"partials in",de:"partials in",it:"partials in",ja:"partials in",ko:"partials in",zh:"partials in",ar:"partials in",he:"partials in",hi:"partials in",bn:"partials in",tr:"partials in",ru:"partials in",uk:"partials in",pl:"partials in",id:"partials in",vi:"partials in",th:"partials in",ms:"partials in",tl:"partials in",sw:"partials in",qu:"partials in"}},{...Um,svoPosition:2,sovPosition:2}]},of={toggle:Dd,add:Bd,remove:Hd,put:Kd,set:Fd,show:Qd,hide:em,on:tm,trigger:rm,wait:nm,fetch:im,increment:am,decrement:om,append:sm,prepend:lm,log:cm,get:um,take:pm,make:dm,halt:mm,settle:fm,throw:hm,send:ym,if:vm,unless:gm,else:km,repeat:wm,for:bm,while:zm,continue:xm,go:Tm,scroll:tf,push:rf,replace:nf,process:af,transition:Sm,clone:Cm,focus:Am,blur:Lm,empty:jm,open:Pm,close:Om,select:Nm,clear:Rm,reset:Mm,breakpoint:Im,call:Wm,return:_m,js:qm,async:$m,tell:Vm,default:Dm,init:Bm,behavior:Hm,install:Km,measure:Fm,swap:Gm,morph:Zm,beep:Ym,break:Xm,copy:Jm,exit:Qm,pick:ef,render:{action:"render",description:"Render a template with optional variables",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The template to render",required:!0,expectedTypes:["selector","reference","expression"],svoPosition:1,sovPosition:2},{role:"style",description:"Variables to pass to the template (with keyword)",required:!1,expectedTypes:["expression","reference"],svoPosition:2,sovPosition:1}]},bind:Ud,live:Gd,eventsource:Zd,socket:Yd,worker:Xd,intercept:Jd,compound:{action:"compound",description:"A compound node representing chained statements",primaryRole:"patient",category:"control-flow",hasBody:!0,roles:[]}},"undefined"!=typeof process&&"1"===process.env.LOKASCRIPT_SCHEMA_VALIDATION&&Promise.resolve().then(()=>(sf(),Rd)).then(({validateAllSchemas:e,formatValidationResults:t})=>{const r=e(of);r.size>0&&(console.warn("[SCHEMA VALIDATION] Found issues in command schemas:"),console.warn(t(r)),console.warn("\nThese warnings help identify potential schema design issues."),console.warn("Fix them to improve type inference and avoid runtime bugs."))}).catch(e=>{})}});function bf(e,t){const r={...e};for(const n of Object.keys(t)){const i=t[n],a=e[n];void 0!==i&&(r[n]="object"!=typeof i||null===i||Array.isArray(i)||"object"!=typeof a||null===a||Array.isArray(a)?i:bf(a,i))}return r}function zf(e,t){return bf(e,t)}function xf(e){if(!e.extends)return e;const t=yf.get(e.extends);if(!t)return console.warn(`[Registry] Profile '${e.code}' extends '${e.extends}' but base is not registered. Make sure to import the base language before the variant.`),e;return zf(xf(t),e)}function Ef(e,t,r){hf.set(e,t),yf.set(e,r),vf.delete(e)}function Tf(e,t){kf.set(e,t),vf.delete(e)}function Sf(e){return e.split("-")[0]}function Cf(e){return e.includes("-")}function Af(e){let t=yf.get(e);return!t&&Cf(e)&&(t=yf.get(Sf(e))),t?xf(t):void 0}function Lf(){return Array.from(hf.keys())}function jf(e){if(hf.has(e)&&yf.has(e))return!0;if(Cf(e)){const t=Sf(e);return hf.has(t)&&yf.has(t)}return!1}function Pf(e,t){return function(e){let t=hf.get(e);if(!t&&Cf(e)){const r=Sf(e);t=hf.get(r)}if(!t){const t=Array.from(hf.keys()).join(", ");throw Error(`Language '${e}' is not registered. Registered languages: ${t||"none"}. Import the language module first: import '@lokascript/semantic/languages/${e}';`)}return t}(t).tokenize(e)}function Of(e){let t=vf.get(e);if(!t&&Cf(e)&&(t=vf.get(Sf(e))),t)return t;let r=kf.get(e);if(!r&&Cf(e)&&(r=kf.get(Sf(e))),r)return vf.set(e,r),r;if(!gf)throw Error(`No patterns registered for language '${e}'. Either import the language module or set a pattern generator.`);const n=function(e){let t=yf.get(e);if(!t&&Cf(e)){const r=Sf(e);t=yf.get(r)}if(!t){const t=Array.from(yf.keys()).join(", ");throw Error(`Language profile '${e}' is not registered. Registered languages: ${t||"none"}. Import the language module first: import '@lokascript/semantic/languages/${e}';`)}return xf(t)}(e),i=gf(n);return vf.set(e,i),i}var Nf,Rf=Cd({"src/registry.ts"(){hf=new Map,yf=new Map,vf=new Map,gf=null,kf=new Map}}),Mf={};Ad(Mf,{arabicProfile:()=>Nf});var If,Wf=Cd({"src/generators/profiles/arabic.ts"(){Nf={code:"ar",name:"Arabic",nativeName:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629",regions:["priority"],direction:"rtl",script:"arabic",wordOrder:"VSO",markingStrategy:"preposition",usesSpaces:!0,verb:{position:"start",subjectDrop:!0},references:{me:"\u0623\u0646\u0627",it:"\u0647\u0648",you:"\u0623\u0646\u062a",result:"\u0627\u0644\u0646\u062a\u064a\u062c\u0629",event:"\u0627\u0644\u062d\u062f\u062b",target:"\u0627\u0644\u0647\u062f\u0641",body:"\u062c\u0633\u0645",document:"\u0648\u062b\u064a\u0642\u0629",window:"\u0646\u0627\u0641\u0630\u0629",detail:"\u062a\u0641\u0627\u0635\u064a\u0644"},possessive:{marker:"",markerPosition:"after-object",usePossessiveAdjectives:!0,specialForms:{me:"\u0644\u064a",it:"\u0644\u0647",you:"\u0644\u0643"},keywords:{"\u0644\u064a":"me","\u0644\u0643":"you","\u0644\u0647":"it","\u0644\u0647\u0627":"it"}},roleMarkers:{destination:{primary:"\u0639\u0644\u0649",alternatives:["\u0641\u064a","\u0625\u0644\u0649","\u0628","\u0642\u0628\u0644","\u0628\u0639\u062f"],position:"before"},source:{primary:"\u0645\u0646",position:"before"},patient:{primary:"",position:"before"},style:{primary:"\u0628\u0640",alternatives:["\u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645"],position:"before"}},keywords:{toggle:{primary:"\u0628\u062f\u0651\u0644",alternatives:["\u0628\u062f\u0644","\u063a\u064a\u0651\u0631","\u063a\u064a\u0631"],normalized:"toggle"},add:{primary:"\u0623\u0636\u0641",alternatives:["\u0627\u0636\u0641"],normalized:"add"},remove:{primary:"\u0627\u062d\u0630\u0641",alternatives:["\u0623\u0632\u0644","\u0627\u0645\u0633\u062d"],normalized:"remove"},put:{primary:"\u0636\u0639",alternatives:["\u0627\u062c\u0639\u0644"],normalized:"put"},append:{primary:"\u0623\u0644\u062d\u0642",normalized:"append"},prepend:{primary:"\u0633\u0628\u0642",normalized:"prepend"},take:{primary:"\u062e\u0630",normalized:"take"},make:{primary:"\u0627\u0635\u0646\u0639",alternatives:["\u0623\u0646\u0634\u0626"],normalized:"make"},clone:{primary:"\u0627\u0633\u062a\u0646\u0633\u062e",normalized:"clone"},swap:{primary:"\u0627\u0633\u062a\u0628\u062f\u0644",alternatives:["\u062a\u0628\u0627\u062f\u0644"],normalized:"swap"},morph:{primary:"\u062d\u0648\u0651\u0644",normalized:"morph"},set:{primary:"\u0627\u0636\u0628\u0637",alternatives:["\u0639\u064a\u0651\u0646","\u062d\u062f\u062f"],normalized:"set"},get:{primary:"\u0627\u062d\u0635\u0644",normalized:"get"},increment:{primary:"\u0632\u0650\u062f",alternatives:["\u0632\u062f","\u0627\u0631\u0641\u0639"],normalized:"increment"},decrement:{primary:"\u0623\u0646\u0642\u0635",alternatives:["\u0627\u0646\u0642\u0635","\u0642\u0644\u0644"],normalized:"decrement"},log:{primary:"\u0633\u062c\u0644",normalized:"log"},show:{primary:"\u0627\u0638\u0647\u0631",alternatives:["\u0623\u0638\u0647\u0631","\u0627\u0639\u0631\u0636"],normalized:"show"},hide:{primary:"\u0627\u062e\u0641",alternatives:["\u0623\u062e\u0641\u0650","\u0627\u062e\u0641\u064a","\u0623\u062e\u0641"],normalized:"hide"},transition:{primary:"\u0627\u0646\u062a\u0642\u0627\u0644",alternatives:["\u0627\u0646\u062a\u0642\u0644"],normalized:"transition"},on:{primary:"\u0639\u0644\u0649",alternatives:["\u0639\u0646\u062f","\u0644\u062f\u0649","\u062d\u064a\u0646"],normalized:"on"},trigger:{primary:"\u062a\u0634\u063a\u064a\u0644",alternatives:["\u0623\u0637\u0644\u0642","\u0641\u0639\u0651\u0644"],normalized:"trigger"},send:{primary:"\u0623\u0631\u0633\u0644",normalized:"send"},focus:{primary:"\u062a\u0631\u0643\u064a\u0632",alternatives:["\u0631\u0643\u0632"],normalized:"focus"},blur:{primary:"\u0636\u0628\u0627\u0628\u064a\u0629",alternatives:["\u0634\u0648\u0634"],normalized:"blur"},empty:{primary:"\u0625\u0641\u0631\u0627\u063a",alternatives:["\u0641\u0627\u0631\u063a"],normalized:"empty"},open:{primary:"\u0627\u0641\u062a\u062d",normalized:"open"},close:{primary:"\u0623\u063a\u0644\u0642",normalized:"close"},select:{primary:"\u0638\u0644\u0644",normalized:"select"},clear:{primary:"\u0646\u0638\u0651\u0641",normalized:"clear"},reset:{primary:"\u0625\u0639\u0627\u062f\u0629-\u0636\u0628\u0637",alternatives:["\u0623\u0639\u062f-\u062a\u0639\u064a\u064a\u0646"],normalized:"reset"},breakpoint:{primary:"\u0646\u0642\u0637\u0629-\u062a\u0648\u0642\u0641",normalized:"breakpoint"},go:{primary:"\u0627\u0630\u0647\u0628",normalized:"go"},scroll:{primary:"\u0645\u0631\u0631",alternatives:["\u062a\u0645\u0631\u064a\u0631"],normalized:"scroll"},push:{primary:"\u0627\u062f\u0641\u0639",alternatives:["\u062f\u0641\u0639"],normalized:"push"},replace:{primary:"\u0627\u0633\u062a\u0628\u062f\u0644_\u0639\u0646\u0648\u0627\u0646",alternatives:["\u0623\u0639\u062f_\u062a\u0639\u064a\u064a\u0646_\u0639\u0646\u0648\u0627\u0646"],normalized:"replace"},process:{primary:"\u0639\u0627\u0644\u062c",alternatives:["\u0645\u0639\u0627\u0644\u062c\u0629"],normalized:"process"},wait:{primary:"\u0627\u0646\u062a\u0638\u0631",normalized:"wait"},fetch:{primary:"\u0627\u062d\u0636\u0631",alternatives:["\u062c\u0644\u0628"],normalized:"fetch"},settle:{primary:"\u0627\u0633\u062a\u0642\u0631",normalized:"settle"},if:{primary:"\u0625\u0630\u0627",normalized:"if"},unless:{primary:"\u0625\u0644\u0627",normalized:"unless"},when:{primary:"\u0639\u0646\u062f\u0645\u0627",normalized:"when"},where:{primary:"\u0623\u064a\u0646",normalized:"where"},else:{primary:"\u0648\u0625\u0644\u0627",alternatives:["\u062e\u0644\u0627\u0641 \u0630\u0644\u0643"],normalized:"else"},repeat:{primary:"\u0643\u0631\u0631",normalized:"repeat"},for:{primary:"\u0644\u0643\u0644",normalized:"for"},while:{primary:"\u0628\u064a\u0646\u0645\u0627",normalized:"while"},forever:{primary:"forever",normalized:"forever"},continue:{primary:"\u0648\u0627\u0635\u0644",normalized:"continue"},halt:{primary:"\u0623\u0648\u0642\u0641",normalized:"halt"},throw:{primary:"\u0627\u0631\u0645",alternatives:["\u0627\u0631\u0645\u0650"],normalized:"throw"},call:{primary:"\u0627\u0633\u062a\u062f\u0639",alternatives:["\u0646\u0627\u062f\u0650"],normalized:"call"},return:{primary:"\u0627\u0631\u062c\u0639",alternatives:["\u0639\u064f\u062f"],normalized:"return"},then:{primary:"\u062b\u0645",alternatives:["\u0628\u0639\u062f\u0647\u0627","\u062b\u0645\u0651"],normalized:"then"},and:{primary:"\u0648\u0623\u064a\u0636\u0627\u064b",alternatives:["\u0623\u064a\u0636\u0627\u064b"],normalized:"and"},matches:{primary:"\u064a\u0637\u0627\u0628\u0642",normalized:"matches"},exists:{primary:"\u0645\u0648\u062c\u0648\u062f",normalized:"exists"},no:{primary:"\u0644\u0627 \u064a\u0648\u062c\u062f",normalized:"no"},end:{primary:"\u0646\u0647\u0627\u064a\u0629",alternatives:["\u0627\u0646\u062a\u0647\u0649","\u0627\u0644\u0646\u0647\u0627\u064a\u0629"],normalized:"end"},js:{primary:"\u062c\u0627\u0641\u0627\u0633\u0643\u0631\u0628\u062a",alternatives:["js"],normalized:"js"},async:{primary:"\u0645\u062a\u0632\u0627\u0645\u0646",normalized:"async"},tell:{primary:"\u0623\u062e\u0628\u0631",normalized:"tell"},default:{primary:"\u0627\u0641\u062a\u0631\u0627\u0636\u064a",normalized:"default"},init:{primary:"\u062a\u0647\u064a\u0626\u0629",alternatives:["\u0628\u062f\u0621"],normalized:"init"},behavior:{primary:"\u0633\u0644\u0648\u0643",normalized:"behavior"},install:{primary:"\u062a\u062b\u0628\u064a\u062a",alternatives:["\u062b\u0628\u0651\u062a"],normalized:"install"},measure:{primary:"\u0642\u064a\u0627\u0633",alternatives:["\u0642\u0650\u0633","\u0642\u0633"],normalized:"measure"},beep:{primary:"\u0635\u0641\u0651\u0631",normalized:"beep"},break:{primary:"\u062a\u0648\u0642\u0641",normalized:"break"},copy:{primary:"\u0627\u0646\u0633\u062e",normalized:"copy"},exit:{primary:"\u0627\u062e\u0631\u062c",normalized:"exit"},pick:{primary:"\u0627\u062e\u062a\u0631",normalized:"pick"},render:{primary:"\u0627\u0631\u0633\u0645",normalized:"render"},into:{primary:"\u0641\u064a",alternatives:["\u0625\u0644\u0649"],normalized:"into"},before:{primary:"\u0642\u0628\u0644",normalized:"before"},after:{primary:"\u0628\u0639\u062f",normalized:"after"},until:{primary:"\u062d\u062a\u0649",normalized:"until"},event:{primary:"\u062d\u062f\u062b",normalized:"event"},from:{primary:"\u0645\u0646",normalized:"from"},connect:{primary:"\u0627\u062a\u0635\u0644",alternatives:["\u0627\u062a\u0635\u0627\u0644"],normalized:"connect"},stream:{primary:"\u062a\u062f\u0641\u0642",alternatives:["\u0628\u062b"],normalized:"stream"},live:{primary:"\u0645\u0628\u0627\u0634\u0631",alternatives:["\u062d\u064a"],normalized:"live"},socket:{primary:"\u0645\u0642\u0628\u0633",alternatives:["websocket"],normalized:"socket"},bind:{primary:"\u0627\u0631\u0628\u0637",alternatives:["\u0631\u0628\u0637","bind"],normalized:"bind"},intercept:{primary:"\u0627\u0639\u062a\u0631\u0636",alternatives:["\u0627\u0639\u062a\u0631\u0627\u0636","intercept"],normalized:"intercept"},worker:{primary:"\u0639\u0627\u0645\u0644",alternatives:["worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["\u0645\u0635\u062f\u0631-\u0627\u0644\u0623\u062d\u062f\u0627\u062b"],normalized:"eventsource"}},tokenization:{prefixes:["\u0627\u0644","\u0648","\u0641","\u0628","\u0643","\u0644"]},eventHandler:{eventMarker:{primary:"\u0639\u0646\u062f",alternatives:["\u0641\u064a","\u0644\u062f\u0649","\u0639\u0646\u062f\u0645\u0627","\u062d\u064a\u0646","\u062d\u064a\u0646\u0645\u0627","\u0644\u0645\u0651\u0627","\u0644\u0645\u0627"],position:"before"},temporalMarkers:["\u0639\u0646\u062f\u0645\u0627","\u062d\u064a\u0646","\u0644\u0645\u0651\u0627"],negationMarker:{primary:"\u0639\u062f\u0645",alternatives:["\u0639\u062f\u0645"],position:"before"}}}}}),_f={};Ad(_f,{bengaliProfile:()=>If});var qf,$f=Cd({"src/generators/profiles/bengali.ts"(){If={code:"bn",name:"Bengali",nativeName:"\u09ac\u09be\u0982\u09b2\u09be",direction:"ltr",script:"bengali",wordOrder:"SOV",markingStrategy:"postposition",usesSpaces:!0,defaultVerbForm:"imperative",verb:{position:"end",suffixes:["\u09c1\u09a8","\u09cb","\u09be","\u09c7","\u09bf"],subjectDrop:!0},references:{me:"\u0986\u09ae\u09bf",it:"\u098f\u099f\u09bf",you:"\u0986\u09aa\u09a8\u09bf",result:"\u09ab\u09b2\u09be\u09ab\u09b2",event:"\u0998\u099f\u09a8\u09be",target:"\u09b2\u0995\u09cd\u09b7\u09cd\u09af",body:"\u09ac\u09a1\u09bf"},possessive:{marker:"\u09b0",markerPosition:"between",keywords:{"\u0986\u09ae\u09be\u09b0":"me","\u09a4\u09cb\u09ae\u09be\u09b0":"you","\u0986\u09aa\u09a8\u09be\u09b0":"you","\u09a4\u09be\u09b0":"it","\u098f\u09b0":"it"}},roleMarkers:{patient:{primary:"\u0995\u09c7",position:"after"},destination:{primary:"\u09a4\u09c7",alternatives:["\u098f"],position:"after"},source:{primary:"\u09a5\u09c7\u0995\u09c7",position:"after"},style:{primary:"\u09a6\u09bf\u09af\u09bc\u09c7",position:"after"},event:{primary:"\u09a4\u09c7",position:"after"}},keywords:{toggle:{primary:"\u099f\u0997\u09b2",normalized:"toggle"},add:{primary:"\u09af\u09cb\u0997",alternatives:["\u09af\u09cb\u0997 \u0995\u09b0\u09c1\u09a8"],normalized:"add"},remove:{primary:"\u09b8\u09b0\u09be\u09a8",alternatives:["\u09b8\u09b0\u09bf\u09af\u09bc\u09c7 \u09ab\u09c7\u09b2\u09c1\u09a8","\u09ae\u09c1\u099b\u09c1\u09a8"],normalized:"remove"},put:{primary:"\u09b0\u09be\u0996\u09c1\u09a8",alternatives:["\u09b0\u09be\u0996"],normalized:"put"},append:{primary:"\u099c\u09c1\u09a1\u09bc\u09c1\u09a8",alternatives:[],normalized:"append"},prepend:{primary:"\u09b6\u09c1\u09b0\u09c1\u09a4\u09c7 \u09af\u09cb\u0997",alternatives:[],normalized:"prepend"},take:{primary:"\u09a8\u09bf\u09a8",alternatives:["\u09a8\u09c7"],normalized:"take"},make:{primary:"\u09a4\u09c8\u09b0\u09bf \u0995\u09b0\u09c1\u09a8",alternatives:["\u09ac\u09be\u09a8\u09be\u09a8"],normalized:"make"},clone:{primary:"\u0995\u09cd\u09b2\u09cb\u09a8",alternatives:["\u09aa\u09cd\u09b0\u09a4\u09bf\u09b2\u09bf\u09aa\u09bf"],normalized:"clone"},swap:{primary:"\u09ac\u09a6\u09b2",alternatives:[],normalized:"swap"},morph:{primary:"\u09b0\u09c2\u09aa\u09be\u09a8\u09cd\u09a4\u09b0",alternatives:[],normalized:"morph"},set:{primary:"\u09b8\u09c7\u099f",alternatives:["\u09a8\u09bf\u09b0\u09cd\u09a7\u09be\u09b0\u09a3"],normalized:"set"},get:{primary:"\u09aa\u09be\u09a8",normalized:"get"},increment:{primary:"\u09ac\u09c3\u09a6\u09cd\u09a7\u09bf",alternatives:["\u09ac\u09be\u09a1\u09bc\u09be\u09a8"],normalized:"increment"},decrement:{primary:"\u09b9\u09cd\u09b0\u09be\u09b8",alternatives:["\u0995\u09ae\u09be\u09a8"],normalized:"decrement"},log:{primary:"\u09b2\u0997",alternatives:["\u09b0\u09c7\u0995\u09b0\u09cd\u09a1"],normalized:"log"},show:{primary:"\u09a6\u09c7\u0996\u09be\u09a8",alternatives:["\u09a6\u09c7\u0996\u09be\u0993"],normalized:"show"},hide:{primary:"\u09b2\u09c1\u0995\u09be\u09a8",alternatives:["\u09b2\u09c1\u0995\u09be\u0993"],normalized:"hide"},transition:{primary:"\u09b8\u0982\u0995\u09cd\u09b0\u09ae\u09a3",alternatives:[],normalized:"transition"},on:{primary:"\u09a4\u09c7",alternatives:["\u098f"],normalized:"on"},trigger:{primary:"\u099f\u09cd\u09b0\u09bf\u0997\u09be\u09b0",alternatives:[],normalized:"trigger"},send:{primary:"\u09aa\u09be\u09a0\u09be\u09a8",alternatives:["\u09aa\u09be\u09a0\u09be\u0993"],normalized:"send"},focus:{primary:"\u09ab\u09cb\u0995\u09be\u09b8",alternatives:["\u09ae\u09a8\u09cb\u09af\u09cb\u0997"],normalized:"focus"},blur:{primary:"\u099d\u09be\u09aa\u09b8\u09be",alternatives:["\u09ab\u09cb\u0995\u09be\u09b8_\u09b8\u09b0\u09be\u09a8"],normalized:"blur"},empty:{primary:"\u0996\u09be\u09b2\u09bf-\u0995\u09b0\u09c1\u09a8",alternatives:["\u0996\u09be\u09b2\u09bf"],normalized:"empty"},open:{primary:"\u0996\u09c1\u09b2\u09c1\u09a8",normalized:"open"},close:{primary:"\u09ac\u09a8\u09cd\u09a7",normalized:"close"},select:{primary:"\u09a8\u09bf\u09b0\u09cd\u09ac\u09be\u099a\u09a8",normalized:"select"},clear:{primary:"\u09aa\u09b0\u09bf\u09b7\u09cd\u0995\u09be\u09b0",normalized:"clear"},reset:{primary:"\u09b0\u09bf\u09b8\u09c7\u099f",normalized:"reset"},breakpoint:{primary:"\u09ac\u09cd\u09b0\u09c7\u0995\u09aa\u09af\u09bc\u09c7\u09a8\u09cd\u099f",normalized:"breakpoint"},click:{primary:"\u0995\u09cd\u09b2\u09bf\u0995",normalized:"click"},hover:{primary:"\u09b9\u09cb\u09ad\u09be\u09b0",alternatives:["\u0989\u09aa\u09b0\u09c7_\u09b0\u09be\u0996\u09c1\u09a8"],normalized:"hover"},submit:{primary:"\u09b8\u09be\u09ac\u09ae\u09bf\u099f",alternatives:["\u099c\u09ae\u09be"],normalized:"submit"},input:{primary:"\u0987\u09a8\u09aa\u09c1\u099f",alternatives:["\u09aa\u09cd\u09b0\u09ac\u09c7\u09b6"],normalized:"input"},change:{primary:"\u09aa\u09b0\u09bf\u09ac\u09b0\u09cd\u09a4\u09a8",normalized:"change"},go:{primary:"\u09af\u09be\u09a8",alternatives:["\u09af\u09be\u0993"],normalized:"go"},scroll:{primary:"\u09b8\u09cd\u0995\u09cd\u09b0\u09cb\u09b2",normalized:"scroll"},push:{primary:"\u09aa\u09c1\u09b6",alternatives:["\u09a0\u09c7\u09b2\u09c1\u09a8"],normalized:"push"},replace:{primary:"\u09aa\u09cd\u09b0\u09a4\u09bf\u09b8\u09cd\u09a5\u09be\u09aa\u09a8",normalized:"replace"},process:{primary:"\u09aa\u09cd\u09b0\u09b8\u09c7\u09b8",alternatives:["\u09aa\u09cd\u09b0\u0995\u09cd\u09b0\u09bf\u09af\u09bc\u09be"],normalized:"process"},wait:{primary:"\u0985\u09aa\u09c7\u0995\u09cd\u09b7\u09be",normalized:"wait"},fetch:{primary:"\u0986\u09a8\u09c1\u09a8",alternatives:[],normalized:"fetch"},settle:{primary:"\u09b8\u09cd\u09a5\u09bf\u09b0",alternatives:[],normalized:"settle"},if:{primary:"\u09af\u09a6\u09bf",alternatives:[],normalized:"if"},when:{primary:"\u09af\u0996\u09a8",normalized:"when"},where:{primary:"\u0995\u09cb\u09a5\u09be\u09af\u09bc",normalized:"where"},else:{primary:"\u09a8\u09a4\u09c1\u09ac\u09be",alternatives:["\u09a8\u09be \u09b9\u09b2\u09c7"],normalized:"else"},repeat:{primary:"\u09aa\u09c1\u09a8\u09b0\u09be\u09ac\u09c3\u09a4\u09cd\u09a4\u09bf",alternatives:["\u09ac\u09be\u09b0 \u09ac\u09be\u09b0"],normalized:"repeat"},for:{primary:"\u099c\u09a8\u09cd\u09af",alternatives:[],normalized:"for"},while:{primary:"\u09af\u09a4\u0995\u09cd\u09b7\u09a3",alternatives:[],normalized:"while"},forever:{primary:"\u099a\u09bf\u09b0\u0995\u09be\u09b2",normalized:"forever",alternatives:["forever"]},continue:{primary:"\u099a\u09be\u09b2\u09bf\u09af\u09bc\u09c7 \u09af\u09be\u09a8",alternatives:[],normalized:"continue"},halt:{primary:"\u09a5\u09be\u09ae\u09c1\u09a8",alternatives:["\u09a5\u09be\u09ae\u09be\u0993"],normalized:"halt"},throw:{primary:"\u09a8\u09bf\u0995\u09cd\u09b7\u09c7\u09aa",alternatives:["\u099b\u09c1\u0981\u09a1\u09bc\u09c7 \u09a6\u09bf\u09a8"],normalized:"throw"},call:{primary:"\u0995\u09b2",alternatives:["\u09a1\u09be\u0995\u09c1\u09a8"],normalized:"call"},return:{primary:"\u09ab\u09bf\u09b0\u09c1\u09a8",alternatives:["\u09ab\u09c7\u09b0\u09a4 \u09a6\u09bf\u09a8"],normalized:"return"},then:{primary:"\u09a4\u09be\u09b0\u09aa\u09b0",alternatives:["\u09a4\u0996\u09a8"],normalized:"then"},and:{primary:"\u098f\u09ac\u0982",alternatives:[],normalized:"and"},is:{primary:"\u09b9\u09af\u09bc",normalized:"is"},end:{primary:"\u09b6\u09c7\u09b7",alternatives:["\u09b8\u09ae\u09be\u09aa\u09cd\u09a4"],normalized:"end"},js:{primary:"\u099c\u09c7\u098f\u09b8",alternatives:["js"],normalized:"js"},async:{primary:"\u0985\u09cd\u09af\u09be\u09b8\u09bf\u0999\u09cd\u0995",alternatives:[],normalized:"async"},tell:{primary:"\u09ac\u09b2\u09c1\u09a8",alternatives:["\u09ac\u09b2"],normalized:"tell"},default:{primary:"\u09a1\u09bf\u09ab\u09b2\u09cd\u099f",alternatives:[],normalized:"default"},init:{primary:"\u09b6\u09c1\u09b0\u09c1",alternatives:[],normalized:"init"},behavior:{primary:"\u0986\u099a\u09b0\u09a3",alternatives:[],normalized:"behavior"},install:{primary:"\u0987\u09a8\u09b8\u09cd\u099f\u09b2",alternatives:[],normalized:"install"},measure:{primary:"\u09ae\u09be\u09aa\u09c1\u09a8",alternatives:[],normalized:"measure"},beep:{primary:"\u09ac\u09c0\u09aa",alternatives:[],normalized:"beep"},break:{primary:"\u09ad\u09be\u0999\u09c1\u09a8",alternatives:[],normalized:"break"},copy:{primary:"\u0995\u09aa\u09bf",alternatives:[],normalized:"copy"},exit:{primary:"\u09ac\u09c7\u09b0",alternatives:[],normalized:"exit"},pick:{primary:"\u09ac\u09be\u099b\u09c1\u09a8",alternatives:[],normalized:"pick"},render:{primary:"\u09b0\u09c7\u09a8\u09cd\u09a1\u09be\u09b0",alternatives:[],normalized:"render"},into:{primary:"\u09ad\u09bf\u09a4\u09b0\u09c7",normalized:"into"},before:{primary:"\u0986\u0997\u09c7",alternatives:[],normalized:"before"},after:{primary:"\u09aa\u09b0\u09c7",alternatives:[],normalized:"after"},until:{primary:"\u09aa\u09b0\u09cd\u09af\u09a8\u09cd\u09a4",alternatives:[],normalized:"until"},event:{primary:"\u0998\u099f\u09a8\u09be",alternatives:[],normalized:"event"},from:{primary:"\u09a5\u09c7\u0995\u09c7",normalized:"from"},connect:{primary:"\u0995\u09be\u09a8\u09c7\u0995\u09cd\u099f",alternatives:["\u09b8\u0982\u09af\u09cb\u0997","\u09af\u09c1\u0995\u09cd\u09a4"],normalized:"connect"},stream:{primary:"\u09b8\u09cd\u099f\u09cd\u09b0\u09bf\u09ae",alternatives:["\u09b8\u09cd\u09b0\u09cb\u09a4","\u09aa\u09cd\u09b0\u09ac\u09be\u09b9"],normalized:"stream"},live:{primary:"\u09b2\u09be\u0987\u09ad",alternatives:["\u09b8\u09b0\u09be\u09b8\u09b0\u09bf","\u09aa\u09cd\u09b0\u09a4\u09cd\u09af\u0995\u09cd\u09b7"],normalized:"live"},socket:{primary:"\u09b8\u0995\u09c7\u099f",alternatives:["\u0993\u09af\u09bc\u09c7\u09ac\u09b8\u0995\u09c7\u099f"],normalized:"socket"},bind:{primary:"\u09ac\u09be\u0987\u09a8\u09cd\u09a1",alternatives:["bind"],normalized:"bind"},intercept:{primary:"\u0986\u099f\u0995\u09be\u0993",alternatives:["\u0987\u09a8\u09cd\u099f\u09be\u09b0\u09b8\u09c7\u09aa\u09cd\u099f","intercept"],normalized:"intercept"},worker:{primary:"\u0995\u09b0\u09cd\u09ae\u09c0",alternatives:["\u0993\u09af\u09bc\u09be\u09b0\u09cd\u0995\u09be\u09b0","worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["\u0987\u09ad\u09c7\u09a8\u09cd\u099f\u09b8\u09cb\u09b0\u09cd\u09b8"],normalized:"eventsource"}},tokenization:{particles:["\u0995\u09c7","\u09a4\u09c7","\u09a5\u09c7\u0995\u09c7","\u09b0","\u098f\u09b0","\u09a6\u09bf\u09af\u09bc\u09c7","\u099c\u09a8\u09cd\u09af","\u09aa\u09b0\u09cd\u09af\u09a8\u09cd\u09a4"],boundaryStrategy:"space"},eventHandler:{keyword:{primary:"\u09a4\u09c7",alternatives:["\u098f","\u09af\u0996\u09a8"],normalized:"on"},sourceMarker:{primary:"\u09a5\u09c7\u0995\u09c7",position:"after"},eventMarker:{primary:"\u09a4\u09c7",alternatives:["\u098f"],position:"after"},temporalMarkers:["\u09af\u0996\u09a8","\u09af\u0996\u09a8\u0987"]}}}}),Vf={};Ad(Vf,{germanProfile:()=>qf});var Df,Bf=Cd({"src/generators/profiles/german.ts"(){qf={code:"de",name:"German",nativeName:"Deutsch",regions:["western","priority"],direction:"ltr",script:"latin",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:!0,defaultVerbForm:"infinitive",verb:{position:"start",subjectDrop:!1},references:{me:"ich",it:"es",you:"du",result:"Ergebnis",event:"Ereignis",target:"Ziel",body:"K\u00f6rper",document:"dokument",window:"fenster",detail:"detail"},possessive:{marker:"",markerPosition:"before-property",usePossessiveAdjectives:!0,specialForms:{me:"mein",it:"sein",you:"dein"},keywords:{mein:"me",meine:"me",meinen:"me",dein:"you",deine:"you",deinen:"you",sein:"it",seine:"it",seinen:"it"}},roleMarkers:{destination:{primary:"auf",alternatives:["zu","in"],position:"before"},source:{primary:"von",alternatives:["aus"],position:"before"},patient:{primary:"",position:"before"},style:{primary:"mit",position:"before"}},keywords:{toggle:{primary:"umschalten",alternatives:["wechseln"],normalized:"toggle"},add:{primary:"hinzuf\u00fcgen",normalized:"add"},remove:{primary:"entfernen",alternatives:["l\u00f6schen"],normalized:"remove"},put:{primary:"setzen",alternatives:["stellen","platzieren"],normalized:"put"},append:{primary:"anh\u00e4ngen",normalized:"append"},prepend:{primary:"voranstellen",normalized:"prepend"},take:{primary:"nehmen",normalized:"take"},make:{primary:"machen",alternatives:["erstellen","erzeugen"],normalized:"make"},clone:{primary:"klonen",alternatives:["duplizieren"],normalized:"clone"},swap:{primary:"austauschen",alternatives:["tauschen","vertauschen"],normalized:"swap"},morph:{primary:"verwandeln",alternatives:["transformieren"],normalized:"morph"},set:{primary:"festlegen",alternatives:["definieren"],normalized:"set"},get:{primary:"holen",alternatives:["bekommen","erhalten"],normalized:"get"},increment:{primary:"erh\u00f6hen",normalized:"increment"},decrement:{primary:"verringern",alternatives:["vermindern"],normalized:"decrement"},log:{primary:"protokollieren",alternatives:["ausgeben"],normalized:"log"},show:{primary:"zeigen",alternatives:["anzeigen"],normalized:"show"},hide:{primary:"verbergen",alternatives:["verstecken"],normalized:"hide"},transition:{primary:"\u00fcbergang",alternatives:["animieren"],normalized:"transition"},on:{primary:"bei",alternatives:["auf"],normalized:"on"},trigger:{primary:"ausl\u00f6sen",normalized:"trigger"},send:{primary:"senden",alternatives:["schicken"],normalized:"send"},focus:{primary:"Fokus",alternatives:["Fokuserhalt","fokussieren"],normalized:"focus"},blur:{primary:"Fokusverlust",alternatives:["verlassen","defokussieren","entfokussieren"],normalized:"blur"},empty:{primary:"leeren",alternatives:["leer"],normalized:"empty"},open:{primary:"\u00f6ffnen",alternatives:["oeffnen"],normalized:"open"},close:{primary:"schlie\u00dfen",alternatives:["schliessen"],normalized:"close"},select:{primary:"markieren",normalized:"select"},clear:{primary:"bereinigen",normalized:"clear"},reset:{primary:"zur\u00fccksetzen",alternatives:["zuruecksetzen"],normalized:"reset"},breakpoint:{primary:"haltepunkt",normalized:"breakpoint"},go:{primary:"gehen",alternatives:["navigieren"],normalized:"go"},scroll:{primary:"scrollen",normalized:"scroll"},push:{primary:"dr\u00fccken",alternatives:["push"],normalized:"push"},replace:{primary:"ersetzen",normalized:"replace"},process:{primary:"verarbeiten",normalized:"process"},wait:{primary:"warten",normalized:"wait"},fetch:{primary:"abrufen",alternatives:["laden"],normalized:"fetch"},settle:{primary:"stabilisieren",normalized:"settle"},if:{primary:"falls",alternatives:["sofern"],normalized:"if"},unless:{primary:"wennnicht",normalized:"unless"},when:{primary:"wenn",normalized:"when"},where:{primary:"wo",normalized:"where"},else:{primary:"sonst",alternatives:["ansonsten"],normalized:"else"},repeat:{primary:"wiederholen",normalized:"repeat"},for:{primary:"f\u00fcr",normalized:"for"},while:{primary:"solange",alternatives:["w\u00e4hrend"],normalized:"while"},forever:{primary:"forever",normalized:"forever"},continue:{primary:"fortfahren",alternatives:["weiter"],normalized:"continue"},halt:{primary:"anhalten",alternatives:["stoppen"],normalized:"halt"},throw:{primary:"werfen",normalized:"throw"},call:{primary:"aufrufen",normalized:"call"},return:{primary:"zur\u00fcckgeben",normalized:"return"},then:{primary:"dann",alternatives:["danach","anschlie\u00dfend"],normalized:"then"},and:{primary:"und",alternatives:["sowie","auch"],normalized:"and"},is:{primary:"ist",normalized:"is"},matches:{primary:"passt",normalized:"matches"},exists:{primary:"existiert",normalized:"exists"},no:{primary:"kein",normalized:"no"},end:{primary:"ende",alternatives:["fertig"],normalized:"end"},js:{primary:"js",alternatives:["javascript"],normalized:"js"},async:{primary:"asynchron",normalized:"async"},tell:{primary:"sagen",normalized:"tell"},default:{primary:"standard",normalized:"default"},init:{primary:"Initialisierung",alternatives:["initialisieren"],normalized:"init"},behavior:{primary:"verhalten",normalized:"behavior"},install:{primary:"installieren",normalized:"install"},measure:{primary:"messen",normalized:"measure"},beep:{primary:"piepton",normalized:"beep"},break:{primary:"unterbrechen",normalized:"break"},copy:{primary:"kopieren",normalized:"copy"},exit:{primary:"beenden",normalized:"exit"},pick:{primary:"ausw\u00e4hlen",normalized:"pick"},render:{primary:"rendern",normalized:"render"},into:{primary:"hinein",normalized:"into"},before:{primary:"vor",normalized:"before"},after:{primary:"nach",normalized:"after"},click:{primary:"Klick",alternatives:["Klicken"],normalized:"click"},hover:{primary:"Hover",alternatives:["Schweben"],normalized:"hover"},submit:{primary:"Absenden",alternatives:["Senden"],normalized:"submit"},input:{primary:"Eingabe",normalized:"input"},change:{primary:"\u00c4nderung",alternatives:["\u00c4ndern"],normalized:"change"},resize:{primary:"Gr\u00f6\u00dfen\u00e4nderung",alternatives:["gr\u00f6\u00dfen\u00e4nderung","gr\u00f6ssen\u00e4nderung","Gr\u00f6\u00dfe \u00e4ndern","gr\u00f6\u00dfe\u00e4ndern"],normalized:"resize"},until:{primary:"bis",normalized:"until"},event:{primary:"Ereignis",alternatives:["Event"],normalized:"event"},from:{primary:"von",alternatives:["aus"],normalized:"from"},connect:{primary:"verbinden",alternatives:["Verbindung"],normalized:"connect"},stream:{primary:"stream",alternatives:["Strom"],normalized:"stream"},live:{primary:"direkt",alternatives:["live","echtzeit"],normalized:"live"},socket:{primary:"socket",alternatives:["websocket"],normalized:"socket"},bind:{primary:"binden",alternatives:["verknuepfen","bind"],normalized:"bind"},intercept:{primary:"abfangen",alternatives:["intercept"],normalized:"intercept"},worker:{primary:"arbeiter",alternatives:["worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["ereignisquelle"],normalized:"eventsource"}},eventHandler:{keyword:{primary:"bei",alternatives:["auf"],normalized:"on"},sourceMarker:{primary:"von",alternatives:["aus"],position:"before"},conditionalKeyword:{primary:"wenn",alternatives:["falls"]},eventMarker:{primary:"bei",alternatives:["beim"],position:"before"},temporalMarkers:["wenn","bei"]}}}}),Hf={};Ad(Hf,{englishProfile:()=>Df});var Kf,Ff=Cd({"src/generators/profiles/english.ts"(){Df={code:"en",name:"English",nativeName:"English",regions:["western","priority"],direction:"ltr",script:"latin",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:!0,defaultVerbForm:"base",verb:{position:"start",subjectDrop:!1},references:{me:"me",it:"it",you:"you",result:"result",event:"event",target:"target",body:"body",document:"document",window:"window",detail:"detail"},possessive:{marker:"'s",markerPosition:"after-object",specialForms:{me:"my",it:"its",you:"your"},keywords:{my:"me",your:"you",its:"it"}},roleMarkers:{destination:{primary:"on",alternatives:["to","from"],position:"before"},source:{primary:"from",position:"before"},patient:{primary:"",position:"before"},style:{primary:"with",alternatives:["by","using"],position:"before"},responseType:{primary:"as",position:"before"},method:{primary:"via",alternatives:["using"],position:"before"}},keywords:{toggle:{primary:"toggle"},add:{primary:"add"},remove:{primary:"remove"},put:{primary:"put"},append:{primary:"append"},prepend:{primary:"prepend"},take:{primary:"take"},make:{primary:"make"},clone:{primary:"clone"},swap:{primary:"swap"},morph:{primary:"morph"},set:{primary:"set"},get:{primary:"get"},increment:{primary:"increment"},decrement:{primary:"decrement"},log:{primary:"log"},show:{primary:"show"},hide:{primary:"hide"},transition:{primary:"transition"},on:{primary:"on"},trigger:{primary:"trigger"},send:{primary:"send"},focus:{primary:"focus"},blur:{primary:"blur"},empty:{primary:"empty",normalized:"empty"},open:{primary:"open",normalized:"open"},close:{primary:"close",normalized:"close"},select:{primary:"select",normalized:"select"},clear:{primary:"clear",normalized:"clear"},reset:{primary:"reset",normalized:"reset"},breakpoint:{primary:"breakpoint",normalized:"breakpoint"},go:{primary:"go"},scroll:{primary:"scroll",normalized:"scroll"},push:{primary:"push",normalized:"push"},replace:{primary:"replace",normalized:"replace"},process:{primary:"process",normalized:"process"},wait:{primary:"wait"},fetch:{primary:"fetch"},settle:{primary:"settle"},if:{primary:"if"},when:{primary:"when",normalized:"when"},where:{primary:"where",normalized:"where"},else:{primary:"else"},repeat:{primary:"repeat"},for:{primary:"for"},while:{primary:"while"},continue:{primary:"continue"},halt:{primary:"halt"},throw:{primary:"throw"},call:{primary:"call"},return:{primary:"return"},then:{primary:"then"},and:{primary:"and"},end:{primary:"end"},js:{primary:"js"},async:{primary:"async"},tell:{primary:"tell"},default:{primary:"default"},init:{primary:"init"},behavior:{primary:"behavior"},install:{primary:"install"},measure:{primary:"measure"},beep:{primary:"beep"},break:{primary:"break"},copy:{primary:"copy"},exit:{primary:"exit"},pick:{primary:"pick"},render:{primary:"render"},into:{primary:"into"},before:{primary:"before"},after:{primary:"after"},until:{primary:"until"},event:{primary:"event"},from:{primary:"from"},connect:{primary:"connect",normalized:"connect"},stream:{primary:"stream",normalized:"stream"},live:{primary:"live",normalized:"live"},socket:{primary:"socket",alternatives:["websocket"],normalized:"socket"},bind:{primary:"bind",normalized:"bind"},eventsource:{primary:"eventsource",normalized:"eventsource"},worker:{primary:"worker",normalized:"worker"},intercept:{primary:"intercept",normalized:"intercept"}}}}}),Uf={};Ad(Uf,{spanishProfile:()=>Kf});var Gf,Zf=Cd({"src/generators/profiles/spanish.ts"(){Kf={code:"es",name:"Spanish",nativeName:"Espa\u00f1ol",regions:["western","priority"],direction:"ltr",script:"latin",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:!0,defaultVerbForm:"infinitive",verb:{position:"start",subjectDrop:!0},references:{me:"yo",it:"ello",you:"t\u00fa",result:"resultado",event:"evento",target:"objetivo",body:"cuerpo",document:"documento",window:"ventana",detail:"detalle"},possessive:{marker:"de",markerPosition:"before-property",usePossessiveAdjectives:!0,specialForms:{me:"mi",it:"su",you:"tu"},keywords:{mi:"me",tu:"you",su:"it"}},roleMarkers:{destination:{primary:"en",alternatives:["sobre","a","hacia"],position:"before"},source:{primary:"de",alternatives:["desde"],position:"before"},patient:{primary:"",position:"before"},style:{primary:"con",position:"before"}},keywords:{toggle:{primary:"alternar",alternatives:["conmutar","toggle"],normalized:"toggle"},add:{primary:"agregar",alternatives:["a\u00f1adir"],normalized:"add"},remove:{primary:"quitar",alternatives:["eliminar","remover","sacar","borrar"],normalized:"remove"},put:{primary:"poner",alternatives:["colocar","pon"],normalized:"put"},append:{primary:"anexar",normalized:"append"},prepend:{primary:"anteponer",normalized:"prepend"},take:{primary:"tomar",normalized:"take"},make:{primary:"hacer",alternatives:["crear"],normalized:"make"},clone:{primary:"clonar",alternatives:["duplicar"],normalized:"clone"},swap:{primary:"intercambiar",alternatives:["permutar"],normalized:"swap"},morph:{primary:"transformar",alternatives:["convertir"],normalized:"morph"},set:{primary:"establecer",alternatives:["fijar","definir","establece"],normalized:"set"},get:{primary:"obtener",alternatives:["conseguir","obt\u00e9n"],normalized:"get"},increment:{primary:"incrementar",alternatives:["aumentar"],normalized:"increment"},decrement:{primary:"decrementar",alternatives:["disminuir"],normalized:"decrement"},log:{primary:"registrar",alternatives:["imprimir"],normalized:"log"},show:{primary:"mostrar",alternatives:["ense\u00f1ar","muestra"],normalized:"show"},hide:{primary:"ocultar",alternatives:["esconder"],normalized:"hide"},transition:{primary:"transici\u00f3n",alternatives:["animar"],normalized:"transition"},on:{primary:"en",alternatives:["al"],normalized:"on"},trigger:{primary:"disparar",alternatives:["activar"],normalized:"trigger"},send:{primary:"enviar",alternatives:["env\u00eda"],normalized:"send"},focus:{primary:"enfoque",alternatives:["enfocar"],normalized:"focus"},blur:{primary:"p\u00e9rdida de foco",alternatives:["perdida de foco","desenfoque","desenfocar"],normalized:"blur"},open:{primary:"abrir",normalized:"open"},close:{primary:"cerrar",normalized:"close"},select:{primary:"seleccionar",normalized:"select"},clear:{primary:"limpiar",normalized:"clear"},reset:{primary:"reiniciar",alternatives:["restablecer"],normalized:"reset"},breakpoint:{primary:"punto-interrupci\u00f3n",alternatives:["punto-interrupcion"],normalized:"breakpoint"},click:{primary:"clic",alternatives:["hacer clic","click"],normalized:"click"},resize:{primary:"cambio de tama\u00f1o",alternatives:["cambio de tamano","redimensionar"],normalized:"resize"},hover:{primary:"sobrevolar",alternatives:["pasar por encima"],normalized:"hover"},submit:{primary:"env\u00edo",alternatives:["envio","someter"],normalized:"submit"},input:{primary:"entrada",alternatives:["introducir"],normalized:"input"},change:{primary:"cambio",alternatives:["cambiar"],normalized:"change"},load:{primary:"carga",alternatives:["cargar"],normalized:"load"},scroll:{primary:"desplazamiento",alternatives:["desplazar"],normalized:"scroll"},keydown:{primary:"tecla pulsada",alternatives:["tecla presionada","tecla abajo"],normalized:"keydown"},keyup:{primary:"tecla soltada",alternatives:["tecla liberada","tecla arriba"],normalized:"keyup"},mouseover:{primary:"rat\u00f3n encima",alternatives:["raton encima","mouse encima"],normalized:"mouseover"},mouseout:{primary:"rat\u00f3n fuera",alternatives:["raton fuera","mouse fuera"],normalized:"mouseout"},mousedown:{primary:"rat\u00f3n pulsado",alternatives:["raton pulsado","mouse presionado","rat\u00f3n abajo","raton abajo","rat\u00f3nabajo"],normalized:"mousedown"},mouseup:{primary:"rat\u00f3n soltado",alternatives:["raton soltado","mouse soltado","rat\u00f3n arriba","raton arriba","rat\u00f3narriba"],normalized:"mouseup"},go:{primary:"ir",alternatives:["navegar","ve"],normalized:"go"},push:{primary:"empujar",alternatives:["push"],normalized:"push"},replace:{primary:"reemplazar",alternatives:["sustituir"],normalized:"replace"},process:{primary:"procesar",normalized:"process"},wait:{primary:"esperar",normalized:"wait"},fetch:{primary:"buscar",alternatives:["recuperar"],normalized:"fetch"},settle:{primary:"estabilizar",normalized:"settle"},if:{primary:"si",normalized:"if"},unless:{primary:"menos",alternatives:["a menos que","salvo"],normalized:"unless"},when:{primary:"cuando",normalized:"when"},where:{primary:"donde",normalized:"where"},else:{primary:"sino",alternatives:["de lo contrario"],normalized:"else"},repeat:{primary:"repetir",normalized:"repeat"},for:{primary:"para",normalized:"for"},while:{primary:"mientras",normalized:"while"},forever:{primary:"forever",normalized:"forever"},continue:{primary:"continuar",normalized:"continue"},halt:{primary:"detener",alternatives:["parar"],normalized:"halt"},throw:{primary:"lanzar",alternatives:["arrojar"],normalized:"throw"},call:{primary:"llamar",normalized:"call"},return:{primary:"retornar",alternatives:["devolver"],normalized:"return"},then:{primary:"entonces",alternatives:["luego"],normalized:"then"},and:{primary:"y",alternatives:["adem\u00e1s","tambi\u00e9n"],normalized:"and"},or:{primary:"o",normalized:"or"},not:{primary:"no",normalized:"not"},is:{primary:"es",normalized:"is"},exists:{primary:"existe",normalized:"exists"},empty:{primary:"vac\u00edo",alternatives:["vacio"],normalized:"empty"},matches:{primary:"coincide",normalized:"matches"},no:{primary:"ning\u00fan",normalized:"no"},end:{primary:"fin",alternatives:["final","terminar"],normalized:"end"},js:{primary:"js",normalized:"js"},async:{primary:"as\u00edncrono",alternatives:["asincrono"],normalized:"async"},tell:{primary:"decir",normalized:"tell"},default:{primary:"predeterminar",alternatives:["por defecto"],normalized:"default"},init:{primary:"inicio",alternatives:["inicializaci\u00f3n","iniciar","inicializar"],normalized:"init"},behavior:{primary:"comportamiento",normalized:"behavior"},install:{primary:"instalar",normalized:"install"},measure:{primary:"medir",normalized:"measure"},beep:{primary:"pitido",normalized:"beep"},break:{primary:"romper",normalized:"break"},copy:{primary:"copiar",normalized:"copy"},exit:{primary:"salir",normalized:"exit"},pick:{primary:"escoger",normalized:"pick"},render:{primary:"renderizar",normalized:"render"},first:{primary:"primero",alternatives:["primera"],normalized:"first"},last:{primary:"\u00faltimo",alternatives:["ultima"],normalized:"last"},next:{primary:"siguiente",normalized:"next"},previous:{primary:"anterior",normalized:"previous"},closest:{primary:"cercano",normalized:"closest"},parent:{primary:"padre",normalized:"parent"},into:{primary:"dentro",alternatives:["adentro","dentro de"],normalized:"into"},before:{primary:"antes",alternatives:["antes de"],normalized:"before"},after:{primary:"despu\u00e9s",alternatives:["despues","despu\u00e9s de","despues de"],normalized:"after"},out:{primary:"fuera",alternatives:["fuera de"],normalized:"out"},until:{primary:"hasta",alternatives:["hasta que"],normalized:"until"},event:{primary:"evento",normalized:"event"},from:{primary:"de",alternatives:["desde"],normalized:"from"},connect:{primary:"conectar",alternatives:["conectarse"],normalized:"connect"},stream:{primary:"transmitir",alternatives:["flujo"],normalized:"stream"},live:{primary:"en-vivo",alternatives:["vivo","directo"],normalized:"live"},socket:{primary:"socket",alternatives:["websocket"],normalized:"socket"},bind:{primary:"vincular",alternatives:["enlazar","bind"],normalized:"bind"},intercept:{primary:"interceptar",alternatives:["intercept"],normalized:"intercept"},worker:{primary:"trabajador",alternatives:["worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["fuente-de-eventos"],normalized:"eventsource"}},eventHandler:{keyword:{primary:"al",alternatives:["cuando","en"],normalized:"on"},sourceMarker:{primary:"de",alternatives:["desde"],position:"before"},eventMarker:{primary:"al",alternatives:["cuando","en"],position:"before"},temporalMarkers:["cuando","al"]}}}}),Yf={};Ad(Yf,{frenchProfile:()=>Gf});var Xf,Jf=Cd({"src/generators/profiles/french.ts"(){Gf={code:"fr",name:"French",nativeName:"Fran\u00e7ais",regions:["western","priority"],direction:"ltr",script:"latin",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:!0,defaultVerbForm:"infinitive",verb:{position:"start",subjectDrop:!1},references:{me:"moi",it:"il",you:"toi",result:"r\u00e9sultat",event:"\u00e9v\u00e9nement",target:"cible",body:"corps",document:"document",window:"fen\u00eatre",detail:"d\u00e9tail"},possessive:{marker:"de",markerPosition:"before-property",usePossessiveAdjectives:!0,specialForms:{me:"ma",it:"sa",you:"ta"},keywords:{mon:"me",ma:"me",mes:"me",ton:"you",ta:"you",tes:"you",son:"it",sa:"it",ses:"it"}},roleMarkers:{destination:{primary:"sur",alternatives:["\u00e0","dans"],position:"before"},source:{primary:"de",alternatives:["depuis"],position:"before"},patient:{primary:"",position:"before"},style:{primary:"avec",position:"before"}},keywords:{toggle:{primary:"basculer",alternatives:["alterner"],normalized:"toggle"},add:{primary:"ajouter",normalized:"add"},remove:{primary:"supprimer",alternatives:["enlever","retirer","retire"],normalized:"remove"},put:{primary:"mettre",alternatives:["placer","mets"],normalized:"put"},append:{primary:"annexer",normalized:"append"},prepend:{primary:"pr\u00e9fixer",normalized:"prepend"},take:{primary:"prendre",normalized:"take"},make:{primary:"faire",alternatives:["cr\u00e9er"],normalized:"make"},clone:{primary:"cloner",alternatives:["dupliquer"],normalized:"clone"},swap:{primary:"\u00e9changer",alternatives:["permuter"],normalized:"swap"},morph:{primary:"transformer",alternatives:["m\u00e9tamorphoser"],normalized:"morph"},set:{primary:"d\u00e9finir",alternatives:["\u00e9tablir"],normalized:"set"},get:{primary:"obtenir",alternatives:["obtiens"],normalized:"get"},increment:{primary:"incr\u00e9menter",alternatives:["augmenter"],normalized:"increment"},decrement:{primary:"d\u00e9cr\u00e9menter",alternatives:["diminuer"],normalized:"decrement"},log:{primary:"enregistrer",alternatives:["journaliser"],normalized:"log"},show:{primary:"montrer",alternatives:["afficher","montre"],normalized:"show"},hide:{primary:"cacher",alternatives:["masquer"],normalized:"hide"},transition:{primary:"transition",alternatives:["animer"],normalized:"transition"},on:{primary:"sur",alternatives:["lors"],normalized:"on"},trigger:{primary:"d\u00e9clencher",normalized:"trigger"},send:{primary:"envoyer",alternatives:["envoie"],normalized:"send"},focus:{primary:"focaliser",alternatives:["concentrer"],normalized:"focus"},blur:{primary:"perte de focus",alternatives:["d\u00e9focaliser"],normalized:"blur"},empty:{primary:"vider",alternatives:["vide"],normalized:"empty"},open:{primary:"ouvrir",normalized:"open"},close:{primary:"fermer",normalized:"close"},select:{primary:"s\u00e9lectionner",alternatives:["selectionner"],normalized:"select"},clear:{primary:"effacer",normalized:"clear"},reset:{primary:"r\u00e9initialiser",alternatives:["reinitialiser"],normalized:"reset"},breakpoint:{primary:"point-arr\u00eat",alternatives:["point-arret"],normalized:"breakpoint"},go:{primary:"aller",alternatives:["naviguer","va"],normalized:"go"},scroll:{primary:"d\u00e9filement",alternatives:["defilement","d\u00e9filer","faire-d\u00e9filer"],normalized:"scroll"},push:{primary:"pousser",normalized:"push"},replace:{primary:"remplacer",normalized:"replace"},process:{primary:"traiter",normalized:"process"},wait:{primary:"attendre",normalized:"wait"},fetch:{primary:"chercher",alternatives:["r\u00e9cup\u00e9rer","r\u00e9cup\u00e8re"],normalized:"fetch"},settle:{primary:"stabiliser",normalized:"settle"},if:{primary:"si",normalized:"if"},unless:{primary:"saufsi",normalized:"unless"},when:{primary:"quand",normalized:"when"},where:{primary:"o\u00f9",normalized:"where"},else:{primary:"sinon",normalized:"else"},repeat:{primary:"r\u00e9p\u00e9ter",normalized:"repeat"},for:{primary:"pour",normalized:"for"},while:{primary:"pendant",normalized:"while"},forever:{primary:"forever",normalized:"forever"},continue:{primary:"continuer",normalized:"continue"},halt:{primary:"arr\u00eater",alternatives:["stopper"],normalized:"halt"},throw:{primary:"lancer",normalized:"throw"},call:{primary:"appeler",normalized:"call"},return:{primary:"retourner",alternatives:["renvoyer"],normalized:"return"},then:{primary:"puis",alternatives:["ensuite","alors"],normalized:"then"},and:{primary:"et",alternatives:["aussi","\u00e9galement"],normalized:"and"},matches:{primary:"correspond",normalized:"matches"},exists:{primary:"existe",normalized:"exists"},is:{primary:"est",normalized:"is"},no:{primary:"aucun",normalized:"no"},end:{primary:"fin",alternatives:["terminer","finir"],normalized:"end"},js:{primary:"js",normalized:"js"},async:{primary:"asynchrone",normalized:"async"},tell:{primary:"dire",normalized:"tell"},default:{primary:"d\u00e9faut",normalized:"default"},init:{primary:"initialiser",normalized:"init"},behavior:{primary:"comportement",normalized:"behavior"},install:{primary:"installer",normalized:"install"},measure:{primary:"mesurer",normalized:"measure"},beep:{primary:"bip",normalized:"beep"},break:{primary:"interrompre",normalized:"break"},copy:{primary:"copier",normalized:"copy"},exit:{primary:"sortir",normalized:"exit"},pick:{primary:"choisir",normalized:"pick"},render:{primary:"rendu",normalized:"render"},into:{primary:"dans",normalized:"into"},before:{primary:"avant",normalized:"before"},after:{primary:"apr\u00e8s",normalized:"after"},click:{primary:"clic",alternatives:["clique"],normalized:"click"},resize:{primary:"redimensionnement",alternatives:["redimensionner"],normalized:"resize"},hover:{primary:"survol",alternatives:["survoler"],normalized:"hover"},submit:{primary:"soumission",alternatives:["soumettre"],normalized:"submit"},input:{primary:"saisie",alternatives:["entr\u00e9e"],normalized:"input"},change:{primary:"changement",alternatives:["modifier","changer"],normalized:"change"},load:{primary:"charger",alternatives:["chargement"],normalized:"load"},until:{primary:"jusqu'\u00e0",alternatives:["jusque"],normalized:"until"},event:{primary:"\u00e9v\u00e9nement",normalized:"event"},from:{primary:"de",alternatives:["depuis"],normalized:"from"},connect:{primary:"connecter",alternatives:["connexion"],normalized:"connect"},stream:{primary:"flux",alternatives:["streaming"],normalized:"stream"},live:{primary:"en-direct",alternatives:["direct","vif"],normalized:"live"},socket:{primary:"socket",alternatives:["websocket"],normalized:"socket"},bind:{primary:"lier",alternatives:["relier","bind"],normalized:"bind"},intercept:{primary:"intercepter",alternatives:["intercept"],normalized:"intercept"},worker:{primary:"travailleur",alternatives:["worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["source-d-evenements"],normalized:"eventsource"}},eventHandler:{keyword:{primary:"sur",alternatives:["lors"],normalized:"on"},sourceMarker:{primary:"de",alternatives:["depuis"],position:"before"},conditionalKeyword:{primary:"quand",alternatives:["lorsque"]},eventMarker:{primary:"au",alternatives:["lors du","lors de","sur"],position:"before"},temporalMarkers:["quand","lorsque"]}}}}),Qf={};Ad(Qf,{hebrewProfile:()=>Xf});var eh,th=Cd({"src/generators/profiles/he.ts"(){Xf={code:"he",name:"Hebrew",nativeName:"\u05e2\u05d1\u05e8\u05d9\u05ea",direction:"rtl",script:"hebrew",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:!0,verb:{position:"second",subjectDrop:!0},references:{me:"\u05d0\u05e0\u05d9",it:"\u05d6\u05d4",you:"\u05d0\u05ea\u05d4",result:"\u05ea\u05d5\u05e6\u05d0\u05d4",event:"\u05d0\u05d9\u05e8\u05d5\u05e2",target:"\u05d9\u05e2\u05d3",body:"\u05d2\u05d5\u05e3"},possessive:{marker:"\u05e9\u05dc",markerPosition:"before-property",usePossessiveAdjectives:!0,specialForms:{me:"\u05e9\u05dc\u05d9",it:"\u05e9\u05dc\u05d5",you:"\u05e9\u05dc\u05da"},keywords:{"\u05e9\u05dc\u05d9":"me","\u05e9\u05dc\u05da":"you","\u05e9\u05dc\u05d5":"it","\u05e9\u05dc\u05d4":"it"}},roleMarkers:{destination:{primary:"\u05e2\u05dc",alternatives:["\u05d1","\u05d0\u05dc","\u05dc"],position:"before"},source:{primary:"\u05de",alternatives:["\u05de\u05df","\u05de\u05d0\u05ea"],position:"before"},patient:{primary:"\u05d0\u05ea",position:"before"},style:{primary:"\u05e2\u05dd",alternatives:["\u05d1"],position:"before"}},keywords:{toggle:{primary:"\u05de\u05ea\u05d2",alternatives:["\u05d4\u05d3\u05dc\u05e7 \u05db\u05d1\u05d4"],normalized:"toggle"},add:{primary:"\u05d4\u05d5\u05e1\u05e3",normalized:"add"},remove:{primary:"\u05d4\u05e1\u05e8",alternatives:["\u05de\u05d7\u05e7","\u05d4\u05d5\u05e8\u05d3"],normalized:"remove"},put:{primary:"\u05e9\u05d9\u05dd",alternatives:["\u05d4\u05e0\u05d7","\u05d4\u05db\u05e0\u05e1"],normalized:"put"},append:{primary:"\u05e6\u05e8\u05e3",alternatives:["\u05d4\u05d5\u05e1\u05e3 \u05d1\u05e1\u05d5\u05e3"],normalized:"append"},prepend:{primary:"\u05d4\u05e7\u05d3\u05dd",alternatives:["\u05d4\u05d5\u05e1\u05e3 \u05d1\u05d4\u05ea\u05d7\u05dc\u05d4"],normalized:"prepend"},take:{primary:"\u05e7\u05d7",normalized:"take"},make:{primary:"\u05e6\u05d5\u05e8",alternatives:["\u05d4\u05db\u05df"],normalized:"make"},clone:{primary:"\u05e9\u05db\u05e4\u05dc",normalized:"clone"},swap:{primary:"\u05d4\u05d7\u05dc\u05e3",alternatives:["\u05d4\u05de\u05e8"],normalized:"swap"},morph:{primary:"\u05d4\u05e4\u05d5\u05da",alternatives:["\u05e2\u05e6\u05d1 \u05de\u05d7\u05d3\u05e9"],normalized:"morph"},set:{primary:"\u05e7\u05d1\u05e2",alternatives:["\u05d4\u05d2\u05d3\u05e8"],normalized:"set"},get:{primary:"\u05e7\u05d1\u05dc",alternatives:["\u05d4\u05e9\u05d2"],normalized:"get"},increment:{primary:"\u05d4\u05d2\u05d3\u05dc",alternatives:["\u05d4\u05d5\u05e1\u05e3 \u05d0\u05d7\u05d3"],normalized:"increment"},decrement:{primary:"\u05d4\u05e7\u05d8\u05df",alternatives:["\u05d4\u05e4\u05d7\u05ea"],normalized:"decrement"},log:{primary:"\u05e8\u05e9\u05d5\u05dd",normalized:"log"},show:{primary:"\u05d4\u05e8\u05d0\u05d4",alternatives:["\u05d4\u05e6\u05d2"],normalized:"show"},hide:{primary:"\u05d4\u05e1\u05ea\u05e8",alternatives:["\u05d4\u05d7\u05d1\u05d0"],normalized:"hide"},transition:{primary:"\u05de\u05e2\u05d1\u05e8",alternatives:["\u05d4\u05e0\u05e4\u05e9"],normalized:"transition"},on:{primary:"\u05d1",normalized:"on"},trigger:{primary:"\u05d4\u05e4\u05e2\u05dc",alternatives:["\u05e9\u05d2\u05e8"],normalized:"trigger"},send:{primary:"\u05e9\u05dc\u05d7",normalized:"send"},focus:{primary:"\u05de\u05e7\u05d3",alternatives:["\u05d4\u05ea\u05de\u05e7\u05d3"],normalized:"focus"},blur:{primary:"\u05d8\u05e9\u05d8\u05e9",alternatives:["\u05d4\u05e1\u05e8 \u05de\u05d9\u05e7\u05d5\u05d3"],normalized:"blur"},empty:{primary:"\u05e8\u05d5\u05e7\u05df",normalized:"empty"},open:{primary:"\u05e4\u05ea\u05d7",normalized:"open"},close:{primary:"\u05e1\u05d2\u05d5\u05e8",normalized:"close"},select:{primary:"\u05e1\u05de\u05df",normalized:"select"},clear:{primary:"\u05e0\u05e7\u05d4",normalized:"clear"},reset:{primary:"\u05d0\u05e4\u05e1",normalized:"reset"},breakpoint:{primary:"\u05e0\u05e7\u05d5\u05d3\u05ea-\u05e2\u05e6\u05d9\u05e8\u05d4",alternatives:["breakpoint"],normalized:"breakpoint"},go:{primary:"\u05dc\u05da",alternatives:["\u05e0\u05d5\u05d5\u05d8"],normalized:"go"},scroll:{primary:"\u05d2\u05dc\u05d5\u05dc",normalized:"scroll"},push:{primary:"\u05d3\u05d7\u05d5\u05e3",alternatives:["\u05d4\u05d5\u05e1\u05e3-\u05dc\u05d4\u05d9\u05e1\u05d8\u05d5\u05e8\u05d9\u05d4"],normalized:"push"},replace:{primary:"\u05d4\u05d7\u05dc\u05e3_\u05db\u05ea\u05d5\u05d1\u05ea",alternatives:["\u05e9\u05e0\u05d4_\u05db\u05ea\u05d5\u05d1\u05ea"],normalized:"replace"},process:{primary:"\u05e2\u05d1\u05d3",alternatives:["\u05e2\u05d9\u05d1\u05d5\u05d3"],normalized:"process"},wait:{primary:"\u05d7\u05db\u05d4",alternatives:["\u05d4\u05de\u05ea\u05df"],normalized:"wait"},fetch:{primary:"\u05d4\u05d1\u05d0",alternatives:["\u05d8\u05e2\u05df"],normalized:"fetch"},settle:{primary:"\u05d4\u05ea\u05d9\u05d9\u05e6\u05d1",normalized:"settle"},if:{primary:"\u05d0\u05dd",normalized:"if"},unless:{primary:"\u05d0\u05dc\u05d0",normalized:"unless"},when:{primary:"\u05db\u05d0\u05e9\u05e8",alternatives:["\u05db\u05e9"],normalized:"when"},where:{primary:"\u05d0\u05d9\u05e4\u05d4",alternatives:["\u05d4\u05d9\u05db\u05df"],normalized:"where"},else:{primary:"\u05d0\u05d7\u05e8\u05ea",alternatives:["\u05d0\u05dd \u05dc\u05d0"],normalized:"else"},repeat:{primary:"\u05d7\u05d6\u05d5\u05e8",normalized:"repeat"},for:{primary:"\u05e2\u05d1\u05d5\u05e8",alternatives:["\u05dc\u05db\u05dc"],normalized:"for"},while:{primary:"\u05db\u05dc \u05e2\u05d5\u05d3",alternatives:["\u05d1\u05d6\u05de\u05df"],normalized:"while"},forever:{primary:"forever",normalized:"forever"},continue:{primary:"\u05d4\u05de\u05e9\u05da",normalized:"continue"},halt:{primary:"\u05e2\u05e6\u05d5\u05e8",alternatives:["\u05d4\u05e4\u05e1\u05e7"],normalized:"halt"},throw:{primary:"\u05d6\u05e8\u05d5\u05e7",normalized:"throw"},call:{primary:"\u05e7\u05e8\u05d0",alternatives:["\u05d6\u05de\u05df"],normalized:"call"},return:{primary:"\u05d4\u05d7\u05d6\u05e8",normalized:"return"},then:{primary:"\u05d0\u05d6",alternatives:["\u05d5\u05d0\u05d6"],normalized:"then"},and:{primary:"\u05d5\u05d2\u05dd",alternatives:["\u05d2\u05dd"],normalized:"and"},end:{primary:"\u05e1\u05d5\u05e3",alternatives:["\u05e1\u05d9\u05d5\u05dd"],normalized:"end"},js:{primary:"js",alternatives:["\u05d2\u05f3\u05d0\u05d5\u05d5\u05d4\u05e1\u05e7\u05e8\u05d9\u05e4\u05d8"],normalized:"js"},async:{primary:"\u05d0\u05e1\u05d9\u05e0\u05db\u05e8\u05d5\u05e0\u05d9",normalized:"async"},tell:{primary:"\u05d0\u05de\u05d5\u05e8",normalized:"tell"},default:{primary:"\u05d1\u05e8\u05d9\u05e8\u05ea \u05de\u05d7\u05d3\u05dc",normalized:"default"},init:{primary:"\u05d0\u05ea\u05d7\u05dc",alternatives:["\u05d4\u05ea\u05d7\u05dc"],normalized:"init"},behavior:{primary:"\u05d4\u05ea\u05e0\u05d4\u05d2\u05d5\u05ea",normalized:"behavior"},install:{primary:"\u05d4\u05ea\u05e7\u05df",normalized:"install"},measure:{primary:"\u05de\u05d3\u05d5\u05d3",normalized:"measure"},beep:{primary:"\u05d1\u05d9\u05e4",normalized:"beep"},break:{primary:"\u05e9\u05d1\u05d5\u05e8",normalized:"break"},copy:{primary:"\u05d4\u05e2\u05ea\u05e7",normalized:"copy"},exit:{primary:"\u05e6\u05d0",normalized:"exit"},pick:{primary:"\u05d1\u05d7\u05e8",normalized:"pick"},render:{primary:"\u05e8\u05e0\u05d3\u05e8",normalized:"render"},into:{primary:"\u05dc\u05ea\u05d5\u05da",alternatives:["\u05d0\u05dc"],normalized:"into"},before:{primary:"\u05dc\u05e4\u05e0\u05d9",normalized:"before"},after:{primary:"\u05d0\u05d7\u05e8\u05d9",normalized:"after"},click:{primary:"\u05dc\u05d7\u05d9\u05e6\u05d4",alternatives:["\u05e7\u05dc\u05d9\u05e7"],normalized:"click"},hover:{primary:"\u05e8\u05d9\u05d7\u05d5\u05e3",normalized:"hover"},submit:{primary:"\u05e9\u05dc\u05d9\u05d7\u05d4",alternatives:["\u05d4\u05d2\u05e9\u05d4"],normalized:"submit"},input:{primary:"\u05e7\u05dc\u05d8",alternatives:["\u05d4\u05d6\u05e0\u05d4"],normalized:"input"},change:{primary:"\u05e9\u05d9\u05e0\u05d5\u05d9",alternatives:["\u05e2\u05d3\u05db\u05d5\u05df"],normalized:"change"},until:{primary:"\u05e2\u05d3",normalized:"until"},event:{primary:"\u05d0\u05d9\u05e8\u05d5\u05e2",normalized:"event"},from:{primary:"\u05de",alternatives:["\u05de\u05d0\u05ea"],normalized:"from"},connect:{primary:"\u05d4\u05ea\u05d7\u05d1\u05e8",alternatives:["\u05d7\u05d1\u05e8","\u05d4\u05ea\u05d7\u05d1\u05e8\u05d5\u05ea"],normalized:"connect"},stream:{primary:"\u05d4\u05d6\u05e8\u05dd",alternatives:["\u05e1\u05d8\u05e8\u05d9\u05dd","\u05e9\u05d9\u05d3\u05d5\u05e8"],normalized:"stream"},live:{primary:"\u05d7\u05d9",alternatives:["\u05d1\u05d6\u05de\u05df-\u05d0\u05de\u05ea","\u05dc\u05d9\u05d9\u05d1"],normalized:"live"},socket:{primary:"\u05e9\u05e7\u05e2",alternatives:["\u05e1\u05d5\u05e7\u05d8","\u05d5\u05d5\u05d1-\u05e1\u05d5\u05e7\u05d8","socket"],normalized:"socket"},bind:{primary:"\u05e7\u05e9\u05d5\u05e8",alternatives:["\u05d0\u05d2\u05d3","bind"],normalized:"bind"},intercept:{primary:"\u05d9\u05d9\u05e8\u05d8",alternatives:["\u05d9\u05d9\u05e8\u05d5\u05d8","intercept"],normalized:"intercept"},worker:{primary:"\u05e2\u05d5\u05d1\u05d3",alternatives:["worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["\u05de\u05e7\u05d5\u05e8-\u05d0\u05d9\u05e8\u05d5\u05e2\u05d9\u05dd"],normalized:"eventsource"}},tokenization:{prefixes:["\u05d4","\u05d5","\u05d1","\u05db","\u05dc","\u05de","\u05e9"]},eventHandler:{keyword:{primary:"\u05d1",normalized:"on"},sourceMarker:{primary:"\u05de",alternatives:["\u05de\u05d0\u05ea"],position:"before"},conditionalKeyword:{primary:"\u05db\u05d0\u05e9\u05e8",alternatives:["\u05db\u05e9","\u05d0\u05dd"]},eventMarker:{primary:"\u05d1",alternatives:["\u05db\u05e9"],position:"before"},temporalMarkers:["\u05db\u05d0\u05e9\u05e8","\u05db\u05e9"]}}}}),rh={};Ad(rh,{hindiProfile:()=>eh});var nh,ih=Cd({"src/generators/profiles/hindi.ts"(){eh={code:"hi",name:"Hindi",nativeName:"\u0939\u093f\u0928\u094d\u0926\u0940",direction:"ltr",script:"devanagari",wordOrder:"SOV",markingStrategy:"postposition",usesSpaces:!0,defaultVerbForm:"imperative",verb:{position:"end",suffixes:["\u0947\u0902","\u093e","\u0940","\u0947","\u094b"],subjectDrop:!0},references:{me:"\u092e\u0948\u0902",it:"\u092f\u0939",you:"\u0906\u092a",result:"\u092a\u0930\u093f\u0923\u093e\u092e",event:"\u0918\u091f\u0928\u093e",target:"\u0932\u0915\u094d\u0937\u094d\u092f",body:"\u092c\u0949\u0921\u0940",document:"\u0926\u0938\u094d\u0924\u093e\u0935\u0947\u091c\u093c",window:"\u0935\u093f\u0902\u0921\u094b",detail:"\u0935\u093f\u0935\u0930\u0923"},possessive:{marker:"\u0915\u093e",markerPosition:"between",keywords:{"\u092e\u0947\u0930\u093e":"me","\u092e\u0947\u0930\u0940":"me","\u092e\u0947\u0930\u0947":"me","\u0924\u0947\u0930\u093e":"you","\u0924\u0947\u0930\u0940":"you","\u0924\u0947\u0930\u0947":"you","\u0906\u092a\u0915\u093e":"you","\u0906\u092a\u0915\u0940":"you","\u0906\u092a\u0915\u0947":"you","\u0909\u0938\u0915\u093e":"it","\u0909\u0938\u0915\u0940":"it","\u0909\u0938\u0915\u0947":"it","\u0907\u0938\u0915\u093e":"it","\u0907\u0938\u0915\u0940":"it","\u0907\u0938\u0915\u0947":"it"}},roleMarkers:{patient:{primary:"\u0915\u094b",position:"after"},destination:{primary:"\u092e\u0947\u0902",alternatives:["\u092a\u0930"],position:"after"},source:{primary:"\u0938\u0947",position:"after"},style:{primary:"\u0938\u0947",position:"after"},event:{primary:"\u092a\u0930",position:"after"}},keywords:{toggle:{primary:"\u091f\u0949\u0917\u0932",alternatives:["\u092c\u0926\u0932\u0947\u0902","\u092c\u0926\u0932"],normalized:"toggle"},add:{primary:"\u091c\u094b\u0921\u093c\u0947\u0902",alternatives:["\u091c\u094b\u0921\u093c"],normalized:"add"},remove:{primary:"\u0939\u091f\u093e\u090f\u0902",alternatives:["\u0939\u091f\u093e","\u092e\u093f\u091f\u093e\u090f\u0902"],normalized:"remove"},put:{primary:"\u0930\u0916\u0947\u0902",alternatives:["\u0930\u0916","\u0921\u093e\u0932\u0947\u0902","\u0921\u093e\u0932"],normalized:"put"},append:{primary:"\u0938\u0902\u0932\u0917\u094d\u0928",alternatives:[],normalized:"append"},prepend:{primary:"\u091c\u094b\u0921\u093c\u0947\u0902_\u0936\u0941\u0930\u0942",alternatives:[],normalized:"prepend"},take:{primary:"\u0932\u0947\u0902",alternatives:["\u0932\u0947"],normalized:"take"},make:{primary:"\u092c\u0928\u093e\u090f\u0902",alternatives:["\u092c\u0928\u093e"],normalized:"make"},clone:{primary:"\u0915\u094d\u0932\u094b\u0928",alternatives:["\u092a\u094d\u0930\u0924\u093f\u0932\u093f\u092a\u093f"],normalized:"clone"},swap:{primary:"\u0935\u093f\u0928\u093f\u092e\u092f",alternatives:[],normalized:"swap"},morph:{primary:"\u0930\u0942\u092a\u093e\u0902\u0924\u0930",alternatives:[],normalized:"morph"},set:{primary:"\u0938\u0947\u091f",alternatives:["\u0928\u093f\u0930\u094d\u0927\u093e\u0930\u093f\u0924"],normalized:"set"},get:{primary:"\u092a\u094d\u0930\u093e\u092a\u094d\u0924",alternatives:["\u092a\u093e\u090f\u0902"],normalized:"get"},increment:{primary:"\u092c\u0922\u093c\u093e\u090f\u0902",alternatives:["\u092c\u0922\u093c\u093e"],normalized:"increment"},decrement:{primary:"\u0918\u091f\u093e\u090f\u0902",alternatives:["\u0918\u091f\u093e"],normalized:"decrement"},log:{primary:"\u0932\u0949\u0917",alternatives:["\u0926\u0930\u094d\u091c"],normalized:"log"},show:{primary:"\u0926\u093f\u0916\u093e\u090f\u0902",alternatives:["\u0926\u093f\u0916\u093e"],normalized:"show"},hide:{primary:"\u091b\u093f\u092a\u093e\u090f\u0902",alternatives:["\u091b\u093f\u092a\u093e"],normalized:"hide"},transition:{primary:"\u0938\u0902\u0915\u094d\u0930\u092e\u0923",alternatives:[],normalized:"transition"},on:{primary:"\u092a\u0930",alternatives:[],normalized:"on"},trigger:{primary:"\u091f\u094d\u0930\u093f\u0917\u0930",alternatives:[],normalized:"trigger"},send:{primary:"\u092d\u0947\u091c\u0947\u0902",alternatives:["\u092d\u0947\u091c"],normalized:"send"},focus:{primary:"\u092b\u094b\u0915\u0938",alternatives:["\u0915\u0947\u0902\u0926\u094d\u0930\u093f\u0924"],normalized:"focus"},blur:{primary:"\u0927\u0941\u0902\u0927\u0932\u093e",alternatives:["\u092b\u094b\u0915\u0938_\u0939\u091f\u093e\u090f\u0902"],normalized:"blur"},empty:{primary:"\u0916\u093e\u0932\u0940-\u0915\u0930\u0947\u0902",alternatives:["\u0916\u093e\u0932\u0940"],normalized:"empty"},open:{primary:"\u0916\u094b\u0932\u0947\u0902",normalized:"open"},close:{primary:"\u092c\u0902\u0926-\u0915\u0930\u0947\u0902",normalized:"close"},select:{primary:"\u091a\u093f\u0939\u094d\u0928\u093f\u0924-\u0915\u0930\u0947\u0902",normalized:"select"},clear:{primary:"\u0938\u093e\u092b\u093c-\u0915\u0930\u0947\u0902",alternatives:["\u0938\u093e\u092b-\u0915\u0930\u0947\u0902"],normalized:"clear"},reset:{primary:"\u0930\u0940\u0938\u0947\u091f",normalized:"reset"},breakpoint:{primary:"\u092c\u094d\u0930\u0947\u0915\u092a\u094d\u0935\u093e\u0907\u0902\u091f",normalized:"breakpoint"},click:{primary:"\u0915\u094d\u0932\u093f\u0915",normalized:"click"},hover:{primary:"\u0939\u094b\u0935\u0930",alternatives:["\u090a\u092a\u0930_\u0930\u0916\u0947\u0902"],normalized:"hover"},submit:{primary:"\u0938\u092c\u092e\u093f\u091f",alternatives:["\u091c\u092e\u093e"],normalized:"submit"},input:{primary:"\u0907\u0928\u092a\u0941\u091f",alternatives:[],normalized:"input"},change:{primary:"\u092c\u0926\u0932\u093e\u0935",alternatives:["\u092a\u0930\u093f\u0935\u0930\u094d\u0924\u0928"],normalized:"change"},go:{primary:"\u091c\u093e\u090f\u0902",alternatives:["\u091c\u093e"],normalized:"go"},scroll:{primary:"\u0938\u094d\u0915\u094d\u0930\u0949\u0932",normalized:"scroll"},push:{primary:"\u0927\u0915\u0947\u0932\u0947\u0902",alternatives:["\u092a\u0941\u0936"],normalized:"push"},replace:{primary:"\u092c\u0926\u0932\u0947\u0902_\u092f\u0942\u0906\u0930\u090f\u0932",alternatives:["\u092a\u094d\u0930\u0924\u093f\u0938\u094d\u0925\u093e\u092a\u093f\u0924"],normalized:"replace"},process:{primary:"\u0938\u0902\u0938\u093e\u0927\u093f\u0924",alternatives:["\u092a\u094d\u0930\u0938\u0902\u0938\u094d\u0915\u0943\u0924"],normalized:"process"},wait:{primary:"\u092a\u094d\u0930\u0924\u0940\u0915\u094d\u0937\u093e",alternatives:["\u0930\u0941\u0915\u0947\u0902"],normalized:"wait"},fetch:{primary:"\u0932\u093e\u090f\u0902",alternatives:[],normalized:"fetch"},settle:{primary:"\u0938\u094d\u0925\u093f\u0930",alternatives:[],normalized:"settle"},if:{primary:"\u0905\u0917\u0930",alternatives:["\u092f\u0926\u093f"],normalized:"if"},when:{primary:"\u091c\u092c",normalized:"when"},where:{primary:"\u0915\u0939\u093e\u0901",normalized:"where"},else:{primary:"\u0935\u0930\u0928\u093e",alternatives:["\u0928\u0939\u0940\u0902 \u0924\u094b"],normalized:"else"},repeat:{primary:"\u0926\u094b\u0939\u0930\u093e\u090f\u0902",alternatives:["\u0926\u094b\u0939\u0930\u093e"],normalized:"repeat"},for:{primary:"\u0915\u0947 \u0932\u093f\u090f",alternatives:["\u0939\u0947\u0924\u0941"],normalized:"for"},while:{primary:"\u091c\u092c \u0924\u0915",alternatives:[],normalized:"while"},forever:{primary:"\u0939\u092e\u0947\u0936\u093e",normalized:"forever",alternatives:["forever"]},unless:{primary:"\u091c\u092c \u0924\u0915 \u0928\u0939\u0940\u0902",normalized:"unless"},continue:{primary:"\u091c\u093e\u0930\u0940",alternatives:[],normalized:"continue"},halt:{primary:"\u0930\u094b\u0915\u0947\u0902",alternatives:["\u0930\u094b\u0915"],normalized:"halt"},throw:{primary:"\u092b\u0947\u0902\u0915\u0947\u0902",alternatives:["\u092b\u0947\u0902\u0915"],normalized:"throw"},call:{primary:"\u0915\u0949\u0932",alternatives:["\u092c\u0941\u0932\u093e\u090f\u0902"],normalized:"call"},return:{primary:"\u0932\u094c\u091f\u093e\u090f\u0902",alternatives:["\u0932\u094c\u091f\u093e"],normalized:"return"},then:{primary:"\u092b\u093f\u0930",alternatives:["\u0924\u092c"],normalized:"then"},and:{primary:"\u0914\u0930",alternatives:[],normalized:"and"},matches:{primary:"\u092e\u0947\u0932 \u0916\u093e\u0924\u093e",normalized:"matches"},exists:{primary:"\u092e\u094c\u091c\u0942\u0926",normalized:"exists"},end:{primary:"\u0938\u092e\u093e\u092a\u094d\u0924",alternatives:["\u0905\u0902\u0924"],normalized:"end"},js:{primary:"\u091c\u0947\u090f\u0938",alternatives:["js"],normalized:"js"},async:{primary:"\u0905\u0938\u093f\u0902\u0915",alternatives:[],normalized:"async"},tell:{primary:"\u092c\u0924\u093e\u090f\u0902",alternatives:["\u092c\u0924\u093e"],normalized:"tell"},default:{primary:"\u0921\u093f\u092b\u093c\u0949\u0932\u094d\u091f",alternatives:[],normalized:"default"},init:{primary:"\u092a\u094d\u0930\u093e\u0930\u0902\u092d",alternatives:[],normalized:"init"},behavior:{primary:"\u0935\u094d\u092f\u0935\u0939\u093e\u0930",alternatives:[],normalized:"behavior"},install:{primary:"\u0907\u0902\u0938\u094d\u091f\u0949\u0932",alternatives:[],normalized:"install"},measure:{primary:"\u092e\u093e\u092a\u0947\u0902",alternatives:[],normalized:"measure"},beep:{primary:"\u092c\u0940\u092a",alternatives:[],normalized:"beep"},break:{primary:"\u0924\u094b\u0921\u093c\u0947\u0902",alternatives:[],normalized:"break"},copy:{primary:"\u0915\u0949\u092a\u0940",alternatives:[],normalized:"copy"},exit:{primary:"\u092c\u093e\u0939\u0930",alternatives:[],normalized:"exit"},pick:{primary:"\u091a\u0941\u0928\u0947\u0902",alternatives:[],normalized:"pick"},render:{primary:"\u0930\u0947\u0902\u0921\u0930",alternatives:[],normalized:"render"},into:{primary:"\u092e\u0947\u0902",alternatives:[],normalized:"into"},before:{primary:"\u0938\u0947 \u092a\u0939\u0932\u0947",alternatives:["\u092a\u0939\u0932\u0947"],normalized:"before"},after:{primary:"\u0915\u0947 \u092c\u093e\u0926",alternatives:["\u092c\u093e\u0926"],normalized:"after"},until:{primary:"\u0924\u0915",alternatives:[],normalized:"until"},event:{primary:"\u0918\u091f\u0928\u093e",alternatives:[],normalized:"event"},from:{primary:"\u0938\u0947",normalized:"from"},connect:{primary:"\u0915\u0928\u0947\u0915\u094d\u091f",alternatives:["\u0938\u0902\u092f\u094b\u091c\u093f\u0924"],normalized:"connect"},stream:{primary:"\u0938\u094d\u091f\u094d\u0930\u0940\u092e",alternatives:["\u0927\u093e\u0930\u093e","\u092a\u094d\u0930\u0935\u093e\u0939"],normalized:"stream"},live:{primary:"\u0932\u093e\u0907\u0935",alternatives:["\u0938\u091c\u0940\u0935","\u092a\u094d\u0930\u0924\u094d\u092f\u0915\u094d\u0937"],normalized:"live"},socket:{primary:"\u0938\u0949\u0915\u0947\u091f",alternatives:["\u0935\u0947\u092c\u0938\u0949\u0915\u0947\u091f"],normalized:"socket"},worker:{primary:"worker",alternatives:["\u0935\u0930\u094d\u0915\u0930"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["\u0907\u0935\u0947\u0902\u091f\u0938\u094b\u0930\u094d\u0938"],normalized:"eventsource"},bind:{primary:"bind",alternatives:["\u092c\u093e\u0907\u0902\u0921","\u092c\u093e\u0902\u0927\u0947\u0902"],normalized:"bind"},intercept:{primary:"intercept",alternatives:["\u0907\u0902\u091f\u0930\u0938\u0947\u092a\u094d\u091f"],normalized:"intercept"}},tokenization:{particles:["\u0915\u094b","\u092e\u0947\u0902","\u092a\u0930","\u0938\u0947","\u0915\u093e","\u0915\u0940","\u0915\u0947","\u0924\u0915","\u0928\u0947"],boundaryStrategy:"space"},eventHandler:{keyword:{primary:"\u092a\u0930",alternatives:[],normalized:"on"},sourceMarker:{primary:"\u0938\u0947",position:"after"},eventMarker:{primary:"\u092a\u0930",alternatives:[],position:"after"},temporalMarkers:["\u091c\u092c","\u091c\u092c \u092d\u0940"]}}}}),ah={};Ad(ah,{indonesianProfile:()=>nh});var oh,sh=Cd({"src/generators/profiles/indonesian.ts"(){nh={code:"id",name:"Indonesian",nativeName:"Bahasa Indonesia",regions:["priority"],direction:"ltr",script:"latin",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:!0,verb:{position:"start",subjectDrop:!0},references:{me:"saya",it:"itu",you:"anda",result:"hasil",event:"peristiwa",target:"target",body:"badan",document:"dokumen",window:"jendela",detail:"detail"},possessive:{marker:"",markerPosition:"after-object",usePossessiveAdjectives:!0,specialForms:{me:"saya",it:"nya",you:"anda"},keywords:{saya:"me",aku:"me",ku:"me",my:"me",anda:"you",kamu:"you",mu:"you",nya:"it",dia:"it",miliknya:"it"},connectors:["punya"]},roleMarkers:{destination:{primary:"pada",alternatives:["ke","di"],position:"before"},source:{primary:"dari",position:"before"},patient:{primary:"",position:"before"},style:{primary:"dengan",position:"before"}},keywords:{toggle:{primary:"alihkan",normalized:"toggle"},add:{primary:"tambah",alternatives:["tambahkan"],normalized:"add"},remove:{primary:"hapus",alternatives:["buang","hilangkan"],normalized:"remove"},put:{primary:"taruh",alternatives:["letakkan","masukkan"],normalized:"put"},append:{primary:"sisipkan",normalized:"append"},prepend:{primary:"awali",normalized:"prepend"},take:{primary:"ambil",normalized:"take"},make:{primary:"buat",alternatives:["bikin","ciptakan"],normalized:"make"},clone:{primary:"klon",alternatives:["tiru"],normalized:"clone"},swap:{primary:"tukar",alternatives:["ganti"],normalized:"swap"},morph:{primary:"ubah",alternatives:["transformasi"],normalized:"morph"},set:{primary:"atur",alternatives:["tetapkan"],normalized:"set"},get:{primary:"dapatkan",alternatives:["peroleh"],normalized:"get"},increment:{primary:"tingkatkan",alternatives:["naikkan"],normalized:"increment"},decrement:{primary:"turunkan",alternatives:["kurangi"],normalized:"decrement"},log:{primary:"catat",alternatives:["rekam","cetak"],normalized:"log"},show:{primary:"tampilkan",alternatives:["perlihatkan"],normalized:"show"},hide:{primary:"sembunyikan",alternatives:["tutup"],normalized:"hide"},transition:{primary:"transisi",alternatives:["animasikan"],normalized:"transition"},on:{primary:"pada",alternatives:["saat"],normalized:"on"},trigger:{primary:"picu",alternatives:["jalankan"],normalized:"trigger"},send:{primary:"kirim",alternatives:["kirimkan"],normalized:"send"},focus:{primary:"fokus",alternatives:["fokuskan"],normalized:"focus"},blur:{primary:"blur",normalized:"blur"},empty:{primary:"kosongkan",alternatives:["kosong"],normalized:"empty"},open:{primary:"buka",normalized:"open"},close:{primary:"tutupkan",normalized:"close"},select:{primary:"tandai",normalized:"select"},clear:{primary:"bersihkan",normalized:"clear"},reset:{primary:"setel-ulang",alternatives:["reset"],normalized:"reset"},breakpoint:{primary:"titik-henti",normalized:"breakpoint"},go:{primary:"pergi",alternatives:["pindah","navigasi"],normalized:"go"},scroll:{primary:"gulir",alternatives:["gulung"],normalized:"scroll"},push:{primary:"dorong",alternatives:["push"],normalized:"push"},replace:{primary:"ganti_url",alternatives:["gantikan_url"],normalized:"replace"},process:{primary:"proses",normalized:"process"},wait:{primary:"tunggu",normalized:"wait"},fetch:{primary:"muat",normalized:"fetch"},settle:{primary:"stabilkan",normalized:"settle"},if:{primary:"jika",alternatives:["kalau","bila"],normalized:"if"},unless:{primary:"kecuali",normalized:"unless"},when:{primary:"ketika",normalized:"when"},where:{primary:"di_mana",normalized:"where"},else:{primary:"selainnya",alternatives:["lainnya"],normalized:"else"},repeat:{primary:"ulangi",normalized:"repeat"},for:{primary:"untuk",normalized:"for"},while:{primary:"selama",normalized:"while"},forever:{primary:"forever",normalized:"forever"},continue:{primary:"lanjutkan",alternatives:["terus"],normalized:"continue"},halt:{primary:"hentikan",alternatives:["berhenti"],normalized:"halt"},throw:{primary:"lempar",normalized:"throw"},call:{primary:"panggil",normalized:"call"},return:{primary:"kembalikan",alternatives:["kembali"],normalized:"return"},then:{primary:"lalu",alternatives:["kemudian","setelah itu"],normalized:"then"},and:{primary:"dan",alternatives:["juga","serta"],normalized:"and"},matches:{primary:"cocok",normalized:"matches"},end:{primary:"selesai",alternatives:["akhir","tamat"],normalized:"end"},js:{primary:"js",alternatives:["javascript"],normalized:"js"},async:{primary:"asinkron",normalized:"async"},tell:{primary:"katakan",alternatives:["beritahu"],normalized:"tell"},default:{primary:"bawaan",normalized:"default"},init:{primary:"inisialisasi",alternatives:["mulai"],normalized:"init"},behavior:{primary:"perilaku",normalized:"behavior"},install:{primary:"pasang",alternatives:["instal"],normalized:"install"},measure:{primary:"ukur",normalized:"measure"},beep:{primary:"bunyi",normalized:"beep"},break:{primary:"putuskan",normalized:"break"},copy:{primary:"salin",normalized:"copy"},exit:{primary:"keluar",normalized:"exit"},pick:{primary:"pilih",normalized:"pick"},render:{primary:"olah",normalized:"render"},into:{primary:"ke dalam",normalized:"into"},before:{primary:"sebelum",normalized:"before"},after:{primary:"sesudah",alternatives:["setelah"],normalized:"after"},click:{primary:"klik",alternatives:["tekan"],normalized:"click"},hover:{primary:"hover",alternatives:["arahkan"],normalized:"hover"},submit:{primary:"ajukan",normalized:"submit"},input:{primary:"masuk",alternatives:["input","masukan"],normalized:"input"},change:{primary:"berubah",normalized:"change"},until:{primary:"sampai",normalized:"until"},event:{primary:"peristiwa",alternatives:["event"],normalized:"event"},from:{primary:"dari",normalized:"from"},connect:{primary:"sambungkan",alternatives:["hubungkan","koneksi"],normalized:"connect"},stream:{primary:"alirkan",alternatives:["streaming"],normalized:"stream"},live:{primary:"langsung",alternatives:["live"],normalized:"live"},socket:{primary:"soket",alternatives:["socket","websocket"],normalized:"socket"},bind:{primary:"ikat",alternatives:["kaitkan","bind"],normalized:"bind"},intercept:{primary:"cegat",alternatives:["tangkap","intercept"],normalized:"intercept"},worker:{primary:"pekerja",alternatives:["worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["sumber peristiwa"],normalized:"eventsource"}},eventHandler:{keyword:{primary:"pada",alternatives:["ketika","saat"],normalized:"on"},sourceMarker:{primary:"dari",position:"before"},conditionalKeyword:{primary:"ketika",alternatives:["saat","waktu"]},eventMarker:{primary:"saat",alternatives:["ketika","pada"],position:"before"},temporalMarkers:["ketika","saat"]}}}}),lh={};Ad(lh,{italianProfile:()=>oh});var ch,uh=Cd({"src/generators/profiles/italian.ts"(){oh={code:"it",name:"Italian",nativeName:"Italiano",regions:["western"],direction:"ltr",script:"latin",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:!0,defaultVerbForm:"infinitive",verb:{position:"start",subjectDrop:!0},references:{me:"io",it:"esso",you:"tu",result:"risultato",event:"evento",target:"obiettivo",body:"corpo",document:"documento",window:"finestra",detail:"dettaglio"},possessive:{marker:"di",markerPosition:"before-property",usePossessiveAdjectives:!0,specialForms:{me:"mio",it:"suo",you:"tuo"},keywords:{mio:"me",mia:"me",miei:"me",mie:"me",tuo:"you",tua:"you",tuoi:"you",tue:"you",suo:"it",sua:"it",suoi:"it",sue:"it"}},roleMarkers:{destination:{primary:"in",alternatives:["su","a"],position:"before"},source:{primary:"da",alternatives:["di"],position:"before"},patient:{primary:"",position:"before"},style:{primary:"con",position:"before"}},keywords:{toggle:{primary:"commutare",alternatives:["alternare"],normalized:"toggle"},add:{primary:"aggiungere",alternatives:["aggiungi"],normalized:"add"},remove:{primary:"rimuovere",alternatives:["eliminare","togliere"],normalized:"remove"},put:{primary:"mettere",alternatives:["inserire"],normalized:"put"},append:{primary:"accodare",normalized:"append"},prepend:{primary:"anteporre",normalized:"prepend"},take:{primary:"prendere",normalized:"take"},make:{primary:"fare",alternatives:["creare"],normalized:"make"},clone:{primary:"clonare",normalized:"clone"},swap:{primary:"scambiare",normalized:"swap"},morph:{primary:"trasformare",alternatives:["convertire"],normalized:"morph"},set:{primary:"impostare",alternatives:["definire"],normalized:"set"},get:{primary:"ottenere",normalized:"get"},increment:{primary:"incrementare",alternatives:["aumentare"],normalized:"increment"},decrement:{primary:"decrementare",alternatives:["diminuire"],normalized:"decrement"},log:{primary:"registrare",normalized:"log"},show:{primary:"mostrare",alternatives:["visualizzare"],normalized:"show"},hide:{primary:"nascondere",normalized:"hide"},transition:{primary:"transizione",alternatives:["animare"],normalized:"transition"},on:{primary:"su",alternatives:["al"],normalized:"on"},trigger:{primary:"scatenare",alternatives:["attivare"],normalized:"trigger"},send:{primary:"inviare",normalized:"send"},focus:{primary:"focalizzare",normalized:"focus"},blur:{primary:"sfuocare",normalized:"blur"},empty:{primary:"svuotare",alternatives:["vuoto"],normalized:"empty"},open:{primary:"aprire",normalized:"open"},close:{primary:"chiudere",normalized:"close"},select:{primary:"selezionare",normalized:"select"},clear:{primary:"cancellare",normalized:"clear"},reset:{primary:"reimpostare",normalized:"reset"},breakpoint:{primary:"punto-interruzione",normalized:"breakpoint"},go:{primary:"andare",alternatives:["navigare","vai"],normalized:"go"},scroll:{primary:"scorrere",alternatives:["scroll"],normalized:"scroll"},push:{primary:"spingere",alternatives:["push"],normalized:"push"},replace:{primary:"sostituire",normalized:"replace"},process:{primary:"elaborare",alternatives:["processare"],normalized:"process"},wait:{primary:"aspettare",alternatives:["attendere"],normalized:"wait"},fetch:{primary:"recuperare",normalized:"fetch"},settle:{primary:"stabilizzare",normalized:"settle"},if:{primary:"se",normalized:"if"},unless:{primary:"salvo",normalized:"unless"},when:{primary:"quando",normalized:"when"},where:{primary:"dove",normalized:"where"},else:{primary:"altrimenti",normalized:"else"},repeat:{primary:"ripetere",normalized:"repeat"},for:{primary:"per",normalized:"for"},while:{primary:"mentre",normalized:"while"},forever:{primary:"forever",normalized:"forever"},continue:{primary:"continuare",normalized:"continue"},halt:{primary:"fermare",normalized:"halt"},throw:{primary:"lanciare",normalized:"throw"},call:{primary:"chiamare",normalized:"call"},return:{primary:"ritornare",normalized:"return"},then:{primary:"allora",alternatives:["poi","quindi"],normalized:"then"},and:{primary:"e",alternatives:["anche"],normalized:"and"},matches:{primary:"corrisponde",normalized:"matches"},no:{primary:"nessun",normalized:"no"},end:{primary:"fine",normalized:"end"},js:{primary:"js",normalized:"js"},async:{primary:"asincrono",normalized:"async"},tell:{primary:"dire",normalized:"tell"},default:{primary:"predefinito",normalized:"default"},init:{primary:"inizializzare",alternatives:["inizia"],normalized:"init"},behavior:{primary:"comportamento",normalized:"behavior"},install:{primary:"installare",normalized:"install"},measure:{primary:"misurare",normalized:"measure"},beep:{primary:"beep",normalized:"beep"},break:{primary:"interrompere",normalized:"break"},copy:{primary:"copiare",normalized:"copy"},exit:{primary:"uscire",normalized:"exit"},pick:{primary:"scegliere",normalized:"pick"},render:{primary:"renderizzare",normalized:"render"},into:{primary:"in",alternatives:["dentro"],normalized:"into"},before:{primary:"prima",normalized:"before"},after:{primary:"dopo",normalized:"after"},click:{primary:"clic",alternatives:["clicca"],normalized:"click"},resize:{primary:"ridimensiona",normalized:"resize"},hover:{primary:"passaggio",alternatives:["sorvolo"],normalized:"hover"},submit:{primary:"invio",alternatives:["sottomettere"],normalized:"submit"},input:{primary:"inserimento",alternatives:["input"],normalized:"input"},change:{primary:"cambio",alternatives:["cambiamento"],normalized:"change"},load:{primary:"carica",alternatives:["caricamento"],normalized:"load"},until:{primary:"fino",normalized:"until"},event:{primary:"evento",normalized:"event"},from:{primary:"da",alternatives:["di"],normalized:"from"},connect:{primary:"connettere",alternatives:["connettersi","collegare"],normalized:"connect"},stream:{primary:"trasmettere",alternatives:["flusso","streaming"],normalized:"stream"},live:{primary:"in-diretta",alternatives:["diretta","dal-vivo","vivo"],normalized:"live"},socket:{primary:"socket",alternatives:["presa","websocket"],normalized:"socket"},bind:{primary:"vincolare",alternatives:["legare","bind"],normalized:"bind"},intercept:{primary:"intercettare",alternatives:["intercept"],normalized:"intercept"},worker:{primary:"lavoratore",alternatives:["worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["sorgente-eventi"],normalized:"eventsource"}},eventHandler:{keyword:{primary:"su",alternatives:["al"],normalized:"on"},sourceMarker:{primary:"da",alternatives:["di"],position:"before"},conditionalKeyword:{primary:"quando",alternatives:["se"]},eventMarker:{primary:"al",alternatives:["allo","alla","su"],position:"before"},temporalMarkers:["quando","al"]}}}}),ph={};Ad(ph,{japaneseProfile:()=>ch});var dh,mh=Cd({"src/generators/profiles/japanese.ts"(){ch={code:"ja",name:"Japanese",nativeName:"\u65e5\u672c\u8a9e",regions:["east-asian","priority"],direction:"ltr",script:"cjk",wordOrder:"SOV",markingStrategy:"particle",usesSpaces:!1,defaultVerbForm:"base",verb:{position:"end",suffixes:["\u308b","\u3066","\u305f","\u307e\u3059","\u306a\u3044"],subjectDrop:!0},references:{me:"\u81ea\u5206",it:"\u305d\u308c",you:"\u3042\u306a\u305f",result:"\u7d50\u679c",event:"\u30a4\u30d9\u30f3\u30c8",target:"\u30bf\u30fc\u30b2\u30c3\u30c8",body:"\u30dc\u30c7\u30a3",document:"\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8",window:"\u30a6\u30a3\u30f3\u30c9\u30a6",detail:"\u8a73\u7d30"},possessive:{marker:"\u306e",markerPosition:"between",keywords:{"\u79c1\u306e":"me","\u3042\u306a\u305f\u306e":"you","\u305d\u306e":"it"}},roleMarkers:{patient:{primary:"\u3092",position:"after"},destination:{primary:"\u306b",alternatives:["\u3078","\u3067","\u306e"],position:"after"},source:{primary:"\u304b\u3089",position:"after"},style:{primary:"\u3067",position:"after"},event:{primary:"\u3092",position:"after"}},keywords:{toggle:{primary:"\u5207\u308a\u66ff\u3048",alternatives:["\u5207\u308a\u66ff\u3048\u308b","\u30c8\u30b0\u30eb","\u30c8\u30b0\u30eb\u3059\u308b"],normalized:"toggle"},add:{primary:"\u8ffd\u52a0",alternatives:["\u8ffd\u52a0\u3059\u308b","\u52a0\u3048\u308b"],normalized:"add"},remove:{primary:"\u524a\u9664",alternatives:["\u524a\u9664\u3059\u308b","\u53d6\u308a\u9664\u304f"],normalized:"remove"},put:{primary:"\u7f6e\u304f",alternatives:["\u5165\u308c\u308b"],normalized:"put"},append:{primary:"\u672b\u5c3e\u8ffd\u52a0",alternatives:["\u672b\u5c3e\u306b\u8ffd\u52a0","\u30a2\u30da\u30f3\u30c9"],normalized:"append"},prepend:{primary:"\u5148\u982d\u8ffd\u52a0",alternatives:["\u5148\u982d\u306b\u8ffd\u52a0","\u30d7\u30ea\u30da\u30f3\u30c9"],normalized:"prepend"},take:{primary:"\u53d6\u308b",normalized:"take"},make:{primary:"\u4f5c\u308b",alternatives:["\u4f5c\u6210"],normalized:"make"},clone:{primary:"\u8907\u88fd",alternatives:["\u30af\u30ed\u30fc\u30f3"],normalized:"clone"},swap:{primary:"\u4ea4\u63db",alternatives:["\u30b9\u30ef\u30c3\u30d7","\u5165\u308c\u66ff\u3048"],normalized:"swap"},morph:{primary:"\u5909\u5f62",alternatives:["\u30e2\u30fc\u30d5","\u5909\u63db"],normalized:"morph"},set:{primary:"\u8a2d\u5b9a",alternatives:["\u8a2d\u5b9a\u3059\u308b"],normalized:"set"},get:{primary:"\u53d6\u5f97",alternatives:["\u53d6\u5f97\u3059\u308b","\u30b2\u30c3\u30c8"],normalized:"get"},increment:{primary:"\u5897\u52a0",alternatives:["\u5897\u3084\u3059","\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8"],normalized:"increment"},decrement:{primary:"\u6e1b\u5c11",alternatives:["\u6e1b\u3089\u3059","\u30c7\u30af\u30ea\u30e1\u30f3\u30c8"],normalized:"decrement"},log:{primary:"\u8a18\u9332",alternatives:["\u30ed\u30b0","\u51fa\u529b"],normalized:"log"},show:{primary:"\u8868\u793a",alternatives:["\u8868\u793a\u3059\u308b","\u898b\u305b\u308b"],normalized:"show"},hide:{primary:"\u96a0\u3059",alternatives:["\u975e\u8868\u793a","\u975e\u8868\u793a\u306b\u3059\u308b"],normalized:"hide"},transition:{primary:"\u9077\u79fb",alternatives:["\u30c8\u30e9\u30f3\u30b8\u30b7\u30e7\u30f3","\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3"],normalized:"transition"},on:{primary:"\u3067",alternatives:["\u6642"],normalized:"on"},trigger:{primary:"\u5f15\u304d\u91d1",alternatives:["\u767a\u706b","\u30c8\u30ea\u30ac\u30fc"],normalized:"trigger"},send:{primary:"\u9001\u308b",alternatives:["\u9001\u4fe1"],normalized:"send"},focus:{primary:"\u30d5\u30a9\u30fc\u30ab\u30b9",normalized:"focus"},blur:{primary:"\u30d5\u30a9\u30fc\u30ab\u30b9\u89e3\u9664",alternatives:["\u30d5\u30a9\u30fc\u30ab\u30b9\u30a2\u30a6\u30c8","\u30d6\u30e9\u30fc","\u307c\u304b\u3057"],normalized:"blur"},empty:{primary:"\u7a7a\u306b",alternatives:["\u7a7a\u306b\u3059\u308b"],normalized:"empty"},open:{primary:"\u958b\u304f",alternatives:["\u30aa\u30fc\u30d7\u30f3"],normalized:"open"},close:{primary:"\u9589\u3058\u308b",alternatives:["\u30af\u30ed\u30fc\u30ba"],normalized:"close"},select:{primary:"\u9078\u3076",alternatives:["\u30bb\u30ec\u30af\u30c8"],normalized:"select"},clear:{primary:"\u30af\u30ea\u30a2",alternatives:["\u6d88\u53bb"],normalized:"clear"},reset:{primary:"\u30ea\u30bb\u30c3\u30c8",alternatives:["\u518d\u8a2d\u5b9a"],normalized:"reset"},breakpoint:{primary:"\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8",normalized:"breakpoint"},go:{primary:"\u79fb\u52d5",alternatives:["\u884c\u304f","\u30ca\u30d3\u30b2\u30fc\u30c8"],normalized:"go"},scroll:{primary:"\u30b9\u30af\u30ed\u30fc\u30eb",normalized:"scroll"},push:{primary:"\u30d7\u30c3\u30b7\u30e5",normalized:"push"},replace:{primary:"\u7f6e\u63db",alternatives:["\u7f6e\u304d\u63db\u3048"],normalized:"replace"},process:{primary:"\u51e6\u7406",normalized:"process"},wait:{primary:"\u5f85\u3064",alternatives:["\u5f85\u6a5f"],normalized:"wait"},fetch:{primary:"\u30d5\u30a7\u30c3\u30c1",normalized:"fetch"},settle:{primary:"\u5b89\u5b9a",alternatives:["\u843d\u3061\u7740\u304f"],normalized:"settle"},if:{primary:"\u3082\u3057",normalized:"if"},when:{primary:"\u3068\u304d",alternatives:["\u3068\u304d\u306b"],normalized:"when"},where:{primary:"\u3069\u3053",normalized:"where"},else:{primary:"\u305d\u3046\u3067\u306a\u3051\u308c\u3070",alternatives:["\u305d\u308c\u4ee5\u5916"],normalized:"else"},unless:{primary:"\u306a\u3044\u9650\u308a",normalized:"unless"},repeat:{primary:"\u7e70\u308a\u8fd4\u3057",alternatives:["\u7e70\u308a\u8fd4\u3059","\u30ea\u30d4\u30fc\u30c8"],normalized:"repeat"},for:{primary:"\u305f\u3081\u306b",alternatives:["\u5404"],normalized:"for"},while:{primary:"\u306e\u9593",alternatives:["\u9593"],normalized:"while"},forever:{primary:"forever",normalized:"forever"},continue:{primary:"\u7d9a\u3051\u308b",alternatives:["\u7d99\u7d9a"],normalized:"continue"},halt:{primary:"\u505c\u6b62",alternatives:["\u6b62\u3081\u308b","\u30cf\u30eb\u30c8"],normalized:"halt"},throw:{primary:"\u6295\u3052\u308b",alternatives:["\u30b9\u30ed\u30fc"],normalized:"throw"},call:{primary:"\u547c\u3073\u51fa\u3057",alternatives:["\u30b3\u30fc\u30eb","\u547c\u3076"],normalized:"call"},return:{primary:"\u623b\u308b",alternatives:["\u8fd4\u3059","\u30ea\u30bf\u30fc\u30f3"],normalized:"return"},then:{primary:"\u305d\u308c\u304b\u3089",alternatives:["\u6b21\u306b","\u306a\u3089\u3070","\u306a\u3089"],normalized:"then"},and:{primary:"\u307e\u305f",alternatives:["\u3068","\u305d\u3057\u3066"],normalized:"and"},matches:{primary:"\u4e00\u81f4\u3059\u308b",normalized:"matches"},exists:{primary:"\u5b58\u5728\u3059\u308b",normalized:"exists"},is:{primary:"\u3067\u3042\u308b",normalized:"is"},no:{primary:"\u306a\u3044",normalized:"no"},end:{primary:"\u7d42\u308f\u308a",alternatives:["\u304a\u308f\u308a"],normalized:"end"},js:{primary:"JS\u5b9f\u884c",alternatives:["js"],normalized:"js"},async:{primary:"\u975e\u540c\u671f",alternatives:["\u30a2\u30b7\u30f3\u30af"],normalized:"async"},tell:{primary:"\u4f1d\u3048\u308b",alternatives:["\u30c6\u30eb"],normalized:"tell"},default:{primary:"\u65e2\u5b9a",alternatives:["\u30c7\u30d5\u30a9\u30eb\u30c8"],normalized:"default"},init:{primary:"\u521d\u671f\u5316",normalized:"init"},behavior:{primary:"\u632f\u308b\u821e\u3044",alternatives:["\u30d3\u30d8\u30a4\u30d3\u30a2"],normalized:"behavior"},install:{primary:"\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb",alternatives:["\u5c0e\u5165"],normalized:"install"},measure:{primary:"\u6e2c\u5b9a",alternatives:["\u8a08\u6e2c","\u30e1\u30b8\u30e3\u30fc"],normalized:"measure"},beep:{primary:"\u30d3\u30fc\u30d7",normalized:"beep"},break:{primary:"\u4e2d\u65ad",normalized:"break"},copy:{primary:"\u30b3\u30d4\u30fc",normalized:"copy"},exit:{primary:"\u9000\u51fa",normalized:"exit"},pick:{primary:"\u9078\u629e",normalized:"pick"},render:{primary:"\u63cf\u753b",normalized:"render"},into:{primary:"\u3078",alternatives:["\u306b"],normalized:"into"},before:{primary:"\u524d\u306b",alternatives:["\u524d"],normalized:"before"},after:{primary:"\u5f8c\u306b",alternatives:["\u5f8c"],normalized:"after"},until:{primary:"\u307e\u3067",alternatives:["\u8fc4"],normalized:"until"},event:{primary:"\u30a4\u30d9\u30f3\u30c8",alternatives:["\u4e8b\u8c61"],normalized:"event"},from:{primary:"\u304b\u3089",normalized:"from"},connect:{primary:"\u63a5\u7d9a",alternatives:["\u63a5\u7d9a\u3059\u308b"],normalized:"connect"},stream:{primary:"\u30b9\u30c8\u30ea\u30fc\u30e0",alternatives:["\u914d\u4fe1"],normalized:"stream"},live:{primary:"\u30e9\u30a4\u30d6",alternatives:["\u5b9f\u6642\u9593"],normalized:"live"},socket:{primary:"\u30bd\u30b1\u30c3\u30c8",alternatives:["websocket"],normalized:"socket"},bind:{primary:"\u30d0\u30a4\u30f3\u30c9",alternatives:["\u7d50\u3073\u3064\u3051\u308b","bind"],normalized:"bind"},intercept:{primary:"\u30a4\u30f3\u30bf\u30fc\u30bb\u30d7\u30c8",alternatives:["\u508d\u53d7","intercept"],normalized:"intercept"},worker:{primary:"\u30ef\u30fc\u30ab\u30fc",alternatives:["worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["\u30a4\u30d9\u30f3\u30c8\u30bd\u30fc\u30b9"],normalized:"eventsource"}},tokenization:{particles:["\u3092","\u306b","\u3067","\u304b\u3089","\u306e","\u304c","\u306f","\u3082","\u3078","\u3068"],boundaryStrategy:"particle"},eventHandler:{eventMarker:{primary:"\u3067",position:"after"},temporalMarkers:["\u6642","\u3068\u304d"]}}}}),fh={};Ad(fh,{koreanProfile:()=>dh});var hh,yh=Cd({"src/generators/profiles/korean.ts"(){dh={code:"ko",name:"Korean",nativeName:"\ud55c\uad6d\uc5b4",regions:["east-asian","priority"],direction:"ltr",script:"hangul",wordOrder:"SOV",markingStrategy:"particle",usesSpaces:!0,verb:{position:"end",suffixes:["\ub2e4","\uc694","\ub2c8\ub2e4","\uc138\uc694"],subjectDrop:!0},references:{me:"\ub098",it:"\uadf8\uac83",you:"\ub108",result:"\uacb0\uacfc",event:"\uc774\ubca4\ud2b8",target:"\ub300\uc0c1",body:"\ubc14\ub514",document:"\ubb38\uc11c",window:"\ucc3d",detail:"\uc138\ubd80"},possessive:{marker:"\uc758",markerPosition:"between",specialForms:{me:"\ub0b4",it:"\uadf8\uac83\uc758",you:"\ub124"},keywords:{"\ub0b4":"me","\ub124":"you","\uadf8\uc758":"it"}},roleMarkers:{patient:{primary:"\uc744",alternatives:["\ub97c"],position:"after"},destination:{primary:"\uc5d0",alternatives:["\uc73c\ub85c","\ub85c","\uc758"],position:"after"},source:{primary:"\uc5d0\uc11c",alternatives:["\ubd80\ud130"],position:"after"},style:{primary:"\ub85c",alternatives:["\uc73c\ub85c"],position:"after"},event:{primary:"\uc744",alternatives:["\ub97c"],position:"after"}},keywords:{toggle:{primary:"\ud1a0\uae00",normalized:"toggle"},add:{primary:"\ucd94\uac00",normalized:"add"},remove:{primary:"\uc81c\uac70",alternatives:["\uc0ad\uc81c"],normalized:"remove"},put:{primary:"\ub123\ub2e4",alternatives:["\ub123\uae30","\ub193\uae30","\ub123\uc73c\uc138\uc694"],normalized:"put"},append:{primary:"\ub367\ubd99\uc774\ub2e4",alternatives:["\ub05d\uc5d0\ucd94\uac00"],normalized:"append"},prepend:{primary:"\uc55e\uc5d0\ucd94\uac00",alternatives:["\uc120\ub450\ucd94\uac00"],normalized:"prepend"},take:{primary:"\uac00\uc838\uc624\ub2e4",alternatives:["\uac00\uc838\uc624\uc138\uc694"],normalized:"take"},make:{primary:"\ub9cc\ub4e4\ub2e4",normalized:"make"},clone:{primary:"\ubcf5\uc81c",normalized:"clone"},swap:{primary:"\uad50\ud658",alternatives:["\ubc14\uafb8\ub2e4"],normalized:"swap"},morph:{primary:"\ubcc0\ud615",alternatives:["\ubcc0\ud658"],normalized:"morph"},set:{primary:"\uc124\uc815",normalized:"set"},get:{primary:"\uc5bb\ub2e4",alternatives:["\uc5bb\uc73c\uc138\uc694"],normalized:"get"},increment:{primary:"\uc99d\uac00",normalized:"increment"},decrement:{primary:"\uac10\uc18c",normalized:"decrement"},log:{primary:"\ub85c\uadf8",normalized:"log"},show:{primary:"\ubcf4\uc774\ub2e4",alternatives:["\ud45c\uc2dc","\ubcf4\uc774\uae30","\ubcf4\uc774\uc138\uc694"],normalized:"show"},hide:{primary:"\uc228\uae30\ub2e4",alternatives:["\uc228\uae30\uae30","\uc228\uae30\uc138\uc694"],normalized:"hide"},transition:{primary:"\ud2b8\ub79c\uc9c0\uc158",alternatives:["\uc804\ud658"],normalized:"transition"},on:{primary:"\uc5d0",alternatives:["\uc2dc","\ud560 \ub54c"],normalized:"on"},trigger:{primary:"\ud2b8\ub9ac\uac70",normalized:"trigger"},send:{primary:"\ubcf4\ub0b4\ub2e4",alternatives:["\ubcf4\ub0b4\uc138\uc694"],normalized:"send"},focus:{primary:"\ud3ec\ucee4\uc2a4",normalized:"focus"},blur:{primary:"\ud3ec\ucee4\uc2a4\uc544\uc6c3",alternatives:["\ube14\ub7ec"],normalized:"blur"},empty:{primary:"\ube44\uc6b0\uae30",alternatives:["\ube44\uc5b4\uc788\ub294"],normalized:"empty"},open:{primary:"\uc5f4\uae30",normalized:"open"},close:{primary:"\ub2eb\uae30",normalized:"close"},select:{primary:"\uace0\ub974\uae30",normalized:"select"},clear:{primary:"\uc9c0\uc6b0\uae30",normalized:"clear"},reset:{primary:"\uc7ac\uc124\uc815",normalized:"reset"},breakpoint:{primary:"\uc911\ub2e8\uc810",normalized:"breakpoint"},click:{primary:"\ud074\ub9ad",normalized:"click"},hover:{primary:"\ud638\ubc84",normalized:"hover"},submit:{primary:"\uc81c\ucd9c",normalized:"submit"},input:{primary:"\uc785\ub825",normalized:"input"},change:{primary:"\ubcc0\uacbd",normalized:"change"},go:{primary:"\uc774\ub3d9",normalized:"go"},scroll:{primary:"\uc2a4\ud06c\ub864",normalized:"scroll"},push:{primary:"\ud478\uc2dc",normalized:"push"},replace:{primary:"\uad50\uccb4",alternatives:["\ubc14\uafb8\uae30"],normalized:"replace"},process:{primary:"\ucc98\ub9ac",normalized:"process"},wait:{primary:"\ub300\uae30",normalized:"wait"},fetch:{primary:"\ud328\uce58",alternatives:["\uac00\uc838\uc624\uae30"],normalized:"fetch"},settle:{primary:"\uc548\uc815",normalized:"settle"},if:{primary:"\ub9cc\uc57d",normalized:"if"},when:{primary:"\ub54c",normalized:"when"},where:{primary:"\uc5b4\ub514",normalized:"where"},else:{primary:"\uc544\ub2c8\uba74",normalized:"else"},unless:{primary:"\uc544\ub2c8\ub77c\uba74",normalized:"unless"},repeat:{primary:"\ubc18\ubcf5",normalized:"repeat"},for:{primary:"\uac01\uac01",normalized:"for"},while:{primary:"\ub3d9\uc548",normalized:"while"},forever:{primary:"forever",normalized:"forever"},continue:{primary:"\uacc4\uc18d",normalized:"continue"},halt:{primary:"\uc815\uc9c0",normalized:"halt"},throw:{primary:"\ub358\uc9c0\ub2e4",normalized:"throw"},call:{primary:"\ud638\ucd9c",normalized:"call"},return:{primary:"\ubc18\ud658",normalized:"return"},then:{primary:"\uadf8\ub2e4\uc74c",alternatives:["\uadf8\ub7f0\ud6c4"],normalized:"then"},and:{primary:"\uadf8\ub9ac\uace0",alternatives:["\ub610\ud55c","\ubc0f"],normalized:"and"},matches:{primary:"\uc77c\uce58",normalized:"matches"},exists:{primary:"\uc874\uc7ac",normalized:"exists"},no:{primary:"\uc5c6\uc74c",normalized:"no"},end:{primary:"\ub05d",alternatives:["\ub9c8\uce68"],normalized:"end"},js:{primary:"JS\uc2e4\ud589",alternatives:["js"],normalized:"js"},async:{primary:"\ube44\ub3d9\uae30",normalized:"async"},tell:{primary:"\ub9d0\ud558\ub2e4",normalized:"tell"},default:{primary:"\uae30\ubcf8\uac12",normalized:"default"},init:{primary:"\ucd08\uae30\ud654",normalized:"init"},behavior:{primary:"\ub3d9\uc791",normalized:"behavior"},install:{primary:"\uc124\uce58",normalized:"install"},measure:{primary:"\uce21\uc815",normalized:"measure"},beep:{primary:"\ube44\ud504",normalized:"beep"},break:{primary:"\uc911\ub2e8",normalized:"break"},copy:{primary:"\ubcf5\uc0ac",normalized:"copy"},exit:{primary:"\ub098\uac00\uae30",normalized:"exit"},pick:{primary:"\uc120\ud0dd",normalized:"pick"},render:{primary:"\ub80c\ub354\ub9c1",normalized:"render"},into:{primary:"\uc73c\ub85c",normalized:"into"},before:{primary:"\uc804\uc5d0",normalized:"before"},after:{primary:"\ud6c4\uc5d0",normalized:"after"},until:{primary:"\uae4c\uc9c0",normalized:"until"},event:{primary:"\uc774\ubca4\ud2b8",normalized:"event"},from:{primary:"\uc5d0\uc11c",normalized:"from"},connect:{primary:"\uc5f0\uacb0",alternatives:["\uc811\uc18d"],normalized:"connect"},stream:{primary:"\uc2a4\ud2b8\ub9bc",alternatives:["\uc2a4\ud2b8\ub9ac\ubc0d"],normalized:"stream"},live:{primary:"\uc2e4\uc2dc\uac04",alternatives:["\ub77c\uc774\ube0c"],normalized:"live"},socket:{primary:"\uc18c\ucf13",alternatives:["websocket"],normalized:"socket"},bind:{primary:"\ubc14\uc778\ub4dc",alternatives:["bind"],normalized:"bind"},intercept:{primary:"\uac00\ub85c\ucc44\uae30",alternatives:["\uc778\ud130\uc149\ud2b8","intercept"],normalized:"intercept"},worker:{primary:"\uc6cc\ucee4",alternatives:["worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["\uc774\ubca4\ud2b8\uc18c\uc2a4"],normalized:"eventsource"}},tokenization:{particles:["\uc744","\ub97c","\uc774","\uac00","\uc740","\ub294","\uc5d0","\uc5d0\uc11c","\uc73c\ub85c","\ub85c","\uc640","\uacfc","\ub3c4"],boundaryStrategy:"space"},eventHandler:{eventMarker:{primary:"\ud560 \ub54c",alternatives:["\ud560\ub54c","\ub54c","\uc5d0"],position:"after"},temporalMarkers:["\ud560 \ub54c","\ud560\ub54c","\ub54c"]}}}}),vh={};Ad(vh,{malayProfile:()=>hh});var gh,kh=Cd({"src/generators/profiles/ms.ts"(){hh={code:"ms",name:"Malay",nativeName:"Melayu",direction:"ltr",script:"latin",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:!0,defaultVerbForm:"base",verb:{position:"start",subjectDrop:!0},references:{me:"saya",it:"ia",you:"kamu",result:"hasil",event:"peristiwa",target:"sasaran",body:"badan",document:"dokumen",window:"tetingkap",detail:"perincian"},possessive:{marker:"",markerPosition:"after-object",keywords:{saya:"me",saya_punya:"me",aku:"me",awak:"you",kamu:"you",anda:"you",dia:"it",ia:"it",nya:"it","-ku":"me","-mu":"you","-nya":"it"}},roleMarkers:{destination:{primary:"ke",alternatives:["pada"],position:"before"},source:{primary:"dari",position:"before"},patient:{primary:"",position:"before"},style:{primary:"dengan",position:"before"}},keywords:{toggle:{primary:"togol",alternatives:["tukar"],normalized:"toggle"},add:{primary:"tambah",normalized:"add"},remove:{primary:"buang",alternatives:["padam"],normalized:"remove"},put:{primary:"letak",alternatives:["letakkan"],normalized:"put"},append:{primary:"tambah_hujung",normalized:"append"},prepend:{primary:"tambah_mula",normalized:"prepend"},take:{primary:"ambil",normalized:"take"},make:{primary:"buat",alternatives:["cipta"],normalized:"make"},clone:{primary:"klon",alternatives:[],normalized:"clone"},swap:{primary:"tukar_tempat",normalized:"swap"},morph:{primary:"ubah_bentuk",normalized:"morph"},set:{primary:"tetapkan",alternatives:["setkan"],normalized:"set"},get:{primary:"dapatkan",alternatives:[],normalized:"get"},increment:{primary:"tambah_satu",normalized:"increment"},decrement:{primary:"kurang_satu",normalized:"decrement"},log:{primary:"catat",alternatives:["log"],normalized:"log"},show:{primary:"tunjuk",alternatives:[],normalized:"show"},hide:{primary:"sembunyi",alternatives:["sorok"],normalized:"hide"},transition:{primary:"peralihan",normalized:"transition"},on:{primary:"apabila",alternatives:["ketika"],normalized:"on"},trigger:{primary:"cetuskan",normalized:"trigger"},send:{primary:"hantar",normalized:"send"},focus:{primary:"fokus",normalized:"focus"},blur:{primary:"kabur",normalized:"blur"},empty:{primary:"kosongkan",alternatives:["kosong"],normalized:"empty"},open:{primary:"buka",normalized:"open"},close:{primary:"tutup",normalized:"close"},select:{primary:"tandai",normalized:"select"},clear:{primary:"bersihkan",normalized:"clear"},reset:{primary:"set-semula",alternatives:["reset"],normalized:"reset"},breakpoint:{primary:"titik-henti",normalized:"breakpoint"},go:{primary:"pergi",alternatives:["pindah"],normalized:"go"},scroll:{primary:"tatal",alternatives:["skrol","scroll"],normalized:"scroll"},push:{primary:"tolak",alternatives:["push"],normalized:"push"},replace:{primary:"ganti_url",alternatives:["gantikan_url"],normalized:"replace"},process:{primary:"proses",normalized:"process"},wait:{primary:"tunggu",normalized:"wait"},fetch:{primary:"ambil_dari",alternatives:["muat"],normalized:"fetch"},settle:{primary:"selesai",normalized:"settle"},if:{primary:"jika",alternatives:["kalau"],normalized:"if"},unless:{primary:"kecuali",normalized:"unless"},when:{primary:"bila",normalized:"when"},where:{primary:"di_mana",normalized:"where"},else:{primary:"kalau_tidak",alternatives:["jika_tidak"],normalized:"else"},repeat:{primary:"ulang",normalized:"repeat"},for:{primary:"untuk",normalized:"for"},while:{primary:"selagi",alternatives:["semasa"],normalized:"while"},forever:{primary:"selamanya",normalized:"forever",alternatives:["forever"]},continue:{primary:"teruskan",normalized:"continue"},halt:{primary:"henti",alternatives:["berhenti"],normalized:"halt"},throw:{primary:"lempar",normalized:"throw"},call:{primary:"panggil",normalized:"call"},return:{primary:"pulang",alternatives:["kembali"],normalized:"return"},then:{primary:"kemudian",alternatives:["lepas_itu"],normalized:"then"},and:{primary:"dan",normalized:"and"},matches:{primary:"sepadan",normalized:"matches"},exists:{primary:"wujud",normalized:"exists"},is:{primary:"adalah",normalized:"is"},no:{primary:"tiada",normalized:"no"},end:{primary:"tamat",alternatives:["habis"],normalized:"end"},js:{primary:"js",normalized:"js"},async:{primary:"tak_segerak",normalized:"async"},tell:{primary:"beritahu",normalized:"tell"},default:{primary:"lalai",normalized:"default"},init:{primary:"mula",alternatives:["mulakan"],normalized:"init"},behavior:{primary:"kelakuan",normalized:"behavior"},install:{primary:"pasang",normalized:"install"},measure:{primary:"ukur",normalized:"measure"},beep:{primary:"bunyi",normalized:"beep"},break:{primary:"pecah",normalized:"break"},copy:{primary:"salin",normalized:"copy"},exit:{primary:"keluar",normalized:"exit"},pick:{primary:"pilih",normalized:"pick"},render:{primary:"papar",normalized:"render"},into:{primary:"ke_dalam",normalized:"into"},before:{primary:"sebelum",normalized:"before"},after:{primary:"selepas",alternatives:["lepas"],normalized:"after"},until:{primary:"sehingga",alternatives:["sampai"],normalized:"until"},event:{primary:"peristiwa",normalized:"event"},from:{primary:"dari",normalized:"from"},connect:{primary:"sambung",alternatives:["hubungkan"],normalized:"connect"},stream:{primary:"strim",alternatives:["penstriman","aliran"],normalized:"stream"},live:{primary:"langsung",alternatives:["siaran-langsung"],normalized:"live"},socket:{primary:"soket",alternatives:["websocket"],normalized:"socket"},bind:{primary:"ikat",alternatives:["kaitkan","bind"],normalized:"bind"},intercept:{primary:"pintas",alternatives:["cegat","intercept"],normalized:"intercept"},worker:{primary:"pekerja",alternatives:["worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["sumber_peristiwa"],normalized:"eventsource"}},eventHandler:{keyword:{primary:"apabila",alternatives:["ketika"],normalized:"on"},sourceMarker:{primary:"dari",position:"before"},eventMarker:{primary:"apabila",alternatives:["ketika"],position:"before"}}}}}),wh={};Ad(wh,{polishProfile:()=>gh});var bh,zh=Cd({"src/generators/profiles/polish.ts"(){gh={code:"pl",name:"Polish",nativeName:"Polski",direction:"ltr",script:"latin",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:!0,defaultVerbForm:"imperative",verb:{position:"start",subjectDrop:!0,suffixes:["a\u0107","e\u0107","i\u0107","y\u0107","\u0105\u0107","owa\u0107"]},references:{me:"ja",it:"to",you:"ty",result:"wynik",event:"zdarzenie",target:"cel",body:"body",document:"dokument",window:"okno",detail:"szczeg\u00f3\u0142"},possessive:{marker:"",markerPosition:"after-object",usePossessiveAdjectives:!0,specialForms:{me:"m\u00f3j",it:"jego",you:"tw\u00f3j"},keywords:{"m\u00f3j":"me",moja:"me",moje:"me","tw\u00f3j":"you",twoja:"you",twoje:"you",jego:"it",jej:"it"}},roleMarkers:{destination:{primary:"do",alternatives:["w","na"],position:"before"},source:{primary:"z",alternatives:["od","ze"],position:"before"},patient:{primary:"",position:"before"},style:{primary:"z",alternatives:["ze"],position:"before"}},keywords:{toggle:{primary:"prze\u0142\u0105cz",alternatives:["przelacz"],normalized:"toggle",form:"imperative"},add:{primary:"dodaj",normalized:"add",form:"imperative"},remove:{primary:"usu\u0144",alternatives:["usun","wyczy\u015b\u0107","wyczysc"],normalized:"remove",form:"imperative"},put:{primary:"umie\u015b\u0107",alternatives:["umiesc","wstaw"],normalized:"put",form:"imperative"},append:{primary:"do\u0142\u0105cz",alternatives:["dolacz"],normalized:"append",form:"imperative"},prepend:{primary:"poprzed\u017a",alternatives:["poprzedz"],normalized:"prepend",form:"imperative"},take:{primary:"we\u017a",alternatives:["wez"],normalized:"take",form:"imperative"},make:{primary:"utw\u00f3rz",alternatives:["utworz","stw\u00f3rz","stworz"],normalized:"make",form:"imperative"},clone:{primary:"sklonuj",normalized:"clone",form:"imperative"},swap:{primary:"zamie\u0144",alternatives:["zamien"],normalized:"swap",form:"imperative"},morph:{primary:"przekszta\u0142\u0107",alternatives:["przeksztalc"],normalized:"morph",form:"imperative"},set:{primary:"ustaw",alternatives:["okre\u015bl","okresl"],normalized:"set",form:"imperative"},get:{primary:"uzyskaj",normalized:"get",form:"imperative"},increment:{primary:"zwi\u0119ksz",alternatives:["zwieksz"],normalized:"increment",form:"imperative"},decrement:{primary:"zmniejsz",normalized:"decrement",form:"imperative"},log:{primary:"loguj",alternatives:["wypisz"],normalized:"log",form:"imperative"},show:{primary:"poka\u017c",alternatives:["pokaz","wy\u015bwietl","wyswietl"],normalized:"show",form:"imperative"},hide:{primary:"ukryj",alternatives:["schowaj"],normalized:"hide",form:"imperative"},transition:{primary:"animuj",alternatives:["przej\u015bcie","przejscie"],normalized:"transition",form:"imperative"},on:{primary:"gdy",alternatives:["przy","na"],normalized:"on"},trigger:{primary:"wyzw\u00f3l",alternatives:["wyzwol"],normalized:"trigger",form:"imperative"},send:{primary:"wy\u015blij",alternatives:["wyslij"],normalized:"send",form:"imperative"},focus:{primary:"skup",alternatives:["skupienie"],normalized:"focus",form:"imperative"},blur:{primary:"rozmyj",alternatives:["odskup"],normalized:"blur",form:"imperative"},empty:{primary:"opr\u00f3\u017cnij",alternatives:["oproznij","pusty"],normalized:"empty"},open:{primary:"otw\u00f3rz",alternatives:["otworz"],normalized:"open"},close:{primary:"zamknij",normalized:"close"},select:{primary:"zaznacz",normalized:"select"},clear:{primary:"zeruj",normalized:"clear"},reset:{primary:"zresetuj",normalized:"reset"},breakpoint:{primary:"punkt-przerwania",normalized:"breakpoint"},go:{primary:"id\u017a",alternatives:["idz","przejd\u017a","przejdz","nawiguj"],normalized:"go",form:"imperative"},scroll:{primary:"przewi\u0144",alternatives:["przewin"],normalized:"scroll",form:"imperative"},push:{primary:"wepchnij",alternatives:["push"],normalized:"push",form:"imperative"},replace:{primary:"nadpisz",alternatives:["zamie\u0144_url","zamien_url"],normalized:"replace",form:"imperative"},process:{primary:"przetw\u00f3rz",alternatives:["przetworz"],normalized:"process",form:"imperative"},wait:{primary:"czekaj",alternatives:["poczekaj"],normalized:"wait",form:"imperative"},fetch:{primary:"pobierz",alternatives:["za\u0142aduj","zaladuj"],normalized:"fetch",form:"imperative"},settle:{primary:"ustabilizuj",normalized:"settle",form:"imperative"},if:{primary:"je\u015bli",alternatives:["jesli","je\u017celi","jezeli"],normalized:"if"},unless:{primary:"chyba",normalized:"unless"},when:{primary:"kiedy",normalized:"when"},where:{primary:"gdzie",normalized:"where"},else:{primary:"inaczej",alternatives:["wpp"],normalized:"else"},repeat:{primary:"powt\u00f3rz",alternatives:["powtorz"],normalized:"repeat",form:"imperative"},for:{primary:"dla",alternatives:["ka\u017cdy","kazdy"],normalized:"for"},while:{primary:"dop\u00f3ki",alternatives:["dopoki","podczas"],normalized:"while"},forever:{primary:"forever",normalized:"forever"},continue:{primary:"kontynuuj",alternatives:["dalej"],normalized:"continue",form:"imperative"},halt:{primary:"zatrzymaj",alternatives:["stop"],normalized:"halt",form:"imperative"},throw:{primary:"rzu\u0107",alternatives:["rzuc"],normalized:"throw",form:"imperative"},call:{primary:"wywo\u0142aj",alternatives:["wywolaj"],normalized:"call",form:"imperative"},return:{primary:"zwr\u00f3\u0107",alternatives:["zwroc"],normalized:"return",form:"imperative"},then:{primary:"wtedy",alternatives:["potem","nast\u0119pnie","nastepnie"],normalized:"then"},and:{primary:"i",alternatives:["oraz"],normalized:"and"},matches:{primary:"pasuje",normalized:"matches"},no:{primary:"brak",normalized:"no"},end:{primary:"koniec",normalized:"end"},js:{primary:"js",normalized:"js"},async:{primary:"async",alternatives:["asynchronicznie"],normalized:"async"},tell:{primary:"powiedz",normalized:"tell",form:"imperative"},default:{primary:"domy\u015blnie",alternatives:["domyslnie"],normalized:"default"},init:{primary:"inicjuj",normalized:"init",form:"imperative"},behavior:{primary:"zachowanie",normalized:"behavior"},install:{primary:"zainstaluj",normalized:"install",form:"imperative"},measure:{primary:"zmierz",normalized:"measure",form:"imperative"},beep:{primary:"sygna\u0142",normalized:"beep"},break:{primary:"przerwij",normalized:"break"},copy:{primary:"kopiuj",normalized:"copy"},exit:{primary:"wyjd\u017a",normalized:"exit"},pick:{primary:"wybierz",normalized:"pick"},render:{primary:"renderuj",normalized:"render"},into:{primary:"do",alternatives:["w"],normalized:"into"},before:{primary:"przed",normalized:"before"},after:{primary:"po",normalized:"after"},click:{primary:"klikni\u0119ciu",alternatives:["klikniecie","klik"],normalized:"click"},resize:{primary:"zmiana rozmiaru",alternatives:["zmie\u0144 rozmiar","zmie\u0144rozmiar"],normalized:"resize"},hover:{primary:"najechaniu",alternatives:["hover"],normalized:"hover"},submit:{primary:"wys\u0142aniu",alternatives:["wyslaniu","submit"],normalized:"submit"},input:{primary:"wprowadzeniu",alternatives:["input","wej\u015bcie"],normalized:"input"},change:{primary:"zmianie",alternatives:["zmiana"],normalized:"change"},until:{primary:"a\u017c",alternatives:["az"],normalized:"until"},event:{primary:"zdarzenie",normalized:"event"},from:{primary:"z",alternatives:["od","ze"],normalized:"from"},connect:{primary:"po\u0142\u0105cz",alternatives:["pod\u0142\u0105cz"],normalized:"connect"},stream:{primary:"transmituj",alternatives:["strumie\u0144","streamuj"],normalized:"stream"},live:{primary:"na-\u017cywo",alternatives:["na-bie\u017c\u0105co","live","\u017cywy"],normalized:"live"},socket:{primary:"gniazdo",alternatives:["socket","websocket"],normalized:"socket"},bind:{primary:"powi\u0105\u017c",alternatives:["zwi\u0105za\u0107","bind"],normalized:"bind"},intercept:{primary:"przechwy\u0107",alternatives:["przechwytuj","intercept"],normalized:"intercept"},worker:{primary:"pracownik",alternatives:["worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["\u017ar\u00f3d\u0142o-zdarze\u0144"],normalized:"eventsource"}},eventHandler:{keyword:{primary:"gdy",alternatives:["przy","na"],normalized:"on"},sourceMarker:{primary:"na",alternatives:["w","przy"],position:"before"},conditionalKeyword:{primary:"kiedy",alternatives:["gdy","je\u015bli"]},eventMarker:{primary:"przy",alternatives:["na","gdy"],position:"before"},temporalMarkers:["kiedy","gdy","przy"]}}}}),xh={};Ad(xh,{portugueseProfile:()=>bh});var Eh,Th=Cd({"src/generators/profiles/portuguese.ts"(){bh={code:"pt",name:"Portuguese",nativeName:"Portugu\u00eas",regions:["western","priority"],direction:"ltr",script:"latin",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:!0,verb:{position:"start",subjectDrop:!0},references:{me:"eu",it:"ele",you:"voc\u00ea",result:"resultado",event:"evento",target:"alvo",body:"corpo",document:"documento",window:"janela",detail:"detalhe"},possessive:{marker:"de",markerPosition:"before-property",usePossessiveAdjectives:!0,specialForms:{me:"meu",it:"seu",you:"teu"},keywords:{meu:"me",minha:"me",teu:"you",tua:"you",seu:"it",sua:"it"}},roleMarkers:{destination:{primary:"em",alternatives:["para","a"],position:"before"},source:{primary:"de",alternatives:["desde"],position:"before"},patient:{primary:"",position:"before"},style:{primary:"com",position:"before"}},keywords:{toggle:{primary:"alternar",alternatives:[],normalized:"toggle"},add:{primary:"adicionar",alternatives:["acrescentar"],normalized:"add"},remove:{primary:"remover",alternatives:["eliminar","apagar","remova"],normalized:"remove"},put:{primary:"colocar",alternatives:["p\u00f4r","por","coloque"],normalized:"put"},append:{primary:"anexar",normalized:"append"},prepend:{primary:"preceder",normalized:"prepend"},take:{primary:"pegar",alternatives:["pegue"],normalized:"take"},make:{primary:"fazer",alternatives:["criar"],normalized:"make"},clone:{primary:"clonar",alternatives:[],normalized:"clone"},swap:{primary:"trocar",alternatives:["substituir"],normalized:"swap"},morph:{primary:"transformar",alternatives:["converter"],normalized:"morph"},set:{primary:"definir",alternatives:["configurar","defina"],normalized:"set"},get:{primary:"obter",alternatives:["obtenha"],normalized:"get"},increment:{primary:"incrementar",alternatives:["aumentar"],normalized:"increment"},decrement:{primary:"decrementar",alternatives:["diminuir"],normalized:"decrement"},log:{primary:"registrar",alternatives:["imprimir"],normalized:"log"},show:{primary:"mostrar",alternatives:["exibir"],normalized:"show"},hide:{primary:"ocultar",alternatives:["esconder","esconda"],normalized:"hide"},transition:{primary:"transi\u00e7\u00e3o",alternatives:["animar"],normalized:"transition"},on:{primary:"em",alternatives:["ao"],normalized:"on"},trigger:{primary:"disparar",alternatives:["ativar"],normalized:"trigger"},send:{primary:"enviar",normalized:"send"},focus:{primary:"foco",alternatives:["focar"],normalized:"focus"},blur:{primary:"perda de foco",alternatives:["desfocar"],normalized:"blur"},empty:{primary:"esvaziar",alternatives:["vazio"],normalized:"empty"},open:{primary:"abrir",normalized:"open"},close:{primary:"fechar",normalized:"close"},select:{primary:"selecionar",normalized:"select"},clear:{primary:"limpar",normalized:"clear"},reset:{primary:"redefinir",alternatives:["resetar"],normalized:"reset"},breakpoint:{primary:"ponto-interrup\u00e7\u00e3o",alternatives:["ponto-interrupcao"],normalized:"breakpoint"},go:{primary:"ir",alternatives:["navegar","v\u00e1"],normalized:"go"},scroll:{primary:"rolagem",alternatives:["rolar","deslocamento","scroll"],normalized:"scroll"},push:{primary:"empurrar",alternatives:["push"],normalized:"push"},replace:{primary:"repor",alternatives:["recolocar"],normalized:"replace"},process:{primary:"processar",normalized:"process"},wait:{primary:"esperar",alternatives:["aguardar"],normalized:"wait"},fetch:{primary:"buscar",alternatives:["busque"],normalized:"fetch"},settle:{primary:"estabilizar",normalized:"settle"},if:{primary:"se",normalized:"if"},unless:{primary:"salvo",alternatives:["a_menos"],normalized:"unless"},when:{primary:"quando",normalized:"when"},where:{primary:"onde",normalized:"where"},else:{primary:"sen\u00e3o",normalized:"else"},repeat:{primary:"repetir",normalized:"repeat"},for:{primary:"para",normalized:"for"},while:{primary:"enquanto",normalized:"while"},forever:{primary:"forever",normalized:"forever"},continue:{primary:"continuar",normalized:"continue"},halt:{primary:"parar",normalized:"halt"},throw:{primary:"lan\u00e7ar",normalized:"throw"},call:{primary:"chamar",normalized:"call"},return:{primary:"retornar",alternatives:["devolver"],normalized:"return"},then:{primary:"ent\u00e3o",alternatives:["logo"],normalized:"then"},and:{primary:"e",alternatives:["tamb\u00e9m","al\u00e9m disso"],normalized:"and"},matches:{primary:"corresponde",normalized:"matches"},exists:{primary:"existe",normalized:"exists"},is:{primary:"\u00e9",normalized:"is"},no:{primary:"nenhum",normalized:"no"},end:{primary:"fim",alternatives:["final","t\u00e9rmino"],normalized:"end"},js:{primary:"js",normalized:"js"},async:{primary:"ass\u00edncrono",normalized:"async"},tell:{primary:"dizer",normalized:"tell"},default:{primary:"padr\u00e3o",normalized:"default"},init:{primary:"inicializa\u00e7\u00e3o",alternatives:["iniciar","inicializar"],normalized:"init"},behavior:{primary:"comportamento",normalized:"behavior"},install:{primary:"instalar",normalized:"install"},measure:{primary:"medir",normalized:"measure"},beep:{primary:"apitar",normalized:"beep"},break:{primary:"interromper",normalized:"break"},copy:{primary:"copiar",normalized:"copy"},exit:{primary:"sair",normalized:"exit"},pick:{primary:"escolher",normalized:"pick"},render:{primary:"renderizar",normalized:"render"},into:{primary:"dentro",alternatives:["dentro de"],normalized:"into"},before:{primary:"antes",normalized:"before"},after:{primary:"depois",normalized:"after"},click:{primary:"clique",alternatives:["clicar"],normalized:"click"},resize:{primary:"redimensionamento",alternatives:["redimensionar"],normalized:"resize"},hover:{primary:"sobrevoar",alternatives:["passar"],normalized:"hover"},submit:{primary:"envio",alternatives:["submeter","submiss\u00e3o"],normalized:"submit"},input:{primary:"entrada",alternatives:["inser\u00e7\u00e3o"],normalized:"input"},change:{primary:"altera\u00e7\u00e3o",alternatives:["mudan\u00e7a"],normalized:"change"},mousedown:{primary:"mouse pressionado",alternatives:["rato pressionado","mouse baixo","mouseBaixo"],normalized:"mousedown"},mouseup:{primary:"mouse solto",alternatives:["mouse liberado","rato libertado","mouse cima","mouseCima"],normalized:"mouseup"},until:{primary:"at\u00e9",normalized:"until"},event:{primary:"evento",normalized:"event"},from:{primary:"de",alternatives:["desde"],normalized:"from"},connect:{primary:"conectar",alternatives:["conex\u00e3o"],normalized:"connect"},stream:{primary:"transmitir",alternatives:["fluxo"],normalized:"stream"},live:{primary:"ao-vivo",alternatives:["vivo","direto"],normalized:"live"},socket:{primary:"soquete",alternatives:["websocket"],normalized:"socket"},bind:{primary:"vincular",alternatives:["ligar","bind"],normalized:"bind"},intercept:{primary:"interceptar",alternatives:["intercept"],normalized:"intercept"},worker:{primary:"trabalhador",alternatives:["worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["fonte-de-eventos"],normalized:"eventsource"}},eventHandler:{keyword:{primary:"em",alternatives:["ao"],normalized:"on"},sourceMarker:{primary:"de",alternatives:["desde"],position:"before"},conditionalKeyword:{primary:"quando",alternatives:["se"]},eventMarker:{primary:"ao",alternatives:["no","em"],position:"before"},temporalMarkers:["quando","ao"]}}}}),Sh={};Ad(Sh,{quechuaProfile:()=>Eh});var Ch,Ah=Cd({"src/generators/profiles/quechua.ts"(){Eh={code:"qu",name:"Quechua",nativeName:"Runasimi",direction:"ltr",script:"latin",wordOrder:"SOV",markingStrategy:"postposition",usesSpaces:!0,verb:{position:"end",subjectDrop:!0},references:{me:"noqa",it:"chay",you:"qam",result:"rurasqa",event:"ruwakuq",target:"punta",body:"kurku",document:"qillqa",window:"k_iri",detail:"sut_iy"},possessive:{marker:"-pa",markerPosition:"after-object",keywords:{"\u00f1uqapa":"me","\u00f1uqaypa":"me",noqaq:"me",qampa:"you",paypa:"it",chay:"it"},connectors:["paq","pa"]},roleMarkers:{patient:{primary:"ta",position:"after"},destination:{primary:"man",alternatives:["pa"],position:"after"},source:{primary:"manta",position:"after"},style:{primary:"wan",position:"after"},event:{primary:"pi",position:"after"}},keywords:{toggle:{primary:"t'ikray",alternatives:["tikray"],normalized:"toggle"},add:{primary:"yapay",alternatives:["yapaykuy"],normalized:"add"},remove:{primary:"qichuy",alternatives:["hurquy","anchuchiy"],normalized:"remove"},put:{primary:"churay",alternatives:["tiyachiy"],normalized:"put"},append:{primary:"qatichiy",alternatives:["qhipaman_yapay"],normalized:"append"},prepend:{primary:"\u00f1awpachiy",normalized:"prepend"},take:{primary:"hapiy",normalized:"take"},make:{primary:"ruray",alternatives:["kamay"],normalized:"make"},clone:{primary:"kikinchay",alternatives:[],normalized:"clone"},swap:{primary:"t'inkuy",alternatives:["rantikunakuy","rantin_tikray"],normalized:"swap"},morph:{primary:"tukunay",alternatives:[],normalized:"morph"},set:{primary:"churanay",alternatives:["kamaykuy"],normalized:"set"},get:{primary:"taripay",normalized:"get"},increment:{primary:"yapachiy",normalized:"increment"},decrement:{primary:"pisiyachiy",normalized:"decrement"},log:{primary:"qillqakuy",alternatives:["willakuy"],normalized:"log"},show:{primary:"rikuchiy",alternatives:["qawachiy"],normalized:"show"},hide:{primary:"pakay",alternatives:["pakakuy"],normalized:"hide"},transition:{primary:"pasay",alternatives:[],normalized:"transition"},on:{primary:"chaypim",alternatives:["kaypi"],normalized:"on"},trigger:{primary:"kuyuchiy",alternatives:["kichay"],normalized:"trigger"},send:{primary:"kachay",alternatives:["apachiy"],normalized:"send"},focus:{primary:"qhawachiy",alternatives:["qhaway"],normalized:"focus"},blur:{primary:"paqariy",alternatives:["mana qhawachiy"],normalized:"blur"},empty:{primary:"ch'usaq",alternatives:["chusaq"],normalized:"empty"},open:{primary:"paskay",normalized:"open"},close:{primary:"wichqay",normalized:"close"},select:{primary:"marcay",normalized:"select"},clear:{primary:"pichay",normalized:"clear"},reset:{primary:"musuqchay",normalized:"reset"},breakpoint:{primary:"sayachinay",normalized:"breakpoint"},go:{primary:"riy",alternatives:["puriy"],normalized:"go"},scroll:{primary:"kunray",alternatives:[],normalized:"scroll"},push:{primary:"tanqay",normalized:"push"},replace:{primary:"tikray_url",alternatives:[],normalized:"replace"},process:{primary:"rurariy",normalized:"process"},wait:{primary:"suyay",normalized:"wait"},fetch:{primary:"apamuy",alternatives:["taripakaramuy"],normalized:"fetch"},settle:{primary:"tiyakuy",normalized:"settle"},if:{primary:"sichus",normalized:"if"},unless:{primary:"mana sichus",normalized:"unless"},when:{primary:"maykama",normalized:"when"},where:{primary:"maypi",normalized:"where"},else:{primary:"manachus",alternatives:["hukniraq"],normalized:"else"},repeat:{primary:"kutipay",alternatives:["muyu"],normalized:"repeat"},for:{primary:"sapankaq",normalized:"for"},while:{primary:"kaykamaqa",normalized:"while"},forever:{primary:"forever",normalized:"forever"},continue:{primary:"qatipay",normalized:"continue"},halt:{primary:"sayay",alternatives:[],normalized:"halt"},throw:{primary:"chanqay",normalized:"throw"},call:{primary:"waqyay",alternatives:["qayay"],normalized:"call"},return:{primary:"kutichiy",alternatives:["kutimuy"],normalized:"return"},then:{primary:"chaymantataq",alternatives:["hinaspa","chaymanta"],normalized:"then"},and:{primary:"hinallataq",alternatives:["ima","chaymantawan"],normalized:"and"},matches:{primary:"tupan",normalized:"matches"},exists:{primary:"tiyan",normalized:"exists"},is:{primary:"kanqa",normalized:"is"},end:{primary:"tukukuy",alternatives:["tukuy","puchukay"],normalized:"end"},js:{primary:"js",normalized:"js"},async:{primary:"mana waqtalla",normalized:"async"},tell:{primary:"niy",alternatives:[],normalized:"tell"},default:{primary:"\u00f1awpaq_kaq",alternatives:["qallariy"],normalized:"default"},init:{primary:"qallarichiy",normalized:"init"},behavior:{primary:"ruwana",normalized:"behavior"},install:{primary:"tarpuy",normalized:"install"},measure:{primary:"tupuy",normalized:"measure"},beep:{primary:"waqay",normalized:"beep"},break:{primary:"p'akiy",normalized:"break"},copy:{primary:"qillqay",normalized:"copy"},exit:{primary:"lluqsiy",normalized:"exit"},pick:{primary:"akllay",normalized:"pick"},render:{primary:"rikurichiy",normalized:"render"},into:{primary:"ukuman",normalized:"into"},before:{primary:"\u00f1awpaq",normalized:"before"},after:{primary:"qhipa",normalized:"after"},until:{primary:"kama",alternatives:["-kama"],normalized:"until"},event:{primary:"ruwakuq",alternatives:["imayna"],normalized:"event"},from:{primary:"manta",alternatives:["-manta"],normalized:"from"},click:{primary:"\u00f1itiy",normalized:"click"},load:{primary:"apakuy",normalized:"load"},submit:{primary:"apaykachay",normalized:"submit"},hover:{primary:"hawachiy",normalized:"hover"},input:{primary:"yaykuchiy",normalized:"input"},change:{primary:"kambiay",normalized:"change"},connect:{primary:"tinkiy",alternatives:["watay","hukllachay"],normalized:"connect"},stream:{primary:"phawachiy",alternatives:["sururichiy","ch'uquchiy"],normalized:"stream"},live:{primary:"kawsachkaq",alternatives:["kunan-pacha","kawsay"],normalized:"live"},socket:{primary:"tinkina",alternatives:["t'oqo","tinkiy-tinkina"],normalized:"socket"},bind:{primary:"bind",alternatives:["watachiy"],normalized:"bind"},intercept:{primary:"hark'ay",alternatives:["intercept"],normalized:"intercept"},worker:{primary:"llamk'aq",alternatives:["worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["kawsay-pukyu"],normalized:"eventsource"}},eventHandler:{keyword:{primary:"pi",alternatives:["kaqtin"]},sourceMarker:{primary:"manta",position:"after"},eventMarker:{primary:"pi",alternatives:["kaqtin","kaqpi"],position:"after"}}}}}),Lh={};Ad(Lh,{russianProfile:()=>Ch});var jh,Ph=Cd({"src/generators/profiles/russian.ts"(){Ch={code:"ru",name:"Russian",nativeName:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439",direction:"ltr",script:"cyrillic",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:!0,defaultVerbForm:"infinitive",verb:{position:"start",subjectDrop:!0,suffixes:["\u0442\u044c","\u0442\u044c\u0441\u044f","\u0438\u0442\u044c","\u0438\u0442\u044c\u0441\u044f","\u0430\u0442\u044c","\u0430\u0442\u044c\u0441\u044f","\u0435\u0442\u044c","\u0435\u0442\u044c\u0441\u044f"]},references:{me:"\u044f",it:"\u044d\u0442\u043e",you:"\u0442\u044b",result:"\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442",event:"\u0441\u043e\u0431\u044b\u0442\u0438\u0435",target:"\u0446\u0435\u043b\u044c",body:"\u0442\u0435\u043b\u043e",document:"\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442",window:"\u043e\u043a\u043d\u043e",detail:"\u0434\u0435\u0442\u0430\u043b\u0438"},possessive:{marker:"",markerPosition:"after-object",usePossessiveAdjectives:!0,specialForms:{me:"\u043c\u043e\u0439",it:"\u0435\u0433\u043e",you:"\u0442\u0432\u043e\u0439"},keywords:{"\u043c\u043e\u0439":"me","\u043c\u043e\u044f":"me","\u043c\u043e\u0451":"me","\u043c\u043e\u0438":"me","\u0442\u0432\u043e\u0439":"you","\u0442\u0432\u043e\u044f":"you","\u0442\u0432\u043e\u0451":"you","\u0442\u0432\u043e\u0438":"you","\u0435\u0433\u043e":"it","\u0435\u0451":"it"}},roleMarkers:{destination:{primary:"\u0432",alternatives:["\u043d\u0430","\u043a"],position:"before"},source:{primary:"\u0438\u0437",alternatives:["\u043e\u0442","\u0441"],position:"before"},patient:{primary:"",position:"before"},style:{primary:"\u0441",alternatives:["\u0441\u043e"],position:"before"}},keywords:{toggle:{primary:"\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c",alternatives:["\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438"],normalized:"toggle",form:"infinitive"},add:{primary:"\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c",alternatives:["\u0434\u043e\u0431\u0430\u0432\u044c"],normalized:"add",form:"infinitive"},remove:{primary:"\u0443\u0434\u0430\u043b\u0438\u0442\u044c",alternatives:["\u0443\u0434\u0430\u043b\u0438","\u0443\u0431\u0440\u0430\u0442\u044c","\u0443\u0431\u0435\u0440\u0438"],normalized:"remove",form:"infinitive"},put:{primary:"\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c",alternatives:["\u043f\u043e\u043b\u043e\u0436\u0438","\u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c","\u043f\u043e\u043c\u0435\u0441\u0442\u0438","\u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c","\u0432\u0441\u0442\u0430\u0432\u044c"],normalized:"put",form:"infinitive"},append:{primary:"\u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c",alternatives:["\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043a\u043e\u043d\u0435\u0446","\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c_\u0432_\u043a\u043e\u043d\u0435\u0446"],normalized:"append",form:"infinitive"},prepend:{primary:"\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043d\u0430\u0447\u0430\u043b\u043e",alternatives:["\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c_\u0432_\u043d\u0430\u0447\u0430\u043b\u043e"],normalized:"prepend",form:"infinitive"},take:{primary:"\u0432\u0437\u044f\u0442\u044c",alternatives:["\u0432\u043e\u0437\u044c\u043c\u0438"],normalized:"take",form:"infinitive"},make:{primary:"\u0441\u043e\u0437\u0434\u0430\u0442\u044c",alternatives:["\u0441\u043e\u0437\u0434\u0430\u0439"],normalized:"make",form:"infinitive"},clone:{primary:"\u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c",alternatives:["\u043a\u043b\u043e\u043d\u0438\u0440\u0443\u0439"],normalized:"clone",form:"infinitive"},swap:{primary:"\u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c",alternatives:["\u043f\u043e\u043c\u0435\u043d\u044f\u0439"],normalized:"swap",form:"infinitive"},morph:{primary:"\u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c",alternatives:["\u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0439"],normalized:"morph",form:"infinitive"},set:{primary:"\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c",alternatives:["\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438","\u0437\u0430\u0434\u0430\u0442\u044c","\u0437\u0430\u0434\u0430\u0439"],normalized:"set",form:"infinitive"},get:{primary:"\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c",alternatives:["\u043f\u043e\u043b\u0443\u0447\u0438"],normalized:"get",form:"infinitive"},increment:{primary:"\u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c",alternatives:["\u0443\u0432\u0435\u043b\u0438\u0447\u044c"],normalized:"increment",form:"infinitive"},decrement:{primary:"\u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c",alternatives:["\u0443\u043c\u0435\u043d\u044c\u0448\u0438"],normalized:"decrement",form:"infinitive"},log:{primary:"\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c",alternatives:["\u0437\u0430\u043f\u0438\u0448\u0438"],normalized:"log",form:"infinitive"},show:{primary:"\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c",alternatives:["\u043f\u043e\u043a\u0430\u0436\u0438"],normalized:"show",form:"infinitive"},hide:{primary:"\u0441\u043a\u0440\u044b\u0442\u044c",alternatives:["\u0441\u043a\u0440\u043e\u0439","\u0441\u043f\u0440\u044f\u0442\u0430\u0442\u044c","\u0441\u043f\u0440\u044f\u0447\u044c"],normalized:"hide",form:"infinitive"},transition:{primary:"\u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c",alternatives:["\u0430\u043d\u0438\u043c\u0438\u0440\u0443\u0439"],normalized:"transition",form:"infinitive"},on:{primary:"\u043f\u0440\u0438",normalized:"on"},trigger:{primary:"\u0438\u043d\u0438\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u0442\u044c",alternatives:["\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c","\u0437\u0430\u043f\u0443\u0441\u0442\u0438"],normalized:"trigger",form:"infinitive"},send:{primary:"\u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c",alternatives:["\u043e\u0442\u043f\u0440\u0430\u0432\u044c"],normalized:"send",form:"infinitive"},focus:{primary:"\u0441\u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c",alternatives:["\u0441\u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u0439","\u0444\u043e\u043a\u0443\u0441"],normalized:"focus",form:"infinitive"},blur:{primary:"\u0440\u0430\u0437\u043c\u044b\u0442\u044c",alternatives:["\u0440\u0430\u0437\u043c\u043e\u0439"],normalized:"blur",form:"infinitive"},empty:{primary:"\u043e\u043f\u0443\u0441\u0442\u043e\u0448\u0438\u0442\u044c",alternatives:["\u043f\u0443\u0441\u0442\u043e\u0439"],normalized:"empty"},open:{primary:"\u043e\u0442\u043a\u0440\u044b\u0442\u044c",normalized:"open"},close:{primary:"\u0437\u0430\u043a\u0440\u044b\u0442\u044c",normalized:"close"},select:{primary:"\u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c",normalized:"select"},clear:{primary:"\u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c",normalized:"clear"},reset:{primary:"\u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c",normalized:"reset"},breakpoint:{primary:"\u0442\u043e\u0447\u043a\u0430-\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0430",normalized:"breakpoint"},click:{primary:"\u043a\u043b\u0438\u043a",alternatives:["\u043a\u043b\u0438\u043a\u0435","\u043d\u0430\u0436\u0430\u0442\u0438\u0438"],normalized:"click"},hover:{primary:"\u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0438",alternatives:["\u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0435"],normalized:"hover"},submit:{primary:"\u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435",alternatives:["\u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430"],normalized:"submit"},input:{primary:"\u0432\u0432\u043e\u0434\u0435",alternatives:["\u0432\u0432\u043e\u0434"],normalized:"input"},change:{primary:"\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438",alternatives:["\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435"],normalized:"change"},load:{primary:"\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430",alternatives:["\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435"],normalized:"load"},go:{primary:"\u043f\u0435\u0440\u0435\u0439\u0442\u0438",alternatives:["\u043f\u0435\u0440\u0435\u0439\u0434\u0438","\u0438\u0434\u0442\u0438","\u0438\u0434\u0438"],normalized:"go",form:"infinitive"},scroll:{primary:"\u043f\u0440\u043e\u043a\u0440\u0443\u0442\u0438\u0442\u044c",alternatives:["\u043f\u0440\u043e\u043a\u0440\u0443\u0442\u0438"],normalized:"scroll",form:"infinitive"},push:{primary:"\u0432\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c",alternatives:["\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c"],normalized:"push",form:"infinitive"},replace:{primary:"\u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c",alternatives:["\u0437\u0430\u043c\u0435\u043d\u0438"],normalized:"replace",form:"infinitive"},process:{primary:"\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c",alternatives:["\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0439"],normalized:"process",form:"infinitive"},wait:{primary:"\u0436\u0434\u0430\u0442\u044c",alternatives:["\u0436\u0434\u0438","\u043f\u043e\u0434\u043e\u0436\u0434\u0438"],normalized:"wait",form:"infinitive"},fetch:{primary:"\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c",alternatives:["\u0437\u0430\u0433\u0440\u0443\u0437\u0438"],normalized:"fetch",form:"infinitive"},settle:{primary:"\u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c",normalized:"settle",form:"infinitive"},if:{primary:"\u0435\u0441\u043b\u0438",normalized:"if"},unless:{primary:"\u043a\u0440\u043e\u043c\u0435",normalized:"unless"},when:{primary:"\u043a\u043e\u0433\u0434\u0430",normalized:"when"},where:{primary:"\u0433\u0434\u0435",normalized:"where"},else:{primary:"\u0438\u043d\u0430\u0447\u0435",normalized:"else"},repeat:{primary:"\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c",alternatives:["\u043f\u043e\u0432\u0442\u043e\u0440\u0438"],normalized:"repeat",form:"infinitive"},for:{primary:"\u0434\u043b\u044f",alternatives:["\u043a\u0430\u0436\u0434\u044b\u0439"],normalized:"for"},while:{primary:"\u043f\u043e\u043a\u0430",normalized:"while"},forever:{primary:"\u0432\u0441\u0435\u0433\u0434\u0430",normalized:"forever",alternatives:["forever"]},continue:{primary:"\u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c",alternatives:["\u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438"],normalized:"continue",form:"infinitive"},halt:{primary:"\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c",alternatives:["\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0441\u044c","\u0441\u0442\u043e\u043f"],normalized:"halt",form:"infinitive"},throw:{primary:"\u0431\u0440\u043e\u0441\u0438\u0442\u044c",alternatives:["\u0431\u0440\u043e\u0441\u044c"],normalized:"throw",form:"infinitive"},call:{primary:"\u0432\u044b\u0437\u0432\u0430\u0442\u044c",alternatives:["\u0432\u044b\u0437\u043e\u0432\u0438"],normalized:"call",form:"infinitive"},return:{primary:"\u0432\u0435\u0440\u043d\u0443\u0442\u044c",alternatives:["\u0432\u0435\u0440\u043d\u0438"],normalized:"return",form:"infinitive"},then:{primary:"\u0437\u0430\u0442\u0435\u043c",alternatives:["\u043f\u043e\u0442\u043e\u043c","\u0442\u043e\u0433\u0434\u0430"],normalized:"then"},and:{primary:"\u0438",normalized:"and"},matches:{primary:"\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442",normalized:"matches"},exists:{primary:"\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442",normalized:"exists"},is:{primary:"\u0435\u0441\u0442\u044c",normalized:"is"},no:{primary:"\u043d\u0435\u0442",normalized:"no"},end:{primary:"\u043a\u043e\u043d\u0435\u0446",normalized:"end"},js:{primary:"js",normalized:"js"},async:{primary:"\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e",alternatives:["async"],normalized:"async"},tell:{primary:"\u0441\u043a\u0430\u0437\u0430\u0442\u044c",alternatives:["\u0441\u043a\u0430\u0436\u0438"],normalized:"tell",form:"infinitive"},default:{primary:"\u043f\u043e_\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e",normalized:"default"},init:{primary:"\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c",alternatives:["\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0439"],normalized:"init",form:"infinitive"},behavior:{primary:"\u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435",normalized:"behavior"},install:{primary:"\u0438\u043d\u0441\u0442\u0430\u043b\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c",normalized:"install",form:"infinitive"},measure:{primary:"\u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c",alternatives:["\u0438\u0437\u043c\u0435\u0440\u044c"],normalized:"measure",form:"infinitive"},beep:{primary:"\u0437\u0432\u0443\u043a",normalized:"beep"},break:{primary:"\u043f\u0440\u0435\u0440\u0432\u0430\u0442\u044c",normalized:"break"},copy:{primary:"\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c",normalized:"copy"},exit:{primary:"\u0432\u044b\u0439\u0442\u0438",normalized:"exit"},pick:{primary:"\u0432\u044b\u0431\u0440\u0430\u0442\u044c",normalized:"pick"},render:{primary:"\u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c",normalized:"render"},into:{primary:"\u0432",alternatives:["\u0432\u043e"],normalized:"into"},before:{primary:"\u0434\u043e",alternatives:["\u043f\u0435\u0440\u0435\u0434"],normalized:"before"},after:{primary:"\u043f\u043e\u0441\u043b\u0435",normalized:"after"},until:{primary:"\u043f\u043e\u043a\u0430_\u043d\u0435",normalized:"until"},event:{primary:"\u0441\u043e\u0431\u044b\u0442\u0438\u0435",normalized:"event"},from:{primary:"\u0438\u0437",alternatives:["\u043e\u0442","\u0441"],normalized:"from"},connect:{primary:"\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c",alternatives:["\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c","\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f"],normalized:"connect"},stream:{primary:"\u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c",alternatives:["\u043f\u043e\u0442\u043e\u043a","\u0441\u0442\u0440\u0438\u043c"],normalized:"stream"},live:{primary:"\u0432-\u043f\u0440\u044f\u043c\u043e\u043c-\u044d\u0444\u0438\u0440\u0435",alternatives:["\u043f\u0440\u044f\u043c\u043e\u0439-\u044d\u0444\u0438\u0440","\u0432\u0436\u0438\u0432\u0443\u044e","\u0436\u0438\u0432\u043e\u0439"],normalized:"live"},socket:{primary:"\u0441\u043e\u043a\u0435\u0442",alternatives:["\u0433\u043d\u0435\u0437\u0434\u043e","websocket","socket"],normalized:"socket"},bind:{primary:"\u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c",alternatives:["\u0441\u0432\u044f\u0437\u0430\u0442\u044c","bind"],normalized:"bind"},intercept:{primary:"\u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0442\u044c",alternatives:["\u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438","intercept"],normalized:"intercept"},worker:{primary:"\u0440\u0430\u0431\u043e\u0447\u0438\u0439",alternatives:["\u0432\u043e\u0440\u043a\u0435\u0440","worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a-\u0441\u043e\u0431\u044b\u0442\u0438\u0439"],normalized:"eventsource"}},eventHandler:{keyword:{primary:"\u043f\u0440\u0438",normalized:"on"},sourceMarker:{primary:"\u043d\u0430",alternatives:["\u0432","\u043f\u0440\u0438"],position:"before"},eventMarker:{primary:"\u043f\u0440\u0438",position:"before"},temporalMarkers:["\u043a\u043e\u0433\u0434\u0430","\u0435\u0441\u043b\u0438"]}}}}),Oh={};Ad(Oh,{swahiliProfile:()=>jh});var Nh,Rh=Cd({"src/generators/profiles/swahili.ts"(){jh={code:"sw",name:"Swahili",nativeName:"Kiswahili",direction:"ltr",script:"latin",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:!0,verb:{position:"start",subjectDrop:!0},references:{me:"mimi",it:"hiyo",you:"wewe",result:"matokeo",event:"tukio",target:"lengo",body:"mwili",document:"hati",window:"dirisha",detail:"maelezo"},possessive:{marker:"",markerPosition:"after-object",usePossessiveAdjectives:!0,specialForms:{me:"yangu",it:"yake",you:"yako"},keywords:{wangu:"me",yangu:"me",langu:"me",changu:"me",wako:"you",yako:"you",lako:"you",chako:"you",wake:"it",yake:"it",lake:"it",chake:"it"}},roleMarkers:{destination:{primary:"kwenye",alternatives:["kwa"],position:"before"},source:{primary:"kutoka",position:"before"},patient:{primary:"",position:"before"},style:{primary:"na",position:"before"}},keywords:{toggle:{primary:"badilisha",normalized:"toggle"},add:{primary:"ongeza",normalized:"add"},remove:{primary:"ondoa",alternatives:["futa","toa"],normalized:"remove"},put:{primary:"weka",alternatives:["tia"],normalized:"put"},append:{primary:"ambatanisha",normalized:"append"},prepend:{primary:"tanguliza",normalized:"prepend"},take:{primary:"chukua",normalized:"take"},make:{primary:"tengeneza",alternatives:["unda"],normalized:"make"},clone:{primary:"nakili",alternatives:["rudufu"],normalized:"clone"},swap:{primary:"badilishana",alternatives:["badalisha"],normalized:"swap"},morph:{primary:"geuza",alternatives:["badilisha umbo"],normalized:"morph"},set:{primary:"seti",normalized:"set"},get:{primary:"pata",alternatives:["pokea"],normalized:"get"},increment:{primary:"ongezeko",normalized:"increment"},decrement:{primary:"punguza",normalized:"decrement"},log:{primary:"andika",alternatives:["rekodi"],normalized:"log"},show:{primary:"onyesha",normalized:"show"},hide:{primary:"ficha",alternatives:["mficho"],normalized:"hide"},transition:{primary:"hamisha",alternatives:["animisha","mpito"],normalized:"transition"},on:{primary:"unapo",alternatives:["kwenye"],normalized:"on"},trigger:{primary:"chochea",normalized:"trigger"},send:{primary:"tuma",alternatives:["peleka"],normalized:"send"},focus:{primary:"lenga",alternatives:["angazia"],normalized:"focus"},blur:{primary:"blur",normalized:"blur"},empty:{primary:"toa-kila-kitu",alternatives:["mwaga","tupu"],normalized:"empty"},open:{primary:"fungua",normalized:"open"},close:{primary:"funga",normalized:"close"},select:{primary:"alama",normalized:"select"},clear:{primary:"safisha",normalized:"clear"},reset:{primary:"anzisha-upya",normalized:"reset"},breakpoint:{primary:"nukta-simama",normalized:"breakpoint"},go:{primary:"nenda",alternatives:["enda","elekea"],normalized:"go"},scroll:{primary:"sogeza",alternatives:["skroli"],normalized:"scroll"},push:{primary:"sukuma",alternatives:["push"],normalized:"push"},replace:{primary:"badilisha_url",alternatives:["badili_url"],normalized:"replace"},process:{primary:"shughulikia",alternatives:["changanua"],normalized:"process"},wait:{primary:"subiri",alternatives:["ngoja"],normalized:"wait"},fetch:{primary:"leta",alternatives:["pakia"],normalized:"fetch"},settle:{primary:"tulia",alternatives:["imarika"],normalized:"settle"},if:{primary:"kama",alternatives:["ikiwa"],normalized:"if"},unless:{primary:"isipokuwa",normalized:"unless"},when:{primary:"wakati",normalized:"when"},where:{primary:"wapi",normalized:"where"},else:{primary:"vinginevyo",alternatives:["sivyo"],normalized:"else"},repeat:{primary:"rudia",normalized:"repeat"},for:{primary:"kwa",normalized:"for"},while:{primary:"kadri",normalized:"while"},forever:{primary:"forever",normalized:"forever"},continue:{primary:"endelea",normalized:"continue"},halt:{primary:"simama",alternatives:["acha"],normalized:"halt"},throw:{primary:"tupa",normalized:"throw"},call:{primary:"ita",normalized:"call"},return:{primary:"rudisha",alternatives:["rejea"],normalized:"return"},then:{primary:"kisha",alternatives:["halafu","baadaye"],normalized:"then"},and:{primary:"na",alternatives:["pia","vilevile"],normalized:"and"},is:{primary:"ni",normalized:"is"},matches:{primary:"inafanana",normalized:"matches"},no:{primary:"hakuna",normalized:"no"},end:{primary:"mwisho",alternatives:["maliza","tamati"],normalized:"end"},js:{primary:"js",alternatives:["javascript"],normalized:"js"},async:{primary:"isiyo sawia",normalized:"async"},tell:{primary:"sema",alternatives:["ambia"],normalized:"tell"},default:{primary:"chaguo-msingi",alternatives:["msingi"],normalized:"default"},init:{primary:"anzisha",alternatives:["anza"],normalized:"init"},behavior:{primary:"tabia",normalized:"behavior"},install:{primary:"sakinisha",normalized:"install"},measure:{primary:"pima",normalized:"measure"},beep:{primary:"lia",normalized:"beep"},break:{primary:"vunja",normalized:"break"},copy:{primary:"nakala",normalized:"copy"},exit:{primary:"toka",normalized:"exit"},pick:{primary:"chagua",normalized:"pick"},render:{primary:"chora",normalized:"render"},into:{primary:"ndani",normalized:"into"},before:{primary:"kabla",normalized:"before"},after:{primary:"baada",normalized:"after"},until:{primary:"hadi",normalized:"until"},event:{primary:"tukio",normalized:"event"},from:{primary:"kutoka",normalized:"from"},connect:{primary:"unganisha",alternatives:["unga","ungana"],normalized:"connect"},stream:{primary:"tiririsha",alternatives:["mtiririko","strimu"],normalized:"stream"},live:{primary:"moja-kwa-moja",alternatives:["mubashara","hai"],normalized:"live"},socket:{primary:"soketi",alternatives:["tundu","soketi-wavuti"],normalized:"socket"},bind:{primary:"ambatisha",alternatives:["funganisha","bind"],normalized:"bind"},intercept:{primary:"zuia",alternatives:["nasa","intercept"],normalized:"intercept"},worker:{primary:"mfanyakazi",alternatives:["worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["chanzo-matukio"],normalized:"eventsource"}},eventHandler:{keyword:{primary:"unapo",alternatives:["kwenye","kwa","wakati"]},sourceMarker:{primary:"kutoka",position:"before"},conditionalKeyword:{primary:"unapo",alternatives:["anapo","tunapo","mnapo","wanapo"]},eventMarker:{primary:"unapo",alternatives:["kwenye","kwa","wakati"],position:"before"}}}}}),Mh={};Ad(Mh,{thaiProfile:()=>Nh});var Ih,Wh=Cd({"src/generators/profiles/thai.ts"(){Nh={code:"th",name:"Thai",nativeName:"\u0e44\u0e17\u0e22",direction:"ltr",script:"thai",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:!1,defaultVerbForm:"base",verb:{position:"second",subjectDrop:!0},references:{me:"\u0e09\u0e31\u0e19",it:"\u0e21\u0e31\u0e19",you:"\u0e04\u0e38\u0e13",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"},possessive:{marker:"\u0e02\u0e2d\u0e07",markerPosition:"between",keywords:{"\u0e02\u0e2d\u0e07\u0e09\u0e31\u0e19":"me","\u0e02\u0e2d\u0e07\u0e1c\u0e21":"me","\u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13":"you","\u0e02\u0e2d\u0e07\u0e21\u0e31\u0e19":"it","\u0e02\u0e2d\u0e07\u0e40\u0e02\u0e32":"it","\u0e02\u0e2d\u0e07\u0e40\u0e18\u0e2d":"it"}},roleMarkers:{patient:{primary:"",position:"before"},destination:{primary:"\u0e43\u0e19",alternatives:["\u0e44\u0e1b\u0e22\u0e31\u0e07"],position:"before"},source:{primary:"\u0e08\u0e32\u0e01",position:"before"},style:{primary:"\u0e14\u0e49\u0e27\u0e22",position:"before"}},keywords:{toggle:{primary:"\u0e2a\u0e25\u0e31\u0e1a",alternatives:[],normalized:"toggle"},add:{primary:"\u0e40\u0e1e\u0e34\u0e48\u0e21",alternatives:[],normalized:"add"},remove:{primary:"\u0e25\u0e1a",alternatives:["\u0e25\u0e1a\u0e2d\u0e2d\u0e01"],normalized:"remove"},put:{primary:"\u0e43\u0e2a\u0e48",alternatives:["\u0e27\u0e32\u0e07"],normalized:"put"},append:{primary:"\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e17\u0e49\u0e32\u0e22",alternatives:[],normalized:"append"},prepend:{primary:"\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e2b\u0e19\u0e49\u0e32",alternatives:[],normalized:"prepend"},take:{primary:"\u0e23\u0e31\u0e1a",alternatives:[],normalized:"take"},make:{primary:"\u0e2a\u0e23\u0e49\u0e32\u0e07",alternatives:[],normalized:"make"},clone:{primary:"\u0e42\u0e04\u0e25\u0e19",alternatives:["\u0e2a\u0e33\u0e40\u0e19\u0e32"],normalized:"clone"},swap:{primary:"\u0e2a\u0e25\u0e31\u0e1a\u0e17\u0e35\u0e48",alternatives:[],normalized:"swap"},morph:{primary:"\u0e41\u0e1b\u0e25\u0e07\u0e23\u0e48\u0e32\u0e07",alternatives:[],normalized:"morph"},set:{primary:"\u0e15\u0e31\u0e49\u0e07",alternatives:["\u0e01\u0e33\u0e2b\u0e19\u0e14"],normalized:"set"},get:{primary:"\u0e23\u0e31\u0e1a\u0e04\u0e48\u0e32",alternatives:[],normalized:"get"},increment:{primary:"\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e04\u0e48\u0e32",alternatives:[],normalized:"increment"},decrement:{primary:"\u0e25\u0e14\u0e04\u0e48\u0e32",alternatives:[],normalized:"decrement"},log:{primary:"\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01",alternatives:[],normalized:"log"},show:{primary:"\u0e41\u0e2a\u0e14\u0e07",alternatives:[],normalized:"show"},hide:{primary:"\u0e0b\u0e48\u0e2d\u0e19",alternatives:[],normalized:"hide"},transition:{primary:"\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e1c\u0e48\u0e32\u0e19",alternatives:[],normalized:"transition"},on:{primary:"\u0e40\u0e21\u0e37\u0e48\u0e2d",alternatives:["\u0e15\u0e2d\u0e19"],normalized:"on"},trigger:{primary:"\u0e17\u0e23\u0e34\u0e01\u0e40\u0e01\u0e2d\u0e23\u0e4c",alternatives:[],normalized:"trigger"},send:{primary:"\u0e2a\u0e48\u0e07",alternatives:[],normalized:"send"},focus:{primary:"\u0e42\u0e1f\u0e01\u0e31\u0e2a",alternatives:[],normalized:"focus"},blur:{primary:"\u0e40\u0e1a\u0e25\u0e2d",alternatives:[],normalized:"blur"},empty:{primary:"\u0e25\u0e49\u0e32\u0e07",alternatives:["\u0e17\u0e33\u0e43\u0e2b\u0e49\u0e27\u0e48\u0e32\u0e07","\u0e27\u0e48\u0e32\u0e07"],normalized:"empty"},open:{primary:"\u0e40\u0e1b\u0e34\u0e14",normalized:"open"},close:{primary:"\u0e1b\u0e34\u0e14",normalized:"close"},select:{primary:"\u0e17\u0e33\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e2b\u0e21\u0e32\u0e22",normalized:"select"},clear:{primary:"\u0e40\u0e04\u0e25\u0e35\u0e22\u0e23\u0e4c",normalized:"clear"},reset:{primary:"\u0e23\u0e35\u0e40\u0e0b\u0e47\u0e15",normalized:"reset"},breakpoint:{primary:"\u0e08\u0e38\u0e14\u0e1e\u0e31\u0e01",normalized:"breakpoint"},click:{primary:"\u0e04\u0e25\u0e34\u0e01",normalized:"click"},hover:{primary:"\u0e42\u0e2e\u0e40\u0e27\u0e2d\u0e23\u0e4c",alternatives:["\u0e27\u0e32\u0e07\u0e40\u0e21\u0e32\u0e2a\u0e4c"],normalized:"hover"},submit:{primary:"\u0e22\u0e37\u0e48\u0e19",alternatives:["\u0e2a\u0e48\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25"],normalized:"submit"},input:{primary:"\u0e1b\u0e49\u0e2d\u0e19",alternatives:["\u0e01\u0e23\u0e2d\u0e01"],normalized:"input"},change:{primary:"\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19",alternatives:["\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e41\u0e1b\u0e25\u0e07"],normalized:"change"},go:{primary:"\u0e44\u0e1b",alternatives:["\u0e44\u0e1b\u0e17\u0e35\u0e48"],normalized:"go"},scroll:{primary:"\u0e40\u0e25\u0e37\u0e48\u0e2d\u0e19",normalized:"scroll"},push:{primary:"\u0e14\u0e31\u0e19",alternatives:["\u0e1c\u0e25\u0e31\u0e01"],normalized:"push"},replace:{primary:"\u0e41\u0e17\u0e19\u0e17\u0e35\u0e48",alternatives:["\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19-url"],normalized:"replace"},process:{primary:"\u0e1b\u0e23\u0e30\u0e21\u0e27\u0e25\u0e1c\u0e25",alternatives:["\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23"],normalized:"process"},wait:{primary:"\u0e23\u0e2d",alternatives:[],normalized:"wait"},fetch:{primary:"\u0e14\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25",alternatives:[],normalized:"fetch"},settle:{primary:"\u0e04\u0e07\u0e17\u0e35\u0e48",alternatives:[],normalized:"settle"},if:{primary:"\u0e16\u0e49\u0e32",alternatives:["\u0e2b\u0e32\u0e01"],normalized:"if"},unless:{primary:"unless",normalized:"unless"},when:{primary:"\u0e02\u0e13\u0e30\u0e17\u0e35\u0e48",normalized:"when"},where:{primary:"\u0e17\u0e35\u0e48\u0e44\u0e2b\u0e19",normalized:"where"},else:{primary:"\u0e44\u0e21\u0e48\u0e07\u0e31\u0e49\u0e19",alternatives:["\u0e44\u0e21\u0e48\u0e40\u0e0a\u0e48\u0e19\u0e19\u0e31\u0e49\u0e19"],normalized:"else"},repeat:{primary:"\u0e17\u0e33\u0e0b\u0e49\u0e33",alternatives:[],normalized:"repeat"},for:{primary:"\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a",alternatives:[],normalized:"for"},while:{primary:"\u0e43\u0e19\u0e02\u0e13\u0e30\u0e17\u0e35\u0e48",alternatives:[],normalized:"while"},forever:{primary:"\u0e15\u0e25\u0e2d\u0e14\u0e44\u0e1b",normalized:"forever",alternatives:["forever"]},continue:{primary:"\u0e15\u0e48\u0e2d\u0e44\u0e1b",alternatives:[],normalized:"continue"},halt:{primary:"\u0e2b\u0e22\u0e38\u0e14",alternatives:[],normalized:"halt"},throw:{primary:"\u0e42\u0e22\u0e19",alternatives:[],normalized:"throw"},call:{primary:"\u0e40\u0e23\u0e35\u0e22\u0e01",alternatives:[],normalized:"call"},return:{primary:"\u0e04\u0e37\u0e19\u0e04\u0e48\u0e32",alternatives:["\u0e01\u0e25\u0e31\u0e1a"],normalized:"return"},then:{primary:"\u0e41\u0e25\u0e49\u0e27",alternatives:[],normalized:"then"},and:{primary:"\u0e41\u0e25\u0e30",alternatives:[],normalized:"and"},exists:{primary:"\u0e21\u0e35\u0e2d\u0e22\u0e39\u0e48",normalized:"exists"},end:{primary:"\u0e08\u0e1a",alternatives:[],normalized:"end"},js:{primary:"\u0e40\u0e08\u0e40\u0e2d\u0e2a",alternatives:["js"],normalized:"js"},async:{primary:"\u0e2d\u0e30\u0e0b\u0e34\u0e07\u0e04\u0e4c",alternatives:[],normalized:"async"},tell:{primary:"\u0e1a\u0e2d\u0e01",alternatives:[],normalized:"tell"},default:{primary:"\u0e04\u0e48\u0e32\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19",alternatives:[],normalized:"default"},init:{primary:"\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19",alternatives:[],normalized:"init"},behavior:{primary:"\u0e1e\u0e24\u0e15\u0e34\u0e01\u0e23\u0e23\u0e21",alternatives:[],normalized:"behavior"},install:{primary:"\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07",alternatives:[],normalized:"install"},measure:{primary:"\u0e27\u0e31\u0e14",alternatives:[],normalized:"measure"},beep:{primary:"\u0e1a\u0e35\u0e4a\u0e1a",alternatives:[],normalized:"beep"},break:{primary:"\u0e02\u0e31\u0e14\u0e08\u0e31\u0e07\u0e2b\u0e27\u0e30",alternatives:[],normalized:"break"},copy:{primary:"\u0e04\u0e31\u0e14\u0e25\u0e2d\u0e01",alternatives:[],normalized:"copy"},exit:{primary:"\u0e2d\u0e2d\u0e01",alternatives:[],normalized:"exit"},pick:{primary:"\u0e40\u0e25\u0e37\u0e2d\u0e01",alternatives:[],normalized:"pick"},render:{primary:"\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25",alternatives:[],normalized:"render"},into:{primary:"\u0e43\u0e19",alternatives:[],normalized:"into"},before:{primary:"\u0e01\u0e48\u0e2d\u0e19",alternatives:[],normalized:"before"},after:{primary:"\u0e2b\u0e25\u0e31\u0e07",alternatives:[],normalized:"after"},until:{primary:"\u0e08\u0e19\u0e16\u0e36\u0e07",alternatives:[],normalized:"until"},event:{primary:"\u0e40\u0e2b\u0e15\u0e38\u0e01\u0e32\u0e23\u0e13\u0e4c",alternatives:[],normalized:"event"},from:{primary:"\u0e08\u0e32\u0e01",normalized:"from"},connect:{primary:"\u0e40\u0e0a\u0e37\u0e48\u0e2d\u0e21\u0e15\u0e48\u0e2d",alternatives:["\u0e40\u0e0a\u0e37\u0e48\u0e2d\u0e21"],normalized:"connect"},stream:{primary:"\u0e2a\u0e15\u0e23\u0e35\u0e21",alternatives:["\u0e2a\u0e15\u0e23\u0e35\u0e21\u0e21\u0e34\u0e48\u0e07","\u0e01\u0e23\u0e30\u0e41\u0e2a"],normalized:"stream"},live:{primary:"\u0e44\u0e25\u0e1f\u0e4c",alternatives:["\u0e2a\u0e14","\u0e16\u0e48\u0e32\u0e22\u0e17\u0e2d\u0e14\u0e2a\u0e14"],normalized:"live"},socket:{primary:"\u0e0b\u0e47\u0e2d\u0e01\u0e40\u0e01\u0e47\u0e15",alternatives:["websocket","\u0e40\u0e27\u0e47\u0e1a\u0e0b\u0e47\u0e2d\u0e01\u0e40\u0e01\u0e47\u0e15","socket"],normalized:"socket"},intercept:{primary:"\u0e14\u0e31\u0e01\u0e08\u0e31\u0e1a",alternatives:["intercept","\u0e2a\u0e01\u0e31\u0e14\u0e01\u0e31\u0e49\u0e19"],normalized:"intercept"},worker:{primary:"\u0e40\u0e27\u0e34\u0e23\u0e4c\u0e01\u0e40\u0e01\u0e2d\u0e23\u0e4c",alternatives:["worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["\u0e2d\u0e35\u0e40\u0e27\u0e19\u0e15\u0e4c\u0e0b\u0e2d\u0e23\u0e4c\u0e2a"],normalized:"eventsource"},bind:{primary:"\u0e1c\u0e39\u0e01",alternatives:["bind"],normalized:"bind"}},tokenization:{boundaryStrategy:"character"},eventHandler:{keyword:{primary:"\u0e40\u0e21\u0e37\u0e48\u0e2d",alternatives:["\u0e15\u0e2d\u0e19"],normalized:"on"},sourceMarker:{primary:"\u0e08\u0e32\u0e01",position:"before"},eventMarker:{primary:"\u0e40\u0e21\u0e37\u0e48\u0e2d",alternatives:["\u0e15\u0e2d\u0e19"],position:"before"},temporalMarkers:["\u0e40\u0e21\u0e37\u0e48\u0e2d","\u0e15\u0e2d\u0e19"]}}}}),_h={};Ad(_h,{tagalogProfile:()=>Ih});var qh,$h=Cd({"src/generators/profiles/tl.ts"(){Ih={code:"tl",name:"Tagalog",nativeName:"Tagalog",direction:"ltr",script:"latin",wordOrder:"VSO",markingStrategy:"preposition",usesSpaces:!0,defaultVerbForm:"base",verb:{position:"start",subjectDrop:!0},references:{me:"ako",it:"ito",you:"ikaw",result:"resulta",event:"pangyayari",target:"target",body:"katawan",document:"dokumento",window:"bintana",detail:"detalye"},possessive:{marker:"ng",markerPosition:"between",keywords:{ko:"me",akin:"me",aking:"me",mo:"you",iyo:"you",niya:"it",nito:"it",kaniya:"it"}},roleMarkers:{destination:{primary:"sa",alternatives:["bago","matapos"],position:"before"},source:{primary:"mula_sa",position:"before"},patient:{primary:"",position:"before"},style:{primary:"nang",position:"before"}},keywords:{toggle:{primary:"palitan",alternatives:["itoggle"],normalized:"toggle"},add:{primary:"idagdag",alternatives:["magdagdag"],normalized:"add"},remove:{primary:"alisin",alternatives:["tanggalin"],normalized:"remove"},put:{primary:"ilagay",alternatives:["maglagay"],normalized:"put"},append:{primary:"idagdag_sa_dulo",normalized:"append"},prepend:{primary:"idagdag_sa_simula",normalized:"prepend"},take:{primary:"kumuha",normalized:"take"},make:{primary:"gumawa",alternatives:["lumikha"],normalized:"make"},clone:{primary:"i-clone",normalized:"clone"},swap:{primary:"palitan_pwesto",alternatives:["magpalit"],normalized:"swap"},morph:{primary:"baguhin",normalized:"morph"},set:{primary:"itakda",alternatives:["magtakda"],normalized:"set"},get:{primary:"kunin",normalized:"get"},increment:{primary:"dagdagan",alternatives:["taasan"],normalized:"increment"},decrement:{primary:"bawasan",alternatives:["ibaba"],normalized:"decrement"},log:{primary:"itala",normalized:"log"},show:{primary:"ipakita",alternatives:["magpakita"],normalized:"show"},hide:{primary:"itago",alternatives:["magtago"],normalized:"hide"},transition:{primary:"lumipat",normalized:"transition"},on:{primary:"kapag",normalized:"on"},trigger:{primary:"palitawin",alternatives:["magpatugtog"],normalized:"trigger"},send:{primary:"ipadala",alternatives:["magpadala"],normalized:"send"},focus:{primary:"ituon",normalized:"focus"},blur:{primary:"alisin_tuon",normalized:"blur"},empty:{primary:"walang-laman",alternatives:["alisin-laman","walang_laman"],normalized:"empty"},open:{primary:"buksan",normalized:"open"},close:{primary:"isara",normalized:"close"},select:{primary:"piliin",normalized:"select"},clear:{primary:"burahin",normalized:"clear"},reset:{primary:"i-reset",normalized:"reset"},breakpoint:{primary:"breakpoint",normalized:"breakpoint"},go:{primary:"pumunta",alternatives:["punta"],normalized:"go"},scroll:{primary:"iscroll",alternatives:["mag_scroll","scroll"],normalized:"scroll"},push:{primary:"itulak",alternatives:["ipush"],normalized:"push"},replace:{primary:"palitan_url",alternatives:["ireplace"],normalized:"replace"},process:{primary:"iproseso",alternatives:["proseso"],normalized:"process"},wait:{primary:"maghintay",alternatives:["hintay"],normalized:"wait"},fetch:{primary:"kuhanin_mula",alternatives:["kunin_mula"],normalized:"fetch"},settle:{primary:"magpatahimik",normalized:"settle"},if:{primary:"kung",normalized:"if"},unless:{primary:"maliban_kung",normalized:"unless"},when:{primary:"tuwing",normalized:"when"},where:{primary:"kung_saan",normalized:"where"},else:{primary:"kung_hindi",alternatives:["kundi"],normalized:"else"},repeat:{primary:"ulitin",alternatives:["paulit-ulit"],normalized:"repeat"},for:{primary:"para_sa",normalized:"for"},while:{primary:"habang",normalized:"while"},forever:{primary:"magpakailanman",normalized:"forever",alternatives:["forever"]},continue:{primary:"magpatuloy",normalized:"continue"},halt:{primary:"itigil",alternatives:["huminto"],normalized:"halt"},throw:{primary:"ihagis",alternatives:["itapon"],normalized:"throw"},call:{primary:"tawagin",alternatives:["tawagan","tumawag"],normalized:"call"},return:{primary:"ibalik",alternatives:["bumalik"],normalized:"return"},then:{primary:"pagkatapos",alternatives:["saka"],normalized:"then"},and:{primary:"at",normalized:"and"},matches:{primary:"tumutugma",normalized:"matches"},is:{primary:"ay",normalized:"is"},end:{primary:"wakas",alternatives:["tapos"],normalized:"end"},js:{primary:"js",normalized:"js"},async:{primary:"async",alternatives:["sabay"],normalized:"async"},tell:{primary:"sabihin",alternatives:["magsabi"],normalized:"tell"},default:{primary:"pamantayan",alternatives:["default","unang_halaga"],normalized:"default"},init:{primary:"simulan",alternatives:["magsimula"],normalized:"init"},behavior:{primary:"ugali",alternatives:["kilos"],normalized:"behavior"},install:{primary:"ikabit",alternatives:["mag-install"],normalized:"install"},measure:{primary:"sukatin",normalized:"measure"},beep:{primary:"tunog",normalized:"beep"},break:{primary:"putulin",normalized:"break"},copy:{primary:"kopyahin",normalized:"copy"},exit:{primary:"lumabas",normalized:"exit"},pick:{primary:"pumili",normalized:"pick"},render:{primary:"irender",normalized:"render"},into:{primary:"sa",normalized:"into"},before:{primary:"bago",normalized:"before"},after:{primary:"matapos",normalized:"after"},until:{primary:"hanggang",normalized:"until"},event:{primary:"pangyayari",normalized:"event"},from:{primary:"mula",alternatives:["galing"],normalized:"from"},connect:{primary:"ikonekta",alternatives:["kumonekta","connect"],normalized:"connect"},stream:{primary:"i-stream",alternatives:["stream","agos"],normalized:"stream"},live:{primary:"live",alternatives:["tuwiran","direkta"],normalized:"live"},socket:{primary:"socket",alternatives:["websocket"],normalized:"socket"},worker:{primary:"worker",alternatives:["manggagawa"],normalized:"worker"},eventsource:{primary:"eventsource",normalized:"eventsource"},intercept:{primary:"intercept",alternatives:["harangin","humarang"],normalized:"intercept"},bind:{primary:"itali",alternatives:["iugnay","bind"],normalized:"bind"}},eventHandler:{keyword:{primary:"kapag",normalized:"on"},sourceMarker:{primary:"mula_sa",alternatives:["galing_sa"],position:"before"},eventMarker:{primary:"kapag",position:"before"}}}}}),Vh={};Ad(Vh,{turkishProfile:()=>qh});var Dh,Bh=Cd({"src/generators/profiles/turkish.ts"(){qh={code:"tr",name:"Turkish",nativeName:"T\u00fcrk\u00e7e",regions:["priority"],direction:"ltr",script:"latin",wordOrder:"SOV",markingStrategy:"case-suffix",usesSpaces:!0,markersOptional:!0,verb:{position:"end",suffixes:["mek","mak","yor","di","mi\u015f"],subjectDrop:!0},references:{me:"ben",it:"o",you:"sen",result:"sonu\u00e7",event:"olay",target:"hedef",body:"g\u00f6vde",document:"belge",window:"pencere",detail:"detay"},possessive:{marker:"\u0131n",markerPosition:"after-object",usePossessiveAdjectives:!0,specialForms:{me:"benim",it:"onun",you:"senin"},keywords:{benim:"me",senin:"you",onun:"it"}},roleMarkers:{patient:{primary:"i",alternatives:["\u0131","u","\u00fc","yi","y\u0131","yu","y\u00fc","ni","n\u0131","nu","n\u00fc"],position:"after"},destination:{primary:"e",alternatives:["a","ye","ya","ne","na","de","da","te","ta","\u0131n","in","un","\u00fcn","n\u0131n","nin","nun","n\u00fcn"],position:"after"},source:{primary:"den",alternatives:["dan","ten","tan"],position:"after"},style:{primary:"le",alternatives:["la","yle","yla","ile"],position:"after"},event:{primary:"i",alternatives:["\u0131","u","\u00fc"],position:"after"}},keywords:{toggle:{primary:"de\u011fi\u015ftir",alternatives:["a\u00e7/kapat"],normalized:"toggle"},add:{primary:"ekle",normalized:"add"},remove:{primary:"kald\u0131r",alternatives:["sil"],normalized:"remove"},put:{primary:"koy",normalized:"put"},append:{primary:"ili\u015ftir",normalized:"append"},prepend:{primary:"ba\u015f\u0131naekle",normalized:"prepend"},take:{primary:"tut",normalized:"take"},make:{primary:"yap",normalized:"make"},clone:{primary:"klonla",normalized:"clone"},swap:{primary:"takas",normalized:"swap"},morph:{primary:"d\u00f6n\u00fc\u015ft\u00fcr",alternatives:["\u015fekil de\u011fi\u015ftir"],normalized:"morph"},set:{primary:"ayarla",alternatives:["belirle"],normalized:"set"},get:{primary:"al",normalized:"get"},increment:{primary:"art\u0131r",normalized:"increment"},decrement:{primary:"azalt",normalized:"decrement"},log:{primary:"kaydet",normalized:"log"},show:{primary:"g\u00f6ster",normalized:"show"},hide:{primary:"gizle",normalized:"hide"},transition:{primary:"ge\u00e7i\u015f",normalized:"transition"},on:{primary:"\u00fczerinde",alternatives:["zaman"],normalized:"on"},trigger:{primary:"tetikle",normalized:"trigger"},send:{primary:"g\u00f6nder",normalized:"send"},focus:{primary:"odaklanma",alternatives:["odak"],normalized:"focus"},blur:{primary:"odak kayb\u0131",alternatives:["odak kaybi","bulan\u0131k","bulan\u0131kl\u0131k","bulanik"],normalized:"blur"},empty:{primary:"bo\u015falt",alternatives:["bosalt","bo\u015f"],normalized:"empty"},open:{primary:"a\u00e7",alternatives:["ac"],normalized:"open"},close:{primary:"kapat",normalized:"close"},select:{primary:"vurgula",normalized:"select"},clear:{primary:"temizle",normalized:"clear"},reset:{primary:"s\u0131f\u0131rla",alternatives:["sifirla"],normalized:"reset"},breakpoint:{primary:"kesme-noktas\u0131",alternatives:["kesme-noktasi"],normalized:"breakpoint"},click:{primary:"t\u0131klama",alternatives:["t\u0131kla","tiklama","t\u0131k","tik"],normalized:"click"},hover:{primary:"\u00fczerine gelme",alternatives:["\u00fczerinde gezinme"],normalized:"hover"},submit:{primary:"g\u00f6nderme",normalized:"submit"},input:{primary:"girdi",alternatives:["giri\u015f","giris"],normalized:"input"},change:{primary:"de\u011fi\u015fiklik",alternatives:["de\u011fi\u015fim","degisim"],normalized:"change"},load:{primary:"y\u00fckle",normalized:"load"},go:{primary:"git",normalized:"go"},scroll:{primary:"kayd\u0131rma",alternatives:["kaydirma","kayd\u0131r","kaydir"],normalized:"scroll"},push:{primary:"itele",alternatives:["push"],normalized:"push"},replace:{primary:"de\u011fi\u015ftir_url",alternatives:["degistir_url"],normalized:"replace"},process:{primary:"i\u015fle",alternatives:["isle"],normalized:"process"},wait:{primary:"bekle",normalized:"wait"},fetch:{primary:"getir",normalized:"fetch"},settle:{primary:"sabitlen",normalized:"settle"},if:{primary:"e\u011fer",normalized:"if"},unless:{primary:"de\u011filse",normalized:"unless"},when:{primary:"iken",alternatives:["durumunda","oldu\u011funda"],normalized:"when"},where:{primary:"nerede",normalized:"where"},else:{primary:"yoksa",normalized:"else"},repeat:{primary:"tekrarla",normalized:"repeat"},for:{primary:"i\u00e7in",normalized:"for"},while:{primary:"s\u00fcresince",normalized:"while"},forever:{primary:"forever",normalized:"forever"},continue:{primary:"devam",normalized:"continue"},halt:{primary:"durdur",normalized:"halt"},throw:{primary:"f\u0131rlat",normalized:"throw"},call:{primary:"\u00e7a\u011f\u0131r",normalized:"call"},return:{primary:"d\u00f6n",normalized:"return"},then:{primary:"ard\u0131ndan",alternatives:["daha sonra","ardindan"],normalized:"then"},and:{primary:"ve",alternatives:["ayr\u0131ca","hem de"],normalized:"and"},or:{primary:"veya",normalized:"or"},not:{primary:"de\u011fil",alternatives:["degil"],normalized:"not"},matches:{primary:"e\u015fle\u015fir",normalized:"matches"},is:{primary:"dir",normalized:"is"},no:{primary:"yok",normalized:"no"},end:{primary:"son",alternatives:["biti\u015f","bitti"],normalized:"end"},js:{primary:"js",normalized:"js"},async:{primary:"asenkron",normalized:"async"},tell:{primary:"s\u00f6yle",normalized:"tell"},default:{primary:"varsay\u0131lan",normalized:"default"},init:{primary:"ba\u015flat",normalized:"init"},behavior:{primary:"davran\u0131\u015f",normalized:"behavior"},install:{primary:"kur",alternatives:["y\u00fcklemek"],normalized:"install"},measure:{primary:"\u00f6l\u00e7",normalized:"measure"},beep:{primary:"bip",normalized:"beep"},break:{primary:"dur",normalized:"break"},copy:{primary:"kopyala",normalized:"copy"},exit:{primary:"\u00e7\u0131k",normalized:"exit"},pick:{primary:"se\u00e7",normalized:"pick"},render:{primary:"render",normalized:"render"},into:{primary:"i\u00e7ine",normalized:"into"},before:{primary:"\u00f6nce",normalized:"before"},after:{primary:"sonra",normalized:"after"},until:{primary:"kadar",normalized:"until"},event:{primary:"olay",normalized:"event"},from:{primary:"den",alternatives:["dan"],normalized:"from"},connect:{primary:"ba\u011flan",alternatives:["ba\u011fla","ba\u011flant\u0131"],normalized:"connect"},stream:{primary:"yay\u0131nla",alternatives:["ak\u0131t","ak\u0131\u015f"],normalized:"stream"},live:{primary:"canl\u0131",alternatives:["ger\u00e7ek-zamanl\u0131"],normalized:"live"},socket:{primary:"soket",alternatives:["websocket"],normalized:"socket"},bind:{primary:"bind",normalized:"bind"},intercept:{primary:"yakala",alternatives:["araya-gir","intercept"],normalized:"intercept"},worker:{primary:"i\u015f\u00e7i",alternatives:["worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["olay-kayna\u011f\u0131"],normalized:"eventsource"}},eventHandler:{eventMarker:{primary:"da",alternatives:["de","ta","te"],position:"after"},temporalMarkers:["d\u0131\u011f\u0131nda","di\u011finde"]}}}}),Hh={};Ad(Hh,{ukrainianProfile:()=>Dh});var Kh,Fh=Cd({"src/generators/profiles/ukrainian.ts"(){Dh={code:"uk",name:"Ukrainian",nativeName:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",direction:"ltr",script:"cyrillic",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:!0,defaultVerbForm:"infinitive",verb:{position:"start",subjectDrop:!0,suffixes:["\u0442\u0438","\u0442\u0438\u0441\u044f","\u0438\u0442\u0438","\u0438\u0442\u0438\u0441\u044f","\u0430\u0442\u0438","\u0430\u0442\u0438\u0441\u044f","\u0456\u0442\u0438","\u0456\u0442\u0438\u0441\u044f"]},references:{me:"\u044f",it:"\u0446\u0435",you:"\u0442\u0438",result:"\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442",event:"\u043f\u043e\u0434\u0456\u044f",target:"\u0446\u0456\u043b\u044c",body:"\u0442\u0456\u043b\u043e",document:"\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442",window:"\u0432\u0456\u043a\u043d\u043e",detail:"\u0434\u0435\u0442\u0430\u043b\u0456"},possessive:{marker:"",markerPosition:"after-object",usePossessiveAdjectives:!0,specialForms:{me:"\u043c\u0456\u0439",it:"\u0439\u043e\u0433\u043e",you:"\u0442\u0432\u0456\u0439"},keywords:{"\u043c\u0456\u0439":"me","\u043c\u043e\u044f":"me","\u043c\u043e\u0454":"me","\u043c\u043e\u0457":"me","\u0442\u0432\u0456\u0439":"you","\u0442\u0432\u043e\u044f":"you","\u0442\u0432\u043e\u0454":"you","\u0442\u0432\u043e\u0457":"you","\u0439\u043e\u0433\u043e":"it","\u0457\u0457":"it"}},roleMarkers:{destination:{primary:"\u0432",alternatives:["\u043d\u0430","\u0434\u043e"],position:"before"},source:{primary:"\u0437",alternatives:["\u0432\u0456\u0434","\u0456\u0437"],position:"before"},patient:{primary:"",position:"before"},style:{primary:"\u0437",alternatives:["\u0456\u0437"],position:"before"}},keywords:{toggle:{primary:"\u043f\u0435\u0440\u0435\u043c\u043a\u043d\u0443\u0442\u0438",alternatives:["\u043f\u0435\u0440\u0435\u043c\u043a\u043d\u0438"],normalized:"toggle",form:"infinitive"},add:{primary:"\u0434\u043e\u0434\u0430\u0442\u0438",alternatives:["\u0434\u043e\u0434\u0430\u0439"],normalized:"add",form:"infinitive"},remove:{primary:"\u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438",alternatives:["\u0432\u0438\u0434\u0430\u043b\u0438","\u043f\u0440\u0438\u0431\u0440\u0430\u0442\u0438","\u043f\u0440\u0438\u0431\u0435\u0440\u0438"],normalized:"remove",form:"infinitive"},put:{primary:"\u043f\u043e\u043a\u043b\u0430\u0441\u0442\u0438",alternatives:["\u043f\u043e\u043a\u043b\u0430\u0434\u0438","\u043f\u043e\u043c\u0456\u0441\u0442\u0438\u0442\u0438","\u043f\u043e\u043c\u0456\u0441\u0442\u0438","\u0432\u0441\u0442\u0430\u0432\u0438\u0442\u0438","\u0432\u0441\u0442\u0430\u0432"],normalized:"put",form:"infinitive"},append:{primary:"\u0434\u043e\u043f\u0438\u0441\u0430\u0442\u0438",alternatives:["\u0434\u043e\u0434\u0430\u0442\u0438 \u0432 \u043a\u0456\u043d\u0435\u0446\u044c","\u0434\u043e\u0434\u0430\u0442\u0438_\u0432_\u043a\u0456\u043d\u0435\u0446\u044c"],normalized:"append",form:"infinitive"},prepend:{primary:"\u0434\u043e\u0434\u0430\u0442\u0438 \u043d\u0430 \u043f\u043e\u0447\u0430\u0442\u043e\u043a",alternatives:["\u0434\u043e\u0434\u0430\u0442\u0438_\u043d\u0430_\u043f\u043e\u0447\u0430\u0442\u043e\u043a"],normalized:"prepend",form:"infinitive"},take:{primary:"\u0432\u0437\u044f\u0442\u0438",alternatives:["\u0432\u0456\u0437\u044c\u043c\u0438"],normalized:"take",form:"infinitive"},make:{primary:"\u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438",alternatives:["\u0441\u0442\u0432\u043e\u0440\u0438"],normalized:"make",form:"infinitive"},clone:{primary:"\u043a\u043b\u043e\u043d\u0443\u0432\u0430\u0442\u0438",alternatives:["\u043a\u043b\u043e\u043d\u0443\u0439"],normalized:"clone",form:"infinitive"},swap:{primary:"\u043f\u043e\u043c\u0456\u043d\u044f\u0442\u0438",alternatives:["\u043f\u043e\u043c\u0456\u043d\u044f\u0439"],normalized:"swap",form:"infinitive"},morph:{primary:"\u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0443\u0432\u0430\u0442\u0438",alternatives:["\u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0443\u0439"],normalized:"morph",form:"infinitive"},set:{primary:"\u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0438",alternatives:["\u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438","\u0437\u0430\u0434\u0430\u0442\u0438","\u0437\u0430\u0434\u0430\u0439"],normalized:"set",form:"infinitive"},get:{primary:"\u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438",alternatives:["\u043e\u0442\u0440\u0438\u043c\u0430\u0439"],normalized:"get",form:"infinitive"},increment:{primary:"\u0437\u0431\u0456\u043b\u044c\u0448\u0438\u0442\u0438",alternatives:["\u0437\u0431\u0456\u043b\u044c\u0448"],normalized:"increment",form:"infinitive"},decrement:{primary:"\u0437\u043c\u0435\u043d\u0448\u0438\u0442\u0438",alternatives:["\u0437\u043c\u0435\u043d\u0448"],normalized:"decrement",form:"infinitive"},log:{primary:"\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u0438",alternatives:["\u0437\u0430\u043f\u0438\u0448\u0438"],normalized:"log",form:"infinitive"},show:{primary:"\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0438",alternatives:["\u043f\u043e\u043a\u0430\u0436\u0438"],normalized:"show",form:"infinitive"},hide:{primary:"\u0441\u0445\u043e\u0432\u0430\u0442\u0438",alternatives:["\u0441\u0445\u043e\u0432\u0430\u0439","\u043f\u0440\u0438\u0445\u043e\u0432\u0430\u0442\u0438","\u043f\u0440\u0438\u0445\u043e\u0432\u0430\u0439"],normalized:"hide",form:"infinitive"},transition:{primary:"\u0430\u043d\u0456\u043c\u0443\u0432\u0430\u0442\u0438",alternatives:["\u0430\u043d\u0456\u043c\u0443\u0439"],normalized:"transition",form:"infinitive"},on:{primary:"\u043f\u0440\u0438",normalized:"on"},trigger:{primary:"\u0456\u043d\u0456\u0446\u0456\u044e\u0432\u0430\u0442\u0438",alternatives:["\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0438","\u0437\u0430\u043f\u0443\u0441\u0442\u0438"],normalized:"trigger",form:"infinitive"},send:{primary:"\u043d\u0430\u0434\u0456\u0441\u043b\u0430\u0442\u0438",alternatives:["\u043d\u0430\u0434\u0456\u0448\u043b\u0438"],normalized:"send",form:"infinitive"},focus:{primary:"\u0441\u0444\u043e\u043a\u0443\u0441\u0443\u0432\u0430\u0442\u0438",alternatives:["\u0441\u0444\u043e\u043a\u0443\u0441\u0443\u0439","\u0444\u043e\u043a\u0443\u0441"],normalized:"focus",form:"infinitive"},blur:{primary:"\u0440\u043e\u0437\u0444\u043e\u043a\u0443\u0441\u0443\u0432\u0430\u0442\u0438",alternatives:["\u0440\u043e\u0437\u0444\u043e\u043a\u0443\u0441\u0443\u0439"],normalized:"blur",form:"infinitive"},empty:{primary:"\u0441\u043f\u043e\u0440\u043e\u0436\u043d\u0438\u0442\u0438",alternatives:["\u043f\u043e\u0440\u043e\u0436\u043d\u0456\u0439"],normalized:"empty"},open:{primary:"\u0432\u0456\u0434\u043a\u0440\u0438\u0442\u0438",normalized:"open"},close:{primary:"\u0437\u0430\u043a\u0440\u0438\u0442\u0438",normalized:"close"},select:{primary:"\u0432\u0438\u0434\u0456\u043b\u0438\u0442\u0438",normalized:"select"},clear:{primary:"\u043e\u0447\u0438\u0441\u0442\u0438\u0442\u0438",normalized:"clear"},reset:{primary:"\u0441\u043a\u0438\u043d\u0443\u0442\u0438",normalized:"reset"},breakpoint:{primary:"\u0442\u043e\u0447\u043a\u0430-\u0437\u0443\u043f\u0438\u043d\u043a\u0438",normalized:"breakpoint"},click:{primary:"\u043a\u043b\u0456\u043a\u0443",alternatives:["\u043a\u043b\u0456\u043a","\u043d\u0430\u0442\u0438\u0441\u043a\u0430\u043d\u043d\u0456"],normalized:"click"},hover:{primary:"\u043d\u0430\u0432\u0435\u0434\u0435\u043d\u043d\u0456",alternatives:["\u043d\u0430\u0432\u0435\u0434\u0435\u043d\u043d\u044f"],normalized:"hover"},submit:{primary:"\u0432\u0456\u0434\u043f\u0440\u0430\u0432\u0446\u0456",alternatives:["\u0432\u0456\u0434\u043f\u0440\u0430\u0432\u043a\u0430","\u043d\u0430\u0434\u0441\u0438\u043b\u0430\u043d\u043d\u044f"],normalized:"submit"},input:{primary:"\u0432\u0432\u0435\u0434\u0435\u043d\u043d\u0456",alternatives:["\u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044f"],normalized:"input"},change:{primary:"\u0437\u043c\u0456\u043d\u0456",alternatives:["\u0437\u043c\u0456\u043d\u0430"],normalized:"change"},load:{primary:"\u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f",normalized:"load"},go:{primary:"\u043f\u0435\u0440\u0435\u0439\u0442\u0438",alternatives:["\u043f\u0435\u0440\u0435\u0439\u0434\u0438","\u0439\u0442\u0438","\u0439\u0434\u0438"],normalized:"go",form:"infinitive"},scroll:{primary:"\u043f\u0440\u043e\u043a\u0440\u0443\u0442\u0438\u0442\u0438",alternatives:["\u043f\u0440\u043e\u043a\u0440\u0443\u0442\u0438"],normalized:"scroll",form:"infinitive"},push:{primary:"\u0448\u0442\u043e\u0432\u0445\u043d\u0443\u0442\u0438",alternatives:["\u0437\u0430\u0448\u0442\u043e\u0432\u0445\u043d\u0443\u0442\u0438"],normalized:"push",form:"infinitive"},replace:{primary:"\u0437\u0430\u043c\u0456\u043d\u0438\u0442\u0438",alternatives:["\u0437\u0430\u043c\u0456\u043d\u0438"],normalized:"replace",form:"infinitive"},process:{primary:"\u043e\u0431\u0440\u043e\u0431\u0438\u0442\u0438",alternatives:["\u043e\u0431\u0440\u043e\u0431\u043b\u044f\u0442\u0438"],normalized:"process",form:"infinitive"},wait:{primary:"\u0447\u0435\u043a\u0430\u0442\u0438",alternatives:["\u0447\u0435\u043a\u0430\u0439","\u0437\u0430\u0447\u0435\u043a\u0430\u0439"],normalized:"wait",form:"infinitive"},fetch:{primary:"\u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438",alternatives:["\u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436"],normalized:"fetch",form:"infinitive"},settle:{primary:"\u0441\u0442\u0430\u0431\u0456\u043b\u0456\u0437\u0443\u0432\u0430\u0442\u0438",normalized:"settle",form:"infinitive"},if:{primary:"\u044f\u043a\u0449\u043e",normalized:"if"},unless:{primary:"\u043a\u0440\u0456\u043c",normalized:"unless"},when:{primary:"\u043a\u043e\u043b\u0438",normalized:"when"},where:{primary:"\u0434\u0435",normalized:"where"},else:{primary:"\u0456\u043d\u0430\u043a\u0448\u0435",normalized:"else"},repeat:{primary:"\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0438",alternatives:["\u043f\u043e\u0432\u0442\u043e\u0440\u0438"],normalized:"repeat",form:"infinitive"},for:{primary:"\u0434\u043b\u044f",alternatives:["\u043a\u043e\u0436\u043d\u0438\u0439"],normalized:"for"},while:{primary:"\u043f\u043e\u043a\u0438",normalized:"while"},forever:{primary:"\u0437\u0430\u0432\u0436\u0434\u0438",normalized:"forever",alternatives:["forever"]},continue:{primary:"\u043f\u0440\u043e\u0434\u043e\u0432\u0436\u0438\u0442\u0438",alternatives:["\u043f\u0440\u043e\u0434\u043e\u0432\u0436\u0443\u0439"],normalized:"continue",form:"infinitive"},halt:{primary:"\u0437\u0443\u043f\u0438\u043d\u0438\u0442\u0438",alternatives:["\u0437\u0443\u043f\u0438\u043d\u0438\u0441\u044c","\u0441\u0442\u043e\u043f"],normalized:"halt",form:"infinitive"},throw:{primary:"\u043a\u0438\u043d\u0443\u0442\u0438",alternatives:["\u043a\u0438\u043d\u044c"],normalized:"throw",form:"infinitive"},call:{primary:"\u0432\u0438\u043a\u043b\u0438\u043a\u0430\u0442\u0438",alternatives:["\u0432\u0438\u043a\u043b\u0438\u0447"],normalized:"call",form:"infinitive"},return:{primary:"\u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u0438",alternatives:["\u043f\u043e\u0432\u0435\u0440\u043d\u0438"],normalized:"return",form:"infinitive"},then:{primary:"\u043f\u043e\u0442\u0456\u043c",alternatives:["\u0434\u0430\u043b\u0456","\u0442\u043e\u0434\u0456"],normalized:"then"},and:{primary:"\u0456",alternatives:["\u0442\u0430"],normalized:"and"},matches:{primary:"\u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u0430\u0454",normalized:"matches"},exists:{primary:"\u0456\u0441\u043d\u0443\u0454",normalized:"exists"},is:{primary:"\u0454",normalized:"is"},no:{primary:"\u043d\u0456",normalized:"no"},end:{primary:"\u043a\u0456\u043d\u0435\u0446\u044c",normalized:"end"},js:{primary:"js",normalized:"js"},async:{primary:"\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e",alternatives:["async"],normalized:"async"},tell:{primary:"\u0441\u043a\u0430\u0437\u0430\u0442\u0438",alternatives:["\u0441\u043a\u0430\u0436\u0438"],normalized:"tell",form:"infinitive"},default:{primary:"\u0437\u0430_\u0437\u0430\u043c\u043e\u0432\u0447\u0443\u0432\u0430\u043d\u043d\u044f\u043c",normalized:"default"},init:{primary:"\u0456\u043d\u0456\u0446\u0456\u0430\u043b\u0456\u0437\u0443\u0432\u0430\u0442\u0438",alternatives:["\u0456\u043d\u0456\u0446\u0456\u0430\u043b\u0456\u0437\u0443\u0439"],normalized:"init",form:"infinitive"},behavior:{primary:"\u043f\u043e\u0432\u0435\u0434\u0456\u043d\u043a\u0430",normalized:"behavior"},install:{primary:"\u0456\u043d\u0441\u0442\u0430\u043b\u044e\u0432\u0430\u0442\u0438",normalized:"install",form:"infinitive"},measure:{primary:"\u0432\u0438\u043c\u0456\u0440\u044f\u0442\u0438",alternatives:["\u0432\u0438\u043c\u0456\u0440\u044f\u0439"],normalized:"measure",form:"infinitive"},beep:{primary:"\u0437\u0432\u0443\u043a",normalized:"beep"},break:{primary:"\u043f\u0435\u0440\u0435\u0440\u0432\u0430\u0442\u0438",normalized:"break"},copy:{primary:"\u043a\u043e\u043f\u0456\u044e\u0432\u0430\u0442\u0438",normalized:"copy"},exit:{primary:"\u0432\u0438\u0439\u0442\u0438",normalized:"exit"},pick:{primary:"\u0432\u0438\u0431\u0440\u0430\u0442\u0438",normalized:"pick"},render:{primary:"\u0432\u0456\u0434\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0438",normalized:"render"},into:{primary:"\u0432",alternatives:["\u0443"],normalized:"into"},before:{primary:"\u0434\u043e",alternatives:["\u043f\u0435\u0440\u0435\u0434"],normalized:"before"},after:{primary:"\u043f\u0456\u0441\u043b\u044f",normalized:"after"},until:{primary:"\u043f\u043e\u043a\u0438_\u043d\u0435",normalized:"until"},event:{primary:"\u043f\u043e\u0434\u0456\u044f",normalized:"event"},from:{primary:"\u0437",alternatives:["\u0432\u0456\u0434","\u0456\u0437"],normalized:"from"},connect:{primary:"\u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0438",alternatives:["\u0437\u02bc\u0454\u0434\u043d\u0430\u0442\u0438","\u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0438\u0441\u044f"],normalized:"connect"},stream:{primary:"\u0442\u0440\u0430\u043d\u0441\u043b\u044e\u0432\u0430\u0442\u0438",alternatives:["\u043f\u043e\u0442\u0456\u043a","\u0441\u0442\u0440\u0456\u043c"],normalized:"stream"},live:{primary:"\u043d\u0430\u0436\u0438\u0432\u043e",alternatives:["\u0443-\u043f\u0440\u044f\u043c\u043e\u043c\u0443-\u0435\u0444\u0456\u0440\u0456","\u0432-\u0440\u0435\u0436\u0438\u043c\u0456-\u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e-\u0447\u0430\u0441\u0443","\u0436\u0438\u0432\u0438\u0439"],normalized:"live"},socket:{primary:"\u0441\u043e\u043a\u0435\u0442",alternatives:["\u0433\u043d\u0456\u0437\u0434\u043e","websocket","socket"],normalized:"socket"},bind:{primary:"\u043f\u0440\u0438\u0432'\u044f\u0437\u0430\u0442\u0438",alternatives:["\u0437\u0432'\u044f\u0437\u0430\u0442\u0438","\u043f\u0440\u0438\u0454\u0434\u043d\u0430\u0442\u0438","bind"],normalized:"bind"},intercept:{primary:"\u043f\u0435\u0440\u0435\u0445\u043e\u043f\u0438\u0442\u0438",alternatives:["\u043f\u0435\u0440\u0435\u0445\u043e\u043f\u043b\u0435\u043d\u043d\u044f","intercept"],normalized:"intercept"},worker:{primary:"\u0440\u043e\u0431\u0456\u0442\u043d\u0438\u043a",alternatives:["\u0432\u043e\u0440\u043a\u0435\u0440","worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["\u0434\u0436\u0435\u0440\u0435\u043b\u043e-\u043f\u043e\u0434\u0456\u0439"],normalized:"eventsource"}},eventHandler:{keyword:{primary:"\u043f\u0440\u0438",normalized:"on"},sourceMarker:{primary:"\u043d\u0430",alternatives:["\u0432","\u043f\u0440\u0438"],position:"before"},eventMarker:{primary:"\u043f\u0440\u0438",position:"before"},temporalMarkers:["\u043a\u043e\u043b\u0438","\u044f\u043a\u0449\u043e"]}}}}),Uh={};Ad(Uh,{vietnameseProfile:()=>Kh});var Gh,Zh=Cd({"src/generators/profiles/vietnamese.ts"(){Kh={code:"vi",name:"Vietnamese",nativeName:"Ti\u1ebfng Vi\u1ec7t",direction:"ltr",script:"latin",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:!0,defaultVerbForm:"base",verb:{position:"start",subjectDrop:!0},references:{me:"t\u00f4i",it:"n\u00f3",you:"b\u1ea1n",result:"k\u1ebft qu\u1ea3",event:"s\u1ef1 ki\u1ec7n",target:"m\u1ee5c ti\u00eau",body:"body"},possessive:{marker:"c\u1ee7a",markerPosition:"between",specialForms:{me:"c\u1ee7a t\u00f4i",it:"c\u1ee7a n\u00f3",you:"c\u1ee7a b\u1ea1n"},keywords:{"c\u1ee7a t\u00f4i":"me",my:"me","c\u1ee7a b\u1ea1n":"you","c\u1ee7a anh":"you","c\u1ee7a ch\u1ecb":"you","c\u1ee7a n\u00f3":"it"}},roleMarkers:{destination:{primary:"v\u00e0o",alternatives:["cho","\u0111\u1ebfn"],position:"before"},source:{primary:"t\u1eeb",alternatives:["kh\u1ecfi"],position:"before"},patient:{primary:"",position:"before"},style:{primary:"v\u1edbi",position:"before"}},keywords:{toggle:{primary:"chuy\u1ec3n \u0111\u1ed5i",alternatives:["b\u1eadt t\u1eaft","chuy\u1ec3n"],normalized:"toggle"},add:{primary:"th\u00eam",alternatives:["b\u1ed5 sung"],normalized:"add"},remove:{primary:"x\u00f3a",alternatives:["g\u1ee1 b\u1ecf","lo\u1ea1i b\u1ecf","b\u1ecf"],normalized:"remove"},put:{primary:"\u0111\u1eb7t",alternatives:["\u0111\u1ec3","\u0111\u01b0a"],normalized:"put"},append:{primary:"n\u1ed1i",normalized:"append"},prepend:{primary:"th\u00eam v\u00e0o \u0111\u1ea7u",normalized:"prepend"},take:{primary:"l\u1ea5y",normalized:"take"},make:{primary:"t\u1ea1o",normalized:"make"},clone:{primary:"nh\u00e2n b\u1ea3n",normalized:"clone"},swap:{primary:"ho\u00e1n \u0111\u1ed5i",normalized:"swap"},morph:{primary:"bi\u1ebfn \u0111\u1ed5i",normalized:"morph"},set:{primary:"g\u00e1n",alternatives:["thi\u1ebft l\u1eadp"],normalized:"set"},get:{primary:"l\u1ea5y gi\u00e1 tr\u1ecb",alternatives:["nh\u1eadn"],normalized:"get"},increment:{primary:"t\u0103ng",alternatives:["t\u0103ng l\u00ean"],normalized:"increment"},decrement:{primary:"gi\u1ea3m",alternatives:["gi\u1ea3m \u0111i"],normalized:"decrement"},log:{primary:"in ra",normalized:"log"},show:{primary:"hi\u1ec3n th\u1ecb",alternatives:["hi\u1ec7n"],normalized:"show"},hide:{primary:"\u1ea9n",alternatives:["che","gi\u1ea5u"],normalized:"hide"},transition:{primary:"chuy\u1ec3n ti\u1ebfp",normalized:"transition"},on:{primary:"khi",alternatives:["tr\u00ean"],normalized:"on"},trigger:{primary:"k\u00edch ho\u1ea1t",normalized:"trigger"},send:{primary:"g\u1eedi",normalized:"send"},focus:{primary:"t\u1eadp trung",normalized:"focus"},blur:{primary:"m\u1ea5t t\u1eadp trung",normalized:"blur"},empty:{primary:"l\u00e0m-r\u1ed7ng",alternatives:["tr\u1ed1ng"],normalized:"empty"},open:{primary:"m\u1edf",normalized:"open"},close:{primary:"\u0111\u00f3ng",normalized:"close"},select:{primary:"\u0111\u00e1nh-d\u1ea5u",normalized:"select"},clear:{primary:"t\u1ea9y",normalized:"clear"},reset:{primary:"\u0111\u1eb7t-l\u1ea1i",normalized:"reset"},breakpoint:{primary:"\u0111i\u1ec3m-d\u1eebng",normalized:"breakpoint"},click:{primary:"nh\u1ea5p",alternatives:["b\u1ea5m"],normalized:"click"},hover:{primary:"di chu\u1ed9t",alternatives:["r\u00ea chu\u1ed9t"],normalized:"hover"},submit:{primary:"n\u1ed9p",alternatives:[],normalized:"submit"},input:{primary:"nh\u1eadp",alternatives:["nh\u1eadp li\u1ec7u"],normalized:"input"},change:{primary:"thay \u0111\u1ed5i",alternatives:["\u0111\u1ed5i"],normalized:"change"},go:{primary:"\u0111i \u0111\u1ebfn",alternatives:["\u0111i"],normalized:"go"},scroll:{primary:"cu\u1ed9n",normalized:"scroll"},push:{primary:"\u0111\u1ea9y",alternatives:["push"],normalized:"push"},replace:{primary:"thay_th\u1ebf",alternatives:["thay_the"],normalized:"replace"},process:{primary:"x\u1eed_l\u00fd",alternatives:["xu_ly"],normalized:"process"},wait:{primary:"ch\u1edd",alternatives:["\u0111\u1ee3i","ch\u1edd \u0111\u1ee3i"],normalized:"wait"},fetch:{primary:"t\u1ea3i",normalized:"fetch"},settle:{primary:"\u1ed5n \u0111\u1ecbnh",normalized:"settle"},if:{primary:"n\u1ebfu",normalized:"if"},unless:{primary:"tr\u1eeb khi",alternatives:["tr\u1eeb_khi"],normalized:"unless"},when:{primary:"l\u00fac",normalized:"when"},where:{primary:"\u1edf_\u0111\u00e2u",normalized:"where"},else:{primary:"kh\u00f4ng th\u00ec",alternatives:["n\u1ebfu kh\u00f4ng"],normalized:"else"},repeat:{primary:"l\u1eb7p l\u1ea1i",normalized:"repeat"},for:{primary:"v\u1edbi m\u1ed7i",normalized:"for"},while:{primary:"trong khi",normalized:"while"},forever:{primary:"m\u00e3i m\u00e3i",normalized:"forever",alternatives:["forever"]},continue:{primary:"ti\u1ebfp t\u1ee5c",normalized:"continue"},halt:{primary:"d\u1eebng",alternatives:["d\u1eebng l\u1ea1i"],normalized:"halt"},throw:{primary:"n\u00e9m",normalized:"throw"},call:{primary:"g\u1ecdi",normalized:"call"},return:{primary:"tr\u1ea3 v\u1ec1",normalized:"return"},then:{primary:"r\u1ed3i",alternatives:["sau \u0111\u00f3","th\u00ec"],normalized:"then"},and:{primary:"v\u00e0",normalized:"and"},matches:{primary:"kh\u1edbp",normalized:"matches"},end:{primary:"k\u1ebft th\u00fac",normalized:"end"},js:{primary:"js",normalized:"js"},async:{primary:"b\u1ea5t \u0111\u1ed3ng b\u1ed9",normalized:"async"},tell:{primary:"n\u00f3i v\u1edbi",normalized:"tell"},default:{primary:"m\u1eb7c \u0111\u1ecbnh",normalized:"default"},init:{primary:"kh\u1edfi t\u1ea1o",normalized:"init"},behavior:{primary:"h\u00e0nh vi",normalized:"behavior"},install:{primary:"c\u00e0i \u0111\u1eb7t",normalized:"install"},measure:{primary:"\u0111o l\u01b0\u1eddng",normalized:"measure"},beep:{primary:"beep",normalized:"beep"},break:{primary:"ng\u1eaft",normalized:"break"},copy:{primary:"sao ch\u00e9p",normalized:"copy"},exit:{primary:"tho\u00e1t",alternatives:["tho\u00e1t ra"],normalized:"exit"},pick:{primary:"ch\u1ecdn",normalized:"pick"},render:{primary:"k\u1ebft xu\u1ea5t",normalized:"render"},into:{primary:"v\u00e0o",alternatives:["v\u00e0o trong"],normalized:"into"},before:{primary:"tr\u01b0\u1edbc",alternatives:["tr\u01b0\u1edbc khi"],normalized:"before"},after:{primary:"sau",alternatives:["sau khi"],normalized:"after"},until:{primary:"cho \u0111\u1ebfn khi",normalized:"until"},event:{primary:"s\u1ef1 ki\u1ec7n",normalized:"event"},from:{primary:"t\u1eeb",alternatives:["kh\u1ecfi"],normalized:"from"},connect:{primary:"k\u1ebft-n\u1ed1i",alternatives:["k\u1ebft-n\u1ed1i-t\u1edbi"],normalized:"connect"},stream:{primary:"truy\u1ec1n-ph\u00e1t",alternatives:["ph\u00e1t","lu\u1ed3ng"],normalized:"stream"},live:{primary:"tr\u1ef1c-ti\u1ebfp",alternatives:["ph\u00e1t-tr\u1ef1c-ti\u1ebfp","live"],normalized:"live"},socket:{primary:"socket",alternatives:["\u1ed5-c\u1eafm","websocket"],normalized:"socket"},bind:{primary:"r\u00e0ng bu\u1ed9c",alternatives:["li\u00ean k\u1ebft","bind"],normalized:"bind"},intercept:{primary:"ch\u1eb7n",alternatives:["ch\u1eb7n b\u1eaft","intercept"],normalized:"intercept"},worker:{primary:"worker",alternatives:["c\u00f4ng nh\u00e2n"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["ngu\u1ed3n s\u1ef1 ki\u1ec7n"],normalized:"eventsource"}},eventHandler:{keyword:{primary:"khi",alternatives:["tr\u00ean"],normalized:"on"},sourceMarker:{primary:"tr\u00ean",alternatives:["t\u1ea1i"],position:"before"},eventMarker:{primary:"khi",alternatives:["l\u00fac"],position:"before"},temporalMarkers:["khi","l\u00fac"]}}}}),Yh={};Ad(Yh,{chineseProfile:()=>Gh});var Xh,Jh=Cd({"src/generators/profiles/chinese.ts"(){Gh={code:"zh",name:"Chinese",nativeName:"\u4e2d\u6587",regions:["east-asian","priority"],direction:"ltr",script:"cjk",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:!1,verb:{position:"second",subjectDrop:!0},references:{me:"\u6211",it:"\u5b83",you:"\u4f60",result:"\u7ed3\u679c",event:"\u4e8b\u4ef6",target:"\u76ee\u6807",body:"\u4e3b\u4f53",document:"\u6587\u6863",window:"\u7a97\u53e3",detail:"\u8be6\u60c5"},possessive:{marker:"\u7684",markerPosition:"between",keywords:{"\u6211\u7684":"me","\u4f60\u7684":"you","\u5b83\u7684":"it","\u4ed6\u7684":"it","\u5979\u7684":"it"}},roleMarkers:{destination:{primary:"\u5728",alternatives:["\u5230","\u4e8e"],position:"before"},source:{primary:"\u4ece",alternatives:["\u7531"],position:"before"},patient:{primary:"\u628a",position:"before"},style:{primary:"\u7528",alternatives:["\u4ee5"],position:"before"}},keywords:{toggle:{primary:"\u5207\u6362",normalized:"toggle"},add:{primary:"\u6dfb\u52a0",alternatives:["\u52a0"],normalized:"add"},remove:{primary:"\u79fb\u9664",alternatives:["\u5220\u9664","\u53bb\u6389"],normalized:"remove"},put:{primary:"\u653e\u7f6e",alternatives:["\u653e","\u653e\u5165"],normalized:"put"},append:{primary:"\u8ffd\u52a0",alternatives:["\u9644\u52a0"],normalized:"append"},prepend:{primary:"\u524d\u7f6e",alternatives:["\u9884\u7f6e"],normalized:"prepend"},take:{primary:"\u62ff\u53d6",normalized:"take"},make:{primary:"\u5236\u4f5c",normalized:"make"},clone:{primary:"\u514b\u9686",normalized:"clone"},swap:{primary:"\u4ea4\u6362",normalized:"swap"},morph:{primary:"\u53d8\u5f62",alternatives:["\u8f6c\u6362"],normalized:"morph"},set:{primary:"\u8bbe\u7f6e",alternatives:["\u8bbe\u5b9a"],normalized:"set"},get:{primary:"\u83b7\u53d6",alternatives:["\u83b7\u5f97","\u53d6\u5f97"],normalized:"get"},increment:{primary:"\u589e\u52a0",normalized:"increment"},decrement:{primary:"\u51cf\u5c11",normalized:"decrement"},log:{primary:"\u65e5\u5fd7",normalized:"log"},show:{primary:"\u663e\u793a",alternatives:["\u5c55\u793a"],normalized:"show"},hide:{primary:"\u9690\u85cf",normalized:"hide"},transition:{primary:"\u8fc7\u6e21",normalized:"transition"},on:{primary:"\u5f53",alternatives:["\u5728...\u65f6"],normalized:"on"},trigger:{primary:"\u89e6\u53d1",normalized:"trigger"},send:{primary:"\u53d1\u9001",normalized:"send"},focus:{primary:"\u805a\u7126",alternatives:["\u53d6\u5f97\u7126\u9ede"],normalized:"focus"},blur:{primary:"\u5931\u7126",alternatives:["\u5931\u53bb\u7126\u9ede"],normalized:"blur"},empty:{primary:"\u6e05\u7a7a",alternatives:["\u7a7a\u7684"],normalized:"empty"},open:{primary:"\u6253\u5f00",normalized:"open"},close:{primary:"\u5173\u95ed",normalized:"close"},select:{primary:"\u9009\u62e9",normalized:"select"},clear:{primary:"\u6e05\u9664",normalized:"clear"},reset:{primary:"\u91cd\u7f6e",normalized:"reset"},breakpoint:{primary:"\u65ad\u70b9",normalized:"breakpoint"},click:{primary:"\u70b9\u51fb",normalized:"click"},hover:{primary:"\u60ac\u505c",alternatives:["\u60ac\u6d6e"],normalized:"hover"},submit:{primary:"\u63d0\u4ea4",alternatives:["\u9001\u51fa"],normalized:"submit"},input:{primary:"\u8f93\u5165",normalized:"input"},change:{primary:"\u53d8\u5316",alternatives:["\u6539\u53d8"],normalized:"change"},go:{primary:"\u524d\u5f80",normalized:"go"},scroll:{primary:"\u6eda\u52a8",alternatives:["\u6372\u52d5"],normalized:"scroll"},push:{primary:"\u63a8\u9001",normalized:"push"},replace:{primary:"\u66ff\u6362",normalized:"replace"},process:{primary:"\u5904\u7406",normalized:"process"},wait:{primary:"\u7b49\u5f85",normalized:"wait"},fetch:{primary:"\u6293\u53d6",normalized:"fetch"},settle:{primary:"\u7a33\u5b9a",normalized:"settle"},if:{primary:"\u5982\u679c",normalized:"if"},unless:{primary:"\u9664\u975e",normalized:"unless"},when:{primary:"\u4f55\u65f6",normalized:"when"},where:{primary:"\u54ea\u91cc",normalized:"where"},else:{primary:"\u5426\u5219",normalized:"else"},matches:{primary:"\u5339\u914d",normalized:"matches"},repeat:{primary:"\u91cd\u590d",normalized:"repeat"},for:{primary:"\u4e3a",normalized:"for"},while:{primary:"\u6301\u7eed",normalized:"while"},continue:{primary:"\u7ee7\u7eed",normalized:"continue"},halt:{primary:"\u505c\u6b62",normalized:"halt"},throw:{primary:"\u629b\u51fa",normalized:"throw"},call:{primary:"\u8c03\u7528",normalized:"call"},return:{primary:"\u8fd4\u56de",normalized:"return"},then:{primary:"\u7136\u540e",alternatives:["\u63a5\u7740","\u90a3\u4e48"],normalized:"then"},and:{primary:"\u5e76\u4e14",alternatives:["\u548c","\u800c\u4e14"],normalized:"and"},exists:{primary:"\u5b58\u5728",normalized:"exists"},end:{primary:"\u7ed3\u675f",alternatives:["\u7ec8\u6b62","\u5b8c"],normalized:"end"},js:{primary:"JS\u6267\u884c",alternatives:["js"],normalized:"js"},async:{primary:"\u5f02\u6b65",normalized:"async"},tell:{primary:"\u544a\u8bc9",normalized:"tell"},default:{primary:"\u9ed8\u8ba4",normalized:"default"},init:{primary:"\u521d\u59cb\u5316",normalized:"init"},behavior:{primary:"\u884c\u4e3a",normalized:"behavior"},install:{primary:"\u5b89\u88c5",normalized:"install"},measure:{primary:"\u6d4b\u91cf",normalized:"measure"},beep:{primary:"\u8702\u9e23",normalized:"beep"},break:{primary:"\u4e2d\u65ad",normalized:"break"},copy:{primary:"\u590d\u5236",normalized:"copy"},exit:{primary:"\u9000\u51fa",normalized:"exit"},pick:{primary:"\u9009\u53d6",normalized:"pick"},render:{primary:"\u6e32\u67d3",normalized:"render"},into:{primary:"\u8fdb\u5165",normalized:"into"},before:{primary:"\u4e4b\u524d",normalized:"before"},after:{primary:"\u4e4b\u540e",normalized:"after"},until:{primary:"\u76f4\u5230",normalized:"until"},event:{primary:"\u4e8b\u4ef6",normalized:"event"},from:{primary:"\u4ece",normalized:"from"},connect:{primary:"\u8fde\u63a5",alternatives:["\u8fde\u63a5\u5668"],normalized:"connect"},stream:{primary:"\u6d41",alternatives:["\u6d41\u5f0f\u4f20\u8f93"],normalized:"stream"},live:{primary:"\u5b9e\u65f6",alternatives:["\u76f4\u64ad"],normalized:"live"},socket:{primary:"\u5957\u63a5\u5b57",alternatives:["websocket","socket"],normalized:"socket"},bind:{primary:"\u7ed1\u5b9a",alternatives:["bind"],normalized:"bind"},intercept:{primary:"\u62e6\u622a",alternatives:["intercept"],normalized:"intercept"},worker:{primary:"\u5de5\u4f5c\u7ebf\u7a0b",alternatives:["\u5de5\u4f5c\u8005","worker"],normalized:"worker"},eventsource:{primary:"eventsource",alternatives:["\u4e8b\u4ef6\u6e90"],normalized:"eventsource"}},tokenization:{boundaryStrategy:"character"},eventHandler:{keyword:{primary:"\u5f53",alternatives:["\u5728...\u65f6"],normalized:"on"},sourceMarker:{primary:"\u4ece",position:"before"},eventMarker:{primary:"\u5f53",alternatives:["\u5728"],position:"before"},temporalMarkers:["\u5f53","\u5728...\u65f6"]}}}});function Qh(e,t){const r=e.markerOverride?.[t.code],n=t.roleMarkers[e.role];if(void 0!==r){const i=function(e,t,r){const n=e.markerLegacy?.[t];if(!n?.length)return;const i=[...new Set(n)].filter(e=>e&&e!==r);return i.length?i:void 0}(e,t.code,r);return{primary:r,...i&&{alternatives:i},position:n?.position??"before",isOverride:!0}}if(n&&n.primary){const e={primary:n.primary,position:n.position,isOverride:!1};return n.alternatives&&(e.alternatives=n.alternatives),e}return null}function ey(e,t,r){const n=[...new Set([...e.markerLegacy?.[t]??[],...e.methodCarrier?[]:e.markerVariants?.[t]??[]])].filter(e=>e&&e!==r);return n.length?n:void 0}var ty,ry,ny=Cd({"src/parser/utils/marker-resolution.ts"(){Xh=new Set(["destination","source","patient","object","event","eventmarker","manner","instrument"])}});function iy(e,t,r,n){const i=ry.find(t=>t.lang===e);if(!i)return!1;const a=(e,t)=>(e??"").toLowerCase()===t.toLowerCase();return a(t,i.end)&&a(r,i.at)&&a(n,i.of)}function ay(){const e=(e,t)=>({id:"put-tr-"+e,language:"tr",command:"put",priority:105,template:{format:`{patient} ${t} {destination} i koy`,tokens:[{type:"role",role:"patient"},{type:"literal",value:t},{type:"role",role:"destination"},{type:"group",optional:!0,tokens:[{type:"literal",value:"i",alternatives:["\u0131","u","\u00fc","yi","y\u0131","yu","y\u00fc"]}]},{type:"literal",value:"koy",alternatives:["koymak"]}]},extraction:{patient:{position:0},destination:{position:2},manner:{default:{type:"literal",value:e}}}});return[e("before","\u00f6nce"),e("after","sonra")]}function oy(e){const t=function(e){const t=ty.find(t=>t.lang===e);return t?["before","after"].map(e=>{const r=t[e],n=[t.verbAlts?{type:"literal",value:t.verb,alternatives:t.verbAlts}:{type:"literal",value:t.verb}];return t.patientPrefix&&n.push(t.patientPrefixOptional?{type:"group",optional:!0,tokens:[{type:"literal",value:t.patientPrefix}]}:{type:"literal",value:t.patientPrefix}),n.push({type:"role",role:"patient"},{type:"literal",value:r},{type:"role",role:"destination"}),{id:`put-${t.lang}-${e}`,language:t.lang,command:"put",priority:95,template:{format:`${t.verb} {patient} ${r} {destination}`,tokens:n},extraction:{patient:{position:t.patientPrefix&&!t.patientPrefixOptional?2:1},destination:{marker:r},manner:{default:{type:"literal",value:e}}}}}):[]}(e),r=function(e){const t=ry.find(t=>t.lang===e);if(!t)return[];const r=[],n=t.verbAlts?{type:"literal",value:t.verb,alternatives:t.verbAlts}:{type:"literal",value:t.verb},i=e=>{r.push({type:"literal",value:e})};return t.sov?(r.push({type:"role",role:"patient"}),i(t.at),i(t.end),i(t.of),r.push({type:"role",role:"destination"}),t.objMarker&&r.push({type:"literal",value:t.objMarker}),r.push(n)):(r.push(n),t.patientPrefix&&r.push({type:"literal",value:t.patientPrefix}),r.push({type:"role",role:"patient"}),i(t.at),i(t.end),i(t.of),r.push({type:"role",role:"destination"})),[{id:`put-${t.lang}-at-end`,language:t.lang,command:"put",priority:110,template:{format:`put {patient} ${t.at} ${t.end} ${t.of} {destination}`,tokens:r},extraction:{manner:{default:{type:"literal",value:"at end of"}}}}]}(e);switch(e){case"bn":return[{id:"put-bn-before",language:"bn",command:"put",priority:105,template:{format:"{patient} before {destination} \u0995\u09c7 \u09b0\u09be\u0996\u09c1\u09a8",tokens:[{type:"role",role:"patient"},{type:"literal",value:"before"},{type:"role",role:"destination"},{type:"literal",value:"\u0995\u09c7"},{type:"literal",value:"\u09b0\u09be\u0996\u09c1\u09a8",alternatives:["\u09b0\u09be\u0996"]}]},extraction:{patient:{position:0},destination:{marker:"before"},manner:{default:{type:"literal",value:"before"}}}},{id:"put-bn-after",language:"bn",command:"put",priority:105,template:{format:"{patient} after {destination} \u0995\u09c7 \u09b0\u09be\u0996\u09c1\u09a8",tokens:[{type:"role",role:"patient"},{type:"literal",value:"after"},{type:"role",role:"destination"},{type:"literal",value:"\u0995\u09c7"},{type:"literal",value:"\u09b0\u09be\u0996\u09c1\u09a8",alternatives:["\u09b0\u09be\u0996"]}]},extraction:{patient:{position:0},destination:{marker:"after"},manner:{default:{type:"literal",value:"after"}}}},{id:"put-bn-full",language:"bn",command:"put",priority:100,template:{format:"{patient} \u0995\u09c7 {destination} \u098f \u09b0\u09be\u0996\u09c1\u09a8",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0995\u09c7"},{type:"role",role:"destination"},{type:"literal",value:"\u098f",alternatives:["\u09a4\u09c7"]},{type:"literal",value:"\u09b0\u09be\u0996\u09c1\u09a8",alternatives:["\u09b0\u09be\u0996"]}]},extraction:{patient:{position:0},destination:{marker:"\u098f",position:2}}},{id:"put-bn-simple",language:"bn",command:"put",priority:90,template:{format:"\u09b0\u09be\u0996\u09c1\u09a8 {patient} {destination} \u098f",tokens:[{type:"literal",value:"\u09b0\u09be\u0996\u09c1\u09a8",alternatives:["\u09b0\u09be\u0996"]},{type:"role",role:"patient"},{type:"role",role:"destination"},{type:"literal",value:"\u098f",alternatives:["\u09a4\u09c7"]}]},extraction:{patient:{position:1},destination:{position:2}}},...r];case"en":return[{id:"put-en-into",language:"en",command:"put",priority:100,template:{format:"put {patient} into {destination}",tokens:[{type:"literal",value:"put"},{type:"role",role:"patient"},{type:"literal",value:"into",alternatives:["in","to"]},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"into",markerAlternatives:["in","to"]}}},{id:"put-en-before",language:"en",command:"put",priority:95,template:{format:"put {patient} before {destination}",tokens:[{type:"literal",value:"put"},{type:"role",role:"patient"},{type:"literal",value:"before"},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"before"},manner:{default:{type:"literal",value:"before"}}}},{id:"put-en-after",language:"en",command:"put",priority:95,template:{format:"put {patient} after {destination}",tokens:[{type:"literal",value:"put"},{type:"role",role:"patient"},{type:"literal",value:"after"},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"after"},manner:{default:{type:"literal",value:"after"}}}},{id:"put-en-at-end",language:"en",command:"put",priority:96,template:{format:"put {patient} at end of {destination}",tokens:[{type:"literal",value:"put"},{type:"role",role:"patient"},{type:"literal",value:"at"},{type:"literal",value:"end"},{type:"literal",value:"of"},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{position:5},manner:{default:{type:"literal",value:"at end of"}}}},{id:"put-en-at-start",language:"en",command:"put",priority:96,template:{format:"put {patient} at start of {destination}",tokens:[{type:"literal",value:"put"},{type:"role",role:"patient"},{type:"literal",value:"at"},{type:"literal",value:"start"},{type:"literal",value:"of"},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{position:5},manner:{default:{type:"literal",value:"at start of"}}}}];case"es":return[{id:"put-es-full",language:"es",command:"put",priority:100,template:{format:"poner {patient} en {destination}",tokens:[{type:"literal",value:"poner",alternatives:["pon","colocar","put"]},{type:"role",role:"patient"},{type:"literal",value:"en",alternatives:["dentro de","a"]},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"en",markerAlternatives:["dentro de","a"]}}},{id:"put-es-before",language:"es",command:"put",priority:95,template:{format:"poner {patient} antes de {destination}",tokens:[{type:"literal",value:"poner",alternatives:["pon","colocar"]},{type:"role",role:"patient"},{type:"literal",value:"antes de",alternatives:["antes"]},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"antes de",markerAlternatives:["antes"]},manner:{default:{type:"literal",value:"before"}}}},{id:"put-es-after",language:"es",command:"put",priority:95,template:{format:"poner {patient} despu\u00e9s de {destination}",tokens:[{type:"literal",value:"poner",alternatives:["pon","colocar"]},{type:"role",role:"patient"},{type:"literal",value:"despu\u00e9s de",alternatives:["despues de","despu\u00e9s"]},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"despu\u00e9s de",markerAlternatives:["despues de","despu\u00e9s"]},manner:{default:{type:"literal",value:"after"}}}},...r];case"hi":return[{id:"put-hi-before",language:"hi",command:"put",priority:106,template:{format:"{patient} before {destination} \u0915\u094b \u0930\u0916\u0947\u0902",tokens:[{type:"role",role:"patient"},{type:"literal",value:"before"},{type:"role",role:"destination"},{type:"literal",value:"\u0915\u094b"},{type:"literal",value:"\u0930\u0916\u0947\u0902",alternatives:["\u0930\u0916","\u0921\u093e\u0932\u0947\u0902","\u0921\u093e\u0932"]}]},extraction:{patient:{position:0},destination:{marker:"before"},manner:{default:{type:"literal",value:"before"}}}},{id:"put-hi-after",language:"hi",command:"put",priority:106,template:{format:"{patient} after {destination} \u0915\u094b \u0930\u0916\u0947\u0902",tokens:[{type:"role",role:"patient"},{type:"literal",value:"after"},{type:"role",role:"destination"},{type:"literal",value:"\u0915\u094b"},{type:"literal",value:"\u0930\u0916\u0947\u0902",alternatives:["\u0930\u0916","\u0921\u093e\u0932\u0947\u0902","\u0921\u093e\u0932"]}]},extraction:{patient:{position:0},destination:{marker:"after"},manner:{default:{type:"literal",value:"after"}}}},{id:"put-hi-verb-medial",language:"hi",command:"put",priority:105,template:{format:"{patient} \u0915\u094b \u0930\u0916\u0947\u0902 {destination} \u092e\u0947\u0902",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0915\u094b"},{type:"literal",value:"\u0930\u0916\u0947\u0902",alternatives:["\u0930\u0916","\u0921\u093e\u0932\u0947\u0902","\u0921\u093e\u0932"]},{type:"role",role:"destination"},{type:"literal",value:"\u092e\u0947\u0902"}]},extraction:{patient:{position:0},destination:{marker:"\u092e\u0947\u0902",position:3}}},{id:"put-hi-full",language:"hi",command:"put",priority:100,template:{format:"{patient} \u0915\u094b {destination} \u092e\u0947\u0902 \u0930\u0916\u0947\u0902",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0915\u094b"},{type:"role",role:"destination"},{type:"literal",value:"\u092e\u0947\u0902"},{type:"literal",value:"\u0930\u0916\u0947\u0902",alternatives:["\u0930\u0916","\u0921\u093e\u0932\u0947\u0902","\u0921\u093e\u0932"]}]},extraction:{patient:{position:0},destination:{marker:"\u092e\u0947\u0902",position:3}}},{id:"put-hi-simple",language:"hi",command:"put",priority:90,template:{format:"{patient} \u0930\u0916\u0947\u0902",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0930\u0916\u0947\u0902",alternatives:["\u0930\u0916","\u0921\u093e\u0932\u0947\u0902","\u0921\u093e\u0932"]}]},extraction:{patient:{position:0},destination:{default:{type:"reference",value:"me"}}}},{id:"put-hi-bare",language:"hi",command:"put",priority:80,template:{format:"\u0930\u0916\u0947\u0902 {patient}",tokens:[{type:"literal",value:"\u0930\u0916\u0947\u0902",alternatives:["\u0930\u0916","\u0921\u093e\u0932\u0947\u0902","\u0921\u093e\u0932"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},destination:{default:{type:"reference",value:"me"}}}},...r];case"id":return[{id:"put-id-full",language:"id",command:"put",priority:100,template:{format:"taruh {patient} ke dalam {destination}",tokens:[{type:"literal",value:"taruh",alternatives:["letakkan","masukkan","tempatkan","put"]},{type:"role",role:"patient",expectedTypes:["literal","selector","reference","expression"]},{type:"literal",value:"ke"},{type:"literal",value:"dalam",alternatives:["di"]},{type:"role",role:"destination",expectedTypes:["selector","reference"]}]},extraction:{patient:{position:1},destination:{position:4}}},{id:"put-id-simple-ke",language:"id",command:"put",priority:95,template:{format:"taruh {patient} ke {destination}",tokens:[{type:"literal",value:"taruh",alternatives:["letakkan","masukkan","tempatkan"]},{type:"role",role:"patient",expectedTypes:["literal","selector","reference","expression"]},{type:"literal",value:"ke",alternatives:["di","pada"]},{type:"role",role:"destination",expectedTypes:["selector","reference"]}]},extraction:{patient:{position:1},destination:{position:3}}},{id:"put-id-di",language:"id",command:"put",priority:90,template:{format:"taruh {patient} di {destination}",tokens:[{type:"literal",value:"taruh",alternatives:["letakkan","masukkan"]},{type:"role",role:"patient",expectedTypes:["literal","selector","reference","expression"]},{type:"literal",value:"di"},{type:"role",role:"destination",expectedTypes:["selector","reference"]}]},extraction:{patient:{position:1},destination:{position:3}}},...t,...r];case"it":return[{id:"put-it-full",language:"it",command:"put",priority:100,template:{format:"mettere {patient} in {target}",tokens:[{type:"literal",value:"mettere",alternatives:["metti","inserire","put"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"in",alternatives:["dentro","nel"]},{type:"role",role:"destination"}]}]},extraction:{patient:{position:1},destination:{marker:"in",markerAlternatives:["dentro","nel"]}}},{id:"put-it-before",language:"it",command:"put",priority:105,template:{format:"mettere {patient} prima {target}",tokens:[{type:"literal",value:"mettere",alternatives:["metti","inserire","put"]},{type:"role",role:"patient"},{type:"literal",value:"prima"},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"prima"},manner:{default:{type:"literal",value:"before"}}}},{id:"put-it-after",language:"it",command:"put",priority:105,template:{format:"mettere {patient} dopo {target}",tokens:[{type:"literal",value:"mettere",alternatives:["metti","inserire","put"]},{type:"role",role:"patient"},{type:"literal",value:"dopo"},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"dopo"},manner:{default:{type:"literal",value:"after"}}}},{id:"put-it-simple",language:"it",command:"put",priority:90,template:{format:"mettere {patient}",tokens:[{type:"literal",value:"mettere",alternatives:["metti","inserire","put"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}},...r];case"ja":return[...["before","after"].map(e=>{const t="before"===e?"\u524d\u306b":"\u5f8c\u306b";return{id:"put-ja-"+e,language:"ja",command:"put",priority:105,template:{format:`{patient} ${t} {destination} \u3092 \u7f6e\u304f`,tokens:[{type:"role",role:"patient"},{type:"literal",value:t,alternatives:["before"===e?"\u524d":"\u5f8c"]},{type:"role",role:"destination"},{type:"literal",value:"\u3092"},{type:"literal",value:"\u7f6e\u304f",alternatives:["\u5165\u308c\u308b"]}]},extraction:{patient:{position:0},destination:{position:2},manner:{default:{type:"literal",value:e}}}}}),...r];case"ko":return[...["before","after"].map(e=>{const t="before"===e?"\uc804\uc5d0":"\ud6c4\uc5d0";return{id:"put-ko-"+e,language:"ko",command:"put",priority:105,template:{format:`{patient} ${t} {destination} \ub97c \ub123\ub2e4`,tokens:[{type:"role",role:"patient"},{type:"literal",value:t},{type:"role",role:"destination"},{type:"literal",value:"\ub97c",alternatives:["\uc744"]},{type:"literal",value:"\ub123\ub2e4",alternatives:["\ub123\uae30","\ub193\uae30"]}]},extraction:{patient:{position:0},destination:{position:2},manner:{default:{type:"literal",value:e}}}}}),...r];case"tr":return[...ay(),...r];case"pl":return[{id:"put-pl-full",language:"pl",command:"put",priority:100,template:{format:"umie\u015b\u0107 {patient} w {destination}",tokens:[{type:"literal",value:"umie\u015b\u0107",alternatives:["umiesc","wstaw","w\u0142\u00f3\u017c","wloz"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"w",alternatives:["do","na"]},{type:"role",role:"destination"}]}]},extraction:{patient:{position:1},destination:{marker:"w",markerAlternatives:["do","na"]}}},{id:"put-pl-before",language:"pl",command:"put",priority:105,template:{format:"umie\u015b\u0107 {patient} przed {destination}",tokens:[{type:"literal",value:"umie\u015b\u0107",alternatives:["umiesc","wstaw"]},{type:"role",role:"patient"},{type:"literal",value:"przed"},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"przed"},manner:{default:{type:"literal",value:"before"}}}},{id:"put-pl-after",language:"pl",command:"put",priority:105,template:{format:"umie\u015b\u0107 {patient} po {destination}",tokens:[{type:"literal",value:"umie\u015b\u0107",alternatives:["umiesc","wstaw"]},{type:"role",role:"patient"},{type:"literal",value:"po"},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"po"},manner:{default:{type:"literal",value:"after"}}}},...r];case"ru":return[{id:"put-ru-full",language:"ru",command:"put",priority:100,template:{format:"\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c {patient} \u0432 {destination}",tokens:[{type:"literal",value:"\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c",alternatives:["\u043f\u043e\u043b\u043e\u0436\u0438","\u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c","\u043f\u043e\u043c\u0435\u0441\u0442\u0438","\u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c","\u0432\u0441\u0442\u0430\u0432\u044c"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0432",alternatives:["\u0432\u043e","\u043d\u0430"]},{type:"role",role:"destination"}]}]},extraction:{patient:{position:1},destination:{marker:"\u0432",markerAlternatives:["\u0432\u043e","\u043d\u0430"]}}},{id:"put-ru-before",language:"ru",command:"put",priority:105,template:{format:"\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c {patient} \u043f\u0435\u0440\u0435\u0434 {destination}",tokens:[{type:"literal",value:"\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c",alternatives:["\u043f\u043e\u043b\u043e\u0436\u0438","\u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c","\u043f\u043e\u043c\u0435\u0441\u0442\u0438"]},{type:"role",role:"patient"},{type:"literal",value:"\u043f\u0435\u0440\u0435\u0434",alternatives:["\u0434\u043e"]},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"\u043f\u0435\u0440\u0435\u0434",markerAlternatives:["\u0434\u043e"]},manner:{default:{type:"literal",value:"before"}}}},{id:"put-ru-after",language:"ru",command:"put",priority:105,template:{format:"\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c {patient} \u043f\u043e\u0441\u043b\u0435 {destination}",tokens:[{type:"literal",value:"\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c",alternatives:["\u043f\u043e\u043b\u043e\u0436\u0438","\u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c","\u043f\u043e\u043c\u0435\u0441\u0442\u0438"]},{type:"role",role:"patient"},{type:"literal",value:"\u043f\u043e\u0441\u043b\u0435"},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"\u043f\u043e\u0441\u043b\u0435"},manner:{default:{type:"literal",value:"after"}}}},...r];case"qu":return[...["before","after"].map(e=>{const t="before"===e?"\u00f1awpaqpi":"qhepapi";return{id:"put-qu-"+e,language:"qu",command:"put",priority:105,template:{format:`{patient} ${t} {destination} ta churay`,tokens:[{type:"role",role:"patient"},{type:"literal",value:t,alternatives:[e]},{type:"role",role:"destination"},{type:"group",optional:!0,tokens:[{type:"literal",value:"ta"}]},{type:"literal",value:"churay",alternatives:["tiyachiy"]}]},extraction:{patient:{position:0},destination:{position:2},manner:{default:{type:"literal",value:e}}}}}),{id:"put-qu-patient-first",language:"qu",command:"put",priority:96,template:{format:"{patient} ta {destination} man churay",tokens:[{type:"role",role:"patient"},{type:"literal",value:"ta"},{type:"role",role:"destination"},{type:"literal",value:"man"},{type:"literal",value:"churay",alternatives:["tiyachiy"]}]},extraction:{patient:{position:0},destination:{position:2}}},...r];case"th":return[{id:"put-th-full",language:"th",command:"put",priority:100,template:{format:"\u0e43\u0e2a\u0e48 {patient} \u0e43\u0e19 {destination}",tokens:[{type:"literal",value:"\u0e43\u0e2a\u0e48",alternatives:["\u0e27\u0e32\u0e07"]},{type:"role",role:"patient"},{type:"literal",value:"\u0e43\u0e19"},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"\u0e43\u0e19",position:3}}},{id:"put-th-before",language:"th",command:"put",priority:105,template:{format:"\u0e43\u0e2a\u0e48 {patient} \u0e01\u0e48\u0e2d\u0e19 {destination}",tokens:[{type:"literal",value:"\u0e43\u0e2a\u0e48",alternatives:["\u0e27\u0e32\u0e07"]},{type:"role",role:"patient"},{type:"literal",value:"\u0e01\u0e48\u0e2d\u0e19"},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"\u0e01\u0e48\u0e2d\u0e19"},manner:{default:{type:"literal",value:"before"}}}},{id:"put-th-after",language:"th",command:"put",priority:105,template:{format:"\u0e43\u0e2a\u0e48 {patient} \u0e2b\u0e25\u0e31\u0e07 {destination}",tokens:[{type:"literal",value:"\u0e43\u0e2a\u0e48",alternatives:["\u0e27\u0e32\u0e07"]},{type:"role",role:"patient"},{type:"literal",value:"\u0e2b\u0e25\u0e31\u0e07"},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"\u0e2b\u0e25\u0e31\u0e07"},manner:{default:{type:"literal",value:"after"}}}},...r];case"uk":return[{id:"put-uk-full",language:"uk",command:"put",priority:100,template:{format:"\u043f\u043e\u043a\u043b\u0430\u0441\u0442\u0438 {patient} \u0432 {destination}",tokens:[{type:"literal",value:"\u043f\u043e\u043a\u043b\u0430\u0441\u0442\u0438",alternatives:["\u043f\u043e\u043a\u043b\u0430\u0434\u0438","\u043f\u043e\u043c\u0456\u0441\u0442\u0438\u0442\u0438","\u043f\u043e\u043c\u0456\u0441\u0442\u0438","\u0432\u0441\u0442\u0430\u0432\u0438\u0442\u0438","\u0432\u0441\u0442\u0430\u0432"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0432",alternatives:["\u0443","\u043d\u0430"]},{type:"role",role:"destination"}]}]},extraction:{patient:{position:1},destination:{marker:"\u0432",markerAlternatives:["\u0443","\u043d\u0430"]}}},{id:"put-uk-before",language:"uk",command:"put",priority:95,template:{format:"\u043f\u043e\u043a\u043b\u0430\u0441\u0442\u0438 {patient} \u043f\u0435\u0440\u0435\u0434 {destination}",tokens:[{type:"literal",value:"\u043f\u043e\u043a\u043b\u0430\u0441\u0442\u0438",alternatives:["\u043f\u043e\u043a\u043b\u0430\u0434\u0438","\u043f\u043e\u043c\u0456\u0441\u0442\u0438\u0442\u0438","\u043f\u043e\u043c\u0456\u0441\u0442\u0438"]},{type:"role",role:"patient"},{type:"literal",value:"\u043f\u0435\u0440\u0435\u0434",alternatives:["\u0434\u043e"]},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"\u043f\u0435\u0440\u0435\u0434",markerAlternatives:["\u0434\u043e"]},manner:{default:{type:"literal",value:"before"}}}},{id:"put-uk-after",language:"uk",command:"put",priority:95,template:{format:"\u043f\u043e\u043a\u043b\u0430\u0441\u0442\u0438 {patient} \u043f\u0456\u0441\u043b\u044f {destination}",tokens:[{type:"literal",value:"\u043f\u043e\u043a\u043b\u0430\u0441\u0442\u0438",alternatives:["\u043f\u043e\u043a\u043b\u0430\u0434\u0438","\u043f\u043e\u043c\u0456\u0441\u0442\u0438\u0442\u0438","\u043f\u043e\u043c\u0456\u0441\u0442\u0438"]},{type:"role",role:"patient"},{type:"literal",value:"\u043f\u0456\u0441\u043b\u044f"},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"\u043f\u0456\u0441\u043b\u044f"},manner:{default:{type:"literal",value:"after"}}}},...r];case"vi":return[{id:"put-vi-into",language:"vi",command:"put",priority:100,template:{format:"\u0111\u1eb7t {patient} v\u00e0o {target}",tokens:[{type:"literal",value:"\u0111\u1eb7t",alternatives:["\u0111\u1ec3","\u0111\u01b0a"]},{type:"role",role:"patient"},{type:"literal",value:"v\u00e0o",alternatives:["v\u00e0o trong"]},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"v\u00e0o",markerAlternatives:["v\u00e0o trong"]}}},{id:"put-vi-before",language:"vi",command:"put",priority:105,template:{format:"\u0111\u1eb7t {patient} tr\u01b0\u1edbc {target}",tokens:[{type:"literal",value:"\u0111\u1eb7t",alternatives:["\u0111\u1ec3","\u0111\u01b0a"]},{type:"role",role:"patient"},{type:"literal",value:"tr\u01b0\u1edbc",alternatives:["tr\u01b0\u1edbc khi"]},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"tr\u01b0\u1edbc",markerAlternatives:["tr\u01b0\u1edbc khi"]},manner:{default:{type:"literal",value:"before"}}}},{id:"put-vi-after",language:"vi",command:"put",priority:105,template:{format:"\u0111\u1eb7t {patient} sau {target}",tokens:[{type:"literal",value:"\u0111\u1eb7t",alternatives:["\u0111\u1ec3","\u0111\u01b0a"]},{type:"role",role:"patient"},{type:"literal",value:"sau",alternatives:["sau khi"]},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"sau",markerAlternatives:["sau khi"]},manner:{default:{type:"literal",value:"after"}}}},...r];case"zh":return[{id:"put-zh-full",language:"zh",command:"put",priority:100,template:{format:"\u653e\u7f6e {patient} \u5230 {destination}",tokens:[{type:"literal",value:"\u653e\u7f6e",alternatives:["\u653e","\u653e\u5165","\u7f6e\u5165","put"]},{type:"role",role:"patient",expectedTypes:["literal","selector","reference","expression"]},{type:"literal",value:"\u5230",alternatives:["\u5728","\u4e8e","\u5165"]},{type:"role",role:"destination",expectedTypes:["selector","reference"]}]},extraction:{patient:{position:1},destination:{position:3}}},{id:"put-zh-ba",language:"zh",command:"put",priority:95,template:{format:"\u628a {patient} \u653e\u7f6e \u5230 {destination}",tokens:[{type:"literal",value:"\u628a"},{type:"role",role:"patient",expectedTypes:["literal","selector","reference","expression"]},{type:"literal",value:"\u653e\u7f6e",alternatives:["\u653e\u5230","\u653e\u5728","\u653e\u5165","\u653e","\u7f6e\u5165"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u5230",alternatives:["\u5728","\u4e8e","\u5165"]}]},{type:"role",role:"destination",expectedTypes:["selector","reference"]}]},extraction:{patient:{position:1},destination:{marker:"\u5230",markerAlternatives:["\u5728","\u4e8e","\u5165"]}}},...t,...r];default:return[...t,...r]}}var sy,ly,cy,uy=Cd({"src/patterns/put.ts"(){ty=[{lang:"de",verb:"setzen",before:"vor",after:"nach"},{lang:"fr",verb:"mettre",before:"avant",after:"apr\u00e8s"},{lang:"he",verb:"\u05e9\u05d9\u05dd",patientPrefix:"\u05d0\u05ea",before:"\u05dc\u05e4\u05e0\u05d9",after:"\u05d0\u05d7\u05e8\u05d9"},{lang:"id",verb:"taruh",verbAlts:["letakkan","masukkan","tempatkan"],before:"sebelum",after:"setelah"},{lang:"ms",verb:"letak",before:"sebelum",after:"selepas"},{lang:"pt",verb:"colocar",before:"antes",after:"depois"},{lang:"sw",verb:"weka",before:"kabla",after:"baada"},{lang:"zh",verb:"\u653e\u7f6e",verbAlts:["\u653e","\u653e\u5165"],patientPrefix:"\u628a",patientPrefixOptional:!0,before:"\u4e4b\u524d",after:"\u4e4b\u540e"}],ry=[{lang:"es",verb:"poner",verbAlts:["pon","colocar","put"],at:"en",end:"fin",of:"de"},{lang:"fr",verb:"mettre",at:"\u00e0",end:"fin",of:"de"},{lang:"pt",verb:"colocar",at:"em",end:"fim",of:"de"},{lang:"it",verb:"mettere",at:"a",end:"fine",of:"di"},{lang:"de",verb:"setzen",at:"bei",end:"ende",of:"von"},{lang:"sw",verb:"weka",at:"katika",end:"mwisho",of:"ya"},{lang:"id",verb:"taruh",verbAlts:["letakkan","masukkan","tempatkan"],at:"di",end:"akhir",of:"dari"},{lang:"ms",verb:"letak",at:"di",end:"tamat",of:"daripada"},{lang:"vi",verb:"\u0111\u1eb7t",at:"t\u1ea1i",end:"k\u1ebft th\u00fac",of:"c\u1ee7a"},{lang:"pl",verb:"umie\u015b\u0107",at:"przy",end:"koniec",of:"z"},{lang:"ru",verb:"\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c",at:"\u0443",end:"\u043a\u043e\u043d\u0435\u0446",of:"\u0438\u0437"},{lang:"uk",verb:"\u043f\u043e\u043a\u043b\u0430\u0441\u0442\u0438",at:"\u0432",end:"\u043a\u0456\u043d\u0435\u0446\u044c",of:"\u0437"},{lang:"th",verb:"\u0e43\u0e2a\u0e48",at:"\u0e17\u0e35\u0e48",end:"\u0e08\u0e1a",of:"\u0e02\u0e2d\u0e07"},{lang:"tl",verb:"ilagay",at:"sa",end:"wakas",of:"ng"},{lang:"ar",verb:"\u0636\u0639",at:"\u0639\u0646\u062f",end:"\u0627\u0644\u0646\u0647\u0627\u064a\u0629",of:"\u0645\u0646"},{lang:"zh",verb:"\u653e\u7f6e",verbAlts:["\u653e","\u653e\u5165"],patientPrefix:"\u628a",at:"\u5728",end:"\u7ed3\u675f",of:"\u7684"},{lang:"he",verb:"\u05e9\u05d9\u05dd",patientPrefix:"\u05d0\u05ea",at:"at",end:"\u05e1\u05d5\u05e3",of:"of"},{lang:"tr",verb:"koy",sov:!0,objMarker:"i",at:"de",end:"son",of:"nin"},{lang:"ja",verb:"\u7f6e\u304f",sov:!0,objMarker:"\u3092",at:"\u3067",end:"\u7d42\u308f\u308a",of:"\u306e"},{lang:"ko",verb:"\ub123\ub2e4",sov:!0,objMarker:"\ub97c",at:"\uc5d0",end:"\ub05d",of:"\uc758"},{lang:"hi",verb:"\u0930\u0916\u0947\u0902",verbAlts:["\u0930\u0916","\u0921\u093e\u0932\u0947\u0902","\u0921\u093e\u0932"],sov:!0,objMarker:"\u0915\u094b",at:"\u092a\u0930",end:"\u0938\u092e\u093e\u092a\u094d\u0924",of:"\u0915\u093e"},{lang:"bn",verb:"\u09b0\u09be\u0996\u09c1\u09a8",verbAlts:["\u09b0\u09be\u0996"],sov:!0,objMarker:"\u0995\u09c7",at:"\u098f",end:"\u09b6\u09c7\u09b7",of:"\u09b0"},{lang:"qu",verb:"churay",sov:!0,objMarker:"ta",at:"pi",end:"tukuy",of:"pa"}]}}),py=Cd({"src/tokenizers/token-utils.ts"(){}}),dy=Cd({"src/tokenizers/char-classifiers.ts"(){}}),my=Cd({"src/tokenizers/base-tokenizer.ts"(){}}),fy=Cd({"src/tokenizers/base.ts"(){py(),dy(),my()}});var hy,yy=Cd({"src/tokenizers/generic-extractors.ts"(){sy=["===","!==","->","==","!=","<=",">=","&&","||","**","+=","-=","*=","/=","+","-","*","/","=",">","<","!","&","|","%","^","~"],ly=class{constructor(e=sy){this.name="operator",this.operators=[...e].sort((e,t)=>t.length-e.length)}canExtract(e,t){return this.operators.some(r=>e.startsWith(r,t))}extract(e,t){for(const r of this.operators)if(e.startsWith(r,t))return{value:r,length:r.length};return null}},cy=class{constructor(e="()[]{},:;"){this.punctuation=e,this.name="punctuation"}canExtract(e,t){return this.punctuation.includes(e[t])}extract(e,t){const r=e[t];return this.punctuation.includes(r)?{value:r,length:1}:null}}}});function vy(e,t){let r=t;for(;e.length>r&&":"===e[r];){const t=e.slice(r).match(/^::?[a-zA-Z][a-zA-Z0-9-]*/);if(!t)break;let n=r+t[0].length;if("("===e[n]){let t=0,r=n;for(;e.length>r;){if("("===e[r])t++;else if(")"===e[r]&&(t--,0===t)){r++;break}r++}if(0!==t)break;n=r}r=n}return r}function gy(e,t){const r=e[t];if("#"===r){const r=e.slice(t).match(/^#[a-zA-Z_][\w-]*/);if(!r)return null;const n=vy(e,t+r[0].length);return e.slice(t,n)}if("."===r){const r=e.slice(t).match(/^\.\{[a-zA-Z_$][\w$]*\}/);if(r)return r[0];const n=e.slice(t).match(/^\.[a-zA-Z_][\w-]*/);if(!n)return null;const i=vy(e,t+n[0].length);return e.slice(t,i)}if("@"===r){const r=e.slice(t).match(/^@[a-zA-Z_][\w-]*/);return r?r[0]:null}if("*"===r){const r=e.slice(t).match(/^\*(?:--)?[a-zA-Z_][\w-]*/);return r?r[0]:null}if("["===r){let r=0,n=t;for(;e.length>n;){if("["===e[n]&&r++,"]"===e[n]&&(r--,0===r)){const r=vy(e,n+1);return e.slice(t,r)}n++}return null}if("<"===r){const r=e.slice(t).match(/^<(?=[\w.#[])[\w-]*(?:[#.][\w-]+|\[[^\]]+\]|::?[a-zA-Z][a-zA-Z0-9-]*(?:\([^)]*\))?)*\s*\/>/);return r?r[0]:null}return null}var ky,wy,by,zy=Cd({"src/tokenizers/extractors/css-selector.ts"(){hy=class{constructor(){this.name="css-selector"}canExtract(e,t){const r=e[t];return"#"===r||"."===r||"["===r||"<"===r||("@"===r||"*"===r)&&null!==gy(e,t)}extract(e,t){const r=gy(e,t);return r?{value:r,length:r.length,metadata:{type:"css-selector"}}:null}}}}),xy=Cd({"src/tokenizers/extractors/event-modifier.ts"(){ky=class{constructor(){this.name="event-modifier"}canExtract(e,t){if("."!==e[t])return!1;const r=e.slice(t);return/^\.(once|prevent|stop|debounce|throttle|queue)/.test(r)}extract(e,t){const r=e.slice(t).match(/^\.(?:once|prevent|stop|debounce|throttle|queue)(?:\(([^)]+)\))?/);if(!r)return null;const n=r[0],i=n.slice(1).split("(")[0],a=r[1];return{value:n,length:n.length,metadata:{modifierName:i,value:a?"queue"===i?a:parseInt(a,10):void 0}}}}}});function Ey(e,t){let r=1;for(let n=t;e.length>n;n++){const t=e[n];if("{"===t)r++;else if("}"===t&&0===--r)return n+1}return-1}var Ty,Sy,Cy=Cd({"src/tokenizers/extractors/url.ts"(){wy=["http://","https://","//","./","../","/"],by=class{constructor(){this.name="url"}canExtract(e,t){const r=e.slice(t);return r.startsWith("http://")||r.startsWith("https://")||r.startsWith("//")||r.startsWith("./")||r.startsWith("../")||r.startsWith("/")}extract(e,t){const r=function(e,t){const r=e.slice(t),n=wy.find(e=>r.startsWith(e));if(!n)return null;let i=n.length;for(;r.length>i;){const e=r[i];if("$"===e&&"{"===r[i+1]){const e=Ey(r,i+2);if(-1!==e){i=e;continue}}if(/\s/.test(e))break;i++}return r.slice(0,i)}(e,t);return r?{value:r,length:r.length,metadata:{type:"url"}}:null}}}}),Ay=Cd({"src/tokenizers/extractors/variable-ref.ts"(){Ty=class{constructor(){this.name="variable-ref"}canExtract(e,t){const r=e[t];return(":"===r||"$"===r||"^"===r)&&e.length>t+1&&/[a-zA-Z_]/.test(e[t+1])}extract(e,t){if(!this.canExtract(e,t))return null;let r=1;for(;e.length>t+r&&/[a-zA-Z0-9_]/.test(e[t+r]);)r++;return{value:e.substring(t,t+r),length:r,metadata:{type:"variable-reference"}}}}}});function Ly(e){return function(e){const t=e.charCodeAt(0);return t>=12352&&12447>=t}(e)||function(e){const t=e.charCodeAt(0);return t>=12448&&12543>=t}(e)||function(e){const t=e.charCodeAt(0);return t>=19968&&40879>=t||t>=13312&&19903>=t}(e)}var jy,Py,Oy,Ny,Ry,My=Cd({"src/tokenizers/extractors/japanese-keyword.ts"(){Sy=class{constructor(){this.name="japanese-keyword"}setContext(e){this.context=e}canExtract(e,t){return Ly(e[t])}extract(e,t){if(!this.context)throw Error("JapaneseKeywordExtractor: context not set");const r=t;this.context.isKeywordStart(e,t);let n="",i=t;for(;e.length>i&&Ly(e[i]);)n+=e[i],i++;let a=n,o=n.length;for(let e=n.length;e>0;e--){const t=n.substring(0,e);if(this.context.lookupKeyword(t)){a=t,o=e;break}}if(n=a,i=t+o,!n)return null;const s=this.context.lookupKeyword(n),l=s&&s.normalized!==s.native?s.normalized:void 0;let c;if(!s&&this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const t=this.context.lookupKeyword(e.stem);t&&(c=t.normalized)}}return{value:n,length:i-r,metadata:{normalized:l||c}}}}}}),Iy=Cd({"src/tokenizers/extractors/japanese-particle.ts"(){jy=new Map([["\u3092",{role:"patient",confidence:.95}],["\u306b",{role:"destination",confidence:.85}],["\u304c",{role:"subject",confidence:.9}],["\u306e",{role:"possessive",confidence:.9}],["\u3068",{role:"conjunction",confidence:.8}],["\u3067",{role:"instrument",confidence:.85}],["\u3078",{role:"direction",confidence:.85}],["\u3084",{role:"listing",confidence:.8}],["\u304b",{role:"question",confidence:.85}],["\u3082",{role:"also",confidence:.85}],["\u306f",{role:"topic",confidence:.9}]]),Py=new Map([["\u304b\u3089",{role:"source",confidence:.95}],["\u307e\u3067",{role:"until",confidence:.95}],["\u3088\u308a",{role:"comparison",confidence:.9}],["\u3068\u3057\u3066",{role:"as",confidence:.9}],["\u306b\u3064\u3044\u3066",{role:"about",confidence:.9}],["\u306b\u3088\u3063\u3066",{role:"by-means",confidence:.9}],["\u306b\u3066",{role:"at-location",confidence:.85}]]),Oy=class{constructor(){this.name="japanese-particle"}setContext(e){this._context=e}longerKeywordStartsHere(e,t){if(!this._context)return!1;for(let r=4;r>=2;r--){const n=e.slice(t,t+r);if(n.length===r&&this._context.isKeyword(n))return!0}return!1}canExtract(e,t){if(jy.has(e[t])&&!this.longerKeywordStartsHere(e,t))return!0;for(const[r]of Py)if(e.startsWith(r,t))return!0;return!1}extract(e,t){for(const[r,n]of Py)if(e.startsWith(r,t))return{value:r,length:r.length,metadata:{role:n.role,confidence:n.confidence,variant:r}};const r=e[t];if(this.longerKeywordStartsHere(e,t))return null;const n=jy.get(r);return n?{value:r,length:1,metadata:{role:n.role,confidence:n.confidence,variant:r}}:null}}}});function Wy(e){return function(e){const t=e.charCodeAt(0);return t>=44032&&55203>=t}(e)||function(e){const t=e.charCodeAt(0);return t>=4352&&4607>=t||t>=12592&&12687>=t}(e)}var _y,qy,$y,Vy=Cd({"src/tokenizers/extractors/korean-keyword.ts"(){Ny=["\ud560\ub54c","\ud558\uba74","\ud558\ub2c8\uae4c","\ud560 \ub54c"],Ry=class{constructor(){this.name="korean-keyword"}setContext(e){this.context=e}canExtract(e,t){return Wy(e[t])}extract(e,t){if(!this.context)throw Error("KoreanKeywordExtractor: context not set");const r=t;for(let t=Math.min(6,e.length-r);t>=2;t--){const n=e.slice(r,r+t);let i=!0;for(let e=0;n.length>e;e++)if(!Wy(n[e])){i=!1;break}if(!i)continue;const a=this.context.lookupKeyword(n);if(a)return{value:n,length:t,metadata:{normalized:a.normalized!==a.native?a.normalized:void 0}};if(this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const r=this.context.lookupKeyword(e.stem);if(r)return{value:n,length:t,metadata:{normalized:r.normalized,stem:e.stem,stemConfidence:e.confidence}}}}}let n="",i=t;for(;e.length>i&&Wy(e[i])&&(0>=n.length||!this.context.isKeywordStart(e,i));)n+=e[i],i++;if(!n)return null;for(const e of Ny)if(n.endsWith(e)&&n.length>e.length){const t=n.slice(0,-e.length),r=this.context.lookupKeyword(t);if(r)return{value:t,length:t.length,metadata:{normalized:r.normalized,hasSuffix:!0,suffix:e,stem:t}}}const a=this.context.lookupKeyword(n),o=a&&a.normalized!==a.native?a.normalized:void 0;let s,l,c;if(n.includes("\ud1a0\uae00"),!a&&this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const t=this.context.lookupKeyword(e.stem);t&&(s=t.normalized,l=e.stem,c=e.confidence,n.includes("\ud1a0\uae00"))}}return{value:n,length:i-r,metadata:{normalized:o||s,stem:l,stemConfidence:c}}}}}});function Dy(e){if(!e)return!1;const t=e.codePointAt(0);return t>=44032&&55203>=t}var By,Hy=Cd({"src/tokenizers/extractors/korean-particle.ts"(){_y=new Map([["\uc774",{role:"agent",confidence:.85,variant:"consonant",description:"subject marker (after consonant)"}],["\uac00",{role:"agent",confidence:.85,variant:"vowel",description:"subject marker (after vowel)"}],["\uc744",{role:"patient",confidence:.95,variant:"consonant",description:"object marker (after consonant)"}],["\ub97c",{role:"patient",confidence:.95,variant:"vowel",description:"object marker (after vowel)"}],["\uc740",{role:"agent",confidence:.75,variant:"consonant",description:"topic marker (after consonant)"}],["\ub294",{role:"agent",confidence:.75,variant:"vowel",description:"topic marker (after vowel)"}],["\uc5d0",{role:"destination",confidence:.85,description:"at/to marker"}],["\ub85c",{role:"destination",confidence:.85,variant:"vowel",description:"to/by means (after vowel or \u3139)"}],["\uc640",{role:"style",confidence:.7,variant:"vowel",description:"and/with (after vowel)"}],["\uacfc",{role:"style",confidence:.7,variant:"consonant",description:"and/with (after consonant)"}],["\uc758",{role:"patient",confidence:.6,description:"possessive marker"}],["\ub3c4",{role:"patient",confidence:.65,description:"also/too marker"}],["\ub9cc",{role:"patient",confidence:.65,description:"only marker"}]]),qy=new Map([["\uc5d0\uc11c",{role:"source",confidence:.8,description:"at/from marker (action location)"}],["\uc73c\ub85c",{role:"destination",confidence:.85,variant:"consonant",description:"to/by means (after consonant)"}],["\ubd80\ud130",{role:"source",confidence:.9,description:"from/since marker"}],["\uae4c\uc9c0",{role:"destination",confidence:.75,description:"until/to marker"}],["\ucc98\ub7fc",{role:"manner",confidence:.8,description:"like/as marker"}],["\ubcf4\ub2e4",{role:"source",confidence:.75,description:"than marker"}]]),$y=class{constructor(){this.name="korean-particle"}setContext(e){this._context=e}canExtract(e,t){if(_y.has(e[t])&&!Dy(e[t+1]))return!0;for(const[r]of qy)if(e.startsWith(r,t))return!0;return!1}extract(e,t){for(const[r,n]of qy)if(e.startsWith(r,t))return{value:r,length:r.length,metadata:{particleRole:n.role,particleConfidence:n.confidence,particleVariant:n.variant}};const r=e[t],n=_y.get(r);return n&&!Dy(e[t+1])?{value:r,length:1,metadata:{particleRole:n.role,particleConfidence:n.confidence,particleVariant:n.variant}}:null}}}});function Ky(e){const t=e.charCodeAt(0);return t>=19968&&40959>=t||t>=13312&&19903>=t||t>=63744&&64255>=t||t>=131072&&173791>=t||t>=173824&&177983>=t||t>=177984&&178207>=t||t>=178208&&183983>=t||t>=183984&&191471>=t||t>=194560&&195103>=t}var Fy,Uy,Gy,Zy,Yy,Xy,Jy,Qy=Cd({"src/tokenizers/extractors/chinese-keyword.ts"(){By=class{constructor(){this.name="chinese-keyword"}setContext(e){this.context=e}canExtract(e,t){return Ky(e[t])}extract(e,t){if(!this.context)throw Error("ChineseKeywordExtractor: context not set");const r=t;let n=null;if(this.context.isKeywordStart(e,t))for(let r=10;r>=1;r--){const i=e.slice(t,t+r);if([...i].every(e=>Ky(e))){const e=this.context.lookupKeyword(i);if(e){n={word:i,entry:e};break}}}if(n)return{value:n.word,length:n.word.length,metadata:{normalized:n.entry.normalized}};let i="",a=t;for(;e.length>a&&Ky(e[a])&&(i+=e[a],a++,a>=e.length||!this.context.isKeywordStart(e,a)););return i?{value:i,length:a-r,metadata:{}}:null}}}}),ev=Cd({"src/tokenizers/extractors/chinese-particle.ts"(){Fy=new Map([["\u628a",{role:"patient",confidence:.95,description:"ba-construction object marker"}],["\u5728",{role:"location",confidence:.85,description:"at/in/on location marker"}],["\u4ece",{role:"source",confidence:.9,description:"from marker"}],["\u5230",{role:"destination",confidence:.9,description:"to/until marker"}],["\u5411",{role:"destination",confidence:.85,description:"towards marker"}],["\u7ed9",{role:"destination",confidence:.85,description:"to/for recipient marker"}],["\u5bf9",{role:"destination",confidence:.8,description:"to/towards marker"}],["\u7528",{role:"instrument",confidence:.85,description:"with/using marker"}],["\u88ab",{role:"agent",confidence:.8,description:"by (passive) marker"}],["\u8ba9",{role:"agent",confidence:.75,description:"let/make causative marker"}],["\u7684",{role:"possessive",confidence:.9,description:"possessive/attributive marker"}],["\u5730",{role:"manner",confidence:.85,description:"adverbial marker"}],["\u5f97",{role:"manner",confidence:.8,description:"complement marker"}],["\u4e86",{role:"aspect",confidence:.7,description:"completion aspect marker"}],["\u7740",{role:"aspect",confidence:.7,description:"progressive aspect marker"}],["\u8fc7",{role:"aspect",confidence:.7,description:"experiential aspect marker"}],["\u5417",{role:"mood",confidence:.75,description:"question particle"}],["\u5462",{role:"mood",confidence:.7,description:"question/emphasis particle"}],["\u5427",{role:"mood",confidence:.7,description:"suggestion particle"}]]),Uy=new Map([["\u7136\u540e",{role:"sequence",confidence:.9,description:"then/afterwards"}],["\u63a5\u7740",{role:"sequence",confidence:.85,description:"next/following"}],["\u5e76\u4e14",{role:"conjunction",confidence:.85,description:"and/moreover"}],["\u6216\u8005",{role:"conjunction",confidence:.85,description:"or"}],["\u5982\u679c",{role:"condition",confidence:.9,description:"if"}],["\u90a3\u4e48",{role:"consequence",confidence:.85,description:"then"}],["\u5426\u5219",{role:"alternative",confidence:.85,description:"otherwise"}]]),Gy=class{constructor(){this.name="chinese-particle"}setContext(e){this._context=e}longerKeywordAt(e,t,r){const n=this._context;if(!n)return!1;for(let i=Math.min(10,e.length-t);i>r;i--)if(n.lookupKeyword(e.slice(t,t+i)))return!0;return!1}canExtract(e,t){if(Fy.has(e[t])&&!this.longerKeywordAt(e,t,1))return!0;for(const[r]of Uy)if(e.startsWith(r,t)&&!this.longerKeywordAt(e,t,r.length))return!0;return!1}extract(e,t){for(const[r,n]of Uy)if(e.startsWith(r,t)&&!this.longerKeywordAt(e,t,r.length))return{value:r,length:r.length,metadata:{particleRole:n.role,particleConfidence:n.confidence,particleDescription:n.description}};const r=e[t],n=Fy.get(r);return n&&!this.longerKeywordAt(e,t,1)?{value:r,length:1,metadata:{particleRole:n.role,particleConfidence:n.confidence,particleDescription:n.description}}:null}}}});var tv,rv,nv,iv,av,ov,sv,lv,cv,uv,pv,dv,mv,fv=Cd({"src/tokenizers/extractors/vietnamese-keyword.ts"(){var e;({isLetter:Zy,isIdentifierChar:Yy}=(e=/[a-zA-Z\u00e0\u00e1\u1ea3\u00e3\u1ea1\u0103\u1eb1\u1eaf\u1eb3\u1eb5\u1eb7\u00e2\u1ea7\u1ea5\u1ea9\u1eab\u1ead\u00e8\u00e9\u1ebb\u1ebd\u1eb9\u00ea\u1ec1\u1ebf\u1ec3\u1ec5\u1ec7\u00ec\u00ed\u1ec9\u0129\u1ecb\u00f2\u00f3\u1ecf\u00f5\u1ecd\u00f4\u1ed3\u1ed1\u1ed5\u1ed7\u1ed9\u01a1\u1edd\u1edb\u1edf\u1ee1\u1ee3\u00f9\u00fa\u1ee7\u0169\u1ee5\u01b0\u1eeb\u1ee9\u1eed\u1eef\u1ef1\u1ef3\u00fd\u1ef7\u1ef9\u1ef5\u0111\u00c0\u00c1\u1ea2\u00c3\u1ea0\u0102\u1eb0\u1eae\u1eb2\u1eb4\u1eb6\u00c2\u1ea6\u1ea4\u1ea8\u1eaa\u1eac\u00c8\u00c9\u1eba\u1ebc\u1eb8\u00ca\u1ec0\u1ebe\u1ec2\u1ec4\u1ec6\u00cc\u00cd\u1ec8\u0128\u1eca\u00d2\u00d3\u1ece\u00d5\u1ecc\u00d4\u1ed2\u1ed0\u1ed4\u1ed6\u1ed8\u01a0\u1edc\u1eda\u1ede\u1ee0\u1ee2\u00d9\u00da\u1ee6\u0168\u1ee4\u01af\u1eea\u1ee8\u1eec\u1eee\u1ef0\u1ef2\u00dd\u1ef6\u1ef8\u1ef4\u0110]/,{isLetter:t=>e.test(t),isIdentifierChar:t=>/[0-9]/.test(t)||e.test(t)})),Xy=new Set(["trong","ngo\u00e0i","tr\u00ean","d\u01b0\u1edbi","v\u00e0o","ra","\u0111\u1ebfn","t\u1eeb","v\u1edbi","cho","b\u1edfi","qua","tr\u01b0\u1edbc","sau","gi\u1eefa","b\u00ean","theo","v\u1ec1","t\u1edbi","l\u00ean","xu\u1ed1ng"]),Jy=class{constructor(){this.name="vietnamese-keyword"}setContext(e){this.context=e}canExtract(e,t){return Zy(e[t])}extract(e,t){if(!this.context)throw Error("VietnameseKeywordExtractor: context not set");const r=this.tryMultiWordPhrase(e,t);if(r)return r;let n=t,i="";for(;e.length>n&&Yy(e[n]);)i+=e[n++];if(!i)return null;const a=i.toLowerCase(),o=Xy.has(a),s=this.context.lookupKeyword(a);return{value:i,length:n-t,metadata:{normalized:s&&s.normalized!==s.native?s.normalized:void 0,isPreposition:o}}}tryMultiWordPhrase(e,t){if(!this.context)return null;const r=["v\u00e0o trong","s\u1ef1 ki\u1ec7n"];for(const n of r){if(e.slice(t,t+n.length).toLowerCase()===n.toLowerCase()){const r=t+n.length;if(r>=e.length||!/[a-zA-Z\u00e0\u00e1\u1ea3\u00e3\u1ea1\u0103\u1eb1\u1eaf\u1eb3\u1eb5\u1eb7\u00e2\u1ea7\u1ea5\u1ea9\u1eab\u1ead\u00e8\u00e9\u1ebb\u1ebd\u1eb9\u00ea\u1ec1\u1ebf\u1ec3\u1ec5\u1ec7\u00ec\u00ed\u1ec9\u0129\u1ecb\u00f2\u00f3\u1ecf\u00f5\u1ecd\u00f4\u1ed3\u1ed1\u1ed5\u1ed7\u1ed9\u01a1\u1edd\u1edb\u1edf\u1ee1\u1ee3\u00f9\u00fa\u1ee7\u0169\u1ee5\u01b0\u1eeb\u1ee9\u1eed\u1eef\u1ef1\u1ef3\u00fd\u1ef7\u1ef9\u1ef5\u0111]/.test(e[r])){const i=this.context.lookupKeyword(n);return{value:e.slice(t,r),length:n.length,metadata:{normalized:i?.normalized,isPreposition:!1}}}}}return null}}}}),hv=Cd({"src/tokenizers/extractors/arabic-keyword.ts"(){fy(),tv=hd([[1536,1791],[1872,1919],[2208,2303],[64336,65023],[65136,65279]]),rv=new Set(["\u0641\u064a","\u0639\u0644\u0649","\u0645\u0646","\u0625\u0644\u0649","\u0627\u0644\u0649","\u0645\u0639","\u0639\u0646","\u0642\u0628\u0644","\u0628\u0639\u062f","\u0628\u064a\u0646"]),nv=class{constructor(){this.name="arabic-keyword"}setContext(e){this.context=e}canExtract(e,t){return tv(e[t])}extract(e,t){if(!this.context)throw Error("ArabicKeywordExtractor: context not set");const r=t;this.context.isKeywordStart(e,t);let n="",i=t;for(;e.length>i&&(tv(e[i])||"\u0640"===e[i]);)n+=e[i],i++;if(!n)return null;const a=this.context.lookupKeyword(n),o=a&&a.normalized!==a.native?a.normalized:void 0;if(rv.has(n))return{value:n,length:i-r,metadata:{prepositionValue:n,normalized:o}};let s,l,c;if(!a&&this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const t=this.context.lookupKeyword(e.stem);t&&(s=t.normalized,l=e.stem,c=e.confidence)}}return{value:n,length:i-r,metadata:{normalized:o||s,stem:l,stemConfidence:c}}}}}}),yv=Cd({"src/tokenizers/extractors/arabic-proclitic.ts"(){fy(),iv=hd([[1536,1791],[1872,1919],[2208,2303],[64336,65023],[65136,65279]]),av=new Map([["\u0648",{normalized:"and",type:"conjunction"}],["\u0641",{normalized:"then",type:"conjunction"}],["\u0628",{normalized:"with",type:"preposition"}],["\u0644",{normalized:"to",type:"preposition"}],["\u0643",{normalized:"like",type:"preposition"}],["\u0648\u0644",{normalized:"and-to",type:"conjunction"}],["\u0648\u0628",{normalized:"and-with",type:"conjunction"}],["\u0648\u0643",{normalized:"and-like",type:"conjunction"}],["\u0641\u0644",{normalized:"then-to",type:"conjunction"}],["\u0641\u0628",{normalized:"then-with",type:"conjunction"}],["\u0641\u0643",{normalized:"then-like",type:"conjunction"}]]),ov=new Set(["\u0648\u062b\u064a\u0642\u0629"]),sv=class{constructor(){this.name="arabic-proclitic"}setContext(e){this.context=e}canExtract(e,t){return av.has(e[t])||e.length>t+1&&av.has(e.slice(t,t+2))}extract(e,t){if(!this.context)throw Error("ArabicProcliticExtractor: context not set");let r=t;for(;e.length>r&&(iv(e[r])||"\u0640"===e[r]);)r++;const n=e.slice(t,r);if(this.context.isKeyword(n))return null;if(ov.has(n))return null;if(e.length>=t+2){const n=e.slice(t,t+2),i=av.get(n);if(i){const a=t+2;if(e.length>a&&iv(e[a])){let o=0,s=a;for(;e.length>s&&iv(e[s]);)o++,s++;if(o>=2){if(!av.get(e[t]))return{value:n,length:2,metadata:{procliticType:i.type,normalized:i.normalized}};{const a=e.slice(t+1,r);if(!this.context.isKeyword(a))return{value:n,length:2,metadata:{procliticType:i.type,normalized:i.normalized}}}}}}}const i=e[t],a=av.get(i);if(!a)return null;const o=t+1;if(o>=e.length||!iv(e[o]))return null;let s=0,l=o;for(;e.length>l&&iv(e[l]);)s++,l++;if(2>s){const r=s>=1&&e.slice(o,l).split("").every(e=>"\u0640"===e),n=e[l];return"preposition"!==a.type||!r||"#"!==n&&"."!==n?null:{value:e.slice(t,l),length:l-t,metadata:{procliticType:a.type,normalized:a.normalized}}}return{value:i,length:1,metadata:{procliticType:a.type,normalized:a.normalized}}}}}}),vv=Cd({"src/tokenizers/extractors/arabic-temporal.ts"(){fy(),lv=hd([[1536,1791],[1872,1919],[2208,2303],[64336,65023],[65136,65279]]),cv=new Map([["\u0639\u0646\u062f\u0645\u0627",{normalized:"on",formality:"formal",confidence:.95,description:"when (formal MSA)"}],["\u062d\u064a\u0646\u0645\u0627",{normalized:"on",formality:"formal",confidence:.93,description:"when/whenever (formal)"}],["\u0639\u0646\u062f",{normalized:"on",formality:"neutral",confidence:.88,description:"at/when (neutral)"}],["\u062d\u064a\u0646",{normalized:"on",formality:"neutral",confidence:.85,description:"when/time (neutral)"}],["\u0644\u0645\u0651\u0627",{normalized:"on",formality:"dialectal",confidence:.7,description:"when (dialectal, with shadda)"}],["\u0644\u0645\u0627",{normalized:"on",formality:"dialectal",confidence:.68,description:"when (dialectal, no diacritic)"}],["\u0644\u062f\u0649",{normalized:"on",formality:"neutral",confidence:.82,description:"at/with (temporal)"}]]),uv=class{constructor(){this.name="arabic-temporal"}setContext(e){this._context=e}canExtract(e,t){for(const[r]of cv)if(e.startsWith(r,t))return!0;return!1}extract(e,t){const r=Array.from(cv.entries()).sort(([e],[t])=>t.length-e.length);for(const[n,i]of r)if(e.startsWith(n,t)){const r=t+n.length;if(r>=e.length||/\s/.test(e[r])||!lv(e[r]))return{value:n,length:n.length,metadata:{temporalFormality:i.formality,temporalConfidence:i.confidence,normalized:i.normalized,description:i.description}}}return null}}}});var gv,kv=Cd({"src/tokenizers/extractors/cyrillic-keyword.ts"(){pv=class{constructor(e,t,r){this.name=e;const n=(i=t,{isLetter:e=>i.test(e),isIdentifierChar:e=>/[0-9_]/.test(e)||i.test(e)});var i;this.isLetter=n.isLetter,this.isIdentifierChar=n.isIdentifierChar,this.prepositions=r}setContext(e){this.context=e}canExtract(e,t){const r=e[t];return"'"!==r&&this.isLetter(r)}extract(e,t){if(!this.context)throw Error(this.name+": context not set");let r=t,n="";for(;e.length>r&&this.isIdentifierChar(e[r]);)n+=e[r++];if(!n)return null;const i=n.toLowerCase(),a=this.prepositions.has(i),o=this.context.lookupKeyword(i),s=o&&o.normalized!==o.native?o.normalized:void 0;let l;if(!o&&this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const t=this.context.lookupKeyword(e.stem);t&&(l=t.normalized)}}return{value:n,length:r-t,metadata:{normalized:s||l,isPreposition:a}}}},dv=new Set(["\u0432","\u0432\u043e","\u043d\u0430","\u0441","\u0441\u043e","\u043a","\u043a\u043e","\u043e","\u043e\u0431","\u043e\u0431\u043e","\u0443","\u043e\u0442","\u0434\u043e","\u0438\u0437","\u0437\u0430","\u043f\u043e","\u043f\u043e\u0434","\u043d\u0430\u0434","\u043f\u0435\u0440\u0435\u0434","\u043f\u0435\u0440\u0435\u0434\u043e","\u043c\u0435\u0436\u0434\u0443","\u0447\u0435\u0440\u0435\u0437","\u0431\u0435\u0437","\u0434\u043b\u044f","\u043f\u0440\u0438","\u043f\u0440\u043e","\u043f\u043e\u0441\u043b\u0435","\u0432\u043e\u043a\u0440\u0443\u0433","\u043f\u0440\u043e\u0442\u0438\u0432","\u0432\u043c\u0435\u0441\u0442\u043e","\u043a\u0440\u043e\u043c\u0435","\u0441\u0440\u0435\u0434\u0438"]),mv=new Set(["\u0432","\u0443","\u043d\u0430","\u0437","\u0456\u0437","\u0437\u0456","\u0434\u043e","\u0432\u0456\u0434","\u043e","\u043e\u0431","\u043f\u0440\u0438","\u0434\u043b\u044f","\u043f\u0456\u0434","\u043d\u0430\u0434","\u043f\u0435\u0440\u0435\u0434","\u043c\u0456\u0436","\u0447\u0435\u0440\u0435\u0437","\u0431\u0435\u0437","\u043f\u043e","\u0437\u0430","\u043f\u0440\u043e","\u043f\u0456\u0441\u043b\u044f","\u043d\u0430\u0432\u043a\u043e\u043b\u043e","\u043f\u0440\u043e\u0442\u0438","\u0437\u0430\u043c\u0456\u0441\u0442\u044c","\u043a\u0440\u0456\u043c","\u0441\u0435\u0440\u0435\u0434","\u043a"])}});function wv(e){const t=e.charCodeAt(0);return t>=2304&&2431>=t||t>=43232&&43263>=t}var bv,zv,xv,Ev,Tv=Cd({"src/tokenizers/extractors/hindi-keyword.ts"(){gv=class{constructor(){this.name="hindi-keyword"}setContext(e){this.context=e}canExtract(e,t){return wv(e[t])}extract(e,t){if(!this.context)throw Error("HindiKeywordExtractor: context not set");const r=t;let n="",i=t;for(;e.length>i&&wv(e[i]);)n+=e[i],i++;if(this.context&&"-"===e[i]&&e.length>i+1&&wv(e[i+1])){let t=i,r=n;for(;e.length>t&&("-"===e[t]||wv(e[t]));)r+=e[t++];this.context.lookupKeyword(r)&&(n=r,i=t)}if(this.context&&"_"===e[i]&&e.length>i+1&&wv(e[i+1])){let t=i,r=n;for(;e.length>t&&("_"===e[t]||wv(e[t]));)r+=e[t++];this.context.lookupKeyword(r)&&(n=r,i=t)}if(!n)return null;const a=this.context.lookupKeyword(n),o=a&&a.normalized!==a.native?a.normalized:void 0;let s;if(!a&&this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const t=this.context.lookupKeyword(e.stem);t&&(s=t.normalized)}}return{value:n,length:i-r,metadata:{normalized:o||s}}}}}}),Sv=Cd({"src/tokenizers/extractors/hindi-particle.ts"(){bv=new Map([["\u0915\u094b",{role:"patient",confidence:.95}],["\u092e\u0947\u0902",{role:"destination",confidence:.9}],["\u092a\u0930",{role:"event",confidence:.85}],["\u0938\u0947",{role:"source",confidence:.9}],["\u0915\u093e",{role:"possessive",confidence:.95}],["\u0915\u0940",{role:"possessive",confidence:.95}],["\u0915\u0947",{role:"possessive",confidence:.95}],["\u0924\u0915",{role:"until",confidence:.9}],["\u0928\u0947",{role:"agent",confidence:.85}]]),zv=new Map([["\u0915\u0947 \u0938\u093e\u0925",{role:"instrument",confidence:.95}],["\u0915\u0947 \u092c\u093e\u0930\u0947 \u092e\u0947\u0902",{role:"about",confidence:.9}]]),xv=class{constructor(){this.name="hindi-particle"}setContext(e){this._context=e}canExtract(e,t){if(this.underscoreJoinedKeyword(e,t))return!1;for(const[r]of zv)if(e.startsWith(r,t))return!0;let r="",n=t;for(;e.length>n&&this.isDevanagari(e[n]);)r+=e[n],n++;return bv.has(r)}underscoreJoinedKeyword(e,t){if(!this._context)return!1;let r=t;for(;e.length>r&&this.isDevanagari(e[r]);)r++;if("_"!==e[r]||r+1>=e.length||!this.isDevanagari(e[r+1]))return!1;let n=e.slice(t,r);for(;e.length>r&&("_"===e[r]||this.isDevanagari(e[r]));)n+=e[r++];return!!this._context.lookupKeyword(n)}extract(e,t){if(this.underscoreJoinedKeyword(e,t))return null;for(const[r,n]of zv)if(e.startsWith(r,t))return{value:r,length:r.length,metadata:{role:n.role,confidence:n.confidence,variant:r}};let r="",n=t;for(;e.length>n&&this.isDevanagari(e[n]);)r+=e[n],n++;const i=bv.get(r);return i?{value:r,length:r.length,metadata:{role:i.role,confidence:i.confidence,variant:r}}:null}isDevanagari(e){const t=e.charCodeAt(0);return t>=2304&&2431>=t||t>=43232&&43263>=t}}}});function Cv(e){const t=e.charCodeAt(0);return t>=2432&&2559>=t}var Av,Lv,jv,Pv=Cd({"src/tokenizers/extractors/bengali-keyword.ts"(){Ev=class{constructor(){this.name="bengali-keyword"}setContext(e){this.context=e}canExtract(e,t){return Cv(e[t])}extract(e,t){if(!this.context)throw Error("BengaliKeywordExtractor: context not set");const r=t;let n="",i=t;for(;e.length>i&&Cv(e[i]);)n+=e[i],i++;if(!n)return null;const a=this.context.lookupKeyword(n),o=a&&a.normalized!==a.native?a.normalized:void 0;let s;if(!a&&this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const t=this.context.lookupKeyword(e.stem);t&&(s=t.normalized)}}return{value:n,length:i-r,metadata:{normalized:o||s}}}}}}),Ov=Cd({"src/tokenizers/extractors/bengali-particle.ts"(){Av=new Map([["\u0995\u09c7",{role:"patient",confidence:.95}],["\u09a4\u09c7",{role:"destination",confidence:.9}],["\u098f",{role:"event",confidence:.85}],["\u09a5\u09c7\u0995\u09c7",{role:"source",confidence:.95}],["\u09b0",{role:"possessive",confidence:.95}],["\u098f\u09b0",{role:"possessive",confidence:.95}],["\u09a6\u09bf\u09af\u09bc\u09c7",{role:"instrument",confidence:.9}],["\u099c\u09a8\u09cd\u09af",{role:"purpose",confidence:.9}],["\u09aa\u09b0\u09cd\u09af\u09a8\u09cd\u09a4",{role:"until",confidence:.9}],["\u09ae\u09a7\u09cd\u09af\u09c7",{role:"location",confidence:.85}]]),Lv=class{constructor(){this.name="bengali-particle"}setContext(e){this._context=e}canExtract(e,t){let r="",n=t;for(;e.length>n&&this.isBengali(e[n]);)r+=e[n],n++;return Av.has(r)}extract(e,t){let r="",n=t;for(;e.length>n&&this.isBengali(e[n]);)r+=e[n],n++;const i=Av.get(r);return i?{value:r,length:r.length,metadata:{role:i.role,confidence:i.confidence,variant:r}}:null}isBengali(e){const t=e.charCodeAt(0);return t>=2432&&2559>=t}}}});function Nv(e){const t=e.charCodeAt(0);return t>=3584&&3711>=t}function Rv(e){return/[a-zA-Z0-9_]/.test(e)}var Mv,Iv=Cd({"src/tokenizers/extractors/thai-keyword.ts"(){jv=class{constructor(){this.name="thai-keyword"}setContext(e){this.context=e}canExtract(e,t){return Nv(e[t])||Rv(e[t])}extract(e,t){if(!this.context)throw Error("ThaiKeywordExtractor: context not set");const r=e[t];return Nv(r)?this.extractThaiWord(e,t):Rv(r)?this.extractAsciiWord(e,t):null}extractThaiWord(e,t){if(!this.context)return null;let r=null,n=t,i="";for(;e.length>n&&Nv(e[n]);){i+=e[n],n++;const t=this.context.lookupKeyword(i);t&&(r={word:i,entry:t})}if(r){return{value:r.word,length:r.word.length,metadata:{normalized:r.entry.normalized!==r.entry.native?r.entry.normalized:void 0}}}let a=t,o="";for(;e.length>a&&Nv(e[a])&&(0>=o.length||!this.isKeywordStart(e,a));)o+=e[a],a++;return o?{value:o,length:o.length,metadata:{}}:null}extractAsciiWord(e,t){if(!this.context)return null;let r=t,n="";for(;e.length>r&&Rv(e[r]);)n+=e[r++];if(!n)return null;const i=n.toLowerCase(),a=this.context.lookupKeyword(i);return{value:n,length:n.length,metadata:{normalized:a&&a.normalized!==a.native?a.normalized:void 0}}}isKeywordStart(e,t){if(!this.context)return!1;let r=t,n="";for(;e.length>r&&Nv(e[r]);){if(n+=e[r],r++,this.context.lookupKeyword(n))return!0;if(n.length>10)break}return!1}}}});function Wv(e){return/[a-zA-Z0-9_]/.test(e)}var _v,qv,$v=Cd({"src/tokenizers/extractors/malay-keyword.ts"(){Mv=class{constructor(){this.name="malay-keyword"}setContext(e){this.context=e}canExtract(e,t){return/[a-zA-Z_]/.test(e[t])}extract(e,t){if(!this.context)throw Error("MalayKeywordExtractor: context not set");let r=t,n="";for(;e.length>r&&Wv(e[r]);)n+=e[r++];if(!n)return null;const i=n.toLowerCase(),a=this.context.lookupKeyword(i);return{value:n,length:n.length,metadata:{normalized:a&&a.normalized!==a.native?a.normalized:void 0}}}}}});function Vv(e){return/[a-zA-Z0-9_]/.test(e)}var Dv,Bv,Hv,Kv,Fv=Cd({"src/tokenizers/extractors/tagalog-keyword.ts"(){_v=new Set(["sa","ng","para","mula","hanggang","gaya","tulad","kasama","para sa"]),qv=class{constructor(){this.name="tagalog-keyword"}setContext(e){this.context=e}canExtract(e,t){return/[a-zA-Z_]/.test(e[t])}extract(e,t){if(!this.context)throw Error("TagalogKeywordExtractor: context not set");let r=t,n="";for(;e.length>r&&Vv(e[r]);)n+=e[r++];if(!n)return null;const i=n.toLowerCase(),a=_v.has(i),o=this.context.lookupKeyword(i),s=o&&o.normalized!==o.native?o.normalized:void 0;let l;if(!o&&this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const t=this.context.lookupKeyword(e.stem);t&&(l=t.normalized)}}return{value:n,length:n.length,metadata:{normalized:s||l,isPreposition:a}}}}}});var Uv,Gv,Zv,Yv,Xv=Cd({"src/tokenizers/extractors/polish-keyword.ts"(){Dv=new Set(["do","od","z","ze","w","we","na","po","pod","przed","za","nad","mi\u0119dzy","miedzy","przez","dla","bez","o","przy","u","wed\u0142ug","wedlug","mimo","w\u015br\u00f3d","wsrod","obok","poza","wok\u00f3\u0142","wokol","przeciw","ku"]),({isLetter:Bv,isIdentifierChar:Hv}=function(){const e=/[a-zA-Z\u0105\u0119\u0107\u0144\u00f3\u015b\u017a\u017c\u0142\u0104\u0118\u0106\u0143\u00d3\u015a\u0179\u017b\u0141]/;return{isLetter:t=>e.test(t),isIdentifierChar:t=>/[0-9]/.test(t)||e.test(t)}}()),Kv=class{constructor(){this.name="polish-keyword"}setContext(e){this.context=e}canExtract(e,t){return Bv(e[t])}extract(e,t){if(!this.context)throw Error("PolishKeywordExtractor: context not set");let r=t,n="";for(;e.length>r&&Hv(e[r]);)n+=e[r++];if(!n)return null;const i=n.toLowerCase(),a=Dv.has(i),o=this.context.lookupKeyword(i),s=o&&o.normalized!==o.native?o.normalized:void 0;let l;if(!o&&this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const t=this.context.lookupKeyword(e.stem);t&&(l=t.normalized)}}return{value:n,length:r-t,metadata:{normalized:s||l,isPreposition:a}}}}}});var Jv,Qv,eg,tg,rg=Cd({"src/tokenizers/extractors/indonesian-keyword.ts"(){Uv=new Set(["di","ke","dari","pada","dengan","tanpa","untuk","oleh","antara","sebelum","sesudah","setelah","selama","sampai","hingga","sejak","menuju","tentang","terhadap","melalui","dalam","luar"]),({isLetter:Gv,isIdentifierChar:Zv}=function(){const e=/[a-zA-Z]/;return{isLetter:t=>e.test(t),isIdentifierChar:t=>/[0-9]/.test(t)||e.test(t)}}()),Yv=class{constructor(){this.name="indonesian-keyword"}setContext(e){this.context=e}canExtract(e,t){return Gv(e[t])}extract(e,t){if(!this.context)throw Error("IndonesianKeywordExtractor: context not set");let r=t,n="";for(;e.length>r&&Zv(e[r]);)n+=e[r++];if(this.context&&e.length>r&&"_"===e[r]){let t=r,i=n;for(;e.length>t&&("_"===e[t]||Zv(e[t]));)i+=e[t++];this.context.lookupKeyword(i.toLowerCase())&&(n=i,r=t)}if(!n)return null;const i=n.toLowerCase(),a=Uv.has(i),o=this.context.lookupKeyword(i),s=o&&o.normalized!==o.native?o.normalized:void 0;let l;if(!o&&this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const t=this.context.lookupKeyword(e.stem);t&&(l=t.normalized)}}return{value:n,length:r-t,metadata:{normalized:s||l,isPreposition:a}}}}}});var ng,ig,ag,og=Cd({"src/tokenizers/extractors/swahili-keyword.ts"(){Jv=new Set(["kwa","na","katika","kwenye","kutoka","hadi","mpaka","kabla","baada","wakati","bila","kuhusu","karibu","mbele","nyuma","ndani","nje","juu","chini","kati"]),({isLetter:Qv,isIdentifierChar:eg}=function(){const e=/[a-zA-Z]/;return{isLetter:t=>e.test(t),isIdentifierChar:t=>/[0-9]/.test(t)||e.test(t)}}()),tg=class{constructor(){this.name="swahili-keyword"}setContext(e){this.context=e}canExtract(e,t){return Qv(e[t])}extract(e,t){if(!this.context)throw Error("SwahiliKeywordExtractor: context not set");let r=t,n="";for(;e.length>r&&eg(e[r]);)n+=e[r++];if(this.context&&e.length>r&&"_"===e[r]){let t=r,i=n;for(;e.length>t&&("_"===e[t]||eg(e[t]));)i+=e[t++];this.context.lookupKeyword(i.toLowerCase())&&(n=i,r=t)}if(!n)return null;const i=n.toLowerCase(),a=Jv.has(i),o=this.context.lookupKeyword(i),s=o&&o.normalized!==o.native?o.normalized:void 0;let l;if(!o&&this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const t=this.context.lookupKeyword(e.stem);t&&(l=t.normalized)}}return{value:n,length:r-t,metadata:{normalized:s||l,isPreposition:a}}}}}});function sg(e){const t=e.charCodeAt(0);if(t>=65&&90>=t||t>=97&&122>=t)return!0;return"\u00e7\u00c7\u011f\u011e\u0131\u0130\u00f6\u00d6\u015f\u015e\u00fc\u00dc".includes(e)}var lg,cg,ug,pg,dg=Cd({"src/tokenizers/extractors/turkish-keyword.ts"(){ng=new Set(["ile","i\u00e7in","kadar","gibi","\u00f6nce","\u00fczerinde","alt\u0131nda","i\u00e7inde","d\u0131\u015f\u0131nda","aras\u0131nda","kar\u015f\u0131","g\u00f6re","ra\u011fmen","do\u011fru","boyunca"]),ig=new Set(["de","da","te","ta","den","dan","ten","tan","e","a","ye","ya","i","\u0131","u","\u00fc","in","\u0131n","un","\u00fcn","le","la","yle","yla"]),ag=class{constructor(){this.name="turkish-keyword"}setContext(e){this.context=e}canExtract(e,t){return sg(e[t])}extract(e,t){if(!this.context)throw Error("TurkishKeywordExtractor: context not set");const r=t;for(let t=Math.min(12,e.length-r);t>=2;t--){const n=e.slice(r,r+t);if(e.length>r+t&&sg(e[r+t]))continue;let i=!0;for(let e=0;n.length>e;e++)if(!sg(n[e])){i=!1;break}if(!i)continue;const a=this.context.lookupKeyword(n);if(a)return{value:n,length:t,metadata:{normalized:a.normalized!==a.native?a.normalized:void 0}};if(this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const r=this.context.lookupKeyword(e.stem);if(r)return{value:n,length:t,metadata:{normalized:r.normalized,stem:e.stem,stemConfidence:e.confidence}}}}}let n="",i=t;for(;e.length>i&&sg(e[i]);)n+=e[i],i++;for(let e=n.length;e>=2&&n.length<=e;e--){const t=n.substring(0,e),r=this.context.lookupKeyword(t);if(r)return{value:t,length:e,metadata:{normalized:r.normalized!==r.native?r.normalized:void 0}}}if(!n)return null;if(!n)return null;if(ng.has(n.toLowerCase()))return{value:n,length:i-r,metadata:{postpositionValue:n.toLowerCase()}};if(ig.has(n.toLowerCase()))return{value:n,length:i-r,metadata:{caseSuffixValue:n.toLowerCase()}};const a=this.context.lookupKeyword(n),o=a&&a.normalized!==a.native?a.normalized:void 0;let s,l,c;if(!a&&this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const t=this.context.lookupKeyword(e.stem);t&&(s=t.normalized,l=e.stem,c=e.confidence)}}return{value:n,length:i-r,metadata:{normalized:o||s,stem:l,stemConfidence:c}}}}}});function mg(e){const t=e.charCodeAt(0);return t>=65&&90>=t||t>=97&&122>=t||("\u00f1"===e||"\u00d1"===e||"'"===e||"\u2019"===e)}function fg(e,t){const r=e.slice(t);for(const n of ug){if(!r.startsWith(n))continue;const i=e[t+n.length];if(void 0===i||!mg(i))return!0}return!1}var hg,yg,vg,gg,kg=Cd({"src/tokenizers/extractors/quechua-keyword.ts"(){lg=new Set(["-ta","-man","-manta","-pi","-wan","-paq","-kama","-rayku","-hina","ta","man","manta","pi","wan","paq","kama","hina","pa"]),cg=new Set(["kama","hina","rayku","paq"]),ug=new Set([...lg,...cg].map(e=>e.startsWith("-")?e.slice(1):e)),pg=class{constructor(){this.name="quechua-keyword"}setContext(e){this.context=e}canExtract(e,t){return!!mg(e[t])||null!==this.isHyphenatedSuffix(e,t)}isHyphenatedSuffix(e,t){if("-"!==e[t])return null;const r=e.slice(t).match(/^-([a-z\u00f1'\u2019]+)/i);return r&&lg.has("-"+r[1].toLowerCase())?r[1]:null}extract(e,t){if(!this.context)throw Error("QuechuaKeywordExtractor: context not set");const r=t,n=this.isHyphenatedSuffix(e,t);if(null!==n)return{value:n,length:n.length+1,metadata:{suffixValue:n.toLowerCase()}};for(let t=Math.min(13,e.length-r);t>=2;t--){const n=e.slice(r,r+t),i=e[r+t];if(void 0!==i&&mg(i))continue;let a=!0;for(let e=0;n.length>e;e++){const t=n[e];if(("_"!==t||0>=e||e>=n.length-1)&&!mg(t)){a=!1;break}}if(!a)continue;const o=this.context.lookupKeyword(n);if(o)return{value:n,length:t,metadata:{normalized:o.normalized!==o.native?o.normalized:void 0}};if(this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const r=this.context.lookupKeyword(e.stem);if(r)return{value:n,length:t,metadata:{normalized:r.normalized}}}}}let i="",a=t;for(;e.length>a&&mg(e[a])&&(0>=i.length||!fg(e,a));)i+=e[a],a++;if(!i)return null;if(lg.has(i.toLowerCase()))return{value:i,length:a-r,metadata:{suffixValue:i.toLowerCase()}};if(cg.has(i.toLowerCase()))return{value:i,length:a-r,metadata:{postpositionValue:i.toLowerCase()}};const o=this.context.lookupKeyword(i),s=o&&o.normalized!==o.native?o.normalized:void 0;let l;if(!o&&this.context.normalizer){const e=this.context.normalizer.normalize(i);if(e.stem!==i&&e.confidence>=.7){const t=this.context.lookupKeyword(e.stem);t&&(l=t.normalized)}}return{value:i,length:a-r,metadata:{normalized:s||l}}}}}});var wg,bg,zg,xg,Eg,Tg=Cd({"src/tokenizers/extractors/hebrew-keyword.ts"(){fy(),hg=hd([[1424,1535],[64285,64335]]),yg=new Set(["\u05e2\u05dc","\u05d0\u05ea","\u05d0\u05dc","\u05de\u05df","\u05e2\u05dd","\u05d1\u05ea\u05d5\u05da","\u05de\u05ea\u05d5\u05da","\u05dc\u05d9\u05d3","\u05d0\u05d7\u05e8\u05d9","\u05dc\u05e4\u05e0\u05d9","\u05d1\u05d9\u05df","\u05e2\u05d3","\u05e9\u05dc"]),vg=new Set(["\u05d5"]),gg=class{constructor(){this.name="hebrew-keyword"}setContext(e){this.context=e}canExtract(e,t){return hg(e[t])}extract(e,t){if(!this.context)throw Error("HebrewKeywordExtractor: context not set");const r=t;this.context.isKeywordStart(e,t);let n="",i=t;for(;e.length>i&&hg(e[i]);)n+=e[i],i++;if(!n)return null;const a=this.context.lookupKeyword(n),o=a&&a.normalized!==a.native?a.normalized:void 0;if(yg.has(n))return{value:n,length:i-r,metadata:{prepositionValue:n,normalized:o}};if(vg.has(n))return{value:n,length:i-r,metadata:{conjunctionValue:n,normalized:o}};let s;if(!a&&this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const t=this.context.lookupKeyword(e.stem);t&&(s=t.normalized)}}return{value:n,length:i-r,metadata:{normalized:o||s}}}}}});var Sg,Cg=Cd({"src/tokenizers/extractors/hebrew-proclitic.ts"(){fy(),wg=hd([[1424,1535],[64285,64335]]),bg=new Map([["\u05d1","on"],["\u05dc","to"],["\u05de","from"],["\u05db","as"],["\u05d4","the"],["\u05d5","and"],["\u05e9","that"]]),zg=new Set(["\u05d1","\u05db"]),xg=new Set(["\u05dc\u05d7\u05d9\u05e6\u05d4","\u05e7\u05dc\u05d9\u05e7","\u05e9\u05dc\u05d9\u05d7\u05d4","\u05d4\u05d2\u05e9\u05d4","\u05e8\u05d9\u05d7\u05d5\u05e3","\u05de\u05e2\u05d1\u05e8","\u05e9\u05d9\u05e0\u05d5\u05d9","\u05e2\u05d3\u05db\u05d5\u05df","\u05e7\u05dc\u05d8","\u05d4\u05d6\u05e0\u05d4","\u05de\u05d9\u05e7\u05d5\u05d3","\u05d8\u05e9\u05d8\u05d5\u05e9","\u05d8\u05e2\u05d9\u05e0\u05d4","\u05d2\u05dc\u05d9\u05dc\u05d4"]),Eg=class{constructor(){this.name="hebrew-proclitic"}setContext(e){this.context=e}canExtract(e,t){return bg.has(e[t])&&e.length>t+1&&wg(e[t+1])}extract(e,t){if(!this.context)throw Error("HebrewProcliticExtractor: context not set");const r=e[t],n=bg.get(r);if(!n)return null;let i=t;for(;e.length>i&&wg(e[i]);)i++;const a=e.slice(t,i),o=this.context?.lookupKeyword(a);if(o)return null;if(e.length>t+1&&bg.has(e[t+1])){const r=e.slice(t+1,i),n=this.context?.lookupKeyword(r),a=xg.has(r);if(!n&&!a&&r.length<3)return null}const s=e.slice(t+1,i),l=this.context?.lookupKeyword(s),c=zg.has(r),u=xg.has(s);if(c&&u)return{value:r,length:1,metadata:{normalized:n,procliticType:n,isEventMarker:!0}};if(1===s.length&&bg.has(s))return null;if(!l&&!u&&2>s.length)return null;return{value:r,length:1,metadata:{normalized:n,procliticType:n,isEventMarker:c&&l}}}}}});function Ag(e){const t=e.charCodeAt(0);return t>=48&&57>=t||t>=65&&90>=t||t>=97&&122>=t||95===t||36===t}var Lg=Cd({"src/tokenizers/extractors/ascii-identifier.ts"(){Sg=class{constructor(){this.name="ascii-identifier"}setContext(e){this.context=e}canExtract(e,t){return function(e){const t=e.charCodeAt(0);return t>=65&&90>=t||t>=97&&122>=t||95===t||36===t}(e[t])}extract(e,t){if(!this.context)throw Error("AsciiIdentifierExtractor: context not set");const r=t;let n="",i=t;for(;e.length>i&&Ag(e[i]);)n+=e[i],i++;if(!n)return null;const a=this.context.lookupKeyword(n);return{value:n,length:i-r,metadata:{normalized:a&&a.normalized!==a.native?a.normalized:void 0}}}}}}),jg=Cd({"src/tokenizers/extractors/index.ts"(){zy(),xy(),Cy(),Ay()}});function Pg(){return[new by,new ky,new Ty,new hy]}var Og,Ng=Cd({"src/tokenizers/extractor-helpers.ts"(){jg()}});function Rg(e){return/[a-zA-Z0-9_]/.test(e)}var Mg,Ig,Wg,_g=Cd({"src/tokenizers/extractors/english-keyword.ts"(){Og=class{constructor(){this.name="english-keyword"}setContext(e){this.context=e}canExtract(e,t){return/[a-zA-Z_]/.test(e[t])}extract(e,t){if(!this.context)throw Error("EnglishKeywordExtractor: context not set");let r=t,n="";for(;e.length>r&&Rg(e[r]);)n+=e[r++];if(!n)return null;if(e.length>r&&":"===e[r]){const t=r;r++;let i="";for(;e.length>r&&Rg(e[r]);)i+=e[r++];i?n=n+":"+i:r=t}const i=this.context.lookupKeyword(n),a=i&&i.normalized!==i.native?i.normalized:void 0;let o=null;return this.context.isKeyword(n)||(o=this.tryClassSyntaxConversion(e,r,n)),{value:o||n,length:r-t,metadata:{normalized:a,classConversion:!!o||void 0}}}tryClassSyntaxConversion(e,t,r){let n=t;for(;e.length>n&&/\s/.test(e[n]);)n++;if("class"===e.slice(n,n+5).toLowerCase()){const t=n+5;if(t>=e.length||!Rg(e[t]))return"."+r}return null}}}}),qg={};Ad(qg,{EnglishTokenizer:()=>Ig,englishTokenizer:()=>Wg});var $g,Vg,Dg,Bg=Cd({"src/tokenizers/english.ts"(){fy(),Ff(),yy(),Ng(),_g(),Mg=[{native:"true",normalized:"true"},{native:"false",normalized:"false"},{native:"null",normalized:"null"},{native:"undefined",normalized:"undefined"},{native:"first",normalized:"first"},{native:"last",normalized:"last"},{native:"next",normalized:"next"},{native:"previous",normalized:"previous"},{native:"closest",normalized:"closest"},{native:"click",normalized:"click"},{native:"dblclick",normalized:"dblclick"},{native:"mousedown",normalized:"mousedown"},{native:"mouseup",normalized:"mouseup"},{native:"mouseover",normalized:"mouseover"},{native:"mouseout",normalized:"mouseout"},{native:"mouseenter",normalized:"mouseenter"},{native:"mouseleave",normalized:"mouseleave"},{native:"mousemove",normalized:"mousemove"},{native:"keydown",normalized:"keydown"},{native:"keyup",normalized:"keyup"},{native:"keypress",normalized:"keypress"},{native:"input",normalized:"input"},{native:"change",normalized:"change"},{native:"submit",normalized:"submit"},{native:"reset",normalized:"reset"},{native:"load",normalized:"load"},{native:"unload",normalized:"unload"},{native:"scroll",normalized:"scroll"},{native:"resize",normalized:"resize"},{native:"dragstart",normalized:"dragstart"},{native:"drag",normalized:"drag"},{native:"dragend",normalized:"dragend"},{native:"dragenter",normalized:"dragenter"},{native:"dragleave",normalized:"dragleave"},{native:"dragover",normalized:"dragover"},{native:"drop",normalized:"drop"},{native:"touchstart",normalized:"touchstart"},{native:"touchmove",normalized:"touchmove"},{native:"touchend",normalized:"touchend"},{native:"touchcancel",normalized:"touchcancel"},{native:"in",normalized:"in"},{native:"to",normalized:"to"},{native:"at",normalized:"at"},{native:"by",normalized:"by"},{native:"with",normalized:"with"},{native:"without",normalized:"without"},{native:"of",normalized:"of"},{native:"as",normalized:"as"},{native:"every",normalized:"every"},{native:"upon",normalized:"upon"},{native:"unless",normalized:"unless"},{native:"forever",normalized:"forever"},{native:"times",normalized:"times"},{native:"and",normalized:"and"},{native:"or",normalized:"or"},{native:"not",normalized:"not"},{native:"is",normalized:"is"},{native:"exists",normalized:"exists"},{native:"empty",normalized:"empty"},{native:"my",normalized:"my"},{native:"your",normalized:"your"},{native:"its",normalized:"its"},{native:"the",normalized:"the"},{native:"a",normalized:"a"},{native:"an",normalized:"an"},{native:"delete",normalized:"delete"},{native:"innerHTML",normalized:"innerHTML"},{native:"outerHTML",normalized:"outerHTML"},{native:"beforebegin",normalized:"beforebegin"},{native:"afterend",normalized:"afterend"},{native:"beforeend",normalized:"beforeend"},{native:"afterbegin",normalized:"afterbegin"},{native:"flip",normalized:"toggle"},{native:"switch",normalized:"toggle"},{native:"increase",normalized:"increment"},{native:"decrease",normalized:"decrement"},{native:"display",normalized:"show"},{native:"reveal",normalized:"show"},{native:"conceal",normalized:"hide"},{native:"colour",normalized:"color"},{native:"grey",normalized:"gray"},{native:"centre",normalized:"center"},{native:"behaviour",normalized:"behavior"},{native:"initialise",normalized:"initialize"},{native:"favourite",normalized:"favorite"}],Wg=new(Ig=class extends ud{constructor(){super(),this.language="en",this.direction="ltr",this.initializeKeywordsFromProfile(Df,Mg),this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractors([new Og]),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){return this.isKeyword(e)?"keyword":e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||e.startsWith("http")?"url":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":["==","!=","<=",">=","<",">","&&","||","!"].includes(e)?"operator":"identifier"}})}}),Hg=Cd({"src/tokenizers/morphology/types.ts"(){}});function Kg(e){const t=e.charCodeAt(0);return t>=12352&&12447>=t}function Fg(e){const t=e.charCodeAt(0);return t>=12448&&12543>=t}function Ug(e){const t=e.charCodeAt(0);return t>=19968&&40959>=t||t>=13312&&19903>=t}var Gg,Zg,Yg,Xg,Jg=Cd({"src/tokenizers/morphology/japanese-normalizer.ts"(){Hg(),$g=[{pattern:"\u3057\u305f\u3089",confidence:.88,conjugationType:"conditional-tara",minStemLength:2},{pattern:"\u3059\u308b\u3068",confidence:.88,conjugationType:"conditional-to",minStemLength:2},{pattern:"\u3059\u308c\u3070",confidence:.85,conjugationType:"conditional-ba",minStemLength:2},{pattern:"\u305f\u3089",confidence:.85,conjugationType:"conditional-tara",minStemLength:2},{pattern:"\u308c\u3070",confidence:.82,conjugationType:"conditional-ba",minStemLength:2},{pattern:"\u3066\u3044\u307e\u3057\u305f",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"\u3066\u3044\u307e\u3059",confidence:.85,conjugationType:"progressive",minStemLength:2},{pattern:"\u3066\u304f\u3060\u3055\u3044",confidence:.85,conjugationType:"request",minStemLength:2},{pattern:"\u3067\u304f\u3060\u3055\u3044",confidence:.85,conjugationType:"request",minStemLength:2},{pattern:"\u3066\u3044\u308b",confidence:.85,conjugationType:"progressive",minStemLength:2},{pattern:"\u3066\u304a\u304f",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"\u3066\u307f\u308b",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"\u3066\u3042\u308b",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"\u3066\u304f\u308c",confidence:.8,conjugationType:"casual-request",minStemLength:2},{pattern:"\u3067\u304f\u308c",confidence:.8,conjugationType:"casual-request",minStemLength:2},{pattern:"\u3061\u3083\u3063\u305f",confidence:.82,conjugationType:"contracted-past",minStemLength:2},{pattern:"\u3058\u3083\u3063\u305f",confidence:.82,conjugationType:"contracted-past",minStemLength:2},{pattern:"\u3061\u3083\u3046",confidence:.82,conjugationType:"contracted",minStemLength:2},{pattern:"\u3058\u3083\u3046",confidence:.82,conjugationType:"contracted",minStemLength:2},{pattern:"\u307e\u3057\u305f",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"\u307e\u305b\u3093",confidence:.85,conjugationType:"negative",minStemLength:2},{pattern:"\u307e\u3059",confidence:.85,conjugationType:"polite",minStemLength:2},{pattern:"\u3066",confidence:.85,conjugationType:"te-form",minStemLength:2},{pattern:"\u305f",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"\u306a\u3044",confidence:.82,conjugationType:"negative",minStemLength:2},{pattern:"\u306a\u304b\u3063\u305f",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"\u3089\u308c\u308b",confidence:.8,conjugationType:"potential",minStemLength:2},{pattern:"\u308c\u308b",confidence:.78,conjugationType:"potential",minStemLength:2},{pattern:"\u3089\u308c\u305f",confidence:.8,conjugationType:"passive",minStemLength:2},{pattern:"\u3055\u305b\u308b",confidence:.8,conjugationType:"causative",minStemLength:2},{pattern:"\u305b\u308b",confidence:.78,conjugationType:"causative",minStemLength:2},{pattern:"\u3088\u3046",confidence:.8,conjugationType:"volitional",minStemLength:2},{pattern:"\u308b",confidence:.75,conjugationType:"dictionary",minStemLength:3}],Vg=[{pattern:"\u3057\u305f\u3089",confidence:.88,conjugationType:"conditional-tara"},{pattern:"\u3059\u308b\u3068",confidence:.88,conjugationType:"conditional-to"},{pattern:"\u3059\u308c\u3070",confidence:.85,conjugationType:"conditional-ba"},{pattern:"\u3057\u3066\u3044\u307e\u3059",confidence:.85,conjugationType:"progressive"},{pattern:"\u3057\u3066\u3044\u308b",confidence:.85,conjugationType:"progressive"},{pattern:"\u3057\u307e\u3057\u305f",confidence:.85,conjugationType:"past"},{pattern:"\u3057\u307e\u3059",confidence:.85,conjugationType:"polite"},{pattern:"\u3057\u306a\u3044",confidence:.82,conjugationType:"negative"},{pattern:"\u3057\u3066",confidence:.85,conjugationType:"te-form"},{pattern:"\u3057\u305f",confidence:.85,conjugationType:"past"},{pattern:"\u3059\u308b",confidence:.88,conjugationType:"dictionary"}],new(Dg=class{constructor(){this.language="ja"}isNormalizable(e){if(!function(e){for(const t of e)if(Kg(t)||Fg(t)||Ug(t))return!0;return!1}(e))return!1;if(2>e.length)return!1;return Kg(e[e.length-1])}normalize(e){const t=this.normalizeCompound(e);if(t)return t;const r=this.trySuruNormalization(e);if(r)return r;for(const t of $g)if(e.endsWith(t.pattern)){const r=e.slice(0,-t.pattern.length);if((t.minStemLength??2)>r.length)continue;const n={removedSuffixes:[t.pattern]};return t.conjugationType&&(n.conjugationType=t.conjugationType),vd(r,t.confidence,n)}return yd(e)}trySuruNormalization(e){for(const t of Vg)if(e.endsWith(t.pattern)){const r=e.slice(0,-t.pattern.length);if(1>r.length)continue;return vd(r,t.confidence,{removedSuffixes:[t.pattern],conjugationType:t.conjugationType,originalForm:"suru-verb"})}return null}normalizeCompound(e){const t=[{pattern:"\u3066\u3044\u306a\u304b\u3063\u305f",suffixes:["\u3066","\u3044","\u306a\u304b\u3063\u305f"],confidence:.8,minStemLength:2},{pattern:"\u3067\u3044\u306a\u304b\u3063\u305f",suffixes:["\u3067","\u3044","\u306a\u304b\u3063\u305f"],confidence:.8,minStemLength:2},{pattern:"\u3066\u3044\u306a\u3044",suffixes:["\u3066","\u3044","\u306a\u3044"],confidence:.82,minStemLength:2},{pattern:"\u3067\u3044\u306a\u3044",suffixes:["\u3067","\u3044","\u306a\u3044"],confidence:.82,minStemLength:2},{pattern:"\u3066\u3044\u305f",suffixes:["\u3066","\u3044","\u305f"],confidence:.85,minStemLength:2},{pattern:"\u3067\u3044\u305f",suffixes:["\u3067","\u3044","\u305f"],confidence:.85,minStemLength:2}];for(const{pattern:r,suffixes:n,confidence:i,minStemLength:a}of t)if(e.endsWith(r)){const t=e.slice(0,-r.length);if(a>t.length)continue;return vd(t,i,{removedSuffixes:n,conjugationType:"compound"})}return null}})}}),Qg={};Ad(Qg,{JapaneseTokenizer:()=>Yg,japaneseTokenizer:()=>Xg});var ek,tk,rk,nk=Cd({"src/tokenizers/japanese.ts"(){fy(),Jg(),mh(),yy(),Ng(),My(),Iy(),Lg(),Gg=new Set(["\u3092","\u306b","\u3067","\u304b\u3089","\u307e\u3067","\u3078","\u3068","\u306e","\u304c","\u306f","\u3082","\u3088\u308a"]),Zg=[{native:"\u771f",normalized:"true"},{native:"\u507d",normalized:"false"},{native:"\u30cc\u30eb",normalized:"null"},{native:"\u672a\u5b9a\u7fa9",normalized:"undefined"},{native:"\u6700\u521d",normalized:"first"},{native:"\u6700\u5f8c",normalized:"last"},{native:"\u6b21",normalized:"next"},{native:"\u524d",normalized:"previous"},{native:"\u6700\u3082\u8fd1\u3044",normalized:"closest"},{native:"\u89aa",normalized:"parent"},{native:"\u306e\u4e2d",normalized:"in"},{native:"\u30af\u30ea\u30c3\u30af",normalized:"click"},{native:"\u5909\u66f4",normalized:"change"},{native:"\u9001\u4fe1",normalized:"submit"},{native:"\u5165\u529b",normalized:"input"},{native:"\u30ed\u30fc\u30c9",normalized:"load"},{native:"\u8aad\u307f\u8fbc\u307f",normalized:"load"},{native:"\u30b9\u30af\u30ed\u30fc\u30eb",normalized:"scroll"},{native:"\u30ad\u30fc\u30c0\u30a6\u30f3",normalized:"keydown"},{native:"\u30ad\u30fc\u30a2\u30c3\u30d7",normalized:"keyup"},{native:"\u30de\u30a6\u30b9\u30aa\u30fc\u30d0\u30fc",normalized:"mouseover"},{native:"\u30de\u30a6\u30b9\u30a2\u30a6\u30c8",normalized:"mouseout"},{native:"\u30de\u30a6\u30b9\u62bc\u4e0b",normalized:"mousedown"},{native:"\u30de\u30a6\u30b9\u89e3\u653e",normalized:"mouseup"},{native:"\u307e\u305f\u306f",normalized:"or"},{native:"\u79c1",normalized:"me"},{native:"\u5bfe\u8c61",normalized:"target"},{native:"\u3057\u305f\u3089",normalized:"on"},{native:"\u3059\u308b\u3068",normalized:"on"},{native:"\u6642\u306b",normalized:"on"},{native:"\u79d2",normalized:"s"},{native:"\u30df\u30ea\u79d2",normalized:"ms"},{native:"\u5206",normalized:"m"},{native:"\u6642\u9593",normalized:"h"},{native:"\u542b\u3080",normalized:"inclusive"},{native:"\u9664\u304f",normalized:"exclusive"},{native:"\u6587\u5b57",normalized:"characters"},{native:"\u30e9\u30f3\u30c0\u30e0",normalized:"random"}],Xg=new(Yg=class extends ud{constructor(){super(),this.language="ja",this.direction="ltr",this.initializeKeywordsFromProfile(ch,Zg),this.normalizer=new Dg,this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractor(new Sg),this.registerExtractor(new Oy),this.registerExtractor(new Sy),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){return Gg.has(e)?"particle":this.isKeyword(e)?"keyword":e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||e.startsWith("http")?"url":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||e.startsWith("\u300c")||/^\d/.test(e)?"literal":"identifier"}})}});function ik(e){const t=e.charCodeAt(0);return t>=44032&&55203>=t}var ak,ok,sk,lk,ck=Cd({"src/tokenizers/morphology/korean-normalizer.ts"(){Hg(),ek=[{pattern:"\ud558\uc2dc\ub2c8\uae4c",confidence:.85,conjugationType:"honorific-causal",minStemLength:1},{pattern:"\ud558\uc2e4\ub54c",confidence:.88,conjugationType:"honorific-temporal",minStemLength:1},{pattern:"\ud558\uc2e4 \ub54c",confidence:.88,conjugationType:"honorific-temporal",minStemLength:1},{pattern:"\ud558\uc2dc\uba74",confidence:.88,conjugationType:"honorific-conditional",minStemLength:1},{pattern:"\uc73c\uc2dc\uba74",confidence:.85,conjugationType:"honorific-conditional",minStemLength:2},{pattern:"\uc2dc\uba74",confidence:.82,conjugationType:"honorific-conditional",minStemLength:2},{pattern:"\ud558\uace0\ub098\uc11c",confidence:.85,conjugationType:"sequential-after",minStemLength:1},{pattern:"\ud558\uace0 \ub098\uc11c",confidence:.85,conjugationType:"sequential-after",minStemLength:1},{pattern:"\ud558\uace0\uc11c",confidence:.85,conjugationType:"sequential-after",minStemLength:1},{pattern:"\uace0\ub098\uc11c",confidence:.82,conjugationType:"sequential-after",minStemLength:2},{pattern:"\uace0 \ub098\uc11c",confidence:.82,conjugationType:"sequential-after",minStemLength:2},{pattern:"\uace0\uc11c",confidence:.82,conjugationType:"sequential-after",minStemLength:2},{pattern:"\ud558\uae30\uc804\uc5d0",confidence:.85,conjugationType:"sequential-before",minStemLength:1},{pattern:"\ud558\uae30 \uc804\uc5d0",confidence:.85,conjugationType:"sequential-before",minStemLength:1},{pattern:"\uae30\uc804\uc5d0",confidence:.82,conjugationType:"sequential-before",minStemLength:2},{pattern:"\uae30 \uc804\uc5d0",confidence:.82,conjugationType:"sequential-before",minStemLength:2},{pattern:"\ud558\uc790\ub9c8\uc790",confidence:.88,conjugationType:"immediate",minStemLength:1},{pattern:"\uc790\ub9c8\uc790",confidence:.85,conjugationType:"immediate",minStemLength:2},{pattern:"\ud574\uc57c\ud574\uc694",confidence:.85,conjugationType:"obligation",minStemLength:1},{pattern:"\ud574\uc57c\ud574",confidence:.85,conjugationType:"obligation",minStemLength:1},{pattern:"\ud574\uc57c\ud558\ub2e4",confidence:.85,conjugationType:"obligation",minStemLength:1},{pattern:"\uc5b4\uc57c\ud574\uc694",confidence:.82,conjugationType:"obligation",minStemLength:2},{pattern:"\uc5b4\uc57c\ud574",confidence:.82,conjugationType:"obligation",minStemLength:2},{pattern:"\uc544\uc57c\ud574\uc694",confidence:.82,conjugationType:"obligation",minStemLength:2},{pattern:"\uc544\uc57c\ud574",confidence:.82,conjugationType:"obligation",minStemLength:2},{pattern:"\ud558\ub2c8\uae4c",confidence:.85,conjugationType:"causal-nikka",minStemLength:1},{pattern:"\ud560\ub54c",confidence:.88,conjugationType:"temporal-ttae",minStemLength:1},{pattern:"\ud560 \ub54c",confidence:.88,conjugationType:"temporal-ttae",minStemLength:1},{pattern:"\uc744\ub54c",confidence:.85,conjugationType:"temporal-ttae",minStemLength:2},{pattern:"\uc744 \ub54c",confidence:.85,conjugationType:"temporal-ttae",minStemLength:2},{pattern:"\ud558\uba74",confidence:.88,conjugationType:"conditional-myeon",minStemLength:1},{pattern:"\uc73c\uba74",confidence:.85,conjugationType:"conditional-myeon",minStemLength:2},{pattern:"\ub2c8\uae4c",confidence:.82,conjugationType:"causal-nikka",minStemLength:2},{pattern:"\uba74",confidence:.8,conjugationType:"conditional-myeon",minStemLength:2},{pattern:"\ud558\uc600\uc2b5\ub2c8\ub2e4",confidence:.85,conjugationType:"past",minStemLength:1},{pattern:"\ud588\uc2b5\ub2c8\ub2e4",confidence:.85,conjugationType:"past",minStemLength:1},{pattern:"\ud569\ub2c8\ub2e4",confidence:.85,conjugationType:"polite",minStemLength:1},{pattern:"\uc2b5\ub2c8\ub2e4",confidence:.82,conjugationType:"polite",minStemLength:2},{pattern:"\ub429\ub2c8\ub2e4",confidence:.82,conjugationType:"polite",minStemLength:1},{pattern:"\u3142\ub2c8\ub2e4",confidence:.82,conjugationType:"polite",minStemLength:2},{pattern:"\ud558\uc138\uc694",confidence:.85,conjugationType:"honorific",minStemLength:1},{pattern:"\ud558\uc2ed\uc2dc\uc624",confidence:.85,conjugationType:"honorific",minStemLength:1},{pattern:"\uc138\uc694",confidence:.82,conjugationType:"honorific",minStemLength:2},{pattern:"\uc2ed\uc2dc\uc624",confidence:.82,conjugationType:"honorific",minStemLength:2},{pattern:"\ud558\uace0\uc788\uc5b4\uc694",confidence:.82,conjugationType:"progressive",minStemLength:1},{pattern:"\ud558\uace0\uc788\uc5b4",confidence:.82,conjugationType:"progressive",minStemLength:1},{pattern:"\ud588\uc5b4\uc694",confidence:.85,conjugationType:"past",minStemLength:1},{pattern:"\ud574\uc694",confidence:.85,conjugationType:"polite",minStemLength:1},{pattern:"\uc5b4\uc694",confidence:.82,conjugationType:"polite",minStemLength:2},{pattern:"\uc544\uc694",confidence:.82,conjugationType:"polite",minStemLength:2},{pattern:"\ud588\uc5b4",confidence:.85,conjugationType:"past",minStemLength:1},{pattern:"\ud574",confidence:.8,conjugationType:"present",minStemLength:1},{pattern:"\uc5c8\uc5b4",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"\uc558\uc5b4",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"\ud558\uace0\uc788\ub2e4",confidence:.82,conjugationType:"progressive",minStemLength:1},{pattern:"\uace0\uc788\ub2e4",confidence:.8,conjugationType:"progressive",minStemLength:2},{pattern:"\uace0\uc788\uc5b4",confidence:.8,conjugationType:"progressive",minStemLength:2},{pattern:"\ud558\ub2e4",confidence:.88,conjugationType:"dictionary",minStemLength:1},{pattern:"\ud558\uc9c0\uc54a\ub2e4",confidence:.82,conjugationType:"negative",minStemLength:1},{pattern:"\uc548\ud558\ub2e4",confidence:.82,conjugationType:"negative",minStemLength:1},{pattern:"\uc9c0\uc54a\ub2e4",confidence:.8,conjugationType:"negative",minStemLength:2},{pattern:"\ud574\ub77c",confidence:.82,conjugationType:"imperative",minStemLength:1},{pattern:"\ud558\ub77c",confidence:.82,conjugationType:"imperative",minStemLength:1},{pattern:"\ub2e4",confidence:.75,conjugationType:"dictionary",minStemLength:2}],tk=[{pattern:"\ud558\uc2dc\ub2c8\uae4c",confidence:.88,conjugationType:"honorific-causal"},{pattern:"\ud558\uc2e4\ub54c",confidence:.88,conjugationType:"honorific-temporal"},{pattern:"\ud558\uc2e4 \ub54c",confidence:.88,conjugationType:"honorific-temporal"},{pattern:"\ud558\uc2dc\uba74",confidence:.88,conjugationType:"honorific-conditional"},{pattern:"\ud558\uc168\uc5b4\uc694",confidence:.85,conjugationType:"honorific-past"},{pattern:"\ud558\uc168\uc5b4",confidence:.85,conjugationType:"honorific-past"},{pattern:"\ud558\uc2ed\ub2c8\ub2e4",confidence:.85,conjugationType:"honorific-polite"},{pattern:"\ud558\uace0\ub098\uc11c",confidence:.88,conjugationType:"sequential-after"},{pattern:"\ud558\uace0 \ub098\uc11c",confidence:.88,conjugationType:"sequential-after"},{pattern:"\ud558\uace0\uc11c",confidence:.88,conjugationType:"sequential-after"},{pattern:"\ud558\uae30\uc804\uc5d0",confidence:.88,conjugationType:"sequential-before"},{pattern:"\ud558\uae30 \uc804\uc5d0",confidence:.88,conjugationType:"sequential-before"},{pattern:"\ud558\uc790\ub9c8\uc790",confidence:.88,conjugationType:"immediate"},{pattern:"\ud574\uc57c\ud574\uc694",confidence:.88,conjugationType:"obligation"},{pattern:"\ud574\uc57c\ud574",confidence:.88,conjugationType:"obligation"},{pattern:"\ud574\uc57c\ud558\ub2e4",confidence:.88,conjugationType:"obligation"},{pattern:"\ud558\ub2c8\uae4c",confidence:.88,conjugationType:"causal-nikka"},{pattern:"\ud560\ub54c",confidence:.88,conjugationType:"temporal-ttae"},{pattern:"\ud560 \ub54c",confidence:.88,conjugationType:"temporal-ttae"},{pattern:"\ud558\uba74",confidence:.88,conjugationType:"conditional-myeon"},{pattern:"\ud558\uc600\uc2b5\ub2c8\ub2e4",confidence:.85,conjugationType:"past"},{pattern:"\ud588\uc2b5\ub2c8\ub2e4",confidence:.85,conjugationType:"past"},{pattern:"\ud569\ub2c8\ub2e4",confidence:.85,conjugationType:"polite"},{pattern:"\ud558\uc2ed\uc2dc\uc624",confidence:.85,conjugationType:"honorific"},{pattern:"\ud558\uc138\uc694",confidence:.85,conjugationType:"honorific"},{pattern:"\ud588\uc5b4\uc694",confidence:.85,conjugationType:"past"},{pattern:"\ud574\uc694",confidence:.85,conjugationType:"polite"},{pattern:"\ud588\uc5b4",confidence:.85,conjugationType:"past"},{pattern:"\ud574",confidence:.8,conjugationType:"present"},{pattern:"\ud558\uace0\uc788\uc5b4\uc694",confidence:.82,conjugationType:"progressive"},{pattern:"\ud558\uace0\uc788\uc5b4",confidence:.82,conjugationType:"progressive"},{pattern:"\ud558\uace0\uc788\ub2e4",confidence:.82,conjugationType:"progressive"},{pattern:"\ud574\uc11c",confidence:.82,conjugationType:"connective"},{pattern:"\ud558\uace0",confidence:.8,conjugationType:"connective"},{pattern:"\ud558\uc9c0\uc54a\uc544\uc694",confidence:.82,conjugationType:"negative"},{pattern:"\ud558\uc9c0\uc54a\ub2e4",confidence:.82,conjugationType:"negative"},{pattern:"\uc548\ud574\uc694",confidence:.82,conjugationType:"negative"},{pattern:"\uc548\ud574",confidence:.82,conjugationType:"negative"},{pattern:"\ud574\ub77c",confidence:.82,conjugationType:"imperative"},{pattern:"\ud558\ub77c",confidence:.82,conjugationType:"imperative"},{pattern:"\ud558\ub2e4",confidence:.88,conjugationType:"dictionary"}],new(rk=class{constructor(){this.language="ko"}isNormalizable(e){return!!function(e){for(const t of e)if(ik(t))return!0;return!1}(e)&&2<=e.length}normalize(e){const t=this.normalizeCompound(e);if(t)return t;const r=this.tryHadaNormalization(e);if(r)return r;for(const t of ek)if(e.endsWith(t.pattern)){const r=e.slice(0,-t.pattern.length);if((t.minStemLength??2)>r.length)continue;const n={removedSuffixes:[t.pattern]};return t.conjugationType&&(n.conjugationType=t.conjugationType),vd(r,t.confidence,n)}return yd(e)}tryHadaNormalization(e){for(const t of tk)if(e.endsWith(t.pattern)){const r=e.slice(0,-t.pattern.length);if(1>r.length)continue;return vd(r,t.confidence,{removedSuffixes:[t.pattern],conjugationType:t.conjugationType,originalForm:"hada-verb"})}return null}normalizeCompound(e){const t=[{pattern:"\ud558\uace0\ub098\uc11c\uc600\uc5b4",suffixes:["\ud558\uace0\ub098\uc11c","\uc600\uc5b4"],confidence:.78,conjugationType:"sequential-after",minStemLength:2},{pattern:"\ud558\uace0\ub098\uc11c\uc600\ub2e4",suffixes:["\ud558\uace0\ub098\uc11c","\uc600\ub2e4"],confidence:.78,conjugationType:"sequential-after",minStemLength:2},{pattern:"\ud558\uace0\ub098\uc11c",suffixes:["\ud558\uace0","\ub098\uc11c"],confidence:.85,conjugationType:"sequential-after",minStemLength:2},{pattern:"\ud574\uc57c\ud588\uc5b4",suffixes:["\ud574\uc57c","\ud588\uc5b4"],confidence:.8,conjugationType:"obligation",minStemLength:2},{pattern:"\ud574\uc57c\ud588\ub2e4",suffixes:["\ud574\uc57c","\ud588\ub2e4"],confidence:.8,conjugationType:"obligation",minStemLength:2},{pattern:"\ud574\uc57c\ud588\uc2b5\ub2c8\ub2e4",suffixes:["\ud574\uc57c","\ud588\uc2b5\ub2c8\ub2e4"],confidence:.8,conjugationType:"obligation",minStemLength:2},{pattern:"\ud558\uc2dc\uba74\uc11c",suffixes:["\ud558\uc2dc","\uba74\uc11c"],confidence:.82,conjugationType:"connective",minStemLength:2},{pattern:"\ud558\uc2dc\uba70",suffixes:["\ud558\uc2dc","\uba70"],confidence:.82,conjugationType:"connective",minStemLength:2},{pattern:"\ud558\uace0\uc788\uc5c8\uc5b4",suffixes:["\ud558\uace0","\uc788\uc5c8\uc5b4"],confidence:.8,conjugationType:"progressive",minStemLength:2},{pattern:"\ud558\uace0\uc788\uc5c8\ub2e4",suffixes:["\ud558\uace0","\uc788\uc5c8\ub2e4"],confidence:.8,conjugationType:"progressive",minStemLength:2}];for(const{pattern:r,suffixes:n,confidence:i,conjugationType:a,minStemLength:o}of t)if(e.endsWith(r)){const t=e.slice(0,-r.length);if(o>t.length)continue;return vd(t,i,{removedSuffixes:n,conjugationType:a})}return null}})}}),uk={};Ad(uk,{KoreanTokenizer:()=>sk,koreanTokenizer:()=>lk});var pk,dk,mk,fk,hk,yk=Cd({"src/tokenizers/korean.ts"(){fy(),ck(),yh(),yy(),Ng(),Vy(),Hy(),Lg(),ak=new Set(["\uc774","\uac00","\uc744","\ub97c","\uc740","\ub294","\uc5d0","\uc5d0\uc11c","\ub85c","\uc73c\ub85c","\uc640","\uacfc","\uc758","\ub3c4","\ub9cc","\ubd80\ud130","\uae4c\uc9c0","\ucc98\ub7fc","\ubcf4\ub2e4"]),ok=[{native:"\ucc38",normalized:"true"},{native:"\uac70\uc9d3",normalized:"false"},{native:"\ub110",normalized:"null"},{native:"\ubbf8\uc815\uc758",normalized:"undefined"},{native:"\uc815\uc758\uc548\ub428",normalized:"undefined"},{native:"\uccab\ubc88\uc9f8",normalized:"first"},{native:"\ub9c8\uc9c0\ub9c9",normalized:"last"},{native:"\ub2e4\uc74c",normalized:"next"},{native:"\uc774\uc804",normalized:"previous"},{native:"\uac00\uc7a5\uac00\uae4c\uc6b4",normalized:"closest"},{native:"\ubd80\ubaa8",normalized:"parent"},{native:"\uc548\uc5d0",normalized:"in"},{native:"\ud074\ub9ad",normalized:"click"},{native:"\ub354\ube14\ud074\ub9ad",normalized:"dblclick"},{native:"\ubcc0\uacbd",normalized:"change"},{native:"\uc81c\ucd9c",normalized:"submit"},{native:"\uc785\ub825",normalized:"input"},{native:"\ub85c\ub4dc",normalized:"load"},{native:"\uc2a4\ud06c\ub864",normalized:"scroll"},{native:"\ud0a4\ub2e4\uc6b4",normalized:"keydown"},{native:"\ud0a4\uc5c5",normalized:"keyup"},{native:"\ub9c8\uc6b0\uc2a4\uc624\ubc84",normalized:"mouseover"},{native:"\ub9c8\uc6b0\uc2a4\uc544\uc6c3",normalized:"mouseout"},{native:"\ub9c8\uc6b0\uc2a4\ub2e4\uc6b4",normalized:"mousedown"},{native:"\ub9c8\uc6b0\uc2a4\uc5c5",normalized:"mouseup"},{native:"\ub0b4",normalized:"my"},{native:"\uadf8\uac83\uc758",normalized:"its"},{native:"\uadf8\ub2e4\uc74c",normalized:"then"},{native:"\uadf8\ub7f0\ud6c4",normalized:"then"},{native:"\uadf8\ub7ec\uba74",normalized:"then"},{native:"\uadf8\ub9ac\uace0",normalized:"and"},{native:"\ub610\ub294",normalized:"or"},{native:"\uc544\ub2c8",normalized:"not"},{native:"\uc774\ub2e4",normalized:"is"},{native:"\ucd08",normalized:"s"},{native:"\ubc00\ub9ac\ucd08",normalized:"ms"},{native:"\ubd84",normalized:"m"},{native:"\uc2dc\uac04",normalized:"h"},{native:"\ud3ec\ud568",normalized:"inclusive"},{native:"\uc81c\uc678",normalized:"exclusive"},{native:"\ubb38\uc790",normalized:"characters"},{native:"\ubb34\uc791\uc704",normalized:"random"}],lk=new(sk=class extends ud{constructor(){super(),this.language="ko",this.direction="ltr",this.initializeKeywordsFromProfile(dh,ok),this.normalizer=new rk,this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractor(new Sg),this.registerExtractor(new $y),this.registerExtractor(new Ry),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){return ak.has(e)?"particle":this.isKeyword(e)?"keyword":e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||e.startsWith("http")?"url":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":"identifier"}})}});function vk(e){const t=e.charCodeAt(0);return t>=1536&&1791>=t||t>=1872&&1919>=t||t>=2208&&2303>=t||t>=64336&&65023>=t||t>=65136&&65279>=t}var gk,kk,wk,bk,zk,xk=Cd({"src/tokenizers/morphology/arabic-normalizer.ts"(){Hg(),pk=[{pattern:"\u0648\u0627\u0644",confidencePenalty:.15,prefixType:"conjunction"},{pattern:"\u0641\u0627\u0644",confidencePenalty:.15,prefixType:"conjunction"},{pattern:"\u0628\u0627\u0644",confidencePenalty:.15,prefixType:"preposition"},{pattern:"\u0643\u0627\u0644",confidencePenalty:.15,prefixType:"preposition"},{pattern:"\u0644\u0644",confidencePenalty:.12,prefixType:"preposition"}],dk=[{pattern:"\u0627\u0644",confidencePenalty:.08,prefixType:"article",minRemaining:2},{pattern:"\u0648",confidencePenalty:.08,prefixType:"conjunction",minRemaining:3},{pattern:"\u0641",confidencePenalty:.08,prefixType:"conjunction",minRemaining:3},{pattern:"\u0628",confidencePenalty:.1,prefixType:"preposition",minRemaining:3},{pattern:"\u0644",confidencePenalty:.1,prefixType:"preposition",minRemaining:3},{pattern:"\u0643",confidencePenalty:.1,prefixType:"preposition",minRemaining:3}],mk=[{pattern:"\u064a",confidencePenalty:.12,prefixType:"verb-marker",minRemaining:3},{pattern:"\u062a",confidencePenalty:.12,prefixType:"verb-marker",minRemaining:3},{pattern:"\u0646",confidencePenalty:.12,prefixType:"verb-marker",minRemaining:3},{pattern:"\u0623",confidencePenalty:.12,prefixType:"verb-marker",minRemaining:3},{pattern:"\u0627",confidencePenalty:.12,prefixType:"verb-marker",minRemaining:3}],fk=[{pattern:"\u0648\u0646",confidencePenalty:.1,type:"masculine-plural"},{pattern:"\u064a\u0646",confidencePenalty:.1,type:"masculine-plural-accusative"},{pattern:"\u0627\u062a",confidencePenalty:.1,type:"feminine-plural"},{pattern:"\u0627\u0646",confidencePenalty:.1,type:"dual-nominative"},{pattern:"\u064a\u0646",confidencePenalty:.1,type:"dual-accusative"},{pattern:"\u0647\u0627",confidencePenalty:.1,type:"pronoun-her"},{pattern:"\u0647\u0645",confidencePenalty:.1,type:"pronoun-them"},{pattern:"\u0647\u0646",confidencePenalty:.1,type:"pronoun-them-f"},{pattern:"\u0646\u0627",confidencePenalty:.1,type:"pronoun-us"},{pattern:"\u0643\u0645",confidencePenalty:.1,type:"pronoun-you-pl"},{pattern:"\u0643",confidencePenalty:.08,type:"pronoun-you"},{pattern:"\u0647",confidencePenalty:.08,type:"pronoun-him"},{pattern:"\u064a",confidencePenalty:.08,type:"pronoun-me"},{pattern:"\u0629",confidencePenalty:.08,type:"feminine"}],new(hk=class{constructor(){this.language="ar"}isNormalizable(e){return!!function(e){for(const t of e)if(vk(t))return!0;return!1}(e)&&2<=e.length}normalize(e){let t=function(e){return e.replace(/[\u064B-\u0652\u0670]/g,"")}(e),r=1;const n=[],i=[];for(const e of pk)if(t.startsWith(e.pattern)){const i=t.slice(e.pattern.length);if(i.length>=2){t=i,r-=e.confidencePenalty,n.push(e.pattern);break}}if(0===n.length)for(const e of dk)if(t.startsWith(e.pattern)){const i=t.slice(e.pattern.length);if(i.length>=(e.minRemaining??2)){t=i,r-=e.confidencePenalty,n.push(e.pattern);break}}if(!(t.endsWith("\u0627\u062a")||t.endsWith("\u0629")||t.endsWith("\u0648\u0646")||t.endsWith("\u064a\u0646")||t.endsWith("\u0647\u0627")||t.endsWith("\u0647\u0645")||t.endsWith("\u0647\u0646")||t.endsWith("\u0646\u0627")||t.endsWith("\u0643\u0645"))&&(0===n.length||"\u0648"===n[0]||"\u0641"===n[0]))for(const e of mk)if(t.startsWith(e.pattern)){const i=t.slice(e.pattern.length);if(i.length>=(e.minRemaining??3)){t=i,r-=e.confidencePenalty,n.push(e.pattern);break}}for(const e of fk)if(t.endsWith(e.pattern)){const n=t.slice(0,-e.pattern.length);2>n.length||(t=n,r-=e.confidencePenalty,i.push(e.pattern))}return r=Math.max(.5,r),0===n.length&&0===i.length?yd(e):vd(t,r,{removedPrefixes:n,removedSuffixes:i})}})}}),Ek={};Ad(Ek,{ArabicTokenizer:()=>bk,arabicTokenizer:()=>zk});var Tk,Sk,Ck,Ak,Lk,jk=Cd({"src/tokenizers/arabic.ts"(){fy(),xk(),Wf(),yy(),Ng(),hv(),Lg(),yv(),vv(),gk=new Set(["\u0648\u0644","\u0648\u0628","\u0648\u0643","\u0641\u0644","\u0641\u0628","\u0641\u0643"]),kk=new Set(["\u0641\u064a","\u0639\u0644\u0649","\u0645\u0646","\u0625\u0644\u0649","\u0627\u0644\u0649","\u0645\u0639","\u0639\u0646","\u0642\u0628\u0644","\u0628\u0639\u062f","\u0628\u064a\u0646","\u0628","\u0644","\u0643"]),wk=[{native:"\u0647\u062f\u0641",normalized:"target"},{native:"\u0646\u062a\u064a\u062c\u0629",normalized:"result"},{native:"\u0635\u062d\u064a\u062d",normalized:"true"},{native:"\u062e\u0637\u0623",normalized:"false"},{native:"null",normalized:"null"},{native:"\u0641\u0627\u0631\u063a",normalized:"null"},{native:"\u063a\u064a\u0631 \u0645\u0639\u0631\u0641",normalized:"undefined"},{native:"\u0627\u0644\u0623\u0648\u0644",normalized:"first"},{native:"\u0623\u0648\u0644",normalized:"first"},{native:"\u0627\u0644\u0623\u062e\u064a\u0631",normalized:"last"},{native:"\u0622\u062e\u0631",normalized:"last"},{native:"\u0627\u0644\u062a\u0627\u0644\u064a",normalized:"next"},{native:"\u0627\u0644\u0633\u0627\u0628\u0642",normalized:"previous"},{native:"\u0627\u0644\u0623\u0642\u0631\u0628",normalized:"closest"},{native:"\u0627\u0644\u0623\u0628",normalized:"parent"},{native:"\u0627\u0644\u0646\u0642\u0631",normalized:"click"},{native:"\u0646\u0642\u0631",normalized:"click"},{native:"\u0627\u0644\u0625\u062f\u062e\u0627\u0644",normalized:"input"},{native:"\u0625\u062f\u062e\u0627\u0644",normalized:"input"},{native:"\u0627\u0644\u062a\u063a\u064a\u064a\u0631",normalized:"change"},{native:"\u062a\u063a\u064a\u064a\u0631",normalized:"change"},{native:"\u0627\u0644\u0625\u0631\u0633\u0627\u0644",normalized:"submit"},{native:"\u0625\u0631\u0633\u0627\u0644",normalized:"submit"},{native:"\u0627\u0644\u062a\u0631\u0643\u064a\u0632",normalized:"focus"},{native:"\u0641\u0642\u062f\u0627\u0646 \u0627\u0644\u062a\u0631\u0643\u064a\u0632",normalized:"blur"},{native:"\u0636\u063a\u0637",normalized:"keydown"},{native:"\u0631\u0641\u0639",normalized:"keyup"},{native:"\u062a\u0645\u0631\u064a\u0631 \u0627\u0644\u0641\u0623\u0631\u0629",normalized:"mouseover"},{native:"\u0645\u063a\u0627\u062f\u0631\u0629 \u0627\u0644\u0641\u0623\u0631\u0629",normalized:"mouseout"},{native:"\u062a\u062d\u0645\u064a\u0644",normalized:"load"},{native:"\u062a\u0645\u0631\u064a\u0631",normalized:"scroll"},{native:"\u0641\u0623\u0631\u0629 \u0623\u0633\u0641\u0644",normalized:"mousedown"},{native:"\u0641\u0623\u0631\u0629 \u0623\u0639\u0644\u0649",normalized:"mouseup"},{native:"\u0641\u0623\u0631\u0629 \u062f\u062e\u0648\u0644",normalized:"mouseenter"},{native:"\u0641\u0623\u0631\u0629 \u062e\u0631\u0648\u062c",normalized:"mouseleave"},{native:"\u0641\u0623\u0631\u0629 \u0641\u0648\u0642",normalized:"mouseover"},{native:"\u0641\u0623\u0631\u0629 \u062e\u0627\u0631\u062c",normalized:"mouseout"},{native:"\u0641\u0623\u0631\u0629 \u062a\u062d\u0631\u0643",normalized:"mousemove"},{native:"\u0645\u0641\u062a\u0627\u062d \u0623\u0633\u0641\u0644",normalized:"keydown"},{native:"\u0645\u0641\u062a\u0627\u062d \u0623\u0639\u0644\u0649",normalized:"keyup"},{native:"\u0647\u064a",normalized:"it"},{native:"\u062b\u0627\u0646\u064a\u0629",normalized:"s"},{native:"\u062b\u0648\u0627\u0646\u064a",normalized:"s"},{native:"\u0645\u0644\u064a \u062b\u0627\u0646\u064a\u0629",normalized:"ms"},{native:"\u062f\u0642\u064a\u0642\u0629",normalized:"m"},{native:"\u062f\u0642\u0627\u0626\u0642",normalized:"m"},{native:"\u0633\u0627\u0639\u0629",normalized:"h"},{native:"\u0633\u0627\u0639\u0627\u062a",normalized:"h"},{native:"\u0639\u0646\u062f\u0645\u0627",normalized:"on"},{native:"\u062d\u064a\u0646\u0645\u0627",normalized:"on"},{native:"\u0639\u0646\u062f",normalized:"on"},{native:"\u062d\u064a\u0646",normalized:"on"},{native:"\u0644\u0645\u0651\u0627",normalized:"on"},{native:"\u0644\u0645\u0627",normalized:"on"},{native:"\u0644\u062f\u0649",normalized:"on"},{native:"\u0634\u0627\u0645\u0644",normalized:"inclusive"},{native:"\u062d\u0635\u0631\u064a",normalized:"exclusive"},{native:"\u062d\u0631\u0648\u0641",normalized:"characters"},{native:"\u0639\u0634\u0648\u0627\u0626\u064a",normalized:"random"}],zk=new(bk=class extends ud{constructor(){super(),this.language="ar",this.direction="rtl",this.initializeKeywordsFromProfile(Nf,wk),this.normalizer=new hk,this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractor(new Sg),this.registerExtractor(new uv),this.registerExtractor(new sv),this.registerExtractor(new nv),this.registerExtractor(new ly),this.registerExtractor(new cy)}tokenizeWithExtractors(e){const t=[];let r=0;for(;e.length>r;){for(;e.length>r&&Dp(e[r]);)r++;if(r>=e.length)break;const n=this.tryMultiWordKeyword(e,r);if(n){t.push(n),r=n.position.end;continue}let i=!1;for(const n of this.extractors)if(n.canExtract(e,r)){const a=n.extract(e,r);if(a){const e=a.metadata?.normalized,n=a.metadata?.stem,o=a.metadata?.stemConfidence,s={};if(a.metadata)for(const[e,t]of Object.entries(a.metadata))"normalized"!==e&&"stem"!==e&&"stemConfidence"!==e&&(s[e]=t);let l;l="conjunction"===s.procliticType?"conjunction":"preposition"===s.procliticType?"particle":this.classifyToken(a.value);const c={};e&&(c.normalized=e),n&&(c.stem=n),void 0!==o&&(c.stemConfidence=o),Object.keys(s).length>0&&(c.metadata=s),t.push(Vp(a.value,l,$p(r,r+a.length),Object.keys(c).length>0?c:void 0)),r+=a.length,i=!0;break}}if(!i){const n=e[r],i=this.classifyUnknownChar(n);t.push(Vp(n,i,$p(r,r+1))),r++}}return new qp(this.mergeColonQualifiedNames(t),this.language)}classifyToken(e){return gk.has(e)?"conjunction":kk.has(e)?"particle":this.isKeyword(e)?"keyword":e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||e.startsWith("http")?"url":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":"identifier"}})}});function Pk(e){return/[\u00e1\u00e9\u00ed\u00f3\u00fa\u00fc\u00f1\u00c1\u00c9\u00cd\u00d3\u00da\u00dc\u00d1]/.test(e)}var Ok,Nk,Rk,Mk,Ik=Cd({"src/tokenizers/morphology/spanish-normalizer.ts"(){Hg(),Tk=[{ending:"ando",stem:"ar",confidence:.88,type:"gerund"},{ending:"ado",stem:"ar",confidence:.88,type:"participle"},{ending:"ada",stem:"ar",confidence:.88,type:"participle"},{ending:"ados",stem:"ar",confidence:.88,type:"participle"},{ending:"adas",stem:"ar",confidence:.88,type:"participle"},{ending:"o",stem:"ar",confidence:.75,type:"present"},{ending:"as",stem:"ar",confidence:.82,type:"present"},{ending:"a",stem:"ar",confidence:.75,type:"present"},{ending:"amos",stem:"ar",confidence:.85,type:"present"},{ending:"\u00e1is",stem:"ar",confidence:.85,type:"present"},{ending:"ais",stem:"ar",confidence:.82,type:"present"},{ending:"an",stem:"ar",confidence:.8,type:"present"},{ending:"\u00e9",stem:"ar",confidence:.85,type:"past"},{ending:"aste",stem:"ar",confidence:.88,type:"past"},{ending:"\u00f3",stem:"ar",confidence:.82,type:"past"},{ending:"amos",stem:"ar",confidence:.85,type:"past"},{ending:"asteis",stem:"ar",confidence:.88,type:"past"},{ending:"aron",stem:"ar",confidence:.88,type:"past"},{ending:"aba",stem:"ar",confidence:.88,type:"past"},{ending:"abas",stem:"ar",confidence:.88,type:"past"},{ending:"\u00e1bamos",stem:"ar",confidence:.88,type:"past"},{ending:"abamos",stem:"ar",confidence:.85,type:"past"},{ending:"abais",stem:"ar",confidence:.88,type:"past"},{ending:"aban",stem:"ar",confidence:.88,type:"past"},{ending:"e",stem:"ar",confidence:.72,type:"subjunctive"},{ending:"es",stem:"ar",confidence:.78,type:"subjunctive"},{ending:"emos",stem:"ar",confidence:.82,type:"subjunctive"},{ending:"\u00e9is",stem:"ar",confidence:.85,type:"subjunctive"},{ending:"eis",stem:"ar",confidence:.82,type:"subjunctive"},{ending:"en",stem:"ar",confidence:.78,type:"subjunctive"},{ending:"a",stem:"ar",confidence:.75,type:"imperative"},{ending:"ad",stem:"ar",confidence:.85,type:"imperative"},{ending:"ar",stem:"ar",confidence:.92,type:"dictionary"}],Sk=[{ending:"iendo",stem:"er",confidence:.88,type:"gerund"},{ending:"ido",stem:"er",confidence:.85,type:"participle"},{ending:"ida",stem:"er",confidence:.85,type:"participle"},{ending:"idos",stem:"er",confidence:.85,type:"participle"},{ending:"idas",stem:"er",confidence:.85,type:"participle"},{ending:"o",stem:"er",confidence:.72,type:"present"},{ending:"es",stem:"er",confidence:.78,type:"present"},{ending:"e",stem:"er",confidence:.72,type:"present"},{ending:"emos",stem:"er",confidence:.85,type:"present"},{ending:"\u00e9is",stem:"er",confidence:.85,type:"present"},{ending:"eis",stem:"er",confidence:.82,type:"present"},{ending:"en",stem:"er",confidence:.78,type:"present"},{ending:"\u00ed",stem:"er",confidence:.85,type:"past"},{ending:"iste",stem:"er",confidence:.88,type:"past"},{ending:"i\u00f3",stem:"er",confidence:.85,type:"past"},{ending:"io",stem:"er",confidence:.82,type:"past"},{ending:"imos",stem:"er",confidence:.85,type:"past"},{ending:"isteis",stem:"er",confidence:.88,type:"past"},{ending:"ieron",stem:"er",confidence:.88,type:"past"},{ending:"\u00eda",stem:"er",confidence:.88,type:"past"},{ending:"ia",stem:"er",confidence:.85,type:"past"},{ending:"\u00edas",stem:"er",confidence:.88,type:"past"},{ending:"ias",stem:"er",confidence:.85,type:"past"},{ending:"\u00edamos",stem:"er",confidence:.88,type:"past"},{ending:"iamos",stem:"er",confidence:.85,type:"past"},{ending:"\u00edais",stem:"er",confidence:.88,type:"past"},{ending:"iais",stem:"er",confidence:.85,type:"past"},{ending:"\u00edan",stem:"er",confidence:.88,type:"past"},{ending:"ian",stem:"er",confidence:.85,type:"past"},{ending:"er",stem:"er",confidence:.92,type:"dictionary"}],Ck=[{ending:"iendo",stem:"ir",confidence:.88,type:"gerund"},{ending:"ido",stem:"ir",confidence:.85,type:"participle"},{ending:"ida",stem:"ir",confidence:.85,type:"participle"},{ending:"idos",stem:"ir",confidence:.85,type:"participle"},{ending:"idas",stem:"ir",confidence:.85,type:"participle"},{ending:"o",stem:"ir",confidence:.72,type:"present"},{ending:"es",stem:"ir",confidence:.78,type:"present"},{ending:"e",stem:"ir",confidence:.72,type:"present"},{ending:"imos",stem:"ir",confidence:.85,type:"present"},{ending:"\u00eds",stem:"ir",confidence:.85,type:"present"},{ending:"is",stem:"ir",confidence:.82,type:"present"},{ending:"en",stem:"ir",confidence:.78,type:"present"},{ending:"\u00ed",stem:"ir",confidence:.85,type:"past"},{ending:"iste",stem:"ir",confidence:.88,type:"past"},{ending:"i\u00f3",stem:"ir",confidence:.85,type:"past"},{ending:"io",stem:"ir",confidence:.82,type:"past"},{ending:"imos",stem:"ir",confidence:.85,type:"past"},{ending:"isteis",stem:"ir",confidence:.88,type:"past"},{ending:"ieron",stem:"ir",confidence:.88,type:"past"},{ending:"\u00eda",stem:"ir",confidence:.88,type:"past"},{ending:"ia",stem:"ir",confidence:.85,type:"past"},{ending:"\u00edas",stem:"ir",confidence:.88,type:"past"},{ending:"ias",stem:"ir",confidence:.85,type:"past"},{ending:"\u00edamos",stem:"ir",confidence:.88,type:"past"},{ending:"iamos",stem:"ir",confidence:.85,type:"past"},{ending:"\u00edais",stem:"ir",confidence:.88,type:"past"},{ending:"iais",stem:"ir",confidence:.85,type:"past"},{ending:"\u00edan",stem:"ir",confidence:.88,type:"past"},{ending:"ian",stem:"ir",confidence:.85,type:"past"},{ending:"ir",stem:"ir",confidence:.92,type:"dictionary"}],Ak=[...Tk,...Sk,...Ck].sort((e,t)=>t.ending.length-e.ending.length),new(Lk=class extends gd{constructor(){super({language:"es",minWordLength:3,minStemLength:2,endings:Ak,reflexiveSuffixes:["se","me","te","nos","os"],infinitiveEndings:["ar","er","ir"]})}isNormalizable(e){if(3>e.length)return!1;const t=e.toLowerCase();if(t.endsWith("ar")||t.endsWith("er")||t.endsWith("ir"))return!0;if(t.endsWith("ando")||t.endsWith("iendo"))return!0;if(t.endsWith("ado")||t.endsWith("ido"))return!0;if(t.endsWith("arse")||t.endsWith("erse")||t.endsWith("irse"))return!0;for(const t of e)if(Pk(t))return!0;return!1}})}});var Wk,_k,qk,$k,Vk=Cd({"src/tokenizers/extractors/spanish-keyword.ts"(){var e;fy(),({isLetter:Ok,isIdentifierChar:Nk}=(e=/[a-zA-Z\u00e1\u00e9\u00ed\u00f3\u00fa\u00fc\u00f1\u00c1\u00c9\u00cd\u00d3\u00da\u00dc\u00d1]/,{isLetter:t=>e.test(t),isIdentifierChar:t=>/[0-9]/.test(t)||e.test(t)})),Rk=new Set(["en","a","de","desde","hasta","con","sin","por","para","sobre","entre","antes","despu\u00e9s","despues","dentro","fuera","al","del"]),Mk=class{constructor(){this.name="spanish-keyword"}setContext(e){this.context=e}canExtract(e,t){return Ok(e[t])}extract(e,t){if(!this.context)throw Error("SpanishKeywordExtractor: context not set");const r=this.tryMultiWordPhrase(e,t);return r||this.extractSpanishWord(e,t)}tryMultiWordPhrase(e,t){if(!this.context)return null;const r=["de lo contrario","de lo normal","por defecto","de nuevo","de otra manera"];for(const n of r){if(e.slice(t,t+n.length).toLowerCase()===n.toLowerCase()){const r=t+n.length;if(r>=e.length||Dp(e[r])||!Ok(e[r])){const i=this.context.lookupKeyword(n);return{value:e.slice(t,r),length:n.length,metadata:{normalized:i?.normalized,multiWord:!0}}}}}return null}extractSpanishWord(e,t){if(!this.context)return null;let r=t,n="";for(;e.length>r&&Nk(e[r]);)n+=e[r++];if(!n)return null;const i=n.toLowerCase(),a=Rk.has(i),o=this.context.lookupKeyword(n),s=o&&o.normalized!==o.native?o.normalized:void 0;let l,c,u;if(!o&&this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const t=this.context.lookupKeyword(e.stem);t&&(l=t.normalized,c=e.stem,u=e.confidence)}}return{value:n,length:r-t,metadata:{normalized:s||l,stem:c,stemConfidence:u,isPreposition:a}}}}}}),Dk={};Ad(Dk,{SpanishTokenizer:()=>qk,spanishTokenizer:()=>$k});var Bk,Hk,Kk=Cd({"src/tokenizers/spanish.ts"(){fy(),Ik(),Zf(),yy(),Ng(),Vk(),Wk=new Set(["en","a","de","desde","hasta","con","sin","por","para","sobre","entre","antes","despu\u00e9s","despues","dentro","fuera","al","del"]),_k=[{native:"verdadero",normalized:"true"},{native:"falso",normalized:"false"},{native:"nulo",normalized:"null"},{native:"indefinido",normalized:"undefined"},{native:"segundo",normalized:"s"},{native:"segundos",normalized:"s"},{native:"milisegundo",normalized:"ms"},{native:"milisegundos",normalized:"ms"},{native:"minuto",normalized:"m"},{native:"minutos",normalized:"m"},{native:"hora",normalized:"h"},{native:"horas",normalized:"h"},{native:"m\u00ed",normalized:"me"},{native:"destino",normalized:"target"},{native:"inclusivo",normalized:"inclusive"},{native:"exclusivo",normalized:"exclusive"},{native:"caracteres",normalized:"characters"},{native:"aleatorio",normalized:"random"}],$k=new(qk=class extends ud{constructor(){super(),this.language="es",this.direction="ltr",this.initializeKeywordsFromProfile(Kf,_k),this.setNormalizer(new Lk),this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractors([new Mk]),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){const t=e.toLowerCase();return Wk.has(t)?"particle":this.isKeyword(t)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":["==","!=","<=",">=","<",">","&&","||","!"].includes(e)?"operator":e.startsWith("/")||e.startsWith("./")||e.startsWith("http")?"url":"identifier"}})}});function Fk(e){const t=e.charCodeAt(0);if(t>=65&&90>=t||t>=97&&122>=t)return!0;return"\u00e7\u00c7\u011f\u011e\u0131\u0130\u00f6\u00d6\u015f\u015e\u00fc\u00dc".includes(e)}function Uk(e){return"a\u0131ouAIOU".includes(e)}function Gk(e){return"ei\u00f6\u00fcE\u0130\u00d6\u00dc".includes(e)}function Zk(e){return Uk(e)||Gk(e)}function Yk(e,t){const r=function(e){for(let t=e.length-1;t>=0;t--)if(Zk(e[t]))return e[t];return null}(e);if(!r)return!0;const n=t.split("").find(e=>Zk(e));return!n||(Uk(r)?Uk(n):Gk(n))}var Xk,Jk,Qk,ew,tw,rw=Cd({"src/tokenizers/morphology/turkish-normalizer.ts"(){Hg(),Bk=[{pattern:"iyorsunuz",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"\u0131yorsunuz",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"\u00fcyorsunuz",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"uyorsunuz",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"iyorsun",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"\u0131yorsun",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"\u00fcyorsun",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"uyorsun",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"iyoruz",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"\u0131yoruz",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"\u00fcyoruz",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"uyoruz",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"iyorum",confidence:.85,conjugationType:"progressive",minStemLength:2},{pattern:"\u0131yorum",confidence:.85,conjugationType:"progressive",minStemLength:2},{pattern:"\u00fcyorum",confidence:.85,conjugationType:"progressive",minStemLength:2},{pattern:"uyorum",confidence:.85,conjugationType:"progressive",minStemLength:2},{pattern:"iyorlar",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"\u0131yorlar",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"\u00fcyorlar",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"uyorlar",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"eceksiniz",confidence:.82,conjugationType:"future",minStemLength:2},{pattern:"acaks\u0131n\u0131z",confidence:.82,conjugationType:"future",minStemLength:2},{pattern:"eceksin",confidence:.82,conjugationType:"future",minStemLength:2},{pattern:"acaks\u0131n",confidence:.82,conjugationType:"future",minStemLength:2},{pattern:"ece\u011fiz",confidence:.82,conjugationType:"future",minStemLength:2},{pattern:"aca\u011f\u0131z",confidence:.82,conjugationType:"future",minStemLength:2},{pattern:"ece\u011fim",confidence:.85,conjugationType:"future",minStemLength:2},{pattern:"aca\u011f\u0131m",confidence:.85,conjugationType:"future",minStemLength:2},{pattern:"ecekler",confidence:.82,conjugationType:"future",minStemLength:2},{pattern:"acaklar",confidence:.82,conjugationType:"future",minStemLength:2},{pattern:"mi\u015fsiniz",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"m\u0131\u015fs\u0131n\u0131z",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"m\u00fc\u015fs\u00fcn\u00fcz",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"mu\u015fsunuz",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"mi\u015fsin",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"m\u0131\u015fs\u0131n",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"m\u00fc\u015fs\u00fcn",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"mu\u015fsun",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"mi\u015fiz",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"m\u0131\u015f\u0131z",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"m\u00fc\u015f\u00fcz",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"mu\u015fuz",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"mi\u015fim",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"m\u0131\u015f\u0131m",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"m\u00fc\u015f\u00fcm",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"mu\u015fum",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"mi\u015fler",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"m\u0131\u015flar",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"m\u00fc\u015fler",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"mu\u015flar",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"diniz",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"d\u0131n\u0131z",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"d\u00fcn\u00fcz",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"dunuz",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"tiniz",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"t\u0131n\u0131z",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"t\u00fcn\u00fcz",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"tunuz",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"diler",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"d\u0131lar",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"d\u00fcler",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"dular",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"tiler",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"t\u0131lar",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"t\u00fcler",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"tular",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"din",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"d\u0131n",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"d\u00fcn",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"dun",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"tin",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"t\u0131n",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"t\u00fcn",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"tun",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"dik",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"d\u0131k",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"d\u00fck",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"duk",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"tik",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"t\u0131k",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"t\u00fck",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"tuk",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"dim",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"d\u0131m",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"d\u00fcm",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"dum",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"tim",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"t\u0131m",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"t\u00fcm",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"tum",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"iyor",confidence:.85,conjugationType:"progressive",minStemLength:2},{pattern:"\u0131yor",confidence:.85,conjugationType:"progressive",minStemLength:2},{pattern:"\u00fcyor",confidence:.85,conjugationType:"progressive",minStemLength:2},{pattern:"uyor",confidence:.85,conjugationType:"progressive",minStemLength:2},{pattern:"ecek",confidence:.85,conjugationType:"future",minStemLength:2},{pattern:"acak",confidence:.85,conjugationType:"future",minStemLength:2},{pattern:"mi\u015f",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"m\u0131\u015f",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"m\u00fc\u015f",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"mu\u015f",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"di",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"d\u0131",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"d\u00fc",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"du",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"ti",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"t\u0131",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"t\u00fc",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"tu",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"mek",confidence:.88,conjugationType:"dictionary",minStemLength:2},{pattern:"mak",confidence:.88,conjugationType:"dictionary",minStemLength:2},{pattern:"eyelim",confidence:.82,conjugationType:"optative",minStemLength:2},{pattern:"ayal\u0131m",confidence:.82,conjugationType:"optative",minStemLength:2},{pattern:"eyim",confidence:.82,conjugationType:"optative",minStemLength:2},{pattern:"ay\u0131m",confidence:.82,conjugationType:"optative",minStemLength:2},{pattern:"elim",confidence:.82,conjugationType:"optative",minStemLength:2},{pattern:"al\u0131m",confidence:.82,conjugationType:"optative",minStemLength:2},{pattern:"melisiniz",confidence:.82,conjugationType:"necessitative",minStemLength:2},{pattern:"mal\u0131s\u0131n\u0131z",confidence:.82,conjugationType:"necessitative",minStemLength:2},{pattern:"melisin",confidence:.82,conjugationType:"necessitative",minStemLength:2},{pattern:"mal\u0131s\u0131n",confidence:.82,conjugationType:"necessitative",minStemLength:2},{pattern:"meliyiz",confidence:.82,conjugationType:"necessitative",minStemLength:2},{pattern:"mal\u0131y\u0131z",confidence:.82,conjugationType:"necessitative",minStemLength:2},{pattern:"meliyim",confidence:.85,conjugationType:"necessitative",minStemLength:2},{pattern:"mal\u0131y\u0131m",confidence:.85,conjugationType:"necessitative",minStemLength:2},{pattern:"meliler",confidence:.82,conjugationType:"necessitative",minStemLength:2},{pattern:"mal\u0131lar",confidence:.82,conjugationType:"necessitative",minStemLength:2},{pattern:"meli",confidence:.85,conjugationType:"necessitative",minStemLength:2},{pattern:"mal\u0131",confidence:.85,conjugationType:"necessitative",minStemLength:2},{pattern:"ebiliyor",confidence:.82,conjugationType:"potential",minStemLength:2},{pattern:"abiliyor",confidence:.82,conjugationType:"potential",minStemLength:2},{pattern:"ebilir",confidence:.85,conjugationType:"potential",minStemLength:2},{pattern:"abilir",confidence:.85,conjugationType:"potential",minStemLength:2},{pattern:"ebildi",confidence:.82,conjugationType:"potential",minStemLength:2},{pattern:"abildi",confidence:.82,conjugationType:"potential",minStemLength:2},{pattern:"ebilmek",confidence:.85,conjugationType:"potential",minStemLength:2},{pattern:"abilmek",confidence:.85,conjugationType:"potential",minStemLength:2},{pattern:"iniz",confidence:.82,conjugationType:"imperative",minStemLength:2},{pattern:"\u0131n\u0131z",confidence:.82,conjugationType:"imperative",minStemLength:2},{pattern:"\u00fcn\u00fcz",confidence:.82,conjugationType:"imperative",minStemLength:2},{pattern:"unuz",confidence:.82,conjugationType:"imperative",minStemLength:2},{pattern:"in",confidence:.8,conjugationType:"imperative",minStemLength:2},{pattern:"\u0131n",confidence:.8,conjugationType:"imperative",minStemLength:2},{pattern:"\u00fcn",confidence:.8,conjugationType:"imperative",minStemLength:2},{pattern:"un",confidence:.8,conjugationType:"imperative",minStemLength:2},{pattern:"ildi",confidence:.82,conjugationType:"passive",minStemLength:2},{pattern:"\u0131ld\u0131",confidence:.82,conjugationType:"passive",minStemLength:2},{pattern:"\u00fcld\u00fc",confidence:.82,conjugationType:"passive",minStemLength:2},{pattern:"uldu",confidence:.82,conjugationType:"passive",minStemLength:2},{pattern:"ilir",confidence:.82,conjugationType:"passive",minStemLength:2},{pattern:"\u0131l\u0131r",confidence:.82,conjugationType:"passive",minStemLength:2},{pattern:"\u00fcl\u00fcr",confidence:.82,conjugationType:"passive",minStemLength:2},{pattern:"ulur",confidence:.82,conjugationType:"passive",minStemLength:2},{pattern:"tirmek",confidence:.82,conjugationType:"causative",minStemLength:2},{pattern:"t\u0131rmak",confidence:.82,conjugationType:"causative",minStemLength:2},{pattern:"t\u00fcrmek",confidence:.82,conjugationType:"causative",minStemLength:2},{pattern:"turmak",confidence:.82,conjugationType:"causative",minStemLength:2},{pattern:"dirmek",confidence:.82,conjugationType:"causative",minStemLength:2},{pattern:"d\u0131rmak",confidence:.82,conjugationType:"causative",minStemLength:2},{pattern:"d\u00fcrmek",confidence:.82,conjugationType:"causative",minStemLength:2},{pattern:"durmak",confidence:.82,conjugationType:"causative",minStemLength:2},{pattern:"miyorsunuz",confidence:.8,conjugationType:"negative",minStemLength:2},{pattern:"m\u0131yorsunuz",confidence:.8,conjugationType:"negative",minStemLength:2},{pattern:"m\u00fcyorsunuz",confidence:.8,conjugationType:"negative",minStemLength:2},{pattern:"muyorsunuz",confidence:.8,conjugationType:"negative",minStemLength:2},{pattern:"miyorsun",confidence:.8,conjugationType:"negative",minStemLength:2},{pattern:"m\u0131yorsun",confidence:.8,conjugationType:"negative",minStemLength:2},{pattern:"m\u00fcyorsun",confidence:.8,conjugationType:"negative",minStemLength:2},{pattern:"muyorsun",confidence:.8,conjugationType:"negative",minStemLength:2},{pattern:"miyoruz",confidence:.8,conjugationType:"negative",minStemLength:2},{pattern:"m\u0131yoruz",confidence:.8,conjugationType:"negative",minStemLength:2},{pattern:"m\u00fcyoruz",confidence:.8,conjugationType:"negative",minStemLength:2},{pattern:"muyoruz",confidence:.8,conjugationType:"negative",minStemLength:2},{pattern:"miyorum",confidence:.82,conjugationType:"negative",minStemLength:2},{pattern:"m\u0131yorum",confidence:.82,conjugationType:"negative",minStemLength:2},{pattern:"m\u00fcyorum",confidence:.82,conjugationType:"negative",minStemLength:2},{pattern:"muyorum",confidence:.82,conjugationType:"negative",minStemLength:2},{pattern:"miyor",confidence:.82,conjugationType:"negative",minStemLength:2},{pattern:"m\u0131yor",confidence:.82,conjugationType:"negative",minStemLength:2},{pattern:"m\u00fcyor",confidence:.82,conjugationType:"negative",minStemLength:2},{pattern:"muyor",confidence:.82,conjugationType:"negative",minStemLength:2},{pattern:"medi",confidence:.82,conjugationType:"negative",minStemLength:2},{pattern:"mad\u0131",confidence:.82,conjugationType:"negative",minStemLength:2},{pattern:"me",confidence:.75,conjugationType:"negative",minStemLength:3},{pattern:"ma",confidence:.75,conjugationType:"negative",minStemLength:3}],new(Hk=class{constructor(){this.language="tr"}isNormalizable(e){return!!function(e){for(const t of e)if(Fk(t))return!0;return!1}(e)&&3<=e.length}normalize(e){const t=e.toLowerCase();for(const e of Bk)if(t.endsWith(e.pattern)){const r=t.slice(0,-e.pattern.length);if((e.minStemLength??2)>r.length)continue;if(!Yk(r,e.pattern)){const t=.9*e.confidence,n={removedSuffixes:[e.pattern]};return e.conjugationType&&(n.conjugationType=e.conjugationType),vd(r,t,n)}const n={removedSuffixes:[e.pattern]};return e.conjugationType&&(n.conjugationType=e.conjugationType),vd(r,e.confidence,n)}return yd(e)}})}}),nw={};Ad(nw,{TurkishTokenizer:()=>ew,turkishTokenizer:()=>tw});var iw,aw,ow,sw,lw=Cd({"src/tokenizers/turkish.ts"(){fy(),rw(),Bh(),yy(),Ng(),dg(),Xk=new Set(["ile","i\u00e7in","kadar","gibi","\u00f6nce","\u00fczerinde","alt\u0131nda","i\u00e7inde","d\u0131\u015f\u0131nda","aras\u0131nda","kar\u015f\u0131","g\u00f6re","ra\u011fmen","boyunca"]),Jk=new Set(["de","da","te","ta","den","dan","ten","tan","e","a","ye","ya","i","\u0131","u","\u00fc","in","\u0131n","un","\u00fcn","le","la","yle","yla"]),Qk=[{native:"do\u011fru",normalized:"true"},{native:"dogru",normalized:"true"},{native:"yanl\u0131\u015f",normalized:"false"},{native:"yanlis",normalized:"false"},{native:"null",normalized:"null"},{native:"bo\u015f",normalized:"null"},{native:"bos",normalized:"null"},{native:"tan\u0131ms\u0131z",normalized:"undefined"},{native:"tanimsiz",normalized:"undefined"},{native:"ilk",normalized:"first"},{native:"son",normalized:"last"},{native:"sonuncu",normalized:"last"},{native:"sonraki",normalized:"next"},{native:"\u00f6nceki",normalized:"previous"},{native:"onceki",normalized:"previous"},{native:"enyak\u0131n",normalized:"closest"},{native:"enyakin",normalized:"closest"},{native:"ebeveyn",normalized:"parent"},{native:"fare \u00fczerinde",normalized:"mouseover"},{native:"fare uzerinde",normalized:"mouseover"},{native:"fare d\u0131\u015f\u0131nda",normalized:"mouseout"},{native:"fare disinda",normalized:"mouseout"},{native:"farebas",normalized:"mousedown"},{native:"fareb\u0131rak",normalized:"mouseup"},{native:"farebirak",normalized:"mouseup"},{native:"kayd\u0131r",normalized:"scroll"},{native:"kaydir",normalized:"scroll"},{native:"boyutland\u0131rma",normalized:"resize"},{native:"boyutlandirma",normalized:"resize"},{native:"boyutland\u0131r",normalized:"resize"},{native:"boyutlandir",normalized:"resize"},{native:"kayd\u0131rma",normalized:"scroll"},{native:"kaydirma",normalized:"scroll"},{native:"tu\u015f_bas",normalized:"keydown"},{native:"tus_bas",normalized:"keydown"},{native:"tu\u015f_b\u0131rak",normalized:"keyup"},{native:"tus_birak",normalized:"keyup"},{native:"saniye",normalized:"s"},{native:"milisaniye",normalized:"ms"},{native:"dakika",normalized:"m"},{native:"saat",normalized:"h"},{native:"dahil",normalized:"inclusive"},{native:"hari\u00e7",normalized:"exclusive"},{native:"karakterler",normalized:"characters"},{native:"rastgele",normalized:"random"}],tw=new(ew=class extends ud{constructor(){super(),this.language="tr",this.direction="ltr",this.initializeKeywordsFromProfile(qh,Qk),this.setNormalizer(new Hk),this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractor(new ag),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){const t=e.toLowerCase();return Xk.has(t)||Jk.has(t)?"particle":this.isKeyword(t)?"keyword":e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||e.startsWith("http")?"url":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":["==","!=","<=",">=","<",">","&&","||","!"].includes(e)?"operator":"identifier"}})}}),cw={};Ad(cw,{ChineseTokenizer:()=>ow,chineseTokenizer:()=>sw});var uw,pw,dw,mw,fw,hw,yw=Cd({"src/tokenizers/chinese.ts"(){fy(),Jh(),yy(),Ng(),Qy(),ev(),Lg(),iw=new Set(["\u628a","\u5728","\u4ece","\u5230","\u5411","\u7ed9","\u5bf9","\u7528","\u88ab","\u8ba9","\u7684","\u5730","\u5f97","\u4e86","\u7740","\u8fc7","\u5417","\u5462","\u5427"]),aw=[{native:"\u771f",normalized:"true"},{native:"\u5047",normalized:"false"},{native:"\u7a7a",normalized:"null"},{native:"\u672a\u5b9a\u4e49",normalized:"undefined"},{native:"\u7b2c\u4e00\u4e2a",normalized:"first"},{native:"\u9996\u4e2a",normalized:"first"},{native:"\u6700\u540e\u4e00\u4e2a",normalized:"last"},{native:"\u672b\u4e2a",normalized:"last"},{native:"\u4e0b\u4e00\u4e2a",normalized:"next"},{native:"\u4e0a\u4e00\u4e2a",normalized:"previous"},{native:"\u6700\u8fd1\u7684",normalized:"closest"},{native:"\u7236\u7ea7",normalized:"parent"},{native:"\u70b9\u51fb",normalized:"click"},{native:"\u53cc\u51fb",normalized:"dblclick"},{native:"\u8f93\u5165",normalized:"input"},{native:"\u53d8\u66f4",normalized:"change"},{native:"\u6539\u53d8",normalized:"change"},{native:"\u63d0\u4ea4",normalized:"submit"},{native:"\u6309\u952e",normalized:"keydown"},{native:"\u91ca\u653e\u952e",normalized:"keyup"},{native:"\u9f20\u6807\u79fb\u5165",normalized:"mouseover"},{native:"\u9f20\u6807\u79fb\u51fa",normalized:"mouseout"},{native:"\u83b7\u5f97\u7126\u70b9",normalized:"focus"},{native:"\u5931\u53bb\u7126\u70b9",normalized:"blur"},{native:"\u52a0\u8f7d",normalized:"load"},{native:"\u6eda\u52a8",normalized:"scroll"},{native:"\u6211\u7684",normalized:"my"},{native:"\u5b83\u7684",normalized:"its"},{native:"\u79d2",normalized:"s"},{native:"\u6beb\u79d2",normalized:"ms"},{native:"\u5206\u949f",normalized:"m"},{native:"\u5c0f\u65f6",normalized:"h"},{native:"\u548c",normalized:"and"},{native:"\u6216\u8005",normalized:"or"},{native:"\u6216",normalized:"or"},{native:"\u4e0d",normalized:"not"},{native:"\u975e",normalized:"not"},{native:"\u662f",normalized:"is"},{native:"\u82e5",normalized:"if"},{native:"\u4e0d\u7136",normalized:"else"},{native:"\u5faa\u73af",normalized:"repeat"},{native:"\u904d\u5386",normalized:"for"},{native:"\u6bcf\u4e2a",normalized:"for"},{native:"\u4e3a\u6bcf",normalized:"for"},{native:"\u4e2d\u6b62",normalized:"halt"},{native:"\u629b",normalized:"throw"},{native:"\u547c\u53eb",normalized:"call"},{native:"\u56de",normalized:"return"},{native:"\u811a\u672c",normalized:"js"},{native:"\u901a\u77e5",normalized:"tell"},{native:"\u7f3a\u7701",normalized:"default"},{native:"\u521d\u59cb",normalized:"init"},{native:"\u52a8\u4f5c",normalized:"behavior"},{native:"\u6fc0\u53d1",normalized:"trigger"},{native:"\u5bf9\u7126",normalized:"focus"},{native:"\u6a21\u7cca",normalized:"blur"},{native:"\u8df3\u8f6c",normalized:"go"},{native:"\u5bfc\u822a",normalized:"go"},{native:"\u6293\u53d6",normalized:"fetch"},{native:"\u83b7\u53d6\u6570\u636e",normalized:"fetch"},{native:"\u5b89\u5b9a",normalized:"settle"},{native:"\u62ff\u53d6",normalized:"take"},{native:"\u53d6",normalized:"take"},{native:"\u521b\u5efa",normalized:"make"},{native:"\u514b\u9686",normalized:"clone"},{native:"\u8bb0\u5f55",normalized:"log"},{native:"\u6253\u5370",normalized:"log"},{native:"\u52a8\u753b",normalized:"transition"},{native:"\u5230\u91cc\u9762",normalized:"into"},{native:"\u91cc",normalized:"into"},{native:"\u524d",normalized:"before"},{native:"\u540e",normalized:"after"},{native:"\u90a3\u4e48",normalized:"then"},{native:"\u5b8c",normalized:"end"},{native:"\u4f5c\u4e3a",normalized:"as"},{native:"\u5305\u542b",normalized:"inclusive"},{native:"\u6392\u9664",normalized:"exclusive"},{native:"\u5b57\u7b26",normalized:"characters"},{native:"\u968f\u673a",normalized:"random"}],sw=new(ow=class extends ud{constructor(){super(),this.language="zh",this.direction="ltr",this.initializeKeywordsFromProfile(Gh,aw),this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractor(new Sg),this.registerExtractor(new Gy),this.registerExtractor(new By),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){return iw.has(e)?"particle":this.isKeyword(e)?"keyword":e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||e.startsWith("http")?"url":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||e.startsWith("\u201c")||e.startsWith("\u2018")||/^\d/.test(e)?"literal":"identifier"}})}});function vw(e){return/[\u00e1\u00e0\u00e2\u00e3\u00e9\u00ea\u00ed\u00f3\u00f4\u00f5\u00fa\u00fc\u00e7\u00c1\u00c0\u00c2\u00c3\u00c9\u00ca\u00cd\u00d3\u00d4\u00d5\u00da\u00dc\u00c7]/.test(e)}var gw,kw,ww,bw,zw=Cd({"src/tokenizers/morphology/portuguese-normalizer.ts"(){Hg(),uw=["-se","-me","-te","-nos","-vos"],pw=[{ending:"ando",stem:"ar",confidence:.88,type:"gerund"},{ending:"ado",stem:"ar",confidence:.88,type:"participle"},{ending:"ada",stem:"ar",confidence:.88,type:"participle"},{ending:"ados",stem:"ar",confidence:.88,type:"participle"},{ending:"adas",stem:"ar",confidence:.88,type:"participle"},{ending:"o",stem:"ar",confidence:.75,type:"present"},{ending:"as",stem:"ar",confidence:.82,type:"present"},{ending:"a",stem:"ar",confidence:.75,type:"present"},{ending:"amos",stem:"ar",confidence:.85,type:"present"},{ending:"ais",stem:"ar",confidence:.85,type:"present"},{ending:"am",stem:"ar",confidence:.8,type:"present"},{ending:"ei",stem:"ar",confidence:.88,type:"past"},{ending:"aste",stem:"ar",confidence:.88,type:"past"},{ending:"ou",stem:"ar",confidence:.88,type:"past"},{ending:"\u00e1mos",stem:"ar",confidence:.88,type:"past"},{ending:"amos",stem:"ar",confidence:.85,type:"past"},{ending:"astes",stem:"ar",confidence:.88,type:"past"},{ending:"aram",stem:"ar",confidence:.88,type:"past"},{ending:"ava",stem:"ar",confidence:.88,type:"past"},{ending:"avas",stem:"ar",confidence:.88,type:"past"},{ending:"\u00e1vamos",stem:"ar",confidence:.88,type:"past"},{ending:"avamos",stem:"ar",confidence:.85,type:"past"},{ending:"\u00e1veis",stem:"ar",confidence:.88,type:"past"},{ending:"aveis",stem:"ar",confidence:.85,type:"past"},{ending:"avam",stem:"ar",confidence:.88,type:"past"},{ending:"e",stem:"ar",confidence:.72,type:"subjunctive"},{ending:"es",stem:"ar",confidence:.78,type:"subjunctive"},{ending:"emos",stem:"ar",confidence:.82,type:"subjunctive"},{ending:"eis",stem:"ar",confidence:.82,type:"subjunctive"},{ending:"em",stem:"ar",confidence:.78,type:"subjunctive"},{ending:"a",stem:"ar",confidence:.75,type:"imperative"},{ending:"ai",stem:"ar",confidence:.85,type:"imperative"},{ending:"ar",stem:"ar",confidence:.92,type:"dictionary"}],dw=[{ending:"endo",stem:"er",confidence:.88,type:"gerund"},{ending:"ido",stem:"er",confidence:.85,type:"participle"},{ending:"ida",stem:"er",confidence:.85,type:"participle"},{ending:"idos",stem:"er",confidence:.85,type:"participle"},{ending:"idas",stem:"er",confidence:.85,type:"participle"},{ending:"o",stem:"er",confidence:.72,type:"present"},{ending:"es",stem:"er",confidence:.78,type:"present"},{ending:"e",stem:"er",confidence:.72,type:"present"},{ending:"emos",stem:"er",confidence:.85,type:"present"},{ending:"eis",stem:"er",confidence:.82,type:"present"},{ending:"em",stem:"er",confidence:.78,type:"present"},{ending:"i",stem:"er",confidence:.85,type:"past"},{ending:"este",stem:"er",confidence:.88,type:"past"},{ending:"eu",stem:"er",confidence:.88,type:"past"},{ending:"emos",stem:"er",confidence:.85,type:"past"},{ending:"estes",stem:"er",confidence:.88,type:"past"},{ending:"eram",stem:"er",confidence:.88,type:"past"},{ending:"ia",stem:"er",confidence:.85,type:"past"},{ending:"ias",stem:"er",confidence:.85,type:"past"},{ending:"\u00edamos",stem:"er",confidence:.88,type:"past"},{ending:"iamos",stem:"er",confidence:.85,type:"past"},{ending:"\u00edeis",stem:"er",confidence:.88,type:"past"},{ending:"ieis",stem:"er",confidence:.85,type:"past"},{ending:"iam",stem:"er",confidence:.85,type:"past"},{ending:"er",stem:"er",confidence:.92,type:"dictionary"}],mw=[{ending:"indo",stem:"ir",confidence:.88,type:"gerund"},{ending:"ido",stem:"ir",confidence:.85,type:"participle"},{ending:"ida",stem:"ir",confidence:.85,type:"participle"},{ending:"idos",stem:"ir",confidence:.85,type:"participle"},{ending:"idas",stem:"ir",confidence:.85,type:"participle"},{ending:"o",stem:"ir",confidence:.72,type:"present"},{ending:"es",stem:"ir",confidence:.78,type:"present"},{ending:"e",stem:"ir",confidence:.72,type:"present"},{ending:"imos",stem:"ir",confidence:.85,type:"present"},{ending:"is",stem:"ir",confidence:.82,type:"present"},{ending:"em",stem:"ir",confidence:.78,type:"present"},{ending:"i",stem:"ir",confidence:.85,type:"past"},{ending:"iste",stem:"ir",confidence:.88,type:"past"},{ending:"iu",stem:"ir",confidence:.88,type:"past"},{ending:"imos",stem:"ir",confidence:.85,type:"past"},{ending:"istes",stem:"ir",confidence:.88,type:"past"},{ending:"iram",stem:"ir",confidence:.88,type:"past"},{ending:"ia",stem:"ir",confidence:.85,type:"past"},{ending:"ias",stem:"ir",confidence:.85,type:"past"},{ending:"\u00edamos",stem:"ir",confidence:.88,type:"past"},{ending:"iamos",stem:"ir",confidence:.85,type:"past"},{ending:"\u00edeis",stem:"ir",confidence:.88,type:"past"},{ending:"ieis",stem:"ir",confidence:.85,type:"past"},{ending:"iam",stem:"ir",confidence:.85,type:"past"},{ending:"ir",stem:"ir",confidence:.92,type:"dictionary"}],fw=[...pw,...dw,...mw].sort((e,t)=>t.ending.length-e.ending.length),new(hw=class{constructor(){this.language="pt"}isNormalizable(e){return e.length>=3&&function(e){const t=e.toLowerCase();if(t.endsWith("ar")||t.endsWith("er")||t.endsWith("ir"))return!0;if(t.endsWith("ando")||t.endsWith("endo")||t.endsWith("indo"))return!0;if(t.endsWith("ado")||t.endsWith("ido"))return!0;if(t.endsWith("ar-se")||t.endsWith("er-se")||t.endsWith("ir-se"))return!0;for(const t of e)if(vw(t))return!0;return!1}(e)}normalize(e){const t=e.toLowerCase();if((t.endsWith("ar")||t.endsWith("er")||t.endsWith("ir"))&&!uw.some(e=>t.endsWith(e)))return yd(e);const r=this.tryReflexiveNormalization(t);if(r)return r;const n=this.tryConjugationNormalization(t);return n||yd(e)}tryReflexiveNormalization(e){for(const t of uw)if(e.endsWith(t)){const r=e.slice(0,-t.length);if(r.endsWith("ar")||r.endsWith("er")||r.endsWith("ir"))return vd(r,.88,{removedSuffixes:[t],conjugationType:"reflexive"});const n=this.tryConjugationNormalization(r);if(n&&n.stem!==r)return vd(n.stem,.95*n.confidence,{removedSuffixes:[t,...n.metadata?.removedSuffixes||[]],conjugationType:"reflexive"})}return null}tryConjugationNormalization(e){for(const t of fw)if(e.endsWith(t.ending)){const r=e.slice(0,-t.ending.length);if(2>r.length)continue;return vd(r+t.stem,t.confidence,{removedSuffixes:[t.ending],conjugationType:t.type})}return null}})}});var xw,Ew,Tw,Sw,Cw=Cd({"src/tokenizers/extractors/portuguese-keyword.ts"(){var e;({isLetter:gw,isIdentifierChar:kw}=(e=/[a-zA-Z\u00e1\u00e2\u00e3\u00e9\u00ea\u00ed\u00f3\u00f4\u00f5\u00fa\u00e7\u00c1\u00c2\u00c3\u00c9\u00ca\u00cd\u00d3\u00d4\u00d5\u00da\u00c7]/,{isLetter:t=>e.test(t),isIdentifierChar:t=>/[0-9]/.test(t)||e.test(t)})),ww=new Set(["em","a","de","para","com","sem","por","sobre","entre","antes","depois","dentro","fora","ao","do","da","no","na"]),bw=class{constructor(){this.name="portuguese-keyword"}setContext(e){this.context=e}canExtract(e,t){return gw(e[t])}extract(e,t){if(!this.context)throw Error("PortugueseKeywordExtractor: context not set");let r=t,n="";for(;e.length>r&&kw(e[r]);)n+=e[r++];if(!n)return null;const i=n.toLowerCase(),a=ww.has(i),o=this.context.lookupKeyword(i),s=o&&o.normalized!==o.native?o.normalized:void 0;let l,c,u;if(!o&&this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const t=this.context.lookupKeyword(e.stem);t&&(l=t.normalized,c=e.stem,u=e.confidence)}}return{value:n,length:r-t,metadata:{normalized:s||l,stem:c,stemConfidence:u,isPreposition:a}}}}}}),Aw={};Ad(Aw,{PortugueseTokenizer:()=>Tw,portugueseTokenizer:()=>Sw});var Lw,jw,Pw,Ow,Nw,Rw,Mw=Cd({"src/tokenizers/portuguese.ts"(){fy(),Th(),zw(),yy(),Ng(),Cw(),xw=new Set(["em","a","de","desde","at\u00e9","ate","com","sem","por","para","sobre","entre","antes","depois","dentro","fora","ao","do","no","na"]),Ew=[{native:"verdadeiro",normalized:"true"},{native:"falso",normalized:"false"},{native:"nulo",normalized:"null"},{native:"indefinido",normalized:"undefined"},{native:"primeiro",normalized:"first"},{native:"primeira",normalized:"first"},{native:"\u00faltimo",normalized:"last"},{native:"ultima",normalized:"last"},{native:"pr\u00f3ximo",normalized:"next"},{native:"proximo",normalized:"next"},{native:"anterior",normalized:"previous"},{native:"maispr\u00f3ximo",normalized:"closest"},{native:"maisproximo",normalized:"closest"},{native:"pai",normalized:"parent"},{native:"clique",normalized:"click"},{native:"click",normalized:"click"},{native:"entrada",normalized:"input"},{native:"mudan\u00e7a",normalized:"change"},{native:"mudanca",normalized:"change"},{native:"envio",normalized:"submit"},{native:"tecla baixo",normalized:"keydown"},{native:"tecla cima",normalized:"keyup"},{native:"mouse sobre",normalized:"mouseover"},{native:"mouse fora",normalized:"mouseout"},{native:"foco",normalized:"focus"},{native:"desfoque",normalized:"blur"},{native:"carregar",normalized:"load"},{native:"rolagem",normalized:"scroll"},{native:"meu",normalized:"my"},{native:"minha",normalized:"my"},{native:"isso",normalized:"it"},{native:"segundo",normalized:"s"},{native:"segundos",normalized:"s"},{native:"milissegundo",normalized:"ms"},{native:"milissegundos",normalized:"ms"},{native:"minuto",normalized:"m"},{native:"minutos",normalized:"m"},{native:"hora",normalized:"h"},{native:"horas",normalized:"h"},{native:"senao",normalized:"else"},{native:"transicao",normalized:"transition"},{native:"ate",normalized:"until"},{native:"entao",normalized:"then"},{native:"lancar",normalized:"throw"},{native:"assincrono",normalized:"async"},{native:"padrao",normalized:"default"},{native:"at\u00e9 que",normalized:"until"},{native:"dentro de",normalized:"into"},{native:"inclusivo",normalized:"inclusive"},{native:"exclusivo",normalized:"exclusive"},{native:"caracteres",normalized:"characters"},{native:"aleat\u00f3rio",normalized:"random"}],Sw=new(Tw=class extends ud{constructor(){super(),this.language="pt",this.direction="ltr",this.initializeKeywordsFromProfile(bh,Ew),this.setNormalizer(new hw),this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractors([new bw]),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){const t=e.toLowerCase();return xw.has(t)?"particle":this.isKeyword(t)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":e.startsWith("/")||e.startsWith("./")||e.startsWith("http")?"url":"identifier"}})}});var Iw,Ww,_w,qw,$w=Cd({"src/tokenizers/morphology/french-normalizer.ts"(){Hg(),Lw=["toi","vous","nous"],jw=[{ending:"ant",stem:"er",confidence:.88,type:"gerund"},{ending:"\u00e9",stem:"er",confidence:.88,type:"participle"},{ending:"\u00e9e",stem:"er",confidence:.88,type:"participle"},{ending:"\u00e9s",stem:"er",confidence:.88,type:"participle"},{ending:"\u00e9es",stem:"er",confidence:.88,type:"participle"},{ending:"e",stem:"er",confidence:.75,type:"present"},{ending:"es",stem:"er",confidence:.78,type:"present"},{ending:"ons",stem:"er",confidence:.85,type:"present"},{ending:"ez",stem:"er",confidence:.85,type:"present"},{ending:"ent",stem:"er",confidence:.82,type:"present"},{ending:"ais",stem:"er",confidence:.82,type:"past"},{ending:"ait",stem:"er",confidence:.82,type:"past"},{ending:"ions",stem:"er",confidence:.85,type:"past"},{ending:"iez",stem:"er",confidence:.85,type:"past"},{ending:"aient",stem:"er",confidence:.85,type:"past"},{ending:"ai",stem:"er",confidence:.8,type:"past"},{ending:"as",stem:"er",confidence:.78,type:"past"},{ending:"a",stem:"er",confidence:.75,type:"past"},{ending:"\u00e2mes",stem:"er",confidence:.88,type:"past"},{ending:"\u00e2tes",stem:"er",confidence:.88,type:"past"},{ending:"\u00e8rent",stem:"er",confidence:.88,type:"past"},{ending:"erai",stem:"er",confidence:.85,type:"future"},{ending:"eras",stem:"er",confidence:.85,type:"future"},{ending:"era",stem:"er",confidence:.82,type:"future"},{ending:"erons",stem:"er",confidence:.88,type:"future"},{ending:"erez",stem:"er",confidence:.88,type:"future"},{ending:"eront",stem:"er",confidence:.88,type:"future"},{ending:"erais",stem:"er",confidence:.85,type:"conditional"},{ending:"erait",stem:"er",confidence:.85,type:"conditional"},{ending:"erions",stem:"er",confidence:.88,type:"conditional"},{ending:"eriez",stem:"er",confidence:.88,type:"conditional"},{ending:"eraient",stem:"er",confidence:.88,type:"conditional"},{ending:"ions",stem:"er",confidence:.8,type:"subjunctive"},{ending:"iez",stem:"er",confidence:.8,type:"subjunctive"},{ending:"ons",stem:"er",confidence:.82,type:"imperative"},{ending:"ez",stem:"er",confidence:.82,type:"imperative"},{ending:"er",stem:"er",confidence:.92,type:"dictionary"}],Pw=[{ending:"issant",stem:"ir",confidence:.88,type:"gerund"},{ending:"i",stem:"ir",confidence:.8,type:"participle"},{ending:"ie",stem:"ir",confidence:.82,type:"participle"},{ending:"is",stem:"ir",confidence:.78,type:"participle"},{ending:"ies",stem:"ir",confidence:.82,type:"participle"},{ending:"is",stem:"ir",confidence:.78,type:"present"},{ending:"it",stem:"ir",confidence:.78,type:"present"},{ending:"issons",stem:"ir",confidence:.88,type:"present"},{ending:"issez",stem:"ir",confidence:.88,type:"present"},{ending:"issent",stem:"ir",confidence:.88,type:"present"},{ending:"issais",stem:"ir",confidence:.85,type:"past"},{ending:"issait",stem:"ir",confidence:.85,type:"past"},{ending:"issions",stem:"ir",confidence:.88,type:"past"},{ending:"issiez",stem:"ir",confidence:.88,type:"past"},{ending:"issaient",stem:"ir",confidence:.88,type:"past"},{ending:"irai",stem:"ir",confidence:.85,type:"future"},{ending:"iras",stem:"ir",confidence:.85,type:"future"},{ending:"ira",stem:"ir",confidence:.82,type:"future"},{ending:"irons",stem:"ir",confidence:.88,type:"future"},{ending:"irez",stem:"ir",confidence:.88,type:"future"},{ending:"iront",stem:"ir",confidence:.88,type:"future"},{ending:"ir",stem:"ir",confidence:.9,type:"dictionary"}],Ow=[{ending:"ant",stem:"re",confidence:.82,type:"gerund"},{ending:"u",stem:"re",confidence:.8,type:"participle"},{ending:"ue",stem:"re",confidence:.82,type:"participle"},{ending:"us",stem:"re",confidence:.82,type:"participle"},{ending:"ues",stem:"re",confidence:.82,type:"participle"},{ending:"s",stem:"re",confidence:.72,type:"present"},{ending:"d",stem:"re",confidence:.75,type:"present"},{ending:"ons",stem:"re",confidence:.82,type:"present"},{ending:"ez",stem:"re",confidence:.82,type:"present"},{ending:"ent",stem:"re",confidence:.8,type:"present"},{ending:"re",stem:"re",confidence:.9,type:"dictionary"}],Nw=[...jw,...Pw,...Ow].sort((e,t)=>t.ending.length-e.ending.length),new(Rw=class{constructor(){this.language="fr"}isNormalizable(e){return e.length>=3&&function(e){const t=e.toLowerCase();return!!(t.endsWith("er")||t.endsWith("ir")||t.endsWith("re")||t.endsWith("ant")||t.endsWith("\u00e9")||t.endsWith("i")||t.endsWith("u")||/[\u00e0\u00e2\u00e4\u00e9\u00e8\u00ea\u00eb\u00ef\u00ee\u00f4\u00f9\u00fb\u00fc\u00ff\u00e7\u0153\u00e6]/i.test(e))}(e)}normalize(e){const t=e.toLowerCase();if((t.endsWith("er")||t.endsWith("ir")||t.endsWith("re"))&&t.length>=4)return yd(e);const r=this.tryReflexiveNormalization(t);if(r)return r;const n=this.tryConjugationNormalization(t);return n||yd(e)}tryReflexiveNormalization(e){for(const t of Lw){const r="-"+t;if(e.endsWith(r)){const t=e.slice(0,-r.length),n=this.tryConjugationNormalization(t);if(n&&n.stem!==t)return vd(n.stem,.95*n.confidence,{removedSuffixes:[r,...n.metadata?.removedSuffixes||[]],conjugationType:"reflexive"})}}return null}tryConjugationNormalization(e){for(const t of Nw)if(e.endsWith(t.ending)){const r=e.slice(0,-t.ending.length);if(2>r.length)continue;return vd(r+t.stem,t.confidence,{removedSuffixes:[t.ending],conjugationType:t.type})}return null}})}});var Vw,Dw,Bw,Hw=Cd({"src/tokenizers/extractors/french-keyword.ts"(){var e;({isLetter:Iw,isIdentifierChar:Ww}=(e=/[a-zA-Z\u00e0\u00e2\u00e6\u00e7\u00e9\u00e8\u00ea\u00eb\u00ef\u00ee\u00f4\u00f9\u00fb\u00fc\u00ff\u0153\u00c0\u00c2\u00c6\u00c7\u00c9\u00c8\u00ca\u00cb\u00cf\u00ce\u00d4\u00d9\u00db\u00dc\u0178\u0152]/,{isLetter:t=>e.test(t),isIdentifierChar:t=>/[0-9]/.test(t)||e.test(t)})),_w=new Set(["\u00e0","a","de","du","des","dans","sur","sous","avec","sans","par","pour","entre","avant","apr\u00e8s","apres","depuis","vers","chez","contre","au","aux"]),qw=class{constructor(){this.name="french-keyword"}setContext(e){this.context=e}canExtract(e,t){return Iw(e[t])}extract(e,t){if(!this.context)throw Error("FrenchKeywordExtractor: context not set");let r=t,n="";for(;e.length>r&&Ww(e[r]);)n+=e[r++];if(!n)return null;const i=n.toLowerCase(),a=_w.has(i),o=this.context.lookupKeyword(i),s=o&&o.normalized!==o.native?o.normalized:void 0;let l,c,u;if(!o&&this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const t=this.context.lookupKeyword(e.stem);t&&(l=t.normalized,c=e.stem,u=e.confidence)}}return{value:n,length:r-t,metadata:{normalized:s||l,stem:c,stemConfidence:u,isPreposition:a}}}}}}),Kw={};Ad(Kw,{FrenchTokenizer:()=>Dw,frenchTokenizer:()=>Bw});var Fw,Uw,Gw,Zw,Yw,Xw=Cd({"src/tokenizers/french.ts"(){fy(),Jf(),$w(),yy(),Ng(),Hw(),Vw=[{native:"vrai",normalized:"true"},{native:"faux",normalized:"false"},{native:"nul",normalized:"null"},{native:"ind\u00e9fini",normalized:"undefined"},{native:"indefini",normalized:"undefined"},{native:"premier",normalized:"first"},{native:"premi\u00e8re",normalized:"first"},{native:"premiere",normalized:"first"},{native:"dernier",normalized:"last"},{native:"derni\u00e8re",normalized:"last"},{native:"derniere",normalized:"last"},{native:"suivant",normalized:"next"},{native:"pr\u00e9c\u00e9dent",normalized:"previous"},{native:"precedent",normalized:"previous"},{native:"proche",normalized:"closest"},{native:"parent",normalized:"parent"},{native:"clic",normalized:"click"},{native:"click",normalized:"click"},{native:"entr\u00e9e",normalized:"input"},{native:"entree",normalized:"input"},{native:"changement",normalized:"change"},{native:"soumission",normalized:"submit"},{native:"touche bas",normalized:"keydown"},{native:"touche haut",normalized:"keyup"},{native:"souris dessus",normalized:"mouseover"},{native:"souris dehors",normalized:"mouseout"},{native:"focus",normalized:"focus"},{native:"flou",normalized:"blur"},{native:"chargement",normalized:"load"},{native:"d\u00e9filement",normalized:"scroll"},{native:"defilement",normalized:"scroll"},{native:"je",normalized:"me"},{native:"mon",normalized:"my"},{native:"ma",normalized:"my"},{native:"mes",normalized:"my"},{native:"\u00e7a",normalized:"it"},{native:"ca",normalized:"it"},{native:"resultat",normalized:"result"},{native:"evenement",normalized:"event"},{native:"seconde",normalized:"s"},{native:"secondes",normalized:"s"},{native:"milliseconde",normalized:"ms"},{native:"millisecondes",normalized:"ms"},{native:"minute",normalized:"m"},{native:"minutes",normalized:"m"},{native:"heure",normalized:"h"},{native:"heures",normalized:"h"},{native:"prefixer",normalized:"prepend"},{native:"creer",normalized:"make"},{native:"definir",normalized:"set"},{native:"etablir",normalized:"set"},{native:"incrementer",normalized:"increment"},{native:"decrementer",normalized:"decrement"},{native:"declencher",normalized:"trigger"},{native:"defocaliser",normalized:"blur"},{native:"recuperer",normalized:"fetch"},{native:"repeter",normalized:"repeat"},{native:"arreter",normalized:"halt"},{native:"defaut",normalized:"default"},{native:"jusqua",normalized:"until"},{native:"apres",normalized:"after"},{native:"journaliser",normalized:"log"},{native:"transmuter",normalized:"morph"},{native:"tant que",normalized:"while"},{native:"inclusif",normalized:"inclusive"},{native:"exclusif",normalized:"exclusive"},{native:"caract\u00e8res",normalized:"characters"},{native:"al\u00e9atoire",normalized:"random"}],Bw=new(Dw=class extends ud{constructor(){super(),this.language="fr",this.direction="ltr",this.initializeKeywordsFromProfile(Gf,Vw),this.normalizer=new Rw,this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractors([new qw]),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){return this.isKeyword(e)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":["==","!=","<=",">=","<",">","&&","||","!"].includes(e)?"operator":e.startsWith("/")||e.startsWith("./")||e.startsWith("http")?"url":"identifier"}})}});var Jw,Qw,eb,tb,rb=Cd({"src/tokenizers/morphology/german-normalizer.ts"(){Hg(),Fw=["an","auf","aus","ein","mit","vor","zu","ab","bei","nach","weg","um","her","hin"],Uw=[{ending:"end",stem:"en",confidence:.88,type:"gerund"},{ending:"e",stem:"en",confidence:.75,type:"present"},{ending:"st",stem:"en",confidence:.8,type:"present"},{ending:"t",stem:"en",confidence:.78,type:"present"},{ending:"en",stem:"en",confidence:.85,type:"dictionary"},{ending:"test",stem:"en",confidence:.85,type:"past"},{ending:"ten",stem:"en",confidence:.82,type:"past"},{ending:"tet",stem:"en",confidence:.85,type:"past"},{ending:"te",stem:"en",confidence:.82,type:"past"},{ending:"test",stem:"en",confidence:.8,type:"subjunctive"},{ending:"ten",stem:"en",confidence:.78,type:"subjunctive"},{ending:"tet",stem:"en",confidence:.8,type:"subjunctive"},{ending:"te",stem:"en",confidence:.78,type:"subjunctive"},{ending:"e",stem:"en",confidence:.72,type:"imperative"},{ending:"t",stem:"en",confidence:.72,type:"imperative"},{ending:"en",stem:"en",confidence:.75,type:"imperative"}],Gw=[{ending:"le",stem:"eln",confidence:.82,type:"present"},{ending:"elst",stem:"eln",confidence:.85,type:"present"},{ending:"elt",stem:"eln",confidence:.85,type:"present"},{ending:"eln",stem:"eln",confidence:.88,type:"dictionary"},{ending:"re",stem:"ern",confidence:.82,type:"present"},{ending:"erst",stem:"ern",confidence:.85,type:"present"},{ending:"ert",stem:"ern",confidence:.85,type:"present"},{ending:"ern",stem:"ern",confidence:.88,type:"dictionary"}],Zw=[...Uw,...Gw].sort((e,t)=>t.ending.length-e.ending.length),Yw=class{constructor(){this.language="de"}isNormalizable(e){return e.length>=3&&function(e){const t=e.toLowerCase();return!!(t.endsWith("en")||t.endsWith("eln")||t.endsWith("ern")||t.startsWith("ge")&&t.endsWith("t")||t.startsWith("ge")&&t.endsWith("en")||/[\u00e4\u00f6\u00fc\u00df]/i.test(e))}(e)}normalize(e){const t=e.toLowerCase();if(t.endsWith("en")&&t.length>=4)return yd(e);if((t.endsWith("eln")||t.endsWith("ern"))&&t.length>=5)return yd(e);const r=this.tryParticipleNormalization(t);if(r)return r;const n=this.tryConjugationNormalization(t);return n||yd(e)}tryParticipleNormalization(e){for(const t of Fw)if(e.startsWith(t+"ge")){const r=e.slice(t.length),n=this.trySimpleParticipleNormalization(r);if(n){const e={removedPrefixes:["ge"],conjugationType:"participle"};return n.metadata?.removedSuffixes&&(e.removedSuffixes=n.metadata.removedSuffixes),vd(t+n.stem,.95*n.confidence,e)}}return this.trySimpleParticipleNormalization(e)}trySimpleParticipleNormalization(e){if(!e.startsWith("ge"))return null;const t=e.slice(2);if(t.endsWith("t")&&t.length>=3){return vd(t.slice(0,-1)+"en",.85,{removedPrefixes:["ge"],removedSuffixes:["t"],conjugationType:"participle"})}return t.endsWith("en")&&t.length>=4?vd(t,.82,{removedPrefixes:["ge"],conjugationType:"participle"}):null}tryConjugationNormalization(e){for(const t of Zw)if(e.endsWith(t.ending)){const r=e.slice(0,-t.ending.length);if(2>r.length)continue;return vd(r+t.stem,t.confidence,{removedSuffixes:[t.ending],conjugationType:t.type})}return null}},new Yw}});var nb,ib,ab,ob=Cd({"src/tokenizers/extractors/german-keyword.ts"(){var e;({isLetter:Jw,isIdentifierChar:Qw}=(e=/[a-zA-Z\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df]/,{isLetter:t=>e.test(t),isIdentifierChar:t=>/[0-9]/.test(t)||e.test(t)})),eb=new Set(["an","auf","aus","bei","durch","f\u00fcr","fur","gegen","in","mit","nach","ohne","seit","\u00fcber","uber","um","unter","von","vor","zu","zwischen","bis","gegen\u00fcber","gegenuber","w\u00e4hrend","wahrend","wegen","trotz","statt","innerhalb","au\u00dferhalb","ausserhalb"]),tb=class{constructor(){this.name="german-keyword"}setContext(e){this.context=e}canExtract(e,t){return Jw(e[t])}extract(e,t){if(!this.context)throw Error("GermanKeywordExtractor: context not set");return this.extractGermanWord(e,t)}extractGermanWord(e,t){if(!this.context)return null;let r=t,n="";for(;e.length>r&&Qw(e[r]);)n+=e[r++];if(!n)return null;const i=n.toLowerCase(),a=eb.has(i),o=this.context.lookupKeyword(n),s=o&&o.normalized!==o.native?o.normalized:void 0;let l;if(!o&&this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const t=this.context.lookupKeyword(e.stem);t&&(l=t.normalized)}}return{value:n,length:r-t,metadata:{normalized:s||l,isPreposition:a}}}}}}),sb={};Ad(sb,{GermanTokenizer:()=>ib,germanTokenizer:()=>ab});var lb,cb,ub,pb,db=Cd({"src/tokenizers/german.ts"(){fy(),Bf(),rb(),yy(),Ng(),ob(),nb=[{native:"wahr",normalized:"true"},{native:"falsch",normalized:"false"},{native:"null",normalized:"null"},{native:"undefiniert",normalized:"undefined"},{native:"erste",normalized:"first"},{native:"erster",normalized:"first"},{native:"erstes",normalized:"first"},{native:"letzte",normalized:"last"},{native:"letzter",normalized:"last"},{native:"letztes",normalized:"last"},{native:"n\u00e4chste",normalized:"next"},{native:"nachste",normalized:"next"},{native:"n\u00e4chstgelegene",normalized:"closest"},{native:"nachstgelegene",normalized:"closest"},{native:"vorherige",normalized:"previous"},{native:"eltern",normalized:"parent"},{native:"klick",normalized:"click"},{native:"click",normalized:"click"},{native:"eingabe",normalized:"input"},{native:"\u00e4nderung",normalized:"change"},{native:"anderung",normalized:"change"},{native:"absenden",normalized:"submit"},{native:"taste unten",normalized:"keydown"},{native:"taste oben",normalized:"keyup"},{native:"maus dr\u00fcber",normalized:"mouseover"},{native:"maus druber",normalized:"mouseover"},{native:"maus weg",normalized:"mouseout"},{native:"fokus",normalized:"focus"},{native:"unsch\u00e4rfe",normalized:"blur"},{native:"unscharfe",normalized:"blur"},{native:"scrollen",normalized:"scroll"},{native:"meine",normalized:"my"},{native:"meinen",normalized:"my"},{native:"ergebnis",normalized:"result"},{native:"ziel",normalized:"target"},{native:"sekunde",normalized:"s"},{native:"sekunden",normalized:"s"},{native:"millisekunde",normalized:"ms"},{native:"millisekunden",normalized:"ms"},{native:"minute",normalized:"m"},{native:"minuten",normalized:"m"},{native:"stunde",normalized:"h"},{native:"stunden",normalized:"h"},{native:"hinzufugen",normalized:"add"},{native:"hinzufgen",normalized:"add"},{native:"loschen",normalized:"remove"},{native:"anhangen",normalized:"append"},{native:"erhohen",normalized:"increment"},{native:"ubergang",normalized:"transition"},{native:"auslosen",normalized:"trigger"},{native:"zuruckgeben",normalized:"return"},{native:"anschliessend",normalized:"then"},{native:"erh\u00f6he",normalized:"increment"},{native:"erhohe",normalized:"increment"},{native:"verringere",normalized:"decrement"},{native:"inklusiv",normalized:"inclusive"},{native:"exklusiv",normalized:"exclusive"},{native:"Zeichen",normalized:"characters"},{native:"zuf\u00e4llig",normalized:"random"}],ab=new(ib=class extends ud{constructor(){super(),this.language="de",this.direction="ltr",this.initializeKeywordsFromProfile(qf,nb),this.normalizer=new Yw,this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractors([new tb]),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){return this.isKeyword(e)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":e.startsWith("/")||e.startsWith("./")||e.startsWith("http")?"url":"identifier"}})}}),mb={};Ad(mb,{IndonesianTokenizer:()=>ub,indonesianTokenizer:()=>pb});var fb,hb,yb=Cd({"src/tokenizers/indonesian.ts"(){fy(),sh(),yy(),Ng(),rg(),lb=new Set(["di","ke","dari","pada","dengan","tanpa","untuk","oleh","antara","sebelum","sesudah","setelah","selama","sampai","hingga","sejak","menuju","tentang","terhadap","melalui","dalam","luar"]),cb=[{native:"ubah_ukuran",normalized:"resize"},{native:"tidak_ada",normalized:"no"},{native:"benar",normalized:"true"},{native:"salah",normalized:"false"},{native:"null",normalized:"null"},{native:"kosong",normalized:"null"},{native:"tidakdidefinisikan",normalized:"undefined"},{native:"tidak_terdefinisi",normalized:"undefined"},{native:"pertama",normalized:"first"},{native:"terakhir",normalized:"last"},{native:"berikutnya",normalized:"next"},{native:"sebelumnya",normalized:"previous"},{native:"terdekat",normalized:"closest"},{native:"induk",normalized:"parent"},{native:"klik",normalized:"click"},{native:"click",normalized:"click"},{native:"ubah",normalized:"change"},{native:"kirim",normalized:"submit"},{native:"tekan",normalized:"keydown"},{native:"arahkan",normalized:"mouseover"},{native:"tinggalkan",normalized:"mouseout"},{native:"kabur",normalized:"blur"},{native:"muat",normalized:"load"},{native:"gulir",normalized:"scroll"},{native:"input",normalized:"input"},{native:"milik",normalized:"my"},{native:"detik",normalized:"s"},{native:"milidetik",normalized:"ms"},{native:"menit",normalized:"m"},{native:"jam",normalized:"h"},{native:"atau",normalized:"or"},{native:"tidak",normalized:"not"},{native:"adalah",normalized:"is"},{native:"ada",normalized:"exists"},{native:"inklusif",normalized:"inclusive"},{native:"eksklusif",normalized:"exclusive"},{native:"karakter",normalized:"characters"},{native:"acak",normalized:"random"}],pb=new(ub=class extends ud{constructor(){super(),this.language="id",this.direction="ltr",this.initializeKeywordsFromProfile(nh,cb),this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractors([new Yv]),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){const t=e.toLowerCase();return lb.has(t)?"particle":this.isKeyword(t)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":["==","!=","<=",">=","<",">","&&","||","!"].includes(e)?"operator":e.startsWith("/")||e.startsWith("./")||e.startsWith("http")?"url":"identifier"}})}});function vb(e){const t=e.charCodeAt(0);return t>=65&&90>=t||t>=97&&122>=t||("\u00f1"===e||"\u00d1"===e||"'"===e||"'"===e)}var gb,kb,wb,bb,zb,xb=Cd({"src/tokenizers/morphology/quechua-normalizer.ts"(){Hg(),fb=[{pattern:"shankichik",confidence:.8,conjugationType:"progressive",minStemLength:2},{pattern:"shaniku",confidence:.8,conjugationType:"progressive",minStemLength:2},{pattern:"shanki",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"shani",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"shanchik",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"shanku",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"shan",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"rqankichik",confidence:.8,conjugationType:"past",minStemLength:2},{pattern:"rqaniku",confidence:.8,conjugationType:"past",minStemLength:2},{pattern:"rqanki",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"rqani",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"rqanchik",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"rqanku",confidence:.82,conjugationType:"past",minStemLength:2},{pattern:"rqan",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"nqankichik",confidence:.8,conjugationType:"future",minStemLength:2},{pattern:"nqaniku",confidence:.8,conjugationType:"future",minStemLength:2},{pattern:"nqanki",confidence:.82,conjugationType:"future",minStemLength:2},{pattern:"nqani",confidence:.82,conjugationType:"future",minStemLength:2},{pattern:"nqanchik",confidence:.82,conjugationType:"future",minStemLength:2},{pattern:"nqanku",confidence:.82,conjugationType:"future",minStemLength:2},{pattern:"nqa",confidence:.85,conjugationType:"future",minStemLength:2},{pattern:"chikuy",confidence:.8,conjugationType:"compound",minStemLength:2},{pattern:"chiku",confidence:.82,conjugationType:"compound",minStemLength:2},{pattern:"chiy",confidence:.85,conjugationType:"causative",minStemLength:2,replacement:"y"},{pattern:"chiq",confidence:.85,conjugationType:"causative",minStemLength:2,replacement:"y"},{pattern:"chi",confidence:.82,conjugationType:"causative",minStemLength:2},{pattern:"kuy",confidence:.82,conjugationType:"reflexive",minStemLength:2},{pattern:"rqa",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"rqan",confidence:.85,conjugationType:"past",minStemLength:2},{pattern:"sha",confidence:.82,conjugationType:"progressive",minStemLength:2},{pattern:"na",confidence:.85,conjugationType:"obligation",minStemLength:2},{pattern:"manmi",confidence:.8,conjugationType:"potential",minStemLength:2},{pattern:"man",confidence:.8,conjugationType:"potential",minStemLength:2},{pattern:"nkichik",confidence:.8,conjugationType:"present",minStemLength:2},{pattern:"niku",confidence:.8,conjugationType:"present",minStemLength:2},{pattern:"nki",confidence:.82,conjugationType:"present",minStemLength:2},{pattern:"nchik",confidence:.82,conjugationType:"present",minStemLength:2},{pattern:"nku",confidence:.82,conjugationType:"present",minStemLength:2},{pattern:"ni",confidence:.85,conjugationType:"present",minStemLength:2},{pattern:"ku",confidence:.82,conjugationType:"reflexive",minStemLength:2},{pattern:"ychik",confidence:.82,conjugationType:"imperative",minStemLength:2},{pattern:"y",confidence:.9,conjugationType:"dictionary",minStemLength:2},{pattern:"sqa",confidence:.82,conjugationType:"passive",minStemLength:2},{pattern:"ska",confidence:.82,conjugationType:"passive",minStemLength:2},{pattern:"kama",confidence:.7,conjugationType:"dictionary",minStemLength:2},{pattern:"manta",confidence:.7,conjugationType:"dictionary",minStemLength:2},{pattern:"man",confidence:.7,conjugationType:"dictionary",minStemLength:2},{pattern:"wan",confidence:.7,conjugationType:"dictionary",minStemLength:2},{pattern:"pi",confidence:.7,conjugationType:"dictionary",minStemLength:2},{pattern:"ta",confidence:.7,conjugationType:"dictionary",minStemLength:2}],hb=new class{constructor(){this.language="qu"}isNormalizable(e){if(!function(e){for(const t of e)if(vb(t))return!0;return!1}(e))return!1;if(3>e.length)return!1;return!!/[aiu]/.test(e.toLowerCase())}normalize(e){const t=e.toLowerCase();for(const e of fb)if(t.endsWith(e.pattern)){let r=t.slice(0,-e.pattern.length);e.replacement&&!r.endsWith(e.replacement)&&(r+=e.replacement);if((e.minStemLength??2)>r.length)continue;if(!this.isValidStem(r))continue;const n={removedSuffixes:[e.pattern]};return e.conjugationType&&(n.conjugationType=e.conjugationType),vd(r,e.confidence,n)}return yd(e)}isValidStem(e){if(2>e.length)return!1;if(!/[aeiou]/.test(e))return!1;return!new Set(["ta","man","pi","wan","pa","kama","hina"]).has(e)}}}}),Eb={};Ad(Eb,{QuechuaTokenizer:()=>bb,quechuaTokenizer:()=>zb});var Tb,Sb,Cb,Ab,Lb=Cd({"src/tokenizers/quechua.ts"(){fy(),Ah(),xb(),yy(),Ng(),kg(),gb=class{constructor(){this.name="quechua-string-literal"}canExtract(e,t){return'"'===e[t]||"'"===e[t]||"`"===e[t]}extract(e,t){const r=e[t];let n=r,i=t+1;for(;e.length>i;){const t=e[i];if(t===r)return n+=t,{value:n,length:n.length};"\\"===t&&e.length>i+1?(n+=t+e[i+1],i+=2):(n+=t,i++)}return null}},kb=new Set(["-ta","-man","-manta","-pi","-wan","-paq","-kama","-rayku","-hina","ta","man","manta","pi","wan","paq","kama","hina","pa"]),wb=[{native:"sanampa",normalized:"characters"},{native:"cheqaq",normalized:"true"},{native:"ar\u00ed",normalized:"true"},{native:"ari",normalized:"true"},{native:"manan",normalized:"false"},{native:"mana",normalized:"false"},{native:"ch'usaq",normalized:"null"},{native:"chusaq",normalized:"null"},{native:"mana riqsisqa",normalized:"undefined"},{native:"\u00f1awpaqpi",normalized:"before"},{native:"nawpaqpi",normalized:"before"},{native:"qhepapi",normalized:"after"},{native:"qhipapi",normalized:"after"},{native:"\u00f1awpaq",normalized:"first"},{native:"nawpaq",normalized:"first"},{native:"qhipa",normalized:"last"},{native:"hamuq",normalized:"next"},{native:"qhipantin",normalized:"next"},{native:"\u00f1awpaqnin",normalized:"previous"},{native:"\u00f1awpaq kaq",normalized:"previous"},{native:"\u00f1awpaq_kaq",normalized:"previous"},{native:"kaylla",normalized:"closest"},{native:"ukupi",normalized:"in"},{native:"k_iri",normalized:"window"},{native:"hatun_kay",normalized:"resize"},{native:"mana_kanchu",normalized:"no"},{native:"mana_riqsisqa",normalized:"undefined"},{native:"qaylla",normalized:"closest"},{native:"tayta",normalized:"parent"},{native:"llikllay",normalized:"click"},{native:"\u00f1itiy",normalized:"click"},{native:"\u00f1it'iy",normalized:"click"},{native:"click",normalized:"click"},{native:"yaykuy",normalized:"input"},{native:"llave uray",normalized:"keydown"},{native:"llave hawa",normalized:"keyup"},{native:"mausiri yayku",normalized:"mouseover"},{native:"mausiri lluqsi",normalized:"mouseout"},{native:"rat\u00f1itiy",normalized:"mousedown"},{native:"rathuqariy",normalized:"mouseup"},{native:"qhaway",normalized:"focus"},{native:"mana qhaway",normalized:"blur"},{native:"kargay",normalized:"load"},{native:"muyuy",normalized:"scroll"},{native:"\u00f1uqa",normalized:"me"},{native:"nuqa",normalized:"me"},{native:"\u00f1uqap",normalized:"my"},{native:"nuqap",normalized:"my"},{native:"chay",normalized:"it"},{native:"chaymi",normalized:"it"},{native:"lluqsiy",normalized:"result"},{native:"ruway",normalized:"event"},{native:"maypi",normalized:"target"},{native:"sikundu",normalized:"s"},{native:"segundu",normalized:"s"},{native:"waranqa sikundu",normalized:"ms"},{native:"minutu",normalized:"m"},{native:"ura",normalized:"h"},{native:"hora",normalized:"h"},{native:"chaypim",normalized:"on"},{native:"kaypi",normalized:"on"},{native:"chayqa",normalized:"then"},{native:"chaymanta",normalized:"then"},{native:"chaymantataq",normalized:"then"},{native:"hinaspa",normalized:"then"},{native:"tukukuy",normalized:"end"},{native:"puchukay",normalized:"end"},{native:"kaykama",normalized:"until"},{native:"yapay",normalized:"add"},{native:"t'ikray",normalized:"toggle"},{native:"tikray",normalized:"toggle"},{native:"qhawachiy",normalized:"focus"},{native:"mana qhawachiy",normalized:"blur"},{native:"-manta",normalized:"from"},{native:"imaymanata",normalized:"random"}],zb=new(bb=class extends ud{constructor(){super(),this.language="qu",this.direction="ltr",this.initializeKeywordsFromProfile(Eh,wb),this.setNormalizer(hb),this.registerExtractors(Pg()),this.registerExtractor(new gb),this.registerExtractor(new Nu),this.registerExtractor(new pg),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){const t=e.toLowerCase();return kb.has(t)?"particle":this.isKeyword(t)?"keyword":e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||e.startsWith("http")?"url":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":["==","!=","<=",">=","<",">","&&","||","!"].includes(e)?"operator":"identifier"}})}}),jb={};Ad(jb,{SwahiliTokenizer:()=>Cb,swahiliTokenizer:()=>Ab});var Pb,Ob,Nb,Rb,Mb,Ib,Wb=Cd({"src/tokenizers/swahili.ts"(){fy(),Rh(),yy(),Ng(),og(),Tb=new Set(["kwa","na","katika","kwenye","kutoka","hadi","mpaka","kabla","baada","wakati","bila","kuhusu","karibu","mbele","nyuma","ndani","nje","juu","chini","kati"]),Sb=[{native:"badilisha_ukubwa",normalized:"resize"},{native:"kweli",normalized:"true"},{native:"uongo",normalized:"false"},{native:"null",normalized:"null"},{native:"haijafafanuliwa",normalized:"undefined"},{native:"kwanza",normalized:"first"},{native:"wamwisho",normalized:"last"},{native:"ifuatayo",normalized:"next"},{native:"ijayo",normalized:"next"},{native:"iliyotangulia",normalized:"previous"},{native:"iliyopita",normalized:"previous"},{native:"karibu",normalized:"closest"},{native:"mzazi",normalized:"parent"},{native:"bonyeza",normalized:"click"},{native:"click",normalized:"click"},{native:"ganti",normalized:"change"},{native:"wasilisha",normalized:"submit"},{native:"bonyeza kitufe",normalized:"keydown"},{native:"sogeza juu",normalized:"mouseover"},{native:"sogeza nje",normalized:"mouseout"},{native:"panya_shuka",normalized:"mousedown"},{native:"panya_juu",normalized:"mouseup"},{native:"panya_ingia",normalized:"mouseenter"},{native:"panya_toka",normalized:"mouseleave"},{native:"panya_nje",normalized:"mouseout"},{native:"panya_sogea",normalized:"mousemove"},{native:"kitufe_shuka",normalized:"keydown"},{native:"kitufe_juu",normalized:"keyup"},{native:"fifia",normalized:"blur"},{native:"pakia",normalized:"load"},{native:"sukuma",normalized:"scroll"},{native:"input",normalized:"input"},{native:"ingizo",normalized:"input"},{native:"yangu",normalized:"my"},{native:"wangu",normalized:"my"},{native:"changu",normalized:"my"},{native:"langu",normalized:"my"},{native:"sekunde",normalized:"s"},{native:"millisekunde",normalized:"ms"},{native:"dakika",normalized:"m"},{native:"saa",normalized:"h"},{native:"au",normalized:"or"},{native:"si",normalized:"not"},{native:"ni",normalized:"is"},{native:"ipo",normalized:"exists"},{native:"tupu",normalized:"empty"},{native:"herufi",normalized:"characters"},{native:"nasibu",normalized:"random"}],Ab=new(Cb=class extends ud{constructor(){super(),this.language="sw",this.direction="ltr",this.initializeKeywordsFromProfile(jh,Sb),this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractors([new tg]),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){const t=e.toLowerCase();return Tb.has(t)?"particle":this.isKeyword(t)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":["==","!=","<=",">=","<",">","&&","||","!"].includes(e)?"operator":e.startsWith("/")||e.startsWith("./")||e.startsWith("http")?"url":"identifier"}})}});function _b(e){return/[\u00e0\u00e8\u00e9\u00ec\u00ed\u00ee\u00f2\u00f3\u00f9\u00fa\u00c0\u00c8\u00c9\u00cc\u00cd\u00ce\u00d2\u00d3\u00d9\u00da]/.test(e)}var qb,$b,Vb=Cd({"src/tokenizers/morphology/italian-normalizer.ts"(){Hg(),Pb=["si","mi","ti","ci","vi"],Ob=[{ending:"ando",stem:"are",confidence:.88,type:"gerund"},{ending:"ato",stem:"are",confidence:.88,type:"participle"},{ending:"ata",stem:"are",confidence:.88,type:"participle"},{ending:"ati",stem:"are",confidence:.88,type:"participle"},{ending:"ate",stem:"are",confidence:.88,type:"participle"},{ending:"o",stem:"are",confidence:.75,type:"present"},{ending:"i",stem:"are",confidence:.72,type:"present"},{ending:"a",stem:"are",confidence:.75,type:"present"},{ending:"iamo",stem:"are",confidence:.85,type:"present"},{ending:"ate",stem:"are",confidence:.85,type:"present"},{ending:"ano",stem:"are",confidence:.85,type:"present"},{ending:"avo",stem:"are",confidence:.88,type:"past"},{ending:"avi",stem:"are",confidence:.88,type:"past"},{ending:"ava",stem:"are",confidence:.88,type:"past"},{ending:"avamo",stem:"are",confidence:.88,type:"past"},{ending:"avate",stem:"are",confidence:.88,type:"past"},{ending:"avano",stem:"are",confidence:.88,type:"past"},{ending:"ai",stem:"are",confidence:.85,type:"past"},{ending:"asti",stem:"are",confidence:.88,type:"past"},{ending:"\u00f2",stem:"are",confidence:.85,type:"past"},{ending:"ammo",stem:"are",confidence:.88,type:"past"},{ending:"aste",stem:"are",confidence:.88,type:"past"},{ending:"arono",stem:"are",confidence:.88,type:"past"},{ending:"i",stem:"are",confidence:.72,type:"subjunctive"},{ending:"ino",stem:"are",confidence:.82,type:"subjunctive"},{ending:"a",stem:"are",confidence:.75,type:"imperative"},{ending:"are",stem:"are",confidence:.92,type:"dictionary"}],Nb=[{ending:"endo",stem:"ere",confidence:.88,type:"gerund"},{ending:"uto",stem:"ere",confidence:.85,type:"participle"},{ending:"uta",stem:"ere",confidence:.85,type:"participle"},{ending:"uti",stem:"ere",confidence:.85,type:"participle"},{ending:"ute",stem:"ere",confidence:.85,type:"participle"},{ending:"o",stem:"ere",confidence:.72,type:"present"},{ending:"i",stem:"ere",confidence:.72,type:"present"},{ending:"e",stem:"ere",confidence:.72,type:"present"},{ending:"iamo",stem:"ere",confidence:.85,type:"present"},{ending:"ete",stem:"ere",confidence:.85,type:"present"},{ending:"ono",stem:"ere",confidence:.82,type:"present"},{ending:"evo",stem:"ere",confidence:.88,type:"past"},{ending:"evi",stem:"ere",confidence:.88,type:"past"},{ending:"eva",stem:"ere",confidence:.88,type:"past"},{ending:"evamo",stem:"ere",confidence:.88,type:"past"},{ending:"evate",stem:"ere",confidence:.88,type:"past"},{ending:"evano",stem:"ere",confidence:.88,type:"past"},{ending:"ei",stem:"ere",confidence:.85,type:"past"},{ending:"etti",stem:"ere",confidence:.85,type:"past"},{ending:"esti",stem:"ere",confidence:.88,type:"past"},{ending:"\u00e9",stem:"ere",confidence:.85,type:"past"},{ending:"ette",stem:"ere",confidence:.85,type:"past"},{ending:"emmo",stem:"ere",confidence:.88,type:"past"},{ending:"este",stem:"ere",confidence:.88,type:"past"},{ending:"erono",stem:"ere",confidence:.88,type:"past"},{ending:"ettero",stem:"ere",confidence:.88,type:"past"},{ending:"ere",stem:"ere",confidence:.92,type:"dictionary"}],Rb=[{ending:"endo",stem:"ire",confidence:.85,type:"gerund"},{ending:"ito",stem:"ire",confidence:.85,type:"participle"},{ending:"ita",stem:"ire",confidence:.85,type:"participle"},{ending:"iti",stem:"ire",confidence:.85,type:"participle"},{ending:"ite",stem:"ire",confidence:.85,type:"participle"},{ending:"o",stem:"ire",confidence:.7,type:"present"},{ending:"i",stem:"ire",confidence:.7,type:"present"},{ending:"e",stem:"ire",confidence:.7,type:"present"},{ending:"iamo",stem:"ire",confidence:.85,type:"present"},{ending:"ite",stem:"ire",confidence:.85,type:"present"},{ending:"ono",stem:"ire",confidence:.78,type:"present"},{ending:"isco",stem:"ire",confidence:.85,type:"present"},{ending:"isci",stem:"ire",confidence:.85,type:"present"},{ending:"isce",stem:"ire",confidence:.85,type:"present"},{ending:"iscono",stem:"ire",confidence:.88,type:"present"},{ending:"ivo",stem:"ire",confidence:.88,type:"past"},{ending:"ivi",stem:"ire",confidence:.88,type:"past"},{ending:"iva",stem:"ire",confidence:.88,type:"past"},{ending:"ivamo",stem:"ire",confidence:.88,type:"past"},{ending:"ivate",stem:"ire",confidence:.88,type:"past"},{ending:"ivano",stem:"ire",confidence:.88,type:"past"},{ending:"ii",stem:"ire",confidence:.85,type:"past"},{ending:"isti",stem:"ire",confidence:.88,type:"past"},{ending:"\u00ec",stem:"ire",confidence:.85,type:"past"},{ending:"immo",stem:"ire",confidence:.88,type:"past"},{ending:"iste",stem:"ire",confidence:.88,type:"past"},{ending:"irono",stem:"ire",confidence:.88,type:"past"},{ending:"ire",stem:"ire",confidence:.92,type:"dictionary"}],Mb=[...Ob,...Nb,...Rb].sort((e,t)=>t.ending.length-e.ending.length),new(Ib=class{constructor(){this.language="it"}isNormalizable(e){return e.length>=3&&function(e){const t=e.toLowerCase();if(t.endsWith("are")||t.endsWith("ere")||t.endsWith("ire"))return!0;if(t.endsWith("ando")||t.endsWith("endo"))return!0;if(t.endsWith("ato")||t.endsWith("uto")||t.endsWith("ito"))return!0;if(t.endsWith("arsi")||t.endsWith("ersi")||t.endsWith("irsi"))return!0;for(const t of e)if(_b(t))return!0;return!1}(e)}normalize(e){const t=e.toLowerCase();if((t.endsWith("are")||t.endsWith("ere")||t.endsWith("ire"))&&!Pb.some(e=>t.endsWith(e+"are")||t.endsWith(e+"ere")||t.endsWith(e+"ire")))return yd(e);const r=this.tryReflexiveNormalization(t);if(r)return r;const n=this.tryConjugationNormalization(t);return n||yd(e)}tryReflexiveNormalization(e){for(const t of Pb)if(e.endsWith(t)){const r=e.slice(0,-t.length);if(r.endsWith("ar")||r.endsWith("er")||r.endsWith("ir")){return vd(r+"e",.88,{removedSuffixes:[t],conjugationType:"reflexive"})}if(r.endsWith("are")||r.endsWith("ere")||r.endsWith("ire"))return vd(r,.88,{removedSuffixes:[t],conjugationType:"reflexive"});const n=this.tryConjugationNormalization(r);if(n&&n.stem!==r)return vd(n.stem,.95*n.confidence,{removedSuffixes:[t,...n.metadata?.removedSuffixes||[]],conjugationType:"reflexive"})}return null}tryConjugationNormalization(e){for(const t of Mb)if(e.endsWith(t.ending)){const r=e.slice(0,-t.ending.length);if(2>r.length)continue;return vd(r+t.stem,t.confidence,{removedSuffixes:[t.ending],conjugationType:t.type})}return null}})}});var Db,Bb,Hb,Kb,Fb=Cd({"src/tokenizers/extractors/romance-language-keyword.ts"(){qb=class{constructor(e,t,r){this.name=e;const n=(i=t,{isLetter:e=>i.test(e),isIdentifierChar:e=>/[0-9]/.test(e)||i.test(e)});var i;this.isLetter=n.isLetter,this.isIdentifierChar=n.isIdentifierChar,this.prepositions=r}setContext(e){this.context=e}canExtract(e,t){return this.isLetter(e[t])}extract(e,t){if(!this.context)throw Error(this.name+": context not set");let r=t,n="";for(;e.length>r&&this.isIdentifierChar(e[r]);)n+=e[r++];if(!n)return null;const i=n.toLowerCase(),a=this.prepositions.has(i),o=this.context.lookupKeyword(i),s=o&&o.normalized!==o.native?o.normalized:void 0;let l;if(!o&&this.context.normalizer){const e=this.context.normalizer.normalize(n);if(e.stem!==n&&e.confidence>=.7){const t=this.context.lookupKeyword(e.stem);t&&(l=t.normalized)}}return{value:n,length:r-t,metadata:{normalized:s||l,isPreposition:a}}}},$b=new Set(["in","a","di","da","con","su","per","tra","fra","dopo","prima","dentro","fuori","sopra","sotto","al","allo","alla","ai","agli","alle","del","dello","della","dei","degli","delle","dal","dallo","dalla","dai","dagli","dalle","nel","nello","nella","nei","negli","nelle","sul","sullo","sulla","sui","sugli","sulle"])}}),Ub={};Ad(Ub,{ItalianTokenizer:()=>Hb,italianTokenizer:()=>Kb});var Gb,Zb,Yb,Xb=Cd({"src/tokenizers/italian.ts"(){fy(),Vb(),uh(),yy(),Ng(),Fb(),Db=new Set(["in","a","di","da","con","su","per","tra","fra","dopo","prima","dentro","fuori","sopra","sotto","al","allo","alla","ai","agli","alle","del","dello","della","dei","degli","delle","dal","dallo","dalla","dai","dagli","dalle","nel","nello","nella","nei","negli","nelle","sul","sullo","sulla","sui","sugli","sulle"]),Bb=[{native:"vero",normalized:"true"},{native:"falso",normalized:"false"},{native:"nullo",normalized:"null"},{native:"indefinito",normalized:"undefined"},{native:"primo",normalized:"first"},{native:"prima",normalized:"first"},{native:"ultimo",normalized:"last"},{native:"ultima",normalized:"last"},{native:"prossimo",normalized:"next"},{native:"successivo",normalized:"next"},{native:"precedente",normalized:"previous"},{native:"vicino",normalized:"closest"},{native:"padre",normalized:"parent"},{native:"clic",normalized:"click"},{native:"click",normalized:"click"},{native:"fare clic",normalized:"click"},{native:"input",normalized:"input"},{native:"cambio",normalized:"change"},{native:"invio",normalized:"submit"},{native:"tasto gi\u00f9",normalized:"keydown"},{native:"tasto su",normalized:"keyup"},{native:"mouse sopra",normalized:"mouseover"},{native:"mouse fuori",normalized:"mouseout"},{native:"fuoco",normalized:"focus"},{native:"sfuocatura",normalized:"blur"},{native:"caricamento",normalized:"load"},{native:"scorrimento",normalized:"scroll"},{native:"io",normalized:"me"},{native:"me",normalized:"me"},{native:"destinazione",normalized:"target"},{native:"secondo",normalized:"s"},{native:"secondi",normalized:"s"},{native:"millisecondo",normalized:"ms"},{native:"millisecondi",normalized:"ms"},{native:"minuto",normalized:"m"},{native:"minuti",normalized:"m"},{native:"ora",normalized:"h"},{native:"ore",normalized:"h"},{native:"fino a",normalized:"until"},{native:"prima di",normalized:"before"},{native:"dopo di",normalized:"after"},{native:"dentro di",normalized:"into"},{native:"fuori di",normalized:"out"},{native:"aggiungere",normalized:"add"},{native:"aggiungi",normalized:"add"},{native:"rimuovi",normalized:"remove"},{native:"elimina",normalized:"remove"},{native:"togli",normalized:"remove"},{native:"metti",normalized:"put"},{native:"inserisci",normalized:"put"},{native:"prendi",normalized:"take"},{native:"fai",normalized:"make"},{native:"crea",normalized:"make"},{native:"clona",normalized:"clone"},{native:"copia",normalized:"clone"},{native:"imposta",normalized:"set"},{native:"ottieni",normalized:"get"},{native:"incrementa",normalized:"increment"},{native:"aumenta",normalized:"increment"},{native:"decrementa",normalized:"decrement"},{native:"diminuisci",normalized:"decrement"},{native:"registra",normalized:"log"},{native:"mostra",normalized:"show"},{native:"visualizza",normalized:"show"},{native:"nascondi",normalized:"hide"},{native:"anima",normalized:"transition"},{native:"scatena",normalized:"trigger"},{native:"attiva",normalized:"trigger"},{native:"invia",normalized:"send"},{native:"focalizza",normalized:"focus"},{native:"sfuoca",normalized:"blur"},{native:"vai",normalized:"go"},{native:"naviga",normalized:"go"},{native:"aspetta",normalized:"wait"},{native:"attendi",normalized:"wait"},{native:"recupera",normalized:"fetch"},{native:"stabilizza",normalized:"settle"},{native:"ripeti",normalized:"repeat"},{native:"continua",normalized:"continue"},{native:"ferma",normalized:"halt"},{native:"lancia",normalized:"throw"},{native:"chiama",normalized:"call"},{native:"ritorna",normalized:"return"},{native:"inizializza",normalized:"init"},{native:"installa",normalized:"install"},{native:"misura",normalized:"measure"},{native:"e",normalized:"and"},{native:"o",normalized:"or"},{native:"non",normalized:"not"},{native:"\u00e8",normalized:"is"},{native:"esiste",normalized:"exists"},{native:"vuoto",normalized:"empty"},{native:"toggle",normalized:"toggle"},{native:"di",normalized:"tell"},{native:"inclusivo",normalized:"inclusive"},{native:"esclusivo",normalized:"exclusive"},{native:"caratteri",normalized:"characters"},{native:"casuale",normalized:"random"}],Kb=new(Hb=class extends ud{constructor(){super(),this.language="it",this.direction="ltr",this.initializeKeywordsFromProfile(oh,Bb),this.setNormalizer(new Ib),this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractors([new qb("italian-keyword",/[a-zA-Z\u00e0\u00e8\u00e9\u00ec\u00ed\u00ee\u00f2\u00f3\u00f9\u00fa\u00c0\u00c8\u00c9\u00cc\u00cd\u00ce\u00d2\u00d3\u00d9\u00da]/,$b)]),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){const t=e.toLowerCase();return Db.has(t)?"particle":this.isKeyword(t)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":["==","!=","<=",">=","<",">","&&","||","!"].includes(e)?"operator":e.startsWith("/")||e.startsWith("./")||e.startsWith("http")?"url":"identifier"}})}}),Jb={};Ad(Jb,{VietnameseTokenizer:()=>Zb,vietnameseTokenizer:()=>Yb});var Qb,ez,tz,rz,nz,iz,az=Cd({"src/tokenizers/vietnamese.ts"(){fy(),Zh(),fv(),yy(),Ng(),Gb=[{native:"\u0111\u00fang",normalized:"true"},{native:"sai",normalized:"false"},{native:"null",normalized:"null"},{native:"kh\u00f4ng x\u00e1c \u0111\u1ecbnh",normalized:"undefined"},{native:"\u0111\u1ea7u ti\u00ean",normalized:"first"},{native:"cu\u1ed1i c\u00f9ng",normalized:"last"},{native:"ti\u1ebfp theo",normalized:"next"},{native:"tr\u01b0\u1edbc \u0111\u00f3",normalized:"previous"},{native:"g\u1ea7n nh\u1ea5t",normalized:"closest"},{native:"cha",normalized:"parent"},{native:"nh\u1ea5p",normalized:"click"},{native:"nh\u1ea5p chu\u1ed9t",normalized:"click"},{native:"click",normalized:"click"},{native:"nh\u1ea5p \u0111\u00fap",normalized:"dblclick"},{native:"nh\u1eadp",normalized:"input"},{native:"thay \u0111\u1ed5i",normalized:"change"},{native:"g\u1eedi bi\u1ec3u m\u1eabu",normalized:"submit"},{native:"ph\u00edm xu\u1ed1ng",normalized:"keydown"},{native:"ph\u00edm l\u00ean",normalized:"keyup"},{native:"chu\u1ed9t v\u00e0o",normalized:"mouseover"},{native:"chu\u1ed9t ra",normalized:"mouseout"},{native:"t\u1ea3i trang",normalized:"load"},{native:"cu\u1ed9n",normalized:"scroll"},{native:"c\u1ee7a t\u00f4i",normalized:"my"},{native:"c\u1ee7a n\u00f3",normalized:"its"},{native:"gi\u00e2y",normalized:"s"},{native:"mili gi\u00e2y",normalized:"ms"},{native:"ph\u00fat",normalized:"m"},{native:"gi\u1edd",normalized:"h"},{native:"th\u00eam v\u00e0o cu\u1ed1i",normalized:"append"},{native:"nh\u00e2n b\u1ea3n",normalized:"clone"},{native:"t\u1ea1o ra",normalized:"make"},{native:"\u0111\u1eb7t gi\u00e1 tr\u1ecb",normalized:"set"},{native:"gi\u00e1 tr\u1ecb",normalized:"value"},{native:"ghi nh\u1eadt k\u00fd",normalized:"log"},{native:"chuy\u1ec3n t\u1edbi",normalized:"go"},{native:"ng\u01b0\u1ee3c l\u1ea1i",normalized:"else"},{native:"l\u1eb7p",normalized:"repeat"},{native:"ho\u1eb7c",normalized:"or"},{native:"kh\u00f4ng",normalized:"not"},{native:"l\u00e0",normalized:"is"},{native:"t\u1ed3n t\u1ea1i",normalized:"exists"},{native:"r\u1ed7ng",normalized:"empty"},{native:"javascript",normalized:"js"},{native:"bao g\u1ed3m",normalized:"inclusive"},{native:"lo\u1ea1i tr\u1eeb",normalized:"exclusive"},{native:"k\u00fd t\u1ef1",normalized:"characters"},{native:"ng\u1eabu nhi\u00ean",normalized:"random"}],Yb=new(Zb=class extends ud{constructor(){super(),this.language="vi",this.direction="ltr",this.initializeKeywordsFromProfile(Kh,Gb),this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractors([new Jy]),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){const t=e.toLowerCase();return this.isKeyword(t)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":["==","!=","<=",">=","<",">","&&","||","!"].includes(e)?"operator":e.startsWith("/")||e.startsWith("./")||e.startsWith("http")?"url":"identifier"}})}}),oz=Cd({"src/tokenizers/morphology/polish-normalizer.ts"(){Hg(),Qb=new Map([["prze\u0142\u0105cz","prze\u0142\u0105cza\u0107"],["przelacz","przelaczac"],["dodaj","dodawa\u0107"],["usu\u0144","usuwa\u0107"],["usun","usuwac"],["umie\u015b\u0107","umieszcza\u0107"],["umiesc","umieszczac"],["wstaw","wstawia\u0107"],["ustaw","ustawia\u0107"],["pobierz","pobiera\u0107"],["we\u017a","bra\u0107"],["wez","brac"],["zwi\u0119ksz","zwi\u0119ksza\u0107"],["zwieksz","zwiekszac"],["zmniejsz","zmniejsza\u0107"],["poka\u017c","pokazywa\u0107"],["pokaz","pokazywac"],["ukryj","ukrywa\u0107"],["schowaj","schowywa\u0107"],["czekaj","czeka\u0107"],["poczekaj","poczeka\u0107"],["id\u017a","i\u015b\u0107"],["idz","isc"],["przejd\u017a","przej\u015b\u0107"],["przejdz","przejsc"],["wywo\u0142aj","wywo\u0142ywa\u0107"],["wywolaj","wywolywac"],["wy\u015blij","wysy\u0142a\u0107"],["wyslij","wysylac"],["loguj","logowa\u0107"],["wypisz","wypisywa\u0107"],["sklonuj","sklonowa\u0107"],["kopiuj","kopiowa\u0107"],["zamie\u0144","zamienia\u0107"],["zamien","zamieniac"],["utw\u00f3rz","tworzy\u0107"],["utworz","tworzyc"],["stw\u00f3rz","stwarza\u0107"],["stworz","stwarzac"],["skup","skupia\u0107"],["rozmyj","rozmywa\u0107"],["nawiguj","nawigowa\u0107"],["za\u0142aduj","\u0142adowa\u0107"],["zaladuj","ladowac"],["powt\u00f3rz","powtarza\u0107"],["powtorz","powtarzac"],["kontynuuj","kontynuowa\u0107"],["zatrzymaj","zatrzymywa\u0107"],["przerwij","przerywa\u0107"],["rzu\u0107","rzuca\u0107"],["rzuc","rzucac"],["zwr\u00f3\u0107","zwraca\u0107"],["zwroc","zwracac"],["inicjuj","inicjowa\u0107"],["zainstaluj","instalowa\u0107"],["zmierz","mierzy\u0107"]]),new(ez=class{constructor(){this.language="pl"}isNormalizable(e){return e.length>=3&&/[a-zA-Z\u0105\u0119\u0107\u0144\u00f3\u015b\u017a\u017c\u0142\u0104\u0118\u0106\u0143\u00d3\u015a\u0179\u017b\u0141]/.test(e)}normalize(e){const t=e.toLowerCase();if(this.isInfinitive(t))return yd(t);const r=this.tryImperativeNormalization(t);if(r)return r;const n=this.tryPastTenseNormalization(t);if(n)return n;const i=this.tryPresentTenseNormalization(t);return i||yd(t)}isInfinitive(e){return["a\u0107","e\u0107","i\u0107","y\u0107","\u0105\u0107","owa\u0107","iwa\u0107","ywa\u0107"].some(t=>e.endsWith(t))}tryImperativeNormalization(e){return Qb.has(e)?vd(Qb.get(e),.95,{removedSuffixes:["imperative"],conjugationType:"imperative"}):e.endsWith("aj")?vd(e.slice(0,-2)+"a\u0107",.8,{removedSuffixes:["aj"],conjugationType:"imperative"}):e.endsWith("uj")?vd(e.slice(0,-2)+"owa\u0107",.8,{removedSuffixes:["uj"],conjugationType:"imperative"}):e.endsWith("ij")?vd(e.slice(0,-2)+"i\u0107",.75,{removedSuffixes:["ij"],conjugationType:"imperative"}):null}tryPresentTenseNormalization(e){return e.endsWith("uj\u0119")||e.endsWith("uje")?vd(e.slice(0,-3)+"owa\u0107",.85,{removedSuffixes:["uj\u0119"],conjugationType:"present"}):e.endsWith("am")&&e.length>3?vd(e.slice(0,-2)+"a\u0107",.8,{removedSuffixes:["am"],conjugationType:"present"}):e.endsWith("em")&&e.length>3?vd(e.slice(0,-2)+"e\u0107",.75,{removedSuffixes:["em"],conjugationType:"present"}):e.endsWith("\u0119")&&e.length>2?vd(e.slice(0,-1)+"a\u0107",.7,{removedSuffixes:["\u0119"],conjugationType:"present"}):null}tryPastTenseNormalization(e){if(e.endsWith("a\u0142em")||e.endsWith("a\u0142am"))return vd(e.slice(0,-4)+"a\u0107",.85,{removedSuffixes:[e.slice(-4)],conjugationType:"past"});if(e.endsWith("a\u0142")||e.endsWith("a\u0142a")){const t=e.endsWith("a\u0142a")?3:2;return vd(e.slice(0,-t)+"a\u0107",.8,{removedSuffixes:[e.slice(-t)],conjugationType:"past"})}if(e.endsWith("i\u0142em")||e.endsWith("i\u0142am")||e.endsWith("ilem")||e.endsWith("ilam"))return vd(e.slice(0,-4)+"i\u0107",.85,{removedSuffixes:[e.slice(-4)],conjugationType:"past"});if(e.endsWith("i\u0142")||e.endsWith("i\u0142a")||e.endsWith("il")||e.endsWith("ila")){const t=e.endsWith("i\u0142a")||e.endsWith("ila")?3:2;return vd(e.slice(0,-t)+"i\u0107",.8,{removedSuffixes:[e.slice(-t)],conjugationType:"past"})}return null}})}}),sz={};Ad(sz,{PolishTokenizer:()=>nz,polishTokenizer:()=>iz});var lz,cz,uz=Cd({"src/tokenizers/polish.ts"(){fy(),zh(),oz(),yy(),Ng(),Xv(),tz=new Set(["do","od","z","ze","w","we","na","po","pod","przed","za","nad","mi\u0119dzy","miedzy","przez","dla","bez","o","przy","u","wed\u0142ug","wedlug","mimo","w\u015br\u00f3d","wsrod","obok","poza","wok\u00f3\u0142","wokol","przeciw","ku"]),rz=[{native:"prawda",normalized:"true"},{native:"fa\u0142sz",normalized:"false"},{native:"falsz",normalized:"false"},{native:"null",normalized:"null"},{native:"nieokre\u015blony",normalized:"undefined"},{native:"nieokreslony",normalized:"undefined"},{native:"pierwszy",normalized:"first"},{native:"pierwsza",normalized:"first"},{native:"pierwsze",normalized:"first"},{native:"ostatni",normalized:"last"},{native:"ostatnia",normalized:"last"},{native:"ostatnie",normalized:"last"},{native:"nast\u0119pny",normalized:"next"},{native:"nastepny",normalized:"next"},{native:"poprzedni",normalized:"previous"},{native:"najbli\u017cszy",normalized:"closest"},{native:"najblizszy",normalized:"closest"},{native:"rodzic",normalized:"parent"},{native:"klikni\u0119cie",normalized:"click"},{native:"klikniecie",normalized:"click"},{native:"klik",normalized:"click"},{native:"click",normalized:"click"},{native:"zmiana",normalized:"change"},{native:"wys\u0142anie",normalized:"submit"},{native:"wyslanie",normalized:"submit"},{native:"naci\u015bni\u0119cie",normalized:"keydown"},{native:"nacisniecie",normalized:"keydown"},{native:"klawisz",normalized:"keydown"},{native:"najechanie",normalized:"mouseover"},{native:"zjechanie",normalized:"mouseout"},{native:"rozmycie",normalized:"blur"},{native:"za\u0142adowanie",normalized:"load"},{native:"zaladowanie",normalized:"load"},{native:"przewini\u0119cie",normalized:"scroll"},{native:"przewiniecie",normalized:"scroll"},{native:"input",normalized:"input"},{native:"m\u00f3j",normalized:"my"},{native:"moj",normalized:"my"},{native:"sekunda",normalized:"s"},{native:"sekundy",normalized:"s"},{native:"sekund",normalized:"s"},{native:"milisekunda",normalized:"ms"},{native:"milisekundy",normalized:"ms"},{native:"milisekund",normalized:"ms"},{native:"minuta",normalized:"m"},{native:"minuty",normalized:"m"},{native:"minut",normalized:"m"},{native:"godzina",normalized:"h"},{native:"godziny",normalized:"h"},{native:"godzin",normalized:"h"},{native:"po\u0142\u00f3\u017c",normalized:"put"},{native:"poloz",normalized:"put"},{native:"lub",normalized:"or"},{native:"nie",normalized:"not"},{native:"jest",normalized:"is"},{native:"istnieje",normalized:"exists"},{native:"pusty",normalized:"empty"},{native:"puste",normalized:"empty"},{native:"w\u0142\u0105cznie",normalized:"inclusive"},{native:"wy\u0142\u0105cznie",normalized:"exclusive"},{native:"znaki",normalized:"characters"},{native:"losowy",normalized:"random"}],iz=new(nz=class extends ud{constructor(){super(),this.language="pl",this.direction="ltr",this.initializeKeywordsFromProfile(gh,rz),this.setNormalizer(new ez),this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractors([new Kv]),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){const t=e.toLowerCase();return tz.has(t)?"particle":this.isKeyword(t)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":["==","!=","<=",">=","<",">","&&","||","!"].includes(e)?"operator":e.startsWith("/")||e.startsWith("./")||e.startsWith("http")?"url":"identifier"}})}});function pz(e){return/[\u0430-\u044f\u0410-\u042f\u0451\u0401]/.test(e)}var dz,mz,fz,hz,yz=Cd({"src/tokenizers/morphology/russian-normalizer.ts"(){Hg(),lz=new Map([["\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438","\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c"],["\u0434\u043e\u0431\u0430\u0432\u044c","\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c"],["\u0443\u0434\u0430\u043b\u0438","\u0443\u0434\u0430\u043b\u0438\u0442\u044c"],["\u0443\u0431\u0435\u0440\u0438","\u0443\u0431\u0440\u0430\u0442\u044c"],["\u043f\u043e\u043b\u043e\u0436\u0438","\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c"],["\u043f\u043e\u043c\u0435\u0441\u0442\u0438","\u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c"],["\u0432\u0441\u0442\u0430\u0432\u044c","\u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c"],["\u0432\u043e\u0437\u044c\u043c\u0438","\u0432\u0437\u044f\u0442\u044c"],["\u0441\u043e\u0437\u0434\u0430\u0439","\u0441\u043e\u0437\u0434\u0430\u0442\u044c"],["\u043a\u043b\u043e\u043d\u0438\u0440\u0443\u0439","\u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c"],["\u043f\u043e\u043c\u0435\u043d\u044f\u0439","\u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c"],["\u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0439","\u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c"],["\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438","\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c"],["\u0437\u0430\u0434\u0430\u0439","\u0437\u0430\u0434\u0430\u0442\u044c"],["\u043f\u043e\u043b\u0443\u0447\u0438","\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c"],["\u0443\u0432\u0435\u043b\u0438\u0447\u044c","\u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c"],["\u0443\u043c\u0435\u043d\u044c\u0448\u0438","\u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c"],["\u0437\u0430\u043f\u0438\u0448\u0438","\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c"],["\u043f\u043e\u043a\u0430\u0436\u0438","\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c"],["\u0441\u043a\u0440\u043e\u0439","\u0441\u043a\u0440\u044b\u0442\u044c"],["\u0441\u043f\u0440\u044f\u0447\u044c","\u0441\u043f\u0440\u044f\u0442\u0430\u0442\u044c"],["\u0430\u043d\u0438\u043c\u0438\u0440\u0443\u0439","\u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c"],["\u0432\u044b\u0437\u043e\u0432\u0438","\u0432\u044b\u0437\u0432\u0430\u0442\u044c"],["\u043e\u0442\u043f\u0440\u0430\u0432\u044c","\u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c"],["\u0441\u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u0439","\u0441\u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c"],["\u0440\u0430\u0437\u043c\u043e\u0439","\u0440\u0430\u0437\u043c\u044b\u0442\u044c"],["\u043f\u0435\u0440\u0435\u0439\u0434\u0438","\u043f\u0435\u0440\u0435\u0439\u0442\u0438"],["\u0438\u0434\u0438","\u0438\u0434\u0442\u0438"],["\u0436\u0434\u0438","\u0436\u0434\u0430\u0442\u044c"],["\u043f\u043e\u0434\u043e\u0436\u0434\u0438","\u043f\u043e\u0434\u043e\u0436\u0434\u0430\u0442\u044c"],["\u0437\u0430\u0433\u0440\u0443\u0437\u0438","\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c"],["\u043f\u043e\u0432\u0442\u043e\u0440\u0438","\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"],["\u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438","\u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c"],["\u0431\u0440\u043e\u0441\u044c","\u0431\u0440\u043e\u0441\u0438\u0442\u044c"],["\u0432\u0435\u0440\u043d\u0438","\u0432\u0435\u0440\u043d\u0443\u0442\u044c"],["\u0441\u043a\u0430\u0436\u0438","\u0441\u043a\u0430\u0437\u0430\u0442\u044c"],["\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0439","\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c"],["\u0438\u0437\u043c\u0435\u0440\u044c","\u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c"]]),new(cz=class{constructor(){this.language="ru"}isNormalizable(e){return e.length>=3&&function(e){for(const t of e)if(pz(t))return!0;return!1}(e)}normalize(e){const t=e.toLowerCase();if(t.endsWith("\u0441\u044f")||t.endsWith("\u0441\u044c")){const e=this.tryReflexiveNormalization(t);if(e)return e}if(t.endsWith("\u0442\u044c")||t.endsWith("\u0442\u0438")||t.endsWith("\u0447\u044c"))return yd(e);const r=this.tryImperativeLookup(t);if(r)return r;const n=this.tryPastTenseNormalization(t);if(n)return n;const i=this.tryPresentTenseNormalization(t);if(i)return i;const a=this.tryGenericImperativeNormalization(t);return a||yd(e)}tryReflexiveNormalization(e){e.endsWith("\u0441\u044f");const t=e.slice(0,-2);if(e.endsWith("\u0442\u044c\u0441\u044f")||e.endsWith("\u0442\u0438\u0441\u044c")||e.endsWith("\u0447\u044c\u0441\u044f"))return yd(e);const r=this.normalizeNonReflexive(t);if(1>r.confidence){return vd(r.stem.endsWith("\u0442\u044c")?r.stem.slice(0,-2)+"\u0442\u044c\u0441\u044f":r.stem+"\u0441\u044f",.95*r.confidence,{removedSuffixes:["\u0441\u044f",...r.metadata?.removedSuffixes||[]],conjugationType:"reflexive"})}return null}normalizeNonReflexive(e){if(e.endsWith("\u0442\u044c")||e.endsWith("\u0442\u0438")||e.endsWith("\u0447\u044c"))return yd(e);const t=this.tryImperativeLookup(e);if(t)return t;const r=this.tryPastTenseNormalization(e);if(r)return r;const n=this.tryPresentTenseNormalization(e);if(n)return n;const i=this.tryGenericImperativeNormalization(e);return i||yd(e)}tryImperativeLookup(e){return lz.has(e)?vd(lz.get(e),.95,{removedSuffixes:["imperative"],conjugationType:"imperative"}):null}tryGenericImperativeNormalization(e){return e.endsWith("\u0439\u0442\u0435")&&e.length>5?vd(e.slice(0,-3)+"\u0442\u044c",.8,{removedSuffixes:["\u0439\u0442\u0435"],conjugationType:"imperative"}):e.endsWith("\u0438\u0442\u0435")&&e.length>5?vd(e.slice(0,-3)+"\u0438\u0442\u044c",.8,{removedSuffixes:["\u0438\u0442\u0435"],conjugationType:"imperative"}):e.endsWith("\u0439")&&e.length>3?vd(e.slice(0,-1)+"\u0442\u044c",.75,{removedSuffixes:["\u0439"],conjugationType:"imperative"}):e.endsWith("\u0438")&&e.length>3?vd(e+"\u0442\u044c",.7,{removedSuffixes:["\u0438\u2192\u0438\u0442\u044c"],conjugationType:"imperative"}):null}tryPastTenseNormalization(e){return e.endsWith("\u0430\u043b\u0430")&&e.length>4?vd(e.slice(0,-3)+"\u0430\u0442\u044c",.85,{removedSuffixes:["\u0430\u043b\u0430"],conjugationType:"past"}):e.endsWith("\u0438\u043b\u0430")&&e.length>4?vd(e.slice(0,-3)+"\u0438\u0442\u044c",.85,{removedSuffixes:["\u0438\u043b\u0430"],conjugationType:"past"}):e.endsWith("\u0435\u043b\u043e")&&e.length>4?vd(e.slice(0,-3)+"\u0435\u0442\u044c",.82,{removedSuffixes:["\u0435\u043b\u043e"],conjugationType:"past"}):e.endsWith("\u0430\u0431\u043e")&&e.length>4?vd(e.slice(0,-3)+"\u0430\u0442\u044c",.82,{removedSuffixes:["\u0430\u0431\u043e"],conjugationType:"past"}):e.endsWith("\u0430\u043b\u0438")&&e.length>4?vd(e.slice(0,-3)+"\u0430\u0442\u044c",.85,{removedSuffixes:["\u0430\u043b\u0438"],conjugationType:"past"}):e.endsWith("\u0438\u043b\u0438")&&e.length>4?vd(e.slice(0,-3)+"\u0438\u0442\u044c",.85,{removedSuffixes:["\u0438\u043b\u0438"],conjugationType:"past"}):e.endsWith("\u0430\u043b")&&e.length>3?vd(e.slice(0,-2)+"\u0430\u0442\u044c",.82,{removedSuffixes:["\u0430\u043b"],conjugationType:"past"}):e.endsWith("\u0438\u043b")&&e.length>3?vd(e.slice(0,-2)+"\u0438\u0442\u044c",.82,{removedSuffixes:["\u0438\u043b"],conjugationType:"past"}):null}tryPresentTenseNormalization(e){return e.endsWith("\u0438\u0448\u044c")&&e.length>4?vd(e.slice(0,-3)+"\u0438\u0442\u044c",.8,{removedSuffixes:["\u0438\u0448\u044c"],conjugationType:"present"}):e.endsWith("\u0438\u0442")&&e.length>3?vd(e.slice(0,-2)+"\u0438\u0442\u044c",.78,{removedSuffixes:["\u0438\u0442"],conjugationType:"present"}):e.endsWith("\u0438\u043c")&&e.length>3?vd(e.slice(0,-2)+"\u0438\u0442\u044c",.78,{removedSuffixes:["\u0438\u043c"],conjugationType:"present"}):e.endsWith("\u044f\u0442")&&e.length>3?vd(e.slice(0,-2)+"\u0438\u0442\u044c",.78,{removedSuffixes:["\u044f\u0442"],conjugationType:"present"}):e.endsWith("\u0435\u0448\u044c")&&e.length>4?vd(e.slice(0,-3)+"\u0430\u0442\u044c",.75,{removedSuffixes:["\u0435\u0448\u044c"],conjugationType:"present"}):e.endsWith("\u0435\u0442")&&e.length>3?vd(e.slice(0,-2)+"\u0430\u0442\u044c",.72,{removedSuffixes:["\u0435\u0442"],conjugationType:"present"}):e.endsWith("\u0435\u043c")&&e.length>3?vd(e.slice(0,-2)+"\u0430\u0442\u044c",.72,{removedSuffixes:["\u0435\u043c"],conjugationType:"present"}):e.endsWith("\u044e\u0442")&&e.length>3?vd(e.slice(0,-2)+"\u0430\u0442\u044c",.75,{removedSuffixes:["\u044e\u0442"],conjugationType:"present"}):e.endsWith("\u0443\u0442")&&e.length>3?vd(e.slice(0,-2)+"\u0430\u0442\u044c",.72,{removedSuffixes:["\u0443\u0442"],conjugationType:"present"}):null}})}}),vz={};Ad(vz,{RussianTokenizer:()=>fz,russianTokenizer:()=>hz});var gz,kz,wz=Cd({"src/tokenizers/russian.ts"(){fy(),yz(),Ph(),yy(),Ng(),kv(),Lg(),dz=new Set(["\u0432","\u0432\u043e","\u043d\u0430","\u0441","\u0441\u043e","\u043a","\u043a\u043e","\u043e","\u043e\u0431","\u043e\u0431\u043e","\u0443","\u043e\u0442","\u0434\u043e","\u0438\u0437","\u0437\u0430","\u043f\u043e","\u043f\u043e\u0434","\u043d\u0430\u0434","\u043f\u0435\u0440\u0435\u0434","\u043f\u0435\u0440\u0435\u0434\u043e","\u043c\u0435\u0436\u0434\u0443","\u0447\u0435\u0440\u0435\u0437","\u0431\u0435\u0437","\u0434\u043b\u044f","\u043f\u0440\u0438","\u043f\u0440\u043e","\u043f\u043e\u0441\u043b\u0435","\u0432\u043e\u043a\u0440\u0443\u0433","\u043f\u0440\u043e\u0442\u0438\u0432","\u0432\u043c\u0435\u0441\u0442\u043e","\u043a\u0440\u043e\u043c\u0435","\u0441\u0440\u0435\u0434\u0438"]),mz=[{native:"\u043c\u044b\u0448\u044c\u0432\u043d\u0438\u0437",normalized:"mousedown"},{native:"\u043c\u044b\u0448\u044c\u0432\u0432\u0435\u0440\u0445",normalized:"mouseup"},{native:"\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u0440\u0430\u0437\u043c\u0435\u0440\u0430",normalized:"resize"},{native:"\u0438\u0441\u0442\u0438\u043d\u0430",normalized:"true"},{native:"\u043f\u0440\u0430\u0432\u0434\u0430",normalized:"true"},{native:"\u043b\u043e\u0436\u044c",normalized:"false"},{native:"null",normalized:"null"},{native:"\u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e",normalized:"undefined"},{native:"\u043d\u0438\u0447\u0435\u0433\u043e",normalized:"null"},{native:"\u0441\u0435\u043a\u0443\u043d\u0434\u0430",normalized:"s"},{native:"\u0441\u0435\u043a\u0443\u043d\u0434\u044b",normalized:"s"},{native:"\u0441\u0435\u043a\u0443\u043d\u0434",normalized:"s"},{native:"\u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u0430",normalized:"ms"},{native:"\u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b",normalized:"ms"},{native:"\u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434",normalized:"ms"},{native:"\u043c\u0438\u043d\u0443\u0442\u0430",normalized:"m"},{native:"\u043c\u0438\u043d\u0443\u0442\u044b",normalized:"m"},{native:"\u043c\u0438\u043d\u0443\u0442",normalized:"m"},{native:"\u0447\u0430\u0441",normalized:"h"},{native:"\u0447\u0430\u0441\u0430",normalized:"h"},{native:"\u0447\u0430\u0441\u043e\u0432",normalized:"h"},{native:"\u043f\u0435\u0440\u0432\u044b\u0439",normalized:"first"},{native:"\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439",normalized:"last"},{native:"\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439",normalized:"next"},{native:"\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439",normalized:"previous"},{native:"\u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439",normalized:"closest"},{native:"\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c",normalized:"parent"},{native:"\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439",normalized:"random"},{native:"\u043f\u0435\u0440\u0432\u0430\u044f",normalized:"first"},{native:"\u043f\u0435\u0440\u0432\u043e\u0435",normalized:"first"},{native:"\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f",normalized:"last"},{native:"\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435",normalized:"last"},{native:"\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f",normalized:"next"},{native:"\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f",normalized:"previous"},{native:"\u043f\u0443\u0441\u0442\u0430\u044f",normalized:"empty"},{native:"\u043f\u0443\u0441\u0442\u043e\u0435",normalized:"empty"},{native:"\u043c\u043e\u044f",normalized:"my"},{native:"\u043c\u043e\u0451",normalized:"my"},{native:"\u043c\u043e\u0438",normalized:"my"},{native:"\u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e",normalized:"inclusive"},{native:"\u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e",normalized:"exclusive"},{native:"\u0441\u0438\u043c\u0432\u043e\u043b\u044b",normalized:"characters"}],hz=new(fz=class extends ud{constructor(){super(),this.language="ru",this.direction="ltr",this.initializeKeywordsFromProfile(Ch,mz),this.setNormalizer(new cz),this.registerExtractors([...Pg(),new pv("russian-keyword",/[a-zA-Z\u0430-\u044f\u0410-\u042f\u0451\u0401]/,dv),new Ou,new Nu,new Sg,new ly,new cy])}classifyToken(e){const t=e.toLowerCase();return dz.has(t)?"particle":this.isKeyword(t)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":e.startsWith("/")||e.startsWith("./")||e.startsWith("http")?"url":"identifier"}})}});var bz,zz,xz,Ez,Tz=Cd({"src/tokenizers/morphology/ukrainian-normalizer.ts"(){Hg(),gz=new Map([["\u043f\u0435\u0440\u0435\u043c\u043a\u043d\u0438","\u043f\u0435\u0440\u0435\u043c\u043a\u043d\u0443\u0442\u0438"],["\u0434\u043e\u0434\u0430\u0439","\u0434\u043e\u0434\u0430\u0442\u0438"],["\u0432\u0438\u0434\u0430\u043b\u0438","\u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438"],["\u043f\u0440\u0438\u0431\u0435\u0440\u0438","\u043f\u0440\u0438\u0431\u0440\u0430\u0442\u0438"],["\u043f\u043e\u043a\u043b\u0430\u0434\u0438","\u043f\u043e\u043a\u043b\u0430\u0441\u0442\u0438"],["\u043f\u043e\u043c\u0456\u0441\u0442\u0438","\u043f\u043e\u043c\u0456\u0441\u0442\u0438\u0442\u0438"],["\u0432\u0441\u0442\u0430\u0432","\u0432\u0441\u0442\u0430\u0432\u0438\u0442\u0438"],["\u0432\u0456\u0437\u044c\u043c\u0438","\u0432\u0437\u044f\u0442\u0438"],["\u0441\u0442\u0432\u043e\u0440\u0438","\u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438"],["\u043a\u043b\u043e\u043d\u0443\u0439","\u043a\u043b\u043e\u043d\u0443\u0432\u0430\u0442\u0438"],["\u043f\u043e\u043c\u0456\u043d\u044f\u0439","\u043f\u043e\u043c\u0456\u043d\u044f\u0442\u0438"],["\u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0443\u0439","\u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0443\u0432\u0430\u0442\u0438"],["\u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438","\u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0438"],["\u0437\u0430\u0434\u0430\u0439","\u0437\u0430\u0434\u0430\u0442\u0438"],["\u043e\u0442\u0440\u0438\u043c\u0430\u0439","\u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438"],["\u0437\u0431\u0456\u043b\u044c\u0448","\u0437\u0431\u0456\u043b\u044c\u0448\u0438\u0442\u0438"],["\u0437\u043c\u0435\u043d\u0448","\u0437\u043c\u0435\u043d\u0448\u0438\u0442\u0438"],["\u0437\u0430\u043f\u0438\u0448\u0438","\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u0438"],["\u043f\u043e\u043a\u0430\u0436\u0438","\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0438"],["\u0441\u0445\u043e\u0432\u0430\u0439","\u0441\u0445\u043e\u0432\u0430\u0442\u0438"],["\u043f\u0440\u0438\u0445\u043e\u0432\u0430\u0439","\u043f\u0440\u0438\u0445\u043e\u0432\u0430\u0442\u0438"],["\u0430\u043d\u0456\u043c\u0443\u0439","\u0430\u043d\u0456\u043c\u0443\u0432\u0430\u0442\u0438"],["\u0432\u0438\u043a\u043b\u0438\u0447","\u0432\u0438\u043a\u043b\u0438\u043a\u0430\u0442\u0438"],["\u043d\u0430\u0434\u0456\u0448\u043b\u0438","\u043d\u0430\u0434\u0456\u0441\u043b\u0430\u0442\u0438"],["\u0441\u0444\u043e\u043a\u0443\u0441\u0443\u0439","\u0441\u0444\u043e\u043a\u0443\u0441\u0443\u0432\u0430\u0442\u0438"],["\u0440\u043e\u0437\u0444\u043e\u043a\u0443\u0441\u0443\u0439","\u0440\u043e\u0437\u0444\u043e\u043a\u0443\u0441\u0443\u0432\u0430\u0442\u0438"],["\u043f\u0435\u0440\u0435\u0439\u0434\u0438","\u043f\u0435\u0440\u0435\u0439\u0442\u0438"],["\u0439\u0434\u0438","\u0439\u0442\u0438"],["\u0447\u0435\u043a\u0430\u0439","\u0447\u0435\u043a\u0430\u0442\u0438"],["\u0437\u0430\u0447\u0435\u043a\u0430\u0439","\u0437\u0430\u0447\u0435\u043a\u0430\u0442\u0438"],["\u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436","\u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438"],["\u043f\u043e\u0432\u0442\u043e\u0440\u0438","\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0438"],["\u043f\u0440\u043e\u0434\u043e\u0432\u0436\u0443\u0439","\u043f\u0440\u043e\u0434\u043e\u0432\u0436\u0438\u0442\u0438"],["\u043a\u0438\u043d\u044c","\u043a\u0438\u043d\u0443\u0442\u0438"],["\u043f\u043e\u0432\u0435\u0440\u043d\u0438","\u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u0438"],["\u0441\u043a\u0430\u0436\u0438","\u0441\u043a\u0430\u0437\u0430\u0442\u0438"],["\u0456\u043d\u0456\u0446\u0456\u0430\u043b\u0456\u0437\u0443\u0439","\u0456\u043d\u0456\u0446\u0456\u0430\u043b\u0456\u0437\u0443\u0432\u0430\u0442\u0438"],["\u0432\u0438\u043c\u0456\u0440\u044f\u0439","\u0432\u0438\u043c\u0456\u0440\u044f\u0442\u0438"]]),new(kz=class{constructor(){this.language="uk"}isNormalizable(e){return e.length>=3&&function(e){return/[\u0430-\u044f\u0410-\u042f\u0456\u0406\u0457\u0407\u0454\u0404\u0491\u0490\u044c\u042c']/.test(e)}(e)}normalize(e){const t=e.toLowerCase();if(t.endsWith("\u0441\u044f")||t.endsWith("\u0441\u044c")){const e=this.tryReflexiveNormalization(t);if(e)return e}if(t.endsWith("\u0442\u0438")||t.endsWith("\u0447\u0438"))return yd(e);const r=this.tryImperativeLookup(t);if(r)return r;const n=this.tryPastTenseNormalization(t);if(n)return n;const i=this.tryPresentTenseNormalization(t);if(i)return i;const a=this.tryGenericImperativeNormalization(t);return a||yd(e)}tryReflexiveNormalization(e){const t=e.slice(0,-2);if(e.endsWith("\u0442\u0438\u0441\u044f")||e.endsWith("\u0447\u0438\u0441\u044f"))return yd(e);const r=this.normalizeNonReflexive(t);if(1>r.confidence){return vd(r.stem.endsWith("\u0442\u0438")?r.stem.slice(0,-2)+"\u0442\u0438\u0441\u044f":r.stem+"\u0441\u044f",.95*r.confidence,{removedSuffixes:["\u0441\u044f",...r.metadata?.removedSuffixes||[]],conjugationType:"reflexive"})}return null}normalizeNonReflexive(e){if(e.endsWith("\u0442\u0438")||e.endsWith("\u0447\u0438"))return yd(e);const t=this.tryImperativeLookup(e);if(t)return t;const r=this.tryPastTenseNormalization(e);if(r)return r;const n=this.tryPresentTenseNormalization(e);if(n)return n;const i=this.tryGenericImperativeNormalization(e);return i||yd(e)}tryImperativeLookup(e){return gz.has(e)?vd(gz.get(e),.95,{removedSuffixes:["imperative"],conjugationType:"imperative"}):null}tryGenericImperativeNormalization(e){return e.endsWith("\u0439\u0442\u0435")&&e.length>5?vd(e.slice(0,-3)+"\u0442\u0438",.8,{removedSuffixes:["\u0439\u0442\u0435"],conjugationType:"imperative"}):e.endsWith("\u0456\u0442\u044c")&&e.length>5?vd(e.slice(0,-3)+"\u0438\u0442\u0438",.8,{removedSuffixes:["\u0456\u0442\u044c"],conjugationType:"imperative"}):e.endsWith("\u0439")&&e.length>3?vd(e.slice(0,-1)+"\u0442\u0438",.75,{removedSuffixes:["\u0439"],conjugationType:"imperative"}):e.endsWith("\u0438")&&e.length>3?vd(e+"\u0442\u0438",.7,{removedSuffixes:["\u0438\u2192\u0438\u0442\u0438"],conjugationType:"imperative"}):null}tryPastTenseNormalization(e){return e.endsWith("\u0430\u043b\u0430")&&e.length>4?vd(e.slice(0,-3)+"\u0430\u0442\u0438",.85,{removedSuffixes:["\u0430\u043b\u0430"],conjugationType:"past"}):e.endsWith("\u0438\u043b\u0430")&&e.length>4?vd(e.slice(0,-3)+"\u0438\u0442\u0438",.85,{removedSuffixes:["\u0438\u043b\u0430"],conjugationType:"past"}):e.endsWith("\u0430\u043b\u0438")&&e.length>4?vd(e.slice(0,-3)+"\u0430\u0442\u0438",.85,{removedSuffixes:["\u0430\u043b\u0438"],conjugationType:"past"}):e.endsWith("\u0438\u043b\u0438")&&e.length>4?vd(e.slice(0,-3)+"\u0438\u0442\u0438",.85,{removedSuffixes:["\u0438\u043b\u0438"],conjugationType:"past"}):e.endsWith("\u0430\u0432")&&e.length>3?vd(e.slice(0,-2)+"\u0430\u0442\u0438",.82,{removedSuffixes:["\u0430\u0432"],conjugationType:"past"}):e.endsWith("\u0438\u0432")&&e.length>3?vd(e.slice(0,-2)+"\u0438\u0442\u0438",.82,{removedSuffixes:["\u0438\u0432"],conjugationType:"past"}):null}tryPresentTenseNormalization(e){return e.endsWith("\u0438\u0448")&&e.length>3?vd(e.slice(0,-2)+"\u0438\u0442\u0438",.8,{removedSuffixes:["\u0438\u0448"],conjugationType:"present"}):e.endsWith("\u0438\u0442\u044c")&&e.length>4?vd(e.slice(0,-3)+"\u0438\u0442\u0438",.78,{removedSuffixes:["\u0438\u0442\u044c"],conjugationType:"present"}):e.endsWith("\u0438\u043c\u043e")&&e.length>4?vd(e.slice(0,-3)+"\u0438\u0442\u0438",.8,{removedSuffixes:["\u0438\u043c\u043e"],conjugationType:"present"}):e.endsWith("\u044f\u0442\u044c")&&e.length>4?vd(e.slice(0,-3)+"\u0438\u0442\u0438",.78,{removedSuffixes:["\u044f\u0442\u044c"],conjugationType:"present"}):e.endsWith("\u0454\u0448")&&e.length>3?vd(e.slice(0,-2)+"\u0430\u0442\u0438",.78,{removedSuffixes:["\u0454\u0448"],conjugationType:"present"}):e.endsWith("\u0435\u0448")&&e.length>3?vd(e.slice(0,-2)+"\u0430\u0442\u0438",.75,{removedSuffixes:["\u0435\u0448"],conjugationType:"present"}):e.endsWith("\u0454")&&e.length>2?vd(e.slice(0,-1)+"\u0430\u0442\u0438",.72,{removedSuffixes:["\u0454"],conjugationType:"present"}):e.endsWith("\u0454\u043c\u043e")&&e.length>4?vd(e.slice(0,-3)+"\u0430\u0442\u0438",.8,{removedSuffixes:["\u0454\u043c\u043e"],conjugationType:"present"}):e.endsWith("\u044e\u0442\u044c")&&e.length>4?vd(e.slice(0,-3)+"\u0430\u0442\u0438",.78,{removedSuffixes:["\u044e\u0442\u044c"],conjugationType:"present"}):e.endsWith("\u0443\u0442\u044c")&&e.length>4?vd(e.slice(0,-3)+"\u0430\u0442\u0438",.75,{removedSuffixes:["\u0443\u0442\u044c"],conjugationType:"present"}):null}})}}),Sz={};Ad(Sz,{UkrainianTokenizer:()=>xz,ukrainianTokenizer:()=>Ez});var Cz,Az,Lz,jz,Pz=Cd({"src/tokenizers/ukrainian.ts"(){fy(),Tz(),Fh(),yy(),Ng(),kv(),Lg(),bz=new Set(["\u0432","\u0443","\u043d\u0430","\u0437","\u0456\u0437","\u0437\u0456","\u0434\u043e","\u0432\u0456\u0434","\u043e","\u043e\u0431","\u043f\u0440\u0438","\u0434\u043b\u044f","\u043f\u0456\u0434","\u043d\u0430\u0434","\u043f\u0435\u0440\u0435\u0434","\u043c\u0456\u0436","\u0447\u0435\u0440\u0435\u0437","\u0431\u0435\u0437","\u043f\u043e","\u0437\u0430","\u043f\u0440\u043e","\u043f\u0456\u0441\u043b\u044f","\u043d\u0430\u0432\u043a\u043e\u043b\u043e","\u043f\u0440\u043e\u0442\u0438","\u0437\u0430\u043c\u0456\u0441\u0442\u044c","\u043a\u0440\u0456\u043c","\u0441\u0435\u0440\u0435\u0434","\u043a"]),zz=[{native:"\u043c\u0438\u0448\u0430\u0432\u043d\u0438\u0437",normalized:"mousedown"},{native:"\u043c\u0438\u0448\u0430\u0432\u0433\u043e\u0440\u0443",normalized:"mouseup"},{native:"\u0437\u043c\u0456\u043d\u0430\u0440\u043e\u0437\u043c\u0456\u0440\u0443",normalized:"resize"},{native:"\u0456\u0441\u0442\u0438\u043d\u0430",normalized:"true"},{native:"\u043f\u0440\u0430\u0432\u0434\u0430",normalized:"true"},{native:"\u0445\u0438\u0431\u043d\u0456\u0441\u0442\u044c",normalized:"false"},{native:"null",normalized:"null"},{native:"\u043d\u0435\u0432\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043e",normalized:"undefined"},{native:"\u043d\u0456\u0447\u043e\u0433\u043e",normalized:"null"},{native:"\u0441\u0435\u043a\u0443\u043d\u0434\u0430",normalized:"s"},{native:"\u0441\u0435\u043a\u0443\u043d\u0434\u0438",normalized:"s"},{native:"\u0441\u0435\u043a\u0443\u043d\u0434",normalized:"s"},{native:"\u043c\u0456\u043b\u0456\u0441\u0435\u043a\u0443\u043d\u0434\u0430",normalized:"ms"},{native:"\u043c\u0456\u043b\u0456\u0441\u0435\u043a\u0443\u043d\u0434\u0438",normalized:"ms"},{native:"\u043c\u0456\u043b\u0456\u0441\u0435\u043a\u0443\u043d\u0434",normalized:"ms"},{native:"\u0445\u0432\u0438\u043b\u0438\u043d\u0430",normalized:"m"},{native:"\u0445\u0432\u0438\u043b\u0438\u043d\u0438",normalized:"m"},{native:"\u0445\u0432\u0438\u043b\u0438\u043d",normalized:"m"},{native:"\u0433\u043e\u0434\u0438\u043d\u0430",normalized:"h"},{native:"\u0433\u043e\u0434\u0438\u043d\u0438",normalized:"h"},{native:"\u0433\u043e\u0434\u0438\u043d",normalized:"h"},{native:"\u043f\u0435\u0440\u0448\u0438\u0439",normalized:"first"},{native:"\u043e\u0441\u0442\u0430\u043d\u043d\u0456\u0439",normalized:"last"},{native:"\u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0438\u0439",normalized:"next"},{native:"\u043f\u043e\u043f\u0435\u0440\u0435\u0434\u043d\u0456\u0439",normalized:"previous"},{native:"\u043d\u0430\u0439\u0431\u043b\u0438\u0436\u0447\u0438\u0439",normalized:"closest"},{native:"\u0431\u0430\u0442\u044c\u043a\u0456\u0432\u0441\u044c\u043a\u0438\u0439",normalized:"parent"},{native:"\u0432\u0438\u043f\u0430\u0434\u043a\u043e\u0432\u0438\u0439",normalized:"random"},{native:"\u043f\u0435\u0440\u0448\u0430",normalized:"first"},{native:"\u043f\u0435\u0440\u0448\u0435",normalized:"first"},{native:"\u043e\u0441\u0442\u0430\u043d\u043d\u044f",normalized:"last"},{native:"\u043e\u0441\u0442\u0430\u043d\u043d\u0454",normalized:"last"},{native:"\u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0430",normalized:"next"},{native:"\u043f\u043e\u043f\u0435\u0440\u0435\u0434\u043d\u044f",normalized:"previous"},{native:"\u043f\u043e\u0440\u043e\u0436\u043d\u044f",normalized:"empty"},{native:"\u043f\u043e\u0440\u043e\u0436\u043d\u0454",normalized:"empty"},{native:"\u043c\u043e\u044f",normalized:"my"},{native:"\u043c\u043e\u0454",normalized:"my"},{native:"\u043c\u043e\u0457",normalized:"my"},{native:"\u0432\u043a\u043b\u044e\u0447\u043d\u043e",normalized:"inclusive"},{native:"\u0432\u0438\u043a\u043b\u044e\u0447\u043d\u043e",normalized:"exclusive"},{native:"\u0441\u0438\u043c\u0432\u043e\u043b\u0438",normalized:"characters"}],Ez=new(xz=class extends ud{constructor(){super(),this.language="uk",this.direction="ltr",this.initializeKeywordsFromProfile(Dh,zz),this.setNormalizer(new kz),this.registerExtractors([...Pg(),new pv("ukrainian-keyword",/[a-zA-Z\u0430-\u044f\u0410-\u042f\u0456\u0406\u0457\u0407\u0454\u0404\u0491\u0490\u044c\u042c']/,mv),new Ou,new Nu,new Sg,new ly,new cy])}classifyToken(e){const t=e.toLowerCase();return bz.has(t)?"particle":this.isKeyword(t)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":e.startsWith("/")||e.startsWith("./")||e.startsWith("http")?"url":"identifier"}})}}),Oz={};Ad(Oz,{HebrewTokenizer:()=>Lz,hebrewTokenizer:()=>jz});var Nz,Rz,Mz=Cd({"src/tokenizers/he.ts"(){fy(),th(),yy(),Ng(),Tg(),Cg(),Lg(),Cz=new Set(["\u05e2\u05dc","\u05d0\u05ea","\u05d0\u05dc","\u05de\u05df","\u05e2\u05dd","\u05d1\u05ea\u05d5\u05da","\u05de\u05ea\u05d5\u05da","\u05dc\u05d9\u05d3","\u05d0\u05d7\u05e8\u05d9","\u05dc\u05e4\u05e0\u05d9","\u05d1\u05d9\u05df","\u05e2\u05d3","\u05e9\u05dc"]),Az=[{native:"\u05d0\u05de\u05ea",normalized:"true"},{native:"\u05e9\u05e7\u05e8",normalized:"false"},{native:"null",normalized:"null"},{native:"\u05e8\u05d9\u05e7",normalized:"null"},{native:"\u05dc\u05d0 \u05de\u05d5\u05d2\u05d3\u05e8",normalized:"undefined"},{native:"\u05e8\u05d0\u05e9\u05d5\u05df",normalized:"first"},{native:"\u05d0\u05d7\u05e8\u05d5\u05df",normalized:"last"},{native:"\u05d4\u05d1\u05d0",normalized:"next"},{native:"\u05d4\u05e7\u05d5\u05d3\u05dd",normalized:"previous"},{native:"\u05d4\u05e7\u05e8\u05d5\u05d1",normalized:"closest"},{native:"\u05d4\u05d5\u05e8\u05d4",normalized:"parent"},{native:"\u05dc\u05d7\u05d9\u05e6\u05d4",normalized:"click"},{native:"\u05e7\u05dc\u05d9\u05e7",normalized:"click"},{native:"\u05e7\u05dc\u05d8",normalized:"input"},{native:"\u05e9\u05d9\u05e0\u05d5\u05d9",normalized:"change"},{native:"\u05e9\u05dc\u05d9\u05d7\u05d4",normalized:"submit"},{native:"\u05de\u05d9\u05e7\u05d5\u05d3",normalized:"focus"},{native:"\u05d8\u05e9\u05d8\u05d5\u05e9",normalized:"blur"},{native:"\u05dc\u05d7\u05d9\u05e6\u05ea \u05de\u05e7\u05e9",normalized:"keydown"},{native:"\u05e9\u05d7\u05e8\u05d5\u05e8 \u05de\u05e7\u05e9",normalized:"keyup"},{native:"\u05de\u05e2\u05d1\u05e8 \u05e2\u05db\u05d1\u05e8",normalized:"mouseover"},{native:"\u05d9\u05e6\u05d9\u05d0\u05ea \u05e2\u05db\u05d1\u05e8",normalized:"mouseout"},{native:"load",normalized:"load"},{native:"resize",normalized:"resize"},{native:"scroll",normalized:"scroll"},{native:"keydown",normalized:"keydown"},{native:"keyup",normalized:"keyup"},{native:"mousedown",normalized:"mousedown"},{native:"mouseup",normalized:"mouseup"},{native:"\u05d8\u05e2\u05d9\u05e0\u05d4",normalized:"load"},{native:"\u05d2\u05dc\u05d9\u05dc\u05d4",normalized:"scroll"},{native:"\u05d4\u05d9\u05d0",normalized:"it"},{native:"\u05d4\u05d5\u05d0",normalized:"it"},{native:"\u05e9\u05e0\u05d9\u05d9\u05d4",normalized:"s"},{native:"\u05e9\u05e0\u05d9\u05d5\u05ea",normalized:"s"},{native:"\u05de\u05d9\u05dc\u05d9\u05e9\u05e0\u05d9\u05d9\u05d4",normalized:"ms"},{native:"\u05d3\u05e7\u05d4",normalized:"m"},{native:"\u05d3\u05e7\u05d5\u05ea",normalized:"m"},{native:"\u05e9\u05e2\u05d4",normalized:"h"},{native:"\u05e9\u05e2\u05d5\u05ea",normalized:"h"},{native:"\u05db\u05d5\u05dc\u05dc",normalized:"inclusive"},{native:"\u05d1\u05dc\u05e2\u05d3\u05d9",normalized:"exclusive"},{native:"\u05ea\u05d5\u05d5\u05d9\u05dd",normalized:"characters"},{native:"\u05d0\u05e7\u05e8\u05d0\u05d9",normalized:"random"}],jz=new(Lz=class extends ud{constructor(){super(),this.language="he",this.direction="rtl",this.initializeKeywordsFromProfile(Xf,Az),this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractor(new Sg),this.registerExtractor(new Eg),this.registerExtractors([new gg]),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){return Cz.has(e)?"particle":this.isKeyword(e)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":["==","!=","<=",">=","<",">","&&","||","!"].includes(e)?"operator":e.startsWith("/")||e.startsWith("./")||e.startsWith("http")?"url":"identifier"}})}});function Iz(e){return/[\u0900-\u097F\u0A8E-\u0A8F]/u.test(e)}var Wz,_z,qz,$z,Vz=Cd({"src/tokenizers/morphology/hindi-normalizer.ts"(){Hg(),Nz=[{suffix:" \u0930\u0939\u093e \u0939\u0948",replacement:"",confidence:.82,type:"progressive",minStemLength:1},{suffix:" \u0930\u0939\u0940 \u0939\u0948",replacement:"",confidence:.82,type:"progressive",minStemLength:1},{suffix:" \u0930\u0939\u0947 \u0939\u0948\u0902",replacement:"",confidence:.82,type:"progressive",minStemLength:1},{suffix:"\u0930\u0939\u093e",replacement:"",confidence:.82,type:"progressive",minStemLength:1},{suffix:"\u0930\u0939\u0940",replacement:"",confidence:.82,type:"progressive",minStemLength:1},{suffix:"\u0930\u0939\u0947",replacement:"",confidence:.82,type:"progressive",minStemLength:1},{suffix:"\u0942\u0902\u0917\u093e",replacement:"",confidence:.85,type:"future",minStemLength:1},{suffix:"\u0942\u0902\u0917\u0940",replacement:"",confidence:.85,type:"future",minStemLength:1},{suffix:"\u0947\u0917\u093e",replacement:"",confidence:.85,type:"future",minStemLength:1},{suffix:"\u0947\u0917\u0940",replacement:"",confidence:.85,type:"future",minStemLength:1},{suffix:"\u0947\u0902\u0917\u0947",replacement:"",confidence:.85,type:"future",minStemLength:1},{suffix:"\u0924\u093e \u0939\u0948",replacement:"",confidence:.85,type:"present",minStemLength:1},{suffix:"\u0924\u0940 \u0939\u0948",replacement:"",confidence:.85,type:"present",minStemLength:1},{suffix:"\u0924\u0947 \u0939\u0948\u0902",replacement:"",confidence:.85,type:"present",minStemLength:1},{suffix:"\u0924\u093e",replacement:"",confidence:.85,type:"present",minStemLength:1},{suffix:"\u0924\u0940",replacement:"",confidence:.85,type:"present",minStemLength:1},{suffix:"\u0924\u0947",replacement:"",confidence:.85,type:"present",minStemLength:1},{suffix:"\u0928\u093e",replacement:"",confidence:.9,type:"dictionary",minStemLength:1},{suffix:"\u093e\u092f\u093e",replacement:"",confidence:.82,type:"past",minStemLength:1},{suffix:"\u093e\u092f\u0940",replacement:"",confidence:.82,type:"past",minStemLength:1},{suffix:"\u093e\u092f\u0947",replacement:"",confidence:.82,type:"past",minStemLength:1},{suffix:"\u092f\u093e",replacement:"",confidence:.82,type:"past",minStemLength:1},{suffix:"\u093f\u092f\u0947",replacement:"",confidence:.85,type:"imperative",minStemLength:1},{suffix:"\u093f\u090f",replacement:"",confidence:.85,type:"imperative",minStemLength:1},{suffix:"\u0908",replacement:"",confidence:.82,type:"past",minStemLength:1},{suffix:"\u090f",replacement:"",confidence:.82,type:"past",minStemLength:1},{suffix:"\u0947\u0902",replacement:"",confidence:.85,type:"imperative",minStemLength:1},{suffix:"\u094b",replacement:"",confidence:.85,type:"imperative",minStemLength:1},{suffix:"\u093e",replacement:"",confidence:.82,type:"past",minStemLength:2},{suffix:"\u0940",replacement:"",confidence:.82,type:"past",minStemLength:2},{suffix:"\u0947",replacement:"",confidence:.82,type:"past",minStemLength:2}],new(Rz=class{constructor(){this.language="hi"}isNormalizable(e){return e.length>=2&&Iz(e)}normalize(e){const t=this.tryConjugationNormalization(e);return t||yd(e)}tryConjugationNormalization(e){for(const t of Nz)if(e.endsWith(t.suffix)){const r=Array.from(e),n=Array.from(t.suffix),i=r.slice(0,r.length-n.length),a=i.join("")+t.replacement;if((t.minStemLength??1)>i.length)continue;if(a.length>0&&!Iz(a))continue;return vd(a,t.confidence,{removedSuffixes:[t.suffix],conjugationType:t.type})}return null}})}}),Dz={};Ad(Dz,{HindiTokenizer:()=>qz,hindiTokenizer:()=>$z});var Bz,Hz,Kz=Cd({"src/tokenizers/hindi.ts"(){fy(),Vz(),ih(),yy(),Ng(),Tv(),Sv(),Lg(),Wz=new Set(["\u0915\u094b","\u092e\u0947\u0902","\u092a\u0930","\u0938\u0947","\u0915\u093e","\u0915\u0940","\u0915\u0947","\u0924\u0915","\u0928\u0947"]),_z=[{native:"\u092e\u093e\u0909\u0938\u0928\u0940\u091a\u0947",normalized:"mousedown"},{native:"\u092e\u093e\u0909\u0938\u090a\u092a\u0930",normalized:"mouseup"},{native:"\u0906\u0915\u093e\u0930_\u092c\u0926\u0932\u0947\u0902",normalized:"resize"},{native:"\u0938\u091a",normalized:"true"},{native:"\u0938\u0924\u094d\u092f",normalized:"true"},{native:"\u091d\u0942\u0920",normalized:"false"},{native:"\u0905\u0938\u0924\u094d\u092f",normalized:"false"},{native:"\u0916\u093e\u0932\u0940",normalized:"null"},{native:"\u0905\u092a\u0930\u093f\u092d\u093e\u0937\u093f\u0924",normalized:"undefined"},{native:"\u092a\u0939\u0932\u093e",normalized:"first"},{native:"\u0905\u0902\u0924\u093f\u092e",normalized:"last"},{native:"\u0905\u0917\u0932\u093e",normalized:"next"},{native:"\u092a\u093f\u091b\u0932\u093e",normalized:"previous"},{native:"\u0928\u093f\u0915\u091f\u0924\u092e",normalized:"closest"},{native:"\u092e\u0942\u0932",normalized:"parent"},{native:"\u0915\u094d\u0932\u093f\u0915",normalized:"click"},{native:"\u092a\u0930\u093f\u0935\u0930\u094d\u0924\u0928",normalized:"change"},{native:"\u091c\u092e\u093e",normalized:"submit"},{native:"\u0907\u0928\u092a\u0941\u091f",normalized:"input"},{native:"\u0932\u094b\u0921",normalized:"load"},{native:"\u0938\u094d\u0915\u094d\u0930\u0949\u0932",normalized:"scroll"},{native:"\u0915\u094b",normalized:"to"},{native:"\u0915\u0947 \u0938\u093e\u0925",normalized:"with"},{native:"\u0915\u0947_\u0930\u0942\u092a_\u092e\u0947\u0902",normalized:"as"},{native:"\u092f\u093e",normalized:"or"},{native:"\u092c\u0926\u0932\u0928\u0947 \u092a\u0930",normalized:"changes"},{native:"\u0905\u0915\u094d\u0937\u0930",normalized:"characters"},{native:"\u092f\u093e\u0926\u0943\u091a\u094d\u091b\u093f\u0915",normalized:"random"}],$z=new(qz=class extends ud{constructor(){super(),this.language="hi",this.direction="ltr",this.initializeKeywordsFromProfile(eh,_z),this.normalizer=new Rz,this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractor(new xv),this.registerExtractor(new gv),this.registerExtractor(new Sg),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){return Wz.has(e)?"particle":this.isKeyword(e)?"keyword":e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||e.startsWith("http")?"url":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":(e.startsWith(":"),"identifier")}})}});function Fz(e){return/[\u0980-\u09FF]/u.test(e)}var Uz,Gz,Zz,Yz,Xz=Cd({"src/tokenizers/morphology/bengali-normalizer.ts"(){Hg(),Bz=[{suffix:"\u099a\u09cd\u099b\u09c7 \u0986\u099b\u09c7",replacement:"",confidence:.82,type:"progressive",minStemLength:1},{suffix:"\u099a\u09cd\u099b \u0986\u099b\u09bf",replacement:"",confidence:.82,type:"progressive",minStemLength:1},{suffix:"\u099a\u09cd\u099b\u09c7\u09a8 \u0986\u099b\u09c7\u09a8",replacement:"",confidence:.82,type:"progressive",minStemLength:1},{suffix:"\u09c7\u099b\u09c7\u09a8",replacement:"",confidence:.85,type:"present",minStemLength:1},{suffix:"\u09c7\u099b\u09c7",replacement:"",confidence:.85,type:"present",minStemLength:1},{suffix:"\u09c7\u099b",replacement:"",confidence:.85,type:"present",minStemLength:1},{suffix:"\u09ac\u09c7\u09a8",replacement:"",confidence:.85,type:"future",minStemLength:1},{suffix:"\u09ac\u09c7",replacement:"",confidence:.85,type:"future",minStemLength:1},{suffix:"\u09ac\u09cb",replacement:"",confidence:.85,type:"future",minStemLength:1},{suffix:"\u09b2\u09c7\u09a8",replacement:"",confidence:.85,type:"past",minStemLength:1},{suffix:"\u09b2\u09cb",replacement:"",confidence:.85,type:"past",minStemLength:1},{suffix:"\u09b2",replacement:"",confidence:.85,type:"past",minStemLength:2},{suffix:"\u09c1\u09a8",replacement:"",confidence:.85,type:"imperative",minStemLength:1},{suffix:"\u09cb",replacement:"",confidence:.85,type:"imperative",minStemLength:1},{suffix:"\u099a\u09cd\u099b\u09c7",replacement:"",confidence:.82,type:"progressive",minStemLength:1},{suffix:"\u099a\u09cd\u099b",replacement:"",confidence:.82,type:"progressive",minStemLength:1},{suffix:"\u099a\u09cd\u099b\u09bf",replacement:"",confidence:.82,type:"progressive",minStemLength:1},{suffix:"\u09be",replacement:"",confidence:.9,type:"dictionary",minStemLength:1},{suffix:"\u09c7",replacement:"",confidence:.85,type:"present",minStemLength:2},{suffix:"\u09bf",replacement:"",confidence:.85,type:"present",minStemLength:2},{suffix:"\u09cb",replacement:"",confidence:.85,type:"present",minStemLength:2}],Hz=new class{constructor(){this.language="bn"}isNormalizable(e){return e.length>=2&&Fz(e)}normalize(e){const t=this.tryConjugationNormalization(e);return t||yd(e)}tryConjugationNormalization(e){for(const t of Bz)if(e.endsWith(t.suffix)){const r=Array.from(e),n=Array.from(t.suffix),i=r.slice(0,r.length-n.length),a=i.join("")+t.replacement;if((t.minStemLength??1)>i.length)continue;if(a.length>0&&!Fz(a))continue;return vd(a,t.confidence,{removedSuffixes:[t.suffix],conjugationType:t.type})}return null}}}}),Jz={};Ad(Jz,{BengaliTokenizer:()=>Zz,bengaliTokenizer:()=>Yz});var Qz,ex,tx,rx=Cd({"src/tokenizers/bengali.ts"(){fy(),Xz(),$f(),yy(),Ng(),Pv(),Ov(),Lg(),Uz=new Set(["\u0995\u09c7","\u09a4\u09c7","\u09a5\u09c7\u0995\u09c7","\u09b0","\u098f\u09b0","\u09a6\u09bf\u09af\u09bc\u09c7","\u099c\u09a8\u09cd\u09af","\u09aa\u09b0\u09cd\u09af\u09a8\u09cd\u09a4","\u098f","\u09ae\u09a7\u09cd\u09af\u09c7"]),Gz=[{native:"\u09b8\u09a4\u09cd\u09af",normalized:"true"},{native:"\u09ae\u09bf\u09a5\u09cd\u09af\u09be",normalized:"false"},{native:"\u09b6\u09c2\u09a8\u09cd\u09af",normalized:"null"},{native:"\u0985\u09a8\u09bf\u09b0\u09cd\u09a7\u09be\u09b0\u09bf\u09a4",normalized:"undefined"},{native:"\u09aa\u09cd\u09b0\u09a5\u09ae",normalized:"first"},{native:"\u09aa\u09b0\u09ac\u09b0\u09cd\u09a4\u09c0",normalized:"next"},{native:"\u0986\u0997\u09c7\u09b0",normalized:"previous"},{native:"\u09a8\u09bf\u0995\u099f\u09a4\u09ae",normalized:"closest"},{native:"\u09ae\u09c2\u09b2",normalized:"parent"},{native:"\u0995\u09cd\u09b2\u09bf\u0995",normalized:"click"},{native:"\u099c\u09ae\u09be",normalized:"submit"},{native:"\u0987\u09a8\u09aa\u09c1\u099f",normalized:"input"},{native:"\u09b2\u09cb\u09a1",normalized:"load"},{native:"\u09b8\u09cd\u0995\u09cd\u09b0\u09cb\u09b2",normalized:"scroll"},{native:"\u0995\u09c7",normalized:"to"},{native:"\u09b8\u09be\u09a5\u09c7",normalized:"with"},{native:"\u0985\u09a5\u09ac\u09be",normalized:"or"},{native:"\u0985\u09a8\u09cd\u09a4\u09b0\u09cd\u09ad\u09c1\u0995\u09cd\u09a4",normalized:"inclusive"},{native:"\u09ac\u09be\u09a6",normalized:"exclusive"},{native:"\u0985\u0995\u09cd\u09b7\u09b0",normalized:"characters"},{native:"\u098f\u09b2\u09cb\u09ae\u09c7\u09b2\u09cb",normalized:"random"}],Yz=new(Zz=class extends ud{constructor(){super(),this.language="bn",this.direction="ltr",this.initializeKeywordsFromProfile(If,Gz),this.setNormalizer(Hz),this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractor(new Lv),this.registerExtractor(new Ev),this.registerExtractor(new Sg),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){return Uz.has(e)?"particle":this.isKeyword(e)?"keyword":e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||e.startsWith("http")?"url":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":(e.startsWith(":"),"identifier")}})}}),nx={};Ad(nx,{ThaiTokenizer:()=>ex,thaiTokenizer:()=>tx});var ix,ax,ox,sx=Cd({"src/tokenizers/thai.ts"(){fy(),Wh(),yy(),Ng(),Iv(),Qz=[{native:"\u0e08\u0e23\u0e34\u0e07",normalized:"true"},{native:"\u0e40\u0e17\u0e47\u0e08",normalized:"false"},{native:"\u0e27\u0e48\u0e32\u0e07",normalized:"null"},{native:"\u0e44\u0e21\u0e48\u0e01\u0e33\u0e2b\u0e19\u0e14",normalized:"undefined"},{native:"\u0e41\u0e23\u0e01",normalized:"first"},{native:"\u0e2a\u0e38\u0e14\u0e17\u0e49\u0e32\u0e22",normalized:"last"},{native:"\u0e16\u0e31\u0e14\u0e44\u0e1b",normalized:"next"},{native:"\u0e01\u0e48\u0e2d\u0e19\u0e2b\u0e19\u0e49\u0e32",normalized:"previous"},{native:"\u0e43\u0e01\u0e25\u0e49\u0e2a\u0e38\u0e14",normalized:"closest"},{native:"\u0e15\u0e49\u0e19\u0e17\u0e32\u0e07",normalized:"parent"},{native:"\u0e04\u0e25\u0e34\u0e01",normalized:"click"},{native:"\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e41\u0e1b\u0e25\u0e07",normalized:"change"},{native:"\u0e2a\u0e48\u0e07",normalized:"submit"},{native:"\u0e2d\u0e34\u0e19\u0e1e\u0e38\u0e15",normalized:"input"},{native:"\u0e42\u0e2b\u0e25\u0e14",normalized:"load"},{native:"\u0e40\u0e25\u0e37\u0e48\u0e2d\u0e19",normalized:"scroll"},{native:"\u0e1b\u0e23\u0e31\u0e1a\u0e02\u0e19\u0e32\u0e14",normalized:"resize"},{native:"\u0e40\u0e27\u0e25\u0e32",normalized:"when"},{native:"\u0e44\u0e1b\u0e22\u0e31\u0e07",normalized:"to"},{native:"\u0e14\u0e49\u0e27\u0e22",normalized:"with"},{native:"\u0e41\u0e25\u0e30",normalized:"and"},{native:"\u0e23\u0e27\u0e21",normalized:"inclusive"},{native:"\u0e22\u0e01\u0e40\u0e27\u0e49\u0e19",normalized:"exclusive"},{native:"\u0e2d\u0e31\u0e01\u0e02\u0e23\u0e30",normalized:"characters"},{native:"\u0e2a\u0e38\u0e48\u0e21",normalized:"random"}],tx=new(ex=class extends ud{constructor(){super(),this.language="th",this.direction="ltr",this.initializeKeywordsFromProfile(Nh,Qz),this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractors([new jv]),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){return this.isKeyword(e)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith(".")||e.startsWith("#")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith(":")?"identifier":e.startsWith('"')||e.startsWith("'")||/^-?\d/.test(e)?"literal":e.startsWith("/")||e.startsWith("./")||e.startsWith("http")?"url":"identifier"}})}}),lx={};Ad(lx,{MalayTokenizer:()=>ax,malayTokenizer:()=>ox});var cx,ux,px,dx,mx,fx=Cd({"src/tokenizers/ms.ts"(){fy(),kh(),yy(),Ng(),$v(),ix=[{native:"benar",normalized:"true"},{native:"salah",normalized:"false"},{native:"kosong",normalized:"null"},{native:"tak_tentu",normalized:"undefined"},{native:"pertama",normalized:"first"},{native:"terakhir",normalized:"last"},{native:"seterusnya",normalized:"next"},{native:"sebelumnya",normalized:"previous"},{native:"terdekat",normalized:"closest"},{native:"induk",normalized:"parent"},{native:"klik",normalized:"click"},{native:"berubah",normalized:"change"},{native:"ubah",normalized:"change"},{native:"hantar",normalized:"submit"},{native:"input",normalized:"input"},{native:"masuk",normalized:"input"},{native:"muat",normalized:"load"},{native:"tatal",normalized:"scroll"},{native:"hover",normalized:"hover"},{native:"inklusif",normalized:"inclusive"},{native:"eksklusif",normalized:"exclusive"},{native:"aksara",normalized:"characters"},{native:"rawak",normalized:"random"}],ox=new(ax=class extends ud{constructor(){super(),this.language="ms",this.direction="ltr",this.initializeKeywordsFromProfile(hh,ix),this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractors([new Mv]),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){return this.isKeyword(e)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith(".")||e.startsWith("#")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith(":")?"identifier":e.startsWith('"')||e.startsWith("'")||/^-?\d/.test(e)?"literal":e.startsWith("/")||e.startsWith("./")||e.startsWith("http")?"url":"identifier"}})}});function hx(e){const t=e.charCodeAt(0);return t>=65&&90>=t||t>=97&&122>=t||("\u00f1"===e||"\u00d1"===e)}var yx,vx,gx,kx=Cd({"src/tokenizers/morphology/tagalog-normalizer.ts"(){Hg(),cx=[{pattern:"magpapa",confidencePenalty:.15,prefixType:"verb-marker",minRemaining:3},{pattern:"magpa",confidencePenalty:.15,prefixType:"verb-marker",minRemaining:3},{pattern:"ipang",confidencePenalty:.15,prefixType:"verb-marker",minRemaining:3},{pattern:"ipag",confidencePenalty:.15,prefixType:"verb-marker",minRemaining:3},{pattern:"nagpa",confidencePenalty:.15,prefixType:"verb-marker",minRemaining:3}],ux=[{pattern:"mag",confidencePenalty:.15,prefixType:"verb-marker",minRemaining:3},{pattern:"nag",confidencePenalty:.15,prefixType:"verb-marker",minRemaining:3},{pattern:"mang",confidencePenalty:.15,prefixType:"verb-marker",minRemaining:3},{pattern:"nang",confidencePenalty:.15,prefixType:"verb-marker",minRemaining:3},{pattern:"ma",confidencePenalty:.12,prefixType:"verb-marker",minRemaining:3},{pattern:"na",confidencePenalty:.12,prefixType:"verb-marker",minRemaining:3},{pattern:"i",confidencePenalty:.15,prefixType:"verb-marker",minRemaining:3},{pattern:"pa",confidencePenalty:.12,prefixType:"verb-marker",minRemaining:3}],px=["um","in"],dx=[{pattern:"hin",confidencePenalty:.18,type:"patient-focus"},{pattern:"in",confidencePenalty:.18,type:"patient-focus"},{pattern:"han",confidencePenalty:.18,type:"locative-focus"},{pattern:"an",confidencePenalty:.18,type:"locative-focus"}],mx=new class{constructor(){this.language="tl"}isNormalizable(e){return!!function(e){for(const t of e)if(hx(t))return!0;return!1}(e)&&2<=e.length}normalize(e){let t=e.toLowerCase(),r=1;const n=[],i=[],a=[];for(const e of cx)if(t.startsWith(e.pattern)){const i=t.slice(e.pattern.length);if(i.length>=(e.minRemaining??2)){t=i,r-=e.confidencePenalty,n.push(e.pattern),a.push("prefix:"+e.pattern);break}}if(0===n.length)for(const e of ux)if(t.startsWith(e.pattern)){const i=t.slice(e.pattern.length);if(i.length>=(e.minRemaining??2)){t=i,r-=e.confidencePenalty,n.push(e.pattern),a.push("prefix:"+e.pattern);break}}const o=function(e){const t=e.toLowerCase();if(4>t.length)return{stem:t,reduplicated:!1};const r=t[0],n=t[1];if(!"aeiou".includes(r)&&"aeiou".includes(n)){const e=t.slice(2);if(e.length>=2&&e[0]===r)return{stem:e,reduplicated:!0}}return{stem:t,reduplicated:!1}}(t);o.reduplicated&&o.stem.length>=2&&(t=o.stem,r-=.1,a.push("reduplication:CV"));const s=function(e){const t=e.toLowerCase();if(5>t.length)return null;let r=0;for(let e=0;t.length>e&&!"aeiou".includes(t[e]);e++)r=e+1;if(0===r)return null;for(const e of px){const n=r;if(t.slice(n,n+e.length)===e){const i=t.slice(0,r)+t.slice(n+e.length);if(i.length>=3)return{stem:i,infix:e}}}return null}(t);let l=!1;if(s&&s.stem.length>=2&&(t=s.stem,r-=.18,a.push("infix:"+s.infix),l=!0),!l)for(const e of dx)if(t.endsWith(e.pattern)){const n=t.slice(0,-e.pattern.length);if(n.length>=2){t=n,r-=e.confidencePenalty,i.push(e.pattern),a.push("suffix:"+e.pattern);break}}return r=Math.max(.5,r),0===n.length&&0===i.length&&0===a.length?yd(e):vd(t,r,{removedPrefixes:n,removedSuffixes:i,appliedRules:a})}}}}),wx={};Ad(wx,{TagalogTokenizer:()=>vx,tagalogTokenizer:()=>gx});var bx,zx,xx,Ex=Cd({"src/tokenizers/tl.ts"(){fy(),$h(),kx(),yy(),Ng(),Fv(),yx=[{native:"totoo",normalized:"true"},{native:"mali",normalized:"false"},{native:"wala",normalized:"null"},{native:"hindi_tinukoy",normalized:"undefined"},{native:"una",normalized:"first"},{native:"huli",normalized:"last"},{native:"susunod",normalized:"next"},{native:"nakaraan",normalized:"previous"},{native:"pinakamalapit",normalized:"closest"},{native:"magulang",normalized:"parent"},{native:"pindot",normalized:"click"},{native:"pagbabago",normalized:"change"},{native:"isumite",normalized:"submit"},{native:"input",normalized:"input"},{native:"karga",normalized:"load"},{native:"mag_scroll",normalized:"scroll"},{native:"kasama",normalized:"inclusive"},{native:"bukod",normalized:"exclusive"},{native:"karakter",normalized:"characters"},{native:"random",normalized:"random"}],gx=new(vx=class extends ud{constructor(){super(),this.language="tl",this.direction="ltr",this.initializeKeywordsFromProfile(Ih,yx),this.setNormalizer(mx),this.registerExtractors(Pg()),this.registerExtractor(new Ou),this.registerExtractor(new Nu),this.registerExtractors([new qv]),this.registerExtractor(new ly),this.registerExtractor(new cy)}classifyToken(e){return this.isKeyword(e)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(e)?"event-modifier":e.startsWith(".")||e.startsWith("#")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith(":")?"identifier":e.startsWith('"')||e.startsWith("'")||/^-?\d/.test(e)?"literal":e.startsWith("/")||e.startsWith("./")||e.startsWith("http")?"url":"identifier"}})}});function Tx(e,t){return xx[t]?.has(e)?e:zx[t]?.[e]??e}function Sx(e){const t=e.verbAlts?{type:"literal",value:e.verb,alternatives:e.verbAlts}:{type:"literal",value:e.verb},r=e.eventMarkerAlts?{type:"literal",value:e.eventMarker,alternatives:e.eventMarkerAlts}:{type:"literal",value:e.eventMarker};return["before","after"].map(n=>{const i={type:"literal",value:"before"===n?e.before:e.after},a={type:"role",role:"patient"},o={type:"role",role:"destination"},s={type:"role",role:"event"};return{id:`put-event-${e.lang}-vso-${n}`,language:e.lang,command:"on",priority:160,template:{format:`${e.lang} put ${n}`,tokens:"verb-first"===e.order?[t,a,i,o,r,s]:[r,s,t,a,i,o]},extraction:"verb-first"===e.order?{action:{value:"put"},patient:{position:1},destination:{position:3},event:{position:5},manner:{default:{type:"literal",value:n}}}:{action:{value:"put"},event:{position:1},patient:{position:3},destination:{position:5},manner:{default:{type:"literal",value:n}}}}})}function Cx(e){switch(e){case"bn":return[{id:"event-handler-bn-sov",language:"bn",command:"on",priority:100,template:{format:"{event} \u09a4\u09c7 {action}",tokens:[{type:"role",role:"event"},{type:"literal",value:"\u09a4\u09c7",alternatives:["\u098f"]},{type:"role",role:"action"}]},extraction:{event:{position:0},action:{position:2}}},{id:"event-handler-bn-with-source",language:"bn",command:"on",priority:95,template:{format:"{source} \u09a5\u09c7\u0995\u09c7 {event} \u09a4\u09c7 {action}",tokens:[{type:"role",role:"source"},{type:"literal",value:"\u09a5\u09c7\u0995\u09c7"},{type:"role",role:"event"},{type:"literal",value:"\u09a4\u09c7",alternatives:["\u098f"]},{type:"role",role:"action"}]},extraction:{source:{position:0},event:{marker:"\u09a4\u09c7",position:2},action:{position:4}}},{id:"event-handler-bn-when",language:"bn",command:"on",priority:90,template:{format:"\u09af\u0996\u09a8 {event} {action}",tokens:[{type:"literal",value:"\u09af\u0996\u09a8"},{type:"role",role:"event"},{type:"role",role:"action"}]},extraction:{event:{position:1},action:{position:2}}}];case"de":return[{id:"event-de-wenn-source",language:"de",command:"on",priority:115,template:{format:"wenn {event} von {source} {body}",tokens:[{type:"literal",value:"wenn",alternatives:["falls","sobald"]},{type:"role",role:"event"},{type:"literal",value:"von",alternatives:["aus"]},{type:"role",role:"source"}]},extraction:{event:{position:1},source:{marker:"von",markerAlternatives:["aus"]}}},{id:"event-de-wenn",language:"de",command:"on",priority:105,template:{format:"wenn {event} {body}",tokens:[{type:"literal",value:"wenn",alternatives:["falls","sobald"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-de-bei-source",language:"de",command:"on",priority:110,template:{format:"bei {event} von {source} {body}",tokens:[{type:"literal",value:"bei",alternatives:["beim"]},{type:"role",role:"event"},{type:"literal",value:"von",alternatives:["aus"]},{type:"role",role:"source"}]},extraction:{event:{position:1},source:{marker:"von",markerAlternatives:["aus"]}}},{id:"event-de-bei",language:"de",command:"on",priority:100,template:{format:"bei {event} {body}",tokens:[{type:"literal",value:"bei",alternatives:["beim"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-de-auf",language:"de",command:"on",priority:95,template:{format:"auf {event} {body}",tokens:[{type:"literal",value:"auf"},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-de-im-falle",language:"de",command:"on",priority:90,template:{format:"im Falle von {event} {body}",tokens:[{type:"literal",value:"im Falle von",alternatives:["im Fall von"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}}];case"en":return[{id:"event-en-when-source",language:"en",command:"on",priority:115,template:{format:"when {event} from {source} {body}",tokens:[{type:"literal",value:"when"},{type:"role",role:"event"},{type:"literal",value:"from"},{type:"role",role:"source"}]},extraction:{event:{position:1},source:{marker:"from"}}},{id:"event-en-when",language:"en",command:"on",priority:105,template:{format:"when {event} {body}",tokens:[{type:"literal",value:"when"},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-en-source",language:"en",command:"on",priority:110,template:{format:"on {event} from {source} {body}",tokens:[{type:"literal",value:"on"},{type:"role",role:"event"},{type:"literal",value:"from"},{type:"role",role:"source"}]},extraction:{event:{position:1},source:{marker:"from"}}},{id:"event-en-standard",language:"en",command:"on",priority:100,template:{format:"on {event} {body}",tokens:[{type:"literal",value:"on"},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-en-upon",language:"en",command:"on",priority:98,template:{format:"upon {event} {body}",tokens:[{type:"literal",value:"upon"},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-en-if",language:"en",command:"on",priority:95,template:{format:"if {event} {body}",tokens:[{type:"literal",value:"if"},{type:"role",role:"event"}]},extraction:{event:{position:1}}}];case"es":return[{id:"event-es-native-al-source",language:"es",command:"on",priority:115,template:{format:"al {event} en {source} {body}",tokens:[{type:"literal",value:"al"},{type:"role",role:"event"},{type:"literal",value:"en",alternatives:["de"]},{type:"role",role:"source"}]},extraction:{event:{position:1},source:{marker:"en",markerAlternatives:["de"]}}},{id:"event-es-cuando-source",language:"es",command:"on",priority:112,template:{format:"cuando {event} en {source} {body}",tokens:[{type:"literal",value:"cuando"},{type:"role",role:"event"},{type:"literal",value:"en",alternatives:["de"]},{type:"role",role:"source"}]},extraction:{event:{position:1},source:{marker:"en",markerAlternatives:["de"]}}},{id:"event-es-native-al",language:"es",command:"on",priority:108,template:{format:"al {event} {body}",tokens:[{type:"literal",value:"al"},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-es-standard",language:"es",command:"on",priority:100,template:{format:"en {event} {body}",tokens:[{type:"literal",value:"en",alternatives:["al","cuando"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-es-source",language:"es",command:"on",priority:110,template:{format:"en {event} desde {source} {body}",tokens:[{type:"literal",value:"en",alternatives:["al"]},{type:"role",role:"event"},{type:"literal",value:"desde",alternatives:["de"]},{type:"role",role:"source"}]},extraction:{event:{position:1},source:{marker:"desde",markerAlternatives:["de"]}}},{id:"event-es-when",language:"es",command:"on",priority:95,template:{format:"cuando {event} {body}",tokens:[{type:"literal",value:"cuando"},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-es-conditional-si",language:"es",command:"on",priority:85,template:{format:"si {event} {body}",tokens:[{type:"literal",value:"si"},{type:"role",role:"event"}]},extraction:{event:{position:1}}}];case"fr":return[{id:"event-fr-quand-source",language:"fr",command:"on",priority:115,template:{format:"quand {event} de {source} {body}",tokens:[{type:"literal",value:"quand",alternatives:["lorsque"]},{type:"role",role:"event"},{type:"literal",value:"de",alternatives:["depuis"]},{type:"role",role:"source"}]},extraction:{event:{position:1},source:{marker:"de",markerAlternatives:["depuis"]}}},{id:"event-fr-quand",language:"fr",command:"on",priority:105,template:{format:"quand {event} {body}",tokens:[{type:"literal",value:"quand",alternatives:["lorsque"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-fr-sur-source",language:"fr",command:"on",priority:110,template:{format:"sur {event} de {source} {body}",tokens:[{type:"literal",value:"sur",alternatives:["lors de"]},{type:"role",role:"event"},{type:"literal",value:"de",alternatives:["depuis"]},{type:"role",role:"source"}]},extraction:{event:{position:1},source:{marker:"de",markerAlternatives:["depuis"]}}},{id:"event-fr-sur",language:"fr",command:"on",priority:100,template:{format:"sur {event} {body}",tokens:[{type:"literal",value:"sur",alternatives:["lors de"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-fr-si",language:"fr",command:"on",priority:95,template:{format:"si {event} {body}",tokens:[{type:"literal",value:"si"},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-fr-a",language:"fr",command:"on",priority:90,template:{format:"\u00e0 {event} {body}",tokens:[{type:"literal",value:"\u00e0",alternatives:["au"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}}];case"hi":return[{id:"event-hi-standard",language:"hi",command:"on",priority:100,template:{format:"{event} \u092a\u0930",tokens:[{type:"role",role:"event"},{type:"literal",value:"\u092a\u0930",alternatives:["\u092e\u0947\u0902","\u091c\u092c"]}]},extraction:{event:{position:0}}},{id:"event-hi-with-source",language:"hi",command:"on",priority:95,template:{format:"{source} \u0938\u0947 {event} \u092a\u0930",tokens:[{type:"role",role:"source"},{type:"literal",value:"\u0938\u0947"},{type:"role",role:"event"},{type:"literal",value:"\u092a\u0930",alternatives:["\u092e\u0947\u0902","\u091c\u092c"]}]},extraction:{source:{position:0},event:{marker:"\u0938\u0947",position:2}}},{id:"event-hi-when",language:"hi",command:"on",priority:95,template:{format:"\u091c\u092c {event} {body}",tokens:[{type:"literal",value:"\u091c\u092c"},{type:"role",role:"event",expectedTypes:["reference","expression","selector"]}]},extraction:{event:{position:1}}},{id:"event-hi-bare",language:"hi",command:"on",priority:80,template:{format:"{event}",tokens:[{type:"role",role:"event"}]},extraction:{event:{position:0}}}];case"id":return[{id:"event-id-ketika-source",language:"id",command:"on",priority:115,template:{format:"ketika {event} dari {source} {body}",tokens:[{type:"literal",value:"ketika",alternatives:["saat","waktu"]},{type:"role",role:"event"},{type:"literal",value:"dari"},{type:"role",role:"source"}]},extraction:{event:{position:1},source:{marker:"dari"}}},{id:"event-id-ketika",language:"id",command:"on",priority:105,template:{format:"ketika {event} {body}",tokens:[{type:"literal",value:"ketika",alternatives:["saat","waktu"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-id-pada-source",language:"id",command:"on",priority:110,template:{format:"pada {event} dari {source} {body}",tokens:[{type:"literal",value:"pada"},{type:"role",role:"event"},{type:"literal",value:"dari"},{type:"role",role:"source"}]},extraction:{event:{position:1},source:{marker:"dari"}}},{id:"event-id-pada",language:"id",command:"on",priority:100,template:{format:"pada {event} {body}",tokens:[{type:"literal",value:"pada"},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-id-jika",language:"id",command:"on",priority:95,template:{format:"jika {event} {body}",tokens:[{type:"literal",value:"jika",alternatives:["kalau","apabila"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-id-bila",language:"id",command:"on",priority:90,template:{format:"bila {event} {body}",tokens:[{type:"literal",value:"bila"},{type:"role",role:"event"}]},extraction:{event:{position:1}}}];case"it":return[{id:"event-handler-it-full",language:"it",command:"on",priority:100,template:{format:"su {event} {action}",tokens:[{type:"literal",value:"su",alternatives:["quando","al","on"]},{type:"role",role:"event"},{type:"role",role:"action"}]},extraction:{event:{position:1},action:{position:2}}},{id:"event-handler-it-from",language:"it",command:"on",priority:95,template:{format:"su {event} da {source} {action}",tokens:[{type:"literal",value:"su",alternatives:["quando","al","on"]},{type:"role",role:"event"},{type:"literal",value:"da",alternatives:["di"]},{type:"role",role:"source"},{type:"role",role:"action"}]},extraction:{event:{position:1},source:{marker:"da",markerAlternatives:["di"]},action:{position:-1}}}];case"ms":return[{id:"event-ms-apabila",language:"ms",command:"on",priority:100,template:{format:"apabila {event} {body}",tokens:[{type:"literal",value:"apabila",alternatives:["bila","ketika"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-ms-apabila-source",language:"ms",command:"on",priority:110,template:{format:"apabila {event} dari {source} {body}",tokens:[{type:"literal",value:"apabila",alternatives:["bila","ketika"]},{type:"role",role:"event"},{type:"literal",value:"dari"},{type:"role",role:"source"}]},extraction:{event:{position:1},source:{marker:"dari"}}}];case"pl":return[{id:"event-handler-pl-full",language:"pl",command:"on",priority:100,template:{format:"gdy {event} na {source}",tokens:[{type:"literal",value:"gdy",alternatives:["kiedy","przy","na"]},{type:"role",role:"event"},{type:"group",optional:!0,tokens:[{type:"literal",value:"na",alternatives:["w","przy","z"]},{type:"role",role:"source"}]}]},extraction:{event:{position:1},source:{marker:"na",markerAlternatives:["w","przy","z"],default:{type:"reference",value:"me"}}}},{id:"event-handler-pl-simple",language:"pl",command:"on",priority:90,template:{format:"gdy {event}",tokens:[{type:"literal",value:"gdy",alternatives:["kiedy","przy","na"]},{type:"role",role:"event"}]},extraction:{event:{position:1},source:{default:{type:"reference",value:"me"}}}}];case"pt":return[{id:"event-pt-ao-source",language:"pt",command:"on",priority:115,template:{format:"ao {event} em {source} {body}",tokens:[{type:"literal",value:"ao",alternatives:["\u00e0"]},{type:"role",role:"event"},{type:"literal",value:"em",alternatives:["de","no","na"]},{type:"role",role:"source"}]},extraction:{event:{position:1},source:{marker:"em",markerAlternatives:["de","no","na"]}}},{id:"event-pt-quando-source",language:"pt",command:"on",priority:110,template:{format:"quando {event} de {source} {body}",tokens:[{type:"literal",value:"quando"},{type:"role",role:"event"},{type:"literal",value:"de",alternatives:["em","no","na"]},{type:"role",role:"source"}]},extraction:{event:{position:1},source:{marker:"de",markerAlternatives:["em","no","na"]}}},{id:"event-pt-ao",language:"pt",command:"on",priority:105,template:{format:"ao {event} {body}",tokens:[{type:"literal",value:"ao",alternatives:["\u00e0"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-pt-quando",language:"pt",command:"on",priority:100,template:{format:"quando {event} {body}",tokens:[{type:"literal",value:"quando"},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-pt-em",language:"pt",command:"on",priority:95,template:{format:"em {event} {body}",tokens:[{type:"literal",value:"em",alternatives:["no","na"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-pt-se",language:"pt",command:"on",priority:90,template:{format:"se {event} {body}",tokens:[{type:"literal",value:"se"},{type:"role",role:"event"}]},extraction:{event:{position:1}}}];case"qu":return[{id:"event-qu-maykama",language:"qu",command:"on",priority:115,template:{format:"maykama {event} {body}",tokens:[{type:"literal",value:"maykama"},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-qu-kaqtin",language:"qu",command:"on",priority:105,template:{format:"{event} kaqtin {body}",tokens:[{type:"role",role:"event"},{type:"literal",value:"kaqtin",alternatives:["qtin","ptin"]}]},extraction:{event:{position:0}}},{id:"event-qu-standard",language:"qu",command:"on",priority:100,template:{format:"{event} pi {body}",tokens:[{type:"role",role:"event"},{type:"literal",value:"pi",alternatives:["kaqpi","kaqpim"]}]},extraction:{event:{position:0}}}];case"ru":return[{id:"event-handler-ru-full",language:"ru",command:"on",priority:100,template:{format:"\u043f\u0440\u0438 {event} \u043d\u0430 {source}",tokens:[{type:"literal",value:"\u043f\u0440\u0438",alternatives:["\u043a\u043e\u0433\u0434\u0430"]},{type:"role",role:"event"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u043d\u0430",alternatives:["\u0432","\u043e\u0442"]},{type:"role",role:"source"}]}]},extraction:{event:{position:1},source:{marker:"\u043d\u0430",markerAlternatives:["\u0432","\u043e\u0442"],default:{type:"reference",value:"me"}}}},{id:"event-handler-ru-simple",language:"ru",command:"on",priority:90,template:{format:"\u043f\u0440\u0438 {event}",tokens:[{type:"literal",value:"\u043f\u0440\u0438",alternatives:["\u043a\u043e\u0433\u0434\u0430"]},{type:"role",role:"event"}]},extraction:{event:{position:1},source:{default:{type:"reference",value:"me"}}}}];case"sw":return[{id:"event-sw-unapo-source",language:"sw",command:"on",priority:115,template:{format:"unapo {event} kutoka {source} {body}",tokens:[{type:"literal",value:"unapo",alternatives:["wakati wa","wakati"]},{type:"role",role:"event"},{type:"literal",value:"kutoka"},{type:"role",role:"source"}]},extraction:{event:{position:1},source:{marker:"kutoka"}}},{id:"event-sw-unapo",language:"sw",command:"on",priority:105,template:{format:"unapo {event} {body}",tokens:[{type:"literal",value:"unapo",alternatives:["wakati wa","wakati"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-sw-kwa-source",language:"sw",command:"on",priority:110,template:{format:"kwa {event} kutoka {source} {body}",tokens:[{type:"literal",value:"kwa"},{type:"role",role:"event"},{type:"literal",value:"kutoka"},{type:"role",role:"source"}]},extraction:{event:{position:1},source:{marker:"kutoka"}}},{id:"event-sw-kwa",language:"sw",command:"on",priority:100,template:{format:"kwa {event} {body}",tokens:[{type:"literal",value:"kwa"},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-sw-ikiwa",language:"sw",command:"on",priority:95,template:{format:"ikiwa {event} {body}",tokens:[{type:"literal",value:"ikiwa",alternatives:["kama"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-sw-baada-ya",language:"sw",command:"on",priority:90,template:{format:"baada ya {event} {body}",tokens:[{type:"literal",value:"baada ya"},{type:"role",role:"event"}]},extraction:{event:{position:1}}}];case"th":return[{id:"event-handler-th-svo",language:"th",command:"on",priority:100,template:{format:"\u0e40\u0e21\u0e37\u0e48\u0e2d {event} {action}",tokens:[{type:"literal",value:"\u0e40\u0e21\u0e37\u0e48\u0e2d",alternatives:["\u0e15\u0e2d\u0e19"]},{type:"role",role:"event"},{type:"role",role:"action"}]},extraction:{event:{position:1},action:{position:2}}},{id:"event-handler-th-with-source",language:"th",command:"on",priority:95,template:{format:"\u0e40\u0e21\u0e37\u0e48\u0e2d {event} \u0e08\u0e32\u0e01 {source} {action}",tokens:[{type:"literal",value:"\u0e40\u0e21\u0e37\u0e48\u0e2d",alternatives:["\u0e15\u0e2d\u0e19"]},{type:"role",role:"event"},{type:"literal",value:"\u0e08\u0e32\u0e01"},{type:"role",role:"source"},{type:"role",role:"action"}]},extraction:{event:{position:1},source:{marker:"\u0e08\u0e32\u0e01",position:3},action:{position:4}}}];case"tl":return[...Sx({lang:"tl",verb:"ilagay",verbAlts:["maglagay"],eventMarker:"kapag",eventMarkerAlts:["sa"],before:"bago",after:"matapos",order:"verb-first"}),{id:"event-tl-kapag-source",language:"tl",command:"on",priority:115,template:{format:"kapag {event} mula_sa {source} {body}",tokens:[{type:"literal",value:"kapag",alternatives:["sa"]},{type:"role",role:"event"},{type:"literal",value:"mula_sa",alternatives:["galing_sa"]},{type:"role",role:"source"}]},extraction:{event:{position:1},source:{marker:"mula_sa"}}},{id:"event-tl-kapag",language:"tl",command:"on",priority:105,template:{format:"kapag {event} {body}",tokens:[{type:"literal",value:"kapag",alternatives:["sa"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}}];case"uk":return[...Sx({lang:"uk",verb:"\u043f\u043e\u043a\u043b\u0430\u0441\u0442\u0438",verbAlts:["\u043f\u043e\u043a\u043b\u0430\u0434\u0438","\u043f\u043e\u043c\u0456\u0441\u0442\u0438\u0442\u0438","\u043f\u043e\u043c\u0456\u0441\u0442\u0438","\u0432\u0441\u0442\u0430\u0432\u0438\u0442\u0438","\u0432\u0441\u0442\u0430\u0432"],eventMarker:"\u043f\u0440\u0438",eventMarkerAlts:["\u043a\u043e\u043b\u0438"],before:"\u0434\u043e",after:"\u043f\u0456\u0441\u043b\u044f",order:"event-first"}),{id:"event-handler-uk-full",language:"uk",command:"on",priority:100,template:{format:"\u043f\u0440\u0438 {event} \u043d\u0430 {source}",tokens:[{type:"literal",value:"\u043f\u0440\u0438",alternatives:["\u043a\u043e\u043b\u0438"]},{type:"role",role:"event"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u043d\u0430",alternatives:["\u0432","\u0432\u0456\u0434"]},{type:"role",role:"source"}]}]},extraction:{event:{position:1},source:{marker:"\u043d\u0430",markerAlternatives:["\u0432","\u0432\u0456\u0434"],default:{type:"reference",value:"me"}}}},{id:"event-handler-uk-simple",language:"uk",command:"on",priority:90,template:{format:"\u043f\u0440\u0438 {event}",tokens:[{type:"literal",value:"\u043f\u0440\u0438",alternatives:["\u043a\u043e\u043b\u0438"]},{type:"role",role:"event"}]},extraction:{event:{position:1},source:{default:{type:"reference",value:"me"}}}}];case"vi":return[{id:"event-handler-vi-full",language:"vi",command:"on",priority:100,template:{format:"khi {event} tr\u00ean {source}",tokens:[{type:"literal",value:"khi",alternatives:["l\u00fac","tr\u00ean"]},{type:"role",role:"event"},{type:"group",optional:!0,tokens:[{type:"literal",value:"tr\u00ean",alternatives:["t\u1ea1i"]},{type:"role",role:"source"}]}]},extraction:{event:{position:1},source:{marker:"tr\u00ean",markerAlternatives:["t\u1ea1i"],default:{type:"reference",value:"me"}}}},{id:"event-handler-vi-simple",language:"vi",command:"on",priority:90,template:{format:"khi {event}",tokens:[{type:"literal",value:"khi",alternatives:["l\u00fac","tr\u00ean"]},{type:"role",role:"event"}]},extraction:{event:{position:1},source:{default:{type:"reference",value:"me"}}}}];case"zh":return[{id:"event-zh-temporal-source",language:"zh",command:"on",priority:115,template:{format:"{event} \u7684\u65f6\u5019 \u4ece {source} {body}",tokens:[{type:"role",role:"event"},{type:"literal",value:"\u7684\u65f6\u5019",alternatives:["\u65f6\u5019","\u65f6"]},{type:"literal",value:"\u4ece",alternatives:["\u5728"]},{type:"role",role:"source"}]},extraction:{event:{position:0},source:{marker:"\u4ece",markerAlternatives:["\u5728"]}}},{id:"event-zh-source",language:"zh",command:"on",priority:110,template:{format:"\u5f53 {event} \u4ece {source} {body}",tokens:[{type:"literal",value:"\u5f53"},{type:"role",role:"event"},{type:"literal",value:"\u4ece",alternatives:["\u5728"]},{type:"role",role:"source"}]},extraction:{event:{position:1},source:{marker:"\u4ece",markerAlternatives:["\u5728"]}}},{id:"event-zh-immediate",language:"zh",command:"on",priority:108,template:{format:"\u4e00 {event} \u5c31 {body}",tokens:[{type:"literal",value:"\u4e00"},{type:"role",role:"event"},{type:"literal",value:"\u5c31"}]},extraction:{event:{position:1}}},{id:"event-zh-temporal",language:"zh",command:"on",priority:105,template:{format:"{event} \u7684\u65f6\u5019 {body}",tokens:[{type:"role",role:"event"},{type:"literal",value:"\u7684\u65f6\u5019",alternatives:["\u65f6\u5019","\u65f6"]}]},extraction:{event:{position:0}}},{id:"event-zh-whenever",language:"zh",command:"on",priority:103,template:{format:"\u6bcf\u5f53 {event} {body}",tokens:[{type:"literal",value:"\u6bcf\u5f53",alternatives:["\u6bcf\u6b21"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-zh-circumfix",language:"zh",command:"on",priority:106,template:{format:"\u5f53 {event} \u65f6 {body}",tokens:[{type:"literal",value:"\u5f53"},{type:"role",role:"event"},{type:"literal",value:"\u65f6",alternatives:["\u7684\u65f6\u5019","\u65f6\u5019"]}]},extraction:{event:{position:1}}},{id:"event-zh-standard",language:"zh",command:"on",priority:100,template:{format:"\u5f53 {event} {body}",tokens:[{type:"literal",value:"\u5f53"},{type:"role",role:"event"}]},extraction:{event:{position:1}}},{id:"event-zh-completion",language:"zh",command:"on",priority:95,template:{format:"{event} \u4e86 {body}",tokens:[{type:"role",role:"event"},{type:"literal",value:"\u4e86"}]},extraction:{event:{position:0}}},{id:"event-zh-conditional",language:"zh",command:"on",priority:90,template:{format:"\u5982\u679c {event} {body}",tokens:[{type:"literal",value:"\u5982\u679c",alternatives:["\u82e5","\u5047\u5982"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}}];case"ja":return[{id:"event-ja-when",language:"ja",command:"on",priority:95,template:{format:"\u3068\u304d {event} {body}",tokens:[{type:"literal",value:"\u3068\u304d",alternatives:["\u6642","\u3068\u304d\u306b"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}}];case"tr":return[{id:"event-tr-when",language:"tr",command:"on",priority:95,template:{format:"iken {event} {body}",tokens:[{type:"literal",value:"iken",alternatives:["durumunda","oldu\u011funda"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}}];case"ar":return[...Sx({lang:"ar",verb:"\u0636\u0639",verbAlts:["\u0627\u062c\u0639\u0644"],eventMarker:"\u0639\u0646\u062f",eventMarkerAlts:["\u0641\u064a","\u0644\u062f\u0649","\u0639\u0646\u062f\u0645\u0627","\u062d\u064a\u0646","\u062d\u064a\u0646\u0645\u0627","\u0644\u0645\u0651\u0627","\u0644\u0645\u0627"],before:"\u0642\u0628\u0644",after:"\u0628\u0639\u062f",order:"verb-first"}),{id:"event-ar-when",language:"ar",command:"on",priority:95,template:{format:"\u0639\u0646\u062f\u0645\u0627 {event} {body}",tokens:[{type:"literal",value:"\u0639\u0646\u062f\u0645\u0627",alternatives:["\u062d\u064a\u0646","\u0644\u0645\u0651\u0627"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}}];case"he":return[{id:"event-he-when",language:"he",command:"on",priority:95,template:{format:"\u05db\u05d0\u05e9\u05e8 {event} {body}",tokens:[{type:"literal",value:"\u05db\u05d0\u05e9\u05e8",alternatives:["\u05db\u05e9"]},{type:"role",role:"event"}]},extraction:{event:{position:1}}}];default:return[]}}var Ax=Cd({"src/patterns/event-handler.ts"(){zx=Object.fromEntries(Object.entries(bx={ko:{"\ud074\ub9ad":"click","\uc785\ub825":"input","\ubcc0\uacbd":"change","\uc81c\ucd9c":"submit","\ud0a4\ub2e4\uc6b4":"keydown","\ud0a4\uc5c5":"keyup","\ub9c8\uc6b0\uc2a4\uc624\ubc84":"mouseover","\ub9c8\uc6b0\uc2a4\uc544\uc6c3":"mouseout","\ub9c8\uc6b0\uc2a4\ub2e4\uc6b4":"mousedown","\ub9c8\uc6b0\uc2a4\uc5c5":"mouseup","\ud3ec\ucee4\uc2a4":"focus","\ube14\ub7ec":"blur","\ub85c\ub4dc":"load","\ub9ac\uc0ac\uc774\uc988":"resize","\uc2a4\ud06c\ub864":"scroll","\ub9c8\uc6b0\uc2a4\uc5d4\ud130":"mouseenter","\ub9c8\uc6b0\uc2a4\ub9ac\ube0c":"mouseleave","\ub9c8\uc6b0\uc2a4\ubb34\ube0c":"mousemove","\ud0a4\ud504\ub808\uc2a4":"keypress","\ud130\uce58\uc885\ub8cc":"touchend","\ud130\uce58\ucde8\uc18c":"touchcancel"},ja:{"\u30af\u30ea\u30c3\u30af":"click","\u5165\u529b":"input","\u5909\u66f4":"change","\u9001\u4fe1":"submit","\u30ad\u30fc\u30c0\u30a6\u30f3":"keydown","\u30ad\u30fc\u30a2\u30c3\u30d7":"keyup","\u30ad\u30fc\u30d7\u30ec\u30b9":"keypress","\u30de\u30a6\u30b9\u30aa\u30fc\u30d0\u30fc":"mouseover","\u30de\u30a6\u30b9\u30a2\u30a6\u30c8":"mouseout","\u30de\u30a6\u30b9\u62bc\u4e0b":"mousedown","\u30de\u30a6\u30b9\u89e3\u653e":"mouseup","\u30d5\u30a9\u30fc\u30ab\u30b9":"focus","\u30d6\u30e9\u30fc":"blur","\u30ed\u30fc\u30c9":"load","\u8aad\u307f\u8fbc\u307f":"load","\u30b5\u30a4\u30ba\u5909\u66f4":"resize","\u30b9\u30af\u30ed\u30fc\u30eb":"scroll","\u307c\u304b\u3057":"blur"},ar:{"\u0627\u0644\u0646\u0642\u0631":"click","\u0646\u0642\u0631":"click","\u0627\u0644\u0625\u062f\u062e\u0627\u0644":"input","\u0625\u062f\u062e\u0627\u0644":"input","\u0627\u0644\u062a\u063a\u064a\u064a\u0631":"change","\u062a\u063a\u064a\u064a\u0631":"change","\u0627\u0644\u0625\u0631\u0633\u0627\u0644":"submit","\u0625\u0631\u0633\u0627\u0644":"submit","\u0636\u063a\u0637 \u0627\u0644\u0645\u0641\u062a\u0627\u062d":"keydown","\u0631\u0641\u0639 \u0627\u0644\u0645\u0641\u062a\u0627\u062d":"keyup","\u062a\u0645\u0631\u064a\u0631 \u0627\u0644\u0645\u0627\u0648\u0633":"mouseover","\u0627\u0644\u062a\u0631\u0643\u064a\u0632":"focus","\u062a\u062d\u0645\u064a\u0644":"load","\u062a\u0645\u0631\u064a\u0631":"scroll","\u062a\u0631\u0643\u064a\u0632":"focus","\u0645\u0641\u062a\u0627\u062d \u0623\u0633\u0641\u0644":"keydown","\u0645\u0641\u062a\u0627\u062d \u0623\u0639\u0644\u0649":"keyup","\u0641\u0623\u0631\u0629 \u0641\u0648\u0642":"mouseover","\u062a\u063a\u064a\u064a\u0631 \u062d\u062c\u0645":"resize"},es:{clic:"click",click:"click",entrada:"input",cambio:"change","env\u00edo":"submit",enviar:"submit","tecla abajo":"keydown","tecla arriba":"keyup","rat\u00f3n encima":"mouseover","rat\u00f3n fuera":"mouseout",enfoque:"focus",desenfoque:"blur",carga:"load",desplazamiento:"scroll",cambiar:"change",enfocar:"focus",desenfocar:"blur",cargar:"load",desplazar:"scroll",dobleclic:"dblclick","rat\u00f3nentrar":"mouseenter","rat\u00f3nsalir":"mouseleave","rat\u00f3nmover":"mousemove",teclapresar:"keypress",descargar:"unload",toqueempezar:"touchstart",toqueterminar:"touchend",toquemover:"touchmove",toquecancelar:"touchcancel"},tr:{"t\u0131klama":"click","t\u0131kla":"click","t\u0131k":"click","giri\u015f":"input",girdi:"input","de\u011fi\u015fiklik":"change","de\u011fi\u015fim":"change","g\u00f6nderme":"submit","g\u00f6nder":"submit","tu\u015fbasma":"keydown","tu\u015fb\u0131rakma":"keyup",fare_bas:"mousedown","fare_b\u0131rak":"mouseup","farei\u00e7inde":"mouseover","fared\u0131\u015f\u0131nda":"mouseout",odaklanma:"focus",odak:"focus","bulan\u0131kl\u0131k":"blur","y\u00fckleme":"load","y\u00fckle":"load","boyutland\u0131rma":"resize","boyutland\u0131r":"resize","kayd\u0131rma":"scroll","bulan\u0131k":"blur",farebas:"mousedown","fareb\u0131rak":"mouseup","kayd\u0131r":"scroll"},pt:{clique:"click",clicar:"click",click:"click",entrada:"input",inserir:"input","mudan\u00e7a":"change",mudanca:"change",alterar:"change",envio:"submit",enviar:"submit","tecla baixo":"keydown","tecla cima":"keyup","pressionar tecla":"keydown","soltar tecla":"keyup","mouse sobre":"mouseover","mouse fora":"mouseout",foco:"focus",focar:"focus",desfoque:"blur",desfocar:"blur",carregar:"load",carregamento:"load",rolagem:"scroll",rolar:"scroll",duploClique:"dblclick",mouseEntrar:"mouseenter",mouseSair:"mouseleave",mouseMover:"mousemove",teclaPressionar:"keypress",descarregar:"unload","toqueIn\u00edcio":"touchstart",toqueFim:"touchend",toqueMover:"touchmove",toqueCancelar:"touchcancel"},zh:{"\u70b9\u51fb":"click","\u5355\u51fb":"click","\u53cc\u51fb":"dblclick","\u8f93\u5165":"input","\u6539\u53d8":"change","\u53d8\u5316":"change","\u53d8\u66f4":"change","\u63d0\u4ea4":"submit","\u53d1\u9001":"submit","\u6309\u952e":"keydown","\u952e\u5165":"keydown","\u677e\u952e":"keyup","\u9f20\u6807\u8fdb\u5165":"mouseover","\u9f20\u6807\u79fb\u5165":"mouseover","\u9f20\u6807\u79bb\u5f00":"mouseout","\u9f20\u6807\u79fb\u51fa":"mouseout","\u7126\u70b9":"focus","\u805a\u7126":"focus","\u5931\u7126":"blur","\u6a21\u7cca":"blur","\u52a0\u8f7d":"load","\u8f7d\u5165":"load","\u6eda\u52a8":"scroll","\u6309\u952e\u6309\u4e0b":"keydown","\u9f20\u6807\u79fb\u52a8":"mousemove","\u5378\u8f7d":"unload","\u8c03\u6574\u5927\u5c0f":"resize","\u89e6\u6478\u5f00\u59cb":"touchstart","\u89e6\u6478\u79fb\u52a8":"touchmove"},fr:{clic:"click",cliquer:"click",click:"click",saisie:"input","entr\u00e9e":"input",changement:"change",changer:"change",soumettre:"submit",soumission:"submit",envoi:"submit","touche bas":"keydown","touche haut":"keyup","souris dessus":"mouseover","souris dehors":"mouseout",focus:"focus",focaliser:"focus","d\u00e9focus":"blur","d\u00e9focaliser":"blur",chargement:"load",charger:"load","d\u00e9filement":"scroll","d\u00e9filer":"scroll",flou:"blur",doubleclic:"dblclick",sourisentrer:"mouseenter",sourissortir:"mouseleave",sourisbouger:"mousemove","touchepress\u00e9e":"keypress","d\u00e9charger":"unload",touchercommencer:"touchstart",toucherfin:"touchend",toucherbouger:"touchmove",toucherannuler:"touchcancel"},de:{klick:"click",klicken:"click",click:"click",eingabe:"input",eingeben:"input","\u00e4nderung":"change","\u00e4ndern":"change",absenden:"submit",einreichen:"submit","taste runter":"keydown","taste hoch":"keyup","maus \u00fcber":"mouseover","maus raus":"mouseout",fokus:"focus",fokussieren:"focus",defokussieren:"blur","unsch\u00e4rfe":"blur",laden:"load",ladung:"load",scrollen:"scroll","bl\u00e4ttern":"scroll","taste unten":"keydown","taste oben":"keyup","maus dr\u00fcber":"mouseover","maus weg":"mouseout",doppelklick:"dblclick",mauseintreten:"mouseenter",mausverlassen:"mouseleave",mausbewegen:"mousemove","tastedr\u00fccken":"keypress",entladen:"unload","ber\u00fchrungstart":"touchstart","ber\u00fchrungend":"touchend","ber\u00fchrungbewegen":"touchmove","ber\u00fchrungabbrechen":"touchcancel"},id:{klik:"click",click:"click",masukan:"input",input:"input",ubah:"change",perubahan:"change",kirim:"submit","tekan tombol":"keydown","lepas tombol":"keyup","mouse masuk":"mouseover","mouse keluar":"mouseout",fokus:"focus",blur:"blur",muat:"load",memuat:"load",gulir:"scroll",menggulir:"scroll",tekan_tombol:"keydown",keyup:"keyup",arahkan:"mouseover",tinggalkan:"mouseout",bongkar:"unload"},bn:{"\u0995\u09cd\u09b2\u09bf\u0995":"click","\u0987\u09a8\u09aa\u09c1\u099f":"input","\u099c\u09ae\u09be":"submit","\u09b2\u09cb\u09a1":"load","\u09b8\u09cd\u0995\u09cd\u09b0\u09cb\u09b2":"scroll","\u09b0\u09bf\u09b8\u09be\u0987\u099c":"resize","\u099d\u09be\u09aa\u09b8\u09be":"blur","\u09ab\u09cb\u0995\u09be\u09b8":"focus","\u09aa\u09b0\u09bf\u09ac\u09b0\u09cd\u09a4\u09a8":"change"},qu:{click:"click","\u00f1it'iy":"click","\u00f1itiy":"click",yaykuchiy:"input",yaykuy:"input",tikray:"change","t'ikray":"change",kambiay:"change",apachiy:"submit",kachay:"submit",apaykachay:"submit","llave uray":"keydown","llave hawa":"keyup","q'away":"focus",qhaway:"focus",paqariy:"blur","mana q'away":"blur",cargay:"load",apakuy:"load",apamuy:"load",kunray:"scroll",muyuy:"scroll",hatun_kay:"resize"},sw:{bofya:"click",click:"click",kubofya:"click",ingiza:"input",kubadilisha:"change",mabadiliko:"change",tuma:"submit",kutuma:"submit","bonyeza chini":"keydown","bonyeza juu":"keyup","panya juu":"mouseover","panya nje":"mouseout",lenga:"focus",kulenga:"focus",blur:"blur",pakia:"load",kupakia:"load",sogeza:"scroll",kusogeza:"scroll",bonyeza:"click",ingizo:"input",kitufe_shuka:"keydown",kitufe_juu:"keyup",panya_nje:"mouseout",wasilisha:"submit","sogeza juu":"mouseover",shuka:"unload"},vi:{"\u0111\u1ed5i k\u00edch th\u01b0\u1edbc":"resize"}}).map(([e,t])=>{const r={};for(const[e,n]of Object.entries(t))n in r||(r[n]=e);return[e,r]})),xx={ar:new Set(["mouseover"]),bn:new Set(["resize"]),de:new Set(["keydown","keyup","load","mouseout","mouseover"]),fr:new Set(["blur"]),id:new Set(["input","keyup","mouseout","mouseover"]),ja:new Set(["keypress","mousedown","mouseup","resize"]),qu:new Set(["change","focus","load","resize","submit"]),sw:new Set(["change","click","input","keydown","keyup","mouseout","mouseover","submit"]),tr:new Set(["keydown","keyup","load","mousedown","mouseout","mouseover","mouseup","resize","scroll"]),zh:new Set(["focus","keyup","mouseout","mouseover"])}}});function Lx(e,t){const r="SOV"===t?"sovPosition":"svoPosition";return[...e].sort((e,t)=>(e[r]??99)-(t[r]??99))}var jx=Cd({"src/parser/utils/role-positioning.ts"(){}});function Px(e,t){let r,n;if(e.markerOverride&&void 0!==e.markerOverride[t.code])r=e.markerOverride[t.code],n=r?ey(e,t.code,r):void 0;else{const i=t.roleMarkers[e.role];if(i){r=i.primary;const a=ey(e,t.code,r)??[],o=[...new Set([...i.alternatives??[],...a])].filter(e=>e!==r);n=o.length?o:void 0}}return{marker:r,alternatives:n}}function Ox(e,t,r){r.roles.find(e=>"scope"===e.role&&!e.required)&&(e.push({type:"group",optional:!0,tokens:[{type:"literal",value:"on"},{type:"role",role:"scope",optional:!0,expectedTypes:["selector","reference"]}]}),t.scope={fromRole:"scope"})}function Nx(e,t,r,n){Mx(e,t,r,n,"manner",{requireMarker:!0})}function Rx(e,t,r,n){Mx(e,t,r,n,"recipient",{requireMarker:!1})}function Mx(e,t,r,n,i,a){const o=r.roles.find(e=>e.role===i&&!e.required);if(!o)return;const s=o.markerOverride?.[n];a.requireMarker&&!s||(e.push({type:"group",optional:!0,tokens:[...(s?s.split(/\s+/):[]).map(e=>({type:"literal",value:e})),{type:"role",role:i,optional:!0,expectedTypes:o.expectedTypes,...void 0!==o.valueShape?{valueShape:o.valueShape}:{}}]}),t[i]={fromRole:i})}function Ix(e,t,r,n,i){const a=[],o="swap"===e.action,s=o?"destination":"patient";a.push({type:"role",role:s,optional:!1});const l=t.roleMarkers.patient;if(l){a.push(l.alternatives?{type:"literal",value:l.primary,alternatives:l.alternatives}:{type:"literal",value:l.primary})}if(a.push({type:"role",role:"event",optional:!1}),"after"===n.position){const e=n.primary.split(/\s+/);if(e.length>1)for(const t of e)a.push({type:"literal",value:t});else{a.push(n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary})}}a.push(r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary}),a.push(...uf(e,t.roleMarkers.source));let c=t.roleMarkers.destination;if(o&&c){const r=e.roles.find(e=>"patient"===e.role)?.markerOverride?.[t.code];if(r&&r!==c.primary){const e=c.alternatives??[];e.includes(r)||(c={...c,alternatives:[...e,r]})}}var u,p;a.push(...o?(u=e,p=c,df(u,p,"patient")):pf(e,c));const d={action:{value:e.action},event:{fromRole:"event"},[s]:{fromRole:s},...o?{}:lf(e),...cf(e)};return Rx(a,d,e,t.code),Nx(a,d,e,t.code),{id:`${e.action}-event-${t.code}-sov-patient-first`,language:t.code,command:"on",priority:(i.basePriority??100)+45,template:{format:`{patient} ${l?.primary||""} {event} ${n.primary} ${r.primary}`,tokens:a},extraction:d}}var Wx=Cd({"src/generators/event-handlers-sov.ts"(){wf(),ny()}});function _x(e,t,r){const n=ey(e,t.code,r.primary)??[],i=[...new Set([...r.alternatives??[],...n])].filter(e=>e!==r.primary);return i.length?i:void 0}function qx(e,t,r,n,i){const a=[];if("before"===n.position){a.push(n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary})}a.push({type:"role",role:"event",optional:!1});a.push(r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary}),a.push({type:"role",role:"patient",optional:!1});const o=t.roleMarkers.destination;return o&&a.push({type:"group",optional:!0,tokens:[o.alternatives?{type:"literal",value:o.primary,alternatives:o.alternatives}:{type:"literal",value:o.primary},{type:"role",role:"destination",optional:!0}]}),a.push(...uf(e,t.roleMarkers.source)),{id:`${e.action}-event-${t.code}-vso`,language:t.code,command:"on",priority:(i.basePriority??100)+50,template:{format:`${n.primary} {event} ${r.primary} {patient} ${o?.primary||""} {destination?}`,tokens:a},extraction:{action:{value:e.action},event:{fromRole:"event"},patient:{fromRole:"patient"},...lf(e),...cf(e)}}}function $x(e,t,r,n,i){const a=[];if("before"===n.position){a.push(n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary})}a.push({type:"role",role:"event",optional:!1});a.push(r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary});const o=[...e.roles.filter(e=>e.required)].sort((e,t)=>(e.svoPosition??999)-(t.svoPosition??999));for(const e of o){let r,n;if(e.markerOverride&&void 0!==e.markerOverride[t.code])r=e.markerOverride[t.code],n=r?ey(e,t.code,r):void 0;else{const i=t.roleMarkers[e.role];i&&(r=i.primary,n=_x(e,t,i))}if(r){a.push(n?{type:"literal",value:r,alternatives:n}:{type:"literal",value:r})}a.push({type:"role",role:e.role,optional:!1})}const s=o.map(e=>`{${e.role}}`).join(" "),l={action:{value:e.action},event:{fromRole:"event"},...Object.fromEntries(o.map(e=>[e.role,{fromRole:e.role}]))};return Ox(a,l,e),{id:`${e.action}-event-${t.code}-vso-2role`,language:t.code,command:"on",priority:(i.basePriority??100)+55,template:{format:`${n.primary} {event} ${r.primary} ${s}`,tokens:a},extraction:l}}var Vx,Dx=Cd({"src/generators/event-handlers-vso.ts"(){wf(),Wx(),ny()}});function Bx(){return Lf().map(e=>Af(e)).filter(e=>void 0!==e)}function Hx(e,t,r=Vx){const n=`${e.action}-${t.code}-generated`,i=r.basePriority??100,a=t.keywords[e.action];if(!a)throw Error(`No keyword translation for '${e.action}' in ${t.code}`);const o=function(e,t,r){const n=[],i=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary},a=function(e,t){const r=[],n=Lx(e.roles,t.wordOrder);for(const e of n){const n=Yx(e,t);e.required?r.push(...n):r.push({type:"group",optional:!0,tokens:n})}return r}(e,t);switch(t.wordOrder){case"SVO":case"VSO":default:n.push(i),n.push(...a);break;case"SOV":n.push(...a),n.push(i)}return function(e){const t=[];for(const r of e){const e=t[t.length-1];if(e&&"literal"===e.type&&"literal"===r.type&&e.value===r.value){const n=[...e.alternatives??[],...r.alternatives??[]];n.length&&(t[t.length-1]={...e,alternatives:[...new Set(n)]});continue}t.push(r)}return t}(n)}(e,t,a),s=Xx(e,t),l=function(e,t,r){const n=[],i=Lx(e.roles,t.wordOrder),a=i.map(e=>{const r=Qh(e,t);let n="";return n=r&&r.primary?"before"===r.position?`${r.primary} {${e.role}}`:`{${e.role}} ${r.primary}`:`{${e.role}}`,e.required?n:`[${n}]`});switch(t.wordOrder){case"SVO":case"VSO":default:n.push(r.primary,...a);break;case"SOV":n.push(...a,r.primary)}return n.join(" ")}(e,t,a);return{id:n,language:t.code,command:e.action,priority:i,template:{format:l,tokens:o},extraction:s}}function Kx(e,t,r=Vx){if(0===e.roles.filter(e=>!e.required).length)return null;const n=e.roles.filter(e=>e.required);return{...Hx({...e,roles:n},t,r),id:`${e.action}-${t.code}-generated-simple`,priority:(r.basePriority??100)-5,extraction:Xx(e,t)}}function Fx(e,t,r=Vx){if("SOV"!==t.wordOrder)return null;const n=e.roles.filter(e=>e.required);if(1!==n.length)return null;const i=t.keywords[e.action];if(!i)return null;const a=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary},o=n.flatMap(e=>{const r=e.valuePrefixLiteral?.[t.code],n={type:"role",role:e.role,optional:!1,expectedTypes:e.expectedTypes};return r?[{type:"literal",value:r},n]:[n]});return{id:`${e.action}-${t.code}-generated-verb-first`,language:t.code,command:e.action,priority:(r.basePriority??100)-20,template:{format:`${i.primary} <${n[0].role}>`,tokens:[a,...o]},extraction:Xx(e,t)}}function Ux(e,t,r=Vx){const n=[];if(n.push(Hx(e,t,r)),r.generateSimpleVariants){const i=Kx(e,t,r);i&&n.push(i)}for(const i of e.omitRoleVariants??[]){const a=Hx({...e,roles:e.roles.filter(e=>e.role!==i)},t,r);n.push({...a,id:`${e.action}-${t.code}-generated-no-${i}`,priority:(r.basePriority??100)-8})}if(!1!==r.generateVerbFirstVariants){const i=Fx(e,t,r);i&&n.push(i)}for(const i of e.rolePrefixLiteralVariants??[]){const a=i.literal[t.code];if(!a)continue;const{rolePrefixLiteralVariants:o,...s}=e,l={...s,roles:e.roles.map(e=>e.role===i.role?{...e,valuePrefixLiteral:{[t.code]:a}}:e)},c=i.priorityDelta??5,u=i.methodCarrier?{[i.methodCarrier]:{value:a}}:{},p=Hx(l,t,r);if(n.push({...p,id:`${e.action}-${t.code}-generated-${i.idSuffix}`,priority:(r.basePriority??100)+c,extraction:{...p.extraction,...u}}),!1!==r.generateVerbFirstVariants){const a=Fx(l,t,r);a&&n.push({...a,id:`${e.action}-${t.code}-generated-verb-first-${i.idSuffix}`,priority:(r.basePriority??100)-20+c,extraction:{...a.extraction,...u}})}}return n}function Gx(e,t=Vx){const r=[],n=ff();for(const i of n){if(!e.keywords[i.action])continue;const n=Ux(i,e,t);if(r.push(...n),e.eventHandler?.eventMarker){const n=Zx(i,e,t);r.push(...n)}}return r}function Zx(e,t,r=Vx){if(!t.eventHandler||!t.eventHandler.eventMarker)return[];const n=[],i=t.eventHandler.eventMarker,a=t.keywords[e.action];if(!a)return[];if(0===e.roles.length)return[];const o=2===e.roles.filter(e=>e.required).length;if("SOV"===t.wordOrder)if(o)n.push(function(e,t,r,n,i){const a=[];if(a.push({type:"role",role:"event",optional:!1}),"after"===n.position){const e=n.primary.split(/\s+/);if(e.length>1)for(const t of e)a.push({type:"literal",value:t});else a.push(n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary})}const o=[...e.roles.filter(e=>e.required)].sort((e,t)=>(e.sovPosition??999)-(t.sovPosition??999));for(const e of o){a.push({type:"role",role:e.role,optional:!1});const{marker:r,alternatives:n}=Px(e,t);r&&a.push(n?{type:"literal",value:r,alternatives:n}:{type:"literal",value:r})}a.push(r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary});const s=o.map(e=>`{${e.role}}`).join(" "),l={action:{value:e.action},event:{fromRole:"event"},...Object.fromEntries(o.map(e=>[e.role,{fromRole:e.role}]))};return Ox(a,l,e),{id:`${e.action}-event-${t.code}-sov-2role`,language:t.code,command:"on",priority:(i.basePriority??100)+55,template:{format:`{event} ${n.primary} ${s} ${r.primary}`,tokens:a},extraction:l}}(e,t,a,i,r)),n.push(function(e,t,r,n,i){const a=[],o=[...e.roles.filter(e=>e.required)].sort((e,t)=>(e.sovPosition??999)-(t.sovPosition??999)),s=o[0];a.push({type:"role",role:s.role,optional:!1});const{marker:l,alternatives:c}=Px(s,t);l&&a.push(c?{type:"literal",value:l,alternatives:c}:{type:"literal",value:l});if(a.push({type:"role",role:"event",optional:!1}),"after"===n.position){const e=n.primary.split(/\s+/);if(e.length>1)for(const t of e)a.push({type:"literal",value:t});else a.push(n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary})}a.push(r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary});const u=o[1];a.push({type:"role",role:u.role,optional:!1});const{marker:p,alternatives:d}=Px(u,t);p&&a.push(d?{type:"literal",value:p,alternatives:d}:{type:"literal",value:p});const m={action:{value:e.action},event:{fromRole:"event"},[s.role]:{fromRole:s.role},[u.role]:{fromRole:u.role}};return Ox(a,m,e),{id:`${e.action}-event-${t.code}-sov-2role-dest-first`,language:t.code,command:"on",priority:(i.basePriority??100)+48,template:{format:`{${s.role}} {event} ${n.primary} ${r.primary} {${u.role}}`,tokens:a},extraction:m}}(e,t,a,i,r)),n.push(function(e,t,r,n,i){const a=[],o=[...e.roles.filter(e=>e.required)].sort((e,t)=>(e.sovPosition??999)-(t.sovPosition??999));for(const e of o){a.push({type:"role",role:e.role,optional:!1});const{marker:r,alternatives:n}=Px(e,t);r&&a.push(n?{type:"literal",value:r,alternatives:n}:{type:"literal",value:r})}if(a.push(r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary}),a.push({type:"role",role:"event",optional:!1}),"after"===n.position){const e=n.primary.split(/\s+/);if(e.length>1)for(const t of e)a.push({type:"literal",value:t});else a.push(n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary})}const s=o.map(e=>`{${e.role}}`).join(" "),l={action:{value:e.action},event:{fromRole:"event"},...Object.fromEntries(o.map(e=>[e.role,{fromRole:e.role}]))};return Ox(a,l,e),{id:`${e.action}-event-${t.code}-sov-2role-event-last`,language:t.code,command:"on",priority:(i.basePriority??100)+40,template:{format:`${s} ${r.primary} {event} ${n.primary}`,tokens:a},extraction:l}}(e,t,a,i,r));else{n.push(function(e,t,r,n,i){const a=[];if(a.push({type:"role",role:"event",optional:!1}),"after"===n.position){const e=n.primary.split(/\s+/);if(e.length>1)for(const t of e)a.push({type:"literal",value:t});else a.push(n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary})}const o=t.roleMarkers.destination;o&&a.push({type:"group",optional:!0,tokens:[{type:"role",role:"destination",optional:!0},o.alternatives?{type:"literal",value:o.primary,alternatives:o.alternatives}:{type:"literal",value:o.primary}]}),a.push({type:"role",role:"patient",optional:!1});const s=t.roleMarkers.patient;s&&a.push(s.alternatives?{type:"literal",value:s.primary,alternatives:s.alternatives}:{type:"literal",value:s.primary});return a.push(r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary}),a.push(...uf(e,t.roleMarkers.source)),a.push(...pf(e,t.roleMarkers.destination)),{id:`${e.action}-event-${t.code}-sov`,language:t.code,command:"on",priority:(i.basePriority??100)+50,template:{format:`{event} ${n.primary} {destination?} {patient} ${s?.primary||""} ${r.primary}`,tokens:a},extraction:{action:{value:e.action},event:{fromRole:"event"},patient:{fromRole:"patient"},...lf(e),...cf(e)}}}(e,t,a,i,r)),n.push(Ix(e,t,a,i,r));const o=function(e,t,r,n,i){const a=e.roles.find(e=>"source"===e.role);if(!a)return null;const{marker:o,alternatives:s}=Px(a,t),l=t.roleMarkers.patient;if(!o)return null;if(o===n.primary||o===l?.primary)return null;const c=[];c.push({type:"role",role:"patient",optional:!1}),l&&c.push(l.alternatives?{type:"literal",value:l.primary,alternatives:l.alternatives}:{type:"literal",value:l.primary}),c.push({type:"role",role:"source",optional:!1,...a.expectedTypes?{expectedTypes:a.expectedTypes}:{},...void 0!==a.valueShape?{valueShape:a.valueShape}:{}});for(const e of o.split(/\s+/))c.push(s&&1===o.split(/\s+/).length?{type:"literal",value:e,alternatives:s}:{type:"literal",value:e});if(c.push({type:"role",role:"event",optional:!1}),"after"===n.position){const e=n.primary.split(/\s+/);if(e.length>1)for(const t of e)c.push({type:"literal",value:t});else c.push(n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary})}c.push(r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary});const u={action:{value:e.action},event:{fromRole:"event"},patient:{fromRole:"patient"},source:{fromRole:"source"}};return Rx(c,u,e,t.code),Nx(c,u,e,t.code),{id:`${e.action}-event-${t.code}-sov-source-fronted`,language:t.code,command:"on",priority:(i.basePriority??100)+48,template:{format:`{patient} ${l?.primary||""} {source} ${o} {event} ${n.primary} ${r.primary}`,tokens:c},extraction:u}}(e,t,a,i,r);o&&n.push(o);const s=t.roleMarkers.destination;s&&s.primary!==i.primary&&n.push(function(e,t,r,n,i){const a=[];a.push({type:"role",role:"patient",optional:!1});const o=t.roleMarkers.patient;o&&a.push(o.alternatives?{type:"literal",value:o.primary,alternatives:o.alternatives}:{type:"literal",value:o.primary});const s=t.roleMarkers.destination;if(s&&(a.push({type:"role",role:"destination",optional:!1}),a.push(s.alternatives?{type:"literal",value:s.primary,alternatives:s.alternatives}:{type:"literal",value:s.primary})),a.push({type:"role",role:"event",optional:!1}),"after"===n.position){const e=n.primary.split(/\s+/);if(e.length>1)for(const t of e)a.push({type:"literal",value:t});else a.push(n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary})}return a.push(r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary}),{id:`${e.action}-event-${t.code}-sov-patient-first-dest`,language:t.code,command:"on",priority:(i.basePriority??100)+40,template:{format:`{patient} ${o?.primary||""} {destination} ${s?.primary||""} {event} ${n.primary} ${r.primary}`,tokens:a},extraction:{action:{value:e.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination"}}}}(e,t,a,i,r));const l=i.primary.split(/\s+/),c=i.alternatives?.some(e=>!e.includes(" ")&&e.length>1);l.length>1&&c&&n.push(function(e,t,r,n,i){const a=[];a.push({type:"role",role:"event",optional:!1});const o=n.alternatives?.filter(e=>!e.includes(" ")&&e.length>1)||[];o.length>0&&a.push({type:"literal",value:o[0],alternatives:o.slice(1)});const s=t.roleMarkers.destination;s&&a.push({type:"group",optional:!0,tokens:[{type:"role",role:"destination",optional:!0},s.alternatives?{type:"literal",value:s.primary,alternatives:s.alternatives}:{type:"literal",value:s.primary}]}),a.push({type:"role",role:"patient",optional:!1});const l=t.roleMarkers.patient;l&&a.push(l.alternatives?{type:"literal",value:l.primary,alternatives:l.alternatives}:{type:"literal",value:l.primary});return a.push(r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary}),a.push(...uf(e,t.roleMarkers.source)),a.push(...pf(e,t.roleMarkers.destination)),{id:`${e.action}-event-${t.code}-sov-compact`,language:t.code,command:"on",priority:(i.basePriority??100)+52,template:{format:`{event}${o[0]||""} {patient} ${r.primary}`,tokens:a},extraction:{action:{value:e.action},event:{fromRole:"event"},patient:{fromRole:"patient"},...lf(e),...cf(e)}}}(e,t,a,i,r)),n.push(function(e,t,r,n,i){const a=[];if(a.push({type:"role",role:"event",optional:!1}),"after"===n.position){const e=n.primary.split(/\s+/);if(e.length>1)for(const t of e)a.push({type:"literal",value:t});else a.push(n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary})}return a.push(r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary}),{id:`${e.action}-event-${t.code}-sov-simple`,language:t.code,command:"on",priority:(i.basePriority??100)+48,template:{format:`{event} ${n.primary} ${r.primary}`,tokens:a},extraction:{action:{value:e.action},event:{fromRole:"event"},patient:{default:{type:"reference",value:"me"}}}}}(e,t,a,i,r));const u=function(e,t,r,n){const i=t.eventHandler?.temporalMarkers;if(!i||0===i.length)return null;const a=[];a.push({type:"role",role:"event",optional:!1}),t.possessive?.marker&&a.push({type:"group",optional:!0,tokens:[{type:"literal",value:t.possessive.marker}]}),a.push({type:"literal",value:i[0],alternatives:i.slice(1)}),a.push({type:"role",role:"patient",optional:!1});const o=t.roleMarkers.patient;o?.primary&&a.push(o.alternatives?{type:"literal",value:o.primary,alternatives:o.alternatives}:{type:"literal",value:o.primary});return a.push(r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary}),{id:`${e.action}-event-${t.code}-sov-temporal`,language:t.code,command:"on",priority:(n.basePriority??100)+49,template:{format:`{event} ${i[0]} {patient} ${r.primary}`,tokens:a},extraction:{action:{value:e.action},event:{fromRole:"event"},patient:{fromRole:"patient"}}}}(e,t,a,r);u&&n.push(u)}else"VSO"===t.wordOrder?o?(n.push($x(e,t,a,i,r)),n.push(function(e,t,r,n,i){const a=[];a.push(r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary});const o=[...e.roles.filter(e=>e.required)].sort((e,t)=>(e.svoPosition??999)-(t.svoPosition??999));for(const e of o){let r,n;if(e.markerOverride&&void 0!==e.markerOverride[t.code])r=e.markerOverride[t.code],n=r?ey(e,t.code,r):void 0;else{const i=t.roleMarkers[e.role];i&&(r=i.primary,n=_x(e,t,i))}r&&a.push(n?{type:"literal",value:r,alternatives:n}:{type:"literal",value:r}),a.push({type:"role",role:e.role,optional:!1})}"before"===n.position&&a.push(n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary});a.push({type:"role",role:"event",optional:!1});const s=o.map(e=>`{${e.role}}`).join(" "),l={action:{value:e.action},event:{fromRole:"event"},...Object.fromEntries(o.map(e=>[e.role,{fromRole:e.role}]))};return Ox(a,l,e),{id:`${e.action}-event-${t.code}-vso-verb-first-2role`,language:t.code,command:"on",priority:(i.basePriority??100)+48,template:{format:`${r.primary} ${s} ${n.primary} {event}`,tokens:a},extraction:l}}(e,t,a,i,r))):(n.push(qx(e,t,a,i,r)),n.push(function(e,t,r,n,i){const a=[];a.push(r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary});const o="swap"===e.action;a.push({type:"role",role:o?"destination":"patient",optional:!1});const s=o?void 0:t.roleMarkers.destination;s&&a.push({type:"group",optional:!0,tokens:[s.alternatives?{type:"literal",value:s.primary,alternatives:s.alternatives}:{type:"literal",value:s.primary},{type:"role",role:"destination",optional:!0}]}),a.push(...uf(e,t.roleMarkers.source)),"before"===n.position&&a.push(n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary});if(a.push({type:"role",role:"event",optional:!1}),o){const r=e.roles.find(e=>"patient"===e.role)?.markerOverride?.[t.code];r&&a.push({type:"group",optional:!0,tokens:[{type:"literal",value:r},{type:"role",role:"patient",optional:!1}]})}const l={action:{value:e.action},event:{fromRole:"event"},[o?"destination":"patient"]:{fromRole:o?"destination":"patient"},...o?{}:lf(e),...cf(e)};return Nx(a,l,e,t.code),{id:`${e.action}-event-${t.code}-vso-verb-first`,language:t.code,command:"on",priority:(i.basePriority??100)+45,template:{format:`${r.primary} {patient} ${s?.primary||""} {destination?} ${n.primary} {event}`,tokens:a},extraction:l}}(e,t,a,i,r)),t.eventHandler?.negationMarker&&n.push(function(e,t,r,n,i){const a=[],o=t.eventHandler?.negationMarker;"before"===n.position&&a.push(n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary});o&&a.push(o.alternatives?{type:"literal",value:o.primary,alternatives:o.alternatives}:{type:"literal",value:o.primary});a.push({type:"role",role:"event",optional:!1}),a.push(r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary}),a.push({type:"role",role:"patient",optional:!1});const s=t.roleMarkers.destination;return s&&a.push({type:"group",optional:!0,tokens:[s.alternatives?{type:"literal",value:s.primary,alternatives:s.alternatives}:{type:"literal",value:s.primary},{type:"role",role:"destination",optional:!0}]}),a.push(...uf(e,t.roleMarkers.source)),{id:`${e.action}-event-${t.code}-vso-negated`,language:t.code,command:"on",priority:(i.basePriority??100)+48,template:{format:`${n.primary} ${o?.primary||""} {event} ${r.primary} {patient} ${s?.primary||""} {destination?}`,tokens:a},extraction:{action:{value:e.action},event:{fromRole:"event"},patient:{fromRole:"patient"},...lf(e),...cf(e)}}}(e,t,a,i,r)),t.tokenization?.prefixes&&n.push(function(e,t,r,n){const i=[];i.push({type:"literal",value:"and",alternatives:["then"]}),i.push({type:"role",role:"event",optional:!1}),i.push(r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary}),i.push({type:"role",role:"patient",optional:!1});const a=t.roleMarkers.destination;return a&&i.push({type:"group",optional:!0,tokens:[a.alternatives?{type:"literal",value:a.primary,alternatives:a.alternatives}:{type:"literal",value:a.primary},{type:"role",role:"destination",optional:!0}]}),i.push(...uf(e,t.roleMarkers.source)),{id:`${e.action}-event-${t.code}-vso-proclitic`,language:t.code,command:"on",priority:(n.basePriority??100)+45,template:{format:`[proclitic?] {event} ${r.primary} {patient} ${a?.primary||""} {destination?}`,tokens:i},extraction:{action:{value:e.action},event:{fromRole:"event"},patient:{fromRole:"patient"},...lf(e),...cf(e)}}}(e,t,a,r))):n.push(o?$x(e,t,a,i,r):qx(e,t,a,i,r));return n}function Yx(e,t){const r=[],n=e.markerOverride?.[t.code],i=t.roleMarkers[e.role],a=""===e.renderOverride?.[t.code],o={type:"role",role:e.role,optional:!e.required,expectedTypes:e.expectedTypes,...void 0!==e.valueShape?{valueShape:e.valueShape}:{}},s=e.valuePrefixLiteral?.[t.code],l=()=>{s&&r.push({type:"literal",value:s}),r.push(o)};if(void 0!==n){const o=n?n.split(/\s+/).filter(Boolean):[],s=i?.position??"before",c=!0===e.markerOptional?.[t.code],u=n=>{const i=1===o.length?ey(e,t.code,n)??[]:[],s={type:"literal",value:n,...i.length?{alternatives:i}:{},...a?{renderSuppress:!0}:{}};r.push(c?{type:"group",optional:!0,tokens:[s]}:s)};if("before"===s){for(const e of o)u(e);l()}else{l();for(const e of o)u(e)}}else if(i){const n=()=>{const r=[...new Set([...i.alternatives??[],...ey(e,t.code,i.primary)??[]])].filter(e=>e!==i.primary);return{type:"literal",value:i.primary,...r.length?{alternatives:r}:{},...a?{renderSuppress:!0}:{}}},o=n=>{r.push(t.markersOptional||e.markerOptional?.[t.code]?{type:"group",optional:!0,tokens:[n]}:n)};"before"===i.position?(i.primary&&o(n()),l()):(l(),o(n()))}else l();return r}function Xx(e,t){const r=function(e,t){const r={};for(const n of e.roles){const e=n.markerOverride?.[t.code],i=t.roleMarkers[n.role];if(n.valuePrefixLiteral?.[t.code])r[n.role]={marker:n.valuePrefixLiteral[t.code]};else if(void 0!==e)if(e){const i=/\s/.test(e.trim())?[]:ey(n,t.code,e)??[];r[n.role]=i.length?{marker:e,markerAlternatives:i}:{marker:e}}else r[n.role]={};else if(i&&i.primary){const e=[...new Set([...i.alternatives??[],...ey(n,t.code,i.primary)??[]])].filter(e=>e!==i.primary);r[n.role]=e.length?{marker:i.primary,markerAlternatives:e}:{marker:i.primary}}else r[n.role]={}}return r}(e,t),n={};for(const t of e.roles){const e=r[t.role]||{};n[t.role]=!t.required&&t.default?{...e,default:t.default}:e}return n}var Jx,Qx,eE,tE,rE=Cd({"src/generators/pattern-generator.ts"(){wf(),jx(),ny(),Wx(),Dx(),Rf(),Vx={basePriority:100,generateSimpleVariants:!0,generateAlternatives:!0}}}),nE=Cd({"src/patterns/languages/en/fetch.ts"(){Jx=[{id:"fetch-en-with-options-as",language:"en",command:"fetch",priority:95,template:{format:"fetch {source} with {style} as {responseType}",tokens:[{type:"literal",value:"fetch"},{type:"role",role:"source",expectedTypes:["literal","expression"]},{type:"literal",value:"with",alternatives:["by","using"]},{type:"role",role:"style",expectedTypes:["expression"]},{type:"literal",value:"as"},{type:"role",role:"responseType",expectedTypes:["literal","expression"]}]},extraction:{source:{position:1},style:{marker:"with"},responseType:{marker:"as"}}},{id:"fetch-en-with-options",language:"en",command:"fetch",priority:93,template:{format:"fetch {source} with {style}",tokens:[{type:"literal",value:"fetch"},{type:"role",role:"source",expectedTypes:["literal","expression"]},{type:"literal",value:"with",alternatives:["by","using"]},{type:"role",role:"style",expectedTypes:["expression"]}]},extraction:{source:{position:1},style:{marker:"with"}}},{id:"fetch-en-with-response-type",language:"en",command:"fetch",priority:90,template:{format:"fetch {source} as {responseType}",tokens:[{type:"literal",value:"fetch"},{type:"role",role:"source",expectedTypes:["literal","expression"]},{type:"literal",value:"as"},{type:"role",role:"responseType",expectedTypes:["literal","expression"]}]},extraction:{source:{position:1},responseType:{marker:"as"}}},{id:"fetch-en-simple",language:"en",command:"fetch",priority:80,template:{format:"fetch {source}",tokens:[{type:"literal",value:"fetch"},{type:"role",role:"source"}]},extraction:{source:{position:1}}}]}}),iE=Cd({"src/patterns/languages/en/pick.ts"(){Qx=[{id:"pick-en-variant",language:"en",command:"pick",priority:110,template:{format:"pick {method} {patient} of {source}",tokens:[{type:"literal",value:"pick"},{type:"role",role:"method",expectedTypes:["literal","expression"]},{type:"role",role:"patient",expectedTypes:["literal","expression"]},{type:"literal",value:"of",alternatives:["from"]},{type:"role",role:"source",expectedTypes:["selector","reference","expression"]}]},extraction:{method:{position:1},patient:{position:2},source:{marker:"of",markerAlternatives:["from"]}}}]}}),aE=Cd({"src/patterns/languages/en/swap.ts"(){tE=[{id:"swap-en-strategy-of",language:"en",command:"swap",priority:140,template:{format:"swap {method} of {destination} with {patient} [using view {manner}]",tokens:[{type:"literal",value:"swap"},{type:"role",role:"method"},{type:"literal",value:"of"},{type:"role",role:"destination"},{type:"literal",value:"with"},{type:"role",role:"patient"},eE={type:"group",optional:!0,tokens:[{type:"literal",value:"using"},{type:"literal",value:"view"},{type:"role",role:"manner",optional:!0,expectedTypes:["literal","expression"],valueShape:"keyword"}]}]},extraction:{}},{id:"swap-en-strategy",language:"en",command:"swap",priority:130,template:{format:"swap {method} {destination} with {patient} [using view {manner}]",tokens:[{type:"literal",value:"swap"},{type:"role",role:"method"},{type:"role",role:"destination"},{type:"literal",value:"with"},{type:"role",role:"patient"},eE]},extraction:{}},{id:"swap-en-element",language:"en",command:"swap",priority:120,template:{format:"swap {destination} with {patient} [using view {manner}]",tokens:[{type:"literal",value:"swap"},{type:"role",role:"destination"},{type:"literal",value:"with"},{type:"role",role:"patient"},eE]},extraction:{}},{id:"swap-en-handcrafted",language:"en",command:"swap",priority:110,template:{format:"swap {method} {destination} [using view {manner}]",tokens:[{type:"literal",value:"swap"},{type:"role",role:"method"},{type:"role",role:"destination"},eE]},extraction:{method:{position:1},destination:{position:2}}}]}});function oE(e){switch(e){case"bn":return[{id:"toggle-bn-full",language:"bn",command:"toggle",priority:100,template:{format:"{patient} \u0995\u09c7 \u099f\u0997\u09b2 \u0995\u09b0\u09c1\u09a8",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0995\u09c7"},{type:"literal",value:"\u099f\u0997\u09b2",alternatives:["\u09aa\u09b0\u09bf\u09ac\u09b0\u09cd\u09a4\u09a8"]},{type:"literal",value:"\u0995\u09b0\u09c1\u09a8"}]},extraction:{patient:{position:0}}},{id:"toggle-bn-simple",language:"bn",command:"toggle",priority:90,template:{format:"\u099f\u0997\u09b2 {patient}",tokens:[{type:"literal",value:"\u099f\u0997\u09b2",alternatives:["\u09aa\u09b0\u09bf\u09ac\u09b0\u09cd\u09a4\u09a8"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}},{id:"toggle-bn-with-dest",language:"bn",command:"toggle",priority:95,template:{format:"{destination} \u098f {patient} \u0995\u09c7 \u099f\u0997\u09b2 \u0995\u09b0\u09c1\u09a8",tokens:[{type:"role",role:"destination"},{type:"literal",value:"\u098f",alternatives:["\u09a4\u09c7"]},{type:"role",role:"patient"},{type:"literal",value:"\u0995\u09c7"},{type:"literal",value:"\u099f\u0997\u09b2",alternatives:["\u09aa\u09b0\u09bf\u09ac\u09b0\u09cd\u09a4\u09a8"]},{type:"literal",value:"\u0995\u09b0\u09c1\u09a8"}]},extraction:{destination:{position:0},patient:{position:2}}}];case"en":return[{id:"toggle-en-full",language:"en",command:"toggle",priority:100,template:{format:"toggle {patient} on {target}",tokens:[{type:"literal",value:"toggle"},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"on",alternatives:["from"]},{type:"role",role:"destination"}]}]},extraction:{patient:{position:1},destination:{marker:"on",markerAlternatives:["from"],default:{type:"reference",value:"me"}}}},{id:"toggle-en-simple",language:"en",command:"toggle",priority:90,template:{format:"toggle {patient}",tokens:[{type:"literal",value:"toggle"},{type:"role",role:"patient"}]},extraction:{patient:{position:1},destination:{default:{type:"reference",value:"me"}}}}];case"es":return[{id:"toggle-es-full",language:"es",command:"toggle",priority:100,template:{format:"alternar {patient} en {target}",tokens:[{type:"literal",value:"alternar",alternatives:["cambiar","toggle"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"en",alternatives:["sobre","de"]},{type:"role",role:"destination"}]}]},extraction:{patient:{position:1},destination:{marker:"en",markerAlternatives:["sobre","de"],default:{type:"reference",value:"me"}}}},{id:"toggle-es-simple",language:"es",command:"toggle",priority:90,template:{format:"alternar {patient}",tokens:[{type:"literal",value:"alternar",alternatives:["cambiar","toggle"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},destination:{default:{type:"reference",value:"me"}}}}];case"hi":return[{id:"toggle-hi-full",language:"hi",command:"toggle",priority:100,template:{format:"{patient} \u0915\u094b {destination} \u092a\u0930 \u091f\u0949\u0917\u0932 \u0915\u0930\u0947\u0902",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0915\u094b"},{type:"role",role:"destination"},{type:"literal",value:"\u092a\u0930"},{type:"literal",value:"\u091f\u0949\u0917\u0932",alternatives:["\u092c\u0926\u0932\u0947\u0902","\u092c\u0926\u0932"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0915\u0930\u0947\u0902",alternatives:["\u0915\u0930\u094b"]}]}]},extraction:{patient:{position:0},destination:{marker:"\u0915\u094b",position:2}}},{id:"toggle-hi-simple",language:"hi",command:"toggle",priority:90,template:{format:"{patient} \u091f\u0949\u0917\u0932 \u0915\u0930\u0947\u0902",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u091f\u0949\u0917\u0932",alternatives:["\u092c\u0926\u0932\u0947\u0902","\u092c\u0926\u0932"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0915\u0930\u0947\u0902",alternatives:["\u0915\u0930\u094b"]}]}]},extraction:{patient:{position:0},destination:{default:{type:"reference",value:"me"}}}},{id:"toggle-hi-bare",language:"hi",command:"toggle",priority:80,template:{format:"\u091f\u0949\u0917\u0932 {patient}",tokens:[{type:"literal",value:"\u091f\u0949\u0917\u0932",alternatives:["\u092c\u0926\u0932\u0947\u0902","\u092c\u0926\u0932"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},destination:{default:{type:"reference",value:"me"}}}}];case"it":return[{id:"toggle-it-full",language:"it",command:"toggle",priority:100,template:{format:"commutare {patient} su {target}",tokens:[{type:"literal",value:"commutare",alternatives:["alternare","toggle","cambiare"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"su",alternatives:["in","di"]},{type:"role",role:"destination"}]}]},extraction:{patient:{position:1},destination:{marker:"su",markerAlternatives:["in","di"],default:{type:"reference",value:"me"}}}},{id:"toggle-it-simple",language:"it",command:"toggle",priority:90,template:{format:"commutare {patient}",tokens:[{type:"literal",value:"commutare",alternatives:["alternare","toggle","cambiare"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},destination:{default:{type:"reference",value:"me"}}}}];case"pl":return[{id:"toggle-pl-full",language:"pl",command:"toggle",priority:100,template:{format:"prze\u0142\u0105cz {patient} na {destination}",tokens:[{type:"literal",value:"prze\u0142\u0105cz",alternatives:["przelacz","prze\u0142\u0105czaj"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"na",alternatives:["w","dla"]},{type:"role",role:"destination"}]}]},extraction:{patient:{position:1},destination:{marker:"na",markerAlternatives:["w","dla"],default:{type:"reference",value:"me"}}}},{id:"toggle-pl-simple",language:"pl",command:"toggle",priority:90,template:{format:"prze\u0142\u0105cz {patient}",tokens:[{type:"literal",value:"prze\u0142\u0105cz",alternatives:["przelacz","prze\u0142\u0105czaj"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},destination:{default:{type:"reference",value:"me"}}}}];case"qu":return[{id:"toggle-qu-sov",language:"qu",command:"toggle",priority:100,template:{format:"{patient} ta t'ikray",tokens:[{type:"role",role:"patient"},{type:"literal",value:"ta"},{type:"literal",value:"t'ikray",alternatives:["tikray","kutichiy"]}]},extraction:{patient:{position:0}}},{id:"toggle-qu-simple",language:"qu",command:"toggle",priority:90,template:{format:"t'ikray {patient}",tokens:[{type:"literal",value:"t'ikray",alternatives:["tikray","kutichiy"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}},{id:"toggle-qu-with-dest",language:"qu",command:"toggle",priority:95,template:{format:"{destination} pi {patient} ta t'ikray",tokens:[{type:"role",role:"destination"},{type:"literal",value:"pi"},{type:"role",role:"patient"},{type:"literal",value:"ta"},{type:"literal",value:"t'ikray",alternatives:["tikray","kutichiy"]}]},extraction:{destination:{position:0},patient:{position:2}}},{id:"toggle-qu-dest-man",language:"qu",command:"toggle",priority:93,template:{format:"{destination} man {patient} ta t'ikray",tokens:[{type:"role",role:"destination"},{type:"literal",value:"man"},{type:"role",role:"patient"},{type:"literal",value:"ta"},{type:"literal",value:"t'ikray",alternatives:["tikray","kutichiy"]}]},extraction:{destination:{position:0},patient:{position:2}}},{id:"toggle-qu-patient-first-dest",language:"qu",command:"toggle",priority:102,template:{format:"{patient} ta {destination} man t'ikray",tokens:[{type:"role",role:"patient"},{type:"literal",value:"ta"},{type:"role",role:"destination"},{type:"literal",value:"man",alternatives:["pa"]},{type:"literal",value:"t'ikray",alternatives:["tikray","kutichiy"]}]},extraction:{patient:{position:0},destination:{position:2}}}];case"ru":return[{id:"toggle-ru-full",language:"ru",command:"toggle",priority:100,template:{format:"\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c {patient} \u043d\u0430 {destination}",tokens:[{type:"literal",value:"\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c",alternatives:["\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u043d\u0430",alternatives:["\u0432","\u0434\u043b\u044f"]},{type:"role",role:"destination"}]}]},extraction:{patient:{position:1},destination:{marker:"\u043d\u0430",markerAlternatives:["\u0432","\u0434\u043b\u044f"],default:{type:"reference",value:"me"}}}},{id:"toggle-ru-simple",language:"ru",command:"toggle",priority:90,template:{format:"\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c {patient}",tokens:[{type:"literal",value:"\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c",alternatives:["\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},destination:{default:{type:"reference",value:"me"}}}}];case"th":return[{id:"toggle-th-simple",language:"th",command:"toggle",priority:100,template:{format:"\u0e2a\u0e25\u0e31\u0e1a {patient}",tokens:[{type:"literal",value:"\u0e2a\u0e25\u0e31\u0e1a"},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}},{id:"toggle-th-with-dest",language:"th",command:"toggle",priority:95,template:{format:"\u0e2a\u0e25\u0e31\u0e1a {patient} \u0e43\u0e19 {destination}",tokens:[{type:"literal",value:"\u0e2a\u0e25\u0e31\u0e1a"},{type:"role",role:"patient"},{type:"literal",value:"\u0e43\u0e19"},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"\u0e43\u0e19",position:3}}}];case"uk":return[{id:"toggle-uk-full",language:"uk",command:"toggle",priority:100,template:{format:"\u043f\u0435\u0440\u0435\u043c\u043a\u043d\u0443\u0442\u0438 {patient} \u043d\u0430 {destination}",tokens:[{type:"literal",value:"\u043f\u0435\u0440\u0435\u043c\u043a\u043d\u0443\u0442\u0438",alternatives:["\u043f\u0435\u0440\u0435\u043c\u043a\u043d\u0438"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u043d\u0430",alternatives:["\u0432","\u0434\u043b\u044f"]},{type:"role",role:"destination"}]}]},extraction:{patient:{position:1},destination:{marker:"\u043d\u0430",markerAlternatives:["\u0432","\u0434\u043b\u044f"],default:{type:"reference",value:"me"}}}},{id:"toggle-uk-simple",language:"uk",command:"toggle",priority:90,template:{format:"\u043f\u0435\u0440\u0435\u043c\u043a\u043d\u0443\u0442\u0438 {patient}",tokens:[{type:"literal",value:"\u043f\u0435\u0440\u0435\u043c\u043a\u043d\u0443\u0442\u0438",alternatives:["\u043f\u0435\u0440\u0435\u043c\u043a\u043d\u0438"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},destination:{default:{type:"reference",value:"me"}}}}];case"vi":return[{id:"toggle-vi-full",language:"vi",command:"toggle",priority:100,template:{format:"chuy\u1ec3n \u0111\u1ed5i {patient} tr\u00ean {target}",tokens:[{type:"literal",value:"chuy\u1ec3n \u0111\u1ed5i",alternatives:["chuy\u1ec3n","b\u1eadt t\u1eaft"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"tr\u00ean",alternatives:["t\u1ea1i","\u1edf"]},{type:"role",role:"destination"}]}]},extraction:{patient:{position:1},destination:{marker:"tr\u00ean",markerAlternatives:["t\u1ea1i","\u1edf"],default:{type:"reference",value:"me"}}}},{id:"toggle-vi-simple",language:"vi",command:"toggle",priority:90,template:{format:"chuy\u1ec3n \u0111\u1ed5i {patient}",tokens:[{type:"literal",value:"chuy\u1ec3n \u0111\u1ed5i",alternatives:["chuy\u1ec3n","b\u1eadt t\u1eaft"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},destination:{default:{type:"reference",value:"me"}}}}];case"zh":return[{id:"toggle-zh-full",language:"zh",command:"toggle",priority:100,template:{format:"\u5207\u6362 {patient} \u5728 {target}",tokens:[{type:"literal",value:"\u5207\u6362"},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u5728",alternatives:["\u5230","\u4e8e"]},{type:"role",role:"destination"}]}]},extraction:{patient:{position:1},destination:{marker:"\u5728",markerAlternatives:["\u5230","\u4e8e"],default:{type:"reference",value:"me"}}}},{id:"toggle-zh-simple",language:"zh",command:"toggle",priority:90,template:{format:"\u5207\u6362 {patient}",tokens:[{type:"literal",value:"\u5207\u6362"},{type:"role",role:"patient"}]},extraction:{patient:{position:1},destination:{default:{type:"reference",value:"me"}}}},{id:"toggle-zh-ba",language:"zh",command:"toggle",priority:95,template:{format:"\u628a {patient} \u5207\u6362",tokens:[{type:"literal",value:"\u628a"},{type:"role",role:"patient"},{type:"literal",value:"\u5207\u6362"}]},extraction:{patient:{marker:"\u628a"},destination:{default:{type:"reference",value:"me"}}}},{id:"toggle-zh-full-ba",language:"zh",command:"toggle",priority:98,template:{format:"\u5728 {target} \u628a {patient} \u5207\u6362",tokens:[{type:"literal",value:"\u5728",alternatives:["\u5230","\u4e8e"]},{type:"role",role:"destination"},{type:"literal",value:"\u628a"},{type:"role",role:"patient"},{type:"literal",value:"\u5207\u6362"}]},extraction:{destination:{marker:"\u5728",markerAlternatives:["\u5230","\u4e8e"]},patient:{marker:"\u628a"}}}];default:return[]}}var sE,lE,cE,uE,pE,dE,mE,fE,hE,yE,vE,gE=Cd({"src/patterns/toggle.ts"(){}});function kE(e,t,r,n){const i=[];return i.push({type:"literal",value:t}),n&&i.push({type:"literal",value:n}),i.push({type:"role",role:"quantity",expectedTypes:["literal","expression"]}),i.push({type:"literal",value:r}),{id:`repeat-${e}-times`,language:e,command:"repeat",priority:110,template:{format:`${t}${n?" "+n:""} {quantity} ${r}`,tokens:i},extraction:{loopType:{default:{type:"literal",value:"times"}}}}}function wE(e,t,r){return{id:`repeat-${e}-times`,language:e,command:"repeat",priority:110,template:{format:`{quantity} ${t} ${r} repeat`,tokens:[{type:"role",role:"quantity",expectedTypes:["literal","expression"]},{type:"literal",value:t},{type:"literal",value:r},{type:"literal",value:"repeat"}]},extraction:{loopType:{default:{type:"literal",value:"times"}}}}}function bE(e,t){const r=[{type:"literal",value:"repeat"}];if(t.forWords&&t.forWords.length>0)if(t.requireForWords)for(const e of t.forWords)r.push({type:"literal",value:e});else r.push({type:"group",optional:!0,tokens:t.forWords.map(e=>({type:"literal",value:e}))});r.push({type:"role",role:"patient",expectedTypes:["expression","reference"]});for(const e of t.inWords)r.push({type:"literal",value:e});return r.push({type:"role",role:"source",expectedTypes:["selector","expression","reference"]}),{id:`repeat-${e}-for-in`,language:e,command:"repeat",priority:110,template:{format:`repeat [${(t.forWords??[]).join(" ")}] {patient} ${t.inWords.join(" ")} {source}`,tokens:r},extraction:{loopType:{default:{type:"literal",value:"for"}}}}}function zE(e,t){const r=[{type:"literal",value:"repeat"}];for(const e of t.pre??[])r.push({type:"literal",value:e});return r.push({type:"literal",value:t.whileWord}),r.push({type:"role",role:"condition",expectedTypes:["property-path","expression"]}),{id:`repeat-${e}-while-head`,language:e,command:"repeat",priority:110,template:{format:`repeat ${(t.pre??[]).join(" ")} ${t.whileWord} {condition}`,tokens:r},extraction:{loopType:{default:{type:"literal",value:"while"}}}}}function xE(e,t){const r=[{type:"literal",value:"repeat"}];for(const e of t.pre??[])r.push({type:"literal",value:e});return r.push({type:"literal",value:t.untilWord}),t.preEvent&&r.push({type:"literal",value:t.preEvent}),r.push({type:"literal",value:t.eventWord}),r.push({type:"role",role:"event",expectedTypes:["literal","expression"]}),r.push({type:"group",optional:!0,tokens:[{type:"literal",value:t.fromWord},{type:"role",role:"source",expectedTypes:["selector","reference","expression"]}]}),{id:`repeat-${e}-until-head`,language:e,command:"repeat",priority:110,template:{format:`repeat ${t.untilWord} ${t.eventWord} {event} [${t.fromWord} {source}]`,tokens:r},extraction:{loopType:{default:{type:"literal",value:"until-event"}}}}}function EE(e,t){return{id:`repeat-${e}-until-head`,language:e,command:"repeat",priority:110,template:{format:`${t.untilWord} ${t.eventWord} {event} ${t.objMarker} repeat [{source} ${t.fromWord}]`,tokens:[{type:"literal",value:t.untilWord},{type:"literal",value:t.eventWord},{type:"role",role:"event",expectedTypes:["literal","expression"]},{type:"literal",value:t.objMarker},{type:"literal",value:"repeat"},{type:"group",optional:!0,tokens:[{type:"role",role:"source",expectedTypes:["selector","reference","expression"]},{type:"literal",value:t.fromWord}]}]},extraction:{loopType:{default:{type:"literal",value:"until-event"}}}}}function TE(e,t){return{id:`repeat-${e}-until-head-verb-final`,language:e,command:"repeat",priority:111,template:{format:`${t.untilWord} ${t.eventWord} {event} ${t.objMarker} {source} ${t.fromWord} repeat`,tokens:[{type:"literal",value:t.untilWord},{type:"literal",value:t.eventWord},{type:"role",role:"event",expectedTypes:["literal","expression"]},{type:"literal",value:t.objMarker},{type:"role",role:"source",expectedTypes:["selector","reference","expression"]},{type:"literal",value:t.fromWord},{type:"literal",value:"repeat"}]},extraction:{loopType:{default:{type:"literal",value:"until-event"}}}}}function SE(e,t){return{id:`for-${e}-sov-basic`,language:e,command:"for",priority:105,template:{format:`{patient} ${t.inWords.join(" ")} {source} [${t.objMarker}] ${t.forVerb}`,tokens:[{type:"role",role:"patient",expectedTypes:["expression","reference"]},...t.inWords.map(e=>({type:"literal",value:e})),{type:"role",role:"source",expectedTypes:["selector","expression","reference"]},{type:"group",optional:!0,tokens:[{type:"literal",value:t.objMarker}]},{type:"literal",value:t.forVerb}]},extraction:{patient:{position:0}}}}function CE(e){return yE.get(e)??[]}var AE=Cd({"src/patterns/repeat.ts"(){sE=[["es","repetir","times"],["de","wiederholen","times"],["fr","r\u00e9p\u00e9ter","times"],["it","ripetere","times"],["pt","repetir","times"],["ru","\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c","times"],["uk","\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0438","times"],["pl","powt\u00f3rz","times"],["ar","\u0643\u0631\u0631","times"],["he","\u05d7\u05d6\u05d5\u05e8","times","\u05d0\u05ea"],["id","ulangi","times"],["ms","ulang","kali"],["sw","rudia","times"],["th","\u0e17\u0e33\u0e0b\u0e49\u0e33","\u0e04\u0e23\u0e31\u0e49\u0e07"],["vi","l\u1eb7p l\u1ea1i","l\u1ea7n"],["tl","ulitin","beses"],["zh","\u91cd\u590d","times","\u628a"]],lE=[["ja","times","\u3092"],["ko","times","\ub97c"],["tr","times","i"],["hi","times","\u0915\u094b"],["bn","\u09ac\u09be\u09b0","\u0995\u09c7"],["qu","times","ta"]],cE=[["en",{forWords:["for"],inWords:["in"],requireForWords:!0}],["es",{forWords:["para"],inWords:["en"]}],["pt",{forWords:["para"],inWords:["dentro"]}],["fr",{forWords:["pour"],inWords:["en"]}],["it",{forWords:["per"],inWords:["in"]}],["de",{forWords:["f\u00fcr"],inWords:["in"]}],["ru",{forWords:["\u0434\u043b\u044f"],inWords:["\u0432"]}],["uk",{forWords:["\u0434\u043b\u044f"],inWords:["\u0443"]}],["pl",{forWords:["dla"],inWords:["w"]}],["ar",{forWords:["\u0644\u0643\u0644"],inWords:["\u0641\u064a"]}],["he",{forWords:["\u05e2\u05d1\u05d5\u05e8","\u05d0\u05ea"],inWords:["in"]}],["hi",{inWords:["\u092e\u0947\u0902"]}],["bn",{inWords:["\u098f"]}],["ja",{inWords:["\u306e\u4e2d"]}],["ko",{inWords:["\uc548\uc5d0"]}],["zh",{forWords:["\u4e3a","\u628a"],inWords:["\u5728"]}],["tr",{inWords:["i\u00e7inde"]}],["id",{forWords:["untuk"],inWords:["dalam"]}],["ms",{forWords:["untuk"],inWords:["dalam"]}],["sw",{forWords:["kwa"],inWords:["ndani"]}],["th",{forWords:["\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a"],inWords:["\u0e43\u0e19"]}],["vi",{forWords:["v\u1edbi m\u1ed7i"],inWords:["trong"]}],["tl",{forWords:["para_sa"],inWords:["sa_loob"]}],["qu",{inWords:["ukupi"]}]],uE=[["en",{whileWord:"while"}],["es",{whileWord:"mientras"}],["pt",{whileWord:"enquanto"}],["fr",{whileWord:"tantque"}],["it",{whileWord:"mentre"}],["de",{whileWord:"w\u00e4hrend"}],["ru",{whileWord:"\u043f\u043e\u043a\u0430"}],["uk",{whileWord:"\u043f\u043e\u043a\u0438"}],["pl",{whileWord:"dop\u00f3ki"}],["ar",{whileWord:"\u0628\u064a\u0646\u0645\u0627"}],["he",{pre:["\u05d0\u05ea"],whileWord:"\u05db\u05dc \u05e2\u05d5\u05d3"}],["zh",{pre:["\u628a"],whileWord:"\u5f53"}],["id",{whileWord:"selama"}],["ms",{whileWord:"selagi"}],["sw",{whileWord:"wakati"}],["th",{whileWord:"\u0e43\u0e19\u0e02\u0e13\u0e30\u0e17\u0e35\u0e48"}],["vi",{whileWord:"trong khi"}],["tl",{whileWord:"habang"}]],pE=[["es",{untilWord:"hasta",eventWord:"evento",fromWord:"de"}],["pt",{untilWord:"at\u00e9",eventWord:"evento",fromWord:"de"}],["fr",{untilWord:"jusqu\u00e0",eventWord:"\u00e9v\u00e9nement",fromWord:"de"}],["it",{untilWord:"fino",eventWord:"evento",fromWord:"da"}],["de",{untilWord:"bis",eventWord:"ereignis",fromWord:"von"}],["ru",{untilWord:"\u0434\u043e",eventWord:"\u0441\u043e\u0431\u044b\u0442\u0438\u0435",fromWord:"\u0438\u0437"}],["uk",{untilWord:"\u0434\u043e",eventWord:"\u043f\u043e\u0434\u0456\u044f",fromWord:"\u0437"}],["pl",{untilWord:"a\u017c",eventWord:"zdarzenie",fromWord:"z"}],["ar",{untilWord:"\u062d\u062a\u0649",eventWord:"\u062d\u062f\u062b",fromWord:"\u0645\u0646"}],["he",{untilWord:"\u05e2\u05d3",preEvent:"\u05d0\u05ea",eventWord:"\u05d0\u05d9\u05e8\u05d5\u05e2",fromWord:"\u05de"}],["id",{untilWord:"sampai",eventWord:"peristiwa",fromWord:"dari"}],["ms",{untilWord:"sehingga",eventWord:"peristiwa",fromWord:"dari"}],["sw",{untilWord:"hadi",eventWord:"tukio",fromWord:"kutoka"}],["th",{untilWord:"\u0e08\u0e19\u0e16\u0e36\u0e07",eventWord:"\u0e40\u0e2b\u0e15\u0e38\u0e01\u0e32\u0e23\u0e13\u0e4c",fromWord:"\u0e08\u0e32\u0e01"}],["vi",{untilWord:"cho \u0111\u1ebfn khi",eventWord:"s\u1ef1 ki\u1ec7n",fromWord:"t\u1eeb"}],["tl",{untilWord:"hanggang",eventWord:"pangyayari",fromWord:"mula_sa"}],["zh",{pre:["\u628a"],untilWord:"\u76f4\u5230",eventWord:"\u4e8b\u4ef6",fromWord:"\u4ece"}]],dE={id:"repeat-qu-midclause-until-head",language:"qu",command:"repeat",priority:109,template:{format:"until event {event} ta {source} manta repeat",tokens:[{type:"literal",value:"until"},{type:"literal",value:"event"},{type:"role",role:"event",expectedTypes:["literal","expression"]},{type:"literal",value:"ta"},{type:"role",role:"source",expectedTypes:["selector","reference","expression"]},{type:"literal",value:"manta"},{type:"literal",value:"repeat"}]},extraction:{loopType:{default:{type:"literal",value:"until-event"}}}},mE=[["hi",{untilWord:"\u0924\u0915",eventWord:"\u0918\u091f\u0928\u093e",objMarker:"\u0915\u094b",fromWord:"\u0938\u0947"}],["bn",{untilWord:"\u09aa\u09b0\u09cd\u09af\u09a8\u09cd\u09a4",eventWord:"\u0998\u099f\u09a8\u09be",objMarker:"\u0995\u09c7",fromWord:"\u09a5\u09c7\u0995\u09c7"}],["ja",{untilWord:"\u307e\u3067",eventWord:"\u30a4\u30d9\u30f3\u30c8",objMarker:"\u3092",fromWord:"\u304b\u3089"}],["ko",{untilWord:"\uae4c\uc9c0",eventWord:"\uc774\ubca4\ud2b8",objMarker:"\ub97c",fromWord:"\uc5d0\uc11c"}],["tr",{untilWord:"kadar",eventWord:"olay",objMarker:"i",fromWord:"den"}]],fE={id:"repeat-qu-until-head",language:"qu",command:"repeat",priority:110,template:{format:"hayk _ a until event {event} ta {source} manta repeat",tokens:[{type:"literal",value:"hayk"},{type:"literal",value:"_"},{type:"literal",value:"a"},{type:"literal",value:"until"},{type:"literal",value:"event"},{type:"role",role:"event",expectedTypes:["literal","expression"]},{type:"literal",value:"ta"},{type:"role",role:"source",expectedTypes:["selector","reference","expression"]},{type:"literal",value:"manta"},{type:"literal",value:"repeat"}]},extraction:{loopType:{default:{type:"literal",value:"until-event"}}}},hE=[["ja",{inWords:["\u306e\u4e2d"],objMarker:"\u3092",forVerb:"\u305f\u3081\u306b"}],["ko",{inWords:["\uc548\uc5d0"],objMarker:"\ub97c",forVerb:"\uac01\uac01"}],["tr",{inWords:["i\u00e7inde"],objMarker:"i",forVerb:"i\u00e7in"}],["qu",{inWords:["ukupi"],objMarker:"ta",forVerb:"sapankaq"}],["bn",{inWords:["\u098f"],objMarker:"\u0995\u09c7",forVerb:"\u099c\u09a8\u09cd\u09af"}],["hi",{inWords:["\u092e\u0947\u0902"],objMarker:"\u0915\u094b",forVerb:"\u0939\u0947\u0924\u0941"}]],yE=new Map,vE=(e,t)=>{const r=yE.get(e);r?r.push(t):yE.set(e,[t])};for(const[e,t,r,n]of sE)vE(e,kE(e,t,r,n));for(const[e,t,r]of lE)vE(e,wE(e,t,r));for(const[e,t]of cE)vE(e,bE(e,t));for(const[e,t]of hE)vE(e,SE(e,t));for(const[e,t]of uE)vE(e,zE(e,t));for(const[e,t]of pE)vE(e,xE(e,t));for(const[e,t]of mE)vE(e,EE(e,t)),"tr"===e&&vE(e,TE(e,t));vE("qu",fE),vE("qu",dE)}});function LE(e,t,r,n,i,a,o){const s=()=>({type:"group",optional:!0,tokens:[{type:"literal",value:"("},...Array.from({length:a},(e,t)=>[...t>0?[{type:"literal",value:","}]:[],{type:"role",role:"condition",expectedTypes:["expression","literal","reference"]}]).flat(),{type:"literal",value:")"}]});return{id:e,language:t,command:"wait",priority:105,template:{format:`{source} ${n} {duration} ${i} {patient} ${r}`,tokens:[{type:"role",role:"source",expectedTypes:["expression","reference"]},{type:"literal",value:n,...o?{alternatives:o}:{}},{type:"role",role:"duration",expectedTypes:["expression","literal"]},s(),{type:"literal",value:i},{type:"role",role:"patient",expectedTypes:["expression","literal"]},s(),{type:"literal",value:r}]},extraction:{source:{position:0},duration:{position:2}}}}function jE(e,t,r,n,i,a,o){const s=()=>({type:"group",optional:!0,tokens:[{type:"literal",value:"("},...Array.from({length:o},(e,t)=>[...t>0?[{type:"literal",value:","}]:[],{type:"role",role:"condition",expectedTypes:["expression","literal","reference"]}]).flat(),{type:"literal",value:")"}]}),l=()=>({type:"group",optional:!0,tokens:[{type:"literal",value:i}]});return{id:e,language:t,command:"wait",priority:105,template:{format:`${r} {duration} ${n} [${i}] {patient} [${i}] {source} ${a}`,tokens:[{type:"literal",value:r},{type:"role",role:"duration",expectedTypes:["expression","literal"]},s(),{type:"literal",value:n},l(),{type:"role",role:"patient",expectedTypes:["expression","literal"]},s(),l(),{type:"role",role:"source",expectedTypes:["expression","reference"]},{type:"literal",value:a}]},extraction:{duration:{position:1},source:{position:8}}}}function PE(e){switch(e){case"en":return[{id:"wait-en-for-event",language:"en",command:"wait",priority:110,template:{format:"wait for {event}",tokens:[{type:"literal",value:"wait"},{type:"literal",value:"for"},{type:"role",role:"event",expectedTypes:["literal","expression"]}]},extraction:{event:{position:2}}}];case"zh":return[{id:"wait-zh-ba",language:"zh",command:"wait",priority:105,template:{format:"\u7b49\u5f85 \u628a {duration}",tokens:[{type:"literal",value:"\u7b49\u5f85",alternatives:["\u7b49","\u7a0d\u5019"]},{type:"literal",value:"\u628a"},{type:"role",role:"duration",expectedTypes:["literal","expression"]}]},extraction:{duration:{position:2}}}];case"he":return[{id:"wait-he-et",language:"he",command:"wait",priority:105,template:{format:"\u05d7\u05db\u05d4 \u05d0\u05ea {duration}",tokens:[{type:"literal",value:"\u05d7\u05db\u05d4",alternatives:["\u05d4\u05de\u05ea\u05df"]},{type:"literal",value:"\u05d0\u05ea"},{type:"role",role:"duration",expectedTypes:["literal","expression"]}]},extraction:{duration:{position:2}}}];case"ar":return[{id:"wait-ar-from-first",language:"ar",command:"wait",priority:105,template:{format:"\u0627\u0646\u062a\u0638\u0631 \u0645\u0646 {source} {duration}",tokens:[{type:"literal",value:"\u0627\u0646\u062a\u0638\u0631",alternatives:["\u0627\u0646\u062a\u0638\u0631\u064a"]},{type:"literal",value:"\u0645\u0646"},{type:"role",role:"source",expectedTypes:["expression","reference"]},{type:"role",role:"duration",expectedTypes:["expression","literal"]}]},extraction:{source:{position:2},duration:{position:3}}}];case"bn":return[jE("wait-bn-or-run","bn","\u0985\u09aa\u09c7\u0995\u09cd\u09b7\u09be","\u0985\u09a5\u09ac\u09be","\u099c\u09a8\u09cd\u09af","\u09a5\u09c7\u0995\u09c7",1),jE("wait-bn-or-run-2arg","bn","\u0985\u09aa\u09c7\u0995\u09cd\u09b7\u09be","\u0985\u09a5\u09ac\u09be","\u099c\u09a8\u09cd\u09af","\u09a5\u09c7\u0995\u09c7",2)];case"tl":return[{id:"wait-tl-from-first",language:"tl",command:"wait",priority:105,template:{format:"maghintay mula_sa {source} {duration}",tokens:[{type:"literal",value:"maghintay",alternatives:["hintay"]},{type:"literal",value:"mula_sa",alternatives:["galing_sa"]},{type:"role",role:"source",expectedTypes:["expression","reference"]},{type:"role",role:"duration",expectedTypes:["expression","literal"]}]},extraction:{source:{position:2},duration:{position:3}}}];case"tr":return[LE("wait-tr-or-run","tr","bekle","den","veya",1,["dan","ten","tan"]),LE("wait-tr-or-run-2arg","tr","bekle","den","veya",2,["dan","ten","tan"])];case"qu":return[LE("wait-qu-or-run","qu","suyay","manta","utaq",1),LE("wait-qu-or-run-2arg","qu","suyay","manta","utaq",2)];default:return[]}}var OE,NE,RE,ME,IE,WE,_E,qE,$E,VE,DE=Cd({"src/patterns/wait.ts"(){}}),BE={};function HE(){const e=[];e.push(...oE("en")),e.push(...oy("en")),e.push(...Cx("en")),e.push(...CE("en")),e.push(...PE("en")),e.push(...Jx,...Qx,...tE,OE,NE,RE,ME,IE,WE,_E,qE,$E,VE);const t=Gx(Df);return e.push(...t),e}Ad(BE,{buildEnglishPatterns:()=>HE});var KE=Cd({"src/patterns/en.ts"(){Ff(),rE(),nE(),iE(),aE(),gE(),uy(),Ax(),AE(),DE(),OE={id:"repeat-en-until-event-from",language:"en",command:"repeat",priority:120,template:{format:"repeat until event {event} from {source}",tokens:[{type:"literal",value:"repeat"},{type:"literal",value:"until"},{type:"literal",value:"event"},{type:"role",role:"event",expectedTypes:["literal","expression"]},{type:"literal",value:"from"},{type:"role",role:"source",expectedTypes:["selector","reference","expression"]}]},extraction:{event:{marker:"event"},source:{marker:"from"},loopType:{default:{type:"literal",value:"until-event"}}}},NE={id:"repeat-en-until-event",language:"en",command:"repeat",priority:110,template:{format:"repeat until event {event}",tokens:[{type:"literal",value:"repeat"},{type:"literal",value:"until"},{type:"literal",value:"event"},{type:"role",role:"event",expectedTypes:["literal","expression"]}]},extraction:{event:{marker:"event"},loopType:{default:{type:"literal",value:"until-event"}}}},RE={id:"repeat-en-times",language:"en",command:"repeat",priority:110,template:{format:"repeat {quantity} times",tokens:[{type:"literal",value:"repeat"},{type:"role",role:"quantity",expectedTypes:["literal","expression"]},{type:"literal",value:"times"}]},extraction:{loopType:{default:{type:"literal",value:"times"}}}},ME={id:"repeat-en-forever",language:"en",command:"repeat",priority:110,template:{format:"repeat forever",tokens:[{type:"literal",value:"repeat"},{type:"literal",value:"forever"}]},extraction:{loopType:{default:{type:"literal",value:"forever"}}}},IE={id:"set-en-possessive",language:"en",command:"set",priority:100,template:{format:"set {destination} to {patient} [on {scope}]",tokens:[{type:"literal",value:"set"},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"to"},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"on"},{type:"role",role:"scope",optional:!0,expectedTypes:["selector","reference"]}]}]},extraction:{destination:{position:1},patient:{marker:"to"},scope:{marker:"on"}}},WE={id:"for-en-basic",language:"en",command:"for",priority:100,template:{format:"for {patient} in {source}",tokens:[{type:"literal",value:"for"},{type:"role",role:"patient",expectedTypes:["expression","reference"]},{type:"literal",value:"in"},{type:"role",role:"source",expectedTypes:["selector","expression","reference"]}]},extraction:{patient:{position:1},source:{marker:"in"}}},_E={id:"if-en-basic",language:"en",command:"if",priority:100,template:{format:"if {condition}",tokens:[{type:"literal",value:"if"},{type:"role",role:"condition",expectedTypes:["expression","reference","selector"]}]},extraction:{condition:{position:1}}},qE={id:"unless-en-basic",language:"en",command:"unless",priority:100,template:{format:"unless {condition}",tokens:[{type:"literal",value:"unless"},{type:"role",role:"condition",expectedTypes:["expression","reference","selector"]}]},extraction:{condition:{position:1}}},$E={id:"temporal-en-in",language:"en",command:"wait",priority:95,template:{format:"in {duration}",tokens:[{type:"literal",value:"in"},{type:"role",role:"duration",expectedTypes:["literal","expression"]}]},extraction:{duration:{position:1}}},VE={id:"temporal-en-after",language:"en",command:"wait",priority:95,template:{format:"after {duration}",tokens:[{type:"literal",value:"after"},{type:"role",role:"duration",expectedTypes:["literal","expression"]}]},extraction:{duration:{position:1}}}}}),FE=.5,UE=new Set(["me","my","myself","you","your","yourself","it","its","result","event","target","body","detail","window","document"]),GE=new Set(["and","or","not","no"]),ZE=new Set(["true","false","null","undefined"]),YE=new Set(["is","matches","match","contains","in"]),XE=new Set(["next","previous","closest","first","last"]),JE=new Set(["ms","s","seconds","second","milliseconds","millisecond","minutes","minute","hours","hour"]);var QE=new Set(["my","its","your"]),eT=new Set(["is","matches","match","contains","in","exists","does"]),tT=new Set(["next","previous","closest","first","last"]),rT=class{constructor(){this.tokens=[],this.current=0}parse(e){try{if(this.tokens=function(e){const t=[];let r=0,n=1,i=1;function a(){if(0===t.length)return!0;const e=t[t.length-1];return!("IDENTIFIER"!==e.type||!YE.has(e.value.toLowerCase()))||!("IDENTIFIER"!==e.type||!XE.has(e.value.toLowerCase()))||["OPERATOR","COMPARISON","LOGICAL","LPAREN","LBRACKET","LBRACE","COMMA","COLON"].includes(e.type)}function o(t=0){return e[r+t]??""}function s(){const t=e[r];return r++,"\n"===t?(n++,i=1):i++,t}function l(){for(;e.length>r&&/\s/.test(e[r]);)s()}function c(t){let n="";for(;e.length>r&&t(e[r]);)n+=s();return n}function u(t){let n=t;for(s();e.length>r&&e[r]!==t;)"\\"===e[r]&&e.length>r+1?(n+=s(),n+=s()):n+=s();return e.length>r&&(n+=s()),n}function p(){let t="`";for(s();e.length>r&&"`"!==e[r];)"\\"===e[r]&&e.length>r+1?(t+=s(),t+=s()):t+=s();return e.length>r&&(t+=s()),t}function d(){let t="<";for(s();e.length>r&&(t+=s(),!t.endsWith("/>")););return t}function m(e,t,a){return{type:e,value:t,start:a,end:r,line:n,column:i-t.length}}for(;e.length>r&&(l(),e.length>r);){const n=r,i=o();if("'"!==i||"s"!==o(1)||/\w/.test(o(2))){if('"'===i||"'"===i){const e=u(i);t.push(m("STRING",e,n));continue}if("`"===i){const e=p();t.push(m("TEMPLATE_LITERAL",e,n));continue}if("<"===i&&/[a-zA-Z.#\[]/.test(o(1))){const e=d();t.push(m("QUERY_SELECTOR",e,n));continue}if("#"===i&&a()){s();const e=c(e=>/[\w-]/.test(e));t.push(m("ID_SELECTOR","#"+e,n));continue}if("."===i&&/[a-zA-Z_-]/.test(o(1))&&a()){s();const e=c(e=>/[\w-]/.test(e));t.push(m("CLASS_SELECTOR","."+e,n));continue}if("@"===i&&/[a-zA-Z_]/.test(o(1))){s();const e=c(e=>/[\w-]/.test(e));t.push(m("ATTRIBUTE_REF","@"+e,n));continue}if("["===i&&a()){const i=o(1);if("@"===i||/[a-zA-Z]/.test(i)){let i="";for(i+=s();e.length>r&&"]"!==e[r];)i+='"'===e[r]||"'"===e[r]?u(e[r]):s();e.length>r&&(i+=s()),t.push(m("ATTRIBUTE_SELECTOR",i,n));continue}}if("["!==i)if("]"!==i){if(/\d/.test(i)){const e=c(e=>/[\d.]/.test(e)),i=r,a=c(e=>/[a-zA-Z]/.test(e));JE.has(a)?t.push(m("TIME_EXPRESSION",e+a,n)):(r=i,t.push(m("NUMBER",e,n)));continue}if("("!==i)if(")"!==i)if("{"!==i)if("}"!==i)if(","!==i)if(":"!==i)if("."!==i)if("+"!==i&&"-"!==i&&"*"!==i&&"/"!==i&&"%"!==i){if("="===i||"!"===i||"<"===i||">"===i){let e=s();"="===o()&&(e+=s()),t.push(m("COMPARISON",e,n));continue}if(/[a-zA-Z_$]/.test(i)){const e=c(e=>/[\w$]/.test(e)),r=e.toLowerCase();UE.has(r)?t.push(m("CONTEXT_VAR",e,n)):GE.has(r)?t.push(m("LOGICAL",e,n)):ZE.has(r)?t.push(m("BOOLEAN",e,n)):t.push(m("IDENTIFIER",e,n));continue}s()}else s(),t.push(m("OPERATOR",i,n));else s(),t.push(m("DOT",".",n));else s(),t.push(m("COLON",":",n));else s(),t.push(m("COMMA",",",n));else s(),t.push(m("RBRACE","}",n));else s(),t.push(m("LBRACE","{",n));else s(),t.push(m("RPAREN",")",n));else s(),t.push(m("LPAREN","(",n))}else s(),t.push(m("RBRACKET","]",n));else s(),t.push(m("LBRACKET","[",n))}else s(),s(),t.push(m("POSSESSIVE","'s",n))}return t.push(m("EOF","",r)),t}(e),this.current=0,this.isAtEnd())return{success:!1,error:"Empty expression"};return{success:!0,node:this.parseExpression(),consumed:this.current}}catch(e){return{success:!1,error:e instanceof Error?e.message:"Parse error"}}}peek(){return this.tokens[this.current]??{type:"EOF",value:"",start:0,end:0}}peekAt(e){return this.tokens[this.current+e]??{type:"EOF",value:"",start:0,end:0}}previous(){return this.tokens[this.current-1]??{type:"EOF",value:"",start:0,end:0}}isAtEnd(){return"EOF"===this.peek().type}advance(){return this.isAtEnd()||this.current++,this.previous()}check(e){return this.peek().type===e}checkValue(e){return this.peek().value.toLowerCase()===e.toLowerCase()}match(...e){for(const t of e)if(this.check(t))return this.advance(),!0;return!1}parseExpression(){return this.parseOr()}parseOr(){let e=this.parseAnd();for(;this.checkValue("or");){const t=this.advance().value,r=this.parseAnd();e=this.createBinaryExpression(t,e,r)}return e}parseAnd(){let e=this.parseEquality();for(;this.checkValue("and");){const t=this.advance().value,r=this.parseEquality();e=this.createBinaryExpression(t,e,r)}return e}parseEquality(){let e=this.parseComparison();for(;;){let t;if(this.match("COMPARISON"))t=this.previous().value;else{if(!(this.checkValue("is")||this.checkValue("matches")||this.checkValue("match")||this.checkValue("contains")||this.checkValue("in")))break;{const e=this.advance().value;t="match"===e.toLowerCase()?"matches":e}}if("is"===t.toLowerCase()){if(this.checkValue("empty")){this.advance(),e=this.createPostfixUnary("is empty",e);continue}if(this.checkValue("not")&&"empty"===this.peekAt(1).value.toLowerCase()){this.advance(),this.advance(),e=this.createPostfixUnary("is not empty",e);continue}}const r=this.parseComparison();e=this.createBinaryExpression(t,e,r)}return e}parseComparison(){let e=this.parseAddition();for(;this.check("COMPARISON");){const t=this.advance().value,r=this.parseAddition();e=this.createBinaryExpression(t,e,r)}return e}parseAddition(){let e=this.parseMultiplication();for(;"+"===this.peek().value||"-"===this.peek().value;){const t=this.advance().value,r=this.parseMultiplication();e=this.createBinaryExpression(t,e,r)}return e}parseMultiplication(){let e=this.parseUnary();for(;"*"===this.peek().value||"/"===this.peek().value||"%"===this.peek().value;){const t=this.advance().value,r=this.parseUnary();e=this.createBinaryExpression(t,e,r)}return e}parseUnary(){if(this.checkValue("not")||this.checkValue("no")||"-"===this.peek().value){const e=this.advance().value,t=this.parseUnary();return this.createUnaryExpression(e,t)}return this.parsePostfix()}parsePostfix(){let e=this.parsePrimary();for(;;)if(this.match("DOT")){if(!this.check("IDENTIFIER")&&!this.check("CONTEXT_VAR"))break;{const t=this.advance().value;e=this.createPropertyAccess(e,t)}}else if(this.match("POSSESSIVE")){if(!this.check("IDENTIFIER")&&!this.check("CONTEXT_VAR"))break;{const t=this.advance().value;e=this.createPossessiveExpression(e,t)}}else if(this.match("LPAREN")){const t=this.parseArguments();e=this.createCallExpression(e,t)}else if(this.match("LBRACKET")){const t=this.parseExpression();if(!this.match("RBRACKET"))throw Error("Expected ] after index");e=this.createPropertyAccess(e,t)}else if("contextReference"===e.type&&QE.has(e.contextType??"")&&this.check("IDENTIFIER")&&!eT.has(this.peek().value.toLowerCase())){const t=this.advance().value;e=this.createPropertyAccess(e,t)}else{if(!this.checkValue("exists")||"LPAREN"===this.peekAt(1).type)break;this.advance(),e=this.createPostfixUnary("exists",e)}return e}parsePrimary(){const e=this.peek();if(this.match("NUMBER"))return this.createLiteral(parseFloat(e.value),"number",e);if(this.match("STRING")){const t=e.value.slice(1,-1);return this.createLiteral(t,"string",e)}if(this.match("BOOLEAN")){return this.createLiteral("true"===e.value||"false"!==e.value&&("null"===e.value?null:void 0),{true:"boolean",false:"boolean",null:"null",undefined:"undefined"}[e.value]??"string",e)}if(this.match("TEMPLATE_LITERAL")){return{type:"templateLiteral",value:e.value,start:e.start,end:e.end,line:e.line,column:e.column}}if(this.match("TIME_EXPRESSION"))return this.parseTimeExpression(e);if(this.match("ID_SELECTOR"))return this.createSelector(e.value,"id",e);if(this.match("CLASS_SELECTOR"))return this.createSelector(e.value,"class",e);if(this.match("ATTRIBUTE_SELECTOR"))return this.createSelector(e.value,"attribute",e);if(this.match("ATTRIBUTE_REF"))return{type:"attributeAccess",attributeName:e.value.slice(1),start:e.start,end:e.end};if(this.match("QUERY_SELECTOR")){const t=e.value.slice(1,-2);return this.createSelector(t,"query",e)}if(this.match("CONTEXT_VAR"))return this.createContextReference(e.value,e);if(this.match("IDENTIFIER")){if(tT.has(e.value.toLowerCase())&&(this.check("CLASS_SELECTOR")||this.check("ID_SELECTOR")||this.check("QUERY_SELECTOR"))){const t=this.advance(),r="QUERY_SELECTOR"===t.type?t.value.slice(1,-2):t.value,n="CLASS_SELECTOR"===t.type?"class":"ID_SELECTOR"===t.type?"id":"query";return{type:"callExpression",callee:this.createIdentifier(e.value,e),arguments:[this.createSelector(r,n,t)],start:e.start,end:t.end}}return this.createIdentifier(e.value,e)}if(this.match("LPAREN")){const e=this.parseExpression();if(!this.match("RPAREN"))throw Error("Expected ) after expression");return e}if(this.match("LBRACKET"))return this.parseArrayLiteral();if(this.match("LBRACE"))return this.parseObjectLiteral();throw Error("Unexpected token: "+e.value)}parseArguments(){const e=[];if(!this.check("RPAREN"))do{e.push(this.parseExpression())}while(this.match("COMMA"));if(!this.match("RPAREN"))throw Error("Expected ) after arguments");return e}parseArrayLiteral(){const e=[],t=this.previous().start;if(!this.check("RBRACKET"))do{e.push(this.parseExpression())}while(this.match("COMMA"));if(!this.match("RBRACKET"))throw Error("Expected ] after array elements");return{type:"arrayLiteral",elements:e,start:t,end:this.previous().end}}parseObjectLiteral(){const e=[],t=this.previous().start;if(!this.check("RBRACE"))do{let t;if(this.check("STRING"))t=this.advance().value.slice(1,-1);else{if(!this.check("IDENTIFIER")&&!this.check("CONTEXT_VAR"))throw Error("Expected property name");t=this.advance().value}if(!this.match("COLON"))throw Error("Expected : after property name");const r=this.parseExpression();e.push({key:t,value:r})}while(this.match("COMMA"));if(!this.match("RBRACE"))throw Error("Expected } after object properties");return{type:"objectLiteral",properties:e.map(e=>({type:"objectProperty",key:e.key,value:e.value})),start:t,end:this.previous().end}}parseTimeExpression(e){const t=e.value.match(/^(\d+(?:\.\d+)?)(ms|s|seconds?|milliseconds?|minutes?|hours?)$/i);if(!t)throw Error("Invalid time expression: "+e.value);return{type:"timeExpression",value:parseFloat(t[1]),unit:t[2].toLowerCase(),raw:e.value,start:e.start,end:e.end,line:e.line,column:e.column}}createLiteral(e,t,r){return{type:"literal",value:e,dataType:t,raw:r.value,start:r.start,end:r.end,line:r.line,column:r.column}}createSelector(e,t,r){return{type:"selector",value:e,selector:e,selectorType:t,start:r.start,end:r.end,line:r.line,column:r.column}}createContextReference(e,t){return{type:"contextReference",contextType:e,name:t.value,start:t.start,end:t.end,line:t.line,column:t.column}}createIdentifier(e,t){return{type:"identifier",name:e,start:t.start,end:t.end,line:t.line,column:t.column}}createPropertyAccess(e,t){return{type:"propertyAccess",object:e,property:"string"==typeof t?t:"identifier"===t.type?t.name:"",start:e.start,end:this.previous().end}}createPossessiveExpression(e,t){return{type:"possessiveExpression",object:e,property:t,start:e.start,end:this.previous().end}}createBinaryExpression(e,t,r){return{type:"binaryExpression",operator:e,left:t,right:r,start:t.start,end:r.end}}createUnaryExpression(e,t){return{type:"unaryExpression",operator:e,operand:t,prefix:!0,start:this.previous().start,end:t.end}}createPostfixUnary(e,t){return{type:"unaryExpression",operator:e,operand:t,prefix:!1,start:t.start,end:this.previous().end}}createCallExpression(e,t){return{type:"callExpression",callee:e,arguments:t,start:e.start,end:this.previous().end}}};function nT(e,t){switch(e.type){case"literal":return iT(e);case"selector":return aT(e,t);case"reference":return oT(e);case"property-path":return sT(e,t);case"expression":return lT(e);case"flag":return{type:"literal",value:e.enabled};default:throw Error("Unknown semantic value type: "+e.type)}}function iT(e){const t={type:"literal",value:e.value};return e.dataType?{...t,dataType:e.dataType}:t}function aT(e,t){return e.value.startsWith("@")&&/^[a-zA-Z_]/.test(e.value.slice(1))?{type:"attributeAccess",attributeName:e.value.slice(1)}:(t&&e.value.startsWith("*")&&/^[a-zA-Z-]/.test(e.value.slice(1))&&t.push(`Converted '${e.value}' to a CSS selector, but it looks like a CSS property name. CSS properties in commands like 'transition' should be literal strings, not selectors. Consider using expectedTypes: ['literal'] instead of ['literal', 'selector'] in the command schema.`),e.value.startsWith("<")?{type:"selector",value:e.value,selector:e.value,selectorType:e.selectorKind,raw:e.value}:{type:"selector",value:e.value,selector:e.value,selectorType:e.selectorKind})}function oT(e){return{type:"contextReference",contextType:e.value,name:e.value}}function sT(e,t){return{type:"propertyAccess",object:nT(e.object,t),property:e.property}}function lT(e){const t=(r=e.raw,(new rT).parse(r));var r;if(!t.success||!t.node){return{type:"identifier",name:e.raw}}return t.node}function cT(e,t){return e.roles.get(t)}function uT(e,t,r){const n=cT(e,t);return n?nT(n,r):void 0}function pT(e,t=[],r,n={}){const i={type:"command",name:e,args:t};return r&&Object.keys(r).length>0&&(i.modifiers=r),n.isBlocking&&(i.isBlocking=n.isBlocking),n.implicitTarget&&(i.implicitTarget=n.implicitTarget),n.semanticRoles&&Object.keys(n.semanticRoles).length>0&&(i.semanticRoles=n.semanticRoles),i}wf();var dT={action:"wait",toAST(e,t){const r=uT(e,"event");if(r){const t={for:r},n=uT(e,"source");return n&&(t.from=n),pT("wait",[],t,{isBlocking:!0})}const n=uT(e,"duration");return pT("wait",n?[n]:[],void 0,{isBlocking:!0})}},mT={action:"put",toAST(e,t){const r=uT(e,"patient"),n=uT(e,"destination"),i=cT(e,"manner")??cT(e,"method"),a=r?[r]:[],o={};if(n){o["literal"===i?.type?i.value+"":"into"]=n}return pT("put",a,o)}},fT={action:"go",toAST(e,t){const r=e.roles.get("destination"),n=e.roles.get("method"),i=[];if(r&&(r&&"value"in r?r.value:r?.raw)+""=="back")i.push({type:"literal",value:"back"});else if(r){n&&("value"in n?n.value:void 0)+""=="url"&&i.push({type:"literal",value:"url"});const t=uT(e,"destination");t&&i.push(t)}return pT("go",i,{})}},hT=new Set(["item","items","character","characters"]),yT=new Set(["first","last","random"]),vT=new Set(["match","matches"]);function gT(e){if(e)return"literal"===e.type?e.value+"":"expression"===e.type?e.raw:"value"in e&&"string"==typeof e.value?e.value:void 0}function kT(e){const t=e.trim();if("start"===t||"end"===t)return{type:"literal",value:t};const r=Number(t);return{type:"literal",value:Number.isNaN(r)?t:r}}var wT=new Map([["wait",dT],["put",mT],["go",fT],["pick",{action:"pick",toAST(e,t){const r=gT(cT(e,"method"))?.trim().toLowerCase(),n=cT(e,"patient"),i=uT(e,"source");if(!r||!(hT.has(r)||yT.has(r)||vT.has(r))){const e=n?nT(n):void 0,t=[];return e&&t.push(e),i&&t.push(i),pT("pick",t)}const a=i?[i]:[],o={};if(yT.has(r))o.variant={type:"literal",value:r},n&&(o.count=nT(n));else if(vT.has(r))o.variant={type:"literal",value:r},n&&(o.regex=nT(n));else{o.variant={type:"literal",value:"range"};let e="default",t=(gT(n)??"").trim();const r=t.match(/\s+(inclusive|exclusive)\s*$/i);r&&(e=r[1].toLowerCase(),t=t.slice(0,t.length-r[0].length).trim());const i=t.split(/\s+to\s+/i),a=i[0]?.trim(),s=i[1]?.trim();a&&(o.rangeStart=kT(a)),s&&(o.rangeEnd=kT(s)),o.rangeMode={type:"literal",value:e}}return pT("pick",a,o)}}]]);function bT(e,t){const r=Array.isArray(t)?t:[t];for(const t of r){const r=uT(e,t);if(void 0!==r)return r}}function zT(e,t,r){const n=[];for(const t of r.args??[]){const r=bT(e,t);void 0!==r&&n.push(r)}const i={};for(const[t,n]of Object.entries(r.modifiers??{})){const r=bT(e,n);void 0!==r&&(i[t]=r)}return pT(t,n,i,r.isBlocking?{isBlocking:!0}:{})}function xT(e){const t=mf(e)?.ast;if(t)return{action:e,toAST:r=>zT(r,e,t)}}function ET(e){return wT.get(e)??xT(e)}var TT=class{constructor(e={}){this.warnings=[]}build(e){switch(e.kind){case"command":return this.buildCommand(e);case"event-handler":return this.buildEventHandler(e);case"conditional":return this.buildConditional(e);case"compound":return this.buildCompound(e);case"loop":return this.buildLoop(e);case"behavior":return this.buildBehavior(e);case"def":return this.buildDef(e);case"feature":return this.buildFeature(e);default:throw Error("Unknown semantic node kind: "+e.kind)}}buildBehavior(e){const t=e.eventHandlers.map(e=>this.buildEventHandler(e)),r={type:"behavior",name:e.name,parameters:[...e.parameters],eventHandlers:t};return e.initBlock&&e.initBlock.length>0&&(r.initBlock={type:"initBlock",commands:e.initBlock.map(e=>this.build(e))}),r}buildDef(e){return{type:"def",name:e.name,params:[...e.parameters],body:e.body.map(e=>this.build(e))}}buildFeature(e){const t=[];return void 0!==e.name&&t.push({type:"literal",value:e.name}),t.push({type:"block",commands:e.body.map(e=>this.build(e))}),{type:"command",name:e.action,args:t}}buildCommand(e){const t=ET(e.action);let r;if(t){const n=t.toAST(e,this);if("ast"in n&&"warnings"in n){const e=n;this.warnings.push(...e.warnings),r=e.ast}else r=n}else r=this.buildGenericCommand(e);if(e.roles&&e.roles.size>0){const t={};for(const[r,n]of e.roles)t[r]=nT(n);Object.keys(t).length>0&&(r.semanticRoles=t)}return r}buildGenericCommand(e){const t=[],r={},n=["patient","source","quantity"],i=["destination","duration","method","style"];for(const r of n){const n=e.roles.get(r);n&&t.push(nT(n))}for(const t of i){const n=e.roles.get(t);if(n){r[this.roleToModifierKey(t)]=nT(n)}}const a={type:"command",name:e.action,args:t};return Object.keys(r).length>0?{...a,modifiers:r}:a}roleToModifierKey(e){return{destination:"on",duration:"for",source:"from",condition:"if",method:"via",style:"with"}[e]??e}buildEventHandler(e){const t=e.roles.get("event");let r,n="click";const i="literal"===t?.type?t.value+"":"expression"===t?.type?t.raw:"reference"===t?.type?t.value:void 0;void 0!==i&&(i.includes("|")||i.includes(" or ")?(r=i.split(/\s+or\s+|\|/).map(e=>e.trim()),n=r[0]):n=i);const a=e.body.map(e=>this.build(e)),o=e.roles.get("source");let s,l;"selector"===o?.type?(s=o.value,l=o.value):"reference"===o?.type?l=o.value:"literal"===o?.type&&(l=o.value+"");const c=e.roles.get("condition"),u=c?nT(c):void 0,p=e.roles.get("destination"),d=p?nT(p):void 0,m=e.eventModifiers;let f=s;if(m?.from){const e=m.from;"selector"!==e.type||s?l||("reference"===e.type?l=e.value:"literal"===e.type?l=e.value+"":"expression"===e.type&&(l=e.raw)):(f=e.value,l=l??e.value)}const h={};m?.once&&(h.once=!0),"number"==typeof m?.debounce&&(h.debounce=m.debounce),"number"==typeof m?.throttle&&(h.throttle=m.throttle);const y=e.parameterNames?[...e.parameterNames]:void 0;return{type:"eventHandler",event:n,commands:a,...r&&r.length>1?{events:r}:{},...f?{selector:f}:{},...l?{target:l}:{},...u?{condition:u}:{},...d?{watchTarget:d}:{},...y&&y.length>0?{args:y,params:y}:{},...Object.keys(h).length>0?{modifiers:h}:{}}}buildConditional(e){const t=e.roles.get("condition");if(!t)throw Error("Conditional node missing condition");const r=nT(t),n=e.thenBranch.map(e=>this.build(e)),i=e.elseBranch?.map(e=>this.build(e)),a=[r,{type:"block",commands:n}];return i&&i.length>0&&a.push({type:"block",commands:i}),{type:"command",name:"if",args:a}}buildCompound(e){const t=e.statements.map(e=>this.build(e));if(1===t.length)return t[0];if(0===t.length)return{type:"block",commands:[]};if(t.every(e=>"eventHandler"===e.type))return{type:"Program",statements:t};return{type:"CommandSequence",commands:t}}buildLoop(e){const t=e.body.map(e=>this.build(e)),r=[{type:"identifier",name:e.loopVariant}];switch(e.loopVariant){case"times":{const t=e.roles.get("quantity");t&&r.push(nT(t));break}case"for":{e.loopVariable&&r.push({type:"string",value:e.loopVariable});const t=e.roles.get("source");t&&r.push(nT(t));break}case"while":case"until":{const t=e.roles.get("condition");t&&r.push(nT(t));break}}return r.push({type:"block",commands:t}),{type:"command",name:"repeat",args:r}}buildBlock(e){return{type:"block",commands:e.map(e=>this.build(e))}}};function ST(e){const t=new TT;return{ast:t.build(e),warnings:t.warnings}}Rf(),Wf(),$f(),Bf(),Ff(),Zf(),Jf(),th(),ih(),sh(),uh(),mh(),yh(),kh(),zh(),Th(),Ah(),Ph(),Rh(),Wh(),$h(),Bh(),Fh(),Zh(),Jh();var CT=Object.freeze({ar:Nf,bn:If,de:qf,en:Df,es:Kf,fr:Gf,he:Xf,hi:eh,id:nh,it:oh,ja:ch,ko:dh,ms:hh,pl:gh,pt:bh,qu:Eh,ru:Ch,sw:jh,th:Nh,tl:Ih,tr:qh,uk:Dh,vi:Kh,zh:Gh});function AT(e){let t="complex";return e.startsWith("#")&&!e.includes(" ")?t="id":e.startsWith(".")&&!e.includes(" ")?t="class":e.startsWith("[")&&e.endsWith("]")?t="attribute":/^[a-z][a-z0-9]*$/i.test(e)&&(t="element"),{type:"selector",value:e,selectorKind:t}}function LT(e,t){return void 0!==t?{type:"literal",value:e,dataType:t}:{type:"literal",value:e}}function jT(e){return Wc(e)}function PT(e){return{type:"reference",value:e}}function OT(e,t){return{type:"property-path",object:e,property:t}}function NT(e,t,r){const n={kind:"command",action:e,roles:new Map(Object.entries(t))};return void 0!==r?{...n,metadata:r}:n}function RT(e,t,r,n,i,a){const o=new Map;o.set("event",e);const s={kind:"event-handler",action:"on",roles:o,body:t};return void 0!==r&&(s.eventModifiers=r),void 0!==n&&(s.metadata=n),void 0!==i&&i.length>0&&(s.parameterNames=i),void 0!==a&&a.length>0&&(s.additionalEvents=a),s}function MT(e,t,r,n){const i={kind:"feature",action:e,roles:new Map,body:t};return void 0!==r&&(i.name=r),void 0!==n&&(i.metadata=n),i}function IT(e,t="then",r){const n={kind:"compound",action:"compound",roles:new Map,statements:e,chainType:t};return void 0!==r&&(n.metadata=r),n}function WT(e,t,r,n){const i=new Map;i.set("condition",e);const a={kind:"conditional",action:"if",roles:i,thenBranch:t};return void 0!==r&&(a.elseBranch=r),void 0!==n&&(a.metadata=n),a}function _T(e,t){return!t||0===t.length||(!!t.includes(e)||(!!t.includes("expression")||("property-path"===e||"expression"===e)&&t.some(e=>["selector","reference","expression"].includes(e))))}function qT(e,t){const r=e.possessive?.keywords?.[t];if(r)return r;const n=e.possessive?.specialForms;if(n)for(const[e,r]of Object.entries(n))if(r===t)return e}function $T(e){return Df.possessive?.specialForms?.[e]??e+"'s"}ny(),wf(),Ff(),wf();var VT={ar:{"\u0642\u064a\u0645\u0629":"value"},bn:{"\u0985\u0995\u09cd\u09b7\u09ae":"disabled","\u099a\u09c7\u0995 \u0995\u09b0\u09be":"checked","\u09a6\u09c8\u09b0\u09cd\u0998\u09cd\u09af":"length","\u09ae\u09be\u09a8":"value"},de:{wert:"value"},es:{valor:"value"},fr:{valeur:"value"},hi:{"\u0905\u0915\u094d\u0937\u092e":"disabled","\u091a\u0947\u0915":"checked","\u091b\u093f\u092a\u093e":"hidden","\u092e\u093e\u0928":"value"},id:{nilai:"value"},it:{valore:"value"},ja:{"\u5024":"value"},ko:{"\uac12":"value"},ms:{dilumpuhkan:"disabled",ditanda:"checked",nilai:"value",panjang:"length"},pl:{"warto\u015b\u0107":"value"},pt:{valor:"value"},qu:{chanin:"value"},ru:{"\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435":"value","\u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043e":"disabled","\u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043e":"checked","\u0441\u043a\u0440\u044b\u0442\u043e":"hidden"},sw:{thamani:"value"},th:{"\u0e04\u0e27\u0e32\u0e21\u0e22\u0e32\u0e27":"length","\u0e04\u0e48\u0e32":"value","\u0e1b\u0e34\u0e14\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19":"disabled","\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e41\u0e25\u0e49\u0e27":"checked"},tl:{haba:"length",halaga:"value",hindi_pinagana:"disabled",naka_tsek:"checked"},tr:{"de\u011fer":"value"},uk:{"\u0432\u0438\u043c\u043a\u043d\u0435\u043d\u043e":"disabled","\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f":"value","\u043f\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u043e":"checked","\u043f\u0440\u0438\u0445\u043e\u0432\u0430\u043d\u043e":"hidden"},vi:{"\u1ea9n":"hidden","\u0111\u01b0\u1ee3c ch\u1ecdn":"checked","gi\u00e1 tr\u1ecb":"value","v\u00f4 hi\u1ec7u":"disabled"},zh:{"\u503c":"value"}},DT={ar:{"\u0643\u0640":"as"},bn:{"\u09b9\u09bf\u09b8\u09be\u09ac\u09c7":"as"},de:{als:"as"},es:{como:"as"},fr:{comme:"as"},hi:{"\u0915\u0947_\u0930\u0942\u092a_\u092e\u0947\u0902":"as"},id:{sebagai:"as"},it:{come:"as"},ja:{"\u3068\u3057\u3066":"as"},ko:{"\ub85c":"as"},ms:{sebagai:"as"},pl:{jako:"as"},pt:{como:"as"},qu:{hina:"as"},ru:{"\u043a\u0430\u043a":"as"},sw:{kuwa:"as"},tl:{bilang:"as"},tr:{olarak:"as"},uk:{"\u044f\u043a":"as"},vi:{"nh\u01b0":"as"},zh:{"\u4f5c\u4e3a":"as"}},BT={ms:new Set(["daripada"]),sw:new Set(["ya"]),vi:new Set(["c\u1ee7a"]),zh:new Set(["\u7684"]),it:new Set(["di"]),pl:new Set(["z"]),uk:new Set(["\u0437"]),th:new Set(["\u0e02\u0e2d\u0e07"]),ar:new Set(["\u0644\u0640"]),ja:new Set(["\u306e"]),ko:new Set(["\uc758"]),bn:new Set(["\u09b0"]),hi:new Set(["\u0915\u093e"]),qu:new Set(["pa"]),tr:new Set(["nin"])};function HT(e,t){const r=t.value.toLowerCase(),n=(t.normalized??"").toLowerCase();if("of"===r||"ng"===r||"of"===n||"source"===n)return!0;const i=e?.code?BT[e.code]:void 0;return!!i&&i.has(r)}var KT={destination:"in",source:"from"},FT={ar:new Set(["\u0639\u0646\u062f","\u0641\u064a"]),bn:new Set(["\u098f","\u09a4\u09c7"]),de:new Set(["bei"]),es:new Set(["en"]),fr:new Set(["dans","en","\u00e0"]),he:new Set(["\u05dc\u05ea\u05d5\u05da"]),hi:new Set(["\u092a\u0930","\u092e\u0947\u0902"]),id:new Set(["dalam","di","ke_dalam"]),it:new Set(["a"]),ja:new Set(["\u3067","\u306e\u4e2d","\u3078"]),ko:new Set(["\uc548\uc5d0","\uc5d0","\uc73c\ub85c"]),ms:new Set(["dalam","di","ke_dalam"]),pl:new Set(["do","przy","w"]),pt:new Set(["dentro","em"]),qu:new Set(["pi","ukupi"]),ru:new Set(["\u0432","\u0443"]),sw:new Set(["katika","ndani"]),th:new Set(["\u0e17\u0e35\u0e48","\u0e43\u0e19"]),tl:new Set(["papasok_sa","sa","sa_loob"]),tr:new Set(["de","i\u00e7inde","i\u00e7ine"]),uk:new Set(["\u0432","\u0443"]),vi:new Set(["trong","t\u1ea1i","v\u00e0o"]),zh:new Set(["\u5728","\u8fdb\u5165"])},UT=new Set(["in","into","at","within","inside"]);function GT(e,t){const r=t.value.toLowerCase(),n=e?.code?FT[e.code]:void 0;if(n?.has(r))return"in";const i=t.normalized??t.value,a=i.toLowerCase();return UT.has(a)?"in":KT[a]??i}var ZT=new Set(["first","last","next","previous","random","closest"]),YT={bn:{"\u09b6\u09c7\u09b7":"last"}},XT=new Set(Object.keys(of).map(e=>e.toLowerCase()));function JT(e,t,r){const n=e[t];if(!n)return null;const i=(n.normalized??n.value).toLowerCase(),a=e[t+1],o=r?.code&&"selector"===a?.kind&&a.value.startsWith("<")?YT[r.code]?.[n.value.toLowerCase()]:void 0;if(!ZT.has(i)&&!ZT.has(n.value.toLowerCase())&&void 0===o)return null;const s=[{text:o??n.normalized??n.value,token:n}];let l=t+1;const c=e[l];if(!c||"selector"!==c.kind)return null;s.push({text:c.value,token:c}),l++;let u=0;for(;8>u++;){const t=e[l];if(!t||"selector"!==t.kind||!t.value.startsWith("."))break;s.push({text:t.value,token:t}),l++}const p=e[l],d=e[l+1];return!p||!d||"selector"!==d.kind||"keyword"!==p.kind&&"particle"!==p.kind&&"identifier"!==p.kind||ZT.has((p.normalized??p.value).toLowerCase())||XT.has((p.normalized??p.value).toLowerCase())||(s.push({text:GT(r,p),token:p}),s.push({text:d.value,token:d}),l+=2),{parts:s,consumed:l-t}}function QT(e,t){const r=DT[e];return r?r[t.toLowerCase()]??t:t}function eS(e,t){const r=VT[e];return r?r[t.toLowerCase()]??t:t}function tS(e,t){const r=[t.value,t.normalized].filter(Boolean);for(const t of r){const r=qT(e,t)??qT(e,t.toLowerCase());if(r)return r}}function rS(e){return"literal"!==e.kind&&"operator"!==e.kind&&"punctuation"!==e.kind&&!/^[$:@#.*^(){}[\]]/.test(e.value)}function nS(e,t){const r=e?.references;if(!r)return!1;const n=Object.values(r).filter(e=>"string"==typeof e).map(e=>e.toLowerCase());return[t.value,t.normalized].filter(Boolean).some(e=>n.includes(e.toLowerCase()))}function iS(e,t){return!!rS(e)&&(eS(t,e.value)!==e.value||"identifier"===e.kind)}var aS={ar:{"\u0647\u0648":{beforePredicate:"is"}},hi:{"\u0939\u0948":{beforePredicate:"is"},"\u0928\u0939\u0940\u0902":{beforeBareIdentifier:"no"}},th:{"\u0e40\u0e1b\u0e47\u0e19":{beforeTypeName:"as",beforePredicate:"is"}},ja:{"\u7a7a":{afterCopula:"empty"}},zh:{"\u6ca1\u6709":{beforeBareIdentifier:"no"}},tl:{walang:{beforeBareIdentifier:"no"},may:{afterSubject:"exists"}},bn:{"\u0986\u099b\u09c7":{afterSubject:"exists"}},tr:{var:{afterSubject:"exists"}}},oS=new Set(["empty","null","undefined","true","false"]),sS=new Set(["Number","Int","Float","String","Date","Array","Object","JSON","json","FormData","HTML","Fragment","Values"]);function lS(e,t,r,n){const i=aS[e],a=i?.[t.value]??i?.[t.value.toLowerCase()];if(a)return a.beforeTypeName&&"identifier"===n?.kind&&sS.has(n.value)?a.beforeTypeName:a.beforePredicate&&n&&("literal"===n.kind||"keyword"===n.kind&&oS.has((n.normalized??"").toLowerCase()))?a.beforePredicate:a.beforeBareIdentifier&&"identifier"===n?.kind&&/^[A-Za-z_]\w*$/.test(n.value)?a.beforeBareIdentifier:!a.afterSubject||"selector"!==r?.kind&&"reference"!==r?.kind?a.afterCopula&&"keyword"===r?.kind&&"is"===(r.normalized??"").toLowerCase()?a.afterCopula:void 0:a.afterSubject}function cS(e,t){const r=t?.code??"en";let n,i="";const a=(e,t)=>{if(void 0===n)return i=e,void(n=t);const r=void 0!==n.position?.end&&void 0!==t.position?.start&&n.position.end===t.position.start&&(e.startsWith(".")||e.startsWith("!"));i+=(r?"":" ")+e,n=t},o=e=>"keyword"===e.kind?e.normalized??e.value:e.value;for(let n=0;e.length>n;n++){const i=e[n],s=t?tS(t,i):void 0,l=e[n+1];if(void 0!==s&&l){const o=t?.possessive?.connectors,c=!!o?.length&&o.some(e=>{const t=e.toLowerCase();return t===l.value.toLowerCase()||t===(l.normalized??"").toLowerCase()}),u=c?n+2:n+1,p=e[u];if(p&&iS(p,r)){a($T(s),i),a(eS(r,p.value),p),n=u;continue}if(c&&p&&/^\.[a-zA-Z_]\w*$/.test(p.value)&&void 0!==l.position?.end&&void 0!==p.position?.start&&l.position.end===p.position.start){a($T(s),i),a(eS(r,p.value.slice(1)),p),n=u;continue}if(!c&&/^\.[a-zA-Z_]\w*$/.test(l.value)&&void 0!==i.position?.end&&void 0!==l.position?.start&&i.position.end===l.position.start&&!nS(t,i)){a($T(s),i),a(eS(r,l.value.slice(1)),l),n+=1;continue}}const c=e[n+2];if(l&&c&&"selector"===c.kind&&HT(t,l)&&rS(i)){a(eS(r,i.value),i),a("of",l),a(c.value,c),n+=2;continue}const u=JT(e,n,t);if(u){for(const e of u.parts)a(e.text,e.token);n+=u.consumed-1;continue}const p=lS(r,i,e[n-1],l);if(void 0!==p){a(p,i);continue}const d=QT(r,i.value);d===i.value?a(o(i),i):a(d,i)}return i.trim()}Rf(),uy();var uS={en:new Set(["end"]),ja:new Set(["\u7d42\u308f\u308a","\u304a\u308f\u308a"]),ar:new Set(["\u0646\u0647\u0627\u064a\u0629","\u0627\u0646\u062a\u0647\u0649","\u0627\u0644\u0646\u0647\u0627\u064a\u0629"]),es:new Set(["fin","final","terminar"]),ko:new Set(["\ub05d","\ub9c8\uce68"]),zh:new Set(["\u7ed3\u675f","\u7ec8\u6b62","\u5b8c"]),tr:new Set(["son","biti\u015f","bitti"]),pt:new Set(["fim","final","t\u00e9rmino"]),fr:new Set(["fin","terminer","finir"]),de:new Set(["ende","fertig"]),id:new Set(["selesai","akhir","tamat"]),tl:new Set(["wakas","tapos"]),bn:new Set(["\u09b8\u09ae\u09be\u09aa\u09cd\u09a4"]),qu:new Set(["tukukuy","tukuy","puchukay"]),sw:new Set(["mwisho","maliza","tamati"])};var pS=/^[A-Za-z_][\w-]*$/,dS=/^[A-Za-z_][\w-]*:[^\s'"`/:][^\s]*$/;function mS(e,t){const r=e.peek(t);return!!r&&"identifier"===r.kind&&dS.test(r.value)}function fS(e,t){const r=e.peek(t);if(!r||"identifier"!==r.kind&&"keyword"!==r.kind||!pS.test(r.value))return!1;const n=e.peek(t+1),i=e.peek(t+2);return!!n&&":"===n.value&&!!i}function hS(e,t=0){return mS(e,t)||fS(e,t)}function yS(e){const t=e.peek();return t?"{"===t.value||"("===t.value?function(e){const t=e.peek();if(!t||"{"!==t.value&&"("!==t.value)return null;let r="",n=-1,i=0,a=0;for(;!e.isAtEnd()&&96>a++;){const t=e.advance();if(!t)break;if(n>=0&&t.position.start>n&&(r+=" ".repeat(t.position.start-n)),r+=t.value,n=t.position.end,"{"===t.value||"("===t.value)i++;else if(("}"===t.value||")"===t.value)&&(i--,0===i))return r}return null}(e):","===t.value||":"===t.value?null:(e.advance(),t.value):null}function vS(e,t){const r=e.mark(),n=[];if(void 0!==t){const i=e.peek();if(!i||":"!==i.value||!e.peek(1))return null;e.advance();const a=yS(e);if(null===a)return e.reset(r),null;n.push(`${t}:${a}`)}else if(!hS(e))return null;let i=0;for(;96>i++;){const t=e.peek();if(!t)break;if(","===t.value){if(0===n.length||!hS(e,1))break;e.advance();continue}if(mS(e,0)){n.push(e.advance().value);continue}if(!fS(e,0))break;const i=e.advance().value;e.advance();const a=yS(e);if(null===a)return e.reset(r),null;n.push(`${i}:${a}`)}return 0===n.length?(e.reset(r),null):`{${n.join(", ")}}`}wf();var gS=.8,kS=new Set(["\u0628\u062f\u0644","\u063a\u064a\u0631","\u0623\u0636\u0641","\u0623\u0632\u0644","\u0636\u0639","\u0627\u062c\u0639\u0644","\u0639\u064a\u0646","\u0632\u062f","\u0627\u0646\u0642\u0635","\u0633\u062c\u0644","\u0623\u0638\u0647\u0631","\u0623\u062e\u0641","\u0634\u063a\u0644","\u0623\u0631\u0633\u0644","\u0631\u0643\u0632","\u0634\u0648\u0634","\u062a\u0648\u0642\u0641","\u0627\u0646\u0633\u062e","\u0627\u062d\u0630\u0641","\u0627\u0635\u0646\u0639","\u0627\u0646\u062a\u0638\u0631","\u0627\u0646\u062a\u0642\u0627\u0644","\u0623\u0648"]),wS={patient:["\u0639\u0644\u0649"],destination:["\u0625\u0644\u0649","\u0627\u0644\u0649"],source:["\u0645\u0646"],agent:["\u0645\u0646"],manner:["\u0628"],style:["\u0628"],goal:["\u0625\u0644\u0649","\u0627\u0644\u0649"],method:["\u0628"]},bS=new class{calculate(e){return this.calculateWithBreakdown(e).final}calculateWithBreakdown(e){const t=this.scoreRoleCoverage(e),r=this.scoreStemPenalty(e),n=this.scoreLanguageBoost(e),i=this.scoreLanguageAdjustment(e);let a=t;return a=Math.max(.5,a+r),a=Math.min(1,a+n),a=Math.max(0,Math.min(1,a+i)),{roleCoverage:t,stemPenalty:r,languageBoost:n,languageAdjustment:i,final:a}}scoreRoleCoverage(e){const{pattern:t,captured:r}=e;let n=0,i=0;const a=e=>void 0!==t.extraction?.[e]?.default,o="on"===t.command?t.extraction?.action?.value:void 0,s=of[o??t.command]?.roles,l=e=>void 0!==s?.find(t=>t.role===e)?.valueShape;for(const e of t.template.tokens)if("role"===e.type)r.has(e.role)?(i+=1,n+=1):l(e.role)||(i+=1);else if("group"===e.type)for(const t of e.tokens)"role"===t.type&&(r.has(t.role)?(i+=gS,n+=gS):l(t.role)||(i+=gS,a(t.role)&&(n+=.48)));return i>0?n/i:1}scoreStemPenalty(e){const{stemMatchCount:t,totalKeywordMatches:r}=e;return t>0&&r>0?-t/r*.15:0}scoreLanguageBoost(e){const{pattern:t}=e;if("ar"!==t.language)return 0;const r=t.template.tokens[0];return r&&"literal"===r.type&&(kS.has(r.value)||r.alternatives?.some(e=>kS.has(e)))?.15:0}scoreLanguageAdjustment(e){const{pattern:t,captured:r}=e;if("ar"!==t.language)return 0;let n=0;for(const[e,t]of r.entries()){const r=wS[e];if(!r||0===r.length)continue;const i="metadata"in t?t.metadata:void 0;i&&"string"==typeof i.prepositionValue&&(r.includes(i.prepositionValue)?n+=.1:n-=.1)}return Math.max(-.1,Math.min(.1,n))}},zS=new Set(Object.values(of).filter(e=>!0===e.bareKeyword).map(e=>e.action)),xS=class e{constructor(e){this.matchCache=new Map,this.stemMatchCount=0,this.totalKeywordMatches=0,this.confidenceModel=e??bS}matchPattern(e,t){const r=e.mark(),n=new Map;this.currentProfile=Af(t.language),this.currentPatternCommand=t.command,this.stemMatchCount=0,this.totalKeywordMatches=0;if(!this.matchTokenSequence(e,t.template.tokens,n))return e.reset(r),null;const i=this.confidenceModel.calculate({pattern:t,captured:n,stemMatchCount:this.stemMatchCount,totalKeywordMatches:this.totalKeywordMatches});return this.applyExtractionRules(t,n),{pattern:t,captured:n,consumedTokens:e.position()-r.position,confidence:i}}matchBest(e,t){this.matchCache.clear();const r=[],n=e.position();for(const i of t){const t=e.mark(),a=`${n}:${i.id}`;let o;this.matchCache.has(a)?o=this.matchCache.get(a):(o=this.matchPattern(e,i),this.matchCache.set(a,o)),o&&r.push(o),e.reset(t)}if(0===r.length)return null;r.sort((e,t)=>{const r=t.pattern.priority-e.pattern.priority;return 0!==r?r:t.confidence-e.confidence});const i=r[0];return this.matchPattern(e,i.pattern),i}matchTokenSequence(e,t,r,n){const i=t[0],a="literal"===i?.type&&("and"===i.value||"then"===i.value||i.alternatives?.includes("and")||i.alternatives?.includes("then"));if("ar"===this.currentProfile?.code&&!a)for(;"conjunction"===e.peek()?.kind;)e.advance();let o=0;for(let i=0;t.length>i;i++){const a=t[i];o>0&&"literal"===a.type&&this.tryConsumeEventSourceClause(e,r,a);const s=this.matchPatternToken(e,a,r,t[i+1]??n);if(o="role"===a.type&&"event"===a.role?2:Math.max(0,o-1),!s){if(this.isOptional(a))continue;return!1}}return!0}tryConsumeEventSourceClause(e,t,r){if(t.has("source"))return;const n=e.peek(),i=e.peek(1);if(!n||!i)return;if(this.patternTokenWouldMatch(r,n))return;const a=this.currentProfile?.roleMarkers?.source,o=e=>{if("particle"!==e.kind&&"keyword"!==e.kind)return!1;if("source"===(e.normalized??"").toLowerCase())return!0;if(!a)return!1;const t=e.value.toLowerCase();return a.primary?.toLowerCase()===t||!!a.alternatives?.some(e=>e.toLowerCase()===t)},s=a?.position;if("after"!==s&&o(n)&&"selector"===i.kind){e.advance();const r=this.tokenToSemanticValue(e.advance());return void(r&&t.set("source",r))}if("after"===s&&"selector"===n.kind&&o(i)){const r=this.tokenToSemanticValue(n);e.advance(),e.advance(),r&&t.set("source",r)}}matchPatternToken(e,t,r,n){switch(t.type){case"literal":return this.matchLiteralToken(e,t);case"role":return this.matchRoleToken(e,t,r,n);case"group":return this.matchGroupToken(e,t,r,n);default:return!1}}matchLiteralToken(e,t){const r=e.peek();if(!r)return!1;const n=this.getMatchType(r,t.value);if("none"!==n)return this.totalKeywordMatches++,"stem"===n&&this.stemMatchCount++,e.advance(),!0;if(t.alternatives)for(const n of t.alternatives){const t=this.getMatchType(r,n);if("none"!==t)return this.totalKeywordMatches++,"stem"===t&&this.stemMatchCount++,e.advance(),!0}for(const r of[t.value,...t.alternatives??[]])for(const t of["-","_"])if(r.includes(t)&&this.tryMatchShatteredCompound(e,r,t))return this.totalKeywordMatches++,!0;return!1}tryFoldHyphenActionKeyword(e){const t=this.currentProfile;if(!t)return null;const r=e.mark(),n=[];for(;;){const t=e.peek();if(!t||"identifier"!==t.kind&&"keyword"!==t.kind)break;n.push(t.value),e.advance();const r=e.peek();if(!r||"-"!==r.value)break;e.advance(),n.push("-")}if(3>n.length||"-"===n[n.length-1])return e.reset(r),null;const i=n.join("").toLowerCase();for(const[e,r]of Object.entries(t.keywords))if(r.primary.toLowerCase()===i||r.alternatives?.some(e=>e.toLowerCase()===i))return LT(e);return e.reset(r),null}tryMatchShatteredCompound(e,t,r){const n=t.split(r);if(2>n.length||n.some(e=>0===e.length))return!1;const i=e.mark();for(let t=0;n.length>t;t++){if(t>0){const t=e.peek();if(!t||t.value!==r)return e.reset(i),!1;e.advance()}const a=e.peek();if(!a||"identifier"!==a.kind&&"keyword"!==a.kind&&"particle"!==a.kind||a.value.toLowerCase()!==n[t].toLowerCase())return e.reset(i),!1;e.advance()}return!0}matchRoleToken(t,r,n,i){this.skipNoiseWords(t);const a=t.peek();if(!a)return r.optional||!1;if("action"===r.role&&this.currentProfile&&"-"===t.peek(1)?.value){const e=this.tryFoldHyphenActionKeyword(t);if(e)return n.set(r.role,e),!0}if("event"===r.role&&"on"===this.currentPatternCommand){if(!e.tokenLooksLikeEvent(a))return r.optional||!1;const t=(a.normalized??a.value).toLowerCase();if(e.POSITIONAL_OR_SCOPE_KEYWORDS.has(t))return r.optional||!1;if(this.currentProfile&&void 0!==(qT(this.currentProfile,a.value)??qT(this.currentProfile,t)))return r.optional||!1;if(a.value.includes("?."))return r.optional||!1}if("event"===r.role){const t=(a.normalized??a.value).toLowerCase();if(e.STRUCTURAL_NEVER_EVENT.has(t))return r.optional||!1}if("keyword"===a.kind){const e=(a.normalized??a.value).toLowerCase();if("then"===e||"end"===e&&"selector"!==t.peek(1)?.kind)return r.optional||!1;if(function(e,t){return uS[t]?.has(e.toLowerCase())??!1}(a.value,this.currentProfile?.code??""))return r.optional||!1}if("duration"===r.role){const t=(a.normalized??a.value).toLowerCase();if(e.POSITIONAL_OR_SCOPE_KEYWORDS.has(t))return r.optional||!1}if(r.optional&&void 0===i&&"event"!==r.role&&"action"!==r.role&&"keyword"!==r.valueShape&&"keyword"===a.kind){if((a.normalized??a.value).toLowerCase()in of)return!0}const o=this.tryMatchPositionalExpression(t);if(o)return r.expectedTypes&&r.expectedTypes.length>0&&!_T(o.type,r.expectedTypes)?r.optional||!1:(n.set(r.role,o),!0);const s=this.tryMatchCaretScopeExpression(t);if(s)return r.expectedTypes&&r.expectedTypes.length>0&&!_T(s.type,r.expectedTypes)?r.optional||!1:(n.set(r.role,s),!0);if("event"!==r.role&&(!r.expectedTypes||r.expectedTypes.includes("expression"))){const e=this.tryMatchBeepPrefixExpression(t);if(e)return n.set(r.role,e),!0;const i=this.tryMatchHyphenatedWord(t);if(i)return n.set(r.role,i),!0;const a=this.tryMatchOperatorRunExpression(t);if(a)return n.set(r.role,a),!0}if("pick"===this.currentPatternCommand&&"patient"===r.role&&(!r.expectedTypes||r.expectedTypes.includes("expression"))){const e=this.tryMatchPickRangeExpression(t);if(e)return n.set(r.role,e),!0}if(r.expectedTypes?.includes("property-path")){const e=this.tryMatchOfPossessiveExpression(t);if(e)return n.set(r.role,e),!0;const i=this.tryMatchPostNominalPossessiveExpression(t);if(i)return n.set(r.role,i),!0}const l=this.tryMatchPossessiveExpression(t);if(l)return r.expectedTypes&&r.expectedTypes.length>0&&!r.expectedTypes.includes(l.type)&&!r.expectedTypes.includes("expression")?r.optional||!1:(n.set(r.role,l),!0);const c=this.tryMatchMethodCallExpression(t);if(c)return r.expectedTypes&&r.expectedTypes.length>0&&!r.expectedTypes.includes(c.type)&&!r.expectedTypes.includes("expression")?r.optional||!1:(n.set(r.role,c),!0);const u="event"===r.role&&"on"===this.currentPatternCommand||e.DECLARATION_COMMANDS.has(this.currentPatternCommand??"")?null:this.tryMatchBareCallExpression(t);if(u)return r.expectedTypes&&r.expectedTypes.length>0&&!r.expectedTypes.includes(u.type)&&!r.expectedTypes.includes("expression")?r.optional||!1:(n.set(r.role,u),!0);const p=this.tryMatchPossessiveSelectorExpression(t);if(p)return r.expectedTypes&&r.expectedTypes.length>0&&!_T(p.type,r.expectedTypes)?r.optional||!1:(n.set(r.role,p),!0);const d=this.tryMatchPropertyAccessExpression(t,"condition"!==r.role);if(d)return r.expectedTypes&&r.expectedTypes.length>0&&!r.expectedTypes.includes(d.type)&&!r.expectedTypes.includes("expression")?r.optional||!1:(n.set(r.role,d),!0);const m=this.tryMatchSelectorPropertyExpression(t);if(m)return r.expectedTypes&&r.expectedTypes.length>0&&!_T(m.type,r.expectedTypes)?r.optional||!1:(n.set(r.role,m),!0);if("identifier"===a.kind&&"{"===a.value){const e=r.expectedTypes,i=1===e?.length&&"expression"===e[0]?this.tryMatchBraceRunExpression(t):!e?.length||e.includes("literal")?this.tryMatchBraceRunLiteral(t):null;if(i)return n.set(r.role,i),!0}if("style"===r.role&&1===r.expectedTypes?.length&&"expression"===r.expectedTypes[0]){const e=vS(t);if(e)return n.set(r.role,{type:"expression",raw:e}),!0}const f=this.tokenToSemanticValue(a);if(!f)return r.optional||!1;if(r.expectedTypes&&r.expectedTypes.length>0&&!r.expectedTypes.includes(f.type)){const e="selector"===f.type&&(f.value+"").startsWith("@"),t=r.expectedTypes.some(e=>"expression"===e||"reference"===e);if(!e||!t)return r.optional||!1}if(n.set(r.role,"keyword"===r.valueShape&&"expression"===f.type?LT((f.raw??"")+""):f),t.advance(),"event"===r.role){const e=t.peek();e&&"selector"===e.kind&&e.value.startsWith("[")&&"value"in f&&(n.set(r.role,LT(`${f.value+""}${e.value}`)),t.advance());const a=t.peek();if(a&&("particle"===a.kind||"keyword"===a.kind)&&"source"===(a.normalized??"").toLowerCase()&&!this.patternTokenWouldMatch(i,a)){const e=t.peek(1);if(e&&("selector"===e.kind||"identifier"===e.kind)){t.advance();const e=this.tokenToSemanticValue(t.advance());e&&!n.has("source")&&n.set("source",e)}}}return!0}patternTokenWouldMatch(e,t){return!!e&&("literal"===e.type?"none"!==this.getMatchType(t,e.value)||!!e.alternatives?.some(e=>"none"!==this.getMatchType(t,e)):"group"===e.type&&this.patternTokenWouldMatch(e.tokens?.[0],t))}tryMatchPositionalExpression(e){const t=JT(e.tokens,e.position(),this.currentProfile);if(!t)return null;for(let r=0;t.consumed>r;r++)e.advance();return{type:"expression",raw:t.parts.map(e=>e.text).join(" ")}}tryMatchCaretScopeExpression(e){const t=e.peek();if(!t||"identifier"!==t.kind||!t.value.startsWith("^"))return null;const r=e.peek(1),n=e.peek(2),i=(r?.normalized??"").toLowerCase(),a=!!r&&("on"===r.value.toLowerCase()||"destination"===i||"on"===i);return r&&n&&"selector"===n.kind&&a?(e.advance(),e.advance(),e.advance(),{type:"expression",raw:`${t.value} on ${n.value}`}):null}isOfPossessiveMarker(e){return HT(this.currentProfile,e)}static isBareWordToken(e){return!!e&&/^[A-Za-z_][A-Za-z0-9_]*$/.test(e.value)}static tokensAdjacent(e,t){return void 0!==e?.position?.end&&void 0!==t?.position?.start&&e.position.end===t.position.start}tryMatchBeepPrefixExpression(t){const r=t.peek(),n=t.peek(1);if(!r||!n||"!"!==n.value)return null;if("beep"!==(r.normalized??r.value).toLowerCase())return null;if(!(void 0!==r.position?.end&&void 0!==n.position?.start&&r.position.end===n.position.start))return null;const i=t.mark(),a=t.position();if(t.advance(),t.advance(),!this.tryConsumeRunOperand(t))return t.reset(i),null;for(;;){const r=t.peek();if(!r||!e.RUN_OPERATORS.has(r.value))break;const n=t.mark();if(t.advance(),!this.tryConsumeRunOperand(t)){t.reset(n);break}}const o=cS(t.tokens.slice(a,t.position()),this.currentProfile);return{type:"expression",raw:o,value:o}}tryMatchHyphenatedWord(t){const r=t.peek();if(!e.isBareWordToken(r))return null;let n=1;const i=[r.value];for(;;){const r=t.peek(n),a=t.peek(n+1);if(!(r&&"-"===r.value&&e.isBareWordToken(a)&&e.tokensAdjacent(t.peek(n-1),r)&&e.tokensAdjacent(r,a)))break;i.push(a.value),n+=2}if(2>i.length)return null;for(let e=0;n>e;e++)t.advance();return LT(i.join("-"),"string")}tryMatchOperatorRunExpression(t){const r=t.mark(),n=t.position();if(!this.tryConsumeRunOperand(t))return t.reset(r),null;let i=1;for(;;){const r=t.peek();if(!r||!e.RUN_OPERATORS.has(r.value))break;const n=t.mark();if(t.advance(),!this.tryConsumeRunOperand(t)){t.reset(n);break}i++}if(2>i)return t.reset(r),null;const a=cS(t.tokens.slice(n,t.position()),this.currentProfile);return{type:"expression",raw:a,value:a}}isPickRangeSeparator(t){const r=(t.normalized??t.value).toLowerCase();if(e.PICK_RANGE_SEPARATORS.has(r))return!0;const n=this.currentProfile?.code;return!!n&&(e.PICK_RANGE_SEPARATORS_BY_LANG[n]?.has(t.value.toLowerCase())??!1)}tryMatchPickRangeExpression(t){const r=t.mark(),n=t.position();if(!this.tryConsumePickRangeOperand(t))return t.reset(r),null;const i=t.peek();if(!i||!this.isPickRangeSeparator(i))return t.reset(r),null;if(t.advance(),!this.tryConsumePickRangeOperand(t))return t.reset(r),null;const a=t.peek();a&&e.PICK_RANGE_MODES.has((a.normalized??a.value).toLowerCase())&&t.advance();const o=t.tokens.slice(n,t.position()),[s,,l,c]=o,u=e=>"keyword"===e.kind?e.normalized??e.value:e.value;let p=`${u(s)} to ${u(l)}`;return c&&(p+=" "+(c.normalized??c.value).toLowerCase()),{type:"expression",raw:p,value:p}}tryConsumePickRangeOperand(e){const t=e.peek();if(!t)return!1;const r=(t.normalized??t.value).toLowerCase();if(this.isPickRangeSeparator(t))return!1;return!("literal"!==t.kind&&"identifier"!==t.kind&&("keyword"!==t.kind||"start"!==r&&"end"!==r))&&(e.advance(),!0)}tryConsumeRunOperand(t){const r=t.peek();if(!r)return!1;if("("===r.value){const e=t.mark();let r=0;for(;!t.isAtEnd();){const e=t.advance();if("("===e.value)r++;else if(")"===e.value&&(r--,0===r))return!0}return t.reset(e),!1}return!!this.tryMatchPossessiveExpression(t)||!("literal"!==r.kind&&"identifier"!==r.kind&&"selector"!==r.kind&&"keyword"!==r.kind||e.RUN_OPERATORS.has(r.value)||")"===r.value)&&(t.advance(),!0)}isPossessorToken(e){if(!this.currentProfile)return!1;for(const t of[e.value,e.normalized].filter(Boolean))if(qT(this.currentProfile,t)??qT(this.currentProfile,t.toLowerCase()))return!0;return!1}isBareWordPropertyHead(e){return"identifier"===e.kind&&(!/^[$:@#.*]/.test(e.value)&&(!this.isStructuralKeyword(e.value)&&((!e.normalized||!this.isStructuralKeyword(e.normalized))&&((!e.normalized||!this.isRoleMarkerConcept(e.normalized))&&!this.isPossessorToken(e)))))}toEnglishProperty(e){return this.currentProfile?eS(this.currentProfile.code,e):e}tryMatchOfPossessiveExpression(e){const t=e.peek();if(!t)return null;if("selector"!==t.kind&&!this.isBareWordPropertyHead(t))return null;const r=e.mark();e.advance();const n=e.peek();if(!n||!this.isOfPossessiveMarker(n))return e.reset(r),null;e.advance();const i=e.peek();return i&&"selector"===i.kind?(e.advance(),OT(AT(i.value),this.toEnglishProperty(t.value))):(e.reset(r),null)}tryMatchPossessiveExpression(t){const r=t.peek();if(!r)return null;if(!this.currentProfile)return null;const n=[r.value,r.normalized].filter(Boolean);let i;for(const e of n)if(i=qT(this.currentProfile,e)??qT(this.currentProfile,e.toLowerCase()),i)break;if(!i)return null;const a=t.mark();t.advance();const o=this.currentProfile.possessive?.connectors;if(o&&o.length>0){const e=t.peek();if(e){const r=e.value.toLowerCase(),n=(e.normalized??"").toLowerCase();o.some(e=>e.toLowerCase()===r||e.toLowerCase()===n)&&t.advance()}}const s=t.peek();if(!s)return t.reset(a),null;if(function(e,t){const r=ry.find(t=>t.lang===e);if(!r)return!1;const n=t.toLowerCase();return n===r.at.toLowerCase()||n===r.of.toLowerCase()||n===r.end.toLowerCase()}(this.currentProfile.code,s.value))return t.reset(a),null;if("identifier"===s.kind||"keyword"===s.kind&&!this.isStructuralKeyword(s.value)&&(!s.normalized||!this.isStructuralKeyword(s.normalized))&&(!s.normalized||!this.isRoleMarkerConcept(s.normalized))&&(!s.normalized||!e.COMMAND_ACTION_KEYWORDS.has(s.normalized.toLowerCase()))||"selector"===s.kind&&s.value.startsWith("*")||"selector"===s.kind&&s.value.startsWith("@")||"selector"===s.kind&&s.value.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(s.value)){t.advance();let r=s.value;"selector"===s.kind&&r.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(r)&&(r=r.substring(1)),r=this.toEnglishProperty(r);let n=r;for(;;){const e=t.peek();if("selector"!==e?.kind||!e.value.startsWith(".")||!/^\.[a-zA-Z_]\w*/.test(e.value)){if("?"===e?.value){const e=t.peek(1);if("selector"===e?.kind&&e.value.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(e.value)){n+="?"+e.value,t.advance(),t.advance();continue}}break}n+=e.value,t.advance()}const a=t.peek();if(a&&a.value.startsWith("(")){let r="",i=0,a=0;for(;!t.isAtEnd()&&a++<e.MAX_METHOD_ARGS+2;){const e=t.peek();if(!e)break;r+=e.value,t.advance();for(const t of e.value)"("===t?i++:")"===t&&i--;if(0>=i)break}n+=r}return OT(PT(i),n)}return t.reset(a),null}tryMatchPostNominalPossessiveExpression(e){if(!this.currentProfile)return null;if("after-object"!==this.currentProfile.possessive?.markerPosition)return null;const t=e.peek();if(!t)return null;const r="selector"===t.kind&&t.value.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(t.value);if(!("identifier"===t.kind&&!this.isStructuralKeyword(t.value)&&!(t.normalized&&this.isStructuralKeyword(t.normalized))&&!(t.normalized&&this.isRoleMarkerConcept(t.normalized))||"selector"===t.kind&&(t.value.startsWith("*")||t.value.startsWith("@"))||r)||this.isPossessorToken(t))return null;const n=e.mark();let i=t.value;r&&(i=i.substring(1)),e.advance(),i=this.toEnglishProperty(i);let a=i;for(;"selector"===e.peek()?.kind&&e.peek().value.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(e.peek().value);)a+=e.peek().value,e.advance();const o=e.peek();if(!o)return e.reset(n),null;let s;for(const e of[o.value,o.normalized].filter(Boolean))if(s=qT(this.currentProfile,e)??qT(this.currentProfile,e.toLowerCase()),s)break;return s?(e.advance(),OT(PT(s),a)):(e.reset(n),null)}isStructuralKeyword(e){return new Set(["into","in","to","from","at","by","with","without","before","after","of","as","on","then","end","else","if","repeat","while","for","toggle","add","remove","put","set","show","hide","increment","decrement","send","trigger","call"]).has(e.toLowerCase())}isRoleMarkerConcept(e){return Xh.has(e.toLowerCase())}static tokenLooksLikeEvent(e){if("selector"===e.kind||"url"===e.kind)return!1;if("literal"===e.kind)return!1;const t=e.value;if(/[/#@*]/.test(t))return!1;if(t.startsWith('"')||t.startsWith("'")||t.startsWith("`"))return!1;const r=e.normalized?.toLowerCase();return!r||!zS.has(r)}tryMatchBraceRunLiteral(t){const r=t.peek();if(!r||"identifier"!==r.kind||"{"!==r.value)return null;const n=t.mark();t.advance();const i=["{"];let a=1,o=0;for(;!t.isAtEnd()&&o++<e.MAX_BRACE_RUN_TOKENS;){const e=t.advance();if(!e)break;if("{"===e.value)a++;else if("}"===e.value&&(a--,0===a))return i.push("}"),LT(i.join(" "));i.push(e.value)}return t.reset(n),null}tryMatchBraceRunExpression(t){const r=t.peek();if(!r||"identifier"!==r.kind||"{"!==r.value)return null;const n=t.mark();let i="",a=-1,o=0,s=0;for(;!t.isAtEnd()&&s++<e.MAX_BRACE_RUN_TOKENS;){const e=t.advance();if(!e)break;if(a>=0&&e.position.start>a&&(i+=" ".repeat(e.position.start-a)),i+=e.value,a=e.position.end,"{"===e.value)o++;else if("}"===e.value&&(o--,0===o))return{type:"expression",raw:i}}return t.reset(n),null}tryMatchBareCallExpression(t){const r=t.peek();if(!r||"identifier"!==r.kind)return null;if(!/^[A-Za-z_][\w$]*$/.test(r.value))return null;const n=t.peek(1);if(!n||"("!==n.value)return null;const i=t.mark();t.advance();const a=t.advance();let o="",s=a.position?.end,l=!1,c=0;for(;!t.isAtEnd()&&c++<e.MAX_METHOD_ARGS+2;){const e=t.peek();if(!e)break;if(")"===e.value){t.advance(),l=!0;break}o+=(""===o||void 0!==s&&e.position?.start===s?"":" ")+e.value,s=e.position?.end,t.advance()}return l?{type:"expression",raw:`${r.value}(${o})`}:(t.reset(i),null)}tryMatchMethodCallExpression(t){const r=t.peek();if(!r||"selector"!==r.kind)return null;const n=t.mark();t.advance();const i=t.peek();if(!i||"operator"!==i.kind||"."!==i.value)return t.reset(n),null;t.advance();const a=t.peek();if(!a||"identifier"!==a.kind)return t.reset(n),null;t.advance();const o=t.peek();if(!o||"punctuation"!==o.kind||"("!==o.value)return t.reset(n),null;t.advance();const s=[];for(;!t.isAtEnd()&&e.MAX_METHOD_ARGS>s.length;){const e=t.peek();if(!e)break;if("punctuation"===e.kind&&")"===e.value){t.advance();break}"punctuation"!==e.kind||","!==e.value?(s.push(e.value),t.advance()):t.advance()}return{type:"expression",raw:`${r.value}.${a.value}(${s.join(", ")})`}}tryMatchPropertyAccessExpression(t,r=!0){const n=t.peek();if(!n)return null;if("identifier"!==n.kind&&"keyword"!==n.kind)return null;const i=t.mark();t.advance();const a=n.value.toLowerCase(),o=t.peek();if(("identifier"===n.kind||e.PROPERTY_ACCESS_BASES.has(a))&&o&&"selector"===o.kind&&/^\.[a-zA-Z_]/.test(o.value)){let i=n.value;const o=[];let s=0;for(;e.MAX_PROPERTY_DEPTH>s;){const e=t.peek();if(!e||"selector"!==e.kind||!/^\.[a-zA-Z_]/.test(e.value))break;i+="."+e.value.slice(1),o.push(e.value.slice(1)),t.advance(),s++}const l=t.peek(),c=!!l&&l.value.startsWith("(");if(r&&!c&&o.length>0&&jT(a))return OT(PT(a),o.join("."));if(c){const e=t.mark(),r=[];let n=0,a=!1;for(;!t.isAtEnd();){const e=t.peek();if(!e)break;if("("===e.value)n++;else if(")"===e.value){if(r.push(e.value),t.advance(),n--,0===n&&(a=!0),a)break;continue}r.push(e.value),t.advance()}a?i+=r.join(""):t.reset(e)}return{type:"expression",raw:i}}const s=t.peek();if(!s||"operator"!==s.kind||"."!==s.value)return t.reset(i),null;t.advance();const l=t.peek();if(!l||"identifier"!==l.kind)return t.reset(i),null;t.advance();let c=`${n.value}.${l.value}`,u=1;for(;!t.isAtEnd()&&e.MAX_PROPERTY_DEPTH>u;){const e=t.peek();if(!e||"operator"!==e.kind||"."!==e.value)break;t.advance();const r=t.peek();if(!r||"identifier"!==r.kind)break;t.advance(),c+="."+r.value,u++}const p=t.peek();if(p&&"punctuation"===p.kind&&"("===p.value){t.advance();const r=[];let n=0;for(;!t.isAtEnd()&&e.MAX_METHOD_ARGS>r.length;){const e=t.peek();if(!e)break;if("punctuation"===e.kind&&")"===e.value){if(0===n){t.advance();break}n--}"punctuation"===e.kind&&"("===e.value&&n++,"punctuation"!==e.kind||","!==e.value?(r.push(e.value),t.advance()):t.advance()}return{type:"expression",raw:`${c}(${r.join(", ")})`}}const d=n.value.toLowerCase();if(r&&jT(d)){const e=c.split(".").slice(1).join(".");return OT(PT(d),e)}return{type:"expression",raw:c}}tryMatchPossessiveSelectorExpression(e){const t=e.peek();if(!t||"selector"!==t.kind)return null;const r=e.mark();e.advance();const n=e.peek(),i=this.currentProfile?.possessive?.marker?.replace(/^-/,""),a=!!n&&"punctuation"===n.kind&&"'s"===n.value,o=!!n&&"'"===n.value&&"s"===(e.peek(1)?.value??"").toLowerCase(),s=(()=>{if(!this.currentPatternCommand)return!1;if("source"!==(n?.normalized??"").toLowerCase())return!1;const e=of[this.currentPatternCommand];return!!e&&e.roles.some(e=>"source"===e.role)})();if(!a&&!!(!n||!i||"'s"===i||n.value!==i||"particle"!==n.kind&&"punctuation"!==n.kind||s)&&!o)return e.reset(r),null;e.advance(),o&&e.advance();const l=e.peek();if(!l)return e.reset(r),null;return"identifier"===l.kind||(a||o)&&("selector"===l.kind||"keyword"===l.kind)?(e.advance(),OT(AT(t.value),this.toEnglishProperty(l.value))):(e.reset(r),null)}tryMatchSelectorPropertyExpression(e){const t=e.peek();if(!t||"selector"!==t.kind)return null;if(!t.value.startsWith("#"))return null;const r=e.mark();e.advance();const n=e.peek();if(!n||"selector"!==n.kind)return e.reset(r),null;if(!n.value.startsWith("."))return e.reset(r),null;e.peek(1);e.advance();const i=n.value.slice(1);return OT(AT(t.value),i)}matchGroupToken(e,t,r,n){const i=e.mark(),a=new Map(r);if(!this.matchTokenSequence(e,t.tokens,r,n)){e.reset(i);for(const e of r.keys())a.has(e)||r.delete(e);for(const[e,t]of a)r.get(e)!==t&&r.set(e,t);return t.optional||!1}return!0}getMatchType(e,t){if(e.value===t)return"exact";if(e.normalized===t)return"normalized";if(e.stem===t&&void 0!==e.stemConfidence&&e.stemConfidence>=.7)return"stem";if("keyword"===e.kind&&e.value.toLowerCase()===t.toLowerCase())return"case-insensitive";if("keyword"===e.kind){const r=Fp(e.value).toLowerCase();if(r&&r===Fp(t).toLowerCase())return"case-insensitive"}return"none"}tokenToSemanticValue(e){switch(e.kind){case"selector":return AT(e.value);case"literal":return this.parseLiteralValue(e.value);case"keyword":const t=(e.normalized||e.value).toLowerCase();return jT(t)?PT(t):LT(e.normalized||e.value);case"identifier":if(e.value.startsWith("@"))return AT(e.value);if(e.value.startsWith(":")||e.value.startsWith("$"))return PT(e.value);const r=e.value.toLowerCase();return jT(r)?PT(r):{type:"expression",raw:e.value};case"url":return LT(e.value,"string");default:return null}}parseLiteralValue(e){if(e.startsWith('"')||e.startsWith("'")||e.startsWith("`")||e.startsWith("\u300c")){return LT(e.slice(1,-1),"string")}if("true"===e)return LT(!0,"boolean");if("false"===e)return LT(!1,"boolean");const t=e.match(/^(\d+(?:\.\d+)?)(ms|s|m|h)?$/);if(t){const r=parseFloat(t[1]);return t[2]?LT(e,"duration"):LT(r,"number")}const r=parseFloat(e);return isNaN(r)?LT(e,"string"):LT(r,"number")}applyExtractionRules(e,t){for(const[r,n]of Object.entries(e.extraction)){const e=t.get(r);if(e){if(n.transform){t.set(r,n.transform("literal"===e.type?e.value+"":(e.raw??"")+""))}}else void 0!==n.value?t.set(r,{type:"literal",value:n.value}):n.default&&t.set(r,{...n.default,implicit:!0})}}isOptional(e){return"literal"!==e.type&&!0===e.optional}skipNoiseWords(t){const r=t.peek();if(!r)return;const n=r.value.toLowerCase();if(e.ENGLISH_NOISE_WORDS.has(n)){const r=t.mark();t.advance();const n=t.peek();if(n&&("selector"===n.kind||"identifier"===n.kind))return;const i=t.peek(1);if(n&&"keyword"===n.kind&&i&&"selector"===i.kind&&/^\.[a-zA-Z_]/.test(i.value))return;const a=n?(n.normalized??n.value).toLowerCase():"";if(n&&e.POSITIONAL_OR_SCOPE_KEYWORDS.has(a))return;const o=t.peek(1),s=o?(o.normalized??o.value).toLowerCase():"",l="SOV"!==this.currentProfile?.wordOrder&&e.COMMAND_ACTION_KEYWORDS.has(s),c=!o||"particle"===o.kind||e.CLAUSE_BOUNDARY_KEYWORDS.has(s)||l;if(n&&"keyword"===n.kind&&"en"!==this.currentProfile?.code&&jT(a)&&c)return;if(n&&"keyword"===n.kind&&"en"===this.currentProfile?.code&&jT(a))return;t.reset(r)}"class"===n&&t.advance()}extractEventModifiers(e){const t={};let r=!1;for(;!e.isAtEnd();){const n=e.peek();if(!n||"event-modifier"!==n.kind)break;const i=n.metadata;if(!i)break;switch(r=!0,i.modifierName){case"once":t.once=!0;break;case"debounce":"number"==typeof i.value&&(t.debounce=i.value);break;case"throttle":"number"==typeof i.value&&(t.throttle=i.value);break;case"queue":"first"!==i.value&&"last"!==i.value&&"all"!==i.value&&"none"!==i.value||(t.queue=i.value)}e.advance()}return r?t:void 0}};xS.POSITIONAL_OR_SCOPE_KEYWORDS=new Set(["first","last","next","previous","random","closest","parent"]),xS.STRUCTURAL_NEVER_EVENT=new Set(["if","unless","else","end","then"]),xS.PROPERTY_ACCESS_BASES=new Set(["it","me","you","my","its","your","event","result","target","detail","body","window","document","self","this"]),xS.COMMAND_ACTION_KEYWORDS=XT,xS.CLAUSE_BOUNDARY_KEYWORDS=new Set(["then","and","or","end","else"]),xS.RUN_OPERATORS=new Set(["+","-","*","/"]),xS.PICK_RANGE_SEPARATORS=new Set(["to"]),xS.PICK_RANGE_SEPARATORS_BY_LANG={ar:new Set(["\u0625\u0644\u0649"]),bn:new Set(["\u09a5\u09c7\u0995\u09c7"]),de:new Set(["zu","bis"]),es:new Set(["a"]),fr:new Set(["\u00e0"]),he:new Set(["\u05e2\u05dc","\u05e2\u05d3"]),hi:new Set(["\u0938\u0947"]),id:new Set(["ke"]),it:new Set(["in","a"]),ja:new Set(["\u304b\u3089"]),ko:new Set(["\ubd80\ud130"]),ms:new Set(["ke"]),pl:new Set(["do"]),pt:new Set(["para","a"]),qu:new Set(["kama"]),ru:new Set(["\u0432","\u0434\u043e"]),sw:new Set(["kwa","hadi"]),th:new Set(["\u0e43\u0e19","\u0e16\u0e36\u0e07"]),tl:new Set(["sa"]),tr:new Set(["ile"]),uk:new Set(["\u0432","\u0434\u043e"]),vi:new Set(["v\u00e0o","\u0111\u1ebfn"]),zh:new Set(["\u5230"])},xS.PICK_RANGE_MODES=new Set(["inclusive","exclusive"]),xS.MAX_BRACE_RUN_TOKENS=64,xS.MAX_PROPERTY_DEPTH=10,xS.MAX_METHOD_ARGS=20,xS.DECLARATION_COMMANDS=new Set(["behavior","def","install"]),xS.ENGLISH_NOISE_WORDS=new Set(["the","a","an"]);var ES=xS,TS=new ES;function SS(e,t){return Pf(e,t)}function CS(){return Lf()}Rf(),Bg(),nk(),yk(),jk(),Kk(),lw(),yw(),fy(),Rf(),wf(),ny(),Rf();var AS=["if","unless","repeat","for","while"],LS=/^[A-Z][A-Za-z0-9_]*$/;function jS(e,t){const r=new Set([t]),n=Af(e),i=n?.keywords?.[t];if(i){i.primary&&r.add(i.primary.toLowerCase());for(const e of i.alternatives??[])r.add(e.toLowerCase())}return r}function PS(e,t){return!!t.has(e.value.toLowerCase())||!!e.normalized&&t.has(e.normalized.toLowerCase())}var OS=new Set(AS);function NS(e,t){const r=e.normalized?.toLowerCase();return r?OS.has(r):t.some(t=>PS(e,t))}var RS=new Set(["me","it","you","the","body","window","document","its","event","result","target","self","this","them","parent","next","previous","closest","first","last"]),MS=new Set(["destination","source","style","patient","on","from","to"]);function IS(e){if(!e)return!1;if("selector"===e.kind)return!1;const t=(e.normalized??e.value).toLowerCase(),r=e.value.toLowerCase();return!RS.has(t)&&!RS.has(r)&&!MS.has(t)}var WS=new Set(["ja","ko"]);function _S(e){const t=new Set;e?.primary&&t.add(e.primary.toLowerCase());for(const r of e?.alternatives??[])t.add(r.toLowerCase());return t}function qS(e,t){const r=[];let n=t.position.end;const i=e.slice(t.position.end).match(/^\s*\(([^)]*)\)/);if(i){n=t.position.end+i[0].length;for(const e of i[1].split(/[,\u060c\u3001]/)){const t=e.trim();t&&r.push(t)}}return{parameters:r,headerEnd:n}}function $S(e,t,r){let n=t+1;if(n>=e.length)return-1;const i=_S(Af(r)?.roleMarkers?.patient);return i.size>0&&PS(e[n],i)&&n++,e.length>n?n:-1}var VS=/^[a-zA-Z_$][\w$]*(?:\.[a-zA-Z_$][\w$]*)*$/;function DS(e,t,r){if(!Af(t))return null;const n=jS(t,"behavior"),i=jS(t,"def"),a=e.toLowerCase(),o=[...n].some(e=>a.includes(e)),s=/\bdef\b/.test(a)||[...i].some(e=>"def"!==e&&a.includes(e));if(!o&&!s)return null;const l=SS(e,t).tokens;if(2>l.length)return null;if(PS(l[0],n))return KS(e,t,l,r,0);const c=l.findIndex((e,t)=>t>0&&PS(e,n));if(c>0&&LS.test(l[0].value))return KS(e,t,l,r,c);if(PS(l[0],i))return FS(e,t,l,r,0);const u=l.findIndex((e,t)=>t>0&&PS(e,i));return u>0&&function(e,t,r){const n=Af(r);if("SOV"!==n?.wordOrder)return!1;if(!VS.test(e[0].value))return!1;if(t!==function(e){let t=1;if("("===e[1]?.value){let r=0,n=1;for(;e.length>n;n++)if("("===e[n].value)r++;else if(")"===e[n].value&&0===--r)break;if(n>=e.length)return-1;t=n+1}return t+1}(e))return!1;const i=_S(n.roleMarkers?.patient);return 0!==i.size&&PS(e[t-1],i)}(l,u,t)?FS(e,t,l,r,u):null}function BS(e){return e.length>0?e.reduce((e,t)=>e+t,0)/e.length:0}function HS(e){const t=[];for(const r of e){const e=r.statements;"compound"===r.kind&&Array.isArray(e)?t.push(...e):t.push(r)}return t}function KS(e,t,r,n,i){const a=i>0,o=a?0:$S(r,i,t);if(0>o)return null;const s=r[o],l=s.value;if(!LS.test(l))return null;const{parameters:c,headerEnd:u}=qS(e,s);let p=a?i+1:r.findIndex(e=>e.position.start>=u);p>o||(p=o+1);const d=jS(t,"init"),m=jS(t,"end"),f=AS.map(e=>jS(t,e)),h=e=>NS(e,f),y=e=>PS(e,m),v=[],g=[],k=[];let w=!1,b=0,z=p;for(let i=p;r.length>i;i++){const a=r[i];if(y(a)){if(b>0){b--;continue}if(i===z){w=!0;break}if(PS(r[z],d)){const i=e.slice(r[z].position.end,a.position.start).trim();if(i)try{const e=HS(n.body(i,t));g.push(...e),k.push(BS(e.map(e=>e.metadata?.confidence??.75)))}catch{k.push(0)}}else{const i=e.slice(r[z].position.start,a.position.start).trim();try{const e=n.statement(i,t);if(e&&"event-handler"===e.kind){const t=e;v.push(t);k.push(!t.body||0===t.body.length?.2:t.metadata?.confidence??.75)}else k.push(0)}catch{k.push(0)}}z=i+1}else h(a)&&b++}if(0===v.length&&0===g.length)return null;const x=(w?1:.8)*BS(k);return function(e,t,r,n,i){const a={kind:"behavior",action:"behavior",roles:new Map,name:e,parameters:t,eventHandlers:r};return void 0!==n&&n.length>0&&(a.initBlock=n),void 0!==i&&(a.metadata=i),a}(l,c,v,g.length>0?g:void 0,{sourceLanguage:t,confidence:x,sourceText:e})}function FS(e,t,r,n,i){const a=i>0,o=a?0:$S(r,i,t);if(0>o)return null;const s=r[o],l=s.value;if(!VS.test(l))return null;const{parameters:c,headerEnd:u}=qS(e,s);let p=a?i+1:r.findIndex(e=>e.position.start>=u);p>o||(p=o+1);const d=jS(t,"end"),m=AS.map(e=>jS(t,e)),f=e=>NS(e,m),h=e=>PS(e,d);let y=0,v=-1;for(let e=p;r.length>e;e++)if(h(r[e])){if(0===y){v=e;break}y--}else f(r[e])&&y++;const g=e.slice(r[p]?.position.start??u,0>v?e.length:r[v].position.start).trim();if(!g)return null;let k;try{k=HS(n.body(g,t))}catch{return null}if(0===k.length)return null;let w=BS(k.map(e=>e.metadata?.confidence??.75));return 0>v&&(w*=.8),function(e,t,r,n){const i={kind:"def",action:"def",roles:new Map,name:e,parameters:t,body:r};return void 0!==n&&(i.metadata=n),i}(l,c,k,{sourceLanguage:t,confidence:w,sourceText:e})}var US=["live","eventsource","socket","worker","intercept"],GS=new Set(["intercept"]),ZS=new Set(["eventsource","socket","worker"]),YS=new Set(["eventsource","socket"]),XS=new Set(["worker"]);function JS(e,t,r,n,i){if("live"===e)return r+1;if(r>0){let i=r+1;return"eventsource"===e&&(i+=function(e,t,r){const n=_S(Af(r)?.roleMarkers?.source);return 0!==n.size&&e.length>t+1&&(PS(e[t],n)||PS(e[t+1],n))?2:0}(t,i,n)),i}const a=$S(t,r,n);if(0>a)return-1;if("worker"===e)return a+1;const o=jS(n,"on"),s=0>i?t.length:i;for(let e=a+1;s>e;e++)if(PS(t[e],o)&&IS(t[e+1]))return e;return s}function QS(e,t,r){if(!Af(t))return null;const n=e.toLowerCase();let i=!1;for(const e of US){for(const r of jS(t,e))if(r&&n.includes(r)){i=!0;break}if(i)break}if(!i)return null;const a=SS(e,t).tokens;if(2>a.length)return null;const o=function(e,t){for(const r of US)if(PS(e[0],jS(t,r)))return{action:r,keywordIdx:0};if("SOV"!==Af(t)?.wordOrder)return null;const r=Math.min(e.length,6);for(let n=1;r>n;n++)for(const r of US)if("live"!==r&&PS(e[n],jS(t,r))&&(!ZS.has(r)||LS.test(e[0].value))&&("intercept"!==r||2>=n))return{action:r,keywordIdx:n};return null}(a,t);return o?function(e,t,r,n,i,a){const o=jS(t,"end"),s=AS.map(e=>jS(t,e)),l=e=>NS(e,s),c=e=>PS(e,o),u=function(e,t,r,n){if(!ZS.has(e))return;const i=r>0?0:$S(t,r,n);return 0>i?void 0:t[i].value}(i,r,a,t);if(ZS.has(i)&&(!u||!LS.test(u)))return null;const p=r=>({sourceLanguage:t,confidence:r,sourceText:e}),d=eC(r,a+1,c,l);if(GS.has(i))return 0>d||d===r.length-1?MT(i,[],u,p(0>d?.8:1)):null;const m=JS(i,r,a,t,d);if(0>m||m>r.length)return null;const f=[],h=[];let y=!1;const v=XS.has(i);if(v||YS.has(i)){const i=v?"def":"event-handler";let a=0,o=m;for(let s=m;r.length>s;s++){const u=r[s];if(c(u)){if(a>0){a--;continue}if(y=!0,s===o)break;const l=e.slice(r[o].position.start,v?u.position.end:u.position.start).trim();try{const e=n.statement(l,t);if(e&&e.kind===i){const t=e;f.push(t);h.push(!t.body||0===t.body.length?.2:t.metadata?.confidence??.75)}else h.push(0)}catch{h.push(0)}o=s+1}else l(u)&&a++}}else{const i=eC(r,m,c,l);y=i>=0;const a=e.slice(r[m].position.start,0>i?e.length:r[i].position.start).trim();if(!a)return null;try{f.push(...HS(n.body(a,t)))}catch{return null}if(0===f.length)return null;h.push(...f.map(e=>e.metadata?.confidence??.75))}if(0===f.length&&!y)return null;const g=y?1:.8,k=h.length>0?g*BS(h):g;return MT(i,f,u,p(k))}(e,t,a,r,o.action,o.keywordIdx):null}function eC(e,t,r,n){let i=0;for(let a=t;e.length>a;a++)if(r(e[a])){if(0===i)return a;i--}else n(e[a])&&i++;return-1}Ax(),uy();var tC={debounced:"debounce",debounce:"debounce",throttled:"throttle",throttle:"throttle"},rC=[["\u043e\u0434\u0438\u043d","_","\u0440\u0430\u0437"],["\u043e\u0434\u0438\u043d_\u0440\u0430\u0437"],["\u043e\u0434\u043d\u0430\u0436\u0434\u044b"],["m\u1ed9t","l\u1ea7n"],["once"]],nC=/^(\d+)(ms|s|m)?$/,iC=new Set(["selector","literal","url","event-modifier"]);function aC(e){const t=e.match(nC);if(!t)return null;let r=parseInt(t[1],10);const n=t[2]||"ms";return"s"===n?r*=1e3:"m"===n&&(r*=6e4),r}Rf(),Ax();var oC=new Set(["repeat","for","while","tell"]),sC=new Set(["js"]),lC=class{render(e,t){if("compound"===e.kind)return this.renderCompound(e,t);if("behavior"===e.kind)return this.renderBehavior(e,t);if("def"===e.kind)return this.renderDef(e,t);if("conditional"===e.kind)return this.renderConditional(e,t);const r=function(e,t){return Of(e).filter(e=>e.command===t).sort((e,t)=>t.priority-e.priority)}(t,e.action);if(0===r.length)return this.renderExplicit(e);const n=this.findBestPattern(e,r);return n?this.renderWithPattern(e,n):this.renderExplicit(e)}renderCompound(e,t){if(e.statements.length>1&&e.statements.every(e=>"event-handler"===e.kind)){const r=this.keyword(t,"end"),n=[];for(const i of e.statements)n.push(this.render(i,t),r);return n.join("\n")}const r=e.statements.map(e=>this.render(e,t)),n=this.getChainWord(e.chainType,t);let i=r[0]??"";for(let a=1;r.length>a;a++){const o=e.statements[a-1],s=e.statements[a],l="command"===o.kind&&oC.has(o.action),c="command"===o.kind&&"bind"===o.action&&"command"===s.kind&&"bind"===s.action;"command"===o.kind&&sC.has(o.action)&&(i+=" "+this.keyword(t,"end"));i+=(l||c?" ":` ${n} `)+r[a]}return i}renderConditional(e,t){const r=e.roles.get("condition"),n=r?this.valueToNaturalString(r,t):"",i=[`${this.keyword(t,"if")} ${n}`.trim()],a=this.joinStatements(e.thenBranch,t);return a&&i.push(a),e.elseBranch&&e.elseBranch.length>0&&i.push(this.keyword(t,"else"),this.joinStatements(e.elseBranch,t)),i.push(this.keyword(t,"end")),i.join(" ")}joinStatements(e,t){const r=e.map(e=>this.render(e,t)),n=this.keyword(t,"then");let i=r[0]??"";for(let a=1;r.length>a;a++){const o=e[a-1],s="command"===o.kind&&oC.has(o.action);"command"===o.kind&&sC.has(o.action)&&(i+=" "+this.keyword(t,"end")),i+=(s?" ":` ${n} `)+r[a]}return i}keyword(e,t){return Af(e)?.keywords?.[t]?.primary??t}renderBlockHeader(e,t,r){return r.length>0?`${e} ${t}(${r.join(", ")})`:`${e} ${t}`}renderBehavior(e,t){const r=this.keyword(t,"end"),n=[this.renderBlockHeader(this.keyword(t,"behavior"),e.name,e.parameters)];for(const i of e.eventHandlers)n.push(" "+this.render(i,t)," "+r);if(e.initBlock&&e.initBlock.length>0){n.push(" "+this.keyword(t,"init"));for(const r of e.initBlock)n.push(" "+this.render(r,t));n.push(" "+r)}return n.push(r),n.join("\n")}renderDef(e,t){const r=[this.renderBlockHeader(this.keyword(t,"def"),e.name,e.parameters)];for(const n of e.body)r.push(" "+this.render(n,t));return r.push(this.keyword(t,"end")),r.join("\n")}getChainWord(e,t){const r=Af(t);if(!r?.keywords)return e;const n=r.keywords[e];return n?.primary??e}renderExplicit(e){return Zc(e)}supportedLanguages(){return CS()}findBestPattern(e,t){let r=t;if("event-handler"===e.kind){const e=t.filter(e=>!/-event-/i.test(e.id));e.length>0&&(r=e)}const n=r.map(t=>{let r=t.priority;for(const n of t.template.tokens)"role"===n.type&&(e.roles.has(n.role)?r+=10:n.optional||(r-=50));return/-at-end|-at-start|-before$|-after$/i.test(t.id)&&(r-=30),"en"===t.language&&((t.id.includes("standard")||t.id.includes("en-source"))&&(r+=20),(t.id.includes("-when")||t.id.includes("-if")||t.id.includes("-upon"))&&(r-=15)),{pattern:t,score:r}});return n.sort((e,t)=>t.score-e.score),n.length>0?n[0].pattern:null}renderWithPattern(e,t){const r=[],n=t.language;for(const i of t.template.tokens){const t=this.renderPatternToken(i,e,n);null!==t&&r.push(t)}if("event-handler"===e.kind){if(e.body&&e.body.length>0){const t=e.body.map(e=>this.render(e,n));r.push(t.join(" "))}}return r.join(" ")}renderPatternToken(e,t,r){switch(e.type){case"literal":return e.renderSuppress?null:e.value;case"role":{const n=t.roles.get(e.role);if(!n)return null;if("event"===e.role)return this.renderEventName(n,r);if("en"===r&&"halt"===t.action&&"patient"===e.role&&"reference"===n.type&&"event"===n.value)return"the "+this.valueToNaturalString(n,r);if("render"===t.action&&"style"===e.role&&"expression"===n.type){const e=n.raw.trim();if(e.startsWith("{")&&e.endsWith("}"))return e.slice(1,-1).trim()}return this.valueToNaturalString(n,r)}case"group":{if(!e.tokens.filter(e=>"role"===e.type&&!e.optional).every(e=>t.roles.has(e.role))&&e.optional)return null;if(e.optional)for(const r of["destination","source"]){if(!e.tokens.find(e=>"role"===e.type&&e.role===r))continue;const n=t.roles.get(r);if("reference"===n?.type&&"me"===n.value&&n.implicit){if("destination"===r){const e=t.roles.get("patient");if("literal"===e?.type&&"string"===e.dataType)continue}return null}}if(e.optional){if(e.tokens.find(e=>"role"===e.type&&"quantity"===e.role)){const e=t.roles.get("quantity");if("literal"===e?.type&&1===Number(e.value))return null}}const n=[];let i=!1;for(const a of e.tokens){const e=this.renderPatternToken(a,t,r);null!==e&&(n.push(e),"role"===a.type&&(i=!0))}return e.optional&&!i?null:n.length>0?n.join(" "):null}default:return null}}renderEventName(e,t){if("literal"!==e.type||"string"!=typeof e.value)return this.valueToNaturalString(e,t);const r=e.value,n=e=>e.includes(":")?e:Tx(e,t);return r.includes(" or ")?r.split(" or ").map(e=>n(e.trim())).join(" or "):n(r)}valueToNaturalString(e,t="en"){switch(e.type){case"literal":return"string"==typeof e.value&&"string"===e.dataType?`"${e.value}"`:e.value+"";case"selector":return e.value;case"reference":return this.renderReference(e,t);case"property-path":return this.renderPropertyPath(e,t);case"expression":return e.raw;case"flag":return e.name}}renderReference(e,t){const r=Af(t);return r?.references?r.references[e.value]??e.value:e.value}renderPropertyPath(e,t){const r=Af(t),n=e.property,i="reference"===e.object.type?e.object.value:null;if(r?.possessive?.specialForms&&i){const e=r.possessive.specialForms[i];if(e){const{markerPosition:t,usePossessiveAdjectives:i}=r.possessive;return i&&"after-object"===t?`${n} ${e}`:`${e} ${n}`}}const a=this.valueToNaturalString(e.object,t);if(r?.possessive){const{marker:e,markerPosition:t,usePossessiveAdjectives:o}=r.possessive;if(o&&i&&"after-object"===t)return`${n} ${a}`;if(e)switch(t){case"between":return r.usesSpaces?`${a}${e} ${n}`:`${a}${e}${n}`;case"after-object":return`${a}${e} ${n}`;case"before-property":return`${a} ${e} ${n}`}}return"en"!==t&&r?.possessive?`${a} ${n}`:"me"===a?"my "+n:"it"===a?"its "+n:`${a}'s ${n}`}},cC=new lC;function uC(e,t){return cC.render(e,t)}function pC(e){return cC.renderExplicit(e)}wf();var dC={getSchema:mf};function mC(e){return qc(e,{schemaLookup:dC})}var fC=new Set(["if","unless","while","repeat","for"]),hC=new Set(["then","end","else","if","unless","while","for","repeat","and"]),yC=new Set(["first","last","next","previous","random","closest"]),vC=new Set(["click","dblclick","input","change","submit","keydown","keyup","keypress","mouseover","mouseout","mousedown","mouseup","focus","blur","load","scroll","resize","contextmenu","transitionend","transitionstart","transitionrun","transitioncancel","animationend","animationstart","animationiteration","animationcancel","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointercancel","pointerover","pointerout","touchstart","touchend","touchmove","touchcancel","mousemove","mouseenter","mouseleave","wheel","dragstart","dragend","dragover","dragenter","dragleave","drop","drag","loadend","loadstart","error","abort","close","open","message","popstate","hashchange","storage","online","offline","visibilitychange"]),gC=class extends Error{constructor(e,t,r,n){super(e),this.name="SemanticParseError",this.language=t,this.input=r,this.diagnostics=n}};function kC(e,t,r){return{message:e,severity:t,source:"semantic-parser",...r&&{code:r}}}function wC(e,t){return 0===t.length?e:{...e,diagnostics:t}}var bC=120;var zC=new Set(["to","from","into","onto","with","as","at","of","in","on","by","and","or","then","end","else","the","a","an","async"]);function xC(e){const t=[],r=new Set((e.diagnostics??[]).map(e=>`${e.code}|${e.message}`)),n=i=>{if(!i||"object"!=typeof i)return;if(i!==e)for(const e of i.diagnostics??[]){if("unconsumed-input"!==e.code)continue;const n=`${e.code}|${e.message}`;r.has(n)||(r.add(n),t.push(e))}const a=i;for(const e of TC){const t=a[e];if(Array.isArray(t))for(const e of t)n(e)}};return n(e),0===t.length?e:wC(e,[...e.diagnostics??[],...t])}function EC(e){if(e.length>=2){const t=e[0];if(('"'===t||"'"===t)&&e.endsWith(t))return e.slice(1,-1)}return e}var TC=["body","statements","thenBranch","elseBranch","eventHandlers","initBlock"];function SC(e,t){if(!e||"object"!=typeof e)return e;if(e.action&&e.roles instanceof Map){const r=mf(e.action),n=r?.primaryRole;if(r&&n&&"patient"!==n&&!r.roles.some(e=>"patient"===e.role)&&e.roles.has("patient")&&!e.roles.has(n)){const t=e.roles,r=t.get("patient");void 0!==r&&(t.delete("patient"),t.set(n,r))}if("tell"===e.action){const t=e.roles,r=t.get("patient"),n=t.get("destination");!r||"selector"!==r.type&&"reference"!==r.type||n&&"literal"!==n.type||(t.delete("patient"),t.set("destination",r))}if("fetch"===e.action){const t=e.roles,r=t.get("patient"),n=t.get("source");!r||!n||"literal"!==r.type&&"expression"!==r.type||"expression"!==n.type||t.has("style")||(t.delete("patient"),t.set("style",n),t.set("source",r))}if("transition"===e.action){const t=e.roles,r=t.get("destination");r&&"literal"===r.type&&!t.has("goal")&&(t.delete("destination"),t.set("goal",r));const n=t.get("patient");n&&"literal"===n.type&&"string"==typeof n.value&&/^[A-Za-z_][A-Za-z0-9_-]*$/.test(n.value)&&t.set("patient",{type:"expression",raw:n.value})}if("morph"===e.action){const t=e.roles,r=t.get("patient");r&&"literal"===r.type&&"string"==typeof r.value&&/<[a-zA-Z][^>]*\/?>/.test(r.value)&&t.set("patient",{type:"expression",raw:r.value})}if("wait"===e.action){const t=e.roles;if(!t.has("event")){const e=t.get("duration"),r="expression"===e?.type?e.raw:"literal"===e?.type?e.value:void 0;"string"==typeof r&&vC.has(r.toLowerCase())&&(t.delete("duration"),t.set("event",{type:"literal",value:r,dataType:"string"}))}}if("command"===e.kind&&"on"!==e.action){const t=e.roles,r=t.get("event");if(r&&"expression"===r.type){const e=r.raw;"string"==typeof e&&/^[A-Za-z_][A-Za-z0-9_-]*(:[A-Za-z0-9_-]+)?$/.test(e)&&t.set("event",{type:"literal",value:e,dataType:"string"})}}if(t?.size){const r=e.roles;for(const e of["destination","source"]){const n=r.get(e);n&&"literal"===n.type&&"string"==typeof n.value&&t.has(n.value)&&r.set(e,{type:"expression",raw:n.value})}}}const r=e;for(const e of TC){const n=r[e];if(Array.isArray(n))for(const e of n)SC(e,t)}return e}var CC=class e{constructor(){this.parseDepth=0,this.coverageFrames=[],this.boundIdentifiers=new Set}parse(e,t){0===this.parseDepth&&this.boundIdentifiers.clear(),this.parseDepth++,this.coverageFrames.push([]);try{let r=SC(this.parseInternal(e,t),this.boundIdentifiers);const n=this.coverageFrames[this.coverageFrames.length-1];if(n.length>0&&(r=wC(r,[...r.diagnostics??[],...n])),1===this.parseDepth&&(r=xC(r),"event-handler"===r.kind)){let n={node:r,input:e};const i=n.node.eventModifiers;if(i&&(i.once||void 0!==i.debounce||void 0!==i.throttle))for(let e=0;4>e;e++){const e=this.reclaimDanglingFromTail(n.node,n.input,t)??this.reclaimEventCompoundTail(n.node,n.input,t)??this.reclaimResponseTypeTail(n.node,n.input,t)??this.reclaimCapturedDestinationTail(n.node,n.input,t);if(!e)break;n=e}const a=this.reclaimEventCompoundTail(n.node,n.input,t);a&&(n=a),r=n.node}return r}finally{this.coverageFrames.pop(),this.parseDepth--}}coverageMark(){const e=this.coverageFrames[this.coverageFrames.length-1];return e?e.length:0}coverageRollback(e){const t=this.coverageFrames[this.coverageFrames.length-1];t&&t.length>e&&(t.length=e)}static getCoverageMarkerSurfaces(t){let r=e.coverageMarkerSurfaces.get(t);if(!r){r=new Set;const n=Af(t)?.roleMarkers;if(n)for(const e of Object.values(n))if(e){if(e.primary)for(const t of e.primary.toLowerCase().split(/\s+/))r.add(t);for(const t of e.alternatives??[])for(const e of t.toLowerCase().split(/\s+/))r.add(e)}for(const n of e.LEAKED_RENDER_MARKERS[t]??[])r.add(n.toLowerCase());e.coverageMarkerSurfaces.set(t,r)}return r}isCoverageResidueToken(t,r){if("particle"===t.kind||"conjunction"===t.kind)return!0;if(t.metadata?.closesTrackedBlock)return!0;if(this.isThenKeyword(t.value,r)||this.isEndKeyword(t.value,r)||this.isElseKeyword(t.value,r))return!0;const n=(t.normalized??t.value).toLowerCase();return!!zC.has(n)||e.getCoverageMarkerSurfaces(r).has(t.value.toLowerCase())}recordDroppedTokens(e,t,r){if(0===e.length)return;const n=this.coverageFrames[this.coverageFrames.length-1];if(!n)return;if(!e.some(e=>!this.isCoverageResidueToken(e,t)))return;const i=e.map(e=>e.value).join(" ").trim();if(!i)return;const a=i.length>bC?i.slice(0,bC)+"\u2026":i;n.push(kC(`${r} left ${e.length} token(s) unconsumed: "${a}"`,"warning","unconsumed-input"))}registerBoundIdentifiers(e){const t="repeat"===e.action||"for"===e.action?"patient":"set"===e.action?"destination":null;if(!t)return;const r=e.roles.get(t);"expression"===r?.type&&"string"==typeof r.raw&&/^[A-Za-z_]\w*$/.test(r.raw)&&this.boundIdentifiers.add(r.raw)}parseInternal(t,r){const n=DS(t,r,{statement:(e,t)=>this.parse(e,t),body:(e,t)=>this.parseStatements(e,t)});if(n)return n;const i=QS(t,r,{statement:(e,t)=>this.parse(e,t),body:(e,t)=>this.parseStatements(e,t)});if(i)return i;const a=function(e,t,r){const n=Af(t);if(!n)return null;const i="SOV"!==n.wordOrder,a=WS.has(t)?_S(n.roleMarkers?.event):new Set,o=WS.has(t)?_S(n.keywords?.on):new Set,s=a.size>0&&o.size>0,l=jS(t,"end"),c=jS(t,"on"),u=e.toLowerCase(),p=[...l].some(e=>u.includes(e)),d=(i||s)&&(()=>{let e=0;for(const t of c)if(t)for(let r=u.indexOf(t);r>=0;r=u.indexOf(t,r+t.length))if(++e>=2)return!0;return!1})();if(!p&&!d)return null;const m=SS(e,t).tokens;if(2>m.length)return null;const f=AS.map(e=>jS(t,e)),h=e=>NS(e,f),y=e=>PS(e,l),v=[];let g=0,k=0;for(let t=0;m.length>t;t++){const r=m[t];if(y(r)){if(g>0){g--;continue}const n=e.slice(m[k].position.start,r.position.start).trim();n&&v.push(n),k=t+1}else if(h(r))g++;else if(i&&0===g&&t>k&&PS(r,c)&&IS(m[t+1])){const n=e.slice(m[k].position.start,r.position.start).trim();n&&v.push(n),k=t}else if(s&&0===g&&t-1>k&&PS(r,a)&&void 0!==m[t+1]&&PS(m[t+1],o)){const r=e.slice(m[k].position.start,m[t-1].position.start).trim();r&&v.push(r),k=t-1}}if(m.length>k){const t=e.slice(m[k].position.start).trim();t&&v.push(t)}if(2>v.length)return null;const w=[],b=[];for(const e of v){let n;try{n=r.statement(e,t)}catch{return null}if(!n||"event-handler"!==n.kind)return null;const i=n;w.push(i),b.push(i.body&&0!==i.body.length?i.metadata?.confidence??.75:.2)}return IT(w,"then",{sourceLanguage:t,confidence:BS(b),sourceText:e})}(t,r,{statement:(e,t)=>this.parse(e,t),body:(e,t)=>this.parseStatements(e,t)});if(a)return a;const{modifiers:o,remainingInput:s}=this.extractStandaloneModifiers(t,r),l=s||t,c=this.stripAsyncModifier(l,r).remainingInput??l,u=this.stripDoNotThrowModifier(c,r).remainingInput??c,p=[],d=SS(u,r),m=Of(r);if(0===m.length)throw new gC("No patterns available for language: "+r,r,u,[kC(`No patterns registered for language '${r}'`,"error","no-patterns")]);const f=[...m].sort((e,t)=>t.priority-e.priority);{const e=d.tokens;if("VSO"===Af(r)?.wordOrder&&e.length>=4&&"source"===e[0]?.normalized){const t=e.findIndex(e=>"on"===e.normalized);if(t>=2&&e.length>t+1){const n=u.slice(e[0].position.start,e[t].position.start).trim(),i=e[t+1].position.end,a=u.slice(e[t].position.start,i)+" "+n+u.slice(i);if(a!==u)try{const e=this.parse(a,r);if(e&&"event-handler"===e.kind){return wC(o?this.applyModifiers(e,o):e,p)}}catch{}}}}{const t=d.tokens,n="if"===t[0]?.normalized;for(let i=0;n&&t.length>i+3;i++){const n=(t[i+3]?.normalized??t[i+3]?.value??"").toLowerCase();if("source"===t[i]?.normalized&&"on"===t[i+2]?.normalized&&e.KNOWN_EVENTS.has(n)){const e=(u.slice(0,t[i].position.start).trimEnd()+" "+u.slice(t[i+1].position.end).trimStart()).trim();if(e&&e!==u)try{const t=this.parse(e,r);if(t&&"event-handler"===t.kind){return wC(o?this.applyModifiers(t,o):t,p)}}catch{}break}}}{const t=d.tokens;for(let n=1;t.length-1>n;n++){const i=t[n],a=i.value,s=(i.normalized??i.value).toLowerCase();if(!("or"===s||e.OR_KEYWORDS.has(a)||e.OR_KEYWORDS.has(s)))continue;const l=t[n+1],c=(l.normalized??l.value).toLowerCase();if(!e.KNOWN_EVENTS.has(c))break;let d=n+1;const m=t[n+2];m&&"selector"===m.kind&&m.value.startsWith("[")&&(d=n+2);const f=t[d].position.end,h=(u.slice(0,t[n].position.start).trimEnd()+" "+u.slice(f).trimStart()).trim();if(h&&h!==u)try{const e=this.parse(h,r);if(e&&"event-handler"===e.kind){e.additionalEvents=[{type:"literal",value:c}];return wC(o?this.applyModifiers(e,o):e,p)}}catch{}break}}{const e=function(e){for(let t=1;e.length>t;t++){const r=e[t];if(iC.has(r.kind))continue;const n=r.value.toLowerCase(),i=tC[n];if(i){let n=0;for(let a=t+1;e.length>a;a++){const t=e[a],o=aC(t.value);if(null!==o)return{modifiers:{[i]:o},start:r.position.start,end:t.position.end};if("selector"===t.kind||"literal"===t.kind||"url"===t.kind)break;if(++n>2)break}continue}for(const i of rC){if(i[0]!==n)continue;if(t+i.length>e.length)continue;let a=!0;for(let r=1;i.length>r;r++)if(e[t+r].value.toLowerCase()!==i[r]){a=!1;break}if(a)return{modifiers:{once:!0},start:r.position.start,end:e[t+i.length-1].position.end}}}return null}(d.tokens);if(e){const t=(u.slice(0,e.start).trimEnd()+" "+u.slice(e.end).trimStart()).trim();if(t&&t!==u)try{const n=this.parse(t,r);if(n&&"event-handler"===n.kind){return wC(this.applyModifiers(n,{...o??{},...e.modifiers}),p)}}catch{}}}const h=f.filter(e=>"on"===e.command),y=d.mark(),v=TS.matchBest(d,h);if(v){p.push(kC(`event pattern matched: ${v.pattern.id} (confidence: ${v.confidence.toFixed(2)})`,"info","pattern-match"));let t=!1;if(/^event-[a-z]+-bare$/.test(v.pattern.id)){const n=v.captured.get("event"),i=(""+(n?.raw??n?.value??"")).toLowerCase(),a=bx[r],s=e.KNOWN_EVENTS.has(i)||!!a&&Object.keys(a).some(e=>e.toLowerCase()===i);if(i&&!s){const e=this.trySOVEventExtraction(u,r,f);if(e){p.push(kC(`bare-event mis-anchor on "${i}" rejected; SOV extraction preferred`,"info","stage-bare-event-guard"));return wC(o?this.applyModifiers(e,o):e,p)}if("reference"===n?.type||"expression"===n?.type){d.reset(y);const e=f.filter(e=>"on"!==e.command),r=TS.matchBest(d,e);d.reset(y),r&&"on"!==r.pattern.command?(t=!0,p.push(kC(`bare-event mis-anchor on reference "${i}" rejected; command ${r.pattern.command} preferred`,"info","stage-bare-event-guard"))):TS.matchBest(d,h)}}}if(!t){const e=this.buildEventHandler(v,d,r);return wC(o?this.applyModifiers(e,o):e,p)}}p.push(kC(`event patterns: ${h.length} tried, no match`,"info","stage-event"));const g=this.tryTrailingEventExtraction(u,r,f);if(g){p.push(kC("trailing event extraction succeeded","info","stage-trailing-event"));return wC(o?this.applyModifiers(g,o):g,p)}const k=f.filter(e=>"on"!==e.command),w=TS.matchBest(d,k);if(w){if(fC.has(w.pattern.command)){const e=this.trySOVEventExtraction(u,r,f);if(e){p.push(kC(`SOV event extraction preferred over bare ${w.pattern.command} command`,"info","stage-sov-loop"));return wC(o?this.applyModifiers(e,o):e,p)}const t=this.tryMidStreamEventExtraction(u,r,f);if(t){p.push(kC(`mid-stream event extraction preferred over bare ${w.pattern.command} command`,"info","stage-midstream-loop"));return wC(o?this.applyModifiers(t,o):t,p)}}else if(e.KNOWN_EVENTS.has(w.pattern.command)&&this.hasSOVEventMarkerHead(u,r)){const e=this.trySOVEventExtraction(u,r,f);if(e){p.push(kC("SOV event extraction preferred over command-homonym event "+w.pattern.command,"info","stage-sov-homonym"));return wC(o?this.applyModifiers(e,o):e,p)}}else if("VSO"===Af(r)?.wordOrder){const e=this.tryMidStreamEventExtraction(u,r,f);if(e){p.push(kC(`mid-stream event extraction preferred over bare ${w.pattern.command} command`,"info","stage-midstream-cmd"));return wC(o?this.applyModifiers(e,o):e,p)}}if(d.tokens.length>w.consumedTokens&&"SOV"===Af(r)?.wordOrder){const e=this.trySOVEventExtraction(u,r,f);if(e){p.push(kC(`SOV event extraction preferred over partial ${w.pattern.command} command (trailing remainder)`,"info","stage-sov-trailing"));return wC(o?this.applyModifiers(e,o):e,p)}}if(d.tokens.length>w.consumedTokens&&!fC.has(w.pattern.command)){const e=this.tryTopLevelCommandSequence(d,k,r);if(e)return p.push(kC(`top-level command sequence: ${e.statements.length} commands`,"info","stage-top-level-sequence")),wC(e,p)}p.push(kC(`command pattern matched: ${w.pattern.id} (confidence: ${w.confidence.toFixed(2)})`,"info","pattern-match"));const t=function(e,t,r){const n=t.tokens.length;if(e.consumedTokens>=n)return null;const i=t.tokens[e.consumedTokens],a=t.tokens[n-1];if(!i||!a)return null;const o=r.slice(i.position.start,a.position.end);if(!o.trim())return null;const s=o.length>bC?o.slice(0,bC)+"\u2026":o;return`pattern ${e.pattern.id} left ${n-e.consumedTokens} token(s) unconsumed: "${s}"`}(w,d,u);return t&&p.push(kC(t,"warning","unconsumed-input")),wC(this.buildCommand(w,r),p)}if(p.push(kC(`command patterns: ${k.length} tried, no match`,"info","stage-command")),!u.includes("\n")&&"VSO"===Af(r)?.wordOrder){const e=this.tryMidStreamEventExtraction(u,r,f);if(e){p.push(kC("mid-stream event extraction succeeded with no leading command match","info","stage-midstream-nocmd"));return wC(o?this.applyModifiers(e,o):e,p)}}const b=this.trySOVEventExtraction(u,r,f);if(b){p.push(kC("SOV event extraction succeeded","info","stage-sov"));return wC(o?this.applyModifiers(b,o):b,p)}p.push(kC("SOV event extraction: no event keyword found","info","stage-sov"));const z=this.tryCompoundCommandParsing(d,k,r);if(z)return p.push(kC("compound command parsing succeeded","info","stage-compound")),wC(z,p);throw p.push(kC("compound parsing: no then-keywords or no command matches","info","stage-compound")),p.push(kC(`all parse stages exhausted for "${u}"`,"error","parse-failed")),new gC(`Could not parse input in ${r}: ${u}`,r,u,p)}parseStatements(e,t){const r=SS(e,t),n=Of(t).filter(e=>"on"!==e.command).sort((e,t)=>t.priority-e.priority);this.coverageFrames.push([]);try{const e=this.parseBodyWithClauses(r,n,t),i=this.coverageFrames[this.coverageFrames.length-1];if(i.length>0&&e.length>0){const t=e[e.length-1];e[e.length-1]=wC(t,[...t.diagnostics??[],...i])}return e}finally{this.coverageFrames.pop()}}canParse(e,t){try{return this.parse(e,t),!0}catch{return!1}}supportedLanguages(){return CS()}buildCommand(e,t){if(!e)throw Error("No match to build command from");const r={};for(const[t,n]of e.captured)r[t]=n;const n=NT(e.pattern.command,r,{sourceLanguage:t,patternId:e.pattern.id,confidence:e.confidence});return this.registerBoundIdentifiers(n),n}buildEventHandler(t,r,n){if(!t)throw Error("No match to build event handler from");let i=t.captured.get("event");if(!i)throw Error("Event handler pattern matched but no event captured");{const t="expression"===i.type?i.raw:"literal"===i.type?i.value:void 0;if("string"==typeof t&&/^[^\s()[\]{}:]+$/.test(t)){const r=bx[n]?.[t];r?i={type:"literal",value:r,dataType:"string"}:"expression"===i.type&&e.KNOWN_EVENTS.has(t.toLowerCase())&&(i={type:"literal",value:t.toLowerCase(),dataType:"string"})}}let a=TS.extractEventModifiers(r);const o=t.captured.get("source");o&&t.pattern.id.endsWith("source")&&("reference"!==o.type||"me"!==o.value)&&(a={...a??{},from:o});const s=this.extractOrConjunctionEvents(r,n);let l,c=i;if(s.length>0&&"literal"===i.type){c={type:"literal",value:[i.value+"",...s.map(e=>("value"in e?e.value:"")+"")].join(" or ")}}const u=t.captured.get("action");if(u&&"literal"===u.type&&"if"===u.value){const e=r.tokens;let i=-1;for(let t=r.position()-1;t>=0;t--){const r=e[t],a=(r.normalized??r.value).toLowerCase();if(this.isIfKeyword(a,n)){i=t;break}}if(i>=0){const o=Of(n).filter(e=>"on"!==e.command).sort((e,t)=>t.priority-e.priority);let s=e.slice(i);if(t.pattern.id.endsWith("vso-verb-first")&&"literal"===c.type){const e=((c.value??"")+"").split("[")[0].trim().toLowerCase(),t=s.findIndex((t,r)=>{if(0===r||""===e)return!1;const n=(t.normalized??t.value).toLowerCase(),i=s[r-1];return n===e&&"keyword"===i.kind&&"on"===(i.normalized??"").toLowerCase()});if(t>0){const e=s[t+1],r=e&&"selector"===e.kind&&e.value.startsWith("[")?1:0;s=[...s.slice(0,t-1),...s.slice(t+1+r)]}}const l=new qp(s,n),u=this.coverageMark(),p=this.parseBodyWithClauses(l,o,n);if(p.some(e=>"conditional"===e.kind)||1===p.length&&"compound"===p[0]?.kind&&p[0].statements.some(e=>"conditional"===e.kind)){for(;!r.isAtEnd();)r.advance();return RT(c,p,a,{sourceLanguage:n,patternId:t.pattern.id,confidence:t.confidence})}this.coverageRollback(u)}}if(u&&"literal"===u.type){const a=u.value,o={};for(const[e,r]of t.captured)"event"!==e&&"action"!==e&&"continues"!==e&&(o[e]=r);if("repeat"===a){const e=r.peek(),t=e=>(e.normalized??e.value).toLowerCase();if(e&&"keyword"===e.kind&&"forever"===t(e))o.loopType={type:"literal",value:"forever"},delete o.patient,r.advance();else if(e&&"keyword"===e.kind&&"event"===t(e)){r.advance();const e=r.peek();if(e)for(o.event={type:"literal",value:t(e)},o.loopType={type:"literal",value:"until-event"},delete o.patient;!r.isAtEnd();){const e=r.peek();if(!e||"conjunction"===e.kind||"keyword"===e.kind&&(this.isThenKeyword(e.value,n)||this.isEndKeyword(e.value,n)))break;r.advance()}}const i=o.patient;i&&"reference"===i.type&&"me"===i.value&&delete o.patient}let s=NT(a,o,{sourceLanguage:n,patternId:t.pattern.id,confidence:t.confidence});if(this.registerBoundIdentifiers(s),!fC.has(a)||"repeat"===a){const e=t.pattern.id.includes("verb-first"),l=r.tokens,c=r.position(),u=e=>"conjunction"===e.kind||"keyword"===e.kind&&(this.isThenKeyword(e.value,n)||this.isEndKeyword(e.value,n));let p=-1;for(let e=c-1;e>=0;e--){const t=l[e];if(u(t))break;if((t.normalized??t.value).toLowerCase()===a){p=e;break}}if(p>=0){let t=c;for(;l.length>t&&!u(l[t]);)t++;const d=l.slice(p,t);let m=d;if(e){const e=((i.value??"")+"").toLowerCase(),t=d.findIndex(t=>(t.normalized??t.value).toLowerCase()===e);if(0>t)m=null;else{const e=d[t-1],r=e&&"keyword"===e.kind&&"on"===e.normalized?.toLowerCase()?t-1:t;m=[...d.slice(0,r),...d.slice(t+1)]}}if(m&&m.length>1){const e=Of(n).filter(e=>"on"!==e.command).sort((e,t)=>t.priority-e.priority),i=this.coverageMark(),l=this.parseClause(m,e,n),c=l[0],u=e=>null!==e&&"object"==typeof e&&"string"==typeof e.type?e.type:typeof e,p=mf(a),d=p?.primaryRole,f=e=>"patient"===e&&d&&"patient"!==d&&!p?.roles.some(e=>"patient"===e.role)?d:e,h=(e,t)=>{if(!fC.has(a)||!p)return!1;const r=p.roles.find(t=>t.role===f(e));return!r||r.expectedTypes.length>0&&!r.expectedTypes.includes(u(t))},y=(e,t)=>"patient"===e&&!!p&&!p.roles.some(e=>"patient"===e.role)&&"literal"===u(t)&&Xh.has(((t.value??"")+"").toLowerCase()),v=!!c&&"command"===c.kind&&Object.entries(o).every(([e,t])=>{if(h(e,t)||y(e,t))return!0;const r=c.roles.get(f(e));if(void 0!==r&&u(r)===u(t))return!0;if("patient"===e&&"pick"===a&&"literal"===u(t)){const e=c.roles.get("method"),r=u(e),n="literal"===r?e.value+"":"expression"===r?e.raw+"":void 0;return void 0!==n&&n===t.value+""}return!1}),g=c?.metadata?.patternId??"",k=!fC.has(a)||/^repeat-.*-(times|for-in|while-head|until-head)$/.test(g);if(1===l.length&&c&&"command"===c.kind&&c.action===a&&v&&k&&c.roles.size>Object.entries(o).filter(([e,t])=>!y(e,t)).length)for(s=c;r.position()<t;)r.advance();else this.coverageRollback(i)}}}if(!fC.has(a)){const t=s,i=mf(a)?.roles.some(e=>"quantity"===e.role&&!e.required);if(i&&!t.roles.has("quantity")){const e=r.peek();e&&/^-?\d+(\.\d+)?$/.test(e.value)&&(s=NT(a,{...Object.fromEntries(t.roles),quantity:{type:"literal",value:parseFloat(e.value),dataType:"number"}},t.metadata),r.advance())}const o=s,l=mf(a)?.roles.some(e=>"duration"===e.role&&!e.required);if(l&&!o.roles.has("duration")){const e=/^\d+(\.\d+)?(ms|s)$/i;let t=r.peek(),i=!1;if(t&&"particle"===t.kind){const n=r.peek(1);n&&e.test(n.value)&&(i=!0,t=n)}t&&e.test(t.value)&&(s=NT(a,{...Object.fromEntries(o.roles),duration:{type:"literal",value:t.value,dataType:"string"}},o.metadata),i&&r.advance(),r.advance(),this.consumeForPostposition(r,n))}const c=s,u=mf(a),p=u?.roles.find(e=>"responseType"===e.role&&!e.required);if(p&&!c.roles.has("responseType")){const t=t=>"string"==typeof t&&e.RESPONSE_TYPE_WORDS.has(t.toLowerCase()),n=(e,t)=>{const r=Object.fromEntries(c.roles);t&&delete r.destination,r.responseType={type:"expression",raw:e},s=NT(a,r,c.metadata)},i=c.roles.get("destination"),o=u?.roles.find(e=>"destination"===e.role),l=i?.raw??i?.value;if(i&&o&&!o.expectedTypes.includes(i.type)&&t(l))n(l,!0);else{const e=r.peek();e&&t(e.value)&&(n(e.value,!1),r.advance())}}if("wait"===a){const e=s;if(!e.roles.has("event")){const t=r.peek();if(t&&vC.has(t.value.toLowerCase())){const i=Object.fromEntries(e.roles),o=i.duration;o&&"literal"!==o.type&&"expression"!==o.type&&delete i.duration;const l=i.patient;l&&"reference"===l.type&&"me"===l.value&&delete i.patient,i.event={type:"literal",value:t.value,dataType:"string"},s=NT(a,i,e.metadata),r.advance(),this.consumeForPostposition(r,n)}}}this.tryAttachTrailingRole(r,s,n),this.tryAttachTrailingStyle(r,s,n),this.tryAttachTrailingExpressionRole(r,s,n)}const c=t.captured.get("continues"),p="literal"===c?.type&&"then"===c.value,d=r.peek(),m=!!d&&this.isThenKeyword(d.value,n),f=fC.has(a)&&!!d&&!this.isEndKeyword(d.value,n),h=!!d&&!this.isEndKeyword(d.value,n);if(p||m||f||h){const e=Of(n).filter(e=>"on"!==e.command).sort((e,t)=>t.priority-e.priority),t=Of(n).filter(e=>e.id.startsWith("grammar-")&&e.id.includes("-continuation")).sort((e,t)=>t.priority-e.priority),i=this.parseBodyWithGrammarPatterns(r,e,t,n);l=i.length>0?[s,...i]:[s]}else l=[s],r.isAtEnd()||this.recordDroppedTokens(r.tokens.slice(r.position()),n,"handler body tail")}else{const e=Of(n).filter(e=>"on"!==e.command).sort((e,t)=>t.priority-e.priority);l=this.parseBodyWithClauses(r,e,n)}return RT(c,l,a,{sourceLanguage:n,patternId:t.pattern.id,confidence:t.confidence})}parseBodyWithClauses(e,t,r){const n=[],i=[];let a=0;const o=[];for(;!e.isAtEnd();){const s=e.peek();if(!s)break;if(0===i.length){const i=this.consumeJsBlock(e,r);if(i){n.push(i);continue}const a=this.tryParseConditionalBlock(e,t,r);if(a){n.push(a);continue}}const l="conjunction"===s.kind||"keyword"===s.kind&&this.isThenKeyword(s.value,r),c=i[i.length-1],u=e.peek(1),p="at"===c?.value.toLowerCase()&&"of"===u?.value.toLowerCase()||iy(r,s.value,c?.value,u?.value),d="keyword"===s.kind&&this.isEndKeyword(s.value,r)&&!p;if(d&&0<a)a--,o.pop(),i.push({...s,metadata:{...s.metadata,closesTrackedBlock:!0}}),e.advance();else if(l&&o.includes("if"))i.push(s),e.advance();else if(l){if(i.length>0){const e=this.parseClause(i,t,r);n.push(...e),i.length=0,a=e.filter(e=>{const t=e;return!("for"!==t.action&&"repeat"!==t.action&&"while"!==t.action||Array.isArray(t.body)&&0!==t.body.length)}).length,o.length=0;for(let e=0;a>e;e++)o.push("other")}e.advance()}else{if(d){e.advance();const a=[];for(;!e.isAtEnd();){const t=e.peek();if(!t)break;if("conjunction"===t.kind||"keyword"===t.kind&&(this.isThenKeyword(t.value,r)||this.isEndKeyword(t.value,r)))break;a.push(t),e.advance()}if(a.length>0){const e=this.coverageMark(),o=i.length>0?this.parseClause(i,t,r):[];0===o.length&&i.length>0?(this.coverageRollback(e),n.push(...this.parseClause([...i,...a],t,r))):(n.push(...o),n.push(...this.parseClause(a,t,r)))}else if(i.length>0){const e=this.parseClause(i,t,r);n.push(...e)}i.length=0;break}if("keyword"===s.kind){const e=(s.normalized??s.value).toLowerCase();(this.isIfKeyword(e,r)||this.isUnlessKeyword(e,r)||"while"===e||"for"===e||"repeat"===e)&&(a++,o.push(this.isIfKeyword(e,r)?"if":"other"))}i.push(s),e.advance()}}if(i.length>0){const e=this.parseClause(i,t,r);n.push(...e)}e.isAtEnd()||this.recordDroppedTokens(e.tokens.slice(e.position()),r,"body stream tail"),this.foldFrontedWhileIntoRepeat(n,r);for(let e=n.length-1;e>=0;e--){const t=n[e];"command"!==t.kind||"for"!==t.action||t.roles instanceof Map&&0!==t.roles.size||Array.isArray(t.body)&&0!==t.body.length||n.splice(e,1)}return n.length>1?[IT(n,"then",{sourceLanguage:r})]:n}tryTopLevelCommandSequence(e,t,r){const n=this.coverageMark();let i;try{const n=new qp(e.tokens,r);i=this.parseBodyWithClauses(n,t,r)}catch{return this.coverageRollback(n),null}if(1!==i.length||"compound"!==i[0].kind)return this.coverageRollback(n),null;const a=i[0];if(2>a.statements.length)return this.coverageRollback(n),null;const o=a.statements.map(e=>e.metadata?.confidence??.75),s=o.reduce((e,t)=>e+t,0)/o.length;return IT(a.statements,a.chainType,{sourceLanguage:r,confidence:s})}foldFrontedWhileIntoRepeat(e,t){for(let r=0;e.length>r+1;r++){const n=e[r],i=e[r+1];if("command"!==n.kind||"while"!==n.action)continue;if("command"!==i.kind||"repeat"!==i.action)continue;const a=n.roles.get("condition");if(!a)continue;if(i.roles.has("condition"))continue;if(Array.isArray(n.body)||Array.isArray(i.body))continue;const o=new Map(i.roles);o.set("condition",a),o.set("loopType",{type:"literal",value:"while",dataType:"string"}),e.splice(r,2,{...i,roles:o,metadata:{...i.metadata,sourceLanguage:t,patternId:`repeat-${t}-fronted-while-fold`,confidence:Math.max(i.metadata?.confidence??0,n.metadata?.confidence??0)}})}}parseClause(t,r,n){if(0===t.length)return[];let i=null,a=t;const o=t[t.length-1];if(o&&t.length>=2){const e=(o.normalized??o.value).toLowerCase();this.isUnlessKeyword(e,n)&&(i="unless",a=t.slice(0,-1))}let s=null;if(i&&a.length>=3){const t=Af(n),r=t?e.buildVerbLookup(t):null;if(r)for(let t=1;a.length-1>t;t++){const n=a[t],i=r.get(n.value.toLowerCase())??(n.normalized?r.get(n.normalized.toLowerCase()):void 0);if(i&&!e.CONDITION_OPERATORS.has(i)){s=a.slice(0,t),a=a.slice(t);break}}}const l=new qp(a,n),c=[],u=this.coverageMark();let p=0;const d=[];let m=s;const f=()=>{if(0===d.length)return;const e=d.slice();if(d.length=0,i&&0===c.length&&null===m)return void(m=e);const t=e[0];if(!(t&&("identifier"===t.kind||"selector"===t.kind||"literal"===t.kind||"reference"===t.kind)))return void this.recordDroppedTokens(e,n,"body clause");let r=!1;for(const t of this.parseSOVClauseByVerbAnchoring(e,n)){const e=t.action,n=t.roles;e&&mf(e)&&n instanceof Map&&n.size>0&&(c.push(t),r=!0)}r||this.recordDroppedTokens(e,n,"body clause")};for(;!l.isAtEnd();){const e=l.peek(),t=!!e&&"repeat"===e.normalized?.toLowerCase(),i=l.mark(),a=TS.matchBest(l,r);if(t&&a&&"repeat"!==a.pattern.command)l.reset(i),f(),c.push(NT("repeat",{},{sourceLanguage:n,confidence:.6})),p++,l.advance();else{if(a&&"if"===a.pattern.command){const e=l.mark(),t=d.length;for(l.reset(i);!l.isAtEnd();){const e=l.peek();if(!e||this.isIfKeyword((e.normalized??e.value).toLowerCase(),n))break;d.push(e),l.advance()}const a=this.tryParseConditionalBlock(l,r,n);if(a){f(),c.push(a),p++;continue}d.length=t,l.reset(e)}if(a){f();const e=this.buildCommand(a,n);c.push(e),p++,this.tryAttachTrailingRole(l,e,n),this.tryAttachTrailingStyle(l,e,n),this.tryAttachTrailingExpressionRole(l,e,n)}else{const e=l.peek();e&&"repeat"===e.normalized?.toLowerCase()?(f(),c.push(NT("repeat",{},{sourceLanguage:n,confidence:.6})),p++):e&&d.push(e),l.advance()}}}f();let h=c;if(0===p){const e=this.parseSOVClauseByVerbAnchoring(a,n);e.length>0&&(this.coverageRollback(u),h=e)}const y=m;if(i&&h.length>0&&y&&y.length>0){return[NT(i,{condition:{type:"expression",raw:this.joinTokenText(y,n)}},{sourceLanguage:n,patternId:`${i}-${n}-trailing-guard`,confidence:.85}),...h]}return i&&y&&y.length>0&&0===h.length&&this.recordDroppedTokens(y,n,"body clause"),h}tryAttachTrailingRole(e,t,r){const n=mf(t.action);if(!n)return;const i=Af(r);if(!i)return;const a=t.roles,o=(e,t)=>{if(!e)return!1;if("selector"===e.kind)return!0;const r=(e.normalized??e.value).toLowerCase();return!hC.has(r)&&("body"===r||"it"===r||"you"===r||"result"===r||"document"===r||"window"===r||(!!this.boundIdentifiers.has(e.value)||!t&&("identifier"===e.kind||"reference"===e.kind)))},s=[{role:"source",strict:!1},{role:"destination",strict:!0}];for(const{role:t,strict:r}of s){if(!n.roles.some(e=>e.role===t))continue;const s=i.roleMarkers?.[t];if(!s)continue;const l=a.get(t);if(l&&("reference"!==l.type||"me"!==l.value))continue;const c=e=>{if(!e||"particle"!==e.kind&&"keyword"!==e.kind)return!1;const n=e.value.toLowerCase();return s.primary?.toLowerCase()===n||!r&&((e.normalized??"").toLowerCase()===t||!!s.alternatives?.some(e=>e.toLowerCase()===n))},u=e.peek(),p=e.peek(1);if(!u||!p)return;if(r&&"after"===s.position){const r=e.peek(2),n=(u.normalized??u.value).toLowerCase();if(yC.has(n)&&"selector"===p.kind&&c(r))return a.set(t,{type:"expression",raw:`${n} ${p.value}`}),e.advance(),e.advance(),void e.advance()}if("after"===s.position){if(o(u,r)&&c(p)){const r=this.tokenToSemanticValue(u);return e.advance(),e.advance(),void(r&&a.set(t,r))}if(r&&o(u,r)){const r=e.peek(2),n=e.peek(3);if("in"===(p.normalized??p.value).toLowerCase()&&r&&!c(r)&&c(n)){const r=this.tokenToSemanticValue(u);return e.advance(),e.advance(),e.advance(),e.advance(),void(r&&a.set(t,r))}}}else if(c(u)&&o(p,r)){e.advance();const r=this.tokenToSemanticValue(e.advance());return void(r&&a.set(t,r))}}}tryAttachTrailingStyle(t,r,n){if("fetch"!==r.action&&"render"!==r.action)return;const i=r.roles,a=mf(r.action);if(!a?.roles.some(e=>"style"===e.role))return;const o=i.get("style");if(o){if("expression"===o.type&&"string"==typeof o.raw&&/^[A-Za-z_][\w-]*$/.test(o.raw)&&":"===t.peek()?.value){const e=vS(t,o.raw);e&&(i.set("style",{type:"expression",raw:e}),this.tryAttachResponseTypeAfterStyle(t,r,n))}return}if("fetch"===r.action){const e=i.get("patient"),a=i.get("source");if(e&&a&&("literal"===e.type||"expression"===e.type)&&"expression"===a.type&&"string"==typeof a.raw&&/^[A-Za-z_][\w-]*$/.test(a.raw)&&":"===t.peek()?.value){const e=vS(t,a.raw);return void(e&&(i.set("source",{type:"expression",raw:e}),this.tryAttachResponseTypeAfterStyle(t,r,n)))}}const s=Af(n),l=s?.roleMarkers?.style;if(!l)return;if("before"===l.position){const e=new Set([l.primary,...l.alternatives??[]].map(e=>e.toLowerCase())),a=t.peek();if(!a||!e.has(a.value.toLowerCase()))return;const o=t.mark();t.advance();const s=vS(t);return s?(i.set("style",{type:"expression",raw:s}),void this.tryAttachResponseTypeAfterStyle(t,r,n)):void t.reset(o)}if("after"!==l.position)return;const c=new Set([l.primary,...l.alternatives??[]].map(e=>e.toLowerCase())),u=e=>"conjunction"===e.kind||"keyword"===e.kind&&(this.isThenKeyword(e.value,n)||this.isEndKeyword(e.value,n));let p=-1,d=0;for(let e=0;24>e;e++){const r=t.peek(e);if(!r||u(r))break;if("("===r.value||"{"===r.value?d++:")"!==r.value&&"}"!==r.value||(d=Math.max(0,d-1)),0===d&&("particle"===r.kind||"keyword"===r.kind)&&c.has(r.value.toLowerCase())){p=e;break}}if(0>=p)return;const m=[];for(let e=0;p>e;e++){const r=t.peek(e);r&&m.push(r)}if(1===m.length&&e.RESPONSE_TYPE_WORDS.has(m[0].value.toLowerCase()))return;const f=new qp(m,n),h=vS(f);i.set("style",{type:"expression",raw:h&&f.isAtEnd()?h:this.joinTokenText(m,n)});for(let e=0;p>=e;e++)t.advance();this.tryAttachResponseTypeAfterStyle(t,r,n)}tryAttachResponseTypeAfterStyle(t,r,n){const i=r.roles;if(i.has("responseType"))return;const a=mf(r.action);if(!a?.roles.some(e=>"responseType"===e.role&&!e.required))return;const o=t=>!!t&&e.RESPONSE_TYPE_WORDS.has(t.toLowerCase()),s=t.peek();if(!s)return;const l=e=>{i.set("responseType",{type:"expression",raw:e})},c=e.AS_MARKERS_BEFORE[n];if(c?.some(e=>s.value.toLowerCase()===e)){const e=t.peek(1);return void(e&&o(e.value)&&(t.advance(),t.advance(),l(e.value)))}if(o(s.value)){t.advance(),l(s.value);for(const r of e.AS_MARKERS_AFTER[n]??[])if(r.every((e,r)=>t.peek(r)?.value.toLowerCase()===e)){for(let e=0;r.length>e;e++)t.advance();break}}}tryAttachTrailingExpressionRole(e,t,r){const n=t.action,i="js"===n?{role:"patient",terminator:"boundary"}:"go"===n||"scroll"===n?{role:"destination",terminator:"destination-marker"}:null;if(!i)return;const a=t.roles,o=a.get(i.role);if("go"===n&&o&&"expression"===o.type&&"url"===(o.raw+"").toLowerCase()){const t=e.peek();if(t&&!hC.has((t.normalized??t.value).toLowerCase())){const r=this.tokenToSemanticValue(t);if("literal"===r.type||"selector"===r.type)return a.set(i.role,r),a.set("method",{type:"literal",value:"url"}),void e.advance()}const r=a.get("patient");if(r&&("literal"===r.type||"selector"===r.type))return a.set(i.role,r),a.set("method",{type:"literal",value:"url"}),void a.delete("patient")}if("go"===n&&o&&"expression"===o.type){const e=/^url\s+(\S+)$/i.exec((o.raw??"")+"");if(e){const t=e[1].replace(/^["']|["']$/g,"");return a.set(i.role,{type:"literal",value:t,dataType:"string"}),void a.set("method",{type:"literal",value:"url"})}}if("go"===n&&!o){const t=a.get("patient");if(t&&"expression"===t.type&&"url"===(t.raw+"").toLowerCase()){const t=e.peek();if(t&&!hC.has((t.normalized??t.value).toLowerCase())){const r=this.tokenToSemanticValue(t);if("literal"===r.type||"selector"===r.type)return a.set(i.role,r),a.set("method",{type:"literal",value:"url"}),a.delete("patient"),void e.advance()}}}if(o&&("reference"!==o.type||"me"!==o.value))return;const s=Af(r);if(!s)return;let l=null;if("destination-marker"===i.terminator){const e=s.roleMarkers?.destination;if(!e||"after"!==e.position)return;l=e.primary.toLowerCase()}const c=e=>"conjunction"===e.kind||"keyword"===e.kind&&(this.isThenKeyword(e.value,r)||this.isEndKeyword(e.value,r)),u=[];let p=0,d=!1;for(let t=0;24>t;t++){const r=e.peek(t);if(!r||c(r))break;if("("===r.value||"{"===r.value?p++:")"!==r.value&&"}"!==r.value||(p=Math.max(0,p-1)),null!==l&&0===p&&("particle"===r.kind||"keyword"===r.kind)&&r.value.toLowerCase()===l){d=!0;break}u.push(r)}if(0===u.length)return;if(null!==l&&!d)return;const m=u.length+(d?1:0);if("go"===n&&2===u.length&&"url"===u[0].value.toLowerCase()){const t=this.tokenToSemanticValue(u[1]);if("literal"===t.type||"selector"===t.type){a.set(i.role,t),a.set("method",{type:"literal",value:"url"});const r=a.get("patient");r&&"reference"===r.type&&"me"===r.value&&!mf(n)?.roles.some(e=>"patient"===e.role)&&a.delete("patient");for(let t=0;m>t;t++)e.advance();return}}let f=u;if("js"===n){const e=s.keywords?.js,t=t=>[e?.primary,...e?.alternatives??[]].some(e=>!!e&&e.length>t.value.length&&e.includes(t.value));let r=0;for(;f.length>r&&t(f[r]);)r++;if(f=f.slice(r),0===f.length)return}if(a.set(i.role,{type:"expression",raw:this.joinTokenText(f,r)}),"patient"!==i.role){const e=a.get("patient");e&&"reference"===e.type&&"me"===e.value&&!mf(n)?.roles.some(e=>"patient"===e.role)&&a.delete("patient")}for(let t=0;m>t;t++)e.advance()}static buildVerbLookup(e){const t=new Map;for(const[r,n]of Object.entries(e.keywords))if(!["on","if","else","when","where","while","end","then","and"].includes(r)&&(t.set(n.primary.toLowerCase(),r),n.alternatives))for(const e of n.alternatives)t.set(e.toLowerCase(),r);return t}static buildMarkerToRoleLookup(e){const t=new Map;for(const[r,n]of Object.entries(e.roleMarkers)){if(!n)continue;if(!("event"!==r)&&t.has(n.primary)||t.set(n.primary,r),n.alternatives)for(const e of n.alternatives)t.has(e)||t.set(e,r)}return t}parseSOVClauseByVerbAnchoring(t,r){const n=Af(r);if(!n||"SOV"!==n.wordOrder)return[];const i=e.buildVerbLookup(n),a=e.buildMarkerToRoleLookup(n),o=[];let s=0;for(;t.length>s;){let e=-1,n="";for(let r=s;t.length>r;r++){const o=t[r];if(a.has(o.value))continue;const s=i.get(o.value.toLowerCase()),l=o.normalized?i.get(o.normalized.toLowerCase()):void 0,c=s||l;if(c){e=r,n=c;break}}if(-1===e)break;const l=t.slice(s,e);let c=t.length;for(let n=e+1;t.length>n;n++){const o=t[n];if("conjunction"===o.kind||this.isThenKeyword(o.value,r)){c=n;break}if(n>e+1&&!a.has(o.value)){if(i.get(o.value.toLowerCase())||(o.normalized?i.get(o.normalized.toLowerCase()):void 0)){c=n;break}}}const u=t.slice(e+1,c),p=this.extractRolesFromMarkedTokens(l,u,a,n,r);if(o.push(NT(n,p,{sourceLanguage:r,confidence:.7})),s=c,t.length>s){const e=t[s];("conjunction"===e.kind||this.isThenKeyword(e.value,r))&&s++}}return o}extractRolesFromMarkedTokens(e,t,r,n,i){const a={},o=(e,t)=>{const r=this.isEndKeyword(e.value,i),n="keyword"===e.kind&&"end"===(e.normalized??"").toLowerCase();return!(!r&&!n)&&(!0===e.metadata?.closesTrackedBlock||(!!r||!(t&&"selector"===t.kind)))},s=e=>{let t=[];for(let s=0;e.length>s;s++){const l=e[s];if(o(l,e[s+1]))continue;const c=r.get(l.value);if(c&&"particle"===l.kind&&t.length>0){const e=this.tokensToSemanticValue(t,i);if(e){const t=this.mapRoleForCommand(c,n,a);t&&(a[t]=e)}t=[]}else t.push(l)}if(t.length>0){if(1===t.length&&/^\d+(\.\d+)?(ms|s)$/i.test(t[0].value)&&!a.duration&&mf(n)?.roles.some(e=>"duration"===e.role))a.duration={type:"literal",value:t[0].value,dataType:"string"};else{const e=this.tokensToSemanticValue(t,i);e&&(a.patient?a.destination||(a.destination=e):a.patient=e)}}};return s(e),s(t),a}mapRoleForCommand(e,t,r){return"set"===t&&("patient"===e?e="destination":"destination"===e&&(e="patient")),r[e]?"patient"!==e||r.destination?"destination"!==e||r.patient?"source"!==e||r.source?null:"source":"patient":"destination":e}tokensToSemanticValue(e,t){if(0===e.length)return null;let r=e.filter(e=>"whitespace"!==e.kind);if(0===r.length)return null;if(r.length>=2&&("selector"===r[0].kind||/^[#.@*<]/.test(r[0].value))){const e=r.findIndex((e,t)=>t>0&&"in"===(e.normalized??e.value).toLowerCase());e>0&&(r=r.slice(0,e))}if(1===r.length)return this.tokenToSemanticValue(r[0]);const n=r.map(e=>e.value).join(""),i=r[0];return"selector"===i.kind||i.value.startsWith("#")||i.value.startsWith(".")||i.value.startsWith("@")||i.value.startsWith("*")?AT(n):"literal"===i.kind||i.value.startsWith('"')||i.value.startsWith("'")?LT(EC(n),"string"):"reference"===i.kind?PT(n):LT(this.joinTokenText(r,t))}tokenToSemanticValue(e){const t=e.value;if("selector"===e.kind||t.startsWith("#")||t.startsWith(".")||t.startsWith("@")||t.startsWith("*"))return AT(t);if(t.startsWith('"')||t.startsWith("'"))return LT(EC(t),"string");if(/^-?\d+(\.\d+)?$/.test(t))return LT(parseFloat(t));if("true"===t||"\u771f"===t||"\ucc38"===t||"do\u011fru"===t)return LT(!0);if("false"===t||"\u507d"===t||"\uac70\uc9d3"===t||"yanl\u0131\u015f"===t)return LT(!1);if(t.length>1&&(t.startsWith(":")||t.startsWith("$")))return PT(t);const r=e.normalized?.toLowerCase();return"me"===r||"it"===r||"you"===r||"result"===r||"body"===r?PT(r):"reference"===e.kind?PT(e.normalized||"me"):LT(t)}parseBodyWithGrammarPatterns(e,t,r,n){const i=[];let a=[],o=!1;const s=()=>{if(!o&&a.length>0){const e=this.parseSOVClauseByVerbAnchoring(a,n);i.push(...e),0===e.length&&this.recordDroppedTokens(a,n,"fused body walk")}else a.length>0&&this.recordDroppedTokens(a,n,"fused body walk");a=[],o=!1};let l=0;const c=()=>{let e=0;for(const t of i){const r=t;"for"!==r.action&&"repeat"!==r.action&&"while"!==r.action||Array.isArray(r.body)&&0!==r.body.length||e++}return e-l};for(;!e.isAtEnd();){const u=e.peek();if(u&&this.isThenKeyword(u.value,n)){s(),e.advance();continue}if(u&&this.isEndKeyword(u.value,n)){const t=e.peek(-1),r=e.peek(1);if(!iy(n,u.value,t?.value,r?.value)){if(s(),c()>0){l++,e.advance();continue}e.advance();break}}if(u&&!o&&this.isIfKeyword((u.normalized??u.value).toLowerCase(),n)){s();const r=this.tryParseConditionalBlock(e,t,n);if(r){i.push(r),o=!0;continue}}let p=!1;if(r.length>0){const t=TS.matchBest(e,r);if(t){const e=t.pattern.command,r={};for(const[e,n]of t.captured)"event"!==e&&"action"!==e&&"continues"!==e&&(r[e]=n);const a=NT(e,r,{sourceLanguage:n,patternId:t.pattern.id});i.push(a),p=!0,o=!0;const s=t.captured.get("continues");if(s&&"literal"===s.type&&"then"===s.value)continue}}if(!p){const r=e.mark(),a=TS.matchBest(e,t);if(a){if("if"===a.pattern.command){const a=e.mark();for(e.reset(r);!e.isAtEnd();){const t=e.peek();if(!t||this.isIfKeyword((t.normalized??t.value).toLowerCase(),n))break;e.advance()}const l=this.tryParseConditionalBlock(e,t,n);if(l){s(),i.push(l),o=!0;continue}e.reset(a)}const l=this.buildCommand(a,n);i.push(l),this.tryAttachTrailingRole(e,l,n),p=!0,o=!0}}p||(u&&a.push(u),e.advance())}s(),e.isAtEnd()||this.recordDroppedTokens(e.tokens.slice(e.position()),n,"fused body walk");for(let e=i.length-1;e>=0;e--){const t=i[e];"command"!==t.kind||"for"!==t.action||t.roles instanceof Map&&0!==t.roles.size||Array.isArray(t.body)&&0!==t.body.length||i.splice(e,1)}return i}tryCompoundCommandParsing(e,t,r){const n=e.tokens,i=n.some(e=>"conjunction"===e.kind||"keyword"===e.kind&&this.isThenKeyword(e.value,r)),a=n.some(e=>this.isElseKeyword(e.value,r));if(!i&&!a)return null;const o=new qp(n,r),s=this.coverageMark(),l=this.parseBodyWithClauses(o,t,r);return 0===l.length?(this.coverageRollback(s),null):l[0]}matchEventMarkerPhrase(t,r,n){const i=e.SOV_EVENT_MARKER_PHRASES[n];if(!i)return 0;for(const e of i)if(e.every((e,n)=>t[r+n]?.value===e))return e.length;return 0}hasSOVEventMarkerHead(t,r){const n=e.SOV_EVENT_MARKERS[r];if(void 0===n)return!1;const{tokens:i}=SS(t,r),a=bx[r],o=new Set;if(a)for(const e of Object.keys(a))o.add(e.toLowerCase());for(let t=0;i.length>t;t++){const a=i[t],s=a.value.toLowerCase(),l=a.normalized?.toLowerCase();if(!(!!l&&(e.KNOWN_EVENTS.has(l)||vC.has(l))||e.KNOWN_EVENTS.has(s)||vC.has(s)||o.has(s)))continue;const c=this.matchEventParamPhrase(i,t+1).len,u=i[t+1+c];if(u&&("particle"===u.kind||"keyword"===u.kind)&&n.has(u.value))return!0;if(this.matchEventMarkerPhrase(i,t+1+c,r)>0)return!0}return!1}matchEventParamPhrase(e,t){if("("!==e[t]?.value)return{len:0,names:[]};const r=[];for(let n=t+1;e.length>n;n++){const i=e[n].value;if(")"===i)return{len:n-t+1,names:r};if(","!==i){if("identifier"!==e[n].kind)break;r.push(i)}}return{len:0,names:[]}}isStrippableSourceRef(e,t){if(!e)return!1;const r=e.normalized?.toLowerCase();if("keyword"===e.kind&&("me"===r||"i"===r||"it"===r))return!0;const n=e.value.toLowerCase();return t.has(n)||!!r&&t.has(r)}tryTrailingEventExtraction(t,r,n){const i=SS(t,r).tokens;if(3>i.length)return null;const a=bx[r],o=new Set;if(a)for(const e of Object.keys(a))o.add(e.toLowerCase());const s=i.length-2,l=i[s];if(!("keyword"===l.kind&&"on"===l.normalized?.toLowerCase()))return null;const c=i[i.length-1],u=c.value.toLowerCase(),p=c.normalized?.toLowerCase();if(!(!!p&&e.KNOWN_EVENTS.has(p)||e.KNOWN_EVENTS.has(u)||o.has(u)))return null;const d=p&&e.KNOWN_EVENTS.has(p)?p:a?.[u]??u,m=i.slice(0,s);if(0===m.length)return null;const f=n.filter(e=>"on"!==e.command),h=new qp(m,r),y=this.coverageMark(),v=this.parseBodyWithClauses(h,f,r);return 0===v.length?(this.coverageRollback(y),null):RT({type:"literal",value:d},v,void 0,{sourceLanguage:r,confidence:.75})}tryMidStreamEventExtraction(t,r,n){const i=SS(t,r).tokens;if(3>i.length)return null;const a=bx[r],o=new Set;if(a)for(const e of Object.keys(a))o.add(e.toLowerCase());for(let t=0;i.length-1>t;t++){const s=i[t];if(!("keyword"===s.kind&&"on"===s.normalized?.toLowerCase()))continue;const l=i[t+1],c=l.value.toLowerCase(),u=l.normalized?.toLowerCase();if(!(!!u&&e.KNOWN_EVENTS.has(u)||e.KNOWN_EVENTS.has(c)||o.has(c)))continue;const p=u&&e.KNOWN_EVENTS.has(u)?u:a?.[c]??c,d=i.filter((e,r)=>r!==t&&r!==t+1);if(0===d.length)return null;const m=n.filter(e=>"on"!==e.command),f=new qp(d,r),h=this.coverageMark(),y=this.parseBodyWithClauses(f,m,r);return 0===y.length?(this.coverageRollback(h),null):RT({type:"literal",value:p},y,void 0,{sourceLanguage:r,confidence:.75})}return null}trySOVEventExtraction(t,r,n){const i=e.SOV_EVENT_MARKERS[r];if(!i)return null;const a=SS(t,r).tokens,o=bx[r],s=new Set;if(o)for(const e of Object.keys(o))s.add(e.toLowerCase());const l=e.SOV_SOURCE_MARKERS[r];let c=-1,u="",p="",d=1,m=[];for(let t=0;a.length>t;t++){const n=a[t],l=n.value.toLowerCase();let f=l,h="";const y=l.indexOf("[");y>0&&(f=l.slice(0,y),h=n.value.slice(y));const v=n.normalized?.toLowerCase(),g=v&&(e.KNOWN_EVENTS.has(v)||vC.has(v)),k=s.has(l)||s.has(f),w=e.KNOWN_EVENTS.has(f)||vC.has(f);if(g||k||w){const e=a[t-1];if(e&&"event"===(e.normalized??e.value).toLowerCase())continue;let n;n=g?v:k?o?.[l]??o?.[f]??f:f;const s=this.matchEventParamPhrase(a,t+1);if(0>=i.size){c=t,u=n,p=h,d=1+s.len+this.matchEventMarkerPhrase(a,t+1+s.len,r),m=s.names;break}{let e=1+s.len;const r=a[t+e];r&&"selector"===r.kind&&r.value.startsWith("[")&&(e+=1);const o=a[t+e];if(o&&("particle"===o.kind||"keyword"===o.kind)&&i.has(o.value)){c=t,u=n,p=h||(e===s.len+2?a[t+e-1].value:""),d=e+1,m=s.names;break}}}}if(-1===c){const e=new Set(n.filter(e=>"on"!==e.command).map(e=>e.command));for(let t=0;a.length>t;t++){const n=a[t];if("identifier"===n.kind)if(i.size>0){let e=1;const r=a[t+1];r&&"selector"===r.kind&&r.value.startsWith("[")&&(e=2);const o=a[t+e];if(o&&("particle"===o.kind||"keyword"===o.kind)&&i.has(o.value)){c=t,u=n.value,p=2===e?a[t+1].value:"",d=e+1;break}}else{const i=this.matchEventMarkerPhrase(a,t+1,r);if(i>0){c=t,u=n.value,p="",d=1+i;break}const o=a[t+1];if(o&&"keyword"===o.kind&&null!=o.normalized&&e.has(o.normalized)){c=t,u=n.value,p="",d=1;break}}}}if(-1===c)return null;const f=new Set;for(let e=c;c+d>e;e++)f.add(e);if(l){const e=c+d;if(a.length>e){const t=a[e];if("particle"!==t.kind&&"keyword"!==t.kind||!l.markers.has(t.value)){if(this.isStrippableSourceRef(t,l.windowTokens)){const t=a[e+1];t&&("particle"===t.kind||"keyword"===t.kind)&&l.markers.has(t.value)&&(f.add(e),f.add(e+1))}}else f.add(e)}if(c>=2){const e=a[c-1];("particle"===e.kind||"keyword"===e.kind)&&l.markers.has(e.value)&&this.isStrippableSourceRef(a[c-2],l.windowTokens)&&(f.add(c-2),f.add(c-1))}for(let e=0;c>e;e++){const t=a[e],r=t.value.toLowerCase(),n=t.normalized?.toLowerCase();if(l.windowTokens.has(r)||n&&l.windowTokens.has(n)){f.add(e);break}}}const h=a.filter((e,t)=>!f.has(t));if(0===h.length)return null;const y=n.filter(e=>"on"!==e.command),v=new qp(h,r),g=this.coverageMark(),k=this.parseBodyWithClauses(v,y,r);if(0===k.length)return this.coverageRollback(g),null;const w={sourceLanguage:r,confidence:.75};return p&&(w.keyFilter=p),RT({type:"literal",value:u},k,void 0,w,m)}profileKeywordMatches(e,t,r){const n=Af(e)?.keywords?.[t];return!!n&&(n.primary?.toLowerCase()===r||!!n.alternatives?.some(e=>e.toLowerCase()===r))}consumeForPostposition(e,t){const r=e.peek();if(!r)return;const n=(r.normalized??"").toLowerCase(),i=Af(t)?.keywords?.for;("for"===n||r.value===i?.primary||(i?.alternatives??[]).includes(r.value))&&e.advance()}isThenKeyword(e,t){const r=e.toLowerCase(),n={en:new Set(["then"]),ja:new Set(["\u305d\u308c\u304b\u3089","\u6b21\u306b","\u305d\u3057\u3066"]),ar:new Set(["\u062b\u0645","\u0628\u0639\u062f\u0647\u0627","\u062b\u0645\u0651"]),es:new Set(["entonces","luego","despu\u00e9s"]),ko:new Set(["\uadf8\ub2e4\uc74c","\uadf8\ub9ac\uace0","\uadf8\ub7f0\ud6c4","\uadf8\ub7ec\uba74"]),zh:new Set(["\u7136\u540e","\u63a5\u7740","\u90a3\u4e48"]),tr:new Set(["ard\u0131ndan","daha sonra","ardindan"]),pt:new Set(["ent\u00e3o","depois","logo"]),fr:new Set(["puis","ensuite","alors"]),de:new Set(["dann","danach","anschlie\u00dfend"]),id:new Set(["lalu","kemudian","setelah itu"]),tl:new Set(["pagkatapos","tapos"]),bn:new Set(["\u09a4\u09be\u09b0\u09aa\u09b0"]),qu:new Set(["chaymantataq","hinaspa","chaymanta","chayqa"]),sw:new Set(["kisha","halafu","baadaye"])}[t];return n?n.has(r):"then"===r||this.profileKeywordMatches(t,"then",r)}isElseKeyword(e,t){const r=e.toLowerCase();return"else"===r||this.profileKeywordMatches(t,"else",r)}isEndKeyword(e,t){const r=e.toLowerCase(),n=function(e){return uS[e]}(t);return n?"end"===r||n.has(r):"end"===r||this.profileKeywordMatches(t,"end",r)}isJsKeyword(e){const t=(e.normalized??e.value).toLowerCase();return"js"===t||this.profileKeywordMatches("en","js",t)}consumeJsBlock(e,t){const r=e.peek();if(!r||!this.isJsKeyword(r))return null;const n=e.mark(),i=[];e.advance();const a=e.peek();a&&void 0!==r.position?.end&&r.position.end===a.position?.start&&this.profileKeywordMatches(t,"js",`${r.value}${a.value}`.toLowerCase())&&e.advance();let o=!1;for(;!e.isAtEnd();){const r=e.peek();if(!r)break;if(e.advance(),this.isEndKeyword(r.value,t)){o=!0;break}i.push(r)}if(!o)return e.reset(n),null;return NT("js",{patient:{type:"expression",raw:i.map(e=>e.value).join(" ").trim()||"()"}},{sourceLanguage:t,patternId:"js-opaque-"+t,confidence:1})}isIfKeyword(e,t){const r=e.toLowerCase();return"if"===r||this.profileKeywordMatches(t,"if",r)}isUnlessKeyword(e,t){const r=e.toLowerCase();return"unless"===r||this.profileKeywordMatches(t,"unless",r)}isBlockEndToken(e,t,r){return!!this.isEndKeyword(e.value,r)||"keyword"===e.kind&&"end"===(e.normalized??"").toLowerCase()&&!(t&&"selector"===t.kind)}tryParseConditionalBlock(t,r,n){const i=t.peek();if(!i)return null;const a=(i.normalized??i.value).toLowerCase();if(!this.isIfKeyword(a,n))return null;const o=t.mark(),s=this.coverageMark();t.advance();const l=[];let c=0;for(;!t.isAtEnd();){const e=t.peek();if(!e)break;const r=(e.normalized??e.value).toLowerCase();if(this.isIfKeyword(r,n)||this.isUnlessKeyword(r,n))c++,l.push(e),t.advance();else if(this.isBlockEndToken(e,t.peek(1)??void 0,n)){if(0===c){t.advance();break}c--,l.push(e),t.advance()}else l.push(e),t.advance()}if(0===l.length)return t.reset(o),this.coverageRollback(s),null;const u=Af(n),p="SOV"===u?.wordOrder?e.buildVerbLookup(u):null;let d=0,m=0;const f=[];for(;l.length>d;d++){const t=l[d],i=(t.normalized??t.value).toLowerCase();if(this.isIfKeyword(i,n)||this.isUnlessKeyword(i,n)?m++:this.isBlockEndToken(t,l[d+1],n)&&m--,0===m&&this.isThenKeyword(t.value,n)){d++;break}if(0===m&&f.length>0){const i=(l[d-1].normalized??l[d-1].value).toLowerCase(),a=l[d-1].value.toLowerCase(),o=(t.normalized??t.value).toLowerCase(),s=e.CONDITION_COPULAS.has(i)||e.CONDITION_COPULAS_SURFACE.has(a)&&e.CONDITION_PREDICATES.has(o),c=null!==p&&p.has(t.value.toLowerCase())&&!e.CONDITION_PREDICATES.has(o),u=/^\.[a-zA-Z_]\w*$/.test(t.value)&&void 0!==l[d-1].position?.end&&void 0!==t.position?.start&&l[d-1].position.end===t.position.start;if(!e.CONDITION_OPERATORS.has(o)&&!u&&(!s||c)&&(this.tokensBeginCommand(l.slice(d),r,n)||this.sovCommandStartsAt(l.slice(d),p)))break}f.push(t)}if(0===f.length)return t.reset(o),this.coverageRollback(s),null;const h=[],y=[];let v=!1,g=0;for(;l.length>d;d++){const e=l[d],t=(e.normalized??e.value).toLowerCase();this.isIfKeyword(t,n)||this.isUnlessKeyword(t,n)?g++:this.isBlockEndToken(e,l[d+1],n)&&g--,0!==g||v||!this.isElseKeyword(e.value,n)?(v?y:h).push(e):v=!0}const k={type:"expression",raw:this.joinTokenText(f,n)},w=this.parseBranch(h,r,n),b=y.length>0?this.parseBranch(y,r,n):void 0;return 0!==w.length||b&&0!==b.length?WT(k,w,b,{sourceLanguage:n,patternId:`conditional-${n}-folded`,confidence:1}):(t.reset(o),this.coverageRollback(s),null)}joinTokenText(e,t){return cS(e,Af(t))}tokensBeginCommand(e,t,r){if(0===e.length)return!1;const n=new qp(e,r);return null!==TS.matchBest(n,t)}sovCommandStartsAt(e,t){if(!t)return!1;const r=e=>t.has(e.value.toLowerCase())||!!e.normalized&&t.has(e.normalized.toLowerCase()),n=e=>"identifier"===e.kind||"selector"===e.kind||"literal"===e.kind||"reference"===e.kind;let i=0,a=0;for(;e.length>i+1;){const t=e[i+1];if(!n(e[i])||"particle"!==t.kind)break;a+=1,i+=2;const o=e[i];if(a>=1&&o&&r(o))return!0}return!1}parseBranch(e,t,r){if(0===e.length)return[];const n=new qp(e,r),i=this.parseBodyWithClauses(n,t,r);return 1===i.length&&"compound"===i[0]?.kind?i[0].statements:i}extractStandaloneModifiers(t,r){const n=SS(t,r).tokens;if(0===n.length)return{modifiers:null,remainingInput:null};const i=n[0].value.toLowerCase(),a=e.STANDALONE_MODIFIERS[i];if(!a)return{modifiers:null,remainingInput:null};const o={};let s=1;if("once"===a)o.once=!0;else{let e=1;if(n.length>e){const t=n[e],r=n[e+1];("keyword"===t.kind||"particle"===t.kind||"identifier"===t.kind&&"literal"===r?.kind&&/^\d+(ms|s|m)?$/.test(r.value))&&(e++,s++)}if(n.length>e){const t=n[e];if("literal"===t.kind){const r=t.value.match(/^(\d+)(ms|s|m)?$/);if(r){let t=parseInt(r[1],10);const n=r[2]||"ms";"s"===n?t*=1e3:"m"===n&&(t*=6e4),o[a]=t,s=e+1}}}o[a]||(o[a]="debounce"===a?300:100)}const l=n.slice(s);if(0===l.length)return{modifiers:null,remainingInput:null};return{modifiers:o,remainingInput:t.slice(l[0].position.start)}}stripAsyncModifier(e,t){const r=Af(t)?.keywords?.async,n=new Set(["async"]);r?.primary&&n.add(r.primary.toLowerCase()),r?.alternatives?.forEach(e=>n.add(e.toLowerCase()));const i=SS(e,t).tokens,a=i.findIndex(e=>n.has(e.value.toLowerCase()));if(-1===a)return{remainingInput:null};const o=i[a],s=(e.slice(0,o.position.start)+e.slice(o.position.end)).replace(/\s{2,}/g," ").trim();return 0===s.length?{remainingInput:null}:{remainingInput:s}}stripDoNotThrowModifier(e,t){const r=SS(e,t).tokens;for(let t=0;r.length-1>t;t++){if("do"!==r[t].value.toLowerCase())continue;let n=-1;for(let e=t+1;t+5>=e&&r.length>e;e++){const t=r[e];if("throw"===t.normalized?.toLowerCase()){n=e;break}const i=t.kind;if("selector"===i||"literal"===i||"reference"===i||"conjunction"===i)break}if(-1===n)continue;const i=r[n].position.end,a=(e.slice(0,r[t].position.start)+e.slice(i)).replace(/\s{2,}/g," ").trim();return 0===a.length?{remainingInput:null}:{remainingInput:a}}return{remainingInput:null}}static droppedTokenCount(e){return(e.diagnostics??[]).filter(e=>"unconsumed-input"===e.code).reduce((e,t)=>e+(parseInt(/left (\d+) token/.exec(t.message)?.[1]??"0",10)||0),0)}static unconsumedSpans(e){return(e.diagnostics??[]).filter(e=>"unconsumed-input"===e.code).map(e=>/unconsumed: "(.*)"$/.exec(e.message)?.[1]).filter(e=>!!e).map(e=>e.replace(/\s+/g," ").trim())}static withoutSpanDiagnostics(e,t){return{...e,diagnostics:(e.diagnostics??[]).filter(e=>{if("unconsumed-input"!==e.code)return!0;const r=/unconsumed: "(.*)"$/.exec(e.message)?.[1];return!r||r.replace(/\s+/g," ").trim()!==t})}}reclaimDanglingFromTail(t,r,n){const i=e.droppedTokenCount,a=e.unconsumedSpans(t);if(0===a.length)return null;const o=i(t),s=Af(n)?.roleMarkers?.source,l=new Set;s?.primary&&l.add(s.primary),s?.alternatives?.forEach(e=>l.add(e));const c=SS(r,n).tokens;for(let e=0;c.length>e;e++){const t=c[e];if("source"!==t.normalized&&!l.has(t.value))continue;const u=c["after"===s?.position?e-1:e+1];if(!u||"identifier"!==u.kind&&"keyword"!==u.kind)continue;const p=Math.min(t.position.start,u.position.start),d=Math.max(t.position.end,u.position.end),m=r.slice(p,d).replace(/\s+/g," ").trim();if(!a.some(e=>e===m||e.includes(m)))continue;const f=(r.slice(0,p).trimEnd()+" "+r.slice(d).trimStart()).trim();if(f&&f!==r)try{const e=this.parse(f,n);if(!e||"event-handler"!==e.kind)continue;const t=xC(e);if(i(t)<o)return{node:{...t,eventModifiers:{...t.eventModifiers,from:{type:"literal",value:u.value,dataType:"string"}}},input:f}}catch{}}return null}reclaimEventCompoundTail(t,r,n){const i=e.unconsumedSpans(t);if(0===i.length)return null;const a=bx[n];if(!a)return null;const o=t.roles,s=o.get("event"),l="literal"===s?.type&&"string"==typeof s.value?s.value:null;if(!l)return null;const c=e=>e.replace(/\s+/g," ").trim(),u=SS(r,n).tokens;for(const n of i)for(let i=1;u.length>i;i++)for(let s=i;u.length>s;s++){const p=c(r.slice(u[i].position.start,u[s].position.end));if(p.length>n.length)break;if(p!==n)continue;const d=u[i-1];if((a[d.value]??d.normalized)!==l)break;const m=a[c(r.slice(d.position.start,u[s].position.end))];if(!m)break;return o.set("event",{type:"literal",value:m,dataType:"string"}),{node:e.withoutSpanDiagnostics(t,n),input:r}}return null}reclaimResponseTypeTail(t,r,n){const i=e.unconsumedSpans(t);if(0===i.length)return null;const a=e.AS_MARKERS_BEFORE[n];if(!a)return null;const o=e=>e.replace(/\s+/g," ").trim(),s=e.droppedTokenCount(t),l=SS(r,n).tokens;for(let t=0;l.length>t+1;t++){const c=l[t],u=l[t+1];if(!a.some(e=>c.value.toLowerCase()===e))continue;if(!e.RESPONSE_TYPE_WORDS.has(u.value.toLowerCase()))continue;const p=o(r.slice(c.position.start,u.position.end));if(!i.includes(p))continue;const d=(r.slice(0,c.position.start).trimEnd()+" "+r.slice(u.position.end).trimStart()).trim();if(d&&d!==r)try{const t=this.parse(d,n);if(!t||"event-handler"!==t.kind)continue;const r=xC(t);if(e.droppedTokenCount(r)>=s)continue;const i=e.findResponseTypeTarget(r);if(!i)continue;return i.roles.set("responseType",{type:"expression",raw:u.value}),{node:r,input:d}}catch{}}return null}static findResponseTypeTarget(e){let t=null;const r=e=>{if(!e||"object"!=typeof e||t)return;if("command"===e.kind){const r=e,n=mf(r.action);if(n?.roles.some(e=>"responseType"===e.role&&!e.required)&&!r.roles.has("responseType"))return void(t=r)}const n=e;for(const e of["body","statements","thenBranch","elseBranch","commands"]){const t=n[e];Array.isArray(t)&&t.forEach(e=>r(e))}};return r(e),t}reclaimCapturedDestinationTail(t,r,n){const i=e.unconsumedSpans(t);if(0===i.length)return null;const a=Af(n)?.roleMarkers?.destination,o=new Set;if(a?.primary&&o.add(a.primary),a?.alternatives?.forEach(e=>o.add(e)),0===o.size)return null;const s=e=>e.replace(/\s+/g," ").trim(),l=SS(r,n).tokens;for(let n=0;l.length>n+1;n++){const a=l[n],c=l[n+1],u=o.has(a.value)&&"me"===c.normalized,p="me"===a.normalized&&o.has(c.value);if(!u&&!p)continue;const d=s(r.slice(a.position.start,c.position.end));if(!i.includes(d))continue;let m=!1;const f=e=>{if(!e||"object"!=typeof e||m)return;if("command"===e.kind){const t=e.roles.get("destination");if("reference"===t?.type&&"me"===t.value)return void(m=!0)}const t=e;for(const e of["body","statements","thenBranch","elseBranch","commands"]){const r=t[e];Array.isArray(r)&&r.forEach(e=>f(e))}};if(f(t),m)return{node:e.withoutSpanDiagnostics(t,d),input:r}}return null}applyModifiers(e,t){return{...e,eventModifiers:{...e.eventModifiers,...t}}}extractOrConjunctionEvents(t,r){const n=[];for(;;){const r=t.mark(),i=t.peek();if(!i)break;const a=(i.normalized||i.value).toLowerCase();if(!e.OR_KEYWORDS.has(a)){t.reset(r);break}t.advance();const o=t.peek();if(!o){t.reset(r);break}const s=(o.normalized||o.value).toLowerCase();t.advance(),n.push({type:"literal",value:s})}return n}};CC.coverageMarkerSurfaces=new Map,CC.LEAKED_RENDER_MARKERS={hi:["\u0915\u0947","\u0930\u0942\u092a","\u092e\u0947\u0902"],tr:["olarak"],qu:["hina"]},CC.AS_MARKERS_BEFORE={en:["as"],es:["como"],fr:["comme"],pt:["como"],it:["come"],de:["als"],id:["sebagai"],ms:["sebagai","sbg"],sw:["kuwa","kama"],th:["\u0e40\u0e1b\u0e47\u0e19"],vi:["nh\u01b0"],tl:["bilang"],he:["\u05db"],ar:["\u0643\u0640"],pl:["jako"],ru:["\u043a\u0430\u043a"],uk:["\u044f\u043a"],zh:["\u7684","\u4f5c\u4e3a","\u5f53\u4f5c"]},CC.AS_MARKERS_AFTER={ko:[["\ub85c"],["\uc73c\ub85c"]],qu:[["hina"]],tr:[["olarak"]],hi:[["\u0915\u0947","\u0930\u0942\u092a","\u092e\u0947\u0902"]]},CC.KNOWN_EVENTS=new Set(["click","dblclick","input","change","submit","keydown","keyup","keypress","mouseover","mouseout","mousedown","mouseup","focus","blur","load","scroll","resize","contextmenu"]),CC.RESPONSE_TYPE_WORDS=new Set(["json","text","html","xml","blob","arraybuffer","formdata","response"]),CC.SOV_EVENT_MARKERS={ja:new Set(["\u3067"]),ko:new Set,tr:new Set(["de","da","te","ta"]),bn:new Set(["\u098f"]),qu:new Set(["pi"]),hi:new Set(["\u092a\u0930"])},CC.SOV_EVENT_MARKER_PHRASES={ko:[["\ud560","\ub54c"],["\ud560\ub54c"]]},CC.SOV_SOURCE_MARKERS={ja:{markers:new Set(["\u304b\u3089"]),windowTokens:new Set(["\u30a6\u30a3\u30f3\u30c9\u30a6","\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8","window","document"])},ko:{markers:new Set(["\uc5d0\uc11c"]),windowTokens:new Set(["\ucc3d","\uc708\ub3c4\uc6b0","\ubb38\uc11c","window","document"])},tr:{markers:new Set(["den","dan","ten","tan"]),windowTokens:new Set(["pencere","belge","window","document"])},bn:{markers:new Set(["\u09a5\u09c7\u0995\u09c7","\u09ae\u09a7\u09cd\u09af\u09c7"]),windowTokens:new Set(["\u0989\u0987\u09a8\u09cd\u09a1\u09cb","\u09a1\u0995\u09c1\u09ae\u09c7\u09a8\u09cd\u099f","window","document"])},qu:{markers:new Set(["manta"]),windowTokens:new Set(["k_iri","ventana","window","document"])},hi:{markers:new Set(["\u0938\u0947"]),windowTokens:new Set(["\u0935\u093f\u0902\u0921\u094b","\u0926\u0938\u094d\u0924\u093e\u0935\u0947\u091c\u093c","window","document"])}},CC.CONDITION_COPULAS=new Set(["is","am","are","be","was","were","not","no"]),CC.CONDITION_COPULAS_SURFACE=new Set(["\u0647\u0648","\u0e40\u0e1b\u0e47\u0e19","\u0939\u0948"]),CC.CONDITION_PREDICATES=new Set(["empty","null","undefined"]),CC.CONDITION_OPERATORS=new Set(["matches","match","contains","exists","has","have","equals","includes"]),CC.STANDALONE_MODIFIERS={once:"once",debounced:"debounce",debounce:"debounce",throttled:"throttle",throttle:"throttle"},CC.OR_KEYWORDS=new Set(["or","\u0623\u0648","o","ou","oder","atau","atau","\u6216","\u307e\u305f\u306f","\ub610\ub294","veya","\u0985\u09a5\u09ac\u09be","utaq","au","\u0430\u0431\u043e","\u0438\u043b\u0438","ho\u1eb7c","lub","\u05d0\u05d5","\u0e2b\u0e23\u0e37\u0e2d","o","\u092f\u093e","\u0985\u09a5\u09ac\u09be"]);var AC=CC,LC=new AC;function jC(e,t){return LC.parse(e,t)}function PC(e,t){try{const r=SS(e,t),n=Of(t);if(0===n.length)return{confidence:0,parseSuccess:!1,error:"No patterns available for language: "+t};const i=[...n].sort((e,t)=>t.priority-e.priority),a=i.filter(e=>"on"===e.command),o=TS.matchBest(r,a);if(o)return{confidence:o.confidence,parseSuccess:!0,patternId:o.pattern.id,action:o.pattern.command,tokensConsumed:o.consumedTokens};r.reset(r.mark());const s=i.filter(e=>"on"!==e.command),l=TS.matchBest(r,s);return l?{confidence:l.confidence,parseSuccess:!0,patternId:l.pattern.id,action:l.pattern.command,tokensConsumed:l.consumedTokens}:{confidence:0,parseSuccess:!1,error:"Could not match any patterns for: "+e}}catch(e){return{confidence:0,parseSuccess:!1,error:e instanceof Error?e.message:e+""}}}function OC(e,t){try{const r=jC(e,t);if(r)return{node:r,confidence:r.metadata?.confidence??.8,error:void 0,tokensConsumed:SS(e,t).tokens.length}}catch{}const r=PC(e,t);return r.parseSuccess?{node:null,confidence:r.confidence,error:void 0,tokensConsumed:r.tokensConsumed}:{node:null,confidence:0,error:r.error}}function NC(e,t){return uC(mC(e),t)}function RC(e,t){return $c(e)?mC(e):jC(e,t)}function MC(e,t,r=Lf()){const n={},i={},a=RC(e,t);for(const e of r)try{n[e]=uC(a,e)}catch(t){i[e]=t instanceof Error?t.message:t+""}return n.explicit=pC(a),{translations:n,failed:i}}function IC(e,t){if(e.type!==t.type)return!1;switch(e.type){case"literal":case"selector":case"reference":return e.value===t.value;case"property-path":return IC(e.object,t.object)&&e.property===t.property;case"expression":return e.raw===t.raw;case"flag":return e.name===t.name&&e.enabled===t.enabled;default:return!1}}Rf(),Rf();var WC=class{constructor(e={}){this.cache=new Map,this.config={maxSize:e.maxSize??1e3,ttlMs:e.ttlMs??0,enabled:e.enabled??!0},this.stats={hits:0,misses:0,evictions:0,expirations:0}}makeKey(e,t){return`${t}:${e}`}isExpired(e){return 0!==this.config.ttlMs&&Date.now()-e.createdAt>this.config.ttlMs}evictLRU(){const e=this.cache.keys().next().value;void 0!==e&&(this.cache.delete(e),this.stats.evictions++)}get(e,t){if(!this.config.enabled)return void this.stats.misses++;const r=this.makeKey(e,t),n=this.cache.get(r);if(n)return this.isExpired(n)?(this.cache.delete(r),this.stats.expirations++,void this.stats.misses++):(this.cache.delete(r),n.lastAccessed=Date.now(),this.cache.set(r,n),this.stats.hits++,n.result);this.stats.misses++}set(e,t,r){if(!this.config.enabled)return;if(null!==r&&"object"==typeof r&&"confidence"in r&&0===r.confidence)return;const n=this.makeKey(e,t),i=Date.now();for(;this.cache.size>=this.config.maxSize;)this.evictLRU();this.cache.set(n,{result:r,createdAt:i,lastAccessed:i})}has(e,t){if(!this.config.enabled)return!1;const r=this.makeKey(e,t),n=this.cache.get(r);return!!n&&(!this.isExpired(n)||(this.cache.delete(r),this.stats.expirations++,!1))}delete(e,t){const r=this.makeKey(e,t);return this.cache.delete(r)}clear(){this.cache.clear()}resetStats(){this.stats={hits:0,misses:0,evictions:0,expirations:0}}getStats(){const e=this.stats.hits+this.stats.misses;return{hits:this.stats.hits,misses:this.stats.misses,size:this.cache.size,maxSize:this.config.maxSize,hitRate:e>0?this.stats.hits/e:0,evictions:this.stats.evictions,expirations:this.stats.expirations,enabled:this.config.enabled}}configure(e){if(void 0!==e.maxSize)for(this.config.maxSize=e.maxSize;this.cache.size>this.config.maxSize;)this.evictLRU();void 0!==e.ttlMs&&(this.config.ttlMs=e.ttlMs),void 0!==e.enabled&&(this.config.enabled=e.enabled)}enable(){this.config.enabled=!0}disable(){this.config.enabled=!1}getConfig(){return{...this.config}}},_C=new WC;jk(),Wf(),Ef("ar",zk,Nf),rx(),$f(),Ef("bn",Yz,If),db(),Bf(),Ef("de",ab,qf),Bg(),Ff(),KE(),Ef("en",Wg,Df),Tf("en",HE()),Kk(),Zf(),Ef("es",$k,Kf),Xw(),Jf(),Ef("fr",Bw,Gf),Mz(),th(),Ef("he",jz,Xf),Kz(),ih(),Ef("hi",$z,eh),yb(),sh(),Ef("id",pb,nh),Xb(),uh(),Ef("it",Kb,oh),nk(),mh(),Ef("ja",Xg,ch),yk(),yh(),Ef("ko",lk,dh),fx(),kh(),Ef("ms",ox,hh),uz(),zh(),Ef("pl",iz,gh),Mw(),Th(),Ef("pt",Sw,bh),Lb(),Ah(),Ef("qu",zb,Eh),wz(),Ph(),Ef("ru",hz,Ch),Wb(),Rh(),Ef("sw",Ab,jh),sx(),Wh(),Ef("th",tx,Nh),Ex(),$h(),Ef("tl",gx,Ih),lw(),Bh(),Ef("tr",tw,qh),Pz(),Fh(),Ef("uk",Ez,Dh),az(),Zh(),Ef("vi",Yb,Kh),yw(),Jh(),Ef("zh",sw,Gh),Rf();var qC={en:async()=>{const{englishTokenizer:e}=await Promise.resolve().then(()=>(Bg(),qg)),{englishProfile:t}=await Promise.resolve().then(()=>(Ff(),Hf)),{buildEnglishPatterns:r}=await Promise.resolve().then(()=>(KE(),BE));return{tokenizer:e,profile:t,buildPatterns:r}},es:async()=>{const{spanishTokenizer:e}=await Promise.resolve().then(()=>(Kk(),Dk)),{spanishProfile:t}=await Promise.resolve().then(()=>(Zf(),Uf));return{tokenizer:e,profile:t}},ja:async()=>{const{japaneseTokenizer:e}=await Promise.resolve().then(()=>(nk(),Qg)),{japaneseProfile:t}=await Promise.resolve().then(()=>(mh(),ph));return{tokenizer:e,profile:t}},ar:async()=>{const{arabicTokenizer:e}=await Promise.resolve().then(()=>(jk(),Ek)),{arabicProfile:t}=await Promise.resolve().then(()=>(Wf(),Mf));return{tokenizer:e,profile:t}},ko:async()=>{const{koreanTokenizer:e}=await Promise.resolve().then(()=>(yk(),uk)),{koreanProfile:t}=await Promise.resolve().then(()=>(yh(),fh));return{tokenizer:e,profile:t}},zh:async()=>{const{chineseTokenizer:e}=await Promise.resolve().then(()=>(yw(),cw)),{chineseProfile:t}=await Promise.resolve().then(()=>(Jh(),Yh));return{tokenizer:e,profile:t}},tr:async()=>{const{turkishTokenizer:e}=await Promise.resolve().then(()=>(lw(),nw)),{turkishProfile:t}=await Promise.resolve().then(()=>(Bh(),Vh));return{tokenizer:e,profile:t}},pt:async()=>{const{portugueseTokenizer:e}=await Promise.resolve().then(()=>(Mw(),Aw)),{portugueseProfile:t}=await Promise.resolve().then(()=>(Th(),xh));return{tokenizer:e,profile:t}},fr:async()=>{const{frenchTokenizer:e}=await Promise.resolve().then(()=>(Xw(),Kw)),{frenchProfile:t}=await Promise.resolve().then(()=>(Jf(),Yf));return{tokenizer:e,profile:t}},de:async()=>{const{germanTokenizer:e}=await Promise.resolve().then(()=>(db(),sb)),{germanProfile:t}=await Promise.resolve().then(()=>(Bf(),Vf));return{tokenizer:e,profile:t}},id:async()=>{const{indonesianTokenizer:e}=await Promise.resolve().then(()=>(yb(),mb)),{indonesianProfile:t}=await Promise.resolve().then(()=>(sh(),ah));return{tokenizer:e,profile:t}},qu:async()=>{const{quechuaTokenizer:e}=await Promise.resolve().then(()=>(Lb(),Eb)),{quechuaProfile:t}=await Promise.resolve().then(()=>(Ah(),Sh));return{tokenizer:e,profile:t}},sw:async()=>{const{swahiliTokenizer:e}=await Promise.resolve().then(()=>(Wb(),jb)),{swahiliProfile:t}=await Promise.resolve().then(()=>(Rh(),Oh));return{tokenizer:e,profile:t}},bn:async()=>{const{bengaliTokenizer:e}=await Promise.resolve().then(()=>(rx(),Jz)),{bengaliProfile:t}=await Promise.resolve().then(()=>($f(),_f));return{tokenizer:e,profile:t}},hi:async()=>{const{hindiTokenizer:e}=await Promise.resolve().then(()=>(Kz(),Dz)),{hindiProfile:t}=await Promise.resolve().then(()=>(ih(),rh));return{tokenizer:e,profile:t}},it:async()=>{const{italianTokenizer:e}=await Promise.resolve().then(()=>(Xb(),Ub)),{italianProfile:t}=await Promise.resolve().then(()=>(uh(),lh));return{tokenizer:e,profile:t}},ms:async()=>{const{malayTokenizer:e}=await Promise.resolve().then(()=>(fx(),lx)),{malayProfile:t}=await Promise.resolve().then(()=>(kh(),vh));return{tokenizer:e,profile:t}},pl:async()=>{const{polishTokenizer:e}=await Promise.resolve().then(()=>(uz(),sz)),{polishProfile:t}=await Promise.resolve().then(()=>(zh(),wh));return{tokenizer:e,profile:t}},ru:async()=>{const{russianTokenizer:e}=await Promise.resolve().then(()=>(wz(),vz)),{russianProfile:t}=await Promise.resolve().then(()=>(Ph(),Lh));return{tokenizer:e,profile:t}},th:async()=>{const{thaiTokenizer:e}=await Promise.resolve().then(()=>(sx(),nx)),{thaiProfile:t}=await Promise.resolve().then(()=>(Wh(),Mh));return{tokenizer:e,profile:t}},tl:async()=>{const{tagalogTokenizer:e}=await Promise.resolve().then(()=>(Ex(),wx)),{tagalogProfile:t}=await Promise.resolve().then(()=>($h(),_h));return{tokenizer:e,profile:t}},uk:async()=>{const{ukrainianTokenizer:e}=await Promise.resolve().then(()=>(Pz(),Sz)),{ukrainianProfile:t}=await Promise.resolve().then(()=>(Fh(),Hh));return{tokenizer:e,profile:t}},vi:async()=>{const{vietnameseTokenizer:e}=await Promise.resolve().then(()=>(az(),Jb)),{vietnameseProfile:t}=await Promise.resolve().then(()=>(Zh(),Uh));return{tokenizer:e,profile:t}},he:async()=>{const{hebrewTokenizer:e}=await Promise.resolve().then(()=>(Mz(),Oz)),{hebrewProfile:t}=await Promise.resolve().then(()=>(th(),Qf));return{tokenizer:e,profile:t}}},$C=Object.keys(qC);async function VC(e,t={}){const{url:r,module:n,skipIfRegistered:i=!0}=t;if(i&&jf(e))return{code:e,loaded:!1};try{let t;if(n)t=n;else if(r)t=await async function(e,t){try{const e=await fetch(t);if(!e.ok)throw Error(`Failed to fetch ${t}: ${e.status} ${e.statusText}`);const r=await e.text(),n=new Blob([r],{type:"application/javascript"}),i=URL.createObjectURL(n);try{const e=await import(i);if(!e.tokenizer||!e.profile)throw Error("Invalid language module: missing tokenizer or profile");return e}finally{URL.revokeObjectURL(i)}}catch(r){throw Error(`Failed to load language '${e}' from ${t}: ${r instanceof Error?r.message:r+""}`)}}(e,r);else{const r=qC[e];if(!r)throw Error(`Unknown language: ${e}. Supported: ${$C.join(", ")}`);t=await r()}return function(e,t){Ef(e,t.tokenizer,t.profile),t.patterns?Tf(e,t.patterns):t.buildPatterns&&Tf(e,t.buildPatterns())}(e,t),{code:e,loaded:!0}}catch(t){return{code:e,loaded:!1,error:t instanceof Error?t.message:t+""}}}function DC(e){return e.map(e=>e.extraction?.scope?e:{...e,template:{...e.template,tokens:[...e.template.tokens,{type:"group",optional:!0,tokens:[{type:"literal",value:"on"},{type:"role",role:"scope",optional:!0,expectedTypes:["selector","reference"]}]}]},extraction:{...e.extraction,scope:{marker:"on"}}})}function BC(e,t,r,n,i,a,o,s){return{id:e,language:t,command:"fetch",priority:105,template:{format:`${r} ${n} {source} ${i} {responseType}`,tokens:[{type:"literal",value:r,...a?{alternatives:a}:{}},{type:"group",optional:!0,tokens:[{type:"literal",value:n,...o?{alternatives:o}:{}}]},{type:"role",role:"source",expectedTypes:["literal","expression"]},{type:"group",optional:!0,tokens:[{type:"literal",value:i,...s?{alternatives:s}:{}},{type:"role",role:"responseType",expectedTypes:["literal","expression"]}]}]},extraction:{source:{marker:n,...o?{markerAlternatives:o}:{}},responseType:{marker:i,...s?{markerAlternatives:s}:{}}}}}function HC(e,t,r,n,i,a){return{id:e,language:t,command:"fetch",priority:105,template:{format:`{source} ${n} ${r}`,tokens:[{type:"role",role:"source",expectedTypes:["literal","expression"]},{type:"group",optional:!0,tokens:[{type:"literal",value:n,...a?{alternatives:a}:{}}]},{type:"literal",value:r,...i?{alternatives:i}:{}}]},extraction:{source:{marker:n,...a?{markerAlternatives:a}:{}}}}}gE(),uy(),Ax(),DE(),AE();var KC=new Set(["character","characters","item","items"]),FC=e=>{if(KC.has(e))return{type:"expression",raw:e};const t=Number(e);return LT(""===e||Number.isNaN(t)?e:t)};function UC(e,t){const r=[{type:"literal",value:"pick"}];return t.objectMarkers?.length&&r.push({type:"group",optional:!0,tokens:[{type:"literal",value:t.objectMarkers[0],...t.objectMarkers.length>1?{alternatives:t.objectMarkers.slice(1)}:{}}]}),r.push({type:"role",role:"method",expectedTypes:["literal","expression"]},{type:"role",role:"patient",expectedTypes:["literal","expression"]},{type:"literal",value:t.srcMarker,...t.srcAlternatives?.length?{alternatives:t.srcAlternatives}:{}},{type:"role",role:"source",expectedTypes:["selector","reference","expression"]}),{id:`pick-${e}-variant`,language:e,command:"pick",priority:110,template:{format:`pick {method} {patient} ${t.srcMarker} {source}`,tokens:r},extraction:{method:{position:1,transform:FC},patient:{position:2},source:{marker:t.srcMarker,...t.srcAlternatives?.length?{markerAlternatives:t.srcAlternatives}:{}}}}}var GC={ar:{srcMarker:"\u0645\u0646"},de:{srcMarker:"von",srcAlternatives:["aus"]},es:{srcMarker:"de"},fr:{srcMarker:"de"},he:{srcMarker:"of",srcAlternatives:["\u05e9\u05dc","\u05de"],objectMarkers:["\u05d0\u05ea"]},id:{srcMarker:"dari"},it:{srcMarker:"di",srcAlternatives:["da"]},ms:{srcMarker:"daripada",srcAlternatives:["dari"]},pl:{srcMarker:"z"},pt:{srcMarker:"de"},ru:{srcMarker:"\u0438\u0437"},sw:{srcMarker:"ya",srcAlternatives:["kutoka"]},th:{srcMarker:"\u0e02\u0e2d\u0e07",srcAlternatives:["\u0e08\u0e32\u0e01"]},tl:{srcMarker:"ng",srcAlternatives:["mula"]},uk:{srcMarker:"\u0437"},vi:{srcMarker:"c\u1ee7a",srcAlternatives:["t\u1eeb"]},zh:{srcMarker:"\u7684",objectMarkers:["\u628a"]}};function ZC(e,t){return{id:`pick-${e}-variant-sov`,language:e,command:"pick",priority:110,template:{format:`{source} ${t.genitive} {method} {patient} ${t.patientMarker} pick`,tokens:[{type:"role",role:"source",expectedTypes:["selector","reference","expression"]},{type:"literal",value:t.genitive},{type:"role",role:"method",expectedTypes:["literal","expression"]},{type:"role",role:"patient",expectedTypes:["literal","expression"]},{type:"group",optional:!0,tokens:[{type:"literal",value:t.patientMarker}]},{type:"literal",value:"pick"}]},extraction:{source:{position:0},method:{position:2,transform:FC},patient:{position:3}}}}var YC={bn:{genitive:"\u09b0",patientMarker:"\u0995\u09c7"},hi:{genitive:"\u0915\u093e",patientMarker:"\u0915\u094b"},ja:{genitive:"\u306e",patientMarker:"\u3092"},ko:{genitive:"\uc758",patientMarker:"\ub97c"},qu:{genitive:"pa",patientMarker:"ta"},tr:{genitive:"nin",patientMarker:"i"}};nE(),aE();var XC=[{id:"repeat-en-until-event-from",language:"en",command:"repeat",priority:120,template:{format:"repeat until event {event} from {source}",tokens:[{type:"literal",value:"repeat"},{type:"literal",value:"until"},{type:"literal",value:"event"},{type:"role",role:"event",expectedTypes:["literal","expression"]},{type:"literal",value:"from"},{type:"role",role:"source",expectedTypes:["selector","reference","expression"]}]},extraction:{event:{marker:"event"},source:{marker:"from"},loopType:{default:{type:"literal",value:"until-event"}}}},{id:"repeat-en-until-event",language:"en",command:"repeat",priority:110,template:{format:"repeat until event {event}",tokens:[{type:"literal",value:"repeat"},{type:"literal",value:"until"},{type:"literal",value:"event"},{type:"role",role:"event",expectedTypes:["literal","expression"]}]},extraction:{event:{marker:"event"},loopType:{default:{type:"literal",value:"until-event"}}}}],JC=[{id:"set-en-possessive",language:"en",command:"set",priority:100,template:{format:"set {destination} to {patient}",tokens:[{type:"literal",value:"set"},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"to"},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:1},patient:{marker:"to"}}}],QC=[{id:"for-en-basic",language:"en",command:"for",priority:100,template:{format:"for {patient} in {source}",tokens:[{type:"literal",value:"for"},{type:"role",role:"patient",expectedTypes:["expression","reference"]},{type:"literal",value:"in"},{type:"role",role:"source",expectedTypes:["selector","expression","reference"]}]},extraction:{patient:{position:1},source:{marker:"in"}}},{id:"if-en-basic",language:"en",command:"if",priority:100,template:{format:"if {condition}",tokens:[{type:"literal",value:"if"},{type:"role",role:"condition",expectedTypes:["expression","reference","selector"]}]},extraction:{condition:{position:1}}},{id:"unless-en-basic",language:"en",command:"unless",priority:100,template:{format:"unless {condition}",tokens:[{type:"literal",value:"unless"},{type:"role",role:"condition",expectedTypes:["expression","reference","selector"]}]},extraction:{condition:{position:1}}}],eA=[{id:"temporal-en-in",language:"en",command:"wait",priority:95,template:{format:"in {duration}",tokens:[{type:"literal",value:"in"},{type:"role",role:"duration",expectedTypes:["literal","expression"]}]},extraction:{duration:{position:1}}},{id:"temporal-en-after",language:"en",command:"wait",priority:95,template:{format:"after {duration}",tokens:[{type:"literal",value:"after"},{type:"role",role:"duration",expectedTypes:["literal","expression"]}]},extraction:{duration:{position:1}}}],tA=[...Jx,...tE,...XC,...JC,...QC,...eA];rE(),Rf();var rA=[oE,function(e){return[]},oy,Cx,function(e){switch(e){case"bn":return[{id:"add-bn-full",language:"bn",command:"add",priority:100,template:{format:"{patient} \u0995\u09c7 \u09af\u09cb\u0997 \u0995\u09b0\u09c1\u09a8",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0995\u09c7"},{type:"literal",value:"\u09af\u09cb\u0997"},{type:"literal",value:"\u0995\u09b0\u09c1\u09a8"}]},extraction:{patient:{position:0}}},{id:"add-bn-simple",language:"bn",command:"add",priority:90,template:{format:"\u09af\u09cb\u0997 {patient}",tokens:[{type:"literal",value:"\u09af\u09cb\u0997"},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}},{id:"add-bn-with-dest",language:"bn",command:"add",priority:95,template:{format:"{destination} \u098f {patient} \u0995\u09c7 \u09af\u09cb\u0997 \u0995\u09b0\u09c1\u09a8",tokens:[{type:"role",role:"destination"},{type:"literal",value:"\u098f",alternatives:["\u09a4\u09c7"]},{type:"role",role:"patient"},{type:"literal",value:"\u0995\u09c7"},{type:"literal",value:"\u09af\u09cb\u0997"},{type:"literal",value:"\u0995\u09b0\u09c1\u09a8"}]},extraction:{destination:{position:0},patient:{position:2}}}];case"hi":return[{id:"add-hi-full",language:"hi",command:"add",priority:100,template:{format:"{patient} \u0915\u094b {destination} \u092e\u0947\u0902 \u091c\u094b\u0921\u093c\u0947\u0902",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0915\u094b"},{type:"role",role:"destination"},{type:"literal",value:"\u092e\u0947\u0902"},{type:"literal",value:"\u091c\u094b\u0921\u093c\u0947\u0902",alternatives:["\u091c\u094b\u0921\u093c"]}]},extraction:{patient:{position:0},destination:{marker:"\u092e\u0947\u0902",position:3}}},{id:"add-hi-simple",language:"hi",command:"add",priority:90,template:{format:"{patient} \u091c\u094b\u0921\u093c\u0947\u0902",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u091c\u094b\u0921\u093c\u0947\u0902",alternatives:["\u091c\u094b\u0921\u093c"]}]},extraction:{patient:{position:0},destination:{default:{type:"reference",value:"me"}}}},{id:"add-hi-bare",language:"hi",command:"add",priority:80,template:{format:"\u091c\u094b\u0921\u093c\u0947\u0902 {patient}",tokens:[{type:"literal",value:"\u091c\u094b\u0921\u093c\u0947\u0902",alternatives:["\u091c\u094b\u0921\u093c"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},destination:{default:{type:"reference",value:"me"}}}}];case"it":return[{id:"add-it-full",language:"it",command:"add",priority:100,template:{format:"aggiungere {patient} a {target}",tokens:[{type:"literal",value:"aggiungere",alternatives:["aggiungi","add"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"a",alternatives:["su","in"]},{type:"role",role:"destination"}]}]},extraction:{patient:{position:1},destination:{marker:"a",markerAlternatives:["su","in"],default:{type:"reference",value:"me"}}}},{id:"add-it-simple",language:"it",command:"add",priority:90,template:{format:"aggiungere {patient}",tokens:[{type:"literal",value:"aggiungere",alternatives:["aggiungi","add"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},destination:{default:{type:"reference",value:"me"}}}}];case"pl":return[{id:"add-pl-full",language:"pl",command:"add",priority:100,template:{format:"dodaj {patient} do {destination}",tokens:[{type:"literal",value:"dodaj"},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"do",alternatives:["na","w"]},{type:"role",role:"destination"}]}]},extraction:{patient:{position:1},destination:{marker:"do",markerAlternatives:["na","w"],default:{type:"reference",value:"me"}}}},{id:"add-pl-simple",language:"pl",command:"add",priority:90,template:{format:"dodaj {patient}",tokens:[{type:"literal",value:"dodaj"},{type:"role",role:"patient"}]},extraction:{patient:{position:1},destination:{default:{type:"reference",value:"me"}}}}];case"qu":return[{id:"add-qu-sov",language:"qu",command:"add",priority:100,template:{format:"{patient} ta yapay",tokens:[{type:"role",role:"patient"},{type:"literal",value:"ta"},{type:"literal",value:"yapay",alternatives:["yapaykuy"]}]},extraction:{patient:{position:0}}},{id:"add-qu-simple",language:"qu",command:"add",priority:90,template:{format:"yapay {patient}",tokens:[{type:"literal",value:"yapay",alternatives:["yapaykuy"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}},{id:"add-qu-patient-first",language:"qu",command:"add",priority:96,template:{format:"{patient} ta {destination} man yapay",tokens:[{type:"role",role:"patient"},{type:"literal",value:"ta"},{type:"role",role:"destination"},{type:"literal",value:"man"},{type:"literal",value:"yapay",alternatives:["yapaykuy"]}]},extraction:{patient:{position:0},destination:{position:2}}},{id:"add-qu-with-dest",language:"qu",command:"add",priority:95,template:{format:"{destination} man {patient} ta yapay",tokens:[{type:"role",role:"destination"},{type:"literal",value:"man"},{type:"role",role:"patient"},{type:"literal",value:"ta"},{type:"literal",value:"yapay",alternatives:["yapaykuy"]}]},extraction:{destination:{position:0},patient:{position:2}}}];case"ru":return[{id:"add-ru-full",language:"ru",command:"add",priority:100,template:{format:"\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c {patient} \u043a {destination}",tokens:[{type:"literal",value:"\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c",alternatives:["\u0434\u043e\u0431\u0430\u0432\u044c"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u043a",alternatives:["\u043d\u0430","\u0432"]},{type:"role",role:"destination"}]}]},extraction:{patient:{position:1},destination:{marker:"\u043a",markerAlternatives:["\u043d\u0430","\u0432"],default:{type:"reference",value:"me"}}}},{id:"add-ru-simple",language:"ru",command:"add",priority:90,template:{format:"\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c {patient}",tokens:[{type:"literal",value:"\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c",alternatives:["\u0434\u043e\u0431\u0430\u0432\u044c"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},destination:{default:{type:"reference",value:"me"}}}}];case"th":default:return[];case"uk":return[{id:"add-uk-full",language:"uk",command:"add",priority:100,template:{format:"\u0434\u043e\u0434\u0430\u0442\u0438 {patient} \u0434\u043e {destination}",tokens:[{type:"literal",value:"\u0434\u043e\u0434\u0430\u0442\u0438",alternatives:["\u0434\u043e\u0434\u0430\u0439"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0434\u043e",alternatives:["\u043d\u0430","\u0432"]},{type:"role",role:"destination"}]}]},extraction:{patient:{position:1},destination:{marker:"\u0434\u043e",markerAlternatives:["\u043d\u0430","\u0432"],default:{type:"reference",value:"me"}}}},{id:"add-uk-simple",language:"uk",command:"add",priority:90,template:{format:"\u0434\u043e\u0434\u0430\u0442\u0438 {patient}",tokens:[{type:"literal",value:"\u0434\u043e\u0434\u0430\u0442\u0438",alternatives:["\u0434\u043e\u0434\u0430\u0439"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},destination:{default:{type:"reference",value:"me"}}}}];case"vi":return[{id:"add-vi-full",language:"vi",command:"add",priority:100,template:{format:"th\u00eam {patient} v\u00e0o {target}",tokens:[{type:"literal",value:"th\u00eam",alternatives:["b\u1ed5 sung"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"v\u00e0o",alternatives:["cho"]},{type:"role",role:"destination"}]}]},extraction:{patient:{position:1},destination:{marker:"v\u00e0o",markerAlternatives:["cho"],default:{type:"reference",value:"me"}}}},{id:"add-vi-simple",language:"vi",command:"add",priority:90,template:{format:"th\u00eam {patient}",tokens:[{type:"literal",value:"th\u00eam",alternatives:["b\u1ed5 sung"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},destination:{default:{type:"reference",value:"me"}}}}];case"zh":return[{id:"add-zh-full",language:"zh",command:"add",priority:100,template:{format:"\u7ed9 {destination} \u6dfb\u52a0 {patient}",tokens:[{type:"literal",value:"\u7ed9",alternatives:["\u70ba","\u4e3a"]},{type:"role",role:"destination"},{type:"literal",value:"\u6dfb\u52a0",alternatives:["\u52a0","\u589e\u52a0","\u52a0\u4e0a"]},{type:"role",role:"patient"}]},extraction:{destination:{position:1},patient:{position:3}}},{id:"add-zh-simple",language:"zh",command:"add",priority:90,template:{format:"\u6dfb\u52a0 {patient}",tokens:[{type:"literal",value:"\u6dfb\u52a0",alternatives:["\u52a0","\u589e\u52a0"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},destination:{default:{type:"reference",value:"me"}}}},{id:"add-zh-ba",language:"zh",command:"add",priority:95,template:{format:"\u628a {patient} \u6dfb\u52a0\u5230 {destination}",tokens:[{type:"literal",value:"\u628a"},{type:"role",role:"patient"},{type:"literal",value:"\u6dfb\u52a0\u5230",alternatives:["\u52a0\u5230","\u589e\u52a0\u5230"]},{type:"role",role:"destination"}]},extraction:{patient:{position:1},destination:{marker:"\u6dfb\u52a0\u5230",markerAlternatives:["\u52a0\u5230","\u589e\u52a0\u5230"]}}}]}},function(e){switch(e){case"bn":return[{id:"remove-bn-full",language:"bn",command:"remove",priority:100,template:{format:"{patient} \u0995\u09c7 \u09b8\u09b0\u09be\u09a8",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0995\u09c7"},{type:"literal",value:"\u09b8\u09b0\u09be\u09a8",alternatives:["\u09ae\u09c1\u099b\u09c1\u09a8"]}]},extraction:{patient:{position:0}}},{id:"remove-bn-simple",language:"bn",command:"remove",priority:90,template:{format:"\u09b8\u09b0\u09be\u09a8 {patient}",tokens:[{type:"literal",value:"\u09b8\u09b0\u09be\u09a8",alternatives:["\u09ae\u09c1\u099b\u09c1\u09a8"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}},{id:"remove-bn-with-source",language:"bn",command:"remove",priority:95,template:{format:"{source} \u09a5\u09c7\u0995\u09c7 {patient} \u0995\u09c7 \u09b8\u09b0\u09be\u09a8",tokens:[{type:"role",role:"source"},{type:"literal",value:"\u09a5\u09c7\u0995\u09c7"},{type:"role",role:"patient"},{type:"literal",value:"\u0995\u09c7"},{type:"literal",value:"\u09b8\u09b0\u09be\u09a8",alternatives:["\u09ae\u09c1\u099b\u09c1\u09a8"]}]},extraction:{source:{position:0},patient:{position:2}}}];case"hi":return[{id:"remove-hi-full",language:"hi",command:"remove",priority:100,template:{format:"{patient} \u0915\u094b {source} \u0938\u0947 \u0939\u091f\u093e\u090f\u0902",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0915\u094b"},{type:"role",role:"source"},{type:"literal",value:"\u0938\u0947"},{type:"literal",value:"\u0939\u091f\u093e\u090f\u0902",alternatives:["\u0939\u091f\u093e","\u092e\u093f\u091f\u093e\u090f\u0902"]}]},extraction:{patient:{position:0},source:{marker:"\u0938\u0947",position:3}}},{id:"remove-hi-simple",language:"hi",command:"remove",priority:90,template:{format:"{patient} \u0939\u091f\u093e\u090f\u0902",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0939\u091f\u093e\u090f\u0902",alternatives:["\u0939\u091f\u093e","\u092e\u093f\u091f\u093e\u090f\u0902"]}]},extraction:{patient:{position:0},source:{default:{type:"reference",value:"me"}}}},{id:"remove-hi-bare",language:"hi",command:"remove",priority:80,template:{format:"\u0939\u091f\u093e\u090f\u0902 {patient}",tokens:[{type:"literal",value:"\u0939\u091f\u093e\u090f\u0902",alternatives:["\u0939\u091f\u093e","\u092e\u093f\u091f\u093e\u090f\u0902"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},source:{default:{type:"reference",value:"me"}}}}];case"it":return[{id:"remove-it-full",language:"it",command:"remove",priority:100,template:{format:"rimuovere {patient} da {source}",tokens:[{type:"literal",value:"rimuovere",alternatives:["rimuovi","eliminare","togliere","remove"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"da",alternatives:["di"]},{type:"role",role:"source"}]}]},extraction:{patient:{position:1},source:{marker:"da",markerAlternatives:["di"],default:{type:"reference",value:"me"}}}},{id:"remove-it-simple",language:"it",command:"remove",priority:90,template:{format:"rimuovere {patient}",tokens:[{type:"literal",value:"rimuovere",alternatives:["rimuovi","eliminare","togliere","remove"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},source:{default:{type:"reference",value:"me"}}}}];case"pl":return[{id:"remove-pl-full",language:"pl",command:"remove",priority:100,template:{format:"usu\u0144 {patient} z {source}",tokens:[{type:"literal",value:"usu\u0144",alternatives:["usun","wyczy\u015b\u0107","wyczysc"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"z",alternatives:["od","ze"]},{type:"role",role:"source"}]}]},extraction:{patient:{position:1},source:{marker:"z",markerAlternatives:["od","ze"],default:{type:"reference",value:"me"}}}},{id:"remove-pl-simple",language:"pl",command:"remove",priority:90,template:{format:"usu\u0144 {patient}",tokens:[{type:"literal",value:"usu\u0144",alternatives:["usun","wyczy\u015b\u0107","wyczysc"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},source:{default:{type:"reference",value:"me"}}}}];case"qu":return[{id:"remove-qu-sov",language:"qu",command:"remove",priority:100,template:{format:"{patient} ta qichuy",tokens:[{type:"role",role:"patient"},{type:"literal",value:"ta"},{type:"literal",value:"qichuy",alternatives:["hurquy","anchuchiy"]}]},extraction:{patient:{position:0}}},{id:"remove-qu-simple",language:"qu",command:"remove",priority:90,template:{format:"qichuy {patient}",tokens:[{type:"literal",value:"qichuy",alternatives:["hurquy","anchuchiy"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}},{id:"remove-qu-patient-first",language:"qu",command:"remove",priority:96,template:{format:"{patient} ta {source} manta qichuy",tokens:[{type:"role",role:"patient"},{type:"literal",value:"ta"},{type:"role",role:"source"},{type:"literal",value:"manta"},{type:"literal",value:"qichuy",alternatives:["hurquy","anchuchiy"]}]},extraction:{patient:{position:0},source:{position:2}}},{id:"remove-qu-with-source",language:"qu",command:"remove",priority:95,template:{format:"{source} manta {patient} ta qichuy",tokens:[{type:"role",role:"source"},{type:"literal",value:"manta"},{type:"role",role:"patient"},{type:"literal",value:"ta"},{type:"literal",value:"qichuy",alternatives:["hurquy","anchuchiy"]}]},extraction:{source:{position:0},patient:{position:2}}}];case"ru":return[{id:"remove-ru-full",language:"ru",command:"remove",priority:100,template:{format:"\u0443\u0434\u0430\u043b\u0438\u0442\u044c {patient} \u0438\u0437 {source}",tokens:[{type:"literal",value:"\u0443\u0434\u0430\u043b\u0438\u0442\u044c",alternatives:["\u0443\u0434\u0430\u043b\u0438","\u0443\u0431\u0440\u0430\u0442\u044c","\u0443\u0431\u0435\u0440\u0438"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0438\u0437",alternatives:["\u043e\u0442","\u0441"]},{type:"role",role:"source"}]}]},extraction:{patient:{position:1},source:{marker:"\u0438\u0437",markerAlternatives:["\u043e\u0442","\u0441"],default:{type:"reference",value:"me"}}}},{id:"remove-ru-simple",language:"ru",command:"remove",priority:90,template:{format:"\u0443\u0434\u0430\u043b\u0438\u0442\u044c {patient}",tokens:[{type:"literal",value:"\u0443\u0434\u0430\u043b\u0438\u0442\u044c",alternatives:["\u0443\u0434\u0430\u043b\u0438","\u0443\u0431\u0440\u0430\u0442\u044c","\u0443\u0431\u0435\u0440\u0438"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},source:{default:{type:"reference",value:"me"}}}}];case"th":return[{id:"remove-th-simple",language:"th",command:"remove",priority:100,template:{format:"\u0e25\u0e1a {patient}",tokens:[{type:"literal",value:"\u0e25\u0e1a",alternatives:["\u0e25\u0e1a\u0e2d\u0e2d\u0e01"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}},{id:"remove-th-with-source",language:"th",command:"remove",priority:95,template:{format:"\u0e25\u0e1a {patient} \u0e08\u0e32\u0e01 {source}",tokens:[{type:"literal",value:"\u0e25\u0e1a",alternatives:["\u0e25\u0e1a\u0e2d\u0e2d\u0e01"]},{type:"role",role:"patient"},{type:"literal",value:"\u0e08\u0e32\u0e01"},{type:"role",role:"source"}]},extraction:{patient:{position:1},source:{marker:"\u0e08\u0e32\u0e01",position:3}}}];case"uk":return[{id:"remove-uk-full",language:"uk",command:"remove",priority:100,template:{format:"\u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 {patient} \u0437 {source}",tokens:[{type:"literal",value:"\u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438",alternatives:["\u0432\u0438\u0434\u0430\u043b\u0438","\u043f\u0440\u0438\u0431\u0440\u0430\u0442\u0438","\u043f\u0440\u0438\u0431\u0435\u0440\u0438"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0437",alternatives:["\u0432\u0456\u0434","\u0456\u0437"]},{type:"role",role:"source"}]}]},extraction:{patient:{position:1},source:{marker:"\u0437",markerAlternatives:["\u0432\u0456\u0434","\u0456\u0437"],default:{type:"reference",value:"me"}}}},{id:"remove-uk-simple",language:"uk",command:"remove",priority:90,template:{format:"\u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 {patient}",tokens:[{type:"literal",value:"\u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438",alternatives:["\u0432\u0438\u0434\u0430\u043b\u0438","\u043f\u0440\u0438\u0431\u0440\u0430\u0442\u0438","\u043f\u0440\u0438\u0431\u0435\u0440\u0438"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},source:{default:{type:"reference",value:"me"}}}}];case"vi":return[{id:"remove-vi-full",language:"vi",command:"remove",priority:100,template:{format:"x\u00f3a {patient} kh\u1ecfi {target}",tokens:[{type:"literal",value:"x\u00f3a",alternatives:["g\u1ee1 b\u1ecf","lo\u1ea1i b\u1ecf","b\u1ecf"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"kh\u1ecfi",alternatives:["t\u1eeb"]},{type:"role",role:"source"}]}]},extraction:{patient:{position:1},source:{marker:"kh\u1ecfi",markerAlternatives:["t\u1eeb"],default:{type:"reference",value:"me"}}}},{id:"remove-vi-simple",language:"vi",command:"remove",priority:90,template:{format:"x\u00f3a {patient}",tokens:[{type:"literal",value:"x\u00f3a",alternatives:["g\u1ee1 b\u1ecf","lo\u1ea1i b\u1ecf","b\u1ecf"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},source:{default:{type:"reference",value:"me"}}}}];case"zh":return[{id:"remove-zh-full",language:"zh",command:"remove",priority:100,template:{format:"\u4ece {destination} \u5220\u9664 {patient}",tokens:[{type:"literal",value:"\u4ece",alternatives:["\u5f9e"]},{type:"role",role:"destination"},{type:"literal",value:"\u5220\u9664",alternatives:["\u522a\u9664","\u79fb\u9664","\u53bb\u6389"]},{type:"role",role:"patient"}]},extraction:{destination:{position:1},patient:{position:3}}},{id:"remove-zh-simple",language:"zh",command:"remove",priority:90,template:{format:"\u5220\u9664 {patient}",tokens:[{type:"literal",value:"\u5220\u9664",alternatives:["\u522a\u9664","\u79fb\u9664","\u53bb\u6389"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},destination:{default:{type:"reference",value:"me"}}}},{id:"remove-zh-ba",language:"zh",command:"remove",priority:95,template:{format:"\u628a {patient} \u4ece {destination} \u5220\u9664",tokens:[{type:"literal",value:"\u628a"},{type:"role",role:"patient"},{type:"literal",value:"\u4ece",alternatives:["\u5f9e"]},{type:"role",role:"destination"},{type:"literal",value:"\u5220\u9664",alternatives:["\u522a\u9664","\u79fb\u9664"]}]},extraction:{patient:{position:1},destination:{position:3}}}];default:return[]}},function(e){switch(e){case"bn":return[{id:"show-bn-full",language:"bn",command:"show",priority:100,template:{format:"{patient} \u0995\u09c7 \u09a6\u09c7\u0996\u09be\u09a8",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0995\u09c7"},{type:"literal",value:"\u09a6\u09c7\u0996\u09be\u09a8",alternatives:["\u09a6\u09c7\u0996\u09be\u0993"]}]},extraction:{patient:{position:0}}},{id:"show-bn-simple",language:"bn",command:"show",priority:90,template:{format:"\u09a6\u09c7\u0996\u09be\u09a8 {patient}",tokens:[{type:"literal",value:"\u09a6\u09c7\u0996\u09be\u09a8",alternatives:["\u09a6\u09c7\u0996\u09be\u0993"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"de":return[{id:"show-de-full",language:"de",command:"show",priority:100,template:{format:"zeige {patient}",tokens:[{type:"literal",value:"zeige",alternatives:["zeigen","anzeigen","show"]},{type:"role",role:"patient",expectedTypes:["selector","reference"]}]},extraction:{patient:{position:1}}}];case"fr":return[{id:"show-fr-full",language:"fr",command:"show",priority:100,template:{format:"afficher {patient}",tokens:[{type:"literal",value:"afficher",alternatives:["montrer","pr\u00e9senter","show"]},{type:"role",role:"patient",expectedTypes:["selector","reference"]}]},extraction:{patient:{position:1}}}];case"hi":return[{id:"show-hi-full",language:"hi",command:"show",priority:100,template:{format:"{patient} \u0915\u094b \u0926\u093f\u0916\u093e\u090f\u0902",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0915\u094b"},{type:"literal",value:"\u0926\u093f\u0916\u093e\u090f\u0902",alternatives:["\u0926\u093f\u0916\u093e"]}]},extraction:{patient:{position:0}}},{id:"show-hi-simple",language:"hi",command:"show",priority:90,template:{format:"\u0926\u093f\u0916\u093e\u090f\u0902 {patient}",tokens:[{type:"literal",value:"\u0926\u093f\u0916\u093e\u090f\u0902",alternatives:["\u0926\u093f\u0916\u093e"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}},{id:"show-hi-bare",language:"hi",command:"show",priority:80,template:{format:"\u0926\u093f\u0916\u093e\u090f\u0902",tokens:[{type:"literal",value:"\u0926\u093f\u0916\u093e\u090f\u0902",alternatives:["\u0926\u093f\u0916\u093e"]}]},extraction:{patient:{default:{type:"reference",value:"me"}}}}];case"it":return[{id:"show-it-full",language:"it",command:"show",priority:100,template:{format:"mostrare {patient} con {style}",tokens:[{type:"literal",value:"mostrare",alternatives:["mostra","visualizzare","show"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"con"},{type:"role",role:"style"}]}]},extraction:{patient:{position:1},style:{marker:"con"}}},{id:"show-it-simple",language:"it",command:"show",priority:90,template:{format:"mostrare {patient}",tokens:[{type:"literal",value:"mostrare",alternatives:["mostra","visualizzare","show"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"pl":return[{id:"show-pl-full",language:"pl",command:"show",priority:100,template:{format:"poka\u017c {patient} z {style}",tokens:[{type:"literal",value:"poka\u017c",alternatives:["pokaz","wy\u015bwietl","wyswietl"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"z",alternatives:["ze","jako"]},{type:"role",role:"style"}]}]},extraction:{patient:{position:1},style:{marker:"z",markerAlternatives:["ze","jako"]}}},{id:"show-pl-simple",language:"pl",command:"show",priority:90,template:{format:"poka\u017c {patient}",tokens:[{type:"literal",value:"poka\u017c",alternatives:["pokaz","wy\u015bwietl","wyswietl"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"ru":return[{id:"show-ru-full",language:"ru",command:"show",priority:100,template:{format:"\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c {patient} \u0441 {style}",tokens:[{type:"literal",value:"\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c",alternatives:["\u043f\u043e\u043a\u0430\u0436\u0438"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0441",alternatives:["\u0441\u043e","\u043a\u0430\u043a"]},{type:"role",role:"style"}]}]},extraction:{patient:{position:1},style:{marker:"\u0441",markerAlternatives:["\u0441\u043e","\u043a\u0430\u043a"]}}},{id:"show-ru-simple",language:"ru",command:"show",priority:90,template:{format:"\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c {patient}",tokens:[{type:"literal",value:"\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c",alternatives:["\u043f\u043e\u043a\u0430\u0436\u0438"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"th":return[{id:"show-th-simple",language:"th",command:"show",priority:100,template:{format:"\u0e41\u0e2a\u0e14\u0e07 {patient}",tokens:[{type:"literal",value:"\u0e41\u0e2a\u0e14\u0e07"},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"uk":return[{id:"show-uk-full",language:"uk",command:"show",priority:100,template:{format:"\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0438 {patient} \u0437 {style}",tokens:[{type:"literal",value:"\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0438",alternatives:["\u043f\u043e\u043a\u0430\u0436\u0438"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0437",alternatives:["\u0456\u0437","\u044f\u043a"]},{type:"role",role:"style"}]}]},extraction:{patient:{position:1},style:{marker:"\u0437",markerAlternatives:["\u0456\u0437","\u044f\u043a"]}}},{id:"show-uk-simple",language:"uk",command:"show",priority:90,template:{format:"\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0438 {patient}",tokens:[{type:"literal",value:"\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0438",alternatives:["\u043f\u043e\u043a\u0430\u0436\u0438"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"vi":return[{id:"show-vi-full",language:"vi",command:"show",priority:100,template:{format:"hi\u1ec3n th\u1ecb {patient} v\u1edbi {effect}",tokens:[{type:"literal",value:"hi\u1ec3n th\u1ecb",alternatives:["hi\u1ec7n"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"v\u1edbi"},{type:"role",role:"style"}]}]},extraction:{patient:{position:1},style:{marker:"v\u1edbi"}}},{id:"show-vi-simple",language:"vi",command:"show",priority:90,template:{format:"hi\u1ec3n th\u1ecb {patient}",tokens:[{type:"literal",value:"hi\u1ec3n th\u1ecb",alternatives:["hi\u1ec7n"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"zh":return[{id:"show-zh-full",language:"zh",command:"show",priority:100,template:{format:"\u663e\u793a {patient}",tokens:[{type:"literal",value:"\u663e\u793a",alternatives:["\u986f\u793a","\u5c55\u793a","\u5448\u73b0","\u5448\u73fe"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}},{id:"show-zh-ba",language:"zh",command:"show",priority:95,template:{format:"\u628a {patient} \u663e\u793a",tokens:[{type:"literal",value:"\u628a"},{type:"role",role:"patient"},{type:"literal",value:"\u663e\u793a",alternatives:["\u986f\u793a","\u5c55\u793a"]}]},extraction:{patient:{position:1}}},{id:"show-zh-with-\u7ed9",language:"zh",command:"show",priority:90,template:{format:"\u7ed9 {destination} \u663e\u793a {patient}",tokens:[{type:"literal",value:"\u7ed9",alternatives:["\u7d66"]},{type:"role",role:"destination"},{type:"literal",value:"\u663e\u793a",alternatives:["\u986f\u793a"]},{type:"role",role:"patient"}]},extraction:{destination:{position:1},patient:{position:3}}}];default:return[]}},function(e){switch(e){case"bn":return[{id:"hide-bn-full",language:"bn",command:"hide",priority:100,template:{format:"{patient} \u0995\u09c7 \u09b2\u09c1\u0995\u09be\u09a8",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0995\u09c7"},{type:"literal",value:"\u09b2\u09c1\u0995\u09be\u09a8",alternatives:["\u09b2\u09c1\u0995\u09be\u0993"]}]},extraction:{patient:{position:0}}},{id:"hide-bn-simple",language:"bn",command:"hide",priority:90,template:{format:"\u09b2\u09c1\u0995\u09be\u09a8 {patient}",tokens:[{type:"literal",value:"\u09b2\u09c1\u0995\u09be\u09a8",alternatives:["\u09b2\u09c1\u0995\u09be\u0993"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"de":return[{id:"hide-de-full",language:"de",command:"hide",priority:100,template:{format:"verstecke {patient}",tokens:[{type:"literal",value:"verstecke",alternatives:["verstecken","verberge","verbergen","hide"]},{type:"role",role:"patient",expectedTypes:["selector","reference"]}]},extraction:{patient:{position:1}}}];case"hi":return[{id:"hide-hi-full",language:"hi",command:"hide",priority:100,template:{format:"{patient} \u0915\u094b \u091b\u093f\u092a\u093e\u090f\u0902",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0915\u094b"},{type:"literal",value:"\u091b\u093f\u092a\u093e\u090f\u0902",alternatives:["\u091b\u093f\u092a\u093e"]}]},extraction:{patient:{position:0}}},{id:"hide-hi-simple",language:"hi",command:"hide",priority:90,template:{format:"\u091b\u093f\u092a\u093e\u090f\u0902 {patient}",tokens:[{type:"literal",value:"\u091b\u093f\u092a\u093e\u090f\u0902",alternatives:["\u091b\u093f\u092a\u093e"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}},{id:"hide-hi-bare",language:"hi",command:"hide",priority:80,template:{format:"\u091b\u093f\u092a\u093e\u090f\u0902",tokens:[{type:"literal",value:"\u091b\u093f\u092a\u093e\u090f\u0902",alternatives:["\u091b\u093f\u092a\u093e"]}]},extraction:{patient:{default:{type:"reference",value:"me"}}}}];case"it":return[{id:"hide-it-full",language:"it",command:"hide",priority:100,template:{format:"nascondere {patient} con {style}",tokens:[{type:"literal",value:"nascondere",alternatives:["nascondi","hide"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"con"},{type:"role",role:"style"}]}]},extraction:{patient:{position:1},style:{marker:"con"}}},{id:"hide-it-simple",language:"it",command:"hide",priority:90,template:{format:"nascondere {patient}",tokens:[{type:"literal",value:"nascondere",alternatives:["nascondi","hide"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"pl":return[{id:"hide-pl-full",language:"pl",command:"hide",priority:100,template:{format:"ukryj {patient} z {style}",tokens:[{type:"literal",value:"ukryj",alternatives:["schowaj","zas\u0142o\u0144","zaslon"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"z",alternatives:["ze","jako"]},{type:"role",role:"style",expectedTypes:["literal"]}]}]},extraction:{patient:{position:1},style:{marker:"z",markerAlternatives:["ze","jako"]}}},{id:"hide-pl-simple",language:"pl",command:"hide",priority:90,template:{format:"ukryj {patient}",tokens:[{type:"literal",value:"ukryj",alternatives:["schowaj","zas\u0142o\u0144","zaslon"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"ru":return[{id:"hide-ru-full",language:"ru",command:"hide",priority:100,template:{format:"\u0441\u043a\u0440\u044b\u0442\u044c {patient} \u0441 {style}",tokens:[{type:"literal",value:"\u0441\u043a\u0440\u044b\u0442\u044c",alternatives:["\u0441\u043a\u0440\u043e\u0439","\u0441\u043f\u0440\u044f\u0442\u0430\u0442\u044c","\u0441\u043f\u0440\u044f\u0447\u044c"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0441",alternatives:["\u0441\u043e","\u043a\u0430\u043a"]},{type:"role",role:"style"}]}]},extraction:{patient:{position:1},style:{marker:"\u0441",markerAlternatives:["\u0441\u043e","\u043a\u0430\u043a"]}}},{id:"hide-ru-simple",language:"ru",command:"hide",priority:90,template:{format:"\u0441\u043a\u0440\u044b\u0442\u044c {patient}",tokens:[{type:"literal",value:"\u0441\u043a\u0440\u044b\u0442\u044c",alternatives:["\u0441\u043a\u0440\u043e\u0439","\u0441\u043f\u0440\u044f\u0442\u0430\u0442\u044c","\u0441\u043f\u0440\u044f\u0447\u044c"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"th":return[{id:"hide-th-simple",language:"th",command:"hide",priority:100,template:{format:"\u0e0b\u0e48\u0e2d\u0e19 {patient}",tokens:[{type:"literal",value:"\u0e0b\u0e48\u0e2d\u0e19"},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"uk":return[{id:"hide-uk-full",language:"uk",command:"hide",priority:100,template:{format:"\u0441\u0445\u043e\u0432\u0430\u0442\u0438 {patient} \u0437 {style}",tokens:[{type:"literal",value:"\u0441\u0445\u043e\u0432\u0430\u0442\u0438",alternatives:["\u0441\u0445\u043e\u0432\u0430\u0439","\u043f\u0440\u0438\u0445\u043e\u0432\u0430\u0442\u0438","\u043f\u0440\u0438\u0445\u043e\u0432\u0430\u0439"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0437",alternatives:["\u0456\u0437","\u044f\u043a"]},{type:"role",role:"style",expectedTypes:["literal"]}]}]},extraction:{patient:{position:1},style:{marker:"\u0437",markerAlternatives:["\u0456\u0437","\u044f\u043a"]}}},{id:"hide-uk-simple",language:"uk",command:"hide",priority:90,template:{format:"\u0441\u0445\u043e\u0432\u0430\u0442\u0438 {patient}",tokens:[{type:"literal",value:"\u0441\u0445\u043e\u0432\u0430\u0442\u0438",alternatives:["\u0441\u0445\u043e\u0432\u0430\u0439","\u043f\u0440\u0438\u0445\u043e\u0432\u0430\u0442\u0438","\u043f\u0440\u0438\u0445\u043e\u0432\u0430\u0439"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"vi":return[{id:"hide-vi-full",language:"vi",command:"hide",priority:100,template:{format:"\u1ea9n {patient} v\u1edbi {effect}",tokens:[{type:"literal",value:"\u1ea9n",alternatives:["che","gi\u1ea5u"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"v\u1edbi"},{type:"role",role:"style"}]}]},extraction:{patient:{position:1},style:{marker:"v\u1edbi"}}},{id:"hide-vi-simple",language:"vi",command:"hide",priority:90,template:{format:"\u1ea9n {patient}",tokens:[{type:"literal",value:"\u1ea9n",alternatives:["che","gi\u1ea5u"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"zh":return[{id:"hide-zh-full",language:"zh",command:"hide",priority:100,template:{format:"\u9690\u85cf {patient}",tokens:[{type:"literal",value:"\u9690\u85cf",alternatives:["\u96b1\u85cf","\u85cf\u8d77","\u85cf"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}},{id:"hide-zh-ba",language:"zh",command:"hide",priority:95,template:{format:"\u628a {patient} \u9690\u85cf",tokens:[{type:"literal",value:"\u628a"},{type:"role",role:"patient"},{type:"literal",value:"\u9690\u85cf",alternatives:["\u96b1\u85cf","\u85cf\u8d77"]}]},extraction:{patient:{position:1}}},{id:"hide-zh-from",language:"zh",command:"hide",priority:90,template:{format:"\u4ece {destination} \u9690\u85cf {patient}",tokens:[{type:"literal",value:"\u4ece",alternatives:["\u5f9e"]},{type:"role",role:"destination"},{type:"literal",value:"\u9690\u85cf",alternatives:["\u96b1\u85cf"]},{type:"role",role:"patient"}]},extraction:{destination:{position:1},patient:{position:3}}}];default:return[]}},function(e){switch(e){case"bn":return DC([{id:"set-bn-full",language:"bn",command:"set",priority:100,template:{format:"{destination} \u0995\u09c7 {patient} \u098f \u09b8\u09c7\u099f \u0995\u09b0\u09c1\u09a8",tokens:[{type:"role",role:"destination"},{type:"literal",value:"\u0995\u09c7"},{type:"role",role:"patient"},{type:"literal",value:"\u098f",alternatives:["\u09a4\u09c7"]},{type:"literal",value:"\u09b8\u09c7\u099f",alternatives:["\u09a8\u09bf\u09b0\u09cd\u09a7\u09be\u09b0\u09a3"]},{type:"literal",value:"\u0995\u09b0\u09c1\u09a8"}]},extraction:{destination:{position:0},patient:{marker:"\u098f",position:2}}},{id:"set-bn-simple",language:"bn",command:"set",priority:90,template:{format:"\u09b8\u09c7\u099f {destination} {patient}",tokens:[{type:"literal",value:"\u09b8\u09c7\u099f",alternatives:["\u09a8\u09bf\u09b0\u09cd\u09a7\u09be\u09b0\u09a3"]},{type:"role",role:"destination"},{type:"role",role:"patient"}]},extraction:{destination:{position:1},patient:{position:2}}}]);case"de":return DC([{id:"set-de-full",language:"de",command:"set",priority:100,template:{format:"setze {destination} auf {patient}",tokens:[{type:"literal",value:"setze",alternatives:["set"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"auf",alternatives:["zu","an"]},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:1},patient:{position:3}}},{id:"set-de-festlegen-auf",language:"de",command:"set",priority:99,template:{format:"festlegen auf {destination} {patient}",tokens:[{type:"literal",value:"festlegen",alternatives:["einstellen"]},{type:"literal",value:"auf",alternatives:["an"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:2},patient:{position:3}}},{id:"set-de-equals",language:"de",command:"set",priority:95,template:{format:"{destination} = {patient}",tokens:[{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"="},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:0},patient:{position:2}}}]);case"es":return DC([{id:"set-es-full",language:"es",command:"set",priority:100,template:{format:"establecer {destination} a {patient}",tokens:[{type:"literal",value:"establecer",alternatives:["fijar","definir","poner","set"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"a",alternatives:["en","como"]},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:1},patient:{position:3}}},{id:"set-es-prep-first",language:"es",command:"set",priority:95,template:{format:"establecer en {destination} {patient}",tokens:[{type:"literal",value:"establecer",alternatives:["fijar","definir","poner","set"]},{type:"literal",value:"en",alternatives:["a"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:2},patient:{position:3}}},{id:"set-es-equals",language:"es",command:"set",priority:95,template:{format:"{destination} = {patient}",tokens:[{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"="},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:0},patient:{position:2}}}]);case"fr":return DC([{id:"set-fr-full",language:"fr",command:"set",priority:100,template:{format:"d\u00e9finir {destination} \u00e0 {patient}",tokens:[{type:"literal",value:"d\u00e9finir",alternatives:["definir","fixer","set"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"\u00e0",alternatives:["a","sur","comme"]},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:1},patient:{position:3}}},{id:"set-fr-sur-direct",language:"fr",command:"set",priority:98,template:{format:"d\u00e9finir sur {destination} {patient}",tokens:[{type:"literal",value:"d\u00e9finir",alternatives:["definir","mettre","fixer"]},{type:"literal",value:"sur",alternatives:["\u00e0","en"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:2},patient:{position:3}}},{id:"set-fr-equals",language:"fr",command:"set",priority:95,template:{format:"{destination} = {patient}",tokens:[{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"="},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:0},patient:{position:2}}}]);case"he":return DC([{id:"set-he-full",language:"he",command:"set",priority:100,template:{format:"\u05e7\u05d1\u05e2 \u05d0\u05ea {destination} \u05e2\u05dc {patient}",tokens:[{type:"literal",value:"\u05e7\u05d1\u05e2",alternatives:["\u05d4\u05d2\u05d3\u05e8"]},{type:"literal",value:"\u05d0\u05ea"},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"\u05e2\u05dc",alternatives:["\u05d1","\u05d0\u05dc","\u05dc","\u05db"]},{type:"role",role:"patient",expectedTypes:["literal","expression","reference","selector"]}]},extraction:{destination:{marker:"\u05d0\u05ea"},patient:{marker:"\u05e2\u05dc",markerAlternatives:["\u05d1","\u05d0\u05dc","\u05dc","\u05db"]}}}]);case"hi":return DC([{id:"set-hi-full",language:"hi",command:"set",priority:100,template:{format:"{destination} \u0915\u094b {patient} \u0938\u0947\u091f \u0915\u0930\u0947\u0902",tokens:[{type:"role",role:"destination"},{type:"literal",value:"\u0915\u094b"},{type:"role",role:"patient"},{type:"literal",value:"\u0938\u0947\u091f",alternatives:["\u0928\u093f\u0930\u094d\u0927\u093e\u0930\u093f\u0924"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0915\u0930\u0947\u0902",alternatives:["\u0915\u0930\u094b"]}]}]},extraction:{destination:{position:0},patient:{marker:"\u0915\u094b",position:2}}},{id:"set-hi-simple",language:"hi",command:"set",priority:90,template:{format:"\u0938\u0947\u091f {destination} {patient}",tokens:[{type:"literal",value:"\u0938\u0947\u091f",alternatives:["\u0928\u093f\u0930\u094d\u0927\u093e\u0930\u093f\u0924"]},{type:"role",role:"destination"},{type:"role",role:"patient"}]},extraction:{destination:{position:1},patient:{position:2}}}]);case"id":return DC([{id:"set-id-full",language:"id",command:"set",priority:100,template:{format:"atur {destination} ke {patient}",tokens:[{type:"literal",value:"atur",alternatives:["tetapkan","setel","set"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"ke",alternatives:["menjadi","jadi","pada"]},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:1},patient:{position:3}}},{id:"set-id-pada-direct",language:"id",command:"set",priority:98,template:{format:"atur pada {destination} {patient}",tokens:[{type:"literal",value:"atur",alternatives:["tetapkan","setel"]},{type:"literal",value:"pada",alternatives:["ke","di"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:2},patient:{position:3}}},{id:"set-id-equals",language:"id",command:"set",priority:95,template:{format:"{destination} = {patient}",tokens:[{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"="},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:0},patient:{position:2}}}]);case"ms":return DC([{id:"set-ms-full",language:"ms",command:"set",priority:100,template:{format:"tetapkan {destination} ke {patient}",tokens:[{type:"literal",value:"tetapkan",alternatives:["setkan","set"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"ke",alternatives:["kepada","menjadi","jadi"]},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:1},patient:{position:3}}}]);case"it":return DC([{id:"set-it-full",language:"it",command:"set",priority:100,template:{format:"impostare {destination} a {patient}",tokens:[{type:"literal",value:"impostare",alternatives:["imposta","set","definire"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"a",alternatives:["su","come","in"]},{type:"role",role:"patient"}]}]},extraction:{destination:{position:1},patient:{marker:"a",markerAlternatives:["su","come","in"]}}},{id:"set-it-simple",language:"it",command:"set",priority:90,template:{format:"impostare {destination}",tokens:[{type:"literal",value:"impostare",alternatives:["imposta","set"]},{type:"role",role:"destination"}]},extraction:{destination:{position:1}}}]);case"pl":return DC([{id:"set-pl-full",language:"pl",command:"set",priority:100,template:{format:"ustaw {destination} na {patient}",tokens:[{type:"literal",value:"ustaw",alternatives:["okre\u015bl","okresl","przypisz"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"na",alternatives:["do","jako"]},{type:"role",role:"patient"}]}]},extraction:{destination:{position:1},patient:{marker:"na",markerAlternatives:["do","jako"]}}},{id:"set-pl-simple",language:"pl",command:"set",priority:90,template:{format:"ustaw {destination}",tokens:[{type:"literal",value:"ustaw",alternatives:["okre\u015bl","okresl"]},{type:"role",role:"destination"}]},extraction:{destination:{position:1}}}]);case"pt":return DC([{id:"set-pt-full",language:"pt",command:"set",priority:100,template:{format:"definir {destination} para {patient}",tokens:[{type:"literal",value:"definir",alternatives:["estabelecer","set"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"para",alternatives:["como","a","em"]},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:1},patient:{position:3}}},{id:"set-pt-em-direct",language:"pt",command:"set",priority:98,template:{format:"definir em {destination} {patient}",tokens:[{type:"literal",value:"definir",alternatives:["estabelecer"]},{type:"literal",value:"em",alternatives:["para","a"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:2},patient:{position:3}}},{id:"set-pt-equals",language:"pt",command:"set",priority:95,template:{format:"{destination} = {patient}",tokens:[{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"="},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:0},patient:{position:2}}}]);case"qu":return DC([{id:"set-qu-oblique-source",language:"qu",command:"set",priority:105,template:{format:"{destination} ta {source} manta {patient} man churanay",tokens:[{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"ta"},{type:"role",role:"source",expectedTypes:["selector","reference","expression"]},{type:"literal",value:"manta"},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]},{type:"literal",value:"man"},{type:"literal",value:"churanay",alternatives:["kamaykuy"]}]},extraction:{destination:{position:0},source:{position:2},patient:{position:4}}}]);case"ru":return DC([{id:"set-ru-full",language:"ru",command:"set",priority:100,template:{format:"\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c {destination} \u0432 {patient}",tokens:[{type:"literal",value:"\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c",alternatives:["\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438","\u0437\u0430\u0434\u0430\u0442\u044c","\u0437\u0430\u0434\u0430\u0439"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0432",alternatives:["\u043d\u0430","\u043a\u0430\u043a"]},{type:"role",role:"patient"}]}]},extraction:{destination:{position:1},patient:{marker:"\u0432",markerAlternatives:["\u043d\u0430","\u043a\u0430\u043a"]}}},{id:"set-ru-simple",language:"ru",command:"set",priority:90,template:{format:"\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c {destination}",tokens:[{type:"literal",value:"\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c",alternatives:["\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438","\u0437\u0430\u0434\u0430\u0442\u044c","\u0437\u0430\u0434\u0430\u0439"]},{type:"role",role:"destination"}]},extraction:{destination:{position:1}}}]);case"sw":return DC([{id:"set-sw-kwa",language:"sw",command:"set",priority:100,template:{format:"seti {destination} kwa {patient}",tokens:[{type:"literal",value:"seti",alternatives:["weka thamani"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"kwa",alternatives:["kwenye"]},{type:"role",role:"patient",expectedTypes:["literal","expression","reference","selector"]}]},extraction:{destination:{position:1},patient:{marker:"kwa",markerAlternatives:["kwenye"]}}}]);case"th":return DC([{id:"set-th-simple",language:"th",command:"set",priority:100,template:{format:"\u0e15\u0e31\u0e49\u0e07 {destination} \u0e43\u0e19 {patient}",tokens:[{type:"literal",value:"\u0e15\u0e31\u0e49\u0e07",alternatives:["\u0e01\u0e33\u0e2b\u0e19\u0e14","\u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0e43\u0e19",alternatives:["\u0e40\u0e1b\u0e47\u0e19"]},{type:"role",role:"patient"}]}]},extraction:{destination:{position:1},patient:{marker:"\u0e43\u0e19",markerAlternatives:["\u0e40\u0e1b\u0e47\u0e19"]}}}]);case"uk":return DC([{id:"set-uk-full",language:"uk",command:"set",priority:100,template:{format:"\u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0438 {destination} \u0432 {patient}",tokens:[{type:"literal",value:"\u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0438",alternatives:["\u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438","\u0437\u0430\u0434\u0430\u0442\u0438","\u0437\u0430\u0434\u0430\u0439"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0432",alternatives:["\u043d\u0430","\u044f\u043a"]},{type:"role",role:"patient"}]}]},extraction:{destination:{position:1},patient:{marker:"\u0432",markerAlternatives:["\u043d\u0430","\u044f\u043a"]}}},{id:"set-uk-simple",language:"uk",command:"set",priority:90,template:{format:"\u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0438 {destination}",tokens:[{type:"literal",value:"\u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0438",alternatives:["\u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438","\u0437\u0430\u0434\u0430\u0442\u0438","\u0437\u0430\u0434\u0430\u0439"]},{type:"role",role:"destination"}]},extraction:{destination:{position:1}}}]);case"vi":return DC([{id:"set-vi-vao",language:"vi",command:"set",priority:101,template:{format:"g\u00e1n {destination} v\u00e0o {patient}",tokens:[{type:"literal",value:"g\u00e1n",alternatives:["thi\u1ebft l\u1eadp","\u0111\u1eb7t gi\u00e1 tr\u1ecb"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"v\u00e0o",alternatives:["cho","\u0111\u1ebfn"]},{type:"role",role:"patient",expectedTypes:["literal","expression","reference","selector"]}]},extraction:{destination:{position:1},patient:{marker:"v\u00e0o",markerAlternatives:["cho","\u0111\u1ebfn"]}}},{id:"set-vi-full",language:"vi",command:"set",priority:100,template:{format:"g\u00e1n {destination} th\u00e0nh {patient}",tokens:[{type:"literal",value:"g\u00e1n",alternatives:["thi\u1ebft l\u1eadp","\u0111\u1eb7t gi\u00e1 tr\u1ecb"]},{type:"role",role:"patient"},{type:"literal",value:"th\u00e0nh",alternatives:["b\u1eb1ng","l\u00e0"]},{type:"role",role:"goal"}]},extraction:{patient:{position:1},goal:{marker:"th\u00e0nh",markerAlternatives:["b\u1eb1ng","l\u00e0"]}}},{id:"set-vi-simple",language:"vi",command:"set",priority:90,template:{format:"\u0111\u1eb7t {destination} l\u00e0 {patient}",tokens:[{type:"literal",value:"\u0111\u1eb7t"},{type:"role",role:"patient"},{type:"literal",value:"l\u00e0"},{type:"role",role:"goal"}]},extraction:{patient:{position:1},goal:{marker:"l\u00e0"}}}]);case"zh":return DC([{id:"set-zh-full",language:"zh",command:"set",priority:100,template:{format:"\u8bbe\u7f6e {destination} \u4e3a {patient}",tokens:[{type:"literal",value:"\u8bbe\u7f6e",alternatives:["\u8a2d\u7f6e","\u8bbe\u5b9a","\u8a2d\u5b9a"]},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"\u4e3a",alternatives:["\u70ba","\u5230","\u6210"]},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:1},patient:{marker:"\u4e3a",markerAlternatives:["\u70ba","\u5230","\u6210"]}}},{id:"set-zh-ba",language:"zh",command:"set",priority:95,template:{format:"\u628a {destination} \u8bbe\u7f6e \u5230 {patient}",tokens:[{type:"literal",value:"\u628a"},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"\u8bbe\u7f6e",alternatives:["\u8a2d\u7f6e","\u8bbe\u5b9a","\u8a2d\u5b9a","\u8bbe\u7f6e\u4e3a","\u8a2d\u7f6e\u70ba","\u8bbe\u5b9a\u4e3a","\u8a2d\u5b9a\u70ba"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u5230",alternatives:["\u4e3a","\u70ba","\u6210"]}]},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:1},patient:{marker:"\u5230",markerAlternatives:["\u4e3a","\u70ba","\u6210"]}}},{id:"set-zh-vba",language:"zh",command:"set",priority:96,template:{format:"\u8bbe\u7f6e \u628a {destination} \u5230 {patient}",tokens:[{type:"literal",value:"\u8bbe\u7f6e",alternatives:["\u8a2d\u7f6e","\u8bbe\u5b9a","\u8a2d\u5b9a"]},{type:"literal",value:"\u628a"},{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u5230",alternatives:["\u4e3a","\u70ba","\u6210"]}]},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:2},patient:{marker:"\u5230",markerAlternatives:["\u4e3a","\u70ba","\u6210"]}}},{id:"set-zh-simple",language:"zh",command:"set",priority:90,template:{format:"{destination} = {patient}",tokens:[{type:"role",role:"destination",expectedTypes:["property-path","selector","reference","expression"]},{type:"literal",value:"="},{type:"role",role:"patient",expectedTypes:["literal","expression","reference"]}]},extraction:{destination:{position:0},patient:{position:2}}}]);default:return[]}},function(e){switch(e){case"bn":return[{id:"get-bn-full",language:"bn",command:"get",priority:100,template:{format:"{source} \u09a5\u09c7\u0995\u09c7 \u09aa\u09be\u09a8",tokens:[{type:"role",role:"source"},{type:"literal",value:"\u09a5\u09c7\u0995\u09c7"},{type:"literal",value:"\u09aa\u09be\u09a8"}]},extraction:{source:{position:0}}},{id:"get-bn-simple",language:"bn",command:"get",priority:90,template:{format:"\u09aa\u09be\u09a8 {source}",tokens:[{type:"literal",value:"\u09aa\u09be\u09a8"},{type:"role",role:"source"}]},extraction:{source:{position:1}}}];case"de":return[{id:"get-de-full",language:"de",command:"get",priority:100,template:{format:"hole {source}",tokens:[{type:"literal",value:"hole",alternatives:["holen","get","bekomme","bekommen"]},{type:"role",role:"source",expectedTypes:["selector","reference","expression"]}]},extraction:{source:{position:1}}}];case"zh":return[{id:"get-zh-ba",language:"zh",command:"get",priority:105,template:{format:"\u83b7\u53d6 \u628a {source}",tokens:[{type:"literal",value:"\u83b7\u53d6",alternatives:["\u83b7\u5f97","\u53d6\u5f97"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u628a",alternatives:["\u4ece","\u7531"]}]},{type:"role",role:"source",expectedTypes:["selector","reference","expression"]}]},extraction:{source:{marker:"\u628a",markerAlternatives:["\u4ece","\u7531"]}}}];case"hi":return[{id:"get-hi-full",language:"hi",command:"get",priority:100,template:{format:"{source} \u0938\u0947 \u092a\u094d\u0930\u093e\u092a\u094d\u0924 \u0915\u0930\u0947\u0902",tokens:[{type:"role",role:"source"},{type:"literal",value:"\u0938\u0947"},{type:"literal",value:"\u092a\u094d\u0930\u093e\u092a\u094d\u0924",alternatives:["\u092a\u093e\u090f\u0902"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0915\u0930\u0947\u0902",alternatives:["\u0915\u0930\u094b"]}]}]},extraction:{source:{position:0}}},{id:"get-hi-simple",language:"hi",command:"get",priority:90,template:{format:"\u092a\u094d\u0930\u093e\u092a\u094d\u0924 {source}",tokens:[{type:"literal",value:"\u092a\u094d\u0930\u093e\u092a\u094d\u0924",alternatives:["\u092a\u093e\u090f\u0902"]},{type:"role",role:"source"}]},extraction:{source:{position:1}}}];case"it":return[{id:"get-it-full",language:"it",command:"get",priority:100,template:{format:"ottenere {patient} da {source}",tokens:[{type:"literal",value:"ottenere",alternatives:["ottieni","get"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"da",alternatives:["di"]},{type:"role",role:"source"}]}]},extraction:{patient:{position:1},source:{marker:"da",markerAlternatives:["di"]}}},{id:"get-it-simple",language:"it",command:"get",priority:90,template:{format:"ottenere {patient}",tokens:[{type:"literal",value:"ottenere",alternatives:["ottieni","get"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"pl":return[{id:"get-pl-full",language:"pl",command:"get",priority:100,template:{format:"uzyskaj {patient} z {source}",tokens:[{type:"literal",value:"uzyskaj"},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"z",alternatives:["od","ze"]},{type:"role",role:"source"}]}]},extraction:{patient:{position:1},source:{marker:"z",markerAlternatives:["od","ze"]}}},{id:"get-pl-simple",language:"pl",command:"get",priority:90,template:{format:"uzyskaj {patient}",tokens:[{type:"literal",value:"uzyskaj"},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"ru":return[{id:"get-ru-full",language:"ru",command:"get",priority:100,template:{format:"\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c {patient} \u0438\u0437 {source}",tokens:[{type:"literal",value:"\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c",alternatives:["\u043f\u043e\u043b\u0443\u0447\u0438"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0438\u0437",alternatives:["\u043e\u0442","\u0441"]},{type:"role",role:"source"}]}]},extraction:{patient:{position:1},source:{marker:"\u0438\u0437",markerAlternatives:["\u043e\u0442","\u0441"]}}},{id:"get-ru-simple",language:"ru",command:"get",priority:90,template:{format:"\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c {patient}",tokens:[{type:"literal",value:"\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c",alternatives:["\u043f\u043e\u043b\u0443\u0447\u0438"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"th":return[{id:"get-th-simple",language:"th",command:"get",priority:100,template:{format:"\u0e23\u0e31\u0e1a\u0e04\u0e48\u0e32 {source}",tokens:[{type:"literal",value:"\u0e23\u0e31\u0e1a\u0e04\u0e48\u0e32"},{type:"role",role:"source"}]},extraction:{source:{position:1}}}];case"uk":return[{id:"get-uk-full",language:"uk",command:"get",priority:100,template:{format:"\u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 {patient} \u0437 {source}",tokens:[{type:"literal",value:"\u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438",alternatives:["\u043e\u0442\u0440\u0438\u043c\u0430\u0439"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0437",alternatives:["\u0432\u0456\u0434","\u0456\u0437"]},{type:"role",role:"source"}]}]},extraction:{patient:{position:1},source:{marker:"\u0437",markerAlternatives:["\u0432\u0456\u0434","\u0456\u0437"]}}},{id:"get-uk-simple",language:"uk",command:"get",priority:90,template:{format:"\u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 {patient}",tokens:[{type:"literal",value:"\u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438",alternatives:["\u043e\u0442\u0440\u0438\u043c\u0430\u0439"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"vi":return[{id:"get-vi-full",language:"vi",command:"get",priority:100,template:{format:"l\u1ea5y gi\u00e1 tr\u1ecb c\u1ee7a {target}",tokens:[{type:"literal",value:"l\u1ea5y gi\u00e1 tr\u1ecb",alternatives:["nh\u1eadn"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"c\u1ee7a"}]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}},{id:"get-vi-simple",language:"vi",command:"get",priority:90,template:{format:"l\u1ea5y gi\u00e1 tr\u1ecb {target}",tokens:[{type:"literal",value:"l\u1ea5y gi\u00e1 tr\u1ecb",alternatives:["nh\u1eadn"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];default:return[]}},function(e){switch(e){case"bn":return[{id:"increment-bn-full",language:"bn",command:"increment",priority:100,template:{format:"{patient} \u0995\u09c7 \u09ac\u09c3\u09a6\u09cd\u09a7\u09bf \u0995\u09b0\u09c1\u09a8",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0995\u09c7"},{type:"literal",value:"\u09ac\u09c3\u09a6\u09cd\u09a7\u09bf",alternatives:["\u09ac\u09be\u09a1\u09bc\u09be\u09a8"]},{type:"literal",value:"\u0995\u09b0\u09c1\u09a8"}]},extraction:{patient:{position:0}}},{id:"increment-bn-with-quantity",language:"bn",command:"increment",priority:95,template:{format:"{patient} \u0995\u09c7 {quantity} \u09a6\u09bf\u09af\u09bc\u09c7 \u09ac\u09c3\u09a6\u09cd\u09a7\u09bf \u0995\u09b0\u09c1\u09a8",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0995\u09c7"},{type:"role",role:"quantity"},{type:"literal",value:"\u09a6\u09bf\u09af\u09bc\u09c7"},{type:"literal",value:"\u09ac\u09c3\u09a6\u09cd\u09a7\u09bf",alternatives:["\u09ac\u09be\u09a1\u09bc\u09be\u09a8"]},{type:"literal",value:"\u0995\u09b0\u09c1\u09a8"}]},extraction:{patient:{position:0},quantity:{marker:"\u09a6\u09bf\u09af\u09bc\u09c7",position:2}}},{id:"increment-bn-simple",language:"bn",command:"increment",priority:90,template:{format:"\u09ac\u09c3\u09a6\u09cd\u09a7\u09bf {patient}",tokens:[{type:"literal",value:"\u09ac\u09c3\u09a6\u09cd\u09a7\u09bf",alternatives:["\u09ac\u09be\u09a1\u09bc\u09be\u09a8"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"de":return function(){const e=["erhoehe","erh\u00f6hen","inkrementiere","inkrementieren","increment"];return[{id:"increment-de-with-quantity",language:"de",command:"increment",priority:105,template:{format:"erh\u00f6he {patient} um {quantity}",tokens:[{type:"literal",value:"erh\u00f6he",alternatives:e},{type:"role",role:"patient",expectedTypes:["selector","reference","expression"]},{type:"literal",value:"um"},{type:"role",role:"quantity"}]},extraction:{patient:{position:1},quantity:{marker:"um",position:3}}},{id:"increment-de-full",language:"de",command:"increment",priority:100,template:{format:"erh\u00f6he {patient}",tokens:[{type:"literal",value:"erh\u00f6he",alternatives:e},{type:"role",role:"patient",expectedTypes:["selector","reference","expression"]}]},extraction:{patient:{position:1}}}]}();case"hi":return[{id:"increment-hi-full",language:"hi",command:"increment",priority:100,template:{format:"{patient} \u0915\u094b \u092c\u0922\u093c\u093e\u090f\u0902",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0915\u094b"},{type:"literal",value:"\u092c\u0922\u093c\u093e\u090f\u0902",alternatives:["\u092c\u0922\u093c\u093e"]}]},extraction:{patient:{position:0}}},{id:"increment-hi-with-quantity",language:"hi",command:"increment",priority:95,template:{format:"{patient} \u0915\u094b {quantity} \u0938\u0947 \u092c\u0922\u093c\u093e\u090f\u0902",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0915\u094b"},{type:"role",role:"quantity"},{type:"literal",value:"\u0938\u0947"},{type:"literal",value:"\u092c\u0922\u093c\u093e\u090f\u0902",alternatives:["\u092c\u0922\u093c\u093e"]}]},extraction:{patient:{position:0},quantity:{marker:"\u0938\u0947",position:2}}},{id:"increment-hi-simple",language:"hi",command:"increment",priority:90,template:{format:"\u092c\u0922\u093c\u093e\u090f\u0902 {patient}",tokens:[{type:"literal",value:"\u092c\u0922\u093c\u093e\u090f\u0902",alternatives:["\u092c\u0922\u093c\u093e"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"it":return[{id:"increment-it-full",language:"it",command:"increment",priority:100,template:{format:"incrementare {patient} di {quantity}",tokens:[{type:"literal",value:"incrementare",alternatives:["incrementa","aumentare","increment"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"di",alternatives:["per"]},{type:"role",role:"quantity"}]}]},extraction:{patient:{position:1},quantity:{marker:"di",markerAlternatives:["per"],default:{type:"literal",value:1}}}},{id:"increment-it-simple",language:"it",command:"increment",priority:90,template:{format:"incrementare {patient}",tokens:[{type:"literal",value:"incrementare",alternatives:["incrementa","aumentare","increment"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},quantity:{default:{type:"literal",value:1}}}}];case"pl":return[{id:"increment-pl-full",language:"pl",command:"increment",priority:100,template:{format:"zwi\u0119ksz {patient} o {quantity}",tokens:[{type:"literal",value:"zwi\u0119ksz",alternatives:["zwieksz","podnie\u015b","podnies"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"o"},{type:"role",role:"quantity"}]}]},extraction:{patient:{position:1},quantity:{marker:"o",default:{type:"literal",value:1}}}},{id:"increment-pl-simple",language:"pl",command:"increment",priority:90,template:{format:"zwi\u0119ksz {patient}",tokens:[{type:"literal",value:"zwi\u0119ksz",alternatives:["zwieksz","podnie\u015b","podnies"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},quantity:{default:{type:"literal",value:1}}}}];case"ru":return[{id:"increment-ru-full",language:"ru",command:"increment",priority:100,template:{format:"\u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c {patient} \u043d\u0430 {quantity}",tokens:[{type:"literal",value:"\u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c",alternatives:["\u0443\u0432\u0435\u043b\u0438\u0447\u044c"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u043d\u0430"},{type:"role",role:"quantity"}]}]},extraction:{patient:{position:1},quantity:{marker:"\u043d\u0430",default:{type:"literal",value:1}}}},{id:"increment-ru-simple",language:"ru",command:"increment",priority:90,template:{format:"\u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c {patient}",tokens:[{type:"literal",value:"\u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c",alternatives:["\u0443\u0432\u0435\u043b\u0438\u0447\u044c"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},quantity:{default:{type:"literal",value:1}}}}];case"th":return[{id:"increment-th-simple",language:"th",command:"increment",priority:100,template:{format:"\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e04\u0e48\u0e32 {patient}",tokens:[{type:"literal",value:"\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e04\u0e48\u0e32"},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}},{id:"increment-th-with-quantity",language:"th",command:"increment",priority:95,template:{format:"\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e04\u0e48\u0e32 {patient} \u0e14\u0e49\u0e27\u0e22 {quantity}",tokens:[{type:"literal",value:"\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e04\u0e48\u0e32"},{type:"role",role:"patient"},{type:"literal",value:"\u0e14\u0e49\u0e27\u0e22"},{type:"role",role:"quantity"}]},extraction:{patient:{position:1},quantity:{marker:"\u0e14\u0e49\u0e27\u0e22",position:3}}}];case"uk":return[{id:"increment-uk-full",language:"uk",command:"increment",priority:100,template:{format:"\u0437\u0431\u0456\u043b\u044c\u0448\u0438\u0442\u0438 {patient} \u043d\u0430 {quantity}",tokens:[{type:"literal",value:"\u0437\u0431\u0456\u043b\u044c\u0448\u0438\u0442\u0438",alternatives:["\u0437\u0431\u0456\u043b\u044c\u0448"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u043d\u0430"},{type:"role",role:"quantity"}]}]},extraction:{patient:{position:1},quantity:{marker:"\u043d\u0430",default:{type:"literal",value:1}}}},{id:"increment-uk-simple",language:"uk",command:"increment",priority:90,template:{format:"\u0437\u0431\u0456\u043b\u044c\u0448\u0438\u0442\u0438 {patient}",tokens:[{type:"literal",value:"\u0437\u0431\u0456\u043b\u044c\u0448\u0438\u0442\u0438",alternatives:["\u0437\u0431\u0456\u043b\u044c\u0448"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},quantity:{default:{type:"literal",value:1}}}}];case"qu":return[{id:"increment-qu-sov",language:"qu",command:"increment",priority:100,template:{format:"{patient} ta yapachiy",tokens:[{type:"role",role:"patient"},{type:"literal",value:"ta"},{type:"literal",value:"yapachiy"}]},extraction:{patient:{position:0},quantity:{default:{type:"literal",value:1}}}},{id:"increment-qu-simple",language:"qu",command:"increment",priority:90,template:{format:"yapachiy {patient}",tokens:[{type:"literal",value:"yapachiy"},{type:"role",role:"patient"}]},extraction:{patient:{position:1},quantity:{default:{type:"literal",value:1}}}}];case"vi":return[{id:"increment-vi-full",language:"vi",command:"increment",priority:100,template:{format:"t\u0103ng {target} th\u00eam {amount}",tokens:[{type:"literal",value:"t\u0103ng",alternatives:["t\u0103ng l\u00ean"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"th\u00eam",alternatives:["l\u00ean"]},{type:"role",role:"quantity"}]}]},extraction:{patient:{position:1},quantity:{marker:"th\u00eam",markerAlternatives:["l\u00ean"],default:{type:"literal",value:1}}}},{id:"increment-vi-simple",language:"vi",command:"increment",priority:90,template:{format:"t\u0103ng {target}",tokens:[{type:"literal",value:"t\u0103ng",alternatives:["t\u0103ng l\u00ean"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},quantity:{default:{type:"literal",value:1}}}}];case"zh":return[{id:"increment-zh-full",language:"zh",command:"increment",priority:100,template:{format:"\u589e\u52a0 {patient}",tokens:[{type:"literal",value:"\u589e\u52a0",alternatives:["\u9012\u589e","\u52a0","\u589e","increment"]},{type:"role",role:"patient",expectedTypes:["selector","reference","expression"]}]},extraction:{patient:{position:1}}}];default:return[]}},function(e){switch(e){case"bn":return[{id:"decrement-bn-full",language:"bn",command:"decrement",priority:100,template:{format:"{patient} \u0995\u09c7 \u09b9\u09cd\u09b0\u09be\u09b8 \u0995\u09b0\u09c1\u09a8",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0995\u09c7"},{type:"literal",value:"\u09b9\u09cd\u09b0\u09be\u09b8",alternatives:["\u0995\u09ae\u09be\u09a8"]},{type:"literal",value:"\u0995\u09b0\u09c1\u09a8"}]},extraction:{patient:{position:0}}},{id:"decrement-bn-with-quantity",language:"bn",command:"decrement",priority:95,template:{format:"{patient} \u0995\u09c7 {quantity} \u09a6\u09bf\u09af\u09bc\u09c7 \u09b9\u09cd\u09b0\u09be\u09b8 \u0995\u09b0\u09c1\u09a8",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0995\u09c7"},{type:"role",role:"quantity"},{type:"literal",value:"\u09a6\u09bf\u09af\u09bc\u09c7"},{type:"literal",value:"\u09b9\u09cd\u09b0\u09be\u09b8",alternatives:["\u0995\u09ae\u09be\u09a8"]},{type:"literal",value:"\u0995\u09b0\u09c1\u09a8"}]},extraction:{patient:{position:0},quantity:{marker:"\u09a6\u09bf\u09af\u09bc\u09c7",position:2}}},{id:"decrement-bn-simple",language:"bn",command:"decrement",priority:90,template:{format:"\u09b9\u09cd\u09b0\u09be\u09b8 {patient}",tokens:[{type:"literal",value:"\u09b9\u09cd\u09b0\u09be\u09b8",alternatives:["\u0995\u09ae\u09be\u09a8"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"de":return[{id:"decrement-de-full",language:"de",command:"decrement",priority:100,template:{format:"verringere {patient}",tokens:[{type:"literal",value:"verringere",alternatives:["verringern","dekrementiere","dekrementieren","reduziere","decrement"]},{type:"role",role:"patient",expectedTypes:["selector","reference","expression"]}]},extraction:{patient:{position:1}}}];case"hi":return[{id:"decrement-hi-full",language:"hi",command:"decrement",priority:100,template:{format:"{patient} \u0915\u094b \u0918\u091f\u093e\u090f\u0902",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0915\u094b"},{type:"literal",value:"\u0918\u091f\u093e\u090f\u0902",alternatives:["\u0918\u091f\u093e"]}]},extraction:{patient:{position:0}}},{id:"decrement-hi-with-quantity",language:"hi",command:"decrement",priority:95,template:{format:"{patient} \u0915\u094b {quantity} \u0938\u0947 \u0918\u091f\u093e\u090f\u0902",tokens:[{type:"role",role:"patient"},{type:"literal",value:"\u0915\u094b"},{type:"role",role:"quantity"},{type:"literal",value:"\u0938\u0947"},{type:"literal",value:"\u0918\u091f\u093e\u090f\u0902",alternatives:["\u0918\u091f\u093e"]}]},extraction:{patient:{position:0},quantity:{marker:"\u0938\u0947",position:2}}},{id:"decrement-hi-simple",language:"hi",command:"decrement",priority:90,template:{format:"\u0918\u091f\u093e\u090f\u0902 {patient}",tokens:[{type:"literal",value:"\u0918\u091f\u093e\u090f\u0902",alternatives:["\u0918\u091f\u093e"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}}];case"it":return[{id:"decrement-it-full",language:"it",command:"decrement",priority:100,template:{format:"decrementare {patient} di {quantity}",tokens:[{type:"literal",value:"decrementare",alternatives:["decrementa","diminuire","decrement"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"di",alternatives:["per"]},{type:"role",role:"quantity"}]}]},extraction:{patient:{position:1},quantity:{marker:"di",markerAlternatives:["per"],default:{type:"literal",value:"1"}}}},{id:"decrement-it-simple",language:"it",command:"decrement",priority:90,template:{format:"decrementare {patient}",tokens:[{type:"literal",value:"decrementare",alternatives:["decrementa","diminuire","decrement"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},quantity:{default:{type:"literal",value:"1"}}}}];case"pl":return[{id:"decrement-pl-full",language:"pl",command:"decrement",priority:100,template:{format:"zmniejsz {patient} o {quantity}",tokens:[{type:"literal",value:"zmniejsz",alternatives:["obni\u017c","obniz"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"o"},{type:"role",role:"quantity"}]}]},extraction:{patient:{position:1},quantity:{marker:"o",default:{type:"literal",value:1}}}},{id:"decrement-pl-simple",language:"pl",command:"decrement",priority:90,template:{format:"zmniejsz {patient}",tokens:[{type:"literal",value:"zmniejsz",alternatives:["obni\u017c","obniz"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},quantity:{default:{type:"literal",value:1}}}}];case"ru":return[{id:"decrement-ru-full",language:"ru",command:"decrement",priority:100,template:{format:"\u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c {patient} \u043d\u0430 {quantity}",tokens:[{type:"literal",value:"\u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c",alternatives:["\u0443\u043c\u0435\u043d\u044c\u0448\u0438"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u043d\u0430"},{type:"role",role:"quantity"}]}]},extraction:{patient:{position:1},quantity:{marker:"\u043d\u0430",default:{type:"literal",value:1}}}},{id:"decrement-ru-simple",language:"ru",command:"decrement",priority:90,template:{format:"\u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c {patient}",tokens:[{type:"literal",value:"\u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c",alternatives:["\u0443\u043c\u0435\u043d\u044c\u0448\u0438"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},quantity:{default:{type:"literal",value:1}}}}];case"th":return[{id:"decrement-th-simple",language:"th",command:"decrement",priority:100,template:{format:"\u0e25\u0e14\u0e04\u0e48\u0e32 {patient}",tokens:[{type:"literal",value:"\u0e25\u0e14\u0e04\u0e48\u0e32"},{type:"role",role:"patient"}]},extraction:{patient:{position:1}}},{id:"decrement-th-with-quantity",language:"th",command:"decrement",priority:95,template:{format:"\u0e25\u0e14\u0e04\u0e48\u0e32 {patient} \u0e14\u0e49\u0e27\u0e22 {quantity}",tokens:[{type:"literal",value:"\u0e25\u0e14\u0e04\u0e48\u0e32"},{type:"role",role:"patient"},{type:"literal",value:"\u0e14\u0e49\u0e27\u0e22"},{type:"role",role:"quantity"}]},extraction:{patient:{position:1},quantity:{marker:"\u0e14\u0e49\u0e27\u0e22",position:3}}}];case"uk":return[{id:"decrement-uk-full",language:"uk",command:"decrement",priority:100,template:{format:"\u0437\u043c\u0435\u043d\u0448\u0438\u0442\u0438 {patient} \u043d\u0430 {quantity}",tokens:[{type:"literal",value:"\u0437\u043c\u0435\u043d\u0448\u0438\u0442\u0438",alternatives:["\u0437\u043c\u0435\u043d\u0448"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u043d\u0430"},{type:"role",role:"quantity"}]}]},extraction:{patient:{position:1},quantity:{marker:"\u043d\u0430",default:{type:"literal",value:1}}}},{id:"decrement-uk-simple",language:"uk",command:"decrement",priority:90,template:{format:"\u0437\u043c\u0435\u043d\u0448\u0438\u0442\u0438 {patient}",tokens:[{type:"literal",value:"\u0437\u043c\u0435\u043d\u0448\u0438\u0442\u0438",alternatives:["\u0437\u043c\u0435\u043d\u0448"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},quantity:{default:{type:"literal",value:1}}}}];case"vi":return[{id:"decrement-vi-full",language:"vi",command:"decrement",priority:100,template:{format:"gi\u1ea3m {target} \u0111i {amount}",tokens:[{type:"literal",value:"gi\u1ea3m",alternatives:["gi\u1ea3m \u0111i"]},{type:"role",role:"patient"},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u0111i",alternatives:["xu\u1ed1ng"]},{type:"role",role:"quantity"}]}]},extraction:{patient:{position:1},quantity:{marker:"\u0111i",markerAlternatives:["xu\u1ed1ng"],default:{type:"literal",value:"1"}}}},{id:"decrement-vi-simple",language:"vi",command:"decrement",priority:90,template:{format:"gi\u1ea3m {target}",tokens:[{type:"literal",value:"gi\u1ea3m",alternatives:["gi\u1ea3m \u0111i"]},{type:"role",role:"patient"}]},extraction:{patient:{position:1},quantity:{default:{type:"literal",value:"1"}}}}];case"zh":return[{id:"decrement-zh-full",language:"zh",command:"decrement",priority:100,template:{format:"\u51cf\u5c11 {patient}",tokens:[{type:"literal",value:"\u51cf\u5c11",alternatives:["\u9012\u51cf","\u51cf","\u964d\u4f4e","decrement"]},{type:"role",role:"patient",expectedTypes:["selector","reference","expression"]}]},extraction:{patient:{position:1}}}];default:return[]}},PE,function(e){switch(e){case"zh":return[{id:"fetch-zh-ba",language:"zh",command:"fetch",priority:105,template:{format:"\u6293\u53d6 \u628a {source} \u7684 {responseType}",tokens:[{type:"literal",value:"\u6293\u53d6",alternatives:["\u53d6"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u628a",alternatives:["\u4ece","\u7531"]}]},{type:"role",role:"source",expectedTypes:["literal","expression"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u7684",alternatives:["\u4f5c\u4e3a","\u5f53\u4f5c"]},{type:"role",role:"responseType",expectedTypes:["literal","expression"]}]}]},extraction:{source:{marker:"\u628a",markerAlternatives:["\u4ece","\u7531"]},responseType:{marker:"\u7684",markerAlternatives:["\u4f5c\u4e3a","\u5f53\u4f5c"]}}}];case"ms":return[{id:"fetch-ms",language:"ms",command:"fetch",priority:105,template:{format:"ambil_dari dari {source} sebagai {responseType}",tokens:[{type:"literal",value:"ambil_dari",alternatives:["muat","ambil"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"dari"}]},{type:"role",role:"source",expectedTypes:["literal","expression"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"sebagai",alternatives:["sbg"]},{type:"role",role:"responseType",expectedTypes:["literal","expression"]}]}]},extraction:{source:{marker:"dari"},responseType:{marker:"sebagai",markerAlternatives:["sbg"]}}}];case"fr":return[{id:"fetch-fr",language:"fr",command:"fetch",priority:105,template:{format:"chercher de {source} comme {responseType}",tokens:[{type:"literal",value:"chercher",alternatives:["r\u00e9cup\u00e9rer"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"de"}]},{type:"role",role:"source",expectedTypes:["literal","expression"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"comme"},{type:"role",role:"responseType",expectedTypes:["literal","expression"]}]}]},extraction:{source:{marker:"de"},responseType:{marker:"comme"}}}];case"pt":return[{id:"fetch-pt",language:"pt",command:"fetch",priority:105,template:{format:"buscar de {source} como {responseType}",tokens:[{type:"literal",value:"buscar"},{type:"group",optional:!0,tokens:[{type:"literal",value:"de"}]},{type:"role",role:"source",expectedTypes:["literal","expression"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"como"},{type:"role",role:"responseType",expectedTypes:["literal","expression"]}]}]},extraction:{source:{marker:"de"},responseType:{marker:"como"}}}];case"es":return[BC("fetch-es","es","buscar","de","como")];case"pl":return[BC("fetch-pl","pl","pobierz","z","jako")];case"id":return[BC("fetch-id","id","muat","dari","sebagai",["ambil"])];case"sw":return[BC("fetch-sw","sw","leta","kutoka","kuwa",void 0,void 0,["kama"])];case"he":return[BC("fetch-he","he","\u05d4\u05d1\u05d0","\u05de","\u05db",["\u05d8\u05e2\u05df"],["\u05d0\u05ea"])];case"de":return[BC("fetch-de","de","abrufen","von","als",["laden"])];case"ru":return[BC("fetch-ru","ru","\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c","\u0438\u0437","\u043a\u0430\u043a",["\u0437\u0430\u0433\u0440\u0443\u0437\u0438"])];case"uk":return[BC("fetch-uk","uk","\u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438","\u0437","\u044f\u043a",["\u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436"])];case"it":return[BC("fetch-it","it","recuperare","da","come")];case"vi":return[BC("fetch-vi","vi","t\u1ea3i","t\u1eeb","nh\u01b0")];case"th":return[BC("fetch-th","th","\u0e14\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25","\u0e08\u0e32\u0e01","\u0e40\u0e1b\u0e47\u0e19")];case"ar":return[BC("fetch-ar","ar","\u0627\u062d\u0636\u0631","\u0645\u0646","\u0643\u0640",["\u062c\u0644\u0628"])];case"tl":return[BC("fetch-tl","tl","kuhanin_mula","mula_sa","bilang",["kunin_mula"])];case"ja":return[HC("fetch-ja-sov","ja","\u30d5\u30a7\u30c3\u30c1","\u3092",["\u53d6\u5f97"])];case"ko":return[HC("fetch-ko-sov","ko","\ud328\uce58","\uc744",["\uac00\uc838\uc624\uae30"],["\ub97c"])];case"tr":return[HC("fetch-tr-sov","tr","getir","i",void 0,["\u0131","u","\u00fc","yi","y\u0131","yu","y\u00fc"])];case"hi":return[HC("fetch-hi-sov","hi","\u0932\u093e\u090f\u0902","\u0915\u094b")];case"qu":return[HC("fetch-qu-sov","qu","apamuy","ta",["taripakaramuy"])];case"bn":return[HC("fetch-bn-sov","bn","\u0986\u09a8\u09c1\u09a8","\u0995\u09c7")];default:return[]}},CE,function(e){return"en"===e?[{id:"append-en-full",language:"en",command:"append",priority:100,template:{format:"append {patient} to {destination}",tokens:[{type:"literal",value:"append"},{type:"role",role:"patient",expectedTypes:["literal","selector","expression"]},{type:"literal",value:"to"},{type:"role",role:"destination",expectedTypes:["selector","reference"]}]},extraction:{patient:{position:1},destination:{marker:"to"}}}]:[]},function(e){return"en"===e?[{id:"prepend-en-full",language:"en",command:"prepend",priority:100,template:{format:"prepend {patient} to {destination}",tokens:[{type:"literal",value:"prepend"},{type:"role",role:"patient",expectedTypes:["literal","selector","expression"]},{type:"literal",value:"to"},{type:"role",role:"destination",expectedTypes:["selector","reference"]}]},extraction:{patient:{position:1},destination:{marker:"to"}}}]:[]},function(e){switch(e){case"en":return[{id:"trigger-en-full",language:"en",command:"trigger",priority:100,template:{format:"trigger {event} on {destination}",tokens:[{type:"literal",value:"trigger"},{type:"role",role:"event",expectedTypes:["literal","expression"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"on"},{type:"role",role:"destination",expectedTypes:["selector","reference"]}]}]},extraction:{event:{position:1},destination:{marker:"on",default:{type:"reference",value:"me"}}}},{id:"trigger-en-simple",language:"en",command:"trigger",priority:90,template:{format:"trigger {event}",tokens:[{type:"literal",value:"trigger"},{type:"role",role:"event",expectedTypes:["literal","expression"]}]},extraction:{event:{position:1},destination:{default:{type:"reference",value:"me"}}}}];case"zh":return[{id:"trigger-zh-ba",language:"zh",command:"trigger",priority:105,template:{format:"\u89e6\u53d1 \u628a {event}",tokens:[{type:"literal",value:"\u89e6\u53d1",alternatives:["\u89f8\u767c"]},{type:"literal",value:"\u628a"},{type:"role",role:"event",expectedTypes:["literal","expression"]}]},extraction:{event:{position:2},destination:{default:{type:"reference",value:"me"}}}}];case"he":return[{id:"trigger-he-et",language:"he",command:"trigger",priority:105,template:{format:"\u05d4\u05e4\u05e2\u05dc \u05d0\u05ea {event} \u05e2\u05dc {destination}",tokens:[{type:"literal",value:"\u05d4\u05e4\u05e2\u05dc",alternatives:["\u05e9\u05d2\u05e8"]},{type:"literal",value:"\u05d0\u05ea"},{type:"role",role:"event",expectedTypes:["literal","expression"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u05e2\u05dc",alternatives:["\u05dc","\u05d0\u05dc"]},{type:"role",role:"destination",expectedTypes:["selector","reference","expression"]}]}]},extraction:{event:{position:2},destination:{marker:"\u05e2\u05dc",markerAlternatives:["\u05dc","\u05d0\u05dc"],default:{type:"reference",value:"me"}}}}];case"qu":return[{id:"trigger-qu-event-first-verb-final",language:"qu",command:"trigger",priority:105,template:{format:"{event} ta [{destination} man] trigger",tokens:[{type:"role",role:"event",expectedTypes:["literal","expression"]},{type:"literal",value:"ta"},{type:"group",optional:!0,tokens:[{type:"role",role:"destination",expectedTypes:["selector","reference","expression"]},{type:"literal",value:"man"}]},{type:"literal",value:"trigger"}]},extraction:{destination:{default:{type:"reference",value:"me"}}}}];default:return[]}},function(e){switch(e){case"zh":return[{id:"send-zh-ba",language:"zh",command:"send",priority:105,template:{format:"\u53d1\u9001 \u628a {event} \u5230 {destination}",tokens:[{type:"literal",value:"\u53d1\u9001",alternatives:["\u767c\u9001","\u4f20\u9001","\u50b3\u9001"]},{type:"literal",value:"\u628a"},{type:"role",role:"event",expectedTypes:["literal","expression"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u5230",alternatives:["\u7ed9","\u7d66","\u5411"]},{type:"role",role:"destination",expectedTypes:["selector","reference","expression"]}]}]},extraction:{event:{position:2},destination:{marker:"\u5230",markerAlternatives:["\u7ed9","\u7d66","\u5411"],default:{type:"reference",value:"me"}}}}];case"he":return[{id:"send-he-et",language:"he",command:"send",priority:105,template:{format:"\u05e9\u05dc\u05d7 \u05d0\u05ea {event} \u05e2\u05dc {destination}",tokens:[{type:"literal",value:"\u05e9\u05dc\u05d7"},{type:"literal",value:"\u05d0\u05ea"},{type:"role",role:"event",expectedTypes:["literal","expression"]},{type:"group",optional:!0,tokens:[{type:"literal",value:"\u05e2\u05dc",alternatives:["\u05dc","\u05d0\u05dc"]},{type:"role",role:"destination",expectedTypes:["selector","reference","expression"]}]}]},extraction:{event:{position:2},destination:{marker:"\u05e2\u05dc",markerAlternatives:["\u05dc","\u05d0\u05dc"],default:{type:"reference",value:"me"}}}}];default:return[]}},function(e){const t=GC[e];if(t)return[UC(e,t)];const r=YC[e];return r?[ZC(e,r)]:[]},function(e){return"qu"===e?[{id:"go-qu-url-dest",language:"qu",command:"go",priority:105,template:{format:"url {destination} man riy",tokens:[{type:"literal",value:"url"},{type:"role",role:"destination",expectedTypes:["literal","expression"]},{type:"literal",value:"man",alternatives:["pa"]},{type:"literal",value:"riy",alternatives:["puriy"]}]},extraction:{destination:{position:1,transform:e=>({type:"expression",raw:"url "+e})}}}]:[]}],nA=new Map;function iA(e){const t=rA.flatMap(t=>t(e));return"en"===e&&t.push(...tA),t.push(...function(e){const t=nA.get(e);if(t)return t;const r=Af(e);if(!r)return[];const n=Gx(r);return nA.set(e,n),n}(e)),t}var aA=["en","ja","ar","es","ko","zh","tr","pt","fr","de","id","qu","sw","it","vi","pl","ru","uk","hi","bn","th","ms","tl","he"];var oA=new Map,sA=null;function lA(){if(null===sA){const e=[];for(const t of aA)e.push(...iA(t));sA=e}return sA}function cA(e){if(oA.has(e))return oA.get(e);const t=iA(e);return oA.set(e,t),t}gE(),uy(),Ax(),Ax(),Rf(),gf=function(e){return iA(e.code)},jg(),Ng(),yy(),Rf(),Wf(),$f(),Jh(),Ff(),Jf(),Bf(),th(),ih(),sh(),uh(),mh(),yh(),kh(),zh(),Th(),Ah(),Ph(),Zf(),Rh(),Wh(),$h(),Bh(),Fh(),Zh(),wf(),rE(),sf(),wf();var uA=new Map(Object.entries(of));function pA(e){return uA.get(e)}function dA(e){return"literal"===e.type&&"string"==typeof e.value||"selector"===e.type||"reference"===e.type?e.value:void 0}function mA(e,t){if(null==e)return!1;for(const r of t)switch(r){case"selector":if("selector"===e.type)return!0;const t=dA(e);if(t&&(t.startsWith(".")||t.startsWith("#")||t.startsWith("[")))return!0;break;case"literal":if("literal"===e.type)return!0;if("property-path"===e.type)return!0;break;case"reference":if("reference"===e.type)return!0;if("property-path"===e.type)return!0;const r=dA(e);if(r&&["me","you","it","my","its","result","event","target"].includes(r.toLowerCase()))return!0;break;case"expression":if("expression"===e.type)return!0;if("property-path"===e.type)return!0}return!1}function fA(e){const t=[],r=[],n=[];let i=0;const a=pA(e.action);if(!a)return r.push({code:"UNKNOWN_ROLE",message:`No schema found for action '${e.action}'. Skipping validation.`,severity:"warning"}),{valid:!0,errors:t,warnings:r,confidenceAdjustment:-.1,suggestions:n};const o=new Map;for(const t of e.arguments)t.role&&o.set(t.role,t);for(const e of a.roles){const a=o.get(e.role);!e.required||a?a&&!mA(a,e.expectedTypes)&&(r.push({code:"INVALID_TYPE",message:`Role '${e.role}' expected ${e.expectedTypes.join(" or ")}, got ${a.type}.`,role:e.role,expected:e.expectedTypes,actual:a,severity:"warning"}),i-=.1):e.default?r.push({code:"MISSING_REQUIRED_ROLE",message:`Role '${e.role}' not provided, using default.`,role:e.role,severity:"warning"}):(t.push({code:"MISSING_REQUIRED_ROLE",message:`Required role '${e.role}' (${e.description}) is missing.`,role:e.role,expected:e.expectedTypes,severity:"error"}),n.push(`Add ${e.description.toLowerCase()} to the command.`),i-=.2)}for(const t of e.arguments)if(t.role){a.roles.some(e=>e.role===t.role)||(r.push({code:"UNKNOWN_ROLE",message:`Role '${t.role}' is not recognized for command '${e.action}'.`,role:t.role,severity:"warning"}),i-=.05)}return a.roles.filter(e=>e.required&&!e.default).every(e=>o.has(e.role))&&0===t.length&&(i+=.1),{valid:0===t.length,errors:t,warnings:r,confidenceAdjustment:Math.max(-1,Math.min(1,i)),suggestions:n}}function hA(e){switch(e){case"preposition":return"preposition";case"postposition":case"particle":case"case-suffix":return"postposition";default:return"none"}}function yA(e,t,r){const n={form:t.primary,role:e,position:hA(r),required:t.required??!1};return t.alternatives&&(n.alternatives=t.alternatives),n}var vA={accessibility:!0,performance:!0,schema:!0,strict:!1},gA=new Set(["scroll","mousemove","touchmove","resize","input","keydown","keyup","keypress"]),kA=new Set(["scroll","mousemove","touchmove","resize"]);function wA(e,t){const r=[];if("event-handler"===e.kind){const n=e.roles.get("event");if(n&&"literal"===n.type){const e=(n.value+"").toLowerCase();"mouseenter"!==e&&"mouseover"!==e&&"hover"!==e||r.push({code:"HOVER_ONLY_INTERACTION",severity:"warning",message:`Hover-only interaction detected (${e}). Not accessible to keyboard or touch users.`,suggestion:"Add keyboard equivalent (focus) or use a click-based interaction.",location:{input:t,role:"event"}})}}return r}function bA(e,t){const r=[];if("event-handler"===e.kind){const n=e.roles.get("event");if(n&&"literal"===n.type){const e=(n.value+"").toLowerCase();if(gA.has(e)){const n=kA.has(e)?"warning":"info";r.push({code:"HIGH_FREQUENCY_TRIGGER",severity:n,message:`High-frequency event '${e}' may cause performance issues.`,suggestion:kA.has(e)?`Consider using 'on ${e} throttled:100ms' to limit execution frequency.`:"Consider debouncing or throttling this handler.",location:{input:t,role:"event"}})}}}return r}function zA(e,t){const r=[];if("command"!==e.kind)return r;const n=pA(e.action);if(!n)return r;const i=Array.isArray(n.roles)?n.roles:[],a=new Set;for(const n of i)n&&"object"==typeof n&&"role"in n&&(a.add(n.role),n.required&&!e.roles.has(n.role)&&r.push({code:"MISSING_REQUIRED_ROLE",severity:"error",message:`Command '${e.action}' requires '${n.role}' but it was not provided.`,suggestion:n.description,location:{input:t}}));return e.roles.forEach((n,i)=>{a.has(i)||r.push({code:"INVALID_ROLE_FOR_COMMAND",severity:"warning",message:`Role '${i}' is not typically used with '${e.action}' command.`,location:{input:t,role:i}})}),r}function xA(e){if("event-handler"===e.kind){return e.body??[]}return[]}function EA(e,t={}){const r=[],n=new Map;for(const t of e)if("event-handler"===t.kind){const e=t.roles.get("event"),r=t.roles.get("source"),i=`${"literal"===e?.type?e.value:"unknown"}:${"selector"===r?.type?r.value:"self"}`;n.has(i)||n.set(i,[]);const a=xA(t);n.get(i).push({handler:t,commands:a})}return n.forEach((e,t)=>{if(e.length>1){const n=[],i=[];for(const{commands:t}of e)for(const e of t){n.push(e.action);const t=e.roles.get("patient");i.push("selector"===t?.type?t.value:"unknown")}const a=n.includes("toggle"),o=n.includes("show"),s=n.includes("hide");if(a&&(o||s)){i.filter((e,t)=>("toggle"===n[t]||"show"===n[t]||"hide"===n[t])&&i.some((r,n)=>t!==n&&e===r)).length>0&&r.push({code:"CONFLICTING_ACTIONS",severity:"warning",message:`Conflicting actions on '${t}': ${[...new Set(n)].join(", ")} may interfere with each other.`,suggestion:"Consider using a single toggle or conditional logic."})}n.some(e=>["fetch","wait","send"].includes(e))&&e.length>1&&r.push({code:"POTENTIAL_RACE_CONDITION",severity:"info",message:`Multiple handlers on '${t}' include async operations. Consider sequencing.`,suggestion:'Use "then" to chain operations or add loading states.'})}}),r}function TA(e,t="en",r={}){const n={...vA,...r},i=[];let a=null;try{a=jC(e,t)}catch{}if(!a)return{valid:!1,warnings:[{code:"UNREACHABLE_BEHAVIOR",severity:"error",message:"Could not parse input to semantic representation.",location:{input:e}}],node:null};n.accessibility&&i.push(...wA(a,e)),n.performance&&i.push(...bA(a,e)),n.schema&&i.push(...zA(a,e));const o=i.some(e=>"error"===e.severity),s=i.some(e=>"warning"===e.severity);return{valid:n.strict?!o&&!s:!o,warnings:i,node:a}}var SA=!1,CA={};function AA(e){const t={};return"number"==typeof e.start&&(t.start=e.start),"number"==typeof e.end&&(t.end=e.end),"number"==typeof e.line&&(t.line=e.line),"number"==typeof e.column&&(t.column=e.column),t}function LA(e){if(!e)return{type:"literal",value:null};switch(e.type){case"eventHandler":return function(e){const t=e.event??"click",r=e.commands??e.body??[],n=r.map(e=>LA(e)),i=function(e){const t=e.eventModifiers;return{...e.once||t?.once?{once:!0}:{},...e.debounce||t?.debounce?{debounce:e.debounce??t?.debounce}:{},...e.throttle||t?.throttle?{throttle:e.throttle??t?.throttle}:{},...e.prevent||t?.prevent?{prevent:!0}:{},...e.stop||t?.stop?{stop:!0}:{},...e.capture||t?.capture?{capture:!0}:{},...e.passive||t?.passive?{passive:!0}:{},...e.from||t?.from?{from:e.from??t?.from}:e.selector?{from:e.selector}:{}}}(e);return{type:"event",event:t,modifiers:i,body:n,...AA(e)}}(e);case"command":return function(e){const t=e.name;if("if"===t||"unless"===t)return function(e){const t=e.args??[];let r=t[0]?LA(t[0]):{type:"literal",value:!0};const n=jA(t[1]),i=t[2]?jA(t[2]):void 0;"unless"===e.name&&(r={type:"unary",operator:"not",operand:r});return{type:"if",condition:r,thenBranch:n,...i?{elseBranch:i}:{},...AA(e)}}(e);if("repeat"===t)return function(e){const t=e.args??[];if(0===t.length)return{type:"repeat",body:[],...AA(e)};const r=t[0],n=t[t.length-1];switch(r?.name??r?.value??"forever"){case"times":return{type:"repeat",count:t[1]?LA(t[1]):void 0,body:jA(n),...AA(e)};case"for":return{type:"foreach",itemName:t[1]?.value??"item",collection:t[2]?LA(t[2]):{type:"identifier",value:"[]"},body:jA(n),...AA(e)};case"while":return{type:"while",condition:t[1]?LA(t[1]):{type:"literal",value:!0},body:jA(n),...AA(e)};case"until":return{type:"while",condition:{type:"unary",operator:"not",operand:t[1]?LA(t[1]):{type:"literal",value:!1}},body:jA(n),...AA(e)};default:return{type:"repeat",body:jA(n),...AA(e)}}}(e);const r=(e.args??[]).map(e=>LA(e)),n=e.target?LA(e.target):void 0,i=e.modifiers?function(e){const t={};for(const[r,n]of Object.entries(e))t[r]=LA(n);return t}(e.modifiers):void 0,a=e.semanticRoles,o=a?function(e){const t={};for(const[r,n]of Object.entries(e))t[r]=LA(n);return t}(a):void 0;return{type:"command",name:t,args:r,...n?{target:n}:{},...i&&Object.keys(i).length>0?{modifiers:i}:{},...o&&Object.keys(o).length>0?{roles:o}:{},...AA(e)}}(e);case"CommandSequence":return function(e){const t=e.commands??[];return 1===t.length?LA(t[0]):{type:"event",event:"click",body:t.map(e=>LA(e)),...AA(e)}}(e);case"block":return function(e){const t=e.commands??[];return 1===t.length?LA(t[0]):{type:"event",event:"click",body:t.map(e=>LA(e)),...AA(e)}}(e);case"if":return function(e){const t=e.condition?LA(e.condition):{type:"literal",value:!0},r=(e.thenBranch??[]).map(e=>LA(e)),n=e.elseBranch?e.elseBranch.map(e=>LA(e)):void 0;return{type:"if",condition:t,thenBranch:r,...n?{elseBranch:n}:{},...AA(e)}}(e);case"literal":case"string":case"timeExpression":return{type:"literal",value:e.value,...AA(e)};case"selector":case"htmlSelector":return{type:"selector",value:e.value??e.selector??"",...AA(e)};case"contextReference":return{type:"identifier",value:e.name??e.contextType??"",...AA(e)};case"identifier":return{type:"identifier",value:e.name??e.value??"",name:e.name??"",...AA(e)};case"propertyAccess":return function(e){const t=e.object?LA(e.object):{type:"identifier",value:"me"};return{type:"possessive",object:t,property:e.property??"",...AA(e)}}(e);case"possessiveExpression":return function(e){const t=e.object?LA(e.object):{type:"identifier",value:"me"},r="string"==typeof e.property?e.property:e.property?.name??e.property?.value??"";return{type:"possessive",object:t,property:r,...AA(e)}}(e);case"memberExpression":return function(e){const t=e.object?LA(e.object):{type:"identifier",value:"me"},r="string"==typeof e.property?e.property:e.property?LA(e.property):{type:"literal",value:""};return{type:"member",object:t,property:r,computed:e.computed??!1,...AA(e)}}(e);case"binaryExpression":return function(e){return{type:"binary",operator:e.operator??"",left:LA(e.left),right:LA(e.right),...AA(e)}}(e);case"callExpression":return function(e){const t="string"==typeof e.callee?{type:"identifier",value:e.callee,name:e.callee}:LA(e.callee),r=(e.arguments??e.args??[]).map(e=>LA(e));return{type:"call",callee:t,args:r,...AA(e)}}(e);case"unaryExpression":return{type:"unary",operator:e.operator,operand:LA(e.operand),...AA(e)};case"templateLiteral":return{type:"literal",value:e.raw??"",...AA(e)};case"variable":return{type:"variable",name:e.name??"",scope:e.scope??"local",...AA(e)};case"positional":return{type:"positional",position:e.position,...e.target?{target:LA(e.target)}:{},...AA(e)};case"positionalExpression":return{type:"positional",position:e.operator,...e.argument?{target:LA(e.argument)}:{},...AA(e)};default:return{type:"literal",value:e.value??null,...AA(e)}}}function jA(e){return e?"block"===e.type?(e.commands??[]).map(e=>LA(e)):[LA(e)]:[]}function PA(e,t){return OC(e,t)}var OA=Object.freeze({__proto__:null,ASTBuilder:TT,get CssSelectorExtractor(){return hy},DEFAULT_CONFIDENCE_THRESHOLD:FE,get EventModifierExtractor(){return ky},HIGH_CONFIDENCE_THRESHOLD:.8,IdentifierExtractor:Ru,KNOWN_PROFILES:CT,LAZY_LOAD_LANGUAGES:$C,NumberExtractor:Nu,get OperatorExtractor(){return ly},PatternMatcher:ES,get PunctuationExtractor(){return cy},SUPPORTED_LANGUAGES:$C,get SchemaErrorCodes(){return bd},SemanticCache:WC,SemanticParserImpl:AC,SemanticRendererImpl:lC,StringLiteralExtractor:Ou,TokenStreamImpl:qp,get UrlExtractor(){return by},VERSION:"0.1.0",get VariableRefExtractor(){return Ty},get addSchema(){return Bd},analyze:TA,analyzeAll:function(e,t="en",r={}){const n=[],i=[];for(const a of e){const e=TA(a,t,r);n.push(...e.warnings),e.node&&i.push(e.node)}n.push(...EA(i,r));const a=n.some(e=>"error"===e.severity),o={...vA,...r},s=n.some(e=>"warning"===e.severity);return{valid:o.strict?!a&&!s:!a,warnings:n,node:i[0]??null}},analyzeMultiple:EA,get appendSchema(){return sm},get arabicProfile(){return Nf},get arabicTokenizer(){return zk},get bengaliProfile(){return If},buildAST:ST,buildFromAstShape:zT,calculateTranslationConfidence:PC,canLoadLanguage:function(e){return e in qC},canParse:function(e,t){return LC.canParse(e,t)},checkAccessibility:wA,checkPerformance:bA,checkSchema:zA,get chineseProfile(){return Gh},get chineseTokenizer(){return sw},get commandSchemas(){return of},convertExpression:lT,convertLiteral:iT,convertPropertyPath:sT,convertReference:oT,convertSelector:aT,convertValue:nT,createCommandNode:NT,createCompoundNode:IT,createConditionalNode:WT,createEventHandler:RT,createLiteral:LT,createLoopNode:function(e,t,r,n,i){const a={kind:"loop",action:e,loopVariant:t,roles:new Map(Object.entries(r)),body:n};return i?.loopVariable&&(a.loopVariable=i.loopVariable),i?.indexVariable&&(a.indexVariable=i.indexVariable),i?.metadata&&(a.metadata=i.metadata),a},createPropertyPath:OT,createReference:PT,createSelector:AT,createSemanticCache:function(e){return new WC(e)},createTokenizerContext:Vu,get decrementSchema(){return om},devModeAnalyze:function(e,t,r){if(!SA)return;if(!r)return void console.warn("[hyperfixi] Parse failed: "+e);const n=TA(e,t,CA);for(const e of n.warnings){console["error"===e.severity?"error":"warning"===e.severity?"warn":"info"](`${"error"===e.severity?"\u274c":"warning"===e.severity?"\u26a0\ufe0f":"\u2139\ufe0f"} [hyperfixi:${e.code}] ${e.message}`,e.suggestion?"\n \ud83d\udca1 "+e.suggestion:"",e.location?.input?"\n \ud83d\udccd "+e.location.input:"")}},disableDevMode:function(){SA=!1},enableDevMode:function(e={}){SA=!0,CA=e},get englishProfile(){return Df},get englishTokenizer(){return Wg},get eventNameTranslations(){return bx},get fetchSchema(){return im},fillSchemaDefaults:function e(t){if(!t||"object"!=typeof t)return t;if(t.action&&t.roles instanceof Map){const e=mf(t.action);if(e){const r=t.roles;for(const t of e.roles)void 0===t.default||r.has(t.role)||r.set(t.role,{...t.default,implicit:!0})}}const r=t;for(const t of TC){const n=r[t];if(Array.isArray(n))for(const t of n)e(t)}return t},formatValidationResults:Wd,get frenchProfile(){return Gf},fromExplicit:NC,fromSemanticAST:LA,generateAllPatterns:function(e,t=Vx){const r=[],n=e??Bx();for(const e of n){const n=Gx(e,t);r.push(...n)}return r},generatePattern:Hx,generatePatternVariants:Ux,generatePatternsForCommand:function(e,t,r=Vx){const n=[],i=t??Bx();for(const t of i){if(!t.keywords[e.action])continue;const i=Ux(e,t,r);n.push(...i)}return n},generatePatternsForLanguage:Gx,generateSimplePattern:Kx,get germanProfile(){return qf},getAllTranslations:function(e,t,r=Lf()){return MC(e,t,r).translations},getAllTranslationsWithStatus:MC,getCommandMapper:function(e){return wT.get(e)},getCommandType:function(e,t){try{return LC.parse(e,t).action}catch{return null}},getDefaultExtractors:function(){return[new Ou,new Nu,new ly,new cy,new Ru]},getDefinedSchemas:ff,getDevModeConfig:function(){return{...CA}},getEventHandlerPatternsForLanguage:Cx,getEventLocalizationDenylist:function(){return xx},getGeneratorSummary:function(){const e=Lf(),t=ff().map(e=>e.action);let r=0;for(const t of e){const e=Af(t);if(e)for(const t of ff())e.keywords[t.action]&&(r+=2)}return{languages:e,commands:t,totalPatterns:r}},getHyperscriptExtractors:Pg,getKeywordTranslations:function(e,t){const r=t??Object.keys(CT),n={};for(const t of r){const r=CT[t]?.keywords[e];r&&(n[t]=r)}return n},getLoadedLanguages:function(){return $C.filter(jf)},getPatternById:function(e){return lA().find(t=>t.id===e)},getPatternStats:function(){const e={},t={},r=lA();for(const n of r)e[n.language]=(e[n.language]||0)+1,t[n.command]=(t[n.command]||0)+1;return{totalPatterns:r.length,byLanguage:e,byCommand:t}},getPatternsForLanguage:cA,getPatternsForLanguageAndCommand:function(e,t){return cA(e).filter(e=>e.command===t).sort((e,t)=>t.priority-e.priority)},getPutPatternsForLanguage:oy,getRegisteredLanguages:Lf,getRegisteredMappers:function(){return new Map(wT)},getRoleMarkers:function(e,t){const r=CT[e]?.roleMarkers??{};return t?r[t]:r},getSOVEventMarkers:function(){const e={};for(const[t,r]of Object.entries(AC.SOV_EVENT_MARKERS))e[t]=[...r];for(const[t,r]of Object.entries(AC.SOV_EVENT_MARKER_PHRASES))e[t]=[...e[t]??[],...r.map(e=>e.join(" "))];return e},getSchema:mf,getSchemaMapper:xT,getSchemasByCategory:function(e){return Object.values(of).filter(t=>t.category===e)},getSupportedCommands:function(){const e=new Set(lA().map(e=>e.command));return Array.from(e)},getSupportedLanguages:function(){return[...$C]},getSupportedPatternLanguages:function(){const e=new Set(lA().map(e=>e.language));return Array.from(e)},getSupportedTokenizerLanguages:CS,getTogglePatternsForLanguage:oE,getTokenizer:function(e){return function(e){let t=hf.get(e);return!t&&Cf(e)&&(t=hf.get(Sf(e))),t}(e)},getUnloadedLanguages:function(){return $C.filter(e=>!jf(e))},getValidationStats:_d,getValidatorSchema:pA,get hebrewProfile(){return Xf},get hideSchema(){return em},get hindiProfile(){return eh},get incrementSchema(){return am},get indonesianProfile(){return nh},isContextAwareExtractor:$u,isDevModeEnabled:function(){return SA},isExplicitSyntax:$c,isLanguageRegistered:jf,isLanguageSupported:function(e){return jf(e)},isUnifiedProfile:function(e){return!(!e||"object"!=typeof e)&&("string"==typeof e.code&&"string"==typeof e.name&&"string"==typeof e.wordOrder&&"string"==typeof e.markingStrategy&&"string"==typeof e.morphology&&"object"==typeof e.keywords&&Array.isArray(e.canonicalOrder))},get italianProfile(){return oh},get japaneseProfile(){return ch},get japaneseTokenizer(){return Xg},get koreanProfile(){return dh},get koreanTokenizer(){return lk},loadLanguage:VC,loadLanguages:async function(e,t={}){return Promise.all(e.map(e=>VC(e,t)))},localizeEventName:Tx,get malayProfile(){return hh},markingStrategyToAdpositionType:hA,matchBest:function(e,t){return TS.matchBest(e,t)},matchPattern:function(e,t){return TS.matchPattern(e,t)},normalizeEventName:function(e,t){const r=bx[t];return r&&r[e]?r[e]:e.toLowerCase()},get onSchema(){return tm},parse:jC,parseAny:RC,parseExplicit:mC,parseSemantic:PA,parseWithConfidence:OC,patternMatcher:TS,get polishProfile(){return gh},get portugueseProfile(){return bh},get prependSchema(){return lm},get putSchema(){return Kd},get quechuaProfile(){return Eh},registerCommandMapper:function(e){wT.set(e.action,e)},registerSchema:function(e,t){uA.set(e,t)},registerTokenizer:function(e){!function(e){hf.set(e.language,e)}(e)},get removeSchema(){return Hd},render:uC,renderExplicit:pC,resolveCommandMapper:ET,roundTrip:function(e,t,r){const n=RC(e,t),i=r??t,a=$c(e)?pC(n):uC(n,i);if(void 0!==r)return a;const o=e.trim().toLowerCase(),s=a.trim().toLowerCase();return{original:e,semantic:n,rendered:a,matches:o===s}},get russianProfile(){return Ch},schemaRegistry:uA,semanticCache:_C,semanticParser:LC,semanticRenderer:cC,get setSchema(){return Fd},get showSchema(){return Qd},get spanishProfile(){return Kf},get spanishTokenizer(){return $k},get swahiliProfile(){return jh},get tagalogProfile(){return Ih},get thaiProfile(){return Nh},toExplicit:function(e,t){return $c(e)?e:pC(jC(e,t))},toGrammaticalMarker:yA,toI18nProfile:function(e){const t=[];for(const[r,n]of Object.entries(e.roleMarkers))n&&t.push(yA(r,n,e.markingStrategy));return{code:e.code,name:e.nativeName,wordOrder:e.wordOrder,adpositionType:hA(e.markingStrategy),morphology:e.morphology,direction:e.direction,markers:t,canonicalOrder:e.canonicalOrder}},get toggleSchema(){return Dd},tokenize:SS,translate:function(e,t,r){return $c(e)?NC(e,r):uC(jC(e,t),r)},get triggerSchema(){return rm},tryGetProfile:Af,get turkishProfile(){return qh},get turkishTokenizer(){return tw},get ukrainianProfile(){return Dh},validateAllSchemas:Id,validateAndAdjustConfidence:function(e){const t=fA(e);return{...e,confidence:Math.max(0,Math.min(1,e.confidence+t.confidenceAdjustment)),validation:t}},validateCommandSchema:Md,validateLanguageKeywords:function(e,t=ff()){const r=[],n=[];for(const i of t)e.keywords[i.action]?n.push(i.action):r.push(i.action);return{missing:r,available:n}},validateSemanticResult:fA,validateTranslation:function(e,t,r,n){try{const i=RC(e,r),a=RC(t,n);if(i.action!==a.action)return!1;for(const[e,t]of i.roles){const r=a.roles.get(e);if(!r)return!1;if(!IC(t,r))return!1}return!0}catch{return!1}},get vietnameseProfile(){return Kh},get waitSchema(){return nm},withCache:function(e,t=_C){return(r,n)=>{const i=t.get(r,n);if(i)return i;const a=e(r,n);return t.set(r,n,a),a}}});let NA=null;function RA(){return NA||(NA=Bt({parse:PA,isRegistered:jf,registered:Lf,buildAST:ST})),NA}function MA(e){if(e&&"object"==typeof e.locals&&e.locals instanceof Map)return e;const t=e?.globals,r=t instanceof Map?t:xe(),n={me:e?.me||null,you:e?.you||null,it:e?.it||e?.result,result:e?.result,locals:new Map,globals:r,halted:!1,returned:!1,broke:!1,continued:!1,async:!1};if(!e)return n;if(e.locals&&"object"==typeof e.locals)for(const[t,r]of Object.entries(e.locals))n.locals.set(t,r);if(e.globals&&"object"==typeof e.globals&&!(e.globals instanceof Map))for(const[t,r]of Object.entries(e.globals))he(n,t,r);const i=new Set(["me","you","it","result","locals","globals","language"]);for(const[t,r]of Object.entries(e))i.has(t)||void 0===r||n.locals.set(t,r);return n}async function IA(e,t){if(!e||""===e.trim())throw Error("Cannot evaluate empty script");try{const r=MA(t),n=t?.language||"en";if(function(e){const t=e.trim().toLowerCase();if([/^set\s+.+\s+to\s+.+/,/^put\s+.+\s+(into|before|after)\s+.+/,/^add\s+.+(\s+to\s+.+)?/,/^remove\s+.+(\s+from\s+.+)?/,/^show\s+.+/,/^hide\s+.+/,/^toggle\s+.+/,/^log\s+.*/,/^wait\s+.+/,/^call\s+.+/,/^send\s+.+/,/^make\s+.+/,/^increment\s+.+/,/^decrement\s+.+/,/^fetch\s+.+/,/^throw\s+.+/,/^return\s+.+/,/^break/,/^continue/,/^halt/,/^go\s+.+/,/^if\s+.+/,/^repeat\s+.+/,/^on\s+.+/,/^render\s+.+/].some(e=>e.test(t)))return!0;const r=t.split(/\s/)[0];if(r&&R.has(r))return!0;return!1}(e))return await async function(e,t,r="en"){const n=vt(e),i=new on(n,{semanticAnalyzer:RA(),language:r,semanticConfidenceThreshold:FE}),a=i.parse();if(!a.success||!a.node)throw Error("Parse error: "+(a.error?.message||"Unknown parse error"));const o=new gc,s=await o.execute(a.node,t);return s}(e,r,n);return await fn(e,r)}catch(e){if(e instanceof Error)throw Error("HyperScript evaluation error: "+e.message);throw e}}async function WA(e,t){if(!e||""===e.trim())throw Error("Cannot evaluate empty expression");try{const r=MA(t);return await fn(e,r)}catch(e){if(e instanceof Error)throw Error("HyperScript evaluation error: "+e.message);throw e}}async function _A(e,t){if(function(e){const t=e.toLowerCase();return["fetch","wait","settle","async","promise"].some(e=>t.includes(e))}(e))return WA(e,t);try{return IA(e,t)}catch(r){if(r instanceof Error&&r.message.includes("Async expressions not yet supported"))return WA(e,t);throw r}}function qA(e){const{target:t,strategy:r="morph",useViewTransition:n=!1,fetchOptions:i={},transformUrl:a,onBeforeFetch:o,onAfterSwap:s,onError:l}=e,c=async e=>{const c=(()=>{if("string"==typeof t){const e=document.querySelector(t);return Ee(e)?e:null}return Ee(t)?t:null})();if(!c)return void console.warn(`HistorySwap: target "${t}" not found`);let u=window.location.href;a&&(u=a(u));try{o&&await o(u),c.classList.add("hx-swapping");const e=await fetch(u,{method:"GET",headers:{Accept:"text/html","HX-Request":"true","HX-History-Restore-Request":"true"},...i});if(!e.ok)throw Error(`HTTP ${e.status}: ${e.statusText}`);const a=await e.text();await Ls([c],a,r,{useViewTransition:n}),c.classList.remove("hx-swapping"),s&&await s(u,a),nl(window,"historyswap",{url:u,strategy:r,target:t})}catch(e){c.classList.remove("hx-swapping"),l?l(e,u):console.error("HistorySwap fetch failed:",e)}};return window.addEventListener("popstate",c),{destroy:()=>{window.removeEventListener("popstate",c)},config:e}}const $A={name:"HistorySwap",init:(e,t={})=>qA({target:t.target||e,strategy:t.strategy||"morph",useViewTransition:!!t.useViewTransition}),destroy(e){e.destroy()}};function VA(e){return!function(e){try{return new URL(e,window.location.origin).origin!==window.location.origin}catch{return!1}}(e.href)&&((!e.target||"_self"===e.target)&&(!e.hasAttribute("download")&&(!e.hasAttribute("data-no-boost")&&!e.hasAttribute("hx-boost-off")&&("javascript:"!==e.protocol&&"mailto:"!==e.protocol))))}function DA(e){const{container:t,target:r,linkSelector:n="a[href]",formSelector:i="form",boostForms:a=!1,strategy:o="morph",pushUrl:s=!0,useViewTransition:l=!1,fetchOptions:c={},onBeforeFetch:u,onAfterSwap:p,onError:d}=e,m=async(e,n="GET",i=null)=>{const a=(()=>{if(!r)return document.body;if("string"==typeof r){const e=document.querySelector(r);return Ee(e)?e:null}return Ee(r)?r:null})();if(a)try{if(u){if(!1===await u(e,n))return}a.classList.add("hx-swapping"),t.classList.add("hx-boosting");const d={method:n,headers:{Accept:"text/html","HX-Request":"true","HX-Boosted":"true"},...c};i&&"GET"!==n&&(d.body=i);const m=await fetch(e,d);if(!m.ok)throw Error(`HTTP ${m.status}: ${m.statusText}`);const f=await m.text();await Ls([a],f,o,{useViewTransition:l}),a.classList.remove("hx-swapping"),t.classList.remove("hx-boosting"),s&&"GET"===n&&window.history.pushState(null,"",e),p&&await p(e,f),nl(window,"boosted",{url:e,method:n,strategy:o,target:r})}catch(r){a.classList.remove("hx-swapping"),t.classList.remove("hx-boosting"),d?d(r,e):(console.error("Boosted fetch failed:",r),window.location.href=e)}else console.warn(`Boosted: target "${r}" not found`)},f=async e=>{const t=e.target.closest(n);t&&function(e){return!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)&&0===e.button}(e)&&VA(t)&&(e.preventDefault(),e.stopPropagation(),await m(t.href))},h=async e=>{if(!a)return;const t=e.target.closest(i);if(!t)return;if(t.hasAttribute("data-no-boost")||t.hasAttribute("hx-boost-off"))return;if(t.target&&"_self"!==t.target)return;e.preventDefault(),e.stopPropagation();const r=(t.method||"GET").toUpperCase(),n=new FormData(t);let o,s=null;if("GET"===r){const e=new URLSearchParams;n.forEach((t,r)=>{e.append(r,t+"")}),o=`${t.action||window.location.pathname}?${""+e}`}else o=t.action||window.location.pathname,s=n;await m(o,r,s)};return t.addEventListener("click",f),a&&t.addEventListener("submit",h),{destroy:()=>{t.removeEventListener("click",f),t.removeEventListener("submit",h)},config:e,boost:m}}const BA={name:"Boosted",init:(e,t={})=>DA({container:e,target:t.target,linkSelector:t.linkSelector||"a[href]",formSelector:t.formSelector||"form",boostForms:!!t.boostForms,strategy:t.strategy||"morph",pushUrl:!1!==t.pushUrl,useViewTransition:!!t.useViewTransition}),destroy(e){e.destroy()}};const HA="click";let KA,FA,UA,GA=null;function ZA(e,t,r){r.errors?.length&&r.errors.forEach((e,t)=>{}),t.split("\n")}async function YA(e,t){try{return await UA().execute(e,t)}catch(e){throw e}}function XA(e,t,r){try{const n=function(e){try{if(function(e){return"eventHandler"===e.type}(e)){return{eventType:e.event||HA,body:{type:"CommandSequence",commands:e.commands||[],start:e.start||0,end:e.end||0,line:e.line||1,column:e.column||1}}}if(function(e){return"FeatureNode"===e.type}(e)&&"on"===e.name){return{eventType:e.args?.[0]?.value||HA,body:e.body||e}}return"CommandSequence"===e.type||"Block"===e.type?{eventType:HA,body:e}:null}catch(e){return null}}(t);if(!n)return;const i=async e=>{try{r.locals.set("event",e),r.locals.set("target",e.target),await YA(n.body,r)}catch(e){}};e.addEventListener(n.eventType,i);try{const t=UA?.();t?.trackListener?.(e,e,n.eventType,i)}catch{}}catch(e){}}function JA(e){return ze(e)}function QA(e,t,r,n){const i=new CustomEvent(t,{bubbles:!0,cancelable:r,detail:n});return e.dispatchEvent(i)}function eL(e,t){if(!QA(e,"hyperscript:before:init",!0,{code:t}))return;const r=function(e){const t=e.getAttribute("data-lang");if(t)return t;const r=e.closest("[lang]")?.getAttribute("lang");if(r)return r.split("-")[0];if("undefined"!=typeof document){const e=document.documentElement?.lang;if(e)return e.split("-")[0]}return"en"}(e);"en"===r?(!function(e,t){try{const r=KA(t);if(!r.ok)return void ZA(0,t,r);if(!r.ast)return;const n=JA(e);if(t.trim().startsWith("on "))try{XA(e,r.ast,n)}catch(e){throw e}else YA(r.ast,n)}catch(e){}}(e,t),tL(e),QA(e,"hyperscript:after:init",!1,{code:t})):async function(e,t,r){try{const n=await FA(t,{language:r});if(!n.ok)return void ZA(0,t,n);if(!n.ast)return;const i=JA(e);t.trim().startsWith("on ")||"eventHandler"===n.ast.type?XA(e,n.ast,i):YA(n.ast,i)}catch(e){}}(e,t,r).then(()=>{tL(e),QA(e,"hyperscript:after:init",!1,{code:t})})}function tL(e){e.hasAttribute("data-hyperscript-powered")||e.setAttribute("data-hyperscript-powered","")}class rL{constructor(e){this.capacity=e,this.head=0,this.count=0,this.items=Array(e)}push(e){this.items[this.head]=e,this.head=(this.head+1)%this.capacity,this.capacity>this.count&&this.count++}toArray(){return this.capacity>this.count?this.items.slice(0,this.count):[...this.items.slice(this.head),...this.items.slice(0,this.head)]}get length(){return this.count}clear(){this.head=0,this.count=0}last(){if(0===this.count)return;return this.items[(this.head-1+this.capacity)%this.capacity]}}class nL{constructor(){this.state={enabled:!1,paused:!1,stepMode:"continue",callDepth:0,pauseDepth:0,currentSnapshot:null},this.history=new rL(200),this.breakpoints=new Map,this.snapshotIndex=0,this._resumeResolver=null,this.listeners=new Map,this.hooks={beforeExecute:this.beforeExecute.bind(this),afterExecute:this.afterExecute.bind(this)}}on(e,t){let r=this.listeners.get(e);return r||(r=new Set,this.listeners.set(e,r)),r.add(t),()=>r.delete(t)}emit(e,t){const r=this.listeners.get(e);if(r)for(const e of r)try{e(t)}catch{}}enable(){this.state.enabled=!0,this.emit("enabled")}disable(){this.state.paused&&this._resumeResolver&&(this._resumeResolver(),this._resumeResolver=null),this.state.enabled=!1,this.state.paused=!1,this.state.stepMode="continue",this.state.callDepth=0,this.emit("disabled")}get enabled(){return this.state.enabled}continue(){this.state.stepMode="continue",this.resume()}pause(){this.state.stepMode="pause"}stepOver(){this.state.stepMode="over",this.state.pauseDepth=this.state.callDepth,this.resume()}stepInto(){this.state.stepMode="into",this.resume()}stepOut(){this.state.stepMode="out",this.state.pauseDepth=this.state.callDepth,this.resume()}resume(){this._resumeResolver&&(this.state.paused=!1,this.emit("resumed"),this._resumeResolver(),this._resumeResolver=null)}setBreakpoint(e){const t=`bp_${Date.now()}_${Math.random().toString(36).slice(2,8)}`;return this.breakpoints.set(t,{...e,id:t,hitCount:0}),t}removeBreakpoint(e){return this.breakpoints.delete(e)}getBreakpoints(){return Array.from(this.breakpoints.values())}clearBreakpoints(){this.breakpoints.clear()}getState(){return{...this.state}}getHistory(){return this.history.toArray()}clearHistory(){this.history.clear(),this.snapshotIndex=0}async beforeExecute(e){if(!this.state.enabled)return;this.state.callDepth++;const t=this.captureSnapshot(e);this.history.push(t),this.emit("snapshot",t),this.shouldPause(e)&&(this.state.paused=!0,this.state.currentSnapshot=t,this.emit("paused",t),await new Promise(e=>{this._resumeResolver=e}),this.state.currentSnapshot=null)}async afterExecute(e,t){if(!this.state.enabled)return;const r=this.history.last();r&&(r.variables.__result=iL(t)),this.state.callDepth=Math.max(0,this.state.callDepth-1)}shouldPause(e){if(this.hitBreakpoint(e))return!0;switch(this.state.stepMode){case"pause":return this.state.stepMode="into",!0;case"into":return!0;case"over":return this.state.pauseDepth>=this.state.callDepth;case"out":return this.state.pauseDepth>this.state.callDepth;case"continue":return!1}}hitBreakpoint(e){for(const t of this.breakpoints.values()){if(!t.enabled)continue;let r=!1;switch(t.type){case"command":r=e.commandName===t.value;break;case"element":if(e.element)try{r=e.element.matches(t.value)}catch{}break;case"expression":r=this.evaluateCondition(t.value,e)}if(r)return t.hitCount++,!0}return!1}evaluateCondition(e,t){try{const r=t.executionContext,n={commandName:t.commandName,it:r.it,result:r.result,me:r.me};if(r.locals)for(const[e,t]of r.locals)n[e]=t;const i=Object.keys(n),a=i.map(e=>n[e]);return!!Function(...i,`return (${e});`)(...a)}catch{return!1}}captureSnapshot(e){const t=e.executionContext,r={};if(r.it=iL(t.it),r.result=iL(t.result),t.me&&(r.me=aL(t.me)),t.you&&(r.you=aL(t.you)),e.event&&(r["event.type"]=e.event.type,e.event.target&&(r["event.target"]=aL(e.event.target))),t.locals)for(const[e,n]of t.locals)e.startsWith("__")||(r[":"+e]=iL(n));return{commandName:e.commandName,element:e.element,variables:r,timestamp:Date.now(),depth:this.state.callDepth,index:this.snapshotIndex++}}}function iL(e){if(null==e)return e;if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return e;if(e instanceof Element)return aL(e);if(Array.isArray(e))return`Array(${e.length})`;if(e instanceof Map)return`Map(${e.size})`;if(e instanceof Set)return`Set(${e.size})`;if("function"==typeof e)return`\u0192 ${e.name||"anonymous"}()`;if("object"==typeof e){const t=Object.keys(e);return t.length>3?`{${t.slice(0,3).join(", ")}, ...${t.length-3} more}`:`{${t.join(", ")}}`}return e+""}function aL(e){let t="<"+e.tagName.toLowerCase();return e.id&&(t+="#"+e.id),e.classList.length>0&&(t+="."+Array.from(e.classList).join(".")),t+=">",t}const oL="en";const sL=new class{constructor(e=500){this.cache=new Map,this.hits=0,this.misses=0,this.maxSize=e}makeKey(e,t){return`${t?.language||oL}\0${t?.traditional?"1":"0"}\0${e}`}get(e,t){const r=this.makeKey(e,t),n=this.cache.get(r);if(n)return this.hits++,this.cache.delete(r),this.cache.set(r,n),n.result;this.misses++}set(e,t,r){if(!r.ok)return;const n=this.makeKey(e,t);if(this.cache.size>=this.maxSize&&!this.cache.has(n)){const e=this.cache.keys().next().value;void 0!==e&&this.cache.delete(e)}this.cache.set(n,{result:r})}clear(){this.cache.clear(),this.hits=0,this.misses=0}getStats(){const e=this.hits+this.misses;return{size:this.cache.size,hits:this.hits,misses:this.misses,hitRate:e>0?this.hits/e:0}}}(500);let lL=null,cL=null;const uL={semantic:!0,language:"en",confidenceThreshold:FE,logAll:!1,conversions:nt.conversions,onCompileError:null};let pL=null,dL=null;function mL(){if(!pL&&(pL=new gc({lazyLoad:!1}),(e=pL.behaviorRegistry)instanceof Map||e&&"function"==typeof e.set?e.set("HistorySwap",$A):e&&"object"==typeof e&&(e.HistorySwap=$A),function(e){e instanceof Map||e&&"function"==typeof e.set?e.set("Boosted",BA):e&&"object"==typeof e&&(e.Boosted=BA)}(pL.behaviorRegistry),"undefined"!=typeof globalThis)){const e=globalThis;e._hyperscript=e._hyperscript||{},e._hyperscript.runtime=pL,e._hyperscript.behaviors=pL.behaviorAPI}var e;return pL}async function fL(e,t){if(!e)throw Error("AST is required for execution");const r=t||ze();return await mL().execute(e,r)}function hL(e){return{message:e.message,line:e.line??1,column:e.column??1}}function yL(e,t){if("string"!=typeof e)throw new TypeError("Code must be a string");const r=sL.get(e,t);if(r)return r;const n=performance.now(),i=t?.language||oL;try{const r=t?.traditional??!1,a=r?{}:uL.semantic?{semanticAnalyzer:(lL||(lL=Bt({parse:PA,isRegistered:jf,registered:Lf,buildAST:ST})),lL),language:uL.language,semanticConfidenceThreshold:uL.confidenceThreshold}:{},o=!r,s=sn(e,a),l=performance.now()-n;if(s.success&&s.node){const r=s.errors??[],n={ok:!0,ast:s.node,...r.length>0?{errors:r.map(hL)}:{},meta:{parser:o?"semantic":"traditional",language:i,timeMs:l}};return sL.set(e,t,n),n}return{ok:!1,errors:s.error?[hL(s.error)]:[],meta:{parser:o?"semantic":"traditional",language:i,timeMs:l}}}catch(e){const t=performance.now()-n;return{ok:!1,errors:[{message:e instanceof Error?e.message:"Unknown compilation error",line:1,column:1}],meta:{parser:"traditional",language:i,timeMs:t}}}}async function vL(e,t){if("string"!=typeof e)throw new TypeError("Code must be a string");const r=t?.language||oL;if(r===oL||t?.traditional)return yL(e,t);const n=sL.get(e,t);if(n)return n;const i=performance.now();try{const n=await async function(){if(!cL){const{SemanticGrammarBridge:e}=await import("./bridge-qaAHXV7X.js");cL=new e,await cL.initialize()}return cL}(),a=await n.parseToASTWithDetails(e,r);if(a.usedDirectPath&&a.ast){const n=performance.now()-i,o={ok:!0,ast:a.ast,meta:{parser:"semantic",confidence:a.confidence,language:r,timeMs:n,directPath:!0,...a.warnings?.length?{warnings:a.warnings}:{}}};return sL.set(e,t,o),o}const o=yL(a.fallbackText||e,{...t,language:oL}),s={...o,meta:{...o.meta,language:r,confidence:a.confidence,directPath:!1}};return sL.set(e,t,s),s}catch{return yL(e,{...t,language:"en"})}}!function(e,t,r){KA=e,FA=t,UA=r}(yL,vL,mL),GA=uL;const gL={compile:vL,compileSync:yL,execute:fL,eval:async function(e,t,r){if("string"!=typeof e||0===e.trim().length)throw Error("Code must be a non-empty string");let n;if(t)if(t instanceof Element)n=ze(t);else if("object"==typeof(i=t)&&null!==i&&"locals"in i&&i.locals instanceof Map)n=t;else{const e=t;n=function(e){return"object"==typeof e&&null!==e&&"me"in e}(e)?ze(e.me):ze()}else n=ze();var i;const a=await vL(e.trim(),r);if(!a.ok){throw Error("Compilation failed: "+(a.errors?.[0]?.message||"Unknown compilation error"))}return fL(a.ast,n)},validate:async function(e,t){const r=await vL(e,t),n=r.errors??[];return{valid:r.ok&&0===n.length,errors:n.length>0?n:void 0}},process:function(e){try{const t=e.getAttribute("_");t&&eL(e,t);e.querySelectorAll("[_]").forEach(e=>{const t=e.getAttribute("_");t&&eL(e,t)})}catch(e){}},cleanup:e=>{e.dispatchEvent(new CustomEvent("hyperscript:before:cleanup",{bubbles:!0,cancelable:!1}));const t=mL().cleanupTree(e);return e.hasAttribute?.("data-hyperscript-powered")&&e.removeAttribute("data-hyperscript-powered"),e.dispatchEvent(new CustomEvent("hyperscript:after:cleanup",{bubbles:!0,cancelable:!1,detail:{count:t}})),t},createContext:function(e,t){return t?function(e,t){return{me:t??e.me,owner:e.owner??e.me??t??null,it:null,you:null,result:null,locals:new Map,globals:e.globals,parent:e,flags:{halted:!1,breaking:!1,continuing:!1,returning:!1,async:!1}}}(t,e):ze(e)},config:uL,version:"2.11.1",createRuntime:function(e){return new gc(e)},getDefaultRuntime:()=>mL(),registerHooks:(e,t)=>{mL().registerHooks(e,t)},unregisterHooks:e=>mL().unregisterHooks(e),getRegisteredHooks:()=>mL().getRegisteredHooks(),evalLSE:async function(e,t){if("string"!=typeof e||0===e.trim().length)throw Error("LSE code must be a non-empty string");const{parseExplicit:r,semanticNodeToRuntimeAST:n}=await import("./index-CbRUhmE7.js"),i=await r(e),a=await n(i),o=t?ze(t):ze();return await mL().execute(a,o)},evalLSENode:async function(e,t){const{semanticNodeToRuntimeAST:r}=await import("./index-CbRUhmE7.js"),n=await r(e),i=t?ze(t):ze();return await mL().execute(n,i)},compileLSE:async function(e){const t=performance.now();if("string"!=typeof e||0===e.trim().length)return{ok:!1,errors:[{message:"LSE code must be a non-empty string",line:0,column:0}],meta:{parser:"lse",language:"explicit",timeMs:performance.now()-t}};try{const{parseExplicit:r,semanticNodeToRuntimeAST:n}=await import("./index-CbRUhmE7.js"),i=await r(e,{collectDiagnostics:!0}),a=await n(i),o=i.diagnostics?.filter(e=>"error"===e.severity),s=o&&o.length>0;return{ok:!s,ast:s?void 0:a,lse:i,...s?{errors:o.map(e=>({message:e.message,line:0,column:0}))}:{},meta:{parser:"lse",language:"explicit",timeMs:performance.now()-t}}}catch(e){return{ok:!1,errors:[{message:e.message,line:0,column:0}],meta:{parser:"lse",language:"explicit",timeMs:performance.now()-t}}}},toLSE:async function(e,t){const r=t||oL,{parseSemantic:n}=await Promise.resolve().then(function(){return OA}),{renderExplicit:i}=await import("./index-CbRUhmE7.js"),a=n(e,r);if(!a||!a.node)throw Error(`Failed to parse "${e}" as ${r} hyperscript`);return await i(a.node)},fromLSE:async function(e,t){const{render:r}=await Promise.resolve().then(function(){return OA}),{parseExplicit:n}=await import("./index-CbRUhmE7.js");return r(await n(e),t)},clearCache:()=>sL.clear(),getCacheStats:()=>sL.getStats(),get debug(){return dL||(dL=new nL,mL().registerHooks("__debugger",dL.hooks)),dL}},kL=/^on\s+(\w+)/,wL=new Set(["load","mutation","intersection","appear","every"]);function bL(){return"undefined"!=typeof globalThis&&"scheduler"in globalThis&&"function"==typeof globalThis.scheduler?.yield?globalThis.scheduler.yield():new Promise(e=>setTimeout(e,0))}const zL=new class{constructor(e={}){this.processedElements=new WeakSet,this.observer=null,this.processedCount=0,this.readyEventDispatched=!1,this.initialized=!1,this.lazyElements=new WeakSet,this.options={attributeName:"_",autoScan:!0,processOnlyNewElements:!0,lazyParsing:!1,chunkedProcessing:!1,chunkSize:16,...e}}async init(){"undefined"!=typeof document&&(this.initialized||(this.initialized=!0,this.options.autoScan&&(await this.scanAndProcessAll(),this.dispatchReadyEvent()),this.setupMutationObserver()))}async scanAndProcessAll(){"undefined"!=typeof window&&window.__hyperfixi_behaviors_ready&&await window.__hyperfixi_behaviors_ready;const e=document.querySelectorAll('script[type="text/hyperscript"]');for(const t of e)t instanceof HTMLScriptElement&&(t.textContent?.substring(0,50),await this.processHyperscriptTag(t));const t=document.querySelectorAll(`[${this.options.attributeName}]`);if(this.options.lazyParsing){const e=[];t.forEach(t=>{if(t instanceof HTMLElement){const r=this.processElementLazy(t);r&&e.push(r)}}),e.length>0&&await Promise.all(e)}else if(this.options.chunkedProcessing)await this.processElementsChunked(t);else{const e=[];t.forEach(t=>{t instanceof HTMLElement&&e.push(this.processElementAsync(t))}),await Promise.all(e)}"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("lokascript:initialized",{detail:{scriptsProcessed:e.length,elementsProcessed:t.length}}))}reportCompileError(e,t,r,n){const i=r??[];console.error("attribute"===e?"[LokaScript] Compilation failed for _= attribute:":"[LokaScript] Compilation failed for hyperscript script tag:",i,n??"");try{uL.onCompileError?.({source:e,code:t,errors:i,element:n})}catch(e){console.error("[LokaScript] onCompileError hook threw:",e)}try{const r=n??("undefined"!=typeof document?document:null);r?.dispatchEvent(new CustomEvent("hyperfixi:compile-error",{bubbles:!0,cancelable:!1,detail:{source:e,code:t,errors:i,element:n}}))}catch(e){}}async processHyperscriptTag(e){const t=e.getAttribute("for");t?await this.processHyperscriptTagForElements(e,t):await this.processHyperscriptTagGlobal(e)}async processHyperscriptTagForElements(e,t){const r=e.textContent||e.innerHTML;if(!r||!r.trim())return;const n=document.querySelectorAll(t);if(0!==n.length)try{r.substring(0,50);const t=gL.compileSync(r);if(!t.ok)return void this.reportCompileError("script",r,t.errors,e);for(const e of n)if(e instanceof HTMLElement){const r=ze(e);await gL.execute(t.ast,r)}}catch(e){console.error(`[LokaScript] Error processing script for="${t}":`,e)}else console.warn(`[LokaScript] Script with for="${t}" found no matching elements`)}async processHyperscriptTagGlobal(e){const t=e.textContent||e.innerHTML;if(t&&t.trim())try{t.substring(0,50);const r=ze(null),n=gL.compileSync(t);if(!n.ok)return void this.reportCompileError("script",t,n.errors,e);await gL.execute(n.ast,r)}catch(e){console.error("[LokaScript] Script execution error:",e)}}processElement(e){this.processElementAsync(e)}async processElementAsync(e){if(this.options.processOnlyNewElements&&this.processedElements.has(e))return;const t=e.getAttribute(this.options.attributeName);if(t){this.processedElements.add(e),this.processedCount++;try{const r=ze(e),n=gL.compileSync(t);if(!n.ok)return void this.reportCompileError("attribute",t,n.errors,e);await gL.execute(n.ast,r),this.dispatchLoadEvent(e)}catch(t){console.error("[LokaScript] Error processing _= attribute:",t,e)}}}async processElementsChunked(e){const t=this.options.chunkSize,r=[];e.forEach(e=>{e instanceof HTMLElement&&r.push(e)});for(let e=0;r.length>e;e+=t){const n=r.slice(e,e+t).map(e=>this.processElementAsync(e));await Promise.all(n),r.length>e+t&&await bL()}}processElementLazy(e){const t=e.getAttribute(this.options.attributeName);if(!t)return null;const r=t.match(kL);if(!r||wL.has(r[1])||this.hasMultipleHandlers(t))return this.processElementAsync(e);const n=r[1];return e.addEventListener(n,async r=>{this.lazyElements.delete(e);try{const n=gL.compileSync(t);if(!n.ok||!n.ast)return void this.reportCompileError("attribute",t,n.errors,e);const i=ze(e);gL.execute(n.ast,i);const a=n.ast;if("eventHandler"===a.type&&a.commands?.length>0){a.modifiers?.prevent&&r.preventDefault(),a.modifiers?.stop&&r.stopPropagation();const t=ze(e);t.locals.set("event",r),t.locals.set("target",r.target),t.event=r;for(const e of a.commands)await gL.execute(e,t)}this.dispatchLoadEvent(e)}catch(t){console.error("[LokaScript] Error in lazy handler on first event:",t,e)}},{once:!0}),this.lazyElements.add(e),this.processedElements.add(e),this.processedCount++,null}hasMultipleHandlers(e){const t=new Set(["me","it","its","my","you","yourself"]);let r=0;const n=/\bon\s+(\w+)/g;let i;for(;null!==(i=n.exec(e));){if("."!==e[i.index+i[0].length]&&(!t.has(i[1])&&(r++,r>1)))return!0}return!1}dispatchLoadEvent(e){try{const t=new Event("load",{bubbles:!1,cancelable:!1});e.dispatchEvent(t)}catch(e){}}dispatchReadyEvent(){if(!this.readyEventDispatched)try{const e=new CustomEvent("hyperscript:ready",{bubbles:!0,cancelable:!1,detail:{processedElements:this.processedCount,timestamp:Date.now()}});document.dispatchEvent(e),this.readyEventDispatched=!0}catch(e){}}setupMutationObserver(){"undefined"!=typeof MutationObserver&&(this.observer=new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){const t=e;"SCRIPT"===t.tagName&&"text/hyperscript"===t.getAttribute("type")&&this.processHyperscriptTag(t).catch(e=>{console.error("[LokaScript] Error processing dynamically added script tag:",e)});const r=t.querySelectorAll?.('script[type="text/hyperscript"]');r?.forEach(e=>{e instanceof HTMLScriptElement&&this.processHyperscriptTag(e).catch(e=>{console.error("[LokaScript] Error processing dynamically added script tag:",e)})}),t.getAttribute&&t.getAttribute(this.options.attributeName)&&this.processElementAsync(t).catch(e=>{console.error("[LokaScript] Error processing dynamically added element:",e)});const n=t.querySelectorAll?.(`[${this.options.attributeName}]`);n?.forEach(e=>{e instanceof HTMLElement&&this.processElementAsync(e).catch(e=>{console.error("[LokaScript] Error processing dynamically added element:",e)})})}})})}),this.observer.observe(document.body,{childList:!0,subtree:!0}))}destroy(){this.observer&&(this.observer.disconnect(),this.observer=null),this.initialized=!1,this.readyEventDispatched=!1,this.processedCount=0,this.lazyElements=new WeakSet}reset(){this.destroy()}};class xL{constructor(e,t,r=0){this.pool=[],this.index=0,this.metrics={allocations:0,reuses:0,peakPoolSize:0},this.factory=e,this.reset=t;for(let t=0;r>t;t++)this.pool.push(e());this.metrics.allocations=r,this.metrics.peakPoolSize=r}get(){let e;return this.pool.length>this.index?(e=this.pool[this.index++],this.metrics.reuses++,this.reset&&this.reset(e)):(e=this.factory(),this.pool.push(e),this.index++,this.metrics.allocations++,this.pool.length>this.metrics.peakPoolSize&&(this.metrics.peakPoolSize=this.pool.length)),e}releaseAll(){this.index=0}getMetrics(){const e=this.metrics.allocations+this.metrics.reuses;return{...this.metrics,hitRate:e>0?this.metrics.reuses/e*100:0}}clear(){this.pool=[],this.index=0,this.metrics={allocations:0,reuses:0,peakPoolSize:0}}}const EL=new class{constructor(){this.pending=new Map,this.rafId=null,this.stylePool=new xL(()=>({}),e=>{for(const t of Object.keys(e))delete e[t]},10)}add(e,t){let r=this.pending.get(e);r||(r=this.stylePool.get(),this.pending.set(e,r)),Object.assign(r,t),this.rafId||(this.rafId=requestAnimationFrame(()=>this.flush()))}flush(){for(const[e,t]of this.pending)for(const[r,n]of Object.entries(t))if(r.startsWith("--"))e.style.setProperty(r,n);else{const t=r.replace(/-([a-z])/g,e=>e[1].toUpperCase());e.style[t]=n}this.pending.clear(),this.stylePool.releaseAll(),this.rafId=null}cancel(){this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.pending.clear(),this.stylePool.releaseAll()}getPendingCount(){return this.pending.size}getPoolMetrics(){return this.stylePool.getMetrics()}},TL={sockets:/\b(socket|connect\s+to\s+ws[s]?:)/i,eventsource:/\b(eventsource|connect\s+to\s+sse:)/i,workers:/\b(worker|start\s+worker)/i},SL=new Set,CL=new Map;function AL(e){const t=new Set,r=Array.isArray(e)?e:[e];for(const e of r)for(const[r,n]of Object.entries(TL))n.test(e)&&t.add(r);return t}async function LL(e){if(SL.has(e))return;const t=CL.get(e);if(t)return t;const r=(async()=>{try{switch(e){case"sockets":await import("./feature-sockets-CcTxD5sT.js").then(function(e){return e.s});break;case"eventsource":await import("./feature-eventsource-Bxg_UNZo.js");break;case"workers":await import("./feature-webworker-DoqZ0Grg.js");break;default:return void console.warn("Unknown feature: "+e)}SL.add(e)}catch(t){throw console.error(`Failed to load feature "${e}":`,t),t}finally{CL.delete(e)}})();return CL.set(e,r),r}async function jL(e){const t=[...AL(e)].filter(e=>!SL.has(e));0!==t.length&&await Promise.all(t.map(e=>LL(e)))}async function PL(){const e=function(){if("undefined"==typeof document)return[];const e=[];return document.querySelectorAll("[_]").forEach(t=>{const r=t.getAttribute("_");r&&e.push(r)}),document.querySelectorAll('script[type="text/hyperscript"]').forEach(t=>{t.textContent&&e.push(t.textContent)}),e}();await jL(e)}function OL(e){return SL.has(e)}function NL(){return[...SL]}async function RL(e){await Promise.all(e.map(e=>LL(e)))}const ML={evalHyperScript:IA,evalHyperScriptAsync:WA,evalHyperScriptSmart:_A,evaluate:IA,compile:e=>{const t=gL.compileSync(e);if(!t.ok){throw Error(t.errors&&t.errors.length>0?t.errors[0].message:"Compilation failed")}return t},execute:gL.execute,run:async(e,t)=>gL.eval(e,t),createContext:gL.createContext,createRuntime:gL.createRuntime,Parser:on,Runtime:gc,tokenize:vt,processNode:async e=>{const t=[];if(e===document)document.querySelectorAll("[_]").forEach(e=>{const r=e.getAttribute("_");r&&t.push(r)}),document.querySelectorAll('script[type="text/hyperscript"]').forEach(e=>{e.textContent&&t.push(e.textContent)});else if(e instanceof HTMLElement){const r=e.getAttribute("_");r&&t.push(r)}await jL(t),e===document?zL.scanAndProcessAll():e instanceof HTMLElement&&zL.processElement(e)},process:e=>ML.processNode(e),attributeProcessor:zL,styleBatcher:EL,ObjectPool:xL,debug:_t,features:{preloadDocument:PL,loadRequired:jL,detect:AL,isLoaded:OL,getLoaded:NL,preload:RL},version:"1.0.0-modular"};"undefined"!=typeof window&&(window.hyperfixi=ML,window.evalHyperScript=IA,window.evalHyperScriptAsync=WA,window.evalHyperScriptSmart=_A,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",async()=>{await PL(),await zL.init()}):PL().then(()=>{zL.init()}));export{FE as D,xL as O,on as P,gc as R,zL as a,AL as b,WA as c,_t as d,IA as e,_A as f,NL as g,ML as h,gL as i,OL as j,RL as k,jL as l,Ed as m,OA as n,PL as p,EL as s,vt as t};
|
|
2
|
+
//# sourceMappingURL=browser-modular-DqXN1HOD.js.map
|