@lokascript/hyperscript-adapter 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +46 -3
  2. package/dist/hyperscript-i18n-ar.global.js +4 -4
  3. package/dist/hyperscript-i18n-bn.global.js +4 -4
  4. package/dist/hyperscript-i18n-de.global.js +4 -4
  5. package/dist/hyperscript-i18n-east-asian.global.js +4 -4
  6. package/dist/hyperscript-i18n-en.global.js +6 -6
  7. package/dist/hyperscript-i18n-es.global.js +4 -4
  8. package/dist/hyperscript-i18n-fr.global.js +4 -4
  9. package/dist/hyperscript-i18n-he.global.js +4 -4
  10. package/dist/hyperscript-i18n-hi.global.js +4 -4
  11. package/dist/hyperscript-i18n-id.global.js +4 -4
  12. package/dist/hyperscript-i18n-it.global.js +4 -4
  13. package/dist/hyperscript-i18n-ja.global.js +4 -4
  14. package/dist/hyperscript-i18n-ko.global.js +4 -4
  15. package/dist/hyperscript-i18n-ms.global.js +4 -4
  16. package/dist/hyperscript-i18n-pl.global.js +4 -4
  17. package/dist/hyperscript-i18n-pt.global.js +4 -4
  18. package/dist/hyperscript-i18n-qu.global.js +4 -4
  19. package/dist/hyperscript-i18n-ru.global.js +4 -4
  20. package/dist/hyperscript-i18n-slavic.global.js +4 -4
  21. package/dist/hyperscript-i18n-south-asian.global.js +4 -4
  22. package/dist/hyperscript-i18n-southeast-asian.global.js +4 -4
  23. package/dist/hyperscript-i18n-sw.global.js +4 -4
  24. package/dist/hyperscript-i18n-th.global.js +4 -4
  25. package/dist/hyperscript-i18n-tl.global.js +4 -4
  26. package/dist/hyperscript-i18n-tr.global.js +4 -4
  27. package/dist/hyperscript-i18n-uk.global.js +4 -4
  28. package/dist/hyperscript-i18n-vi.global.js +4 -4
  29. package/dist/hyperscript-i18n-western.global.js +4 -4
  30. package/dist/hyperscript-i18n-zh.global.js +4 -4
  31. package/dist/hyperscript-i18n.global.js +73 -7
  32. package/dist/hyperscript-i18n.global.js.map +1 -1
  33. package/package.json +1 -1
  34. package/src/hyperscript-renderer.ts +3 -0
@@ -1,4 +1,4 @@
1
- var HyperscriptI18n=(function(exports){'use strict';var jt=new Map,Wt=new Map,$t=new Map;function qt(e,t,r){jt.set(e,t),Wt.set(e,r),$t.delete(e);}var Vt=class{constructor(e,t){this.pos=0,this.tokens=e,this.language=t;}peek(e=0){let t=this.pos+e;return t<0||t>=this.tokens.length?null:this.tokens[t]}advance(){if(this.isAtEnd())throw new 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){let t=[];for(;!this.isAtEnd()&&e(this.peek());)t.push(this.advance());return t}skipWhile(e){for(;!this.isAtEnd()&&e(this.peek());)this.advance();}};function C(e,t){return {start:e,end:t}}function k(e,t,r,i){if(typeof i=="string")return {value:e,kind:t,position:r,normalized:i};if(i){let{normalized:n,stem:u,stemConfidence:o}=i;return {value:e,kind:t,position:r,...n!==void 0&&{normalized:n},...u!==void 0&&{stem:u},...o!==void 0&&{stemConfidence:o}}}return {value:e,kind:t,position:r}}function U(e){return /\s/.test(e)}function Ie(e){return e==="#"||e==="."||e==="["||e==="@"||e==="*"||e==="<"}function Be(e){return e==='"'||e==="'"||e==="`"||e==="\u300C"||e==="\u300D"}function I(e){return /\d/.test(e)}function Ut(e){return /[a-zA-Z]/.test(e)}function R(e){return /[a-zA-Z0-9_-]/.test(e)}function Kt(e){let t=i=>e.test(i);return {isLetter:t,isIdentifierChar:i=>t(i)||/[0-9_-]/.test(i)}}function Gt(e,t){if(t>=e.length)return null;let r=e[t];if(!Ie(r))return null;let i=t,n="";if(r==="#"||r==="."){for(n+=e[i++];i<e.length&&R(e[i]);)n+=e[i++];if(n.length<=1)return null;if(i<e.length&&e[i]==="."&&r==="#"){let o=i+1;for(;o<e.length&&R(e[o]);)o++;if(o<e.length&&e[o]==="(")return n}}else if(r==="["){let u=1,o=false,s=null,a=false;for(n+=e[i++];i<e.length&&u>0;){let c=e[i];n+=c,a?a=false:c==="\\"?a=true:o?c===s&&(o=false,s=null):c==='"'||c==="'"||c==="`"?(o=true,s=c):c==="["?u++:c==="]"&&u--,i++;}if(u!==0)return null}else if(r==="@"){for(n+=e[i++];i<e.length&&R(e[i]);)n+=e[i++];if(n.length<=1)return null}else if(r==="*"){for(n+=e[i++];i<e.length&&R(e[i]);)n+=e[i++];if(n.length<=1)return null}else if(r==="<"){if(n+=e[i++],i>=e.length||!Ut(e[i]))return null;for(;i<e.length&&R(e[i]);)n+=e[i++];for(;i<e.length;){let u=e[i];if(u==="."){if(n+=e[i++],i>=e.length||!R(e[i]))return null;for(;i<e.length&&R(e[i]);)n+=e[i++];}else if(u==="#"){if(n+=e[i++],i>=e.length||!R(e[i]))return null;for(;i<e.length&&R(e[i]);)n+=e[i++];}else if(u==="["){let o=1,s=false,a=null,c=false;for(n+=e[i++];i<e.length&&o>0;){let l=e[i];n+=l,c?c=false:l==="\\"?c=true:s?l===a&&(s=false,a=null):l==='"'||l==="'"||l==="`"?(s=true,a=l):l==="["?o++:l==="]"&&o--,i++;}if(o!==0)return null}else break}for(;i<e.length&&U(e[i]);)n+=e[i++];if(i<e.length&&e[i]==="/")for(n+=e[i++];i<e.length&&U(e[i]);)n+=e[i++];if(i>=e.length||e[i]!==">")return null;n+=e[i++];}return n||null}function Ht(e,t){if(t>=e.length||e[t]!=="'"||t+1>=e.length||e[t+1].toLowerCase()!=="s")return false;if(t+2>=e.length)return true;let i=e[t+2];return U(i)||i==="*"||!R(i)}function Qt(e,t){if(t>=e.length)return null;let r=e[t];if(!Be(r)||r==="'"&&Ht(e,t))return null;let n={'"':'"',"'":"'","`":"`","\u300C":"\u300D"}[r];if(!n)return null;let u=t+1,o=r,s=false;for(;u<e.length;){let a=e[u];if(o+=a,s)s=false;else if(a==="\\")s=true;else if(a===n)return o;u++;}return o}function Oe(e,t){if(t>=e.length)return false;let r=e[t],i=e[t+1]||"",n=e[t+2]||"";if(r==="/"&&i!=="/"&&/[a-zA-Z0-9._-]/.test(i)||r==="/"&&i==="/"&&/[a-zA-Z]/.test(n)||r==="."&&(i==="/"||i==="."&&n==="/"))return true;let u=e.slice(t,t+8).toLowerCase();return !!(u.startsWith("http://")||u.startsWith("https://"))}function Yt(e,t){if(!Oe(e,t))return null;let r=t,i="",n=/[a-zA-Z0-9/:._\-?&=%@+~!$'()*,;[\]]/;for(;r<e.length;){let u=e[r];if(u==="#"){if(i.length>0&&/[a-zA-Z0-9/.]$/.test(i))for(i+=u,r++;r<e.length&&/[a-zA-Z0-9_-]/.test(e[r]);)i+=e[r++];break}if(n.test(u))i+=u,r++;else break}return i.length<2?null:i}function Xt(e,t){if(t>=e.length)return null;let r=e[t];if(!I(r)&&r!=="-"&&r!=="+")return null;let i=t,n="";if((e[i]==="-"||e[i]==="+")&&(n+=e[i++]),i>=e.length||!I(e[i]))return null;for(;i<e.length&&I(e[i]);)n+=e[i++];if(i<e.length&&e[i]===".")for(n+=e[i++];i<e.length&&I(e[i]);)n+=e[i++];return i<e.length&&(e.slice(i,i+2)==="ms"?n+="ms":(e[i]==="s"||e[i]==="m"||e[i]==="h")&&(n+=e[i])),n}var Me=class Le{constructor(){this.profileKeywords=[],this.profileKeywordMap=new Map;}tryPropertyAccess(t,r,i){if(t[r]!==".")return false;let n=i[i.length-1],u=n&&n.position.end<r;if(n&&!u&&(n.kind==="identifier"||n.kind==="keyword"||n.kind==="selector"))return i.push(k(".","operator",C(r,r+1))),true;let a=r+1;for(;a<t.length&&R(t[a]);)a++;return a<t.length&&t[a]==="("?(i.push(k(".","operator",C(r,r+1))),true):false}initializeKeywordsFromProfile(t,r=[]){let i=new Map;if(t.keywords){for(let[n,u]of Object.entries(t.keywords))if(i.set(u.primary,{native:u.primary,normalized:u.normalized||n}),u.alternatives)for(let o of u.alternatives)i.set(o,{native:o,normalized:u.normalized||n});}if(t.references){for(let[n,u]of Object.entries(t.references))i.set(u,{native:u,normalized:n});for(let n of Object.keys(t.references))i.has(n)||i.set(n,{native:n,normalized:n});}if(t.roleMarkers){for(let[n,u]of Object.entries(t.roleMarkers))if(u.primary&&i.set(u.primary,{native:u.primary,normalized:n}),u.alternatives)for(let o of u.alternatives)i.set(o,{native:o,normalized:n});}for(let n of r)i.set(n.native,n);this.profileKeywords=Array.from(i.values()).sort((n,u)=>u.native.length-n.native.length),this.profileKeywordMap=new Map;for(let n of this.profileKeywords){this.profileKeywordMap.set(n.native.toLowerCase(),n);let u=this.removeDiacritics(n.native);u!==n.native&&!this.profileKeywordMap.has(u.toLowerCase())&&this.profileKeywordMap.set(u.toLowerCase(),n);}}removeDiacritics(t){return t.replace(/[\u064B-\u0652\u0670]/g,"")}tryProfileKeyword(t,r){for(let i of this.profileKeywords)if(t.slice(r).startsWith(i.native))return k(i.native,"keyword",C(r,r+i.native.length),i.normalized);return null}isKeywordStart(t,r){let i=t.slice(r);return this.profileKeywords.some(n=>i.startsWith(n.native))}lookupKeyword(t){return this.profileKeywordMap.get(t.toLowerCase())}isKeyword(t){return this.profileKeywordMap.has(t.toLowerCase())}setNormalizer(t){this.normalizer=t;}tryNormalize(t){if(!this.normalizer)return null;let r=this.normalizer.normalize(t);return r.stem!==t&&r.confidence>=.7?r:null}tryMorphKeywordMatch(t,r,i){let n=this.tryNormalize(t);if(!n)return null;let u=this.lookupKeyword(n.stem);if(!u)return null;let o={normalized:u.normalized,stem:n.stem,stemConfidence:n.confidence};return k(t,"keyword",C(r,i),o)}trySelector(t,r){let i=Gt(t,r);return i?k(i,"selector",C(r,r+i.length)):null}tryEventModifier(t,r){if(t[r]!==".")return null;let i=t.slice(r).match(/^\.(?:once|debounce|throttle|queue)(?:\(([^)]+)\))?(?:\s|$|\.)/);if(!i)return null;let n=i[0].replace(/(\s|\.)$/,""),u=n.slice(1).split("(")[0],o=i[1];return {...k(n,"event-modifier",C(r,r+n.length)),metadata:{modifierName:u,value:o?u==="queue"?o:parseInt(o,10):void 0}}}tryString(t,r){let i=Qt(t,r);return i?k(i,"literal",C(r,r+i.length)):null}tryNumber(t,r){let i=Xt(t,r);return i?k(i,"literal",C(r,r+i.length)):null}tryMatchTimeUnit(t,r,i,n=false){let u=r;if(n)for(;u<t.length&&U(t[u]);)u++;let o=t.slice(u);for(let s of i){let a=o.slice(0,s.length);if(s.caseInsensitive?a.toLowerCase()===s.pattern.toLowerCase():a===s.pattern){if(s.notFollowedBy&&(o[s.length]||"")===s.notFollowedBy)continue;if(s.checkBoundary){let l=o[s.length]||"";if(R(l))continue}return {suffix:s.suffix,endPos:u+s.length}}}return null}parseBaseNumber(t,r,i=true){let n=r,u="";if(i&&(t[n]==="-"||t[n]==="+")&&(u+=t[n++]),n>=t.length||!I(t[n]))return null;for(;n<t.length&&I(t[n]);)u+=t[n++];if(n<t.length&&t[n]===".")for(u+=t[n++];n<t.length&&I(t[n]);)u+=t[n++];return !u||u==="-"||u==="+"?null:{number:u,endPos:n}}tryNumberWithTimeUnits(t,r,i,n={}){let{allowSign:u=true,skipWhitespace:o=false}=n,s=this.parseBaseNumber(t,r,u);if(!s)return null;let{number:a,endPos:c}=s,l=[...i,...Le.STANDARD_TIME_UNITS],d=this.tryMatchTimeUnit(t,c,l,o);return d&&(a+=d.suffix,c=d.endPos),k(a,"literal",C(r,c))}tryUrl(t,r){let i=Yt(t,r);return i?k(i,"url",C(r,r+i.length)):null}tryVariableRef(t,r){if(t[r]!==":"||r+1>=t.length||!R(t[r+1]))return null;let i=r+1;for(;i<t.length&&R(t[i]);)i++;let n=t.slice(r,i);return k(n,"identifier",C(r,i))}tryOperator(t,r){let i=t.slice(r,r+2);if(["==","!=","<=",">=","&&","||","->"].includes(i))return k(i,"operator",C(r,r+2));let n=t[r];return ["<",">","!","+","-","*","/","="].includes(n)?k(n,"operator",C(r,r+1)):["(",")","{","}",",",";",":"].includes(n)?k(n,"punctuation",C(r,r+1)):null}tryMultiCharParticle(t,r,i){for(let n of i)if(t.slice(r,r+n.length)===n)return k(n,"particle",C(r,r+n.length));return null}};Me.STANDARD_TIME_UNITS=[{pattern:"ms",suffix:"ms",length:2},{pattern:"s",suffix:"s",length:1,checkBoundary:true},{pattern:"m",suffix:"m",length:1,checkBoundary:true,notFollowedBy:"s"},{pattern:"h",suffix:"h",length:1,checkBoundary:true}];var Zt=Me,je={code:"ru",name:"Russian",nativeName:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",direction:"ltr",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:true,defaultVerbForm:"infinitive",verb:{position:"start",subjectDrop:true,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:"body"},possessive:{marker:"",markerPosition:"after-object",usePossessiveAdjectives:true,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\u0431\u0430\u0432\u0438\u0442\u044C_\u0432_\u043A\u043E\u043D\u0435\u0446",alternatives:["\u0434\u043E\u043F\u0438\u0441\u0430\u0442\u044C"],normalized:"append",form:"infinitive"},prepend:{primary:"\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",alternatives:["\u043A\u043E\u0433\u0434\u0430"],normalized:"on"},trigger:{primary:"\u0432\u044B\u0437\u0432\u0430\u0442\u044C",alternatives:["\u0432\u044B\u0437\u043E\u0432\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"},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"},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"},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"},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"},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"},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:"\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C_\u043F\u0430\u043A\u0435\u0442",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:"\u0434\u043E",alternatives:["\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"}},eventHandler:{keyword:{primary:"\u043F\u0440\u0438",alternatives:["\u043A\u043E\u0433\u0434\u0430"],normalized:"on"},sourceMarker:{primary:"\u043D\u0430",alternatives:["\u0432","\u043F\u0440\u0438"],position:"before"},eventMarker:{primary:"\u043F\u0440\u0438",alternatives:["\u043A\u043E\u0433\u0434\u0430"],position:"before"},temporalMarkers:["\u043A\u043E\u0433\u0434\u0430","\u0435\u0441\u043B\u0438"]}};function re(e){return {stem:e,confidence:1}}function y(e,t,r){return r?{stem:e,confidence:t,metadata:r}:{stem:e,confidence:t}}function Jt(e){return /[а-яА-ЯёЁ]/.test(e)}function er(e){for(let t of e)if(Jt(t))return true;return false}var _e=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"]]),We=class{constructor(){this.language="ru";}isNormalizable(e){return e.length<3?false:er(e)}normalize(e){let t=e.toLowerCase();if(t.endsWith("\u0441\u044F")||t.endsWith("\u0441\u044C")){let o=this.tryReflexiveNormalization(t);if(o)return o}if(t.endsWith("\u0442\u044C")||t.endsWith("\u0442\u0438")||t.endsWith("\u0447\u044C"))return re(e);let r=this.tryImperativeLookup(t);if(r)return r;let i=this.tryPastTenseNormalization(t);if(i)return i;let n=this.tryPresentTenseNormalization(t);if(n)return n;let u=this.tryGenericImperativeNormalization(t);return u||re(e)}tryReflexiveNormalization(e){(e.endsWith("\u0441\u044F"),2);let r=e.slice(0,-2);if(e.endsWith("\u0442\u044C\u0441\u044F")||e.endsWith("\u0442\u0438\u0441\u044C")||e.endsWith("\u0447\u044C\u0441\u044F"))return re(e);let i=this.normalizeNonReflexive(r);if(i.confidence<1){let n=i.stem.endsWith("\u0442\u044C")?i.stem.slice(0,-2)+"\u0442\u044C\u0441\u044F":i.stem+"\u0441\u044F";return y(n,i.confidence*.95,{removedSuffixes:["\u0441\u044F",...i.metadata?.removedSuffixes||[]],conjugationType:"reflexive"})}return null}normalizeNonReflexive(e){if(e.endsWith("\u0442\u044C")||e.endsWith("\u0442\u0438")||e.endsWith("\u0447\u044C"))return re(e);let t=this.tryImperativeLookup(e);if(t)return t;let r=this.tryPastTenseNormalization(e);if(r)return r;let i=this.tryPresentTenseNormalization(e);if(i)return i;let n=this.tryGenericImperativeNormalization(e);return n||re(e)}tryImperativeLookup(e){return _e.has(e)?y(_e.get(e),.95,{removedSuffixes:["imperative"],conjugationType:"imperative"}):null}tryGenericImperativeNormalization(e){return e.endsWith("\u0439\u0442\u0435")&&e.length>5?y(e.slice(0,-3)+"\u0442\u044C",.8,{removedSuffixes:["\u0439\u0442\u0435"],conjugationType:"imperative"}):e.endsWith("\u0438\u0442\u0435")&&e.length>5?y(e.slice(0,-3)+"\u0438\u0442\u044C",.8,{removedSuffixes:["\u0438\u0442\u0435"],conjugationType:"imperative"}):e.endsWith("\u0439")&&e.length>3?y(e.slice(0,-1)+"\u0442\u044C",.75,{removedSuffixes:["\u0439"],conjugationType:"imperative"}):e.endsWith("\u0438")&&e.length>3?y(e+"\u0442\u044C",.7,{removedSuffixes:["\u0438\u2192\u0438\u0442\u044C"],conjugationType:"imperative"}):null}tryPastTenseNormalization(e){return e.endsWith("\u0430\u043B\u0430")&&e.length>4?y(e.slice(0,-3)+"\u0430\u0442\u044C",.85,{removedSuffixes:["\u0430\u043B\u0430"],conjugationType:"past"}):e.endsWith("\u0438\u043B\u0430")&&e.length>4?y(e.slice(0,-3)+"\u0438\u0442\u044C",.85,{removedSuffixes:["\u0438\u043B\u0430"],conjugationType:"past"}):e.endsWith("\u0435\u043B\u043E")&&e.length>4?y(e.slice(0,-3)+"\u0435\u0442\u044C",.82,{removedSuffixes:["\u0435\u043B\u043E"],conjugationType:"past"}):e.endsWith("\u0430\u0431\u043E")&&e.length>4?y(e.slice(0,-3)+"\u0430\u0442\u044C",.82,{removedSuffixes:["\u0430\u0431\u043E"],conjugationType:"past"}):e.endsWith("\u0430\u043B\u0438")&&e.length>4?y(e.slice(0,-3)+"\u0430\u0442\u044C",.85,{removedSuffixes:["\u0430\u043B\u0438"],conjugationType:"past"}):e.endsWith("\u0438\u043B\u0438")&&e.length>4?y(e.slice(0,-3)+"\u0438\u0442\u044C",.85,{removedSuffixes:["\u0438\u043B\u0438"],conjugationType:"past"}):e.endsWith("\u0430\u043B")&&e.length>3?y(e.slice(0,-2)+"\u0430\u0442\u044C",.82,{removedSuffixes:["\u0430\u043B"],conjugationType:"past"}):e.endsWith("\u0438\u043B")&&e.length>3?y(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?y(e.slice(0,-3)+"\u0438\u0442\u044C",.8,{removedSuffixes:["\u0438\u0448\u044C"],conjugationType:"present"}):e.endsWith("\u0438\u0442")&&e.length>3?y(e.slice(0,-2)+"\u0438\u0442\u044C",.78,{removedSuffixes:["\u0438\u0442"],conjugationType:"present"}):e.endsWith("\u0438\u043C")&&e.length>3?y(e.slice(0,-2)+"\u0438\u0442\u044C",.78,{removedSuffixes:["\u0438\u043C"],conjugationType:"present"}):e.endsWith("\u044F\u0442")&&e.length>3?y(e.slice(0,-2)+"\u0438\u0442\u044C",.78,{removedSuffixes:["\u044F\u0442"],conjugationType:"present"}):e.endsWith("\u0435\u0448\u044C")&&e.length>4?y(e.slice(0,-3)+"\u0430\u0442\u044C",.75,{removedSuffixes:["\u0435\u0448\u044C"],conjugationType:"present"}):e.endsWith("\u0435\u0442")&&e.length>3?y(e.slice(0,-2)+"\u0430\u0442\u044C",.72,{removedSuffixes:["\u0435\u0442"],conjugationType:"present"}):e.endsWith("\u0435\u043C")&&e.length>3?y(e.slice(0,-2)+"\u0430\u0442\u044C",.72,{removedSuffixes:["\u0435\u043C"],conjugationType:"present"}):e.endsWith("\u044E\u0442")&&e.length>3?y(e.slice(0,-2)+"\u0430\u0442\u044C",.75,{removedSuffixes:["\u044E\u0442"],conjugationType:"present"}):e.endsWith("\u0443\u0442")&&e.length>3?y(e.slice(0,-2)+"\u0430\u0442\u044C",.72,{removedSuffixes:["\u0443\u0442"],conjugationType:"present"}):null}},{isLetter:tr,isIdentifierChar:rr}=Kt(/[a-zA-Zа-яА-ЯёЁ]/),Fe=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"]),ir=[{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:"\u043F\u0435\u0440\u0432\u044B\u0439",normalized:"first"},{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\u0438\u0439",normalized:"last"},{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\u0438\u0439",normalized:"next"},{native:"\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0430\u044F",normalized:"next"},{native:"\u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0438\u0439",normalized:"previous"},{native:"\u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0430\u044F",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:"\u043A\u043B\u0438\u043A",normalized:"click"},{native:"\u043D\u0430\u0436\u0430\u0442\u0438\u0435",normalized:"click"},{native:"click",normalized:"click"},{native:"\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0435",normalized:"change"},{native:"\u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0430",normalized:"submit"},{native:"\u043A\u043B\u0430\u0432\u0438\u0448\u0430",normalized:"keydown"},{native:"\u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u0435",normalized:"mouseover"},{native:"\u0443\u0445\u043E\u0434",normalized:"mouseout"},{native:"\u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0430",normalized:"load"},{native:"\u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0430",normalized:"scroll"},{native:"\u0432\u0432\u043E\u0434",normalized:"input"},{native:"\u043C\u043E\u0439",normalized:"my"},{native:"\u043C\u043E\u044F",normalized:"my"},{native:"\u043C\u043E\u0451",normalized:"my"},{native:"\u043C\u043E\u0438",normalized:"my"},{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:"\u0438\u043B\u0438",normalized:"or"},{native:"\u043D\u0435",normalized:"not"},{native:"\u0435\u0441\u0442\u044C",normalized:"is"},{native:"\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442",normalized:"exists"},{native:"\u043F\u0443\u0441\u0442\u043E\u0439",normalized:"empty"},{native:"\u043F\u0443\u0441\u0442\u0430\u044F",normalized:"empty"},{native:"\u043F\u0443\u0441\u0442\u043E\u0435",normalized:"empty"}],nr=class extends Zt{constructor(){super(),this.language="ru",this.direction="ltr",this.initializeKeywordsFromProfile(je,ir),this.normalizer=new We;}tokenize(e){let t=[],r=0;for(;r<e.length;){if(U(e[r])){r++;continue}if(Ie(e[r])){let u=this.tryEventModifier(e,r);if(u){t.push(u),r=u.position.end;continue}if(this.tryPropertyAccess(e,r,t)){r++;continue}let o=this.trySelector(e,r);if(o){t.push(o),r=o.position.end;continue}}if(Be(e[r])){let u=this.tryString(e,r);if(u){t.push(u),r=u.position.end;continue}}if(Oe(e,r)){let u=this.tryUrl(e,r);if(u){t.push(u),r=u.position.end;continue}}if(I(e[r])||e[r]==="-"&&r+1<e.length&&I(e[r+1])){let u=this.extractNumber(e,r);if(u){t.push(u),r=u.position.end;continue}}let i=this.tryVariableRef(e,r);if(i){t.push(i),r=i.position.end;continue}if(tr(e[r])){let u=this.extractWord(e,r);if(u){t.push(u),r=u.position.end;continue}}let n=this.tryOperator(e,r);if(n){t.push(n),r=n.position.end;continue}r++;}return new Vt(t,"ru")}classifyToken(e){let t=e.toLowerCase();return Fe.has(t)?"particle":this.isKeyword(t)?"keyword":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":"identifier"}extractWord(e,t){let r=t,i="";for(;r<e.length&&rr(e[r]);)i+=e[r++];if(!i)return null;let n=i.toLowerCase();if(Fe.has(n))return k(i,"particle",C(t,r));let u=this.lookupKeyword(n);return u?k(i,"keyword",C(t,r),u.normalized):k(i,"identifier",C(t,r))}extractNumber(e,t){let r=t,i="";for((e[r]==="-"||e[r]==="+")&&(i+=e[r++]);r<e.length&&I(e[r]);)i+=e[r++];if(r<e.length&&e[r]===".")for(i+=e[r++];r<e.length&&I(e[r]);)i+=e[r++];let n=r;for(;n<e.length&&U(e[n]);)n++;let u=e.slice(n).toLowerCase();return u.startsWith("\u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434")||u.startsWith("\u043C\u0441")?u.startsWith("\u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434")?(i+="ms",r=n+11,u.length>11&&/[аы]/.test(u[11])&&r++):(i+="ms",r=n+2):u.startsWith("\u0441\u0435\u043A\u0443\u043D\u0434")||u.startsWith("\u0441\u0435\u043A")?u.startsWith("\u0441\u0435\u043A\u0443\u043D\u0434")?(i+="s",r=n+6,u.length>6&&/[аы]/.test(u[6])&&r++):(i+="s",r=n+3):u.startsWith("\u043C\u0438\u043D\u0443\u0442")||u.startsWith("\u043C\u0438\u043D")?u.startsWith("\u043C\u0438\u043D\u0443\u0442")?(i+="m",r=n+5,u.length>5&&/[аы]/.test(u[5])&&r++):(i+="m",r=n+3):u.startsWith("\u0447\u0430\u0441")?(i+="h",r=n+3,u.length>3&&u[3]==="\u0430"?r++:u.length>3&&u.slice(3,5)==="\u043E\u0432"&&(r+=2)):u.startsWith("ms")?(i+="ms",r=n+2):u.startsWith("s")&&!u.startsWith("se")&&(i+="s",r=n+1),!i||i==="-"||i==="+"?null:k(i,"literal",C(t,r))}},ur=new nr;qt("ru",ur,je);var or=new Map,sr=new Map,ar=new Map;function lr(e,t,r){or.set(e,t),sr.set(e,r),ar.delete(e);}var cr=class{constructor(e,t){this.pos=0,this.tokens=e,this.language=t;}peek(e=0){let t=this.pos+e;return t<0||t>=this.tokens.length?null:this.tokens[t]}advance(){if(this.isAtEnd())throw new 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){let t=[];for(;!this.isAtEnd()&&e(this.peek());)t.push(this.advance());return t}skipWhile(e){for(;!this.isAtEnd()&&e(this.peek());)this.advance();}};function z(e,t){return {start:e,end:t}}function T(e,t,r,i){if(typeof i=="string")return {value:e,kind:t,position:r,normalized:i};if(i){let{normalized:n,stem:u,stemConfidence:o}=i;return {value:e,kind:t,position:r,...n!==void 0&&{normalized:n},...u!==void 0&&{stem:u},...o!==void 0&&{stemConfidence:o}}}return {value:e,kind:t,position:r}}function K(e){return /\s/.test(e)}function Ue(e){return e==="#"||e==="."||e==="["||e==="@"||e==="*"||e==="<"}function Ke(e){return e==='"'||e==="'"||e==="`"||e==="\u300C"||e==="\u300D"}function B(e){return /\d/.test(e)}function dr(e){return /[a-zA-Z]/.test(e)}function N(e){return /[a-zA-Z0-9_-]/.test(e)}function fr(e){let t=i=>e.test(i);return {isLetter:t,isIdentifierChar:i=>t(i)||/[0-9_-]/.test(i)}}function mr(e,t){if(t>=e.length)return null;let r=e[t];if(!Ue(r))return null;let i=t,n="";if(r==="#"||r==="."){for(n+=e[i++];i<e.length&&N(e[i]);)n+=e[i++];if(n.length<=1)return null;if(i<e.length&&e[i]==="."&&r==="#"){let o=i+1;for(;o<e.length&&N(e[o]);)o++;if(o<e.length&&e[o]==="(")return n}}else if(r==="["){let u=1,o=false,s=null,a=false;for(n+=e[i++];i<e.length&&u>0;){let c=e[i];n+=c,a?a=false:c==="\\"?a=true:o?c===s&&(o=false,s=null):c==='"'||c==="'"||c==="`"?(o=true,s=c):c==="["?u++:c==="]"&&u--,i++;}if(u!==0)return null}else if(r==="@"){for(n+=e[i++];i<e.length&&N(e[i]);)n+=e[i++];if(n.length<=1)return null}else if(r==="*"){for(n+=e[i++];i<e.length&&N(e[i]);)n+=e[i++];if(n.length<=1)return null}else if(r==="<"){if(n+=e[i++],i>=e.length||!dr(e[i]))return null;for(;i<e.length&&N(e[i]);)n+=e[i++];for(;i<e.length;){let u=e[i];if(u==="."){if(n+=e[i++],i>=e.length||!N(e[i]))return null;for(;i<e.length&&N(e[i]);)n+=e[i++];}else if(u==="#"){if(n+=e[i++],i>=e.length||!N(e[i]))return null;for(;i<e.length&&N(e[i]);)n+=e[i++];}else if(u==="["){let o=1,s=false,a=null,c=false;for(n+=e[i++];i<e.length&&o>0;){let l=e[i];n+=l,c?c=false:l==="\\"?c=true:s?l===a&&(s=false,a=null):l==='"'||l==="'"||l==="`"?(s=true,a=l):l==="["?o++:l==="]"&&o--,i++;}if(o!==0)return null}else break}for(;i<e.length&&K(e[i]);)n+=e[i++];if(i<e.length&&e[i]==="/")for(n+=e[i++];i<e.length&&K(e[i]);)n+=e[i++];if(i>=e.length||e[i]!==">")return null;n+=e[i++];}return n||null}function pr(e,t){if(t>=e.length||e[t]!=="'"||t+1>=e.length||e[t+1].toLowerCase()!=="s")return false;if(t+2>=e.length)return true;let i=e[t+2];return K(i)||i==="*"||!N(i)}function hr(e,t){if(t>=e.length)return null;let r=e[t];if(!Ke(r)||r==="'"&&pr(e,t))return null;let n={'"':'"',"'":"'","`":"`","\u300C":"\u300D"}[r];if(!n)return null;let u=t+1,o=r,s=false;for(;u<e.length;){let a=e[u];if(o+=a,s)s=false;else if(a==="\\")s=true;else if(a===n)return o;u++;}return o}function Ge(e,t){if(t>=e.length)return false;let r=e[t],i=e[t+1]||"",n=e[t+2]||"";if(r==="/"&&i!=="/"&&/[a-zA-Z0-9._-]/.test(i)||r==="/"&&i==="/"&&/[a-zA-Z]/.test(n)||r==="."&&(i==="/"||i==="."&&n==="/"))return true;let u=e.slice(t,t+8).toLowerCase();return !!(u.startsWith("http://")||u.startsWith("https://"))}function vr(e,t){if(!Ge(e,t))return null;let r=t,i="",n=/[a-zA-Z0-9/:._\-?&=%@+~!$'()*,;[\]]/;for(;r<e.length;){let u=e[r];if(u==="#"){if(i.length>0&&/[a-zA-Z0-9/.]$/.test(i))for(i+=u,r++;r<e.length&&/[a-zA-Z0-9_-]/.test(e[r]);)i+=e[r++];break}if(n.test(u))i+=u,r++;else break}return i.length<2?null:i}function yr(e,t){if(t>=e.length)return null;let r=e[t];if(!B(r)&&r!=="-"&&r!=="+")return null;let i=t,n="";if((e[i]==="-"||e[i]==="+")&&(n+=e[i++]),i>=e.length||!B(e[i]))return null;for(;i<e.length&&B(e[i]);)n+=e[i++];if(i<e.length&&e[i]===".")for(n+=e[i++];i<e.length&&B(e[i]);)n+=e[i++];return i<e.length&&(e.slice(i,i+2)==="ms"?n+="ms":(e[i]==="s"||e[i]==="m"||e[i]==="h")&&(n+=e[i])),n}var He=class Qe{constructor(){this.profileKeywords=[],this.profileKeywordMap=new Map;}tryPropertyAccess(t,r,i){if(t[r]!==".")return false;let n=i[i.length-1],u=n&&n.position.end<r;if(n&&!u&&(n.kind==="identifier"||n.kind==="keyword"||n.kind==="selector"))return i.push(T(".","operator",z(r,r+1))),true;let a=r+1;for(;a<t.length&&N(t[a]);)a++;return a<t.length&&t[a]==="("?(i.push(T(".","operator",z(r,r+1))),true):false}initializeKeywordsFromProfile(t,r=[]){let i=new Map;if(t.keywords){for(let[n,u]of Object.entries(t.keywords))if(i.set(u.primary,{native:u.primary,normalized:u.normalized||n}),u.alternatives)for(let o of u.alternatives)i.set(o,{native:o,normalized:u.normalized||n});}if(t.references){for(let[n,u]of Object.entries(t.references))i.set(u,{native:u,normalized:n});for(let n of Object.keys(t.references))i.has(n)||i.set(n,{native:n,normalized:n});}if(t.roleMarkers){for(let[n,u]of Object.entries(t.roleMarkers))if(u.primary&&i.set(u.primary,{native:u.primary,normalized:n}),u.alternatives)for(let o of u.alternatives)i.set(o,{native:o,normalized:n});}for(let n of r)i.set(n.native,n);this.profileKeywords=Array.from(i.values()).sort((n,u)=>u.native.length-n.native.length),this.profileKeywordMap=new Map;for(let n of this.profileKeywords){this.profileKeywordMap.set(n.native.toLowerCase(),n);let u=this.removeDiacritics(n.native);u!==n.native&&!this.profileKeywordMap.has(u.toLowerCase())&&this.profileKeywordMap.set(u.toLowerCase(),n);}}removeDiacritics(t){return t.replace(/[\u064B-\u0652\u0670]/g,"")}tryProfileKeyword(t,r){for(let i of this.profileKeywords)if(t.slice(r).startsWith(i.native))return T(i.native,"keyword",z(r,r+i.native.length),i.normalized);return null}isKeywordStart(t,r){let i=t.slice(r);return this.profileKeywords.some(n=>i.startsWith(n.native))}lookupKeyword(t){return this.profileKeywordMap.get(t.toLowerCase())}isKeyword(t){return this.profileKeywordMap.has(t.toLowerCase())}setNormalizer(t){this.normalizer=t;}tryNormalize(t){if(!this.normalizer)return null;let r=this.normalizer.normalize(t);return r.stem!==t&&r.confidence>=.7?r:null}tryMorphKeywordMatch(t,r,i){let n=this.tryNormalize(t);if(!n)return null;let u=this.lookupKeyword(n.stem);if(!u)return null;let o={normalized:u.normalized,stem:n.stem,stemConfidence:n.confidence};return T(t,"keyword",z(r,i),o)}trySelector(t,r){let i=mr(t,r);return i?T(i,"selector",z(r,r+i.length)):null}tryEventModifier(t,r){if(t[r]!==".")return null;let i=t.slice(r).match(/^\.(?:once|debounce|throttle|queue)(?:\(([^)]+)\))?(?:\s|$|\.)/);if(!i)return null;let n=i[0].replace(/(\s|\.)$/,""),u=n.slice(1).split("(")[0],o=i[1];return {...T(n,"event-modifier",z(r,r+n.length)),metadata:{modifierName:u,value:o?u==="queue"?o:parseInt(o,10):void 0}}}tryString(t,r){let i=hr(t,r);return i?T(i,"literal",z(r,r+i.length)):null}tryNumber(t,r){let i=yr(t,r);return i?T(i,"literal",z(r,r+i.length)):null}tryMatchTimeUnit(t,r,i,n=false){let u=r;if(n)for(;u<t.length&&K(t[u]);)u++;let o=t.slice(u);for(let s of i){let a=o.slice(0,s.length);if(s.caseInsensitive?a.toLowerCase()===s.pattern.toLowerCase():a===s.pattern){if(s.notFollowedBy&&(o[s.length]||"")===s.notFollowedBy)continue;if(s.checkBoundary){let l=o[s.length]||"";if(N(l))continue}return {suffix:s.suffix,endPos:u+s.length}}}return null}parseBaseNumber(t,r,i=true){let n=r,u="";if(i&&(t[n]==="-"||t[n]==="+")&&(u+=t[n++]),n>=t.length||!B(t[n]))return null;for(;n<t.length&&B(t[n]);)u+=t[n++];if(n<t.length&&t[n]===".")for(u+=t[n++];n<t.length&&B(t[n]);)u+=t[n++];return !u||u==="-"||u==="+"?null:{number:u,endPos:n}}tryNumberWithTimeUnits(t,r,i,n={}){let{allowSign:u=true,skipWhitespace:o=false}=n,s=this.parseBaseNumber(t,r,u);if(!s)return null;let{number:a,endPos:c}=s,l=[...i,...Qe.STANDARD_TIME_UNITS],d=this.tryMatchTimeUnit(t,c,l,o);return d&&(a+=d.suffix,c=d.endPos),T(a,"literal",z(r,c))}tryUrl(t,r){let i=vr(t,r);return i?T(i,"url",z(r,r+i.length)):null}tryVariableRef(t,r){if(t[r]!==":"||r+1>=t.length||!N(t[r+1]))return null;let i=r+1;for(;i<t.length&&N(t[i]);)i++;let n=t.slice(r,i);return T(n,"identifier",z(r,i))}tryOperator(t,r){let i=t.slice(r,r+2);if(["==","!=","<=",">=","&&","||","->"].includes(i))return T(i,"operator",z(r,r+2));let n=t[r];return ["<",">","!","+","-","*","/","="].includes(n)?T(n,"operator",z(r,r+1)):["(",")","{","}",",",";",":"].includes(n)?T(n,"punctuation",z(r,r+1)):null}tryMultiCharParticle(t,r,i){for(let n of i)if(t.slice(r,r+n.length)===n)return T(n,"particle",z(r,r+n.length));return null}};He.STANDARD_TIME_UNITS=[{pattern:"ms",suffix:"ms",length:2},{pattern:"s",suffix:"s",length:1,checkBoundary:true},{pattern:"m",suffix:"m",length:1,checkBoundary:true,notFollowedBy:"s"},{pattern:"h",suffix:"h",length:1,checkBoundary:true}];var gr=He,Ye={code:"pl",name:"Polish",nativeName:"Polski",direction:"ltr",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:true,defaultVerbForm:"imperative",verb:{position:"start",subjectDrop:true,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"},possessive:{marker:"",markerPosition:"after-object",usePossessiveAdjectives:true,specialForms:{me:"m\xF3j",it:"jego",you:"tw\xF3j"},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\xF3rz",alternatives:["utworz","stw\xF3rz","stworz"],normalized:"make",form:"imperative"},clone:{primary:"sklonuj",alternatives:["kopiuj"],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:"pobierz",alternatives:["we\u017A","wez"],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:["kiedy","przy","na"],normalized:"on"},trigger:{primary:"wywo\u0142aj",alternatives:["wywolaj","wyzw\xF3l","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"},go:{primary:"id\u017A",alternatives:["idz","przejd\u017A","przejdz","nawiguj"],normalized:"go",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"},when:{primary:"kiedy",normalized:"when"},where:{primary:"gdzie",normalized:"where"},else:{primary:"inaczej",alternatives:["wpp"],normalized:"else"},repeat:{primary:"powt\xF3rz",alternatives:["powtorz"],normalized:"repeat",form:"imperative"},for:{primary:"dla",alternatives:["ka\u017Cdy","kazdy"],normalized:"for"},while:{primary:"dop\xF3ki",alternatives:["dopoki","podczas"],normalized:"while"},continue:{primary:"kontynuuj",alternatives:["dalej"],normalized:"continue",form:"imperative"},halt:{primary:"zatrzymaj",alternatives:["przerwij","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\xF3\u0107",alternatives:["zwroc"],normalized:"return",form:"imperative"},then:{primary:"wtedy",alternatives:["potem","nast\u0119pnie","nastepnie"],normalized:"then"},and:{primary:"i",alternatives:["oraz"],normalized:"and"},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"},hover:{primary:"najechaniu",alternatives:["hover"],normalized:"hover"},submit:{primary:"wys\u0142aniu",alternatives:["wyslaniu","submit"],normalized:"submit"},input:{primary:"wprowadzeniu",alternatives:["input"],normalized:"input"},change:{primary:"zmianie",alternatives:["zmiana"],normalized:"change"},until:{primary:"a\u017C",alternatives:["az","do"],normalized:"until"},event:{primary:"zdarzenie",normalized:"event"},from:{primary:"z",alternatives:["od","ze"],normalized:"from"}},eventHandler:{keyword:{primary:"gdy",alternatives:["kiedy","przy","na"],normalized:"on"},sourceMarker:{primary:"na",alternatives:["w","przy"],position:"before"},conditionalKeyword:{primary:"kiedy",alternatives:["gdy","je\u015Bli"]},eventMarker:{primary:"przy",alternatives:["na"],position:"before"},temporalMarkers:["kiedy","gdy","przy"]}};function $e(e){return {stem:e,confidence:1}}function F(e,t,r){return r?{stem:e,confidence:t,metadata:r}:{stem:e,confidence:t}}var qe=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\xF3rz","tworzy\u0107"],["utworz","tworzyc"],["stw\xF3rz","stwarza\u0107"],["stworz","stwarzac"],["skup","skupia\u0107"],["rozmyj","rozmywa\u0107"],["nawiguj","nawigowa\u0107"],["za\u0142aduj","\u0142adowa\u0107"],["zaladuj","ladowac"],["powt\xF3rz","powtarza\u0107"],["powtorz","powtarzac"],["kontynuuj","kontynuowa\u0107"],["zatrzymaj","zatrzymywa\u0107"],["przerwij","przerywa\u0107"],["rzu\u0107","rzuca\u0107"],["rzuc","rzucac"],["zwr\xF3\u0107","zwraca\u0107"],["zwroc","zwracac"],["inicjuj","inicjowa\u0107"],["zainstaluj","instalowa\u0107"],["zmierz","mierzy\u0107"]]),Xe=class{constructor(){this.language="pl";}isNormalizable(e){return e.length<3?false:/[a-zA-ZąęćńóśźżłĄĘĆŃÓŚŹŻŁ]/.test(e)}normalize(e){let t=e.toLowerCase();if(this.isInfinitive(t))return $e(t);let r=this.tryImperativeNormalization(t);if(r)return r;let i=this.tryPastTenseNormalization(t);if(i)return i;let n=this.tryPresentTenseNormalization(t);return n||$e(t)}isInfinitive(e){return ["a\u0107","e\u0107","i\u0107","y\u0107","\u0105\u0107","owa\u0107","iwa\u0107","ywa\u0107"].some(r=>e.endsWith(r))}tryImperativeNormalization(e){return qe.has(e)?F(qe.get(e),.95,{removedSuffixes:["imperative"],conjugationType:"imperative"}):e.endsWith("aj")?F(e.slice(0,-2)+"a\u0107",.8,{removedSuffixes:["aj"],conjugationType:"imperative"}):e.endsWith("uj")?F(e.slice(0,-2)+"owa\u0107",.8,{removedSuffixes:["uj"],conjugationType:"imperative"}):e.endsWith("ij")?F(e.slice(0,-2)+"i\u0107",.75,{removedSuffixes:["ij"],conjugationType:"imperative"}):null}tryPresentTenseNormalization(e){return e.endsWith("uj\u0119")||e.endsWith("uje")?F(e.slice(0,-3)+"owa\u0107",.85,{removedSuffixes:["uj\u0119"],conjugationType:"present"}):e.endsWith("am")&&e.length>3?F(e.slice(0,-2)+"a\u0107",.8,{removedSuffixes:["am"],conjugationType:"present"}):e.endsWith("em")&&e.length>3?F(e.slice(0,-2)+"e\u0107",.75,{removedSuffixes:["em"],conjugationType:"present"}):e.endsWith("\u0119")&&e.length>2?F(e.slice(0,-1)+"a\u0107",.7,{removedSuffixes:["\u0119"],conjugationType:"present"}):null}tryPastTenseNormalization(e){if(e.endsWith("a\u0142em")||e.endsWith("a\u0142am"))return F(e.slice(0,-4)+"a\u0107",.85,{removedSuffixes:[e.slice(-4)],conjugationType:"past"});if(e.endsWith("a\u0142")||e.endsWith("a\u0142a")){let t=e.endsWith("a\u0142a")?3:2;return F(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 F(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")){let t=e.endsWith("i\u0142a")||e.endsWith("ila")?3:2;return F(e.slice(0,-t)+"i\u0107",.8,{removedSuffixes:[e.slice(-t)],conjugationType:"past"})}return null}},{isLetter:Er,isIdentifierChar:Cr}=fr(/[a-zA-ZąęćńóśźżłĄĘĆŃÓŚŹŻŁ]/),Ve=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\xF3d","wsrod","obok","poza","wok\xF3\u0142","wokol","przeciw","ku"]),kr=[{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\xF3j",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\xF3\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"}],zr=class extends gr{constructor(){super(),this.language="pl",this.direction="ltr",this.initializeKeywordsFromProfile(Ye,kr),this.normalizer=new Xe;}tokenize(e){let t=[],r=0;for(;r<e.length;){if(K(e[r])){r++;continue}if(Ue(e[r])){let u=this.tryEventModifier(e,r);if(u){t.push(u),r=u.position.end;continue}if(this.tryPropertyAccess(e,r,t)){r++;continue}let o=this.trySelector(e,r);if(o){t.push(o),r=o.position.end;continue}}if(Ke(e[r])){let u=this.tryString(e,r);if(u){t.push(u),r=u.position.end;continue}}if(Ge(e,r)){let u=this.tryUrl(e,r);if(u){t.push(u),r=u.position.end;continue}}if(B(e[r])||e[r]==="-"&&r+1<e.length&&B(e[r+1])){let u=this.extractNumber(e,r);if(u){t.push(u),r=u.position.end;continue}}let i=this.tryVariableRef(e,r);if(i){t.push(i),r=i.position.end;continue}if(Er(e[r])){let u=this.extractWord(e,r);if(u){t.push(u),r=u.position.end;continue}}let n=this.tryOperator(e,r);if(n){t.push(n),r=n.position.end;continue}r++;}return new cr(t,"pl")}classifyToken(e){let t=e.toLowerCase();return Ve.has(t)?"particle":this.isKeyword(t)?"keyword":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":"identifier"}extractWord(e,t){let r=t,i="";for(;r<e.length&&Cr(e[r]);)i+=e[r++];if(!i)return null;let n=i.toLowerCase();if(Ve.has(n))return T(i,"particle",z(t,r));let u=this.lookupKeyword(n);return u?T(i,"keyword",z(t,r),u.normalized):T(i,"identifier",z(t,r))}extractNumber(e,t){let r=t,i="";for((e[r]==="-"||e[r]==="+")&&(i+=e[r++]);r<e.length&&B(e[r]);)i+=e[r++];if(r<e.length&&e[r]===".")for(i+=e[r++];r<e.length&&B(e[r]);)i+=e[r++];let n=r;for(;n<e.length&&K(e[n]);)n++;let u=e.slice(n).toLowerCase();return u.startsWith("milisekund")||u.startsWith("milisekunda")?(i+="ms",r=n+(u.startsWith("milisekundy")||u.startsWith("milisekunda")?11:10)):u.startsWith("sekund")||u.startsWith("sekunda")?(i+="s",r=n+(u.startsWith("sekundy")||u.startsWith("sekunda")?7:6)):u.startsWith("minut")||u.startsWith("minuta")?(i+="m",r=n+(u.startsWith("minuty")||u.startsWith("minuta")?6:5)):u.startsWith("godzin")||u.startsWith("godzina")?(i+="h",r=n+(u.startsWith("godziny")||u.startsWith("godzina")?7:6)):u.startsWith("ms")?(i+="ms",r=n+2):u.startsWith("s")&&!u.startsWith("se")&&(i+="s",r=n+1),!i||i==="-"||i==="+"?null:T(i,"literal",z(t,r))}},Tr=new zr;lr("pl",Tr,Ye);var wr=new Map,Ar=new Map,br=new Map;function Sr(e,t,r){wr.set(e,t),Ar.set(e,r),br.delete(e);}var xr=class{constructor(e,t){this.pos=0,this.tokens=e,this.language=t;}peek(e=0){let t=this.pos+e;return t<0||t>=this.tokens.length?null:this.tokens[t]}advance(){if(this.isAtEnd())throw new 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){let t=[];for(;!this.isAtEnd()&&e(this.peek());)t.push(this.advance());return t}skipWhile(e){for(;!this.isAtEnd()&&e(this.peek());)this.advance();}};function w(e,t){return {start:e,end:t}}function A(e,t,r,i){if(typeof i=="string")return {value:e,kind:t,position:r,normalized:i};if(i){let{normalized:n,stem:u,stemConfidence:o}=i;return {value:e,kind:t,position:r,...n!==void 0&&{normalized:n},...u!==void 0&&{stem:u},...o!==void 0&&{stemConfidence:o}}}return {value:e,kind:t,position:r}}function G(e){return /\s/.test(e)}function et(e){return e==="#"||e==="."||e==="["||e==="@"||e==="*"||e==="<"}function tt(e){return e==='"'||e==="'"||e==="`"||e==="\u300C"||e==="\u300D"}function O(e){return /\d/.test(e)}function Pr(e){return /[a-zA-Z]/.test(e)}function D(e){return /[a-zA-Z0-9_-]/.test(e)}function Rr(e){let t=i=>e.test(i);return {isLetter:t,isIdentifierChar:i=>t(i)||/[0-9_-]/.test(i)}}function Nr(e,t){if(t>=e.length)return null;let r=e[t];if(!et(r))return null;let i=t,n="";if(r==="#"||r==="."){for(n+=e[i++];i<e.length&&D(e[i]);)n+=e[i++];if(n.length<=1)return null;if(i<e.length&&e[i]==="."&&r==="#"){let o=i+1;for(;o<e.length&&D(e[o]);)o++;if(o<e.length&&e[o]==="(")return n}}else if(r==="["){let u=1,o=false,s=null,a=false;for(n+=e[i++];i<e.length&&u>0;){let c=e[i];n+=c,a?a=false:c==="\\"?a=true:o?c===s&&(o=false,s=null):c==='"'||c==="'"||c==="`"?(o=true,s=c):c==="["?u++:c==="]"&&u--,i++;}if(u!==0)return null}else if(r==="@"){for(n+=e[i++];i<e.length&&D(e[i]);)n+=e[i++];if(n.length<=1)return null}else if(r==="*"){for(n+=e[i++];i<e.length&&D(e[i]);)n+=e[i++];if(n.length<=1)return null}else if(r==="<"){if(n+=e[i++],i>=e.length||!Pr(e[i]))return null;for(;i<e.length&&D(e[i]);)n+=e[i++];for(;i<e.length;){let u=e[i];if(u==="."){if(n+=e[i++],i>=e.length||!D(e[i]))return null;for(;i<e.length&&D(e[i]);)n+=e[i++];}else if(u==="#"){if(n+=e[i++],i>=e.length||!D(e[i]))return null;for(;i<e.length&&D(e[i]);)n+=e[i++];}else if(u==="["){let o=1,s=false,a=null,c=false;for(n+=e[i++];i<e.length&&o>0;){let l=e[i];n+=l,c?c=false:l==="\\"?c=true:s?l===a&&(s=false,a=null):l==='"'||l==="'"||l==="`"?(s=true,a=l):l==="["?o++:l==="]"&&o--,i++;}if(o!==0)return null}else break}for(;i<e.length&&G(e[i]);)n+=e[i++];if(i<e.length&&e[i]==="/")for(n+=e[i++];i<e.length&&G(e[i]);)n+=e[i++];if(i>=e.length||e[i]!==">")return null;n+=e[i++];}return n||null}function Dr(e,t){if(t>=e.length||e[t]!=="'"||t+1>=e.length||e[t+1].toLowerCase()!=="s")return false;if(t+2>=e.length)return true;let i=e[t+2];return G(i)||i==="*"||!D(i)}function _r(e,t){if(t>=e.length)return null;let r=e[t];if(!tt(r)||r==="'"&&Dr(e,t))return null;let n={'"':'"',"'":"'","`":"`","\u300C":"\u300D"}[r];if(!n)return null;let u=t+1,o=r,s=false;for(;u<e.length;){let a=e[u];if(o+=a,s)s=false;else if(a==="\\")s=true;else if(a===n)return o;u++;}return o}function rt(e,t){if(t>=e.length)return false;let r=e[t],i=e[t+1]||"",n=e[t+2]||"";if(r==="/"&&i!=="/"&&/[a-zA-Z0-9._-]/.test(i)||r==="/"&&i==="/"&&/[a-zA-Z]/.test(n)||r==="."&&(i==="/"||i==="."&&n==="/"))return true;let u=e.slice(t,t+8).toLowerCase();return !!(u.startsWith("http://")||u.startsWith("https://"))}function Fr(e,t){if(!rt(e,t))return null;let r=t,i="",n=/[a-zA-Z0-9/:._\-?&=%@+~!$'()*,;[\]]/;for(;r<e.length;){let u=e[r];if(u==="#"){if(i.length>0&&/[a-zA-Z0-9/.]$/.test(i))for(i+=u,r++;r<e.length&&/[a-zA-Z0-9_-]/.test(e[r]);)i+=e[r++];break}if(n.test(u))i+=u,r++;else break}return i.length<2?null:i}function Ir(e,t){if(t>=e.length)return null;let r=e[t];if(!O(r)&&r!=="-"&&r!=="+")return null;let i=t,n="";if((e[i]==="-"||e[i]==="+")&&(n+=e[i++]),i>=e.length||!O(e[i]))return null;for(;i<e.length&&O(e[i]);)n+=e[i++];if(i<e.length&&e[i]===".")for(n+=e[i++];i<e.length&&O(e[i]);)n+=e[i++];return i<e.length&&(e.slice(i,i+2)==="ms"?n+="ms":(e[i]==="s"||e[i]==="m"||e[i]==="h")&&(n+=e[i])),n}var it=class nt{constructor(){this.profileKeywords=[],this.profileKeywordMap=new Map;}tryPropertyAccess(t,r,i){if(t[r]!==".")return false;let n=i[i.length-1],u=n&&n.position.end<r;if(n&&!u&&(n.kind==="identifier"||n.kind==="keyword"||n.kind==="selector"))return i.push(A(".","operator",w(r,r+1))),true;let a=r+1;for(;a<t.length&&D(t[a]);)a++;return a<t.length&&t[a]==="("?(i.push(A(".","operator",w(r,r+1))),true):false}initializeKeywordsFromProfile(t,r=[]){let i=new Map;if(t.keywords){for(let[n,u]of Object.entries(t.keywords))if(i.set(u.primary,{native:u.primary,normalized:u.normalized||n}),u.alternatives)for(let o of u.alternatives)i.set(o,{native:o,normalized:u.normalized||n});}if(t.references){for(let[n,u]of Object.entries(t.references))i.set(u,{native:u,normalized:n});for(let n of Object.keys(t.references))i.has(n)||i.set(n,{native:n,normalized:n});}if(t.roleMarkers){for(let[n,u]of Object.entries(t.roleMarkers))if(u.primary&&i.set(u.primary,{native:u.primary,normalized:n}),u.alternatives)for(let o of u.alternatives)i.set(o,{native:o,normalized:n});}for(let n of r)i.set(n.native,n);this.profileKeywords=Array.from(i.values()).sort((n,u)=>u.native.length-n.native.length),this.profileKeywordMap=new Map;for(let n of this.profileKeywords){this.profileKeywordMap.set(n.native.toLowerCase(),n);let u=this.removeDiacritics(n.native);u!==n.native&&!this.profileKeywordMap.has(u.toLowerCase())&&this.profileKeywordMap.set(u.toLowerCase(),n);}}removeDiacritics(t){return t.replace(/[\u064B-\u0652\u0670]/g,"")}tryProfileKeyword(t,r){for(let i of this.profileKeywords)if(t.slice(r).startsWith(i.native))return A(i.native,"keyword",w(r,r+i.native.length),i.normalized);return null}isKeywordStart(t,r){let i=t.slice(r);return this.profileKeywords.some(n=>i.startsWith(n.native))}lookupKeyword(t){return this.profileKeywordMap.get(t.toLowerCase())}isKeyword(t){return this.profileKeywordMap.has(t.toLowerCase())}setNormalizer(t){this.normalizer=t;}tryNormalize(t){if(!this.normalizer)return null;let r=this.normalizer.normalize(t);return r.stem!==t&&r.confidence>=.7?r:null}tryMorphKeywordMatch(t,r,i){let n=this.tryNormalize(t);if(!n)return null;let u=this.lookupKeyword(n.stem);if(!u)return null;let o={normalized:u.normalized,stem:n.stem,stemConfidence:n.confidence};return A(t,"keyword",w(r,i),o)}trySelector(t,r){let i=Nr(t,r);return i?A(i,"selector",w(r,r+i.length)):null}tryEventModifier(t,r){if(t[r]!==".")return null;let i=t.slice(r).match(/^\.(?:once|debounce|throttle|queue)(?:\(([^)]+)\))?(?:\s|$|\.)/);if(!i)return null;let n=i[0].replace(/(\s|\.)$/,""),u=n.slice(1).split("(")[0],o=i[1];return {...A(n,"event-modifier",w(r,r+n.length)),metadata:{modifierName:u,value:o?u==="queue"?o:parseInt(o,10):void 0}}}tryString(t,r){let i=_r(t,r);return i?A(i,"literal",w(r,r+i.length)):null}tryNumber(t,r){let i=Ir(t,r);return i?A(i,"literal",w(r,r+i.length)):null}tryMatchTimeUnit(t,r,i,n=false){let u=r;if(n)for(;u<t.length&&G(t[u]);)u++;let o=t.slice(u);for(let s of i){let a=o.slice(0,s.length);if(s.caseInsensitive?a.toLowerCase()===s.pattern.toLowerCase():a===s.pattern){if(s.notFollowedBy&&(o[s.length]||"")===s.notFollowedBy)continue;if(s.checkBoundary){let l=o[s.length]||"";if(D(l))continue}return {suffix:s.suffix,endPos:u+s.length}}}return null}parseBaseNumber(t,r,i=true){let n=r,u="";if(i&&(t[n]==="-"||t[n]==="+")&&(u+=t[n++]),n>=t.length||!O(t[n]))return null;for(;n<t.length&&O(t[n]);)u+=t[n++];if(n<t.length&&t[n]===".")for(u+=t[n++];n<t.length&&O(t[n]);)u+=t[n++];return !u||u==="-"||u==="+"?null:{number:u,endPos:n}}tryNumberWithTimeUnits(t,r,i,n={}){let{allowSign:u=true,skipWhitespace:o=false}=n,s=this.parseBaseNumber(t,r,u);if(!s)return null;let{number:a,endPos:c}=s,l=[...i,...nt.STANDARD_TIME_UNITS],d=this.tryMatchTimeUnit(t,c,l,o);return d&&(a+=d.suffix,c=d.endPos),A(a,"literal",w(r,c))}tryUrl(t,r){let i=Fr(t,r);return i?A(i,"url",w(r,r+i.length)):null}tryVariableRef(t,r){if(t[r]!==":"||r+1>=t.length||!D(t[r+1]))return null;let i=r+1;for(;i<t.length&&D(t[i]);)i++;let n=t.slice(r,i);return A(n,"identifier",w(r,i))}tryOperator(t,r){let i=t.slice(r,r+2);if(["==","!=","<=",">=","&&","||","->"].includes(i))return A(i,"operator",w(r,r+2));let n=t[r];return ["<",">","!","+","-","*","/","="].includes(n)?A(n,"operator",w(r,r+1)):["(",")","{","}",",",";",":"].includes(n)?A(n,"punctuation",w(r,r+1)):null}tryMultiCharParticle(t,r,i){for(let n of i)if(t.slice(r,r+n.length)===n)return A(n,"particle",w(r,r+n.length));return null}};it.STANDARD_TIME_UNITS=[{pattern:"ms",suffix:"ms",length:2},{pattern:"s",suffix:"s",length:1,checkBoundary:true},{pattern:"m",suffix:"m",length:1,checkBoundary:true,notFollowedBy:"s"},{pattern:"h",suffix:"h",length:1,checkBoundary:true}];var Br=it,ut={code:"uk",name:"Ukrainian",nativeName:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",direction:"ltr",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:true,defaultVerbForm:"infinitive",verb:{position:"start",subjectDrop:true,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:"body"},possessive:{marker:"",markerPosition:"after-object",usePossessiveAdjectives:true,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\u0434\u0430\u0442\u0438_\u0432_\u043A\u0456\u043D\u0435\u0446\u044C",alternatives:["\u0434\u043E\u043F\u0438\u0441\u0430\u0442\u0438"],normalized:"append",form:"infinitive"},prepend:{primary:"\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",alternatives:["\u043A\u043E\u043B\u0438"],normalized:"on"},trigger:{primary:"\u0432\u0438\u043A\u043B\u0438\u043A\u0430\u0442\u0438",alternatives:["\u0432\u0438\u043A\u043B\u0438\u0447"],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"},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"],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"},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"},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"},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"},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"},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:"\u0432\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0438_\u043F\u0430\u043A\u0435\u0442",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:"\u0434\u043E",alternatives:["\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"}},eventHandler:{keyword:{primary:"\u043F\u0440\u0438",alternatives:["\u043A\u043E\u043B\u0438"],normalized:"on"},sourceMarker:{primary:"\u043D\u0430",alternatives:["\u0432","\u043F\u0440\u0438"],position:"before"},eventMarker:{primary:"\u043F\u0440\u0438",alternatives:["\u043A\u043E\u043B\u0438"],position:"before"},temporalMarkers:["\u043A\u043E\u043B\u0438","\u044F\u043A\u0449\u043E"]}};function ie(e){return {stem:e,confidence:1}}function g(e,t,r){return r?{stem:e,confidence:t,metadata:r}:{stem:e,confidence:t}}function Or(e){return /[а-яА-ЯіІїЇєЄґҐьЬ']/.test(e)}var Ze=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"]]),ot=class{constructor(){this.language="uk";}isNormalizable(e){return e.length<3?false:Or(e)}normalize(e){let t=e.toLowerCase();if(t.endsWith("\u0441\u044F")||t.endsWith("\u0441\u044C")){let o=this.tryReflexiveNormalization(t);if(o)return o}if(t.endsWith("\u0442\u0438")||t.endsWith("\u0447\u0438"))return ie(e);let r=this.tryImperativeLookup(t);if(r)return r;let i=this.tryPastTenseNormalization(t);if(i)return i;let n=this.tryPresentTenseNormalization(t);if(n)return n;let u=this.tryGenericImperativeNormalization(t);return u||ie(e)}tryReflexiveNormalization(e){let t=e.slice(0,-2);if(e.endsWith("\u0442\u0438\u0441\u044F")||e.endsWith("\u0447\u0438\u0441\u044F"))return ie(e);let r=this.normalizeNonReflexive(t);if(r.confidence<1){let i=r.stem.endsWith("\u0442\u0438")?r.stem.slice(0,-2)+"\u0442\u0438\u0441\u044F":r.stem+"\u0441\u044F";return g(i,r.confidence*.95,{removedSuffixes:["\u0441\u044F",...r.metadata?.removedSuffixes||[]],conjugationType:"reflexive"})}return null}normalizeNonReflexive(e){if(e.endsWith("\u0442\u0438")||e.endsWith("\u0447\u0438"))return ie(e);let t=this.tryImperativeLookup(e);if(t)return t;let r=this.tryPastTenseNormalization(e);if(r)return r;let i=this.tryPresentTenseNormalization(e);if(i)return i;let n=this.tryGenericImperativeNormalization(e);return n||ie(e)}tryImperativeLookup(e){return Ze.has(e)?g(Ze.get(e),.95,{removedSuffixes:["imperative"],conjugationType:"imperative"}):null}tryGenericImperativeNormalization(e){return e.endsWith("\u0439\u0442\u0435")&&e.length>5?g(e.slice(0,-3)+"\u0442\u0438",.8,{removedSuffixes:["\u0439\u0442\u0435"],conjugationType:"imperative"}):e.endsWith("\u0456\u0442\u044C")&&e.length>5?g(e.slice(0,-3)+"\u0438\u0442\u0438",.8,{removedSuffixes:["\u0456\u0442\u044C"],conjugationType:"imperative"}):e.endsWith("\u0439")&&e.length>3?g(e.slice(0,-1)+"\u0442\u0438",.75,{removedSuffixes:["\u0439"],conjugationType:"imperative"}):e.endsWith("\u0438")&&e.length>3?g(e+"\u0442\u0438",.7,{removedSuffixes:["\u0438\u2192\u0438\u0442\u0438"],conjugationType:"imperative"}):null}tryPastTenseNormalization(e){return e.endsWith("\u0430\u043B\u0430")&&e.length>4?g(e.slice(0,-3)+"\u0430\u0442\u0438",.85,{removedSuffixes:["\u0430\u043B\u0430"],conjugationType:"past"}):e.endsWith("\u0438\u043B\u0430")&&e.length>4?g(e.slice(0,-3)+"\u0438\u0442\u0438",.85,{removedSuffixes:["\u0438\u043B\u0430"],conjugationType:"past"}):e.endsWith("\u0430\u043B\u0438")&&e.length>4?g(e.slice(0,-3)+"\u0430\u0442\u0438",.85,{removedSuffixes:["\u0430\u043B\u0438"],conjugationType:"past"}):e.endsWith("\u0438\u043B\u0438")&&e.length>4?g(e.slice(0,-3)+"\u0438\u0442\u0438",.85,{removedSuffixes:["\u0438\u043B\u0438"],conjugationType:"past"}):e.endsWith("\u0430\u0432")&&e.length>3?g(e.slice(0,-2)+"\u0430\u0442\u0438",.82,{removedSuffixes:["\u0430\u0432"],conjugationType:"past"}):e.endsWith("\u0438\u0432")&&e.length>3?g(e.slice(0,-2)+"\u0438\u0442\u0438",.82,{removedSuffixes:["\u0438\u0432"],conjugationType:"past"}):null}tryPresentTenseNormalization(e){return e.endsWith("\u0438\u0448")&&e.length>3?g(e.slice(0,-2)+"\u0438\u0442\u0438",.8,{removedSuffixes:["\u0438\u0448"],conjugationType:"present"}):e.endsWith("\u0438\u0442\u044C")&&e.length>4?g(e.slice(0,-3)+"\u0438\u0442\u0438",.78,{removedSuffixes:["\u0438\u0442\u044C"],conjugationType:"present"}):e.endsWith("\u0438\u043C\u043E")&&e.length>4?g(e.slice(0,-3)+"\u0438\u0442\u0438",.8,{removedSuffixes:["\u0438\u043C\u043E"],conjugationType:"present"}):e.endsWith("\u044F\u0442\u044C")&&e.length>4?g(e.slice(0,-3)+"\u0438\u0442\u0438",.78,{removedSuffixes:["\u044F\u0442\u044C"],conjugationType:"present"}):e.endsWith("\u0454\u0448")&&e.length>3?g(e.slice(0,-2)+"\u0430\u0442\u0438",.78,{removedSuffixes:["\u0454\u0448"],conjugationType:"present"}):e.endsWith("\u0435\u0448")&&e.length>3?g(e.slice(0,-2)+"\u0430\u0442\u0438",.75,{removedSuffixes:["\u0435\u0448"],conjugationType:"present"}):e.endsWith("\u0454")&&e.length>2?g(e.slice(0,-1)+"\u0430\u0442\u0438",.72,{removedSuffixes:["\u0454"],conjugationType:"present"}):e.endsWith("\u0454\u043C\u043E")&&e.length>4?g(e.slice(0,-3)+"\u0430\u0442\u0438",.8,{removedSuffixes:["\u0454\u043C\u043E"],conjugationType:"present"}):e.endsWith("\u044E\u0442\u044C")&&e.length>4?g(e.slice(0,-3)+"\u0430\u0442\u0438",.78,{removedSuffixes:["\u044E\u0442\u044C"],conjugationType:"present"}):e.endsWith("\u0443\u0442\u044C")&&e.length>4?g(e.slice(0,-3)+"\u0430\u0442\u0438",.75,{removedSuffixes:["\u0443\u0442\u044C"],conjugationType:"present"}):null}},{isLetter:Mr,isIdentifierChar:Lr}=Rr(/[a-zA-Zа-яА-ЯіІїЇєЄґҐьЬ']/),Je=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"]),jr=[{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:"\u043F\u0435\u0440\u0448\u0438\u0439",normalized:"first"},{native:"\u043F\u0435\u0440\u0448\u0430",normalized:"first"},{native:"\u043F\u0435\u0440\u0448\u0435",normalized:"first"},{native:"\u043E\u0441\u0442\u0430\u043D\u043D\u0456\u0439",normalized:"last"},{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\u0438\u0439",normalized:"next"},{native:"\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0430",normalized:"next"},{native:"\u043F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u0456\u0439",normalized:"previous"},{native:"\u043F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u044F",normalized:"previous"},{native:"\u043D\u0430\u0439\u0431\u043B\u0438\u0436\u0447\u0438\u0439",normalized:"closest"},{native:"\u0431\u0430\u0442\u044C\u043A\u043E",normalized:"parent"},{native:"\u043A\u043B\u0456\u043A",normalized:"click"},{native:"\u043D\u0430\u0442\u0438\u0441\u043A\u0430\u043D\u043D\u044F",normalized:"click"},{native:"click",normalized:"click"},{native:"\u0437\u043C\u0456\u043D\u0430",normalized:"change"},{native:"\u043D\u0430\u0434\u0441\u0438\u043B\u0430\u043D\u043D\u044F",normalized:"submit"},{native:"\u043A\u043B\u0430\u0432\u0456\u0448\u0430",normalized:"keydown"},{native:"\u043D\u0430\u0432\u0435\u0434\u0435\u043D\u043D\u044F",normalized:"mouseover"},{native:"\u0432\u0456\u0434\u0432\u0435\u0434\u0435\u043D\u043D\u044F",normalized:"mouseout"},{native:"\u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F",normalized:"load"},{native:"\u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0430",normalized:"scroll"},{native:"\u0432\u0432\u0435\u0434\u0435\u043D\u043D\u044F",normalized:"input"},{native:"\u043C\u0456\u0439",normalized:"my"},{native:"\u043C\u043E\u044F",normalized:"my"},{native:"\u043C\u043E\u0454",normalized:"my"},{native:"\u043C\u043E\u0457",normalized:"my"},{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:"\u0430\u0431\u043E",normalized:"or"},{native:"\u043D\u0435",normalized:"not"},{native:"\u0454",normalized:"is"},{native:"\u0456\u0441\u043D\u0443\u0454",normalized:"exists"},{native:"\u043F\u043E\u0440\u043E\u0436\u043D\u0456\u0439",normalized:"empty"},{native:"\u043F\u043E\u0440\u043E\u0436\u043D\u044F",normalized:"empty"},{native:"\u043F\u043E\u0440\u043E\u0436\u043D\u0454",normalized:"empty"}],Wr=class extends Br{constructor(){super(),this.language="uk",this.direction="ltr",this.initializeKeywordsFromProfile(ut,jr),this.normalizer=new ot;}tokenize(e){let t=[],r=0;for(;r<e.length;){if(G(e[r])){r++;continue}if(et(e[r])){let u=this.tryEventModifier(e,r);if(u){t.push(u),r=u.position.end;continue}if(this.tryPropertyAccess(e,r,t)){r++;continue}let o=this.trySelector(e,r);if(o){t.push(o),r=o.position.end;continue}}if(tt(e[r])){let u=this.tryString(e,r);if(u){t.push(u),r=u.position.end;continue}}if(rt(e,r)){let u=this.tryUrl(e,r);if(u){t.push(u),r=u.position.end;continue}}if(O(e[r])||e[r]==="-"&&r+1<e.length&&O(e[r+1])){let u=this.extractNumber(e,r);if(u){t.push(u),r=u.position.end;continue}}let i=this.tryVariableRef(e,r);if(i){t.push(i),r=i.position.end;continue}if(Mr(e[r])){let u=this.extractWord(e,r);if(u){t.push(u),r=u.position.end;continue}}let n=this.tryOperator(e,r);if(n){t.push(n),r=n.position.end;continue}r++;}return new xr(t,"uk")}classifyToken(e){let t=e.toLowerCase();return Je.has(t)?"particle":this.isKeyword(t)?"keyword":e.startsWith("#")||e.startsWith(".")||e.startsWith("[")||e.startsWith("*")||e.startsWith("<")?"selector":e.startsWith('"')||e.startsWith("'")||/^\d/.test(e)?"literal":"identifier"}extractWord(e,t){let r=t,i="";for(;r<e.length&&Lr(e[r]);)i+=e[r++];if(!i)return null;let n=i.toLowerCase();if(Je.has(n))return A(i,"particle",w(t,r));let u=this.lookupKeyword(n);return u?A(i,"keyword",w(t,r),u.normalized):A(i,"identifier",w(t,r))}extractNumber(e,t){let r=t,i="";for((e[r]==="-"||e[r]==="+")&&(i+=e[r++]);r<e.length&&O(e[r]);)i+=e[r++];if(r<e.length&&e[r]===".")for(i+=e[r++];r<e.length&&O(e[r]);)i+=e[r++];let n=r;for(;n<e.length&&G(e[n]);)n++;let u=e.slice(n).toLowerCase();return u.startsWith("\u043C\u0456\u043B\u0456\u0441\u0435\u043A\u0443\u043D\u0434")||u.startsWith("\u043C\u0441")?u.startsWith("\u043C\u0456\u043B\u0456\u0441\u0435\u043A\u0443\u043D\u0434")?(i+="ms",r=n+10,u.length>10&&/[аи]/.test(u[10])&&r++):(i+="ms",r=n+2):u.startsWith("\u0441\u0435\u043A\u0443\u043D\u0434")||u.startsWith("\u0441\u0435\u043A")?u.startsWith("\u0441\u0435\u043A\u0443\u043D\u0434")?(i+="s",r=n+6,u.length>6&&/[аи]/.test(u[6])&&r++):(i+="s",r=n+3):u.startsWith("\u0445\u0432\u0438\u043B\u0438\u043D")||u.startsWith("\u0445\u0432")?u.startsWith("\u0445\u0432\u0438\u043B\u0438\u043D")?(i+="m",r=n+6,u.length>6&&/[аи]/.test(u[6])&&r++):(i+="m",r=n+2):u.startsWith("\u0433\u043E\u0434\u0438\u043D")?(i+="h",r=n+5,u.length>5&&/[аи]/.test(u[5])&&r++):u.startsWith("ms")?(i+="ms",r=n+2):u.startsWith("s")&&!u.startsWith("se")&&(i+="s",r=n+1),!i||i==="-"||i==="+"?null:A(i,"literal",w(t,r))}},$r=new Wr;Sr("uk",$r,ut);var qr=Object.defineProperty,Vr=Object.getOwnPropertyNames,ht=(e,t)=>function(){return e&&(t=(0, e[Vr(e)[0]])(e=0)),t},Ur=(e,t)=>{for(var r in t)qr(e,r,{get:t[r],enumerable:true});};function st(e,t){return e.replace(/\{(\w+)\}/g,(r,i)=>String(t[i]??`{${i}}`))}function _(e,t,r={},i){let n=vt[e],u=st(n,r),o=yt[e],s=o?st(o,r):void 0;return {code:e,message:u,severity:t,...i&&{role:i},...s&&{suggestion:s}}}var h,vt,yt,Kr=ht({"src/generators/schema-error-codes.ts"(){h={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"},vt={[h.AMBIGUOUS_TYPE_LITERAL_SELECTOR]:"Role '{role}' accepts both 'literal' and 'selector'. This may cause ambiguous type inference for values starting with special characters (* . # etc.).",[h.TOO_MANY_EXPECTED_TYPES]:"Role '{role}' accepts {count} different types. This may make type inference unreliable.",[h.MULTI_TYPE_PATIENT_EXPECTED]:"Role '{role}' accepts multiple types (expected for {command} command).",[h.NO_REQUIRED_ROLES]:"Command has no required roles. Is this intentional?",[h.NO_REQUIRED_ROLES_EXPECTED]:"Command has no required roles (expected for {command}).",[h.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.",[h.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.",[h.EVENT_HANDLER_MISSING_EVENT]:"Event handler command should have an 'event' role to specify which event to listen for.",[h.EVENT_HANDLER_EVENT_NOT_REQUIRED]:"Event role should be required - every event handler needs an event to listen for.",[h.CONDITIONAL_MISSING_CONDITION]:"Conditional command should have a 'condition' role for the boolean expression.",[h.CONDITIONAL_CONDITION_NOT_REQUIRED]:"Condition role should be required - conditionals need a condition to evaluate.",[h.FOR_LOOP_MISSING_SOURCE]:"For-loop should have a 'source' role for the collection to iterate over.",[h.WHILE_LOOP_MISSING_CONDITION]:"While-loop should have a 'condition' role for the loop condition."},yt={[h.AMBIGUOUS_TYPE_LITERAL_SELECTOR]:"Consider being more specific about which type is expected, or use explicit type markers.",[h.TOO_MANY_EXPECTED_TYPES]:"Consider narrowing the accepted types to improve type inference reliability.",[h.TRANSITION_PATIENT_ACCEPTS_SELECTOR]:"Remove 'selector' from expectedTypes and only accept 'literal'.",[h.TRANSITION_MISSING_GOAL]:"Add a 'goal' role with expectedTypes ['literal', 'variable'].",[h.EVENT_HANDLER_MISSING_EVENT]:"Add an 'event' role with expectedTypes ['literal'].",[h.EVENT_HANDLER_EVENT_NOT_REQUIRED]:"Set required: true on the 'event' role.",[h.CONDITIONAL_MISSING_CONDITION]:"Add a 'condition' role with expectedTypes ['expression'].",[h.CONDITIONAL_CONDITION_NOT_REQUIRED]:"Set required: true on the 'condition' role.",[h.FOR_LOOP_MISSING_SOURCE]:"Add a 'source' role for the collection to iterate over.",[h.WHILE_LOOP_MISSING_CONDITION]:"Add a 'condition' role for the loop continuation condition."};}}),gt={};Ur(gt,{SchemaErrorCodes:()=>h,formatValidationResults:()=>Jr,getValidationStats:()=>ei,validateAllSchemas:()=>Zr,validateCommandSchema:()=>Et});function Gr(e,t){return {action:e,items:t,get notes(){return t.filter(r=>r.severity==="note").map(r=>r.message)},get warnings(){return t.filter(r=>r.severity==="warning").map(r=>r.message)},get errors(){return t.filter(r=>r.severity==="error").map(r=>r.message)}}}function Et(e){let t=[];for(let i of e.roles)i.expectedTypes.includes("literal")&&i.expectedTypes.includes("selector")&&(i.role==="patient"&&ke.has(e.action)?t.push(_(h.MULTI_TYPE_PATIENT_EXPECTED,"note",{role:i.role,command:e.action},i.role)):t.push(_(h.AMBIGUOUS_TYPE_LITERAL_SELECTOR,"warning",{role:i.role},i.role))),i.expectedTypes.length>3&&!ke.has(e.action)&&t.push(_(h.TOO_MANY_EXPECTED_TYPES,"warning",{role:i.role,count:i.expectedTypes.length},i.role));switch(e.action){case "transition":Hr(e,t);break;case "on":Qr(e,t);break;case "if":case "unless":Yr(e,t);break;case "repeat":case "for":case "while":Xr(e,t);break}return e.roles.filter(i=>i.required).length===0&&(Ct.has(e.action)?t.push(_(h.NO_REQUIRED_ROLES_EXPECTED,"note",{command:e.action})):t.push(_(h.NO_REQUIRED_ROLES,"warning",{}))),Gr(e.action,t)}function Hr(e,t){let r=e.roles.find(n=>n.role==="patient"),i=e.roles.find(n=>n.role==="goal");r&&r.expectedTypes.includes("selector")&&t.push(_(h.TRANSITION_PATIENT_ACCEPTS_SELECTOR,"warning",{},"patient")),r&&!i&&t.push(_(h.TRANSITION_MISSING_GOAL,"error",{}));}function Qr(e,t){let r=e.roles.find(i=>i.role==="event");r||t.push(_(h.EVENT_HANDLER_MISSING_EVENT,"warning",{})),r&&!r.required&&t.push(_(h.EVENT_HANDLER_EVENT_NOT_REQUIRED,"warning",{}));}function Yr(e,t){let r=e.roles.find(i=>i.role==="condition");r||t.push(_(h.CONDITIONAL_MISSING_CONDITION,"warning",{})),r&&!r.required&&t.push(_(h.CONDITIONAL_CONDITION_NOT_REQUIRED,"warning",{}));}function Xr(e,t){e.action==="for"?e.roles.find(i=>i.role==="source")||t.push(_(h.FOR_LOOP_MISSING_SOURCE,"warning",{})):e.action==="while"&&(e.roles.find(i=>i.role==="condition")||t.push(_(h.WHILE_LOOP_MISSING_CONDITION,"warning",{})));}function Zr(e,t={}){let r=new Map,{includeNotes:i=false}=t;for(let[n,u]of Object.entries(e)){let o=Et(u),s=o.items.some(c=>c.severity==="warning"||c.severity==="error"),a=i&&o.items.some(c=>c.severity==="note");(s||a)&&r.set(n,o);}return r}function Jr(e,t={}){let r=[],{showNotes:i=false,showCodes:n=true}=t;for(let[u,o]of e){let s=o.items.filter(l=>l.severity==="error"),a=o.items.filter(l=>l.severity==="warning"),c=o.items.filter(l=>l.severity==="note");if(s.length>0){r.push(` \u274C ${u}:`);for(let l of s){let d=n?` [${l.code}]`:"";r.push(` ERROR${d}: ${l.message}`),l.suggestion&&r.push(` \u{1F4A1} Suggestion: ${l.suggestion}`);}}if(a.length>0){r.push(` \u26A0\uFE0F ${u}:`);for(let l of a){let d=n?` [${l.code}]`:"";r.push(` ${d?`${l.code}: `:""}${l.message}`),l.suggestion&&r.push(` \u{1F4A1} ${l.suggestion}`);}}if(i&&c.length>0){r.push(` \u2139\uFE0F ${u}:`);for(let l of c){let d=n?` [${l.code}]`:"";r.push(` ${d?`${l.code}: `:""}${l.message}`);}}}return r.join(`
2
- `)}function ei(e){let t=0,r=0,i=0,n={};for(let u of e.values())for(let o of u.items)o.severity==="error"?t++:o.severity==="warning"?r++:o.severity==="note"&&i++,n[o.code]=(n[o.code]||0)+1;return {totalCommands:e.size,errors:t,warnings:r,notes:i,byCode:n}}var ke,Ct,ti=ht({"src/generators/schema-validator.ts"(){Kr(),ke=new Set(["put","append","prepend","log","throw","make","measure","return","swap","morph","beep","copy"]),Ct=new Set(["compound","else","halt","continue","async","init","settle","focus","blur","return","js","measure","break","exit","beep"]);}});function ue(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 S(e,t){let r={type:"literal",value:e};return t!==void 0?{type:"literal",value:e,dataType:t}:r}var ri=new Set(["me","you","it","result","event","target","body"]);function at(e){return ri.has(e)}function $(e){return {type:"reference",value:e}}function ge(e,t){return {type:"property-path",object:e,property:t}}function de(e,t,r){let i={kind:"command",action:e,roles:new Map(Object.entries(t))};return r!==void 0?{...i,metadata:r}:i}function lt(e,t,r,i,n,u){let o=new Map;o.set("event",e);let s={kind:"event-handler",action:"on",roles:o,body:t};return r!==void 0&&(s.eventModifiers=r),i!==void 0&&(s.metadata=i),s}function ct(e,t="then",r){let i={kind:"compound",action:"compound",roles:new Map,statements:e,chainType:t};return r!==void 0&&(i.metadata=r),i}function dt(e,t){return !t||t.length===0||t.includes(e)||t.includes("expression")?true:e==="property-path"?t.some(r=>["selector","reference","expression"].includes(r)):false}function ii(e,t){return e.possessive?.keywords?.[t]}var Y=new Map,X=new Map,fe=new Map,ze=null;function kt(e,t){let r={...e};for(let i of Object.keys(t)){let n=t[i],u=e[i];n!==void 0&&(typeof n=="object"&&n!==null&&!Array.isArray(n)&&typeof u=="object"&&u!==null&&!Array.isArray(u)?r[i]=kt(u,n):r[i]=n);}return r}function ni(e,t){return kt(e,t)}function we(e){if(!e.extends)return e;let t=X.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;let r=we(t);return ni(r,e)}function zt(e){ze=e;}var ft=new Map;function Z(e){return e.split("-")[0]}function J(e){return e.includes("-")}function ui(e){let t=Y.get(e);if(!t&&J(e)){let r=Z(e);t=Y.get(r);}if(!t){let r=Array.from(Y.keys()).join(", ");throw new Error(`Language '${e}' is not registered. Registered languages: ${r||"none"}. Import the language module first: import '@lokascript/semantic/languages/${e}';`)}return t}function oi(e){let t=X.get(e);if(!t&&J(e)){let r=Z(e);t=X.get(r);}if(!t){let r=Array.from(X.keys()).join(", ");throw new Error(`Language profile '${e}' is not registered. Registered languages: ${r||"none"}. Import the language module first: import '@lokascript/semantic/languages/${e}';`)}return we(t)}function si(e){let t=Y.get(e);return !t&&J(e)&&(t=Y.get(Z(e))),t}function q(e){let t=X.get(e);return !t&&J(e)&&(t=X.get(Z(e))),t?we(t):void 0}function Tt(){return Array.from(Y.keys())}function ai(e,t){return ui(t).tokenize(e)}function Q(e){let t=fe.get(e);if(!t&&J(e)&&(t=fe.get(Z(e))),t)return t;let r=ft.get(e);if(!r&&J(e)&&(r=ft.get(Z(e))),r)return fe.set(e,r),r;if(!ze)throw new Error(`No patterns registered for language '${e}'. Either import the language module or set a pattern generator.`);let i=oi(e),n=ze(i);return fe.set(e,n),n}var me=class ne{constructor(){this.stemMatchCount=0,this.totalKeywordMatches=0;}matchPattern(t,r){let i=t.mark(),n=new Map;if(this.currentProfile=q(r.language),this.stemMatchCount=0,this.totalKeywordMatches=0,!this.matchTokenSequence(t,r.template.tokens,n))return t.reset(i),null;let o=this.calculateConfidence(r,n);return this.applyExtractionRules(r,n),{pattern:r,captured:n,consumedTokens:t.position()-i.position,confidence:o}}matchBest(t,r){let i=[];for(let u of r){let o=t.mark(),s=this.matchPattern(t,u);s&&i.push(s),t.reset(o);}if(i.length===0)return null;i.sort((u,o)=>{let s=o.pattern.priority-u.pattern.priority;return s!==0?s:o.confidence-u.confidence});let n=i[0];return this.matchPattern(t,n.pattern),n}matchTokenSequence(t,r,i){let n=r[0],u=n?.type==="literal"&&(n.value==="and"||n.value==="then"||n.alternatives?.includes("and")||n.alternatives?.includes("then"));if(this.currentProfile?.code==="ar"&&!u)for(;t.peek()?.kind==="conjunction";)t.advance();for(let o of r)if(!this.matchPatternToken(t,o,i)){if(this.isOptional(o))continue;return false}return true}matchPatternToken(t,r,i){switch(r.type){case "literal":return this.matchLiteralToken(t,r);case "role":return this.matchRoleToken(t,r,i);case "group":return this.matchGroupToken(t,r,i);default:return false}}matchLiteralToken(t,r){let i=t.peek();if(!i)return false;let n=this.getMatchType(i,r.value);if(n!=="none")return this.totalKeywordMatches++,n==="stem"&&this.stemMatchCount++,t.advance(),true;if(r.alternatives)for(let u of r.alternatives){let o=this.getMatchType(i,u);if(o!=="none")return this.totalKeywordMatches++,o==="stem"&&this.stemMatchCount++,t.advance(),true}return false}matchRoleToken(t,r,i){this.skipNoiseWords(t);let n=t.peek();if(!n)return r.optional||false;let u=this.tryMatchPossessiveExpression(t);if(u)return r.expectedTypes&&r.expectedTypes.length>0&&!r.expectedTypes.includes(u.type)&&!r.expectedTypes.includes("expression")?r.optional||false:(i.set(r.role,u),true);let o=this.tryMatchMethodCallExpression(t);if(o)return r.expectedTypes&&r.expectedTypes.length>0&&!r.expectedTypes.includes(o.type)&&!r.expectedTypes.includes("expression")?r.optional||false:(i.set(r.role,o),true);let s=this.tryMatchPossessiveSelectorExpression(t);if(s)return r.expectedTypes&&r.expectedTypes.length>0&&!dt(s.type,r.expectedTypes)?r.optional||false:(i.set(r.role,s),true);let a=this.tryMatchPropertyAccessExpression(t);if(a)return r.expectedTypes&&r.expectedTypes.length>0&&!r.expectedTypes.includes(a.type)&&!r.expectedTypes.includes("expression")?r.optional||false:(i.set(r.role,a),true);let c=this.tryMatchSelectorPropertyExpression(t);if(c)return r.expectedTypes&&r.expectedTypes.length>0&&!dt(c.type,r.expectedTypes)?r.optional||false:(i.set(r.role,c),true);let l=this.tokenToSemanticValue(n);return !l||r.expectedTypes&&r.expectedTypes.length>0&&!r.expectedTypes.includes(l.type)?r.optional||false:(i.set(r.role,l),t.advance(),true)}tryMatchPossessiveExpression(t){let r=t.peek();if(!r||!this.currentProfile)return null;let i=(r.normalized||r.value).toLowerCase(),n=ii(this.currentProfile,i);if(!n)return null;let u=t.mark();t.advance();let o=t.peek();if(!o)return t.reset(u),null;if(o.kind==="identifier"||o.kind==="keyword"&&!this.isStructuralKeyword(o.value)||o.kind==="selector"&&o.value.startsWith("*")||o.kind==="selector"&&o.value.startsWith("@")||o.kind==="selector"&&o.value.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(o.value)){t.advance();let s=o.value;o.kind==="selector"&&s.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(s)&&(s=s.substring(1));let a=s;for(;t.peek()?.kind==="selector"&&t.peek().value.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(t.peek().value);)a+=t.peek().value,t.advance();let c=t.peek();return c?.kind==="literal"&&c.value.startsWith("(")&&(a+=c.value,t.advance()),ge($(n),a)}return t.reset(u),null}isStructuralKeyword(t){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(t.toLowerCase())}tryMatchMethodCallExpression(t){let r=t.peek();if(!r||r.kind!=="selector")return null;let i=t.mark();t.advance();let n=t.peek();if(!n||n.kind!=="operator"||n.value!==".")return t.reset(i),null;t.advance();let u=t.peek();if(!u||u.kind!=="identifier")return t.reset(i),null;t.advance();let o=t.peek();if(!o||o.kind!=="punctuation"||o.value!=="(")return t.reset(i),null;t.advance();let s=[];for(;!t.isAtEnd()&&s.length<ne.MAX_METHOD_ARGS;){let c=t.peek();if(!c)break;if(c.kind==="punctuation"&&c.value===")"){t.advance();break}if(c.kind==="punctuation"&&c.value===","){t.advance();continue}s.push(c.value),t.advance();}return {type:"expression",raw:`${r.value}.${u.value}(${s.join(", ")})`}}tryMatchPropertyAccessExpression(t){let r=t.peek();if(!r||r.kind!=="identifier"&&r.kind!=="keyword")return null;let i=t.mark();t.advance();let n=t.peek();if(!n||n.kind!=="operator"||n.value!==".")return t.reset(i),null;t.advance();let u=t.peek();if(!u||u.kind!=="identifier")return t.reset(i),null;t.advance();let o=`${r.value}.${u.value}`,s=1;for(;!t.isAtEnd()&&s<ne.MAX_PROPERTY_DEPTH;){let c=t.peek();if(!c||c.kind!=="operator"||c.value!==".")break;t.advance();let l=t.peek();if(!l||l.kind!=="identifier")break;t.advance(),o+=`.${l.value}`,s++;}let a=t.peek();if(a&&a.kind==="punctuation"&&a.value==="("){t.advance();let c=[],l=0;for(;!t.isAtEnd()&&c.length<ne.MAX_METHOD_ARGS;){let f=t.peek();if(!f)break;if(f.kind==="punctuation"&&f.value===")"){if(l===0){t.advance();break}l--;}if(f.kind==="punctuation"&&f.value==="("&&l++,f.kind==="punctuation"&&f.value===","){t.advance();continue}c.push(f.value),t.advance();}return {type:"expression",raw:`${o}(${c.join(", ")})`}}return {type:"expression",raw:o}}tryMatchPossessiveSelectorExpression(t){let r=t.peek();if(!r||r.kind!=="selector")return null;let i=t.mark();t.advance();let n=t.peek();if(!n||n.kind!=="punctuation"||n.value!=="'s")return t.reset(i),null;t.advance();let u=t.peek();return !u||u.kind!=="selector"&&u.kind!=="identifier"?(t.reset(i),null):(t.advance(),ge(ue(r.value),u.value))}tryMatchSelectorPropertyExpression(t){let r=t.peek();if(!r||r.kind!=="selector"||!r.value.startsWith("#"))return null;let i=t.mark();t.advance();let n=t.peek();if(!n||n.kind!=="selector"||!n.value.startsWith("."))return t.reset(i),null;let u=t.peek(1);u&&u.kind,t.advance();let o=n.value.slice(1);return ge(ue(r.value),o)}matchGroupToken(t,r,i){let n=t.mark(),u=new Set(i.keys());if(!this.matchTokenSequence(t,r.tokens,i)){t.reset(n);for(let s of i.keys())u.has(s)||i.delete(s);return r.optional||false}return true}getMatchType(t,r){return t.value===r?"exact":t.normalized===r?"normalized":t.stem===r&&t.stemConfidence!==void 0&&t.stemConfidence>=.7?"stem":t.kind==="keyword"&&t.value.toLowerCase()===r.toLowerCase()?"case-insensitive":"none"}tokenToSemanticValue(t){switch(t.kind){case "selector":return ue(t.value);case "literal":return this.parseLiteralValue(t.value);case "keyword":let r=(t.normalized||t.value).toLowerCase();return at(r)?$(r):S(t.normalized||t.value);case "identifier":if(t.value.startsWith(":"))return $(t.value);let i=t.value.toLowerCase();return at(i)?$(i):{type:"expression",raw:t.value};case "url":return S(t.value,"string");default:return null}}parseLiteralValue(t){if(t.startsWith('"')||t.startsWith("'")||t.startsWith("`")||t.startsWith("\u300C")){let n=t.slice(1,-1);return S(n,"string")}if(t==="true")return S(true,"boolean");if(t==="false")return S(false,"boolean");let r=t.match(/^(\d+(?:\.\d+)?)(ms|s|m|h)?$/);if(r){let n=parseFloat(r[1]);return r[2]?S(t,"duration"):S(n,"number")}let i=parseFloat(t);return isNaN(i)?S(t,"string"):S(i,"number")}applyExtractionRules(t,r){for(let[i,n]of Object.entries(t.extraction))r.has(i)||(n.value!==void 0?r.set(i,{type:"literal",value:n.value}):n.default&&r.set(i,n.default));}isOptional(t){return t.type!=="literal"&&t.optional===true}calculateConfidence(t,r){let i=0,n=0,u=c=>t.extraction?.[c]?.default!==void 0;for(let c of t.template.tokens)if(c.type==="role")n+=1,r.has(c.role)&&(i+=1);else if(c.type==="group"){for(let l of c.tokens)if(l.type==="role"){let d=u(l.role),f=.8;n+=f,r.has(l.role)?i+=f:d&&(i+=f*.6);}}let o=n>0?i/n:1;if(this.stemMatchCount>0&&this.totalKeywordMatches>0){let c=this.stemMatchCount/this.totalKeywordMatches*.15;o=Math.max(.5,o-c);}let s=this.calculateVSOConfidenceBoost(t);o=Math.min(1,o+s);let a=this.arabicPrepositionDisambiguation(t,r);return o=Math.max(0,Math.min(1,o+a)),o}calculateVSOConfidenceBoost(t){if(t.language!=="ar")return 0;let r=t.template.tokens[0];if(!r||r.type!=="literal")return 0;let i=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(i.has(r.value))return .15;if(r.alternatives){for(let n of r.alternatives)if(i.has(n))return .15}return 0}arabicPrepositionDisambiguation(t,r){if(t.language!=="ar")return 0;let i=0,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(let[u,o]of r.entries()){let s=n[u];if(!s||s.length===0)continue;let a="metadata"in o?o.metadata:void 0;if(a&&typeof a.prepositionValue=="string"){let c=a.prepositionValue;s.includes(c)?i+=.1:i-=.1;}}return Math.max(-0.1,Math.min(.1,i))}skipNoiseWords(t){let r=t.peek();if(!r)return;let i=r.value.toLowerCase();if(ne.ENGLISH_NOISE_WORDS.has(i)){let n=t.mark();t.advance();let u=t.peek();if(u&&u.kind==="selector")return;t.reset(n);}i==="class"&&t.advance();}extractEventModifiers(t){let r={},i=false;for(;!t.isAtEnd();){let n=t.peek();if(!n||n.kind!=="event-modifier")break;let u=n.metadata;if(!u)break;switch(i=true,u.modifierName){case "once":r.once=true;break;case "debounce":typeof u.value=="number"&&(r.debounce=u.value);break;case "throttle":typeof u.value=="number"&&(r.throttle=u.value);break;case "queue":(u.value==="first"||u.value==="last"||u.value==="all"||u.value==="none")&&(r.queue=u.value);break}t.advance();}return i?r:void 0}};me.MAX_PROPERTY_DEPTH=10;me.MAX_METHOD_ARGS=20;me.ENGLISH_NOISE_WORDS=new Set(["the","a","an"]);var wt=me,H=new wt,Ee=class{constructor(e,t){this.pos=0,this.tokens=e,this.language=t;}peek(e=0){let t=this.pos+e;return t<0||t>=this.tokens.length?null:this.tokens[t]}advance(){if(this.isAtEnd())throw new 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){let t=[];for(;!this.isAtEnd()&&e(this.peek());)t.push(this.advance());return t}skipWhile(e){for(;!this.isAtEnd()&&e(this.peek());)this.advance();}};function ci(e){return si(e)}function Ce(e,t){return ai(e,t)}function At(){return Tt()}var di={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"},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"},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"},es:{clic:"click",click:"click",entrada:"input",cambio:"change",env\u00EDo:"submit",enviar:"submit","tecla abajo":"keydown","tecla arriba":"keyup","rat\xF3n encima":"mouseover","rat\xF3n fuera":"mouseout",enfoque:"focus",desenfoque:"blur",carga:"load",desplazamiento:"scroll"},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",boyut_de\u011Fi\u015Ftir:"resize",kayd\u0131rma:"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"},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"},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"},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 \xFCber":"mouseover","maus raus":"mouseout",fokus:"focus",fokussieren:"focus",defokussieren:"blur",unsch\u00E4rfe:"blur",laden:"load",ladung:"load",scrollen:"scroll",bl\u00E4ttern:"scroll"},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"},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","\xF1it'iy":"click",\u00F1itiy:"click",yaykuchiy:"input",yaykuy:"input",tikray:"change","t'ikray":"change",apachiy:"submit",kachay:"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"}};var ee=class L{parse(t,r){let{modifiers:i,remainingInput:n}=this.extractStandaloneModifiers(t,r),u=n||t,o=Ce(u,r),s=Q(r);if(s.length===0)throw new Error(`No patterns available for language: ${r}`);let a=[...s].sort((v,x)=>x.priority-v.priority),c=a.filter(v=>v.command==="on"),l=H.matchBest(o,c);if(l){let v=this.buildEventHandler(l,o,r);return i?this.applyModifiers(v,i):v}let d=a.filter(v=>v.command!=="on"),f=H.matchBest(o,d);if(f)return this.buildCommand(f,r);let m=this.trySOVEventExtraction(u,r,a);if(m)return i?this.applyModifiers(m,i):m;let p=this.tryCompoundCommandParsing(o,d,r);if(p)return p;throw new Error(`Could not parse input in ${r}: ${u}`)}canParse(t,r){try{return this.parse(t,r),!0}catch{return false}}supportedLanguages(){return At()}buildCommand(t,r){if(!t)throw new Error("No match to build command from");let i={};for(let[n,u]of t.captured)i[n]=u;return de(t.pattern.command,i,{sourceLanguage:r,patternId:t.pattern.id,confidence:t.confidence})}buildEventHandler(t,r,i){if(!t)throw new Error("No match to build event handler from");let n=t.captured.get("event");if(!n)throw new Error("Event handler pattern matched but no event captured");let u=H.extractEventModifiers(r),o=this.extractOrConjunctionEvents(r,i),s=n;o.length>0&&n.type==="literal"&&(s={type:"literal",value:[String(n.value),...o.map(d=>String("value"in d?d.value:""))].join(" or ")});let a,c=t.captured.get("action");if(c&&c.type==="literal"){let l=c.value,d={};for(let[p,v]of t.captured)p!=="event"&&p!=="action"&&p!=="continues"&&(d[p]=v);let f=de(l,d,{sourceLanguage:i,patternId:t.pattern.id,confidence:t.confidence}),m=t.captured.get("continues");if(m&&m.type==="literal"&&m.value==="then"){let p=Q(i).filter(b=>b.command!=="on").sort((b,M)=>M.priority-b.priority),v=Q(i).filter(b=>b.id.startsWith("grammar-")&&b.id.includes("-continuation")).sort((b,M)=>M.priority-b.priority),x=this.parseBodyWithGrammarPatterns(r,p,v,i);x.length>0?a=[f,...x]:a=[f];}else a=[f];}else {let l=Q(i).filter(d=>d.command!=="on").sort((d,f)=>f.priority-d.priority);a=this.parseBodyWithClauses(r,l,i);}return lt(s,a,u,{sourceLanguage:i,patternId:t.pattern.id,confidence:t.confidence})}parseBodyWithClauses(t,r,i){let n=[],u=[];for(;!t.isAtEnd();){let o=t.peek();if(!o)break;let s=o.kind==="conjunction"||o.kind==="keyword"&&this.isThenKeyword(o.value,i),a=o.kind==="keyword"&&this.isEndKeyword(o.value,i);if(s){if(u.length>0){let c=this.parseClause(u,r,i);n.push(...c),u.length=0;}t.advance();continue}if(a){if(u.length>0){let c=this.parseClause(u,r,i);n.push(...c);}t.advance();break}u.push(o),t.advance();}if(u.length>0){let o=this.parseClause(u,r,i);n.push(...o);}return n.length>1?[ct(n,"then",{sourceLanguage:i})]:n}parseClause(t,r,i){if(t.length===0)return [];let n=new Ee(t,i),u=[];for(;!n.isAtEnd();){let o=H.matchBest(n,r);o?u.push(this.buildCommand(o,i)):n.advance();}if(u.length===0){let o=this.parseSOVClauseByVerbAnchoring(t,i);if(o.length>0)return o}return u}static buildVerbLookup(t){let r=new Map;for(let[i,n]of Object.entries(t.keywords))if(!["on","if","else","when","where","while","for","end","then","and"].includes(i)&&(r.set(n.primary.toLowerCase(),i),n.alternatives))for(let u of n.alternatives)r.set(u.toLowerCase(),i);return r}static buildMarkerToRoleLookup(t){let r=new Map;for(let[i,n]of Object.entries(t.roleMarkers))if(n&&(r.set(n.primary,i),n.alternatives))for(let u of n.alternatives)r.has(u)||r.set(u,i);return r}parseSOVClauseByVerbAnchoring(t,r){let i=q(r);if(!i||i.wordOrder!=="SOV")return [];let n=L.buildVerbLookup(i),u=L.buildMarkerToRoleLookup(i),o=[],s=0;for(;s<t.length;){let a=-1,c="";for(let p=s;p<t.length;p++){let v=t[p],x=n.get(v.value.toLowerCase()),b=v.normalized?n.get(v.normalized.toLowerCase()):void 0,M=x||b;if(M){a=p,c=M;break}}if(a===-1)break;let l=t.slice(s,a),d=t.length;for(let p=a+1;p<t.length;p++){let v=t[p];if(v.kind==="conjunction"||this.isThenKeyword(v.value,r)){d=p;break}if(p>a+1&&(n.get(v.value.toLowerCase())||(v.normalized?n.get(v.normalized.toLowerCase()):void 0))){d=p;break}}let f=t.slice(a+1,d),m=this.extractRolesFromMarkedTokens(l,f,u,c,r);if(o.push(de(c,m,{sourceLanguage:r,confidence:.7})),s=d,s<t.length){let p=t[s];(p.kind==="conjunction"||this.isThenKeyword(p.value,r))&&s++;}}return o}extractRolesFromMarkedTokens(t,r,i,n,u){let o={},s=a=>{let c=[];for(let l of a){let d=i.get(l.value);if(d&&l.kind==="particle"&&c.length>0){let f=this.tokensToSemanticValue(c);if(f){let m=this.mapRoleForCommand(d,n,o);m&&(o[m]=f);}c=[];}else c.push(l);}if(c.length>0){let l=this.tokensToSemanticValue(c);l&&(o.patient?o.destination||(o.destination=l):o.patient=l);}};return s(t),s(r),o}mapRoleForCommand(t,r,i){return i[t]?t==="patient"&&!i.destination?"destination":t==="destination"&&!i.patient?"patient":t==="source"&&!i.source?"source":null:t}tokensToSemanticValue(t){if(t.length===0)return null;let r=t.filter(u=>u.kind!=="whitespace");if(r.length===0)return null;if(r.length===1)return this.tokenToSemanticValue(r[0]);let i=r.map(u=>u.value).join(""),n=r[0];return n.kind==="selector"||n.value.startsWith("#")||n.value.startsWith(".")||n.value.startsWith("@")||n.value.startsWith("*")?ue(i):n.kind==="literal"||n.value.startsWith('"')||n.value.startsWith("'")?S(i):n.kind==="reference"?$(i):S(i)}tokenToSemanticValue(t){let r=t.value;if(t.kind==="selector"||r.startsWith("#")||r.startsWith(".")||r.startsWith("@")||r.startsWith("*"))return ue(r);if(r.startsWith('"')||r.startsWith("'"))return S(r);if(/^-?\d+(\.\d+)?$/.test(r))return S(parseFloat(r));if(r==="true"||r==="\u771F"||r==="\uCC38"||r==="do\u011Fru")return S(true);if(r==="false"||r==="\u507D"||r==="\uAC70\uC9D3"||r==="yanl\u0131\u015F")return S(false);let i=t.normalized?.toLowerCase();return i==="me"||i==="it"||i==="you"||i==="result"||i==="body"?$(i):t.kind==="reference"?$(t.normalized||"me"):S(r)}parseBodyWithGrammarPatterns(t,r,i,n){let u=[];for(;!t.isAtEnd();){let o=t.peek();if(o&&this.isThenKeyword(o.value,n)){t.advance();continue}if(o&&this.isEndKeyword(o.value,n)){t.advance();break}let s=false;if(i.length>0){let a=H.matchBest(t,i);if(a){let c=a.pattern.command,l={};for(let[m,p]of a.captured)m!=="event"&&m!=="action"&&m!=="continues"&&(l[m]=p);let d=de(c,l,{sourceLanguage:n,patternId:a.pattern.id});u.push(d),s=true;let f=a.captured.get("continues");if(f&&f.type==="literal"&&f.value==="then")continue}}if(!s){let a=H.matchBest(t,r);a&&(u.push(this.buildCommand(a,n)),s=true);}s||t.advance();}return u}tryCompoundCommandParsing(t,r,i){let n=t.tokens;if(!n.some(a=>a.kind==="conjunction"||a.kind==="keyword"&&this.isThenKeyword(a.value,i)))return null;let o=new Ee(n,i),s=this.parseBodyWithClauses(o,r,i);return s.length===0?null:s.length===1?s[0]:ct(s,"then",{sourceLanguage:i,confidence:.65})}trySOVEventExtraction(t,r,i){let n=L.SOV_EVENT_MARKERS[r];if(!n)return null;let o=Ce(t,r).tokens,s=di[r],a=new Set;if(s)for(let E of Object.keys(s))a.add(E.toLowerCase());let c=L.SOV_SOURCE_MARKERS[r],l=-1,d="",f="",m=1;for(let E=0;E<o.length;E++){let P=o[E],j=P.value.toLowerCase(),W=j,V="",he=j.indexOf("[");he>0&&(W=j.slice(0,he),V=P.value.slice(he));let ve=P.normalized?.toLowerCase(),Ne=ve&&L.KNOWN_EVENTS.has(ve),De=a.has(j)||a.has(W),Lt=L.KNOWN_EVENTS.has(W);if(Ne||De||Lt){let te;if(Ne?te=ve:De?te=s?.[j]??s?.[W]??W:te=W,n.size>0){let le=1,ye=o[E+1];ye&&ye.kind==="selector"&&ye.value.startsWith("[")&&(le=2);let ce=o[E+le];if(ce&&(ce.kind==="particle"||ce.kind==="keyword")&&n.has(ce.value)){l=E,d=te,f=V||(le===2?o[E+1].value:""),m=le+1;break}}else {l=E,d=te,f=V,m=1;break}}}if(l===-1)return null;let p=new Set;for(let E=l;E<l+m;E++)p.add(E);if(c){let E=l+m;if(E<o.length){let P=o[E];(P.kind==="particle"||P.kind==="keyword")&&c.markers.has(P.value)&&p.add(E);}for(let P=0;P<l;P++){let j=o[P],W=j.value.toLowerCase(),V=j.normalized?.toLowerCase();if(c.windowTokens.has(W)||V&&c.windowTokens.has(V)){p.add(P);break}}}let v=o.filter((E,P)=>!p.has(P));if(v.length===0)return null;let x=i.filter(E=>E.command!=="on"),b=new Ee(v,r),M=this.parseBodyWithClauses(b,x,r);if(M.length===0)return null;let Re={sourceLanguage:r,confidence:.75};return f&&(Re.keyFilter=f),lt({type:"literal",value:d},M,void 0,Re)}isThenKeyword(t,r){let i={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\xE9s"]),ko:new Set(["\uADF8\uB2E4\uC74C","\uADF8\uB9AC\uACE0","\uADF8\uB7F0\uD6C4","\uADF8\uB7EC\uBA74"]),zh:new Set(["\u7136\u540E","\u63A5\u7740","\u4E4B\u540E"]),tr:new Set(["sonra","ard\u0131ndan","daha sonra"]),pt:new Set(["ent\xE3o","depois","logo"]),fr:new Set(["puis","ensuite","alors"]),de:new Set(["dann","danach","anschlie\xDFend"]),id:new Set(["lalu","kemudian","setelah itu"]),tl:new Set(["pagkatapos","tapos"]),bn:new Set(["\u09A4\u09BE\u09B0\u09AA\u09B0","\u09AA\u09B0\u09C7"]),qu:new Set(["chaymantataq","hinaspa","chaymanta","chayqa"]),sw:new Set(["kisha","halafu","baadaye"])};return (i[r]||i.en).has(t.toLowerCase())}isEndKeyword(t,r){let i={en:new Set(["end"]),ja:new Set(["\u7D42\u308F\u308A","\u7D42\u4E86","\u304A\u308F\u308A"]),ar:new Set(["\u0646\u0647\u0627\u064A\u0629","\u0627\u0646\u062A\u0647\u0649","\u0622\u062E\u0631"]),es:new Set(["fin","final","terminar"]),ko:new Set(["\uB05D","\uC885\uB8CC","\uB9C8\uCE68"]),zh:new Set(["\u7ED3\u675F","\u7EC8\u6B62","\u5B8C"]),tr:new Set(["son","biti\u015F","bitti"]),pt:new Set(["fim","final","t\xE9rmino"]),fr:new Set(["fin","terminer","finir"]),de:new Set(["ende","beenden","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"])};return (i[r]||i.en).has(t.toLowerCase())}extractStandaloneModifiers(t,r){let n=Ce(t,r).tokens;if(n.length===0)return {modifiers:null,remainingInput:null};let o=n[0].value.toLowerCase(),s=L.STANDALONE_MODIFIERS[o];if(!s)return {modifiers:null,remainingInput:null};let a={},c=1;if(s==="once")a.once=true;else {let m=1;if(m<n.length){let p=n[m];(p.kind==="keyword"||p.kind==="particle")&&(m++,c++);}if(m<n.length){let p=n[m];if(p.kind==="literal"){let v=p.value.match(/^(\d+)(ms|s|m)?$/);if(v){let x=parseInt(v[1],10),b=v[2]||"ms";b==="s"?x*=1e3:b==="m"&&(x*=6e4),a[s]=x,c=m+1;}}}a[s]||(a[s]=s==="debounce"?300:100);}let l=n.slice(c);if(l.length===0)return {modifiers:null,remainingInput:null};let d=l[0].position.start,f=t.slice(d);return {modifiers:a,remainingInput:f}}applyModifiers(t,r){return {...t,eventModifiers:{...t.eventModifiers,...r}}}extractOrConjunctionEvents(t,r){let i=[];for(;;){let n=t.mark(),u=t.peek();if(!u)break;let o=(u.normalized||u.value).toLowerCase();if(!L.OR_KEYWORDS.has(o)){t.reset(n);break}t.advance();let s=t.peek();if(!s){t.reset(n);break}let a=(s.normalized||s.value).toLowerCase();t.advance(),i.push({type:"literal",value:a});}return i}};ee.KNOWN_EVENTS=new Set(["click","dblclick","input","change","submit","keydown","keyup","keypress","mouseover","mouseout","mousedown","mouseup","focus","blur","load","scroll","resize","contextmenu"]);ee.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"])};ee.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"])}};ee.STANDALONE_MODIFIERS={once:"once",debounced:"debounce",debounce:"debounce",throttled:"throttle",throttle:"throttle"};ee.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"]);var mi=ee,pi=new mi;function Ae(e,t){return pi.parse(e,t)}var Te=class{constructor(e={}){this.cache=new Map,this.config={maxSize:e.maxSize??1e3,ttlMs:e.ttlMs??0,enabled:e.enabled??true},this.stats={hits:0,misses:0,evictions:0,expirations:0};}makeKey(e,t){return `${t}:${e}`}isExpired(e){return this.config.ttlMs===0?false:Date.now()-e.createdAt>this.config.ttlMs}evictLRU(){let e=this.cache.keys().next().value;e!==void 0&&(this.cache.delete(e),this.stats.evictions++);}get(e,t){if(!this.config.enabled){this.stats.misses++;return}let r=this.makeKey(e,t),i=this.cache.get(r);if(!i){this.stats.misses++;return}if(this.isExpired(i)){this.cache.delete(r),this.stats.expirations++,this.stats.misses++;return}return this.cache.delete(r),i.lastAccessed=Date.now(),this.cache.set(r,i),this.stats.hits++,i.result}set(e,t,r){if(!this.config.enabled||r.confidence===0)return;let i=this.makeKey(e,t),n=Date.now();for(;this.cache.size>=this.config.maxSize;)this.evictLRU();this.cache.set(i,{result:r,createdAt:n,lastAccessed:n});}has(e,t){if(!this.config.enabled)return false;let r=this.makeKey(e,t),i=this.cache.get(r);return i?this.isExpired(i)?(this.cache.delete(r),this.stats.expirations++,false):true:false}delete(e,t){let 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(){let 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(e.maxSize!==void 0)for(this.config.maxSize=e.maxSize;this.cache.size>this.config.maxSize;)this.evictLRU();e.ttlMs!==void 0&&(this.config.ttlMs=e.ttlMs),e.enabled!==void 0&&(this.config.enabled=e.enabled);}enable(){this.config.enabled=true;}disable(){this.config.enabled=false;}getConfig(){return {...this.config}}},hi=new Te;var vi=class{constructor(e={}){this.patternMatcher=new wt,this.languages=new Set(Tt()),e.cache===false?this.cache=new Te({enabled:false}):this.cache=e.cache?new Te(e.cache):hi;}analyze(e,t){if(!this.supportsLanguage(t))return {confidence:0,errors:[`Language '${t}' is not supported for semantic parsing`]};let r=this.cache.get(e,t);if(r)return r;let i=this.analyzeUncached(e,t);return this.cache.set(e,t,i),i}analyzeUncached(e,t){try{try{let o=Ae(e,t),s={confidence:o.metadata?.confidence??.8,node:o};return o.kind==="command"?{...s,command:{name:o.action,roles:o.roles}}:s}catch{}let r=ci(t);if(!r)return {confidence:0,errors:[`No tokenizer available for language '${t}'`]};let i=r.tokenize(e),n=Q(t);if(n.length===0)return {confidence:0,errors:[`No patterns available for language '${t}'`]};let u=this.patternMatcher.matchBest(i,n);if(u){let o=this.buildSemanticNode(u);return {confidence:u.confidence,command:{name:u.pattern.command,roles:u.captured},node:o,tokensConsumed:u.consumedTokens}}return {confidence:0,errors:["No pattern matched the input"]}}catch(r){return {confidence:0,errors:[r instanceof Error?r.message:String(r)]}}}supportsLanguage(e){return this.languages.has(e)}supportedLanguages(){return Array.from(this.languages)}getCacheStats(){return this.cache.getStats()}clearCache(){this.cache.clear();}configureCache(e){this.cache.configure(e);}buildSemanticNode(e){return {kind:"command",action:e.pattern.command,roles:e.captured,metadata:{patternId:e.pattern.id}}}};function bt(e){return new vi(e)}var yi=.5;function St(e,t=yi){return e.confidence>=t&&e.command!==void 0}var gi={action:"toggle",description:"Toggle a class or attribute on/off",category:"dom-class",primaryRole:"patient",roles:[{role:"patient",description:"The class or attribute to toggle",required:true,expectedTypes:["selector"],svoPosition:1,sovPosition:2},{role:"destination",description:"The target element (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}],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)"}},Ei={action:"add",description:"Add a class or attribute to an element",category:"dom-class",primaryRole:"patient",roles:[{role:"patient",description:"The class or attribute to add",required:true,expectedTypes:["selector"],svoPosition:1,sovPosition:2},{role:"destination",description:"The target element (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1,markerOverride:{en:"to"}}],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"}},Ci={action:"remove",description:"Remove a class or attribute from an element",category:"dom-class",primaryRole:"patient",roles:[{role:"patient",description:"The class or attribute to remove",required:true,expectedTypes:["selector"],svoPosition:1,sovPosition:2},{role:"source",description:"The element to remove from (defaults to me)",required:false,expectedTypes:["selector","reference"],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"}},ki={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:true,expectedTypes:["literal","selector","reference","expression"],svoPosition:1,sovPosition:1},{role:"destination",description:"Where to put the content",required:true,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:2,markerOverride:{en:"into"}}],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"}},zi={action:"set",description:"Set a property or variable to a value",category:"variable",primaryRole:"destination",roles:[{role:"destination",description:"The property or variable to set",required:true,expectedTypes:["selector","reference","expression"],svoPosition:1,sovPosition:1,markerOverride:{en:"",ja:"\u3092",ko:"\uB97C",tr:"i",ar:"",sw:"",tl:"",bn:"\u0995\u09C7",qu:"ta"}},{role:"patient",description:"The value to set",required:true,expectedTypes:["literal","expression","reference"],svoPosition:2,sovPosition:2,markerOverride:{en:"to",es:"a",pt:"para",fr:"\xE0",de:"auf",id:"ke",ja:"\u306B",ko:"\uC73C\uB85C",tr:"e",ar:"\u0625\u0644\u0649",sw:"kwenye",tl:"sa",bn:"\u09A4\u09C7",qu:"man"}}],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>"}},Ti={action:"show",description:"Make an element visible",category:"dom-visibility",primaryRole:"patient",roles:[{role:"patient",description:"The element to show",required:true,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1},{role:"style",description:"Animation style (fade, slide, etc.)",required:false,expectedTypes:["literal"],svoPosition:2,sovPosition:2}]},wi={action:"hide",description:"Make an element invisible",category:"dom-visibility",primaryRole:"patient",roles:[{role:"patient",description:"The element to hide",required:true,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1},{role:"style",description:"Animation style (fade, slide, etc.)",required:false,expectedTypes:["literal"],svoPosition:2,sovPosition:2}]},Ai={action:"on",description:"Handle an event",category:"event",primaryRole:"event",hasBody:true,roles:[{role:"event",description:"The event to handle",required:true,expectedTypes:["literal"],svoPosition:1,sovPosition:2},{role:"source",description:"The element to listen on (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}]},bi={action:"trigger",description:"Trigger/dispatch an event",category:"event",primaryRole:"event",roles:[{role:"event",description:"The event to trigger (supports namespaced events like draggable:start)",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"The target element (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}]},Si={action:"wait",description:"Wait for a duration or event",category:"async",primaryRole:"patient",roles:[{role:"patient",description:"Duration or event to wait for",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1}]},xi={action:"fetch",description:"Fetch data from a URL",category:"async",primaryRole:"source",roles:[{role:"source",description:"The URL to fetch from",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1,renderOverride:{en:""}},{role:"responseType",description:"Response format (json, text, html, blob, etc.)",required:false,expectedTypes:["literal","expression"],svoPosition:2,sovPosition:2},{role:"method",description:"HTTP method (GET, POST, etc.)",required:false,expectedTypes:["literal"],svoPosition:3,sovPosition:3},{role:"destination",description:"Where to store the result",required:false,expectedTypes:["selector","reference"],svoPosition:4,sovPosition:4}]},Pi={action:"increment",description:"Increment a numeric value",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The value to increment",required:true,expectedTypes:["selector","reference","expression"],svoPosition:1,sovPosition:1},{role:"quantity",description:"Amount to increment by (defaults to 1)",required:false,expectedTypes:["literal"],default:{type:"literal",value:1,dataType:"number"},svoPosition:2,sovPosition:2,markerOverride:{en:"by"}}]},Ri={action:"decrement",description:"Decrement a numeric value",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The value to decrement",required:true,expectedTypes:["selector","reference","expression"],svoPosition:1,sovPosition:1},{role:"quantity",description:"Amount to decrement by (defaults to 1)",required:false,expectedTypes:["literal"],default:{type:"literal",value:1,dataType:"number"},svoPosition:2,sovPosition:2,markerOverride:{en:"by"}}]},Ni={action:"append",description:"Append content to an element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The content to append",required:true,expectedTypes:["literal","selector","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"The element to append to",required:true,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:1,markerOverride:{en:"to"}}]},Di={action:"prepend",description:"Prepend content to an element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The content to prepend",required:true,expectedTypes:["literal","selector","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"The element to prepend to",required:true,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:1,markerOverride:{en:"to"}}]},_i={action:"log",description:"Log a value to the console",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The value to log",required:true,expectedTypes:["literal","selector","reference","expression"],svoPosition:1,sovPosition:1}]},Fi={action:"get",description:"Get a value from a source",category:"variable",primaryRole:"source",roles:[{role:"source",description:"The source to get from",required:true,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:"",sw:"",tl:"",bn:"\u0995\u09C7",qu:"ta"}},{role:"destination",description:"Where to store the result (optional)",required:false,expectedTypes:["reference"],svoPosition:2,sovPosition:1}]},Ii={action:"take",description:"Take content from a source element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The class or element to take",required:true,expectedTypes:["selector"],svoPosition:1,sovPosition:2},{role:"source",description:"The element to take from (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}]},Bi={action:"make",description:"Create a new element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element type or selector to create",required:true,expectedTypes:["literal","selector"],svoPosition:1,sovPosition:1}]},Oi={action:"halt",description:"Halt/stop execution or event propagation",category:"control-flow",primaryRole:"patient",roles:[{role:"patient",description:"What to halt (event, default, bubbling, etc.)",required:false,expectedTypes:["literal","reference","expression"],svoPosition:1,sovPosition:1}]},Mi={action:"settle",description:"Wait for animations/transitions to settle",category:"async",primaryRole:"patient",roles:[{role:"patient",description:"The element to settle (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},Li={action:"throw",description:"Throw an error",category:"control-flow",primaryRole:"patient",roles:[{role:"patient",description:"The error message or object to throw",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1}]},ji={action:"send",description:"Send an event to an element",category:"event",primaryRole:"event",roles:[{role:"event",description:"The event to send",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"The target element (defaults to me)",required:false,expectedTypes:["selector","reference"],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:"\xE0",de:"an",id:"ke",qu:"-man",sw:"kwa"}}]},Wi={action:"if",description:"Conditional execution",category:"control-flow",primaryRole:"condition",hasBody:true,roles:[{role:"condition",description:"The condition to evaluate",required:true,expectedTypes:["expression"],svoPosition:1,sovPosition:1}]},$i={action:"unless",description:"Negated conditional execution (executes when condition is false)",category:"control-flow",primaryRole:"condition",hasBody:true,roles:[{role:"condition",description:"The condition to evaluate (body executes when false)",required:true,expectedTypes:["expression"],svoPosition:1,sovPosition:1}]},qi={action:"else",description:"Else branch of conditional",category:"control-flow",primaryRole:"patient",hasBody:true,roles:[]},Vi={action:"repeat",description:"Repeat a block of commands",category:"control-flow",primaryRole:"loopType",hasBody:true,roles:[{role:"loopType",description:"Loop variant: forever, times, for, while, until, until-event",required:true,expectedTypes:["literal"],svoPosition:0,sovPosition:0},{role:"quantity",description:"Number of times to repeat",required:false,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1},{role:"event",description:"Event to wait for (terminates loop)",required:false,expectedTypes:["literal","expression"],svoPosition:2,sovPosition:2},{role:"source",description:"Element to listen for event on",required:false,expectedTypes:["selector","reference"],svoPosition:3,sovPosition:3}],notes:'Can also use "repeat forever", "repeat until condition", or "repeat until event X from Y"'},Ui={action:"for",description:"Iterate over a collection",category:"control-flow",primaryRole:"patient",hasBody:true,roles:[{role:"patient",description:"The iteration variable",required:true,expectedTypes:["reference"],svoPosition:1,sovPosition:2},{role:"source",description:"The collection to iterate over",required:true,expectedTypes:["selector","reference","expression"],svoPosition:2,sovPosition:1,markerOverride:{en:"in"}}]},Ki={action:"while",description:"Loop while condition is true",category:"control-flow",primaryRole:"condition",hasBody:true,roles:[{role:"condition",description:"The condition to check",required:true,expectedTypes:["expression"],svoPosition:1,sovPosition:1}]},Gi={action:"continue",description:"Continue to next loop iteration",category:"control-flow",primaryRole:"patient",roles:[]},Hi={action:"go",description:"Navigate to a URL",category:"navigation",primaryRole:"destination",roles:[{role:"destination",description:"The URL to navigate to",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1,markerOverride:{en:"to"},renderOverride:{en:""}}]},Qi={action:"transition",description:"Transition an element with animation",category:"dom-visibility",primaryRole:"patient",roles:[{role:"patient",description:"The property to transition (opacity, *background-color, etc.)",required:true,expectedTypes:["literal"],svoPosition:1,sovPosition:2,markerOverride:{en:"",ar:"",tl:"",sw:""}},{role:"goal",description:"The target value to transition to",required:true,expectedTypes:["literal","expression"],svoPosition:2,sovPosition:3,markerOverride:{en:"to",ar:"\u0625\u0644\u0649",tl:"sa",sw:"kwenye",bn:"\u09A4\u09C7",qu:"man",es:"a",pt:"para",fr:"\xE0",de:"auf",ja:"\u306B",ko:"\uC73C\uB85C",tr:"e",id:"ke"}},{role:"destination",description:"The target element (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:3,sovPosition:1},{role:"duration",description:"Transition duration (over 500ms, for 2 seconds)",required:false,expectedTypes:["literal"],svoPosition:4,sovPosition:4,markerOverride:{en:"over"}},{role:"style",description:"Easing function (ease-in, linear, etc.)",required:false,expectedTypes:["literal"],svoPosition:5,sovPosition:5}]},Yi={action:"clone",description:"Clone an element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element to clone",required:true,expectedTypes:["selector","reference"],svoPosition:1,sovPosition:2},{role:"destination",description:"Where to put the clone",required:false,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:1,markerOverride:{en:"into"}}]},Xi={action:"focus",description:"Focus an element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element to focus (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},Zi={action:"blur",description:"Remove focus from an element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element to blur (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},Ji={action:"call",description:"Call a function",category:"control-flow",primaryRole:"patient",roles:[{role:"patient",description:"The function to call",required:true,expectedTypes:["expression","reference"],svoPosition:1,sovPosition:1}]},en={action:"return",description:"Return a value from a function",category:"control-flow",primaryRole:"patient",roles:[{role:"patient",description:"The value to return",required:false,expectedTypes:["literal","expression","reference"],svoPosition:1,sovPosition:1}]},tn={action:"js",description:"Execute raw JavaScript code",category:"control-flow",primaryRole:"patient",hasBody:true,roles:[{role:"patient",description:"The JavaScript code to execute",required:false,expectedTypes:["expression"],svoPosition:1,sovPosition:1}]},rn={action:"async",description:"Execute commands asynchronously",category:"async",primaryRole:"patient",hasBody:true,roles:[]},nn={action:"tell",description:"Execute commands in context of another element",category:"control-flow",primaryRole:"destination",hasBody:true,roles:[{role:"destination",description:"The element to tell",required:true,expectedTypes:["selector","reference"],svoPosition:1,sovPosition:1,markerOverride:{en:""}}]},un={action:"default",description:"Set a default value for a variable",category:"variable",primaryRole:"destination",roles:[{role:"destination",description:"The variable to set default for",required:true,expectedTypes:["reference"],svoPosition:1,sovPosition:1,markerOverride:{en:"",ar:"",tl:"",sw:"",bn:"\u0995\u09C7",qu:"ta"}},{role:"patient",description:"The default value",required:true,expectedTypes:["literal","expression"],svoPosition:2,sovPosition:2,markerOverride:{en:"to",ar:"\u0625\u0644\u0649",tl:"sa",sw:"kwenye",bn:"\u09A4\u09C7",qu:"man"}}]},on={action:"init",description:"Initialization block that runs once",category:"control-flow",primaryRole:"patient",hasBody:true,roles:[]},sn={action:"behavior",description:"Define a reusable behavior",category:"control-flow",primaryRole:"patient",hasBody:true,roles:[{role:"patient",description:"The behavior name (PascalCase identifier)",required:true,expectedTypes:["literal","reference","expression"],svoPosition:1,sovPosition:1}]},an={action:"install",description:"Install a behavior on an element",category:"control-flow",primaryRole:"patient",roles:[{role:"patient",description:"The behavior name to install",required:true,expectedTypes:["literal","reference","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"Element to install on (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}]},ln={action:"measure",description:"Measure element dimensions (x, y, width, height, etc.)",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"Property to measure (x, y, width, height, top, left, etc.)",required:false,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1},{role:"source",description:"Element to measure (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:2,markerOverride:{en:"of"}}]},cn={action:"swap",description:"Swap DOM content using various strategies (innerHTML, outerHTML, delete, etc.)",category:"dom-content",primaryRole:"destination",roles:[{role:"method",description:"The swap strategy (innerHTML, outerHTML, beforebegin, afterend, delete)",required:false,expectedTypes:["literal"],svoPosition:1,sovPosition:3,markerOverride:{en:""}},{role:"destination",description:"The element to swap content in/for",required:true,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:1,markerOverride:{en:"of"}},{role:"patient",description:"The content to swap in (optional for delete)",required:false,expectedTypes:["literal","expression","selector"],svoPosition:3,sovPosition:2,markerOverride:{en:"with"}}]},dn={action:"morph",description:"Morph an element into another using DOM diffing",category:"dom-content",primaryRole:"destination",roles:[{role:"destination",description:"The element to morph",required:true,expectedTypes:["selector","reference"],svoPosition:1,sovPosition:1,markerOverride:{en:""}},{role:"patient",description:"The target content/element to morph into",required:true,expectedTypes:["literal","expression","selector"],svoPosition:2,sovPosition:2,markerOverride:{en:"to"}}]},fn={action:"beep",description:"Debug output for expressions with type information",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The expression(s) to debug",required:false,expectedTypes:["literal","selector","reference","expression"],svoPosition:1,sovPosition:1}]},mn={action:"break",description:"Exit from the current loop",category:"control-flow",primaryRole:"patient",roles:[]},pn={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:true,expectedTypes:["literal","selector","reference","expression"],svoPosition:1,sovPosition:1}]},hn={action:"exit",description:"Exit from the current event handler",category:"control-flow",primaryRole:"patient",roles:[]},vn={action:"pick",description:"Select a random element from a collection",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The items to pick from",required:true,expectedTypes:["literal","expression","reference"],svoPosition:1,sovPosition:1},{role:"source",description:'The array to pick from (with "from" keyword)',required:false,expectedTypes:["reference","expression"],svoPosition:2,sovPosition:2}]},yn={action:"render",description:"Render a template with optional variables",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The template to render",required:true,expectedTypes:["selector","reference","expression"],svoPosition:1,sovPosition:2},{role:"style",description:"Variables to pass to the template (with keyword)",required:false,expectedTypes:["expression","reference"],svoPosition:2,sovPosition:1}]},xt={toggle:gi,add:Ei,remove:Ci,put:ki,set:zi,show:Ti,hide:wi,on:Ai,trigger:bi,wait:Si,fetch:xi,increment:Pi,decrement:Ri,append:Ni,prepend:Di,log:_i,get:Fi,take:Ii,make:Bi,halt:Oi,settle:Mi,throw:Li,send:ji,if:Wi,unless:$i,else:qi,repeat:Vi,for:Ui,while:Ki,continue:Gi,go:Hi,transition:Qi,clone:Yi,focus:Xi,blur:Zi,call:Ji,return:en,js:tn,async:rn,tell:nn,default:un,init:on,behavior:sn,install:an,measure:ln,swap:cn,morph:dn,beep:fn,break:mn,copy:pn,exit:hn,pick:vn,render:yn,compound:{action:"compound",description:"A compound node representing chained statements",primaryRole:"patient",category:"control-flow",hasBody:true,roles:[]}};function gn(){return Object.values(xt).filter(e=>e.roles.length>0)}typeof process<"u"&&process.env.NODE_ENV!=="production"&&Promise.resolve().then(()=>(ti(),gt)).then(({validateAllSchemas:e,formatValidationResults:t})=>{let r=e(xt);r.size>0&&(console.warn("[SCHEMA VALIDATION] Found issues in command schemas:"),console.warn(t(r)),console.warn(`
3
- These warnings help identify potential schema design issues.`),console.warn("Fix them to improve type inference and avoid runtime bugs."));}).catch(e=>{console.debug("Schema validation skipped:",e);});function Pt(e,t){let r=t==="SOV"?"sovPosition":"svoPosition";return [...e].sort((i,n)=>{let u=i[r]??99,o=n[r]??99;return u-o})}function En(e,t){let r=e.markerOverride?.[t.code],i=t.roleMarkers[e.role];if(r!==void 0)return {primary:r,position:i?.position??"before",isOverride:true};if(i&&i.primary){let n={primary:i.primary,position:i.position,isOverride:false};return i.alternatives&&(n.alternatives=i.alternatives),n}return null}function Cn(e,t,r,i,n){let u=[];if(u.push({type:"role",role:"event",optional:false}),i.position==="after"){let c=i.primary.split(/\s+/);if(c.length>1)for(let l of c)u.push({type:"literal",value:l});else {let l=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(l);}}let o=t.roleMarkers.destination;o&&u.push({type:"group",optional:true,tokens:[{type:"role",role:"destination",optional:true},o.alternatives?{type:"literal",value:o.primary,alternatives:o.alternatives}:{type:"literal",value:o.primary}]}),u.push({type:"role",role:"patient",optional:false});let s=t.roleMarkers.patient;if(s){let c=s.alternatives?{type:"literal",value:s.primary,alternatives:s.alternatives}:{type:"literal",value:s.primary};u.push(c);}let a=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};return u.push(a),{id:`${e.action}-event-${t.code}-sov`,language:t.code,command:"on",priority:(n.basePriority??100)+50,template:{format:`{event} ${i.primary} {destination?} {patient} ${s?.primary||""} ${r.primary}`,tokens:u},extraction:{action:{value:e.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}function kn(e,t,r,i,n){let u=[];u.push({type:"role",role:"patient",optional:false});let o=t.roleMarkers.patient;if(o){let a=o.alternatives?{type:"literal",value:o.primary,alternatives:o.alternatives}:{type:"literal",value:o.primary};u.push(a);}if(u.push({type:"role",role:"event",optional:false}),i.position==="after"){let a=i.primary.split(/\s+/);if(a.length>1)for(let c of a)u.push({type:"literal",value:c});else {let c=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(c);}}let s=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};return u.push(s),{id:`${e.action}-event-${t.code}-sov-patient-first`,language:t.code,command:"on",priority:(n.basePriority??100)+45,template:{format:`{patient} ${o?.primary||""} {event} ${i.primary} ${r.primary}`,tokens:u},extraction:{action:{value:e.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}function zn(e,t,r,i,n){let u=[];u.push({type:"role",role:"patient",optional:false});let o=t.roleMarkers.patient;if(o){let c=o.alternatives?{type:"literal",value:o.primary,alternatives:o.alternatives}:{type:"literal",value:o.primary};u.push(c);}let s=t.roleMarkers.destination;if(s&&(u.push({type:"role",role:"destination",optional:false}),u.push(s.alternatives?{type:"literal",value:s.primary,alternatives:s.alternatives}:{type:"literal",value:s.primary})),u.push({type:"role",role:"event",optional:false}),i.position==="after"){let c=i.primary.split(/\s+/);if(c.length>1)for(let l of c)u.push({type:"literal",value:l});else {let l=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(l);}}let a=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};return u.push(a),{id:`${e.action}-event-${t.code}-sov-patient-first-dest`,language:t.code,command:"on",priority:(n.basePriority??100)+40,template:{format:`{patient} ${o?.primary||""} {destination} ${s?.primary||""} {event} ${i.primary} ${r.primary}`,tokens:u},extraction:{action:{value:e.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination"}}}}function Tn(e,t,r,i,n){let u=[];u.push({type:"role",role:"event",optional:false});let o=i.alternatives?.filter(l=>!l.includes(" ")&&l.length>1)||[];o.length>0&&u.push({type:"literal",value:o[0],alternatives:o.slice(1)});let s=t.roleMarkers.destination;s&&u.push({type:"group",optional:true,tokens:[{type:"role",role:"destination",optional:true},s.alternatives?{type:"literal",value:s.primary,alternatives:s.alternatives}:{type:"literal",value:s.primary}]}),u.push({type:"role",role:"patient",optional:false});let a=t.roleMarkers.patient;if(a){let l=a.alternatives?{type:"literal",value:a.primary,alternatives:a.alternatives}:{type:"literal",value:a.primary};u.push(l);}let c=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};return u.push(c),{id:`${e.action}-event-${t.code}-sov-compact`,language:t.code,command:"on",priority:(n.basePriority??100)+52,template:{format:`{event}${o[0]||""} {patient} ${r.primary}`,tokens:u},extraction:{action:{value:e.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}function wn(e,t,r,i,n){let u=[];if(u.push({type:"role",role:"event",optional:false}),i.position==="after"){let s=i.primary.split(/\s+/);if(s.length>1)for(let a of s)u.push({type:"literal",value:a});else {let a=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(a);}}let o=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};return u.push(o),{id:`${e.action}-event-${t.code}-sov-simple`,language:t.code,command:"on",priority:(n.basePriority??100)+48,template:{format:`{event} ${i.primary} ${r.primary}`,tokens:u},extraction:{action:{value:e.action},event:{fromRole:"event"},patient:{default:{type:"reference",value:"me"}}}}}function An(e,t,r,i){let n=t.eventHandler?.temporalMarkers;if(!n||n.length===0)return null;let u=[];u.push({type:"role",role:"event",optional:false}),t.possessive?.marker&&u.push({type:"group",optional:true,tokens:[{type:"literal",value:t.possessive.marker}]}),u.push({type:"literal",value:n[0],alternatives:n.slice(1)}),u.push({type:"role",role:"patient",optional:false});let o=t.roleMarkers.patient;if(o?.primary){let a=o.alternatives?{type:"literal",value:o.primary,alternatives:o.alternatives}:{type:"literal",value:o.primary};u.push(a);}let s=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};return u.push(s),{id:`${e.action}-event-${t.code}-sov-temporal`,language:t.code,command:"on",priority:(i.basePriority??100)+49,template:{format:`{event} ${n[0]} {patient} ${r.primary}`,tokens:u},extraction:{action:{value:e.action},event:{fromRole:"event"},patient:{fromRole:"patient"}}}}function bn(e,t,r,i,n){let u=[];if(u.push({type:"role",role:"event",optional:false}),i.position==="after"){let l=i.primary.split(/\s+/);if(l.length>1)for(let d of l)u.push({type:"literal",value:d});else {let d=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(d);}}let s=[...e.roles.filter(l=>l.required)].sort((l,d)=>{let f=l.sovPosition??999,m=d.sovPosition??999;return f-m});for(let l of s){u.push({type:"role",role:l.role,optional:false});let d,f;if(l.markerOverride&&l.markerOverride[t.code]!==void 0)d=l.markerOverride[t.code];else {let m=t.roleMarkers[l.role];m&&(d=m.primary,f=m.alternatives);}if(d){let m=f?{type:"literal",value:d,alternatives:f}:{type:"literal",value:d};u.push(m);}}let a=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};u.push(a);let c=s.map(l=>`{${l.role}}`).join(" ");return {id:`${e.action}-event-${t.code}-sov-2role`,language:t.code,command:"on",priority:(n.basePriority??100)+55,template:{format:`{event} ${i.primary} ${c} ${r.primary}`,tokens:u},extraction:{action:{value:e.action},event:{fromRole:"event"},...Object.fromEntries(s.map(l=>[l.role,{fromRole:l.role}]))}}}function Sn(e,t,r,i,n){let u=[],s=[...e.roles.filter(p=>p.required)].sort((p,v)=>{let x=p.sovPosition??999,b=v.sovPosition??999;return x-b}),a=s[0];u.push({type:"role",role:a.role,optional:false});let c;if(a.markerOverride&&a.markerOverride[t.code]!==void 0)c=a.markerOverride[t.code];else {let p=t.roleMarkers[a.role];p&&(c=p.primary);}if(c&&u.push({type:"literal",value:c}),u.push({type:"role",role:"event",optional:false}),i.position==="after"){let p=i.primary.split(/\s+/);if(p.length>1)for(let v of p)u.push({type:"literal",value:v});else {let v=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(v);}}let l=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};u.push(l);let d=s[1];u.push({type:"role",role:d.role,optional:false});let f,m;if(d.markerOverride&&d.markerOverride[t.code]!==void 0)f=d.markerOverride[t.code];else {let p=t.roleMarkers[d.role];p&&(f=p.primary,m=p.alternatives);}if(f){let p=m?{type:"literal",value:f,alternatives:m}:{type:"literal",value:f};u.push(p);}return {id:`${e.action}-event-${t.code}-sov-2role-dest-first`,language:t.code,command:"on",priority:(n.basePriority??100)+48,template:{format:`{${a.role}} {event} ${i.primary} ${r.primary} {${d.role}}`,tokens:u},extraction:{action:{value:e.action},event:{fromRole:"event"},[a.role]:{fromRole:a.role},[d.role]:{fromRole:d.role}}}}function mt(e,t,r,i,n){let u=[];if(i.position==="before"){let a=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(a);}u.push({type:"role",role:"event",optional:false});let o=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};u.push(o),u.push({type:"role",role:"patient",optional:false});let s=t.roleMarkers.destination;return s&&u.push({type:"group",optional:true,tokens:[s.alternatives?{type:"literal",value:s.primary,alternatives:s.alternatives}:{type:"literal",value:s.primary},{type:"role",role:"destination",optional:true}]}),{id:`${e.action}-event-${t.code}-vso`,language:t.code,command:"on",priority:(n.basePriority??100)+50,template:{format:`${i.primary} {event} ${r.primary} {patient} ${s?.primary||""} {destination?}`,tokens:u},extraction:{action:{value:e.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}function xn(e,t,r,i,n){let u=[],o=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};u.push(o),u.push({type:"role",role:"patient",optional:false});let s=t.roleMarkers.destination;if(s&&u.push({type:"group",optional:true,tokens:[s.alternatives?{type:"literal",value:s.primary,alternatives:s.alternatives}:{type:"literal",value:s.primary},{type:"role",role:"destination",optional:true}]}),i.position==="before"){let a=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(a);}return u.push({type:"role",role:"event",optional:false}),{id:`${e.action}-event-${t.code}-vso-verb-first`,language:t.code,command:"on",priority:(n.basePriority??100)+45,template:{format:`${r.primary} {patient} ${s?.primary||""} {destination?} ${i.primary} {event}`,tokens:u},extraction:{action:{value:e.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}function Pn(e,t,r,i,n){let u=[],o=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};u.push(o);let a=[...e.roles.filter(l=>l.required)].sort((l,d)=>{let f=l.svoPosition??999,m=d.svoPosition??999;return f-m});for(let l of a){let d,f;if(l.markerOverride&&l.markerOverride[t.code]!==void 0)d=l.markerOverride[t.code];else {let m=t.roleMarkers[l.role];m&&(d=m.primary,f=m.alternatives);}if(d){let m=f?{type:"literal",value:d,alternatives:f}:{type:"literal",value:d};u.push(m);}u.push({type:"role",role:l.role,optional:false});}if(i.position==="before"){let l=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(l);}u.push({type:"role",role:"event",optional:false});let c=a.map(l=>`{${l.role}}`).join(" ");return {id:`${e.action}-event-${t.code}-vso-verb-first-2role`,language:t.code,command:"on",priority:(n.basePriority??100)+48,template:{format:`${r.primary} ${c} ${i.primary} {event}`,tokens:u},extraction:{action:{value:e.action},event:{fromRole:"event"},...Object.fromEntries(a.map(l=>[l.role,{fromRole:l.role}]))}}}function pt(e,t,r,i,n){let u=[];if(i.position==="before"){let l=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(l);}u.push({type:"role",role:"event",optional:false});let o=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};u.push(o);let a=[...e.roles.filter(l=>l.required)].sort((l,d)=>{let f=l.svoPosition??999,m=d.svoPosition??999;return f-m});for(let l of a){let d,f;if(l.markerOverride&&l.markerOverride[t.code]!==void 0)d=l.markerOverride[t.code];else {let m=t.roleMarkers[l.role];m&&(d=m.primary,f=m.alternatives);}if(d){let m=f?{type:"literal",value:d,alternatives:f}:{type:"literal",value:d};u.push(m);}u.push({type:"role",role:l.role,optional:false});}let c=a.map(l=>`{${l.role}}`).join(" ");return {id:`${e.action}-event-${t.code}-vso-2role`,language:t.code,command:"on",priority:(n.basePriority??100)+55,template:{format:`${i.primary} {event} ${r.primary} ${c}`,tokens:u},extraction:{action:{value:e.action},event:{fromRole:"event"},...Object.fromEntries(a.map(l=>[l.role,{fromRole:l.role}]))}}}function Rn(e,t,r,i,n){let u=[],o=t.eventHandler?.negationMarker;if(i.position==="before"){let c=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(c);}if(o){let c=o.alternatives?{type:"literal",value:o.primary,alternatives:o.alternatives}:{type:"literal",value:o.primary};u.push(c);}u.push({type:"role",role:"event",optional:false});let s=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};u.push(s),u.push({type:"role",role:"patient",optional:false});let a=t.roleMarkers.destination;return a&&u.push({type:"group",optional:true,tokens:[a.alternatives?{type:"literal",value:a.primary,alternatives:a.alternatives}:{type:"literal",value:a.primary},{type:"role",role:"destination",optional:true}]}),{id:`${e.action}-event-${t.code}-vso-negated`,language:t.code,command:"on",priority:(n.basePriority??100)+48,template:{format:`${i.primary} ${o?.primary||""} {event} ${r.primary} {patient} ${a?.primary||""} {destination?}`,tokens:u},extraction:{action:{value:e.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}function Nn(e,t,r,i){let n=[];n.push({type:"literal",value:"and",alternatives:["then"]}),n.push({type:"role",role:"event",optional:false});let u=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};n.push(u),n.push({type:"role",role:"patient",optional:false});let o=t.roleMarkers.destination;return o&&n.push({type:"group",optional:true,tokens:[o.alternatives?{type:"literal",value:o.primary,alternatives:o.alternatives}:{type:"literal",value:o.primary},{type:"role",role:"destination",optional:true}]}),{id:`${e.action}-event-${t.code}-vso-proclitic`,language:t.code,command:"on",priority:(i.basePriority??100)+45,template:{format:`[proclitic?] {event} ${r.primary} {patient} ${o?.primary||""} {destination?}`,tokens:n},extraction:{action:{value:e.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}var oe={basePriority:100,generateSimpleVariants:true,generateAlternatives:true};function Rt(e,t,r=oe){let i=`${e.action}-${t.code}-generated`,n=r.basePriority??100,u=t.keywords[e.action];if(!u)throw new Error(`No keyword translation for '${e.action}' in ${t.code}`);let o=In(e,t,u),s=Dt(e,t),a=Ln(e,t,u);return {id:i,language:t.code,command:e.action,priority:n,template:{format:a,tokens:o},extraction:s}}function Dn(e,t,r=oe){if(e.roles.filter(s=>!s.required).length===0)return null;let n=e.roles.filter(s=>s.required),u={...e,roles:n};return {...Rt(u,t,r),id:`${e.action}-${t.code}-simple`,priority:(r.basePriority??100)-5,extraction:Dt(e,t)}}function _n(e,t,r=oe){let i=[];if(i.push(Rt(e,t,r)),r.generateSimpleVariants){let n=Dn(e,t,r);n&&i.push(n);}return i}function Nt(e,t=oe){let r=[],i=gn();for(let n of i){if(!e.keywords[n.action])continue;let u=_n(n,e,t);if(r.push(...u),e.eventHandler?.eventMarker){let o=Fn(n,e,t);r.push(...o);}}return r}function Fn(e,t,r=oe){if(!t.eventHandler||!t.eventHandler.eventMarker)return [];let i=[],n=t.eventHandler.eventMarker,u=t.keywords[e.action];if(!u)return [];let s=e.roles.filter(a=>a.required).length===2;if(t.wordOrder==="SOV")if(s)i.push(bn(e,t,u,n,r)),i.push(Sn(e,t,u,n,r));else {i.push(Cn(e,t,u,n,r)),i.push(kn(e,t,u,n,r));let a=t.roleMarkers.destination;a&&a.primary!==n.primary&&i.push(zn(e,t,u,n,r));let c=n.primary.split(/\s+/),l=n.alternatives?.some(f=>!f.includes(" ")&&f.length>1);c.length>1&&l&&i.push(Tn(e,t,u,n,r)),i.push(wn(e,t,u,n,r));let d=An(e,t,u,r);d&&i.push(d);}else t.wordOrder==="VSO"?s?(i.push(pt(e,t,u,n,r)),i.push(Pn(e,t,u,n,r))):(i.push(mt(e,t,u,n,r)),i.push(xn(e,t,u,n,r)),t.eventHandler?.negationMarker&&i.push(Rn(e,t,u,n,r)),t.tokenization?.prefixes&&i.push(Nn(e,t,u,r))):s?i.push(pt(e,t,u,n,r)):i.push(mt(e,t,u,n,r));return i}function In(e,t,r){let i=[],n=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary},u=Bn(e,t);switch(t.wordOrder){case "SVO":i.push(n),i.push(...u);break;case "SOV":i.push(...u),i.push(n);break;case "VSO":i.push(n),i.push(...u);break;default:i.push(n),i.push(...u);}return i}function Bn(e,t){let r=[],i=Pt(e.roles,t.wordOrder);for(let n of i){let u=On(n,t);n.required?r.push(...u):r.push({type:"group",optional:true,tokens:u});}return r}function On(e,t){let r=[],i=e.markerOverride?.[t.code],n=t.roleMarkers[e.role],u={type:"role",role:e.role,optional:!e.required,expectedTypes:e.expectedTypes};if(i!==void 0)(n?.position??"before")==="before"?(i&&r.push({type:"literal",value:i}),r.push(u)):(r.push(u),i&&r.push({type:"literal",value:i}));else if(n)if(n.position==="before"){if(n.primary){let o=n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary};r.push(o);}r.push(u);}else {r.push(u);let o=n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary};r.push(o);}else r.push(u);return r}function Mn(e,t){let r={};for(let i of e.roles){let n=i.markerOverride?.[t.code],u=t.roleMarkers[i.role];n!==void 0?r[i.role]=n?{marker:n}:{}:u&&u.primary?r[i.role]=u.alternatives?{marker:u.primary,markerAlternatives:u.alternatives}:{marker:u.primary}:r[i.role]={};}return r}function Dt(e,t){let r=Mn(e,t),i={};for(let n of e.roles){let u=r[n.role]||{};!n.required&&n.default?i[n.role]={...u,default:n.default}:i[n.role]=u;}return i}function Ln(e,t,r){let i=[],u=Pt(e.roles,t.wordOrder).map(o=>{let s=En(o,t),a="";return s&&s.primary?s.position==="before"?a=`${s.primary} {${o.role}}`:a=`{${o.role}} ${s.primary}`:a=`{${o.role}}`,o.required?a:`[${a}]`});switch(t.wordOrder){case "SVO":case "VSO":i.push(r.primary,...u);break;case "SOV":i.push(...u,r.primary);break;default:i.push(r.primary,...u);}return i.join(" ")}function pe(e){let t=e.getAttribute("data-lang");if(t)return be(t);let r=e.getAttribute("data-hyperscript-lang")??e.closest?.("[data-hyperscript-lang]")?.getAttribute("data-hyperscript-lang");if(r)return be(r);let i=typeof document<"u"?document.documentElement?.lang:null;return i&&i!=="en"?be(i):null}function be(e){return e.split("-")[0].toLowerCase()}var _t={add:[["patient",""],["destination","to"]],append:[["patient",""],["destination","to"]],async:[],beep:[["patient",""]],behavior:[["patient",""]],blur:[["patient",""]],break:[],call:[["patient",""]],clone:[["patient",""],["destination","into"]],compound:[],continue:[],copy:[["patient",""]],decrement:[["patient",""],["quantity","by"]],default:[["destination",""],["patient","to"]],else:[],exit:[],fetch:[["source",""],["responseType","as"],["method","via"],["destination","on"]],focus:[["patient",""]],for:[["patient",""],["source","in"]],get:[["source",""],["destination","on"]],go:[["destination",""]],halt:[["patient",""]],hide:[["patient",""],["style","with"]],if:[["condition",""]],increment:[["patient",""],["quantity","by"]],init:[],install:[["patient",""],["destination","on"]],js:[["patient",""]],log:[["patient",""]],make:[["patient",""]],measure:[["patient",""],["source","of"]],morph:[["destination",""],["patient","to"]],on:[["event",""],["source","from"]],pick:[["patient",""],["source","from"]],prepend:[["patient",""],["destination","to"]],put:[["patient",""],["destination","into"]],remove:[["patient",""],["source","from"]],render:[["patient",""],["style","with"]],repeat:[["quantity",""],["condition","until"]],return:[["patient",""]],send:[["event",""],["destination","to"]],set:[["destination",""],["patient","to"]],settle:[["patient",""]],show:[["patient",""],["style","with"]],swap:[["method",""],["destination","of"],["patient","with"]],take:[["patient",""],["source","from"]],tell:[["destination",""]],throw:[["patient",""]],toggle:[["patient",""],["destination","on"]],transition:[["patient",""],["goal","to"],["destination","on"],["duration","over"],["style","with"]],trigger:[["event",""],["destination","on"]],unless:[["condition",""]],wait:[["patient",""]],while:[["condition",""]]};function ae(e){switch(e.kind){case "event-handler":return jn(e);case "compound":return Wn(e);default:return $n(e)}}function jn(e){let t=["on"],r=e.roles.get("event");r&&t.push(se(r));let i=e.roles.get("source");if(i&&t.push("from",se(i)),e.body&&e.body.length>0){let n=e.body.map(ae);t.push(n.join(" then "));}return t.join(" ")}function Wn(e){let t=e.chainType==="async"?"async":e.chainType;return e.statements.map(ae).join(` ${t} `)}function $n(e){let t=_t[e.action];if(t){let i=[e.action];for(let[n,u]of t){let o=e.roles.get(n);o&&(n==="destination"&&o.type==="reference"&&o.value==="me"||(u&&i.push(u),i.push(se(o))));}return i.join(" ")}let r=[e.action];for(let[,i]of e.roles)r.push(se(i));return r.join(" ")}function se(e){switch(e.type){case "literal":return typeof e.value=="string"&&e.dataType==="string"?`"${e.value}"`:String(e.value);case "selector":return e.value;case "reference":return e.value;case "property-path":return qn(e);case "expression":return e.raw}}function qn(e){let t=se(e.object),r=e.property;if(e.object.type==="reference")switch(e.object.value){case "me":return `my ${r}`;case "it":return `its ${r}`;case "you":return `your ${r}`}return `${t}'s ${r}`}var It=.5,Vn={confidenceThreshold:It,strategy:"semantic",fallbackToOriginal:true};function Un(e,t){return typeof e=="number"?e:e[t]??e["*"]??It}var Se=null;function Kn(){return Se||(Se=bt()),Se}function xe(e,t,r={}){let i={...Vn,...r},n=Ft(e,t,i);if(n!==null)return n;let u=Hn(e);if(u){let o=Ft(u.commands,t,i);if(o!==null)return u.prefix+o}return e}function Ft(e,t,r){if(r.strategy==="semantic"||r.strategy==="auto"){let i=Un(r.confidenceThreshold,t),n=Bt(e,t,i);if(n!==null)return n}if((r.strategy==="auto"||r.strategy==="i18n")&&r.i18nToEnglish){let i=Qn(e,t,r.i18nToEnglish);if(i!==null)return i}return null}var Gn=/^(on\s+(?:every\s+)?[\w-]+(?:\[.*?\])?(?:\.[\w-]+(?:\([^)]*\))?)*(?:\s+from\s+\S+)?(?:\s+queue\s+\w+)?\s+)/;function Hn(e){let t=e.match(Gn);if(!t)return null;let r=t[1],i=e.slice(r.length);return i?{prefix:r,commands:i}:null}function Bt(e,t,r){try{let i=Xn(e,t);if(i.length>1)return Zn(i,t,r);let n=Kn();if(!n.supportsLanguage(t))return null;let u=n.analyze(e,t);if(!St(u,r))return null;if(u.node)return ae(u.node);let o=Ae(e,t);return ae(o)}catch{return null}}function Qn(e,t,r){try{let i=r(e,t);return i!==e?i:null}catch{return null}}function Yn(e){let t=["then"],r=q(e);if(r?.keywords?.then){let i=r.keywords.then;if(i.primary&&i.primary!=="then"&&t.push(i.primary),i.alternatives)for(let n of i.alternatives)t.includes(n)||t.push(n);}return t}function Xn(e,t){let i=Yn(t).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),n=new RegExp(`\\s+(?:${i.join("|")})\\s+`,"i"),u=e.split(`
4
- `).map(s=>s.trim()).filter(s=>s.length>0),o=[];for(let s of u){let a=s.split(n);o.push(...a);}return o}function Zn(e,t,r){let i=[];for(let n of e){let u=Bt(n.trim(),t,r);if(u===null)return null;i.push(u);}return i.join(" then ")}function Pe(e={}){return function(r){let{internals:i}=r,n=i.runtime,u=n.getScript.bind(n);n.getScript=function(o){let s=u(o);if(!s)return null;let a=Jn(o,e);if(!a||a==="en")return s;let c=xe(s,a,e);return e.debug&&c!==s&&console.log(`[hyperscript-i18n] ${a}: "${s}" \u2192 "${c}"`),c};}}function Jn(e,t){if(t.languageAttribute){let i=e.getAttribute(t.languageAttribute);if(i)return i.split("-")[0].toLowerCase()}let r=pe(e);return r||(t.defaultLanguage??null)}function Ot(e,t,r={}){return t==="en"?e:xe(e,t,r)}zt(e=>Nt(e));function Mt(){typeof _hyperscript<"u"&&_hyperscript.use&&(_hyperscript.use(Pe()),eu());}function eu(){if(typeof document>"u")return;let t=_hyperscript?.internals?.runtime;if(!t?.processNode||!t?.getInternalData)return;let r=t.getScriptSelector?.()??"[_], [script], [data-script]";document.querySelectorAll(r).forEach(i=>{let n=t.getInternalData(i);n.initialized&&(n.initialized=false);}),t.processNode(document.body);}var Lu=["ru","pl","uk"];Mt();exports.plugin=Pe;exports.preprocess=Ot;exports.resolveLanguage=pe;exports.supportedLanguages=Lu;return exports;})({});
1
+ var HyperscriptI18n=(function(exports){'use strict';function P(t,e){return e?{type:"literal",value:t,dataType:e}:{type:"literal",value:t}}function ye(t,e){return e?{type:"selector",value:t,selectorKind:e}:{type:"selector",value:t}}function ae(t){return {type:"reference",value:t}}function ge(t,e){return {type:"property-path",object:t,property:e}}var Ot=class{constructor(t){this.namespace=t,this.enabled=this.checkEnabled();}checkEnabled(){if(typeof process<"u"&&process.env){let t=process.env.DEBUG||"";return t==="*"||t.includes("framework:*")||t.includes(`framework:${this.namespace}`)}return false}log(t,e,...r){if(!this.enabled)return;let n=`[framework:${this.namespace}]`,i=new Date().toISOString();switch(t){case "debug":console.debug(`${i} ${n} DEBUG:`,e,...r);break;case "info":console.info(`${i} ${n} INFO:`,e,...r);break;case "warn":console.warn(`${i} ${n} WARN:`,e,...r);break;case "error":console.error(`${i} ${n} ERROR:`,e,...r);break}}debug(t,...e){this.log("debug",t,...e);}info(t,...e){this.log("info",t,...e);}warn(t,...e){this.log("warn",t,...e);}error(t,...e){this.log("error",t,...e);}isEnabled(){return this.enabled}enable(){this.enabled=true;}disable(){this.enabled=false;}};function It(t){return new Ot(t)}function B(t,e){return !e||e.length===0||e.includes(t)||e.includes("expression")?true:t==="property-path"?e.some(r=>["selector","reference","expression"].includes(r)):false}function _t(t,e){return t?.possessive?.keywords?.[e]}var Q=class ${constructor(){this.logger=It("pattern-matcher"),this.stemMatchCount=0,this.totalKeywordMatches=0;}safeToLowerCase(e){return typeof e=="string"?e.toLowerCase():e==null?"":String(e).toLowerCase()}matchPattern(e,r,n){let i=e.mark(),o=new Map;if(this.logger.debug("========================================"),this.logger.debug("matchPattern ENTRY"),this.logger.debug("Pattern ID:",r.id),this.logger.debug("Pattern command:",r.command),this.logger.debug("Pattern language:",r.language),this.logger.debug("Pattern template:",JSON.stringify(r.template,null,2)),this.logger.isEnabled()){let a=[];for(let l=0;l<10;l++){let c=e.peek(l);if(c)a.push({type:c.type,value:c.value,kind:c.kind});else break}this.logger.debug("Input tokens (first 10):",a),this.logger.debug("Profile code:",n?.code);}this.currentProfile=n,this.stemMatchCount=0,this.totalKeywordMatches=0,this.logger.debug("--- Calling matchTokenSequence ---"),this.logger.debug("Pattern tokens to match:",JSON.stringify(r.template.tokens,null,2));let s=this.matchTokenSequence(e,r.template.tokens,o);if(this.logger.debug("matchTokenSequence returned:",s),this.logger.debug("Captured roles:",Array.from(o.entries()).map(([a,l])=>[a,JSON.stringify(l)])),!s)return this.logger.debug(">>> MATCH FAILED - resetting token position"),e.reset(i),null;let u=this.calculateConfidence(r,o);return this.applyExtractionRules(r,o),{pattern:r,captured:o,consumedTokens:e.position()-i.position,confidence:u}}matchBest(e,r,n){let i=[];for(let s of r){let u=e.mark(),a=this.matchPattern(e,s,n);a&&i.push(a),e.reset(u);}if(i.length===0)return null;i.sort((s,u)=>{let a=u.pattern.priority-s.pattern.priority;if(a!==0)return a;let l=u.confidence-s.confidence;return Math.abs(l)>.001?l:u.consumedTokens-s.consumedTokens});let o=i[0];return this.matchPattern(e,o.pattern),o}matchTokenSequence(e,r,n,i){let o=r[0],s=o?.type==="literal"&&(o.value==="and"||o.value==="then"||o.alternatives?.includes("and")||o.alternatives?.includes("then"));if(this.currentProfile?.code==="ar"&&!s)for(;e.peek()?.kind==="conjunction";)e.advance();let u=null,a=null;for(let l=0;l<r.length;l++){let c=r[l];this.logger.debug(" >> Matching pattern token:",JSON.stringify(c,null,2));let p=e.peek();if(this.logger.debug(" >> Current input token:",p?JSON.stringify({type:p.type,value:p.value,kind:p.kind}):"EOF"),c.type==="role"&&c.greedy){let y=this.collectStopMarkers(r,l+1);if(i)for(let w of i)y.add(w);let E=[];for(;!e.isAtEnd();){let w=e.peek();if(!w||this.isStopMarker(w,y))break;E.push(w.value),e.advance();}if(E.length>0){n.set(c.role,{type:"expression",raw:E.join(" ")}),u=null,a=null;continue}else {if(c.optional)continue;return false}}if(c.type==="group"){let y=this.collectStopMarkers(r,l+1);if(i)for(let w of i)y.add(w);if(this.matchGroupToken(e,c,n,y)){u=null,a=null;continue}if(this.isOptional(c))continue;return false}let d=c.type==="role"&&c.optional===true,f=d?e.mark():null;if(c.type==="role"&&!d){let y=l+1<r.length?r[l+1]:null;if(y?.type==="literal"){let E=e.peek();if(E&&this.getMatchType(E,y.value)!=="none"){if(this.logger.debug(" >> MARKER-STEAL GUARD: current token matches next literal, skipping role"),this.logger.debug(" >> Token match FAILED"),this.isOptional(c))continue;if(u&&a){this.logger.debug(" >> BACKTRACKING: undoing optional role",a),e.reset(u),n.delete(a),u=null,a=null;let w=this.matchPatternToken(e,c,n);if(this.logger.debug(" >> Backtrack retry result:",w),w)continue}return false}}}let g=this.matchPatternToken(e,c,n);if(this.logger.debug(" >> Match result:",g),g){d?(u=f,a=c.role):(u=null,a=null);continue}if(this.logger.debug(" >> Token match FAILED"),!this.isOptional(c)){if(u&&a){this.logger.debug(" >> BACKTRACKING: undoing optional role",a),e.reset(u),n.delete(a),u=null,a=null;let y=this.matchPatternToken(e,c,n);if(this.logger.debug(" >> Backtrack retry result:",y),y)continue}return false}}return true}matchPatternToken(e,r,n){switch(r.type){case "literal":return this.matchLiteralToken(e,r);case "role":return this.matchRoleToken(e,r,n);case "group":return this.matchGroupToken(e,r,n);default:return false}}matchLiteralToken(e,r){let n=e.peek();if(this.logger.debug(" >>> matchLiteralToken: expecting",r.value),this.logger.debug(" >>> matchLiteralToken: got token",n?JSON.stringify({type:n.type,value:n.value,kind:n.kind}):"null"),!n)return this.logger.debug(" >>> matchLiteralToken: FAIL - no token"),false;let i=this.getMatchType(n,r.value);if(this.logger.debug(" >>> matchType for",n.value,"vs",r.value,":",i),i!=="none")return this.totalKeywordMatches++,i==="stem"&&this.stemMatchCount++,e.advance(),true;if(r.alternatives)for(let o of r.alternatives){let s=this.getMatchType(n,o);if(s!=="none")return this.totalKeywordMatches++,s==="stem"&&this.stemMatchCount++,e.advance(),true}return false}matchRoleToken(e,r,n){this.logger.debug(" >>> matchRoleToken ENTRY: capturing role",r.role),this.logger.debug(" >>> matchRoleToken: expected types",r.expectedTypes),this.logger.debug(" >>> matchRoleToken: optional?",r.optional),this.skipNoiseWords(e);let i=e.peek();if(this.logger.debug(" >>> After skipNoiseWords, current token:",i?JSON.stringify({value:i.value,kind:i.kind}):"null"),!i)return r.optional||false;let o=this.tryMatchPossessiveExpression(e);if(o)return r.expectedTypes&&r.expectedTypes.length>0&&!B(o.type,r.expectedTypes)?r.optional||false:(n.set(r.role,o),true);let s=this.tryMatchMethodCallExpression(e);if(s)return r.expectedTypes&&r.expectedTypes.length>0&&!B(s.type,r.expectedTypes)?r.optional||false:(n.set(r.role,s),true);let u=this.tryMatchPossessiveSelectorExpression(e);if(u)return r.expectedTypes&&r.expectedTypes.length>0&&!B(u.type,r.expectedTypes)?r.optional||false:(n.set(r.role,u),true);let a=this.tryMatchPropertyAccessExpression(e);if(a)return r.expectedTypes&&r.expectedTypes.length>0&&!B(a.type,r.expectedTypes)?r.optional||false:(n.set(r.role,a),true);let l=this.tryMatchSelectorPropertyExpression(e);if(l)return r.expectedTypes&&r.expectedTypes.length>0&&!B(l.type,r.expectedTypes)?r.optional||false:(n.set(r.role,l),true);this.logger.debug(" >>> Trying tokenToSemanticValue for token:",i?JSON.stringify({value:i.value,kind:i.kind}):"null");let c=this.tokenToSemanticValue(i);return this.logger.debug(" >>> tokenToSemanticValue returned:",c?JSON.stringify(c):"null"),c?(this.logger.debug(" >>> Validating type:",c.type,"against expected:",r.expectedTypes),r.expectedTypes&&r.expectedTypes.length>0&&!B(c.type,r.expectedTypes)?(this.logger.debug(" >>> TYPE MISMATCH - returning",r.optional||false),r.optional||false):(this.logger.debug(" >>> Type validation PASSED"),n.set(r.role,c),e.advance(),true)):r.optional||false}tryMatchPossessiveExpression(e){let r=e.peek();if(!r||!this.currentProfile)return null;let n=r.normalized||r.value,i=this.safeToLowerCase(n),o=_t(this.currentProfile,i);if(!o)return null;let s=e.mark();e.advance();let u=e.peek();if(!u)return e.reset(s),null;if(u.kind==="identifier"||u.kind==="keyword"&&!this.isStructuralKeyword(u.value)||u.kind==="selector"&&u.value.startsWith("*")||u.kind==="selector"&&u.value.startsWith("@")||u.kind==="selector"&&u.value.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(u.value)){e.advance();let a=u.value;u.kind==="selector"&&a.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(a)&&(a=a.substring(1));let l=a;for(;e.peek()?.kind==="selector"&&e.peek().value.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(e.peek().value);)l+=e.peek().value,e.advance();let c=e.peek();return c?.kind==="literal"&&c.value.startsWith("(")&&(l+=c.value,e.advance()),ge(ae(o),l)}return e.reset(s),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(e){let r=e.peek();if(!r||r.kind!=="selector")return null;let n=e.mark();e.advance();let i=e.peek();if(!i||i.kind!=="operator"||i.value!==".")return e.reset(n),null;e.advance();let o=e.peek();if(!o||o.kind!=="identifier")return e.reset(n),null;e.advance();let s=e.peek();if(!s||s.kind!=="punctuation"||s.value!=="(")return e.reset(n),null;e.advance();let u=[];for(;!e.isAtEnd()&&u.length<$.MAX_METHOD_ARGS;){let l=e.peek();if(!l)break;if(l.kind==="punctuation"&&l.value===")"){e.advance();break}if(l.kind==="punctuation"&&l.value===","){e.advance();continue}u.push(l.value),e.advance();}return {type:"expression",raw:`${r.value}.${o.value}(${u.join(", ")})`}}tryMatchPropertyAccessExpression(e){let r=e.peek();if(!r||r.kind!=="identifier"&&r.kind!=="keyword")return null;let n=e.mark();e.advance();let i=e.peek();if(!i||i.kind!=="operator"||i.value!==".")return e.reset(n),null;e.advance();let o=e.peek();if(!o||o.kind!=="identifier")return e.reset(n),null;e.advance();let s=`${r.value}.${o.value}`,u=1;for(;!e.isAtEnd()&&u<$.MAX_PROPERTY_DEPTH;){let l=e.peek();if(!l||l.kind!=="operator"||l.value!==".")break;e.advance();let c=e.peek();if(!c||c.kind!=="identifier")break;e.advance(),s+=`.${c.value}`,u++;}let a=e.peek();if(a&&a.kind==="punctuation"&&a.value==="("){e.advance();let l=[],c=0;for(;!e.isAtEnd()&&l.length<$.MAX_METHOD_ARGS;){let d=e.peek();if(!d)break;if(d.kind==="punctuation"&&d.value===")"){if(c===0){e.advance();break}c--;}if(d.kind==="punctuation"&&d.value==="("&&c++,d.kind==="punctuation"&&d.value===","){e.advance();continue}l.push(d.value),e.advance();}return {type:"expression",raw:`${s}(${l.join(", ")})`}}return {type:"expression",raw:s}}tryMatchPossessiveSelectorExpression(e){let r=e.peek();if(!r||r.kind!=="selector")return null;let n=e.mark();e.advance();let i=e.peek();if(!i||i.kind!=="punctuation"||i.value!=="'s")return e.reset(n),null;e.advance();let o=e.peek();return !o||o.kind!=="selector"&&o.kind!=="identifier"?(e.reset(n),null):(e.advance(),ge(ye(r.value),o.value))}tryMatchSelectorPropertyExpression(e){let r=e.peek();if(!r||r.kind!=="selector"||typeof r.value!="string"||!r.value.startsWith("#"))return null;let n=e.mark();e.advance();let i=e.peek();if(!i||i.kind!=="selector"||!i.value.startsWith("."))return e.reset(n),null;let o=e.peek(1);o&&o.kind,e.advance();let s=i.value.slice(1);return ge(ye(r.value),s)}matchGroupToken(e,r,n,i){let o=e.mark(),s=new Set(n.keys());if(this.matchTokenSequence(e,r.tokens,n,i))return true;e.reset(o);for(let l of n.keys())s.has(l)||n.delete(l);if(!r.optional)return false;let a=this.getGroupLeadingMarker(r);if(a)for(let l=1;l<=$.MAX_MARKER_SCAN;l++){let c=e.peek(l);if(!c)break;if((c.normalized||c.value).toLowerCase()===a){this.logger.debug(" >> MARKER SCAN: found",a,"at offset",l,"- skipping intervening tokens");for(let f=0;f<l;f++)e.advance();if(this.matchTokenSequence(e,r.tokens,n,i))return true;e.reset(o);for(let f of n.keys())s.has(f)||n.delete(f);break}}return true}getGroupLeadingMarker(e){let r=e.tokens[0];return r?.type==="literal"?r.value.toLowerCase():null}getMatchType(e,r){return e.value===r?"exact":e.normalized===r?"normalized":e.stem===r&&e.stemConfidence!==void 0&&e.stemConfidence>=.7?"stem":e.kind==="keyword"&&this.safeToLowerCase(e.value)===r.toLowerCase()?"case-insensitive":"none"}collectStopMarkers(e,r){let n=new Set;for(let i=r;i<e.length;i++){let o=e[i];if(o.type==="literal"){if(n.add(o.value.toLowerCase()),o.alternatives)for(let s of o.alternatives)n.add(s.toLowerCase());break}if(o.type==="group"){for(let s of o.tokens)if(s.type==="literal"){if(n.add(s.value.toLowerCase()),s.alternatives)for(let u of s.alternatives)n.add(u.toLowerCase());break}if(!o.optional)break}}return n}isStopMarker(e,r){return r.size===0?false:!!(r.has(e.value.toLowerCase())||e.normalized&&r.has(e.normalized.toLowerCase()))}tokenToSemanticValue(e){switch(e.kind){case "selector":return ye(e.value);case "literal":return this.parseLiteralValue(e.value);case "keyword":let r=e.normalized||e.value;this.safeToLowerCase(r);return P(e.normalized||e.value);case "identifier":if(typeof e.value=="string"&&e.value.startsWith(":"))return ae(e.value);this.safeToLowerCase(e.value);return {type:"expression",raw:e.value};case "url":return P(e.value,"string");default:return null}}parseLiteralValue(e){if(e.startsWith('"')||e.startsWith("'")||e.startsWith("`")||e.startsWith("\u300C")){let i=e.slice(1,-1);return P(i,"string")}if(e==="true")return P(true,"boolean");if(e==="false")return P(false,"boolean");let r=e.match(/^(\d+(?:\.\d+)?)(ms|s|m|h)?$/);if(r){let i=parseFloat(r[1]);return r[2]?P(e,"duration"):P(i,"number")}let n=parseFloat(e);return isNaN(n)?P(e,"string"):P(n,"number")}applyExtractionRules(e,r){for(let[n,i]of Object.entries(e.extraction))r.has(n)||(i.value!==void 0?r.set(n,{type:"literal",value:i.value}):i.default&&r.set(n,i.default));}isOptional(e){return e.type!=="literal"&&e.optional===true}calculateConfidence(e,r){let n=0,i=0,o=l=>e.extraction?.[l]?.default!==void 0;for(let l of e.template.tokens)if(l.type==="role")i+=1,r.has(l.role)&&(n+=1);else if(l.type==="group"){for(let c of l.tokens)if(c.type==="role"){let p=o(c.role),d=.8;i+=d,r.has(c.role)?n+=d:p&&(n+=d*.6);}}let s=i>0?n/i:1;if(this.stemMatchCount>0&&this.totalKeywordMatches>0){let l=this.stemMatchCount/this.totalKeywordMatches*.15;s=Math.max(.5,s-l);}let u=this.calculateVSOConfidenceBoost(e);s=Math.min(1,s+u);let a=this.arabicPrepositionDisambiguation(e,r);return s=Math.max(0,Math.min(1,s+a)),s}calculateVSOConfidenceBoost(e){if(e.language!=="ar")return 0;let r=e.template.tokens[0];if(!r||r.type!=="literal")return 0;let n=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(n.has(r.value))return .15;if(r.alternatives){for(let i of r.alternatives)if(n.has(i))return .15}return 0}arabicPrepositionDisambiguation(e,r){if(e.language!=="ar")return 0;let n=0,i={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(let[o,s]of r.entries()){let u=i[o];if(!u||u.length===0)continue;let a="metadata"in s?s.metadata:void 0;if(a&&typeof a.prepositionValue=="string"){let l=a.prepositionValue;u.includes(l)?n+=.1:n-=.1;}}return Math.max(-0.1,Math.min(.1,n))}skipNoiseWords(e){let r=e.peek();if(!r)return;let n=this.safeToLowerCase(r.value);if($.ENGLISH_NOISE_WORDS.has(n)){let i=e.mark();e.advance();let o=e.peek();if(o&&o.kind==="selector")return;e.reset(i);}n==="class"&&e.advance();}extractEventModifiers(e){let r={},n=false;for(;!e.isAtEnd();){let i=e.peek();if(!i||i.kind!=="event-modifier")break;let o=i.metadata;if(!o)break;switch(n=true,o.modifierName){case "once":r.once=true;break;case "debounce":typeof o.value=="number"&&(r.debounce=o.value);break;case "throttle":typeof o.value=="number"&&(r.throttle=o.value);break;case "queue":(o.value==="first"||o.value==="last"||o.value==="all"||o.value==="none")&&(r.queue=o.value);break}e.advance();}return n?r:void 0}};Q.MAX_MARKER_SCAN=3;Q.MAX_PROPERTY_DEPTH=10;Q.MAX_METHOD_ARGS=20;Q.ENGLISH_NOISE_WORDS=new Set(["the","a","an"]);var Mt=Q;new Mt;var j=class{constructor(){this.name="string-literal";}canExtract(t,e){let r=t[e];return r==='"'||r==="'"||r==="`"||r==="\u201C"||r==="\u2018"}extract(t,e){let r=t[e];if(r==="\u201C"){let o=1;for(;e+o<t.length;){if(t[e+o]==="\u201D")return o++,{value:t.substring(e,e+o),length:o};o++;}return null}if(r==="\u2018"){let o=1;for(;e+o<t.length;){if(t[e+o]==="\u2019")return o++,{value:t.substring(e,e+o),length:o};o++;}return null}let n=1,i=false;for(;e+n<t.length;){let o=t[e+n];if(i){i=false,n++;continue}if(o==="\\"){i=true,n++;continue}if(o===r)return n++,{value:t.substring(e,e+n),length:n};n++;}return null}},V=class{constructor(){this.name="number";}canExtract(t,e){return /\d/.test(t[e])}extract(t,e){let r=0,n=false;for(;e+r<t.length;){let s=t[e+r];if(/\d/.test(s))r++;else if(s==="."&&!n)n=true,r++;else break}if(r===0)return null;let i=t.substring(e,e+r),o=e+r;if(o<t.length){let s=t.slice(o),u=[{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(let l of u)if(s.startsWith(l.pattern))return {value:i+l.suffix,length:r+l.pattern.length,metadata:{hasTimeUnit:true}};if(s.startsWith("ms"))return {value:i+"ms",length:r+2,metadata:{hasTimeUnit:true}};let a=[{pattern:"\u79D2",suffix:"s"},{pattern:"\u5206",suffix:"m"}];for(let l of a)if(s.startsWith(l.pattern))return {value:i+l.suffix,length:r+1,metadata:{hasTimeUnit:true}};if(/^[smh](?![a-zA-Z])/.test(s))return {value:i+s[0],length:r+1,metadata:{hasTimeUnit:true}}}return {value:i,length:r}}};function Lt(t){return "setContext"in t&&typeof t.setContext=="function"}function Dt(t){let e={language:t.language,direction:t.direction,lookupKeyword:t.lookupKeyword.bind(t),isKeyword:t.isKeyword.bind(t),isKeywordStart:t.isKeywordStart.bind(t)};return t.normalizer?{...e,normalizer:t.normalizer}:e}var Ft=new Set(["me","you","it","result","event","target","body"]);function Me(t,e=Ft){return e.has(t)}var ee=class{constructor(t,e){this.pos=0,this.tokens=t,this.language=e;}peek(t=0){let e=this.pos+t;return e<0||e>=this.tokens.length?null:this.tokens[e]}advance(){if(this.isAtEnd())throw new Error("Unexpected end of token stream");return this.tokens[this.pos++]}isAtEnd(){return this.pos>=this.tokens.length}mark(){return {position:this.pos}}reset(t){this.pos=t.position;}position(){return this.pos}remaining(){return this.tokens.slice(this.pos)}takeWhile(t){let e=[];for(;!this.isAtEnd()&&t(this.peek());)e.push(this.advance());return e}skipWhile(t){for(;!this.isAtEnd()&&t(this.peek());)this.advance();}};function S(t,e){return {start:t,end:e}}function C(t,e,r,n){if(typeof t=="object"){let{value:o,kind:s,position:u,normalized:a,stem:l,stemConfidence:c,metadata:p}=t;return {value:o,kind:s,position:u,...a!==void 0&&{normalized:a},...l!==void 0&&{stem:l},...c!==void 0&&{stemConfidence:c},...p!==void 0&&{metadata:p}}}let i=t;if(!e||!r)throw new Error("createToken requires kind and position parameters");if(typeof n=="string")return {value:i,kind:e,position:r,normalized:n};if(n){let{normalized:o,stem:s,stemConfidence:u,metadata:a}=n;return {value:i,kind:e,position:r,...o!==void 0&&{normalized:o},...s!==void 0&&{stem:s},...u!==void 0&&{stemConfidence:u},...a!==void 0&&{metadata:a}}}return {value:i,kind:e,position:r}}function J(t){return /\s/.test(t)}function $t(t){return t==="#"||t==="."||t==="["||t==="@"||t==="*"||t==="<"}function jt(t){return t==='"'||t==="'"||t==="`"||t==="\u300C"||t==="\u300D"}function M(t){return /\d/.test(t)}function Vt(t){return /[a-zA-Z]/.test(t)}function A(t){return /[a-zA-Z0-9_-]/.test(t)}function Wt(t,e){if(e>=t.length)return null;let r=t[e];if(!$t(r))return null;let n=e,i="";if(r==="#"||r==="."){for(i+=t[n++];n<t.length&&A(t[n]);)i+=t[n++];if(i.length<=1)return null;if(n<t.length&&t[n]==="."&&r==="#"){let s=n+1;for(;s<t.length&&A(t[s]);)s++;if(s<t.length&&t[s]==="(")return i}}else if(r==="["){let o=1,s=false,u=null,a=false;for(i+=t[n++];n<t.length&&o>0;){let l=t[n];i+=l,a?a=false:l==="\\"?a=true:s?l===u&&(s=false,u=null):l==='"'||l==="'"||l==="`"?(s=true,u=l):l==="["?o++:l==="]"&&o--,n++;}if(o!==0)return null}else if(r==="@"){for(i+=t[n++];n<t.length&&A(t[n]);)i+=t[n++];if(i.length<=1)return null}else if(r==="*"){for(i+=t[n++];n<t.length&&A(t[n]);)i+=t[n++];if(i.length<=1)return null}else if(r==="<"){if(i+=t[n++],n>=t.length||!Vt(t[n]))return null;for(;n<t.length&&A(t[n]);)i+=t[n++];for(;n<t.length;){let o=t[n];if(o==="."){if(i+=t[n++],n>=t.length||!A(t[n]))return null;for(;n<t.length&&A(t[n]);)i+=t[n++];}else if(o==="#"){if(i+=t[n++],n>=t.length||!A(t[n]))return null;for(;n<t.length&&A(t[n]);)i+=t[n++];}else if(o==="["){let s=1,u=false,a=null,l=false;for(i+=t[n++];n<t.length&&s>0;){let c=t[n];i+=c,l?l=false:c==="\\"?l=true:u?c===a&&(u=false,a=null):c==='"'||c==="'"||c==="`"?(u=true,a=c):c==="["?s++:c==="]"&&s--,n++;}if(s!==0)return null}else break}for(;n<t.length&&J(t[n]);)i+=t[n++];if(n<t.length&&t[n]==="/")for(i+=t[n++];n<t.length&&J(t[n]);)i+=t[n++];if(n>=t.length||t[n]!==">")return null;i+=t[n++];}return i||null}function qt(t,e){if(e>=t.length||t[e]!=="'"||e+1>=t.length||t[e+1].toLowerCase()!=="s")return false;if(e+2>=t.length)return true;let n=t[e+2];return J(n)||n==="*"||!A(n)}function Ut(t,e){if(e>=t.length)return null;let r=t[e];if(!jt(r)||r==="'"&&qt(t,e))return null;let i={'"':'"',"'":"'","`":"`","\u300C":"\u300D"}[r];if(!i)return null;let o=e+1,s=r,u=false;for(;o<t.length;){let a=t[o];if(s+=a,u)u=false;else if(a==="\\")u=true;else if(a===i)return s;o++;}return s}function Kt(t,e){if(e>=t.length)return false;let r=t[e],n=t[e+1]||"",i=t[e+2]||"";if(r==="/"&&n!=="/"&&/[a-zA-Z0-9._-]/.test(n)||r==="/"&&n==="/"&&/[a-zA-Z]/.test(i)||r==="."&&(n==="/"||n==="."&&i==="/"))return true;let o=t.slice(e,e+8).toLowerCase();return !!(o.startsWith("http://")||o.startsWith("https://"))}function Gt(t,e){if(!Kt(t,e))return null;let r=e,n="",i=/[a-zA-Z0-9/:._\-?&=%@+~!$'()*,;[\]]/;for(;r<t.length;){let o=t[r];if(o==="#"){if(n.length>0&&/[a-zA-Z0-9/.]$/.test(n))for(n+=o,r++;r<t.length&&/[a-zA-Z0-9_-]/.test(t[r]);)n+=t[r++];break}if(i.test(o))n+=o,r++;else break}return n.length<2?null:n}function Ht(t,e){if(e>=t.length)return null;let r=t[e];if(!M(r)&&r!=="-"&&r!=="+")return null;let n=e,i="";if((t[n]==="-"||t[n]==="+")&&(i+=t[n++]),n>=t.length||!M(t[n]))return null;for(;n<t.length&&M(t[n]);)i+=t[n++];if(n<t.length&&t[n]===".")for(i+=t[n++];n<t.length&&M(t[n]);)i+=t[n++];return n<t.length&&(t.slice(n,n+2)==="ms"?i+="ms":(t[n]==="s"||t[n]==="m"||t[n]==="h")&&(i+=t[n])),i}var Yt=["===","!==","->","==","!=","<=",">=","&&","||","**","+=","-=","*=","/=","+","-","*","/","=",">","<","!","&","|","%","^","~"];new Set(Yt);var De=class Fe{constructor(){this.profileKeywords=[],this.profileKeywordMap=new Map,this.extractors=[];}tokenize(e){if(this.isUsingExtractors())return this.tokenizeWithExtractors(e);throw new Error(`${this.constructor.name}: tokenize() not implemented and no extractors registered. Either register extractors or override tokenize() method.`)}registerExtractor(e){Lt(e)&&e.setContext(Dt(this)),this.extractors.push(e);}registerExtractors(e){for(let r of e)this.registerExtractor(r);}clearExtractors(){this.extractors=[];}isUsingExtractors(){return this.extractors.length>0}tokenizeWithExtractors(e){let r=[],n=0;for(;n<e.length;){for(;n<e.length&&J(e[n]);)n++;if(n>=e.length)break;let i=false;for(let o of this.extractors)if(o.canExtract(e,n)){let s=o.extract(e,n);if(s){let u=s.metadata?.normalized,a=s.metadata?.stem,l=s.metadata?.stemConfidence,c={};if(s.metadata)for(let[d,f]of Object.entries(s.metadata))d!=="normalized"&&d!=="stem"&&d!=="stemConfidence"&&(c[d]=f);let p={};u&&(p.normalized=u),a&&(p.stem=a),l!==void 0&&(p.stemConfidence=l),Object.keys(c).length>0&&(p.metadata=c),r.push(C(s.value,this.classifyToken(s.value),S(n,n+s.length),Object.keys(p).length>0?p:void 0)),n+=s.length,i=true;break}}if(!i){let o=e[n],s=this.classifyUnknownChar(o);r.push(C(o,s,S(n,n+1))),n++;}}return new ee(r,this.language)}classifyUnknownChar(e){return "()[]{},:;".includes(e)?"punctuation":"+-*/<>=!&|".includes(e)?"operator":"identifier"}tryPropertyAccess(e,r,n){if(e[r]!==".")return false;let i=n[n.length-1],o=i&&i.position.end<r;if(i&&!o&&(i.kind==="identifier"||i.kind==="keyword"||i.kind==="selector"))return n.push(C(".","operator",S(r,r+1))),true;let a=r+1;for(;a<e.length&&A(e[a]);)a++;return a<e.length&&e[a]==="("?(n.push(C(".","operator",S(r,r+1))),true):false}initializeKeywordsFromProfile(e,r=[]){let n=new Map;if(e.keywords){for(let[i,o]of Object.entries(e.keywords))if(n.set(o.primary,{native:o.primary,normalized:o.normalized||i}),o.alternatives)for(let s of o.alternatives)n.set(s,{native:s,normalized:o.normalized||i});}if(e.references){for(let[i,o]of Object.entries(e.references))n.set(o,{native:o,normalized:i});for(let i of Object.keys(e.references))n.has(i)||n.set(i,{native:i,normalized:i});}if(e.roleMarkers){for(let[i,o]of Object.entries(e.roleMarkers))if(o.primary&&n.set(o.primary,{native:o.primary,normalized:i}),o.alternatives)for(let s of o.alternatives)n.set(s,{native:s,normalized:i});}if(e.possessive?.keywords)for(let[i,o]of Object.entries(e.possessive.keywords))n.set(i,{native:i,normalized:o});for(let i of r)n.set(i.native,i);this.profileKeywords=Array.from(n.values()).sort((i,o)=>o.native.length-i.native.length),this.profileKeywordMap=new Map;for(let i of this.profileKeywords){this.profileKeywordMap.set(i.native.toLowerCase(),i);let o=this.removeDiacritics(i.native);o!==i.native&&!this.profileKeywordMap.has(o.toLowerCase())&&this.profileKeywordMap.set(o.toLowerCase(),i);}}removeDiacritics(e){return e.replace(/[\u064B-\u0652\u0670]/g,"")}tryProfileKeyword(e,r){for(let n of this.profileKeywords)if(e.slice(r).startsWith(n.native))return C(n.native,"keyword",S(r,r+n.native.length),n.normalized);return null}isKeywordStart(e,r){let n=e.slice(r);return this.profileKeywords.some(i=>n.startsWith(i.native))}lookupKeyword(e){return this.profileKeywordMap.get(e.toLowerCase())}isKeyword(e){return this.profileKeywordMap.has(e.toLowerCase())}setNormalizer(e){this.normalizer=e;}tryNormalize(e){if(!this.normalizer)return null;let r=this.normalizer.normalize(e);return r.stem!==e&&r.confidence>=.7?r:null}tryMorphKeywordMatch(e,r,n){let i=this.tryNormalize(e);if(!i)return null;let o=this.lookupKeyword(i.stem);if(!o)return null;let s={normalized:o.normalized,stem:i.stem,stemConfidence:i.confidence};return C(e,"keyword",S(r,n),s)}trySelector(e,r){let n=Wt(e,r);return n?C(n,"selector",S(r,r+n.length)):null}tryEventModifier(e,r){if(e[r]!==".")return null;let n=e.slice(r).match(/^\.(?:once|debounce|throttle|queue)(?:\(([^)]+)\))?(?:\s|$|\.)/);if(!n)return null;let i=n[0].replace(/(\s|\.)$/,""),o=i.slice(1).split("(")[0],s=n[1];return {...C(i,"event-modifier",S(r,r+i.length)),metadata:{modifierName:o,value:s?o==="queue"?s:parseInt(s,10):void 0}}}tryString(e,r){let n=Ut(e,r);return n?C(n,"literal",S(r,r+n.length)):null}tryNumber(e,r){let n=Ht(e,r);return n?C(n,"literal",S(r,r+n.length)):null}tryMatchTimeUnit(e,r,n,i=false){let o=r;if(i)for(;o<e.length&&J(e[o]);)o++;let s=e.slice(o);for(let u of n){let a=s.slice(0,u.length);if(u.caseInsensitive?a.toLowerCase()===u.pattern.toLowerCase():a===u.pattern){if(u.notFollowedBy&&(s[u.length]||"")===u.notFollowedBy)continue;if(u.checkBoundary){let c=s[u.length]||"";if(A(c))continue}return {suffix:u.suffix,endPos:o+u.length}}}return null}parseBaseNumber(e,r,n=true){let i=r,o="";if(n&&(e[i]==="-"||e[i]==="+")&&(o+=e[i++]),i>=e.length||!M(e[i]))return null;for(;i<e.length&&M(e[i]);)o+=e[i++];if(i<e.length&&e[i]===".")for(o+=e[i++];i<e.length&&M(e[i]);)o+=e[i++];return !o||o==="-"||o==="+"?null:{number:o,endPos:i}}tryNumberWithTimeUnits(e,r,n,i={}){let{allowSign:o=true,skipWhitespace:s=false}=i,u=this.parseBaseNumber(e,r,o);if(!u)return null;let{number:a,endPos:l}=u,c=[...n,...Fe.STANDARD_TIME_UNITS],p=this.tryMatchTimeUnit(e,l,c,s);return p&&(a+=p.suffix,l=p.endPos),C(a,"literal",S(r,l))}tryUrl(e,r){let n=Gt(e,r);return n?C(n,"url",S(r,r+n.length)):null}tryVariableRef(e,r){if(e[r]!==":"||r+1>=e.length||!A(e[r+1]))return null;let n=r+1;for(;n<e.length&&A(e[n]);)n++;let i=e.slice(r,n);return C(i,"identifier",S(r,n))}tryOperator(e,r){let n=e.slice(r,r+2);if(["==","!=","<=",">=","&&","||","->"].includes(n))return C(n,"operator",S(r,r+2));let i=e[r];return ["<",">","!","+","-","*","/","="].includes(i)?C(i,"operator",S(r,r+1)):["(",")","{","}",",",";",":"].includes(i)?C(i,"punctuation",S(r,r+1)):null}tryMultiCharParticle(e,r,n){for(let i of n)if(e.slice(r,r+i.length)===i)return C(i,"particle",S(r,r+i.length));return null}};De.STANDARD_TIME_UNITS=[{pattern:"ms",suffix:"ms",length:2},{pattern:"s",suffix:"s",length:1,checkBoundary:true},{pattern:"m",suffix:"m",length:1,checkBoundary:true,notFollowedBy:"s"},{pattern:"h",suffix:"h",length:1,checkBoundary:true}];var W=De;function T(t){return {stem:t,confidence:1}}function m(t,e,r){return r?{stem:t,confidence:e,metadata:r}:{stem:t,confidence:e}}var Xt=new Map,Zt=new Map,Jt=new Map;function Qt(t,e,r){Xt.set(t,e),Zt.set(t,r),Jt.delete(t);}function er(t){return /[а-яА-ЯёЁ]/.test(t)}function tr(t){for(let e of t)if(er(e))return true;return false}var Be=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"]]),$e=class{constructor(){this.language="ru";}isNormalizable(t){return t.length<3?false:tr(t)}normalize(t){let e=t.toLowerCase();if(e.endsWith("\u0441\u044F")||e.endsWith("\u0441\u044C")){let s=this.tryReflexiveNormalization(e);if(s)return s}if(e.endsWith("\u0442\u044C")||e.endsWith("\u0442\u0438")||e.endsWith("\u0447\u044C"))return T(t);let r=this.tryImperativeLookup(e);if(r)return r;let n=this.tryPastTenseNormalization(e);if(n)return n;let i=this.tryPresentTenseNormalization(e);if(i)return i;let o=this.tryGenericImperativeNormalization(e);return o||T(t)}tryReflexiveNormalization(t){(t.endsWith("\u0441\u044F"),2);let r=t.slice(0,-2);if(t.endsWith("\u0442\u044C\u0441\u044F")||t.endsWith("\u0442\u0438\u0441\u044C")||t.endsWith("\u0447\u044C\u0441\u044F"))return T(t);let n=this.normalizeNonReflexive(r);if(n.confidence<1){let i=n.stem.endsWith("\u0442\u044C")?n.stem.slice(0,-2)+"\u0442\u044C\u0441\u044F":n.stem+"\u0441\u044F";return m(i,n.confidence*.95,{removedSuffixes:["\u0441\u044F",...n.metadata?.removedSuffixes||[]],conjugationType:"reflexive"})}return null}normalizeNonReflexive(t){if(t.endsWith("\u0442\u044C")||t.endsWith("\u0442\u0438")||t.endsWith("\u0447\u044C"))return T(t);let e=this.tryImperativeLookup(t);if(e)return e;let r=this.tryPastTenseNormalization(t);if(r)return r;let n=this.tryPresentTenseNormalization(t);if(n)return n;let i=this.tryGenericImperativeNormalization(t);return i||T(t)}tryImperativeLookup(t){return Be.has(t)?m(Be.get(t),.95,{removedSuffixes:["imperative"],conjugationType:"imperative"}):null}tryGenericImperativeNormalization(t){return t.endsWith("\u0439\u0442\u0435")&&t.length>5?m(t.slice(0,-3)+"\u0442\u044C",.8,{removedSuffixes:["\u0439\u0442\u0435"],conjugationType:"imperative"}):t.endsWith("\u0438\u0442\u0435")&&t.length>5?m(t.slice(0,-3)+"\u0438\u0442\u044C",.8,{removedSuffixes:["\u0438\u0442\u0435"],conjugationType:"imperative"}):t.endsWith("\u0439")&&t.length>3?m(t.slice(0,-1)+"\u0442\u044C",.75,{removedSuffixes:["\u0439"],conjugationType:"imperative"}):t.endsWith("\u0438")&&t.length>3?m(t+"\u0442\u044C",.7,{removedSuffixes:["\u0438\u2192\u0438\u0442\u044C"],conjugationType:"imperative"}):null}tryPastTenseNormalization(t){return t.endsWith("\u0430\u043B\u0430")&&t.length>4?m(t.slice(0,-3)+"\u0430\u0442\u044C",.85,{removedSuffixes:["\u0430\u043B\u0430"],conjugationType:"past"}):t.endsWith("\u0438\u043B\u0430")&&t.length>4?m(t.slice(0,-3)+"\u0438\u0442\u044C",.85,{removedSuffixes:["\u0438\u043B\u0430"],conjugationType:"past"}):t.endsWith("\u0435\u043B\u043E")&&t.length>4?m(t.slice(0,-3)+"\u0435\u0442\u044C",.82,{removedSuffixes:["\u0435\u043B\u043E"],conjugationType:"past"}):t.endsWith("\u0430\u0431\u043E")&&t.length>4?m(t.slice(0,-3)+"\u0430\u0442\u044C",.82,{removedSuffixes:["\u0430\u0431\u043E"],conjugationType:"past"}):t.endsWith("\u0430\u043B\u0438")&&t.length>4?m(t.slice(0,-3)+"\u0430\u0442\u044C",.85,{removedSuffixes:["\u0430\u043B\u0438"],conjugationType:"past"}):t.endsWith("\u0438\u043B\u0438")&&t.length>4?m(t.slice(0,-3)+"\u0438\u0442\u044C",.85,{removedSuffixes:["\u0438\u043B\u0438"],conjugationType:"past"}):t.endsWith("\u0430\u043B")&&t.length>3?m(t.slice(0,-2)+"\u0430\u0442\u044C",.82,{removedSuffixes:["\u0430\u043B"],conjugationType:"past"}):t.endsWith("\u0438\u043B")&&t.length>3?m(t.slice(0,-2)+"\u0438\u0442\u044C",.82,{removedSuffixes:["\u0438\u043B"],conjugationType:"past"}):null}tryPresentTenseNormalization(t){return t.endsWith("\u0438\u0448\u044C")&&t.length>4?m(t.slice(0,-3)+"\u0438\u0442\u044C",.8,{removedSuffixes:["\u0438\u0448\u044C"],conjugationType:"present"}):t.endsWith("\u0438\u0442")&&t.length>3?m(t.slice(0,-2)+"\u0438\u0442\u044C",.78,{removedSuffixes:["\u0438\u0442"],conjugationType:"present"}):t.endsWith("\u0438\u043C")&&t.length>3?m(t.slice(0,-2)+"\u0438\u0442\u044C",.78,{removedSuffixes:["\u0438\u043C"],conjugationType:"present"}):t.endsWith("\u044F\u0442")&&t.length>3?m(t.slice(0,-2)+"\u0438\u0442\u044C",.78,{removedSuffixes:["\u044F\u0442"],conjugationType:"present"}):t.endsWith("\u0435\u0448\u044C")&&t.length>4?m(t.slice(0,-3)+"\u0430\u0442\u044C",.75,{removedSuffixes:["\u0435\u0448\u044C"],conjugationType:"present"}):t.endsWith("\u0435\u0442")&&t.length>3?m(t.slice(0,-2)+"\u0430\u0442\u044C",.72,{removedSuffixes:["\u0435\u0442"],conjugationType:"present"}):t.endsWith("\u0435\u043C")&&t.length>3?m(t.slice(0,-2)+"\u0430\u0442\u044C",.72,{removedSuffixes:["\u0435\u043C"],conjugationType:"present"}):t.endsWith("\u044E\u0442")&&t.length>3?m(t.slice(0,-2)+"\u0430\u0442\u044C",.75,{removedSuffixes:["\u044E\u0442"],conjugationType:"present"}):t.endsWith("\u0443\u0442")&&t.length>3?m(t.slice(0,-2)+"\u0430\u0442\u044C",.72,{removedSuffixes:["\u0443\u0442"],conjugationType:"present"}):null}},je={code:"ru",name:"Russian",nativeName:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",direction:"ltr",script:"cyrillic",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:true,defaultVerbForm:"infinitive",verb:{position:"start",subjectDrop:true,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:"body"},possessive:{marker:"",markerPosition:"after-object",usePossessiveAdjectives:true,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\u0431\u0430\u0432\u0438\u0442\u044C_\u0432_\u043A\u043E\u043D\u0435\u0446",alternatives:["\u0434\u043E\u043F\u0438\u0441\u0430\u0442\u044C"],normalized:"append",form:"infinitive"},prepend:{primary:"\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"},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"},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"},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"},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"},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"},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:"\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C_\u043F\u0430\u043A\u0435\u0442",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"}},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"]}},rr=["===","!==","->","==","!=","<=",">=","&&","||","**","+=","-=","*=","/=","+","-","*","/","=",">","<","!","&","|","%","^","~"],nr=class{constructor(t=rr){this.name="operator",this.operators=[...t].sort((e,r)=>r.length-e.length);}canExtract(t,e){return this.operators.some(r=>t.startsWith(r,e))}extract(t,e){for(let r of this.operators)if(t.startsWith(r,e))return {value:r,length:r.length};return null}},ir="()[]{},:;",or=class{constructor(t=ir){this.punctuation=t,this.name="punctuation";}canExtract(t,e){return this.punctuation.includes(t[e])}extract(t,e){let r=t[e];return this.punctuation.includes(r)?{value:r,length:1}:null}};function sr(t,e){let r=t[e];if(r==="#"){let n=t.slice(e).match(/^#[a-zA-Z_][\w-]*/);return n?n[0]:null}if(r==="."){let n=t.slice(e).match(/^\.[a-zA-Z_][\w-]*/);return n?n[0]:null}if(r==="["){let n=0,i=e;for(;i<t.length;){if(t[i]==="["&&n++,t[i]==="]"&&(n--,n===0))return t.slice(e,i+1);i++;}return null}if(r==="<"){let n=t.slice(e).match(/^<[\w-]+(?:[#.][\w-]+|\[[^\]]+\])*\s*\/>/);return n?n[0]:null}return null}var ur=class{constructor(){this.name="css-selector";}canExtract(t,e){let r=t[e];return r==="#"||r==="."||r==="["||r==="<"}extract(t,e){let r=sr(t,e);return r?{value:r,length:r.length,metadata:{type:"css-selector"}}:null}},ar=class{constructor(){this.name="event-modifier";}canExtract(t,e){if(t[e]!==".")return false;let r=t.slice(e);return /^\.(once|prevent|stop|debounce|throttle|queue)/.test(r)}extract(t,e){let r=t.slice(e).match(/^\.(?:once|prevent|stop|debounce|throttle|queue)(?:\(([^)]+)\))?/);if(!r)return null;let n=r[0],i=n.slice(1).split("(")[0],o=r[1];return {value:n,length:n.length,metadata:{modifierName:i,value:o?i==="queue"?o:parseInt(o,10):void 0}}}};function lr(t,e){let r=t.slice(e);if(r.startsWith("http://")||r.startsWith("https://")){let n=r.match(/^https?:\/\/[^\s]*/);return n?n[0]:null}if(r.startsWith("//")){let n=r.match(/^\/\/[^\s]*/);return n?n[0]:null}if(r.startsWith("./")||r.startsWith("../")){let n=r.match(/^\.\.?\/[^\s]*/);return n?n[0]:null}if(r.startsWith("/")){let n=r.match(/^\/[^\s]*/);return n?n[0]:null}return null}var cr=class{constructor(){this.name="url";}canExtract(t,e){let r=t.slice(e);return r.startsWith("http://")||r.startsWith("https://")||r.startsWith("//")||r.startsWith("./")||r.startsWith("../")||r.startsWith("/")}extract(t,e){let r=lr(t,e);return r?{value:r,length:r.length,metadata:{type:"url"}}:null}},pr=class{constructor(){this.name="variable-ref";}canExtract(t,e){return t[e]===":"&&e+1<t.length&&/[a-zA-Z_]/.test(t[e+1])}extract(t,e){if(!this.canExtract(t,e))return null;let r=1;for(;e+r<t.length&&/[a-zA-Z0-9_]/.test(t[e+r]);)r++;return {value:t.substring(e,e+r),length:r,metadata:{type:"variable-reference"}}}};function dr(t){return {isLetter:n=>t.test(n),isIdentifierChar:n=>/[0-9]/.test(n)||t.test(n)}}var fr=class{constructor(t,e,r){this.name=t;let n=dr(e);this.isLetter=n.isLetter,this.isIdentifierChar=n.isIdentifierChar,this.prepositions=r;}setContext(t){this.context=t;}canExtract(t,e){return this.isLetter(t[e])}extract(t,e){if(!this.context)throw new Error(`${this.name}: context not set`);let r=e,n="";for(;r<t.length&&this.isIdentifierChar(t[r]);)n+=t[r++];if(!n)return null;let i=n.toLowerCase(),o=this.prepositions.has(i),s=this.context.lookupKeyword(i),u=s&&s.normalized!==s.native?s.normalized:void 0,a;if(!s&&this.context.normalizer){let l=this.context.normalizer.normalize(n);if(l.stem!==n&&l.confidence>=.7){let c=this.context.lookupKeyword(l.stem);c&&(a=c.normalized);}}return {value:n,length:r-e,metadata:{normalized:u||a,isPreposition:o}}}},mr=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"]);function hr(){return [new fr("russian-keyword",/[a-zA-Zа-яА-ЯёЁ]/,mr)]}function vr(t){let e=t.charCodeAt(0);return e>=65&&e<=90||e>=97&&e<=122||e===95||e===36}function yr(t){let e=t.charCodeAt(0);return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95||e===36}var gr=class{constructor(){this.name="ascii-identifier";}setContext(t){this.context=t;}canExtract(t,e){return vr(t[e])}extract(t,e){if(!this.context)throw new Error("AsciiIdentifierExtractor: context not set");let r=e,n="",i=e;for(;i<t.length&&yr(t[i]);)n+=t[i],i++;if(!n)return null;let o=this.context.lookupKeyword(n),s=o&&o.normalized!==o.native?o.normalized:void 0;return {value:n,length:i-r,metadata:{normalized:s}}}};function Er(){return [new cr,new ar,new pr,new ur]}var br=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"]),wr=[{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:"\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\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"}],Sr=class extends W{constructor(){super(),this.language="ru",this.direction="ltr",this.initializeKeywordsFromProfile(je,wr),this.setNormalizer(new $e),this.registerExtractors([...Er(),...hr(),new j,new V,new gr,new nr,new or]);}classifyToken(t){let e=t.toLowerCase();return br.has(e)?"particle":this.isKeyword(e)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(t)?"event-modifier":t.startsWith("#")||t.startsWith(".")||t.startsWith("[")||t.startsWith("*")||t.startsWith("<")?"selector":t.startsWith('"')||t.startsWith("'")||/^\d/.test(t)?"literal":"identifier"}},Cr=new Sr;Qt("ru",Cr,je);var kr=new Map,Tr=new Map,xr=new Map;function Ar(t,e,r){kr.set(t,e),Tr.set(t,r),xr.delete(t);}var We={code:"pl",name:"Polish",nativeName:"Polski",direction:"ltr",script:"latin",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:true,defaultVerbForm:"imperative",verb:{position:"start",subjectDrop:true,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"},possessive:{marker:"",markerPosition:"after-object",usePossessiveAdjectives:true,specialForms:{me:"m\xF3j",it:"jego",you:"tw\xF3j"},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\xF3rz",alternatives:["utworz","stw\xF3rz","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\xF3l",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"},go:{primary:"id\u017A",alternatives:["idz","przejd\u017A","przejdz","nawiguj"],normalized:"go",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"},when:{primary:"kiedy",normalized:"when"},where:{primary:"gdzie",normalized:"where"},else:{primary:"inaczej",alternatives:["wpp"],normalized:"else"},repeat:{primary:"powt\xF3rz",alternatives:["powtorz"],normalized:"repeat",form:"imperative"},for:{primary:"dla",alternatives:["ka\u017Cdy","kazdy"],normalized:"for"},while:{primary:"dop\xF3ki",alternatives:["dopoki","podczas"],normalized:"while"},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\xF3\u0107",alternatives:["zwroc"],normalized:"return",form:"imperative"},then:{primary:"wtedy",alternatives:["potem","nast\u0119pnie","nastepnie"],normalized:"then"},and:{primary:"i",alternatives:["oraz"],normalized:"and"},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"},hover:{primary:"najechaniu",alternatives:["hover"],normalized:"hover"},submit:{primary:"wys\u0142aniu",alternatives:["wyslaniu","submit"],normalized:"submit"},input:{primary:"wprowadzeniu",alternatives:["input"],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"}},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"],position:"before"},temporalMarkers:["kiedy","gdy","przy"]}},Ve=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\xF3rz","tworzy\u0107"],["utworz","tworzyc"],["stw\xF3rz","stwarza\u0107"],["stworz","stwarzac"],["skup","skupia\u0107"],["rozmyj","rozmywa\u0107"],["nawiguj","nawigowa\u0107"],["za\u0142aduj","\u0142adowa\u0107"],["zaladuj","ladowac"],["powt\xF3rz","powtarza\u0107"],["powtorz","powtarzac"],["kontynuuj","kontynuowa\u0107"],["zatrzymaj","zatrzymywa\u0107"],["przerwij","przerywa\u0107"],["rzu\u0107","rzuca\u0107"],["rzuc","rzucac"],["zwr\xF3\u0107","zwraca\u0107"],["zwroc","zwracac"],["inicjuj","inicjowa\u0107"],["zainstaluj","instalowa\u0107"],["zmierz","mierzy\u0107"]]),qe=class{constructor(){this.language="pl";}isNormalizable(t){return t.length<3?false:/[a-zA-ZąęćńóśźżłĄĘĆŃÓŚŹŻŁ]/.test(t)}normalize(t){let e=t.toLowerCase();if(this.isInfinitive(e))return T(e);let r=this.tryImperativeNormalization(e);if(r)return r;let n=this.tryPastTenseNormalization(e);if(n)return n;let i=this.tryPresentTenseNormalization(e);return i||T(e)}isInfinitive(t){return ["a\u0107","e\u0107","i\u0107","y\u0107","\u0105\u0107","owa\u0107","iwa\u0107","ywa\u0107"].some(r=>t.endsWith(r))}tryImperativeNormalization(t){return Ve.has(t)?m(Ve.get(t),.95,{removedSuffixes:["imperative"],conjugationType:"imperative"}):t.endsWith("aj")?m(t.slice(0,-2)+"a\u0107",.8,{removedSuffixes:["aj"],conjugationType:"imperative"}):t.endsWith("uj")?m(t.slice(0,-2)+"owa\u0107",.8,{removedSuffixes:["uj"],conjugationType:"imperative"}):t.endsWith("ij")?m(t.slice(0,-2)+"i\u0107",.75,{removedSuffixes:["ij"],conjugationType:"imperative"}):null}tryPresentTenseNormalization(t){return t.endsWith("uj\u0119")||t.endsWith("uje")?m(t.slice(0,-3)+"owa\u0107",.85,{removedSuffixes:["uj\u0119"],conjugationType:"present"}):t.endsWith("am")&&t.length>3?m(t.slice(0,-2)+"a\u0107",.8,{removedSuffixes:["am"],conjugationType:"present"}):t.endsWith("em")&&t.length>3?m(t.slice(0,-2)+"e\u0107",.75,{removedSuffixes:["em"],conjugationType:"present"}):t.endsWith("\u0119")&&t.length>2?m(t.slice(0,-1)+"a\u0107",.7,{removedSuffixes:["\u0119"],conjugationType:"present"}):null}tryPastTenseNormalization(t){if(t.endsWith("a\u0142em")||t.endsWith("a\u0142am"))return m(t.slice(0,-4)+"a\u0107",.85,{removedSuffixes:[t.slice(-4)],conjugationType:"past"});if(t.endsWith("a\u0142")||t.endsWith("a\u0142a")){let e=t.endsWith("a\u0142a")?3:2;return m(t.slice(0,-e)+"a\u0107",.8,{removedSuffixes:[t.slice(-e)],conjugationType:"past"})}if(t.endsWith("i\u0142em")||t.endsWith("i\u0142am")||t.endsWith("ilem")||t.endsWith("ilam"))return m(t.slice(0,-4)+"i\u0107",.85,{removedSuffixes:[t.slice(-4)],conjugationType:"past"});if(t.endsWith("i\u0142")||t.endsWith("i\u0142a")||t.endsWith("il")||t.endsWith("ila")){let e=t.endsWith("i\u0142a")||t.endsWith("ila")?3:2;return m(t.slice(0,-e)+"i\u0107",.8,{removedSuffixes:[t.slice(-e)],conjugationType:"past"})}return null}},zr=["===","!==","->","==","!=","<=",">=","&&","||","**","+=","-=","*=","/=","+","-","*","/","=",">","<","!","&","|","%","^","~"],Rr=class{constructor(t=zr){this.name="operator",this.operators=[...t].sort((e,r)=>r.length-e.length);}canExtract(t,e){return this.operators.some(r=>t.startsWith(r,e))}extract(t,e){for(let r of this.operators)if(t.startsWith(r,e))return {value:r,length:r.length};return null}},Nr="()[]{},:;",Pr=class{constructor(t=Nr){this.punctuation=t,this.name="punctuation";}canExtract(t,e){return this.punctuation.includes(t[e])}extract(t,e){let r=t[e];return this.punctuation.includes(r)?{value:r,length:1}:null}};function Or(t,e){let r=t[e];if(r==="#"){let n=t.slice(e).match(/^#[a-zA-Z_][\w-]*/);return n?n[0]:null}if(r==="."){let n=t.slice(e).match(/^\.[a-zA-Z_][\w-]*/);return n?n[0]:null}if(r==="["){let n=0,i=e;for(;i<t.length;){if(t[i]==="["&&n++,t[i]==="]"&&(n--,n===0))return t.slice(e,i+1);i++;}return null}if(r==="<"){let n=t.slice(e).match(/^<[\w-]+(?:[#.][\w-]+|\[[^\]]+\])*\s*\/>/);return n?n[0]:null}return null}var Ir=class{constructor(){this.name="css-selector";}canExtract(t,e){let r=t[e];return r==="#"||r==="."||r==="["||r==="<"}extract(t,e){let r=Or(t,e);return r?{value:r,length:r.length,metadata:{type:"css-selector"}}:null}},_r=class{constructor(){this.name="event-modifier";}canExtract(t,e){if(t[e]!==".")return false;let r=t.slice(e);return /^\.(once|prevent|stop|debounce|throttle|queue)/.test(r)}extract(t,e){let r=t.slice(e).match(/^\.(?:once|prevent|stop|debounce|throttle|queue)(?:\(([^)]+)\))?/);if(!r)return null;let n=r[0],i=n.slice(1).split("(")[0],o=r[1];return {value:n,length:n.length,metadata:{modifierName:i,value:o?i==="queue"?o:parseInt(o,10):void 0}}}};function Mr(t,e){let r=t.slice(e);if(r.startsWith("http://")||r.startsWith("https://")){let n=r.match(/^https?:\/\/[^\s]*/);return n?n[0]:null}if(r.startsWith("//")){let n=r.match(/^\/\/[^\s]*/);return n?n[0]:null}if(r.startsWith("./")||r.startsWith("../")){let n=r.match(/^\.\.?\/[^\s]*/);return n?n[0]:null}if(r.startsWith("/")){let n=r.match(/^\/[^\s]*/);return n?n[0]:null}return null}var Lr=class{constructor(){this.name="url";}canExtract(t,e){let r=t.slice(e);return r.startsWith("http://")||r.startsWith("https://")||r.startsWith("//")||r.startsWith("./")||r.startsWith("../")||r.startsWith("/")}extract(t,e){let r=Mr(t,e);return r?{value:r,length:r.length,metadata:{type:"url"}}:null}},Dr=class{constructor(){this.name="variable-ref";}canExtract(t,e){return t[e]===":"&&e+1<t.length&&/[a-zA-Z_]/.test(t[e+1])}extract(t,e){if(!this.canExtract(t,e))return null;let r=1;for(;e+r<t.length&&/[a-zA-Z0-9_]/.test(t[e+r]);)r++;return {value:t.substring(e,e+r),length:r,metadata:{type:"variable-reference"}}}},Fr=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\xF3d","wsrod","obok","poza","wok\xF3\u0142","wokol","przeciw","ku"]);function Br(){let t=/[a-zA-ZąęćńóśźżłĄĘĆŃÓŚŹŻŁ]/;return {isLetter:n=>t.test(n),isIdentifierChar:n=>/[0-9]/.test(n)||t.test(n)}}var{isLetter:$r,isIdentifierChar:jr}=Br(),Vr=class{constructor(){this.name="polish-keyword";}setContext(t){this.context=t;}canExtract(t,e){return $r(t[e])}extract(t,e){if(!this.context)throw new Error("PolishKeywordExtractor: context not set");let r=e,n="";for(;r<t.length&&jr(t[r]);)n+=t[r++];if(!n)return null;let i=n.toLowerCase(),o=Fr.has(i),s=this.context.lookupKeyword(i),u=s&&s.normalized!==s.native?s.normalized:void 0,a;if(!s&&this.context.normalizer){let l=this.context.normalizer.normalize(n);if(l.stem!==n&&l.confidence>=.7){let c=this.context.lookupKeyword(l.stem);c&&(a=c.normalized);}}return {value:n,length:r-e,metadata:{normalized:u||a,isPreposition:o}}}};function Wr(){return [new Vr]}function qr(){return [new Lr,new _r,new Dr,new Ir]}var Ur=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\xF3d","wsrod","obok","poza","wok\xF3\u0142","wokol","przeciw","ku"]),Kr=[{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\xF3j",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\xF3\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"}],Gr=class extends W{constructor(){super(),this.language="pl",this.direction="ltr",this.initializeKeywordsFromProfile(We,Kr),this.setNormalizer(new qe),this.registerExtractors(qr()),this.registerExtractor(new j),this.registerExtractor(new V),this.registerExtractors(Wr()),this.registerExtractor(new Rr),this.registerExtractor(new Pr);}classifyToken(t){let e=t.toLowerCase();return Ur.has(e)?"particle":this.isKeyword(e)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(t)?"event-modifier":t.startsWith("#")||t.startsWith(".")||t.startsWith("[")||t.startsWith("*")||t.startsWith("<")?"selector":t.startsWith('"')||t.startsWith("'")||/^\d/.test(t)?"literal":["==","!=","<=",">=","<",">","&&","||","!"].includes(t)?"operator":"identifier"}},Hr=new Gr;Ar("pl",Hr,We);var Yr=new Map,Xr=new Map,Zr=new Map;function Jr(t,e,r){Yr.set(t,e),Xr.set(t,r),Zr.delete(t);}function Qr(t){return /[а-яА-ЯіІїЇєЄґҐьЬ']/.test(t)}var Ue=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"]]),Ke=class{constructor(){this.language="uk";}isNormalizable(t){return t.length<3?false:Qr(t)}normalize(t){let e=t.toLowerCase();if(e.endsWith("\u0441\u044F")||e.endsWith("\u0441\u044C")){let s=this.tryReflexiveNormalization(e);if(s)return s}if(e.endsWith("\u0442\u0438")||e.endsWith("\u0447\u0438"))return T(t);let r=this.tryImperativeLookup(e);if(r)return r;let n=this.tryPastTenseNormalization(e);if(n)return n;let i=this.tryPresentTenseNormalization(e);if(i)return i;let o=this.tryGenericImperativeNormalization(e);return o||T(t)}tryReflexiveNormalization(t){let e=t.slice(0,-2);if(t.endsWith("\u0442\u0438\u0441\u044F")||t.endsWith("\u0447\u0438\u0441\u044F"))return T(t);let r=this.normalizeNonReflexive(e);if(r.confidence<1){let n=r.stem.endsWith("\u0442\u0438")?r.stem.slice(0,-2)+"\u0442\u0438\u0441\u044F":r.stem+"\u0441\u044F";return m(n,r.confidence*.95,{removedSuffixes:["\u0441\u044F",...r.metadata?.removedSuffixes||[]],conjugationType:"reflexive"})}return null}normalizeNonReflexive(t){if(t.endsWith("\u0442\u0438")||t.endsWith("\u0447\u0438"))return T(t);let e=this.tryImperativeLookup(t);if(e)return e;let r=this.tryPastTenseNormalization(t);if(r)return r;let n=this.tryPresentTenseNormalization(t);if(n)return n;let i=this.tryGenericImperativeNormalization(t);return i||T(t)}tryImperativeLookup(t){return Ue.has(t)?m(Ue.get(t),.95,{removedSuffixes:["imperative"],conjugationType:"imperative"}):null}tryGenericImperativeNormalization(t){return t.endsWith("\u0439\u0442\u0435")&&t.length>5?m(t.slice(0,-3)+"\u0442\u0438",.8,{removedSuffixes:["\u0439\u0442\u0435"],conjugationType:"imperative"}):t.endsWith("\u0456\u0442\u044C")&&t.length>5?m(t.slice(0,-3)+"\u0438\u0442\u0438",.8,{removedSuffixes:["\u0456\u0442\u044C"],conjugationType:"imperative"}):t.endsWith("\u0439")&&t.length>3?m(t.slice(0,-1)+"\u0442\u0438",.75,{removedSuffixes:["\u0439"],conjugationType:"imperative"}):t.endsWith("\u0438")&&t.length>3?m(t+"\u0442\u0438",.7,{removedSuffixes:["\u0438\u2192\u0438\u0442\u0438"],conjugationType:"imperative"}):null}tryPastTenseNormalization(t){return t.endsWith("\u0430\u043B\u0430")&&t.length>4?m(t.slice(0,-3)+"\u0430\u0442\u0438",.85,{removedSuffixes:["\u0430\u043B\u0430"],conjugationType:"past"}):t.endsWith("\u0438\u043B\u0430")&&t.length>4?m(t.slice(0,-3)+"\u0438\u0442\u0438",.85,{removedSuffixes:["\u0438\u043B\u0430"],conjugationType:"past"}):t.endsWith("\u0430\u043B\u0438")&&t.length>4?m(t.slice(0,-3)+"\u0430\u0442\u0438",.85,{removedSuffixes:["\u0430\u043B\u0438"],conjugationType:"past"}):t.endsWith("\u0438\u043B\u0438")&&t.length>4?m(t.slice(0,-3)+"\u0438\u0442\u0438",.85,{removedSuffixes:["\u0438\u043B\u0438"],conjugationType:"past"}):t.endsWith("\u0430\u0432")&&t.length>3?m(t.slice(0,-2)+"\u0430\u0442\u0438",.82,{removedSuffixes:["\u0430\u0432"],conjugationType:"past"}):t.endsWith("\u0438\u0432")&&t.length>3?m(t.slice(0,-2)+"\u0438\u0442\u0438",.82,{removedSuffixes:["\u0438\u0432"],conjugationType:"past"}):null}tryPresentTenseNormalization(t){return t.endsWith("\u0438\u0448")&&t.length>3?m(t.slice(0,-2)+"\u0438\u0442\u0438",.8,{removedSuffixes:["\u0438\u0448"],conjugationType:"present"}):t.endsWith("\u0438\u0442\u044C")&&t.length>4?m(t.slice(0,-3)+"\u0438\u0442\u0438",.78,{removedSuffixes:["\u0438\u0442\u044C"],conjugationType:"present"}):t.endsWith("\u0438\u043C\u043E")&&t.length>4?m(t.slice(0,-3)+"\u0438\u0442\u0438",.8,{removedSuffixes:["\u0438\u043C\u043E"],conjugationType:"present"}):t.endsWith("\u044F\u0442\u044C")&&t.length>4?m(t.slice(0,-3)+"\u0438\u0442\u0438",.78,{removedSuffixes:["\u044F\u0442\u044C"],conjugationType:"present"}):t.endsWith("\u0454\u0448")&&t.length>3?m(t.slice(0,-2)+"\u0430\u0442\u0438",.78,{removedSuffixes:["\u0454\u0448"],conjugationType:"present"}):t.endsWith("\u0435\u0448")&&t.length>3?m(t.slice(0,-2)+"\u0430\u0442\u0438",.75,{removedSuffixes:["\u0435\u0448"],conjugationType:"present"}):t.endsWith("\u0454")&&t.length>2?m(t.slice(0,-1)+"\u0430\u0442\u0438",.72,{removedSuffixes:["\u0454"],conjugationType:"present"}):t.endsWith("\u0454\u043C\u043E")&&t.length>4?m(t.slice(0,-3)+"\u0430\u0442\u0438",.8,{removedSuffixes:["\u0454\u043C\u043E"],conjugationType:"present"}):t.endsWith("\u044E\u0442\u044C")&&t.length>4?m(t.slice(0,-3)+"\u0430\u0442\u0438",.78,{removedSuffixes:["\u044E\u0442\u044C"],conjugationType:"present"}):t.endsWith("\u0443\u0442\u044C")&&t.length>4?m(t.slice(0,-3)+"\u0430\u0442\u0438",.75,{removedSuffixes:["\u0443\u0442\u044C"],conjugationType:"present"}):null}},Ge={code:"uk",name:"Ukrainian",nativeName:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",direction:"ltr",script:"cyrillic",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:true,defaultVerbForm:"infinitive",verb:{position:"start",subjectDrop:true,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:"body"},possessive:{marker:"",markerPosition:"after-object",usePossessiveAdjectives:true,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\u0434\u0430\u0442\u0438_\u0432_\u043A\u0456\u043D\u0435\u0446\u044C",alternatives:["\u0434\u043E\u043F\u0438\u0441\u0430\u0442\u0438"],normalized:"append",form:"infinitive"},prepend:{primary:"\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"},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"],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"},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"},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"},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"},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"},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:"\u0432\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0438_\u043F\u0430\u043A\u0435\u0442",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"}},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"]}},en=["===","!==","->","==","!=","<=",">=","&&","||","**","+=","-=","*=","/=","+","-","*","/","=",">","<","!","&","|","%","^","~"],tn=class{constructor(t=en){this.name="operator",this.operators=[...t].sort((e,r)=>r.length-e.length);}canExtract(t,e){return this.operators.some(r=>t.startsWith(r,e))}extract(t,e){for(let r of this.operators)if(t.startsWith(r,e))return {value:r,length:r.length};return null}},rn="()[]{},:;",nn=class{constructor(t=rn){this.punctuation=t,this.name="punctuation";}canExtract(t,e){return this.punctuation.includes(t[e])}extract(t,e){let r=t[e];return this.punctuation.includes(r)?{value:r,length:1}:null}};function on(t,e){let r=t[e];if(r==="#"){let n=t.slice(e).match(/^#[a-zA-Z_][\w-]*/);return n?n[0]:null}if(r==="."){let n=t.slice(e).match(/^\.[a-zA-Z_][\w-]*/);return n?n[0]:null}if(r==="["){let n=0,i=e;for(;i<t.length;){if(t[i]==="["&&n++,t[i]==="]"&&(n--,n===0))return t.slice(e,i+1);i++;}return null}if(r==="<"){let n=t.slice(e).match(/^<[\w-]+(?:[#.][\w-]+|\[[^\]]+\])*\s*\/>/);return n?n[0]:null}return null}var sn=class{constructor(){this.name="css-selector";}canExtract(t,e){let r=t[e];return r==="#"||r==="."||r==="["||r==="<"}extract(t,e){let r=on(t,e);return r?{value:r,length:r.length,metadata:{type:"css-selector"}}:null}},un=class{constructor(){this.name="event-modifier";}canExtract(t,e){if(t[e]!==".")return false;let r=t.slice(e);return /^\.(once|prevent|stop|debounce|throttle|queue)/.test(r)}extract(t,e){let r=t.slice(e).match(/^\.(?:once|prevent|stop|debounce|throttle|queue)(?:\(([^)]+)\))?/);if(!r)return null;let n=r[0],i=n.slice(1).split("(")[0],o=r[1];return {value:n,length:n.length,metadata:{modifierName:i,value:o?i==="queue"?o:parseInt(o,10):void 0}}}};function an(t,e){let r=t.slice(e);if(r.startsWith("http://")||r.startsWith("https://")){let n=r.match(/^https?:\/\/[^\s]*/);return n?n[0]:null}if(r.startsWith("//")){let n=r.match(/^\/\/[^\s]*/);return n?n[0]:null}if(r.startsWith("./")||r.startsWith("../")){let n=r.match(/^\.\.?\/[^\s]*/);return n?n[0]:null}if(r.startsWith("/")){let n=r.match(/^\/[^\s]*/);return n?n[0]:null}return null}var ln=class{constructor(){this.name="url";}canExtract(t,e){let r=t.slice(e);return r.startsWith("http://")||r.startsWith("https://")||r.startsWith("//")||r.startsWith("./")||r.startsWith("../")||r.startsWith("/")}extract(t,e){let r=an(t,e);return r?{value:r,length:r.length,metadata:{type:"url"}}:null}},cn=class{constructor(){this.name="variable-ref";}canExtract(t,e){return t[e]===":"&&e+1<t.length&&/[a-zA-Z_]/.test(t[e+1])}extract(t,e){if(!this.canExtract(t,e))return null;let r=1;for(;e+r<t.length&&/[a-zA-Z0-9_]/.test(t[e+r]);)r++;return {value:t.substring(e,e+r),length:r,metadata:{type:"variable-reference"}}}};function pn(t){return {isLetter:n=>t.test(n),isIdentifierChar:n=>/[0-9]/.test(n)||t.test(n)}}var dn=class{constructor(t,e,r){this.name=t;let n=pn(e);this.isLetter=n.isLetter,this.isIdentifierChar=n.isIdentifierChar,this.prepositions=r;}setContext(t){this.context=t;}canExtract(t,e){return this.isLetter(t[e])}extract(t,e){if(!this.context)throw new Error(`${this.name}: context not set`);let r=e,n="";for(;r<t.length&&this.isIdentifierChar(t[r]);)n+=t[r++];if(!n)return null;let i=n.toLowerCase(),o=this.prepositions.has(i),s=this.context.lookupKeyword(i),u=s&&s.normalized!==s.native?s.normalized:void 0,a;if(!s&&this.context.normalizer){let l=this.context.normalizer.normalize(n);if(l.stem!==n&&l.confidence>=.7){let c=this.context.lookupKeyword(l.stem);c&&(a=c.normalized);}}return {value:n,length:r-e,metadata:{normalized:u||a,isPreposition:o}}}},fn=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 mn(){return [new dn("ukrainian-keyword",/[a-zA-Zа-яА-ЯіІїЇєЄґҐьЬ']/,fn)]}function hn(t){let e=t.charCodeAt(0);return e>=65&&e<=90||e>=97&&e<=122||e===95||e===36}function vn(t){let e=t.charCodeAt(0);return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95||e===36}var yn=class{constructor(){this.name="ascii-identifier";}setContext(t){this.context=t;}canExtract(t,e){return hn(t[e])}extract(t,e){if(!this.context)throw new Error("AsciiIdentifierExtractor: context not set");let r=e,n="",i=e;for(;i<t.length&&vn(t[i]);)n+=t[i],i++;if(!n)return null;let o=this.context.lookupKeyword(n),s=o&&o.normalized!==o.native?o.normalized:void 0;return {value:n,length:i-r,metadata:{normalized:s}}}};function gn(){return [new ln,new un,new cn,new sn]}var En=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"]),bn=[{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:"\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\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"}],wn=class extends W{constructor(){super(),this.language="uk",this.direction="ltr",this.initializeKeywordsFromProfile(Ge,bn),this.setNormalizer(new Ke),this.registerExtractors([...gn(),...mn(),new j,new V,new yn,new tn,new nn]);}classifyToken(t){let e=t.toLowerCase();return En.has(e)?"particle":this.isKeyword(e)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(t)?"event-modifier":t.startsWith("#")||t.startsWith(".")||t.startsWith("[")||t.startsWith("*")||t.startsWith("<")?"selector":t.startsWith('"')||t.startsWith("'")||/^\d/.test(t)?"literal":"identifier"}},Sn=new wn;Jr("uk",Sn,Ge);var Cn=Object.defineProperty,kn=Object.getOwnPropertyNames,st=(t,e)=>function(){return t&&(e=(0, t[kn(t)[0]])(t=0)),e},Tn=(t,e)=>{for(var r in e)Cn(t,r,{get:e[r],enumerable:true});};function He(t,e){return t.replace(/\{(\w+)\}/g,(r,n)=>String(e[n]??`{${n}}`))}function z(t,e,r={},n){let i=ut[t],o=He(i,r),s=at[t],u=s?He(s,r):void 0;return {code:t,message:o,severity:e,...n&&{role:n},...u&&{suggestion:u}}}var v,ut,at,xn=st({"src/generators/schema-error-codes.ts"(){v={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"},ut={[v.AMBIGUOUS_TYPE_LITERAL_SELECTOR]:"Role '{role}' accepts both 'literal' and 'selector'. This may cause ambiguous type inference for values starting with special characters (* . # etc.).",[v.TOO_MANY_EXPECTED_TYPES]:"Role '{role}' accepts {count} different types. This may make type inference unreliable.",[v.MULTI_TYPE_PATIENT_EXPECTED]:"Role '{role}' accepts multiple types (expected for {command} command).",[v.NO_REQUIRED_ROLES]:"Command has no required roles. Is this intentional?",[v.NO_REQUIRED_ROLES_EXPECTED]:"Command has no required roles (expected for {command}).",[v.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.",[v.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.",[v.EVENT_HANDLER_MISSING_EVENT]:"Event handler command should have an 'event' role to specify which event to listen for.",[v.EVENT_HANDLER_EVENT_NOT_REQUIRED]:"Event role should be required - every event handler needs an event to listen for.",[v.CONDITIONAL_MISSING_CONDITION]:"Conditional command should have a 'condition' role for the boolean expression.",[v.CONDITIONAL_CONDITION_NOT_REQUIRED]:"Condition role should be required - conditionals need a condition to evaluate.",[v.FOR_LOOP_MISSING_SOURCE]:"For-loop should have a 'source' role for the collection to iterate over.",[v.WHILE_LOOP_MISSING_CONDITION]:"While-loop should have a 'condition' role for the loop condition.",[v.VALUE_TYPE_MISMATCH]:"Role '{role}' of command '{command}' expects type [{expectedTypes}], got '{actualType}'.",[v.SELECTOR_KIND_MISMATCH]:"Role '{role}' of command '{command}' expects selector kind [{selectorKinds}], got '{actualKind}'.",[v.SELECTOR_KINDS_WITHOUT_SELECTOR_TYPE]:"Role '{role}' has selectorKinds but expectedTypes does not include 'selector'.",[v.KEYWORD_COLLISION]:"Keyword '{keyword}' is used by multiple commands: {commands}. Only the first-registered command will be reachable."},at={[v.AMBIGUOUS_TYPE_LITERAL_SELECTOR]:"Consider being more specific about which type is expected, or use explicit type markers.",[v.TOO_MANY_EXPECTED_TYPES]:"Consider narrowing the accepted types to improve type inference reliability.",[v.TRANSITION_PATIENT_ACCEPTS_SELECTOR]:"Remove 'selector' from expectedTypes and only accept 'literal'.",[v.TRANSITION_MISSING_GOAL]:"Add a 'goal' role with expectedTypes ['literal', 'variable'].",[v.EVENT_HANDLER_MISSING_EVENT]:"Add an 'event' role with expectedTypes ['literal'].",[v.EVENT_HANDLER_EVENT_NOT_REQUIRED]:"Set required: true on the 'event' role.",[v.CONDITIONAL_MISSING_CONDITION]:"Add a 'condition' role with expectedTypes ['expression'].",[v.CONDITIONAL_CONDITION_NOT_REQUIRED]:"Set required: true on the 'condition' role.",[v.FOR_LOOP_MISSING_SOURCE]:"Add a 'source' role for the collection to iterate over.",[v.WHILE_LOOP_MISSING_CONDITION]:"Add a 'condition' role for the loop continuation condition.",[v.VALUE_TYPE_MISMATCH]:"Ensure the value matches one of the expected types: [{expectedTypes}].",[v.SELECTOR_KIND_MISMATCH]:"Use a selector of the correct kind: [{selectorKinds}].",[v.SELECTOR_KINDS_WITHOUT_SELECTOR_TYPE]:"Either add 'selector' to expectedTypes or remove selectorKinds.",[v.KEYWORD_COLLISION]:"Give each command a unique keyword. Move the shared keyword to alternatives on one command, or use a more specific translation."};}}),lt={};Tn(lt,{SchemaErrorCodes:()=>v,formatValidationResults:()=>In,getValidationStats:()=>_n,validateAllKeywordCollisions:()=>Ln,validateAllSchemas:()=>On,validateCommandSchema:()=>ct,validateKeywordCollisions:()=>pt,validateRoleValues:()=>Mn});function An(t,e){return {action:t,items:e,get notes(){return e.filter(r=>r.severity==="note").map(r=>r.message)},get warnings(){return e.filter(r=>r.severity==="warning").map(r=>r.message)},get errors(){return e.filter(r=>r.severity==="error").map(r=>r.message)}}}function ct(t){let e=[];for(let n of t.roles)n.expectedTypes.includes("literal")&&n.expectedTypes.includes("selector")&&(n.role==="patient"&&Se.has(t.action)?e.push(z(v.MULTI_TYPE_PATIENT_EXPECTED,"note",{role:n.role,command:t.action},n.role)):e.push(z(v.AMBIGUOUS_TYPE_LITERAL_SELECTOR,"warning",{role:n.role},n.role))),n.expectedTypes.length>3&&!Se.has(t.action)&&e.push(z(v.TOO_MANY_EXPECTED_TYPES,"warning",{role:n.role,count:n.expectedTypes.length},n.role));for(let n of t.roles)n.selectorKinds&&n.selectorKinds.length>0&&(n.expectedTypes.includes("selector")||e.push(z(v.SELECTOR_KINDS_WITHOUT_SELECTOR_TYPE,"warning",{role:n.role},n.role)));switch(t.action){case "transition":zn(t,e);break;case "on":Rn(t,e);break;case "if":case "unless":Nn(t,e);break;case "repeat":case "for":case "while":Pn(t,e);break}return t.roles.filter(n=>n.required).length===0&&(dt.has(t.action)?e.push(z(v.NO_REQUIRED_ROLES_EXPECTED,"note",{command:t.action})):e.push(z(v.NO_REQUIRED_ROLES,"warning",{}))),An(t.action,e)}function zn(t,e){let r=t.roles.find(i=>i.role==="patient"),n=t.roles.find(i=>i.role==="goal");r&&r.expectedTypes.includes("selector")&&e.push(z(v.TRANSITION_PATIENT_ACCEPTS_SELECTOR,"warning",{},"patient")),r&&!n&&e.push(z(v.TRANSITION_MISSING_GOAL,"error",{}));}function Rn(t,e){let r=t.roles.find(n=>n.role==="event");r||e.push(z(v.EVENT_HANDLER_MISSING_EVENT,"warning",{})),r&&!r.required&&e.push(z(v.EVENT_HANDLER_EVENT_NOT_REQUIRED,"warning",{}));}function Nn(t,e){let r=t.roles.find(n=>n.role==="condition");r||e.push(z(v.CONDITIONAL_MISSING_CONDITION,"warning",{})),r&&!r.required&&e.push(z(v.CONDITIONAL_CONDITION_NOT_REQUIRED,"warning",{}));}function Pn(t,e){t.action==="for"?t.roles.find(n=>n.role==="source")||e.push(z(v.FOR_LOOP_MISSING_SOURCE,"warning",{})):t.action==="while"&&(t.roles.find(n=>n.role==="condition")||e.push(z(v.WHILE_LOOP_MISSING_CONDITION,"warning",{})));}function On(t,e={}){let r=new Map,{includeNotes:n=false}=e;for(let[i,o]of Object.entries(t)){let s=ct(o),u=s.items.some(l=>l.severity==="warning"||l.severity==="error"),a=n&&s.items.some(l=>l.severity==="note");(u||a)&&r.set(i,s);}return r}function In(t,e={}){let r=[],{showNotes:n=false,showCodes:i=true}=e;for(let[o,s]of t){let u=s.items.filter(c=>c.severity==="error"),a=s.items.filter(c=>c.severity==="warning"),l=s.items.filter(c=>c.severity==="note");if(u.length>0){r.push(` \u274C ${o}:`);for(let c of u){let p=i?` [${c.code}]`:"";r.push(` ERROR${p}: ${c.message}`),c.suggestion&&r.push(` \u{1F4A1} Suggestion: ${c.suggestion}`);}}if(a.length>0){r.push(` \u26A0\uFE0F ${o}:`);for(let c of a){let p=i?` [${c.code}]`:"";r.push(` ${p?`${c.code}: `:""}${c.message}`),c.suggestion&&r.push(` \u{1F4A1} ${c.suggestion}`);}}if(n&&l.length>0){r.push(` \u2139\uFE0F ${o}:`);for(let c of l){let p=i?` [${c.code}]`:"";r.push(` ${p?`${c.code}: `:""}${c.message}`);}}}return r.join(`
2
+ `)}function _n(t){let e=0,r=0,n=0,i={};for(let o of t.values())for(let s of o.items)s.severity==="error"?e++:s.severity==="warning"?r++:s.severity==="note"&&n++,i[s.code]=(i[s.code]||0)+1;return {totalCommands:t.size,errors:e,warnings:r,notes:n,byCode:i}}function Mn(t,e){let r=[];for(let n of e){let i=t.roles.find(o=>o.role===n.role);i&&(i.expectedTypes.length>0&&!i.expectedTypes.includes(n.type)&&(i.expectedTypes.includes("expression")||r.push({level:"error",role:n.role,message:`${t.action}.${n.role} expects type [${i.expectedTypes.join(", ")}], got '${n.type}'`,code:v.VALUE_TYPE_MISMATCH})),n.type==="selector"&&n.selectorKind&&i.selectorKinds&&i.selectorKinds.length>0&&(i.selectorKinds.includes(n.selectorKind)||r.push({level:"error",role:n.role,message:`${t.action}.${n.role} expects selector kind [${i.selectorKinds.join(", ")}], got '${n.selectorKind}'`,code:v.SELECTOR_KIND_MISMATCH})));}return r}function pt(t){let e=[];if(!t.keywords)return {language:t.code,collisions:e};let r=new Map;for(let[i,o]of Object.entries(t.keywords)){if(!o||!o.primary)continue;let s=r.get(o.primary)||[];if(s.push({command:i,isPrimary:true}),r.set(o.primary,s),o.alternatives)for(let u of o.alternatives){let a=r.get(u)||[];a.push({command:i,isPrimary:false}),r.set(u,a);}}for(let[i,o]of r){let s=[...new Set(o.map(l=>l.command))];if(s.length<=1)continue;let u=o.filter(l=>l.isPrimary).length,a;u>=2?a="primary-primary":u===1?a="primary-alternative":a="alternative-alternative",e.push({keyword:i,commands:s.sort(),type:a});}let n={"primary-primary":0,"primary-alternative":1,"alternative-alternative":2};return e.sort((i,o)=>n[i.type]-n[o.type]),{language:t.code,collisions:e}}function Ln(t){let e=[];for(let[,r]of Object.entries(t)){let n=pt(r);n.collisions.length>0&&e.push(n);}return e.sort((r,n)=>r.language.localeCompare(n.language))}var Se,dt,Dn=st({"src/generators/schema-validator.ts"(){xn(),Se=new Set(["put","append","prepend","log","throw","make","measure","return","swap","morph","beep","copy"]),dt=new Set(["compound","else","halt","continue","async","init","settle","focus","blur","return","js","measure","break","exit","beep"]);}});function re(t){let e="complex";return t.startsWith("#")&&!t.includes(" ")?e="id":t.startsWith(".")&&!t.includes(" ")?e="class":t.startsWith("[")&&t.endsWith("]")?e="attribute":/^[a-z][a-z0-9]*$/i.test(t)&&(e="element"),{type:"selector",value:t,selectorKind:e}}function k(t,e){let r={type:"literal",value:t};return e!==void 0?{type:"literal",value:t,dataType:e}:r}function Ye(t){return Me(t)}function L(t){return {type:"reference",value:t}}function Ee(t,e){return {type:"property-path",object:t,property:e}}function le(t,e,r){let n={kind:"command",action:t,roles:new Map(Object.entries(e))};return r!==void 0?{...n,metadata:r}:n}function Xe(t,e,r,n,i,o){let s=new Map;s.set("event",t);let u={kind:"event-handler",action:"on",roles:s,body:e};return r!==void 0&&(u.eventModifiers=r),n!==void 0&&(u.metadata=n),u}function Ze(t,e="then",r){let n={kind:"compound",action:"compound",roles:new Map,statements:t,chainType:e};return r!==void 0&&(n.metadata=r),n}function Je(t,e){return !e||e.length===0||e.includes(t)||e.includes("expression")?true:t==="property-path"?e.some(r=>["selector","reference","expression"].includes(r)):false}function Fn(t,e){return t.possessive?.keywords?.[e]}var K=new Map,G=new Map,ce=new Map,Ce=null;function ft(t,e){let r={...t};for(let n of Object.keys(e)){let i=e[n],o=t[n];i!==void 0&&(typeof i=="object"&&i!==null&&!Array.isArray(i)&&typeof o=="object"&&o!==null&&!Array.isArray(o)?r[n]=ft(o,i):r[n]=i);}return r}function Bn(t,e){return ft(t,e)}function Te(t){if(!t.extends)return t;let e=G.get(t.extends);if(!e)return console.warn(`[Registry] Profile '${t.code}' extends '${t.extends}' but base is not registered. Make sure to import the base language before the variant.`),t;let r=Te(e);return Bn(r,t)}function mt(t){Ce=t;}var Qe=new Map;function H(t){return t.split("-")[0]}function Y(t){return t.includes("-")}function $n(t){let e=K.get(t);if(!e&&Y(t)){let r=H(t);e=K.get(r);}if(!e){let r=Array.from(K.keys()).join(", ");throw new Error(`Language '${t}' is not registered. Registered languages: ${r||"none"}. Import the language module first: import '@lokascript/semantic/languages/${t}';`)}return e}function jn(t){let e=G.get(t);if(!e&&Y(t)){let r=H(t);e=G.get(r);}if(!e){let r=Array.from(G.keys()).join(", ");throw new Error(`Language profile '${t}' is not registered. Registered languages: ${r||"none"}. Import the language module first: import '@lokascript/semantic/languages/${t}';`)}return Te(e)}function Vn(t){let e=K.get(t);return !e&&Y(t)&&(e=K.get(H(t))),e}function D(t){let e=G.get(t);return !e&&Y(t)&&(e=G.get(H(t))),e?Te(e):void 0}function ht(){return Array.from(K.keys())}function Wn(t,e){return $n(e).tokenize(t)}function U(t){let e=ce.get(t);if(!e&&Y(t)&&(e=ce.get(H(t))),e)return e;let r=Qe.get(t);if(!r&&Y(t)&&(r=Qe.get(H(t))),r)return ce.set(t,r),r;if(!Ce)throw new Error(`No patterns registered for language '${t}'. Either import the language module or set a pattern generator.`);let n=jn(t),i=Ce(n);return ce.set(t,i),i}var be=.8,Un=.6,Kn=.15,Gn=.5,et=.15,tt=.1,rt=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"]),Hn={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"]},Yn=class{calculate(t){return this.calculateWithBreakdown(t).final}calculateWithBreakdown(t){let e=this.scoreRoleCoverage(t),r=this.scoreStemPenalty(t),n=this.scoreLanguageBoost(t),i=this.scoreLanguageAdjustment(t),o=e;return o=Math.max(Gn,o+r),o=Math.min(1,o+n),o=Math.max(0,Math.min(1,o+i)),{roleCoverage:e,stemPenalty:r,languageBoost:n,languageAdjustment:i,final:o}}scoreRoleCoverage(t){let{pattern:e,captured:r}=t,n=0,i=0,o=s=>e.extraction?.[s]?.default!==void 0;for(let s of e.template.tokens)if(s.type==="role")i+=1,r.has(s.role)&&(n+=1);else if(s.type==="group")for(let u of s.tokens)u.type==="role"&&(i+=be,r.has(u.role)?n+=be:o(u.role)&&(n+=be*Un));return i>0?n/i:1}scoreStemPenalty(t){let{stemMatchCount:e,totalKeywordMatches:r}=t;return e<=0||r<=0?0:-(e/r)*Kn}scoreLanguageBoost(t){let{pattern:e}=t;if(e.language!=="ar")return 0;let r=e.template.tokens[0];return !r||r.type!=="literal"?0:rt.has(r.value)||r.alternatives?.some(n=>rt.has(n))?et:0}scoreLanguageAdjustment(t){let{pattern:e,captured:r}=t;if(e.language!=="ar")return 0;let n=0;for(let[i,o]of r.entries()){let s=Hn[i];if(!s||s.length===0)continue;let u="metadata"in o?o.metadata:void 0;u&&typeof u.prepositionValue=="string"&&(s.includes(u.prepositionValue)?n+=.1:n-=.1);}return Math.max(-tt,Math.min(tt,n))}},Xn=new Yn,de=class te{constructor(e){this.matchCache=new Map,this.stemMatchCount=0,this.totalKeywordMatches=0,this.confidenceModel=e??Xn;}matchPattern(e,r){let n=e.mark(),i=new Map;if(this.currentProfile=D(r.language),this.stemMatchCount=0,this.totalKeywordMatches=0,!this.matchTokenSequence(e,r.template.tokens,i))return e.reset(n),null;let s=this.confidenceModel.calculate({pattern:r,captured:i,stemMatchCount:this.stemMatchCount,totalKeywordMatches:this.totalKeywordMatches});return this.applyExtractionRules(r,i),{pattern:r,captured:i,consumedTokens:e.position()-n.position,confidence:s}}matchBest(e,r){this.matchCache.clear();let n=[],i=e.position();for(let s of r){let u=e.mark(),a=`${i}:${s.id}`,l;this.matchCache.has(a)?l=this.matchCache.get(a):(l=this.matchPattern(e,s),this.matchCache.set(a,l)),l&&n.push(l),e.reset(u);}if(n.length===0)return null;n.sort((s,u)=>{let a=u.pattern.priority-s.pattern.priority;return a!==0?a:u.confidence-s.confidence});let o=n[0];return this.matchPattern(e,o.pattern),o}matchTokenSequence(e,r,n){let i=r[0],o=i?.type==="literal"&&(i.value==="and"||i.value==="then"||i.alternatives?.includes("and")||i.alternatives?.includes("then"));if(this.currentProfile?.code==="ar"&&!o)for(;e.peek()?.kind==="conjunction";)e.advance();for(let s of r)if(!this.matchPatternToken(e,s,n)){if(this.isOptional(s))continue;return false}return true}matchPatternToken(e,r,n){switch(r.type){case "literal":return this.matchLiteralToken(e,r);case "role":return this.matchRoleToken(e,r,n);case "group":return this.matchGroupToken(e,r,n);default:return false}}matchLiteralToken(e,r){let n=e.peek();if(!n)return false;let i=this.getMatchType(n,r.value);if(i!=="none")return this.totalKeywordMatches++,i==="stem"&&this.stemMatchCount++,e.advance(),true;if(r.alternatives)for(let o of r.alternatives){let s=this.getMatchType(n,o);if(s!=="none")return this.totalKeywordMatches++,s==="stem"&&this.stemMatchCount++,e.advance(),true}return false}matchRoleToken(e,r,n){this.skipNoiseWords(e);let i=e.peek();if(!i)return r.optional||false;let o=this.tryMatchPossessiveExpression(e);if(o)return r.expectedTypes&&r.expectedTypes.length>0&&!r.expectedTypes.includes(o.type)&&!r.expectedTypes.includes("expression")?r.optional||false:(n.set(r.role,o),true);let s=this.tryMatchMethodCallExpression(e);if(s)return r.expectedTypes&&r.expectedTypes.length>0&&!r.expectedTypes.includes(s.type)&&!r.expectedTypes.includes("expression")?r.optional||false:(n.set(r.role,s),true);let u=this.tryMatchPossessiveSelectorExpression(e);if(u)return r.expectedTypes&&r.expectedTypes.length>0&&!Je(u.type,r.expectedTypes)?r.optional||false:(n.set(r.role,u),true);let a=this.tryMatchPropertyAccessExpression(e);if(a)return r.expectedTypes&&r.expectedTypes.length>0&&!r.expectedTypes.includes(a.type)&&!r.expectedTypes.includes("expression")?r.optional||false:(n.set(r.role,a),true);let l=this.tryMatchSelectorPropertyExpression(e);if(l)return r.expectedTypes&&r.expectedTypes.length>0&&!Je(l.type,r.expectedTypes)?r.optional||false:(n.set(r.role,l),true);let c=this.tokenToSemanticValue(i);return !c||r.expectedTypes&&r.expectedTypes.length>0&&!r.expectedTypes.includes(c.type)?r.optional||false:(n.set(r.role,c),e.advance(),true)}tryMatchPossessiveExpression(e){let r=e.peek();if(!r||!this.currentProfile)return null;let n=(r.normalized||r.value).toLowerCase(),i=Fn(this.currentProfile,n);if(!i)return null;let o=e.mark();e.advance();let s=e.peek();if(!s)return e.reset(o),null;if(s.kind==="identifier"||s.kind==="keyword"&&!this.isStructuralKeyword(s.value)||s.kind==="selector"&&s.value.startsWith("*")||s.kind==="selector"&&s.value.startsWith("@")||s.kind==="selector"&&s.value.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(s.value)){e.advance();let u=s.value;s.kind==="selector"&&u.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(u)&&(u=u.substring(1));let a=u;for(;e.peek()?.kind==="selector"&&e.peek().value.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(e.peek().value);)a+=e.peek().value,e.advance();let l=e.peek();return l?.kind==="literal"&&l.value.startsWith("(")&&(a+=l.value,e.advance()),Ee(L(i),a)}return e.reset(o),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(e){let r=e.peek();if(!r||r.kind!=="selector")return null;let n=e.mark();e.advance();let i=e.peek();if(!i||i.kind!=="operator"||i.value!==".")return e.reset(n),null;e.advance();let o=e.peek();if(!o||o.kind!=="identifier")return e.reset(n),null;e.advance();let s=e.peek();if(!s||s.kind!=="punctuation"||s.value!=="(")return e.reset(n),null;e.advance();let u=[];for(;!e.isAtEnd()&&u.length<te.MAX_METHOD_ARGS;){let l=e.peek();if(!l)break;if(l.kind==="punctuation"&&l.value===")"){e.advance();break}if(l.kind==="punctuation"&&l.value===","){e.advance();continue}u.push(l.value),e.advance();}return {type:"expression",raw:`${r.value}.${o.value}(${u.join(", ")})`}}tryMatchPropertyAccessExpression(e){let r=e.peek();if(!r||r.kind!=="identifier"&&r.kind!=="keyword")return null;let n=e.mark();e.advance();let i=e.peek();if(!i||i.kind!=="operator"||i.value!==".")return e.reset(n),null;e.advance();let o=e.peek();if(!o||o.kind!=="identifier")return e.reset(n),null;e.advance();let s=`${r.value}.${o.value}`,u=1;for(;!e.isAtEnd()&&u<te.MAX_PROPERTY_DEPTH;){let l=e.peek();if(!l||l.kind!=="operator"||l.value!==".")break;e.advance();let c=e.peek();if(!c||c.kind!=="identifier")break;e.advance(),s+=`.${c.value}`,u++;}let a=e.peek();if(a&&a.kind==="punctuation"&&a.value==="("){e.advance();let l=[],c=0;for(;!e.isAtEnd()&&l.length<te.MAX_METHOD_ARGS;){let d=e.peek();if(!d)break;if(d.kind==="punctuation"&&d.value===")"){if(c===0){e.advance();break}c--;}if(d.kind==="punctuation"&&d.value==="("&&c++,d.kind==="punctuation"&&d.value===","){e.advance();continue}l.push(d.value),e.advance();}return {type:"expression",raw:`${s}(${l.join(", ")})`}}return {type:"expression",raw:s}}tryMatchPossessiveSelectorExpression(e){let r=e.peek();if(!r||r.kind!=="selector")return null;let n=e.mark();e.advance();let i=e.peek();if(!i||i.kind!=="punctuation"||i.value!=="'s")return e.reset(n),null;e.advance();let o=e.peek();return !o||o.kind!=="selector"&&o.kind!=="identifier"?(e.reset(n),null):(e.advance(),Ee(re(r.value),o.value))}tryMatchSelectorPropertyExpression(e){let r=e.peek();if(!r||r.kind!=="selector"||!r.value.startsWith("#"))return null;let n=e.mark();e.advance();let i=e.peek();if(!i||i.kind!=="selector"||!i.value.startsWith("."))return e.reset(n),null;let o=e.peek(1);o&&o.kind,e.advance();let s=i.value.slice(1);return Ee(re(r.value),s)}matchGroupToken(e,r,n){let i=e.mark(),o=new Set(n.keys());if(!this.matchTokenSequence(e,r.tokens,n)){e.reset(i);for(let u of n.keys())o.has(u)||n.delete(u);return r.optional||false}return true}getMatchType(e,r){return e.value===r?"exact":e.normalized===r?"normalized":e.stem===r&&e.stemConfidence!==void 0&&e.stemConfidence>=.7?"stem":e.kind==="keyword"&&e.value.toLowerCase()===r.toLowerCase()?"case-insensitive":"none"}tokenToSemanticValue(e){switch(e.kind){case "selector":return re(e.value);case "literal":return this.parseLiteralValue(e.value);case "keyword":let r=(e.normalized||e.value).toLowerCase();return Ye(r)?L(r):k(e.normalized||e.value);case "identifier":if(e.value.startsWith(":"))return L(e.value);let n=e.value.toLowerCase();return Ye(n)?L(n):{type:"expression",raw:e.value};case "url":return k(e.value,"string");default:return null}}parseLiteralValue(e){if(e.startsWith('"')||e.startsWith("'")||e.startsWith("`")||e.startsWith("\u300C")){let i=e.slice(1,-1);return k(i,"string")}if(e==="true")return k(true,"boolean");if(e==="false")return k(false,"boolean");let r=e.match(/^(\d+(?:\.\d+)?)(ms|s|m|h)?$/);if(r){let i=parseFloat(r[1]);return r[2]?k(e,"duration"):k(i,"number")}let n=parseFloat(e);return isNaN(n)?k(e,"string"):k(n,"number")}applyExtractionRules(e,r){for(let[n,i]of Object.entries(e.extraction))r.has(n)||(i.value!==void 0?r.set(n,{type:"literal",value:i.value}):i.default&&r.set(n,i.default));}isOptional(e){return e.type!=="literal"&&e.optional===true}skipNoiseWords(e){let r=e.peek();if(!r)return;let n=r.value.toLowerCase();if(te.ENGLISH_NOISE_WORDS.has(n)){let i=e.mark();e.advance();let o=e.peek();if(o&&(o.kind==="selector"||o.kind==="identifier"))return;e.reset(i);}n==="class"&&e.advance();}extractEventModifiers(e){let r={},n=false;for(;!e.isAtEnd();){let i=e.peek();if(!i||i.kind!=="event-modifier")break;let o=i.metadata;if(!o)break;switch(n=true,o.modifierName){case "once":r.once=true;break;case "debounce":typeof o.value=="number"&&(r.debounce=o.value);break;case "throttle":typeof o.value=="number"&&(r.throttle=o.value);break;case "queue":(o.value==="first"||o.value==="last"||o.value==="all"||o.value==="none")&&(r.queue=o.value);break}e.advance();}return n?r:void 0}};de.MAX_PROPERTY_DEPTH=10;de.MAX_METHOD_ARGS=20;de.ENGLISH_NOISE_WORDS=new Set(["the","a","an"]);var vt=de,q=new vt;function Zn(t){return Vn(t)}function we(t,e){return Wn(t,e)}function yt(){return ht()}var Jn={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"},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"},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"},es:{clic:"click",click:"click",entrada:"input",cambio:"change",env\u00EDo:"submit",enviar:"submit","tecla abajo":"keydown","tecla arriba":"keyup","rat\xF3n encima":"mouseover","rat\xF3n fuera":"mouseout",enfoque:"focus",desenfoque:"blur",carga:"load",desplazamiento:"scroll"},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",boyut_de\u011Fi\u015Ftir:"resize",kayd\u0131rma:"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"},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"},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"},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 \xFCber":"mouseover","maus raus":"mouseout",fokus:"focus",fokussieren:"focus",defokussieren:"blur",unsch\u00E4rfe:"blur",laden:"load",ladung:"load",scrollen:"scroll",bl\u00E4ttern:"scroll"},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"},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","\xF1it'iy":"click",\u00F1itiy:"click",yaykuchiy:"input",yaykuy:"input",tikray:"change","t'ikray":"change",apachiy:"submit",kachay:"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"}};var ei={action:"toggle",description:"Toggle a class or attribute on/off",category:"dom-class",primaryRole:"patient",roles:[{role:"patient",description:"The class or attribute to toggle",required:true,expectedTypes:["selector"],selectorKinds:["class","attribute"],svoPosition:1,sovPosition:2},{role:"destination",description:"The target element (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}],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)"}},ti={action:"add",description:"Add a class or attribute to an element",category:"dom-class",primaryRole:"patient",roles:[{role:"patient",description:"The class or attribute to add",required:true,expectedTypes:["selector"],svoPosition:1,sovPosition:2},{role:"destination",description:"The target element (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1,markerOverride:{en:"to"}}],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"}},ri={action:"remove",description:"Remove a class or attribute from an element",category:"dom-class",primaryRole:"patient",roles:[{role:"patient",description:"The class or attribute to remove",required:true,expectedTypes:["selector"],svoPosition:1,sovPosition:2},{role:"source",description:"The element to remove from (defaults to me)",required:false,expectedTypes:["selector","reference"],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"}},ni={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:true,expectedTypes:["literal","selector","reference","expression"],svoPosition:1,sovPosition:1},{role:"destination",description:"Where to put the content",required:true,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:2,markerOverride:{en:"into"}}],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"}},ii={action:"set",description:"Set a property or variable to a value",category:"variable",primaryRole:"destination",roles:[{role:"destination",description:"The property or variable to set",required:true,expectedTypes:["selector","reference","expression"],svoPosition:1,sovPosition:1,markerOverride:{en:"",ja:"\u3092",ko:"\uB97C",tr:"i",ar:"",sw:"",tl:"",bn:"\u0995\u09C7",qu:"ta"}},{role:"patient",description:"The value to set",required:true,expectedTypes:["literal","expression","reference"],svoPosition:2,sovPosition:2,markerOverride:{en:"to",es:"a",pt:"para",fr:"\xE0",de:"auf",id:"ke",ja:"\u306B",ko:"\uC73C\uB85C",tr:"e",ar:"\u0625\u0644\u0649",sw:"kwenye",tl:"sa",bn:"\u09A4\u09C7",qu:"man"}}],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>"}},oi={action:"show",description:"Make an element visible",category:"dom-visibility",primaryRole:"patient",roles:[{role:"patient",description:"The element to show",required:true,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1},{role:"style",description:"Animation style (fade, slide, etc.)",required:false,expectedTypes:["literal"],svoPosition:2,sovPosition:2}]},si={action:"hide",description:"Make an element invisible",category:"dom-visibility",primaryRole:"patient",roles:[{role:"patient",description:"The element to hide",required:true,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1},{role:"style",description:"Animation style (fade, slide, etc.)",required:false,expectedTypes:["literal"],svoPosition:2,sovPosition:2}]},ui={action:"on",description:"Handle an event",category:"event",primaryRole:"event",hasBody:true,roles:[{role:"event",description:"The event to handle",required:true,expectedTypes:["literal"],svoPosition:1,sovPosition:2},{role:"source",description:"The element to listen on (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}]},ai={action:"trigger",description:"Trigger/dispatch an event",category:"event",primaryRole:"event",roles:[{role:"event",description:"The event to trigger (supports namespaced events like draggable:start)",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"The target element (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}]},li={action:"wait",description:"Wait for a duration or event",category:"async",primaryRole:"patient",roles:[{role:"patient",description:"Duration or event to wait for",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1}]},ci={action:"fetch",description:"Fetch data from a URL",category:"async",primaryRole:"source",roles:[{role:"source",description:"The URL to fetch from",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1,renderOverride:{en:""}},{role:"responseType",description:"Response format (json, text, html, blob, etc.)",required:false,expectedTypes:["literal","expression"],svoPosition:2,sovPosition:2},{role:"method",description:"HTTP method (GET, POST, etc.)",required:false,expectedTypes:["literal"],svoPosition:3,sovPosition:3},{role:"destination",description:"Where to store the result",required:false,expectedTypes:["selector","reference"],svoPosition:4,sovPosition:4}]},pi={action:"increment",description:"Increment a numeric value",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The value to increment",required:true,expectedTypes:["selector","reference","expression"],svoPosition:1,sovPosition:1},{role:"quantity",description:"Amount to increment by (defaults to 1)",required:false,expectedTypes:["literal"],default:{type:"literal",value:1,dataType:"number"},svoPosition:2,sovPosition:2,markerOverride:{en:"by"}}]},di={action:"decrement",description:"Decrement a numeric value",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The value to decrement",required:true,expectedTypes:["selector","reference","expression"],svoPosition:1,sovPosition:1},{role:"quantity",description:"Amount to decrement by (defaults to 1)",required:false,expectedTypes:["literal"],default:{type:"literal",value:1,dataType:"number"},svoPosition:2,sovPosition:2,markerOverride:{en:"by"}}]},fi={action:"append",description:"Append content to an element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The content to append",required:true,expectedTypes:["literal","selector","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"The element to append to",required:true,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:1,markerOverride:{en:"to"}}]},mi={action:"prepend",description:"Prepend content to an element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The content to prepend",required:true,expectedTypes:["literal","selector","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"The element to prepend to",required:true,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:1,markerOverride:{en:"to"}}]},hi={action:"log",description:"Log a value to the console",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The value to log",required:true,expectedTypes:["literal","selector","reference","expression"],svoPosition:1,sovPosition:1}]},vi={action:"get",description:"Get a value from a source",category:"variable",primaryRole:"source",roles:[{role:"source",description:"The source to get from",required:true,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:"",sw:"",tl:"",bn:"\u0995\u09C7",qu:"ta"}},{role:"destination",description:"Where to store the result (optional)",required:false,expectedTypes:["reference"],svoPosition:2,sovPosition:1}]},yi={action:"take",description:"Take content from a source element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The class or element to take",required:true,expectedTypes:["selector"],svoPosition:1,sovPosition:2},{role:"source",description:"The element to take from (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}]},gi={action:"make",description:"Create a new element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element type or selector to create",required:true,expectedTypes:["literal","selector"],svoPosition:1,sovPosition:1}]},Ei={action:"halt",description:"Halt/stop execution or event propagation",category:"control-flow",primaryRole:"patient",roles:[{role:"patient",description:"What to halt (event, default, bubbling, etc.)",required:false,expectedTypes:["literal","reference","expression"],svoPosition:1,sovPosition:1}]},bi={action:"settle",description:"Wait for animations/transitions to settle",category:"async",primaryRole:"patient",roles:[{role:"patient",description:"The element to settle (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},wi={action:"throw",description:"Throw an error",category:"control-flow",primaryRole:"patient",roles:[{role:"patient",description:"The error message or object to throw",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1}]},Si={action:"send",description:"Send an event to an element",category:"event",primaryRole:"event",roles:[{role:"event",description:"The event to send",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"The target element (defaults to me)",required:false,expectedTypes:["selector","reference"],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:"\xE0",de:"an",id:"ke",qu:"-man",sw:"kwa"}}]},Ci={action:"if",description:"Conditional execution",category:"control-flow",primaryRole:"condition",hasBody:true,roles:[{role:"condition",description:"The condition to evaluate",required:true,expectedTypes:["expression"],svoPosition:1,sovPosition:1}]},ki={action:"unless",description:"Negated conditional execution (executes when condition is false)",category:"control-flow",primaryRole:"condition",hasBody:true,roles:[{role:"condition",description:"The condition to evaluate (body executes when false)",required:true,expectedTypes:["expression"],svoPosition:1,sovPosition:1}]},Ti={action:"else",description:"Else branch of conditional",category:"control-flow",primaryRole:"patient",hasBody:true,roles:[]},xi={action:"repeat",description:"Repeat a block of commands",category:"control-flow",primaryRole:"loopType",hasBody:true,roles:[{role:"loopType",description:"Loop variant: forever, times, for, while, until, until-event",required:true,expectedTypes:["literal"],svoPosition:0,sovPosition:0},{role:"quantity",description:"Number of times to repeat",required:false,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1},{role:"event",description:"Event to wait for (terminates loop)",required:false,expectedTypes:["literal","expression"],svoPosition:2,sovPosition:2},{role:"source",description:"Element to listen for event on",required:false,expectedTypes:["selector","reference"],svoPosition:3,sovPosition:3}],notes:'Can also use "repeat forever", "repeat until condition", or "repeat until event X from Y"'},Ai={action:"for",description:"Iterate over a collection",category:"control-flow",primaryRole:"patient",hasBody:true,roles:[{role:"patient",description:"The iteration variable",required:true,expectedTypes:["reference"],svoPosition:1,sovPosition:2},{role:"source",description:"The collection to iterate over",required:true,expectedTypes:["selector","reference","expression"],svoPosition:2,sovPosition:1,markerOverride:{en:"in"}}]},zi={action:"while",description:"Loop while condition is true",category:"control-flow",primaryRole:"condition",hasBody:true,roles:[{role:"condition",description:"The condition to check",required:true,expectedTypes:["expression"],svoPosition:1,sovPosition:1}]},Ri={action:"continue",description:"Continue to next loop iteration",category:"control-flow",primaryRole:"patient",roles:[]},Ni={action:"go",description:"Navigate to a URL",category:"navigation",primaryRole:"destination",roles:[{role:"destination",description:"The URL to navigate to",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1,markerOverride:{en:"to"},renderOverride:{en:""}}]},Pi={action:"transition",description:"Transition an element with animation",category:"dom-visibility",primaryRole:"patient",roles:[{role:"patient",description:"The property to transition (opacity, *background-color, etc.)",required:true,expectedTypes:["literal"],svoPosition:1,sovPosition:2,markerOverride:{en:"",ar:"",tl:"",sw:""}},{role:"goal",description:"The target value to transition to",required:true,expectedTypes:["literal","expression"],svoPosition:2,sovPosition:3,markerOverride:{en:"to",ar:"\u0625\u0644\u0649",tl:"sa",sw:"kwenye",bn:"\u09A4\u09C7",qu:"man",es:"a",pt:"para",fr:"\xE0",de:"auf",ja:"\u306B",ko:"\uC73C\uB85C",tr:"e",id:"ke"}},{role:"destination",description:"The target element (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:3,sovPosition:1},{role:"duration",description:"Transition duration (over 500ms, for 2 seconds)",required:false,expectedTypes:["literal"],svoPosition:4,sovPosition:4,markerOverride:{en:"over"}},{role:"style",description:"Easing function (ease-in, linear, etc.)",required:false,expectedTypes:["literal"],svoPosition:5,sovPosition:5}]},Oi={action:"clone",description:"Clone an element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element to clone",required:true,expectedTypes:["selector","reference"],svoPosition:1,sovPosition:2},{role:"destination",description:"Where to put the clone",required:false,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:1,markerOverride:{en:"into"}}]},Ii={action:"focus",description:"Focus an element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element to focus (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},_i={action:"blur",description:"Remove focus from an element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element to blur (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},Mi={action:"call",description:"Call a function",category:"control-flow",primaryRole:"patient",roles:[{role:"patient",description:"The function to call",required:true,expectedTypes:["expression","reference"],svoPosition:1,sovPosition:1}]},Li={action:"return",description:"Return a value from a function",category:"control-flow",primaryRole:"patient",roles:[{role:"patient",description:"The value to return",required:false,expectedTypes:["literal","expression","reference"],svoPosition:1,sovPosition:1}]},Di={action:"js",description:"Execute raw JavaScript code",category:"control-flow",primaryRole:"patient",hasBody:true,roles:[{role:"patient",description:"The JavaScript code to execute",required:false,expectedTypes:["expression"],svoPosition:1,sovPosition:1}]},Fi={action:"async",description:"Execute commands asynchronously",category:"async",primaryRole:"patient",hasBody:true,roles:[]},Bi={action:"tell",description:"Execute commands in context of another element",category:"control-flow",primaryRole:"destination",hasBody:true,roles:[{role:"destination",description:"The element to tell",required:true,expectedTypes:["selector","reference"],svoPosition:1,sovPosition:1,markerOverride:{en:""}}]},$i={action:"default",description:"Set a default value for a variable",category:"variable",primaryRole:"destination",roles:[{role:"destination",description:"The variable to set default for",required:true,expectedTypes:["reference"],svoPosition:1,sovPosition:1,markerOverride:{en:"",ar:"",tl:"",sw:"",bn:"\u0995\u09C7",qu:"ta"}},{role:"patient",description:"The default value",required:true,expectedTypes:["literal","expression"],svoPosition:2,sovPosition:2,markerOverride:{en:"to",ar:"\u0625\u0644\u0649",tl:"sa",sw:"kwenye",bn:"\u09A4\u09C7",qu:"man"}}]},ji={action:"init",description:"Initialization block that runs once",category:"control-flow",primaryRole:"patient",hasBody:true,roles:[]},Vi={action:"behavior",description:"Define a reusable behavior",category:"control-flow",primaryRole:"patient",hasBody:true,roles:[{role:"patient",description:"The behavior name (PascalCase identifier)",required:true,expectedTypes:["literal","reference","expression"],svoPosition:1,sovPosition:1}]},Wi={action:"install",description:"Install a behavior on an element",category:"control-flow",primaryRole:"patient",roles:[{role:"patient",description:"The behavior name to install",required:true,expectedTypes:["literal","reference","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"Element to install on (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}]},qi={action:"measure",description:"Measure element dimensions (x, y, width, height, etc.)",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"Property to measure (x, y, width, height, top, left, etc.)",required:false,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1},{role:"source",description:"Element to measure (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:2,markerOverride:{en:"of"}}]},Ui={action:"swap",description:"Swap DOM content using various strategies (innerHTML, outerHTML, delete, etc.)",category:"dom-content",primaryRole:"destination",roles:[{role:"method",description:"The swap strategy (innerHTML, outerHTML, beforebegin, afterend, delete)",required:false,expectedTypes:["literal"],svoPosition:1,sovPosition:3,markerOverride:{en:""}},{role:"destination",description:"The element to swap content in/for",required:true,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:1,markerOverride:{en:"of"}},{role:"patient",description:"The content to swap in (optional for delete)",required:false,expectedTypes:["literal","expression","selector"],svoPosition:3,sovPosition:2,markerOverride:{en:"with"}}]},Ki={action:"morph",description:"Morph an element into another using DOM diffing",category:"dom-content",primaryRole:"destination",roles:[{role:"destination",description:"The element to morph",required:true,expectedTypes:["selector","reference"],svoPosition:1,sovPosition:1,markerOverride:{en:""}},{role:"patient",description:"The target content/element to morph into",required:true,expectedTypes:["literal","expression","selector"],svoPosition:2,sovPosition:2,markerOverride:{en:"to"}}]},Gi={action:"beep",description:"Debug output for expressions with type information",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The expression(s) to debug",required:false,expectedTypes:["literal","selector","reference","expression"],svoPosition:1,sovPosition:1}]},Hi={action:"break",description:"Exit from the current loop",category:"control-flow",primaryRole:"patient",roles:[]},Yi={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:true,expectedTypes:["literal","selector","reference","expression"],svoPosition:1,sovPosition:1}]},Xi={action:"exit",description:"Exit from the current event handler",category:"control-flow",primaryRole:"patient",roles:[]},Zi={action:"pick",description:"Select a random element from a collection",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The items to pick from",required:true,expectedTypes:["literal","expression","reference"],svoPosition:1,sovPosition:1},{role:"source",description:'The array to pick from (with "from" keyword)',required:false,expectedTypes:["reference","expression"],svoPosition:2,sovPosition:2}]},Ji={action:"render",description:"Render a template with optional variables",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The template to render",required:true,expectedTypes:["selector","reference","expression"],svoPosition:1,sovPosition:2},{role:"style",description:"Variables to pass to the template (with keyword)",required:false,expectedTypes:["expression","reference"],svoPosition:2,sovPosition:1}]},gt={toggle:ei,add:ti,remove:ri,put:ni,set:ii,show:oi,hide:si,on:ui,trigger:ai,wait:li,fetch:ci,increment:pi,decrement:di,append:fi,prepend:mi,log:hi,get:vi,take:yi,make:gi,halt:Ei,settle:bi,throw:wi,send:Si,if:Ci,unless:ki,else:Ti,repeat:xi,for:Ai,while:zi,continue:Ri,go:Ni,transition:Pi,clone:Oi,focus:Ii,blur:_i,call:Mi,return:Li,js:Di,async:Fi,tell:Bi,default:$i,init:ji,behavior:Vi,install:Wi,measure:qi,swap:Ui,morph:Ki,beep:Gi,break:Hi,copy:Yi,exit:Xi,pick:Zi,render:Ji,compound:{action:"compound",description:"A compound node representing chained statements",primaryRole:"patient",category:"control-flow",hasBody:true,roles:[]}};function Qi(){return Object.values(gt).filter(t=>t.roles.length>0)}typeof process<"u"&&process.env.NODE_ENV!=="production"&&Promise.resolve().then(()=>(Dn(),lt)).then(({validateAllSchemas:t,formatValidationResults:e})=>{let r=t(gt);r.size>0&&(console.warn("[SCHEMA VALIDATION] Found issues in command schemas:"),console.warn(e(r)),console.warn(`
3
+ These warnings help identify potential schema design issues.`),console.warn("Fix them to improve type inference and avoid runtime bugs."));}).catch(t=>{console.debug("Schema validation skipped:",t);});var nt=class extends Error{constructor(t,e,r,n){super(t),this.name="SemanticParseError",this.language=e,this.input=r,this.diagnostics=n;}};function N(t,e,r){return {message:t,severity:e,source:"semantic-parser",...r&&{code:r}}}function pe(t,e){return e.length===0?t:{...t,diagnostics:e}}var X=class O{parse(e,r){let{modifiers:n,remainingInput:i}=this.extractStandaloneModifiers(e,r),o=i||e,s=[],u=we(o,r),a=U(r);if(a.length===0)throw new nt(`No patterns available for language: ${r}`,r,o,[N(`No patterns registered for language '${r}'`,"error","no-patterns")]);let l=[...a].sort((y,E)=>E.priority-y.priority),c=l.filter(y=>y.command==="on"),p=q.matchBest(u,c);if(p){s.push(N(`event pattern matched: ${p.pattern.id} (confidence: ${p.confidence.toFixed(2)})`,"info","pattern-match"));let y=this.buildEventHandler(p,u,r),E=n?this.applyModifiers(y,n):y;return pe(E,s)}s.push(N(`event patterns: ${c.length} tried, no match`,"info","stage-event"));let d=l.filter(y=>y.command!=="on"),f=q.matchBest(u,d);if(f)return s.push(N(`command pattern matched: ${f.pattern.id} (confidence: ${f.confidence.toFixed(2)})`,"info","pattern-match")),pe(this.buildCommand(f,r),s);s.push(N(`command patterns: ${d.length} tried, no match`,"info","stage-command"));let h=this.trySOVEventExtraction(o,r,l);if(h){s.push(N("SOV event extraction succeeded","info","stage-sov"));let y=n?this.applyModifiers(h,n):h;return pe(y,s)}s.push(N("SOV event extraction: no event keyword found","info","stage-sov"));let g=this.tryCompoundCommandParsing(u,d,r);if(g)return s.push(N("compound command parsing succeeded","info","stage-compound")),pe(g,s);throw s.push(N("compound parsing: no then-keywords or no command matches","info","stage-compound")),s.push(N(`all parse stages exhausted for "${o}"`,"error","parse-failed")),new nt(`Could not parse input in ${r}: ${o}`,r,o,s)}canParse(e,r){try{return this.parse(e,r),!0}catch{return false}}supportedLanguages(){return yt()}buildCommand(e,r){if(!e)throw new Error("No match to build command from");let n={};for(let[i,o]of e.captured)n[i]=o;return le(e.pattern.command,n,{sourceLanguage:r,patternId:e.pattern.id,confidence:e.confidence})}buildEventHandler(e,r,n){if(!e)throw new Error("No match to build event handler from");let i=e.captured.get("event");if(!i)throw new Error("Event handler pattern matched but no event captured");let o=q.extractEventModifiers(r),s=this.extractOrConjunctionEvents(r,n),u=i;s.length>0&&i.type==="literal"&&(u={type:"literal",value:[String(i.value),...s.map(p=>String("value"in p?p.value:""))].join(" or ")});let a,l=e.captured.get("action");if(l&&l.type==="literal"){let c=l.value,p={};for(let[h,g]of e.captured)h!=="event"&&h!=="action"&&h!=="continues"&&(p[h]=g);let d=le(c,p,{sourceLanguage:n,patternId:e.pattern.id,confidence:e.confidence}),f=e.captured.get("continues");if(f&&f.type==="literal"&&f.value==="then"){let h=U(n).filter(E=>E.command!=="on").sort((E,w)=>w.priority-E.priority),g=U(n).filter(E=>E.id.startsWith("grammar-")&&E.id.includes("-continuation")).sort((E,w)=>w.priority-E.priority),y=this.parseBodyWithGrammarPatterns(r,h,g,n);y.length>0?a=[d,...y]:a=[d];}else a=[d];}else {let c=U(n).filter(p=>p.command!=="on").sort((p,d)=>d.priority-p.priority);a=this.parseBodyWithClauses(r,c,n);}return Xe(u,a,o,{sourceLanguage:n,patternId:e.pattern.id,confidence:e.confidence})}parseBodyWithClauses(e,r,n){let i=[],o=[];for(;!e.isAtEnd();){let s=e.peek();if(!s)break;let u=s.kind==="conjunction"||s.kind==="keyword"&&this.isThenKeyword(s.value,n),a=s.kind==="keyword"&&this.isEndKeyword(s.value,n);if(u){if(o.length>0){let l=this.parseClause(o,r,n);i.push(...l),o.length=0;}e.advance();continue}if(a){if(o.length>0){let l=this.parseClause(o,r,n);i.push(...l);}e.advance();break}o.push(s),e.advance();}if(o.length>0){let s=this.parseClause(o,r,n);i.push(...s);}return i.length>1?[Ze(i,"then",{sourceLanguage:n})]:i}parseClause(e,r,n){if(e.length===0)return [];let i=new ee(e,n),o=[];for(;!i.isAtEnd();){let s=q.matchBest(i,r);s?o.push(this.buildCommand(s,n)):i.advance();}if(o.length===0){let s=this.parseSOVClauseByVerbAnchoring(e,n);if(s.length>0)return s}return o}static buildVerbLookup(e){let r=new Map;for(let[n,i]of Object.entries(e.keywords))if(!["on","if","else","when","where","while","for","end","then","and"].includes(n)&&(r.set(i.primary.toLowerCase(),n),i.alternatives))for(let o of i.alternatives)r.set(o.toLowerCase(),n);return r}static buildMarkerToRoleLookup(e){let r=new Map;for(let[n,i]of Object.entries(e.roleMarkers))if(i&&(r.set(i.primary,n),i.alternatives))for(let o of i.alternatives)r.has(o)||r.set(o,n);return r}parseSOVClauseByVerbAnchoring(e,r){let n=D(r);if(!n||n.wordOrder!=="SOV")return [];let i=O.buildVerbLookup(n),o=O.buildMarkerToRoleLookup(n),s=[],u=0;for(;u<e.length;){let a=-1,l="";for(let h=u;h<e.length;h++){let g=e[h],y=i.get(g.value.toLowerCase()),E=g.normalized?i.get(g.normalized.toLowerCase()):void 0,w=y||E;if(w){a=h,l=w;break}}if(a===-1)break;let c=e.slice(u,a),p=e.length;for(let h=a+1;h<e.length;h++){let g=e[h];if(g.kind==="conjunction"||this.isThenKeyword(g.value,r)){p=h;break}if(h>a+1&&(i.get(g.value.toLowerCase())||(g.normalized?i.get(g.normalized.toLowerCase()):void 0))){p=h;break}}let d=e.slice(a+1,p),f=this.extractRolesFromMarkedTokens(c,d,o,l,r);if(s.push(le(l,f,{sourceLanguage:r,confidence:.7})),u=p,u<e.length){let h=e[u];(h.kind==="conjunction"||this.isThenKeyword(h.value,r))&&u++;}}return s}extractRolesFromMarkedTokens(e,r,n,i,o){let s={},u=a=>{let l=[];for(let c of a){let p=n.get(c.value);if(p&&c.kind==="particle"&&l.length>0){let d=this.tokensToSemanticValue(l);if(d){let f=this.mapRoleForCommand(p,i,s);f&&(s[f]=d);}l=[];}else l.push(c);}if(l.length>0){let c=this.tokensToSemanticValue(l);c&&(s.patient?s.destination||(s.destination=c):s.patient=c);}};return u(e),u(r),s}mapRoleForCommand(e,r,n){return n[e]?e==="patient"&&!n.destination?"destination":e==="destination"&&!n.patient?"patient":e==="source"&&!n.source?"source":null:e}tokensToSemanticValue(e){if(e.length===0)return null;let r=e.filter(o=>o.kind!=="whitespace");if(r.length===0)return null;if(r.length===1)return this.tokenToSemanticValue(r[0]);let n=r.map(o=>o.value).join(""),i=r[0];return i.kind==="selector"||i.value.startsWith("#")||i.value.startsWith(".")||i.value.startsWith("@")||i.value.startsWith("*")?re(n):i.kind==="literal"||i.value.startsWith('"')||i.value.startsWith("'")?k(n):i.kind==="reference"?L(n):k(n)}tokenToSemanticValue(e){let r=e.value;if(e.kind==="selector"||r.startsWith("#")||r.startsWith(".")||r.startsWith("@")||r.startsWith("*"))return re(r);if(r.startsWith('"')||r.startsWith("'"))return k(r);if(/^-?\d+(\.\d+)?$/.test(r))return k(parseFloat(r));if(r==="true"||r==="\u771F"||r==="\uCC38"||r==="do\u011Fru")return k(true);if(r==="false"||r==="\u507D"||r==="\uAC70\uC9D3"||r==="yanl\u0131\u015F")return k(false);let n=e.normalized?.toLowerCase();return n==="me"||n==="it"||n==="you"||n==="result"||n==="body"?L(n):e.kind==="reference"?L(e.normalized||"me"):k(r)}parseBodyWithGrammarPatterns(e,r,n,i){let o=[];for(;!e.isAtEnd();){let s=e.peek();if(s&&this.isThenKeyword(s.value,i)){e.advance();continue}if(s&&this.isEndKeyword(s.value,i)){e.advance();break}let u=false;if(n.length>0){let a=q.matchBest(e,n);if(a){let l=a.pattern.command,c={};for(let[f,h]of a.captured)f!=="event"&&f!=="action"&&f!=="continues"&&(c[f]=h);let p=le(l,c,{sourceLanguage:i,patternId:a.pattern.id});o.push(p),u=true;let d=a.captured.get("continues");if(d&&d.type==="literal"&&d.value==="then")continue}}if(!u){let a=q.matchBest(e,r);a&&(o.push(this.buildCommand(a,i)),u=true);}u||e.advance();}return o}tryCompoundCommandParsing(e,r,n){let i=e.tokens;if(!i.some(a=>a.kind==="conjunction"||a.kind==="keyword"&&this.isThenKeyword(a.value,n)))return null;let s=new ee(i,n),u=this.parseBodyWithClauses(s,r,n);return u.length===0?null:u.length===1?u[0]:Ze(u,"then",{sourceLanguage:n,confidence:.65})}trySOVEventExtraction(e,r,n){let i=O.SOV_EVENT_MARKERS[r];if(!i)return null;let s=we(e,r).tokens,u=Jn[r],a=new Set;if(u)for(let b of Object.keys(u))a.add(b.toLowerCase());let l=O.SOV_SOURCE_MARKERS[r],c=-1,p="",d="",f=1;for(let b=0;b<s.length;b++){let x=s[b],I=x.value.toLowerCase(),_=I,F="",me=I.indexOf("[");me>0&&(_=I.slice(0,me),F=x.value.slice(me));let he=x.normalized?.toLowerCase(),Oe=he&&O.KNOWN_EVENTS.has(he),Ie=a.has(I)||a.has(_),Pt=O.KNOWN_EVENTS.has(_);if(Oe||Ie||Pt){let Z;if(Oe?Z=he:Ie?Z=u?.[I]??u?.[_]??_:Z=_,i.size>0){let se=1,ve=s[b+1];ve&&ve.kind==="selector"&&ve.value.startsWith("[")&&(se=2);let ue=s[b+se];if(ue&&(ue.kind==="particle"||ue.kind==="keyword")&&i.has(ue.value)){c=b,p=Z,d=F||(se===2?s[b+1].value:""),f=se+1;break}}else {c=b,p=Z,d=F,f=1;break}}}if(c===-1)return null;let h=new Set;for(let b=c;b<c+f;b++)h.add(b);if(l){let b=c+f;if(b<s.length){let x=s[b];(x.kind==="particle"||x.kind==="keyword")&&l.markers.has(x.value)&&h.add(b);}for(let x=0;x<c;x++){let I=s[x],_=I.value.toLowerCase(),F=I.normalized?.toLowerCase();if(l.windowTokens.has(_)||F&&l.windowTokens.has(F)){h.add(x);break}}}let g=s.filter((b,x)=>!h.has(x));if(g.length===0)return null;let y=n.filter(b=>b.command!=="on"),E=new ee(g,r),w=this.parseBodyWithClauses(E,y,r);if(w.length===0)return null;let Pe={sourceLanguage:r,confidence:.75};return d&&(Pe.keyFilter=d),Xe({type:"literal",value:p},w,void 0,Pe)}isThenKeyword(e,r){let 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\xE9s"]),ko:new Set(["\uADF8\uB2E4\uC74C","\uADF8\uB9AC\uACE0","\uADF8\uB7F0\uD6C4","\uADF8\uB7EC\uBA74"]),zh:new Set(["\u7136\u540E","\u63A5\u7740","\u4E4B\u540E"]),tr:new Set(["sonra","ard\u0131ndan","daha sonra"]),pt:new Set(["ent\xE3o","depois","logo"]),fr:new Set(["puis","ensuite","alors"]),de:new Set(["dann","danach","anschlie\xDFend"]),id:new Set(["lalu","kemudian","setelah itu"]),tl:new Set(["pagkatapos","tapos"]),bn:new Set(["\u09A4\u09BE\u09B0\u09AA\u09B0","\u09AA\u09B0\u09C7"]),qu:new Set(["chaymantataq","hinaspa","chaymanta","chayqa"]),sw:new Set(["kisha","halafu","baadaye"])};return (n[r]||n.en).has(e.toLowerCase())}isEndKeyword(e,r){let n={en:new Set(["end"]),ja:new Set(["\u7D42\u308F\u308A","\u7D42\u4E86","\u304A\u308F\u308A"]),ar:new Set(["\u0646\u0647\u0627\u064A\u0629","\u0627\u0646\u062A\u0647\u0649","\u0622\u062E\u0631"]),es:new Set(["fin","final","terminar"]),ko:new Set(["\uB05D","\uC885\uB8CC","\uB9C8\uCE68"]),zh:new Set(["\u7ED3\u675F","\u7EC8\u6B62","\u5B8C"]),tr:new Set(["son","biti\u015F","bitti"]),pt:new Set(["fim","final","t\xE9rmino"]),fr:new Set(["fin","terminer","finir"]),de:new Set(["ende","beenden","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"])};return (n[r]||n.en).has(e.toLowerCase())}extractStandaloneModifiers(e,r){let i=we(e,r).tokens;if(i.length===0)return {modifiers:null,remainingInput:null};let s=i[0].value.toLowerCase(),u=O.STANDALONE_MODIFIERS[s];if(!u)return {modifiers:null,remainingInput:null};let a={},l=1;if(u==="once")a.once=true;else {let f=1;if(f<i.length){let h=i[f];(h.kind==="keyword"||h.kind==="particle")&&(f++,l++);}if(f<i.length){let h=i[f];if(h.kind==="literal"){let g=h.value.match(/^(\d+)(ms|s|m)?$/);if(g){let y=parseInt(g[1],10),E=g[2]||"ms";E==="s"?y*=1e3:E==="m"&&(y*=6e4),a[u]=y,l=f+1;}}}a[u]||(a[u]=u==="debounce"?300:100);}let c=i.slice(l);if(c.length===0)return {modifiers:null,remainingInput:null};let p=c[0].position.start,d=e.slice(p);return {modifiers:a,remainingInput:d}}applyModifiers(e,r){return {...e,eventModifiers:{...e.eventModifiers,...r}}}extractOrConjunctionEvents(e,r){let n=[];for(;;){let i=e.mark(),o=e.peek();if(!o)break;let s=(o.normalized||o.value).toLowerCase();if(!O.OR_KEYWORDS.has(s)){e.reset(i);break}e.advance();let u=e.peek();if(!u){e.reset(i);break}let a=(u.normalized||u.value).toLowerCase();e.advance(),n.push({type:"literal",value:a});}return n}};X.KNOWN_EVENTS=new Set(["click","dblclick","input","change","submit","keydown","keyup","keypress","mouseover","mouseout","mousedown","mouseup","focus","blur","load","scroll","resize","contextmenu"]);X.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"])};X.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"])}};X.STANDALONE_MODIFIERS={once:"once",debounced:"debounce",debounce:"debounce",throttled:"throttle",throttle:"throttle"};X.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"]);var eo=X,to=new eo;function xe(t,e){return to.parse(t,e)}var ke=class{constructor(t={}){this.cache=new Map,this.config={maxSize:t.maxSize??1e3,ttlMs:t.ttlMs??0,enabled:t.enabled??true},this.stats={hits:0,misses:0,evictions:0,expirations:0};}makeKey(t,e){return `${e}:${t}`}isExpired(t){return this.config.ttlMs===0?false:Date.now()-t.createdAt>this.config.ttlMs}evictLRU(){let t=this.cache.keys().next().value;t!==void 0&&(this.cache.delete(t),this.stats.evictions++);}get(t,e){if(!this.config.enabled){this.stats.misses++;return}let r=this.makeKey(t,e),n=this.cache.get(r);if(!n){this.stats.misses++;return}if(this.isExpired(n)){this.cache.delete(r),this.stats.expirations++,this.stats.misses++;return}return this.cache.delete(r),n.lastAccessed=Date.now(),this.cache.set(r,n),this.stats.hits++,n.result}set(t,e,r){if(!this.config.enabled||r.confidence===0)return;let n=this.makeKey(t,e),i=Date.now();for(;this.cache.size>=this.config.maxSize;)this.evictLRU();this.cache.set(n,{result:r,createdAt:i,lastAccessed:i});}has(t,e){if(!this.config.enabled)return false;let r=this.makeKey(t,e),n=this.cache.get(r);return n?this.isExpired(n)?(this.cache.delete(r),this.stats.expirations++,false):true:false}delete(t,e){let r=this.makeKey(t,e);return this.cache.delete(r)}clear(){this.cache.clear();}resetStats(){this.stats={hits:0,misses:0,evictions:0,expirations:0};}getStats(){let t=this.stats.hits+this.stats.misses;return {hits:this.stats.hits,misses:this.stats.misses,size:this.cache.size,maxSize:this.config.maxSize,hitRate:t>0?this.stats.hits/t:0,evictions:this.stats.evictions,expirations:this.stats.expirations,enabled:this.config.enabled}}configure(t){if(t.maxSize!==void 0)for(this.config.maxSize=t.maxSize;this.cache.size>this.config.maxSize;)this.evictLRU();t.ttlMs!==void 0&&(this.config.ttlMs=t.ttlMs),t.enabled!==void 0&&(this.config.enabled=t.enabled);}enable(){this.config.enabled=true;}disable(){this.config.enabled=false;}getConfig(){return {...this.config}}},ro=new ke;var no=class{constructor(t={}){this.patternMatcher=new vt,this.languages=new Set(ht()),t.cache===false?this.cache=new ke({enabled:false}):this.cache=t.cache?new ke(t.cache):ro;}analyze(t,e){if(!this.supportsLanguage(e))return {confidence:0,errors:[`Language '${e}' is not supported for semantic parsing`]};let r=this.cache.get(t,e);if(r)return r;let n=this.analyzeUncached(t,e);return this.cache.set(t,e,n),n}analyzeUncached(t,e){try{try{let s=xe(t,e),u={confidence:s.metadata?.confidence??.8,node:s};return s.kind==="command"?{...u,command:{name:s.action,roles:s.roles}}:u}catch{}let r=Zn(e);if(!r)return {confidence:0,errors:[`No tokenizer available for language '${e}'`]};let n=r.tokenize(t),i=U(e);if(i.length===0)return {confidence:0,errors:[`No patterns available for language '${e}'`]};let o=this.patternMatcher.matchBest(n,i);if(o){let s=this.buildSemanticNode(o);return {confidence:o.confidence,command:{name:o.pattern.command,roles:o.captured},node:s,tokensConsumed:o.consumedTokens}}return {confidence:0,errors:["No pattern matched the input"]}}catch(r){return {confidence:0,errors:[r instanceof Error?r.message:String(r)]}}}supportsLanguage(t){return this.languages.has(t)}supportedLanguages(){return Array.from(this.languages)}getCacheStats(){return this.cache.getStats()}clearCache(){this.cache.clear();}configureCache(t){this.cache.configure(t);}buildSemanticNode(t){return {kind:"command",action:t.pattern.command,roles:t.captured,metadata:{patternId:t.pattern.id}}}};function Et(t){return new no(t)}var io=.5;function bt(t,e=io){return t.confidence>=e&&t.command!==void 0}function wt(t,e){let r=e==="SOV"?"sovPosition":"svoPosition";return [...t].sort((n,i)=>{let o=n[r]??99,s=i[r]??99;return o-s})}function oo(t,e){let r=t.markerOverride?.[e.code],n=e.roleMarkers[t.role];if(r!==void 0)return {primary:r,position:n?.position??"before",isOverride:true};if(n&&n.primary){let i={primary:n.primary,position:n.position,isOverride:false};return n.alternatives&&(i.alternatives=n.alternatives),i}return null}function so(t,e,r,n,i){let o=[];if(o.push({type:"role",role:"event",optional:false}),n.position==="after"){let l=n.primary.split(/\s+/);if(l.length>1)for(let c of l)o.push({type:"literal",value:c});else {let c=n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary};o.push(c);}}let s=e.roleMarkers.destination;s&&o.push({type:"group",optional:true,tokens:[{type:"role",role:"destination",optional:true},s.alternatives?{type:"literal",value:s.primary,alternatives:s.alternatives}:{type:"literal",value:s.primary}]}),o.push({type:"role",role:"patient",optional:false});let u=e.roleMarkers.patient;if(u){let l=u.alternatives?{type:"literal",value:u.primary,alternatives:u.alternatives}:{type:"literal",value:u.primary};o.push(l);}let a=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};return o.push(a),{id:`${t.action}-event-${e.code}-sov`,language:e.code,command:"on",priority:(i.basePriority??100)+50,template:{format:`{event} ${n.primary} {destination?} {patient} ${u?.primary||""} ${r.primary}`,tokens:o},extraction:{action:{value:t.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}function uo(t,e,r,n,i){let o=[];o.push({type:"role",role:"patient",optional:false});let s=e.roleMarkers.patient;if(s){let a=s.alternatives?{type:"literal",value:s.primary,alternatives:s.alternatives}:{type:"literal",value:s.primary};o.push(a);}if(o.push({type:"role",role:"event",optional:false}),n.position==="after"){let a=n.primary.split(/\s+/);if(a.length>1)for(let l of a)o.push({type:"literal",value:l});else {let l=n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary};o.push(l);}}let u=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};return o.push(u),{id:`${t.action}-event-${e.code}-sov-patient-first`,language:e.code,command:"on",priority:(i.basePriority??100)+45,template:{format:`{patient} ${s?.primary||""} {event} ${n.primary} ${r.primary}`,tokens:o},extraction:{action:{value:t.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}function ao(t,e,r,n,i){let o=[];o.push({type:"role",role:"patient",optional:false});let s=e.roleMarkers.patient;if(s){let l=s.alternatives?{type:"literal",value:s.primary,alternatives:s.alternatives}:{type:"literal",value:s.primary};o.push(l);}let u=e.roleMarkers.destination;if(u&&(o.push({type:"role",role:"destination",optional:false}),o.push(u.alternatives?{type:"literal",value:u.primary,alternatives:u.alternatives}:{type:"literal",value:u.primary})),o.push({type:"role",role:"event",optional:false}),n.position==="after"){let l=n.primary.split(/\s+/);if(l.length>1)for(let c of l)o.push({type:"literal",value:c});else {let c=n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary};o.push(c);}}let a=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};return o.push(a),{id:`${t.action}-event-${e.code}-sov-patient-first-dest`,language:e.code,command:"on",priority:(i.basePriority??100)+40,template:{format:`{patient} ${s?.primary||""} {destination} ${u?.primary||""} {event} ${n.primary} ${r.primary}`,tokens:o},extraction:{action:{value:t.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination"}}}}function lo(t,e,r,n,i){let o=[];o.push({type:"role",role:"event",optional:false});let s=n.alternatives?.filter(c=>!c.includes(" ")&&c.length>1)||[];s.length>0&&o.push({type:"literal",value:s[0],alternatives:s.slice(1)});let u=e.roleMarkers.destination;u&&o.push({type:"group",optional:true,tokens:[{type:"role",role:"destination",optional:true},u.alternatives?{type:"literal",value:u.primary,alternatives:u.alternatives}:{type:"literal",value:u.primary}]}),o.push({type:"role",role:"patient",optional:false});let a=e.roleMarkers.patient;if(a){let c=a.alternatives?{type:"literal",value:a.primary,alternatives:a.alternatives}:{type:"literal",value:a.primary};o.push(c);}let l=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};return o.push(l),{id:`${t.action}-event-${e.code}-sov-compact`,language:e.code,command:"on",priority:(i.basePriority??100)+52,template:{format:`{event}${s[0]||""} {patient} ${r.primary}`,tokens:o},extraction:{action:{value:t.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}function co(t,e,r,n,i){let o=[];if(o.push({type:"role",role:"event",optional:false}),n.position==="after"){let u=n.primary.split(/\s+/);if(u.length>1)for(let a of u)o.push({type:"literal",value:a});else {let a=n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary};o.push(a);}}let s=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};return o.push(s),{id:`${t.action}-event-${e.code}-sov-simple`,language:e.code,command:"on",priority:(i.basePriority??100)+48,template:{format:`{event} ${n.primary} ${r.primary}`,tokens:o},extraction:{action:{value:t.action},event:{fromRole:"event"},patient:{default:{type:"reference",value:"me"}}}}}function po(t,e,r,n){let i=e.eventHandler?.temporalMarkers;if(!i||i.length===0)return null;let o=[];o.push({type:"role",role:"event",optional:false}),e.possessive?.marker&&o.push({type:"group",optional:true,tokens:[{type:"literal",value:e.possessive.marker}]}),o.push({type:"literal",value:i[0],alternatives:i.slice(1)}),o.push({type:"role",role:"patient",optional:false});let s=e.roleMarkers.patient;if(s?.primary){let a=s.alternatives?{type:"literal",value:s.primary,alternatives:s.alternatives}:{type:"literal",value:s.primary};o.push(a);}let u=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};return o.push(u),{id:`${t.action}-event-${e.code}-sov-temporal`,language:e.code,command:"on",priority:(n.basePriority??100)+49,template:{format:`{event} ${i[0]} {patient} ${r.primary}`,tokens:o},extraction:{action:{value:t.action},event:{fromRole:"event"},patient:{fromRole:"patient"}}}}function fo(t,e,r,n,i){let o=[];if(o.push({type:"role",role:"event",optional:false}),n.position==="after"){let c=n.primary.split(/\s+/);if(c.length>1)for(let p of c)o.push({type:"literal",value:p});else {let p=n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary};o.push(p);}}let u=[...t.roles.filter(c=>c.required)].sort((c,p)=>{let d=c.sovPosition??999,f=p.sovPosition??999;return d-f});for(let c of u){o.push({type:"role",role:c.role,optional:false});let p,d;if(c.markerOverride&&c.markerOverride[e.code]!==void 0)p=c.markerOverride[e.code];else {let f=e.roleMarkers[c.role];f&&(p=f.primary,d=f.alternatives);}if(p){let f=d?{type:"literal",value:p,alternatives:d}:{type:"literal",value:p};o.push(f);}}let a=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};o.push(a);let l=u.map(c=>`{${c.role}}`).join(" ");return {id:`${t.action}-event-${e.code}-sov-2role`,language:e.code,command:"on",priority:(i.basePriority??100)+55,template:{format:`{event} ${n.primary} ${l} ${r.primary}`,tokens:o},extraction:{action:{value:t.action},event:{fromRole:"event"},...Object.fromEntries(u.map(c=>[c.role,{fromRole:c.role}]))}}}function mo(t,e,r,n,i){let o=[],u=[...t.roles.filter(h=>h.required)].sort((h,g)=>{let y=h.sovPosition??999,E=g.sovPosition??999;return y-E}),a=u[0];o.push({type:"role",role:a.role,optional:false});let l;if(a.markerOverride&&a.markerOverride[e.code]!==void 0)l=a.markerOverride[e.code];else {let h=e.roleMarkers[a.role];h&&(l=h.primary);}if(l&&o.push({type:"literal",value:l}),o.push({type:"role",role:"event",optional:false}),n.position==="after"){let h=n.primary.split(/\s+/);if(h.length>1)for(let g of h)o.push({type:"literal",value:g});else {let g=n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary};o.push(g);}}let c=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};o.push(c);let p=u[1];o.push({type:"role",role:p.role,optional:false});let d,f;if(p.markerOverride&&p.markerOverride[e.code]!==void 0)d=p.markerOverride[e.code];else {let h=e.roleMarkers[p.role];h&&(d=h.primary,f=h.alternatives);}if(d){let h=f?{type:"literal",value:d,alternatives:f}:{type:"literal",value:d};o.push(h);}return {id:`${t.action}-event-${e.code}-sov-2role-dest-first`,language:e.code,command:"on",priority:(i.basePriority??100)+48,template:{format:`{${a.role}} {event} ${n.primary} ${r.primary} {${p.role}}`,tokens:o},extraction:{action:{value:t.action},event:{fromRole:"event"},[a.role]:{fromRole:a.role},[p.role]:{fromRole:p.role}}}}function it(t,e,r,n,i){let o=[];if(n.position==="before"){let a=n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary};o.push(a);}o.push({type:"role",role:"event",optional:false});let s=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};o.push(s),o.push({type:"role",role:"patient",optional:false});let u=e.roleMarkers.destination;return u&&o.push({type:"group",optional:true,tokens:[u.alternatives?{type:"literal",value:u.primary,alternatives:u.alternatives}:{type:"literal",value:u.primary},{type:"role",role:"destination",optional:true}]}),{id:`${t.action}-event-${e.code}-vso`,language:e.code,command:"on",priority:(i.basePriority??100)+50,template:{format:`${n.primary} {event} ${r.primary} {patient} ${u?.primary||""} {destination?}`,tokens:o},extraction:{action:{value:t.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}function ho(t,e,r,n,i){let o=[],s=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};o.push(s),o.push({type:"role",role:"patient",optional:false});let u=e.roleMarkers.destination;if(u&&o.push({type:"group",optional:true,tokens:[u.alternatives?{type:"literal",value:u.primary,alternatives:u.alternatives}:{type:"literal",value:u.primary},{type:"role",role:"destination",optional:true}]}),n.position==="before"){let a=n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary};o.push(a);}return o.push({type:"role",role:"event",optional:false}),{id:`${t.action}-event-${e.code}-vso-verb-first`,language:e.code,command:"on",priority:(i.basePriority??100)+45,template:{format:`${r.primary} {patient} ${u?.primary||""} {destination?} ${n.primary} {event}`,tokens:o},extraction:{action:{value:t.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}function vo(t,e,r,n,i){let o=[],s=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};o.push(s);let a=[...t.roles.filter(c=>c.required)].sort((c,p)=>{let d=c.svoPosition??999,f=p.svoPosition??999;return d-f});for(let c of a){let p,d;if(c.markerOverride&&c.markerOverride[e.code]!==void 0)p=c.markerOverride[e.code];else {let f=e.roleMarkers[c.role];f&&(p=f.primary,d=f.alternatives);}if(p){let f=d?{type:"literal",value:p,alternatives:d}:{type:"literal",value:p};o.push(f);}o.push({type:"role",role:c.role,optional:false});}if(n.position==="before"){let c=n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary};o.push(c);}o.push({type:"role",role:"event",optional:false});let l=a.map(c=>`{${c.role}}`).join(" ");return {id:`${t.action}-event-${e.code}-vso-verb-first-2role`,language:e.code,command:"on",priority:(i.basePriority??100)+48,template:{format:`${r.primary} ${l} ${n.primary} {event}`,tokens:o},extraction:{action:{value:t.action},event:{fromRole:"event"},...Object.fromEntries(a.map(c=>[c.role,{fromRole:c.role}]))}}}function ot(t,e,r,n,i){let o=[];if(n.position==="before"){let c=n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary};o.push(c);}o.push({type:"role",role:"event",optional:false});let s=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};o.push(s);let a=[...t.roles.filter(c=>c.required)].sort((c,p)=>{let d=c.svoPosition??999,f=p.svoPosition??999;return d-f});for(let c of a){let p,d;if(c.markerOverride&&c.markerOverride[e.code]!==void 0)p=c.markerOverride[e.code];else {let f=e.roleMarkers[c.role];f&&(p=f.primary,d=f.alternatives);}if(p){let f=d?{type:"literal",value:p,alternatives:d}:{type:"literal",value:p};o.push(f);}o.push({type:"role",role:c.role,optional:false});}let l=a.map(c=>`{${c.role}}`).join(" ");return {id:`${t.action}-event-${e.code}-vso-2role`,language:e.code,command:"on",priority:(i.basePriority??100)+55,template:{format:`${n.primary} {event} ${r.primary} ${l}`,tokens:o},extraction:{action:{value:t.action},event:{fromRole:"event"},...Object.fromEntries(a.map(c=>[c.role,{fromRole:c.role}]))}}}function yo(t,e,r,n,i){let o=[],s=e.eventHandler?.negationMarker;if(n.position==="before"){let l=n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary};o.push(l);}if(s){let l=s.alternatives?{type:"literal",value:s.primary,alternatives:s.alternatives}:{type:"literal",value:s.primary};o.push(l);}o.push({type:"role",role:"event",optional:false});let u=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};o.push(u),o.push({type:"role",role:"patient",optional:false});let a=e.roleMarkers.destination;return a&&o.push({type:"group",optional:true,tokens:[a.alternatives?{type:"literal",value:a.primary,alternatives:a.alternatives}:{type:"literal",value:a.primary},{type:"role",role:"destination",optional:true}]}),{id:`${t.action}-event-${e.code}-vso-negated`,language:e.code,command:"on",priority:(i.basePriority??100)+48,template:{format:`${n.primary} ${s?.primary||""} {event} ${r.primary} {patient} ${a?.primary||""} {destination?}`,tokens:o},extraction:{action:{value:t.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}function go(t,e,r,n){let i=[];i.push({type:"literal",value:"and",alternatives:["then"]}),i.push({type:"role",role:"event",optional:false});let o=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary};i.push(o),i.push({type:"role",role:"patient",optional:false});let s=e.roleMarkers.destination;return s&&i.push({type:"group",optional:true,tokens:[s.alternatives?{type:"literal",value:s.primary,alternatives:s.alternatives}:{type:"literal",value:s.primary},{type:"role",role:"destination",optional:true}]}),{id:`${t.action}-event-${e.code}-vso-proclitic`,language:e.code,command:"on",priority:(n.basePriority??100)+45,template:{format:`[proclitic?] {event} ${r.primary} {patient} ${s?.primary||""} {destination?}`,tokens:i},extraction:{action:{value:t.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}var ne={basePriority:100,generateSimpleVariants:true,generateAlternatives:true};function St(t,e,r=ne){let n=`${t.action}-${e.code}-generated`,i=r.basePriority??100,o=e.keywords[t.action];if(!o)throw new Error(`No keyword translation for '${t.action}' in ${e.code}`);let s=So(t,e,o),u=kt(t,e),a=xo(t,e,o);return {id:n,language:e.code,command:t.action,priority:i,template:{format:a,tokens:s},extraction:u}}function Eo(t,e,r=ne){if(t.roles.filter(u=>!u.required).length===0)return null;let i=t.roles.filter(u=>u.required),o={...t,roles:i};return {...St(o,e,r),id:`${t.action}-${e.code}-generated-simple`,priority:(r.basePriority??100)-5,extraction:kt(t,e)}}function bo(t,e,r=ne){let n=[];if(n.push(St(t,e,r)),r.generateSimpleVariants){let i=Eo(t,e,r);i&&n.push(i);}return n}function Ct(t,e=ne){let r=[],n=Qi();for(let i of n){if(!t.keywords[i.action])continue;let o=bo(i,t,e);if(r.push(...o),t.eventHandler?.eventMarker){let s=wo(i,t,e);r.push(...s);}}return r}function wo(t,e,r=ne){if(!e.eventHandler||!e.eventHandler.eventMarker)return [];let n=[],i=e.eventHandler.eventMarker,o=e.keywords[t.action];if(!o)return [];let u=t.roles.filter(a=>a.required).length===2;if(e.wordOrder==="SOV")if(u)n.push(fo(t,e,o,i,r)),n.push(mo(t,e,o,i,r));else {n.push(so(t,e,o,i,r)),n.push(uo(t,e,o,i,r));let a=e.roleMarkers.destination;a&&a.primary!==i.primary&&n.push(ao(t,e,o,i,r));let l=i.primary.split(/\s+/),c=i.alternatives?.some(d=>!d.includes(" ")&&d.length>1);l.length>1&&c&&n.push(lo(t,e,o,i,r)),n.push(co(t,e,o,i,r));let p=po(t,e,o,r);p&&n.push(p);}else e.wordOrder==="VSO"?u?(n.push(ot(t,e,o,i,r)),n.push(vo(t,e,o,i,r))):(n.push(it(t,e,o,i,r)),n.push(ho(t,e,o,i,r)),e.eventHandler?.negationMarker&&n.push(yo(t,e,o,i,r)),e.tokenization?.prefixes&&n.push(go(t,e,o,r))):u?n.push(ot(t,e,o,i,r)):n.push(it(t,e,o,i,r));return n}function So(t,e,r){let n=[],i=r.alternatives?{type:"literal",value:r.primary,alternatives:r.alternatives}:{type:"literal",value:r.primary},o=Co(t,e);switch(e.wordOrder){case "SVO":n.push(i),n.push(...o);break;case "SOV":n.push(...o),n.push(i);break;case "VSO":n.push(i),n.push(...o);break;default:n.push(i),n.push(...o);}return n}function Co(t,e){let r=[],n=wt(t.roles,e.wordOrder);for(let i of n){let o=ko(i,e);i.required?r.push(...o):r.push({type:"group",optional:true,tokens:o});}return r}function ko(t,e){let r=[],n=t.markerOverride?.[e.code],i=e.roleMarkers[t.role],o={type:"role",role:t.role,optional:!t.required,expectedTypes:t.expectedTypes};if(n!==void 0)(i?.position??"before")==="before"?(n&&r.push({type:"literal",value:n}),r.push(o)):(r.push(o),n&&r.push({type:"literal",value:n}));else if(i)if(i.position==="before"){if(i.primary){let s=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};r.push(s);}r.push(o);}else {r.push(o);let s=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};r.push(s);}else r.push(o);return r}function To(t,e){let r={};for(let n of t.roles){let i=n.markerOverride?.[e.code],o=e.roleMarkers[n.role];i!==void 0?r[n.role]=i?{marker:i}:{}:o&&o.primary?r[n.role]=o.alternatives?{marker:o.primary,markerAlternatives:o.alternatives}:{marker:o.primary}:r[n.role]={};}return r}function kt(t,e){let r=To(t,e),n={};for(let i of t.roles){let o=r[i.role]||{};!i.required&&i.default?n[i.role]={...o,default:i.default}:n[i.role]=o;}return n}function xo(t,e,r){let n=[],o=wt(t.roles,e.wordOrder).map(s=>{let u=oo(s,e),a="";return u&&u.primary?u.position==="before"?a=`${u.primary} {${s.role}}`:a=`{${s.role}} ${u.primary}`:a=`{${s.role}}`,s.required?a:`[${a}]`});switch(e.wordOrder){case "SVO":case "VSO":n.push(r.primary,...o);break;case "SOV":n.push(...o,r.primary);break;default:n.push(r.primary,...o);}return n.join(" ")}function fe(t){let e=t.getAttribute("data-lang");if(e)return Ae(e);let r=t.getAttribute("data-hyperscript-lang")??t.closest?.("[data-hyperscript-lang]")?.getAttribute("data-hyperscript-lang");if(r)return Ae(r);let n=typeof document<"u"?document.documentElement?.lang:null;return n&&n!=="en"?Ae(n):null}function Ae(t){return t.split("-")[0].toLowerCase()}var Tt={add:[["patient",""],["destination","to"]],append:[["patient",""],["destination","to"]],async:[],beep:[["patient",""]],behavior:[["patient",""]],blur:[["patient",""]],break:[],call:[["patient",""]],clone:[["patient",""],["destination","into"]],compound:[],continue:[],copy:[["patient",""]],decrement:[["patient",""],["quantity","by"]],default:[["destination",""],["patient","to"]],else:[],exit:[],fetch:[["source",""],["responseType","as"],["method","via"],["destination","on"]],focus:[["patient",""]],for:[["patient",""],["source","in"]],get:[["source",""],["destination","on"]],go:[["destination",""]],halt:[["patient",""]],hide:[["patient",""],["style","with"]],if:[["condition",""]],increment:[["patient",""],["quantity","by"]],init:[],install:[["patient",""],["destination","on"]],js:[["patient",""]],log:[["patient",""]],make:[["patient",""]],measure:[["patient",""],["source","of"]],morph:[["destination",""],["patient","to"]],on:[["event",""],["source","from"]],pick:[["patient",""],["source","from"]],prepend:[["patient",""],["destination","to"]],put:[["patient",""],["destination","into"]],remove:[["patient",""],["source","from"]],render:[["patient",""],["style","with"]],repeat:[["quantity",""],["condition","until"]],return:[["patient",""]],send:[["event",""],["destination","to"]],set:[["destination",""],["patient","to"]],settle:[["patient",""]],show:[["patient",""],["style","with"]],swap:[["method",""],["destination","of"],["patient","with"]],take:[["patient",""],["source","from"]],tell:[["destination",""]],throw:[["patient",""]],toggle:[["patient",""],["destination","on"]],transition:[["patient",""],["goal","to"],["destination","on"],["duration","over"],["style","with"]],trigger:[["event",""],["destination","on"]],unless:[["condition",""]],wait:[["patient",""]],while:[["condition",""]]};function oe(t){switch(t.kind){case "event-handler":return Ao(t);case "compound":return zo(t);default:return Ro(t)}}function Ao(t){let e=["on"],r=t.roles.get("event");r&&e.push(ie(r));let n=t.roles.get("source");if(n&&e.push("from",ie(n)),t.body&&t.body.length>0){let i=t.body.map(oe);e.push(i.join(" then "));}return e.join(" ")}function zo(t){let e=t.chainType==="async"?"async":t.chainType;return t.statements.map(oe).join(` ${e} `)}function Ro(t){let e=Tt[t.action];if(e){let n=[t.action];for(let[i,o]of e){let s=t.roles.get(i);s&&(i==="destination"&&s.type==="reference"&&s.value==="me"||(o&&n.push(o),n.push(ie(s))));}return n.join(" ")}let r=[t.action];for(let[,n]of t.roles)r.push(ie(n));return r.join(" ")}function ie(t){switch(t.type){case "literal":return typeof t.value=="string"&&t.dataType==="string"?`"${t.value}"`:String(t.value);case "selector":return t.value;case "reference":return t.value;case "property-path":return No(t);case "expression":return t.raw;case "flag":return t.enabled?`+${t.name}`:`~${t.name}`}}function No(t){let e=ie(t.object),r=t.property;if(t.object.type==="reference")switch(t.object.value){case "me":return `my ${r}`;case "it":return `its ${r}`;case "you":return `your ${r}`}return `${e}'s ${r}`}var At=.5,Po={confidenceThreshold:At,strategy:"semantic",fallbackToOriginal:true};function Oo(t,e){return typeof t=="number"?t:t[e]??t["*"]??At}var ze=null;function Io(){return ze||(ze=Et()),ze}function Re(t,e,r={}){let n={...Po,...r},i=xt(t,e,n);if(i!==null)return i;let o=Mo(t);if(o){let s=xt(o.commands,e,n);if(s!==null)return o.prefix+s}return t}function xt(t,e,r){if(r.strategy==="semantic"||r.strategy==="auto"){let n=Oo(r.confidenceThreshold,e),i=zt(t,e,n);if(i!==null)return i}if((r.strategy==="auto"||r.strategy==="i18n")&&r.i18nToEnglish){let n=Lo(t,e,r.i18nToEnglish);if(n!==null)return n}return null}var _o=/^(on\s+(?:every\s+)?[\w-]+(?:\[.*?\])?(?:\.[\w-]+(?:\([^)]*\))?)*(?:\s+from\s+\S+)?(?:\s+queue\s+\w+)?\s+)/;function Mo(t){let e=t.match(_o);if(!e)return null;let r=e[1],n=t.slice(r.length);return n?{prefix:r,commands:n}:null}function zt(t,e,r){try{let n=Fo(t,e);if(n.length>1)return Bo(n,e,r);let i=Io();if(!i.supportsLanguage(e))return null;let o=i.analyze(t,e);if(!bt(o,r))return null;if(o.node)return oe(o.node);let s=xe(t,e);return oe(s)}catch{return null}}function Lo(t,e,r){try{let n=r(t,e);return n!==t?n:null}catch{return null}}function Do(t){let e=["then"],r=D(t);if(r?.keywords?.then){let n=r.keywords.then;if(n.primary&&n.primary!=="then"&&e.push(n.primary),n.alternatives)for(let i of n.alternatives)e.includes(i)||e.push(i);}return e}function Fo(t,e){let n=Do(e).map(u=>u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),i=new RegExp(`\\s+(?:${n.join("|")})\\s+`,"i"),o=t.split(`
4
+ `).map(u=>u.trim()).filter(u=>u.length>0),s=[];for(let u of o){let a=u.split(i);s.push(...a);}return s}function Bo(t,e,r){let n=[];for(let i of t){let o=zt(i.trim(),e,r);if(o===null)return null;n.push(o);}return n.join(" then ")}function Ne(t={}){return function(r){let{internals:n}=r,i=n.runtime,o=i.getScript.bind(i);i.getScript=function(s){let u=o(s);if(!u)return null;let a=$o(s,t);if(!a||a==="en")return u;let l=Re(u,a,t);return t.debug&&l!==u&&console.log(`[hyperscript-i18n] ${a}: "${u}" \u2192 "${l}"`),l};}}function $o(t,e){if(e.languageAttribute){let n=t.getAttribute(e.languageAttribute);if(n)return n.split("-")[0].toLowerCase()}let r=fe(t);return r||(e.defaultLanguage??null)}function Rt(t,e,r={}){return e==="en"?t:Re(t,e,r)}mt(t=>Ct(t));function Nt(){typeof _hyperscript<"u"&&_hyperscript.use&&(_hyperscript.use(Ne()),jo());}function jo(){if(typeof document>"u")return;let e=_hyperscript?.internals?.runtime;if(!e?.processNode||!e?.getInternalData)return;let r=e.getScriptSelector?.()??"[_], [script], [data-script]";document.querySelectorAll(r).forEach(n=>{let i=e.getInternalData(n);i.initialized&&(i.initialized=false);}),e.processNode(document.body);}var xu=["ru","pl","uk"];Nt();exports.plugin=Ne;exports.preprocess=Rt;exports.resolveLanguage=fe;exports.supportedLanguages=xu;return exports;})({});