@lentystyle/core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/CHANGELOG.tr.md +13 -0
- package/CODE_OF_CONDUCT.md +42 -0
- package/CODE_OF_CONDUCT.tr.md +41 -0
- package/CONTRIBUTING.md +53 -0
- package/CONTRIBUTING.tr.md +50 -0
- package/LICENSE.md +281 -0
- package/LICENSE.tr.md +280 -0
- package/README.md +139 -0
- package/README.tr.md +136 -0
- package/SECURITY.md +33 -0
- package/SECURITY.tr.md +32 -0
- package/dist/compiler/imports/chars.min.cjs +2 -0
- package/dist/compiler/imports/chars.min.js +2 -0
- package/dist/compiler/imports/classify.min.cjs +2 -0
- package/dist/compiler/imports/classify.min.js +2 -0
- package/dist/compiler/imports/scan.min.cjs +3 -0
- package/dist/compiler/imports/scan.min.js +3 -0
- package/dist/compiler/incremental.min.cjs +73 -0
- package/dist/compiler/incremental.min.js +73 -0
- package/dist/compiler/index.min.cjs +67 -0
- package/dist/compiler/index.min.js +67 -0
- package/dist/compiler/profile.min.cjs +2 -0
- package/dist/compiler/profile.min.js +2 -0
- package/dist/compiler/renderer.min.cjs +8 -0
- package/dist/compiler/renderer.min.js +8 -0
- package/dist/compiler/resource-limits.min.cjs +1 -0
- package/dist/compiler/resource-limits.min.js +1 -0
- package/dist/compiler/security/guard.min.cjs +1 -0
- package/dist/compiler/security/guard.min.js +1 -0
- package/dist/compiler/variables/array-variable.min.cjs +1 -0
- package/dist/compiler/variables/array-variable.min.js +1 -0
- package/dist/config.min.cjs +1 -0
- package/dist/config.min.js +1 -0
- package/dist/guard/hybrid.min.cjs +2 -0
- package/dist/guard/hybrid.min.js +2 -0
- package/dist/guard/runtime.min.cjs +1 -0
- package/dist/guard/runtime.min.js +1 -0
- package/dist/guard/shared.min.cjs +1 -0
- package/dist/guard/shared.min.js +1 -0
- package/dist/guard/ssr.min.cjs +2 -0
- package/dist/guard/ssr.min.js +2 -0
- package/dist/index.min.cjs +103 -0
- package/dist/index.min.js +103 -0
- package/dist/runtime/diagnostics.min.cjs +1 -0
- package/dist/runtime/diagnostics.min.js +1 -0
- package/dist/runtime/features.min.cjs +2 -0
- package/dist/runtime/features.min.js +2 -0
- package/dist/runtime/index.min.cjs +103 -0
- package/dist/runtime/index.min.js +103 -0
- package/dist/runtime/lentystyle.compile.worker.min.js +83 -0
- package/dist/runtime/lentystyle.debug.min.js +4 -0
- package/dist/runtime/lentystyle.integrity.json +12 -0
- package/dist/runtime/lentystyle.lazy.min.js +1 -0
- package/dist/runtime/lentystyle.log-critical.min.js +1 -0
- package/dist/runtime/lentystyle.log-optional.min.js +1 -0
- package/dist/runtime/lentystyle.map.min.js +4 -0
- package/dist/runtime/lentystyle.min.js +103 -0
- package/dist/runtime/lentystyle.observed.min.js +9 -0
- package/dist/runtime/lentystyle.performance.min.js +1 -0
- package/dist/runtime/lentystyle.worker.min.js +2 -0
- package/dist/runtime/options.min.cjs +1 -0
- package/dist/runtime/options.min.js +1 -0
- package/dist/runtime/style-sheet.min.cjs +1 -0
- package/dist/runtime/style-sheet.min.js +1 -0
- package/dist/types/compiler/compiler/index.d.ts +4 -0
- package/dist/types/compiler/compiler/render/collect-leaves.d.ts +3 -0
- package/dist/types/compiler/compiler/render/index.d.ts +3 -0
- package/dist/types/compiler/compiler/render/render-buckets.d.ts +3 -0
- package/dist/types/compiler/compiler/render/types.d.ts +13 -0
- package/dist/types/compiler/compiler/renderer.d.ts +5 -0
- package/dist/types/compiler/compiler/resource-limits.d.ts +21 -0
- package/dist/types/compiler/compiler/types.d.ts +82 -0
- package/dist/types/compiler/index.d.ts +2 -0
- package/dist/types/compiler/reader.d.ts +5 -0
- package/dist/types/compiler/renderer.d.ts +1 -0
- package/dist/types/config.d.ts +14 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/runtime/diagnostics.d.ts +1 -0
- package/dist/types/runtime/features.d.ts +1 -0
- package/dist/types/runtime/index.d.ts +4 -0
- package/dist/types/runtime/options.d.ts +12 -0
- package/dist/types/runtime/runtime/features/assets.d.ts +3 -0
- package/dist/types/runtime/runtime/features/index.d.ts +5 -0
- package/dist/types/runtime/runtime/features/loader.d.ts +2 -0
- package/dist/types/runtime/runtime/features/performance-types.d.ts +39 -0
- package/dist/types/runtime/runtime/features/registry.d.ts +4 -0
- package/dist/types/runtime/runtime/features/types.d.ts +109 -0
- package/dist/types/runtime/runtime/loader/context-time.d.ts +2 -0
- package/dist/types/runtime/runtime/loader/context-types.d.ts +19 -0
- package/dist/types/runtime/runtime/loader/context.d.ts +18 -0
- package/dist/types/runtime/runtime/loader/options.d.ts +8 -0
- package/dist/types/runtime/runtime/loader/process/import-resolver/types.d.ts +12 -0
- package/dist/types/runtime/runtime/loader/process/types.d.ts +25 -0
- package/dist/types/runtime/runtime/style-sheet/cache.d.ts +6 -0
- package/dist/types/runtime/runtime/style-sheet.d.ts +7 -0
- package/dist/types/runtime/runtime/stylesheet-links/auto-loader.d.ts +7 -0
- package/dist/types/runtime/runtime/stylesheet-links/dom-compile.d.ts +9 -0
- package/dist/types/runtime/runtime/stylesheet-links.d.ts +2 -0
- package/dist/types/runtime/style-sheet.d.ts +1 -0
- package/dist/types/runtime/style.d.ts +2 -0
- package/package.json +117 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";(()=>{function Bn(e,r,n,t){return e==="vendor-fast"?!1:Vr(r)||Vr(n)?!0:!!Vr(t)}function Vr(e){for(let r in e)return!0;return!1}function S(){return{source:"",lineMap:[],outputLine:1}}function x(e,r,n,t){Co(e,n,t),e.source+=r,r===`
|
|
2
|
+
`&&(e.outputLine+=1)}function kr(e,r){let n=1;for(let t=0;t<r.source.length;t+=1){let i=r.source[t],s=Ro(r,n);x(e,i,s.sourceId,s.line),i===`
|
|
3
|
+
`&&(n+=1)}}function Dn(e,r,n,t){r.source&&(r.source.startsWith(`
|
|
4
|
+
`)||x(e,`
|
|
5
|
+
`,n,t),kr(e,r),r.source.endsWith(`
|
|
6
|
+
`)||x(e,`
|
|
7
|
+
`,n,t))}function $(e,r){let n=S(),t=1;for(let i=0;i<e.length;i+=1)x(n,e[i],r,t),e[i]===`
|
|
8
|
+
`&&(t+=1);return n}function Ro(e,r){return e.lineMap[r-1]?e.lineMap[r-1]:e.lineMap.length>0?e.lineMap[e.lineMap.length-1]:{sourceId:"<inline>",line:1}}function Co(e,r,n){let t=e.outputLine;e.lineMap[t-1]||(e.lineMap[t-1]={sourceId:r,line:n})}function _n(e,r){return typeof r=="string"?{id:e,source:r}:r}function qn(e,r){return e&&e.trim().length>0?e:r}function Or(e){return e===" "||e===" "||e===`
|
|
9
|
+
`||e==="\r"||e==="\f"}function Zn(e){let r=1;for(;r<e.length&&Or(e[r]);)r+=1;let n=r;for(;r<e.length&&So(e[r]);)r+=1;return e.slice(n,r).toLowerCase()}function So(e){let r=e.charCodeAt(0);return r>=65&&r<=90||r>=97&&r<=122||r>=48&&r<=57?!0:e==="_"||e==="-"}function Kn(e){let r=e.indexOf("?"),n=e.indexOf("#"),t=Vo(r,n);return(t===-1?e:e.slice(0,t)).trim().toLowerCase()}function Vo(e,r){return e===-1?r:r===-1?e:Math.min(e,r)}function Un(e){var i;let r=e.toLowerCase().indexOf("@import");if(r===-1)return null;let n=r+7;for(;n<e.length&&Gn(e[n]);)n+=1;let t=(i=e[n])!=null?i:"";return t==="'"||t==='"'?ko(e,n):wo(e,n)?Oo(e,n+4):Io(e,n)}function ko(e,r){let n=e[r],t=r+1;for(;t<e.length;){let i=e[t],s=t>r?e[t-1]:"";if(i===n&&s!=="\\")return e.slice(r+1,t);t+=1}return null}function Oo(e,r){let n=e.indexOf(")",r);if(n===-1)return null;let t=e.slice(r,n).trim();return t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):t}function Io(e,r){let n=r;for(;n<e.length&&!Gn(e[n])&&e[n]!==";";)n+=1;let t=e.slice(r,n).trim();return t||null}function wo(e,r){return e.slice(r,r+4).toLowerCase()==="url("}function Gn(e){return e===" "||e===" "||e===`
|
|
10
|
+
`||e==="\r"||e==="\f"}function Hn(e){return e==="char"||e==="charset"}function Qn(e){let r=Un(e);if(!r)return null;let n=Kn(r);return n.endsWith(".css")?{raw:r,normalized:n,kind:"css"}:n.endsWith(".luis")?{raw:r,normalized:n,kind:"luis"}:{raw:r,normalized:n,kind:"other"}}function Xn(){return{phase:0}}function ee(e){e.phase>=5||(e.phase=5)}function Jn(e,r,n,t){e.phase>0&&t.push({code:"invalid-directive-position",line:r,message:`[${n}] @charset must be the first top-level statement.`}),e.phase=1}function Yn(e,r,n,t){e.phase>=4&&t.push({code:"invalid-directive-order",line:r,message:`[${n}] @layer declaration must be before @import ".luis" and before regular rules.`}),e.phase<3&&(e.phase=3)}function et(e,r,n,t,i){if(r.kind==="css"||r.kind==="other"){e.phase<2&&(e.phase=2);return}e.phase<4&&(e.phase=4)}function rt(e){let n=e.toLowerCase().indexOf("@import");if(n===-1)return null;let t=$o(e,n+7);return t>=e.length?null:e[t]==='"'||e[t]==="'"?Po(e,t):Eo(e,t)?Ao(e,t):Wo(e,t)}function Po(e,r){let n=e[r],t=r+1;for(;t<e.length;){if(e[t]===n&&e[t-1]!=="\\")return{start:r,end:t+1};t+=1}return null}function Ao(e,r){let n=e.indexOf(")",r+4);return n===-1?null:{start:r,end:n+1}}function Wo(e,r){let n=r;for(;n<e.length&&!nt(e[n])&&e[n]!==";";)n+=1;return n===r?null:{start:r,end:n}}function $o(e,r){let n=r;for(;n<e.length&&nt(e[n]);)n+=1;return n}function nt(e){return e===" "||e===" "||e===`
|
|
11
|
+
`||e==="\r"||e==="\f"}function Eo(e,r){return e.slice(r,r+4).toLowerCase()==="url("}function Ir(e,r){let n=rt(e);if(!n)return`@import "${tt(r)}";`;let t=e.slice(0,n.start),i=e.slice(n.end);return`${t}"${tt(r)}"${i}`}function st(e,r){let n=e.trim();if(n){if(it(n))return n;if(!it(r))return null}else return null;try{return new URL(n,r).href}catch{return null}}function tt(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function it(e){let r=e.trim().toLowerCase();return r.startsWith("http://")||r.startsWith("https://")||r.startsWith("//")||r.startsWith("data:")}var Re=class extends Error{constructor(n){super(n);this.code="security-check-failed";this.name="LuisSecurityError"}};function O(e,r){let n=r instanceof Error?r.message:String(r);throw new Re(`[LentyStyle][Security] ${e} failed: ${n}`)}var jo=/^(?:javascript|vbscript|data|blob|file):/i,ot=/url\(\s*(['"])?\s*(https?:|\/\/|data:|javascript:|vbscript:)/i,lt=/@import\s+(?:url\(\s*)?(?:"|')?\s*(?:https?:|\/\/|data:|javascript:|vbscript:|blob:|file:)/i,Mo=/\\([0-9a-fA-F]{1,6}\s?|.)/g,No=/^[0-9a-fA-F]+$/;function wr(e){return jo.test(at(e).trim())}function E(e){let r=at(e);return r.includes("</style")||r.includes("<script")||r.includes("<\/script")||r.includes("javascript:")||ot.test(e)||ot.test(r)||lt.test(e)||lt.test(r)}function at(e){return e.replace(Mo,(r,n)=>{let t=To(n);if(t){let i=Number.parseInt(t,16);return i>1114111?"":String.fromCodePoint(i)}else return n}).toLowerCase()}function To(e){let r=e.trim();return No.test(r)?r:null}function ut(e){try{return wr(e)}catch(r){return O("isUnsafeImportRequest",r)}}function Pr(e){try{return E(e)}catch(r){return O("isUnsafeCssImportStatement",r)}}function M(e,r,n,t){e.warnings.push({code:r,line:n,message:t})}function ct(e,r,n,t,i,s){var d,b;let o=Zn(e);if(Hn(o))return Jn(i,r,n,t.warnings),$(e,n);if(o==="layer")return Yn(i,r,n,t.warnings),$(e,n);if(o!=="import")return ee(i),$(e,n);let l=Qn(e);if(!l)return Pr(e)?(M(t,"invalid-import-url",r,`[${n}] Unsafe @import URL blocked.`),S()):(ee(i),$(e,n));if(ut(l.raw))return M(t,"invalid-import-url",r,`[${n}] Unsafe @import URL blocked: ${l.raw}`),S();let a=i.phase;if(et(i,l,r,n,t.warnings),l.kind!=="luis"&&Pr(e))return M(t,"invalid-import-url",r,`[${n}] Unsafe CSS @import blocked: ${l.raw}`),S();if(l.kind==="css"){let h=st(l.raw,n);return h?$(Ir(e,h),n):$(e,n)}else if(l.kind!=="luis")return $(e,n);if(!t.options.importResolver)return M(t,"unsupported-import",r,`[${n}] Runtime/dynamic .luis import is disabled. Use compile-time importResolver.`),S();let u=t.options.importResolver(l.raw,n);if(!u)return M(t,"import-not-found",r,`[${n}] Unable to resolve .luis import: ${l.raw}`),S();let c=_n(l.raw,u);if(((b=(d=t.options).importModeResolver)==null?void 0:b.call(d,c.id))==="vendor-fast"&&a<=3)return $(Ir(e,c.id),n);if(t.importStack.includes(c.id))return M(t,"import-cycle",r,`[${n}] Import cycle detected for "${c.id}".`),S();let f=t.importStack.length+1;if(f>t.resourceLimits.maxImportDepth)return M(t,"resource-limit",r,`[${n}] Import depth budget exceeded (${f}/${t.resourceLimits.maxImportDepth}) for "${c.id}".`),S();if(t.importCount+1>t.resourceLimits.maxImportCount)return M(t,"resource-limit",r,`[${n}] Import count budget exceeded (${t.importCount+1}/${t.resourceLimits.maxImportCount}) for "${c.id}".`),S();if(t.importedBytes+c.source.length>t.resourceLimits.maxImportedBytes)return M(t,"resource-limit",r,`[${n}] Imported bytes budget exceeded (${t.importedBytes+c.source.length}/${t.resourceLimits.maxImportedBytes}) for "${c.id}".`),S();t.importCount+=1,t.importedBytes+=c.source.length,t.importStack.push(c.id);let m=s(c.source,c.id,t);t.importStack.pop();let g=S();return Dn(g,m,n,r),g}function ft(e,r,n){let t=r+1,i=null,s=0,o=0,l=n;for(;t<e.length;){let a=e[t],u=t>r?e[t-1]:"";if(a===`
|
|
12
|
+
`&&(l+=1),i){a===i&&u!=="\\"&&(i=null),t+=1;continue}if(a==="'"||a==='"'){i=a,t+=1;continue}if(a==="("?s+=1:a===")"&&s>0?s-=1:a==="["?o+=1:a==="]"&&o>0&&(o-=1),a==="{"&&s===0&&o===0)return null;if(a===";"&&s===0&&o===0){let c=e.slice(r,t+1),p=Bo(c);return p?{name:p,statement:c,start:r,end:t+1,lineStart:n,lineEnd:l}:null}t+=1}return null}function Bo(e){let r=1;for(;r<e.length&&Do(e[r]);)r+=1;let n=r;for(;r<e.length&&_o(e[r]);)r+=1;return e.slice(n,r).toLowerCase()}function Do(e){return e===" "||e===" "||e===`
|
|
13
|
+
`||e==="\r"||e==="\f"}function _o(e){let r=e.charCodeAt(0);return r>=65&&r<=90||r>=97&&r<=122||r>=48&&r<=57?!0:e==="_"||e==="-"}var qo=/\{/g,Zo=/\}/g;function Ar(e,r){let n=r==="{"?qo:Zo;n.lastIndex=0;let t=e.match(n);return t?t.length:0}function fe(e){let r=e.trim();return r.endsWith(";")?r:`${r};`}function pt(e){let r=e.trim(),n=r.indexOf(":");if(n===-1)return fe(r);let t=r.slice(0,n).trimEnd(),i=r.slice(n+1).trim(),s=i.length>0?`${t}: ${i}`:`${t}:`;return fe(s)}function mt(e,r=2){let n=" ".repeat(r);return e.split(`
|
|
14
|
+
`).map(t=>`${n}${t}`).join(`
|
|
15
|
+
`)}function Wr(e){let r=[],n="",t=null,i=0,s=0,o=0;for(let a=0;a<e.length;a+=1){let u=e[a],c=a>0?e[a-1]:"";if(t){n+=u,u===t&&c!=="\\"&&(t=null);continue}if(u==="'"||u==='"'){t=u,n+=u;continue}if(u==="("?i+=1:u===")"&&i>0?i-=1:u==="{"?s+=1:u==="}"&&s>0?s-=1:u==="["?o+=1:u==="]"&&o>0&&(o-=1),u===","&&i===0&&s===0&&o===0){let p=n.trim();p.length>0&&r.push(p),n="";continue}n+=u}let l=n.trim();return l.length>0&&r.push(l),r}function $r(e){if(e.length<2)return!1;let r=e[0],n=e[e.length-1];return r==="'"&&n==="'"||r==='"'&&n==='"'}function dt(e){let r=e.trim();if($r(r))return null;let n=Ko(r);return n||Uo(r)}function gt(e){let r=bt(e);return r?!r.startSuffix||!r.endSuffix?!1:r.startSuffix!==r.endSuffix:!1}function Ko(e){let r=bt(e);if(!r)return null;let{start:n,end:t,startSuffix:i,endSuffix:s}=r,o=n<=t?1:-1,l=i||s,a=[];for(let u=n;;u+=o){let c=Go(u,n,t,i,s,l);if(a.push(`${u}${c}`),u===t)break}return a}function bt(e){let r=e.trim();if($r(r))return null;let n=r.match(/^(-?\d+)([a-zA-Z%]+)?\s*-\s*(-?\d+)([a-zA-Z%]+)?$/);if(!n)return null;let[,t,i="",s,o=""]=n;return{start:Number.parseInt(t,10),end:Number.parseInt(s,10),startSuffix:i,endSuffix:o}}function Uo(e){let r=e.match(/^([A-Za-z])\s*-\s*([A-Za-z])$/);if(!r)return null;let[,n,t]=r,i=n.charCodeAt(0),s=t.charCodeAt(0),o=i<=s?1:-1,l=[];for(let a=i;l.push(String.fromCharCode(a)),a!==s;a+=o);return l}function Go(e,r,n,t,i,s){return e===r&&t?t:e===n&&i?i:s}function ht(e,r,n){var f;let t=e.lastIndexOf(`
|
|
16
|
+
`,r-1)+1,i=e.indexOf(`
|
|
17
|
+
`,n),s=i===-1?e.length:i,o=e.slice(t,s),l=o.trim(),a=r-t;if(!l||l.startsWith("@for")||l.startsWith("for(")||l.startsWith("@"))return!1;let u=Ho(o);if(u!==-1&&a<u)return!0;if(/^\s*[a-zA-Z_-][\w-]*\s*:/.test(o)||o.includes(";"))return!1;if(/^\s*([.#\[:&*>+~]|[a-zA-Z][\w-]*(?=[\s.#\[:&*>+~]|$))/.test(o))return!0;let c=o.slice(0,a).trimEnd(),p=(f=c[c.length-1])!=null?f:"";return p==="-"||p==="_"||p==="."}function Ho(e){for(let r=0;r<e.length;r+=1)if(e[r]==="{"&&e[r-1]!=="$")return r;return-1}function Lt(e){return j(e.trim())}function j(e){if(e.length<2)return e;let r=e[0],n=e[e.length-1];return r==="'"&&n==="'"||r==='"'&&n==='"'?e.slice(1,-1):e}function W(e){let r=e.trim();return r.startsWith("[")&&r.endsWith("]")}function re(e){let r=e.trim();if(!W(r))return[];let n=r.slice(1,-1).trim();if(!n)return[];let t=Wr(n);if(t.length===1){let i=dt(t[0]);if(i)return i}return t.map(i=>j(i))}function Er(e){let r=e.trim();if(!W(r))return!1;let n=r.slice(1,-1).trim();if(!n)return!1;let t=Wr(n);return t.length!==1?!1:gt(t[0])}function jr(e){return`[${e.join(", ")}]`}function yt(e){let r=[],n=0,t=0,i="";for(let s=0;s<e.length;s+=1){let o=e[s];if(o==="("?n+=1:o===")"&&n>0?n-=1:o==="["?t+=1:o==="]"&&t>0&&(t-=1),o===";"&&n===0&&t===0){r.push(i),i="";continue}i+=o}return i.trim()&&r.push(i),r}function D(e,r,n){let t=e[r];if(!t)return;let i=[n,Ce(n),Qo(n),n.toLowerCase(),Ce(n).toLowerCase()];for(let o of i)if(Object.prototype.hasOwnProperty.call(t,o))return t[o];let s=n.toLowerCase();for(let[o,l]of Object.entries(t))if(o.toLowerCase()===s||Ce(o).toLowerCase()===s)return l}function Ce(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`)}function Qo(e){return e.replace(/-([a-z])/g,(r,n)=>n.toUpperCase())}var Mr={maxForIterationsPerLoop:2e3,maxNestedLoopProduct:1e5,maxExpandedRules:5e4,maxOutputCssChars:3e6,maxObservedRules:5e3,maxObservedActiveRules:1e3,maxObservedRuleKeysPerToken:300,maxMutationBatchTokens:1500,maxObservedReevalPerTick:500,maxImportDepth:64,maxImportCount:2e3,maxImportedBytes:4e6};function xt(e){return e.resourcePolicy?e.resourcePolicy:e.debug?"fail-soft":"fail-closed"}function Ne(e){var r;return{...Mr,...(r=e.resourceLimits)!=null?r:{}}}function ne(e,r){return{code:"resource-limit",line:e,message:r}}function te(e){throw new Error(`[LentyStyle][resource-limit] ${e}`)}function _(e){let r=[],n="",t=null,i=0,s=0,o=0;for(let l=0;l<e.length;l+=1){let a=e[l],u=l>0?e[l-1]:"";if(t){n+=a,a===t&&u!=="\\"&&(t=null);continue}if(a==="'"||a==='"'){t=a,n+=a;continue}if(a==="("?i+=1:a===")"&&i>0?i-=1:a==="{"?s+=1:a==="}"&&s>0?s-=1:a==="["?o+=1:a==="]"&&o>0&&(o-=1),a===","&&i===0&&s===0&&o===0){r.push(n),n="";continue}n+=a}return r.push(n),r}function L(e,r,n,t){let i=null,s=0;for(let o=r;o<e.length;o+=1){let l=e[o],a=o>0?e[o-1]:"";if(i){l===i&&a!=="\\"&&(i=null);continue}if(l==="'"||l==='"'){i=l;continue}if(l===n){s+=1;continue}else if(l===t&&(s-=1,s===0))return o}return-1}function v(e,r){let n=r;for(;n<e.length&&pe(e[n]);)n+=1;return n}function vt(e){if(e.length===0)return!1;let r=e.charCodeAt(0);return r>=65&&r<=90||r>=97&&r<=122||r>=48&&r<=57||r===95||r===45}function pe(e){let r=e.charCodeAt(0);return r===32||r===9||r===10||r===13}function Nr(e,r,n){let i=Ct(e,r,n==="if"?["@if"]:["elseif","@elseif"]);if(!i)return null;let s=v(e,r+i.length);if(e[s]!=="(")return null;let o=L(e,s,"(",")");if(o===-1)return null;let l=e.slice(s+1,o).trim();if(s=v(e,o+1),e[s]!=="{")return null;let a=L(e,s,"{","}");return a===-1?null:{branch:{type:n,condition:l,body:e.slice(s+1,a)},endIndex:a+1}}function Rt(e,r){let n=Ct(e,r,["else","@else"]);if(!n)return null;let t=v(e,r+n.length);if(e[t]!=="{")return null;let i=L(e,t,"{","}");return i===-1?null:{branch:{type:"else",condition:"",body:e.slice(t+1,i)},endIndex:i+1}}function Tr(e,r){var i;if(e.slice(r,r+3)!=="@if")return!1;let n=r>0?e[r-1]:"",t=(i=e[r+3])!=null?i:"";return/[a-zA-Z0-9_-]/.test(n)?!1:!(!pe(t)&&t!=="(")}function Ct(e,r,n){var t;for(let i of n){if(e.slice(r,r+i.length)!==i)continue;let s=r>0?e[r-1]:"",o=(t=e[r+i.length])!=null?t:"";if(!/[a-zA-Z0-9_-]/.test(s)){if(!pe(o)&&o!=="("&&o!=="{")continue;return i}}return null}function St(e){let r=e.trim();return r.startsWith("(")&&r.endsWith(")")?Xo(r):Fr(r)?{variableName:r}:null}function Xo(e){let r=e.slice(1,-1),n=_(r).map(s=>s.trim());if(n.length!==2)return null;let t=n[0],i=n[1];return Fr(t)&&Fr(i)?{variableName:t,indexVariableName:i}:null}function Fr(e){return/^[a-zA-Z_][\w-]*$/.test(e)}function Vt(e,r){for(let n=r;n<e.length;n+=1)if(Se(e,n)!==0)return n;return-1}function Te(e,r){let n=Se(e,r);if(n===0)return null;let t=r+n;if(t=v(e,t),e[t]!=="(")return null;let i=L(e,t,"(",")");if(i===-1)return null;let s=e.slice(t+1,i),o=_(s).map(u=>u.trim());if(o.length!==2)return null;let l=St(o[0]);if(!l||(t=v(e,i+1),e[t]!=="{"))return null;let a=L(e,t,"{","}");return a===-1?null:{variableName:l.variableName,indexVariableName:l.indexVariableName,sourceExpression:o[1],body:e.slice(t+1,a),endIndex:a+1}}function Fe(e,r,n){let t=e.trim(),i=t.match(/^var\(\s*(--[a-zA-Z_][\w-]*)(?:\s*\[\s*([^\]\s]+)\s*\])?\s*\)$/);if(i){let s=r[i[1]],o=n[i[1]];if(s&&typeof i[2]=="string"&&/^\d+$/.test(i[2])){let l=Number.parseInt(i[2],10),a=s[l];return typeof a=="string"?[a]:null}else return s&&typeof i[2]!="string"?s:o&&typeof i[2]!="string"?Object.keys(o):null}return W(t)?re(t):null}function Se(e,r){var l;let n=e.slice(r,r+4)==="@for",t=e.slice(r,r+3)==="for";if(!n&&!t)return 0;let i=n?4:3,s=r>0?e[r-1]:"",o=(l=e[r+i])!=null?l:"";return vt(s)||!pe(o)&&o!=="("?0:i}function me(e,r,n){e.resourcePolicy==="fail-closed"?te(n):e.warnings.push(ne(r,n))}function ze(e,r){let n=1;for(let t=0;t<r;t+=1)e[t]===`
|
|
18
|
+
`&&(n+=1);return n}function kt(e,r){for(let n=r;n<e.length;n+=1){let t=e[n];if(t==="@"){if(Tr(e,n)||Se(e,n)>0)return n}else if(t==="f"&&Se(e,n)>0)return n}return-1}function Ot(e){return/^[a-zA-Z_][a-zA-Z0-9_]*(?:-[a-zA-Z0-9_]+)*(?:\.[a-zA-Z_][a-zA-Z0-9_]*(?:-[a-zA-Z0-9_]+)*)*$/.test(e)}function Ve(e){return/[a-zA-Z_]/.test(e)}function zr(e){return/[a-zA-Z0-9_]/.test(e)}function It(e,r){return e[r]!=="$"||e[r+1]!=="{"?null:Jo(e,r)}function Jo(e,r){let n=Yo(e,r);if(n===-1)return null;let t=e.slice(r+2,n).trim();if(!t)return null;let i=el(t)?"key":"expression";return{key:t,mode:i,start:r,end:n+1,raw:e.slice(r,n+1)}}function Yo(e,r){var i;let n=1,t=null;for(let s=r+2;s<e.length;s+=1){let o=e[s],l=(i=e[s-1])!=null?i:"";if(t){o===t&&l!=="\\"&&(t=null);continue}if(o==="'"||o==='"'){t=o;continue}if(o==="{")return-1;if(o==="}"&&(n-=1,n===0))return s}return-1}function el(e){for(let r=0;r<e.length;r+=1){let n=e[r];if(n===" "||n===" "||n===`
|
|
19
|
+
`||n==="\r"||n==="\f"||n==="+"||n==="-"||n==="*"||n==="/"||n==="("||n===")"||n==="'"||n==='"')return!1}return Ot(e)}function wt(e,r){let n=rl(e,r);return`Invalid .luis syntax at line ${Wt(e,r)}: plain loop placeholder "${n}" is not supported. Use braced form like "\${i}" or "\${bp.name}".`}function Pt(e,r){let n=nl(e,r);return`Invalid .luis syntax at line ${Wt(e,r)}: malformed loop placeholder "${n}" is not supported. Use balanced braced form like "\${i}" or "\${bp.name}".`}function At(e){return`Invalid .luis syntax: loop placeholder "${e}" could not be resolved. Use valid forms like "\${i}" or "\${bp.name}".`}function rl(e,r){let n=r+1;for(;n<e.length;){let t=e[n];if(t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||t==="_"||t==="."||t==="-"){n+=1;continue}break}return e.slice(r,n)}function nl(e,r){let n=r+1;for(;n<e.length;){let t=e[n];if(t===`
|
|
20
|
+
`||t==="\r"||t===";")break;n+=1}return e.slice(r,n).trim()}function Wt(e,r){let n=1;for(let t=0;t<r;t+=1)e[t]===`
|
|
21
|
+
`&&(n+=1);return n}function ie(e){return e.kind==="number"?`${tl(e.value)}${e.unit}`:e.value}function Br(e,r){return!e&&!r?"":e&&!r?e:!e&&r?r:e===r?e:null}function $t(e,r){return r?e===r?"":null:e}function tl(e){let r=Number.parseFloat(e.toFixed(6));return Number.isInteger(r),String(r)}function q(e){let r=j(e.trim()),n=Dr(r);return n||{kind:"string",value:r}}function Dr(e){let r=e[0]==="-"?1:0,n=!1,t=!1;for(;r<e.length;){let s=e[r];if(s>="0"&&s<="9"){n=!0,r+=1;continue}if(s==="."&&!t){t=!0,r+=1;continue}break}if(!n)return null;let i=Number.parseFloat(e.slice(0,r));return Number.isNaN(i)?null:{kind:"number",value:i,unit:e.slice(r)}}function se(e,r){let n=_r(e,r);return n?{value:il(n.value),end:n.end}:null}function _r(e,r){var s;if(e.slice(r,r+4)!=="var(")return null;let n=de(e,r+4);if(e[n]!=="-"||e[n+1]!=="-")return null;let t=n;if(n+=2,!Be((s=e[n])!=null?s:""))return null;for(n+=1;n<e.length&&ul(e[n]);)n+=1;let i={variableName:e.slice(t,n),accessKey:null,objectKey:null};if(n=de(e,n),e[n]==="["){let o=sl(e,n);if(!o)return null;i.accessKey=o.value,n=o.end}if(n=de(e,n),e[n]==="."){let o=ol(e,n+1);if(!o)return null;i.objectKey=o.value,n=o.end}return n=de(e,n),e[n]!==")"?null:{value:i,end:n+1}}function il(e){let r=e.accessKey===null?"":`[${e.accessKey}]`,n=e.objectKey===null?"":`.${e.objectKey}`;return`var(${e.variableName}${r}${n})`}function sl(e,r){var i;let n=de(e,r+1);if(!ll((i=e[n])!=null?i:""))return null;let t=n;for(n+=1;n<e.length&&al(e[n]);)n+=1;return n=de(e,n),e[n]!=="]"?null:{value:e.slice(t,n),end:n+1}}function ol(e,r){var t;if(!Be((t=e[r])!=null?t:""))return null;let n=r+1;for(;n<e.length&&qr(e[n]);)n+=1;return{value:e.slice(r,n),end:n}}function Et(e,r){return e===null?null:/^\d+$/.test(e)?e:e in r?j(r[e].trim()):e}function de(e,r){let n=r;for(;e[n]===" "||e[n]===" "||e[n]===`
|
|
22
|
+
`||e[n]==="\r"||e[n]==="\f";)n+=1;return n}function ll(e){return Be(e)||jt(e)}function al(e){return qr(e)||e==="-"}function ul(e){return qr(e)||e==="-"}function Be(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"}function qr(e){return Be(e)||jt(e)}function jt(e){return e>="0"&&e<="9"}function oe(e,r){let n=r.trim(),t=Mt(n),i=cl(n),s=[n,t,i,n.toLowerCase(),t.toLowerCase()];for(let l of s)if(l in e)return e[l];let o=n.toLowerCase();for(let[l,a]of Object.entries(e))if(l.toLowerCase()===o||Mt(l).toLowerCase()===o)return a}function Mt(e){if(e.startsWith("--"))return e;let r="";for(let n=0;n<e.length;n+=1){let t=e[n];if(t>="A"&&t<="Z"){r+=`-${t.toLowerCase()}`;continue}r+=t}return r}function cl(e){let r="";for(let n=0;n<e.length;n+=1){let t=e[n];if(t==="-"&&n+1<e.length){let i=e[n+1];if(i>="a"&&i<="z"){r+=i.toUpperCase(),n+=1;continue}}r+=t}return r}function Nt(e,r,n,t,i){if(e.accessKey===null&&e.objectKey===null){let a=t[e.variableName];return typeof a=="string"?q(a):null}else if(e.accessKey===null){let a=D(i,e.variableName,e.objectKey);return typeof a=="string"?q(a):null}let s=Et(e.accessKey,r);if(s===null)return null;let o=n[e.variableName];if(o)return fl(o,s,e.objectKey,i);if(e.objectKey!==null)return null;let l=D(i,e.variableName,s);return typeof l=="string"?q(l):null}function fl(e,r,n,t){if(!/^\d+$/.test(r))return null;let i=e[Number.parseInt(r,10)];if(typeof i!="string")return null;if(n===null)return q(i);if(!V(i))return null;let s=I(i,t),o=oe(s,n);return typeof o=="string"?q(o):null}function Tt(e,r,n,t,i){let s=_r(e,0);return!s||s.end!==e.length?null:Nt(s.value,r,n,t,i)}function Ft(e,r,n,t,i){return e.kind==="string"?{kind:"string",value:e.value}:e.kind==="number"?Dr(e.value):e.kind==="var-call"?Tt(e.value,r,n,t,i):e.kind==="identifier"&&e.value in r?q(r[e.value]):null}function Zr(e,r,n){if(r==="plus")return pl(e,n);if(r==="minus")return ml(e,n);if(e.kind!=="number"||n.kind!=="number")return null;if(r==="star")return dl(e,n);if(n.value===0)return null;let t=$t(e.unit,n.unit);return t===null?null:{kind:"number",value:e.value/n.value,unit:t}}function pl(e,r){if(e.kind==="number"&&r.kind==="number"){let n=Br(e.unit,r.unit);return n===null?null:{kind:"number",value:e.value+r.value,unit:n}}return{kind:"string",value:`${ie(e)}${ie(r)}`}}function ml(e,r){if(e.kind==="number"&&r.kind==="number"){let n=Br(e.unit,r.unit);return n===null?null:{kind:"number",value:e.value-r.value,unit:n}}return{kind:"string",value:`${ie(e)}-${ie(r)}`}}function dl(e,r){let n=e.unit?!r.unit||e.unit===r.unit?e.unit:"":r.unit;return{kind:"number",value:e.value*r.value,unit:n}}function Bt(e){return Dt(e)}function Dt(e){let r=zt(e);if(!r)return null;for(;;){let n=ke(e);if(!n||n.kind!=="plus"&&n.kind!=="minus")break;e.index+=1;let t=zt(e);if(!t||(r=Zr(r,n.kind,t),!r))return null}return r}function zt(e){let r=Kr(e);if(!r)return null;for(;;){let n=ke(e);if(!n||n.kind!=="star"&&n.kind!=="slash")break;e.index+=1;let t=Kr(e);if(!t||(r=Zr(r,n.kind,t),!r))return null}return r}function Kr(e){let r=ke(e);if(!r||r.kind!=="plus"&&r.kind!=="minus")return gl(e);e.index+=1;let n=Kr(e);return!n||n.kind!=="number"?null:r.kind==="minus"?{kind:"number",value:-n.value,unit:n.unit}:n}function gl(e){var n;let r=ke(e);if(!r)return null;if(r.kind==="paren-open"){e.index+=1;let t=Dt(e);return!t||((n=ke(e))==null?void 0:n.kind)!=="paren-close"?null:(e.index+=1,t)}return e.index+=1,Ft(r,e.scope,e.arrays,e.variables,e.objectVariables)}function ke(e){var r;return(r=e.tokens[e.index])!=null?r:null}function _t(e){switch(e){case"+":return{kind:"plus",value:"+"};case"-":return{kind:"minus",value:"-"};case"*":return{kind:"star",value:"*"};case"/":return{kind:"slash",value:"/"};case"(":return{kind:"paren-open",value:"("};default:return{kind:"paren-close",value:")"}}}function qt(e,r,n){var i;let t="";for(let s=r+1;s<e.length;s+=1){let o=e[s],l=(i=e[s-1])!=null?i:"";if(o===n&&l!=="\\")return{value:t,end:s+1};t+=o}return null}function Zt(e,r){let n=r,t=!1;for(;n<e.length;){let i=e[n];if(Oe(i)){n+=1;continue}if(i==="."&&!t){t=!0,n+=1;continue}break}for(;n<e.length&&hl(e[n]);)n+=1;return{value:e.slice(r,n),end:n}}function Kt(e,r){var t;let n=r+1;for(;n<e.length;){let i=e[n],s=(t=e[n+1])!=null?t:"";if(bl(i)){n+=1;continue}if(i==="."&&De(s)){n+=1;continue}break}return{value:e.slice(r,n),end:n}}function Ut(e){return e===" "||e===" "||e===`
|
|
23
|
+
`||e==="\r"||e==="\f"}function Oe(e){return e>="0"&&e<="9"}function De(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"}function bl(e){return De(e)||Oe(e)}function hl(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="%"}function Ie(e){var t;let r=[],n=0;for(;n<e.length;){let i=e[n],s=(t=e[n+1])!=null?t:"";if(Ut(i)){n+=1;continue}if(i==="$")throw new Error("Invalid .luis syntax: nested or legacy `$...` usage inside `${...}` is not supported. Use plain identifiers like `${i + j}`.");if(i==="+"||i==="-"||i==="*"||i==="/"||i==="("||i===")"){r.push(_t(i)),n+=1;continue}if(i==="'"||i==='"'){let o=qt(e,n,i);if(!o)return null;r.push({kind:"string",value:o.value}),n=o.end;continue}if(Oe(i)||i==="."&&Oe(s)){let o=Zt(e,n);r.push({kind:"number",value:o.value}),n=o.end;continue}if(i==="v"){let o=se(e,n);if(o){r.push({kind:"var-call",value:o.value}),n=o.end;continue}}if(De(i)){let o=Kt(e,n);r.push({kind:"identifier",value:o.value}),n=o.end;continue}return null}return r}function Gt(e,r,n={},t={},i={}){let s=Ie(e);if(!s||s.length===0)return null;let o={index:0,tokens:s,scope:r,arrays:i,variables:n,objectVariables:t},l=Bt(o);return!l||o.index!==o.tokens.length?null:ie(l)}function Z(e,r,n={},t={},i={}){return Gt(e,r,n,t,i)}function Ht(e,r,n,t,i){return e.mode==="key"?e.key in r?r[e.key]:null:Z(e.key,r,t,i,n)}function K(e,r,n,t,i){if(!e.includes("$"))return e;let s=[],o=0;for(let l=0;l<e.length;l+=1){if(e[l]!=="$")continue;if(Ll(e,l))throw new Error(wt(e,l));let u=It(e,l);if(!u){if(e[l+1]==="{")throw new Error(Pt(e,l));continue}let c=ht(e,u.start,u.end),p=Ht(u,r,n,t,i);if(p===null)throw new Error(At(u.raw));l>o&&s.push(e.slice(o,l)),c?s.push(Lt(p)):s.push(p),l=u.end-1,o=u.end}return o===0?e:(o<e.length&&s.push(e.slice(o)),s.join(""))}function Ll(e,r){var t;let n=(t=e[r+1])!=null?t:"";return n!=="{"&&Ve(n)}function _e(e,r,n,t,i){let s={...e,[r]:n};i&&(s[i]=String(t));let o=n.trim();if(!V(o))return s;let l=I(o);for(let[a,u]of Object.entries(l))s[`${r}.${a}`]=u;return s}function Xt(e,r){return e.includes("for")?Jt(e,r,{},1):e}function Jt(e,r,n,t){let i=0,s="";for(;i<e.length;){let o=Vt(e,i);if(o===-1){s+=Qt(e.slice(i),n,r);break}s+=Qt(e.slice(i,o),n,r);let l=Te(e,o);if(!l){s+=e[o],i=o+1;continue}let a=K(l.sourceExpression,n,r.arrays,r.variables,r.objectVariables),u=Fe(a,r.arrays,r.objectVariables);if(!u){s+=e.slice(o,l.endIndex),i=l.endIndex;continue}let c=yl(e,o,r.lineOffset);if(u.length>r.resourceLimits.maxForIterationsPerLoop){me(r,c,`Loop iteration budget exceeded (${u.length}/${r.resourceLimits.maxForIterationsPerLoop}) in ${r.sourceId}.`),i=l.endIndex;continue}let p=t*u.length;if(p>r.resourceLimits.maxNestedLoopProduct){me(r,c,`Nested loop product exceeded (${p}/${r.resourceLimits.maxNestedLoopProduct}) in ${r.sourceId}.`),i=l.endIndex;continue}for(let f=0;f<u.length;f+=1){let m=u[f],g=_e(n,l.variableName,m,f,l.indexVariableName);s+=Jt(l.body,r,g,p)}i=l.endIndex}return s}function Qt(e,r,n){return e.includes("$")?K(e,r,n.arrays,n.variables,n.objectVariables):e}function yl(e,r,n=1){return n+ze(e,r)-1}function U(e,r){let n=r;for(;n<e.length&&qe(e[n]);)n+=1;return n}function le(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"}function ge(e){return le(e)||e>="0"&&e<="9"||e==="-"}function Yt(e){return le(e)||e==="-"}function ei(e){return ge(e)}function qe(e){return e===" "||e===" "||e===`
|
|
24
|
+
`||e==="\r"}function ri(e){return e.length>0&&qe(e[0])}function Ze(e){return e>="0"&&e<="9"}function ae(e,r){var l,a,u;if(!e.startsWith("var(",r))return null;let n=r+4;if(n=U(e,n),e[n]!=="-"||e[n+1]!=="-"||(n+=2,!le((l=e[n])!=null?l:"")))return null;let t=n;for(n+=1;n<e.length&&ge(e[n]);)n+=1;let i=`--${e.slice(t,n)}`,s=null;if(e[n]==="["){if(n+=1,n=U(e,n),!Ze((a=e[n])!=null?a:""))return null;let c=n;for(n+=1;n<e.length&&Ze(e[n]);)n+=1;if(n=U(e,n),e[n]!=="]")return null;s=Number.parseInt(e.slice(c,n),10),n+=1}let o=null;if(e[n]==="."){if(n+=1,!xl((u=e[n])!=null?u:""))return null;let c=n;for(n+=1;n<e.length&&ge(e[n]);)n+=1;o=e.slice(c,n)}if(n=U(e,n),e[n]!==")")return null;{let c=n+1;return{start:r,end:c,raw:e.slice(r,c),variableName:i,objectKey:o,arrayIndex:s}}}function xl(e){return le(e)||Ze(e)}function ni(e,r){if(e[r]!=="&")return null;{let n=r+1;return{startIndex:r,nextIndex:n}}}function Ke(e,r,n,t,i=0){var o;let s="";for(let l=0;l<e.length;l+=1){let a=ae(e,l);if(!a){s+=e[l];continue}let u=vl(a.variableName,a.objectKey,a.arrayIndex,r,n,t);s+=(o=Cl(u,r,n,t,i))!=null?o:a.raw,l=a.end-1}return s}function vl(e,r,n,t,i,s){return n!==null?Rl(e,r,n,t,i,s):r?D(t,e,r):void 0}function Rl(e,r,n,t,i,s){var l;let o=(l=i[e])==null?void 0:l[n];if(typeof o=="string")if(r)if(Sl(o)){let a=s(o,t);return D({"--item":a},"--item",r)}else return;else return o}function Cl(e,r,n,t,i){return!e||!e.includes("var(")||i>=4?e:Ke(e,r,n,t,i+1)}function Sl(e){let r=e.trim();return r.startsWith("{")&&r.endsWith("}")}function ti(e){let r=e.trim();if(!r.startsWith("var("))return null;let n=r.match(/^var\(\s*(--[a-zA-Z_][\w-]*)\s*\)$/);return n?n[1]:null}function ii(e){let r=e.trim().toLowerCase();return r==="__proto__"||r==="prototype"||r==="constructor"}function V(e){let r=e.trim();return r.startsWith("{")&&r.endsWith("}")}function I(e,r={},n){let i=e.trim().slice(1,-1).trim(),s=Object.create(null);if(!i)return s;let o=n?Xt(i,n):i,l=yt(o);for(let a of l){let u=a.trim();if(!u)continue;let c=u.indexOf(":");if(c===-1){let m=ti(u);if(!m)continue;let g=r[m];if(g){for(let[d,b]of Object.entries(g))s[d]=b;continue}else continue}let p=u.slice(0,c).trim(),f=u.slice(c+1).trim();if(!(!p||!f)){if(ii(p))continue;s[p]=j(f)}}return s}function Ur(e,r,n={}){let t=e.trim();if(!t)return[];let i=t.match(/^var\(\s*(--[a-zA-Z_][\w-]*)\s*\)$/);if(i){let s=i[1],o=r[s];return o?Object.entries(o).map(([l,a])=>`${Ce(l)}: ${Ke(a,r,n,I)}`):[t]}else return[Ke(t,r,n,I)]}function Ue(e){return V(e)||W(e)?!1:e.includes("{")&&e.includes("}")}function Ge(e){let r=[],n="";for(let t=0;t<e.length;t+=1){let i=e[t];if(i===`
|
|
25
|
+
`){r.push(n),n="";continue}else if(i==="\r"){r.push(n),n="",e[t+1]===`
|
|
26
|
+
`&&(t+=1);continue}n+=i}return r.push(n),r}function be(e){let r=[],n="",t=null,i=0,s=0,o=0;for(let l=0;l<e.length;l+=1){let a=e[l],u=l>0?e[l-1]:"";if(t){n+=a,a===t&&u!=="\\"&&(t=null);continue}if(a==="'"||a==='"'){t=a,n+=a;continue}if(a==="("?i+=1:a===")"&&i>0?i-=1:a==="{"?s+=1:a==="}"&&s>0?s-=1:a==="["?o+=1:a==="]"&&o>0&&(o-=1),a===";"&&i===0&&s===0&&o===0){r.push({text:n,hasTerminator:!0}),n="";continue}n+=a}return r.push({text:n,hasTerminator:!1}),r}function He(e){let r=e.match(/^\s*([^{}]+?)\s*\{([\s\S]*)\}\s*;?\s*$/);if(!r)return null;let[,n,t]=r;return{selector:n.trim(),body:t}}function we(e,r){let n=e.trim(),t=r.trim();return t.startsWith("&")?t.replace(/&/g,n):t.startsWith(":")||t.startsWith("::")||t.startsWith("[")||t.startsWith(".")||t.startsWith("#")?`${n}${t}`:`${n} ${t}`}function si(e){return Vl(e)||kl(e)}function Vl(e){var n;let r=0;if(e[r]!=="-"||e[r+1]!=="-"||(r+=2,!le((n=e[r])!=null?n:"")))return!1;for(r+=1;r<e.length&&ge(e[r]);)r+=1;return r=U(e,r),e[r]===":"}function kl(e){var t;let r=0,n=(t=e[r])!=null?t:"";if(!Yt(n))return!1;for(r+=1;r<e.length&&ei(e[r]);)r+=1;return r=U(e,r),e[r]===":"}function he(e,r){let n=ae(e,r);if(n)return{tokenStart:r,raw:n.raw,hasAmpersandPrefix:!1,reference:n};if(e[r]!=="&")return null;let t=ae(e,r+1);return t?{tokenStart:r,raw:e.slice(r,t.end),hasAmpersandPrefix:!0,reference:t}:null}function Gr(e,r){let n="",t=0;for(;t<e.length;){let i=he(e,t);if(!i){n+=e[t],t+=1;continue}let s=i.reference.objectKey||i.reference.arrayIndex!==null?void 0:r[i.reference.variableName];if(s)n+=i.hasAmpersandPrefix?`&${s}`:s,t=i.reference.end;else{n+=i.raw,t=i.reference.end;continue}}return n}function oi(e,r){let n=r.classVariables[e];return n?He(n):null}function Hr(e,r){let n="";for(let t=0;t<e.length;t+=1){let i=he(e,t);if(!i){n+=e[t];continue}let s=Qr(i.reference,r);n+=s!=null?s:i.raw,t=i.reference.end-1}return n}function Qr(e,r){var n;if(e.arrayIndex!==null){let t=(n=r.arrayVariables[e.variableName])==null?void 0:n[e.arrayIndex];return typeof t!="string"?void 0:e.objectKey?Ol(t,e.objectKey,r):t}else if(e.objectKey){let t=r.objectVariables[e.variableName];return t?oe(t,e.objectKey):void 0}else return}function Ol(e,r,n){if(!V(e))return;let t=I(e,n.objectVariables);return oe(t,r)}function Le(e,r){let n="",t=0;for(;t<e.length;){let i=he(e,t);if(!i){n+=e[t],t+=1;continue}let s=i.reference;if(s.objectKey||s.arrayIndex!==null){let a=Qr(s,r);n+=a!=null?a:i.raw,t=s.end;continue}let o=r.classVariables[s.variableName];if(o){let a=He(o);if(a){n=i.hasAmpersandPrefix?Il(n,a.selector.trim()):`${n}${a.selector.trim()}`,t=s.end;continue}}let l=r.variables[s.variableName];if(l){n+=l.trim(),t=s.end;continue}else n+=s.raw,t=s.end}return n}function Il(e,r){let n=e.trim();return n?we(n,r):r}function Xr(e,r){let n=e.trim(),t=r.trim();return t?n?ri(r)?`${n} ${t}`:`${n}${t}`:t:n}function li(e,r,n){let t=e.trim();return t?qe(n)?`${t} ${r}`:we(t,r):r}function Jr(e,r){let n=e.trim();if(!n||si(n))return null;let t=wl(n,r.classVariables);if(t.length===0)return null;let i="",s="",o=0;for(let u=0;u<t.length;u+=1){let c=t[u],p=Le(n.slice(o,c.start),r);i=Xr(i,p);let f=Le(c.rule.selector,r).trim();if(!f)return null;if(c.hasAmpersandPrefix){let m=i.trim();if(m)i=we(m,f);else return null}else{let m=c.start>0?n[c.start-1]:"";i=li(i,f,m)}s=c.rule.body.trim(),o=c.end}let l=Le(n.slice(o),r);i=Xr(i,l);let a=i.trim();return!a||!s?null:`${a} { ${s} }`}function wl(e,r){let n=[],t=0;for(;t<e.length;){let i=ni(e,t),s=i?i.nextIndex:t,o=ae(e,s);if(!o||o.objectKey||o.arrayIndex!==null){t+=1;continue}if(!r[o.variableName]){t=o.end;continue}let a=oi(o.variableName,{classVariables:r,variables:{},objectVariables:{},arrayVariables:{}});if(!a){t=o.end;continue}let u=i?i.startIndex:o.start;n.push({start:u,end:o.end,hasAmpersandPrefix:!!i,rule:a}),t=o.end}return n}function ai(e,r){let n="",t="",i=null,s=!1;for(let o=0;o<e.length;o+=1){let l=e[o];if(i){t+=l,s?s=!1:l==="\\"?s=!0:l===i&&(i=null);continue}if(l==="'"||l==='"'){i=l,t+=l;continue}if(l==="{"){n+=Pl(t,r),n+="{",t="";continue}else if(l===";"||l==="}"){n+=t,n+=l,t="";continue}t+=l}return n+=t,n}function Pl(e,r){let n=e.trim();return!n||n.startsWith("@")||!e.includes("var(")?e:Le(e,r)}function Qe(e,r){if(!e.includes("var("))return e;let n=Ge(e),t=[];for(let s of n)t.push(Al(s,r));let i=t.join(`
|
|
27
|
+
`);return ai(i,r)}function Al(e,r){if(!e.includes("var("))return e;if(!e.includes(";")){let s=Jr(e,r);return s||Hr(Gr(e,r.classVariables),r)}let n=be(e),t=[],i=!1;for(let s of n){let o=Jr(s.text,r);if(o){t.push(o),i=!0;continue}let l=Hr(Gr(s.text,r.classVariables),r);l!==s.text&&(i=!0);let a=s.hasTerminator?";":"";t.push(`${l}${a}`)}return i?t.join(`
|
|
28
|
+
`):e}function Wl(e,r,n,t,i,s,o,l,a,u="<inline>",c="fail-closed",p){$l(r)||(V(r)?i[e]=I(r,i,p?{variables:n,arrays:s,objectVariables:i,sourceId:`${u}::${e}`,resourcePolicy:c,resourceLimits:p,warnings:o,lineOffset:a}:void 0):W(r)?(l&&Er(r)&&o.push(El(e,a,r)),s[e]=re(r)):Ue(r)?t[e]=r:n[e]=r)}function Xe(e,r,n,t,i,s,o,l="<inline>",a="fail-closed",u){var c;for(let p of e)Wl(p.name,p.value,r,n,t,i,s,o,(c=p.line)!=null?c:1,l,a,u)}function $l(e){try{return!!(E(e)||!V(e)&&!Ue(e)&&!W(e)&&(e.includes("{")||e.includes("}")))}catch(r){return O("containsUnsafeVariablePayload",r)}}function El(e,r,n){return{code:"invalid-array-range-unit",line:r,message:`Array range "${e}" uses mismatched units in "${n}". Prefer same-unit ranges like [1px-12px] or [1rem-12rem].`}}var ui=/(^|[^a-zA-Z0-9_-]):root\b/;function ye(e){return e.trimStart().startsWith("--")}function ci(e){return/^[}\s]*$/.test(e)}function fi(e,r,n){return n||r!==0?!1:ui.test(e)&&e.includes("{")}function pi(e){let r=e.indexOf("{");return r===-1?{prefix:e,inline:""}:{prefix:e.slice(0,r+1),inline:e.slice(r+1)}}function mi(e,r,n,t){return!n&&r===0&&ui.test(e)&&t>0}var jl=/^--[a-zA-Z_][\w-]*$/;function Je(e){let r=[],n=e.trim();for(;ye(n);){let t=Ml(n);if(!t)break;r.push({name:t.name,value:t.value}),n=t.remainder.trimStart()}return{declarations:r,remainder:n}}function Ml(e){let r=e.indexOf(":");if(r<=2)return null;let n=e.slice(0,r).trim();if(!jl.test(n))return null;let t=0,i=0,s=0,o=null,l=-1;for(let p=r+1;p<e.length;p+=1){let f=e[p],m=p>r+1?e[p-1]:"";if(o){f===o&&m!=="\\"&&(o=null);continue}if(f==="'"||f==='"'){o=f;continue}if(f==="("?t+=1:f===")"&&t>0?t-=1:f==="["?i+=1:f==="]"&&i>0?i-=1:f==="{"?s+=1:f==="}"&&s>0&&(s-=1),f===";"&&t===0&&i===0&&s===0){l=p;break}}if(l===-1){if(o||t>0||i>0||s>0)return null;l=e.length}let a=e.slice(r+1,l).trim();if(!a)return null;let c=l<e.length&&e[l]===";"?l+1:l;return{name:n,value:a,remainder:e.slice(c)}}function ue(e,r=!0,n){var w,N;if(!e.includes("--")&&!e.includes(":root"))return{cleanSource:e,variables:{},classVariables:{},objectVariables:{},arrayVariables:{},warnings:[]};let t={},i={},s={},o={},l=[],a=[],u=e.split(/\r?\n/),c=0,p=!1,f=0,m=null,g=(w=n==null?void 0:n.sourceId)!=null?w:"<inline>",d=(N=n==null?void 0:n.resourcePolicy)!=null?N:"fail-closed",b=n==null?void 0:n.resourceLimits;for(let P=0;P<u.length;P+=1){let y=u[P],A=y.trim(),B=P+1;if(m){m.source=`${m.source}
|
|
29
|
+
${A}`;let R=Je(m.source),C=R.remainder.trimStart();R.declarations.length>0&&ci(C)&&(Xe(Yr(R.declarations,m.line),t,i,s,o,l,r,g,d,b),C.length>0&&(a.push(C),h(C)),m=null);continue}if(fi(A,c,p)){let R=pi(y);R.prefix.trim().length>0&&(a.push(R.prefix),h(R.prefix));let C=R.inline.trimStart();if(!C)continue;let Y=Je(C),T=Y.remainder.trimStart();if(Y.declarations.length>0&&Xe(Yr(Y.declarations,B),t,i,s,o,l,r,g,d,b),ye(T)){m={source:T,line:B};continue}else T.length>0&&(a.push(T),h(T));continue}if((c===0||p)&&ye(A)){let R=Je(A),C=R.remainder.trimStart();if(R.declarations.length>0&&Xe(Yr(R.declarations,B),t,i,s,o,l,r,g,d,b),ye(C)){m={source:C,line:B};continue}else C.length>0&&(a.push(C),h(C));continue}a.push(y),h(y)}return m&&a.push(m.source),{cleanSource:a.join(`
|
|
30
|
+
`),variables:t,classVariables:i,objectVariables:s,arrayVariables:o,warnings:l};function h(P){let y=Ar(P,"{"),A=Ar(P,"}"),B=P.trim();mi(B,c,p,y)?(p=!0,f=y-A):p&&(f+=y-A),p&&f<=0&&(p=!1,f=0),c+=y-A,c=Math.max(c,0)}}function Yr(e,r){return e.map(n=>{var t;return{...n,line:(t=n.line)!=null?t:r}})}function di(e,r,n,t){let i=ue(e),s=Nl(i);for(let o of s){let l=n.get(o);l&&l!==r&&t.push({code:"duplicate-import-variable",line:1,message:`[${r}] Variable "${o}" duplicates declaration from "${l}".`}),l||n.set(o,r)}}function Nl(e){return[...Object.keys(e.variables),...Object.keys(e.classVariables),...Object.keys(e.objectVariables),...Object.keys(e.arrayVariables)]}function en(e,r,n){var p;di(e,r,n.variableOwners,n.warnings);let t=Xn(),i=S(),s=0,o=1,l=0,a=null,u=!1,c=!1;for(;s<e.length;){let f=e[s],m=(p=e[s+1])!=null?p:"",g=s>0?e[s-1]:"";if(f===`
|
|
31
|
+
`&&(o+=1),u){f===`
|
|
32
|
+
`&&(u=!1),x(i,f,r,o),s+=1;continue}if(c){if(f==="*"&&m==="/"){c=!1,x(i,"*",r,o),x(i,"/",r,o),s+=2;continue}x(i,f,r,o),s+=1;continue}if(a){f===a&&g!=="\\"&&(a=null),x(i,f,r,o),s+=1;continue}if(f==="'"||f==='"'){a=f,x(i,f,r,o),s+=1;continue}if(f==="/"&&m==="*"){c=!0,x(i,"/",r,o),x(i,"*",r,o),s+=2;continue}else if(f==="/"&&m==="/"){u=!0,x(i,"/",r,o),x(i,"/",r,o),s+=2;continue}if(f==="{"){l+=1,ee(t),x(i,f,r,o),s+=1;continue}else if(f==="}"){l=Math.max(0,l-1),x(i,f,r,o),s+=1;continue}if(l===0&&f==="@"){let d=ft(e,s,o);if(!d){ee(t),x(i,f,r,o),s+=1;continue}let b=ct(d.statement,d.lineStart,r,n,t,en);kr(i,b),s=d.end,o=d.lineEnd;continue}l===0&&!Or(f)&&ee(t),x(i,f,r,o),s+=1}return i}function gi(e,r){let n=qn(r.sourceId,"<inline>");if(!e.includes("@import")&&!e.includes("@char")&&!e.includes("@charset")&&!e.includes("@layer"))return{...$(e,n),warnings:[]};let t={options:r,warnings:[],variableOwners:new Map,importStack:[n],importCount:0,importedBytes:0,resourceLimits:Ne(r)};return{...en(e,n,t),warnings:t.warnings}}function bi(e,r){return gi(e,r)}function k(e,r){let n=r;for(;n<e.length&&Tl(e[n]);)n+=1;return n}function G(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"}function ce(e){return G(e)||e>="0"&&e<="9"||e==="-"}function hi(e){return G(e)||e==="-"}function Li(e){return ce(e)}function Tl(e){return e===" "||e===" "||e===`
|
|
33
|
+
`||e==="\r"}function Ye(e){let r=[],n="";for(let t=0;t<e.length;t+=1){let i=e[t];if(i===`
|
|
34
|
+
`){r.push(n),n="";continue}else if(i==="\r"){r.push(n),n="",e[t+1]===`
|
|
35
|
+
`&&(t+=1);continue}n+=i}return r.push(n),r}function xi(e){var a;let r="",n="",t=0,i=null,s=!1,o=!1,l=!1;for(;t<e.length;){let u=e[t],c=(a=e[t+1])!=null?a:"",p=t>0?e[t-1]:"";if(u===`
|
|
36
|
+
`){o||(r+=`${n}
|
|
37
|
+
`),n="",l=!1,o=!1,t+=1;continue}if(o){t+=1;continue}if(s){u==="*"&&c==="/"?(s=!1,t+=2):t+=1;continue}if(i){n+=u,u===i&&p!=="\\"&&(i=null),yi(u)||(l=!0),t+=1;continue}if(u==="'"||u==='"'){i=u,n+=u,l=!0,t+=1;continue}if(u==="/"&&c==="*"){s=!0,t+=2;continue}else if(u==="/"&&c==="/"&&!l){o=!0,t+=2;continue}n+=u,yi(u)||(l=!0),t+=1}return o||(r+=n),r}function yi(e){return e===" "||e===" "||e==="\r"||e==="\f"}function er(e,r){var t,i,s;if(!e.startsWith("var(",r))return null;let n=r+4;if(n=k(e,n),e[n]!=="-"||e[n+1]!=="-"||(n+=2,!G((t=e[n])!=null?t:"")))return null;for(n+=1;n<e.length&&ce(e[n]);)n+=1;if(n=k(e,n),e[n]==="["){if(n+=1,n=k(e,n),!vi((i=e[n])!=null?i:""))return null;for(n+=1;n<e.length&&vi(e[n]);)n+=1;if(n=k(e,n),e[n]!=="]")return null;n+=1,n=k(e,n)}if(e[n]==="."){if(n+=1,!G((s=e[n])!=null?s:""))return null;for(n+=1;n<e.length&&ce(e[n]);)n+=1}if(n=k(e,n),e[n]!==")")return null;{let o=n+1;return{raw:e.slice(r,o),end:o}}}function vi(e){return e>="0"&&e<="9"}function rr(e){let r=e.endsWith(";")?e.slice(0,-1).trimEnd():e,n=er(r,0);return!!(n&&n.end===r.length)}function xe(e,r){return nr(e,r)||rn(e,r)}function nr(e,r){var t;let n=r;if(e[n]!=="-"||e[n+1]!=="-"||(n+=2,!G((t=e[n])!=null?t:"")))return!1;for(n+=1;n<e.length&&ce(e[n]);)n+=1;return n=k(e,n),e[n]===":"}function rn(e,r){var i;let n=r,t=(i=e[n])!=null?i:"";if(!hi(t))return!1;for(n+=1;n<e.length&&Li(e[n]);)n+=1;return n=k(e,n),e[n]===":"}function Ri(e){var n;let r=0;if(e[r]!=="-"||e[r+1]!=="-"||(r+=2,!G((n=e[r])!=null?n:"")))return-1;for(r+=1;r<e.length&&ce(e[r]);)r+=1;return r=k(e,r),e[r]===":"?r:-1}function Ci(e){let r=Ye(e),n=[];for(let t of r){let i=Fl(t),s=zl(i);n.push(s)}return n.join(`
|
|
38
|
+
`)}function Fl(e){var t;let r="",n=0;for(;n<e.length;){let i=er(e,n);if(!i){r+=e[n],n+=1;continue}r+=i.raw;let s=i.end,o=k(e,s);((t=e[o])!=null?t:"")!==";"&&xe(e,o)&&(r+=";"),n=s}return r}function zl(e){let r=e.trim();return!rr(r)||r.endsWith(";")?e:`${e.trimEnd()};`}function Si(e){var n;let r=0;for(;r<e.length;){let t=er(e,r);if(!t){r+=1;continue}let i=k(e,t.end);if(((n=e[i])!=null?n:"")!==";"&&xe(e,i))return!0;r=t.end}return!1}function Vi(e,r){var s,o;let n=(o=(s=e[r])==null?void 0:s.trim())!=null?o:"";if(!n||!xe(n,0))return!1;let t=Bl(e,r+1);if(t===-1)return!1;let i=e[t].trim();return!(!i||i.startsWith("}")||i==="{"||i.endsWith("{")||i.startsWith("@")||xe(i,0)||i.includes("&var(")||/^var\(\s*--/.test(i))}function Bl(e,r){for(let n=r;n<e.length;n+=1)if(e[n].trim().length>0)return n;return-1}function Oi(e){let r=[],n=Ye(e);for(let t=0;t<n.length;t+=1){let i=n[t].trim();if(i&&!Dl(i)&&!ql(i)){if(Si(i)){let s=ki(n,t);r.push({code:"missing-semicolon",line:t+1,message:s?`Missing semicolon after var(...) statement before next declaration. (selector: ${s})`:"Missing semicolon after var(...) statement before next declaration."})}if(!i.endsWith(";")&&_l(i)){if(Zl(n,t))continue;if(Vi(n,t))continue;let s=ki(n,t);r.push({code:"missing-semicolon",line:t+1,message:s?`Missing semicolon at end of line. (selector: ${s})`:"Missing semicolon at end of line."})}}}return r}function Dl(e){return e==="{"||e==="}"||e.endsWith("{")||e.endsWith("}")?!0:!!(e.startsWith("@for")||e.startsWith("for(")||e.startsWith("for ("))}function _l(e){return nr(e,0)||rn(e,0)||rr(e)?!0:!!e.includes("&var(")}function ql(e){if(nr(e,0)){if(e.endsWith("[")||e.endsWith("{"))return!0}else return!1;let r=Ri(e);return r===-1?!1:e.slice(r+1).trim().length===0}function Zl(e,r){let n=Kl(e,r+1);return n===-1?!1:e[n].trim().startsWith("}")}function Kl(e,r){for(let n=r;n<e.length;n+=1)if(e[n].trim().length>0)return n;return-1}function ki(e,r){for(let n=r;n>=0;n-=1){let t=e[n].trim();if(t){if(t.startsWith("@"))continue}else continue;let i=t.indexOf("{");if(i<=0)continue;let s=t.slice(0,i).trim();if(!(!s||s.includes(":")&&!s.startsWith(".")&&!s.startsWith("#")))return s}return null}function Ii(e,r=!0){let n=e.includes("/*")||e.includes("//")?xi(e):e,t=r?Oi(n):[];return{source:Ci(n),warnings:t}}function H(e){let r=2166136261;for(let n=0;n<e.length;n+=1)r^=e.charCodeAt(n),r=Math.imul(r,16777619);return(r>>>0).toString(36)}function wi(e){let r=[e.atRules.join(""),e.selector,e.declarations.join("")].join("");return H(r)}function Pi(e,r){var t;let n=[];for(let i of e){let s=(t=r[i])!=null?t:"";n.push(`${i}=${s}`)}return H(n.join(""))}function tr(e,r,n,t){let i=n.trim();i&&e.push({kind:r,content:i,line:t,key:`${r}:${e.length}`})}function Ai(e){return e.trim().length===0}function Wi(e){return e===" "||e===" "||e===`
|
|
39
|
+
`||e==="\r"}function $i(e){var a;let r=[],n="",t=0,i=1,s=1,o=null,l=!1;for(let u=0;u<e.length;u+=1){let c=e[u],p=(a=e[u+1])!=null?a:"",f=u>0?e[u-1]:"";if(l){n+=c,c==="*"&&p==="/"&&(n+="/",u+=1,l=!1),c===`
|
|
40
|
+
`&&(i+=1);continue}if(o){n+=c,c===o&&f!=="\\"&&(o=null),c===`
|
|
41
|
+
`&&(i+=1);continue}if(c==="/"&&p==="*"){n+="/*",u+=1,l=!0;continue}else if(c==="'"||c==='"'){o=c,n+=c;continue}if(Ai(n)&&!Wi(c)&&(s=i),c===";"&&t===0){n+=c,tr(r,"declaration",n,s),n="",s=i;continue}if(c==="{"){t+=1,n+=c;continue}else if(c==="}"){if(t===0)return null;t-=1,n+=c,t===0&&(tr(r,"block",n,s),n="",s=i);continue}n+=c,c===`
|
|
42
|
+
`&&(i+=1)}return t!==0||o||l?null:(tr(r,"declaration",n,s),r)}function Ei(e,r={}){let n=Object.keys(e).sort(),t=Object.keys(r).sort(),i=[];for(let s of n){let o=e[s],l=Object.keys(o).sort(),a=[];for(let u of l)a.push(`${u}:${o[u].trim()}`);i.push(`${s}=>${a.join("|")}`)}for(let s of t)i.push(`${s}=>${r[s].map(o=>o.trim()).join("|")}`);return H(i.join(""))}function ji(e,r){var t;let n=new Map;if(!e||e.objectSignature!==r)return n;for(let i of e.segments){let s=(t=n.get(i.fingerprint))!=null?t:[];s.push(i),n.set(i.fingerprint,s)}return n}function Mi(e,r,n,t,i){let s=n.get(e.key);if(s&&s.kind===e.kind&&s.fingerprint===r)return s;let o=t.get(r);if(!o||o.length===0)return null;for(let l of o)if(l.kind===e.kind&&!i.has(l))return i.add(l),l;return null}function ir(e,r,n,t={}){if(Ni(r))return;let i=Ur(r,n,t);for(let s of i)Ni(s)||e.declarations.push(s)}function tn(e,r,n=1){return{type:e,value:r,line:n,declarations:[],children:[]}}function Pe(e){return e[e.length-1]}function Ti(e){var n;if(!e.startsWith("var("))return!1;let r=4;if(r=nn(e,r),e[r]!=="-"||e[r+1]!=="-"||(r+=2,!Fi((n=e[r])!=null?n:"")))return!1;for(r+=1;r<e.length&&Ul(e[r]);)r+=1;return r=nn(e,r),e[r]!==")"?!1:(r+=1,r=nn(e,r),r===e.length)}function nn(e,r){let n=r;for(;n<e.length&&Gl(e[n]);)n+=1;return n}function Fi(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"}function Ul(e){return Fi(e)||e>="0"&&e<="9"||e==="-"||e==="_"}function Gl(e){return e===" "||e===" "||e===`
|
|
43
|
+
`||e==="\r"}function Ni(e){try{return E(e)}catch(r){return O("containsUnsafeCssPayload",r)}}function sn(e,r,n=1,t={}){var u;let i=tn("root","",n),s=[i],o=[n],l="",a=n;for(let c=0;c<e.length;c+=1){let p=e[c];if(p==="{"){let f=l.trim();if(l="",!f)continue;let m=f.startsWith("@")?"at-rule":"selector",g=tn(m,f,a);Pe(s).children.push(g),s.push(g),o.push(a);continue}if(p===";"){let f=l.trim();if(l="",!f)continue;let m=Pe(s);if(m.type==="root"){f.startsWith("@")&&m.declarations.push(f);continue}ir(m,f,r,t);continue}if(p==="}"){let f=l.trim();if(l="",f.length>0){let m=Pe(s);m.type!=="root"&&ir(m,f,r,t)}if(s.length===1)throw new Error(`Invalid .luis syntax: unmatched closing brace at line ${a}.`);s.pop(),o.pop();continue}if(p===`
|
|
44
|
+
`||p==="\r"){let f=l.trim(),m=Pe(s);if(m.type!=="root"&&Ti(f)){ir(m,f,r,t),l="";continue}}l+=p,p===`
|
|
45
|
+
`&&(a+=1)}if(s.length!==1){let c=(u=o[o.length-1])!=null?u:a;throw new Error(`Invalid .luis syntax: missing closing brace for block opened near line ${c}.`)}return i}function on(e,r,n){for(let t of r)e.declarations.push(t);for(let t of n)e.children.push(Q(t))}function Q(e){return{type:e.type,value:e.value,line:e.line,declarations:[...e.declarations],children:e.children.map(r=>Q(r))}}function zi(e,r,n={}){if(e.kind==="declaration"){let i=e.content.trim();return i.startsWith("@")?{declarations:[i],children:[]}:{declarations:[],children:[]}}let t=sn(e.content,r,e.line,n);return{declarations:[...t.declarations],children:t.children.map(i=>Q(i))}}function ln(e,r,n,t){let i=sn(e,r,1,n);return{root:i,cache:{objectSignature:t,segments:[{key:"fallback:0",kind:"block",fingerprint:H(e),declarations:[...i.declarations],children:i.children.map(s=>Q(s))}]},stats:{totalSegments:1,reusedSegments:0,parsedSegments:1}}}function Bi(e,r,n={},t){var f;let i=Ei(r,n);if(!t)return ln(e,r,n,i);let s=$i(e);if(!s)return ln(e,r,n,i);let o={type:"root",value:"",line:1,declarations:[],children:[]},l=new Map((f=t==null?void 0:t.segments.map(m=>[m.key,m]))!=null?f:[]),a=ji(t,i),u=new Set,c=[],p=0;for(let m of s){let g=H(m.content),d=Mi(m,g,l,a,u);if(d){p+=1,c.push({key:m.key,kind:d.kind,fingerprint:d.fingerprint,declarations:[...d.declarations],children:d.children.map(h=>Q(h))}),on(o,d.declarations,d.children);continue}let b=zi(m,r,n);c.push({key:m.key,kind:m.kind,fingerprint:g,declarations:[...b.declarations],children:b.children.map(h=>Q(h))}),on(o,b.declarations,b.children)}return{root:o,cache:{objectSignature:i,segments:c},stats:{totalSegments:s.length,reusedSegments:p,parsedSegments:s.length-p}}}function Di(e,r,n,t,i){if(!e.includes("var(")||Object.keys(r).length===0&&Object.keys(n).length===0&&Object.keys(t).length===0)return e;let s="",o={};for(let l=0;l<e.length;l+=1){let a=Hl(e,l);if(!a){s+=e[l];continue}if(a.accessKey!==null){let p=Ql(a.name,a.accessKey,r,n,t,i,Xl(e,l));s+=p!=null?p:a.raw,l=a.end-1;continue}let u=r[a.name];if(!u){s+=a.raw,l=a.end-1;continue}let c=o[a.name];if(typeof c=="string")s+=c;else{let p=u.join(", ");o[a.name]=p,s+=p}l=a.end-1}return s}function Hl(e,r){var l,a;if(e.slice(r,r+4)!=="var(")return null;let n=v(e,r+4);if(e[n]!=="-"||e[n+1]!=="-")return null;let t=n;if(n+=2,!Ve((l=e[n])!=null?l:""))return null;for(n+=1;n<e.length&&ea(e[n]);)n+=1;let i=e.slice(t,n),s=null;if(n=v(e,n),e[n]==="["){if(n+=1,n=v(e,n),!Jl((a=e[n])!=null?a:""))return null;let u=n;for(n+=1;n<e.length&&Yl(e[n]);)n+=1;if(n=v(e,n),e[n]!=="]")return null;s=e.slice(u,n),n+=1}if(n=v(e,n),e[n]!==")")return null;let o=n+1;return{name:i,accessKey:s,end:o,raw:e.slice(r,o)}}function Ql(e,r,n,t,i,s,o){var u,c;let l=n[e],a=t[e];if(l&&/^\d+$/.test(r)){let p=Number.parseInt(r,10);return(u=l[p])!=null?u:null}else return a?(c=D(t,e,r))!=null?c:null:((e in i||e in n)&&s.push({code:"invalid-object-loop-access",line:o,message:`Variable "${e}" is not an object variable and cannot be accessed with [${r}].`}),null)}function Xl(e,r){let n=1;for(let t=0;t<r;t+=1)e[t]===`
|
|
46
|
+
`&&(n+=1);return n}function Jl(e){return Ve(e)||_i(e)}function Yl(e){return zr(e)||e==="-"||_i(e)}function ea(e){return zr(e)||e==="-"}function _i(e){return e>="0"&&e<="9"}function sr(e){if(!e.includes("calc")&&!e.includes("min")&&!e.includes("max")&&!e.includes("clamp"))return[];let r=[],n=/\b(calc|min|max|clamp)\s*\(/g,t=n.exec(e);for(;t;){let i=t[0].lastIndexOf("("),s=t.index+i,o=L(e,s,"(",")");o!==-1&&r.push({start:t.index,end:o+1}),t=n.exec(e)}return r}function Ae(e,r){for(let n of r)if(e>=n.start&&e<n.end)return!0;return!1}function or(e,r){if(!e.includes("*"))return e;let n=sr(e);return(e.includes("(")?ra(e,r,n):e).replace(/([a-zA-Z0-9_.()%\-]+)\s*\*\s*([a-zA-Z0-9_.()%\-]+)/g,(s,o,l,a)=>{if(Ae(a,n))return s;let u=We(o,r),c=We(l,r);if(!u||!c)return s;let p=qi(u.unit,c.unit);if(p===null)return s;let f=u.value*c.value;return`${Zi(f)}${p}`})}function ra(e,r,n){return e.replace(/\(\s*([a-zA-Z0-9_.()%\-]+)\s*\*\s*([a-zA-Z0-9_.()%\-]+)\s*\)([a-zA-Z%]+)/g,(t,i,s,o,l)=>{if(Ae(l,n))return t;let a=We(i,r),u=We(s,r);if(!a||!u)return t;let c=qi(a.unit,u.unit);if(c===null)return t;if(c&&c!==o)return t;let p=a.value*u.value;return`${Zi(p)}${o}`})}function We(e,r){let n=e.trim(),t=na(n);if(t){let s=r[t];return s?We(s,r):null}let i=ta(n);return i||null}function qi(e,r){return!e&&!r?"":e&&!r?e:!e&&r?r:e===r?e:null}function Zi(e){let r=Number.parseFloat(e.toFixed(6));return Number.isInteger(r),String(r)}function na(e){var t;if(!e.startsWith("var(")||!e.endsWith(")"))return null;let r=e.slice(4,-1).trim();if(!r.startsWith("--"))return null;let n=(t=r[2])!=null?t:"";if(!Ki(n))return null;for(let i=3;i<r.length;i+=1)if(!ia(r[i]))return null;return r}function ta(e){let r=0;e[r]==="-"&&(r+=1);let n=!1;for(;r<e.length&&an(e[r]);)n=!0,r+=1;if(e[r]===".")for(r+=1;r<e.length&&an(e[r]);)n=!0,r+=1;if(!n)return null;let t=e.slice(0,r),i=e.slice(r);if(i&&!sa(i))return null;let s=Number.parseFloat(t);return Number.isNaN(s)?null:{value:s,unit:i}}function Ki(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"}function ia(e){return Ki(e)||an(e)||e==="-"}function an(e){return e>="0"&&e<="9"}function sa(e){if(!e)return!1;for(let r=0;r<e.length;r+=1){let n=e[r];if(!(n>="a"&&n<="z"||n>="A"&&n<="Z")&&n!=="%")return!1}return!0}var oa=/(?:var\(\s*--[a-zA-Z_][\w-]*\s*\)|-?\d+(?:\.\d+)?(?:[a-zA-Z%]+)?)(?:\s+[+-]\s+(?:var\(\s*--[a-zA-Z_][\w-]*\s*\)|-?\d+(?:\.\d+)?(?:[a-zA-Z%]+)?))+/g;function lr(e,r){let n=sr(e);return e.replace(oa,(t,i)=>{if(Ae(i,n))return t;let s=la(t,r);if(s===null)return t;let o=Z(s,{});return o===null?t:o})}function la(e,r){let n="";for(let t=0;t<e.length;t+=1){if(e[t]!=="v"||e.slice(t,t+4)!=="var("){n+=e[t];continue}let i=e.indexOf(")",t+4);if(i===-1)return null;let s=e.slice(t+4,i).trim();if(!s.startsWith("--")||!(s in r))return null;n+=r[s],t=i}return n}function Ui(e){return!e.includes(":{")&&!e.includes(": {")?e:e.split(/\r?\n/).map(t=>{let i=t.trim();return i.includes(";")?t:i.match(/:\s*\{$/)?t.replace(/:\s*\{$/," {"):t}).join(`
|
|
47
|
+
`)}function ar(e,r,n,t,i,s){let o=e;return e.includes("$")&&(o=K(o,s,n,r,t)),o.includes("var(")&&(o=Di(o,n,t,r,i)),(o.includes("+")||o.includes("-"))&&(o=lr(o,r)),o.includes("*")&&(o=or(o,r)),Ui(o)}function Gi(e,r){let n=Nr(e,r,"if");if(!n)return null;let t=[n.branch],i=n.endIndex;for(;i<e.length;){i=v(e,i);let s=Nr(e,i,"elseif");if(s){t.push(s.branch),i=s.endIndex;continue}let o=Rt(e,i);o&&(t.push(o.branch),i=o.endIndex);break}return{branches:t,endIndex:i}}function un(e){let r=[],n=[],t=0;for(let i=0,s=0,o=null;i<e.length;i+=1){let l=e[i],a=i>0?e[i-1]:"";if(o){l===o&&a!=="\\"&&(o=null);continue}if(l==="'"||l==='"'){o=l;continue}l==="("?s+=1:l===")"&&s>0&&(s-=1);let u=s===0?aa(e,i):null;u&&(r.push(e.slice(t,i)),n.push(u),i+=u.length-1,t=i+1)}return r.push(e.slice(t)),{segments:r,operators:n}}function cn(e){for(let r=0,n=0,t=null;r<e.length;r+=1){let i=e[r],s=r>0?e[r-1]:"";if(t){i===t&&s!=="\\"&&(t=null);continue}if(i==="'"||i==='"'){t=i;continue}i==="("?n+=1:i===")"&&n>0&&(n-=1);let o=n===0?ua(e,r):null;if(o)return{operator:o,start:r,end:r+o.length}}return null}function Hi(e){return e.startsWith("(")&&L(e,0,"(",")")===e.length-1?e.slice(1,-1).trim():null}function aa(e,r){return e[r]==="&"&&e[r+1]==="&"?"&&":e[r]==="|"&&e[r+1]==="|"?"||":null}function ua(e,r){var s,o;let n=e[r],t=(s=e[r+1])!=null?s:"",i=(o=e[r+2])!=null?o:"";return n==="="&&t==="="&&i==="="?"===":n==="!"&&t==="="&&i==="="?"!==":n===">"&&t==="="?">=":n==="<"&&t==="="?"<=":n===">"?">":n==="<"?"<":null}function mn(e,r,n,t,i){let s=un(e);if(s.operators.length===0)return fn(e,r,n,t,i);let o=fn(s.segments[0],r,n,t,i);for(let l=0;l<s.operators.length;l+=1)o+=` ${s.operators[l]} ${fn(s.segments[l+1],r,n,t,i)}`;return o}function fn(e,r,n,t,i){let s=e.trim();if(!s)return s;let o=Hi(s);if(o!==null&&ca(o))return`(${mn(o,r,n,t,i)})`;let l=cn(s);if(!l)return pn(s,r,n,t,i);let a=pn(s.slice(0,l.start),r,n,t,i),u=pn(s.slice(l.end),r,n,t,i);return`${a} ${l.operator} ${u}`}function pn(e,r,n,t,i){let s=e.trim();if(!s||fa(s))return s;let o=Z(s,r,n,t,i);return o!=null?o:s}function ca(e){return un(e).operators.length>0||cn(e)!==null}function fa(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')}function Qi(e){let r=[],n=0;for(;n<e.length;){let t=e[n];if(Ji(t)){n+=1;continue}if(t==="("){r.push({type:"lparen",value:"("}),n+=1;continue}else if(t===")"){r.push({type:"rparen",value:")"}),n+=1;continue}let i=Xi(e,n);if(i){r.push({type:"operator",value:i}),n+=i.length;continue}let s=pa(e,n);if(s)r.push({type:"value",value:s.value}),n=s.endIndex;else return null}return r}function Xi(e,r){var s,o;let n=e[r],t=(s=e[r+1])!=null?s:"",i=(o=e[r+2])!=null?o:"";return n==="="&&t==="="&&i==="="?"===":n==="!"&&t==="="&&i==="="?"!==":n===">"&&t==="="?">=":n==="<"&&t==="="?"<=":n==="&"&&t==="&"?"&&":n==="|"&&t==="|"?"||":n===">"?">":n==="<"?"<":null}function pa(e,r){let n=e[r];return n==="'"||n==='"'?ma(e,r):e.slice(r,r+4)==="var("?da(e,r):ga(e,r)}function ma(e,r){let n=e[r],t=r+1;for(;t<e.length;){let i=e[t],s=t>r?e[t-1]:"";if(i===n&&s!=="\\")return{value:e.slice(r,t+1),endIndex:t+1};t+=1}return null}function da(e,r){let n=0;for(let t=r;t<e.length;t+=1){let i=e[t];if(i==="(")n+=1;else if(i===")"&&(n-=1,n===0))return{value:e.slice(r,t+1),endIndex:t+1}}return null}function ga(e,r){let n=r;for(;n<e.length;){let i=e[n],s=i==="="||i==="!"||i===">"||i==="<"||i==="&"||i==="|";if(Ji(i)||i==="("||i===")"||s&&Xi(e,n))break;n+=1}let t=e.slice(r,n).trim();return t?{value:t,endIndex:n}:null}function Ji(e){return e===" "||e===" "||e===`
|
|
48
|
+
`||e==="\r"||e==="\f"}function cr(e,r,n,t,i){let s=ba(e);if(es(s.trim()))return{kind:"string",value:s.trim().slice(1,-1)};let o=ha(s,r,n,t,i);if(es(o))return{kind:"string",value:o.slice(1,-1)};if(o==="true"||o==="false")return{kind:"boolean",value:o==="true"};let l=ts(o);return l?{kind:"number",value:l.value,unit:l.unit}:{kind:"string",value:o}}function rs(e,r,n){if(r==="===")return ur(e)===ur(n);if(r==="!==")return ur(e)!==ur(n);let t=La(e,n);return t?r===">"?t.left>t.right:r===">="?t.left>=t.right:r==="<"?t.left<t.right:t.left<=t.right:!1}function ns(e){return e.kind==="boolean"?e.value:e.kind==="number"?e.value!==0:e.value.length>0}function ba(e){let r=e.trim();return r.startsWith("$")?r.slice(1):r}function ha(e,r,n,t,i){if(e in r)return r[e].trim();let s=Z(e.trim(),r,n,t,i);return s?s.trim():e.trim()}function ts(e){var n;let r=e.match(/^(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?$/);return r?{value:Number.parseFloat(r[1]),unit:(n=r[2])!=null?n:""}:null}function ur(e){return e.kind==="number"?`${e.value}${e.unit}`:String(e.value)}function La(e,r){let n=Yi(e),t=Yi(r);return!n||!t||n.unit&&t.unit&&n.unit!==t.unit?null:{left:n.value,right:t.value}}function Yi(e){return e.kind==="number"?{value:e.value,unit:e.unit}:e.kind==="string"?ts(e.value.trim()):null}function es(e){return e.length>=2&&e.startsWith("'")&&e.endsWith("'")||e.length>=2&&e.startsWith('"')&&e.endsWith('"')}function ls(e,r,n,t,i){let s=mn(e,r,n,t,i),o=Qi(s);if(!o)return!1;let l={e:0,t:o,n:r,i:n,o:t,p:i},a=as(l);return a!==null&&l.e===l.t.length?a:!1}function as(e){let r=is(e);if(r===null)return null;for(;us(e,"||");){let n=is(e);if(n===null)return null;r=r||n}return r}function is(e){let r=ss(e);if(r===null)return null;for(;us(e,"&&");){let n=ss(e);if(n===null)return null;r=r&&n}return r}function ss(e){var s;let r=e.t[e.e];if((r==null?void 0:r.type)==="lparen"){e.e+=1;let o=as(e);return o===null||((s=e.t[e.e])==null?void 0:s.type)!=="rparen"?null:(e.e+=1,o)}let n=os(e);if(!n)return null;let t=e.t[e.e];if((t==null?void 0:t.type)==="operator"&&ya(t.value)){e.e+=1;let o=os(e);if(!o)return null;let l=cr(n,e.n,e.i,e.o,e.p),a=cr(o,e.n,e.i,e.o,e.p);return rs(l,t.value,a)}let i=cr(n,e.n,e.i,e.o,e.p);return ns(i)}function os(e){let r=e.t[e.e];return!r||r.type!=="value"?null:(e.e+=1,r.value)}function us(e,r){let n=e.t[e.e];return!n||n.type!=="operator"||n.value!==r?!1:(e.e+=1,!0)}function ya(e){return e==="==="||e==="!=="||e===">="||e==="<="||e===">"||e==="<"}function dn(e,r){return fr(e,r,{},1)}function fr(e,r,n,t){let i=0,s="";for(;i<e.length;){let o=kt(e,i);if(o===-1){s+=ar(e.slice(i),r.variables,r.arrays,r.objectVariables,r.warnings,n);break}s+=ar(e.slice(i,o),r.variables,r.arrays,r.objectVariables,r.warnings,n);let l=Gi(e,o);if(l){s+=xa(l.branches,r,n,t),i=l.endIndex;continue}let a=Te(e,o);if(!a){s+=e[o],i=o+1;continue}let u=K(a.sourceExpression,n,r.arrays,r.variables,r.objectVariables),c=Fe(u,r.arrays,r.objectVariables);if(!c){s+=ar(e.slice(o,a.endIndex),r.variables,r.arrays,r.objectVariables,r.warnings,n),i=a.endIndex;continue}let p=ze(e,o);if(c.length>r.resourceLimits.maxForIterationsPerLoop){me(r,p,`Loop iteration budget exceeded (${c.length}/${r.resourceLimits.maxForIterationsPerLoop}) in ${r.sourceId}.`),i=a.endIndex;continue}let f=t*c.length;if(f>r.resourceLimits.maxNestedLoopProduct){me(r,p,`Nested loop product exceeded (${f}/${r.resourceLimits.maxNestedLoopProduct}) in ${r.sourceId}.`),i=a.endIndex;continue}for(let m=0;m<c.length;m+=1){let g=c[m],d=_e(n,a.variableName,g,m,a.indexVariableName);s+=fr(a.body,r,d,f)}i=a.endIndex}return s}function xa(e,r,n,t){for(let i of e){if(i.type==="else")return fr(i.body,r,n,t);let s=K(i.condition,n,r.arrays,r.variables,r.objectVariables);if(ls(s,n,r.variables,r.objectVariables,r.arrays))return fr(i.body,r,n,t)}return""}function gn(e){var o;let r=0,n=null,t=!1,i=!1,s=1;for(;r<e.length;){let l=e[r],a=(o=e[r+1])!=null?o:"",u=r>0?e[r-1]:"";if(t){l===`
|
|
49
|
+
`&&(t=!1,s+=1),r+=1;continue}else if(i){if(l==="*"&&a==="/"){i=!1,r+=2;continue}else l===`
|
|
50
|
+
`&&(s+=1);r+=1;continue}if(n){l===n&&u!=="\\"?n=null:l===`
|
|
51
|
+
`&&(s+=1),r+=1;continue}if(l==="/"&&a==="*"){i=!0,r+=2;continue}else if(l==="/"&&a==="/"){t=!0,r+=2;continue}if(l==="'"||l==='"'){n=l,r+=1;continue}let c=va(e,r);if(c)throw new Error(`Invalid .luis syntax: legacy control closer "/${c.keyword}}" is not supported at line ${s}. Use "}" instead.`);l===`
|
|
52
|
+
`&&(s+=1),r+=1}}function va(e,r){if(e[r]!=="/")return null;let n=r+1,t=n;for(;n<e.length&&Ca(e[n]);)n+=1;let i=e.slice(t,n).toLowerCase();if(!Ra(i))return null;for(;n<e.length&&Sa(e[n]);)n+=1;return e[n]!=="}"?null:{keyword:i}}function Ra(e){return e==="for"||e==="if"||e==="elseif"||e==="else"}function Ca(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}function Sa(e){return e===" "||e===" "||e===`
|
|
53
|
+
`||e==="\r"||e==="\f"}function X(e){return/^[a-zA-Z_][a-zA-Z0-9_]*(?:-[a-zA-Z0-9_]+)*$/.test(e)}function pr(e,r){return e.slice(0,Math.max(0,r)).split(`
|
|
54
|
+
`).length}function Va(e){let r=0;for(let n=0;n<e.length;n+=1)e[n]===`
|
|
55
|
+
`&&(r+=1);return r}function cs(e){let r=Va(e);return r===0?"":`
|
|
56
|
+
`.repeat(r)}function fs(e,r){let n=r+5;n=v(e,n);let t=n;for(;n<e.length&&/[a-zA-Z0-9_-]/.test(e[n]);)n+=1;if(n<=t)return null;let i=e.slice(t,n);if(n=v(e,n),e[n]!=="(")return null;let s=L(e,n,"(",")");if(s===-1)return null;let o=ka(e.slice(n+1,s));if(n=v(e,s+1),e[n]!=="{")return null;let l=L(e,n,"{","}");return l===-1?null:{definition:{name:i,params:o,body:e.slice(n+1,l),line:pr(e,r)},endIndex:l+1}}function ka(e){let r=_(e).map(t=>t.trim()).filter(Boolean),n=[];for(let t of r){let i=t.startsWith("$")?t.slice(1).trim():t;X(i)&&n.push(i)}return n}function ps(e,r=!0){let n=[],t={},i="",s=0;for(;s<e.length;){let o=e.indexOf("@fun:",s);if(o===-1){i+=e.slice(s);break}let l=pr(e,o),a=fs(e,o);if(!a){r&&n.push(bn("invalid-function-syntax",l,"Invalid function syntax near @fun: declaration.")),i+=e.slice(s,o+5),s=o+5;continue}i+=e.slice(s,o);let u=a.definition;X(u.name)?u.name in t?r&&n.push(bn("duplicate-function",l,`Function "${u.name}" is already defined.`)):t[u.name]=u:r&&n.push(bn("invalid-function-name",l,`Invalid function name "${u.name}".`)),i+=cs(e.slice(o,a.endIndex)),s=a.endIndex}return{source:i,functions:t,warnings:n}}function bn(e,r,n){return{code:e,line:r,message:n}}function ms(e){let r=e;return(r.includes(" + ")||r.includes(" - "))&&(r=lr(r,{})),r.includes("*")&&(r=or(r,{})),r}function mr(e){return/[a-zA-Z_]/.test(e)}function ds(e){return/[a-zA-Z0-9_]/.test(e)}function hn(e,r){var t,i;let n=r;if(!mr((t=e[n])!=null?t:""))return r;for(n+=1;n<e.length;){let s=e[n],o=(i=e[n+1])!=null?i:"";if(ds(s)||s==="-"&&ds(o))n+=1;else break}return n}function gs(e,r){if(e[r]!=="$")return null;if(e[r+1]==="{")return Oa(e,r);let n=Ln(e,r+1);return n?{raw:e.slice(r,n.end),end:n.end,name:n.name,objectKey:n.objectKey,arrayIndex:n.arrayIndex}:null}function Oa(e,r){let n=e.indexOf("}",r+2);if(n===-1)return null;let t=e.slice(r+2,n).trim();if(!t)return null;let i=Ln(t,0);return!i||i.end!==t.length?null:{raw:e.slice(r,n+1),end:n+1,name:i.name,objectKey:i.objectKey,arrayIndex:i.arrayIndex}}function dr(e,r){let n=Ln(e,r);return n?{raw:e.slice(r,n.end),end:n.end,name:n.name,objectKey:n.objectKey,arrayIndex:n.arrayIndex}:null}function Ln(e,r){var l,a;if(!mr((l=e[r])!=null?l:""))return null;let n=hn(e,r),t=e.slice(r,n),i=n,s=null;if(e[i]==="["){let u=e.indexOf("]",i+1);if(u===-1)return null;let c=e.slice(i+1,u).trim();if(!/^\d+$/.test(c))return null;s=Number.parseInt(c,10),i=u+1}let o=null;if(e[i]==="."){let u=i+1;if(!mr((a=e[u])!=null?a:""))return null;i=hn(e,u),o=e.slice(u,i)}return{end:i,name:t,objectKey:o,arrayIndex:s}}function bs(e,r){let n="",t=!1;for(let i=0;i<e.length;){let s=Ia(e,i);if(s){n+=s.value,i=s.end;continue}let o=se(e,i);if(o){n+=o.value,i=o.end;continue}let l=wa(e,i)?dr(e,i):null;if(l){let a=r(l);if(a!==null){n+=a,t=!0,i=l.end;continue}}n+=e[i],i+=1}return{value:n,changed:t}}function Ia(e,r){var t;let n=e[r];if(n!=="'"&&n!=='"')return null;for(let i=r+1;i<e.length;i+=1){let s=e[i],o=(t=e[i-1])!=null?t:"";if(s===n&&o!=="\\")return{value:e.slice(r,i+1),end:i+1}}return null}function wa(e,r){var i;let n=(i=e[r])!=null?i:"",t=r===0?"":e[r-1];return hs(n)&&!Pa(t)}function hs(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"}function Pa(e){return hs(e)||e>="0"&&e<="9"}function $e(e,r){let n="";for(let t=0;t<e.length;t+=1){let i=e[t];if(i!=="$"){n+=i;continue}let s=gs(e,t);if(!s){let l=Aa(e,t,r);if(l){n+=l.value,t=l.end-1;continue}n+=i;continue}let o=xs(r,s.name,s.objectKey,s.arrayIndex);typeof o=="string"?s.raw.startsWith("${")&&ys(o)?n+=`\${${o.slice(1)}}`:n+=o:n+=s.raw,t=s.end-1}return n}function Aa(e,r,n){var c;let t=e.indexOf("}",r+2);if(e[r+1]!=="{"||t===-1)return null;let i=e.slice(r+2,t).trim(),s=bs(i,p=>Ls(n,p.raw,!0)),o=Ie(s.value);if(!o)return null;let l=o.length!==1||((c=o[0])==null?void 0:c.kind)!=="identifier",a=s.changed,u=o.map(p=>{if(p.kind==="string")return`'${p.value.replace(/'/g,"\\'")}'`;if(p.kind!=="identifier")return p.value;let f=Ls(n,p.value,l);return f===null?p.value:(a=!0,f)}).join(" ");return a?{value:`\${${u}}`,end:t+1}:null}function ys(e){return/^\$[a-zA-Z_][\w-]*(?:\.[a-zA-Z_][\w-]*)*$/.test(e.trim())}function Ls(e,r,n){let t=dr(r,0);if(!t||t.end!==r.length)return null;let i=xs(e,t.name,t.objectKey,t.arrayIndex);if(typeof i!="string")return null;let s=Wa(i);if(s)return s;let o=n?Ea(i):null;return o||($a(i)?i:`'${i.replace(/'/g,"\\'")}'`)}function Wa(e){let r=e.trim();if(ys(r))return`(${r.slice(1)})`;if(!r.startsWith("${")||!r.endsWith("}"))return null;let n=r.slice(2,-1).trim(),t=n?Ie(n):null;return!t||t.length===0?null:`(${t.map(i=>i.value).join(" ")})`}function $a(e){return/^-?\d+(?:\.\d+)?(?:[a-zA-Z%]+)?$/.test(e.trim())}function Ea(e){let r=e.trim(),n=se(r,0);return n&&n.end===r.length?n.value:null}function xs(e,r,n,t){var i;if(n){let s=e.objects[r],o=s?oe(s,n):void 0;return typeof o=="string"?o:null}else if(t!==null){let s=(i=e.arrays[r])==null?void 0:i[t];return typeof s=="string"?s:null}else return typeof e.values[r]=="string"?e.values[r]:null}function yn(){return{values:{},objects:{},arrays:{}}}function xn(e,r,n){var t;for(let i=0;i<r.length;i+=1){let s=r[i],o=(t=n[i])!=null?t:"";vs(e,s,o)}}function vn(e,r){let n=Na(r),t=[],i=be(e);for(let s of i){let o=s.text.trim(),l=ja(o);if(s.hasTerminator&&l){let u=$e(l.v,n);vs(n,l.C,u);continue}let a=s.hasTerminator?";":"";t.push(`${s.text}${a}`)}return{r:t.join(""),n}}function ja(e){let r=e.indexOf(":");if(r<=1||e[0]!=="$")return null;let n=e.slice(1,r).trim(),t=e.slice(r+1).trim();return!X(n)||!t?null:{C:n,v:t}}function vs(e,r,n){let t=n.trim();if(V(t)){let i=I(t);e.objects[r]=i,e.values[r]=Ma(i)}else if(W(t)){let i=re(t);e.arrays[r]=i,e.values[r]=jr(i)}else e.values[r]=j(t)}function Ma(e){return`{ ${Object.entries(e).map(([n,t])=>`${n}: ${t};`).join(" ")} }`}function Na(e){return{values:{...e.values},objects:Object.fromEntries(Object.entries(e.objects).map(([r,n])=>[r,{...n}])),arrays:Object.fromEntries(Object.entries(e.arrays).map(([r,n])=>[r,[...n]]))}}function F(e,r,n,t){e.L&&e.s.push({code:r,line:n,message:t})}function Rs(e,r){return`@fun.${e}(${r.join(", ")})`}function gr(e,r,n,t,i,s,o){if(t.includes(e.name))return F(n,"function-recursion",s,`Recursive call detected for function "${e.name}".`),Rs(e.name,r.args);if(r.args.length!==e.params.length){if(n.L)throw new Error(Ta(e.name,e.params.length,r.args.length,s));return F(n,"function-argument-mismatch",s,`Function "${e.name}" expects ${e.params.length} arguments, got ${r.args.length}.`),""}let l=yn();xn(l,e.params,r.args);let a=vn(e.body,l),u=$e(a.r,a.n),c=ms(u);return o(c,n,[...t,e.name],i+1,e.line)}function Ta(e,r,n,t){return`Invalid .luis syntax at line ${t}: function "${e}" expects ${r} arguments, got ${n}.`}var Cs="@fun";function br(e){let r=e.trim();if(!r||Fa(r))return null;if(!r.startsWith(Cs))return null;let n=Ba(r);if(n===-1)return null;let t=n,i=za(r,t),s=r.slice(t,i);if(!X(s))return null;let o=i;for(;o<r.length&&/\s/.test(r[o]);)o+=1;if(r[o]!=="(")return null;let l=L(r,o,"(",")");if(l===-1||l!==r.length-1)return null;let a=r.slice(o+1,l).trim(),u=a?_(a).map(c=>c.trim()):[];return{name:s,args:u}}function Fa(e){var t,i;let r=null,n=0;for(let s=0;s<e.length;s+=1){let o=e[s],l=(t=e[s+1])!=null?t:"",a=(i=e[s-1])!=null?i:"";if(r){o===r&&a!=="\\"&&(r=null);continue}if(o==="'"||o==='"'){r=o;continue}if(o==="$"&&l==="{"){n+=1,s+=1;continue}if(n>0){o==="{"?n+=1:o==="}"&&(n-=1);continue}if(o==="{"||o==="}")return!0}return!1}function za(e,r){let n=r;for(;n<e.length&&/[a-zA-Z0-9_-]/.test(e[n]);)n+=1;return n}function Ba(e){let r=Cs.length;return e[r]?e[r]==="."?r+1:(/\s/.test(e[r]),-1):-1}function Ss(e,r,n,t,i,s){var u;let o="",l=null,a=!1;for(let c=0;c<e.length;c+=1){let p=e[c],f=(u=e[c-1])!=null?u:"";if(l){o+=p,p===l&&f!=="\\"&&(l=null);continue}if(p==="'"||p==='"'){l=p,o+=p;continue}let m=Da(e,c);if(!m){o+=p;continue}let g=n.l[m.call.name];if(!g){F(n,"unknown-function-call",r,`Function "${m.call.name}" is not defined.`),o+=m.raw,c=m.end-1;continue}o=qa(o),o+=_a(gr(g,m.call,n,t,i,r,s)),c=m.end-1,a=!0}return a?o:e}function Da(e,r){if(e.slice(r,r+5)!=="@fun.")return null;let n=e.indexOf("(",r+5);if(n===-1)return null;let t=L(e,n,"(",")");if(t===-1)return null;let i=e.slice(r,t+1),s=br(i);return s?{call:s,raw:i,end:t+1}:null}function _a(e){return e.replace(/;\s*/g,"").replace(/\s+/g," ").trim()}function qa(e){return/:\s+$/.test(e)?e.replace(/\s+$/,""):e}function Vs(e){let r=e.trim();if(!r||r.includes(":")||r.includes("{")||r.includes("}")||r[0]==="@")return null;let n=0;for(;n<r.length&&/[a-zA-Z0-9_-]/.test(r[n]);)n+=1;if(n===0)return null;let t=r.slice(0,n),i=Rn(r,n);return r[i]!=="("?null:L(r,i,"(",")")===r.length-1?t:null}function ks(e){var o;let r=e.trim();if(!r.startsWith("@fun")||r.startsWith("@fun.")||r.includes("{")||r.includes("}"))return null;let n=4;if(!/\s/.test((o=r[n])!=null?o:""))return null;n=Rn(r,n);let t=n;for(;n<r.length&&/[a-zA-Z0-9_-]/.test(r[n]);)n+=1;if(n<=t)return null;let i=r.slice(t,n),s=Rn(r,n);return r[s]!=="("?null:L(r,s,"(",")")===r.length-1?i:null}function Rn(e,r){let n=r;for(;n<e.length&&/\s/.test(e[n]);)n+=1;return n}function Cn(e,r,n=!0){let t={l:r,s:[],L:n};return{source:Sn(e,t,[],0,1),warnings:t.s}}function Sn(e,r,n,t,i){if(t>32)return e;let s=Ge(e),o=[];for(let l=0;l<s.length;l+=1){let a=s[l],u=i+l,c=Za(a,u,r,n,t);o.push(Ss(c,u,r,n,t,Sn))}return o.join(`
|
|
57
|
+
`)}function Za(e,r,n,t,i){let s=be(e),o=[],l=!1;for(let a of s){let u=a.hasTerminator?br(a.text):null;if(!u){let p=a.hasTerminator?Vs(a.text):null,f=a.hasTerminator?ks(a.text):null;p&&p in n.l?F(n,"invalid-function-call",r,`Legacy function call "${p}(...)" is not supported. Use "@fun.${p}(...)".`):f&&f in n.l&&F(n,"invalid-function-call",r,`Legacy function call "@fun ${f}(...)" is not supported. Use "@fun.${f}(...)".`);let m=a.hasTerminator?";":"";o.push(`${a.text}${m}`);continue}let c=n.l[u.name];if(!c){F(n,"unknown-function-call",r,`Function "${u.name}" is not defined.`),o.push(`${a.text};`);continue}o.push(gr(c,u,n,t,i,r,Sn)),l=!0}return l?o.join(`
|
|
58
|
+
`):e}function Os(e,r=!0){let n=ps(e,r),t=Cn(n.source,n.functions,r);return{source:t.source,warnings:[...n.warnings,...t.warnings]}}function Is(e,r){return{variables:{...e.variables,...r.i},classVariables:{...e.classVariables,...r.w},objectVariables:{...e.objectVariables,...r.o},arrayVariables:{...e.arrayVariables,...r.k},warnings:[...e.warnings,...r.s]}}function ws(e,r=!0,n="full",t){var c,p,f;if(n==="vendor-fast"){let m=ue(e,r,t);return gn(m.cleanSource),{source:m.cleanSource,variables:m.variables,classVariables:m.classVariables,objectVariables:m.objectVariables,arrayVariables:m.arrayVariables,warnings:m.warnings}}let i=Ka(e)?Os(e,r):{source:e,warnings:[]},s=ue(i.source,r,t);gn(s.cleanSource);let o=[],l=Ua(s.cleanSource)?dn(s.cleanSource,{arrays:s.arrayVariables,variables:s.variables,objectVariables:s.objectVariables,sourceId:(c=t==null?void 0:t.sourceId)!=null?c:"<inline>",resourcePolicy:(p=t==null?void 0:t.resourcePolicy)!=null?p:"fail-closed",resourceLimits:(f=t==null?void 0:t.resourceLimits)!=null?f:Mr,warnings:o}):s.cleanSource,a=ue(l,r,t),u=Is({variables:s.variables,classVariables:s.classVariables,objectVariables:s.objectVariables,arrayVariables:s.arrayVariables,warnings:[...i.warnings,...s.warnings,...o]},{i:a.variables,w:a.classVariables,o:a.objectVariables,k:a.arrayVariables,s:a.warnings});return{source:a.cleanSource,variables:u.variables,classVariables:u.classVariables,objectVariables:u.objectVariables,arrayVariables:u.arrayVariables,warnings:u.warnings}}function Ka(e){return hr(e,"@fun:")||hr(e,"@fun.")}function Ua(e){return hr(e,"@for")||Vn(e,"for","(")||hr(e,"@if")||Vn(e,"elseif","(")||Vn(e,"else","{")||Ha(e)}function hr(e,r){var s;let n=null,t=!1,i=!1;for(let o=0;o<e.length;o+=1){let l=e[o],a=(s=e[o+1])!=null?s:"",u=o>0?e[o-1]:"";if(t){l===`
|
|
59
|
+
`&&(t=!1);continue}else if(i){l==="*"&&a==="/"&&(i=!1,o+=1);continue}if(n){l===n&&u!=="\\"&&(n=null);continue}if(l==="/"&&a==="/"){t=!0,o+=1;continue}else if(l==="/"&&a==="*"){i=!0,o+=1;continue}else if(l==='"'||l==="'"){n=l;continue}if(e.slice(o,o+r.length)===r)return!0}return!1}function Vn(e,r,n){var o;let t=null,i=!1,s=!1;for(let l=0;l<e.length;l+=1){let a=e[l],u=(o=e[l+1])!=null?o:"",c=l>0?e[l-1]:"";if(i){a===`
|
|
60
|
+
`&&(i=!1);continue}else if(s){a==="*"&&u==="/"&&(s=!1,l+=1);continue}if(t){a===t&&c!=="\\"&&(t=null);continue}if(a==="/"&&u==="/"){i=!0,l+=1;continue}else if(a==="/"&&u==="*"){s=!0,l+=1;continue}else if(a==='"'||a==="'"){t=a;continue}if(e.slice(l,l+r.length)!==r)continue;let p=l>0?e[l-1]:"";if(/[a-zA-Z0-9_]/.test(p))continue;let f=l+r.length;for(;f<e.length&&Ga(e[f]);)f+=1;if(e[f]===n)return!0}return!1}function Ga(e){return e===" "||e===" "||e===`
|
|
61
|
+
`||e==="\r"||e==="\f"}function Ha(e){var i,s;let r=null,n=!1,t=!1;for(let o=0;o<e.length;o+=1){let l=e[o],a=(i=e[o+1])!=null?i:"",u=o>0?e[o-1]:"";if(n){l===`
|
|
62
|
+
`&&(n=!1);continue}else if(t){l==="*"&&a==="/"&&(t=!1,o+=1);continue}if(r){l===r&&u!=="\\"&&(r=null);continue}if(l==="/"&&a==="/"){n=!0,o+=1;continue}else if(l==="/"&&a==="*"){t=!0,o+=1;continue}else if(l==='"'||l==="'"){r=l;continue}if(l!=="$")continue;let c=(s=e[o+1])!=null?s:"";if(c==="{"||/[a-zA-Z_]/.test(c))return!0}return!1}function yr(e){let r=[],n="",t=0,i=0,s=null;for(let o=0;o<e.length;o+=1){let l=e[o],a=o>0?e[o-1]:"";if(s){l===s&&a!=="\\"&&(s=null),n+=l;continue}else l==='"'||l==="'"?s=l:l==="("?t+=1:l===")"&&t>0?t-=1:l==="["?i+=1:l==="]"&&i>0&&(i-=1);if(l===","&&t===0&&i===0){r.push(n),n="";continue}n+=l}return n.length>0&&r.push(n),r}function Ps(e){return e.map(r=>r.trim()).filter(Boolean).join(", ")}function Lr(e){return e.trim().replace(/\s*([>+~])\s*/g,"$1").replace(/\s+/g," ")}function As(e,r){let n=Lr(e),t=Lr(r);if(n===t)return!0;if(!n.startsWith(t))return!1;let i=n[t.length];return Qa(i)}function Qa(e){return e?e===" "||e===">"||e==="+"||e==="~"||e==="."||e==="#"||e===":"||e==="[":!0}function Xa(e){return e.endsWith("?!")?{g:"initial",b:2}:e.endsWith("?")?{g:"dynamic",b:1}:null}function kn(e){let r=e.trim(),n=Xa(r);if(!n)return{selector:r,observedMode:"none",hasMarker:!1,markerValid:!1};let t=r.length-n.b,i=r[t-1];if(!i||/\s/.test(i))return{selector:r,observedMode:"none",hasMarker:!0,markerValid:!1};let s=r.slice(0,t);return Ja(s)?{selector:s,observedMode:n.g,hasMarker:!0,markerValid:!0}:{selector:r,observedMode:"none",hasMarker:!0,markerValid:!1}}function xr(e){return yr(e).map(r=>kn(r))}function On(e){return Ps(xr(e).map(r=>r.selector))}function Ja(e){let r=e.trimEnd();if(!r)return!1;let n=r[r.length-1];return n!==">"&&n!=="+"&&n!=="~"&&n!==","}function Ws(e){let r=Ya(e);return r?`Observed marker "?" or "?!" must be attached to the final selector tail. Descendant chains place the marker on the final target element, for example ".host .child?" not ".host? .child". Selector: "${r}".`:null}function Ya(e){for(let r of yr(e))if(kn(r).observedMode==="none"&&eu(r))return r.trim();return null}function eu(e){let r=null,n=0;for(let t=0;t<e.length;t+=1){let i=e[t],s=t>0?e[t-1]:"";if(r){i===r&&s!=="\\"&&(r=null);continue}if(i==="["){n+=1;continue}else if(i==="]"&&n>0){n-=1;continue}else if(n>0&&(i==='"'||i==="'")){r=i;continue}if(i==="?"&&s!=="\\"&&n===0)return!0}return!1}function $s(e,r,n,t){let i=xr(e);for(let s of i)s.observedMode!=="none"&&ru(s,r,n,t)}function Es(e,r,n){return xr(e).map(i=>n?{selector:i.selector,observedMode:"none"}:i.observedMode!=="none"?{selector:i.selector,observedMode:i.observedMode}:i.hasMarker?{selector:i.selector,observedMode:"none"}:{selector:i.selector,observedMode:nu(i.selector,r)})}function ru(e,r,n,t){let i=Lr(e.selector),s=r.get(i);s&&s!==e.observedMode&&t&&t.push({code:"invalid-observed-syntax",line:n,message:`Observed root "${e.selector}" was declared with both "${s}" and "${e.observedMode}" modes. The latest explicit marker is used for inherited selectors.`}),r.set(i,e.observedMode)}function nu(e,r){let n="none",t=-1;for(let[i,s]of r)s!=="none"&&As(e,i)&&i.length>t&&(n=s,t=i.length);return n}function js(e,r,n,t,i,s){var l;let o=tu(e);for(let a of o){let u=s(a.selector,r,i);t.push({key:u,atRules:[...r],selector:a.selector,observedMode:a.observedMode,sourceLine:(l=n.line)!=null?l:1,declarations:[...n.declarations]})}}function tu(e){let r=[];for(let n of e){let t=r[r.length-1];t&&t.observedMode===n.observedMode?t.selector=`${t.selector}, ${n.selector}`:r.push({selector:n.selector,observedMode:n.observedMode})}return r}function vr(e,r){let n=[],t=new Map,i=iu(e,r);for(let s of e.children)In(s,"",[],n,t,i,r);return n}function In(e,r,n,t,i,s,o){var f;if(e.type==="at-rule"){let m=[...n,e.value];for(let g of e.children)In(g,r,m,t,i,s,o);return}let l=Ms(r,e.value);if(Ts(l))return;let a=Ns(n),u=a?null:Ws(l);o&&u&&o.push({code:"invalid-observed-syntax",line:(f=e.line)!=null?f:1,message:u});let c=Es(l,s,a),p=On(l);e.declarations.length>0&&js(c,n,e,t,i,su);for(let m of e.children)In(m,p,n,t,i,s,o)}function iu(e,r){let n=new Map;for(let t of e.children)wn(t,"",[],n,r);return n}function wn(e,r,n,t,i){var a;if(e.type==="at-rule"){for(let u of e.children)wn(u,r,[...n,e.value],t,i);return}let s=Ms(r,e.value);!Ns(n)&&!Ts(s)&&$s(s,t,(a=e.line)!=null?a:1,i);let l=On(s);for(let u of e.children)wn(u,l,n,t,i)}function Ms(e,r){return e?r.includes("&")?r.split("&").join(e):`${e} ${r}`:r}function su(e,r,n){var o;let i=`${r.join("")}${e}`,s=(o=n.get(i))!=null?o:0;return n.set(i,s+1),`${i}${s}`}function Ns(e){for(let r of e){let n=r.trim().toLowerCase();if(n.startsWith("@keyframes")||n.startsWith("@-webkit-keyframes"))return!0}return!1}function Ts(e){try{return E(e)}catch(r){return O("containsUnsafeSelectorPayload",r)}}function z(e){return[`${e.selector} {`,...e.declarations.map(r=>` ${pt(r)}`),"}"].join(`
|
|
63
|
+
`)}function Rr(e,r,n){let t=[],i=[];for(let s of e)t.push(fe(s));for(let s of r){let o=n==null?void 0:n.get(s.key);i.push({key:s.key,atRules:[...s.atRules],rule:o!=null?o:z(s)})}return[...t,...ou(i)]}function ou(e){let r=[];for(let t of e){let i=t.atRules.join(""),s=r[r.length-1];if(s&&s.R===i){s.f.push(t.rule);continue}r.push({R:i,y:[...t.atRules],f:[t.rule]})}let n=[];for(let t of r){if(t.y.length===0){n.push(...t.f);continue}let i=t.f.join(`
|
|
64
|
+
|
|
65
|
+
`);n.push(lu(i,t.y))}return n}function lu(e,r){return r.reduceRight((n,t)=>`${t} {
|
|
66
|
+
${mt(n)}
|
|
67
|
+
}`,e)}function Fs(e){let r=0;for(let n of e)n.observedMode!=="none"&&(r+=1);return r}function zs(e){let r=[],n=[],t=[],i=[];for(let s of e){let o=z(s),l={key:s.key,selector:s.selector,atRules:[...s.atRules],line:s.sourceLine,rule:o};s.observedMode==="none"?(r.push(s),n.push({...l,observedMode:"none"})):s.observedMode==="dynamic"?t.push(l):s.observedMode==="initial"&&(r.push(s),n.push({...l,observedMode:"initial"}),i.push(l))}return{regularLeaves:r,mainRules:n,observedRules:t,initialObservedRules:i}}function Bs(e,r,n,t,i){let s=e;if(s.length>t.maxExpandedRules){let l=`[${r}] Rule budget exceeded (${s.length}/${t.maxExpandedRules}).`;n==="fail-closed"?te(l):(i.push(ne(1,l)),s=s.slice(0,t.maxExpandedRules))}let o=Fs(s);if(o>t.maxObservedRules){let l=`[${r}] Observed rule budget exceeded (${o}/${t.maxObservedRules}).`;n==="fail-closed"?te(l):(i.push(ne(1,l)),s=au(s,t.maxObservedRules))}return s}function Ds(e){let{regularLeaves:r,mainRules:n}=zs(e),t=e.filter(s=>s.observedMode==="dynamic"),i=e.filter(s=>s.observedMode==="initial");return{allLeaves:e,regularLeaves:r,observedLeaves:t,initialObservedLeaves:i,mainRules:n}}function au(e,r){let n=new Set,t=0;for(let i of e)i.observedMode!=="none"&&(t<r&&n.add(i.key),t+=1);return e.filter(i=>i.observedMode==="none"||n.has(i.key))}function _s(e){let r=Object.entries(e).filter(([,n])=>uu(n));return r.length===0?"":[":root {",...r.map(([n,t])=>` ${n}: ${fe(t)}`),"}"].join(`
|
|
68
|
+
`)}function uu(e){try{return E(e)?!1:!(e.includes("{")||e.includes("}"))}catch(r){return O("isSafeRootVariableValue",r)}}function qs(e){let r=[],n=[],t=!0;for(let i of e)!t||!cu(i)?(t=!1,n.push(i)):r.push(i);return[r,n]}function cu(e){let r=e.trim().toLowerCase();return r.startsWith("@charset ")||r.startsWith("@import ")?!0:!!(r.startsWith("@layer ")&&r.endsWith(";"))}function Zs(e,r,n,t,i){if(!i)return e;let s=Us(n,t);return`/* luis-source: ${r}:${s} */
|
|
69
|
+
${e}`}function Ks(e,r,n,t){if(t)return e.map(i=>({key:i.key,selector:i.selector,atRules:[...i.atRules],line:Us(i.sourceLine,n),sourceId:r}))}function Us(e,r){let n=e-r;return n>0?n:1}function Pn(e){let r=Rr(e.rootDeclarations,e.preparedLeaves.regularLeaves,e.ruleOverridesByKey),n=e.preparedLeaves.observedLeaves.map(u=>Gs(u,e.ruleOverridesByKey)),t=e.preparedLeaves.initialObservedLeaves.map(u=>Gs(u,e.ruleOverridesByKey)),i=_s(e.variables),[s,o]=qs(r),l=Ks(e.preparedLeaves.allLeaves,e.sourceId,e.lineOffset,e.debugEnabled),a={css:[...s,i,...o].filter(Boolean).join(`
|
|
70
|
+
|
|
71
|
+
`),headerRules:s,rootVariableRule:i,mainRules:e.preparedLeaves.mainRules,variables:e.variables,classVariables:e.classVariables,objectVariables:e.objectVariables,arrayVariables:e.arrayVariables,warnings:e.collectWarnings?[...e.importWarnings,...e.normalizeWarnings,...e.preprocessWarnings,...e.renderWarnings,...e.resourceWarnings]:[],debugRules:e.debugEnabled?l:void 0,observedRules:n,initialObservedRules:t};return fu(a,e.sourceId,e.resourcePolicy,e.resourceLimits.maxOutputCssChars),a}function Hs(e,r,n,t,i){return{result:e,cache:{blocks:[],parseCache:t},stats:{mode:r,totalBlocks:n.allLeaves.length,reusedBlocks:0,renderedBlocks:n.allLeaves.length,parser:i}}}function Qs(e,r,n,t,i,s,o){return{result:e,cache:{blocks:t,parseCache:i},stats:{mode:r,totalBlocks:n.allLeaves.length,reusedBlocks:s,renderedBlocks:n.allLeaves.length-s,parser:o}}}function Gs(e,r){var n;return{key:e.key,selector:e.selector,atRules:[...e.atRules],line:e.sourceLine,rule:(n=r==null?void 0:r.get(e.key))!=null?n:z(e)}}function fu(e,r,n,t){if(e.css.length>t){let i=`[${r}] CSS size budget exceeded (${e.css.length}/${t} chars).`;n==="fail-closed"?te(i):e.warnings.push(ne(1,i))}}function Xs(e){let r=new Set;An(e.selector,r);for(let n of e.declarations)An(n,r);for(let n of e.atRules)An(n,r);return Array.from(r).sort()}function Js(e,r,n,t){let i={};for(let[s,o]of Object.entries(e))i[s]=`v:${o.trim()}`;for(let[s,o]of Object.entries(r))i[s]=`c:${o.trim()}`;for(let[s,o]of Object.entries(n))i[s]=`o:${du(o)}`;for(let[s,o]of Object.entries(t))i[s]=`a:${o.join("")}`;return i}function An(e,r){var n;for(let t=0;t<e.length;t+=1){if(!pu(e,t))continue;let i=t+4;if(i=mu(e,i),e[i]!=="-"||e[i+1]!=="-")continue;i+=2;let s=i;if(!Ys((n=e[i])!=null?n:""))continue;for(i+=1;i<e.length&&gu(e[i]);)i+=1;let o=`--${e.slice(s,i)}`;r.add(o)}}function pu(e,r){return e[r]==="v"&&e[r+1]==="a"&&e[r+2]==="r"&&e[r+3]==="("}function mu(e,r){let n=r;for(;n<e.length&&bu(e[n]);)n+=1;return n}function du(e){return Object.keys(e).sort().map(n=>`${n}:${e[n].trim()}`).join(";")}function Ys(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"}function gu(e){return Ys(e)||e>="0"&&e<="9"||e==="-"||e==="_"}function bu(e){return e===" "||e===" "||e===`
|
|
72
|
+
`||e==="\r"}function eo(e,r,n,t,i,s,o,l,a){var g;let u=Js(n,t,i,s),c=new Map((g=r==null?void 0:r.blocks.map(d=>[d.key,d]))!=null?g:[]),p=[],f=new Map,m=0;for(let d of e){let b=Xs(d),h=Pi(b,u),w=wi(d),N=c.get(d.key);if(hu(N,w,h,a)){m+=1,f.set(d.key,N.rule),p.push({...N,dependencies:b,atRules:[...d.atRules]});continue}let P=z(d),y=Zs(P,o,d.sourceLine,l,a);f.set(d.key,y),p.push({key:d.key,fingerprint:w,debug:a,dependencies:b,dependencyHash:h,atRules:[...d.atRules],rule:y})}return{nextBlocks:p,ruleOverridesByKey:f,reusedBlocks:m}}function hu(e,r,n,t){return e?e.fingerprint===r&&e.debug===t&&e.dependencyHash===n:!1}function Wn(e){var c,p;let r=!1,n=!1,t=!1,i=!1,s=null,o=!1,l=!1;for(let f=0;f<e.length;f+=1){let m=e[f],g=(c=e[f+1])!=null?c:"",d=f>0?e[f-1]:"";if(o){m===`
|
|
73
|
+
`&&(o=!1);continue}else if(l){m==="*"&&g==="/"&&(l=!1,f+=1);continue}if(s){m===s&&d!=="\\"&&(s=null);continue}if(m==="/"&&g==="/"){o=!0,f+=1;continue}else if(m==="/"&&g==="*"){l=!0,f+=1;continue}if(m==='"'||m==="'"){s=m;continue}if((m==="@"&&J(e,f,"@fun:")||m==="@"&&J(e,f,"@fun.")||m==="@"&&J(e,f,"@fun "))&&(r=!0),(m==="@"&&J(e,f,"@for")||m==="f"&&Ee(e,f,"for(")||m==="@"&&J(e,f,"@if")||m==="e"&&Ee(e,f,"elseif(")||m==="e"&&Ee(e,f,"elseif (")||m==="e"&&Ee(e,f,"else{")||m==="e"&&Ee(e,f,"else {"))&&(n=!0),m==="$"){let b=(p=e[f+1])!=null?p:"";(b==="{"||yu(b))&&(t=!0)}if(m==="&"&&J(e,f+1,"var("))i=!0;else if(m==="v"&&J(e,f,"var(--")){let b=Lu(e,f+5);if(b!==-1){let h=e.slice(f+5,b).trim();(h.includes(".")||h.includes("["))&&(i=!0)}}if(r&&n&&t&&i)break}let a=r||n||t||i;return{hasFunctionSyntax:r,hasControlFlowSyntax:n,hasLoopPlaceholderSyntax:t,hasClassVarUsage:i,hasTopLevelLuisOnlyPatterns:a,recommendedMode:a?"full":"vendor-fast"}}function $n(e,r){return r?r==="full"?{mode:"full",downgradedFromOverride:!1}:e.hasTopLevelLuisOnlyPatterns?{mode:"full",downgradedFromOverride:!0}:{mode:"vendor-fast",downgradedFromOverride:!1}:{mode:e.recommendedMode,downgradedFromOverride:!1}}function J(e,r,n){return e.slice(r,r+n.length)===n}function Ee(e,r,n){let t=r>0?e[r-1]:"";return xu(t)?!1:J(e,r,n)}function Lu(e,r){let n=1;for(let t=r;t<e.length;t+=1){let i=e[t];if(i==="(")n+=1;else if(i===")"&&(n-=1,n===0))return t}return-1}function yu(e){return/[a-zA-Z_]/.test(e)}function xu(e){return/[a-zA-Z0-9_]/.test(e)}var ro=/\bline\s+(\d+)\b/i;function no(e,r,n){let t=e instanceof Error?e:new Error(String(e)),i=t.message.match(ro);if(!i)throw t;let s=Number.parseInt(i[1],10),o=r[s-1];if(!o)throw t;let l=vu(t.message,o,n),a=new Error(l);throw a.name=t.name,a}function vu(e,r,n){let t=e.replace(ro,`line ${r.line}`);return r.sourceId===n?t:t.startsWith("Invalid .luis syntax")?t.replace("Invalid .luis syntax",`Invalid .luis syntax in "${r.sourceId}"`):`${t} [source: ${r.sourceId}]`}function je(e,r={},n){var a,u;let t=r.collectWarnings!==!1,i=xt(r),s=Ne(r),o=(a=r.sourceId)!=null?a:"<inline>",l=bi(e,r);try{let{source:c,warnings:p}=Ii(l.source,t),f=Wn(c),m=$n(f,r.compileMode),{source:g,variables:d,classVariables:b,objectVariables:h,arrayVariables:w,warnings:N}=ws(c,t,m.mode,{sourceId:o,resourcePolicy:i,resourceLimits:s}),P=Bn(m.mode,b,h,w)?Qe(g,{classVariables:b,variables:d,objectVariables:h,arrayVariables:w}):g,y=Bi(P,h,w,n==null?void 0:n.parseCache),A=[],B=vr(y.root,A),ve=[],zn=Bs(B,o,i,s,ve),R=Ds(zn),C=r.debug===!0,Y=(u=r.lineOffset)!=null?u:0;if(!n&&!C){let vo=Pn({sourceId:o,resourcePolicy:i,resourceLimits:s,rootDeclarations:y.root.declarations,collectWarnings:t,importWarnings:l.warnings,normalizeWarnings:p,preprocessWarnings:N,renderWarnings:A,resourceWarnings:ve,variables:d,classVariables:b,objectVariables:h,arrayVariables:w,lineOffset:Y,debugEnabled:C,preparedLeaves:R});return Hs(vo,m.mode,R,y.cache,y.stats)}let T=eo(R.allLeaves,n,d,b,h,w,o,Y,C),xo=Pn({sourceId:o,resourcePolicy:i,resourceLimits:s,rootDeclarations:y.root.declarations,collectWarnings:t,importWarnings:l.warnings,normalizeWarnings:p,preprocessWarnings:N,renderWarnings:A,resourceWarnings:ve,variables:d,classVariables:b,objectVariables:h,arrayVariables:w,lineOffset:Y,debugEnabled:C,ruleOverridesByKey:T.ruleOverridesByKey,preparedLeaves:R});return Qs(xo,m.mode,R,T.nextBlocks,y.cache,T.reusedBlocks,y.stats)}catch(c){no(c,l.lineMap,o)}}function to(e){var s;let r=0,n=null,t=!1,i=!1;for(let o=0;o<e.length;o+=1){let l=e[o],a=(s=e[o+1])!=null?s:"",u=o>0?e[o-1]:"";if(t){l===`
|
|
74
|
+
`&&(t=!1);continue}else if(i){l==="*"&&a==="/"&&(i=!1,o+=1);continue}if(n){l===n&&u!=="\\"&&(n=null);continue}if(l==="/"&&a==="*"){i=!0,o+=1;continue}else if(l==="/"&&a==="/"){t=!0,o+=1;continue}if(l==="'"||l==='"'){n=l;continue}l==="{"?r+=1:l==="}"&&(r=Math.max(0,r-1))}return r}function io(e){return e instanceof Error?e.message:typeof e=="string"?e:""}function En(e){let r=Number.parseInt(e!=null?e:"",10);return Number.isFinite(r)&&r>0?r:1}function so(e,r){let n=e.split(`
|
|
75
|
+
`),t=r-1;return t<0||t>=n.length?e:(n.splice(t,1),n.join(`
|
|
76
|
+
`))}function oo(e,r){let n=io(r);if(!n)return null;let t=n.match(/unmatched closing brace at line (\d+)/i);if(t){let s=En(t[1]);return{r:so(e,s),u:s,a:`Fail-soft recovery removed unmatched closing brace line ${s}.`}}let i=n.match(/missing closing brace for block opened near line (\d+)/i);if(i){let s=En(i[1]),o=Math.max(1,to(e)),l=`
|
|
77
|
+
${Array.from({length:o},()=>"}").join(`
|
|
78
|
+
`)}
|
|
79
|
+
`;return{r:`${e}${l}`,u:s,a:`Fail-soft recovery appended ${o} closing brace(s) near line ${s}.`}}else return null}function ao(e,r){if(!(r instanceof Error?r.message:typeof r=="string"?r:"").includes("plain loop placeholder"))return null;let t=Cr(e);return t===e?null:{r:t,u:1,a:"Fail-soft recovery rewrote legacy plain `$...` placeholders to `${...}`."}}function Cr(e){var s;let r="",n=null,t=!1,i=!1;for(let o=0;o<e.length;o+=1){let l=e[o],a=(s=e[o+1])!=null?s:"",u=o>0?e[o-1]:"";if(t){r+=l,l===`
|
|
80
|
+
`&&(t=!1);continue}if(i){r+=l,l==="*"&&a==="/"&&(r+=a,i=!1,o+=1);continue}if(n){r+=l,l===n&&u!=="\\"&&(n=null);continue}if(l==="/"&&a==="*"){r+="/*",i=!0,o+=1;continue}if(l==="/"&&a==="/"){r+="//",t=!0,o+=1;continue}if(l==="'"||l==='"'){n=l,r+=l;continue}if(l==="$"&&a!=="{"&&uo(a)){let c=Ru(e,o+1,u==="."||u==="-"||u==="_"||u===":"),p=e.slice(o+1,c);Cu(e,c)?r+=`$${p}`:r+=`\${${p}}`,o=c-1;continue}r+=l}return r}function Ru(e,r,n=!1){var s;let t=r+1,i=!1;for(;t<e.length;){let o=e[t];if(lo(o)||o==="."){o==="."&&(i=!0),t+=1;continue}else if(o==="-"){if(n&&i)break;let l=(s=e[t+1])!=null?s:"";if(lo(l)){t+=1;continue}else break}break}return t}function Cu(e,r){let n=r;for(;n<e.length&&(e[n]===" "||e[n]===" ");)n+=1;return e[n]===":"}function uo(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"}function lo(e){return uo(e)||e>="0"&&e<="9"}function co(e,r){let n=oo(e,r);return n||ao(e,r)}function jn(e,r,n){e.push({code:"invalid-syntax",line:n.u,message:`[${r}] ${n.a}`})}function fo(e,r,n){if(!(n instanceof Error?n.message:typeof n=="string"?n:"").includes("plain loop placeholder"))return null;let i=Cr(e),s=Su(r),o=JSON.stringify(s)!==JSON.stringify(r);return i===e&&!o?null:{r:i,u:1,a:"Fail-soft recovery rewrote legacy plain `$...` placeholders to `${...}`.",I:s}}function Su(e){let r={};for(let n of Object.keys(e)){r[n]={};let t=e[n];for(let i of Object.keys(t)){let s=t[i];r[n][i]={...s,source:Cr(s.source)}}}return r}function Mn(e){let r=Object.keys(e);if(r.length!==0)return(n,t)=>{var a;let i=t!=null?t:r[0],s=(a=e[i])!=null?a:e[r[0]];if(!s)return null;let o=s[n];if(o)return po(o);let l=s[n.trim()];return l?po(l):null}}function Nn(e){if(Object.keys(e).length!==0)return n=>e[n]}function po(e){return{...e}}function Tn(){return typeof performance!="undefined"&&typeof performance.now=="function"?performance.now():Date.now()}function Fn(e,r){return{kind:"error",requestId:e,payload:{message:r}}}function mo(e){return{mode:e.mode,totalBlocks:e.totalBlocks,reusedBlocks:e.reusedBlocks,renderedBlocks:e.renderedBlocks,parser:{totalSegments:e.parser.totalSegments,reusedSegments:e.parser.reusedSegments,parsedSegments:e.parser.parsedSegments}}}function bo(e){if(!e||typeof e!="object")return null;let r=e;return typeof r.kind!="string"||!Number.isInteger(r.requestId)?null:r.kind==="compile"?Vu(r)?r:null:r.kind==="prune-cache"&&ku(r)?r:null}function Vu(e){let r=e.payload;return Me(e,["kind","requestId","payload"])&&!!r&&typeof r=="object"&&Me(r,["source","sourceId","contextPrelude","lineOffset","compileMode","debugEnabled","serializedImportGraph","serializedImportModes","limits"])&&typeof r.source=="string"&&typeof r.sourceId=="string"&&typeof r.contextPrelude=="string"&&typeof r.lineOffset=="number"&&Ou(r.compileMode)&&typeof r.debugEnabled=="boolean"&&go(r.serializedImportGraph)&&go(r.serializedImportModes)&&Iu(r.limits)}function ku(e){let r=e.payload,n=r;return Me(e,["kind","requestId","payload"])&&!!r&&typeof r=="object"&&Me(r,["activeSourceIds"])&&Array.isArray(n.activeSourceIds)&&n.activeSourceIds.every(t=>typeof t=="string")}function Ou(e){return e===void 0||e==="full"||e==="vendor-fast"}function Iu(e){return e===void 0||!!e&&typeof e=="object"&&Me(e,["maxCompileTimeMs"])&&typeof e.maxCompileTimeMs=="number"&&Number.isFinite(e.maxCompileTimeMs)&&e.maxCompileTimeMs>0}function go(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Me(e,r){let n=new Set(r);for(let t of Object.keys(e))if(!n.has(t))return!1;return!0}var Sr=new Map,ho=!1;function Lo(e){let r=bo(e);if(!r)return Fn(0,"Invalid worker request payload.");if(r.kind==="prune-cache")return Au(r);try{return wu(r)}catch(n){let t=n instanceof Error?n.message:"Unknown worker compile error.";return Fn(r.requestId,t)}}function wu(e){let r=ho?"warm":"cold",{payload:n}=e,t=n.contextPrelude?`${n.contextPrelude}
|
|
81
|
+
${n.source}`:n.source,i=Tn(),s=Sr.get(n.sourceId),o=Pu(n,t,s),l=Tn()-i;if(n.limits&&l>n.limits.maxCompileTimeMs)throw new Error("Worker compile exceeded security policy time limit.");return Sr.set(n.sourceId,o.cache),ho=!0,{kind:"compile-result",requestId:e.requestId,payload:{result:o.result,compileDurationMs:l,incremental:mo(o.stats),workerState:r}}}function Pu(e,r,n){let t=Mn(e.serializedImportGraph),i=Nn(e.serializedImportModes);try{return je(r,{sourceId:e.sourceId,importResolver:t,importModeResolver:i,compileMode:e.compileMode,debug:e.debugEnabled,collectWarnings:e.debugEnabled,lineOffset:e.lineOffset},n)}catch(s){if(e.debugEnabled)throw s;let o=fo(e.source,e.serializedImportGraph,s);if(o){let c=e.contextPrelude?`${e.contextPrelude}
|
|
82
|
+
${o.r}`:o.r,p=je(c,{sourceId:e.sourceId,importResolver:Mn(o.I),importModeResolver:Nn(e.serializedImportModes),compileMode:e.compileMode,debug:e.debugEnabled,collectWarnings:e.debugEnabled,lineOffset:e.lineOffset},n);return jn(p.result.warnings,e.sourceId,o),p}let l=co(e.source,s);if(!l)throw s;let a=e.contextPrelude?`${e.contextPrelude}
|
|
83
|
+
${l.r}`:l.r,u=je(a,{sourceId:e.sourceId,importResolver:t,importModeResolver:i,compileMode:e.compileMode,debug:e.debugEnabled,collectWarnings:e.debugEnabled,lineOffset:e.lineOffset},n);return jn(u.result.warnings,e.sourceId,l),u}}function Au(e){let r=new Set(e.payload.activeSourceIds);for(let n of Array.from(Sr.keys()))r.has(n)||Sr.delete(n);return{kind:"prune-cache-result",requestId:e.requestId}}var yo=globalThis;yo.onmessage=e=>{let r=Lo(e.data);yo.postMessage(r)};})();
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";(()=>{var _=/^\s*\/\*\s*luis-origin:\s*(.+):(\d+)\s*\*\/\s*$/;function R(e,r,t){let n=e.match(_);n&&t.push({c:A(n[1].trim()),U:Number.parseInt(n[2],10)||1,N:r+e.length+1})}function S(e,r){let t=null;for(let o of e.$){if(o.N>r)break;t=o}if(!t)return null;let n=O(e.F,t.N,r);return{sourceId:t.c,line:Math.max(1,t.U+n)}}function g(e,r){return!Number.isFinite(e)||e<1?1:e>r?r:e}function O(e,r,t){let n=0;for(let o=r;o<t;o+=1)e.charCodeAt(o)===10&&(n+=1);return n}function A(e){try{return decodeURIComponent(e)}catch{return e}}var P=/(\$\{[^}]+\}|\$[A-Za-z_][\w.-]*)/g;function y(e){return e.replace(/\?!/g,"").replace(/\?/g,"").trim()}function C(e,r,t,n,o){let i=$(e);if(i.length!==0)for(let s of i)v(t,s,r),v(n,s.replace(/\\/g,""),r),F(s,r,o)}function f(e,r,t){let n=e.get(r);if(!n)return-1;for(let o of n)if(o>=t)return o;return-1}function E(e,r,t){for(let n of e)if(!(n._<t)){if(n.H.test(r))return n._;continue}return-1}function $(e){let r=e.trim();if(!r||r.startsWith("@")||r.startsWith("/*")||r.startsWith("--"))return[];let t=r.indexOf("{"),n=t===-1?r:r.slice(0,t).trimEnd();return!n||n.includes(": ")||n.includes(": ")?[]:n.split(",").map(o=>y(o)).filter(Boolean)}function v(e,r,t){var o;let n=(o=e.get(r))!=null?o:[];n.push(t),e.set(r,n)}function F(e,r,t){if(!e.includes("$"))return;let n=W(e);n&&t.push({H:n,_:r})}function W(e){let r="LENTY_PLACEHOLDER",t="[A-Za-z0-9_-]+",n=e.replace(P,r);if(!n.includes(r))return null;let i=x(n).replace(new RegExp(x(r),"g"),t);try{return new RegExp(`^${i}$`)}catch{return null}}function x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function D(e){let r=[0],t=[],n=new Map,o=new Map,i=[],s=e.split(`
|
|
2
|
+
`),l=0;for(let u of s)R(u,l,t),C(u,l,n,o,i),l+=u.length+1,r.push(l);return{F:e,T:s.length,D:r,$:t,B:n,W:o,G:i}}function M(e,r,t){let n=y(r),o=f(e.B,n,t);if(o!==-1)return o;let i=f(e.W,r.replace(/\\/g,""),t);return i!==-1?i:E(e.G,n,t)}function w(e,r){var o;let t=0,n=e.D.length-1;for(;t<=n;){let i=Math.floor((t+n)/2),s=e.D[i],l=(o=e.D[i+1])!=null?o:Number.POSITIVE_INFINITY;if(r<s)n=i-1;else if(r>=l)t=i+1;else return i+1}return 1}var H=/^\s*\/\*\s*luis-source:\s*(.+):(\d+)\s*\*\/\s*$/;function d(e,r){if(!e)return;let t=D(r),n=new Map;return e.map(o=>{var a;let i=o.selector,s=(a=n.get(i))!=null?a:0,l=M(t,o.selector,s);if(l===-1)return{...o,line:g(o.line,t.T)};let u=S(t,l);return n.set(i,l+Math.max(1,o.selector.length)),u?{...o,sourceId:u.sourceId,line:u.line}:{...o,line:g(w(t,l),t.T)}})}function L(e,r){if(!r||r.length===0)return e;let t=e.split(`
|
|
3
|
+
`),n=0;for(let o=0;o<t.length;o+=1){if(!H.test(t[o]))continue;let i=r[n];if(!i)break;t[o]=`/* luis-source: ${i.sourceId}:${i.line} */`,n+=1}return t.join(`
|
|
4
|
+
`)}var B={RUN0001:{scope:"runtime",channel:"debug",severity:"error",layer:"emergency",template:"Debug feature requires core script before plugin script."},RUN0002:{scope:"runtime",channel:"performance",severity:"error",layer:"emergency",template:"Performance feature requires core script before plugin script."},RUN0003:{scope:"runtime",channel:"runtime",severity:"error",layer:"emergency",template:"Observed feature requires core script before plugin script."},RUN0004:{scope:"runtime",channel:"debug",severity:"error",layer:"emergency",template:"Map feature requires core script before plugin script."},RUN0005:{scope:"runtime",channel:"runtime",severity:"error",layer:"emergency",template:"Worker feature requires core script before plugin script."},RUN0006:{scope:"runtime",channel:"runtime",severity:"error",layer:"emergency",template:"Lazy feature requires core script before plugin script."},RUN0007:{scope:"runtime",channel:"compile",severity:"error",layer:"critical",template:"Initial runtime compile failed."},RUN0008:{scope:"runtime",channel:"runtime",severity:"error",layer:"emergency",template:"Runtime {layer} logger bundle could not load. Falling back to emergency console output."},RUN0009:{scope:"runtime",channel:"runtime",severity:"error",layer:"critical",template:'Runtime feature "{feature}" could not resolve script URL.'},RUN0010:{scope:"runtime",channel:"security",severity:"error",layer:"critical",template:'Runtime feature "{feature}" blocked: missing SRI hash for cross-origin URL {scriptUrl}.'},RUN0011:{scope:"runtime",channel:"runtime",severity:"error",layer:"critical",template:'Runtime feature "{feature}" loaded but did not register.'},RUN0012:{scope:"runtime",channel:"runtime",severity:"error",layer:"critical",template:'Runtime feature "{feature}" failed to load: {scriptUrl}'},RUN0013:{scope:"runtime",channel:"debug",severity:"warn",layer:"optional",template:"{sourceLabel}: {warningMessage} (line {line}, code: {warningCode})."},RUN0014:{scope:"runtime",channel:"debug",severity:"info",layer:"optional",template:"Loaded imported .luis: {importedHref} (from {sourceLabel})"},RUN0015:{scope:"runtime",channel:"debug",severity:"info",layer:"optional",template:"Import diagnostics: {href} (from {importerSourceId}; {sourceLength} chars; {fetchDurationMs} ms; {cacheStatus}; parent: {sourceLabel})"},RUN0016:{scope:"runtime",channel:"performance",severity:"info",layer:"optional",template:"Compiled {sourceLabel} in {headlineDuration} (css: {cssLength} chars){modeSuffix}{executionSuffix}{timingSuffix}{incrementalSuffix}"},RUN0017:{scope:"runtime",channel:"performance",severity:"info",layer:"optional",template:"Compiled {importHref} in {compileDuration} (css: {cssLength} chars) (imported by: {importerSourceId}; {cacheStatus}; parent: {sourceLabel})"},RUN0018:{scope:"runtime",channel:"performance",severity:"info",layer:"optional",template:"Compiled {sourceLabel} [observed:{event}] in {compileDuration} (css: {cssLength} chars) (observed: {activeRules}/{totalRules} active, changed: {changedRules})"},RUN0019:{scope:"runtime",channel:"debug",severity:"warn",layer:"optional",template:"{message} (code: resource-limit)."},RUN0020:{scope:"runtime",channel:"debug",severity:"warn",layer:"optional",template:'{sourceLabel}{sourceSuffix}: Invalid observed selector "{selector}"{lineSuffix}. ({reason}, code: invalid-observed-selector).'},RUN0021:{scope:"runtime",channel:"debug",severity:"info",layer:"optional",template:"Observed {event}: {sourceLabel} (tokens: {tokenCount}, affected: {changedRules}, active: {activeRules})"},RUN0022:{scope:"runtime",channel:"debug",severity:"info",layer:"optional",template:'Debug rule map ready: window.__LentyStyleRuleMap["{styleId}"]'},RUN0023:{scope:"runtime",channel:"debug",severity:"warn",layer:"optional",template:"{sourceLabel}{lineLabel} {detailMessage}"},RUN0024:{scope:"runtime",channel:"compile",severity:"error",layer:"critical",template:".luis stylesheet failed: {href}{lineSuffix}"},RUN0025:{scope:"runtime",channel:"compile",severity:"error",layer:"critical",template:"<style data-luis> failed{lineSuffix}."},GRD0001:{scope:"guard",channel:"security",severity:"error",layer:null,template:"blocked candidate changes: {changedPaths} | targets={targetCount}, blocked={blockedCount}, warning={warningCount}"},GRD0002:{scope:"guard",channel:"security",severity:"info",layer:null,template:"validated candidate changes: {changedPaths} | targets={targetCount}, blocked={blockedCount}, warning={warningCount}"},HYB0001:{scope:"hybrid",channel:"hybrid",severity:"info",layer:null,template:"Compiled {routeId} in {duration} (sources: {sourceCount}; compile {compileDuration}; evaluate {evaluateDuration}; cache: {cacheState}; runtime-features: {runtimeFeatures})"},HYB0002:{scope:"hybrid",channel:"debug",severity:"warn",layer:null,template:"{routeId}: {warningMessage} (line {line}, code: {warningCode})."},HYB0003:{scope:"hybrid",channel:"debug",severity:"info",layer:null,template:"{routeId}: {rewriteState}."}};function h(e,r={},t={}){var o;let n=(o=B[e])!=null?o:G(e);return{id:e,...n,message:z(n.template,r),error:t.error}}function G(e){let r=Y(e);return{scope:r,channel:{guard:"security",runtime:"runtime",compiler:"compile",hybrid:"hybrid",ssr:"ssr"}[r],severity:"error",layer:r==="runtime"?"emergency":null,template:`Unregistered log id "${e}".`}}function Y(e){return e.startsWith("RUN")?"runtime":e.startsWith("GRD")?"guard":e.startsWith("HYB")?"hybrid":e.startsWith("SSR")?"ssr":"compiler"}function z(e,r){return e.replace(/\{([a-zA-Z0-9_]+)\}/g,(t,n)=>{let o=r[n];return o===void 0?t:String(o)})}var q="__LentyStyleDispatchLogEvent__";function I(e){let r=e.channel===e.scope?"":`[${e.channel}] `;return`[LentyStyle][${e.scope}][${e.severity}][${e.id}] ${r}${e.message}`}function c(e,r={},t={}){var o;let n=h(e,r,{error:t.error});Z(n)||N(n,(o=t.sink)!=null?o:console)}function N(e,r=console){let t=I(e),n=K(e.severity,r);if(e.error===void 0){n(t);return}n(t,e.error)}function K(e,r){var t,n,o,i,s,l,u,a,b;return e==="error"?(n=(t=r.error)!=null?t:r.warn)!=null?n:r.info:e==="warn"?(i=(o=r.warn)!=null?o:r.info)!=null?i:r.error:e==="debug"?(u=(l=(s=r.debug)!=null?s:r.info)!=null?l:r.warn)!=null?u:r.error:(b=(a=r.info)!=null?a:r.warn)!=null?b:r.error}function Z(e){let t=globalThis[q];return t?t(e)===!0:!1}function T(e,r,t,n,o,i){var l;if(!o){p(e);return}if(!n||n.length===0){p(e);return}let s=k();s&&(s.__LentyStyleRuleMap=(l=s.__LentyStyleRuleMap)!=null?l:{},s.__LentyStyleRuleMap[e]={sourceLabel:r,sourceId:t,updatedAt:Date.now(),rules:n.map(u=>({...u,atRules:[...u.atRules]}))},i&&c("RUN0022",{styleId:e}))}function p(e){let r=k();r!=null&&r.__LentyStyleRuleMap&&delete r.__LentyStyleRuleMap[e]}function k(){return typeof window=="undefined"?null:window}function U(){return{remapDebugRulesToSource:d,applyDebugRulesToCssMarkers:L,logCompileWarnings:j,logLoadedLuisImports:V,logImportedLuisDiagnostics:J,publishDebugRuleMap:Q,clearDebugRuleMap:p}}function j(e,r){if(e.length!==0)for(let t of e)c("RUN0013",{sourceLabel:r,warningMessage:t.message,line:t.line,warningCode:t.code})}function V(e,r){if(e.importedLuisHrefs.length!==0)for(let t of e.importedLuisHrefs)c("RUN0014",{importedHref:t,sourceLabel:r})}function J(e,r){if(r.length!==0)for(let t of r){let n=t.fromCache?"cache hit":"cache miss";c("RUN0015",{href:t.href,importerSourceId:t.importerSourceId,sourceLength:t.sourceLength,fetchDurationMs:t.fetchDurationMs.toFixed(2),cacheStatus:n,sourceLabel:e})}}function Q(e,r,t,n,o){let i=e.kind==="link"?e.href:e.sourceId;T(e.styleTag.id,r,i,t,n,o)}var m=globalThis.LentyStyle;m!=null&&m.registerRuntimeFeature?m.registerRuntimeFeature("debug",U()):c("RUN0001");})();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lentystyle.min.js": "sha384-pN7Ft+2bku1sQoPJihiiGgj5tcAAUUi2WpeQgZLkFpzIUhCWue26ODyuslZDRcLo",
|
|
3
|
+
"lentystyle.debug.min.js": "sha384-bG2iLG/PJvjq2AKIY/XOiopuaE1Gc7243A71vgkkaCIUYOU7481yjgydFdosLEUn",
|
|
4
|
+
"lentystyle.performance.min.js": "sha384-kFt1e1r2DzmUNfvYK/yxURnVfVj7P4SjAEezP1bGsdBvBu+9xlQ2X9SzGKVjUvHL",
|
|
5
|
+
"lentystyle.map.min.js": "sha384-YTIDeE4UBmeG+9rxDkSD1cARaQ1o1KzWLzXdbk6yjPDN8z8JtDxGWZHrtpy5hvAM",
|
|
6
|
+
"lentystyle.lazy.min.js": "sha384-UDObiqkGp9ZfdqYgB3jTB0677ado1fsEkleU4Y+QDSg9Edn8OBga0bMtcTEmzm92",
|
|
7
|
+
"lentystyle.observed.min.js": "sha384-N6hEWgMMvNqJcXJev9/VfOIirvSHtltpZd287f/LRUYUK+fU9A4l/IGPBFzwzcxB",
|
|
8
|
+
"lentystyle.worker.min.js": "sha384-o4UAVd+I9Upr44IvM2nc/G41YQqHOI7qQkIa7Hgnqdyvek0CWQM+MbF3/hcL3Opn",
|
|
9
|
+
"lentystyle.compile.worker.min.js": "sha384-rf1rc9deay7TydWMr9K+Tk7kCTSvhO+8FD6fT2fThe/kfaxgCwqdHBdF6R78R95O",
|
|
10
|
+
"lentystyle.log-critical.min.js": "sha384-ukhICTb3BTGMgavEKM2kcjYdSpngQd6d4QjrXxLy5Js187mT78kL6kJytF6/IvbZ",
|
|
11
|
+
"lentystyle.log-optional.min.js": "sha384-dzZXwnxdvcG6IcjqDaxyUtHPYAEwnZgovnCXM/XgoEFMF0zwaW1DxcvCh+bXGdsM"
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(()=>{var p=new Map,c=new Map,a=new Map,l=null;function m(e,t){return`${e}::${t}`}function R(){return l||(l=new IntersectionObserver(e=>{for(let t of e)if(t.isIntersecting)x(t.target);else continue}),l)}function x(e){let t=a.get(e);if(!(!t||t.size===0))for(let r of[...t]){let n=p.get(r);if(n)n.onEnter(),L(n.hostStyleTagId,n.ruleKey,r);else continue}}function L(e,t,r){let n=p.get(r);if(!n)return;for(let i of n.elements){let s=a.get(i);if(s)s.delete(r);else continue;s.size===0?(l==null||l.unobserve(i),a.delete(i)):a.set(i,s)}let o=c.get(e);o&&(o.delete(r),o.size===0?c.delete(e):c.set(e,o)),p.delete(r)}function S(){return{isElementInViewport:E,watchRuleElements:U,clearRuleWatch:f,clearSourceWatches:N}}function E(e){let t=e.getBoundingClientRect(),r=window.innerWidth||document.documentElement.clientWidth||0,n=window.innerHeight||document.documentElement.clientHeight||0;return t.width>0&&t.height>0&&t.bottom>0&&t.right>0&&t.top<n&&t.left<r}function U(e){var i,s;if(f(e.hostStyleTagId,e.ruleKey),typeof IntersectionObserver!="function")return;if(e.elements.length===0)return;let t=m(e.hostStyleTagId,e.ruleKey),r={hostStyleTagId:e.hostStyleTagId,ruleKey:e.ruleKey,onEnter:e.onEnter,elements:new Set(e.elements)};p.set(t,r);let n=(i=c.get(e.hostStyleTagId))!=null?i:new Set;n.add(t),c.set(e.hostStyleTagId,n);let o=R();for(let u of r.elements){let y=(s=a.get(u))!=null?s:new Set;y.add(t),a.set(u,y),o.observe(u)}}function f(e,t){let r=m(e,t);L(e,t,r)}function N(e){let t=c.get(e);if(t)for(let r of[...t]){let n=r.slice(e.length+2);f(e,n)}}var k={RUN0001:{scope:"runtime",channel:"debug",severity:"error",layer:"emergency",template:"Debug feature requires core script before plugin script."},RUN0002:{scope:"runtime",channel:"performance",severity:"error",layer:"emergency",template:"Performance feature requires core script before plugin script."},RUN0003:{scope:"runtime",channel:"runtime",severity:"error",layer:"emergency",template:"Observed feature requires core script before plugin script."},RUN0004:{scope:"runtime",channel:"debug",severity:"error",layer:"emergency",template:"Map feature requires core script before plugin script."},RUN0005:{scope:"runtime",channel:"runtime",severity:"error",layer:"emergency",template:"Worker feature requires core script before plugin script."},RUN0006:{scope:"runtime",channel:"runtime",severity:"error",layer:"emergency",template:"Lazy feature requires core script before plugin script."},RUN0007:{scope:"runtime",channel:"compile",severity:"error",layer:"critical",template:"Initial runtime compile failed."},RUN0008:{scope:"runtime",channel:"runtime",severity:"error",layer:"emergency",template:"Runtime {layer} logger bundle could not load. Falling back to emergency console output."},RUN0009:{scope:"runtime",channel:"runtime",severity:"error",layer:"critical",template:'Runtime feature "{feature}" could not resolve script URL.'},RUN0010:{scope:"runtime",channel:"security",severity:"error",layer:"critical",template:'Runtime feature "{feature}" blocked: missing SRI hash for cross-origin URL {scriptUrl}.'},RUN0011:{scope:"runtime",channel:"runtime",severity:"error",layer:"critical",template:'Runtime feature "{feature}" loaded but did not register.'},RUN0012:{scope:"runtime",channel:"runtime",severity:"error",layer:"critical",template:'Runtime feature "{feature}" failed to load: {scriptUrl}'},RUN0013:{scope:"runtime",channel:"debug",severity:"warn",layer:"optional",template:"{sourceLabel}: {warningMessage} (line {line}, code: {warningCode})."},RUN0014:{scope:"runtime",channel:"debug",severity:"info",layer:"optional",template:"Loaded imported .luis: {importedHref} (from {sourceLabel})"},RUN0015:{scope:"runtime",channel:"debug",severity:"info",layer:"optional",template:"Import diagnostics: {href} (from {importerSourceId}; {sourceLength} chars; {fetchDurationMs} ms; {cacheStatus}; parent: {sourceLabel})"},RUN0016:{scope:"runtime",channel:"performance",severity:"info",layer:"optional",template:"Compiled {sourceLabel} in {headlineDuration} (css: {cssLength} chars){modeSuffix}{executionSuffix}{timingSuffix}{incrementalSuffix}"},RUN0017:{scope:"runtime",channel:"performance",severity:"info",layer:"optional",template:"Compiled {importHref} in {compileDuration} (css: {cssLength} chars) (imported by: {importerSourceId}; {cacheStatus}; parent: {sourceLabel})"},RUN0018:{scope:"runtime",channel:"performance",severity:"info",layer:"optional",template:"Compiled {sourceLabel} [observed:{event}] in {compileDuration} (css: {cssLength} chars) (observed: {activeRules}/{totalRules} active, changed: {changedRules})"},RUN0019:{scope:"runtime",channel:"debug",severity:"warn",layer:"optional",template:"{message} (code: resource-limit)."},RUN0020:{scope:"runtime",channel:"debug",severity:"warn",layer:"optional",template:'{sourceLabel}{sourceSuffix}: Invalid observed selector "{selector}"{lineSuffix}. ({reason}, code: invalid-observed-selector).'},RUN0021:{scope:"runtime",channel:"debug",severity:"info",layer:"optional",template:"Observed {event}: {sourceLabel} (tokens: {tokenCount}, affected: {changedRules}, active: {activeRules})"},RUN0022:{scope:"runtime",channel:"debug",severity:"info",layer:"optional",template:'Debug rule map ready: window.__LentyStyleRuleMap["{styleId}"]'},RUN0023:{scope:"runtime",channel:"debug",severity:"warn",layer:"optional",template:"{sourceLabel}{lineLabel} {detailMessage}"},RUN0024:{scope:"runtime",channel:"compile",severity:"error",layer:"critical",template:".luis stylesheet failed: {href}{lineSuffix}"},RUN0025:{scope:"runtime",channel:"compile",severity:"error",layer:"critical",template:"<style data-luis> failed{lineSuffix}."},GRD0001:{scope:"guard",channel:"security",severity:"error",layer:null,template:"blocked candidate changes: {changedPaths} | targets={targetCount}, blocked={blockedCount}, warning={warningCount}"},GRD0002:{scope:"guard",channel:"security",severity:"info",layer:null,template:"validated candidate changes: {changedPaths} | targets={targetCount}, blocked={blockedCount}, warning={warningCount}"},HYB0001:{scope:"hybrid",channel:"hybrid",severity:"info",layer:null,template:"Compiled {routeId} in {duration} (sources: {sourceCount}; compile {compileDuration}; evaluate {evaluateDuration}; cache: {cacheState}; runtime-features: {runtimeFeatures})"},HYB0002:{scope:"hybrid",channel:"debug",severity:"warn",layer:null,template:"{routeId}: {warningMessage} (line {line}, code: {warningCode})."},HYB0003:{scope:"hybrid",channel:"debug",severity:"info",layer:null,template:"{routeId}: {rewriteState}."}};function d(e,t={},r={}){var o;let n=(o=k[e])!=null?o:I(e);return{id:e,...n,message:D(n.template,t),error:r.error}}function I(e){let t=K(e);return{scope:t,channel:{guard:"security",runtime:"runtime",compiler:"compile",hybrid:"hybrid",ssr:"ssr"}[t],severity:"error",layer:t==="runtime"?"emergency":null,template:`Unregistered log id "${e}".`}}function K(e){return e.startsWith("RUN")?"runtime":e.startsWith("GRD")?"guard":e.startsWith("HYB")?"hybrid":e.startsWith("SSR")?"ssr":"compiler"}function D(e,t){return e.replace(/\{([a-zA-Z0-9_]+)\}/g,(r,n)=>{let o=t[n];return o===void 0?r:String(o)})}var W="__LentyStyleDispatchLogEvent__";function w(e){let t=e.channel===e.scope?"":`[${e.channel}] `;return`[LentyStyle][${e.scope}][${e.severity}][${e.id}] ${t}${e.message}`}function h(e,t={},r={}){var o;let n=d(e,t,{error:r.error});_(n)||C(n,(o=r.sink)!=null?o:console)}function C(e,t=console){let r=w(e),n=z(e.severity,t);if(e.error===void 0){n(r);return}n(r,e.error)}function z(e,t){var r,n,o,i,s,u,y,v,b;return e==="error"?(n=(r=t.error)!=null?r:t.warn)!=null?n:t.info:e==="warn"?(i=(o=t.warn)!=null?o:t.info)!=null?i:t.error:e==="debug"?(y=(u=(s=t.debug)!=null?s:t.info)!=null?u:t.warn)!=null?y:t.error:(b=(v=t.info)!=null?v:t.warn)!=null?b:t.error}function _(e){let r=globalThis[W];return r?r(e)===!0:!1}var g=globalThis.LentyStyle;g!=null&&g.registerRuntimeFeature?g.registerRuntimeFeature("lazy",S()):h("RUN0006");})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(()=>{function l(e){let t=e.channel===e.scope?"":`[${e.channel}] `;return`[LentyStyle][${e.scope}][${e.severity}][${e.id}] ${t}${e.message}`}function p(e,t=console){let o=l(e),n=S(e.severity,t);if(e.error===void 0){n(o);return}n(o,e.error)}function r(e=console){return t=>p(t,e)}function S(e,t){var o,n,i,s,g,y,u,a,c;return e==="error"?(n=(o=t.error)!=null?o:t.warn)!=null?n:t.info:e==="warn"?(s=(i=t.warn)!=null?i:t.info)!=null?s:t.error:e==="debug"?(u=(y=(g=t.debug)!=null?g:t.info)!=null?y:t.warn)!=null?u:t.error:(c=(a=t.info)!=null?a:t.warn)!=null?c:t.error}var L="__LentyStyleRuntimeLogState__";function m(e,t){let o=f();o.sinks[e]=t,h(e)}function h(e){let t=f(),o=t.sinks[e];if(!o)return;let n=t.queues[e];for(;n.length>0;)o(n.shift())}function f(){let e=globalThis;if(e[L])return e[L];let t={sinks:{},queues:{critical:[],optional:[]}};return e[L]=t,t}m("critical",r());})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(()=>{function l(e){let t=e.channel===e.scope?"":`[${e.channel}] `;return`[LentyStyle][${e.scope}][${e.severity}][${e.id}] ${t}${e.message}`}function p(e,t=console){let o=l(e),n=S(e.severity,t);if(e.error===void 0){n(o);return}n(o,e.error)}function r(e=console){return t=>p(t,e)}function S(e,t){var o,n,i,s,g,y,u,a,c;return e==="error"?(n=(o=t.error)!=null?o:t.warn)!=null?n:t.info:e==="warn"?(s=(i=t.warn)!=null?i:t.info)!=null?s:t.error:e==="debug"?(u=(y=(g=t.debug)!=null?g:t.info)!=null?y:t.warn)!=null?u:t.error:(c=(a=t.info)!=null?a:t.warn)!=null?c:t.error}var L="__LentyStyleRuntimeLogState__";function m(e,t){let o=f();o.sinks[e]=t,h(e)}function h(e){let t=f(),o=t.sinks[e];if(!o)return;let n=t.queues[e];for(;n.length>0;)o(n.shift())}function f(){let e=globalThis;if(e[L])return e[L];let t={sinks:{},queues:{critical:[],optional:[]}};return e[L]=t,t}m("optional",r());})();
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";(()=>{var M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function h(e){let r=[],t=0,n=0;for(let o of e){if(!o){r.push("");continue}let i=[p(0),p(o.sourceIndex-t),p(o.sourceLine-n),p(0)].join("");t=o.sourceIndex,n=o.sourceLine,r.push(i)}return r.join(";")}function p(e){let r=U(e),t="";do{let n=r&31;r>>>=5,r>0&&(n|=32),t+=M[n]}while(r>0);return t}function U(e){return e<0?(-e<<1)+1:e<<1}var w=/^\s*\/\*\s*luis-source:\s*(.+):(\d+)\s*\*\/\s*$/;function S(e,r,t,n){let o={sources:[t],sourcesContent:[n],sourceIndexById:new Map([[t,0]])},i=I(r,o);return{version:3,file:`${e}.css`,sources:o.sources,sourcesContent:o.sourcesContent,names:[],mappings:h(i)}}function I(e,r){let t=[],n=e.split(`
|
|
2
|
+
`),o=0,i=0,s=!1;for(let c of n){let a=c.match(w);if(a){let l=a[1].trim(),u=Number.parseInt(a[2],10);o=E(r,l),i=Number.isFinite(u)?Math.max(0,u-1):0,s=!0,t.push(null);continue}if(!s||c.trim().length===0){t.push(null);continue}t.push({sourceIndex:o,sourceLine:i})}return t}function E(e,r){let t=e.sourceIndexById.get(r);if(typeof t=="number")return t;let n=e.sources.length;return e.sources.push(r),e.sourcesContent.push(null),e.sourceIndexById.set(r,n),n}var m=new WeakMap,L=new WeakMap;function b(e,r){let t=L.get(e),n=m.get(e);if(t===r&&n)return n;let o=N(r);return m.set(e,o),L.set(e,r),o}function y(e){m.delete(e),L.delete(e)}function N(e){return`data:application/json;charset=utf-8;base64,${k(e)}`}function k(e){let r=encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,n)=>String.fromCharCode(Number.parseInt(n,16)));return btoa(r)}function v(e,r,t){if(!t.enabled)return y(e),r;let n=S(e.id,r,t.sourceId,t.sourceContent),o=JSON.stringify(n),i=b(e,o),s=D(t.sourceId,e.id);return`${r}
|
|
3
|
+
/*# sourceMappingURL=${i} */
|
|
4
|
+
/*# sourceURL=${s} */`}function D(e,r){if(_(e))return e;let t=encodeURIComponent(e);return`lenty-generated://${r}?source=${t}`}function _(e){let r=e.trim().toLowerCase();return r.startsWith("http://")||r.startsWith("https://")||r.startsWith("/")}function R(){return{buildCssWithLuisSourceMap:v,revokeLuisSourceMapForStyleTag:y}}var A={RUN0001:{scope:"runtime",channel:"debug",severity:"error",layer:"emergency",template:"Debug feature requires core script before plugin script."},RUN0002:{scope:"runtime",channel:"performance",severity:"error",layer:"emergency",template:"Performance feature requires core script before plugin script."},RUN0003:{scope:"runtime",channel:"runtime",severity:"error",layer:"emergency",template:"Observed feature requires core script before plugin script."},RUN0004:{scope:"runtime",channel:"debug",severity:"error",layer:"emergency",template:"Map feature requires core script before plugin script."},RUN0005:{scope:"runtime",channel:"runtime",severity:"error",layer:"emergency",template:"Worker feature requires core script before plugin script."},RUN0006:{scope:"runtime",channel:"runtime",severity:"error",layer:"emergency",template:"Lazy feature requires core script before plugin script."},RUN0007:{scope:"runtime",channel:"compile",severity:"error",layer:"critical",template:"Initial runtime compile failed."},RUN0008:{scope:"runtime",channel:"runtime",severity:"error",layer:"emergency",template:"Runtime {layer} logger bundle could not load. Falling back to emergency console output."},RUN0009:{scope:"runtime",channel:"runtime",severity:"error",layer:"critical",template:'Runtime feature "{feature}" could not resolve script URL.'},RUN0010:{scope:"runtime",channel:"security",severity:"error",layer:"critical",template:'Runtime feature "{feature}" blocked: missing SRI hash for cross-origin URL {scriptUrl}.'},RUN0011:{scope:"runtime",channel:"runtime",severity:"error",layer:"critical",template:'Runtime feature "{feature}" loaded but did not register.'},RUN0012:{scope:"runtime",channel:"runtime",severity:"error",layer:"critical",template:'Runtime feature "{feature}" failed to load: {scriptUrl}'},RUN0013:{scope:"runtime",channel:"debug",severity:"warn",layer:"optional",template:"{sourceLabel}: {warningMessage} (line {line}, code: {warningCode})."},RUN0014:{scope:"runtime",channel:"debug",severity:"info",layer:"optional",template:"Loaded imported .luis: {importedHref} (from {sourceLabel})"},RUN0015:{scope:"runtime",channel:"debug",severity:"info",layer:"optional",template:"Import diagnostics: {href} (from {importerSourceId}; {sourceLength} chars; {fetchDurationMs} ms; {cacheStatus}; parent: {sourceLabel})"},RUN0016:{scope:"runtime",channel:"performance",severity:"info",layer:"optional",template:"Compiled {sourceLabel} in {headlineDuration} (css: {cssLength} chars){modeSuffix}{executionSuffix}{timingSuffix}{incrementalSuffix}"},RUN0017:{scope:"runtime",channel:"performance",severity:"info",layer:"optional",template:"Compiled {importHref} in {compileDuration} (css: {cssLength} chars) (imported by: {importerSourceId}; {cacheStatus}; parent: {sourceLabel})"},RUN0018:{scope:"runtime",channel:"performance",severity:"info",layer:"optional",template:"Compiled {sourceLabel} [observed:{event}] in {compileDuration} (css: {cssLength} chars) (observed: {activeRules}/{totalRules} active, changed: {changedRules})"},RUN0019:{scope:"runtime",channel:"debug",severity:"warn",layer:"optional",template:"{message} (code: resource-limit)."},RUN0020:{scope:"runtime",channel:"debug",severity:"warn",layer:"optional",template:'{sourceLabel}{sourceSuffix}: Invalid observed selector "{selector}"{lineSuffix}. ({reason}, code: invalid-observed-selector).'},RUN0021:{scope:"runtime",channel:"debug",severity:"info",layer:"optional",template:"Observed {event}: {sourceLabel} (tokens: {tokenCount}, affected: {changedRules}, active: {activeRules})"},RUN0022:{scope:"runtime",channel:"debug",severity:"info",layer:"optional",template:'Debug rule map ready: window.__LentyStyleRuleMap["{styleId}"]'},RUN0023:{scope:"runtime",channel:"debug",severity:"warn",layer:"optional",template:"{sourceLabel}{lineLabel} {detailMessage}"},RUN0024:{scope:"runtime",channel:"compile",severity:"error",layer:"critical",template:".luis stylesheet failed: {href}{lineSuffix}"},RUN0025:{scope:"runtime",channel:"compile",severity:"error",layer:"critical",template:"<style data-luis> failed{lineSuffix}."},GRD0001:{scope:"guard",channel:"security",severity:"error",layer:null,template:"blocked candidate changes: {changedPaths} | targets={targetCount}, blocked={blockedCount}, warning={warningCount}"},GRD0002:{scope:"guard",channel:"security",severity:"info",layer:null,template:"validated candidate changes: {changedPaths} | targets={targetCount}, blocked={blockedCount}, warning={warningCount}"},HYB0001:{scope:"hybrid",channel:"hybrid",severity:"info",layer:null,template:"Compiled {routeId} in {duration} (sources: {sourceCount}; compile {compileDuration}; evaluate {evaluateDuration}; cache: {cacheState}; runtime-features: {runtimeFeatures})"},HYB0002:{scope:"hybrid",channel:"debug",severity:"warn",layer:null,template:"{routeId}: {warningMessage} (line {line}, code: {warningCode})."},HYB0003:{scope:"hybrid",channel:"debug",severity:"info",layer:null,template:"{routeId}: {rewriteState}."}};function d(e,r={},t={}){var o;let n=(o=A[e])!=null?o:F(e);return{id:e,...n,message:$(n.template,r),error:t.error}}function F(e){let r=T(e);return{scope:r,channel:{guard:"security",runtime:"runtime",compiler:"compile",hybrid:"hybrid",ssr:"ssr"}[r],severity:"error",layer:r==="runtime"?"emergency":null,template:`Unregistered log id "${e}".`}}function T(e){return e.startsWith("RUN")?"runtime":e.startsWith("GRD")?"guard":e.startsWith("HYB")?"hybrid":e.startsWith("SSR")?"ssr":"compiler"}function $(e,r){return e.replace(/\{([a-zA-Z0-9_]+)\}/g,(t,n)=>{let o=r[n];return o===void 0?t:String(o)})}var H="__LentyStyleDispatchLogEvent__";function C(e){let r=e.channel===e.scope?"":`[${e.channel}] `;return`[LentyStyle][${e.scope}][${e.severity}][${e.id}] ${r}${e.message}`}function f(e,r={},t={}){var o;let n=d(e,r,{error:t.error});G(n)||x(n,(o=t.sink)!=null?o:console)}function x(e,r=console){let t=C(e),n=B(e.severity,r);if(e.error===void 0){n(t);return}n(t,e.error)}function B(e,r){var t,n,o,i,s,c,a,l,u;return e==="error"?(n=(t=r.error)!=null?t:r.warn)!=null?n:r.info:e==="warn"?(i=(o=r.warn)!=null?o:r.info)!=null?i:r.error:e==="debug"?(a=(c=(s=r.debug)!=null?s:r.info)!=null?c:r.warn)!=null?a:r.error:(u=(l=r.info)!=null?l:r.warn)!=null?u:r.error}function G(e){let t=globalThis[H];return t?t(e)===!0:!1}var g=globalThis.LentyStyle;g!=null&&g.registerRuntimeFeature?g.registerRuntimeFeature("map",R()):f("RUN0004");})();
|