@africode/core 5.0.11 → 5.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/AGENTS.md +585 -585
  2. package/AGENT_INSTRUCTIONS.md +595 -595
  3. package/COMPONENT_SCHEMA.json +1826 -1800
  4. package/LICENSE +623 -623
  5. package/README.md +476 -476
  6. package/bin/africode.js +73 -73
  7. package/bin/cli.ts +82 -82
  8. package/bin/create-africode.js +220 -220
  9. package/bin/scaffold.ts +218 -218
  10. package/components/accordion.js +183 -183
  11. package/components/alert.js +131 -131
  12. package/components/auth-form.js +154 -154
  13. package/components/auth.js +172 -172
  14. package/components/avatar.js +117 -117
  15. package/components/badge.js +104 -104
  16. package/components/base.d.ts +139 -139
  17. package/components/base.js +234 -234
  18. package/components/breadcrumb.js +76 -72
  19. package/components/button.js +164 -164
  20. package/components/card.js +144 -137
  21. package/components/carousel.js +32 -32
  22. package/components/cart-drawer.js +28 -28
  23. package/components/code-block.js +20 -20
  24. package/components/contact-form.js +25 -25
  25. package/components/cookie-consent.js +23 -23
  26. package/components/cta-banner.js +38 -38
  27. package/components/cultural-card.js +243 -243
  28. package/components/dashboard-activity-list.js +103 -103
  29. package/components/dashboard-card.js +85 -85
  30. package/components/dashboard-metric.js +81 -81
  31. package/components/dashboard-shell.js +85 -85
  32. package/components/dashboard-topbar.js +84 -84
  33. package/components/divider.js +83 -83
  34. package/components/dropdown.js +171 -171
  35. package/components/error-boundary.js +155 -155
  36. package/components/faq-accordion.js +23 -23
  37. package/components/feature-grid.js +85 -85
  38. package/components/file-uploader.js +22 -22
  39. package/components/filter-bar.js +19 -19
  40. package/components/footer.js +113 -113
  41. package/components/form.js +131 -131
  42. package/components/gallery.js +22 -22
  43. package/components/hero.js +140 -138
  44. package/components/icon.js +36 -36
  45. package/components/index.js +128 -128
  46. package/components/input.js +252 -256
  47. package/components/kanga-card.js +185 -185
  48. package/components/kyc-upload.js +173 -173
  49. package/components/language-switcher.js +108 -108
  50. package/components/loader.js +80 -80
  51. package/components/modal.js +262 -262
  52. package/components/motion.js +84 -84
  53. package/components/nav-drawer.js +216 -216
  54. package/components/navbar.js +243 -236
  55. package/components/newsletter-signup.js +24 -24
  56. package/components/pagination.js +31 -31
  57. package/components/pattern-showcase.js +225 -225
  58. package/components/pricing-card.js +100 -100
  59. package/components/product-card.js +41 -41
  60. package/components/progress.js +132 -134
  61. package/components/react.js +111 -111
  62. package/components/search-box.js +24 -24
  63. package/components/section.js +54 -54
  64. package/components/select.js +321 -322
  65. package/components/sidebar.js +180 -180
  66. package/components/simple-chart.js +22 -22
  67. package/components/skeleton.js +85 -85
  68. package/components/stepper.js +28 -28
  69. package/components/table.js +181 -181
  70. package/components/tabs.js +202 -202
  71. package/components/team-grid.js +23 -23
  72. package/components/testimonial.js +94 -94
  73. package/components/theme-toggle.js +82 -82
  74. package/components/toast.js +139 -139
  75. package/components/tooltip.js +167 -167
  76. package/components/transaction-ledger.js +138 -138
  77. package/components/ui-avatar.js +79 -79
  78. package/components/ui-badge.js +61 -61
  79. package/components/ui-button.js +149 -149
  80. package/components/ui-card.js +74 -75
  81. package/components/ui-chip.js +87 -87
  82. package/components/ui-input.js +110 -110
  83. package/components/ui-popover.js +84 -84
  84. package/components/ui-progress-ring.js +60 -60
  85. package/components/ui-select.js +85 -85
  86. package/components/ui-stat.js +75 -75
  87. package/components/ui-switch.js +85 -85
  88. package/components/ui-table.js +69 -69
  89. package/components/ui-tabs.js +99 -99
  90. package/components/ui-tag.js +64 -64
  91. package/components/ui-textarea.js +84 -84
  92. package/components/ui-tooltip.js +66 -66
  93. package/components/video-player.js +22 -22
  94. package/components/wallet-balance.js +114 -114
  95. package/core/a2ui-schema-manager.js +351 -351
  96. package/core/a2ui.js +696 -696
  97. package/core/actions.js +27 -27
  98. package/core/bun-runtime.js +396 -396
  99. package/core/cli/commands/add.js +23 -23
  100. package/core/cli/commands/audit.js +58 -58
  101. package/core/cli/commands/build.js +193 -193
  102. package/core/cli/commands/create-plugin.js +241 -241
  103. package/core/cli/commands/dev.js +248 -283
  104. package/core/cli/commands/lint.js +23 -23
  105. package/core/cli/commands/test.js +33 -34
  106. package/core/cli/migrator.js +71 -71
  107. package/core/cli/ui.js +56 -56
  108. package/core/compliance.js +823 -823
  109. package/core/config.js +265 -265
  110. package/core/db-advanced.js +478 -481
  111. package/core/db.js +282 -284
  112. package/core/enhanced-hmr.js +406 -406
  113. package/core/errors.js +222 -222
  114. package/core/file-router.js +47 -47
  115. package/core/hmr-client.js +203 -204
  116. package/core/hmr.js +205 -197
  117. package/core/html.d.ts +30 -30
  118. package/core/html.js +84 -84
  119. package/core/hydration.js +52 -52
  120. package/core/lipa-namba-journey.js +548 -605
  121. package/core/logging.js +14 -14
  122. package/core/middleware.js +145 -145
  123. package/core/motion.js +106 -106
  124. package/core/nida-cig-middleware.js +417 -460
  125. package/core/patterns.d.ts +124 -124
  126. package/core/patterns.js +947 -1001
  127. package/core/plugins/index.js +345 -345
  128. package/core/request-analytics.js +253 -253
  129. package/core/request-identity.js +93 -93
  130. package/core/router.js +386 -386
  131. package/core/sdk-browser.js +140 -140
  132. package/core/sdk-client.js +61 -61
  133. package/core/sdk.d.ts +133 -133
  134. package/core/sdk.js +148 -148
  135. package/core/seo.js +76 -76
  136. package/core/server/auth-endpoints.js +339 -339
  137. package/core/server/auth.js +180 -180
  138. package/core/server/csrf.js +200 -206
  139. package/core/server/db.js +39 -39
  140. package/core/server/middleware.js +324 -324
  141. package/core/server/rate-limit.js +238 -238
  142. package/core/server/render.js +67 -69
  143. package/core/server/router.js +23 -11
  144. package/core/session-store.js +68 -68
  145. package/core/shim.js +28 -28
  146. package/core/state.d.ts +86 -86
  147. package/core/state.js +276 -276
  148. package/core/store.d.ts +122 -122
  149. package/core/store.js +61 -61
  150. package/core/validation.d.ts +232 -232
  151. package/core/validation.js +602 -602
  152. package/core/websocket.js +656 -641
  153. package/dist/africode.js +233 -230
  154. package/dist/africode.js.map +83 -83
  155. package/dist/build-info.json +3 -3
  156. package/dist/components.js +195 -192
  157. package/dist/components.js.map +73 -73
  158. package/dist/styles/africanity.css +321 -321
  159. package/dist/styles/typography.css +140 -140
  160. package/docs/IDE-Guide.md +50 -50
  161. package/package.json +113 -113
  162. package/scripts/generate-component-schema.js +82 -79
  163. package/styles/africanity.css +321 -321
  164. package/styles/typography.css +140 -140
  165. package/templates/starter/.env.example +15 -15
  166. package/templates/starter/africode.config.js +40 -40
  167. package/templates/starter/package.json +13 -13
  168. package/templates/starter/src/index.js +18 -18
  169. package/templates/starter/src/pages/index.html +55 -55
  170. package/templates/starter/src/pages/index.js +17 -17
  171. package/templates/starter/src/styles/main.css +3 -3
  172. package/templates/starter-3d/.env.example +7 -7
  173. package/templates/starter-3d/africode.config.js +29 -29
  174. package/templates/starter-3d/components/af-model-viewer.js +125 -125
  175. package/templates/starter-3d/package.json +14 -14
  176. package/templates/starter-3d/src/pages/index.html +55 -55
  177. package/templates/starter-3d/src/pages/index.js +50 -50
  178. package/templates/starter-3d/src/styles/main.css +3 -3
  179. package/templates/starter-dashboard/.env.example +21 -21
  180. package/templates/starter-dashboard/africode.config.js +20 -20
  181. package/templates/starter-dashboard/package.json +14 -14
  182. package/templates/starter-dashboard/src/index.js +17 -17
  183. package/templates/starter-dashboard/src/pages/api/analytics.js +24 -24
  184. package/templates/starter-dashboard/src/pages/index.html +118 -118
  185. package/templates/starter-dashboard/src/pages/index.js +110 -110
  186. package/templates/starter-dashboard/src/styles/main.css +172 -172
  187. package/templates/starter-fintech/.env.example +28 -28
  188. package/templates/starter-fintech/africode.config.js +20 -20
  189. package/templates/starter-fintech/package.json +15 -15
  190. package/templates/starter-fintech/src/index.js +17 -17
  191. package/templates/starter-fintech/src/pages/api/auth.js +45 -45
  192. package/templates/starter-fintech/src/pages/api/transfer.js +65 -65
  193. package/templates/starter-fintech/src/pages/api/wallet.js +39 -39
  194. package/templates/starter-fintech/src/pages/api/webhooks/payment.js +32 -32
  195. package/templates/starter-fintech/src/pages/index.html +169 -169
  196. package/templates/starter-fintech/src/pages/index.js +161 -161
  197. package/templates/starter-fintech/src/styles/main.css +246 -246
  198. package/templates/starter-react/.env.example +15 -15
  199. package/templates/starter-react/africode.config.js +40 -40
  200. package/templates/starter-react/package.json +15 -15
  201. package/templates/starter-react/src/pages/index.html +55 -55
  202. package/templates/starter-react/src/pages/index.js +68 -68
  203. package/templates/starter-react/src/styles/main.css +3 -3
  204. package/templates/starter-tailwind/.env.example +15 -15
  205. package/templates/starter-tailwind/africode.config.js +40 -40
  206. package/templates/starter-tailwind/package.json +19 -19
  207. package/templates/starter-tailwind/src/pages/index.html +55 -55
  208. package/templates/starter-tailwind/src/pages/index.js +67 -67
  209. package/templates/starter-tailwind/src/styles/main.css +3 -3
  210. package/templates/starter-tailwind/src/styles/tailwind.css +1 -1
  211. package/templates/starter-tailwind/src/tailwind-loader.js +30 -30
  212. package/templates/starter-tailwind/tailwind.config.cjs +18 -18
  213. package/templates/starter-website/.env.example +18 -18
  214. package/templates/starter-website/africode.config.js +20 -20
  215. package/templates/starter-website/package.json +14 -14
  216. package/templates/starter-website/src/index.js +17 -17
  217. package/templates/starter-website/src/pages/index.html +124 -124
  218. package/templates/starter-website/src/pages/index.js +116 -116
  219. package/templates/starter-website/src/styles/main.css +195 -195
  220. package/bin/africode.js.1758507140 +0 -343
  221. package/core/heartbeat.js +0 -64
package/dist/africode.js CHANGED
@@ -1,4 +1,4 @@
1
- var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null,n)}var $=(t,n)=>{for(var r in n)le(t,r,{get:n[r],enumerable:!0,configurable:!0,set:be.bind(n,r)})};var m=(t,n)=>()=>(t&&(n=t(t=0)),n);function ht(t){if(sn.has(t))return sn.get(t);let r=new Proxy(t,{get(o,a,l){let e=Reflect.get(o,a,l);if(e!==null&&typeof e==="object")return ht(e);return e},set(o,a,l,e){let b=Reflect.get(o,a,e);if(b!==l){let f=Reflect.set(o,a,l,e);if(f)io(e,l,b,a);return f}return!0},deleteProperty(o,a){let l=Reflect.get(o,a),e=Reflect.deleteProperty(o,a);if(e){let b=sn.get(o);io(b,void 0,l,a)}return e}});return sn.set(t,r),r}function T(t,n){if(!mn.has(t))mn.set(t,new Set);let r=mn.get(t);return r.add(n),()=>{r.delete(n)}}function io(t,n,r,o){let a=mn.get(t);if(!a)return;a.forEach((l)=>{try{l(n,r,o)}catch(e){console.error("[AfriCode State] Subscriber error:",e)}})}class Gr{constructor(){this.store={}}get(t){return t.split("/").reduce((n,r)=>n?.[r],this.store)}set(t,n){let r=t.split("/"),o=this.store;while(r.length>1){let a=r.shift();if(!o[a]||typeof o[a]!=="object")o[a]={};o=o[a]}o[r[0]]=n}getAll(){return this.store}}function fo(t){let n=t,r=new Set,o=()=>{return n},a=(l)=>{if(n!==l)n=typeof l==="function"?l(n):l,r.forEach((e)=>e()),io()};return o.subscribe=(l)=>{return r.add(l),()=>r.delete(l)},[o,a]}function ho(t){return t(),T(t)}var mn,sn,Ki;var rt=m(()=>{mn=new WeakMap,sn=new WeakMap;Ki=new Gr});var ie,J,Qr;var Ht=m(()=>{rt();ie={theme:"light",language:"en",ui:{sidebarCollapsed:!1,theme:"dark",activePage:"home"},user:{name:"Guest",permissions:[]},config:{animationsEnabled:!0,soundEnabled:!1}},J=ht(ie),Qr={setTheme(t){if(["dark","light","system"].includes(t))J.theme=t,J.ui.theme=t},setLanguage(t){J.language=t},toggleSidebar(t){if(typeof t==="boolean")J.ui.sidebarCollapsed=t;else J.ui.sidebarCollapsed=!J.ui.sidebarCollapsed},setActivePage(t){J.ui.activePage=t}}});function fe(t,n,r=50,o=50){let a=[];for(let l=0;l<t;l++){let e=2*Math.PI*l/t-Math.PI/2,b=r+n*Math.cos(e),f=o+n*Math.sin(e);a.push(`${b.toFixed(2)},${f.toFixed(2)}`)}return a.join(" ")}function co({primaryColor:t="#FF0000",secondaryColor:n="#000000",backgroundColor:r="#8B0000",stripeWidth:o=4,size:a=40}={}){let l=`
1
+ var lb=Object.defineProperty;var bb=(t)=>t;function eb(t,n){this[t]=bb.bind(null,n)}var w=(t,n)=>{for(var r in n)lb(t,r,{get:n[r],enumerable:!0,configurable:!0,set:eb.bind(n,r)})};var v=(t,n)=>()=>(t&&(n=t(t=0)),n);function ft(t){if(gn.has(t))return gn.get(t);let r=new Proxy(t,{get(o,a,l){let b=Reflect.get(o,a,l);if(b!==null&&typeof b==="object")return ft(b);return b},set(o,a,l,b){let e=Reflect.get(o,a,b);if(e!==l){let h=Reflect.set(o,a,l,b);if(h)fo(b,l,e,a);return h}return!0},deleteProperty(o,a){let l=Reflect.get(o,a),b=Reflect.deleteProperty(o,a);if(b){let e=gn.get(o);fo(e,void 0,l,a)}return b}});return gn.set(t,r),r}function ht(t,n){if(!mn.has(t))mn.set(t,new Set);let r=mn.get(t);return r.add(n),()=>{r.delete(n)}}function fo(t,n,r,o){let a=mn.get(t);if(!a)return;a.forEach((l)=>{try{l(n,r,o)}catch(b){console.error("[AfriCode State] Subscriber error:",b)}})}class Gr{constructor(){this.store={}}get(t){return t.split("/").reduce((n,r)=>n?.[r],this.store)}set(t,n){let r=t.split("/"),o=this.store;while(r.length>1){let a=r.shift();if(!o[a]||typeof o[a]!=="object")o[a]={};o=o[a]}o[r[0]]=n}getAll(){return this.store}}function ho(t){let n=t,r=new Set,o=()=>{return n},a=(l)=>{if(n!==l)n=typeof l==="function"?l(n):l,r.forEach((b)=>b()),fo()};return o.subscribe=(l)=>{return r.add(l),()=>r.delete(l)},[o,a]}function io(t){return t(),ht(t)}var mn,gn,y0;var Ht=v(()=>{mn=new WeakMap,gn=new WeakMap;y0=new Gr});var fb,G,vn;var co=v(()=>{Ht();fb={theme:"light",language:"en",ui:{sidebarCollapsed:!1,theme:"dark",activePage:"home"},user:{name:"Guest",permissions:[]},config:{animationsEnabled:!0,soundEnabled:!1}},G=ft(fb),vn={setTheme(t){if(["dark","light","system"].includes(t))G.theme=t,G.ui.theme=t},setLanguage(t){G.language=t},toggleSidebar(t){if(typeof t==="boolean")G.ui.sidebarCollapsed=t;else G.ui.sidebarCollapsed=!G.ui.sidebarCollapsed},setActivePage(t){G.ui.activePage=t}}});function hb(t,n,r=50,o=50){let a=[];for(let l=0;l<t;l++){let b=2*Math.PI*l/t-Math.PI/2,e=r+n*Math.cos(b),h=o+n*Math.sin(b);a.push(`${e.toFixed(2)},${h.toFixed(2)}`)}return a.join(" ")}function go({primaryColor:t="#FF0000",secondaryColor:n="#000000",backgroundColor:r="#8B0000",stripeWidth:o=4,size:a=40}={}){let l=`
2
2
  <svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${a}" viewBox="0 0 ${a} ${a}">
3
3
  <rect width="${a}" height="${a}" fill="${r}"/>
4
4
  <rect x="0" y="0" width="${a}" height="${o}" fill="${t}" opacity="0.8"/>
@@ -8,7 +8,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
8
8
  <rect x="${a/2-o/2}" y="0" width="${o}" height="${a}" fill="${n}" opacity="0.4"/>
9
9
  <rect x="${a-o}" y="0" width="${o}" height="${a}" fill="${t}" opacity="0.5"/>
10
10
  </svg>
11
- `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function go({earthColor:t="#8B4513",ochreColor:n="#CD853F",charcoalColor:r="#2F2F2F",size:o=50}={}){let a=`
11
+ `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function mo({earthColor:t="#8B4513",ochreColor:n="#CD853F",charcoalColor:r="#2F2F2F",size:o=50}={}){let a=`
12
12
  <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
13
13
  <rect width="${o}" height="${o}" fill="${t}"/>
14
14
  <!-- Cave art inspired figures -->
@@ -23,7 +23,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
23
23
  <circle cx="${o*0.15}" cy="${o*0.8}" r="3" fill="${n}"/>
24
24
  <circle cx="${o*0.85}" cy="${o*0.2}" r="3" fill="${n}"/>
25
25
  </svg>
26
- `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function so({primaryColor:t="#1EB53A",accentColor:n="#FCD116",size:r=30}={}){let o=`
26
+ `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function vo({primaryColor:t="#1EB53A",accentColor:n="#FCD116",size:r=30}={}){let o=`
27
27
  <svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${r}" viewBox="0 0 ${r} ${r}">
28
28
  <rect width="${r}" height="${r}" fill="${t}"/>
29
29
  <!-- Pindo (Border) Motifs: Cashew/Triangle -->
@@ -31,7 +31,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
31
31
  <path d="M${r},0 L${r/2},${r/2} L${r},${r} Z" fill="${n}"/>
32
32
  <circle cx="${r/2}" cy="${r/2}" r="${r*0.15}" fill="none" stroke="${n}" stroke-width="2"/>
33
33
  </svg>
34
- `;return`data:image/svg+xml,${encodeURIComponent(o.trim())}`}function he({primaryColor:t="#FF6B00",secondaryColor:n="#002B5C",backgroundColor:r="#FFFFFF",size:o=40}={}){let a=`
34
+ `;return`data:image/svg+xml,${encodeURIComponent(o.trim())}`}function ib({primaryColor:t="#FF6B00",secondaryColor:n="#002B5C",backgroundColor:r="#FFFFFF",size:o=40}={}){let a=`
35
35
  <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
36
36
  <rect width="${o}" height="${o}" fill="${r}"/>
37
37
  <!-- Border pattern -->
@@ -43,7 +43,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
43
43
  <circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.15}" fill="${n}"/>
44
44
  <text x="${o*0.5}" y="${o*0.55}" text-anchor="middle" fill="${t}" font-size="${o*0.08}">KANGA</text>
45
45
  </svg>
46
- `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function de({primaryColor:t="#8B4513",secondaryColor:n="#DAA520",backgroundColor:r="#F5F5DC",size:o=30}={}){let a=`
46
+ `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function cb({primaryColor:t="#8B4513",secondaryColor:n="#DAA520",backgroundColor:r="#F5F5DC",size:o=30}={}){let a=`
47
47
  <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
48
48
  <rect width="${o}" height="${o}" fill="${r}"/>
49
49
  <!-- Kuba geometric border -->
@@ -54,7 +54,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
54
54
  <!-- Center diamond -->
55
55
  <polygon points="${o*0.5},${o*0.3} ${o*0.7},${o*0.5} ${o*0.5},${o*0.7} ${o*0.3},${o*0.5}" fill="${n}"/>
56
56
  </svg>
57
- `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function ce({primaryColor:t="#FF0000",secondaryColor:n="#000000",accentColor:r="#FFFFFF",size:o=40}={}){let a=`
57
+ `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function db({primaryColor:t="#FF0000",secondaryColor:n="#000000",accentColor:r="#FFFFFF",size:o=40}={}){let a=`
58
58
  <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
59
59
  <rect width="${o}" height="${o}" fill="${r}"/>
60
60
  <!-- Bead pattern -->
@@ -68,7 +68,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
68
68
  <circle cx="${o*0.5}" cy="${o*0.8}" r="${o*0.08}" fill="${n}"/>
69
69
  <circle cx="${o*0.8}" cy="${o*0.8}" r="${o*0.08}" fill="${t}"/>
70
70
  </svg>
71
- `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function ge({primaryColor:t="#8B0000",secondaryColor:n="#FFD700",backgroundColor:r="#654321",size:o=50}={}){let a=`
71
+ `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function gb({primaryColor:t="#8B0000",secondaryColor:n="#FFD700",backgroundColor:r="#654321",size:o=50}={}){let a=`
72
72
  <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
73
73
  <ellipse cx="${o*0.5}" cy="${o*0.5}" rx="${o*0.4}" ry="${o*0.45}" fill="${r}"/>
74
74
  <!-- Shield patterns -->
@@ -78,7 +78,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
78
78
  <line x1="${o*0.3}" y1="${o*0.2}" x2="${o*0.7}" y2="${o*0.2}" stroke="${t}" stroke-width="3"/>
79
79
  <line x1="${o*0.3}" y1="${o*0.8}" x2="${o*0.7}" y2="${o*0.8}" stroke="${t}" stroke-width="3"/>
80
80
  </svg>
81
- `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function se({primaryColor:t="#FF1493",secondaryColor:n="#00FF00",accentColor:r="#FFFF00",backgroundColor:o="#FFFFFF",size:a=50}={}){let l=`
81
+ `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function mb({primaryColor:t="#FF1493",secondaryColor:n="#00FF00",accentColor:r="#FFFF00",backgroundColor:o="#FFFFFF",size:a=50}={}){let l=`
82
82
  <svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${a}" viewBox="0 0 ${a} ${a}">
83
83
  <rect width="${a}" height="${a}" fill="${o}"/>
84
84
  <!-- Ndebele geometric patterns -->
@@ -90,7 +90,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
90
90
  <circle cx="${a*0.5}" cy="${a*0.5}" r="${a*0.15}" fill="${n}"/>
91
91
  <rect x="${a*0.45}" y="${a*0.45}" width="${a*0.1}" height="${a*0.1}" fill="${r}"/>
92
92
  </svg>
93
- `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function mo({primaryColor:t="#00A3DD",secondaryColor:n="#FCD116",backgroundColor:r="#1EB53A",size:o=50}={}){let a=`
93
+ `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function $o({primaryColor:t="#00A3DD",secondaryColor:n="#FCD116",backgroundColor:r="#1EB53A",size:o=50}={}){let a=`
94
94
  <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
95
95
  <rect width="${o}" height="${o}" fill="${r}"/>
96
96
  <circle cx="${o*0.25}" cy="${o*0.25}" r="${o*0.2}" fill="${t}" opacity="0.8"/>
@@ -100,16 +100,16 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
100
100
  <circle cx="${o*0.75}" cy="${o*0.25}" r="${o*0.08}" fill="${n}" opacity="0.6"/>
101
101
  <circle cx="${o*0.25}" cy="${o*0.75}" r="${o*0.08}" fill="${n}" opacity="0.6"/>
102
102
  </svg>
103
- `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function vo({colors:t=["#FFD700","#228B22","#DC143C","#000000"],size:n=60}={}){let[r,o,a,l]=t,e=n/6,b=`
103
+ `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function po({colors:t=["#FFD700","#228B22","#DC143C","#000000"],size:n=60}={}){let[r,o,a,l]=t,b=n/6,e=`
104
104
  <svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
105
105
  <rect width="${n}" height="${n}" fill="${l}"/>
106
106
  <!-- Horizontal bands -->
107
- <rect x="0" y="0" width="${n}" height="${e}" fill="${r}"/>
108
- <rect x="0" y="${e}" width="${n}" height="${e}" fill="${o}"/>
109
- <rect x="0" y="${e*2}" width="${n}" height="${e}" fill="${a}"/>
110
- <rect x="0" y="${e*3}" width="${n}" height="${e}" fill="${r}"/>
111
- <rect x="0" y="${e*4}" width="${n}" height="${e}" fill="${o}"/>
112
- <rect x="0" y="${e*5}" width="${n}" height="${e}" fill="${a}"/>
107
+ <rect x="0" y="0" width="${n}" height="${b}" fill="${r}"/>
108
+ <rect x="0" y="${b}" width="${n}" height="${b}" fill="${o}"/>
109
+ <rect x="0" y="${b*2}" width="${n}" height="${b}" fill="${a}"/>
110
+ <rect x="0" y="${b*3}" width="${n}" height="${b}" fill="${r}"/>
111
+ <rect x="0" y="${b*4}" width="${n}" height="${b}" fill="${o}"/>
112
+ <rect x="0" y="${b*5}" width="${n}" height="${b}" fill="${a}"/>
113
113
  <!-- Vertical accents -->
114
114
  <rect x="${n*0.2}" y="0" width="3" height="${n}" fill="${l}" opacity="0.5"/>
115
115
  <rect x="${n*0.4}" y="0" width="3" height="${n}" fill="${l}" opacity="0.5"/>
@@ -119,7 +119,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
119
119
  <rect x="${n*0.1}" y="${n*0.1}" width="${n*0.15}" height="${n*0.15}" fill="${r}" stroke="${l}" stroke-width="1"/>
120
120
  <rect x="${n*0.75}" y="${n*0.75}" width="${n*0.15}" height="${n*0.15}" fill="${a}" stroke="${l}" stroke-width="1"/>
121
121
  </svg>
122
- `;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function po({symbolColor:t="#000000",backgroundColor:n="#CD853F",size:r=50}={}){let o=`
122
+ `;return`data:image/svg+xml,${encodeURIComponent(e.trim())}`}function uo({symbolColor:t="#000000",backgroundColor:n="#CD853F",size:r=50}={}){let o=`
123
123
  <svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${r}" viewBox="0 0 ${r} ${r}">
124
124
  <rect width="${r}" height="${r}" fill="${n}"/>
125
125
  <!-- Sankofa-inspired heart shape (go back and get it) -->
@@ -133,7 +133,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
133
133
  <circle cx="${r*0.35}" cy="${r*0.45}" r="${r*0.08}" fill="none" stroke="${t}" stroke-width="2"/>
134
134
  <circle cx="${r*0.65}" cy="${r*0.45}" r="${r*0.08}" fill="none" stroke="${t}" stroke-width="2"/>
135
135
  </svg>
136
- `;return`data:image/svg+xml,${encodeURIComponent(o.trim())}`}function uo({colors:t=["#4B0082","#FFD700","#FFFFFF"],size:n=50}={}){let[r,o,a]=t,l=n/10,e=`
136
+ `;return`data:image/svg+xml,${encodeURIComponent(o.trim())}`}function wo({colors:t=["#4B0082","#FFD700","#FFFFFF"],size:n=50}={}){let[r,o,a]=t,l=n/10,b=`
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="${r}"/>
139
139
  <!-- Horizontal stripes -->
@@ -150,7 +150,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
150
150
  <polygon points="${n*0.75},${n*0.3} ${n*0.85},${n*0.5} ${n*0.75},${n*0.7} ${n*0.65},${n*0.5}"
151
151
  fill="${o}" stroke="${a}" stroke-width="1"/>
152
152
  </svg>
153
- `;return`data:image/svg+xml,${encodeURIComponent(e.trim())}`}function $o({primaryColor:t="#FF6B00",secondaryColor:n="#00A86B",accentColor:r="#FFD700",backgroundColor:o="#FFFFFF",size:a=60}={}){let l=`
153
+ `;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function so({primaryColor:t="#FF6B00",secondaryColor:n="#00A86B",accentColor:r="#FFD700",backgroundColor:o="#FFFFFF",size:a=60}={}){let l=`
154
154
  <svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${a}" viewBox="0 0 ${a} ${a}">
155
155
  <rect width="${a}" height="${a}" fill="${o}"/>
156
156
  <!-- Bold circular motifs -->
@@ -169,7 +169,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
169
169
  <circle cx="${a*0.1}" cy="${a*0.8}" r="${a*0.05}" fill="${r}"/>
170
170
  <circle cx="${a*0.9}" cy="${a*0.2}" r="${a*0.05}" fill="${r}"/>
171
171
  </svg>
172
- `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function wo({primaryColor:t="#000000",secondaryColor:n="#FFFFFF",accentColor:r="#8B4513",size:o=60}={}){let a=`
172
+ `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function xo({primaryColor:t="#000000",secondaryColor:n="#FFFFFF",accentColor:r="#8B4513",size:o=60}={}){let a=`
173
173
  <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
174
174
  <rect width="${o}" height="${o}" fill="${t}"/>
175
175
  <!-- Zigzags -->
@@ -185,7 +185,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
185
185
  <!-- Dots -->
186
186
  <circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.08}" fill="${r}"/>
187
187
  </svg>
188
- `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function xo({primaryColor:t="#D2B48C",secondaryColor:n="#3E2723",size:r=60}={}){let o=`
188
+ `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function _o({primaryColor:t="#D2B48C",secondaryColor:n="#3E2723",size:r=60}={}){let o=`
189
189
  <svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${r}" viewBox="0 0 ${r} ${r}">
190
190
  <rect width="${r}" height="${r}" fill="${t}"/>
191
191
  <!-- Interlocking diamonds/rectangles -->
@@ -215,7 +215,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
215
215
  fill="${n}"/>
216
216
  <circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.1}" fill="${r}"/>
217
217
  </svg>
218
- `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function _o({colors:t=["#009E60","#FCDD09","#EF3340"],backgroundColor:n="#FFFFFF",size:r=40}={}){let[o,a,l]=t,e=`
218
+ `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function ko({colors:t=["#009E60","#FCDD09","#EF3340"],backgroundColor:n="#FFFFFF",size:r=40}={}){let[o,a,l]=t,b=`
219
219
  <svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${r}" viewBox="0 0 ${r} ${r}">
220
220
  <rect width="${r}" height="${r}" fill="${n}"/>
221
221
  <!-- Diamond Chain -->
@@ -228,7 +228,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
228
228
  <line x1="0" y1="0" x2="0" y2="${r}" stroke="${o}" stroke-width="4"/>
229
229
  <line x1="${r}" y1="0" x2="${r}" y2="${r}" stroke="${o}" stroke-width="4"/>
230
230
  </svg>
231
- `;return`data:image/svg+xml,${encodeURIComponent(e.trim())}`}function ko({colors:t=["#FFD700","#4169E1","#FF69B4","#228B22"],size:n=60,strokeWidth:r=2}={}){let[o,a,l,e]=t,b=`
231
+ `;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function qo({colors:t=["#FFD700","#4169E1","#FF69B4","#228B22"],size:n=60,strokeWidth:r=2}={}){let[o,a,l,b]=t,e=`
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="${r}" y="${r}"
@@ -241,11 +241,11 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
241
241
  <rect x="${n*0.15}" y="${n*0.5}" width="${n*0.35}" height="${n*0.35}"
242
242
  fill="${l}" stroke="#000000" stroke-width="${r/2}"/>
243
243
  <rect x="${n*0.5}" y="${n*0.5}" width="${n*0.35}" height="${n*0.35}"
244
- fill="${e}" stroke="#000000" stroke-width="${r/2}"/>
244
+ fill="${b}" stroke="#000000" stroke-width="${r/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="${r}"/>
247
247
  </svg>
248
- `;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function qo({colors:t=["#FFFFFF","#000000","#FF0000","#00A86B","#FFD700"],size:n=50}={}){let[r,o,a,l,e]=t,b=n/10,f=`
248
+ `;return`data:image/svg+xml,${encodeURIComponent(e.trim())}`}function Lo({colors:t=["#FFFFFF","#000000","#FF0000","#00A86B","#FFD700"],size:n=50}={}){let[r,o,a,l,b]=t,e=n/10,h=`
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="${o}"/>
251
251
  <!-- Triangle pattern (isivivane - sacred cairn) -->
@@ -254,15 +254,15 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.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="${a}"/>
256
256
  <!-- Beadwork dots -->
257
- <circle cx="${n*0.5}" cy="${n*0.35}" r="${b}" fill="${r}"/>
258
- <circle cx="${n*0.35}" cy="${n*0.6}" r="${b}" fill="${l}"/>
259
- <circle cx="${n*0.65}" cy="${n*0.6}" r="${b}" fill="${e}"/>
260
- <circle cx="${n*0.5}" cy="${n*0.8}" r="${b}" fill="${r}"/>
257
+ <circle cx="${n*0.5}" cy="${n*0.35}" r="${e}" fill="${r}"/>
258
+ <circle cx="${n*0.35}" cy="${n*0.6}" r="${e}" fill="${l}"/>
259
+ <circle cx="${n*0.65}" cy="${n*0.6}" r="${e}" fill="${b}"/>
260
+ <circle cx="${n*0.5}" cy="${n*0.8}" r="${e}" fill="${r}"/>
261
261
  <!-- Border dots -->
262
- <circle cx="${n*0.1}" cy="${n*0.1}" r="${b*0.7}" fill="${a}"/>
263
- <circle cx="${n*0.9}" cy="${n*0.1}" r="${b*0.7}" fill="${l}"/>
262
+ <circle cx="${n*0.1}" cy="${n*0.1}" r="${e*0.7}" fill="${a}"/>
263
+ <circle cx="${n*0.9}" cy="${n*0.1}" r="${e*0.7}" fill="${l}"/>
264
264
  </svg>
265
- `;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function Lo({colors:t=["#3E5EB9","#FECD00","#B10C0C","#FFFFFF"],size:n=50}={}){let[r,o,a,l]=t,e=`
265
+ `;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function Ho({colors:t=["#3E5EB9","#FECD00","#B10C0C","#FFFFFF"],size:n=50}={}){let[r,o,a,l]=t,b=`
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="${r}"/>
268
268
  <!-- Shield shape (central to Eswatini culture) -->
@@ -282,7 +282,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
282
282
  <polygon points="${n*0.1},${n*0.3} ${n*0.05},${n*0.5} ${n*0.15},${n*0.5}" fill="${l}"/>
283
283
  <polygon points="${n*0.9},${n*0.3} ${n*0.85},${n*0.5} ${n*0.95},${n*0.5}" fill="${l}"/>
284
284
  </svg>
285
- `;return`data:image/svg+xml,${encodeURIComponent(e.trim())}`}function Ho({primaryColor:t="#FFFFFF",accentColor:n="#00A86B",backgroundColor:r="#1a1a2e",size:o=50}={}){let a=`
285
+ `;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function Mo({primaryColor:t="#FFFFFF",accentColor:n="#00A86B",backgroundColor:r="#1a1a2e",size:o=50}={}){let a=`
286
286
  <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
287
287
  <rect width="${o}" height="${o}" fill="${r}"/>
288
288
  <!-- Horizontal bands -->
@@ -300,7 +300,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
300
300
  <polygon points="0,${o} ${o*0.15},${o} 0,${o*0.85}" fill="${n}"/>
301
301
  <polygon points="${o},${o} ${o*0.85},${o} ${o},${o*0.85}" fill="${n}"/>
302
302
  </svg>
303
- `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function me(t,n){t.style.backgroundImage=`url("${n}")`,t.style.backgroundRepeat="repeat"}function Mo({primaryColor:t="#8B0000",secondaryColor:n="#000000",accentColor:r="#FFD700",backgroundColor:o="#F5F5DC",size:a=60}={}){let l=`
303
+ `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function vb(t,n){t.style.backgroundImage=`url("${n}")`,t.style.backgroundRepeat="repeat"}function Ro({primaryColor:t="#8B0000",secondaryColor:n="#000000",accentColor:r="#FFD700",backgroundColor:o="#F5F5DC",size:a=60}={}){let l=`
304
304
  <svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${a}" viewBox="0 0 ${a} ${a}">
305
305
  <rect width="${a}" height="${a}" fill="${o}"/>
306
306
  <!-- Lozenge (Diamond) - universal protective symbol -->
@@ -313,7 +313,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
313
313
  <line x1="${a*0.4}" y1="${a*0.4}" x2="${a*0.6}" y2="${a*0.6}" stroke="${n}" stroke-width="2"/>
314
314
  <line x1="${a*0.6}" y1="${a*0.4}" x2="${a*0.4}" y2="${a*0.6}" stroke="${n}" stroke-width="2"/>
315
315
  </svg>
316
- `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Ro({primaryColor:t="#4B0082",secondaryColor:n="#8A2BE2",accentColor:r="#FFFFFF",size:o=50}={}){let a=`
316
+ `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Xo({primaryColor:t="#4B0082",secondaryColor:n="#8A2BE2",accentColor:r="#FFFFFF",size:o=50}={}){let a=`
317
317
  <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
318
318
  <rect width="${o}" height="${o}" fill="${t}"/>
319
319
  <!-- Resist circles (Oniko) -->
@@ -324,7 +324,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
324
324
  <path d="M0,0 Q${o*0.2},0 ${o*0.2},${o*0.2} Q0,${o*0.2} 0,0" fill="${n}"/>
325
325
  <path d="M${o},${o} Q${o*0.8},${o} ${o*0.8},${o*0.8} Q${o},${o*0.8} ${o},${o}" fill="${n}"/>
326
326
  </svg>
327
- `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function ve({primaryColor:t="#2D3D6B",secondaryColor:n="#6B8CC7",accentColor:r="#FFFFFF",size:o=60}={}){let a=`
327
+ `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function $b({primaryColor:t="#2D3D6B",secondaryColor:n="#6B8CC7",accentColor:r="#FFFFFF",size:o=60}={}){let a=`
328
328
  <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
329
329
  <rect width="${o}" height="${o}" fill="${t}"/>
330
330
  <!-- Southern Cross / Tuareg Star -->
@@ -332,7 +332,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
332
332
  fill="none" stroke="${r}" stroke-width="2"/>
333
333
  <circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.1}" fill="${n}"/>
334
334
  </svg>
335
- `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function pe({inkColor:t="#3A2E2C",parchmentColor:n="#F4E4BC",size:r=50}={}){let o=`
335
+ `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function pb({inkColor:t="#3A2E2C",parchmentColor:n="#F4E4BC",size:r=50}={}){let o=`
336
336
  <svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${r}" viewBox="0 0 ${r} ${r}">
337
337
  <rect width="${r}" height="${r}" fill="${n}"/>
338
338
  <path d="M${r*0.2} ${r*0.2} L${r*0.4} ${r*0.2} M${r*0.3} ${r*0.2} L${r*0.3} ${r*0.5} Q${r*0.4} ${r*0.6} ${r*0.2} ${r*0.7}"
@@ -340,7 +340,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
340
340
  <path d="M${r*0.6} ${r*0.3} C${r*0.8} ${r*0.3} ${r*0.8} ${r*0.6} ${r*0.6} ${r*0.6} L${r*0.8} ${r*0.8}"
341
341
  fill="none" stroke="${t}" stroke-width="3" stroke-linecap="round"/>
342
342
  </svg>
343
- `;return`data:image/svg+xml,${encodeURIComponent(o.trim())}`}function ue({clayColor:t="#4E342E",earthColor:n="#3E2723",accentColor:r="#BCAAA4",size:o=60}={}){let a=`
343
+ `;return`data:image/svg+xml,${encodeURIComponent(o.trim())}`}function ub({clayColor:t="#4E342E",earthColor:n="#3E2723",accentColor:r="#BCAAA4",size:o=60}={}){let a=`
344
344
  <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
345
345
  <rect width="${o}" height="${o}" fill="${n}"/>
346
346
  <path d="M${o*0.2} ${o*0.5} Q${o*0.3} ${o*0.2} ${o*0.5} ${o*0.3} T${o*0.8} ${o*0.5} Q${o*0.7} ${o*0.8} ${o*0.5} ${o*0.7} T${o*0.2} ${o*0.5}"
@@ -355,7 +355,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.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(o.trim())}`}function $e({primaryColor:t="#000000",secondaryColor:n="#FCD116",backgroundColor:r="#FFFFFF",size:o=50}={}){let a=`
358
+ `;return`data:image/svg+xml,${encodeURIComponent(o.trim())}`}function wb({primaryColor:t="#000000",secondaryColor:n="#FCD116",backgroundColor:r="#FFFFFF",size:o=50}={}){let a=`
359
359
 
360
360
  <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
361
361
 
@@ -381,7 +381,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
381
381
 
382
382
  </svg>
383
383
 
384
- `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function we({colors:t=["#000000","#FCD116","#E82127","#006B3F"],size:n=60}={}){let[r,o,a,l]=t,e=n/6,b=`
384
+ `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function sb({colors:t=["#000000","#FCD116","#E82127","#006B3F"],size:n=60}={}){let[r,o,a,l]=t,b=n/6,e=`
385
385
 
386
386
  <svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
387
387
 
@@ -389,46 +389,46 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
389
389
 
390
390
  <!-- Horizontal black stripes -->
391
391
 
392
- <rect x="0" y="0" width="${n}" height="${e}" fill="${r}"/>
392
+ <rect x="0" y="0" width="${n}" height="${b}" fill="${r}"/>
393
393
 
394
- <rect x="0" y="${e*2}" width="${n}" height="${e}" fill="${r}"/>
394
+ <rect x="0" y="${b*2}" width="${n}" height="${b}" fill="${r}"/>
395
395
 
396
- <rect x="0" y="${e*4}" width="${n}" height="${e}" fill="${r}"/>
396
+ <rect x="0" y="${b*4}" width="${n}" height="${b}" fill="${r}"/>
397
397
 
398
398
  <!-- Vertical red stripes -->
399
399
 
400
- <rect x="0" y="0" width="${e}" height="${n}" fill="${a}" opacity="0.6"/>
400
+ <rect x="0" y="0" width="${b}" height="${n}" fill="${a}" opacity="0.6"/>
401
401
 
402
- <rect x="${e*2}" y="0" width="${e}" height="${n}" fill="${a}" opacity="0.6"/>
402
+ <rect x="${b*2}" y="0" width="${b}" height="${n}" fill="${a}" opacity="0.6"/>
403
403
 
404
- <rect x="${e*4}" y="0" width="${e}" height="${n}" fill="${a}" opacity="0.6"/>
404
+ <rect x="${b*4}" y="0" width="${b}" height="${n}" fill="${a}" opacity="0.6"/>
405
405
 
406
406
  <!-- Green corner squares -->
407
407
 
408
- <rect x="0" y="0" width="${e*0.8}" height="${e*0.8}" fill="${l}"/>
408
+ <rect x="0" y="0" width="${b*0.8}" height="${b*0.8}" fill="${l}"/>
409
409
 
410
- <rect x="${n-e*0.8}" y="0" width="${e*0.8}" height="${e*0.8}" fill="${l}"/>
410
+ <rect x="${n-b*0.8}" y="0" width="${b*0.8}" height="${b*0.8}" fill="${l}"/>
411
411
 
412
- <rect x="0" y="${n-e*0.8}" width="${e*0.8}" height="${e*0.8}" fill="${l}"/>
412
+ <rect x="0" y="${n-b*0.8}" width="${b*0.8}" height="${b*0.8}" fill="${l}"/>
413
413
 
414
- <rect x="${n-e*0.8}" y="${n-e*0.8}" width="${e*0.8}" height="${e*0.8}" fill="${l}"/>
414
+ <rect x="${n-b*0.8}" y="${n-b*0.8}" width="${b*0.8}" height="${b*0.8}" fill="${l}"/>
415
415
 
416
416
  </svg>
417
417
 
418
- `;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}var Mt;var Rt=m(()=>{Mt={generatePolygon:fe,generateShuka:co,generateHadzabe:go,generateKanga:he,generateKangaBorder:so,generateKitenge:mo,generateMasaiShield:ge,generateTibeb:_o,generateImigongo:Ao,generateKente:vo,generateAdinkra:po,generateAsoOke:uo,generateAnkara:$o,generateBogolan:wo,generateAdire:Ro,generateKuba:xo,generateKubaBorder:de,generateBerber:Mo,generateNdebele:ko,generateNdebelePaint:se,generateZulu:qo,generateZuluBeads:ce,generateSwazi:Lo,generateXhosa:Ho,generateYorubaAdire:$e,generateAkanKente:we,applyPattern:me,generateTuareg:ve,generateGeez:pe,generateBoli:ue,generateCircuit:Fr,circuit:Fr}});class Yo{constructor(t){this.value=t,this.__type="RawHtml",Object.freeze(this)}toString(){return this.value}valueOf(){return this.value}}function _e(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Wr({title:t="AfriCode App",meta:n="",stylesheet:r="/styles/africanity.css",children:o}={}){return c`<!DOCTYPE html>
418
+ `;return`data:image/svg+xml,${encodeURIComponent(e.trim())}`}var it;var Mt=v(()=>{it={generatePolygon:hb,generateShuka:go,generateHadzabe:mo,generateKanga:ib,generateKangaBorder:vo,generateKitenge:$o,generateMasaiShield:gb,generateTibeb:ko,generateImigongo:Ao,generateKente:po,generateAdinkra:uo,generateAsoOke:wo,generateAnkara:so,generateBogolan:xo,generateAdire:Xo,generateKuba:_o,generateKubaBorder:cb,generateBerber:Ro,generateNdebele:qo,generateNdebelePaint:mb,generateZulu:Lo,generateZuluBeads:db,generateSwazi:Ho,generateXhosa:Mo,generateYorubaAdire:wb,generateAkanKente:sb,applyPattern:vb,generateTuareg:$b,generateGeez:pb,generateBoli:ub,generateCircuit:Fr,circuit:Fr}});class Jo{constructor(t){this.value=t,this.__type="RawHtml",Object.freeze(this)}toString(){return this.value}valueOf(){return this.value}}function Ab(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Wr({title:t="AfriCode App",meta:n="",stylesheet:r="/styles/africanity.css",children:o}={}){return d`<!DOCTYPE html>
419
419
  <html lang="en">
420
420
  <head>
421
421
  <meta charset="UTF-8">
422
422
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
423
423
  <title>${t}</title>
424
424
  ${n}
425
- ${r?c`<link rel="stylesheet" href="${r}">`:""}
425
+ ${r?d`<link rel="stylesheet" href="${r}">`:""}
426
426
  <script type="module" src="/core/sdk.js"></script>
427
427
  </head>
428
428
  <body>
429
429
  ${o}
430
430
  </body>
431
- </html>`}function Or(t){if(t instanceof Yo)return t.toString();if(Array.isArray(t))return t.map(Or).join("");if(t===null||t===void 0||t===!1)return"";if(t===!0)return"true";return _e(t)}var c=(t,...n)=>{let r="";for(let o=0;o<t.length;o++)if(r+=t[o],o<n.length)r+=Or(n[o]);return new Yo(r)};var L,Jo,s,N=(t)=>{switch(typeof t){case"undefined":return s.undefined;case"string":return s.string;case"number":return Number.isNaN(t)?s.nan:s.number;case"boolean":return s.boolean;case"function":return s.function;case"bigint":return s.bigint;case"symbol":return s.symbol;case"object":if(Array.isArray(t))return s.array;if(t===null)return s.null;if(t.then&&typeof t.then==="function"&&t.catch&&typeof t.catch==="function")return s.promise;if(typeof Map<"u"&&t instanceof Map)return s.map;if(typeof Set<"u"&&t instanceof Set)return s.set;if(typeof Date<"u"&&t instanceof Date)return s.date;return s.object;default:return s.unknown}};var St=m(()=>{(function(t){t.assertEqual=(a)=>{};function n(a){}t.assertIs=n;function r(a){throw Error()}t.assertNever=r,t.arrayToEnum=(a)=>{let l={};for(let e of a)l[e]=e;return l},t.getValidEnumValues=(a)=>{let l=t.objectKeys(a).filter((b)=>typeof a[a[b]]!=="number"),e={};for(let b of l)e[b]=a[b];return t.objectValues(e)},t.objectValues=(a)=>{return t.objectKeys(a).map(function(l){return a[l]})},t.objectKeys=typeof Object.keys==="function"?(a)=>Object.keys(a):(a)=>{let l=[];for(let e in a)if(Object.prototype.hasOwnProperty.call(a,e))l.push(e);return l},t.find=(a,l)=>{for(let e of a)if(l(e))return e;return},t.isInteger=typeof Number.isInteger==="function"?(a)=>Number.isInteger(a):(a)=>typeof a==="number"&&Number.isFinite(a)&&Math.floor(a)===a;function o(a,l=" | "){return a.map((e)=>typeof e==="string"?`'${e}'`:e).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(a,l)=>{if(typeof l==="bigint")return l.toString();return l}})(L||(L={}));(function(t){t.mergeShapes=(n,r)=>{return{...n,...r}}})(Jo||(Jo={}));s=L.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var d,ke=(t)=>{return JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:")},G;var pn=m(()=>{St();d=L.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"]);G=class G extends Error{get errors(){return this.issues}constructor(t){super();this.issues=[],this.addIssue=(r)=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};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(a){return a.message},r={_errors:[]},o=(a)=>{for(let l of a.issues)if(l.code==="invalid_union")l.unionErrors.map(o);else if(l.code==="invalid_return_type")o(l.returnTypeError);else if(l.code==="invalid_arguments")o(l.argumentsError);else if(l.path.length===0)r._errors.push(n(l));else{let e=r,b=0;while(b<l.path.length){let f=l.path[b];if(b!==l.path.length-1)e[f]=e[f]||{_errors:[]};else e[f]=e[f]||{_errors:[]},e[f]._errors.push(n(l));e=e[f],b++}}};return o(this),r}static assert(t){if(!(t instanceof G))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,L.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=(n)=>n.message){let n={},r=[];for(let o of this.issues)if(o.path.length>0){let a=o.path[0];n[a]=n[a]||[],n[a].push(t(o))}else r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};G.create=(t)=>{return new G(t)}});var qe=(t,n)=>{let r;switch(t.code){case d.invalid_type:if(t.received===s.undefined)r="Required";else r=`Expected ${t.expected}, received ${t.received}`;break;case d.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,L.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:r=`Unrecognized key(s) in object: ${L.joinValues(t.keys,", ")}`;break;case d.invalid_union:r="Invalid input";break;case d.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${L.joinValues(t.options)}`;break;case d.invalid_enum_value:r=`Invalid enum value. Expected ${L.joinValues(t.options)}, received '${t.received}'`;break;case d.invalid_arguments:r="Invalid function arguments";break;case d.invalid_return_type:r="Invalid function return type";break;case d.invalid_date:r="Invalid date";break;case d.invalid_string:if(typeof t.validation==="object")if("includes"in t.validation){if(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position==="number")r=`${r} at one or more positions greater than or equal to ${t.validation.position}`}else if("startsWith"in t.validation)r=`Invalid input: must start with "${t.validation.startsWith}"`;else if("endsWith"in t.validation)r=`Invalid input: must end with "${t.validation.endsWith}"`;else L.assertNever(t.validation);else if(t.validation!=="regex")r=`Invalid ${t.validation}`;else r="Invalid";break;case d.too_small:if(t.type==="array")r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`;else if(t.type==="string")r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`;else if(t.type==="number")r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="bigint")r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="date")r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`;else r="Invalid input";break;case d.too_big:if(t.type==="array")r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`;else if(t.type==="string")r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`;else if(t.type==="number")r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="bigint")r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="date")r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`;else r="Invalid input";break;case d.custom:r="Invalid input";break;case d.invalid_intersection_types:r="Intersection results could not be merged";break;case d.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case d.not_finite:r="Number must be finite";break;default:r=n.defaultError,L.assertNever(t)}return{message:r}},C;var Go=m(()=>{pn();St();C=qe});function Le(t){Ur=t}function dt(){return Ur}var Ur;var un=m(()=>{Go();Ur=C});function v(t,n){let r=dt(),o=Xt({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===C?void 0:C].filter((a)=>!!a)});t.common.issues.push(o)}class S{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 r=[];for(let o of n){if(o.status==="aborted")return x;if(o.status==="dirty")t.dirty();r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){let r=[];for(let o of n){let a=await o.key,l=await o.value;r.push({key:a,value:l})}return S.mergeObjectSync(t,r)}static mergeObjectSync(t,n){let r={};for(let o of n){let{key:a,value:l}=o;if(a.status==="aborted")return x;if(l.status==="aborted")return x;if(a.status==="dirty")t.dirty();if(l.status==="dirty")t.dirty();if(a.value!=="__proto__"&&(typeof l.value<"u"||o.alwaysSet))r[a.value]=l.value}return{status:t.value,value:r}}}var Xt=(t)=>{let{data:n,path:r,errorMaps:o,issueData:a}=t,l=[...r,...a.path||[]],e={...a,path:l};if(a.message!==void 0)return{...a,path:l,message:a.message};let b="",f=o.filter((u)=>!!u).slice().reverse();for(let u of f)b=u(e,{data:n,defaultError:b}).message;return{...a,path:l,message:b}},He,x,at=(t)=>({status:"dirty",value:t}),X=(t)=>({status:"valid",value:t}),$n=(t)=>t.status==="aborted",wn=(t)=>t.status==="dirty",Z=(t)=>t.status==="valid",ct=(t)=>typeof Promise<"u"&&t instanceof Promise;var Qo=m(()=>{un();Go();He=[];x=Object.freeze({status:"aborted"})});var Nr=()=>{};var w;var yr=m(()=>{(function(t){t.errToObj=(n)=>typeof n==="string"?{message:n}:n||{},t.toString=(n)=>typeof n==="string"?n:n?.message})(w||(w={}))});class E{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}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 _(t){if(!t)return{};let{errorMap:n,invalid_type_error:r,required_error:o,description:a}=t;if(n&&(r||o))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(n)return{errorMap:n,description:a};return{errorMap:(e,b)=>{let{message:f}=t;if(e.code==="invalid_enum_value")return{message:f??b.defaultError};if(typeof b.data>"u")return{message:f??o??b.defaultError};if(e.code!=="invalid_type")return{message:b.defaultError};return{message:f??r??b.defaultError}},description:a}}class k{get description(){return this._def.description}_getType(t){return N(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:N(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new S,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(ct(n))throw Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:N(t)},o=this._parseSync({data:t,path:r.path,parent:r});return Vr(r,o)}"~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 r=this._parseSync({data:t,path:[],parent:n});return Z(r)?{value:r.value}:{issues:n.common.issues}}catch(r){if(r?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then((r)=>Z(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(t,n){let r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:N(t)},o=this._parse({data:t,path:r.path,parent:r}),a=await(ct(o)?o:Promise.resolve(o));return Vr(r,a)}refine(t,n){let r=(o)=>{if(typeof n==="string"||typeof n>"u")return{message:n};else if(typeof n==="function")return n(o);else return n};return this._refinement((o,a)=>{let l=t(o),e=()=>a.addIssue({code:d.custom,...r(o)});if(typeof Promise<"u"&&l instanceof Promise)return l.then((b)=>{if(!b)return e(),!1;else return!0});if(!l)return e(),!1;else return!0})}refinement(t,n){return this._refinement((r,o)=>{if(!t(r))return o.addIssue(typeof n==="function"?n(r,o):n),!1;else return!0})}_refinement(t){return new W({schema:this,typeName:A.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(n)=>this["~validate"](n)}}optional(){return D.create(this,this._def)}nullable(){return P.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return B.create(this)}promise(){return it.create(this,this._def)}or(t){return ut.create([this,t],this._def)}and(t){return $t.create(this,t,this._def)}transform(t){return new W({..._(this._def),schema:this,typeName:A.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t==="function"?t:()=>t;return new _t({..._(this._def),innerType:this,defaultValue:n,typeName:A.ZodDefault})}brand(){return new An({typeName:A.ZodBranded,type:this,..._(this._def)})}catch(t){let n=typeof t==="function"?t:()=>t;return new kt({..._(this._def),innerType:this,catchValue:n,typeName:A.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return Bt.create(this,t)}readonly(){return qt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Cr(t){let n="[0-5]\\d";if(t.precision)n=`${n}\\.\\d{${t.precision}}`;else if(t.precision==null)n=`${n}(\\.\\d+)?`;let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${n})${r}`}function ye(t){return new RegExp(`^${Cr(t)}$`)}function Ir(t){let n=`${jr}T${Cr(t)}`,r=[];if(r.push(t.local?"Z?":"Z"),t.offset)r.push("([+-]\\d{2}:?\\d{2})");return n=`${n}(${r.join("|")})`,new RegExp(`^${n}$`)}function Ve(t,n){if((n==="v4"||!n)&&Be.test(t))return!0;if((n==="v6"||!n)&&Ee.test(t))return!0;return!1}function Ke(t,n){if(!Je.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let o=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(o));if(typeof a!=="object"||a===null)return!1;if("typ"in a&&a?.typ!=="JWT")return!1;if(!a.alg)return!1;if(n&&a.alg!==n)return!1;return!0}catch{return!1}}function je(t,n){if((n==="v4"||!n)&&De.test(t))return!0;if((n==="v6"||!n)&&We.test(t))return!0;return!1}function Ce(t,n){let r=(t.toString().split(".")[1]||"").length,o=(n.toString().split(".")[1]||"").length,a=r>o?r:o,l=Number.parseInt(t.toFixed(a).replace(".","")),e=Number.parseInt(n.toFixed(a).replace(".",""));return l%e/10**a}function gt(t){if(t instanceof H){let n={};for(let r in t.shape){let o=t.shape[r];n[r]=D.create(gt(o))}return new H({...t._def,shape:()=>n})}else if(t instanceof B)return new B({...t._def,type:gt(t.element)});else if(t instanceof D)return D.create(gt(t.unwrap()));else if(t instanceof P)return P.create(gt(t.unwrap()));else if(t instanceof V)return V.create(t.items.map((n)=>gt(n)));else return t}function Bo(t,n){let r=N(t),o=N(n);if(t===n)return{valid:!0,data:t};else if(r===s.object&&o===s.object){let a=L.objectKeys(n),l=L.objectKeys(t).filter((b)=>a.indexOf(b)!==-1),e={...t,...n};for(let b of l){let f=Bo(t[b],n[b]);if(!f.valid)return{valid:!1};e[b]=f.data}return{valid:!0,data:e}}else if(r===s.array&&o===s.array){if(t.length!==n.length)return{valid:!1};let a=[];for(let l=0;l<t.length;l++){let e=t[l],b=n[l],f=Bo(e,b);if(!f.valid)return{valid:!1};a.push(f.data)}return{valid:!0,data:a}}else if(r===s.date&&o===s.date&&+t===+n)return{valid:!0,data:t};else return{valid:!1}}function Pr(t,n){return new ot({values:t,typeName:A.ZodEnum,..._(n)})}function Kr(t,n){let r=typeof t==="function"?t(n):typeof t==="string"?{message:t}:t;return typeof r==="string"?{message:r}:r}function Tr(t,n={},r){if(t)return et.create().superRefine((o,a)=>{let l=t(o);if(l instanceof Promise)return l.then((e)=>{if(!e){let b=Kr(n,o),f=b.fatal??r??!0;a.addIssue({code:"custom",...b,fatal:f})}});if(!l){let e=Kr(n,o),b=e.fatal??r??!0;a.addIssue({code:"custom",...e,fatal:b})}return});return et.create()}var Vr=(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 r=new G(t.common.issues);return this._error=r,this._error}}}},Me,Re,Se,Xe,Ye,Je,Ge,Qe,Fe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Fo,Be,De,Ee,We,Oe,Ue,jr="((\\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])))",Ne,F,tt,nt,mt,lt,Yt,vt,pt,et,z,y,Jt,B,H,ut,I=(t)=>{if(t instanceof wt)return I(t.schema);else if(t instanceof W)return I(t.innerType());else if(t instanceof xt)return[t.value];else if(t instanceof ot)return t.options;else if(t instanceof At)return L.objectValues(t.enum);else if(t instanceof _t)return I(t._def.innerType);else if(t instanceof vt)return[void 0];else if(t instanceof pt)return[null];else if(t instanceof D)return[void 0,...I(t.unwrap())];else if(t instanceof P)return[null,...I(t.unwrap())];else if(t instanceof An)return I(t.unwrap());else if(t instanceof qt)return I(t.unwrap());else if(t instanceof kt)return I(t._def.innerType);else return[]},xn,$t,V,Gt,Qt,bt,st,wt,xt,ot,At,it,W,D,P,_t,kt,Ft,Ie,An,Bt,qt,Pe,A,Te=(t,n={message:`Input not instance of ${t.name}`})=>Tr((r)=>r instanceof t,n),Zr,zr,Ze,ze,ta,tb,nb,ob,rb,ab,lb,eb,bb,ib,fb,hb,db,cb,gb,sb,mb,vb,pb,ub,$b,wb,xb,Ab,_b,kb,qb,Lb,Hb,Mb,Rb=()=>Zr().optional(),Sb=()=>zr().optional(),Xb=()=>ta().optional(),Yb,Jb;var na=m(()=>{pn();un();yr();Qo();St();Me=/^c[^\s-]{8,}$/i,Re=/^[0-9a-z]+$/,Se=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Xe=/^[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,Ye=/^[a-z0-9_-]{21}$/i,Je=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ge=/^[-+]?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)?)??$/,Qe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Be=/^(?:(?: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])$/,De=/^(?:(?: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])$/,Ee=/^(([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]))$/,We=/^(([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])$/,Oe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ue=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ne=new RegExp(`^${jr}$`);F=class F extends k{_parse(t){if(this._def.coerce)t.data=String(t.data);if(this._getType(t)!==s.string){let a=this._getOrReturnCtx(t);return v(a,{code:d.invalid_type,expected:s.string,received:a.parsedType}),x}let r=new S,o=void 0;for(let a of this._def.checks)if(a.kind==="min"){if(t.data.length<a.value)o=this._getOrReturnCtx(t,o),v(o,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty()}else if(a.kind==="max"){if(t.data.length>a.value)o=this._getOrReturnCtx(t,o),v(o,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty()}else if(a.kind==="length"){let l=t.data.length>a.value,e=t.data.length<a.value;if(l||e){if(o=this._getOrReturnCtx(t,o),l)v(o,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message});else if(e)v(o,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message});r.dirty()}}else if(a.kind==="email"){if(!Qe.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"email",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="emoji"){if(!Fo)Fo=new RegExp(Fe,"u");if(!Fo.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"emoji",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="uuid"){if(!Xe.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"uuid",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="nanoid"){if(!Ye.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"nanoid",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="cuid"){if(!Me.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"cuid",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="cuid2"){if(!Re.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"cuid2",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="ulid"){if(!Se.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"ulid",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),v(o,{validation:"url",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="regex"){if(a.regex.lastIndex=0,!a.regex.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"regex",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="trim")t.data=t.data.trim();else if(a.kind==="includes"){if(!t.data.includes(a.value,a.position))o=this._getOrReturnCtx(t,o),v(o,{code:d.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()}else if(a.kind==="toLowerCase")t.data=t.data.toLowerCase();else if(a.kind==="toUpperCase")t.data=t.data.toUpperCase();else if(a.kind==="startsWith"){if(!t.data.startsWith(a.value))o=this._getOrReturnCtx(t,o),v(o,{code:d.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()}else if(a.kind==="endsWith"){if(!t.data.endsWith(a.value))o=this._getOrReturnCtx(t,o),v(o,{code:d.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()}else if(a.kind==="datetime"){if(!Ir(a).test(t.data))o=this._getOrReturnCtx(t,o),v(o,{code:d.invalid_string,validation:"datetime",message:a.message}),r.dirty()}else if(a.kind==="date"){if(!Ne.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{code:d.invalid_string,validation:"date",message:a.message}),r.dirty()}else if(a.kind==="time"){if(!ye(a).test(t.data))o=this._getOrReturnCtx(t,o),v(o,{code:d.invalid_string,validation:"time",message:a.message}),r.dirty()}else if(a.kind==="duration"){if(!Ge.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"duration",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="ip"){if(!Ve(t.data,a.version))o=this._getOrReturnCtx(t,o),v(o,{validation:"ip",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="jwt"){if(!Ke(t.data,a.alg))o=this._getOrReturnCtx(t,o),v(o,{validation:"jwt",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="cidr"){if(!je(t.data,a.version))o=this._getOrReturnCtx(t,o),v(o,{validation:"cidr",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="base64"){if(!Oe.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"base64",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="base64url"){if(!Ue.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"base64url",code:d.invalid_string,message:a.message}),r.dirty()}else L.assertNever(a);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement((o)=>t.test(o),{validation:n,code:d.invalid_string,...w.errToObj(r)})}_addCheck(t){return new F({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...w.errToObj(t)})}url(t){return this._addCheck({kind:"url",...w.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...w.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...w.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...w.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...w.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...w.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...w.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...w.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...w.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...w.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...w.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...w.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,...w.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,...w.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...w.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...w.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...w.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...w.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...w.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...w.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...w.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...w.errToObj(n)})}nonempty(t){return this.min(1,w.errToObj(t))}trim(){return new F({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new F({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new F({...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}};F.create=(t)=>{return new F({checks:[],typeName:A.ZodString,coerce:t?.coerce??!1,..._(t)})};tt=class tt extends k{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce)t.data=Number(t.data);if(this._getType(t)!==s.number){let a=this._getOrReturnCtx(t);return v(a,{code:d.invalid_type,expected:s.number,received:a.parsedType}),x}let r=void 0,o=new S;for(let a of this._def.checks)if(a.kind==="int"){if(!L.isInteger(t.data))r=this._getOrReturnCtx(t,r),v(r,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()}else if(a.kind==="min"){if(a.inclusive?t.data<a.value:t.data<=a.value)r=this._getOrReturnCtx(t,r),v(r,{code:d.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()}else if(a.kind==="max"){if(a.inclusive?t.data>a.value:t.data>=a.value)r=this._getOrReturnCtx(t,r),v(r,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()}else if(a.kind==="multipleOf"){if(Ce(t.data,a.value)!==0)r=this._getOrReturnCtx(t,r),v(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()}else if(a.kind==="finite"){if(!Number.isFinite(t.data))r=this._getOrReturnCtx(t,r),v(r,{code:d.not_finite,message:a.message}),o.dirty()}else L.assertNever(a);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,w.toString(n))}gt(t,n){return this.setLimit("min",t,!1,w.toString(n))}lte(t,n){return this.setLimit("max",t,!0,w.toString(n))}lt(t,n){return this.setLimit("max",t,!1,w.toString(n))}setLimit(t,n,r,o){return new tt({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:w.toString(o)}]})}_addCheck(t){return new tt({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:w.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:w.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:w.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:w.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:w.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:w.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:w.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:w.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:w.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"&&L.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let r of this._def.checks)if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;else if(r.kind==="min"){if(n===null||r.value>n)n=r.value}else if(r.kind==="max"){if(t===null||r.value<t)t=r.value}return Number.isFinite(n)&&Number.isFinite(t)}};tt.create=(t)=>{return new tt({checks:[],typeName:A.ZodNumber,coerce:t?.coerce||!1,..._(t)})};nt=class nt extends k{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==s.bigint)return this._getInvalidInput(t);let r=void 0,o=new S;for(let a of this._def.checks)if(a.kind==="min"){if(a.inclusive?t.data<a.value:t.data<=a.value)r=this._getOrReturnCtx(t,r),v(r,{code:d.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()}else if(a.kind==="max"){if(a.inclusive?t.data>a.value:t.data>=a.value)r=this._getOrReturnCtx(t,r),v(r,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()}else if(a.kind==="multipleOf"){if(t.data%a.value!==BigInt(0))r=this._getOrReturnCtx(t,r),v(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()}else L.assertNever(a);return{status:o.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return v(n,{code:d.invalid_type,expected:s.bigint,received:n.parsedType}),x}gte(t,n){return this.setLimit("min",t,!0,w.toString(n))}gt(t,n){return this.setLimit("min",t,!1,w.toString(n))}lte(t,n){return this.setLimit("max",t,!0,w.toString(n))}lt(t,n){return this.setLimit("max",t,!1,w.toString(n))}setLimit(t,n,r,o){return new nt({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:w.toString(o)}]})}_addCheck(t){return new nt({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:w.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:w.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:w.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:w.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:w.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}};nt.create=(t)=>{return new nt({checks:[],typeName:A.ZodBigInt,coerce:t?.coerce??!1,..._(t)})};mt=class mt extends k{_parse(t){if(this._def.coerce)t.data=Boolean(t.data);if(this._getType(t)!==s.boolean){let r=this._getOrReturnCtx(t);return v(r,{code:d.invalid_type,expected:s.boolean,received:r.parsedType}),x}return X(t.data)}};mt.create=(t)=>{return new mt({typeName:A.ZodBoolean,coerce:t?.coerce||!1,..._(t)})};lt=class lt extends k{_parse(t){if(this._def.coerce)t.data=new Date(t.data);if(this._getType(t)!==s.date){let a=this._getOrReturnCtx(t);return v(a,{code:d.invalid_type,expected:s.date,received:a.parsedType}),x}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return v(a,{code:d.invalid_date}),x}let r=new S,o=void 0;for(let a of this._def.checks)if(a.kind==="min"){if(t.data.getTime()<a.value)o=this._getOrReturnCtx(t,o),v(o,{code:d.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()}else if(a.kind==="max"){if(t.data.getTime()>a.value)o=this._getOrReturnCtx(t,o),v(o,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()}else L.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new lt({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:w.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:w.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}};lt.create=(t)=>{return new lt({checks:[],coerce:t?.coerce||!1,typeName:A.ZodDate,..._(t)})};Yt=class Yt extends k{_parse(t){if(this._getType(t)!==s.symbol){let r=this._getOrReturnCtx(t);return v(r,{code:d.invalid_type,expected:s.symbol,received:r.parsedType}),x}return X(t.data)}};Yt.create=(t)=>{return new Yt({typeName:A.ZodSymbol,..._(t)})};vt=class vt extends k{_parse(t){if(this._getType(t)!==s.undefined){let r=this._getOrReturnCtx(t);return v(r,{code:d.invalid_type,expected:s.undefined,received:r.parsedType}),x}return X(t.data)}};vt.create=(t)=>{return new vt({typeName:A.ZodUndefined,..._(t)})};pt=class pt extends k{_parse(t){if(this._getType(t)!==s.null){let r=this._getOrReturnCtx(t);return v(r,{code:d.invalid_type,expected:s.null,received:r.parsedType}),x}return X(t.data)}};pt.create=(t)=>{return new pt({typeName:A.ZodNull,..._(t)})};et=class et extends k{constructor(){super(...arguments);this._any=!0}_parse(t){return X(t.data)}};et.create=(t)=>{return new et({typeName:A.ZodAny,..._(t)})};z=class z extends k{constructor(){super(...arguments);this._unknown=!0}_parse(t){return X(t.data)}};z.create=(t)=>{return new z({typeName:A.ZodUnknown,..._(t)})};y=class y extends k{_parse(t){let n=this._getOrReturnCtx(t);return v(n,{code:d.invalid_type,expected:s.never,received:n.parsedType}),x}};y.create=(t)=>{return new y({typeName:A.ZodNever,..._(t)})};Jt=class Jt extends k{_parse(t){if(this._getType(t)!==s.undefined){let r=this._getOrReturnCtx(t);return v(r,{code:d.invalid_type,expected:s.void,received:r.parsedType}),x}return X(t.data)}};Jt.create=(t)=>{return new Jt({typeName:A.ZodVoid,..._(t)})};B=class B extends k{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==s.array)return v(n,{code:d.invalid_type,expected:s.array,received:n.parsedType}),x;if(o.exactLength!==null){let l=n.data.length>o.exactLength.value,e=n.data.length<o.exactLength.value;if(l||e)v(n,{code:l?d.too_big:d.too_small,minimum:e?o.exactLength.value:void 0,maximum:l?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty()}if(o.minLength!==null){if(n.data.length<o.minLength.value)v(n,{code:d.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()}if(o.maxLength!==null){if(n.data.length>o.maxLength.value)v(n,{code:d.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()}if(n.common.async)return Promise.all([...n.data].map((l,e)=>{return o.type._parseAsync(new E(n,l,n.path,e))})).then((l)=>{return S.mergeArray(r,l)});let a=[...n.data].map((l,e)=>{return o.type._parseSync(new E(n,l,n.path,e))});return S.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new B({...this._def,minLength:{value:t,message:w.toString(n)}})}max(t,n){return new B({...this._def,maxLength:{value:t,message:w.toString(n)}})}length(t,n){return new B({...this._def,exactLength:{value:t,message:w.toString(n)}})}nonempty(t){return this.min(1,t)}};B.create=(t,n)=>{return new B({type:t,minLength:null,maxLength:null,exactLength:null,typeName:A.ZodArray,..._(n)})};H=class H extends k{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=L.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==s.object){let f=this._getOrReturnCtx(t);return v(f,{code:d.invalid_type,expected:s.object,received:f.parsedType}),x}let{status:r,ctx:o}=this._processInputParams(t),{shape:a,keys:l}=this._getCached(),e=[];if(!(this._def.catchall instanceof y&&this._def.unknownKeys==="strip")){for(let f in o.data)if(!l.includes(f))e.push(f)}let b=[];for(let f of l){let u=a[f],q=o.data[f];b.push({key:{status:"valid",value:f},value:u._parse(new E(o,q,o.path,f)),alwaysSet:f in o.data})}if(this._def.catchall instanceof y){let f=this._def.unknownKeys;if(f==="passthrough")for(let u of e)b.push({key:{status:"valid",value:u},value:{status:"valid",value:o.data[u]}});else if(f==="strict"){if(e.length>0)v(o,{code:d.unrecognized_keys,keys:e}),r.dirty()}else if(f==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let f=this._def.catchall;for(let u of e){let q=o.data[u];b.push({key:{status:"valid",value:u},value:f._parse(new E(o,q,o.path,u)),alwaysSet:u in o.data})}}if(o.common.async)return Promise.resolve().then(async()=>{let f=[];for(let u of b){let q=await u.key,R=await u.value;f.push({key:q,value:R,alwaysSet:u.alwaysSet})}return f}).then((f)=>{return S.mergeObjectSync(r,f)});else return S.mergeObjectSync(r,b)}get shape(){return this._def.shape()}strict(t){return w.errToObj,new H({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{let o=this._def.errorMap?.(n,r).message??r.defaultError;if(n.code==="unrecognized_keys")return{message:w.errToObj(t).message??o};return{message:o}}}:{}})}strip(){return new H({...this._def,unknownKeys:"strip"})}passthrough(){return new H({...this._def,unknownKeys:"passthrough"})}extend(t){return new H({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new H({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:A.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new H({...this._def,catchall:t})}pick(t){let n={};for(let r of L.objectKeys(t))if(t[r]&&this.shape[r])n[r]=this.shape[r];return new H({...this._def,shape:()=>n})}omit(t){let n={};for(let r of L.objectKeys(this.shape))if(!t[r])n[r]=this.shape[r];return new H({...this._def,shape:()=>n})}deepPartial(){return gt(this)}partial(t){let n={};for(let r of L.objectKeys(this.shape)){let o=this.shape[r];if(t&&!t[r])n[r]=o;else n[r]=o.optional()}return new H({...this._def,shape:()=>n})}required(t){let n={};for(let r of L.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];while(a instanceof D)a=a._def.innerType;n[r]=a}return new H({...this._def,shape:()=>n})}keyof(){return Pr(L.objectKeys(this.shape))}};H.create=(t,n)=>{return new H({shape:()=>t,unknownKeys:"strip",catchall:y.create(),typeName:A.ZodObject,..._(n)})};H.strictCreate=(t,n)=>{return new H({shape:()=>t,unknownKeys:"strict",catchall:y.create(),typeName:A.ZodObject,..._(n)})};H.lazycreate=(t,n)=>{return new H({shape:t,unknownKeys:"strip",catchall:y.create(),typeName:A.ZodObject,..._(n)})};ut=class ut extends k{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;function o(a){for(let e of a)if(e.result.status==="valid")return e.result;for(let e of a)if(e.result.status==="dirty")return n.common.issues.push(...e.ctx.common.issues),e.result;let l=a.map((e)=>new G(e.ctx.common.issues));return v(n,{code:d.invalid_union,unionErrors:l}),x}if(n.common.async)return Promise.all(r.map(async(a)=>{let l={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:l}),ctx:l}})).then(o);else{let a=void 0,l=[];for(let b of r){let f={...n,common:{...n.common,issues:[]},parent:null},u=b._parseSync({data:n.data,path:n.path,parent:f});if(u.status==="valid")return u;else if(u.status==="dirty"&&!a)a={result:u,ctx:f};if(f.common.issues.length)l.push(f.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;let e=l.map((b)=>new G(b));return v(n,{code:d.invalid_union,unionErrors:e}),x}}get options(){return this._def.options}};ut.create=(t,n)=>{return new ut({options:t,typeName:A.ZodUnion,..._(n)})};xn=class xn extends k{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==s.object)return v(n,{code:d.invalid_type,expected:s.object,received:n.parsedType}),x;let r=this.discriminator,o=n.data[r],a=this.optionsMap.get(o);if(!a)return v(n,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),x;if(n.common.async)return a._parseAsync({data:n.data,path:n.path,parent:n});else return a._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,r){let o=new Map;for(let a of n){let l=I(a.shape[t]);if(!l.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let e of l){if(o.has(e))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(e)}`);o.set(e,a)}}return new xn({typeName:A.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,..._(r)})}};$t=class $t extends k{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),o=(a,l)=>{if($n(a)||$n(l))return x;let e=Bo(a.value,l.value);if(!e.valid)return v(r,{code:d.invalid_intersection_types}),x;if(wn(a)||wn(l))n.dirty();return{status:n.value,value:e.data}};if(r.common.async)return Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,l])=>o(a,l));else return o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};$t.create=(t,n,r)=>{return new $t({left:t,right:n,typeName:A.ZodIntersection,..._(r)})};V=class V extends k{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==s.array)return v(r,{code:d.invalid_type,expected:s.array,received:r.parsedType}),x;if(r.data.length<this._def.items.length)return v(r,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;if(!this._def.rest&&r.data.length>this._def.items.length)v(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty();let a=[...r.data].map((l,e)=>{let b=this._def.items[e]||this._def.rest;if(!b)return null;return b._parse(new E(r,l,r.path,e))}).filter((l)=>!!l);if(r.common.async)return Promise.all(a).then((l)=>{return S.mergeArray(n,l)});else return S.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new V({...this._def,rest:t})}};V.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new V({items:t,typeName:A.ZodTuple,rest:null,..._(n)})};Gt=class Gt extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==s.object)return v(r,{code:d.invalid_type,expected:s.object,received:r.parsedType}),x;let o=[],a=this._def.keyType,l=this._def.valueType;for(let e in r.data)o.push({key:a._parse(new E(r,e,r.path,e)),value:l._parse(new E(r,r.data[e],r.path,e)),alwaysSet:e in r.data});if(r.common.async)return S.mergeObjectAsync(n,o);else return S.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){if(n instanceof k)return new Gt({keyType:t,valueType:n,typeName:A.ZodRecord,..._(r)});return new Gt({keyType:F.create(),valueType:t,typeName:A.ZodRecord,..._(n)})}};Qt=class Qt extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==s.map)return v(r,{code:d.invalid_type,expected:s.map,received:r.parsedType}),x;let o=this._def.keyType,a=this._def.valueType,l=[...r.data.entries()].map(([e,b],f)=>{return{key:o._parse(new E(r,e,r.path,[f,"key"])),value:a._parse(new E(r,b,r.path,[f,"value"]))}});if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let b of l){let f=await b.key,u=await b.value;if(f.status==="aborted"||u.status==="aborted")return x;if(f.status==="dirty"||u.status==="dirty")n.dirty();e.set(f.value,u.value)}return{status:n.value,value:e}})}else{let e=new Map;for(let b of l){let{key:f,value:u}=b;if(f.status==="aborted"||u.status==="aborted")return x;if(f.status==="dirty"||u.status==="dirty")n.dirty();e.set(f.value,u.value)}return{status:n.value,value:e}}}};Qt.create=(t,n,r)=>{return new Qt({valueType:n,keyType:t,typeName:A.ZodMap,..._(r)})};bt=class bt extends k{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==s.set)return v(r,{code:d.invalid_type,expected:s.set,received:r.parsedType}),x;let o=this._def;if(o.minSize!==null){if(r.data.size<o.minSize.value)v(r,{code:d.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()}if(o.maxSize!==null){if(r.data.size>o.maxSize.value)v(r,{code:d.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty()}let a=this._def.valueType;function l(b){let f=new Set;for(let u of b){if(u.status==="aborted")return x;if(u.status==="dirty")n.dirty();f.add(u.value)}return{status:n.value,value:f}}let e=[...r.data.values()].map((b,f)=>a._parse(new E(r,b,r.path,f)));if(r.common.async)return Promise.all(e).then((b)=>l(b));else return l(e)}min(t,n){return new bt({...this._def,minSize:{value:t,message:w.toString(n)}})}max(t,n){return new bt({...this._def,maxSize:{value:t,message:w.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:A.ZodSet,..._(n)})};st=class st extends k{constructor(){super(...arguments);this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==s.function)return v(n,{code:d.invalid_type,expected:s.function,received:n.parsedType}),x;function r(e,b){return Xt({data:e,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,dt(),C].filter((f)=>!!f),issueData:{code:d.invalid_arguments,argumentsError:b}})}function o(e,b){return Xt({data:e,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,dt(),C].filter((f)=>!!f),issueData:{code:d.invalid_return_type,returnTypeError:b}})}let a={errorMap:n.common.contextualErrorMap},l=n.data;if(this._def.returns instanceof it){let e=this;return X(async function(...b){let f=new G([]),u=await e._def.args.parseAsync(b,a).catch((M)=>{throw f.addIssue(r(b,M)),f}),q=await Reflect.apply(l,this,u);return await e._def.returns._def.type.parseAsync(q,a).catch((M)=>{throw f.addIssue(o(q,M)),f})})}else{let e=this;return X(function(...b){let f=e._def.args.safeParse(b,a);if(!f.success)throw new G([r(b,f.error)]);let u=Reflect.apply(l,this,f.data),q=e._def.returns.safeParse(u,a);if(!q.success)throw new G([o(u,q.error)]);return q.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new st({...this._def,args:V.create(t).rest(z.create())})}returns(t){return new st({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new st({args:t?t:V.create([]).rest(z.create()),returns:n||z.create(),typeName:A.ZodFunction,..._(r)})}};wt=class wt extends k{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};wt.create=(t,n)=>{return new wt({getter:t,typeName:A.ZodLazy,..._(n)})};xt=class xt extends k{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return v(n,{received:n.data,code:d.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:t.data}}get value(){return this._def.value}};xt.create=(t,n)=>{return new xt({value:t,typeName:A.ZodLiteral,..._(n)})};ot=class ot extends k{_parse(t){if(typeof t.data!=="string"){let n=this._getOrReturnCtx(t),r=this._def.values;return v(n,{expected:L.joinValues(r),received:n.parsedType,code:d.invalid_type}),x}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),r=this._def.values;return v(n,{received:n.data,code:d.invalid_enum_value,options:r}),x}return X(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 ot.create(t,{...this._def,...n})}exclude(t,n=this._def){return ot.create(this.options.filter((r)=>!t.includes(r)),{...this._def,...n})}};ot.create=Pr;At=class At extends k{_parse(t){let n=L.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==s.string&&r.parsedType!==s.number){let o=L.objectValues(n);return v(r,{expected:L.joinValues(o),received:r.parsedType,code:d.invalid_type}),x}if(!this._cache)this._cache=new Set(L.getValidEnumValues(this._def.values));if(!this._cache.has(t.data)){let o=L.objectValues(n);return v(r,{received:r.data,code:d.invalid_enum_value,options:o}),x}return X(t.data)}get enum(){return this._def.values}};At.create=(t,n)=>{return new At({values:t,typeName:A.ZodNativeEnum,..._(n)})};it=class it extends k{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==s.promise&&n.common.async===!1)return v(n,{code:d.invalid_type,expected:s.promise,received:n.parsedType}),x;let r=n.parsedType===s.promise?n.data:Promise.resolve(n.data);return X(r.then((o)=>{return this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})}))}};it.create=(t,n)=>{return new it({type:t,typeName:A.ZodPromise,..._(n)})};W=class W extends k{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===A.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,a={addIssue:(l)=>{if(v(r,l),l.fatal)n.abort();else n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){let l=o.transform(r.data,a);if(r.common.async)return Promise.resolve(l).then(async(e)=>{if(n.value==="aborted")return x;let b=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});if(b.status==="aborted")return x;if(b.status==="dirty")return at(b.value);if(n.value==="dirty")return at(b.value);return b});else{if(n.value==="aborted")return x;let e=this._def.schema._parseSync({data:l,path:r.path,parent:r});if(e.status==="aborted")return x;if(e.status==="dirty")return at(e.value);if(n.value==="dirty")return at(e.value);return e}}if(o.type==="refinement"){let l=(e)=>{let b=o.refinement(e,a);if(r.common.async)return Promise.resolve(b);if(b instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(r.common.async===!1){let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(e.status==="aborted")return x;if(e.status==="dirty")n.dirty();return l(e.value),{status:n.value,value:e.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e)=>{if(e.status==="aborted")return x;if(e.status==="dirty")n.dirty();return l(e.value).then(()=>{return{status:n.value,value:e.value}})})}if(o.type==="transform")if(r.common.async===!1){let l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Z(l))return x;let e=o.transform(l.value,a);if(e instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:e}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((l)=>{if(!Z(l))return x;return Promise.resolve(o.transform(l.value,a)).then((e)=>({status:n.value,value:e}))});L.assertNever(o)}};W.create=(t,n,r)=>{return new W({schema:t,typeName:A.ZodEffects,effect:n,..._(r)})};W.createWithPreprocess=(t,n,r)=>{return new W({schema:n,effect:{type:"preprocess",transform:t},typeName:A.ZodEffects,..._(r)})};D=class D extends k{_parse(t){if(this._getType(t)===s.undefined)return X(void 0);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};D.create=(t,n)=>{return new D({innerType:t,typeName:A.ZodOptional,..._(n)})};P=class P extends k{_parse(t){if(this._getType(t)===s.null)return X(null);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};P.create=(t,n)=>{return new P({innerType:t,typeName:A.ZodNullable,..._(n)})};_t=class _t extends k{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;if(n.parsedType===s.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};_t.create=(t,n)=>{return new _t({innerType:t,typeName:A.ZodDefault,defaultValue:typeof n.default==="function"?n.default:()=>n.default,..._(n)})};kt=class kt extends k{_parse(t){let{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});if(ct(o))return o.then((a)=>{return{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new G(r.common.issues)},input:r.data})}});else return{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new G(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};kt.create=(t,n)=>{return new kt({innerType:t,typeName:A.ZodCatch,catchValue:typeof n.catch==="function"?n.catch:()=>n.catch,..._(n)})};Ft=class Ft extends k{_parse(t){if(this._getType(t)!==s.nan){let r=this._getOrReturnCtx(t);return v(r,{code:d.invalid_type,expected:s.nan,received:r.parsedType}),x}return{status:"valid",value:t.data}}};Ft.create=(t)=>{return new Ft({typeName:A.ZodNaN,..._(t)})};Ie=Symbol("zod_brand");An=class An extends k{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}};Bt=class Bt extends k{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});if(a.status==="aborted")return x;if(a.status==="dirty")return n.dirty(),at(a.value);else return this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();else{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});if(o.status==="aborted")return x;if(o.status==="dirty")return n.dirty(),{status:"dirty",value:o.value};else return this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new Bt({in:t,out:n,typeName:A.ZodPipeline})}};qt=class qt extends k{_parse(t){let n=this._def.innerType._parse(t),r=(o)=>{if(Z(o))o.value=Object.freeze(o.value);return o};return ct(n)?n.then((o)=>r(o)):r(n)}unwrap(){return this._def.innerType}};qt.create=(t,n)=>{return new qt({innerType:t,typeName:A.ZodReadonly,..._(n)})};Pe={object:H.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"})(A||(A={}));Zr=F.create,zr=tt.create,Ze=Ft.create,ze=nt.create,ta=mt.create,tb=lt.create,nb=Yt.create,ob=vt.create,rb=pt.create,ab=et.create,lb=z.create,eb=y.create,bb=Jt.create,ib=B.create,fb=H.create,hb=H.strictCreate,db=ut.create,cb=xn.create,gb=$t.create,sb=V.create,mb=Gt.create,vb=Qt.create,pb=bt.create,ub=st.create,$b=wt.create,wb=xt.create,xb=ot.create,Ab=At.create,_b=it.create,kb=W.create,qb=D.create,Lb=P.create,Hb=W.createWithPreprocess,Mb=Bt.create,Yb={string:(t)=>F.create({...t,coerce:!0}),number:(t)=>tt.create({...t,coerce:!0}),boolean:(t)=>mt.create({...t,coerce:!0}),bigint:(t)=>nt.create({...t,coerce:!0}),date:(t)=>lt.create({...t,coerce:!0})},Jb=x});var g={};$(g,{void:()=>bb,util:()=>L,unknown:()=>lb,union:()=>db,undefined:()=>ob,tuple:()=>sb,transformer:()=>kb,symbol:()=>nb,string:()=>Zr,strictObject:()=>hb,setErrorMap:()=>Le,set:()=>pb,record:()=>mb,quotelessJson:()=>ke,promise:()=>_b,preprocess:()=>Hb,pipeline:()=>Mb,ostring:()=>Rb,optional:()=>qb,onumber:()=>Sb,oboolean:()=>Xb,objectUtil:()=>Jo,object:()=>fb,number:()=>zr,nullable:()=>Lb,null:()=>rb,never:()=>eb,nativeEnum:()=>Ab,nan:()=>Ze,map:()=>vb,makeIssue:()=>Xt,literal:()=>wb,lazy:()=>$b,late:()=>Pe,isValid:()=>Z,isDirty:()=>wn,isAsync:()=>ct,isAborted:()=>$n,intersection:()=>gb,instanceof:()=>Te,getParsedType:()=>N,getErrorMap:()=>dt,function:()=>ub,enum:()=>xb,effect:()=>kb,discriminatedUnion:()=>cb,defaultErrorMap:()=>C,datetimeRegex:()=>Ir,date:()=>tb,custom:()=>Tr,coerce:()=>Yb,boolean:()=>ta,bigint:()=>ze,array:()=>ib,any:()=>ab,addIssueToContext:()=>v,ZodVoid:()=>Jt,ZodUnknown:()=>z,ZodUnion:()=>ut,ZodUndefined:()=>vt,ZodType:()=>k,ZodTuple:()=>V,ZodTransformer:()=>W,ZodSymbol:()=>Yt,ZodString:()=>F,ZodSet:()=>bt,ZodSchema:()=>k,ZodRecord:()=>Gt,ZodReadonly:()=>qt,ZodPromise:()=>it,ZodPipeline:()=>Bt,ZodParsedType:()=>s,ZodOptional:()=>D,ZodObject:()=>H,ZodNumber:()=>tt,ZodNullable:()=>P,ZodNull:()=>pt,ZodNever:()=>y,ZodNativeEnum:()=>At,ZodNaN:()=>Ft,ZodMap:()=>Qt,ZodLiteral:()=>xt,ZodLazy:()=>wt,ZodIssueCode:()=>d,ZodIntersection:()=>$t,ZodFunction:()=>st,ZodFirstPartyTypeKind:()=>A,ZodError:()=>G,ZodEnum:()=>ot,ZodEffects:()=>W,ZodDiscriminatedUnion:()=>xn,ZodDefault:()=>_t,ZodDate:()=>lt,ZodCatch:()=>kt,ZodBranded:()=>An,ZodBoolean:()=>mt,ZodBigInt:()=>nt,ZodArray:()=>B,ZodAny:()=>et,Schema:()=>k,ParseStatus:()=>S,OK:()=>X,NEVER:()=>Jb,INVALID:()=>x,EMPTY_PATH:()=>He,DIRTY:()=>at,BRAND:()=>Ie});var Do=m(()=>{un();Qo();Nr();St();na();pn()});var oa=m(()=>{Do();Do()});function Lt(t,...n){if(Gb())return;(console[t]||console.log).call(console,...n)}var Gb=()=>Boolean(globalThis.__AFRICODE_TEST__||globalThis.__AFRICODE_SILENT_LOGS__);function _n(t){if(t===null||typeof t!=="object")return t;if(Array.isArray(t))return t.map(_n);let n={};for(let r of Object.keys(t))n[r]=_n(t[r]);return n}function la(t,n){let r={...t};for(let o of Object.keys(n))if(n[o]!==null&&typeof n[o]==="object"&&!Array.isArray(n[o])&&typeof t[o]==="object"&&!Array.isArray(t[o]))r[o]=la(t[o]||{},n[o]);else r[o]=n[o];return r}function ea(t={}){return aa=la(ra,t),Qb=!0,Dt()}function Dt(){return Object.freeze(_n(aa))}var ra,aa,Qb=!1;var Eo=m(()=>{ra={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}},aa=_n(ra)});class ft{static validate(t,n){try{return{success:!0,data:t.parse(n)}}catch(r){if(r instanceof g.ZodError){let o={};return r.errors.forEach((a)=>{let l=a.path.join(".");o[l]=a.message}),{success:!1,errors:o}}return{success:!1,errors:{general:"Validation failed"}}}}static validateField(t,n){try{return t.parse(n),{success:!0}}catch(r){if(r instanceof g.ZodError)return{success:!1,error:r.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 K{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){if(this._customMessage=t,this._customMessage&&this._baseSchema){if(this._fieldType==="string"&&this._baseSchema._def?.minLength)this._baseSchema=g.string().min(this._baseSchema._def.minLength.value,t);else if(this._fieldType==="url")this._baseSchema=g.string().min(1,"URL cannot be empty").url(t);else if(this._fieldType==="email")this._baseSchema=g.string().min(1,"Email cannot be empty").email(t);else if(this._fieldType==="phone")this._baseSchema=g.string().regex(/^[\+]?[1-9][\d]{0,15}$/,t)}return 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 ia(t,n){let r={...n},o=!1;try{o=Dt().validation?.trimStrings===!0}catch{}for(let[a,l]of Object.entries(t)){if(!(l instanceof K))continue;let e=l.getMeta(),b=r[a];if(typeof b==="string"&&(e.trim||o))r[a]=b.trim();if(e.emptyAsNull&&r[a]==="")r[a]=null}return r}function fa(t){let n={};for(let[r,o]of Object.entries(t))if(o instanceof K)n[r]=o.build();else n[r]=o;return g.object(n)}var kn,O,ba;var qn=m(()=>{oa();Eo();kn={login:g.object({email:g.string().min(1,"Email is required").email("Please enter a valid email address"),password:g.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:g.object({name:g.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:g.string().min(1,"Email is required").email("Please enter a valid email address"),password:g.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:g.string()}).refine((t)=>t.password===t.confirmPassword,{message:"Passwords don't match",path:["confirmPassword"]}),auth:{register:g.object({action:g.literal("register"),email:g.string().min(1,"Email is required").email("Please enter a valid email address"),username:g.string().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters"),password:g.string().min(8,"Password must be at least 8 characters"),full_name:g.string().min(2,"Full name is required").max(100,"Full name is too long")}),login:g.object({action:g.literal("login"),email:g.string().min(1,"Email is required").email("Please enter a valid email address"),password:g.string().min(8,"Password must be at least 8 characters")}),logout:g.object({action:g.literal("logout")}),action:g.discriminatedUnion("action",[g.object({action:g.literal("register")}).merge(g.object({email:g.string().min(1,"Email is required").email("Please enter a valid email address"),username:g.string().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters"),password:g.string().min(8,"Password must be at least 8 characters"),full_name:g.string().min(2,"Full name is required").max(100,"Full name is too long")})),g.object({action:g.literal("login")}).merge(g.object({email:g.string().min(1,"Email is required").email("Please enter a valid email address"),password:g.string().min(8,"Password must be at least 8 characters")})),g.object({action:g.literal("logout")})])},contact:g.object({name:g.string().min(2,"Name must be at least 2 characters").max(100,"Name is too long"),email:g.string().email("Please enter a valid email address"),message:g.string().min(10,"Message must be at least 10 characters").max(1000,"Message is too long")}),email:g.string().min(1,"Email is required").email("Please enter a valid email address"),password:g.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,"Password must contain uppercase, lowercase, and number"),phone:g.string().regex(/^[\+]?[1-9][\d]{0,15}$/,"Please enter a valid phone number"),url:g.string().min(1,"URL is required").url("Please enter a valid URL"),required:g.string().min(1,"This field is required"),positiveNumber:g.number().positive("Must be a positive number"),integer:g.number().int("Must be a whole number"),futureDate:g.date().min(new Date,"Date must be in the future"),imageFile:g.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:g.object({full_name:g.string().min(2,"Full name must be at least 2 characters").max(100,"Full name is too long").optional(),bio:g.string().max(500,"Bio must be less than 500 characters").nullable().optional(),avatar_url:g.string().url("Please enter a valid URL").nullable().optional(),theme:g.enum(["africanity","dark","light","system"]).optional(),language:g.string().min(2).max(10).optional()}),project:g.object({name:g.string().min(1,"Project name is required").max(100,"Project name is too long"),description:g.string().max(1000,"Description is too long").nullable().optional(),repository_url:g.string().url("Please enter a valid repository URL").nullable().optional(),demo_url:g.string().url("Please enter a valid demo URL").nullable().optional(),tags:g.array(g.string()).optional(),is_public:g.boolean().optional()})};O={required:(t="This field is required")=>g.string().min(1,t),email:(t="Please enter a valid email address")=>g.string().email(t),minLength:(t,n)=>g.string().min(t,n||`Must be at least ${t} characters`),maxLength:(t,n)=>g.string().max(t,n||`Must be less than ${t} characters`),pattern:(t,n)=>g.string().regex(t,n),numeric:(t="Must be a number")=>g.string().regex(/^\d+$/,t),phone:(t="Please enter a valid phone number")=>g.string().regex(/^[\+]?[1-9][\d]{0,15}$/,t),url:(t="Please enter a valid URL")=>g.string().min(1,"URL is required").url(t)};ba={url(t="Please enter a valid URL"){return new K(g.string().min(1,"URL cannot be empty").url(t),"url")},email(t="Please enter a valid email address"){return new K(g.string().min(1,"Email cannot be empty").email(t),"email")},string(t={}){let n=g.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 K(n,"string")},number(t={}){let n=g.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 K(n,"number")},phone(t="Please enter a valid phone number"){return new K(g.string().regex(/^[\+]?[1-9][\d]{0,15}$/,t),"phone")}}});function h(t,n){if(typeof customElements>"u")return;if(!customElements.get(t))customElements.define(t,n)}var Fb,va,i;var p=m(()=>{Fb=globalThis.HTMLElement??class{},va=typeof CSSStyleSheet<"u";i=class i extends Fb{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=`
431
+ </html>`}function Or(t){if(t instanceof Jo)return t.toString();if(Array.isArray(t))return t.map(Or).join("");if(t===null||t===void 0||t===!1)return"";if(t===!0)return"true";return Ab(t)}var d=(t,...n)=>{let r="";for(let o=0;o<t.length;o++)if(r+=t[o],o<n.length)r+=Or(n[o]);return new Jo(r)};var L,Qo,m,N=(t)=>{switch(typeof t){case"undefined":return m.undefined;case"string":return m.string;case"number":return Number.isNaN(t)?m.nan:m.number;case"boolean":return m.boolean;case"function":return m.function;case"bigint":return m.bigint;case"symbol":return m.symbol;case"object":if(Array.isArray(t))return m.array;if(t===null)return m.null;if(t.then&&typeof t.then==="function"&&t.catch&&typeof t.catch==="function")return m.promise;if(typeof Map<"u"&&t instanceof Map)return m.map;if(typeof Set<"u"&&t instanceof Set)return m.set;if(typeof Date<"u"&&t instanceof Date)return m.date;return m.object;default:return m.unknown}};var Rt=v(()=>{(function(t){t.assertEqual=(a)=>{};function n(a){}t.assertIs=n;function r(a){throw Error()}t.assertNever=r,t.arrayToEnum=(a)=>{let l={};for(let b of a)l[b]=b;return l},t.getValidEnumValues=(a)=>{let l=t.objectKeys(a).filter((e)=>typeof a[a[e]]!=="number"),b={};for(let e of l)b[e]=a[e];return t.objectValues(b)},t.objectValues=(a)=>{return t.objectKeys(a).map(function(l){return a[l]})},t.objectKeys=typeof Object.keys==="function"?(a)=>Object.keys(a):(a)=>{let l=[];for(let b in a)if(Object.prototype.hasOwnProperty.call(a,b))l.push(b);return l},t.find=(a,l)=>{for(let b of a)if(l(b))return b;return},t.isInteger=typeof Number.isInteger==="function"?(a)=>Number.isInteger(a):(a)=>typeof a==="number"&&Number.isFinite(a)&&Math.floor(a)===a;function o(a,l=" | "){return a.map((b)=>typeof b==="string"?`'${b}'`:b).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(a,l)=>{if(typeof l==="bigint")return l.toString();return l}})(L||(L={}));(function(t){t.mergeShapes=(n,r)=>{return{...n,...r}}})(Qo||(Qo={}));m=L.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var c,kb=(t)=>{return JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:")},J;var pn=v(()=>{Rt();c=L.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"]);J=class J extends Error{get errors(){return this.issues}constructor(t){super();this.issues=[],this.addIssue=(r)=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};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(a){return a.message},r={_errors:[]},o=(a)=>{for(let l of a.issues)if(l.code==="invalid_union")l.unionErrors.map(o);else if(l.code==="invalid_return_type")o(l.returnTypeError);else if(l.code==="invalid_arguments")o(l.argumentsError);else if(l.path.length===0)r._errors.push(n(l));else{let b=r,e=0;while(e<l.path.length){let h=l.path[e];if(e!==l.path.length-1)b[h]=b[h]||{_errors:[]};else b[h]=b[h]||{_errors:[]},b[h]._errors.push(n(l));b=b[h],e++}}};return o(this),r}static assert(t){if(!(t instanceof J))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,L.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=(n)=>n.message){let n={},r=[];for(let o of this.issues)if(o.path.length>0){let a=o.path[0];n[a]=n[a]||[],n[a].push(t(o))}else r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};J.create=(t)=>{return new J(t)}});var qb=(t,n)=>{let r;switch(t.code){case c.invalid_type:if(t.received===m.undefined)r="Required";else r=`Expected ${t.expected}, received ${t.received}`;break;case c.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,L.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:r=`Unrecognized key(s) in object: ${L.joinValues(t.keys,", ")}`;break;case c.invalid_union:r="Invalid input";break;case c.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${L.joinValues(t.options)}`;break;case c.invalid_enum_value:r=`Invalid enum value. Expected ${L.joinValues(t.options)}, received '${t.received}'`;break;case c.invalid_arguments:r="Invalid function arguments";break;case c.invalid_return_type:r="Invalid function return type";break;case c.invalid_date:r="Invalid date";break;case c.invalid_string:if(typeof t.validation==="object")if("includes"in t.validation){if(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position==="number")r=`${r} at one or more positions greater than or equal to ${t.validation.position}`}else if("startsWith"in t.validation)r=`Invalid input: must start with "${t.validation.startsWith}"`;else if("endsWith"in t.validation)r=`Invalid input: must end with "${t.validation.endsWith}"`;else L.assertNever(t.validation);else if(t.validation!=="regex")r=`Invalid ${t.validation}`;else r="Invalid";break;case c.too_small:if(t.type==="array")r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`;else if(t.type==="string")r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`;else if(t.type==="number")r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="bigint")r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="date")r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`;else r="Invalid input";break;case c.too_big:if(t.type==="array")r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`;else if(t.type==="string")r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`;else if(t.type==="number")r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="bigint")r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="date")r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`;else r="Invalid input";break;case c.custom:r="Invalid input";break;case c.invalid_intersection_types:r="Intersection results could not be merged";break;case c.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case c.not_finite:r="Number must be finite";break;default:r=n.defaultError,L.assertNever(t)}return{message:r}},C;var Go=v(()=>{pn();Rt();C=qb});function Lb(t){Ur=t}function ct(){return Ur}var Ur;var un=v(()=>{Go();Ur=C});function $(t,n){let r=ct(),o=Xt({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===C?void 0:C].filter((a)=>!!a)});t.common.issues.push(o)}class X{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 r=[];for(let o of n){if(o.status==="aborted")return x;if(o.status==="dirty")t.dirty();r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){let r=[];for(let o of n){let a=await o.key,l=await o.value;r.push({key:a,value:l})}return X.mergeObjectSync(t,r)}static mergeObjectSync(t,n){let r={};for(let o of n){let{key:a,value:l}=o;if(a.status==="aborted")return x;if(l.status==="aborted")return x;if(a.status==="dirty")t.dirty();if(l.status==="dirty")t.dirty();if(a.value!=="__proto__"&&(typeof l.value<"u"||o.alwaysSet))r[a.value]=l.value}return{status:t.value,value:r}}}var Xt=(t)=>{let{data:n,path:r,errorMaps:o,issueData:a}=t,l=[...r,...a.path||[]],b={...a,path:l};if(a.message!==void 0)return{...a,path:l,message:a.message};let e="",h=o.filter((u)=>!!u).slice().reverse();for(let u of h)e=u(b,{data:n,defaultError:e}).message;return{...a,path:l,message:e}},Hb,x,ot=(t)=>({status:"dirty",value:t}),S=(t)=>({status:"valid",value:t}),wn=(t)=>t.status==="aborted",sn=(t)=>t.status==="dirty",T=(t)=>t.status==="valid",dt=(t)=>typeof Promise<"u"&&t instanceof Promise;var Fo=v(()=>{un();Go();Hb=[];x=Object.freeze({status:"aborted"})});var Nr=()=>{};var s;var Vr=v(()=>{(function(t){t.errToObj=(n)=>typeof n==="string"?{message:n}:n||{},t.toString=(n)=>typeof n==="string"?n:n?.message})(s||(s={}))});class W{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}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 A(t){if(!t)return{};let{errorMap:n,invalid_type_error:r,required_error:o,description:a}=t;if(n&&(r||o))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(n)return{errorMap:n,description:a};return{errorMap:(b,e)=>{let{message:h}=t;if(b.code==="invalid_enum_value")return{message:h??e.defaultError};if(typeof e.data>"u")return{message:h??o??e.defaultError};if(b.code!=="invalid_type")return{message:e.defaultError};return{message:h??r??e.defaultError}},description:a}}class k{get description(){return this._def.description}_getType(t){return N(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:N(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new X,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(dt(n))throw Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:N(t)},o=this._parseSync({data:t,path:r.path,parent:r});return Kr(r,o)}"~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 r=this._parseSync({data:t,path:[],parent:n});return T(r)?{value:r.value}:{issues:n.common.issues}}catch(r){if(r?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then((r)=>T(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(t,n){let r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:N(t)},o=this._parse({data:t,path:r.path,parent:r}),a=await(dt(o)?o:Promise.resolve(o));return Kr(r,a)}refine(t,n){let r=(o)=>{if(typeof n==="string"||typeof n>"u")return{message:n};else if(typeof n==="function")return n(o);else return n};return this._refinement((o,a)=>{let l=t(o),b=()=>a.addIssue({code:c.custom,...r(o)});if(typeof Promise<"u"&&l instanceof Promise)return l.then((e)=>{if(!e)return b(),!1;else return!0});if(!l)return b(),!1;else return!0})}refinement(t,n){return this._refinement((r,o)=>{if(!t(r))return o.addIssue(typeof n==="function"?n(r,o):n),!1;else return!0})}_refinement(t){return new O({schema:this,typeName:_.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 E.create(this,this._def)}nullable(){return P.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return D.create(this)}promise(){return bt.create(this,this._def)}or(t){return ut.create([this,t],this._def)}and(t){return wt.create(this,t,this._def)}transform(t){return new O({...A(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t==="function"?t:()=>t;return new At({...A(this._def),innerType:this,defaultValue:n,typeName:_.ZodDefault})}brand(){return new _n({typeName:_.ZodBranded,type:this,...A(this._def)})}catch(t){let n=typeof t==="function"?t:()=>t;return new kt({...A(this._def),innerType:this,catchValue:n,typeName:_.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return Ft.create(this,t)}readonly(){return qt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Cr(t){let n="[0-5]\\d";if(t.precision)n=`${n}\\.\\d{${t.precision}}`;else if(t.precision==null)n=`${n}(\\.\\d+)?`;let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${n})${r}`}function Vb(t){return new RegExp(`^${Cr(t)}$`)}function Ir(t){let n=`${jr}T${Cr(t)}`,r=[];if(r.push(t.local?"Z?":"Z"),t.offset)r.push("([+-]\\d{2}:?\\d{2})");return n=`${n}(${r.join("|")})`,new RegExp(`^${n}$`)}function Kb(t,n){if((n==="v4"||!n)&&Bb.test(t))return!0;if((n==="v6"||!n)&&Eb.test(t))return!0;return!1}function yb(t,n){if(!Jb.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let o=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(o));if(typeof a!=="object"||a===null)return!1;if("typ"in a&&a?.typ!=="JWT")return!1;if(!a.alg)return!1;if(n&&a.alg!==n)return!1;return!0}catch{return!1}}function jb(t,n){if((n==="v4"||!n)&&Db.test(t))return!0;if((n==="v6"||!n)&&Wb.test(t))return!0;return!1}function Cb(t,n){let r=(t.toString().split(".")[1]||"").length,o=(n.toString().split(".")[1]||"").length,a=r>o?r:o,l=Number.parseInt(t.toFixed(a).replace(".","")),b=Number.parseInt(n.toFixed(a).replace(".",""));return l%b/10**a}function gt(t){if(t instanceof H){let n={};for(let r in t.shape){let o=t.shape[r];n[r]=E.create(gt(o))}return new H({...t._def,shape:()=>n})}else if(t instanceof D)return new D({...t._def,type:gt(t.element)});else if(t instanceof E)return E.create(gt(t.unwrap()));else if(t instanceof P)return P.create(gt(t.unwrap()));else if(t instanceof K)return K.create(t.items.map((n)=>gt(n)));else return t}function Do(t,n){let r=N(t),o=N(n);if(t===n)return{valid:!0,data:t};else if(r===m.object&&o===m.object){let a=L.objectKeys(n),l=L.objectKeys(t).filter((e)=>a.indexOf(e)!==-1),b={...t,...n};for(let e of l){let h=Do(t[e],n[e]);if(!h.valid)return{valid:!1};b[e]=h.data}return{valid:!0,data:b}}else if(r===m.array&&o===m.array){if(t.length!==n.length)return{valid:!1};let a=[];for(let l=0;l<t.length;l++){let b=t[l],e=n[l],h=Do(b,e);if(!h.valid)return{valid:!1};a.push(h.data)}return{valid:!0,data:a}}else if(r===m.date&&o===m.date&&+t===+n)return{valid:!0,data:t};else return{valid:!1}}function Pr(t,n){return new nt({values:t,typeName:_.ZodEnum,...A(n)})}function yr(t,n){let r=typeof t==="function"?t(n):typeof t==="string"?{message:t}:t;return typeof r==="string"?{message:r}:r}function Tr(t,n={},r){if(t)return at.create().superRefine((o,a)=>{let l=t(o);if(l instanceof Promise)return l.then((b)=>{if(!b){let e=yr(n,o),h=e.fatal??r??!0;a.addIssue({code:"custom",...e,fatal:h})}});if(!l){let b=yr(n,o),e=b.fatal??r??!0;a.addIssue({code:"custom",...b,fatal:e})}return});return at.create()}var Kr=(t,n)=>{if(T(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 r=new J(t.common.issues);return this._error=r,this._error}}}},Mb,Rb,Xb,Sb,Yb,Jb,Qb,Gb,Fb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Bo,Bb,Db,Eb,Wb,Ob,Ub,jr="((\\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])))",Nb,B,z,tt,vt,rt,St,$t,pt,at,Z,V,Yt,D,H,ut,I=(t)=>{if(t instanceof st)return I(t.schema);else if(t instanceof O)return I(t.innerType());else if(t instanceof xt)return[t.value];else if(t instanceof nt)return t.options;else if(t instanceof _t)return L.objectValues(t.enum);else if(t instanceof At)return I(t._def.innerType);else if(t instanceof $t)return[void 0];else if(t instanceof pt)return[null];else if(t instanceof E)return[void 0,...I(t.unwrap())];else if(t instanceof P)return[null,...I(t.unwrap())];else if(t instanceof _n)return I(t.unwrap());else if(t instanceof qt)return I(t.unwrap());else if(t instanceof kt)return I(t._def.innerType);else return[]},xn,wt,K,Jt,Qt,lt,mt,st,xt,nt,_t,bt,O,E,P,At,kt,Gt,Ib,_n,Ft,qt,Pb,_,Tb=(t,n={message:`Input not instance of ${t.name}`})=>Tr((r)=>r instanceof t,n),Zr,zr,Zb,zb,ta,te,ne,oe,re,ae,le,be,ee,fe,he,ie,ce,de,ge,me,ve,$e,pe,ue,we,se,xe,_e,Ae,ke,qe,Le,He,Me,Re=()=>Zr().optional(),Xe=()=>zr().optional(),Se=()=>ta().optional(),Ye,Je;var na=v(()=>{pn();un();Vr();Fo();Rt();Mb=/^c[^\s-]{8,}$/i,Rb=/^[0-9a-z]+$/,Xb=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Sb=/^[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,Yb=/^[a-z0-9_-]{21}$/i,Jb=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Qb=/^[-+]?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)?)??$/,Gb=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Bb=/^(?:(?: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])$/,Db=/^(?:(?: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]))$/,Wb=/^(([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])$/,Ob=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ub=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Nb=new RegExp(`^${jr}$`);B=class B extends k{_parse(t){if(this._def.coerce)t.data=String(t.data);if(this._getType(t)!==m.string){let a=this._getOrReturnCtx(t);return $(a,{code:c.invalid_type,expected:m.string,received:a.parsedType}),x}let r=new X,o=void 0;for(let a of this._def.checks)if(a.kind==="min"){if(t.data.length<a.value)o=this._getOrReturnCtx(t,o),$(o,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty()}else if(a.kind==="max"){if(t.data.length>a.value)o=this._getOrReturnCtx(t,o),$(o,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty()}else if(a.kind==="length"){let l=t.data.length>a.value,b=t.data.length<a.value;if(l||b){if(o=this._getOrReturnCtx(t,o),l)$(o,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message});else if(b)$(o,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message});r.dirty()}}else if(a.kind==="email"){if(!Gb.test(t.data))o=this._getOrReturnCtx(t,o),$(o,{validation:"email",code:c.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="emoji"){if(!Bo)Bo=new RegExp(Fb,"u");if(!Bo.test(t.data))o=this._getOrReturnCtx(t,o),$(o,{validation:"emoji",code:c.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="uuid"){if(!Sb.test(t.data))o=this._getOrReturnCtx(t,o),$(o,{validation:"uuid",code:c.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="nanoid"){if(!Yb.test(t.data))o=this._getOrReturnCtx(t,o),$(o,{validation:"nanoid",code:c.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="cuid"){if(!Mb.test(t.data))o=this._getOrReturnCtx(t,o),$(o,{validation:"cuid",code:c.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="cuid2"){if(!Rb.test(t.data))o=this._getOrReturnCtx(t,o),$(o,{validation:"cuid2",code:c.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="ulid"){if(!Xb.test(t.data))o=this._getOrReturnCtx(t,o),$(o,{validation:"ulid",code:c.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),$(o,{validation:"url",code:c.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="regex"){if(a.regex.lastIndex=0,!a.regex.test(t.data))o=this._getOrReturnCtx(t,o),$(o,{validation:"regex",code:c.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="trim")t.data=t.data.trim();else if(a.kind==="includes"){if(!t.data.includes(a.value,a.position))o=this._getOrReturnCtx(t,o),$(o,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()}else if(a.kind==="toLowerCase")t.data=t.data.toLowerCase();else if(a.kind==="toUpperCase")t.data=t.data.toUpperCase();else if(a.kind==="startsWith"){if(!t.data.startsWith(a.value))o=this._getOrReturnCtx(t,o),$(o,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()}else if(a.kind==="endsWith"){if(!t.data.endsWith(a.value))o=this._getOrReturnCtx(t,o),$(o,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()}else if(a.kind==="datetime"){if(!Ir(a).test(t.data))o=this._getOrReturnCtx(t,o),$(o,{code:c.invalid_string,validation:"datetime",message:a.message}),r.dirty()}else if(a.kind==="date"){if(!Nb.test(t.data))o=this._getOrReturnCtx(t,o),$(o,{code:c.invalid_string,validation:"date",message:a.message}),r.dirty()}else if(a.kind==="time"){if(!Vb(a).test(t.data))o=this._getOrReturnCtx(t,o),$(o,{code:c.invalid_string,validation:"time",message:a.message}),r.dirty()}else if(a.kind==="duration"){if(!Qb.test(t.data))o=this._getOrReturnCtx(t,o),$(o,{validation:"duration",code:c.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="ip"){if(!Kb(t.data,a.version))o=this._getOrReturnCtx(t,o),$(o,{validation:"ip",code:c.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="jwt"){if(!yb(t.data,a.alg))o=this._getOrReturnCtx(t,o),$(o,{validation:"jwt",code:c.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="cidr"){if(!jb(t.data,a.version))o=this._getOrReturnCtx(t,o),$(o,{validation:"cidr",code:c.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="base64"){if(!Ob.test(t.data))o=this._getOrReturnCtx(t,o),$(o,{validation:"base64",code:c.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="base64url"){if(!Ub.test(t.data))o=this._getOrReturnCtx(t,o),$(o,{validation:"base64url",code:c.invalid_string,message:a.message}),r.dirty()}else L.assertNever(a);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement((o)=>t.test(o),{validation:n,code:c.invalid_string,...s.errToObj(r)})}_addCheck(t){return new B({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...s.errToObj(t)})}url(t){return this._addCheck({kind:"url",...s.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...s.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...s.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...s.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...s.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...s.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...s.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...s.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...s.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...s.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...s.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...s.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,...s.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,...s.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...s.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...s.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...s.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...s.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...s.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...s.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...s.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...s.errToObj(n)})}nonempty(t){return this.min(1,s.errToObj(t))}trim(){return new B({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new B({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new B({...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}};B.create=(t)=>{return new B({checks:[],typeName:_.ZodString,coerce:t?.coerce??!1,...A(t)})};z=class z extends k{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce)t.data=Number(t.data);if(this._getType(t)!==m.number){let a=this._getOrReturnCtx(t);return $(a,{code:c.invalid_type,expected:m.number,received:a.parsedType}),x}let r=void 0,o=new X;for(let a of this._def.checks)if(a.kind==="int"){if(!L.isInteger(t.data))r=this._getOrReturnCtx(t,r),$(r,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()}else if(a.kind==="min"){if(a.inclusive?t.data<a.value:t.data<=a.value)r=this._getOrReturnCtx(t,r),$(r,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()}else if(a.kind==="max"){if(a.inclusive?t.data>a.value:t.data>=a.value)r=this._getOrReturnCtx(t,r),$(r,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()}else if(a.kind==="multipleOf"){if(Cb(t.data,a.value)!==0)r=this._getOrReturnCtx(t,r),$(r,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()}else if(a.kind==="finite"){if(!Number.isFinite(t.data))r=this._getOrReturnCtx(t,r),$(r,{code:c.not_finite,message:a.message}),o.dirty()}else L.assertNever(a);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,s.toString(n))}gt(t,n){return this.setLimit("min",t,!1,s.toString(n))}lte(t,n){return this.setLimit("max",t,!0,s.toString(n))}lt(t,n){return this.setLimit("max",t,!1,s.toString(n))}setLimit(t,n,r,o){return new z({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:s.toString(o)}]})}_addCheck(t){return new z({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:s.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:s.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:s.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:s.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:s.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:s.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:s.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:s.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:s.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"&&L.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let r of this._def.checks)if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;else if(r.kind==="min"){if(n===null||r.value>n)n=r.value}else if(r.kind==="max"){if(t===null||r.value<t)t=r.value}return Number.isFinite(n)&&Number.isFinite(t)}};z.create=(t)=>{return new z({checks:[],typeName:_.ZodNumber,coerce:t?.coerce||!1,...A(t)})};tt=class tt extends k{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==m.bigint)return this._getInvalidInput(t);let r=void 0,o=new X;for(let a of this._def.checks)if(a.kind==="min"){if(a.inclusive?t.data<a.value:t.data<=a.value)r=this._getOrReturnCtx(t,r),$(r,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()}else if(a.kind==="max"){if(a.inclusive?t.data>a.value:t.data>=a.value)r=this._getOrReturnCtx(t,r),$(r,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()}else if(a.kind==="multipleOf"){if(t.data%a.value!==BigInt(0))r=this._getOrReturnCtx(t,r),$(r,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()}else L.assertNever(a);return{status:o.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return $(n,{code:c.invalid_type,expected:m.bigint,received:n.parsedType}),x}gte(t,n){return this.setLimit("min",t,!0,s.toString(n))}gt(t,n){return this.setLimit("min",t,!1,s.toString(n))}lte(t,n){return this.setLimit("max",t,!0,s.toString(n))}lt(t,n){return this.setLimit("max",t,!1,s.toString(n))}setLimit(t,n,r,o){return new tt({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:s.toString(o)}]})}_addCheck(t){return new tt({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:s.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:s.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:s.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:s.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:s.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}};tt.create=(t)=>{return new tt({checks:[],typeName:_.ZodBigInt,coerce:t?.coerce??!1,...A(t)})};vt=class vt extends k{_parse(t){if(this._def.coerce)t.data=Boolean(t.data);if(this._getType(t)!==m.boolean){let r=this._getOrReturnCtx(t);return $(r,{code:c.invalid_type,expected:m.boolean,received:r.parsedType}),x}return S(t.data)}};vt.create=(t)=>{return new vt({typeName:_.ZodBoolean,coerce:t?.coerce||!1,...A(t)})};rt=class rt extends k{_parse(t){if(this._def.coerce)t.data=new Date(t.data);if(this._getType(t)!==m.date){let a=this._getOrReturnCtx(t);return $(a,{code:c.invalid_type,expected:m.date,received:a.parsedType}),x}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return $(a,{code:c.invalid_date}),x}let r=new X,o=void 0;for(let a of this._def.checks)if(a.kind==="min"){if(t.data.getTime()<a.value)o=this._getOrReturnCtx(t,o),$(o,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()}else if(a.kind==="max"){if(t.data.getTime()>a.value)o=this._getOrReturnCtx(t,o),$(o,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()}else L.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new rt({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:s.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:s.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}};rt.create=(t)=>{return new rt({checks:[],coerce:t?.coerce||!1,typeName:_.ZodDate,...A(t)})};St=class St extends k{_parse(t){if(this._getType(t)!==m.symbol){let r=this._getOrReturnCtx(t);return $(r,{code:c.invalid_type,expected:m.symbol,received:r.parsedType}),x}return S(t.data)}};St.create=(t)=>{return new St({typeName:_.ZodSymbol,...A(t)})};$t=class $t extends k{_parse(t){if(this._getType(t)!==m.undefined){let r=this._getOrReturnCtx(t);return $(r,{code:c.invalid_type,expected:m.undefined,received:r.parsedType}),x}return S(t.data)}};$t.create=(t)=>{return new $t({typeName:_.ZodUndefined,...A(t)})};pt=class pt extends k{_parse(t){if(this._getType(t)!==m.null){let r=this._getOrReturnCtx(t);return $(r,{code:c.invalid_type,expected:m.null,received:r.parsedType}),x}return S(t.data)}};pt.create=(t)=>{return new pt({typeName:_.ZodNull,...A(t)})};at=class at extends k{constructor(){super(...arguments);this._any=!0}_parse(t){return S(t.data)}};at.create=(t)=>{return new at({typeName:_.ZodAny,...A(t)})};Z=class Z extends k{constructor(){super(...arguments);this._unknown=!0}_parse(t){return S(t.data)}};Z.create=(t)=>{return new Z({typeName:_.ZodUnknown,...A(t)})};V=class V extends k{_parse(t){let n=this._getOrReturnCtx(t);return $(n,{code:c.invalid_type,expected:m.never,received:n.parsedType}),x}};V.create=(t)=>{return new V({typeName:_.ZodNever,...A(t)})};Yt=class Yt extends k{_parse(t){if(this._getType(t)!==m.undefined){let r=this._getOrReturnCtx(t);return $(r,{code:c.invalid_type,expected:m.void,received:r.parsedType}),x}return S(t.data)}};Yt.create=(t)=>{return new Yt({typeName:_.ZodVoid,...A(t)})};D=class D extends k{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==m.array)return $(n,{code:c.invalid_type,expected:m.array,received:n.parsedType}),x;if(o.exactLength!==null){let l=n.data.length>o.exactLength.value,b=n.data.length<o.exactLength.value;if(l||b)$(n,{code:l?c.too_big:c.too_small,minimum:b?o.exactLength.value:void 0,maximum:l?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty()}if(o.minLength!==null){if(n.data.length<o.minLength.value)$(n,{code:c.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()}if(o.maxLength!==null){if(n.data.length>o.maxLength.value)$(n,{code:c.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()}if(n.common.async)return Promise.all([...n.data].map((l,b)=>{return o.type._parseAsync(new W(n,l,n.path,b))})).then((l)=>{return X.mergeArray(r,l)});let a=[...n.data].map((l,b)=>{return o.type._parseSync(new W(n,l,n.path,b))});return X.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new D({...this._def,minLength:{value:t,message:s.toString(n)}})}max(t,n){return new D({...this._def,maxLength:{value:t,message:s.toString(n)}})}length(t,n){return new D({...this._def,exactLength:{value:t,message:s.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:_.ZodArray,...A(n)})};H=class H extends k{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=L.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==m.object){let h=this._getOrReturnCtx(t);return $(h,{code:c.invalid_type,expected:m.object,received:h.parsedType}),x}let{status:r,ctx:o}=this._processInputParams(t),{shape:a,keys:l}=this._getCached(),b=[];if(!(this._def.catchall instanceof V&&this._def.unknownKeys==="strip")){for(let h in o.data)if(!l.includes(h))b.push(h)}let e=[];for(let h of l){let u=a[h],q=o.data[h];e.push({key:{status:"valid",value:h},value:u._parse(new W(o,q,o.path,h)),alwaysSet:h in o.data})}if(this._def.catchall instanceof V){let h=this._def.unknownKeys;if(h==="passthrough")for(let u of b)e.push({key:{status:"valid",value:u},value:{status:"valid",value:o.data[u]}});else if(h==="strict"){if(b.length>0)$(o,{code:c.unrecognized_keys,keys:b}),r.dirty()}else if(h==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let h=this._def.catchall;for(let u of b){let q=o.data[u];e.push({key:{status:"valid",value:u},value:h._parse(new W(o,q,o.path,u)),alwaysSet:u in o.data})}}if(o.common.async)return Promise.resolve().then(async()=>{let h=[];for(let u of e){let q=await u.key,R=await u.value;h.push({key:q,value:R,alwaysSet:u.alwaysSet})}return h}).then((h)=>{return X.mergeObjectSync(r,h)});else return X.mergeObjectSync(r,e)}get shape(){return this._def.shape()}strict(t){return s.errToObj,new H({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{let o=this._def.errorMap?.(n,r).message??r.defaultError;if(n.code==="unrecognized_keys")return{message:s.errToObj(t).message??o};return{message:o}}}:{}})}strip(){return new H({...this._def,unknownKeys:"strip"})}passthrough(){return new H({...this._def,unknownKeys:"passthrough"})}extend(t){return new H({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new H({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:_.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new H({...this._def,catchall:t})}pick(t){let n={};for(let r of L.objectKeys(t))if(t[r]&&this.shape[r])n[r]=this.shape[r];return new H({...this._def,shape:()=>n})}omit(t){let n={};for(let r of L.objectKeys(this.shape))if(!t[r])n[r]=this.shape[r];return new H({...this._def,shape:()=>n})}deepPartial(){return gt(this)}partial(t){let n={};for(let r of L.objectKeys(this.shape)){let o=this.shape[r];if(t&&!t[r])n[r]=o;else n[r]=o.optional()}return new H({...this._def,shape:()=>n})}required(t){let n={};for(let r of L.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];while(a instanceof E)a=a._def.innerType;n[r]=a}return new H({...this._def,shape:()=>n})}keyof(){return Pr(L.objectKeys(this.shape))}};H.create=(t,n)=>{return new H({shape:()=>t,unknownKeys:"strip",catchall:V.create(),typeName:_.ZodObject,...A(n)})};H.strictCreate=(t,n)=>{return new H({shape:()=>t,unknownKeys:"strict",catchall:V.create(),typeName:_.ZodObject,...A(n)})};H.lazycreate=(t,n)=>{return new H({shape:t,unknownKeys:"strip",catchall:V.create(),typeName:_.ZodObject,...A(n)})};ut=class ut extends k{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;function o(a){for(let b of a)if(b.result.status==="valid")return b.result;for(let b of a)if(b.result.status==="dirty")return n.common.issues.push(...b.ctx.common.issues),b.result;let l=a.map((b)=>new J(b.ctx.common.issues));return $(n,{code:c.invalid_union,unionErrors:l}),x}if(n.common.async)return Promise.all(r.map(async(a)=>{let l={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:l}),ctx:l}})).then(o);else{let a=void 0,l=[];for(let e of r){let h={...n,common:{...n.common,issues:[]},parent:null},u=e._parseSync({data:n.data,path:n.path,parent:h});if(u.status==="valid")return u;else if(u.status==="dirty"&&!a)a={result:u,ctx:h};if(h.common.issues.length)l.push(h.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;let b=l.map((e)=>new J(e));return $(n,{code:c.invalid_union,unionErrors:b}),x}}get options(){return this._def.options}};ut.create=(t,n)=>{return new ut({options:t,typeName:_.ZodUnion,...A(n)})};xn=class xn extends k{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==m.object)return $(n,{code:c.invalid_type,expected:m.object,received:n.parsedType}),x;let r=this.discriminator,o=n.data[r],a=this.optionsMap.get(o);if(!a)return $(n,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),x;if(n.common.async)return a._parseAsync({data:n.data,path:n.path,parent:n});else return a._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,r){let o=new Map;for(let a of n){let l=I(a.shape[t]);if(!l.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let b of l){if(o.has(b))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(b)}`);o.set(b,a)}}return new xn({typeName:_.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...A(r)})}};wt=class wt extends k{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),o=(a,l)=>{if(wn(a)||wn(l))return x;let b=Do(a.value,l.value);if(!b.valid)return $(r,{code:c.invalid_intersection_types}),x;if(sn(a)||sn(l))n.dirty();return{status:n.value,value:b.data}};if(r.common.async)return Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,l])=>o(a,l));else return o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};wt.create=(t,n,r)=>{return new wt({left:t,right:n,typeName:_.ZodIntersection,...A(r)})};K=class K extends k{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==m.array)return $(r,{code:c.invalid_type,expected:m.array,received:r.parsedType}),x;if(r.data.length<this._def.items.length)return $(r,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;if(!this._def.rest&&r.data.length>this._def.items.length)$(r,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty();let a=[...r.data].map((l,b)=>{let e=this._def.items[b]||this._def.rest;if(!e)return null;return e._parse(new W(r,l,r.path,b))}).filter((l)=>!!l);if(r.common.async)return Promise.all(a).then((l)=>{return X.mergeArray(n,l)});else return X.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new K({...this._def,rest:t})}};K.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new K({items:t,typeName:_.ZodTuple,rest:null,...A(n)})};Jt=class Jt extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==m.object)return $(r,{code:c.invalid_type,expected:m.object,received:r.parsedType}),x;let o=[],a=this._def.keyType,l=this._def.valueType;for(let b in r.data)o.push({key:a._parse(new W(r,b,r.path,b)),value:l._parse(new W(r,r.data[b],r.path,b)),alwaysSet:b in r.data});if(r.common.async)return X.mergeObjectAsync(n,o);else return X.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){if(n instanceof k)return new Jt({keyType:t,valueType:n,typeName:_.ZodRecord,...A(r)});return new Jt({keyType:B.create(),valueType:t,typeName:_.ZodRecord,...A(n)})}};Qt=class Qt extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==m.map)return $(r,{code:c.invalid_type,expected:m.map,received:r.parsedType}),x;let o=this._def.keyType,a=this._def.valueType,l=[...r.data.entries()].map(([b,e],h)=>{return{key:o._parse(new W(r,b,r.path,[h,"key"])),value:a._parse(new W(r,e,r.path,[h,"value"]))}});if(r.common.async){let b=new Map;return Promise.resolve().then(async()=>{for(let e of l){let h=await e.key,u=await e.value;if(h.status==="aborted"||u.status==="aborted")return x;if(h.status==="dirty"||u.status==="dirty")n.dirty();b.set(h.value,u.value)}return{status:n.value,value:b}})}else{let b=new Map;for(let e of l){let{key:h,value:u}=e;if(h.status==="aborted"||u.status==="aborted")return x;if(h.status==="dirty"||u.status==="dirty")n.dirty();b.set(h.value,u.value)}return{status:n.value,value:b}}}};Qt.create=(t,n,r)=>{return new Qt({valueType:n,keyType:t,typeName:_.ZodMap,...A(r)})};lt=class lt extends k{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==m.set)return $(r,{code:c.invalid_type,expected:m.set,received:r.parsedType}),x;let o=this._def;if(o.minSize!==null){if(r.data.size<o.minSize.value)$(r,{code:c.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()}if(o.maxSize!==null){if(r.data.size>o.maxSize.value)$(r,{code:c.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty()}let a=this._def.valueType;function l(e){let h=new Set;for(let u of e){if(u.status==="aborted")return x;if(u.status==="dirty")n.dirty();h.add(u.value)}return{status:n.value,value:h}}let b=[...r.data.values()].map((e,h)=>a._parse(new W(r,e,r.path,h)));if(r.common.async)return Promise.all(b).then((e)=>l(e));else return l(b)}min(t,n){return new lt({...this._def,minSize:{value:t,message:s.toString(n)}})}max(t,n){return new lt({...this._def,maxSize:{value:t,message:s.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};lt.create=(t,n)=>{return new lt({valueType:t,minSize:null,maxSize:null,typeName:_.ZodSet,...A(n)})};mt=class mt extends k{constructor(){super(...arguments);this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==m.function)return $(n,{code:c.invalid_type,expected:m.function,received:n.parsedType}),x;function r(b,e){return Xt({data:b,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ct(),C].filter((h)=>!!h),issueData:{code:c.invalid_arguments,argumentsError:e}})}function o(b,e){return Xt({data:b,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ct(),C].filter((h)=>!!h),issueData:{code:c.invalid_return_type,returnTypeError:e}})}let a={errorMap:n.common.contextualErrorMap},l=n.data;if(this._def.returns instanceof bt){let b=this;return S(async function(...e){let h=new J([]),u=await b._def.args.parseAsync(e,a).catch((M)=>{throw h.addIssue(r(e,M)),h}),q=await Reflect.apply(l,this,u);return await b._def.returns._def.type.parseAsync(q,a).catch((M)=>{throw h.addIssue(o(q,M)),h})})}else{let b=this;return S(function(...e){let h=b._def.args.safeParse(e,a);if(!h.success)throw new J([r(e,h.error)]);let u=Reflect.apply(l,this,h.data),q=b._def.returns.safeParse(u,a);if(!q.success)throw new J([o(u,q.error)]);return q.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new mt({...this._def,args:K.create(t).rest(Z.create())})}returns(t){return new mt({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new mt({args:t?t:K.create([]).rest(Z.create()),returns:n||Z.create(),typeName:_.ZodFunction,...A(r)})}};st=class st extends k{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};st.create=(t,n)=>{return new st({getter:t,typeName:_.ZodLazy,...A(n)})};xt=class xt extends k{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return $(n,{received:n.data,code:c.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:t.data}}get value(){return this._def.value}};xt.create=(t,n)=>{return new xt({value:t,typeName:_.ZodLiteral,...A(n)})};nt=class nt extends k{_parse(t){if(typeof t.data!=="string"){let n=this._getOrReturnCtx(t),r=this._def.values;return $(n,{expected:L.joinValues(r),received:n.parsedType,code:c.invalid_type}),x}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),r=this._def.values;return $(n,{received:n.data,code:c.invalid_enum_value,options:r}),x}return S(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 nt.create(t,{...this._def,...n})}exclude(t,n=this._def){return nt.create(this.options.filter((r)=>!t.includes(r)),{...this._def,...n})}};nt.create=Pr;_t=class _t extends k{_parse(t){let n=L.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==m.string&&r.parsedType!==m.number){let o=L.objectValues(n);return $(r,{expected:L.joinValues(o),received:r.parsedType,code:c.invalid_type}),x}if(!this._cache)this._cache=new Set(L.getValidEnumValues(this._def.values));if(!this._cache.has(t.data)){let o=L.objectValues(n);return $(r,{received:r.data,code:c.invalid_enum_value,options:o}),x}return S(t.data)}get enum(){return this._def.values}};_t.create=(t,n)=>{return new _t({values:t,typeName:_.ZodNativeEnum,...A(n)})};bt=class bt extends k{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==m.promise&&n.common.async===!1)return $(n,{code:c.invalid_type,expected:m.promise,received:n.parsedType}),x;let r=n.parsedType===m.promise?n.data:Promise.resolve(n.data);return S(r.then((o)=>{return this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})}))}};bt.create=(t,n)=>{return new bt({type:t,typeName:_.ZodPromise,...A(n)})};O=class O extends k{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,a={addIssue:(l)=>{if($(r,l),l.fatal)n.abort();else n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){let l=o.transform(r.data,a);if(r.common.async)return Promise.resolve(l).then(async(b)=>{if(n.value==="aborted")return x;let e=await this._def.schema._parseAsync({data:b,path:r.path,parent:r});if(e.status==="aborted")return x;if(e.status==="dirty")return ot(e.value);if(n.value==="dirty")return ot(e.value);return e});else{if(n.value==="aborted")return x;let b=this._def.schema._parseSync({data:l,path:r.path,parent:r});if(b.status==="aborted")return x;if(b.status==="dirty")return ot(b.value);if(n.value==="dirty")return ot(b.value);return b}}if(o.type==="refinement"){let l=(b)=>{let e=o.refinement(b,a);if(r.common.async)return Promise.resolve(e);if(e instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return b};if(r.common.async===!1){let b=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(b.status==="aborted")return x;if(b.status==="dirty")n.dirty();return l(b.value),{status:n.value,value:b.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((b)=>{if(b.status==="aborted")return x;if(b.status==="dirty")n.dirty();return l(b.value).then(()=>{return{status:n.value,value:b.value}})})}if(o.type==="transform")if(r.common.async===!1){let l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!T(l))return x;let b=o.transform(l.value,a);if(b instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:b}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((l)=>{if(!T(l))return x;return Promise.resolve(o.transform(l.value,a)).then((b)=>({status:n.value,value:b}))});L.assertNever(o)}};O.create=(t,n,r)=>{return new O({schema:t,typeName:_.ZodEffects,effect:n,...A(r)})};O.createWithPreprocess=(t,n,r)=>{return new O({schema:n,effect:{type:"preprocess",transform:t},typeName:_.ZodEffects,...A(r)})};E=class E extends k{_parse(t){if(this._getType(t)===m.undefined)return S(void 0);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};E.create=(t,n)=>{return new E({innerType:t,typeName:_.ZodOptional,...A(n)})};P=class P extends k{_parse(t){if(this._getType(t)===m.null)return S(null);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};P.create=(t,n)=>{return new P({innerType:t,typeName:_.ZodNullable,...A(n)})};At=class At extends k{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;if(n.parsedType===m.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};At.create=(t,n)=>{return new At({innerType:t,typeName:_.ZodDefault,defaultValue:typeof n.default==="function"?n.default:()=>n.default,...A(n)})};kt=class kt extends k{_parse(t){let{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});if(dt(o))return o.then((a)=>{return{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new J(r.common.issues)},input:r.data})}});else return{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new J(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};kt.create=(t,n)=>{return new kt({innerType:t,typeName:_.ZodCatch,catchValue:typeof n.catch==="function"?n.catch:()=>n.catch,...A(n)})};Gt=class Gt extends k{_parse(t){if(this._getType(t)!==m.nan){let r=this._getOrReturnCtx(t);return $(r,{code:c.invalid_type,expected:m.nan,received:r.parsedType}),x}return{status:"valid",value:t.data}}};Gt.create=(t)=>{return new Gt({typeName:_.ZodNaN,...A(t)})};Ib=Symbol("zod_brand");_n=class _n extends k{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}};Ft=class Ft extends k{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});if(a.status==="aborted")return x;if(a.status==="dirty")return n.dirty(),ot(a.value);else return this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();else{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});if(o.status==="aborted")return x;if(o.status==="dirty")return n.dirty(),{status:"dirty",value:o.value};else return this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new Ft({in:t,out:n,typeName:_.ZodPipeline})}};qt=class qt extends k{_parse(t){let n=this._def.innerType._parse(t),r=(o)=>{if(T(o))o.value=Object.freeze(o.value);return o};return dt(n)?n.then((o)=>r(o)):r(n)}unwrap(){return this._def.innerType}};qt.create=(t,n)=>{return new qt({innerType:t,typeName:_.ZodReadonly,...A(n)})};Pb={object:H.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"})(_||(_={}));Zr=B.create,zr=z.create,Zb=Gt.create,zb=tt.create,ta=vt.create,te=rt.create,ne=St.create,oe=$t.create,re=pt.create,ae=at.create,le=Z.create,be=V.create,ee=Yt.create,fe=D.create,he=H.create,ie=H.strictCreate,ce=ut.create,de=xn.create,ge=wt.create,me=K.create,ve=Jt.create,$e=Qt.create,pe=lt.create,ue=mt.create,we=st.create,se=xt.create,xe=nt.create,_e=_t.create,Ae=bt.create,ke=O.create,qe=E.create,Le=P.create,He=O.createWithPreprocess,Me=Ft.create,Ye={string:(t)=>B.create({...t,coerce:!0}),number:(t)=>z.create({...t,coerce:!0}),boolean:(t)=>vt.create({...t,coerce:!0}),bigint:(t)=>tt.create({...t,coerce:!0}),date:(t)=>rt.create({...t,coerce:!0})},Je=x});var g={};w(g,{void:()=>ee,util:()=>L,unknown:()=>le,union:()=>ce,undefined:()=>oe,tuple:()=>me,transformer:()=>ke,symbol:()=>ne,string:()=>Zr,strictObject:()=>ie,setErrorMap:()=>Lb,set:()=>pe,record:()=>ve,quotelessJson:()=>kb,promise:()=>Ae,preprocess:()=>He,pipeline:()=>Me,ostring:()=>Re,optional:()=>qe,onumber:()=>Xe,oboolean:()=>Se,objectUtil:()=>Qo,object:()=>he,number:()=>zr,nullable:()=>Le,null:()=>re,never:()=>be,nativeEnum:()=>_e,nan:()=>Zb,map:()=>$e,makeIssue:()=>Xt,literal:()=>se,lazy:()=>we,late:()=>Pb,isValid:()=>T,isDirty:()=>sn,isAsync:()=>dt,isAborted:()=>wn,intersection:()=>ge,instanceof:()=>Tb,getParsedType:()=>N,getErrorMap:()=>ct,function:()=>ue,enum:()=>xe,effect:()=>ke,discriminatedUnion:()=>de,defaultErrorMap:()=>C,datetimeRegex:()=>Ir,date:()=>te,custom:()=>Tr,coerce:()=>Ye,boolean:()=>ta,bigint:()=>zb,array:()=>fe,any:()=>ae,addIssueToContext:()=>$,ZodVoid:()=>Yt,ZodUnknown:()=>Z,ZodUnion:()=>ut,ZodUndefined:()=>$t,ZodType:()=>k,ZodTuple:()=>K,ZodTransformer:()=>O,ZodSymbol:()=>St,ZodString:()=>B,ZodSet:()=>lt,ZodSchema:()=>k,ZodRecord:()=>Jt,ZodReadonly:()=>qt,ZodPromise:()=>bt,ZodPipeline:()=>Ft,ZodParsedType:()=>m,ZodOptional:()=>E,ZodObject:()=>H,ZodNumber:()=>z,ZodNullable:()=>P,ZodNull:()=>pt,ZodNever:()=>V,ZodNativeEnum:()=>_t,ZodNaN:()=>Gt,ZodMap:()=>Qt,ZodLiteral:()=>xt,ZodLazy:()=>st,ZodIssueCode:()=>c,ZodIntersection:()=>wt,ZodFunction:()=>mt,ZodFirstPartyTypeKind:()=>_,ZodError:()=>J,ZodEnum:()=>nt,ZodEffects:()=>O,ZodDiscriminatedUnion:()=>xn,ZodDefault:()=>At,ZodDate:()=>rt,ZodCatch:()=>kt,ZodBranded:()=>_n,ZodBoolean:()=>vt,ZodBigInt:()=>tt,ZodArray:()=>D,ZodAny:()=>at,Schema:()=>k,ParseStatus:()=>X,OK:()=>S,NEVER:()=>Je,INVALID:()=>x,EMPTY_PATH:()=>Hb,DIRTY:()=>ot,BRAND:()=>Ib});var Eo=v(()=>{un();Fo();Nr();Rt();na();pn()});var oa=v(()=>{Eo();Eo()});function Lt(t,...n){if(Qe())return;(console[t]||console.log).call(console,...n)}var Qe=()=>Boolean(globalThis.__AFRICODE_TEST__||globalThis.__AFRICODE_SILENT_LOGS__);function An(t){if(t===null||typeof t!=="object")return t;if(Array.isArray(t))return t.map(An);let n={};for(let r of Object.keys(t))n[r]=An(t[r]);return n}function la(t,n){let r={...t};for(let o of Object.keys(n))if(n[o]!==null&&typeof n[o]==="object"&&!Array.isArray(n[o])&&typeof t[o]==="object"&&!Array.isArray(t[o]))r[o]=la(t[o]||{},n[o]);else r[o]=n[o];return r}function ba(t={}){return aa=la(ra,t),Ge=!0,Bt()}function Bt(){return Object.freeze(An(aa))}var ra,aa,Ge=!1;var Wo=v(()=>{ra={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}},aa=An(ra)});class et{static validate(t,n){try{return{success:!0,data:t.parse(n)}}catch(r){if(r instanceof g.ZodError){let o={};return r.errors.forEach((a)=>{let l=a.path.join(".");o[l]=a.message}),{success:!1,errors:o}}return{success:!1,errors:{general:"Validation failed"}}}}static validateField(t,n){try{return t.parse(n),{success:!0}}catch(r){if(r instanceof g.ZodError)return{success:!1,error:r.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 y{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){if(this._customMessage=t,this._customMessage&&this._baseSchema){if(this._fieldType==="string"&&this._baseSchema._def?.minLength)this._baseSchema=g.string().min(this._baseSchema._def.minLength.value,t);else if(this._fieldType==="url")this._baseSchema=g.string().min(1,"URL cannot be empty").url(t);else if(this._fieldType==="email")this._baseSchema=g.string().min(1,"Email cannot be empty").email(t);else if(this._fieldType==="phone")this._baseSchema=g.string().regex(/^[+]?[1-9][\d]{0,15}$/,t)}return 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 fa(t,n){let r={...n},o=!1;try{o=Bt().validation?.trimStrings===!0}catch{}for(let[a,l]of Object.entries(t)){if(!(l instanceof y))continue;let b=l.getMeta(),e=r[a];if(typeof e==="string"&&(b.trim||o))r[a]=e.trim();if(b.emptyAsNull&&r[a]==="")r[a]=null}return r}function ha(t){let n={};for(let[r,o]of Object.entries(t))if(o instanceof y)n[r]=o.build();else n[r]=o;return g.object(n)}var kn,U,ea;var qn=v(()=>{oa();Wo();kn={login:g.object({email:g.string().min(1,"Email is required").email("Please enter a valid email address"),password:g.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:g.object({name:g.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:g.string().min(1,"Email is required").email("Please enter a valid email address"),password:g.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:g.string()}).refine((t)=>t.password===t.confirmPassword,{message:"Passwords don't match",path:["confirmPassword"]}),auth:{register:g.object({action:g.literal("register"),email:g.string().min(1,"Email is required").email("Please enter a valid email address"),username:g.string().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters"),password:g.string().min(8,"Password must be at least 8 characters"),full_name:g.string().min(2,"Full name is required").max(100,"Full name is too long")}),login:g.object({action:g.literal("login"),email:g.string().min(1,"Email is required").email("Please enter a valid email address"),password:g.string().min(8,"Password must be at least 8 characters")}),logout:g.object({action:g.literal("logout")}),action:g.discriminatedUnion("action",[g.object({action:g.literal("register")}).merge(g.object({email:g.string().min(1,"Email is required").email("Please enter a valid email address"),username:g.string().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters"),password:g.string().min(8,"Password must be at least 8 characters"),full_name:g.string().min(2,"Full name is required").max(100,"Full name is too long")})),g.object({action:g.literal("login")}).merge(g.object({email:g.string().min(1,"Email is required").email("Please enter a valid email address"),password:g.string().min(8,"Password must be at least 8 characters")})),g.object({action:g.literal("logout")})])},contact:g.object({name:g.string().min(2,"Name must be at least 2 characters").max(100,"Name is too long"),email:g.string().email("Please enter a valid email address"),message:g.string().min(10,"Message must be at least 10 characters").max(1000,"Message is too long")}),email:g.string().min(1,"Email is required").email("Please enter a valid email address"),password:g.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,"Password must contain uppercase, lowercase, and number"),phone:g.string().regex(/^[+]?[1-9][\d]{0,15}$/,"Please enter a valid phone number"),url:g.string().min(1,"URL is required").url("Please enter a valid URL"),required:g.string().min(1,"This field is required"),positiveNumber:g.number().positive("Must be a positive number"),integer:g.number().int("Must be a whole number"),futureDate:g.date().min(new Date,"Date must be in the future"),imageFile:g.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:g.object({full_name:g.string().min(2,"Full name must be at least 2 characters").max(100,"Full name is too long").optional(),bio:g.string().max(500,"Bio must be less than 500 characters").nullable().optional(),avatar_url:g.string().url("Please enter a valid URL").nullable().optional(),theme:g.enum(["africanity","dark","light","system"]).optional(),language:g.string().min(2).max(10).optional()}),project:g.object({name:g.string().min(1,"Project name is required").max(100,"Project name is too long"),description:g.string().max(1000,"Description is too long").nullable().optional(),repository_url:g.string().url("Please enter a valid repository URL").nullable().optional(),demo_url:g.string().url("Please enter a valid demo URL").nullable().optional(),tags:g.array(g.string()).optional(),is_public:g.boolean().optional()})};U={required:(t="This field is required")=>g.string().min(1,t),email:(t="Please enter a valid email address")=>g.string().email(t),minLength:(t,n)=>g.string().min(t,n||`Must be at least ${t} characters`),maxLength:(t,n)=>g.string().max(t,n||`Must be less than ${t} characters`),pattern:(t,n)=>g.string().regex(t,n),numeric:(t="Must be a number")=>g.string().regex(/^\d+$/,t),phone:(t="Please enter a valid phone number")=>g.string().regex(/^[+]?[1-9][\d]{0,15}$/,t),url:(t="Please enter a valid URL")=>g.string().min(1,"URL is required").url(t)};ea={url(t="Please enter a valid URL"){return new y(g.string().min(1,"URL cannot be empty").url(t),"url")},email(t="Please enter a valid email address"){return new y(g.string().min(1,"Email cannot be empty").email(t),"email")},string(t={}){let n=g.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 y(n,"string")},number(t={}){let n=g.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 y(n,"number")},phone(t="Please enter a valid phone number"){return new y(g.string().regex(/^[+]?[1-9][\d]{0,15}$/,t),"phone")}}});function i(t,n){if(typeof customElements>"u")return;if(!customElements.get(t))customElements.define(t,n)}var Fe,$a,f;var p=v(()=>{Fe=globalThis.HTMLElement??class{},$a=typeof CSSStyleSheet<"u";f=class f extends Fe{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=`
432
432
  <style>
433
433
  .af-local-error {
434
434
  padding: 1rem;
@@ -447,7 +447,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
447
447
  <span aria-hidden="true">⚠️</span>
448
448
  <span>Failed to render</span>
449
449
  </div>
450
- `,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(!va)return;if(!(t instanceof CSSStyleSheet))return;if(!i.globalSheets.includes(t))i.globalSheets.push(t)}async loadStyles(t=""){if(!this.shadowRoot)return;let r=va&&"adoptedStyleSheets"in this.shadowRoot,o=typeof t==="string"&&t.length>0?t:"/styles/africanity.css",a=typeof t==="string"&&t.length>0?t:null;if(i.styleCache.has(o)){let l=i.styleCache.get(o);if(r)this.shadowRoot.adoptedStyleSheets=[l,...i.globalSheets];else this._applyFallbackStyle(l?.cssText||l?.text||l||"");return}try{let l=a;if(!l){let e=await fetch("/styles/africanity.css");if(!e.ok)throw Error(`Unable to load stylesheet: ${e.status}`);l=await e.text()}if(r){let e=new CSSStyleSheet;e.replaceSync(l),i.styleCache.set(o,e),this.shadowRoot.adoptedStyleSheets=[e,...i.globalSheets];return}this._applyFallbackStyle(l),i.styleCache.set(o,{text:l})}catch(l){this._applyFallbackStyle(a||"")}}_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:r={},text:o=""}={}){let a=document.createElement(t);if(n.length)a.classList.add(...n);if(Object.entries(r).forEach(([l,e])=>a.setAttribute(l,e)),o)a.textContent=o;return a}emit(t,n){this.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0}))}}});var pa={};$(pa,{default:()=>Bb,AfriUIButton:()=>Wt});var Wt,Bb;var Io=m(()=>{p();Wt=class Wt extends i{static get observedAttributes(){return["variant","size","disabled","loading","full-width","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-ui-button-click",{originalEvent:n})})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"primary",n=this.getAttribute("size")||"md",r=this.hasAttribute("disabled"),o=this.hasAttribute("loading"),a=this.getAttribute("aria-label")||"";this.shadowRoot.innerHTML=c`
450
+ `,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(!$a)return;if(!(t instanceof CSSStyleSheet))return;if(!f.globalSheets.includes(t))f.globalSheets.push(t)}async loadStyles(t=""){if(!this.shadowRoot)return;let r=$a&&"adoptedStyleSheets"in this.shadowRoot,o=typeof t==="string"&&t.length>0?t:"/styles/africanity.css",a=typeof t==="string"&&t.length>0?t:null;if(f.styleCache.has(o)){let l=f.styleCache.get(o);if(r)this.shadowRoot.adoptedStyleSheets=[l,...f.globalSheets];else this._applyFallbackStyle(l?.cssText||l?.text||l||"");return}try{let l=a;if(!l){let b=await fetch("/styles/africanity.css");if(!b.ok)throw Error(`Unable to load stylesheet: ${b.status}`);l=await b.text()}if(r){let b=new CSSStyleSheet;b.replaceSync(l),f.styleCache.set(o,b),this.shadowRoot.adoptedStyleSheets=[b,...f.globalSheets];return}this._applyFallbackStyle(l),f.styleCache.set(o,{text:l})}catch{this._applyFallbackStyle(a||"")}}_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:r={},text:o=""}={}){let a=document.createElement(t);if(n.length)a.classList.add(...n);if(Object.entries(r).forEach(([l,b])=>a.setAttribute(l,b)),o)a.textContent=o;return a}emit(t,n){this.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0}))}}});var pa={};w(pa,{default:()=>Be,AfriUIButton:()=>Et});var Et,Be;var Po=v(()=>{p();Et=class Et extends f{static get observedAttributes(){return["variant","size","disabled","loading","full-width","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-ui-button-click",{originalEvent:n})})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"primary",n=this.getAttribute("size")||"md",r=this.hasAttribute("disabled"),o=this.hasAttribute("loading"),a=this.getAttribute("aria-label")||"";this.shadowRoot.innerHTML=d`
451
451
  <style>
452
452
  :host { display: inline-block; }
453
453
 
@@ -544,10 +544,10 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
544
544
  ${a?`aria-label="${a}"`:""}
545
545
  ${o?'aria-busy="true"':""}
546
546
  >
547
- ${o?c`<span class="spinner"></span>`:""}
547
+ ${o?d`<span class="spinner"></span>`:""}
548
548
  <slot></slot>
549
549
  </button>
550
- `}};h("af-ui-button",Wt);Bb=Wt});var ua={};$(ua,{default:()=>Db,AfriUICard:()=>Ot});var Ot,Db;var Po=m(()=>{p();Ot=class Ot extends i{static get observedAttributes(){return["variant","bordered","clickable"]}constructor(){super();this.render()}connectedCallback(){if(this.loadStyles(),this.hasAttribute("clickable"))this.shadowRoot.querySelector(".card")?.addEventListener("click",()=>{this.emit("af-ui-card-click")})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"elevated",n=this.hasAttribute("bordered"),r=this.hasAttribute("clickable");this.shadowRoot.innerHTML=c`
550
+ `}};i("af-ui-button",Et);Be=Et});var ua={};w(ua,{default:()=>De,AfriUICard:()=>Wt});var Wt,De;var To=v(()=>{p();Wt=class Wt extends f{static get observedAttributes(){return["variant","bordered","clickable"]}constructor(){super();this.render()}connectedCallback(){if(this.loadStyles(),this.hasAttribute("clickable"))this.shadowRoot.querySelector(".card")?.addEventListener("click",()=>{this.emit("af-ui-card-click")})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"elevated";this.shadowRoot.innerHTML=d`
551
551
  <style>
552
552
  :host { display: block; }
553
553
 
@@ -577,7 +577,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
577
577
  <article class="card ${t}">
578
578
  <slot></slot>
579
579
  </article>
580
- `}};h("af-ui-card",Ot);Db=Ot});var $a={};$($a,{default:()=>Eb,AfriUIInput:()=>Ut});var Ut,Eb;var To=m(()=>{p();Ut=class Ut extends i{static get observedAttributes(){return["label","placeholder","type","value","disabled","error"]}constructor(){super();this.render()}connectedCallback(){this._attachListeners(),this.loadStyles()}attributeChangedCallback(){this.render(),this._attachListeners()}_attachListeners(){let t=this.shadowRoot.querySelector("input");if(!t)return;t.addEventListener("input",()=>{this.emit("af-ui-input",{value:t.value})})}render(){let t=this.getAttribute("label")||"",n=this.getAttribute("placeholder")||"",r=this.getAttribute("type")||"text",o=this.getAttribute("value")||"",a=this.hasAttribute("disabled"),l=this.getAttribute("error")||"";this.shadowRoot.innerHTML=c`
580
+ `}};i("af-ui-card",Wt);De=Wt});var wa={};w(wa,{default:()=>Ee,AfriUIInput:()=>Ot});var Ot,Ee;var Zo=v(()=>{p();Ot=class Ot extends f{static get observedAttributes(){return["label","placeholder","type","value","disabled","error"]}constructor(){super();this.render()}connectedCallback(){this._attachListeners(),this.loadStyles()}attributeChangedCallback(){this.render(),this._attachListeners()}_attachListeners(){let t=this.shadowRoot.querySelector("input");if(!t)return;t.addEventListener("input",()=>{this.emit("af-ui-input",{value:t.value})})}render(){let t=this.getAttribute("label")||"",n=this.getAttribute("placeholder")||"",r=this.getAttribute("type")||"text",o=this.getAttribute("value")||"",a=this.hasAttribute("disabled"),l=this.getAttribute("error")||"";this.shadowRoot.innerHTML=d`
581
581
  <style>
582
582
  :host { display: block; font-family: 'Inter', system-ui, sans-serif; }
583
583
 
@@ -625,7 +625,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
625
625
  </style>
626
626
 
627
627
  <div class="field">
628
- ${t?c`<label>${t}</label>`:""}
628
+ ${t?d`<label>${t}</label>`:""}
629
629
  <input
630
630
  type="${r}"
631
631
  placeholder="${n}"
@@ -635,7 +635,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
635
635
  />
636
636
  <div class="error">${l}</div>
637
637
  </div>
638
- `}};h("af-ui-input",Ut);Eb=Ut});var wa={};$(wa,{default:()=>Wb,AfriUIBadge:()=>Nt});var Nt,Wb;var Zo=m(()=>{p();Nt=class Nt extends i{static get observedAttributes(){return["variant","size","pill"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"secondary",n=this.getAttribute("size")||"md",r=this.hasAttribute("pill");this.shadowRoot.innerHTML=c`
638
+ `}};i("af-ui-input",Ot);Ee=Ot});var sa={};w(sa,{default:()=>We,AfriUIBadge:()=>Ut});var Ut,We;var zo=v(()=>{p();Ut=class Ut extends f{static get observedAttributes(){return["variant","size","pill"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"secondary",n=this.getAttribute("size")||"md",r=this.hasAttribute("pill");this.shadowRoot.innerHTML=d`
639
639
  <style>
640
640
  :host { display: inline-block; font-family: 'Inter', system-ui, sans-serif; }
641
641
 
@@ -662,7 +662,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
662
662
  </style>
663
663
 
664
664
  <span class="badge ${t}"><slot></slot></span>
665
- `}};h("af-ui-badge",Nt);Wb=Nt});var xa={};$(xa,{default:()=>Ob,AfriUISwitch:()=>yt});var yt,Ob;var zo=m(()=>{p();yt=class yt extends i{static get observedAttributes(){return["checked","disabled","size"]}constructor(){super();this.render()}connectedCallback(){this.shadowRoot.querySelector("button")?.addEventListener("click",(t)=>{if(this.hasAttribute("disabled"))return;let n=!this.hasAttribute("checked");if(n)this.setAttribute("checked","");else this.removeAttribute("checked");this.emit("af-ui-switch-toggle",{checked:n,originalEvent:t})})}attributeChangedCallback(){this.render()}render(){let t=this.hasAttribute("checked"),n=this.hasAttribute("disabled"),r=this.getAttribute("size")||"md",o=r==="sm"?{width:36,height:20,knob:14}:r==="lg"?{width:56,height:32,knob:24}:{width:48,height:28,knob:20},a=t?"true":"false";this.shadowRoot.innerHTML=c`
665
+ `}};i("af-ui-badge",Ut);We=Ut});var xa={};w(xa,{default:()=>Oe,AfriUISwitch:()=>Nt});var Nt,Oe;var tr=v(()=>{p();Nt=class Nt extends f{static get observedAttributes(){return["checked","disabled","size"]}constructor(){super();this.render()}connectedCallback(){this.shadowRoot.querySelector("button")?.addEventListener("click",(t)=>{if(this.hasAttribute("disabled"))return;let n=!this.hasAttribute("checked");if(n)this.setAttribute("checked","");else this.removeAttribute("checked");this.emit("af-ui-switch-toggle",{checked:n,originalEvent:t})})}attributeChangedCallback(){this.render()}render(){let t=this.hasAttribute("checked"),n=this.hasAttribute("disabled"),r=this.getAttribute("size")||"md",o=r==="sm"?{width:36,height:20,knob:14}:r==="lg"?{width:56,height:32,knob:24}:{width:48,height:28,knob:20},a=t?"true":"false";this.shadowRoot.innerHTML=d`
666
666
  <style>
667
667
  :host { display: inline-block; }
668
668
 
@@ -697,7 +697,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
697
697
  <button role="switch" aria-checked="${a}" ${n?"disabled":""}>
698
698
  <span class="knob"></span>
699
699
  </button>
700
- `}};h("af-ui-switch",yt);Ob=yt});var Aa={};$(Aa,{default:()=>Ub,AfriUISelect:()=>Vt});var Vt,Ub;var tr=m(()=>{p();Vt=class Vt extends i{static get observedAttributes(){return["label","placeholder","disabled","error"]}constructor(){super();this.render()}connectedCallback(){this._attachListeners(),this.loadStyles()}attributeChangedCallback(){this.render(),this._attachListeners()}_attachListeners(){let t=this.shadowRoot.querySelector("select");if(!t)return;t.addEventListener("change",()=>{this.emit("af-ui-select",{value:t.value})})}render(){let t=this.getAttribute("label")||"",n=this.getAttribute("placeholder")||"Select an option",r=this.hasAttribute("disabled"),o=this.getAttribute("error")||"";this.shadowRoot.innerHTML=c`
700
+ `}};i("af-ui-switch",Nt);Oe=Nt});var _a={};w(_a,{default:()=>Ue,AfriUISelect:()=>Vt});var Vt,Ue;var nr=v(()=>{p();Vt=class Vt extends f{static get observedAttributes(){return["label","placeholder","disabled","error"]}constructor(){super();this.render()}connectedCallback(){this._attachListeners(),this.loadStyles()}attributeChangedCallback(){this.render(),this._attachListeners()}_attachListeners(){let t=this.shadowRoot.querySelector("select");if(!t)return;t.addEventListener("change",()=>{this.emit("af-ui-select",{value:t.value})})}render(){let t=this.getAttribute("label")||"",n=this.getAttribute("placeholder")||"Select an option",r=this.hasAttribute("disabled"),o=this.getAttribute("error")||"";this.shadowRoot.innerHTML=d`
701
701
  <style>
702
702
  :host { display: block; font-family: 'Inter', system-ui, sans-serif; }
703
703
 
@@ -726,14 +726,14 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
726
726
  </style>
727
727
 
728
728
  <div class="field">
729
- ${t?c`<label>${t}</label>`:""}
729
+ ${t?d`<label>${t}</label>`:""}
730
730
  <select ${r?"disabled":""}>
731
731
  <option disabled selected hidden>${n}</option>
732
732
  <slot></slot>
733
733
  </select>
734
734
  <div class="error">${o}</div>
735
735
  </div>
736
- `}};h("af-ui-select",Vt);Ub=Vt});var _a={};$(_a,{default:()=>Nb,AfriUITextarea:()=>Kt});var Kt,Nb;var nr=m(()=>{p();Kt=class Kt extends i{static get observedAttributes(){return["label","placeholder","rows","disabled","error"]}constructor(){super();this.render()}connectedCallback(){this._attachListeners(),this.loadStyles()}attributeChangedCallback(){this.render(),this._attachListeners()}_attachListeners(){let t=this.shadowRoot.querySelector("textarea");if(!t)return;t.addEventListener("input",()=>{this.emit("af-ui-textarea",{value:t.value})})}render(){let t=this.getAttribute("label")||"",n=this.getAttribute("placeholder")||"",r=this.getAttribute("rows")||"4",o=this.hasAttribute("disabled"),a=this.getAttribute("error")||"";this.shadowRoot.innerHTML=c`
736
+ `}};i("af-ui-select",Vt);Ue=Vt});var Aa={};w(Aa,{default:()=>Ne,AfriUITextarea:()=>Kt});var Kt,Ne;var or=v(()=>{p();Kt=class Kt extends f{static get observedAttributes(){return["label","placeholder","rows","disabled","error"]}constructor(){super();this.render()}connectedCallback(){this._attachListeners(),this.loadStyles()}attributeChangedCallback(){this.render(),this._attachListeners()}_attachListeners(){let t=this.shadowRoot.querySelector("textarea");if(!t)return;t.addEventListener("input",()=>{this.emit("af-ui-textarea",{value:t.value})})}render(){let t=this.getAttribute("label")||"",n=this.getAttribute("placeholder")||"",r=this.getAttribute("rows")||"4",o=this.hasAttribute("disabled"),a=this.getAttribute("error")||"";this.shadowRoot.innerHTML=d`
737
737
  <style>
738
738
  :host { display: block; font-family: 'Inter', system-ui, sans-serif; }
739
739
 
@@ -763,11 +763,11 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
763
763
  </style>
764
764
 
765
765
  <div class="field">
766
- ${t?c`<label>${t}</label>`:""}
766
+ ${t?d`<label>${t}</label>`:""}
767
767
  <textarea rows="${r}" placeholder="${n}" ${o?"disabled":""}></textarea>
768
768
  <div class="error">${a}</div>
769
769
  </div>
770
- `}};h("af-ui-textarea",Kt);Nb=Kt});var ka={};$(ka,{default:()=>yb,AfriUIChip:()=>jt});var jt,yb;var or=m(()=>{p();jt=class jt extends i{static get observedAttributes(){return["variant","size","dismissible"]}constructor(){super();this.render()}connectedCallback(){this.render(),this._attachListeners()}attributeChangedCallback(){this.render(),this._attachListeners()}_attachListeners(){let t=this.shadowRoot.querySelector(".chip button");if(!t)return;t.addEventListener("click",(n)=>{n.stopPropagation(),this.emit("af-ui-chip-dismiss",{})})}render(){let t=this.getAttribute("variant")||"neutral",n=this.getAttribute("size")||"md",r=this.hasAttribute("dismissible");this.shadowRoot.innerHTML=c`
770
+ `}};i("af-ui-textarea",Kt);Ne=Kt});var ka={};w(ka,{default:()=>Ve,AfriUIChip:()=>yt});var yt,Ve;var rr=v(()=>{p();yt=class yt extends f{static get observedAttributes(){return["variant","size","dismissible"]}constructor(){super();this.render()}connectedCallback(){this.render(),this._attachListeners()}attributeChangedCallback(){this.render(),this._attachListeners()}_attachListeners(){let t=this.shadowRoot.querySelector(".chip button");if(!t)return;t.addEventListener("click",(n)=>{n.stopPropagation(),this.emit("af-ui-chip-dismiss",{})})}render(){let t=this.getAttribute("variant")||"neutral",n=this.getAttribute("size")||"md",r=this.hasAttribute("dismissible");this.shadowRoot.innerHTML=d`
771
771
  <style>
772
772
  :host { display: inline-flex; }
773
773
 
@@ -803,9 +803,9 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
803
803
 
804
804
  <span class="chip ${t}">
805
805
  <slot></slot>
806
- ${r?c`<button aria-label="Remove">×</button>`:""}
806
+ ${r?d`<button aria-label="Remove">×</button>`:""}
807
807
  </span>
808
- `}};h("af-ui-chip",jt);yb=jt});var qa={};$(qa,{default:()=>Vb,AfriUITag:()=>Ct});var Ct,Vb;var rr=m(()=>{p();Ct=class Ct extends i{static get observedAttributes(){return["variant","size"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"secondary",n=this.getAttribute("size")||"md",r={sm:"0.25rem 0.6rem",md:"0.35rem 0.8rem",lg:"0.5rem 1rem"};this.shadowRoot.innerHTML=c`
808
+ `}};i("af-ui-chip",yt);Ve=yt});var qa={};w(qa,{default:()=>Ke,AfriUITag:()=>jt});var jt,Ke;var ar=v(()=>{p();jt=class jt extends f{static get observedAttributes(){return["variant","size"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"secondary",n=this.getAttribute("size")||"md",r={sm:"0.25rem 0.6rem",md:"0.35rem 0.8rem",lg:"0.5rem 1rem"};this.shadowRoot.innerHTML=d`
809
809
  <style>
810
810
  :host { display: inline-block; font-family: 'Inter', sans-serif; }
811
811
 
@@ -831,7 +831,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
831
831
  </style>
832
832
 
833
833
  <span class="tag ${t}"><slot></slot></span>
834
- `}};h("af-ui-tag",Ct);Vb=Ct});var La={};$(La,{default:()=>Kb,AfriUIAvatar:()=>It});var It,Kb;var ar=m(()=>{p();It=class It extends i{static get observedAttributes(){return["src","initials","size","badge"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("src"),n=this.getAttribute("initials")||"AC",r=this.getAttribute("size")||"md",o=r==="sm"?"32px":r==="lg"?"64px":"48px",a=this.getAttribute("badge");this.shadowRoot.innerHTML=c`
834
+ `}};i("af-ui-tag",jt);Ke=jt});var La={};w(La,{default:()=>ye,AfriUIAvatar:()=>Ct});var Ct,ye;var lr=v(()=>{p();Ct=class Ct extends f{static get observedAttributes(){return["src","initials","size","badge"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("src"),n=this.getAttribute("initials")||"AC",r=this.getAttribute("size")||"md",o=r==="sm"?"32px":r==="lg"?"64px":"48px",a=this.getAttribute("badge");this.shadowRoot.innerHTML=d`
835
835
  <style>
836
836
  :host { display: inline-flex; }
837
837
 
@@ -871,17 +871,17 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
871
871
  </style>
872
872
 
873
873
  <div class="avatar">
874
- ${t?c`<img src="${t}" alt="Avatar" />`:c`<span>${n}</span>`}
875
- ${a?c`<span class="badge">${a}</span>`:""}
874
+ ${t?d`<img src="${t}" alt="Avatar" />`:d`<span>${n}</span>`}
875
+ ${a?d`<span class="badge">${a}</span>`:""}
876
876
  </div>
877
- `}};h("af-ui-avatar",It);Kb=It});var Ha={};$(Ha,{default:()=>jb,AfriUIProgressRing:()=>Pt});var Pt,jb;var lr=m(()=>{p();Pt=class Pt extends i{static get observedAttributes(){return["value","size","stroke","label"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=Number(this.getAttribute("value")||0),n=Number(this.getAttribute("size")||96),r=Number(this.getAttribute("stroke")||10),o=this.getAttribute("label")||"",a=(n-r)/2,l=2*Math.PI*a,e=l-t/100*l;this.shadowRoot.innerHTML=c`
877
+ `}};i("af-ui-avatar",Ct);ye=Ct});var Ha={};w(Ha,{default:()=>je,AfriUIProgressRing:()=>It});var It,je;var br=v(()=>{p();It=class It extends f{static get observedAttributes(){return["value","size","stroke","label"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=Number(this.getAttribute("value")||0),n=Number(this.getAttribute("size")||96),r=Number(this.getAttribute("stroke")||10),o=this.getAttribute("label")||"",a=(n-r)/2,l=2*Math.PI*a,b=l-t/100*l;this.shadowRoot.innerHTML=d`
878
878
  <style>
879
879
  :host { display: inline-flex; align-items: center; justify-content: center; }
880
880
  .ring { position: relative; width: ${n}px; height: ${n}px; }
881
881
  svg { transform: rotate(-90deg); width: 100%; height: 100%; }
882
882
  circle { fill: none; stroke-width: ${r}; stroke-linecap: round; }
883
883
  .bg { stroke: rgba(15, 23, 42, 0.12); }
884
- .progress { stroke: #2563eb; stroke-dasharray: ${l}; stroke-dashoffset: ${e}; transition: stroke-dashoffset 0.35s ease; }
884
+ .progress { stroke: #2563eb; stroke-dasharray: ${l}; stroke-dashoffset: ${b}; transition: stroke-dashoffset 0.35s ease; }
885
885
  .label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #111827; font-family: 'Inter', sans-serif; }
886
886
  .value { font-size: 1rem; font-weight: 700; }
887
887
  .subtitle { font-size: 0.75rem; color: #6b7280; }
@@ -893,10 +893,10 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
893
893
  </svg>
894
894
  <div class="label">
895
895
  <div class="value">${t}%</div>
896
- ${o?c`<div class="subtitle">${o}</div>`:""}
896
+ ${o?d`<div class="subtitle">${o}</div>`:""}
897
897
  </div>
898
898
  </div>
899
- `}};h("af-ui-progress-ring",Pt);jb=Pt});var Ma={};$(Ma,{default:()=>Cb,AfriUITooltip:()=>Tt});var Tt,Cb;var er=m(()=>{p();Tt=class Tt extends i{static get observedAttributes(){return["text","position"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("text")||"",n=this.getAttribute("position")||"top";this.shadowRoot.innerHTML=c`
899
+ `}};i("af-ui-progress-ring",It);je=It});var Ma={};w(Ma,{default:()=>Ce,AfriUITooltip:()=>Pt});var Pt,Ce;var er=v(()=>{p();Pt=class Pt extends f{static get observedAttributes(){return["text","position"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("text")||"",n=this.getAttribute("position")||"top";this.shadowRoot.innerHTML=d`
900
900
  <style>
901
901
  :host { position: relative; display: inline-flex; }
902
902
 
@@ -929,7 +929,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
929
929
  </style>
930
930
  <slot></slot>
931
931
  <div class="tooltip ${n}" role="tooltip">${t}</div>
932
- `}};h("af-ui-tooltip",Tt);Cb=Tt});var Ra={};$(Ra,{default:()=>Ib,AfriUIPopover:()=>Zt});var Zt,Ib;var br=m(()=>{p();Zt=class Zt extends i{static get observedAttributes(){return["label","open"]}constructor(){super();this._open=this.hasAttribute("open"),this.render()}connectedCallback(){this._attachListeners()}attributeChangedCallback(){this._open=this.hasAttribute("open"),this.render(),this._attachListeners()}_attachListeners(){let t=this.shadowRoot.querySelector(".trigger");if(!t)return;t.addEventListener("click",()=>{if(this._open=!this._open,this._open)this.setAttribute("open","");else this.removeAttribute("open");this.render(),this._attachListeners()})}render(){let t=this.getAttribute("label")||"Open",n=this._open;this.shadowRoot.innerHTML=c`
932
+ `}};i("af-ui-tooltip",Pt);Ce=Pt});var Ra={};w(Ra,{default:()=>Ie,AfriUIPopover:()=>Tt});var Tt,Ie;var fr=v(()=>{p();Tt=class Tt extends f{static get observedAttributes(){return["label","open"]}constructor(){super();this._open=this.hasAttribute("open"),this.render()}connectedCallback(){this._attachListeners()}attributeChangedCallback(){this._open=this.hasAttribute("open"),this.render(),this._attachListeners()}_attachListeners(){let t=this.shadowRoot.querySelector(".trigger");if(!t)return;t.addEventListener("click",()=>{if(this._open=!this._open,this._open)this.setAttribute("open","");else this.removeAttribute("open");this.render(),this._attachListeners()})}render(){let t=this.getAttribute("label")||"Open",n=this._open;this.shadowRoot.innerHTML=d`
933
933
  <style>
934
934
  :host { position: relative; display: inline-flex; }
935
935
  .trigger {
@@ -961,7 +961,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
961
961
  </style>
962
962
  <button class="trigger" type="button">${t}</button>
963
963
  <div class="panel"><slot></slot></div>
964
- `}};h("af-ui-popover",Zt);Ib=Zt});var Sa={};$(Sa,{default:()=>Pb,AfriUITabs:()=>zt,AfriUITabPanel:()=>ir});var zt,ir,Pb;var fr=m(()=>{p();zt=class zt extends i{static get observedAttributes(){return["active"]}constructor(){super();this._active=this.getAttribute("active")||"0",this.render()}connectedCallback(){this._attachListeners()}attributeChangedCallback(){this._active=this.getAttribute("active")||"0",this.render(),this._attachListeners()}_attachListeners(){this.shadowRoot.querySelectorAll('[role="tab"]').forEach((n)=>{n.addEventListener("click",()=>{let r=n.getAttribute("data-index");this.setAttribute("active",r)})})}render(){let t=this._active,n=Array.from(this.children).filter((r)=>r.tagName.toLowerCase()==="ui-tab-panel");this.shadowRoot.innerHTML=c`
964
+ `}};i("af-ui-popover",Tt);Ie=Tt});var Xa={};w(Xa,{default:()=>Pe,AfriUITabs:()=>Zt,AfriUITabPanel:()=>hr});var Zt,hr,Pe;var ir=v(()=>{p();Zt=class Zt extends f{static get observedAttributes(){return["active"]}constructor(){super();this._active=this.getAttribute("active")||"0",this.render()}connectedCallback(){this._attachListeners()}attributeChangedCallback(){this._active=this.getAttribute("active")||"0",this.render(),this._attachListeners()}_attachListeners(){this.shadowRoot.querySelectorAll('[role="tab"]').forEach((n)=>{n.addEventListener("click",()=>{let r=n.getAttribute("data-index");this.setAttribute("active",r)})})}render(){let t=this._active,n=Array.from(this.children).filter((r)=>r.tagName.toLowerCase()==="ui-tab-panel");this.shadowRoot.innerHTML=d`
965
965
  <style>
966
966
  :host { display: block; font-family: 'Inter', system-ui, sans-serif; }
967
967
 
@@ -987,7 +987,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
987
987
  .panel.active { display: block; }
988
988
  </style>
989
989
  <div class="tab-list" role="tablist">
990
- ${n.map((r,o)=>c`
990
+ ${n.map((r,o)=>d`
991
991
  <button
992
992
  role="tab"
993
993
  data-index="${o}"
@@ -998,12 +998,12 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
998
998
  </button>
999
999
  `).join("")}
1000
1000
  </div>
1001
- ${n.map((r,o)=>c`
1001
+ ${n.map((r,o)=>d`
1002
1002
  <div class="panel ${String(o)===String(t)?"active":""}" role="tabpanel">
1003
1003
  ${r.innerHTML}
1004
1004
  </div>
1005
1005
  `).join("")}
1006
- `}};ir=class ir extends i{render(){this.shadowRoot.innerHTML=c`<slot></slot>`}};h("af-ui-tabs",zt);h("ui-tab-panel",ir);Pb=zt});var Xa={};$(Xa,{default:()=>Tb,AfriUITable:()=>tn});var tn,Tb;var hr=m(()=>{p();tn=class tn extends i{static get observedAttributes(){return["striped","bordered","compact"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.hasAttribute("striped"),n=this.hasAttribute("bordered"),r=this.hasAttribute("compact");this.shadowRoot.innerHTML=c`
1006
+ `}};hr=class hr extends f{render(){this.shadowRoot.innerHTML=d`<slot></slot>`}};i("af-ui-tabs",Zt);i("ui-tab-panel",hr);Pe=Zt});var Sa={};w(Sa,{default:()=>Te,AfriUITable:()=>zt});var zt,Te;var cr=v(()=>{p();zt=class zt extends f{static get observedAttributes(){return["striped","bordered","compact"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.hasAttribute("striped"),n=this.hasAttribute("bordered"),r=this.hasAttribute("compact");this.shadowRoot.innerHTML=d`
1007
1007
  <style>
1008
1008
  :host { display: block; overflow-x: auto; }
1009
1009
  table {
@@ -1038,7 +1038,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1038
1038
  <table class="${n?"bordered":""}">
1039
1039
  <slot></slot>
1040
1040
  </table>
1041
- `}};h("af-ui-table",tn);Tb=tn});var Ya={};$(Ya,{default:()=>Zb,AfriUIStat:()=>nn});var nn,Zb;var dr=m(()=>{p();nn=class nn extends i{static get observedAttributes(){return["label","value","delta","trend"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("label")||"Metric",n=this.getAttribute("value")||"0",r=this.getAttribute("delta")||"",o=this.getAttribute("trend")||"neutral",a=o==="positive"?"#16a34a":o==="negative"?"#dc2626":"#475569";this.shadowRoot.innerHTML=c`
1041
+ `}};i("af-ui-table",zt);Te=zt});var Ya={};w(Ya,{default:()=>Ze,AfriUIStat:()=>tn});var tn,Ze;var dr=v(()=>{p();tn=class tn extends f{static get observedAttributes(){return["label","value","delta","trend"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("label")||"Metric",n=this.getAttribute("value")||"0",r=this.getAttribute("delta")||"",o=this.getAttribute("trend")||"neutral",a=o==="positive"?"#16a34a":o==="negative"?"#dc2626":"#475569";this.shadowRoot.innerHTML=d`
1042
1042
  <style>
1043
1043
  :host { display: block; font-family: 'Inter', sans-serif; }
1044
1044
  .stat {
@@ -1074,9 +1074,9 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1074
1074
  <div class="stat">
1075
1075
  <div class="label">${t}</div>
1076
1076
  <div class="value">${n}</div>
1077
- ${r?c`<div class="delta">${r}</div>`:""}
1077
+ ${r?d`<div class="delta">${r}</div>`:""}
1078
1078
  </div>
1079
- `}};h("af-ui-stat",nn);Zb=nn});var Ja={};$(Ja,{default:()=>zb,AfriFooter:()=>on});var on,zb;var cr=m(()=>{p();on=class on extends i{static get observedAttributes(){return["company","year"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("company")||"AfriCode",n=this.getAttribute("year")||new Date().getFullYear();this.shadowRoot.innerHTML=c`
1079
+ `}};i("af-ui-stat",tn);Ze=tn});var Ja={};w(Ja,{default:()=>ze,AfriFooter:()=>nn});var nn,ze;var gr=v(()=>{p();nn=class nn extends f{static get observedAttributes(){return["company","year"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("company")||"AfriCode",n=this.getAttribute("year")||new Date().getFullYear();this.shadowRoot.innerHTML=d`
1080
1080
  <style>
1081
1081
  :host {
1082
1082
  display: block;
@@ -1156,7 +1156,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1156
1156
  <slot name="legal"></slot>
1157
1157
  </div>
1158
1158
  </footer>
1159
- `}};h("af-footer",on);zb=on});var Ga={};$(Ga,{default:()=>ti,AfriBreadcrumb:()=>rn});var rn,ti;var gr=m(()=>{p();rn=class rn extends i{static get observedAttributes(){return["separator"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("separator")||"/";this.shadowRoot.innerHTML=c`
1159
+ `}};i("af-footer",nn);ze=nn});var Qa={};w(Qa,{default:()=>t0,AfriBreadcrumb:()=>on});var on,t0;var mr=v(()=>{p();on=class on extends f{static get observedAttributes(){return["separator"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("separator")||"/";this.shadowRoot.innerHTML=d`
1160
1160
  <style>
1161
1161
  :host {
1162
1162
  display: block;
@@ -1182,6 +1182,10 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1182
1182
  color: #cbd5e1;
1183
1183
  }
1184
1184
 
1185
+ nav {
1186
+ --af-breadcrumb-separator: '${t}';
1187
+ }
1188
+
1185
1189
  ::slotted(a) {
1186
1190
  color: #0f172a;
1187
1191
  text-decoration: none;
@@ -1196,7 +1200,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1196
1200
  <nav aria-label="Breadcrumb">
1197
1201
  <slot></slot>
1198
1202
  </nav>
1199
- `}};h("af-breadcrumb",rn);ti=rn});var Qa={};$(Qa,{default:()=>ni,AfriFeatureGrid:()=>an});var an,ni;var sr=m(()=>{p();an=class an extends i{static get observedAttributes(){return["columns"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("columns")||"3";this.shadowRoot.innerHTML=c`
1203
+ `}};i("af-breadcrumb",on);t0=on});var Ga={};w(Ga,{default:()=>n0,AfriFeatureGrid:()=>rn});var rn,n0;var vr=v(()=>{p();rn=class rn extends f{static get observedAttributes(){return["columns"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("columns")||"3";this.shadowRoot.innerHTML=d`
1200
1204
  <style>
1201
1205
  :host {
1202
1206
  display: block;
@@ -1249,7 +1253,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1249
1253
  <div class="grid">
1250
1254
  <slot></slot>
1251
1255
  </div>
1252
- `}};h("af-feature-grid",an);ni=an});var Fa={};$(Fa,{default:()=>oi,AfriPricingCard:()=>ln});var ln,oi;var mr=m(()=>{p();ln=class ln extends i{static get observedAttributes(){return["title","price","frequency","highlight"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("title")||"Standard",n=this.getAttribute("price")||"$49",r=this.getAttribute("frequency")||"per month",o=this.hasAttribute("highlight");this.shadowRoot.innerHTML=c`
1256
+ `}};i("af-feature-grid",rn);n0=rn});var Fa={};w(Fa,{default:()=>o0,AfriPricingCard:()=>an});var an,o0;var $r=v(()=>{p();an=class an extends f{static get observedAttributes(){return["title","price","frequency","highlight"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("title")||"Standard",n=this.getAttribute("price")||"$49",r=this.getAttribute("frequency")||"per month",o=this.hasAttribute("highlight");this.shadowRoot.innerHTML=d`
1253
1257
  <style>
1254
1258
  :host {
1255
1259
  display: block;
@@ -1314,7 +1318,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1314
1318
  </div>
1315
1319
  <div class="footer"><slot name="action"></slot></div>
1316
1320
  </div>
1317
- `}};h("af-pricing-card",ln);oi=ln});var Ba={};$(Ba,{default:()=>ri,AfriTestimonial:()=>en});var en,ri;var vr=m(()=>{p();en=class en extends i{static get observedAttributes(){return["author","role","company"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("author")||"Customer",n=this.getAttribute("role")||"Founder",r=this.getAttribute("company")||"";this.shadowRoot.innerHTML=c`
1321
+ `}};i("af-pricing-card",an);o0=an});var Ba={};w(Ba,{default:()=>r0,AfriTestimonial:()=>ln});var ln,r0;var pr=v(()=>{p();ln=class ln extends f{static get observedAttributes(){return["author","role","company"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("author")||"Customer",n=this.getAttribute("role")||"Founder",r=this.getAttribute("company")||"";this.shadowRoot.innerHTML=d`
1318
1322
  <style>
1319
1323
  :host {
1320
1324
  display: block;
@@ -1374,7 +1378,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1374
1378
  <span class="meta">${n}${r?` · ${r}`:""}</span>
1375
1379
  </div>
1376
1380
  </article>
1377
- `}};h("af-testimonial",en);ri=en});var Da={};$(Da,{default:()=>ai,AfriDashboardShell:()=>bn});var bn,ai;var pr=m(()=>{p();bn=class bn extends i{static get observedAttributes(){return["sidebar-width","topbar-height"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("sidebar-width")||"280px",n=this.getAttribute("topbar-height")||"72px";this.shadowRoot.innerHTML=c`
1381
+ `}};i("af-testimonial",ln);r0=ln});var Da={};w(Da,{default:()=>a0,AfriDashboardShell:()=>bn});var bn,a0;var ur=v(()=>{p();bn=class bn extends f{static get observedAttributes(){return["sidebar-width","topbar-height"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("sidebar-width")||"280px",n=this.getAttribute("topbar-height")||"72px";this.shadowRoot.innerHTML=d`
1378
1382
  <style>
1379
1383
  :host {
1380
1384
  display: block;
@@ -1425,7 +1429,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1425
1429
  <header class="topbar"><slot name="topbar"></slot></header>
1426
1430
  <main class="content"><slot></slot></main>
1427
1431
  </div>
1428
- `}};h("af-dashboard-shell",bn);ai=bn});var Ea={};$(Ea,{default:()=>li,AfriDashboardTopbar:()=>fn});var fn,li;var ur=m(()=>{p();fn=class fn extends i{static get observedAttributes(){return["title","description"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("title")||"Dashboard",n=this.getAttribute("description")||"";this.shadowRoot.innerHTML=c`
1432
+ `}};i("af-dashboard-shell",bn);a0=bn});var Ea={};w(Ea,{default:()=>l0,AfriDashboardTopbar:()=>en});var en,l0;var wr=v(()=>{p();en=class en extends f{static get observedAttributes(){return["title","description"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("title")||"Dashboard",n=this.getAttribute("description")||"";this.shadowRoot.innerHTML=d`
1429
1433
  <style>
1430
1434
  :host {
1431
1435
  display: block;
@@ -1472,11 +1476,11 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1472
1476
  <div class="topbar">
1473
1477
  <div class="heading">
1474
1478
  <div class="title">${t}</div>
1475
- ${n?c`<div class="description">${n}</div>`:""}
1479
+ ${n?d`<div class="description">${n}</div>`:""}
1476
1480
  </div>
1477
1481
  <div class="actions"><slot name="actions"></slot></div>
1478
1482
  </div>
1479
- `}};h("af-dashboard-topbar",fn);li=fn});var Wa={};$(Wa,{default:()=>ei,AfriDashboardCard:()=>hn});var hn,ei;var $r=m(()=>{p();hn=class hn extends i{static get observedAttributes(){return["title","variant"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("title")||"",n=this.getAttribute("variant")||"surface",r={surface:{background:"#ffffff",border:"1px solid rgba(15, 23, 42, 0.08)",shadow:"0 18px 36px rgba(15, 23, 42, 0.04)"},elevated:{background:"linear-gradient(180deg, #ffffff 0%, #f8fafc 100%)",border:"1px solid rgba(15, 23, 42, 0.12)",shadow:"0 24px 48px rgba(15, 23, 42, 0.08)"}},o=r[n]||r.surface;this.shadowRoot.innerHTML=c`
1483
+ `}};i("af-dashboard-topbar",en);l0=en});var Wa={};w(Wa,{default:()=>b0,AfriDashboardCard:()=>fn});var fn,b0;var sr=v(()=>{p();fn=class fn extends f{static get observedAttributes(){return["title","variant"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("title")||"",n=this.getAttribute("variant")||"surface",r={surface:{background:"#ffffff",border:"1px solid rgba(15, 23, 42, 0.08)",shadow:"0 18px 36px rgba(15, 23, 42, 0.04)"},elevated:{background:"linear-gradient(180deg, #ffffff 0%, #f8fafc 100%)",border:"1px solid rgba(15, 23, 42, 0.12)",shadow:"0 24px 48px rgba(15, 23, 42, 0.08)"}},o=r[n]||r.surface;this.shadowRoot.innerHTML=d`
1480
1484
  <style>
1481
1485
  :host {
1482
1486
  display: block;
@@ -1510,10 +1514,10 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1510
1514
  </style>
1511
1515
 
1512
1516
  <div class="card">
1513
- ${t?c`<div class="header"><h3 class="title">${t}</h3><slot name="header"></slot></div>`:""}
1517
+ ${t?d`<div class="header"><h3 class="title">${t}</h3><slot name="header"></slot></div>`:""}
1514
1518
  <div class="body"><slot></slot></div>
1515
1519
  </div>
1516
- `}};h("af-dashboard-card",hn);ei=hn});var Oa={};$(Oa,{default:()=>bi,AfriDashboardMetric:()=>dn});var dn,bi;var wr=m(()=>{p();dn=class dn extends i{static get observedAttributes(){return["label","value","delta","trend"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("label")||"Metric",n=this.getAttribute("value")||"0",r=this.getAttribute("delta")||"",o=this.getAttribute("trend")||"neutral",a=o==="positive"?"#16a34a":o==="negative"?"#dc2626":"#475569";this.shadowRoot.innerHTML=c`
1520
+ `}};i("af-dashboard-card",fn);b0=fn});var Oa={};w(Oa,{default:()=>e0,AfriDashboardMetric:()=>hn});var hn,e0;var xr=v(()=>{p();hn=class hn extends f{static get observedAttributes(){return["label","value","delta","trend"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("label")||"Metric",n=this.getAttribute("value")||"0",r=this.getAttribute("delta")||"",o=this.getAttribute("trend")||"neutral",a=o==="positive"?"#16a34a":o==="negative"?"#dc2626":"#475569";this.shadowRoot.innerHTML=d`
1517
1521
  <style>
1518
1522
  :host {
1519
1523
  display: block;
@@ -1556,9 +1560,9 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1556
1560
  <div class="metric">
1557
1561
  <div class="label">${t}</div>
1558
1562
  <div class="value">${n}</div>
1559
- ${r?c`<div class="delta">${r}</div>`:""}
1563
+ ${r?d`<div class="delta">${r}</div>`:""}
1560
1564
  </div>
1561
- `}};h("af-dashboard-metric",dn);bi=dn});var Ua={};$(Ua,{default:()=>ii,AfriDashboardActivityList:()=>cn});var cn,ii;var xr=m(()=>{p();cn=class cn extends i{static get observedAttributes(){return["title","empty-text"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("title")||"Recent Activity",n=this.getAttribute("empty-text")||"No recent activity available.";this.shadowRoot.innerHTML=c`
1565
+ `}};i("af-dashboard-metric",hn);e0=hn});var Ua={};w(Ua,{default:()=>f0,AfriDashboardActivityList:()=>cn});var cn,f0;var _r=v(()=>{p();cn=class cn extends f{static get observedAttributes(){return["title","empty-text"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("title")||"Recent Activity",n=this.getAttribute("empty-text")||"No recent activity available.";this.shadowRoot.innerHTML=d`
1562
1566
  <style>
1563
1567
  :host {
1564
1568
  display: block;
@@ -1628,7 +1632,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1628
1632
  </slot>
1629
1633
  </div>
1630
1634
  </div>
1631
- `}};h("af-dashboard-activity-list",cn);ii=cn});var Na={};$(Na,{AfriAuthForm:()=>Hn});function hi(t){return typeof t==="string"&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}var fi=`
1635
+ `}};i("af-dashboard-activity-list",cn);f0=cn});var Na={};w(Na,{AfriAuthForm:()=>Hn});function i0(t){return typeof t==="string"&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}var h0=`
1632
1636
  :host {
1633
1637
  display: block;
1634
1638
  color: var(--af-smart-text, var(--af-text, #172033));
@@ -1685,8 +1689,8 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1685
1689
  .message.success {
1686
1690
  color: var(--af-smart-success, var(--af-success, #087443));
1687
1691
  }
1688
- `,Hn;var Ar=m(()=>{p();Hn=class Hn extends i{static get observedAttributes(){return["endpoint","button-label"]}connectedCallback(){this.render()}attributeChangedCallback(){if(this.isConnected)this.render()}get endpoint(){return this.getAttribute("endpoint")||"/api/auth"}render(){this.shadowRoot.innerHTML=`
1689
- <style>${fi}</style>
1692
+ `,Hn;var Ar=v(()=>{p();Hn=class Hn extends f{static get observedAttributes(){return["endpoint","button-label"]}connectedCallback(){this.render()}attributeChangedCallback(){if(this.isConnected)this.render()}get endpoint(){return this.getAttribute("endpoint")||"/api/auth"}render(){this.shadowRoot.innerHTML=`
1693
+ <style>${h0}</style>
1690
1694
  <form novalidate>
1691
1695
  <label>
1692
1696
  Email
@@ -1699,7 +1703,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1699
1703
  <button type="submit">${this.getAttribute("button-label")||"Continue"}</button>
1700
1704
  <div class="message" role="status" aria-live="polite"></div>
1701
1705
  </form>
1702
- `,this.shadowRoot.querySelector("form").addEventListener("submit",(t)=>this.handleSubmit(t))}setMessage(t,n=""){let r=this.shadowRoot.querySelector(".message");r.className=n?`message ${n}`:"message",r.textContent=t}async handleSubmit(t){t.preventDefault();let n=t.currentTarget,r=n.querySelector("button"),o={email:n.elements.email.value.trim(),password:n.elements.password.value};if(!hi(o.email)||o.password.length<8){this.setMessage("Enter a valid email and password.","error"),this.emit("af-auth-error",{code:"INVALID_INPUT"});return}r.disabled=!0,this.setMessage("Checking credentials...");try{let a=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}),l=await a.json();if(!a.ok||l.ok===!1){this.setMessage(l.error||"Authentication failed.","error"),this.emit("af-auth-error",{response:l,status:a.status});return}this.setMessage("Authenticated.","success"),this.emit("af-auth-success",l)}catch(a){this.setMessage("Authentication service unavailable.","error"),this.emit("af-auth-error",{code:"NETWORK_ERROR",message:a.message})}finally{r.disabled=!1}}};h("af-auth-form",Hn)});var ya={};$(ya,{AfriKycUpload:()=>Mn});var di=`
1706
+ `,this.shadowRoot.querySelector("form").addEventListener("submit",(t)=>this.handleSubmit(t))}setMessage(t,n=""){let r=this.shadowRoot.querySelector(".message");r.className=n?`message ${n}`:"message",r.textContent=t}async handleSubmit(t){t.preventDefault();let n=t.currentTarget,r=n.querySelector("button"),o={email:n.elements.email.value.trim(),password:n.elements.password.value};if(!i0(o.email)||o.password.length<8){this.setMessage("Enter a valid email and password.","error"),this.emit("af-auth-error",{code:"INVALID_INPUT"});return}r.disabled=!0,this.setMessage("Checking credentials...");try{let a=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}),l=await a.json();if(!a.ok||l.ok===!1){this.setMessage(l.error||"Authentication failed.","error"),this.emit("af-auth-error",{response:l,status:a.status});return}this.setMessage("Authenticated.","success"),this.emit("af-auth-success",l)}catch(a){this.setMessage("Authentication service unavailable.","error"),this.emit("af-auth-error",{code:"NETWORK_ERROR",message:a.message})}finally{r.disabled=!1}}};i("af-auth-form",Hn)});var Va={};w(Va,{AfriKycUpload:()=>Mn});var c0=`
1703
1707
  :host {
1704
1708
  display: block;
1705
1709
  color: var(--af-smart-text, var(--af-text, #172033));
@@ -1760,8 +1764,8 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1760
1764
  .message.success {
1761
1765
  color: var(--af-smart-success, var(--af-success, #087443));
1762
1766
  }
1763
- `,ci,Mn;var _r=m(()=>{p();ci=new Set(["application/pdf","image/jpeg","image/png"]);Mn=class Mn extends i{static get observedAttributes(){return["endpoint","max-size-mb"]}connectedCallback(){this.render()}attributeChangedCallback(){if(this.isConnected)this.render()}get endpoint(){return this.getAttribute("endpoint")||"/api/kyc"}get maxSizeMb(){return Number(this.getAttribute("max-size-mb")||5)}render(){this.shadowRoot.innerHTML=`
1764
- <style>${di}</style>
1767
+ `,d0,Mn;var kr=v(()=>{p();d0=new Set(["application/pdf","image/jpeg","image/png"]);Mn=class Mn extends f{static get observedAttributes(){return["endpoint","max-size-mb"]}connectedCallback(){this.render()}attributeChangedCallback(){if(this.isConnected)this.render()}get endpoint(){return this.getAttribute("endpoint")||"/api/kyc"}get maxSizeMb(){return Number(this.getAttribute("max-size-mb")||5)}render(){this.shadowRoot.innerHTML=`
1768
+ <style>${c0}</style>
1765
1769
  <form novalidate>
1766
1770
  <label>
1767
1771
  Identity document
@@ -1771,7 +1775,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1771
1775
  <button type="submit">Upload for review</button>
1772
1776
  <div class="message" role="status" aria-live="polite"></div>
1773
1777
  </form>
1774
- `,this.shadowRoot.querySelector("form").addEventListener("submit",(t)=>this.handleSubmit(t))}setMessage(t,n=""){let r=this.shadowRoot.querySelector(".message");r.className=n?`message ${n}`:"message",r.textContent=t}validateFile(t){if(!t)return{ok:!1,code:"FILE_REQUIRED",error:"Choose an identity document."};if(!ci.has(t.type))return{ok:!1,code:"UNSUPPORTED_FILE_TYPE",error:"Use a PDF, JPG, or PNG document."};if(t.size>this.maxSizeMb*1024*1024)return{ok:!1,code:"FILE_TOO_LARGE",error:`File must be ${this.maxSizeMb} MB or smaller.`};return{ok:!0}}async handleSubmit(t){t.preventDefault();let n=t.currentTarget,r=n.querySelector("button"),o=n.elements.document.files?.[0],a=this.validateFile(o);if(!a.ok){this.setMessage(a.error,"error"),this.emit("af-kyc-error",a);return}let l=new FormData;l.set("document",o,o.name),r.disabled=!0,this.setMessage("Uploading document...");try{let e=await fetch(this.endpoint,{method:"POST",body:l}),b=await e.json().catch(()=>({}));if(!e.ok||b.ok===!1){this.setMessage(b.error||"Document upload failed.","error"),this.emit("af-kyc-error",{response:b,status:e.status});return}this.setMessage("Document received for review.","success"),this.emit("af-kyc-success",b)}catch(e){this.setMessage("KYC service unavailable.","error"),this.emit("af-kyc-error",{code:"NETWORK_ERROR",message:e.message})}finally{r.disabled=!1}}};h("af-kyc-upload",Mn)});var Va={};$(Va,{AfriWalletBalance:()=>Rn});function qr(t,n){return`${n||"TZS"} ${Number(t||0).toLocaleString("en-US")}`}var kr=`
1778
+ `,this.shadowRoot.querySelector("form").addEventListener("submit",(t)=>this.handleSubmit(t))}setMessage(t,n=""){let r=this.shadowRoot.querySelector(".message");r.className=n?`message ${n}`:"message",r.textContent=t}validateFile(t){if(!t)return{ok:!1,code:"FILE_REQUIRED",error:"Choose an identity document."};if(!d0.has(t.type))return{ok:!1,code:"UNSUPPORTED_FILE_TYPE",error:"Use a PDF, JPG, or PNG document."};if(t.size>this.maxSizeMb*1024*1024)return{ok:!1,code:"FILE_TOO_LARGE",error:`File must be ${this.maxSizeMb} MB or smaller.`};return{ok:!0}}async handleSubmit(t){t.preventDefault();let n=t.currentTarget,r=n.querySelector("button"),o=n.elements.document.files?.[0],a=this.validateFile(o);if(!a.ok){this.setMessage(a.error,"error"),this.emit("af-kyc-error",a);return}let l=new FormData;l.set("document",o,o.name),r.disabled=!0,this.setMessage("Uploading document...");try{let b=await fetch(this.endpoint,{method:"POST",body:l}),e=await b.json().catch(()=>({}));if(!b.ok||e.ok===!1){this.setMessage(e.error||"Document upload failed.","error"),this.emit("af-kyc-error",{response:e,status:b.status});return}this.setMessage("Document received for review.","success"),this.emit("af-kyc-success",e)}catch(b){this.setMessage("KYC service unavailable.","error"),this.emit("af-kyc-error",{code:"NETWORK_ERROR",message:b.message})}finally{r.disabled=!1}}};i("af-kyc-upload",Mn)});var Ka={};w(Ka,{AfriWalletBalance:()=>Rn});function Lr(t,n){return`${n||"TZS"} ${Number(t||0).toLocaleString("en-US")}`}var qr=`
1775
1779
  :host {
1776
1780
  display: block;
1777
1781
  color: var(--af-smart-text, var(--af-text, #172033));
@@ -1801,28 +1805,28 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1801
1805
  .error {
1802
1806
  color: var(--af-smart-danger, var(--af-danger, #b42318));
1803
1807
  }
1804
- `,Rn;var Lr=m(()=>{p();Rn=class Rn extends i{static get observedAttributes(){return["endpoint"]}connectedCallback(){this.renderLoading(),this.load()}attributeChangedCallback(){if(this.isConnected)this.load()}get endpoint(){return this.getAttribute("endpoint")||"/api/wallet"}renderLoading(){this.shadowRoot.innerHTML=`
1805
- <style>${kr}</style>
1808
+ `,Rn;var Hr=v(()=>{p();Rn=class Rn extends f{static get observedAttributes(){return["endpoint"]}connectedCallback(){this.renderLoading(),this.load()}attributeChangedCallback(){if(this.isConnected)this.load()}get endpoint(){return this.getAttribute("endpoint")||"/api/wallet"}renderLoading(){this.shadowRoot.innerHTML=`
1809
+ <style>${qr}</style>
1806
1810
  <article class="wallet">
1807
1811
  <span class="label">Available balance</span>
1808
1812
  <strong class="amount">Loading</strong>
1809
1813
  <span class="meta">Fetching wallet</span>
1810
1814
  </article>
1811
1815
  `}renderWallet(t){this.shadowRoot.innerHTML=`
1812
- <style>${kr}</style>
1816
+ <style>${qr}</style>
1813
1817
  <article class="wallet">
1814
1818
  <span class="label">Available balance</span>
1815
1819
  <strong class="amount"></strong>
1816
1820
  <span class="meta"></span>
1817
1821
  </article>
1818
- `,this.shadowRoot.querySelector(".amount").textContent=qr(t.availableBalance,t.currency),this.shadowRoot.querySelector(".meta").textContent=`Ledger ${qr(t.ledgerBalance,t.currency)} · Daily limit ${qr(t.dailyLimit,t.currency)}`}renderError(t){this.shadowRoot.innerHTML=`
1819
- <style>${kr}</style>
1822
+ `,this.shadowRoot.querySelector(".amount").textContent=Lr(t.availableBalance,t.currency),this.shadowRoot.querySelector(".meta").textContent=`Ledger ${Lr(t.ledgerBalance,t.currency)} · Daily limit ${Lr(t.dailyLimit,t.currency)}`}renderError(t){this.shadowRoot.innerHTML=`
1823
+ <style>${qr}</style>
1820
1824
  <article class="wallet">
1821
1825
  <span class="label">Available balance</span>
1822
1826
  <strong class="amount error">Unavailable</strong>
1823
1827
  <span class="meta error"></span>
1824
1828
  </article>
1825
- `,this.shadowRoot.querySelector(".meta").textContent=t}async load(){try{let t=await fetch(this.endpoint),n=await t.json();if(!t.ok||n.ok===!1||!n.wallet)throw Error(n.error||"Wallet data unavailable.");this.renderWallet(n.wallet),this.emit("af-wallet-load",n)}catch(t){this.renderError("Wallet API is unavailable."),this.emit("af-wallet-error",{message:t.message})}}};h("af-wallet-balance",Rn)});var ja={};$(ja,{AfriTransactionLedger:()=>Sn});function gi(t,n){return`${n||"TZS"} ${Number(t||0).toLocaleString("en-US")}`}var Ka=`
1829
+ `,this.shadowRoot.querySelector(".meta").textContent=t}async load(){try{let t=await fetch(this.endpoint),n=await t.json();if(!t.ok||n.ok===!1||!n.wallet)throw Error(n.error||"Wallet data unavailable.");this.renderWallet(n.wallet),this.emit("af-wallet-load",n)}catch(t){this.renderError("Wallet API is unavailable."),this.emit("af-wallet-error",{message:t.message})}}};i("af-wallet-balance",Rn)});var ja={};w(ja,{AfriTransactionLedger:()=>Xn});function g0(t,n){return`${n||"TZS"} ${Number(t||0).toLocaleString("en-US")}`}var ya=`
1826
1830
  :host {
1827
1831
  display: block;
1828
1832
  color: var(--af-smart-text, var(--af-text, #172033));
@@ -1857,13 +1861,13 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1857
1861
  .error {
1858
1862
  color: var(--af-smart-danger, var(--af-danger, #b42318));
1859
1863
  }
1860
- `,Sn;var Hr=m(()=>{p();Sn=class Sn extends i{static get observedAttributes(){return["endpoint"]}connectedCallback(){this.renderShell("Loading transactions"),this.load()}attributeChangedCallback(){if(this.isConnected)this.load()}get endpoint(){return this.getAttribute("endpoint")||"/api/wallet"}renderShell(t=""){if(this.shadowRoot.innerHTML=`
1861
- <style>${Ka}</style>
1864
+ `,Xn;var Mr=v(()=>{p();Xn=class Xn extends f{static get observedAttributes(){return["endpoint"]}connectedCallback(){this.renderShell("Loading transactions"),this.load()}attributeChangedCallback(){if(this.isConnected)this.load()}get endpoint(){return this.getAttribute("endpoint")||"/api/wallet"}renderShell(t=""){if(this.shadowRoot.innerHTML=`
1865
+ <style>${ya}</style>
1862
1866
  <div class="ledger" role="list"></div>
1863
- `,t){let n=document.createElement("div");n.className="empty",n.textContent=t,this.shadowRoot.querySelector(".ledger").append(n)}}renderTransactions(t){this.renderShell();let n=this.shadowRoot.querySelector(".ledger");if(!t.length){let r=document.createElement("div");r.className="empty",r.textContent="No transactions yet.",n.append(r);return}n.replaceChildren(...t.map((r)=>{let o=document.createElement("article"),a=document.createElement("div"),l=document.createElement("strong"),e=document.createElement("div"),b=document.createElement("span");return o.className="row",o.setAttribute("role","listitem"),e.className="status",b.className="amount",l.textContent=r.counterparty||r.id||"Transaction",e.textContent=r.status||r.type||"pending",b.textContent=gi(r.amount,r.currency),a.append(l,e),o.append(a,b),o}))}renderError(t){this.shadowRoot.innerHTML=`
1864
- <style>${Ka}</style>
1867
+ `,t){let n=document.createElement("div");n.className="empty",n.textContent=t,this.shadowRoot.querySelector(".ledger").append(n)}}renderTransactions(t){this.renderShell();let n=this.shadowRoot.querySelector(".ledger");if(!t.length){let r=document.createElement("div");r.className="empty",r.textContent="No transactions yet.",n.append(r);return}n.replaceChildren(...t.map((r)=>{let o=document.createElement("article"),a=document.createElement("div"),l=document.createElement("strong"),b=document.createElement("div"),e=document.createElement("span");return o.className="row",o.setAttribute("role","listitem"),b.className="status",e.className="amount",l.textContent=r.counterparty||r.id||"Transaction",b.textContent=r.status||r.type||"pending",e.textContent=g0(r.amount,r.currency),a.append(l,b),o.append(a,e),o}))}renderError(t){this.shadowRoot.innerHTML=`
1868
+ <style>${ya}</style>
1865
1869
  <div class="empty error"></div>
1866
- `,this.shadowRoot.querySelector(".empty").textContent=t}async load(){try{let t=await fetch(this.endpoint),n=await t.json(),r=Array.isArray(n.transactions)?n.transactions:[];if(!t.ok||n.ok===!1)throw Error(n.error||"Ledger data unavailable.");this.renderTransactions(r),this.emit("af-ledger-load",{transactions:r})}catch(t){this.renderError("Transaction ledger unavailable."),this.emit("af-ledger-error",{message:t.message})}}};h("af-transaction-ledger",Sn)});var Ca={};$(Ca,{default:()=>si,AfriNavDrawer:()=>gn});var gn,si;var Mr=m(()=>{p();p();gn=class gn extends i{constructor(){super();this.isOpen=!1,this.position=this.getAttribute("position")||"left",this.width=this.getAttribute("width")||"280px",this.overlay=this.hasAttribute("overlay")}static get observedAttributes(){return["open","position","width","overlay"]}attributeChangedCallback(t,n,r){switch(t){case"open":this.isOpen=r!==null,this.render();break;case"position":this.position=r;break;case"width":this.width=r;break;case"overlay":this.overlay=r!==null;break}}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.handleKeyDown),this.loadStyles()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeyDown)}handleKeyDown=(t)=>{if(t.key==="Escape"&&this.isOpen)this.close()};toggle(){this.isOpen?this.close():this.open()}open(){this.isOpen=!0,this.setAttribute("open",""),this.render(),this.emit("af-navdrawer-open",{drawer:this})}close(){this.isOpen=!1,this.removeAttribute("open"),this.render(),this.emit("af-navdrawer-close",{drawer:this})}render(){if(!this.shadowRoot)return;if(this.shadowRoot.innerHTML=`
1870
+ `,this.shadowRoot.querySelector(".empty").textContent=t}async load(){try{let t=await fetch(this.endpoint),n=await t.json(),r=Array.isArray(n.transactions)?n.transactions:[];if(!t.ok||n.ok===!1)throw Error(n.error||"Ledger data unavailable.");this.renderTransactions(r),this.emit("af-ledger-load",{transactions:r})}catch(t){this.renderError("Transaction ledger unavailable."),this.emit("af-ledger-error",{message:t.message})}}};i("af-transaction-ledger",Xn)});var Ca={};w(Ca,{default:()=>m0,AfriNavDrawer:()=>dn});var dn,m0;var Rr=v(()=>{p();p();dn=class dn extends f{constructor(){super();this.isOpen=!1,this.position=this.getAttribute("position")||"left",this.width=this.getAttribute("width")||"280px",this.overlay=this.hasAttribute("overlay")}static get observedAttributes(){return["open","position","width","overlay"]}attributeChangedCallback(t,n,r){switch(t){case"open":this.isOpen=r!==null,this.render();break;case"position":this.position=r;break;case"width":this.width=r;break;case"overlay":this.overlay=r!==null;break}}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.handleKeyDown),this.loadStyles()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeyDown)}handleKeyDown=(t)=>{if(t.key==="Escape"&&this.isOpen)this.close()};toggle(){this.isOpen?this.close():this.open()}open(){this.isOpen=!0,this.setAttribute("open",""),this.render(),this.emit("af-navdrawer-open",{drawer:this})}close(){this.isOpen=!1,this.removeAttribute("open"),this.render(),this.emit("af-navdrawer-close",{drawer:this})}render(){if(!this.shadowRoot)return;if(this.shadowRoot.innerHTML=`
1867
1871
  <style>
1868
1872
  :host {
1869
1873
  display: block;
@@ -1969,7 +1973,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1969
1973
  <slot name="content"></slot>
1970
1974
  </div>
1971
1975
  </aside>
1972
- `,this.overlay){let t=this.shadowRoot.querySelector(".nav-drawer-overlay");if(t)t.addEventListener("click",()=>this.close())}}getItems(){return this.querySelectorAll('[slot="content"] .nav-item')}setActiveItem(t){this.getItems().forEach((o)=>o.classList.remove("active"));let r=this.querySelector(t);if(r)r.classList.add("active")}};h("af-nav-drawer",gn);si=gn});var Ia={};$(Ia,{default:()=>mi,AfriButton:()=>Xn});var Xn,mi;var Pa=m(()=>{p();Xn=class Xn extends i{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",r=this.getAttribute("theme")||"tanzania",o=this.hasAttribute("disabled"),a=this.hasAttribute("loading"),l=this.getAttribute("icon"),e=this.getAttribute("aria-label"),b={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"}},f=b[r]||b.tanzania;this.shadowRoot.innerHTML=`
1976
+ `,this.overlay){let t=this.shadowRoot.querySelector(".nav-drawer-overlay");if(t)t.addEventListener("click",()=>this.close())}}getItems(){return this.querySelectorAll('[slot="content"] .nav-item')}setActiveItem(t){this.getItems().forEach((o)=>o.classList.remove("active"));let r=this.querySelector(t);if(r)r.classList.add("active")}};i("af-nav-drawer",dn);m0=dn});var Ia={};w(Ia,{default:()=>v0,AfriButton:()=>Sn});var Sn,v0;var Pa=v(()=>{p();Sn=class Sn extends f{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",r=this.getAttribute("theme")||"tanzania",o=this.hasAttribute("disabled"),a=this.hasAttribute("loading"),l=this.getAttribute("icon"),b=this.getAttribute("aria-label"),e={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"}},h=e[r]||e.tanzania;this.shadowRoot.innerHTML=`
1973
1977
  <style>
1974
1978
  :host {
1975
1979
  display: inline-block;
@@ -1997,8 +2001,8 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
1997
2001
 
1998
2002
  /* Variants */
1999
2003
  .variant-primary {
2000
- background: ${f.primary};
2001
- color: ${f.text};
2004
+ background: ${h.primary};
2005
+ color: ${h.text};
2002
2006
  }
2003
2007
  .variant-primary:hover:not(:disabled) {
2004
2008
  filter: brightness(1.1);
@@ -2008,25 +2012,25 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2008
2012
 
2009
2013
  .variant-secondary {
2010
2014
  background: transparent;
2011
- color: ${f.primary};
2012
- border: 2px solid ${f.primary};
2015
+ color: ${h.primary};
2016
+ border: 2px solid ${h.primary};
2013
2017
  }
2014
2018
  .variant-secondary:hover:not(:disabled) {
2015
- background: ${f.primary};
2016
- color: ${f.text};
2019
+ background: ${h.primary};
2020
+ color: ${h.text};
2017
2021
  }
2018
2022
 
2019
2023
  .variant-ghost {
2020
2024
  background: transparent;
2021
- color: ${f.primary};
2025
+ color: ${h.primary};
2022
2026
  }
2023
2027
  .variant-ghost:hover:not(:disabled) {
2024
2028
  background: rgba(0,0,0,0.05);
2025
2029
  }
2026
2030
 
2027
2031
  .variant-gradient {
2028
- background: linear-gradient(135deg, ${f.primary} 0%, ${f.accent} 100%);
2029
- color: ${f.text};
2032
+ background: linear-gradient(135deg, ${h.primary} 0%, ${h.accent} 100%);
2033
+ color: ${h.text};
2030
2034
  }
2031
2035
  .variant-gradient:hover:not(:disabled) {
2032
2036
  transform: translateY(-2px);
@@ -2066,14 +2070,14 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2066
2070
  <button
2067
2071
  class="variant-${t} size-${n}"
2068
2072
  ${o?"disabled":""}
2069
- ${e?`aria-label="${e}"`:""}
2073
+ ${b?`aria-label="${b}"`:""}
2070
2074
  ${a?'aria-busy="true"':""}
2071
2075
  >
2072
2076
  ${a?'<span class="spinner"></span>':""}
2073
2077
  ${l&&!a?`<span class="icon">${l}</span>`:""}
2074
2078
  <slot></slot>
2075
2079
  </button>
2076
- `}};h("af-button",Xn);mi=Xn});var Ta={};$(Ta,{default:()=>vi,AfriCard:()=>Yn});var Yn,vi;var Za=m(()=>{p();Yn=class Yn extends i{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",r=this.hasAttribute("clickable"),o=this.getAttribute("image"),a={default:{accent:"#333",border:"#eee"},tanzania:{accent:"#1EB53A",border:"#1EB53A"},maasai:{accent:"#FF0000",border:"#8B0000"},ndebele:{accent:"#4169E1",border:"#4169E1"}},e={elevated:"box-shadow: 0 2px 12px rgba(0,0,0,0.1);",outlined:`border: 2px solid ${(a[t]||a.default).border};`,flat:"background: #f8f9fa;"};this.shadowRoot.innerHTML=html`
2080
+ `}};i("af-button",Sn);v0=Sn});var Ta={};w(Ta,{default:()=>$0,AfriCard:()=>Yn});var Yn,$0;var Za=v(()=>{p();Yn=class Yn extends f{static get observedAttributes(){return["theme","variant","clickable","image"]}constructor(){super()}connectedCallback(){if(this.render(),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",r=this.hasAttribute("clickable"),o=this.getAttribute("image"),a={default:{accent:"#333",border:"#eee"},tanzania:{accent:"#1EB53A",border:"#1EB53A"},maasai:{accent:"#FF0000",border:"#8B0000"},ndebele:{accent:"#4169E1",border:"#4169E1"}},b={elevated:"box-shadow: 0 2px 12px rgba(0,0,0,0.1);",outlined:`border: 2px solid ${(a[t]||a.default).border};`,flat:"background: #f8f9fa;"},e=b[n]||b.elevated;this.shadowRoot.innerHTML=d`
2077
2081
  <style>
2078
2082
  :host {
2079
2083
  display: block;
@@ -2081,6 +2085,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2081
2085
  }
2082
2086
 
2083
2087
  .card {
2088
+ ${e}
2084
2089
  background: var(--glass-bg, rgba(15, 23, 42, 0.7));
2085
2090
  backdrop-filter: blur(var(--glass-blur, 12px));
2086
2091
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
@@ -2141,17 +2146,17 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2141
2146
  </style>
2142
2147
 
2143
2148
  <article class="card">
2144
- ${o?`<img class="card-image" src="${o}" alt="" />`:""}
2149
+ ${o?d`<img class="card-image" src="${o}" alt="" />`:""}
2145
2150
  <div class="card-body">
2146
2151
  <slot></slot>
2147
2152
  </div>
2148
- ${this.querySelector('[slot="footer"]')?`
2149
- <div class="card-footer">
2150
- <slot name="footer"></slot>
2151
- </div>
2152
- `:""}
2153
+ ${this.querySelector('[slot="footer"]')?d`
2154
+ <div class="card-footer">
2155
+ <slot name="footer"></slot>
2156
+ </div>
2157
+ `:""}
2153
2158
  </article>
2154
- `}};h("af-card",Yn);vi=Yn});var za={};$(za,{default:()=>pi,AfriNavbar:()=>Jn});var Jn,pi;var tl=m(()=>{p();Ht();rt();Jn=class Jn extends i{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",r=this.hasAttribute("sticky");this.shadowRoot.innerHTML=`
2159
+ `}};i("af-card",Yn);$0=Yn});var za={};w(za,{default:()=>p0,AfriNavbar:()=>Jn});var Jn,p0;var tl=v(()=>{p();Jn=class Jn extends f{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",r=this.getAttribute("sticky")!=="false",o={dark:{start:"var(--afri-green, #1eb53a)",end:"var(--afri-gold, #fcd116)",accent:"var(--afri-gold, #fcd116)"},tanzania:{start:"#1EB53A",end:"#FCD116",accent:"#FCD116"},maasai:{start:"#FF0000",end:"#8B0000",accent:"#FF0000"},ndebele:{start:"#4169E1",end:"#FFFFFF",accent:"#4169E1"}},a=o[t]||o.dark;this.shadowRoot.innerHTML=`
2155
2160
  <style>
2156
2161
  :host {
2157
2162
  display: block;
@@ -2168,7 +2173,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2168
2173
  backdrop-filter: blur(12px);
2169
2174
  -webkit-backdrop-filter: blur(12px);
2170
2175
  border-bottom: 1px solid var(--glass-border);
2171
- position: fixed;
2176
+ position: ${r?"fixed":"static"};
2172
2177
  top: 0;
2173
2178
  inset-inline: 0;
2174
2179
  z-index: 1000;
@@ -2186,7 +2191,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2186
2191
  .logo-mark {
2187
2192
  width: 32px;
2188
2193
  height: 32px;
2189
- background: linear-gradient(135deg, var(--afri-green, #1eb53a), var(--afri-gold, #fcd116));
2194
+ background: linear-gradient(135deg, ${a.start}, ${a.end});
2190
2195
  border-radius: 8px;
2191
2196
  display: flex;
2192
2197
  align-items: center;
@@ -2235,7 +2240,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2235
2240
  left: 50%;
2236
2241
  width: 0;
2237
2242
  height: 2px;
2238
- background: var(--afri-gold, #fcd116);
2243
+ background: ${a.accent};
2239
2244
  transition: all 0.3s ease;
2240
2245
  transform: translateX(-50%);
2241
2246
  }
@@ -2327,7 +2332,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2327
2332
  <slot></slot>
2328
2333
  </div>
2329
2334
  </nav>
2330
- `}};h("af-navbar",Jn);pi=Jn});var nl={};$(nl,{default:()=>ui,AfriInput:()=>Gn});var Gn,ui;var ol=m(()=>{p();qn();Gn=class Gn extends i{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"),r=t.value;if(this.hasAttribute("required")&&!r.trim()){this.setAttribute("error","This field is required");return}if(n&&r.trim()){let a=this._getValidationSchema(n);if(a){let l=ft.validateField(a,r);if(!l.success)this.setAttribute("error",l.error);else this.removeAttribute("error")}}}_getValidationSchema(t){let n={email:O.email(),password:O.password(),phone:O.phone(),url:O.url(),required:O.required()};if(t.includes(":")){let[r,o]=t.split(":"),a=parseInt(o);switch(r){case"minLength":return O.minLength(a);case"maxLength":return O.maxLength(a);case"pattern":return O.pattern(new RegExp(o),"Invalid format")}}return n[t]||null}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("type")||"text",n=this.getAttribute("name")||"",r=this.getAttribute("label")||"",o=this.getAttribute("placeholder")||"",a=this.getAttribute("error")||"",l=this.getAttribute("helper")||"",e=this.getAttribute("theme")||"tanzania",b=this.getAttribute("icon")||"",f=this.hasAttribute("required"),u=this.getAttribute("aria-label"),q=this.getAttribute("aria-describedby"),R={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},M=R[e]||R.tanzania,Y=[];if(a)Y.push(`error-${this._uniqueId}`);else if(l)Y.push(`helper-${this._uniqueId}`);if(q)Y.push(...q.split(" "));let bo=Y.length>0?`aria-describedby="${Y.join(" ")}"`:"";this.shadowRoot.innerHTML=`
2335
+ `}};i("af-navbar",Jn);p0=Jn});var nl={};w(nl,{default:()=>u0,AfriInput:()=>Qn});var Qn,u0;var ol=v(()=>{p();qn();Qn=class Qn extends f{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"),r=t.value;if(this.hasAttribute("required")&&!r.trim()){this.setAttribute("error","This field is required");return}if(n&&r.trim()){let a=this._getValidationSchema(n);if(a){let l=et.validateField(a,r);if(!l.success)this.setAttribute("error",l.error);else this.removeAttribute("error")}}}_getValidationSchema(t){let n={email:U.email(),password:U.password(),phone:U.phone(),url:U.url(),required:U.required()};if(t.includes(":")){let[r,o]=t.split(":"),a=parseInt(o);switch(r){case"minLength":return U.minLength(a);case"maxLength":return U.maxLength(a);case"pattern":return U.pattern(new RegExp(o),"Invalid format")}}return n[t]||null}render(){let t=this.getAttribute("type")||"text",n=this.getAttribute("name")||"",r=this.getAttribute("label")||"",o=this.getAttribute("placeholder")||"",a=this.getAttribute("error")||"",l=this.getAttribute("helper")||"",b=this.getAttribute("theme")||"tanzania",e=this.getAttribute("icon")||"",h=this.hasAttribute("required"),u=this.getAttribute("aria-label"),q=this.getAttribute("aria-describedby"),R={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},M=R[b]||R.tanzania,Y=[];if(a)Y.push(`error-${this._uniqueId}`);else if(l)Y.push(`helper-${this._uniqueId}`);if(q)Y.push(...q.split(" "));let eo=Y.length>0?`aria-describedby="${Y.join(" ")}"`:"";this.shadowRoot.innerHTML=`
2331
2336
  <style>
2332
2337
  :host {
2333
2338
  display: block;
@@ -2360,7 +2365,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2360
2365
  input {
2361
2366
  width: 100%;
2362
2367
  padding: 10px 13px;
2363
- ${b?"padding-left: 40px;":""}
2368
+ ${e?"padding-left: 40px;":""}
2364
2369
  font-size: 15px;
2365
2370
  border: 2px solid #ddd;
2366
2371
  border-radius: 5px;
@@ -2401,25 +2406,25 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2401
2406
  </style>
2402
2407
 
2403
2408
  <div class="input-wrapper">
2404
- ${r?`<label for="input-${this._uniqueId}">${r}${f?'<span class="required-star">*</span>':""}</label>`:""}
2409
+ ${r?`<label for="input-${this._uniqueId}">${r}${h?'<span class="required-star">*</span>':""}</label>`:""}
2405
2410
  <div class="input-container">
2406
- ${b?`<span class="icon">${b}</span>`:""}
2411
+ ${e?`<span class="icon">${e}</span>`:""}
2407
2412
  <input
2408
2413
  id="input-${this._uniqueId}"
2409
2414
  name="${n}"
2410
2415
  type="${t}"
2411
2416
  placeholder="${o}"
2412
2417
  class="${a?"has-error":""}"
2413
- ${f?"required":""}
2418
+ ${h?"required":""}
2414
2419
  ${u?`aria-label="${u}"`:""}
2415
2420
  ${a?'aria-invalid="true"':""}
2416
- ${bo}
2421
+ ${eo}
2417
2422
  />
2418
2423
  </div>
2419
2424
  ${a?`<div id="error-${this._uniqueId}" class="error-text" role="alert">${a}</div>`:""}
2420
2425
  ${l&&!a?`<div id="helper-${this._uniqueId}" class="helper-text">${l}</div>`:""}
2421
2426
  </div>
2422
- `}};h("af-input",Gn);ui=Gn});var rl={};$(rl,{default:()=>$i,AfriAlert:()=>Qn});var Qn,$i;var al=m(()=>{p();Qn=class Qn extends i{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")||"",r=this.hasAttribute("dismissible"),o={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:"ℹ"}},a=o[t]||o.info;this.shadowRoot.innerHTML=`
2427
+ `}};i("af-input",Qn);u0=Qn});var rl={};w(rl,{default:()=>w0,AfriAlert:()=>Gn});var Gn,w0;var al=v(()=>{p();Gn=class Gn extends f{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")||"",r=this.hasAttribute("dismissible"),o={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:"ℹ"}},a=o[t]||o.info;this.shadowRoot.innerHTML=`
2423
2428
  <style>
2424
2429
  :host {
2425
2430
  display: block;
@@ -2499,8 +2504,8 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2499
2504
  </div>
2500
2505
  ${r?'<button class="close-btn" aria-label="Dismiss">×</button>':""}
2501
2506
  </div>
2502
- `}};h("af-alert",Qn);$i=Qn});var ll={};$(ll,{AfriGrid:()=>Rr});function wi(t,n){let{sidebarSide:r="left",sidebarWidth:o="280px",minWidth:a="280px",gap:l="24px",columns:e,rows:b,align:f="stretch",justify:u="stretch",dense:q=!1}=n,R=q?"dense":"",M=`
2503
- align-items: ${f};
2507
+ `}};i("af-alert",Gn);w0=Gn});var ll={};w(ll,{AfriGrid:()=>Xr});function s0(t,n){let{sidebarSide:r="left",sidebarWidth:o="280px",minWidth:a="280px",gap:l="24px",columns:b,rows:e,align:h="stretch",justify:u="stretch",dense:q=!1}=n,R=q?"dense":"",M=`
2508
+ align-items: ${h};
2504
2509
  justify-items: ${u};
2505
2510
  gap: ${l};
2506
2511
  `;switch(t){case"sidebar":return r==="right"?`display: grid; grid-template-columns: 1fr ${o}; ${M}`:`display: grid; grid-template-columns: ${o} 1fr; ${M}`;case"holy-grail":return`
@@ -2520,13 +2525,13 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2520
2525
  grid-template-rows: masonry;
2521
2526
  grid-auto-flow: row ${R};
2522
2527
  ${M}
2523
- `;case"auto":default:{let Y=e?`repeat(${e}, 1fr)`:`repeat(auto-fit, minmax(${a}, 1fr))`,bo=b?`repeat(${b}, 1fr)`:"auto";return`
2528
+ `;case"auto":default:{let Y=b?`repeat(${b}, 1fr)`:`repeat(auto-fit, minmax(${a}, 1fr))`,eo=e?`repeat(${e}, 1fr)`:"auto";return`
2524
2529
  display: grid;
2525
2530
  grid-template-columns: ${Y};
2526
- ${b?`grid-template-rows: ${bo};`:""}
2531
+ ${e?`grid-template-rows: ${eo};`:""}
2527
2532
  grid-auto-flow: row ${R};
2528
2533
  ${M}
2529
- `}}}var Rr;var el=m(()=>{p();Rr=class Rr extends i{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`
2534
+ `}}}var Xr;var bl=v(()=>{p();Xr=class Xr extends f{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`
2530
2535
  @media (max-width: 768px) {
2531
2536
  .grid {
2532
2537
  grid-template-columns: repeat(auto-fit, minmax(min(${t.minWidth}, 100%), 1fr));
@@ -2543,7 +2548,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2543
2548
  grid-template-columns: 1fr;
2544
2549
  }
2545
2550
  }
2546
- `}render(){let t=this._getAttrs(),n=wi(t.layout,t),r=this._buildResponsiveBreakpoints(t)+this._buildSidebarResponsive(t);this.shadowRoot.innerHTML=c`
2551
+ `}render(){let t=this._getAttrs(),n=s0(t.layout,t),r=this._buildResponsiveBreakpoints(t)+this._buildSidebarResponsive(t);this.shadowRoot.innerHTML=d`
2547
2552
  <style>
2548
2553
  :host {
2549
2554
  display: block;
@@ -2573,7 +2578,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2573
2578
  >
2574
2579
  <slot></slot>
2575
2580
  </div>
2576
- `}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 r of n){let o=r.contentRect.width;if(Math.abs(o-t)>10)t=o,this.emit("af-grid-resize",{width:o,height:r.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")}};h("af-grid",Rr)});var bl={};$(bl,{AfriSection:()=>Sr});var Sr;var il=m(()=>{p();Sr=class Sr extends i{render(){let t=this.getAttribute("variant")||"default",n=this.getAttribute("title");this.shadowRoot.innerHTML=c`
2581
+ `}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 r of n){let o=r.contentRect.width;if(Math.abs(o-t)>10)t=o,this.emit("af-grid-resize",{width:o,height:r.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")}};i("af-grid",Xr)});var el={};w(el,{AfriSection:()=>Sr});var Sr;var fl=v(()=>{p();Sr=class Sr extends f{render(){let t=this.getAttribute("title");this.shadowRoot.innerHTML=d`
2577
2582
  <style>
2578
2583
  :host { display: block; width: 100%; }
2579
2584
  .section {
@@ -2600,20 +2605,20 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2600
2605
  }
2601
2606
  </style>
2602
2607
  <section class="section">
2603
- ${n?c`
2608
+ ${t?d`
2604
2609
  <div class="section-header">
2605
- <h2>${n}</h2>
2610
+ <h2>${t}</h2>
2606
2611
  </div>
2607
2612
  `:""}
2608
2613
  <slot></slot>
2609
2614
  </section>
2610
- `}connectedCallback(){this.render()}};h("af-section",Sr)});var fl={};$(fl,{default:()=>xi,AfriIcon:()=>Fn});var Fn,xi;var hl=m(()=>{p();Fn=class Fn extends i{static get observedAttributes(){return["name","size"]}connectedCallback(){this.render()}render(){let t=this.getAttribute("name")||"circle",n=this.getAttribute("size")||"24",o={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=`
2615
+ `}connectedCallback(){this.render()}};i("af-section",Sr)});var hl={};w(hl,{default:()=>x0,AfriIcon:()=>Fn});var Fn,x0;var il=v(()=>{p();Fn=class Fn extends f{static get observedAttributes(){return["name","size"]}connectedCallback(){this.render()}render(){let t=this.getAttribute("name")||"circle",n=this.getAttribute("size")||"24",o={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=`
2611
2616
  <style>
2612
2617
  :host { display: inline-flex; vertical-align: middle; }
2613
2618
  svg { width: ${n}px; height: ${n}px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
2614
2619
  </style>
2615
2620
  <svg viewBox="0 0 24 24">${o}</svg>
2616
- `}};h("af-icon",Fn);xi=Fn});var dl={};$(dl,{default:()=>Ai,AfriAccordion:()=>Bn});var Bn,Ai;var cl=m(()=>{p();Bn=class Bn extends i{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,r)=>{n.addEventListener("click",()=>{this._toggleItem(r)})})}_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"]'),r=n?Array.from(n.children):[],o={tanzania:{accent:"#1EB53A"},maasai:{accent:"#FF0000"},ndebele:{accent:"#4169E1"}},a=o[t]||o.tanzania;this.shadowRoot.innerHTML=`
2621
+ `}};i("af-icon",Fn);x0=Fn});var cl={};w(cl,{default:()=>_0,AfriAccordion:()=>Bn});var Bn,_0;var dl=v(()=>{p();Bn=class Bn extends f{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,r)=>{n.addEventListener("click",()=>{this._toggleItem(r)})})}_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"]'),r=n?Array.from(n.children):[],o={tanzania:{accent:"#1EB53A"},maasai:{accent:"#FF0000"},ndebele:{accent:"#4169E1"}},a=o[t]||o.tanzania;this.shadowRoot.innerHTML=`
2617
2622
  <style>
2618
2623
  :host {
2619
2624
  display: block;
@@ -2691,22 +2696,22 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2691
2696
  </style>
2692
2697
 
2693
2698
  <div class="accordion">
2694
- ${r.map((l,e)=>{let b=this._openItems.has(e),f=`accordion-header-${this._uniqueId}-${e}`,u=`accordion-panel-${this._uniqueId}-${e}`;return`
2699
+ ${r.map((l,b)=>{let e=this._openItems.has(b),h=`accordion-header-${this._uniqueId}-${b}`,u=`accordion-panel-${this._uniqueId}-${b}`;return`
2695
2700
  <div class="accordion-item">
2696
2701
  <button
2697
- class="accordion-header ${b?"active":""}"
2698
- aria-expanded="${b}"
2702
+ class="accordion-header ${e?"active":""}"
2703
+ aria-expanded="${e}"
2699
2704
  aria-controls="${u}"
2700
- id="${f}"
2705
+ id="${h}"
2701
2706
  >
2702
- <span>${l.getAttribute("title")||`Item ${e+1}`}</span>
2707
+ <span>${l.getAttribute("title")||`Item ${b+1}`}</span>
2703
2708
  <span class="accordion-icon">▼</span>
2704
2709
  </button>
2705
2710
  <div
2706
- class="accordion-content ${b?"open":""}"
2711
+ class="accordion-content ${e?"open":""}"
2707
2712
  id="${u}"
2708
2713
  role="region"
2709
- aria-labelledby="${f}"
2714
+ aria-labelledby="${h}"
2710
2715
  >
2711
2716
  <div class="accordion-body">
2712
2717
  ${l.innerHTML}
@@ -2716,7 +2721,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2716
2721
  `}).join("")}
2717
2722
  </div>
2718
2723
  <slot name="items"></slot>
2719
- `}};h("af-accordion",Bn);Ai=Bn});var gl={};$(gl,{default:()=>_i,AfriHero:()=>Dn});var Dn,_i;var sl=m(()=>{p();Ht();rt();Dn=class Dn extends i{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")||"",r=this.getAttribute("pattern")||"",o=this.getAttribute("variant")||"default";this.shadowRoot.innerHTML=`
2724
+ `}};i("af-accordion",Bn);_0=Bn});var gl={};w(gl,{default:()=>A0,AfriHero:()=>Dn});var Dn,A0;var ml=v(()=>{p();Dn=class Dn extends f{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")||"",r=this.getAttribute("pattern")||"";this.shadowRoot.innerHTML=`
2720
2725
  <style>
2721
2726
  :host {
2722
2727
  display: flex;
@@ -2816,7 +2821,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2816
2821
  </div>
2817
2822
  <slot></slot>
2818
2823
  </div>
2819
- `}};h("af-hero",Dn);_i=Dn});var ml={};$(ml,{default:()=>ki,AfriTable:()=>En});var En,ki;var vl=m(()=>{p();En=class En extends i{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 r=t[this._sortColumn],o=n[this._sortColumn],a=this._sortDirection==="asc"?1:-1;if(typeof r==="number")return(r-o)*a;return String(r).localeCompare(String(o))*a})}render(){let t=this.getAttribute("theme")||"tanzania",n=this.hasAttribute("striped"),r=this.hasAttribute("hoverable"),o={tanzania:{header:"#1EB53A",text:"#FFFFFF",accent:"#FCD116"},maasai:{header:"#8B0000",text:"#FFFFFF",accent:"#FF0000"},ndebele:{header:"#4169E1",text:"#FFFFFF",accent:"#FFD700"}},a=o[t]||o.tanzania,l=this._getSortedData();this.shadowRoot.innerHTML=`
2824
+ `}};i("af-hero",Dn);A0=Dn});var vl={};w(vl,{default:()=>k0,AfriTable:()=>En});var En,k0;var $l=v(()=>{p();En=class En extends f{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 r=t[this._sortColumn],o=n[this._sortColumn],a=this._sortDirection==="asc"?1:-1;if(typeof r==="number")return(r-o)*a;return String(r).localeCompare(String(o))*a})}render(){let t=this.getAttribute("theme")||"tanzania",n=this.hasAttribute("striped"),r=this.hasAttribute("hoverable"),o={tanzania:{header:"#1EB53A",text:"#FFFFFF",accent:"#FCD116"},maasai:{header:"#8B0000",text:"#FFFFFF",accent:"#FF0000"},ndebele:{header:"#4169E1",text:"#FFFFFF",accent:"#FFD700"}},a=o[t]||o.tanzania,l=this._getSortedData();this.shadowRoot.innerHTML=`
2820
2825
  <style>
2821
2826
  :host {
2822
2827
  display: block;
@@ -2883,20 +2888,20 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2883
2888
  <table>
2884
2889
  <thead>
2885
2890
  <tr>
2886
- ${this._columns.map((e)=>`
2887
- <th data-column="${e.key}">
2888
- ${e.label}
2891
+ ${this._columns.map((b)=>`
2892
+ <th data-column="${b.key}">
2893
+ ${b.label}
2889
2894
  <span class="sort-icon">
2890
- ${this._sortColumn===e.key?this._sortDirection==="asc"?"↑":"↓":"↕"}
2895
+ ${this._sortColumn===b.key?this._sortDirection==="asc"?"↑":"↓":"↕"}
2891
2896
  </span>
2892
2897
  </th>
2893
2898
  `).join("")}
2894
2899
  </tr>
2895
2900
  </thead>
2896
2901
  <tbody>
2897
- ${l.length?l.map((e)=>`
2902
+ ${l.length?l.map((b)=>`
2898
2903
  <tr>
2899
- ${this._columns.map((b)=>`<td>${e[b.key]??""}</td>`).join("")}
2904
+ ${this._columns.map((e)=>`<td>${b[e.key]??""}</td>`).join("")}
2900
2905
  </tr>
2901
2906
  `).join(""):`
2902
2907
  <tr>
@@ -2906,7 +2911,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2906
2911
  </tbody>
2907
2912
  </table>
2908
2913
  </div>
2909
- `,this.shadowRoot.querySelectorAll("th").forEach((e)=>{e.addEventListener("click",()=>{this._handleSort(e.dataset.column)})})}};h("af-table",En);ki=En});var pl={};$(pl,{default:()=>qi,AfriModal:()=>Wn});var Wn,qi;var ul=m(()=>{p();Wn=class Wn extends i{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"])',r=Array.from(t?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')||[]),o=Array.from(this.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));return[...r,...o]}_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 r=n[0],o=n[n.length-1];if(t.shiftKey){if(document.activeElement===r)t.preventDefault(),o.focus()}else if(document.activeElement===o)t.preventDefault(),r.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,r){if(this.render(),t==="open")this._setupListeners()}render(){let t=this.hasAttribute("open"),n=this.getAttribute("theme")||"tanzania",r=this.getAttribute("size")||"md",o={tanzania:{accent:"#1EB53A"},maasai:{accent:"#FF0000"},ndebele:{accent:"#4169E1"}},a=o[n]||o.tanzania,l={sm:"400px",md:"560px",lg:"720px",full:"95vw"},e=this.getAttribute("aria-label"),b=this.getAttribute("aria-labelledby")||"modal-title";this.shadowRoot.innerHTML=`
2914
+ `,this.shadowRoot.querySelectorAll("th").forEach((b)=>{b.addEventListener("click",()=>{this._handleSort(b.dataset.column)})})}};i("af-table",En);k0=En});var pl={};w(pl,{default:()=>q0,AfriModal:()=>Wn});var Wn,q0;var ul=v(()=>{p();Wn=class Wn extends f{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"])',r=Array.from(t?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')||[]),o=Array.from(this.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));return[...r,...o]}_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 r=n[0],o=n[n.length-1];if(t.shiftKey){if(document.activeElement===r)t.preventDefault(),o.focus()}else if(document.activeElement===o)t.preventDefault(),r.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,r){if(this.render(),t==="open")this._setupListeners()}render(){let t=this.hasAttribute("open"),n=this.getAttribute("theme")||"tanzania",r=this.getAttribute("size")||"md",o={tanzania:{accent:"#1EB53A"},maasai:{accent:"#FF0000"},ndebele:{accent:"#4169E1"}},a=o[n]||o.tanzania,l={sm:"400px",md:"560px",lg:"720px",full:"95vw"},b=this.getAttribute("aria-label"),e=this.getAttribute("aria-labelledby")||"modal-title";this.shadowRoot.innerHTML=`
2910
2915
  <style>
2911
2916
  :host {
2912
2917
  font-family: 'Inter', system-ui, sans-serif;
@@ -2997,7 +3002,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
2997
3002
  </style>
2998
3003
 
2999
3004
  <div class="backdrop">
3000
- <div class="modal" role="dialog" aria-modal="true" ${e?`aria-label="${e}"`:`aria-labelledby="${b}"`}>
3005
+ <div class="modal" role="dialog" aria-modal="true" ${b?`aria-label="${b}"`:`aria-labelledby="${e}"`}>
3001
3006
  <div class="modal-header">
3002
3007
  <slot name="header" id="modal-title"></slot>
3003
3008
  <button class="close-btn" aria-label="Close modal">×</button>
@@ -3010,7 +3015,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3010
3015
  </div>
3011
3016
  </div>
3012
3017
  </div>
3013
- `}};h("af-modal",Wn);qi=Wn});var $l={};$($l,{default:()=>Li,AfriTabs:()=>On});var On,Li;var wl=m(()=>{p();On=class On extends i{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"]'),r=n?Array.from(n.children):[];if(r.length===0)return;switch(t.key){case"ArrowLeft":t.preventDefault(),this._activeTab=this._activeTab>0?this._activeTab-1:r.length-1,this.render(),this._setupTabs(),this._focusActiveTab();break;case"ArrowRight":t.preventDefault(),this._activeTab=this._activeTab<r.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=r.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,r)=>{n.addEventListener("click",()=>{this._activeTab=r,this.render(),this._setupTabs(),this.emit("af-tab-change",{index:r,tab:n.textContent})})})}attributeChangedCallback(){this.render(),this._setupTabs()}render(){let t=this.getAttribute("theme")||"tanzania",n=this.querySelector('[slot="tabs"]'),r=n?Array.from(n.children):[],o={tanzania:{active:"#1EB53A",text:"#FFFFFF"},maasai:{active:"#FF0000",text:"#FFFFFF"},ndebele:{active:"#4169E1",text:"#FFFFFF"}},a=o[t]||o.tanzania;this.shadowRoot.innerHTML=`
3018
+ `}};i("af-modal",Wn);q0=Wn});var wl={};w(wl,{default:()=>L0,AfriTabs:()=>On});var On,L0;var sl=v(()=>{p();On=class On extends f{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"]'),r=n?Array.from(n.children):[];if(r.length===0)return;switch(t.key){case"ArrowLeft":t.preventDefault(),this._activeTab=this._activeTab>0?this._activeTab-1:r.length-1,this.render(),this._setupTabs(),this._focusActiveTab();break;case"ArrowRight":t.preventDefault(),this._activeTab=this._activeTab<r.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=r.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,r)=>{n.addEventListener("click",()=>{this._activeTab=r,this.render(),this._setupTabs(),this.emit("af-tab-change",{index:r,tab:n.textContent})})})}attributeChangedCallback(){this.render(),this._setupTabs()}render(){let t=this.getAttribute("theme")||"tanzania",n=this.querySelector('[slot="tabs"]'),r=n?Array.from(n.children):[],o={tanzania:{active:"#1EB53A",text:"#FFFFFF"},maasai:{active:"#FF0000",text:"#FFFFFF"},ndebele:{active:"#4169E1",text:"#FFFFFF"}},a=o[t]||o.tanzania;this.shadowRoot.innerHTML=`
3014
3019
  <style>
3015
3020
  :host {
3016
3021
  display: block;
@@ -3082,30 +3087,30 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3082
3087
 
3083
3088
  <div class="tabs-container">
3084
3089
  <div class="tab-list" role="tablist">
3085
- ${r.map((l,e)=>`
3086
- <button class="tab-button ${e===this._activeTab?"active":""}"
3090
+ ${r.map((l,b)=>`
3091
+ <button class="tab-button ${b===this._activeTab?"active":""}"
3087
3092
  role="tab"
3088
- aria-selected="${e===this._activeTab}"
3089
- aria-controls="panel-${e}"
3090
- tabindex="${e===this._activeTab?"0":"-1"}"
3091
- id="tab-${e}">
3092
- ${l.getAttribute("label")||`Tab ${e+1}`}
3093
+ aria-selected="${b===this._activeTab}"
3094
+ aria-controls="panel-${b}"
3095
+ tabindex="${b===this._activeTab?"0":"-1"}"
3096
+ id="tab-${b}">
3097
+ ${l.getAttribute("label")||`Tab ${b+1}`}
3093
3098
  </button>
3094
3099
  `).join("")}
3095
3100
  </div>
3096
3101
  <div class="tab-panels">
3097
- ${r.map((l,e)=>`
3098
- <div class="tab-panel ${e===this._activeTab?"active":""}"
3102
+ ${r.map((l,b)=>`
3103
+ <div class="tab-panel ${b===this._activeTab?"active":""}"
3099
3104
  role="tabpanel"
3100
- id="panel-${e}"
3101
- aria-labelledby="tab-${e}">
3105
+ id="panel-${b}"
3106
+ aria-labelledby="tab-${b}">
3102
3107
  ${l.innerHTML}
3103
3108
  </div>
3104
3109
  `).join("")}
3105
3110
  </div>
3106
3111
  </div>
3107
3112
  <slot name="tabs"></slot>
3108
- `}};h("af-tabs",On);Li=On});var xl={};$(xl,{default:()=>Hi,AfriSidebar:()=>Un});var Un,Hi;var Al=m(()=>{p();Ht();rt();Un=class Un extends i{static get observedAttributes(){return["position"]}constructor(){super();this._unsubscribe=null}connectedCallback(){super.connectedCallback(),this._unsubscribe=T(()=>{this.updateUI()}),this.render()}disconnectedCallback(){if(this._unsubscribe)this._unsubscribe()}updateUI(){let t=J.ui.sidebarCollapsed,n=this.shadowRoot.querySelector(".sidebar"),r=this.shadowRoot.querySelector(".sidebar-title"),o=this.shadowRoot.getElementById("toggle"),a=this.shadowRoot.querySelector(".sidebar-content");if(n)n.style.width=t?"60px":"260px";if(r)r.style.opacity=t?"0":"1";if(a)a.style.padding=t?"12px":"20px";if(o)o.innerHTML=t?"→":"← Collapse"}render(){let t=this.getAttribute("position")||"left",n=J.ui.sidebarCollapsed;this.shadowRoot.innerHTML=`
3113
+ `}};i("af-tabs",On);L0=On});var xl={};w(xl,{default:()=>H0,AfriSidebar:()=>Un});var Un,H0;var _l=v(()=>{p();co();Ht();Un=class Un extends f{static get observedAttributes(){return["position"]}constructor(){super();this._unsubscribe=null}connectedCallback(){super.connectedCallback(),this._unsubscribe=ht(()=>{this.updateUI()}),this.render()}disconnectedCallback(){if(this._unsubscribe)this._unsubscribe()}updateUI(){let t=G.ui.sidebarCollapsed,n=this.shadowRoot.querySelector(".sidebar"),r=this.shadowRoot.querySelector(".sidebar-title"),o=this.shadowRoot.getElementById("toggle"),a=this.shadowRoot.querySelector(".sidebar-content");if(n)n.style.width=t?"60px":"260px";if(r)r.style.opacity=t?"0":"1";if(a)a.style.padding=t?"12px":"20px";if(o)o.innerHTML=t?"→":"← Collapse"}render(){let t=this.getAttribute("position")||"left",n=G.ui.sidebarCollapsed;this.shadowRoot.innerHTML=`
3109
3114
  <style>
3110
3115
  :host {
3111
3116
  display: block;
@@ -3214,7 +3219,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3214
3219
  </button>
3215
3220
  </div>
3216
3221
  </aside>
3217
- `,this.shadowRoot.getElementById("toggle").addEventListener("click",()=>{actions.toggleSidebar()})}};h("af-sidebar",Un);Hi=Un});var _l={};$(_l,{default:()=>Mi,AfriDropdown:()=>Nn});var Nn,Mi;var kl=m(()=>{p();Nn=class Nn extends i{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=`
3222
+ `,this.shadowRoot.getElementById("toggle").addEventListener("click",()=>{vn.toggleSidebar()})}};i("af-sidebar",Un);H0=Un});var Al={};w(Al,{default:()=>M0,AfriDropdown:()=>Nn});var Nn,M0;var kl=v(()=>{p();Nn=class Nn extends f{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=`
3218
3223
  <style>
3219
3224
  :host {
3220
3225
  display: inline-block;
@@ -3296,7 +3301,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3296
3301
  <div class="dropdown-menu" role="menu" ${n?"":'aria-hidden="true"'}>
3297
3302
  <slot></slot>
3298
3303
  </div>
3299
- `,this.shadowRoot.getElementById("trigger").addEventListener("click",(r)=>{r.stopPropagation(),this.toggle()})}};h("af-dropdown",Nn);Mi=Nn});var ql={};$(ql,{default:()=>Ri,AfriSelect:()=>yn});var yn,Ri;var Ll=m(()=>{p();yn=class yn extends i{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",(r)=>{this._handleKeydown(r)}),this.shadowRoot.querySelectorAll(".select-option").forEach((r,o)=>{r.addEventListener("click",()=>{this._selectOption(o)})}),document.addEventListener("click",(r)=>{if(!this.contains(r.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 r=this._selectedIndex+t;if(r<0)r=n.length-1;if(r>=n.length)r=0;this._selectedIndex=r,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",r=this.getAttribute("theme")||"tanzania",o=this.getAttribute("error")||"",a=this.hasAttribute("required"),l=this.getAttribute("aria-label"),e=this.getAttribute("aria-describedby"),b={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},f=b[r]||b.tanzania,u=[];if(o)u.push(`error-${this._uniqueId}`);if(e)u.push(...e.split(" "));let q=u.length>0?`aria-describedby="${u.join(" ")}"`:"",R=this._selectedIndex>=0?this._options[this._selectedIndex]?.label:n;this.shadowRoot.innerHTML=`
3304
+ `,this.shadowRoot.getElementById("trigger").addEventListener("click",(r)=>{r.stopPropagation(),this.toggle()})}};i("af-dropdown",Nn);M0=Nn});var ql={};w(ql,{default:()=>R0,AfriSelect:()=>Vn});var Vn,R0;var Ll=v(()=>{p();Vn=class Vn extends f{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");t?.addEventListener("click",()=>{this._toggleDropdown()}),t?.addEventListener("keydown",(n)=>{this._handleKeydown(n)}),this.shadowRoot.querySelectorAll(".select-option").forEach((n,r)=>{n.addEventListener("click",()=>{this._selectOption(r)})}),document.addEventListener("click",(n)=>{if(!this.contains(n.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 r=this._selectedIndex+t;if(r<0)r=n.length-1;if(r>=n.length)r=0;this._selectedIndex=r,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",r=this.getAttribute("theme")||"tanzania",o=this.getAttribute("error")||"",a=this.hasAttribute("required"),l=this.getAttribute("aria-label"),b=this.getAttribute("aria-describedby"),e={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},h=e[r]||e.tanzania,u=[];if(o)u.push(`error-${this._uniqueId}`);if(b)u.push(...b.split(" "));let q=u.length>0?`aria-describedby="${u.join(" ")}"`:"",R=this._selectedIndex>=0?this._options[this._selectedIndex]?.label:n;this.shadowRoot.innerHTML=`
3300
3305
  <style>
3301
3306
  :host {
3302
3307
  display: block;
@@ -3313,7 +3318,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3313
3318
  }
3314
3319
 
3315
3320
  .required-star {
3316
- color: ${f.error};
3321
+ color: ${h.error};
3317
3322
  margin-left: 2px;
3318
3323
  }
3319
3324
 
@@ -3325,7 +3330,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3325
3330
  width: 100%;
3326
3331
  padding: 10px 40px 10px 13px;
3327
3332
  font-size: 15px;
3328
- border: 2px solid ${o?f.error:"#ddd"};
3333
+ border: 2px solid ${o?h.error:"#ddd"};
3329
3334
  border-radius: 5px;
3330
3335
  background: white;
3331
3336
  cursor: pointer;
@@ -3338,8 +3343,8 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3338
3343
  .select-trigger:focus,
3339
3344
  .select-trigger.open {
3340
3345
  outline: none;
3341
- border-color: ${o?f.error:f.focus};
3342
- box-shadow: 0 0 0 3px ${o?f.error+"20":f.focus+"20"};
3346
+ border-color: ${o?h.error:h.focus};
3347
+ box-shadow: 0 0 0 3px ${o?h.error+"20":h.focus+"20"};
3343
3348
  }
3344
3349
 
3345
3350
  .select-arrow {
@@ -3385,18 +3390,18 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3385
3390
  }
3386
3391
 
3387
3392
  .select-option:hover {
3388
- background: ${f.focus}15;
3393
+ background: ${h.focus}15;
3389
3394
  }
3390
3395
 
3391
3396
  .select-option.selected {
3392
- background: ${f.focus};
3397
+ background: ${h.focus};
3393
3398
  color: white;
3394
3399
  }
3395
3400
 
3396
3401
  .error-text {
3397
3402
  font-size: 12px;
3398
3403
  margin-top: 4px;
3399
- color: ${f.error};
3404
+ color: ${h.error};
3400
3405
  }
3401
3406
 
3402
3407
  ::slotted(option) {
@@ -3432,7 +3437,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3432
3437
  </div>
3433
3438
  ${o?`<div id="error-${this._uniqueId}" class="error-text" role="alert">${o}</div>`:""}
3434
3439
  <slot></slot>
3435
- `}};h("af-select",yn);Ri=yn});var Hl={};$(Hl,{default:()=>Si,AfriForm:()=>Vn});var Vn,Si;var Ml=m(()=>{p();qn();Vn=class Vn extends i{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,r=this.querySelector('[type="submit"]')||this.shadowRoot.querySelector('button[type="submit"]'),o=this.getAttribute("schema"),a=o?this._getSchema(o):null,l=this.getAttribute("action"),e=this.getAttribute("method")||"GET",b=new FormData(n),f=Object.fromEntries(b.entries());if(Array.from(this.querySelectorAll("af-input")).forEach((q)=>{let R=q.getAttribute("name");if(R)f[R]=q.value}),a){let q=ft.validate(a,f);if(!q.success){this._showValidationErrors(q.errors),this.emit("af-validation-error",{errors:q.errors});return}}if(!l)return;if(r){var u=r.textContent;r.textContent="Wait...",r.disabled=!0}try{let q=await fetch(l,{method:e,headers:{"Content-Type":"application/json"},body:JSON.stringify(f)});if(q.ok)this.emit("success",await q.json()),this.setAttribute("success","Form submitted successfully!"),this.removeAttribute("error");else{let R=await q.text();this.emit("error",R),this.setAttribute("error",R),this.removeAttribute("success")}}catch(q){this.emit("error",q.message),this.setAttribute("error",q.message),this.removeAttribute("success")}finally{if(r)r.textContent=u,r.disabled=!1}}_getSchema(t){return kn[t]||null}_showValidationErrors(t){this.shadowRoot.querySelectorAll(".field-error").forEach((n)=>n.remove()),Object.entries(t).forEach(([n,r])=>{let o=this.querySelector(`[name="${n}"]`);if(o)if(o.tagName==="AF-INPUT")o.setAttribute("error",r);else{let a=document.createElement("div");a.className="field-error",a.textContent=r,a.style.color="red",a.style.fontSize="12px",a.style.marginTop="4px",o.parentNode.insertBefore(a,o.nextSibling)}})}};h("af-form",Vn);Si=Vn});var Rl={};$(Rl,{default:()=>Xi,AfriTooltip:()=>Kn});var Kn,Xi;var Sl=m(()=>{p();Kn=class Kn extends i{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",r={top:`
3440
+ `}};i("af-select",Vn);R0=Vn});var Hl={};w(Hl,{default:()=>X0,AfriForm:()=>Kn});var Kn,X0;var Ml=v(()=>{p();qn();Kn=class Kn extends f{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,r=this.querySelector('[type="submit"]')||this.shadowRoot.querySelector('button[type="submit"]'),o=this.getAttribute("schema"),a=o?this._getSchema(o):null,l=this.getAttribute("action"),b=this.getAttribute("method")||"GET",e=new FormData(n),h=Object.fromEntries(e.entries());if(Array.from(this.querySelectorAll("af-input")).forEach((q)=>{let R=q.getAttribute("name");if(R)h[R]=q.value}),a){let q=et.validate(a,h);if(!q.success){this._showValidationErrors(q.errors),this.emit("af-validation-error",{errors:q.errors});return}}if(!l)return;if(r){var u=r.textContent;r.textContent="Wait...",r.disabled=!0}try{let q=await fetch(l,{method:b,headers:{"Content-Type":"application/json"},body:JSON.stringify(h)});if(q.ok)this.emit("success",await q.json()),this.setAttribute("success","Form submitted successfully!"),this.removeAttribute("error");else{let R=await q.text();this.emit("error",R),this.setAttribute("error",R),this.removeAttribute("success")}}catch(q){this.emit("error",q.message),this.setAttribute("error",q.message),this.removeAttribute("success")}finally{if(r)r.textContent=u,r.disabled=!1}}_getSchema(t){return kn[t]||null}_showValidationErrors(t){this.shadowRoot.querySelectorAll(".field-error").forEach((n)=>n.remove()),Object.entries(t).forEach(([n,r])=>{let o=this.querySelector(`[name="${n}"]`);if(o)if(o.tagName==="AF-INPUT")o.setAttribute("error",r);else{let a=document.createElement("div");a.className="field-error",a.textContent=r,a.style.color="red",a.style.fontSize="12px",a.style.marginTop="4px",o.parentNode.insertBefore(a,o.nextSibling)}})}};i("af-form",Kn);X0=Kn});var Rl={};w(Rl,{default:()=>S0,AfriTooltip:()=>yn});var yn,S0;var Xl=v(()=>{p();yn=class yn extends f{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",r={top:`
3436
3441
  bottom: 100%;
3437
3442
  left: 50%;
3438
3443
  transform: translateX(-50%) translateY(-8px);
@@ -3521,7 +3526,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3521
3526
  <slot></slot>
3522
3527
  </span>
3523
3528
  <div class="tooltip-content" id="${this._tooltipId}" role="tooltip" aria-hidden="true">${t}</div>
3524
- `}};h("af-tooltip",Kn);Xi=Kn});var Xl={};$(Xl,{default:()=>Yi,AfriToast:()=>jn});var jn,Yi;var Yl=m(()=>{p();jn=class jn extends i{static get observedAttributes(){return["type","message","duration"]}constructor(){super();this.render()}show(t,n="info",r=4000){if(this.setAttribute("message",t),this.setAttribute("type",n),this.render(),this.shadowRoot.querySelector(".toast").classList.add("show"),r>0)setTimeout(()=>this.hide(),r)}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")||"",r={success:"✓",error:"✗",warning:"⚠",info:"ℹ"},o={success:"#1EB53A",error:"#EF3340",warning:"#FCD116",info:"#00A3DD"};this.shadowRoot.innerHTML=`
3529
+ `}};i("af-tooltip",yn);S0=yn});var Sl={};w(Sl,{default:()=>Y0,AfriToast:()=>jn});var jn,Y0;var Yl=v(()=>{p();jn=class jn extends f{static get observedAttributes(){return["type","message","duration"]}constructor(){super();this.render()}show(t,n="info",r=4000){if(this.setAttribute("message",t),this.setAttribute("type",n),this.render(),this.shadowRoot.querySelector(".toast").classList.add("show"),r>0)setTimeout(()=>this.hide(),r)}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")||"",r={success:"✓",error:"✗",warning:"⚠",info:"ℹ"},o={success:"#1EB53A",error:"#EF3340",warning:"#FCD116",info:"#00A3DD"};this.shadowRoot.innerHTML=`
3525
3530
  <style>
3526
3531
  :host {
3527
3532
  position: fixed;
@@ -3595,7 +3600,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3595
3600
  </div>
3596
3601
  <button class="toast-close" id="close">×</button>
3597
3602
  </div>
3598
- `,this.shadowRoot.getElementById("close")?.addEventListener("click",()=>this.hide())}};h("af-toast",jn);Yi=jn});var Jl={};$(Jl,{default:()=>Ji,AfriBadge:()=>Cn});var Cn,Ji;var Gl=m(()=>{p();Cn=class Cn extends i{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",r=this.hasAttribute("removable"),o={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"}},a=o[t]||o.default,l={sm:{padding:"2px 6px",fontSize:"11px"},md:{padding:"4px 10px",fontSize:"13px"},lg:{padding:"6px 14px",fontSize:"15px"}},e=l[n]||l.md;this.shadowRoot.innerHTML=`
3603
+ `,this.shadowRoot.getElementById("close")?.addEventListener("click",()=>this.hide())}};i("af-toast",jn);Y0=jn});var Jl={};w(Jl,{default:()=>J0,AfriBadge:()=>Cn});var Cn,J0;var Ql=v(()=>{p();Cn=class Cn extends f{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",r=this.hasAttribute("removable"),o={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"}},a=o[t]||o.default,l={sm:{padding:"2px 6px",fontSize:"11px"},md:{padding:"4px 10px",fontSize:"13px"},lg:{padding:"6px 14px",fontSize:"15px"}},b=l[n]||l.md;this.shadowRoot.innerHTML=`
3599
3604
  <style>
3600
3605
  :host {
3601
3606
  display: inline-block;
@@ -3606,8 +3611,8 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3606
3611
  display: inline-flex;
3607
3612
  align-items: center;
3608
3613
  gap: 5px;
3609
- padding: ${e.padding};
3610
- font-size: ${e.fontSize};
3614
+ padding: ${b.padding};
3615
+ font-size: ${b.fontSize};
3611
3616
  font-weight: 600;
3612
3617
  background: ${a.bg};
3613
3618
  color: ${a.text};
@@ -3636,7 +3641,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3636
3641
  <slot></slot>
3637
3642
  ${r?'<button class="remove-btn" aria-label="Remove">×</button>':""}
3638
3643
  </span>
3639
- `}};h("af-badge",Cn);Ji=Cn});var Ql={};$(Ql,{default:()=>Gi,AfriAvatar:()=>In});var In,Gi;var Fl=m(()=>{p();In=class In extends i{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")||"",r=this.getAttribute("size")||"md",o=this.getAttribute("status"),a=this.getAttribute("theme")||"tanzania",l={tanzania:"#1EB53A",maasai:"#FF0000",ndebele:"#4169E1",gold:"#FCD116"},e=l[a]||l.tanzania,b={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"}},f=b[r]||b.md,u={online:"#28a745",offline:"#6c757d",busy:"#dc3545",away:"#ffc107"};this.shadowRoot.innerHTML=`
3644
+ `}};i("af-badge",Cn);J0=Cn});var Gl={};w(Gl,{default:()=>Q0,AfriAvatar:()=>In});var In,Q0;var Fl=v(()=>{p();In=class In extends f{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")||"",r=this.getAttribute("size")||"md",o=this.getAttribute("status"),a=this.getAttribute("theme")||"tanzania",l={tanzania:"#1EB53A",maasai:"#FF0000",ndebele:"#4169E1",gold:"#FCD116"},b=l[a]||l.tanzania,e={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"}},h=e[r]||e.md,u={online:"#28a745",offline:"#6c757d",busy:"#dc3545",away:"#ffc107"};this.shadowRoot.innerHTML=`
3640
3645
  <style>
3641
3646
  :host {
3642
3647
  display: inline-block;
@@ -3645,16 +3650,16 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3645
3650
 
3646
3651
  .avatar {
3647
3652
  position: relative;
3648
- width: ${f.size};
3649
- height: ${f.size};
3653
+ width: ${h.size};
3654
+ height: ${h.size};
3650
3655
  border-radius: 50%;
3651
3656
  display: flex;
3652
3657
  align-items: center;
3653
3658
  justify-content: center;
3654
- background: ${e};
3659
+ background: ${b};
3655
3660
  color: white;
3656
3661
  font-weight: 600;
3657
- font-size: ${f.font};
3662
+ font-size: ${h.font};
3658
3663
  overflow: hidden;
3659
3664
  }
3660
3665
 
@@ -3668,8 +3673,8 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3668
3673
  position: absolute;
3669
3674
  bottom: 0;
3670
3675
  right: 0;
3671
- width: ${f.status};
3672
- height: ${f.status};
3676
+ width: ${h.status};
3677
+ height: ${h.status};
3673
3678
  border-radius: 50%;
3674
3679
  border: 2px solid white;
3675
3680
  background: ${o?u[o]||u.offline:"transparent"};
@@ -3680,7 +3685,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3680
3685
  ${t?`<img src="${t}" alt="${n}" />`:this._getInitials(n)}
3681
3686
  ${o?'<span class="status"></span>':""}
3682
3687
  </div>
3683
- `}};h("af-avatar",In);Gi=In});var Bl={};$(Bl,{default:()=>Qi,AfriProgress:()=>Pn});var Pn,Qi;var Dl=m(()=>{p();Pn=class Pn extends i{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,r=this.getAttribute("theme")||"tanzania",o=this.getAttribute("size")||"md",a=this.getAttribute("label"),l=this.hasAttribute("animated"),e=Math.min(100,Math.max(0,t/n*100)),b={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"}},f=b[r]||b.tanzania,u={sm:"6px",md:"10px",lg:"16px"},q=u[o]||u.md;this.shadowRoot.innerHTML=`
3688
+ `}};i("af-avatar",In);Q0=In});var Bl={};w(Bl,{default:()=>G0,AfriProgress:()=>Pn});var Pn,G0;var Dl=v(()=>{p();Pn=class Pn extends f{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,r=this.getAttribute("theme")||"tanzania",o=this.getAttribute("size")||"md",a=this.getAttribute("label"),l=this.hasAttribute("animated"),b=Math.min(100,Math.max(0,t/n*100)),e={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"}},h=e[r]||e.tanzania,u={sm:"6px",md:"10px",lg:"16px"},q=u[o]||u.md;this.shadowRoot.innerHTML=`
3684
3689
  <style>
3685
3690
  :host {
3686
3691
  display: block;
@@ -3710,15 +3715,15 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3710
3715
  .progress-track {
3711
3716
  width: 100%;
3712
3717
  height: ${q};
3713
- background: ${f.track};
3718
+ background: ${h.track};
3714
3719
  border-radius: 100px;
3715
3720
  overflow: hidden;
3716
3721
  }
3717
3722
 
3718
3723
  .progress-bar {
3719
3724
  height: 100%;
3720
- width: ${e}%;
3721
- background: ${f.bar};
3725
+ width: ${b}%;
3726
+ background: ${h.bar};
3722
3727
  border-radius: 100px;
3723
3728
  transition: width 500ms ease-out;
3724
3729
  ${l?`
@@ -3744,12 +3749,10 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3744
3749
  </style>
3745
3750
 
3746
3751
  <div class="progress-container">
3747
- ${`
3748
- <div class="progress-header">
3749
- <span class="progress-label">${a||""}</span>
3750
- <span class="progress-value">${e.toFixed(0)}%</span>
3751
- </div>
3752
- `}
3752
+ <div class="progress-header">
3753
+ <span class="progress-label">${a||""}</span>
3754
+ <span class="progress-value">${b.toFixed(0)}%</span>
3755
+ </div>
3753
3756
  <div class="progress-track">
3754
3757
  <div class="progress-bar" role="progressbar"
3755
3758
  aria-valuenow="${t}"
@@ -3757,7 +3760,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3757
3760
  aria-valuemax="${n}"></div>
3758
3761
  </div>
3759
3762
  </div>
3760
- `}};h("af-progress",Pn);Qi=Pn});var El={};$(El,{default:()=>Fi,AfriLoader:()=>Tn});var Tn,Fi;var Wl=m(()=>{p();Tn=class Tn extends i{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",r=this.getAttribute("type")||"spiral",o={spiral:`M25,25 m0,-20 a20,20 0 1,1 0,40 a20,20 0 1,1 0,-40
3763
+ `}};i("af-progress",Pn);G0=Pn});var El={};w(El,{default:()=>F0,AfriLoader:()=>Tn});var Tn,F0;var Wl=v(()=>{p();Tn=class Tn extends f{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",r=this.getAttribute("type")||"spiral",o={spiral:`M25,25 m0,-20 a20,20 0 1,1 0,40 a20,20 0 1,1 0,-40
3761
3764
  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=`
3762
3765
  <style>
3763
3766
  :host {
@@ -3788,7 +3791,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3788
3791
  ${r==="spiral"?`<path d="${o.spiral}" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" />`:r==="sun"?`<path d="${o.sun}" stroke="currentColor" stroke-width="4" stroke-linecap="round" />`:`<path d="${o.diamond}" fill="none" stroke="currentColor" stroke-width="4" />`}
3789
3792
  </svg>
3790
3793
  </div>
3791
- `}};h("af-loader",Tn);Fi=Tn});var Ol={};$(Ol,{default:()=>Bi,AfriSkeleton:()=>Zn});var Zn,Bi;var Ul=m(()=>{p();Zn=class Zn extends i{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%",r=this.getAttribute("height")||"auto",o=parseInt(this.getAttribute("lines"))||1,a={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"}},l=a[t]||a.text;this.shadowRoot.innerHTML=`
3794
+ `}};i("af-loader",Tn);F0=Tn});var Ol={};w(Ol,{default:()=>B0,AfriSkeleton:()=>Zn});var Zn,B0;var Ul=v(()=>{p();Zn=class Zn extends f{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%",r=this.getAttribute("height")||"auto",o=parseInt(this.getAttribute("lines"))||1,a={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"}},l=a[t]||a.text;this.shadowRoot.innerHTML=`
3792
3795
  <style>
3793
3796
  :host {
3794
3797
  display: block;
@@ -3824,7 +3827,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3824
3827
  </style>
3825
3828
 
3826
3829
  ${t==="text"||t==="title"?Array(o).fill(0).map(()=>'<div class="skeleton skeleton-line"></div>').join(""):`<div class="skeleton" style="width: ${l.width||n}; height: ${l.height||r};"></div>`}
3827
- `}};h("af-skeleton",Zn);Bi=Zn});var Nl={};$(Nl,{default:()=>Di,AfriDivider:()=>zn});var zn,Di;var yl=m(()=>{p();zn=class zn extends i{static get observedAttributes(){return["pattern","height","color","flip"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}_getPatternPath(t,n,r){switch(t||"zigzag"){case"zigzag":return`M0,${r} L${n/4},0 L${n/2},${r} L${n*0.75},0 L${n},${r} V${r+10} H0 Z`;case"waves":return`M0,${r/2} Q${n/4},0 ${n/2},${r/2} T${n},${r/2} V${r} H0 Z`;case"triangles":return`M0,${r} L${n/8},0 L${n/4},${r} L${n*0.375},0 L${n/2},${r}
3830
+ `}};i("af-skeleton",Zn);B0=Zn});var Nl={};w(Nl,{default:()=>D0,AfriDivider:()=>zn});var zn,D0;var Vl=v(()=>{p();zn=class zn extends f{static get observedAttributes(){return["pattern","height","color","flip"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}_getPatternPath(t,n,r){switch(t||"zigzag"){case"zigzag":return`M0,${r} L${n/4},0 L${n/2},${r} L${n*0.75},0 L${n},${r} V${r+10} H0 Z`;case"waves":return`M0,${r/2} Q${n/4},0 ${n/2},${r/2} T${n},${r/2} V${r} H0 Z`;case"triangles":return`M0,${r} L${n/8},0 L${n/4},${r} L${n*0.375},0 L${n/2},${r}
3828
3831
  L${n*0.625},0 L${n*0.75},${r} L${n*0.875},0 L${n},${r} V${r+10} H0 Z`;case"diamonds":return`M0,0 H${n} V${r/2}
3829
3832
  L${n*0.9},${r} L${n*0.8},${r/2}
3830
3833
  L${n*0.7},${r} L${n*0.6},${r/2}
@@ -3849,7 +3852,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3849
3852
  <svg viewBox="0 0 100 ${n}" preserveAspectRatio="none">
3850
3853
  <path d="${this._getPatternPath(t,100,parseInt(n))}" fill="currentColor" />
3851
3854
  </svg>
3852
- `}};h("af-divider",zn);Di=zn});var Vl={};$(Vl,{default:()=>Ei,KangaCard:()=>to});var to,Ei;var Kl=m(()=>{p();Rt();to=class to extends i{static get observedAttributes(){return["theme","proverb","proverb-translation"]}constructor(){super();this.render()}connectedCallback(){this.loadStyles(),this.applyTheme()}attributeChangedCallback(t,n,r){if(n!==r)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 r=generateKangaBorder({primaryColor:t.primary,accentColor:t.accent});n.style.backgroundImage=`url("${r}")`,n.style.backgroundRepeat="repeat"}}render(){let t=this.getAttribute("proverb")||"",n=this.getAttribute("proverb-translation")||"",r=this.getThemeColors();this.shadowRoot.innerHTML=`
3855
+ `}};i("af-divider",zn);D0=zn});var Kl={};w(Kl,{default:()=>E0,KangaCard:()=>to});var to,E0;var yl=v(()=>{p();Mt();to=class to extends f{static get observedAttributes(){return["theme","proverb","proverb-translation"]}constructor(){super();this.render()}connectedCallback(){this.loadStyles(),this.applyTheme()}attributeChangedCallback(t,n,r){if(n!==r)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 r=it.generateKangaBorder({primaryColor:t.primary,accentColor:t.accent});n.style.backgroundImage=`url("${r}")`,n.style.backgroundRepeat="repeat"}}render(){let t=this.getAttribute("proverb")||"",n=this.getAttribute("proverb-translation")||"",r=this.getThemeColors();this.shadowRoot.innerHTML=`
3853
3856
  <style>
3854
3857
  :host {
3855
3858
  display: block;
@@ -3931,7 +3934,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
3931
3934
  </div>
3932
3935
  `:'<div class="jina"><slot name="proverb"></slot></div>'}
3933
3936
  </article>
3934
- `,this.applyTheme()}};h("af-kanga-card",to);Ei=to});var jl={};$(jl,{default:()=>Wi,CulturalCard:()=>no});var no,Wi;var Cl=m(()=>{p();Rt();no=class no extends i{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"),r=this._cultures[t]||this._cultures.maasai,o=Mt[r.pattern],a=o?o():"";this.shadowRoot.innerHTML=`
3937
+ `,this.applyTheme()}};i("af-kanga-card",to);E0=to});var jl={};w(jl,{default:()=>W0,CulturalCard:()=>no});var no,W0;var Cl=v(()=>{p();Mt();no=class no extends f{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"),r=this._cultures[t]||this._cultures.maasai,o=it[r.pattern],a=o?o():"";this.shadowRoot.innerHTML=`
3935
3938
  <style>
3936
3939
  :host {
3937
3940
  display: block;
@@ -4096,7 +4099,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
4096
4099
  `:""}
4097
4100
  </div>
4098
4101
  </article>
4099
- `}};h("af-cultural-card",no);Wi=no});var Il={};$(Il,{default:()=>Oi,PatternShowcase:()=>oo});var oo,Oi;var Pl=m(()=>{p();Rt();oo=class oo extends i{static get observedAttributes(){return["region","size"]}constructor(){super();this._allPatterns=[{key:"shuka",name:"Maasai Shuka",region:"east",country:"Tanzania/Kenya",fn:co,meaning:"Bravery, Unity, Identity"},{key:"hadzabe",name:"Hadzabe",region:"east",country:"Tanzania",fn:go,meaning:"Ancient traditions, Hunter-gatherer heritage"},{key:"kanga",name:"Kanga",region:"east",country:"Tanzania/Kenya",fn:so,meaning:"Communication, Proverbs, Femininity"},{key:"kitenge",name:"Kitenge",region:"east",country:"East Africa",fn:mo,meaning:"Celebration, African identity"},{key:"tibeb",name:"Tibeb",region:"east",country:"Ethiopia",fn:_o,meaning:"Faith, Tradition, Celebration"},{key:"kente",name:"Kente",region:"west",country:"Ghana",fn:vo,meaning:"Royalty, Wisdom, Celebration"},{key:"adinkra",name:"Adinkra",region:"west",country:"Ghana",fn:po,meaning:"Philosophy, Proverbs, Wisdom"},{key:"bogolan",name:"Bogolan",region:"west",country:"Mali",fn:wo,meaning:"Earth energy, Protection, Healing"},{key:"asooke",name:"Aso-Oke",region:"west",country:"Nigeria",fn:uo,meaning:"Prestige, Celebration, Heritage"},{key:"adire",name:"Adire (Indigo)",region:"west",country:"Nigeria",fn:Ro,meaning:"Creativity, Uniqueness, Depth"},{key:"ankara",name:"Ankara",region:"west",country:"West Africa",fn:$o,meaning:"Boldness, Pan-African pride"},{key:"kuba",name:"Kuba Shoowa",region:"central",country:"DRC",fn:xo,meaning:"Status, Mathematics, Eternity"},{key:"imigongo",name:"Imigongo",region:"central",country:"Rwanda",fn:Ao,meaning:"Resilience, Strength, Artistry"},{key:"berber",name:"Berber",region:"north",country:"North Africa",fn:Mo,meaning:"Protection, Nature, Identity"},{key:"ndebele",name:"Ndebele",region:"south",country:"South Africa",fn:ko,meaning:"Artistry, Marriage, Status"},{key:"zulu",name:"Zulu Beadwork",region:"south",country:"South Africa",fn:qo,meaning:"Love letters, Community"},{key:"swazi",name:"Swazi",region:"south",country:"Eswatini",fn:Lo,meaning:"Monarchy, Warriors, Pride"},{key:"xhosa",name:"Xhosa",region:"south",country:"South Africa",fn:Ho,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,r=this._allPatterns.find((o)=>o.key===n);if(r)this.emit("af-pattern-select",{pattern:r})})})}attributeChangedCallback(){this.render(),this._setupHovers()}render(){let t=this.getAttribute("region")||"all",n=this.getAttribute("size")||"md",r=t==="all"?this._allPatterns:this._allPatterns.filter((l)=>l.region===t),o={sm:80,md:120,lg:160},a=o[n]||o.md;this.shadowRoot.innerHTML=`
4102
+ `}};i("af-cultural-card",no);W0=no});var Il={};w(Il,{default:()=>O0,PatternShowcase:()=>oo});var oo,O0;var Pl=v(()=>{p();Mt();oo=class oo extends f{static get observedAttributes(){return["region","size"]}constructor(){super();this._allPatterns=[{key:"shuka",name:"Maasai Shuka",region:"east",country:"Tanzania/Kenya",fn:go,meaning:"Bravery, Unity, Identity"},{key:"hadzabe",name:"Hadzabe",region:"east",country:"Tanzania",fn:mo,meaning:"Ancient traditions, Hunter-gatherer heritage"},{key:"kanga",name:"Kanga",region:"east",country:"Tanzania/Kenya",fn:vo,meaning:"Communication, Proverbs, Femininity"},{key:"kitenge",name:"Kitenge",region:"east",country:"East Africa",fn:$o,meaning:"Celebration, African identity"},{key:"tibeb",name:"Tibeb",region:"east",country:"Ethiopia",fn:ko,meaning:"Faith, Tradition, Celebration"},{key:"kente",name:"Kente",region:"west",country:"Ghana",fn:po,meaning:"Royalty, Wisdom, Celebration"},{key:"adinkra",name:"Adinkra",region:"west",country:"Ghana",fn:uo,meaning:"Philosophy, Proverbs, Wisdom"},{key:"bogolan",name:"Bogolan",region:"west",country:"Mali",fn:xo,meaning:"Earth energy, Protection, Healing"},{key:"asooke",name:"Aso-Oke",region:"west",country:"Nigeria",fn:wo,meaning:"Prestige, Celebration, Heritage"},{key:"adire",name:"Adire (Indigo)",region:"west",country:"Nigeria",fn:Xo,meaning:"Creativity, Uniqueness, Depth"},{key:"ankara",name:"Ankara",region:"west",country:"West Africa",fn:so,meaning:"Boldness, Pan-African pride"},{key:"kuba",name:"Kuba Shoowa",region:"central",country:"DRC",fn:_o,meaning:"Status, Mathematics, Eternity"},{key:"imigongo",name:"Imigongo",region:"central",country:"Rwanda",fn:Ao,meaning:"Resilience, Strength, Artistry"},{key:"berber",name:"Berber",region:"north",country:"North Africa",fn:Ro,meaning:"Protection, Nature, Identity"},{key:"ndebele",name:"Ndebele",region:"south",country:"South Africa",fn:qo,meaning:"Artistry, Marriage, Status"},{key:"zulu",name:"Zulu Beadwork",region:"south",country:"South Africa",fn:Lo,meaning:"Love letters, Community"},{key:"swazi",name:"Swazi",region:"south",country:"Eswatini",fn:Ho,meaning:"Monarchy, Warriors, Pride"},{key:"xhosa",name:"Xhosa",region:"south",country:"South Africa",fn:Mo,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,r=this._allPatterns.find((o)=>o.key===n);if(r)this.emit("af-pattern-select",{pattern:r})})})}attributeChangedCallback(){this.render(),this._setupHovers()}render(){let t=this.getAttribute("region")||"all",n=this.getAttribute("size")||"md",r=t==="all"?this._allPatterns:this._allPatterns.filter((l)=>l.region===t),o={sm:80,md:120,lg:160},a=o[n]||o.md;this.shadowRoot.innerHTML=`
4100
4103
  <style>
4101
4104
  :host {
4102
4105
  display: block;
@@ -4229,7 +4232,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
4229
4232
  `).join("")}
4230
4233
  </div>
4231
4234
  </div>
4232
- `,this.shadowRoot.querySelectorAll(".region-tab").forEach((l)=>{l.addEventListener("click",()=>{this.setAttribute("region",l.dataset.region)})})}};h("af-pattern-showcase",oo);Oi=oo});var Tl={};$(Tl,{AfriLanguageSwitcher:()=>Xr});var Xr;var Zl=m(()=>{p();Xr=class Xr extends i{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",r=t.find((o)=>o.code===n)||t[0];this.shadowRoot.innerHTML=c`
4235
+ `,this.shadowRoot.querySelectorAll(".region-tab").forEach((l)=>{l.addEventListener("click",()=>{this.setAttribute("region",l.dataset.region)})})}};i("af-pattern-showcase",oo);O0=oo});var Tl={};w(Tl,{AfriLanguageSwitcher:()=>Yr});var Yr;var Zl=v(()=>{p();Yr=class Yr extends f{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",r=t.find((o)=>o.code===n)||t[0];this.shadowRoot.innerHTML=d`
4233
4236
  <style>
4234
4237
  :host { display: inline-block; position: relative; font-family: var(--font-body); }
4235
4238
  .switcher-btn {
@@ -4274,13 +4277,13 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
4274
4277
  </button>
4275
4278
 
4276
4279
  <div class="dropdown">
4277
- ${t.map((o)=>c`
4280
+ ${t.map((o)=>d`
4278
4281
  <div class="lang-option" data-code="${o.code}" dir="${o.dir||"ltr"}">
4279
4282
  ${o.name}
4280
4283
  </div>
4281
4284
  `)}
4282
4285
  </div>
4283
- `,this.shadowRoot.querySelector(".switcher-btn").onclick=()=>{this.toggleAttribute("open")},this.shadowRoot.querySelectorAll(".lang-option").forEach((o)=>{o.onclick=()=>{let a=o.dataset.code;if(this.setAttribute("current",a),this.removeAttribute("open"),this.emit("lang-change",{code:a}),a==="ar")document.documentElement.dir="rtl";else document.documentElement.dir="ltr"}})}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}};h("af-language-switcher",Xr)});var zl={};$(zl,{AfriAuth:()=>Yr});var Yr;var te=m(()=>{p();Yr=class Yr extends i{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",(r)=>{r.preventDefault(),this.mode=this.mode==="login"?"register":"login",this.render(),this.setupEvents()});if(t)t.addEventListener("submit",async(r)=>{r.preventDefault();let o=this.shadowRoot.querySelector("#email").value,a=this.shadowRoot.querySelector("#password").value,l=this.shadowRoot.querySelector(".feedback");l.textContent="Processing...";try{let b=await(await fetch("/api/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:this.mode,email:o,password:a})})).json();if(b.error)l.textContent=b.error,l.style.color="#ef4444";else l.textContent="Success! Redirecting...",l.style.color="#22c55e",setTimeout(()=>window.location.href="/",1000)}catch(e){l.textContent="Network Error"}})}render(){let t=this.mode==="login";this.shadowRoot.innerHTML=`
4286
+ `,this.shadowRoot.querySelector(".switcher-btn").onclick=()=>{this.toggleAttribute("open")},this.shadowRoot.querySelectorAll(".lang-option").forEach((o)=>{o.onclick=()=>{let a=o.dataset.code;if(this.setAttribute("current",a),this.removeAttribute("open"),this.emit("lang-change",{code:a}),a==="ar")document.documentElement.dir="rtl";else document.documentElement.dir="ltr"}})}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}};i("af-language-switcher",Yr)});var zl={};w(zl,{AfriAuth:()=>Jr});var Jr;var tb=v(()=>{p();Jr=class Jr extends f{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",(r)=>{r.preventDefault(),this.mode=this.mode==="login"?"register":"login",this.render(),this.setupEvents()});if(t)t.addEventListener("submit",async(r)=>{r.preventDefault();let o=this.shadowRoot.querySelector("#email").value,a=this.shadowRoot.querySelector("#password").value,l=this.shadowRoot.querySelector(".feedback");l.textContent="Processing...";try{let e=await(await fetch("/api/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:this.mode,email:o,password:a})})).json();if(e.error)l.textContent=e.error,l.style.color="#ef4444";else l.textContent="Success! Redirecting...",l.style.color="#22c55e",setTimeout(()=>window.location.href="/",1000)}catch{l.textContent="Network Error"}})}render(){let t=this.mode==="login";this.shadowRoot.innerHTML=`
4284
4287
  <style>
4285
4288
  :host {
4286
4289
  display: block;
@@ -4378,7 +4381,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
4378
4381
  <span class="toggle-mode">${t?"Create an account":"Sign in"}</span>
4379
4382
  </div>
4380
4383
  </div>
4381
- `}};h("af-auth",Yr)});var ne={};$(ne,{default:()=>Ui});var Jr,Ui;var oe=m(()=>{p();Jr=class Jr extends i{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=c`
4384
+ `}};i("af-auth",Jr)});var nb={};w(nb,{default:()=>U0});var Qr,U0;var ob=v(()=>{p();Qr=class Qr extends f{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=d`
4382
4385
  <style>
4383
4386
  .toggle-btn {
4384
4387
  background: var(--bg-surface-elevated, var(--afri-obsidian));
@@ -4403,11 +4406,11 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
4403
4406
  }
4404
4407
  </style>
4405
4408
 
4406
- <button class="toggle-btn" @click="\${() => this.toggleTheme()}">
4407
- <span class="icon">\${isDark ? '🌙' : '☀️'}</span>
4408
- <span>\${isDark ? 'Dark Mode' : 'Light Mode'}</span>
4409
+ <button class="toggle-btn">
4410
+ <span class="icon">${t?"\uD83C\uDF19":"☀️"}</span>
4411
+ <span>${t?"Dark Mode":"Light Mode"}</span>
4409
4412
  </button>
4410
- `;let n=this.shadowRoot.querySelector(".toggle-btn");if(n)n.addEventListener("click",()=>this.toggleTheme())}};h("af-theme-toggle",Jr);Ui=Jr});rt();Ht();Rt();var So={};$(So,{transitionPage:()=>Dr,default:()=>Ae,animateStaggered:()=>Br,Easing:()=>vn});var vn={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 Br(t,{delay:n=50,duration:r=600,easing:o=vn.DrumBeat,y:a=20,scale:l=0.95}={}){let e=typeof t==="string"?document.querySelectorAll(t):t;if(!e||e.length===0)return;let b=new IntersectionObserver((f)=>{f.forEach((u,q)=>{if(u.isIntersecting){let R=Math.random()*10,M=q*n+R,Y=u.target;Y.animate([{opacity:0,transform:`translateY(${a}px) scale(${l})`},{opacity:1,transform:"translateY(0) scale(1)"}],{duration:r,delay:M,easing:o,fill:"forwards"}),b.unobserve(Y),Y.style.opacity="1"}})},{threshold:0.1});e.forEach((f)=>{f.style.opacity="0",b.observe(f)})}function Dr(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:vn.DrumBeat})}}var Ae={Easing:vn,animateStaggered:Br,transitionPage:Dr};function Er(t){if(typeof window>"u")return;if(!("IntersectionObserver"in window)){Object.values(t).forEach((r)=>r());return}let n=new IntersectionObserver((r)=>{r.forEach((o)=>{if(o.isIntersecting){let a=o.target.tagName.toLowerCase(),l=t[a];if(l)console.log(`\uD83C\uDFDD️ Hydrating Island: <${a}>`),l().then(()=>{delete t[a]}).catch((e)=>console.error(`Failed to hydrate <${a}>`,e));n.unobserve(o.target)}})},{rootMargin:"50px 0px"});Object.keys(t).forEach((r)=>{document.querySelectorAll(r).forEach((o)=>n.observe(o))})}qn();Eo();function Wo(t){if(!t)return{};let n={};return t.split(";").forEach((r)=>{let[o,a]=r.trim().split("=");if(o&&a)n[decodeURIComponent(o)]=decodeURIComponent(a)}),n}function ha(){return crypto.randomUUID()}function da(t){let r=(t.headers||{}).get("cookie");return Wo(r)[Oo]||null}var Oo="session_id";class ca{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,r){let o=this.get(t),a=n.split("/"),l=o;while(a.length>1){let e=a.shift();if(!l[e]||typeof l[e]!=="object")l[e]={};l=l[e]}return l[a[0]]=r,r}delete(t){return this.sessions.delete(t)}clear(){this.sessions.clear()}}var j=new ca;var ga={incrementCounter(t){let o=(j.get(t).counter?.value||0)+1;return j.set(t,"counter/value",o),o},resetCounter(t){return j.set(t,"counter/value",0),0},getCounter(t){return j.get(t).counter?.value||0}};class U extends Error{constructor(t,n="INTERNAL_ERROR",r={},o=500){super(t);this.name="AfriCodeError",this.code=n,this.context=r,this.statusCode=o,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 Ln extends U{constructor(t,n=null,r={}){super(t,"VALIDATION_FAILED",{field:n,...r},422);this.name="ValidationError"}static fromZodError(t){let n=t.issues[0],r=n?.path?.join(".")||null,o=n?.message||"Validation failed";return new Ln(o,r,{issues:t.issues.map((a)=>({field:a.path.join("."),message:a.message,code:a.code}))})}}class Uo extends U{constructor(t,n){let r=n===""?"an empty string":`"${n}"`;super(`Field '${t}' must be a valid URL or null. Got ${r}.`,"INVALID_URL",{field:t,received:n},422);this.name="InvalidUrlError"}}class Et extends U{constructor(t,n="SECURITY_VIOLATION",r={},o=403){super(t,n,r,o);this.name="SecurityError"}}class No extends Et{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 yo extends Et{constructor(t,n="Too many requests. Please try again later."){super(n,"RATE_LIMIT_EXCEEDED",{retryAfter:t},429);this.name="RateLimitError"}}class Vo extends U{constructor(t,n=null,r={}){super(t,"DATABASE_ERROR",{operation:n,...r},500);this.name="DatabaseError"}}class Ko extends U{constructor(t,n,r={}){super(`Component Error in <${n}>: ${t}`,"COMPONENT_ERROR",{componentName:n,...r},500);this.name="ComponentError"}}class jo{constructor(){this.middlewares=[],this.isRunning=!1}use(t,n=null){if(typeof t!=="function")throw new U("Middleware must be a function","MIDDLEWARE_INVALID",{},500);let r=async(o)=>{let a=Date.now();try{Lt("debug",`[Middleware] Running ${n||"anonymous"} middleware`);let l=await t(o),e=Date.now()-a;return Lt("debug",`[Middleware] ${n||"anonymous"} completed in ${e}ms`),l}catch(l){throw Lt("error",`[Middleware] Error in ${n||"anonymous"}: ${l.message}`),new U(`Middleware error in ${n||"anonymous"}: ${l.message}`,"MIDDLEWARE_EXECUTION_ERROR",{cause:l},500)}};return this.middlewareMeta=this.middlewareMeta||new WeakMap,this.middlewareMeta.set(r,{original:t,name:n||t.name||"anonymous"}),this.middlewares.push(r),this}async run(t){if(this.isRunning)throw new MiddlewareError("Middleware pipeline is already running");this.isRunning=!0;try{for(let n of this.middlewares){let r=await n(t);if(r instanceof Response)return r;if(r?.response)return r.response;if(r?.context)Object.assign(t,r.context)}return null}finally{this.isRunning=!1}}count(){return this.middlewares.length}clear(){return this.middlewares=[],this}}function sa(){return async(t)=>{return Lt("log",`[AfriCode] ${t.req.method} ${t.pathname}`),{}}}function ma(t={}){return async(n)=>{let{protectedPaths:r=[],authorize:o=()=>!1,unauthorizedResponse:a=()=>new Response("Unauthorized",{status:401})}=t;if(r.some((e)=>n.pathname.startsWith(e))){if(!await o(n))return{response:a(n)}}return{}}}p();p();class Co extends i{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.",r={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"}},o=r[t]||r.tanzania;if(this._hasError){this.shadowRoot.innerHTML=`
4413
+ `;let n=this.shadowRoot.querySelector(".toggle-btn");if(n)n.addEventListener("click",()=>this.toggleTheme())}};i("af-theme-toggle",Qr);U0=Qr});Ht();co();Mt();var So={};w(So,{transitionPage:()=>Dr,default:()=>_b,animateStaggered:()=>Br,Easing:()=>$n});var $n={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 Br(t,{delay:n=50,duration:r=600,easing:o=$n.DrumBeat,y:a=20,scale:l=0.95}={}){let b=typeof t==="string"?document.querySelectorAll(t):t;if(!b||b.length===0)return;let e=new IntersectionObserver((h)=>{h.forEach((u,q)=>{if(u.isIntersecting){let R=Math.random()*10,M=q*n+R,Y=u.target;Y.animate([{opacity:0,transform:`translateY(${a}px) scale(${l})`},{opacity:1,transform:"translateY(0) scale(1)"}],{duration:r,delay:M,easing:o,fill:"forwards"}),e.unobserve(Y),Y.style.opacity="1"}})},{threshold:0.1});b.forEach((h)=>{h.style.opacity="0",e.observe(h)})}function Dr(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:$n.DrumBeat})}}var _b={Easing:$n,animateStaggered:Br,transitionPage:Dr};function Er(t){if(typeof window>"u")return;if(!("IntersectionObserver"in window)){Object.values(t).forEach((r)=>r());return}let n=new IntersectionObserver((r)=>{r.forEach((o)=>{if(o.isIntersecting){let a=o.target.tagName.toLowerCase(),l=t[a];if(l)console.log(`\uD83C\uDFDD️ Hydrating Island: <${a}>`),l().then(()=>{delete t[a]}).catch((b)=>console.error(`Failed to hydrate <${a}>`,b));n.unobserve(o.target)}})},{rootMargin:"50px 0px"});Object.keys(t).forEach((r)=>{document.querySelectorAll(r).forEach((o)=>n.observe(o))})}qn();Wo();function Oo(t){if(!t)return{};let n={};return t.split(";").forEach((r)=>{let[o,a]=r.trim().split("=");if(o&&a)n[decodeURIComponent(o)]=decodeURIComponent(a)}),n}function ia(){return crypto.randomUUID()}function ca(t){let r=(t.headers||{}).get("cookie");return Oo(r)[Uo]||null}var Uo="session_id";class da{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,r){let o=this.get(t),a=n.split("/"),l=o;while(a.length>1){let b=a.shift();if(!l[b]||typeof l[b]!=="object")l[b]={};l=l[b]}return l[a[0]]=r,r}delete(t){return this.sessions.delete(t)}clear(){this.sessions.clear()}}var j=new da;var ga={incrementCounter(t){let o=(j.get(t).counter?.value||0)+1;return j.set(t,"counter/value",o),o},resetCounter(t){return j.set(t,"counter/value",0),0},getCounter(t){return j.get(t).counter?.value||0}};class F extends Error{constructor(t,n="INTERNAL_ERROR",r={},o=500){super(t);this.name="AfriCodeError",this.code=n,this.context=r,this.statusCode=o,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 Ln extends F{constructor(t,n=null,r={}){super(t,"VALIDATION_FAILED",{field:n,...r},422);this.name="ValidationError"}static fromZodError(t){let n=t.issues[0],r=n?.path?.join(".")||null,o=n?.message||"Validation failed";return new Ln(o,r,{issues:t.issues.map((a)=>({field:a.path.join("."),message:a.message,code:a.code}))})}}class No extends F{constructor(t,n){let r=n===""?"an empty string":`"${n}"`;super(`Field '${t}' must be a valid URL or null. Got ${r}.`,"INVALID_URL",{field:t,received:n},422);this.name="InvalidUrlError"}}class Dt extends F{constructor(t,n="SECURITY_VIOLATION",r={},o=403){super(t,n,r,o);this.name="SecurityError"}}class Vo extends Dt{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 Ko extends Dt{constructor(t,n="Too many requests. Please try again later."){super(n,"RATE_LIMIT_EXCEEDED",{retryAfter:t},429);this.name="RateLimitError"}}class yo extends F{constructor(t,n=null,r={}){super(t,"DATABASE_ERROR",{operation:n,...r},500);this.name="DatabaseError"}}class jo extends F{constructor(t,n,r={}){super(`Component Error in <${n}>: ${t}`,"COMPONENT_ERROR",{componentName:n,...r},500);this.name="ComponentError"}}class Co{constructor(){this.middlewares=[],this.isRunning=!1}use(t,n=null){if(typeof t!=="function")throw new F("Middleware must be a function","MIDDLEWARE_INVALID",{},500);let r=async(o)=>{let a=Date.now();try{Lt("debug",`[Middleware] Running ${n||"anonymous"} middleware`);let l=await t(o),b=Date.now()-a;return Lt("debug",`[Middleware] ${n||"anonymous"} completed in ${b}ms`),l}catch(l){throw Lt("error",`[Middleware] Error in ${n||"anonymous"}: ${l.message}`),new F(`Middleware error in ${n||"anonymous"}: ${l.message}`,"MIDDLEWARE_EXECUTION_ERROR",{cause:l},500)}};return this.middlewareMeta=this.middlewareMeta||new WeakMap,this.middlewareMeta.set(r,{original:t,name:n||t.name||"anonymous"}),this.middlewares.push(r),this}async run(t){if(this.isRunning)throw new F("Middleware pipeline is already running","MIDDLEWARE_ALREADY_RUNNING",{},500);this.isRunning=!0;try{for(let n of this.middlewares){let r=await n(t);if(r instanceof Response)return r;if(r?.response)return r.response;if(r?.context)Object.assign(t,r.context)}return null}finally{this.isRunning=!1}}count(){return this.middlewares.length}clear(){return this.middlewares=[],this}}function ma(){return async(t)=>{return Lt("log",`[AfriCode] ${t.req.method} ${t.pathname}`),{}}}function va(t={}){return async(n)=>{let{protectedPaths:r=[],authorize:o=()=>!1,unauthorizedResponse:a=()=>new Response("Unauthorized",{status:401})}=t;if(r.some((b)=>n.pathname.startsWith(b))){if(!await o(n))return{response:a(n)}}return{}}}p();p();class Io extends f{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.",r={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"}},o=r[t]||r.tanzania;if(this._hasError){this.shadowRoot.innerHTML=`
4411
4414
  <style>
4412
4415
  :host { display: block; width: 100%; font-family: 'Inter', system-ui, sans-serif; }
4413
4416
  .boundary-error {
@@ -4478,7 +4481,7 @@ var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null
4478
4481
  `,this.shadowRoot.getElementById("retry-btn").addEventListener("click",()=>{this.reset()});return}this.shadowRoot.innerHTML=`
4479
4482
  <style>:host { display: block; }</style>
4480
4483
  <slot></slot>
4481
- `}}h("af-error-boundary",Co);Io();Po();To();Zo();zo();tr();nr();or();rr();ar();lr();er();br();fr();hr();dr();cr();gr();sr();mr();vr();pr();ur();$r();wr();xr();Ar();_r();Lr();Hr();Mr();var ro={"af-button":()=>Promise.resolve().then(() => (Pa(),Ia)),"af-card":()=>Promise.resolve().then(() => (Za(),Ta)),"af-navbar":()=>Promise.resolve().then(() => (tl(),za)),"af-input":()=>Promise.resolve().then(() => (ol(),nl)),"af-alert":()=>Promise.resolve().then(() => (al(),rl)),"af-grid":()=>Promise.resolve().then(() => (el(),ll)),"af-section":()=>Promise.resolve().then(() => (il(),bl)),"af-icon":()=>Promise.resolve().then(() => (hl(),fl)),"af-ui-button":()=>Promise.resolve().then(() => (Io(),pa)),"af-ui-card":()=>Promise.resolve().then(() => (Po(),ua)),"af-ui-input":()=>Promise.resolve().then(() => (To(),$a)),"af-ui-badge":()=>Promise.resolve().then(() => (Zo(),wa)),"af-ui-switch":()=>Promise.resolve().then(() => (zo(),xa)),"af-ui-select":()=>Promise.resolve().then(() => (tr(),Aa)),"af-ui-textarea":()=>Promise.resolve().then(() => (nr(),_a)),"af-ui-chip":()=>Promise.resolve().then(() => (or(),ka)),"af-ui-tag":()=>Promise.resolve().then(() => (rr(),qa)),"af-ui-avatar":()=>Promise.resolve().then(() => (ar(),La)),"af-ui-progress-ring":()=>Promise.resolve().then(() => (lr(),Ha)),"af-ui-tooltip":()=>Promise.resolve().then(() => (er(),Ma)),"af-ui-popover":()=>Promise.resolve().then(() => (br(),Ra)),"af-ui-tabs":()=>Promise.resolve().then(() => (fr(),Sa)),"af-ui-table":()=>Promise.resolve().then(() => (hr(),Xa)),"af-ui-stat":()=>Promise.resolve().then(() => (dr(),Ya)),"af-footer":()=>Promise.resolve().then(() => (cr(),Ja)),"af-breadcrumb":()=>Promise.resolve().then(() => (gr(),Ga)),"af-feature-grid":()=>Promise.resolve().then(() => (sr(),Qa)),"af-pricing-card":()=>Promise.resolve().then(() => (mr(),Fa)),"af-testimonial":()=>Promise.resolve().then(() => (vr(),Ba)),"af-dashboard-shell":()=>Promise.resolve().then(() => (pr(),Da)),"af-dashboard-topbar":()=>Promise.resolve().then(() => (ur(),Ea)),"af-dashboard-card":()=>Promise.resolve().then(() => ($r(),Wa)),"af-dashboard-metric":()=>Promise.resolve().then(() => (wr(),Oa)),"af-dashboard-activity-list":()=>Promise.resolve().then(() => (xr(),Ua)),"af-accordion":()=>Promise.resolve().then(() => (cl(),dl)),"af-hero":()=>Promise.resolve().then(() => (sl(),gl)),"af-table":()=>Promise.resolve().then(() => (vl(),ml)),"af-modal":()=>Promise.resolve().then(() => (ul(),pl)),"af-tabs":()=>Promise.resolve().then(() => (wl(),$l)),"af-sidebar":()=>Promise.resolve().then(() => (Al(),xl)),"af-dropdown":()=>Promise.resolve().then(() => (kl(),_l)),"af-select":()=>Promise.resolve().then(() => (Ll(),ql)),"af-form":()=>Promise.resolve().then(() => (Ml(),Hl)),"af-tooltip":()=>Promise.resolve().then(() => (Sl(),Rl)),"af-toast":()=>Promise.resolve().then(() => (Yl(),Xl)),"af-badge":()=>Promise.resolve().then(() => (Gl(),Jl)),"af-avatar":()=>Promise.resolve().then(() => (Fl(),Ql)),"af-progress":()=>Promise.resolve().then(() => (Dl(),Bl)),"af-loader":()=>Promise.resolve().then(() => (Wl(),El)),"af-skeleton":()=>Promise.resolve().then(() => (Ul(),Ol)),"af-divider":()=>Promise.resolve().then(() => (yl(),Nl)),"af-kanga-card":()=>Promise.resolve().then(() => (Kl(),Vl)),"af-cultural-card":()=>Promise.resolve().then(() => (Cl(),jl)),"af-pattern-showcase":()=>Promise.resolve().then(() => (Pl(),Il)),"af-language-switcher":()=>Promise.resolve().then(() => (Zl(),Tl)),"af-auth":()=>Promise.resolve().then(() => (te(),zl)),"af-auth-form":()=>Promise.resolve().then(() => (Ar(),Na)),"af-kyc-upload":()=>Promise.resolve().then(() => (_r(),ya)),"af-wallet-balance":()=>Promise.resolve().then(() => (Lr(),Va)),"af-transaction-ledger":()=>Promise.resolve().then(() => (Hr(),ja)),"af-nav-drawer":()=>Promise.resolve().then(() => (Mr(),Ca)),"af-theme-toggle":()=>Promise.resolve().then(() => (oe(),ne))};var Q={COMPONENT:"component",FORM:"form",LIST:"list",CARD:"card",MODAL:"modal",TOAST:"toast",PROGRESS:"progress",CHART:"chart",DATATABLE:"datatable",TABS:"tabs",ACCORDION:"accordion",STEPPER:"stepper",DASHBOARD_WIDGET:"dashboard-widget"},Vh={component:{type:"object",properties:{id:{type:"string"},type:{type:"string",enum:Object.values(Q)},props:{type:"object"},children:{type:"array",items:{$ref:"#"}}},required:["id","type"]}};function re(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function ao(t){if(Array.isArray(t))return t.map(ao).join("");if(t===null||t===void 0||t===!1)return"";if(typeof t==="string"||typeof t==="number"||typeof t==="boolean")return re(t);if(typeof t!=="object")return"";let n=t.tag||t.tagName;if(!n)return"";let r=t.props||{},o=Object.entries(r).filter(([,l])=>l!==null&&l!==void 0&&l!==!1).map(([l,e])=>e===!0?l:`${l}="${re(e)}"`).join(" "),a=ao(t.children??t.content??"");return`<${n}${o?` ${o}`:""}>${a}</${n}>`}function Ni(t){return/<\s*script\b|on\w+\s*=|javascript:/i.test(String(t))}class lo{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(Ni(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(ao).join(""):ao(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 o=document.createElement("div");o.innerHTML=n;while(o.firstChild)this.root.appendChild(o.firstChild)}return n}createElement(t){let{type:n,props:r={},children:o=[]}=t,a;switch(n){case Q.COMPONENT:a=this.createCustomComponent(r);break;case Q.FORM:a=this.createForm(r);break;case Q.LIST:a=this.createList(r);break;case Q.CARD:a=this.createCard(r);break;case Q.MODAL:a=this.createModal(r);break;case Q.TOAST:a=this.createToast(r);break;case Q.PROGRESS:a=this.createProgress(r);break;case Q.CHART:a=this.createChart(r);break;case Q.DATATABLE:a=this.createDatatable(r);break;case Q.TABS:a=this.createTabs(r);break;case Q.ACCORDION:a=this.createAccordion(r);break;case Q.STEPPER:a=this.createStepper(r);break;case Q.DASHBOARD_WIDGET:a=this.createDashboardWidget(r);break;default:throw Error(`Unknown A2UI component type: ${n}`)}if(o.length>0)for(let l of o){let e=this.createElement(l);a.appendChild(e)}return a}createCustomComponent({tag:t,...n}){let r=document.createElement(t||"div");return Object.assign(r,n),r}createForm({fields:t=[],onSubmit:n}){let r=document.createElement("af-form");for(let o of t){let a=document.createElement("af-input");a.setAttribute("name",o.name),a.setAttribute("placeholder",o.placeholder||""),a.setAttribute("type",o.type||"text"),r.appendChild(a)}if(n)r.addEventListener("submit",n);return r}createList({items:t=[]}){let n=document.createElement("af-grid");for(let r of t){let o=this.createCard(r);n.appendChild(o)}return n}createCard({title:t,content:n,image:r}){let o=document.createElement("af-card");if(t){let a=document.createElement("h3");a.textContent=t,o.appendChild(a)}if(n){let a=document.createElement("p");a.textContent=n,o.appendChild(a)}if(r){let a=document.createElement("img");a.src=r,a.alt=t||"Card image",o.appendChild(a)}return o}createModal({title:t,content:n,actions:r=[]}){let o=document.createElement("af-modal");if(o.setAttribute("open",""),t){let l=document.createElement("h2");l.slot="header",l.textContent=t,o.appendChild(l)}if(n){let l=document.createElement("p");l.textContent=n,o.appendChild(l)}let a=document.createElement("div");a.slot="footer";for(let l of r){let e=document.createElement("af-button");if(e.textContent=l.label,l.primary)e.setAttribute("variant","primary");if(l.onClick)e.addEventListener("click",l.onClick);a.appendChild(e)}return o.appendChild(a),o}createToast({message:t,type:n="info",duration:r=3000}){let o=document.createElement("af-toast");return o.setAttribute("type",n),o.textContent=t,setTimeout(()=>{o.remove()},r),o}createProgress({value:t=0,max:n=100,label:r}){let o=document.createElement("af-progress");if(o.setAttribute("value",t),o.setAttribute("max",n),r)o.setAttribute("label",r);return o}createChart({type:t="bar",data:n=[],labels:r=[],title:o,options:a={}}){let l=document.createElement("af-chart");if(l.setAttribute("type",t),l.setAttribute("data",JSON.stringify(n)),l.setAttribute("labels",JSON.stringify(r)),o)l.setAttribute("title",o);if(a)l.setAttribute("options",JSON.stringify(a));return l}createDatatable({columns:t=[],rows:n=[],title:r,options:o={}}){let a=document.createElement("af-datatable");if(a.setAttribute("columns",JSON.stringify(t)),a.setAttribute("rows",JSON.stringify(n)),r)a.setAttribute("title",r);if(o)a.setAttribute("options",JSON.stringify(o));return a}createTabs({tabs:t=[],activeTab:n=0}){let r=document.createElement("af-tabs");r.setAttribute("active",n);for(let o=0;o<t.length;o++){let a=t[o],l=document.createElement("af-tab-button");l.setAttribute("tab-id",o),l.textContent=a.title;let e=document.createElement("af-tab-content");e.setAttribute("tab-id",o),e.innerHTML=a.content||"",r.appendChild(l),r.appendChild(e)}return r}createAccordion({items:t=[]}){let n=document.createElement("af-accordion");for(let r of t){let o=document.createElement("af-accordion-panel"),a=document.createElement("af-accordion-header");a.textContent=r.title;let l=document.createElement("af-accordion-content");l.innerHTML=r.content||"",o.appendChild(a),o.appendChild(l),n.appendChild(o)}return n}createStepper({steps:t=[],currentStep:n=0}){let r=document.createElement("af-stepper");r.setAttribute("current-step",n);for(let o=0;o<t.length;o++){let a=document.createElement("af-step");if(a.setAttribute("step-number",o+1),a.setAttribute("active",o<=n),o===n)a.setAttribute("current","true");a.textContent=t[o].title||`Step ${o+1}`,r.appendChild(a)}return r}createDashboardWidget({title:t,content:n,type:r="card",size:o="medium",actions:a=[]}){let l=document.createElement("af-dashboard-widget");if(l.setAttribute("type",r),l.setAttribute("size",o),t){let e=document.createElement("h3");e.className="widget-title",e.textContent=t,l.appendChild(e)}if(n){let e=document.createElement("div");e.className="widget-content",e.innerHTML=typeof n==="string"?n:JSON.stringify(n),l.appendChild(e)}if(a.length>0){let e=document.createElement("div");e.className="widget-actions";for(let b of a){let f=document.createElement("af-button");if(f.textContent=b.label,f.setAttribute("variant",b.variant||"secondary"),b.onClick)f.addEventListener("click",b.onClick);e.appendChild(f)}l.appendChild(e)}return l}update(t,n){let r=this.components.get(t);if(r)Object.assign(r,n)}remove(t){let n=this.components.get(t);if(n)n.remove(),this.components.delete(t)}}class eo{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(),r=new TextDecoder,o="";while(!0){let{done:a,value:l}=await n.read();if(a)break;o+=r.decode(l,{stream:!0});let e=o.split(`
4482
- `);o=e.pop();for(let b of e)if(b.trim())this.processMessage(b.trim())}if(o.trim())this.processMessage(o.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 r of t)r(n)}}}validateAgainstSchema(t){let n=t?.tag||t?.tagName;return Promise.resolve(Boolean(n&&ro[n]))}}function ae(t){if(typeof document>"u")t=null;else t=t||document.body;let n=new lo(t),r=new eo(n);if(typeof window<"u")window.a2ui={render:(o)=>r.processMessage(o),handleStream:(o)=>r.handleStream(o),update:(o,a)=>n.update(o,a),remove:(o)=>n.remove(o),sendMessage:(o)=>r.sendMessage(o),onMessage:(o)=>r.onMessage(o),createStream:()=>r.createStream(),validateAgainstSchema:(o)=>r.validateAgainstSchema(o)};return{renderer:n,protocol:r}}rt();function yi(t={}){if(typeof window<"u"){console.log("\uD83C\uDF0D AfriCode Browser SDK Initialized");let n={...ro,...t};if(Object.keys(n).length>0)Er(n)}}var bd={createReactiveState:ht,subscribe:T,createSignal:fo,createEffect:ho,store:J,actions:Qr,patterns:Mt,motion:So,html:c,Layout:Wr,schemas:kn,Validation:ft,rules:O,afri:ba,AfriFieldBuilder:K,normalizeInput:ia,buildSchema:fa,createFramework:ea,getConfig:Dt,getRequestIdentity:da,parseCookieHeader:Wo,createSessionId:ha,SESSION_COOKIE_NAME:Oo,sessionStore:j,runtimeActions:ga,MiddlewareManager:jo,loggerMiddleware:sa,authMiddleware:ma,AfriCodeError:U,ValidationError:Ln,InvalidUrlError:Uo,SecurityError:Et,CsrfError:No,RateLimitError:yo,DatabaseError:Vo,ComponentError:Ko,initA2UI:ae,A2UIRenderer:lo,A2UIProtocol:eo,init:yi};export{T as subscribe,J as store,j as sessionStore,kn as schemas,ga as runtimeActions,O as rules,Mt as patterns,Wo as parseCookieHeader,ia as normalizeInput,So as motion,sa as loggerMiddleware,ae as initA2UI,yi as init,c as html,da as getRequestIdentity,Dt as getConfig,bd as default,fo as createSignal,ha as createSessionId,ht as createReactiveState,ea as createFramework,ho as createEffect,fa as buildSchema,ma as authMiddleware,ba as afri,Qr as actions,Ln as ValidationError,ft as Validation,Et as SecurityError,Oo as SESSION_COOKIE_NAME,yo as RateLimitError,jo as MiddlewareManager,Wr as Layout,Uo as InvalidUrlError,Vo as DatabaseError,No as CsrfError,Ko as ComponentError,K as AfriFieldBuilder,U as AfriCodeError,lo as A2UIRenderer,eo as A2UIProtocol};
4484
+ `}}i("af-error-boundary",Io);Po();To();Zo();zo();tr();nr();or();rr();ar();lr();br();er();fr();ir();cr();dr();gr();mr();vr();$r();pr();ur();wr();sr();xr();_r();Ar();kr();Hr();Mr();Rr();var ro={"af-button":()=>Promise.resolve().then(() => (Pa(),Ia)),"af-card":()=>Promise.resolve().then(() => (Za(),Ta)),"af-navbar":()=>Promise.resolve().then(() => (tl(),za)),"af-input":()=>Promise.resolve().then(() => (ol(),nl)),"af-alert":()=>Promise.resolve().then(() => (al(),rl)),"af-grid":()=>Promise.resolve().then(() => (bl(),ll)),"af-section":()=>Promise.resolve().then(() => (fl(),el)),"af-icon":()=>Promise.resolve().then(() => (il(),hl)),"af-ui-button":()=>Promise.resolve().then(() => (Po(),pa)),"af-ui-card":()=>Promise.resolve().then(() => (To(),ua)),"af-ui-input":()=>Promise.resolve().then(() => (Zo(),wa)),"af-ui-badge":()=>Promise.resolve().then(() => (zo(),sa)),"af-ui-switch":()=>Promise.resolve().then(() => (tr(),xa)),"af-ui-select":()=>Promise.resolve().then(() => (nr(),_a)),"af-ui-textarea":()=>Promise.resolve().then(() => (or(),Aa)),"af-ui-chip":()=>Promise.resolve().then(() => (rr(),ka)),"af-ui-tag":()=>Promise.resolve().then(() => (ar(),qa)),"af-ui-avatar":()=>Promise.resolve().then(() => (lr(),La)),"af-ui-progress-ring":()=>Promise.resolve().then(() => (br(),Ha)),"af-ui-tooltip":()=>Promise.resolve().then(() => (er(),Ma)),"af-ui-popover":()=>Promise.resolve().then(() => (fr(),Ra)),"af-ui-tabs":()=>Promise.resolve().then(() => (ir(),Xa)),"af-ui-table":()=>Promise.resolve().then(() => (cr(),Sa)),"af-ui-stat":()=>Promise.resolve().then(() => (dr(),Ya)),"af-footer":()=>Promise.resolve().then(() => (gr(),Ja)),"af-breadcrumb":()=>Promise.resolve().then(() => (mr(),Qa)),"af-feature-grid":()=>Promise.resolve().then(() => (vr(),Ga)),"af-pricing-card":()=>Promise.resolve().then(() => ($r(),Fa)),"af-testimonial":()=>Promise.resolve().then(() => (pr(),Ba)),"af-dashboard-shell":()=>Promise.resolve().then(() => (ur(),Da)),"af-dashboard-topbar":()=>Promise.resolve().then(() => (wr(),Ea)),"af-dashboard-card":()=>Promise.resolve().then(() => (sr(),Wa)),"af-dashboard-metric":()=>Promise.resolve().then(() => (xr(),Oa)),"af-dashboard-activity-list":()=>Promise.resolve().then(() => (_r(),Ua)),"af-accordion":()=>Promise.resolve().then(() => (dl(),cl)),"af-hero":()=>Promise.resolve().then(() => (ml(),gl)),"af-table":()=>Promise.resolve().then(() => ($l(),vl)),"af-modal":()=>Promise.resolve().then(() => (ul(),pl)),"af-tabs":()=>Promise.resolve().then(() => (sl(),wl)),"af-sidebar":()=>Promise.resolve().then(() => (_l(),xl)),"af-dropdown":()=>Promise.resolve().then(() => (kl(),Al)),"af-select":()=>Promise.resolve().then(() => (Ll(),ql)),"af-form":()=>Promise.resolve().then(() => (Ml(),Hl)),"af-tooltip":()=>Promise.resolve().then(() => (Xl(),Rl)),"af-toast":()=>Promise.resolve().then(() => (Yl(),Sl)),"af-badge":()=>Promise.resolve().then(() => (Ql(),Jl)),"af-avatar":()=>Promise.resolve().then(() => (Fl(),Gl)),"af-progress":()=>Promise.resolve().then(() => (Dl(),Bl)),"af-loader":()=>Promise.resolve().then(() => (Wl(),El)),"af-skeleton":()=>Promise.resolve().then(() => (Ul(),Ol)),"af-divider":()=>Promise.resolve().then(() => (Vl(),Nl)),"af-kanga-card":()=>Promise.resolve().then(() => (yl(),Kl)),"af-cultural-card":()=>Promise.resolve().then(() => (Cl(),jl)),"af-pattern-showcase":()=>Promise.resolve().then(() => (Pl(),Il)),"af-language-switcher":()=>Promise.resolve().then(() => (Zl(),Tl)),"af-auth":()=>Promise.resolve().then(() => (tb(),zl)),"af-auth-form":()=>Promise.resolve().then(() => (Ar(),Na)),"af-kyc-upload":()=>Promise.resolve().then(() => (kr(),Va)),"af-wallet-balance":()=>Promise.resolve().then(() => (Hr(),Ka)),"af-transaction-ledger":()=>Promise.resolve().then(() => (Mr(),ja)),"af-nav-drawer":()=>Promise.resolve().then(() => (Rr(),Ca)),"af-theme-toggle":()=>Promise.resolve().then(() => (ob(),nb))};var Q={COMPONENT:"component",FORM:"form",LIST:"list",CARD:"card",MODAL:"modal",TOAST:"toast",PROGRESS:"progress",CHART:"chart",DATATABLE:"datatable",TABS:"tabs",ACCORDION:"accordion",STEPPER:"stepper",DASHBOARD_WIDGET:"dashboard-widget"},Oi={component:{type:"object",properties:{id:{type:"string"},type:{type:"string",enum:Object.values(Q)},props:{type:"object"},children:{type:"array",items:{$ref:"#"}}},required:["id","type"]}};function rb(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function ao(t){if(Array.isArray(t))return t.map(ao).join("");if(t===null||t===void 0||t===!1)return"";if(typeof t==="string"||typeof t==="number"||typeof t==="boolean")return rb(t);if(typeof t!=="object")return"";let n=t.tag||t.tagName;if(!n)return"";let r=t.props||{},o=Object.entries(r).filter(([,l])=>l!==null&&l!==void 0&&l!==!1).map(([l,b])=>b===!0?l:`${l}="${rb(b)}"`).join(" "),a=ao(t.children??t.content??"");return`<${n}${o?` ${o}`:""}>${a}</${n}>`}function N0(t){return/<\s*script\b|on\w+\s*=|javascript:/i.test(String(t))}class lo{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(N0(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(ao).join(""):ao(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 o=document.createElement("div");o.innerHTML=n;while(o.firstChild)this.root.appendChild(o.firstChild)}return n}createElement(t){let{type:n,props:r={},children:o=[]}=t,a;switch(n){case Q.COMPONENT:a=this.createCustomComponent(r);break;case Q.FORM:a=this.createForm(r);break;case Q.LIST:a=this.createList(r);break;case Q.CARD:a=this.createCard(r);break;case Q.MODAL:a=this.createModal(r);break;case Q.TOAST:a=this.createToast(r);break;case Q.PROGRESS:a=this.createProgress(r);break;case Q.CHART:a=this.createChart(r);break;case Q.DATATABLE:a=this.createDatatable(r);break;case Q.TABS:a=this.createTabs(r);break;case Q.ACCORDION:a=this.createAccordion(r);break;case Q.STEPPER:a=this.createStepper(r);break;case Q.DASHBOARD_WIDGET:a=this.createDashboardWidget(r);break;default:throw Error(`Unknown A2UI component type: ${n}`)}if(o.length>0)for(let l of o){let b=this.createElement(l);a.appendChild(b)}return a}createCustomComponent({tag:t,...n}){let r=document.createElement(t||"div");return Object.assign(r,n),r}createForm({fields:t=[],onSubmit:n}){let r=document.createElement("af-form");for(let o of t){let a=document.createElement("af-input");a.setAttribute("name",o.name),a.setAttribute("placeholder",o.placeholder||""),a.setAttribute("type",o.type||"text"),r.appendChild(a)}if(n)r.addEventListener("submit",n);return r}createList({items:t=[]}){let n=document.createElement("af-grid");for(let r of t){let o=this.createCard(r);n.appendChild(o)}return n}createCard({title:t,content:n,image:r}){let o=document.createElement("af-card");if(t){let a=document.createElement("h3");a.textContent=t,o.appendChild(a)}if(n){let a=document.createElement("p");a.textContent=n,o.appendChild(a)}if(r){let a=document.createElement("img");a.src=r,a.alt=t||"Card image",o.appendChild(a)}return o}createModal({title:t,content:n,actions:r=[]}){let o=document.createElement("af-modal");if(o.setAttribute("open",""),t){let l=document.createElement("h2");l.slot="header",l.textContent=t,o.appendChild(l)}if(n){let l=document.createElement("p");l.textContent=n,o.appendChild(l)}let a=document.createElement("div");a.slot="footer";for(let l of r){let b=document.createElement("af-button");if(b.textContent=l.label,l.primary)b.setAttribute("variant","primary");if(l.onClick)b.addEventListener("click",l.onClick);a.appendChild(b)}return o.appendChild(a),o}createToast({message:t,type:n="info",duration:r=3000}){let o=document.createElement("af-toast");return o.setAttribute("type",n),o.textContent=t,setTimeout(()=>{o.remove()},r),o}createProgress({value:t=0,max:n=100,label:r}){let o=document.createElement("af-progress");if(o.setAttribute("value",t),o.setAttribute("max",n),r)o.setAttribute("label",r);return o}createChart({type:t="bar",data:n=[],labels:r=[],title:o,options:a={}}){let l=document.createElement("af-chart");if(l.setAttribute("type",t),l.setAttribute("data",JSON.stringify(n)),l.setAttribute("labels",JSON.stringify(r)),o)l.setAttribute("title",o);if(a)l.setAttribute("options",JSON.stringify(a));return l}createDatatable({columns:t=[],rows:n=[],title:r,options:o={}}){let a=document.createElement("af-datatable");if(a.setAttribute("columns",JSON.stringify(t)),a.setAttribute("rows",JSON.stringify(n)),r)a.setAttribute("title",r);if(o)a.setAttribute("options",JSON.stringify(o));return a}createTabs({tabs:t=[],activeTab:n=0}){let r=document.createElement("af-tabs");r.setAttribute("active",n);for(let o=0;o<t.length;o++){let a=t[o],l=document.createElement("af-tab-button");l.setAttribute("tab-id",o),l.textContent=a.title;let b=document.createElement("af-tab-content");b.setAttribute("tab-id",o),b.innerHTML=a.content||"",r.appendChild(l),r.appendChild(b)}return r}createAccordion({items:t=[]}){let n=document.createElement("af-accordion");for(let r of t){let o=document.createElement("af-accordion-panel"),a=document.createElement("af-accordion-header");a.textContent=r.title;let l=document.createElement("af-accordion-content");l.innerHTML=r.content||"",o.appendChild(a),o.appendChild(l),n.appendChild(o)}return n}createStepper({steps:t=[],currentStep:n=0}){let r=document.createElement("af-stepper");r.setAttribute("current-step",n);for(let o=0;o<t.length;o++){let a=document.createElement("af-step");if(a.setAttribute("step-number",o+1),a.setAttribute("active",o<=n),o===n)a.setAttribute("current","true");a.textContent=t[o].title||`Step ${o+1}`,r.appendChild(a)}return r}createDashboardWidget({title:t,content:n,type:r="card",size:o="medium",actions:a=[]}){let l=document.createElement("af-dashboard-widget");if(l.setAttribute("type",r),l.setAttribute("size",o),t){let b=document.createElement("h3");b.className="widget-title",b.textContent=t,l.appendChild(b)}if(n){let b=document.createElement("div");b.className="widget-content",b.innerHTML=typeof n==="string"?n:JSON.stringify(n),l.appendChild(b)}if(a.length>0){let b=document.createElement("div");b.className="widget-actions";for(let e of a){let h=document.createElement("af-button");if(h.textContent=e.label,h.setAttribute("variant",e.variant||"secondary"),e.onClick)h.addEventListener("click",e.onClick);b.appendChild(h)}l.appendChild(b)}return l}update(t,n){let r=this.components.get(t);if(r)Object.assign(r,n)}remove(t){let n=this.components.get(t);if(n)n.remove(),this.components.delete(t)}}class bo{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(),r=new TextDecoder,o="";while(!0){let{done:a,value:l}=await n.read();if(a)break;o+=r.decode(l,{stream:!0});let b=o.split(`
4485
+ `);o=b.pop();for(let e of b)if(e.trim())this.processMessage(e.trim())}if(o.trim())this.processMessage(o.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 r of t)r(n)}}}validateAgainstSchema(t){let n=t?.tag||t?.tagName;return Promise.resolve(Boolean(n&&ro[n]))}}function ab(t){if(typeof document>"u")t=null;else t=t||document.body;let n=new lo(t),r=new bo(n);if(typeof window<"u")window.a2ui={render:(o)=>r.processMessage(o),handleStream:(o)=>r.handleStream(o),update:(o,a)=>n.update(o,a),remove:(o)=>n.remove(o),sendMessage:(o)=>r.sendMessage(o),onMessage:(o)=>r.onMessage(o),createStream:()=>r.createStream(),validateAgainstSchema:(o)=>r.validateAgainstSchema(o)};return{renderer:n,protocol:r}}Ht();function V0(t={}){if(typeof window<"u"){console.log("\uD83C\uDF0D AfriCode Browser SDK Initialized");let n={...ro,...t};if(Object.keys(n).length>0)Er(n)}}var rc={createReactiveState:ft,subscribe:ht,createSignal:ho,createEffect:io,store:G,actions:vn,patterns:it,motion:So,html:d,Layout:Wr,schemas:kn,Validation:et,rules:U,afri:ea,AfriFieldBuilder:y,normalizeInput:fa,buildSchema:ha,createFramework:ba,getConfig:Bt,getRequestIdentity:ca,parseCookieHeader:Oo,createSessionId:ia,SESSION_COOKIE_NAME:Uo,sessionStore:j,runtimeActions:ga,MiddlewareManager:Co,loggerMiddleware:ma,authMiddleware:va,AfriCodeError:F,ValidationError:Ln,InvalidUrlError:No,SecurityError:Dt,CsrfError:Vo,RateLimitError:Ko,DatabaseError:yo,ComponentError:jo,initA2UI:ab,A2UIRenderer:lo,A2UIProtocol:bo,init:V0};export{ht as subscribe,G as store,j as sessionStore,kn as schemas,ga as runtimeActions,U as rules,it as patterns,Oo as parseCookieHeader,fa as normalizeInput,So as motion,ma as loggerMiddleware,ab as initA2UI,V0 as init,d as html,ca as getRequestIdentity,Bt as getConfig,rc as default,ho as createSignal,ia as createSessionId,ft as createReactiveState,ba as createFramework,io as createEffect,ha as buildSchema,va as authMiddleware,ea as afri,vn as actions,Ln as ValidationError,et as Validation,Dt as SecurityError,Uo as SESSION_COOKIE_NAME,Ko as RateLimitError,Co as MiddlewareManager,Wr as Layout,No as InvalidUrlError,yo as DatabaseError,Vo as CsrfError,jo as ComponentError,y as AfriFieldBuilder,F as AfriCodeError,lo as A2UIRenderer,bo as A2UIProtocol};
4483
4486
 
4484
- //# debugId=F0A067E8E7015B7664756E2164756E21
4487
+ //# debugId=C85B87F0BF12F6B064756E2164756E21