@devwareng/vanilla-ts 1.9.92 → 1.9.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +4 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- function pe(n){let e=n==null?"":String(n),t=e.toLowerCase();return(t.includes("<script")||t.includes("javascript:"))&&(e=""),e=e.replace(/url\(\s*(['"])?\s*\1?\s*\)/gi,""),e.replace(/<\s*(script|iframe|object|embed|link|style|meta|body)[^>]*>.*?<\s*\/\s*\1\s*>/gi,"").replace(/<\s*(script|iframe|object|embed|link|style|meta)[^>]*>/gi,"").replace(/\s+on\w+\s*=\s*(['"]).*?\1/gi,"").replace(/\s+on\w+\s*=\s*[^\s>]+/gi,"").replace(/\s(href|src)\s*=\s*(['"]?)\s*(javascript:|vbscript:|data:|file:)[^'">\s]*\2/gi,'$1="#"')}function F(n,...e){return n.reduce((t,r,o)=>{let i=o<e.length?pe(e[o]):"";return t+r+i},"")}var fe=n=>n.replace(/<\/?(script|iframe|object|embed|link|meta|style|form|textarea|svg|math|body)[^>]*>/gi,"").replace(/<(?!\/?(b|i|em|strong|p|br|ul|ol|li|a|div|span|h1|h2|h3|h4|h5|h6|section|article|input|button)\b)[^>]*>/gi,"").replace(/\s+on[a-z]+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/\s*style\s*=\s*("[^"]*"|'[^']*')/gi,"").replace(/<a\b([^>]*)href\s*=\s*(['"]?)(?!https?:|#)[^'"\s>]+(['"]?)([^>]*)>/gi,"<a$1$4>").replace(/\s+(href|src)\s*=\s*(['"]?)\s*(javascript:|data:)[^'"\s>]*/gi,"").replace(/<a\b([^>]*)\bhref\s*=\s*(['"])(\/blog|#blog)\2([^>]*)>/gi,'<a$1 href=$2$3$2 href-line="true"$4>').trim(),he=n=>n?.map(e=>fe(e)).join("")??"";import z from"dompurify";var _=(n,e)=>{let r={...{ADD_TAGS:["my-custom-tag"]},...e};return typeof n=="string"?z.sanitize(n,r):z.sanitize(n.innerHTML,r)};var I=(n,e,t)=>{if(typeof n=="string"){let r=document.getElementById(n);r?r.addEventListener(e,t):console.warn(`Element with id '${n}' not found.`)}else n instanceof HTMLElement?n.addEventListener(e,t):n===document?document.addEventListener(e,t):console.warn("Invalid target parameter provided.")};import{createStore as ge}from"zustand/vanilla";import q from"dompurify";function Te(n,e){let t=[],r=n.replace(/:[^/]+/g,s=>(t.push(s.slice(1)),"([^/]+)")),o=new RegExp(`^${r}$`),i=e.match(o),a={};return i&&t.forEach((s,c)=>{a[s]=q.sanitize(i[c+1]??"")}),a}function ye(n){let e={},t=new URLSearchParams(n);for(let[r,o]of t.entries())e[r]=q.sanitize(o);return e}var C=ge((n,e)=>({params:{},query:{},setFromPattern:t=>{let r=window.location.pathname,o=Te(t,r),i=ye(window.location.search);n({params:o,query:i})},getParam:t=>e().params[t],getQuery:t=>e().query[t]}));function U(n){let e=C.getState();e.setFromPattern(n);let t=e.params,r=e.query;return{...t,...r}}var j=(n,e,t)=>{let r=document.querySelectorAll(n);return r.forEach(o=>{o.addEventListener(e,t)}),()=>{r.forEach(o=>{o.removeEventListener(e,t)})}};import B from"dompurify";var W=(n,e,t={},r)=>{let o={USE_PROFILES:{svg:!0,html:!0},ALLOWED_TAGS:["svg","path","circle","rect","line","polyline","polygon","g","main","div","h1","h2","h3","h4","h5","h6","p","button","span","a","img","input","ul","li","i","label","form"],ALLOWED_ATTR:["class","id","href","src","alt","title","fill","stroke","stroke-width","viewBox","xmlns","d","x","y","cx","cy","r","width","height","type","name","value","placeholder","data-click","data-change","data-select","data-classlist","data-hover","data-submit","data-key","data-event"],FORBID_TAGS:["script","iframe","foreignObject","body","html"],FORBID_ATTR:["style","xlink:href"],ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto|tel|ftp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,...r};B.addHook("uponSanitizeAttribute",(s,c)=>{let l=(c.attrName||"").toLowerCase(),d=(c.attrValue??"").toString().trim();if(l.startsWith("on")){c.keepAttr=!1;return}if(/^data-(click|change|submit|select|hover|classlist|key|event)$/.test(l)){c.keepAttr=!0;return}if(s.nodeName.toLowerCase()==="img"&&l==="src"){/^https?:\/\//i.test(d)||/^\/(?!\/)/.test(d)||/^data:image\/(png|jpeg|jpg|gif|webp);base64,/i.test(d)||(c.keepAttr=!1);return}if(l==="class"){let y=d.split(/\s+/).filter(Boolean).filter(f=>{if(/^[a-zA-Z0-9\-\:\/_\[\]\(\)]*$/.test(f)){if(/^bg-\[url\(.*\)\]$/.test(f)){let v=f.replace(/^bg-\[url\(/,"").replace(/\)\]$/,"").replace(/^['"]|['"]$/g,"");return v===""||/^https?:\/\//i.test(v)||/^\/(?!\/)/.test(v)||/^\.{0,2}\//.test(v)}return/^bg-\[\]$/.test(f),!0}return!1});c.attrValue=y.join(" ");return}});let i=B.sanitize(e,{...o,RETURN_DOM_FRAGMENT:!0});for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(i);let a=(s,c)=>{n.querySelectorAll(`[${s}]`).forEach(l=>{let d=l.getAttribute(s);d&&Object.prototype.hasOwnProperty.call(t,d)&&l.addEventListener(c,m=>{c==="submit"&&m.preventDefault(),t[d](m)})})};a("data-click","click"),a("data-change","change"),a("data-select","select"),a("data-submit","submit"),n.querySelectorAll("[data-key]").forEach(s=>{let c=s.dataset.key,l=s.dataset.event??"click";c&&Object.prototype.hasOwnProperty.call(t,c)&&s.addEventListener(l,t[c])}),n.querySelectorAll("[data-hover]").forEach(s=>{let c=s.dataset.hover;c&&Object.prototype.hasOwnProperty.call(t,c)&&(s.addEventListener("mouseenter",t[c]),s.addEventListener("mouseleave",t[c]))}),n.querySelectorAll("[data-classlist]").forEach(s=>{let c=s.dataset.classlist;/^[a-zA-Z0-9\-\s:_]+$/.test(c)&&s.classList.add(...c.split(/\s+/))})};import G from"dompurify";var D=null,V=(n,e)=>{if(typeof document>"u")return;let t=document.getElementById(n);if(!t)return;G.addHook("uponSanitizeAttribute",(a,s)=>{let c=(s.attrName||"").toLowerCase(),l=(s.attrValue??"").toString().trim();if(c.startsWith("on")){s.keepAttr=!1;return}if((c==="href"||c==="src")&&/^(javascript:|vbscript:|data:|file:|about:)/i.test(l)){s.keepAttr=!1;return}if(c==="class"){let m=l.split(/\s+/).filter(Boolean).filter(y=>{if(/^[a-zA-Z0-9\-\:\/_\[\]\(\)]+$/.test(y)){if(/^bg-\[url\(.*\)\]$/.test(y)){let f=y.replace(/^bg-\[url\(/,"").replace(/\)\]$/,"").replace(/^['"]|['"]$/g,"");return f===""||/^https?:\/\//i.test(f)||/^\/(?!\/)/.test(f)||/^\.{0,2}\//.test(f)}return!0}return!1});s.attrValue=m.join(" ");return}if(c==="style"){s.keepAttr=!1;return}});let r=t.cloneNode(!0),o=G.sanitize(r.innerHTML,{USE_PROFILES:{html:!0},ALLOWED_TAGS:["div","span","p","h1","h2","h3","h4","h5","h6","ul","ol","li","strong","em","a","img","br","form","button","input","label"],ALLOWED_ATTR:["href","src","alt","title","class","id","type","name","value","placeholder","data-click","data-change","data-submit","data-select","data-hover","data-classlist"],FORBID_TAGS:["script","iframe","object","embed","body","html","svg","math","link","meta"],ALLOW_DATA_ATTR:!0,KEEP_CONTENT:!1,RETURN_DOM_FRAGMENT:!0}),i=Array.from(o.childNodes).map(a=>a.outerHTML||a.textContent||"").join("");if(D!==null&&i!==D){let a=document.createElement("div");e(a);let c=new DOMParser().parseFromString(D,"text/html");for(;t.firstChild;)t.removeChild(t.firstChild);c.body.childNodes.forEach(l=>t.appendChild(l.cloneNode(!0)))}else{for(D=i;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(o),e(t)}};import Q from"dompurify";typeof window<"u"&&!window.__anchorSinglePopstateHandlerAttached&&(window.addEventListener("popstate",n=>{let e=n.state;e?.scrollPosition!==void 0&&window.scrollTo(0,e.scrollPosition)}),window.__anchorSinglePopstateHandlerAttached=!0);var K=(n,e,t,r="",o=null)=>{if(!n)return;let i=Q.sanitize(e,{ALLOWED_URI_REGEXP:/^(https?:|\/)/}),a=Q.sanitize(t,{USE_PROFILES:{html:!1}});n.setAttribute("href",i),n.setAttribute("aria-label",a),r&&(n.className=r.trim()),o&&n.replaceChildren(o),typeof window<"u"&&n.addEventListener("click",s=>{s.preventDefault();let l=s.currentTarget.getAttribute("href");if(l){let d=window.scrollY;window.scrollTo(0,0),window.history.pushState({scrollPosition:d},"",l),dispatchEvent(new PopStateEvent("popstate"))}})};import L from"dompurify";var Y=(n="'self' 'nonce-rAnd0m123' 'unsafe-inline' 'unsafe-eval'",e="'self' 'nonce-rAnd0m123'",t="'none'",r="'self' https://fonts.googleapis.com https://fonts.gstatic.com",o="'self' https://blogger.googleusercontent.com",i=["'self'","https://fonts.googleapis.com","https://fonts.gstatic.com","https://www.google.com/maps/"],a="'self' https://www.youtube.com",s="'self'",c="/csp-report",l=!1)=>{let d=()=>{try{let m=document.querySelector('meta[http-equiv="Content-Security-Policy"]');m||(m=document.createElement("meta"),m.setAttribute("http-equiv","Content-Security-Policy"),document.head.appendChild(m));let y=l?`report-uri ${c};`:"";m.setAttribute("content",`default-src 'self'; script-src ${n}; style-src ${e}; object-src ${t}; font-src ${r}; img-src ${o}; connect-src ${i.join(" ")}; frame-src ${a}; base-uri ${s}; ${y}`)}catch(m){console.error("Error adding CSP meta element:",m)}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",d):d()};var Z=(n,e)=>{let t={name:L.sanitize(n.name||""),title:L.sanitize(n.title||""),description:L.sanitize(n.description||"Default description"),author:L.sanitize(n.author||""),favicon:n.favicon},r=u=>{t.name=L.sanitize(u),E("name",t.name)},o=u=>{t.title=L.sanitize(u),document.title=t.title},i=u=>{t.description=L.sanitize(u),E("description",t.description)},a=u=>{t.author=L.sanitize(u),E("author",t.author)},s=u=>{t.favicon=L.sanitize(u);let p=document.querySelector('link[rel="icon"]');p||(p=document.createElement("link"),p.rel="icon",document.head.appendChild(p)),p.href=t.favicon},c=()=>t.name,l=()=>t.title,d=()=>t.description,m=()=>t.author,y=()=>t.favicon,f=()=>t,v=(u,p)=>{let h=document.createElement("meta");h.setAttribute("name",u),h.setAttribute("content",p),document.head.appendChild(h)},E=(u,p)=>{let h=document.querySelector(`meta[name="${u}"]`);h?h.setAttribute("content",p):v(u,p)},g=()=>{t.title&&(document.title=t.title),t.name&&E("name",t.name),t.description&&E("description",t.description),t.author&&E("author",t.author),t.favicon&&s(t.favicon)};return e&&Y(e.scriptSrc,e.styleSrc,e.objectSrc,Array.isArray(e.connectSrc)?e.connectSrc.join(" "):e.connectSrc,e.reportOnly!==void 0?String(e.reportOnly):void 0),g(),{setName:r,setTitle:o,setDescription:i,setAuthor:a,setFavicon:s,getName:c,getTitle:l,getDescription:d,getAuthor:m,getFavicon:y,getAllMetaData:f,appendMetaTagsToHead:g}};import Se from"dompurify";var H=(n,e,t,r,o)=>{let i=`#${n}`,a=e.querySelectorAll(i);if(a.length===0)throw new Error(`[useTSComponent] No element found with id '${n}' in the given parent.`);if(a.length>1)throw new Error(`[useTSComponent] Duplicate id '${n}' detected. Found ${a.length} elements.`);let s=a[0];s.innerHTML=Se.sanitize(s.innerHTML,{USE_PROFILES:{html:!0}}),t(s,r,o)};var X=(n,e,t,r=[])=>{let o=new Set;n.forEach((i,a)=>{if(o.has(i)){console.warn(`[useTSCollection] Duplicate ID in collection array: "${i}" \u2014 skipping.`);return}o.add(i);let s=e.querySelectorAll(`#${i}`);if(s.length>1){console.warn(`[useTSCollection] Duplicate ID in DOM: "${i}" (${s.length} elements found) \u2014 skipping component mount.`);return}let c=t[a],l=Array.isArray(r)?r[a]:void 0;typeof c=="function"?H(i,e,c,l):console.warn(`[useTSCollection] No valid component function found for ID: "${i}"`)})};var A=(n,e)=>{let r=(e??document).querySelectorAll(n);if(r.length===0)return process.env.NODE_ENV!=="production"&&console.warn(`[useTSSelect] No element found for selector: '${n}'`),null;if(n.startsWith("#")&&r.length>1){if(process.env.NODE_ENV!=="production")throw new Error(`[useTSSelect] Duplicate ID detected: '${n}'. Found ${r.length} elements with this ID.`);return r[0]}return r.length>1&&process.env.NODE_ENV!=="production"&&console.warn(`[useTSSelect] Multiple elements found for selector: '${n}'. Returning the first one.`),r[0]};import{jwtDecode as Ee}from"jwt-decode";var J=(n,e)=>{let t=localStorage.getItem("token");if(!t)return window.location.href=e,null;try{let r=Ee(t),o=Date.now()/1e3;return r.exp&&r.exp<o&&(console.error("Token has expired"),window.localStorage.removeItem("token"),window.location.href=e),null}catch(r){return console.error("Invalid token:",r),window.location.href=e,null}};var $=(n,e,t)=>{n.forEach(r=>{e.forEach(o=>{r.addEventListener(o,i=>{t(r,i)})})})};var ee=()=>({back:()=>window.history.back(),forward:()=>window.history.forward()});var te=(n,e)=>{let t=document.querySelector(`#${n}`)||document.querySelector(`.${n}`);if(!t)return;let r=window.location.pathname.replace(/\/$/,"");for(let o of e){let i=o.path.replace(/\/$/,"");if(r===i||r.startsWith(`${i}/`)){o.component(t);break}}};function ne(n,e){let t=window.location.pathname.replace(/\/$/,"");e.routes.forEach(r=>{r.children?.length&&r.children.forEach(o=>{let i=o.path.replace(/\/$/,"");if(t===i||t.startsWith(`${i}/`)){let a=n.querySelector(`#${o.outlet}`)||n.querySelector(`.${o.outlet}`);a instanceof HTMLElement&&o.element&&o.element(a)}})})}import{createStore as ve}from"zustand/vanilla";function re(n){let e=ve(()=>({value:n})),t=new Set;return{get:()=>e.getState().value,set:r=>{e.setState({value:r}),t.forEach(o=>o(r))},subscribe:r=>(t.add(r),r(e.getState().value),()=>t.delete(r))}}function oe(n){let e=n();typeof e=="function"&&e()}var se=async()=>{let n="https://cdn.jsdelivr.net/npm/brython@3/brython.min.js",e="https://cdn.jsdelivr.net/npm/brython@3/brython_stdlib.js",t=r=>new Promise((o,i)=>{let a=document.createElement("script");a.src=r,a.onload=()=>o(),a.onerror=()=>i(new Error(`Failed to load ${r}`)),document.head.appendChild(a)});await t(n),await t(e),typeof window.brython=="function"?window.brython():console.error("Brython did not load correctly.")},ie=n=>new Promise((e,t)=>{let r=document.createElement("script");r.type="text/python",r.src=`/src/python/${n}`,r.onload=()=>e(),r.onerror=()=>t(new Error(`Failed to load ${n}`)),document.body.appendChild(r)});function ae(n){let e=null;return async(t,r)=>{try{if(!e){let o=await n();e=o.default||o}if(typeof e=="function")return e(t,r);if(e instanceof HTMLElement){let o=e.cloneNode(!0);return t?.appendChild(o),o}if(typeof e=="object"&&e!==null&&"render"in e&&typeof e.render=="function")return e.render(t,r);console.warn("useTSLazy: Unsupported module type",e)}catch(o){console.error("useTSLazy failed:",o)}}}var ce=n=>typeof window>"u"?{isDOM:null}:{isDOM:n||document.body};import{debounce as we}from"lodash-es";var k=n=>n;typeof window<"u"&&typeof document<"u"&&(k=n=>{let e=document.createElement("div");return e.innerText=n,e.innerHTML});var Le=n=>{(n?Array.isArray(n)?n:n instanceof HTMLAnchorElement?[n]:Array.from(n):Array.from(document.querySelectorAll("a"))).forEach(t=>{if(!t||t.dataset.anchorEnhanced==="true")return;t.dataset.anchorEnhanced="true";let r=t.getAttribute("class")||"";t.setAttribute("class",k(r));let o=t.getAttribute("aria-label");o&&t.setAttribute("aria-label",k(o));let i=t.querySelector(":scope > *");i&&(t.innerHTML="",t.appendChild(i));let a=t.getAttribute("href")||"";if(!a.startsWith("#")){try{if(new URL(a,window.location.href).origin!==window.location.origin)return}catch{return}t.addEventListener("click",s=>{s.preventDefault();let c=t.getAttribute("href")||"";try{let l=new URL(c,window.location.href);window.history.pushState({},"",l.pathname+l.search+l.hash),window.dispatchEvent(new PopStateEvent("popstate"))}catch(l){console.error("Invalid URL in anchor:",c,l)}})}})},Me=we(Le,50),O=n=>{Me(n)};var le=n=>{if(!n)return;let e=A("a",n);O(e)};import de from"dompurify";import{createStore as Ae}from"zustand/vanilla";import Re from"dompurify";var M=Ae(n=>({params:{},query:{},setParams:e=>n(()=>({params:ue(e)})),setQuery:e=>n(()=>({query:ue(e)}))}));function ue(n){let e={};for(let t in n)e[t]=Re.sanitize(n[t]);return e}var N=class{constructor(e,t){this.routes=[];this.routes=e,this.expectedParams=new Set(t),window.addEventListener("popstate",this.handlePopState.bind(this)),this.handlePopState()}handlePopState(){let e=window.location.pathname,t=window.location.search,r=this.parseQueryParams(t),o=this.findMatchingRoute(e,this.routes);if(o){if(o.routeto){this.navigate(o.routeto);return}let i=this.filterAndSanitizeParams(o.params);M.getState().setParams(i),M.getState().setQuery(r);let a=document.createElement("div");if(o.element?.(a,i,r),o.children){let s=e.slice(o.path.length),c=a.querySelector("#child");c&&this.renderChildren(o.children,s,c,i,r)}}else{let i=this.findMatchingRoute("*",this.routes);if(i){let a=this.filterAndSanitizeParams(i.params);M.getState().setParams(a),M.getState().setQuery(r);let s=document.createElement("div");i.element?.(s,a,r)}}}renderChildren(e,t,r,o,i){if(!e||e.length===0){let s=r.querySelector("#child");s&&s.remove();return}let a=this.findMatchingRoute(t,e);if(a){let s=document.createElement("div");s.id="child";let c={...o,...a.params},l=this.filterAndSanitizeParams(c);if(M.getState().setParams(l),M.getState().setQuery(i),a.element?.(s,l,i),r.appendChild(s),a.children){let d=t.slice(a.path.length);this.renderChildren(a.children,d,s,l,i)}}}parseQueryParams(e){let t={},r=new URLSearchParams(e);for(let[o,i]of r.entries())this.expectedParams.has(o)&&(t[o]=de.sanitize(i));return t}findMatchingRoute(e,t,r={}){for(let o of t){let i=o.path;if(i==="*")return o;{let s=[],c=i.replace(/:[^\s/]+/g,m=>(s.push(m.substring(1)),"([^\\s/]+)")),l=new RegExp(`^${c}(?:/|$)`),d=e.match(l);if(d){let m={...r};if(s.forEach((y,f)=>{m[y]=d[f+1]??""}),o.children){let y=e.slice(d[0].length),f=this.findMatchingRoute(y,o.children,m);if(f)return f}return{...o,params:m}}}}}filterAndSanitizeParams(e){if(!e)return{};let t={};for(let r in e)this.expectedParams.has(r)&&(t[r]=de.sanitize(e[r]??""));return t}navigate(e){history.pushState(null,"",e),this.handlePopState()}addRoute(e){this.routes.push(e)}};var be=()=>({name:"ts-filebased-router",async buildStart(){if(typeof process>"u"||!process.versions?.node)return;let n=await import("fs/promises"),e=await import("path"),t=await import("./esm-KRNKVVL7.js"),r=e.resolve("src/pages"),o=e.resolve("src/gen"),i=e.resolve("src/routes"),a=e.join(o,"tsrouter.gen.ts"),s=e.join(i,"__root.ts"),c=process.env.NODE_ENV!=="production";async function l(g){try{await n.mkdir(g,{recursive:!0})}catch{}}function d(g,u){let p="/"+e.relative(u,g).replace(/\\/g,"/");return p=p.replace(/\.ts$/,"").replace(/\/index$/,"")||"/",p.replace(/\[(.+?)\]/g,":$1")}function m(g){return g.replace(/^\//,"").split("/").map(u=>u.startsWith(":")?u.slice(1):u).filter(Boolean).join("-")||"index"}function y(g,u){let h=e.relative(u,g).replace(/\\/g,"/").split("/").filter(Boolean),S=h[h.length-1].replace(".ts",""),w=h.length>1?h[h.length-2]:"";if(S==="index")return w?w.charAt(0).toUpperCase()+w.slice(1):"Index";if(S.startsWith("[")&&S.endsWith("]")){let T=S.slice(1,-1);return w.charAt(0).toUpperCase()+T.charAt(0).toUpperCase()+T.slice(1)}return S.charAt(0).toUpperCase()+S.slice(1)}async function f(g){let u=await n.readdir(g,{withFileTypes:!0}),p=[];for(let h of u){let S=e.join(g,h.name);if(h.isDirectory())p=p.concat(await f(S));else if(h.isFile()&&h.name.endsWith(".ts")){let w=d(S,r),T=m(w),R=y(S,r);p.push({file:S,route:w,routeName:T,importName:R})}}return p}function v(){return`import { createRouter } from "@/gen/tsrouter.gen";
1
+ function pe(n){let e=n==null?"":String(n),t=e.toLowerCase();return(t.includes("<script")||t.includes("javascript:"))&&(e=""),e=e.replace(/url\(\s*(['"])?\s*\1?\s*\)/gi,""),e.replace(/<\s*(script|iframe|object|embed|link|style|meta|body)[^>]*>.*?<\s*\/\s*\1\s*>/gi,"").replace(/<\s*(script|iframe|object|embed|link|style|meta)[^>]*>/gi,"").replace(/\s+on\w+\s*=\s*(['"]).*?\1/gi,"").replace(/\s+on\w+\s*=\s*[^\s>]+/gi,"").replace(/\s(href|src)\s*=\s*(['"]?)\s*(javascript:|vbscript:|data:|file:)[^'">\s]*\2/gi,'$1="#"')}function F(n,...e){return n.reduce((t,r,o)=>{let i=o<e.length?pe(e[o]):"";return t+r+i},"")}var fe=n=>n.replace(/<\/?(script|iframe|object|embed|link|meta|style|form|textarea|svg|math|body)[^>]*>/gi,"").replace(/<(?!\/?(b|i|em|strong|p|br|ul|ol|li|a|div|span|h1|h2|h3|h4|h5|h6|section|article|input|button)\b)[^>]*>/gi,"").replace(/\s+on[a-z]+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/\s*style\s*=\s*("[^"]*"|'[^']*')/gi,"").replace(/<a\b([^>]*)href\s*=\s*(['"]?)(?!https?:|#)[^'"\s>]+(['"]?)([^>]*)>/gi,"<a$1$4>").replace(/\s+(href|src)\s*=\s*(['"]?)\s*(javascript:|data:)[^'"\s>]*/gi,"").replace(/<a\b([^>]*)\bhref\s*=\s*(['"])(\/blog|#blog)\2([^>]*)>/gi,'<a$1 href=$2$3$2 href-line="true"$4>').trim(),he=n=>n?.map(e=>fe(e)).join("")??"";import z from"dompurify";var _=(n,e)=>{let r={...{ADD_TAGS:["my-custom-tag"]},...e};return typeof n=="string"?z.sanitize(n,r):z.sanitize(n.innerHTML,r)};var I=(n,e,t)=>{if(typeof n=="string"){let r=document.getElementById(n);r?r.addEventListener(e,t):console.warn(`Element with id '${n}' not found.`)}else n instanceof HTMLElement?n.addEventListener(e,t):n===document?document.addEventListener(e,t):console.warn("Invalid target parameter provided.")};import{createStore as ge}from"zustand/vanilla";import q from"dompurify";function Te(n,e){let t=[],r=n.replace(/:[^/]+/g,s=>(t.push(s.slice(1)),"([^/]+)")),o=new RegExp(`^${r}$`),i=e.match(o),a={};return i&&t.forEach((s,c)=>{a[s]=q.sanitize(i[c+1]??"")}),a}function ye(n){let e={},t=new URLSearchParams(n);for(let[r,o]of t.entries())e[r]=q.sanitize(o);return e}var C=ge((n,e)=>({params:{},query:{},setFromPattern:t=>{let r=window.location.pathname,o=Te(t,r),i=ye(window.location.search);n({params:o,query:i})},getParam:t=>e().params[t],getQuery:t=>e().query[t]}));function U(n){let e=C.getState();e.setFromPattern(n);let t=e.params,r=e.query;return{...t,...r}}var j=(n,e,t)=>{let r=document.querySelectorAll(n);return r.forEach(o=>{o.addEventListener(e,t)}),()=>{r.forEach(o=>{o.removeEventListener(e,t)})}};import B from"dompurify";var W=(n,e,t={},r)=>{let o={USE_PROFILES:{svg:!0,html:!0},ALLOWED_TAGS:["svg","path","circle","rect","line","polyline","polygon","g","main","div","h1","h2","h3","h4","h5","h6","p","button","span","a","img","input","ul","li","i","label","form"],ALLOWED_ATTR:["class","id","href","src","alt","title","fill","stroke","stroke-width","viewBox","xmlns","d","x","y","cx","cy","r","width","height","type","name","value","placeholder","data-click","data-change","data-select","data-classlist","data-hover","data-submit","data-key","data-event"],FORBID_TAGS:["script","iframe","foreignObject","body","html"],FORBID_ATTR:["style","xlink:href"],ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto|tel|ftp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,...r};B.addHook("uponSanitizeAttribute",(s,c)=>{let l=(c.attrName||"").toLowerCase(),d=(c.attrValue??"").toString().trim();if(l.startsWith("on")){c.keepAttr=!1;return}if(/^data-(click|change|submit|select|hover|classlist|key|event)$/.test(l)){c.keepAttr=!0;return}if(s.nodeName.toLowerCase()==="img"&&l==="src"){/^https?:\/\//i.test(d)||/^\/(?!\/)/.test(d)||/^data:image\/(png|jpeg|jpg|gif|webp);base64,/i.test(d)||(c.keepAttr=!1);return}if(l==="class"){let y=d.split(/\s+/).filter(Boolean).filter(f=>{if(/^[a-zA-Z0-9\-\:\/_\[\]\(\)]*$/.test(f)){if(/^bg-\[url\(.*\)\]$/.test(f)){let v=f.replace(/^bg-\[url\(/,"").replace(/\)\]$/,"").replace(/^['"]|['"]$/g,"");return v===""||/^https?:\/\//i.test(v)||/^\/(?!\/)/.test(v)||/^\.{0,2}\//.test(v)}return/^bg-\[\]$/.test(f),!0}return!1});c.attrValue=y.join(" ");return}});let i=B.sanitize(e,{...o,RETURN_DOM_FRAGMENT:!0});for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(i);let a=(s,c)=>{n.querySelectorAll(`[${s}]`).forEach(l=>{let d=l.getAttribute(s);d&&Object.prototype.hasOwnProperty.call(t,d)&&l.addEventListener(c,m=>{c==="submit"&&m.preventDefault(),t[d](m)})})};a("data-click","click"),a("data-change","change"),a("data-select","select"),a("data-submit","submit"),n.querySelectorAll("[data-key]").forEach(s=>{let c=s.dataset.key,l=s.dataset.event??"click";c&&Object.prototype.hasOwnProperty.call(t,c)&&s.addEventListener(l,t[c])}),n.querySelectorAll("[data-hover]").forEach(s=>{let c=s.dataset.hover;c&&Object.prototype.hasOwnProperty.call(t,c)&&(s.addEventListener("mouseenter",t[c]),s.addEventListener("mouseleave",t[c]))}),n.querySelectorAll("[data-classlist]").forEach(s=>{let c=s.dataset.classlist;/^[a-zA-Z0-9\-\s:_]+$/.test(c)&&s.classList.add(...c.split(/\s+/))})};import G from"dompurify";var D=null,V=(n,e)=>{if(typeof document>"u")return;let t=document.getElementById(n);if(!t)return;G.addHook("uponSanitizeAttribute",(a,s)=>{let c=(s.attrName||"").toLowerCase(),l=(s.attrValue??"").toString().trim();if(c.startsWith("on")){s.keepAttr=!1;return}if((c==="href"||c==="src")&&/^(javascript:|vbscript:|data:|file:|about:)/i.test(l)){s.keepAttr=!1;return}if(c==="class"){let m=l.split(/\s+/).filter(Boolean).filter(y=>{if(/^[a-zA-Z0-9\-\:\/_\[\]\(\)]+$/.test(y)){if(/^bg-\[url\(.*\)\]$/.test(y)){let f=y.replace(/^bg-\[url\(/,"").replace(/\)\]$/,"").replace(/^['"]|['"]$/g,"");return f===""||/^https?:\/\//i.test(f)||/^\/(?!\/)/.test(f)||/^\.{0,2}\//.test(f)}return!0}return!1});s.attrValue=m.join(" ");return}if(c==="style"){s.keepAttr=!1;return}});let r=t.cloneNode(!0),o=G.sanitize(r.innerHTML,{USE_PROFILES:{html:!0},ALLOWED_TAGS:["div","span","p","h1","h2","h3","h4","h5","h6","ul","ol","li","strong","em","a","img","br","form","button","input","label"],ALLOWED_ATTR:["href","src","alt","title","class","id","type","name","value","placeholder","data-click","data-change","data-submit","data-select","data-hover","data-classlist"],FORBID_TAGS:["script","iframe","object","embed","body","html","svg","math","link","meta"],ALLOW_DATA_ATTR:!0,KEEP_CONTENT:!1,RETURN_DOM_FRAGMENT:!0}),i=Array.from(o.childNodes).map(a=>a.outerHTML||a.textContent||"").join("");if(D!==null&&i!==D){let a=document.createElement("div");e(a);let c=new DOMParser().parseFromString(D,"text/html");for(;t.firstChild;)t.removeChild(t.firstChild);c.body.childNodes.forEach(l=>t.appendChild(l.cloneNode(!0)))}else{for(D=i;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(o),e(t)}};import Q from"dompurify";typeof window<"u"&&!window.__anchorSinglePopstateHandlerAttached&&(window.addEventListener("popstate",n=>{let e=n.state;e?.scrollPosition!==void 0&&window.scrollTo(0,e.scrollPosition)}),window.__anchorSinglePopstateHandlerAttached=!0);var K=(n,e,t,r="",o=null)=>{if(!n)return;let i=Q.sanitize(e,{ALLOWED_URI_REGEXP:/^(https?:|\/)/}),a=Q.sanitize(t,{USE_PROFILES:{html:!1}});n.setAttribute("href",i),n.setAttribute("aria-label",a),r&&(n.className=r.trim()),o&&n.replaceChildren(o),typeof window<"u"&&n.addEventListener("click",s=>{s.preventDefault();let l=s.currentTarget.getAttribute("href");if(l){let d=window.scrollY;window.scrollTo(0,0),window.history.pushState({scrollPosition:d},"",l),dispatchEvent(new PopStateEvent("popstate"))}})};import L from"dompurify";var Y=(n="'self' 'nonce-rAnd0m123' 'unsafe-inline' 'unsafe-eval'",e="'self' 'nonce-rAnd0m123'",t="'none'",r="'self' https://fonts.googleapis.com https://fonts.gstatic.com",o="'self' https://blogger.googleusercontent.com",i=["'self'","https://fonts.googleapis.com","https://fonts.gstatic.com","https://www.google.com/maps/"],a="'self' https://www.youtube.com",s="'self'",c="/csp-report",l=!1)=>{let d=()=>{try{let m=document.querySelector('meta[http-equiv="Content-Security-Policy"]');m||(m=document.createElement("meta"),m.setAttribute("http-equiv","Content-Security-Policy"),document.head.appendChild(m));let y=l?`report-uri ${c};`:"";m.setAttribute("content",`default-src 'self'; script-src ${n}; style-src ${e}; object-src ${t}; font-src ${r}; img-src ${o}; connect-src ${i.join(" ")}; frame-src ${a}; base-uri ${s}; ${y}`)}catch(m){console.error("Error adding CSP meta element:",m)}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",d):d()};var Z=(n,e)=>{let t={name:L.sanitize(n.name||""),title:L.sanitize(n.title||""),description:L.sanitize(n.description||"Default description"),author:L.sanitize(n.author||""),favicon:n.favicon},r=u=>{t.name=L.sanitize(u),E("name",t.name)},o=u=>{t.title=L.sanitize(u),document.title=t.title},i=u=>{t.description=L.sanitize(u),E("description",t.description)},a=u=>{t.author=L.sanitize(u),E("author",t.author)},s=u=>{t.favicon=L.sanitize(u);let p=document.querySelector('link[rel="icon"]');p||(p=document.createElement("link"),p.rel="icon",document.head.appendChild(p)),p.href=t.favicon},c=()=>t.name,l=()=>t.title,d=()=>t.description,m=()=>t.author,y=()=>t.favicon,f=()=>t,v=(u,p)=>{let h=document.createElement("meta");h.setAttribute("name",u),h.setAttribute("content",p),document.head.appendChild(h)},E=(u,p)=>{let h=document.querySelector(`meta[name="${u}"]`);h?h.setAttribute("content",p):v(u,p)},g=()=>{t.title&&(document.title=t.title),t.name&&E("name",t.name),t.description&&E("description",t.description),t.author&&E("author",t.author),t.favicon&&s(t.favicon)};return e&&Y(e.scriptSrc,e.styleSrc,e.objectSrc,Array.isArray(e.connectSrc)?e.connectSrc.join(" "):e.connectSrc,e.reportOnly!==void 0?String(e.reportOnly):void 0),g(),{setName:r,setTitle:o,setDescription:i,setAuthor:a,setFavicon:s,getName:c,getTitle:l,getDescription:d,getAuthor:m,getFavicon:y,getAllMetaData:f,appendMetaTagsToHead:g}};import Se from"dompurify";var H=(n,e,t,r,o)=>{let i=`#${n}`,a=e.querySelectorAll(i);if(a.length===0)throw new Error(`[useTSComponent] No element found with id '${n}' in the given parent.`);if(a.length>1)throw new Error(`[useTSComponent] Duplicate id '${n}' detected. Found ${a.length} elements.`);let s=a[0];s.innerHTML=Se.sanitize(s.innerHTML,{USE_PROFILES:{html:!0}}),t(s,r,o)};var X=(n,e,t,r=[])=>{let o=new Set;n.forEach((i,a)=>{if(o.has(i)){console.warn(`[useTSCollection] Duplicate ID in collection array: "${i}" \u2014 skipping.`);return}o.add(i);let s=e.querySelectorAll(`#${i}`);if(s.length>1){console.warn(`[useTSCollection] Duplicate ID in DOM: "${i}" (${s.length} elements found) \u2014 skipping component mount.`);return}let c=t[a],l=Array.isArray(r)?r[a]:void 0;typeof c=="function"?H(i,e,c,l):console.warn(`[useTSCollection] No valid component function found for ID: "${i}"`)})};var R=(n,e)=>{let r=(e??document).querySelectorAll(n);if(r.length===0)return process.env.NODE_ENV!=="production"&&console.warn(`[useTSSelect] No element found for selector: '${n}'`),null;if(n.startsWith("#")&&r.length>1){if(process.env.NODE_ENV!=="production")throw new Error(`[useTSSelect] Duplicate ID detected: '${n}'. Found ${r.length} elements with this ID.`);return r[0]}return r.length>1&&process.env.NODE_ENV!=="production"&&console.warn(`[useTSSelect] Multiple elements found for selector: '${n}'. Returning the first one.`),r[0]};import{jwtDecode as Ee}from"jwt-decode";var J=(n,e)=>{let t=localStorage.getItem("token");if(!t)return window.location.href=e,null;try{let r=Ee(t),o=Date.now()/1e3;return r.exp&&r.exp<o&&(console.error("Token has expired"),window.localStorage.removeItem("token"),window.location.href=e),null}catch(r){return console.error("Invalid token:",r),window.location.href=e,null}};var $=(n,e,t)=>{n.forEach(r=>{e.forEach(o=>{r.addEventListener(o,i=>{t(r,i)})})})};var ee=()=>({back:()=>window.history.back(),forward:()=>window.history.forward()});var te=(n,e)=>{let t=document.querySelector(`#${n}`)||document.querySelector(`.${n}`);if(!t)return;let r=window.location.pathname.replace(/\/$/,"");for(let o of e){let i=o.path.replace(/\/$/,"");if(r===i||r.startsWith(`${i}/`)){o.component(t);break}}};function ne(n,e){let t=window.location.pathname.replace(/\/$/,"");e.routes.forEach(r=>{r.children?.length&&r.children.forEach(o=>{let i=o.path.replace(/\/$/,"");if(t===i||t.startsWith(`${i}/`)){let a=n.querySelector(`#${o.outlet}`)||n.querySelector(`.${o.outlet}`);a instanceof HTMLElement&&o.element&&o.element(a)}})})}import{createStore as ve}from"zustand/vanilla";function re(n){let e=ve(()=>({value:n})),t=new Set;return{get:()=>e.getState().value,set:r=>{e.setState({value:r}),t.forEach(o=>o(r))},subscribe:r=>(t.add(r),r(e.getState().value),()=>t.delete(r))}}function oe(n){let e=n();typeof e=="function"&&e()}var se=async()=>{let n="https://cdn.jsdelivr.net/npm/brython@3/brython.min.js",e="https://cdn.jsdelivr.net/npm/brython@3/brython_stdlib.js",t=r=>new Promise((o,i)=>{let a=document.createElement("script");a.src=r,a.onload=()=>o(),a.onerror=()=>i(new Error(`Failed to load ${r}`)),document.head.appendChild(a)});await t(n),await t(e),typeof window.brython=="function"?window.brython():console.error("Brython did not load correctly.")},ie=n=>new Promise((e,t)=>{let r=document.createElement("script");r.type="text/python",r.src=`/src/python/${n}`,r.onload=()=>e(),r.onerror=()=>t(new Error(`Failed to load ${n}`)),document.body.appendChild(r)});function ae(n){let e=null;return async(t,r)=>{try{if(!e){let o=await n();e=o.default||o}if(typeof e=="function")return e(t,r);if(e instanceof HTMLElement){let o=e.cloneNode(!0);return t?.appendChild(o),o}if(typeof e=="object"&&e!==null&&"render"in e&&typeof e.render=="function")return e.render(t,r);console.warn("useTSLazy: Unsupported module type",e)}catch(o){console.error("useTSLazy failed:",o)}}}var ce=n=>typeof window>"u"?{isDOM:null}:{isDOM:n||document.body};import{debounce as we}from"lodash-es";var k=n=>n;typeof window<"u"&&typeof document<"u"&&(k=n=>{let e=document.createElement("div");return e.innerText=n,e.innerHTML});var Le=n=>{(n?Array.isArray(n)?n:n instanceof HTMLAnchorElement?[n]:Array.from(n):Array.from(document.querySelectorAll("a"))).forEach(t=>{if(!t||t.dataset.anchorEnhanced==="true")return;t.dataset.anchorEnhanced="true";let r=t.getAttribute("class")||"";t.setAttribute("class",k(r));let o=t.getAttribute("aria-label");o&&t.setAttribute("aria-label",k(o));let i=t.querySelector(":scope > *");i&&(t.innerHTML="",t.appendChild(i));let a=t.getAttribute("href")||"";if(!a.startsWith("#")){try{if(new URL(a,window.location.href).origin!==window.location.origin)return}catch{return}t.addEventListener("click",s=>{s.preventDefault();let c=t.getAttribute("href")||"";try{let l=new URL(c,window.location.href);window.history.pushState({},"",l.pathname+l.search+l.hash),window.dispatchEvent(new PopStateEvent("popstate"))}catch(l){console.error("Invalid URL in anchor:",c,l)}})}})},Me=we(Le,50),O=n=>{Me(n)};var le=n=>{if(!n)return;let e=R("a",n);O(e)};import de from"dompurify";import{createStore as Re}from"zustand/vanilla";import Ae from"dompurify";var M=Re(n=>({params:{},query:{},setParams:e=>n(()=>({params:ue(e)})),setQuery:e=>n(()=>({query:ue(e)}))}));function ue(n){let e={};for(let t in n)e[t]=Ae.sanitize(n[t]);return e}var N=class{constructor(e,t){this.routes=[];this.routes=e,this.expectedParams=new Set(t),window.addEventListener("popstate",this.handlePopState.bind(this)),this.handlePopState()}handlePopState(){let e=window.location.pathname,t=window.location.search,r=this.parseQueryParams(t),o=this.findMatchingRoute(e,this.routes);if(o){if(o.routeto){this.navigate(o.routeto);return}let i=this.filterAndSanitizeParams(o.params);M.getState().setParams(i),M.getState().setQuery(r);let a=document.createElement("div");if(o.element?.(a,i,r),o.children){let s=e.slice(o.path.length),c=a.querySelector("#child");c&&this.renderChildren(o.children,s,c,i,r)}}else{let i=this.findMatchingRoute("*",this.routes);if(i){let a=this.filterAndSanitizeParams(i.params);M.getState().setParams(a),M.getState().setQuery(r);let s=document.createElement("div");i.element?.(s,a,r)}}}renderChildren(e,t,r,o,i){if(!e||e.length===0){let s=r.querySelector("#child");s&&s.remove();return}let a=this.findMatchingRoute(t,e);if(a){let s=document.createElement("div");s.id="child";let c={...o,...a.params},l=this.filterAndSanitizeParams(c);if(M.getState().setParams(l),M.getState().setQuery(i),a.element?.(s,l,i),r.appendChild(s),a.children){let d=t.slice(a.path.length);this.renderChildren(a.children,d,s,l,i)}}}parseQueryParams(e){let t={},r=new URLSearchParams(e);for(let[o,i]of r.entries())this.expectedParams.has(o)&&(t[o]=de.sanitize(i));return t}findMatchingRoute(e,t,r={}){for(let o of t){let i=o.path;if(i==="*")return o;{let s=[],c=i.replace(/:[^\s/]+/g,m=>(s.push(m.substring(1)),"([^\\s/]+)")),l=new RegExp(`^${c}(?:/|$)`),d=e.match(l);if(d){let m={...r};if(s.forEach((y,f)=>{m[y]=d[f+1]??""}),o.children){let y=e.slice(d[0].length),f=this.findMatchingRoute(y,o.children,m);if(f)return f}return{...o,params:m}}}}}filterAndSanitizeParams(e){if(!e)return{};let t={};for(let r in e)this.expectedParams.has(r)&&(t[r]=de.sanitize(e[r]??""));return t}navigate(e){history.pushState(null,"",e),this.handlePopState()}addRoute(e){this.routes.push(e)}};var be=()=>({name:"ts-filebased-router",async buildStart(){if(typeof process>"u"||!process.versions?.node)return;let n=await import("fs/promises"),e=await import("path"),t=await import("./esm-KRNKVVL7.js"),r=e.resolve("src/pages"),o=e.resolve("src/gen"),i=e.resolve("src/routes"),a=e.join(o,"tsrouter.gen.ts"),s=e.join(i,"__root.ts"),c=process.env.NODE_ENV!=="production";async function l(g){try{await n.mkdir(g,{recursive:!0})}catch{}}function d(g,u){let p="/"+e.relative(u,g).replace(/\\/g,"/");return p=p.replace(/\.ts$/,"").replace(/\/index$/,"")||"/",p.replace(/\[(.+?)\]/g,":$1")}function m(g){return g.replace(/^\//,"").split("/").map(u=>u.startsWith(":")?u.slice(1):u).filter(Boolean).join("-")||"index"}function y(g,u){let h=e.relative(u,g).replace(/\\/g,"/").split("/").filter(Boolean),S=h[h.length-1].replace(".ts",""),w=h.length>1?h[h.length-2]:"";if(S==="index")return w?w.charAt(0).toUpperCase()+w.slice(1):"Index";if(S.startsWith("[")&&S.endsWith("]")){let T=S.slice(1,-1);return w.charAt(0).toUpperCase()+T.charAt(0).toUpperCase()+T.slice(1)}return S.charAt(0).toUpperCase()+S.slice(1)}async function f(g){let u=await n.readdir(g,{withFileTypes:!0}),p=[];for(let h of u){let S=e.join(g,h.name);if(h.isDirectory())p=p.concat(await f(S));else if(h.isFile()&&h.name.endsWith(".ts")){let w=d(S,r),T=m(w),A=y(S,r);p.push({file:S,route:w,routeName:T,importName:A})}}return p}function v(){return`import { createRouter } from "@/gen/tsrouter.gen";
2
2
  import { useTSParams } from "@devwareng/vanilla-ts";
3
3
 
4
4
  export const Router = async (DOM: HTMLElement) => {
@@ -32,10 +32,10 @@ export default function ${b}(DOM: HTMLElement, params: ${me}) {
32
32
  `):""}
33
33
  </div>
34
34
  \`);
35
- }`,"utf-8")}let h=p.map(T=>{let R="../pages/"+e.relative(r,T.file).replace(/\\/g,"/").replace(/\.ts$/,"");return`{
35
+ }`,"utf-8")}let h=p.map(T=>{let A="../pages/"+e.relative(r,T.file).replace(/\\/g,"/").replace(/\.ts$/,"");return`{
36
36
  path: "${T.route}",
37
37
  name: "${T.routeName}",
38
- component: useTSLazy(() => import("${R}"))
38
+ component: useTSLazy(() => import("${A}"))
39
39
  }`}).join(`,
40
40
  `),w=`// AUTO-GENERATED FILE. DO NOT EDIT MANUALLY.
41
41
  import { useTSLazy } from "@devwareng/vanilla-ts";
@@ -77,4 +77,4 @@ export async function createRouter(DOM: HTMLElement) {
77
77
 
78
78
  return { navigate, routes: routeTree }
79
79
  }
80
- `;await l(o),await n.writeFile(a,w,"utf-8"),await n.writeFile(s,v(),"utf-8")}await l(o),await l(i),await l(r),await E(),c&&(t.watch(r).on("all",async(u,p)=>{p.endsWith(".ts")&&await E()}),t.watch(s).on("unlink",async()=>{await n.writeFile(s,v(),"utf-8")})),console.log("\u{1F7E2} TS Filebased Router Generated with Lazy Routes and Params Support...")}});export{be as TSFilebasedRouter,N as TSRouter,oe as createEffect,re as createSignal,F as html,ie as loadPyFiles,he as mapper,ne as renderChildRoutes,O as useAnchor,K as useAnchorSingle,V as useInitialDOM,J as useTSAuth,X as useTSCollection,H as useTSComponent,$ as useTSElementEach,W as useTSElements,I as useTSEvent,j as useTSEventAll,U as useTSExtractParams,ae as useTSLazy,Z as useTSMetaData,ee as useTSNavigate,le as useTSNoReload,te as useTSOutlet,C as useTSParams,_ as useTSPurifier,ce as useTSSSRHydration,A as useTSSelect,se as useTSloadBrython};
80
+ `;await l(o),await n.writeFile(a,w,"utf-8"),await n.writeFile(s,v(),"utf-8")}await l(o),await l(i),await l(r),await E(),c&&(t.watch(r).on("all",async(u,p)=>{p.endsWith(".ts")&&await E()}),t.watch(s).on("unlink",async()=>{await n.writeFile(s,v(),"utf-8")})),console.log("\u{1F7E2} TS Filebased Router Generated with Lazy Routes and Params Support...")}});export{be as TSFilebasedRouter,N as TSRouter,oe as createEffect,re as createSignal,F as html,ie as loadPyFiles,he as mapper,ne as renderChildRoutes,O as useAnchor,K as useAnchorSingle,V as useInitialDOM,J as useTSAuth,X as useTSCollection,H as useTSComponent,$ as useTSElementEach,W as useTSElements,I as useTSEvent,j as useTSEventAll,U as useTSExtractParams,ae as useTSLazy,Z as useTSMetaData,ee as useTSNavigate,le as useTSNoReload,te as useTSOutlet,C as useTSParams,_ as useTSPurifier,ce as useTSSSRHydration,R as useTSSelect,se as useTSloadBrython};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devwareng/vanilla-ts",
3
- "version": "1.9.92",
3
+ "version": "1.9.93",
4
4
  "description": "Framework-less TypeScript hooks for SPA development.",
5
5
  "author": "Waren Arapoc Gador",
6
6
  "license": "MIT",