@stacksjs/stx-vscode 0.2.815 → 0.2.816
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.
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
`)n++;continue}if(
|
|
3
|
-
`)return-1;if(i==="\\"){t+=2;continue}if(i==="[")n=!0;else if(i==="]")n=!1;else if(i==="/"&&!n){t++;while(t<e.length&&/[a-z]/i.test(e[t]))t++;return t}t++}return-1}function
|
|
4
|
-
`)s+=" ",t++;continue}if(
|
|
1
|
+
var Pt=Object.create;var{getPrototypeOf:Dt,defineProperty:$e,getOwnPropertyNames:Mt}=Object;var Ce=Object.prototype.hasOwnProperty;function It(e){return this[e]}var Lt,Ot,X=(e,s,t)=>{var n=e!=null&&typeof e==="object";if(n){var i=s?Lt??=new WeakMap:Ot??=new WeakMap,r=i.get(e);if(r)return r}t=e!=null?Pt(Dt(e)):{};let o=s||!e||!e.__esModule||!Ce.call(e,"default")?$e(t,"default",{value:e,enumerable:!0}):t;if(e&&typeof e==="object"||typeof e==="function"){for(let a of Mt(e))if(!Ce.call(o,a))$e(o,a,{get:It.bind(e,a),enumerable:!0})}if(n)i.set(e,o);return o};var wt=require("node:crypto"),z=require("node:fs"),vt=require("node:os"),B=X(require("node:path"));var pe=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var be=X(require("node:path"),1);function jt(e,s){let t=e[s],n=s+1;while(n<e.length){if(e[n]==="\\"){n+=2;continue}if(e[n]===t)return n+1;n++}return e.length}function Bt(e,s){let t=s+1;while(t<e.length){if(e[t]==="\\"){t+=2;continue}if(e[t]==="`")return t+1;if(e[t]==="$"&&e[t+1]==="{"){if(t=_e(e,t+2),t<e.length)t++;continue}t++}return e.length}function _e(e,s){let t=1,n=s,i="{",r="";while(n<e.length){let o=e[n];if(o==="\\"){n+=2;continue}if(o==='"'||o==="'"){n=jt(e,n),i=Z,r="";continue}if(o==="`"){n=Bt(e,n),i=Z,r="";continue}if(o==="/"&&e[n+1]==="/"){while(n<e.length&&e[n]!==`
|
|
2
|
+
`)n++;continue}if(o==="/"&&e[n+1]==="*"){n+=2;while(n<e.length&&e.slice(n,n+2)!=="*/")n++;n+=2;continue}if(o==="/"&&ke(i,r)){let a=Ae(e,n);if(a!==-1){n=a,i=Z,r="";continue}}if(o==="{")t++;else if(o==="}"){if(t--,t===0)return n}if(/[\w$]/.test(o))r=/[\w$]/.test(i)?r+o:o,i=o;else if(!/\s/.test(o))i=o,r="";n++}return e.length}var Nt=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]);function ke(e,s){if(s)return Nt.has(s);return!(e===")"||e==="]"||e===Z)}var Z="\x00";function Ae(e,s){let t=s+1,n=!1;while(t<e.length){let i=e[t];if(i===`
|
|
3
|
+
`)return-1;if(i==="\\"){t+=2;continue}if(i==="[")n=!0;else if(i==="]")n=!1;else if(i==="/"&&!n){t++;while(t<e.length&&/[a-z]/i.test(e[t]))t++;return t}t++}return-1}function j(e){let s="",t=0,n="",i="";while(t<e.length){let r=e.slice(t,t+2);if(r==="//"){while(t<e.length&&e[t]!==`
|
|
4
|
+
`)s+=" ",t++;continue}if(r==="/*"){while(t<e.length&&e.slice(t,t+2)!=="*/")s+=e[t]===`
|
|
5
5
|
`?`
|
|
6
|
-
`:" ",t++;s+=" ",t+=2;continue}let
|
|
6
|
+
`:" ",t++;s+=" ",t+=2;continue}let o=e[t];if(o==='"'||o==="'"){let a=o;s+=" ",t++;while(t<e.length&&e[t]!==a){if(e[t]==="\\"){s+=" ",t+=2;continue}s+=e[t]===`
|
|
7
7
|
`?`
|
|
8
|
-
`:" ",t++}s+=" ",t++,n=
|
|
8
|
+
`:" ",t++}s+=" ",t++,n=Z,i="";continue}if(o==="/"&&ke(n,i)){let a=Ae(e,t);if(a!==-1){s+=`/${" ".repeat(a-t-2)}/`,t=a,n=Z,i="";continue}}if(o==="`"){s+=" ",t++;while(t<e.length&&e[t]!=="`"){if(e[t]==="\\"){s+=" ",t+=2;continue}if(e[t]==="$"&&e[t+1]==="{"){let a=t+2,c=_e(e,a);if(s+=" ",s+=j(e.slice(a,c)),c<e.length)s+=" ";t=c+1;continue}s+=e[t]===`
|
|
9
9
|
`?`
|
|
10
|
-
`:" ",t++}s+=" ",t++,n=
|
|
10
|
+
`:" ",t++}s+=" ",t++,n=Z,i="";continue}if(s+=o,t++,/[\w$]/.test(o))i=/[\w$]/.test(n)?i+o:o,n=o;else if(!/\s/.test(o))n=o,i=""}return s}function oe(e){let s=new Uint16Array(e.length),t=0,n=!0;for(let i=0;i<e.length;i++){let r=e[i];if(r===")"||r==="]"||r==="}")if(t===0)n=!1;else t--;if(s[i]=t,r==="("||r==="["||r==="{")t++}return{depths:s,balanced:n&&t===0}}class me{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,s){this.maxSize=e,this.options=s??null,this.sizes=s?new Map:null}get byteSize(){return this.bytes}setMaxBytes(e){if(!this.options)return;this.options={...this.options,maxBytes:e};while(this.bytes>e&&this.cache.size>0){let s=this.cache.keys().next().value;if(s===void 0)break;this.delete(s)}}get(e){if(!this.cache.has(e))return;let s=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,s),s}set(e,s){if(this.cache.has(e))this.delete(e);let t=this.options?this.options.sizeOf(s):0;if(this.options&&t>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+t>this.options.maxBytes)){let n=this.cache.keys().next().value;if(n===void 0)break;this.delete(n)}if(this.cache.set(e,s),this.sizes)this.sizes.set(e,t),this.bytes+=t}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let s=this.sizes.get(e);if(s!==void 0)this.bytes-=s,this.sizes.delete(e)}return this.cache.delete(e)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}class Re{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let s=Array.from(new Set(e)),t=s.sort().join(","),n=this.pool.find((a)=>a.context.join(",")===t);if(n)return n.func;let i=this.fnCache,r=this.fnCacheMaxSize,o=(...a)=>(c)=>{try{let f=`${t}:${c}`,u=i.get(f);if(!u){if(i.size>=r){let b=i.keys().next().value;if(b)i.delete(b)}u=Function(...s,`
|
|
11
11
|
'use strict';
|
|
12
12
|
try {
|
|
13
13
|
return ${c};
|
|
@@ -18,7 +18,7 @@ catch (e) {
|
|
|
18
18
|
}
|
|
19
19
|
throw e;
|
|
20
20
|
}
|
|
21
|
-
`),i.set(u
|
|
21
|
+
`),i.set(f,u)}return u(...a)}catch{return}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:o,context:s.slice()});return o}clear(){this.pool.length=0,this.fnCache.clear()}}var jn=new Re;class Pe{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(e){this.enabled=e}isEnabled(){return this.enabled}setBudget(e,s){this.budgets.set(e,{warnThreshold:0.8,action:"warn",...s})}setBudgets(e){for(let[s,t]of Object.entries(e))this.setBudget(s,t)}removeBudget(e){this.budgets.delete(e)}getBudgets(){let e={};for(let[s,t]of this.budgets.entries())e[s]=t;return e}onViolation(e){this.violationHandlers.push(e)}offViolation(e){let s=this.violationHandlers.indexOf(e);if(s!==-1)this.violationHandlers.splice(s,1)}time(e,s){if(!this.enabled)return s();let t=performance.now(),n=s(),i=performance.now()-t;return this.recordTime(e,i),this.checkBudget(e,i),n}async timeAsync(e,s){if(!this.enabled)return s();let t=performance.now(),n=await s(),i=performance.now()-t;return this.recordTime(e,i),this.checkBudget(e,i),n}checkBudget(e,s){let t=this.budgets.get(e);if(!t)return;let n=s/t.maxTime*100,i=t.warnThreshold!==void 0?s>=t.maxTime*t.warnThreshold&&s<t.maxTime:!1,r=s>=t.maxTime;if(!i&&!r)return;let o={label:e,actualTime:s,budgetTime:t.maxTime,exceedancePercent:n,timestamp:new Date,isWarning:i};this.violations.push(o);while(this.violations.length>this.maxViolations)this.violations.shift();for(let c of this.violationHandlers)try{c(o)}catch{}let a=i?`[Performance Warning] "${e}" took ${s.toFixed(2)}ms (${n.toFixed(1)}% of ${t.maxTime}ms budget)`:`[Performance Budget Exceeded] "${e}" took ${s.toFixed(2)}ms (exceeded ${t.maxTime}ms budget by ${(n-100).toFixed(1)}%)`;switch(t.action){case"log":console.log(a);break;case"warn":console.warn(a);break;case"error":console.error(a);break;case"throw":if(r)throw Error(a);else console.warn(a);break}}recordTime(e,s){let t=this.metrics.get(e);if(t)t.count++,t.totalTime+=s,t.maxTime=Math.max(t.maxTime,s),t.minTime=Math.min(t.minTime,s);else this.metrics.set(e,{count:1,totalTime:s,maxTime:s,minTime:s})}getStats(e){if(e){let t=this.metrics.get(e);if(!t)return{};let n=this.budgets.get(e);return{count:t.count,avgTime:t.totalTime/t.count,totalTime:t.totalTime,maxTime:t.maxTime,minTime:t.minTime,budget:n?.maxTime,budgetUtilization:n?t.totalTime/t.count/n.maxTime*100:void 0}}let s={};for(let[t,n]of this.metrics.entries()){let i=this.budgets.get(t);s[t]={count:n.count,avgTime:n.totalTime/n.count,totalTime:n.totalTime,maxTime:n.maxTime,minTime:n.minTime,budget:i?.maxTime,budgetUtilization:i?n.totalTime/n.count/i.maxTime*100:void 0}}return s}getViolations(e){if(e)return this.violations.filter((s)=>s.label===e);return[...this.violations]}getViolationStats(){let e={},s=0,t=0;for(let n of this.violations)if(e[n.label]=(e[n.label]||0)+1,n.isWarning)s++;else t++;return{total:this.violations.length,byLabel:e,warnings:s,errors:t}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var ge=null;function Vt(){if(!ge)ge=new Pe;return ge}var Bn=new Proxy({},{get(e,s){return Vt()[s]}});var Fn=new me(32,{maxBytes:2097152,sizeOf:(e)=>e.code.length*4});function De(e){let s=e.indexOf(" as ");if(s!==-1){let r=e.slice(0,s).trim(),o=e.slice(s+4).trim();return r&&o?{arrayExpr:r,itemVar:o}:null}let t=/^\s*(.+?)\s+in\s+([\s\S]+)$/.exec(e);if(!t)return null;let n=t[1].trim().replace(/^\(([\s\S]*)\)$/,"$1").trim(),i=t[2].trim();return n&&i?{arrayExpr:i,itemVar:n}:null}var Q=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","memo","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refDebounced","refresh","registerStoresClient","setKeptScope","setRouteParams","sharedRequest","state","untrack","useAsync","useBroadcastStream","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebounceFn","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useNativeDesktop","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useThrottleFn","useTimeout","useTimeoutFn","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"];var zt=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var Xn=Q.filter((e)=>!zt.includes(e));var Ft=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],Kt=["x-init","x-transition","x-effect","x-on"],Zn=[...Ft,...Kt];var ae=X(require("node:fs"),1),J=X(require("node:path"),1);function Me(e,s,t,n){let i=0;for(let r=s;r<e.length;r++)if(e[r]===t)i++;else if(e[r]===n&&!(n===">"&&e[r-1]==="=")){if(--i===0)return r}return-1}function Wt(e){let s=j(e),t=0,n=0,i=[];for(let r=0;r<s.length;r++)if("([{".includes(s[r]))t++;else if(")]}".includes(s[r]))t--;else if(s[r]===","&&t===0)i.push(e.slice(n,r).trim()),n=r+1;return i.push(e.slice(n).trim()),i}function he(e,s){let t=j(e),n=new RegExp(`\\b(?:${s.map((i)=>i.replace(/[$]/g,"\\$&")).join("|")})\\s*(?=[<(])`,"g");for(let i of t.matchAll(n)){let r=i.index+i[0].length,o="";if(t[r]==="<"){let c=Me(t,r,"<",">");if(c<0)continue;o=e.slice(r+1,c),r=c+1;while(/\s/.test(t[r]||"")&&r<t.length)r++}if(t[r]!=="(")continue;let a=Me(t,r,"(",")");if(a>=0)return{type:o,args:Wt(e.slice(r+1,a))}}return null}var Ie=`
|
|
22
22
|
type __StxCtor<T> = T extends StringConstructor ? string : T extends NumberConstructor ? number : T extends BooleanConstructor ? boolean : T extends ArrayConstructor ? unknown[] : T extends ObjectConstructor ? object : T extends readonly unknown[] ? __StxCtor<T[number]> : T extends abstract new (...args: any[]) => infer V ? V : unknown;
|
|
23
23
|
type __StxWiden<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T;
|
|
24
24
|
type __StxOption<T> = T extends { type: infer C } ? __StxCtor<C> : T extends { default: infer D } ? D extends (...args: any[]) => infer V ? V : __StxWiden<D> : __StxCtor<T>;
|
|
@@ -26,39 +26,40 @@ type __StxRequired<O> = { [K in keyof O]-?: O[K] extends { required: true } ? K
|
|
|
26
26
|
type __StxDefaulted<O> = { [K in keyof O]-?: O[K] extends { default: unknown } ? K : never }[keyof O];
|
|
27
27
|
type __StxOptions<O> = { [K in Exclude<__StxRequired<O>, __StxDefaulted<O>>]: __StxOption<O[K]> } & { [K in Exclude<keyof O, Exclude<__StxRequired<O>, __StxDefaulted<O>>>]?: __StxOption<O[K]> };
|
|
28
28
|
type __StxDefaults<P, K> = Omit<P, Extract<keyof P, K>> & Partial<Pick<P, Extract<keyof P, K>>>;
|
|
29
|
-
`;function Le(e,s){let t=[],n={defineProps:["defineProps"],defineEmits:["defineEmits"],withDefaults:["withDefaults"]},i=
|
|
30
|
-
`)}),
|
|
29
|
+
`;function Le(e,s){let t=[],n={defineProps:["defineProps"],defineEmits:["defineEmits"],withDefaults:["withDefaults"]},i=j(e),r=e.replace(/\bimport\s+(?:type\s+)?(\{[^}]*\}|\*\s+as\s+[\w$]+|[\w$]+)\s+from\s*(['"])([^'"]+)\2\s*;?/g,(T,y,C,w,d)=>{if(i.slice(d,d+6)!=="import")return T;if(w.endsWith(".stx"))return"";let v=`${s}Import${t.length}`;if(t.push(`import * as ${v} from ${JSON.stringify(w)};`),y.startsWith("*"))return`import ${y.replace(/^\*\s+as\s+/,"")} = ${v};`;if(!y.startsWith("{"))return`import ${y} = ${v}.default;`;return y.slice(1,-1).split(",").map((E)=>{let[m,A=m]=E.trim().replace(/^type\s+/,"").split(/\s+as\s+/);if(!m)return"";if(/^(?:stx|@stacksjs\/stx)(?:\/|$)/.test(w)&&m in n)n[m].push(A);return`import ${A} = ${v}.${m};`}).join(`
|
|
30
|
+
`)}),o=he(e,n.defineProps),a=he(e,n.defineEmits),c=he(e,n.withDefaults);if(!o&&!a)return{declarations:"",props:null,events:null};let f=[],u=null,b=null;if(o){f.push(`const __options = (${o.args[0]||"{}"}) as const;`),f.push(`const __defaults = (${c?.args[1]||"{}"});`);let T=o.type||"__StxOptions<typeof __options>";f.push(`export type __StxProps = __StxDefaults<${T}, keyof typeof __defaults | __StxDefaulted<typeof __options>>;`),u=`${s}.__StxProps`}if(a)f.push(`const __events = (${a.args[0]||"[]"}) as const;`),f.push(`export type __StxEvents = ${a.type||"Record<(typeof __events)[number], any[]>"};`),b=`${s}.__StxEvents`;return{declarations:`${t.join(`
|
|
31
31
|
`)}
|
|
32
32
|
namespace ${s} {
|
|
33
|
-
${
|
|
34
|
-
${
|
|
33
|
+
${r}
|
|
34
|
+
${f.join(`
|
|
35
35
|
`)}
|
|
36
|
-
}`,props:
|
|
37
|
-
`).length,column:
|
|
38
|
-
`)}},
|
|
39
|
-
`):"",checks:n,events:
|
|
40
|
-
`,s-1)+1;return s-t+1}function
|
|
41
|
-
`)s[
|
|
42
|
-
`),
|
|
43
|
-
`)),
|
|
44
|
-
${
|
|
36
|
+
}`,props:u,events:b}}var q=X(require("node:fs"),1),R=X(require("node:path"),1);function je(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var Oe=new Map;function Be(e,s=!0){let t=Oe.get(e);if(s&&t)return t;let n=new Map,i=[R.default.join(e,"src"),R.default.join(e,"dist"),e];function r(o,a){if(a>6)return;let c;try{c=q.default.readdirSync(o,{withFileTypes:!0})}catch{return}for(let f of c){let u=R.default.join(o,f.name);if(f.isDirectory()){if(f.name==="node_modules"||f.name.startsWith("."))continue;r(u,a+1)}else if(f.isFile()&&f.name.endsWith(".stx")){let b=f.name.slice(0,-4);if(!n.has(b))n.set(b,u);let T=b.toLowerCase();if(!n.has(T))n.set(T,u);let y=je(b);if(!n.has(y))n.set(y,u)}}}for(let o of i)if(r(o,0),n.size>0)break;if(s)Oe.set(e,n);return n}function Ne(e,s){if(e.startsWith(".")||e.startsWith("/"))return null;let t=s;while(!0){let n=R.default.join(t,"node_modules",e);try{if(q.default.statSync(n).isDirectory())return n}catch{}let i=R.default.dirname(t);if(i===t)return null;t=i}}function Ve(e,s,t={}){return[R.default.resolve(R.default.dirname(s),`${e}.stx`),R.default.resolve(R.default.dirname(s),e),R.default.resolve(t.componentsDir||"components",`${e}.stx`),R.default.resolve(t.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function ze(e){let s=e.endsWith(".stx")?e.slice(0,-4):e,t=s.split("-").map((i)=>i.charAt(0).toUpperCase()+i.slice(1)).join(""),n=je(s);return[s,t,n]}function Ht(e,s){let[t,n,i]=ze(e);for(let r of[t,t.toLowerCase(),n,i]){let o=s?.__importedComponents?.get(r);if(o!==void 0)return o}}function Gt(e,s){let t=s?R.default.resolve(s):void 0,n=R.default.dirname(R.default.resolve(e));for(;;){if(q.default.existsSync(R.default.join(n,"package.json")))return t&&n===t?void 0:n;let i=R.default.dirname(n);if(i===n)return;n=i}}var Ut=["src/ui","src/components","components","dist"];function Xt(e,s){let t=R.default.resolve(e);if(!s&&!t.split(R.default.sep).includes("node_modules"))return[];let n=Gt(t,s);if(!n)return[];let i=[];try{let a=JSON.parse(q.default.readFileSync(R.default.join(n,"package.json"),"utf8")).stx?.components;if(Array.isArray(a))i=a.filter((c)=>typeof c==="string")}catch{}let r=i.length?i:Ut;return[R.default.dirname(R.default.resolve(e)),...r.map((o)=>R.default.resolve(n,o))]}function*Zt(e,s,t={},n){let i=ze(e);if(i[0].startsWith("./")||i[0].startsWith("../")){yield R.default.resolve(R.default.dirname(s),`${i[0]}.stx`);return}let r=[...new Set(i.map((c)=>`${c}.stx`))],o=t.projectRoot||process.cwd(),a=[...Xt(s,t.projectRoot),...n?.__originalFilePath?[R.default.join(R.default.dirname(n.__originalFilePath),"components")]:[],...t.componentsDir?[t.componentsDir]:[],R.default.join(R.default.dirname(s),"components"),R.default.resolve(o,"src/components"),R.default.resolve(o,"components"),R.default.resolve("/home/runner/work/stx/stx/packages/stx/src","components")];for(let c of new Set(a)){for(let f of r)yield R.default.join(c,f);try{for(let f of q.default.readdirSync(c,{withFileTypes:!0}))if(f.isDirectory())for(let u of r)yield R.default.join(c,f.name,u)}catch{}}}function Fe(e,s,t={},n){let i=Ht(e,n);if(i!==void 0)return i;for(let r of Zt(e,s,t,n))try{if(q.default.statSync(r,{throwIfNoEntry:!1})?.isFile())return r}catch{}return null}var Ke=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","component","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","path","circle","rect","line","polygon","polyline","ellipse","text","tspan","textPath","g","defs","use","symbol","image","clipPath","mask","pattern","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","foreignObject","animate","animateMotion","animateTransform","set","mpath","desc","metadata","switch","view"]);function We(e){if(e.includes("-")||e==="component")return!1;if(/^[A-Z]/.test(e))return!/[a-z]/.test(e)&&[...Ke].some((s)=>s.toLowerCase()===e.toLowerCase());return Ke.has(e)||/[A-Z]/.test(e)}function*qt(e){let s=/<([A-Za-z][\w.-]*)(?=[\s/>])/g,t;while(t=s.exec(e)){let n=s.lastIndex,i=[];while(n<e.length){while(/\s/.test(e[n]||""))n++;if(e[n]===">"||e.slice(n,n+2)==="/>"){n+=e[n]===">"?1:2;break}let r=/^[^\s=/>]+/.exec(e.slice(n))?.[0];if(!r){n++;continue}let o=n;n+=r.length;while(/\s/.test(e[n]||""))n++;if(e[n]!=="="){i.push({name:r,value:!0,offset:o,braced:!1});continue}n++;while(/\s/.test(e[n]||""))n++;let a=e[n],c=a==="{",f=a==='"'||a==="'";if(f||c)n++;let u=n;if(c){let b=j(e.slice(n)),T=1,y=0;for(;y<b.length;y++){if(b[y]==="{")T++;if(b[y]==="}"&&--T===0)break}n+=y}else if(f)while(n<e.length&&e[n]!==a)n++;else while(n<e.length&&!/[\s/>]/.test(e[n]))n++;if(i.push({name:r,value:e.slice(u,n),offset:u,braced:c}),f||c)n++}s.lastIndex=n,yield{name:t[1],offset:t.index,attributes:i}}}function He(e,s,t){let n=[],i=[Ie,"type __StxAssignedValue<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? T extends () => infer V ? V : T : T;","type __StxProp<P, K> = K extends keyof P ? P[K] : unknown;",'type __StxStaticProp<P, K> = __StxProp<P, K> extends infer T ? boolean extends T ? T | "true" | "false" : T : never;','type __StxEvent<E, K> = K extends keyof E ? E[K] extends readonly unknown[] ? number extends E[K]["length"] ? E[K][0] : Exclude<E[K]["length"], 0 | 1> extends never ? E[K][0] : E[K] : E[K] : any;'],r=new Map,o=new Map,a=new Map,c=t.scriptCode(e,t.filePath),f=j(c);for(let C of c.matchAll(/\bimport\s+(\{[^}]+\}|[\w$]+)\s+from\s*['"]([^'"]+)['"]/g)){if(f.slice(C.index,C.index+6)!=="import")continue;let w=C[2],d=J.default.isAbsolute(w)||w.startsWith(".")?J.default.resolve(J.default.dirname(t.filePath),w):Ne(w,J.default.dirname(t.filePath));if(!d)continue;let v=d.endsWith(".stx")?d:ae.default.existsSync(`${d}.stx`)?`${d}.stx`:void 0,E=v?null:Be(d,!1),m=C[1].startsWith("{")?C[1].slice(1,-1).split(","):[C[1]];for(let A of m){let[_,S=_]=A.trim().split(/\s+as\s+/),D=v||E?.get(_)||E?.get(_.toLowerCase());if(D)a.set(S,D),a.set(S.toLowerCase(),D),a.set(S.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),D)}}for(let C of s.matchAll(/@import\s*\(([^)]+)\)/g))for(let w of C[1].matchAll(/['"]([^'"]+)['"]/g)){let d=Ve(w[1],t.filePath,t).find((v)=>ae.default.statSync(v,{throwIfNoEntry:!1})?.isFile());if(d)a.set(J.default.basename(w[1]).replace(/\.stx$/,""),d)}let u={__importedComponents:a},b=new Map,T=(C,w,d)=>{let v=e.slice(0,C);return{code:w,offset:C,attribute:d,anchor:!0,kind:"directive",line:v.split(`
|
|
37
|
+
`).length,column:C-v.lastIndexOf(`
|
|
38
|
+
`)}},y=(C,w,d)=>n.push({expression:C,statement:{text:w+C.code+d,prefixLength:w.length}});for(let C of qt(s)){if(We(C.name)||C.name==="component")continue;let w=Fe(C.name,t.filePath,t,u);if(!w)continue;let d=b.get(w);if(!d){let E;try{E=t.readComponent?t.readComponent(w):ae.default.readFileSync(w,"utf8")}catch{continue}if(E===void 0)continue;o.set(w,E),d=Le(t.scriptCode(E,w),`__StxComponent${b.size}`),b.set(w,d),i.push(d.declarations)}let v=[];for(let E of C.attributes){let{name:m,offset:A}=E,_=E.value===!0?"true":E.value;if(m.startsWith("@")||m.startsWith("v-on:")){if(d.events&&E.value!==!0)r.set(A,`__StxEvent<${d.events}, ${JSON.stringify(m.replace(/^@|^v-on:/,"").split(".")[0])}>`);continue}let S=/^v-model(?::([\w-]+))?(?:\.[\w-]+)*$/.exec(m);if(m.startsWith("v-")&&!m.startsWith("v-bind:")&&!S)continue;if(/^(?:x-|:)(?:if|for|show|key|else)(?:$|[.:-])/.test(m))continue;let D=(S?S[1]||"modelValue":m.replace(/^:|^v-bind:/,"")).replace(/-([a-z])/g,(F,O)=>O.toUpperCase());if(v.push(D),!d.props)continue;let N=m.startsWith(":")||m.startsWith("v-bind:")||!!S||E.braced,P=N?_:E.value!==!0?JSON.stringify(_):"true",M=!N&&E.value!==!0&&(_==="true"||_==="false");y(T(A,P,m),";void ((",`) satisfies ${M?"__StxStaticProp":"__StxProp"}<${d.props}, ${JSON.stringify(D)}>);`)}if(d.props){let E=[...new Set(v)].map((A)=>`${JSON.stringify(A)}: undefined as any`).join(", "),m=T(C.offset,`<${C.name}>`);n.push({expression:m,statement:{text:`;void ({ ${E} } satisfies ${d.props} & Record<string, unknown>);`,prefixLength:0}})}}return{declarations:b.size?i.join(`
|
|
39
|
+
`):"",checks:n,events:r,dependencies:o}}function Ge(e){if(!e.includes("#")&&!e.includes("v-slot:")&&!e.includes("data-stx-slot-binding"))return[];let s=[],t=[],n=/<!--[\s\S]*?-->|<script\b(?:"[^"]*"|'[^']*'|[^'">])*>[\s\S]*?<\/script\s*>|<style\b(?:"[^"]*"|'[^']*'|[^'">])*>[\s\S]*?<\/style\s*>|<\/?[a-z][\w:-]*\b(?:"[^"]*"|'[^']*'|[^'">])*>/gi;for(let i of e.matchAll(n)){let r=i[0];if(/^<\/template\s*>$/i.test(r)){let o=t.pop();if(o)o.end=i.index}else if(/^<template\b/i.test(r)&&!/\/\s*>$/.test(r)){let a=[...r.slice(9).matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g)].find((u)=>/^(?:#[\w-]+|v-slot:[\w-]+|data-stx-slot-binding)$/i.test(u[1])),c=(a?.[2]??a?.[3])?.trim();if(c&&a?.[1]==="data-stx-slot-binding")try{c=decodeURIComponent(c)}catch{c=void 0}let f=c?{start:i.index+r.length,end:e.length,binding:c}:void 0;if(t.push(f),f)s.push(f)}}return s}var Ue=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function Yt(e){let s=(t)=>t.replace(/[^\n]/g," ");return e.replace(/<!--[\s\S]*?-->/g,s).replace(/\{\{--[\s\S]*?--\}\}/g,s)}function le(e){let s=[],t=Yt(e);Ue.lastIndex=0;let n;while((n=Ue.exec(t))!==null){let i=(n[1]||"").trim(),r=(n[0].match(/^<script(?:\s[^>]*)?>/i)?.[0]??"<script>").length,o=(n[0].match(/<\/script\s*>$/i)?.[0]??"</script>").length,a=n.index+r,c=n.index+n[0].length-o,f=e.slice(a,c);if(/\bsrc\s*=/.test(i))continue;let u=i.match(/\btype\s*=\s*["']([^"']+)["']/i);if(u&&!/^(?:module|text\/(?:javascript|typescript))$/i.test(u[1]))continue;let b=/\bserver\b/.test(i)?"server":/\bclient\b/.test(i)?"client":"plain",T=te(e,a);s.push({kind:b,code:f,startLine:T,startColumn:ne(e,a),offset:a,attrs:i})}return s}function te(e,s){let t=1;for(let n=0;n<s&&n<e.length;n++)if(e.charCodeAt(n)===10)t++;return t}function ne(e,s){let t=e.lastIndexOf(`
|
|
40
|
+
`,s-1)+1;return s-t+1}function ue(e){let s=e.split(""),t=(i,r)=>{for(let o=i;o<r&&o<s.length;o++)if(s[o]!==`
|
|
41
|
+
`)s[o]=" "},n=[/<script(?:\s[^>]*)?>[\s\S]*?<\/script>/gi,/<style(?:\s[^>]*)?>[\s\S]*?<\/style>/gi,/<!--[\s\S]*?-->/g,/\{\{--[\s\S]*?--\}\}/g,/@verbatim\b[\s\S]*?@endverbatim\b/g];for(let i of n){i.lastIndex=0;let r;while((r=i.exec(e))!==null)t(r.index,r.index+r[0].length)}return s.join("")}function nt(e){let s=0,t="";for(let n=0;n<e.length;n++){let i=e[n];if(t){if(i==="\\"){n++;continue}if(i===t)t="";continue}if(i==='"'||i==="'"||i==="`"){t=i;continue}if(i==="("||i==="["||i==="{"){s++;continue}if(i===")"||i==="]"||i==="}"){s--;continue}if(i==="|"&&s===0){if(e[n+1]==="|"){n++;continue}if(e[n-1]==="|")continue;return e.slice(0,n)}}return e}var st=new Set([":for","x-for","v-for"]),fe=/(?:^|\s)((?::|x-|v-|@)[\w.:-]+)\s*=\s*(["'])([\s\S]*?)\2/g,xe="__stx_interpolated",Xe="__StxElement",it="__StxTemplateValue",Qt=`type ${it}<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? (T extends () => infer V ? T & V : T) : T`;function Ze(e){return e.replace(/\{\{[\s\S]*?\}\}/g,xe).replace(/\{!![\s\S]*?!!\}/g,xe)}function Jt(e,s,t){let n=0;for(let i=s;i<e.length;i++){let r=e[i];if(r==="{"){n++;continue}if(r!=="}"&&r!=="!")continue;if(e.startsWith(t,i)&&n===0)return i;if(r==="}"&&n>0)n--}return-1}function en(e,s,t="0"){let n=`__stxScript${t}`;while((e+s).includes(n))n+="_";let i=new Map,r=[],o=[],a=j(e),c=se(e),f=[],u=0;for(let d=0;d<a.length;d++){let v=a.startsWith("{{",d);if(!v&&!a.startsWith("{!!",d))continue;let E=v?2:3,m=v?"}}":"!!}",A=Jt(a,d+E,m);if(A<0)continue;let _=d,S=e.slice(_,A+m.length),D=S.slice(E,-m.length);d=A+m.length-1;let N=o.length,P=Y(c,_),M=Y(c,_+(v?2:3));o.push({code:nt(D),...M});let F=`${n}_${N}`,O=S.split(`
|
|
42
|
+
`),K=O[0].length;O[0]=F+" ".repeat(Math.max(0,K-F.length));for(let H=1;H<O.length;H++)O[H]=O[H].replace(/[^\r]/g," ");let W=i.get(P.line)??[],V=W.at(-1),re=P.column+(V?V.generatedEnd-V.sourceEnd:0);W.push({sourceStart:P.column,sourceEnd:P.column+K,generatedStart:re,generatedEnd:re+O[0].length}),i.set(P.line,W),f.push(e.slice(u,_),O.join(`
|
|
43
|
+
`)),u=_+S.length}f.push(e.slice(u));let b=f.join("");if(!o.length)return{code:b,columns:i,declarations:r};let{imports:T,body:y}=cn(s),C=[],w=0;for(let d of T.split(/\n(?=import\b)/)){if(!d.trim())continue;let v=/^import\s+(?:type\s+)?([\s\S]+?)\s+from\s*(['"][^'"]+['"])/.exec(d);if(!v){r.push({text:d});continue}let E=`${n}Module${w++}`;r.push({text:`import * as ${E} from ${v[2]}`});let m=v[1],A=/\{([\s\S]*?)\}/.exec(m);for(let N of A?.[1].split(",")??[]){let[P,M=P]=N.trim().replace(/^type\s+/,"").split(/\s+as\s+/);if(P==="default")C.push(`const ${M} = ${E}.default; type ${M} = import(${v[2]}).default`);else if(P)C.push(`import ${M} = ${E}.${P}`)}let _=m.replace(/\{[\s\S]*?\}/,""),S=/\*\s+as\s+(\w+)/.exec(_);if(S)C.push(`import ${S[1]} = ${E}`);let D=/^\s*([\w$]+)/.exec(_)?.[1];if(D)C.push(`const ${D} = ${E}.default; type ${D} = import(${v[2]}).default`)}r.push({text:`namespace ${n}Scope {
|
|
44
|
+
${C.join(`
|
|
45
45
|
`)}
|
|
46
46
|
export async function read() {
|
|
47
|
-
${
|
|
48
|
-
return {`});for(let[
|
|
47
|
+
${rt(y).replace(/^[ \t]*export[ \t]+(?=(?:const|let|var|function|async|class|interface|type)\b)/gm,"")}
|
|
48
|
+
return {`});for(let[d,v]of o.entries())r.push({text:`value${d}: (`}),r.push({text:v.code,origin:{line:v.line,column:v.column}}),r.push({text:"),"});r.push({text:`}
|
|
49
49
|
}
|
|
50
|
-
}`});for(let
|
|
50
|
+
}`});for(let d=0;d<o.length;d++)r.push({text:`declare var ${n}_${d}: Awaited<ReturnType<typeof ${n}Scope.read>>['value${d}']`});return{code:b,columns:i,declarations:r}}function qe(e,s){let t=0;for(let n of e){if(s<n.generatedStart)break;if(s<n.generatedEnd)return n.sourceStart+Math.min(s-n.generatedStart,n.sourceEnd-n.sourceStart);t=n.sourceEnd-n.generatedEnd}return s+t}function Ye(e,s){let t=0;for(let n of e){if(s<n.sourceStart)break;if(s<n.sourceEnd)return n.generatedStart+Math.min(s-n.sourceStart,n.generatedEnd-n.generatedStart);t=n.generatedEnd-n.sourceEnd}return s+t}var tn=["foreach","endforeach","forelse","endforelse","for","endfor","while","endwhile","empty","if","elseif","else","endif","unless","endunless","isset","endisset","switch","case","default","endswitch","auth","endauth","guest","endguest","env","endenv","once","endonce","break","continue"],nn=new RegExp(String.raw`^[ \t]*@(?:${tn.join("|")})\b[ \t]*(\([^\n)]*\))?[ \t]*$`,"gm");function rt(e){return e.replace(nn,(s)=>s.replace(/[^\n]/g," "))}var Qe=new Set(["x-cloak","x-ref","x-transition","x-teleport","v-slot","x-hydrate",":key","x-tooltip","x-tooltip-position"]);function sn(e){let s=ue(e),t=[],n=/(@?)\{\{([\s\S]*?)\}\}|(@?)\{!!([\s\S]*?)!!\}/g,i;while((i=n.exec(s))!==null){if(i[1]||i[3])continue;let a=i[2]??i[4]??"",c=i[2]!==void 0?2:3,f=nt(a);if(!f.trim())continue;let u=i.index+c+(f.length-f.trimStart().length);t.push({code:f.trim(),line:te(s,u),column:ne(s,u),offset:u,kind:"interpolation"})}let r=/@(if|elseif|else\s+if|unless)\b\s*\(/g;while((i=r.exec(s))!==null){let o=i.index+i[0].length-1,a=0,c=o;for(;c<s.length;c++){let T=s[c];if(T==="(")a++;else if(T===")"){if(a--,a===0)break}}if(a!==0)continue;let f=s.slice(o+1,c),u=f.trim();if(r.lastIndex=c+1,!u)continue;let b=o+1+(f.length-f.trimStart().length);t.push({code:u,line:te(s,b),column:ne(s,b),offset:i.index,kind:"condition"})}fe.lastIndex=0;while((i=fe.exec(s))!==null){let o=i[1],a=i[3]??"",c=o.replace(/\..*$/,"").replace(/^([^:].*?):.*$/,"$1");if(Qe.has(c)||Qe.has(o))continue;if(!a.trim())continue;let f=i.index+i[0].indexOf(i[2],i[0].indexOf(o)+o.length)+1;if(st.has(c)){let b=a.match(/\s+(?:in|of)\s+/);if(!b||b.index===void 0)continue;let T=a.slice(b.index+b[0].length),y=b.index+b[0].length+(T.length-T.trimStart().length);t.push({code:Ze(T.trim()),line:te(s,f+y),column:ne(s,f+y),offset:f+y,kind:"directive",attribute:c});continue}let u=a.length-a.trimStart().length;t.push({code:Ze(a.trim()),line:te(s,f+u),column:ne(s,f+u),offset:f+u,kind:"directive",attribute:c})}return t.sort((o,a)=>o.line-a.line||o.column-a.column),t}var rn=2000;function on(e,s){let t=0,n=Math.min(e.length,s+rn);for(let i=s;i<n;i++){let r=e[i];if(r==="(")t++;else if(r===")"){if(t--,t===0)return e.slice(s+1,i)}}return null}function an(e){let s=new Map,t=(a,c)=>{let f=a.split(/[,[\]{}()\s]+/).filter(Boolean);for(let u of f){let b=u.replace(/^\.\.\./,"").trim();if(!/^\$?[A-Z_$][\w$]*$/i.test(b))continue;let T=f.length===1?c:void 0,y=s.get(b);if(!y)s.set(b,{name:b,iterable:T});else if(y.iterable!==T)y.iterable=void 0}},n=/^\$?[A-Z_$][\w$]*$/i,i=(a)=>{let c=a.trim();return n.test(c)?c:void 0};for(let a of e.matchAll(/@for(?:each|else)\s*\(/g)){let c=on(e,a.index+a[0].length-1);if(c===null)continue;let f=De(c);if(!f)continue;t(f.itemVar.replace(/=>/g," "),i(f.arrayExpr))}for(let a of e.matchAll(/@for\s*\(\s*(?:(?:let|const|var)\s+)?([\w$]+|\[[^\]]*\]|\{[^}]*\})\s+(of|in)\s+([^)]*)/g))t(a[1],a[2]==="of"?i(a[3]):void 0);for(let a of e.matchAll(/@for\s*\(\s*(?:let|const|var)\s+([\w$]+)\s*[=;]/g))t(a[1]);let r=ue(e);fe.lastIndex=0;let o;while((o=fe.exec(r))!==null){let a=o[1].replace(/\..*$/,"");if(!st.has(a))continue;let c=o[3].match(/\s+(?:in|of)\s+/);if(!c||c.index===void 0)continue;t(o[3].slice(0,c.index),i(o[3].slice(c.index+c[0].length)))}for(let a of e.matchAll(/@(?:php|js|ts)\b([\s\S]*?)@end(?:php|js|ts)\b/g))for(let c of a[1].matchAll(/\b(?:const|let|var|function|class)\s+([\w$]+)/g))t(c[1]);return[...s.values()].sort((a,c)=>a.name.localeCompare(c.name))}function ce(e){let s=new Set;for(let t of e.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s+([\w$]+)/gm))s.add(t[1]);for(let t of e.matchAll(/^\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([\w$]+)/gm))s.add(t[1]);for(let t of e.matchAll(/^\s*(?:export\s+)?class\s+([\w$]+)/gm))s.add(t[1]);for(let t of e.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s*[[{]([^\]}]*)[\]}]/gm))for(let n of t[1].split(",")){let i=n.split(":").pop().split("=")[0].replace(/^\.\.\./,"").trim();if(/^[A-Z_$][\w$]*$/i.test(i))s.add(i)}return[...s].sort()}var Je=["params","query","cookies","host","ip","setResponseStatus","setResponseHeader","notFound","request","url","definePageMeta","defineClientPayload","defineStore","props","$props"];function cn(e){let s=/^[ \t]*import\b[\s\S]*?(?:from\s*['"][^'"]*['"]|['"][^'"]*['"])[ \t]*;?[ \t]*$/gm,t=[],n=e.replace(s,(i)=>(t.push(i.trim()),i.split(`
|
|
51
51
|
`).map(()=>"").join(`
|
|
52
52
|
`)));return{imports:t.join(`
|
|
53
|
-
`),body:n}}var
|
|
54
|
-
`),
|
|
55
|
-
`),
|
|
56
|
-
`)
|
|
57
|
-
`);
|
|
58
|
-
`).
|
|
59
|
-
`)
|
|
60
|
-
`)
|
|
61
|
-
`).length;t.push({line:
|
|
62
|
-
`)
|
|
53
|
+
`),body:n}}var et=["$env","$user","$slot","$slots","$attrs","$props","$page","$route","$loop","loop","$errors","$csrf","$native","props","slot"];function ot(e){let s=new Set,t=new Set;for(let n of e){let i=n.kind==="server"?s:t;for(let r of ce(n.code))i.add(r)}return[...s].filter((n)=>t.has(n)).sort()}var ln=/^\s*[A-Z_$][\w$]*\s*=[^=]/i;function un(e){let s=new Map,t=/!|===|!==|==|!=|&&|\|\||<|>|\btypeof\b|\binstanceof\b|\bin\b/;for(let n of e){let i=j(n),{depths:r,balanced:o}=oe(i);if(!o)continue;let a=/^([ \t]*(?:export[ \t]+)?const[ \t]+)([A-Za-z_$][\w$]*)[ \t]*(?::[^=\n]+)?=[ \t]*([^\n]+)$/gm;for(let c of i.matchAll(a)){let f=c.index??0;if(r[f+c[1].length]!==0)continue;let u=c[2],b=f+c[0].length-c[3].length,T=n.slice(b,f+c[0].length).trim().replace(/;$/,"").trim(),y=c[3],C=t.test(y)&&!/\bawait\b|=>|\bfunction\b|[{}]/.test(y)&&!/[,+\-*/%&|?:=]$/.test(T)&&oe(y).balanced;s.set(u,s.has(u)||!C?null:T)}}return new Map([...s].filter((n)=>n[1]!==null))}function at(e,s,t=0,n=new Set){if(s.size===0||t>=5)return e;let i=j(e),r="",o=0;for(let a of i.matchAll(/[A-Za-z_$][\w$]*/g)){let c=a.index??0,f=a[0],u=s.get(f);if(!u||n.has(f))continue;let b=i.slice(0,c).trimEnd(),T=i.slice(c+f.length).trimStart();if(b.endsWith(".")||/^:(?!:)/.test(T)&&/[{,]$/.test(b))continue;if(c>0&&/[\w$]/.test(i[c-1]))continue;r+=`${e.slice(o,c)}(${at(u,s,t+1,new Set([...n,f]))})`,o=c+f.length}return r+e.slice(o)}function fn(e,s){let t=/@(if|unless|elseif|else|endif|endunless)\b\s*(\()?/g,n=[],i;while((i=t.exec(e))!==null){if(i.index>s)break;let r=i[1];if(i.index===s){if(r==="elseif"){let a=n[n.length-1];if(a?.current)a.seen.push(a.current);if(a)a.current=null}break}if(r==="endif"||r==="endunless"){n.pop();continue}let o="";if(i[2]==="("){let a=0,c=i.index+i[0].length-1,f=c+1;for(;c<e.length;c++){let u=e[c];if(u==="(")a++;else if(u===")"){if(a--,a===0)break}}o=e.slice(f,c).trim(),t.lastIndex=c+1}if(r==="if")n.push({seen:[],current:o});else if(r==="unless")n.push({seen:[],current:`!(${o})`});else if(r==="elseif"||r==="else"){let a=n[n.length-1];if(!a)continue;if(a.current)a.seen.push(a.current);a.current=r==="elseif"?o:null}}return n.flatMap((r)=>[...r.seen.map((o)=>`!(${o})`),...r.current?[r.current]:[]]).filter(Boolean)}function dn(e){let s=e.code.trim();if(!s)return null;if(e.attribute?.startsWith("@")){if(ln.test(s))return null;let n=";(($event: any): void => { ";return{text:`${n}${s} });`,prefixLength:n.length}}let t=";void ((";return{text:`${t}${s}));`,prefixLength:t.length}}var pn=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.{1,2}\/[^'"\n]*)\2/g;function tt(e,s){return ct(e,s).code}function ct(e,s){let t=new Map;if(!s)return{code:e,columns:t};let n=se(e),i=[],r=0;for(let o of e.matchAll(pn)){let a=o.index,[c,f,u,b]=o,T=be.default.resolve(s,b).replace(/\\/g,"/"),y=`${f}${u}${T}${u}`;if(i.push(e.slice(r,a),y),r=a+c.length,c.includes(`
|
|
54
|
+
`))continue;let C=Y(n,a),w=t.get(C.line)??[],d=w.at(-1),v=C.column+(d?d.generatedEnd-d.sourceEnd:0);w.push({sourceStart:C.column,sourceEnd:C.column+c.length,generatedStart:v,generatedEnd:v+y.length}),t.set(C.line,w)}return i.push(e.slice(r)),{code:i.join(""),columns:t}}function gn(e,s,t){let n=qe(e.importColumns?.get(s)??[],t);return qe(e.scriptColumns?.get(s)??[],n)}function lt(e,s,t){let n=Ye(e.scriptColumns?.get(s)??[],t);return Ye(e.importColumns?.get(s)??[],n)}function mn(e){return" ".repeat(Math.max(0,(e.startColumn??1)-1))}function hn(e){let s=new Set,t=j(e);for(let n of t.matchAll(/\bimport\s+(?:type\s+)?([\w$*{}\s,]+?)\s+from\b/g)){let i=n[1],r=/\{([^}]*)\}/.exec(i);for(let f of r?.[1].split(",")??[]){let u=f.trim().replace(/^type\s+/,"").split(/\s+as\s+/).pop()?.trim();if(u&&/^[A-Z_$][\w$]*$/i.test(u))s.add(u)}let o=i.replace(/\{[^}]*\}/,""),a=/\*\s*as\s+([A-Z_$][\w$]*)/i.exec(o);if(a)s.add(a[1]);let c=/^\s*([A-Z_$][\w$]*)/i.exec(o);if(c&&c[1]!=="type")s.add(c[1])}return[...s].sort()}function ut(e,s={}){let t=le(e),n=e.split(`
|
|
55
|
+
`),i=Array.from({length:n.length},()=>""),r=new Map,o=new Map,a=new Map,c=[],f=t.filter((w)=>w.kind==="server").map((w)=>w.code).join(`
|
|
56
|
+
`),u=s.filePath&&s.templateExpressions!==!1?He(e,ue(e),{filePath:s.filePath,componentsDir:s.componentsDir,projectRoot:s.projectRoot,readComponent:s.readComponent,scriptCode:(w,d)=>le(w).map((v)=>tt(v.code,be.default.dirname(d))).join(`
|
|
57
|
+
`)}):void 0,b=new Set,T=[];for(let[w,d]of t.entries()){let v=en(mn(d)+d.code,f,String(w));for(let[_,S]of v.columns)o.set(d.startLine+_-1,S);for(let _ of v.declarations)c.push({text:tt(_.text,s.originDir??""),origin:_.origin?{..._.origin,line:_.origin.line+d.startLine-1}:void 0});let E=rt(v.code),m=ct(E,s.originDir??"");for(let[_,S]of m.columns)a.set(d.startLine+_-1,S);let A=m.code.split(`
|
|
58
|
+
`);A.forEach((_,S)=>{let D=d.startLine-1+S;if(D<i.length)i[D]=_,b.add(D)}),T.push(d.startLine-1+A.length-1)}for(let w of T){let d=i[w]?.trim()===""?w:w+1;if(d<i.length&&i[d].trim()===""&&(d===w||!b.has(d)))i[d]=";"}let y=(w,d)=>{for(let[v,E]of w.split(`
|
|
59
|
+
`).entries())if(i.push(E),d)r.set(i.length,v===0?d:{...d,line:d.line+v,column:1,prefixLength:0})};for(let w of c)y(w.text,w.origin);if(s.globals!==!1){y("");let w=new Set([...t.flatMap((m)=>ce(m.code)),...t.flatMap((m)=>hn(m.code))]),d=(m)=>{if(!w.has(m))y(`declare var ${m}: any`)};if(s.runtimeGlobals!==!1){if(!w.has("window"))y("declare var window: any");for(let m of Q)d(m)}let v=[...new Set([...Je,...pe,...et])].filter((m)=>s.runtimeGlobals!==!1||!Q.includes(m));if(s.contextScope==="global"){y("declare global {");for(let m of v)y(` var ${m}: any`);y("}")}else{for(let m of Je)d(m);for(let m of pe)d(m);for(let m of et)d(m)}y(`declare var ${xe}: any`);let E=new Set(t.flatMap((m)=>ce(m.code)));y(`type ${Xe}<T> = T extends readonly (infer E)[] ? E : T extends Iterable<infer E2> ? E2 : any`);for(let m of an(e)){if(E.has(m.name))continue;let A=m.iterable&&E.has(m.iterable)?`${Xe}<typeof ${m.iterable}>`:"any";y(`declare var ${m.name}: ${A}`)}}if(s.templateExpressions!==!1){if(u?.declarations)for(let d of u.declarations.split(`
|
|
60
|
+
`))y(d);let w=sn(e).map((d)=>{let v=u?.events.get(d.offset??-1);if(v){d.anchor=!0;let E=d.code.trim(),m=/^([\w$]+)\s*=\s*([^=][\s\S]*)$/.exec(E),A=m?`void ((${m[2]}) satisfies __StxAssignedValue<typeof ${m[1]}>)`:/^[\w$]+(?:\.[\w$]+)*$/.test(E)?`${E} satisfies (($event: ${v}) => unknown)`:E,_=`;(($event: ${v}): void => { `;return{expression:d,statement:{text:`${_}${A} });`,prefixLength:_.length}}}return{expression:d,statement:dn(d)}}).filter((d)=>d.statement!==null);if(w.push(...u?.checks||[]),w.length>0){let d=ue(e),v=Ge(d),E=un(t.map((S)=>S.code)),A=[...new Set(t.flatMap((S)=>ce(S.code)))].filter((S)=>/^[A-Z_$][\w$]*$/i.test(S)),_=0;if(A.length>0){y(Qt);for(let S of A)y(`function __StxRead_${S}() { return ${S} }`),y(`type __StxT_${S} = ${it}<ReturnType<typeof __StxRead_${S}>>`);y(`;((${A.map((S)=>`${S}: __StxT_${S}`).join(", ")}) => {`),_=1}for(let{expression:S,statement:D}of w){let N=" ".repeat(_),P=S.offset===void 0?[]:v.filter((V)=>S.offset>=V.start&&S.offset<V.end),M=P.map((V)=>`;((${V.binding.replace(/[\r\n]/g," ")}: any) => { `).join(""),F=" });".repeat(P.length),O=S.offset===void 0?[]:fn(d,S.offset),K=O.length>0?`${O.map((V)=>`if (${at(V,E)}) `).join("")}{ `:"",W=O.length>0?" }":"";y(N+M+K+D.text+W+F,{line:S.line,column:S.column,expression:S,prefixLength:D.prefixLength+N.length+M.length+K.length,guardPrefixLength:N.length+M.length+K.length})}if(_>0)y("});")}}let C=!1;if(s.reference&&i[0]!==void 0&&i[0].trim()==="")i[0]=`/// <reference path=${JSON.stringify(s.reference.replace(/\\/g,"/"))} />`,C=!0;return y("export {}"),{text:i.join(`
|
|
61
|
+
`),lineMap:r,sourceLineCount:n.length,componentDependencies:u?.dependencies,referenced:C,scriptColumns:o,importColumns:a}}function se(e){let s=[0];for(let t=0;t<e.length;t++)if(e.charCodeAt(t)===10)s.push(t+1);return s}function Y(e,s){let t=0,n=e.length-1;while(t<n){let i=Math.ceil((t+n)/2);if(e[i]<=s)t=i;else n=i-1}return{line:t+1,column:s-e[t]+1}}function de(e,s,t){let n=Math.min(Math.max(s,1),e.length)-1,i=n+1<e.length?e[n+1]-1:Number.MAX_SAFE_INTEGER;return Math.min(e[n]+Math.max(t,1)-1,i)}function ft(e,s){if(!e.expression)return!1;return e.inGuard===!0||s===2774}function dt(e,s,t){let n=e.lineMap.get(s);if(!n)return s<=e.sourceLineCount?{line:s,column:gn(e,s,t)}:null;let i=n.expression?.anchor?0:Math.max(0,t-1-(n.prefixLength??0));return{line:n.line,column:n.column+i,expression:n.expression,inGuard:t<=(n.guardPrefixLength??0)}}var pt=["module","exports","require","props","$props","$bool","$num","defineProps","withDefaults","defineClientPayload","useServerData","useRuntimeConfig","useServerRuntimeConfig","state","derived","effect","batch","onMount","onDestroy","definePageMeta","useRoute","useRouter","useHead","useSeoMeta","setResponseStatus","setResponseHeader","notFound","ref","reactive","computed","watch","onMounted","onUnmounted","nextTick","defineEmits","defineExpose","defineSlots","provide","inject","useColorMode","useDark","useMediaQuery","useScrollLock","usePreferredDark","usePreferredLight","usePreferredReducedMotion","usePreferredContrast","window","document","console","confirm","alert","fetch","params"];var xn=new Set(["module","exports","require","$bool","$num","window","document","console","confirm","alert","fetch"]),mt=pt.filter((e)=>!xn.has(e)).sort(),ht=[...Q].sort(),bn=[...new Set([...mt,...ht])].sort(),Sn=new Set(mt),yn=new Set(ht),wn=new Set(bn),gt=/\bimport\s+(?!type[\s{])\{([^}]*)\}\s*from\s*(['"])stx\2/g;function vn(e,s){if(s==="server")return`'${e}' is not provided by 'stx' in a <script server> block. The engine binds only its own names there (defineProps, state, useHead, ...); any other name becomes \`await import('stx')\`, which does not resolve, so the whole script fails when the page renders. Import it from '@stacksjs/stx' instead.`;return`'${e}' is not provided by 'stx' in a client <script> block. The import is replaced by the window.stx runtime, which has no '${e}', so it is undefined in the browser.`}function xt(e,s){let t=[];for(let n of s){if(n.offset===void 0)continue;let i=n.kind==="server"?Sn:yn;gt.lastIndex=0;for(let r of n.code.matchAll(gt)){let o=r.index+r[0].indexOf("{")+1;for(let a of r[1].matchAll(/[^,]+/g)){let c=a[0];if(/^\s*type\s/.test(c))continue;let f=/^\s*([A-Za-z_$][\w$]*)/.exec(c);if(!f)continue;let u=f[1];if(!wn.has(u)||i.has(u))continue;let b=n.offset+o+a.index+f[0].length-u.length,T=e.slice(0,b),y=T.split(`
|
|
62
|
+
`).length;t.push({line:y,column:b-(T.lastIndexOf(`
|
|
63
|
+
`)+1)+1,offset:b,length:u.length,name:u,kind:n.kind,message:vn(u,n.kind)})}}}return t}var U=X(require("node:path"),1),Tn="@stacksjs/stx-typescript-plugin";function En(e,s){let t=U.default.resolve(e);for(;;){let n=U.default.join(t,"tsconfig.json");if(s(n))return n;let i=U.default.dirname(t);if(i===t)return;t=i}}function bt(e,s,t){let n=En(e,t);if(!n)return;let i=new Set,r=(o)=>{if(i.has(o))return;i.add(o);let a=s(o);if(!a)return;let c=a.compilerOptions?.plugins;if(Array.isArray(c)){let u=c.find((T)=>T?.name===Tn),b=Array.isArray(u?.libs)?u.libs.filter((T)=>typeof T==="string"):[];return u?{configPath:o,libs:b.map((T)=>U.default.resolve(U.default.dirname(o),T))}:null}let f=typeof a.extends==="string"?[a.extends]:Array.isArray(a.extends)?a.extends:[];for(let u of[...f].reverse()){if(typeof u!=="string"||!u.startsWith("."))continue;let b=U.default.resolve(U.default.dirname(o),u.endsWith(".json")?u:`${u}.json`),T=r(b);if(T!==void 0)return T}return};return r(n)??void 0}var St=Symbol.for("@stacksjs/stx-typescript-plugin"),$n=new Set([2300,2451,2403]);function ie(e){return e.endsWith(".stx")}function yt(e){return ie(e)||e.endsWith(".md")}function Cn(e){if(!e)return;return z.existsSync(B.default.join(e,"stx-module.d.ts"))&&z.existsSync(B.default.join(e,"stx.d.ts"))?B.default.join(e,"stx-module.d.ts"):void 0}function _n(e,s=z.existsSync){let t=e;for(;;){let n=B.default.join(t,"node_modules","@stacksjs","stx","stx-module.d.ts");if(s(n))return n;let i=B.default.dirname(t);if(i===t)return;t=i}}function kn(e,s=B.default.join(vt.tmpdir(),"stx-typescript-plugin")){let t=e.map((i)=>`/// <reference path=${JSON.stringify(i.replace(/\\/g,"/"))} />`).join(`
|
|
63
64
|
`)+`
|
|
64
|
-
`,n=B.default.join(s,`${
|
|
65
|
+
`,n=B.default.join(s,`${wt.createHash("sha1").update(t).digest("hex").slice(0,16)}.d.ts`);if(!z.existsSync(n))z.mkdirSync(s,{recursive:!0}),z.writeFileSync(n,t);return n}function An(e,s,t,n){let i=(a)=>ut(s,{templateExpressions:ie(e),originDir:B.default.dirname(e),filePath:e,readComponent:n.readComponent,componentsDir:n.componentsDir,projectRoot:n.projectRoot,reference:a,runtimeGlobals:!a,contextScope:"global"}),r=i(n.declarations);if(n.declarations&&!r.referenced)r=i(void 0);let o=le(s);return{version:t,source:s,virtual:r,blocks:o,sourceStarts:se(s),virtualStarts:se(r.text),collisions:new Set(ot(o))}}function Rn(e,s){let t=e.findConfigFile(s,e.sys.fileExists);if(!t)return;let n=e.readConfigFile(t,e.sys.readFile);if(n.error)return;let i=e.parseJsonConfigFileContent(n.config,e.sys,B.default.dirname(t),void 0,t),r={};if(i.options.types)r.types=i.options.types;let o=i.options.paths;if(o){let a=i.options.baseUrl??i.options.pathsBasePath??B.default.dirname(t);r.paths={};for(let[c,f]of Object.entries(o))r.paths[c]=f.map((u)=>B.default.isAbsolute(u)?u:B.default.resolve(a,u))}return r}function Pn(e,s={}){let t=e.typescript,n={},i=new Set,r=new WeakSet;return{create(o){let a=(l)=>{o.project.projectService.logger.info(`[stx-plugin] ${l}`)};if(o.languageService[St])return r.add(o.project),a("already applied to this project by another registration of the plugin; leaving it as it is"),o.languageService;a("TypeScript stx plugin initialized");let{languageService:c,languageServiceHost:f}=o,u=(l)=>{let g=c[l];return typeof g==="function"?g.bind(c):()=>{return}},b=f.getScriptSnapshot?.bind(f),T=f.getScriptVersion?.bind(f),y=Cn(s.declarationsDir);if(!y)a("the bundled stx declarations were not found; apps without their own fall back to `any`");let C=(l)=>t.sys?.fileExists(l)??z.existsSync(l),w=(l)=>{let g=t.readConfigFile?.(l,(p)=>t.sys.readFile(p));return g&&!g.error?g.config:void 0},d=new Map,v=(l)=>{let g=B.default.dirname(l);if(!d.has(g)){let p=_n(g,C)??y,x=[];try{x=(bt(g,w,C)?.libs??[]).filter(C)}catch(h){a(`could not read the stx entry of the project's tsconfig: ${String(h)}`)}d.set(g,p&&x.length>0?kn([p,...x]):p)}return d.get(g)},E=new Map,m=(l)=>{let g=b?.(l);return g?g.getText(0,g.getLength()):t.sys?.readFile(l)},A=()=>n.enabled!==!1;i.add(()=>{E.clear(),o.project.refreshDiagnostics?.()});let _=(l)=>{if(!yt(l)||!b)return;let g=`${T?.(l)||"0"}:${f.getProjectVersion?.()||""}`,p=E.get(l);if(p&&p.version===g&&[...p.virtual.componentDependencies||[]].every(([h,k])=>m(h)===k))return p;let x=b(l);if(!x)return;try{let h=o.project.getCurrentDirectory?.(),k=h?B.default.resolve(h,typeof o.config?.componentsDir==="string"?o.config.componentsDir:"components"):void 0,I=An(l,x.getText(0,x.getLength()),g,{declarations:v(l),readComponent:m,componentsDir:k,projectRoot:h});return E.set(l,I),I}catch(h){a(`failed to build virtual document for ${l}: ${String(h)}`);return}},S=(l)=>ie(l)?_(l):void 0,D=(l,g)=>{let p=Y(l.virtualStarts,g);return dt(l.virtual,p.line,p.column)},N=(l,g)=>{let p=D(l,g);if(!p)return;return de(l.sourceStarts,p.line,p.column)},P=(l,g)=>{let p=Y(l.sourceStarts,g);return de(l.virtualStarts,p.line,lt(l.virtual,p.line,p.column))},M=(l,g)=>{let p=N(l,g.start);if(p===void 0)return;let x=N(l,g.start+g.length);return{start:p,length:x!==void 0&&x>=p?x-p:g.length}},F=(l,g)=>l.blocks.some((p)=>p.offset!==void 0&&g>=p.offset&&g<=p.offset+p.code.length),O=(l)=>{let g=S(l.fileName);if(!g)return l;let p=M(g,l.textSpan);if(!p)return;let x=l.contextSpan?M(g,l.contextSpan):void 0;return{...l,textSpan:p,contextSpan:x}},K=(l)=>l?.map(O).filter((g)=>g!==void 0),W=(l)=>l?.filter((g)=>{let p=S(g.fileName);if(!p)return!0;let{line:x}=Y(p.virtualStarts,g.textSpan.start);return x<=p.virtual.sourceLineCount&&!p.virtual.lineMap.has(x)});if(b)f.getScriptSnapshot=(l)=>{let g=_(l);if(g)return t.ScriptSnapshot.fromString(g.virtual.text);return b(l)};let V=f.getCompilationSettings?.bind(f),re=t.server?.ProjectKind!==void 0&&o.project.projectKind===t.server.ProjectKind.Inferred;if(V&&re){let l=null,g;f.getCompilationSettings=()=>{let p=V();if(l===null)try{l=Rn(t,o.project.getCurrentDirectory())}catch(x){a(`could not read the project's tsconfig: ${String(x)}`),l=void 0}if(!l)return p;if(g?.from!==p)g={from:p,options:{...p,...l.paths&&!p.paths?{paths:l.paths}:{},...l.types&&!p.types?{types:l.types}:{}}};return g.options}}let H=(l,g)=>{let p=_(l);if(!p)return g;if(ie(l)&&!A())return[];let x=[];for(let h of g){let k=typeof h.messageText==="string"?h.messageText:h.messageText.messageText;if($n.has(h.code)){let G=k.match(/'([^']+)'/)?.[1];if(G&&p.collisions.has(G))continue}if(h.start===void 0){x.push(h);continue}let I=D(p,h.start);if(!I||ft(I,h.code))continue;let L=de(p.sourceStarts,I.line,I.column),ee=N(p,h.start+(h.length??0));x.push({...h,start:L,length:ee!==void 0&&ee>L?ee-L:h.length??0})}return x},Et=u("getSemanticDiagnostics");c.getSemanticDiagnostics=(l)=>{let g=H(l,Et(l)),p=S(l);if(!p||!A())return g;let x=c.getProgram?.()?.getSourceFile(l);for(let h of xt(p.source,p.blocks))g.push({file:x,start:h.offset,length:h.length,messageText:h.message,category:t.DiagnosticCategory?.Error??1,code:0,source:"stx"});return g};let $t=u("getSyntacticDiagnostics");c.getSyntacticDiagnostics=(l)=>H(l,$t(l));let Ct=u("getSuggestionDiagnostics");c.getSuggestionDiagnostics=(l)=>H(l,Ct(l));let Se=u("getQuickInfoAtPosition");c.getQuickInfoAtPosition=(l,g,...p)=>{let x=S(l);if(!x)return Se(l,g,...p);if(!A())return;let h=Se(l,P(x,g),...p);if(!h)return h;let k=M(x,h.textSpan);return k?{...h,textSpan:k}:void 0};let ye=u("getCompletionsAtPosition");c.getCompletionsAtPosition=(l,g,p,...x)=>{let h=S(l);if(!h)return ye(l,g,p,...x);if(!A()||!F(h,g))return;let k=ye(l,P(h,g),{...p,includeCompletionsForModuleExports:!1},...x);if(!k)return k;let I=(L)=>L&&M(h,L);return{...k,optionalReplacementSpan:I(k.optionalReplacementSpan),entries:k.entries.filter((L)=>!L.name.startsWith("__stx")&&!L.name.startsWith("__Stx")).map((L)=>L.replacementSpan?{...L,replacementSpan:I(L.replacementSpan)}:L)}};let we=u("getCompletionEntryDetails");c.getCompletionEntryDetails=(l,g,...p)=>{let x=S(l);if(!x)return we(l,g,...p);let h=we(l,P(x,g),...p);return h?{...h,codeActions:void 0}:h};let ve=u("getSignatureHelpItems");c.getSignatureHelpItems=(l,g,...p)=>{let x=S(l);if(!x)return ve(l,g,...p);if(!A()||!F(x,g))return;let h=ve(l,P(x,g),...p),k=h&&M(x,h.applicableSpan);return h&&k?{...h,applicableSpan:k}:void 0};let Te=u("getDefinitionAndBoundSpan");c.getDefinitionAndBoundSpan=(l,g)=>{let p=S(l);if(!p)return Ee(Te(l,g));if(!A())return;let x=Te(l,P(p,g)),h=x&&M(p,x.textSpan);return x&&h?{...Ee(x),textSpan:h}:void 0};let Ee=(l)=>l&&{...l,definitions:W(l.definitions)};for(let l of["getDefinitionAtPosition","getTypeDefinitionAtPosition","getImplementationAtPosition"]){let g=u(l);c[l]=(p,x,...h)=>{let k=S(p);if(k&&!A())return;return W(g(p,k?P(k,x):x,...h))}}for(let l of["getReferencesAtPosition"]){let g=u(l);c[l]=(p,x,...h)=>{let k=S(p);if(k&&!A())return;return K(g(p,k?P(k,x):x,...h))}}let _t=u("findReferences");c.findReferences=(l,g)=>{let p=S(l);if(p&&!A())return;return _t(l,p?P(p,g):g)?.map((x)=>{let h=O(x.definition);return h?{definition:h,references:K(x.references)}:void 0}).filter((x)=>x!==void 0)};let kt=u("getDocumentHighlights");c.getDocumentHighlights=(l,g,p)=>{let x=S(l);if(x&&(!A()||!F(x,g)))return;return kt(l,x?P(x,g):g,p)?.map((h)=>{let k=S(h.fileName);if(!k)return h;return{...h,highlightSpans:h.highlightSpans.map((I)=>{let L=M(k,I.textSpan);return L?{...I,textSpan:L,contextSpan:I.contextSpan&&M(k,I.contextSpan)}:void 0}).filter((I)=>I!==void 0)}})};let At=u("getNavigationTree");c.getNavigationTree=(l)=>{let g=At(l),p=S(l);if(!p)return g;let x=(k)=>{let I=k.spans.map((G)=>M(p,G)).filter((G)=>G!==void 0);if(I.length===0)return;let L=k.nameSpan&&M(p,k.nameSpan),ee=k.childItems?.map(x).filter((G)=>G!==void 0);return{...k,spans:I,nameSpan:L,childItems:ee}},h={...g,spans:[{start:0,length:p.source.length}]};return A()?{...h,childItems:g.childItems?.map(x).filter((k)=>k!==void 0)}:{...h,childItems:[]}};let Rt={getEncodedSemanticClassifications:()=>{return},getEncodedSyntacticClassifications:()=>{return},getSemanticClassifications:()=>[],getSyntacticClassifications:()=>[],getFormattingEditsForDocument:()=>[],getFormattingEditsForRange:()=>[],getFormattingEditsAfterKeystroke:()=>[],getNavigationBarItems:()=>[],getOutliningSpans:()=>[],getBraceMatchingAtPosition:()=>[],getTodoComments:()=>[],getDocCommentTemplateAtPosition:()=>{return},getJsxClosingTagAtPosition:()=>{return},getLinkedEditingRangeAtPosition:()=>{return},getSpanOfEnclosingComment:()=>{return},getCodeFixesAtPosition:()=>[],getApplicableRefactors:()=>[],getEditsForRefactor:()=>{return},getRenameInfo:()=>({canRename:!1,localizedErrorMessage:"Rename is not supported in .stx files."}),findRenameLocations:()=>{return},provideInlayHints:()=>[],prepareCallHierarchy:()=>{return},provideCallHierarchyIncomingCalls:()=>[],provideCallHierarchyOutgoingCalls:()=>[],getFileReferences:()=>[]};for(let[l,g]of Object.entries(Rt)){let p=c[l];if(typeof p!=="function")continue;let x=p.bind(c);c[l]=(h,...k)=>typeof h==="string"&&ie(h)?g():x(h,...k)}return c[St]=!0,a("Language service proxy created"),c},getExternalFiles(o){if(r.has(o))return[];return o.getFileNames().filter(yt)},onConfigurationChanged(o){n={...n,...o};for(let a of i)a()}}}var Tt=Pn;module.exports=Tt;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx-vscode",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.816",
|
|
5
5
|
"description": "stx language support for VS Code extensions to embed: the hovers, completions, diagnostics, grammar, snippets, language configuration and TypeScript server plugin behind the stx extension.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|