@africode/core 5.0.3 → 5.0.4
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/core/cli/commands/build.js +2 -1
- package/core/sdk-browser.js +140 -0
- package/dist/africode.js +184 -183
- package/dist/africode.js.map +16 -9
- package/dist/build-info.json +3 -3
- package/package.json +6 -5
- package/templates/starter/src/pages/index.html +2 -2
- package/templates/starter-3d/src/pages/index.html +2 -2
- package/templates/starter-react/src/pages/index.html +2 -2
- package/templates/starter-tailwind/src/pages/index.html +2 -2
- package/src/index.ts +0 -196
package/dist/africode.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null,n)}var L=(t,n)=>{for(var o in n)Ao(t,o,{get:n[o],enumerable:!0,configurable:!0,set:Ho.bind(n,o)})};var Y=(t,n)=>()=>(t&&(n=t(t=0)),n);function vt(t){if(Kt.has(t))return Kt.get(t);let o=new Proxy(t,{get(b,l,h){let f=Reflect.get(b,l,h);if(f!==null&&typeof f==="object")return vt(f);return f},set(b,l,h,f){let a=Reflect.get(b,l,f);if(a!==h){let g=Reflect.set(b,l,h,f);if(g)Bn(f,h,a,l);return g}return!0},deleteProperty(b,l){let h=Reflect.get(b,l),f=Reflect.deleteProperty(b,l);if(f){let a=Kt.get(b);Bn(a,void 0,h,l)}return f}});return Kt.set(t,o),o}function y(t,n){if(!mt.has(t))mt.set(t,new Set);let o=mt.get(t);return o.add(n),()=>{o.delete(n)}}function Bn(t,n,o,b){let l=mt.get(t);if(!l)return;l.forEach((h)=>{try{h(n,o,b)}catch(f){console.error("[AfriCode State] Subscriber error:",f)}})}class J0{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 Rn(t){let n=t,o=new Set,b=()=>{return n},l=(h)=>{if(n!==h)n=typeof h==="function"?h(n):h,o.forEach((f)=>f()),Bn()};return b.subscribe=(h)=>{return o.add(h),()=>o.delete(h)},[b,l]}function Dn(t){return t(),y(t)}var mt,Kt,Mh;var ot=Y(()=>{mt=new WeakMap,Kt=new WeakMap;Mh=new J0});var Xo,W,G0;var kt=Y(()=>{ot();Xo={theme:"light",language:"en",ui:{sidebarCollapsed:!1,theme:"dark",activePage:"home"},user:{name:"Guest",permissions:[]},config:{animationsEnabled:!0,soundEnabled:!1}},W=vt(Xo),G0={setTheme(t){if(["dark","light","system"].includes(t))W.theme=t,W.ui.theme=t},setLanguage(t){W.language=t},toggleSidebar(t){if(typeof t==="boolean")W.ui.sidebarCollapsed=t;else W.ui.sidebarCollapsed=!W.ui.sidebarCollapsed},setActivePage(t){W.ui.activePage=t}}});function Yo(t,n,o=50,b=50){let l=[];for(let h=0;h<t;h++){let f=2*Math.PI*h/t-Math.PI/2,a=o+n*Math.cos(f),g=b+n*Math.sin(f);l.push(`${a.toFixed(2)},${g.toFixed(2)}`)}return l.join(" ")}function On({primaryColor:t="#FF0000",secondaryColor:n="#000000",backgroundColor:o="#8B0000",stripeWidth:b=4,size:l=40}={}){let h=`
|
|
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"/>
|
|
@@ -8,7 +8,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
8
8
|
<rect x="${l/2-b/2}" y="0" width="${b}" height="${l}" fill="${n}" opacity="0.4"/>
|
|
9
9
|
<rect x="${l-b}" y="0" width="${b}" height="${l}" fill="${t}" opacity="0.5"/>
|
|
10
10
|
</svg>
|
|
11
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
11
|
+
`;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function Wn({earthColor:t="#8B4513",ochreColor:n="#CD853F",charcoalColor:o="#2F2F2F",size:b=50}={}){let l=`
|
|
12
12
|
<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
|
|
13
13
|
<rect width="${b}" height="${b}" fill="${t}"/>
|
|
14
14
|
<!-- Cave art inspired figures -->
|
|
@@ -23,7 +23,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.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 En({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 Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.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 xo({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 Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.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 Qo({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 Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.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 Jo({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 -->
|
|
@@ -68,7 +68,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
68
68
|
<circle cx="${b*0.5}" cy="${b*0.8}" r="${b*0.08}" fill="${n}"/>
|
|
69
69
|
<circle cx="${b*0.8}" cy="${b*0.8}" r="${b*0.08}" fill="${t}"/>
|
|
70
70
|
</svg>
|
|
71
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function
|
|
71
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Go({primaryColor:t="#8B0000",secondaryColor:n="#FFD700",backgroundColor:o="#654321",size:b=50}={}){let l=`
|
|
72
72
|
<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
|
|
73
73
|
<ellipse cx="${b*0.5}" cy="${b*0.5}" rx="${b*0.4}" ry="${b*0.45}" fill="${o}"/>
|
|
74
74
|
<!-- Shield patterns -->
|
|
@@ -78,7 +78,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.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 Mo({primaryColor:t="#FF1493",secondaryColor:n="#00FF00",accentColor:o="#FFFF00",backgroundColor:b="#FFFFFF",size:l=50}={}){let h=`
|
|
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 -->
|
|
@@ -90,7 +90,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
90
90
|
<circle cx="${l*0.5}" cy="${l*0.5}" r="${l*0.15}" fill="${n}"/>
|
|
91
91
|
<rect x="${l*0.45}" y="${l*0.45}" width="${l*0.1}" height="${l*0.1}" fill="${o}"/>
|
|
92
92
|
</svg>
|
|
93
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
93
|
+
`;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function Un({primaryColor:t="#00A3DD",secondaryColor:n="#FCD116",backgroundColor:o="#1EB53A",size:b=50}={}){let l=`
|
|
94
94
|
<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
|
|
95
95
|
<rect width="${b}" height="${b}" fill="${o}"/>
|
|
96
96
|
<circle cx="${b*0.25}" cy="${b*0.25}" r="${b*0.2}" fill="${t}" opacity="0.8"/>
|
|
@@ -100,9 +100,9 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
100
100
|
<circle cx="${b*0.75}" cy="${b*0.25}" r="${b*0.08}" fill="${n}" opacity="0.6"/>
|
|
101
101
|
<circle cx="${b*0.25}" cy="${b*0.75}" r="${b*0.08}" fill="${n}" opacity="0.6"/>
|
|
102
102
|
</svg>
|
|
103
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function
|
|
103
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Vn({colors:t=["#FFD700","#228B22","#DC143C","#000000"],size:n=60}={}){let[o,b,l,h]=t,f=n/6,a=`
|
|
104
104
|
<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
|
|
105
|
-
<rect width="${n}" height="${n}" fill="${
|
|
105
|
+
<rect width="${n}" height="${n}" fill="${h}"/>
|
|
106
106
|
<!-- Horizontal bands -->
|
|
107
107
|
<rect x="0" y="0" width="${n}" height="${f}" fill="${o}"/>
|
|
108
108
|
<rect x="0" y="${f}" width="${n}" height="${f}" fill="${b}"/>
|
|
@@ -111,15 +111,15 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
111
111
|
<rect x="0" y="${f*4}" width="${n}" height="${f}" fill="${b}"/>
|
|
112
112
|
<rect x="0" y="${f*5}" width="${n}" height="${f}" fill="${l}"/>
|
|
113
113
|
<!-- Vertical accents -->
|
|
114
|
-
<rect x="${n*0.2}" y="0" width="3" height="${n}" fill="${
|
|
115
|
-
<rect x="${n*0.4}" y="0" width="3" height="${n}" fill="${
|
|
116
|
-
<rect x="${n*0.6}" y="0" width="3" height="${n}" fill="${
|
|
117
|
-
<rect x="${n*0.8}" y="0" width="3" height="${n}" fill="${
|
|
114
|
+
<rect x="${n*0.2}" y="0" width="3" height="${n}" fill="${h}" opacity="0.5"/>
|
|
115
|
+
<rect x="${n*0.4}" y="0" width="3" height="${n}" fill="${h}" opacity="0.5"/>
|
|
116
|
+
<rect x="${n*0.6}" y="0" width="3" height="${n}" fill="${h}" opacity="0.5"/>
|
|
117
|
+
<rect x="${n*0.8}" y="0" width="3" height="${n}" fill="${h}" opacity="0.5"/>
|
|
118
118
|
<!-- Kente squares -->
|
|
119
|
-
<rect x="${n*0.1}" y="${n*0.1}" width="${n*0.15}" height="${n*0.15}" fill="${o}" stroke="${
|
|
120
|
-
<rect x="${n*0.75}" y="${n*0.75}" width="${n*0.15}" height="${n*0.15}" fill="${l}" stroke="${
|
|
119
|
+
<rect x="${n*0.1}" y="${n*0.1}" width="${n*0.15}" height="${n*0.15}" fill="${o}" stroke="${h}" stroke-width="1"/>
|
|
120
|
+
<rect x="${n*0.75}" y="${n*0.75}" width="${n*0.15}" height="${n*0.15}" fill="${l}" stroke="${h}" stroke-width="1"/>
|
|
121
121
|
</svg>
|
|
122
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
122
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function Nn({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,24 +133,24 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.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 jn({colors:t=["#4B0082","#FFD700","#FFFFFF"],size:n=50}={}){let[o,b,l]=t,h=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 -->
|
|
140
|
-
<rect x="0" y="${
|
|
141
|
-
<rect x="0" y="${
|
|
142
|
-
<rect x="0" y="${
|
|
143
|
-
<rect x="0" y="${
|
|
144
|
-
<rect x="0" y="${
|
|
140
|
+
<rect x="0" y="${h}" width="${n}" height="${h*0.5}" fill="${b}"/>
|
|
141
|
+
<rect x="0" y="${h*3}" width="${n}" height="${h*0.5}" fill="${l}"/>
|
|
142
|
+
<rect x="0" y="${h*5}" width="${n}" height="${h*0.5}" fill="${b}"/>
|
|
143
|
+
<rect x="0" y="${h*7}" width="${n}" height="${h*0.5}" fill="${l}"/>
|
|
144
|
+
<rect x="0" y="${h*9}" width="${n}" height="${h*0.5}" fill="${b}"/>
|
|
145
145
|
<!-- Vertical accent lines -->
|
|
146
|
-
<rect x="${n*0.48}" y="0" width="${
|
|
146
|
+
<rect x="${n*0.48}" y="0" width="${h*0.4}" height="${n}" fill="${b}" opacity="0.7"/>
|
|
147
147
|
<!-- Diamond motifs -->
|
|
148
148
|
<polygon points="${n*0.25},${n*0.3} ${n*0.35},${n*0.5} ${n*0.25},${n*0.7} ${n*0.15},${n*0.5}"
|
|
149
149
|
fill="${b}" stroke="${l}" stroke-width="1"/>
|
|
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 Kn({primaryColor:t="#FF6B00",secondaryColor:n="#00A86B",accentColor:o="#FFD700",backgroundColor:b="#FFFFFF",size:l=60}={}){let h=`
|
|
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 Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.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(
|
|
172
|
+
`;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function mn({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 Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.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 pn({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 Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.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 dn({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 Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.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 un({colors:t=["#009E60","#FCDD09","#EF3340"],backgroundColor:n="#FFFFFF",size:o=40}={}){let[b,l,h]=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 -->
|
|
@@ -223,12 +223,12 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
223
223
|
fill="${b}" opacity="0.2"/>
|
|
224
224
|
<polygon points="${o*0.5},${o*0.2} ${o*0.8},${o*0.5} ${o*0.5},${o*0.8} ${o*0.2},${o*0.5}"
|
|
225
225
|
fill="${l}"/>
|
|
226
|
-
<rect x="${o*0.4}" y="${o*0.4}" width="${o*0.2}" height="${o*0.2}" fill="${
|
|
226
|
+
<rect x="${o*0.4}" y="${o*0.4}" width="${o*0.2}" height="${o*0.2}" fill="${h}"/>
|
|
227
227
|
<!-- Side accents -->
|
|
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 In({colors:t=["#FFD700","#4169E1","#FF69B4","#228B22"],size:n=60,strokeWidth:o=2}={}){let[b,l,h,f]=t,a=`
|
|
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}"
|
|
@@ -239,13 +239,13 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
239
239
|
<rect x="${n*0.5}" y="${n*0.15}" width="${n*0.35}" height="${n*0.35}"
|
|
240
240
|
fill="${l}" stroke="#000000" stroke-width="${o/2}"/>
|
|
241
241
|
<rect x="${n*0.15}" y="${n*0.5}" width="${n*0.35}" height="${n*0.35}"
|
|
242
|
-
fill="${
|
|
242
|
+
fill="${h}" stroke="#000000" stroke-width="${o/2}"/>
|
|
243
243
|
<rect x="${n*0.5}" y="${n*0.5}" width="${n*0.35}" height="${n*0.35}"
|
|
244
244
|
fill="${f}" stroke="#000000" stroke-width="${o/2}"/>
|
|
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(
|
|
248
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function Pn({colors:t=["#FFFFFF","#000000","#FF0000","#00A86B","#FFD700"],size:n=50}={}){let[o,b,l,h,f]=t,a=n/10,g=`
|
|
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) -->
|
|
@@ -254,15 +254,15 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
254
254
|
<polygon points="${n*0.5},${n*0.25} ${n*0.75},${n*0.75} ${n*0.25},${n*0.75}"
|
|
255
255
|
fill="${l}"/>
|
|
256
256
|
<!-- Beadwork dots -->
|
|
257
|
-
<circle cx="${n*0.5}" cy="${n*0.35}" r="${
|
|
258
|
-
<circle cx="${n*0.35}" cy="${n*0.6}" r="${
|
|
259
|
-
<circle cx="${n*0.65}" cy="${n*0.6}" r="${
|
|
260
|
-
<circle cx="${n*0.5}" cy="${n*0.8}" r="${
|
|
257
|
+
<circle cx="${n*0.5}" cy="${n*0.35}" r="${a}" fill="${o}"/>
|
|
258
|
+
<circle cx="${n*0.35}" cy="${n*0.6}" r="${a}" fill="${h}"/>
|
|
259
|
+
<circle cx="${n*0.65}" cy="${n*0.6}" r="${a}" fill="${f}"/>
|
|
260
|
+
<circle cx="${n*0.5}" cy="${n*0.8}" r="${a}" fill="${o}"/>
|
|
261
261
|
<!-- Border dots -->
|
|
262
|
-
<circle cx="${n*0.1}" cy="${n*0.1}" r="${
|
|
263
|
-
<circle cx="${n*0.9}" cy="${n*0.1}" r="${
|
|
262
|
+
<circle cx="${n*0.1}" cy="${n*0.1}" r="${a*0.7}" fill="${l}"/>
|
|
263
|
+
<circle cx="${n*0.9}" cy="${n*0.1}" r="${a*0.7}" fill="${h}"/>
|
|
264
264
|
</svg>
|
|
265
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
265
|
+
`;return`data:image/svg+xml,${encodeURIComponent(g.trim())}`}function Tn({colors:t=["#3E5EB9","#FECD00","#B10C0C","#FFFFFF"],size:n=50}={}){let[o,b,l,h]=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) -->
|
|
@@ -273,16 +273,16 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
273
273
|
fill="${l}"/>
|
|
274
274
|
<!-- Feather accents -->
|
|
275
275
|
<line x1="${n*0.5}" y1="${n*0.05}" x2="${n*0.5}" y2="${n*0.2}"
|
|
276
|
-
stroke="${
|
|
276
|
+
stroke="${h}" stroke-width="3"/>
|
|
277
277
|
<line x1="${n*0.4}" y1="${n*0.08}" x2="${n*0.45}" y2="${n*0.15}"
|
|
278
|
-
stroke="${
|
|
278
|
+
stroke="${h}" stroke-width="2"/>
|
|
279
279
|
<line x1="${n*0.6}" y1="${n*0.08}" x2="${n*0.55}" y2="${n*0.15}"
|
|
280
|
-
stroke="${
|
|
280
|
+
stroke="${h}" stroke-width="2"/>
|
|
281
281
|
<!-- Spear points -->
|
|
282
|
-
<polygon points="${n*0.1},${n*0.3} ${n*0.05},${n*0.5} ${n*0.15},${n*0.5}" fill="${
|
|
283
|
-
<polygon points="${n*0.9},${n*0.3} ${n*0.85},${n*0.5} ${n*0.95},${n*0.5}" fill="${
|
|
282
|
+
<polygon points="${n*0.1},${n*0.3} ${n*0.05},${n*0.5} ${n*0.15},${n*0.5}" fill="${h}"/>
|
|
283
|
+
<polygon points="${n*0.9},${n*0.3} ${n*0.85},${n*0.5} ${n*0.95},${n*0.5}" fill="${h}"/>
|
|
284
284
|
</svg>
|
|
285
|
-
`;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function
|
|
285
|
+
`;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function Cn({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 Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.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
|
|
303
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Lo(t,n){t.style.backgroundImage=`url("${n}")`,t.style.backgroundRepeat="repeat"}function yn({primaryColor:t="#8B0000",secondaryColor:n="#000000",accentColor:o="#FFD700",backgroundColor:b="#F5F5DC",size:l=60}={}){let h=`
|
|
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 Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.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(
|
|
316
|
+
`;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function Zn({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 Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.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 ko({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 Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.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 So({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 Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.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 Fo({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 M0({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,20 +355,20 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.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 St;var
|
|
358
|
+
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}var St;var Ft=Y(()=>{St={generatePolygon:Yo,generateShuka:On,generateHadzabe:Wn,generateKanga:xo,generateKangaBorder:En,generateKitenge:Un,generateMasaiShield:Go,generateTibeb:un,generateImigongo:dn,generateKente:Vn,generateAdinkra:Nn,generateAsoOke:jn,generateAnkara:Kn,generateBogolan:mn,generateAdire:Zn,generateKuba:pn,generateKubaBorder:Qo,generateBerber:yn,generateNdebele:In,generateNdebelePaint:Mo,generateZulu:Pn,generateZuluBeads:Jo,generateSwazi:Tn,generateXhosa:Cn,applyPattern:Lo,generateTuareg:ko,generateGeez:So,generateBoli:Fo,generateCircuit:M0,circuit:M0}});class zn{constructor(t){this.value=t,this.__type="RawHtml",Object.freeze(this)}toString(){return this.value}valueOf(){return this.value}}function Do(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 R`<!DOCTYPE html>
|
|
359
359
|
<html lang="en">
|
|
360
360
|
<head>
|
|
361
361
|
<meta charset="UTF-8">
|
|
362
362
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
363
363
|
<title>${t}</title>
|
|
364
364
|
${n}
|
|
365
|
-
${o?
|
|
365
|
+
${o?R`<link rel="stylesheet" href="${o}">`:""}
|
|
366
366
|
<script type="module" src="/core/sdk.js"></script>
|
|
367
367
|
</head>
|
|
368
368
|
<body>
|
|
369
369
|
${b}
|
|
370
370
|
</body>
|
|
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=`
|
|
371
|
+
</html>`}function B0(t){if(t instanceof zn)return t.toString();if(Array.isArray(t))return t.map(B0).join("");if(t===null||t===void 0||t===!1)return"";if(t===!0)return"true";return Do(t)}var R=(t,...n)=>{let o="";for(let b=0;b<t.length;b++)if(o+=t[b],b<n.length)o+=B0(n[b]);return new zn(o)};var G,t0,v,p=(t)=>{switch(typeof t){case"undefined":return v.undefined;case"string":return v.string;case"number":return Number.isNaN(t)?v.nan:v.number;case"boolean":return v.boolean;case"function":return v.function;case"bigint":return v.bigint;case"symbol":return v.symbol;case"object":if(Array.isArray(t))return v.array;if(t===null)return v.null;if(t.then&&typeof t.then==="function"&&t.catch&&typeof t.catch==="function")return v.promise;if(typeof Map<"u"&&t instanceof Map)return v.map;if(typeof Set<"u"&&t instanceof Set)return v.set;if(typeof Date<"u"&&t instanceof Date)return v.date;return v.object;default:return v.unknown}};var Bt=Y(()=>{(function(t){t.assertEqual=(l)=>{};function n(l){}t.assertIs=n;function o(l){throw Error()}t.assertNever=o,t.arrayToEnum=(l)=>{let h={};for(let f of l)h[f]=f;return h},t.getValidEnumValues=(l)=>{let h=t.objectKeys(l).filter((a)=>typeof l[l[a]]!=="number"),f={};for(let a of h)f[a]=l[a];return t.objectValues(f)},t.objectValues=(l)=>{return t.objectKeys(l).map(function(h){return l[h]})},t.objectKeys=typeof Object.keys==="function"?(l)=>Object.keys(l):(l)=>{let h=[];for(let f in l)if(Object.prototype.hasOwnProperty.call(l,f))h.push(f);return h},t.find=(l,h)=>{for(let f of l)if(h(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,h=" | "){return l.map((f)=>typeof f==="string"?`'${f}'`:f).join(h)}t.joinValues=b,t.jsonStringifyReplacer=(l,h)=>{if(typeof h==="bigint")return h.toString();return h}})(G||(G={}));(function(t){t.mergeShapes=(n,o)=>{return{...n,...o}}})(t0||(t0={}));v=G.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var $,Oo=(t)=>{return JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:")},E;var dt=Y(()=>{Bt();$=G.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"]);E=class E 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 h of l.issues)if(h.code==="invalid_union")h.unionErrors.map(b);else if(h.code==="invalid_return_type")b(h.returnTypeError);else if(h.code==="invalid_arguments")b(h.argumentsError);else if(h.path.length===0)o._errors.push(n(h));else{let f=o,a=0;while(a<h.path.length){let g=h.path[a];if(a!==h.path.length-1)f[g]=f[g]||{_errors:[]};else f[g]=f[g]||{_errors:[]},f[g]._errors.push(n(h));f=f[g],a++}}};return b(this),o}static assert(t){if(!(t instanceof E))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,G.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()}};E.create=(t)=>{return new E(t)}});var Wo=(t,n)=>{let o;switch(t.code){case $.invalid_type:if(t.received===v.undefined)o="Required";else o=`Expected ${t.expected}, received ${t.received}`;break;case $.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(t.expected,G.jsonStringifyReplacer)}`;break;case $.unrecognized_keys:o=`Unrecognized key(s) in object: ${G.joinValues(t.keys,", ")}`;break;case $.invalid_union:o="Invalid input";break;case $.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${G.joinValues(t.options)}`;break;case $.invalid_enum_value:o=`Invalid enum value. Expected ${G.joinValues(t.options)}, received '${t.received}'`;break;case $.invalid_arguments:o="Invalid function arguments";break;case $.invalid_return_type:o="Invalid function return type";break;case $.invalid_date:o="Invalid date";break;case $.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 G.assertNever(t.validation);else if(t.validation!=="regex")o=`Invalid ${t.validation}`;else o="Invalid";break;case $.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 $.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 $.custom:o="Invalid input";break;case $.invalid_intersection_types:o="Intersection results could not be merged";break;case $.not_multiple_of:o=`Number must be a multiple of ${t.multipleOf}`;break;case $.not_finite:o="Number must be finite";break;default:o=n.defaultError,G.assertNever(t)}return{message:o}},T;var n0=Y(()=>{dt();Bt();T=Wo});function Eo(t){R0=t}function wt(){return R0}var R0;var ut=Y(()=>{n0();R0=T});function _(t,n){let o=wt(),b=Rt({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,o,o===T?void 0:T].filter((l)=>!!l)});t.common.issues.push(b)}class B{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,h=await b.value;o.push({key:l,value:h})}return B.mergeObjectSync(t,o)}static mergeObjectSync(t,n){let o={};for(let b of n){let{key:l,value:h}=b;if(l.status==="aborted")return H;if(h.status==="aborted")return H;if(l.status==="dirty")t.dirty();if(h.status==="dirty")t.dirty();if(l.value!=="__proto__"&&(typeof h.value<"u"||b.alwaysSet))o[l.value]=h.value}return{status:t.value,value:o}}}var Rt=(t)=>{let{data:n,path:o,errorMaps:b,issueData:l}=t,h=[...o,...l.path||[]],f={...l,path:h};if(l.message!==void 0)return{...l,path:h,message:l.message};let a="",g=b.filter((c)=>!!c).slice().reverse();for(let c of g)a=c(f,{data:n,defaultError:a}).message;return{...l,path:h,message:a}},Uo,H,lt=(t)=>({status:"dirty",value:t}),D=(t)=>({status:"valid",value:t}),It=(t)=>t.status==="aborted",Pt=(t)=>t.status==="dirty",Z=(t)=>t.status==="valid",_t=(t)=>typeof Promise<"u"&&t instanceof Promise;var b0=Y(()=>{ut();n0();Uo=[];H=Object.freeze({status:"aborted"})});var D0=()=>{};var q;var O0=Y(()=>{(function(t){t.errToObj=(n)=>typeof n==="string"?{message:n}:n||{},t.toString=(n)=>typeof n==="string"?n:n?.message})(q||(q={}))});class j{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,a)=>{let{message:g}=t;if(f.code==="invalid_enum_value")return{message:g??a.defaultError};if(typeof a.data>"u")return{message:g??b??a.defaultError};if(f.code!=="invalid_type")return{message:a.defaultError};return{message:g??o??a.defaultError}},description:l}}class Q{get description(){return this._def.description}_getType(t){return p(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:p(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new B,ctx:{common:t.parent.common,data:t.data,parsedType:p(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(_t(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:p(t)},b=this._parseSync({data:t,path:o.path,parent:o});return W0(o,b)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:p(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:n});return Z(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)=>Z(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:p(t)},b=this._parse({data:t,path:o.path,parent:o}),l=await(_t(b)?b:Promise.resolve(b));return W0(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 h=t(b),f=()=>l.addIssue({code:$.custom,...o(b)});if(typeof Promise<"u"&&h instanceof Promise)return h.then((a)=>{if(!a)return f(),!1;else return!0});if(!h)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 K({schema:this,typeName:X.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 N.create(this,this._def)}nullable(){return C.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return V.create(this)}promise(){return gt.create(this,this._def)}or(t){return Xt.create([this,t],this._def)}and(t){return Yt.create(this,t,this._def)}transform(t){return new K({...x(this._def),schema:this,typeName:X.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t==="function"?t:()=>t;return new Gt({...x(this._def),innerType:this,defaultValue:n,typeName:X.ZodDefault})}brand(){return new it({typeName:X.ZodBranded,type:this,...x(this._def)})}catch(t){let n=typeof t==="function"?t:()=>t;return new Mt({...x(this._def),innerType:this,catchValue:n,typeName:X.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return Vt.create(this,t)}readonly(){return Lt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function V0(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 zo(t){return new RegExp(`^${V0(t)}$`)}function N0(t){let n=`${U0}T${V0(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 tl(t,n){if((n==="v4"||!n)&&To.test(t))return!0;if((n==="v6"||!n)&&Co.test(t))return!0;return!1}function nl(t,n){if(!po.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 bl(t,n){if((n==="v4"||!n)&&io.test(t))return!0;if((n==="v6"||!n)&&yo.test(t))return!0;return!1}function ol(t,n){let o=(t.toString().split(".")[1]||"").length,b=(n.toString().split(".")[1]||"").length,l=o>b?o:b,h=Number.parseInt(t.toFixed(l).replace(".","")),f=Number.parseInt(n.toFixed(l).replace(".",""));return h%f/10**l}function rt(t){if(t instanceof k){let n={};for(let o in t.shape){let b=t.shape[o];n[o]=N.create(rt(b))}return new k({...t._def,shape:()=>n})}else if(t instanceof V)return new V({...t._def,type:rt(t.element)});else if(t instanceof N)return N.create(rt(t.unwrap()));else if(t instanceof C)return C.create(rt(t.unwrap()));else if(t instanceof u)return u.create(t.items.map((n)=>rt(n)));else return t}function l0(t,n){let o=p(t),b=p(n);if(t===n)return{valid:!0,data:t};else if(o===v.object&&b===v.object){let l=G.objectKeys(n),h=G.objectKeys(t).filter((a)=>l.indexOf(a)!==-1),f={...t,...n};for(let a of h){let g=l0(t[a],n[a]);if(!g.valid)return{valid:!1};f[a]=g.data}return{valid:!0,data:f}}else if(o===v.array&&b===v.array){if(t.length!==n.length)return{valid:!1};let l=[];for(let h=0;h<t.length;h++){let f=t[h],a=n[h],g=l0(f,a);if(!g.valid)return{valid:!1};l.push(g.data)}return{valid:!0,data:l}}else if(o===v.date&&b===v.date&&+t===+n)return{valid:!0,data:t};else return{valid:!1}}function j0(t,n){return new tt({values:t,typeName:X.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 K0(t,n={},o){if(t)return ft.create().superRefine((b,l)=>{let h=t(b);if(h instanceof Promise)return h.then((f)=>{if(!f){let a=E0(n,b),g=a.fatal??o??!0;l.addIssue({code:"custom",...a,fatal:g})}});if(!h){let f=E0(n,b),a=f.fatal??o??!0;l.addIssue({code:"custom",...f,fatal:a})}return});return ft.create()}var W0=(t,n)=>{if(Z(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 E(t.common.issues);return this._error=o,this._error}}}},Vo,No,jo,Ko,mo,po,uo,Io,Po="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",o0,To,io,Co,yo,Zo,eo,U0="((\\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])))",so,U,s,z,At,ht,Dt,qt,Ht,ft,e,d,Ot,V,k,Xt,i=(t)=>{if(t instanceof xt)return i(t.schema);else if(t instanceof K)return i(t.innerType());else if(t instanceof Qt)return[t.value];else if(t instanceof tt)return t.options;else if(t instanceof Jt)return G.objectValues(t.enum);else if(t instanceof Gt)return i(t._def.innerType);else if(t instanceof qt)return[void 0];else if(t instanceof Ht)return[null];else if(t instanceof N)return[void 0,...i(t.unwrap())];else if(t instanceof C)return[null,...i(t.unwrap())];else if(t instanceof it)return i(t.unwrap());else if(t instanceof Lt)return i(t.unwrap());else if(t instanceof Mt)return i(t._def.innerType);else return[]},Tt,Yt,u,Wt,Et,at,ct,xt,Qt,tt,Jt,gt,K,N,C,Gt,Mt,Ut,ll,it,Vt,Lt,hl,X,fl=(t,n={message:`Input not instance of ${t.name}`})=>K0((o)=>o instanceof t,n),m0,p0,al,gl,d0,$l,vl,wl,_l,rl,cl,Al,ql,Hl,Xl,Yl,xl,Ql,Jl,Gl,Ml,Ll,kl,Sl,Fl,Bl,Rl,Dl,Ol,Wl,El,Ul,Vl,Nl,jl=()=>m0().optional(),Kl=()=>p0().optional(),ml=()=>d0().optional(),pl,dl;var u0=Y(()=>{dt();ut();O0();b0();Bt();Vo=/^c[^\s-]{8,}$/i,No=/^[0-9a-z]+$/,jo=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ko=/^[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,mo=/^[a-z0-9_-]{21}$/i,po=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,uo=/^[-+]?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)?)??$/,Io=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,To=/^(?:(?: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])$/,io=/^(?:(?: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])$/,Co=/^(([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]))$/,yo=/^(([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])$/,Zo=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,eo=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,so=new RegExp(`^${U0}$`);U=class U extends Q{_parse(t){if(this._def.coerce)t.data=String(t.data);if(this._getType(t)!==v.string){let l=this._getOrReturnCtx(t);return _(l,{code:$.invalid_type,expected:v.string,received:l.parsedType}),H}let o=new B,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),_(b,{code:$.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),_(b,{code:$.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty()}else if(l.kind==="length"){let h=t.data.length>l.value,f=t.data.length<l.value;if(h||f){if(b=this._getOrReturnCtx(t,b),h)_(b,{code:$.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message});else if(f)_(b,{code:$.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message});o.dirty()}}else if(l.kind==="email"){if(!Io.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"email",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="emoji"){if(!o0)o0=new RegExp(Po,"u");if(!o0.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"emoji",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="uuid"){if(!Ko.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"uuid",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="nanoid"){if(!mo.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"nanoid",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="cuid"){if(!Vo.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"cuid",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="cuid2"){if(!No.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"cuid2",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="ulid"){if(!jo.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"ulid",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="url")try{new URL(t.data)}catch{b=this._getOrReturnCtx(t,b),_(b,{validation:"url",code:$.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),_(b,{validation:"regex",code:$.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),_(b,{code:$.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),_(b,{code:$.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),_(b,{code:$.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()}else if(l.kind==="datetime"){if(!N0(l).test(t.data))b=this._getOrReturnCtx(t,b),_(b,{code:$.invalid_string,validation:"datetime",message:l.message}),o.dirty()}else if(l.kind==="date"){if(!so.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{code:$.invalid_string,validation:"date",message:l.message}),o.dirty()}else if(l.kind==="time"){if(!zo(l).test(t.data))b=this._getOrReturnCtx(t,b),_(b,{code:$.invalid_string,validation:"time",message:l.message}),o.dirty()}else if(l.kind==="duration"){if(!uo.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"duration",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="ip"){if(!tl(t.data,l.version))b=this._getOrReturnCtx(t,b),_(b,{validation:"ip",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="jwt"){if(!nl(t.data,l.alg))b=this._getOrReturnCtx(t,b),_(b,{validation:"jwt",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="cidr"){if(!bl(t.data,l.version))b=this._getOrReturnCtx(t,b),_(b,{validation:"cidr",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="base64"){if(!Zo.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"base64",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="base64url"){if(!eo.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"base64url",code:$.invalid_string,message:l.message}),o.dirty()}else G.assertNever(l);return{status:o.value,value:t.data}}_regex(t,n,o){return this.refinement((b)=>t.test(b),{validation:n,code:$.invalid_string,...q.errToObj(o)})}_addCheck(t){return new U({...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 U({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new U({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new U({...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}};U.create=(t)=>{return new U({checks:[],typeName:X.ZodString,coerce:t?.coerce??!1,...x(t)})};s=class s extends Q{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)!==v.number){let l=this._getOrReturnCtx(t);return _(l,{code:$.invalid_type,expected:v.number,received:l.parsedType}),H}let o=void 0,b=new B;for(let l of this._def.checks)if(l.kind==="int"){if(!G.isInteger(t.data))o=this._getOrReturnCtx(t,o),_(o,{code:$.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),_(o,{code:$.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),_(o,{code:$.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),b.dirty()}else if(l.kind==="multipleOf"){if(ol(t.data,l.value)!==0)o=this._getOrReturnCtx(t,o),_(o,{code:$.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),_(o,{code:$.not_finite,message:l.message}),b.dirty()}else G.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 s({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:q.toString(b)}]})}_addCheck(t){return new s({...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"&&G.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)}};s.create=(t)=>{return new s({checks:[],typeName:X.ZodNumber,coerce:t?.coerce||!1,...x(t)})};z=class z extends Q{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)!==v.bigint)return this._getInvalidInput(t);let o=void 0,b=new B;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),_(o,{code:$.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),_(o,{code:$.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),_(o,{code:$.not_multiple_of,multipleOf:l.value,message:l.message}),b.dirty()}else G.assertNever(l);return{status:b.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return _(n,{code:$.invalid_type,expected:v.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 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]})}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}};z.create=(t)=>{return new z({checks:[],typeName:X.ZodBigInt,coerce:t?.coerce??!1,...x(t)})};At=class At extends Q{_parse(t){if(this._def.coerce)t.data=Boolean(t.data);if(this._getType(t)!==v.boolean){let o=this._getOrReturnCtx(t);return _(o,{code:$.invalid_type,expected:v.boolean,received:o.parsedType}),H}return D(t.data)}};At.create=(t)=>{return new At({typeName:X.ZodBoolean,coerce:t?.coerce||!1,...x(t)})};ht=class ht extends Q{_parse(t){if(this._def.coerce)t.data=new Date(t.data);if(this._getType(t)!==v.date){let l=this._getOrReturnCtx(t);return _(l,{code:$.invalid_type,expected:v.date,received:l.parsedType}),H}if(Number.isNaN(t.data.getTime())){let l=this._getOrReturnCtx(t);return _(l,{code:$.invalid_date}),H}let o=new B,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),_(b,{code:$.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),_(b,{code:$.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()}else G.assertNever(l);return{status:o.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ht({...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}};ht.create=(t)=>{return new ht({checks:[],coerce:t?.coerce||!1,typeName:X.ZodDate,...x(t)})};Dt=class Dt extends Q{_parse(t){if(this._getType(t)!==v.symbol){let o=this._getOrReturnCtx(t);return _(o,{code:$.invalid_type,expected:v.symbol,received:o.parsedType}),H}return D(t.data)}};Dt.create=(t)=>{return new Dt({typeName:X.ZodSymbol,...x(t)})};qt=class qt extends Q{_parse(t){if(this._getType(t)!==v.undefined){let o=this._getOrReturnCtx(t);return _(o,{code:$.invalid_type,expected:v.undefined,received:o.parsedType}),H}return D(t.data)}};qt.create=(t)=>{return new qt({typeName:X.ZodUndefined,...x(t)})};Ht=class Ht extends Q{_parse(t){if(this._getType(t)!==v.null){let o=this._getOrReturnCtx(t);return _(o,{code:$.invalid_type,expected:v.null,received:o.parsedType}),H}return D(t.data)}};Ht.create=(t)=>{return new Ht({typeName:X.ZodNull,...x(t)})};ft=class ft extends Q{constructor(){super(...arguments);this._any=!0}_parse(t){return D(t.data)}};ft.create=(t)=>{return new ft({typeName:X.ZodAny,...x(t)})};e=class e extends Q{constructor(){super(...arguments);this._unknown=!0}_parse(t){return D(t.data)}};e.create=(t)=>{return new e({typeName:X.ZodUnknown,...x(t)})};d=class d extends Q{_parse(t){let n=this._getOrReturnCtx(t);return _(n,{code:$.invalid_type,expected:v.never,received:n.parsedType}),H}};d.create=(t)=>{return new d({typeName:X.ZodNever,...x(t)})};Ot=class Ot extends Q{_parse(t){if(this._getType(t)!==v.undefined){let o=this._getOrReturnCtx(t);return _(o,{code:$.invalid_type,expected:v.void,received:o.parsedType}),H}return D(t.data)}};Ot.create=(t)=>{return new Ot({typeName:X.ZodVoid,...x(t)})};V=class V extends Q{_parse(t){let{ctx:n,status:o}=this._processInputParams(t),b=this._def;if(n.parsedType!==v.array)return _(n,{code:$.invalid_type,expected:v.array,received:n.parsedType}),H;if(b.exactLength!==null){let h=n.data.length>b.exactLength.value,f=n.data.length<b.exactLength.value;if(h||f)_(n,{code:h?$.too_big:$.too_small,minimum:f?b.exactLength.value:void 0,maximum:h?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)_(n,{code:$.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)_(n,{code:$.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((h,f)=>{return b.type._parseAsync(new j(n,h,n.path,f))})).then((h)=>{return B.mergeArray(o,h)});let l=[...n.data].map((h,f)=>{return b.type._parseSync(new j(n,h,n.path,f))});return B.mergeArray(o,l)}get element(){return this._def.type}min(t,n){return new V({...this._def,minLength:{value:t,message:q.toString(n)}})}max(t,n){return new V({...this._def,maxLength:{value:t,message:q.toString(n)}})}length(t,n){return new V({...this._def,exactLength:{value:t,message:q.toString(n)}})}nonempty(t){return this.min(1,t)}};V.create=(t,n)=>{return new V({type:t,minLength:null,maxLength:null,exactLength:null,typeName:X.ZodArray,...x(n)})};k=class k extends Q{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=G.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==v.object){let g=this._getOrReturnCtx(t);return _(g,{code:$.invalid_type,expected:v.object,received:g.parsedType}),H}let{status:o,ctx:b}=this._processInputParams(t),{shape:l,keys:h}=this._getCached(),f=[];if(!(this._def.catchall instanceof d&&this._def.unknownKeys==="strip")){for(let g in b.data)if(!h.includes(g))f.push(g)}let a=[];for(let g of h){let c=l[g],J=b.data[g];a.push({key:{status:"valid",value:g},value:c._parse(new j(b,J,b.path,g)),alwaysSet:g in b.data})}if(this._def.catchall instanceof d){let g=this._def.unknownKeys;if(g==="passthrough")for(let c of f)a.push({key:{status:"valid",value:c},value:{status:"valid",value:b.data[c]}});else if(g==="strict"){if(f.length>0)_(b,{code:$.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 c of f){let J=b.data[c];a.push({key:{status:"valid",value:c},value:g._parse(new j(b,J,b.path,c)),alwaysSet:c in b.data})}}if(b.common.async)return Promise.resolve().then(async()=>{let g=[];for(let c of a){let J=await c.key,F=await c.value;g.push({key:J,value:F,alwaysSet:c.alwaysSet})}return g}).then((g)=>{return B.mergeObjectSync(o,g)});else return B.mergeObjectSync(o,a)}get shape(){return this._def.shape()}strict(t){return q.errToObj,new k({...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 k({...this._def,unknownKeys:"strip"})}passthrough(){return new k({...this._def,unknownKeys:"passthrough"})}extend(t){return new k({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new k({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:X.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new k({...this._def,catchall:t})}pick(t){let n={};for(let o of G.objectKeys(t))if(t[o]&&this.shape[o])n[o]=this.shape[o];return new k({...this._def,shape:()=>n})}omit(t){let n={};for(let o of G.objectKeys(this.shape))if(!t[o])n[o]=this.shape[o];return new k({...this._def,shape:()=>n})}deepPartial(){return rt(this)}partial(t){let n={};for(let o of G.objectKeys(this.shape)){let b=this.shape[o];if(t&&!t[o])n[o]=b;else n[o]=b.optional()}return new k({...this._def,shape:()=>n})}required(t){let n={};for(let o of G.objectKeys(this.shape))if(t&&!t[o])n[o]=this.shape[o];else{let l=this.shape[o];while(l instanceof N)l=l._def.innerType;n[o]=l}return new k({...this._def,shape:()=>n})}keyof(){return j0(G.objectKeys(this.shape))}};k.create=(t,n)=>{return new k({shape:()=>t,unknownKeys:"strip",catchall:d.create(),typeName:X.ZodObject,...x(n)})};k.strictCreate=(t,n)=>{return new k({shape:()=>t,unknownKeys:"strict",catchall:d.create(),typeName:X.ZodObject,...x(n)})};k.lazycreate=(t,n)=>{return new k({shape:t,unknownKeys:"strip",catchall:d.create(),typeName:X.ZodObject,...x(n)})};Xt=class Xt extends Q{_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 h=l.map((f)=>new E(f.ctx.common.issues));return _(n,{code:$.invalid_union,unionErrors:h}),H}if(n.common.async)return Promise.all(o.map(async(l)=>{let h={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:h}),ctx:h}})).then(b);else{let l=void 0,h=[];for(let a of o){let g={...n,common:{...n.common,issues:[]},parent:null},c=a._parseSync({data:n.data,path:n.path,parent:g});if(c.status==="valid")return c;else if(c.status==="dirty"&&!l)l={result:c,ctx:g};if(g.common.issues.length)h.push(g.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;let f=h.map((a)=>new E(a));return _(n,{code:$.invalid_union,unionErrors:f}),H}}get options(){return this._def.options}};Xt.create=(t,n)=>{return new Xt({options:t,typeName:X.ZodUnion,...x(n)})};Tt=class Tt extends Q{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==v.object)return _(n,{code:$.invalid_type,expected:v.object,received:n.parsedType}),H;let o=this.discriminator,b=n.data[o],l=this.optionsMap.get(b);if(!l)return _(n,{code:$.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 h=i(l.shape[t]);if(!h.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let f of h){if(b.has(f))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(f)}`);b.set(f,l)}}return new Tt({typeName:X.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:b,...x(o)})}};Yt=class Yt extends Q{_parse(t){let{status:n,ctx:o}=this._processInputParams(t),b=(l,h)=>{if(It(l)||It(h))return H;let f=l0(l.value,h.value);if(!f.valid)return _(o,{code:$.invalid_intersection_types}),H;if(Pt(l)||Pt(h))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,h])=>b(l,h));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}))}};Yt.create=(t,n,o)=>{return new Yt({left:t,right:n,typeName:X.ZodIntersection,...x(o)})};u=class u extends Q{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==v.array)return _(o,{code:$.invalid_type,expected:v.array,received:o.parsedType}),H;if(o.data.length<this._def.items.length)return _(o,{code:$.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)_(o,{code:$.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty();let l=[...o.data].map((h,f)=>{let a=this._def.items[f]||this._def.rest;if(!a)return null;return a._parse(new j(o,h,o.path,f))}).filter((h)=>!!h);if(o.common.async)return Promise.all(l).then((h)=>{return B.mergeArray(n,h)});else return B.mergeArray(n,l)}get items(){return this._def.items}rest(t){return new u({...this._def,rest:t})}};u.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new u({items:t,typeName:X.ZodTuple,rest:null,...x(n)})};Wt=class Wt extends Q{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!==v.object)return _(o,{code:$.invalid_type,expected:v.object,received:o.parsedType}),H;let b=[],l=this._def.keyType,h=this._def.valueType;for(let f in o.data)b.push({key:l._parse(new j(o,f,o.path,f)),value:h._parse(new j(o,o.data[f],o.path,f)),alwaysSet:f in o.data});if(o.common.async)return B.mergeObjectAsync(n,b);else return B.mergeObjectSync(n,b)}get element(){return this._def.valueType}static create(t,n,o){if(n instanceof Q)return new Wt({keyType:t,valueType:n,typeName:X.ZodRecord,...x(o)});return new Wt({keyType:U.create(),valueType:t,typeName:X.ZodRecord,...x(n)})}};Et=class Et extends Q{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!==v.map)return _(o,{code:$.invalid_type,expected:v.map,received:o.parsedType}),H;let b=this._def.keyType,l=this._def.valueType,h=[...o.data.entries()].map(([f,a],g)=>{return{key:b._parse(new j(o,f,o.path,[g,"key"])),value:l._parse(new j(o,a,o.path,[g,"value"]))}});if(o.common.async){let f=new Map;return Promise.resolve().then(async()=>{for(let a of h){let g=await a.key,c=await a.value;if(g.status==="aborted"||c.status==="aborted")return H;if(g.status==="dirty"||c.status==="dirty")n.dirty();f.set(g.value,c.value)}return{status:n.value,value:f}})}else{let f=new Map;for(let a of h){let{key:g,value:c}=a;if(g.status==="aborted"||c.status==="aborted")return H;if(g.status==="dirty"||c.status==="dirty")n.dirty();f.set(g.value,c.value)}return{status:n.value,value:f}}}};Et.create=(t,n,o)=>{return new Et({valueType:n,keyType:t,typeName:X.ZodMap,...x(o)})};at=class at extends Q{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==v.set)return _(o,{code:$.invalid_type,expected:v.set,received:o.parsedType}),H;let b=this._def;if(b.minSize!==null){if(o.data.size<b.minSize.value)_(o,{code:$.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)_(o,{code:$.too_big,maximum:b.maxSize.value,type:"set",inclusive:!0,exact:!1,message:b.maxSize.message}),n.dirty()}let l=this._def.valueType;function h(a){let g=new Set;for(let c of a){if(c.status==="aborted")return H;if(c.status==="dirty")n.dirty();g.add(c.value)}return{status:n.value,value:g}}let f=[...o.data.values()].map((a,g)=>l._parse(new j(o,a,o.path,g)));if(o.common.async)return Promise.all(f).then((a)=>h(a));else return h(f)}min(t,n){return new at({...this._def,minSize:{value:t,message:q.toString(n)}})}max(t,n){return new at({...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)}};at.create=(t,n)=>{return new at({valueType:t,minSize:null,maxSize:null,typeName:X.ZodSet,...x(n)})};ct=class ct extends Q{constructor(){super(...arguments);this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==v.function)return _(n,{code:$.invalid_type,expected:v.function,received:n.parsedType}),H;function o(f,a){return Rt({data:f,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wt(),T].filter((g)=>!!g),issueData:{code:$.invalid_arguments,argumentsError:a}})}function b(f,a){return Rt({data:f,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wt(),T].filter((g)=>!!g),issueData:{code:$.invalid_return_type,returnTypeError:a}})}let l={errorMap:n.common.contextualErrorMap},h=n.data;if(this._def.returns instanceof gt){let f=this;return D(async function(...a){let g=new E([]),c=await f._def.args.parseAsync(a,l).catch((S)=>{throw g.addIssue(o(a,S)),g}),J=await Reflect.apply(h,this,c);return await f._def.returns._def.type.parseAsync(J,l).catch((S)=>{throw g.addIssue(b(J,S)),g})})}else{let f=this;return D(function(...a){let g=f._def.args.safeParse(a,l);if(!g.success)throw new E([o(a,g.error)]);let c=Reflect.apply(h,this,g.data),J=f._def.returns.safeParse(c,l);if(!J.success)throw new E([b(c,J.error)]);return J.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ct({...this._def,args:u.create(t).rest(e.create())})}returns(t){return new ct({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,o){return new ct({args:t?t:u.create([]).rest(e.create()),returns:n||e.create(),typeName:X.ZodFunction,...x(o)})}};xt=class xt extends Q{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})}};xt.create=(t,n)=>{return new xt({getter:t,typeName:X.ZodLazy,...x(n)})};Qt=class Qt extends Q{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return _(n,{received:n.data,code:$.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:X.ZodLiteral,...x(n)})};tt=class tt extends Q{_parse(t){if(typeof t.data!=="string"){let n=this._getOrReturnCtx(t),o=this._def.values;return _(n,{expected:G.joinValues(o),received:n.parsedType,code:$.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 _(n,{received:n.data,code:$.invalid_enum_value,options:o}),H}return D(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 tt.create(t,{...this._def,...n})}exclude(t,n=this._def){return tt.create(this.options.filter((o)=>!t.includes(o)),{...this._def,...n})}};tt.create=j0;Jt=class Jt extends Q{_parse(t){let n=G.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(t);if(o.parsedType!==v.string&&o.parsedType!==v.number){let b=G.objectValues(n);return _(o,{expected:G.joinValues(b),received:o.parsedType,code:$.invalid_type}),H}if(!this._cache)this._cache=new Set(G.getValidEnumValues(this._def.values));if(!this._cache.has(t.data)){let b=G.objectValues(n);return _(o,{received:o.data,code:$.invalid_enum_value,options:b}),H}return D(t.data)}get enum(){return this._def.values}};Jt.create=(t,n)=>{return new Jt({values:t,typeName:X.ZodNativeEnum,...x(n)})};gt=class gt extends Q{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==v.promise&&n.common.async===!1)return _(n,{code:$.invalid_type,expected:v.promise,received:n.parsedType}),H;let o=n.parsedType===v.promise?n.data:Promise.resolve(n.data);return D(o.then((b)=>{return this._def.type.parseAsync(b,{path:n.path,errorMap:n.common.contextualErrorMap})}))}};gt.create=(t,n)=>{return new gt({type:t,typeName:X.ZodPromise,...x(n)})};K=class K extends Q{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===X.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:(h)=>{if(_(o,h),h.fatal)n.abort();else n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),b.type==="preprocess"){let h=b.transform(o.data,l);if(o.common.async)return Promise.resolve(h).then(async(f)=>{if(n.value==="aborted")return H;let a=await this._def.schema._parseAsync({data:f,path:o.path,parent:o});if(a.status==="aborted")return H;if(a.status==="dirty")return lt(a.value);if(n.value==="dirty")return lt(a.value);return a});else{if(n.value==="aborted")return H;let f=this._def.schema._parseSync({data:h,path:o.path,parent:o});if(f.status==="aborted")return H;if(f.status==="dirty")return lt(f.value);if(n.value==="dirty")return lt(f.value);return f}}if(b.type==="refinement"){let h=(f)=>{let a=b.refinement(f,l);if(o.common.async)return Promise.resolve(a);if(a 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 h(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 h(f.value).then(()=>{return{status:n.value,value:f.value}})})}if(b.type==="transform")if(o.common.async===!1){let h=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Z(h))return H;let f=b.transform(h.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((h)=>{if(!Z(h))return H;return Promise.resolve(b.transform(h.value,l)).then((f)=>({status:n.value,value:f}))});G.assertNever(b)}};K.create=(t,n,o)=>{return new K({schema:t,typeName:X.ZodEffects,effect:n,...x(o)})};K.createWithPreprocess=(t,n,o)=>{return new K({schema:n,effect:{type:"preprocess",transform:t},typeName:X.ZodEffects,...x(o)})};N=class N extends Q{_parse(t){if(this._getType(t)===v.undefined)return D(void 0);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};N.create=(t,n)=>{return new N({innerType:t,typeName:X.ZodOptional,...x(n)})};C=class C extends Q{_parse(t){if(this._getType(t)===v.null)return D(null);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};C.create=(t,n)=>{return new C({innerType:t,typeName:X.ZodNullable,...x(n)})};Gt=class Gt extends Q{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;if(n.parsedType===v.undefined)o=this._def.defaultValue();return this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Gt.create=(t,n)=>{return new Gt({innerType:t,typeName:X.ZodDefault,defaultValue:typeof n.default==="function"?n.default:()=>n.default,...x(n)})};Mt=class Mt extends Q{_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(_t(b))return b.then((l)=>{return{status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new E(o.common.issues)},input:o.data})}});else return{status:"valid",value:b.status==="valid"?b.value:this._def.catchValue({get error(){return new E(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};Mt.create=(t,n)=>{return new Mt({innerType:t,typeName:X.ZodCatch,catchValue:typeof n.catch==="function"?n.catch:()=>n.catch,...x(n)})};Ut=class Ut extends Q{_parse(t){if(this._getType(t)!==v.nan){let o=this._getOrReturnCtx(t);return _(o,{code:$.invalid_type,expected:v.nan,received:o.parsedType}),H}return{status:"valid",value:t.data}}};Ut.create=(t)=>{return new Ut({typeName:X.ZodNaN,...x(t)})};ll=Symbol("zod_brand");it=class it extends Q{_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}};Vt=class Vt extends Q{_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(),lt(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 Vt({in:t,out:n,typeName:X.ZodPipeline})}};Lt=class Lt extends Q{_parse(t){let n=this._def.innerType._parse(t),o=(b)=>{if(Z(b))b.value=Object.freeze(b.value);return b};return _t(n)?n.then((b)=>o(b)):o(n)}unwrap(){return this._def.innerType}};Lt.create=(t,n)=>{return new Lt({innerType:t,typeName:X.ZodReadonly,...x(n)})};hl={object:k.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"})(X||(X={}));m0=U.create,p0=s.create,al=Ut.create,gl=z.create,d0=At.create,$l=ht.create,vl=Dt.create,wl=qt.create,_l=Ht.create,rl=ft.create,cl=e.create,Al=d.create,ql=Ot.create,Hl=V.create,Xl=k.create,Yl=k.strictCreate,xl=Xt.create,Ql=Tt.create,Jl=Yt.create,Gl=u.create,Ml=Wt.create,Ll=Et.create,kl=at.create,Sl=ct.create,Fl=xt.create,Bl=Qt.create,Rl=tt.create,Dl=Jt.create,Ol=gt.create,Wl=K.create,El=N.create,Ul=C.create,Vl=K.createWithPreprocess,Nl=Vt.create,pl={string:(t)=>U.create({...t,coerce:!0}),number:(t)=>s.create({...t,coerce:!0}),boolean:(t)=>At.create({...t,coerce:!0}),bigint:(t)=>z.create({...t,coerce:!0}),date:(t)=>ht.create({...t,coerce:!0})},dl=H});var w={};L(w,{void:()=>ql,util:()=>G,unknown:()=>cl,union:()=>xl,undefined:()=>wl,tuple:()=>Gl,transformer:()=>Wl,symbol:()=>vl,string:()=>m0,strictObject:()=>Yl,setErrorMap:()=>Eo,set:()=>kl,record:()=>Ml,quotelessJson:()=>Oo,promise:()=>Ol,preprocess:()=>Vl,pipeline:()=>Nl,ostring:()=>jl,optional:()=>El,onumber:()=>Kl,oboolean:()=>ml,objectUtil:()=>t0,object:()=>Xl,number:()=>p0,nullable:()=>Ul,null:()=>_l,never:()=>Al,nativeEnum:()=>Dl,nan:()=>al,map:()=>Ll,makeIssue:()=>Rt,literal:()=>Bl,lazy:()=>Fl,late:()=>hl,isValid:()=>Z,isDirty:()=>Pt,isAsync:()=>_t,isAborted:()=>It,intersection:()=>Jl,instanceof:()=>fl,getParsedType:()=>p,getErrorMap:()=>wt,function:()=>Sl,enum:()=>Rl,effect:()=>Wl,discriminatedUnion:()=>Ql,defaultErrorMap:()=>T,datetimeRegex:()=>N0,date:()=>$l,custom:()=>K0,coerce:()=>pl,boolean:()=>d0,bigint:()=>gl,array:()=>Hl,any:()=>rl,addIssueToContext:()=>_,ZodVoid:()=>Ot,ZodUnknown:()=>e,ZodUnion:()=>Xt,ZodUndefined:()=>qt,ZodType:()=>Q,ZodTuple:()=>u,ZodTransformer:()=>K,ZodSymbol:()=>Dt,ZodString:()=>U,ZodSet:()=>at,ZodSchema:()=>Q,ZodRecord:()=>Wt,ZodReadonly:()=>Lt,ZodPromise:()=>gt,ZodPipeline:()=>Vt,ZodParsedType:()=>v,ZodOptional:()=>N,ZodObject:()=>k,ZodNumber:()=>s,ZodNullable:()=>C,ZodNull:()=>Ht,ZodNever:()=>d,ZodNativeEnum:()=>Jt,ZodNaN:()=>Ut,ZodMap:()=>Et,ZodLiteral:()=>Qt,ZodLazy:()=>xt,ZodIssueCode:()=>$,ZodIntersection:()=>Yt,ZodFunction:()=>ct,ZodFirstPartyTypeKind:()=>X,ZodError:()=>E,ZodEnum:()=>tt,ZodEffects:()=>K,ZodDiscriminatedUnion:()=>Tt,ZodDefault:()=>Gt,ZodDate:()=>ht,ZodCatch:()=>Mt,ZodBranded:()=>it,ZodBoolean:()=>At,ZodBigInt:()=>z,ZodArray:()=>V,ZodAny:()=>ft,Schema:()=>Q,ParseStatus:()=>B,OK:()=>D,NEVER:()=>dl,INVALID:()=>H,EMPTY_PATH:()=>Uo,DIRTY:()=>lt,BRAND:()=>ll});var h0=Y(()=>{ut();b0();D0();Bt();u0();dt()});var I0=Y(()=>{h0();h0()});function f0(t,...n){if(ul())return;(console[t]||console.log).call(console,...n)}var ul=()=>Boolean(globalThis.__AFRICODE_TEST__||globalThis.__AFRICODE_SILENT_LOGS__);function Ct(t){if(t===null||typeof t!=="object")return t;if(Array.isArray(t))return t.map(Ct);let n={};for(let o of Object.keys(t))n[o]=Ct(t[o]);return n}function i0(t,n){let o={...t};for(let b of Object.keys(n))if(n[b]!==null&&typeof n[b]==="object"&&!Array.isArray(n[b])&&typeof t[b]==="object"&&!Array.isArray(t[b]))o[b]=i0(t[b]||{},n[b]);else o[b]=n[b];return o}function C0(t={}){return T0=i0(P0,t),Il=!0,Nt()}function Nt(){return Object.freeze(Ct(T0))}var P0,T0,Il=!1;var a0=Y(()=>{P0={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}},T0=Ct(P0)});class $t{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 h=l.path.join(".");b[h]=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)}}class I{constructor(t,n="string"){this._baseSchema=t,this._fieldType=n,this._isNullable=!1,this._isOptional=!1,this._emptyAsNull=!1,this._trim=!1,this._customMessage=null}nullable(){return this._isNullable=!0,this}optional(){return this._isOptional=!0,this}emptyAsNull(){if(!this._isNullable)throw Error(`[AfriCode] .emptyAsNull() requires .nullable() to be called first. Use: afri.${this._fieldType}().nullable().emptyAsNull()`);return this._emptyAsNull=!0,this}trim(){return this._trim=!0,this}message(t){return this._customMessage=t,this}build(){let t=this._baseSchema;if(this._isNullable)t=t.nullable();if(this._isOptional)t=t.optional();return t}getMeta(){return{fieldType:this._fieldType,isNullable:this._isNullable,isOptional:this._isOptional,emptyAsNull:this._emptyAsNull,trim:this._trim}}}function Z0(t,n){let o={...n},b=!1;try{b=Nt().validation?.trimStrings===!0}catch{}for(let[l,h]of Object.entries(t)){if(!(h instanceof I))continue;let f=h.getMeta(),a=o[l];if(typeof a==="string"&&(f.trim||b))o[l]=a.trim();if(f.emptyAsNull&&o[l]==="")o[l]=null}return o}function e0(t){let n={};for(let[o,b]of Object.entries(t))if(b instanceof I)n[o]=b.build();else n[o]=b;return w.object(n)}var yt,m,y0;var Zt=Y(()=>{I0();a0();yt={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()})};m={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)};y0={url(t="Please enter a valid URL"){return new I(w.string().min(1,"URL cannot be empty").url(t),"url")},email(t="Please enter a valid email address"){return new I(w.string().min(1,"Email cannot be empty").email(t),"email")},string(t={}){let n=w.string();if(t.min!==void 0)n=n.min(t.min,t.message||`Must be at least ${t.min} characters`);if(t.max!==void 0)n=n.max(t.max,t.message||`Must be less than ${t.max} characters`);return new I(n,"string")},number(t={}){let n=w.number();if(t.min!==void 0)n=n.min(t.min);if(t.max!==void 0)n=n.max(t.max);if(t.int)n=n.int("Must be a whole number");return new I(n,"number")},phone(t="Please enter a valid phone number"){return new I(w.string().regex(/^[\+]?[1-9][\d]{0,15}$/,t),"phone")}}});function A(t,n){if(typeof customElements>"u")return;if(!customElements.get(t))customElements.define(t,n)}var Tl,lb,r;var M=Y(()=>{Tl=globalThis.HTMLElement??class{},lb=typeof CSSStyleSheet<"u";r=class r extends Tl{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=`
|
|
372
372
|
<style>
|
|
373
373
|
.af-local-error {
|
|
374
374
|
padding: 1rem;
|
|
@@ -387,7 +387,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
387
387
|
<span aria-hidden="true">⚠️</span>
|
|
388
388
|
<span>Failed to render</span>
|
|
389
389
|
</div>
|
|
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(!
|
|
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(!lb)return;if(!(t instanceof CSSStyleSheet))return;if(!r.globalSheets.includes(t))r.globalSheets.push(t)}async loadStyles(t=""){if(!this.shadowRoot)return;let o=lb&&"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(r.styleCache.has(b)){let h=r.styleCache.get(b);if(o)this.shadowRoot.adoptedStyleSheets=[h,...r.globalSheets];else this._applyFallbackStyle(h?.cssText||h?.text||h||"");return}try{let h=l;if(!h){let f=await fetch("/styles/africanity.css");if(!f.ok)throw Error(`Unable to load stylesheet: ${f.status}`);h=await f.text()}if(o){let f=new CSSStyleSheet;f.replaceSync(h),r.styleCache.set(b,f),this.shadowRoot.adoptedStyleSheets=[f,...r.globalSheets];return}this._applyFallbackStyle(h),r.styleCache.set(b,{text:h})}catch(h){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(([h,f])=>l.setAttribute(h,f)),b)l.textContent=b;return l}emit(t,n){this.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0}))}}});var hb={};L(hb,{default:()=>il,AfriButton:()=>st});var st,il;var fb=Y(()=>{M();st=class st extends r{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"),h=this.getAttribute("icon"),f=this.getAttribute("aria-label"),a={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"}},g=a[o]||a.tanzania;this.shadowRoot.innerHTML=`
|
|
391
391
|
<style>
|
|
392
392
|
:host {
|
|
393
393
|
display: inline-block;
|
|
@@ -415,8 +415,8 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
415
415
|
|
|
416
416
|
/* Variants */
|
|
417
417
|
.variant-primary {
|
|
418
|
-
background: ${
|
|
419
|
-
color: ${
|
|
418
|
+
background: ${g.primary};
|
|
419
|
+
color: ${g.text};
|
|
420
420
|
}
|
|
421
421
|
.variant-primary:hover:not(:disabled) {
|
|
422
422
|
filter: brightness(1.1);
|
|
@@ -426,25 +426,25 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
426
426
|
|
|
427
427
|
.variant-secondary {
|
|
428
428
|
background: transparent;
|
|
429
|
-
color: ${
|
|
430
|
-
border: 2px solid ${
|
|
429
|
+
color: ${g.primary};
|
|
430
|
+
border: 2px solid ${g.primary};
|
|
431
431
|
}
|
|
432
432
|
.variant-secondary:hover:not(:disabled) {
|
|
433
|
-
background: ${
|
|
434
|
-
color: ${
|
|
433
|
+
background: ${g.primary};
|
|
434
|
+
color: ${g.text};
|
|
435
435
|
}
|
|
436
436
|
|
|
437
437
|
.variant-ghost {
|
|
438
438
|
background: transparent;
|
|
439
|
-
color: ${
|
|
439
|
+
color: ${g.primary};
|
|
440
440
|
}
|
|
441
441
|
.variant-ghost:hover:not(:disabled) {
|
|
442
442
|
background: rgba(0,0,0,0.05);
|
|
443
443
|
}
|
|
444
444
|
|
|
445
445
|
.variant-gradient {
|
|
446
|
-
background: linear-gradient(135deg, ${
|
|
447
|
-
color: ${
|
|
446
|
+
background: linear-gradient(135deg, ${g.primary} 0%, ${g.accent} 100%);
|
|
447
|
+
color: ${g.text};
|
|
448
448
|
}
|
|
449
449
|
.variant-gradient:hover:not(:disabled) {
|
|
450
450
|
transform: translateY(-2px);
|
|
@@ -488,10 +488,10 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
488
488
|
${l?'aria-busy="true"':""}
|
|
489
489
|
>
|
|
490
490
|
${l?'<span class="spinner"></span>':""}
|
|
491
|
-
${
|
|
491
|
+
${h&&!l?`<span class="icon">${h}</span>`:""}
|
|
492
492
|
<slot></slot>
|
|
493
493
|
</button>
|
|
494
|
-
`}};A("af-button",
|
|
494
|
+
`}};A("af-button",st);il=st});var ab={};L(ab,{default:()=>Cl,AfriCard:()=>zt});var zt,Cl;var gb=Y(()=>{M();zt=class zt extends r{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`
|
|
495
495
|
<style>
|
|
496
496
|
:host {
|
|
497
497
|
display: block;
|
|
@@ -569,7 +569,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
569
569
|
</div>
|
|
570
570
|
`:""}
|
|
571
571
|
</article>
|
|
572
|
-
`}};A("af-card",
|
|
572
|
+
`}};A("af-card",zt);Cl=zt});var $b={};L($b,{default:()=>yl,AfriNavbar:()=>tn});var tn,yl;var vb=Y(()=>{M();kt();ot();tn=class tn extends r{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=`
|
|
573
573
|
<style>
|
|
574
574
|
:host {
|
|
575
575
|
display: block;
|
|
@@ -745,7 +745,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
745
745
|
<slot></slot>
|
|
746
746
|
</div>
|
|
747
747
|
</nav>
|
|
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=`
|
|
748
|
+
`}};A("af-navbar",tn);yl=tn});var wb={};L(wb,{default:()=>Zl,AfriInput:()=>nn});var nn,Zl;var _b=Y(()=>{M();Zt();nn=class nn extends r{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 h=$t.validateField(l,o);if(!h.success)this.setAttribute("error",h.error);else this.removeAttribute("error")}}}_getValidationSchema(t){let n={email:m.email(),password:m.password(),phone:m.phone(),url:m.url(),required:m.required()};if(t.includes(":")){let[o,b]=t.split(":"),l=parseInt(b);switch(o){case"minLength":return m.minLength(l);case"maxLength":return m.maxLength(l);case"pattern":return m.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")||"",h=this.getAttribute("helper")||"",f=this.getAttribute("theme")||"tanzania",a=this.getAttribute("icon")||"",g=this.hasAttribute("required"),c=this.getAttribute("aria-label"),J=this.getAttribute("aria-describedby"),F={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},S=F[f]||F.tanzania,O=[];if(l)O.push(`error-${this._uniqueId}`);else if(h)O.push(`helper-${this._uniqueId}`);if(J)O.push(...J.split(" "));let Fn=O.length>0?`aria-describedby="${O.join(" ")}"`:"";this.shadowRoot.innerHTML=`
|
|
749
749
|
<style>
|
|
750
750
|
:host {
|
|
751
751
|
display: block;
|
|
@@ -765,7 +765,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
765
765
|
}
|
|
766
766
|
|
|
767
767
|
.required-star {
|
|
768
|
-
color: ${
|
|
768
|
+
color: ${S.error};
|
|
769
769
|
margin-left: 2px;
|
|
770
770
|
}
|
|
771
771
|
|
|
@@ -778,7 +778,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
778
778
|
input {
|
|
779
779
|
width: 100%;
|
|
780
780
|
padding: 10px 13px;
|
|
781
|
-
${
|
|
781
|
+
${a?"padding-left: 40px;":""}
|
|
782
782
|
font-size: 15px;
|
|
783
783
|
border: 2px solid #ddd;
|
|
784
784
|
border-radius: 5px;
|
|
@@ -789,12 +789,12 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
789
789
|
|
|
790
790
|
input:focus {
|
|
791
791
|
outline: none;
|
|
792
|
-
border-color: ${l?
|
|
793
|
-
box-shadow: 0 0 0 3px ${l?
|
|
792
|
+
border-color: ${l?S.error:S.focus};
|
|
793
|
+
box-shadow: 0 0 0 3px ${l?S.error+"20":S.focus+"20"};
|
|
794
794
|
}
|
|
795
795
|
|
|
796
796
|
input.has-error {
|
|
797
|
-
border-color: ${
|
|
797
|
+
border-color: ${S.error};
|
|
798
798
|
}
|
|
799
799
|
|
|
800
800
|
.icon {
|
|
@@ -814,30 +814,30 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
814
814
|
.error-text {
|
|
815
815
|
font-size: 12px;
|
|
816
816
|
margin-top: 4px;
|
|
817
|
-
color: ${
|
|
817
|
+
color: ${S.error};
|
|
818
818
|
}
|
|
819
819
|
</style>
|
|
820
820
|
|
|
821
821
|
<div class="input-wrapper">
|
|
822
|
-
${o?`<label for="input-${this._uniqueId}">${o}${
|
|
822
|
+
${o?`<label for="input-${this._uniqueId}">${o}${g?'<span class="required-star">*</span>':""}</label>`:""}
|
|
823
823
|
<div class="input-container">
|
|
824
|
-
${
|
|
824
|
+
${a?`<span class="icon">${a}</span>`:""}
|
|
825
825
|
<input
|
|
826
826
|
id="input-${this._uniqueId}"
|
|
827
827
|
name="${n}"
|
|
828
828
|
type="${t}"
|
|
829
829
|
placeholder="${b}"
|
|
830
830
|
class="${l?"has-error":""}"
|
|
831
|
-
${
|
|
832
|
-
${
|
|
831
|
+
${g?"required":""}
|
|
832
|
+
${c?`aria-label="${c}"`:""}
|
|
833
833
|
${l?'aria-invalid="true"':""}
|
|
834
|
-
${
|
|
834
|
+
${Fn}
|
|
835
835
|
/>
|
|
836
836
|
</div>
|
|
837
837
|
${l?`<div id="error-${this._uniqueId}" class="error-text" role="alert">${l}</div>`:""}
|
|
838
|
-
${
|
|
838
|
+
${h&&!l?`<div id="helper-${this._uniqueId}" class="helper-text">${h}</div>`:""}
|
|
839
839
|
</div>
|
|
840
|
-
`}};A("af-input",
|
|
840
|
+
`}};A("af-input",nn);Zl=nn});var rb={};L(rb,{default:()=>el,AfriAlert:()=>bn});var bn,el;var cb=Y(()=>{M();bn=class bn extends r{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=`
|
|
841
841
|
<style>
|
|
842
842
|
:host {
|
|
843
843
|
display: block;
|
|
@@ -917,34 +917,34 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
917
917
|
</div>
|
|
918
918
|
${o?'<button class="close-btn" aria-label="Dismiss">×</button>':""}
|
|
919
919
|
</div>
|
|
920
|
-
`}};A("af-alert",
|
|
921
|
-
align-items: ${
|
|
922
|
-
justify-items: ${
|
|
923
|
-
gap: ${
|
|
924
|
-
`;switch(t){case"sidebar":return o==="right"?`display: grid; grid-template-columns: 1fr ${b}; ${
|
|
920
|
+
`}};A("af-alert",bn);el=bn});var Ab={};L(Ab,{AfriGrid:()=>H0});function sl(t,n){let{sidebarSide:o="left",sidebarWidth:b="280px",minWidth:l="280px",gap:h="24px",columns:f,rows:a,align:g="stretch",justify:c="stretch",dense:J=!1}=n,F=J?"dense":"",S=`
|
|
921
|
+
align-items: ${g};
|
|
922
|
+
justify-items: ${c};
|
|
923
|
+
gap: ${h};
|
|
924
|
+
`;switch(t){case"sidebar":return o==="right"?`display: grid; grid-template-columns: 1fr ${b}; ${S}`:`display: grid; grid-template-columns: ${b} 1fr; ${S}`;case"holy-grail":return`
|
|
925
925
|
display: grid;
|
|
926
926
|
grid-template-columns: ${b} 1fr ${b};
|
|
927
927
|
grid-template-rows: auto 1fr auto;
|
|
928
|
-
${
|
|
928
|
+
${S}
|
|
929
929
|
`;case"bento":return`
|
|
930
930
|
display: grid;
|
|
931
931
|
grid-template-columns: repeat(12, 1fr);
|
|
932
932
|
grid-auto-rows: minmax(120px, auto);
|
|
933
|
-
grid-auto-flow: row ${
|
|
934
|
-
${
|
|
933
|
+
grid-auto-flow: row ${F};
|
|
934
|
+
${S}
|
|
935
935
|
`;case"masonry":return`
|
|
936
936
|
display: grid;
|
|
937
937
|
grid-template-columns: repeat(auto-fill, minmax(${l}, 1fr));
|
|
938
938
|
grid-template-rows: masonry;
|
|
939
|
-
grid-auto-flow: row ${
|
|
940
|
-
${
|
|
941
|
-
`;case"auto":default:{let
|
|
939
|
+
grid-auto-flow: row ${F};
|
|
940
|
+
${S}
|
|
941
|
+
`;case"auto":default:{let O=f?`repeat(${f}, 1fr)`:`repeat(auto-fit, minmax(${l}, 1fr))`,Fn=a?`repeat(${a}, 1fr)`:"auto";return`
|
|
942
942
|
display: grid;
|
|
943
|
-
grid-template-columns: ${
|
|
944
|
-
${
|
|
945
|
-
grid-auto-flow: row ${
|
|
946
|
-
${
|
|
947
|
-
`}}}var
|
|
943
|
+
grid-template-columns: ${O};
|
|
944
|
+
${a?`grid-template-rows: ${Fn};`:""}
|
|
945
|
+
grid-auto-flow: row ${F};
|
|
946
|
+
${S}
|
|
947
|
+
`}}}var H0;var qb=Y(()=>{M();H0=class H0 extends r{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`
|
|
948
948
|
@media (max-width: 768px) {
|
|
949
949
|
.grid {
|
|
950
950
|
grid-template-columns: repeat(auto-fit, minmax(min(${t.minWidth}, 100%), 1fr));
|
|
@@ -961,7 +961,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
961
961
|
grid-template-columns: 1fr;
|
|
962
962
|
}
|
|
963
963
|
}
|
|
964
|
-
`}render(){let t=this._getAttrs(),n=
|
|
964
|
+
`}render(){let t=this._getAttrs(),n=sl(t.layout,t),o=this._buildResponsiveBreakpoints(t)+this._buildSidebarResponsive(t);this.shadowRoot.innerHTML=R`
|
|
965
965
|
<style>
|
|
966
966
|
:host {
|
|
967
967
|
display: block;
|
|
@@ -991,7 +991,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
991
991
|
>
|
|
992
992
|
<slot></slot>
|
|
993
993
|
</div>
|
|
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",
|
|
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",H0)});var Hb={};L(Hb,{AfriSection:()=>X0});var X0;var Xb=Y(()=>{M();X0=class X0 extends r{render(){let t=this.getAttribute("variant")||"default",n=this.getAttribute("title");this.shadowRoot.innerHTML=R`
|
|
995
995
|
<style>
|
|
996
996
|
:host { display: block; width: 100%; }
|
|
997
997
|
.section {
|
|
@@ -1018,20 +1018,20 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1018
1018
|
}
|
|
1019
1019
|
</style>
|
|
1020
1020
|
<section class="section">
|
|
1021
|
-
${n?
|
|
1021
|
+
${n?R`
|
|
1022
1022
|
<div class="section-header">
|
|
1023
1023
|
<h2>${n}</h2>
|
|
1024
1024
|
</div>
|
|
1025
1025
|
`:""}
|
|
1026
1026
|
<slot></slot>
|
|
1027
1027
|
</section>
|
|
1028
|
-
`}connectedCallback(){this.render()}};A("af-section",
|
|
1028
|
+
`}connectedCallback(){this.render()}};A("af-section",X0)});var Yb={};L(Yb,{default:()=>zl,AfriIcon:()=>on});var on,zl;var xb=Y(()=>{M();on=class on extends r{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=`
|
|
1029
1029
|
<style>
|
|
1030
1030
|
:host { display: inline-flex; vertical-align: middle; }
|
|
1031
1031
|
svg { width: ${n}px; height: ${n}px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
1032
1032
|
</style>
|
|
1033
1033
|
<svg viewBox="0 0 24 24">${b}</svg>
|
|
1034
|
-
`}};A("af-icon",
|
|
1034
|
+
`}};A("af-icon",on);zl=on});var Qb={};L(Qb,{default:()=>th,AfriAccordion:()=>ln});var ln,th;var Jb=Y(()=>{M();ln=class ln extends r{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=`
|
|
1035
1035
|
<style>
|
|
1036
1036
|
:host {
|
|
1037
1037
|
display: block;
|
|
@@ -1109,32 +1109,32 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1109
1109
|
</style>
|
|
1110
1110
|
|
|
1111
1111
|
<div class="accordion">
|
|
1112
|
-
${o.map((
|
|
1112
|
+
${o.map((h,f)=>{let a=this._openItems.has(f),g=`accordion-header-${this._uniqueId}-${f}`,c=`accordion-panel-${this._uniqueId}-${f}`;return`
|
|
1113
1113
|
<div class="accordion-item">
|
|
1114
1114
|
<button
|
|
1115
|
-
class="accordion-header ${
|
|
1116
|
-
aria-expanded="${
|
|
1117
|
-
aria-controls="${
|
|
1118
|
-
id="${
|
|
1115
|
+
class="accordion-header ${a?"active":""}"
|
|
1116
|
+
aria-expanded="${a}"
|
|
1117
|
+
aria-controls="${c}"
|
|
1118
|
+
id="${g}"
|
|
1119
1119
|
>
|
|
1120
|
-
<span>${
|
|
1120
|
+
<span>${h.getAttribute("title")||`Item ${f+1}`}</span>
|
|
1121
1121
|
<span class="accordion-icon">▼</span>
|
|
1122
1122
|
</button>
|
|
1123
1123
|
<div
|
|
1124
|
-
class="accordion-content ${
|
|
1125
|
-
id="${
|
|
1124
|
+
class="accordion-content ${a?"open":""}"
|
|
1125
|
+
id="${c}"
|
|
1126
1126
|
role="region"
|
|
1127
|
-
aria-labelledby="${
|
|
1127
|
+
aria-labelledby="${g}"
|
|
1128
1128
|
>
|
|
1129
1129
|
<div class="accordion-body">
|
|
1130
|
-
${
|
|
1130
|
+
${h.innerHTML}
|
|
1131
1131
|
</div>
|
|
1132
1132
|
</div>
|
|
1133
1133
|
</div>
|
|
1134
1134
|
`}).join("")}
|
|
1135
1135
|
</div>
|
|
1136
1136
|
<slot name="items"></slot>
|
|
1137
|
-
`}};A("af-accordion",
|
|
1137
|
+
`}};A("af-accordion",ln);th=ln});var Gb={};L(Gb,{default:()=>nh,AfriHero:()=>hn});var hn,nh;var Mb=Y(()=>{M();kt();ot();hn=class hn extends r{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=`
|
|
1138
1138
|
<style>
|
|
1139
1139
|
:host {
|
|
1140
1140
|
display: flex;
|
|
@@ -1234,7 +1234,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1234
1234
|
</div>
|
|
1235
1235
|
<slot></slot>
|
|
1236
1236
|
</div>
|
|
1237
|
-
`}};A("af-hero",
|
|
1237
|
+
`}};A("af-hero",hn);nh=hn});var Lb={};L(Lb,{default:()=>bh,AfriTable:()=>fn});var fn,bh;var kb=Y(()=>{M();fn=class fn extends r{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,h=this._getSortedData();this.shadowRoot.innerHTML=`
|
|
1238
1238
|
<style>
|
|
1239
1239
|
:host {
|
|
1240
1240
|
display: block;
|
|
@@ -1312,9 +1312,9 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1312
1312
|
</tr>
|
|
1313
1313
|
</thead>
|
|
1314
1314
|
<tbody>
|
|
1315
|
-
${
|
|
1315
|
+
${h.length?h.map((f)=>`
|
|
1316
1316
|
<tr>
|
|
1317
|
-
${this._columns.map((
|
|
1317
|
+
${this._columns.map((a)=>`<td>${f[a.key]??""}</td>`).join("")}
|
|
1318
1318
|
</tr>
|
|
1319
1319
|
`).join(""):`
|
|
1320
1320
|
<tr>
|
|
@@ -1324,7 +1324,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1324
1324
|
</tbody>
|
|
1325
1325
|
</table>
|
|
1326
1326
|
</div>
|
|
1327
|
-
`,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",fn);bh=fn});var Sb={};L(Sb,{default:()=>oh,AfriModal:()=>an});var an,oh;var Fb=Y(()=>{M();an=class an extends r{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,h={sm:"400px",md:"560px",lg:"720px",full:"95vw"},f=this.getAttribute("aria-label"),a=this.getAttribute("aria-labelledby")||"modal-title";this.shadowRoot.innerHTML=`
|
|
1328
1328
|
<style>
|
|
1329
1329
|
:host {
|
|
1330
1330
|
font-family: 'Inter', system-ui, sans-serif;
|
|
@@ -1351,7 +1351,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1351
1351
|
background: white;
|
|
1352
1352
|
border-radius: 8px;
|
|
1353
1353
|
width: 100%;
|
|
1354
|
-
max-width: ${
|
|
1354
|
+
max-width: ${h[o]||h.md};
|
|
1355
1355
|
max-height: 90vh;
|
|
1356
1356
|
overflow: hidden;
|
|
1357
1357
|
display: flex;
|
|
@@ -1415,7 +1415,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1415
1415
|
</style>
|
|
1416
1416
|
|
|
1417
1417
|
<div class="backdrop">
|
|
1418
|
-
<div class="modal" role="dialog" aria-modal="true" ${f?`aria-label="${f}"`:`aria-labelledby="${
|
|
1418
|
+
<div class="modal" role="dialog" aria-modal="true" ${f?`aria-label="${f}"`:`aria-labelledby="${a}"`}>
|
|
1419
1419
|
<div class="modal-header">
|
|
1420
1420
|
<slot name="header" id="modal-title"></slot>
|
|
1421
1421
|
<button class="close-btn" aria-label="Close modal">×</button>
|
|
@@ -1428,7 +1428,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1428
1428
|
</div>
|
|
1429
1429
|
</div>
|
|
1430
1430
|
</div>
|
|
1431
|
-
`}};A("af-modal",
|
|
1431
|
+
`}};A("af-modal",an);oh=an});var Bb={};L(Bb,{default:()=>lh,AfriTabs:()=>gn});var gn,lh;var Rb=Y(()=>{M();gn=class gn extends r{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=`
|
|
1432
1432
|
<style>
|
|
1433
1433
|
:host {
|
|
1434
1434
|
display: block;
|
|
@@ -1500,30 +1500,30 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1500
1500
|
|
|
1501
1501
|
<div class="tabs-container">
|
|
1502
1502
|
<div class="tab-list" role="tablist">
|
|
1503
|
-
${o.map((
|
|
1503
|
+
${o.map((h,f)=>`
|
|
1504
1504
|
<button class="tab-button ${f===this._activeTab?"active":""}"
|
|
1505
1505
|
role="tab"
|
|
1506
1506
|
aria-selected="${f===this._activeTab}"
|
|
1507
1507
|
aria-controls="panel-${f}"
|
|
1508
1508
|
tabindex="${f===this._activeTab?"0":"-1"}"
|
|
1509
1509
|
id="tab-${f}">
|
|
1510
|
-
${
|
|
1510
|
+
${h.getAttribute("label")||`Tab ${f+1}`}
|
|
1511
1511
|
</button>
|
|
1512
1512
|
`).join("")}
|
|
1513
1513
|
</div>
|
|
1514
1514
|
<div class="tab-panels">
|
|
1515
|
-
${o.map((
|
|
1515
|
+
${o.map((h,f)=>`
|
|
1516
1516
|
<div class="tab-panel ${f===this._activeTab?"active":""}"
|
|
1517
1517
|
role="tabpanel"
|
|
1518
1518
|
id="panel-${f}"
|
|
1519
1519
|
aria-labelledby="tab-${f}">
|
|
1520
|
-
${
|
|
1520
|
+
${h.innerHTML}
|
|
1521
1521
|
</div>
|
|
1522
1522
|
`).join("")}
|
|
1523
1523
|
</div>
|
|
1524
1524
|
</div>
|
|
1525
1525
|
<slot name="tabs"></slot>
|
|
1526
|
-
`}};A("af-tabs",
|
|
1526
|
+
`}};A("af-tabs",gn);lh=gn});var Db={};L(Db,{default:()=>hh,AfriSidebar:()=>$n});var $n,hh;var Ob=Y(()=>{M();kt();ot();$n=class $n extends r{static get observedAttributes(){return["position"]}constructor(){super();this._unsubscribe=null}connectedCallback(){super.connectedCallback(),this._unsubscribe=y(()=>{this.updateUI()}),this.render()}disconnectedCallback(){if(this._unsubscribe)this._unsubscribe()}updateUI(){let t=W.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=W.ui.sidebarCollapsed;this.shadowRoot.innerHTML=`
|
|
1527
1527
|
<style>
|
|
1528
1528
|
:host {
|
|
1529
1529
|
display: block;
|
|
@@ -1632,7 +1632,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1632
1632
|
</button>
|
|
1633
1633
|
</div>
|
|
1634
1634
|
</aside>
|
|
1635
|
-
`,this.shadowRoot.getElementById("toggle").addEventListener("click",()=>{actions.toggleSidebar()})}};A("af-sidebar"
|
|
1635
|
+
`,this.shadowRoot.getElementById("toggle").addEventListener("click",()=>{actions.toggleSidebar()})}};A("af-sidebar",$n);hh=$n});var Wb={};L(Wb,{default:()=>fh,AfriDropdown:()=>vn});var vn,fh;var Eb=Y(()=>{M();vn=class vn extends r{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=`
|
|
1636
1636
|
<style>
|
|
1637
1637
|
:host {
|
|
1638
1638
|
display: inline-block;
|
|
@@ -1714,7 +1714,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1714
1714
|
<div class="dropdown-menu" role="menu" ${n?"":'aria-hidden="true"'}>
|
|
1715
1715
|
<slot></slot>
|
|
1716
1716
|
</div>
|
|
1717
|
-
`,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",vn);fh=vn});var Ub={};L(Ub,{default:()=>ah,AfriSelect:()=>wn});var wn,ah;var Vb=Y(()=>{M();wn=class wn extends r{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"),h=this.getAttribute("aria-label"),f=this.getAttribute("aria-describedby"),a={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},g=a[o]||a.tanzania,c=[];if(b)c.push(`error-${this._uniqueId}`);if(f)c.push(...f.split(" "));let J=c.length>0?`aria-describedby="${c.join(" ")}"`:"",F=this._selectedIndex>=0?this._options[this._selectedIndex]?.label:n;this.shadowRoot.innerHTML=`
|
|
1718
1718
|
<style>
|
|
1719
1719
|
:host {
|
|
1720
1720
|
display: block;
|
|
@@ -1731,7 +1731,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1731
1731
|
}
|
|
1732
1732
|
|
|
1733
1733
|
.required-star {
|
|
1734
|
-
color: ${
|
|
1734
|
+
color: ${g.error};
|
|
1735
1735
|
margin-left: 2px;
|
|
1736
1736
|
}
|
|
1737
1737
|
|
|
@@ -1743,7 +1743,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1743
1743
|
width: 100%;
|
|
1744
1744
|
padding: 10px 40px 10px 13px;
|
|
1745
1745
|
font-size: 15px;
|
|
1746
|
-
border: 2px solid ${b?
|
|
1746
|
+
border: 2px solid ${b?g.error:"#ddd"};
|
|
1747
1747
|
border-radius: 5px;
|
|
1748
1748
|
background: white;
|
|
1749
1749
|
cursor: pointer;
|
|
@@ -1756,8 +1756,8 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1756
1756
|
.select-trigger:focus,
|
|
1757
1757
|
.select-trigger.open {
|
|
1758
1758
|
outline: none;
|
|
1759
|
-
border-color: ${b?
|
|
1760
|
-
box-shadow: 0 0 0 3px ${b?
|
|
1759
|
+
border-color: ${b?g.error:g.focus};
|
|
1760
|
+
box-shadow: 0 0 0 3px ${b?g.error+"20":g.focus+"20"};
|
|
1761
1761
|
}
|
|
1762
1762
|
|
|
1763
1763
|
.select-arrow {
|
|
@@ -1803,18 +1803,18 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1803
1803
|
}
|
|
1804
1804
|
|
|
1805
1805
|
.select-option:hover {
|
|
1806
|
-
background: ${
|
|
1806
|
+
background: ${g.focus}15;
|
|
1807
1807
|
}
|
|
1808
1808
|
|
|
1809
1809
|
.select-option.selected {
|
|
1810
|
-
background: ${
|
|
1810
|
+
background: ${g.focus};
|
|
1811
1811
|
color: white;
|
|
1812
1812
|
}
|
|
1813
1813
|
|
|
1814
1814
|
.error-text {
|
|
1815
1815
|
font-size: 12px;
|
|
1816
1816
|
margin-top: 4px;
|
|
1817
|
-
color: ${
|
|
1817
|
+
color: ${g.error};
|
|
1818
1818
|
}
|
|
1819
1819
|
|
|
1820
1820
|
::slotted(option) {
|
|
@@ -1829,28 +1829,28 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1829
1829
|
class="select-trigger ${this._isOpen?"open":""}"
|
|
1830
1830
|
aria-expanded="${this._isOpen}"
|
|
1831
1831
|
aria-haspopup="listbox"
|
|
1832
|
-
${
|
|
1832
|
+
${h?`aria-label="${h}"`:""}
|
|
1833
1833
|
${b?'aria-invalid="true"':""}
|
|
1834
|
-
${
|
|
1835
|
-
${
|
|
1834
|
+
${J}>
|
|
1835
|
+
${F}
|
|
1836
1836
|
</button>
|
|
1837
1837
|
<span class="select-arrow" aria-hidden="true">▼</span>
|
|
1838
1838
|
<div class="select-dropdown ${this._isOpen?"open":""}"
|
|
1839
1839
|
role="listbox"
|
|
1840
1840
|
aria-hidden="${!this._isOpen}">
|
|
1841
|
-
${this._options.map((
|
|
1842
|
-
<div class="select-option ${
|
|
1843
|
-
data-index="${
|
|
1841
|
+
${this._options.map((S,O)=>`
|
|
1842
|
+
<div class="select-option ${O===this._selectedIndex?"selected":""}"
|
|
1843
|
+
data-index="${O}"
|
|
1844
1844
|
role="option"
|
|
1845
|
-
aria-selected="${
|
|
1846
|
-
${
|
|
1845
|
+
aria-selected="${O===this._selectedIndex}">
|
|
1846
|
+
${S.label}
|
|
1847
1847
|
</div>
|
|
1848
1848
|
`).join("")}
|
|
1849
1849
|
</div>
|
|
1850
1850
|
</div>
|
|
1851
1851
|
${b?`<div id="error-${this._uniqueId}" class="error-text" role="alert">${b}</div>`:""}
|
|
1852
1852
|
<slot></slot>
|
|
1853
|
-
`}};A("af-select",
|
|
1853
|
+
`}};A("af-select",wn);ah=wn});var Nb={};L(Nb,{default:()=>gh,AfriForm:()=>_n});var _n,gh;var jb=Y(()=>{M();Zt();_n=class _n extends r{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,h=this.getAttribute("action"),f=this.getAttribute("method")||"GET",a=new FormData(n),g=Object.fromEntries(a.entries());if(Array.from(this.querySelectorAll("af-input")).forEach((J)=>{let F=J.getAttribute("name");if(F)g[F]=J.value}),l){let J=$t.validate(l,g);if(!J.success){this._showValidationErrors(J.errors),this.emit("af-validation-error",{errors:J.errors});return}}if(!h)return;if(o){var c=o.textContent;o.textContent="Wait...",o.disabled=!0}try{let J=await fetch(h,{method:f,headers:{"Content-Type":"application/json"},body:JSON.stringify(g)});if(J.ok)this.emit("success",await J.json()),this.setAttribute("success","Form submitted successfully!"),this.removeAttribute("error");else{let F=await J.text();this.emit("error",F),this.setAttribute("error",F),this.removeAttribute("success")}}catch(J){this.emit("error",J.message),this.setAttribute("error",J.message),this.removeAttribute("success")}finally{if(o)o.textContent=c,o.disabled=!1}}_getSchema(t){return yt[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",_n);gh=_n});var Kb={};L(Kb,{default:()=>$h,AfriTooltip:()=>rn});var rn,$h;var mb=Y(()=>{M();rn=class rn extends r{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:`
|
|
1854
1854
|
bottom: 100%;
|
|
1855
1855
|
left: 50%;
|
|
1856
1856
|
transform: translateX(-50%) translateY(-8px);
|
|
@@ -1939,7 +1939,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1939
1939
|
<slot></slot>
|
|
1940
1940
|
</span>
|
|
1941
1941
|
<div class="tooltip-content" id="${this._tooltipId}" role="tooltip" aria-hidden="true">${t}</div>
|
|
1942
|
-
`}};A("af-tooltip",
|
|
1942
|
+
`}};A("af-tooltip",rn);$h=rn});var pb={};L(pb,{default:()=>vh,AfriToast:()=>cn});var cn,vh;var db=Y(()=>{M();cn=class cn extends r{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=`
|
|
1943
1943
|
<style>
|
|
1944
1944
|
:host {
|
|
1945
1945
|
position: fixed;
|
|
@@ -2013,7 +2013,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2013
2013
|
</div>
|
|
2014
2014
|
<button class="toast-close" id="close">×</button>
|
|
2015
2015
|
</div>
|
|
2016
|
-
`,this.shadowRoot.getElementById("close")?.addEventListener("click",()=>this.hide())}};A("af-toast",
|
|
2016
|
+
`,this.shadowRoot.getElementById("close")?.addEventListener("click",()=>this.hide())}};A("af-toast",cn);vh=cn});var ub={};L(ub,{default:()=>wh,AfriBadge:()=>An});var An,wh;var Ib=Y(()=>{M();An=class An extends r{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,h={sm:{padding:"2px 6px",fontSize:"11px"},md:{padding:"4px 10px",fontSize:"13px"},lg:{padding:"6px 14px",fontSize:"15px"}},f=h[n]||h.md;this.shadowRoot.innerHTML=`
|
|
2017
2017
|
<style>
|
|
2018
2018
|
:host {
|
|
2019
2019
|
display: inline-block;
|
|
@@ -2054,7 +2054,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2054
2054
|
<slot></slot>
|
|
2055
2055
|
${o?'<button class="remove-btn" aria-label="Remove">×</button>':""}
|
|
2056
2056
|
</span>
|
|
2057
|
-
`}};A("af-badge",
|
|
2057
|
+
`}};A("af-badge",An);wh=An});var Pb={};L(Pb,{default:()=>_h,AfriAvatar:()=>qn});var qn,_h;var Tb=Y(()=>{M();qn=class qn extends r{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",h={tanzania:"#1EB53A",maasai:"#FF0000",ndebele:"#4169E1",gold:"#FCD116"},f=h[l]||h.tanzania,a={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"}},g=a[o]||a.md,c={online:"#28a745",offline:"#6c757d",busy:"#dc3545",away:"#ffc107"};this.shadowRoot.innerHTML=`
|
|
2058
2058
|
<style>
|
|
2059
2059
|
:host {
|
|
2060
2060
|
display: inline-block;
|
|
@@ -2063,8 +2063,8 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2063
2063
|
|
|
2064
2064
|
.avatar {
|
|
2065
2065
|
position: relative;
|
|
2066
|
-
width: ${
|
|
2067
|
-
height: ${
|
|
2066
|
+
width: ${g.size};
|
|
2067
|
+
height: ${g.size};
|
|
2068
2068
|
border-radius: 50%;
|
|
2069
2069
|
display: flex;
|
|
2070
2070
|
align-items: center;
|
|
@@ -2072,7 +2072,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2072
2072
|
background: ${f};
|
|
2073
2073
|
color: white;
|
|
2074
2074
|
font-weight: 600;
|
|
2075
|
-
font-size: ${
|
|
2075
|
+
font-size: ${g.font};
|
|
2076
2076
|
overflow: hidden;
|
|
2077
2077
|
}
|
|
2078
2078
|
|
|
@@ -2086,11 +2086,11 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2086
2086
|
position: absolute;
|
|
2087
2087
|
bottom: 0;
|
|
2088
2088
|
right: 0;
|
|
2089
|
-
width: ${
|
|
2090
|
-
height: ${
|
|
2089
|
+
width: ${g.status};
|
|
2090
|
+
height: ${g.status};
|
|
2091
2091
|
border-radius: 50%;
|
|
2092
2092
|
border: 2px solid white;
|
|
2093
|
-
background: ${b?
|
|
2093
|
+
background: ${b?c[b]||c.offline:"transparent"};
|
|
2094
2094
|
}
|
|
2095
2095
|
</style>
|
|
2096
2096
|
|
|
@@ -2098,7 +2098,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2098
2098
|
${t?`<img src="${t}" alt="${n}" />`:this._getInitials(n)}
|
|
2099
2099
|
${b?'<span class="status"></span>':""}
|
|
2100
2100
|
</div>
|
|
2101
|
-
`}};A("af-avatar",
|
|
2101
|
+
`}};A("af-avatar",qn);_h=qn});var ib={};L(ib,{default:()=>rh,AfriProgress:()=>Hn});var Hn,rh;var Cb=Y(()=>{M();Hn=class Hn extends r{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"),h=this.hasAttribute("animated"),f=Math.min(100,Math.max(0,t/n*100)),a={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"}},g=a[o]||a.tanzania,c={sm:"6px",md:"10px",lg:"16px"},J=c[b]||c.md;this.shadowRoot.innerHTML=`
|
|
2102
2102
|
<style>
|
|
2103
2103
|
:host {
|
|
2104
2104
|
display: block;
|
|
@@ -2127,8 +2127,8 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2127
2127
|
|
|
2128
2128
|
.progress-track {
|
|
2129
2129
|
width: 100%;
|
|
2130
|
-
height: ${
|
|
2131
|
-
background: ${
|
|
2130
|
+
height: ${J};
|
|
2131
|
+
background: ${g.track};
|
|
2132
2132
|
border-radius: 100px;
|
|
2133
2133
|
overflow: hidden;
|
|
2134
2134
|
}
|
|
@@ -2136,10 +2136,10 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2136
2136
|
.progress-bar {
|
|
2137
2137
|
height: 100%;
|
|
2138
2138
|
width: ${f}%;
|
|
2139
|
-
background: ${
|
|
2139
|
+
background: ${g.bar};
|
|
2140
2140
|
border-radius: 100px;
|
|
2141
2141
|
transition: width 500ms ease-out;
|
|
2142
|
-
${
|
|
2142
|
+
${h?`
|
|
2143
2143
|
background-size: 30px 30px;
|
|
2144
2144
|
background-image: linear-gradient(
|
|
2145
2145
|
135deg,
|
|
@@ -2175,7 +2175,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2175
2175
|
aria-valuemax="${n}"></div>
|
|
2176
2176
|
</div>
|
|
2177
2177
|
</div>
|
|
2178
|
-
`}};A("af-progress",
|
|
2178
|
+
`}};A("af-progress",Hn);rh=Hn});var yb={};L(yb,{default:()=>ch,AfriLoader:()=>Xn});var Xn,ch;var Zb=Y(()=>{M();Xn=class Xn extends r{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
|
|
2179
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=`
|
|
2180
2180
|
<style>
|
|
2181
2181
|
:host {
|
|
@@ -2206,7 +2206,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2206
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" />`}
|
|
2207
2207
|
</svg>
|
|
2208
2208
|
</div>
|
|
2209
|
-
`}};A("af-loader",
|
|
2209
|
+
`}};A("af-loader",Xn);ch=Xn});var eb={};L(eb,{default:()=>Ah,AfriSkeleton:()=>Yn});var Yn,Ah;var sb=Y(()=>{M();Yn=class Yn extends r{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"}},h=l[t]||l.text;this.shadowRoot.innerHTML=`
|
|
2210
2210
|
<style>
|
|
2211
2211
|
:host {
|
|
2212
2212
|
display: block;
|
|
@@ -2221,7 +2221,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2221
2221
|
);
|
|
2222
2222
|
background-size: 200% 100%;
|
|
2223
2223
|
animation: shimmer 1.5s infinite;
|
|
2224
|
-
border-radius: ${
|
|
2224
|
+
border-radius: ${h.borderRadius};
|
|
2225
2225
|
}
|
|
2226
2226
|
|
|
2227
2227
|
@keyframes shimmer {
|
|
@@ -2230,8 +2230,8 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2230
2230
|
}
|
|
2231
2231
|
|
|
2232
2232
|
.skeleton-line {
|
|
2233
|
-
width: ${t==="text"?n:
|
|
2234
|
-
height: ${
|
|
2233
|
+
width: ${t==="text"?n:h.width||n};
|
|
2234
|
+
height: ${h.height};
|
|
2235
2235
|
margin-bottom: 8px;
|
|
2236
2236
|
}
|
|
2237
2237
|
|
|
@@ -2241,8 +2241,8 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2241
2241
|
}
|
|
2242
2242
|
</style>
|
|
2243
2243
|
|
|
2244
|
-
${t==="text"||t==="title"?Array(b).fill(0).map(()=>'<div class="skeleton skeleton-line"></div>').join(""):`<div class="skeleton" style="width: ${
|
|
2245
|
-
`}};A("af-skeleton",
|
|
2244
|
+
${t==="text"||t==="title"?Array(b).fill(0).map(()=>'<div class="skeleton skeleton-line"></div>').join(""):`<div class="skeleton" style="width: ${h.width||n}; height: ${h.height||o};"></div>`}
|
|
2245
|
+
`}};A("af-skeleton",Yn);Ah=Yn});var zb={};L(zb,{default:()=>qh,AfriDivider:()=>xn});var xn,qh;var to=Y(()=>{M();xn=class xn extends r{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}
|
|
2246
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}
|
|
2247
2247
|
L${n*0.9},${o} L${n*0.8},${o/2}
|
|
2248
2248
|
L${n*0.7},${o} L${n*0.6},${o/2}
|
|
@@ -2267,7 +2267,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2267
2267
|
<svg viewBox="0 0 100 ${n}" preserveAspectRatio="none">
|
|
2268
2268
|
<path d="${this._getPatternPath(t,100,parseInt(n))}" fill="currentColor" />
|
|
2269
2269
|
</svg>
|
|
2270
|
-
`}};A("af-divider"
|
|
2270
|
+
`}};A("af-divider",xn);qh=xn});var no={};L(no,{default:()=>Hh,KangaCard:()=>Qn});var Qn,Hh;var bo=Y(()=>{M();Ft();Qn=class Qn extends r{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=`
|
|
2271
2271
|
<style>
|
|
2272
2272
|
:host {
|
|
2273
2273
|
display: block;
|
|
@@ -2349,7 +2349,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2349
2349
|
</div>
|
|
2350
2350
|
`:'<div class="jina"><slot name="proverb"></slot></div>'}
|
|
2351
2351
|
</article>
|
|
2352
|
-
`,this.applyTheme()}};A("af-kanga-card",
|
|
2352
|
+
`,this.applyTheme()}};A("af-kanga-card",Qn);Hh=Qn});var oo={};L(oo,{default:()=>Xh,CulturalCard:()=>Jn});var Jn,Xh;var lo=Y(()=>{M();Ft();Jn=class Jn extends r{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=`
|
|
2353
2353
|
<style>
|
|
2354
2354
|
:host {
|
|
2355
2355
|
display: block;
|
|
@@ -2514,7 +2514,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2514
2514
|
`:""}
|
|
2515
2515
|
</div>
|
|
2516
2516
|
</article>
|
|
2517
|
-
`}};A("af-cultural-card",
|
|
2517
|
+
`}};A("af-cultural-card",Jn);Xh=Jn});var ho={};L(ho,{default:()=>Yh,PatternShowcase:()=>Gn});var Gn,Yh;var fo=Y(()=>{M();Ft();Gn=class Gn extends r{static get observedAttributes(){return["region","size"]}constructor(){super();this._allPatterns=[{key:"shuka",name:"Maasai Shuka",region:"east",country:"Tanzania/Kenya",fn:On,meaning:"Bravery, Unity, Identity"},{key:"hadzabe",name:"Hadzabe",region:"east",country:"Tanzania",fn:Wn,meaning:"Ancient traditions, Hunter-gatherer heritage"},{key:"kanga",name:"Kanga",region:"east",country:"Tanzania/Kenya",fn:En,meaning:"Communication, Proverbs, Femininity"},{key:"kitenge",name:"Kitenge",region:"east",country:"East Africa",fn:Un,meaning:"Celebration, African identity"},{key:"tibeb",name:"Tibeb",region:"east",country:"Ethiopia",fn:un,meaning:"Faith, Tradition, Celebration"},{key:"kente",name:"Kente",region:"west",country:"Ghana",fn:Vn,meaning:"Royalty, Wisdom, Celebration"},{key:"adinkra",name:"Adinkra",region:"west",country:"Ghana",fn:Nn,meaning:"Philosophy, Proverbs, Wisdom"},{key:"bogolan",name:"Bogolan",region:"west",country:"Mali",fn:mn,meaning:"Earth energy, Protection, Healing"},{key:"asooke",name:"Aso-Oke",region:"west",country:"Nigeria",fn:jn,meaning:"Prestige, Celebration, Heritage"},{key:"adire",name:"Adire (Indigo)",region:"west",country:"Nigeria",fn:Zn,meaning:"Creativity, Uniqueness, Depth"},{key:"ankara",name:"Ankara",region:"west",country:"West Africa",fn:Kn,meaning:"Boldness, Pan-African pride"},{key:"kuba",name:"Kuba Shoowa",region:"central",country:"DRC",fn:pn,meaning:"Status, Mathematics, Eternity"},{key:"imigongo",name:"Imigongo",region:"central",country:"Rwanda",fn:dn,meaning:"Resilience, Strength, Artistry"},{key:"berber",name:"Berber",region:"north",country:"North Africa",fn:yn,meaning:"Protection, Nature, Identity"},{key:"ndebele",name:"Ndebele",region:"south",country:"South Africa",fn:In,meaning:"Artistry, Marriage, Status"},{key:"zulu",name:"Zulu Beadwork",region:"south",country:"South Africa",fn:Pn,meaning:"Love letters, Community"},{key:"swazi",name:"Swazi",region:"south",country:"Eswatini",fn:Tn,meaning:"Monarchy, Warriors, Pride"},{key:"xhosa",name:"Xhosa",region:"south",country:"South Africa",fn:Cn,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((h)=>h.region===t),b={sm:80,md:120,lg:160},l=b[n]||b.md;this.shadowRoot.innerHTML=`
|
|
2518
2518
|
<style>
|
|
2519
2519
|
:host {
|
|
2520
2520
|
display: block;
|
|
@@ -2634,20 +2634,20 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2634
2634
|
</div>
|
|
2635
2635
|
|
|
2636
2636
|
<div class="pattern-grid">
|
|
2637
|
-
${o.map((
|
|
2638
|
-
<div class="pattern-item" data-key="${
|
|
2639
|
-
<div class="pattern-preview" style="background-image: url('${
|
|
2637
|
+
${o.map((h)=>`
|
|
2638
|
+
<div class="pattern-item" data-key="${h.key}">
|
|
2639
|
+
<div class="pattern-preview" style="background-image: url('${h.fn()}')"></div>
|
|
2640
2640
|
<div class="pattern-info">
|
|
2641
|
-
<span class="region-label region-${
|
|
2642
|
-
<div class="pattern-name">${
|
|
2643
|
-
<div class="pattern-country">${
|
|
2644
|
-
<div class="pattern-meaning">${
|
|
2641
|
+
<span class="region-label region-${h.region}">${h.region.charAt(0).toUpperCase()+h.region.slice(1)}</span>
|
|
2642
|
+
<div class="pattern-name">${h.name}</div>
|
|
2643
|
+
<div class="pattern-country">${h.country}</div>
|
|
2644
|
+
<div class="pattern-meaning">${h.meaning}</div>
|
|
2645
2645
|
</div>
|
|
2646
2646
|
</div>
|
|
2647
2647
|
`).join("")}
|
|
2648
2648
|
</div>
|
|
2649
2649
|
</div>
|
|
2650
|
-
`,this.shadowRoot.querySelectorAll(".region-tab").forEach((
|
|
2650
|
+
`,this.shadowRoot.querySelectorAll(".region-tab").forEach((h)=>{h.addEventListener("click",()=>{this.setAttribute("region",h.dataset.region)})})}};A("af-pattern-showcase",Gn);Yh=Gn});var ao={};L(ao,{AfriLanguageSwitcher:()=>Y0});var Y0;var go=Y(()=>{M();Y0=class Y0 extends r{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=R`
|
|
2651
2651
|
<style>
|
|
2652
2652
|
:host { display: inline-block; position: relative; font-family: var(--font-body); }
|
|
2653
2653
|
.switcher-btn {
|
|
@@ -2692,13 +2692,13 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2692
2692
|
</button>
|
|
2693
2693
|
|
|
2694
2694
|
<div class="dropdown">
|
|
2695
|
-
${t.map((b)=>
|
|
2695
|
+
${t.map((b)=>R`
|
|
2696
2696
|
<div class="lang-option" data-code="${b.code}" dir="${b.dir||"ltr"}">
|
|
2697
2697
|
${b.name}
|
|
2698
2698
|
</div>
|
|
2699
2699
|
`)}
|
|
2700
2700
|
</div>
|
|
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",
|
|
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",Y0)});var $o={};L($o,{AfriAuth:()=>x0});var x0;var vo=Y(()=>{M();x0=class x0 extends r{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,h=this.shadowRoot.querySelector(".feedback");h.textContent="Processing...";try{let a=await(await fetch("/api/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:this.mode,email:b,password:l})})).json();if(a.error)h.textContent=a.error,h.style.color="#ef4444";else h.textContent="Success! Redirecting...",h.style.color="#22c55e",setTimeout(()=>window.location.href="/",1000)}catch(f){h.textContent="Network Error"}})}render(){let t=this.mode==="login";this.shadowRoot.innerHTML=`
|
|
2702
2702
|
<style>
|
|
2703
2703
|
:host {
|
|
2704
2704
|
display: block;
|
|
@@ -2796,7 +2796,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2796
2796
|
<span class="toggle-mode">${t?"Create an account":"Sign in"}</span>
|
|
2797
2797
|
</div>
|
|
2798
2798
|
</div>
|
|
2799
|
-
`}};A("af-auth",
|
|
2799
|
+
`}};A("af-auth",x0)});var wo={};L(wo,{default:()=>xh});var Q0,xh;var _o=Y(()=>{M();Q0=class Q0 extends r{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=R`
|
|
2800
2800
|
<style>
|
|
2801
2801
|
.toggle-btn {
|
|
2802
2802
|
background: var(--bg-surface-elevated, var(--afri-obsidian));
|
|
@@ -2825,7 +2825,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2825
2825
|
<span class="icon">\${isDark ? '🌙' : '☀️'}</span>
|
|
2826
2826
|
<span>\${isDark ? 'Dark Mode' : 'Light Mode'}</span>
|
|
2827
2827
|
</button>
|
|
2828
|
-
`;let n=this.shadowRoot.querySelector(".toggle-btn");if(n)n.addEventListener("click",()=>this.toggleTheme())}};A("af-theme-toggle",
|
|
2828
|
+
`;let n=this.shadowRoot.querySelector(".toggle-btn");if(n)n.addEventListener("click",()=>this.toggleTheme())}};A("af-theme-toggle",Q0);xh=Q0});ot();kt();Ft();var en={};L(en,{transitionPage:()=>k0,default:()=>Ro,animateStaggered:()=>L0,Easing:()=>pt});var pt={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 L0(t,{delay:n=50,duration:o=600,easing:b=pt.DrumBeat,y:l=20,scale:h=0.95}={}){let f=typeof t==="string"?document.querySelectorAll(t):t;if(!f||f.length===0)return;let a=new IntersectionObserver((g)=>{g.forEach((c,J)=>{if(c.isIntersecting){let F=Math.random()*10,S=J*n+F,O=c.target;O.animate([{opacity:0,transform:`translateY(${l}px) scale(${h})`},{opacity:1,transform:"translateY(0) scale(1)"}],{duration:o,delay:S,easing:b,fill:"forwards"}),a.unobserve(O),O.style.opacity="1"}})},{threshold:0.1});f.forEach((g)=>{g.style.opacity="0",a.observe(g)})}function k0(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:pt.DrumBeat})}}var Ro={Easing:pt,animateStaggered:L0,transitionPage:k0};function S0(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(),h=t[l];if(h)console.log(`\uD83C\uDFDD️ Hydrating Island: <${l}>`),h().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))})}Zt();a0();var s0="afri_session",Pl=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function g0(t=""){return t.split(";").map((n)=>n.trim()).filter(Boolean).reduce((n,o)=>{let b=o.indexOf("=");if(b===-1)return n;let l=o.slice(0,b).trim(),h=o.slice(b+1).trim();return n[l]=h,n},{})}function $0(){return crypto.randomUUID()}function z0(t){let n=t?.headers?.get?.("cookie")||"",b=g0(n).afri_session;if(b&&Pl.test(b))return b;return $0()}class tb{constructor(){this.sessions=new Map}ensure(t){if(!this.sessions.has(t))this.sessions.set(t,{data:{counter:{value:0}},meta:{createdAt:new Date,lastSeenAt:new Date}});return this.sessions.get(t)}touch(t){let n=this.ensure(t);return n.meta.lastSeenAt=new Date,n}has(t){return this.sessions.has(t)}get(t){return this.touch(t).data}set(t,n,o){let b=this.get(t),l=n.split("/"),h=b;while(l.length>1){let f=l.shift();if(!h[f]||typeof h[f]!=="object")h[f]={};h=h[f]}return h[l[0]]=o,o}delete(t){return this.sessions.delete(t)}clear(){this.sessions.clear()}}var P=new tb;var nb={incrementCounter(t){let b=(P.get(t).counter?.value||0)+1;return P.set(t,"counter/value",b),b},resetCounter(t){return P.set(t,"counter/value",0),0},getCounter(t){return P.get(t).counter?.value||0}};class v0{constructor(){this.middlewares=[]}use(t){if(typeof t!=="function")throw Error("Middleware must be a function");return this.middlewares.push(t),this}async run(t){for(let n of this.middlewares){let o=await n(t);if(o instanceof Response)return o;if(o?.response)return o.response;if(o?.context)Object.assign(t,o.context)}return null}}function bb(){return async(t)=>{return f0("log",`[AfriCode] ${t.req.method} ${t.pathname}`),{}}}function ob(t={}){return async(n)=>{let{protectedPaths:o=[],authorize:b=()=>!1,unauthorizedResponse:l=()=>new Response("Unauthorized",{status:401})}=t;if(o.some((f)=>n.pathname.startsWith(f))){if(!await b(n))return{response:l(n)}}return{}}}class nt extends Error{constructor(t,n="INTERNAL_ERROR",o={},b=500){super(t);this.name="AfriCodeError",this.code=n,this.context=o,this.statusCode=b,this.timestamp=new Date().toISOString()}toJSON(){return{error:{code:this.code,message:this.message,...this.context.field?{field:this.context.field}:{},...Object.keys(this.context).length>0?{context:this.context}:{}}}}toResponse(){return new Response(JSON.stringify(this.toJSON()),{status:this.statusCode,headers:{"Content-Type":"application/json"}})}}class et extends nt{constructor(t,n=null,o={}){super(t,"VALIDATION_FAILED",{field:n,...o},422);this.name="ValidationError"}static fromZodError(t){let n=t.issues[0],o=n?.path?.join(".")||null,b=n?.message||"Validation failed";return new et(b,o,{issues:t.issues.map((l)=>({field:l.path.join("."),message:l.message,code:l.code}))})}}class w0 extends nt{constructor(t,n){let o=n===""?"an empty string":`"${n}"`;super(`Field '${t}' must be a valid URL or null. Got ${o}.`,"INVALID_URL",{field:t,received:n},422);this.name="InvalidUrlError"}}class jt extends nt{constructor(t,n="SECURITY_VIOLATION",o={},b=403){super(t,n,o,b);this.name="SecurityError"}}class _0 extends jt{constructor(t="missing"){let n={missing:"CSRF token missing. Include the token in both the cookie and the X-CSRF-Token header.",mismatch:"CSRF token mismatch. The header token does not match the cookie token."};super(n[t]||n.missing,"CSRF_FAILURE",{reason:t});this.name="CsrfError"}}class r0 extends jt{constructor(t,n="Too many requests. Please try again later."){super(n,"RATE_LIMIT_EXCEEDED",{retryAfter:t},429);this.name="RateLimitError"}}class c0 extends nt{constructor(t,n=null,o={}){super(t,"DATABASE_ERROR",{operation:n,...o},500);this.name="DatabaseError"}}class A0 extends nt{constructor(t,n,o={}){super(`Component Error in <${n}>: ${t}`,"COMPONENT_ERROR",{componentName:n,...o},500);this.name="ComponentError"}}M();M();class q0 extends r{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=`
|
|
2829
2829
|
<style>
|
|
2830
2830
|
:host { display: block; width: 100%; font-family: 'Inter', system-ui, sans-serif; }
|
|
2831
2831
|
.boundary-error {
|
|
@@ -2896,6 +2896,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2896
2896
|
`,this.shadowRoot.getElementById("retry-btn").addEventListener("click",()=>{this.reset()});return}this.shadowRoot.innerHTML=`
|
|
2897
2897
|
<style>:host { display: block; }</style>
|
|
2898
2898
|
<slot></slot>
|
|
2899
|
-
`}}A("af-error-boundary",
|
|
2899
|
+
`}}A("af-error-boundary",q0);var Mn={"af-button":()=>Promise.resolve().then(() => (fb(),hb)),"af-card":()=>Promise.resolve().then(() => (gb(),ab)),"af-navbar":()=>Promise.resolve().then(() => (vb(),$b)),"af-input":()=>Promise.resolve().then(() => (_b(),wb)),"af-alert":()=>Promise.resolve().then(() => (cb(),rb)),"af-grid":()=>Promise.resolve().then(() => (qb(),Ab)),"af-section":()=>Promise.resolve().then(() => (Xb(),Hb)),"af-icon":()=>Promise.resolve().then(() => (xb(),Yb)),"af-accordion":()=>Promise.resolve().then(() => (Jb(),Qb)),"af-hero":()=>Promise.resolve().then(() => (Mb(),Gb)),"af-table":()=>Promise.resolve().then(() => (kb(),Lb)),"af-modal":()=>Promise.resolve().then(() => (Fb(),Sb)),"af-tabs":()=>Promise.resolve().then(() => (Rb(),Bb)),"af-sidebar":()=>Promise.resolve().then(() => (Ob(),Db)),"af-dropdown":()=>Promise.resolve().then(() => (Eb(),Wb)),"af-select":()=>Promise.resolve().then(() => (Vb(),Ub)),"af-form":()=>Promise.resolve().then(() => (jb(),Nb)),"af-tooltip":()=>Promise.resolve().then(() => (mb(),Kb)),"af-toast":()=>Promise.resolve().then(() => (db(),pb)),"af-badge":()=>Promise.resolve().then(() => (Ib(),ub)),"af-avatar":()=>Promise.resolve().then(() => (Tb(),Pb)),"af-progress":()=>Promise.resolve().then(() => (Cb(),ib)),"af-loader":()=>Promise.resolve().then(() => (Zb(),yb)),"af-skeleton":()=>Promise.resolve().then(() => (sb(),eb)),"af-divider":()=>Promise.resolve().then(() => (to(),zb)),"af-kanga-card":()=>Promise.resolve().then(() => (bo(),no)),"af-cultural-card":()=>Promise.resolve().then(() => (lo(),oo)),"af-pattern-showcase":()=>Promise.resolve().then(() => (fo(),ho)),"af-language-switcher":()=>Promise.resolve().then(() => (go(),ao)),"af-auth":()=>Promise.resolve().then(() => (vo(),$o)),"af-theme-toggle":()=>Promise.resolve().then(() => (_o(),wo))};var bt={COMPONENT:"component",FORM:"form",LIST:"list",CARD:"card",MODAL:"modal",TOAST:"toast",PROGRESS:"progress"},r1={component:{type:"object",properties:{id:{type:"string"},type:{type:"string",enum:Object.values(bt)},props:{type:"object"},children:{type:"array",items:{$ref:"#"}}},required:["id","type"]}};function ro(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ln(t){if(Array.isArray(t))return t.map(Ln).join("");if(t===null||t===void 0||t===!1)return"";if(typeof t==="string"||typeof t==="number"||typeof t==="boolean")return ro(t);if(typeof t!=="object")return"";let n=t.tag||t.tagName;if(!n)return"";let o=t.props||{},b=Object.entries(o).filter(([,h])=>h!==null&&h!==void 0&&h!==!1).map(([h,f])=>f===!0?h:`${h}="${ro(f)}"`).join(" "),l=Ln(t.children??t.content??"");return`<${n}${b?` ${b}`:""}>${l}</${n}>`}function Qh(t){return/<\s*script\b|on\w+\s*=|javascript:/i.test(String(t))}class kn{constructor(t){this.root=t,this.components=new Map}render(t){if(!t||!t.type)throw Error("Invalid A2UI message");if(t.html!==void 0){if(Qh(t.html))throw Error("Unsafe HTML is not allowed in A2UI render messages");throw Error("Raw HTML payloads are not supported in A2UI render messages")}let n=Array.isArray(t.components)?t.components.map(Ln).join(""):Ln(t.component||t);if(t.id)this.components.set(t.id,{id:t.id,type:t.type,props:t.props||{},children:t.children||t.components||[]});if(this.root&&typeof this.root.appendChild==="function"&&typeof document<"u"&&n){let b=document.createElement("div");b.innerHTML=n;while(b.firstChild)this.root.appendChild(b.firstChild)}return n}createElement(t){let{type:n,props:o={},children:b=[]}=t,l;switch(n){case bt.COMPONENT:l=this.createCustomComponent(o);break;case bt.FORM:l=this.createForm(o);break;case bt.LIST:l=this.createList(o);break;case bt.CARD:l=this.createCard(o);break;case bt.MODAL:l=this.createModal(o);break;case bt.TOAST:l=this.createToast(o);break;case bt.PROGRESS:l=this.createProgress(o);break;default:throw Error(`Unknown A2UI component type: ${n}`)}if(b.length>0)for(let h of b){let f=this.createElement(h);l.appendChild(f)}return l}createCustomComponent({tag:t,...n}){let o=document.createElement(t||"div");return Object.assign(o,n),o}createForm({fields:t=[],onSubmit:n}){let o=document.createElement("af-form");for(let b of t){let l=document.createElement("af-input");l.setAttribute("name",b.name),l.setAttribute("placeholder",b.placeholder||""),l.setAttribute("type",b.type||"text"),o.appendChild(l)}if(n)o.addEventListener("submit",n);return o}createList({items:t=[]}){let n=document.createElement("af-grid");for(let o of t){let b=this.createCard(o);n.appendChild(b)}return n}createCard({title:t,content:n,image:o}){let b=document.createElement("af-card");if(t){let l=document.createElement("h3");l.textContent=t,b.appendChild(l)}if(n){let l=document.createElement("p");l.textContent=n,b.appendChild(l)}if(o){let l=document.createElement("img");l.src=o,l.alt=t||"Card image",b.appendChild(l)}return b}createModal({title:t,content:n,actions:o=[]}){let b=document.createElement("af-modal");if(b.setAttribute("open",""),t){let h=document.createElement("h2");h.slot="header",h.textContent=t,b.appendChild(h)}if(n){let h=document.createElement("p");h.textContent=n,b.appendChild(h)}let l=document.createElement("div");l.slot="footer";for(let h of o){let f=document.createElement("af-button");if(f.textContent=h.label,h.primary)f.setAttribute("variant","primary");if(h.onClick)f.addEventListener("click",h.onClick);l.appendChild(f)}return b.appendChild(l),b}createToast({message:t,type:n="info",duration:o=3000}){let b=document.createElement("af-toast");return b.setAttribute("type",n),b.textContent=t,setTimeout(()=>{b.remove()},o),b}createProgress({value:t=0,max:n=100,label:o}){let b=document.createElement("af-progress");if(b.setAttribute("value",t),b.setAttribute("max",n),o)b.setAttribute("label",o);return b}update(t,n){let o=this.components.get(t);if(o)Object.assign(o,n)}remove(t){let n=this.components.get(t);if(n)n.remove(),this.components.delete(t)}}class Sn{constructor(t){this.renderer=t,this.messageQueue=[],this.messageHandlers=[],this.isProcessing=!1}onMessage(t){if(typeof t==="function")this.messageHandlers.push(t)}sendMessage(t){return this.processMessage(t)}processMessage(t){if(typeof t==="string")try{t=JSON.parse(t)}catch{return console.warn("Invalid A2UI message format:",t),null}if(t?.type==="render"&&this.renderer)return this.renderer.render(t);for(let n of this.messageHandlers)n(t);return t}processQueue(){if(this.isProcessing||this.messageQueue.length===0)return;this.isProcessing=!0;while(this.messageQueue.length>0){let t=this.messageQueue.shift();try{this.renderer.render(t)}catch(n){console.error("A2UI render error:",n)}}this.isProcessing=!1}async handleStream(t){let n=t.getReader(),o=new TextDecoder,b="";while(!0){let{done:l,value:h}=await n.read();if(l)break;b+=o.decode(h,{stream:!0});let f=b.split(`
|
|
2900
|
+
`);b=f.pop();for(let a of f)if(a.trim())this.processMessage(a.trim())}if(b.trim())this.processMessage(b.trim())}createStream(){let t=new Set;return{subscribe(n){if(typeof n!=="function")return()=>{};return t.add(n),()=>t.delete(n)},push(n){for(let o of t)o(n)}}}validateAgainstSchema(t){let n=t?.tag||t?.tagName;return Promise.resolve(Boolean(n&&Mn[n]))}}function co(t){if(typeof document>"u")t=null;else t=t||document.body;let n=new kn(t),o=new Sn(n);if(typeof window<"u")window.a2ui={render:(b)=>o.processMessage(b),handleStream:(b)=>o.handleStream(b),update:(b,l)=>n.update(b,l),remove:(b)=>n.remove(b),sendMessage:(b)=>o.sendMessage(b),onMessage:(b)=>o.onMessage(b),createStream:()=>o.createStream(),validateAgainstSchema:(b)=>o.validateAgainstSchema(b)};return{renderer:n,protocol:o}}ot();function Jh(t={}){if(typeof window<"u"){console.log("\uD83C\uDF0D AfriCode Browser SDK Initialized");let n={...Mn,...t};if(Object.keys(n).length>0)S0(n)}}var B1={createReactiveState:vt,subscribe:y,createSignal:Rn,createEffect:Dn,store:W,actions:G0,patterns:St,motion:en,html:R,Layout:F0,schemas:yt,Validation:$t,rules:m,afri:y0,AfriFieldBuilder:I,normalizeInput:Z0,buildSchema:e0,createFramework:C0,getConfig:Nt,getRequestIdentity:z0,parseCookieHeader:g0,createSessionId:$0,SESSION_COOKIE_NAME:s0,sessionStore:P,runtimeActions:nb,MiddlewareManager:v0,loggerMiddleware:bb,authMiddleware:ob,AfriCodeError:nt,ValidationError:et,InvalidUrlError:w0,SecurityError:jt,CsrfError:_0,RateLimitError:r0,DatabaseError:c0,ComponentError:A0,initA2UI:co,A2UIRenderer:kn,A2UIProtocol:Sn,init:Jh};export{y as subscribe,W as store,P as sessionStore,yt as schemas,nb as runtimeActions,m as rules,St as patterns,g0 as parseCookieHeader,Z0 as normalizeInput,en as motion,bb as loggerMiddleware,co as initA2UI,Jh as init,R as html,z0 as getRequestIdentity,Nt as getConfig,B1 as default,Rn as createSignal,$0 as createSessionId,vt as createReactiveState,C0 as createFramework,Dn as createEffect,e0 as buildSchema,ob as authMiddleware,y0 as afri,G0 as actions,et as ValidationError,$t as Validation,jt as SecurityError,s0 as SESSION_COOKIE_NAME,r0 as RateLimitError,v0 as MiddlewareManager,F0 as Layout,w0 as InvalidUrlError,c0 as DatabaseError,_0 as CsrfError,A0 as ComponentError,I as AfriFieldBuilder,nt as AfriCodeError,kn as A2UIRenderer,Sn as A2UIProtocol};
|
|
2900
2901
|
|
|
2901
|
-
//# debugId=
|
|
2902
|
+
//# debugId=047013451C9EB27464756E2164756E21
|