@qwik.dev/core 2.0.0-beta.17 → 2.0.0-beta.19

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 (51) hide show
  1. package/bindings/qwik.darwin-arm64.node +0 -0
  2. package/bindings/qwik.linux-x64-gnu.node +0 -0
  3. package/bindings/qwik.win32-x64-msvc.node +0 -0
  4. package/bindings/qwik_wasm_bg.wasm +0 -0
  5. package/dist/backpatch/package.json +1 -1
  6. package/dist/build/package.json +1 -1
  7. package/dist/cli.mjs +57 -57
  8. package/dist/core-internal.d.ts +32 -32
  9. package/dist/core.min.mjs +1 -1
  10. package/dist/core.mjs +1234 -788
  11. package/dist/core.mjs.map +1 -1
  12. package/dist/core.prod.mjs +815 -553
  13. package/dist/loader/index.mjs +2 -2
  14. package/dist/loader/package.json +1 -1
  15. package/dist/optimizer.mjs +1007 -1000
  16. package/dist/qwikloader.debug.js +1 -1
  17. package/dist/qwikloader.js +1 -1
  18. package/dist/server.mjs +65 -106
  19. package/dist/starters/adapters/cloudflare-workers/README.md +52 -0
  20. package/dist/starters/adapters/cloudflare-workers/adapters/cloudflare-workers/vite.config.ts +15 -0
  21. package/dist/starters/adapters/cloudflare-workers/gitignore +3 -0
  22. package/dist/starters/adapters/cloudflare-workers/package.json +31 -0
  23. package/dist/starters/adapters/cloudflare-workers/public/.assetsignore +4 -0
  24. package/dist/starters/adapters/cloudflare-workers/public/_headers +11 -0
  25. package/dist/starters/adapters/cloudflare-workers/public/_redirects +1 -0
  26. package/dist/starters/adapters/cloudflare-workers/src/entry.cloudflare-pages.tsx +23 -0
  27. package/dist/starters/adapters/cloudflare-workers/worker-configuration.d.ts +5 -0
  28. package/dist/starters/adapters/cloudflare-workers/wrangler.jsonc +41 -0
  29. package/dist/starters/adapters/express/package.json +1 -1
  30. package/dist/starters/features/compiled-i18n/package.json +37 -0
  31. package/dist/starters/features/compiled-i18n/src/components/locale-selector/locale-selector.tsx +30 -0
  32. package/dist/starters/features/{localize → compiled-i18n}/src/entry.ssr.tsx +7 -2
  33. package/dist/starters/features/compiled-i18n/src/routes/plugin@compiled-i18n.ts +28 -0
  34. package/dist/starters/features/csr/package.json +1 -1
  35. package/dist/starters/features/cypress/src/actions/example.action.ts +5 -0
  36. package/dist/starters/features/cypress/src/components/example/example.cy.tsx +50 -8
  37. package/dist/starters/features/cypress/src/components/example/example.tsx +13 -3
  38. package/dist/starters/features/cypress/src/loaders/example.loader.ts +5 -0
  39. package/dist/starters/features/playwright/playwright-report/index.html +0 -19
  40. package/dist/testing/index.d.ts +11 -11
  41. package/dist/testing/index.mjs +2966 -2498
  42. package/dist/testing/package.json +1 -1
  43. package/package.json +14 -11
  44. package/bindings/qwik.darwin-x64.node +0 -0
  45. package/bindings/qwik.wasm.cjs +0 -471
  46. package/dist/starters/features/localize/package.json +0 -37
  47. package/dist/starters/features/localize/src/locales/message.en.json +0 -8
  48. package/dist/starters/features/localize/src/locales/message.it.json +0 -8
  49. package/dist/starters/features/localize/src/routes/[locale]/i18n-utils.ts +0 -94
  50. package/dist/starters/features/localize/src/routes/[locale]/index.tsx +0 -52
  51. package/dist/starters/features/localize/src/routes/[locale]/layout.tsx +0 -12
@@ -253,7 +253,7 @@ if (!("__q_context__" in doc)) {
253
253
  if (Array.isArray(qwikevents)) {
254
254
  processEventOrNode(...qwikevents);
255
255
  } else {
256
- processEventOrNode("click", "input");
256
+ processEventOrNode(":click", ":input");
257
257
  }
258
258
  }
259
259
  win.qwikevents = {
@@ -1 +1 @@
1
- const t=document,e=window,n=new Set,o=new Set([t]),r={},s="-window",i="-document";let a;const c=(t,e)=>Array.from(t.querySelectorAll(e)),l=t=>{const e=[];return o.forEach(n=>e.push(...c(n,t))),e},f=t=>{A(t),c(t,"[q\\:shadowroot]").forEach(t=>{const e=t.shadowRoot;e&&f(e)})},p=t=>t&&"function"==typeof t.then,u=(t,e,n=e.type)=>{l("[on"+t+"\\:"+n+"]").forEach(o=>{h(o,t,e,n)})},b=e=>{if(void 0===e._qwikjson_){let n=(e===t.documentElement?t.body:e).lastElementChild;for(;n;){if("SCRIPT"===n.tagName&&"qwik/json"===n.getAttribute("type")){e._qwikjson_=JSON.parse(n.textContent.replace(/\\x3C(\/?script)/gi,"<$1"));break}n=n.previousElementSibling}}},q=(t,e)=>new CustomEvent(t,{detail:e}),h=async(e,n,o,s=o.type)=>{const i="on"+n+":"+s;e.hasAttribute("preventdefault:"+s)&&o.preventDefault(),e.hasAttribute("stoppropagation:"+s)&&o.stopPropagation();const a=e._qc_,c=a&&a.li.filter(t=>t[0]===i);if(c&&c.length>0){for(const t of c){const n=t[1].getFn([e,o],()=>e.isConnected)(o,e),r=o.cancelBubble;p(n)&&await n,r&&o.stopPropagation()}return}const l=e.qDispatchEvent;if(l)return l(o,n);const f=e.getAttribute(i);if(f){const n=e.closest("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])"),s=n.getAttribute("q:base"),i=n.getAttribute("q:version")||"unknown",a=n.getAttribute("q:manifest-hash")||"dev",c=new URL(s,t.baseURI);for(const l of f.split("\n")){const f=new URL(l,c),u=f.href,q=f.hash.replace(/^#?([^?[|]*).*$/,"$1")||"default",h=performance.now();let d,m,g;const y=l.startsWith("#"),v={qBase:s,qManifest:a,qVersion:i,href:u,symbol:q,element:e,reqTime:h};if(y){const e=n.getAttribute("q:instance");d=(t["qFuncs_"+e]||[])[Number.parseInt(q)],d||(m="sync",g=Error("sym:"+q))}else if(q in r)d=r[q];else{_("qsymbol",v);const t=f.href.split("#")[0];try{const e=import(t);b(n),d=(await e)[q],d?r[q]=d:(m="no-symbol",g=Error(`${q} not in ${t}`))}catch(t){m||(m="async"),g=t}}if(!d){_("qerror",{importError:m,error:g,...v}),console.error(g);break}const w=t.__q_context__;if(e.isConnected)try{t.__q_context__=[e,o,f];const n=d(o,e);p(n)&&await n}catch(t){_("qerror",{error:t,...v})}finally{t.__q_context__=w}}}},_=(e,n)=>{t.dispatchEvent(q(e,n))},d=t=>t.replace(/([A-Z-])/g,t=>"-"+t.toLowerCase()),m=async(t,e)=>{let n=d(t.type),o=t.target;if(e!==i)for(;o&&o.getAttribute;){const e=h(o,"",t,n);let r=t.cancelBubble;p(e)&&await e,r||(r=r||t.cancelBubble||o.hasAttribute("stoppropagation:"+t.type)),o=t.bubbles&&!0!==r?o.parentElement:null}else u(i,t,n)},g=t=>{u(s,t,d(t.type))},y=()=>{const r=t.readyState;if(!a&&("interactive"==r||"complete"==r)&&(o.forEach(f),a=1,_("qinit"),(e.requestIdleCallback??e.setTimeout).bind(e)(()=>_("qidle")),n.has(":qvisible"))){const t=l("[on\\:qvisible]"),e=new IntersectionObserver(t=>{for(const n of t)n.isIntersecting&&(e.unobserve(n.target),h(n.target,"",q("qvisible",n)))});t.forEach(t=>e.observe(t))}},v=(t,e,n,o=!1)=>{t.addEventListener(e,n,{capture:o,passive:!1})},w=t=>t.replace(/-./g,t=>t[1].toUpperCase()),E=t=>{const e=t.indexOf(":");let n="",o=t;if(e>=0){const r=t.substring(0,e);""!==r&&r!==s&&r!==i||(n=r,o=t.substring(e+1))}return{scope:n,eventName:w(o)}},A=(...t)=>{for(const r of t)if("string"==typeof r){if(!n.has(r)){n.add(r);const{scope:t,eventName:i}=E(r);t===s?v(e,i,g,!0):o.forEach(e=>v(e,i,e=>m(e,t),!0))}}else o.has(r)||(n.forEach(t=>{const{scope:e,eventName:n}=E(t);v(r,n,t=>m(t,e),!0)}),o.add(r))};if(!("__q_context__"in t)){t.__q_context__=0;const r=e.qwikevents;r&&(Array.isArray(r)?A(...r):A("click","input")),e.qwikevents={events:n,roots:o,push:A},v(t,"readystatechange",y),y()}
1
+ const t=document,e=window,n=new Set,o=new Set([t]),r={},s="-window",i="-document";let a;const c=(t,e)=>Array.from(t.querySelectorAll(e)),l=t=>{const e=[];return o.forEach(n=>e.push(...c(n,t))),e},f=t=>{A(t),c(t,"[q\\:shadowroot]").forEach(t=>{const e=t.shadowRoot;e&&f(e)})},p=t=>t&&"function"==typeof t.then,u=(t,e,n=e.type)=>{l("[on"+t+"\\:"+n+"]").forEach(o=>{h(o,t,e,n)})},b=e=>{if(void 0===e._qwikjson_){let n=(e===t.documentElement?t.body:e).lastElementChild;for(;n;){if("SCRIPT"===n.tagName&&"qwik/json"===n.getAttribute("type")){e._qwikjson_=JSON.parse(n.textContent.replace(/\\x3C(\/?script)/gi,"<$1"));break}n=n.previousElementSibling}}},q=(t,e)=>new CustomEvent(t,{detail:e}),h=async(e,n,o,s=o.type)=>{const i="on"+n+":"+s;e.hasAttribute("preventdefault:"+s)&&o.preventDefault(),e.hasAttribute("stoppropagation:"+s)&&o.stopPropagation();const a=e._qc_,c=a&&a.li.filter(t=>t[0]===i);if(c&&c.length>0){for(const t of c){const n=t[1].getFn([e,o],()=>e.isConnected)(o,e),r=o.cancelBubble;p(n)&&await n,r&&o.stopPropagation()}return}const l=e.qDispatchEvent;if(l)return l(o,n);const f=e.getAttribute(i);if(f){const n=e.closest("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])"),s=n.getAttribute("q:base"),i=n.getAttribute("q:version")||"unknown",a=n.getAttribute("q:manifest-hash")||"dev",c=new URL(s,t.baseURI);for(const l of f.split("\n")){const f=new URL(l,c),u=f.href,q=f.hash.replace(/^#?([^?[|]*).*$/,"$1")||"default",h=performance.now();let d,m,g;const y=l.startsWith("#"),v={qBase:s,qManifest:a,qVersion:i,href:u,symbol:q,element:e,reqTime:h};if(y){const e=n.getAttribute("q:instance");d=(t["qFuncs_"+e]||[])[Number.parseInt(q)],d||(m="sync",g=Error("sym:"+q))}else if(q in r)d=r[q];else{_("qsymbol",v);const t=f.href.split("#")[0];try{const e=import(t);b(n),d=(await e)[q],d?r[q]=d:(m="no-symbol",g=Error(`${q} not in ${t}`))}catch(t){m||(m="async"),g=t}}if(!d){_("qerror",{importError:m,error:g,...v}),console.error(g);break}const w=t.__q_context__;if(e.isConnected)try{t.__q_context__=[e,o,f];const n=d(o,e);p(n)&&await n}catch(t){_("qerror",{error:t,...v})}finally{t.__q_context__=w}}}},_=(e,n)=>{t.dispatchEvent(q(e,n))},d=t=>t.replace(/([A-Z-])/g,t=>"-"+t.toLowerCase()),m=async(t,e)=>{let n=d(t.type),o=t.target;if(e!==i)for(;o&&o.getAttribute;){const e=h(o,"",t,n);let r=t.cancelBubble;p(e)&&await e,r||(r=r||t.cancelBubble||o.hasAttribute("stoppropagation:"+t.type)),o=t.bubbles&&!0!==r?o.parentElement:null}else u(i,t,n)},g=t=>{u(s,t,d(t.type))},y=()=>{const r=t.readyState;if(!a&&("interactive"==r||"complete"==r)&&(o.forEach(f),a=1,_("qinit"),(e.requestIdleCallback??e.setTimeout).bind(e)(()=>_("qidle")),n.has(":qvisible"))){const t=l("[on\\:qvisible]"),e=new IntersectionObserver(t=>{for(const n of t)n.isIntersecting&&(e.unobserve(n.target),h(n.target,"",q("qvisible",n)))});t.forEach(t=>e.observe(t))}},v=(t,e,n,o=!1)=>{t.addEventListener(e,n,{capture:o,passive:!1})},w=t=>t.replace(/-./g,t=>t[1].toUpperCase()),E=t=>{const e=t.indexOf(":");let n="",o=t;if(e>=0){const r=t.substring(0,e);""!==r&&r!==s&&r!==i||(n=r,o=t.substring(e+1))}return{scope:n,eventName:w(o)}},A=(...t)=>{for(const r of t)if("string"==typeof r){if(!n.has(r)){n.add(r);const{scope:t,eventName:i}=E(r);t===s?v(e,i,g,!0):o.forEach(e=>v(e,i,e=>m(e,t),!0))}}else o.has(r)||(n.forEach(t=>{const{scope:e,eventName:n}=E(t);v(r,n,t=>m(t,e),!0)}),o.add(r))};if(!("__q_context__"in t)){t.__q_context__=0;const r=e.qwikevents;r&&(Array.isArray(r)?A(...r):A(":click",":input")),e.qwikevents={events:n,roots:o,push:A},v(t,"readystatechange",y),y()}
package/dist/server.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core/server 2.0.0-beta.17-dev+c34c237
3
+ * @qwik.dev/core/server 2.0.0-beta.19-dev+0d046fb
4
4
  * Copyright QwikDev. All Rights Reserved.
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
@@ -20,7 +20,10 @@ import { setPlatform as setPlatform2 } from "@qwik.dev/core";
20
20
 
21
21
  // packages/qwik/src/server/platform.ts
22
22
  import { setPlatform } from "@qwik.dev/core";
23
- import { isDev as isDev3 } from "@qwik.dev/core/build";
23
+ import { isDev as isDev4 } from "@qwik.dev/core/build";
24
+
25
+ // packages/qwik/src/core/client/util-mapArray.ts
26
+ import { isDev } from "@qwik.dev/core/build";
24
27
 
25
28
  // packages/qwik/src/core/shared/utils/qdev.ts
26
29
  var qDev = globalThis.qDev !== false;
@@ -64,7 +67,7 @@ function assertTrue(value1, text, ...parts) {
64
67
 
65
68
  // packages/qwik/src/core/client/util-mapArray.ts
66
69
  var mapApp_findIndx = (array, key, start) => {
67
- assertTrue(start % 2 === 0, "Expecting even number.");
70
+ isDev && assertTrue(start % 2 === 0, "Expecting even number.");
68
71
  let bottom = start >> 1;
69
72
  let top = array.length - 2 >> 1;
70
73
  while (bottom <= top) {
@@ -223,7 +226,7 @@ var qError = (code, errorMessageArgs = []) => {
223
226
  };
224
227
 
225
228
  // packages/qwik/src/core/shared/qrl/qrl-utils.ts
226
- import { isDev } from "@qwik.dev/core/build";
229
+ import { isDev as isDev2 } from "@qwik.dev/core/build";
227
230
  var SYNC_QRL = "<sync>";
228
231
 
229
232
  // packages/qwik/src/core/shared/types.ts
@@ -611,7 +614,7 @@ var Q_PROPS_SEPARATOR = ":";
611
614
  var dangerouslySetInnerHTML = "dangerouslySetInnerHTML";
612
615
 
613
616
  // packages/qwik/src/core/shared/utils/promises.ts
614
- import { isDev as isDev2, isServer } from "@qwik.dev/core/build";
617
+ import { isDev as isDev3, isServer } from "@qwik.dev/core/build";
615
618
  var MAX_RETRY_ON_PROMISE_COUNT = 100;
616
619
  var isPromise = (value) => {
617
620
  return !!value && typeof value == "object" && typeof value.then === "function";
@@ -633,7 +636,7 @@ function retryOnPromise(fn, retryCount = 0) {
633
636
  }
634
637
  return result;
635
638
  } catch (e) {
636
- if (isDev2 && isServer && e instanceof ReferenceError && e.message.includes("window")) {
639
+ if (isDev3 && isServer && e instanceof ReferenceError && e.message.includes("window")) {
637
640
  e.message = 'It seems like you forgot to add "if (isBrowser) {...}" here:' + e.message;
638
641
  throw e;
639
642
  }
@@ -1089,9 +1092,9 @@ var getDevSegmentPath = (mapper, hash2, symbolName, parent) => {
1089
1092
  function createPlatform(opts, resolvedManifest) {
1090
1093
  const mapper = resolvedManifest?.mapper;
1091
1094
  const mapperFn = opts.symbolMapper ? opts.symbolMapper : (symbolName, _chunk, parent) => {
1092
- if (mapper || isDev3 && import.meta.env.MODE !== "test") {
1095
+ if (mapper || isDev4 && import.meta.env.MODE !== "test") {
1093
1096
  const hash2 = getSymbolHash(symbolName);
1094
- const result = !isDev3 ? mapper[hash2] : getDevSegmentPath(mapper, hash2, symbolName, parent);
1097
+ const result = !isDev4 ? mapper[hash2] : getDevSegmentPath(mapper, hash2, symbolName, parent);
1095
1098
  if (!result) {
1096
1099
  if (hash2 === SYNC_QRL) {
1097
1100
  return [hash2, ""];
@@ -1171,16 +1174,15 @@ function getBuildBase(opts) {
1171
1174
  return `${import.meta.env.BASE_URL || "/"}build/`;
1172
1175
  }
1173
1176
  var versions = {
1174
- qwik: "2.0.0-beta.17-dev+c34c237",
1177
+ qwik: "2.0.0-beta.19-dev+0d046fb",
1175
1178
  qwikDom: "2.1.19"
1176
1179
  };
1177
1180
 
1178
1181
  // packages/qwik/src/server/ssr-container.ts
1179
- import { isDev as isDev5 } from "@qwik.dev/core/build";
1182
+ import { isDev as isDev6 } from "@qwik.dev/core/build";
1180
1183
  import {
1181
1184
  _SubscriptionData as SubscriptionData,
1182
1185
  _SharedContainer,
1183
- _executeSsrChores,
1184
1186
  _jsxSorted,
1185
1187
  _jsxSplit,
1186
1188
  _walkJSX,
@@ -1212,7 +1214,7 @@ function flattenPrefetchResources(prefetchResources) {
1212
1214
  // packages/qwik/src/server/preload-strategy.ts
1213
1215
  var getBundles = (qrls) => {
1214
1216
  const platform = getPlatform();
1215
- return qrls?.map((qrl) => {
1217
+ const bundles2 = qrls?.map((qrl) => {
1216
1218
  const symbol = qrl.$symbol$;
1217
1219
  const chunk = qrl.$chunk$;
1218
1220
  const result = platform.chunkForSymbol(symbol, chunk, qrl.dev?.file);
@@ -1221,6 +1223,7 @@ var getBundles = (qrls) => {
1221
1223
  }
1222
1224
  return chunk;
1223
1225
  }).filter(Boolean);
1226
+ return [...new Set(bundles2)];
1224
1227
  };
1225
1228
  function getPreloadPaths(qrls, opts, resolvedManifest) {
1226
1229
  const prefetchStrategy = opts.prefetchStrategy;
@@ -1429,8 +1432,8 @@ var preLoaderOptionsDefault = {
1429
1432
  };
1430
1433
 
1431
1434
  // packages/qwik/src/server/scripts.ts
1432
- var QWIK_LOADER_DEFAULT_MINIFIED = 'const t=document,e=window,n=new Set,o=new Set([t]),r={},s="-window",i="-document";let a;const c=(t,e)=>Array.from(t.querySelectorAll(e)),l=t=>{const e=[];return o.forEach(n=>e.push(...c(n,t))),e},f=t=>{A(t),c(t,"[q\\\\:shadowroot]").forEach(t=>{const e=t.shadowRoot;e&&f(e)})},p=t=>t&&"function"==typeof t.then,u=(t,e,n=e.type)=>{l("[on"+t+"\\\\:"+n+"]").forEach(o=>{h(o,t,e,n)})},b=e=>{if(void 0===e._qwikjson_){let n=(e===t.documentElement?t.body:e).lastElementChild;for(;n;){if("SCRIPT"===n.tagName&&"qwik/json"===n.getAttribute("type")){e._qwikjson_=JSON.parse(n.textContent.replace(/\\\\x3C(\\/?script)/gi,"<$1"));break}n=n.previousElementSibling}}},q=(t,e)=>new CustomEvent(t,{detail:e}),h=async(e,n,o,s=o.type)=>{const i="on"+n+":"+s;e.hasAttribute("preventdefault:"+s)&&o.preventDefault(),e.hasAttribute("stoppropagation:"+s)&&o.stopPropagation();const a=e._qc_,c=a&&a.li.filter(t=>t[0]===i);if(c&&c.length>0){for(const t of c){const n=t[1].getFn([e,o],()=>e.isConnected)(o,e),r=o.cancelBubble;p(n)&&await n,r&&o.stopPropagation()}return}const l=e.qDispatchEvent;if(l)return l(o,n);const f=e.getAttribute(i);if(f){const n=e.closest("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"),s=n.getAttribute("q:base"),i=n.getAttribute("q:version")||"unknown",a=n.getAttribute("q:manifest-hash")||"dev",c=new URL(s,t.baseURI);for(const l of f.split("\\n")){const f=new URL(l,c),u=f.href,q=f.hash.replace(/^#?([^?[|]*).*$/,"$1")||"default",h=performance.now();let d,m,g;const y=l.startsWith("#"),v={qBase:s,qManifest:a,qVersion:i,href:u,symbol:q,element:e,reqTime:h};if(y){const e=n.getAttribute("q:instance");d=(t["qFuncs_"+e]||[])[Number.parseInt(q)],d||(m="sync",g=Error("sym:"+q))}else if(q in r)d=r[q];else{_("qsymbol",v);const t=f.href.split("#")[0];try{const e=import(t);b(n),d=(await e)[q],d?r[q]=d:(m="no-symbol",g=Error(`${q} not in ${t}`))}catch(t){m||(m="async"),g=t}}if(!d){_("qerror",{importError:m,error:g,...v}),console.error(g);break}const w=t.__q_context__;if(e.isConnected)try{t.__q_context__=[e,o,f];const n=d(o,e);p(n)&&await n}catch(t){_("qerror",{error:t,...v})}finally{t.__q_context__=w}}}},_=(e,n)=>{t.dispatchEvent(q(e,n))},d=t=>t.replace(/([A-Z-])/g,t=>"-"+t.toLowerCase()),m=async(t,e)=>{let n=d(t.type),o=t.target;if(e!==i)for(;o&&o.getAttribute;){const e=h(o,"",t,n);let r=t.cancelBubble;p(e)&&await e,r||(r=r||t.cancelBubble||o.hasAttribute("stoppropagation:"+t.type)),o=t.bubbles&&!0!==r?o.parentElement:null}else u(i,t,n)},g=t=>{u(s,t,d(t.type))},y=()=>{const r=t.readyState;if(!a&&("interactive"==r||"complete"==r)&&(o.forEach(f),a=1,_("qinit"),(e.requestIdleCallback??e.setTimeout).bind(e)(()=>_("qidle")),n.has(":qvisible"))){const t=l("[on\\\\:qvisible]"),e=new IntersectionObserver(t=>{for(const n of t)n.isIntersecting&&(e.unobserve(n.target),h(n.target,"",q("qvisible",n)))});t.forEach(t=>e.observe(t))}},v=(t,e,n,o=!1)=>{t.addEventListener(e,n,{capture:o,passive:!1})},w=t=>t.replace(/-./g,t=>t[1].toUpperCase()),E=t=>{const e=t.indexOf(":");let n="",o=t;if(e>=0){const r=t.substring(0,e);""!==r&&r!==s&&r!==i||(n=r,o=t.substring(e+1))}return{scope:n,eventName:w(o)}},A=(...t)=>{for(const r of t)if("string"==typeof r){if(!n.has(r)){n.add(r);const{scope:t,eventName:i}=E(r);t===s?v(e,i,g,!0):o.forEach(e=>v(e,i,e=>m(e,t),!0))}}else o.has(r)||(n.forEach(t=>{const{scope:e,eventName:n}=E(t);v(r,n,t=>m(t,e),!0)}),o.add(r))};if(!("__q_context__"in t)){t.__q_context__=0;const r=e.qwikevents;r&&(Array.isArray(r)?A(...r):A("click","input")),e.qwikevents={events:n,roots:o,push:A},v(t,"readystatechange",y),y()}';
1433
- var QWIK_LOADER_DEFAULT_DEBUG = 'const doc = document;\nconst win = window;\nconst events = /* @__PURE__ */ new Set();\nconst roots = /* @__PURE__ */ new Set([doc]);\nconst symbols = {};\nconst windowPrefix = "-window";\nconst documentPrefix = "-document";\nlet hasInitialized;\nconst nativeQuerySelectorAll = (root, selector) => Array.from(root.querySelectorAll(selector));\nconst querySelectorAll = (query) => {\n const elements = [];\n roots.forEach((root) => elements.push(...nativeQuerySelectorAll(root, query)));\n return elements;\n};\nconst findShadowRoots = (fragment) => {\n processEventOrNode(fragment);\n nativeQuerySelectorAll(fragment, "[q\\\\:shadowroot]").forEach((parent) => {\n const shadowRoot = parent.shadowRoot;\n shadowRoot && findShadowRoots(shadowRoot);\n });\n};\nconst isPromise = (promise) => promise && typeof promise.then === "function";\nconst broadcast = (infix, ev, type = ev.type) => {\n querySelectorAll("[on" + infix + "\\\\:" + type + "]").forEach((el) => {\n dispatch(el, infix, ev, type);\n });\n};\nconst resolveContainer = (containerEl) => {\n if (containerEl._qwikjson_ === void 0) {\n const parentJSON = containerEl === doc.documentElement ? doc.body : containerEl;\n let script = parentJSON.lastElementChild;\n while (script) {\n if (script.tagName === "SCRIPT" && script.getAttribute("type") === "qwik/json") {\n containerEl._qwikjson_ = JSON.parse(\n script.textContent.replace(/\\\\x3C(\\/?script)/gi, "<$1")\n );\n break;\n }\n script = script.previousElementSibling;\n }\n }\n};\nconst createEvent = (eventName, detail) => new CustomEvent(eventName, {\n detail\n});\nconst dispatch = async (element, scope, ev, eventName = ev.type) => {\n const attrName = "on" + scope + ":" + eventName;\n if (element.hasAttribute("preventdefault:" + eventName)) {\n ev.preventDefault();\n }\n if (element.hasAttribute("stoppropagation:" + eventName)) {\n ev.stopPropagation();\n }\n const ctx = element._qc_;\n const relevantListeners = ctx && ctx.li.filter((li) => li[0] === attrName);\n if (relevantListeners && relevantListeners.length > 0) {\n for (const listener of relevantListeners) {\n const results = listener[1].getFn([element, ev], () => element.isConnected)(ev, element);\n const cancelBubble = ev.cancelBubble;\n if (isPromise(results)) {\n await results;\n }\n if (cancelBubble) {\n ev.stopPropagation();\n }\n }\n return;\n }\n const qDispatchEvent = element.qDispatchEvent;\n if (qDispatchEvent) {\n return qDispatchEvent(ev, scope);\n }\n const attrValue = element.getAttribute(attrName);\n if (attrValue) {\n const container = element.closest(\n "[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"\n );\n const qBase = container.getAttribute("q:base");\n const qVersion = container.getAttribute("q:version") || "unknown";\n const qManifest = container.getAttribute("q:manifest-hash") || "dev";\n const base = new URL(qBase, doc.baseURI);\n for (const qrl of attrValue.split("\\n")) {\n const url = new URL(qrl, base);\n const href = url.href;\n const symbol = url.hash.replace(/^#?([^?[|]*).*$/, "$1") || "default";\n const reqTime = performance.now();\n let handler;\n let importError;\n let error;\n const isSync = qrl.startsWith("#");\n const eventData = {\n qBase,\n qManifest,\n qVersion,\n href,\n symbol,\n element,\n reqTime\n };\n if (isSync) {\n const hash = container.getAttribute("q:instance");\n handler = (doc["qFuncs_" + hash] || [])[Number.parseInt(symbol)];\n if (!handler) {\n importError = "sync";\n error = new Error("sym:" + symbol);\n }\n } else if (symbol in symbols) {\n handler = symbols[symbol];\n } else {\n emitEvent("qsymbol", eventData);\n const uri = url.href.split("#")[0];\n try {\n const module = import(\n uri\n );\n resolveContainer(container);\n handler = (await module)[symbol];\n if (!handler) {\n importError = "no-symbol";\n error = new Error(`${symbol} not in ${uri}`);\n } else {\n symbols[symbol] = handler;\n }\n } catch (err) {\n importError || (importError = "async");\n error = err;\n }\n }\n if (!handler) {\n emitEvent("qerror", {\n importError,\n error,\n ...eventData\n });\n console.error(error);\n break;\n }\n const previousCtx = doc.__q_context__;\n if (element.isConnected) {\n try {\n doc.__q_context__ = [element, ev, url];\n const results = handler(ev, element);\n if (isPromise(results)) {\n await results;\n }\n } catch (error2) {\n emitEvent("qerror", { error: error2, ...eventData });\n } finally {\n doc.__q_context__ = previousCtx;\n }\n }\n }\n }\n};\nconst emitEvent = (eventName, detail) => {\n doc.dispatchEvent(createEvent(eventName, detail));\n};\nconst camelToKebab = (str) => str.replace(/([A-Z-])/g, (a) => "-" + a.toLowerCase());\nconst processDocumentEvent = async (ev, scope) => {\n let type = camelToKebab(ev.type);\n let element = ev.target;\n if (scope === documentPrefix) {\n broadcast(documentPrefix, ev, type);\n return;\n }\n while (element && element.getAttribute) {\n const results = dispatch(element, "", ev, type);\n let cancelBubble = ev.cancelBubble;\n if (isPromise(results)) {\n await results;\n }\n cancelBubble || (cancelBubble = cancelBubble || ev.cancelBubble || element.hasAttribute("stoppropagation:" + ev.type));\n element = ev.bubbles && cancelBubble !== true ? element.parentElement : null;\n }\n};\nconst processWindowEvent = (ev) => {\n broadcast(windowPrefix, ev, camelToKebab(ev.type));\n};\nconst processReadyStateChange = () => {\n const readyState = doc.readyState;\n if (!hasInitialized && (readyState == "interactive" || readyState == "complete")) {\n roots.forEach(findShadowRoots);\n hasInitialized = 1;\n emitEvent("qinit");\n const riC = win.requestIdleCallback ?? win.setTimeout;\n riC.bind(win)(() => emitEvent("qidle"));\n if (events.has(":qvisible")) {\n const results = querySelectorAll("[on\\\\:qvisible]");\n const observer = new IntersectionObserver((entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n observer.unobserve(entry.target);\n dispatch(entry.target, "", createEvent("qvisible", entry));\n }\n }\n });\n results.forEach((el) => observer.observe(el));\n }\n }\n};\nconst addEventListener = (el, eventName, handler, capture = false) => {\n el.addEventListener(eventName, handler, { capture, passive: false });\n};\nconst kebabToCamel = (eventName) => eventName.replace(/-./g, (a) => a[1].toUpperCase());\nconst processEventName = (event) => {\n const i = event.indexOf(":");\n let scope = "";\n let eventName = event;\n if (i >= 0) {\n const s = event.substring(0, i);\n if (s === "" || s === windowPrefix || s === documentPrefix) {\n scope = s;\n eventName = event.substring(i + 1);\n }\n }\n return { scope, eventName: kebabToCamel(eventName) };\n};\nconst processEventOrNode = (...eventNames) => {\n for (const eventNameOrNode of eventNames) {\n if (typeof eventNameOrNode === "string") {\n if (!events.has(eventNameOrNode)) {\n events.add(eventNameOrNode);\n const { scope, eventName } = processEventName(eventNameOrNode);\n if (scope === windowPrefix) {\n addEventListener(win, eventName, processWindowEvent, true);\n } else {\n roots.forEach(\n (root) => addEventListener(root, eventName, (ev) => processDocumentEvent(ev, scope), true)\n );\n }\n }\n } else {\n if (!roots.has(eventNameOrNode)) {\n events.forEach((kebabEventName) => {\n const { scope, eventName } = processEventName(kebabEventName);\n addEventListener(\n eventNameOrNode,\n eventName,\n (ev) => processDocumentEvent(ev, scope),\n true\n );\n });\n roots.add(eventNameOrNode);\n }\n }\n }\n};\nif (!("__q_context__" in doc)) {\n doc.__q_context__ = 0;\n const qwikevents = win.qwikevents;\n if (qwikevents) {\n if (Array.isArray(qwikevents)) {\n processEventOrNode(...qwikevents);\n } else {\n processEventOrNode("click", "input");\n }\n }\n win.qwikevents = {\n events,\n roots,\n push: processEventOrNode\n };\n addEventListener(doc, "readystatechange", processReadyStateChange);\n processReadyStateChange();\n}';
1435
+ var QWIK_LOADER_DEFAULT_MINIFIED = 'const t=document,e=window,n=new Set,o=new Set([t]),r={},s="-window",i="-document";let a;const c=(t,e)=>Array.from(t.querySelectorAll(e)),l=t=>{const e=[];return o.forEach(n=>e.push(...c(n,t))),e},f=t=>{A(t),c(t,"[q\\\\:shadowroot]").forEach(t=>{const e=t.shadowRoot;e&&f(e)})},p=t=>t&&"function"==typeof t.then,u=(t,e,n=e.type)=>{l("[on"+t+"\\\\:"+n+"]").forEach(o=>{h(o,t,e,n)})},b=e=>{if(void 0===e._qwikjson_){let n=(e===t.documentElement?t.body:e).lastElementChild;for(;n;){if("SCRIPT"===n.tagName&&"qwik/json"===n.getAttribute("type")){e._qwikjson_=JSON.parse(n.textContent.replace(/\\\\x3C(\\/?script)/gi,"<$1"));break}n=n.previousElementSibling}}},q=(t,e)=>new CustomEvent(t,{detail:e}),h=async(e,n,o,s=o.type)=>{const i="on"+n+":"+s;e.hasAttribute("preventdefault:"+s)&&o.preventDefault(),e.hasAttribute("stoppropagation:"+s)&&o.stopPropagation();const a=e._qc_,c=a&&a.li.filter(t=>t[0]===i);if(c&&c.length>0){for(const t of c){const n=t[1].getFn([e,o],()=>e.isConnected)(o,e),r=o.cancelBubble;p(n)&&await n,r&&o.stopPropagation()}return}const l=e.qDispatchEvent;if(l)return l(o,n);const f=e.getAttribute(i);if(f){const n=e.closest("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"),s=n.getAttribute("q:base"),i=n.getAttribute("q:version")||"unknown",a=n.getAttribute("q:manifest-hash")||"dev",c=new URL(s,t.baseURI);for(const l of f.split("\\n")){const f=new URL(l,c),u=f.href,q=f.hash.replace(/^#?([^?[|]*).*$/,"$1")||"default",h=performance.now();let d,m,g;const y=l.startsWith("#"),v={qBase:s,qManifest:a,qVersion:i,href:u,symbol:q,element:e,reqTime:h};if(y){const e=n.getAttribute("q:instance");d=(t["qFuncs_"+e]||[])[Number.parseInt(q)],d||(m="sync",g=Error("sym:"+q))}else if(q in r)d=r[q];else{_("qsymbol",v);const t=f.href.split("#")[0];try{const e=import(t);b(n),d=(await e)[q],d?r[q]=d:(m="no-symbol",g=Error(`${q} not in ${t}`))}catch(t){m||(m="async"),g=t}}if(!d){_("qerror",{importError:m,error:g,...v}),console.error(g);break}const w=t.__q_context__;if(e.isConnected)try{t.__q_context__=[e,o,f];const n=d(o,e);p(n)&&await n}catch(t){_("qerror",{error:t,...v})}finally{t.__q_context__=w}}}},_=(e,n)=>{t.dispatchEvent(q(e,n))},d=t=>t.replace(/([A-Z-])/g,t=>"-"+t.toLowerCase()),m=async(t,e)=>{let n=d(t.type),o=t.target;if(e!==i)for(;o&&o.getAttribute;){const e=h(o,"",t,n);let r=t.cancelBubble;p(e)&&await e,r||(r=r||t.cancelBubble||o.hasAttribute("stoppropagation:"+t.type)),o=t.bubbles&&!0!==r?o.parentElement:null}else u(i,t,n)},g=t=>{u(s,t,d(t.type))},y=()=>{const r=t.readyState;if(!a&&("interactive"==r||"complete"==r)&&(o.forEach(f),a=1,_("qinit"),(e.requestIdleCallback??e.setTimeout).bind(e)(()=>_("qidle")),n.has(":qvisible"))){const t=l("[on\\\\:qvisible]"),e=new IntersectionObserver(t=>{for(const n of t)n.isIntersecting&&(e.unobserve(n.target),h(n.target,"",q("qvisible",n)))});t.forEach(t=>e.observe(t))}},v=(t,e,n,o=!1)=>{t.addEventListener(e,n,{capture:o,passive:!1})},w=t=>t.replace(/-./g,t=>t[1].toUpperCase()),E=t=>{const e=t.indexOf(":");let n="",o=t;if(e>=0){const r=t.substring(0,e);""!==r&&r!==s&&r!==i||(n=r,o=t.substring(e+1))}return{scope:n,eventName:w(o)}},A=(...t)=>{for(const r of t)if("string"==typeof r){if(!n.has(r)){n.add(r);const{scope:t,eventName:i}=E(r);t===s?v(e,i,g,!0):o.forEach(e=>v(e,i,e=>m(e,t),!0))}}else o.has(r)||(n.forEach(t=>{const{scope:e,eventName:n}=E(t);v(r,n,t=>m(t,e),!0)}),o.add(r))};if(!("__q_context__"in t)){t.__q_context__=0;const r=e.qwikevents;r&&(Array.isArray(r)?A(...r):A(":click",":input")),e.qwikevents={events:n,roots:o,push:A},v(t,"readystatechange",y),y()}';
1436
+ var QWIK_LOADER_DEFAULT_DEBUG = 'const doc = document;\nconst win = window;\nconst events = /* @__PURE__ */ new Set();\nconst roots = /* @__PURE__ */ new Set([doc]);\nconst symbols = {};\nconst windowPrefix = "-window";\nconst documentPrefix = "-document";\nlet hasInitialized;\nconst nativeQuerySelectorAll = (root, selector) => Array.from(root.querySelectorAll(selector));\nconst querySelectorAll = (query) => {\n const elements = [];\n roots.forEach((root) => elements.push(...nativeQuerySelectorAll(root, query)));\n return elements;\n};\nconst findShadowRoots = (fragment) => {\n processEventOrNode(fragment);\n nativeQuerySelectorAll(fragment, "[q\\\\:shadowroot]").forEach((parent) => {\n const shadowRoot = parent.shadowRoot;\n shadowRoot && findShadowRoots(shadowRoot);\n });\n};\nconst isPromise = (promise) => promise && typeof promise.then === "function";\nconst broadcast = (infix, ev, type = ev.type) => {\n querySelectorAll("[on" + infix + "\\\\:" + type + "]").forEach((el) => {\n dispatch(el, infix, ev, type);\n });\n};\nconst resolveContainer = (containerEl) => {\n if (containerEl._qwikjson_ === void 0) {\n const parentJSON = containerEl === doc.documentElement ? doc.body : containerEl;\n let script = parentJSON.lastElementChild;\n while (script) {\n if (script.tagName === "SCRIPT" && script.getAttribute("type") === "qwik/json") {\n containerEl._qwikjson_ = JSON.parse(\n script.textContent.replace(/\\\\x3C(\\/?script)/gi, "<$1")\n );\n break;\n }\n script = script.previousElementSibling;\n }\n }\n};\nconst createEvent = (eventName, detail) => new CustomEvent(eventName, {\n detail\n});\nconst dispatch = async (element, scope, ev, eventName = ev.type) => {\n const attrName = "on" + scope + ":" + eventName;\n if (element.hasAttribute("preventdefault:" + eventName)) {\n ev.preventDefault();\n }\n if (element.hasAttribute("stoppropagation:" + eventName)) {\n ev.stopPropagation();\n }\n const ctx = element._qc_;\n const relevantListeners = ctx && ctx.li.filter((li) => li[0] === attrName);\n if (relevantListeners && relevantListeners.length > 0) {\n for (const listener of relevantListeners) {\n const results = listener[1].getFn([element, ev], () => element.isConnected)(ev, element);\n const cancelBubble = ev.cancelBubble;\n if (isPromise(results)) {\n await results;\n }\n if (cancelBubble) {\n ev.stopPropagation();\n }\n }\n return;\n }\n const qDispatchEvent = element.qDispatchEvent;\n if (qDispatchEvent) {\n return qDispatchEvent(ev, scope);\n }\n const attrValue = element.getAttribute(attrName);\n if (attrValue) {\n const container = element.closest(\n "[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"\n );\n const qBase = container.getAttribute("q:base");\n const qVersion = container.getAttribute("q:version") || "unknown";\n const qManifest = container.getAttribute("q:manifest-hash") || "dev";\n const base = new URL(qBase, doc.baseURI);\n for (const qrl of attrValue.split("\\n")) {\n const url = new URL(qrl, base);\n const href = url.href;\n const symbol = url.hash.replace(/^#?([^?[|]*).*$/, "$1") || "default";\n const reqTime = performance.now();\n let handler;\n let importError;\n let error;\n const isSync = qrl.startsWith("#");\n const eventData = {\n qBase,\n qManifest,\n qVersion,\n href,\n symbol,\n element,\n reqTime\n };\n if (isSync) {\n const hash = container.getAttribute("q:instance");\n handler = (doc["qFuncs_" + hash] || [])[Number.parseInt(symbol)];\n if (!handler) {\n importError = "sync";\n error = new Error("sym:" + symbol);\n }\n } else if (symbol in symbols) {\n handler = symbols[symbol];\n } else {\n emitEvent("qsymbol", eventData);\n const uri = url.href.split("#")[0];\n try {\n const module = import(\n uri\n );\n resolveContainer(container);\n handler = (await module)[symbol];\n if (!handler) {\n importError = "no-symbol";\n error = new Error(`${symbol} not in ${uri}`);\n } else {\n symbols[symbol] = handler;\n }\n } catch (err) {\n importError || (importError = "async");\n error = err;\n }\n }\n if (!handler) {\n emitEvent("qerror", {\n importError,\n error,\n ...eventData\n });\n console.error(error);\n break;\n }\n const previousCtx = doc.__q_context__;\n if (element.isConnected) {\n try {\n doc.__q_context__ = [element, ev, url];\n const results = handler(ev, element);\n if (isPromise(results)) {\n await results;\n }\n } catch (error2) {\n emitEvent("qerror", { error: error2, ...eventData });\n } finally {\n doc.__q_context__ = previousCtx;\n }\n }\n }\n }\n};\nconst emitEvent = (eventName, detail) => {\n doc.dispatchEvent(createEvent(eventName, detail));\n};\nconst camelToKebab = (str) => str.replace(/([A-Z-])/g, (a) => "-" + a.toLowerCase());\nconst processDocumentEvent = async (ev, scope) => {\n let type = camelToKebab(ev.type);\n let element = ev.target;\n if (scope === documentPrefix) {\n broadcast(documentPrefix, ev, type);\n return;\n }\n while (element && element.getAttribute) {\n const results = dispatch(element, "", ev, type);\n let cancelBubble = ev.cancelBubble;\n if (isPromise(results)) {\n await results;\n }\n cancelBubble || (cancelBubble = cancelBubble || ev.cancelBubble || element.hasAttribute("stoppropagation:" + ev.type));\n element = ev.bubbles && cancelBubble !== true ? element.parentElement : null;\n }\n};\nconst processWindowEvent = (ev) => {\n broadcast(windowPrefix, ev, camelToKebab(ev.type));\n};\nconst processReadyStateChange = () => {\n const readyState = doc.readyState;\n if (!hasInitialized && (readyState == "interactive" || readyState == "complete")) {\n roots.forEach(findShadowRoots);\n hasInitialized = 1;\n emitEvent("qinit");\n const riC = win.requestIdleCallback ?? win.setTimeout;\n riC.bind(win)(() => emitEvent("qidle"));\n if (events.has(":qvisible")) {\n const results = querySelectorAll("[on\\\\:qvisible]");\n const observer = new IntersectionObserver((entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n observer.unobserve(entry.target);\n dispatch(entry.target, "", createEvent("qvisible", entry));\n }\n }\n });\n results.forEach((el) => observer.observe(el));\n }\n }\n};\nconst addEventListener = (el, eventName, handler, capture = false) => {\n el.addEventListener(eventName, handler, { capture, passive: false });\n};\nconst kebabToCamel = (eventName) => eventName.replace(/-./g, (a) => a[1].toUpperCase());\nconst processEventName = (event) => {\n const i = event.indexOf(":");\n let scope = "";\n let eventName = event;\n if (i >= 0) {\n const s = event.substring(0, i);\n if (s === "" || s === windowPrefix || s === documentPrefix) {\n scope = s;\n eventName = event.substring(i + 1);\n }\n }\n return { scope, eventName: kebabToCamel(eventName) };\n};\nconst processEventOrNode = (...eventNames) => {\n for (const eventNameOrNode of eventNames) {\n if (typeof eventNameOrNode === "string") {\n if (!events.has(eventNameOrNode)) {\n events.add(eventNameOrNode);\n const { scope, eventName } = processEventName(eventNameOrNode);\n if (scope === windowPrefix) {\n addEventListener(win, eventName, processWindowEvent, true);\n } else {\n roots.forEach(\n (root) => addEventListener(root, eventName, (ev) => processDocumentEvent(ev, scope), true)\n );\n }\n }\n } else {\n if (!roots.has(eventNameOrNode)) {\n events.forEach((kebabEventName) => {\n const { scope, eventName } = processEventName(kebabEventName);\n addEventListener(\n eventNameOrNode,\n eventName,\n (ev) => processDocumentEvent(ev, scope),\n true\n );\n });\n roots.add(eventNameOrNode);\n }\n }\n }\n};\nif (!("__q_context__" in doc)) {\n doc.__q_context__ = 0;\n const qwikevents = win.qwikevents;\n if (qwikevents) {\n if (Array.isArray(qwikevents)) {\n processEventOrNode(...qwikevents);\n } else {\n processEventOrNode(":click", ":input");\n }\n }\n win.qwikevents = {\n events,\n roots,\n push: processEventOrNode\n };\n addEventListener(doc, "readystatechange", processReadyStateChange);\n processReadyStateChange();\n}';
1434
1437
  var QWIK_BACKPATCH_EXECUTOR_MINIFIED = `const t='script[type="qwik/backpatch"]',e=document.currentScript;if(e){const o=e.closest("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])");if(o){const e=o.querySelector(t);if(e){const t=JSON.parse(e.textContent||"[]"),n=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);let r=n.currentNode,c=r.hasAttribute(":")?0:-1;for(let e=0;e<t.length;e+=3){const o=t[e],i=t[e+1];let s=t[e+2];for(;c<o&&(r=n.nextNode(),r);)r.hasAttribute(":")&&c++;const l=r;null==s||!1===s?l.removeAttribute(i):("boolean"==typeof s&&(s=""),l.setAttribute(i,s))}}}}`;
1435
1438
  var QWIK_BACKPATCH_EXECUTOR_DEBUG = `const BACKPATCH_DATA_SELECTOR = 'script[type="qwik/backpatch"]';
1436
1439
  const executorScript = document.currentScript;
@@ -1485,7 +1488,7 @@ function getQwikBackpatchExecutorScript(opts = {}) {
1485
1488
 
1486
1489
  // packages/qwik/src/server/ssr-node.ts
1487
1490
  import { _isJSXNode as isJSXNode, _EMPTY_ARRAY, _EFFECT_BACK_REF } from "@qwik.dev/core/internal";
1488
- import { isDev as isDev4 } from "@qwik.dev/core/build";
1491
+ import { isDev as isDev5 } from "@qwik.dev/core/build";
1489
1492
  var SsrNode = class {
1490
1493
  constructor(parentComponent, id, attributesIndex, cleanupQueue, vnodeData, currentFile) {
1491
1494
  this.parentComponent = parentComponent;
@@ -1510,7 +1513,7 @@ var SsrNode = class {
1510
1513
  this.flags = 1 /* Updatable */;
1511
1514
  this.attrs = this.attributesIndex >= 0 ? this.vnodeData[this.attributesIndex] : _EMPTY_ARRAY;
1512
1515
  this.parentComponent?.addChild(this);
1513
- if (isDev4 && id.indexOf("undefined") != -1) {
1516
+ if (isDev5 && id.indexOf("undefined") != -1) {
1514
1517
  throw new Error(`Invalid SSR node id: ${id}`);
1515
1518
  }
1516
1519
  }
@@ -1574,7 +1577,7 @@ var SsrNode = class {
1574
1577
  }
1575
1578
  }
1576
1579
  toString() {
1577
- if (isDev4) {
1580
+ if (isDev5) {
1578
1581
  let stringifiedAttrs = "";
1579
1582
  for (let i = 0; i < this.attrs.length; i += 2) {
1580
1583
  const key = this.attrs[i];
@@ -1658,13 +1661,6 @@ var SsrComponentFrame = class {
1658
1661
  projectionNode.setProp(QSlotParent, this.componentNode.id);
1659
1662
  return children;
1660
1663
  }
1661
- releaseUnclaimedProjections(unclaimedProjections) {
1662
- if (this.slots.length) {
1663
- unclaimedProjections.push(this);
1664
- unclaimedProjections.push(this.projectionScopedStyle);
1665
- unclaimedProjections.push.apply(unclaimedProjections, this.slots);
1666
- }
1667
- }
1668
1664
  };
1669
1665
 
1670
1666
  // packages/qwik/src/server/tag-nesting.ts
@@ -2154,8 +2150,6 @@ var SSRContainer = class extends _SharedContainer {
2154
2150
  __publicField(this, "depthFirstElementCount", -1);
2155
2151
  __publicField(this, "vNodeDatas", []);
2156
2152
  __publicField(this, "componentStack", []);
2157
- __publicField(this, "unclaimedProjections", []);
2158
- __publicField(this, "unclaimedProjectionComponentFrameQueue", []);
2159
2153
  __publicField(this, "cleanupQueue", []);
2160
2154
  __publicField(this, "$instanceHash$", hash());
2161
2155
  // Temporary flag to find missing roots after the state was serialized
@@ -2261,7 +2255,7 @@ var SSRContainer = class extends _SharedContainer {
2261
2255
  containerAttributes[QContainerAttr] = "paused" /* PAUSED */;
2262
2256
  containerAttributes[QRuntimeAttr] = "2";
2263
2257
  containerAttributes[QVersionAttr] = this.$version$ ?? "dev";
2264
- containerAttributes[QRenderAttr] = (qRender ? qRender + "-" : "") + (isDev5 ? "ssr-dev" : "ssr");
2258
+ containerAttributes[QRenderAttr] = (qRender ? qRender + "-" : "") + (isDev6 ? "ssr-dev" : "ssr");
2265
2259
  containerAttributes[QBaseAttr] = this.$buildBase$ || "";
2266
2260
  containerAttributes[QLocaleAttr] = this.$locale$;
2267
2261
  containerAttributes[QManifestHashAttr] = this.resolvedManifest.manifest.manifestHash;
@@ -2310,7 +2304,7 @@ var SSRContainer = class extends _SharedContainer {
2310
2304
  this.write(" " + Q_PROPS_SEPARATOR);
2311
2305
  if (key !== null) {
2312
2306
  this.write(`="${key}"`);
2313
- } else if (isDev5) {
2307
+ } else if (isDev6) {
2314
2308
  this.write('=""');
2315
2309
  }
2316
2310
  if (constAttrs && constAttrs.length) {
@@ -2429,13 +2423,38 @@ var SSRContainer = class extends _SharedContainer {
2429
2423
  const localProjectionDepth = this.getComponentFrame()?.projectionDepth || 0;
2430
2424
  return this.getComponentFrame(localProjectionDepth);
2431
2425
  }
2432
- /** Writes closing data to vNodeData for component boundaries and mark unclaimed projections */
2433
- closeComponent() {
2426
+ /** Writes closing data to vNodeData for component boundaries and emit unclaimed projections inline */
2427
+ async closeComponent() {
2434
2428
  const componentFrame = this.componentStack.pop();
2435
- componentFrame.releaseUnclaimedProjections(this.unclaimedProjections);
2429
+ await this.emitUnclaimedProjectionForComponent(componentFrame);
2436
2430
  this.closeFragment();
2437
2431
  this.currentComponentNode = this.currentComponentNode?.parentComponent || null;
2438
2432
  }
2433
+ async emitUnclaimedProjectionForComponent(componentFrame) {
2434
+ if (componentFrame.slots.length === 0) {
2435
+ return;
2436
+ }
2437
+ this.openElement(QTemplate, null, ["hidden", true, "aria-hidden", "true"], null);
2438
+ const scopedStyleId = componentFrame.projectionScopedStyle;
2439
+ for (let i = 0; i < componentFrame.slots.length; i += 2) {
2440
+ const slotName = componentFrame.slots[i];
2441
+ const children = componentFrame.slots[i + 1];
2442
+ this.openFragment(
2443
+ isDev6 ? [DEBUG_TYPE, "P" /* Projection */, QSlotParent, componentFrame.componentNode.id] : [QSlotParent, componentFrame.componentNode.id]
2444
+ );
2445
+ const lastNode = this.getOrCreateLastNode();
2446
+ if (lastNode.vnodeData) {
2447
+ lastNode.vnodeData[0] |= 16 /* SERIALIZE */;
2448
+ }
2449
+ componentFrame.componentNode.setProp(slotName, lastNode.id);
2450
+ await _walkJSX(this, children, {
2451
+ currentStyleScoped: scopedStyleId,
2452
+ parentComponentFrame: componentFrame.projectionComponentFrame
2453
+ });
2454
+ this.closeFragment();
2455
+ }
2456
+ this.closeElement();
2457
+ }
2439
2458
  /** Write a text node with correct escaping. Save the length of the text node in the vNodeData. */
2440
2459
  textNode(text) {
2441
2460
  this.write(escapeHTML(text));
@@ -2467,14 +2486,8 @@ var SSRContainer = class extends _SharedContainer {
2467
2486
  }
2468
2487
  return this.lastNode;
2469
2488
  }
2470
- executeChores() {
2471
- if (!this.lastNode) {
2472
- return;
2473
- }
2474
- return _executeSsrChores(this, this.lastNode);
2475
- }
2476
2489
  addUnclaimedProjection(frame, name, children) {
2477
- this.unclaimedProjections.push(frame, null, name, children);
2490
+ frame.slots.push(name, children);
2478
2491
  }
2479
2492
  $processInjectionsFromManifest$() {
2480
2493
  const injections = this.resolvedManifest.manifest.injections;
@@ -2525,18 +2538,15 @@ var SSRContainer = class extends _SharedContainer {
2525
2538
  emitContainerData() {
2526
2539
  return maybeThen(
2527
2540
  this.resolvePromiseAttributes(),
2528
- () => maybeThen(
2529
- this.emitUnclaimedProjection(),
2530
- () => maybeThen(this.emitStateData(), () => {
2531
- this.$noMoreRoots$ = true;
2532
- this.emitVNodeData();
2533
- preloaderPost(this, this.renderOptions, this.$serverData$?.nonce);
2534
- this.emitSyncFnsData();
2535
- this.emitPatchDataIfNeeded();
2536
- this.emitExecutorIfNeeded();
2537
- this.emitQwikLoaderAtBottomIfNeeded();
2538
- })
2539
- )
2541
+ () => maybeThen(this.emitStateData(), () => {
2542
+ this.$noMoreRoots$ = true;
2543
+ this.emitVNodeData();
2544
+ preloaderPost(this, this.renderOptions, this.$serverData$?.nonce);
2545
+ this.emitSyncFnsData();
2546
+ this.emitPatchDataIfNeeded();
2547
+ this.emitExecutorIfNeeded();
2548
+ this.emitQwikLoaderAtBottomIfNeeded();
2549
+ })
2540
2550
  );
2541
2551
  }
2542
2552
  /**
@@ -2736,7 +2746,7 @@ var SSRContainer = class extends _SharedContainer {
2736
2746
  scriptAttrs.push("nonce", this.renderOptions.serverData.nonce);
2737
2747
  }
2738
2748
  this.openElement("script", null, scriptAttrs);
2739
- const backpatchScript = getQwikBackpatchExecutorScript({ debug: isDev5 });
2749
+ const backpatchScript = getQwikBackpatchExecutorScript({ debug: isDev6 });
2740
2750
  this.write(backpatchScript);
2741
2751
  this.closeElement();
2742
2752
  }
@@ -2798,57 +2808,6 @@ var SSRContainer = class extends _SharedContainer {
2798
2808
  this.closeElement();
2799
2809
  }
2800
2810
  }
2801
- async emitUnclaimedProjection() {
2802
- const unclaimedProjections = this.unclaimedProjections;
2803
- if (unclaimedProjections.length) {
2804
- const previousCurrentComponentNode = this.currentComponentNode;
2805
- try {
2806
- this.openElement(QTemplate, null, ["hidden", true, "aria-hidden", "true"], null);
2807
- let idx = 0;
2808
- let ssrComponentNode = null;
2809
- let ssrComponentFrame = null;
2810
- let scopedStyleId = null;
2811
- for (let i = 0; i < unclaimedProjections.length; i += 4) {
2812
- this.unclaimedProjectionComponentFrameQueue.push(
2813
- unclaimedProjections[i]
2814
- );
2815
- }
2816
- while (idx < unclaimedProjections.length) {
2817
- const value = unclaimedProjections[idx++];
2818
- if (value instanceof SsrComponentFrame) {
2819
- ssrComponentNode = this.currentComponentNode = value.componentNode;
2820
- ssrComponentFrame = value;
2821
- scopedStyleId = unclaimedProjections[idx++];
2822
- } else if (typeof value === "string") {
2823
- const children = unclaimedProjections[idx++];
2824
- if (!ssrComponentFrame?.hasSlot(value)) {
2825
- ssrComponentFrame && ssrComponentFrame.componentNode.removeProp(value);
2826
- continue;
2827
- }
2828
- this.unclaimedProjectionComponentFrameQueue.shift();
2829
- this.openFragment(
2830
- isDev5 ? [DEBUG_TYPE, "P" /* Projection */, QSlotParent, ssrComponentNode.id] : [QSlotParent, ssrComponentNode.id]
2831
- );
2832
- const lastNode = this.getOrCreateLastNode();
2833
- if (lastNode.vnodeData) {
2834
- lastNode.vnodeData[0] |= 16 /* SERIALIZE */;
2835
- }
2836
- ssrComponentNode?.setProp(value, lastNode.id);
2837
- await _walkJSX(this, children, {
2838
- currentStyleScoped: scopedStyleId,
2839
- parentComponentFrame: null
2840
- });
2841
- this.closeFragment();
2842
- } else {
2843
- throw Error();
2844
- }
2845
- }
2846
- this.closeElement();
2847
- } finally {
2848
- this.currentComponentNode = previousCurrentComponentNode;
2849
- }
2850
- }
2851
- }
2852
2811
  // Keep in sync with process-vnode-data.unit.ts
2853
2812
  emitVNodeSeparators(lastSerializedIdx, elementIdx) {
2854
2813
  let skipCount = elementIdx - lastSerializedIdx;
@@ -2877,7 +2836,7 @@ var SSRContainer = class extends _SharedContainer {
2877
2836
  }
2878
2837
  createAndPushFrame(elementName, depthFirstElementIdx, currentFile) {
2879
2838
  let tagNesting = 10 /* ANYTHING */;
2880
- if (isDev5) {
2839
+ if (isDev6) {
2881
2840
  if (!this.currentElementFrame) {
2882
2841
  tagNesting = initialTag(elementName);
2883
2842
  } else {
@@ -2923,7 +2882,7 @@ var SSRContainer = class extends _SharedContainer {
2923
2882
  elementName,
2924
2883
  depthFirstElementIdx,
2925
2884
  vNodeData: [0 /* NONE */],
2926
- currentFile: isDev5 ? currentFile || null : null
2885
+ currentFile: isDev6 ? currentFile || null : null
2927
2886
  };
2928
2887
  this.currentElementFrame = frame;
2929
2888
  this.vNodeDatas.push(frame.vNodeData);
@@ -2955,7 +2914,7 @@ var SSRContainer = class extends _SharedContainer {
2955
2914
  let value = attrs[i];
2956
2915
  let styleScopedId = null;
2957
2916
  if (isSSRUnsafeAttr(key)) {
2958
- if (isDev5) {
2917
+ if (isDev6) {
2959
2918
  throw qError(32 /* unsafeAttr */, [key]);
2960
2919
  }
2961
2920
  continue;
@@ -3010,7 +2969,7 @@ var SSRContainer = class extends _SharedContainer {
3010
2969
  }
3011
2970
  if (tag === "textarea" && key === "value") {
3012
2971
  if (value && typeof value !== "string") {
3013
- if (isDev5) {
2972
+ if (isDev6) {
3014
2973
  throw qError(23 /* wrongTextareaValue */, [currentFile, value]);
3015
2974
  }
3016
2975
  continue;
@@ -0,0 +1,52 @@
1
+ ## Cloudflare Workers
2
+
3
+ Cloudflare's [wrangler](https://github.com/cloudflare/wrangler) CLI can be used to preview a production build locally. To start a local server, run:
4
+
5
+ ```
6
+ npm run serve
7
+ ```
8
+
9
+ Then visit [http://localhost:8787/](http://localhost:8787/)
10
+
11
+ ### Deployments
12
+
13
+ [Cloudflare Workers](https://workers.cloudflare.com/) can be deployed using the [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/).
14
+
15
+ If you don't already have an account, then [create a Cloudflare account here](https://dash.cloudflare.com/sign-up/workers-and-pages).
16
+
17
+ Once authenticated, you can deploy your Worker:
18
+
19
+ ```
20
+ npm run deploy
21
+ ```
22
+
23
+ ### Configuration
24
+
25
+ The `wrangler.jsonc` file contains your Worker configuration. Key settings include:
26
+
27
+ - **name**: Your Worker's name
28
+ - **main**: Path to your Worker script (default: `./dist/_worker.js`)
29
+ - **compatibility_date**: The date used for compatibility with the Workers runtime
30
+ - **assets**: Configuration for serving static assets
31
+ - **bindings**: Resources your Worker can interact with (KV, R2, D1, etc.)
32
+
33
+ After adding any binding, use this command to regenerate the worker-configuration.d.ts file
34
+
35
+ ```
36
+ npm run cf-typegen
37
+ ```
38
+
39
+ For more details, see the [Wrangler configuration documentation](https://developers.cloudflare.com/workers/wrangler/configuration/).
40
+
41
+ ### Bindings
42
+
43
+ Cloudflare Workers can interact with various Cloudflare resources through bindings:
44
+
45
+ - **KV**: Key-value storage
46
+ - **R2**: Object storage
47
+ - **D1**: SQL database
48
+ - **Durable Objects**: Strongly consistent storage
49
+ - **Queues**: Message queues
50
+ - **AI**: AI inference
51
+
52
+ Configure bindings in your `wrangler.jsonc` file. See the [bindings documentation](https://developers.cloudflare.com/workers/runtime-apis/bindings/) for more information.
@@ -0,0 +1,15 @@
1
+ import { cloudflarePagesAdapter as cloudflareWorkersAdapter } from "@builder.io/qwik-city/adapters/cloudflare-pages/vite";
2
+ import { extendConfig } from "@builder.io/qwik-city/vite";
3
+ import baseConfig from "../../vite.config";
4
+
5
+ export default extendConfig(baseConfig, () => {
6
+ return {
7
+ build: {
8
+ ssr: true,
9
+ rollupOptions: {
10
+ input: ["src/entry.cloudflare-pages.tsx", "@qwik-city-plan"],
11
+ },
12
+ },
13
+ plugins: [cloudflareWorkersAdapter()],
14
+ };
15
+ });
@@ -0,0 +1,3 @@
1
+ # Cloudflare
2
+ functions/**/*.js
3
+ .wrangler/
@@ -0,0 +1,31 @@
1
+ {
2
+ "description": "Cloudflare Workers",
3
+ "scripts": {
4
+ "build.server": "qwik check-client src dist && vite build -c adapters/cloudflare-workers/vite.config.ts",
5
+ "deploy": "wrangler deploy",
6
+ "serve": "wrangler dev",
7
+ "cf-typegen": "wrangler types"
8
+ },
9
+ "devDependencies": {
10
+ "@cloudflare/workers-types": "^4.20251228.0",
11
+ "wrangler": "^3.0.0"
12
+ },
13
+ "__qwik__": {
14
+ "priority": 40,
15
+ "displayName": "Adapter: Cloudflare Workers",
16
+ "docs": [
17
+ "https://qwik.dev/deployments/cloudflare-workers/",
18
+ "https://developers.cloudflare.com/workers"
19
+ ],
20
+ "nextSteps": {
21
+ "title": "Next Steps",
22
+ "lines": [
23
+ "Make sure to follow the instructions in the [Cloudflare Workers documentation](https://qwik.dev/deployments/cloudflare-workers/) to setup your Qwik app.",
24
+ "Now you can build and deploy to Cloudflare Workers with:",
25
+ "",
26
+ "- pnpm run build: production build for Cloudflare",
27
+ "- pnpm run deploy: it will use the Cloudflare CLI to deploy your site"
28
+ ]
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,4 @@
1
+ _worker.js
2
+ _routes.json
3
+ _headers
4
+ _redirects
@@ -0,0 +1,11 @@
1
+ # https://developers.cloudflare.com/pages/platform/headers/
2
+
3
+ /*service-worker.js
4
+ Cache-Control: no-store
5
+ Content-Type: application/javascript
6
+ X-Content-Type-Options: nosniff
7
+
8
+ /build/*
9
+ Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable
10
+ /assets/*
11
+ Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable
@@ -0,0 +1 @@
1
+ # https://developers.cloudflare.com/pages/platform/redirects/
@@ -0,0 +1,23 @@
1
+ /*
2
+ * WHAT IS THIS FILE?
3
+ *
4
+ * It's the entry point for Cloudflare Workers when building for production.
5
+ *
6
+ * Learn more about the Cloudflare Workers integration here:
7
+ * - https://qwik.dev/docs/deployments/cloudflare-workers/
8
+ *
9
+ */
10
+ import {
11
+ createQwikCity,
12
+ type PlatformCloudflarePages as PlatformCloudflareWorkers,
13
+ } from "@builder.io/qwik-city/middleware/cloudflare-pages";
14
+ import qwikCityPlan from "@qwik-city-plan";
15
+ import render from "./entry.ssr";
16
+
17
+ declare global {
18
+ type QwikCityPlatform = PlatformCloudflareWorkers;
19
+ }
20
+
21
+ const fetch = createQwikCity({ render, qwikCityPlan });
22
+
23
+ export { fetch };
@@ -0,0 +1,5 @@
1
+ // Generated by Wrangler
2
+ // After adding bindings to `wrangler.jsonc`, regenerate this interface via `npm run cf-typegen`
3
+ interface Env {
4
+ ASSET: Fetcher;
5
+ }