|
4 | 4 | <meta charset="utf-8" /> |
5 | 5 | <meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
6 | 6 | <meta name="viewport" content="width=device-width,initial-scale=1.0" /> |
7 | | - <title>headless Components App</title> |
| 7 | + <title>Headless Components App</title> |
8 | 8 | </head> |
9 | 9 | <body> |
10 | 10 | <div data-cy-root></div> |
11 | | - <script type="text/javascript"> |
12 | | - ((e, t) => { |
13 | | - const n = '__q_context__', |
14 | | - o = window, |
15 | | - i = new Set(), |
16 | | - s = (t) => e.querySelectorAll(t), |
17 | | - r = (e, t, n = t.type) => { |
18 | | - s('[on' + e + '\\:' + n + ']').forEach((o) => f(o, e, t, n)); |
19 | | - }, |
20 | | - a = (e, t) => e.getAttribute(t), |
21 | | - l = (t) => { |
22 | | - if (void 0 === t._qwikjson_) { |
23 | | - let n = (t === e.documentElement ? e.body : t).lastElementChild; |
24 | | - for (; n; ) { |
25 | | - if ('SCRIPT' === n.tagName && 'qwik/json' === a(n, 'type')) { |
26 | | - t._qwikjson_ = JSON.parse( |
27 | | - n.textContent.replace(/\\x3C(\/?script)/g, '<$1') |
28 | | - ); |
29 | | - break; |
30 | | - } |
31 | | - n = n.previousElementSibling; |
32 | | - } |
33 | | - } |
34 | | - }, |
35 | | - c = (e, t) => new CustomEvent(e, { detail: t }), |
36 | | - f = async (t, o, i, s = i.type) => { |
37 | | - const r = 'on' + o + ':' + s; |
38 | | - t.hasAttribute('preventdefault:' + s) && i.preventDefault(); |
39 | | - const c = t._qc_, |
40 | | - f = null == c ? void 0 : c.li.filter((e) => e[0] === r); |
41 | | - if (f && f.length > 0) { |
42 | | - for (const e of f) |
43 | | - await e[1].getFn([t, i], () => t.isConnected)(i, t); |
44 | | - return; |
45 | | - } |
46 | | - const d = a(t, r); |
47 | | - if (d) { |
48 | | - const o = t.closest('[q\\:container]'), |
49 | | - s = new URL(a(o, 'q:base'), e.baseURI); |
50 | | - for (const r of d.split('\n')) { |
51 | | - const a = new URL(r, s), |
52 | | - c = a.hash.replace(/^#?([^?[|]*).*$/, '$1') || 'default', |
53 | | - f = performance.now(), |
54 | | - d = import(a.href.split('#')[0]); |
55 | | - l(o); |
56 | | - const p = b(await d, c), |
57 | | - w = e[n]; |
58 | | - if (t.isConnected) |
59 | | - try { |
60 | | - (e[n] = [t, i, a]), |
61 | | - u('qsymbol', { symbol: c, element: t, reqTime: f }), |
62 | | - await p(i, t); |
63 | | - } finally { |
64 | | - e[n] = w; |
65 | | - } |
66 | | - } |
67 | | - } |
68 | | - }, |
69 | | - u = (t, n) => { |
70 | | - e.dispatchEvent(c(t, n)); |
71 | | - }, |
72 | | - b = (e, t) => { |
73 | | - if (t in e) return e[t]; |
74 | | - for (const n of Object.values(e)) |
75 | | - if ('object' == typeof n && n && t in n) return n[t]; |
76 | | - }, |
77 | | - d = (e) => e.replace(/([A-Z])/g, (e) => '-' + e.toLowerCase()), |
78 | | - p = async (e) => { |
79 | | - let t = d(e.type), |
80 | | - n = e.target; |
81 | | - for (r('-document', e, t); n && n.getAttribute; ) |
82 | | - await f(n, '', e, t), |
83 | | - (n = |
84 | | - e.bubbles && !0 !== e.cancelBubble ? n.parentElement : null); |
85 | | - }, |
86 | | - w = (e) => { |
87 | | - r('-window', e, d(e.type)); |
88 | | - }, |
89 | | - q = () => { |
90 | | - var n; |
91 | | - const r = e.readyState; |
92 | | - if ( |
93 | | - !t && |
94 | | - ('interactive' == r || 'complete' == r) && |
95 | | - ((t = 1), |
96 | | - u('qinit'), |
97 | | - (null != (n = o.requestIdleCallback) ? n : o.setTimeout).bind(o)( |
98 | | - () => u('qidle') |
99 | | - ), |
100 | | - i.has('qvisible')) |
101 | | - ) { |
102 | | - const e = s('[on\\:qvisible]'), |
103 | | - t = new IntersectionObserver((e) => { |
104 | | - for (const n of e) |
105 | | - n.isIntersecting && |
106 | | - (t.unobserve(n.target), |
107 | | - f(n.target, '', c('qvisible', n))); |
108 | | - }); |
109 | | - e.forEach((e) => t.observe(e)); |
110 | | - } |
111 | | - }, |
112 | | - v = (e, t, n, o = !1) => e.addEventListener(t, n, { capture: o }), |
113 | | - y = (t) => { |
114 | | - for (const n of t) |
115 | | - i.has(n) || (v(e, n, p, !0), v(o, n, w), i.add(n)); |
116 | | - }; |
117 | | - if (!e.qR) { |
118 | | - const t = o.qwikevents; |
119 | | - Array.isArray(t) && y(t), |
120 | | - (o.qwikevents = { push: (...e) => y(e) }), |
121 | | - v(e, 'readystatechange', q), |
122 | | - q(); |
123 | | - } |
124 | | - })(document); |
125 | | - </script> |
126 | 11 | </body> |
127 | 12 | </html> |
0 commit comments