@africode/core 5.0.1 → 5.0.2
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.
- package/COMPONENT_SCHEMA.json +103 -69
- package/components/base.d.ts +1 -1
- package/components/base.js +71 -21
- package/core/a2ui-schema-manager.js +9 -2
- package/core/a2ui.js +131 -43
- package/core/actions.js +27 -0
- package/core/bun-runtime.js +207 -724
- package/core/compliance.js +6 -5
- package/core/config.js +7 -5
- package/core/enhanced-hmr.js +16 -14
- package/core/file-router.js +42 -282
- package/core/hmr.js +8 -7
- package/core/html.d.ts +15 -101
- package/core/html.js +53 -129
- package/core/lipa-namba-journey.js +74 -12
- package/core/logging.js +14 -0
- package/core/middleware.js +82 -0
- package/core/nida-cig-middleware.js +13 -8
- package/core/plugins/index.js +345 -312
- package/core/request-identity.js +44 -0
- package/core/sdk.js +22 -0
- package/core/session-store.js +68 -0
- package/core/state.js +34 -0
- package/core/websocket.js +22 -20
- package/dist/africode.js +108 -112
- package/dist/africode.js.map +6 -6
- package/dist/build-info.json +3 -3
- package/dist/components.js +351 -351
- package/dist/components.js.map +6 -6
- package/package.json +3 -3
- package/scripts/generate-component-schema.js +1 -1
package/dist/africode.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null,n)}var Q=(t,n)=>{for(var o in n)Wo(t,o,{get:n[o],enumerable:!0,configurable:!0,set:Vo.bind(n,o)})};var x=(t,n)=>()=>(t&&(n=t(t=0)),n);function at(t){if(Dt.has(t))return Dt.get(t);let o=new Proxy(t,{get(b,l,a){let f=Reflect.get(b,l,a);if(f!==null&&typeof f==="object")return at(f);return f},set(b,l,a,f){let h=Reflect.get(b,l,f);if(h!==a){let r=Reflect.set(b,l,a,f);if(r)An(f,a,h,l);return r}return!0},deleteProperty(b,l){let a=Reflect.get(b,l),f=Reflect.deleteProperty(b,l);if(f){let h=Dt.get(b);An(h,void 0,a,l)}return f}});return Dt.set(t,o),o}function T(t,n){if(!Ot.has(t))Ot.set(t,new Set);let o=Ot.get(t);return o.add(n),()=>{o.delete(n)}}function An(t,n,o,b){let l=Ot.get(t);if(!l)return;l.forEach((a)=>{try{a(n,o,b)}catch(f){console.error("[AfriCode State] Subscriber error:",f)}})}class t0{constructor(){this.store={}}get(t){return t.split("/").reduce((n,o)=>n?.[o],this.store)}set(t,n){let o=t.split("/"),b=this.store;while(o.length>1){let l=o.shift();if(!b[l]||typeof b[l]!=="object")b[l]={};b=b[l]}b[o[0]]=n}getAll(){return this.store}}function qn(t){let n=t,o=new Set,b=()=>{return n},l=(a)=>{if(n!==a)n=typeof a==="function"?a(n):a,o.forEach((f)=>f()),An()};return b.subscribe=(a)=>{return o.add(a),()=>o.delete(a)},[b,l]}function Hn(t){return t(),T(t)}var Ot,Dt,Kl;var z=x(()=>{Ot=new WeakMap,Dt=new WeakMap;Kl=new t0});var jo,D,n0;var Xt=x(()=>{z();jo={theme:"light",language:"en",ui:{sidebarCollapsed:!1,theme:"dark",activePage:"home"},user:{name:"Guest",permissions:[]},config:{animationsEnabled:!0,soundEnabled:!1}},D=at(jo),n0={setTheme(t){if(["dark","light","system"].includes(t))D.theme=t,D.ui.theme=t},setLanguage(t){D.language=t},toggleSidebar(t){if(typeof t==="boolean")D.ui.sidebarCollapsed=t;else D.ui.sidebarCollapsed=!D.ui.sidebarCollapsed},setActivePage(t){D.ui.activePage=t}}});function No(t,n,o=50,b=50){let l=[];for(let a=0;a<t;a++){let f=2*Math.PI*a/t-Math.PI/2,h=o+n*Math.cos(f),r=b+n*Math.sin(f);l.push(`${h.toFixed(2)},${r.toFixed(2)}`)}return l.join(" ")}function En({primaryColor:t="#FF0000",secondaryColor:n="#000000",backgroundColor:o="#8B0000",stripeWidth:b=4,size:l=40}={}){let a=`
|
|
2
2
|
<svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${l}" viewBox="0 0 ${l} ${l}">
|
|
3
3
|
<rect width="${l}" height="${l}" fill="${o}"/>
|
|
4
4
|
<rect x="0" y="0" width="${l}" height="${b}" fill="${t}" opacity="0.8"/>
|
|
@@ -23,7 +23,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
23
23
|
<circle cx="${b*0.15}" cy="${b*0.8}" r="3" fill="${n}"/>
|
|
24
24
|
<circle cx="${b*0.85}" cy="${b*0.2}" r="3" fill="${n}"/>
|
|
25
25
|
</svg>
|
|
26
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function
|
|
26
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Yn({primaryColor:t="#1EB53A",accentColor:n="#FCD116",size:o=30}={}){let b=`
|
|
27
27
|
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
|
|
28
28
|
<rect width="${o}" height="${o}" fill="${t}"/>
|
|
29
29
|
<!-- Pindo (Border) Motifs: Cashew/Triangle -->
|
|
@@ -31,7 +31,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
31
31
|
<path d="M${o},0 L${o/2},${o/2} L${o},${o} Z" fill="${n}"/>
|
|
32
32
|
<circle cx="${o/2}" cy="${o/2}" r="${o*0.15}" fill="none" stroke="${n}" stroke-width="2"/>
|
|
33
33
|
</svg>
|
|
34
|
-
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function
|
|
34
|
+
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function Ko({primaryColor:t="#FF6B00",secondaryColor:n="#002B5C",backgroundColor:o="#FFFFFF",size:b=40}={}){let l=`
|
|
35
35
|
<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
|
|
36
36
|
<rect width="${b}" height="${b}" fill="${o}"/>
|
|
37
37
|
<!-- Border pattern -->
|
|
@@ -43,7 +43,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
43
43
|
<circle cx="${b*0.5}" cy="${b*0.5}" r="${b*0.15}" fill="${n}"/>
|
|
44
44
|
<text x="${b*0.5}" y="${b*0.55}" text-anchor="middle" fill="${t}" font-size="${b*0.08}">KANGA</text>
|
|
45
45
|
</svg>
|
|
46
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function
|
|
46
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function po({primaryColor:t="#8B4513",secondaryColor:n="#DAA520",backgroundColor:o="#F5F5DC",size:b=30}={}){let l=`
|
|
47
47
|
<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
|
|
48
48
|
<rect width="${b}" height="${b}" fill="${o}"/>
|
|
49
49
|
<!-- Kuba geometric border -->
|
|
@@ -54,7 +54,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
54
54
|
<!-- Center diamond -->
|
|
55
55
|
<polygon points="${b*0.5},${b*0.3} ${b*0.7},${b*0.5} ${b*0.5},${b*0.7} ${b*0.3},${b*0.5}" fill="${n}"/>
|
|
56
56
|
</svg>
|
|
57
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function
|
|
57
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function uo({primaryColor:t="#FF0000",secondaryColor:n="#000000",accentColor:o="#FFFFFF",size:b=40}={}){let l=`
|
|
58
58
|
<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
|
|
59
59
|
<rect width="${b}" height="${b}" fill="${o}"/>
|
|
60
60
|
<!-- Bead pattern -->
|
|
@@ -78,7 +78,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
78
78
|
<line x1="${b*0.3}" y1="${b*0.2}" x2="${b*0.7}" y2="${b*0.2}" stroke="${t}" stroke-width="3"/>
|
|
79
79
|
<line x1="${b*0.3}" y1="${b*0.8}" x2="${b*0.7}" y2="${b*0.8}" stroke="${t}" stroke-width="3"/>
|
|
80
80
|
</svg>
|
|
81
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function
|
|
81
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function io({primaryColor:t="#FF1493",secondaryColor:n="#00FF00",accentColor:o="#FFFF00",backgroundColor:b="#FFFFFF",size:l=50}={}){let a=`
|
|
82
82
|
<svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${l}" viewBox="0 0 ${l} ${l}">
|
|
83
83
|
<rect width="${l}" height="${l}" fill="${b}"/>
|
|
84
84
|
<!-- Ndebele geometric patterns -->
|
|
@@ -119,7 +119,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
119
119
|
<rect x="${n*0.1}" y="${n*0.1}" width="${n*0.15}" height="${n*0.15}" fill="${o}" stroke="${a}" stroke-width="1"/>
|
|
120
120
|
<rect x="${n*0.75}" y="${n*0.75}" width="${n*0.15}" height="${n*0.15}" fill="${l}" stroke="${a}" stroke-width="1"/>
|
|
121
121
|
</svg>
|
|
122
|
-
`;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function
|
|
122
|
+
`;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function kn({symbolColor:t="#000000",backgroundColor:n="#CD853F",size:o=50}={}){let b=`
|
|
123
123
|
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
|
|
124
124
|
<rect width="${o}" height="${o}" fill="${n}"/>
|
|
125
125
|
<!-- Sankofa-inspired heart shape (go back and get it) -->
|
|
@@ -133,7 +133,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
133
133
|
<circle cx="${o*0.35}" cy="${o*0.45}" r="${o*0.08}" fill="none" stroke="${t}" stroke-width="2"/>
|
|
134
134
|
<circle cx="${o*0.65}" cy="${o*0.45}" r="${o*0.08}" fill="none" stroke="${t}" stroke-width="2"/>
|
|
135
135
|
</svg>
|
|
136
|
-
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function
|
|
136
|
+
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function Mn({colors:t=["#4B0082","#FFD700","#FFFFFF"],size:n=50}={}){let[o,b,l]=t,a=n/10,f=`
|
|
137
137
|
<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
|
|
138
138
|
<rect width="${n}" height="${n}" fill="${o}"/>
|
|
139
139
|
<!-- Horizontal stripes -->
|
|
@@ -150,7 +150,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
150
150
|
<polygon points="${n*0.75},${n*0.3} ${n*0.85},${n*0.5} ${n*0.75},${n*0.7} ${n*0.65},${n*0.5}"
|
|
151
151
|
fill="${b}" stroke="${l}" stroke-width="1"/>
|
|
152
152
|
</svg>
|
|
153
|
-
`;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function
|
|
153
|
+
`;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function Qn({primaryColor:t="#FF6B00",secondaryColor:n="#00A86B",accentColor:o="#FFD700",backgroundColor:b="#FFFFFF",size:l=60}={}){let a=`
|
|
154
154
|
<svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${l}" viewBox="0 0 ${l} ${l}">
|
|
155
155
|
<rect width="${l}" height="${l}" fill="${b}"/>
|
|
156
156
|
<!-- Bold circular motifs -->
|
|
@@ -169,7 +169,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
169
169
|
<circle cx="${l*0.1}" cy="${l*0.8}" r="${l*0.05}" fill="${o}"/>
|
|
170
170
|
<circle cx="${l*0.9}" cy="${l*0.2}" r="${l*0.05}" fill="${o}"/>
|
|
171
171
|
</svg>
|
|
172
|
-
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function
|
|
172
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function Jn({primaryColor:t="#000000",secondaryColor:n="#FFFFFF",accentColor:o="#8B4513",size:b=60}={}){let l=`
|
|
173
173
|
<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
|
|
174
174
|
<rect width="${b}" height="${b}" fill="${t}"/>
|
|
175
175
|
<!-- Zigzags -->
|
|
@@ -185,7 +185,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
185
185
|
<!-- Dots -->
|
|
186
186
|
<circle cx="${b*0.5}" cy="${b*0.5}" r="${b*0.08}" fill="${o}"/>
|
|
187
187
|
</svg>
|
|
188
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function
|
|
188
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Gn({primaryColor:t="#D2B48C",secondaryColor:n="#3E2723",size:o=60}={}){let b=`
|
|
189
189
|
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
|
|
190
190
|
<rect width="${o}" height="${o}" fill="${t}"/>
|
|
191
191
|
<!-- Interlocking diamonds/rectangles -->
|
|
@@ -199,7 +199,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
199
199
|
<line x1="${o*0.4}" y1="${o*0.5}" x2="${o*0.6}" y2="${o*0.5}" stroke="${n}" stroke-width="2"/>
|
|
200
200
|
<line x1="${o*0.5}" y1="${o*0.4}" x2="${o*0.5}" y2="${o*0.6}" stroke="${n}" stroke-width="2"/>
|
|
201
201
|
</svg>
|
|
202
|
-
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function
|
|
202
|
+
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function Ln({primaryColor:t="#000000",secondaryColor:n="#FFFFFF",accentColor:o="#B22222",size:b=60}={}){let l=`
|
|
203
203
|
<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
|
|
204
204
|
<rect width="${b}" height="${b}" fill="${n}"/>
|
|
205
205
|
<!-- Spiral/Diamond Motif -->
|
|
@@ -215,7 +215,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
215
215
|
fill="${n}"/>
|
|
216
216
|
<circle cx="${b*0.5}" cy="${b*0.5}" r="${b*0.1}" fill="${o}"/>
|
|
217
217
|
</svg>
|
|
218
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function
|
|
218
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Fn({colors:t=["#009E60","#FCDD09","#EF3340"],backgroundColor:n="#FFFFFF",size:o=40}={}){let[b,l,a]=t,f=`
|
|
219
219
|
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
|
|
220
220
|
<rect width="${o}" height="${o}" fill="${n}"/>
|
|
221
221
|
<!-- Diamond Chain -->
|
|
@@ -228,7 +228,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
228
228
|
<line x1="0" y1="0" x2="0" y2="${o}" stroke="${b}" stroke-width="4"/>
|
|
229
229
|
<line x1="${o}" y1="0" x2="${o}" y2="${o}" stroke="${b}" stroke-width="4"/>
|
|
230
230
|
</svg>
|
|
231
|
-
`;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function
|
|
231
|
+
`;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function mn({colors:t=["#FFD700","#4169E1","#FF69B4","#228B22"],size:n=60,strokeWidth:o=2}={}){let[b,l,a,f]=t,h=`
|
|
232
232
|
<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
|
|
233
233
|
<rect width="${n}" height="${n}" fill="#FFFFFF"/>
|
|
234
234
|
<rect x="${o}" y="${o}"
|
|
@@ -245,7 +245,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
245
245
|
<polygon points="${n/2},${n*0.3} ${n*0.7},${n/2} ${n/2},${n*0.7} ${n*0.3},${n/2}"
|
|
246
246
|
fill="#FFFFFF" stroke="#000000" stroke-width="${o}"/>
|
|
247
247
|
</svg>
|
|
248
|
-
`;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function
|
|
248
|
+
`;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function Rn({colors:t=["#FFFFFF","#000000","#FF0000","#00A86B","#FFD700"],size:n=50}={}){let[o,b,l,a,f]=t,h=n/10,r=`
|
|
249
249
|
<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
|
|
250
250
|
<rect width="${n}" height="${n}" fill="${b}"/>
|
|
251
251
|
<!-- Triangle pattern (isivivane - sacred cairn) -->
|
|
@@ -262,7 +262,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
262
262
|
<circle cx="${n*0.1}" cy="${n*0.1}" r="${h*0.7}" fill="${l}"/>
|
|
263
263
|
<circle cx="${n*0.9}" cy="${n*0.1}" r="${h*0.7}" fill="${a}"/>
|
|
264
264
|
</svg>
|
|
265
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
265
|
+
`;return`data:image/svg+xml,${encodeURIComponent(r.trim())}`}function Bn({colors:t=["#3E5EB9","#FECD00","#B10C0C","#FFFFFF"],size:n=50}={}){let[o,b,l,a]=t,f=`
|
|
266
266
|
<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
|
|
267
267
|
<rect width="${n}" height="${n}" fill="${o}"/>
|
|
268
268
|
<!-- Shield shape (central to Eswatini culture) -->
|
|
@@ -282,7 +282,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
282
282
|
<polygon points="${n*0.1},${n*0.3} ${n*0.05},${n*0.5} ${n*0.15},${n*0.5}" fill="${a}"/>
|
|
283
283
|
<polygon points="${n*0.9},${n*0.3} ${n*0.85},${n*0.5} ${n*0.95},${n*0.5}" fill="${a}"/>
|
|
284
284
|
</svg>
|
|
285
|
-
`;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function
|
|
285
|
+
`;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function Dn({primaryColor:t="#FFFFFF",accentColor:n="#00A86B",backgroundColor:o="#1a1a2e",size:b=50}={}){let l=`
|
|
286
286
|
<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
|
|
287
287
|
<rect width="${b}" height="${b}" fill="${o}"/>
|
|
288
288
|
<!-- Horizontal bands -->
|
|
@@ -300,7 +300,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
300
300
|
<polygon points="0,${b} ${b*0.15},${b} 0,${b*0.85}" fill="${n}"/>
|
|
301
301
|
<polygon points="${b},${b} ${b*0.85},${b} ${b},${b*0.85}" fill="${n}"/>
|
|
302
302
|
</svg>
|
|
303
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Po(t,n){t.style.backgroundImage=`url("${n}")`,t.style.backgroundRepeat="repeat"}function
|
|
303
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Po(t,n){t.style.backgroundImage=`url("${n}")`,t.style.backgroundRepeat="repeat"}function On({primaryColor:t="#8B0000",secondaryColor:n="#000000",accentColor:o="#FFD700",backgroundColor:b="#F5F5DC",size:l=60}={}){let a=`
|
|
304
304
|
<svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${l}" viewBox="0 0 ${l} ${l}">
|
|
305
305
|
<rect width="${l}" height="${l}" fill="${b}"/>
|
|
306
306
|
<!-- Lozenge (Diamond) - universal protective symbol -->
|
|
@@ -313,7 +313,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
313
313
|
<line x1="${l*0.4}" y1="${l*0.4}" x2="${l*0.6}" y2="${l*0.6}" stroke="${n}" stroke-width="2"/>
|
|
314
314
|
<line x1="${l*0.6}" y1="${l*0.4}" x2="${l*0.4}" y2="${l*0.6}" stroke="${n}" stroke-width="2"/>
|
|
315
315
|
</svg>
|
|
316
|
-
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function
|
|
316
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function Wn({primaryColor:t="#4B0082",secondaryColor:n="#8A2BE2",accentColor:o="#FFFFFF",size:b=50}={}){let l=`
|
|
317
317
|
<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
|
|
318
318
|
<rect width="${b}" height="${b}" fill="${t}"/>
|
|
319
319
|
<!-- Resist circles (Oniko) -->
|
|
@@ -324,7 +324,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
324
324
|
<path d="M0,0 Q${b*0.2},0 ${b*0.2},${b*0.2} Q0,${b*0.2} 0,0" fill="${n}"/>
|
|
325
325
|
<path d="M${b},${b} Q${b*0.8},${b} ${b*0.8},${b*0.8} Q${b},${b*0.8} ${b},${b}" fill="${n}"/>
|
|
326
326
|
</svg>
|
|
327
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function
|
|
327
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function To({primaryColor:t="#2D3D6B",secondaryColor:n="#6B8CC7",accentColor:o="#FFFFFF",size:b=60}={}){let l=`
|
|
328
328
|
<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
|
|
329
329
|
<rect width="${b}" height="${b}" fill="${t}"/>
|
|
330
330
|
<!-- Southern Cross / Tuareg Star -->
|
|
@@ -332,7 +332,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
332
332
|
fill="none" stroke="${o}" stroke-width="2"/>
|
|
333
333
|
<circle cx="${b*0.5}" cy="${b*0.5}" r="${b*0.1}" fill="${n}"/>
|
|
334
334
|
</svg>
|
|
335
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function
|
|
335
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Co({inkColor:t="#3A2E2C",parchmentColor:n="#F4E4BC",size:o=50}={}){let b=`
|
|
336
336
|
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
|
|
337
337
|
<rect width="${o}" height="${o}" fill="${n}"/>
|
|
338
338
|
<path d="M${o*0.2} ${o*0.2} L${o*0.4} ${o*0.2} M${o*0.3} ${o*0.2} L${o*0.3} ${o*0.5} Q${o*0.4} ${o*0.6} ${o*0.2} ${o*0.7}"
|
|
@@ -340,13 +340,13 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
340
340
|
<path d="M${o*0.6} ${o*0.3} C${o*0.8} ${o*0.3} ${o*0.8} ${o*0.6} ${o*0.6} ${o*0.6} L${o*0.8} ${o*0.8}"
|
|
341
341
|
fill="none" stroke="${t}" stroke-width="3" stroke-linecap="round"/>
|
|
342
342
|
</svg>
|
|
343
|
-
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function
|
|
343
|
+
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function yo({clayColor:t="#4E342E",earthColor:n="#3E2723",accentColor:o="#BCAAA4",size:b=60}={}){let l=`
|
|
344
344
|
<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
|
|
345
345
|
<rect width="${b}" height="${b}" fill="${n}"/>
|
|
346
346
|
<path d="M${b*0.2} ${b*0.5} Q${b*0.3} ${b*0.2} ${b*0.5} ${b*0.3} T${b*0.8} ${b*0.5} Q${b*0.7} ${b*0.8} ${b*0.5} ${b*0.7} T${b*0.2} ${b*0.5}"
|
|
347
347
|
fill="${t}" stroke="${o}" stroke-width="2"/>
|
|
348
348
|
</svg>
|
|
349
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function
|
|
349
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function o0({primaryColor:t="#334155",secondaryColor:n="#1e293b",size:o=100}={}){let b=`
|
|
350
350
|
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 100 100">
|
|
351
351
|
<rect width="100" height="100" fill="${n}"/>
|
|
352
352
|
<path d="M10 10 H90 V90 H10 Z" fill="none" stroke="${t}" stroke-width="0.5" opacity="0.3"/>
|
|
@@ -355,24 +355,20 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
355
355
|
<circle cx="80" cy="80" r="2" fill="${t}"/>
|
|
356
356
|
<circle cx="50" cy="50" r="1.5" fill="${t}"/>
|
|
357
357
|
</svg>
|
|
358
|
-
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}var
|
|
358
|
+
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}var St;var kt=x(()=>{St={generatePolygon:No,generateShuka:En,generateHadzabe:xn,generateKanga:Ko,generateKangaBorder:Yn,generateKitenge:Xn,generateMasaiShield:Io,generateTibeb:Fn,generateImigongo:Ln,generateKente:Sn,generateAdinkra:kn,generateAsoOke:Mn,generateAnkara:Qn,generateBogolan:Jn,generateAdire:Wn,generateKuba:Gn,generateKubaBorder:po,generateBerber:On,generateNdebele:mn,generateNdebelePaint:io,generateZulu:Rn,generateZuluBeads:uo,generateSwazi:Bn,generateXhosa:Dn,applyPattern:Po,generateTuareg:To,generateGeez:Co,generateBoli:yo,generateCircuit:o0,circuit:o0}});class Vn{constructor(t){this.value=t,this.__type="RawHtml",Object.freeze(this)}toString(){return this.value}valueOf(){return this.value}}function so(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function f0({title:t="AfriCode App",meta:n="",stylesheet:o="/styles/africanity.css",children:b}={}){return m`<!DOCTYPE html>
|
|
359
359
|
<html lang="en">
|
|
360
360
|
<head>
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
<script type="module">
|
|
368
|
-
import { init } from '/core/sdk.js';
|
|
369
|
-
init();
|
|
370
|
-
</script>
|
|
361
|
+
<meta charset="UTF-8">
|
|
362
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
363
|
+
<title>${t}</title>
|
|
364
|
+
${n}
|
|
365
|
+
${o?m`<link rel="stylesheet" href="${o}">`:""}
|
|
366
|
+
<script type="module" src="/core/sdk.js"></script>
|
|
371
367
|
</head>
|
|
372
368
|
<body>
|
|
373
|
-
|
|
369
|
+
${b}
|
|
374
370
|
</body>
|
|
375
|
-
</html>`}var
|
|
371
|
+
</html>`}function h0(t){if(t instanceof Vn)return t.toString();if(Array.isArray(t))return t.map(h0).join("");if(t===null||t===void 0||t===!1)return"";if(t===!0)return"true";return so(t)}var m=(t,...n)=>{let o="";for(let b=0;b<t.length;b++)if(o+=t[b],b<n.length)o+=h0(n[b]);return new Vn(o)};function A(t,n){if(typeof customElements>"u")return;if(!customElements.get(t))customElements.define(t,n)}var zo,r0,c;var M=x(()=>{zo=globalThis.HTMLElement??class{},r0=typeof CSSStyleSheet<"u";c=class c extends zo{constructor(){super();this.attachShadow({mode:"open"});let t=this.render;if(t&&typeof t==="function")this.render=()=>{try{t.call(this),this.removeAttribute("has-error")}catch(n){console.error(`[AfriCode] Rendering error in <${this.localName}>:`,n),this.setAttribute("has-error","true"),this.shadowRoot.innerHTML=`
|
|
376
372
|
<style>
|
|
377
373
|
.af-local-error {
|
|
378
374
|
padding: 1rem;
|
|
@@ -391,7 +387,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
391
387
|
<span aria-hidden="true">⚠️</span>
|
|
392
388
|
<span>Failed to render</span>
|
|
393
389
|
</div>
|
|
394
|
-
`,this.emit("af-component-error",{component:this.localName,message:n.message,stack:n.stack})}}}connectedCallback(){}static styleCache=new Map;static globalSheets=[];static injectGlobalSheet(t){if(!(t instanceof CSSStyleSheet))
|
|
390
|
+
`,this.emit("af-component-error",{component:this.localName,message:n.message,stack:n.stack})}}}connectedCallback(){}static styleCache=new Map;static globalSheets=[];static injectGlobalSheet(t){if(!r0)return;if(!(t instanceof CSSStyleSheet))return;if(!c.globalSheets.includes(t))c.globalSheets.push(t)}async loadStyles(t=""){if(!this.shadowRoot)return;let o=r0&&"adoptedStyleSheets"in this.shadowRoot,b=typeof t==="string"&&t.length>0?t:"/styles/africanity.css",l=typeof t==="string"&&t.length>0?t:null;if(c.styleCache.has(b)){let a=c.styleCache.get(b);if(o)this.shadowRoot.adoptedStyleSheets=[a,...c.globalSheets];else this._applyFallbackStyle(a?.cssText||a?.text||a||"");return}try{let a=l;if(!a){let f=await fetch("/styles/africanity.css");if(!f.ok)throw Error(`Unable to load stylesheet: ${f.status}`);a=await f.text()}if(o){let f=new CSSStyleSheet;f.replaceSync(a),c.styleCache.set(b,f),this.shadowRoot.adoptedStyleSheets=[f,...c.globalSheets];return}this._applyFallbackStyle(a),c.styleCache.set(b,{text:a})}catch(a){this._applyFallbackStyle(l||"")}}_applyFallbackStyle(t){if(!this.shadowRoot)return;let n=this.shadowRoot.querySelector("style[data-africode-core-styles]");if(!n)n=document.createElement("style"),n.setAttribute("data-africode-core-styles",""),this.shadowRoot.prepend(n);n.textContent=t}spacing(t){return`var(--space-${t})`}createElement(t,{classes:n=[],attributes:o={},text:b=""}={}){let l=document.createElement(t);if(n.length)l.classList.add(...n);if(Object.entries(o).forEach(([a,f])=>l.setAttribute(a,f)),b)l.textContent=b;return l}emit(t,n){this.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0}))}}});var g0={};Q(g0,{default:()=>tb,AfriButton:()=>dt});var dt,tb;var $0=x(()=>{M();dt=class dt extends c{static get observedAttributes(){return["variant","size","theme","disabled","loading","icon","aria-label"]}constructor(){super();this.render()}connectedCallback(){this.shadowRoot.querySelector("button")?.addEventListener("click",(n)=>{if(this.hasAttribute("disabled")||this.hasAttribute("loading")){n.preventDefault();return}this.emit("af-click",{originalEvent:n})})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"primary",n=this.getAttribute("size")||"md",o=this.getAttribute("theme")||"tanzania",b=this.hasAttribute("disabled"),l=this.hasAttribute("loading"),a=this.getAttribute("icon"),f=this.getAttribute("aria-label"),h={tanzania:{primary:"#1EB53A",accent:"#FCD116",text:"#FFFFFF"},maasai:{primary:"#FF0000",accent:"#8B0000",text:"#FFFFFF"},ndebele:{primary:"#4169E1",accent:"#FFD700",text:"#FFFFFF"},ocean:{primary:"#00A3DD",accent:"#0077BE",text:"#FFFFFF"}},r=h[o]||h.tanzania;this.shadowRoot.innerHTML=`
|
|
395
391
|
<style>
|
|
396
392
|
:host {
|
|
397
393
|
display: inline-block;
|
|
@@ -419,8 +415,8 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
419
415
|
|
|
420
416
|
/* Variants */
|
|
421
417
|
.variant-primary {
|
|
422
|
-
background: ${
|
|
423
|
-
color: ${
|
|
418
|
+
background: ${r.primary};
|
|
419
|
+
color: ${r.text};
|
|
424
420
|
}
|
|
425
421
|
.variant-primary:hover:not(:disabled) {
|
|
426
422
|
filter: brightness(1.1);
|
|
@@ -430,25 +426,25 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
430
426
|
|
|
431
427
|
.variant-secondary {
|
|
432
428
|
background: transparent;
|
|
433
|
-
color: ${
|
|
434
|
-
border: 2px solid ${
|
|
429
|
+
color: ${r.primary};
|
|
430
|
+
border: 2px solid ${r.primary};
|
|
435
431
|
}
|
|
436
432
|
.variant-secondary:hover:not(:disabled) {
|
|
437
|
-
background: ${
|
|
438
|
-
color: ${
|
|
433
|
+
background: ${r.primary};
|
|
434
|
+
color: ${r.text};
|
|
439
435
|
}
|
|
440
436
|
|
|
441
437
|
.variant-ghost {
|
|
442
438
|
background: transparent;
|
|
443
|
-
color: ${
|
|
439
|
+
color: ${r.primary};
|
|
444
440
|
}
|
|
445
441
|
.variant-ghost:hover:not(:disabled) {
|
|
446
442
|
background: rgba(0,0,0,0.05);
|
|
447
443
|
}
|
|
448
444
|
|
|
449
445
|
.variant-gradient {
|
|
450
|
-
background: linear-gradient(135deg, ${
|
|
451
|
-
color: ${
|
|
446
|
+
background: linear-gradient(135deg, ${r.primary} 0%, ${r.accent} 100%);
|
|
447
|
+
color: ${r.text};
|
|
452
448
|
}
|
|
453
449
|
.variant-gradient:hover:not(:disabled) {
|
|
454
450
|
transform: translateY(-2px);
|
|
@@ -495,7 +491,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
495
491
|
${a&&!l?`<span class="icon">${a}</span>`:""}
|
|
496
492
|
<slot></slot>
|
|
497
493
|
</button>
|
|
498
|
-
`}};A("af-button",dt);
|
|
494
|
+
`}};A("af-button",dt);tb=dt});var v0={};Q(v0,{default:()=>nb,AfriCard:()=>Ut});var Ut,nb;var w0=x(()=>{M();Ut=class Ut extends c{static get observedAttributes(){return["theme","variant","clickable","image"]}constructor(){super();this.render()}connectedCallback(){if(this.hasAttribute("clickable"))this.shadowRoot.querySelector(".card").addEventListener("click",()=>{this.emit("af-click")})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("theme")||"default",n=this.getAttribute("variant")||"elevated",o=this.hasAttribute("clickable"),b=this.getAttribute("image"),l={default:{accent:"#333",border:"#eee"},tanzania:{accent:"#1EB53A",border:"#1EB53A"},maasai:{accent:"#FF0000",border:"#8B0000"},ndebele:{accent:"#4169E1",border:"#4169E1"}},f={elevated:"box-shadow: 0 2px 12px rgba(0,0,0,0.1);",outlined:`border: 2px solid ${(l[t]||l.default).border};`,flat:"background: #f8f9fa;"};this.shadowRoot.innerHTML=html`
|
|
499
495
|
<style>
|
|
500
496
|
:host {
|
|
501
497
|
display: block;
|
|
@@ -573,7 +569,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
573
569
|
</div>
|
|
574
570
|
`:""}
|
|
575
571
|
</article>
|
|
576
|
-
`}};A("af-card",
|
|
572
|
+
`}};A("af-card",Ut);nb=Ut});var c0={};Q(c0,{default:()=>ob,AfriNavbar:()=>Vt});var Vt,ob;var _0=x(()=>{M();Xt();z();Vt=class Vt extends c{static get observedAttributes(){return["theme","logo","sticky"]}constructor(){super();this._isOpen=!1,this._unsubscribe=null,this.render()}connectedCallback(){super.connectedCallback(),this.shadowRoot.querySelector(".menu-toggle")?.addEventListener("click",()=>{this._isOpen=!this._isOpen;let t=this.shadowRoot.querySelector(".nav-links"),n=this.shadowRoot.querySelector(".menu-toggle");if(t)t.classList.toggle("open",this._isOpen);if(n)n.classList.toggle("open",this._isOpen),n.setAttribute("aria-expanded",String(this._isOpen))})}disconnectedCallback(){if(this._unsubscribe)this._unsubscribe()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("theme")||"dark",n=this.getAttribute("logo")||"AfriCode",o=this.hasAttribute("sticky");this.shadowRoot.innerHTML=`
|
|
577
573
|
<style>
|
|
578
574
|
:host {
|
|
579
575
|
display: block;
|
|
@@ -749,7 +745,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
749
745
|
<slot></slot>
|
|
750
746
|
</div>
|
|
751
747
|
</nav>
|
|
752
|
-
`}};A("af-navbar",jt);zo=jt});var S,Nn,$,N=(t)=>{switch(typeof t){case"undefined":return $.undefined;case"string":return $.string;case"number":return Number.isNaN(t)?$.nan:$.number;case"boolean":return $.boolean;case"function":return $.function;case"bigint":return $.bigint;case"symbol":return $.symbol;case"object":if(Array.isArray(t))return $.array;if(t===null)return $.null;if(t.then&&typeof t.then==="function"&&t.catch&&typeof t.catch==="function")return $.promise;if(typeof Map<"u"&&t instanceof Map)return $.map;if(typeof Set<"u"&&t instanceof Set)return $.set;if(typeof Date<"u"&&t instanceof Date)return $.date;return $.object;default:return $.unknown}};var Mt=Y(()=>{(function(t){t.assertEqual=(l)=>{};function n(l){}t.assertIs=n;function o(l){throw Error()}t.assertNever=o,t.arrayToEnum=(l)=>{let a={};for(let f of l)a[f]=f;return a},t.getValidEnumValues=(l)=>{let a=t.objectKeys(l).filter((h)=>typeof l[l[h]]!=="number"),f={};for(let h of a)f[h]=l[h];return t.objectValues(f)},t.objectValues=(l)=>{return t.objectKeys(l).map(function(a){return l[a]})},t.objectKeys=typeof Object.keys==="function"?(l)=>Object.keys(l):(l)=>{let a=[];for(let f in l)if(Object.prototype.hasOwnProperty.call(l,f))a.push(f);return a},t.find=(l,a)=>{for(let f of l)if(a(f))return f;return},t.isInteger=typeof Number.isInteger==="function"?(l)=>Number.isInteger(l):(l)=>typeof l==="number"&&Number.isFinite(l)&&Math.floor(l)===l;function b(l,a=" | "){return l.map((f)=>typeof f==="string"?`'${f}'`:f).join(a)}t.joinValues=b,t.jsonStringifyReplacer=(l,a)=>{if(typeof a==="bigint")return a.toString();return a}})(S||(S={}));(function(t){t.mergeShapes=(n,o)=>{return{...n,...o}}})(Nn||(Nn={}));$=S.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var r,tb=(t)=>{return JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:")},O;var Nt=Y(()=>{Mt();r=S.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);O=class O extends Error{get errors(){return this.issues}constructor(t){super();this.issues=[],this.addIssue=(o)=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let n=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,n);else this.__proto__=n;this.name="ZodError",this.issues=t}format(t){let n=t||function(l){return l.message},o={_errors:[]},b=(l)=>{for(let a of l.issues)if(a.code==="invalid_union")a.unionErrors.map(b);else if(a.code==="invalid_return_type")b(a.returnTypeError);else if(a.code==="invalid_arguments")b(a.argumentsError);else if(a.path.length===0)o._errors.push(n(a));else{let f=o,h=0;while(h<a.path.length){let g=a.path[h];if(h!==a.path.length-1)f[g]=f[g]||{_errors:[]};else f[g]=f[g]||{_errors:[]},f[g]._errors.push(n(a));f=f[g],h++}}};return b(this),o}static assert(t){if(!(t instanceof O))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,S.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=(n)=>n.message){let n={},o=[];for(let b of this.issues)if(b.path.length>0){let l=b.path[0];n[l]=n[l]||[],n[l].push(t(b))}else o.push(t(b));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}};O.create=(t)=>{return new O(t)}});var nb=(t,n)=>{let o;switch(t.code){case r.invalid_type:if(t.received===$.undefined)o="Required";else o=`Expected ${t.expected}, received ${t.received}`;break;case r.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(t.expected,S.jsonStringifyReplacer)}`;break;case r.unrecognized_keys:o=`Unrecognized key(s) in object: ${S.joinValues(t.keys,", ")}`;break;case r.invalid_union:o="Invalid input";break;case r.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${S.joinValues(t.options)}`;break;case r.invalid_enum_value:o=`Invalid enum value. Expected ${S.joinValues(t.options)}, received '${t.received}'`;break;case r.invalid_arguments:o="Invalid function arguments";break;case r.invalid_return_type:o="Invalid function return type";break;case r.invalid_date:o="Invalid date";break;case r.invalid_string:if(typeof t.validation==="object")if("includes"in t.validation){if(o=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position==="number")o=`${o} at one or more positions greater than or equal to ${t.validation.position}`}else if("startsWith"in t.validation)o=`Invalid input: must start with "${t.validation.startsWith}"`;else if("endsWith"in t.validation)o=`Invalid input: must end with "${t.validation.endsWith}"`;else S.assertNever(t.validation);else if(t.validation!=="regex")o=`Invalid ${t.validation}`;else o="Invalid";break;case r.too_small:if(t.type==="array")o=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`;else if(t.type==="string")o=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`;else if(t.type==="number")o=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="bigint")o=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="date")o=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`;else o="Invalid input";break;case r.too_big:if(t.type==="array")o=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`;else if(t.type==="string")o=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`;else if(t.type==="number")o=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="bigint")o=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="date")o=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`;else o="Invalid input";break;case r.custom:o="Invalid input";break;case r.invalid_intersection_types:o="Intersection results could not be merged";break;case r.not_multiple_of:o=`Number must be a multiple of ${t.multipleOf}`;break;case r.not_finite:o="Number must be finite";break;default:o=n.defaultError,S.assertNever(t)}return{message:o}},I;var Kn=Y(()=>{Nt();Mt();I=nb});function ob(t){_0=t}function ft(){return _0}var _0;var Kt=Y(()=>{Kn();_0=I});function v(t,n){let o=ft(),b=Qt({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,o,o===I?void 0:I].filter((l)=>!!l)});t.common.issues.push(b)}class F{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(t,n){let o=[];for(let b of n){if(b.status==="aborted")return H;if(b.status==="dirty")t.dirty();o.push(b.value)}return{status:t.value,value:o}}static async mergeObjectAsync(t,n){let o=[];for(let b of n){let l=await b.key,a=await b.value;o.push({key:l,value:a})}return F.mergeObjectSync(t,o)}static mergeObjectSync(t,n){let o={};for(let b of n){let{key:l,value:a}=b;if(l.status==="aborted")return H;if(a.status==="aborted")return H;if(l.status==="dirty")t.dirty();if(a.status==="dirty")t.dirty();if(l.value!=="__proto__"&&(typeof a.value<"u"||b.alwaysSet))o[l.value]=a.value}return{status:t.value,value:o}}}var Qt=(t)=>{let{data:n,path:o,errorMaps:b,issueData:l}=t,a=[...o,...l.path||[]],f={...l,path:a};if(l.message!==void 0)return{...l,path:a,message:l.message};let h="",g=b.filter((_)=>!!_).slice().reverse();for(let _ of g)h=_(f,{data:n,defaultError:h}).message;return{...l,path:a,message:h}},bb,H,tt=(t)=>({status:"dirty",value:t}),B=(t)=>({status:"valid",value:t}),pt=(t)=>t.status==="aborted",It=(t)=>t.status==="dirty",C=(t)=>t.status==="valid",ht=(t)=>typeof Promise<"u"&&t instanceof Promise;var pn=Y(()=>{Kt();Kn();bb=[];H=Object.freeze({status:"aborted"})});var A0=()=>{};var q;var q0=Y(()=>{(function(t){t.errToObj=(n)=>typeof n==="string"?{message:n}:n||{},t.toString=(n)=>typeof n==="string"?n:n?.message})(q||(q={}))});class V{constructor(t,n,o,b){this._cachedPath=[],this.parent=t,this.data=n,this._path=o,this._key=b}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function x(t){if(!t)return{};let{errorMap:n,invalid_type_error:o,required_error:b,description:l}=t;if(n&&(o||b))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(n)return{errorMap:n,description:l};return{errorMap:(f,h)=>{let{message:g}=t;if(f.code==="invalid_enum_value")return{message:g??h.defaultError};if(typeof h.data>"u")return{message:g??b??h.defaultError};if(f.code!=="invalid_type")return{message:h.defaultError};return{message:g??o??h.defaultError}},description:l}}class k{get description(){return this._def.description}_getType(t){return N(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:N(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new F,ctx:{common:t.parent.common,data:t.data,parsedType:N(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(ht(n))throw Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let o=this.safeParse(t,n);if(o.success)return o.data;throw o.error}safeParse(t,n){let o={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:N(t)},b=this._parseSync({data:t,path:o.path,parent:o});return H0(o,b)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:N(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:n});return C(o)?{value:o.value}:{issues:n.common.issues}}catch(o){if(o?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then((o)=>C(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){let o=await this.safeParseAsync(t,n);if(o.success)return o.data;throw o.error}async safeParseAsync(t,n){let o={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:N(t)},b=this._parse({data:t,path:o.path,parent:o}),l=await(ht(b)?b:Promise.resolve(b));return H0(o,l)}refine(t,n){let o=(b)=>{if(typeof n==="string"||typeof n>"u")return{message:n};else if(typeof n==="function")return n(b);else return n};return this._refinement((b,l)=>{let a=t(b),f=()=>l.addIssue({code:r.custom,...o(b)});if(typeof Promise<"u"&&a instanceof Promise)return a.then((h)=>{if(!h)return f(),!1;else return!0});if(!a)return f(),!1;else return!0})}refinement(t,n){return this._refinement((o,b)=>{if(!t(o))return b.addIssue(typeof n==="function"?n(o,b):n),!1;else return!0})}_refinement(t){return new j({schema:this,typeName:E.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(n)=>this["~validate"](n)}}optional(){return d.create(this,this._def)}nullable(){return P.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return U.create(this)}promise(){return lt.create(this,this._def)}or(t){return ct.create([this,t],this._def)}and(t){return _t.create(this,t,this._def)}transform(t){return new j({...x(this._def),schema:this,typeName:E.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t==="function"?t:()=>t;return new Et({...x(this._def),innerType:this,defaultValue:n,typeName:E.ZodDefault})}brand(){return new Pt({typeName:E.ZodBranded,type:this,...x(this._def)})}catch(t){let n=typeof t==="function"?t:()=>t;return new Yt({...x(this._def),innerType:this,catchValue:n,typeName:E.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return Rt.create(this,t)}readonly(){return xt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function x0(t){let n="[0-5]\\d";if(t.precision)n=`${n}\\.\\d{${t.precision}}`;else if(t.precision==null)n=`${n}(\\.\\d+)?`;let o=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${n})${o}`}function xb(t){return new RegExp(`^${x0(t)}$`)}function k0(t){let n=`${Y0}T${x0(t)}`,o=[];if(o.push(t.local?"Z?":"Z"),t.offset)o.push("([+-]\\d{2}:?\\d{2})");return n=`${n}(${o.join("|")})`,new RegExp(`^${n}$`)}function kb(t,n){if((n==="v4"||!n)&&cb.test(t))return!0;if((n==="v6"||!n)&&Ab.test(t))return!0;return!1}function Xb(t,n){if(!rb.test(t))return!1;try{let[o]=t.split(".");if(!o)return!1;let b=o.replace(/-/g,"+").replace(/_/g,"/").padEnd(o.length+(4-o.length%4)%4,"="),l=JSON.parse(atob(b));if(typeof l!=="object"||l===null)return!1;if("typ"in l&&l?.typ!=="JWT")return!1;if(!l.alg)return!1;if(n&&l.alg!==n)return!1;return!0}catch{return!1}}function Sb(t,n){if((n==="v4"||!n)&&_b.test(t))return!0;if((n==="v6"||!n)&&qb.test(t))return!0;return!1}function Mb(t,n){let o=(t.toString().split(".")[1]||"").length,b=(n.toString().split(".")[1]||"").length,l=o>b?o:b,a=Number.parseInt(t.toFixed(l).replace(".","")),f=Number.parseInt(n.toFixed(l).replace(".",""));return a%f/10**l}function gt(t){if(t instanceof J){let n={};for(let o in t.shape){let b=t.shape[o];n[o]=d.create(gt(b))}return new J({...t._def,shape:()=>n})}else if(t instanceof U)return new U({...t._def,type:gt(t.element)});else if(t instanceof d)return d.create(gt(t.unwrap()));else if(t instanceof P)return P.create(gt(t.unwrap()));else if(t instanceof p)return p.create(t.items.map((n)=>gt(n)));else return t}function un(t,n){let o=N(t),b=N(n);if(t===n)return{valid:!0,data:t};else if(o===$.object&&b===$.object){let l=S.objectKeys(n),a=S.objectKeys(t).filter((h)=>l.indexOf(h)!==-1),f={...t,...n};for(let h of a){let g=un(t[h],n[h]);if(!g.valid)return{valid:!1};f[h]=g.data}return{valid:!0,data:f}}else if(o===$.array&&b===$.array){if(t.length!==n.length)return{valid:!1};let l=[];for(let a=0;a<t.length;a++){let f=t[a],h=n[a],g=un(f,h);if(!g.valid)return{valid:!1};l.push(g.data)}return{valid:!0,data:l}}else if(o===$.date&&b===$.date&&+t===+n)return{valid:!0,data:t};else return{valid:!1}}function X0(t,n){return new s({values:t,typeName:E.ZodEnum,...x(n)})}function E0(t,n){let o=typeof t==="function"?t(n):typeof t==="string"?{message:t}:t;return typeof o==="string"?{message:o}:o}function S0(t,n={},o){if(t)return ot.create().superRefine((b,l)=>{let a=t(b);if(a instanceof Promise)return a.then((f)=>{if(!f){let h=E0(n,b),g=h.fatal??o??!0;l.addIssue({code:"custom",...h,fatal:g})}});if(!a){let f=E0(n,b),h=f.fatal??o??!0;l.addIssue({code:"custom",...f,fatal:h})}return});return ot.create()}var H0=(t,n)=>{if(C(n))return{success:!0,data:n.value};else{if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let o=new O(t.common.issues);return this._error=o,this._error}}}},lb,ab,fb,hb,gb,rb,$b,vb,wb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",In,cb,_b,Ab,qb,Hb,Eb,Y0="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Yb,m,Z,e,$t,nt,Jt,vt,wt,ot,y,K,Gt,U,J,ct,u=(t)=>{if(t instanceof At)return u(t.schema);else if(t instanceof j)return u(t.innerType());else if(t instanceof qt)return[t.value];else if(t instanceof s)return t.options;else if(t instanceof Ht)return S.objectValues(t.enum);else if(t instanceof Et)return u(t._def.innerType);else if(t instanceof vt)return[void 0];else if(t instanceof wt)return[null];else if(t instanceof d)return[void 0,...u(t.unwrap())];else if(t instanceof P)return[null,...u(t.unwrap())];else if(t instanceof Pt)return u(t.unwrap());else if(t instanceof xt)return u(t.unwrap());else if(t instanceof Yt)return u(t._def.innerType);else return[]},ut,_t,p,Lt,Ft,bt,rt,At,qt,s,Ht,lt,j,d,P,Et,Yt,Bt,Qb,Pt,Rt,xt,Jb,E,Gb=(t,n={message:`Input not instance of ${t.name}`})=>S0((o)=>o instanceof t,n),M0,Q0,Lb,Fb,J0,Bb,Rb,Db,Wb,Ob,mb,Ub,db,Vb,jb,Nb,Kb,pb,Ib,ub,Pb,ib,Tb,Cb,yb,Zb,eb,sb,zb,tl,nl,ol,bl,ll,al=()=>M0().optional(),fl=()=>Q0().optional(),hl=()=>J0().optional(),gl,rl;var G0=Y(()=>{Nt();Kt();q0();pn();Mt();lb=/^c[^\s-]{8,}$/i,ab=/^[0-9a-z]+$/,fb=/^[0-9A-HJKMNP-TV-Z]{26}$/i,hb=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,gb=/^[a-z0-9_-]{21}$/i,rb=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$b=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,vb=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cb=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_b=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ab=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,qb=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Hb=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Eb=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Yb=new RegExp(`^${Y0}$`);m=class m extends k{_parse(t){if(this._def.coerce)t.data=String(t.data);if(this._getType(t)!==$.string){let l=this._getOrReturnCtx(t);return v(l,{code:r.invalid_type,expected:$.string,received:l.parsedType}),H}let o=new F,b=void 0;for(let l of this._def.checks)if(l.kind==="min"){if(t.data.length<l.value)b=this._getOrReturnCtx(t,b),v(b,{code:r.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty()}else if(l.kind==="max"){if(t.data.length>l.value)b=this._getOrReturnCtx(t,b),v(b,{code:r.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty()}else if(l.kind==="length"){let a=t.data.length>l.value,f=t.data.length<l.value;if(a||f){if(b=this._getOrReturnCtx(t,b),a)v(b,{code:r.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message});else if(f)v(b,{code:r.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message});o.dirty()}}else if(l.kind==="email"){if(!vb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"email",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="emoji"){if(!In)In=new RegExp(wb,"u");if(!In.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"emoji",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="uuid"){if(!hb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"uuid",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="nanoid"){if(!gb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"nanoid",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="cuid"){if(!lb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"cuid",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="cuid2"){if(!ab.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"cuid2",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="ulid"){if(!fb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"ulid",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="url")try{new URL(t.data)}catch{b=this._getOrReturnCtx(t,b),v(b,{validation:"url",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="regex"){if(l.regex.lastIndex=0,!l.regex.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"regex",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="trim")t.data=t.data.trim();else if(l.kind==="includes"){if(!t.data.includes(l.value,l.position))b=this._getOrReturnCtx(t,b),v(b,{code:r.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()}else if(l.kind==="toLowerCase")t.data=t.data.toLowerCase();else if(l.kind==="toUpperCase")t.data=t.data.toUpperCase();else if(l.kind==="startsWith"){if(!t.data.startsWith(l.value))b=this._getOrReturnCtx(t,b),v(b,{code:r.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()}else if(l.kind==="endsWith"){if(!t.data.endsWith(l.value))b=this._getOrReturnCtx(t,b),v(b,{code:r.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()}else if(l.kind==="datetime"){if(!k0(l).test(t.data))b=this._getOrReturnCtx(t,b),v(b,{code:r.invalid_string,validation:"datetime",message:l.message}),o.dirty()}else if(l.kind==="date"){if(!Yb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{code:r.invalid_string,validation:"date",message:l.message}),o.dirty()}else if(l.kind==="time"){if(!xb(l).test(t.data))b=this._getOrReturnCtx(t,b),v(b,{code:r.invalid_string,validation:"time",message:l.message}),o.dirty()}else if(l.kind==="duration"){if(!$b.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"duration",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="ip"){if(!kb(t.data,l.version))b=this._getOrReturnCtx(t,b),v(b,{validation:"ip",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="jwt"){if(!Xb(t.data,l.alg))b=this._getOrReturnCtx(t,b),v(b,{validation:"jwt",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="cidr"){if(!Sb(t.data,l.version))b=this._getOrReturnCtx(t,b),v(b,{validation:"cidr",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="base64"){if(!Hb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"base64",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="base64url"){if(!Eb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"base64url",code:r.invalid_string,message:l.message}),o.dirty()}else S.assertNever(l);return{status:o.value,value:t.data}}_regex(t,n,o){return this.refinement((b)=>t.test(b),{validation:n,code:r.invalid_string,...q.errToObj(o)})}_addCheck(t){return new m({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...q.errToObj(t)})}url(t){return this._addCheck({kind:"url",...q.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...q.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...q.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...q.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...q.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...q.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...q.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...q.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...q.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...q.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...q.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...q.errToObj(t)})}datetime(t){if(typeof t==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t});return this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...q.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){if(typeof t==="string")return this._addCheck({kind:"time",precision:null,message:t});return this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...q.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...q.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...q.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...q.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...q.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...q.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...q.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...q.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...q.errToObj(n)})}nonempty(t){return this.min(1,q.errToObj(t))}trim(){return new m({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new m({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new m({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((t)=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find((t)=>t.kind==="date")}get isTime(){return!!this._def.checks.find((t)=>t.kind==="time")}get isDuration(){return!!this._def.checks.find((t)=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find((t)=>t.kind==="email")}get isURL(){return!!this._def.checks.find((t)=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find((t)=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find((t)=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((t)=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((t)=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((t)=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find((t)=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find((t)=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find((t)=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find((t)=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find((t)=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t}get maxLength(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t}};m.create=(t)=>{return new m({checks:[],typeName:E.ZodString,coerce:t?.coerce??!1,...x(t)})};Z=class Z extends k{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce)t.data=Number(t.data);if(this._getType(t)!==$.number){let l=this._getOrReturnCtx(t);return v(l,{code:r.invalid_type,expected:$.number,received:l.parsedType}),H}let o=void 0,b=new F;for(let l of this._def.checks)if(l.kind==="int"){if(!S.isInteger(t.data))o=this._getOrReturnCtx(t,o),v(o,{code:r.invalid_type,expected:"integer",received:"float",message:l.message}),b.dirty()}else if(l.kind==="min"){if(l.inclusive?t.data<l.value:t.data<=l.value)o=this._getOrReturnCtx(t,o),v(o,{code:r.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),b.dirty()}else if(l.kind==="max"){if(l.inclusive?t.data>l.value:t.data>=l.value)o=this._getOrReturnCtx(t,o),v(o,{code:r.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),b.dirty()}else if(l.kind==="multipleOf"){if(Mb(t.data,l.value)!==0)o=this._getOrReturnCtx(t,o),v(o,{code:r.not_multiple_of,multipleOf:l.value,message:l.message}),b.dirty()}else if(l.kind==="finite"){if(!Number.isFinite(t.data))o=this._getOrReturnCtx(t,o),v(o,{code:r.not_finite,message:l.message}),b.dirty()}else S.assertNever(l);return{status:b.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,q.toString(n))}gt(t,n){return this.setLimit("min",t,!1,q.toString(n))}lte(t,n){return this.setLimit("max",t,!0,q.toString(n))}lt(t,n){return this.setLimit("max",t,!1,q.toString(n))}setLimit(t,n,o,b){return new Z({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:q.toString(b)}]})}_addCheck(t){return new Z({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:q.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:q.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:q.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:q.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:q.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:q.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t}get maxValue(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t}get isInt(){return!!this._def.checks.find((t)=>t.kind==="int"||t.kind==="multipleOf"&&S.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let o of this._def.checks)if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;else if(o.kind==="min"){if(n===null||o.value>n)n=o.value}else if(o.kind==="max"){if(t===null||o.value<t)t=o.value}return Number.isFinite(n)&&Number.isFinite(t)}};Z.create=(t)=>{return new Z({checks:[],typeName:E.ZodNumber,coerce:t?.coerce||!1,...x(t)})};e=class e extends k{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==$.bigint)return this._getInvalidInput(t);let o=void 0,b=new F;for(let l of this._def.checks)if(l.kind==="min"){if(l.inclusive?t.data<l.value:t.data<=l.value)o=this._getOrReturnCtx(t,o),v(o,{code:r.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),b.dirty()}else if(l.kind==="max"){if(l.inclusive?t.data>l.value:t.data>=l.value)o=this._getOrReturnCtx(t,o),v(o,{code:r.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),b.dirty()}else if(l.kind==="multipleOf"){if(t.data%l.value!==BigInt(0))o=this._getOrReturnCtx(t,o),v(o,{code:r.not_multiple_of,multipleOf:l.value,message:l.message}),b.dirty()}else S.assertNever(l);return{status:b.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return v(n,{code:r.invalid_type,expected:$.bigint,received:n.parsedType}),H}gte(t,n){return this.setLimit("min",t,!0,q.toString(n))}gt(t,n){return this.setLimit("min",t,!1,q.toString(n))}lte(t,n){return this.setLimit("max",t,!0,q.toString(n))}lt(t,n){return this.setLimit("max",t,!1,q.toString(n))}setLimit(t,n,o,b){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:q.toString(b)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:q.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:q.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t}get maxValue(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t}};e.create=(t)=>{return new e({checks:[],typeName:E.ZodBigInt,coerce:t?.coerce??!1,...x(t)})};$t=class $t extends k{_parse(t){if(this._def.coerce)t.data=Boolean(t.data);if(this._getType(t)!==$.boolean){let o=this._getOrReturnCtx(t);return v(o,{code:r.invalid_type,expected:$.boolean,received:o.parsedType}),H}return B(t.data)}};$t.create=(t)=>{return new $t({typeName:E.ZodBoolean,coerce:t?.coerce||!1,...x(t)})};nt=class nt extends k{_parse(t){if(this._def.coerce)t.data=new Date(t.data);if(this._getType(t)!==$.date){let l=this._getOrReturnCtx(t);return v(l,{code:r.invalid_type,expected:$.date,received:l.parsedType}),H}if(Number.isNaN(t.data.getTime())){let l=this._getOrReturnCtx(t);return v(l,{code:r.invalid_date}),H}let o=new F,b=void 0;for(let l of this._def.checks)if(l.kind==="min"){if(t.data.getTime()<l.value)b=this._getOrReturnCtx(t,b),v(b,{code:r.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()}else if(l.kind==="max"){if(t.data.getTime()>l.value)b=this._getOrReturnCtx(t,b),v(b,{code:r.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()}else S.assertNever(l);return{status:o.value,value:new Date(t.data.getTime())}}_addCheck(t){return new nt({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:q.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:q.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t!=null?new Date(t):null}};nt.create=(t)=>{return new nt({checks:[],coerce:t?.coerce||!1,typeName:E.ZodDate,...x(t)})};Jt=class Jt extends k{_parse(t){if(this._getType(t)!==$.symbol){let o=this._getOrReturnCtx(t);return v(o,{code:r.invalid_type,expected:$.symbol,received:o.parsedType}),H}return B(t.data)}};Jt.create=(t)=>{return new Jt({typeName:E.ZodSymbol,...x(t)})};vt=class vt extends k{_parse(t){if(this._getType(t)!==$.undefined){let o=this._getOrReturnCtx(t);return v(o,{code:r.invalid_type,expected:$.undefined,received:o.parsedType}),H}return B(t.data)}};vt.create=(t)=>{return new vt({typeName:E.ZodUndefined,...x(t)})};wt=class wt extends k{_parse(t){if(this._getType(t)!==$.null){let o=this._getOrReturnCtx(t);return v(o,{code:r.invalid_type,expected:$.null,received:o.parsedType}),H}return B(t.data)}};wt.create=(t)=>{return new wt({typeName:E.ZodNull,...x(t)})};ot=class ot extends k{constructor(){super(...arguments);this._any=!0}_parse(t){return B(t.data)}};ot.create=(t)=>{return new ot({typeName:E.ZodAny,...x(t)})};y=class y extends k{constructor(){super(...arguments);this._unknown=!0}_parse(t){return B(t.data)}};y.create=(t)=>{return new y({typeName:E.ZodUnknown,...x(t)})};K=class K extends k{_parse(t){let n=this._getOrReturnCtx(t);return v(n,{code:r.invalid_type,expected:$.never,received:n.parsedType}),H}};K.create=(t)=>{return new K({typeName:E.ZodNever,...x(t)})};Gt=class Gt extends k{_parse(t){if(this._getType(t)!==$.undefined){let o=this._getOrReturnCtx(t);return v(o,{code:r.invalid_type,expected:$.void,received:o.parsedType}),H}return B(t.data)}};Gt.create=(t)=>{return new Gt({typeName:E.ZodVoid,...x(t)})};U=class U extends k{_parse(t){let{ctx:n,status:o}=this._processInputParams(t),b=this._def;if(n.parsedType!==$.array)return v(n,{code:r.invalid_type,expected:$.array,received:n.parsedType}),H;if(b.exactLength!==null){let a=n.data.length>b.exactLength.value,f=n.data.length<b.exactLength.value;if(a||f)v(n,{code:a?r.too_big:r.too_small,minimum:f?b.exactLength.value:void 0,maximum:a?b.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:b.exactLength.message}),o.dirty()}if(b.minLength!==null){if(n.data.length<b.minLength.value)v(n,{code:r.too_small,minimum:b.minLength.value,type:"array",inclusive:!0,exact:!1,message:b.minLength.message}),o.dirty()}if(b.maxLength!==null){if(n.data.length>b.maxLength.value)v(n,{code:r.too_big,maximum:b.maxLength.value,type:"array",inclusive:!0,exact:!1,message:b.maxLength.message}),o.dirty()}if(n.common.async)return Promise.all([...n.data].map((a,f)=>{return b.type._parseAsync(new V(n,a,n.path,f))})).then((a)=>{return F.mergeArray(o,a)});let l=[...n.data].map((a,f)=>{return b.type._parseSync(new V(n,a,n.path,f))});return F.mergeArray(o,l)}get element(){return this._def.type}min(t,n){return new U({...this._def,minLength:{value:t,message:q.toString(n)}})}max(t,n){return new U({...this._def,maxLength:{value:t,message:q.toString(n)}})}length(t,n){return new U({...this._def,exactLength:{value:t,message:q.toString(n)}})}nonempty(t){return this.min(1,t)}};U.create=(t,n)=>{return new U({type:t,minLength:null,maxLength:null,exactLength:null,typeName:E.ZodArray,...x(n)})};J=class J extends k{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=S.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==$.object){let g=this._getOrReturnCtx(t);return v(g,{code:r.invalid_type,expected:$.object,received:g.parsedType}),H}let{status:o,ctx:b}=this._processInputParams(t),{shape:l,keys:a}=this._getCached(),f=[];if(!(this._def.catchall instanceof K&&this._def.unknownKeys==="strip")){for(let g in b.data)if(!a.includes(g))f.push(g)}let h=[];for(let g of a){let _=l[g],X=b.data[g];h.push({key:{status:"valid",value:g},value:_._parse(new V(b,X,b.path,g)),alwaysSet:g in b.data})}if(this._def.catchall instanceof K){let g=this._def.unknownKeys;if(g==="passthrough")for(let _ of f)h.push({key:{status:"valid",value:_},value:{status:"valid",value:b.data[_]}});else if(g==="strict"){if(f.length>0)v(b,{code:r.unrecognized_keys,keys:f}),o.dirty()}else if(g==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let _ of f){let X=b.data[_];h.push({key:{status:"valid",value:_},value:g._parse(new V(b,X,b.path,_)),alwaysSet:_ in b.data})}}if(b.common.async)return Promise.resolve().then(async()=>{let g=[];for(let _ of h){let X=await _.key,L=await _.value;g.push({key:X,value:L,alwaysSet:_.alwaysSet})}return g}).then((g)=>{return F.mergeObjectSync(o,g)});else return F.mergeObjectSync(o,h)}get shape(){return this._def.shape()}strict(t){return q.errToObj,new J({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,o)=>{let b=this._def.errorMap?.(n,o).message??o.defaultError;if(n.code==="unrecognized_keys")return{message:q.errToObj(t).message??b};return{message:b}}}:{}})}strip(){return new J({...this._def,unknownKeys:"strip"})}passthrough(){return new J({...this._def,unknownKeys:"passthrough"})}extend(t){return new J({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new J({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:E.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new J({...this._def,catchall:t})}pick(t){let n={};for(let o of S.objectKeys(t))if(t[o]&&this.shape[o])n[o]=this.shape[o];return new J({...this._def,shape:()=>n})}omit(t){let n={};for(let o of S.objectKeys(this.shape))if(!t[o])n[o]=this.shape[o];return new J({...this._def,shape:()=>n})}deepPartial(){return gt(this)}partial(t){let n={};for(let o of S.objectKeys(this.shape)){let b=this.shape[o];if(t&&!t[o])n[o]=b;else n[o]=b.optional()}return new J({...this._def,shape:()=>n})}required(t){let n={};for(let o of S.objectKeys(this.shape))if(t&&!t[o])n[o]=this.shape[o];else{let l=this.shape[o];while(l instanceof d)l=l._def.innerType;n[o]=l}return new J({...this._def,shape:()=>n})}keyof(){return X0(S.objectKeys(this.shape))}};J.create=(t,n)=>{return new J({shape:()=>t,unknownKeys:"strip",catchall:K.create(),typeName:E.ZodObject,...x(n)})};J.strictCreate=(t,n)=>{return new J({shape:()=>t,unknownKeys:"strict",catchall:K.create(),typeName:E.ZodObject,...x(n)})};J.lazycreate=(t,n)=>{return new J({shape:t,unknownKeys:"strip",catchall:K.create(),typeName:E.ZodObject,...x(n)})};ct=class ct extends k{_parse(t){let{ctx:n}=this._processInputParams(t),o=this._def.options;function b(l){for(let f of l)if(f.result.status==="valid")return f.result;for(let f of l)if(f.result.status==="dirty")return n.common.issues.push(...f.ctx.common.issues),f.result;let a=l.map((f)=>new O(f.ctx.common.issues));return v(n,{code:r.invalid_union,unionErrors:a}),H}if(n.common.async)return Promise.all(o.map(async(l)=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(b);else{let l=void 0,a=[];for(let h of o){let g={...n,common:{...n.common,issues:[]},parent:null},_=h._parseSync({data:n.data,path:n.path,parent:g});if(_.status==="valid")return _;else if(_.status==="dirty"&&!l)l={result:_,ctx:g};if(g.common.issues.length)a.push(g.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;let f=a.map((h)=>new O(h));return v(n,{code:r.invalid_union,unionErrors:f}),H}}get options(){return this._def.options}};ct.create=(t,n)=>{return new ct({options:t,typeName:E.ZodUnion,...x(n)})};ut=class ut extends k{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$.object)return v(n,{code:r.invalid_type,expected:$.object,received:n.parsedType}),H;let o=this.discriminator,b=n.data[o],l=this.optionsMap.get(b);if(!l)return v(n,{code:r.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),H;if(n.common.async)return l._parseAsync({data:n.data,path:n.path,parent:n});else return l._parseSync({data:n.data,path:n.path,parent:n})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,o){let b=new Map;for(let l of n){let a=u(l.shape[t]);if(!a.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let f of a){if(b.has(f))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(f)}`);b.set(f,l)}}return new ut({typeName:E.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:b,...x(o)})}};_t=class _t extends k{_parse(t){let{status:n,ctx:o}=this._processInputParams(t),b=(l,a)=>{if(pt(l)||pt(a))return H;let f=un(l.value,a.value);if(!f.valid)return v(o,{code:r.invalid_intersection_types}),H;if(It(l)||It(a))n.dirty();return{status:n.value,value:f.data}};if(o.common.async)return Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,a])=>b(l,a));else return b(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};_t.create=(t,n,o)=>{return new _t({left:t,right:n,typeName:E.ZodIntersection,...x(o)})};p=class p extends k{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==$.array)return v(o,{code:r.invalid_type,expected:$.array,received:o.parsedType}),H;if(o.data.length<this._def.items.length)return v(o,{code:r.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),H;if(!this._def.rest&&o.data.length>this._def.items.length)v(o,{code:r.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty();let l=[...o.data].map((a,f)=>{let h=this._def.items[f]||this._def.rest;if(!h)return null;return h._parse(new V(o,a,o.path,f))}).filter((a)=>!!a);if(o.common.async)return Promise.all(l).then((a)=>{return F.mergeArray(n,a)});else return F.mergeArray(n,l)}get items(){return this._def.items}rest(t){return new p({...this._def,rest:t})}};p.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new p({items:t,typeName:E.ZodTuple,rest:null,...x(n)})};Lt=class Lt extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==$.object)return v(o,{code:r.invalid_type,expected:$.object,received:o.parsedType}),H;let b=[],l=this._def.keyType,a=this._def.valueType;for(let f in o.data)b.push({key:l._parse(new V(o,f,o.path,f)),value:a._parse(new V(o,o.data[f],o.path,f)),alwaysSet:f in o.data});if(o.common.async)return F.mergeObjectAsync(n,b);else return F.mergeObjectSync(n,b)}get element(){return this._def.valueType}static create(t,n,o){if(n instanceof k)return new Lt({keyType:t,valueType:n,typeName:E.ZodRecord,...x(o)});return new Lt({keyType:m.create(),valueType:t,typeName:E.ZodRecord,...x(n)})}};Ft=class Ft extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==$.map)return v(o,{code:r.invalid_type,expected:$.map,received:o.parsedType}),H;let b=this._def.keyType,l=this._def.valueType,a=[...o.data.entries()].map(([f,h],g)=>{return{key:b._parse(new V(o,f,o.path,[g,"key"])),value:l._parse(new V(o,h,o.path,[g,"value"]))}});if(o.common.async){let f=new Map;return Promise.resolve().then(async()=>{for(let h of a){let g=await h.key,_=await h.value;if(g.status==="aborted"||_.status==="aborted")return H;if(g.status==="dirty"||_.status==="dirty")n.dirty();f.set(g.value,_.value)}return{status:n.value,value:f}})}else{let f=new Map;for(let h of a){let{key:g,value:_}=h;if(g.status==="aborted"||_.status==="aborted")return H;if(g.status==="dirty"||_.status==="dirty")n.dirty();f.set(g.value,_.value)}return{status:n.value,value:f}}}};Ft.create=(t,n,o)=>{return new Ft({valueType:n,keyType:t,typeName:E.ZodMap,...x(o)})};bt=class bt extends k{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==$.set)return v(o,{code:r.invalid_type,expected:$.set,received:o.parsedType}),H;let b=this._def;if(b.minSize!==null){if(o.data.size<b.minSize.value)v(o,{code:r.too_small,minimum:b.minSize.value,type:"set",inclusive:!0,exact:!1,message:b.minSize.message}),n.dirty()}if(b.maxSize!==null){if(o.data.size>b.maxSize.value)v(o,{code:r.too_big,maximum:b.maxSize.value,type:"set",inclusive:!0,exact:!1,message:b.maxSize.message}),n.dirty()}let l=this._def.valueType;function a(h){let g=new Set;for(let _ of h){if(_.status==="aborted")return H;if(_.status==="dirty")n.dirty();g.add(_.value)}return{status:n.value,value:g}}let f=[...o.data.values()].map((h,g)=>l._parse(new V(o,h,o.path,g)));if(o.common.async)return Promise.all(f).then((h)=>a(h));else return a(f)}min(t,n){return new bt({...this._def,minSize:{value:t,message:q.toString(n)}})}max(t,n){return new bt({...this._def,maxSize:{value:t,message:q.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};bt.create=(t,n)=>{return new bt({valueType:t,minSize:null,maxSize:null,typeName:E.ZodSet,...x(n)})};rt=class rt extends k{constructor(){super(...arguments);this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$.function)return v(n,{code:r.invalid_type,expected:$.function,received:n.parsedType}),H;function o(f,h){return Qt({data:f,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ft(),I].filter((g)=>!!g),issueData:{code:r.invalid_arguments,argumentsError:h}})}function b(f,h){return Qt({data:f,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ft(),I].filter((g)=>!!g),issueData:{code:r.invalid_return_type,returnTypeError:h}})}let l={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof lt){let f=this;return B(async function(...h){let g=new O([]),_=await f._def.args.parseAsync(h,l).catch((G)=>{throw g.addIssue(o(h,G)),g}),X=await Reflect.apply(a,this,_);return await f._def.returns._def.type.parseAsync(X,l).catch((G)=>{throw g.addIssue(b(X,G)),g})})}else{let f=this;return B(function(...h){let g=f._def.args.safeParse(h,l);if(!g.success)throw new O([o(h,g.error)]);let _=Reflect.apply(a,this,g.data),X=f._def.returns.safeParse(_,l);if(!X.success)throw new O([b(_,X.error)]);return X.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new rt({...this._def,args:p.create(t).rest(y.create())})}returns(t){return new rt({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,o){return new rt({args:t?t:p.create([]).rest(y.create()),returns:n||y.create(),typeName:E.ZodFunction,...x(o)})}};At=class At extends k{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};At.create=(t,n)=>{return new At({getter:t,typeName:E.ZodLazy,...x(n)})};qt=class qt extends k{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return v(n,{received:n.data,code:r.invalid_literal,expected:this._def.value}),H}return{status:"valid",value:t.data}}get value(){return this._def.value}};qt.create=(t,n)=>{return new qt({value:t,typeName:E.ZodLiteral,...x(n)})};s=class s extends k{_parse(t){if(typeof t.data!=="string"){let n=this._getOrReturnCtx(t),o=this._def.values;return v(n,{expected:S.joinValues(o),received:n.parsedType,code:r.invalid_type}),H}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),o=this._def.values;return v(n,{received:n.data,code:r.invalid_enum_value,options:o}),H}return B(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return s.create(t,{...this._def,...n})}exclude(t,n=this._def){return s.create(this.options.filter((o)=>!t.includes(o)),{...this._def,...n})}};s.create=X0;Ht=class Ht extends k{_parse(t){let n=S.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(t);if(o.parsedType!==$.string&&o.parsedType!==$.number){let b=S.objectValues(n);return v(o,{expected:S.joinValues(b),received:o.parsedType,code:r.invalid_type}),H}if(!this._cache)this._cache=new Set(S.getValidEnumValues(this._def.values));if(!this._cache.has(t.data)){let b=S.objectValues(n);return v(o,{received:o.data,code:r.invalid_enum_value,options:b}),H}return B(t.data)}get enum(){return this._def.values}};Ht.create=(t,n)=>{return new Ht({values:t,typeName:E.ZodNativeEnum,...x(n)})};lt=class lt extends k{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$.promise&&n.common.async===!1)return v(n,{code:r.invalid_type,expected:$.promise,received:n.parsedType}),H;let o=n.parsedType===$.promise?n.data:Promise.resolve(n.data);return B(o.then((b)=>{return this._def.type.parseAsync(b,{path:n.path,errorMap:n.common.contextualErrorMap})}))}};lt.create=(t,n)=>{return new lt({type:t,typeName:E.ZodPromise,...x(n)})};j=class j extends k{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===E.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:o}=this._processInputParams(t),b=this._def.effect||null,l={addIssue:(a)=>{if(v(o,a),a.fatal)n.abort();else n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),b.type==="preprocess"){let a=b.transform(o.data,l);if(o.common.async)return Promise.resolve(a).then(async(f)=>{if(n.value==="aborted")return H;let h=await this._def.schema._parseAsync({data:f,path:o.path,parent:o});if(h.status==="aborted")return H;if(h.status==="dirty")return tt(h.value);if(n.value==="dirty")return tt(h.value);return h});else{if(n.value==="aborted")return H;let f=this._def.schema._parseSync({data:a,path:o.path,parent:o});if(f.status==="aborted")return H;if(f.status==="dirty")return tt(f.value);if(n.value==="dirty")return tt(f.value);return f}}if(b.type==="refinement"){let a=(f)=>{let h=b.refinement(f,l);if(o.common.async)return Promise.resolve(h);if(h instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return f};if(o.common.async===!1){let f=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(f.status==="aborted")return H;if(f.status==="dirty")n.dirty();return a(f.value),{status:n.value,value:f.value}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((f)=>{if(f.status==="aborted")return H;if(f.status==="dirty")n.dirty();return a(f.value).then(()=>{return{status:n.value,value:f.value}})})}if(b.type==="transform")if(o.common.async===!1){let a=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!C(a))return H;let f=b.transform(a.value,l);if(f instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:f}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((a)=>{if(!C(a))return H;return Promise.resolve(b.transform(a.value,l)).then((f)=>({status:n.value,value:f}))});S.assertNever(b)}};j.create=(t,n,o)=>{return new j({schema:t,typeName:E.ZodEffects,effect:n,...x(o)})};j.createWithPreprocess=(t,n,o)=>{return new j({schema:n,effect:{type:"preprocess",transform:t},typeName:E.ZodEffects,...x(o)})};d=class d extends k{_parse(t){if(this._getType(t)===$.undefined)return B(void 0);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};d.create=(t,n)=>{return new d({innerType:t,typeName:E.ZodOptional,...x(n)})};P=class P extends k{_parse(t){if(this._getType(t)===$.null)return B(null);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};P.create=(t,n)=>{return new P({innerType:t,typeName:E.ZodNullable,...x(n)})};Et=class Et extends k{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;if(n.parsedType===$.undefined)o=this._def.defaultValue();return this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Et.create=(t,n)=>{return new Et({innerType:t,typeName:E.ZodDefault,defaultValue:typeof n.default==="function"?n.default:()=>n.default,...x(n)})};Yt=class Yt extends k{_parse(t){let{ctx:n}=this._processInputParams(t),o={...n,common:{...n.common,issues:[]}},b=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});if(ht(b))return b.then((l)=>{return{status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new O(o.common.issues)},input:o.data})}});else return{status:"valid",value:b.status==="valid"?b.value:this._def.catchValue({get error(){return new O(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};Yt.create=(t,n)=>{return new Yt({innerType:t,typeName:E.ZodCatch,catchValue:typeof n.catch==="function"?n.catch:()=>n.catch,...x(n)})};Bt=class Bt extends k{_parse(t){if(this._getType(t)!==$.nan){let o=this._getOrReturnCtx(t);return v(o,{code:r.invalid_type,expected:$.nan,received:o.parsedType}),H}return{status:"valid",value:t.data}}};Bt.create=(t)=>{return new Bt({typeName:E.ZodNaN,...x(t)})};Qb=Symbol("zod_brand");Pt=class Pt extends k{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}};Rt=class Rt extends k{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.common.async)return(async()=>{let l=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});if(l.status==="aborted")return H;if(l.status==="dirty")return n.dirty(),tt(l.value);else return this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();else{let b=this._def.in._parseSync({data:o.data,path:o.path,parent:o});if(b.status==="aborted")return H;if(b.status==="dirty")return n.dirty(),{status:"dirty",value:b.value};else return this._def.out._parseSync({data:b.value,path:o.path,parent:o})}}static create(t,n){return new Rt({in:t,out:n,typeName:E.ZodPipeline})}};xt=class xt extends k{_parse(t){let n=this._def.innerType._parse(t),o=(b)=>{if(C(b))b.value=Object.freeze(b.value);return b};return ht(n)?n.then((b)=>o(b)):o(n)}unwrap(){return this._def.innerType}};xt.create=(t,n)=>{return new xt({innerType:t,typeName:E.ZodReadonly,...x(n)})};Jb={object:J.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(E||(E={}));M0=m.create,Q0=Z.create,Lb=Bt.create,Fb=e.create,J0=$t.create,Bb=nt.create,Rb=Jt.create,Db=vt.create,Wb=wt.create,Ob=ot.create,mb=y.create,Ub=K.create,db=Gt.create,Vb=U.create,jb=J.create,Nb=J.strictCreate,Kb=ct.create,pb=ut.create,Ib=_t.create,ub=p.create,Pb=Lt.create,ib=Ft.create,Tb=bt.create,Cb=rt.create,yb=At.create,Zb=qt.create,eb=s.create,sb=Ht.create,zb=lt.create,tl=j.create,nl=d.create,ol=P.create,bl=j.createWithPreprocess,ll=Rt.create,gl={string:(t)=>m.create({...t,coerce:!0}),number:(t)=>Z.create({...t,coerce:!0}),boolean:(t)=>$t.create({...t,coerce:!0}),bigint:(t)=>e.create({...t,coerce:!0}),date:(t)=>nt.create({...t,coerce:!0})},rl=H});var w={};Q(w,{void:()=>db,util:()=>S,unknown:()=>mb,union:()=>Kb,undefined:()=>Db,tuple:()=>ub,transformer:()=>tl,symbol:()=>Rb,string:()=>M0,strictObject:()=>Nb,setErrorMap:()=>ob,set:()=>Tb,record:()=>Pb,quotelessJson:()=>tb,promise:()=>zb,preprocess:()=>bl,pipeline:()=>ll,ostring:()=>al,optional:()=>nl,onumber:()=>fl,oboolean:()=>hl,objectUtil:()=>Nn,object:()=>jb,number:()=>Q0,nullable:()=>ol,null:()=>Wb,never:()=>Ub,nativeEnum:()=>sb,nan:()=>Lb,map:()=>ib,makeIssue:()=>Qt,literal:()=>Zb,lazy:()=>yb,late:()=>Jb,isValid:()=>C,isDirty:()=>It,isAsync:()=>ht,isAborted:()=>pt,intersection:()=>Ib,instanceof:()=>Gb,getParsedType:()=>N,getErrorMap:()=>ft,function:()=>Cb,enum:()=>eb,effect:()=>tl,discriminatedUnion:()=>pb,defaultErrorMap:()=>I,datetimeRegex:()=>k0,date:()=>Bb,custom:()=>S0,coerce:()=>gl,boolean:()=>J0,bigint:()=>Fb,array:()=>Vb,any:()=>Ob,addIssueToContext:()=>v,ZodVoid:()=>Gt,ZodUnknown:()=>y,ZodUnion:()=>ct,ZodUndefined:()=>vt,ZodType:()=>k,ZodTuple:()=>p,ZodTransformer:()=>j,ZodSymbol:()=>Jt,ZodString:()=>m,ZodSet:()=>bt,ZodSchema:()=>k,ZodRecord:()=>Lt,ZodReadonly:()=>xt,ZodPromise:()=>lt,ZodPipeline:()=>Rt,ZodParsedType:()=>$,ZodOptional:()=>d,ZodObject:()=>J,ZodNumber:()=>Z,ZodNullable:()=>P,ZodNull:()=>wt,ZodNever:()=>K,ZodNativeEnum:()=>Ht,ZodNaN:()=>Bt,ZodMap:()=>Ft,ZodLiteral:()=>qt,ZodLazy:()=>At,ZodIssueCode:()=>r,ZodIntersection:()=>_t,ZodFunction:()=>rt,ZodFirstPartyTypeKind:()=>E,ZodError:()=>O,ZodEnum:()=>s,ZodEffects:()=>j,ZodDiscriminatedUnion:()=>ut,ZodDefault:()=>Et,ZodDate:()=>nt,ZodCatch:()=>Yt,ZodBranded:()=>Pt,ZodBoolean:()=>$t,ZodBigInt:()=>e,ZodArray:()=>U,ZodAny:()=>ot,Schema:()=>k,ParseStatus:()=>F,OK:()=>B,NEVER:()=>rl,INVALID:()=>H,EMPTY_PATH:()=>bb,DIRTY:()=>tt,BRAND:()=>Qb});var Pn=Y(()=>{Kt();pn();A0();Mt();G0();Nt()});var L0=Y(()=>{Pn();Pn()});function Tn(t){if(t===null||typeof t!=="object")return t;if(Array.isArray(t))return t.map(Tn);let n={};for(let o of Object.keys(t))n[o]=Tn(t[o]);return n}var $l,Ma;var F0=Y(()=>{$l={validation:{trimStrings:!1,emptyAsNullDefault:!1},security:{csrf:{enabled:!0,excludePaths:[],sameSite:"Strict",secure:!1},rateLimit:{enabled:!0,windowMs:60000,maxRequests:60,excludePaths:[]}},hooks:{onValidationError:null,onSecurityViolation:null,onRateLimit:null,onDatabaseError:null,onRequest:null}},Ma=Tn($l)});class Dt{static validate(t,n){try{return{success:!0,data:t.parse(n)}}catch(o){if(o instanceof w.ZodError){let b={};return o.errors.forEach((l)=>{let a=l.path.join(".");b[a]=l.message}),{success:!1,errors:b}}return{success:!1,errors:{general:"Validation failed"}}}}static validateField(t,n){try{return t.parse(n),{success:!0}}catch(o){if(o instanceof w.ZodError)return{success:!1,error:o.errors[0]?.message||"Invalid value"};return{success:!1,error:"Validation failed"}}}static getFieldError(t,n){if(t.success)return null;return t.errors?.[n]||null}static hasFieldError(t,n){return!!this.getFieldError(t,n)}}var B0,i;var Cn=Y(()=>{L0();F0();B0={login:w.object({email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,"Password must contain at least one uppercase letter, one lowercase letter, and one number")}),register:w.object({name:w.string().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").regex(/^[a-zA-Z\s'-]+$/,"Name can only contain letters, spaces, hyphens, and apostrophes"),email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])/,"Password must contain uppercase, lowercase, number, and special character"),confirmPassword:w.string()}).refine((t)=>t.password===t.confirmPassword,{message:"Passwords don't match",path:["confirmPassword"]}),auth:{register:w.object({action:w.literal("register"),email:w.string().min(1,"Email is required").email("Please enter a valid email address"),username:w.string().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters"),password:w.string().min(8,"Password must be at least 8 characters"),full_name:w.string().min(2,"Full name is required").max(100,"Full name is too long")}),login:w.object({action:w.literal("login"),email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.string().min(8,"Password must be at least 8 characters")}),logout:w.object({action:w.literal("logout")}),action:w.discriminatedUnion("action",[w.object({action:w.literal("register")}).merge(w.object({email:w.string().min(1,"Email is required").email("Please enter a valid email address"),username:w.string().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters"),password:w.string().min(8,"Password must be at least 8 characters"),full_name:w.string().min(2,"Full name is required").max(100,"Full name is too long")})),w.object({action:w.literal("login")}).merge(w.object({email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.string().min(8,"Password must be at least 8 characters")})),w.object({action:w.literal("logout")})])},contact:w.object({name:w.string().min(2,"Name must be at least 2 characters").max(100,"Name is too long"),email:w.string().email("Please enter a valid email address"),message:w.string().min(10,"Message must be at least 10 characters").max(1000,"Message is too long")}),email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,"Password must contain uppercase, lowercase, and number"),phone:w.string().regex(/^[\+]?[1-9][\d]{0,15}$/,"Please enter a valid phone number"),url:w.string().min(1,"URL is required").url("Please enter a valid URL"),required:w.string().min(1,"This field is required"),positiveNumber:w.number().positive("Must be a positive number"),integer:w.number().int("Must be a whole number"),futureDate:w.date().min(new Date,"Date must be in the future"),imageFile:w.instanceof(File).refine((t)=>t.size<=5242880,"File size must be less than 5MB").refine((t)=>["image/jpeg","image/png","image/gif","image/webp"].includes(t.type),"File must be a JPEG, PNG, GIF, or WebP image"),userProfile:w.object({full_name:w.string().min(2,"Full name must be at least 2 characters").max(100,"Full name is too long").optional(),bio:w.string().max(500,"Bio must be less than 500 characters").nullable().optional(),avatar_url:w.string().url("Please enter a valid URL").nullable().optional(),theme:w.enum(["africanity","dark","light","system"]).optional(),language:w.string().min(2).max(10).optional()}),project:w.object({name:w.string().min(1,"Project name is required").max(100,"Project name is too long"),description:w.string().max(1000,"Description is too long").nullable().optional(),repository_url:w.string().url("Please enter a valid repository URL").nullable().optional(),demo_url:w.string().url("Please enter a valid demo URL").nullable().optional(),tags:w.array(w.string()).optional(),is_public:w.boolean().optional()})};i={required:(t="This field is required")=>w.string().min(1,t),email:(t="Please enter a valid email address")=>w.string().email(t),minLength:(t,n)=>w.string().min(t,n||`Must be at least ${t} characters`),maxLength:(t,n)=>w.string().max(t,n||`Must be less than ${t} characters`),pattern:(t,n)=>w.string().regex(t,n),numeric:(t="Must be a number")=>w.string().regex(/^\d+$/,t),phone:(t="Please enter a valid phone number")=>w.string().regex(/^[\+]?[1-9][\d]{0,15}$/,t),url:(t="Please enter a valid URL")=>w.string().min(1,"URL is required").url(t)}});var R0={};Q(R0,{default:()=>vl,AfriInput:()=>it});var it,vl;var D0=Y(()=>{M();Cn();it=class it extends c{static get observedAttributes(){return["type","name","label","placeholder","error","helper","theme","icon","required","aria-label","aria-describedby","validation"]}constructor(){super();this._uniqueId=Math.random().toString(36).substr(2,9),this.render()}get value(){return this.shadowRoot.querySelector("input")?.value||""}set value(t){let n=this.shadowRoot.querySelector("input");if(n)n.value=t}connectedCallback(){this._attachInputListeners(),this.loadStyles()}attributeChangedCallback(){this.render(),this._attachInputListeners()}_attachInputListeners(){let t=this.shadowRoot.querySelector("input");if(!t)return;t.addEventListener("input",(n)=>{if(this.emit("af-input",{value:n.target.value}),this.hasAttribute("error"))this.removeAttribute("error")}),t.addEventListener("blur",()=>{this.emit("af-blur",{value:this.value}),this._validateInput()})}_setupValidation(){if(!this.getAttribute("validation"))return;let n=this.shadowRoot.querySelector("input");if(!n)return;n.addEventListener("input",()=>{if(this.hasAttribute("error"))this.removeAttribute("error")})}_validateInput(){let t=this.shadowRoot.querySelector("input");if(!t)return;let n=this.getAttribute("validation"),o=t.value;if(this.hasAttribute("required")&&!o.trim()){this.setAttribute("error","This field is required");return}if(n&&o.trim()){let l=this._getValidationSchema(n);if(l){let a=Dt.validateField(l,o);if(!a.success)this.setAttribute("error",a.error);else this.removeAttribute("error")}}}_getValidationSchema(t){let n={email:i.email(),password:i.password(),phone:i.phone(),url:i.url(),required:i.required()};if(t.includes(":")){let[o,b]=t.split(":"),l=parseInt(b);switch(o){case"minLength":return i.minLength(l);case"maxLength":return i.maxLength(l);case"pattern":return i.pattern(new RegExp(b),"Invalid format")}}return n[t]||null}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("type")||"text",n=this.getAttribute("name")||"",o=this.getAttribute("label")||"",b=this.getAttribute("placeholder")||"",l=this.getAttribute("error")||"",a=this.getAttribute("helper")||"",f=this.getAttribute("theme")||"tanzania",h=this.getAttribute("icon")||"",g=this.hasAttribute("required"),_=this.getAttribute("aria-label"),X=this.getAttribute("aria-describedby"),L={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},G=L[f]||L.tanzania,R=[];if(l)R.push(`error-${this._uniqueId}`);else if(a)R.push(`helper-${this._uniqueId}`);if(X)R.push(...X.split(" "));let An=R.length>0?`aria-describedby="${R.join(" ")}"`:"";this.shadowRoot.innerHTML=`
|
|
748
|
+
`}};A("af-navbar",Vt);ob=Vt});var k,Nn,$,N=(t)=>{switch(typeof t){case"undefined":return $.undefined;case"string":return $.string;case"number":return Number.isNaN(t)?$.nan:$.number;case"boolean":return $.boolean;case"function":return $.function;case"bigint":return $.bigint;case"symbol":return $.symbol;case"object":if(Array.isArray(t))return $.array;if(t===null)return $.null;if(t.then&&typeof t.then==="function"&&t.catch&&typeof t.catch==="function")return $.promise;if(typeof Map<"u"&&t instanceof Map)return $.map;if(typeof Set<"u"&&t instanceof Set)return $.set;if(typeof Date<"u"&&t instanceof Date)return $.date;return $.object;default:return $.unknown}};var Mt=x(()=>{(function(t){t.assertEqual=(l)=>{};function n(l){}t.assertIs=n;function o(l){throw Error()}t.assertNever=o,t.arrayToEnum=(l)=>{let a={};for(let f of l)a[f]=f;return a},t.getValidEnumValues=(l)=>{let a=t.objectKeys(l).filter((h)=>typeof l[l[h]]!=="number"),f={};for(let h of a)f[h]=l[h];return t.objectValues(f)},t.objectValues=(l)=>{return t.objectKeys(l).map(function(a){return l[a]})},t.objectKeys=typeof Object.keys==="function"?(l)=>Object.keys(l):(l)=>{let a=[];for(let f in l)if(Object.prototype.hasOwnProperty.call(l,f))a.push(f);return a},t.find=(l,a)=>{for(let f of l)if(a(f))return f;return},t.isInteger=typeof Number.isInteger==="function"?(l)=>Number.isInteger(l):(l)=>typeof l==="number"&&Number.isFinite(l)&&Math.floor(l)===l;function b(l,a=" | "){return l.map((f)=>typeof f==="string"?`'${f}'`:f).join(a)}t.joinValues=b,t.jsonStringifyReplacer=(l,a)=>{if(typeof a==="bigint")return a.toString();return a}})(k||(k={}));(function(t){t.mergeShapes=(n,o)=>{return{...n,...o}}})(Nn||(Nn={}));$=k.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var g,bb=(t)=>{return JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:")},O;var jt=x(()=>{Mt();g=k.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);O=class O extends Error{get errors(){return this.issues}constructor(t){super();this.issues=[],this.addIssue=(o)=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let n=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,n);else this.__proto__=n;this.name="ZodError",this.issues=t}format(t){let n=t||function(l){return l.message},o={_errors:[]},b=(l)=>{for(let a of l.issues)if(a.code==="invalid_union")a.unionErrors.map(b);else if(a.code==="invalid_return_type")b(a.returnTypeError);else if(a.code==="invalid_arguments")b(a.argumentsError);else if(a.path.length===0)o._errors.push(n(a));else{let f=o,h=0;while(h<a.path.length){let r=a.path[h];if(h!==a.path.length-1)f[r]=f[r]||{_errors:[]};else f[r]=f[r]||{_errors:[]},f[r]._errors.push(n(a));f=f[r],h++}}};return b(this),o}static assert(t){if(!(t instanceof O))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,k.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=(n)=>n.message){let n={},o=[];for(let b of this.issues)if(b.path.length>0){let l=b.path[0];n[l]=n[l]||[],n[l].push(t(b))}else o.push(t(b));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}};O.create=(t)=>{return new O(t)}});var lb=(t,n)=>{let o;switch(t.code){case g.invalid_type:if(t.received===$.undefined)o="Required";else o=`Expected ${t.expected}, received ${t.received}`;break;case g.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(t.expected,k.jsonStringifyReplacer)}`;break;case g.unrecognized_keys:o=`Unrecognized key(s) in object: ${k.joinValues(t.keys,", ")}`;break;case g.invalid_union:o="Invalid input";break;case g.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${k.joinValues(t.options)}`;break;case g.invalid_enum_value:o=`Invalid enum value. Expected ${k.joinValues(t.options)}, received '${t.received}'`;break;case g.invalid_arguments:o="Invalid function arguments";break;case g.invalid_return_type:o="Invalid function return type";break;case g.invalid_date:o="Invalid date";break;case g.invalid_string:if(typeof t.validation==="object")if("includes"in t.validation){if(o=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position==="number")o=`${o} at one or more positions greater than or equal to ${t.validation.position}`}else if("startsWith"in t.validation)o=`Invalid input: must start with "${t.validation.startsWith}"`;else if("endsWith"in t.validation)o=`Invalid input: must end with "${t.validation.endsWith}"`;else k.assertNever(t.validation);else if(t.validation!=="regex")o=`Invalid ${t.validation}`;else o="Invalid";break;case g.too_small:if(t.type==="array")o=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`;else if(t.type==="string")o=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`;else if(t.type==="number")o=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="bigint")o=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="date")o=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`;else o="Invalid input";break;case g.too_big:if(t.type==="array")o=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`;else if(t.type==="string")o=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`;else if(t.type==="number")o=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="bigint")o=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="date")o=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`;else o="Invalid input";break;case g.custom:o="Invalid input";break;case g.invalid_intersection_types:o="Intersection results could not be merged";break;case g.not_multiple_of:o=`Number must be a multiple of ${t.multipleOf}`;break;case g.not_finite:o="Number must be finite";break;default:o=n.defaultError,k.assertNever(t)}return{message:o}},u;var Kn=x(()=>{jt();Mt();u=lb});function ab(t){A0=t}function ft(){return A0}var A0;var Nt=x(()=>{Kn();A0=u});function v(t,n){let o=ft(),b=Qt({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,o,o===u?void 0:u].filter((l)=>!!l)});t.common.issues.push(b)}class F{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(t,n){let o=[];for(let b of n){if(b.status==="aborted")return H;if(b.status==="dirty")t.dirty();o.push(b.value)}return{status:t.value,value:o}}static async mergeObjectAsync(t,n){let o=[];for(let b of n){let l=await b.key,a=await b.value;o.push({key:l,value:a})}return F.mergeObjectSync(t,o)}static mergeObjectSync(t,n){let o={};for(let b of n){let{key:l,value:a}=b;if(l.status==="aborted")return H;if(a.status==="aborted")return H;if(l.status==="dirty")t.dirty();if(a.status==="dirty")t.dirty();if(l.value!=="__proto__"&&(typeof a.value<"u"||b.alwaysSet))o[l.value]=a.value}return{status:t.value,value:o}}}var Qt=(t)=>{let{data:n,path:o,errorMaps:b,issueData:l}=t,a=[...o,...l.path||[]],f={...l,path:a};if(l.message!==void 0)return{...l,path:a,message:l.message};let h="",r=b.filter((_)=>!!_).slice().reverse();for(let _ of r)h=_(f,{data:n,defaultError:h}).message;return{...l,path:a,message:h}},fb,H,tt=(t)=>({status:"dirty",value:t}),R=(t)=>({status:"valid",value:t}),Kt=(t)=>t.status==="aborted",pt=(t)=>t.status==="dirty",C=(t)=>t.status==="valid",ht=(t)=>typeof Promise<"u"&&t instanceof Promise;var pn=x(()=>{Nt();Kn();fb=[];H=Object.freeze({status:"aborted"})});var q0=()=>{};var q;var H0=x(()=>{(function(t){t.errToObj=(n)=>typeof n==="string"?{message:n}:n||{},t.toString=(n)=>typeof n==="string"?n:n?.message})(q||(q={}))});class V{constructor(t,n,o,b){this._cachedPath=[],this.parent=t,this.data=n,this._path=o,this._key=b}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function Y(t){if(!t)return{};let{errorMap:n,invalid_type_error:o,required_error:b,description:l}=t;if(n&&(o||b))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(n)return{errorMap:n,description:l};return{errorMap:(f,h)=>{let{message:r}=t;if(f.code==="invalid_enum_value")return{message:r??h.defaultError};if(typeof h.data>"u")return{message:r??b??h.defaultError};if(f.code!=="invalid_type")return{message:h.defaultError};return{message:r??o??h.defaultError}},description:l}}class X{get description(){return this._def.description}_getType(t){return N(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:N(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new F,ctx:{common:t.parent.common,data:t.data,parsedType:N(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(ht(n))throw Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let o=this.safeParse(t,n);if(o.success)return o.data;throw o.error}safeParse(t,n){let o={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:N(t)},b=this._parseSync({data:t,path:o.path,parent:o});return E0(o,b)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:N(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:n});return C(o)?{value:o.value}:{issues:n.common.issues}}catch(o){if(o?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then((o)=>C(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){let o=await this.safeParseAsync(t,n);if(o.success)return o.data;throw o.error}async safeParseAsync(t,n){let o={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:N(t)},b=this._parse({data:t,path:o.path,parent:o}),l=await(ht(b)?b:Promise.resolve(b));return E0(o,l)}refine(t,n){let o=(b)=>{if(typeof n==="string"||typeof n>"u")return{message:n};else if(typeof n==="function")return n(b);else return n};return this._refinement((b,l)=>{let a=t(b),f=()=>l.addIssue({code:g.custom,...o(b)});if(typeof Promise<"u"&&a instanceof Promise)return a.then((h)=>{if(!h)return f(),!1;else return!0});if(!a)return f(),!1;else return!0})}refinement(t,n){return this._refinement((o,b)=>{if(!t(o))return b.addIssue(typeof n==="function"?n(o,b):n),!1;else return!0})}_refinement(t){return new j({schema:this,typeName:E.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(n)=>this["~validate"](n)}}optional(){return U.create(this,this._def)}nullable(){return i.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return d.create(this)}promise(){return lt.create(this,this._def)}or(t){return ct.create([this,t],this._def)}and(t){return _t.create(this,t,this._def)}transform(t){return new j({...Y(this._def),schema:this,typeName:E.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t==="function"?t:()=>t;return new Et({...Y(this._def),innerType:this,defaultValue:n,typeName:E.ZodDefault})}brand(){return new It({typeName:E.ZodBranded,type:this,...Y(this._def)})}catch(t){let n=typeof t==="function"?t:()=>t;return new xt({...Y(this._def),innerType:this,catchValue:n,typeName:E.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return Rt.create(this,t)}readonly(){return Yt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function X0(t){let n="[0-5]\\d";if(t.precision)n=`${n}\\.\\d{${t.precision}}`;else if(t.precision==null)n=`${n}(\\.\\d+)?`;let o=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${n})${o}`}function kb(t){return new RegExp(`^${X0(t)}$`)}function S0(t){let n=`${Y0}T${X0(t)}`,o=[];if(o.push(t.local?"Z?":"Z"),t.offset)o.push("([+-]\\d{2}:?\\d{2})");return n=`${n}(${o.join("|")})`,new RegExp(`^${n}$`)}function Mb(t,n){if((n==="v4"||!n)&&qb.test(t))return!0;if((n==="v6"||!n)&&Eb.test(t))return!0;return!1}function Qb(t,n){if(!wb.test(t))return!1;try{let[o]=t.split(".");if(!o)return!1;let b=o.replace(/-/g,"+").replace(/_/g,"/").padEnd(o.length+(4-o.length%4)%4,"="),l=JSON.parse(atob(b));if(typeof l!=="object"||l===null)return!1;if("typ"in l&&l?.typ!=="JWT")return!1;if(!l.alg)return!1;if(n&&l.alg!==n)return!1;return!0}catch{return!1}}function Jb(t,n){if((n==="v4"||!n)&&Hb.test(t))return!0;if((n==="v6"||!n)&&xb.test(t))return!0;return!1}function Gb(t,n){let o=(t.toString().split(".")[1]||"").length,b=(n.toString().split(".")[1]||"").length,l=o>b?o:b,a=Number.parseInt(t.toFixed(l).replace(".","")),f=Number.parseInt(n.toFixed(l).replace(".",""));return a%f/10**l}function rt(t){if(t instanceof J){let n={};for(let o in t.shape){let b=t.shape[o];n[o]=U.create(rt(b))}return new J({...t._def,shape:()=>n})}else if(t instanceof d)return new d({...t._def,type:rt(t.element)});else if(t instanceof U)return U.create(rt(t.unwrap()));else if(t instanceof i)return i.create(rt(t.unwrap()));else if(t instanceof p)return p.create(t.items.map((n)=>rt(n)));else return t}function In(t,n){let o=N(t),b=N(n);if(t===n)return{valid:!0,data:t};else if(o===$.object&&b===$.object){let l=k.objectKeys(n),a=k.objectKeys(t).filter((h)=>l.indexOf(h)!==-1),f={...t,...n};for(let h of a){let r=In(t[h],n[h]);if(!r.valid)return{valid:!1};f[h]=r.data}return{valid:!0,data:f}}else if(o===$.array&&b===$.array){if(t.length!==n.length)return{valid:!1};let l=[];for(let a=0;a<t.length;a++){let f=t[a],h=n[a],r=In(f,h);if(!r.valid)return{valid:!1};l.push(r.data)}return{valid:!0,data:l}}else if(o===$.date&&b===$.date&&+t===+n)return{valid:!0,data:t};else return{valid:!1}}function k0(t,n){return new s({values:t,typeName:E.ZodEnum,...Y(n)})}function x0(t,n){let o=typeof t==="function"?t(n):typeof t==="string"?{message:t}:t;return typeof o==="string"?{message:o}:o}function M0(t,n={},o){if(t)return ot.create().superRefine((b,l)=>{let a=t(b);if(a instanceof Promise)return a.then((f)=>{if(!f){let h=x0(n,b),r=h.fatal??o??!0;l.addIssue({code:"custom",...h,fatal:r})}});if(!a){let f=x0(n,b),h=f.fatal??o??!0;l.addIssue({code:"custom",...f,fatal:h})}return});return ot.create()}var E0=(t,n)=>{if(C(n))return{success:!0,data:n.value};else{if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let o=new O(t.common.issues);return this._error=o,this._error}}}},hb,rb,gb,$b,vb,wb,cb,_b,Ab="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",un,qb,Hb,Eb,xb,Yb,Xb,Y0="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Sb,W,Z,e,$t,nt,Jt,vt,wt,ot,y,K,Gt,d,J,ct,I=(t)=>{if(t instanceof At)return I(t.schema);else if(t instanceof j)return I(t.innerType());else if(t instanceof qt)return[t.value];else if(t instanceof s)return t.options;else if(t instanceof Ht)return k.objectValues(t.enum);else if(t instanceof Et)return I(t._def.innerType);else if(t instanceof vt)return[void 0];else if(t instanceof wt)return[null];else if(t instanceof U)return[void 0,...I(t.unwrap())];else if(t instanceof i)return[null,...I(t.unwrap())];else if(t instanceof It)return I(t.unwrap());else if(t instanceof Yt)return I(t.unwrap());else if(t instanceof xt)return I(t._def.innerType);else return[]},ut,_t,p,Lt,Ft,bt,gt,At,qt,s,Ht,lt,j,U,i,Et,xt,mt,Lb,It,Rt,Yt,Fb,E,mb=(t,n={message:`Input not instance of ${t.name}`})=>M0((o)=>o instanceof t,n),Q0,J0,Rb,Bb,G0,Db,Ob,Wb,db,Ub,Vb,jb,Nb,Kb,pb,ub,Ib,ib,Pb,Tb,Cb,yb,Zb,eb,sb,zb,tl,nl,ol,bl,ll,al,fl,hl,rl=()=>Q0().optional(),gl=()=>J0().optional(),$l=()=>G0().optional(),vl,wl;var L0=x(()=>{jt();Nt();H0();pn();Mt();hb=/^c[^\s-]{8,}$/i,rb=/^[0-9a-z]+$/,gb=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$b=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,vb=/^[a-z0-9_-]{21}$/i,wb=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,cb=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_b=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,qb=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Hb=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Eb=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,xb=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Yb=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Xb=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Sb=new RegExp(`^${Y0}$`);W=class W extends X{_parse(t){if(this._def.coerce)t.data=String(t.data);if(this._getType(t)!==$.string){let l=this._getOrReturnCtx(t);return v(l,{code:g.invalid_type,expected:$.string,received:l.parsedType}),H}let o=new F,b=void 0;for(let l of this._def.checks)if(l.kind==="min"){if(t.data.length<l.value)b=this._getOrReturnCtx(t,b),v(b,{code:g.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty()}else if(l.kind==="max"){if(t.data.length>l.value)b=this._getOrReturnCtx(t,b),v(b,{code:g.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty()}else if(l.kind==="length"){let a=t.data.length>l.value,f=t.data.length<l.value;if(a||f){if(b=this._getOrReturnCtx(t,b),a)v(b,{code:g.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message});else if(f)v(b,{code:g.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message});o.dirty()}}else if(l.kind==="email"){if(!_b.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"email",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="emoji"){if(!un)un=new RegExp(Ab,"u");if(!un.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"emoji",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="uuid"){if(!$b.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"uuid",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="nanoid"){if(!vb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"nanoid",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="cuid"){if(!hb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"cuid",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="cuid2"){if(!rb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"cuid2",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="ulid"){if(!gb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"ulid",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="url")try{new URL(t.data)}catch{b=this._getOrReturnCtx(t,b),v(b,{validation:"url",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="regex"){if(l.regex.lastIndex=0,!l.regex.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"regex",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="trim")t.data=t.data.trim();else if(l.kind==="includes"){if(!t.data.includes(l.value,l.position))b=this._getOrReturnCtx(t,b),v(b,{code:g.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()}else if(l.kind==="toLowerCase")t.data=t.data.toLowerCase();else if(l.kind==="toUpperCase")t.data=t.data.toUpperCase();else if(l.kind==="startsWith"){if(!t.data.startsWith(l.value))b=this._getOrReturnCtx(t,b),v(b,{code:g.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()}else if(l.kind==="endsWith"){if(!t.data.endsWith(l.value))b=this._getOrReturnCtx(t,b),v(b,{code:g.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()}else if(l.kind==="datetime"){if(!S0(l).test(t.data))b=this._getOrReturnCtx(t,b),v(b,{code:g.invalid_string,validation:"datetime",message:l.message}),o.dirty()}else if(l.kind==="date"){if(!Sb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{code:g.invalid_string,validation:"date",message:l.message}),o.dirty()}else if(l.kind==="time"){if(!kb(l).test(t.data))b=this._getOrReturnCtx(t,b),v(b,{code:g.invalid_string,validation:"time",message:l.message}),o.dirty()}else if(l.kind==="duration"){if(!cb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"duration",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="ip"){if(!Mb(t.data,l.version))b=this._getOrReturnCtx(t,b),v(b,{validation:"ip",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="jwt"){if(!Qb(t.data,l.alg))b=this._getOrReturnCtx(t,b),v(b,{validation:"jwt",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="cidr"){if(!Jb(t.data,l.version))b=this._getOrReturnCtx(t,b),v(b,{validation:"cidr",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="base64"){if(!Yb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"base64",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="base64url"){if(!Xb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"base64url",code:g.invalid_string,message:l.message}),o.dirty()}else k.assertNever(l);return{status:o.value,value:t.data}}_regex(t,n,o){return this.refinement((b)=>t.test(b),{validation:n,code:g.invalid_string,...q.errToObj(o)})}_addCheck(t){return new W({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...q.errToObj(t)})}url(t){return this._addCheck({kind:"url",...q.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...q.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...q.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...q.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...q.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...q.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...q.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...q.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...q.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...q.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...q.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...q.errToObj(t)})}datetime(t){if(typeof t==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t});return this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...q.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){if(typeof t==="string")return this._addCheck({kind:"time",precision:null,message:t});return this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...q.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...q.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...q.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...q.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...q.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...q.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...q.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...q.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...q.errToObj(n)})}nonempty(t){return this.min(1,q.errToObj(t))}trim(){return new W({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new W({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new W({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((t)=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find((t)=>t.kind==="date")}get isTime(){return!!this._def.checks.find((t)=>t.kind==="time")}get isDuration(){return!!this._def.checks.find((t)=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find((t)=>t.kind==="email")}get isURL(){return!!this._def.checks.find((t)=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find((t)=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find((t)=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((t)=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((t)=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((t)=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find((t)=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find((t)=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find((t)=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find((t)=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find((t)=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t}get maxLength(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t}};W.create=(t)=>{return new W({checks:[],typeName:E.ZodString,coerce:t?.coerce??!1,...Y(t)})};Z=class Z extends X{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce)t.data=Number(t.data);if(this._getType(t)!==$.number){let l=this._getOrReturnCtx(t);return v(l,{code:g.invalid_type,expected:$.number,received:l.parsedType}),H}let o=void 0,b=new F;for(let l of this._def.checks)if(l.kind==="int"){if(!k.isInteger(t.data))o=this._getOrReturnCtx(t,o),v(o,{code:g.invalid_type,expected:"integer",received:"float",message:l.message}),b.dirty()}else if(l.kind==="min"){if(l.inclusive?t.data<l.value:t.data<=l.value)o=this._getOrReturnCtx(t,o),v(o,{code:g.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),b.dirty()}else if(l.kind==="max"){if(l.inclusive?t.data>l.value:t.data>=l.value)o=this._getOrReturnCtx(t,o),v(o,{code:g.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),b.dirty()}else if(l.kind==="multipleOf"){if(Gb(t.data,l.value)!==0)o=this._getOrReturnCtx(t,o),v(o,{code:g.not_multiple_of,multipleOf:l.value,message:l.message}),b.dirty()}else if(l.kind==="finite"){if(!Number.isFinite(t.data))o=this._getOrReturnCtx(t,o),v(o,{code:g.not_finite,message:l.message}),b.dirty()}else k.assertNever(l);return{status:b.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,q.toString(n))}gt(t,n){return this.setLimit("min",t,!1,q.toString(n))}lte(t,n){return this.setLimit("max",t,!0,q.toString(n))}lt(t,n){return this.setLimit("max",t,!1,q.toString(n))}setLimit(t,n,o,b){return new Z({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:q.toString(b)}]})}_addCheck(t){return new Z({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:q.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:q.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:q.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:q.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:q.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:q.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t}get maxValue(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t}get isInt(){return!!this._def.checks.find((t)=>t.kind==="int"||t.kind==="multipleOf"&&k.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let o of this._def.checks)if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;else if(o.kind==="min"){if(n===null||o.value>n)n=o.value}else if(o.kind==="max"){if(t===null||o.value<t)t=o.value}return Number.isFinite(n)&&Number.isFinite(t)}};Z.create=(t)=>{return new Z({checks:[],typeName:E.ZodNumber,coerce:t?.coerce||!1,...Y(t)})};e=class e extends X{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==$.bigint)return this._getInvalidInput(t);let o=void 0,b=new F;for(let l of this._def.checks)if(l.kind==="min"){if(l.inclusive?t.data<l.value:t.data<=l.value)o=this._getOrReturnCtx(t,o),v(o,{code:g.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),b.dirty()}else if(l.kind==="max"){if(l.inclusive?t.data>l.value:t.data>=l.value)o=this._getOrReturnCtx(t,o),v(o,{code:g.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),b.dirty()}else if(l.kind==="multipleOf"){if(t.data%l.value!==BigInt(0))o=this._getOrReturnCtx(t,o),v(o,{code:g.not_multiple_of,multipleOf:l.value,message:l.message}),b.dirty()}else k.assertNever(l);return{status:b.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return v(n,{code:g.invalid_type,expected:$.bigint,received:n.parsedType}),H}gte(t,n){return this.setLimit("min",t,!0,q.toString(n))}gt(t,n){return this.setLimit("min",t,!1,q.toString(n))}lte(t,n){return this.setLimit("max",t,!0,q.toString(n))}lt(t,n){return this.setLimit("max",t,!1,q.toString(n))}setLimit(t,n,o,b){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:q.toString(b)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:q.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:q.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t}get maxValue(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t}};e.create=(t)=>{return new e({checks:[],typeName:E.ZodBigInt,coerce:t?.coerce??!1,...Y(t)})};$t=class $t extends X{_parse(t){if(this._def.coerce)t.data=Boolean(t.data);if(this._getType(t)!==$.boolean){let o=this._getOrReturnCtx(t);return v(o,{code:g.invalid_type,expected:$.boolean,received:o.parsedType}),H}return R(t.data)}};$t.create=(t)=>{return new $t({typeName:E.ZodBoolean,coerce:t?.coerce||!1,...Y(t)})};nt=class nt extends X{_parse(t){if(this._def.coerce)t.data=new Date(t.data);if(this._getType(t)!==$.date){let l=this._getOrReturnCtx(t);return v(l,{code:g.invalid_type,expected:$.date,received:l.parsedType}),H}if(Number.isNaN(t.data.getTime())){let l=this._getOrReturnCtx(t);return v(l,{code:g.invalid_date}),H}let o=new F,b=void 0;for(let l of this._def.checks)if(l.kind==="min"){if(t.data.getTime()<l.value)b=this._getOrReturnCtx(t,b),v(b,{code:g.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()}else if(l.kind==="max"){if(t.data.getTime()>l.value)b=this._getOrReturnCtx(t,b),v(b,{code:g.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()}else k.assertNever(l);return{status:o.value,value:new Date(t.data.getTime())}}_addCheck(t){return new nt({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:q.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:q.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t!=null?new Date(t):null}};nt.create=(t)=>{return new nt({checks:[],coerce:t?.coerce||!1,typeName:E.ZodDate,...Y(t)})};Jt=class Jt extends X{_parse(t){if(this._getType(t)!==$.symbol){let o=this._getOrReturnCtx(t);return v(o,{code:g.invalid_type,expected:$.symbol,received:o.parsedType}),H}return R(t.data)}};Jt.create=(t)=>{return new Jt({typeName:E.ZodSymbol,...Y(t)})};vt=class vt extends X{_parse(t){if(this._getType(t)!==$.undefined){let o=this._getOrReturnCtx(t);return v(o,{code:g.invalid_type,expected:$.undefined,received:o.parsedType}),H}return R(t.data)}};vt.create=(t)=>{return new vt({typeName:E.ZodUndefined,...Y(t)})};wt=class wt extends X{_parse(t){if(this._getType(t)!==$.null){let o=this._getOrReturnCtx(t);return v(o,{code:g.invalid_type,expected:$.null,received:o.parsedType}),H}return R(t.data)}};wt.create=(t)=>{return new wt({typeName:E.ZodNull,...Y(t)})};ot=class ot extends X{constructor(){super(...arguments);this._any=!0}_parse(t){return R(t.data)}};ot.create=(t)=>{return new ot({typeName:E.ZodAny,...Y(t)})};y=class y extends X{constructor(){super(...arguments);this._unknown=!0}_parse(t){return R(t.data)}};y.create=(t)=>{return new y({typeName:E.ZodUnknown,...Y(t)})};K=class K extends X{_parse(t){let n=this._getOrReturnCtx(t);return v(n,{code:g.invalid_type,expected:$.never,received:n.parsedType}),H}};K.create=(t)=>{return new K({typeName:E.ZodNever,...Y(t)})};Gt=class Gt extends X{_parse(t){if(this._getType(t)!==$.undefined){let o=this._getOrReturnCtx(t);return v(o,{code:g.invalid_type,expected:$.void,received:o.parsedType}),H}return R(t.data)}};Gt.create=(t)=>{return new Gt({typeName:E.ZodVoid,...Y(t)})};d=class d extends X{_parse(t){let{ctx:n,status:o}=this._processInputParams(t),b=this._def;if(n.parsedType!==$.array)return v(n,{code:g.invalid_type,expected:$.array,received:n.parsedType}),H;if(b.exactLength!==null){let a=n.data.length>b.exactLength.value,f=n.data.length<b.exactLength.value;if(a||f)v(n,{code:a?g.too_big:g.too_small,minimum:f?b.exactLength.value:void 0,maximum:a?b.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:b.exactLength.message}),o.dirty()}if(b.minLength!==null){if(n.data.length<b.minLength.value)v(n,{code:g.too_small,minimum:b.minLength.value,type:"array",inclusive:!0,exact:!1,message:b.minLength.message}),o.dirty()}if(b.maxLength!==null){if(n.data.length>b.maxLength.value)v(n,{code:g.too_big,maximum:b.maxLength.value,type:"array",inclusive:!0,exact:!1,message:b.maxLength.message}),o.dirty()}if(n.common.async)return Promise.all([...n.data].map((a,f)=>{return b.type._parseAsync(new V(n,a,n.path,f))})).then((a)=>{return F.mergeArray(o,a)});let l=[...n.data].map((a,f)=>{return b.type._parseSync(new V(n,a,n.path,f))});return F.mergeArray(o,l)}get element(){return this._def.type}min(t,n){return new d({...this._def,minLength:{value:t,message:q.toString(n)}})}max(t,n){return new d({...this._def,maxLength:{value:t,message:q.toString(n)}})}length(t,n){return new d({...this._def,exactLength:{value:t,message:q.toString(n)}})}nonempty(t){return this.min(1,t)}};d.create=(t,n)=>{return new d({type:t,minLength:null,maxLength:null,exactLength:null,typeName:E.ZodArray,...Y(n)})};J=class J extends X{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=k.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==$.object){let r=this._getOrReturnCtx(t);return v(r,{code:g.invalid_type,expected:$.object,received:r.parsedType}),H}let{status:o,ctx:b}=this._processInputParams(t),{shape:l,keys:a}=this._getCached(),f=[];if(!(this._def.catchall instanceof K&&this._def.unknownKeys==="strip")){for(let r in b.data)if(!a.includes(r))f.push(r)}let h=[];for(let r of a){let _=l[r],S=b.data[r];h.push({key:{status:"valid",value:r},value:_._parse(new V(b,S,b.path,r)),alwaysSet:r in b.data})}if(this._def.catchall instanceof K){let r=this._def.unknownKeys;if(r==="passthrough")for(let _ of f)h.push({key:{status:"valid",value:_},value:{status:"valid",value:b.data[_]}});else if(r==="strict"){if(f.length>0)v(b,{code:g.unrecognized_keys,keys:f}),o.dirty()}else if(r==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let r=this._def.catchall;for(let _ of f){let S=b.data[_];h.push({key:{status:"valid",value:_},value:r._parse(new V(b,S,b.path,_)),alwaysSet:_ in b.data})}}if(b.common.async)return Promise.resolve().then(async()=>{let r=[];for(let _ of h){let S=await _.key,L=await _.value;r.push({key:S,value:L,alwaysSet:_.alwaysSet})}return r}).then((r)=>{return F.mergeObjectSync(o,r)});else return F.mergeObjectSync(o,h)}get shape(){return this._def.shape()}strict(t){return q.errToObj,new J({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,o)=>{let b=this._def.errorMap?.(n,o).message??o.defaultError;if(n.code==="unrecognized_keys")return{message:q.errToObj(t).message??b};return{message:b}}}:{}})}strip(){return new J({...this._def,unknownKeys:"strip"})}passthrough(){return new J({...this._def,unknownKeys:"passthrough"})}extend(t){return new J({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new J({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:E.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new J({...this._def,catchall:t})}pick(t){let n={};for(let o of k.objectKeys(t))if(t[o]&&this.shape[o])n[o]=this.shape[o];return new J({...this._def,shape:()=>n})}omit(t){let n={};for(let o of k.objectKeys(this.shape))if(!t[o])n[o]=this.shape[o];return new J({...this._def,shape:()=>n})}deepPartial(){return rt(this)}partial(t){let n={};for(let o of k.objectKeys(this.shape)){let b=this.shape[o];if(t&&!t[o])n[o]=b;else n[o]=b.optional()}return new J({...this._def,shape:()=>n})}required(t){let n={};for(let o of k.objectKeys(this.shape))if(t&&!t[o])n[o]=this.shape[o];else{let l=this.shape[o];while(l instanceof U)l=l._def.innerType;n[o]=l}return new J({...this._def,shape:()=>n})}keyof(){return k0(k.objectKeys(this.shape))}};J.create=(t,n)=>{return new J({shape:()=>t,unknownKeys:"strip",catchall:K.create(),typeName:E.ZodObject,...Y(n)})};J.strictCreate=(t,n)=>{return new J({shape:()=>t,unknownKeys:"strict",catchall:K.create(),typeName:E.ZodObject,...Y(n)})};J.lazycreate=(t,n)=>{return new J({shape:t,unknownKeys:"strip",catchall:K.create(),typeName:E.ZodObject,...Y(n)})};ct=class ct extends X{_parse(t){let{ctx:n}=this._processInputParams(t),o=this._def.options;function b(l){for(let f of l)if(f.result.status==="valid")return f.result;for(let f of l)if(f.result.status==="dirty")return n.common.issues.push(...f.ctx.common.issues),f.result;let a=l.map((f)=>new O(f.ctx.common.issues));return v(n,{code:g.invalid_union,unionErrors:a}),H}if(n.common.async)return Promise.all(o.map(async(l)=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(b);else{let l=void 0,a=[];for(let h of o){let r={...n,common:{...n.common,issues:[]},parent:null},_=h._parseSync({data:n.data,path:n.path,parent:r});if(_.status==="valid")return _;else if(_.status==="dirty"&&!l)l={result:_,ctx:r};if(r.common.issues.length)a.push(r.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;let f=a.map((h)=>new O(h));return v(n,{code:g.invalid_union,unionErrors:f}),H}}get options(){return this._def.options}};ct.create=(t,n)=>{return new ct({options:t,typeName:E.ZodUnion,...Y(n)})};ut=class ut extends X{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$.object)return v(n,{code:g.invalid_type,expected:$.object,received:n.parsedType}),H;let o=this.discriminator,b=n.data[o],l=this.optionsMap.get(b);if(!l)return v(n,{code:g.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),H;if(n.common.async)return l._parseAsync({data:n.data,path:n.path,parent:n});else return l._parseSync({data:n.data,path:n.path,parent:n})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,o){let b=new Map;for(let l of n){let a=I(l.shape[t]);if(!a.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let f of a){if(b.has(f))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(f)}`);b.set(f,l)}}return new ut({typeName:E.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:b,...Y(o)})}};_t=class _t extends X{_parse(t){let{status:n,ctx:o}=this._processInputParams(t),b=(l,a)=>{if(Kt(l)||Kt(a))return H;let f=In(l.value,a.value);if(!f.valid)return v(o,{code:g.invalid_intersection_types}),H;if(pt(l)||pt(a))n.dirty();return{status:n.value,value:f.data}};if(o.common.async)return Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,a])=>b(l,a));else return b(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};_t.create=(t,n,o)=>{return new _t({left:t,right:n,typeName:E.ZodIntersection,...Y(o)})};p=class p extends X{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==$.array)return v(o,{code:g.invalid_type,expected:$.array,received:o.parsedType}),H;if(o.data.length<this._def.items.length)return v(o,{code:g.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),H;if(!this._def.rest&&o.data.length>this._def.items.length)v(o,{code:g.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty();let l=[...o.data].map((a,f)=>{let h=this._def.items[f]||this._def.rest;if(!h)return null;return h._parse(new V(o,a,o.path,f))}).filter((a)=>!!a);if(o.common.async)return Promise.all(l).then((a)=>{return F.mergeArray(n,a)});else return F.mergeArray(n,l)}get items(){return this._def.items}rest(t){return new p({...this._def,rest:t})}};p.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new p({items:t,typeName:E.ZodTuple,rest:null,...Y(n)})};Lt=class Lt extends X{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==$.object)return v(o,{code:g.invalid_type,expected:$.object,received:o.parsedType}),H;let b=[],l=this._def.keyType,a=this._def.valueType;for(let f in o.data)b.push({key:l._parse(new V(o,f,o.path,f)),value:a._parse(new V(o,o.data[f],o.path,f)),alwaysSet:f in o.data});if(o.common.async)return F.mergeObjectAsync(n,b);else return F.mergeObjectSync(n,b)}get element(){return this._def.valueType}static create(t,n,o){if(n instanceof X)return new Lt({keyType:t,valueType:n,typeName:E.ZodRecord,...Y(o)});return new Lt({keyType:W.create(),valueType:t,typeName:E.ZodRecord,...Y(n)})}};Ft=class Ft extends X{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==$.map)return v(o,{code:g.invalid_type,expected:$.map,received:o.parsedType}),H;let b=this._def.keyType,l=this._def.valueType,a=[...o.data.entries()].map(([f,h],r)=>{return{key:b._parse(new V(o,f,o.path,[r,"key"])),value:l._parse(new V(o,h,o.path,[r,"value"]))}});if(o.common.async){let f=new Map;return Promise.resolve().then(async()=>{for(let h of a){let r=await h.key,_=await h.value;if(r.status==="aborted"||_.status==="aborted")return H;if(r.status==="dirty"||_.status==="dirty")n.dirty();f.set(r.value,_.value)}return{status:n.value,value:f}})}else{let f=new Map;for(let h of a){let{key:r,value:_}=h;if(r.status==="aborted"||_.status==="aborted")return H;if(r.status==="dirty"||_.status==="dirty")n.dirty();f.set(r.value,_.value)}return{status:n.value,value:f}}}};Ft.create=(t,n,o)=>{return new Ft({valueType:n,keyType:t,typeName:E.ZodMap,...Y(o)})};bt=class bt extends X{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==$.set)return v(o,{code:g.invalid_type,expected:$.set,received:o.parsedType}),H;let b=this._def;if(b.minSize!==null){if(o.data.size<b.minSize.value)v(o,{code:g.too_small,minimum:b.minSize.value,type:"set",inclusive:!0,exact:!1,message:b.minSize.message}),n.dirty()}if(b.maxSize!==null){if(o.data.size>b.maxSize.value)v(o,{code:g.too_big,maximum:b.maxSize.value,type:"set",inclusive:!0,exact:!1,message:b.maxSize.message}),n.dirty()}let l=this._def.valueType;function a(h){let r=new Set;for(let _ of h){if(_.status==="aborted")return H;if(_.status==="dirty")n.dirty();r.add(_.value)}return{status:n.value,value:r}}let f=[...o.data.values()].map((h,r)=>l._parse(new V(o,h,o.path,r)));if(o.common.async)return Promise.all(f).then((h)=>a(h));else return a(f)}min(t,n){return new bt({...this._def,minSize:{value:t,message:q.toString(n)}})}max(t,n){return new bt({...this._def,maxSize:{value:t,message:q.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};bt.create=(t,n)=>{return new bt({valueType:t,minSize:null,maxSize:null,typeName:E.ZodSet,...Y(n)})};gt=class gt extends X{constructor(){super(...arguments);this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$.function)return v(n,{code:g.invalid_type,expected:$.function,received:n.parsedType}),H;function o(f,h){return Qt({data:f,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ft(),u].filter((r)=>!!r),issueData:{code:g.invalid_arguments,argumentsError:h}})}function b(f,h){return Qt({data:f,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ft(),u].filter((r)=>!!r),issueData:{code:g.invalid_return_type,returnTypeError:h}})}let l={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof lt){let f=this;return R(async function(...h){let r=new O([]),_=await f._def.args.parseAsync(h,l).catch((G)=>{throw r.addIssue(o(h,G)),r}),S=await Reflect.apply(a,this,_);return await f._def.returns._def.type.parseAsync(S,l).catch((G)=>{throw r.addIssue(b(S,G)),r})})}else{let f=this;return R(function(...h){let r=f._def.args.safeParse(h,l);if(!r.success)throw new O([o(h,r.error)]);let _=Reflect.apply(a,this,r.data),S=f._def.returns.safeParse(_,l);if(!S.success)throw new O([b(_,S.error)]);return S.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new gt({...this._def,args:p.create(t).rest(y.create())})}returns(t){return new gt({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,o){return new gt({args:t?t:p.create([]).rest(y.create()),returns:n||y.create(),typeName:E.ZodFunction,...Y(o)})}};At=class At extends X{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};At.create=(t,n)=>{return new At({getter:t,typeName:E.ZodLazy,...Y(n)})};qt=class qt extends X{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return v(n,{received:n.data,code:g.invalid_literal,expected:this._def.value}),H}return{status:"valid",value:t.data}}get value(){return this._def.value}};qt.create=(t,n)=>{return new qt({value:t,typeName:E.ZodLiteral,...Y(n)})};s=class s extends X{_parse(t){if(typeof t.data!=="string"){let n=this._getOrReturnCtx(t),o=this._def.values;return v(n,{expected:k.joinValues(o),received:n.parsedType,code:g.invalid_type}),H}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),o=this._def.values;return v(n,{received:n.data,code:g.invalid_enum_value,options:o}),H}return R(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return s.create(t,{...this._def,...n})}exclude(t,n=this._def){return s.create(this.options.filter((o)=>!t.includes(o)),{...this._def,...n})}};s.create=k0;Ht=class Ht extends X{_parse(t){let n=k.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(t);if(o.parsedType!==$.string&&o.parsedType!==$.number){let b=k.objectValues(n);return v(o,{expected:k.joinValues(b),received:o.parsedType,code:g.invalid_type}),H}if(!this._cache)this._cache=new Set(k.getValidEnumValues(this._def.values));if(!this._cache.has(t.data)){let b=k.objectValues(n);return v(o,{received:o.data,code:g.invalid_enum_value,options:b}),H}return R(t.data)}get enum(){return this._def.values}};Ht.create=(t,n)=>{return new Ht({values:t,typeName:E.ZodNativeEnum,...Y(n)})};lt=class lt extends X{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$.promise&&n.common.async===!1)return v(n,{code:g.invalid_type,expected:$.promise,received:n.parsedType}),H;let o=n.parsedType===$.promise?n.data:Promise.resolve(n.data);return R(o.then((b)=>{return this._def.type.parseAsync(b,{path:n.path,errorMap:n.common.contextualErrorMap})}))}};lt.create=(t,n)=>{return new lt({type:t,typeName:E.ZodPromise,...Y(n)})};j=class j extends X{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===E.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:o}=this._processInputParams(t),b=this._def.effect||null,l={addIssue:(a)=>{if(v(o,a),a.fatal)n.abort();else n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),b.type==="preprocess"){let a=b.transform(o.data,l);if(o.common.async)return Promise.resolve(a).then(async(f)=>{if(n.value==="aborted")return H;let h=await this._def.schema._parseAsync({data:f,path:o.path,parent:o});if(h.status==="aborted")return H;if(h.status==="dirty")return tt(h.value);if(n.value==="dirty")return tt(h.value);return h});else{if(n.value==="aborted")return H;let f=this._def.schema._parseSync({data:a,path:o.path,parent:o});if(f.status==="aborted")return H;if(f.status==="dirty")return tt(f.value);if(n.value==="dirty")return tt(f.value);return f}}if(b.type==="refinement"){let a=(f)=>{let h=b.refinement(f,l);if(o.common.async)return Promise.resolve(h);if(h instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return f};if(o.common.async===!1){let f=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(f.status==="aborted")return H;if(f.status==="dirty")n.dirty();return a(f.value),{status:n.value,value:f.value}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((f)=>{if(f.status==="aborted")return H;if(f.status==="dirty")n.dirty();return a(f.value).then(()=>{return{status:n.value,value:f.value}})})}if(b.type==="transform")if(o.common.async===!1){let a=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!C(a))return H;let f=b.transform(a.value,l);if(f instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:f}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((a)=>{if(!C(a))return H;return Promise.resolve(b.transform(a.value,l)).then((f)=>({status:n.value,value:f}))});k.assertNever(b)}};j.create=(t,n,o)=>{return new j({schema:t,typeName:E.ZodEffects,effect:n,...Y(o)})};j.createWithPreprocess=(t,n,o)=>{return new j({schema:n,effect:{type:"preprocess",transform:t},typeName:E.ZodEffects,...Y(o)})};U=class U extends X{_parse(t){if(this._getType(t)===$.undefined)return R(void 0);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};U.create=(t,n)=>{return new U({innerType:t,typeName:E.ZodOptional,...Y(n)})};i=class i extends X{_parse(t){if(this._getType(t)===$.null)return R(null);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};i.create=(t,n)=>{return new i({innerType:t,typeName:E.ZodNullable,...Y(n)})};Et=class Et extends X{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;if(n.parsedType===$.undefined)o=this._def.defaultValue();return this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Et.create=(t,n)=>{return new Et({innerType:t,typeName:E.ZodDefault,defaultValue:typeof n.default==="function"?n.default:()=>n.default,...Y(n)})};xt=class xt extends X{_parse(t){let{ctx:n}=this._processInputParams(t),o={...n,common:{...n.common,issues:[]}},b=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});if(ht(b))return b.then((l)=>{return{status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new O(o.common.issues)},input:o.data})}});else return{status:"valid",value:b.status==="valid"?b.value:this._def.catchValue({get error(){return new O(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};xt.create=(t,n)=>{return new xt({innerType:t,typeName:E.ZodCatch,catchValue:typeof n.catch==="function"?n.catch:()=>n.catch,...Y(n)})};mt=class mt extends X{_parse(t){if(this._getType(t)!==$.nan){let o=this._getOrReturnCtx(t);return v(o,{code:g.invalid_type,expected:$.nan,received:o.parsedType}),H}return{status:"valid",value:t.data}}};mt.create=(t)=>{return new mt({typeName:E.ZodNaN,...Y(t)})};Lb=Symbol("zod_brand");It=class It extends X{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}};Rt=class Rt extends X{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.common.async)return(async()=>{let l=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});if(l.status==="aborted")return H;if(l.status==="dirty")return n.dirty(),tt(l.value);else return this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();else{let b=this._def.in._parseSync({data:o.data,path:o.path,parent:o});if(b.status==="aborted")return H;if(b.status==="dirty")return n.dirty(),{status:"dirty",value:b.value};else return this._def.out._parseSync({data:b.value,path:o.path,parent:o})}}static create(t,n){return new Rt({in:t,out:n,typeName:E.ZodPipeline})}};Yt=class Yt extends X{_parse(t){let n=this._def.innerType._parse(t),o=(b)=>{if(C(b))b.value=Object.freeze(b.value);return b};return ht(n)?n.then((b)=>o(b)):o(n)}unwrap(){return this._def.innerType}};Yt.create=(t,n)=>{return new Yt({innerType:t,typeName:E.ZodReadonly,...Y(n)})};Fb={object:J.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(E||(E={}));Q0=W.create,J0=Z.create,Rb=mt.create,Bb=e.create,G0=$t.create,Db=nt.create,Ob=Jt.create,Wb=vt.create,db=wt.create,Ub=ot.create,Vb=y.create,jb=K.create,Nb=Gt.create,Kb=d.create,pb=J.create,ub=J.strictCreate,Ib=ct.create,ib=ut.create,Pb=_t.create,Tb=p.create,Cb=Lt.create,yb=Ft.create,Zb=bt.create,eb=gt.create,sb=At.create,zb=qt.create,tl=s.create,nl=Ht.create,ol=lt.create,bl=j.create,ll=U.create,al=i.create,fl=j.createWithPreprocess,hl=Rt.create,vl={string:(t)=>W.create({...t,coerce:!0}),number:(t)=>Z.create({...t,coerce:!0}),boolean:(t)=>$t.create({...t,coerce:!0}),bigint:(t)=>e.create({...t,coerce:!0}),date:(t)=>nt.create({...t,coerce:!0})},wl=H});var w={};Q(w,{void:()=>Nb,util:()=>k,unknown:()=>Vb,union:()=>Ib,undefined:()=>Wb,tuple:()=>Tb,transformer:()=>bl,symbol:()=>Ob,string:()=>Q0,strictObject:()=>ub,setErrorMap:()=>ab,set:()=>Zb,record:()=>Cb,quotelessJson:()=>bb,promise:()=>ol,preprocess:()=>fl,pipeline:()=>hl,ostring:()=>rl,optional:()=>ll,onumber:()=>gl,oboolean:()=>$l,objectUtil:()=>Nn,object:()=>pb,number:()=>J0,nullable:()=>al,null:()=>db,never:()=>jb,nativeEnum:()=>nl,nan:()=>Rb,map:()=>yb,makeIssue:()=>Qt,literal:()=>zb,lazy:()=>sb,late:()=>Fb,isValid:()=>C,isDirty:()=>pt,isAsync:()=>ht,isAborted:()=>Kt,intersection:()=>Pb,instanceof:()=>mb,getParsedType:()=>N,getErrorMap:()=>ft,function:()=>eb,enum:()=>tl,effect:()=>bl,discriminatedUnion:()=>ib,defaultErrorMap:()=>u,datetimeRegex:()=>S0,date:()=>Db,custom:()=>M0,coerce:()=>vl,boolean:()=>G0,bigint:()=>Bb,array:()=>Kb,any:()=>Ub,addIssueToContext:()=>v,ZodVoid:()=>Gt,ZodUnknown:()=>y,ZodUnion:()=>ct,ZodUndefined:()=>vt,ZodType:()=>X,ZodTuple:()=>p,ZodTransformer:()=>j,ZodSymbol:()=>Jt,ZodString:()=>W,ZodSet:()=>bt,ZodSchema:()=>X,ZodRecord:()=>Lt,ZodReadonly:()=>Yt,ZodPromise:()=>lt,ZodPipeline:()=>Rt,ZodParsedType:()=>$,ZodOptional:()=>U,ZodObject:()=>J,ZodNumber:()=>Z,ZodNullable:()=>i,ZodNull:()=>wt,ZodNever:()=>K,ZodNativeEnum:()=>Ht,ZodNaN:()=>mt,ZodMap:()=>Ft,ZodLiteral:()=>qt,ZodLazy:()=>At,ZodIssueCode:()=>g,ZodIntersection:()=>_t,ZodFunction:()=>gt,ZodFirstPartyTypeKind:()=>E,ZodError:()=>O,ZodEnum:()=>s,ZodEffects:()=>j,ZodDiscriminatedUnion:()=>ut,ZodDefault:()=>Et,ZodDate:()=>nt,ZodCatch:()=>xt,ZodBranded:()=>It,ZodBoolean:()=>$t,ZodBigInt:()=>e,ZodArray:()=>d,ZodAny:()=>ot,Schema:()=>X,ParseStatus:()=>F,OK:()=>R,NEVER:()=>wl,INVALID:()=>H,EMPTY_PATH:()=>fb,DIRTY:()=>tt,BRAND:()=>Lb});var Pn=x(()=>{Nt();pn();q0();Mt();L0();jt()});var F0=x(()=>{Pn();Pn()});function Tn(t){if(t===null||typeof t!=="object")return t;if(Array.isArray(t))return t.map(Tn);let n={};for(let o of Object.keys(t))n[o]=Tn(t[o]);return n}var cl,Ba;var m0=x(()=>{cl={validation:{trimStrings:!1,emptyAsNullDefault:!1},security:{csrf:{enabled:!0,excludePaths:[],sameSite:"Strict",secure:!1},rateLimit:{enabled:!0,windowMs:60000,maxRequests:60,excludePaths:[]}},hooks:{onValidationError:null,onSecurityViolation:null,onRateLimit:null,onDatabaseError:null,onRequest:null}},Ba=Tn(cl)});class Bt{static validate(t,n){try{return{success:!0,data:t.parse(n)}}catch(o){if(o instanceof w.ZodError){let b={};return o.errors.forEach((l)=>{let a=l.path.join(".");b[a]=l.message}),{success:!1,errors:b}}return{success:!1,errors:{general:"Validation failed"}}}}static validateField(t,n){try{return t.parse(n),{success:!0}}catch(o){if(o instanceof w.ZodError)return{success:!1,error:o.errors[0]?.message||"Invalid value"};return{success:!1,error:"Validation failed"}}}static getFieldError(t,n){if(t.success)return null;return t.errors?.[n]||null}static hasFieldError(t,n){return!!this.getFieldError(t,n)}}var R0,P;var Cn=x(()=>{F0();m0();R0={login:w.object({email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,"Password must contain at least one uppercase letter, one lowercase letter, and one number")}),register:w.object({name:w.string().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").regex(/^[a-zA-Z\s'-]+$/,"Name can only contain letters, spaces, hyphens, and apostrophes"),email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])/,"Password must contain uppercase, lowercase, number, and special character"),confirmPassword:w.string()}).refine((t)=>t.password===t.confirmPassword,{message:"Passwords don't match",path:["confirmPassword"]}),auth:{register:w.object({action:w.literal("register"),email:w.string().min(1,"Email is required").email("Please enter a valid email address"),username:w.string().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters"),password:w.string().min(8,"Password must be at least 8 characters"),full_name:w.string().min(2,"Full name is required").max(100,"Full name is too long")}),login:w.object({action:w.literal("login"),email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.string().min(8,"Password must be at least 8 characters")}),logout:w.object({action:w.literal("logout")}),action:w.discriminatedUnion("action",[w.object({action:w.literal("register")}).merge(w.object({email:w.string().min(1,"Email is required").email("Please enter a valid email address"),username:w.string().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters"),password:w.string().min(8,"Password must be at least 8 characters"),full_name:w.string().min(2,"Full name is required").max(100,"Full name is too long")})),w.object({action:w.literal("login")}).merge(w.object({email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.string().min(8,"Password must be at least 8 characters")})),w.object({action:w.literal("logout")})])},contact:w.object({name:w.string().min(2,"Name must be at least 2 characters").max(100,"Name is too long"),email:w.string().email("Please enter a valid email address"),message:w.string().min(10,"Message must be at least 10 characters").max(1000,"Message is too long")}),email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,"Password must contain uppercase, lowercase, and number"),phone:w.string().regex(/^[\+]?[1-9][\d]{0,15}$/,"Please enter a valid phone number"),url:w.string().min(1,"URL is required").url("Please enter a valid URL"),required:w.string().min(1,"This field is required"),positiveNumber:w.number().positive("Must be a positive number"),integer:w.number().int("Must be a whole number"),futureDate:w.date().min(new Date,"Date must be in the future"),imageFile:w.instanceof(File).refine((t)=>t.size<=5242880,"File size must be less than 5MB").refine((t)=>["image/jpeg","image/png","image/gif","image/webp"].includes(t.type),"File must be a JPEG, PNG, GIF, or WebP image"),userProfile:w.object({full_name:w.string().min(2,"Full name must be at least 2 characters").max(100,"Full name is too long").optional(),bio:w.string().max(500,"Bio must be less than 500 characters").nullable().optional(),avatar_url:w.string().url("Please enter a valid URL").nullable().optional(),theme:w.enum(["africanity","dark","light","system"]).optional(),language:w.string().min(2).max(10).optional()}),project:w.object({name:w.string().min(1,"Project name is required").max(100,"Project name is too long"),description:w.string().max(1000,"Description is too long").nullable().optional(),repository_url:w.string().url("Please enter a valid repository URL").nullable().optional(),demo_url:w.string().url("Please enter a valid demo URL").nullable().optional(),tags:w.array(w.string()).optional(),is_public:w.boolean().optional()})};P={required:(t="This field is required")=>w.string().min(1,t),email:(t="Please enter a valid email address")=>w.string().email(t),minLength:(t,n)=>w.string().min(t,n||`Must be at least ${t} characters`),maxLength:(t,n)=>w.string().max(t,n||`Must be less than ${t} characters`),pattern:(t,n)=>w.string().regex(t,n),numeric:(t="Must be a number")=>w.string().regex(/^\d+$/,t),phone:(t="Please enter a valid phone number")=>w.string().regex(/^[\+]?[1-9][\d]{0,15}$/,t),url:(t="Please enter a valid URL")=>w.string().min(1,"URL is required").url(t)}});var B0={};Q(B0,{default:()=>_l,AfriInput:()=>it});var it,_l;var D0=x(()=>{M();Cn();it=class it extends c{static get observedAttributes(){return["type","name","label","placeholder","error","helper","theme","icon","required","aria-label","aria-describedby","validation"]}constructor(){super();this._uniqueId=Math.random().toString(36).substr(2,9),this.render()}get value(){return this.shadowRoot.querySelector("input")?.value||""}set value(t){let n=this.shadowRoot.querySelector("input");if(n)n.value=t}connectedCallback(){this._attachInputListeners(),this.loadStyles()}attributeChangedCallback(){this.render(),this._attachInputListeners()}_attachInputListeners(){let t=this.shadowRoot.querySelector("input");if(!t)return;t.addEventListener("input",(n)=>{if(this.emit("af-input",{value:n.target.value}),this.hasAttribute("error"))this.removeAttribute("error")}),t.addEventListener("blur",()=>{this.emit("af-blur",{value:this.value}),this._validateInput()})}_setupValidation(){if(!this.getAttribute("validation"))return;let n=this.shadowRoot.querySelector("input");if(!n)return;n.addEventListener("input",()=>{if(this.hasAttribute("error"))this.removeAttribute("error")})}_validateInput(){let t=this.shadowRoot.querySelector("input");if(!t)return;let n=this.getAttribute("validation"),o=t.value;if(this.hasAttribute("required")&&!o.trim()){this.setAttribute("error","This field is required");return}if(n&&o.trim()){let l=this._getValidationSchema(n);if(l){let a=Bt.validateField(l,o);if(!a.success)this.setAttribute("error",a.error);else this.removeAttribute("error")}}}_getValidationSchema(t){let n={email:P.email(),password:P.password(),phone:P.phone(),url:P.url(),required:P.required()};if(t.includes(":")){let[o,b]=t.split(":"),l=parseInt(b);switch(o){case"minLength":return P.minLength(l);case"maxLength":return P.maxLength(l);case"pattern":return P.pattern(new RegExp(b),"Invalid format")}}return n[t]||null}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("type")||"text",n=this.getAttribute("name")||"",o=this.getAttribute("label")||"",b=this.getAttribute("placeholder")||"",l=this.getAttribute("error")||"",a=this.getAttribute("helper")||"",f=this.getAttribute("theme")||"tanzania",h=this.getAttribute("icon")||"",r=this.hasAttribute("required"),_=this.getAttribute("aria-label"),S=this.getAttribute("aria-describedby"),L={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},G=L[f]||L.tanzania,B=[];if(l)B.push(`error-${this._uniqueId}`);else if(a)B.push(`helper-${this._uniqueId}`);if(S)B.push(...S.split(" "));let _n=B.length>0?`aria-describedby="${B.join(" ")}"`:"";this.shadowRoot.innerHTML=`
|
|
753
749
|
<style>
|
|
754
750
|
:host {
|
|
755
751
|
display: block;
|
|
@@ -823,7 +819,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
823
819
|
</style>
|
|
824
820
|
|
|
825
821
|
<div class="input-wrapper">
|
|
826
|
-
${o?`<label for="input-${this._uniqueId}">${o}${
|
|
822
|
+
${o?`<label for="input-${this._uniqueId}">${o}${r?'<span class="required-star">*</span>':""}</label>`:""}
|
|
827
823
|
<div class="input-container">
|
|
828
824
|
${h?`<span class="icon">${h}</span>`:""}
|
|
829
825
|
<input
|
|
@@ -832,16 +828,16 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
832
828
|
type="${t}"
|
|
833
829
|
placeholder="${b}"
|
|
834
830
|
class="${l?"has-error":""}"
|
|
835
|
-
${
|
|
831
|
+
${r?"required":""}
|
|
836
832
|
${_?`aria-label="${_}"`:""}
|
|
837
833
|
${l?'aria-invalid="true"':""}
|
|
838
|
-
${
|
|
834
|
+
${_n}
|
|
839
835
|
/>
|
|
840
836
|
</div>
|
|
841
837
|
${l?`<div id="error-${this._uniqueId}" class="error-text" role="alert">${l}</div>`:""}
|
|
842
838
|
${a&&!l?`<div id="helper-${this._uniqueId}" class="helper-text">${a}</div>`:""}
|
|
843
839
|
</div>
|
|
844
|
-
`}};A("af-input",it);
|
|
840
|
+
`}};A("af-input",it);_l=it});var O0={};Q(O0,{default:()=>Al,AfriAlert:()=>Pt});var Pt,Al;var W0=x(()=>{M();Pt=class Pt extends c{static get observedAttributes(){return["type","title","dismissible"]}constructor(){super();this.render()}connectedCallback(){this.shadowRoot.querySelector(".close-btn")?.addEventListener("click",()=>{this.remove(),this.emit("af-dismiss")})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("type")||"info",n=this.getAttribute("title")||"",o=this.hasAttribute("dismissible"),b={success:{bg:"#d4edda",border:"#1EB53A",text:"#155724",icon:"✓"},warning:{bg:"#fff3cd",border:"#FCD116",text:"#856404",icon:"⚠"},error:{bg:"#f8d7da",border:"#DC3545",text:"#721c24",icon:"✕"},info:{bg:"#d1ecf1",border:"#00A3DD",text:"#0c5460",icon:"ℹ"}},l=b[t]||b.info;this.shadowRoot.innerHTML=`
|
|
845
841
|
<style>
|
|
846
842
|
:host {
|
|
847
843
|
display: block;
|
|
@@ -921,8 +917,8 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
921
917
|
</div>
|
|
922
918
|
${o?'<button class="close-btn" aria-label="Dismiss">×</button>':""}
|
|
923
919
|
</div>
|
|
924
|
-
`}};A("af-alert",
|
|
925
|
-
align-items: ${
|
|
920
|
+
`}};A("af-alert",Pt);Al=Pt});var d0={};Q(d0,{AfriGrid:()=>yn});function ql(t,n){let{sidebarSide:o="left",sidebarWidth:b="280px",minWidth:l="280px",gap:a="24px",columns:f,rows:h,align:r="stretch",justify:_="stretch",dense:S=!1}=n,L=S?"dense":"",G=`
|
|
921
|
+
align-items: ${r};
|
|
926
922
|
justify-items: ${_};
|
|
927
923
|
gap: ${a};
|
|
928
924
|
`;switch(t){case"sidebar":return o==="right"?`display: grid; grid-template-columns: 1fr ${b}; ${G}`:`display: grid; grid-template-columns: ${b} 1fr; ${G}`;case"holy-grail":return`
|
|
@@ -942,13 +938,13 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
942
938
|
grid-template-rows: masonry;
|
|
943
939
|
grid-auto-flow: row ${L};
|
|
944
940
|
${G}
|
|
945
|
-
`;case"auto":default:{let
|
|
941
|
+
`;case"auto":default:{let B=f?`repeat(${f}, 1fr)`:`repeat(auto-fit, minmax(${l}, 1fr))`,_n=h?`repeat(${h}, 1fr)`:"auto";return`
|
|
946
942
|
display: grid;
|
|
947
|
-
grid-template-columns: ${
|
|
948
|
-
${h?`grid-template-rows: ${
|
|
943
|
+
grid-template-columns: ${B};
|
|
944
|
+
${h?`grid-template-rows: ${_n};`:""}
|
|
949
945
|
grid-auto-flow: row ${L};
|
|
950
946
|
${G}
|
|
951
|
-
`}}}var yn;var U0=
|
|
947
|
+
`}}}var yn;var U0=x(()=>{M();yn=class yn extends c{static get observedAttributes(){return["min-width","gap","columns","rows","layout","align","justify","dense","sidebar-side","sidebar-width"]}attributeChangedCallback(){if(this.isConnected)this.render()}_getAttrs(){return{minWidth:this.getAttribute("min-width")||"280px",gap:this.getAttribute("gap")||"24px",columns:this.getAttribute("columns")||null,rows:this.getAttribute("rows")||null,layout:this.getAttribute("layout")||"auto",align:this.getAttribute("align")||"stretch",justify:this.getAttribute("justify")||"stretch",dense:this.hasAttribute("dense"),sidebarSide:this.getAttribute("sidebar-side")||"left",sidebarWidth:this.getAttribute("sidebar-width")||"280px"}}_buildResponsiveBreakpoints(t){if(t.layout!=="auto"&&t.layout!=="masonry")return"";return`
|
|
952
948
|
@media (max-width: 768px) {
|
|
953
949
|
.grid {
|
|
954
950
|
grid-template-columns: repeat(auto-fit, minmax(min(${t.minWidth}, 100%), 1fr));
|
|
@@ -965,7 +961,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
965
961
|
grid-template-columns: 1fr;
|
|
966
962
|
}
|
|
967
963
|
}
|
|
968
|
-
`}render(){let t=this._getAttrs(),n=
|
|
964
|
+
`}render(){let t=this._getAttrs(),n=ql(t.layout,t),o=this._buildResponsiveBreakpoints(t)+this._buildSidebarResponsive(t);this.shadowRoot.innerHTML=m`
|
|
969
965
|
<style>
|
|
970
966
|
:host {
|
|
971
967
|
display: block;
|
|
@@ -995,7 +991,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
995
991
|
>
|
|
996
992
|
<slot></slot>
|
|
997
993
|
</div>
|
|
998
|
-
`}connectedCallback(){this.render(),this._setupResizeObserver()}disconnectedCallback(){if(this._resizeObserver)this._resizeObserver.disconnect()}_setupResizeObserver(){if(typeof ResizeObserver>"u")return;let t=this.offsetWidth;this._resizeObserver=new ResizeObserver((n)=>{for(let o of n){let b=o.contentRect.width;if(Math.abs(b-t)>10)t=b,this.emit("af-grid-resize",{width:b,height:o.contentRect.height,layout:this.getAttribute("layout")||"auto"})}}),this._resizeObserver.observe(this)}setLayout(t){this.setAttribute("layout",t)}setColumns(t){this.setAttribute("columns",String(t))}setDense(t){if(t)this.setAttribute("dense","");else this.removeAttribute("dense")}};A("af-grid",yn)});var
|
|
994
|
+
`}connectedCallback(){this.render(),this._setupResizeObserver()}disconnectedCallback(){if(this._resizeObserver)this._resizeObserver.disconnect()}_setupResizeObserver(){if(typeof ResizeObserver>"u")return;let t=this.offsetWidth;this._resizeObserver=new ResizeObserver((n)=>{for(let o of n){let b=o.contentRect.width;if(Math.abs(b-t)>10)t=b,this.emit("af-grid-resize",{width:b,height:o.contentRect.height,layout:this.getAttribute("layout")||"auto"})}}),this._resizeObserver.observe(this)}setLayout(t){this.setAttribute("layout",t)}setColumns(t){this.setAttribute("columns",String(t))}setDense(t){if(t)this.setAttribute("dense","");else this.removeAttribute("dense")}};A("af-grid",yn)});var V0={};Q(V0,{AfriSection:()=>Zn});var Zn;var j0=x(()=>{M();Zn=class Zn extends c{render(){let t=this.getAttribute("variant")||"default",n=this.getAttribute("title");this.shadowRoot.innerHTML=m`
|
|
999
995
|
<style>
|
|
1000
996
|
:host { display: block; width: 100%; }
|
|
1001
997
|
.section {
|
|
@@ -1022,20 +1018,20 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
1022
1018
|
}
|
|
1023
1019
|
</style>
|
|
1024
1020
|
<section class="section">
|
|
1025
|
-
${n?
|
|
1021
|
+
${n?m`
|
|
1026
1022
|
<div class="section-header">
|
|
1027
1023
|
<h2>${n}</h2>
|
|
1028
1024
|
</div>
|
|
1029
1025
|
`:""}
|
|
1030
1026
|
<slot></slot>
|
|
1031
1027
|
</section>
|
|
1032
|
-
`}connectedCallback(){this.render()}};A("af-section",Zn)});var
|
|
1028
|
+
`}connectedCallback(){this.render()}};A("af-section",Zn)});var N0={};Q(N0,{default:()=>Hl,AfriIcon:()=>Tt});var Tt,Hl;var K0=x(()=>{M();Tt=class Tt extends c{static get observedAttributes(){return["name","size"]}connectedCallback(){this.render()}render(){let t=this.getAttribute("name")||"circle",n=this.getAttribute("size")||"24",b={check:'<path d="M20 6L9 17l-5-5" />',x:'<path d="M18 6L6 18M6 6l12 12" />',"arrow-right":'<path d="M5 12h14M12 5l7 7-7 7" />',menu:'<path d="M3 12h18M3 6h18M3 18h18" />',search:'<circle cx="11" cy="11" r="8" /><path d="M21 21l-4.35-4.35" />'}[t]||"";this.shadowRoot.innerHTML=`
|
|
1033
1029
|
<style>
|
|
1034
1030
|
:host { display: inline-flex; vertical-align: middle; }
|
|
1035
1031
|
svg { width: ${n}px; height: ${n}px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
1036
1032
|
</style>
|
|
1037
1033
|
<svg viewBox="0 0 24 24">${b}</svg>
|
|
1038
|
-
`}};A("af-icon",
|
|
1034
|
+
`}};A("af-icon",Tt);Hl=Tt});var p0={};Q(p0,{default:()=>El,AfriAccordion:()=>Ct});var Ct,El;var u0=x(()=>{M();Ct=class Ct extends c{static get observedAttributes(){return["theme","multiple"]}constructor(){super();this._openItems=new Set,this._uniqueId=Math.random().toString(36).substr(2,9),this.render()}connectedCallback(){this._setupAccordion()}_setupAccordion(){this.shadowRoot.querySelectorAll(".accordion-header").forEach((n,o)=>{n.addEventListener("click",()=>{this._toggleItem(o)})})}_toggleItem(t){let n=this.hasAttribute("multiple");if(this._openItems.has(t))this._openItems.delete(t);else{if(!n)this._openItems.clear();this._openItems.add(t)}this.render(),this._setupAccordion(),this.emit("af-toggle",{index:t,open:this._openItems.has(t)})}attributeChangedCallback(){this.render(),this._setupAccordion()}render(){let t=this.getAttribute("theme")||"tanzania",n=this.querySelector('[slot="items"]'),o=n?Array.from(n.children):[],b={tanzania:{accent:"#1EB53A"},maasai:{accent:"#FF0000"},ndebele:{accent:"#4169E1"}},l=b[t]||b.tanzania;this.shadowRoot.innerHTML=`
|
|
1039
1035
|
<style>
|
|
1040
1036
|
:host {
|
|
1041
1037
|
display: block;
|
|
@@ -1113,13 +1109,13 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
1113
1109
|
</style>
|
|
1114
1110
|
|
|
1115
1111
|
<div class="accordion">
|
|
1116
|
-
${o.map((a,f)=>{let h=this._openItems.has(f),
|
|
1112
|
+
${o.map((a,f)=>{let h=this._openItems.has(f),r=`accordion-header-${this._uniqueId}-${f}`,_=`accordion-panel-${this._uniqueId}-${f}`;return`
|
|
1117
1113
|
<div class="accordion-item">
|
|
1118
1114
|
<button
|
|
1119
1115
|
class="accordion-header ${h?"active":""}"
|
|
1120
1116
|
aria-expanded="${h}"
|
|
1121
1117
|
aria-controls="${_}"
|
|
1122
|
-
id="${
|
|
1118
|
+
id="${r}"
|
|
1123
1119
|
>
|
|
1124
1120
|
<span>${a.getAttribute("title")||`Item ${f+1}`}</span>
|
|
1125
1121
|
<span class="accordion-icon">▼</span>
|
|
@@ -1128,7 +1124,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
1128
1124
|
class="accordion-content ${h?"open":""}"
|
|
1129
1125
|
id="${_}"
|
|
1130
1126
|
role="region"
|
|
1131
|
-
aria-labelledby="${
|
|
1127
|
+
aria-labelledby="${r}"
|
|
1132
1128
|
>
|
|
1133
1129
|
<div class="accordion-body">
|
|
1134
1130
|
${a.innerHTML}
|
|
@@ -1138,7 +1134,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
1138
1134
|
`}).join("")}
|
|
1139
1135
|
</div>
|
|
1140
1136
|
<slot name="items"></slot>
|
|
1141
|
-
`}};A("af-accordion",
|
|
1137
|
+
`}};A("af-accordion",Ct);El=Ct});var I0={};Q(I0,{default:()=>xl,AfriHero:()=>yt});var yt,xl;var i0=x(()=>{M();Xt();z();yt=class yt extends c{static get observedAttributes(){return["title","subtitle","pattern","overlay"]}connectedCallback(){super.connectedCallback(),this.render(),this.loadStyles()}render(){let t=this.getAttribute("title")||"AfriCode",n=this.getAttribute("subtitle")||"",o=this.getAttribute("pattern")||"",b=this.getAttribute("variant")||"default";this.shadowRoot.innerHTML=`
|
|
1142
1138
|
<style>
|
|
1143
1139
|
:host {
|
|
1144
1140
|
display: flex;
|
|
@@ -1238,7 +1234,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
1238
1234
|
</div>
|
|
1239
1235
|
<slot></slot>
|
|
1240
1236
|
</div>
|
|
1241
|
-
`}};A("af-hero",
|
|
1237
|
+
`}};A("af-hero",yt);xl=yt});var P0={};Q(P0,{default:()=>Yl,AfriTable:()=>Zt});var Zt,Yl;var T0=x(()=>{M();Zt=class Zt extends c{static get observedAttributes(){return["theme","striped","hoverable"]}constructor(){super();this._columns=[],this._data=[],this._sortColumn=null,this._sortDirection="asc",this.render()}set columns(t){this._columns=t,this.render()}set data(t){this._data=t,this.render()}attributeChangedCallback(){this.render()}_handleSort(t){if(this._sortColumn===t)this._sortDirection=this._sortDirection==="asc"?"desc":"asc";else this._sortColumn=t,this._sortDirection="asc";this.emit("af-sort",{column:t,direction:this._sortDirection}),this.render()}_getSortedData(){if(!this._sortColumn)return this._data;return[...this._data].sort((t,n)=>{let o=t[this._sortColumn],b=n[this._sortColumn],l=this._sortDirection==="asc"?1:-1;if(typeof o==="number")return(o-b)*l;return String(o).localeCompare(String(b))*l})}render(){let t=this.getAttribute("theme")||"tanzania",n=this.hasAttribute("striped"),o=this.hasAttribute("hoverable"),b={tanzania:{header:"#1EB53A",text:"#FFFFFF",accent:"#FCD116"},maasai:{header:"#8B0000",text:"#FFFFFF",accent:"#FF0000"},ndebele:{header:"#4169E1",text:"#FFFFFF",accent:"#FFD700"}},l=b[t]||b.tanzania,a=this._getSortedData();this.shadowRoot.innerHTML=`
|
|
1242
1238
|
<style>
|
|
1243
1239
|
:host {
|
|
1244
1240
|
display: block;
|
|
@@ -1328,7 +1324,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
1328
1324
|
</tbody>
|
|
1329
1325
|
</table>
|
|
1330
1326
|
</div>
|
|
1331
|
-
`,this.shadowRoot.querySelectorAll("th").forEach((f)=>{f.addEventListener("click",()=>{this._handleSort(f.dataset.column)})})}};A("af-table",
|
|
1327
|
+
`,this.shadowRoot.querySelectorAll("th").forEach((f)=>{f.addEventListener("click",()=>{this._handleSort(f.dataset.column)})})}};A("af-table",Zt);Yl=Zt});var C0={};Q(C0,{default:()=>Xl,AfriModal:()=>et});var et,Xl;var y0=x(()=>{M();et=class et extends c{static get observedAttributes(){return["open","theme","size","aria-label","aria-labelledby"]}constructor(){super();this.render()}connectedCallback(){this._setupListeners()}_setupListeners(){this.shadowRoot.querySelector(".backdrop")?.addEventListener("click",(t)=>{if(t.target.classList.contains("backdrop"))this.close()}),this.shadowRoot.querySelector(".close-btn")?.addEventListener("click",()=>{this.close()}),document.addEventListener("keydown",(t)=>{if(t.key==="Escape"&&this.hasAttribute("open"))this.close()}),this.shadowRoot.addEventListener("keydown",(t)=>{if(t.key==="Tab"&&this.hasAttribute("open"))this._handleTabKey(t)})}_getFocusableElements(){let t=this.shadowRoot.querySelector(".modal"),n='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',o=Array.from(t?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')||[]),b=Array.from(this.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));return[...o,...b]}_focusFirstFocusableElement(){let t=this._getFocusableElements();if(t.length>0)t[0].focus();else this.shadowRoot.querySelector(".close-btn")?.focus()}_handleTabKey(t){let n=this._getFocusableElements();if(n.length===0){t.preventDefault();return}let o=n[0],b=n[n.length-1];if(t.shiftKey){if(document.activeElement===o)t.preventDefault(),b.focus()}else if(document.activeElement===b)t.preventDefault(),o.focus()}open(){this.setAttribute("open",""),document.body.style.overflow="hidden",this._previousFocus=document.activeElement,this._focusFirstFocusableElement(),this.emit("af-open")}close(){if(this.removeAttribute("open"),document.body.style.overflow="",this._previousFocus&&this._previousFocus.focus)this._previousFocus.focus();this.emit("af-close")}attributeChangedCallback(t,n,o){if(this.render(),t==="open")this._setupListeners()}render(){let t=this.hasAttribute("open"),n=this.getAttribute("theme")||"tanzania",o=this.getAttribute("size")||"md",b={tanzania:{accent:"#1EB53A"},maasai:{accent:"#FF0000"},ndebele:{accent:"#4169E1"}},l=b[n]||b.tanzania,a={sm:"400px",md:"560px",lg:"720px",full:"95vw"},f=this.getAttribute("aria-label"),h=this.getAttribute("aria-labelledby")||"modal-title";this.shadowRoot.innerHTML=`
|
|
1332
1328
|
<style>
|
|
1333
1329
|
:host {
|
|
1334
1330
|
font-family: 'Inter', system-ui, sans-serif;
|
|
@@ -1432,7 +1428,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
1432
1428
|
</div>
|
|
1433
1429
|
</div>
|
|
1434
1430
|
</div>
|
|
1435
|
-
`}};A("af-modal",
|
|
1431
|
+
`}};A("af-modal",et);Xl=et});var Z0={};Q(Z0,{default:()=>Sl,AfriTabs:()=>st});var st,Sl;var e0=x(()=>{M();st=class st extends c{static get observedAttributes(){return["theme"]}constructor(){super();this._activeTab=0,this.render()}connectedCallback(){this._setupTabs(),this.addEventListener("keydown",this._handleKeydown.bind(this))}_handleKeydown(t){let n=this.querySelector('[slot="tabs"]'),o=n?Array.from(n.children):[];if(o.length===0)return;switch(t.key){case"ArrowLeft":t.preventDefault(),this._activeTab=this._activeTab>0?this._activeTab-1:o.length-1,this.render(),this._setupTabs(),this._focusActiveTab();break;case"ArrowRight":t.preventDefault(),this._activeTab=this._activeTab<o.length-1?this._activeTab+1:0,this.render(),this._setupTabs(),this._focusActiveTab();break;case"Home":t.preventDefault(),this._activeTab=0,this.render(),this._setupTabs(),this._focusActiveTab();break;case"End":t.preventDefault(),this._activeTab=o.length-1,this.render(),this._setupTabs(),this._focusActiveTab();break}}_focusActiveTab(){let t=this.shadowRoot.querySelectorAll(".tab-button");if(t[this._activeTab])t[this._activeTab].focus()}_setupTabs(){this.shadowRoot.querySelectorAll(".tab-button").forEach((n,o)=>{n.addEventListener("click",()=>{this._activeTab=o,this.render(),this._setupTabs(),this.emit("af-tab-change",{index:o,tab:n.textContent})})})}attributeChangedCallback(){this.render(),this._setupTabs()}render(){let t=this.getAttribute("theme")||"tanzania",n=this.querySelector('[slot="tabs"]'),o=n?Array.from(n.children):[],b={tanzania:{active:"#1EB53A",text:"#FFFFFF"},maasai:{active:"#FF0000",text:"#FFFFFF"},ndebele:{active:"#4169E1",text:"#FFFFFF"}},l=b[t]||b.tanzania;this.shadowRoot.innerHTML=`
|
|
1436
1432
|
<style>
|
|
1437
1433
|
:host {
|
|
1438
1434
|
display: block;
|
|
@@ -1527,7 +1523,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
1527
1523
|
</div>
|
|
1528
1524
|
</div>
|
|
1529
1525
|
<slot name="tabs"></slot>
|
|
1530
|
-
`}};A("af-tabs",
|
|
1526
|
+
`}};A("af-tabs",st);Sl=st});var s0={};Q(s0,{default:()=>kl,AfriSidebar:()=>zt});var zt,kl;var z0=x(()=>{M();Xt();z();zt=class zt extends c{static get observedAttributes(){return["position"]}constructor(){super();this._unsubscribe=null}connectedCallback(){super.connectedCallback(),this._unsubscribe=T(()=>{this.updateUI()}),this.render()}disconnectedCallback(){if(this._unsubscribe)this._unsubscribe()}updateUI(){let t=D.ui.sidebarCollapsed,n=this.shadowRoot.querySelector(".sidebar"),o=this.shadowRoot.querySelector(".sidebar-title"),b=this.shadowRoot.getElementById("toggle"),l=this.shadowRoot.querySelector(".sidebar-content");if(n)n.style.width=t?"60px":"260px";if(o)o.style.opacity=t?"0":"1";if(l)l.style.padding=t?"12px":"20px";if(b)b.innerHTML=t?"→":"← Collapse"}render(){let t=this.getAttribute("position")||"left",n=D.ui.sidebarCollapsed;this.shadowRoot.innerHTML=`
|
|
1531
1527
|
<style>
|
|
1532
1528
|
:host {
|
|
1533
1529
|
display: block;
|
|
@@ -1636,7 +1632,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
1636
1632
|
</button>
|
|
1637
1633
|
</div>
|
|
1638
1634
|
</aside>
|
|
1639
|
-
`,this.shadowRoot.getElementById("toggle").addEventListener("click",()=>{actions.toggleSidebar()})}};A("af-sidebar",
|
|
1635
|
+
`,this.shadowRoot.getElementById("toggle").addEventListener("click",()=>{actions.toggleSidebar()})}};A("af-sidebar",zt);kl=zt});var to={};Q(to,{default:()=>Ml,AfriDropdown:()=>tn});var tn,Ml;var no=x(()=>{M();tn=class tn extends c{static get observedAttributes(){return["label","open"]}constructor(){super();this._open=!1,this.render()}toggle(){if(this._open=!this._open,this._open)this.setAttribute("open","");else this.removeAttribute("open");this.render()}close(){this._open=!1,this.removeAttribute("open"),this.render()}connectedCallback(){document.addEventListener("click",(t)=>{if(!this.contains(t.target))this.close()}),this.addEventListener("keydown",this._handleKeydown.bind(this))}_handleKeydown(t){let n=this.shadowRoot.getElementById("trigger");switch(t.key){case"Enter":case" ":t.preventDefault(),this.toggle();break;case"Escape":if(this._open)t.preventDefault(),this.close(),n.focus();break;case"ArrowDown":if(!this._open)t.preventDefault(),this.toggle();break}}render(){let t=this.getAttribute("label")||"Menu",n=this.hasAttribute("open");this.shadowRoot.innerHTML=`
|
|
1640
1636
|
<style>
|
|
1641
1637
|
:host {
|
|
1642
1638
|
display: inline-block;
|
|
@@ -1718,7 +1714,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
1718
1714
|
<div class="dropdown-menu" role="menu" ${n?"":'aria-hidden="true"'}>
|
|
1719
1715
|
<slot></slot>
|
|
1720
1716
|
</div>
|
|
1721
|
-
`,this.shadowRoot.getElementById("trigger").addEventListener("click",(o)=>{o.stopPropagation(),this.toggle()})}};A("af-dropdown",
|
|
1717
|
+
`,this.shadowRoot.getElementById("trigger").addEventListener("click",(o)=>{o.stopPropagation(),this.toggle()})}};A("af-dropdown",tn);Ml=tn});var oo={};Q(oo,{default:()=>Ql,AfriSelect:()=>nn});var nn,Ql;var bo=x(()=>{M();nn=class nn extends c{static get observedAttributes(){return["label","placeholder","theme","error","required","aria-label","aria-describedby"]}constructor(){super();this._uniqueId=Math.random().toString(36).substr(2,9),this._isOpen=!1,this._selectedIndex=-1,this._options=[],this.render()}get value(){return this._selectedIndex>=0?this._options[this._selectedIndex]?.value:""}connectedCallback(){this._options=Array.from(this.querySelectorAll("option")).map((t)=>({value:t.value,label:t.textContent})),this.render(),this._setupListeners()}_setupListeners(){let t=this.shadowRoot.querySelector(".select-trigger"),n=this.shadowRoot.querySelector(".select-dropdown");t?.addEventListener("click",()=>{this._toggleDropdown()}),t?.addEventListener("keydown",(o)=>{this._handleKeydown(o)}),this.shadowRoot.querySelectorAll(".select-option").forEach((o,b)=>{o.addEventListener("click",()=>{this._selectOption(b)})}),document.addEventListener("click",(o)=>{if(!this.contains(o.target)&&this._isOpen)this._closeDropdown()})}_toggleDropdown(){this._isOpen=!this._isOpen;let t=this.shadowRoot.querySelector(".select-trigger"),n=this.shadowRoot.querySelector(".select-dropdown");if(n?.classList.toggle("open",this._isOpen),t?.classList.toggle("open",this._isOpen),this._isOpen)t?.setAttribute("aria-expanded","true"),n?.setAttribute("aria-hidden","false");else t?.setAttribute("aria-expanded","false"),n?.setAttribute("aria-hidden","true")}_closeDropdown(){this._isOpen=!1;let t=this.shadowRoot.querySelector(".select-trigger"),n=this.shadowRoot.querySelector(".select-dropdown");n?.classList.remove("open"),t?.classList.remove("open"),t?.setAttribute("aria-expanded","false"),n?.setAttribute("aria-hidden","true")}_selectOption(t){this._selectedIndex=t,this._closeDropdown(),this.render(),this._setupListeners(),this.emit("af-change",{value:this.value,label:this._options[t].label})}_handleKeydown(t){let n=this.shadowRoot.querySelector(".select-trigger");switch(t.key){case"Enter":case" ":t.preventDefault(),this._toggleDropdown();break;case"Escape":if(this._isOpen)t.preventDefault(),this._closeDropdown(),n.focus();break;case"ArrowDown":if(!this._isOpen)t.preventDefault(),this._toggleDropdown();else t.preventDefault(),this._navigateOptions(1);break;case"ArrowUp":if(this._isOpen)t.preventDefault(),this._navigateOptions(-1);break}}_navigateOptions(t){let n=this.shadowRoot.querySelectorAll(".select-option");if(n.length===0)return;let o=this._selectedIndex+t;if(o<0)o=n.length-1;if(o>=n.length)o=0;this._selectedIndex=o,this.render(),this._setupListeners(),this.shadowRoot.querySelector(".select-option.selected")?.scrollIntoView({block:"nearest"})}attributeChangedCallback(){this.render(),this._setupListeners()}render(){let t=this.getAttribute("label")||"",n=this.getAttribute("placeholder")||"Select an option",o=this.getAttribute("theme")||"tanzania",b=this.getAttribute("error")||"",l=this.hasAttribute("required"),a=this.getAttribute("aria-label"),f=this.getAttribute("aria-describedby"),h={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},r=h[o]||h.tanzania,_=[];if(b)_.push(`error-${this._uniqueId}`);if(f)_.push(...f.split(" "));let S=_.length>0?`aria-describedby="${_.join(" ")}"`:"",L=this._selectedIndex>=0?this._options[this._selectedIndex]?.label:n;this.shadowRoot.innerHTML=`
|
|
1722
1718
|
<style>
|
|
1723
1719
|
:host {
|
|
1724
1720
|
display: block;
|
|
@@ -1735,7 +1731,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
1735
1731
|
}
|
|
1736
1732
|
|
|
1737
1733
|
.required-star {
|
|
1738
|
-
color: ${
|
|
1734
|
+
color: ${r.error};
|
|
1739
1735
|
margin-left: 2px;
|
|
1740
1736
|
}
|
|
1741
1737
|
|
|
@@ -1747,7 +1743,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
1747
1743
|
width: 100%;
|
|
1748
1744
|
padding: 10px 40px 10px 13px;
|
|
1749
1745
|
font-size: 15px;
|
|
1750
|
-
border: 2px solid ${b?
|
|
1746
|
+
border: 2px solid ${b?r.error:"#ddd"};
|
|
1751
1747
|
border-radius: 5px;
|
|
1752
1748
|
background: white;
|
|
1753
1749
|
cursor: pointer;
|
|
@@ -1760,8 +1756,8 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
1760
1756
|
.select-trigger:focus,
|
|
1761
1757
|
.select-trigger.open {
|
|
1762
1758
|
outline: none;
|
|
1763
|
-
border-color: ${b?
|
|
1764
|
-
box-shadow: 0 0 0 3px ${b?
|
|
1759
|
+
border-color: ${b?r.error:r.focus};
|
|
1760
|
+
box-shadow: 0 0 0 3px ${b?r.error+"20":r.focus+"20"};
|
|
1765
1761
|
}
|
|
1766
1762
|
|
|
1767
1763
|
.select-arrow {
|
|
@@ -1807,18 +1803,18 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
1807
1803
|
}
|
|
1808
1804
|
|
|
1809
1805
|
.select-option:hover {
|
|
1810
|
-
background: ${
|
|
1806
|
+
background: ${r.focus}15;
|
|
1811
1807
|
}
|
|
1812
1808
|
|
|
1813
1809
|
.select-option.selected {
|
|
1814
|
-
background: ${
|
|
1810
|
+
background: ${r.focus};
|
|
1815
1811
|
color: white;
|
|
1816
1812
|
}
|
|
1817
1813
|
|
|
1818
1814
|
.error-text {
|
|
1819
1815
|
font-size: 12px;
|
|
1820
1816
|
margin-top: 4px;
|
|
1821
|
-
color: ${
|
|
1817
|
+
color: ${r.error};
|
|
1822
1818
|
}
|
|
1823
1819
|
|
|
1824
1820
|
::slotted(option) {
|
|
@@ -1835,18 +1831,18 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
1835
1831
|
aria-haspopup="listbox"
|
|
1836
1832
|
${a?`aria-label="${a}"`:""}
|
|
1837
1833
|
${b?'aria-invalid="true"':""}
|
|
1838
|
-
${
|
|
1834
|
+
${S}>
|
|
1839
1835
|
${L}
|
|
1840
1836
|
</button>
|
|
1841
1837
|
<span class="select-arrow" aria-hidden="true">▼</span>
|
|
1842
1838
|
<div class="select-dropdown ${this._isOpen?"open":""}"
|
|
1843
1839
|
role="listbox"
|
|
1844
1840
|
aria-hidden="${!this._isOpen}">
|
|
1845
|
-
${this._options.map((G,
|
|
1846
|
-
<div class="select-option ${
|
|
1847
|
-
data-index="${
|
|
1841
|
+
${this._options.map((G,B)=>`
|
|
1842
|
+
<div class="select-option ${B===this._selectedIndex?"selected":""}"
|
|
1843
|
+
data-index="${B}"
|
|
1848
1844
|
role="option"
|
|
1849
|
-
aria-selected="${
|
|
1845
|
+
aria-selected="${B===this._selectedIndex}">
|
|
1850
1846
|
${G.label}
|
|
1851
1847
|
</div>
|
|
1852
1848
|
`).join("")}
|
|
@@ -1854,7 +1850,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
1854
1850
|
</div>
|
|
1855
1851
|
${b?`<div id="error-${this._uniqueId}" class="error-text" role="alert">${b}</div>`:""}
|
|
1856
1852
|
<slot></slot>
|
|
1857
|
-
`}};A("af-select",
|
|
1853
|
+
`}};A("af-select",nn);Ql=nn});var lo={};Q(lo,{default:()=>Jl,AfriForm:()=>on});var on,Jl;var ao=x(()=>{M();Cn();on=class on extends c{static get observedAttributes(){return["action","method","error","success","schema"]}constructor(){super();this.handleSubmit=this.handleSubmit.bind(this)}connectedCallback(){this.render(),this.shadowRoot.querySelector("form").addEventListener("submit",this.handleSubmit),this.loadStyles()}async handleSubmit(t){t.preventDefault();let n=t.target,o=this.querySelector('[type="submit"]')||this.shadowRoot.querySelector('button[type="submit"]'),b=this.getAttribute("schema"),l=b?this._getSchema(b):null,a=this.getAttribute("action"),f=this.getAttribute("method")||"GET",h=new FormData(n),r=Object.fromEntries(h.entries());if(Array.from(this.querySelectorAll("af-input")).forEach((S)=>{let L=S.getAttribute("name");if(L)r[L]=S.value}),l){let S=Bt.validate(l,r);if(!S.success){this._showValidationErrors(S.errors),this.emit("af-validation-error",{errors:S.errors});return}}if(!a)return;if(o){var _=o.textContent;o.textContent="Wait...",o.disabled=!0}try{let S=await fetch(a,{method:f,headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(S.ok)this.emit("success",await S.json()),this.setAttribute("success","Form submitted successfully!"),this.removeAttribute("error");else{let L=await S.text();this.emit("error",L),this.setAttribute("error",L),this.removeAttribute("success")}}catch(S){this.emit("error",S.message),this.setAttribute("error",S.message),this.removeAttribute("success")}finally{if(o)o.textContent=_,o.disabled=!1}}_getSchema(t){return R0[t]||null}_showValidationErrors(t){this.shadowRoot.querySelectorAll(".field-error").forEach((n)=>n.remove()),Object.entries(t).forEach(([n,o])=>{let b=this.querySelector(`[name="${n}"]`);if(b)if(b.tagName==="AF-INPUT")b.setAttribute("error",o);else{let l=document.createElement("div");l.className="field-error",l.textContent=o,l.style.color="red",l.style.fontSize="12px",l.style.marginTop="4px",b.parentNode.insertBefore(l,b.nextSibling)}})}};A("af-form",on);Jl=on});var fo={};Q(fo,{default:()=>Gl,AfriTooltip:()=>bn});var bn,Gl;var ho=x(()=>{M();bn=class bn extends c{static get observedAttributes(){return["text","position"]}constructor(){super();this._tooltipId=`af-tooltip-${Math.random().toString(36).substr(2,9)}`,this.render()}connectedCallback(){this._setupTooltipListeners()}attributeChangedCallback(){this.render(),this._setupTooltipListeners()}_setupTooltipListeners(){let t=this.shadowRoot.querySelector(".tooltip-trigger"),n=this.shadowRoot.querySelector(".tooltip-content");if(!t||!n)return;t.addEventListener("focus",()=>{n.style.opacity="1",n.style.visibility="visible",n.setAttribute("aria-hidden","false")}),t.addEventListener("blur",()=>{n.style.opacity="0",n.style.visibility="hidden",n.setAttribute("aria-hidden","true")}),t.addEventListener("mouseenter",()=>{n.style.opacity="1",n.style.visibility="visible",n.setAttribute("aria-hidden","false")}),t.addEventListener("mouseleave",()=>{n.style.opacity="0",n.style.visibility="hidden",n.setAttribute("aria-hidden","true")})}render(){let t=this.getAttribute("text")||"Tooltip",n=this.getAttribute("position")||"top",o={top:`
|
|
1858
1854
|
bottom: 100%;
|
|
1859
1855
|
left: 50%;
|
|
1860
1856
|
transform: translateX(-50%) translateY(-8px);
|
|
@@ -1943,7 +1939,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
1943
1939
|
<slot></slot>
|
|
1944
1940
|
</span>
|
|
1945
1941
|
<div class="tooltip-content" id="${this._tooltipId}" role="tooltip" aria-hidden="true">${t}</div>
|
|
1946
|
-
`}};A("af-tooltip",
|
|
1942
|
+
`}};A("af-tooltip",bn);Gl=bn});var ro={};Q(ro,{default:()=>Ll,AfriToast:()=>ln});var ln,Ll;var go=x(()=>{M();ln=class ln extends c{static get observedAttributes(){return["type","message","duration"]}constructor(){super();this.render()}show(t,n="info",o=4000){if(this.setAttribute("message",t),this.setAttribute("type",n),this.render(),this.shadowRoot.querySelector(".toast").classList.add("show"),o>0)setTimeout(()=>this.hide(),o)}hide(){this.shadowRoot.querySelector(".toast").classList.remove("show"),setTimeout(()=>this.emit("af-toast-close"),300)}render(){let t=this.getAttribute("type")||"info",n=this.getAttribute("message")||"",o={success:"✓",error:"✗",warning:"⚠",info:"ℹ"},b={success:"#1EB53A",error:"#EF3340",warning:"#FCD116",info:"#00A3DD"};this.shadowRoot.innerHTML=`
|
|
1947
1943
|
<style>
|
|
1948
1944
|
:host {
|
|
1949
1945
|
position: fixed;
|
|
@@ -2017,7 +2013,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2017
2013
|
</div>
|
|
2018
2014
|
<button class="toast-close" id="close">×</button>
|
|
2019
2015
|
</div>
|
|
2020
|
-
`,this.shadowRoot.getElementById("close")?.addEventListener("click",()=>this.hide())}};A("af-toast",
|
|
2016
|
+
`,this.shadowRoot.getElementById("close")?.addEventListener("click",()=>this.hide())}};A("af-toast",ln);Ll=ln});var $o={};Q($o,{default:()=>Fl,AfriBadge:()=>an});var an,Fl;var vo=x(()=>{M();an=class an extends c{static get observedAttributes(){return["variant","size","removable"]}constructor(){super();this.render()}connectedCallback(){this.shadowRoot.querySelector(".remove-btn")?.addEventListener("click",()=>{this.emit("af-remove"),this.remove()})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"default",n=this.getAttribute("size")||"md",o=this.hasAttribute("removable"),b={default:{bg:"#e9ecef",text:"#495057"},success:{bg:"#d4edda",text:"#155724"},warning:{bg:"#fff3cd",text:"#856404"},error:{bg:"#f8d7da",text:"#721c24"},info:{bg:"#d1ecf1",text:"#0c5460"},tanzania:{bg:"#1EB53A",text:"#FFFFFF"},maasai:{bg:"#FF0000",text:"#FFFFFF"},ndebele:{bg:"#4169E1",text:"#FFFFFF"},gold:{bg:"#FCD116",text:"#000000"}},l=b[t]||b.default,a={sm:{padding:"2px 6px",fontSize:"11px"},md:{padding:"4px 10px",fontSize:"13px"},lg:{padding:"6px 14px",fontSize:"15px"}},f=a[n]||a.md;this.shadowRoot.innerHTML=`
|
|
2021
2017
|
<style>
|
|
2022
2018
|
:host {
|
|
2023
2019
|
display: inline-block;
|
|
@@ -2058,7 +2054,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2058
2054
|
<slot></slot>
|
|
2059
2055
|
${o?'<button class="remove-btn" aria-label="Remove">×</button>':""}
|
|
2060
2056
|
</span>
|
|
2061
|
-
`}};A("af-badge",
|
|
2057
|
+
`}};A("af-badge",an);Fl=an});var wo={};Q(wo,{default:()=>ml,AfriAvatar:()=>fn});var fn,ml;var co=x(()=>{M();fn=class fn extends c{static get observedAttributes(){return["src","name","size","status","theme"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}_getInitials(t){if(!t)return"?";let n=t.trim().split(" ");if(n.length>=2)return(n[0][0]+n[n.length-1][0]).toUpperCase();return t.substring(0,2).toUpperCase()}render(){let t=this.getAttribute("src"),n=this.getAttribute("name")||"",o=this.getAttribute("size")||"md",b=this.getAttribute("status"),l=this.getAttribute("theme")||"tanzania",a={tanzania:"#1EB53A",maasai:"#FF0000",ndebele:"#4169E1",gold:"#FCD116"},f=a[l]||a.tanzania,h={sm:{size:"32px",font:"12px",status:"8px"},md:{size:"44px",font:"16px",status:"10px"},lg:{size:"64px",font:"22px",status:"14px"},xl:{size:"96px",font:"32px",status:"18px"}},r=h[o]||h.md,_={online:"#28a745",offline:"#6c757d",busy:"#dc3545",away:"#ffc107"};this.shadowRoot.innerHTML=`
|
|
2062
2058
|
<style>
|
|
2063
2059
|
:host {
|
|
2064
2060
|
display: inline-block;
|
|
@@ -2067,8 +2063,8 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2067
2063
|
|
|
2068
2064
|
.avatar {
|
|
2069
2065
|
position: relative;
|
|
2070
|
-
width: ${
|
|
2071
|
-
height: ${
|
|
2066
|
+
width: ${r.size};
|
|
2067
|
+
height: ${r.size};
|
|
2072
2068
|
border-radius: 50%;
|
|
2073
2069
|
display: flex;
|
|
2074
2070
|
align-items: center;
|
|
@@ -2076,7 +2072,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2076
2072
|
background: ${f};
|
|
2077
2073
|
color: white;
|
|
2078
2074
|
font-weight: 600;
|
|
2079
|
-
font-size: ${
|
|
2075
|
+
font-size: ${r.font};
|
|
2080
2076
|
overflow: hidden;
|
|
2081
2077
|
}
|
|
2082
2078
|
|
|
@@ -2090,8 +2086,8 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2090
2086
|
position: absolute;
|
|
2091
2087
|
bottom: 0;
|
|
2092
2088
|
right: 0;
|
|
2093
|
-
width: ${
|
|
2094
|
-
height: ${
|
|
2089
|
+
width: ${r.status};
|
|
2090
|
+
height: ${r.status};
|
|
2095
2091
|
border-radius: 50%;
|
|
2096
2092
|
border: 2px solid white;
|
|
2097
2093
|
background: ${b?_[b]||_.offline:"transparent"};
|
|
@@ -2102,7 +2098,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2102
2098
|
${t?`<img src="${t}" alt="${n}" />`:this._getInitials(n)}
|
|
2103
2099
|
${b?'<span class="status"></span>':""}
|
|
2104
2100
|
</div>
|
|
2105
|
-
`}};A("af-avatar",
|
|
2101
|
+
`}};A("af-avatar",fn);ml=fn});var _o={};Q(_o,{default:()=>Rl,AfriProgress:()=>hn});var hn,Rl;var Ao=x(()=>{M();hn=class hn extends c{static get observedAttributes(){return["value","max","theme","size","label","animated"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=parseFloat(this.getAttribute("value"))||0,n=parseFloat(this.getAttribute("max"))||100,o=this.getAttribute("theme")||"tanzania",b=this.getAttribute("size")||"md",l=this.getAttribute("label"),a=this.hasAttribute("animated"),f=Math.min(100,Math.max(0,t/n*100)),h={tanzania:{bar:"#1EB53A",track:"#e9ecef"},maasai:{bar:"#FF0000",track:"#e9ecef"},ndebele:{bar:"#4169E1",track:"#e9ecef"},gold:{bar:"#FCD116",track:"#e9ecef"},gradient:{bar:"linear-gradient(90deg, #1EB53A 0%, #FCD116 50%, #00A3DD 100%)",track:"#e9ecef"}},r=h[o]||h.tanzania,_={sm:"6px",md:"10px",lg:"16px"},S=_[b]||_.md;this.shadowRoot.innerHTML=`
|
|
2106
2102
|
<style>
|
|
2107
2103
|
:host {
|
|
2108
2104
|
display: block;
|
|
@@ -2131,8 +2127,8 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2131
2127
|
|
|
2132
2128
|
.progress-track {
|
|
2133
2129
|
width: 100%;
|
|
2134
|
-
height: ${
|
|
2135
|
-
background: ${
|
|
2130
|
+
height: ${S};
|
|
2131
|
+
background: ${r.track};
|
|
2136
2132
|
border-radius: 100px;
|
|
2137
2133
|
overflow: hidden;
|
|
2138
2134
|
}
|
|
@@ -2140,7 +2136,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2140
2136
|
.progress-bar {
|
|
2141
2137
|
height: 100%;
|
|
2142
2138
|
width: ${f}%;
|
|
2143
|
-
background: ${
|
|
2139
|
+
background: ${r.bar};
|
|
2144
2140
|
border-radius: 100px;
|
|
2145
2141
|
transition: width 500ms ease-out;
|
|
2146
2142
|
${a?`
|
|
@@ -2179,7 +2175,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2179
2175
|
aria-valuemax="${n}"></div>
|
|
2180
2176
|
</div>
|
|
2181
2177
|
</div>
|
|
2182
|
-
`}};A("af-progress",
|
|
2178
|
+
`}};A("af-progress",hn);Rl=hn});var qo={};Q(qo,{default:()=>Bl,AfriLoader:()=>rn});var rn,Bl;var Ho=x(()=>{M();rn=class rn extends c{static get observedAttributes(){return["size","color","type"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("size")||"40",n=this.getAttribute("color")||"currentColor",o=this.getAttribute("type")||"spiral",b={spiral:`M25,25 m0,-20 a20,20 0 1,1 0,40 a20,20 0 1,1 0,-40
|
|
2183
2179
|
M25,25 m0,-15 a15,15 0 1,0 0,30 a15,15 0 1,0 0,-30`,sun:"M25,5 L25,45 M5,25 L45,25 M11,11 L39,39 M39,11 L11,39",diamond:"M25,5 L45,25 L25,45 L5,25 Z"};this.shadowRoot.innerHTML=`
|
|
2184
2180
|
<style>
|
|
2185
2181
|
:host {
|
|
@@ -2210,7 +2206,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2210
2206
|
${o==="spiral"?`<path d="${b.spiral}" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" />`:o==="sun"?`<path d="${b.sun}" stroke="currentColor" stroke-width="4" stroke-linecap="round" />`:`<path d="${b.diamond}" fill="none" stroke="currentColor" stroke-width="4" />`}
|
|
2211
2207
|
</svg>
|
|
2212
2208
|
</div>
|
|
2213
|
-
`}};A("af-loader",rn);
|
|
2209
|
+
`}};A("af-loader",rn);Bl=rn});var Eo={};Q(Eo,{default:()=>Dl,AfriSkeleton:()=>gn});var gn,Dl;var xo=x(()=>{M();gn=class gn extends c{static get observedAttributes(){return["variant","width","height","lines"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"text",n=this.getAttribute("width")||"100%",o=this.getAttribute("height")||"auto",b=parseInt(this.getAttribute("lines"))||1,l={text:{height:"16px",borderRadius:"4px"},title:{height:"28px",borderRadius:"4px"},avatar:{width:"48px",height:"48px",borderRadius:"50%"},card:{height:"200px",borderRadius:"12px"},button:{height:"40px",borderRadius:"6px",width:"120px"}},a=l[t]||l.text;this.shadowRoot.innerHTML=`
|
|
2214
2210
|
<style>
|
|
2215
2211
|
:host {
|
|
2216
2212
|
display: block;
|
|
@@ -2246,7 +2242,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2246
2242
|
</style>
|
|
2247
2243
|
|
|
2248
2244
|
${t==="text"||t==="title"?Array(b).fill(0).map(()=>'<div class="skeleton skeleton-line"></div>').join(""):`<div class="skeleton" style="width: ${a.width||n}; height: ${a.height||o};"></div>`}
|
|
2249
|
-
`}};A("af-skeleton"
|
|
2245
|
+
`}};A("af-skeleton",gn);Dl=gn});var Yo={};Q(Yo,{default:()=>Ol,AfriDivider:()=>$n});var $n,Ol;var Xo=x(()=>{M();$n=class $n extends c{static get observedAttributes(){return["pattern","height","color","flip"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}_getPatternPath(t,n,o){switch(t||"zigzag"){case"zigzag":return`M0,${o} L${n/4},0 L${n/2},${o} L${n*0.75},0 L${n},${o} V${o+10} H0 Z`;case"waves":return`M0,${o/2} Q${n/4},0 ${n/2},${o/2} T${n},${o/2} V${o} H0 Z`;case"triangles":return`M0,${o} L${n/8},0 L${n/4},${o} L${n*0.375},0 L${n/2},${o}
|
|
2250
2246
|
L${n*0.625},0 L${n*0.75},${o} L${n*0.875},0 L${n},${o} V${o+10} H0 Z`;case"diamonds":return`M0,0 H${n} V${o/2}
|
|
2251
2247
|
L${n*0.9},${o} L${n*0.8},${o/2}
|
|
2252
2248
|
L${n*0.7},${o} L${n*0.6},${o/2}
|
|
@@ -2271,7 +2267,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2271
2267
|
<svg viewBox="0 0 100 ${n}" preserveAspectRatio="none">
|
|
2272
2268
|
<path d="${this._getPatternPath(t,100,parseInt(n))}" fill="currentColor" />
|
|
2273
2269
|
</svg>
|
|
2274
|
-
`}};A("af-divider"
|
|
2270
|
+
`}};A("af-divider",$n);Ol=$n});var So={};Q(So,{default:()=>Wl,KangaCard:()=>vn});var vn,Wl;var ko=x(()=>{M();kt();vn=class vn extends c{static get observedAttributes(){return["theme","proverb","proverb-translation"]}constructor(){super();this.render()}connectedCallback(){this.loadStyles(),this.applyTheme()}attributeChangedCallback(t,n,o){if(n!==o)if(t==="theme")this.applyTheme();else this.render()}getThemeColors(){let t=this.getAttribute("theme")||"tanzania",n={tanzania:{primary:"#1EB53A",accent:"#FCD116",border:"#00A3DD",text:"#000000"},maasai:{primary:"#8B0000",accent:"#FF0000",border:"#000000",text:"#FFFFFF"},ndebele:{primary:"#4169E1",accent:"#FFD700",border:"#FF69B4",text:"#000000"}};return n[t]||n.tanzania}applyTheme(){let t=this.getThemeColors(),n=this.shadowRoot.querySelector(".pindo");if(n){let o=generateKangaBorder({primaryColor:t.primary,accentColor:t.accent});n.style.backgroundImage=`url("${o}")`,n.style.backgroundRepeat="repeat"}}render(){let t=this.getAttribute("proverb")||"",n=this.getAttribute("proverb-translation")||"",o=this.getThemeColors();this.shadowRoot.innerHTML=`
|
|
2275
2271
|
<style>
|
|
2276
2272
|
:host {
|
|
2277
2273
|
display: block;
|
|
@@ -2353,7 +2349,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2353
2349
|
</div>
|
|
2354
2350
|
`:'<div class="jina"><slot name="proverb"></slot></div>'}
|
|
2355
2351
|
</article>
|
|
2356
|
-
`,this.applyTheme()}};A("af-kanga-card",
|
|
2352
|
+
`,this.applyTheme()}};A("af-kanga-card",vn);Wl=vn});var Mo={};Q(Mo,{default:()=>dl,CulturalCard:()=>wn});var wn,dl;var Qo=x(()=>{M();kt();wn=class wn extends c{static get observedAttributes(){return["culture","interactive"]}constructor(){super();this._cultures={maasai:{name:"Maasai",region:"Tanzania/Kenya",pattern:"generateShuka",colors:{primary:"#FF0000",accent:"#000000"}},hadzabe:{name:"Hadzabe",region:"Tanzania",pattern:"generateHadzabe",colors:{primary:"#8B4513",accent:"#CD853F"}},swahili:{name:"Swahili",region:"East Africa",pattern:"generateKangaBorder",colors:{primary:"#1EB53A",accent:"#FCD116"}},kitenge:{name:"Kitenge",region:"East Africa",pattern:"generateKitenge",colors:{primary:"#00A3DD",accent:"#1EB53A"}},tibeb:{name:"Tibeb",region:"Ethiopia",pattern:"generateTibeb",colors:{primary:"#009E60",accent:"#FCDD09"}},ashanti:{name:"Ashanti/Akan",region:"Ghana",pattern:"generateKente",colors:{primary:"#FFD700",accent:"#228B22"}},adinkra:{name:"Adinkra",region:"Ghana",pattern:"generateAdinkra",colors:{primary:"#000000",accent:"#CD853F"}},bogolan:{name:"Bogolan",region:"Mali",pattern:"generateBogolan",colors:{primary:"#3E2723",accent:"#D7CCC8"}},yoruba:{name:"Yoruba",region:"Nigeria",pattern:"generateAsoOke",colors:{primary:"#4B0082",accent:"#FFD700"}},ankara:{name:"Ankara",region:"West Africa",pattern:"generateAnkara",colors:{primary:"#FF6B00",accent:"#00A86B"}},kuba:{name:"Kuba Shoowa",region:"DRC",pattern:"generateKuba",colors:{primary:"#D2B48C",accent:"#3E2723"}},imigongo:{name:"Imigongo",region:"Rwanda",pattern:"generateImigongo",colors:{primary:"#000000",accent:"#B22222"}},ndebele:{name:"Ndebele",region:"South Africa",pattern:"generateNdebele",colors:{primary:"#4169E1",accent:"#FFD700"}},zulu:{name:"Zulu",region:"South Africa",pattern:"generateZulu",colors:{primary:"#FF0000",accent:"#000000"}},swazi:{name:"Swazi",region:"Eswatini",pattern:"generateSwazi",colors:{primary:"#3E5EB9",accent:"#FECD00"}},xhosa:{name:"Xhosa",region:"South Africa",pattern:"generateXhosa",colors:{primary:"#00A86B",accent:"#1a1a2e"}}},this.render()}connectedCallback(){this._setupInteraction()}_setupInteraction(){if(!this.hasAttribute("interactive"))return;this.shadowRoot.querySelector(".culture-selector")?.addEventListener("change",(n)=>{this.setAttribute("culture",n.target.value),this.emit("af-culture-change",{culture:n.target.value})})}attributeChangedCallback(){this.render(),this._setupInteraction()}render(){let t=this.getAttribute("culture")||"maasai",n=this.hasAttribute("interactive"),o=this._cultures[t]||this._cultures.maasai,b=St[o.pattern],l=b?b():"";this.shadowRoot.innerHTML=`
|
|
2357
2353
|
<style>
|
|
2358
2354
|
:host {
|
|
2359
2355
|
display: block;
|
|
@@ -2518,7 +2514,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2518
2514
|
`:""}
|
|
2519
2515
|
</div>
|
|
2520
2516
|
</article>
|
|
2521
|
-
`}};A("af-cultural-card",
|
|
2517
|
+
`}};A("af-cultural-card",wn);dl=wn});var Jo={};Q(Jo,{default:()=>Ul,PatternShowcase:()=>cn});var cn,Ul;var Go=x(()=>{M();kt();cn=class cn extends c{static get observedAttributes(){return["region","size"]}constructor(){super();this._allPatterns=[{key:"shuka",name:"Maasai Shuka",region:"east",country:"Tanzania/Kenya",fn:En,meaning:"Bravery, Unity, Identity"},{key:"hadzabe",name:"Hadzabe",region:"east",country:"Tanzania",fn:xn,meaning:"Ancient traditions, Hunter-gatherer heritage"},{key:"kanga",name:"Kanga",region:"east",country:"Tanzania/Kenya",fn:Yn,meaning:"Communication, Proverbs, Femininity"},{key:"kitenge",name:"Kitenge",region:"east",country:"East Africa",fn:Xn,meaning:"Celebration, African identity"},{key:"tibeb",name:"Tibeb",region:"east",country:"Ethiopia",fn:Fn,meaning:"Faith, Tradition, Celebration"},{key:"kente",name:"Kente",region:"west",country:"Ghana",fn:Sn,meaning:"Royalty, Wisdom, Celebration"},{key:"adinkra",name:"Adinkra",region:"west",country:"Ghana",fn:kn,meaning:"Philosophy, Proverbs, Wisdom"},{key:"bogolan",name:"Bogolan",region:"west",country:"Mali",fn:Jn,meaning:"Earth energy, Protection, Healing"},{key:"asooke",name:"Aso-Oke",region:"west",country:"Nigeria",fn:Mn,meaning:"Prestige, Celebration, Heritage"},{key:"adire",name:"Adire (Indigo)",region:"west",country:"Nigeria",fn:Wn,meaning:"Creativity, Uniqueness, Depth"},{key:"ankara",name:"Ankara",region:"west",country:"West Africa",fn:Qn,meaning:"Boldness, Pan-African pride"},{key:"kuba",name:"Kuba Shoowa",region:"central",country:"DRC",fn:Gn,meaning:"Status, Mathematics, Eternity"},{key:"imigongo",name:"Imigongo",region:"central",country:"Rwanda",fn:Ln,meaning:"Resilience, Strength, Artistry"},{key:"berber",name:"Berber",region:"north",country:"North Africa",fn:On,meaning:"Protection, Nature, Identity"},{key:"ndebele",name:"Ndebele",region:"south",country:"South Africa",fn:mn,meaning:"Artistry, Marriage, Status"},{key:"zulu",name:"Zulu Beadwork",region:"south",country:"South Africa",fn:Rn,meaning:"Love letters, Community"},{key:"swazi",name:"Swazi",region:"south",country:"Eswatini",fn:Bn,meaning:"Monarchy, Warriors, Pride"},{key:"xhosa",name:"Xhosa",region:"south",country:"South Africa",fn:Dn,meaning:"Dignity, Coming of age"}],this.render()}connectedCallback(){this._setupHovers()}_setupHovers(){this.shadowRoot.querySelectorAll(".pattern-item").forEach((t)=>{t.addEventListener("click",()=>{let n=t.dataset.key,o=this._allPatterns.find((b)=>b.key===n);if(o)this.emit("af-pattern-select",{pattern:o})})})}attributeChangedCallback(){this.render(),this._setupHovers()}render(){let t=this.getAttribute("region")||"all",n=this.getAttribute("size")||"md",o=t==="all"?this._allPatterns:this._allPatterns.filter((a)=>a.region===t),b={sm:80,md:120,lg:160},l=b[n]||b.md;this.shadowRoot.innerHTML=`
|
|
2522
2518
|
<style>
|
|
2523
2519
|
:host {
|
|
2524
2520
|
display: block;
|
|
@@ -2651,7 +2647,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2651
2647
|
`).join("")}
|
|
2652
2648
|
</div>
|
|
2653
2649
|
</div>
|
|
2654
|
-
`,this.shadowRoot.querySelectorAll(".region-tab").forEach((a)=>{a.addEventListener("click",()=>{this.setAttribute("region",a.dataset.region)})})}};A("af-pattern-showcase",
|
|
2650
|
+
`,this.shadowRoot.querySelectorAll(".region-tab").forEach((a)=>{a.addEventListener("click",()=>{this.setAttribute("region",a.dataset.region)})})}};A("af-pattern-showcase",cn);Ul=cn});var Lo={};Q(Lo,{AfriLanguageSwitcher:()=>en});var en;var Fo=x(()=>{M();en=class en extends c{static get observedAttributes(){return["current"]}render(){let t=[{code:"en",name:"English"},{code:"sw",name:"Kiswahili"},{code:"fr",name:"Français"},{code:"ar",name:"العربية",dir:"rtl"},{code:"am",name:"አማርኛ"},{code:"yo",name:"Yorùbá"}],n=this.getAttribute("current")||"en",o=t.find((b)=>b.code===n)||t[0];this.shadowRoot.innerHTML=m`
|
|
2655
2651
|
<style>
|
|
2656
2652
|
:host { display: inline-block; position: relative; font-family: var(--font-body); }
|
|
2657
2653
|
.switcher-btn {
|
|
@@ -2696,13 +2692,13 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2696
2692
|
</button>
|
|
2697
2693
|
|
|
2698
2694
|
<div class="dropdown">
|
|
2699
|
-
${t.map((b)=>
|
|
2695
|
+
${t.map((b)=>m`
|
|
2700
2696
|
<div class="lang-option" data-code="${b.code}" dir="${b.dir||"ltr"}">
|
|
2701
2697
|
${b.name}
|
|
2702
2698
|
</div>
|
|
2703
2699
|
`)}
|
|
2704
2700
|
</div>
|
|
2705
|
-
`,this.shadowRoot.querySelector(".switcher-btn").onclick=()=>{this.toggleAttribute("open")},this.shadowRoot.querySelectorAll(".lang-option").forEach((b)=>{b.onclick=()=>{let l=b.dataset.code;if(this.setAttribute("current",l),this.removeAttribute("open"),this.emit("lang-change",{code:l}),l==="ar")document.documentElement.dir="rtl";else document.documentElement.dir="ltr"}})}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}};A("af-language-switcher",en)});var
|
|
2701
|
+
`,this.shadowRoot.querySelector(".switcher-btn").onclick=()=>{this.toggleAttribute("open")},this.shadowRoot.querySelectorAll(".lang-option").forEach((b)=>{b.onclick=()=>{let l=b.dataset.code;if(this.setAttribute("current",l),this.removeAttribute("open"),this.emit("lang-change",{code:l}),l==="ar")document.documentElement.dir="rtl";else document.documentElement.dir="ltr"}})}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}};A("af-language-switcher",en)});var mo={};Q(mo,{AfriAuth:()=>sn});var sn;var Ro=x(()=>{M();sn=class sn extends c{constructor(){super();this.mode="login"}connectedCallback(){this.render(),this.setupEvents()}setupEvents(){let t=this.shadowRoot.querySelector("form"),n=this.shadowRoot.querySelector(".toggle-mode");if(n)n.addEventListener("click",(o)=>{o.preventDefault(),this.mode=this.mode==="login"?"register":"login",this.render(),this.setupEvents()});if(t)t.addEventListener("submit",async(o)=>{o.preventDefault();let b=this.shadowRoot.querySelector("#email").value,l=this.shadowRoot.querySelector("#password").value,a=this.shadowRoot.querySelector(".feedback");a.textContent="Processing...";try{let h=await(await fetch("/api/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:this.mode,email:b,password:l})})).json();if(h.error)a.textContent=h.error,a.style.color="#ef4444";else a.textContent="Success! Redirecting...",a.style.color="#22c55e",setTimeout(()=>window.location.href="/",1000)}catch(f){a.textContent="Network Error"}})}render(){let t=this.mode==="login";this.shadowRoot.innerHTML=`
|
|
2706
2702
|
<style>
|
|
2707
2703
|
:host {
|
|
2708
2704
|
display: block;
|
|
@@ -2800,7 +2796,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2800
2796
|
<span class="toggle-mode">${t?"Create an account":"Sign in"}</span>
|
|
2801
2797
|
</div>
|
|
2802
2798
|
</div>
|
|
2803
|
-
`}};A("af-auth",sn)});var
|
|
2799
|
+
`}};A("af-auth",sn)});var Bo={};Q(Bo,{default:()=>Vl});var zn,Vl;var Do=x(()=>{M();zn=class zn extends c{constructor(){super();this.currentTheme="dark"}connectedCallback(){this.loadStyles();let t=localStorage.getItem("africode-theme");if(t)this.currentTheme=t,document.documentElement.setAttribute("data-theme",t);else{let n=window.matchMedia("(prefers-color-scheme: light)").matches;this.currentTheme=n?"light":"dark",document.documentElement.setAttribute("data-theme",this.currentTheme)}this.render()}toggleTheme(){this.currentTheme=this.currentTheme==="dark"?"light":"dark",document.documentElement.setAttribute("data-theme",this.currentTheme),localStorage.setItem("africode-theme",this.currentTheme),window.dispatchEvent(new CustomEvent("theme-changed",{detail:{theme:this.currentTheme}})),this.render()}render(){let t=this.currentTheme==="dark";this.shadowRoot.innerHTML=m`
|
|
2804
2800
|
<style>
|
|
2805
2801
|
.toggle-btn {
|
|
2806
2802
|
background: var(--bg-surface-elevated, var(--afri-obsidian));
|
|
@@ -2829,7 +2825,7 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2829
2825
|
<span class="icon">\${isDark ? '🌙' : '☀️'}</span>
|
|
2830
2826
|
<span>\${isDark ? 'Dark Mode' : 'Light Mode'}</span>
|
|
2831
2827
|
</button>
|
|
2832
|
-
`;let n=this.shadowRoot.querySelector(".toggle-btn");if(n)n.addEventListener("click",()=>this.toggleTheme())}};A("af-theme-toggle",zn);
|
|
2828
|
+
`;let n=this.shadowRoot.querySelector(".toggle-btn");if(n)n.addEventListener("click",()=>this.toggleTheme())}};A("af-theme-toggle",zn);Vl=zn});z();Xt();kt();var dn={};Q(dn,{transitionPage:()=>l0,default:()=>eo,animateStaggered:()=>b0,Easing:()=>Wt});var Wt={DrumBeat:"cubic-bezier(0.1, 0.9, 0.2, 1.0)",KoraPluck:"cubic-bezier(0.34, 1.56, 0.64, 1)",RiverFlow:"cubic-bezier(0.4, 0.0, 0.2, 1)"};function b0(t,{delay:n=50,duration:o=600,easing:b=Wt.DrumBeat,y:l=20,scale:a=0.95}={}){let f=typeof t==="string"?document.querySelectorAll(t):t;if(!f||f.length===0)return;let h=new IntersectionObserver((r)=>{r.forEach((_,S)=>{if(_.isIntersecting){let L=Math.random()*10,G=S*n+L,B=_.target;B.animate([{opacity:0,transform:`translateY(${l}px) scale(${a})`},{opacity:1,transform:"translateY(0) scale(1)"}],{duration:o,delay:G,easing:b,fill:"forwards"}),h.unobserve(B),B.style.opacity="1"}})},{threshold:0.1});f.forEach((r)=>{r.style.opacity="0",h.observe(r)})}function l0(t){document.body.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(0.98)"}],{duration:200,easing:"ease-in"}).onfinish=()=>{t(),document.body.animate([{opacity:0,transform:"scale(1.02)"},{opacity:1,transform:"scale(1)"}],{duration:400,easing:Wt.DrumBeat})}}var eo={Easing:Wt,animateStaggered:b0,transitionPage:l0};function a0(t){if(typeof window>"u")return;if(!("IntersectionObserver"in window)){Object.values(t).forEach((o)=>o());return}let n=new IntersectionObserver((o)=>{o.forEach((b)=>{if(b.isIntersecting){let l=b.target.tagName.toLowerCase(),a=t[l];if(a)console.log(`\uD83C\uDFDD️ Hydrating Island: <${l}>`),a().then(()=>{delete t[l]}).catch((f)=>console.error(`Failed to hydrate <${l}>`,f));n.unobserve(b.target)}})},{rootMargin:"50px 0px"});Object.keys(t).forEach((o)=>{document.querySelectorAll(o).forEach((b)=>n.observe(b))})}M();M();class jn extends c{static get observedAttributes(){return["theme","fallback-message"]}constructor(){super();this._hasError=!1,this._errorDetail=null,this.render()}connectedCallback(){this.addEventListener("af-component-error",this._handleError.bind(this))}disconnectedCallback(){this.removeEventListener("af-component-error",this._handleError.bind(this))}_handleError(t){t.stopPropagation(),this._hasError=!0,this._errorDetail=t.detail,console.warn("[AfriCode Boundary] Caught error:",this._errorDetail),this.render()}reset(){this._hasError=!1,this._errorDetail=null,this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("theme")||"tanzania",n=this.getAttribute("fallback-message")||"A part of this page failed to load.",o={tanzania:{bg:"#FFF9E6",border:"#FCD116",text:"#5A4A00"},maasai:{bg:"#FFEEEE",border:"#FF0000",text:"#8B0000"},ndebele:{bg:"#EBF0FF",border:"#4169E1",text:"#002B5C"},ocean:{bg:"#E6FAFF",border:"#00A3DD",text:"#004A66"}},b=o[t]||o.tanzania;if(this._hasError){this.shadowRoot.innerHTML=`
|
|
2833
2829
|
<style>
|
|
2834
2830
|
:host { display: block; width: 100%; font-family: 'Inter', system-ui, sans-serif; }
|
|
2835
2831
|
.boundary-error {
|
|
@@ -2900,6 +2896,6 @@ var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null
|
|
|
2900
2896
|
`,this.shadowRoot.getElementById("retry-btn").addEventListener("click",()=>{this.reset()});return}this.shadowRoot.innerHTML=`
|
|
2901
2897
|
<style>:host { display: block; }</style>
|
|
2902
2898
|
<slot></slot>
|
|
2903
|
-
`}}A("af-error-boundary",jn);var
|
|
2899
|
+
`}}A("af-error-boundary",jn);var Oo={"af-button":()=>Promise.resolve().then(() => ($0(),g0)),"af-card":()=>Promise.resolve().then(() => (w0(),v0)),"af-navbar":()=>Promise.resolve().then(() => (_0(),c0)),"af-input":()=>Promise.resolve().then(() => (D0(),B0)),"af-alert":()=>Promise.resolve().then(() => (W0(),O0)),"af-grid":()=>Promise.resolve().then(() => (U0(),d0)),"af-section":()=>Promise.resolve().then(() => (j0(),V0)),"af-icon":()=>Promise.resolve().then(() => (K0(),N0)),"af-accordion":()=>Promise.resolve().then(() => (u0(),p0)),"af-hero":()=>Promise.resolve().then(() => (i0(),I0)),"af-table":()=>Promise.resolve().then(() => (T0(),P0)),"af-modal":()=>Promise.resolve().then(() => (y0(),C0)),"af-tabs":()=>Promise.resolve().then(() => (e0(),Z0)),"af-sidebar":()=>Promise.resolve().then(() => (z0(),s0)),"af-dropdown":()=>Promise.resolve().then(() => (no(),to)),"af-select":()=>Promise.resolve().then(() => (bo(),oo)),"af-form":()=>Promise.resolve().then(() => (ao(),lo)),"af-tooltip":()=>Promise.resolve().then(() => (ho(),fo)),"af-toast":()=>Promise.resolve().then(() => (go(),ro)),"af-badge":()=>Promise.resolve().then(() => (vo(),$o)),"af-avatar":()=>Promise.resolve().then(() => (co(),wo)),"af-progress":()=>Promise.resolve().then(() => (Ao(),_o)),"af-loader":()=>Promise.resolve().then(() => (Ho(),qo)),"af-skeleton":()=>Promise.resolve().then(() => (xo(),Eo)),"af-divider":()=>Promise.resolve().then(() => (Xo(),Yo)),"af-kanga-card":()=>Promise.resolve().then(() => (ko(),So)),"af-cultural-card":()=>Promise.resolve().then(() => (Qo(),Mo)),"af-pattern-showcase":()=>Promise.resolve().then(() => (Go(),Jo)),"af-language-switcher":()=>Promise.resolve().then(() => (Fo(),Lo)),"af-auth":()=>Promise.resolve().then(() => (Ro(),mo)),"af-theme-toggle":()=>Promise.resolve().then(() => (Do(),Bo))};z();function jl(t={}){if(typeof window<"u"){console.log("\uD83C\uDF0D AfriCode Client SDK Initialized (Zero-Config Mode)");let n={...Oo,...t};if(Object.keys(n).length>0)a0(n)}}var mf={createReactiveState:at,subscribe:T,createSignal:qn,createEffect:Hn,store:D,actions:n0,patterns:St,motion:dn,html:m,Layout:f0,init:jl};export{T as subscribe,D as store,St as patterns,dn as motion,jl as init,m as html,mf as default,qn as createSignal,at as createReactiveState,Hn as createEffect,n0 as actions,f0 as Layout};
|
|
2904
2900
|
|
|
2905
|
-
//# debugId=
|
|
2901
|
+
//# debugId=E47C17E1BD0D369F64756E2164756E21
|