@stacksjs/stx 0.2.43 → 0.2.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +3 -3
- package/dist/index.js +2 -2
- package/dist/pwa.js +2 -2
- package/dist/ssg.js +2 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -879,7 +879,7 @@ catch (e) {
|
|
|
879
879
|
}
|
|
880
880
|
throw e;
|
|
881
881
|
}
|
|
882
|
-
`)(...Object.values(X))}catch{return}}function O0($){try{return o$($),!0}catch{return!1}}function x0($,Z){try{let Y=R0($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function V0($,Z){let Y=o$($);
|
|
882
|
+
`)(...Object.values(X))}catch{return}}function O0($){try{return o$($),!0}catch{return!1}}function x0($,Z){try{let Y=R0($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function V0($,Z){let Y=o$($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++)if(X.test(Z[K]))J.push(K),Q.push(Z[K]);let G=Function(...Q,`
|
|
883
883
|
'use strict';
|
|
884
884
|
try {
|
|
885
885
|
return ${Y};
|
|
@@ -890,7 +890,7 @@ catch (e) {
|
|
|
890
890
|
}
|
|
891
891
|
throw e;
|
|
892
892
|
}
|
|
893
|
-
`)}function R8($){let Z=$.trim(),Y=[/\beval\s*\(/i,/\bFunction\s*\(/i,/\bimport\s*\(/i,/\brequire\s*\(/i,/\bprocess\b/i,/\b__proto__\b/i,/\bconstructor\s*[.(]/i,/\bglobalThis\b/i,/\bwindow\b/i,/\bdocument\b/i,/\bfetch\s*\(/i,/\bBun\b/i,/\bDeno\b/i,/\bconsole\b/i,/\bthis\b/i,/\bReflect\b/i,/\bProxy\b/i,/\bprototype\b/i,/\.(bind|call|apply)\s*\(/i];for(let X of Y)if(X.test(Z))return!1;return!0}var CV,SK,bK,PV;var n0=D(()=>{CV={maxSanitizeDepth:10,allowBracketNotation:!1},SK={...CV},bK=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,/\bnew\s+/,/\bdelete\s+/,/\bthis\b/],PV=/[\w)\]]\s*\[\s*['"]/});function hY(){CK=0,M8.clear()}function t$($,Z){let Y=CK++,X=`<!--__STX_${$.toUpperCase()}_${Y}__-->`;return M8.set(X,{type:$,expression:Z}),X}function dY(){let $={};for(let[Z,Y]of M8)$[Z]={type:Y.type,expression:Y.expression};return $}function vV($){let Z={},Y=/<!--__STX_(EXPR|COND|RAW)_(\d+)__-->/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=X[1].toLowerCase(),G=M8.get(J);Z[J]={type:Q,expression:G?.expression||""}}return Z}function E8($,Z){let Y=$;for(let[X,J]of Z)Y=Y.split(X).join(J);return Y}function R6($){return $.includes("<!--__STX_")}var CK=0,M8;var e$=D(()=>{M8=new Map});var Y5={};e(Y5,{usesSignalsInScript:()=>Z5,unescapeHtml:()=>T8,registerFilters:()=>xK,registerFilter:()=>uY,processExpressions:()=>O1,interpolateScriptsInTemplate:()=>gK,interpolateScriptExpressions:()=>cY,getAllFilters:()=>mY,evaluateExpression:()=>_1,escapeHtml:()=>D0,defaultFilters:()=>M6,clearCustomFilters:()=>vK,applyFilters:()=>pY});function gV($){let Z=PK.get($);if(!Z){let Y=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Z=new RegExp(`:${Y}(?!\\w)`,"g"),PK.set($,Z)}return Z.lastIndex=0,Z}function uY($,Z){if($ in M6)console.warn(`Filter "${$}" already exists as a built-in filter. Custom filter will take precedence.`);$5[$]=Z}function xK($){for(let[Z,Y]of Object.entries($))uY(Z,Y)}function mY(){return{...M6,...$5}}function vK(){for(let $ of Object.keys($5))delete $5[$]}function D0($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Z5($){let Z=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,Y;while((Y=Z.exec($))!==null){let X=Y[1];if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/.test(X))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test($))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test($))return!0;return!1}function yK($,Z){let Y=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console"],X=$.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),J="",Q=!1,G=0;for(let U=0;U<X.length;U++){let _=X[U];if(!Q&&_==="`"){Q=!0,G=0;continue}if(Q){if(_==="`"&&G===0){Q=!1;continue}if(_==="$"&&X[U+1]==="{"){G++,U++;continue}if(_==="}"&&G>0){G--;continue}continue}J+=_}X=J;let K=/\b([a-zA-Z_$][a-zA-Z0-9_$]*)\b/g,W;while((W=K.exec(X))!==null){let U=W[1];if(!X.substring(0,W.index).trimEnd().endsWith(".")){if(!Y.includes(U)&&!(U in Z))return!1}}return!0}function cY($,Z){let Y=$;return Y=Y.replace(/\{!!([\s\S]*?)!!\}/g,(X,J)=>{try{let Q=_1(J,Z);if(Q===void 0)return X;return Q===null?"":String(Q)}catch{return X}}),Y=Y.replace(/\{\{([\s\S]*?)\}\}/g,(X,J)=>{let Q=J.trim();if(/^__[A-Z_]+__$/.test(Q))return X;try{let G=_1(J,Z);if(G===void 0)return X;return JSON.stringify(G)}catch{return X}}),Y}function gK($,Z,Y={}){return $.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(X,J,Q)=>{if(/\bsrc\s*=/.test(J))return X;if(/\bdata-raw\b/.test(J))return X;if(/\btype\s*=\s*["']application\/json["']/.test(J))return X;if(Y.skipServer&&/\bserver\b/.test(J))return X;let G=cY(Q,Z);return`<script${J}>${G}</script>`})}function O1($,Z,Y){let X=$,J=[];X=X.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,(K)=>{if(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K))return K;let W=J.length;return J.push(K),`<!--__STX_STYLE_${W}__-->`});let Q=[];X=X.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,(K)=>{let W=Q.length;return Q.push(K),`<!--__STX_SCRIPT_EXPR_${W}__-->`});let G=Z5($);X=X.replace(/\{\{\{([\s\S]*?)\}\}\}/g,(K,W,U)=>{try{let _=_1(W,Z);return _!==void 0&&_!==null?String(_):""}catch(_){let B=_ instanceof Error?_.message:String(_);return L0("Expression",`Error evaluating: {{{ ${W.trim()}}}}: ${B}`,Y,$,U,K)}}),X=X.replace(/\{!!([\s\S]*?)!!\}/g,(K,W,U)=>{try{let _=_1(W,Z);if(_===void 0&&Z.__stx_buildMode==="compile")return t$("raw",W.trim());return _!==void 0&&_!==null?String(_):""}catch(_){if(Z.__stx_buildMode==="compile")return t$("raw",W.trim());let B=_ instanceof Error?_.message:String(_);return L0("Expression",`Error evaluating: {!! ${W.trim()} !!}: ${B}`,Y,$,U,K)}}),X=X.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,(K)=>{if(K.startsWith("<!--__STX_SCRIPT_EXPR_"))return K;let W=Q.length;return Q.push(K),`<!--__STX_SCRIPT_EXPR_${W}__-->`}),X=X.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,(K)=>{if(K.startsWith("<!--__STX_STYLE_"))return K;if(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K))return K;let W=J.length;return J.push(K),`<!--__STX_STYLE_${W}__-->`}),X=X.replace(/\{\{([\s\S]*?)\}\}/g,(K,W,U)=>{let _=W.trim(),B=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],z=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,j=_.match(z)?.[1],H=j&&((j in Z)||B.includes(j)),O=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,F=_.match(O),L=F&&!B.includes(F[1])&&!(F[1]in Z);if(/^__[A-Z_]+__$/.test(_))return"";try{let V=_1(W,Z);if(V===void 0&&G&&!yK(_,Z))return K;if(V===void 0&&Z.__stx_buildMode==="compile"&&!G)return t$("expr",_);return V!==void 0&&V!==null?D0(String(V)):""}catch(V){if(G&&!yK(_,Z))return K;if(L)return K;let N=V instanceof Error?V.message:String(V);return L0("Expression",`Error evaluating: {{ ${_} }}: ${N}`,Y,$,U,K)}});for(let K=0;K<Q.length;K++)X=X.replace(`<!--__STX_SCRIPT_EXPR_${K}__-->`,()=>Q[K]);for(let K=0;K<J.length;K++)X=X.replace(`<!--__STX_STYLE_${K}__-->`,()=>J[K]);return X}function pY($,Z,Y){if(!Z.trim())return $;let X=$,J=Z.trim();while(J.length>0){let Q=J.match(/^(\w+)/);if(!Q)break;let G=Q[1];J=J.substring(G.length).trim();let K=$5[G]||M6[G];if(!K)throw Error(`Filter not found: ${G}. Available filters: ${Object.keys(mY()).join(", ")}`);let W=[];if(J.startsWith(":")){let U=J.match(/^:([^|\s]+)/);if(U){let _=U[1].trim();try{let B=Number(_);W=[Number.isNaN(B)?_:B]}catch{W=[_]}J=J.substring(U[0].length).trim()}}else if(J.startsWith("(")){let U=1,_=1;while(U>0&&_<J.length){if(J[_]==="(")U++;if(J[_]===")")U--;_++}if(U===0){let B=J.substring(1,_-1).trim();if(B)try{if(B.startsWith("{")&&B.endsWith("}"))W=[_1(`(${B})`,Y,!0)];else{let z=[],q="",j=null,H=0,O=0,F=0,L=!1;for(let V=0;V<B.length;V++){let N=B[V];if(L){q+=N,L=!1;continue}if(N==="\\"){q+=N,L=!0;continue}if(j){if(q+=N,N===j)j=null;continue}if(N==='"'||N==="'"||N==="`"){j=N,q+=N;continue}if(N==="(")H++;else if(N===")")H--;else if(N==="[")O++;else if(N==="]")O--;else if(N==="{")F++;else if(N==="}")F--;if(N===","&&H===0&&O===0&&F===0){z.push(q),q="";continue}q+=N}if(q)z.push(q);W=z.map((V)=>{let N=V.trim();return _1(N,Y,!0)})}}catch{W=[B]}J=J.substring(_).trim()}}try{X=K(X,Y,...W)}catch(U){let _=U instanceof Error?U.message:String(U);throw Error(`Error applying filter '${G}': ${_}`)}if(J.startsWith("|"))J=J.substring(1).trim();else break}return X}function fV($){let Z=!1,Y="",X=0,J=0,Q=0,G=!1;for(let K=0;K<$.length;K++){let W=$[K],U=$[K+1];if(Z&&G){G=!1;continue}if(Z&&W==="\\"){G=!0;continue}if(G=!1,(W==='"'||W==="'"||W==="`")&&!G){if(!Z)Z=!0,Y=W;else if(W===Y)Z=!1,Y="";continue}if(Z&&Y==="`"&&W==="$"&&U==="{"){let _=1;K+=2;while(K<$.length&&_>0){if($[K]==="{")_++;else if($[K]==="}")_--;if(_>0)K++}continue}if(Z)continue;if(W==="(")X++;else if(W===")")X--;else if(W==="[")J++;else if(W==="]")J--;else if(W==="{")Q++;else if(W==="}")Q--;if(W==="|"&&X===0&&J===0&&Q===0){if(U==="|"){K++;continue}if(U==="="){K++;continue}return K}}return-1}function _1($,Z,Y=!1){try{let X=$.trim(),J=fV(X);if(J>0){let Q=X.substring(0,J).trim(),G=X.substring(J+1).trim(),K=_1(Q,Z,!0);return pY(K,G,Z)}if(!O0(X)){if(!Y)console.warn(`Potentially unsafe expression detected, using safe evaluator: ${X}`);return R0(X,Z)}try{let Q=Object.keys(Z),G=Object.values(Z);return V0(X,Q)(...G)}catch{return R0(X,Z)}}catch(X){if(X instanceof ReferenceError){let J=/(\b\w+)\s+is not defined/.exec(X.message);if(J){let Q=J[1],G=hV(Q,Object.keys(Z));if(G&&G!==Q)X.message=`${X.message} \u2014 did you mean '${G}'?`}}if(!Y)console.error(`Error evaluating expression: ${$}`,X);throw X}}function hV($,Z){let Y=null;for(let J of Z){if(J===$)continue;let Q=dV($,J);if(Y===null||Q<Y.dist)Y={key:J,dist:Q}}if(!Y)return null;let X=Math.max($.length,Y.key.length);if(Y.dist<=2||Y.dist/X<=0.35)return Y.key;return null}function dV($,Z){if($===Z)return 0;if($.length===0)return Z.length;if(Z.length===0)return $.length;let[Y,X]=$.length<Z.length?[$,Z]:[Z,$],J=Array(Y.length+1),Q=Array(Y.length+1);for(let G=0;G<=Y.length;G++)J[G]=G;for(let G=1;G<=X.length;G++){Q[0]=G;for(let K=1;K<=Y.length;K++){let W=Y[K-1]===X[G-1]?0:1;Q[K]=Math.min(Q[K-1]+1,J[K]+1,J[K-1]+W)}for(let K=0;K<=Y.length;K++)J[K]=Q[K]}return J[Y.length]}function T8($){if(!$)return"";return $.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'").replace(/&/g,"&")}var $5,PK,M6;var r0=D(()=>{n0();H0();e$();$5={},PK=new Map;M6={uppercase:($,Z)=>{return $!==void 0&&$!==null?String($).toUpperCase():""},lowercase:($,Z)=>{return $!==void 0&&$!==null?String($).toLowerCase():""},capitalize:($,Z)=>{if($===void 0||$===null)return"";let Y=String($);return Y.charAt(0).toUpperCase()+Y.slice(1)},number:($,Z,Y=0)=>{if($===void 0||$===null)return"";try{let X=Number($);return Number.isNaN(X)?"":X.toFixed(Number.parseInt(String(Y),10))}catch{return""}},fmt:($,Z,Y="en-US")=>{if($===void 0||$===null)return"";try{let X=Number($);if(Number.isNaN(X))return String($);return X.toLocaleString(Y)}catch{return String($)}},join:($,Z,Y=",")=>{if(!Array.isArray($))return"";return $.join(String(Y))},escape:($,Z)=>{if($===void 0||$===null)return"";return D0(String($))},translate:($,Z,Y={})=>{if(!Z||!Z.__translations)return $;let X=Z.__translations,J=Z.__i18nConfig?.fallbackToKey??!0,Q=String($).split("."),G=X;for(let W of Q){if(G===void 0||G===null)break;G=G[W]}if(G===void 0||G===null)return J?$:"";let K=String(G);return Object.entries(Y).forEach(([W,U])=>{K=K.replace(gV(W),String(U))}),K},t:($,Z,Y={})=>{return M6.translate($,Z,Y)},truncate:($,Z,Y=50,X="...")=>{if($===void 0||$===null)return"";let J=String($);if(J.length<=Y)return J;if(Y<=X.length)return X.substring(0,Y);return J.substring(0,Y-X.length)+X},date:($,Z,Y="short",X="en-US")=>{if($===void 0||$===null)return"";try{let J=$ instanceof Date?$:new Date($);if(Number.isNaN(J.getTime()))return String($);let Q={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(Y==="iso")return J.toISOString();return new Intl.DateTimeFormat(X,Q[Y]||Q.short).format(J)}catch{return String($)}},currency:($,Z,Y="USD",X="en-US")=>{if($===void 0||$===null)return"";try{let J=Number($);if(Number.isNaN(J))return String($);return new Intl.NumberFormat(X,{style:"currency",currency:Y}).format(J)}catch{return String($)}},pluralize:($,Z,Y,X)=>{let J=Number($);if(Number.isNaN(J))return Y;let Q=X||`${Y}s`;return J===1?Y:Q},first:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[0];return String($).charAt(0)},last:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[$.length-1];let Y=String($);return Y.charAt(Y.length-1)},length:($,Z)=>{if($===void 0||$===null)return 0;if(Array.isArray($)||typeof $==="string")return $.length;if($ instanceof Map||$ instanceof Set)return $.size;if(typeof $==="object")return Object.keys($).length;return 0},json:($,Z,Y=!1)=>{if($===void 0)return"undefined";if($===null)return"null";try{return Y?JSON.stringify($,null,2):JSON.stringify($)}catch{return String($)}},default:($,Z,Y="")=>{return $===void 0||$===null||$===""?Y:$},reverse:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return[...$].reverse();return String($).split("").reverse().join("")},slice:($,Z,Y=0,X)=>{if($===void 0||$===null)return"";if(Array.isArray($)||typeof $==="string")return $.slice(Y,X);return $},replace:($,Z,Y,X="")=>{if($===void 0||$===null)return"";let J=Y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String($).replace(new RegExp(J,"g"),()=>X)},stripTags:($,Z)=>{if($===void 0||$===null)return"";return String($).replace(/<[^>]*>/g,"")},urlencode:($,Z)=>{if($===void 0||$===null)return"";return encodeURIComponent(String($))},abs:($,Z)=>{let Y=Number($);return Number.isNaN(Y)?0:Math.abs(Y)},round:($,Z,Y=0)=>{let X=Number($);if(Number.isNaN(X))return 0;let J=10**Y;return Math.round(X*J)/J}}});class X5{cache=new Map;maxSize;constructor($=100){this.maxSize=$}get($){if(!this.cache.has($))return;let Z=this.cache.get($);return this.cache.delete($),this.cache.set($,Z),Z}set($,Z){if(this.cache.has($))this.cache.delete($);else if(this.cache.size>=this.maxSize){let Y=this.cache.keys().next().value;if(Y!==void 0)this.cache.delete(Y)}this.cache.set($,Z)}has($){return this.cache.has($)}delete($){return this.cache.delete($)}clear(){this.cache.clear()}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}function T6($,Z){if(Z?.includes("g"))return new RegExp($,Z);let Y=`${$}:${Z||""}`;if(!E6.has(Y)){if(E6.size>=uV){let X=E6.keys().next().value;if(X)E6.delete(X)}E6.set(Y,new RegExp($,Z))}return E6.get(Y)}class fK{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator($){let Z=Array.from(new Set($)),Y=Z.sort().join(","),X=this.pool.find((K)=>K.context.join(",")===Y);if(X)return X.func;let J=this.fnCache,Q=this.fnCacheMaxSize,G=(...K)=>{return(W)=>{try{let U=`${Y}:${W}`,_=J.get(U);if(!_){if(J.size>=Q){let B=J.keys().next().value;if(B)J.delete(B)}_=Function(...Z,`
|
|
893
|
+
`);if(Q.length===Z.length)return G;return(...K)=>{let W=Array(J.length);for(let U=0;U<J.length;U++)W[U]=K[J[U]];return G(...W)}}function R8($){let Z=$.trim(),Y=[/\beval\s*\(/i,/\bFunction\s*\(/i,/\bimport\s*\(/i,/\brequire\s*\(/i,/\bprocess\b/i,/\b__proto__\b/i,/\bconstructor\s*[.(]/i,/\bglobalThis\b/i,/\bwindow\b/i,/\bdocument\b/i,/\bfetch\s*\(/i,/\bBun\b/i,/\bDeno\b/i,/\bconsole\b/i,/\bthis\b/i,/\bReflect\b/i,/\bProxy\b/i,/\bprototype\b/i,/\.(bind|call|apply)\s*\(/i];for(let X of Y)if(X.test(Z))return!1;return!0}var CV,SK,bK,PV;var n0=D(()=>{CV={maxSanitizeDepth:10,allowBracketNotation:!1},SK={...CV},bK=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,/\bnew\s+/,/\bdelete\s+/,/\bthis\b/],PV=/[\w)\]]\s*\[\s*['"]/});function hY(){CK=0,M8.clear()}function t$($,Z){let Y=CK++,X=`<!--__STX_${$.toUpperCase()}_${Y}__-->`;return M8.set(X,{type:$,expression:Z}),X}function dY(){let $={};for(let[Z,Y]of M8)$[Z]={type:Y.type,expression:Y.expression};return $}function vV($){let Z={},Y=/<!--__STX_(EXPR|COND|RAW)_(\d+)__-->/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=X[1].toLowerCase(),G=M8.get(J);Z[J]={type:Q,expression:G?.expression||""}}return Z}function E8($,Z){let Y=$;for(let[X,J]of Z)Y=Y.split(X).join(J);return Y}function R6($){return $.includes("<!--__STX_")}var CK=0,M8;var e$=D(()=>{M8=new Map});var Y5={};e(Y5,{usesSignalsInScript:()=>Z5,unescapeHtml:()=>T8,registerFilters:()=>xK,registerFilter:()=>uY,processExpressions:()=>O1,interpolateScriptsInTemplate:()=>gK,interpolateScriptExpressions:()=>cY,getAllFilters:()=>mY,evaluateExpression:()=>_1,escapeHtml:()=>D0,defaultFilters:()=>M6,clearCustomFilters:()=>vK,applyFilters:()=>pY});function gV($){let Z=PK.get($);if(!Z){let Y=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Z=new RegExp(`:${Y}(?!\\w)`,"g"),PK.set($,Z)}return Z.lastIndex=0,Z}function uY($,Z){if($ in M6)console.warn(`Filter "${$}" already exists as a built-in filter. Custom filter will take precedence.`);$5[$]=Z}function xK($){for(let[Z,Y]of Object.entries($))uY(Z,Y)}function mY(){return{...M6,...$5}}function vK(){for(let $ of Object.keys($5))delete $5[$]}function D0($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Z5($){let Z=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,Y;while((Y=Z.exec($))!==null){let X=Y[1];if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/.test(X))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test($))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test($))return!0;return!1}function yK($,Z){let Y=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console"],X=$.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),J="",Q=!1,G=0;for(let U=0;U<X.length;U++){let _=X[U];if(!Q&&_==="`"){Q=!0,G=0;continue}if(Q){if(_==="`"&&G===0){Q=!1;continue}if(_==="$"&&X[U+1]==="{"){G++,U++;continue}if(_==="}"&&G>0){G--;continue}continue}J+=_}X=J;let K=/\b([a-zA-Z_$][a-zA-Z0-9_$]*)\b/g,W;while((W=K.exec(X))!==null){let U=W[1];if(!X.substring(0,W.index).trimEnd().endsWith(".")){if(!Y.includes(U)&&!(U in Z))return!1}}return!0}function cY($,Z){let Y=$;return Y=Y.replace(/\{!!([\s\S]*?)!!\}/g,(X,J)=>{try{let Q=_1(J,Z);if(Q===void 0)return X;return Q===null?"":String(Q)}catch{return X}}),Y=Y.replace(/\{\{([\s\S]*?)\}\}/g,(X,J)=>{let Q=J.trim();if(/^__[A-Z_]+__$/.test(Q))return X;try{let G=_1(J,Z);if(G===void 0)return X;return JSON.stringify(G)}catch{return X}}),Y}function gK($,Z,Y={}){return $.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(X,J,Q)=>{if(/\bsrc\s*=/.test(J))return X;if(/\bdata-raw\b/.test(J))return X;if(/\btype\s*=\s*["']application\/json["']/.test(J))return X;if(Y.skipServer&&/\bserver\b/.test(J))return X;let G=cY(Q,Z);return`<script${J}>${G}</script>`})}function O1($,Z,Y){let X=$,J=[];X=X.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,(K)=>{if(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K))return K;let W=J.length;return J.push(K),`<!--__STX_STYLE_${W}__-->`});let Q=[];X=X.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,(K)=>{let W=Q.length;return Q.push(K),`<!--__STX_SCRIPT_EXPR_${W}__-->`});let G=Z5($);X=X.replace(/\{\{\{([\s\S]*?)\}\}\}/g,(K,W,U)=>{try{let _=_1(W,Z);return _!==void 0&&_!==null?String(_):""}catch(_){let B=_ instanceof Error?_.message:String(_);return L0("Expression",`Error evaluating: {{{ ${W.trim()}}}}: ${B}`,Y,$,U,K)}}),X=X.replace(/\{!!([\s\S]*?)!!\}/g,(K,W,U)=>{try{let _=_1(W,Z);if(_===void 0&&Z.__stx_buildMode==="compile")return t$("raw",W.trim());return _!==void 0&&_!==null?String(_):""}catch(_){if(Z.__stx_buildMode==="compile")return t$("raw",W.trim());let B=_ instanceof Error?_.message:String(_);return L0("Expression",`Error evaluating: {!! ${W.trim()} !!}: ${B}`,Y,$,U,K)}}),X=X.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,(K)=>{if(K.startsWith("<!--__STX_SCRIPT_EXPR_"))return K;let W=Q.length;return Q.push(K),`<!--__STX_SCRIPT_EXPR_${W}__-->`}),X=X.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,(K)=>{if(K.startsWith("<!--__STX_STYLE_"))return K;if(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K))return K;let W=J.length;return J.push(K),`<!--__STX_STYLE_${W}__-->`}),X=X.replace(/\{\{([\s\S]*?)\}\}/g,(K,W,U)=>{let _=W.trim(),B=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],z=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,j=_.match(z)?.[1],H=j&&((j in Z)||B.includes(j)),O=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,F=_.match(O),L=F&&!B.includes(F[1])&&!(F[1]in Z);if(/^__[A-Z_]+__$/.test(_))return"";try{let V=_1(W,Z);if(V===void 0&&G&&!yK(_,Z))return K;if(V===void 0&&Z.__stx_buildMode==="compile"&&!G)return t$("expr",_);return V!==void 0&&V!==null?D0(String(V)):""}catch(V){if(G&&!yK(_,Z))return K;if(L)return K;let N=V instanceof Error?V.message:String(V);return L0("Expression",`Error evaluating: {{ ${_} }}: ${N}`,Y,$,U,K)}});for(let K=0;K<Q.length;K++)X=X.replace(`<!--__STX_SCRIPT_EXPR_${K}__-->`,()=>Q[K]);for(let K=0;K<J.length;K++)X=X.replace(`<!--__STX_STYLE_${K}__-->`,()=>J[K]);return X}function pY($,Z,Y){if(!Z.trim())return $;let X=$,J=Z.trim();while(J.length>0){let Q=J.match(/^(\w+)/);if(!Q)break;let G=Q[1];J=J.substring(G.length).trim();let K=$5[G]||M6[G];if(!K)throw Error(`Filter not found: ${G}. Available filters: ${Object.keys(mY()).join(", ")}`);let W=[];if(J.startsWith(":")){let U=J.match(/^:([^|\s]+)/);if(U){let _=U[1].trim();try{let B=Number(_);W=[Number.isNaN(B)?_:B]}catch{W=[_]}J=J.substring(U[0].length).trim()}}else if(J.startsWith("(")){let U=1,_=1;while(U>0&&_<J.length){if(J[_]==="(")U++;if(J[_]===")")U--;_++}if(U===0){let B=J.substring(1,_-1).trim();if(B)try{if(B.startsWith("{")&&B.endsWith("}"))W=[_1(`(${B})`,Y,!0)];else{let z=[],q="",j=null,H=0,O=0,F=0,L=!1;for(let V=0;V<B.length;V++){let N=B[V];if(L){q+=N,L=!1;continue}if(N==="\\"){q+=N,L=!0;continue}if(j){if(q+=N,N===j)j=null;continue}if(N==='"'||N==="'"||N==="`"){j=N,q+=N;continue}if(N==="(")H++;else if(N===")")H--;else if(N==="[")O++;else if(N==="]")O--;else if(N==="{")F++;else if(N==="}")F--;if(N===","&&H===0&&O===0&&F===0){z.push(q),q="";continue}q+=N}if(q)z.push(q);W=z.map((V)=>{let N=V.trim();return _1(N,Y,!0)})}}catch{W=[B]}J=J.substring(_).trim()}}try{X=K(X,Y,...W)}catch(U){let _=U instanceof Error?U.message:String(U);throw Error(`Error applying filter '${G}': ${_}`)}if(J.startsWith("|"))J=J.substring(1).trim();else break}return X}function fV($){let Z=!1,Y="",X=0,J=0,Q=0,G=!1;for(let K=0;K<$.length;K++){let W=$[K],U=$[K+1];if(Z&&G){G=!1;continue}if(Z&&W==="\\"){G=!0;continue}if(G=!1,(W==='"'||W==="'"||W==="`")&&!G){if(!Z)Z=!0,Y=W;else if(W===Y)Z=!1,Y="";continue}if(Z&&Y==="`"&&W==="$"&&U==="{"){let _=1;K+=2;while(K<$.length&&_>0){if($[K]==="{")_++;else if($[K]==="}")_--;if(_>0)K++}continue}if(Z)continue;if(W==="(")X++;else if(W===")")X--;else if(W==="[")J++;else if(W==="]")J--;else if(W==="{")Q++;else if(W==="}")Q--;if(W==="|"&&X===0&&J===0&&Q===0){if(U==="|"){K++;continue}if(U==="="){K++;continue}return K}}return-1}function _1($,Z,Y=!1){try{let X=$.trim(),J=fV(X);if(J>0){let Q=X.substring(0,J).trim(),G=X.substring(J+1).trim(),K=_1(Q,Z,!0);return pY(K,G,Z)}if(!O0(X)){if(!Y)console.warn(`Potentially unsafe expression detected, using safe evaluator: ${X}`);return R0(X,Z)}try{let Q=Object.keys(Z),G=Object.values(Z);return V0(X,Q)(...G)}catch{return R0(X,Z)}}catch(X){if(X instanceof ReferenceError){let J=/(\b\w+)\s+is not defined/.exec(X.message);if(J){let Q=J[1],G=hV(Q,Object.keys(Z));if(G&&G!==Q)X.message=`${X.message} \u2014 did you mean '${G}'?`}}if(!Y)console.error(`Error evaluating expression: ${$}`,X);throw X}}function hV($,Z){let Y=null;for(let J of Z){if(J===$)continue;let Q=dV($,J);if(Y===null||Q<Y.dist)Y={key:J,dist:Q}}if(!Y)return null;let X=Math.max($.length,Y.key.length);if(Y.dist<=2||Y.dist/X<=0.35)return Y.key;return null}function dV($,Z){if($===Z)return 0;if($.length===0)return Z.length;if(Z.length===0)return $.length;let[Y,X]=$.length<Z.length?[$,Z]:[Z,$],J=Array(Y.length+1),Q=Array(Y.length+1);for(let G=0;G<=Y.length;G++)J[G]=G;for(let G=1;G<=X.length;G++){Q[0]=G;for(let K=1;K<=Y.length;K++){let W=Y[K-1]===X[G-1]?0:1;Q[K]=Math.min(Q[K-1]+1,J[K]+1,J[K-1]+W)}for(let K=0;K<=Y.length;K++)J[K]=Q[K]}return J[Y.length]}function T8($){if(!$)return"";return $.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'").replace(/&/g,"&")}var $5,PK,M6;var r0=D(()=>{n0();H0();e$();$5={},PK=new Map;M6={uppercase:($,Z)=>{return $!==void 0&&$!==null?String($).toUpperCase():""},lowercase:($,Z)=>{return $!==void 0&&$!==null?String($).toLowerCase():""},capitalize:($,Z)=>{if($===void 0||$===null)return"";let Y=String($);return Y.charAt(0).toUpperCase()+Y.slice(1)},number:($,Z,Y=0)=>{if($===void 0||$===null)return"";try{let X=Number($);return Number.isNaN(X)?"":X.toFixed(Number.parseInt(String(Y),10))}catch{return""}},fmt:($,Z,Y="en-US")=>{if($===void 0||$===null)return"";try{let X=Number($);if(Number.isNaN(X))return String($);return X.toLocaleString(Y)}catch{return String($)}},join:($,Z,Y=",")=>{if(!Array.isArray($))return"";return $.join(String(Y))},escape:($,Z)=>{if($===void 0||$===null)return"";return D0(String($))},translate:($,Z,Y={})=>{if(!Z||!Z.__translations)return $;let X=Z.__translations,J=Z.__i18nConfig?.fallbackToKey??!0,Q=String($).split("."),G=X;for(let W of Q){if(G===void 0||G===null)break;G=G[W]}if(G===void 0||G===null)return J?$:"";let K=String(G);return Object.entries(Y).forEach(([W,U])=>{K=K.replace(gV(W),String(U))}),K},t:($,Z,Y={})=>{return M6.translate($,Z,Y)},truncate:($,Z,Y=50,X="...")=>{if($===void 0||$===null)return"";let J=String($);if(J.length<=Y)return J;if(Y<=X.length)return X.substring(0,Y);return J.substring(0,Y-X.length)+X},date:($,Z,Y="short",X="en-US")=>{if($===void 0||$===null)return"";try{let J=$ instanceof Date?$:new Date($);if(Number.isNaN(J.getTime()))return String($);let Q={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(Y==="iso")return J.toISOString();return new Intl.DateTimeFormat(X,Q[Y]||Q.short).format(J)}catch{return String($)}},currency:($,Z,Y="USD",X="en-US")=>{if($===void 0||$===null)return"";try{let J=Number($);if(Number.isNaN(J))return String($);return new Intl.NumberFormat(X,{style:"currency",currency:Y}).format(J)}catch{return String($)}},pluralize:($,Z,Y,X)=>{let J=Number($);if(Number.isNaN(J))return Y;let Q=X||`${Y}s`;return J===1?Y:Q},first:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[0];return String($).charAt(0)},last:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[$.length-1];let Y=String($);return Y.charAt(Y.length-1)},length:($,Z)=>{if($===void 0||$===null)return 0;if(Array.isArray($)||typeof $==="string")return $.length;if($ instanceof Map||$ instanceof Set)return $.size;if(typeof $==="object")return Object.keys($).length;return 0},json:($,Z,Y=!1)=>{if($===void 0)return"undefined";if($===null)return"null";try{return Y?JSON.stringify($,null,2):JSON.stringify($)}catch{return String($)}},default:($,Z,Y="")=>{return $===void 0||$===null||$===""?Y:$},reverse:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return[...$].reverse();return String($).split("").reverse().join("")},slice:($,Z,Y=0,X)=>{if($===void 0||$===null)return"";if(Array.isArray($)||typeof $==="string")return $.slice(Y,X);return $},replace:($,Z,Y,X="")=>{if($===void 0||$===null)return"";let J=Y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String($).replace(new RegExp(J,"g"),()=>X)},stripTags:($,Z)=>{if($===void 0||$===null)return"";return String($).replace(/<[^>]*>/g,"")},urlencode:($,Z)=>{if($===void 0||$===null)return"";return encodeURIComponent(String($))},abs:($,Z)=>{let Y=Number($);return Number.isNaN(Y)?0:Math.abs(Y)},round:($,Z,Y=0)=>{let X=Number($);if(Number.isNaN(X))return 0;let J=10**Y;return Math.round(X*J)/J}}});class X5{cache=new Map;maxSize;constructor($=100){this.maxSize=$}get($){if(!this.cache.has($))return;let Z=this.cache.get($);return this.cache.delete($),this.cache.set($,Z),Z}set($,Z){if(this.cache.has($))this.cache.delete($);else if(this.cache.size>=this.maxSize){let Y=this.cache.keys().next().value;if(Y!==void 0)this.cache.delete(Y)}this.cache.set($,Z)}has($){return this.cache.has($)}delete($){return this.cache.delete($)}clear(){this.cache.clear()}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}function T6($,Z){if(Z?.includes("g"))return new RegExp($,Z);let Y=`${$}:${Z||""}`;if(!E6.has(Y)){if(E6.size>=uV){let X=E6.keys().next().value;if(X)E6.delete(X)}E6.set(Y,new RegExp($,Z))}return E6.get(Y)}class fK{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator($){let Z=Array.from(new Set($)),Y=Z.sort().join(","),X=this.pool.find((K)=>K.context.join(",")===Y);if(X)return X.func;let J=this.fnCache,Q=this.fnCacheMaxSize,G=(...K)=>{return(W)=>{try{let U=`${Y}:${W}`,_=J.get(U);if(!_){if(J.size>=Q){let B=J.keys().next().value;if(B)J.delete(B)}_=Function(...Z,`
|
|
894
894
|
'use strict';
|
|
895
895
|
try {
|
|
896
896
|
return ${W};
|
|
@@ -18223,7 +18223,7 @@ else {
|
|
|
18223
18223
|
`)}function vF($,Z){let Y=" ".repeat(Z),X=[];for(let[K,W]of Object.entries($.props))if(W.type==="literal"){let U=typeof W.value==="string"?`"${W.value}"`:String(W.value);X.push(`${K}: ${U}`)}let J=X.length>0?`{ ${X.join(", ")} }`:"{}",Q=$.children.map((K)=>K.type==="text"?`"${K.props.text?.type==="literal"?K.props.text.value:""}"`:vF(K,Z+1)),G=Q.length>0?`,
|
|
18224
18224
|
${Y} [${Q.join(`,
|
|
18225
18225
|
${Y} `)}]`:"";return`Craft.create("${$.zigType}", ${J}${G})`}function aC($,Z,Y){if(Z.target==="universal"){let X=[];X.push("// Universal entry point"),X.push("");for(let[J,Q]of Y)X.push(`// --- ${J.toUpperCase()} ---`),X.push(`#if ${J.toUpperCase()}`),X.push(Q),X.push("#endif"),X.push("");return X.join(`
|
|
18226
|
-
`)}return Y.get(Z.target)||GK($,Z)}function oC($,Z,Y){let X=[];function J(Q){X.push({name:Q.zigType,hash:fF(JSON.stringify(Q.props)),props:Object.keys(Q.props),events:Array.from(Q.events.keys()),slots:[],isNative:Q.zigType.startsWith("craft.")});for(let G of Q.children)J(G)}return J(Z),{version:"1.0.0",components:X,entry:$.id,assets:[],styles:$.styles}}function tC($,Z){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}function gF(){return`id_${++eC}`}function fF($){let Z=0;for(let Y=0;Y<$.length;Y++){let X=$.charCodeAt(Y);Z=(Z<<5)-Z+X,Z=Z&Z}return Math.abs(Z).toString(36)}function $P($){return $.charAt(0).toUpperCase()+$.slice(1)}function ZP($){let Z=[],Y=/<script[^>]*>([\s\S]*?)<\/script>/gi,X;while((X=Y.exec($))!==null)Z.push(X[1]);return Z}function YP($){let Z=[],Y=/<style[^>]*>([\s\S]*?)<\/style>/gi,X;while((X=Y.exec($))!==null)Z.push(X[1]);return Z}function KK($){let Z=$.type==="component"?1:0;if($.children)for(let Y of $.children)Z+=KK(Y);return Z}function WK($){let Z=$.zigType.startsWith("craft.")?1:0;for(let Y of $.children)Z+=WK(Y);return Z}function hF($){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(Z)=>{console.log(`[craft-compiler] File changed: ${Z}`)}}}var UK,eC=0,XP,JP;var uF=D(()=>{UK=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{name:"variant",type:"string",required:!1,default:"primary"},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onclick",type:"callback",required:!1}],children:"single"}],["craft-text-input",{name:"TextInput",zigType:"craft.TextInput",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-textarea",{name:"TextArea",zigType:"craft.TextArea",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"rows",type:"number",required:!1,default:3},{name:"disabled",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-checkbox",{name:"Checkbox",zigType:"craft.Checkbox",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"label",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-select",{name:"Select",zigType:"craft.Select",props:[{name:"value",type:"string",required:!1},{name:"options",type:"array",required:!0},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-slider",{name:"Slider",zigType:"craft.Slider",props:[{name:"value",type:"number",required:!1,default:0},{name:"min",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"step",type:"number",required:!1,default:1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-toggle",{name:"Toggle",zigType:"craft.Toggle",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-modal",{name:"Modal",zigType:"craft.Modal",props:[{name:"open",type:"boolean",required:!1,default:!1},{name:"title",type:"string",required:!1},{name:"closable",type:"boolean",required:!1,default:!0},{name:"onclose",type:"callback",required:!1}],children:"multiple"}],["craft-alert",{name:"Alert",zigType:"craft.Alert",props:[{name:"variant",type:"string",required:!1,default:"info"},{name:"title",type:"string",required:!1},{name:"dismissible",type:"boolean",required:!1,default:!1}],children:"single"}],["craft-progress",{name:"ProgressBar",zigType:"craft.ProgressBar",props:[{name:"value",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"indeterminate",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-spinner",{name:"Spinner",zigType:"craft.Spinner",props:[{name:"size",type:"number",required:!1,default:24}],children:"none"}],["craft-avatar",{name:"Avatar",zigType:"craft.Avatar",props:[{name:"src",type:"string",required:!1},{name:"alt",type:"string",required:!1},{name:"size",type:"number",required:!1,default:40}],children:"none"}],["craft-badge",{name:"Badge",zigType:"craft.Badge",props:[{name:"variant",type:"string",required:!1,default:"default"}],children:"single"}],["craft-card",{name:"Card",zigType:"craft.Card",props:[{name:"padding",type:"number",required:!1,default:16}],children:"multiple"}],["craft-accordion",{name:"Accordion",zigType:"craft.Accordion",props:[{name:"title",type:"string",required:!0},{name:"open",type:"boolean",required:!1,default:!1}],children:"multiple"}],["craft-tabs",{name:"TabView",zigType:"craft.TabView",props:[{name:"activeTab",type:"number",required:!1,default:0},{name:"ontabchange",type:"callback",required:!1}],children:"multiple"}],["craft-tooltip",{name:"Tooltip",zigType:"craft.Tooltip",props:[{name:"content",type:"string",required:!0},{name:"position",type:"string",required:!1,default:"top"}],children:"single"}],["craft-date-picker",{name:"DatePicker",zigType:"craft.DatePicker",props:[{name:"value",type:"string",required:!1},{name:"min",type:"string",required:!1},{name:"max",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-time-picker",{name:"TimePicker",zigType:"craft.TimePicker",props:[{name:"value",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-color-picker",{name:"ColorPicker",zigType:"craft.ColorPicker",props:[{name:"value",type:"color",required:!1,default:"#000000"},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-data-table",{name:"DataTable",zigType:"craft.DataTable",props:[{name:"data",type:"array",required:!0},{name:"columns",type:"array",required:!0},{name:"sortable",type:"boolean",required:!1,default:!1},{name:"paginated",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-virtual-list",{name:"VirtualList",zigType:"craft.VirtualList",props:[{name:"items",type:"array",required:!0},{name:"itemHeight",type:"number",required:!1,default:48},{name:"renderItem",type:"callback",required:!0}],children:"none"}],["craft-tree-view",{name:"TreeView",zigType:"craft.TreeView",props:[{name:"data",type:"object",required:!0},{name:"expandable",type:"boolean",required:!1,default:!0}],children:"none"}]]);XP={compileToNative:bF,createHotReloadServer:hF,NATIVE_COMPONENTS:UK},JP=XP});import{spawn as pF}from"child_process";import k0 from"fs";import QP from"os";import t from"path";import x from"process";import{CLI as GP}from"@stacksjs/clapp";var r4="0.2.43";w6();fG();o2();XQ();O4();$Q();var __dirname="/home/runner/work/stx/stx/packages/stx/bin",q0=new GP("stx");function mF($){let Z=typeof $==="string"?Number.parseInt($,10):$;if(Number.isNaN(Z))return{isValid:!1,error:"Port must be a valid number",suggestion:"Try using a number between 1024 and 65535"};if(Z<1024||Z>65535)return{isValid:!1,error:"Port must be between 1024 and 65535",suggestion:"Try using a port between 1024 and 65535"};return{isValid:!0}}function cF($){try{if(!k0.existsSync($)){let Y=t.dirname($),X=t.basename($);if(k0.existsSync(Y)){let Q=k0.readdirSync(Y).filter((K)=>K.toLowerCase().includes(X.toLowerCase().substring(0,3))||K.endsWith(".stx")||K.endsWith(".md")),G=Q.length>0?`File not found. Similar files in ${Y}: ${Q.slice(0,3).join(", ")}`:`File not found. Directory ${Y} exists but doesn't contain the specified file.`;return{isValid:!1,error:`File does not exist: ${$}`,suggestion:G}}return{isValid:!1,error:`File does not exist: ${$}`,suggestion:"Check the file path and try again"}}if(k0.statSync($).isDirectory())return{isValid:!1,error:`Expected file but got directory: ${$}`,suggestion:"Specify a .stx or .md file path"};return{isValid:!0}}catch(Z){return{isValid:!1,error:`Cannot access file: ${$}`,suggestion:"Check file permissions and path"}}}function _K($){let Z=typeof $==="string"?Number.parseInt($,10):$;if(Number.isNaN(Z))return{isValid:!1,error:"Timeout must be a valid number",suggestion:"Specify timeout in milliseconds (e.g., 5000 for 5 seconds)"};if(Z<100)return{isValid:!1,error:"Timeout too short (minimum 100ms)",suggestion:"Use a timeout of at least 100ms"};if(Z>300000)return{isValid:!1,error:"Timeout too long (maximum 5 minutes)",suggestion:"Use a timeout of less than 300000ms (5 minutes)"};return{isValid:!0}}var r$=($)=>$.includes("*")||$.includes("?")||$.includes("{")||$.includes("["),KP=($)=>$.endsWith(".stx")||$.endsWith(".md");function n$($,Z=1){if(console.error(`\u274C ${$.error}`),$.suggestion)console.error(`\uD83D\uDCA1 suggestion: ${$.suggestion}`);x.exit(Z)}async function WP($,Z){try{let Y=["test"],X=[];if($&&$.length>0)for(let W of $)if(r$(W))try{let U=await Array.fromAsync(new Bun.Glob(W).scan({onlyFiles:!0,absolute:!0}));if(U.length===0)console.warn(`Warning: No files found matching pattern: ${W}`);else if(X.push(...U),Z.verbose)console.log(`Found ${U.length} file(s) matching pattern: ${W}`)}catch(U){return console.error(`Error expanding glob pattern ${W}:`,U),!1}else X.push(W);if(X.length===0)return console.error("Error: No test files found matching the provided patterns."),!1;if(Y.push(...X),Z.filter)Y.push("--pattern",Z.filter);if(Z.timeout)Y.push("--timeout",Z.timeout.toString());if(Z.reporter&&Z.reporter!=="default")if(Z.reporter==="junit"){let W=t.join(QP.tmpdir(),`stx-test-report-${Date.now()}.xml`);Y.push("--reporter",Z.reporter),Y.push("--reporter-outfile",W)}else console.warn(`Warning: Reporter '${Z.reporter}' is not supported. Using default reporter.`);if(Z.coverage)Y.push("--coverage");if(Z.watch)Y.push("--watch");Y.push("--preload",t.join(__dirname,"../../../test-utils/happy-dom.ts"));let J={...x.env,STX_TEST_MODE:"true",STX_TEST_UI:Z.ui?"true":"false",STX_TEST_VERBOSE:Z.verbose?"true":"false"},Q="bun";if(Z.verbose)console.log(`Running: ${Q} ${Y.join(" ")}`);let G=performance.now(),K=pF(Q,Y,{stdio:"inherit",shell:!1,env:J});return new Promise((W)=>{K.on("close",(U)=>{let B=((performance.now()-G)/1000).toFixed(2);if(U===0)W(!0);else W(!1)}),x.on("SIGINT",()=>{console.log(`
|
|
18226
|
+
`)}return Y.get(Z.target)||GK($,Z)}function oC($,Z,Y){let X=[];function J(Q){X.push({name:Q.zigType,hash:fF(JSON.stringify(Q.props)),props:Object.keys(Q.props),events:Array.from(Q.events.keys()),slots:[],isNative:Q.zigType.startsWith("craft.")});for(let G of Q.children)J(G)}return J(Z),{version:"1.0.0",components:X,entry:$.id,assets:[],styles:$.styles}}function tC($,Z){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}function gF(){return`id_${++eC}`}function fF($){let Z=0;for(let Y=0;Y<$.length;Y++){let X=$.charCodeAt(Y);Z=(Z<<5)-Z+X,Z=Z&Z}return Math.abs(Z).toString(36)}function $P($){return $.charAt(0).toUpperCase()+$.slice(1)}function ZP($){let Z=[],Y=/<script[^>]*>([\s\S]*?)<\/script>/gi,X;while((X=Y.exec($))!==null)Z.push(X[1]);return Z}function YP($){let Z=[],Y=/<style[^>]*>([\s\S]*?)<\/style>/gi,X;while((X=Y.exec($))!==null)Z.push(X[1]);return Z}function KK($){let Z=$.type==="component"?1:0;if($.children)for(let Y of $.children)Z+=KK(Y);return Z}function WK($){let Z=$.zigType.startsWith("craft.")?1:0;for(let Y of $.children)Z+=WK(Y);return Z}function hF($){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(Z)=>{console.log(`[craft-compiler] File changed: ${Z}`)}}}var UK,eC=0,XP,JP;var uF=D(()=>{UK=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{name:"variant",type:"string",required:!1,default:"primary"},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onclick",type:"callback",required:!1}],children:"single"}],["craft-text-input",{name:"TextInput",zigType:"craft.TextInput",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-textarea",{name:"TextArea",zigType:"craft.TextArea",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"rows",type:"number",required:!1,default:3},{name:"disabled",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-checkbox",{name:"Checkbox",zigType:"craft.Checkbox",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"label",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-select",{name:"Select",zigType:"craft.Select",props:[{name:"value",type:"string",required:!1},{name:"options",type:"array",required:!0},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-slider",{name:"Slider",zigType:"craft.Slider",props:[{name:"value",type:"number",required:!1,default:0},{name:"min",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"step",type:"number",required:!1,default:1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-toggle",{name:"Toggle",zigType:"craft.Toggle",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-modal",{name:"Modal",zigType:"craft.Modal",props:[{name:"open",type:"boolean",required:!1,default:!1},{name:"title",type:"string",required:!1},{name:"closable",type:"boolean",required:!1,default:!0},{name:"onclose",type:"callback",required:!1}],children:"multiple"}],["craft-alert",{name:"Alert",zigType:"craft.Alert",props:[{name:"variant",type:"string",required:!1,default:"info"},{name:"title",type:"string",required:!1},{name:"dismissible",type:"boolean",required:!1,default:!1}],children:"single"}],["craft-progress",{name:"ProgressBar",zigType:"craft.ProgressBar",props:[{name:"value",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"indeterminate",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-spinner",{name:"Spinner",zigType:"craft.Spinner",props:[{name:"size",type:"number",required:!1,default:24}],children:"none"}],["craft-avatar",{name:"Avatar",zigType:"craft.Avatar",props:[{name:"src",type:"string",required:!1},{name:"alt",type:"string",required:!1},{name:"size",type:"number",required:!1,default:40}],children:"none"}],["craft-badge",{name:"Badge",zigType:"craft.Badge",props:[{name:"variant",type:"string",required:!1,default:"default"}],children:"single"}],["craft-card",{name:"Card",zigType:"craft.Card",props:[{name:"padding",type:"number",required:!1,default:16}],children:"multiple"}],["craft-accordion",{name:"Accordion",zigType:"craft.Accordion",props:[{name:"title",type:"string",required:!0},{name:"open",type:"boolean",required:!1,default:!1}],children:"multiple"}],["craft-tabs",{name:"TabView",zigType:"craft.TabView",props:[{name:"activeTab",type:"number",required:!1,default:0},{name:"ontabchange",type:"callback",required:!1}],children:"multiple"}],["craft-tooltip",{name:"Tooltip",zigType:"craft.Tooltip",props:[{name:"content",type:"string",required:!0},{name:"position",type:"string",required:!1,default:"top"}],children:"single"}],["craft-date-picker",{name:"DatePicker",zigType:"craft.DatePicker",props:[{name:"value",type:"string",required:!1},{name:"min",type:"string",required:!1},{name:"max",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-time-picker",{name:"TimePicker",zigType:"craft.TimePicker",props:[{name:"value",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-color-picker",{name:"ColorPicker",zigType:"craft.ColorPicker",props:[{name:"value",type:"color",required:!1,default:"#000000"},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-data-table",{name:"DataTable",zigType:"craft.DataTable",props:[{name:"data",type:"array",required:!0},{name:"columns",type:"array",required:!0},{name:"sortable",type:"boolean",required:!1,default:!1},{name:"paginated",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-virtual-list",{name:"VirtualList",zigType:"craft.VirtualList",props:[{name:"items",type:"array",required:!0},{name:"itemHeight",type:"number",required:!1,default:48},{name:"renderItem",type:"callback",required:!0}],children:"none"}],["craft-tree-view",{name:"TreeView",zigType:"craft.TreeView",props:[{name:"data",type:"object",required:!0},{name:"expandable",type:"boolean",required:!1,default:!0}],children:"none"}]]);XP={compileToNative:bF,createHotReloadServer:hF,NATIVE_COMPONENTS:UK},JP=XP});import{spawn as pF}from"child_process";import k0 from"fs";import QP from"os";import t from"path";import x from"process";import{CLI as GP}from"@stacksjs/clapp";var r4="0.2.44";w6();fG();o2();XQ();O4();$Q();var __dirname="/home/runner/work/stx/stx/packages/stx/bin",q0=new GP("stx");function mF($){let Z=typeof $==="string"?Number.parseInt($,10):$;if(Number.isNaN(Z))return{isValid:!1,error:"Port must be a valid number",suggestion:"Try using a number between 1024 and 65535"};if(Z<1024||Z>65535)return{isValid:!1,error:"Port must be between 1024 and 65535",suggestion:"Try using a port between 1024 and 65535"};return{isValid:!0}}function cF($){try{if(!k0.existsSync($)){let Y=t.dirname($),X=t.basename($);if(k0.existsSync(Y)){let Q=k0.readdirSync(Y).filter((K)=>K.toLowerCase().includes(X.toLowerCase().substring(0,3))||K.endsWith(".stx")||K.endsWith(".md")),G=Q.length>0?`File not found. Similar files in ${Y}: ${Q.slice(0,3).join(", ")}`:`File not found. Directory ${Y} exists but doesn't contain the specified file.`;return{isValid:!1,error:`File does not exist: ${$}`,suggestion:G}}return{isValid:!1,error:`File does not exist: ${$}`,suggestion:"Check the file path and try again"}}if(k0.statSync($).isDirectory())return{isValid:!1,error:`Expected file but got directory: ${$}`,suggestion:"Specify a .stx or .md file path"};return{isValid:!0}}catch(Z){return{isValid:!1,error:`Cannot access file: ${$}`,suggestion:"Check file permissions and path"}}}function _K($){let Z=typeof $==="string"?Number.parseInt($,10):$;if(Number.isNaN(Z))return{isValid:!1,error:"Timeout must be a valid number",suggestion:"Specify timeout in milliseconds (e.g., 5000 for 5 seconds)"};if(Z<100)return{isValid:!1,error:"Timeout too short (minimum 100ms)",suggestion:"Use a timeout of at least 100ms"};if(Z>300000)return{isValid:!1,error:"Timeout too long (maximum 5 minutes)",suggestion:"Use a timeout of less than 300000ms (5 minutes)"};return{isValid:!0}}var r$=($)=>$.includes("*")||$.includes("?")||$.includes("{")||$.includes("["),KP=($)=>$.endsWith(".stx")||$.endsWith(".md");function n$($,Z=1){if(console.error(`\u274C ${$.error}`),$.suggestion)console.error(`\uD83D\uDCA1 suggestion: ${$.suggestion}`);x.exit(Z)}async function WP($,Z){try{let Y=["test"],X=[];if($&&$.length>0)for(let W of $)if(r$(W))try{let U=await Array.fromAsync(new Bun.Glob(W).scan({onlyFiles:!0,absolute:!0}));if(U.length===0)console.warn(`Warning: No files found matching pattern: ${W}`);else if(X.push(...U),Z.verbose)console.log(`Found ${U.length} file(s) matching pattern: ${W}`)}catch(U){return console.error(`Error expanding glob pattern ${W}:`,U),!1}else X.push(W);if(X.length===0)return console.error("Error: No test files found matching the provided patterns."),!1;if(Y.push(...X),Z.filter)Y.push("--pattern",Z.filter);if(Z.timeout)Y.push("--timeout",Z.timeout.toString());if(Z.reporter&&Z.reporter!=="default")if(Z.reporter==="junit"){let W=t.join(QP.tmpdir(),`stx-test-report-${Date.now()}.xml`);Y.push("--reporter",Z.reporter),Y.push("--reporter-outfile",W)}else console.warn(`Warning: Reporter '${Z.reporter}' is not supported. Using default reporter.`);if(Z.coverage)Y.push("--coverage");if(Z.watch)Y.push("--watch");Y.push("--preload",t.join(__dirname,"../../../test-utils/happy-dom.ts"));let J={...x.env,STX_TEST_MODE:"true",STX_TEST_UI:Z.ui?"true":"false",STX_TEST_VERBOSE:Z.verbose?"true":"false"},Q="bun";if(Z.verbose)console.log(`Running: ${Q} ${Y.join(" ")}`);let G=performance.now(),K=pF(Q,Y,{stdio:"inherit",shell:!1,env:J});return new Promise((W)=>{K.on("close",(U)=>{let B=((performance.now()-G)/1000).toFixed(2);if(U===0)W(!0);else W(!1)}),x.on("SIGINT",()=>{console.log(`
|
|
18227
18227
|
Test run interrupted`),K.kill("SIGINT"),x.exit(1)})})}catch(Y){return console.error("Error running tests:",Y instanceof Error?Y.message:String(Y)),!1}}var UP=x.argv.length>=3&&(KP(x.argv[2])&&k0.existsSync(x.argv[2])||r$(x.argv[2]));if(UP){let $=x.argv[2],Z={port:3000,watch:!0,cache:!0,markdown:{syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}}};for(let Y=3;Y<x.argv.length;Y++){let X=x.argv[Y];if(X==="--port"&&Y+1<x.argv.length){let J=mF(x.argv[++Y]);if(!J.isValid)n$(J);Z.port=Number.parseInt(x.argv[Y],10)}else if(X==="--no-watch")Z.watch=!1;else if(X==="--highlight-theme"&&Y+1<x.argv.length){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.defaultTheme=x.argv[++Y]}else if(X==="--no-highlight"){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.enabled=!1}else if(X==="--no-highlight-unknown"){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.highlightUnknownLanguages=!1}else if(X==="--no-cache")Z.cache=!1;else if(X==="--native")Z.native=!0}if(r$($))try{let Y=await Array.fromAsync(new Bun.Glob($).scan({onlyFiles:!0,absolute:!0})),X=$.endsWith(".stx")?Y.filter((K)=>K.endsWith(".stx")):$.endsWith(".md")?Y.filter((K)=>K.endsWith(".md")):Y.filter((K)=>K.endsWith(".stx")||K.endsWith(".md")),J=$.split("*")[0].replace(/\/$/,"")||".",Q=t.resolve(J);try{let K=new Bun.Glob("**/*.stx"),U=(await Array.fromAsync(K.scan({cwd:Q,onlyFiles:!0,absolute:!0}))).filter((_)=>/\[.+\]/.test(t.basename(_)));for(let _ of U)if(!X.includes(_))X.push(_)}catch{}if(X.length===0)console.error(`Error: No STX or Markdown files found matching pattern: ${$}`),x.exit(1);if(!await r7(X,Z))x.exit(1)}catch(Y){console.error("Failed to process files:",Y),x.exit(1)}else n7($,Z).catch((Y)=>{console.error("Failed to start dev server:",Y),x.exit(1)})}else{let $=function(X,J){let Q=[];for(let G=0;G<=J.length;G++)Q[G]=[G];for(let G=0;G<=X.length;G++)Q[0][G]=G;for(let G=1;G<=J.length;G++)for(let K=1;K<=X.length;K++)if(J.charAt(G-1)===X.charAt(K-1))Q[G][K]=Q[G-1][K-1];else Q[G][K]=Math.min(Q[G-1][K-1]+1,Q[G][K-1]+1,Q[G-1][K]+1);return Q[J.length][X.length]};q0.command("docs","Generate documentation for components, templates, and directives").option("--output <dir>","Output directory for documentation",{default:"docs"}).option("--format <format>","Documentation format (markdown, html, json)",{default:"markdown"}).option("--components-dir <dir>","Components directory",{default:"components"}).option("--templates-dir <dir>","Templates directory",{default:"."}).option("--no-components","Disable components documentation").option("--no-templates","Disable templates documentation").option("--no-directives","Disable directives documentation").option("--extra-content <content>","Extra content to include in documentation").example("stx docs --output docs --format html").action(async(X)=>{try{if(await a2(X))console.log("Documentation generated successfully."),x.exit(0);else console.error("Documentation generation failed."),x.exit(1)}catch(J){console.error("Error generating documentation:",J),x.exit(1)}}),q0.command("iconify <command>","Generate Iconify icon packages").option("--output <dir>","Output directory for generated packages",{default:"packages"}).option("--icons <icons>","Comma-separated list of specific icons to generate").example("stx iconify list").example("stx iconify generate mdi").example("stx iconify generate lucide --icons home,settings,user").action(async(X,J)=>{try{let{fetchCollections:Q,generatePackage:G}=await import("@stacksjs/iconify-generator");if(X==="list"){console.log(`
|
|
18228
18228
|
\uD83D\uDCDA Fetching available icon collections...
|
|
18229
18229
|
`);let K=await Q(),W=Object.entries(K).sort((U,_)=>_[1].total-U[1].total);console.log(`Available collections:
|
package/dist/index.js
CHANGED
|
@@ -281,7 +281,7 @@ catch (e) {
|
|
|
281
281
|
}
|
|
282
282
|
throw e;
|
|
283
283
|
}
|
|
284
|
-
`)(...Object.values(X))}catch{return}}function U0($){try{return k7($),!0}catch{return!1}}function k0($,Z){try{let Y=L0($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function j0($,Z){let Y=k7($);
|
|
284
|
+
`)(...Object.values(X))}catch{return}}function U0($){try{return k7($),!0}catch{return!1}}function k0($,Z){try{let Y=L0($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function j0($,Z){let Y=k7($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++)if(X.test(Z[K]))J.push(K),Q.push(Z[K]);let G=Function(...Q,`
|
|
285
285
|
'use strict';
|
|
286
286
|
try {
|
|
287
287
|
return ${Y};
|
|
@@ -292,7 +292,7 @@ catch (e) {
|
|
|
292
292
|
}
|
|
293
293
|
throw e;
|
|
294
294
|
}
|
|
295
|
-
`)}function D6($){let Z=$.trim(),Y=[/\beval\s*\(/i,/\bFunction\s*\(/i,/\bimport\s*\(/i,/\brequire\s*\(/i,/\bprocess\b/i,/\b__proto__\b/i,/\bconstructor\s*[.(]/i,/\bglobalThis\b/i,/\bwindow\b/i,/\bdocument\b/i,/\bfetch\s*\(/i,/\bBun\b/i,/\bDeno\b/i,/\bconsole\b/i,/\bthis\b/i,/\bReflect\b/i,/\bProxy\b/i,/\bprototype\b/i,/\.(bind|call|apply)\s*\(/i];for(let X of Y)if(X.test(Z))return!1;return!0}var YO,gQ,hQ,XO;var h0=D(()=>{YO={maxSanitizeDepth:10,allowBracketNotation:!1},gQ={...YO},hQ=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,/\bnew\s+/,/\bdelete\s+/,/\bthis\b/],XO=/[\w)\]]\s*\[\s*['"]/});function vZ(){dQ=0,k6.clear()}function S7($,Z){let Y=dQ++,X=`<!--__STX_${$.toUpperCase()}_${Y}__-->`;return k6.set(X,{type:$,expression:Z}),X}function fZ(){let $={};for(let[Z,Y]of k6)$[Z]={type:Y.type,expression:Y.expression};return $}function GO($){let Z={},Y=/<!--__STX_(EXPR|COND|RAW)_(\d+)__-->/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=X[1].toLowerCase(),G=k6.get(J);Z[J]={type:Q,expression:G?.expression||""}}return Z}function S6($,Z){let Y=$;for(let[X,J]of Z)Y=Y.split(X).join(J);return Y}function W5($){return $.includes("<!--__STX_")}var dQ=0,k6;var b7=D(()=>{k6=new Map});var P7={};Q0(P7,{usesSignalsInScript:()=>y7,unescapeHtml:()=>b6,registerFilters:()=>pQ,registerFilter:()=>gZ,processExpressions:()=>W1,interpolateScriptsInTemplate:()=>lQ,interpolateScriptExpressions:()=>dZ,getAllFilters:()=>hZ,evaluateExpression:()=>Y1,escapeHtml:()=>w0,defaultFilters:()=>_5,clearCustomFilters:()=>cQ,applyFilters:()=>uZ});function KO($){let Z=uQ.get($);if(!Z){let Y=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Z=new RegExp(`:${Y}(?!\\w)`,"g"),uQ.set($,Z)}return Z.lastIndex=0,Z}function gZ($,Z){if($ in _5)console.warn(`Filter "${$}" already exists as a built-in filter. Custom filter will take precedence.`);C7[$]=Z}function pQ($){for(let[Z,Y]of Object.entries($))gZ(Z,Y)}function hZ(){return{..._5,...C7}}function cQ(){for(let $ of Object.keys(C7))delete C7[$]}function w0($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function y7($){let Z=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,Y;while((Y=Z.exec($))!==null){let X=Y[1];if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/.test(X))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test($))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test($))return!0;return!1}function mQ($,Z){let Y=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console"],X=$.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),J="",Q=!1,G=0;for(let _=0;_<X.length;_++){let U=X[_];if(!Q&&U==="`"){Q=!0,G=0;continue}if(Q){if(U==="`"&&G===0){Q=!1;continue}if(U==="$"&&X[_+1]==="{"){G++,_++;continue}if(U==="}"&&G>0){G--;continue}continue}J+=U}X=J;let K=/\b([a-zA-Z_$][a-zA-Z0-9_$]*)\b/g,W;while((W=K.exec(X))!==null){let _=W[1];if(!X.substring(0,W.index).trimEnd().endsWith(".")){if(!Y.includes(_)&&!(_ in Z))return!1}}return!0}function dZ($,Z){let Y=$;return Y=Y.replace(/\{!!([\s\S]*?)!!\}/g,(X,J)=>{try{let Q=Y1(J,Z);if(Q===void 0)return X;return Q===null?"":String(Q)}catch{return X}}),Y=Y.replace(/\{\{([\s\S]*?)\}\}/g,(X,J)=>{let Q=J.trim();if(/^__[A-Z_]+__$/.test(Q))return X;try{let G=Y1(J,Z);if(G===void 0)return X;return JSON.stringify(G)}catch{return X}}),Y}function lQ($,Z,Y={}){return $.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(X,J,Q)=>{if(/\bsrc\s*=/.test(J))return X;if(/\bdata-raw\b/.test(J))return X;if(/\btype\s*=\s*["']application\/json["']/.test(J))return X;if(Y.skipServer&&/\bserver\b/.test(J))return X;let G=dZ(Q,Z);return`<script${J}>${G}</script>`})}function W1($,Z,Y){let X=$,J=[];X=X.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,(K)=>{if(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K))return K;let W=J.length;return J.push(K),`<!--__STX_STYLE_${W}__-->`});let Q=[];X=X.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,(K)=>{let W=Q.length;return Q.push(K),`<!--__STX_SCRIPT_EXPR_${W}__-->`});let G=y7($);X=X.replace(/\{\{\{([\s\S]*?)\}\}\}/g,(K,W,_)=>{try{let U=Y1(W,Z);return U!==void 0&&U!==null?String(U):""}catch(U){let B=U instanceof Error?U.message:String(U);return B0("Expression",`Error evaluating: {{{ ${W.trim()}}}}: ${B}`,Y,$,_,K)}}),X=X.replace(/\{!!([\s\S]*?)!!\}/g,(K,W,_)=>{try{let U=Y1(W,Z);if(U===void 0&&Z.__stx_buildMode==="compile")return S7("raw",W.trim());return U!==void 0&&U!==null?String(U):""}catch(U){if(Z.__stx_buildMode==="compile")return S7("raw",W.trim());let B=U instanceof Error?U.message:String(U);return B0("Expression",`Error evaluating: {!! ${W.trim()} !!}: ${B}`,Y,$,_,K)}}),X=X.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,(K)=>{if(K.startsWith("<!--__STX_SCRIPT_EXPR_"))return K;let W=Q.length;return Q.push(K),`<!--__STX_SCRIPT_EXPR_${W}__-->`}),X=X.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,(K)=>{if(K.startsWith("<!--__STX_STYLE_"))return K;if(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K))return K;let W=J.length;return J.push(K),`<!--__STX_STYLE_${W}__-->`}),X=X.replace(/\{\{([\s\S]*?)\}\}/g,(K,W,_)=>{let U=W.trim(),B=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],z=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,q=U.match(z)?.[1],H=q&&((q in Z)||B.includes(q)),O=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,F=U.match(O),L=F&&!B.includes(F[1])&&!(F[1]in Z);if(/^__[A-Z_]+__$/.test(U))return"";try{let V=Y1(W,Z);if(V===void 0&&G&&!mQ(U,Z))return K;if(V===void 0&&Z.__stx_buildMode==="compile"&&!G)return S7("expr",U);return V!==void 0&&V!==null?w0(String(V)):""}catch(V){if(G&&!mQ(U,Z))return K;if(L)return K;let A=V instanceof Error?V.message:String(V);return B0("Expression",`Error evaluating: {{ ${U} }}: ${A}`,Y,$,_,K)}});for(let K=0;K<Q.length;K++)X=X.replace(`<!--__STX_SCRIPT_EXPR_${K}__-->`,()=>Q[K]);for(let K=0;K<J.length;K++)X=X.replace(`<!--__STX_STYLE_${K}__-->`,()=>J[K]);return X}function uZ($,Z,Y){if(!Z.trim())return $;let X=$,J=Z.trim();while(J.length>0){let Q=J.match(/^(\w+)/);if(!Q)break;let G=Q[1];J=J.substring(G.length).trim();let K=C7[G]||_5[G];if(!K)throw Error(`Filter not found: ${G}. Available filters: ${Object.keys(hZ()).join(", ")}`);let W=[];if(J.startsWith(":")){let _=J.match(/^:([^|\s]+)/);if(_){let U=_[1].trim();try{let B=Number(U);W=[Number.isNaN(B)?U:B]}catch{W=[U]}J=J.substring(_[0].length).trim()}}else if(J.startsWith("(")){let _=1,U=1;while(_>0&&U<J.length){if(J[U]==="(")_++;if(J[U]===")")_--;U++}if(_===0){let B=J.substring(1,U-1).trim();if(B)try{if(B.startsWith("{")&&B.endsWith("}"))W=[Y1(`(${B})`,Y,!0)];else{let z=[],j="",q=null,H=0,O=0,F=0,L=!1;for(let V=0;V<B.length;V++){let A=B[V];if(L){j+=A,L=!1;continue}if(A==="\\"){j+=A,L=!0;continue}if(q){if(j+=A,A===q)q=null;continue}if(A==='"'||A==="'"||A==="`"){q=A,j+=A;continue}if(A==="(")H++;else if(A===")")H--;else if(A==="[")O++;else if(A==="]")O--;else if(A==="{")F++;else if(A==="}")F--;if(A===","&&H===0&&O===0&&F===0){z.push(j),j="";continue}j+=A}if(j)z.push(j);W=z.map((V)=>{let A=V.trim();return Y1(A,Y,!0)})}}catch{W=[B]}J=J.substring(U).trim()}}try{X=K(X,Y,...W)}catch(_){let U=_ instanceof Error?_.message:String(_);throw Error(`Error applying filter '${G}': ${U}`)}if(J.startsWith("|"))J=J.substring(1).trim();else break}return X}function WO($){let Z=!1,Y="",X=0,J=0,Q=0,G=!1;for(let K=0;K<$.length;K++){let W=$[K],_=$[K+1];if(Z&&G){G=!1;continue}if(Z&&W==="\\"){G=!0;continue}if(G=!1,(W==='"'||W==="'"||W==="`")&&!G){if(!Z)Z=!0,Y=W;else if(W===Y)Z=!1,Y="";continue}if(Z&&Y==="`"&&W==="$"&&_==="{"){let U=1;K+=2;while(K<$.length&&U>0){if($[K]==="{")U++;else if($[K]==="}")U--;if(U>0)K++}continue}if(Z)continue;if(W==="(")X++;else if(W===")")X--;else if(W==="[")J++;else if(W==="]")J--;else if(W==="{")Q++;else if(W==="}")Q--;if(W==="|"&&X===0&&J===0&&Q===0){if(_==="|"){K++;continue}if(_==="="){K++;continue}return K}}return-1}function Y1($,Z,Y=!1){try{let X=$.trim(),J=WO(X);if(J>0){let Q=X.substring(0,J).trim(),G=X.substring(J+1).trim(),K=Y1(Q,Z,!0);return uZ(K,G,Z)}if(!U0(X)){if(!Y)console.warn(`Potentially unsafe expression detected, using safe evaluator: ${X}`);return L0(X,Z)}try{let Q=Object.keys(Z),G=Object.values(Z);return j0(X,Q)(...G)}catch{return L0(X,Z)}}catch(X){if(X instanceof ReferenceError){let J=/(\b\w+)\s+is not defined/.exec(X.message);if(J){let Q=J[1],G=_O(Q,Object.keys(Z));if(G&&G!==Q)X.message=`${X.message} \u2014 did you mean '${G}'?`}}if(!Y)console.error(`Error evaluating expression: ${$}`,X);throw X}}function _O($,Z){let Y=null;for(let J of Z){if(J===$)continue;let Q=UO($,J);if(Y===null||Q<Y.dist)Y={key:J,dist:Q}}if(!Y)return null;let X=Math.max($.length,Y.key.length);if(Y.dist<=2||Y.dist/X<=0.35)return Y.key;return null}function UO($,Z){if($===Z)return 0;if($.length===0)return Z.length;if(Z.length===0)return $.length;let[Y,X]=$.length<Z.length?[$,Z]:[Z,$],J=Array(Y.length+1),Q=Array(Y.length+1);for(let G=0;G<=Y.length;G++)J[G]=G;for(let G=1;G<=X.length;G++){Q[0]=G;for(let K=1;K<=Y.length;K++){let W=Y[K-1]===X[G-1]?0:1;Q[K]=Math.min(Q[K-1]+1,J[K]+1,J[K-1]+W)}for(let K=0;K<=Y.length;K++)J[K]=Q[K]}return J[Y.length]}function b6($){if(!$)return"";return $.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'").replace(/&/g,"&")}var C7,uQ,_5;var d0=D(()=>{h0();q0();b7();C7={},uQ=new Map;_5={uppercase:($,Z)=>{return $!==void 0&&$!==null?String($).toUpperCase():""},lowercase:($,Z)=>{return $!==void 0&&$!==null?String($).toLowerCase():""},capitalize:($,Z)=>{if($===void 0||$===null)return"";let Y=String($);return Y.charAt(0).toUpperCase()+Y.slice(1)},number:($,Z,Y=0)=>{if($===void 0||$===null)return"";try{let X=Number($);return Number.isNaN(X)?"":X.toFixed(Number.parseInt(String(Y),10))}catch{return""}},fmt:($,Z,Y="en-US")=>{if($===void 0||$===null)return"";try{let X=Number($);if(Number.isNaN(X))return String($);return X.toLocaleString(Y)}catch{return String($)}},join:($,Z,Y=",")=>{if(!Array.isArray($))return"";return $.join(String(Y))},escape:($,Z)=>{if($===void 0||$===null)return"";return w0(String($))},translate:($,Z,Y={})=>{if(!Z||!Z.__translations)return $;let X=Z.__translations,J=Z.__i18nConfig?.fallbackToKey??!0,Q=String($).split("."),G=X;for(let W of Q){if(G===void 0||G===null)break;G=G[W]}if(G===void 0||G===null)return J?$:"";let K=String(G);return Object.entries(Y).forEach(([W,_])=>{K=K.replace(KO(W),String(_))}),K},t:($,Z,Y={})=>{return _5.translate($,Z,Y)},truncate:($,Z,Y=50,X="...")=>{if($===void 0||$===null)return"";let J=String($);if(J.length<=Y)return J;if(Y<=X.length)return X.substring(0,Y);return J.substring(0,Y-X.length)+X},date:($,Z,Y="short",X="en-US")=>{if($===void 0||$===null)return"";try{let J=$ instanceof Date?$:new Date($);if(Number.isNaN(J.getTime()))return String($);let Q={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(Y==="iso")return J.toISOString();return new Intl.DateTimeFormat(X,Q[Y]||Q.short).format(J)}catch{return String($)}},currency:($,Z,Y="USD",X="en-US")=>{if($===void 0||$===null)return"";try{let J=Number($);if(Number.isNaN(J))return String($);return new Intl.NumberFormat(X,{style:"currency",currency:Y}).format(J)}catch{return String($)}},pluralize:($,Z,Y,X)=>{let J=Number($);if(Number.isNaN(J))return Y;let Q=X||`${Y}s`;return J===1?Y:Q},first:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[0];return String($).charAt(0)},last:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[$.length-1];let Y=String($);return Y.charAt(Y.length-1)},length:($,Z)=>{if($===void 0||$===null)return 0;if(Array.isArray($)||typeof $==="string")return $.length;if($ instanceof Map||$ instanceof Set)return $.size;if(typeof $==="object")return Object.keys($).length;return 0},json:($,Z,Y=!1)=>{if($===void 0)return"undefined";if($===null)return"null";try{return Y?JSON.stringify($,null,2):JSON.stringify($)}catch{return String($)}},default:($,Z,Y="")=>{return $===void 0||$===null||$===""?Y:$},reverse:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return[...$].reverse();return String($).split("").reverse().join("")},slice:($,Z,Y=0,X)=>{if($===void 0||$===null)return"";if(Array.isArray($)||typeof $==="string")return $.slice(Y,X);return $},replace:($,Z,Y,X="")=>{if($===void 0||$===null)return"";let J=Y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String($).replace(new RegExp(J,"g"),()=>X)},stripTags:($,Z)=>{if($===void 0||$===null)return"";return String($).replace(/<[^>]*>/g,"")},urlencode:($,Z)=>{if($===void 0||$===null)return"";return encodeURIComponent(String($))},abs:($,Z)=>{let Y=Number($);return Number.isNaN(Y)?0:Math.abs(Y)},round:($,Z,Y=0)=>{let X=Number($);if(Number.isNaN(X))return 0;let J=10**Y;return Math.round(X*J)/J}}});class x7{cache=new Map;maxSize;constructor($=100){this.maxSize=$}get($){if(!this.cache.has($))return;let Z=this.cache.get($);return this.cache.delete($),this.cache.set($,Z),Z}set($,Z){if(this.cache.has($))this.cache.delete($);else if(this.cache.size>=this.maxSize){let Y=this.cache.keys().next().value;if(Y!==void 0)this.cache.delete(Y)}this.cache.set($,Z)}has($){return this.cache.has($)}delete($){return this.cache.delete($)}clear(){this.cache.clear()}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}function B5($,Z){if(Z?.includes("g"))return new RegExp($,Z);let Y=`${$}:${Z||""}`;if(!U5.has(Y)){if(U5.size>=BO){let X=U5.keys().next().value;if(X)U5.delete(X)}U5.set(Y,new RegExp($,Z))}return U5.get(Y)}class iQ{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator($){let Z=Array.from(new Set($)),Y=Z.sort().join(","),X=this.pool.find((K)=>K.context.join(",")===Y);if(X)return X.func;let J=this.fnCache,Q=this.fnCacheMaxSize,G=(...K)=>{return(W)=>{try{let _=`${Y}:${W}`,U=J.get(_);if(!U){if(J.size>=Q){let B=J.keys().next().value;if(B)J.delete(B)}U=Function(...Z,`
|
|
295
|
+
`);if(Q.length===Z.length)return G;return(...K)=>{let W=Array(J.length);for(let _=0;_<J.length;_++)W[_]=K[J[_]];return G(...W)}}function D6($){let Z=$.trim(),Y=[/\beval\s*\(/i,/\bFunction\s*\(/i,/\bimport\s*\(/i,/\brequire\s*\(/i,/\bprocess\b/i,/\b__proto__\b/i,/\bconstructor\s*[.(]/i,/\bglobalThis\b/i,/\bwindow\b/i,/\bdocument\b/i,/\bfetch\s*\(/i,/\bBun\b/i,/\bDeno\b/i,/\bconsole\b/i,/\bthis\b/i,/\bReflect\b/i,/\bProxy\b/i,/\bprototype\b/i,/\.(bind|call|apply)\s*\(/i];for(let X of Y)if(X.test(Z))return!1;return!0}var YO,gQ,hQ,XO;var h0=D(()=>{YO={maxSanitizeDepth:10,allowBracketNotation:!1},gQ={...YO},hQ=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,/\bnew\s+/,/\bdelete\s+/,/\bthis\b/],XO=/[\w)\]]\s*\[\s*['"]/});function vZ(){dQ=0,k6.clear()}function S7($,Z){let Y=dQ++,X=`<!--__STX_${$.toUpperCase()}_${Y}__-->`;return k6.set(X,{type:$,expression:Z}),X}function fZ(){let $={};for(let[Z,Y]of k6)$[Z]={type:Y.type,expression:Y.expression};return $}function GO($){let Z={},Y=/<!--__STX_(EXPR|COND|RAW)_(\d+)__-->/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=X[1].toLowerCase(),G=k6.get(J);Z[J]={type:Q,expression:G?.expression||""}}return Z}function S6($,Z){let Y=$;for(let[X,J]of Z)Y=Y.split(X).join(J);return Y}function W5($){return $.includes("<!--__STX_")}var dQ=0,k6;var b7=D(()=>{k6=new Map});var P7={};Q0(P7,{usesSignalsInScript:()=>y7,unescapeHtml:()=>b6,registerFilters:()=>pQ,registerFilter:()=>gZ,processExpressions:()=>W1,interpolateScriptsInTemplate:()=>lQ,interpolateScriptExpressions:()=>dZ,getAllFilters:()=>hZ,evaluateExpression:()=>Y1,escapeHtml:()=>w0,defaultFilters:()=>_5,clearCustomFilters:()=>cQ,applyFilters:()=>uZ});function KO($){let Z=uQ.get($);if(!Z){let Y=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Z=new RegExp(`:${Y}(?!\\w)`,"g"),uQ.set($,Z)}return Z.lastIndex=0,Z}function gZ($,Z){if($ in _5)console.warn(`Filter "${$}" already exists as a built-in filter. Custom filter will take precedence.`);C7[$]=Z}function pQ($){for(let[Z,Y]of Object.entries($))gZ(Z,Y)}function hZ(){return{..._5,...C7}}function cQ(){for(let $ of Object.keys(C7))delete C7[$]}function w0($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function y7($){let Z=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,Y;while((Y=Z.exec($))!==null){let X=Y[1];if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/.test(X))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test($))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test($))return!0;return!1}function mQ($,Z){let Y=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console"],X=$.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),J="",Q=!1,G=0;for(let _=0;_<X.length;_++){let U=X[_];if(!Q&&U==="`"){Q=!0,G=0;continue}if(Q){if(U==="`"&&G===0){Q=!1;continue}if(U==="$"&&X[_+1]==="{"){G++,_++;continue}if(U==="}"&&G>0){G--;continue}continue}J+=U}X=J;let K=/\b([a-zA-Z_$][a-zA-Z0-9_$]*)\b/g,W;while((W=K.exec(X))!==null){let _=W[1];if(!X.substring(0,W.index).trimEnd().endsWith(".")){if(!Y.includes(_)&&!(_ in Z))return!1}}return!0}function dZ($,Z){let Y=$;return Y=Y.replace(/\{!!([\s\S]*?)!!\}/g,(X,J)=>{try{let Q=Y1(J,Z);if(Q===void 0)return X;return Q===null?"":String(Q)}catch{return X}}),Y=Y.replace(/\{\{([\s\S]*?)\}\}/g,(X,J)=>{let Q=J.trim();if(/^__[A-Z_]+__$/.test(Q))return X;try{let G=Y1(J,Z);if(G===void 0)return X;return JSON.stringify(G)}catch{return X}}),Y}function lQ($,Z,Y={}){return $.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(X,J,Q)=>{if(/\bsrc\s*=/.test(J))return X;if(/\bdata-raw\b/.test(J))return X;if(/\btype\s*=\s*["']application\/json["']/.test(J))return X;if(Y.skipServer&&/\bserver\b/.test(J))return X;let G=dZ(Q,Z);return`<script${J}>${G}</script>`})}function W1($,Z,Y){let X=$,J=[];X=X.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,(K)=>{if(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K))return K;let W=J.length;return J.push(K),`<!--__STX_STYLE_${W}__-->`});let Q=[];X=X.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,(K)=>{let W=Q.length;return Q.push(K),`<!--__STX_SCRIPT_EXPR_${W}__-->`});let G=y7($);X=X.replace(/\{\{\{([\s\S]*?)\}\}\}/g,(K,W,_)=>{try{let U=Y1(W,Z);return U!==void 0&&U!==null?String(U):""}catch(U){let B=U instanceof Error?U.message:String(U);return B0("Expression",`Error evaluating: {{{ ${W.trim()}}}}: ${B}`,Y,$,_,K)}}),X=X.replace(/\{!!([\s\S]*?)!!\}/g,(K,W,_)=>{try{let U=Y1(W,Z);if(U===void 0&&Z.__stx_buildMode==="compile")return S7("raw",W.trim());return U!==void 0&&U!==null?String(U):""}catch(U){if(Z.__stx_buildMode==="compile")return S7("raw",W.trim());let B=U instanceof Error?U.message:String(U);return B0("Expression",`Error evaluating: {!! ${W.trim()} !!}: ${B}`,Y,$,_,K)}}),X=X.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,(K)=>{if(K.startsWith("<!--__STX_SCRIPT_EXPR_"))return K;let W=Q.length;return Q.push(K),`<!--__STX_SCRIPT_EXPR_${W}__-->`}),X=X.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,(K)=>{if(K.startsWith("<!--__STX_STYLE_"))return K;if(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K))return K;let W=J.length;return J.push(K),`<!--__STX_STYLE_${W}__-->`}),X=X.replace(/\{\{([\s\S]*?)\}\}/g,(K,W,_)=>{let U=W.trim(),B=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],z=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,q=U.match(z)?.[1],H=q&&((q in Z)||B.includes(q)),O=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,F=U.match(O),L=F&&!B.includes(F[1])&&!(F[1]in Z);if(/^__[A-Z_]+__$/.test(U))return"";try{let V=Y1(W,Z);if(V===void 0&&G&&!mQ(U,Z))return K;if(V===void 0&&Z.__stx_buildMode==="compile"&&!G)return S7("expr",U);return V!==void 0&&V!==null?w0(String(V)):""}catch(V){if(G&&!mQ(U,Z))return K;if(L)return K;let A=V instanceof Error?V.message:String(V);return B0("Expression",`Error evaluating: {{ ${U} }}: ${A}`,Y,$,_,K)}});for(let K=0;K<Q.length;K++)X=X.replace(`<!--__STX_SCRIPT_EXPR_${K}__-->`,()=>Q[K]);for(let K=0;K<J.length;K++)X=X.replace(`<!--__STX_STYLE_${K}__-->`,()=>J[K]);return X}function uZ($,Z,Y){if(!Z.trim())return $;let X=$,J=Z.trim();while(J.length>0){let Q=J.match(/^(\w+)/);if(!Q)break;let G=Q[1];J=J.substring(G.length).trim();let K=C7[G]||_5[G];if(!K)throw Error(`Filter not found: ${G}. Available filters: ${Object.keys(hZ()).join(", ")}`);let W=[];if(J.startsWith(":")){let _=J.match(/^:([^|\s]+)/);if(_){let U=_[1].trim();try{let B=Number(U);W=[Number.isNaN(B)?U:B]}catch{W=[U]}J=J.substring(_[0].length).trim()}}else if(J.startsWith("(")){let _=1,U=1;while(_>0&&U<J.length){if(J[U]==="(")_++;if(J[U]===")")_--;U++}if(_===0){let B=J.substring(1,U-1).trim();if(B)try{if(B.startsWith("{")&&B.endsWith("}"))W=[Y1(`(${B})`,Y,!0)];else{let z=[],j="",q=null,H=0,O=0,F=0,L=!1;for(let V=0;V<B.length;V++){let A=B[V];if(L){j+=A,L=!1;continue}if(A==="\\"){j+=A,L=!0;continue}if(q){if(j+=A,A===q)q=null;continue}if(A==='"'||A==="'"||A==="`"){q=A,j+=A;continue}if(A==="(")H++;else if(A===")")H--;else if(A==="[")O++;else if(A==="]")O--;else if(A==="{")F++;else if(A==="}")F--;if(A===","&&H===0&&O===0&&F===0){z.push(j),j="";continue}j+=A}if(j)z.push(j);W=z.map((V)=>{let A=V.trim();return Y1(A,Y,!0)})}}catch{W=[B]}J=J.substring(U).trim()}}try{X=K(X,Y,...W)}catch(_){let U=_ instanceof Error?_.message:String(_);throw Error(`Error applying filter '${G}': ${U}`)}if(J.startsWith("|"))J=J.substring(1).trim();else break}return X}function WO($){let Z=!1,Y="",X=0,J=0,Q=0,G=!1;for(let K=0;K<$.length;K++){let W=$[K],_=$[K+1];if(Z&&G){G=!1;continue}if(Z&&W==="\\"){G=!0;continue}if(G=!1,(W==='"'||W==="'"||W==="`")&&!G){if(!Z)Z=!0,Y=W;else if(W===Y)Z=!1,Y="";continue}if(Z&&Y==="`"&&W==="$"&&_==="{"){let U=1;K+=2;while(K<$.length&&U>0){if($[K]==="{")U++;else if($[K]==="}")U--;if(U>0)K++}continue}if(Z)continue;if(W==="(")X++;else if(W===")")X--;else if(W==="[")J++;else if(W==="]")J--;else if(W==="{")Q++;else if(W==="}")Q--;if(W==="|"&&X===0&&J===0&&Q===0){if(_==="|"){K++;continue}if(_==="="){K++;continue}return K}}return-1}function Y1($,Z,Y=!1){try{let X=$.trim(),J=WO(X);if(J>0){let Q=X.substring(0,J).trim(),G=X.substring(J+1).trim(),K=Y1(Q,Z,!0);return uZ(K,G,Z)}if(!U0(X)){if(!Y)console.warn(`Potentially unsafe expression detected, using safe evaluator: ${X}`);return L0(X,Z)}try{let Q=Object.keys(Z),G=Object.values(Z);return j0(X,Q)(...G)}catch{return L0(X,Z)}}catch(X){if(X instanceof ReferenceError){let J=/(\b\w+)\s+is not defined/.exec(X.message);if(J){let Q=J[1],G=_O(Q,Object.keys(Z));if(G&&G!==Q)X.message=`${X.message} \u2014 did you mean '${G}'?`}}if(!Y)console.error(`Error evaluating expression: ${$}`,X);throw X}}function _O($,Z){let Y=null;for(let J of Z){if(J===$)continue;let Q=UO($,J);if(Y===null||Q<Y.dist)Y={key:J,dist:Q}}if(!Y)return null;let X=Math.max($.length,Y.key.length);if(Y.dist<=2||Y.dist/X<=0.35)return Y.key;return null}function UO($,Z){if($===Z)return 0;if($.length===0)return Z.length;if(Z.length===0)return $.length;let[Y,X]=$.length<Z.length?[$,Z]:[Z,$],J=Array(Y.length+1),Q=Array(Y.length+1);for(let G=0;G<=Y.length;G++)J[G]=G;for(let G=1;G<=X.length;G++){Q[0]=G;for(let K=1;K<=Y.length;K++){let W=Y[K-1]===X[G-1]?0:1;Q[K]=Math.min(Q[K-1]+1,J[K]+1,J[K-1]+W)}for(let K=0;K<=Y.length;K++)J[K]=Q[K]}return J[Y.length]}function b6($){if(!$)return"";return $.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'").replace(/&/g,"&")}var C7,uQ,_5;var d0=D(()=>{h0();q0();b7();C7={},uQ=new Map;_5={uppercase:($,Z)=>{return $!==void 0&&$!==null?String($).toUpperCase():""},lowercase:($,Z)=>{return $!==void 0&&$!==null?String($).toLowerCase():""},capitalize:($,Z)=>{if($===void 0||$===null)return"";let Y=String($);return Y.charAt(0).toUpperCase()+Y.slice(1)},number:($,Z,Y=0)=>{if($===void 0||$===null)return"";try{let X=Number($);return Number.isNaN(X)?"":X.toFixed(Number.parseInt(String(Y),10))}catch{return""}},fmt:($,Z,Y="en-US")=>{if($===void 0||$===null)return"";try{let X=Number($);if(Number.isNaN(X))return String($);return X.toLocaleString(Y)}catch{return String($)}},join:($,Z,Y=",")=>{if(!Array.isArray($))return"";return $.join(String(Y))},escape:($,Z)=>{if($===void 0||$===null)return"";return w0(String($))},translate:($,Z,Y={})=>{if(!Z||!Z.__translations)return $;let X=Z.__translations,J=Z.__i18nConfig?.fallbackToKey??!0,Q=String($).split("."),G=X;for(let W of Q){if(G===void 0||G===null)break;G=G[W]}if(G===void 0||G===null)return J?$:"";let K=String(G);return Object.entries(Y).forEach(([W,_])=>{K=K.replace(KO(W),String(_))}),K},t:($,Z,Y={})=>{return _5.translate($,Z,Y)},truncate:($,Z,Y=50,X="...")=>{if($===void 0||$===null)return"";let J=String($);if(J.length<=Y)return J;if(Y<=X.length)return X.substring(0,Y);return J.substring(0,Y-X.length)+X},date:($,Z,Y="short",X="en-US")=>{if($===void 0||$===null)return"";try{let J=$ instanceof Date?$:new Date($);if(Number.isNaN(J.getTime()))return String($);let Q={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(Y==="iso")return J.toISOString();return new Intl.DateTimeFormat(X,Q[Y]||Q.short).format(J)}catch{return String($)}},currency:($,Z,Y="USD",X="en-US")=>{if($===void 0||$===null)return"";try{let J=Number($);if(Number.isNaN(J))return String($);return new Intl.NumberFormat(X,{style:"currency",currency:Y}).format(J)}catch{return String($)}},pluralize:($,Z,Y,X)=>{let J=Number($);if(Number.isNaN(J))return Y;let Q=X||`${Y}s`;return J===1?Y:Q},first:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[0];return String($).charAt(0)},last:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[$.length-1];let Y=String($);return Y.charAt(Y.length-1)},length:($,Z)=>{if($===void 0||$===null)return 0;if(Array.isArray($)||typeof $==="string")return $.length;if($ instanceof Map||$ instanceof Set)return $.size;if(typeof $==="object")return Object.keys($).length;return 0},json:($,Z,Y=!1)=>{if($===void 0)return"undefined";if($===null)return"null";try{return Y?JSON.stringify($,null,2):JSON.stringify($)}catch{return String($)}},default:($,Z,Y="")=>{return $===void 0||$===null||$===""?Y:$},reverse:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return[...$].reverse();return String($).split("").reverse().join("")},slice:($,Z,Y=0,X)=>{if($===void 0||$===null)return"";if(Array.isArray($)||typeof $==="string")return $.slice(Y,X);return $},replace:($,Z,Y,X="")=>{if($===void 0||$===null)return"";let J=Y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String($).replace(new RegExp(J,"g"),()=>X)},stripTags:($,Z)=>{if($===void 0||$===null)return"";return String($).replace(/<[^>]*>/g,"")},urlencode:($,Z)=>{if($===void 0||$===null)return"";return encodeURIComponent(String($))},abs:($,Z)=>{let Y=Number($);return Number.isNaN(Y)?0:Math.abs(Y)},round:($,Z,Y=0)=>{let X=Number($);if(Number.isNaN(X))return 0;let J=10**Y;return Math.round(X*J)/J}}});class x7{cache=new Map;maxSize;constructor($=100){this.maxSize=$}get($){if(!this.cache.has($))return;let Z=this.cache.get($);return this.cache.delete($),this.cache.set($,Z),Z}set($,Z){if(this.cache.has($))this.cache.delete($);else if(this.cache.size>=this.maxSize){let Y=this.cache.keys().next().value;if(Y!==void 0)this.cache.delete(Y)}this.cache.set($,Z)}has($){return this.cache.has($)}delete($){return this.cache.delete($)}clear(){this.cache.clear()}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}function B5($,Z){if(Z?.includes("g"))return new RegExp($,Z);let Y=`${$}:${Z||""}`;if(!U5.has(Y)){if(U5.size>=BO){let X=U5.keys().next().value;if(X)U5.delete(X)}U5.set(Y,new RegExp($,Z))}return U5.get(Y)}class iQ{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator($){let Z=Array.from(new Set($)),Y=Z.sort().join(","),X=this.pool.find((K)=>K.context.join(",")===Y);if(X)return X.func;let J=this.fnCache,Q=this.fnCacheMaxSize,G=(...K)=>{return(W)=>{try{let _=`${Y}:${W}`,U=J.get(_);if(!U){if(J.size>=Q){let B=J.keys().next().value;if(B)J.delete(B)}U=Function(...Z,`
|
|
296
296
|
'use strict';
|
|
297
297
|
try {
|
|
298
298
|
return ${W};
|
package/dist/pwa.js
CHANGED
|
@@ -1899,7 +1899,7 @@ catch (e) {
|
|
|
1899
1899
|
}
|
|
1900
1900
|
throw e;
|
|
1901
1901
|
}
|
|
1902
|
-
`)(...Object.values(X))}catch{return}}function e($){try{return p1($),!0}catch{return!1}}function z0($,Y){try{let Z=X0($,Y);if(Z&&typeof Z==="object"&&!Array.isArray(Z))return Z;return{}}catch{return{}}}function Y0($,Y){let Z=p1($);
|
|
1902
|
+
`)(...Object.values(X))}catch{return}}function e($){try{return p1($),!0}catch{return!1}}function z0($,Y){try{let Z=X0($,Y);if(Z&&typeof Z==="object"&&!Array.isArray(Z))return Z;return{}}catch{return{}}}function Y0($,Y){let Z=p1($),X=/^[A-Za-z_$][\w$]*$/,Q=[],J=[];for(let K=0;K<Y.length;K++)if(X.test(Y[K]))Q.push(K),J.push(Y[K]);let G=Function(...J,`
|
|
1903
1903
|
'use strict';
|
|
1904
1904
|
try {
|
|
1905
1905
|
return ${Z};
|
|
@@ -1910,7 +1910,7 @@ catch (e) {
|
|
|
1910
1910
|
}
|
|
1911
1911
|
throw e;
|
|
1912
1912
|
}
|
|
1913
|
-
`)}function R5($){let Y=$.trim(),Z=[/\beval\s*\(/i,/\bFunction\s*\(/i,/\bimport\s*\(/i,/\brequire\s*\(/i,/\bprocess\b/i,/\b__proto__\b/i,/\bconstructor\s*[.(]/i,/\bglobalThis\b/i,/\bwindow\b/i,/\bdocument\b/i,/\bfetch\s*\(/i,/\bBun\b/i,/\bDeno\b/i,/\bconsole\b/i,/\bthis\b/i,/\bReflect\b/i,/\bProxy\b/i,/\bprototype\b/i,/\.(bind|call|apply)\s*\(/i];for(let X of Z)if(X.test(Y))return!1;return!0}var HX,n7,o7,LX;var V0=S(()=>{HX={maxSanitizeDepth:10,allowBracketNotation:!1},n7={...HX},o7=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,/\bnew\s+/,/\bdelete\s+/,/\bthis\b/],LX=/[\w)\]]\s*\[\s*['"]/});function N5($,Y){let Z=RX++,X=`<!--__STX_${$.toUpperCase()}_${Z}__-->`;return NX.set(X,{type:$,expression:Y}),X}var RX=0,NX;var s7=S(()=>{NX=new Map});var Z3={};r(Z3,{usesSignalsInScript:()=>A5,unescapeHtml:()=>s9,registerFilters:()=>wX,registerFilter:()=>t7,processExpressions:()=>c0,interpolateScriptsInTemplate:()=>MX,interpolateScriptExpressions:()=>$3,getAllFilters:()=>e7,evaluateExpression:()=>m0,escapeHtml:()=>Q1,defaultFilters:()=>i1,clearCustomFilters:()=>TX,applyFilters:()=>Y3});function AX($){let Y=r7.get($);if(!Y){let Z=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Y=new RegExp(`:${Z}(?!\\w)`,"g"),r7.set($,Y)}return Y.lastIndex=0,Y}function t7($,Y){if($ in i1)console.warn(`Filter "${$}" already exists as a built-in filter. Custom filter will take precedence.`);c1[$]=Y}function wX($){for(let[Y,Z]of Object.entries($))t7(Y,Z)}function e7(){return{...i1,...c1}}function TX(){for(let $ of Object.keys(c1))delete c1[$]}function Q1($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function A5($){let Y=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,Z;while((Z=Y.exec($))!==null){let X=Z[1];if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/.test(X))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test($))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test($))return!0;return!1}function a7($,Y){let Z=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console"],X=$.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),Q="",J=!1,G=0;for(let _=0;_<X.length;_++){let U=X[_];if(!J&&U==="`"){J=!0,G=0;continue}if(J){if(U==="`"&&G===0){J=!1;continue}if(U==="$"&&X[_+1]==="{"){G++,_++;continue}if(U==="}"&&G>0){G--;continue}continue}Q+=U}X=Q;let K=/\b([a-zA-Z_$][a-zA-Z0-9_$]*)\b/g,q;while((q=K.exec(X))!==null){let _=q[1];if(!X.substring(0,q.index).trimEnd().endsWith(".")){if(!Z.includes(_)&&!(_ in Y))return!1}}return!0}function $3($,Y){let Z=$;return Z=Z.replace(/\{!!([\s\S]*?)!!\}/g,(X,Q)=>{try{let J=m0(Q,Y);if(J===void 0)return X;return J===null?"":String(J)}catch{return X}}),Z=Z.replace(/\{\{([\s\S]*?)\}\}/g,(X,Q)=>{let J=Q.trim();if(/^__[A-Z_]+__$/.test(J))return X;try{let G=m0(Q,Y);if(G===void 0)return X;return JSON.stringify(G)}catch{return X}}),Z}function MX($,Y,Z={}){return $.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(X,Q,J)=>{if(/\bsrc\s*=/.test(Q))return X;if(/\bdata-raw\b/.test(Q))return X;if(/\btype\s*=\s*["']application\/json["']/.test(Q))return X;if(Z.skipServer&&/\bserver\b/.test(Q))return X;let G=$3(J,Y);return`<script${Q}>${G}</script>`})}function c0($,Y,Z){let X=$,Q=[];X=X.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,(K)=>{if(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K))return K;let q=Q.length;return Q.push(K),`<!--__STX_STYLE_${q}__-->`});let J=[];X=X.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,(K)=>{let q=J.length;return J.push(K),`<!--__STX_SCRIPT_EXPR_${q}__-->`});let G=A5($);X=X.replace(/\{\{\{([\s\S]*?)\}\}\}/g,(K,q,_)=>{try{let U=m0(q,Y);return U!==void 0&&U!==null?String(U):""}catch(U){let W=U instanceof Error?U.message:String(U);return J0("Expression",`Error evaluating: {{{ ${q.trim()}}}}: ${W}`,Z,$,_,K)}}),X=X.replace(/\{!!([\s\S]*?)!!\}/g,(K,q,_)=>{try{let U=m0(q,Y);if(U===void 0&&Y.__stx_buildMode==="compile")return N5("raw",q.trim());return U!==void 0&&U!==null?String(U):""}catch(U){if(Y.__stx_buildMode==="compile")return N5("raw",q.trim());let W=U instanceof Error?U.message:String(U);return J0("Expression",`Error evaluating: {!! ${q.trim()} !!}: ${W}`,Z,$,_,K)}}),X=X.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,(K)=>{if(K.startsWith("<!--__STX_SCRIPT_EXPR_"))return K;let q=J.length;return J.push(K),`<!--__STX_SCRIPT_EXPR_${q}__-->`}),X=X.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,(K)=>{if(K.startsWith("<!--__STX_STYLE_"))return K;if(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K))return K;let q=Q.length;return Q.push(K),`<!--__STX_STYLE_${q}__-->`}),X=X.replace(/\{\{([\s\S]*?)\}\}/g,(K,q,_)=>{let U=q.trim(),W=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],B=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,z=U.match(B)?.[1],O=z&&((z in Y)||W.includes(z)),L=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,F=U.match(L),H=F&&!W.includes(F[1])&&!(F[1]in Y);if(/^__[A-Z_]+__$/.test(U))return"";try{let V=m0(q,Y);if(V===void 0&&G&&!a7(U,Y))return K;if(V===void 0&&Y.__stx_buildMode==="compile"&&!G)return N5("expr",U);return V!==void 0&&V!==null?Q1(String(V)):""}catch(V){if(G&&!a7(U,Y))return K;if(H)return K;let N=V instanceof Error?V.message:String(V);return J0("Expression",`Error evaluating: {{ ${U} }}: ${N}`,Z,$,_,K)}});for(let K=0;K<J.length;K++)X=X.replace(`<!--__STX_SCRIPT_EXPR_${K}__-->`,()=>J[K]);for(let K=0;K<Q.length;K++)X=X.replace(`<!--__STX_STYLE_${K}__-->`,()=>Q[K]);return X}function Y3($,Y,Z){if(!Y.trim())return $;let X=$,Q=Y.trim();while(Q.length>0){let J=Q.match(/^(\w+)/);if(!J)break;let G=J[1];Q=Q.substring(G.length).trim();let K=c1[G]||i1[G];if(!K)throw Error(`Filter not found: ${G}. Available filters: ${Object.keys(e7()).join(", ")}`);let q=[];if(Q.startsWith(":")){let _=Q.match(/^:([^|\s]+)/);if(_){let U=_[1].trim();try{let W=Number(U);q=[Number.isNaN(W)?U:W]}catch{q=[U]}Q=Q.substring(_[0].length).trim()}}else if(Q.startsWith("(")){let _=1,U=1;while(_>0&&U<Q.length){if(Q[U]==="(")_++;if(Q[U]===")")_--;U++}if(_===0){let W=Q.substring(1,U-1).trim();if(W)try{if(W.startsWith("{")&&W.endsWith("}"))q=[m0(`(${W})`,Z,!0)];else{let B=[],j="",z=null,O=0,L=0,F=0,H=!1;for(let V=0;V<W.length;V++){let N=W[V];if(H){j+=N,H=!1;continue}if(N==="\\"){j+=N,H=!0;continue}if(z){if(j+=N,N===z)z=null;continue}if(N==='"'||N==="'"||N==="`"){z=N,j+=N;continue}if(N==="(")O++;else if(N===")")O--;else if(N==="[")L++;else if(N==="]")L--;else if(N==="{")F++;else if(N==="}")F--;if(N===","&&O===0&&L===0&&F===0){B.push(j),j="";continue}j+=N}if(j)B.push(j);q=B.map((V)=>{let N=V.trim();return m0(N,Z,!0)})}}catch{q=[W]}Q=Q.substring(U).trim()}}try{X=K(X,Z,...q)}catch(_){let U=_ instanceof Error?_.message:String(_);throw Error(`Error applying filter '${G}': ${U}`)}if(Q.startsWith("|"))Q=Q.substring(1).trim();else break}return X}function IX($){let Y=!1,Z="",X=0,Q=0,J=0,G=!1;for(let K=0;K<$.length;K++){let q=$[K],_=$[K+1];if(Y&&G){G=!1;continue}if(Y&&q==="\\"){G=!0;continue}if(G=!1,(q==='"'||q==="'"||q==="`")&&!G){if(!Y)Y=!0,Z=q;else if(q===Z)Y=!1,Z="";continue}if(Y&&Z==="`"&&q==="$"&&_==="{"){let U=1;K+=2;while(K<$.length&&U>0){if($[K]==="{")U++;else if($[K]==="}")U--;if(U>0)K++}continue}if(Y)continue;if(q==="(")X++;else if(q===")")X--;else if(q==="[")Q++;else if(q==="]")Q--;else if(q==="{")J++;else if(q==="}")J--;if(q==="|"&&X===0&&Q===0&&J===0){if(_==="|"){K++;continue}if(_==="="){K++;continue}return K}}return-1}function m0($,Y,Z=!1){try{let X=$.trim(),Q=IX(X);if(Q>0){let J=X.substring(0,Q).trim(),G=X.substring(Q+1).trim(),K=m0(J,Y,!0);return Y3(K,G,Y)}if(!e(X)){if(!Z)console.warn(`Potentially unsafe expression detected, using safe evaluator: ${X}`);return X0(X,Y)}try{let J=Object.keys(Y),G=Object.values(Y);return Y0(X,J)(...G)}catch{return X0(X,Y)}}catch(X){if(X instanceof ReferenceError){let Q=/(\b\w+)\s+is not defined/.exec(X.message);if(Q){let J=Q[1],G=EX(J,Object.keys(Y));if(G&&G!==J)X.message=`${X.message} \u2014 did you mean '${G}'?`}}if(!Z)console.error(`Error evaluating expression: ${$}`,X);throw X}}function EX($,Y){let Z=null;for(let Q of Y){if(Q===$)continue;let J=DX($,Q);if(Z===null||J<Z.dist)Z={key:Q,dist:J}}if(!Z)return null;let X=Math.max($.length,Z.key.length);if(Z.dist<=2||Z.dist/X<=0.35)return Z.key;return null}function DX($,Y){if($===Y)return 0;if($.length===0)return Y.length;if(Y.length===0)return $.length;let[Z,X]=$.length<Y.length?[$,Y]:[Y,$],Q=Array(Z.length+1),J=Array(Z.length+1);for(let G=0;G<=Z.length;G++)Q[G]=G;for(let G=1;G<=X.length;G++){J[0]=G;for(let K=1;K<=Z.length;K++){let q=Z[K-1]===X[G-1]?0:1;J[K]=Math.min(J[K-1]+1,Q[K]+1,Q[K-1]+q)}for(let K=0;K<=Z.length;K++)Q[K]=J[K]}return Q[Z.length]}function s9($){if(!$)return"";return $.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'").replace(/&/g,"&")}var c1,r7,i1;var i0=S(()=>{V0();H0();s7();c1={},r7=new Map;i1={uppercase:($,Y)=>{return $!==void 0&&$!==null?String($).toUpperCase():""},lowercase:($,Y)=>{return $!==void 0&&$!==null?String($).toLowerCase():""},capitalize:($,Y)=>{if($===void 0||$===null)return"";let Z=String($);return Z.charAt(0).toUpperCase()+Z.slice(1)},number:($,Y,Z=0)=>{if($===void 0||$===null)return"";try{let X=Number($);return Number.isNaN(X)?"":X.toFixed(Number.parseInt(String(Z),10))}catch{return""}},fmt:($,Y,Z="en-US")=>{if($===void 0||$===null)return"";try{let X=Number($);if(Number.isNaN(X))return String($);return X.toLocaleString(Z)}catch{return String($)}},join:($,Y,Z=",")=>{if(!Array.isArray($))return"";return $.join(String(Z))},escape:($,Y)=>{if($===void 0||$===null)return"";return Q1(String($))},translate:($,Y,Z={})=>{if(!Y||!Y.__translations)return $;let X=Y.__translations,Q=Y.__i18nConfig?.fallbackToKey??!0,J=String($).split("."),G=X;for(let q of J){if(G===void 0||G===null)break;G=G[q]}if(G===void 0||G===null)return Q?$:"";let K=String(G);return Object.entries(Z).forEach(([q,_])=>{K=K.replace(AX(q),String(_))}),K},t:($,Y,Z={})=>{return i1.translate($,Y,Z)},truncate:($,Y,Z=50,X="...")=>{if($===void 0||$===null)return"";let Q=String($);if(Q.length<=Z)return Q;if(Z<=X.length)return X.substring(0,Z);return Q.substring(0,Z-X.length)+X},date:($,Y,Z="short",X="en-US")=>{if($===void 0||$===null)return"";try{let Q=$ instanceof Date?$:new Date($);if(Number.isNaN(Q.getTime()))return String($);let J={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(Z==="iso")return Q.toISOString();return new Intl.DateTimeFormat(X,J[Z]||J.short).format(Q)}catch{return String($)}},currency:($,Y,Z="USD",X="en-US")=>{if($===void 0||$===null)return"";try{let Q=Number($);if(Number.isNaN(Q))return String($);return new Intl.NumberFormat(X,{style:"currency",currency:Z}).format(Q)}catch{return String($)}},pluralize:($,Y,Z,X)=>{let Q=Number($);if(Number.isNaN(Q))return Z;let J=X||`${Z}s`;return Q===1?Z:J},first:($,Y)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[0];return String($).charAt(0)},last:($,Y)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[$.length-1];let Z=String($);return Z.charAt(Z.length-1)},length:($,Y)=>{if($===void 0||$===null)return 0;if(Array.isArray($)||typeof $==="string")return $.length;if($ instanceof Map||$ instanceof Set)return $.size;if(typeof $==="object")return Object.keys($).length;return 0},json:($,Y,Z=!1)=>{if($===void 0)return"undefined";if($===null)return"null";try{return Z?JSON.stringify($,null,2):JSON.stringify($)}catch{return String($)}},default:($,Y,Z="")=>{return $===void 0||$===null||$===""?Z:$},reverse:($,Y)=>{if($===void 0||$===null)return"";if(Array.isArray($))return[...$].reverse();return String($).split("").reverse().join("")},slice:($,Y,Z=0,X)=>{if($===void 0||$===null)return"";if(Array.isArray($)||typeof $==="string")return $.slice(Z,X);return $},replace:($,Y,Z,X="")=>{if($===void 0||$===null)return"";let Q=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String($).replace(new RegExp(Q,"g"),()=>X)},stripTags:($,Y)=>{if($===void 0||$===null)return"";return String($).replace(/<[^>]*>/g,"")},urlencode:($,Y)=>{if($===void 0||$===null)return"";return encodeURIComponent(String($))},abs:($,Y)=>{let Z=Number($);return Number.isNaN(Z)?0:Math.abs(Z)},round:($,Y,Z=0)=>{let X=Number($);if(Number.isNaN(X))return 0;let Q=10**Z;return Math.round(X*Q)/Q}}});class n1{cache=new Map;maxSize;constructor($=100){this.maxSize=$}get($){if(!this.cache.has($))return;let Y=this.cache.get($);return this.cache.delete($),this.cache.set($,Y),Y}set($,Y){if(this.cache.has($))this.cache.delete($);else if(this.cache.size>=this.maxSize){let Z=this.cache.keys().next().value;if(Z!==void 0)this.cache.delete(Z)}this.cache.set($,Y)}has($){return this.cache.has($)}delete($){return this.cache.delete($)}clear(){this.cache.clear()}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}function w1($,Y){if(Y?.includes("g"))return new RegExp($,Y);let Z=`${$}:${Y||""}`;if(!A1.has(Z)){if(A1.size>=kX){let X=A1.keys().next().value;if(X)A1.delete(X)}A1.set(Z,new RegExp($,Y))}return A1.get(Z)}class X3{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator($){let Y=Array.from(new Set($)),Z=Y.sort().join(","),X=this.pool.find((K)=>K.context.join(",")===Z);if(X)return X.func;let Q=this.fnCache,J=this.fnCacheMaxSize,G=(...K)=>{return(q)=>{try{let _=`${Z}:${q}`,U=Q.get(_);if(!U){if(Q.size>=J){let W=Q.keys().next().value;if(W)Q.delete(W)}U=Function(...Y,`
|
|
1913
|
+
`);if(J.length===Y.length)return G;return(...K)=>{let q=Array(Q.length);for(let _=0;_<Q.length;_++)q[_]=K[Q[_]];return G(...q)}}function R5($){let Y=$.trim(),Z=[/\beval\s*\(/i,/\bFunction\s*\(/i,/\bimport\s*\(/i,/\brequire\s*\(/i,/\bprocess\b/i,/\b__proto__\b/i,/\bconstructor\s*[.(]/i,/\bglobalThis\b/i,/\bwindow\b/i,/\bdocument\b/i,/\bfetch\s*\(/i,/\bBun\b/i,/\bDeno\b/i,/\bconsole\b/i,/\bthis\b/i,/\bReflect\b/i,/\bProxy\b/i,/\bprototype\b/i,/\.(bind|call|apply)\s*\(/i];for(let X of Z)if(X.test(Y))return!1;return!0}var HX,n7,o7,LX;var V0=S(()=>{HX={maxSanitizeDepth:10,allowBracketNotation:!1},n7={...HX},o7=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,/\bnew\s+/,/\bdelete\s+/,/\bthis\b/],LX=/[\w)\]]\s*\[\s*['"]/});function N5($,Y){let Z=RX++,X=`<!--__STX_${$.toUpperCase()}_${Z}__-->`;return NX.set(X,{type:$,expression:Y}),X}var RX=0,NX;var s7=S(()=>{NX=new Map});var Z3={};r(Z3,{usesSignalsInScript:()=>A5,unescapeHtml:()=>s9,registerFilters:()=>wX,registerFilter:()=>t7,processExpressions:()=>c0,interpolateScriptsInTemplate:()=>MX,interpolateScriptExpressions:()=>$3,getAllFilters:()=>e7,evaluateExpression:()=>m0,escapeHtml:()=>Q1,defaultFilters:()=>i1,clearCustomFilters:()=>TX,applyFilters:()=>Y3});function AX($){let Y=r7.get($);if(!Y){let Z=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Y=new RegExp(`:${Z}(?!\\w)`,"g"),r7.set($,Y)}return Y.lastIndex=0,Y}function t7($,Y){if($ in i1)console.warn(`Filter "${$}" already exists as a built-in filter. Custom filter will take precedence.`);c1[$]=Y}function wX($){for(let[Y,Z]of Object.entries($))t7(Y,Z)}function e7(){return{...i1,...c1}}function TX(){for(let $ of Object.keys(c1))delete c1[$]}function Q1($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function A5($){let Y=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,Z;while((Z=Y.exec($))!==null){let X=Z[1];if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/.test(X))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test($))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test($))return!0;return!1}function a7($,Y){let Z=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console"],X=$.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),Q="",J=!1,G=0;for(let _=0;_<X.length;_++){let U=X[_];if(!J&&U==="`"){J=!0,G=0;continue}if(J){if(U==="`"&&G===0){J=!1;continue}if(U==="$"&&X[_+1]==="{"){G++,_++;continue}if(U==="}"&&G>0){G--;continue}continue}Q+=U}X=Q;let K=/\b([a-zA-Z_$][a-zA-Z0-9_$]*)\b/g,q;while((q=K.exec(X))!==null){let _=q[1];if(!X.substring(0,q.index).trimEnd().endsWith(".")){if(!Z.includes(_)&&!(_ in Y))return!1}}return!0}function $3($,Y){let Z=$;return Z=Z.replace(/\{!!([\s\S]*?)!!\}/g,(X,Q)=>{try{let J=m0(Q,Y);if(J===void 0)return X;return J===null?"":String(J)}catch{return X}}),Z=Z.replace(/\{\{([\s\S]*?)\}\}/g,(X,Q)=>{let J=Q.trim();if(/^__[A-Z_]+__$/.test(J))return X;try{let G=m0(Q,Y);if(G===void 0)return X;return JSON.stringify(G)}catch{return X}}),Z}function MX($,Y,Z={}){return $.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(X,Q,J)=>{if(/\bsrc\s*=/.test(Q))return X;if(/\bdata-raw\b/.test(Q))return X;if(/\btype\s*=\s*["']application\/json["']/.test(Q))return X;if(Z.skipServer&&/\bserver\b/.test(Q))return X;let G=$3(J,Y);return`<script${Q}>${G}</script>`})}function c0($,Y,Z){let X=$,Q=[];X=X.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,(K)=>{if(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K))return K;let q=Q.length;return Q.push(K),`<!--__STX_STYLE_${q}__-->`});let J=[];X=X.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,(K)=>{let q=J.length;return J.push(K),`<!--__STX_SCRIPT_EXPR_${q}__-->`});let G=A5($);X=X.replace(/\{\{\{([\s\S]*?)\}\}\}/g,(K,q,_)=>{try{let U=m0(q,Y);return U!==void 0&&U!==null?String(U):""}catch(U){let W=U instanceof Error?U.message:String(U);return J0("Expression",`Error evaluating: {{{ ${q.trim()}}}}: ${W}`,Z,$,_,K)}}),X=X.replace(/\{!!([\s\S]*?)!!\}/g,(K,q,_)=>{try{let U=m0(q,Y);if(U===void 0&&Y.__stx_buildMode==="compile")return N5("raw",q.trim());return U!==void 0&&U!==null?String(U):""}catch(U){if(Y.__stx_buildMode==="compile")return N5("raw",q.trim());let W=U instanceof Error?U.message:String(U);return J0("Expression",`Error evaluating: {!! ${q.trim()} !!}: ${W}`,Z,$,_,K)}}),X=X.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,(K)=>{if(K.startsWith("<!--__STX_SCRIPT_EXPR_"))return K;let q=J.length;return J.push(K),`<!--__STX_SCRIPT_EXPR_${q}__-->`}),X=X.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,(K)=>{if(K.startsWith("<!--__STX_STYLE_"))return K;if(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K))return K;let q=Q.length;return Q.push(K),`<!--__STX_STYLE_${q}__-->`}),X=X.replace(/\{\{([\s\S]*?)\}\}/g,(K,q,_)=>{let U=q.trim(),W=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],B=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,z=U.match(B)?.[1],O=z&&((z in Y)||W.includes(z)),L=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,F=U.match(L),H=F&&!W.includes(F[1])&&!(F[1]in Y);if(/^__[A-Z_]+__$/.test(U))return"";try{let V=m0(q,Y);if(V===void 0&&G&&!a7(U,Y))return K;if(V===void 0&&Y.__stx_buildMode==="compile"&&!G)return N5("expr",U);return V!==void 0&&V!==null?Q1(String(V)):""}catch(V){if(G&&!a7(U,Y))return K;if(H)return K;let N=V instanceof Error?V.message:String(V);return J0("Expression",`Error evaluating: {{ ${U} }}: ${N}`,Z,$,_,K)}});for(let K=0;K<J.length;K++)X=X.replace(`<!--__STX_SCRIPT_EXPR_${K}__-->`,()=>J[K]);for(let K=0;K<Q.length;K++)X=X.replace(`<!--__STX_STYLE_${K}__-->`,()=>Q[K]);return X}function Y3($,Y,Z){if(!Y.trim())return $;let X=$,Q=Y.trim();while(Q.length>0){let J=Q.match(/^(\w+)/);if(!J)break;let G=J[1];Q=Q.substring(G.length).trim();let K=c1[G]||i1[G];if(!K)throw Error(`Filter not found: ${G}. Available filters: ${Object.keys(e7()).join(", ")}`);let q=[];if(Q.startsWith(":")){let _=Q.match(/^:([^|\s]+)/);if(_){let U=_[1].trim();try{let W=Number(U);q=[Number.isNaN(W)?U:W]}catch{q=[U]}Q=Q.substring(_[0].length).trim()}}else if(Q.startsWith("(")){let _=1,U=1;while(_>0&&U<Q.length){if(Q[U]==="(")_++;if(Q[U]===")")_--;U++}if(_===0){let W=Q.substring(1,U-1).trim();if(W)try{if(W.startsWith("{")&&W.endsWith("}"))q=[m0(`(${W})`,Z,!0)];else{let B=[],j="",z=null,O=0,L=0,F=0,H=!1;for(let V=0;V<W.length;V++){let N=W[V];if(H){j+=N,H=!1;continue}if(N==="\\"){j+=N,H=!0;continue}if(z){if(j+=N,N===z)z=null;continue}if(N==='"'||N==="'"||N==="`"){z=N,j+=N;continue}if(N==="(")O++;else if(N===")")O--;else if(N==="[")L++;else if(N==="]")L--;else if(N==="{")F++;else if(N==="}")F--;if(N===","&&O===0&&L===0&&F===0){B.push(j),j="";continue}j+=N}if(j)B.push(j);q=B.map((V)=>{let N=V.trim();return m0(N,Z,!0)})}}catch{q=[W]}Q=Q.substring(U).trim()}}try{X=K(X,Z,...q)}catch(_){let U=_ instanceof Error?_.message:String(_);throw Error(`Error applying filter '${G}': ${U}`)}if(Q.startsWith("|"))Q=Q.substring(1).trim();else break}return X}function IX($){let Y=!1,Z="",X=0,Q=0,J=0,G=!1;for(let K=0;K<$.length;K++){let q=$[K],_=$[K+1];if(Y&&G){G=!1;continue}if(Y&&q==="\\"){G=!0;continue}if(G=!1,(q==='"'||q==="'"||q==="`")&&!G){if(!Y)Y=!0,Z=q;else if(q===Z)Y=!1,Z="";continue}if(Y&&Z==="`"&&q==="$"&&_==="{"){let U=1;K+=2;while(K<$.length&&U>0){if($[K]==="{")U++;else if($[K]==="}")U--;if(U>0)K++}continue}if(Y)continue;if(q==="(")X++;else if(q===")")X--;else if(q==="[")Q++;else if(q==="]")Q--;else if(q==="{")J++;else if(q==="}")J--;if(q==="|"&&X===0&&Q===0&&J===0){if(_==="|"){K++;continue}if(_==="="){K++;continue}return K}}return-1}function m0($,Y,Z=!1){try{let X=$.trim(),Q=IX(X);if(Q>0){let J=X.substring(0,Q).trim(),G=X.substring(Q+1).trim(),K=m0(J,Y,!0);return Y3(K,G,Y)}if(!e(X)){if(!Z)console.warn(`Potentially unsafe expression detected, using safe evaluator: ${X}`);return X0(X,Y)}try{let J=Object.keys(Y),G=Object.values(Y);return Y0(X,J)(...G)}catch{return X0(X,Y)}}catch(X){if(X instanceof ReferenceError){let Q=/(\b\w+)\s+is not defined/.exec(X.message);if(Q){let J=Q[1],G=EX(J,Object.keys(Y));if(G&&G!==J)X.message=`${X.message} \u2014 did you mean '${G}'?`}}if(!Z)console.error(`Error evaluating expression: ${$}`,X);throw X}}function EX($,Y){let Z=null;for(let Q of Y){if(Q===$)continue;let J=DX($,Q);if(Z===null||J<Z.dist)Z={key:Q,dist:J}}if(!Z)return null;let X=Math.max($.length,Z.key.length);if(Z.dist<=2||Z.dist/X<=0.35)return Z.key;return null}function DX($,Y){if($===Y)return 0;if($.length===0)return Y.length;if(Y.length===0)return $.length;let[Z,X]=$.length<Y.length?[$,Y]:[Y,$],Q=Array(Z.length+1),J=Array(Z.length+1);for(let G=0;G<=Z.length;G++)Q[G]=G;for(let G=1;G<=X.length;G++){J[0]=G;for(let K=1;K<=Z.length;K++){let q=Z[K-1]===X[G-1]?0:1;J[K]=Math.min(J[K-1]+1,Q[K]+1,Q[K-1]+q)}for(let K=0;K<=Z.length;K++)Q[K]=J[K]}return Q[Z.length]}function s9($){if(!$)return"";return $.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'").replace(/&/g,"&")}var c1,r7,i1;var i0=S(()=>{V0();H0();s7();c1={},r7=new Map;i1={uppercase:($,Y)=>{return $!==void 0&&$!==null?String($).toUpperCase():""},lowercase:($,Y)=>{return $!==void 0&&$!==null?String($).toLowerCase():""},capitalize:($,Y)=>{if($===void 0||$===null)return"";let Z=String($);return Z.charAt(0).toUpperCase()+Z.slice(1)},number:($,Y,Z=0)=>{if($===void 0||$===null)return"";try{let X=Number($);return Number.isNaN(X)?"":X.toFixed(Number.parseInt(String(Z),10))}catch{return""}},fmt:($,Y,Z="en-US")=>{if($===void 0||$===null)return"";try{let X=Number($);if(Number.isNaN(X))return String($);return X.toLocaleString(Z)}catch{return String($)}},join:($,Y,Z=",")=>{if(!Array.isArray($))return"";return $.join(String(Z))},escape:($,Y)=>{if($===void 0||$===null)return"";return Q1(String($))},translate:($,Y,Z={})=>{if(!Y||!Y.__translations)return $;let X=Y.__translations,Q=Y.__i18nConfig?.fallbackToKey??!0,J=String($).split("."),G=X;for(let q of J){if(G===void 0||G===null)break;G=G[q]}if(G===void 0||G===null)return Q?$:"";let K=String(G);return Object.entries(Z).forEach(([q,_])=>{K=K.replace(AX(q),String(_))}),K},t:($,Y,Z={})=>{return i1.translate($,Y,Z)},truncate:($,Y,Z=50,X="...")=>{if($===void 0||$===null)return"";let Q=String($);if(Q.length<=Z)return Q;if(Z<=X.length)return X.substring(0,Z);return Q.substring(0,Z-X.length)+X},date:($,Y,Z="short",X="en-US")=>{if($===void 0||$===null)return"";try{let Q=$ instanceof Date?$:new Date($);if(Number.isNaN(Q.getTime()))return String($);let J={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(Z==="iso")return Q.toISOString();return new Intl.DateTimeFormat(X,J[Z]||J.short).format(Q)}catch{return String($)}},currency:($,Y,Z="USD",X="en-US")=>{if($===void 0||$===null)return"";try{let Q=Number($);if(Number.isNaN(Q))return String($);return new Intl.NumberFormat(X,{style:"currency",currency:Z}).format(Q)}catch{return String($)}},pluralize:($,Y,Z,X)=>{let Q=Number($);if(Number.isNaN(Q))return Z;let J=X||`${Z}s`;return Q===1?Z:J},first:($,Y)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[0];return String($).charAt(0)},last:($,Y)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[$.length-1];let Z=String($);return Z.charAt(Z.length-1)},length:($,Y)=>{if($===void 0||$===null)return 0;if(Array.isArray($)||typeof $==="string")return $.length;if($ instanceof Map||$ instanceof Set)return $.size;if(typeof $==="object")return Object.keys($).length;return 0},json:($,Y,Z=!1)=>{if($===void 0)return"undefined";if($===null)return"null";try{return Z?JSON.stringify($,null,2):JSON.stringify($)}catch{return String($)}},default:($,Y,Z="")=>{return $===void 0||$===null||$===""?Z:$},reverse:($,Y)=>{if($===void 0||$===null)return"";if(Array.isArray($))return[...$].reverse();return String($).split("").reverse().join("")},slice:($,Y,Z=0,X)=>{if($===void 0||$===null)return"";if(Array.isArray($)||typeof $==="string")return $.slice(Z,X);return $},replace:($,Y,Z,X="")=>{if($===void 0||$===null)return"";let Q=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String($).replace(new RegExp(Q,"g"),()=>X)},stripTags:($,Y)=>{if($===void 0||$===null)return"";return String($).replace(/<[^>]*>/g,"")},urlencode:($,Y)=>{if($===void 0||$===null)return"";return encodeURIComponent(String($))},abs:($,Y)=>{let Z=Number($);return Number.isNaN(Z)?0:Math.abs(Z)},round:($,Y,Z=0)=>{let X=Number($);if(Number.isNaN(X))return 0;let Q=10**Z;return Math.round(X*Q)/Q}}});class n1{cache=new Map;maxSize;constructor($=100){this.maxSize=$}get($){if(!this.cache.has($))return;let Y=this.cache.get($);return this.cache.delete($),this.cache.set($,Y),Y}set($,Y){if(this.cache.has($))this.cache.delete($);else if(this.cache.size>=this.maxSize){let Z=this.cache.keys().next().value;if(Z!==void 0)this.cache.delete(Z)}this.cache.set($,Y)}has($){return this.cache.has($)}delete($){return this.cache.delete($)}clear(){this.cache.clear()}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}function w1($,Y){if(Y?.includes("g"))return new RegExp($,Y);let Z=`${$}:${Y||""}`;if(!A1.has(Z)){if(A1.size>=kX){let X=A1.keys().next().value;if(X)A1.delete(X)}A1.set(Z,new RegExp($,Y))}return A1.get(Z)}class X3{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator($){let Y=Array.from(new Set($)),Z=Y.sort().join(","),X=this.pool.find((K)=>K.context.join(",")===Z);if(X)return X.func;let Q=this.fnCache,J=this.fnCacheMaxSize,G=(...K)=>{return(q)=>{try{let _=`${Z}:${q}`,U=Q.get(_);if(!U){if(Q.size>=J){let W=Q.keys().next().value;if(W)Q.delete(W)}U=Function(...Y,`
|
|
1914
1914
|
'use strict';
|
|
1915
1915
|
try {
|
|
1916
1916
|
return ${q};
|
package/dist/ssg.js
CHANGED
|
@@ -708,7 +708,7 @@ catch (e) {
|
|
|
708
708
|
}
|
|
709
709
|
throw e;
|
|
710
710
|
}
|
|
711
|
-
`)(...Object.values(Y))}catch{return}}function e($){try{return i1($),!0}catch{return!1}}function O0($,Z){try{let J=X0($,Z);if(J&&typeof J==="object"&&!Array.isArray(J))return J;return{}}catch{return{}}}function $0($,Z){let J=i1($);
|
|
711
|
+
`)(...Object.values(Y))}catch{return}}function e($){try{return i1($),!0}catch{return!1}}function O0($,Z){try{let J=X0($,Z);if(J&&typeof J==="object"&&!Array.isArray(J))return J;return{}}catch{return{}}}function $0($,Z){let J=i1($),Y=/^[A-Za-z_$][\w$]*$/,Q=[],X=[];for(let K=0;K<Z.length;K++)if(Y.test(Z[K]))Q.push(K),X.push(Z[K]);let G=Function(...X,`
|
|
712
712
|
'use strict';
|
|
713
713
|
try {
|
|
714
714
|
return ${J};
|
|
@@ -719,7 +719,7 @@ catch (e) {
|
|
|
719
719
|
}
|
|
720
720
|
throw e;
|
|
721
721
|
}
|
|
722
|
-
`)}function F5($){let Z=$.trim(),J=[/\beval\s*\(/i,/\bFunction\s*\(/i,/\bimport\s*\(/i,/\brequire\s*\(/i,/\bprocess\b/i,/\b__proto__\b/i,/\bconstructor\s*[.(]/i,/\bglobalThis\b/i,/\bwindow\b/i,/\bdocument\b/i,/\bfetch\s*\(/i,/\bBun\b/i,/\bDeno\b/i,/\bconsole\b/i,/\bthis\b/i,/\bReflect\b/i,/\bProxy\b/i,/\bprototype\b/i,/\.(bind|call|apply)\s*\(/i];for(let Y of J)if(Y.test(Z))return!1;return!0}var CY,N7,T7,PY;var A0=C(()=>{CY={maxSanitizeDepth:10,allowBracketNotation:!1},N7={...CY},T7=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,/\bnew\s+/,/\bdelete\s+/,/\bthis\b/],PY=/[\w)\]]\s*\[\s*['"]/});function V5($,Z){let J=fY++,Y=`<!--__STX_${$.toUpperCase()}_${J}__-->`;return gY.set(Y,{type:$,expression:Z}),Y}var fY=0,gY;var M7=C(()=>{gY=new Map});var y7={};r(y7,{usesSignalsInScript:()=>w5,unescapeHtml:()=>m9,registerFilters:()=>dY,registerFilter:()=>E7,processExpressions:()=>o0,interpolateScriptsInTemplate:()=>uY,interpolateScriptExpressions:()=>b7,getAllFilters:()=>k7,evaluateExpression:()=>l0,escapeHtml:()=>q1,defaultFilters:()=>o1,clearCustomFilters:()=>mY,applyFilters:()=>S7});function hY($){let Z=I7.get($);if(!Z){let J=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Z=new RegExp(`:${J}(?!\\w)`,"g"),I7.set($,Z)}return Z.lastIndex=0,Z}function E7($,Z){if($ in o1)console.warn(`Filter "${$}" already exists as a built-in filter. Custom filter will take precedence.`);n1[$]=Z}function dY($){for(let[Z,J]of Object.entries($))E7(Z,J)}function k7(){return{...o1,...n1}}function mY(){for(let $ of Object.keys(n1))delete n1[$]}function q1($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function w5($){let Z=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,J;while((J=Z.exec($))!==null){let Y=J[1];if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/.test(Y))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test($))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test($))return!0;return!1}function D7($,Z){let J=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console"],Y=$.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),Q="",X=!1,G=0;for(let _=0;_<Y.length;_++){let W=Y[_];if(!X&&W==="`"){X=!0,G=0;continue}if(X){if(W==="`"&&G===0){X=!1;continue}if(W==="$"&&Y[_+1]==="{"){G++,_++;continue}if(W==="}"&&G>0){G--;continue}continue}Q+=W}Y=Q;let K=/\b([a-zA-Z_$][a-zA-Z0-9_$]*)\b/g,q;while((q=K.exec(Y))!==null){let _=q[1];if(!Y.substring(0,q.index).trimEnd().endsWith(".")){if(!J.includes(_)&&!(_ in Z))return!1}}return!0}function b7($,Z){let J=$;return J=J.replace(/\{!!([\s\S]*?)!!\}/g,(Y,Q)=>{try{let X=l0(Q,Z);if(X===void 0)return Y;return X===null?"":String(X)}catch{return Y}}),J=J.replace(/\{\{([\s\S]*?)\}\}/g,(Y,Q)=>{let X=Q.trim();if(/^__[A-Z_]+__$/.test(X))return Y;try{let G=l0(Q,Z);if(G===void 0)return Y;return JSON.stringify(G)}catch{return Y}}),J}function uY($,Z,J={}){return $.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(Y,Q,X)=>{if(/\bsrc\s*=/.test(Q))return Y;if(/\bdata-raw\b/.test(Q))return Y;if(/\btype\s*=\s*["']application\/json["']/.test(Q))return Y;if(J.skipServer&&/\bserver\b/.test(Q))return Y;let G=b7(X,Z);return`<script${Q}>${G}</script>`})}function o0($,Z,J){let Y=$,Q=[];Y=Y.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,(K)=>{if(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K))return K;let q=Q.length;return Q.push(K),`<!--__STX_STYLE_${q}__-->`});let X=[];Y=Y.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,(K)=>{let q=X.length;return X.push(K),`<!--__STX_SCRIPT_EXPR_${q}__-->`});let G=w5($);Y=Y.replace(/\{\{\{([\s\S]*?)\}\}\}/g,(K,q,_)=>{try{let W=l0(q,Z);return W!==void 0&&W!==null?String(W):""}catch(W){let z=W instanceof Error?W.message:String(W);return Q0("Expression",`Error evaluating: {{{ ${q.trim()}}}}: ${z}`,J,$,_,K)}}),Y=Y.replace(/\{!!([\s\S]*?)!!\}/g,(K,q,_)=>{try{let W=l0(q,Z);if(W===void 0&&Z.__stx_buildMode==="compile")return V5("raw",q.trim());return W!==void 0&&W!==null?String(W):""}catch(W){if(Z.__stx_buildMode==="compile")return V5("raw",q.trim());let z=W instanceof Error?W.message:String(W);return Q0("Expression",`Error evaluating: {!! ${q.trim()} !!}: ${z}`,J,$,_,K)}}),Y=Y.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,(K)=>{if(K.startsWith("<!--__STX_SCRIPT_EXPR_"))return K;let q=X.length;return X.push(K),`<!--__STX_SCRIPT_EXPR_${q}__-->`}),Y=Y.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,(K)=>{if(K.startsWith("<!--__STX_STYLE_"))return K;if(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K))return K;let q=Q.length;return Q.push(K),`<!--__STX_STYLE_${q}__-->`}),Y=Y.replace(/\{\{([\s\S]*?)\}\}/g,(K,q,_)=>{let W=q.trim(),z=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],U=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,B=W.match(U)?.[1],O=B&&((B in Z)||z.includes(B)),F=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,L=W.match(F),H=L&&!z.includes(L[1])&&!(L[1]in Z);if(/^__[A-Z_]+__$/.test(W))return"";try{let V=l0(q,Z);if(V===void 0&&G&&!D7(W,Z))return K;if(V===void 0&&Z.__stx_buildMode==="compile"&&!G)return V5("expr",W);return V!==void 0&&V!==null?q1(String(V)):""}catch(V){if(G&&!D7(W,Z))return K;if(H)return K;let A=V instanceof Error?V.message:String(V);return Q0("Expression",`Error evaluating: {{ ${W} }}: ${A}`,J,$,_,K)}});for(let K=0;K<X.length;K++)Y=Y.replace(`<!--__STX_SCRIPT_EXPR_${K}__-->`,()=>X[K]);for(let K=0;K<Q.length;K++)Y=Y.replace(`<!--__STX_STYLE_${K}__-->`,()=>Q[K]);return Y}function S7($,Z,J){if(!Z.trim())return $;let Y=$,Q=Z.trim();while(Q.length>0){let X=Q.match(/^(\w+)/);if(!X)break;let G=X[1];Q=Q.substring(G.length).trim();let K=n1[G]||o1[G];if(!K)throw Error(`Filter not found: ${G}. Available filters: ${Object.keys(k7()).join(", ")}`);let q=[];if(Q.startsWith(":")){let _=Q.match(/^:([^|\s]+)/);if(_){let W=_[1].trim();try{let z=Number(W);q=[Number.isNaN(z)?W:z]}catch{q=[W]}Q=Q.substring(_[0].length).trim()}}else if(Q.startsWith("(")){let _=1,W=1;while(_>0&&W<Q.length){if(Q[W]==="(")_++;if(Q[W]===")")_--;W++}if(_===0){let z=Q.substring(1,W-1).trim();if(z)try{if(z.startsWith("{")&&z.endsWith("}"))q=[l0(`(${z})`,J,!0)];else{let U=[],j="",B=null,O=0,F=0,L=0,H=!1;for(let V=0;V<z.length;V++){let A=z[V];if(H){j+=A,H=!1;continue}if(A==="\\"){j+=A,H=!0;continue}if(B){if(j+=A,A===B)B=null;continue}if(A==='"'||A==="'"||A==="`"){B=A,j+=A;continue}if(A==="(")O++;else if(A===")")O--;else if(A==="[")F++;else if(A==="]")F--;else if(A==="{")L++;else if(A==="}")L--;if(A===","&&O===0&&F===0&&L===0){U.push(j),j="";continue}j+=A}if(j)U.push(j);q=U.map((V)=>{let A=V.trim();return l0(A,J,!0)})}}catch{q=[z]}Q=Q.substring(W).trim()}}try{Y=K(Y,J,...q)}catch(_){let W=_ instanceof Error?_.message:String(_);throw Error(`Error applying filter '${G}': ${W}`)}if(Q.startsWith("|"))Q=Q.substring(1).trim();else break}return Y}function pY($){let Z=!1,J="",Y=0,Q=0,X=0,G=!1;for(let K=0;K<$.length;K++){let q=$[K],_=$[K+1];if(Z&&G){G=!1;continue}if(Z&&q==="\\"){G=!0;continue}if(G=!1,(q==='"'||q==="'"||q==="`")&&!G){if(!Z)Z=!0,J=q;else if(q===J)Z=!1,J="";continue}if(Z&&J==="`"&&q==="$"&&_==="{"){let W=1;K+=2;while(K<$.length&&W>0){if($[K]==="{")W++;else if($[K]==="}")W--;if(W>0)K++}continue}if(Z)continue;if(q==="(")Y++;else if(q===")")Y--;else if(q==="[")Q++;else if(q==="]")Q--;else if(q==="{")X++;else if(q==="}")X--;if(q==="|"&&Y===0&&Q===0&&X===0){if(_==="|"){K++;continue}if(_==="="){K++;continue}return K}}return-1}function l0($,Z,J=!1){try{let Y=$.trim(),Q=pY(Y);if(Q>0){let X=Y.substring(0,Q).trim(),G=Y.substring(Q+1).trim(),K=l0(X,Z,!0);return S7(K,G,Z)}if(!e(Y)){if(!J)console.warn(`Potentially unsafe expression detected, using safe evaluator: ${Y}`);return X0(Y,Z)}try{let X=Object.keys(Z),G=Object.values(Z);return $0(Y,X)(...G)}catch{return X0(Y,Z)}}catch(Y){if(Y instanceof ReferenceError){let Q=/(\b\w+)\s+is not defined/.exec(Y.message);if(Q){let X=Q[1],G=lY(X,Object.keys(Z));if(G&&G!==X)Y.message=`${Y.message} \u2014 did you mean '${G}'?`}}if(!J)console.error(`Error evaluating expression: ${$}`,Y);throw Y}}function lY($,Z){let J=null;for(let Q of Z){if(Q===$)continue;let X=cY($,Q);if(J===null||X<J.dist)J={key:Q,dist:X}}if(!J)return null;let Y=Math.max($.length,J.key.length);if(J.dist<=2||J.dist/Y<=0.35)return J.key;return null}function cY($,Z){if($===Z)return 0;if($.length===0)return Z.length;if(Z.length===0)return $.length;let[J,Y]=$.length<Z.length?[$,Z]:[Z,$],Q=Array(J.length+1),X=Array(J.length+1);for(let G=0;G<=J.length;G++)Q[G]=G;for(let G=1;G<=Y.length;G++){X[0]=G;for(let K=1;K<=J.length;K++){let q=J[K-1]===Y[G-1]?0:1;X[K]=Math.min(X[K-1]+1,Q[K]+1,Q[K-1]+q)}for(let K=0;K<=J.length;K++)Q[K]=X[K]}return Q[J.length]}function m9($){if(!$)return"";return $.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'").replace(/&/g,"&")}var n1,I7,o1;var s0=C(()=>{A0();F0();M7();n1={},I7=new Map;o1={uppercase:($,Z)=>{return $!==void 0&&$!==null?String($).toUpperCase():""},lowercase:($,Z)=>{return $!==void 0&&$!==null?String($).toLowerCase():""},capitalize:($,Z)=>{if($===void 0||$===null)return"";let J=String($);return J.charAt(0).toUpperCase()+J.slice(1)},number:($,Z,J=0)=>{if($===void 0||$===null)return"";try{let Y=Number($);return Number.isNaN(Y)?"":Y.toFixed(Number.parseInt(String(J),10))}catch{return""}},fmt:($,Z,J="en-US")=>{if($===void 0||$===null)return"";try{let Y=Number($);if(Number.isNaN(Y))return String($);return Y.toLocaleString(J)}catch{return String($)}},join:($,Z,J=",")=>{if(!Array.isArray($))return"";return $.join(String(J))},escape:($,Z)=>{if($===void 0||$===null)return"";return q1(String($))},translate:($,Z,J={})=>{if(!Z||!Z.__translations)return $;let Y=Z.__translations,Q=Z.__i18nConfig?.fallbackToKey??!0,X=String($).split("."),G=Y;for(let q of X){if(G===void 0||G===null)break;G=G[q]}if(G===void 0||G===null)return Q?$:"";let K=String(G);return Object.entries(J).forEach(([q,_])=>{K=K.replace(hY(q),String(_))}),K},t:($,Z,J={})=>{return o1.translate($,Z,J)},truncate:($,Z,J=50,Y="...")=>{if($===void 0||$===null)return"";let Q=String($);if(Q.length<=J)return Q;if(J<=Y.length)return Y.substring(0,J);return Q.substring(0,J-Y.length)+Y},date:($,Z,J="short",Y="en-US")=>{if($===void 0||$===null)return"";try{let Q=$ instanceof Date?$:new Date($);if(Number.isNaN(Q.getTime()))return String($);let X={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(J==="iso")return Q.toISOString();return new Intl.DateTimeFormat(Y,X[J]||X.short).format(Q)}catch{return String($)}},currency:($,Z,J="USD",Y="en-US")=>{if($===void 0||$===null)return"";try{let Q=Number($);if(Number.isNaN(Q))return String($);return new Intl.NumberFormat(Y,{style:"currency",currency:J}).format(Q)}catch{return String($)}},pluralize:($,Z,J,Y)=>{let Q=Number($);if(Number.isNaN(Q))return J;let X=Y||`${J}s`;return Q===1?J:X},first:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[0];return String($).charAt(0)},last:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[$.length-1];let J=String($);return J.charAt(J.length-1)},length:($,Z)=>{if($===void 0||$===null)return 0;if(Array.isArray($)||typeof $==="string")return $.length;if($ instanceof Map||$ instanceof Set)return $.size;if(typeof $==="object")return Object.keys($).length;return 0},json:($,Z,J=!1)=>{if($===void 0)return"undefined";if($===null)return"null";try{return J?JSON.stringify($,null,2):JSON.stringify($)}catch{return String($)}},default:($,Z,J="")=>{return $===void 0||$===null||$===""?J:$},reverse:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return[...$].reverse();return String($).split("").reverse().join("")},slice:($,Z,J=0,Y)=>{if($===void 0||$===null)return"";if(Array.isArray($)||typeof $==="string")return $.slice(J,Y);return $},replace:($,Z,J,Y="")=>{if($===void 0||$===null)return"";let Q=J.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String($).replace(new RegExp(Q,"g"),()=>Y)},stripTags:($,Z)=>{if($===void 0||$===null)return"";return String($).replace(/<[^>]*>/g,"")},urlencode:($,Z)=>{if($===void 0||$===null)return"";return encodeURIComponent(String($))},abs:($,Z)=>{let J=Number($);return Number.isNaN(J)?0:Math.abs(J)},round:($,Z,J=0)=>{let Y=Number($);if(Number.isNaN(Y))return 0;let Q=10**J;return Math.round(Y*Q)/Q}}});class s1{cache=new Map;maxSize;constructor($=100){this.maxSize=$}get($){if(!this.cache.has($))return;let Z=this.cache.get($);return this.cache.delete($),this.cache.set($,Z),Z}set($,Z){if(this.cache.has($))this.cache.delete($);else if(this.cache.size>=this.maxSize){let J=this.cache.keys().next().value;if(J!==void 0)this.cache.delete(J)}this.cache.set($,Z)}has($){return this.cache.has($)}delete($){return this.cache.delete($)}clear(){this.cache.clear()}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}function M1($,Z){if(Z?.includes("g"))return new RegExp($,Z);let J=`${$}:${Z||""}`;if(!T1.has(J)){if(T1.size>=iY){let Y=T1.keys().next().value;if(Y)T1.delete(Y)}T1.set(J,new RegExp($,Z))}return T1.get(J)}class C7{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator($){let Z=Array.from(new Set($)),J=Z.sort().join(","),Y=this.pool.find((K)=>K.context.join(",")===J);if(Y)return Y.func;let Q=this.fnCache,X=this.fnCacheMaxSize,G=(...K)=>{return(q)=>{try{let _=`${J}:${q}`,W=Q.get(_);if(!W){if(Q.size>=X){let z=Q.keys().next().value;if(z)Q.delete(z)}W=Function(...Z,`
|
|
722
|
+
`);if(X.length===Z.length)return G;return(...K)=>{let q=Array(Q.length);for(let _=0;_<Q.length;_++)q[_]=K[Q[_]];return G(...q)}}function F5($){let Z=$.trim(),J=[/\beval\s*\(/i,/\bFunction\s*\(/i,/\bimport\s*\(/i,/\brequire\s*\(/i,/\bprocess\b/i,/\b__proto__\b/i,/\bconstructor\s*[.(]/i,/\bglobalThis\b/i,/\bwindow\b/i,/\bdocument\b/i,/\bfetch\s*\(/i,/\bBun\b/i,/\bDeno\b/i,/\bconsole\b/i,/\bthis\b/i,/\bReflect\b/i,/\bProxy\b/i,/\bprototype\b/i,/\.(bind|call|apply)\s*\(/i];for(let Y of J)if(Y.test(Z))return!1;return!0}var CY,N7,T7,PY;var A0=C(()=>{CY={maxSanitizeDepth:10,allowBracketNotation:!1},N7={...CY},T7=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,/\bnew\s+/,/\bdelete\s+/,/\bthis\b/],PY=/[\w)\]]\s*\[\s*['"]/});function V5($,Z){let J=fY++,Y=`<!--__STX_${$.toUpperCase()}_${J}__-->`;return gY.set(Y,{type:$,expression:Z}),Y}var fY=0,gY;var M7=C(()=>{gY=new Map});var y7={};r(y7,{usesSignalsInScript:()=>w5,unescapeHtml:()=>m9,registerFilters:()=>dY,registerFilter:()=>E7,processExpressions:()=>o0,interpolateScriptsInTemplate:()=>uY,interpolateScriptExpressions:()=>b7,getAllFilters:()=>k7,evaluateExpression:()=>l0,escapeHtml:()=>q1,defaultFilters:()=>o1,clearCustomFilters:()=>mY,applyFilters:()=>S7});function hY($){let Z=I7.get($);if(!Z){let J=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Z=new RegExp(`:${J}(?!\\w)`,"g"),I7.set($,Z)}return Z.lastIndex=0,Z}function E7($,Z){if($ in o1)console.warn(`Filter "${$}" already exists as a built-in filter. Custom filter will take precedence.`);n1[$]=Z}function dY($){for(let[Z,J]of Object.entries($))E7(Z,J)}function k7(){return{...o1,...n1}}function mY(){for(let $ of Object.keys(n1))delete n1[$]}function q1($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function w5($){let Z=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,J;while((J=Z.exec($))!==null){let Y=J[1];if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/.test(Y))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test($))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test($))return!0;return!1}function D7($,Z){let J=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console"],Y=$.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),Q="",X=!1,G=0;for(let _=0;_<Y.length;_++){let W=Y[_];if(!X&&W==="`"){X=!0,G=0;continue}if(X){if(W==="`"&&G===0){X=!1;continue}if(W==="$"&&Y[_+1]==="{"){G++,_++;continue}if(W==="}"&&G>0){G--;continue}continue}Q+=W}Y=Q;let K=/\b([a-zA-Z_$][a-zA-Z0-9_$]*)\b/g,q;while((q=K.exec(Y))!==null){let _=q[1];if(!Y.substring(0,q.index).trimEnd().endsWith(".")){if(!J.includes(_)&&!(_ in Z))return!1}}return!0}function b7($,Z){let J=$;return J=J.replace(/\{!!([\s\S]*?)!!\}/g,(Y,Q)=>{try{let X=l0(Q,Z);if(X===void 0)return Y;return X===null?"":String(X)}catch{return Y}}),J=J.replace(/\{\{([\s\S]*?)\}\}/g,(Y,Q)=>{let X=Q.trim();if(/^__[A-Z_]+__$/.test(X))return Y;try{let G=l0(Q,Z);if(G===void 0)return Y;return JSON.stringify(G)}catch{return Y}}),J}function uY($,Z,J={}){return $.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(Y,Q,X)=>{if(/\bsrc\s*=/.test(Q))return Y;if(/\bdata-raw\b/.test(Q))return Y;if(/\btype\s*=\s*["']application\/json["']/.test(Q))return Y;if(J.skipServer&&/\bserver\b/.test(Q))return Y;let G=b7(X,Z);return`<script${Q}>${G}</script>`})}function o0($,Z,J){let Y=$,Q=[];Y=Y.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,(K)=>{if(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K))return K;let q=Q.length;return Q.push(K),`<!--__STX_STYLE_${q}__-->`});let X=[];Y=Y.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,(K)=>{let q=X.length;return X.push(K),`<!--__STX_SCRIPT_EXPR_${q}__-->`});let G=w5($);Y=Y.replace(/\{\{\{([\s\S]*?)\}\}\}/g,(K,q,_)=>{try{let W=l0(q,Z);return W!==void 0&&W!==null?String(W):""}catch(W){let z=W instanceof Error?W.message:String(W);return Q0("Expression",`Error evaluating: {{{ ${q.trim()}}}}: ${z}`,J,$,_,K)}}),Y=Y.replace(/\{!!([\s\S]*?)!!\}/g,(K,q,_)=>{try{let W=l0(q,Z);if(W===void 0&&Z.__stx_buildMode==="compile")return V5("raw",q.trim());return W!==void 0&&W!==null?String(W):""}catch(W){if(Z.__stx_buildMode==="compile")return V5("raw",q.trim());let z=W instanceof Error?W.message:String(W);return Q0("Expression",`Error evaluating: {!! ${q.trim()} !!}: ${z}`,J,$,_,K)}}),Y=Y.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,(K)=>{if(K.startsWith("<!--__STX_SCRIPT_EXPR_"))return K;let q=X.length;return X.push(K),`<!--__STX_SCRIPT_EXPR_${q}__-->`}),Y=Y.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,(K)=>{if(K.startsWith("<!--__STX_STYLE_"))return K;if(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K))return K;let q=Q.length;return Q.push(K),`<!--__STX_STYLE_${q}__-->`}),Y=Y.replace(/\{\{([\s\S]*?)\}\}/g,(K,q,_)=>{let W=q.trim(),z=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],U=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,B=W.match(U)?.[1],O=B&&((B in Z)||z.includes(B)),F=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,L=W.match(F),H=L&&!z.includes(L[1])&&!(L[1]in Z);if(/^__[A-Z_]+__$/.test(W))return"";try{let V=l0(q,Z);if(V===void 0&&G&&!D7(W,Z))return K;if(V===void 0&&Z.__stx_buildMode==="compile"&&!G)return V5("expr",W);return V!==void 0&&V!==null?q1(String(V)):""}catch(V){if(G&&!D7(W,Z))return K;if(H)return K;let A=V instanceof Error?V.message:String(V);return Q0("Expression",`Error evaluating: {{ ${W} }}: ${A}`,J,$,_,K)}});for(let K=0;K<X.length;K++)Y=Y.replace(`<!--__STX_SCRIPT_EXPR_${K}__-->`,()=>X[K]);for(let K=0;K<Q.length;K++)Y=Y.replace(`<!--__STX_STYLE_${K}__-->`,()=>Q[K]);return Y}function S7($,Z,J){if(!Z.trim())return $;let Y=$,Q=Z.trim();while(Q.length>0){let X=Q.match(/^(\w+)/);if(!X)break;let G=X[1];Q=Q.substring(G.length).trim();let K=n1[G]||o1[G];if(!K)throw Error(`Filter not found: ${G}. Available filters: ${Object.keys(k7()).join(", ")}`);let q=[];if(Q.startsWith(":")){let _=Q.match(/^:([^|\s]+)/);if(_){let W=_[1].trim();try{let z=Number(W);q=[Number.isNaN(z)?W:z]}catch{q=[W]}Q=Q.substring(_[0].length).trim()}}else if(Q.startsWith("(")){let _=1,W=1;while(_>0&&W<Q.length){if(Q[W]==="(")_++;if(Q[W]===")")_--;W++}if(_===0){let z=Q.substring(1,W-1).trim();if(z)try{if(z.startsWith("{")&&z.endsWith("}"))q=[l0(`(${z})`,J,!0)];else{let U=[],j="",B=null,O=0,F=0,L=0,H=!1;for(let V=0;V<z.length;V++){let A=z[V];if(H){j+=A,H=!1;continue}if(A==="\\"){j+=A,H=!0;continue}if(B){if(j+=A,A===B)B=null;continue}if(A==='"'||A==="'"||A==="`"){B=A,j+=A;continue}if(A==="(")O++;else if(A===")")O--;else if(A==="[")F++;else if(A==="]")F--;else if(A==="{")L++;else if(A==="}")L--;if(A===","&&O===0&&F===0&&L===0){U.push(j),j="";continue}j+=A}if(j)U.push(j);q=U.map((V)=>{let A=V.trim();return l0(A,J,!0)})}}catch{q=[z]}Q=Q.substring(W).trim()}}try{Y=K(Y,J,...q)}catch(_){let W=_ instanceof Error?_.message:String(_);throw Error(`Error applying filter '${G}': ${W}`)}if(Q.startsWith("|"))Q=Q.substring(1).trim();else break}return Y}function pY($){let Z=!1,J="",Y=0,Q=0,X=0,G=!1;for(let K=0;K<$.length;K++){let q=$[K],_=$[K+1];if(Z&&G){G=!1;continue}if(Z&&q==="\\"){G=!0;continue}if(G=!1,(q==='"'||q==="'"||q==="`")&&!G){if(!Z)Z=!0,J=q;else if(q===J)Z=!1,J="";continue}if(Z&&J==="`"&&q==="$"&&_==="{"){let W=1;K+=2;while(K<$.length&&W>0){if($[K]==="{")W++;else if($[K]==="}")W--;if(W>0)K++}continue}if(Z)continue;if(q==="(")Y++;else if(q===")")Y--;else if(q==="[")Q++;else if(q==="]")Q--;else if(q==="{")X++;else if(q==="}")X--;if(q==="|"&&Y===0&&Q===0&&X===0){if(_==="|"){K++;continue}if(_==="="){K++;continue}return K}}return-1}function l0($,Z,J=!1){try{let Y=$.trim(),Q=pY(Y);if(Q>0){let X=Y.substring(0,Q).trim(),G=Y.substring(Q+1).trim(),K=l0(X,Z,!0);return S7(K,G,Z)}if(!e(Y)){if(!J)console.warn(`Potentially unsafe expression detected, using safe evaluator: ${Y}`);return X0(Y,Z)}try{let X=Object.keys(Z),G=Object.values(Z);return $0(Y,X)(...G)}catch{return X0(Y,Z)}}catch(Y){if(Y instanceof ReferenceError){let Q=/(\b\w+)\s+is not defined/.exec(Y.message);if(Q){let X=Q[1],G=lY(X,Object.keys(Z));if(G&&G!==X)Y.message=`${Y.message} \u2014 did you mean '${G}'?`}}if(!J)console.error(`Error evaluating expression: ${$}`,Y);throw Y}}function lY($,Z){let J=null;for(let Q of Z){if(Q===$)continue;let X=cY($,Q);if(J===null||X<J.dist)J={key:Q,dist:X}}if(!J)return null;let Y=Math.max($.length,J.key.length);if(J.dist<=2||J.dist/Y<=0.35)return J.key;return null}function cY($,Z){if($===Z)return 0;if($.length===0)return Z.length;if(Z.length===0)return $.length;let[J,Y]=$.length<Z.length?[$,Z]:[Z,$],Q=Array(J.length+1),X=Array(J.length+1);for(let G=0;G<=J.length;G++)Q[G]=G;for(let G=1;G<=Y.length;G++){X[0]=G;for(let K=1;K<=J.length;K++){let q=J[K-1]===Y[G-1]?0:1;X[K]=Math.min(X[K-1]+1,Q[K]+1,Q[K-1]+q)}for(let K=0;K<=J.length;K++)Q[K]=X[K]}return Q[J.length]}function m9($){if(!$)return"";return $.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'").replace(/&/g,"&")}var n1,I7,o1;var s0=C(()=>{A0();F0();M7();n1={},I7=new Map;o1={uppercase:($,Z)=>{return $!==void 0&&$!==null?String($).toUpperCase():""},lowercase:($,Z)=>{return $!==void 0&&$!==null?String($).toLowerCase():""},capitalize:($,Z)=>{if($===void 0||$===null)return"";let J=String($);return J.charAt(0).toUpperCase()+J.slice(1)},number:($,Z,J=0)=>{if($===void 0||$===null)return"";try{let Y=Number($);return Number.isNaN(Y)?"":Y.toFixed(Number.parseInt(String(J),10))}catch{return""}},fmt:($,Z,J="en-US")=>{if($===void 0||$===null)return"";try{let Y=Number($);if(Number.isNaN(Y))return String($);return Y.toLocaleString(J)}catch{return String($)}},join:($,Z,J=",")=>{if(!Array.isArray($))return"";return $.join(String(J))},escape:($,Z)=>{if($===void 0||$===null)return"";return q1(String($))},translate:($,Z,J={})=>{if(!Z||!Z.__translations)return $;let Y=Z.__translations,Q=Z.__i18nConfig?.fallbackToKey??!0,X=String($).split("."),G=Y;for(let q of X){if(G===void 0||G===null)break;G=G[q]}if(G===void 0||G===null)return Q?$:"";let K=String(G);return Object.entries(J).forEach(([q,_])=>{K=K.replace(hY(q),String(_))}),K},t:($,Z,J={})=>{return o1.translate($,Z,J)},truncate:($,Z,J=50,Y="...")=>{if($===void 0||$===null)return"";let Q=String($);if(Q.length<=J)return Q;if(J<=Y.length)return Y.substring(0,J);return Q.substring(0,J-Y.length)+Y},date:($,Z,J="short",Y="en-US")=>{if($===void 0||$===null)return"";try{let Q=$ instanceof Date?$:new Date($);if(Number.isNaN(Q.getTime()))return String($);let X={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(J==="iso")return Q.toISOString();return new Intl.DateTimeFormat(Y,X[J]||X.short).format(Q)}catch{return String($)}},currency:($,Z,J="USD",Y="en-US")=>{if($===void 0||$===null)return"";try{let Q=Number($);if(Number.isNaN(Q))return String($);return new Intl.NumberFormat(Y,{style:"currency",currency:J}).format(Q)}catch{return String($)}},pluralize:($,Z,J,Y)=>{let Q=Number($);if(Number.isNaN(Q))return J;let X=Y||`${J}s`;return Q===1?J:X},first:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[0];return String($).charAt(0)},last:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[$.length-1];let J=String($);return J.charAt(J.length-1)},length:($,Z)=>{if($===void 0||$===null)return 0;if(Array.isArray($)||typeof $==="string")return $.length;if($ instanceof Map||$ instanceof Set)return $.size;if(typeof $==="object")return Object.keys($).length;return 0},json:($,Z,J=!1)=>{if($===void 0)return"undefined";if($===null)return"null";try{return J?JSON.stringify($,null,2):JSON.stringify($)}catch{return String($)}},default:($,Z,J="")=>{return $===void 0||$===null||$===""?J:$},reverse:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return[...$].reverse();return String($).split("").reverse().join("")},slice:($,Z,J=0,Y)=>{if($===void 0||$===null)return"";if(Array.isArray($)||typeof $==="string")return $.slice(J,Y);return $},replace:($,Z,J,Y="")=>{if($===void 0||$===null)return"";let Q=J.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String($).replace(new RegExp(Q,"g"),()=>Y)},stripTags:($,Z)=>{if($===void 0||$===null)return"";return String($).replace(/<[^>]*>/g,"")},urlencode:($,Z)=>{if($===void 0||$===null)return"";return encodeURIComponent(String($))},abs:($,Z)=>{let J=Number($);return Number.isNaN(J)?0:Math.abs(J)},round:($,Z,J=0)=>{let Y=Number($);if(Number.isNaN(Y))return 0;let Q=10**J;return Math.round(Y*Q)/Q}}});class s1{cache=new Map;maxSize;constructor($=100){this.maxSize=$}get($){if(!this.cache.has($))return;let Z=this.cache.get($);return this.cache.delete($),this.cache.set($,Z),Z}set($,Z){if(this.cache.has($))this.cache.delete($);else if(this.cache.size>=this.maxSize){let J=this.cache.keys().next().value;if(J!==void 0)this.cache.delete(J)}this.cache.set($,Z)}has($){return this.cache.has($)}delete($){return this.cache.delete($)}clear(){this.cache.clear()}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}function M1($,Z){if(Z?.includes("g"))return new RegExp($,Z);let J=`${$}:${Z||""}`;if(!T1.has(J)){if(T1.size>=iY){let Y=T1.keys().next().value;if(Y)T1.delete(Y)}T1.set(J,new RegExp($,Z))}return T1.get(J)}class C7{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator($){let Z=Array.from(new Set($)),J=Z.sort().join(","),Y=this.pool.find((K)=>K.context.join(",")===J);if(Y)return Y.func;let Q=this.fnCache,X=this.fnCacheMaxSize,G=(...K)=>{return(q)=>{try{let _=`${J}:${q}`,W=Q.get(_);if(!W){if(Q.size>=X){let z=Q.keys().next().value;if(z)Q.delete(z)}W=Function(...Z,`
|
|
723
723
|
'use strict';
|
|
724
724
|
try {
|
|
725
725
|
return ${q};
|