mirror of
https://github.com/gromlab-ru/svg-sprites.git
synced 2026-07-21 20:30:16 +03:00
Добавлены exact modes: - vue@vite и vue@webpack - nuxt@vite и nuxt@webpack - svelte@vite, svelte@webpack и sveltekit@vite - angular@application и angular@webpack - astro@vite - solid@vite, solid@webpack и solid-start@vite - preact@vite и preact@webpack - qwik@vite - lit@vite и lit@webpack - alpine@vite и alpine@webpack Для каждого mode реализованы изолированный adapter, нативный framework-компонент, declarations, manifest, CSS и внешний asset URL. Добавлены production integration-стенды с генерацией, typecheck, сборкой и Playwright-проверкой рендера спрайта и Viewer. Обновлены Viewer, RU/EN-гайды, README, technical reference и AI skills. Итоговая матрица включает 29 exact modes. Проверки: - 48 unit-тестов - 29 integration E2E-тестов
2 lines
24 KiB
JavaScript
2 lines
24 KiB
JavaScript
import{ssrElement as K,escape as T,mergeProps as Ke,ssr as $,isServer as x,getRequestEvent as k,renderToString as ze,renderToStream as Ge,createComponent as R,delegateEvents as Je,ssrHydrationKey as q,useAssets as Ve,NoHydration as ye,Hydration as Xe,ssrAttribute as z,HydrationScript as Ye}from"solid-js/web";import{lazy as Qe,createComponent as we,sharedConfig as U,getOwner as ve,runWithOwner as Re,createMemo as P,createSignal as M,createRenderEffect as Ze,on as ne,useContext as et,createContext as be,startTransition as tt,resetErrorBoundaries as nt,batch as rt,untrack as Se,children as st,Show as Ee,createRoot as ot,onCleanup as re,Suspense as at,catchError as it,ErrorBoundary as ct}from"solid-js";import{provideRequestEvent as ut}from"solid-js/web/storage";import{H3Event as Y,setResponseStatus as lt,setHeader as ht,getRequestIP as dt,getResponseStatus as ft,getResponseStatusText as pt,getResponseHeader as mt,setResponseHeader as gt,removeResponseHeader as yt,appendResponseHeader as wt,getResponseHeaders as vt,getRequestURL as Rt,getRequestWebStream as bt,sendRedirect as St,getCookie as Et,setCookie as At,eventHandler as $t}from"h3";import{getContext as Pt}from"unctx";import{AsyncLocalStorage as Tt}from"node:async_hooks";import{createRouter as xt}from"radix3";function Ct(e){let t;const n=$e(e),s={duplex:"half",method:e.method,headers:e.headers};return e.node.req.body instanceof ArrayBuffer?new Request(n,{...s,body:e.node.req.body}):new Request(n,{...s,get body(){return t||(t=Mt(e),t)}})}function Lt(e){return e.web??={request:Ct(e),url:$e(e)},e.web.request}function Ht(){return Bt()}const Ae=Symbol("$HTTPEvent");function qt(e){return typeof e=="object"&&(e instanceof Y||e?.[Ae]instanceof Y||e?.__is_event__===!0)}function S(e){return function(...t){let n=t[0];if(qt(n))t[0]=n instanceof Y||n.__is_event__?n:n[Ae];else{if(!globalThis.app.config.server.experimental?.asyncContext)throw new Error("AsyncLocalStorage was not enabled. Use the `server.experimental.asyncContext: true` option in your app configuration to enable it. Or, pass the instance of HTTPEvent that you have as the first argument to the function.");if(n=Ht(),!n)throw new Error("No HTTPEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.");t.unshift(n)}return e(...t)}}const $e=S(Rt),kt=S(dt),Q=S(lt),ue=S(ft),Ot=S(pt),G=S(vt),le=S(mt),Ft=S(gt),_t=S(wt),he=S(St),It=S(Et),Ut=S(At),jt=S(ht),Mt=S(bt),Nt=S(yt),Wt=S(Lt);function Dt(){return Pt("nitro-app",{asyncContext:!!globalThis.app.config.server.experimental?.asyncContext,AsyncLocalStorage:Tt})}function Bt(){return Dt().use().event}const Pe=[{page:!0,$component:{src:"src/routes/index.jsx?pick=default&pick=$css",build:()=>import("./index.js"),import:()=>import("./index.js")},path:"/",filePath:"/home/gromov/projects/my/svg-sprites/integration/apps/solid-start-vite/src/routes/index.jsx"}],Kt=zt(Pe.filter(e=>e.page));function zt(e){function t(n,s,r,o){const a=Object.values(n).find(i=>r.startsWith(i.id+"/"));return a?(t(a.children||(a.children=[]),s,r.slice(a.id.length)),n):(n.push({...s,id:r,path:r.replace(/\([^)/]+\)/g,"").replace(/\/+/g,"/")}),n)}return e.sort((n,s)=>n.path.length-s.path.length).reduce((n,s)=>t(n,s,s.path,s.path),[])}function Gt(e,t){const n=Vt.lookup(e);if(n&&n.route){const s=n.route,r=t==="HEAD"?s.$HEAD||s.$GET:s[`$${t}`];if(r===void 0)return;const o=s.page===!0&&s.$component!==void 0;return{handler:r,params:n.params,isPage:o}}}function Jt(e){return e.$HEAD||e.$GET||e.$POST||e.$PUT||e.$PATCH||e.$DELETE}const Vt=xt({routes:Pe.reduce((e,t)=>{if(!Jt(t))return e;let n=t.path.replace(/\([^)/]+\)/g,"").replace(/\/+/g,"/").replace(/\*([^/]*)/g,(s,r)=>`**:${r}`).split("/").map(s=>s.startsWith(":")||s.startsWith("*")?s:encodeURIComponent(s)).join("/");if(/:[^/]*\?/g.test(n))throw new Error(`Optional parameters are not supported in API routes: ${n}`);if(e[n])throw new Error(`Duplicate API routes for "${n}" found at "${e[n].route.path}" and "${t.path}"`);return e[n]={route:t},e},{})}),V="solidFetchEvent";function Xt(e){return{request:Wt(e),response:Zt(e),clientAddress:kt(e),locals:{},nativeEvent:e}}function Yt(e){if(!e.context[V]){const t=Xt(e);e.context[V]=t}return e.context[V]}class Qt{event;constructor(t){this.event=t}get(t){const n=le(this.event,t);return Array.isArray(n)?n.join(", "):n||null}has(t){return this.get(t)!==null}set(t,n){return Ft(this.event,t,n)}delete(t){return Nt(this.event,t)}append(t,n){_t(this.event,t,n)}getSetCookie(){const t=le(this.event,"Set-Cookie");return Array.isArray(t)?t:[t]}forEach(t){return Object.entries(G(this.event)).forEach(([n,s])=>t(Array.isArray(s)?s.join(", "):s,n,this))}entries(){return Object.entries(G(this.event)).map(([t,n])=>[t,Array.isArray(n)?n.join(", "):n])[Symbol.iterator]()}keys(){return Object.keys(G(this.event))[Symbol.iterator]()}values(){return Object.values(G(this.event)).map(t=>Array.isArray(t)?t.join(", "):t)[Symbol.iterator]()}[Symbol.iterator](){return this.entries()[Symbol.iterator]()}}function Zt(e){return{get status(){return ue(e)},set status(t){Q(e,t)},get statusText(){return Ot(e)},set statusText(t){Q(e,ue(e),t)},headers:new Qt(e)}}function en(e){e.forEach(t=>{if(!t.attrs.href)return;let n=document.head.querySelector(`link[href="${t.attrs.href}"]`);n||(n=document.createElement("link"),n.setAttribute("rel","preload"),n.setAttribute("as","style"),n.setAttribute("href",t.attrs.href),document.head.appendChild(n))})}var tn=" ";const nn={style:e=>K("style",e.attrs,()=>e.children,!0),link:e=>K("link",e.attrs,void 0,!0),script:e=>e.attrs.src?K("script",Ke(()=>e.attrs,{get id(){return e.key}}),()=>$(tn),!0):null,noscript:e=>K("noscript",e.attrs,()=>T(e.children),!0)};function Z(e,t){let{tag:n,attrs:{key:s,...r}={key:void 0},children:o}=e;return nn[n]({attrs:{...r,nonce:t},key:s,children:o})}function rn(e,t,n,s="default"){return Qe(async()=>{{const o=(await e.import())[s],i=(await t.inputs?.[e.src].assets()).filter(u=>u.tag==="style"||u.attrs.rel==="stylesheet");return typeof window<"u"&&en(i),{default:u=>[...i.map(h=>Z(h)),we(o,u)]}}})}function Te(){function e(n){return{...n,...n.$$route?n.$$route.require().route:void 0,info:{...n.$$route?n.$$route.require().route.info:{},filesystem:!0},component:n.$component&&rn(n.$component,globalThis.MANIFEST.client,globalThis.MANIFEST.ssr),children:n.children?n.children.map(e):void 0}}return Kt.map(e)}let de;const sn=x?()=>k().routes:()=>de||(de=Te());function on(e){const t=It(e.nativeEvent,"flash");if(t)try{let n=JSON.parse(t);if(!n||!n.result)return;const s=[...n.input.slice(0,-1),new Map(n.input[n.input.length-1])],r=n.error?new Error(n.result):n.result;return{input:s,url:n.url,pending:!1,result:n.thrown?void 0:r,error:n.thrown?r:void 0}}catch(n){console.error(n)}finally{Ut(e.nativeEvent,"flash","",{maxAge:0})}}async function an(e){const t=globalThis.MANIFEST.client;return globalThis.MANIFEST.ssr,e.response.headers.set("Content-Type","text/html"),Object.assign(e,{manifest:await t.json(),assets:[...await t.inputs[t.handler].assets()],router:{submission:on(e)},routes:Te(),complete:!1,$islands:new Set})}const cn=new Set([301,302,303,307,308]);function ee(e){return e.status&&cn.has(e.status)?e.status:302}function un(e,t,n={},s){return $t({handler:r=>{const o=Yt(r);return ut(o,async()=>{const a=Gt(new URL(o.request.url).pathname,o.request.method);if(a){const d=await a.handler.import(),g=o.request.method==="HEAD"?d.HEAD||d.GET:d[o.request.method];o.params=a.params||{},U.context={event:o};const l=await g(o);if(l!==void 0)return l;if(o.request.method!=="GET")throw new Error(`API handler for ${o.request.method} "${o.request.url}" did not return a response.`);if(!a.isPage)return}const i=await t(o),c=typeof n=="function"?await n(i):{...n},u=c.mode||"stream";if(c.nonce&&(i.nonce=c.nonce),u==="sync"){const d=ze(()=>(U.context.event=i,e(i)),c);if(i.complete=!0,i.response&&i.response.headers.get("Location")){const g=ee(i.response);return he(r,i.response.headers.get("Location"),g)}return d}if(c.onCompleteAll){const d=c.onCompleteAll;c.onCompleteAll=g=>{pe(i)(g),d(g)}}else c.onCompleteAll=pe(i);if(c.onCompleteShell){const d=c.onCompleteShell;c.onCompleteShell=g=>{fe(i,r)(),d(g)}}else c.onCompleteShell=fe(i,r);const h=Ge(()=>(U.context.event=i,e(i)),c);if(i.response&&i.response.headers.get("Location")){const d=ee(i.response);return he(r,i.response.headers.get("Location"),d)}if(u==="async")return h;const{writable:w,readable:m}=new TransformStream;return h.pipeTo(w),m})}})}function fe(e,t){return()=>{if(e.response&&e.response.headers.get("Location")){const n=ee(e.response);Q(t,n),jt(t,"Location",e.response.headers.get("Location"))}}}function pe(e){return({write:t})=>{e.complete=!0;const n=e.response&&e.response.headers.get("Location");n&&t(`<script>window.location="${n}"<\/script>`)}}function ln(e,t,n){return un(e,an,t)}function xe(){let e=new Set;function t(r){return e.add(r),()=>e.delete(r)}let n=!1;function s(r,o){if(n)return!(n=!1);const a={to:r,options:o,defaultPrevented:!1,preventDefault:()=>a.defaultPrevented=!0};for(const i of e)i.listener({...a,from:i.location,retry:c=>{c&&(n=!0),i.navigate(r,{...o,resolve:!1})}});return!a.defaultPrevented}return{subscribe:t,confirm:s}}let te;function se(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),te=window.history.state._depth}x||se();function hn(e){return{...e,_depth:window.history.state&&window.history.state._depth}}function dn(e,t){let n=!1;return()=>{const s=te;se();const r=s==null?null:te-s;if(n){n=!1;return}r&&t(r)?(n=!0,window.history.go(-r)):e()}}const fn=/^(?:[a-z0-9]+:)?\/\//i,pn=/^\/+|(\/)\/+$/g,Ce="http://sr";function N(e,t=!1){const n=e.replace(pn,"$1");return n?t||/^[?#]/.test(n)?n:"/"+n:""}function J(e,t,n){if(fn.test(t))return;const s=N(e),r=n&&N(n);let o="";return!r||t.startsWith("/")?o=s:r.toLowerCase().indexOf(s.toLowerCase())!==0?o=s+r:o=r,(o||"/")+N(t,!o)}function mn(e,t){return N(e).replace(/\/*(\*.*)?$/g,"")+N(t)}function Le(e){const t={};return e.searchParams.forEach((n,s)=>{s in t?Array.isArray(t[s])?t[s].push(n):t[s]=[t[s],n]:t[s]=n}),t}function gn(e,t,n){const[s,r]=e.split("/*",2),o=s.split("/").filter(Boolean),a=o.length;return i=>{const c=i.split("/").filter(Boolean),u=c.length-a;if(u<0||u>0&&r===void 0&&!t)return null;const h={path:a?"":"/",params:{}},w=m=>n===void 0?void 0:n[m];for(let m=0;m<a;m++){const d=o[m],g=d[0]===":",l=g?c[m]:c[m].toLowerCase(),f=g?d.slice(1):d.toLowerCase();if(g&&X(l,w(f)))h.params[f]=l;else if(g||!X(l,f))return null;h.path+=`/${l}`}if(r){const m=u?c.slice(-u).join("/"):"";if(X(m,w(r)))h.params[r]=m;else return null}return h}}function X(e,t){const n=s=>s===e;return t===void 0?!0:typeof t=="string"?n(t):typeof t=="function"?t(e):Array.isArray(t)?t.some(n):t instanceof RegExp?t.test(e):!1}function yn(e){const[t,n]=e.pattern.split("/*",2),s=t.split("/").filter(Boolean);return s.reduce((r,o)=>r+(o.startsWith(":")?2:3),s.length-(n===void 0?0:1))}function He(e){const t=new Map,n=ve();return new Proxy({},{get(s,r){return t.has(r)||Re(n,()=>t.set(r,P(()=>e()[r]))),t.get(r)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(e())},has(s,r){return r in e()}})}function qe(e){let t=/(\/?\:[^\/]+)\?/.exec(e);if(!t)return[e];let n=e.slice(0,t.index),s=e.slice(t.index+t[0].length);const r=[n,n+=t[1]];for(;t=/^(\/\:[^\/]+)\?/.exec(s);)r.push(n+=t[1]),s=s.slice(t[0].length);return qe(s).reduce((o,a)=>[...o,...r.map(i=>i+a)],[])}const wn=100,vn=be(),ke=be();function Rn(e,t=""){const{component:n,preload:s,load:r,children:o,info:a}=e,i=!o||Array.isArray(o)&&!o.length,c={key:e,component:n,preload:s||r,info:a};return Oe(e.path).reduce((u,h)=>{for(const w of qe(h)){const m=mn(t,w);let d=i?m:m.split("/*",1)[0];d=d.split("/").map(g=>g.startsWith(":")||g.startsWith("*")?g:encodeURIComponent(g)).join("/"),u.push({...c,originalPath:h,pattern:d,matcher:gn(d,!i,e.matchFilters)})}return u},[])}function bn(e,t=0){return{routes:e,score:yn(e[e.length-1])*1e4-t,matcher(n){const s=[];for(let r=e.length-1;r>=0;r--){const o=e[r],a=o.matcher(n);if(!a)return null;s.unshift({...a,route:o})}return s}}}function Oe(e){return Array.isArray(e)?e:[e]}function Fe(e,t="",n=[],s=[]){const r=Oe(e);for(let o=0,a=r.length;o<a;o++){const i=r[o];if(i&&typeof i=="object"){i.hasOwnProperty("path")||(i.path="");const c=Rn(i,t);for(const u of c){n.push(u);const h=Array.isArray(i.children)&&i.children.length===0;if(i.children&&!h)Fe(i.children,u.pattern,n,s);else{const w=bn([...n],s.length);s.push(w)}n.pop()}}}return n.length?s:s.sort((o,a)=>a.score-o.score)}function W(e,t){for(let n=0,s=e.length;n<s;n++){const r=e[n].matcher(t);if(r)return r}return[]}function Sn(e,t,n){const s=new URL(Ce),r=P(h=>{const w=e();try{return new URL(w,s)}catch{return console.error(`Invalid path ${w}`),h}},s,{equals:(h,w)=>h.href===w.href}),o=P(()=>r().pathname),a=P(()=>r().search,!0),i=P(()=>r().hash),c=()=>"",u=ne(a,()=>Le(r()));return{get pathname(){return o()},get search(){return a()},get hash(){return i()},get state(){return t()},get key(){return c()},query:n?n(u):He(u)}}let H;function En(){return H}function An(e,t,n,s={}){const{signal:[r,o],utils:a={}}=e,i=a.parsePath||(p=>p),c=a.renderPath||(p=>p),u=a.beforeLeave||xe(),h=J("",s.base||"");if(h===void 0)throw new Error(`${h} is not a valid base path`);h&&!r().value&&o({value:h,replace:!0,scroll:!1});const[w,m]=M(!1);let d;const g=(p,y)=>{y.value===l()&&y.state===b()||(d===void 0&&m(!0),H=p,d=y,tt(()=>{d===y&&(f(d.value),v(d.state),nt(),x||L[1](E=>E.filter(O=>O.pending)))}).finally(()=>{d===y&&rt(()=>{H=void 0,p==="navigate"&&We(d),m(!1),d=void 0})}))},[l,f]=M(r().value),[b,v]=M(r().state),C=Sn(l,b,a.queryWrapper),A=[],L=M(x?Be():[]),j=P(()=>typeof s.transformUrl=="function"?W(t(),s.transformUrl(C.pathname)):W(t(),C.pathname)),oe=()=>{const p=j(),y={};for(let E=0;E<p.length;E++)Object.assign(y,p[E].params);return y},je=a.paramsWrapper?a.paramsWrapper(oe,t):He(oe),ae={pattern:h,path:()=>h,outlet:()=>null,resolvePath(p){return J(h,p)}};return Ze(ne(r,p=>g("native",p),{defer:!0})),{base:ae,location:C,params:je,isRouting:w,renderPath:c,parsePath:i,navigatorFactory:Ne,matches:j,beforeLeave:u,preloadRoute:De,singleFlight:s.singleFlight===void 0?!0:s.singleFlight,submissions:L};function Me(p,y,E){Se(()=>{if(typeof y=="number"){y&&(a.go?a.go(y):console.warn("Router integration does not support relative routing"));return}const O=!y||y[0]==="?",{replace:D,resolve:F,scroll:B,state:_}={replace:!1,resolve:!O,scroll:!0,...E},I=F?p.resolvePath(y):J(O&&C.pathname||"",y);if(I===void 0)throw new Error(`Path '${y}' is not a routable path`);if(A.length>=wn)throw new Error("Too many redirects");const ie=l();if(I!==ie||_!==b())if(x){const ce=k();ce&&(ce.response={status:302,headers:new Headers({Location:I})}),o({value:I,replace:D,scroll:B,state:_})}else u.confirm(I,E)&&(A.push({value:ie,replace:D,scroll:B,state:b()}),g("navigate",{value:I,state:_}))})}function Ne(p){return p=p||et(ke)||ae,(y,E)=>Me(p,y,E)}function We(p){const y=A[0];y&&(o({...p,replace:y.replace,scroll:y.scroll}),A.length=0)}function De(p,y){const E=W(t(),p.pathname),O=H;H="preload";for(let D in E){const{route:F,params:B}=E[D];F.component&&F.component.preload&&F.component.preload();const{preload:_}=F;y&&_&&Re(n(),()=>_({params:B,location:{pathname:p.pathname,search:p.search,hash:p.hash,query:Le(p),state:null,key:""},intent:"preload"}))}H=O}function Be(){const p=k();return p&&p.router&&p.router.submission?[p.router.submission]:[]}}function $n(e,t,n,s){const{base:r,location:o,params:a}=e,{pattern:i,component:c,preload:u}=s().route,h=P(()=>s().path);c&&c.preload&&c.preload();const w=u?u({params:a,location:o,intent:H||"initial"}):void 0;return{parent:t,pattern:i,path:h,outlet:()=>c?we(c,{params:a,location:o,data:w,get children(){return n()}}):n(),resolvePath(d){return J(r.path(),d,h())}}}const _e=e=>t=>{const{base:n}=t,s=st(()=>t.children),r=P(()=>Fe(s(),t.base||""));let o;const a=An(e,r,()=>o,{base:n,singleFlight:t.singleFlight,transformUrl:t.transformUrl});return e.create&&e.create(a),R(vn.Provider,{value:a,get children(){return R(Pn,{routerState:a,get root(){return t.root},get preload(){return t.rootPreload||t.rootLoad},get children(){return[(o=ve())&&null,R(Tn,{routerState:a,get branches(){return r()}})]}})}})};function Pn(e){const t=e.routerState.location,n=e.routerState.params,s=P(()=>e.preload&&Se(()=>{e.preload({params:n,location:t,intent:En()||"initial"})}));return R(Ee,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:r=>R(r,{params:n,location:t,get data(){return s()},get children(){return e.children}})})}function Tn(e){if(x){const r=k();if(r&&r.router&&r.router.dataOnly){xn(r,e.routerState,e.branches);return}r&&((r.router||(r.router={})).matches||(r.router.matches=e.routerState.matches().map(({route:o,path:a,params:i})=>({path:o.originalPath,pattern:o.pattern,match:a,params:i,info:o.info}))))}const t=[];let n;const s=P(ne(e.routerState.matches,(r,o,a)=>{let i=o&&r.length===o.length;const c=[];for(let u=0,h=r.length;u<h;u++){const w=o&&o[u],m=r[u];a&&w&&m.route.key===w.route.key?c[u]=a[u]:(i=!1,t[u]&&t[u](),ot(d=>{t[u]=d,c[u]=$n(e.routerState,c[u-1]||e.routerState.base,me(()=>s()[u+1]),()=>{const g=e.routerState.matches();return g[u]??g[0]})}))}return t.splice(r.length).forEach(u=>u()),a&&i?a:(n=c[0],c)}));return me(()=>s()&&n)()}const me=e=>()=>R(Ee,{get when(){return e()},keyed:!0,children:t=>R(ke.Provider,{value:t,get children(){return t.outlet()}})});function xn(e,t,n){const s=new URL(e.request.url),r=W(n,new URL(e.router.previousUrl||e.request.url).pathname),o=W(n,s.pathname);for(let a=0;a<o.length;a++){(!r[a]||o[a].route!==r[a].route)&&(e.router.dataOnly=!0);const{route:i,params:c}=o[a];i.preload&&i.preload({params:c,location:t.location,intent:"preload"})}}function Cn([e,t],n,s){return[e,s?r=>t(s(r)):t]}function Ln(e){let t=!1;const n=r=>typeof r=="string"?{value:r}:r,s=Cn(M(n(e.get()),{equals:(r,o)=>r.value===o.value&&r.state===o.state}),void 0,r=>(!t&&e.set(r),U.registry&&!U.done&&(U.done=!0),r));return e.init&&re(e.init((r=e.get())=>{t=!0,s[1](n(r)),t=!1})),_e({signal:s,create:e.create,utils:e.utils})}function Hn(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function qn(e,t){const n=e&&document.getElementById(e);n?n.scrollIntoView():t&&window.scrollTo(0,0)}function kn(e){const t=new URL(e);return t.pathname+t.search}function On(e){let t;const n={value:e.url||(t=k())&&kn(t.request.url)||""};return _e({signal:[()=>n,s=>Object.assign(n,s)]})(e)}const Fn=new Map;function _n(e=!0,t=!1,n="/_server",s){return r=>{const o=r.base.path(),a=r.navigatorFactory(r.base);let i,c;function u(l){return l.namespaceURI==="http://www.w3.org/2000/svg"}function h(l){if(l.defaultPrevented||l.button!==0||l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)return;const f=l.composedPath().find(j=>j instanceof Node&&j.nodeName.toUpperCase()==="A");if(!f||t&&!f.hasAttribute("link"))return;const b=u(f),v=b?f.href.baseVal:f.href;if((b?f.target.baseVal:f.target)||!v&&!f.hasAttribute("state"))return;const A=(f.getAttribute("rel")||"").split(/\s+/);if(f.hasAttribute("download")||A&&A.includes("external"))return;const L=b?new URL(v,document.baseURI):new URL(v);if(!(L.origin!==window.location.origin||o&&L.pathname&&!L.pathname.toLowerCase().startsWith(o.toLowerCase())))return[f,L]}function w(l){const f=h(l);if(!f)return;const[b,v]=f,C=r.parsePath(v.pathname+v.search+v.hash),A=b.getAttribute("state");l.preventDefault(),a(C,{resolve:!1,replace:b.hasAttribute("replace"),scroll:!b.hasAttribute("noscroll"),state:A?JSON.parse(A):void 0})}function m(l){const f=h(l);if(!f)return;const[b,v]=f;s&&(v.pathname=s(v.pathname)),r.preloadRoute(v,b.getAttribute("preload")!=="false")}function d(l){clearTimeout(i);const f=h(l);if(!f)return c=null;const[b,v]=f;c!==b&&(s&&(v.pathname=s(v.pathname)),i=setTimeout(()=>{r.preloadRoute(v,b.getAttribute("preload")!=="false"),c=b},20))}function g(l){if(l.defaultPrevented)return;let f=l.submitter&&l.submitter.hasAttribute("formaction")?l.submitter.getAttribute("formaction"):l.target.getAttribute("action");if(!f)return;if(!f.startsWith("https://action/")){const v=new URL(f,Ce);if(f=r.parsePath(v.pathname+v.search),!f.startsWith(n))return}if(l.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const b=Fn.get(f);if(b){l.preventDefault();const v=new FormData(l.target,l.submitter);b.call({r,f:l.target},l.target.enctype==="multipart/form-data"?v:new URLSearchParams(v))}}Je(["click","submit"]),document.addEventListener("click",w),e&&(document.addEventListener("mousemove",d,{passive:!0}),document.addEventListener("focusin",m,{passive:!0}),document.addEventListener("touchstart",m,{passive:!0})),document.addEventListener("submit",g),re(()=>{document.removeEventListener("click",w),e&&(document.removeEventListener("mousemove",d),document.removeEventListener("focusin",m),document.removeEventListener("touchstart",m)),document.removeEventListener("submit",g)})}}function In(e){if(x)return On(e);const t=()=>{const s=window.location.pathname.replace(/^\/+/,"/")+window.location.search,r=window.history.state&&window.history.state._depth&&Object.keys(window.history.state).length===1?void 0:window.history.state;return{value:s+window.location.hash,state:r}},n=xe();return Ln({get:t,set({value:s,replace:r,scroll:o,state:a}){r?window.history.replaceState(hn(a),"",s):window.history.pushState(a,"",s),qn(decodeURIComponent(window.location.hash.slice(1)),o),se()},init:s=>Hn(window,"popstate",dn(s,r=>{if(r)return!n.confirm(r);{const o=t();return!n.confirm(o.value,{state:o.state})}})),create:_n(e.preload,e.explicitLinks,e.actionBase,e.transformUrl),utils:{go:s=>window.history.go(s),beforeLeave:n}})(e)}function Un(){return R(In,{root:e=>R(at,{get children(){return e.children}}),get children(){return R(sn,{})}})}const Ie=x?e=>{const t=k();return t.response.status=e.code,t.response.statusText=e.text,re(()=>!t.nativeEvent.handled&&!t.complete&&(t.response.status=200)),null}:e=>null;var jn=["<span",' style="font-size:1.5em;text-align:center;position:fixed;left:0px;bottom:55%;width:100%;">',"</span>"],Mn=["<span",' style="font-size:1.5em;text-align:center;position:fixed;left:0px;bottom:55%;width:100%;">500 | Internal Server Error</span>'];const Nn=e=>{const t=x?"500 | Internal Server Error":"Error | Uncaught Client Exception";return R(ct,{fallback:n=>(console.error(n),[$(jn,q(),T(t)),R(Ie,{code:500})]),get children(){return e.children}})},Wn=e=>{let t=!1;const n=it(()=>e.children,s=>{console.error(s),t=!!s});return t?[$(Mn,q()),R(Ie,{code:500})]:n};var ge=["<script",">","<\/script>"],Dn=["<script",' type="module"'," async","><\/script>"],Bn=["<script",' type="module" async',"><\/script>"];const Kn=$("<!DOCTYPE html>");function Ue(e,t,n=[]){for(let s=0;s<t.length;s++){const r=t[s];if(r.path!==e[0].path)continue;let o=[...n,r];if(r.children){const a=e.slice(1);if(a.length===0||(o=Ue(a,r.children,o),!o))continue}return o}}function zn(e){const t=k(),n=t.nonce;let s=[];return Promise.resolve().then(async()=>{let r=[];if(t.router&&t.router.matches){const o=[...t.router.matches];for(;o.length&&(!o[0].info||!o[0].info.filesystem);)o.shift();const a=o.length&&Ue(o,t.routes);if(a){const i=globalThis.MANIFEST.client.inputs;for(let c=0;c<a.length;c++){const u=a[c],h=i[u.$component.src];r.push(h.assets())}}}s=await Promise.all(r).then(o=>[...new Map(o.flat().map(a=>[a.attrs.key,a])).values()].filter(a=>a.attrs.rel==="modulepreload"&&!t.assets.find(i=>i.attrs.key===a.attrs.key)))}),Ve(()=>s.length?s.map(r=>Z(r)):void 0),R(ye,{get children(){return[Kn,R(Wn,{get children(){return R(e.document,{get assets(){return[R(Ye,{}),t.assets.map(r=>Z(r,n))]},get scripts(){return n?[$(ge,q()+z("nonce",T(n,!0),!1),`window.manifest = ${JSON.stringify(t.manifest)}`),$(Dn,q(),z("nonce",T(n,!0),!1),z("src",T(globalThis.MANIFEST.client.inputs[globalThis.MANIFEST.client.handler].output.path,!0),!1))]:[$(ge,q(),`window.manifest = ${JSON.stringify(t.manifest)}`),$(Bn,q(),z("src",T(globalThis.MANIFEST.client.inputs[globalThis.MANIFEST.client.handler].output.path,!0),!1))]},get children(){return R(Xe,{get children(){return R(Nn,{get children(){return R(Un,{})}})}})}})}})]}})}var Gn=['<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>SolidStart Vite sprite fixture</title>',"</head>"],Jn=["<html",' lang="en">','<body><div id="app">',"</div><!--$-->","<!--/--></body></html>"];function Vn(e){return $(Jn,q(),R(ye,{get children(){return $(Gn,T(e.assets))}}),T(e.children),T(e.scripts))}const rr=ln(()=>R(zn,{document:Vn}));export{rr as default};
|