levix-bot 4.9.1 → 5.0.0

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 (245) hide show
  1. package/README.md +57 -3
  2. package/SETUP.md +63 -7
  3. package/app.cjs +159 -46
  4. package/deploy/install.sh +10 -5
  5. package/package.json +9 -6
  6. package/public/dashboard/assets/40af6d88b63079a0-BZ8ojJNu.woff2 +0 -0
  7. package/public/dashboard/assets/481acf6760031cee-BypgxfGb.woff2 +0 -0
  8. package/public/dashboard/assets/6d3351fc535f8ef3-D2-eand5.woff2 +0 -0
  9. package/public/dashboard/assets/8ab0af53a3bda9d3-CyCXRvzh.woff2 +0 -0
  10. package/public/dashboard/assets/8f262393e9249e61-TQp-UTiE.woff2 +0 -0
  11. package/public/dashboard/assets/94d65887a83f1282-DmpS2jIq.woff2 +0 -0
  12. package/public/dashboard/assets/99e400330f36ae77-D3oMJlXt.woff2 +0 -0
  13. package/public/dashboard/assets/9d1f41b13e519d90-BVNSOH3d.woff2 +0 -0
  14. package/public/dashboard/assets/a005256cb957ecc7-CoYeBiSI.woff2 +0 -0
  15. package/public/dashboard/assets/b19c2080652a3c2b-DIC32ArD.woff2 +0 -0
  16. package/public/dashboard/assets/c4064400db3750ce-BehTv68k.woff2 +0 -0
  17. package/public/dashboard/assets/c69d345fa1068c2d-CmI34b-g.woff2 +0 -0
  18. package/public/dashboard/assets/cc27b30471250057-6fWv1k7M.woff2 +0 -0
  19. package/public/dashboard/assets/d8c30647abfeffe6-eXO_dkmS.woff2 +0 -0
  20. package/public/dashboard/assets/eb83d8d40af4411f-Buze_B52.woff2 +0 -0
  21. package/public/dashboard/assets/effc6711249e7349-qRpaaN48.woff2 +0 -0
  22. package/public/dashboard/assets/gateway-BDYet0pI.css +1 -0
  23. package/public/dashboard/assets/gateway-BYt6-s1O.js +1 -0
  24. package/public/dashboard/assets/index-B9wFpD_z.css +2 -0
  25. package/public/dashboard/assets/index-DWcQmu0_.js +124 -0
  26. package/public/dashboard/assets/index-Da-j89O-.js +458 -0
  27. package/public/dashboard/font-licenses/jetbrainsmono-OFL.txt +93 -0
  28. package/public/dashboard/font-licenses/plusjakartasans-OFL.txt +93 -0
  29. package/public/dashboard/font-licenses/tajawal-OFL.txt +93 -0
  30. package/public/dashboard/gateway.html +17 -0
  31. package/public/dashboard/index.html +3 -5
  32. package/public/ui-boot.js +33 -14
  33. package/scheduler.cjs +76 -23
  34. package/src/auth/auth-storage.cjs +54 -7
  35. package/src/auth/use-database-auth-state.js +70 -39
  36. package/src/automation/engine.js +412 -0
  37. package/src/automation/limits.cjs +6 -0
  38. package/src/automation/manage.js +290 -0
  39. package/src/automation/reactions.js +471 -0
  40. package/src/automation/rules.cjs +114 -0
  41. package/src/automation/status.cjs +76 -0
  42. package/src/backup/account.cjs +29 -0
  43. package/src/backup/activation.cjs +247 -0
  44. package/src/backup/content.cjs +36 -0
  45. package/src/backup/create.cjs +280 -0
  46. package/src/backup/extensions.cjs +101 -0
  47. package/src/backup/format.cjs +565 -0
  48. package/src/backup/jobs.cjs +111 -0
  49. package/src/backup/journal.cjs +41 -0
  50. package/src/backup/plan.cjs +223 -0
  51. package/src/backup/recovery.cjs +110 -0
  52. package/src/backup/restore.cjs +460 -0
  53. package/src/backup/uploads.cjs +146 -0
  54. package/src/bootstrap/core.js +50 -12
  55. package/src/bootstrap/panel.js +53 -2
  56. package/src/bootstrap/session-startup-policy.js +8 -1
  57. package/src/cli.js +163 -22
  58. package/src/commands/autodelete.cjs +41 -57
  59. package/src/commands/autoschedule.cjs +7 -33
  60. package/src/commands/blacklist.cjs +17 -35
  61. package/src/commands/block.cjs +4 -18
  62. package/src/commands/calc.cjs +22 -74
  63. package/src/commands/debt.cjs +28 -59
  64. package/src/commands/deleteschedule.cjs +7 -23
  65. package/src/commands/digit.cjs +5 -39
  66. package/src/commands/gemini.cjs +135 -218
  67. package/src/commands/group/add.cjs +28 -76
  68. package/src/commands/group/all.cjs +4 -15
  69. package/src/commands/group/antilink.cjs +28 -41
  70. package/src/commands/group/antispam.cjs +25 -35
  71. package/src/commands/group/approveall.cjs +7 -21
  72. package/src/commands/group/clearwarns.cjs +4 -18
  73. package/src/commands/group/deletenote.cjs +4 -18
  74. package/src/commands/group/demote.cjs +6 -23
  75. package/src/commands/group/flagged.cjs +10 -19
  76. package/src/commands/group/kick.cjs +26 -36
  77. package/src/commands/group/media.cjs +21 -36
  78. package/src/commands/group/members.cjs +16 -28
  79. package/src/commands/group/note.cjs +3 -14
  80. package/src/commands/group/policy.cjs +16 -37
  81. package/src/commands/group/promote.cjs +5 -22
  82. package/src/commands/group/removeall.cjs +6 -38
  83. package/src/commands/group/rules.cjs +4 -19
  84. package/src/commands/group/save.cjs +4 -18
  85. package/src/commands/group/setname.cjs +5 -19
  86. package/src/commands/group/setpp.cjs +8 -26
  87. package/src/commands/group/setrules.cjs +4 -15
  88. package/src/commands/group/setwarn.cjs +6 -23
  89. package/src/commands/group/tagadmins.cjs +5 -16
  90. package/src/commands/group/warn.cjs +5 -16
  91. package/src/commands/group/warns.cjs +12 -33
  92. package/src/commands/group/welcome.cjs +17 -34
  93. package/src/commands/group.cjs +91 -68
  94. package/src/commands/help.cjs +48 -89
  95. package/src/commands/lang.cjs +38 -97
  96. package/src/commands/listschedules.cjs +19 -30
  97. package/src/commands/loop.cjs +9 -55
  98. package/src/commands/md.cjs +2 -13
  99. package/src/commands/memory.cjs +53 -87
  100. package/src/commands/mod.cjs +40 -79
  101. package/src/commands/notes.cjs +4 -15
  102. package/src/commands/pack.cjs +26 -49
  103. package/src/commands/packs.cjs +8 -18
  104. package/src/commands/perm.cjs +48 -51
  105. package/src/commands/ping.cjs +2 -10
  106. package/src/commands/poll.cjs +5 -38
  107. package/src/commands/prayer.cjs +55 -36
  108. package/src/commands/qr.cjs +4 -18
  109. package/src/commands/rand.cjs +9 -58
  110. package/src/commands/restart.cjs +15 -33
  111. package/src/commands/schedule.cjs +5 -25
  112. package/src/commands/score.cjs +6 -27
  113. package/src/commands/send.cjs +4 -18
  114. package/src/commands/setprefix.cjs +11 -23
  115. package/src/commands/shortlink.cjs +13 -39
  116. package/src/commands/status.cjs +188 -76
  117. package/src/commands/sticker.cjs +5 -16
  118. package/src/commands/stickers.cjs +16 -20
  119. package/src/commands/stopbot.cjs +9 -25
  120. package/src/commands/stt.cjs +75 -107
  121. package/src/commands/todo.cjs +11 -31
  122. package/src/commands/toimage.cjs +11 -27
  123. package/src/commands/translate.cjs +53 -36
  124. package/src/commands/tts.cjs +46 -40
  125. package/src/commands/unblock.cjs +3 -17
  126. package/src/commands/update.cjs +23 -0
  127. package/src/commands/weather.cjs +40 -47
  128. package/src/config/ai-identity.cjs +14 -1
  129. package/src/config/baileys.config.js +16 -3
  130. package/src/config/data-dir.cjs +37 -0
  131. package/src/config/defaults.cjs +1 -0
  132. package/src/config/exit-codes.cjs +11 -0
  133. package/src/config/lock.cjs +55 -81
  134. package/src/config/official-links.cjs +61 -0
  135. package/src/config/paths.cjs +4 -33
  136. package/src/config/release.cjs +87 -0
  137. package/src/config/settings.cjs +199 -10
  138. package/src/core/connection.js +77 -9
  139. package/src/core/events.js +119 -33
  140. package/src/core/session.js +536 -84
  141. package/src/core/socket.js +81 -10
  142. package/src/db/copy.cjs +136 -0
  143. package/src/db/db.cjs +241 -36
  144. package/src/db/startup-guard.js +5 -0
  145. package/src/db/store.cjs +561 -54
  146. package/src/diagnostics/baileysLog.cjs +87 -0
  147. package/src/diagnostics/debugLog.cjs +16 -4
  148. package/src/diagnostics/device.cjs +4 -2
  149. package/src/diagnostics/nodeRuntime.cjs +131 -0
  150. package/src/diagnostics/signalSessionInspect.cjs +38 -0
  151. package/src/domain/command.js +24 -22
  152. package/src/extensions/autoReply.cjs +521 -0
  153. package/src/extensions/context.cjs +73 -0
  154. package/src/extensions/contract.cjs +69 -0
  155. package/src/extensions/entitlement/client.cjs +381 -0
  156. package/src/extensions/entitlement/index.cjs +629 -0
  157. package/src/extensions/entitlement/installation.cjs +117 -0
  158. package/src/extensions/entitlement/keys.cjs +72 -0
  159. package/src/extensions/entitlement/state.cjs +201 -0
  160. package/src/extensions/entitlement/target.cjs +7 -0
  161. package/src/extensions/entitlement/token.cjs +225 -0
  162. package/src/extensions/host.cjs +519 -0
  163. package/src/extensions/templateKeys.cjs +81 -0
  164. package/src/handlers/command.handler.js +191 -64
  165. package/src/handlers/group.handler.js +78 -18
  166. package/src/handlers/message.handler.js +56 -25
  167. package/src/i18n/catalog.generated.cjs +3537 -0
  168. package/src/index.js +51 -12
  169. package/src/legal/bundled/ar.json +102 -0
  170. package/src/legal/bundled/en.json +102 -0
  171. package/src/legal/bundled/es-419.json +102 -0
  172. package/src/legal/bundled/pt-BR.json +102 -0
  173. package/src/legal/cli.cjs +200 -0
  174. package/src/legal/consent.cjs +187 -0
  175. package/src/legal/document.cjs +156 -0
  176. package/src/legal/keys.cjs +100 -0
  177. package/src/legal/release.cjs +226 -0
  178. package/src/legal/remote.cjs +419 -0
  179. package/src/legal/terms.cjs +142 -0
  180. package/src/messaging/escape.cjs +31 -0
  181. package/src/messaging/health.cjs +65 -0
  182. package/src/messaging/identity.cjs +42 -0
  183. package/src/messaging/message.cjs +136 -0
  184. package/src/messaging/parser.cjs +88 -0
  185. package/src/messaging/router.cjs +217 -0
  186. package/src/middleware/permissions.middleware.js +34 -2
  187. package/src/panel/account-profile.cjs +489 -0
  188. package/src/panel/fallback-page.cjs +177 -0
  189. package/src/panel/password-reset.cjs +13 -14
  190. package/src/panel/recovery-email.cjs +3 -1
  191. package/src/routes/backup.api.esm.js +175 -0
  192. package/src/routes/dashboard.api.esm.js +183 -7
  193. package/src/routes/plus.api.esm.js +172 -0
  194. package/src/routes/reactions.api.esm.js +60 -0
  195. package/src/services/aiAgent.cjs +56 -43
  196. package/src/services/aiDocs.cjs +187 -0
  197. package/src/services/aiImage.cjs +183 -0
  198. package/src/services/aiMedia.cjs +146 -0
  199. package/src/services/aiProviders.cjs +76 -80
  200. package/src/services/aiRouter.cjs +2 -2
  201. package/src/services/aiToolAuth.cjs +76 -4
  202. package/src/services/aiTools.cjs +431 -105
  203. package/src/services/autoDelete.cjs +9 -1
  204. package/src/services/levix-docs.generated.json +2623 -0
  205. package/src/services/memoryPolicy.cjs +56 -0
  206. package/src/services/updateCheck.cjs +362 -0
  207. package/src/stickers/errors.cjs +53 -97
  208. package/src/stickers/library.cjs +13 -6
  209. package/src/stickers/owner.cjs +1 -1
  210. package/src/utils/commandContext.cjs +13 -0
  211. package/src/utils/commandDocs.cjs +42 -20
  212. package/src/utils/geminiHttpOptions.cjs +56 -0
  213. package/src/utils/geminiMedia.cjs +28 -3
  214. package/src/utils/groupMetadataCache.cjs +386 -21
  215. package/src/utils/httpsFetch.cjs +113 -0
  216. package/src/utils/i18n.cjs +117 -7
  217. package/src/utils/linkPreview.cjs +90 -0
  218. package/src/utils/logger.cjs +6 -0
  219. package/src/utils/markdownParser.cjs +3 -3
  220. package/src/utils/memory.cjs +375 -28
  221. package/src/utils/messageContent.cjs +7 -1
  222. package/src/utils/moderationAction.cjs +116 -73
  223. package/src/utils/moderationSummary.cjs +32 -56
  224. package/src/utils/permissionLevel.cjs +7 -28
  225. package/src/utils/permissions.cjs +23 -14
  226. package/src/utils/permissions.esm.js +99 -166
  227. package/src/utils/recentMessageCache.esm.js +241 -37
  228. package/src/utils/recurrence.cjs +78 -66
  229. package/src/utils/sendBotMessage.cjs +14 -29
  230. package/src/utils/sendBotMessage.esm.js +28 -13
  231. package/src/utils/statusMessage.cjs +94 -33
  232. package/src/utils/stickerBot.cjs +18 -16
  233. package/src/utils/storage.cjs +2 -0
  234. package/src/utils/storage.esm.js +2 -0
  235. package/src/utils/thumbnail.cjs +5 -21
  236. package/public/dashboard/assets/index-B1sOW2VX.js +0 -561
  237. package/public/dashboard/assets/index-CK8osB4o.css +0 -2
  238. package/public/dashboard.css +0 -3127
  239. package/public/dashboard.js +0 -1981
  240. package/public/gateway-i18n.js +0 -321
  241. package/public/gateway.js +0 -70
  242. package/views/dashboard.ejs +0 -775
  243. package/views/login.ejs +0 -408
  244. package/views/qr.ejs +0 -155
  245. package/views/setup.ejs +0 -118
@@ -1,561 +0,0 @@
1
- var nk=Object.defineProperty;var ak=(n,i,r)=>i in n?nk(n,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[i]=r;var Uy=(n,i,r)=>ak(n,typeof i!="symbol"?i+"":i,r);(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(m)}).observe(document,{childList:!0,subtree:!0});function r(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function o(d){if(d.ep)return;d.ep=!0;const f=r(d);fetch(d.href,f)}})();function $m(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Mf={exports:{}},yr={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Hy;function sk(){if(Hy)return yr;Hy=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(o,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var p in d)p!=="key"&&(f[p]=d[p])}else f=d;return d=f.ref,{$$typeof:n,type:o,key:m,ref:d!==void 0?d:null,props:f}}return yr.Fragment=i,yr.jsx=r,yr.jsxs=r,yr}var Py;function lk(){return Py||(Py=1,Mf.exports=sk()),Mf.exports}var s=lk(),Rf={exports:{}},Ye={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var qy;function ik(){if(qy)return Ye;qy=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),S=Symbol.for("react.view_transition"),A=Symbol.iterator;function k(C){return C===null||typeof C!="object"?null:(C=A&&C[A]||C["@@iterator"],typeof C=="function"?C:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,L={};function _(C,K,Y){this.props=C,this.context=K,this.refs=L,this.updater=Y||N}_.prototype.isReactComponent={},_.prototype.setState=function(C,K){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,K,"setState")},_.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function G(){}G.prototype=_.prototype;function R(C,K,Y){this.props=C,this.context=K,this.refs=L,this.updater=Y||N}var ne=R.prototype=new G;ne.constructor=R,j(ne,_.prototype),ne.isPureReactComponent=!0;var U=Array.isArray;function M(){}var T={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function O(C,K,Y){var me=Y.ref;return{$$typeof:n,type:C,key:K,ref:me!==void 0?me:null,props:Y}}function J(C,K){return O(C.type,K,C.props)}function Z(C){return typeof C=="object"&&C!==null&&C.$$typeof===n}function se(C){var K={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(Y){return K[Y]})}var E=/\/+/g;function z(C,K){return typeof C=="object"&&C!==null&&C.key!=null?se(""+C.key):K.toString(36)}function F(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(M,M):(C.status="pending",C.then(function(K){C.status==="pending"&&(C.status="fulfilled",C.value=K)},function(K){C.status==="pending"&&(C.status="rejected",C.reason=K)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function le(C,K,Y,me,te){var oe=typeof C;(oe==="undefined"||oe==="boolean")&&(C=null);var ve=!1;if(C===null)ve=!0;else switch(oe){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(C.$$typeof){case n:case i:ve=!0;break;case x:return ve=C._init,le(ve(C._payload),K,Y,me,te)}}if(ve)return te=te(C),ve=me===""?"."+z(C,0):me,U(te)?(Y="",ve!=null&&(Y=ve.replace(E,"$&/")+"/"),le(te,K,Y,"",function(it){return it})):te!=null&&(Z(te)&&(te=J(te,Y+(te.key==null||C&&C.key===te.key?"":(""+te.key).replace(E,"$&/")+"/")+ve)),K.push(te)),1;ve=0;var be=me===""?".":me+":";if(U(C))for(var Se=0;Se<C.length;Se++)me=C[Se],oe=be+z(me,Se),ve+=le(me,K,Y,oe,te);else if(Se=k(C),typeof Se=="function")for(C=Se.call(C),Se=0;!(me=C.next()).done;)me=me.value,oe=be+z(me,Se++),ve+=le(me,K,Y,oe,te);else if(oe==="object"){if(typeof C.then=="function")return le(F(C),K,Y,me,te);throw K=String(C),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return ve}function pe(C,K,Y){if(C==null)return C;var me=[],te=0;return le(C,me,"","",function(oe){return K.call(Y,oe,te++)}),me}function he(C){if(C._status===-1){var K=C._result,Y=K();Y.then(function(me){(C._status===0||C._status===-1)&&(C._status=1,C._result=me,Y.status===void 0&&(Y.status="fulfilled",Y.value=me))},function(me){(C._status===0||C._status===-1)&&(C._status=2,C._result=me,Y.status===void 0&&(Y.status="rejected",Y.reason=me))}),C._status===-1&&(C._status=0,C._result=Y)}if(C._status===1)return C._result.default;throw C._result}var I=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)};function ce(C){var K=T.T,Y={};Y.types=K!==null?K.types:null,T.T=Y;try{var me=C(),te=T.S;te!==null&&te(Y,me),typeof me=="object"&&me!==null&&typeof me.then=="function"&&me.then(M,I)}catch(oe){I(oe)}finally{K!==null&&Y.types!==null&&(K.types=Y.types),T.T=K}}function ie(C){var K=T.T;if(K!==null){var Y=K.types;Y===null?K.types=[C]:Y.indexOf(C)===-1&&Y.push(C)}else ce(ie.bind(null,C))}var fe={map:pe,forEach:function(C,K,Y){pe(C,function(){K.apply(this,arguments)},Y)},count:function(C){var K=0;return pe(C,function(){K++}),K},toArray:function(C){return pe(C,function(K){return K})||[]},only:function(C){if(!Z(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return Ye.Activity=v,Ye.Children=fe,Ye.Component=_,Ye.Fragment=r,Ye.Profiler=d,Ye.PureComponent=R,Ye.StrictMode=o,Ye.Suspense=h,Ye.ViewTransition=S,Ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,Ye.__COMPILER_RUNTIME={__proto__:null,c:function(C){return T.H.useMemoCache(C)}},Ye.addTransitionType=ie,Ye.cache=function(C){return function(){return C.apply(null,arguments)}},Ye.cacheSignal=function(){return null},Ye.cloneElement=function(C,K,Y){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var me=j({},C.props),te=C.key;if(K!=null)for(oe in K.key!==void 0&&(te=""+K.key),K)!P.call(K,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&K.ref===void 0||(me[oe]=K[oe]);var oe=arguments.length-2;if(oe===1)me.children=Y;else if(1<oe){for(var ve=Array(oe),be=0;be<oe;be++)ve[be]=arguments[be+2];me.children=ve}return O(C.type,te,me)},Ye.createContext=function(C){return C={$$typeof:m,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:f,_context:C},C},Ye.createElement=function(C,K,Y){var me,te={},oe=null;if(K!=null)for(me in K.key!==void 0&&(oe=""+K.key),K)P.call(K,me)&&me!=="key"&&me!=="__self"&&me!=="__source"&&(te[me]=K[me]);var ve=arguments.length-2;if(ve===1)te.children=Y;else if(1<ve){for(var be=Array(ve),Se=0;Se<ve;Se++)be[Se]=arguments[Se+2];te.children=be}if(C&&C.defaultProps)for(me in ve=C.defaultProps,ve)te[me]===void 0&&(te[me]=ve[me]);return O(C,oe,te)},Ye.createRef=function(){return{current:null}},Ye.forwardRef=function(C){return{$$typeof:p,render:C}},Ye.isValidElement=Z,Ye.lazy=function(C){return{$$typeof:x,_payload:{_status:-1,_result:C},_init:he}},Ye.memo=function(C,K){return{$$typeof:b,type:C,compare:K===void 0?null:K}},Ye.startTransition=ce,Ye.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},Ye.use=function(C){return T.H.use(C)},Ye.useActionState=function(C,K,Y){return T.H.useActionState(C,K,Y)},Ye.useCallback=function(C,K){return T.H.useCallback(C,K)},Ye.useContext=function(C){return T.H.useContext(C)},Ye.useDebugValue=function(){},Ye.useDeferredValue=function(C,K){return T.H.useDeferredValue(C,K)},Ye.useEffect=function(C,K){return T.H.useEffect(C,K)},Ye.useEffectEvent=function(C){return T.H.useEffectEvent(C)},Ye.useId=function(){return T.H.useId()},Ye.useImperativeHandle=function(C,K,Y){return T.H.useImperativeHandle(C,K,Y)},Ye.useInsertionEffect=function(C,K){return T.H.useInsertionEffect(C,K)},Ye.useLayoutEffect=function(C,K){return T.H.useLayoutEffect(C,K)},Ye.useMemo=function(C,K){return T.H.useMemo(C,K)},Ye.useOptimistic=function(C,K){return T.H.useOptimistic(C,K)},Ye.useReducer=function(C,K,Y){return T.H.useReducer(C,K,Y)},Ye.useRef=function(C){return T.H.useRef(C)},Ye.useState=function(C){return T.H.useState(C)},Ye.useSyncExternalStore=function(C,K,Y){return T.H.useSyncExternalStore(C,K,Y)},Ye.useTransition=function(){return T.H.useTransition()},Ye.version="19.3.0",Ye}var Fy;function Jm(){return Fy||(Fy=1,Rf.exports=ik()),Rf.exports}var y=Jm();const rk=$m(y);var zf={exports:{}},br={},Lf={exports:{}},Of={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var Gy;function ok(){return Gy||(Gy=1,(function(n){function i(F,le){var pe=F.length;F.push(le);e:for(;0<pe;){var he=pe-1>>>1,I=F[he];if(0<d(I,le))F[he]=le,F[pe]=I,pe=he;else break e}}function r(F){return F.length===0?null:F[0]}function o(F){if(F.length===0)return null;var le=F[0],pe=F.pop();if(pe!==le){F[0]=pe;e:for(var he=0,I=F.length,ce=I>>>1;he<ce;){var ie=2*(he+1)-1,fe=F[ie],C=ie+1,K=F[C];if(0>d(fe,pe))C<I&&0>d(K,fe)?(F[he]=K,F[C]=pe,he=C):(F[he]=fe,F[ie]=pe,he=ie);else if(C<I&&0>d(K,pe))F[he]=K,F[C]=pe,he=C;else break e}}return le}function d(F,le){var pe=F.sortIndex-le.sortIndex;return pe!==0?pe:F.id-le.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var m=Date,p=m.now();n.unstable_now=function(){return m.now()-p}}var h=[],b=[],x=1,v=null,S=3,A=!1,k=!1,N=!1,j=!1,L=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function R(F){for(var le=r(b);le!==null;){if(le.callback===null)o(b);else if(le.startTime<=F)o(b),le.sortIndex=le.expirationTime,i(h,le);else break;le=r(b)}}function ne(F){if(N=!1,R(F),!k)if(r(h)!==null)k=!0,U||(U=!0,Z());else{var le=r(b);le!==null&&z(ne,le.startTime-F)}}var U=!1,M=-1,T=5,P=-1;function O(){return j?!0:!(n.unstable_now()-P<T)}function J(){if(j=!1,U){var F=n.unstable_now();P=F;var le=!0;try{e:{k=!1,N&&(N=!1,_(M),M=-1),A=!0;var pe=S;try{t:{for(R(F),v=r(h);v!==null&&!(v.expirationTime>F&&O());){var he=v.callback;if(typeof he=="function"){v.callback=null,S=v.priorityLevel;var I=he(v.expirationTime<=F);if(F=n.unstable_now(),typeof I=="function"){v.callback=I,R(F),le=!0;break t}v===r(h)&&o(h),R(F)}else o(h);v=r(h)}if(v!==null)le=!0;else{var ce=r(b);ce!==null&&z(ne,ce.startTime-F),le=!1}}break e}finally{v=null,S=pe,A=!1}le=void 0}}finally{le?Z():U=!1}}}var Z;if(typeof G=="function")Z=function(){G(J)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,E=se.port2;se.port1.onmessage=J,Z=function(){E.postMessage(null)}}else Z=function(){L(J,0)};function z(F,le){M=L(function(){F(n.unstable_now())},le)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(F){F.callback=null},n.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<F?Math.floor(1e3/F):5},n.unstable_getCurrentPriorityLevel=function(){return S},n.unstable_next=function(F){switch(S){case 1:case 2:case 3:var le=3;break;default:le=S}var pe=S;S=le;try{return F()}finally{S=pe}},n.unstable_requestPaint=function(){j=!0},n.unstable_runWithPriority=function(F,le){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var pe=S;S=F;try{return le()}finally{S=pe}},n.unstable_scheduleCallback=function(F,le,pe){var he=n.unstable_now();switch(typeof pe=="object"&&pe!==null?(pe=pe.delay,pe=typeof pe=="number"&&0<pe?he+pe:he):pe=he,F){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=pe+I,F={id:x++,callback:le,priorityLevel:F,startTime:pe,expirationTime:I,sortIndex:-1},pe>he?(F.sortIndex=pe,i(b,F),r(h)===null&&F===r(b)&&(N?(_(M),M=-1):N=!0,z(ne,pe-he))):(F.sortIndex=I,i(h,F),k||A||(k=!0,U||(U=!0,Z()))),F},n.unstable_shouldYield=O,n.unstable_wrapCallback=function(F){var le=S;return function(){var pe=S;S=le;try{return F.apply(this,arguments)}finally{S=pe}}}})(Of)),Of}var Iy;function ck(){return Iy||(Iy=1,Lf.exports=ok()),Lf.exports}var Bf={exports:{}},nn={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var Vy;function uk(){if(Vy)return nn;Vy=1;var n=Jm();function i(x){var v="https://react.dev/errors/"+x;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)v+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+x+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var o={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},d=Symbol.for("react.portal"),f=Symbol.for("react.recoverable"),m=Symbol.for("react.optimistic_key");function p(x,v,S){var A=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:A==null?null:A===m?m:""+A,children:x,containerInfo:v,implementation:S}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function b(x,v){if(x==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,nn.browser=function(x){return{$$typeof:f,_reason:x}},nn.createPortal=function(x,v){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(i(299));return p(x,v,null,S)},nn.flushSync=function(x){var v=h.T,S=o.p;try{if(h.T=null,o.p=2,x)return x()}finally{h.T=v,o.p=S,o.d.f()}},nn.preconnect=function(x,v){typeof x=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,o.d.C(x,v))},nn.prefetchDNS=function(x){typeof x=="string"&&o.d.D(x)},nn.preinit=function(x,v){if(typeof x=="string"&&v&&typeof v.as=="string"){var S=v.as,A=b(S,v.crossOrigin),k=typeof v.integrity=="string"?v.integrity:void 0,N=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;S==="style"?o.d.S(x,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:A,integrity:k,fetchPriority:N}):S==="script"&&o.d.X(x,{crossOrigin:A,integrity:k,fetchPriority:N,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},nn.preinitModule=function(x,v){if(typeof x=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var S=b(v.as,v.crossOrigin);o.d.M(x,{crossOrigin:S,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0})}}else v==null&&o.d.M(x)},nn.preload=function(x,v){if(typeof x=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var S=v.as,A=b(S,v.crossOrigin);o.d.L(x,S,{crossOrigin:A,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},nn.preloadModule=function(x,v){if(typeof x=="string")if(v){var S=b(v.as,v.crossOrigin);o.d.m(x,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:S,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0})}else o.d.m(x)},nn.requestFormReset=function(x){o.d.r(x)},nn.unstable_batchedUpdates=function(x,v){return x(v)},nn.useFormState=function(x,v,S){return h.H.useFormState(x,v,S)},nn.useFormStatus=function(){return h.H.useHostTransitionStatus()},nn.version="19.3.0",nn}var Ky;function uv(){if(Ky)return Bf.exports;Ky=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),Bf.exports=uk(),Bf.exports}/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var Yy;function dk(){if(Yy)return br;Yy=1;var n=ck(),i=Jm(),r=uv();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){for(var t=e,a=t;a&&!a.alternate;)t=a,(t.flags&4098)!==0&&(e=t.return),a=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(f(e)!==e)throw Error(o(188))}function b(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(o(188));return t!==e?null:e}for(var a=e,l=t;;){var c=a.return;if(c===null)break;var u=c.alternate;if(u===null){if(l=c.return,l!==null){a=l;continue}break}if(c.child===u.child){for(u=c.child;u;){if(u===a)return h(c),e;if(u===l)return h(c),t;u=u.sibling}throw Error(o(188))}if(a.return!==l.return)a=c,l=u;else{for(var g=!1,w=c.child;w;){if(w===a){g=!0,a=c,l=u;break}if(w===l){g=!0,l=c,a=u;break}w=w.sibling}if(!g){for(w=u.child;w;){if(w===a){g=!0,a=u,l=c;break}if(w===l){g=!0,l=u,a=c;break}w=w.sibling}if(!g)throw Error(o(189))}}if(a.alternate!==l)throw Error(o(190))}if(a.tag!==3)throw Error(o(188));return a.stateNode.current===a?e:t}function x(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=x(e),t!==null)return t;e=e.sibling}return null}function v(e,t,a,l,c,u){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&a(e,l,c,u)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&v(e.child,t,a,l,c,u))return!0;e=e.sibling}return!1}function S(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function A(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function k(e){var t=[null,null],a=S(e);return a===null||N(t,e,a.child,{foundSelf:!1}),t}function N(e,t,a,l){for(;a!==null;){if(a===t)l.foundSelf=!0;else if(a.tag===5||a.tag===27||a.tag===6){if(l.foundSelf)return e[1]=a,!0;e[0]=a}else if((a.tag!==22||a.memoizedState===null)&&N(e,t,a.child,l))return!0;a=a.sibling}return!1}function j(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(o(559))}}var L=null,_=null;function G(e,t,a){return e===a?!0:e===t?(L=e,!0):!1}function R(e,t,a){return e===a?(_=e,!1):e===t?(_!==null&&(L=e),!0):!1}function ne(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function U(e,t,a){for(var l=0,c=e;c;c=a(c))l++;c=0;for(var u=t;u;u=a(u))c++;for(;0<l-c;)e=a(e),l--;for(;0<c-l;)t=a(t),c--;for(;l--;){if(e===t||t!==null&&e===t.alternate)return e;e=a(e),t=a(t)}return null}var M=Object.assign,T=Symbol.for("react.element"),P=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),J=Symbol.for("react.fragment"),Z=Symbol.for("react.strict_mode"),se=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),z=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),le=Symbol.for("react.suspense"),pe=Symbol.for("react.suspense_list"),he=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),ie=Symbol.for("react.legacy_hidden"),fe=Symbol.for("react.memo_cache_sentinel"),C=Symbol.for("react.view_transition"),K=Symbol.for("react.recoverable"),Y=Symbol.iterator;function me(e){return e===null||typeof e!="object"?null:(e=Y&&e[Y]||e["@@iterator"],typeof e=="function"?e:null)}var te=Symbol.for("react.client.reference");function oe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case J:return"Fragment";case se:return"Profiler";case Z:return"StrictMode";case le:return"Suspense";case pe:return"SuspenseList";case ce:return"Activity";case C:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case O:return"Portal";case z:return e.displayName||"Context";case E:return(e._context.displayName||"Context")+".Consumer";case F:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case he:return t=e.displayName||null,t!==null?t:oe(e.type)||"Memo";case I:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var ve=Array.isArray,be=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Se=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,it={pending:!1,data:null,method:null,action:null},xt=[],Ce=-1;function Ie(e){return{current:e}}function Fe(e){0>Ce||(e.current=xt[Ce],xt[Ce]=null,Ce--)}function ue(e,t){Ce++,xt[Ce]=e.current,e.current=t}var Re=Ie(null),je=Ie(null),Ke=Ie(null),yt=Ie(null);function jt(e,t){switch(ue(Ke,t),ue(je,e),ue(Re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Yx(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Yx(t),e=Qx(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Fe(Re),ue(Re,e)}function B(){Fe(Re),Fe(je),Fe(Ke)}function ye(e){var t=e.memoizedState;t!==null&&(ui._currentValue=t.memoizedState,ue(yt,e)),t=Re.current;var a=Qx(t,e.type);t!==a&&(ue(je,e),ue(Re,a))}function Le(e){je.current===e&&(Fe(Re),Fe(je)),yt.current===e&&(Fe(yt),ui._currentValue=it)}var Ge,ut;function Ut(e){if(Ge===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Ge=t&&t[1]||"",ut=-1<a.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+Ge+e+ut}var on=!1;function sn(e,t){if(!e||on)return"";on=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(ke){var V=ke}Reflect.construct(e,[],xe)}else{try{xe.call()}catch(ke){V=ke}xe=!1;try{var ee=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),xe=!0,new e}finally{xe&&(ee!==void 0?Object.defineProperty(e.prototype,"props",ee):delete e.prototype.props)}}}else{try{throw Error()}catch(ke){V=ke}(xe=e())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(ke){if(ke&&V&&typeof ke.stack=="string")return[ke.stack,V.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=l.DetermineComponentFrameRoot(),g=u[0],w=u[1];if(g&&w){var D=g.split(`
44
- `),X=w.split(`
45
- `);for(c=l=0;l<D.length&&!D[l].includes("DetermineComponentFrameRoot");)l++;for(;c<X.length&&!X[c].includes("DetermineComponentFrameRoot");)c++;if(l===D.length||c===X.length)for(l=D.length-1,c=X.length-1;1<=l&&0<=c&&D[l]!==X[c];)c--;for(;1<=l&&0<=c;l--,c--)if(D[l]!==X[c]){if(l!==1||c!==1)do if(l--,c--,0>c||D[l]!==X[c]){var ae=`
46
- `+D[l].replace(" at new "," at ");return e.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",e.displayName)),ae}while(1<=l&&0<=c);break}}}finally{on=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Ut(a):""}function kn(e,t){switch(e.tag){case 26:case 27:case 5:return Ut(e.type);case 16:return Ut("Lazy");case 13:return e.child!==t&&t!==null?Ut("Suspense Fallback"):Ut("Suspense");case 19:return Ut("SuspenseList");case 0:case 15:return sn(e.type,!1);case 11:return sn(e.type.render,!1);case 1:return sn(e.type,!0);case 31:return Ut("Activity");case 30:return Ut("ViewTransition");default:return""}}function wl(e){try{var t="",a=null;do t+=kn(e,a),a=e,e=e.return;while(e);return t}catch(l){return`
47
- Error generating stack: `+l.message+`
48
- `+l.stack}}var Va=Object.prototype.hasOwnProperty,Ms=n.unstable_scheduleCallback,Rs=n.unstable_cancelCallback,Ni=n.unstable_shouldYield,Ka=n.unstable_requestPaint,Ht=n.unstable_now,Ya=n.unstable_getCurrentPriorityLevel,zs=n.unstable_ImmediatePriority,Qa=n.unstable_UserBlockingPriority,ka=n.unstable_NormalPriority,Sl=n.unstable_LowPriority,Xa=n.unstable_IdlePriority,kl=n.log,re=n.unstable_setDisableYieldValue,Me=null,He=null;function q(e){if(typeof kl=="function"&&re(e),He&&typeof He.setStrictMode=="function")try{He.setStrictMode(Me,e)}catch{}}var Ne=Math.clz32?Math.clz32:Xt,Ve=Math.log,Qt=Math.LN2;function Xt(e){return e>>>=0,e===0?32:31-(Ve(e)/Qt|0)|0}var Qn=256,aa=262144,sa=4194304;function Xn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function la(e,t,a){var l=e.pendingLanes;if(l===0)return 0;var c=0,u=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var w=l&134217727;return w!==0?(l=w&~u,l!==0?c=Xn(l):(g&=w,g!==0?c=Xn(g):a||(a=w&~e,a!==0&&(c=Xn(a))))):(w=l&~u,w!==0?c=Xn(w):g!==0?c=Xn(g):a||(a=l&~e,a!==0&&(c=Xn(a)))),c===0?0:t!==0&&t!==c&&(t&u)===0&&(u=c&-c,a=t&-t,u>=a||u===32&&(a&4194048)!==0)?t:c}function Ci(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function bh(e,t){(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var l=31-Ne(a),c=1<<l;t|=e[l],a&=~c}return t}function gw(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function vh(){var e=sa;return sa<<=1,(sa&62914560)===0&&(sa=4194304),e}function su(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ei(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function xw(e,t,a,l,c,u){var g=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var w=e.entanglements,D=e.expirationTimes,X=e.hiddenUpdates;for(a=g&~a;0<a;){var ae=31-Ne(a),xe=1<<ae;w[ae]=0,D[ae]=-1;var V=X[ae];if(V!==null)for(X[ae]=null,ae=0;ae<V.length;ae++){var ee=V[ae];ee!==null&&(ee.lane&=-536870913)}a&=~xe}l!==0&&wh(e,l,0),u!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=u&~(g&~t))}function wh(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Ne(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|a&261930}function Sh(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-Ne(a),c=1<<l;c&t|e[l]&t&&(e[l]|=t),a&=~c}}function kh(e,t){var a=t&-t;return a=(a&42)!==0?1:lu(a),(a&(e.suspendedLanes|t))!==0?0:a}function lu(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function iu(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function jh(){var e=Se.p;return e!==0?e:(e=window.event,e===void 0?32:Dy(e.type))}function Nh(e,t){var a=Se.p;try{return Se.p=e,t()}finally{Se.p=a}}var ja=Math.random().toString(36).slice(2),Zt="__reactFiber$"+ja,mn="__reactProps$"+ja,jl="__reactContainer$"+ja,Ch="__reactEvents$"+ja,yw="__reactListeners$"+ja,bw="__reactHandles$"+ja,Eh="__reactResources$"+ja,Ai="__reactMarker$"+ja,Ir="__reactLoad$"+ja;function Vr(e){delete e[Zt],delete e[mn],delete e[yw],delete e[bw]}function Ls(e){var t;if(t=e[Zt])return t;for(var a=e.parentNode;a;){if(t=a[jl]||a[Zt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=dy(e);e!==null;){if(a=e[Zt])return a;e=dy(e)}return t}e=a,a=e.parentNode}return null}function Nl(e){if(e=e[Zt]||e[jl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ti(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Cl(e){var t=e[Eh];return t||(t=e[Eh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function It(e){e[Ai]=!0}function Ah(e){e[Ir]=void 0}var Th=new Set,_h={};function Os(e,t){El(e,t),El(e+"Capture",t)}function El(e,t){for(_h[e]=t,e=0;e<t.length;e++)Th.add(t[e])}var vw=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Dh={},Mh={};function ww(e){return Va.call(Mh,e)?!0:Va.call(Dh,e)?!1:vw.test(e)?Mh[e]=!0:(Dh[e]=!0,!1)}var ot=!1;function Rh(){var e=ot;return ot=!1,e}function Kr(e,t,a){if(ww(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,a)}}function Yr(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,a)}}function Na(e,t,a,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,l)}}function jn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Sw(e,t,a){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var c=l.get,u=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(g){a=""+g,u.call(this,g)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(g){a=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ru(e){if(!e._valueTracker){var t=zh(e)?"checked":"value";e._valueTracker=Sw(e,t,""+e[t])}}function Lh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=zh(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}var kw=/[\n"\\]/g;function zn(e){return e.replace(kw,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ou(e,t,a,l,c,u,g,w){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),t!=null?g==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+jn(t)):e.value!==""+jn(t)&&(e.value=""+jn(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?g==="number"&&e.value==t?cu(e,jn(e.value)):cu(e,jn(t)):a!=null?cu(e,jn(a)):l!=null&&e.removeAttribute("value"),c==null&&u!=null&&(e.defaultChecked=!!u),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+jn(w):e.removeAttribute("name")}function Oh(e,t,a,l,c,u,g,w){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||a!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){ru(e);return}a=a!=null?""+jn(a):"",t=t!=null?""+jn(t):a,w||t===e.value||(e.value=t),e.defaultValue=t}l=l??c,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=w?e.checked:!!l,e.defaultChecked=!!l,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),ru(e)}function cu(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function Al(e,t,a,l){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&l&&(e[a].defaultSelected=!0)}else{for(a=""+jn(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,l&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Bh(e,t,a){if(t!=null&&(t=""+jn(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+jn(a):""}function Uh(e,t,a,l){if(t==null){if(l!=null){if(a!=null)throw Error(o(92));if(ve(l)){if(1<l.length)throw Error(o(93));l=l[0]}a=l}a==null&&(a=""),t=a}a=jn(t),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l),ru(e)}function Tl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var jw=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Hh(e,t,a){var l=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,a):typeof a!="number"||a===0||jw.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Ph(e,t,a){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="",ot=!0);for(var c in t)l=t[c],t.hasOwnProperty(c)&&a[c]!==l&&(Hh(e,c,l),ot=!0)}else for(var u in t)t.hasOwnProperty(u)&&Hh(e,u,t[u])}function uu(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Nw=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Cw=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Qr(e){return Cw.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ia(){}var du=null;function fu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _l=null,Dl=null;function qh(e){var t=Nl(e);if(t&&(e=t.stateNode)){var a=e[mn]||null;e:switch(e=t.stateNode,t.type){case"input":if(ou(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+zn(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var l=a[t];if(l!==e&&l.form===e.form){var c=l[mn]||null;if(!c)throw Error(o(90));ou(l,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)l=a[t],l.form===e.form&&Lh(l)}break e;case"textarea":Bh(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Al(e,!!a.multiple,t,!1)}}}var mu=!1;function Fh(e,t,a){if(mu)return e(t,a);mu=!0;try{var l=e(t);return l}finally{if(mu=!1,(_l!==null||Dl!==null)&&(Xo(),_l&&(t=_l,e=Dl,Dl=_l=null,qh(t),e)))for(t=0;t<e.length;t++)qh(e[t])}}function _i(e,t){var a=e.stateNode;if(a===null)return null;var l=a[mn]||null;if(l===null)return null;a=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(o(231,t,typeof a));return a}var Ca=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hu=!1;if(Ca)try{var Di={};Object.defineProperty(Di,"passive",{get:function(){hu=!0}}),window.addEventListener("test",Di,Di),window.removeEventListener("test",Di,Di)}catch{hu=!1}var Za=null,pu=null,Xr=null;function Gh(){if(Xr)return Xr;var e,t=pu,a=t.length,l,c="value"in Za?Za.value:Za.textContent,u=c.length;for(e=0;e<a&&t[e]===c[e];e++);var g=a-e;for(l=1;l<=g&&t[a-l]===c[u-l];l++);return Xr=c.slice(e,1<l?1-l:void 0)}function Zr(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function $r(){return!0}function Ih(){return!1}function cn(e){function t(a,l,c,u,g){this._reactName=a,this._targetInst=c,this.type=l,this.nativeEvent=u,this.target=g,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(a=e[w],this[w]=a?a(u):u[w]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?$r:Ih,this.isPropagationStopped=Ih,this}return M(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=$r)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=$r)},persist:function(){},isPersistent:$r}),t}var $a={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jr=cn($a),Mi=M({},$a,{view:0,detail:0}),Ew=cn(Mi),gu,xu,Ri,Wr=M({},Mi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ri&&(Ri&&e.type==="mousemove"?(gu=e.screenX-Ri.screenX,xu=e.screenY-Ri.screenY):xu=gu=0,Ri=e),gu)},movementY:function(e){return"movementY"in e?e.movementY:xu}}),Vh=cn(Wr),Aw=M({},Wr,{dataTransfer:0}),Tw=cn(Aw),_w=M({},Mi,{relatedTarget:0}),yu=cn(_w),Dw=M({},$a,{animationName:0,elapsedTime:0,pseudoElement:0}),Mw=cn(Dw),Rw=M({},$a,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),zw=cn(Rw),Lw=M({},$a,{data:0}),Kh=cn(Lw),Ow={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bw={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Uw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Uw[e])?!!t[e]:!1}function bu(){return Hw}var Pw=M({},Mi,{key:function(e){if(e.key){var t=Ow[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Zr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Bw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bu,charCode:function(e){return e.type==="keypress"?Zr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Zr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qw=cn(Pw),Fw=M({},Wr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yh=cn(Fw),Gw=M({},$a,{submitter:0}),Iw=cn(Gw),Vw=M({},Mi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bu}),Kw=cn(Vw),Yw=M({},$a,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qw=cn(Yw),Xw=M({},Wr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Zw=cn(Xw),$w=M({},$a,{newState:0,oldState:0,source:0}),Jw=cn($w),Ww=[9,13,27,32],vu=Ca&&"CompositionEvent"in window,zi=null;Ca&&"documentMode"in document&&(zi=document.documentMode);var eS=Ca&&"TextEvent"in window&&!zi,Qh=Ca&&(!vu||zi&&8<zi&&11>=zi),Xh=" ",Zh=!1;function $h(e,t){switch(e){case"keyup":return Ww.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ml=!1;function tS(e,t){switch(e){case"compositionend":return Jh(t);case"keypress":return t.which!==32?null:(Zh=!0,Xh);case"textInput":return e=t.data,e===Xh&&Zh?null:e;default:return null}}function nS(e,t){if(Ml)return e==="compositionend"||!vu&&$h(e,t)?(e=Gh(),Xr=pu=Za=null,Ml=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Qh&&t.locale!=="ko"?null:t.data;default:return null}}var aS={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Wh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!aS[e.type]:t==="textarea"}function ep(e,t,a,l){_l?Dl?Dl.push(l):Dl=[l]:_l=l,t=tc(t,"onChange"),0<t.length&&(a=new Jr("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var Li=null,Oi=null;function sS(e){qx(e,0)}function eo(e){var t=Ti(e);if(Lh(t))return e}function tp(e,t){if(e==="change")return t}var np=!1;if(Ca){var wu;if(Ca){var Su="oninput"in document;if(!Su){var ap=document.createElement("div");ap.setAttribute("oninput","return;"),Su=typeof ap.oninput=="function"}wu=Su}else wu=!1;np=wu&&(!document.documentMode||9<document.documentMode)}function sp(){Li&&(Li.detachEvent("onpropertychange",lp),Oi=Li=null)}function lp(e){if(e.propertyName==="value"&&eo(Oi)){var t=[];ep(t,Oi,e,fu(e)),Fh(sS,t)}}function lS(e,t,a){e==="focusin"?(sp(),Li=t,Oi=a,Li.attachEvent("onpropertychange",lp)):e==="focusout"&&sp()}function iS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return eo(Oi)}function rS(e,t){if(e==="click")return eo(t)}function oS(e,t){if(e==="input"||e==="change")return eo(t)}function cS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nn=typeof Object.is=="function"?Object.is:cS;function Bi(e,t){if(Nn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var c=a[l];if(!Va.call(t,c)||!Nn(e[c],t[c]))return!1}return!0}function ku(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ip(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function rp(e,t){var a=ip(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=ip(a)}}function op(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?op(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ku(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=ku(e.document)}return t}function ju(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var uS=Ca&&"documentMode"in document&&11>=document.documentMode,Rl=null,Nu=null,Ui=null,Cu=!1;function up(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Cu||Rl==null||Rl!==ku(l)||(l=Rl,"selectionStart"in l&&ju(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ui&&Bi(Ui,l)||(Ui=l,l=tc(Nu,"onSelect"),0<l.length&&(t=new Jr("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=Rl)))}function Bs(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var zl={animationend:Bs("Animation","AnimationEnd"),animationiteration:Bs("Animation","AnimationIteration"),animationstart:Bs("Animation","AnimationStart"),transitionrun:Bs("Transition","TransitionRun"),transitionstart:Bs("Transition","TransitionStart"),transitioncancel:Bs("Transition","TransitionCancel"),transitionend:Bs("Transition","TransitionEnd")},Eu={},dp={};Ca&&(dp=document.createElement("div").style,"AnimationEvent"in window||(delete zl.animationend.animation,delete zl.animationiteration.animation,delete zl.animationstart.animation),"TransitionEvent"in window||delete zl.transitionend.transition);function Us(e){if(Eu[e])return Eu[e];if(!zl[e])return e;var t=zl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in dp)return Eu[e]=t[a];return e}var fp=Us("animationend"),mp=Us("animationiteration"),hp=Us("animationstart"),dS=Us("transitionrun"),fS=Us("transitionstart"),mS=Us("transitioncancel"),pp=Us("transitionend"),gp=new Map,Au="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Au.push("scrollEnd");function Zn(e,t){gp.set(e,t),Os(t,[e])}var hS=0;function Ea(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=ea.identifierPrefix;var a=hS++;return e="_"+e+"t_"+a.toString(32)+"_",t.autoName=e}function xp(e){if(e==null||typeof e=="string")return e;var t=null,a=ei;if(a!==null)for(var l=0;l<a.length;l++){var c=e[a[l]];if(c!=null){if(c==="none")return"none";t=t==null?c:t+(" "+c)}}return t??e.default}function Aa(e,t){return e=xp(e),t=xp(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var to=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ln=[],Ll=0,Tu=0;function no(){for(var e=Ll,t=Tu=Ll=0;t<e;){var a=Ln[t];Ln[t++]=null;var l=Ln[t];Ln[t++]=null;var c=Ln[t];Ln[t++]=null;var u=Ln[t];if(Ln[t++]=null,l!==null&&c!==null){var g=l.pending;g===null?c.next=c:(c.next=g.next,g.next=c),l.pending=c}u!==0&&yp(a,c,u)}}function ao(e,t,a,l){Ln[Ll++]=e,Ln[Ll++]=t,Ln[Ll++]=a,Ln[Ll++]=l,Tu|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function _u(e,t,a,l){return ao(e,t,a,l),so(e)}function Hs(e,t){return ao(e,null,null,t),so(e)}function yp(e,t,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var c=!1,u=e.return;u!==null;)u.childLanes|=a,l=u.alternate,l!==null&&(l.childLanes|=a),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(c=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,c&&t!==null&&(c=31-Ne(a),e=u.hiddenUpdates,l=e[c],l===null?e[c]=[t]:l.push(t),t.lane=a|536870912),u):null}function so(e){if(50<ir)throw ir=0,Qo=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ol={};function pS(e,t,a,l){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hn(e,t,a,l){return new pS(e,t,a,l)}function Du(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ta(e,t){var a=e.alternate;return a===null?(a=hn(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&1206910976,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function bp(e,t){e.flags&=1206910978;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function lo(e,t,a,l,c,u){var g=0;if(l=e,typeof l=="function")Du(l)&&(g=1);else if(typeof l=="string")g=G2(e,a,Re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(l){case ce:return e=hn(31,a,t,c),e.elementType=ce,e.lanes=u,e;case J:return Ps(a.children,c,u,t);case Z:g=8,c|=24;break;case se:return e=hn(12,a,t,c|2),e.elementType=se,e.lanes=u,e;case le:return e=hn(13,a,t,c),e.elementType=le,e.lanes=u,e;case pe:return e=hn(19,a,t,c),e.elementType=pe,e.lanes=u,e;case ie:case C:return e=c|32,e=hn(30,a,t,e),e.elementType=C,e.lanes=u,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case z:g=10;break e;case E:g=9;break e;case F:g=11;break e;case he:g=14;break e;case I:g=16,l=null;break e}g=29,a=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=hn(g,a,t,c),t.elementType=e,t.type=l,t.lanes=u,t}function Ps(e,t,a,l){return e=hn(7,e,l,t),e.lanes=a,e}function Mu(e,t,a){return e=hn(6,e,null,t),e.lanes=a,e}function vp(e){var t=hn(18,null,null,0);return t.stateNode=e,t}function Ru(e,t,a){return t=hn(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var wp=new WeakMap;function On(e,t){if(typeof e=="object"&&e!==null){var a=wp.get(e);return a!==void 0?a:(t={value:e,source:t,stack:wl(t)},wp.set(e,t),t)}return{value:e,source:t,stack:wl(t)}}var Bl=[],Ul=0,io=null,Hi=0,Bn=[],Un=0,Ja=null,ra=1,oa="";function _a(e,t){Bl[Ul++]=Hi,Bl[Ul++]=io,io=e,Hi=t}function Sp(e,t,a){Bn[Un++]=ra,Bn[Un++]=oa,Bn[Un++]=Ja,Ja=e;var l=ra;e=oa;var c=32-Ne(l)-1;l&=~(1<<c),a+=1;var u=32-Ne(t)+c;if(30<u){var g=c-c%5;u=(l&(1<<g)-1).toString(32),l>>=g,c-=g,ra=1<<32-Ne(t)+c|a<<c|l,oa=u+e}else ra=1<<u|a<<c|l,oa=e}function ro(e){e.return!==null&&(_a(e,1),Sp(e,1,0))}function zu(e){for(;e===io;)io=Bl[--Ul],Bl[Ul]=null,Hi=Bl[--Ul],Bl[Ul]=null;for(;e===Ja;)Ja=Bn[--Un],Bn[Un]=null,oa=Bn[--Un],Bn[Un]=null,ra=Bn[--Un],Bn[Un]=null}function kp(e,t){Bn[Un++]=ra,Bn[Un++]=oa,Bn[Un++]=Ja,ra=t.id,oa=t.overflow,Ja=e}var Vt=null,wt=null,$e=!1,Wa=null,Hn=!1,Lu=Error(o(519));function es(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Pi(On(t,e)),Lu}function jp(e){var t=e.stateNode,a=e.type,l=e.memoizedProps;switch(t[Zt]=e,t[mn]=l,a){case"dialog":tt("cancel",t),tt("close",t);break;case"iframe":case"object":case"embed":tt("load",t);break;case"video":case"audio":for(a=0;a<or.length;a++)tt(or[a],t);break;case"source":tt("error",t);break;case"img":case"image":case"link":tt("error",t),tt("load",t);break;case"details":tt("toggle",t);break;case"input":tt("invalid",t),Oh(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":tt("invalid",t);break;case"textarea":tt("invalid",t),Uh(t,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||l.suppressHydrationWarning===!0||Vx(t.textContent,a)?(l.popover!=null&&(tt("beforetoggle",t),tt("toggle",t)),l.onScroll!=null&&tt("scroll",t),l.onScrollEnd!=null&&tt("scrollend",t),l.onClick!=null&&(t.onclick=ia),t=!0):t=!1,t||es(e,!0)}function oo(e){for(Vt=e.return;Vt;)switch(Vt.tag){case 5:case 31:case 13:Hn=!1;return;case 27:case 3:Hn=!0;return;default:Vt=Vt.return}}function Hl(e){if(e!==Vt)return!1;if(!$e)return oo(e),$e=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||ff(e.type,e.memoizedProps)),a=!a),a&&wt&&es(e),oo(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));wt=uy(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));wt=uy(e)}else t===27?(t=wt,gs(e.type)?(e=wf,wf=null,wt=e):wt=t):wt=Vt?qn(e.stateNode.nextSibling):null;return!0}function qs(){wt=Vt=null,$e=!1}function Ou(){var e=Wa;return e!==null&&(xn===null?xn=e:xn.push.apply(xn,e),Wa=null),e}function Pi(e){Wa===null?Wa=[e]:Wa.push(e)}var Bu=Ie(null),Fs=null,Da=null;function ts(e,t,a){ue(Bu,t._currentValue),t._currentValue=a}function Ma(e){e._currentValue=Bu.current,Fe(Bu)}function co(e,t,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===a)break;e=e.return}}function Uu(e,t,a,l){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var u=c.dependencies;if(u!==null){var g=c.child;u=u.firstContext;e:for(;u!==null;){var w=u;u=c;for(var D=0;D<t.length;D++)if(w.context===t[D]){u.lanes|=a,w=u.alternate,w!==null&&(w.lanes|=a),co(u.return,a,e),l||(g=null);break e}u=w.next}}else if(c.tag===18){if(g=c.return,g===null)throw Error(o(341));g.lanes|=a,u=g.alternate,u!==null&&(u.lanes|=a),co(g,a,e),g=null}else c.tag===13&&c.memoizedState!==null&&c.memoizedState.dehydrated===null?(c.lanes|=a,g=c.alternate,g!==null&&(g.lanes|=a),co(c.return,a,e),g=c.child,g=g!==null?g.sibling:null):g=c.child;if(g!==null)g.return=c;else for(g=c;g!==null;){if(g===e){g=null;break}if(c=g.sibling,c!==null){c.return=g.return,g=c;break}g=g.return}c=g}}function Gs(e,t,a,l){e=null;for(var c=t,u=!1;c!==null;){if(!u){if((c.flags&524288)!==0)u=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var g=c.alternate;if(g===null)throw Error(o(387));if(g=g.memoizedProps,g!==null){var w=c.type;Nn(c.pendingProps.value,g.value)||(e!==null?e.push(w):e=[w])}}else if(c===yt.current){if(g=c.alternate,g===null)throw Error(o(387));g.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(ui):e=[ui])}c=c.return}return e!==null&&Uu(t,e,a,l),t.flags|=262144,e!==null}function uo(e){for(e=e.firstContext;e!==null;){if(!Nn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Is(e){Fs=e,Da=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $t(e){return Np(Fs,e)}function fo(e,t){return Fs===null&&Is(e),Np(e,t)}function Np(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Da===null){if(e===null)throw Error(o(308));Da=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Da=Da.next=t;return a}var gS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},xS=n.unstable_scheduleCallback,yS=n.unstable_NormalPriority,Mt={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hu(){return{controller:new gS,data:new Map,refCount:0}}function qi(e){e.refCount--,e.refCount===0&&xS(yS,function(){e.controller.abort()})}function Cp(e,t){if((e.pendingLanes&4194048)!==0){var a=e.transitionTypes;for(a===null&&(a=e.transitionTypes=[]),e=0;e<t.length;e++){var l=t[e];a.indexOf(l)===-1&&a.push(l)}}}var Fi=null;function bS(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Gi=null,Pu=0,Vs=0,Pl=null;function vS(e,t){if(Gi===null){var a=Gi=[];Pu=0,Vs=nf(),Pl={status:"pending",value:void 0,then:function(l){a.push(l)}}}return Pu++,t.then(Ep,Ep),t}function Ep(){if(--Pu===0&&(Fi=null,Gi!==null)){Pl!==null&&(Pl.status="fulfilled");var e=Gi;Gi=null,Vs=0,Pl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function wS(e,t){var a=[],l={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(l.status="rejected",l.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),l}var Ap=be.S;be.S=function(e,t){if(vx=Ht(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&vS(e,t),Fi!==null)for(var a=si;a!==null;)Cp(a,Fi),a=a.next;if(a=e.types,a!==null){for(var l=si;l!==null;)Cp(l,a),l=l.next;if(Vs!==0){l=Fi,l===null&&(l=Fi=[]);for(var c=0;c<a.length;c++){var u=a[c];l.indexOf(u)===-1&&l.push(u)}}}Ap!==null&&Ap(e,t)};var Ks=Ie(null);function qu(){var e=Ks.current;return e!==null?e:vt.pooledCache}function mo(e,t){t===null?ue(Ks,Ks.current):ue(Ks,t.pool)}function Tp(){var e=qu();return e===null?null:{parent:Mt._currentValue,pool:e}}var ql=Error(o(460)),Fu=Error(o(474)),ho=Error(o(542)),po={then:function(){}};function _p(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Dp(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(ia,ia),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rp(e),e===void 0&&!("reason"in t)?Error(o(600)):e;default:if(typeof t.status=="string")t.then(ia,ia);else{if(e=vt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=l}},function(l){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rp(e),e}throw Qs=t,ql}}function Ys(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Qs=a,ql):a}}var Qs=null;function Mp(){if(Qs===null)throw Error(o(459));var e=Qs;return Qs=null,e}function Rp(e){if(e===ql||e===ho)throw Error(o(483))}var Fl=null,Ii=0;function go(e){var t=Ii;return Ii+=1,Fl===null&&(Fl=[]),Dp(Fl,e,t)}function ns(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function xo(e,t){throw t.$$typeof===T?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function zp(e){function t(Q,H){if(e){var W=Q.deletions;W===null?(Q.deletions=[H],Q.flags|=16):W.push(H)}}function a(Q,H){if(!e)return null;for(;H!==null;)t(Q,H),H=H.sibling;return null}function l(Q){for(var H=new Map;Q!==null;)Q.key===null?H.set(Q.index,Q):H.set(Q.key,Q),Q=Q.sibling;return H}function c(Q,H){return Q=Ta(Q,H),Q.index=0,Q.sibling=null,Q}function u(Q,H,W){return Q.index=W,e?(W=Q.alternate,W!==null?(W=W.index,W<H?(Q.flags|=2,H):W):(Q.flags|=134217730,H)):(Q.flags|=1048576,H)}function g(Q){return e&&Q.alternate===null&&(Q.flags|=134217730),Q}function w(Q,H,W,ge){return H===null||H.tag!==6?(H=Mu(W,Q.mode,ge),H.return=Q,H):(H=c(H,W),H.return=Q,H)}function D(Q,H,W,ge){var Ee=W.type;return Ee===J?(Q=ae(Q,H,W.props.children,ge,W.key),ns(Q,W),Q):H!==null&&(H.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===I&&Ys(Ee)===H.type)?(H=c(H,W.props),ns(H,W),H.return=Q,H):(H=lo(W.type,W.key,W.props,null,Q.mode,ge),ns(H,W),H.return=Q,H)}function X(Q,H,W,ge){return H===null||H.tag!==4||H.stateNode.containerInfo!==W.containerInfo||H.stateNode.implementation!==W.implementation?(H=Ru(W,Q.mode,ge),H.return=Q,H):(H=c(H,W.children||[]),H.return=Q,H)}function ae(Q,H,W,ge,Ee){return H===null||H.tag!==7?(H=Ps(W,Q.mode,ge,Ee),H.return=Q,H):(H=c(H,W),H.return=Q,H)}function xe(Q,H,W){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=Mu(""+H,Q.mode,W),H.return=Q,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case P:return W=lo(H.type,H.key,H.props,null,Q.mode,W),ns(W,H),W.return=Q,W;case O:return H=Ru(H,Q.mode,W),H.return=Q,H;case I:return H=Ys(H),xe(Q,H,W)}if(ve(H)||me(H))return H=Ps(H,Q.mode,W,null),H.return=Q,H;if(typeof H.then=="function")return xe(Q,go(H),W);if(H.$$typeof===z)return xe(Q,fo(Q,H),W);xo(Q,H)}return null}function V(Q,H,W,ge){var Ee=H!==null?H.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return Ee!==null?null:w(Q,H,""+W,ge);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case P:return W.key===Ee?D(Q,H,W,ge):null;case O:return W.key===Ee?X(Q,H,W,ge):null;case I:return W=Ys(W),V(Q,H,W,ge)}if(ve(W)||me(W))return Ee!==null?null:ae(Q,H,W,ge,null);if(typeof W.then=="function")return V(Q,H,go(W),ge);if(W.$$typeof===z)return V(Q,H,fo(Q,W),ge);xo(Q,W)}return null}function ee(Q,H,W,ge,Ee){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return Q=Q.get(W)||null,w(H,Q,""+ge,Ee);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case P:return Q=Q.get(ge.key===null?W:ge.key)||null,D(H,Q,ge,Ee);case O:return Q=Q.get(ge.key===null?W:ge.key)||null,X(H,Q,ge,Ee);case I:return ge=Ys(ge),ee(Q,H,W,ge,Ee)}if(ve(ge)||me(ge))return Q=Q.get(W)||null,ae(H,Q,ge,Ee,null);if(typeof ge.then=="function")return ee(Q,H,W,go(ge),Ee);if(ge.$$typeof===z)return ee(Q,H,W,fo(H,ge),Ee);xo(H,ge)}return null}function ke(Q,H,W,ge){for(var Ee=null,at=null,ze=H,qe=H=0,Lt=null;ze!==null&&qe<W.length;qe++){ze.index>qe?(Lt=ze,ze=null):Lt=ze.sibling;var rt=V(Q,ze,W[qe],ge);if(rt===null){ze===null&&(ze=Lt);break}e&&ze&&rt.alternate===null&&t(Q,ze),H=u(rt,H,qe),at===null?Ee=rt:at.sibling=rt,at=rt,ze=Lt}if(qe===W.length)return a(Q,ze),$e&&_a(Q,qe),Ee;if(ze===null){for(;qe<W.length;qe++)ze=xe(Q,W[qe],ge),ze!==null&&(H=u(ze,H,qe),at===null?Ee=ze:at.sibling=ze,at=ze);return $e&&_a(Q,qe),Ee}for(ze=l(ze);qe<W.length;qe++)Lt=ee(ze,Q,qe,W[qe],ge),Lt!==null&&(e&&(rt=Lt.alternate,rt!==null&&ze.delete(rt.key===null?qe:rt.key)),H=u(Lt,H,qe),at===null?Ee=Lt:at.sibling=Lt,at=Lt);return e&&ze.forEach(function(ws){return t(Q,ws)}),$e&&_a(Q,qe),Ee}function De(Q,H,W,ge){if(W==null)throw Error(o(151));for(var Ee=null,at=null,ze=H,qe=H=0,Lt=null,rt=W.next();ze!==null&&!rt.done;qe++,rt=W.next()){ze.index>qe?(Lt=ze,ze=null):Lt=ze.sibling;var ws=V(Q,ze,rt.value,ge);if(ws===null){ze===null&&(ze=Lt);break}e&&ze&&ws.alternate===null&&t(Q,ze),H=u(ws,H,qe),at===null?Ee=ws:at.sibling=ws,at=ws,ze=Lt}if(rt.done)return a(Q,ze),$e&&_a(Q,qe),Ee;if(ze===null){for(;!rt.done;qe++,rt=W.next())rt=xe(Q,rt.value,ge),rt!==null&&(H=u(rt,H,qe),at===null?Ee=rt:at.sibling=rt,at=rt);return $e&&_a(Q,qe),Ee}for(ze=l(ze);!rt.done;qe++,rt=W.next())rt=ee(ze,Q,qe,rt.value,ge),rt!==null&&(e&&(Lt=rt.alternate,Lt!==null&&ze.delete(Lt.key===null?qe:Lt.key)),H=u(rt,H,qe),at===null?Ee=rt:at.sibling=rt,at=rt);return e&&ze.forEach(function(tk){return t(Q,tk)}),$e&&_a(Q,qe),Ee}function Xe(Q,H,W,ge){if(typeof W=="object"&&W!==null&&W.type===J&&W.key===null&&W.props.ref===void 0&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case P:e:{for(var Ee=W.key;H!==null;){if(H.key===Ee){if(Ee=W.type,Ee===J){if(H.tag===7){a(Q,H.sibling),ge=c(H,W.props.children),ns(ge,W),ge.return=Q,Q=ge;break e}}else if(H.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===I&&Ys(Ee)===H.type){a(Q,H.sibling),ge=c(H,W.props),ns(ge,W),ge.return=Q,Q=ge;break e}a(Q,H);break}else t(Q,H);H=H.sibling}W.type===J?(ge=Ps(W.props.children,Q.mode,ge,W.key),ns(ge,W),ge.return=Q,Q=ge):(ge=lo(W.type,W.key,W.props,null,Q.mode,ge),ns(ge,W),ge.return=Q,Q=ge)}return g(Q);case O:e:{for(Ee=W.key;H!==null;){if(H.key===Ee)if(H.tag===4&&H.stateNode.containerInfo===W.containerInfo&&H.stateNode.implementation===W.implementation){a(Q,H.sibling),ge=c(H,W.children||[]),ge.return=Q,Q=ge;break e}else{a(Q,H);break}else t(Q,H);H=H.sibling}ge=Ru(W,Q.mode,ge),ge.return=Q,Q=ge}return g(Q);case I:return W=Ys(W),Xe(Q,H,W,ge)}if(ve(W))return ke(Q,H,W,ge);if(me(W)){if(Ee=me(W),typeof Ee!="function")throw Error(o(150));return W=Ee.call(W),De(Q,H,W,ge)}if(typeof W.then=="function")return Xe(Q,H,go(W),ge);if(W.$$typeof===z)return Xe(Q,H,fo(Q,W),ge);xo(Q,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,H!==null&&H.tag===6?(a(Q,H.sibling),ge=c(H,W),ge.return=Q,Q=ge):(a(Q,H),ge=Mu(W,Q.mode,ge),ge.return=Q,Q=ge),g(Q)):a(Q,H)}return function(Q,H,W,ge){try{Ii=0;var Ee=Xe(Q,H,W,ge);return Fl=null,Ee}catch(ze){if(ze===ql||ze===ho)throw ze;var at=hn(29,ze,null,Q.mode);return at.lanes=ge,at.return=Q,at}finally{}}}var Xs=zp(!0),Lp=zp(!1),as=!1;function Gu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Iu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ss(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ls(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(ct&2)!==0){var c=l.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),l.pending=t,t=so(e),yp(e,null,a),t}return ao(e,l,t,a),so(e)}function Vi(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Sh(e,a)}}function Vu(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var c=null,u=null;if(a=a.firstBaseUpdate,a!==null){do{var g={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};u===null?c=u=g:u=u.next=g,a=a.next}while(a!==null);u===null?c=u=t:u=u.next=t}else c=u=t;a={baseState:l.baseState,firstBaseUpdate:c,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Ku=!1;function Ki(){if(Ku){var e=Pl;if(e!==null)throw e}}function Yi(e,t,a,l){Ku=!1;var c=e.updateQueue;as=!1;var u=c.firstBaseUpdate,g=c.lastBaseUpdate,w=c.shared.pending;if(w!==null){c.shared.pending=null;var D=w,X=D.next;D.next=null,g===null?u=X:g.next=X,g=D;var ae=e.alternate;ae!==null&&(ae=ae.updateQueue,w=ae.lastBaseUpdate,w!==g&&(w===null?ae.firstBaseUpdate=X:w.next=X,ae.lastBaseUpdate=D))}if(u!==null){var xe=c.baseState;g=0,ae=X=D=null,w=u;do{var V=w.lane&-536870913,ee=V!==w.lane;if(ee?(nt&V)===V:(l&V)===V){V!==0&&V===Vs&&(Ku=!0),ae!==null&&(ae=ae.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var ke=e,De=w;V=t;var Xe=a;switch(De.tag){case 1:if(ke=De.payload,typeof ke=="function"){xe=ke.call(Xe,xe,V);break e}xe=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=De.payload,V=typeof ke=="function"?ke.call(Xe,xe,V):ke,V==null)break e;xe=M({},xe,V);break e;case 2:as=!0}}V=w.callback,V!==null&&(e.flags|=64,ee&&(e.flags|=8192),ee=c.callbacks,ee===null?c.callbacks=[V]:ee.push(V))}else ee={lane:V,tag:w.tag,payload:w.payload,callback:w.callback,next:null},ae===null?(X=ae=ee,D=xe):ae=ae.next=ee,g|=V;if(w=w.next,w===null){if(w=c.shared.pending,w===null)break;ee=w,w=ee.next,ee.next=null,c.lastBaseUpdate=ee,c.shared.pending=null}}while(!0);ae===null&&(D=xe),c.baseState=D,c.firstBaseUpdate=X,c.lastBaseUpdate=ae,u===null&&(c.shared.lanes=0),fs|=g,e.lanes=g,e.memoizedState=xe}}function Op(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Bp(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Op(a[e],t)}var is=Ie(null),yo=Ie(0);function Up(e,t){e=Ba,ue(yo,e),ue(is,t),Ba=e|t.baseLanes}function Yu(){ue(yo,Ba),ue(is,is.current)}function Qu(){Ba=yo.current,Fe(is),Fe(yo)}var Jt=Ie(null),ln=null;function rs(e){var t=e.alternate;ue(Wt,Wt.current&1),ue(Jt,e),ln===null&&(t===null||is.current!==null||t.memoizedState!==null)&&(ln=e)}function Xu(e){ue(Wt,Wt.current),ue(Jt,e),ln===null&&(ln=e)}function Hp(e){e.tag===22?(ue(Wt,Wt.current),ue(Jt,e),ln===null&&(ln=e)):os()}function os(){ue(Wt,Wt.current),ue(Jt,Jt.current)}function Cn(e){Fe(Jt),ln===e&&(ln=null),Fe(Wt)}var Wt=Ie(0);function Qi(e,t){ue(Jt,Jt.current),ue(Wt,t)}function Zu(e){Fe(Wt),Fe(Jt),ln===e&&(ln=null)}function bo(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||bf(a)||vf(a)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ra=0,Qe=null,bt=null,Rt=null,vo=!1,Gl=!1,Zs=!1,wo=0,Xi=0,Il=null,SS=0;function At(){throw Error(o(321))}function $u(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Nn(e[a],t[a]))return!1;return!0}function Ju(e,t,a,l,c,u){return Ra=u,Qe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,be.H=e===null||e.memoizedState===null?Sg:kg,Zs=!1,u=a(l,c),Zs=!1,Gl&&(u=qp(t,a,l,c)),Pp(e),u}function Pp(e){be.H=Ao;var t=bt!==null&&bt.next!==null;if(Ra=0,Rt=bt=Qe=null,vo=!1,Xi=0,Il=null,t)throw Error(o(300));e===null||zt||(e=e.dependencies,e!==null&&uo(e)&&(zt=!0))}function qp(e,t,a,l){Qe=e;var c=0;do{if(Gl&&(Il=null),Xi=0,Gl=!1,25<=c)throw Error(o(301));if(c+=1,Rt=bt=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}be.H=_S,u=t(a,l)}while(Gl);return u}function kS(){var e=be.H,t=e.useState()[0];return t=typeof t.then=="function"?Zi(t):t,e=e.useState()[0],(bt!==null?bt.memoizedState:null)!==e&&(Qe.flags|=1024),t}function Wu(){var e=wo!==0;return wo=0,e}function ed(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function td(e){if(vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}vo=!1}Ra=0,Rt=bt=Qe=null,Gl=!1,Xi=wo=0,Il=null}function un(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?Qe.memoizedState=Rt=e:Rt=Rt.next=e,Rt}function _t(){if(bt===null){var e=Qe.alternate;e=e!==null?e.memoizedState:null}else e=bt.next;var t=Rt===null?Qe.memoizedState:Rt.next;if(t!==null)Rt=t,bt=e;else{if(e===null)throw Qe.alternate===null?Error(o(467)):Error(o(310));bt=e,e={memoizedState:bt.memoizedState,baseState:bt.baseState,baseQueue:bt.baseQueue,queue:bt.queue,next:null},Rt===null?Qe.memoizedState=Rt=e:Rt=Rt.next=e}return Rt}function So(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zi(e){var t=Xi;return Xi+=1,Il===null&&(Il=[]),e=Dp(Il,e,t),t=Qe,(Rt===null?t.memoizedState:Rt.next)===null&&(t=t.alternate,be.H=t===null||t.memoizedState===null?Sg:kg),e}function ko(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Zi(e);if(e.$$typeof===K)return;if(e.$$typeof===z)return $t(e)}throw Error(o(438,String(e)))}function nd(e){var t=null,a=Qe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var l=Qe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=So(),Qe.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),l=0;l<e;l++)a[l]=fe;return t.index++,a}function za(e,t){return typeof t=="function"?t(e):t}function jo(e){var t=_t();return ad(t,bt,e)}function ad(e,t,a){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=a;var c=e.baseQueue,u=l.pending;if(u!==null){if(c!==null){var g=c.next;c.next=u.next,u.next=g}t.baseQueue=c=u,l.pending=null}if(u=e.baseState,c===null)e.memoizedState=u;else{t=c.next;var w=g=null,D=null,X=t,ae=!1;do{var xe=X.lane&-536870913;if(xe!==X.lane?(nt&xe)===xe:(Ra&xe)===xe){var V=X.revertLane;if(V===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),xe===Vs&&(ae=!0);else if((Ra&V)===V){X=X.next,V===Vs&&(ae=!0);continue}else xe={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},D===null?(w=D=xe,g=u):D=D.next=xe,Qe.lanes|=V,fs|=V;xe=X.action,Zs&&a(u,xe),u=X.hasEagerState?X.eagerState:a(u,xe)}else V={lane:xe,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},D===null?(w=D=V,g=u):D=D.next=V,Qe.lanes|=xe,fs|=xe;X=X.next}while(X!==null&&X!==t);if(D===null?g=u:D.next=w,!Nn(u,e.memoizedState)&&(zt=!0,ae&&(a=Pl,a!==null)))throw a;e.memoizedState=u,e.baseState=g,e.baseQueue=D,l.lastRenderedState=u}return c===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function sd(e){var t=_t(),a=t.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=e;var l=a.dispatch,c=a.pending,u=t.memoizedState;if(c!==null){a.pending=null;var g=c=c.next;do u=e(u,g.action),g=g.next;while(g!==c);Nn(u,t.memoizedState)||(zt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),a.lastRenderedState=u}return[u,l]}function Fp(e,t,a){var l=Qe,c=_t(),u=$e;if(u){if(a===void 0)throw Error(o(407));a=a()}else a=t();var g=!Nn((bt||c).memoizedState,a);if(g&&(c.memoizedState=a,zt=!0),c=c.queue,rd(Vp.bind(null,l,c,e),[e]),e=c.getSnapshot!==t||g||Rt!==null&&(Rt.memoizedState.tag&1)!==0,Vl(e?9:8,{destroy:void 0},Ip.bind(null,l,c,a,t),null),e){if(l.flags|=2048,vt===null)throw Error(o(349));u||(Ra&127)!==0||Gp(l,t,a)}return a}function Gp(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Qe.updateQueue,t===null?(t=So(),Qe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Ip(e,t,a,l){t.value=a,t.getSnapshot=l,Kp(t)&&Yp(e)}function Vp(e,t,a){return a(function(){Kp(t)&&Yp(e)})}function Kp(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Nn(e,a)}catch{return!0}}function Yp(e){var t=Hs(e,2);t!==null&&yn(t,e,2)}function ld(e){var t=un();if(typeof e=="function"){var a=e;if(e=a(),Zs){q(!0);try{a()}finally{q(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:za,lastRenderedState:e},t}function Qp(e,t,a,l){return e.baseState=a,ad(e,bt,typeof l=="function"?l:za)}function jS(e,t,a,l,c){if(Eo(e))throw Error(o(485));if(e=t.action,e!==null){var u={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){u.listeners.push(g)}};be.T!==null?a(!0):u.isTransition=!1,l(u),a=t.pending,a===null?(u.next=t.pending=u,Xp(t,u)):(u.next=a.next,t.pending=a.next=u)}}function Xp(e,t){var a=t.action,l=t.payload,c=e.state;if(t.isTransition){var u=be.T,g={};g.types=u!==null?u.types:null,be.T=g;try{var w=a(c,l),D=be.S;D!==null&&D(g,w),Zp(e,t,w)}catch(X){id(e,t,X)}finally{u!==null&&g.types!==null&&(u.types=g.types),be.T=u}}else try{u=a(c,l),Zp(e,t,u)}catch(X){id(e,t,X)}}function Zp(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){$p(e,t,l)},function(l){return id(e,t,l)}):$p(e,t,a)}function $p(e,t,a){t.status="fulfilled",t.value=a,Jp(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Xp(e,a)))}function id(e,t,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=a,Jp(t),t=t.next;while(t!==l)}e.action=null}function Jp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Wp(e,t){return t}function eg(e,t){if($e){var a=vt.formState;if(a!==null){e:{var l=Qe;if($e){if(wt){t:{for(var c=wt,u=Hn;c.nodeType!==8;){if(!u){c=null;break t}if(c=qn(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){wt=qn(c.nextSibling),l=c.data==="F!";break e}}es(l)}l=!1}l&&(t=a[0])}}return a=un(),a.memoizedState=a.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wp,lastRenderedState:t},a.queue=l,a=bg.bind(null,Qe,l),l.dispatch=a,l=ld(!1),u=fd.bind(null,Qe,!1,l.queue),l=un(),c={state:t,dispatch:null,action:e,pending:null},l.queue=c,a=jS.bind(null,Qe,c,u,a),c.dispatch=a,l.memoizedState=e,[t,a,!1]}function tg(e){var t=_t();return ng(t,bt,e)}function ng(e,t,a){if(t=ad(e,t,Wp)[0],e=jo(za)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Zi(t)}catch(g){throw g===ql?ho:g}else l=t;t=_t();var c=t.queue,u=c.dispatch;return a!==t.memoizedState&&(Qe.flags|=2048,Vl(9,{destroy:void 0},NS.bind(null,c,a),null)),[l,u,e]}function NS(e,t){e.action=t}function ag(e){var t=_t(),a=bt;if(a!==null)return ng(t,a,e);_t(),t=t.memoizedState,a=_t();var l=a.queue.dispatch;return a.memoizedState=e,[t,l,!1]}function Vl(e,t,a,l){return e={tag:e,create:a,deps:l,inst:t,next:null},t=Qe.updateQueue,t===null&&(t=So(),Qe.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e),e}function sg(){return _t().memoizedState}function No(e,t,a,l){var c=un();Qe.flags|=e,c.memoizedState=Vl(1|t,{destroy:void 0},a,l===void 0?null:l)}function Co(e,t,a,l){var c=_t();l=l===void 0?null:l;var u=c.memoizedState.inst;bt!==null&&l!==null&&$u(l,bt.memoizedState.deps)?c.memoizedState=Vl(t,u,a,l):(Qe.flags|=e,c.memoizedState=Vl(1|t,u,a,l))}function lg(e,t){No(8390656,8,e,t)}function rd(e,t){Co(2048,8,e,t)}function CS(e){Qe.flags|=4;var t=Qe.updateQueue;if(t===null)t=So(),Qe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function ig(e){var t=_t().memoizedState;return CS({ref:t,nextImpl:e}),function(){if((ct&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function rg(e,t){return Co(4,2,e,t)}function og(e,t){return Co(4,4,e,t)}function cg(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ug(e,t,a){a=a!=null?a.concat([e]):null,Co(4,4,cg.bind(null,t,e),a)}function od(){}function dg(e,t){var a=_t();t=t===void 0?null:t;var l=a.memoizedState;return t!==null&&$u(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function fg(e,t){var a=_t();t=t===void 0?null:t;var l=a.memoizedState;if(t!==null&&$u(t,l[1]))return l[0];if(l=e(),Zs){q(!0);try{e()}finally{q(!1)}}return a.memoizedState=[l,t],l}function cd(e,t,a){return a===void 0||(Ra&1073741824)!==0&&(nt&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Sx(),Qe.lanes|=e,fs|=e,a)}function mg(e,t,a,l){return Nn(a,t)?a:is.current!==null?(e=cd(e,a,l),Nn(e,t)||(zt=!0),e):(Ra&106)===0||(Ra&1073741824)!==0&&(nt&261930)===0?(zt=!0,e.memoizedState=a):(e=Sx(),Qe.lanes|=e,fs|=e,t)}function hg(e,t,a,l,c){var u=Se.p;Se.p=u!==0&&8>u?u:8;var g=be.T,w={};w.types=g!==null?g.types:null,be.T=w,fd(e,!1,t,a);try{var D=c(),X=be.S;if(X!==null&&X(w,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var ae=wS(D,l);$i(e,t,ae,_n(e))}else $i(e,t,l,_n(e))}catch(xe){$i(e,t,{then:function(){},status:"rejected",reason:xe},_n())}finally{Se.p=u,g!==null&&w.types!==null&&(g.types=w.types),be.T=g}}function ES(){}function ud(e,t,a,l){if(e.tag!==5)throw Error(o(476));var c=pg(e).queue;hg(e,c,t,it,a===null?ES:function(){return gg(e),a(l)})}function pg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:it,baseState:it,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:za,lastRenderedState:it},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:za,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function gg(e){var t=pg(e);t.next===null&&(t=e.alternate.memoizedState),$i(e,t.next.queue,{},_n())}function dd(){return $t(ui)}function xg(){return _t().memoizedState}function yg(){return _t().memoizedState}function AS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=_n();e=ss(a);var l=ls(t,e,a);l!==null&&(yn(l,t,a),Vi(l,t,a)),t={cache:Hu()},e.payload=t;return}t=t.return}}function TS(e,t,a){var l=_n();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Eo(e)?vg(t,a):(a=_u(e,t,a,l),a!==null&&(yn(a,e,l),wg(a,t,l)))}function bg(e,t,a){var l=_n();$i(e,t,a,l)}function $i(e,t,a,l){var c={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Eo(e))vg(t,c);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var g=t.lastRenderedState,w=u(g,a);if(c.hasEagerState=!0,c.eagerState=w,Nn(w,g))return ao(e,t,c,0),vt===null&&no(),!1}catch{}finally{}if(a=_u(e,t,c,l),a!==null)return yn(a,e,l),wg(a,t,l),!0}return!1}function fd(e,t,a,l){if(l={lane:2,revertLane:nf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Eo(e)){if(t)throw Error(o(479))}else t=_u(e,a,l,2),t!==null&&yn(t,e,2)}function Eo(e){var t=e.alternate;return e===Qe||t!==null&&t===Qe}function vg(e,t){Gl=vo=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function wg(e,t,a){if((a&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Sh(e,a)}}var Ao={readContext:$t,use:ko,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At,useEffectEvent:At},Sg={readContext:$t,use:ko,useCallback:function(e,t){return un().memoizedState=[e,t===void 0?null:t],e},useContext:$t,useEffect:lg,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,No(4194308,4,cg.bind(null,t,e),a)},useLayoutEffect:function(e,t){return No(4194308,4,e,t)},useInsertionEffect:function(e,t){No(4,2,e,t)},useMemo:function(e,t){var a=un();t=t===void 0?null:t;var l=e();if(Zs){q(!0);try{e()}finally{q(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=un();if(a!==void 0){var c=a(t);if(Zs){q(!0);try{a(t)}finally{q(!1)}}}else c=t;return l.memoizedState=l.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},l.queue=e,e=e.dispatch=TS.bind(null,Qe,e),[l.memoizedState,e]},useRef:function(e){var t=un();return e={current:e},t.memoizedState=e},useState:function(e){e=ld(e);var t=e.queue,a=bg.bind(null,Qe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:od,useDeferredValue:function(e,t){var a=un();return cd(a,e,t)},useTransition:function(){var e=ld(!1);return e=hg.bind(null,Qe,e.queue,!0,!1),un().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=Qe,c=un();if($e){if(a===void 0)throw Error(o(407));a=a()}else{if(a=t(),vt===null)throw Error(o(349));(nt&127)!==0||Gp(l,t,a)}c.memoizedState=a;var u={value:a,getSnapshot:t};return c.queue=u,lg(Vp.bind(null,l,u,e),[e]),l.flags|=2048,Vl(9,{destroy:void 0},Ip.bind(null,l,u,a,t),null),a},useId:function(){var e=un(),t=vt.identifierPrefix;if($e){var a=oa,l=ra;a=(l&~(1<<32-Ne(l)-1)).toString(32)+a,t="_"+t+"R_"+a,a=wo++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=SS++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:dd,useFormState:eg,useActionState:eg,useOptimistic:function(e){var t=un();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=fd.bind(null,Qe,!0,a),a.dispatch=t,[e,t]},useMemoCache:nd,useCacheRefresh:function(){return un().memoizedState=AS.bind(null,Qe)},useEffectEvent:function(e){var t=un(),a={impl:e};return t.memoizedState=a,function(){if((ct&2)!==0)throw Error(o(440));return a.impl.apply(void 0,arguments)}}},kg={readContext:$t,use:ko,useCallback:dg,useContext:$t,useEffect:rd,useImperativeHandle:ug,useInsertionEffect:rg,useLayoutEffect:og,useMemo:fg,useReducer:jo,useRef:sg,useState:function(){return jo(za)},useDebugValue:od,useDeferredValue:function(e,t){var a=_t();return mg(a,bt.memoizedState,e,t)},useTransition:function(){var e=jo(za)[0],t=_t().memoizedState;return[typeof e=="boolean"?e:Zi(e),t]},useSyncExternalStore:Fp,useId:xg,useHostTransitionStatus:dd,useFormState:tg,useActionState:tg,useOptimistic:function(e,t){var a=_t();return Qp(a,bt,e,t)},useMemoCache:nd,useCacheRefresh:yg,useEffectEvent:ig},_S={readContext:$t,use:ko,useCallback:dg,useContext:$t,useEffect:rd,useImperativeHandle:ug,useInsertionEffect:rg,useLayoutEffect:og,useMemo:fg,useReducer:sd,useRef:sg,useState:function(){return sd(za)},useDebugValue:od,useDeferredValue:function(e,t){var a=_t();return bt===null?cd(a,e,t):mg(a,bt.memoizedState,e,t)},useTransition:function(){var e=sd(za)[0],t=_t().memoizedState;return[typeof e=="boolean"?e:Zi(e),t]},useSyncExternalStore:Fp,useId:xg,useHostTransitionStatus:dd,useFormState:ag,useActionState:ag,useOptimistic:function(e,t){var a=_t();return bt!==null?Qp(a,bt,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:nd,useCacheRefresh:yg,useEffectEvent:ig};function md(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:M({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var hd={enqueueSetState:function(e,t,a){e=e._reactInternals;var l=_n(),c=ss(l);c.payload=t,a!=null&&(c.callback=a),t=ls(e,c,l),t!==null&&(yn(t,e,l),Vi(t,e,l))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=_n(),c=ss(l);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=ls(e,c,l),t!==null&&(yn(t,e,l),Vi(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=_n(),l=ss(a);l.tag=2,t!=null&&(l.callback=t),t=ls(e,l,a),t!==null&&(yn(t,e,a),Vi(t,e,a))}};function jg(e,t,a,l,c,u,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,u,g):t.prototype&&t.prototype.isPureReactComponent?!Bi(a,l)||!Bi(c,u):!0}function Ng(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&hd.enqueueReplaceState(t,t.state,null)}function $s(e,t){var a=t;if("ref"in t){a={};for(var l in t)l!=="ref"&&(a[l]=t[l])}if(e=e.defaultProps){a===t&&(a=M({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function Cg(e){to(e)}function Eg(e){console.error(e)}function Ag(e){to(e)}function To(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Tg(e,t,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function pd(e,t,a){return a=ss(a),a.tag=3,a.payload={element:null},a.callback=function(){To(e,t)},a}function _g(e){return e=ss(e),e.tag=3,e}function Dg(e,t,a,l){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var u=l.value;e.payload=function(){return c(u)},e.callback=function(){Tg(t,a,l)}}var g=a.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){Tg(t,a,l),typeof c!="function"&&(ms===null?ms=new Set([this]):ms.add(this));var w=l.stack;this.componentDidCatch(l.value,{componentStack:w!==null?w:""})})}function DS(e,t,a,l,c){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=a.alternate,t!==null&&Gs(t,a,c,!0),a=Jt.current,a!==null){switch(a.tag){case 31:case 13:case 19:return ln===null?Zo():a.alternate===null&&Tt===0&&(Tt=3),a.flags&=-257,a.flags|=65536,a.lanes=c,l===po?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([l]):t.add(l),Wd(e,l,c)),!1;case 22:return a.flags|=65536,l===po?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([l]):a.add(l)),Wd(e,l,c)),!1}throw Error(o(435,a.tag))}return Wd(e,l,c),Zo(),!1}if($e)return t=Jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,l!==Lu&&(e=Error(o(422),{cause:l}),Pi(On(e,a)))):(l!==Lu&&(t=Error(o(423),{cause:l}),Pi(On(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,l=On(l,a),c=pd(e.stateNode,l,c),Vu(e,c),Tt!==4&&(Tt=2)),!1;var u=Error(o(520),{cause:l});if(u=On(u,a),lr===null?lr=[u]:lr.push(u),Tt!==4&&(Tt=2),t===null)return!0;l=On(l,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=pd(a.stateNode,l,e),Vu(a,e),!1;case 1:if(t=a.type,u=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(ms===null||!ms.has(u))))return a.flags|=65536,c&=-c,a.lanes|=c,c=_g(c),Dg(c,e,a,l),Vu(a,c),!1;break;case 22:if(a.memoizedState!==null)return a.flags|=65536,!1}a=a.return}while(a!==null);return!1}var gd=Error(o(461)),zt=!1;function Pt(e,t,a,l){t.child=e===null?Lp(t,null,a,l):Xs(t,e.child,a,l)}function Mg(e,t,a,l,c){a=a.render;var u=t.ref;if("ref"in l){var g={};for(var w in l)w!=="ref"&&(g[w]=l[w])}else g=l;return Is(t),l=Ju(e,t,a,g,u,c),w=Wu(),e!==null&&!zt?(ed(e,t,c),La(e,t,c)):($e&&w&&ro(t),t.flags|=1,Pt(e,t,l,c),t.child)}function Rg(e,t,a,l,c){if(e===null){var u=a.type;return typeof u=="function"&&!Du(u)&&u.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=u,zg(e,t,u,l,c)):(e=lo(a.type,null,l,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!jd(e,c)){var g=u.memoizedProps;if(a=a.compare,a=a!==null?a:Bi,a(g,l)&&e.ref===t.ref)return La(e,t,c)}return t.flags|=1,e=Ta(u,l),e.ref=t.ref,e.return=t,t.child=e}function zg(e,t,a,l,c){if(e!==null){var u=e.memoizedProps;if(Bi(u,l)&&e.ref===t.ref)if(zt=!1,t.pendingProps=l=u,jd(e,c))(e.flags&131072)!==0&&(zt=!0);else return t.lanes=e.lanes,La(e,t,c)}return xd(e,t,a,l,c)}function Lg(e,t,a,l){var c=l.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|a:a,e!==null){for(l=t.child=e.child,c=0;l!==null;)c=c|l.lanes|l.childLanes,l=l.sibling;l=c&~u}else l=0,t.child=null;return Og(e,t,u,a,l)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&mo(t,u!==null?u.cachePool:null),u!==null?Up(t,u):Yu(),Hp(t);else return l=t.lanes=536870912,Og(e,t,u!==null?u.baseLanes|a:a,a,l)}else u!==null?(mo(t,u.cachePool),Up(t,u),os(),t.memoizedState=null):(e!==null&&mo(t,null),Yu(),os());return Pt(e,t,c,a),t.child}function Ji(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Og(e,t,a,l,c){var u=qu();return u=u===null?null:{parent:Mt._currentValue,pool:u},t.memoizedState={baseLanes:a,cachePool:u},e!==null&&mo(t,null),Yu(),Hp(t),e!==null&&Gs(e,t,l,!0),t.childLanes=c,null}function _o(e,t){return t=Do({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Bg(e,t,a){return Xs(t,e.child,null,a),e=_o(t,t.pendingProps),e.flags|=2,Cn(t),t.memoizedState=null,e}function MS(e,t,a){var l=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if($e){if(l.mode==="hidden")return e=_o(t,l),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Ji(null,e);if(Xu(t),(e=wt)?(e=cy(e,Hn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ja!==null?{id:ra,overflow:oa}:null,retryLane:536870912,hydrationErrors:null},a=vp(e),a.return=t,t.child=a,Vt=t,wt=null)):e=null,e===null)throw es(t);return t.lanes=536870912,null}return _o(t,l)}var u=e.memoizedState;if(u!==null){var g=u.dehydrated;if(Xu(t),c)if(t.flags&256)t.flags&=-257,t=Bg(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(zt||Gs(e,t,a,!1),c=(a&e.childLanes)!==0,zt||c){if(is.current===null){if(l=vt,l!==null&&(g=kh(l,a),g!==0&&g!==u.retryLane))throw u.retryLane=g,Hs(e,g),yn(l,e,g),gd;Zo()}t=Bg(e,t,a)}else e=u.treeContext,wt=qn(g.nextSibling),Vt=t,$e=!0,Wa=null,Hn=!1,e!==null&&kp(t,e),t=_o(t,l),t.flags|=134221824;return t}return e=Ta(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Kl(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(o(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function xd(e,t,a,l,c){return Is(t),a=Ju(e,t,a,l,void 0,c),l=Wu(),e!==null&&!zt?(ed(e,t,c),La(e,t,c)):($e&&l&&ro(t),t.flags|=1,Pt(e,t,a,c),t.child)}function Ug(e,t,a,l,c,u){return Is(t),t.updateQueue=null,a=qp(t,l,a,c),Pp(e),l=Wu(),e!==null&&!zt?(ed(e,t,u),La(e,t,u)):($e&&l&&ro(t),t.flags|=1,Pt(e,t,a,u),t.child)}function Hg(e,t,a,l,c){if(Is(t),t.stateNode===null){var u=Ol,g=a.contextType;typeof g=="object"&&g!==null&&(u=$t(g)),u=new a(l,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=hd,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=l,u.state=t.memoizedState,u.refs={},Gu(t),g=a.contextType,u.context=typeof g=="object"&&g!==null?$t(g):Ol,u.state=t.memoizedState,g=a.getDerivedStateFromProps,typeof g=="function"&&(md(t,a,g,l),u.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(g=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),g!==u.state&&hd.enqueueReplaceState(u,u.state,null),Yi(t,l,u,c),Ki(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){u=t.stateNode;var w=t.memoizedProps,D=$s(a,w);u.props=D;var X=u.context,ae=a.contextType;g=Ol,typeof ae=="object"&&ae!==null&&(g=$t(ae));var xe=a.getDerivedStateFromProps;ae=typeof xe=="function"||typeof u.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,ae||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(w||X!==g)&&Ng(t,u,l,g),as=!1;var V=t.memoizedState;u.state=V,Yi(t,l,u,c),Ki(),X=t.memoizedState,w||V!==X||as?(typeof xe=="function"&&(md(t,a,xe,l),X=t.memoizedState),(D=as||jg(t,a,D,l,V,X,g))?(ae||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=X),u.props=l,u.state=X,u.context=g,l=D):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{u=t.stateNode,Iu(e,t),g=t.memoizedProps,ae=$s(a,g),u.props=ae,xe=t.pendingProps,V=u.context,X=a.contextType,D=Ol,typeof X=="object"&&X!==null&&(D=$t(X)),w=a.getDerivedStateFromProps,(X=typeof w=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(g!==xe||V!==D)&&Ng(t,u,l,D),as=!1,V=t.memoizedState,u.state=V,Yi(t,l,u,c),Ki();var ee=t.memoizedState;g!==xe||V!==ee||as||e!==null&&e.dependencies!==null&&uo(e.dependencies)?(typeof w=="function"&&(md(t,a,w,l),ee=t.memoizedState),(ae=as||jg(t,a,ae,l,V,ee,D)||e!==null&&e.dependencies!==null&&uo(e.dependencies))?(X||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(l,ee,D),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(l,ee,D)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||g===e.memoizedProps&&V===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&V===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=ee),u.props=l,u.state=ee,u.context=D,l=ae):(typeof u.componentDidUpdate!="function"||g===e.memoizedProps&&V===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&V===e.memoizedState||(t.flags|=1024),l=!1)}return u=l,Kl(e,t),l=(t.flags&128)!==0,u||l?(u=t.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&l?(t.child=Xs(t,e.child,null,c),t.child=Xs(t,null,a,c)):Pt(e,t,a,c),t.memoizedState=u.state,e=t.child):e=La(e,t,c),e}function Pg(e,t,a,l){return qs(),t.flags|=256,Pt(e,t,a,l),t.child}var yd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bd(e){return{baseLanes:e,cachePool:Tp()}}function vd(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Tn),e}function qg(e,t,a){var l=t.pendingProps,c=!1,u=(t.flags&128)!==0,g;if((g=u)||(g=e!==null&&e.memoizedState===null?!1:(Wt.current&2)!==0),g&&(c=!0,t.flags&=-129),g=(t.flags&32)!==0,t.flags&=-33,e===null){if($e){if(c?rs(t):os(),(e=wt)?(e=cy(e,Hn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ja!==null?{id:ra,overflow:oa}:null,retryLane:536870912,hydrationErrors:null},a=vp(e),a.return=t,t.child=a,Vt=t,wt=null)):e=null,e===null)throw es(t);return vf(e)?t.lanes=32:t.lanes=536870912,null}return u=l.children,l=l.fallback,c?(os(),c=t.mode,u=Do({mode:"hidden",children:u},c),l=Ps(l,c,a,null),u.return=t,l.return=t,u.sibling=l,t.child=u,l=t.child,l.memoizedState=bd(a),l.childLanes=vd(e,g,a),t.memoizedState=yd,Ji(null,l)):(rs(t),wd(t,u))}var w=e.memoizedState;if(w!==null){var D=w.dehydrated;if(D!==null)return RS(e,t,u,g,l,D,w,a)}return c?(os(),c=l.fallback,u=t.mode,w=e.child,D=w.sibling,l=Ta(w,{mode:"hidden",children:l.children}),l.subtreeFlags=w.subtreeFlags&1206910976,D!==null?c=Ta(D,c):(c=Ps(c,u,a,null),c.flags|=2),c.return=t,l.return=t,l.sibling=c,t.child=l,Ji(null,l),l=t.child,c=e.child.memoizedState,c===null?c=bd(a):(u=c.cachePool,u!==null?(w=Mt._currentValue,u=u.parent!==w?{parent:w,pool:w}:u):u=Tp(),c={baseLanes:c.baseLanes|a,cachePool:u}),l.memoizedState=c,l.childLanes=vd(e,g,a),t.memoizedState=yd,Ji(e.child,l)):(rs(t),a=e.child,e=a.sibling,a=Ta(a,{mode:"visible",children:l.children}),a.return=t,a.sibling=null,e!==null&&(g=t.deletions,g===null?(t.deletions=[e],t.flags|=16):g.push(e)),t.child=a,t.memoizedState=null,a)}function wd(e,t){return t=Do({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Do(e,t){return e=hn(22,e,null,t),e.lanes=0,e}function Mo(e,t,a){return Xs(t,e.child,null,a),e=wd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function RS(e,t,a,l,c,u,g,w){if(a)return t.flags&256?(rs(t),t.flags&=-257,Mo(e,t,w)):t.memoizedState!==null?(os(),t.child=e.child,t.flags|=128,null):(os(),u=c.fallback,g=t.mode,c=Do({mode:"visible",children:c.children},g),u=Ps(u,g,w,null),u.flags|=2,c.return=t,u.return=t,c.sibling=u,t.child=c,Xs(t,e.child,null,w),c=t.child,c.memoizedState=bd(w),c.childLanes=vd(e,l,w),t.memoizedState=yd,Ji(null,c));if(rs(t),vf(u)){if(l=u.nextSibling&&u.nextSibling.dataset,l)var D=l.dgst;return l=D,l!==""&&(c=Error(o(419)),c.stack="",c.digest=l,Pi({value:c,source:null,stack:null})),Mo(e,t,w)}if(zt||Gs(e,t,w,!1),l=(w&e.childLanes)!==0,zt||l){if(is.current!==null)return Mo(e,t,w);if(l=vt,l!==null&&(c=kh(l,w),c!==0&&c!==g.retryLane))throw g.retryLane=c,Hs(e,c),yn(l,e,c),gd;return bf(u)||Zo(),Mo(e,t,w)}return bf(u)?(t.flags|=192,t.child=e.child,null):(e=g.treeContext,wt=qn(u.nextSibling),Vt=t,$e=!0,Wa=null,Hn=!1,e!==null&&kp(t,e),t=wd(t,c.children),t.flags|=134221824,t)}function Fg(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),co(e.return,t,a)}function Gg(e){for(var t=null;e!==null;){var a=e.alternate;a!==null&&bo(a)===null&&(t=e),e=e.sibling}return t}function Ro(e,t,a,l,c,u){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:c,treeForkCount:u}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=l,g.tail=a,g.tailMode=c,g.treeForkCount=u)}function Sd(e){var t=e.child;for(e.child=null;t!==null;){var a=t.sibling;t.sibling=e.child,e.child=t,t=a}}function kd(e,t,a){var l=t.pendingProps,c=l.revealOrder,u=l.tail;l=l.children;var g=Wt.current;if(t.flags&128)return Qi(t,g),null;var w=(g&2)!==0;if(w?(g=g&1|2,t.flags|=128):g&=1,Qi(t,g),c==="backwards"&&e!==null?(Sd(e),Pt(e,t,l,a),Sd(e)):Pt(e,t,l,a),l=$e?Hi:0,!w&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Fg(e,a,t);else if(e.tag===19)Fg(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"backwards":a=Gg(t.child),a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null,Sd(t)),Ro(t,!0,c,null,u,l);break;case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&bo(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}Ro(t,!0,a,null,u,l);break;case"together":Ro(t,!1,null,null,void 0,l);break;case"independent":t.memoizedState=null;break;default:a=Gg(t.child),a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),Ro(t,!1,c,a,u,l)}return t.child}function Ig(e,t,a){var l=t.pendingProps;return ts(t,t.type,l.value),Pt(e,t,l.children,a),t.child}function La(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),fs|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Gs(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,a=Ta(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ta(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function jd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&uo(e)))}function zS(e,t,a){switch(t.tag){case 3:jt(t,t.stateNode.containerInfo),ts(t,Mt,e.memoizedState.cache),qs();break;case 27:case 5:ye(t);break;case 4:jt(t,t.stateNode.containerInfo);break;case 10:ts(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Xu(t),null;break;case 13:var l=t.memoizedState;if(l!==null){if(l.dehydrated!==null)return rs(t),t.flags|=128,null;l=Gs(e,t,a,!1);var c=t.child.childLanes;return l||(a&c)!==0?qg(e,t,a):(rs(t),e=La(e,t,a),e!==null?e.sibling:null)}rs(t);break;case 19:if(t.flags&128)return kd(e,t,a);if(c=(e.flags&128)!==0,l=(a&t.childLanes)!==0,l||(Gs(e,t,a,!1),l=(a&t.childLanes)!==0),c){if(l)return kd(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Qi(t,Wt.current),l)break;return null;case 22:return t.lanes=0,Lg(e,t,a,t.pendingProps);case 24:ts(t,Mt,e.memoizedState.cache)}return La(e,t,a)}function Vg(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)zt=!0;else{if(!jd(e,a)&&(t.flags&128)===0)return zt=!1,zS(e,t,a);zt=(e.flags&131072)!==0}else zt=!1,$e&&(t.flags&1048576)!==0&&Sp(t,Hi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Ys(t.elementType),t.type=e,typeof e=="function")Du(e)?(l=$s(e,l),t.tag=1,t=Hg(null,t,e,l,a)):(t.tag=0,t=xd(null,t,e,l,a));else{if(e!=null){var c=e.$$typeof;if(c===F){t.tag=11,t=Mg(null,t,e,l,a);break e}else if(c===he){t.tag=14,t=Rg(null,t,e,l,a);break e}else if(c===z){t.tag=10,t.type=e,t=Ig(null,t,a);break e}}throw t=oe(e)||e,Error(o(306,t,""))}}return t;case 0:return xd(e,t,t.type,t.pendingProps,a);case 1:return l=t.type,c=$s(l,t.pendingProps),Hg(e,t,l,c,a);case 3:e:{if(jt(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var u=t.memoizedState;c=u.element,Iu(e,t),Yi(t,l,null,a);var g=t.memoizedState;if(l=g.cache,ts(t,Mt,l),l!==u.cache&&Uu(t,[Mt],a,!0),Ki(),l=g.element,u.isDehydrated)if(u={element:l,isDehydrated:!1,cache:g.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=Pg(e,t,l,a);break e}else if(l!==c){c=On(Error(o(424)),t),Pi(c),t=Pg(e,t,l,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(wt=qn(e.firstChild),Vt=t,$e=!0,Wa=null,Hn=!0,a=Lp(t,null,l,a),t.child=a;a;)a.flags=a.flags&-3|134221824,a=a.sibling}else{if(qs(),l===c){t=La(e,t,a);break e}Pt(e,t,l,a)}t=t.child}return t;case 26:return Kl(e,t),e===null?(a=gy(t.type,null,t.pendingProps,null))?t.memoizedState=a:$e||(t.stateNode=Xx(t.type,t.pendingProps,Ke.current,t)):t.memoizedState=gy(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ye(t),e===null&&$e&&(l=t.stateNode=fy(t.type,t.pendingProps,Ke.current),Vt=t,Hn=!0,c=wt,gs(t.type)?(wf=c,wt=qn(l.firstChild)):wt=c),Pt(e,t,t.pendingProps.children,a),Kl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&$e&&((c=l=wt)&&(l=A2(l,t.type,t.pendingProps,Hn),l!==null?(t.stateNode=l,Vt=t,wt=qn(l.firstChild),Hn=!1,c=!0):c=!1),c||es(t)),ye(t),c=t.type,u=t.pendingProps,g=e!==null?e.memoizedProps:null,l=u.children,ff(c,u)?l=null:g!==null&&ff(c,g)&&(t.flags|=32),t.memoizedState!==null&&(c=Ju(e,t,kS,null,null,a),ui._currentValue=c),Kl(e,t),Pt(e,t,l,a),t.child;case 6:return e===null&&$e&&((e=a=wt)&&(a=T2(a,t.pendingProps,Hn),a!==null?(t.stateNode=a,Vt=t,wt=null,e=!0):e=!1),e||es(t)),null;case 13:return qg(e,t,a);case 4:return jt(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Xs(t,null,l,a):Pt(e,t,l,a),t.child;case 11:return Mg(e,t,t.type,t.pendingProps,a);case 7:return l=t.pendingProps,Kl(e,t),Pt(e,t,l,a),t.child;case 8:return Pt(e,t,t.pendingProps.children,a),t.child;case 12:return Pt(e,t,t.pendingProps.children,a),t.child;case 10:return Ig(e,t,a);case 9:return c=t.type._context,l=t.pendingProps.children,Is(t),c=$t(c),l=l(c),t.flags|=1,Pt(e,t,l,a),t.child;case 14:return Rg(e,t,t.type,t.pendingProps,a);case 15:return zg(e,t,t.type,t.pendingProps,a);case 19:return kd(e,t,a);case 31:return MS(e,t,a);case 22:return Lg(e,t,a,t.pendingProps);case 24:return Is(t),l=$t(Mt),e===null?(c=qu(),c===null&&(c=vt,u=Hu(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=a),c=u),t.memoizedState={parent:l,cache:c},Gu(t),ts(t,Mt,c)):((e.lanes&a)!==0&&(Iu(e,t),Yi(t,null,null,a),Ki()),c=e.memoizedState,u=t.memoizedState,c.parent!==l?(c={parent:l,cache:l},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),ts(t,Mt,l)):(l=u.cache,ts(t,Mt,l),l!==c.cache&&Uu(t,[Mt],a,!0))),Pt(e,t,t.pendingProps.children,a),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),l=t.pendingProps,l.name!=null&&l.name!=="auto"?t.flags|=e===null?18882560:18874368:$e&&ro(t),e!==null&&e.memoizedProps.name!==l.name?t.flags|=4194816:Kl(e,t),Pt(e,t,l.children,a),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Oa(e){e.flags|=4}function Nd(e,t,a,l,c){var u;if((u=(e.mode&32)!==0)&&(u=a===null?vy(t,l):vy(t,l)&&(l.src!==a.src||l.srcSet!==a.srcSet)),u){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Cx())e.flags|=8192;else throw Qs=po,Fu}else e.flags&=-16777217}function Kg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!wy(t))if(Cx())e.flags|=8192;else throw Qs=po,Fu}function zo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?vh():536870912,e.lanes|=t,$l|=t)}function Wi(e,t){if(!$e)switch(e.tailMode){case"visible":break;case"collapsed":for(var a=e.tail,l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null;break;default:for(t=e.tail,a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null}}function St(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,l|=c.subtreeFlags&1206910976,l|=c.flags&1206910976,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,l|=c.subtreeFlags,l|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function LS(e,t,a){var l=t.pendingProps;switch(zu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(t),null;case 1:return St(t),null;case 3:return a=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Ma(Mt),B(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Hl(t)?Oa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ou())),St(t),null;case 26:var c=t.type,u=t.memoizedState;return e===null?(Oa(t),u!==null?(St(t),Kg(t,u)):(St(t),Nd(t,c,null,l,a))):u?u!==e.memoizedState?(Oa(t),St(t),Kg(t,u)):(St(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Oa(t),St(t),Nd(t,c,e,l,a)),null;case 27:if(Le(t),a=Ke.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Oa(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return St(t),t.subtreeFlags&=-33554433,null}e=Re.current,Hl(t)?jp(t):(e=fy(c,l,a),t.stateNode=e,Oa(t))}return St(t),t.subtreeFlags&=-33554433,null;case 5:if(Le(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Oa(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return St(t),t.subtreeFlags&=-33554433,null}if(u=Re.current,Hl(t))jp(t);else{var g=ur(Ke.current);switch(u){case 1:u=g.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:u=g.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":u=g.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":u=g.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":u=g.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof l.is=="string"?g.createElement("select",{is:l.is}):g.createElement("select"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is=="string"?g.createElement(c,{is:l.is}):g.createElement(c)}}u[Zt]=t,u[mn]=l;e:for(g=t.child;g!==null;){if(g.tag===5||g.tag===6)u.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===t)break e;for(;g.sibling===null;){if(g.return===null||g.return===t)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}t.stateNode=u;e:switch(tn(u,c,l),c){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Oa(t)}}return St(t),t.subtreeFlags&=-33554433,Nd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Oa(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=Ke.current,Hl(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,c=Vt,c!==null)switch(c.tag){case 27:case 5:l=c.memoizedProps}e[Zt]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||Vx(e.nodeValue,a)),e||es(t,!0)}else e=ur(e).createTextNode(l),e[Zt]=t,t.stateNode=e}return St(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(l=Hl(t),a!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Zt]=t}else qs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;St(t),e=!1}else a=Ou(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Cn(t),t):(Cn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return St(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Hl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!c)throw Error(o(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));c[Zt]=t}else qs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;St(t),c=!1}else c=Ou(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Cn(t),t):(Cn(t),null)}return Cn(t),(t.flags&128)!==0?(t.lanes=a,t):(a=l!==null,e=e!==null&&e.memoizedState!==null,a&&(l=t.child,c=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(c=l.alternate.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==c&&(l.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),zo(t,t.updateQueue),St(t),null);case 4:return B(),e===null&&rf(t.stateNode.containerInfo),t.flags|=67108864,St(t),null;case 10:return Ma(t.type),St(t),null;case 19:if(Zu(t),l=t.memoizedState,l===null)return St(t),null;if(c=(t.flags&128)!==0,u=l.rendering,u===null)if(c)Wi(l,!1);else{if(Tt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=bo(e),u!==null){for(t.flags|=128,Wi(l,!1),e=u.updateQueue,t.updateQueue=e,zo(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)bp(a,e),a=a.sibling;return Qi(t,Wt.current&1|2),$e&&_a(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Ht()>Ko&&(t.flags|=128,c=!0,Wi(l,!1),t.lanes=4194304)}else{if(!c)if(e=bo(u),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,zo(t,e),Wi(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!u.alternate&&!$e)return St(t),null}else 2*Ht()-l.renderingStartTime>Ko&&a!==536870912&&(t.flags|=128,c=!0,Wi(l,!1),t.lanes=4194304);l.isBackwards?(u.sibling=t.child,t.child=u):(e=l.last,e!==null?e.sibling=u:t.child=u,l.last=u)}if(l.tail!==null){e=l.tail;e:{for(a=e;a!==null;){if(a.alternate!==null){a=!1;break e}a=a.sibling}a=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Ht(),e.sibling=null,u=Wt.current,u=c?u&1|2:u&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!a||$e?Qi(t,u):(a=u,ue(Jt,t),ue(Wt,a),ln===null&&(ln=t)),$e&&_a(t,l.treeForkCount),e}return St(t),null;case 22:case 23:return Cn(t),Qu(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),a=t.updateQueue,a!==null&&zo(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&Fe(Ks),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ma(Mt),St(t),null;case 25:return null;case 30:return t.flags|=33554432,St(t),null}throw Error(o(156,t.tag))}function OS(e,t){switch(zu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ma(Mt),B(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Le(t),null;case 31:if(t.memoizedState!==null){if(Cn(t),t.alternate===null)throw Error(o(340));qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Cn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Zu(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return B(),null;case 10:return Ma(t.type),null;case 22:case 23:return Cn(t),Qu(),e!==null&&Fe(Ks),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ma(Mt),null;case 25:return null;default:return null}}function Yg(e,t){switch(zu(t),t.tag){case 3:Ma(Mt),B();break;case 26:case 27:case 5:Le(t);break;case 4:B();break;case 31:t.memoizedState!==null&&Cn(t);break;case 13:Cn(t);break;case 19:Zu(t);break;case 10:Ma(t.type);break;case 22:case 23:Cn(t),Qu(),e!==null&&Fe(Ks);break;case 24:Ma(Mt)}}function er(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var c=l.next;a=c;do{if((a.tag&e)===e){l=void 0;var u=a.create,g=a.inst;l=u(),g.destroy=l}a=a.next}while(a!==c)}}catch(w){pt(t,t.return,w)}}function cs(e,t,a){try{var l=t.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var u=c.next;l=u;do{if((l.tag&e)===e){var g=l.inst,w=g.destroy;if(w!==void 0){g.destroy=void 0,c=t;var D=a,X=w;try{X()}catch(ae){pt(c,D,ae)}}}l=l.next}while(l!==u)}}catch(ae){pt(t,t.return,ae)}}function Qg(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Bp(t,a)}catch(l){pt(e,e.return,l)}}}function Xg(e,t,a){a.props=$s(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){pt(e,t,l)}}function ca(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var c=e.stateNode,u=Ea(e.memoizedProps,c);(c.ref===null||c.ref.name!==u)&&(c.ref=ny(u)),l=c.ref;break;case 7:if(e.stateNode===null){var g=new Dn(e);v(e.child,!1,C2,g,void 0,void 0),e.stateNode=g}l=e.stateNode;break;default:l=e.stateNode}typeof a=="function"?e.refCleanup=a(l):a.current=l}}catch(w){pt(e,t,w)}}function en(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(c){pt(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){pt(e,t,c)}else a.current=null}function Lo(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var a=0;a<t.length;a++)oy(e.stateNode,t[a])}function Zg(e){for(var t=e.return;t!==null&&(Ed(t)&&oy(e.stateNode,t.stateNode),!Cd(t));)t=t.return}function tr(e){for(var t=e.return;t!==null&&(Ed(t)&&E2(e.stateNode,t.stateNode),!Cd(t));)t=t.return}function Cd(e){return e.tag===5||e.tag===3||e.tag===27}function Ed(e){return e&&e.tag===7&&e.stateNode!==null}function Ad(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(c){pt(e,e.return,c)}}function Td(e,t,a){try{var l=e.stateNode;o2(l,e.type,a,t),l[mn]=t}catch(c){pt(e,e.return,c)}}function $g(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&gs(e.type)||e.tag===4}function _d(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$g(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&gs(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Dd(e,t,a,l){var c=e.tag;if(c===5||c===6)c=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(c,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(c),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=ia)),Lo(e,l),ot=!0;else if(c!==4&&(c===27&&(Lo(e,l),l=null,gs(e.type)&&(a=e.stateNode,t=null)),e=e.child,e!==null))for(Dd(e,t,a,l),e=e.sibling;e!==null;)Dd(e,t,a,l),e=e.sibling}function Oo(e,t,a,l){var c=e.tag;if(c===5||c===6)c=e.stateNode,t?a.insertBefore(c,t):a.appendChild(c),Lo(e,l),ot=!0;else if(c!==4&&(c===27&&(Lo(e,l),l=null,gs(e.type)&&(a=e.stateNode)),e=e.child,e!==null))for(Oo(e,t,a,l),e=e.sibling;e!==null;)Oo(e,t,a,l),e=e.sibling}function Jg(e){var t=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);tn(t,l,a),t[Zt]=e,t[mn]=a}catch(u){pt(e,e.return,u)}}var Bo=!1,En=null;function Wg(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Bo=!0)}var ua=null;function ex(){var e=ua;return ua=null,e}var pn=0;function Yl(e,t,a,l,c){return pn=0,tx(e.child,t,a,l,c)}function tx(e,t,a,l,c){for(var u=!1;e!==null;){if(e.tag===5){var g=e.stateNode;if(l!==null){var w=pf(g);l.push(w),w.view&&(u=!0)}else u||pf(g).view&&(u=!0);Bo=!0,ey(g,pn===0?t:t+"_"+pn,a),pn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&c||tx(e.child,t,a,l,c)&&(u=!0));e=e.sibling}return u}function da(e,t){for(;e!==null;)e.tag===5?ty(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||da(e.child,t)),e=e.sibling}function Uo(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Uo(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(o(544));var a=t.name;t=Aa(t.default,t.share),t!=="none"&&(Yl(e,a,t,null,!1)||da(e.child,!1))}e=e.sibling}}function Md(e,t){if(e.tag===30){var a=e.stateNode,l=e.memoizedProps,c=Ea(l,a),u=Aa(l.default,a.paired?l.share:l.enter);u!=="none"?Yl(e,c,u,null,!1)?(Uo(e),a.paired||t||ti(e,l.onEnter)):da(e.child,!1):Uo(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Md(e,t),e=e.sibling;else Uo(e)}function Rd(e){if(En!==null&&En.size!==0){var t=En;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var a=e.memoizedProps,l=a.name;if(l!=null&&l!=="auto"){var c=t.get(l);if(c!==void 0){var u=Aa(a.default,a.share);if(u!=="none"&&(Yl(e,l,u,null,!1)?(u=e.stateNode,c.paired=u,u.paired=c,ti(e,a.onShare)):da(e.child,!1)),t.delete(l),t.size===0)break}}}Rd(e)}e=e.sibling}}}function zd(e){if(e.tag===30){var t=e.memoizedProps,a=Ea(t,e.stateNode),l=En!==null?En.get(a):void 0,c=Aa(t.default,l!==void 0?t.share:t.exit);c!=="none"&&(Yl(e,a,c,null,!1)?l!==void 0?(c=e.stateNode,l.paired=c,c.paired=l,En.delete(a),ti(e,t.onShare)):ti(e,t.onExit):da(e.child,!1)),En!==null&&Rd(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)zd(e),e=e.sibling;else En!==null&&Rd(e)}function nx(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,a=Ea(t,e.stateNode);t=Aa(t.default,t.update),e.flags&=-5,t!=="none"&&Yl(e,a,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&nx(e);e=e.sibling}}function Ld(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,da(e.child,!1))}Ld(e)}e=e.sibling}}function Ho(e){if(e.tag===30)e.stateNode.paired=null,da(e.child,!1),Ld(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Ho(e),e=e.sibling;else Ld(e)}function ax(e){for(e=e.child;e!==null;)e.tag===30?da(e.child,!1):(e.subtreeFlags&33554432)!==0&&ax(e),e=e.sibling}function Od(e,t,a,l,c,u,g){for(var w=!1;t!==null;){if(t.tag===5){var D=t.stateNode;if(u!==null&&pn<u.length){var X=u[pn],ae=pf(D);(X.view||ae.view)&&(w=!0);var xe;if(xe=(e.flags&4)===0)if(ae.clip)xe=!0;else{xe=X.rect;var V=ae.rect;xe=xe.y!==V.y||xe.x!==V.x||xe.height!==V.height||xe.width!==V.width}xe&&(e.flags|=4),ae.abs?ae=!X.abs:(X=X.rect,ae=ae.rect,ae=X.height!==ae.height||X.width!==ae.width),ae&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&ey(D,pn===0?a:a+"_"+pn,c),w&&(e.flags&4)!==0||(ua===null&&(ua=[]),ua.push(D,pn===0?l:l+"_"+pn,t.memoizedProps)),pn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&g?e.flags|=t.flags&32:Od(e,t.child,a,l,c,u,g)&&(w=!0));t=t.sibling}return w}function sx(e,t){for(e=e.child;e!==null;){if(e.tag===30){var a=e.memoizedProps,l=e.stateNode,c=Ea(a,l),u=Aa(a.default,a.update),g;g=e.memoizedState,e.memoizedState=null,l=e;var w=e.child;pn=0,c=Od(l,w,c,c,u,g,!1),(e.flags&4)!==0&&c&&ti(e,a.onUpdate)}else(e.subtreeFlags&33554432)!==0&&sx(e);e=e.sibling}}var Kt=!1,dt=!1,fa=!1,Bd=!1,lx=typeof WeakSet=="function"?WeakSet:Set,Yt=null,ma=!1,nr=!1,Po=!1,Ud=!1;function BS(e,t,a){if(e=e.containerInfo,uf=di,e=cp(e),ju(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var c=l.getSelection&&l.getSelection();if(c&&c.rangeCount!==0){l=c.anchorNode;var u=c.anchorOffset,g=c.focusNode;c=c.focusOffset;try{l.nodeType,g.nodeType}catch{l=null;break e}var w=0,D=-1,X=-1,ae=0,xe=0,V=e,ee=null;t:for(;;){for(var ke;V!==l||u!==0&&V.nodeType!==3||(D=w+u),V!==g||c!==0&&V.nodeType!==3||(X=w+c),V.nodeType===3&&(w+=V.nodeValue.length),(ke=V.firstChild)!==null;)ee=V,V=ke;for(;;){if(V===e)break t;if(ee===l&&++ae===u&&(D=w),ee===g&&++xe===c&&(X=w),(ke=V.nextSibling)!==null)break;V=ee,ee=V.parentNode}V=ke}l=D===-1||X===-1?null:{start:D,end:X}}else l=null}l=l||{start:0,end:0}}else l=null;for(df={focusedElem:e,selectionRange:l},di=!1,a=(a&335544064)===a,Yt=t,t=a?9270:1024;Yt!==null;){if(e=Yt,a&&(l=e.deletions,l!==null))for(u=0;u<l.length;u++)a&&zd(l[u]);if(e.alternate===null&&(e.flags&2)!==0)a&&Wg(e),qo(a);else{if(e.tag===22){if(l=e.alternate,e.memoizedState!==null){l!==null&&l.memoizedState===null&&a&&zd(l),qo(a);continue}else if(l!==null&&l.memoizedState!==null){a&&Wg(e),qo(a);continue}}l=e.child,(e.subtreeFlags&t)!==0&&l!==null?(l.return=e,Yt=l):(a&&nx(e),qo(a))}}En=null}function qo(e){for(;Yt!==null;){var t=Yt,a=e,l=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((c&1024)!==0&&l!==null){a=void 0,c=l.memoizedProps,l=l.memoizedState;var u=t.stateNode;try{var g=$s(t.type,c);a=u.getSnapshotBeforeUpdate(g,l),u.__reactInternalSnapshotBeforeUpdate=a}catch(w){pt(t,t.return,w)}}break;case 3:if((c&1024)!==0){if(l=t.stateNode.containerInfo,a=l.nodeType,a===9)yf(l);else if(a===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":yf(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:a&&l!==null&&(a=Ea(l.memoizedProps,l.stateNode),c=t.memoizedProps,c=Aa(c.default,c.update),c!=="none"&&Yl(l,a,c,l.memoizedState=[],!0));break;default:if((c&1024)!==0)throw Error(o(163))}if(l=t.sibling,l!==null){l.return=t.return,Yt=l;break}Yt=t.return}}function ix(e,t,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:ha(e,a),l&4&&er(5,a);break;case 1:if(ha(e,a),l&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(g){pt(a,a.return,g)}else{var c=$s(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(g){pt(a,a.return,g)}}l&64&&Qg(a),l&512&&ca(a,a.return);break;case 3:if(ha(e,a),l&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Bp(e,t)}catch(g){pt(a,a.return,g)}}break;case 27:t===null&&l&4&&Jg(a);case 26:case 5:ha(e,a),t===null&&l&4&&Ad(a),l&512&&ca(a,a.return);break;case 12:ha(e,a);break;case 31:ha(e,a),l&4&&ux(e,a);break;case 13:ha(e,a),l&4&&dx(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=XS.bind(null,a),_2(e,a))));break;case 22:if(l=a.memoizedState!==null||Kt,!l){var u=t!==null&&t.memoizedState!==null||dt;t=Kt,c=dt,Kt=l,(dt=u)&&!c?(l=2,(a.subtreeFlags&8772)!==0&&(l|=1),Wn(e,a,l)):ha(e,a),Kt=t,dt=c}break;case 30:ha(e,a),l&512&&ca(a,a.return);break;case 7:l&512&&ca(a,a.return);default:ha(e,a)}}function Hd(e,t){for(e=e.child;e!==null;)rx(e,t),e=e.sibling}function rx(e,t){switch(e.tag){case 5:case 26:try{var a=e.stateNode;if(t){var l=a.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var c=e.stateNode,u=e.memoizedProps.style,g=u!=null&&u.hasOwnProperty("display")?u.display:null;c.style.display=g==null||typeof g=="boolean"?"":(""+g).trim()}}catch(D){pt(e,e.return,D)}Pd(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,ot=!0}catch(D){pt(e,e.return,D)}break;case 18:try{var w=e.stateNode;t?Wx(w,!0):Wx(e.stateNode,!1)}catch(D){pt(e,e.return,D)}break;case 22:case 23:e.memoizedState===null&&Hd(e,t);break;default:Hd(e,t)}}function Pd(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var a=e,l=t;switch(a.tag){case 4:rx(a,l);break e;case 22:a.memoizedState===null&&Pd(a,l);break e;default:Pd(a,l)}}e=e.sibling}}function ox(e){var t=e.alternate;t!==null&&(e.alternate=null,ox(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Vr(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Nt=null,gn=!1;function $n(e,t,a){for(a=a.child;a!==null;)cx(e,t,a),a=a.sibling}function cx(e,t,a){if(He&&typeof He.onCommitFiberUnmount=="function")try{He.onCommitFiberUnmount(Me,a)}catch{}switch(a.tag){case 26:dt||en(a,t),$n(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&!dt&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:dt||en(a,t),tr(a);var l=Nt,c=gn;gs(a.type)&&(Nt=a.stateNode,gn=!1),$n(e,t,a),my(a.stateNode,a.type,a.memoizedProps),Nt=l,gn=c;break;case 5:dt||en(a,t),tr(a);case 6:if(a.tag===6&&tr(a),l=Nt,c=gn,Nt=null,$n(e,t,a),Nt=l,gn=c,Nt!==null)if(gn)try{(Nt.nodeType===9?Nt.body:Nt.nodeName==="HTML"?Nt.ownerDocument.body:Nt).removeChild(a.stateNode),ot=!0}catch(u){pt(a,t,u)}else try{Nt.removeChild(a.stateNode),ot=!0}catch(u){pt(a,t,u)}break;case 18:Nt!==null&&(gn?(e=Nt,Jx(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),fi(e)):Jx(Nt,a.stateNode));break;case 4:l=Nt,c=gn,Nt=a.stateNode.containerInfo,gn=!0,$n(e,t,a),Nt=l,gn=c;break;case 0:case 11:case 14:case 15:cs(2,a,t),dt||cs(4,a,t),$n(e,t,a);break;case 1:dt||(en(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Xg(a,t,l)),$n(e,t,a);break;case 21:$n(e,t,a);break;case 22:dt=(l=dt)||a.memoizedState!==null,$n(e,t,a),dt=l;break;case 30:en(a,t),$n(e,t,a);break;case 7:dt||en(a,t),$n(e,t,a);break;default:$n(e,t,a)}}function ux(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{fi(e)}catch(a){pt(t,t.return,a)}}}function dx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{fi(e)}catch(a){pt(t,t.return,a)}}function US(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lx),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lx),t;default:throw Error(o(435,e.tag))}}function Fo(e,t){var a=US(e);t.forEach(function(l){if(!a.has(l)){a.add(l);var c=ZS.bind(null,e,l);l.then(c,c)}})}function dn(e,t,a){var l=t.deletions;if(l!==null)for(var c=0;c<l.length;c++){var u=l[c],g=e,w=t,D=w;e:for(;D!==null;){switch(D.tag){case 27:if(gs(D.type)){Nt=D.stateNode,gn=!1;break e}break;case 5:Nt=D.stateNode,gn=!1;break e;case 3:case 4:Nt=D.stateNode.containerInfo,gn=!0;break e}D=D.return}if(Nt===null)throw Error(o(160));cx(g,w,u),Nt=null,gn=!1,g=u.alternate,g!==null&&(g.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fx(t,e,a),t=t.sibling}var Jn=null;function fx(e,t,a){var l=e.alternate,c=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(c&4&&(l=e.updateQueue,l=l!==null?l.events:null,l!==null))for(var u=0;u<l.length;u++){var g=l[u];g.ref.impl=g.nextImpl}dn(t,e,a),fn(e),c&4&&(cs(3,e,e.return),er(3,e),cs(5,e,e.return));break;case 1:dn(t,e,a),fn(e),c&512&&(dt||l===null||en(l,l.return)),c&64&&Kt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?t:a.concat(t))));break;case 26:if(u=Jn,dn(t,e,a),fn(e),c&512&&(dt||l===null||en(l,l.return)),c&4)if(c=l!==null?l.memoizedState:null,a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null)if(Kt)e.stateNode=Xx(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,a=e.memoizedProps,c=u.ownerDocument||u;t:switch(t){case"title":l=c.getElementsByTagName("title")[0],(!l||l[Ai]||l[Zt]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=c.createElement(t),c.head.insertBefore(l,c.querySelector("head > title"))),tn(l,t,a),l[Zt]=e,It(l),t=l;break e;case"link":if(u=by("link","href",c).get(t+(a.href||""))){for(g=0;g<u.length;g++)if(l=u[g],l.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&l.getAttribute("rel")===(a.rel==null?null:a.rel)&&l.getAttribute("title")===(a.title==null?null:a.title)&&l.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){u.splice(g,1);break t}}l=c.createElement(t),tn(l,t,a),c.head.appendChild(l);break;case"meta":if(u=by("meta","content",c).get(t+(a.content||""))){for(g=0;g<u.length;g++)if(l=u[g],l.getAttribute("content")===(a.content==null?null:""+a.content)&&l.getAttribute("name")===(a.name==null?null:a.name)&&l.getAttribute("property")===(a.property==null?null:a.property)&&l.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&l.getAttribute("charset")===(a.charSet==null?null:a.charSet)){u.splice(g,1);break t}}l=c.createElement(t),tn(l,t,a),c.head.appendChild(l);break;default:throw Error(o(468,t))}l[Zt]=e,It(l),t=l}e.stateNode=t}else Kt||Nf(u,e.type,e.stateNode);else e.stateNode=yy(u,a,e.memoizedProps);else c!==a?(c===null?(t=l.stateNode,t===null||dt||t.parentNode.removeChild(t)):c.count--,a===null?Kt||Nf(u,e.type,e.stateNode):yy(u,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Td(e,e.memoizedProps,l.memoizedProps);break;case 27:dn(t,e,a),fn(e),c&512&&(dt||l===null||en(l,l.return)),l!==null&&c&4&&Td(e,e.memoizedProps,l.memoizedProps);break;case 5:if(u=fa,fa=!1,dn(t,e,a),fa=u,fn(e),c&512&&(dt||l===null||en(l,l.return)),e.flags&32){t=e.stateNode;try{Tl(t,""),ot=!0}catch(ae){pt(e,e.return,ae)}}c&4&&e.stateNode!=null&&(t=e.memoizedProps,Td(e,t,l!==null?l.memoizedProps:t)),c&1024&&(Bd=!0);break;case 6:if(dn(t,e,a),fn(e),c&4){if(e.stateNode===null)throw Error(o(162));t=e.memoizedProps,a=e.stateNode;try{a.nodeValue=t,ot=!0}catch(ae){pt(e,e.return,ae)}}break;case 3:if(ot=!1,ac=null,u=Jn,Jn=dr(t.containerInfo),dn(t,e,a),Jn=u,fn(e),c&4&&l!==null&&l.memoizedState.isDehydrated)try{fi(t.containerInfo)}catch(ae){pt(e,e.return,ae)}Bd&&(Bd=!1,mx(e)),ot=!1;break;case 4:c=fa,fa=Kt,l=Rh(),u=Jn,Jn=dr(e.stateNode.containerInfo),dn(t,e,a),fn(e),Jn=u,ot&&nr&&(Po=!0),ot=l,fa=c;break;case 12:dn(t,e,a),fn(e);break;case 31:dn(t,e,a),fn(e),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Fo(e,t)));break;case 13:dn(t,e,a),fn(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Vo=Ht()),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Fo(e,t)));break;case 22:u=e.memoizedState!==null,g=l!==null&&l.memoizedState!==null;var w=Kt,D=dt,X=fa;Kt=w||u,fa=X||u,dt=D||g,dn(t,e,a),dt=D,fa=X,Kt=w,fn(e),c&8192&&(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,!u||l===null||g||Kt||dt||(t=g||dt,a=Kt,l=dt,Kt=u||Kt,dt=t,us(e,2),Kt=a,dt=l),!u&&fa||Hd(e,u)),c&4&&(t=e.updateQueue,t!==null&&(a=t.retryQueue,a!==null&&(t.retryQueue=null,Fo(e,a))));break;case 19:dn(t,e,a),fn(e),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Fo(e,t)));break;case 30:c&512&&(dt||l===null||en(l,l.return)),c=Rh(),u=nr,g=(a&335544064)===a,w=e.memoizedProps,nr=g&&Aa(w.default,w.update)!=="none",dn(t,e,a),fn(e),g&&l!==null&&ot&&(e.flags|=4),nr=u,ot=c;break;case 21:break;case 7:c&512&&(dt||l===null||en(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=e);default:dn(t,e,a),fn(e)}}function fn(e){var t=e.flags;if(t&2){try{for(var a,l=e.return;l!==null;){if($g(l)){a=l;break}l=l.return}l=null;for(var c=e.return;c!==null;){if(Ed(c)){var u=c.stateNode;l===null?l=[u]:l.push(u)}if(Cd(c))break;c=c.return}var g=l;if(a==null)throw Error(o(160));switch(a.tag){case 27:var w=a.stateNode,D=_d(e);Oo(e,D,w,g);break;case 5:var X=a.stateNode;a.flags&32&&(Tl(X,""),a.flags&=-33);var ae=_d(e);Oo(e,ae,X,g);break;case 3:case 4:var xe=a.stateNode.containerInfo,V=_d(e);Dd(e,V,xe,g);break;default:throw Error(o(161))}}catch(ee){pt(e,e.return,ee)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function mx(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;mx(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,di=!0,t.reset(),di=!1),e=e.sibling}}function Ql(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)hx(t,e),t=t.sibling;else sx(t)}function hx(e,t){var a=e.alternate;if(a===null)Md(e,!1);else switch(e.tag){case 3:if(Ud=ma=!1,ex(),Ql(t,e),!ma&&!Po){if(e=ua,e!==null)for(var l=0;l<e.length;l+=3){a=e[l];var c=e[l+1];ty(a,e[l+2]),a=a.ownerDocument.documentElement,a!==null&&a.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+c+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Ud=!0}ua=null;break;case 5:Ql(t,e);break;case 4:l=ma,ma=!1,Ql(t,e),ma&&(Po=!0),ma=l;break;case 22:e.memoizedState===null&&(a.memoizedState!==null?Md(e,!1):Ql(t,e));break;case 30:l=ma,c=ex(),ma=!1,Ql(t,e),ma&&(e.flags|=4);var u=e.memoizedProps,g=e.stateNode;t=Ea(u,g),g=Ea(a.memoizedProps,g);var w=Aa(u.default,u.update);w==="none"?t=!1:(u=a.memoizedState,a.memoizedState=null,a=e.child,pn=0,t=Od(e,a,t,g,w,u,!0),pn!==(u===null?0:u.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(ti(e,e.memoizedProps.onUpdate),ua=c):c!==null&&(c.push.apply(c,ua),ua=c),ma=(e.flags&32)!==0?!0:l;break;default:Ql(t,e)}}function ha(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ix(e,t.alternate,t),t=t.sibling}function us(e,t){for(e=e.child;e!==null;){var a=e,l=t;switch(a.tag){case 0:case 11:case 14:case 15:cs(4,a,a.return),us(a,l);break;case 1:en(a,a.return);var c=a.stateNode;typeof c.componentWillUnmount=="function"&&Xg(a,a.return,c),us(a,l);break;case 27:(l&2)!==0&&my(a.stateNode,a.type,a.memoizedProps);case 5:en(a,a.return),a.tag!==5&&a.tag!==27||tr(a),us(a,l);break;case 6:tr(a);break;case 26:en(a,a.return),c=a.stateNode,a.memoizedState!==null||c===null||dt||c.parentNode.removeChild(c),us(a,l);break;case 22:a.memoizedState===null&&us(a,l);break;case 30:en(a,a.return),us(a,l);break;case 7:en(a,a.return);default:us(a,l)}e=e.sibling}}function Wn(e,t,a){for(a=(t.subtreeFlags&8772)!==0?a:a&-2,t=t.child;t!==null;){var l=t.alternate,c=e,u=t,g=u.flags,w=(a&1)!==0;switch(u.tag){case 0:case 11:case 15:Wn(c,u,a),er(4,u);break;case 1:if(Wn(c,u,a),l=u,c=l.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(ae){pt(l,l.return,ae)}if(l=u,c=l.updateQueue,c!==null){var D=l.stateNode;try{var X=c.shared.hiddenCallbacks;if(X!==null)for(c.shared.hiddenCallbacks=null,c=0;c<X.length;c++)Op(X[c],D)}catch(ae){pt(l,l.return,ae)}}w&&g&64&&Qg(u),ca(u,u.return);break;case 27:(a&2)!==0&&Jg(u);case 5:u.tag!==5&&u.tag!==27||Zg(u),Wn(c,u,a),w&&l===null&&g&4&&Ad(u),ca(u,u.return);break;case 6:Zg(u);break;case 26:D=u.stateNode,u.memoizedState!==null||D===null||Kt||Nf(dr(D.ownerDocument),u.type,D),Wn(c,u,a),w&&l===null&&g&4&&Ad(u),ca(u,u.return);break;case 12:Wn(c,u,a);break;case 31:Wn(c,u,a),w&&g&4&&ux(c,u);break;case 13:Wn(c,u,a),w&&g&4&&dx(c,u);break;case 22:u.memoizedState===null&&Wn(c,u,a),ca(u,u.return);break;case 30:Wn(c,u,a),ca(u,u.return);break;case 7:ca(u,u.return);default:Wn(c,u,a)}t=t.sibling}}function qd(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&qi(a))}function Fd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&qi(e))}function Pn(e,t,a,l){var c=(a&335544064)===a;if(t.subtreeFlags&(c?10262:10256))for(t=t.child;t!==null;)px(e,t,a,l),t=t.sibling;else c&&ax(t)}function px(e,t,a,l){var c=(a&335544064)===a;c&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Ho(t);var u=t.flags;switch(t.tag){case 0:case 11:case 15:Pn(e,t,a,l),u&2048&&er(9,t);break;case 1:Pn(e,t,a,l);break;case 3:Pn(e,t,a,l),c&&Ud&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),u&2048&&(u=null,t.alternate!==null&&(u=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==u&&(t.refCount++,u!=null&&qi(u)));break;case 12:if(u&2048){Pn(e,t,a,l),u=t.stateNode;try{var g=t.memoizedProps,w=g.id,D=g.onPostCommit;typeof D=="function"&&D(w,t.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(X){pt(t,t.return,X)}}else Pn(e,t,a,l);break;case 31:Pn(e,t,a,l);break;case 13:Pn(e,t,a,l);break;case 23:break;case 22:g=t.stateNode,w=t.alternate,t.memoizedState!==null?(c&&w!==null&&w.memoizedState===null&&Ho(w),g._visibility&2?Pn(e,t,a,l):ar(e,t)):(c&&w!==null&&w.memoizedState!==null&&Ho(t),g._visibility&2?Pn(e,t,a,l):(g._visibility|=2,Xl(e,t,a,l,(t.subtreeFlags&10256)!==0||!1))),u&2048&&qd(w,t);break;case 24:Pn(e,t,a,l),u&2048&&Fd(t.alternate,t);break;case 30:c&&(u=t.alternate,u!==null&&(da(u.child,!0),da(t.child,!0))),Pn(e,t,a,l);break;default:Pn(e,t,a,l)}}function Xl(e,t,a,l,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,g=t,w=a,D=l,X=g.flags;switch(g.tag){case 0:case 11:case 15:Xl(u,g,w,D,c),er(8,g);break;case 23:break;case 22:var ae=g.stateNode;g.memoizedState!==null?ae._visibility&2?Xl(u,g,w,D,c):ar(u,g):(ae._visibility|=2,Xl(u,g,w,D,c)),c&&X&2048&&qd(g.alternate,g);break;case 24:Xl(u,g,w,D,c),c&&X&2048&&Fd(g.alternate,g);break;default:Xl(u,g,w,D,c)}t=t.sibling}}function ar(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,l=t,c=l.flags;switch(l.tag){case 22:ar(a,l),c&2048&&qd(l.alternate,l);break;case 24:ar(a,l),c&2048&&Fd(l.alternate,l);break;default:ar(a,l)}t=t.sibling}}var Js=8192;function Ws(e,t,a){if(e.subtreeFlags&Js)for(e=e.child;e!==null;)gx(e,t,a),e=e.sibling}function gx(e,t,a){switch(e.tag){case 26:Ws(e,t,a),e.flags&Js&&(e.memoizedState!==null?I2(a,Jn,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&ky(a,e)));break;case 5:Ws(e,t,a),e.flags&Js&&(e=e.stateNode,(t&335544128)===t&&ky(a,e));break;case 3:case 4:var l=Jn;Jn=dr(e.stateNode.containerInfo),Ws(e,t,a),Jn=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Js,Js=16777216,Ws(e,t,a),Js=l):Ws(e,t,a));break;case 30:if((e.flags&Js)!==0&&(l=e.memoizedProps.name,l!=null&&l!=="auto")){var c=e.stateNode;c.paired=null,En===null&&(En=new Map),En.set(l,c)}Ws(e,t,a);break;default:Ws(e,t,a)}}function xx(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function sr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Yt=l,bx(l,e)}xx(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)yx(e),e=e.sibling}function yx(e){switch(e.tag){case 0:case 11:case 15:sr(e),e.flags&2048&&cs(9,e,e.return);break;case 3:sr(e);break;case 12:sr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Go(e)):sr(e);break;default:sr(e)}}function Go(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Yt=l,bx(l,e)}xx(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:cs(8,t,t.return),Go(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Go(t));break;default:Go(t)}e=e.sibling}}function bx(e,t){for(;Yt!==null;){var a=Yt;switch(a.tag){case 0:case 11:case 15:cs(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:qi(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,Yt=l;else e:for(a=e;Yt!==null;){l=Yt;var c=l.sibling,u=l.return;if(ox(l),l===a){Yt=null;break e}if(c!==null){c.return=u,Yt=c;break e}Yt=u}}}var HS={getCacheForType:function(e){var t=$t(Mt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return $t(Mt).controller.signal}},PS=typeof WeakMap=="function"?WeakMap:Map,ct=0,vt=null,et=null,nt=0,ht=0,An=null,ds=!1,Zl=!1,Gd=!1,Ba=0,Tt=0,fs=0,el=0,Io=0,Tn=0,$l=0,lr=null,xn=null,Id=!1,Vo=0,vx=0,Ko=1/0,Yo=null,ms=null,Et=0,ea=null,tl=null,pa=0,Vd=0,Kd=null,wx=null,Jl=null,Wl=null,ei=null,ir=0,Qo=null;function _n(){return(ct&2)!==0&&nt!==0?nt&-nt:be.T!==null?nf():jh()}function Sx(){if(Tn===0)if((nt&536870912)===0||$e){var e=aa;aa<<=1,(aa&3932160)===0&&(aa=262144),Tn=e}else Tn=536870912;return e=Jt.current,e!==null&&(e.flags|=32),Tn}function ti(e,t){if(t!=null){var a=e.stateNode,l=a.ref;l===null&&(l=a.ref=ny(Ea(e.memoizedProps,a))),Wl===null&&(Wl=[]),Wl.push(t.bind(null,l))}}function yn(e,t,a){(e===vt&&(ht===2||ht===9)||e.cancelPendingCommit!==null)&&(ni(e,0),hs(e,nt,Tn,!1)),Ei(e,a),((ct&2)===0||e!==vt)&&(e===vt&&((ct&2)===0&&(el|=a),Tt===4&&hs(e,nt,Tn,!1)),ga(e))}function kx(e,t,a){if((ct&6)!==0)throw Error(o(327));var l=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Ci(e,t),c=l?GS(e,t):Qd(e,t,!0),u=l;do{if(c===0){Zl&&!l&&hs(e,t,0,!1);break}else{if(a=e.current.alternate,u&&!qS(a)){c=Qd(e,t,!1),u=!1;continue}if(c===2){if(u=t,e.errorRecoveryDisabledLanes&u)var g=0;else g=e.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){t=g;e:{var w=e;c=lr;var D=w.current.memoizedState.isDehydrated;if(D&&(ni(w,g).flags|=256),g=Qd(w,g,!1),g!==2&&g!==6){if(Gd&&!D){w.errorRecoveryDisabledLanes|=u,el|=u,c=4;break e}u=xn,xn=c,u!==null&&(xn===null?xn=u:xn.push.apply(xn,u))}c=g}if(u=!1,c!==2)continue}}if(c===1){ni(e,0),hs(e,t,0,!0);break}e:{switch(l=e,u=c,u){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:hs(l,t,Tn,!ds);break e;case 2:xn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=Vo+300-Ht(),10<c)){if(hs(l,t,Tn,!ds),la(l,0,!0)!==0)break e;pa=t,l.timeoutHandle=hf(jx.bind(null,l,a,xn,Yo,Id,t,Tn,el,$l,ds,u,"Throttled",-0,0),c);break e}jx(l,a,xn,Yo,Id,t,Tn,el,$l,ds,u,null,-0,0)}}break}while(!0);ga(e)}function jx(e,t,a,l,c,u,g,w,D,X,ae,xe,V,ee){e.timeoutHandle=-1;var ke=t.subtreeFlags,De=(u&335544064)===u;if(xe=null,(De||ke&8192||(ke&16785408)===16785408)&&(xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ia},En=null,gx(t,u,xe),De&&(ke=xe,De=e.containerInfo,De=(De.nodeType===9?De:De.ownerDocument).__reactViewTransition,De!=null&&(ke.count++,ke.waitingForViewTransition=!0,ke=hr.bind(ke),De.finished.then(ke,ke))),ke=(u&62914560)===u?Vo-Ht():(u&4194048)===u?vx-Ht():0,ke=V2(xe,ke),ke!==null)){pa=u,e.cancelPendingCommit=ke(Mx.bind(null,e,t,u,a,l,c,g,w,D,X,ae,xe,null,V,ee)),hs(e,u,g,!X);return}Mx(e,t,u,a,l,c,g,w,D,X,ae,xe)}function qS(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var c=a[l],u=c.getSnapshot;c=c.value;try{if(!Nn(u(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function hs(e,t,a,l){t=bh(e,t),t&=~Io,t&=~el,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var c=t;0<c;){var u=31-Ne(c),g=1<<u;l[u]=-1,c&=~g}a!==0&&wh(e,a,t)}function Xo(){return(ct&6)===0?(rr(0),!1):!0}function Yd(){if(et!==null){if(ht===0)var e=et.return;else e=et,Da=Fs=null,td(e),Fl=null,Ii=0,e=et;for(;e!==null;)Yg(e.alternate,e),e=e.return;et=null}}function ni(e,t){var a=e.timeoutHandle;return a!==-1&&(e.timeoutHandle=-1,d2(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),pa=0,Yd(),vt=e,et=a=Ta(e.current,null),nt=t,ht=0,An=null,ds=!1,Zl=Ci(e,t),Gd=!1,$l=Tn=Io=el=fs=Tt=0,xn=lr=null,Id=!1,Ba=bh(e,t),no(),a}function Nx(e,t){Qe=null,be.H=Ao,t===ql||t===ho?(t=Mp(),ht=3):t===Fu?(t=Mp(),ht=4):ht=t===gd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,An=t,et===null&&(Tt=1,To(e,On(t,e.current)))}function Cx(){var e=Jt.current;return e===null?!0:(nt&4194048)===nt?ln===null:(nt&62914560)===nt||(nt&536870912)!==0?e===ln:!1}function Ex(){var e=be.H;return be.H=Ao,e===null?Ao:e}function Ax(){var e=be.A;return be.A=HS,e}function Zo(){Tt=4,ds||(nt&4194048)!==nt&&Jt.current!==null||(Zl=!0),(fs&134217727)===0&&(el&134217727)===0||vt===null||hs(vt,nt,Tn,!1)}function Qd(e,t,a){var l=ct;ct|=2;var c=Ex(),u=Ax();(vt!==e||nt!==t)&&(Yo=null,ni(e,t)),t=!1;var g=Tt;e:do try{if(ht!==0&&et!==null){var w=et,D=An;switch(ht){case 8:Yd(),g=6;break e;case 3:case 2:case 9:case 6:Jt.current===null&&(t=!0);var X=ht;if(ht=0,An=null,ai(e,w,D,X),a&&Zl){g=0;break e}break;default:X=ht,ht=0,An=null,ai(e,w,D,X)}}FS(),g=Tt;break}catch(ae){Nx(e,ae)}while(!0);return t&&e.shellSuspendCounter++,Da=Fs=null,ct=l,be.H=c,be.A=u,et===null&&(vt=null,nt=0,no()),g}function FS(){for(;et!==null;)Tx(et)}function GS(e,t){var a=ct;ct|=2;var l=Ex(),c=Ax();vt!==e||nt!==t?(Yo=null,Ko=Ht()+500,ni(e,t)):Zl=Ci(e,t);e:do try{if(ht!==0&&et!==null){t=et;var u=An;t:switch(ht){case 1:ht=0,An=null,ai(e,t,u,1);break;case 2:case 9:if(_p(u)){ht=0,An=null,_x(t);break}t=function(){ht!==2&&ht!==9||vt!==e||(ht=7),ga(e)},u.then(t,t);break e;case 3:ht=7;break e;case 4:ht=5;break e;case 7:_p(u)?(ht=0,An=null,_x(t)):(ht=0,An=null,ai(e,t,u,7));break;case 5:var g=null;switch(et.tag){case 26:g=et.memoizedState;case 5:case 27:var w=et;if(g?wy(g):w.stateNode.complete){ht=0,An=null;var D=w.sibling;if(D!==null)et=D;else{var X=w.return;X!==null?(et=X,$o(X)):et=null}break t}}ht=0,An=null,ai(e,t,u,5);break;case 6:ht=0,An=null,ai(e,t,u,6);break;case 8:Yd(),Tt=6;break e;default:throw Error(o(462))}}IS();break}catch(ae){Nx(e,ae)}while(!0);return Da=Fs=null,be.H=l,be.A=c,ct=a,et!==null?0:(vt=null,nt=0,no(),Tt)}function IS(){for(;et!==null&&!Ni();)Tx(et)}function Tx(e){var t=Vg(e.alternate,e,Ba);e.memoizedProps=e.pendingProps,t===null?$o(e):et=t}function _x(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Ug(a,t,t.pendingProps,t.type,void 0,nt);break;case 11:t=Ug(a,t,t.pendingProps,t.type.render,t.ref,nt);break;case 5:td(t);var l=t;l===Vt&&($e?(oo(l),l.tag===5&&l.stateNode!=null&&(wt=l.stateNode)):(oo(l),$e=!0));default:Yg(a,t),t=et=bp(t,Ba),t=Vg(a,t,Ba)}e.memoizedProps=e.pendingProps,t===null?$o(e):et=t}function ai(e,t,a,l){Da=Fs=null,td(t),Fl=null,Ii=0;var c=t.return;try{if(DS(e,c,t,a,nt)){Tt=1,To(e,On(a,e.current)),et=null;return}}catch(u){if(c!==null)throw et=c,u;Tt=1,To(e,On(a,e.current)),et=null;return}t.flags&32768?($e||l===1?e=!0:Zl||(nt&536870912)!==0?e=!1:(ds=e=!0,(l===2||l===9||l===3||l===6)&&(l=Jt.current,l!==null&&l.tag===13&&(l.flags|=16384))),Dx(t,e)):$o(t)}function $o(e){var t=e;do{if((t.flags&32768)!==0){Dx(t,ds);return}e=t.return;var a=LS(t.alternate,t,Ba);if(a!==null){et=a;return}if(t=t.sibling,t!==null){et=t;return}et=t=e}while(t!==null);Tt===0&&(Tt=5)}function Dx(e,t){do{var a=OS(e.alternate,e);if(a!==null){a.flags&=32767,et=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){et=e;return}et=e=a}while(e!==null);Tt=6,et=null}function Mx(e,t,a,l,c,u,g,w,D,X,ae,xe){e.cancelPendingCommit=null;do Jo();while(Et!==0);if((ct&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===vt&&(et=vt=null,nt=0),tl=t,ea=e,pa=a,Kd=c,wx=l,VS(e,t,a,g,w,D,xe)}}function VS(e,t,a,l,c,u,g){var w=t.lanes|t.childLanes;if(Vd=w,w|=Tu,xw(e,a,w,l,c,u),Wl=null,(a&335544064)===a?(ei=bS(e),l=10262):(ei=null,l=10256),(t.subtreeFlags&l)!==0||(t.flags&l)!==0?(e.callbackNode=null,e.callbackPriority=0,$S(ka,function(){return Jd(),null})):(e.callbackNode=null,e.callbackPriority=0),Bo=!1,l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=be.T,be.T=null,c=Se.p,Se.p=2,u=ct,ct|=4;try{BS(e,t,a)}finally{ct=u,Se.p=c,be.T=l}}Et=1,Bo?Jl=x2(g,e.containerInfo,ei,Xd,Zd,YS,$d,Jd,KS):(Xd(),Zd(),$d())}function KS(e){if(Et!==0){var t=ea.onRecoverableError;t(e,{componentStack:null})}}function YS(){Et===3&&(Et=0,hx(tl,ea),Et=4)}function Xd(){if(Et===1){Et=0;var e=ea,t=tl,a=pa,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=be.T,be.T=null;var c=Se.p;Se.p=2;var u=ct;ct|=4;try{nr=Po=!1,fx(t,e,a),a=df;var g=cp(e.containerInfo),w=a.focusedElem,D=a.selectionRange;if(g!==w&&w&&w.ownerDocument&&op(w.ownerDocument.documentElement,w)){if(D!==null&&ju(w)){var X=D.start,ae=D.end;if(ae===void 0&&(ae=X),"selectionStart"in w)w.selectionStart=X,w.selectionEnd=Math.min(ae,w.value.length);else{var xe=w.ownerDocument||document,V=xe&&xe.defaultView||window;if(V.getSelection){var ee=V.getSelection(),ke=w.textContent.length,De=Math.min(D.start,ke),Xe=D.end===void 0?De:Math.min(D.end,ke);!ee.extend&&De>Xe&&(g=Xe,Xe=De,De=g);var Q=rp(w,De),H=rp(w,Xe);if(Q&&H&&(ee.rangeCount!==1||ee.anchorNode!==Q.node||ee.anchorOffset!==Q.offset||ee.focusNode!==H.node||ee.focusOffset!==H.offset)){var W=xe.createRange();W.setStart(Q.node,Q.offset),ee.removeAllRanges(),De>Xe?(ee.addRange(W),ee.extend(H.node,H.offset)):(W.setEnd(H.node,H.offset),ee.addRange(W))}}}}for(xe=[],ee=w;ee=ee.parentNode;)ee.nodeType===1&&xe.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<xe.length;w++){var ge=xe[w];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}di=!!uf,df=uf=null}finally{ct=u,Se.p=c,be.T=l}}e.current=t,Et=2}}function Zd(){if(Et===2){Et=0;var e=ea,t=tl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=be.T,be.T=null;var l=Se.p;Se.p=2;var c=ct;ct|=4;try{ix(e,t.alternate,t)}finally{ct=c,Se.p=l,be.T=a}}Et=3}}function $d(){if(Et===4||Et===3){Et=0;var e=Jl;Jl=null,Ka();var t=ea,a=tl,l=pa,c=wx,u=(l&335544064)===l?10262:10256;if((a.subtreeFlags&u)!==0||(a.flags&u)!==0?Et=5:(Et=0,tl=ea=null,Rx(t,t.pendingLanes)),u=t.pendingLanes,u===0&&(ms=null),iu(l),a=a.stateNode,He&&typeof He.onCommitFiberRoot=="function")try{He.onCommitFiberRoot(Me,a,void 0,(a.current.flags&128)===128)}catch{}if(c!==null){a=be.T,u=Se.p,Se.p=2,be.T=null;try{for(var g=t.onRecoverableError,w=0;w<c.length;w++){var D=c[w];g(D.value,{componentStack:D.stack})}}finally{be.T=a,Se.p=u}}if(c=Wl,g=ei,ei=null,c!==null&&(Wl=null,g===null&&(g=[]),e!==null))for(D=0;D<c.length;D++)a=(0,c[D])(g),a!==void 0&&e.finished.finally(a);(pa&3)!==0&&Jo(),ga(t),u=t.pendingLanes,(l&261930)!==0&&(u&42)!==0?t===Qo?ir++:(ir=0,Qo=t):(ir=0,Qo=null),rr(0)}}function Rx(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,qi(t)))}function Jo(){return Jl!==null&&(Jl.skipTransition(),Jl=null),Xd(),Zd(),$d(),Jd()}function Jd(){if(Et!==5)return!1;var e=ea,t=Vd;Vd=0;var a=iu(pa),l=be.T,c=Se.p;try{Se.p=32>a?32:a,be.T=null,a=Kd,Kd=null;var u=ea,g=pa;if(Et=0,tl=ea=null,pa=0,(ct&6)!==0)throw Error(o(331));var w=ct;if(ct|=4,yx(u.current),px(u,u.current,g,a),ct=w,rr(0,!1),He&&typeof He.onPostCommitFiberRoot=="function")try{He.onPostCommitFiberRoot(Me,u)}catch{}return!0}finally{Se.p=c,be.T=l,Rx(e,t)}}function zx(e,t,a){t=On(a,t),t=pd(e.stateNode,t,2),e=ls(e,t,2),e!==null&&(Ei(e,2),ga(e))}function pt(e,t,a){if(e.tag===3)zx(e,e,a);else for(;t!==null;){if(t.tag===3){zx(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ms===null||!ms.has(l))){e=On(a,e),a=_g(2),l=ls(t,a,2),l!==null&&(Dg(a,l,t,e),Ei(l,2),ga(l));break}}t=t.return}}function Wd(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new PS;var c=new Set;l.set(t,c)}else c=l.get(t),c===void 0&&(c=new Set,l.set(t,c));c.has(a)||(Gd=!0,c.add(a),e=QS.bind(null,e,t,a),t.then(e,e))}function QS(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,vt===e&&(nt&a)===a&&((Tt===4||Tt===3&&(nt&62914560)===nt&&300>Ht()-Vo)&&(ct&2)===0?ni(e,0):Io|=a,$l===nt&&($l=0)),ga(e)}function Lx(e,t){t===0&&(t=vh()),e=Hs(e,t),e!==null&&(Ei(e,t),ga(e))}function XS(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Lx(e,a)}function ZS(e,t){var a=0;switch(e.tag){case 31:case 13:var l=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),Lx(e,a)}function $S(e,t){return Ms(e,t)}var si=null,li=null,ef=!1,Wo=!1,tf=!1,ps=0;function ga(e){e!==li&&e.next===null&&(li===null?si=li=e:li=li.next=e),Wo=!0,ef||(ef=!0,WS())}function rr(e,t){if(!tf&&Wo){tf=!0;do for(var a=!1,l=si;l!==null;){if(e!==0){var c=l.pendingLanes;if(c===0)var u=0;else{var g=l.suspendedLanes,w=l.pingedLanes;u=(1<<31-Ne(42|e)+1)-1,u&=c&~(g&~w),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(a=!0,Hx(l,u))}else u=nt,u=la(l,l===vt?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||Ci(l,u)||(a=!0,Hx(l,u));l=l.next}while(a);tf=!1}}function JS(){Ox()}function Ox(){Wo=ef=!1;var e=0;ps!==0&&u2()&&(e=ps);for(var t=Ht(),a=null,l=si;l!==null;){var c=l.next,u=Bx(l,t);u===0?(l.next=null,a===null?si=c:a.next=c,c===null&&(li=a)):(a=l,(e!==0||(u&3)!==0)&&(Wo=!0)),l=c}Et!==0&&Et!==5||rr(e),ps!==0&&(ps=0)}function Bx(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,c=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var g=31-Ne(u),w=1<<g,D=c[g];D===-1?((w&a)===0||(w&l)!==0)&&(c[g]=gw(w,t)):D<=t&&(e.expiredLanes|=w),u&=~w}if(t=vt,a=nt,a=la(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,a===0||e===t&&(ht===2||ht===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Rs(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Ci(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(l!==null&&Rs(l),iu(a)){case 2:case 8:a=Qa;break;case 32:a=ka;break;case 268435456:a=Xa;break;default:a=ka}return l=Ux.bind(null,e),a=Ms(a,l),e.callbackPriority=t,e.callbackNode=a,t}return l!==null&&l!==null&&Rs(l),e.callbackPriority=2,e.callbackNode=null,2}function Ux(e,t){if(Et!==0&&Et!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Jo()&&e.callbackNode!==a)return null;var l=nt;return l=la(e,e===vt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(kx(e,l,t),Bx(e,Ht()),e.callbackNode!=null&&e.callbackNode===a?Ux.bind(null,e):null)}function Hx(e,t){if(Jo())return null;kx(e,t,!0)}function WS(){f2(function(){(ct&6)!==0?Ms(zs,JS):Ox()})}function nf(){if(ps===0){var e=Vs;e===0&&(e=Qn,Qn<<=1,(Qn&261888)===0&&(Qn=256)),ps=e}return ps}function Px(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Qr(e)}function e2(e,t,a,l,c){if(t==="submit"&&a&&a.stateNode===c){var u=Px((c[mn]||null).action),g=l.submitter;g&&(t=(t=g[mn]||null)?Px(t.formAction):g.getAttribute("formAction"),t!==null&&(u=t,g=null));var w=new Jr("action","action",null,l,c);e.push({event:w,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ps!==0){var D=new FormData(c,g);ud(a,{pending:!0,data:D,method:c.method,action:u},null,D)}}else typeof u=="function"&&(w.preventDefault(),D=new FormData(c,g),ud(a,{pending:!0,data:D,method:c.method,action:u},u,D))},currentTarget:c}]})}}for(var af=0;af<Au.length;af++){var sf=Au[af],t2=sf.toLowerCase(),n2=sf[0].toUpperCase()+sf.slice(1);Zn(t2,"on"+n2)}Zn(fp,"onAnimationEnd"),Zn(mp,"onAnimationIteration"),Zn(hp,"onAnimationStart"),Zn("dblclick","onDoubleClick"),Zn("focusin","onFocus"),Zn("focusout","onBlur"),Zn(dS,"onTransitionRun"),Zn(fS,"onTransitionStart"),Zn(mS,"onTransitionCancel"),Zn(pp,"onTransitionEnd"),El("onMouseEnter",["mouseout","mouseover"]),El("onMouseLeave",["mouseout","mouseover"]),El("onPointerEnter",["pointerout","pointerover"]),El("onPointerLeave",["pointerout","pointerover"]),Os("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Os("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Os("onBeforeInput",["compositionend","keypress","textInput","paste"]),Os("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Os("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Os("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var or="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),a2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(or));function qx(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],c=l.event;l=l.listeners;e:{var u=void 0;if(t)for(var g=l.length-1;0<=g;g--){var w=l[g],D=w.instance,X=w.currentTarget;if(w=w.listener,D!==u&&c.isPropagationStopped())break e;u=w,c.currentTarget=X;try{u(c)}catch(ae){to(ae)}c.currentTarget=null,u=D}else for(g=0;g<l.length;g++){if(w=l[g],D=w.instance,X=w.currentTarget,w=w.listener,D!==u&&c.isPropagationStopped())break e;u=w,c.currentTarget=X;try{u(c)}catch(ae){to(ae)}c.currentTarget=null,u=D}}}}function tt(e,t){var a=t[Ch];a===void 0&&(a=t[Ch]=new Set);var l=e+"__bubble";a.has(l)||(Fx(t,e,2,!1),a.add(l))}function lf(e,t,a){var l=0;t&&(l|=4),Fx(a,e,l,t)}var ec="_reactListening"+Math.random().toString(36).slice(2);function rf(e){if(!e[ec]){e[ec]=!0,Th.forEach(function(a){a!=="selectionchange"&&(a2.has(a)||lf(a,!1,e),lf(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ec]||(t[ec]=!0,lf("selectionchange",!1,t))}}function Fx(e,t,a,l){switch(Dy(t)){case 2:var c=X2;break;case 8:c=Z2;break;default:c=Ef}a=c.bind(null,t,a,e),c=void 0,!hu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),l?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function of(e,t,a,l,c){var u=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var g=l.tag;if(g===3||g===4){var w=l.stateNode.containerInfo;if(w===c)break;if(g===4)for(g=l.return;g!==null;){var D=g.tag;if((D===3||D===4)&&g.stateNode.containerInfo===c)return;g=g.return}for(;w!==null;){if(g=Ls(w),g===null)return;if(D=g.tag,D===5||D===6||D===26||D===27){l=u=g;continue e}w=w.parentNode}}l=l.return}Fh(function(){var X=u,ae=fu(a),xe=[];e:{var V=gp.get(e);if(V!==void 0){var ee=Jr,ke=e;switch(e){case"keypress":if(Zr(a)===0)break e;case"keydown":case"keyup":ee=qw;break;case"focusin":ke="focus",ee=yu;break;case"focusout":ke="blur",ee=yu;break;case"beforeblur":case"afterblur":ee=yu;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=Vh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=Tw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=Kw;break;case fp:case mp:case hp:ee=Mw;break;case pp:ee=Qw;break;case"scroll":case"scrollend":ee=Ew;break;case"wheel":ee=Zw;break;case"copy":case"cut":case"paste":ee=zw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=Yh;break;case"submit":ee=Iw;break;case"toggle":case"beforetoggle":ee=Jw}var De=(t&4)!==0,Xe=!De&&(e==="scroll"||e==="scrollend"),Q=De?V!==null?V+"Capture":null:V;De=[];for(var H=X,W;H!==null;){var ge=H;if(W=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||W===null||Q===null||(ge=_i(H,Q),ge!=null&&De.push(cr(H,ge,W))),Xe)break;H=H.return}0<De.length&&(V=new ee(V,ke,null,a,ae),xe.push({event:V,listeners:De}))}}if((t&7)===0){e:{if(ee=e==="mouseover"||e==="pointerover",V=e==="mouseout"||e==="pointerout",ee&&a!==du&&(ke=a.relatedTarget||a.fromElement)&&(Ls(ke)||ke[jl]))break e;(V||ee)&&(ke=ae.window===ae?ae:(ee=ae.ownerDocument)?ee.defaultView||ee.parentWindow:window,V?(ee=a.relatedTarget||a.toElement,V=X,ee=ee?Ls(ee):null,ee!==null&&(Xe=f(ee),De=ee.tag,ee!==Xe||De!==5&&De!==27&&De!==6)&&(ee=null)):(V=null,ee=X),V!==ee&&(De=Vh,ge="onMouseLeave",Q="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(De=Yh,ge="onPointerLeave",Q="onPointerEnter",H="pointer"),Xe=V==null?ke:Ti(V),W=ee==null?ke:Ti(ee),ke=new De(ge,H+"leave",V,a,ae),ke.target=Xe,ke.relatedTarget=W,ge=null,Ls(ae)===X&&(De=new De(Q,H+"enter",ee,a,ae),De.target=W,De.relatedTarget=Xe,ge=De),Xe=ge,De=V&&ee?U(V,ee,s2):null,V!==null&&Gx(xe,ke,V,De,!1),ee!==null&&Xe!==null&&Gx(xe,Xe,ee,De,!0)))}e:{if(V=X?Ti(X):window,ee=V.nodeName&&V.nodeName.toLowerCase(),ee==="select"||ee==="input"&&V.type==="file")var Ee=tp;else if(Wh(V))if(np)Ee=oS;else{Ee=iS;var at=lS}else ee=V.nodeName,!ee||ee.toLowerCase()!=="input"||V.type!=="checkbox"&&V.type!=="radio"?X&&uu(X.elementType)&&(Ee=tp):Ee=rS;if(Ee&&(Ee=Ee(e,X))){ep(xe,Ee,a,ae);break e}at&&at(e,V,X)}switch(at=X?Ti(X):window,e){case"focusin":(Wh(at)||at.contentEditable==="true")&&(Rl=at,Nu=X,Ui=null);break;case"focusout":Ui=Nu=Rl=null;break;case"mousedown":Cu=!0;break;case"contextmenu":case"mouseup":case"dragend":Cu=!1,up(xe,a,ae);break;case"selectionchange":if(uS)break;case"keydown":case"keyup":up(xe,a,ae)}var ze;if(vu)e:{switch(e){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else Ml?$h(e,a)&&(qe="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(qe="onCompositionStart");qe&&(Qh&&a.locale!=="ko"&&(Ml||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&Ml&&(ze=Gh()):(Za=ae,pu="value"in Za?Za.value:Za.textContent,Ml=!0)),at=tc(X,qe),0<at.length&&(qe=new Kh(qe,e,null,a,ae),xe.push({event:qe,listeners:at}),ze?qe.data=ze:(ze=Jh(a),ze!==null&&(qe.data=ze)))),(ze=eS?tS(e,a):nS(e,a))&&(qe=tc(X,"onBeforeInput"),0<qe.length&&(at=new Kh("onBeforeInput","beforeinput",null,a,ae),xe.push({event:at,listeners:qe}),at.data=ze)),e2(xe,e,X,a,ae)}qx(xe,t)})}function cr(e,t,a){return{instance:e,listener:t,currentTarget:a}}function tc(e,t){for(var a=t+"Capture",l=[];e!==null;){var c=e,u=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||u===null||(c=_i(e,a),c!=null&&l.unshift(cr(e,c,u)),c=_i(e,t),c!=null&&l.push(cr(e,c,u))),e.tag===3)return l;e=e.return}return[]}function s2(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Gx(e,t,a,l,c){for(var u=t._reactName,g=[];a!==null&&a!==l;){var w=a,D=w.alternate,X=w.stateNode;if(w=w.tag,D!==null&&D===l)break;w!==5&&w!==26&&w!==27||X===null||(D=X,c?(X=_i(a,u),X!=null&&g.unshift(cr(a,X,D))):c||(X=_i(a,u),X!=null&&g.push(cr(a,X,D)))),a=a.return}g.length!==0&&e.push({event:t,listeners:g})}var l2=/\r\n?/g,i2=/\u0000|\uFFFD/g;function Ix(e){return(typeof e=="string"?e:""+e).replace(l2,`
49
- `).replace(i2,"")}function Vx(e,t){return t=Ix(t),Ix(e)===t}function gt(e,t,a,l,c,u){switch(a){case"children":if(typeof l=="string")t==="body"||t==="textarea"&&l===""||Tl(e,l);else if(typeof l=="number"||typeof l=="bigint")t!=="body"&&Tl(e,""+l);else return;break;case"className":Yr(e,"class",l);break;case"tabIndex":Yr(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Yr(e,a,l);break;case"style":Ph(e,l,u);return;case"data":if(t!=="object"){Yr(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Qr(l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(a==="formAction"?(t!=="input"&&gt(e,t,"name",c.name,c,null),gt(e,t,"formEncType",c.formEncType,c,null),gt(e,t,"formMethod",c.formMethod,c,null),gt(e,t,"formTarget",c.formTarget,c,null)):(gt(e,t,"encType",c.encType,c,null),gt(e,t,"method",c.method,c,null),gt(e,t,"target",c.target,c,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Qr(l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=ia);return;case"onScroll":l!=null&&tt("scroll",e);return;case"onScrollEnd":l!=null&&tt("scrollend",e);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(a=l.__html,a!=null){if(c.children!=null)throw Error(o(60));(u!=null?u.__html:void 0)!==a&&(e.innerHTML=a)}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}a=Qr(l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":tt("beforetoggle",e),tt("toggle",e),Kr(e,"popover",l);break;case"xlinkActuate":Na(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Na(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Na(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Na(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Na(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Na(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Na(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Na(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Na(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Kr(e,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")a=Nw.get(a)||a,Kr(e,a,l);else return}ot=!0}function cf(e,t,a,l,c,u){switch(a){case"style":Ph(e,l,u);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(a=l.__html,a!=null){if(c.children!=null)throw Error(o(60));(u!=null?u.__html:void 0)!==a&&(e.innerHTML=a)}}break;case"children":if(typeof l=="string")Tl(e,l);else if(typeof l=="number"||typeof l=="bigint")Tl(e,""+l);else return;break;case"onScroll":l!=null&&tt("scroll",e);return;case"onScrollEnd":l!=null&&tt("scrollend",e);return;case"onClick":l!=null&&(e.onclick=ia);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!_h.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),u=a.slice(2,c?a.length-7:void 0),t=e[mn]||null,t=t!=null?t[a]:null,typeof t=="function"&&e.removeEventListener(u,t,c),typeof l=="function")){typeof t!="function"&&t!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(u,l,c);break e}ot=!0,a in e?e[a]=l:l===!0?e.setAttribute(a,""):Kr(e,a,l)}return}ot=!0}function tn(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":tt("error",e),tt("load",e);var l=!1,c=!1,u;for(u in a)if(a.hasOwnProperty(u)){var g=a[u];if(g!=null)switch(u){case"src":l=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:gt(e,t,u,g,a,null)}}c&&gt(e,t,"srcSet",a.srcSet,a,null),l&&gt(e,t,"src",a.src,a,null);return;case"input":tt("invalid",e);var w=u=g=c=null,D=null,X=null;for(l in a)if(a.hasOwnProperty(l)){var ae=a[l];if(ae!=null)switch(l){case"name":c=ae;break;case"type":g=ae;break;case"checked":D=ae;break;case"defaultChecked":X=ae;break;case"value":u=ae;break;case"defaultValue":w=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(o(137,t));break;default:gt(e,t,l,ae,a,null)}}Oh(e,u,w,D,X,g,c,!1);return;case"select":tt("invalid",e),l=g=u=null;for(c in a)if(a.hasOwnProperty(c)&&(w=a[c],w!=null))switch(c){case"value":u=w;break;case"defaultValue":g=w;break;case"multiple":l=w;default:gt(e,t,c,w,a,null)}t=u,a=g,e.multiple=!!l,t!=null?Al(e,!!l,t,!1):a!=null&&Al(e,!!l,a,!0);return;case"textarea":tt("invalid",e),u=c=l=null;for(g in a)if(a.hasOwnProperty(g)&&(w=a[g],w!=null))switch(g){case"value":l=w;break;case"defaultValue":c=w;break;case"children":u=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(o(91));break;default:gt(e,t,g,w,a,null)}Uh(e,l,c,u);return;case"option":for(D in a)if(a.hasOwnProperty(D)&&(l=a[D],l!=null))switch(D){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:gt(e,t,D,l,a,null)}return;case"dialog":tt("beforetoggle",e),tt("toggle",e),tt("cancel",e),tt("close",e);break;case"iframe":case"object":tt("load",e);break;case"video":case"audio":for(l=0;l<or.length;l++)tt(or[l],e);break;case"image":tt("error",e),tt("load",e);break;case"details":tt("toggle",e);break;case"embed":case"source":case"link":tt("error",e),tt("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(X in a)if(a.hasOwnProperty(X)&&(l=a[X],l!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:gt(e,t,X,l,a,null)}return;default:if(uu(t)){for(ae in a)a.hasOwnProperty(ae)&&(l=a[ae],l!==void 0&&cf(e,t,ae,l,a,void 0));return}}for(w in a)a.hasOwnProperty(w)&&(l=a[w],l!=null&&gt(e,t,w,l,a,null))}var r2={};function o2(e,t,a,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,u=null,g=null,w=null,D=null,X=null,ae=null;for(ee in a){var xe=a[ee];if(a.hasOwnProperty(ee)&&xe!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":D=xe;default:l.hasOwnProperty(ee)||gt(e,t,ee,null,l,xe)}}for(var V in l){var ee=l[V];if(xe=a[V],l.hasOwnProperty(V)&&(ee!=null||xe!=null))switch(V){case"type":ee!==xe&&(ot=!0),u=ee;break;case"name":ee!==xe&&(ot=!0),c=ee;break;case"checked":ee!==xe&&(ot=!0),X=ee;break;case"defaultChecked":ee!==xe&&(ot=!0),ae=ee;break;case"value":ee!==xe&&(ot=!0),g=ee;break;case"defaultValue":ee!==xe&&(ot=!0),w=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(o(137,t));break;default:ee!==xe&&gt(e,t,V,ee,l,xe)}}ou(e,g,w,D,X,ae,u,c);return;case"select":ee=g=w=V=null;for(u in a)if(D=a[u],a.hasOwnProperty(u)&&D!=null)switch(u){case"value":break;case"multiple":ee=D;default:l.hasOwnProperty(u)||gt(e,t,u,null,l,D)}for(c in l)if(u=l[c],D=a[c],l.hasOwnProperty(c)&&(u!=null||D!=null))switch(c){case"value":u!==D&&(ot=!0),V=u;break;case"defaultValue":u!==D&&(ot=!0),w=u;break;case"multiple":u!==D&&(ot=!0),g=u;default:u!==D&&gt(e,t,c,u,l,D)}t=w,a=g,l=ee,V!=null?Al(e,!!a,V,!1):!!l!=!!a&&(t!=null?Al(e,!!a,t,!0):Al(e,!!a,a?[]:"",!1));return;case"textarea":ee=V=null;for(w in a)if(c=a[w],a.hasOwnProperty(w)&&c!=null&&!l.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:gt(e,t,w,null,l,c)}for(g in l)if(c=l[g],u=a[g],l.hasOwnProperty(g)&&(c!=null||u!=null))switch(g){case"value":c!==u&&(ot=!0),V=c;break;case"defaultValue":c!==u&&(ot=!0),ee=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==u&&gt(e,t,g,c,l,u)}Bh(e,V,ee);return;case"option":for(var ke in a)if(V=a[ke],a.hasOwnProperty(ke)&&V!=null&&!l.hasOwnProperty(ke))switch(ke){case"selected":e.selected=!1;break;default:gt(e,t,ke,null,l,V)}for(D in l)if(V=l[D],ee=a[D],l.hasOwnProperty(D)&&V!==ee&&(V!=null||ee!=null))switch(D){case"selected":V!==ee&&(ot=!0),e.selected=V&&typeof V!="function"&&typeof V!="symbol";break;default:gt(e,t,D,V,l,ee)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var De in a)V=a[De],a.hasOwnProperty(De)&&V!=null&&!l.hasOwnProperty(De)&&gt(e,t,De,null,l,V);for(X in l)if(V=l[X],ee=a[X],l.hasOwnProperty(X)&&V!==ee&&(V!=null||ee!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(o(137,t));break;default:gt(e,t,X,V,l,ee)}return;default:if(uu(t)){for(var Xe in a)V=a[Xe],a.hasOwnProperty(Xe)&&V!==void 0&&!l.hasOwnProperty(Xe)&&cf(e,t,Xe,void 0,l,V);for(ae in l)V=l[ae],ee=a[ae],!l.hasOwnProperty(ae)||V===ee||V===void 0&&ee===void 0||cf(e,t,ae,V,l,ee);return}}for(var Q in a)V=a[Q],a.hasOwnProperty(Q)&&V!=null&&!l.hasOwnProperty(Q)&&gt(e,t,Q,null,l,V);for(xe in l)V=l[xe],ee=a[xe],!l.hasOwnProperty(xe)||V===ee||V==null&&ee==null||gt(e,t,xe,V,l,ee)}function Kx(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function c2(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var c=a[l],u=c.transferSize,g=c.initiatorType,w=c.duration;if(u&&w&&Kx(g)){for(g=0,w=c.responseEnd,l+=1;l<a.length;l++){var D=a[l],X=D.startTime;if(X>w)break;var ae=D.transferSize,xe=D.initiatorType;ae&&Kx(xe)&&(D=D.responseEnd,g+=ae*(D<w?1:(w-X)/(D-X)))}if(--l,t+=8*(u+g)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var uf=null,df=null;function ur(e){return e.nodeType===9?e:e.ownerDocument}function Yx(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Qx(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Xx(e,t,a,l){return a=ur(a).createElement(e),a[Zt]=l,a[mn]=t,tn(a,e,t),It(a),a}function ff(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mf=null;function u2(){var e=window.event;return e&&e.type==="popstate"?e===mf?!1:(mf=e,!0):(mf=null,!1)}var hf=typeof setTimeout=="function"?setTimeout:void 0,d2=typeof clearTimeout=="function"?clearTimeout:void 0,Zx=typeof Promise=="function"?Promise:void 0,$x=typeof requestAnimationFrame=="function"?requestAnimationFrame:hf,f2=typeof queueMicrotask=="function"?queueMicrotask:typeof Zx<"u"?function(e){return Zx.resolve(null).then(e).catch(m2)}:hf;function m2(e){setTimeout(function(){throw e})}function gs(e){return e==="head"}function Jx(e,t){var a=t,l=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(l===0){e.removeChild(c),fi(t);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")Sf(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Sf(a);for(var u=a.firstChild;u;){var g=u.nextSibling,w=u.nodeName;u[Ai]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&u.rel.toLowerCase()==="stylesheet"||a.removeChild(u),u=g}}else a==="body"&&Sf(e.ownerDocument.body);a=c}while(a);fi(t)}function Wx(e,t){var a=e;e=0;do{var l=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=l}while(a)}function ey(e,t,a){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,a!=null&&(e.style.viewTransitionClass=a),a=getComputedStyle(e),a.display==="inline"){if(t=e.getClientRects(),t.length===1)var l=1;else for(var c=l=0;c<t.length;c++){var u=t[c];0<u.width&&0<u.height&&l++}l===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+a.paddingTop,e.marginBottom="-"+a.paddingBottom)}}function ty(e,t){e=e.style,t=t.style;var a=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=a==null||typeof a=="boolean"?"":(""+a).trim(),a=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=a==null||typeof a=="boolean"?"":(""+a).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(a=t.display,e.display=a==null||typeof a=="boolean"?"":a,a=t.margin,a!=null?e.margin=a:(a=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=a==null||typeof a=="boolean"?"":a,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function h2(e,t,a){return a=a.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=a.innerHeight&&e.left<=a.innerWidth}}function pf(e){var t=e.getBoundingClientRect(),a=getComputedStyle(e);return h2(t,a,e)}function p2(e){return e.documentElement.clientHeight}function g2(e){this.addEventListener("load",e),this.addEventListener("error",e)}function x2(e,t,a,l,c,u,g,w,D){var X=t.nodeType===9?t:t.ownerDocument;try{var ae=X.startViewTransition({update:function(){var V=X.defaultView,ee=V.navigation&&V.navigation.transition,ke=X.fonts.status;l();var De=[];if(ke==="loaded"&&(p2(X),X.fonts.status==="loading"&&De.push(X.fonts.ready)),ke=De.length,e!==null)for(var Xe=e.suspenseyImages,Q=0,H=0;H<Xe.length;H++){var W=Xe[H];if(!W.complete){var ge=W.getBoundingClientRect();if(0<ge.bottom&&0<ge.right&&ge.top<V.innerHeight&&ge.left<V.innerWidth){if(Q+=Sy(W),Q>sc){De.length=ke;break}W=new Promise(g2.bind(W)),De.push(W)}}}if(0<De.length)return V=Promise.race([Promise.all(De),new Promise(function(Ee){return setTimeout(Ee,500)})]).then(c,c),(ee?Promise.allSettled([ee.finished,V]):V).then(u,u);if(c(),ee)return ee.finished.then(u,u);u()},types:a});X.__reactViewTransition=ae;var xe=[];return ae.ready.then(function(){for(var V=X.documentElement.getAnimations({subtree:!0}),ee=0;ee<V.length;ee++){var ke=V[ee],De=ke.effect,Xe=De.pseudoElement;if(Xe!=null&&Xe.startsWith("::view-transition")){xe.push(ke),ke=De.getKeyframes();for(var Q=Xe=void 0,H=!0,W=0;W<ke.length;W++){var ge=ke[W],Ee=ge.width;if(Xe===void 0)Xe=Ee;else if(Xe!==Ee){H=!1;break}if(Ee=ge.height,Q===void 0)Q=Ee;else if(Q!==Ee){H=!1;break}delete ge.width,delete ge.height,ge.transform==="none"&&delete ge.transform}H&&Xe!==void 0&&Q!==void 0&&(De.setKeyframes(ke),H=getComputedStyle(De.target,De.pseudoElement),H.width!==Xe||H.height!==Q)&&(H=ke[0],H.width=Xe,H.height=Q,H=ke[ke.length-1],H.width=Xe,H.height=Q,De.setKeyframes(ke))}}g()},function(V){X.__reactViewTransition===ae&&(X.__reactViewTransition=null);try{if(typeof V=="object"&&V!==null)switch(V.name){case"InvalidStateError":(V.message==="View transition was skipped because document visibility state is hidden."||V.message==="Skipping view transition because document visibility state has become hidden."||V.message==="Skipping view transition because viewport size changed."||V.message==="Transition was aborted because of invalid state")&&(V=null)}V!==null&&D(V)}finally{l(),c(),g()}}),ae.finished.finally(function(){for(var V=0;V<xe.length;V++)xe[V].cancel();X.__reactViewTransition===ae&&(X.__reactViewTransition=null),w()}),ae}catch{return l(),c(),g(),null}}function nl(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}nl.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:M({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},nl.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,a=e.getAnimations({subtree:!0}),l=[],c=0;c<a.length;c++){var u=a[c].effect;u!==null&&u.target===e&&u.pseudoElement===t&&l.push(a[c])}return l},nl.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function ny(e){return{name:e,group:new nl("group",e),imagePair:new nl("image-pair",e),old:new nl("old",e),new:new nl("new",e)}}function Dn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Dn.prototype.addEventListener=function(e,t,a){var l=null,c=null;if(!(a!=null&&typeof a!="boolean"&&(l=a.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var u=this._eventListeners;if(sy(u,e,t,a)===-1){var g=this,w=t;a!=null&&typeof a!="boolean"&&a.once===!0&&(w=function(D){g.removeEventListener(e,t,a),typeof t=="function"?t.call(this,D):t.handleEvent(D)}),l!==null&&(c=g.removeEventListener.bind(g,e,t,a),l.addEventListener("abort",c,{once:!0}),c=l.removeEventListener.bind(l,"abort",c)),l=ii(a),u.push({type:e,listener:t,optionsOrUseCapture:a,attachedListener:w,cleanup:c}),v(this._fragmentFiber.child,!1,y2,e,w,l)}this._eventListeners=u}};function y2(e,t,a,l){return j(e).addEventListener(t,a,l),!1}Dn.prototype.removeEventListener=function(e,t,a){var l=this._eventListeners;if(l!==null&&(t=sy(l,e,t,a),t!==-1)){var c=l[t];a=c.attachedListener;var u=c.cleanup;c=ii(c.optionsOrUseCapture),v(this._fragmentFiber.child,!1,b2,e,a,c),l.splice(t,1),u!==null&&u()}};function b2(e,t,a,l){return j(e).removeEventListener(t,a,l),!1}function ii(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function ay(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function sy(e,t,a,l){if(e.length===0)return-1;l=ay(l);for(var c=0;c<e.length;c++){var u=e[c];if(u.type===t&&u.listener===a&&ay(u.optionsOrUseCapture)===l)return c}return-1}Dn.prototype.dispatchEvent=function(e){var t=S(this._fragmentFiber);if(t===null)return!0;t=j(t);var a=this._eventListeners;if(a!==null&&0<a.length||!e.bubbles){var l=t.nodeType===9?t.createComment(""):document.createTextNode("");if(a)for(var c=0;c<a.length;c++){var u=a[c];l.addEventListener(u.type,u.attachedListener,ii(u.optionsOrUseCapture))}if(t.appendChild(l),e=l.dispatchEvent(e),a)for(c=0;c<a.length;c++)u=a[c],l.removeEventListener(u.type,u.attachedListener,ii(u.optionsOrUseCapture));return t.removeChild(l),e}return t.dispatchEvent(e)},Dn.prototype.focus=function(e){v(this._fragmentFiber.child,!0,ly,e,void 0,void 0)};function ly(e,t){return e.tag===6?!1:(e=j(e),D2(e,t))}Dn.prototype.focusLast=function(e){var t=[];v(this._fragmentFiber.child,!0,gf,t,void 0,void 0);for(var a=t.length-1;0<=a&&!ly(t[a],e);a--);};function gf(e,t){return t.push(e),!1}Dn.prototype.blur=function(){var e=S(this._fragmentFiber);e!==null&&(e=j(e),e=ur(e).activeElement,e!==null&&v(this._fragmentFiber.child,!1,v2,e,void 0,void 0))};function v2(e,t){return e.tag===6?!1:(e=j(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Dn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),v(this._fragmentFiber.child,!1,w2,e,void 0,void 0)};function w2(e,t){return e.tag===6||(e=j(e),t.observe(e)),!1}Dn.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),v(this._fragmentFiber.child,!1,S2,e,void 0,void 0);for(var a=t=0;a<ta.length;a++){var l=ta[a];l.fragmentInstance===this&&l.observer===e?e.unobserve(l.instance):ta[t++]=l}ta.length=t}};function S2(e,t){return e.tag===6||(e=j(e),t.unobserve(e)),!1}var ta=[],xf=!1;function k2(e,t,a){ta.push({fragmentInstance:e,observer:t,instance:a}),xf||(xf=!0,M2(function(){xf=!1;var l=ta;ta=[];for(var c=0;c<l.length;c++){var u=l[c];u.observer.unobserve(u.instance)}}))}Dn.prototype.getClientRects=function(){var e=[];return v(this._fragmentFiber.child,!1,j2,e,void 0,void 0),e};function j2(e,t){if(e.tag===6){e=e.stateNode;var a=e.ownerDocument.createRange();a.selectNodeContents(e),t.push.apply(t,a.getClientRects())}else e=j(e),t.push.apply(t,e.getClientRects());return!1}Dn.prototype.getRootNode=function(e){var t=S(this._fragmentFiber);return t===null?this:j(t).getRootNode(e)},Dn.prototype.compareDocumentPosition=function(e){var t=S(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var a=[];v(this._fragmentFiber.child,!1,gf,a,void 0,void 0);var l=j(t);if(a.length===0){if(a=l,A(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(a=t)}t=this._fragmentFiber;var c=l=a.compareDocumentPosition(e);return a===e?c=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(a=k(t)[1],a===null?c=Node.DOCUMENT_POSITION_PRECEDING:(e=j(a).compareDocumentPosition(e),c=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),c|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=j(a[0]),c=j(a[a.length-1]);var u=A(this._fragmentFiber)?t.parentElement:l;if(u==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=u.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,u=u.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_CONTAINED_BY;var g=t.compareDocumentPosition(e),w=c.compareDocumentPosition(e),D=g&Node.DOCUMENT_POSITION_CONTAINED_BY||w&Node.DOCUMENT_POSITION_CONTAINED_BY;return w=l&&u&&g&Node.DOCUMENT_POSITION_FOLLOWING&&w&Node.DOCUMENT_POSITION_PRECEDING,t=l&&t===e||u&&c===e||D||w?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&t===e||!u&&c===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:g,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||N2(t,this._fragmentFiber,a[0],a[a.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function N2(e,t,a,l,c){var u=Ls(c);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(a=!!u)e:{for(;u!==null;){if(u.tag===7&&(u===t||u.alternate===t)){a=!0;break e}u=u.return}a=!1}return a}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(u===null)return u=c.ownerDocument,c===u||c===u.documentElement||c===u.body;e:{for(u=t,t=S(t);u!==null;){if(!(u.tag!==5&&u.tag!==3&&u.tag!==27||u!==t&&u.alternate!==t)){u=!0;break e}u=u.return}u=!1}return u}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!u)&&!(t=u===a)&&(t=U(a,u,ne),t===null?t=!1:(v(t,!0,G,u,a),u=L,L=null,t=u!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!u)&&!(t=u===l)&&(t=U(l,u,ne),t===null?t=!1:(v(t,!0,R,u,l),u=L,_=L=null,t=u!==null)),t):!1}function iy(e,t){var a=e.ownerDocument.createRange();a.selectNodeContents(e),e=a.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Dn.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(o(566));var t=[];v(this._fragmentFiber.child,!1,gf,t,void 0,void 0);var a=e!==!1;if(t.length===0){var l=k(this._fragmentFiber);if(l=a?l[1]||l[0]||S(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){e=j(l),iy(e,a);return}if(l=j(l),l.nodeType!==9){if(l.nodeType===11){a="host"in l?l.host:null,a!==null&&a.scrollIntoView(e);return}l.scrollIntoView(e)}}for(l=a?t.length-1:0;l!==(a?-1:t.length);){var c=t[l];c.tag===6?(c=j(c),iy(c,a)):j(c).scrollIntoView(e),l+=a?-1:1}};function C2(e,t){return e=j(e),ry(e,t),!1}function ry(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function oy(e,t){var a=t._eventListeners;if(a!==null)for(var l=0;l<a.length;l++){var c=a[l];e.addEventListener(c.type,c.attachedListener,ii(c.optionsOrUseCapture))}e.nodeType!==3&&(a=t._observers,a!==null&&a.forEach(function(u){for(var g=0,w=0;w<ta.length;w++){var D=ta[w];(D.fragmentInstance!==t||D.observer!==u||D.instance!==e)&&(ta[g++]=D)}ta.length=g,u.observe(e)}),ry(e,t))}function E2(e,t){var a=t._eventListeners;if(a!==null)for(var l=0;l<a.length;l++){var c=a[l];e.removeEventListener(c.type,c.attachedListener,ii(c.optionsOrUseCapture))}e.nodeType!==3&&(a=t._observers,a!==null&&a.forEach(function(u){typeof u.rootMargin=="string"?k2(t,u,e):u.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function yf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":yf(a),Vr(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function A2(e,t,a,l){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Ai])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=qn(e.nextSibling),e===null)break}return null}function T2(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=qn(e.nextSibling),e===null))return null;return e}function cy(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=qn(e.nextSibling),e===null))return null;return e}function bf(e){return e.data==="$?"||e.data==="$~"}function vf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function _2(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var l=function(){t(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function qn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var wf=null;function uy(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return qn(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function dy(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function D2(e,t){function a(){l=!0}if(e.ownerDocument.activeElement===e)return!0;var l=!1;try{e.ownerDocument.addEventListener("focus",a,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",a,!0)}return l}function M2(e){$x(function(){$x(function(t){return e(t)})})}function fy(e,t,a){switch(t=ur(a),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function my(e,t,a){for(var l in a){var c=a[l];a.hasOwnProperty(l)&&c!=null&&gt(e,t,l,null,r2,c)}a.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===ia&&(e.onclick=null),Vr(e)}function Sf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Vr(e)}var Fn=new Map,hy=new Set;function dr(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Ua=Se.d;Se.d={f:R2,r:z2,D:L2,C:O2,L:B2,m:U2,X:P2,S:H2,M:q2};function R2(){var e=Ua.f(),t=Xo();return e||t}function z2(e){var t=Nl(e);t!==null&&t.tag===5&&t.type==="form"?gg(t):Ua.r(e)}var ri=typeof document>"u"?null:document;function py(e,t,a){var l=ri;if(l&&typeof t=="string"&&t){var c=zn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),hy.has(c)||(hy.add(c),e={rel:e,crossOrigin:a,href:t},l.querySelector(c)===null&&(t=l.createElement("link"),tn(t,"link",e),It(t),l.head.appendChild(t)))}}function L2(e){Ua.D(e),py("dns-prefetch",e,null)}function O2(e,t){Ua.C(e,t),py("preconnect",e,t)}function B2(e,t,a){Ua.L(e,t,a);var l=ri;if(l&&e&&t){var c='link[rel="preload"][as="'+zn(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+zn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+zn(a.imageSizes)+'"]')):c+='[href="'+zn(e)+'"]';var u=c;switch(t){case"style":u=oi(e);break;case"script":u=ci(e)}if(!(Fn.has(u)||(e=M({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Fn.set(u,e),l.querySelector(c)!==null||t==="style"&&l.querySelector(fr(u))||t==="script"&&l.querySelector(mr(u))))){var g=l.createElement("link");tn(g,"link",e),t==="style"&&(g[Ir]=!0,g.onload=g.onerror=function(){Ah(g)}),It(g),l.head.appendChild(g)}}}function U2(e,t){Ua.m(e,t);var a=ri;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+zn(l)+'"][href="'+zn(e)+'"]',u=c;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=ci(e)}if(!Fn.has(u)&&(e=M({rel:"modulepreload",href:e},t),Fn.set(u,e),a.querySelector(c)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(mr(u)))return}l=a.createElement("link"),tn(l,"link",e),It(l),a.head.appendChild(l)}}}function H2(e,t,a){Ua.S(e,t,a);var l=ri;if(l&&e){var c=Cl(l).hoistableStyles,u=oi(e);t=t||"default";var g=c.get(u);if(!g){var w={loading:0,preload:null};if(g=l.querySelector(fr(u)))w.loading=5;else{e=M({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Fn.get(u))&&kf(e,a);var D=g=l.createElement("link");It(D),tn(D,"link",e),D._p=new Promise(function(X,ae){D.onload=X,D.onerror=ae}),D.addEventListener("load",function(){w.loading|=1}),D.addEventListener("error",function(){w.loading|=2}),w.loading|=4,nc(g,t,l)}g={type:"stylesheet",instance:g,count:1,state:w},c.set(u,g)}}}function P2(e,t){Ua.X(e,t);var a=ri;if(a&&e){var l=Cl(a).hoistableScripts,c=ci(e),u=l.get(c);u||(u=a.querySelector(mr(c)),u||(e=M({src:e,async:!0},t),(t=Fn.get(c))&&jf(e,t),u=a.createElement("script"),It(u),tn(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(c,u))}}function q2(e,t){Ua.M(e,t);var a=ri;if(a&&e){var l=Cl(a).hoistableScripts,c=ci(e),u=l.get(c);u||(u=a.querySelector(mr(c)),u||(e=M({src:e,async:!0,type:"module"},t),(t=Fn.get(c))&&jf(e,t),u=a.createElement("script"),It(u),tn(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(c,u))}}function gy(e,t,a,l){var c=(c=Ke.current)?dr(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(a=oi(a.href),t=Cl(c).hoistableStyles,l=t.get(a),l||(l={type:"style",instance:null,count:0,state:null},t.set(a,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=oi(a.href);var u=Cl(c).hoistableStyles,g=u.get(e);if(g||(c=c.ownerDocument||c,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,g),(u=c.querySelector(fr(e)))?u._p||(g.instance=u,g.state.loading=5):(u=Fn.get(e),u||(u={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Fn.set(e,u)),F2(c,e,u,g.state))),t&&l===null)throw Error(o(528,""));return g}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(a=ci(a),t=Cl(c).hoistableScripts,l=t.get(a),l||(l={type:"script",instance:null,count:0,state:null},t.set(a,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function oi(e){return'href="'+zn(e)+'"'}function fr(e){return'link[rel="stylesheet"]['+e+"]"}function xy(e){return M({},e,{"data-precedence":e.precedence,precedence:null})}function F2(e,t,a,l){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Ir]!==!0){l.loading=1;return}}else t=e.createElement("link"),t[Ir]=!0,t.onload=t.onerror=Ah.bind(null,t),tn(t,"link",a),It(t),e.head.appendChild(t);l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2})}function ci(e){return'[src="'+zn(e)+'"]'}function mr(e){return"script[async]"+e}function yy(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+zn(a.href)+'"]');if(l)return t.instance=l,It(l),l;var c=M({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),It(l),tn(l,"style",c),nc(l,a.precedence,e),t.instance=l;case"stylesheet":c=oi(a.href);var u=e.querySelector(fr(c));if(u)return t.state.loading|=4,t.instance=u,It(u),u;l=xy(a),(c=Fn.get(c))&&kf(l,c),u=(e.ownerDocument||e).createElement("link"),It(u);var g=u;return g._p=new Promise(function(w,D){g.onload=w,g.onerror=D}),tn(u,"link",l),t.state.loading|=4,nc(u,a.precedence,e),t.instance=u;case"script":return u=ci(a.src),(c=e.querySelector(mr(u)))?(t.instance=c,It(c),c):(l=a,(c=Fn.get(u))&&(l=M({},a),jf(l,c)),e=e.ownerDocument||e,c=e.createElement("script"),It(c),tn(c,"link",l),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,nc(l,a.precedence,e));return t.instance}function nc(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=l.length?l[l.length-1]:null,u=c,g=0;g<l.length;g++){var w=l[g];if(w.dataset.precedence===t)u=w;else if(u!==c)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function kf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function jf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ac=null;function by(e,t,a){if(ac===null){var l=new Map,c=ac=new Map;c.set(a,l)}else c=ac,l=c.get(a),l||(l=new Map,c.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var u=a[c];if(!(u[Ai]||u[Zt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var g=u.getAttribute(t)||"";g=e+g;var w=l.get(g);w?w.push(u):l.set(g,[u])}}return l}function Nf(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function G2(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function vy(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function wy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Sy(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function ky(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=Sy(t),e.suspenseyImages.push(t)),e=K2.bind(e),t.decode().then(e,e))}function I2(e,t,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=oi(l.href),u=t.querySelector(fr(c));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=hr.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=u,It(u);return}u=t.ownerDocument||t,l=xy(l),(c=Fn.get(c))&&kf(l,c),u=u.createElement("link"),It(u);var g=u;g._p=new Promise(function(w,D){g.onload=w,g.onerror=D}),tn(u,"link",l),a.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=hr.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var sc=0;function V2(e,t){return e.stylesheets&&e.count===0&&ic(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var l=setTimeout(function(){if(e.stylesheets&&ic(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&sc===0&&(sc=62500*c2());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ic(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>sc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(c)}}:null}function jy(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ic(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function hr(){this.count--,jy(this)}function K2(){this.imgCount--,jy(this)}var lc=null;function ic(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,lc=new Map,t.forEach(Y2,e),lc=null,hr.call(e))}function Y2(e,t){if(!(t.state.loading&4)){var a=lc.get(e);if(a)var l=a.get(null);else{a=new Map,lc.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<c.length;u++){var g=c[u];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(a.set(g.dataset.precedence,g),l=g)}l&&a.set(null,l)}c=t.instance,g=c.getAttribute("data-precedence"),u=a.get(g)||l,u===l&&a.set(null,c),a.set(g,c),this.count++,l=hr.bind(this),c.addEventListener("load",l),c.addEventListener("error",l),u?u.parentNode.insertBefore(c,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var ui={$$typeof:z,Provider:null,Consumer:null,_currentValue:it,_currentValue2:it,_threadCount:0};function Q2(e,t,a,l,c,u,g,w,D){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=su(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=su(0),this.hiddenUpdates=su(null),this.identifierPrefix=l,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.transitionTypes=null,this.incompleteTransitions=new Map}function Ny(e,t,a,l,c,u,g,w,D,X,ae,xe){return e=new Q2(e,t,a,g,D,X,ae,xe,w),t=1,u===!0&&(t|=24),u=hn(3,null,null,t),e.current=u,u.stateNode=e,t=Hu(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:l,isDehydrated:a,cache:t},Gu(u),e}function Cy(e){return e?(e=Ol,e):Ol}function Ey(e,t,a,l,c,u){c=Cy(c),l.context===null?l.context=c:l.pendingContext=c,l=ss(t),l.payload={element:a},u=u===void 0?null:u,u!==null&&(l.callback=u),a=ls(e,l,t),a!==null&&(yn(a,e,t),Vi(a,e,t))}function Ay(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Cf(e,t){Ay(e,t),(e=e.alternate)&&Ay(e,t)}function Ty(e){if(e.tag===13||e.tag===31){var t=Hs(e,67108864);t!==null&&yn(t,e,67108864),Cf(e,67108864)}}function _y(e){if(e.tag===13||e.tag===31){var t=_n();t=lu(t);var a=Hs(e,t);a!==null&&yn(a,e,t),Cf(e,t)}}var di=!0;function X2(e,t,a,l){var c=be.T;be.T=null;var u=Se.p;try{Se.p=2,Ef(e,t,a,l)}finally{Se.p=u,be.T=c}}function Z2(e,t,a,l){var c=be.T;be.T=null;var u=Se.p;try{Se.p=8,Ef(e,t,a,l)}finally{Se.p=u,be.T=c}}function Ef(e,t,a,l){if(di){var c=Af(l);if(c===null)of(e,t,l,rc,a),My(e,l);else if(J2(c,e,t,a,l))l.stopPropagation();else if(My(e,l),t&4&&-1<$2.indexOf(e)){for(;c!==null;){var u=Nl(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var g=Xn(u.pendingLanes);if(g!==0){var w=u;for(w.pendingLanes|=2,w.entangledLanes|=2;g;){var D=1<<31-Ne(g);w.entanglements[1]|=D,g&=~D}ga(u),(ct&6)===0&&(Ko=Ht()+500,rr(0))}}break;case 31:case 13:w=Hs(u,2),w!==null&&yn(w,u,2),Xo(),Cf(u,2)}if(u=Af(l),u===null&&of(e,t,l,rc,a),u===c)break;c=u}c!==null&&l.stopPropagation()}else of(e,t,l,null,a)}}function Af(e){return e=fu(e),Tf(e)}var rc=null;function Tf(e){if(rc=null,e=Ls(e),e!==null){var t=f(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===31){if(e=p(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return rc=e,null}function Dy(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ya()){case zs:return 2;case Qa:return 8;case ka:case Sl:return 32;case Xa:return 268435456;default:return 32}default:return 32}}var _f=!1,xs=null,ys=null,bs=null,pr=new Map,gr=new Map,vs=[],$2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function My(e,t){switch(e){case"focusin":case"focusout":xs=null;break;case"dragenter":case"dragleave":ys=null;break;case"mouseover":case"mouseout":bs=null;break;case"pointerover":case"pointerout":pr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":gr.delete(t.pointerId)}}function xr(e,t,a,l,c,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:u,targetContainers:[c]},t!==null&&(t=Nl(t),t!==null&&Ty(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function J2(e,t,a,l,c){switch(t){case"focusin":return xs=xr(xs,e,t,a,l,c),!0;case"dragenter":return ys=xr(ys,e,t,a,l,c),!0;case"mouseover":return bs=xr(bs,e,t,a,l,c),!0;case"pointerover":var u=c.pointerId;return pr.set(u,xr(pr.get(u)||null,e,t,a,l,c)),!0;case"gotpointercapture":return u=c.pointerId,gr.set(u,xr(gr.get(u)||null,e,t,a,l,c)),!0}return!1}function Ry(e){var t=Ls(e.target);if(t!==null){var a=f(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,Nh(e.priority,function(){_y(a)});return}}else if(t===31){if(t=p(a),t!==null){e.blockedOn=t,Nh(e.priority,function(){_y(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function oc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Af(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);du=l,a.target.dispatchEvent(l),du=null}else return t=Nl(a),t!==null&&Ty(t),e.blockedOn=a,!1;t.shift()}return!0}function zy(e,t,a){oc(e)&&a.delete(t)}function W2(){_f=!1,xs!==null&&oc(xs)&&(xs=null),ys!==null&&oc(ys)&&(ys=null),bs!==null&&oc(bs)&&(bs=null),pr.forEach(zy),gr.forEach(zy)}function cc(e,t){e.blockedOn===t&&(e.blockedOn=null,_f||(_f=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,W2)))}var uc=null;function Ly(e){uc!==e&&(uc=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){uc===e&&(uc=null);for(var t=0;t<e.length;t+=3){var a=e[t],l=e[t+1],c=e[t+2];if(typeof l!="function"){if(Tf(l||a)===null)continue;break}var u=Nl(a);u!==null&&(e.splice(t,3),t-=3,ud(u,{pending:!0,data:c,method:a.method,action:l},l,c))}}))}function fi(e){function t(D){return cc(D,e)}xs!==null&&cc(xs,e),ys!==null&&cc(ys,e),bs!==null&&cc(bs,e),pr.forEach(t),gr.forEach(t);for(var a=0;a<vs.length;a++){var l=vs[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<vs.length&&(a=vs[0],a.blockedOn===null);)Ry(a),a.blockedOn===null&&vs.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var c=a[l],u=a[l+1],g=c[mn]||null;if(typeof u=="function")g||Ly(a);else if(g){var w=null;if(u&&u.hasAttribute("formAction")){if(c=u,g=u[mn]||null)w=g.formAction;else if(Tf(c)!==null)continue}else w=g.action;typeof w=="function"?a[l+1]=w:(a.splice(l,3),l-=3),Ly(a)}}}function Oy(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(g){return c=g})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Df(e){this._internalRoot=e}dc.prototype.render=Df.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var a=t.current,l=_n();Ey(a,l,e,t,null,null)},dc.prototype.unmount=Df.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ey(e.current,2,null,e,null,null),Xo(),t[jl]=null}};function dc(e){this._internalRoot=e}dc.prototype.unstable_scheduleHydration=function(e){if(e){var t=jh();e={blockedOn:null,target:e,priority:t};for(var a=0;a<vs.length&&t!==0&&t<vs[a].priority;a++);vs.splice(a,0,e),a===0&&Ry(e)}};var By=i.version;if(By!=="19.3.0")throw Error(o(527,By,"19.3.0"));Se.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=b(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var ek={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:be,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fc.isDisabled&&fc.supportsFiber)try{Me=fc.inject(ek),He=fc}catch{}}return br.createRoot=function(e,t){if(!d(e))throw Error(o(299));var a=!1,l="",c=Cg,u=Eg,g=Ag;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(g=t.onRecoverableError)),t=Ny(e,1,!1,null,null,a,l,null,c,u,g,Oy),e[jl]=t.current,rf(e),new Df(t)},br.hydrateRoot=function(e,t,a){if(!d(e))throw Error(o(299));var l=!1,c="",u=Cg,g=Eg,w=Ag,D=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(u=a.onUncaughtError),a.onCaughtError!==void 0&&(g=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError),a.formState!==void 0&&(D=a.formState)),t=Ny(e,1,!0,t,a??null,l,c,D,u,g,w,Oy),t.context=Cy(null),a=t.current,l=_n(),l=lu(l),c=ss(l),c.callback=null,ls(a,c,l),a=l,t.current.lanes=a,Ei(t,a),ga(t),e[jl]=t.current,rf(e),new dc(t)},br.version="19.3.0",br}var Qy;function fk(){if(Qy)return zf.exports;Qy=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),zf.exports=dk(),zf.exports}var mk=fk();const hk=$m(mk);class Dt extends Error{constructor(i,r,o){super(r),this.status=i,this.data=o,this.name="ApiError"}get code(){var i;return(i=this.data)==null?void 0:i.code}}async function Ns(n,i={}){const r=n.startsWith("/dashboard/api")?n:`/dashboard/api${n.startsWith("/")?n:`/${n}`}`,o={...i.body instanceof Blob?{}:{"Content-Type":"application/json"},...i.headers},d=await fetch(r,{...i,headers:o});if(d.status===401)throw window.location.href="/login",new Dt(401,"Session expired, redirecting to login...");const f=await d.json().catch(()=>null);if(!d.ok)throw new Dt(d.status,(f==null?void 0:f.error)||(f==null?void 0:f.message)||`HTTP ${d.status}: Request failed`,f);return f}function pk(n){if(!n)return null;const i=/filename\*=UTF-8''([^;]+)/i.exec(n);if(i!=null&&i[1])try{return decodeURIComponent(i[1])}catch{return i[1]}const r=/filename="([^"]*)"/.exec(n);return(r==null?void 0:r[1])||null}async function mc(n,i="GET",r){const o=new AbortController,d=setTimeout(()=>o.abort(),2e4);try{return await Ns(n,{method:i,body:r?JSON.stringify(r):void 0,signal:o.signal})}finally{clearTimeout(d)}}async function Xy(n,i={}){const r=await fetch(`/dashboard/api${n}`,i);if(r.status===401)throw window.location.href="/login",new Dt(401,"Session expired");if(!r.ok){const o=await r.json().catch(()=>null);throw new Dt(r.status,(o==null?void 0:o.error)||"Sticker operation failed",o)}return{blob:await r.blob(),fileName:pk(r.headers.get("Content-Disposition")),animated:r.headers.get("X-Levix-Animated")==="1"}}const $={get:n=>Ns(n,{method:"GET"}),post:(n,i)=>Ns(n,{method:"POST",body:i?JSON.stringify(i):void 0}),patch:(n,i)=>Ns(n,{method:"PATCH",body:i?JSON.stringify(i):void 0}),put:(n,i)=>Ns(n,{method:"PUT",body:i?JSON.stringify(i):void 0}),delete:n=>Ns(n,{method:"DELETE"}),getStats:()=>$.get("/stats"),getSession:()=>$.get("/bot/session"),startSession:n=>$.post("/bot/session/start",n),reconnectSession:()=>$.post("/bot/session/reconnect"),stopSession:()=>$.post("/bot/session/stop"),unlinkSession:()=>$.post("/bot/logout"),restartBot:()=>$.post("/bot/restart"),getSettings:()=>$.get("/settings"),updateSetting:(n,i)=>$.patch("/settings",{key:n,value:i}),updatePrefix:n=>$.patch("/settings",{key:"prefix",value:n}),exportSettings:()=>$.get("/settings/export"),importSettings:n=>$.post("/settings/import",n),getCommands:()=>$.get("/commands"),updateCommand:(n,i)=>$.patch(`/commands/${encodeURIComponent(n)}`,i),postMultipart:(n,i,r)=>new Promise((o,d)=>{const f=new FormData;for(const[p,h]of Object.entries(i))h!=null&&h!==""&&f.set(p,h);f.set("file",r);const m=new XMLHttpRequest;m.open("POST",`/dashboard/api${n}`),m.responseType="json",m.onload=()=>{const p=m.response&&typeof m.response=="object"?m.response:null;if(m.status===401){window.location.href="/login",d(new Dt(401,"Session expired"));return}m.status>=200&&m.status<300?o(p):d(new Dt(m.status,(p==null?void 0:p.error)||(p==null?void 0:p.message)||`HTTP ${m.status}: Request failed`,p))},m.onerror=()=>d(new Dt(0,"Network error")),m.send(f)}),getSchedules:()=>$.get("/schedules"),createSchedule:n=>$.post("/schedules",n),deleteSchedule:n=>$.delete(`/schedules/${encodeURIComponent(n)}`),retrySchedule:n=>$.post(`/schedules/${encodeURIComponent(n)}/retry`),getGroups:()=>$.get("/groups"),updateGroup:(n,i)=>$.patch(`/groups/${encodeURIComponent(n)}`,i),previewModeration:n=>$.post("/groups/moderation-preview",n),kickFlagged:(n,i)=>$.post(`/groups/${encodeURIComponent(n)}/flagged/kick`,{user_id:i}),clearFlagged:(n,i)=>$.post(`/groups/${encodeURIComponent(n)}/flagged/clear`,{user_id:i}),dismissFlagged:(n,i)=>$.post(`/groups/${encodeURIComponent(n)}/flagged/dismiss`,{user_id:i}),getPersona:()=>$.get("/ai/persona"),updatePersona:n=>$.put("/ai/persona",{body:n}),getMemoryFiles:()=>$.get("/ai/memory"),getMemoryFile:n=>$.get(`/ai/memory/${encodeURIComponent(n)}`),updateMemoryFile:(n,i)=>$.put(`/ai/memory/${encodeURIComponent(n)}`,{content:i}),deleteMemoryFile:n=>$.delete(`/ai/memory/${encodeURIComponent(n)}`),getAiConversations:()=>$.get("/ai/conversations"),getAiConversation:n=>$.get(`/ai/conversations/${encodeURIComponent(n)}`),getRecipients:()=>$.get("/recipients"),fetchAiModels:n=>$.post("/ai/models",n||{}),changePassword:(n,i)=>$.post("/security/password",{current:n,next:i}),getRecoveryEmail:()=>mc("/recovery-email"),startRecoveryEmail:(n,i,r)=>mc("/recovery-email/start","POST",{email:n,current:i,lang:r}),verifyRecoveryEmail:n=>mc("/recovery-email/verify","POST",{code:n}),deleteRecoveryEmail:()=>mc("/recovery-email","DELETE"),getFeedbackMeta:()=>$.get("/feedback/meta"),getFeedbackDiagnosticsPreview:n=>$.post("/feedback/diagnostics-preview",{client:n}),sendFeedback:n=>$.post("/feedback",n),sendFeedbackMultipart:(n,i,r)=>new Promise((o,d)=>{const f=new FormData;f.set("message",n.message),f.set("topic",n.topic),n.rating&&f.set("rating",String(n.rating)),n.contact&&f.set("contact",n.contact),n.diagnostics&&f.set("diagnostics",JSON.stringify(n.diagnostics)),n.debugLogId&&f.set("debugLogId",n.debugLogId),f.set("file",i,i.name);const m=new XMLHttpRequest;m.open("POST","/dashboard/api/feedback"),m.responseType="json",m.upload.onprogress=p=>{p.lengthComputable&&r&&r(p.loaded/p.total)},m.onload=()=>{const p=m.response&&typeof m.response=="object"?m.response:null;if(m.status===401){window.location.href="/login",d(new Dt(401,"Session expired"));return}m.status>=200&&m.status<300?o(p??{success:!0}):d(new Dt(m.status,(p==null?void 0:p.error)||(p==null?void 0:p.message)||`HTTP ${m.status}: Request failed`,p))},m.onerror=()=>d(new Dt(0,"Network error")),m.send(f)}),getCrashReports:()=>$.get("/crash-reports"),submitCrashReport:n=>$.post("/crash-reports",n),sendCrashReport:(n,i)=>$.post(`/crash-reports/${encodeURIComponent(n)}/send`,{...i?{debugLogId:i}:{}}),deleteCrashReport:n=>$.delete(`/crash-reports/${encodeURIComponent(n)}`),deleteAllCrashReports:()=>$.delete("/crash-reports"),clearLogs:()=>$.delete("/logs"),getLogs:()=>$.get("/logs"),getStickerCapabilities:()=>$.get("/stickers/capabilities"),getStickers:n=>{const i=new URLSearchParams;return n.q&&i.set("q",n.q),n.sort&&i.set("sort",n.sort),n.filter&&i.set("filter",n.filter),n.pack&&i.set("pack",n.pack),n.offset!==void 0&&i.set("offset",n.offset.toString()),n.limit!==void 0&&i.set("limit",n.limit.toString()),$.get(`/stickers?${i.toString()}`)},uploadStickerSource:(n,i)=>{const r={};return i&&(r["X-Filename"]=encodeURIComponent(i)),Ns("/stickers/uploads",{method:"POST",body:n,headers:r})},uploadExistingStickerSource:n=>Ns(`/stickers/${encodeURIComponent(n)}/uploads`,{method:"POST"}),createStickerJob:n=>$.post("/stickers/jobs",n),getStickerJob:n=>$.get(`/stickers/jobs/${encodeURIComponent(n)}`),exportSticker:(n,i)=>Xy(`/stickers/${encodeURIComponent(n)}/export?format=${i}`),exportStickers:(n,i)=>Xy("/stickers/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:n,format:i})}),updateSticker:(n,i)=>$.patch(`/stickers/${encodeURIComponent(n)}`,i),deleteSticker:(n,i)=>$.delete(`/stickers/${encodeURIComponent(n)}${i?"?confirm=1":""}`),bulkStickers:n=>$.post("/stickers/bulk",n),sendStickers:n=>$.post("/stickers/send",n),getPacks:()=>$.get("/sticker-packs"),createPack:n=>$.post("/sticker-packs",{name:n}),getPack:n=>$.get(`/sticker-packs/${encodeURIComponent(n)}`),updatePack:(n,i)=>$.patch(`/sticker-packs/${encodeURIComponent(n)}`,{name:i}),deletePack:(n,i)=>$.delete(`/sticker-packs/${encodeURIComponent(n)}${i?"?deleteStickers=1":""}`),reorderPack:(n,i)=>$.put(`/sticker-packs/${encodeURIComponent(n)}/order`,{ids:i}),mergePack:(n,i)=>$.post(`/sticker-packs/${encodeURIComponent(n)}/merge`,{intoPackId:i}),listAutoDeleteRules:()=>$.get("/auto-delete/rules"),createAutoDeleteRule:n=>$.post("/auto-delete/rules",n),updateAutoDeleteRule:(n,i)=>$.patch(`/auto-delete/rules/${n}`,i),deleteAutoDeleteRule:n=>$.delete(`/auto-delete/rules/${n}`),resetAutoDeleteRule:n=>$.post(`/auto-delete/rules/${n}/reset`),listAutoDeleteLog:(n={})=>{const i=new URLSearchParams;n.ruleId&&i.set("ruleId",n.ruleId),n.limit!==void 0&&i.set("limit",String(n.limit)),n.offset!==void 0&&i.set("offset",String(n.offset));const r=i.toString();return $.get(`/auto-delete/log${r?`?${r}`:""}`)},clearAutoDeleteLog:n=>$.delete(n?`/auto-delete/log?ruleId=${encodeURIComponent(n)}`:"/auto-delete/log")};/**
50
- * @license lucide-react v1.46.0 - ISC
51
- *
52
- * This source code is licensed under the ISC license.
53
- * See the LICENSE file in the root directory of this source tree.
54
- */const gk=n=>n==null?void 0:n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
55
- * @license lucide-react v1.46.0 - ISC
56
- *
57
- * This source code is licensed under the ISC license.
58
- * See the LICENSE file in the root directory of this source tree.
59
- */function xk(n,i,r=[]){if(i==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:gk(n),size:24,node:i,...r.length>0?{aliases:r}:{}}}/**
60
- * @license lucide-react v1.46.0 - ISC
61
- *
62
- * This source code is licensed under the ISC license.
63
- * See the LICENSE file in the root directory of this source tree.
64
- */const yk=n=>{let i="",r=!1;for(const o of n){if(o==="-"||o==="_"||o<=" "){r=i.length>0;continue}i.length===0?i+=o.toLowerCase():i+=r?o.toUpperCase():o,r=!1}return i};/**
65
- * @license lucide-react v1.46.0 - ISC
66
- *
67
- * This source code is licensed under the ISC license.
68
- * See the LICENSE file in the root directory of this source tree.
69
- */const bk=n=>{const i=yk(n);return i.charAt(0).toUpperCase()+i.slice(1)};/**
70
- * @license lucide-react v1.46.0 - ISC
71
- *
72
- * This source code is licensed under the ISC license.
73
- * See the LICENSE file in the root directory of this source tree.
74
- */const Dm=(...n)=>n.filter((i,r,o)=>!!i&&i.trim()!==""&&o.indexOf(i)===r).join(" ").trim();/**
75
- * @license lucide-react v1.46.0 - ISC
76
- *
77
- * This source code is licensed under the ISC license.
78
- * See the LICENSE file in the root directory of this source tree.
79
- */const al={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
80
- * @license lucide-react v1.46.0 - ISC
81
- *
82
- * This source code is licensed under the ISC license.
83
- * See the LICENSE file in the root directory of this source tree.
84
- */function Uf(n){return n!=null}function vk(n,i={}){var S,A;const r=i.attributeNames??{},o=k=>r[k]??k,d=n.size??n.width??al.width,f=n.size??n.height??al.height,m=((S=n.aliases)==null?void 0:S.filter(k=>typeof k=="string"&&k.trim()!=="").map(k=>`lucide-${k}`))??[],p=[...n.name?[`lucide-${n.name}`]:[],...m],h=((A=i.className)==null?void 0:A.split(" ").filter(Boolean))??[],b=i.includeDefaultClasses===!1?Dm(...h):Dm("lucide",...p,...h),x=i.absoluteStrokeWidth?Number(i.strokeWidth??al["stroke-width"])*Number(n.size??n.width??al.width)/Number(i.size??i.width??al.width):i.strokeWidth??al["stroke-width"];return["svg",{...Object.entries(al).reduce((k,[N,j])=>(k[o(N)]=j,k),{}),..."color"in i&&i.color&&{[o("stroke")]:i.color},..."size"in i&&Uf(i.size)&&{[o("width")]:i.size,[o("height")]:i.size},..."width"in i&&Uf(i.width)&&{[o("width")]:i.width},..."height"in i&&Uf(i.height)&&{[o("height")]:i.height},[o("stroke-width")]:x,...b&&{[o("class")]:b},[o("viewBox")]:`0 0 ${d} ${f}`,...i.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in i&&i.attributes},n.node.map(k=>{const[N,j,L]=k,_=i.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...j}:j;return L?[N,_,L]:[N,_]})]}/**
85
- * @license lucide-react v1.46.0 - ISC
86
- *
87
- * This source code is licensed under the ISC license.
88
- * See the LICENSE file in the root directory of this source tree.
89
- */function wk(n,i={}){return vk(n,{...i,attributeNames:{...i.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
90
- * @license lucide-react v1.46.0 - ISC
91
- *
92
- * This source code is licensed under the ISC license.
93
- * See the LICENSE file in the root directory of this source tree.
94
- */const Sk=n=>{for(const i in n)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1},kk=y.createContext({}),jk=()=>y.useContext(kk),Nk=y.forwardRef(({color:n,size:i,width:r,height:o,strokeWidth:d,absoluteStrokeWidth:f,nonScalingStroke:m,className:p="",children:h,iconNode:b=[],icon:x={node:b,aliases:[],size:24},...v},S)=>{const{size:A=24,strokeWidth:k=2,absoluteStrokeWidth:N=!1,nonScalingStroke:j=!1,color:L="currentColor",className:_=""}=jk()??{},G=!!h||Sk(v),[R,ne,U=[]]=wk(x,{color:n??L,width:r??i??A,height:o??i??A,strokeWidth:d??k,absoluteStrokeWidth:f??N,nonScalingStroke:m??j,className:Dm(_,p),hasA11yProp:G,attributes:v});return y.createElement(R,{ref:S,...ne},[...U.map(([M,T])=>y.createElement(M,T)),...Array.isArray(h)?h:[h]])});/**
95
- * @license lucide-react v1.46.0 - ISC
96
- *
97
- * This source code is licensed under the ISC license.
98
- * See the LICENSE file in the root directory of this source tree.
99
- */function we(n,i=[],r=[]){const o=typeof n=="string"?xk(n,i,r):n,d=y.forwardRef(({className:f,...m},p)=>y.createElement(Nk,{ref:p,icon:o,className:f,...m}));return o.name&&(d.displayName=bk(o.name)),d}/**
100
- * @license lucide-react v1.46.0 - ISC
101
- *
102
- * This source code is licensed under the ISC license.
103
- * See the LICENSE file in the root directory of this source tree.
104
- */const dv={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};dv.node;const Ck=we(dv);/**
105
- * @license lucide-react v1.46.0 - ISC
106
- *
107
- * This source code is licensed under the ISC license.
108
- * See the LICENSE file in the root directory of this source tree.
109
- */const fv={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};fv.node;const Ek=we(fv);/**
110
- * @license lucide-react v1.46.0 - ISC
111
- *
112
- * This source code is licensed under the ISC license.
113
- * See the LICENSE file in the root directory of this source tree.
114
- */const mv={name:"arrow-up-down",size:24,node:[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]};mv.node;const Ak=we(mv);/**
115
- * @license lucide-react v1.46.0 - ISC
116
- *
117
- * This source code is licensed under the ISC license.
118
- * See the LICENSE file in the root directory of this source tree.
119
- */const hv={name:"book-user",size:24,node:[["path",{d:"M15 13a3 3 0 1 0-6 0",key:"10j68g"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}]]};hv.node;const Tk=we(hv);/**
120
- * @license lucide-react v1.46.0 - ISC
121
- *
122
- * This source code is licensed under the ISC license.
123
- * See the LICENSE file in the root directory of this source tree.
124
- */const pv={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};pv.node;const Wm=we(pv);/**
125
- * @license lucide-react v1.46.0 - ISC
126
- *
127
- * This source code is licensed under the ISC license.
128
- * See the LICENSE file in the root directory of this source tree.
129
- */const gv={name:"bug",size:24,node:[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]};gv.node;const _k=we(gv);/**
130
- * @license lucide-react v1.46.0 - ISC
131
- *
132
- * This source code is licensed under the ISC license.
133
- * See the LICENSE file in the root directory of this source tree.
134
- */const xv={name:"calendar",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}]]};xv.node;const Mm=we(xv);/**
135
- * @license lucide-react v1.46.0 - ISC
136
- *
137
- * This source code is licensed under the ISC license.
138
- * See the LICENSE file in the root directory of this source tree.
139
- */const yv={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};yv.node;const gi=we(yv);/**
140
- * @license lucide-react v1.46.0 - ISC
141
- *
142
- * This source code is licensed under the ISC license.
143
- * See the LICENSE file in the root directory of this source tree.
144
- */const bv={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};bv.node;const cl=we(bv);/**
145
- * @license lucide-react v1.46.0 - ISC
146
- *
147
- * This source code is licensed under the ISC license.
148
- * See the LICENSE file in the root directory of this source tree.
149
- */const vv={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};vv.node;const Lr=we(vv);/**
150
- * @license lucide-react v1.46.0 - ISC
151
- *
152
- * This source code is licensed under the ISC license.
153
- * See the LICENSE file in the root directory of this source tree.
154
- */const wv={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};wv.node;const Oc=we(wv);/**
155
- * @license lucide-react v1.46.0 - ISC
156
- *
157
- * This source code is licensed under the ISC license.
158
- * See the LICENSE file in the root directory of this source tree.
159
- */const Sv={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};Sv.node;const Dk=we(Sv);/**
160
- * @license lucide-react v1.46.0 - ISC
161
- *
162
- * This source code is licensed under the ISC license.
163
- * See the LICENSE file in the root directory of this source tree.
164
- */const kv={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};kv.node;const ll=we(kv);/**
165
- * @license lucide-react v1.46.0 - ISC
166
- *
167
- * This source code is licensed under the ISC license.
168
- * See the LICENSE file in the root directory of this source tree.
169
- */const jv={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};jv.node;const Cs=we(jv);/**
170
- * @license lucide-react v1.46.0 - ISC
171
- *
172
- * This source code is licensed under the ISC license.
173
- * See the LICENSE file in the root directory of this source tree.
174
- */const Nv={name:"circle-play",size:24,node:[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],aliases:["play-circle"]};Nv.node;const Mk=we(Nv);/**
175
- * @license lucide-react v1.46.0 - ISC
176
- *
177
- * This source code is licensed under the ISC license.
178
- * See the LICENSE file in the root directory of this source tree.
179
- */const Cv={name:"circle-plus",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],aliases:["plus-circle"]};Cv.node;const Rk=we(Cv);/**
180
- * @license lucide-react v1.46.0 - ISC
181
- *
182
- * This source code is licensed under the ISC license.
183
- * See the LICENSE file in the root directory of this source tree.
184
- */const Ev={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};Ev.node;const zk=we(Ev);/**
185
- * @license lucide-react v1.46.0 - ISC
186
- *
187
- * This source code is licensed under the ISC license.
188
- * See the LICENSE file in the root directory of this source tree.
189
- */const Av={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};Av.node;const Lk=we(Av);/**
190
- * @license lucide-react v1.46.0 - ISC
191
- *
192
- * This source code is licensed under the ISC license.
193
- * See the LICENSE file in the root directory of this source tree.
194
- */const Tv={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};Tv.node;const _v=we(Tv);/**
195
- * @license lucide-react v1.46.0 - ISC
196
- *
197
- * This source code is licensed under the ISC license.
198
- * See the LICENSE file in the root directory of this source tree.
199
- */const Dv={name:"compass",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]]};Dv.node;const Ok=we(Dv);/**
200
- * @license lucide-react v1.46.0 - ISC
201
- *
202
- * This source code is licensed under the ISC license.
203
- * See the LICENSE file in the root directory of this source tree.
204
- */const Mv={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};Mv.node;const Rv=we(Mv);/**
205
- * @license lucide-react v1.46.0 - ISC
206
- *
207
- * This source code is licensed under the ISC license.
208
- * See the LICENSE file in the root directory of this source tree.
209
- */const zv={name:"database",size:24,node:[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]};zv.node;const Bk=we(zv);/**
210
- * @license lucide-react v1.46.0 - ISC
211
- *
212
- * This source code is licensed under the ISC license.
213
- * See the LICENSE file in the root directory of this source tree.
214
- */const Lv={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};Lv.node;const Vc=we(Lv);/**
215
- * @license lucide-react v1.46.0 - ISC
216
- *
217
- * This source code is licensed under the ISC license.
218
- * See the LICENSE file in the root directory of this source tree.
219
- */const Ov={name:"ellipsis-vertical",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],aliases:["more-vertical"]};Ov.node;const Uk=we(Ov);/**
220
- * @license lucide-react v1.46.0 - ISC
221
- *
222
- * This source code is licensed under the ISC license.
223
- * See the LICENSE file in the root directory of this source tree.
224
- */const Bv={name:"eraser",size:24,node:[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]};Bv.node;const Hk=we(Bv);/**
225
- * @license lucide-react v1.46.0 - ISC
226
- *
227
- * This source code is licensed under the ISC license.
228
- * See the LICENSE file in the root directory of this source tree.
229
- */const Uv={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};Uv.node;const Pk=we(Uv);/**
230
- * @license lucide-react v1.46.0 - ISC
231
- *
232
- * This source code is licensed under the ISC license.
233
- * See the LICENSE file in the root directory of this source tree.
234
- */const Hv={name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};Hv.node;const Pv=we(Hv);/**
235
- * @license lucide-react v1.46.0 - ISC
236
- *
237
- * This source code is licensed under the ISC license.
238
- * See the LICENSE file in the root directory of this source tree.
239
- */const qv={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};qv.node;const Si=we(qv);/**
240
- * @license lucide-react v1.46.0 - ISC
241
- *
242
- * This source code is licensed under the ISC license.
243
- * See the LICENSE file in the root directory of this source tree.
244
- */const Fv={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};Fv.node;const Ur=we(Fv);/**
245
- * @license lucide-react v1.46.0 - ISC
246
- *
247
- * This source code is licensed under the ISC license.
248
- * See the LICENSE file in the root directory of this source tree.
249
- */const Gv={name:"funnel",size:24,node:[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],aliases:["filter"]};Gv.node;const qk=we(Gv);/**
250
- * @license lucide-react v1.46.0 - ISC
251
- *
252
- * This source code is licensed under the ISC license.
253
- * See the LICENSE file in the root directory of this source tree.
254
- */const Iv={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};Iv.node;const Bc=we(Iv);/**
255
- * @license lucide-react v1.46.0 - ISC
256
- *
257
- * This source code is licensed under the ISC license.
258
- * See the LICENSE file in the root directory of this source tree.
259
- */const Vv={name:"grip-vertical",size:24,node:[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]};Vv.node;const Zy=we(Vv);/**
260
- * @license lucide-react v1.46.0 - ISC
261
- *
262
- * This source code is licensed under the ISC license.
263
- * See the LICENSE file in the root directory of this source tree.
264
- */const Kv={name:"hard-drive",size:24,node:[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]};Kv.node;const $y=we(Kv);/**
265
- * @license lucide-react v1.46.0 - ISC
266
- *
267
- * This source code is licensed under the ISC license.
268
- * See the LICENSE file in the root directory of this source tree.
269
- */const Yv={name:"heart-handshake",size:24,node:[["path",{d:"M19.414 14.414C21 12.828 22 11.5 22 9.5a5.5 5.5 0 0 0-9.591-3.676.6.6 0 0 1-.818.001A5.5 5.5 0 0 0 2 9.5c0 2.3 1.5 4 3 5.5l5.535 5.362a2 2 0 0 0 2.879.052 2.12 2.12 0 0 0-.004-3 2.124 2.124 0 1 0 3-3 2.124 2.124 0 0 0 3.004 0 2 2 0 0 0 0-2.828l-1.881-1.882a2.41 2.41 0 0 0-3.409 0l-1.71 1.71a2 2 0 0 1-2.828 0 2 2 0 0 1 0-2.828l2.823-2.762",key:"17lmqv"}]]};Yv.node;const Fk=we(Yv);/**
270
- * @license lucide-react v1.46.0 - ISC
271
- *
272
- * This source code is licensed under the ISC license.
273
- * See the LICENSE file in the root directory of this source tree.
274
- */const Qv={name:"images",size:24,node:[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]]};Qv.node;const Gk=we(Qv);/**
275
- * @license lucide-react v1.46.0 - ISC
276
- *
277
- * This source code is licensed under the ISC license.
278
- * See the LICENSE file in the root directory of this source tree.
279
- */const Xv={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};Xv.node;const Ik=we(Xv);/**
280
- * @license lucide-react v1.46.0 - ISC
281
- *
282
- * This source code is licensed under the ISC license.
283
- * See the LICENSE file in the root directory of this source tree.
284
- */const Zv={name:"key",size:24,node:[["path",{d:"m2 21 9.6-9.6",key:"9l79m3"}],["path",{d:"m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19",key:"fw8biw"}],["circle",{cx:"15.5",cy:"7.5",r:"5.5",key:"4wxmhb"}]]};Zv.node;const Rm=we(Zv);/**
285
- * @license lucide-react v1.46.0 - ISC
286
- *
287
- * This source code is licensed under the ISC license.
288
- * See the LICENSE file in the root directory of this source tree.
289
- */const $v={name:"layout-grid",size:24,node:[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]};$v.node;const Vk=we($v);/**
290
- * @license lucide-react v1.46.0 - ISC
291
- *
292
- * This source code is licensed under the ISC license.
293
- * See the LICENSE file in the root directory of this source tree.
294
- */const Jv={name:"lightbulb",size:24,node:[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]};Jv.node;const Kk=we(Jv);/**
295
- * @license lucide-react v1.46.0 - ISC
296
- *
297
- * This source code is licensed under the ISC license.
298
- * See the LICENSE file in the root directory of this source tree.
299
- */const Wv={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};Wv.node;const e0=we(Wv);/**
300
- * @license lucide-react v1.46.0 - ISC
301
- *
302
- * This source code is licensed under the ISC license.
303
- * See the LICENSE file in the root directory of this source tree.
304
- */const t0={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};t0.node;const Yk=we(t0);/**
305
- * @license lucide-react v1.46.0 - ISC
306
- *
307
- * This source code is licensed under the ISC license.
308
- * See the LICENSE file in the root directory of this source tree.
309
- */const n0={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};n0.node;const Qk=we(n0);/**
310
- * @license lucide-react v1.46.0 - ISC
311
- *
312
- * This source code is licensed under the ISC license.
313
- * See the LICENSE file in the root directory of this source tree.
314
- */const a0={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};a0.node;const Xk=we(a0);/**
315
- * @license lucide-react v1.46.0 - ISC
316
- *
317
- * This source code is licensed under the ISC license.
318
- * See the LICENSE file in the root directory of this source tree.
319
- */const s0={name:"merge",size:24,node:[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]]};s0.node;const Zk=we(s0);/**
320
- * @license lucide-react v1.46.0 - ISC
321
- *
322
- * This source code is licensed under the ISC license.
323
- * See the LICENSE file in the root directory of this source tree.
324
- */const l0={name:"message-square-heart",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7.5 9.5c0 .687.265 1.383.697 1.844l3.009 3.264a1.14 1.14 0 0 0 .407.314 1 1 0 0 0 .783-.004 1.14 1.14 0 0 0 .398-.31l3.008-3.264A2.77 2.77 0 0 0 16.5 9.5 2.5 2.5 0 0 0 12 8a2.5 2.5 0 0 0-4.5 1.5",key:"1faxuh"}]]};l0.node;const $k=we(l0);/**
325
- * @license lucide-react v1.46.0 - ISC
326
- *
327
- * This source code is licensed under the ISC license.
328
- * See the LICENSE file in the root directory of this source tree.
329
- */const i0={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};i0.node;const kc=we(i0);/**
330
- * @license lucide-react v1.46.0 - ISC
331
- *
332
- * This source code is licensed under the ISC license.
333
- * See the LICENSE file in the root directory of this source tree.
334
- */const r0={name:"message-square-x",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"m14.5 8.5-5 5",key:"19tnj2"}],["path",{d:"m9.5 8.5 5 5",key:"1oa8ql"}]]};r0.node;const jc=we(r0);/**
335
- * @license lucide-react v1.46.0 - ISC
336
- *
337
- * This source code is licensed under the ISC license.
338
- * See the LICENSE file in the root directory of this source tree.
339
- */const o0={name:"mic",size:24,node:[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]};o0.node;const c0=we(o0);/**
340
- * @license lucide-react v1.46.0 - ISC
341
- *
342
- * This source code is licensed under the ISC license.
343
- * See the LICENSE file in the root directory of this source tree.
344
- */const u0={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};u0.node;const Jk=we(u0);/**
345
- * @license lucide-react v1.46.0 - ISC
346
- *
347
- * This source code is licensed under the ISC license.
348
- * See the LICENSE file in the root directory of this source tree.
349
- */const d0={name:"package",size:24,node:[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]};d0.node;const zm=we(d0);/**
350
- * @license lucide-react v1.46.0 - ISC
351
- *
352
- * This source code is licensed under the ISC license.
353
- * See the LICENSE file in the root directory of this source tree.
354
- */const f0={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};f0.node;const Er=we(f0);/**
355
- * @license lucide-react v1.46.0 - ISC
356
- *
357
- * This source code is licensed under the ISC license.
358
- * See the LICENSE file in the root directory of this source tree.
359
- */const m0={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aliases:["edit-3"]};m0.node;const Wk=we(m0);/**
360
- * @license lucide-react v1.46.0 - ISC
361
- *
362
- * This source code is licensed under the ISC license.
363
- * See the LICENSE file in the root directory of this source tree.
364
- */const h0={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};h0.node;const p0=we(h0);/**
365
- * @license lucide-react v1.46.0 - ISC
366
- *
367
- * This source code is licensed under the ISC license.
368
- * See the LICENSE file in the root directory of this source tree.
369
- */const g0={name:"phone",size:24,node:[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]};g0.node;const ej=we(g0);/**
370
- * @license lucide-react v1.46.0 - ISC
371
- *
372
- * This source code is licensed under the ISC license.
373
- * See the LICENSE file in the root directory of this source tree.
374
- */const x0={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};x0.node;const tj=we(x0);/**
375
- * @license lucide-react v1.46.0 - ISC
376
- *
377
- * This source code is licensed under the ISC license.
378
- * See the LICENSE file in the root directory of this source tree.
379
- */const y0={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};y0.node;const ul=we(y0);/**
380
- * @license lucide-react v1.46.0 - ISC
381
- *
382
- * This source code is licensed under the ISC license.
383
- * See the LICENSE file in the root directory of this source tree.
384
- */const b0={name:"qr-code",size:24,node:[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]};b0.node;const Hf=we(b0);/**
385
- * @license lucide-react v1.46.0 - ISC
386
- *
387
- * This source code is licensed under the ISC license.
388
- * See the LICENSE file in the root directory of this source tree.
389
- */const v0={name:"radio",size:24,node:[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]};v0.node;const Or=we(v0);/**
390
- * @license lucide-react v1.46.0 - ISC
391
- *
392
- * This source code is licensed under the ISC license.
393
- * See the LICENSE file in the root directory of this source tree.
394
- */const w0={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};w0.node;const Ga=we(w0);/**
395
- * @license lucide-react v1.46.0 - ISC
396
- *
397
- * This source code is licensed under the ISC license.
398
- * See the LICENSE file in the root directory of this source tree.
399
- */const S0={name:"rotate-ccw-clock",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],aliases:["history"]};S0.node;const nj=we(S0);/**
400
- * @license lucide-react v1.46.0 - ISC
401
- *
402
- * This source code is licensed under the ISC license.
403
- * See the LICENSE file in the root directory of this source tree.
404
- */const k0={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};k0.node;const dl=we(k0);/**
405
- * @license lucide-react v1.46.0 - ISC
406
- *
407
- * This source code is licensed under the ISC license.
408
- * See the LICENSE file in the root directory of this source tree.
409
- */const j0={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};j0.node;const xi=we(j0);/**
410
- * @license lucide-react v1.46.0 - ISC
411
- *
412
- * This source code is licensed under the ISC license.
413
- * See the LICENSE file in the root directory of this source tree.
414
- */const N0={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};N0.node;const eh=we(N0);/**
415
- * @license lucide-react v1.46.0 - ISC
416
- *
417
- * This source code is licensed under the ISC license.
418
- * See the LICENSE file in the root directory of this source tree.
419
- */const C0={name:"send",size:24,node:[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]};C0.node;const yi=we(C0);/**
420
- * @license lucide-react v1.46.0 - ISC
421
- *
422
- * This source code is licensed under the ISC license.
423
- * See the LICENSE file in the root directory of this source tree.
424
- */const E0={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};E0.node;const aj=we(E0);/**
425
- * @license lucide-react v1.46.0 - ISC
426
- *
427
- * This source code is licensed under the ISC license.
428
- * See the LICENSE file in the root directory of this source tree.
429
- */const A0={name:"share-2",size:24,node:[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]};A0.node;const Hr=we(A0);/**
430
- * @license lucide-react v1.46.0 - ISC
431
- *
432
- * This source code is licensed under the ISC license.
433
- * See the LICENSE file in the root directory of this source tree.
434
- */const T0={name:"shield-alert",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]};T0.node;const Jy=we(T0);/**
435
- * @license lucide-react v1.46.0 - ISC
436
- *
437
- * This source code is licensed under the ISC license.
438
- * See the LICENSE file in the root directory of this source tree.
439
- */const _0={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};_0.node;const th=we(_0);/**
440
- * @license lucide-react v1.46.0 - ISC
441
- *
442
- * This source code is licensed under the ISC license.
443
- * See the LICENSE file in the root directory of this source tree.
444
- */const D0={name:"sliders-vertical",size:24,node:[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],aliases:["sliders"]};D0.node;const M0=we(D0);/**
445
- * @license lucide-react v1.46.0 - ISC
446
- *
447
- * This source code is licensed under the ISC license.
448
- * See the LICENSE file in the root directory of this source tree.
449
- */const R0={name:"smartphone",size:24,node:[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]};R0.node;const _r=we(R0);/**
450
- * @license lucide-react v1.46.0 - ISC
451
- *
452
- * This source code is licensed under the ISC license.
453
- * See the LICENSE file in the root directory of this source tree.
454
- */const z0={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};z0.node;const L0=we(z0);/**
455
- * @license lucide-react v1.46.0 - ISC
456
- *
457
- * This source code is licensed under the ISC license.
458
- * See the LICENSE file in the root directory of this source tree.
459
- */const O0={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};O0.node;const Lm=we(O0);/**
460
- * @license lucide-react v1.46.0 - ISC
461
- *
462
- * This source code is licensed under the ISC license.
463
- * See the LICENSE file in the root directory of this source tree.
464
- */const B0={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};B0.node;const Kc=we(B0);/**
465
- * @license lucide-react v1.46.0 - ISC
466
- *
467
- * This source code is licensed under the ISC license.
468
- * See the LICENSE file in the root directory of this source tree.
469
- */const U0={name:"sticker",size:24,node:[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}],["path",{d:"M8 13h.01",key:"1sbv64"}],["path",{d:"M16 13h.01",key:"wip0gl"}],["path",{d:"M10 16s.8 1 2 1c1.3 0 2-1 2-1",key:"1vvgv3"}]]};U0.node;const nh=we(U0);/**
470
- * @license lucide-react v1.46.0 - ISC
471
- *
472
- * This source code is licensed under the ISC license.
473
- * See the LICENSE file in the root directory of this source tree.
474
- */const H0={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};H0.node;const sj=we(H0);/**
475
- * @license lucide-react v1.46.0 - ISC
476
- *
477
- * This source code is licensed under the ISC license.
478
- * See the LICENSE file in the root directory of this source tree.
479
- */const P0={name:"tag",size:24,node:[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]};P0.node;const lj=we(P0);/**
480
- * @license lucide-react v1.46.0 - ISC
481
- *
482
- * This source code is licensed under the ISC license.
483
- * See the LICENSE file in the root directory of this source tree.
484
- */const q0={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};q0.node;const fl=we(q0);/**
485
- * @license lucide-react v1.46.0 - ISC
486
- *
487
- * This source code is licensed under the ISC license.
488
- * See the LICENSE file in the root directory of this source tree.
489
- */const F0={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};F0.node;const Mn=we(F0);/**
490
- * @license lucide-react v1.46.0 - ISC
491
- *
492
- * This source code is licensed under the ISC license.
493
- * See the LICENSE file in the root directory of this source tree.
494
- */const G0={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};G0.node;const ml=we(G0);/**
495
- * @license lucide-react v1.46.0 - ISC
496
- *
497
- * This source code is licensed under the ISC license.
498
- * See the LICENSE file in the root directory of this source tree.
499
- */const I0={name:"type",size:24,node:[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]]};I0.node;const ij=we(I0);/**
500
- * @license lucide-react v1.46.0 - ISC
501
- *
502
- * This source code is licensed under the ISC license.
503
- * See the LICENSE file in the root directory of this source tree.
504
- */const V0={name:"unlink",size:24,node:[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]};V0.node;const rj=we(V0);/**
505
- * @license lucide-react v1.46.0 - ISC
506
- *
507
- * This source code is licensed under the ISC license.
508
- * See the LICENSE file in the root directory of this source tree.
509
- */const K0={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};K0.node;const Y0=we(K0);/**
510
- * @license lucide-react v1.46.0 - ISC
511
- *
512
- * This source code is licensed under the ISC license.
513
- * See the LICENSE file in the root directory of this source tree.
514
- */const Q0={name:"user-x",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]};Q0.node;const oj=we(Q0);/**
515
- * @license lucide-react v1.46.0 - ISC
516
- *
517
- * This source code is licensed under the ISC license.
518
- * See the LICENSE file in the root directory of this source tree.
519
- */const X0={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};X0.node;const hc=we(X0);/**
520
- * @license lucide-react v1.46.0 - ISC
521
- *
522
- * This source code is licensed under the ISC license.
523
- * See the LICENSE file in the root directory of this source tree.
524
- */const Z0={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};Z0.node;const rl=we(Z0);/**
525
- * @license lucide-react v1.46.0 - ISC
526
- *
527
- * This source code is licensed under the ISC license.
528
- * See the LICENSE file in the root directory of this source tree.
529
- */const $0={name:"video",size:24,node:[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]};$0.node;const cj=we($0);/**
530
- * @license lucide-react v1.46.0 - ISC
531
- *
532
- * This source code is licensed under the ISC license.
533
- * See the LICENSE file in the root directory of this source tree.
534
- */const J0={name:"volume-2",size:24,node:[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]};J0.node;const uj=we(J0);/**
535
- * @license lucide-react v1.46.0 - ISC
536
- *
537
- * This source code is licensed under the ISC license.
538
- * See the LICENSE file in the root directory of this source tree.
539
- */const W0={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};W0.node;const e1=we(W0);/**
540
- * @license lucide-react v1.46.0 - ISC
541
- *
542
- * This source code is licensed under the ISC license.
543
- * See the LICENSE file in the root directory of this source tree.
544
- */const t1={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};t1.node;const Rn=we(t1),Pf={ar:{unknownContact:"جهة اتصال غير معروفة",showNumber:"إظهار رقم الهاتف",hideNumber:"إخفاء رقم الهاتف",clearLogsConfirm:"مسح السجلات المحفوظة؟",clearLogsBody:"سيتم مسح السجلات المحفوظة للمصدر المحدد. ستستمر الأحداث الجديدة في التسجيل.",logsCleared:"تم مسح السجلات المحفوظة",logsLoadFailed:"تعذر تحميل السجلات. جارٍ إعادة المحاولة…",logsClearFailed:"تعذر مسح السجلات المحفوظة. حاول مرة أخرى.",botAdminHint:"إجراءات الإشراف على واتساب تتطلب أن يكون البوت مشرفًا بالمجموعة. تظل صلاحيات الأوامر سارية.",antiSpam:"مكافحة الإزعاج",autoApprove:"قبول طلبات الانضمام تلقائيًا",blockImages:"حظر الصور",blockVideos:"حظر الفيديو",blockAudio:"حظر الصوت",blockStickers:"حظر الملصقات",groupModeration:"إعدادات الإشراف",linkMode:"سياسة الروابط",linkAll:"حظر جميع الروابط",linkWhitelist:"السماح بالنطاقات المدرجة فقط",linkBlacklist:"حظر النطاقات المدرجة فقط",allowedDomains:"النطاقات، كل نطاق في سطر",spamWindow:"مدة رصد الإزعاج (بالثواني)",spamLimit:"عدد الرسائل قبل الإجراء",spamAction:"إجراء مكافحة الإزعاج",actionWarn:"إنذار العضو",actionKick:"طرد العضو",actionNone:"إبقاء العضو",actionFlag:"إبلاغ المشرفين للمراجعة",actionDelete:"حذف الرسالة فقط",actionDeleteWarn:"حذف وإنذار",actionDeleteKick:"حذف وطرد فورًا",linkAction:"إجراء منع الروابط",mediaAction:"إجراء الوسائط",wordsAction:"إجراء الكلمات الممنوعة",forbiddenWords:"الكلمات الممنوعة",flaggedMembers:"أعضاء بانتظار المراجعة",flaggedEmpty:"لا يوجد أعضاء معلَّمون للمراجعة.",kickFlagged:"طرد",clearWarnings:"مسح الإنذارات",dismissFlag:"إلغاء التعليم",policyPreset:"نمط جاهز",presetRelaxed:"مرن",presetStandard:"قياسي",presetStrict:"صارم",presetCustom:"مخصص",policyMode:"كيف تُحسب الإنذارات",policyModeSimple:"نقطة واحدة لكل مخالفة",policyModeSeverity:"حسب شدة المخالفة",policyFlagAt:"عدد النقاط قبل إبلاغ المشرفين",policyKickAt:"عدد النقاط قبل طرد العضو",policyHitMerge:"إذا خالفت رسالة واحدة عدة قوانين",policyHitMergeMax:"احسب أقوى قانون فقط",policyHitMergeSum:"اجمع النقاط كلها",policyActionDefault:"افتراضي (كالإنذار)",policyLinkLabel:"عندما يرسل أحد رابطًا",policyMediaLabel:"عندما يرسل أحد وسائط",policyForbiddenLabel:"عندما يستخدم أحد الكلمات الممنوعة",policySpamLabel:"عندما يُغرق أحد المجموعة برسائل",policyDecay:"انتهاء الإنذارات",policyDecayOff:"لا تنتهي",policyDecayExpire:"إسقاط الإنذار كاملًا بعد",policyDecayStep:"فقدان نقطة واحدة كل",policyDecayDays:"عدد الأيام",policyMembership:"إذا ترك عضو المجموعة وعاد",policyMembershipKeep:"الاحتفاظ بإنذاراته",policyMembershipClear:"مسح إنذاراته",policyBlockTitle:"أسلوب الإشراف على المخالفات",policyFlagNotify:"إرسال إشعار في المجموعة",policyNotifyGroup:"نعم، إرساله",policyNotifySilent:"بدون إشعار",policyMentionAdmins:"الإشارة إلى المشرفين",policyCooldown:"دقائق الانتظار قبل إرسال الإشعار مرة أخرى",policyCooldownHint:"اجعلها 0 لإرساله في كل مرة.",policyWhileFlagged:"بينما لم يراجعهم المشرفون بعد",policyWhileFlaggedRecord:"متابعة العد",policyWhileFlaggedHold:"إيقاف العد مؤقتًا",policyWhileFlaggedEscalate:"طرده بعد إنذارات أكثر",policyEscalateAfter:"إنذارات إضافية قبل الطرد",policyWeightLink:"نقاط الرابط",policyWeightMedia:"نقاط الوسائط",policyWeightForbidden:"نقاط الكلمات الممنوعة",policyWeightSpam:"نقاط الإزعاج",policyWeightManual:"نقاط إنذار المشرف اليدوي",warningLimit:"الحد الأقصى للإنذارات",warningAction:"عند بلوغ حد الإنذارات",groupRules:"قوانين المجموعة",rulesAndModeration:"القوانين والإشراف",moderationPreview:"معاينة الإشراف المفعّل",moderationPreviewHint:"هذا النص يظهر تحت القوانين وفي رسالة الترحيب.",welcomeMessages:"رسائل الترحيب، كل رسالة في سطر",groupCommands:"أوامر المجموعة وصلاحياتها",overview:"نظرة عامة",stickers:"استوديو الملصقات",connection:"حالة الاتصال",control:"التحكم والإدارة",commands:"كتالوج الأوامر",ai:"الذكاء الاصطناعي",groups:"المجموعات",roles:"الأدوار والمشرفين",schedules:"الرسائل المجدولة",notes:"الملاحظات والقوائم",settings:"الإعدادات العامة",logs:"السجلات المباشرة",connected:"متصل بالواتساب",disconnected:"غير متصل",starting:"جارٍ إنشاء الاتصال...",waiting_for_qr:"بانتظار مسح رمز الـ QR",linking:"جارٍ ربط الجلسة...",reconnecting:"جارٍ إعادة الاتصال...",retry_exhausted:"استُنفذت محاولات الاتصال",logged_out:"تم تسجيل الخروج من الهاتف",idle:"الجلسة خاملة",paused:"متوقف مؤقتاً",resume:"استئناف الجلسة",connectSession:"الاتصال",start:"بدء الاتصال",stop:"إيقاف مؤقت",reconnect:"إعادة الاتصال",unlink:"إلغاء الربط (Unlink)",restart:"إعادة تشغيل البوت",save:"حفظ التغييرات",saving:"جارٍ الحفظ...",discard:"تجاهل",unsavedChanges:"تغييرات غير محفوظة",toggleOn:"مفعل",toggleOff:"معطل",cancel:"إلغاء",delete:"حذف",edit:"تعديل",add:"إضافة",refresh:"تحديث",logout:"تسجيل الخروج",backToApp:"العودة للتطبيق",close:"إغلاق",copy:"نسخ",copied:"تم النسخ!",filter:"تصفية",sort:"ترتيب",more:"المزيد",reset:"إعادة التعيين",autoScroll:"تمرير تلقائي",dismiss:"إخفاء",openNavigation:"فتح القائمة",closeNavigation:"إغلاق القائمة",pagination:"التنقل بين الصفحات",previousPage:"الصفحة السابقة",nextPage:"الصفحة التالية",pageOf:"صفحة {page} من {count}",resultCount:"{n} نتيجة",emptyRecords:"لا توجد سجلات بعد",emptyMatches:"لا توجد نتائج مطابقة",loadError:"تعذر تحميل البيانات",clearFilters:"مسح عوامل التصفية",searchGroups:"ابحث باسم المجموعة",searchSchedules:"ابحث في الرسائل والوجهات",sortByMembers:"عدد الأعضاء",mediaCustom:"وسائط مخصصة",mediaWith:"تحتوي وسائط",mediaWithout:"بدون وسائط",logsSubtitle:"سجل أحداث النظام واتصالات واتساب واستدعاءات الذكاء الاصطناعي في الوقت الفعلي",groupsSubtitle:"إدارة مجموعات واتساب، الحماية من الروابط، تقييد الوسائط، ورسائل الترحيب التلقائية",groupsCount:"{n} مجموعة",noGroupsTitle:"لا توجد مجموعات حتى الآن",noGroupsBody:"بمجرد إضافة البوت إلى مجموعات واتساب، ستظهر تلقائياً هنا مع خيارات الإشراف والحماية.",unnamedGroup:"مجموعة بدون اسم",mediaNone:"بلا قيود (الكل)",mediaBlockAll:"حظر كافة الوسائط",clientIdentity:"هوية العميل",noPhonePaired:"لم يتم ربط أي هاتف بعد",linkedAs:"مرتبط كـ",datastoreHealth:"حالة قاعدة البيانات",datastoreHealthy:"بيانات الاعتماد ومفاتيح الجلسة ومطابقات LID سليمة ومستقرة.",reconnectPolicy:"سياسة إعادة الاتصال",reconnectPolicyDesc:"تراجع خطي تدريجي (5ث، 10ث، 15ث، 20ث، 25ث) مع محاولات محدودة.",maxAttemptsAutoPause:"الحد الأقصى: 5 محاولات · إيقاف تلقائي دون إنترنت",platformWeb:"المنصة: واتساب ويب (v7 Multi-Device)",databaseNodeSqlite:"قاعدة البيانات: node:sqlite (تزامني)",totalGroups:"إجمالي المجموعات",totalUsers:"المستخدمون المسجلون",commandCount:"الأوامر المفعلة",uptime:"مدة التشغيل",uptimeDayUnit:"يوم",uptimeHourUnit:"ساعة",uptimeMinuteUnit:"دقيقة",online:"متصل",offline:"غير متصل",quickCommandsDesc:"{n} أمراً واختصاراً نشطاً",moreActions:"إجراءات إضافية",lightMode:"الوضع الفاتح",darkMode:"الوضع الداكن",quickStatus:"حالة النظام",activeSchedules:"المهام المجدولة النشطة",activeListening:"المساعد نشط ويستقبل الرسائل",pausedOrLinking:"اتصال واتساب متوقف حالياً أو قيد المزامنة",aiTitle:"إعدادات الذكاء الاصطناعي",aiSubtitle:"اختر المزود المناسب بضغطة زر أو خصص النماذج والمفاتيح",aiAgentEnabled:"تفعيل وكيل الذكاء الاصطناعي",aiProvider:"المزود النشط",quickSetup:"معالج الإعداد السريع للمزودين",aiVision:"تحليل وفهم الصور (Vision)",aiVisionDesc:"تحويل الصور وتمريرها لنماذج الرؤية الذكية المتوافقة",aiStt:"محرك تحويل الصوت إلى نص (STT)",sttDesc:"محرك تفريغ الرسائل الصوتية وتحويلها إلى نص",sttAuto:"تلقائي (مطابق للمزود النشط)",sttGemini:"Google Gemini Audio API",sttOpenAI:"OpenAI / Groq Whisper API",botLanguage:"لغة ردود البوت",botLanguageDesc:"تحديد لغة ردود البوت أو تغييرها عبر الأمر !lang",langAuto:"تلقائي (حسب لغة رسالة المستخدم)",langAr:"العربية الفصحى (دائماً)",langEn:"English (دائماً)",modelName:"النموذج",apiKey:"مفتاح API",enterApiKey:"أدخل المفتاح",baseUrl:"Base URL",maxToolSteps:"الحد الأقصى لخطوات الأدوات",googleSearch:"أداة بحث جوجل المدمجة (Google Search)",personaPrompt:"توجيه شخصية البوت (AI Persona)",personaDesc:"تعديل التوجيه الأساسي الذي يحدد أسلوب وشخصية مساعدك الذكي",editPersona:"تعديل توجيه الشخصية",translateEngine:"محرك الترجمة",translateEngineDesc:"المحرك الافتراضي لأمر !translate. يمكن تغييره في كل استدعاء بـ ai أو google.",translateEngineAi:"الذكاء الاصطناعي (المزود النشط)",translateEngineGoogle:"Google Translate",googleTranslateApiKey:"مفتاح Google Translate API",googleTranslateApiKeyDesc:"اختياري لواجهة Cloud Translation v2. بدون المفتاح يستخدم الأمر نقطة الترجمة العامة.",memoryFiles:"الذاكرة طويلة المدى",memoryDesc:"ذاكرة البوت الدائمة: تشترك جميع المحادثات في الذاكرة العامة، ولكل محادثة ملف خاص. يقرأ البوت المعلومات المحفوظة وأي نص حر تكتبه.",manageMemory:"إدارة ملفات الذاكرة",memoryGlobalScope:"الذاكرة العامة",memoryGlobalScopeHint:"تُضاف إلى سياق جميع المحادثات",memoryChatScopeHint:"تُضاف إلى سياق هذه المحادثة فقط",memoryEntriesCount:"{n} معلومة محفوظة",memoryProseHint:"يقرأ البوت محتوى الملف كله: الأسطر التي تبدأ بـ `-` معلومات منفصلة يمكنه إضافتها أو حذفها، ويقرأ أي نص حر كما كُتب.",memoryEditorPlaceholder:"اكتب هنا ما تريد أن يتذكره البوت دائمًا…",aiInspector:"معاينة محادثات الذكاء الاصطناعي",aiInspectorDesc:"نظرة للقراءة فقط على السياق المخزّن لكل محادثة: الردود، الوسائط، واستخدام الأدوات.",openInspector:"فتح المعاينة",noConversations:"لا توجد محادثات محفوظة بعد.",convTurns:"{n} جزء",backToList:"رجوع للقائمة",convTruncated:"يقتصر العرض على آخر 200 جزء.",convMedia:"ملف وسائط",capabilities:"القدرات والميزات المتقدمة",modelsAvailableLive:"نماذج متاحة لحسابك (تم التحقق عبر API)",modelsRecommendedSeed:"نماذج مقترحة / معروفة (دليل النماذج)",connectKeyFirstPrompt:"يرجى إدخال مفتاح API أولاً لاكتشاف النماذج المتاحة لحسابك",refreshModels:"تحديث قائمة النماذج",refreshing:"جارٍ التحديث...",fetchModels:"فحص النماذج المتاحة",fetchingModels:"جارٍ فحص النماذج...",capVision:"الرؤية",capStt:"الصوت",capAudio:"إدخال الصوت",capText:"نص",capPdf:"PDF",capVideo:"فيديو",supported:"مدعوم",unsupported:"غير مدعوم",sourceLive:"حسابك",sourceSeed:"مقترح",sourceUnknown:"غير معروف",retry:"إعادة المحاولة",noModelsFound:"لم يتم العثور على نماذج لهذا المزود",noMemoryFiles:"لا توجد ملفات ذاكرة محفوظة",capSupportedDesc:"النموذج يدعم هذه الميزة",capUnsupportedDesc:"النموذج لا يدعم هذه الميزة",capUnknownDesc:"حالة الدعم غير محددة لهذا النموذج",visionUnsupportedNotice:"النموذج المختار لا يدعم معالجة الصور والرؤية (Vision)، تم تعطيل الميزة تلقائياً.",sttUnsupportedNotice:"النموذج المختار لا يدعم تحويل وفهم الصوت (STT)، تم تعطيل الميزة تلقائياً.",aiSttEnabled:"تفعيل تحويل وفهم الصوت (STT)",aiSttEnabledDesc:"تفريغ الرسائل الصوتية وفهم الملفات الصوتية عبر النموذج المختار",providerGemini:"Google Gemini",providerGeminiDesc:"الافتراضي، يدعم البحث والملفات والصور والصوتيات محلياً",providerGroq:"Groq Cloud",providerGroqDesc:"فائق السرعة لنماذج Llama 3 و Mixtral مع دعم Vision",providerOpenAI:"OpenAI / Compatible",providerOpenAIDesc:"لنماذج GPT-4o أو أي خادم متوافق مع API OpenAI",providerOllama:"Ollama (محلي)",providerOllamaDesc:"تشغيل النماذج محلياً على جهازك مجاناً بدون إنترنت",providerAnthropic:"Anthropic Claude",providerAnthropicDesc:"لنماذج Claude 3.5 Sonnet الذكية والمتقدمة",scanQrHint:"افتح تطبيق واتساب على هاتفك > الأجهزة المرتبطة > ربط جهاز، وامسح الرمز أدناه.",pairingCode:"رمز الربط (Pairing Code)",reconnectingSoon:"إعادة الاتصال قريباً...",nextAttemptIn:"المحاولة القادمة خلال",seconds:"ثوانٍ",tabGeneral:"عام والبادئة",tabAI:"الذكاء الاصطناعي",tabSecurity:"الأمان والوصول",tabProxy:"بروكسي واتساب",tabStorage:"التخزين والوسائط",tabLogs:"سجلات النظام",prefixTitle:"بادئة أوامر البوت (Command Prefix)",prefixDesc:"الرمز أو الحرف الذي تبدأ به جميع الأوامر الموجهة للبوت في واتساب (مثل !help أو /ping)",prefixPlaceholder:"مثال: !",prefixPresets:"بادئات شائعة سريعة:",prefixPreview:"معاينة حية لشكل الأوامر:",prefixSaveBtn:"حفظ البادئة الجديدة",prefixUpdated:"تم تحديث بادئة الأوامر بنجاح!",prefixValidation:"يجب أن تكون البادئة من رمز واحد إلى 3 رموز",activePrefix:"البادئة الحالية",changePrefix:"تعديل البادئة",prefix:"بادئة الأوامر (Prefix)",botTimezone:"المنطقة الزمنية (Timezone)",botTimezoneDesc:"المنطقة الزمنية المعتمدة لحساب أوقات الصلاة والمهام المجدولة (مثل Africa/Cairo)",botMinDelay:"الحد الأدنى للتأخير البشري (ms)",botMaxDelay:"الحد الأقصى للتأخير البشري (ms)",delaysDesc:"فترة انتظار قصيرة قبل إرسال الردود ليبدو سلوك البوت طبيعياً وبشرياً",delayRangeError:"يجب ألا يزيد الحد الأدنى للتأخير عن الحد الأقصى.",shareSettingsTitle:"مشاركة الإعدادات",shareSettingsDesc:"صدّر إعداداتك في ملف JSON يشاركه أصدقاؤك، أو استورد ملف صديقك. المفاتيح السرية (مفاتيح الـ API وكلمات المرور) لا تُصدَّر أبداً ولا تُستبدل بالاستيراد.",exportAction:"تصدير",exportSettings:"تصدير الإعدادات",exportSettingsDesc:"ملف JSON يتضمن الإعدادات غير السرية التي غيّرتها",exportSettingsSuccess:"تم تصدير الإعدادات",exportSavedTo:"حُفظ في",exportSettingsError:"تعذر تصدير الإعدادات",importSettings:"استيراد من ملف",importSettingsError:"ملف غير صالح — يجب أن يكون ملفًا صادرًا من إعدادات Levix",importTitle:"استيراد الإعدادات",importSummary:"سيُطبّق على هذا الجهاز:",importSettingsCount:"إعداد",importPermissionsCount:"صلاحية أمر",importAliasesCount:"أسماء بديلة",importDisabledCount:"أمر مُعطَّل",importPrefix:"البادئة",importApply:"تطبيق الاستيراد",importSuccess:"تم استيراد الإعدادات بنجاح",importSkipped:"تم تخطي",importRestartNeeded:"تحتاج إعادة تشغيل البوت لتُطبَّق",changePassword:"تغيير كلمة مرور لوحة التحكم",currentPassword:"كلمة المرور الحالية",newPassword:"كلمة المرور الجديدة",confirmPassword:"تأكيد كلمة المرور الجديدة",passwordMatchError:"كلمتا المرور غير متطابقتين",passwordMinLength:"يجب ألا تقل كلمة المرور عن 8 خانات",passwordChangedSuccess:"تم تغيير كلمة مرور لوحة التحكم بنجاح!",recoveryEmailTitle:"بريد الاسترداد",recoveryEmailTokenPolicy:"إعادة التحقق من هذا البريد توقف استرداد البريد على أي تثبيت آخر يستخدمه. يلزم التحقق مجدداً بعد 365 يوماً دون طلب استرداد مقبول.",recoveryEmailReverify:"يحتاج البريد المحفوظ إلى التحقق مجدداً. أدخل عنوانك وكلمة مرور اللوحة أدناه. يظل الاسترداد عبر واتساب أو الأمر levix reset-password متاحاً.",recoveryEmailDesc:"إذا نسيت كلمة مرور اللوحة، يرسل Levix كوداً لمرة واحدة إلى هذا العنوان. لا يُعتمد العنوان إلا بعد التحقق.",recoveryEmailLabel:"عنوان البريد",recoveryEmailSendCode:"أرسل الكود",recoveryEmailCode:"كود التحقق",recoveryEmailCodeSent:"أدخل الكود المكوّن من 6 أرقام. يصلح لمدة 10 دقائق.",recoveryEmailVerify:"تحقّق",recoveryEmailCurrent:"العنوان المُحقَّق",recoveryEmailChange:"تغيير",recoveryEmailRemove:"إزالة بريد الاسترداد",recoveryEmailRemoveTitle:"إزالة بريد الاسترداد؟",recoveryEmailRemoveDesc:"لن يستطيع «نسيت كلمة المرور» إرسال كود إلى بريدك بعد ذلك.",recoveryEmailRemoved:"تمت إزالة بريد الاسترداد",recoveryEmailVerified:"تم التحقق من بريد الاسترداد",recoveryEmailStays:"يبقى العنوان الحالي فعالاً إلى أن يتم التحقق من العنوان الجديد.",recoveryEmailPasswordHint:"يستطيع بريد الاسترداد إعادة تعيين كلمة المرور، لذلك يلزم إدخالها لإضافته.",recoveryErrInvalidEmail:"أدخل عنوان بريد صالحاً.",recoveryErrWrongPassword:"كلمة المرور الحالية غير صحيحة.",recoveryErrThrottled:"طلبات كثيرة جداً. حاول مرة أخرى خلال {n} ثانية.",recoveryErrRateLimited:"خدمة البريد مشغولة. حاول مرة أخرى بعد قليل.",recoveryErrUnavailable:"تعذّر الوصول إلى خدمة البريد. تحقق من الاتصال وحاول مرة أخرى.",recoveryErrInvalid:"رفضت خدمة البريد هذا العنوان.",recoveryErrWrongCode:"كود غير صحيح.",recoveryErrAttemptsLeft:"{n} محاولات متبقية.",recoveryErrExpired:"هذا الكود لم يعد صالحاً. أرسل كوداً جديداً.",recoveryErrFailed:"تعذر تحديث بريد الاسترداد. حاول مرة أخرى.",proxyTitle:"بروكسي واتساب الصادر (Outbound Proxy)",proxyDesc:"توجيه اتصالات Baileys إلى واتساب عبر بروكسي خارجي لتجاوز قيود الشبكة أو الحظر",proxyEnabled:"تفعيل البروكسي لاتصالات واتساب",proxyProtocol:"بروتوكول البروكسي (Protocol)",proxyHost:"عنوان المضيف (Host / IP)",proxyPort:"المنفذ (Port)",proxyUsername:"اسم المستخدم (اختياري)",proxyPassword:"كلمة المرور (اختياري)",proxyApplyHint:"⚠️ ملاحظة: عند تعديل إعدادات البروكسي، اضغط على زر إعادة الاتصال في صفحة الاتصال لتطبيق التغييرات.",storageTitle:"إدارة البيانات والاحتفاظ بها",storageDesc:"تحديد مدد صلاحية البيانات المؤقتة وسجلات الرسائل الموجهة والحدود القصوى للجلب",forwardTtl:"صلاحية سجلات الرسائل الموجهة (أيام)",forwardTtlDesc:"حذف إحصائيات الرسائل الموجهة القديمة تلقائياً بعد مرور هذا العدد من الأيام",maxFetchBytes:"الحد الأقصى لجلب محتوى صفحات الويب (Bytes)",maxFetchBytesDesc:"حجم المحتوى الأقصى المسموح لأدوات الذكاء الاصطناعي بجلبه من صفحات الويب (افتراضي: 512KB)",ffmpegPath:"مسار محرك FFmpeg مخصص (اختياري)",weatherApiKey:"مفتاح OpenWeatherMap API (اختياري)",chooseLanguage:"اختر اللغة",langCardTitle:"لغة الواجهة: العربية (RTL)",langCardDesc:"تصميم مخصص بالكامل لاتجاه الكتابة العربي من اليمين لليسار مع خط تجوال",langSwitchBtn:"Switch to English",langName:"العربية",interfaceLanguage:"لغة لوحة التحكم",interfaceLanguageDesc:"العربية (RTL) أو الإنجليزية (LTR) لهذه اللوحة",botPort:"منفذ خادم لوحة التحكم (Port)",botPortHint:"* يتطلب تغيير المنفذ إعادة تشغيل البوت ليأخذ مفعوله",searchPlaceholder:"ابحث في الأوامر أو الأسماء البديلة...",thCommand:"الأمر",thAliases:"الأسماء البديلة",thDescription:"الوصف",thScope:"النطاق",thRequiredRole:"الرتبة المطلوبة",thStatus:"الحالة",thGroupName:"اسم المجموعة",thGroupJid:"معرف المجموعة (JID)",thMembers:"الأعضاء",thAntiLink:"مانع الروابط",thMedia:"الوسائط",thWelcome:"الترحيب",thTarget:"الوجهة",thMessage:"الرسالة",thSchedule:"الموعد",thType:"النوع",thDelivery:"حالة الإرسال",thActions:"إجراءات",scheduleNewMsg:"جدولة رسالة جديدة",liveServerLogs:"سجلات النظام المباشرة",clearLogs:"مسح السجلات",allLogs:"جميع المستويات",noLogs:"لا توجد سجلات مسجلة حتى الآن.",logSourceBot:"البوت",logSourceHost:"مضيف أندرويد",shareLogs:"مشاركة السجلات",share:"مشاركة",savedSuccessfully:"تم حفظ الإعدادات بنجاح!",saveFailed:"حدث خطأ أثناء حفظ الإعدادات.",connectionStatusUpdated:"تم تحديث حالة الاتصال.",networkError:"تعذر الاتصال بالخادم.",loading:"جارٍ التحميل...",aiAssistantDesc:"وكيل ذكي متعدد الأدوات مع ذاكرة طويلة الأمد",settingsSub:"البادئة، التأخير، الخدمات، والأمان",editAliases:"تعديل الأسماء المستعارة",aliasesFor:"الأسماء المستعارة لـ",addAlias:"إضافة اسم مستعار",newAliasPlaceholder:"اكتب اسماً جديداً...",noAliases:"لا توجد أسماء مستعارة",aliasesHelp:"الأسماء المستعارة تتيح استدعاء هذا الأمر بأسماء بديلة (مثل: p بدلاً من ping).",aliasAlreadyAdded:"هذا الاسم المستعار مضاف بالفعل",aliasScriptArabic:"اسم مستعار بالعربية",aliasScriptLatin:"اسم مستعار بالإنجليزية",commandsSub:"إدارة رتب الأوامر والأسماء المستعارة وتفعيلها أو تعطيلها مباشرة",editPrefixHint:"اضغط لتعديل البادئة",usage:"الاستخدام",usageHint:"الأمر كما يُرسل في واتساب",noMatchingCommands:"لا توجد أوامر مطابقة لبحثك.",commandEnabled:"تم تفعيل الأمر '{name}'",commandDisabled:"تم تعطيل الأمر '{name}'",permissionUpdated:"تم تحديث رتبة '{name}'",scopeAll:"الكل",scopeGroup:"المجموعات",scopePrivate:"خاص",permMembers:"الجميع (الأعضاء)",permAdminsOnly:"مشرفو المجموعة",permAdminsOwner:"مشرفو المجموعة أو المالك",permOwnerOnly:"مالك البوت فقط",details:"التفاصيل",hideDetails:"إخفاء التفاصيل",copyCommand:"نسخ الأمر",copyFailed:"تعذّر النسخ",overridden:"معدّل",defaultLabel:"الافتراضي",locked:"مقفل",permissionLockedReason:"ثابتة لأن هذا الأمر ينفّذ إجراءً إدارياً في واتساب",overriddenOnly:"المعدّلة فقط",lockedOnly:"المقفلة فقط",filterScope:"النطاق",filterPermission:"الرتبة",scopeAllChats:"كل المحادثات",scopeGroupsOnly:"المجموعات فقط",scopePrivateOnly:"الخاص فقط",scopeGroupSub:"أوامر المجموعات الفرعية",scopeGeneral:"الأوامر العامة",sortStatus:"الحالة",resultCountOf:"{n} من {total}",selectRecipient:"اختر المحادثة المستهدفة",searchRecipients:"ابحث بالاسم أو رقم الهاتف...",recipients:"المستلمون",chooseChat:"اختر جهة اتصال أو مجموعة...",noRecipientsFound:"لم يتم العثور على محادثات",pickPhoneContact:"من دليل الهاتف",pickPhoneContactHint:"اختر جهة اتصال من هاتف أندرويد",maxSchedulesReached:"تم بلوغ الحد الأقصى (3 رسائل مجدولة)",limitReached:"الحد الأقصى مكتمل",scheduleType:"نوع الجدولة",scheduleRecurring:"دوري متكرر",scheduleOnce:"مرة واحدة (تاريخ ووقت محدد)",repeat:"التكرار",repeatDaily:"كل يوم",repeatWeekly:"كل أسبوع",repeatMonthly:"كل شهر",repeatHourly:"كل عدد من الساعات",weekdays:"أيام الأسبوع",dayOfMonth:"يوم الشهر",monthDayHint:"إذا كان الشهر أقصر من اليوم المختار (مثل 31 في فبراير) تُتخطى تلك المرة.",everyHours:"كل كم ساعة",atMinute:"عند الدقيقة",sendTime:"وقت الإرسال",deliveryDateTime:"موعد وتاريخ الإرسال",timezoneLabel:"المنطقة الزمنية",recurrencePreview:"المعاينة",weekdaySun:"الأحد",weekdayMon:"الاثنين",weekdayTue:"الثلاثاء",weekdayWed:"الأربعاء",weekdayThu:"الخميس",weekdayFri:"الجمعة",weekdaySat:"السبت",contactFallback:"جهة اتصال",groupFallback:"مجموعة",hoursUnit:"ساعة",messageText:"نص الرسالة",messagePlaceholder:"اكتب الرسالة التي سيتم إرسالها تلقائياً...",scheduleAction:"جدولة الرسالة",scheduledCount:"مجدول",headerSubtitle:"إرسال دوري ومحدد بالوقت",noSchedules:"لا توجد رسائل مجدولة حالياً.",typeRecurring:"متكرر",typeOnce:"مرة واحدة",deliveryFailed:"فشل الإرسال",deliveryActive:"نشط",changeChat:"تغيير المحادثة",weekdayRequired:"اختر يوماً واحداً على الأقل",tabIntegrations:"الربط والخدمات",integrationsDesc:"مفاتيح واجهات البرمجة (API) للخدمات الخارجية المرتبطة بالبوت",youtubeApiKey:"مفتاح YouTube Data API (اختياري)",selectModel:"اختر نموذجاً من القائمة...",availableModels:"النماذج المتاحة من المزود",customModel:"أو اكتب اسم نموذج مخصص",modelListToggle:"القائمة",modelCustomToggle:"مخصص",showSecret:"إظهار السر",hideSecret:"إخفاء السر",sessionStatus:"حالة الجلسة",sessionActive:"الجلسة متصلة وتستقبل الرسائل",sessionOffline:"الجلسة غير متصلة حالياً",connectedNumber:"الرقم المرتبط",tabFeedback:"الملاحظات والدعم",feedbackTitle:"أرسل ملاحظاتك إلى المطوّر",feedbackDesc:"مشكلة، اقتراح، أو سؤال — تُسلَّم رسالتك مباشرةً إلى مطوّر ليفيكس. لا يوجد وسيط ولا نظام تذاكر.",feedbackTopicLabel:"موضوع الرسالة",feedbackTopicBug:"هناك خلل",feedbackTopicIdea:"فكرة أو طلب",feedbackTopicQuestion:"سؤال",feedbackTopicPraise:"يعمل بشكل جيد",feedbackTopicOther:"شيء آخر",feedbackMessageLabel:"رسالتك",feedbackMessagePlaceholder:"ماذا حدث، وماذا كنت تتوقع، وماذا كنت تفعل في ذلك الوقت. التفاصيل تساعد — يقرأها شخص حقيقي.",feedbackCharsNeeded:"حرفاً إضافياً على الأقل",feedbackRatingLabel:"كيف يعمل ليفيكس معك؟ (اختياري)",feedbackContactLabel:"كيف نتواصل معك؟ (اختياري)",feedbackContactPlaceholder:"بريد إلكتروني أو معرّف واتساب/تيليجرام — فقط إن أردت رداً",feedbackSendBtn:"إرسال الملاحظات",feedbackSending:"جارٍ الإرسال...",feedbackSent:"تم الإرسال. شكراً لك!",feedbackSentDesc:"وصلت رسالتك إلى مطوّر ليفيكس. إن تركت وسيلة للتواصل، توقّع رداً.",feedbackSendAnother:"إرسال رسالة أخرى",feedbackWhatIsSent:"ما يُرسَل مع رسالتك",feedbackWhatIsSentDesc:"نص رسالتك، والموضوع، والتقييم ووسيلة التواصل إن أضفتهما، والملف الذي أرفقته إن وُجد، بالإضافة إلى إصدار ليفيكس والمنصة التي يعمل عليها. لا تُرسَل أي رسالة واتساب أو محادثة أو جهة اتصال أو مفتاح، ولا يُرسَل شيء إلا عند الضغط على إرسال.",feedbackRuntimeLabel:"يُرفَق مع الرسالة",feedbackGithubHint:"للأخطاء التي تريد تتبّعها علناً مع السجلات، افتح Issue على GitHub.",feedbackOpenGithub:"فتح Issue على GitHub",feedbackAttach:"إرفاق ملف",feedbackAttachmentHint:"اختياري — لقطة شاشة أو ملف سجل حتى {max} م.ب",feedbackRemoveAttachment:"إزالة المرفق",fileSizeKb:"{size} ك.ب",fileSizeMb:"{size} م.ب",feedbackFileTooLarge:"الملف كبير جداً — الحد الأقصى {max} م.ب",feedbackAttachDiagnostics:"إرفاق بيانات تشخيص الجهاز والبيئة التقنية وسجل التصحيح التقني",feedbackDiagnosticsPreview:"عرض ما سيتم إرساله بالضبط",feedbackDiagnosticsLoading:"جارٍ تحميل معاينة التشخيص...",feedbackDiagnosticsError:"تعذّر تحميل معاينة التشخيص",feedbackDiagnosticsEmpty:"لا توجد بيانات تشخيص متاحة",debugLogSectionLabel:"سجل التصحيح التقني (منقّح)",debugLogHint:"سجل تقني منقّح من آخر 14 يوماً. لا يحتوي كلمات مرور أو مفاتيح أو أرقام هواتف أو محتوى رسائل.",tabDiagnostics:"التشخيص والأعطال",diagnosticsTitle:"تقارير الأعطال والتشخيص",diagnosticsDesc:"راجع تقارير الأعطال المحلية قبل إرسالها لمساعدتنا في تحسين النظام وحل المشاكل.",pendingReports:"التقارير المعلقة",sentReports:"التقارير المرسلة",noPendingReports:"لا توجد تقارير أعطال معلقة",noSentReports:"لم يتم إرسال أي تقارير بعد",sendReport:"إرسال",sendingReport:"جارٍ الإرسال...",deleteReport:"حذف التقرير",deleteAllReports:"حذف الكل",confirmDeleteReport:"حذف هذا التقرير؟",confirmDeleteReportDesc:"سيتم حذف تقرير العطل هذا نهائياً من جهازك.",confirmDeleteAllReports:"حذف جميع التقارير؟",confirmDeleteAllDesc:"سيتم حذف جميع تقارير الأعطال المعلقة نهائياً من هذا الجهاز.",reportSentSuccess:"تم إرسال تقرير العطل بنجاح",reportDeleteSuccess:"تم حذف التقرير",allReportsDeleted:"تم حذف جميع التقارير بنجاح",crashReportPreview:"معاينة ما سيتم إرساله (JSON)",reportCategory:"الفئة",reportErrorType:"نوع الخطأ",reportTime:"الوقت",reportId:"المعرّف",reportStatus:"الحالة",reportLastError:"فشل الإرسال الأخير",errorBoundaryTitle:"حدث خطأ غير متوقع",errorBoundaryDesc:"واجهت لوحة التحكم خطأً أثناء العرض. تم تسجيل تفاصيل الخطأ محلياً لمساعدتك في تشخيصه.",errorBoundaryReload:"إعادة التحميل",errorBoundaryGoDiagnostics:"تقارير الأعطال",crashBannerTitle:"توقف ليفيكس بشكل غير متوقع",crashBannerDesc:"تم تسجيل تقرير عطل محلياً. يمكنك مراجعته وإرساله للمساعدة في حل المشكلة.",crashBannerReview:"مراجعة وإرسال",crashBannerNotNow:"ليس الآن",crashBannerDelete:"حذف التقارير",scheduleAttachMedia:"إرفاق وسائط",scheduleMediaHint:"اختياري — صورة أو فيديو أو صوت أو مستند حتى {max} م.ب",scheduleRemoveMedia:"إزالة الوسائط",scheduleDetails:"تفاصيل الرسالة المجدولة",detailMedia:"الوسائط",detailLastRun:"آخر إرسال",detailError:"الخطأ",detailCreated:"أُنشئت",retryDelivery:"إعادة محاولة الإرسال",mediaKindImage:"صورة",mediaKindVideo:"فيديو",mediaKindAudio:"صوت",mediaKindDocument:"مستند",stickerStudio:"استوديو الملصقات",stickersDesc:"إنشاء وإدارة ملصقات واتساب",library:"المكتبة",packs:"الحزم",favorites:"المفضلة",create:"إنشاء",recent:"مستخدمة حديثاً",allStickers:"الكل",static:"ثابت",animated:"متحرك",noPack:"بدون حزمة",anyPack:"أي حزمة",newPack:"حزمة جديدة…",addToPack:"إضافة لحزمة",moveToPack:"نقل لحزمة",removeFromPack:"إزالة من الحزمة",favorite:"إضافة للمفضلة",unfavorite:"إزالة من المفضلة",download:"تحميل",convertToImage:"تحويل لصورة",shareSticker:"مشاركة",sendViaWhatsapp:"إرسال عبر واتساب",deleteEverywhere:"حذف من كل مكان",deleteKeepStickers:"حذف الحزمة فقط (مع الاحتفاظ بالملصقات)",deletePackAndStickers:"حذف الحزمة والملصقات غير الموجودة في حزم أخرى",openInCreate:"فتح في المُنشئ",packName:"اسم الحزمة",mergeInto:"دمج في حزمة أخرى",merge:"دمج",stickersKept:"سيتم الاحتفاظ بالملصقات",trim:"اقتطاع المقطع",background:"الخلفية",transparent:"شفاف",white:"أبيض",black:"أسود",customColor:"لون مخصص",removePlainBackground:"إزالة الخلفية المسطحة",fit:"الملاءمة",contain:"احتواء",cover:"تغطية",zoom:"تكبير/تصغير",panX:"تحريك أفقي",panY:"تحريك عمودي",rotate:"تدوير",addText:"إضافة نص",addEmoji:"إضافة إيموجي",createAnother:"إنشاء آخر",qualityReduced:"تم ضغط الملصق ليناسب حد واتساب",alreadyInLibrary:"الملصق موجود بالفعل في المكتبة",encoderMissing:"لا يوجد محول WebP، إنشاء الملصقات معطل.",tryAgain:"حاول مرة أخرى",loadMore:"تحميل المزيد",selectAll:"تحديد الكل",clearSelection:"إلغاء التحديد",deleteConfirm:"هل أنت متأكد أنك تريد الحذف؟",nSelected:"{n} محددة",sizeLbl:"الحجم:",formatLbl:"التنسيق:",packsLbl:"الحزم:",gifBadge:"متحرك",startDur:"البداية: {start}ث | المدة: {dur}ث",outlineBox:"إطار/خلفية",toolsLbl:"الأدوات",clearLbl:"مسح",resetPan:"إعادة ضبط",clickOrDrag:"انقر أو اسحب صورة/فيديو للرفع",creatingSticker:"جارٍ إنشاء الملصق…",goToLibrary:"الذهاب للمكتبة",loadingLbl:"جارٍ التحميل…",selectPack:"اختر حزمة…",noPacksCreated:"لم يتم إنشاء أي حزم بعد",packCreated:"تم إنشاء الحزمة",packDeleted:"تم حذف الحزمة",packRenamed:"تم تغيير اسم الحزمة",failedToCreatePack:"فشل إنشاء الحزمة",failedToDeletePack:"فشل حذف الحزمة",failedToRenamePack:"فشل تغيير اسم الحزمة",failedToMerge:"فشل الدمج",someStickersInPacks:"بعض الملصقات موجودة في حزم: {packs}",deleteEverywherePrompt:"حذفها من كل مكان؟",packsMerged:"تم دمج الحزم",emptyLibrary:"المكتبة فارغة",jobStage_probing:"جارٍ الفحص…",jobStage_decoding:"جارٍ فك التشفير…",jobStage_encoding:"جارٍ التشفير…",jobStage_optimizing:"جارٍ التحسين…",jobStage_saving:"جارٍ الحفظ…",jobQueued:"جارٍ الانتظار في الطابور…",sortNewest:"الأحدث",sortOldest:"الأقدم",sortName:"الاسم",sortRecent:"الأحدث استخداماً",unlinkStickersWarning:"سيتم مسح مكتبة الملصقات بالكامل أيضاً.",stickerErr_NO_MEDIA:"أرسل صورة أو فيديو أو ملصقاً.",stickerErr_UNSUPPORTED_TYPE:"نوع الملف غير مدعوم.",stickerErr_TOO_LARGE:"الملف كبير جداً.",stickerErr_DIMENSIONS_TOO_LARGE:"أبعاد الصورة كبيرة جداً.",stickerErr_VIDEO_TOO_LONG:"الفيديو طويل جداً.",stickerErr_CORRUPT:"الملف تالف.",stickerErr_CONVERSION_FAILED:"فشل تحويل الملصق.",stickerErr_OUTPUT_TOO_LARGE:"حجم الملصق النهائي كبير جداً.",stickerErr_ENCODER_MISSING:"الخادم لا يدعم معالجة WebP.",stickerErr_TIMEOUT:"انتهى وقت المعالجة.",stickerErr_BUSY:"النظام مشغول، يرجى المحاولة لاحقاً.",stickerErr_NOT_FOUND:"الملصق غير موجود.",stickerErr_PACK_NOT_FOUND:"الحزمة غير موجودة.",stickerErr_PACK_EXISTS:"اسم الحزمة موجود بالفعل.",stickerErr_INVALID_NAME:"اسم الحزمة غير صالح.",stickerErr_INVALID_OPTIONS:"خيارات التعديل غير صالحة.",stickerErr_LIBRARY_FULL:"المكتبة ممتلئة.",stickerErr_PACK_LIMIT:"تم الوصول للحد الأقصى للحزم.",stickerErr_IN_USE:"الملصق مستخدم في حزم أخرى.",stickerErr_STORAGE_UNAVAILABLE:"مساحة التخزين غير متوفرة.",stickerErr_NOT_CONNECTED:"واتساب غير متصل.",stickerErr_INTERNAL:"خطأ داخلي في الخادم.",stickerErr_CANCELLED:"أُلغي التحويل.",stickerLibraryLimit:"الحد الأقصى للملصقات",stickerLibraryLimitDesc:"عدد الملصقات التي يمكن لكل شخص الاحتفاظ بها في استوديو الملصقات.",autoDeleteKeepDays:"مدة الاحتفاظ بنسخ الحذف التلقائي (أيام)",autoDeleteKeepDaysDesc:"كم يوماً تبقى نسخ النص التي تحتفظ بها قواعد الحذف التلقائي.",stickerUploadInfo:"{kind} · {size} كيلوبايت",stickerRemoveHint:"تُطبّق إزالة الخلفية المسطحة عند الإنشاء.",stickerSelect:"تحديد الملصق",deselectSticker:"إلغاء تحديد الملصق",selectCurrentPage:"تحديد الصفحة الحالية",stickerOpen:"فتح تفاصيل الملصق",stickerShareSaved:"حُفظ الملف في {dir}",stickerDrag:"اسحب ملفًا إلى هنا أو اختره",stickerAlignmentStart:"البداية",stickerAlignmentCenter:"الوسط",stickerAlignmentEnd:"النهاية",stickerKindImage:"صورة",stickerKindGif:"صورة متحركة",stickerKindVideo:"فيديو",stickerKindWebp:"ملصق WebP",stickerDeletePackWarning:"سيُحذف الملصق من جميع الحزم.",stickerSendLimit:"يمكن إرسال عدد محدود من الملصقات دفعة واحدة.",stickerExportLimit:"اختر عددًا أقل من الملصقات للتصدير.",tolerance:"نسبة التسامح",stickerName:"اسم الملصق",stickerNamePlaceholder:"اسم اختياري…",trimStart:"البداية",trimDuration:"المدة",trimSeconds:"ثوانٍ",textContent:"النص",textSize:"الحجم",textColor:"اللون",textAlignment:"المحاذاة",textOutline:"إطار",textBackground:"خلفية النص",layerRotation:"الدوران",deleteLayer:"حذف الطبقة",noLayers:"لا توجد طبقات",reorderUp:"تقديم",reorderDown:"تأخير",renamePack:"تغيير اسم الحزمة",deletePack:"حذف الحزمة",packEmpty:"هذه الحزمة فارغة",noPacks:"لا توجد حزم بعد",createFirstPack:"أنشئ حزمتك الأولى",stickerCount:"{n} ملصقات",notConnectedHint:"اتصل بواتساب أولاً",exportFirstFrame:"يصدّر الإطار الأول",downloadWebp:"تحميل WebP",downloadPng:"تحميل PNG",downloadGif:"تحميل GIF",reorderDragHint:"اسحب لإعادة الترتيب",saved:"تم الحفظ",createBtn:"إنشاء ملصق",uploadHint:"يقبل JPEG، PNG، WebP، GIF، MP4، WebM",stickerCreated:"تم إنشاء الملصق!",stickerSent:"تم إرسال الملصق",stickersSent:"تم إرسال الملصقات",stickerPreview:"معاينة الملصق",firstFrameHint:"يُصدَّر الملصق المتحرك كصورة ثابتة من إطاره الأول.",gifOnlyAnimated:"تصدير GIF متاح للملصقات المتحركة فقط.",rename:"إعادة التسمية",inUsePacksLabel:"في هذه الحزم",notInPack:"ليس في أي حزمة",retryLoad:"إعادة المحاولة",showingCount:"يُعرض {shown} من {total}",emojiPaletteLabel:"الرموز التعبيرية",customEmoji:"رمز آخر",emojiInputLabel:"اكتب رمزًا تعبيريًا",textPlaceholder:"نص",layerSelected:"الطبقة المحددة",selectVisible:"تحديد الظاهر",downloadZip:"تنزيل ملف مضغوط",noRecipients:"لا توجد محادثات",recipientGroup:"مجموعة",recipientContact:"جهة اتصال",sending:"جارٍ الإرسال…",deleteStickersTitle:"حذف الملصقات",inUseBody:"هذا الملصق داخل حزمة. حذفه يزيله من تلك الحزم أيضًا.",inUseBulkBody:"بعض الملصقات المحددة موجودة في حزم، ولم تُحذف.",deleteEverywhereHint:"الحذف من كل مكان يزيل الملصقات من جميع الحزم ومن المكتبة.",packNameLength:"يجب أن يكون اسم الحزمة بين حرف واحد و40 حرفًا.",newPackPlaceholder:"اسم الحزمة",createPack:"إنشاء حزمة",skippedOther:"تعذّر تحديث بعض الملصقات.",addedToPack:"أُضيف إلى الحزمة",movedToPack:"نُقل إلى الحزمة",removedFromPack:"أُزيل من الحزمة",renamed:"تم تحديث الاسم",downloaded:"بدأ التنزيل",shareDone:"تمت المشاركة",backToPacks:"كل الحزم",confirmMerge:"دمج الحزم",mergeTitle:"دمج في حزمة أخرى",mergeConfirmBody:"تبقى الملصقات في المكتبة. تُلحَق عناصر هذه الحزمة بالحزمة الأخرى، ويُتخطى المكرر، ثم تُحذف هذه الحزمة.",trimApplied:"يُطبَّق الاقتطاع عند إنشاء الملصق.",gifTrimNote:"يُطبَّق اقتطاع الصورة المتحركة عند الإنشاء، وقد لا يطابق المعاينة إطارًا بإطار.",animatedUnavailable:"هذا الخادم لا يستطيع ترميز الملصقات المتحركة.",targetPack:"إضافة إلى حزمة",previewStage:"معاينة الملصق",rotateQuarter:"تدوير 90 درجة",uploadReady:"الملف جاهز",stickerNameTooLong:"يمكن أن يبلغ اسم الملصق 60 حرفًا كحد أقصى.",noDestinationPack:"اختر حزمة للدمج فيها.",deletePackTitle:"حذف الحزمة",openPack:"فتح الحزمة",searchStickers:"البحث في الملصقات",sortBy:"الترتيب",filterBy:"التصفية",packFilter:"الحزمة",noResults:"لا توجد ملصقات مطابقة للبحث",favoritesEmpty:"لا توجد ملصقات مفضلة بعد",recentEmpty:"لا توجد ملصقات استُخدمت أو أُنشئت خلال آخر 30 يومًا",favoriteBadge:"مفضلة",deleted:"تم الحذف",autoDelete:"الحذف التلقائي",autoDeleteSubtitle:"احذف الرسائل التي تحتوي على كلمات تختارها.",newRule:"قاعدة جديدة",editRule:"تعديل القاعدة",searchRules:"ابحث بالاسم أو الكلمة",sortByName:"الاسم",sortMostDeleted:"الأكثر حذفًا",sortLastDeleted:"آخر حذف",filterStatus:"الحالة",statusAny:"الكل",statusEnabled:"مفعّلة",statusDisabled:"متوقفة",filterChat:"المحادثات",filterSender:"المرسلون",chatsAll:"كل المحادثات",chatsGroups:"المجموعات فقط",chatsPrivate:"الخاصة فقط",sendersEveryone:"الجميع",sendersSelected:"جهات محددة",oneContact:"جهة واحدة",sendersCount:"{n} جهات",matchMode:"المطابقة",matchContains:"يحتوي",matchWord:"كلمة كاملة",matchExact:"الرسالة كاملة",matchContainsHint:"تُحذف الرسالة إذا تضمن نصها الكلمة.",matchWordHint:"تُحذف عندما تقف الكلمة وحدها، لا داخل كلمة أطول.",matchExactHint:"تُحذف فقط عندما تكون الرسالة كلها هي الكلمة تمامًا.",chatScopeLabel:"المحادثات",ruleName:"الاسم",ruleNamePlaceholder:"اسم اختياري",keywordsLabel:"الكلمات",keywordsPlaceholder:"اكتب كلمة ثم اضغط Enter",keywordCount:"{n} / {max}",keywordTooLong:"يجب ألا تتجاوز الكلمة 100 حرف.",keywordEmpty:"هذه الكلمة فارغة بعد تنظيفها.",keywordDuplicate:"هذه الكلمة موجودة في القائمة.",keywordsRequired:"أضف من كلمة واحدة إلى 50 كلمة.",keywordsMax:"يمكن أن تضم القاعدة 50 كلمة كحد أقصى.",nameTooLong:"يجب ألا يتجاوز الاسم 60 حرفًا.",includeOwn:"احذف رسائلي أيضًا",includeOwnHint:"تُحذف رسائل الحساب المرتبط أيضًا.",forEveryone:"احذف لدى الجميع عندما يمكن ذلك",forEveryoneHint:"تُحذف رسائل الآخرين لدى الجميع فقط في المجموعات التي يكون فيها الحساب المرتبط مشرفًا. وإلا تُزال من هذا الجهاز فقط.",keepCopy:"احتفظ بنسخة في Levix",keepCopyHint:"يُحفظ النص أو التعليق فقط، ولا تُحفظ الوسائط أبدًا. تتبع النسخ إعداد «أيام الاحتفاظ بنسخ الحذف التلقائي».",keepCopyPrivacy:"تبقى النسخ على هذا الجهاز مع بيانات البوت. وهي ليست نسخة احتياطية للمحادثة.",ruleEnabled:"مفعّلة",deletedLabel:"محذوفة",lastDeleted:"آخر حذف",neverDeleted:"لم يُحذف شيء بعد",moreKeywords:"+{n}",resetCounter:"تصفير العداد",viewCopies:"عرض النسخ المحفوظة",deleteRule:"حذف القاعدة",deleteRuleTitle:"حذف هذه القاعدة؟",deleteRuleBody:"تتوقف «{name}» عن المطابقة. وتُحذف النسخ المحفوظة لهذه القاعدة أيضًا.",counterReset:"تم تصفير العداد",ruleSaved:"تم حفظ القاعدة",ruleDeleted:"تم حذف القاعدة",ruleSaveFailed:"تعذر حفظ القاعدة.",noRulesTitle:"لا توجد قواعد حذف تلقائي بعد",noRulesBody:"تُحذف تلقائيًا الرسائل التي تحتوي على الكلمات التي تضيفها.",noRulesMatch:"لا توجد قواعد تطابق هذا البحث",rulesTab:"القواعد",copiesTab:"النسخ المحفوظة",noCopiesTitle:"لا توجد نسخ محفوظة",noCopiesBody:"عندما تحتفظ قاعدة بنسخة، يظهر النص هنا.",noCopiesForRule:"لا توجد نسخ لهذه القاعدة",clearCopies:"مسح النسخ",clearCopiesForRule:"مسح نسخ هذه القاعدة",clearCopiesTitle:"مسح النسخ المحفوظة؟",clearCopiesBody:"هذا يزيل النص المخزن. ولا يمكن التراجع عنه.",clearCopiesRuleBody:"هذا يزيل النص المخزن لـ«{name}». ولا يمكن التراجع عنه.",copiesCleared:"تم مسح النسخ",copyChat:"المحادثة",copySender:"المرسل",mediaText:"نص",mediaImage:"صورة",mediaVideo:"فيديو",mediaAudio:"صوت",mediaSticker:"ملصق",mediaDocument:"مستند",modeRevoke:"حُذفت لدى الجميع",modeForMe:"حُذفت على هذا الجهاز",selectContacts:"اختيار جهات",addPhone:"إضافة رقم",phonePlaceholder:"رقم الهاتف",invalidPhone:"أدخل رقم هاتف من 8 إلى 15 رقمًا.",sendersRequired:"اختر جهة أو رقمًا واحدًا على الأقل.",sendersHelp:"اختر جهات، أو اكتب رقم هاتف.",tooManySenders:"يمكنك اختيار 200 جهة كحد أقصى.",removeKeyword:"إزالة {word}",removeContact:"إزالة {name}",groupSenderRejected:"يجب أن يكون المرسلون جهات اتصال، لا مجموعات.",rulesLimit:"يمكنك الاحتفاظ بـ 100 قاعدة كحد أقصى.",toggleFailed:"تعذر تحديث القاعدة.",rulesLoadFailed:"تعذر تحميل قواعد الحذف التلقائي.",copiesLoadFailed:"تعذر تحميل النسخ المحفوظة.",allRules:"كل القواعد",filterByRule:"القاعدة",noContacts:"لا توجد جهات اتصال",contactAdded:"مضافة",saveRule:"حفظ القاعدة",recipientsLoadFailed:"تعذر تحميل المحادثات.",tourBack:"رجوع",tourNext:"التالي",tourDone:"تم",tourSkip:"تخطي الجولة",tourStepOf:"خطوة {n} من {total}",tourScreenHelp:"دليل هذه الشاشة",tourReplayTitle:"جولة إرشادية",tourReplayDesc:"إعادة عرض شرح اللوحة خطوة بخطوة فوق العناصر الحقيقية.",tourReplayAction:"إعادة العرض",tourSidebarTitle:"هذه غرفة التحكم الخاصة بك",tourSidebarBody:"القائمة الجانبية تفتح كل شاشات البوت: نظرة عامة، الاتصال، الأوامر، الذكاء الاصطناعي، المجموعات والمزيد. اضغط أي عنصر للانتقال إليه.",tourConnectionStartTitle:"ربط واتساب",tourConnectionStartBody:"اضغط هذا الزر لربط حساب واتساب أو استئناف جلستك المحفوظة. البوت يرد من هذا الحساب.",tourConnectionPairingTitle:"خطوات الربط",tourConnectionPairingBody:"اختر ما يناسبك: كود رقمي تدخله في واتساب، أو مسح رمز QR. الطريقتان تؤديان إلى النتيجة نفسها، والربط لا يتجاوز دقيقة.",tourOverviewStatsTitle:"بوتك في نظرة واحدة",tourOverviewStatsBody:"هذه البطاقات تعرض أرقاماً حية: مجموعات واتساب لديك، عدد الأوامر، مدة تشغيل البوت، ورسائله المجدولة.",tourCommandsTitle:"كتالوج الأوامر",tourCommandsBody:"كل أمر يستجيب له البوت. افتح أي صف لتشغيله أو إيقافه، أو تغيير من يمكن استخدامه، أو إدارة اختصاراته. استخدم البحث والتصفية في الأعلى للوصول بسرعة.",tourAiAgentTitle:"تشغيل المساعد الذكي",tourAiAgentBody:"هذا المفتاح يشغّل المساعد الذكي. عندما يعمل، يستطيع الأشخاص سؤاله بأمر !ai داخل محادثاتك.",tourAiProviderTitle:"اختر عقل الذكاء الاصطناعي",tourAiProviderBody:"اختر المزوّد — Google Gemini أو خادم متوافق مع OpenAI أو Anthropic — ثم الصق مفتاح API الخاص به واسم الموديل. مفتاحك يبقى على هذا الجهاز.",tourAiMemoryTitle:"علّمه بطريقتك",tourAiMemoryBody:"اكتب شخصية المساعد في «الشخصية» واحفظ الحقائق التي يجب أن يتذكرها في «الذاكرة» — يقرأ الاثنين عند كل رد.",tourGroupsTitle:"إشراف المجموعات",tourGroupsBody:"كل مجموعة أنت فيها معروضة هنا. افتح أي مجموعة لضبط منع الروابط، ورسالة الترحيب، وقيود الوسائط والقوانين — وتُطبَّق فوراً.",tourStickersTitle:"استوديو الملصقات",tourStickersBody:"أنشئ ملصقات من الصور والفيديوهات، واحفظها هنا، واجمعها في حزم. كل ما يرسله البوت أو ترفعه من اللوحة يذهب إلى مكتبة واحدة مشتركة.",tourSchedulesTitle:"الرسائل المجدولة",tourSchedulesBody:"جدولة رسالة مرة واحدة في وقت محدد، أو تكرارها بشكل دوري. تحفظ القائمة كل الوظائف، وتُوسم الرسائل التي فشل إرسالها للمراجعة.",tourLogsTitle:"السجلات المباشرة",tourLogsBody:"كل ما يفعله البوت يظهر هنا مباشرة، لتتابع الردود وتكتشف الأخطاء فور حدوثها.",tourSettingsTitle:"أول محطة في الإعدادات",tourSettingsBody:"اضبط بادئة الأوامر ولغة الواجهة ولغة البوت والمنطقة الزمنية من هنا. تبويب «عام» يُصدِّر إعداداتك أيضاً لربطها بجهاز آخر.",tourSettingsPasswordTitle:"احمِ لوحة التحكم",tourSettingsPasswordBody:"من هذا التبويب تغيّر كلمة السر التي تفتح اللوحة. كلمة سر طويلة هنا تحمي جلسة واتساب وإعداداتك.",tourSettingsFeedbackTitle:"أخبر المطوّر",tourSettingsFeedbackBody:"اللوحة تعمل على بيانتك فقط. إن أعجبك شيء أو واجهتك مشكلة، استخدم هذا التبويب لإرسال ملاحظة — لا شيء يخرج من جهازك إلا بضغطتك.",tourSettingsDiagnosticsTitle:"تقارير الأعطال",tourSettingsDiagnosticsBody:"إذا تعطّل التطبيق أو اللوحة، يُجمع هنا تقرير مختصّ لا يحمل أي بيانات تعريفية. تعاينه كاملاً وترسله عند تقرر ذلك."},en:{unknownContact:"Unknown contact",showNumber:"Show phone number",hideNumber:"Hide phone number",clearLogsConfirm:"Delete stored logs?",clearLogsBody:"This deletes the stored logs for the selected source. New events will still be recorded.",logsCleared:"Stored logs cleared",logsLoadFailed:"Could not load logs. Retrying…",logsClearFailed:"Could not clear stored logs. Please try again.",botAdminHint:"WhatsApp moderation actions require the bot to be a group admin. Command permissions still apply.",antiSpam:"Anti-spam",autoApprove:"Approve join requests automatically",blockImages:"Block photos",blockVideos:"Block videos",blockAudio:"Block audio",blockStickers:"Block stickers",groupModeration:"Moderation settings",linkMode:"Link policy",linkAll:"Block all links",linkWhitelist:"Allow listed domains only",linkBlacklist:"Block listed domains only",allowedDomains:"Domains, one per line",spamWindow:"Spam window (seconds)",spamLimit:"Messages before action",spamAction:"Spam action",actionWarn:"Warn member",actionKick:"Remove member",actionNone:"Keep member",actionFlag:"Flag for admin review",actionDelete:"Delete the message only",actionDeleteWarn:"Delete and warn",actionDeleteKick:"Delete and remove now",linkAction:"Anti-link action",mediaAction:"Media action",wordsAction:"Forbidden-words action",forbiddenWords:"Forbidden words",flaggedMembers:"Members waiting for review",flaggedEmpty:"No members are flagged for review.",kickFlagged:"Kick",clearWarnings:"Clear warnings",dismissFlag:"Dismiss flag",policyPreset:"Preset",presetRelaxed:"Relaxed",presetStandard:"Standard",presetStrict:"Strict",presetCustom:"Custom",policyMode:"How warnings add up",policyModeSimple:"One point per violation",policyModeSeverity:"By severity",policyFlagAt:"Points before asking admins to review",policyKickAt:"Points before removing the member",policyHitMerge:"If one message breaks several rules",policyHitMergeMax:"Count the strongest rule only",policyHitMergeSum:"Add the points together",policyActionDefault:"Default (same as warn)",policyLinkLabel:"When someone sends a link",policyMediaLabel:"When someone sends media",policyForbiddenLabel:"When someone uses forbidden words",policySpamLabel:"When someone floods the group",policyDecay:"Warnings fade",policyDecayOff:"They don't",policyDecayExpire:"Drop the whole warning after",policyDecayStep:"Lose one point every",policyDecayDays:"Days",policyMembership:"If a member leaves and comes back",policyMembershipKeep:"Keep their warnings",policyMembershipClear:"Clear their warnings",policyBlockTitle:"Enforcement",policyFlagNotify:"Post a notice in the group",policyNotifyGroup:"Yes, post it",policyNotifySilent:"Don't post it",policyMentionAdmins:"Mention the admins",policyCooldown:"Minutes to wait before posting that notice again",policyCooldownHint:"Set 0 to post it every time.",policyWhileFlagged:"While admins have not reviewed them",policyWhileFlaggedRecord:"Keep counting",policyWhileFlaggedHold:"Pause counting",policyWhileFlaggedEscalate:"Remove them after more warnings",policyEscalateAfter:"Extra warnings before removal",policyWeightLink:"Points for a link",policyWeightMedia:"Points for media",policyWeightForbidden:"Points for forbidden words",policyWeightSpam:"Points for spam",policyWeightManual:"Points for a manual warning",warningLimit:"Warning limit",warningAction:"At the warning limit",groupRules:"Group rules",rulesAndModeration:"Rules & moderation",moderationPreview:"Active moderation preview",moderationPreviewHint:"Members see this block under the rules and in the welcome message.",welcomeMessages:"Welcome messages, one per line",groupCommands:"Group commands & permissions",overview:"Overview",stickers:"Sticker Studio",connection:"Connection",control:"Control & Management",commands:"Command Catalog",ai:"AI & Memory",groups:"Groups",roles:"Roles & Admins",schedules:"Scheduled Messages",notes:"Notes & Lists",settings:"Settings",logs:"Live Logs",connected:"Connected to WhatsApp",disconnected:"Disconnected",starting:"Starting socket...",waiting_for_qr:"Waiting for QR scan",linking:"Linking session...",reconnecting:"Reconnecting...",retry_exhausted:"Retries exhausted",logged_out:"Logged out from phone",idle:"Session idle",paused:"Paused",resume:"Resume session",connectSession:"Connect",start:"Start Connection",stop:"Pause",reconnect:"Reconnect",unlink:"Unlink Device",restart:"Restart Bot",save:"Save Changes",saving:"Saving...",discard:"Discard",unsavedChanges:"Unsaved changes",toggleOn:"On",toggleOff:"Off",cancel:"Cancel",delete:"Delete",edit:"Edit",add:"Add",refresh:"Refresh",logout:"Sign Out",backToApp:"Back to app",close:"Close",copy:"Copy",copied:"Copied!",filter:"Filter",sort:"Sort",more:"More",reset:"Reset",autoScroll:"Auto-scroll",dismiss:"Dismiss",openNavigation:"Open navigation",closeNavigation:"Close menu",pagination:"Pagination",previousPage:"Previous page",nextPage:"Next page",pageOf:"Page {page} of {count}",resultCount:"{n} results",emptyRecords:"No records yet",emptyMatches:"No matching results",loadError:"Could not load data",clearFilters:"Clear filters",searchGroups:"Search by group name",searchSchedules:"Search messages and targets",sortByMembers:"Members",mediaCustom:"Custom media",mediaWith:"With media",mediaWithout:"Without media",logsSubtitle:"Real-time streaming console for WhatsApp socket, AI calls, and bot commands",groupsSubtitle:"WhatsApp group moderation, anti-link defense, media filtering, and automated greetings",groupsCount:"{n} groups",noGroupsTitle:"No active groups found",noGroupsBody:"Once the bot is added to WhatsApp groups, they will automatically appear here with full moderation and anti-link controls.",unnamedGroup:"Unnamed group",mediaNone:"No Restrictions",mediaBlockAll:"Block All Media",clientIdentity:"Client Identity",noPhonePaired:"No phone paired yet",linkedAs:"Linked as",datastoreHealth:"Datastore Health",datastoreHealthy:"SQLite credentials, auth keys, and LID mappings are healthy.",reconnectPolicy:"Reconnect Policy",reconnectPolicyDesc:"Staged linear backoff (5s, 10s, 15s, 20s, 25s) with bounded retries.",maxAttemptsAutoPause:"Max attempts: 5 • Auto-pause offline",platformWeb:"Platform: WhatsApp Web (v7 Multi-Device)",databaseNodeSqlite:"Database: node:sqlite (Synchronous)",totalGroups:"Total Groups",totalUsers:"Registered Users",commandCount:"Enabled Commands",uptime:"Uptime",uptimeDayUnit:"d",uptimeHourUnit:"h",uptimeMinuteUnit:"m",online:"ONLINE",offline:"OFFLINE",quickCommandsDesc:"{n} active commands & aliases",moreActions:"More actions",lightMode:"Light mode",darkMode:"Dark mode",quickStatus:"System Status",activeSchedules:"Active Schedules",activeListening:"Active and listening to messages",pausedOrLinking:"WhatsApp connection is currently paused or linking",aiTitle:"AI Assistant Configuration",aiSubtitle:"Select a provider with one click or configure custom endpoints and keys",aiAgentEnabled:"Enable AI Agent",aiProvider:"Active Provider",quickSetup:"Quick Provider Setup Wizard",aiVision:"Image Understanding (Vision)",aiVisionDesc:"Encode attached images and pass to supported multimodal vision models",aiStt:"Speech-to-Text Provider (STT)",sttDesc:"Speech-to-text transcription engine for voice notes",sttAuto:"Auto (Matches active provider)",sttGemini:"Google Gemini Audio API",sttOpenAI:"OpenAI / Groq Whisper API",botLanguage:"Bot Response Language",botLanguageDesc:"Set bot response language directly or via command !lang",langAuto:"Auto-detect (matches user's language)",langAr:"Modern Standard Arabic (Always)",langEn:"English (Always)",modelName:"Model",apiKey:"API key",enterApiKey:"Enter API key",baseUrl:"Base URL",maxToolSteps:"Max Tool Steps",googleSearch:"Built-in Google Search Grounding",personaPrompt:"AI Persona System Prompt",personaDesc:"Edit the live system prompt that shapes your AI assistant's persona, tone, and behavior.",editPersona:"Edit System Prompt",translateEngine:"Translate engine",translateEngineDesc:"Default engine for !translate. Override a call with !translate ai or !translate google.",translateEngineAi:"AI (active provider)",translateEngineGoogle:"Google Translate",googleTranslateApiKey:"Google Translate API key",googleTranslateApiKeyDesc:"Optional Cloud Translation API v2 key. Without it, !translate google uses the public endpoint.",memoryFiles:"Long-term Memory",memoryDesc:"The bot's durable memory. Global memory is shared by every chat; each chat also has its own file. The bot reads saved entries and any free-form text you write.",manageMemory:"Manage Memory Files",memoryGlobalScope:"Global memory",memoryGlobalScopeHint:"Injected into every chat",memoryChatScopeHint:"Injected into this chat only",memoryEntriesCount:"{n} saved entries",memoryProseHint:"Everything in this file reaches the bot: lines starting with '-' are separate entries it can add or forget, and free-form text is included verbatim.",memoryEditorPlaceholder:"Write anything you want the bot to remember for good…",aiInspector:"AI Conversation Inspector",aiInspectorDesc:"Read-only view of each chat's stored conversation context: replies, media references and tool usage.",openInspector:"Open Inspector",noConversations:"No stored conversations yet.",convTurns:"{n} parts",backToList:"Back to list",convTruncated:"Showing only the latest 200 parts.",convMedia:"media file",capabilities:"Capabilities & Toggles",modelsAvailableLive:"Models Available for Your Account (Live API Verified)",modelsRecommendedSeed:"Recommended / Known Models (Catalog)",connectKeyFirstPrompt:"Please connect your API key first to discover models available to your account",refreshModels:"Refresh Models",refreshing:"Refreshing...",fetchModels:"Fetch Available Models",fetchingModels:"Discovering models...",capVision:"Vision",capStt:"Speech",capAudio:"Audio in",capText:"Text",capPdf:"PDF",capVideo:"Video",supported:"Supported",unsupported:"Unsupported",sourceLive:"Your account",sourceSeed:"Catalog",sourceUnknown:"Unknown",retry:"Retry",noModelsFound:"No models found for this provider",noMemoryFiles:"No memory files found",capSupportedDesc:"Supported by this model",capUnsupportedDesc:"Not supported by this model",capUnknownDesc:"Support status unknown for this model",visionUnsupportedNotice:"The selected model does not support Vision (image understanding). Feature disabled automatically.",sttUnsupportedNotice:"The selected model does not support Speech-to-Text (STT). Feature disabled automatically.",aiSttEnabled:"Enable Speech-to-Text (STT)",aiSttEnabledDesc:"Audio transcription and voice note understanding using the active model",providerGemini:"Google Gemini",providerGeminiDesc:"Default provider with native Google Search, Files upload, and Multimodal support",providerGroq:"Groq Cloud",providerGroqDesc:"Ultra-fast inference for Llama 3 & Mixtral models with Vision support",providerOpenAI:"OpenAI / Compatible",providerOpenAIDesc:"For GPT-4o models or any OpenAI-compatible API gateway",providerOllama:"Ollama (Local)",providerOllamaDesc:"Run local open-source models completely offline on your own machine",providerAnthropic:"Anthropic Claude",providerAnthropicDesc:"For Claude 3.5 Sonnet advanced reasoning models",scanQrHint:"Open WhatsApp on your phone > Settings > Linked Devices > Link a Device, and scan the QR code below.",pairingCode:"Pairing Code",reconnectingSoon:"Reconnecting soon...",nextAttemptIn:"Next attempt in",seconds:"seconds",tabGeneral:"General & Prefix",tabAI:"AI Assistant",tabSecurity:"Security & Access",tabProxy:"WhatsApp Proxy",tabStorage:"Storage & Media",tabLogs:"System Logs",prefixTitle:"Bot Command Prefix",prefixDesc:"The leading character or symbol that triggers commands in WhatsApp chats (e.g. !help, /ping)",prefixPlaceholder:"e.g. !",prefixPresets:"Common Quick Presets:",prefixPreview:"Live Command Syntax Preview:",prefixSaveBtn:"Save New Prefix",prefixUpdated:"Command prefix updated successfully!",prefixValidation:"Prefix must be 1 to 3 characters long",activePrefix:"Active Prefix",changePrefix:"Change Prefix",prefix:"Command Prefix",botTimezone:"Timezone",botTimezoneDesc:"IANA timezone used for prayer times, AI context, and cron schedules (e.g. Africa/Cairo)",botMinDelay:"Min Human Delay (ms)",botMaxDelay:"Max Human Delay (ms)",delaysDesc:"Simulated human typing pause before replying to avoid robotic triggers",delayRangeError:"Min delay must be less than or equal to max delay.",shareSettingsTitle:"Share Settings",shareSettingsDesc:"Export your settings as a JSON file to share with friends, or import a friend's file. Secrets (API keys and passwords) are never exported and never overwritten by an import.",exportAction:"Export",exportSettings:"Export settings",exportSettingsDesc:"A JSON file of the non-secret settings you changed",exportSettingsSuccess:"Settings exported",exportSavedTo:"Saved to",exportSettingsError:"Couldn't export the settings",importSettings:"Import from file",importSettingsError:"Invalid file — expected a Levix settings export",importTitle:"Import settings",importSummary:"This will apply to this install:",importSettingsCount:"settings",importPermissionsCount:"command permissions",importAliasesCount:"alias sets",importDisabledCount:"disabled commands",importPrefix:"Prefix",importApply:"Apply import",importSuccess:"Settings imported",importSkipped:"Skipped",importRestartNeeded:"Needs a bot restart to take effect",changePassword:"Change Dashboard Password",currentPassword:"Current Password",newPassword:"New Password",confirmPassword:"Confirm New Password",passwordMatchError:"Passwords do not match",passwordMinLength:"Password must be at least 8 characters long",passwordChangedSuccess:"Dashboard password changed successfully!",recoveryEmailTitle:"Recovery email",recoveryEmailTokenPolicy:"Verifying this address again disables email recovery on other installations using it. Verification is also required after 365 days without an accepted reset request.",recoveryEmailReverify:"Your saved email needs verification again. Enter your address and panel password below. WhatsApp and levix reset-password remain available.",recoveryEmailDesc:"If you forget the panel password, Levix sends a one-time code to this address. The address is only used after you verify it.",recoveryEmailLabel:"Email address",recoveryEmailSendCode:"Send code",recoveryEmailCode:"Verification code",recoveryEmailCodeSent:"Enter the 6-digit code. It works for 10 minutes.",recoveryEmailVerify:"Verify",recoveryEmailCurrent:"Verified address",recoveryEmailChange:"Change",recoveryEmailRemove:"Remove recovery email",recoveryEmailRemoveTitle:"Remove the recovery email?",recoveryEmailRemoveDesc:"Forgot password will no longer be able to email you a code.",recoveryEmailRemoved:"Recovery email removed",recoveryEmailVerified:"Recovery email verified",recoveryEmailStays:"The current address stays active until the new one is verified.",recoveryEmailPasswordHint:"A recovery email can reset the password, so adding one asks for it.",recoveryErrInvalidEmail:"Enter a valid email address.",recoveryErrWrongPassword:"The current password is wrong.",recoveryErrThrottled:"Too many requests. Try again in {n} seconds.",recoveryErrRateLimited:"The mail service is busy. Try again in a little while.",recoveryErrUnavailable:"Couldn't reach the mail service. Check the connection and try again.",recoveryErrInvalid:"The mail service rejected this address.",recoveryErrWrongCode:"Wrong code.",recoveryErrAttemptsLeft:"{n} attempts left.",recoveryErrExpired:"This code is no longer valid. Send a new one.",recoveryErrFailed:"Couldn't update the recovery email. Try again.",proxyTitle:"Outbound WhatsApp Proxy",proxyDesc:"Route Baileys WhatsApp traffic through an HTTP or SOCKS5 proxy to bypass restrictions",proxyEnabled:"Enable Outbound Proxy for WhatsApp",proxyProtocol:"Proxy Protocol",proxyHost:"Proxy Host / IP",proxyPort:"Proxy Port",proxyUsername:"Username (Optional)",proxyPassword:"Password (Optional)",proxyApplyHint:"⚠️ Note: To apply proxy changes, go to Connection and reconnect WhatsApp.",storageTitle:"Data Retention & Storage Limits",storageDesc:"Configure data cleanup thresholds, forward score retention, and fetch limits",forwardTtl:"Forward Score Expiry (Days)",forwardTtlDesc:"Automatically purge forwarded message scores after this many days",maxFetchBytes:"Web Fetch Byte Limit",maxFetchBytesDesc:"Maximum response body size AI tools are allowed to fetch from web pages (default: 512KB)",ffmpegPath:"Custom FFmpeg Binary Path (Optional)",weatherApiKey:"OpenWeatherMap API Key (Optional)",chooseLanguage:"Choose Language",langCardTitle:"Interface Language: English (LTR)",langCardDesc:"Full bidirectional layout support with optimized Arabic RTL & English LTR",langSwitchBtn:"التبديل إلى العربية",langName:"English",interfaceLanguage:"Dashboard Interface Language",interfaceLanguageDesc:"Arabic (RTL) or English (LTR) for this panel",botPort:"Control Panel Port",botPortHint:"* Changing port takes effect on next process restart",searchPlaceholder:"Search commands or aliases...",thCommand:"Command",thAliases:"Aliases",thDescription:"Description",thScope:"Scope",thRequiredRole:"Required Role",thStatus:"Status",thGroupName:"Group Name",thGroupJid:"Group JID",thMembers:"Members",thAntiLink:"Anti-Link",thMedia:"Media",thWelcome:"Welcome",thTarget:"Target",thMessage:"Message",thSchedule:"Schedule",thType:"Type",thDelivery:"Delivery Status",thActions:"Actions",scheduleNewMsg:"Schedule New Message",liveServerLogs:"Live Server Logs",clearLogs:"Clear Logs",allLogs:"All Levels",noLogs:"No log entries to display.",logSourceBot:"Bot",logSourceHost:"Android host",shareLogs:"Share logs",share:"Share",savedSuccessfully:"Settings saved successfully!",saveFailed:"Failed to save settings.",connectionStatusUpdated:"Connection status updated.",networkError:"Network error connecting to server.",loading:"Loading...",aiAssistantDesc:"Autonomous tool-calling AI agent with long-term memory",settingsSub:"Prefix, delays, integrations, & security",editAliases:"Edit Aliases",aliasesFor:"Aliases for",addAlias:"Add Alias",newAliasPlaceholder:"Type new alias...",noAliases:"No custom aliases",aliasesHelp:"Aliases allow invoking this command using alternative names.",aliasAlreadyAdded:"Alias already added",aliasScriptArabic:"Arabic alias",aliasScriptLatin:"Latin alias",commandsSub:"Manage role permissions, edit aliases, or enable/disable bot commands live",editPrefixHint:"Click to change prefix",usage:"Usage",usageHint:"The command as it is sent in WhatsApp",noMatchingCommands:"No commands match your search.",commandEnabled:"Command '{name}' enabled",commandDisabled:"Command '{name}' disabled",permissionUpdated:"Permission for '{name}' updated",scopeAll:"All",scopeGroup:"Group",scopePrivate:"Private",permMembers:"Members (Everyone)",permAdminsOnly:"Group Admins",permAdminsOwner:"Group Admins or Owner",permOwnerOnly:"Bot Owner Only",details:"Details",hideDetails:"Hide details",copyCommand:"Copy command",copyFailed:"Could not copy",overridden:"Overridden",defaultLabel:"Default",locked:"Locked",permissionLockedReason:"Fixed because this command performs a WhatsApp group-admin action",overriddenOnly:"Overridden only",lockedOnly:"Locked only",filterScope:"Scope",filterPermission:"Permission",scopeAllChats:"All chats",scopeGroupsOnly:"Groups only",scopePrivateOnly:"Private only",scopeGroupSub:"Group sub-commands",scopeGeneral:"General commands",sortStatus:"Status",resultCountOf:"{n} of {total}",selectRecipient:"Select Target Chat",searchRecipients:"Search by name or phone...",recipients:"Recipients",chooseChat:"Choose a contact or group...",noRecipientsFound:"No matching chats found",pickPhoneContact:"From phone book",pickPhoneContactHint:"Pick a contact from this Android phone",maxSchedulesReached:"Maximum limit reached (3 scheduled messages)",limitReached:"Limit Reached",scheduleType:"Schedule Type",scheduleRecurring:"Recurring",scheduleOnce:"One-Off (Specific Date & Time)",repeat:"Repeat",repeatDaily:"Every day",repeatWeekly:"Every week",repeatMonthly:"Every month",repeatHourly:"Every N hours",weekdays:"Weekdays",dayOfMonth:"Day of month",monthDayHint:"If the month is shorter than the chosen day (for example 31 in February), that month is skipped.",everyHours:"Every how many hours",atMinute:"At minute",sendTime:"Send time",deliveryDateTime:"Delivery Date & Time",timezoneLabel:"Timezone",recurrencePreview:"Preview",weekdaySun:"Sun",weekdayMon:"Mon",weekdayTue:"Tue",weekdayWed:"Wed",weekdayThu:"Thu",weekdayFri:"Fri",weekdaySat:"Sat",contactFallback:"Contact",groupFallback:"Group",hoursUnit:"hours",messageText:"Message Text",messagePlaceholder:"Message to be sent automatically...",scheduleAction:"Schedule",scheduledCount:"scheduled",headerSubtitle:"Recurring and one-off automated message deliveries",noSchedules:"No active schedules found.",typeRecurring:"Recurring",typeOnce:"Once",deliveryFailed:"Failed",deliveryActive:"Active",changeChat:"Change chat",weekdayRequired:"Select at least one weekday",tabIntegrations:"Integrations",integrationsDesc:"API keys for external services connected to the bot",youtubeApiKey:"YouTube Data API Key (Optional)",selectModel:"Select a model from list...",availableModels:"Models Available from Provider",customModel:"Or type a custom model name",modelListToggle:"List",modelCustomToggle:"Custom",showSecret:"Show secret",hideSecret:"Hide secret",sessionStatus:"Session Status",sessionActive:"Session active and receiving messages",sessionOffline:"Session currently offline",connectedNumber:"Linked Phone",tabFeedback:"Feedback & Support",feedbackTitle:"Send feedback to the developer",feedbackDesc:"A bug, an idea, or a question — it is delivered straight to the person who builds Levix. No middle layer, no ticket queue.",feedbackTopicLabel:"What is this about?",feedbackTopicBug:"Something is broken",feedbackTopicIdea:"An idea or request",feedbackTopicQuestion:"A question",feedbackTopicPraise:"It works well",feedbackTopicOther:"Something else",feedbackMessageLabel:"Your message",feedbackMessagePlaceholder:"What happened, what you expected, and what you were doing at the time. Detail helps — it is read by a person.",feedbackCharsNeeded:"more characters",feedbackRatingLabel:"How is Levix working out? (optional)",feedbackContactLabel:"How to reach you (optional)",feedbackContactPlaceholder:"Email, or a WhatsApp/Telegram handle — only if you want an answer",feedbackSendBtn:"Send feedback",feedbackSending:"Sending...",feedbackSent:"Sent. Thank you!",feedbackSentDesc:"It reached the developer of Levix. If you left a way to reach you, expect a reply.",feedbackSendAnother:"Send something else",feedbackWhatIsSent:"What goes with your message",feedbackWhatIsSentDesc:"Your text, the topic, and the rating and contact if you added them, the file you attached if any, plus the Levix version and the platform it runs on. No WhatsApp message, chat, contact or key is ever attached, and nothing is sent until you press Send.",feedbackRuntimeLabel:"Attached to the message",feedbackGithubHint:"For reproducible bugs you want tracked in public with logs, open a GitHub issue.",feedbackOpenGithub:"Open an Issue on GitHub",feedbackAttach:"Attach a file",feedbackAttachmentHint:"Optional — a screenshot or log up to {max} MB",feedbackRemoveAttachment:"Remove attachment",fileSizeKb:"{size} KB",fileSizeMb:"{size} MB",feedbackFileTooLarge:"The file is too large — the limit is {max} MB",feedbackAttachDiagnostics:"Attach device & technical diagnostics and the technical debug log",feedbackDiagnosticsPreview:"See exactly what is sent",feedbackDiagnosticsLoading:"Loading diagnostics preview...",feedbackDiagnosticsError:"Could not load diagnostics preview",feedbackDiagnosticsEmpty:"No diagnostics available",debugLogSectionLabel:"Technical debug log (sanitized)",debugLogHint:"Sanitized technical log from the last 14 days. No passwords, keys, phone numbers or message content.",tabDiagnostics:"Diagnostics",diagnosticsTitle:"Crash Reports & Diagnostics",diagnosticsDesc:"Review local crash reports before sending them to help diagnose and fix issues.",pendingReports:"Pending reports",sentReports:"Sent reports",noPendingReports:"No pending crash reports",noSentReports:"No sent reports yet",sendReport:"Send",sendingReport:"Sending...",deleteReport:"Delete report",deleteAllReports:"Delete all",confirmDeleteReport:"Delete this report?",confirmDeleteReportDesc:"This crash report will be permanently deleted from this device.",confirmDeleteAllReports:"Delete all crash reports?",confirmDeleteAllDesc:"This will permanently delete all pending crash reports from this device.",reportSentSuccess:"Crash report sent successfully",reportDeleteSuccess:"Report deleted",allReportsDeleted:"All crash reports deleted",crashReportPreview:"Upload preview (JSON)",reportCategory:"Category",reportErrorType:"Error type",reportTime:"Time",reportId:"Report ID",reportStatus:"Status",reportLastError:"Last send failure",errorBoundaryTitle:"Something went wrong",errorBoundaryDesc:"The panel encountered an unexpected error while rendering. A local crash report was captured.",errorBoundaryReload:"Reload",errorBoundaryGoDiagnostics:"Diagnostics",crashBannerTitle:"Levix stopped unexpectedly",crashBannerDesc:"Pending crash reports were saved locally. You can review and send them to help fix the issue.",crashBannerReview:"Review & send",crashBannerNotNow:"Not now",crashBannerDelete:"Delete",scheduleAttachMedia:"Attach media",scheduleMediaHint:"Optional — an image, video, audio or document up to {max} MB",scheduleRemoveMedia:"Remove media",scheduleDetails:"Schedule details",detailMedia:"Media",detailLastRun:"Last run",detailError:"Error",detailCreated:"Created",retryDelivery:"Retry delivery",mediaKindImage:"Image",mediaKindVideo:"Video",mediaKindAudio:"Audio",mediaKindDocument:"Document",stickerStudio:"Sticker Studio",stickersDesc:"Create and manage WhatsApp stickers",library:"Library",packs:"Packs",favorites:"Favorites",create:"Create",recent:"Recent",allStickers:"All",static:"Static",animated:"Animated",noPack:"No pack",anyPack:"Any pack",newPack:"New pack…",addToPack:"Add to pack",moveToPack:"Move to pack",removeFromPack:"Remove from pack",favorite:"Favorite",unfavorite:"Unfavorite",download:"Download",convertToImage:"Convert to image",shareSticker:"Share",sendViaWhatsapp:"Send via WhatsApp",deleteEverywhere:"Delete everywhere",deleteKeepStickers:"Delete pack only (keep stickers)",deletePackAndStickers:"Delete pack and stickers not in other packs",openInCreate:"Open in Create",packName:"Pack name",mergeInto:"Merge into another pack",merge:"Merge",stickersKept:"Stickers will be kept",trim:"Trim",background:"Background",transparent:"Transparent",white:"White",black:"Black",customColor:"Custom color",removePlainBackground:"Remove plain background",fit:"Fit",contain:"Contain",cover:"Cover",zoom:"Zoom",panX:"Pan X",panY:"Pan Y",rotate:"Rotate",addText:"Add text",addEmoji:"Add emoji",createAnother:"Create another",qualityReduced:"Sticker was compressed to fit WhatsApp's limit",alreadyInLibrary:"This sticker already exists in your library",encoderMissing:"No WebP encoder available. Sticker creation is disabled.",tryAgain:"Try again",loadMore:"Load more",selectAll:"Select all",clearSelection:"Clear selection",deleteConfirm:"Are you sure you want to delete?",nSelected:"{n} selected",sizeLbl:"Size:",formatLbl:"Format:",packsLbl:"Packs:",gifBadge:"Animated",startDur:"Start: {start}s | Duration: {dur}s",outlineBox:"Outline/Background",toolsLbl:"Tools",clearLbl:"Clear",resetPan:"Reset",clickOrDrag:"Click or drag an image/video to upload",creatingSticker:"Creating sticker…",goToLibrary:"Go to Library",loadingLbl:"Loading…",selectPack:"Select a pack…",noPacksCreated:"No packs created yet",packCreated:"Pack created",packDeleted:"Pack deleted",packRenamed:"Pack renamed",failedToCreatePack:"Failed to create pack",failedToDeletePack:"Failed to delete pack",failedToRenamePack:"Failed to rename pack",failedToMerge:"Failed to merge",someStickersInPacks:"Some stickers are in packs: {packs}",deleteEverywherePrompt:"Delete them everywhere?",packsMerged:"Packs merged",emptyLibrary:"Library is empty",jobStage_probing:"Probing…",jobStage_decoding:"Decoding…",jobStage_encoding:"Encoding…",jobStage_optimizing:"Optimizing…",jobStage_saving:"Saving…",jobQueued:"Queued…",sortNewest:"Newest",sortOldest:"Oldest",sortName:"Name",sortRecent:"Recently used",unlinkStickersWarning:"Your sticker library will also be cleared.",stickerErr_NO_MEDIA:"Send an image, video or sticker.",stickerErr_UNSUPPORTED_TYPE:"Unsupported file type.",stickerErr_TOO_LARGE:"File is too large.",stickerErr_DIMENSIONS_TOO_LARGE:"Image dimensions are too large.",stickerErr_VIDEO_TOO_LONG:"Video is too long.",stickerErr_CORRUPT:"File is corrupt.",stickerErr_CONVERSION_FAILED:"Sticker conversion failed.",stickerErr_OUTPUT_TOO_LARGE:"Output sticker is too large.",stickerErr_ENCODER_MISSING:"Server does not support WebP encoding.",stickerErr_TIMEOUT:"Processing timed out.",stickerErr_BUSY:"Server is busy, try again later.",stickerErr_NOT_FOUND:"Sticker not found.",stickerErr_PACK_NOT_FOUND:"Pack not found.",stickerErr_PACK_EXISTS:"Pack name already exists.",stickerErr_INVALID_NAME:"Invalid pack name.",stickerErr_INVALID_OPTIONS:"Invalid edit options.",stickerErr_LIBRARY_FULL:"Library is full.",stickerErr_PACK_LIMIT:"Pack limit reached.",stickerErr_IN_USE:"Sticker is in use by packs.",stickerErr_STORAGE_UNAVAILABLE:"Storage unavailable.",stickerErr_NOT_CONNECTED:"WhatsApp is not connected.",stickerErr_INTERNAL:"Internal server error.",stickerErr_CANCELLED:"Conversion was cancelled.",stickerLibraryLimit:"Sticker library limit",stickerLibraryLimitDesc:"How many stickers one person can keep in Sticker Studio.",autoDeleteKeepDays:"Auto-delete copies kept (days)",autoDeleteKeepDaysDesc:"How long opt-in text copies from auto-delete rules are kept.",stickerUploadInfo:"{kind} · {size} KB",stickerRemoveHint:"Flat background removal is applied when you create the sticker.",stickerSelect:"Select sticker",deselectSticker:"Deselect sticker",selectCurrentPage:"Select current page",stickerOpen:"Open sticker details",stickerShareSaved:"Saved to {dir}",stickerDrag:"Drop a file here or choose one",stickerAlignmentStart:"Start",stickerAlignmentCenter:"Center",stickerAlignmentEnd:"End",stickerKindImage:"Image",stickerKindGif:"GIF",stickerKindVideo:"Video",stickerKindWebp:"WebP sticker",stickerDeletePackWarning:"The sticker will be removed from every pack.",stickerSendLimit:"Only a limited number of stickers can be sent at once.",stickerExportLimit:"Select fewer stickers to export.",tolerance:"Tolerance",stickerName:"Sticker name",stickerNamePlaceholder:"Optional name…",trimStart:"Start",trimDuration:"Duration",trimSeconds:"seconds",textContent:"Text",textSize:"Size",textColor:"Color",textAlignment:"Alignment",textOutline:"Outline",textBackground:"Background pill",layerRotation:"Rotation",deleteLayer:"Delete layer",noLayers:"No overlay layers",reorderUp:"Move earlier",reorderDown:"Move later",renamePack:"Rename pack",deletePack:"Delete pack",packEmpty:"This pack is empty",noPacks:"No packs yet",createFirstPack:"Create your first pack",stickerCount:"{n} stickers",notConnectedHint:"Connect WhatsApp first",exportFirstFrame:"Exports the first frame",downloadWebp:"Download WebP",downloadPng:"Download PNG",downloadGif:"Download GIF",reorderDragHint:"Drag to reorder",saved:"Saved",createBtn:"Create sticker",uploadHint:"Accepts JPEG, PNG, WebP, GIF, MP4, WebM",stickerCreated:"Sticker created!",stickerSent:"Sticker sent",stickersSent:"Stickers sent",stickerPreview:"Sticker preview",firstFrameHint:"An animated sticker exports its first frame as a still image.",gifOnlyAnimated:"GIF export is only available for animated stickers.",rename:"Rename",inUsePacksLabel:"In these packs",notInPack:"Not in any pack",retryLoad:"Try again",showingCount:"Showing {shown} of {total}",emojiPaletteLabel:"Emoji",customEmoji:"Other emoji",emojiInputLabel:"Type an emoji",textPlaceholder:"Text",layerSelected:"Selected layer",selectVisible:"Select visible",downloadZip:"Download ZIP",noRecipients:"No chats found",recipientGroup:"Group",recipientContact:"Contact",sending:"Sending…",deleteStickersTitle:"Delete stickers",inUseBody:"This sticker is in a pack. Deleting it removes it from those packs too.",inUseBulkBody:"Some selected stickers are in packs. They were not deleted.",deleteEverywhereHint:"Delete everywhere removes the stickers from every pack and from the library.",packNameLength:"A pack name must be between 1 and 40 characters.",newPackPlaceholder:"Pack name",createPack:"Create pack",skippedOther:"Some stickers could not be updated.",addedToPack:"Added to the pack",movedToPack:"Moved to the pack",removedFromPack:"Removed from the pack",renamed:"Name updated",downloaded:"Download started",shareDone:"Shared",backToPacks:"All packs",confirmMerge:"Merge packs",mergeTitle:"Merge into another pack",mergeConfirmBody:"Stickers stay in the library. Items from this pack are appended to the other pack, duplicates are skipped, and this pack is then deleted.",trimApplied:"The trim is applied when the sticker is created.",gifTrimNote:"GIF trim is applied on create and may not match the preview frame for frame.",animatedUnavailable:"This server cannot encode animated stickers.",targetPack:"Add to pack",previewStage:"Sticker preview",rotateQuarter:"Rotate 90 degrees",uploadReady:"File ready",stickerNameTooLong:"A sticker name can be at most 60 characters.",noDestinationPack:"Choose a pack to merge into.",deletePackTitle:"Delete pack",openPack:"Open pack",searchStickers:"Search stickers",sortBy:"Sort",filterBy:"Filter",packFilter:"Pack",noResults:"No stickers match this search",favoritesEmpty:"No favorite stickers yet",recentEmpty:"No stickers used or created in the last 30 days",favoriteBadge:"Favorite",deleted:"Deleted",autoDelete:"Auto-delete",autoDeleteSubtitle:"Delete messages that contain words you choose.",newRule:"New rule",editRule:"Edit rule",searchRules:"Search by name or keyword",sortByName:"Name",sortMostDeleted:"Most deleted",sortLastDeleted:"Last deleted",filterStatus:"Status",statusAny:"Any",statusEnabled:"Enabled",statusDisabled:"Disabled",filterChat:"Chats",filterSender:"Senders",chatsAll:"All chats",chatsGroups:"Groups only",chatsPrivate:"Private only",sendersEveryone:"Everyone",sendersSelected:"Selected contacts",oneContact:"1 contact",sendersCount:"{n} contacts",matchMode:"Match",matchContains:"Contains",matchWord:"Whole word",matchExact:"Exact message",matchContainsHint:"Deletes a message when its text includes the keyword.",matchWordHint:"Deletes when the keyword stands alone, not inside a longer word.",matchExactHint:"Deletes only when the whole message is exactly the keyword.",chatScopeLabel:"Chats",ruleName:"Name",ruleNamePlaceholder:"Optional name",keywordsLabel:"Keywords",keywordsPlaceholder:"Type a word, then press Enter",keywordCount:"{n} / {max}",keywordTooLong:"Each keyword must be 100 characters or fewer.",keywordEmpty:"That keyword is empty after it is cleaned up.",keywordDuplicate:"That keyword is already in the list.",keywordsRequired:"Add between 1 and 50 keywords.",keywordsMax:"A rule can have at most 50 keywords.",nameTooLong:"Name must be 60 characters or fewer.",includeOwn:"Also delete my own messages",includeOwnHint:"Messages sent by the linked account are deleted too.",forEveryone:"Delete for everyone when possible",forEveryoneHint:"Other people's messages are deleted for everyone only in groups where the linked account is an admin. Otherwise they are removed only from this device.",keepCopy:"Keep a copy in Levix",keepCopyHint:"Stores the text or caption only, never the media. Copies follow the “Auto-delete copies kept (days)” setting.",keepCopyPrivacy:"Copies stay on this device with the bot's data. They are not a backup of the chat.",ruleEnabled:"Enabled",deletedLabel:"Deleted",lastDeleted:"Last deleted",neverDeleted:"Nothing deleted yet",moreKeywords:"+{n}",resetCounter:"Reset counter",viewCopies:"View kept copies",deleteRule:"Delete rule",deleteRuleTitle:"Delete this rule?",deleteRuleBody:"“{name}” stops matching. Kept copies for this rule are removed too.",counterReset:"Counter reset",ruleSaved:"Rule saved",ruleDeleted:"Rule deleted",ruleSaveFailed:"Could not save the rule.",noRulesTitle:"No auto-delete rules yet",noRulesBody:"Messages that contain the words you add are deleted automatically.",noRulesMatch:"No rules match this search",rulesTab:"Rules",copiesTab:"Kept copies",noCopiesTitle:"No copies kept",noCopiesBody:"When a rule keeps a copy, the text shows up here.",noCopiesForRule:"No copies for this rule",clearCopies:"Clear copies",clearCopiesForRule:"Clear copies for this rule",clearCopiesTitle:"Clear kept copies?",clearCopiesBody:"This removes the stored text. It cannot be undone.",clearCopiesRuleBody:"This removes the stored text for “{name}”. It cannot be undone.",copiesCleared:"Copies cleared",copyChat:"Chat",copySender:"Sender",mediaText:"Text",mediaImage:"Image",mediaVideo:"Video",mediaAudio:"Audio",mediaSticker:"Sticker",mediaDocument:"Document",modeRevoke:"Deleted for everyone",modeForMe:"Deleted on this device",selectContacts:"Choose contacts",addPhone:"Add number",phonePlaceholder:"Phone number",invalidPhone:"Enter a phone number of 8 to 15 digits.",sendersRequired:"Select at least one contact or number.",sendersHelp:"Choose contacts, or type a phone number.",tooManySenders:"You can select at most 200 contacts.",removeKeyword:"Remove {word}",removeContact:"Remove {name}",groupSenderRejected:"Senders must be contacts, not groups.",rulesLimit:"You can keep at most 100 rules.",toggleFailed:"Could not update the rule.",rulesLoadFailed:"Could not load auto-delete rules.",copiesLoadFailed:"Could not load kept copies.",allRules:"All rules",filterByRule:"Rule",noContacts:"No contacts found",contactAdded:"Added",saveRule:"Save rule",recipientsLoadFailed:"Could not load chats.",tourBack:"Back",tourNext:"Next",tourDone:"Done",tourSkip:"Skip tour",tourStepOf:"Step {n} of {total}",tourScreenHelp:"Guide for this screen",tourReplayTitle:"Guided tour",tourReplayDesc:"Replay a step-by-step walkthrough of the panel, highlighted on the real controls.",tourReplayAction:"Replay guide",tourSidebarTitle:"This is your control room",tourSidebarBody:"The menu on the side opens every screen of your bot: overview, connection, commands, AI, groups and more. Tap any item to jump there.",tourConnectionStartTitle:"Connecting WhatsApp",tourConnectionStartBody:"Tap this button to link a WhatsApp account or to resume your saved session. The bot replies from this account.",tourConnectionPairingTitle:"Pairing steps",tourConnectionPairingBody:"Choose whatever suits you: a numeric code you type into WhatsApp, or scanning a QR code. Both reach the same result, and pairing takes under a minute.",tourOverviewStatsTitle:"Your bot at a glance",tourOverviewStatsBody:"These cards show live numbers: your WhatsApp groups, the number of commands, how long the bot has been running, and its scheduled messages.",tourCommandsTitle:"The command catalog",tourCommandsBody:"Every command the bot answers to. Open a row to turn it on or off, change who may use it, or manage its aliases. Use search and filters above to find a command fast.",tourAiAgentTitle:"Turn the assistant on",tourAiAgentBody:"This switch arms the AI assistant. When it is on, people can ask it questions with the !ai command inside your chats.",tourAiProviderTitle:"Choose the AI brain",tourAiProviderBody:"Pick a provider — Google Gemini, an OpenAI-compatible server or Anthropic — then paste its API key and model name. Your key stays on this device.",tourAiMemoryTitle:"Teach it your way",tourAiMemoryBody:"Write the assistant's personality in the persona, and save facts it should remember in memory — it reads both before every reply.",tourGroupsTitle:"Group moderation",tourGroupsBody:"Every group you are in is listed here. Open a group to set its anti-link, welcome message, media limits and rules — all applied live.",tourStickersTitle:"Sticker Studio",tourStickersBody:"Create stickers from photos and videos, keep them here, and collect them into packs. Everything the bot sends or you upload in the panel lands in one shared library.",tourSchedulesTitle:"Scheduled messages",tourSchedulesBody:"Schedule a message once at a chosen time, or repeat it on a schedule. The list keeps every job, and failed deliveries stay marked for review.",tourLogsTitle:"Live logs",tourLogsBody:"Everything the bot does streams here as it happens, so you can follow replies and spot errors early.",tourSettingsTitle:"First stop in Settings",tourSettingsBody:"Set the command prefix, the interface and bot languages, and the timezone from here. The General tab also exports your settings so another Levix can import them.",tourSettingsPasswordTitle:"Protect your panel",tourSettingsPasswordBody:"This tab is where you change the password that opens this panel. A strong password here protects the WhatsApp session and your settings.",tourSettingsFeedbackTitle:"Tell the developer",tourSettingsFeedbackBody:"The panel works on your device only. If you like something or something breaks, use this tab to send a note — nothing leaves your device unless you tap Send.",tourSettingsDiagnosticsTitle:"Crash reports",tourSettingsDiagnosticsBody:"If the app or the panel crashes, a stripped-down report collects here with no identifying data. You preview it in full and send it only when you decide to."}},ah=y.createContext(null),dj=({children:n})=>{const[i,r]=y.useState(()=>document.documentElement.lang==="ar"?"ar":"en"),[o,d]=y.useState(()=>document.documentElement.getAttribute("data-theme")==="light"?"light":"dark"),f=i==="ar"?"rtl":"ltr";y.useEffect(()=>{const x=v=>{const S=v.detail;((S==null?void 0:S.language)==="ar"||(S==null?void 0:S.language)==="en")&&r(S.language),((S==null?void 0:S.theme)==="light"||(S==null?void 0:S.theme)==="dark")&&d(S.theme)};return window.addEventListener("levix-ui-prefs",x),()=>window.removeEventListener("levix-ui-prefs",x)},[]);const m=(x,v,S)=>{var k;const A=window.LevixHost;(k=A==null?void 0:A.setUiPrefs)==null||k.call(A,x,v,S)},p=x=>{x!==i&&(r(x),document.documentElement.lang=x,document.documentElement.dir=x==="ar"?"rtl":"ltr",localStorage.setItem("levix_lang",x),m(x,o,"language"))},h=x=>{x!==o&&(d(x),document.documentElement.setAttribute("data-theme",x),localStorage.setItem("levix_theme",x),m(i,x,"theme"))},b=y.useMemo(()=>(x,v)=>(Pf[i]||Pf.en)[x]??Pf.en[x]??v??String(x),[i]);return s.jsx(ah.Provider,{value:{language:i,theme:o,direction:f,setLanguage:p,setTheme:h,t:b},children:n})},Ue=()=>{const n=y.useContext(ah);if(!n)throw new Error("useI18n must be used within an I18nProvider");return n};function fj({src:n,name:i}){var d;const[r,o]=y.useState(!1);return s.jsxs("span",{className:"relative inline-flex size-12 shrink-0 items-center justify-center overflow-hidden rounded-xl bg-brand-blue/10 text-lg font-bold text-brand-cyan",children:[s.jsx("span",{"aria-hidden":!0,children:(d=Array.from(i)[0])==null?void 0:d.toUpperCase()}),!r&&s.jsx("img",{src:n,alt:"",loading:"lazy",onError:()=>o(!0),className:"absolute inset-0 size-full object-cover"})]})}function n1(n){var i,r,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var d=n.length;for(i=0;i<d;i++)n[i]&&(r=n1(n[i]))&&(o&&(o+=" "),o+=r)}else for(r in n)n[r]&&(o&&(o+=" "),o+=r);return o}function mj(){for(var n,i,r=0,o="",d=arguments.length;r<d;r++)(n=arguments[r])&&(i=n1(n))&&(o&&(o+=" "),o+=i);return o}const hj=(n,i)=>{const r=new Array(n.length+i.length);for(let o=0;o<n.length;o++)r[o]=n[o];for(let o=0;o<i.length;o++)r[n.length+o]=i[o];return r},pj=(n,i)=>({classGroupId:n,validator:i}),a1=(n=new Map,i=null,r)=>({nextPart:n,validators:i,classGroupId:r}),Uc="-",Wy=[],gj="arbitrary..",xj=n=>{const i=bj(n),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return yj(m);const p=m.split(Uc),h=p[0]===""&&p.length>1?1:0;return s1(p,h,i)},getConflictingClassGroupIds:(m,p)=>{if(p){const h=o[m],b=r[m];return h?b?hj(b,h):h:b||Wy}return r[m]||Wy}}},s1=(n,i,r)=>{if(n.length-i===0)return r.classGroupId;const d=n[i],f=r.nextPart.get(d);if(f){const b=s1(n,i+1,f);if(b)return b}const m=r.validators;if(m===null)return;const p=i===0?n.join(Uc):n.slice(i).join(Uc),h=m.length;for(let b=0;b<h;b++){const x=m[b];if(x.validator(p))return x.classGroupId}},yj=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const i=n.slice(1,-1),r=i.indexOf(":"),o=i.slice(0,r);return o?gj+o:void 0})(),bj=n=>{const{theme:i,classGroups:r}=n;return vj(r,i)},vj=(n,i)=>{const r=a1();for(const o in n){const d=n[o];sh(d,r,o,i)}return r},sh=(n,i,r,o)=>{const d=n.length;for(let f=0;f<d;f++){const m=n[f];wj(m,i,r,o)}},wj=(n,i,r,o)=>{if(typeof n=="string"){Sj(n,i,r);return}if(typeof n=="function"){kj(n,i,r,o);return}jj(n,i,r,o)},Sj=(n,i,r)=>{const o=n===""?i:l1(i,n);o.classGroupId=r},kj=(n,i,r,o)=>{if(Nj(n)){sh(n(o),i,r,o);return}i.validators===null&&(i.validators=[]),i.validators.push(pj(r,n))},jj=(n,i,r,o)=>{const d=Object.entries(n),f=d.length;for(let m=0;m<f;m++){const[p,h]=d[m];sh(h,l1(i,p),r,o)}},l1=(n,i)=>{let r=n;const o=i.split(Uc),d=o.length;for(let f=0;f<d;f++){const m=o[f];let p=r.nextPart.get(m);p||(p=a1(),r.nextPart.set(m,p)),r=p}return r},Nj=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,Cj=n=>{if(n<1)return{get:()=>{},set:()=>{}};let i=0,r=Object.create(null),o=Object.create(null);const d=(f,m)=>{r[f]=m,i++,i>n&&(i=0,o=r,r=Object.create(null))};return{get(f){let m=r[f];if(m!==void 0)return m;if((m=o[f])!==void 0)return d(f,m),m},set(f,m){f in r?r[f]=m:d(f,m)}}},Om="!",eb=":",Ej=[],tb=(n,i,r,o,d)=>({modifiers:n,hasImportantModifier:i,baseClassName:r,maybePostfixModifierPosition:o,isExternal:d}),Aj=n=>{const{prefix:i,experimentalParseClassName:r}=n;let o=d=>{const f=[];let m=0,p=0,h=0,b;const x=d.length;for(let N=0;N<x;N++){const j=d[N];if(m===0&&p===0){if(j===eb){f.push(d.slice(h,N)),h=N+1;continue}if(j==="/"){b=N;continue}}j==="["?m++:j==="]"?m--:j==="("?p++:j===")"&&p--}const v=f.length===0?d:d.slice(h);let S=v,A=!1;v.endsWith(Om)?(S=v.slice(0,-1),A=!0):v.startsWith(Om)&&(S=v.slice(1),A=!0);const k=b&&b>h?b-h:void 0;return tb(f,A,S,k)};if(i){const d=i+eb,f=o;o=m=>m.startsWith(d)?f(m.slice(d.length)):tb(Ej,!1,m,void 0,!0)}if(r){const d=o;o=f=>r({className:f,parseClassName:d})}return o},Tj=n=>{const i=new Map;return n.orderSensitiveModifiers.forEach((r,o)=>{i.set(r,1e6+o)}),r=>{const o=[];let d=[];for(let f=0;f<r.length;f++){const m=r[f],p=m[0]==="[",h=i.has(m);p||h?(d.length>0&&(d.sort(),o.push(...d),d=[]),o.push(m)):d.push(m)}return d.length>0&&(d.sort(),o.push(...d)),o}},_j=n=>({cache:Cj(n.cacheSize),parseClassName:Aj(n),sortModifiers:Tj(n),postfixLookupClassGroupIds:Dj(n),...xj(n)}),Dj=n=>{const i=Object.create(null),r=n.postfixLookupClassGroups;if(r)for(let o=0;o<r.length;o++)i[r[o]]=!0;return i},Mj=/\s+/,Rj=(n,i)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:d,sortModifiers:f,postfixLookupClassGroupIds:m}=i,p=[],h=n.trim().split(Mj);let b="";for(let x=h.length-1;x>=0;x-=1){const v=h[x],{isExternal:S,modifiers:A,hasImportantModifier:k,baseClassName:N,maybePostfixModifierPosition:j}=r(v);if(S){b=v+(b.length>0?" "+b:b);continue}let L=!!j,_;if(L){const M=N.substring(0,j);_=o(M);const T=_&&m[_]?o(N):void 0;T&&T!==_&&(_=T,L=!1)}else _=o(N);if(!_){if(!L){b=v+(b.length>0?" "+b:b);continue}if(_=o(N),!_){b=v+(b.length>0?" "+b:b);continue}L=!1}const G=A.length===0?"":A.length===1?A[0]:f(A).join(":"),R=k?G+Om:G,ne=R+_;if(p.indexOf(ne)>-1)continue;p.push(ne);const U=d(_,L);for(let M=0;M<U.length;++M){const T=U[M];p.push(R+T)}b=v+(b.length>0?" "+b:b)}return b},zj=(...n)=>{let i=0,r,o,d="";for(;i<n.length;)(r=n[i++])&&(o=i1(r))&&(d&&(d+=" "),d+=o);return d},i1=n=>{if(typeof n=="string")return n;let i,r="";for(let o=0;o<n.length;o++)n[o]&&(i=i1(n[o]))&&(r&&(r+=" "),r+=i);return r},Lj=(n,...i)=>{let r,o,d,f;const m=h=>{const b=i.reduce((x,v)=>v(x),n());return r=_j(b),o=r.cache.get,d=r.cache.set,f=p,p(h)},p=h=>{const b=o(h);if(b)return b;const x=Rj(h,r);return d(h,x),x};return f=m,(...h)=>f(zj(...h))},Oj=[],qt=n=>{const i=r=>r[n]||Oj;return i.isThemeGetter=!0,i.themeKey=n,i},r1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,o1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Bj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Uj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Hj=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Pj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,qj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Fj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ss=n=>Bj.test(n),Je=n=>!!n&&!Number.isNaN(Number(n)),xa=n=>!!n&&Number.isInteger(Number(n)),qf=n=>n.endsWith("%")&&Je(n.slice(0,-1)),Ha=n=>Uj.test(n),c1=()=>!0,Gj=n=>Hj.test(n)&&!Pj.test(n),lh=()=>!1,Ij=n=>qj.test(n),Vj=n=>Fj.test(n),Kj=n=>!Ae(n)&&!Te(n),Yj=n=>n.startsWith("@container")&&(n[10]==="/"&&n[11]!==void 0||n[11]==="s"&&n[16]!==void 0&&n.startsWith("-size/",10)||n[11]==="n"&&n[18]!==void 0&&n.startsWith("-normal/",10)),Qj=n=>Ds(n,f1,lh),Ae=n=>r1.test(n),sl=n=>Ds(n,m1,Gj),nb=n=>Ds(n,nN,Je),Xj=n=>Ds(n,p1,c1),Zj=n=>Ds(n,h1,lh),ab=n=>Ds(n,u1,lh),$j=n=>Ds(n,d1,Vj),pc=n=>Ds(n,g1,Ij),Te=n=>o1.test(n),vr=n=>pl(n,m1),Jj=n=>pl(n,h1),sb=n=>pl(n,u1),Wj=n=>pl(n,f1),eN=n=>pl(n,d1),gc=n=>pl(n,g1,!0),tN=n=>pl(n,p1,!0),Ds=(n,i,r)=>{const o=r1.exec(n);return o?o[1]?i(o[1]):r(o[2]):!1},pl=(n,i,r=!1)=>{const o=o1.exec(n);return o?o[1]?i(o[1]):r:!1},u1=n=>n==="position"||n==="percentage",d1=n=>n==="image"||n==="url",f1=n=>n==="length"||n==="size"||n==="bg-size",m1=n=>n==="length",nN=n=>n==="number",h1=n=>n==="family-name",p1=n=>n==="number"||n==="weight",g1=n=>n==="shadow",aN=()=>{const n=qt("color"),i=qt("font"),r=qt("text"),o=qt("font-weight"),d=qt("tracking"),f=qt("leading"),m=qt("breakpoint"),p=qt("container"),h=qt("spacing"),b=qt("radius"),x=qt("shadow"),v=qt("inset-shadow"),S=qt("text-shadow"),A=qt("drop-shadow"),k=qt("blur"),N=qt("perspective"),j=qt("aspect"),L=qt("ease"),_=qt("animate"),G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],ne=()=>[...R(),Te,Ae],U=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],T=()=>[Te,Ae,h],P=()=>[Ss,"full","auto",...T()],O=()=>[xa,"none","subgrid",Te,Ae],J=()=>["auto",{span:["full",xa,Te,Ae]},xa,Te,Ae],Z=()=>[xa,"auto",Te,Ae],se=()=>["auto","min","max","fr",Te,Ae],E=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...T()],le=()=>[Ss,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],pe=()=>[p,Ss,"screen","full","dvw","lvw","svw","min","max","fit",...T()],he=()=>[Ss,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],I=()=>[n,Te,Ae],ce=()=>[...R(),sb,ab,{position:[Te,Ae]}],ie=()=>["no-repeat",{repeat:["","x","y","space","round"]}],fe=()=>["auto","cover","contain",Wj,Qj,{size:[Te,Ae]}],C=()=>[qf,vr,sl],K=()=>["","none","full",b,Te,Ae],Y=()=>["",Je,vr,sl],me=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>[Je,qf,sb,ab],ve=()=>["","none",k,Te,Ae],be=()=>["none",Je,Te,Ae],Se=()=>["none",Je,Te,Ae],it=()=>[Je,Te,Ae],xt=()=>[Ss,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ha],breakpoint:[Ha],color:[c1],container:[Ha],"drop-shadow":[Ha],ease:["in","out","in-out"],font:[Kj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ha],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ha],shadow:[Ha],spacing:["px",Je],text:[Ha],"text-shadow":[Ha],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ss,Ae,Te,j]}],container:["container"],"container-type":[{"@container":["","normal","size",Te,Ae]}],"container-named":[Yj],columns:[{columns:[Je,"auto",Ae,Te,p]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:ne()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[xa,"auto",Te,Ae]}],basis:[{basis:[Ss,"full","auto",p,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Je,Ss,"auto","initial","none",Ae]}],grow:[{grow:["",Je,Te,Ae]}],shrink:[{shrink:["",Je,Te,Ae]}],order:[{order:[xa,"first","last","none",Te,Ae]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:J()}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:J()}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":se()}],"auto-rows":[{"auto-rows":se()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...E(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...E()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":E()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mbs:[{mbs:F()}],mbe:[{mbe:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:le()}],"inline-size":[{inline:["auto",...pe()]}],"min-inline-size":[{"min-inline":["auto",...pe()]}],"max-inline-size":[{"max-inline":["none",...pe()]}],"block-size":[{block:["auto",...he()]}],"min-block-size":[{"min-block":["auto",...he()]}],"max-block-size":[{"max-block":["none",...he()]}],w:[{w:[p,"screen",...le()]}],"min-w":[{"min-w":[p,"screen","none",...le()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[m]},...le()]}],h:[{h:["screen","lh",...le()]}],"min-h":[{"min-h":["screen","lh","none",...le()]}],"max-h":[{"max-h":["screen","lh","none",...le()]}],"font-size":[{text:["base",r,vr,sl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,tN,Xj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qf,Ae]}],"font-family":[{font:[Jj,Zj,i]}],"font-features":[{"font-features":[Ae]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[d,Te,Ae]}],"line-clamp":[{"line-clamp":[Je,"none",Te,nb]}],leading:[{leading:["none",f,...T()]}],"list-image":[{"list-image":["none",Te,Ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Te,Ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:[Je,"from-font","auto",Te,sl]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Je,"auto",Te,Ae]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"tab-size":[{tab:[xa,Te,Ae]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Te,Ae]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Te,Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ce()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:fe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xa,Te,Ae],radial:["",Te,Ae],conic:["",xa,Te,Ae]},eN,$j]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:C()}],"gradient-via-pos":[{via:C()}],"gradient-to-pos":[{to:C()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-bs":[{"border-bs":Y()}],"border-w-be":[{"border-be":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...me(),"hidden","none"]}],"divide-style":[{divide:[...me(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Je,Te,Ae]}],"outline-w":[{outline:["",Je,vr,sl]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","inner","none",x,gc,pc]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",v,gc,pc]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Je,sl]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",S,gc,pc]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Je,Te,Ae]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Je]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Te,Ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[Je]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ce()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:fe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Te,Ae]}],filter:[{filter:["","none",Te,Ae]}],blur:[{blur:ve()}],brightness:[{brightness:[Je,Te,Ae]}],contrast:[{contrast:[Je,Te,Ae]}],"drop-shadow":[{"drop-shadow":["","none",A,gc,pc]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",Je,Te,Ae]}],"hue-rotate":[{"hue-rotate":[Je,Te,Ae]}],invert:[{invert:["",Je,Te,Ae]}],saturate:[{saturate:[Je,Te,Ae]}],sepia:[{sepia:["",Je,Te,Ae]}],"backdrop-filter":[{"backdrop-filter":["","none",Te,Ae]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[Je,Te,Ae]}],"backdrop-contrast":[{"backdrop-contrast":[Je,Te,Ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Je,Te,Ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Je,Te,Ae]}],"backdrop-invert":[{"backdrop-invert":["",Je,Te,Ae]}],"backdrop-opacity":[{"backdrop-opacity":[Je,Te,Ae]}],"backdrop-saturate":[{"backdrop-saturate":[Je,Te,Ae]}],"backdrop-sepia":[{"backdrop-sepia":["",Je,Te,Ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Te,Ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Je,"initial",Te,Ae]}],ease:[{ease:["linear","initial",L,Te,Ae]}],delay:[{delay:[Je,Te,Ae]}],animate:[{animate:["none",_,Te,Ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,Te,Ae]}],"perspective-origin":[{"perspective-origin":ne()}],rotate:[{rotate:be()}],"rotate-x":[{"rotate-x":be()}],"rotate-y":[{"rotate-y":be()}],"rotate-z":[{"rotate-z":be()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:it()}],"skew-x":[{"skew-x":it()}],"skew-y":[{"skew-y":it()}],transform:[{transform:[Te,Ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:ne()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:xt()}],"translate-x":[{"translate-x":xt()}],"translate-y":[{"translate-y":xt()}],"translate-z":[{"translate-z":xt()}],"translate-none":["translate-none"],zoom:[{zoom:[xa,Te,Ae]}],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Te,Ae]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Te,Ae]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[Je,vr,sl,nb]}],stroke:[{stroke:["none",...I()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},sN=Lj(aN);function Pe(...n){return sN(mj(n))}const lN={ok:"border-ok/30 bg-ok/10 text-ok",warn:"border-warn/30 bg-warn/10 text-warn",danger:"border-danger/30 bg-danger/10 text-danger",info:"border-info/30 bg-info/10 text-info",neutral:"border-line bg-panel-raised text-muted"};function We({tone:n="neutral",className:i,children:r,...o}){return s.jsx("span",{className:Pe("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-bold",lN[n],i),...o,children:r})}function Nc({dot:n=!1,pulse:i=!1,children:r,...o}){return s.jsxs(We,{...o,children:[n&&s.jsx("span",{className:Pe("size-2 shrink-0 rounded-full bg-current",i&&"pulse-dot")}),r]})}function iN({tone:n="neutral",label:i}){return s.jsxs("span",{role:"status",className:Pe("inline-flex size-4 items-center justify-center",{ok:"text-ok",warn:"text-warn",danger:"text-danger",info:"text-info",neutral:"text-muted"}[n]),children:[s.jsx("span",{"aria-hidden":!0,className:"size-2.5 rounded-full bg-current"}),s.jsx("span",{className:"sr-only",children:i})]})}const pi={base:"inline-flex shrink-0 items-center justify-center gap-2 font-bold transition-colors select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:cursor-not-allowed disabled:opacity-50",variant:{primary:"bg-brand-blue text-white shadow-md shadow-brand-blue/20 hover:bg-brand-blue-deep",secondary:"border border-line bg-panel-raised text-text-main hover:bg-panel-hover",ghost:"text-muted hover:bg-panel-hover hover:text-text-main",danger:"bg-danger text-white shadow-md shadow-danger/20 hover:bg-danger/90"},size:{sm:"h-10 min-h-10 rounded-lg px-3 text-xs",md:"h-11 min-h-11 rounded-xl px-4 text-sm",lg:"h-12 min-h-12 rounded-xl px-5 text-sm"},icon:{sm:"size-10 min-h-10 min-w-10 rounded-lg p-0",md:"size-11 min-h-11 min-w-11 rounded-xl p-0",lg:"size-12 min-h-12 min-w-12 rounded-xl p-0"}},de=y.forwardRef(function({variant:i="secondary",size:r="md",loading:o=!1,icon:d,className:f,type:m="button",disabled:p,children:h,...b},x){return s.jsxs("button",{ref:x,type:m,disabled:p||o,"aria-busy":o||void 0,className:Pe(pi.base,pi.variant[i],pi.size[r],f),...b,children:[o?s.jsx("span",{"aria-hidden":!0,className:"size-4 shrink-0 rounded-full border-2 border-current border-t-transparent animate-spin"}):d&&s.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:d}),h]})}),Oe=y.forwardRef(function({label:i,icon:r,children:o,variant:d="secondary",size:f="sm",loading:m=!1,pressed:p,className:h,type:b="button",disabled:x,...v},S){const A=r??o;return s.jsx("button",{ref:S,type:b,title:i,"aria-label":i,...p===void 0?{}:{"aria-pressed":p},disabled:x||m,"aria-busy":m||void 0,className:Pe(pi.base,pi.variant[d],pi.icon[f],p&&"border-brand-blue/40 bg-brand-blue/15 text-brand-blue",h),...v,children:m?s.jsx("span",{"aria-hidden":!0,className:"size-4 rounded-full border-2 border-current border-t-transparent animate-spin"}):s.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:A})})}),Ze=y.forwardRef(function({className:i,padded:r=!0,...o},d){return s.jsx("div",{ref:d,className:Pe("rounded-2xl border border-line bg-panel shadow-sm",r&&"p-4 md:p-5",i),...o})}),x1=Ze;function wn({title:n,description:i,actions:r,icon:o,className:d}){return s.jsxs("div",{className:Pe("flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",d),children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[o&&s.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-brand-cyan/10 text-brand-cyan",children:o}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h2",{className:"truncate text-base font-bold text-text-main md:text-lg",children:n}),i&&s.jsx("p",{className:"mt-0.5 text-xs text-muted",children:i})]})]}),r&&s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:r})]})}function gl({className:n,...i}){return s.jsx(Ze,{className:n,children:s.jsx(wn,{...i})})}function lb({title:n,description:i,actions:r,children:o,className:d}){return s.jsxs("section",{className:Pe("flex flex-col gap-3",d),children:[n&&s.jsx(wn,{title:n,description:i,actions:r}),o]})}const Yc="w-full min-h-10 rounded-xl border border-line bg-panel-raised px-3 text-sm text-text-main placeholder:text-faint focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:cursor-not-allowed disabled:opacity-50";function Es({children:n,htmlFor:i}){return s.jsx("label",{htmlFor:i,className:"mb-1 block text-xs font-bold text-text-main",children:n})}function _e({label:n,description:i,error:r,htmlFor:o,children:d,className:f}){return s.jsxs("div",{className:Pe("flex flex-col gap-1.5",f),children:[n&&s.jsx(Es,{htmlFor:o,children:n}),d,r?s.jsx("p",{className:"text-xs text-danger",children:r}):i&&s.jsx("p",{className:"text-xs text-muted",children:i})]})}const Be=y.forwardRef(function({className:i,technical:r=!1,dir:o,...d},f){return s.jsx("input",{ref:f,dir:o??(r?"ltr":void 0),className:Pe(Yc,r&&"text-start",i),...d})}),ol=y.forwardRef(function({className:i,...r},o){return s.jsx("textarea",{ref:o,className:Pe(Yc,"h-auto min-h-24 resize-y py-3 leading-relaxed",i),...r})}),ft=y.forwardRef(function({className:i,...r},o){return s.jsx("select",{ref:o,className:Pe(Yc,"pe-8",i),...r})}),bi=y.forwardRef(function({label:i,description:r,className:o,id:d,...f},m){const p=y.useId(),h=d??p;return s.jsxs("label",{htmlFor:h,className:"flex min-h-10 cursor-pointer items-center gap-2.5",children:[s.jsx("input",{ref:m,id:h,type:"checkbox",className:Pe("size-4 shrink-0 accent-brand-blue",o),...f}),(i||r)&&s.jsxs("span",{className:"min-w-0",children:[i&&s.jsx("span",{className:"block text-sm text-text-main",children:i}),r&&s.jsx("span",{className:"block text-xs text-muted",children:r})]})]})});function Sn({label:n,name:i,value:r,onChange:o,options:d,orientation:f="vertical",className:m}){return s.jsxs("div",{role:"radiogroup","aria-label":n,className:Pe("flex gap-1",f==="horizontal"?"flex-row flex-wrap":"flex-col",m),children:[n&&s.jsx("p",{className:"mb-1 w-full text-xs font-bold text-text-main",children:n}),d.map(p=>s.jsxs("label",{className:"flex min-h-10 cursor-pointer items-center gap-2.5",children:[s.jsx("input",{type:"radio",name:i,value:p.value,checked:r===p.value,onChange:()=>o(p.value),className:"size-4 shrink-0 accent-brand-blue"}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block text-sm text-text-main",children:p.label}),p.description&&s.jsx("span",{className:"block text-xs text-muted",children:p.description})]})]},p.value))]})}const Kn=y.forwardRef(function({checked:i,onChange:r,disabled:o,id:d,label:f,description:m,className:p,...h},b){const x=y.useId(),v=d||x,S=`${v}-label`,A=`${v}-description`,k=!!(f||m);return s.jsxs("div",{className:Pe(k?"flex items-center justify-between gap-4":"inline-flex",p),children:[k&&s.jsxs("div",{className:"min-w-0 flex-1",children:[f&&s.jsx("label",{id:S,htmlFor:v,className:"block cursor-pointer text-sm font-semibold text-text-main",children:f}),m&&s.jsx("p",{id:A,className:"mt-0.5 text-xs text-muted",children:m})]}),s.jsx("button",{ref:b,type:"button",...h,role:"switch","aria-checked":i,"aria-labelledby":h["aria-labelledby"]??(f&&!h["aria-label"]?S:void 0),"aria-describedby":[h["aria-describedby"],m?A:void 0].filter(Boolean).join(" ")||void 0,id:v,disabled:o,onClick:()=>r(!i),className:Pe("relative inline-flex size-11 shrink-0 items-center rounded-full transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50","disabled:cursor-not-allowed disabled:opacity-50","before:absolute before:inset-x-0 before:top-[9px] before:h-[26px] before:rounded-full before:border before:transition-colors",i?"before:border-brand-blue before:bg-brand-blue":"before:border-faint/70 before:bg-panel-hover"),children:s.jsx("span",{"aria-hidden":!0,className:Pe("pointer-events-none absolute top-3 size-5 rounded-full bg-white shadow transition-[inset-inline-start] duration-200 motion-reduce:transition-none",i?"start-[21px]":"start-[3px]")})})]})});function Qc({children:n,removeLabel:i,onRemove:r,dir:o="auto",className:d,disabled:f}){return s.jsxs("span",{className:Pe("inline-flex max-w-full items-center gap-0.5 rounded-full border border-line bg-panel-raised py-0.5 ps-2.5 text-xs font-semibold text-text-main",r?"pe-0.5":"pe-2.5",d),children:[s.jsx("span",{dir:o,className:"min-w-0 truncate",children:n}),r&&i&&s.jsx(Oe,{variant:"ghost",label:i,icon:s.jsx(Rn,{size:14}),disabled:f,onMouseDown:m=>m.preventDefault(),onClick:r})]})}function rN(n){return n.split(/[,،\n\r]+/)}const oN=y.forwardRef(function({value:i,onChange:r,max:o,maxLength:d,prepare:f,onReject:m,removeLabel:p,countLabel:h,chipDir:b="auto",className:x,disabled:v,id:S,placeholder:A,"aria-label":k,"aria-invalid":N,"aria-describedby":j,...L},_){const G=y.useId(),R=S??G,[ne,U]=y.useState(""),M=(P,O)=>{const J=P.trim();if(!J)return{next:O,reason:null};let Z=J;if(f){const se=f(J);if("error"in se)return{next:O,reason:se.error};if(Z=se.value,!Z)return{next:O,reason:"empty"}}else if(d!==void 0&&Z.length>d)return{next:O,reason:"long"};return O.includes(Z)?{next:O,reason:"duplicate"}:o!==void 0&&O.length>=o?{next:O,reason:"max"}:{next:[...O,Z],reason:null}},T=P=>{const O=rN(P);let J=i,Z=null,se=!1;for(const E of O){if(!E.trim())continue;se=!0;const z=M(E,J);J=z.next,z.reason&&(Z=z.reason)}!se&&P.trim()&&(Z="empty"),J!==i&&r(J),m==null||m(Z),U("")};return s.jsxs("div",{className:Pe("flex flex-col gap-1.5",x),children:[s.jsxs("div",{className:Pe(Yc,"flex h-auto flex-wrap items-center gap-1.5 py-1.5 focus-within:ring-2 focus-within:ring-brand-blue/50"),children:[i.map(P=>s.jsx(Qc,{dir:b,disabled:v,removeLabel:p(P),onRemove:v?void 0:()=>{r(i.filter(O=>O!==P)),m==null||m(null)},children:P},P)),s.jsx(Be,{...L,ref:_,id:R,value:ne,disabled:v,placeholder:i.length===0?A:void 0,"aria-label":k,"aria-invalid":N,"aria-describedby":j,className:"min-h-10 min-w-24 flex-1 border-0 bg-transparent px-1 shadow-none focus-visible:ring-0",onChange:P=>{const O=P.target.value;if(/[,،\n\r]/.test(O)){T(O);return}U(O)},onKeyDown:P=>{if(!P.nativeEvent.isComposing){if(P.key==="Enter"||P.key===","||P.key==="،"){P.preventDefault(),T(ne);return}P.key==="Backspace"&&ne.length===0&&i.length>0&&(P.preventDefault(),r(i.slice(0,-1)),m==null||m(null))}},onPaste:P=>{const O=P.clipboardData.getData("text");/[,،\n\r]/.test(O)&&(P.preventDefault(),T(`${ne}${O}`))},onBlur:()=>{ne.trim()&&T(ne)}})]}),h&&s.jsx("p",{className:"text-xs text-muted tabular-nums",children:h})]})});var Xc=uv();const cN='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function uN(n){return[...n.querySelectorAll(cN)].filter(i=>!(i.tabIndex<0||i.closest("[aria-hidden='true']")))}function ih(n,i,r){const o=y.useRef(r);o.current=r,y.useLayoutEffect(()=>{if(!i)return;const d=document.activeElement instanceof HTMLElement?document.activeElement:null,f=n.current;f&&(!(document.activeElement instanceof Node)||!f.contains(document.activeElement))&&f.focus();const m=h=>{var k;if(h.key==="Escape"){if(h.defaultPrevented)return;const N=n.current;if(N){const j=document.querySelectorAll("[data-overlay]"),L=j.item(j.length-1);if(L&&L!==N)return}h.preventDefault(),h.stopImmediatePropagation(),(k=o.current)==null||k.call(o);return}if(h.key!=="Tab"||!n.current)return;const b=document.activeElement;if(b instanceof Element&&b.closest("[data-overlay='popover']"))return;if(n.current.dataset.overlay==="dialog"&&b instanceof Element){const N=b.closest("[data-overlay]");if(N&&N!==n.current)return}const x=uN(n.current);if(x.length===0){h.preventDefault(),n.current.focus();return}const v=x[0],S=x[x.length-1],A=b instanceof Node&&n.current.contains(b);h.shiftKey&&(!A||b===v)?(h.preventDefault(),S==null||S.focus()):!h.shiftKey&&(!A||b===S)&&(h.preventDefault(),v==null||v.focus())};document.addEventListener("keydown",m);const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{var h;document.removeEventListener("keydown",m),document.body.style.overflow=p,(h=d==null?void 0:d.focus)==null||h.call(d)}},[i,n])}function an({isOpen:n,onClose:i,title:r,children:o,footer:d,maxWidth:f,description:m,className:p}){const{t:h}=Ue(),b=y.useRef(null),x=y.useId(),v=y.useId();if(ih(b,n,i),!n)return null;const S={paddingBottom:"max(1rem, env(safe-area-inset-bottom))"};return Xc.createPortal(s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center overflow-y-auto p-4",style:S,children:[s.jsx("button",{type:"button",className:"fixed inset-0 cursor-default border-0 bg-black/65 p-0 backdrop-blur-sm",onClick:i,"aria-label":h("close")}),s.jsxs("div",{ref:b,role:"dialog","aria-modal":"true","aria-labelledby":x,"aria-describedby":m?v:void 0,tabIndex:-1,"data-overlay":"dialog",className:Pe("relative z-10 my-auto flex w-full flex-col overflow-hidden rounded-2xl border border-line bg-panel shadow-2xl outline-none",p),style:{maxWidth:f||"32.5rem",maxHeight:"calc(100dvh - 1rem - max(1rem, env(safe-area-inset-bottom)))",animation:"modal-enter 150ms ease-out"},children:[s.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-line p-4 md:p-5",children:[s.jsx("h2",{id:x,className:"min-w-0 text-base font-bold text-text-main md:text-lg",children:r}),s.jsx(Oe,{label:h("close"),icon:s.jsx(Rn,{size:18}),onClick:i})]}),s.jsxs("div",{className:Pe("min-h-0 overflow-y-auto p-4 md:p-5",!d&&"pb-[max(1rem,env(safe-area-inset-bottom))]"),style:d?void 0:S,children:[m&&s.jsx("p",{id:v,className:"mb-3 text-sm text-muted",children:m}),o]}),d&&s.jsx("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-line bg-panel-raised/50 p-4 pb-[max(1rem,env(safe-area-inset-bottom))]",style:S,children:d})]})]}),document.body)}function hl({isOpen:n,onClose:i,onConfirm:r,title:o,description:d,confirmLabel:f,cancelLabel:m,variant:p="danger",loading:h=!1,children:b,maxWidth:x}){return s.jsx(an,{isOpen:n,onClose:i,title:o,description:d,maxWidth:x,footer:s.jsxs(s.Fragment,{children:[s.jsx(de,{variant:"secondary",onClick:i,disabled:h,children:m}),s.jsx(de,{variant:p==="danger"?"danger":"primary",onClick:r,loading:h,children:f})]}),children:b})}function rh({summary:n,children:i}){const[r,o]=y.useState(!1),d=y.useId();return s.jsxs(Ze,{padded:!1,className:"min-w-0 self-start overflow-hidden",children:[s.jsxs(de,{variant:"ghost",className:"h-auto w-full justify-between gap-3 p-4 text-start","aria-expanded":r,"aria-controls":d,id:`${d}-trigger`,onClick:()=>o(f=>!f),children:[s.jsx("span",{className:"min-w-0 flex-1",children:n}),s.jsx(cl,{size:18,"aria-hidden":!0,className:`shrink-0 transition-transform motion-reduce:transition-none ${r?"rotate-180":""}`})]}),s.jsx("section",{id:d,"aria-labelledby":`${d}-trigger`,"aria-hidden":!r,inert:!r,className:`grid transition-[grid-template-rows] duration-200 motion-reduce:transition-none ${r?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:s.jsx("div",{className:"min-h-0 overflow-hidden",children:s.jsx("div",{className:"border-t border-line p-4",children:i})})})]})}function va({className:n,label:i}){return s.jsxs("span",{role:i?"status":void 0,className:Pe("inline-flex items-center gap-2",i&&"text-muted"),children:[s.jsx("span",{"aria-hidden":!0,className:Pe("size-4 shrink-0 rounded-full border-2 border-brand-blue border-t-transparent animate-spin",n)}),i&&s.jsx("span",{className:"text-xs",children:i})]})}function Ts({text:n}){return s.jsx("div",{className:"flex flex-col items-center justify-center gap-2 py-16",children:s.jsx(va,{className:"size-6",label:n})})}function Gt({className:n}){return s.jsx("div",{"aria-hidden":!0,className:Pe("animate-pulse rounded-lg bg-panel-hover",n)})}function mt({kind:n,icon:i,title:r,text:o,description:d,action:f,className:m}){const{t:p}=Ue(),h=n==="empty"?p("emptyRecords"):n==="no-results"?p("emptyMatches"):n==="error"?p("loadError"):null;return s.jsxs("div",{role:n==="error"?"alert":void 0,className:Pe("flex flex-col items-center justify-center gap-2 px-4 py-12 text-center sm:py-16",m),children:[i&&s.jsx("div",{className:"text-muted",children:i}),(r||h)&&s.jsx("p",{className:"text-base font-bold text-text-main",children:r??h}),(o||d)&&s.jsx("p",{className:"max-w-md text-sm text-muted",children:d??o}),f]})}const ib="(max-width: 639px)";function dN(){const[n,i]=y.useState(()=>typeof window<"u"?window.matchMedia(ib).matches:!1);return y.useEffect(()=>{const r=window.matchMedia(ib),o=()=>i(r.matches);return o(),r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),n}function fN(n,i,r,o){const m=window.innerWidth,p=window.innerHeight;let h=n.bottom+6;h+i.height>p-8&&n.top-i.height-6>=8&&(h=n.top-i.height-6),h=Math.max(8,Math.min(h,p-8-i.height));const b=r==="center"?n.left+n.width/2-i.width/2:r==="start"?o==="rtl"?n.right-i.width:n.left:o==="rtl"?n.left:n.right-i.width,x=Math.max(8,Math.min(b,m-8-i.width));return{top:h,left:x}}function y1({open:n,defaultOpen:i=!1,onOpenChange:r,trigger:o,children:d,align:f="end",label:m,haspopup:p="dialog",className:h,badge:b}){const{t:x}=Ue(),[v,S]=y.useState(i),A=n??v,k=y.useCallback(O=>{n===void 0&&S(O),r==null||r(O)},[r,n]),N=dN(),j=y.useRef(null),L=y.useRef(null),_=y.useId(),[G,R]=y.useState(null),ne=y.useRef(k);ne.current=k;const U=y.useCallback(()=>{const O=j.current,J=L.current;if(!O||!J)return;const Z=document.documentElement.dir==="rtl"?"rtl":"ltr";R(fN(O.getBoundingClientRect(),J.getBoundingClientRect(),f,Z))},[f]);y.useLayoutEffect(()=>{if(!A||N)return;U();const O=L.current,J=O?new ResizeObserver(()=>U()):null;return O&&J&&J.observe(O),window.addEventListener("resize",U),window.addEventListener("scroll",U,!0),()=>{J==null||J.disconnect(),window.removeEventListener("resize",U),window.removeEventListener("scroll",U,!0)}},[A,N,U]),y.useEffect(()=>{if(!A)return;const O=Z=>{var E,z;const se=Z.target;se instanceof Node&&((E=j.current)!=null&&E.contains(se)||(z=L.current)!=null&&z.contains(se)||ne.current(!1))},J=Z=>{Z.key==="Escape"&&(Z.preventDefault(),Z.stopPropagation(),ne.current(!1))};return document.addEventListener("pointerdown",O,!0),document.addEventListener("keydown",J,!0),()=>{document.removeEventListener("pointerdown",O,!0),document.removeEventListener("keydown",J,!0)}},[A]),ih(L,A&&N,()=>k(!1));const M=y.isValidElement(o)?o.props:{},T=y.isValidElement(o)?y.cloneElement(o,{onClick:O=>{var J;(J=M.onClick)==null||J.call(M,O),O.defaultPrevented||k(!A)},"aria-expanded":A,"aria-haspopup":p,"aria-controls":_}):o,P=s.jsxs("div",{ref:L,id:_,role:p==="menu"?"presentation":"dialog",...p==="menu"||!m?{}:{"aria-label":m},tabIndex:-1,"data-overlay":"popover",className:Pe("z-[70] border border-line bg-panel-solid text-text-main shadow-2xl outline-none",h,N?"relative max-h-[85dvh] w-full max-w-none overflow-y-auto rounded-t-2xl p-4 pb-[max(1rem,env(safe-area-inset-bottom))]":"fixed max-h-[min(24rem,calc(100dvh-1rem))] overflow-y-auto rounded-2xl"),style:N?{animation:"modal-enter 150ms ease-out",paddingBottom:"max(1rem, env(safe-area-inset-bottom))"}:{top:(G==null?void 0:G.top)??0,left:(G==null?void 0:G.left)??0,visibility:G?"visible":"hidden",animation:"modal-enter 150ms ease-out"},children:[N&&s.jsxs("div",{className:"relative mb-3 flex h-10 items-center justify-center",children:[s.jsx("span",{className:"h-1 w-10 rounded-full bg-line"}),s.jsx(Oe,{label:x("close"),icon:s.jsx(Rn,{size:16}),variant:"ghost",className:"absolute end-0",onClick:()=>k(!1)})]}),d]});return s.jsxs(s.Fragment,{children:[s.jsxs("span",{ref:j,className:"relative inline-flex",children:[T,b]}),A&&Xc.createPortal(N?s.jsxs("div",{className:"fixed inset-0 z-[70] flex items-end",children:[s.jsx("button",{type:"button",className:"absolute inset-0 cursor-default border-0 bg-black/60 p-0","aria-label":x("close"),onClick:()=>k(!1)}),P]}):P,document.body)]})}function xl({label:n,resetLabel:i,activeCount:r=0,onReset:o,children:d}){const[f,m]=y.useState(!1),p=r>0?`${n} (${r})`:n;return s.jsxs(y1,{open:f,onOpenChange:m,align:"end",label:n,haspopup:"dialog",className:"w-[min(20rem,calc(100vw-1rem))] p-3",badge:r>0?s.jsx(We,{tone:"info",className:"pointer-events-none absolute -top-1 -end-1 z-10 h-5 min-w-5 justify-center px-1 tabular-nums",children:r}):null,trigger:s.jsx(Oe,{label:p,icon:s.jsx(qk,{size:18}),pressed:r>0}),children:[s.jsxs("div",{className:"mb-3 flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-sm font-bold text-text-main",children:n}),o&&s.jsx(de,{variant:"ghost",size:"sm",onClick:o,disabled:r===0,children:i})]}),s.jsx("div",{className:"flex flex-col gap-3",children:d})]})}function mN({label:n,content:i,children:r,className:o}){const[d,f]=y.useState(!1),[m,p]=y.useState(null),h=y.useRef(null),b=y.useRef(null),x=y.useRef(!1),v=y.useId();return y.useLayoutEffect(()=>{if(!d)return;const S=()=>{var G,R;const A=(G=h.current)==null?void 0:G.getBoundingClientRect(),k=(R=b.current)==null?void 0:R.getBoundingClientRect();if(!A||!k)return;const N=8,j=Math.max(N,Math.min(A.left+A.width/2-k.width/2,window.innerWidth-N-k.width)),L=A.top>=k.height+N+6?A.top-k.height-6:A.bottom+6,_=Math.max(N,Math.min(L,window.innerHeight-N-k.height));p({top:_,left:j})};return S(),window.addEventListener("resize",S),window.addEventListener("scroll",S,!0),()=>{window.removeEventListener("resize",S),window.removeEventListener("scroll",S,!0)}},[d]),y.useEffect(()=>{if(!d)return;const S=k=>{var N,j;k.target instanceof Node&&!((N=h.current)!=null&&N.contains(k.target))&&!((j=b.current)!=null&&j.contains(k.target))&&f(!1)},A=k=>{k.key==="Escape"&&f(!1)};return document.addEventListener("pointerdown",S),document.addEventListener("keydown",A),()=>{document.removeEventListener("pointerdown",S),document.removeEventListener("keydown",A)}},[d]),s.jsxs(s.Fragment,{children:[s.jsx(Oe,{ref:h,label:n,title:"",icon:r,variant:"ghost",className:o,"aria-describedby":d?v:void 0,onPointerDown:S=>{x.current=S.pointerType==="touch"},onPointerEnter:S=>{S.pointerType==="mouse"&&f(!0)},onPointerLeave:S=>{S.pointerType==="mouse"&&document.activeElement!==h.current&&f(!1)},onFocus:()=>{x.current||f(!0)},onBlur:()=>{x.current=!1,f(!1)},onClick:()=>{x.current&&f(S=>!S)}}),d&&Xc.createPortal(s.jsx("div",{ref:b,id:v,role:"tooltip",className:"fixed z-[80] max-h-[calc(100dvh-1rem)] w-max max-w-[calc(100vw-1rem)] overflow-y-auto rounded-lg border border-line bg-panel-solid px-3 py-2 text-xs leading-relaxed text-text-main shadow-lg",style:{top:(m==null?void 0:m.top)??0,left:(m==null?void 0:m.left)??0,visibility:m?"visible":"hidden"},children:i}),document.body)]})}const oh=y.createContext(()=>{});function ch({trigger:n,label:i,align:r="end",children:o}){const[d,f]=y.useState(!1);return s.jsx(oh.Provider,{value:()=>f(!1),children:s.jsx(y1,{open:d,onOpenChange:f,trigger:n,label:i,align:r,haspopup:"menu",className:"min-w-52 p-1",children:s.jsx(hN,{label:i,children:o})})})}function hN({label:n,children:i}){const r=y.useRef(null),o=y.useContext(oh);y.useEffect(()=>{var f,m;(m=(f=r.current)==null?void 0:f.querySelector("[role='menuitem']:not([disabled])"))==null||m.focus()},[]);const d=f=>{var b,x,v;const m=[...((b=r.current)==null?void 0:b.querySelectorAll("[role='menuitem']:not([disabled])"))??[]];if(m.length===0)return;const p=m.indexOf(document.activeElement),h=S=>{var A;f.preventDefault(),(A=m[(S+m.length)%m.length])==null||A.focus()};f.key==="ArrowDown"?h(p+1):f.key==="ArrowUp"?h(p<=0?m.length-1:p-1):f.key==="Home"?(f.preventDefault(),(x=m[0])==null||x.focus()):f.key==="End"?(f.preventDefault(),(v=m[m.length-1])==null||v.focus()):f.key==="Escape"&&(f.preventDefault(),o())};return s.jsx("div",{ref:r,role:"menu","aria-label":n,"aria-orientation":"vertical",onKeyDown:d,className:"flex flex-col gap-0.5",children:i})}function lt({icon:n,danger:i=!1,checked:r=!1,onSelect:o,className:d,type:f="button",children:m,onClick:p,...h}){const b=y.useContext(oh);return s.jsxs("button",{type:f,role:"menuitem",className:Pe("flex min-h-10 w-full items-center gap-2 rounded-lg px-3 py-2 text-start text-sm font-medium","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50","disabled:cursor-not-allowed disabled:opacity-40",i?"text-danger hover:bg-danger/10":"text-text-main hover:bg-panel-hover",d),onClick:x=>{p==null||p(x),!x.defaultPrevented&&(o==null||o(),f!=="submit"&&b())},...h,children:[n&&s.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:n}),s.jsx("span",{className:"min-w-0 flex-1",children:m}),r&&s.jsx(gi,{size:16,className:"shrink-0 text-brand-cyan"})]})}function Dr(){return s.jsx("hr",{className:"my-1 border-0 border-t border-line"})}function pN({children:n}){return s.jsx("div",{className:"px-3 py-1.5 text-[11px] font-semibold uppercase tracking-wider text-faint",children:n})}function Yn({label:n,align:i="end",id:r,children:o}){return s.jsx(ch,{label:n,align:i,trigger:s.jsx(Oe,{id:r,label:n,icon:s.jsx(Uk,{size:18})}),children:o})}function ki({page:n,pageCount:i,total:r,onPageChange:o,label:d,className:f}){const{t:m,direction:p}=Ue(),h=Math.max(1,i),b=Math.min(Math.max(1,n),h),x=p==="rtl"?s.jsx(Oc,{size:18}):s.jsx(Lr,{size:18}),v=p==="rtl"?s.jsx(Lr,{size:18}):s.jsx(Oc,{size:18});return s.jsxs("nav",{"aria-label":d??m("pagination"),className:Pe("flex min-w-0 flex-wrap items-center justify-between gap-2 text-sm",f),children:[s.jsx("span",{className:"text-muted tabular-nums",children:m("resultCount").replace("{n}",String(r))}),i>1&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Oe,{label:m("previousPage"),icon:x,disabled:b<=1,onClick:()=>o(b-1)}),s.jsx("span",{className:"min-w-0 px-1 text-center text-xs font-medium text-text-main tabular-nums sm:text-sm",children:m("pageOf").replace("{page}",String(b)).replace("{count}",String(h))}),s.jsx(Oe,{label:m("nextPage"),icon:v,disabled:b>=h,onClick:()=>o(b+1)})]})]})}function Zc(n,i=20,r){const o=Math.max(1,Math.floor(i)||20),d=n.length,f=Math.max(1,Math.ceil(d/o)),[m,p]=y.useState({page:1,resetKey:r}),h=Object.is(m.resetKey,r)?Math.min(m.page,f):1;y.useEffect(()=>{(!Object.is(m.resetKey,r)||m.page!==h)&&p({page:h,resetKey:r})},[h,r,m]);const b=x=>{p({page:Math.min(Math.max(1,Math.floor(x)||1),f),resetKey:r})};return{page:h,pageCount:f,pageItems:n.slice((h-1)*o,h*o),setPage:b,total:d}}const qa=y.forwardRef(function({className:i,dir:r="ltr",spellCheck:o=!1,autoCapitalize:d="off",autoCorrect:f="off",disabled:m,...p},h){const{t:b}=Ue(),[x,v]=y.useState(!1),S=y.useRef(null),A=y.useRef(null);return y.useLayoutEffect(()=>{const k=A.current,N=S.current;!k||!N||(N.focus({preventScroll:!0}),N.setSelectionRange(k.start,k.end),A.current=null)}),s.jsxs("span",{dir:r,className:"grid w-full min-w-0 items-center",children:[s.jsx(Be,{...p,ref:k=>{S.current=k,typeof h=="function"?h(k):h&&(h.current=k)},type:x?"text":"password",dir:r,spellCheck:o,autoCapitalize:d,autoCorrect:f,disabled:m,className:Pe("col-start-1 row-start-1 pe-12 text-start",i)}),s.jsx(Oe,{label:b(x?"hideSecret":"showSecret"),icon:x?s.jsx(Pv,{size:18}):s.jsx(Si,{size:18}),pressed:x,variant:"ghost",disabled:m,className:"col-start-1 row-start-1 me-0.5 justify-self-end",onMouseDown:k=>k.preventDefault(),onClick:()=>{const k=S.current;k&&(A.current={start:k.selectionStart??k.value.length,end:k.selectionEnd??k.value.length}),v(N=>!N)}})]})}),xc=new Set;let wr=null;function gN(n){return xc.add(n),wr===null&&(wr=window.setInterval(()=>{for(const i of xc)i()},3e4)),()=>{xc.delete(n),xc.size===0&&wr!==null&&(window.clearInterval(wr),wr=null)}}function b1(n){return n==="ar"?"ar":"en"}function xN(n){const i=n instanceof Date?n.getTime():typeof n=="number"?n:Date.parse(n);return Number.isFinite(i)?i:null}const Ff=[{unit:"year",ms:1e3*60*60*24*365},{unit:"month",ms:1e3*60*60*24*30},{unit:"week",ms:1e3*60*60*24*7},{unit:"day",ms:1e3*60*60*24},{unit:"hour",ms:1e3*60*60},{unit:"minute",ms:1e3*60},{unit:"second",ms:1e3}];function yN(n,i,r){const o=n-i,d=Math.abs(o),f=new Intl.RelativeTimeFormat(b1(r),{numeric:"auto"}),m=Ff.find(h=>d>=h.ms)??Ff[Ff.length-1],p=Math.round(o/m.ms);return f.format(p,m.unit)}function Br({value:n,className:i}){const{language:r}=Ue(),[o,d]=y.useState(()=>Date.now());y.useEffect(()=>gN(()=>d(Date.now())),[]);const f=xN(n);if(f===null)return null;const m=b1(r),p=new Intl.DateTimeFormat(m,{dateStyle:"medium",timeStyle:"short"}).format(f);return s.jsx("time",{dateTime:new Date(f).toISOString(),title:p,className:Pe("whitespace-nowrap",i),children:yN(f,o,r)})}const bN=1500;function v1(n){return n instanceof Error&&n.message?n.message:typeof n=="string"&&n?n:""}function Hc(n,i){if(Object.is(n,i))return!0;if(typeof n!="object"||typeof i!="object"||n===null||i===null)return!1;const r=n,o=i,d=Object.keys(r);return d.length!==Object.keys(o).length?!1:d.every(f=>Object.is(r[f],o[f]))}function w1(n,i){y.useEffect(()=>{if(n!=="saved")return;const r=window.setTimeout(()=>{i(o=>o==="saved"?"idle":o)},bN);return()=>window.clearTimeout(r)},[n,i])}function bn(n){const[i,r]=y.useState(n),[o,d]=y.useState("idle"),[f,m]=y.useState(null),p=y.useRef(n);y.useEffect(()=>{o!=="saving"&&(Hc(n,p.current)||(p.current=n,r(n)))},[n,o]),w1(o,d);const h=!Hc(i,n),b=y.useCallback(async v=>{if(!(!h||o==="saving")){d("saving"),m(null);try{await v(i),d("saved")}catch(S){d("idle"),m(v1(S)||null)}}},[h,o,i]),x=y.useCallback(()=>{r(n),m(null),d("idle")},[n]);return{value:i,setValue:r,dirty:h,status:o,error:f,save:b,revert:x}}function Pc(n){const[i,r]=y.useState(n),[o,d]=y.useState("idle"),[f,m]=y.useState(null),p=y.useRef(n);y.useEffect(()=>{o!=="saving"&&(Hc(n,p.current)||(p.current=n,r(n)))},[n,o]),w1(o,d);const h=!Hc(i,n),b=y.useCallback((S,A)=>{r(k=>({...k,[S]:A}))},[]),x=y.useCallback(async S=>{if(!(!h||o==="saving")){d("saving"),m(null);try{await S(i),d("saved")}catch(A){d("idle"),m(v1(A)||null)}}},[h,o,i]),v=y.useCallback(()=>{r(n),m(null),d("idle")},[n]);return{draft:i,setDraft:r,setField:b,dirty:h,status:o,error:f,save:x,revert:v}}function vn({label:n,description:i,error:r,htmlFor:o,className:d,dirty:f,saving:m,justSaved:p,onSave:h,onRevert:b,saveLabel:x,savedLabel:v,actions:S,children:A}){const k=j=>{var _;const L=(_=j.target)==null?void 0:_.tagName;j.key==="Enter"&&L==="INPUT"&&!j.nativeEvent.isComposing&&(j.preventDefault(),f&&!m&&h()),j.key==="Escape"&&(j.preventDefault(),b())},N=y.isValidElement(A)?y.cloneElement(A,{onKeyDown:j=>{var L,_;(_=(L=A.props).onKeyDown)==null||_.call(L,j),k(j)}}):A;return s.jsx(_e,{label:n,description:i,error:r,htmlFor:o,className:d,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"min-w-0 flex-1",children:N}),S,s.jsx(Oe,{type:"button",label:p?v??x:x,icon:p?s.jsx(gi,{size:16}):s.jsx(xi,{size:16}),loading:m,disabled:!f&&!p||m,onClick:()=>{f&&!m&&h()},className:p?"text-ok":void 0})]})})}function qc({dirty:n,saving:i,justSaved:r,error:o,onDiscard:d,saveLabel:f,discardLabel:m,unsavedLabel:p,savedLabel:h,className:b}){return s.jsxs("div",{className:Pe("flex flex-wrap items-center gap-2",b),children:[s.jsx("div",{className:"min-w-0 flex-1",children:o?s.jsx("p",{role:"alert",className:"text-xs text-danger",children:o}):n?s.jsx("p",{className:"text-xs text-warn",children:p}):r&&h?s.jsx("p",{className:"text-xs text-ok",children:h}):null}),s.jsx(de,{type:"button",variant:"ghost",disabled:!n||i,onClick:d,children:m}),s.jsx(de,{type:"submit",variant:"primary",icon:s.jsx(xi,{size:16}),disabled:!n,loading:i,children:f})]})}function Pr({label:n,value:i,options:r,onChange:o}){var f;const d=(f=r.find(m=>m.value===i))==null?void 0:f.label;return s.jsx(ch,{label:n,trigger:s.jsx(Oe,{label:d?`${n}: ${d}`:n,icon:s.jsx(Ak,{size:18})}),children:r.map(m=>s.jsx(lt,{checked:m.value===i,onSelect:()=>o(m.value),children:m.label},m.value))})}function S1(n){var f,m;if(!(n.target instanceof HTMLButtonElement))return;const i=Array.from(n.currentTarget.querySelectorAll('[role="tab"]')),r=i.indexOf(n.target);if(r<0)return;const o=getComputedStyle(n.currentTarget).direction==="rtl";let d;switch(n.key){case"ArrowRight":d=(r+(o?-1:1)+i.length)%i.length;break;case"ArrowLeft":d=(r+(o?1:-1)+i.length)%i.length;break;case"Home":d=0;break;case"End":d=i.length-1;break;default:return}n.preventDefault(),i[d].focus({preventScroll:!0}),(m=(f=i[d]).scrollIntoView)==null||m.call(f,{block:"nearest",inline:"nearest"}),i[d].click()}function k1(n){const i=y.useRef(null);return y.useEffect(()=>{var r,o;(o=(r=i.current)==null?void 0:r.scrollIntoView)==null||o.call(r,{block:"nearest",inline:"nearest"})},[n]),i}function Ia({value:n,onChange:i,options:r,"aria-label":o,className:d}){var p;const f=k1(n),m=r.some(h=>h.value===n)?n:(p=r[0])==null?void 0:p.value;return s.jsx("div",{role:"tablist","aria-label":o,onKeyDown:S1,className:Pe("inline-flex max-w-full flex-nowrap overflow-x-auto no-scrollbar rounded-xl border border-line bg-panel-raised p-1",d),children:r.map(h=>{const b=h.value===n;return s.jsxs("button",{ref:b?f:void 0,type:"button",role:"tab","aria-selected":b,tabIndex:h.value===m?0:-1,onClick:()=>i(h.value),className:Pe("inline-flex min-h-10 shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-lg px-3 text-xs font-semibold transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50",b?"bg-brand-blue text-white":"text-muted hover:text-text-main"),children:[h.icon,h.label]},h.value)})})}function $c({value:n,onChange:i,options:r,"aria-label":o,className:d}){var p;const f=k1(n),m=r.some(h=>h.value===n)?n:(p=r[0])==null?void 0:p.value;return s.jsx("div",{role:"tablist","aria-label":o,onKeyDown:S1,className:Pe("flex items-center gap-1 sm:gap-2",d),children:r.map(h=>{const b=h.value===n,x=!!h.icon&&!b;return s.jsxs("button",{ref:b?f:void 0,type:"button",role:"tab","aria-selected":b,tabIndex:h.value===m?0:-1,title:x&&typeof h.label=="string"?h.label:void 0,onClick:()=>i(h.value),className:Pe("inline-flex min-h-10 min-w-10 shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-xl text-sm font-bold transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50",x?"px-2.5 sm:px-4":"px-4",b?"bg-brand-blue text-white shadow-md shadow-brand-blue/25":"text-muted hover:bg-panel-hover hover:text-text-main"),children:[h.icon,s.jsx("span",{className:Pe(x&&"sr-only sm:not-sr-only"),children:h.label})]},h.value)})})}const yl=y.forwardRef(function({className:i,...r},o){return s.jsx("div",{ref:o,className:Pe("flex flex-wrap items-center gap-2",i),...r})}),vN=1500,rb=120,j1=8,ks=12,wN=320,ob=640,cb="color-mix(in srgb, var(--panel-solid) 62%, transparent)",SN="0 0 0 1px color-mix(in srgb, var(--brand-cyan) 55%, transparent)",kN="0 0 20px 3px color-mix(in srgb, var(--brand-cyan) 30%, transparent)",yc=(n,i,r)=>Math.min(Math.max(n,i),r);function jN({rect:n,pad:i=j1}){if(!n||n.width<=0&&n.height<=0)return s.jsx("div",{className:"absolute inset-0",style:{backgroundColor:cb}});const r={top:n.top-i,left:n.left-i,width:n.width+i*2,height:n.height+i*2};return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"absolute rounded-2xl transition-[top,left,width,height] duration-150 ease-out",style:{...r,boxShadow:`0 0 0 9999px ${cb}`}}),s.jsx("div",{className:"tour-glow absolute rounded-2xl",style:{...r,boxShadow:`${SN}, ${kN}`}})]})}function NN({open:n,steps:i,index:r,onAdvance:o,onBack:d,onClose:f,labels:m}){const{direction:p}=Ue(),h=y.useId(),b=i[r],[x,v]=y.useState(null),[S,A]=y.useState(null),[k,N]=y.useState(0),[j,L]=y.useState(()=>window.innerWidth<ob),_=y.useRef(null),G=y.useRef(null),R=y.useRef(o);if(R.current=o,y.useEffect(()=>{const P=()=>L(window.innerWidth<ob);return window.addEventListener("resize",P),window.addEventListener("orientationchange",P),()=>{window.removeEventListener("resize",P),window.removeEventListener("orientationchange",P)}},[]),y.useEffect(()=>{if(!n||(v(null),A(null),!b))return;const P=`[data-tour="${b.target}"]`;let O=0;const J=window.setInterval(()=>{const Z=document.querySelector(P),se=Z==null?void 0:Z.getBoundingClientRect();if(Z&&se&&(se.width>0||se.height>0)){window.clearInterval(J),Z.scrollIntoView({block:"center",inline:"nearest"}),v(Z);return}O+=rb,O>=vN&&(window.clearInterval(J),R.current())},rb);return()=>window.clearInterval(J)},[n,b]),y.useEffect(()=>{if(!n||!x)return;let P=0,O=null;const J=()=>{const Z=_.current;if(Z){const F=Z.offsetHeight;N(le=>Math.abs(le-F)>1?F:le)}const se=x.getBoundingClientRect(),E={top:se.top,left:se.left,width:se.width,height:se.height,bottom:se.bottom,right:se.right};(!O||Math.abs(E.top-O.top)>.5||Math.abs(E.left-O.left)>.5||Math.abs(E.width-O.width)>.5||Math.abs(E.height-O.height)>.5)&&(O=E,A(E)),P=window.requestAnimationFrame(J)};return P=window.requestAnimationFrame(J),()=>window.cancelAnimationFrame(P)},[n,x]),y.useEffect(()=>{var E;const P=_.current;if(!n||!x||!j||!P)return;const O=(((E=document.querySelector("header"))==null?void 0:E.getBoundingClientRect().bottom)??0)+ks,J=window.innerHeight-P.offsetHeight-ks-O,Z=x.getBoundingClientRect(),se=Z.height>=J?O:O+(J-Z.height)/2;window.scrollBy({top:Z.top-se})},[n,x,j]),ih(_,n&&!!x,f),y.useEffect(()=>{var P;n&&x&&((P=G.current)==null||P.focus({preventScroll:!0}))},[n,x]),!n||!b)return null;const ne=r===i.length-1,U=P=>{const O=p==="rtl"?"ArrowLeft":"ArrowRight",J=p==="rtl"?"ArrowRight":"ArrowLeft";P.key===O?(P.preventDefault(),o()):P.key===J&&(P.preventDefault(),d())};let M,T;if(j)T="fixed inset-x-0 bottom-0 rounded-t-2xl border-t p-4",M={paddingBottom:"max(1rem, env(safe-area-inset-bottom))",animation:"modal-enter 150ms ease-out"};else if(S){const P=window.innerWidth,O=window.innerHeight,J=Math.min(wN,P-24),Z=k||170,se=P-S.left-S.width,E=S.left,z=J+ks+j1;let F,le;se>=E&&se>=z?(F=yc(S.top+S.height/2-Z/2,8,Math.max(8,O-Z-8)),le=S.left+S.width+ks):E>=z?(F=yc(S.top+S.height/2-Z/2,8,Math.max(8,O-Z-8)),le=S.left-ks-J):S.bottom+ks+Z<=O-8?(F=S.bottom+ks,le=yc(S.left+S.width/2-J/2,8,P-J-8)):(F=Math.max(8,S.top-ks-Z),le=yc(S.left+S.width/2-J/2,8,P-J-8)),T="fixed rounded-2xl border p-4",M={top:F,left:le,width:J,maxHeight:`calc(100dvh - ${F}px - 8px)`,overflowY:"auto",animation:"modal-enter 150ms ease-out"}}else T="fixed inset-x-0 bottom-0 rounded-t-2xl border-t p-4",M={paddingBottom:"max(1rem, env(safe-area-inset-bottom))",animation:"modal-enter 150ms ease-out"};return Xc.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-50"}),s.jsx("div",{"aria-hidden":"true",className:"pointer-events-none fixed inset-0 z-50",children:s.jsx(jN,{rect:S})}),s.jsxs("div",{ref:_,role:"dialog","aria-modal":"true","aria-labelledby":h,tabIndex:-1,"data-overlay":"dialog",className:Pe("z-50 flex w-full flex-col gap-2 border-line bg-panel shadow-2xl outline-none",T),style:M,onKeyDown:U,children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider text-faint",children:m.stepOf}),s.jsx("span",{className:"ms-auto"}),s.jsx(Oe,{size:"sm",variant:"ghost",label:m.skip,icon:s.jsx(Rn,{size:16}),onClick:f})]}),s.jsx("h2",{id:h,className:"text-base font-bold text-text-main",children:b.title}),s.jsx("p",{className:"text-sm leading-relaxed text-muted",children:b.body}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(de,{variant:"secondary",size:"md",disabled:r===0,icon:s.jsx(Lr,{size:16,className:"rtl:-scale-x-100"}),onClick:d,children:m.back}),s.jsx(de,{ref:G,variant:"primary",size:"md",className:"ms-auto",icon:ne?void 0:s.jsx(Oc,{size:16,className:"rtl:-scale-x-100"}),onClick:o,children:ne?m.done:m.next})]})]})]}),document.body)}const CN={1:"line-clamp-1",2:"line-clamp-2",3:"line-clamp-3"},rn=y.forwardRef(function({as:i="span",lines:r,title:o,className:d,children:f,dir:m,...p},h){const b={...p,dir:m??"auto",title:o??(r!==void 0&&typeof f=="string"?f:void 0),className:Pe("min-w-0 whitespace-normal break-words",r!==void 0&&CN[r],d),children:f};return i==="p"?s.jsx("p",{ref:h,...b}):i==="bdi"?s.jsx("bdi",{ref:h,...b}):i==="strong"?s.jsx("strong",{ref:h,...b}):i==="em"?s.jsx("em",{ref:h,...b}):s.jsx("span",{ref:h,...b})}),N1=y.createContext(null),EN=({children:n})=>{const{t:i}=Ue(),[r,o]=y.useState([]),d=y.useCallback(m=>{o(p=>p.filter(h=>h.id!==m))},[]),f=y.useCallback((m,p="info",h=4e3)=>{const b=Math.random().toString(36).slice(2,9);o(x=>[...x,{id:b,message:m,type:p,duration:h}]),setTimeout(()=>d(b),h)},[d]);return s.jsxs(N1.Provider,{value:{toast:f},children:[n,s.jsx("div",{className:"fixed bottom-5 end-5 z-50 flex flex-col gap-2.5 max-w-sm w-full px-4 pointer-events-none","aria-live":"polite",children:r.map(m=>s.jsxs("div",{className:`pointer-events-auto flex items-center gap-3 rounded-xl border bg-panel-raised/95 px-4 py-3 text-xs text-text-main shadow-xl backdrop-blur-md md:text-sm ${m.type==="success"?"border-ok/35":m.type==="error"?"border-danger/35":m.type==="warning"?"border-warn/35":"border-line"}`,children:[m.type==="success"&&s.jsx(Cs,{size:18,className:"shrink-0 text-ok"}),m.type==="error"&&s.jsx(Lk,{size:18,className:"shrink-0 text-danger"}),m.type==="warning"&&s.jsx(ml,{size:18,className:"shrink-0 text-warn"}),m.type==="info"&&s.jsx(Ik,{size:18,className:"shrink-0 text-info"}),s.jsx("span",{className:"flex-1 font-medium",children:m.message}),s.jsx(Oe,{variant:"ghost",label:i("dismiss"),icon:s.jsx(Rn,{size:16}),onClick:()=>d(m.id)})]},m.id))})]})},Ct=()=>{const n=y.useContext(N1);if(!n)throw new Error("useToast must be used within a ToastProvider");return n};let ub=!1;const AN=()=>{const{t:n}=Ue(),{toast:i}=Ct(),[r,o]=y.useState(!1),[d,f]=y.useState(!1),[m,p]=y.useState(!1);if(y.useEffect(()=>{typeof window>"u"||window.LevixHost||ub||(ub=!0,$.getCrashReports().then(x=>{x!=null&&x.reports&&x.reports.length>0&&o(!0)}).catch(()=>{}))},[]),!r)return null;const h=()=>{o(!1),window.location.hash="settings/diagnostics"},b=async()=>{p(!0);try{await $.deleteAllCrashReports(),i(n("allReportsDeleted"),"success"),o(!1)}catch(x){i((x==null?void 0:x.message)||"Delete failed","error")}finally{p(!1),f(!1)}};return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mb-4",children:s.jsx(Ze,{className:"border-warn/30 bg-warn/5 p-4",children:s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-xl bg-warn/15 text-warn",children:s.jsx(ml,{size:18})}),s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("h4",{className:"text-sm font-bold text-text-main",children:n("crashBannerTitle")}),s.jsx("p",{className:"text-xs leading-relaxed text-muted",children:n("crashBannerDesc")})]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 self-end sm:self-auto shrink-0",children:[s.jsx(de,{variant:"primary",size:"sm",onClick:h,icon:s.jsx(e1,{size:14}),children:n("crashBannerReview")}),s.jsx(de,{variant:"ghost",size:"sm",onClick:()=>o(!1),children:n("crashBannerNotNow")}),s.jsx(de,{variant:"danger",size:"sm",onClick:()=>f(!0),icon:s.jsx(Mn,{size:14}),children:n("crashBannerDelete")})]})]})})}),s.jsx(hl,{isOpen:d,onClose:()=>f(!1),onConfirm:b,loading:m,title:n("confirmDeleteAllReports"),description:n("confirmDeleteAllDesc"),confirmLabel:n("deleteAllReports"),cancelLabel:n("cancel"),variant:"danger"})]})};function Bm(n,i){const r=n||(document.documentElement.lang==="en"?"en":"ar"),o=i||(document.documentElement.getAttribute("data-theme")==="light"?"light":"dark"),d=`${window.innerWidth}x${window.innerHeight}@${Number(window.devicePixelRatio||1).toFixed(2)}`,f={screen:d.length>24?d.slice(0,24):d,language:r,theme:o},m=window.LevixHost;if(m&&typeof m.getDiagnostics=="function")try{const p=m.getDiagnostics();if(p){const h=JSON.parse(p);if(h&&typeof h=="object"){const b=["nativeApp","android","device","abi","webview","connectivity","memory","storage"];for(const x of b)typeof h[x]=="string"&&(f[x]=h[x])}}}catch{}return f}const TN=3,_N=20;let db=0;const fb=new Set;let Um=!1;const Cc=[];function Hm(){try{const n=window.location.hash.replace(/^#\/?/,"").split("/")[0];return(n?n.trim():"overview").slice(0,40)||"overview"}catch{return"overview"}}function mb(n){try{const i=(n||"overview").slice(0,60);Cc.push({at:new Date().toISOString(),kind:"nav",name:i}),Cc.length>_N&&Cc.shift()}catch{}}if(typeof window<"u")try{window.addEventListener("beforeunload",()=>{Um=!0}),window.addEventListener("pagehide",()=>{Um=!0}),mb(Hm()),window.addEventListener("hashchange",()=>{mb(Hm())})}catch{}function Pm(n,i,r){try{if(Um||db>=TN)return;let o=r||"Error",d="Unknown error",f=[];if(i instanceof Error)o=r||i.name||"Error",d=i.message||"Unknown error",i.stack&&(f=i.stack.split(`
545
- `).map(h=>h.trim().slice(0,200)).filter(Boolean).slice(0,20));else if(typeof i=="string")d=i;else if(i&&typeof i=="object"){const h=i;typeof h.message=="string"&&(d=h.message),typeof h.name=="string"&&(o=r||h.name),typeof h.stack=="string"&&(f=h.stack.split(`
546
- `).map(b=>b.trim().slice(0,200)).filter(Boolean).slice(0,20))}o=o.slice(0,120),d=d.slice(0,300);const m=`${o}|${d}`;if(fb.has(m))return;fb.add(m),db++;const p={category:n,error:{type:o,message:d,stack:f},screen:Hm(),breadcrumbs:[...Cc],device:Bm()};$.submitCrashReport(p).catch(()=>{})}catch{}}function DN(){if(typeof window>"u")return()=>{};const n=r=>{try{Pm("web-error",r.error||r.message)}catch{}},i=r=>{try{Pm("web-rejection",r.reason)}catch{}};return window.addEventListener("error",n),window.addEventListener("unhandledrejection",i),()=>{window.removeEventListener("error",n),window.removeEventListener("unhandledrejection",i)}}class C1 extends y.Component{constructor(i){super(i),this.state={hasError:!1,error:null}}static getDerivedStateFromError(i){return{hasError:!0,error:i}}componentDidCatch(i,r){try{Pm("react-render",i)}catch{}}render(){var i,r;if(this.state.hasError){const o=((i=this.context)==null?void 0:i.t)||(d=>d);return s.jsx("div",{className:"flex min-h-[50vh] items-center justify-center p-4",children:s.jsxs(Ze,{className:"max-w-md w-full text-center border-danger/30",children:[s.jsx("div",{className:"mx-auto flex size-12 items-center justify-center rounded-full bg-danger/10 text-danger",children:s.jsx(ml,{size:24})}),s.jsx("h2",{className:"mt-4 text-lg font-bold text-text-main",children:o("errorBoundaryTitle")}),s.jsx("p",{className:"mt-2 text-xs leading-relaxed text-muted sm:text-sm",children:o("errorBoundaryDesc")}),((r=this.state.error)==null?void 0:r.message)&&s.jsx("pre",{dir:"ltr",className:"mt-3 overflow-x-auto rounded-lg bg-panel p-2 font-mono text-[11px] leading-relaxed text-danger border border-line text-start",children:this.state.error.message}),s.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row items-center justify-center gap-3",children:[s.jsx(de,{variant:"primary",onClick:()=>window.location.reload(),icon:s.jsx(Ga,{size:16}),className:"w-full sm:w-auto",children:o("errorBoundaryReload")}),s.jsx(de,{variant:"secondary",onClick:()=>{window.location.hash="settings/diagnostics",this.setState({hasError:!1,error:null})},icon:s.jsx(e1,{size:16}),className:"w-full sm:w-auto",children:o("errorBoundaryGoDiagnostics")})]})]})})}return this.props.children}}Uy(C1,"contextType",ah);function Bt(n,i){return n.replace(/\{([A-Za-z0-9_]+)\}/g,(r,o)=>Object.hasOwn(i,o)?String(i[o]):r)}const Gf=[{id:"sidebar",target:"sidebar-nav",screen:"sidebar",desktopOnly:!0,titleKey:"tourSidebarTitle",bodyKey:"tourSidebarBody"},{id:"connection-start",target:"connection-start",screen:"connection",hash:"connection",titleKey:"tourConnectionStartTitle",bodyKey:"tourConnectionStartBody"},{id:"connection-pairing",target:"connection-pairing",screen:"connection",hash:"connection",titleKey:"tourConnectionPairingTitle",bodyKey:"tourConnectionPairingBody"},{id:"overview-stats",target:"overview-stats",screen:"overview",hash:"overview",titleKey:"tourOverviewStatsTitle",bodyKey:"tourOverviewStatsBody"},{id:"commands-list",target:"commands-list",screen:"commands",hash:"commands",titleKey:"tourCommandsTitle",bodyKey:"tourCommandsBody"},{id:"ai-agent",target:"ai-agent",screen:"ai",hash:"ai",inMainTour:!1,titleKey:"tourAiAgentTitle",bodyKey:"tourAiAgentBody"},{id:"ai-provider",target:"ai-provider",screen:"ai",hash:"ai",titleKey:"tourAiProviderTitle",bodyKey:"tourAiProviderBody"},{id:"ai-memory",target:"ai-memory",screen:"ai",hash:"ai",titleKey:"tourAiMemoryTitle",bodyKey:"tourAiMemoryBody"},{id:"groups-list",target:"groups-list",screen:"groups",hash:"groups",titleKey:"tourGroupsTitle",bodyKey:"tourGroupsBody"},{id:"stickers-tabs",target:"stickers-tabs",screen:"stickers",hash:"stickers",titleKey:"tourStickersTitle",bodyKey:"tourStickersBody"},{id:"schedules-list",target:"schedules-list",screen:"schedules",hash:"schedules",titleKey:"tourSchedulesTitle",bodyKey:"tourSchedulesBody"},{id:"logs-stream",target:"logs-stream",screen:"logs",hash:"logs",titleKey:"tourLogsTitle",bodyKey:"tourLogsBody"},{id:"settings-general",target:"settings-general",screen:"settings",hash:"settings",titleKey:"tourSettingsTitle",bodyKey:"tourSettingsBody"},{id:"settings-password",target:"settings-password",screen:"settings",hash:"settings/security",inMainTour:!1,titleKey:"tourSettingsPasswordTitle",bodyKey:"tourSettingsPasswordBody"},{id:"settings-feedback",target:"settings-feedback",screen:"settings",hash:"settings/feedback",inMainTour:!1,titleKey:"tourSettingsFeedbackTitle",bodyKey:"tourSettingsFeedbackBody"},{id:"settings-diagnostics",target:"settings-diagnostics",screen:"settings",hash:"settings/diagnostics",inMainTour:!1,titleKey:"tourSettingsDiagnosticsTitle",bodyKey:"tourSettingsDiagnosticsBody"}],E1="levix_tour_v1_done",MN=768,RN=()=>{try{return window.localStorage.getItem(E1)==="1"}catch{return!1}},zN=()=>{try{window.localStorage.setItem(E1,"1")}catch{}},A1=y.createContext(null),T1=()=>y.useContext(A1),If=()=>!!document.querySelector('[role="dialog"]'),Vf=()=>window.innerWidth>=MN,LN=({children:n})=>{const{t:i}=Ue(),[r,o]=y.useState(null),[d,f]=y.useState(0),m=y.useRef(r);m.current=r;const p=y.useRef(d);p.current=d;const h=y.useCallback(_=>{o(_),f(0)},[]),b=y.useCallback(()=>{If()||m.current||h(Gf.filter(_=>_.inMainTour!==!1&&(!_.desktopOnly||Vf())))},[h]),x=y.useCallback(_=>{if(If()||m.current)return;const G=Gf.filter(R=>R.screen===_&&(!R.desktopOnly||Vf()));G.length!==0&&h(G)},[h]),v=y.useCallback(_=>Gf.some(G=>G.screen===_&&(!G.desktopOnly||Vf())),[]),S=y.useCallback(()=>{zN(),o(null),f(0)},[]),A=y.useCallback(()=>{const _=m.current;if(!_)return;const G=p.current+1;G>=_.length?S():f(G)},[S]),k=y.useCallback(()=>{p.current>0&&f(p.current-1)},[]);y.useEffect(()=>{if(!r)return;const _=r[d];_!=null&&_.hash&&window.location.hash!==`#${_.hash}`&&(window.location.hash=_.hash)},[r,d]),y.useEffect(()=>{let _=0,G;const R=()=>{if(_+=1,!m.current&&!RN()){if(If()){_<5&&(G=window.setTimeout(R,600));return}b()}};return G=window.setTimeout(R,1200),()=>window.clearTimeout(G)},[b]);const N=y.useMemo(()=>(r??[]).map(_=>({target:_.target,title:i(_.titleKey),body:i(_.bodyKey)})),[r,i]),j=y.useMemo(()=>({back:i("tourBack"),next:i("tourNext"),done:i("tourDone"),skip:i("tourSkip"),stepOf:r?Bt(i("tourStepOf"),{n:d+1,total:r.length}):""}),[i,r,d]),L=y.useMemo(()=>({startMainTour:b,startScreenTour:x,hasScreenSteps:v}),[b,x,v]);return s.jsxs(A1.Provider,{value:L,children:[n,s.jsx(NN,{open:!!r,steps:N,index:d,onAdvance:A,onBack:k,onClose:S,labels:j})]})},ON=({onToggleMobileMenu:n,title:i,view:r,status:o})=>{const{language:d,setLanguage:f,theme:m,setTheme:p,t:h}=Ue(),b=T1(),x=()=>{p(m==="dark"?"light":"dark")};return s.jsxs("header",{className:"sticky top-0 z-30 flex h-16 items-center justify-between border-b border-line bg-panel/85 px-4 backdrop-blur-md md:px-6",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s.jsx(Oe,{id:"mobile-menu-btn",className:"md:hidden",label:h("openNavigation"),icon:s.jsx(Xk,{size:20}),onClick:n}),s.jsx("h1",{className:"truncate text-lg font-bold tracking-tight text-text-main md:text-xl",title:i,children:i})]}),s.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[(b==null?void 0:b.hasScreenSteps(r))&&s.jsx(Oe,{id:"btn-header-guide",label:h("tourScreenHelp"),icon:s.jsx(zk,{size:18,className:"text-brand-cyan"}),onClick:()=>b.startScreenTour(r)}),s.jsxs(ch,{label:h("chooseLanguage"),trigger:s.jsx(Oe,{id:"btn-header-lang",label:h("chooseLanguage"),icon:s.jsx(Bc,{size:18,className:"text-brand-cyan"})}),children:[s.jsx(pN,{children:h("chooseLanguage")}),s.jsx(lt,{checked:d==="ar",onSelect:()=>f("ar"),children:"العربية"}),s.jsx(lt,{checked:d==="en",onSelect:()=>f("en"),children:"English"})]}),s.jsx(Oe,{id:"btn-header-theme",label:h(m==="dark"?"lightMode":"darkMode"),icon:m==="dark"?s.jsx(sj,{size:18,className:"text-brand-cyan"}):s.jsx(Jk,{size:18,className:"text-brand-cyan"}),onClick:x})]})]})},BN=({currentView:n,onSelectView:i,isOpenMobile:r,onCloseMobile:o})=>{var h;const{t:d}=Ue(),f=typeof((h=window.LevixHost)==null?void 0:h.closePanel)=="function",m=window.__BRAND__||{name:"Levix",tagline:"Private control room",version:"",developer:"Abdelrhman Diab",studio:"Leviro",developerSite:"https://github.com/Abdodiab2005",studioSite:"https://leviro.net"},p=[{id:"overview",label:d("overview"),icon:Vk},{id:"connection",label:d("connection"),icon:Or},{labelCategory:d("control")},{id:"commands",label:d("commands"),icon:fl},{id:"ai",label:d("ai"),icon:Wm},{id:"groups",label:d("groups"),icon:rl},{id:"autodelete",label:d("autoDelete"),icon:jc},{id:"schedules",label:d("schedules"),icon:Mm},{id:"stickers",label:d("stickers"),icon:nh},{labelCategory:d("settings")},{id:"settings",label:d("settings"),icon:aj},{id:"logs",label:d("logs"),icon:Ur}];return s.jsxs(s.Fragment,{children:[r&&s.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default border-0 bg-black/60 p-0 backdrop-blur-sm md:hidden",onClick:o,"aria-label":d("closeNavigation")}),s.jsxs("aside",{className:Pe("fixed start-0 top-0 bottom-0 z-50 flex w-72 flex-col border-e border-line bg-panel transition-transform duration-200 ease-out md:static md:z-auto md:w-64",r?"translate-x-0":"max-md:-translate-x-full rtl:max-md:translate-x-full"),"aria-label":"Main Navigation",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-line p-4",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl border border-line bg-panel-raised shadow-md",children:s.jsx("img",{src:"/brand/mark.svg",alt:m.name,className:"size-6"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate text-base font-extrabold leading-tight tracking-tight text-text-main",children:m.name}),s.jsx("div",{className:"mt-0.5 truncate text-xs leading-none text-muted",children:m.tagline})]})]}),s.jsx(Oe,{className:"md:hidden",label:d("closeNavigation"),icon:s.jsx(Rn,{size:18}),onClick:o})]}),s.jsx("nav",{className:"flex-1 space-y-1 overflow-y-auto p-3","data-tour":"sidebar-nav",children:p.map(b=>{if(b.labelCategory)return s.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] font-bold uppercase tracking-wider text-faint",children:b.labelCategory},`cat-${b.labelCategory}`);if(!b.icon||!b.id)return null;const x=b.icon,v=n===b.id;return s.jsx(de,{variant:v?"primary":"ghost",className:"w-full justify-start",icon:s.jsx(x,{size:20}),onClick:()=>{i(b.id),o()},children:s.jsx("span",{className:"truncate",children:b.label})},b.id)})}),s.jsxs("div",{className:"flex flex-col gap-1 border-t border-line p-3",children:[f&&s.jsx(de,{variant:"ghost",className:"w-full justify-start",icon:s.jsx(Ek,{size:20,className:"rtl:-scale-x-100"}),onClick:()=>window.LevixHost.closePanel(),children:s.jsx("span",{className:"truncate",children:d("backToApp")})}),s.jsx("form",{action:"/logout",method:"POST",className:"m-0",children:s.jsx(de,{type:"submit",variant:"ghost",className:"w-full justify-start text-danger hover:bg-danger/10 hover:text-danger",icon:s.jsx(Yk,{size:20,className:"rtl:-scale-x-100"}),children:s.jsx("span",{className:"truncate",children:d("logout")})})})]}),s.jsxs("div",{className:"flex flex-col gap-2.5 border-t border-line p-4 text-xs text-faint",children:[s.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted",children:[s.jsx("span",{className:"font-mono",children:m.version?`v${m.version}`:""}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(th,{size:14,className:"text-brand-cyan"})," Local-first"]})]}),s.jsxs("div",{className:"truncate text-[11px] text-muted",children:["© ",m.copyrightYear||2026," ",s.jsx("a",{href:m.developerSite||"#",target:"_blank",rel:"noopener noreferrer",className:"text-brand-cyan hover:underline",children:m.developer})," ","(",s.jsx("a",{href:m.studioSite||"#",target:"_blank",rel:"noopener noreferrer",className:"text-brand-cyan hover:underline",children:m.studio}),")"]})]})]})]})},Sa=Object.create(null);Sa.open="0";Sa.close="1";Sa.ping="2";Sa.pong="3";Sa.message="4";Sa.upgrade="5";Sa.noop="6";const Ec=Object.create(null);Object.keys(Sa).forEach(n=>{Ec[Sa[n]]=n});const qm={type:"error",data:"parser error"},_1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",D1=typeof ArrayBuffer=="function",M1=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,uh=({type:n,data:i},r,o)=>_1&&i instanceof Blob?r?o(i):hb(i,o):D1&&(i instanceof ArrayBuffer||M1(i))?r?o(i):hb(new Blob([i]),o):o(Sa[n]+(i||"")),hb=(n,i)=>{const r=new FileReader;return r.onload=function(){const o=r.result.split(",")[1];i("b"+(o||""))},r.readAsDataURL(n)};function pb(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let Kf;function UN(n,i){if(_1&&n.data instanceof Blob)return n.data.arrayBuffer().then(pb).then(i);if(D1&&(n.data instanceof ArrayBuffer||M1(n.data)))return i(pb(n.data));uh(n,!1,r=>{Kf||(Kf=new TextEncoder),i(Kf.encode(r))})}const gb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ar=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<gb.length;n++)Ar[gb.charCodeAt(n)]=n;const HN=n=>{let i=n.length*.75,r=n.length,o,d=0,f,m,p,h;n[n.length-1]==="="&&(i--,n[n.length-2]==="="&&i--);const b=new ArrayBuffer(i),x=new Uint8Array(b);for(o=0;o<r;o+=4)f=Ar[n.charCodeAt(o)],m=Ar[n.charCodeAt(o+1)],p=Ar[n.charCodeAt(o+2)],h=Ar[n.charCodeAt(o+3)],x[d++]=f<<2|m>>4,x[d++]=(m&15)<<4|p>>2,x[d++]=(p&3)<<6|h&63;return b},PN=typeof ArrayBuffer=="function",dh=(n,i)=>{if(typeof n!="string")return{type:"message",data:R1(n,i)};const r=n.charAt(0);return r==="b"?{type:"message",data:qN(n.substring(1),i)}:Ec[r]?n.length>1?{type:Ec[r],data:n.substring(1)}:{type:Ec[r]}:qm},qN=(n,i)=>{if(PN){const r=HN(n);return R1(r,i)}else return{base64:!0,data:n}},R1=(n,i)=>{switch(i){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},z1="",FN=(n,i)=>{const r=n.length,o=new Array(r);let d=0;n.forEach((f,m)=>{uh(f,!1,p=>{o[m]=p,++d===r&&i(o.join(z1))})})},GN=(n,i)=>{const r=n.split(z1),o=[];for(let d=0;d<r.length;d++){const f=dh(r[d],i);if(o.push(f),f.type==="error")break}return o};function IN(){return new TransformStream({transform(n,i){UN(n,r=>{const o=r.length;let d;if(o<126)d=new Uint8Array(1),new DataView(d.buffer).setUint8(0,o);else if(o<65536){d=new Uint8Array(3);const f=new DataView(d.buffer);f.setUint8(0,126),f.setUint16(1,o)}else{d=new Uint8Array(9);const f=new DataView(d.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(o))}n.data&&typeof n.data!="string"&&(d[0]|=128),i.enqueue(d),i.enqueue(r)})}})}let Yf;function bc(n){return n.reduce((i,r)=>i+r.length,0)}function vc(n,i){if(n[0].length===i)return n.shift();const r=new Uint8Array(i);let o=0;for(let d=0;d<i;d++)r[d]=n[0][o++],o===n[0].length&&(n.shift(),o=0);return n.length&&o<n[0].length&&(n[0]=n[0].slice(o)),r}function VN(n,i){Yf||(Yf=new TextDecoder);const r=[];let o=0,d=-1,f=!1;return new TransformStream({transform(m,p){for(r.push(m);;){if(o===0){if(bc(r)<1)break;const h=vc(r,1);f=(h[0]&128)===128,d=h[0]&127,d<126?o=3:d===126?o=1:o=2}else if(o===1){if(bc(r)<2)break;const h=vc(r,2);d=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),o=3}else if(o===2){if(bc(r)<8)break;const h=vc(r,8),b=new DataView(h.buffer,h.byteOffset,h.length),x=b.getUint32(0);if(x>Math.pow(2,21)-1){p.enqueue(qm);break}d=x*Math.pow(2,32)+b.getUint32(4),o=3}else{if(bc(r)<d)break;const h=vc(r,d);p.enqueue(dh(f?h:Yf.decode(h),i)),o=0}if(d===0||d>n){p.enqueue(qm);break}}}})}const L1=4;function Ot(n){if(n)return KN(n)}function KN(n){for(var i in Ot.prototype)n[i]=Ot.prototype[i];return n}Ot.prototype.on=Ot.prototype.addEventListener=function(n,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(i),this};Ot.prototype.once=function(n,i){function r(){this.off(n,r),i.apply(this,arguments)}return r.fn=i,this.on(n,r),this};Ot.prototype.off=Ot.prototype.removeListener=Ot.prototype.removeAllListeners=Ot.prototype.removeEventListener=function(n,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+n];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var o,d=0;d<r.length;d++)if(o=r[d],o===i||o.fn===i){r.splice(d,1);break}return r.length===0&&delete this._callbacks["$"+n],this};Ot.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),r=this._callbacks["$"+n],o=1;o<arguments.length;o++)i[o-1]=arguments[o];if(r){r=r.slice(0);for(var o=0,d=r.length;o<d;++o)r[o].apply(this,i)}return this};Ot.prototype.emitReserved=Ot.prototype.emit;Ot.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};Ot.prototype.hasListeners=function(n){return!!this.listeners(n).length};const Jc=typeof Promise=="function"&&typeof Promise.resolve=="function"?i=>Promise.resolve().then(i):(i,r)=>r(i,0),Gn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),YN="arraybuffer";function O1(n,...i){return i.reduce((r,o)=>(n.hasOwnProperty(o)&&(r[o]=n[o]),r),{})}const QN=Gn.setTimeout,XN=Gn.clearTimeout;function Wc(n,i){i.useNativeTimers?(n.setTimeoutFn=QN.bind(Gn),n.clearTimeoutFn=XN.bind(Gn)):(n.setTimeoutFn=Gn.setTimeout.bind(Gn),n.clearTimeoutFn=Gn.clearTimeout.bind(Gn))}const ZN=1.33;function $N(n){return typeof n=="string"?JN(n):Math.ceil((n.byteLength||n.size)*ZN)}function JN(n){let i=0,r=0;for(let o=0,d=n.length;o<d;o++)i=n.charCodeAt(o),i<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(o++,r+=4);return r}function B1(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function WN(n){let i="";for(let r in n)n.hasOwnProperty(r)&&(i.length&&(i+="&"),i+=encodeURIComponent(r)+"="+encodeURIComponent(n[r]));return i}function eC(n){let i={},r=n.split("&");for(let o=0,d=r.length;o<d;o++){let f=r[o].split("=");i[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return i}class tC extends Error{constructor(i,r,o){super(i),this.description=r,this.context=o,this.type="TransportError"}}class fh extends Ot{constructor(i){super(),this.writable=!1,Wc(this,i),this.opts=i,this.query=i.query,this.socket=i.socket,this.supportsBinary=!i.forceBase64}onError(i,r,o){return super.emitReserved("error",new tC(i,r,o)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(i){this.readyState==="open"&&this.write(i)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(i){const r=dh(i,this.socket.binaryType);this.onPacket(r)}onPacket(i){super.emitReserved("packet",i)}onClose(i){this.readyState="closed",super.emitReserved("close",i)}pause(i){}createUri(i,r={}){return i+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const i=this.opts.hostname;return i.indexOf(":")===-1?i:"["+i+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(i){const r=WN(i);return r.length?"?"+r:""}}class nC extends fh{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(i){this.readyState="pausing";const r=()=>{this.readyState="paused",i()};if(this._polling||!this.writable){let o=0;this._polling&&(o++,this.once("pollComplete",function(){--o||r()})),this.writable||(o++,this.once("drain",function(){--o||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(i){const r=o=>{if(this.readyState==="opening"&&o.type==="open"&&this.onOpen(),o.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(o)};GN(i,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const i=()=>{this.write([{type:"close"}])};this.readyState==="open"?i():this.once("open",i)}write(i){this.writable=!1,FN(i,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const i=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=B1()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(i,r)}}let U1=!1;try{U1=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const aC=U1;function sC(){}class lC extends nC{constructor(i){if(super(i),typeof location<"u"){const r=location.protocol==="https:";let o=location.port;o||(o=r?"443":"80"),this.xd=typeof location<"u"&&i.hostname!==location.hostname||o!==i.port}}doWrite(i,r){const o=this.request({method:"POST",data:i});o.on("success",r),o.on("error",(d,f)=>{this.onError("xhr post error",d,f)})}doPoll(){const i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(r,o)=>{this.onError("xhr poll error",r,o)}),this.pollXhr=i}}class wa extends Ot{constructor(i,r,o){super(),this.createRequest=i,Wc(this,o),this._opts=o,this._method=o.method||"GET",this._uri=r,this._data=o.data!==void 0?o.data:null,this._create()}_create(){var i;const r=O1(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const o=this._xhr=this.createRequest(r);try{o.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(let d in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(d)&&o.setRequestHeader(d,this._opts.extraHeaders[d])}}catch{}if(this._method==="POST")try{o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(o),"withCredentials"in o&&(o.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(o.timeout=this._opts.requestTimeout),o.onreadystatechange=()=>{var d;o.readyState===3&&((d=this._opts.cookieJar)===null||d===void 0||d.parseCookies(o.getResponseHeader("set-cookie"))),o.readyState===4&&(o.status===200||o.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof o.status=="number"?o.status:0)},0))},o.send(this._data)}catch(d){this.setTimeoutFn(()=>{this._onError(d)},0);return}typeof document<"u"&&(this._index=wa.requestsCount++,wa.requests[this._index]=this)}_onError(i){this.emitReserved("error",i,this._xhr),this._cleanup(!0)}_cleanup(i){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=sC,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete wa.requests[this._index],this._xhr=null}}_onLoad(){const i=this._xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}wa.requestsCount=0;wa.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",xb);else if(typeof addEventListener=="function"){const n="onpagehide"in Gn?"pagehide":"unload";addEventListener(n,xb,!1)}}function xb(){for(let n in wa.requests)wa.requests.hasOwnProperty(n)&&wa.requests[n].abort()}const iC=(function(){const n=H1({xdomain:!1});return n&&n.responseType!==null})();class rC extends lC{constructor(i){super(i);const r=i&&i.forceBase64;this.supportsBinary=iC&&!r}request(i={}){return Object.assign(i,{xd:this.xd},this.opts),new wa(H1,this.uri(),i)}}function H1(n){const i=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||aC))return new XMLHttpRequest}catch{}if(!i)try{return new Gn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const P1=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class oC extends fh{get name(){return"websocket"}doOpen(){const i=this.uri(),r=this.opts.protocols,o=P1?{}:O1(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(o.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(i,r,o)}catch(d){return this.emitReserved("error",d)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=i=>this.onClose({description:"websocket connection closed",context:i}),this.ws.onmessage=i=>this.onData(i.data),this.ws.onerror=i=>this.onError("websocket error",i)}write(i){this.writable=!1;for(let r=0;r<i.length;r++){const o=i[r],d=r===i.length-1;uh(o,this.supportsBinary,f=>{try{this.doWrite(o,f)}catch{}d&&Jc(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const i=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=B1()),this.supportsBinary||(r.b64=1),this.createUri(i,r)}}const Qf=Gn.WebSocket||Gn.MozWebSocket;class cC extends oC{createSocket(i,r,o){return P1?new Qf(i,r,o):r?new Qf(i,r):new Qf(i)}doWrite(i,r){this.ws.send(r)}}class uC extends fh{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(i){return this.emitReserved("error",i)}this._transport.closed.then(()=>{this.onClose()}).catch(i=>{this.onError("webtransport error",i)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(i=>{const r=VN(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=i.readable.pipeThrough(r).getReader(),d=IN();d.readable.pipeTo(i.writable),this._writer=d.writable.getWriter();const f=()=>{o.read().then(({done:p,value:h})=>{p||(this.onPacket(h),f())}).catch(p=>{})};f();const m={type:"open"};this.query.sid&&(m.data=`{"sid":"${this.query.sid}"}`),this._writer.write(m).then(()=>this.onOpen())})})}write(i){this.writable=!1;for(let r=0;r<i.length;r++){const o=i[r],d=r===i.length-1;this._writer.write(o).then(()=>{d&&Jc(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this._transport)===null||i===void 0||i.close()}}const dC={websocket:cC,webtransport:uC,polling:rC},fC=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,mC=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Fm(n){if(n.length>8e3)throw"URI too long";const i=n,r=n.indexOf("["),o=n.indexOf("]");r!=-1&&o!=-1&&(n=n.substring(0,r)+n.substring(r,o).replace(/:/g,";")+n.substring(o,n.length));let d=fC.exec(n||""),f={},m=14;for(;m--;)f[mC[m]]=d[m]||"";return r!=-1&&o!=-1&&(f.source=i,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=hC(f,f.path),f.queryKey=pC(f,f.query),f}function hC(n,i){const r=/\/{2,9}/g,o=i.replace(r,"/").split("/");return(i.slice(0,1)=="/"||i.length===0)&&o.splice(0,1),i.slice(-1)=="/"&&o.splice(o.length-1,1),o}function pC(n,i){const r={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,d,f){d&&(r[d]=f)}),r}const Gm=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ac=[];Gm&&addEventListener("offline",()=>{Ac.forEach(n=>n())},!1);class As extends Ot{constructor(i,r){if(super(),this.binaryType=YN,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(r=i,i=null),i){const o=Fm(i);r.hostname=o.host,r.secure=o.protocol==="https"||o.protocol==="wss",r.port=o.port,o.query&&(r.query=o.query)}else r.host&&(r.hostname=Fm(r.host).host);Wc(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(o=>{const d=o.prototype.name;this.transports.push(d),this._transportsByName[d]=o}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=eC(this.opts.query)),Gm&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Ac.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){const r=Object.assign({},this.opts.query);r.EIO=L1,r.transport=i,this.id&&(r.sid=this.id);const o=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](o)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const i=this.opts.rememberUpgrade&&As.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(i);r.open(),this.setTransport(r)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",As.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=i.data,this._onError(r);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this._pingInterval=i.pingInterval,this._pingTimeout=i.pingTimeout,this._maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const i=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+i,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},i),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const i=this._getWritablePackets();this.transport.send(i),this._prevBufferLen=i.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let o=0;o<this.writeBuffer.length;o++){const d=this.writeBuffer[o].data;if(d&&(r+=$N(d)),o>0&&r>this._maxPayload)return this.writeBuffer.slice(0,o);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,Jc(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,r,o){return this._sendPacket("message",i,r,o),this}send(i,r,o){return this._sendPacket("message",i,r,o),this}_sendPacket(i,r,o,d){if(typeof r=="function"&&(d=r,r=void 0),typeof o=="function"&&(d=o,o=null),this.readyState==="closing"||this.readyState==="closed")return;o=o||{},o.compress=o.compress!==!1;const f={type:i,data:r,options:o};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),d&&this.once("flush",d),this.flush()}close(){const i=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),i()},o=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?o():i()}):this.upgrading?o():i()),this}_onError(i){if(As.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",i),this._onClose("transport error",i)}_onClose(i,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Gm&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const o=Ac.indexOf(this._offlineEventListener);o!==-1&&Ac.splice(o,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,r),this.writeBuffer=[],this._prevBufferLen=0}}}As.protocol=L1;class gC extends As{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let i=0;i<this._upgrades.length;i++)this._probe(this._upgrades[i])}_probe(i){let r=this.createTransport(i),o=!1;As.priorWebsocketSuccess=!1;const d=()=>{o||(r.send([{type:"ping",data:"probe"}]),r.once("packet",v=>{if(!o)if(v.type==="pong"&&v.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;As.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(x(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const S=new Error("probe error");S.transport=r.name,this.emitReserved("upgradeError",S)}}))};function f(){o||(o=!0,x(),r.close(),r=null)}const m=v=>{const S=new Error("probe error: "+v);S.transport=r.name,f(),this.emitReserved("upgradeError",S)};function p(){m("transport closed")}function h(){m("socket closed")}function b(v){r&&v.name!==r.name&&f()}const x=()=>{r.removeListener("open",d),r.removeListener("error",m),r.removeListener("close",p),this.off("close",h),this.off("upgrading",b)};r.once("open",d),r.once("error",m),r.once("close",p),this.once("close",h),this.once("upgrading",b),this._upgrades.indexOf("webtransport")!==-1&&i!=="webtransport"?this.setTimeoutFn(()=>{o||r.open()},200):r.open()}onHandshake(i){this._upgrades=this._filterUpgrades(i.upgrades),super.onHandshake(i)}_filterUpgrades(i){const r=[];for(let o=0;o<i.length;o++)~this.transports.indexOf(i[o])&&r.push(i[o]);return r}}let xC=class extends gC{constructor(i,r={}){const o=typeof i=="object",d=o?{...i}:{...r};(!d.transports||d.transports&&typeof d.transports[0]=="string")&&(d.transports=(d.transports||["polling","websocket","webtransport"]).map(f=>dC[f]).filter(f=>!!f)),super(o?d:i,d)}};function yC(n,i="",r){let o=n;r=r||typeof location<"u"&&location,n==null&&(n=r.protocol+"//"+r.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=r.protocol+n:n=r.host+n),/^(https?|wss?):\/\//.test(n)||(typeof r<"u"?n=r.protocol+"//"+n:n="https://"+n),o=Fm(n)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const f=o.host.indexOf(":")!==-1?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+f+":"+o.port+i,o.href=o.protocol+"://"+f+(r&&r.port===o.port?"":":"+o.port),o}const bC=typeof ArrayBuffer=="function",vC=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,q1=Object.prototype.toString,wC=typeof Blob=="function"||typeof Blob<"u"&&q1.call(Blob)==="[object BlobConstructor]",SC=typeof File=="function"||typeof File<"u"&&q1.call(File)==="[object FileConstructor]";function mh(n){return bC&&(n instanceof ArrayBuffer||vC(n))||wC&&n instanceof Blob||SC&&n instanceof File}function Tc(n,i){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let r=0,o=n.length;r<o;r++)if(Tc(n[r]))return!0;return!1}if(mh(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return Tc(n.toJSON(),!0);for(const r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&Tc(n[r]))return!0;return!1}function kC(n){const i=[],r=n.data,o=n;return o.data=_c(r,i),o.attachments=i.length,{packet:o,buffers:i}}function _c(n,i,r){if(!n)return n;if(mh(n)){const o={_placeholder:!0,num:i.length};return i.push(n),o}else if(Array.isArray(n)){const o=new Array(n.length);for(let d=0;d<n.length;d++)o[d]=_c(n[d],i);return o}else if(typeof n=="object"&&!(n instanceof Date)){if(n.toJSON&&typeof n.toJSON=="function"&&!r)return _c(n.toJSON(),i,!0);const o={};for(const d in n)Object.prototype.hasOwnProperty.call(n,d)&&(o[d]=_c(n[d],i));return o}return n}function jC(n,i){return n.data=Im(n.data,i),delete n.attachments,n}function Im(n,i){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<i.length)return i[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let r=0;r<n.length;r++)n[r]=Im(n[r],i);else if(typeof n=="object")for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=Im(n[r],i));return n}const NC=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var st;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(st||(st={}));class CC{constructor(i){this.replacer=i}encode(i){return(i.type===st.EVENT||i.type===st.ACK)&&Tc(i)?this.encodeAsBinary({type:i.type===st.EVENT?st.BINARY_EVENT:st.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let r=""+i.type;return(i.type===st.BINARY_EVENT||i.type===st.BINARY_ACK)&&(r+=i.attachments+"-"),i.nsp&&i.nsp!=="/"&&(r+=i.nsp+","),i.id!=null&&(r+=i.id),i.data!=null&&(r+=JSON.stringify(i.data,this.replacer)),r}encodeAsBinary(i){const r=kC(i),o=this.encodeAsString(r.packet),d=r.buffers;return d.unshift(o),d}}class hh extends Ot{constructor(i){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof i=="function"?{reviver:i}:i)}add(i){let r;if(typeof i=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(i);const o=r.type===st.BINARY_EVENT;o||r.type===st.BINARY_ACK?(r.type=o?st.EVENT:st.ACK,this.reconstructor=new EC(r)):super.emitReserved("decoded",r)}else if(mh(i)||i.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(i),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+i)}decodeString(i){let r=0;const o={type:Number(i.charAt(0))};if(st[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===st.BINARY_EVENT||o.type===st.BINARY_ACK){const f=r+1;for(;i.charAt(++r)!=="-"&&r!=i.length;);const m=i.substring(f,r);if(m!=Number(m)||i.charAt(r)!=="-")throw new Error("Illegal attachments");const p=Number(m);if(!AC(p)||p<1)throw new Error("Illegal attachments");if(p>this.opts.maxAttachments)throw new Error("too many attachments");o.attachments=p}if(i.charAt(r+1)==="/"){const f=r+1;for(;++r&&!(i.charAt(r)===","||r===i.length););o.nsp=i.substring(f,r)}else o.nsp="/";const d=i.charAt(r+1);if(d!==""&&Number(d)==d){const f=r+1;for(;++r;){const m=i.charAt(r);if(m==null||Number(m)!=m){--r;break}if(r===i.length)break}o.id=Number(i.substring(f,r+1))}if(i.charAt(++r)){const f=this.tryParse(i.substr(r));if(hh.isPayloadValid(o.type,f))o.data=f;else throw new Error("invalid payload")}return o}tryParse(i){try{return JSON.parse(i,this.opts.reviver)}catch{return!1}}static isPayloadValid(i,r){switch(i){case st.CONNECT:return yb(r);case st.DISCONNECT:return r===void 0;case st.CONNECT_ERROR:return typeof r=="string"||yb(r);case st.EVENT:case st.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&NC.indexOf(r[0])===-1);case st.ACK:case st.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class EC{constructor(i){this.packet=i,this.buffers=[],this.reconPack=i}takeBinaryData(i){if(this.buffers.push(i),this.buffers.length===this.reconPack.attachments){const r=jC(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const AC=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n};function yb(n){return Object.prototype.toString.call(n)==="[object Object]"}const TC=Object.freeze(Object.defineProperty({__proto__:null,Decoder:hh,Encoder:CC,get PacketType(){return st}},Symbol.toStringTag,{value:"Module"}));function na(n,i,r){return n.on(i,r),function(){n.off(i,r)}}const _C=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class F1 extends Ot{constructor(i,r,o){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=i,this.nsp=r,o&&o.auth&&(this.auth=o.auth),this._opts=Object.assign({},o),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const i=this.io;this.subs=[na(i,"open",this.onopen.bind(this)),na(i,"packet",this.onpacket.bind(this)),na(i,"error",this.onerror.bind(this)),na(i,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...i){return i.unshift("message"),this.emit.apply(this,i),this}emit(i,...r){var o,d,f;if(_C.hasOwnProperty(i))throw new Error('"'+i.toString()+'" is a reserved event name');if(r.unshift(i),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const m={type:st.EVENT,data:r};if(m.options={},m.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const x=this.ids++,v=r.pop();this._registerAckCallback(x,v),m.id=x}const p=(d=(o=this.io.engine)===null||o===void 0?void 0:o.transport)===null||d===void 0?void 0:d.writable,h=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!p||(h?(this.notifyOutgoingListeners(m),this.packet(m)):this.sendBuffer.push(m)),this.flags={},this}_registerAckCallback(i,r){var o;const d=(o=this.flags.timeout)!==null&&o!==void 0?o:this._opts.ackTimeout;if(d===void 0){this.acks[i]=r;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[i];for(let p=0;p<this.sendBuffer.length;p++)this.sendBuffer[p].id===i&&this.sendBuffer.splice(p,1);r.call(this,new Error("operation has timed out"))},d),m=(...p)=>{this.io.clearTimeoutFn(f),r.apply(this,p)};m.withError=!0,this.acks[i]=m}emitWithAck(i,...r){return new Promise((o,d)=>{const f=(m,p)=>m?d(m):o(p);f.withError=!0,r.push(f),this.emit(i,...r)})}_addToQueue(i){let r;typeof i[i.length-1]=="function"&&(r=i.pop());const o={id:this._queueSeq++,tryCount:0,pending:!1,args:i,flags:Object.assign({fromQueue:!0},this.flags)};i.push((d,...f)=>(this._queue[0],d!==null?o.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(d)):(this._queue.shift(),r&&r(null,...f)),o.pending=!1,this._drainQueue())),this._queue.push(o),this._drainQueue()}_drainQueue(i=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!i||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(i){i.nsp=this.nsp,this.io._packet(i)}onopen(){typeof this.auth=="function"?this.auth(i=>{this._sendConnectPacket(i)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(i){this.packet({type:st.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},i):i})}onerror(i){this.connected||this.emitReserved("connect_error",i)}onclose(i,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",i,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(i=>{if(!this.sendBuffer.some(o=>String(o.id)===i)){const o=this.acks[i];delete this.acks[i],o.withError&&o.call(this,new Error("socket has been disconnected"))}})}onpacket(i){if(i.nsp===this.nsp)switch(i.type){case st.CONNECT:i.data&&i.data.sid?this.onconnect(i.data.sid,i.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case st.EVENT:case st.BINARY_EVENT:this.onevent(i);break;case st.ACK:case st.BINARY_ACK:this.onack(i);break;case st.DISCONNECT:this.ondisconnect();break;case st.CONNECT_ERROR:this.destroy();const o=new Error(i.data.message);o.data=i.data.data,this.emitReserved("connect_error",o);break}}onevent(i){const r=i.data||[];i.id!=null&&r.push(this.ack(i.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(i){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const o of r)o.apply(this,i)}super.emit.apply(this,i),this._pid&&i.length&&typeof i[i.length-1]=="string"&&(this._lastOffset=i[i.length-1])}ack(i){const r=this;let o=!1;return function(...d){o||(o=!0,r.packet({type:st.ACK,id:i,data:d}))}}onack(i){const r=this.acks[i.id];typeof r=="function"&&(delete this.acks[i.id],r.withError&&i.data.unshift(null),r.apply(this,i.data))}onconnect(i,r){this.id=i,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(i=>this.emitEvent(i)),this.receiveBuffer=[],this.sendBuffer.forEach(i=>{this.notifyOutgoingListeners(i),this.packet(i)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(i=>i()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:st.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(i){return this.flags.compress=i,this}get volatile(){return this.flags.volatile=!0,this}timeout(i){return this.flags.timeout=i,this}onAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(i),this}prependAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(i),this}offAny(i){if(!this._anyListeners)return this;if(i){const r=this._anyListeners;for(let o=0;o<r.length;o++)if(i===r[o])return r.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(i),this}prependAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(i),this}offAnyOutgoing(i){if(!this._anyOutgoingListeners)return this;if(i){const r=this._anyOutgoingListeners;for(let o=0;o<r.length;o++)if(i===r[o])return r.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(i){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const o of r)o.apply(this,i.data)}}}function ji(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}ji.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),r=Math.floor(i*this.jitter*n);n=(Math.floor(i*10)&1)==0?n-r:n+r}return Math.min(n,this.max)|0};ji.prototype.reset=function(){this.attempts=0};ji.prototype.setMin=function(n){this.ms=n};ji.prototype.setMax=function(n){this.max=n};ji.prototype.setJitter=function(n){this.jitter=n};class Vm extends Ot{constructor(i,r){var o;super(),this.nsps={},this.subs=[],i&&typeof i=="object"&&(r=i,i=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,Wc(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((o=r.randomizationFactor)!==null&&o!==void 0?o:.5),this.backoff=new ji({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=i;const d=r.parser||TC;this.encoder=new d.Encoder,this.decoder=new d.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(i){return arguments.length?(this._reconnection=!!i,i||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(i){return i===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=i,this)}reconnectionDelay(i){var r;return i===void 0?this._reconnectionDelay:(this._reconnectionDelay=i,(r=this.backoff)===null||r===void 0||r.setMin(i),this)}randomizationFactor(i){var r;return i===void 0?this._randomizationFactor:(this._randomizationFactor=i,(r=this.backoff)===null||r===void 0||r.setJitter(i),this)}reconnectionDelayMax(i){var r;return i===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=i,(r=this.backoff)===null||r===void 0||r.setMax(i),this)}timeout(i){return arguments.length?(this._timeout=i,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(i){if(~this._readyState.indexOf("open"))return this;this.engine=new xC(this.uri,this.opts);const r=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const d=na(r,"open",function(){o.onopen(),i&&i()}),f=p=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",p),i?i(p):this.maybeReconnectOnOpen()},m=na(r,"error",f);if(this._timeout!==!1){const p=this._timeout,h=this.setTimeoutFn(()=>{d(),f(new Error("timeout")),r.close()},p);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(d),this.subs.push(m),this}connect(i){return this.open(i)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const i=this.engine;this.subs.push(na(i,"ping",this.onping.bind(this)),na(i,"data",this.ondata.bind(this)),na(i,"error",this.onerror.bind(this)),na(i,"close",this.onclose.bind(this)),na(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(i){try{this.decoder.add(i)}catch(r){this.onclose("parse error",r)}}ondecoded(i){Jc(()=>{this.emitReserved("packet",i)},this.setTimeoutFn)}onerror(i){this.emitReserved("error",i)}socket(i,r){let o=this.nsps[i];return o?this._autoConnect&&!o.active&&o.connect():(o=new F1(this,i,r),this.nsps[i]=o),o}_destroy(i){const r=Object.keys(this.nsps);for(const o of r)if(this.nsps[o].active)return;this._close()}_packet(i){const r=this.encoder.encode(i);for(let o=0;o<r.length;o++)this.engine.write(r[o],i.options)}cleanup(){this.subs.forEach(i=>i()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(i,r){var o;this.cleanup(),(o=this.engine)===null||o===void 0||o.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",i,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const i=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const o=this.setTimeoutFn(()=>{i.skipReconnect||(this.emitReserved("reconnect_attempt",i.backoff.attempts),!i.skipReconnect&&i.open(d=>{d?(i._reconnecting=!1,i.reconnect(),this.emitReserved("reconnect_error",d)):i.onreconnect()}))},r);this.opts.autoUnref&&o.unref(),this.subs.push(()=>{this.clearTimeoutFn(o)})}}onreconnect(){const i=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",i)}}const Sr={};function Dc(n,i){typeof n=="object"&&(i=n,n=void 0),i=i||{};const r=yC(n,i.path||"/socket.io"),o=r.source,d=r.id,f=r.path,m=Sr[d]&&f in Sr[d].nsps,p=i.forceNew||i["force new connection"]||i.multiplex===!1||m;let h;return p?h=new Vm(o,i):(Sr[d]||(Sr[d]=new Vm(o,i)),h=Sr[d]),r.query&&!i.query&&(i.query=r.queryKey),h.socket(r.path,i)}Object.assign(Dc,{Manager:Vm,Socket:F1,io:Dc,connect:Dc});let Xf=null;function bb(){return Xf||(Xf=Dc(window.location.origin,{path:"/socket.io",transports:["websocket","polling"],reconnectionAttempts:10,reconnectionDelay:2e3})),Xf}function DC(n){const[i,r]=y.useState(!1),[o,d]=y.useState(null);return y.useEffect(()=>{const f=bb(),m=()=>r(!0),p=()=>r(!1),h=j=>{d(L=>({...L,...j,state:(j==null?void 0:j.state)||(L==null?void 0:L.state)||"idle"})),n==null||n("session",j)},b=j=>{d(L=>({...L,state:(j==null?void 0:j.state)||(L==null?void 0:L.state)||"idle",status:(j==null?void 0:j.status)||(L==null?void 0:L.status)})),n==null||n("status_update",j)},x=j=>{d(L=>({...L,...j})),n==null||n("status",j)},v=j=>{d(L=>({...L,state:"waiting_for_qr",qr:j})),n==null||n("qr",j)},S=j=>{const L=typeof j=="object"&&j&&"code"in j?String(j.code):String(j||"");d(_=>({..._,state:"waiting_for_qr",pairingCode:L})),n==null||n("pairing_code",L)},A=()=>{d(j=>j?{...j,qr:null}:null),n==null||n("qr_cleared",{})},k=()=>{d(j=>j?{...j,pairingCode:null}:null),n==null||n("pairing_code_cleared",{})},N=(j,...L)=>{n==null||n(j,L[0])};return f.on("connect",m),f.on("disconnect",p),f.on("session",h),f.on("status_update",b),f.on("status",x),f.on("qr",v),f.on("pairing_code",S),f.on("pairing-code",S),f.on("qr_cleared",A),f.on("pairing_code_cleared",k),f.onAny(N),r(f.connected),()=>{f.off("connect",m),f.off("disconnect",p),f.off("session",h),f.off("status_update",b),f.off("status",x),f.off("qr",v),f.off("pairing_code",S),f.off("pairing-code",S),f.off("qr_cleared",A),f.off("pairing_code_cleared",k),f.offAny(N)}},[n]),{isConnected:i,sessionStatus:o,socket:bb()}}const MC=[{key:"text",icon:ij,labelKey:"capText",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:n=>(n==null?void 0:n.textInput)!=null&&(n==null?void 0:n.textOutput)!=null?!!(n.textInput&&n.textOutput):null},{key:"vision",icon:Si,labelKey:"capVision",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:n=>n==null?void 0:n.vision},{key:"audioInput",icon:uj,labelKey:"capAudio",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:n=>n==null?void 0:n.audioInput},{key:"stt",icon:c0,labelKey:"capStt",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:n=>n==null?void 0:n.stt},{key:"pdfInput",icon:Ur,labelKey:"capPdf",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:n=>n==null?void 0:n.pdfInput},{key:"videoInput",icon:cj,labelKey:"capVideo",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:n=>n==null?void 0:n.videoInput}];function RC(n,i){return i==="unknown"||!i||n==null?"unknown":n?"supported":"unsupported"}function zC({capabilities:n,capabilitySource:i}){const{t:r}=Ue(),o=i==="provider"?"ok":i==="seed"?"info":"neutral",d=r(i==="provider"?"sourceLive":i==="seed"?"sourceSeed":"sourceUnknown");return s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsx("div",{className:"flex flex-wrap items-center gap-1 sm:gap-1.5",children:MC.map(f=>{const m=f.getValue(n),p=RC(m,i),h=f.icon,b=r(p==="supported"?"supported":p==="unsupported"?"unsupported":"sourceUnknown"),x=`${r(f.labelKey)}: ${b}`,v=s.jsxs("span",{className:"flex flex-col gap-1 text-xs",children:[s.jsxs("span",{className:"flex items-center gap-1.5 font-bold text-text-main",children:[p==="supported"&&s.jsx(gi,{size:13,strokeWidth:2.5,className:"text-ok shrink-0"}),p==="unsupported"&&s.jsx(Rn,{size:13,strokeWidth:2.5,className:"text-danger shrink-0"}),p==="unknown"&&s.jsx("span",{className:"font-mono text-faint shrink-0",children:"?"}),s.jsx("span",{children:x})]}),s.jsx("span",{className:"text-[11px] text-muted",children:r(p==="supported"?f.supportedDescKey:p==="unsupported"?f.unsupportedDescKey:"capUnknownDesc")})]});return s.jsx(mN,{label:x,content:v,className:"size-10 min-h-10 min-w-10 rounded-lg p-0",children:s.jsxs("span",{className:"relative inline-flex size-5 items-center justify-center",children:[s.jsx(h,{size:18,className:p==="supported"?"text-ok":p==="unsupported"?"text-muted/60":"text-muted/40"}),p==="supported"&&s.jsx("span",{"aria-hidden":!0,className:"absolute -bottom-1 -end-1 flex size-3.5 items-center justify-center rounded-full bg-panel-raised text-ok ring-1 ring-line",children:s.jsx(gi,{size:9,strokeWidth:3})}),p==="unsupported"&&s.jsx("span",{"aria-hidden":!0,className:"absolute -bottom-1 -end-1 flex size-3.5 items-center justify-center rounded-full bg-panel-raised text-danger ring-1 ring-line",children:s.jsx(Rn,{size:9,strokeWidth:3})}),p==="unknown"&&s.jsx("span",{"aria-hidden":!0,className:"absolute -bottom-1 -end-1 flex size-3.5 items-center justify-center rounded-full bg-panel-raised text-faint ring-1 ring-line font-mono text-[9px] font-bold leading-none",children:"?"})]})},f.key)})}),s.jsx(We,{tone:o,children:d})]})}const il=[{id:"gemini",name:"Google Gemini",descKey:"providerGeminiDesc",provider:"gemini",defaultModel:"gemini-3.7-flash",defaultBaseUrl:"",keySetting:"gemini_api_key",modelSetting:"gemini_model",baseUrlSetting:"gemini_base_url"},{id:"groq",name:"Groq Cloud",descKey:"providerGroqDesc",provider:"openai",defaultModel:"llama-3.3-70b-versatile",defaultBaseUrl:"https://api.groq.com/openai/v1",keySetting:"openai_api_key",modelSetting:"openai_model",baseUrlSetting:"openai_base_url"},{id:"openai",name:"OpenAI",descKey:"providerOpenAIDesc",provider:"openai",defaultModel:"gpt-4o-mini",defaultBaseUrl:"https://api.openai.com/v1",keySetting:"openai_api_key",modelSetting:"openai_model",baseUrlSetting:"openai_base_url"},{id:"ollama",name:"Ollama (Local)",descKey:"providerOllamaDesc",provider:"openai",defaultModel:"llama3.2",defaultBaseUrl:"http://localhost:11434/v1",keySetting:"openai_api_key",modelSetting:"openai_model",baseUrlSetting:"openai_base_url"},{id:"anthropic",name:"Anthropic Claude",descKey:"providerAnthropicDesc",provider:"anthropic",defaultModel:"claude-sonnet-4-5",defaultBaseUrl:"https://api.anthropic.com",keySetting:"anthropic_api_key",modelSetting:"anthropic_model",baseUrlSetting:"anthropic_base_url"}];function LC(n){const i=n.ai_provider||"gemini";return il.find(r=>{var o,d;return r.provider!==i?!1:!!(r.id==="gemini"||r.id==="anthropic"||r.id==="groq"&&((o=n.openai_base_url)!=null&&o.includes("groq.com"))||r.id==="ollama"&&((d=n.openai_base_url)!=null&&d.includes("11434"))||r.id==="openai"&&(!n.openai_base_url||n.openai_base_url.includes("api.openai.com")))})||il[0]}const OC=()=>{var zs,Qa,ka,Sl,Xa,kl;const{t:n,language:i}=Ue(),{toast:r}=Ct(),[o,d]=y.useState({}),[f,m]=y.useState({}),[p,h]=y.useState(!0),[b,x]=y.useState({}),[v,S]=y.useState(!1),[A,k]=y.useState(!1),[N,j]=y.useState(!1),[L,_]=y.useState(""),[G,R]=y.useState(!1),[ne,U]=y.useState([]),[M,T]=y.useState(null),[P,O]=y.useState(""),[J,Z]=y.useState(!1),[se,E]=y.useState(!1),[z,F]=y.useState([]),[le,pe]=y.useState(null),[he,I]=y.useState(null),[ce,ie]=y.useState(!1),fe=LC(o),C=Pc({presetId:fe.id,apiKey:"",baseUrl:fe.baseUrlSetting?String(o[fe.baseUrlSetting]||fe.defaultBaseUrl):"",model:String(o[fe.modelSetting]||fe.defaultModel)}),K=bn(String(o.ai_stt_provider||"auto")),Y=bn(String(o.bot_language||"auto")),me=bn(String(o.translate_engine||"ai")),te=bn(String(o.google_translate_api_key||"")),oe=il.find(re=>re.id===C.draft.presetId)||fe,ve=async()=>{try{const re=await $.getSettings();if(re!=null&&re.settings){const Me={},He={};re.settings.forEach(q=>{Me[q.key]=q.value,q.type==="secret"&&(He[q.key]=!!q.configured,Me[q.key]="")}),d(Me),m(He)}}catch(re){r(re.message,"error")}finally{h(!1)}};y.useEffect(()=>{ve()},[]);const be=async(re,Me,He=!1)=>{d(q=>({...q,[re]:Me}));try{await $.updateSetting(re,Me),He||r(n("savedSuccessfully"),"success")}catch(q){r(q.message,"error")}},Se=async(re,Me)=>{await $.updateSetting(re,Me),re.endsWith("_api_key")?(d(He=>({...He,[re]:""})),m(He=>({...He,[re]:!!Me}))):d(He=>({...He,[re]:Me}))},it=re=>{const Me=il.find(q=>q.id===re);if(!Me)return;const He=il.find(q=>q.id===C.draft.presetId)||fe;C.setDraft({presetId:Me.id,apiKey:Me.keySetting===He.keySetting?C.draft.apiKey:"",baseUrl:Me.defaultBaseUrl,model:Me.defaultModel})},xt=async(re=!1,Me=!1)=>{S(!0);const He=String(C.draft.apiKey||"").trim(),q=!!f[oe.keySetting];try{const Ne={provider:oe.provider,refresh:re,cacheOnly:Me};He&&(Ne.apiKey=He),oe.baseUrlSetting&&C.draft.baseUrl&&(Ne.baseUrl=C.draft.baseUrl);const Ve=await $.fetchAiModels(Ne);Ve&&(Ve.success||Ve.fallback)?(x(Qt=>{var Xt;return{...Qt,[oe.id]:{live:!!Ve.live,requiresApiKey:!!Ve.requiresApiKey,fallback:!!Ve.fallback,models:Ve.models||[],cached:!!Ve.cached,error:Ve.success||(Xt=Ve.error)==null?void 0:Xt.message}}}),!Ve.live&&Ve.requiresApiKey&&re?r(n("connectKeyFirstPrompt"),"info"):!Ve.success&&Ve.error&&r(Ve.error.message||"Failed to discover models","error")):Ve&&!Ve.success&&Ve.error&&(x(Qt=>{var Xt;return{...Qt,[oe.id]:{live:!1,requiresApiKey:!(q||He),fallback:!0,models:Ve.models||[],error:(Xt=Ve.error)==null?void 0:Xt.message}}}),r(Ve.error.message||"Failed to discover models","error"))}catch(Ne){Me||r(Ne.message||"Failed to fetch models","error")}finally{S(!1)}};y.useEffect(()=>{p||xt(!1,!0)},[oe.id,p]);const Ce=((zs=b[oe.id])==null?void 0:zs.models)||[],Ie=!!((Qa=b[oe.id])!=null&&Qa.live),Fe=!!(((ka=b[oe.id])==null?void 0:ka.requiresApiKey)??!f[oe.keySetting]),ue=o[fe.modelSetting]||fe.defaultModel,Re=C.draft.model||oe.defaultModel,je=re=>Ce.find(Me=>Me.id.toLowerCase()===re.toLowerCase())||{id:re,displayName:re,provider:oe.provider,recommended:!1,capabilities:{textInput:!0,textOutput:!0,vision:!1,audioInput:!1,stt:!1,videoInput:!1,pdfInput:!1},capabilitySource:"unknown"},Ke=je(Re),yt=je(ue),jt=!!yt.capabilities.vision,B=!!yt.capabilities.stt,ye=yt.capabilitySource==="provider"||yt.capabilitySource==="seed",Le=o.ai_auto_detect_capabilities!==!1,Ge=ye&&Le&&!jt,ut=ye&&Le&&!B;y.useEffect(()=>{p||(Ge&&o.ai_vision_enabled&&be("ai_vision_enabled",!1,!0),ut&&o.ai_stt_enabled&&be("ai_stt_enabled",!1,!0))},[ue,Ge,ut,p]);const Ut=async()=>{j(!0),R(!0);try{const re=await $.getPersona(),Me=re==null?void 0:re.persona;_(typeof Me=="string"?Me:(Me==null?void 0:Me.body)||"")}catch(re){r(re.message,"error")}finally{R(!1)}},on=async()=>{try{await $.updatePersona(L),r(i==="ar"?"تم تحديث توجيه الشخصية بنجاح!":"Persona updated successfully!","success"),j(!1)}catch(re){r(re.message,"error")}},sn=async()=>{try{const re=await $.getMemoryFiles(),Me=((re==null?void 0:re.scopes)||[]).map(He=>({scope:He.scope,label:He.label,entries:He.entries??0}));U(Me.some(He=>He.scope==="global")?Me:[{scope:"global",label:"Global memory",entries:0},...Me])}catch(re){U([{scope:"global",label:"Global memory",entries:0}]),r(re.message,"error")}},kn=async re=>{T(re),O(""),Z(!0);try{const Me=await $.getMemoryFile(re);O((Me==null?void 0:Me.content)||"")}catch(Me){r(Me.message,"error")}finally{Z(!1)}},wl=async()=>{T("global"),Z(!0),await sn();try{const re=await $.getMemoryFile("global");O((re==null?void 0:re.content)||"")}catch(re){r(re.message,"error")}finally{Z(!1)}},Va=async()=>{if(M)try{await $.updateMemoryFile(M,P),r(i==="ar"?"تم حفظ ملف الذاكرة بنجاح!":"Memory file updated!","success"),sn(),T(null)}catch(re){r(re.message,"error")}},Ms=async()=>{E(!0),pe(null),I(null),ie(!0);try{const re=await $.getAiConversations();F((re==null?void 0:re.conversations)||[])}catch(re){r(re.message,"error")}finally{ie(!1)}},Rs=async re=>{pe(re),I(null),ie(!0);try{const Me=await $.getAiConversation(re);I(Me||null)}catch(Me){r(Me.message,"error")}finally{ie(!1)}},Ni=re=>re?new Date(re).toLocaleString(i==="ar"?"ar-EG":"en-GB",{dateStyle:"medium",timeStyle:"short"}):"—",Ka={saveLabel:n("save"),savedLabel:n("saved")},Ht={saveLabel:n("save"),discardLabel:n("discard"),unsavedLabel:n("unsavedChanges"),savedLabel:n("saved")};if(p)return s.jsx(Ts,{text:n("starting")});const Ya=!!o.ai_agent;return s.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[s.jsx(gl,{icon:s.jsx(Wm,{size:20}),title:n("aiTitle"),description:n("aiSubtitle")}),s.jsx(Ze,{"data-tour":"ai-agent",children:s.jsxs("div",{className:"flex min-h-10 items-center justify-between gap-4",children:[s.jsx("span",{className:"text-sm font-semibold text-text-main",children:n("aiAgentEnabled")}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs font-bold text-muted",children:n(Ya?"toggleOn":"toggleOff")}),s.jsx(Kn,{checked:Ya,onChange:re=>be("ai_agent",re),"aria-label":n("aiAgentEnabled")})]})]})}),s.jsxs(Ze,{className:"flex flex-col gap-3","data-tour":"ai-provider",children:[s.jsx(wn,{icon:s.jsx(L0,{size:18}),title:n("aiProvider")}),s.jsx(Ia,{"aria-label":n("aiProvider"),value:C.draft.presetId,onChange:re=>it(re),options:il.map(re=>({value:re.id,label:re.name})),className:"w-full"}),s.jsx("p",{className:"text-xs text-muted",children:n(oe.descKey)}),Fe&&s.jsx("p",{className:"text-xs text-warn",children:n("connectKeyFirstPrompt")}),s.jsxs("form",{className:"flex flex-col gap-3",onSubmit:re=>{re.preventDefault(),C.save(async Me=>{const He=il.find(q=>q.id===Me.presetId)||oe;await Se("ai_provider",He.provider),He.baseUrlSetting&&await Se(He.baseUrlSetting,Me.baseUrl),await Se(He.modelSetting,Me.model),Me.apiKey.trim()&&await Se(He.keySetting,Me.apiKey.trim()),C.setDraft({...Me,apiKey:""})})},onKeyDown:re=>{re.key==="Escape"&&C.revert()},children:[s.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-3",children:[s.jsx(_e,{className:"min-w-0",htmlFor:"input-api-key",label:s.jsxs("span",{className:"flex w-full items-center justify-between gap-2",children:[s.jsx("span",{children:n("apiKey")}),f[oe.keySetting]&&s.jsxs(We,{tone:"ok",children:[s.jsx(Cs,{size:11}),n("saved")]})]}),children:s.jsx(qa,{id:"input-api-key",className:"font-mono",value:C.draft.apiKey,onChange:re=>C.setField("apiKey",re.target.value),placeholder:f[oe.keySetting]?"••••••••••••":n("enterApiKey")})}),oe.baseUrlSetting&&s.jsx(_e,{className:"min-w-0",label:n("baseUrl"),htmlFor:"input-base-url",children:s.jsx(Be,{id:"input-base-url",technical:!0,className:"font-mono",value:C.draft.baseUrl,onChange:re=>C.setField("baseUrl",re.target.value),placeholder:oe.defaultBaseUrl})}),s.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-1.5",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("label",{htmlFor:"input-model-name",className:"text-xs font-bold text-text-main",children:n("modelName")}),s.jsx(We,{tone:Ie?"ok":"info",children:n(Ie?"sourceLive":"sourceSeed")})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(de,{type:"button",variant:"ghost",size:"sm",onClick:()=>k(!A),children:n(A?"modelListToggle":"modelCustomToggle")}),s.jsx(Oe,{type:"button",variant:"ghost",label:n("refreshModels"),icon:s.jsx(Ga,{size:16}),onClick:()=>xt(!0),loading:v})]})]}),((Sl=b[oe.id])==null?void 0:Sl.error)&&s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-xl border border-danger/30 bg-danger/10 p-2 text-xs text-danger",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[s.jsx(ll,{size:15,className:"shrink-0"}),s.jsx("span",{className:"min-w-0 break-words",children:(Xa=b[oe.id])==null?void 0:Xa.error})]}),s.jsx(de,{type:"button",variant:"ghost",size:"sm",icon:s.jsx(Ga,{size:14}),onClick:()=>xt(!0),loading:v,children:n("retry")})]}),v?s.jsx("div",{className:"flex min-h-10 items-center gap-2 rounded-xl border border-line bg-panel-raised px-3",children:s.jsx(va,{label:n("fetchingModels")})}):A?s.jsx(Be,{id:"input-model-name",technical:!0,className:"font-mono",value:C.draft.model,onChange:re=>C.setField("model",re.target.value),placeholder:oe.defaultModel}):Ce.length===0?s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-xl border border-line bg-panel-raised p-2 text-xs text-muted",children:[s.jsx("span",{children:n(Fe?"connectKeyFirstPrompt":"noModelsFound")}),s.jsx(de,{type:"button",variant:"ghost",size:"sm",icon:s.jsx(Ga,{size:14}),onClick:()=>xt(!0),loading:v,children:n("retry")})]}):s.jsxs(ft,{id:"input-model-name",dir:"ltr",className:"font-mono text-start",value:Re,onChange:re=>C.setField("model",re.target.value),children:[s.jsx("optgroup",{label:n(Ie?"modelsAvailableLive":"modelsRecommendedSeed"),children:Ce.map(re=>s.jsxs("option",{value:re.id,dir:"ltr",children:[re.displayName&&re.displayName!==re.id?re.displayName:re.id,re.recommended?" ★":""]},re.id))}),!Ce.some(re=>re.id.toLowerCase()===Re.toLowerCase())&&s.jsx("option",{value:Re,dir:"ltr",children:Re})]}),s.jsxs("div",{className:"flex min-w-0 items-center gap-1 text-xs text-muted",dir:"ltr",title:Re,children:[s.jsx("span",{className:"shrink-0 text-faint",children:"ID:"}),s.jsx("span",{className:"truncate font-mono",children:Re})]})]})]}),s.jsx(qc,{dirty:C.dirty,saving:C.status==="saving",justSaved:C.status==="saved",error:C.error,onDiscard:C.revert,...Ht})]}),s.jsx(zC,{capabilities:Ke.capabilities,capabilitySource:Ke.capabilitySource})]}),s.jsxs(Ze,{className:"flex flex-col gap-3",children:[s.jsx(wn,{title:n("capabilities")}),s.jsxs("div",{className:"flex flex-col divide-y divide-line",children:[s.jsxs("div",{className:"py-2",children:[s.jsx(Kn,{checked:Ge?!1:!!o.ai_vision_enabled,disabled:Ge,onChange:re=>{Ge||be("ai_vision_enabled",re)},label:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[s.jsx(Si,{size:17,className:Ge?"shrink-0 text-muted":"shrink-0 text-brand-cyan"}),n("aiVision")]}),description:n("aiVisionDesc")}),Ge&&s.jsxs("p",{className:"mt-1 flex items-center gap-1 text-[11px] font-semibold text-warn",children:[s.jsx(ml,{size:13,className:"shrink-0"}),s.jsx("span",{children:n("visionUnsupportedNotice")})]})]}),s.jsxs("div",{className:"py-2",children:[s.jsx(Kn,{checked:ut?!1:!!(o.ai_stt_enabled??!0),disabled:ut,onChange:re=>{ut||be("ai_stt_enabled",re)},label:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[s.jsx(c0,{size:17,className:ut?"shrink-0 text-muted":"shrink-0 text-brand-purple"}),n("aiSttEnabled")]}),description:n("aiSttEnabledDesc")}),ut&&s.jsxs("p",{className:"mt-1 flex items-center gap-1 text-[11px] font-semibold text-warn",children:[s.jsx(ml,{size:13,className:"shrink-0"}),s.jsx("span",{children:n("sttUnsupportedNotice")})]})]}),s.jsx("div",{className:"py-2",children:s.jsx(vn,{label:n("aiStt"),description:n("sttDesc"),htmlFor:"ai-stt-provider",dirty:K.dirty,saving:K.status==="saving",justSaved:K.status==="saved",error:K.error,onSave:()=>K.save(re=>Se("ai_stt_provider",re)),onRevert:K.revert,...Ka,children:s.jsxs(ft,{id:"ai-stt-provider","aria-label":n("aiStt"),value:K.value,disabled:ut,onChange:re=>K.setValue(re.target.value),children:[s.jsx("option",{value:"auto",children:n("sttAuto")}),s.jsx("option",{value:"gemini",children:n("sttGemini")}),s.jsx("option",{value:"openai",children:n("sttOpenAI")})]})})}),s.jsx("div",{className:"py-2",children:s.jsx(vn,{label:n("botLanguage"),description:n("botLanguageDesc"),htmlFor:"ai-bot-language",dirty:Y.dirty,saving:Y.status==="saving",justSaved:Y.status==="saved",error:Y.error,onSave:()=>Y.save(re=>Se("bot_language",re)),onRevert:Y.revert,...Ka,children:s.jsxs(ft,{id:"ai-bot-language","aria-label":n("botLanguage"),value:Y.value,onChange:re=>Y.setValue(re.target.value),children:[s.jsx("option",{value:"auto",children:n("langAuto")}),s.jsx("option",{value:"ar",children:n("langAr")}),s.jsx("option",{value:"en",children:n("langEn")})]})})}),s.jsx("div",{className:"py-2",children:s.jsx(vn,{label:n("translateEngine"),description:n("translateEngineDesc"),htmlFor:"ai-translate-engine",dirty:me.dirty,saving:me.status==="saving",justSaved:me.status==="saved",error:me.error,onSave:()=>me.save(re=>Se("translate_engine",re)),onRevert:me.revert,...Ka,children:s.jsxs(ft,{id:"ai-translate-engine","aria-label":n("translateEngine"),value:me.value,onChange:re=>me.setValue(re.target.value),children:[s.jsx("option",{value:"ai",children:n("translateEngineAi")}),s.jsx("option",{value:"google",children:n("translateEngineGoogle")})]})})}),s.jsx("div",{className:"py-2",children:s.jsx(vn,{label:n("googleTranslateApiKey"),description:n("googleTranslateApiKeyDesc"),htmlFor:"ai-google-translate-key",dirty:te.dirty,saving:te.status==="saving",justSaved:te.status==="saved",error:te.error,onSave:()=>te.save(async re=>{await Se("google_translate_api_key",re),te.setValue("")}),onRevert:te.revert,...Ka,children:s.jsx(qa,{id:"ai-google-translate-key",className:"font-mono",placeholder:f.google_translate_api_key?"••••••••••••":n("enterApiKey"),value:te.value,onChange:re=>te.setValue(re.target.value)})})})]})]}),s.jsxs(Ze,{className:"grid grid-cols-1 gap-2 sm:grid-cols-2","data-tour":"ai-memory",children:[s.jsx(de,{variant:"secondary",icon:s.jsx(Ur,{size:16}),onClick:Ut,title:n("personaDesc"),children:n("editPersona")}),s.jsx(de,{variant:"secondary",icon:s.jsx(Bk,{size:16}),onClick:wl,title:n("memoryDesc"),children:n("manageMemory")}),s.jsx(de,{variant:"secondary",icon:s.jsx(nj,{size:16}),onClick:Ms,title:n("aiInspectorDesc"),children:n("openInspector")})]}),s.jsx(an,{isOpen:N,onClose:()=>j(!1),title:n("personaPrompt"),maxWidth:"750px",footer:s.jsxs(s.Fragment,{children:[s.jsx(de,{variant:"secondary",onClick:()=>j(!1),children:n("cancel")}),s.jsx(de,{variant:"primary",icon:s.jsx(xi,{size:16}),onClick:on,disabled:G,children:n("save")})]}),children:G?s.jsx("div",{className:"flex min-h-[280px] items-center justify-center",children:s.jsx(va,{className:"size-6",label:n("starting")})}):s.jsx(ol,{className:"font-mono",rows:12,value:L,onChange:re=>_(re.target.value)})}),s.jsx(an,{isOpen:!!M,onClose:()=>T(null),title:n("memoryFiles"),maxWidth:"900px",footer:s.jsxs(s.Fragment,{children:[s.jsx(de,{variant:"secondary",onClick:()=>T(null),children:n("cancel")}),s.jsx(de,{variant:"primary",icon:s.jsx(xi,{size:16}),onClick:Va,disabled:J,children:n("save")})]}),children:s.jsxs("div",{className:"flex flex-col gap-4 md:flex-row",children:[s.jsx("div",{className:"flex shrink-0 flex-col gap-1.5 md:max-h-[420px] md:w-60 md:overflow-y-auto",children:ne.length===0?s.jsx(mt,{kind:"empty",text:n("noMemoryFiles"),className:"py-6"}):ne.map(re=>{const Me=re.scope==="global",He=M===re.scope;return s.jsxs(de,{variant:He?"primary":"secondary","aria-pressed":He,onClick:()=>kn(re.scope),className:"h-auto w-full flex-col items-stretch gap-1 px-2.5 py-2.5",children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2 text-xs font-bold",children:[Me?s.jsx(Bc,{size:14,className:"shrink-0"}):s.jsx(kc,{size:14,className:"shrink-0"}),s.jsx("span",{className:"truncate",children:Me?n("memoryGlobalScope"):re.label||n(re.scope.endsWith("@g.us")?"unnamedGroup":"unknownContact")})]}),s.jsxs("span",{className:"block text-start text-[10px] opacity-80",children:[n(Me?"memoryGlobalScopeHint":"memoryChatScopeHint")," · ",n("memoryEntriesCount").replace("{n}",String(re.entries))]})]},re.scope)})}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s.jsx("p",{className:"text-[11px] leading-relaxed text-muted",children:n("memoryProseHint")}),J?s.jsx("div",{className:"flex min-h-[340px] items-center justify-center",children:s.jsx(va,{className:"size-6",label:n("starting")})}):s.jsx(ol,{className:"min-h-[340px] flex-1 font-mono",rows:12,value:P,onChange:re=>O(re.target.value),placeholder:n("memoryEditorPlaceholder")})]})]})}),s.jsx(an,{isOpen:se,onClose:()=>E(!1),title:n("aiInspector"),maxWidth:"750px",footer:s.jsx(de,{variant:"secondary",onClick:()=>E(!1),children:n("cancel")}),children:ce?s.jsx("div",{className:"flex min-h-[280px] items-center justify-center",children:s.jsx(va,{className:"size-6",label:n("starting")})}):le?s.jsxs("div",{className:"flex flex-col gap-2.5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(de,{variant:"ghost",size:"sm",icon:s.jsx(Lr,{size:16,className:"rtl:rotate-180"}),onClick:()=>pe(null),children:n("backToList")}),s.jsx(rn,{lines:2,className:"text-xs text-muted",children:(he==null?void 0:he.name)||((kl=z.find(re=>re.chatId===le))==null?void 0:kl.name)||n((he==null?void 0:he.kind)==="group"?"unnamedGroup":"unknownContact")})]}),(he==null?void 0:he.truncated)&&s.jsx("p",{className:"text-[11px] font-semibold text-warn",children:n("convTruncated")}),s.jsxs("div",{className:"flex max-h-[420px] flex-col gap-1.5 overflow-y-auto",children:[(he==null?void 0:he.messages.length)===0&&s.jsx(mt,{kind:"empty",text:n("noConversations"),className:"py-6"}),he==null?void 0:he.messages.map((re,Me)=>s.jsxs("div",{className:`rounded-xl border p-2.5 text-xs ${re.kind==="tool"||re.kind==="toolResult"?"border-line bg-panel font-mono text-muted":re.role==="model"?"border-brand-blue/25 bg-brand-blue/10 text-text-main":"border-line bg-panel-raised text-text-main"}`,children:[re.kind==="text"&&s.jsx("p",{className:"whitespace-pre-wrap break-words leading-relaxed",children:re.text}),re.kind==="media"&&s.jsxs("span",{children:["📎 ",re.mimeType||n("convMedia")]}),re.kind==="tool"&&s.jsxs("span",{children:["⚙️ ",re.name]}),re.kind==="toolResult"&&s.jsxs("span",{children:["↩️ ",re.name]})]},Me))]})]}):z.length===0?s.jsx(mt,{kind:"empty",icon:s.jsx(kc,{size:20}),text:n("noConversations"),className:"py-8"}):s.jsx("div",{className:"flex flex-col gap-1.5",children:z.map(re=>s.jsxs(de,{variant:"secondary",onClick:()=>Rs(re.chatId),className:"h-auto w-full flex-col items-stretch gap-1 px-3 py-3",children:[s.jsxs("span",{className:"flex items-center gap-2 text-xs font-bold",children:[s.jsx(kc,{size:14,className:"shrink-0 text-brand-blue"}),s.jsx(rn,{lines:2,children:re.name||n(re.kind==="group"?"unnamedGroup":"unknownContact")})]}),s.jsxs("span",{className:"block text-start text-[10px] text-muted",children:[n("convTurns").replace("{n}",String(re.turns))," ·"," ",Ni(re.updatedAt)]})]},re.chatId))})})]})},In={rules:100,keywords:50,keywordChars:100,nameChars:60,senders:200,phoneMin:8,phoneMax:15},BC=/[\u064B-\u065F\u0670\u0640]/g,UC=/[\u0622\u0623\u0625\u0671]/g,HC=/\u0649/g,Zf={enabled:"any",chatScope:"any",senders:"any"};function Km(n){let i=String(n??"");return i=i.normalize("NFKC"),i=i.replace(BC,""),i=i.replace(UC,"ا"),i=i.replace(HC,"ي"),i=i.toLowerCase(),i=i.replace(/\s+/g," ").trim(),i}function PC(n){const i=String(n??"").normalize("NFC").replace(/\s+/g," ").trim();return i?i.length>In.keywordChars?{error:"long"}:Km(i)?{value:i}:{error:"empty"}:{error:"empty"}}class hi extends Error{constructor(i){super(i),this.reason=i,this.name="SenderInputError"}}function qC(n){var d;const i=String(n??"").trim();if(!i)throw new hi("invalid");const r=i.toLowerCase();if(r.endsWith("@g.us")||r.endsWith("@broadcast")||r.endsWith("@newsletter"))throw new hi("group");if(i.includes("@")){if(r.includes("@lid")){const f=(d=i.split("@")[0])==null?void 0:d.split(":")[0];if(!f)throw new hi("invalid");return`${f}@lid`}if(i.includes(":")){const f=i.split(":")[0],m=i.split("@")[1];if(!f||!m)throw new hi("invalid");return`${f}@${m}`}return i}const o=i.replace(/\D/g,"");if(o.length>=In.phoneMin&&o.length<=In.phoneMax)return`${o}@s.whatsapp.net`;throw new hi("invalid")}function vi(n){var r;const i=(r=n.name)==null?void 0:r.trim();return i||n.keywords[0]||""}function Fc(n,i){if(!n)return"";const r=i==null?void 0:i.get(n);if(r)return r;const o=/^(\d+)@s\.whatsapp\.net$/i.exec(n);return o?`+${o[1]}`:n}function Ym(n,i){return n&&(i!=null&&i.has(n))?"auto":"ltr"}function FC(n){const i={};return n.name.trim().length>In.nameChars&&(i.name="long"),n.keywords.length<1?i.keywords="required":n.keywords.length>In.keywords&&(i.keywords="max"),n.sendersMode==="selected"&&(n.senders.length<1?i.senders="required":n.senders.length>In.senders&&(i.senders="max")),i}function GC(n,i){return{name:n.name.trim()||null,keywords:n.keywords,match:n.match,chatScope:n.chatScope,senders:{mode:n.sendersMode,list:n.sendersMode==="everyone"?[]:n.senders},includeOwn:n.includeOwn,forEveryone:n.forEveryone,keepCopy:n.keepCopy,...i===void 0?{}:{enabled:i}}}function IC(n,i,r){const o=Km(i);return!(o&&!Km(`${n.name??""} ${n.keywords.join(" ")}`).includes(o)||r.enabled==="on"&&!n.enabled||r.enabled==="off"&&n.enabled||r.chatScope!=="any"&&n.chatScope!==r.chatScope||r.senders!=="any"&&n.senders.mode!==r.senders)}function VC(n,i,r){const o=[...n],d=(f,m)=>vi(f).localeCompare(vi(m),r,{sensitivity:"base"});return i==="name"?o.sort(d):i==="deleted"?o.sort((f,m)=>m.deletedCount-f.deletedCount||d(f,m)):i==="last"?o.sort((f,m)=>(m.lastDeletedAt??-1)-(f.lastDeletedAt??-1)||d(f,m)):o.sort((f,m)=>m.createdAt-f.createdAt||m.id-f.id),o}function KC(n){return[n.enabled,n.chatScope,n.senders].filter(i=>i!=="any").length}const $f=20;function vb(n,i){return n instanceof Dt&&n.message?n.message:i}const YC=({rules:n,names:i,ruleId:r,onRuleIdChange:o})=>{const{t:d}=Ue(),{toast:f}=Ct(),[m,p]=y.useState([]),[h,b]=y.useState(0),[x,v]=y.useState(1),[S,A]=y.useState(!0),[k,N]=y.useState(null),[j,L]=y.useState(0),[_,G]=y.useState(null),[R,ne]=y.useState(!1),U=y.useRef(0),M=`${r}|${j}`,[T,P]=y.useState(M);T!==M&&(P(M),v(1)),y.useEffect(()=>{const z=++U.current;A(!0),N(null),$.listAutoDeleteLog({ruleId:r||void 0,limit:$f,offset:(x-1)*$f}).then(F=>{U.current===z&&(p(F.log),b(F.total))}).catch(F=>{if(U.current!==z)return;const le=vb(F,d("copiesLoadFailed"));N(le),f(le,"error")}).finally(()=>{U.current===z&&A(!1)})},[r,j,x,d,f]);const O=async()=>{ne(!0);try{await $.clearAutoDeleteLog(_==="rule"?r:void 0),f(d("copiesCleared"),"success"),G(null),L(z=>z+1)}catch(z){f(vb(z,d("copiesLoadFailed")),"error")}finally{ne(!1)}},J=y.useCallback(z=>{if(!z)return d("mediaText");const le={image:"mediaImage",video:"mediaVideo",audio:"mediaAudio",sticker:"mediaSticker",document:"mediaDocument"}[z];return le?d(le):z},[d]),Z=n.find(z=>String(z.id)===r),se=Math.max(1,Math.ceil(h/$f)),E=Math.min(x,se);return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs(yl,{children:[s.jsx(xl,{label:d("filter"),resetLabel:d("reset"),activeCount:r?1:0,onReset:()=>o(""),children:s.jsx(_e,{label:d("filterByRule"),children:s.jsxs(ft,{"aria-label":d("filterByRule"),value:r,onChange:z=>o(z.target.value),children:[s.jsx("option",{value:"",children:d("allRules")}),n.map(z=>s.jsx("option",{value:String(z.id),children:vi(z)},z.id))]})})}),s.jsx("span",{className:"ms-auto",children:s.jsxs(Yn,{label:d("more"),children:[r&&s.jsx(lt,{danger:!0,icon:s.jsx(Mn,{size:16}),onSelect:()=>G("rule"),children:d("clearCopiesForRule")}),s.jsx(lt,{danger:!0,icon:s.jsx(Mn,{size:16}),onSelect:()=>G("all"),children:d("clearCopies")})]})})]}),S&&s.jsx("div",{className:"flex flex-col gap-3","aria-busy":"true",children:["s1","s2","s3"].map(z=>s.jsxs(Ze,{className:"flex flex-col gap-3",children:[s.jsx(Gt,{className:"h-4 w-40"}),s.jsx(Gt,{className:"h-12 w-full"}),s.jsx(Gt,{className:"h-5 w-24"})]},z))}),!S&&k&&s.jsx(mt,{kind:"error",icon:s.jsx(dl,{size:28}),description:k,action:s.jsx(de,{variant:"secondary",icon:s.jsx(dl,{size:16}),onClick:()=>L(z=>z+1),children:d("retryLoad")})}),!S&&!k&&m.length===0&&r&&s.jsx(mt,{kind:"no-results",description:d("noCopiesForRule"),action:s.jsx(de,{variant:"secondary",onClick:()=>o(""),children:d("clearFilters")})}),!S&&!k&&m.length===0&&!r&&s.jsx(mt,{kind:"empty",title:d("noCopiesTitle"),description:d("noCopiesBody")}),!S&&!k&&m.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex flex-col gap-3",children:m.map(z=>{const F=Fc(z.chatJid,i)||"—",le=Fc(z.sender,i)||"—",pe=z.mode==="revoke"?d("modeRevoke"):z.mode==="deleteForMe"?d("modeForMe"):z.mode;return s.jsxs(Ze,{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-[11px] font-bold text-faint",children:d("copyChat")}),s.jsx("p",{dir:Ym(z.chatJid,i),className:"truncate text-sm font-semibold",children:F})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-[11px] font-bold text-faint",children:d("copySender")}),s.jsx("p",{dir:Ym(z.sender,i),className:"truncate text-sm",children:le})]}),s.jsx(Br,{value:z.createdAt,className:"ms-auto text-xs text-muted"})]}),s.jsx("p",{dir:"auto",className:"whitespace-pre-wrap break-words text-sm text-text-main",children:z.text||"—"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.jsx(We,{children:J(z.mediaType)}),s.jsx(We,{tone:z.mode==="revoke"?"info":"neutral",children:pe})]})]},z.id)})}),s.jsx(ki,{page:E,pageCount:se,total:h,onPageChange:v})]}),s.jsx(hl,{isOpen:_!==null,onClose:()=>G(null),onConfirm:()=>void O(),title:d("clearCopiesTitle"),description:_==="rule"?Bt(d("clearCopiesRuleBody"),{name:Z?vi(Z):""}):d("clearCopiesBody"),confirmLabel:d("clearCopies"),cancelLabel:d("cancel"),loading:R})]})},QC={NO_MEDIA:"stickerErr_NO_MEDIA",UNSUPPORTED_TYPE:"stickerErr_UNSUPPORTED_TYPE",TOO_LARGE:"stickerErr_TOO_LARGE",DIMENSIONS_TOO_LARGE:"stickerErr_DIMENSIONS_TOO_LARGE",VIDEO_TOO_LONG:"stickerErr_VIDEO_TOO_LONG",CORRUPT:"stickerErr_CORRUPT",CONVERSION_FAILED:"stickerErr_CONVERSION_FAILED",OUTPUT_TOO_LARGE:"stickerErr_OUTPUT_TOO_LARGE",ENCODER_MISSING:"stickerErr_ENCODER_MISSING",TIMEOUT:"stickerErr_TIMEOUT",BUSY:"stickerErr_BUSY",NOT_FOUND:"stickerErr_NOT_FOUND",PACK_NOT_FOUND:"stickerErr_PACK_NOT_FOUND",PACK_EXISTS:"stickerErr_PACK_EXISTS",INVALID_NAME:"stickerErr_INVALID_NAME",INVALID_OPTIONS:"stickerErr_INVALID_OPTIONS",LIBRARY_FULL:"stickerErr_LIBRARY_FULL",PACK_LIMIT:"stickerErr_PACK_LIMIT",IN_USE:"stickerErr_IN_USE",STORAGE_UNAVAILABLE:"stickerErr_STORAGE_UNAVAILABLE",NOT_CONNECTED:"stickerErr_NOT_CONNECTED",CANCELLED:"stickerErr_CANCELLED",INTERNAL:"stickerErr_INTERNAL"};function G1(n){return n?QC[n]??null:null}function ph(n,i){const r=G1(i);return n(r||"stickerErr_INTERNAL")}function kt(n,i){return i instanceof Dt?ph(n,i.code):n("stickerErr_INTERNAL")}function XC(n,i){const o=i?{probing:"jobStage_probing",decoding:"jobStage_decoding",encoding:"jobStage_encoding",optimizing:"jobStage_optimizing",queued:"jobQueued"}[i]:null;return n(o||"jobQueued")}const gh=({open:n,busy:i=!1,onClose:r,onPick:o,title:d,includeGroups:f=!0,selectedIds:m,emptyText:p})=>{const{t:h}=Ue(),[b,x]=y.useState([]),[v,S]=y.useState(""),[A,k]=y.useState(!1),[N,j]=y.useState(null);y.useEffect(()=>{if(!n)return;let _=!1;return k(!0),j(null),$.getRecipients().then(G=>{_||x(G.recipients)}).catch(G=>{_||(G instanceof Dt&&!G1(G.code)?j(G.message||h("recipientsLoadFailed")):j(kt(h,G)))}).finally(()=>{_||k(!1)}),()=>{_=!0}},[n,h]);const L=y.useMemo(()=>{const _=f?b:b.filter(R=>R.type==="contact"),G=v.trim().toLowerCase();return G?_.filter(R=>R.name.toLowerCase().includes(G)||(R.phone||"").toLowerCase().includes(G)):_},[f,b,v]);return s.jsx(an,{isOpen:n,onClose:r,title:d??h("sendViaWhatsapp"),footer:s.jsx(de,{onClick:r,disabled:i,children:h("cancel")}),children:s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx(eh,{size:16,className:"pointer-events-none absolute start-3 top-3 text-muted"}),s.jsx(Be,{type:"search",value:v,onChange:_=>S(_.target.value),placeholder:h("searchRecipients"),"aria-label":h("searchRecipients"),className:"ps-9"})]}),A&&s.jsx(Ts,{text:h("loading")}),N&&s.jsx("p",{className:"text-sm text-danger",role:"alert",children:N}),!A&&!N&&L.length===0&&s.jsx("p",{className:"text-sm text-muted",children:p??h("noRecipients")}),s.jsx("div",{className:"flex max-h-72 flex-col gap-1.5 overflow-y-auto",children:L.map(_=>{const G=(m==null?void 0:m.includes(_.id))??!1;return s.jsxs(de,{variant:"secondary",disabled:i||G,onClick:()=>o(_.id),className:"h-auto w-full flex-col items-start px-3 py-2.5",children:[s.jsxs("span",{className:"flex w-full items-center gap-2",children:[s.jsx("span",{dir:"auto",className:"block min-w-0 flex-1 truncate text-sm font-semibold",children:_.name}),G&&s.jsx(We,{tone:"info",children:h("contactAdded")})]}),s.jsxs("span",{className:"block w-full text-[11px] font-medium text-muted",children:[_.type==="group"?h("recipientGroup"):h("recipientContact"),_.phone?s.jsx("span",{dir:"ltr",className:"ms-2",children:_.phone}):null]})]},_.id)})}),i&&s.jsx("p",{className:"text-xs text-muted",children:h("sending")})]})})},ZC=["contains","word","exact"],$C=["all","groups","private"],JC=({open:n,rule:i,names:r,onClose:o,onSaved:d})=>{const{t:f}=Ue(),m=y.useRef(i);m.current=i;const p=(i==null?void 0:i.id)??null,[h,b]=y.useState(""),[x,v]=y.useState([]),[S,A]=y.useState("contains"),[k,N]=y.useState("all"),[j,L]=y.useState("everyone"),[_,G]=y.useState([]),[R,ne]=y.useState(!1),[U,M]=y.useState(!0),[T,P]=y.useState(!1),[O,J]=y.useState(""),[Z,se]=y.useState(!1),[E,z]=y.useState(!1),[F,le]=y.useState(null),[pe,he]=y.useState(null),[I,ce]=y.useState(null),[ie,fe]=y.useState(null);y.useEffect(()=>{if(!n)return;const te=m.current;((te==null?void 0:te.id)??null)===p&&(b((te==null?void 0:te.name)??""),v((te==null?void 0:te.keywords)??[]),A((te==null?void 0:te.match)??"contains"),N((te==null?void 0:te.chatScope)??"all"),L((te==null?void 0:te.senders.mode)??"everyone"),G((te==null?void 0:te.senders.list)??[]),ne((te==null?void 0:te.includeOwn)??!1),M((te==null?void 0:te.forEveryone)??!0),P((te==null?void 0:te.keepCopy)??!1),J(""),se(!1),z(!1),le(null),he(null),ce(null),fe(null))},[n,p]);const C=f(S==="word"?"matchWordHint":S==="exact"?"matchExactHint":"matchContainsHint"),K=te=>{ce(te==="long"?f("keywordTooLong"):te==="max"?f("keywordsMax"):te==="empty"?f("keywordEmpty"):te==="duplicate"?f("keywordDuplicate"):null)},Y=te=>{try{const oe=qC(te);if(_.includes(oe)){J(""),fe(null);return}if(_.length>=In.senders){fe(f("tooManySenders"));return}G(ve=>ve.includes(oe)?ve:[...ve,oe]),J(""),fe(null)}catch(oe){fe(oe instanceof hi&&oe.reason==="group"?f("groupSenderRejected"):f("invalidPhone"))}},me=async te=>{var be;te.preventDefault();const oe={name:h,keywords:x,match:S,chatScope:k,sendersMode:j,senders:_,includeOwn:R,forEveryone:U,keepCopy:T},ve=FC(oe);if(he(ve.name?f("nameTooLong"):null),ce(ve.keywords==="required"?f("keywordsRequired"):ve.keywords==="max"?f("keywordsMax"):null),fe(ve.senders==="required"?f("sendersRequired"):ve.senders==="max"?f("tooManySenders"):null),!(ve.name||ve.keywords||ve.senders)){z(!0),le(null);try{const Se=GC(oe,(be=m.current)==null?void 0:be.enabled),it=m.current?await $.updateAutoDeleteRule(m.current.id,Se):await $.createAutoDeleteRule(Se);d(it.rule)}catch(Se){const it=Se instanceof Dt&&Se.message?Se.message:f("ruleSaveFailed");le(it)}finally{z(!1)}}};return s.jsxs(s.Fragment,{children:[s.jsx(an,{isOpen:n,onClose:o,title:f(i?"editRule":"newRule"),maxWidth:"40rem",footer:s.jsxs(s.Fragment,{children:[s.jsx(de,{variant:"secondary",onClick:o,disabled:E,children:f("cancel")}),s.jsx(de,{variant:"primary",type:"submit",form:"auto-delete-rule-form",loading:E,children:f("saveRule")})]}),children:s.jsxs("form",{id:"auto-delete-rule-form",className:"flex flex-col gap-4",onSubmit:te=>void me(te),children:[F&&s.jsx("p",{role:"alert",className:"text-sm text-danger",children:F}),s.jsx(_e,{label:f("ruleName"),htmlFor:"ad-rule-name",error:pe,children:s.jsx(Be,{id:"ad-rule-name",name:"rule-name",dir:"auto",value:h,"aria-invalid":pe?!0:void 0,placeholder:f("ruleNamePlaceholder"),onChange:te=>{b(te.target.value),pe&&te.target.value.trim().length<=In.nameChars&&he(null)},onBlur:()=>{h.trim().length>In.nameChars&&he(f("nameTooLong"))}})}),s.jsx(_e,{label:f("keywordsLabel"),error:I,children:s.jsx(oN,{id:"ad-keywords",value:x,onChange:v,max:In.keywords,prepare:PC,onReject:K,removeLabel:te=>Bt(f("removeKeyword"),{word:te}),countLabel:Bt(f("keywordCount"),{n:x.length,max:In.keywords}),placeholder:f("keywordsPlaceholder"),"aria-label":f("keywordsLabel"),"aria-invalid":I?!0:void 0,disabled:E})}),s.jsx(_e,{label:f("matchMode"),description:C,children:s.jsx(Ia,{"aria-label":f("matchMode"),className:"flex w-full flex-wrap",value:S,onChange:A,options:ZC.map(te=>({value:te,label:f(te==="contains"?"matchContains":te==="word"?"matchWord":"matchExact")}))})}),s.jsx(_e,{label:f("chatScopeLabel"),children:s.jsx(Ia,{"aria-label":f("chatScopeLabel"),className:"flex w-full flex-wrap",value:k,onChange:N,options:$C.map(te=>({value:te,label:f(te==="all"?"chatsAll":te==="groups"?"chatsGroups":"chatsPrivate")}))})}),s.jsxs(_e,{label:f("filterSender"),error:j==="selected"?ie:null,children:[s.jsx(Ia,{"aria-label":f("filterSender"),className:"flex w-full flex-wrap",value:j,onChange:L,options:[{value:"everyone",label:f("sendersEveryone")},{value:"selected",label:f("sendersSelected")}]}),j==="selected"&&s.jsxs("div",{className:"mt-3 flex flex-col gap-3",children:[s.jsx("p",{className:"text-xs text-muted",children:f("sendersHelp")}),_.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1.5",children:_.map(te=>s.jsx(Qc,{dir:Ym(te,r),removeLabel:Bt(f("removeContact"),{name:Fc(te,r)}),onRemove:()=>G(oe=>oe.filter(ve=>ve!==te)),children:Fc(te,r)},te))}),s.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[s.jsx(Be,{type:"tel",inputMode:"tel",name:"phone",autoComplete:"tel",dir:"ltr",value:O,placeholder:f("phonePlaceholder"),"aria-label":f("phonePlaceholder"),className:"min-w-0 flex-1",onChange:te=>J(te.target.value),onKeyDown:te=>{te.key==="Enter"&&(te.preventDefault(),Y(O))}}),s.jsx(de,{type:"button",variant:"secondary",onClick:()=>Y(O),children:f("addPhone")})]}),s.jsx(de,{type:"button",variant:"secondary",onClick:()=>se(!0),children:f("selectContacts")})]})]}),s.jsx(Kn,{checked:R,onChange:ne,label:f("includeOwn"),description:f("includeOwnHint")}),s.jsx(Kn,{checked:U,onChange:M,label:f("forEveryone"),description:f("forEveryoneHint")}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(Kn,{checked:T,onChange:P,label:f("keepCopy"),description:f("keepCopyHint")}),s.jsx("p",{className:"text-xs text-faint",children:f("keepCopyPrivacy")})]})]})}),s.jsx(gh,{open:Z,onClose:()=>se(!1),title:f("selectContacts"),includeGroups:!1,selectedIds:_,emptyText:f("noContacts"),onPick:te=>Y(te)})]})},wb=4,WC={contains:"matchContains",word:"matchWord",exact:"matchExact"};function kr(n,i){return n instanceof Dt&&n.message?n.message:i}const eE=()=>{const{t:n,language:i}=Ue(),{toast:r}=Ct(),[o,d]=y.useState("rules"),[f,m]=y.useState([]),[p,h]=y.useState(()=>new Map),[b,x]=y.useState(!0),[v,S]=y.useState(null),[A,k]=y.useState(0),[N,j]=y.useState(""),[L,_]=y.useState("newest"),[G,R]=y.useState(Zf),[ne,U]=y.useState(!1),[M,T]=y.useState(null),[P,O]=y.useState(null),[J,Z]=y.useState(!1),[se,E]=y.useState(""),z=y.useRef(new Set),F=y.useRef(new Map),le=y.useRef(0),pe=y.useRef(!0),he=y.useRef(0),I=y.useMemo(()=>new Intl.NumberFormat(i),[i]),ce=y.useCallback(ue=>{m(Re=>ue.map(je=>{if(!z.current.has(je.id))return je;const Ke=Re.find(yt=>yt.id===je.id);return Ke?{...je,enabled:Ke.enabled}:je}))},[]);y.useEffect(()=>{const ue=++le.current;return x(!0),$.listAutoDeleteRules().then(Re=>{!pe.current||le.current!==ue||(ce(Re.rules),S(null))}).catch(Re=>{if(!pe.current||le.current!==ue)return;const je=kr(Re,n("rulesLoadFailed"));S(je),r(je,"error")}).finally(()=>{pe.current&&le.current===ue&&x(!1)}),()=>{le.current+=1}},[A,n,r,ce]),y.useEffect(()=>(pe.current=!0,()=>{pe.current=!1}),[]);const ie=y.useCallback(async()=>{const ue=++le.current,Re=he.current;try{const je=await $.listAutoDeleteRules();if(!pe.current||le.current!==ue||he.current!==Re)return;ce(je.rules),S(null)}catch{}},[ce]);y.useEffect(()=>{if(b)return;const ue=()=>{document.visibilityState!=="hidden"&&ie()};window.addEventListener("focus",ue),document.addEventListener("visibilitychange",ue);const Re=window.setInterval(ue,3e4);return()=>{window.removeEventListener("focus",ue),document.removeEventListener("visibilitychange",ue),window.clearInterval(Re)}},[b,ie]),y.useEffect(()=>{let ue=!1;return $.getRecipients().then(Re=>{if(ue)return;const je=new Map;for(const Ke of Re.recipients)Ke.name&&je.set(Ke.id,Ke.name);h(je)}).catch(Re=>{ue||r(kr(Re,n("recipientsLoadFailed")),"error")}),()=>{ue=!0}},[n,r]);const fe=y.useMemo(()=>VC(f.filter(ue=>IC(ue,N,G)),L,i),[f,N,G,L,i]),C=`${N}|${L}|${G.enabled}|${G.chatScope}|${G.senders}`,{page:K,pageCount:Y,pageItems:me,setPage:te,total:oe}=Zc(fe,20,C),ve=()=>{j(""),R(Zf)},be=M?f.find(ue=>ue.id===M.id)??M:null,Se=()=>{if(f.length>=In.rules){r(n("rulesLimit"),"warning");return}T(null),U(!0)},it=async(ue,Re)=>{he.current+=1;const je=ue.enabled,Ke=(F.current.get(ue.id)??0)+1;F.current.set(ue.id,Ke),z.current.add(ue.id),m(yt=>yt.map(jt=>jt.id===ue.id?{...jt,enabled:Re}:jt));try{const yt=await $.updateAutoDeleteRule(ue.id,{enabled:Re});if(F.current.get(ue.id)!==Ke)return;m(jt=>jt.map(B=>B.id===ue.id?yt.rule:B))}catch(yt){F.current.get(ue.id)===Ke&&(m(jt=>jt.map(B=>B.id===ue.id?{...B,enabled:je}:B)),r(kr(yt,n("toggleFailed")),"error"))}finally{he.current+=1,F.current.get(ue.id)===Ke&&z.current.delete(ue.id)}},xt=async ue=>{he.current+=1;try{const Re=await $.resetAutoDeleteRule(ue.id);m(je=>je.map(Ke=>Ke.id===ue.id?Re.rule:Ke)),r(n("counterReset"),"success")}catch(Re){r(kr(Re,n("toggleFailed")),"error")}finally{he.current+=1}},Ce=async()=>{if(P){he.current+=1,Z(!0);try{await $.deleteAutoDeleteRule(P.id),m(ue=>ue.filter(Re=>Re.id!==P.id)),se===String(P.id)&&E(""),r(n("ruleDeleted"),"success"),O(null)}catch(ue){r(kr(ue,n("toggleFailed")),"error")}finally{he.current+=1,Z(!1)}}},Ie=ue=>ue.chatScope==="groups"?n("chatsGroups"):ue.chatScope==="private"?n("chatsPrivate"):n("chatsAll"),Fe=ue=>ue.senders.mode==="everyone"?n("sendersEveryone"):ue.senders.list.length===1?n("oneContact"):Bt(n("sendersCount"),{n:ue.senders.list.length});return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(gl,{icon:s.jsx(jc,{size:24}),title:n("autoDelete"),description:n("autoDeleteSubtitle"),actions:f.length>0||o==="copies"?s.jsx(de,{variant:"primary",icon:s.jsx(ul,{size:16}),onClick:Se,children:n("newRule")}):void 0}),s.jsx($c,{"aria-label":n("autoDelete"),className:"overflow-x-auto no-scrollbar",value:o,onChange:d,options:[{value:"rules",label:n("rulesTab")},{value:"copies",label:n("copiesTab")}]}),o==="rules"&&s.jsxs("div",{className:"flex flex-col gap-3",children:[!b&&!v&&f.length>0&&s.jsxs(yl,{children:[s.jsx(Be,{type:"search",name:"q",autoComplete:"off",value:N,onChange:ue=>j(ue.target.value),placeholder:n("searchRules"),"aria-label":n("searchRules"),className:"min-w-48 flex-1"}),s.jsx(Pr,{label:n("sort"),value:L,onChange:_,options:[{value:"newest",label:n("sortNewest")},{value:"name",label:n("sortByName")},{value:"deleted",label:n("sortMostDeleted")},{value:"last",label:n("sortLastDeleted")}]}),s.jsxs(xl,{label:n("filter"),resetLabel:n("reset"),activeCount:KC(G),onReset:()=>R(Zf),children:[s.jsx(Sn,{label:n("filterStatus"),name:"ad-status",value:G.enabled,onChange:ue=>R(Re=>({...Re,enabled:ue})),options:[{value:"any",label:n("statusAny")},{value:"on",label:n("statusEnabled")},{value:"off",label:n("statusDisabled")}]}),s.jsx(Sn,{label:n("filterChat"),name:"ad-scope",value:G.chatScope,onChange:ue=>R(Re=>({...Re,chatScope:ue})),options:[{value:"any",label:n("statusAny")},{value:"all",label:n("chatsAll")},{value:"groups",label:n("chatsGroups")},{value:"private",label:n("chatsPrivate")}]}),s.jsx(Sn,{label:n("filterSender"),name:"ad-senders",value:G.senders,onChange:ue=>R(Re=>({...Re,senders:ue})),options:[{value:"any",label:n("statusAny")},{value:"everyone",label:n("sendersEveryone")},{value:"selected",label:n("sendersSelected")}]})]})]}),b&&s.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2","aria-busy":"true",children:["s1","s2","s3","s4"].map(ue=>s.jsxs(Ze,{className:"flex flex-col gap-3",children:[s.jsx(Gt,{className:"h-5 w-40"}),s.jsx(Gt,{className:"h-6 w-full"}),s.jsx(Gt,{className:"h-8 w-24"})]},ue))}),!b&&v&&f.length===0&&s.jsx(mt,{kind:"error",icon:s.jsx(jc,{size:28}),description:v,action:s.jsx(de,{variant:"secondary",icon:s.jsx(dl,{size:16}),onClick:()=>k(ue=>ue+1),children:n("retryLoad")})}),!b&&!v&&f.length===0&&s.jsx(mt,{kind:"empty",icon:s.jsx(jc,{size:28}),title:n("noRulesTitle"),description:n("noRulesBody"),action:s.jsx(de,{variant:"primary",icon:s.jsx(ul,{size:16}),onClick:Se,children:n("newRule")})}),!b&&!v&&f.length>0&&fe.length===0&&s.jsx(mt,{kind:"no-results",action:s.jsx(de,{variant:"secondary",onClick:ve,children:n("clearFilters")})}),!b&&!v&&fe.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:me.map(ue=>{const Re=vi(ue),je=Math.max(0,ue.keywords.length-wb);return s.jsxs(Ze,{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("h3",{dir:"auto",className:"min-w-0 flex-1 truncate text-sm font-bold",children:Re||"—"}),s.jsx(Kn,{checked:ue.enabled,"aria-label":n("ruleEnabled"),onChange:Ke=>void it(ue,Ke)}),s.jsxs(Yn,{label:n("more"),children:[s.jsx(lt,{icon:s.jsx(p0,{size:16}),onSelect:()=>{T(ue),U(!0)},children:n("edit")}),s.jsx(lt,{icon:s.jsx(dl,{size:16}),onSelect:()=>void xt(ue),children:n("resetCounter")}),ue.keepCopy&&s.jsx(lt,{icon:s.jsx(Si,{size:16}),onSelect:()=>{E(String(ue.id)),d("copies")},children:n("viewCopies")}),s.jsx(lt,{danger:!0,icon:s.jsx(Mn,{size:16}),onSelect:()=>O(ue),children:n("delete")})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[ue.keywords.slice(0,wb).map(Ke=>s.jsx(Qc,{children:Ke},Ke)),je>0&&s.jsx(We,{children:Bt(n("moreKeywords"),{n:je})})]}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.jsx(We,{children:n(WC[ue.match])}),s.jsx(We,{children:Ie(ue)}),s.jsx(We,{children:Fe(ue)})]}),s.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-1",children:[s.jsx("span",{className:"text-2xl font-bold tabular-nums text-text-main",children:I.format(ue.deletedCount)}),s.jsx("span",{className:"text-xs text-muted",children:n("deletedLabel")}),s.jsx("span",{className:"ms-auto text-xs text-muted",children:ue.lastDeletedAt?s.jsxs(s.Fragment,{children:[n("lastDeleted")," ",s.jsx(Br,{value:ue.lastDeletedAt})]}):n("neverDeleted")})]})]},ue.id)})}),s.jsx(ki,{page:K,pageCount:Y,total:oe,onPageChange:te})]})]}),o==="copies"&&s.jsx(YC,{rules:f,names:p,ruleId:se,onRuleIdChange:E}),s.jsx(JC,{open:ne,rule:be,names:p,onClose:()=>U(!1),onSaved:ue=>{he.current+=1,m(Re=>{const je=Re.findIndex(yt=>yt.id===ue.id);if(je===-1)return[ue,...Re];const Ke=Re.slice();return Ke[je]=ue,Ke}),r(n("ruleSaved"),"success"),U(!1)}}),s.jsx(hl,{isOpen:P!==null,onClose:()=>O(null),onConfirm:()=>void Ce(),title:n("deleteRuleTitle"),description:s.jsx("span",{dir:"auto",children:Bt(n("deleteRuleBody"),{name:P?vi(P):""})}),confirmLabel:n("delete"),cancelLabel:n("cancel"),loading:J})]})},tE=/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/;function Fa(n){return n.key??n.name}function I1(n){return`cmd-details-${Fa(n).replace(/[^a-zA-Z0-9_-]+/g,"-")}`}const nE={MEMBERS:"permMembers",ALL:"permMembers",ADMINS_ONLY:"permAdminsOnly",ADMINS_OWNER:"permAdminsOwner",OWNER_ONLY:"permOwnerOnly"},aE={all:"scopeAll",group:"scopeGroup",private:"scopePrivate"};function qr(){const{t:n,language:i}=Ue(),r=p=>{const h=nE[p];return h?n(h):p},o=p=>{const h=aE[p];return h?n(h):p},d=p=>{var h;return((h=p.descriptions)==null?void 0:h[i])||p.description||""},f=p=>{var h;return((h=p.usages)==null?void 0:h[i])||p.usage||""};return{t:n,language:i,permissionLabel:r,scopeLabel:o,describe:d,usageOf:f,usageLines:(p,h)=>f(p).split(`
547
- `).map(b=>b.trim()).filter(Boolean).map(b=>`${h}${b}`)}}function xh({alias:n,prefix:i,onRemove:r,removeLabel:o}){const{t:d,language:f}=Ue(),m=tE.test(n),p=m!==(f==="ar");return s.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-lg border border-line bg-panel-raised px-2 py-0.5 text-[11px] text-muted",children:[s.jsxs("span",{dir:"ltr",className:"font-mono",children:[i,n]}),p&&s.jsx("span",{className:"font-sans text-[9px] font-bold uppercase tracking-wide text-brand-cyan/80",children:m?"AR":"EN"}),r&&s.jsx(Oe,{variant:"ghost",label:o??d("delete"),icon:s.jsx(Rn,{size:14}),onMouseDown:h=>h.preventDefault(),onClick:r})]})}function sE({command:n,prefix:i,onClose:r,onSaved:o}){const{t:d}=Ue(),{toast:f}=Ct(),[m,p]=y.useState([]),[h,b]=y.useState(""),[x,v]=y.useState(!1);y.useEffect(()=>{n&&(p(Array.isArray(n.aliases)?[...n.aliases]:[]),b(""),v(!1))},[n]);const S=()=>{const N=h.trim().replace(/^[!/#.?$]+/,"").toLowerCase();if(N){if(m.includes(N)){f(d("aliasAlreadyAdded"),"warning");return}p([...m,N]),b("")}},A=N=>{p(m.filter(j=>j!==N))},k=async()=>{if(n){v(!0);try{await $.updateCommand(n.name,{aliases:m}),o(n,m),f(d("savedSuccessfully"),"success"),r()}catch(N){f(N.message,"error")}finally{v(!1)}}};return s.jsx(an,{isOpen:!!n,onClose:r,title:n?s.jsxs(s.Fragment,{children:[d("aliasesFor")," ",s.jsxs("span",{dir:"ltr",className:"font-mono",children:[i,n.name]})]}):d("aliasesFor"),footer:s.jsxs(s.Fragment,{children:[s.jsx(de,{variant:"secondary",onClick:r,children:d("cancel")}),s.jsx(de,{variant:"primary",onClick:k,loading:x,children:d(x?"saving":"save")})]}),children:s.jsxs("div",{className:"flex flex-col gap-4 py-1",children:[s.jsx("p",{className:"text-xs text-muted sm:text-sm",children:d("aliasesHelp")}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("span",{className:"block text-xs font-bold text-muted",children:d("thAliases")}),s.jsx("div",{className:"flex min-h-[42px] flex-wrap items-center gap-2 rounded-xl border border-line bg-panel-raised p-2",children:m.length>0?m.map(N=>s.jsx(xh,{alias:N,prefix:i,removeLabel:d("delete"),onRemove:()=>A(N)},N)):s.jsx("span",{className:"px-1 text-xs text-faint",children:d("noAliases")})})]}),s.jsx(_e,{label:d("addAlias"),htmlFor:"new-alias-input",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(lj,{size:16,className:"pointer-events-none absolute start-3 top-3 text-muted"}),s.jsx(Be,{id:"new-alias-input",type:"text",value:h,onChange:N=>b(N.target.value),onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),S())},placeholder:d("newAliasPlaceholder"),className:"ps-10"})]}),s.jsx(de,{variant:"secondary",icon:s.jsx(ul,{size:16}),onClick:S,className:"shrink-0",children:d("add")})]})})]})})}function V1({command:n,levels:i,actions:r}){const{t:o,permissionLabel:d}=qr(),f=bn(n.permission);return n.permissionLocked?s.jsxs(x1,{padded:!1,role:"group","aria-label":`${o("thRequiredRole")}: ${n.name}`,className:"flex min-h-11 items-center gap-2.5 px-3 py-3",children:[s.jsx(e0,{size:16,className:"shrink-0 text-muted","aria-hidden":!0}),s.jsx("span",{className:"min-w-0 break-words text-sm text-text-main",children:d(n.permission)})]}):s.jsx(vn,{dirty:f.dirty,saving:f.status==="saving",justSaved:f.status==="saved",error:f.error,onSave:()=>f.save(m=>r.onSavePermission(n,m)),onRevert:f.revert,saveLabel:o("save"),savedLabel:o("saved"),children:s.jsx(ft,{"aria-label":`${o("thRequiredRole")}: ${n.name}`,value:f.value,onChange:m=>f.setValue(m.target.value),children:i.map(m=>s.jsx("option",{value:m,children:d(m)},m))})})}function jr({label:n,children:i}){return s.jsxs("section",{className:"flex min-w-0 flex-col gap-2.5",children:[s.jsx("p",{className:"text-xs font-bold text-muted",children:n}),i]})}function K1({command:n,prefix:i,levels:r,actions:o}){var v;const{t:d,describe:f,scopeLabel:m,permissionLabel:p,usageLines:h}=qr(),b=f(n),x=h(n,i);return s.jsxs("div",{className:"flex flex-col gap-5",children:[b&&s.jsx("p",{dir:"auto",className:"min-w-0 break-words text-sm leading-relaxed text-muted",children:b}),s.jsxs("div",{className:"grid grid-cols-1 gap-x-5 gap-y-5 sm:grid-cols-2",children:[s.jsx(jr,{label:d("thAliases"),children:s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[(v=n.aliases)!=null&&v.length?n.aliases.map(S=>s.jsx(xh,{alias:S,prefix:i},S)):s.jsx("span",{className:"text-xs text-faint",children:d("noAliases")}),s.jsx(Oe,{label:d("editAliases"),icon:s.jsx(Wk,{size:16}),onClick:()=>o.onEditAliases(n)})]})}),s.jsxs(jr,{label:d("thRequiredRole"),children:[s.jsx(V1,{command:n,levels:r,actions:o}),n.permissionLocked&&s.jsx("p",{className:"text-xs text-muted",children:d("permissionLockedReason")})]}),s.jsx(jr,{label:d("thScope"),children:s.jsx("div",{children:s.jsx(We,{tone:"info",children:m(n.chat)})})}),s.jsxs(jr,{label:d("thStatus"),children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.jsx(We,{tone:n.enabled?"ok":"neutral",children:n.enabled?d("statusEnabled"):d("statusDisabled")}),n.overridden&&s.jsx(We,{tone:"info",children:d("overridden")})]}),s.jsxs("p",{className:"text-xs text-muted",children:[d("defaultLabel"),": ",p(n.defaultPermission)]})]})]}),x.length>0&&s.jsx(jr,{label:d("usage"),children:s.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:x.map(S=>s.jsx("li",{children:s.jsxs(x1,{padded:!1,className:"flex min-h-11 items-center gap-2 px-3 py-2",children:[s.jsx("code",{dir:"ltr",title:S,className:"min-w-0 flex-1 whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-muted",children:S}),s.jsx(Oe,{label:d("copyCommand"),variant:"ghost",icon:s.jsx(Rv,{size:16}),onClick:()=>o.onCopy(S)})]})},S))})})]})}function lE({commands:n,prefix:i,levels:r,expanded:o,onToggleDetails:d,actions:f}){const{t:m}=Ue();return s.jsx("ul",{className:"divide-y divide-line/50",children:n.map(p=>{const h=Fa(p),b=o===h,x=I1(p);return s.jsxs("li",{children:[s.jsxs("div",{className:"flex min-h-12 items-center gap-2 px-4",children:[s.jsxs("span",{dir:"ltr",className:"min-w-0 flex-1 truncate font-mono text-sm font-bold text-brand-cyan",children:[i,p.name]}),s.jsx(Kn,{checked:p.enabled,"aria-label":`${m("thStatus")}: ${i}${p.name}`,onChange:v=>f.onToggleEnabled(p,v)}),s.jsx(Oe,{size:"md",variant:"ghost",label:m(b?"hideDetails":"details"),"aria-expanded":b,"aria-controls":x,icon:s.jsx(cl,{size:18,className:Pe("transition-transform",b&&"rotate-180")}),onClick:()=>d(h)})]}),b&&s.jsx("div",{id:x,className:"border-t border-line/40 bg-panel-raised/40 px-4 py-4",children:s.jsx(K1,{command:p,prefix:i,levels:r,actions:f})})]},h)})})}const Sb=2;function iE({command:n,prefix:i}){const r=n.aliases||[];if(r.length===0)return s.jsx("span",{className:"text-xs text-faint",children:"—"});const o=r.length-Sb;return s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[r.slice(0,Sb).map(d=>s.jsx(xh,{alias:d,prefix:i},d)),o>0&&s.jsxs(We,{tone:"neutral",children:["+",o]})]})}function rE({commands:n,prefix:i,levels:r,expanded:o,onToggleDetails:d,actions:f}){const{t:m}=Ue(),{describe:p}=qr();return s.jsx("div",{className:"overflow-hidden",children:s.jsxs("table",{className:"w-full table-fixed border-collapse text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-line bg-panel-raised text-xs font-bold uppercase tracking-wider text-muted",children:[s.jsx("th",{className:"w-[26%] px-3 py-3 text-start",children:m("thCommand")}),s.jsx("th",{className:"px-3 py-3 text-start",children:m("thDescription")}),s.jsx("th",{className:"hidden px-3 py-3 text-start lg:table-cell lg:w-[16%]",children:m("thAliases")}),s.jsx("th",{className:"hidden px-3 py-3 text-start sm:table-cell sm:w-[26%] md:table-cell",children:m("thRequiredRole")}),s.jsx("th",{className:"w-[72px] px-3 py-3 text-center",children:m("thStatus")}),s.jsx("th",{className:"w-14 px-3 py-3 text-end",children:s.jsx("span",{className:"sr-only",children:m("details")})})]})}),s.jsx("tbody",{className:"divide-y divide-line/40",children:n.map(h=>{const b=Fa(h),x=o===b,v=I1(h);return s.jsxs(y.Fragment,{children:[s.jsxs("tr",{className:"hover:bg-panel-hover/40",children:[s.jsx("td",{className:"min-w-0 px-3 py-2.5",children:s.jsxs("span",{dir:"ltr",className:"block truncate font-mono font-bold text-brand-cyan",children:[i,h.name]})}),s.jsx("td",{className:"min-w-0 px-3 py-2.5",children:s.jsx(rn,{as:"p",lines:1,className:"text-xs text-text-main md:text-sm",children:p(h)})}),s.jsx("td",{className:"hidden min-w-0 px-3 py-2.5 lg:table-cell",children:s.jsx(iE,{command:h,prefix:i})}),s.jsx("td",{className:"px-3 py-2.5",children:s.jsx(V1,{command:h,levels:r,actions:f})}),s.jsx("td",{className:"px-3 py-2.5",children:s.jsx("div",{className:"flex justify-center",children:s.jsx(Kn,{checked:h.enabled,"aria-label":`${m("thStatus")}: ${i}${h.name}`,onChange:S=>f.onToggleEnabled(h,S)})})}),s.jsx("td",{className:"px-3 py-2.5 text-end",children:s.jsx(Oe,{size:"md",variant:"ghost",label:m(x?"hideDetails":"details"),"aria-expanded":x,"aria-controls":v,icon:s.jsx(cl,{size:18,className:Pe("transition-transform",x&&"rotate-180")}),onClick:()=>d(b)})})]}),x&&s.jsx("tr",{className:"bg-panel-raised/40",children:s.jsx("td",{colSpan:6,className:"border-t border-line/40 px-3 py-4",children:s.jsx(K1,{command:h,prefix:i,levels:r,actions:f})})})]},b)})})]})})}const kb={status:"all",scope:"all",permission:"all"};function oE(n){let i=0;return n.status!=="all"&&(i+=1),n.scope!=="all"&&(i+=1),n.permission!=="all"&&(i+=1),i}function cE(n,i,r){var o,d,f,m;return!(i&&![n.name,...n.aliases||[],n.description,(o=n.descriptions)==null?void 0:o.en,(d=n.descriptions)==null?void 0:d.ar,n.usage,(f=n.usages)==null?void 0:f.en,(m=n.usages)==null?void 0:m.ar].filter(Boolean).join(" ").toLowerCase().includes(i)||r.status==="on"&&!n.enabled||r.status==="off"&&n.enabled||r.scope==="allChats"&&n.chat!=="all"||r.scope==="groups"&&n.chat!=="group"||r.scope==="private"&&n.chat!=="private"||r.scope==="groupSub"&&n.category!=="group"||r.scope==="general"&&n.category==="group"||r.permission==="overridden"&&!n.overridden||r.permission==="locked"&&!n.permissionLocked||r.permission!=="all"&&r.permission!=="overridden"&&r.permission!=="locked"&&n.permission!==r.permission)}function uE(n,i,r){const o=(f,m)=>r.compare(f.name,m.name),d=[...n];return i==="status"?d.sort((f,m)=>f.enabled===m.enabled?o(f,m):f.enabled?-1:1):d.sort(o),d}const dE=["MEMBERS","ADMINS_ONLY","ADMINS_OWNER","OWNER_ONLY"],fE=["s1","s2","s3","s4","s5"],mE=()=>{const{t:n,language:i}=Ue(),{toast:r}=Ct(),{permissionLabel:o}=qr(),[d,f]=y.useState([]),[m,p]=y.useState(dE),[h,b]=y.useState("!"),[x,v]=y.useState(!1),[S,A]=y.useState("!"),[k,N]=y.useState(""),[j,L]=y.useState(kb),[_,G]=y.useState("name"),[R,ne]=y.useState(!0),[U,M]=y.useState(null),[T,P]=y.useState(null),[O,J]=y.useState(null),Z=y.useCallback(async()=>{ne(!0);try{const Y=await $.getCommands();Y!=null&&Y.commands&&f(Y.commands),Y!=null&&Y.prefix&&(b(Y.prefix),A(Y.prefix)),Array.isArray(Y==null?void 0:Y.levels)&&Y.levels.length&&p(Y.levels),M(null)}catch(Y){M((Y==null?void 0:Y.message)||n("loadError")),r(Y.message,"error")}finally{ne(!1)}},[n,r]);y.useEffect(()=>{Z()},[Z]);const se=async()=>{const Y=S.trim();if(!Y||Y.length>3){r(n("prefixValidation"),"error");return}try{await $.updatePrefix(Y),b(Y),v(!1),r(`${n("prefixUpdated")} (${Y})`,"success")}catch(me){r(me.message,"error")}},E=async(Y,me)=>{f(te=>te.map(oe=>Fa(oe)===Fa(Y)?{...oe,enabled:me,overridden:!0}:oe));try{await $.updateCommand(Y.name,{enabled:me}),r(n(me?"commandEnabled":"commandDisabled").replace("{name}",Y.name),"success")}catch(te){r(te.message,"error"),Z()}},z=async(Y,me)=>{await $.updateCommand(Y.name,{permission:me}),f(te=>te.map(oe=>Fa(oe)===Fa(Y)?{...oe,permission:me,overridden:!0}:oe))},F=async Y=>{try{await navigator.clipboard.writeText(Y),r(n("copied"),"success")}catch{r(n("copyFailed"),"error")}},le=Y=>{P(me=>me===Y?null:Y)},pe=(Y,me)=>{f(te=>te.map(oe=>Fa(oe)===Fa(Y)?{...oe,aliases:me}:oe))},he=()=>{N(""),L(kb)},I=y.useMemo(()=>new Intl.Collator(i),[i]),ce=k.trim().toLowerCase(),ie=y.useMemo(()=>uE(d.filter(Y=>cE(Y,ce,j)),_,I),[d,ce,j,_,I]),fe=oE(j),C=ce.length>0||fe>0,K={onToggleEnabled:(Y,me)=>void E(Y,me),onEditAliases:Y=>J(Y),onSavePermission:z,onCopy:Y=>void F(Y)};return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsx(gl,{icon:s.jsx(fl,{size:20}),title:n("commands"),description:n("commandsSub"),actions:s.jsxs("div",{className:"inline-flex flex-wrap items-center gap-2 rounded-xl border border-line bg-panel-raised px-3 py-1.5",children:[s.jsxs("span",{className:"text-xs font-semibold text-muted",children:[n("activePrefix"),":"]}),x?s.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[s.jsx(Be,{type:"text",technical:!0,maxLength:3,value:S,onChange:Y=>A(Y.target.value),className:"w-14 text-center font-mono",onKeyDown:Y=>{Y.key==="Enter"&&se(),Y.key==="Escape"&&v(!1)}}),s.jsx(de,{variant:"primary",size:"sm",onClick:se,children:n("save")}),s.jsx(de,{variant:"secondary",size:"sm",onClick:()=>v(!1),children:n("cancel")})]}):s.jsx(de,{variant:"ghost",size:"sm",title:n("editPrefixHint"),onClick:()=>{A(h),v(!0)},children:s.jsx("span",{dir:"ltr",className:"font-mono",children:h})})]})}),s.jsxs("div",{className:"flex flex-col gap-3","data-tour":"commands-list",children:[s.jsxs(yl,{children:[s.jsxs("div",{className:"relative min-w-48 flex-1",children:[s.jsx(eh,{size:18,className:"pointer-events-none absolute start-3.5 top-3 text-muted"}),s.jsx(Be,{type:"search",value:k,onChange:Y=>N(Y.target.value),placeholder:n("searchPlaceholder"),"aria-label":n("searchPlaceholder"),className:"ps-10"})]}),s.jsx(Pr,{label:n("sort"),value:_,onChange:G,options:[{value:"name",label:n("sortByName")},{value:"status",label:n("sortStatus")}]}),s.jsxs(xl,{label:n("filter"),resetLabel:n("clearFilters"),activeCount:fe,onReset:he,children:[s.jsx(Sn,{label:n("filterStatus"),name:"cmd-status",value:j.status,onChange:Y=>L(me=>({...me,status:Y})),options:[{value:"all",label:n("statusAny")},{value:"on",label:n("statusEnabled")},{value:"off",label:n("statusDisabled")}]}),s.jsx(Sn,{label:n("filterScope"),name:"cmd-scope",value:j.scope,onChange:Y=>L(me=>({...me,scope:Y})),options:[{value:"all",label:n("statusAny")},{value:"allChats",label:n("scopeAllChats")},{value:"groups",label:n("scopeGroupsOnly")},{value:"private",label:n("scopePrivateOnly")},{value:"groupSub",label:n("scopeGroupSub")},{value:"general",label:n("scopeGeneral")}]}),s.jsx(Sn,{label:n("filterPermission"),name:"cmd-permission",value:j.permission,onChange:Y=>L(me=>({...me,permission:Y})),options:[{value:"all",label:n("statusAny")},...m.map(Y=>({value:Y,label:o(Y)})),{value:"overridden",label:n("overriddenOnly")},{value:"locked",label:n("lockedOnly")}]})]})]}),!R&&!U&&s.jsx("p",{"aria-live":"polite",className:"text-xs text-muted",children:Bt(n("resultCountOf"),{n:ie.length,total:d.length})})]}),R?s.jsx(Ze,{padded:!1,className:"overflow-hidden",children:s.jsx("div",{className:"divide-y divide-line/40","aria-busy":"true",children:fE.map(Y=>s.jsxs("div",{className:"flex min-h-12 items-center gap-3 px-4 py-2.5",children:[s.jsx(Gt,{className:"h-4 w-28"}),s.jsx(Gt,{className:"ms-auto h-4 w-14"}),s.jsx(Gt,{className:"h-8 w-10"})]},Y))})}):U&&d.length===0?s.jsx(mt,{kind:"error",description:U,action:s.jsx(de,{variant:"primary",onClick:()=>void Z(),children:n("retryLoad")})}):d.length===0?s.jsx(mt,{kind:"empty"}):ie.length===0?s.jsx(mt,{kind:"no-results",description:n("noMatchingCommands"),action:C?s.jsx(de,{variant:"secondary",onClick:he,children:n("clearFilters")}):void 0}):s.jsxs(Ze,{padded:!1,className:"overflow-hidden",children:[s.jsx("div",{className:"md:hidden",children:s.jsx(lE,{commands:ie,prefix:h,levels:m,expanded:T,onToggleDetails:le,actions:K})}),s.jsx("div",{className:"hidden md:block",children:s.jsx(rE,{commands:ie,prefix:h,levels:m,expanded:T,onToggleDetails:le,actions:K})})]}),s.jsx(sE,{command:O,prefix:h,onClose:()=>J(null),onSaved:pe})]})};var mi={},Jf,jb;function hE(){return jb||(jb=1,Jf=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Jf}var Wf={},js={},Nb;function bl(){if(Nb)return js;Nb=1;let n;const i=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return js.getSymbolSize=function(o){if(!o)throw new Error('"version" cannot be null or undefined');if(o<1||o>40)throw new Error('"version" should be in range from 1 to 40');return o*4+17},js.getSymbolTotalCodewords=function(o){return i[o]},js.getBCHDigit=function(r){let o=0;for(;r!==0;)o++,r>>>=1;return o},js.setToSJISFunction=function(o){if(typeof o!="function")throw new Error('"toSJISFunc" is not a valid function.');n=o},js.isKanjiModeEnabled=function(){return typeof n<"u"},js.toSJIS=function(o){return n(o)},js}var em={},Cb;function yh(){return Cb||(Cb=1,(function(n){n.L={bit:1},n.M={bit:0},n.Q={bit:3},n.H={bit:2};function i(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return n.L;case"m":case"medium":return n.M;case"q":case"quartile":return n.Q;case"h":case"high":return n.H;default:throw new Error("Unknown EC Level: "+r)}}n.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},n.from=function(o,d){if(n.isValid(o))return o;try{return i(o)}catch{return d}}})(em)),em}var tm,Eb;function pE(){if(Eb)return tm;Eb=1;function n(){this.buffer=[],this.length=0}return n.prototype={get:function(i){const r=Math.floor(i/8);return(this.buffer[r]>>>7-i%8&1)===1},put:function(i,r){for(let o=0;o<r;o++)this.putBit((i>>>r-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(i){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),i&&(this.buffer[r]|=128>>>this.length%8),this.length++}},tm=n,tm}var nm,Ab;function gE(){if(Ab)return nm;Ab=1;function n(i){if(!i||i<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=i,this.data=new Uint8Array(i*i),this.reservedBit=new Uint8Array(i*i)}return n.prototype.set=function(i,r,o,d){const f=i*this.size+r;this.data[f]=o,d&&(this.reservedBit[f]=!0)},n.prototype.get=function(i,r){return this.data[i*this.size+r]},n.prototype.xor=function(i,r,o){this.data[i*this.size+r]^=o},n.prototype.isReserved=function(i,r){return this.reservedBit[i*this.size+r]},nm=n,nm}var am={},Tb;function xE(){return Tb||(Tb=1,(function(n){const i=bl().getSymbolSize;n.getRowColCoords=function(o){if(o===1)return[];const d=Math.floor(o/7)+2,f=i(o),m=f===145?26:Math.ceil((f-13)/(2*d-2))*2,p=[f-7];for(let h=1;h<d-1;h++)p[h]=p[h-1]-m;return p.push(6),p.reverse()},n.getPositions=function(o){const d=[],f=n.getRowColCoords(o),m=f.length;for(let p=0;p<m;p++)for(let h=0;h<m;h++)p===0&&h===0||p===0&&h===m-1||p===m-1&&h===0||d.push([f[p],f[h]]);return d}})(am)),am}var sm={},_b;function yE(){if(_b)return sm;_b=1;const n=bl().getSymbolSize,i=7;return sm.getPositions=function(o){const d=n(o);return[[0,0],[d-i,0],[0,d-i]]},sm}var lm={},Db;function bE(){return Db||(Db=1,(function(n){n.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const i={N1:3,N2:3,N3:40,N4:10};n.isValid=function(d){return d!=null&&d!==""&&!isNaN(d)&&d>=0&&d<=7},n.from=function(d){return n.isValid(d)?parseInt(d,10):void 0},n.getPenaltyN1=function(d){const f=d.size;let m=0,p=0,h=0,b=null,x=null;for(let v=0;v<f;v++){p=h=0,b=x=null;for(let S=0;S<f;S++){let A=d.get(v,S);A===b?p++:(p>=5&&(m+=i.N1+(p-5)),b=A,p=1),A=d.get(S,v),A===x?h++:(h>=5&&(m+=i.N1+(h-5)),x=A,h=1)}p>=5&&(m+=i.N1+(p-5)),h>=5&&(m+=i.N1+(h-5))}return m},n.getPenaltyN2=function(d){const f=d.size;let m=0;for(let p=0;p<f-1;p++)for(let h=0;h<f-1;h++){const b=d.get(p,h)+d.get(p,h+1)+d.get(p+1,h)+d.get(p+1,h+1);(b===4||b===0)&&m++}return m*i.N2},n.getPenaltyN3=function(d){const f=d.size;let m=0,p=0,h=0;for(let b=0;b<f;b++){p=h=0;for(let x=0;x<f;x++)p=p<<1&2047|d.get(b,x),x>=10&&(p===1488||p===93)&&m++,h=h<<1&2047|d.get(x,b),x>=10&&(h===1488||h===93)&&m++}return m*i.N3},n.getPenaltyN4=function(d){let f=0;const m=d.data.length;for(let h=0;h<m;h++)f+=d.data[h];return Math.abs(Math.ceil(f*100/m/5)-10)*i.N4};function r(o,d,f){switch(o){case n.Patterns.PATTERN000:return(d+f)%2===0;case n.Patterns.PATTERN001:return d%2===0;case n.Patterns.PATTERN010:return f%3===0;case n.Patterns.PATTERN011:return(d+f)%3===0;case n.Patterns.PATTERN100:return(Math.floor(d/2)+Math.floor(f/3))%2===0;case n.Patterns.PATTERN101:return d*f%2+d*f%3===0;case n.Patterns.PATTERN110:return(d*f%2+d*f%3)%2===0;case n.Patterns.PATTERN111:return(d*f%3+(d+f)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}n.applyMask=function(d,f){const m=f.size;for(let p=0;p<m;p++)for(let h=0;h<m;h++)f.isReserved(h,p)||f.xor(h,p,r(d,h,p))},n.getBestMask=function(d,f){const m=Object.keys(n.Patterns).length;let p=0,h=1/0;for(let b=0;b<m;b++){f(b),n.applyMask(b,d);const x=n.getPenaltyN1(d)+n.getPenaltyN2(d)+n.getPenaltyN3(d)+n.getPenaltyN4(d);n.applyMask(b,d),x<h&&(h=x,p=b)}return p}})(lm)),lm}var wc={},Mb;function Y1(){if(Mb)return wc;Mb=1;const n=yh(),i=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return wc.getBlocksCount=function(d,f){switch(f){case n.L:return i[(d-1)*4+0];case n.M:return i[(d-1)*4+1];case n.Q:return i[(d-1)*4+2];case n.H:return i[(d-1)*4+3];default:return}},wc.getTotalCodewordsCount=function(d,f){switch(f){case n.L:return r[(d-1)*4+0];case n.M:return r[(d-1)*4+1];case n.Q:return r[(d-1)*4+2];case n.H:return r[(d-1)*4+3];default:return}},wc}var im={},Nr={},Rb;function vE(){if(Rb)return Nr;Rb=1;const n=new Uint8Array(512),i=new Uint8Array(256);return(function(){let o=1;for(let d=0;d<255;d++)n[d]=o,i[o]=d,o<<=1,o&256&&(o^=285);for(let d=255;d<512;d++)n[d]=n[d-255]})(),Nr.log=function(o){if(o<1)throw new Error("log("+o+")");return i[o]},Nr.exp=function(o){return n[o]},Nr.mul=function(o,d){return o===0||d===0?0:n[i[o]+i[d]]},Nr}var zb;function wE(){return zb||(zb=1,(function(n){const i=vE();n.mul=function(o,d){const f=new Uint8Array(o.length+d.length-1);for(let m=0;m<o.length;m++)for(let p=0;p<d.length;p++)f[m+p]^=i.mul(o[m],d[p]);return f},n.mod=function(o,d){let f=new Uint8Array(o);for(;f.length-d.length>=0;){const m=f[0];for(let h=0;h<d.length;h++)f[h]^=i.mul(d[h],m);let p=0;for(;p<f.length&&f[p]===0;)p++;f=f.slice(p)}return f},n.generateECPolynomial=function(o){let d=new Uint8Array([1]);for(let f=0;f<o;f++)d=n.mul(d,new Uint8Array([1,i.exp(f)]));return d}})(im)),im}var rm,Lb;function SE(){if(Lb)return rm;Lb=1;const n=wE();function i(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return i.prototype.initialize=function(o){this.degree=o,this.genPoly=n.generateECPolynomial(this.degree)},i.prototype.encode=function(o){if(!this.genPoly)throw new Error("Encoder not initialized");const d=new Uint8Array(o.length+this.degree);d.set(o);const f=n.mod(d,this.genPoly),m=this.degree-f.length;if(m>0){const p=new Uint8Array(this.degree);return p.set(f,m),p}return f},rm=i,rm}var om={},cm={},um={},Ob;function Q1(){return Ob||(Ob=1,um.isValid=function(i){return!isNaN(i)&&i>=1&&i<=40}),um}var ya={},Bb;function X1(){if(Bb)return ya;Bb=1;const n="[0-9]+",i="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const o="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r
548
- ]))+`;ya.KANJI=new RegExp(r,"g"),ya.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),ya.BYTE=new RegExp(o,"g"),ya.NUMERIC=new RegExp(n,"g"),ya.ALPHANUMERIC=new RegExp(i,"g");const d=new RegExp("^"+r+"$"),f=new RegExp("^"+n+"$"),m=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return ya.testKanji=function(h){return d.test(h)},ya.testNumeric=function(h){return f.test(h)},ya.testAlphanumeric=function(h){return m.test(h)},ya}var Ub;function vl(){return Ub||(Ub=1,(function(n){const i=Q1(),r=X1();n.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},n.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},n.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},n.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},n.MIXED={bit:-1},n.getCharCountIndicator=function(f,m){if(!f.ccBits)throw new Error("Invalid mode: "+f);if(!i.isValid(m))throw new Error("Invalid version: "+m);return m>=1&&m<10?f.ccBits[0]:m<27?f.ccBits[1]:f.ccBits[2]},n.getBestModeForData=function(f){return r.testNumeric(f)?n.NUMERIC:r.testAlphanumeric(f)?n.ALPHANUMERIC:r.testKanji(f)?n.KANJI:n.BYTE},n.toString=function(f){if(f&&f.id)return f.id;throw new Error("Invalid mode")},n.isValid=function(f){return f&&f.bit&&f.ccBits};function o(d){if(typeof d!="string")throw new Error("Param is not a string");switch(d.toLowerCase()){case"numeric":return n.NUMERIC;case"alphanumeric":return n.ALPHANUMERIC;case"kanji":return n.KANJI;case"byte":return n.BYTE;default:throw new Error("Unknown mode: "+d)}}n.from=function(f,m){if(n.isValid(f))return f;try{return o(f)}catch{return m}}})(cm)),cm}var Hb;function kE(){return Hb||(Hb=1,(function(n){const i=bl(),r=Y1(),o=yh(),d=vl(),f=Q1(),m=7973,p=i.getBCHDigit(m);function h(S,A,k){for(let N=1;N<=40;N++)if(A<=n.getCapacity(N,k,S))return N}function b(S,A){return d.getCharCountIndicator(S,A)+4}function x(S,A){let k=0;return S.forEach(function(N){const j=b(N.mode,A);k+=j+N.getBitsLength()}),k}function v(S,A){for(let k=1;k<=40;k++)if(x(S,k)<=n.getCapacity(k,A,d.MIXED))return k}n.from=function(A,k){return f.isValid(A)?parseInt(A,10):k},n.getCapacity=function(A,k,N){if(!f.isValid(A))throw new Error("Invalid QR Code version");typeof N>"u"&&(N=d.BYTE);const j=i.getSymbolTotalCodewords(A),L=r.getTotalCodewordsCount(A,k),_=(j-L)*8;if(N===d.MIXED)return _;const G=_-b(N,A);switch(N){case d.NUMERIC:return Math.floor(G/10*3);case d.ALPHANUMERIC:return Math.floor(G/11*2);case d.KANJI:return Math.floor(G/13);case d.BYTE:default:return Math.floor(G/8)}},n.getBestVersionForData=function(A,k){let N;const j=o.from(k,o.M);if(Array.isArray(A)){if(A.length>1)return v(A,j);if(A.length===0)return 1;N=A[0]}else N=A;return h(N.mode,N.getLength(),j)},n.getEncodedBits=function(A){if(!f.isValid(A)||A<7)throw new Error("Invalid QR Code version");let k=A<<12;for(;i.getBCHDigit(k)-p>=0;)k^=m<<i.getBCHDigit(k)-p;return A<<12|k}})(om)),om}var dm={},Pb;function jE(){if(Pb)return dm;Pb=1;const n=bl(),i=1335,r=21522,o=n.getBCHDigit(i);return dm.getEncodedBits=function(f,m){const p=f.bit<<3|m;let h=p<<10;for(;n.getBCHDigit(h)-o>=0;)h^=i<<n.getBCHDigit(h)-o;return(p<<10|h)^r},dm}var fm={},mm,qb;function NE(){if(qb)return mm;qb=1;const n=vl();function i(r){this.mode=n.NUMERIC,this.data=r.toString()}return i.getBitsLength=function(o){return 10*Math.floor(o/3)+(o%3?o%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(o){let d,f,m;for(d=0;d+3<=this.data.length;d+=3)f=this.data.substr(d,3),m=parseInt(f,10),o.put(m,10);const p=this.data.length-d;p>0&&(f=this.data.substr(d),m=parseInt(f,10),o.put(m,p*3+1))},mm=i,mm}var hm,Fb;function CE(){if(Fb)return hm;Fb=1;const n=vl(),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(o){this.mode=n.ALPHANUMERIC,this.data=o}return r.getBitsLength=function(d){return 11*Math.floor(d/2)+6*(d%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(d){let f;for(f=0;f+2<=this.data.length;f+=2){let m=i.indexOf(this.data[f])*45;m+=i.indexOf(this.data[f+1]),d.put(m,11)}this.data.length%2&&d.put(i.indexOf(this.data[f]),6)},hm=r,hm}var pm,Gb;function EE(){if(Gb)return pm;Gb=1;const n=vl();function i(r){this.mode=n.BYTE,typeof r=="string"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return i.getBitsLength=function(o){return o*8},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(r){for(let o=0,d=this.data.length;o<d;o++)r.put(this.data[o],8)},pm=i,pm}var gm,Ib;function AE(){if(Ib)return gm;Ib=1;const n=vl(),i=bl();function r(o){this.mode=n.KANJI,this.data=o}return r.getBitsLength=function(d){return d*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(o){let d;for(d=0;d<this.data.length;d++){let f=i.toSJIS(this.data[d]);if(f>=33088&&f<=40956)f-=33088;else if(f>=57408&&f<=60351)f-=49472;else throw new Error("Invalid SJIS character: "+this.data[d]+`
549
- Make sure your charset is UTF-8`);f=(f>>>8&255)*192+(f&255),o.put(f,13)}},gm=r,gm}var xm={exports:{}},Vb;function TE(){return Vb||(Vb=1,(function(n){var i={single_source_shortest_paths:function(r,o,d){var f={},m={};m[o]=0;var p=i.PriorityQueue.make();p.push(o,0);for(var h,b,x,v,S,A,k,N,j;!p.empty();){h=p.pop(),b=h.value,v=h.cost,S=r[b]||{};for(x in S)S.hasOwnProperty(x)&&(A=S[x],k=v+A,N=m[x],j=typeof m[x]>"u",(j||N>k)&&(m[x]=k,p.push(x,k),f[x]=b))}if(typeof d<"u"&&typeof m[d]>"u"){var L=["Could not find a path from ",o," to ",d,"."].join("");throw new Error(L)}return f},extract_shortest_path_from_predecessor_list:function(r,o){for(var d=[],f=o;f;)d.push(f),r[f],f=r[f];return d.reverse(),d},find_path:function(r,o,d){var f=i.single_source_shortest_paths(r,o,d);return i.extract_shortest_path_from_predecessor_list(f,d)},PriorityQueue:{make:function(r){var o=i.PriorityQueue,d={},f;r=r||{};for(f in o)o.hasOwnProperty(f)&&(d[f]=o[f]);return d.queue=[],d.sorter=r.sorter||o.default_sorter,d},default_sorter:function(r,o){return r.cost-o.cost},push:function(r,o){var d={value:r,cost:o};this.queue.push(d),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};n.exports=i})(xm)),xm.exports}var Kb;function _E(){return Kb||(Kb=1,(function(n){const i=vl(),r=NE(),o=CE(),d=EE(),f=AE(),m=X1(),p=bl(),h=TE();function b(L){return unescape(encodeURIComponent(L)).length}function x(L,_,G){const R=[];let ne;for(;(ne=L.exec(G))!==null;)R.push({data:ne[0],index:ne.index,mode:_,length:ne[0].length});return R}function v(L){const _=x(m.NUMERIC,i.NUMERIC,L),G=x(m.ALPHANUMERIC,i.ALPHANUMERIC,L);let R,ne;return p.isKanjiModeEnabled()?(R=x(m.BYTE,i.BYTE,L),ne=x(m.KANJI,i.KANJI,L)):(R=x(m.BYTE_KANJI,i.BYTE,L),ne=[]),_.concat(G,R,ne).sort(function(M,T){return M.index-T.index}).map(function(M){return{data:M.data,mode:M.mode,length:M.length}})}function S(L,_){switch(_){case i.NUMERIC:return r.getBitsLength(L);case i.ALPHANUMERIC:return o.getBitsLength(L);case i.KANJI:return f.getBitsLength(L);case i.BYTE:return d.getBitsLength(L)}}function A(L){return L.reduce(function(_,G){const R=_.length-1>=0?_[_.length-1]:null;return R&&R.mode===G.mode?(_[_.length-1].data+=G.data,_):(_.push(G),_)},[])}function k(L){const _=[];for(let G=0;G<L.length;G++){const R=L[G];switch(R.mode){case i.NUMERIC:_.push([R,{data:R.data,mode:i.ALPHANUMERIC,length:R.length},{data:R.data,mode:i.BYTE,length:R.length}]);break;case i.ALPHANUMERIC:_.push([R,{data:R.data,mode:i.BYTE,length:R.length}]);break;case i.KANJI:_.push([R,{data:R.data,mode:i.BYTE,length:b(R.data)}]);break;case i.BYTE:_.push([{data:R.data,mode:i.BYTE,length:b(R.data)}])}}return _}function N(L,_){const G={},R={start:{}};let ne=["start"];for(let U=0;U<L.length;U++){const M=L[U],T=[];for(let P=0;P<M.length;P++){const O=M[P],J=""+U+P;T.push(J),G[J]={node:O,lastCount:0},R[J]={};for(let Z=0;Z<ne.length;Z++){const se=ne[Z];G[se]&&G[se].node.mode===O.mode?(R[se][J]=S(G[se].lastCount+O.length,O.mode)-S(G[se].lastCount,O.mode),G[se].lastCount+=O.length):(G[se]&&(G[se].lastCount=O.length),R[se][J]=S(O.length,O.mode)+4+i.getCharCountIndicator(O.mode,_))}}ne=T}for(let U=0;U<ne.length;U++)R[ne[U]].end=0;return{map:R,table:G}}function j(L,_){let G;const R=i.getBestModeForData(L);if(G=i.from(_,R),G!==i.BYTE&&G.bit<R.bit)throw new Error('"'+L+'" cannot be encoded with mode '+i.toString(G)+`.
550
- Suggested mode is: `+i.toString(R));switch(G===i.KANJI&&!p.isKanjiModeEnabled()&&(G=i.BYTE),G){case i.NUMERIC:return new r(L);case i.ALPHANUMERIC:return new o(L);case i.KANJI:return new f(L);case i.BYTE:return new d(L)}}n.fromArray=function(_){return _.reduce(function(G,R){return typeof R=="string"?G.push(j(R,null)):R.data&&G.push(j(R.data,R.mode)),G},[])},n.fromString=function(_,G){const R=v(_,p.isKanjiModeEnabled()),ne=k(R),U=N(ne,G),M=h.find_path(U.map,"start","end"),T=[];for(let P=1;P<M.length-1;P++)T.push(U.table[M[P]].node);return n.fromArray(A(T))},n.rawSplit=function(_){return n.fromArray(v(_,p.isKanjiModeEnabled()))}})(fm)),fm}var Yb;function DE(){if(Yb)return Wf;Yb=1;const n=bl(),i=yh(),r=pE(),o=gE(),d=xE(),f=yE(),m=bE(),p=Y1(),h=SE(),b=kE(),x=jE(),v=vl(),S=_E();function A(U,M){const T=U.size,P=f.getPositions(M);for(let O=0;O<P.length;O++){const J=P[O][0],Z=P[O][1];for(let se=-1;se<=7;se++)if(!(J+se<=-1||T<=J+se))for(let E=-1;E<=7;E++)Z+E<=-1||T<=Z+E||(se>=0&&se<=6&&(E===0||E===6)||E>=0&&E<=6&&(se===0||se===6)||se>=2&&se<=4&&E>=2&&E<=4?U.set(J+se,Z+E,!0,!0):U.set(J+se,Z+E,!1,!0))}}function k(U){const M=U.size;for(let T=8;T<M-8;T++){const P=T%2===0;U.set(T,6,P,!0),U.set(6,T,P,!0)}}function N(U,M){const T=d.getPositions(M);for(let P=0;P<T.length;P++){const O=T[P][0],J=T[P][1];for(let Z=-2;Z<=2;Z++)for(let se=-2;se<=2;se++)Z===-2||Z===2||se===-2||se===2||Z===0&&se===0?U.set(O+Z,J+se,!0,!0):U.set(O+Z,J+se,!1,!0)}}function j(U,M){const T=U.size,P=b.getEncodedBits(M);let O,J,Z;for(let se=0;se<18;se++)O=Math.floor(se/3),J=se%3+T-8-3,Z=(P>>se&1)===1,U.set(O,J,Z,!0),U.set(J,O,Z,!0)}function L(U,M,T){const P=U.size,O=x.getEncodedBits(M,T);let J,Z;for(J=0;J<15;J++)Z=(O>>J&1)===1,J<6?U.set(J,8,Z,!0):J<8?U.set(J+1,8,Z,!0):U.set(P-15+J,8,Z,!0),J<8?U.set(8,P-J-1,Z,!0):J<9?U.set(8,15-J-1+1,Z,!0):U.set(8,15-J-1,Z,!0);U.set(P-8,8,1,!0)}function _(U,M){const T=U.size;let P=-1,O=T-1,J=7,Z=0;for(let se=T-1;se>0;se-=2)for(se===6&&se--;;){for(let E=0;E<2;E++)if(!U.isReserved(O,se-E)){let z=!1;Z<M.length&&(z=(M[Z]>>>J&1)===1),U.set(O,se-E,z),J--,J===-1&&(Z++,J=7)}if(O+=P,O<0||T<=O){O-=P,P=-P;break}}}function G(U,M,T){const P=new r;T.forEach(function(E){P.put(E.mode.bit,4),P.put(E.getLength(),v.getCharCountIndicator(E.mode,U)),E.write(P)});const O=n.getSymbolTotalCodewords(U),J=p.getTotalCodewordsCount(U,M),Z=(O-J)*8;for(P.getLengthInBits()+4<=Z&&P.put(0,4);P.getLengthInBits()%8!==0;)P.putBit(0);const se=(Z-P.getLengthInBits())/8;for(let E=0;E<se;E++)P.put(E%2?17:236,8);return R(P,U,M)}function R(U,M,T){const P=n.getSymbolTotalCodewords(M),O=p.getTotalCodewordsCount(M,T),J=P-O,Z=p.getBlocksCount(M,T),se=P%Z,E=Z-se,z=Math.floor(P/Z),F=Math.floor(J/Z),le=F+1,pe=z-F,he=new h(pe);let I=0;const ce=new Array(Z),ie=new Array(Z);let fe=0;const C=new Uint8Array(U.buffer);for(let oe=0;oe<Z;oe++){const ve=oe<E?F:le;ce[oe]=C.slice(I,I+ve),ie[oe]=he.encode(ce[oe]),I+=ve,fe=Math.max(fe,ve)}const K=new Uint8Array(P);let Y=0,me,te;for(me=0;me<fe;me++)for(te=0;te<Z;te++)me<ce[te].length&&(K[Y++]=ce[te][me]);for(me=0;me<pe;me++)for(te=0;te<Z;te++)K[Y++]=ie[te][me];return K}function ne(U,M,T,P){let O;if(Array.isArray(U))O=S.fromArray(U);else if(typeof U=="string"){let z=M;if(!z){const F=S.rawSplit(U);z=b.getBestVersionForData(F,T)}O=S.fromString(U,z||40)}else throw new Error("Invalid data");const J=b.getBestVersionForData(O,T);if(!J)throw new Error("The amount of data is too big to be stored in a QR Code");if(!M)M=J;else if(M<J)throw new Error(`
551
- The chosen QR Code version cannot contain this amount of data.
552
- Minimum version required to store current data is: `+J+`.
553
- `);const Z=G(M,T,O),se=n.getSymbolSize(M),E=new o(se);return A(E,M),k(E),N(E,M),L(E,T,0),M>=7&&j(E,M),_(E,Z),isNaN(P)&&(P=m.getBestMask(E,L.bind(null,E,T))),m.applyMask(P,E),L(E,T,P),{modules:E,version:M,errorCorrectionLevel:T,maskPattern:P,segments:O}}return Wf.create=function(M,T){if(typeof M>"u"||M==="")throw new Error("No input text");let P=i.M,O,J;return typeof T<"u"&&(P=i.from(T.errorCorrectionLevel,i.M),O=b.from(T.version),J=m.from(T.maskPattern),T.toSJISFunc&&n.setToSJISFunction(T.toSJISFunc)),ne(M,O,P,J)},Wf}var ym={},bm={},Qb;function Z1(){return Qb||(Qb=1,(function(n){function i(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let o=r.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+r);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(f){return[f,f]}))),o.length===6&&o.push("F","F");const d=parseInt(o.join(""),16);return{r:d>>24&255,g:d>>16&255,b:d>>8&255,a:d&255,hex:"#"+o.slice(0,6).join("")}}n.getOptions=function(o){o||(o={}),o.color||(o.color={});const d=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,f=o.width&&o.width>=21?o.width:void 0,m=o.scale||4;return{width:f,scale:f?4:m,margin:d,color:{dark:i(o.color.dark||"#000000ff"),light:i(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},n.getScale=function(o,d){return d.width&&d.width>=o+d.margin*2?d.width/(o+d.margin*2):d.scale},n.getImageWidth=function(o,d){const f=n.getScale(o,d);return Math.floor((o+d.margin*2)*f)},n.qrToImageData=function(o,d,f){const m=d.modules.size,p=d.modules.data,h=n.getScale(m,f),b=Math.floor((m+f.margin*2)*h),x=f.margin*h,v=[f.color.light,f.color.dark];for(let S=0;S<b;S++)for(let A=0;A<b;A++){let k=(S*b+A)*4,N=f.color.light;if(S>=x&&A>=x&&S<b-x&&A<b-x){const j=Math.floor((S-x)/h),L=Math.floor((A-x)/h);N=v[p[j*m+L]?1:0]}o[k++]=N.r,o[k++]=N.g,o[k++]=N.b,o[k]=N.a}}})(bm)),bm}var Xb;function ME(){return Xb||(Xb=1,(function(n){const i=Z1();function r(d,f,m){d.clearRect(0,0,f.width,f.height),f.style||(f.style={}),f.height=m,f.width=m,f.style.height=m+"px",f.style.width=m+"px"}function o(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}n.render=function(f,m,p){let h=p,b=m;typeof h>"u"&&(!m||!m.getContext)&&(h=m,m=void 0),m||(b=o()),h=i.getOptions(h);const x=i.getImageWidth(f.modules.size,h),v=b.getContext("2d"),S=v.createImageData(x,x);return i.qrToImageData(S.data,f,h),r(v,b,x),v.putImageData(S,0,0),b},n.renderToDataURL=function(f,m,p){let h=p;typeof h>"u"&&(!m||!m.getContext)&&(h=m,m=void 0),h||(h={});const b=n.render(f,m,h),x=h.type||"image/png",v=h.rendererOpts||{};return b.toDataURL(x,v.quality)}})(ym)),ym}var vm={},Zb;function RE(){if(Zb)return vm;Zb=1;const n=Z1();function i(d,f){const m=d.a/255,p=f+'="'+d.hex+'"';return m<1?p+" "+f+'-opacity="'+m.toFixed(2).slice(1)+'"':p}function r(d,f,m){let p=d+f;return typeof m<"u"&&(p+=" "+m),p}function o(d,f,m){let p="",h=0,b=!1,x=0;for(let v=0;v<d.length;v++){const S=Math.floor(v%f),A=Math.floor(v/f);!S&&!b&&(b=!0),d[v]?(x++,v>0&&S>0&&d[v-1]||(p+=b?r("M",S+m,.5+A+m):r("m",h,0),h=0,b=!1),S+1<f&&d[v+1]||(p+=r("h",x),x=0)):h++}return p}return vm.render=function(f,m,p){const h=n.getOptions(m),b=f.modules.size,x=f.modules.data,v=b+h.margin*2,S=h.color.light.a?"<path "+i(h.color.light,"fill")+' d="M0 0h'+v+"v"+v+'H0z"/>':"",A="<path "+i(h.color.dark,"stroke")+' d="'+o(x,b,h.margin)+'"/>',k='viewBox="0 0 '+v+" "+v+'"',j='<svg xmlns="http://www.w3.org/2000/svg" '+(h.width?'width="'+h.width+'" height="'+h.width+'" ':"")+k+' shape-rendering="crispEdges">'+S+A+`</svg>
554
- `;return typeof p=="function"&&p(null,j),j},vm}var $b;function zE(){if($b)return mi;$b=1;const n=hE(),i=DE(),r=ME(),o=RE();function d(f,m,p,h,b){const x=[].slice.call(arguments,1),v=x.length,S=typeof x[v-1]=="function";if(!S&&!n())throw new Error("Callback required as last argument");if(S){if(v<2)throw new Error("Too few arguments provided");v===2?(b=p,p=m,m=h=void 0):v===3&&(m.getContext&&typeof b>"u"?(b=h,h=void 0):(b=h,h=p,p=m,m=void 0))}else{if(v<1)throw new Error("Too few arguments provided");return v===1?(p=m,m=h=void 0):v===2&&!m.getContext&&(h=p,p=m,m=void 0),new Promise(function(A,k){try{const N=i.create(p,h);A(f(N,m,h))}catch(N){k(N)}})}try{const A=i.create(p,h);b(null,f(A,m,h))}catch(A){b(A)}}return mi.create=i.create,mi.toCanvas=d.bind(null,r.render),mi.toDataURL=d.bind(null,r.renderToDataURL),mi.toString=d.bind(null,function(f,m,p){return o.render(f,p)}),mi}var $1=zE();const wm=$m($1);function LE(){return typeof window<"u"&&!!window.LevixHost}const OE=({status:n,onRefresh:i,onStatusUpdate:r})=>{var te;const{t:o,language:d}=Ue(),{toast:f}=Ct(),[m,p]=y.useState(!1),[h,b]=y.useState(!1),[x,v]=y.useState(null),[S,A]=y.useState("pairing"),[k,N]=y.useState(""),[j,L]=y.useState(!1),_=(n==null?void 0:n.state)||"idle",G=_==="connected",R=_==="waiting_for_qr",ne=_==="starting"||_==="linking",U=_==="reconnecting",M=_==="paused",T=_==="logged_out",P=!!(n!=null&&n.linked)&&!T,O=!P,J=!!(n!=null&&n.canUnlink),Z=(n==null?void 0:n.isOnline)!==!1,se=M||_==="disconnected"||_==="retry_exhausted"?d==="ar"?"استئناف الجلسة":"Resume session":d==="ar"?"الاتصال":"Connect";y.useEffect(()=>{if(n!=null&&n.qr){const oe=$1.toDataURL||(wm==null?void 0:wm.toDataURL);if(typeof oe=="function"){const ve=getComputedStyle(document.documentElement),be=document.documentElement.getAttribute("data-theme")==="light",Se=(be?ve.getPropertyValue("--text"):ve.getPropertyValue("--bg")).trim(),it=(be?ve.getPropertyValue("--panel"):ve.getPropertyValue("--text")).trim();oe(n.qr,{width:280,margin:2,color:{dark:Se,light:it}}).then(xt=>v(xt)).catch(()=>v(null))}}else v(null)},[n==null?void 0:n.qr]),y.useEffect(()=>{if(R&&!(n!=null&&n.qr)&&!(n!=null&&n.pairingCode)){const oe=setInterval(()=>{i==null||i()},1500);return()=>clearInterval(oe)}},[R,n==null?void 0:n.qr,n==null?void 0:n.pairingCode,i]);const E=async(oe,ve)=>{b(!0);try{const be=await oe();be&&typeof be=="object"&&"session"in be&&(r==null||r(be.session)),f(ve,"success"),await(i==null?void 0:i())}catch(be){f(be instanceof Error?be.message:String(be),"error")}finally{b(!1)}},z=async oe=>{oe&&oe.preventDefault();const ve=k.replace(/\D/g,"");if(!ve){f(d==="ar"?"يرجى إدخال رقم الهاتف مع كود الدولة أولاً.":"Please enter your phone number with country code.","error");return}if(ve.startsWith("0")){f(d==="ar"?"يرجى حذف الصفر في البداية وكتابة كود الدولة (مثلاً: 2010... وليس 010...)":"Drop the leading 0 and include the country code (e.g. 2010... not 010...).","error");return}await E(()=>$.startSession({method:"pairing",phone:ve}),d==="ar"?"جارٍ طلب رمز الربط من واتساب...":"Requesting pairing code...")},F=async()=>{await E(()=>$.startSession({method:"qr"}),d==="ar"?"جارٍ بدء الاتصال برمز QR...":"Starting QR code connection...")},le=async()=>{await E($.stopSession,d==="ar"?"تم الإلغاء، أدخل رقم هاتفك":"Cancelled, enter your phone number"),A("pairing")},pe=()=>{n!=null&&n.pairingCode&&(navigator.clipboard.writeText(n.pairingCode.replace(/\s+/g,"")),L(!0),f(d==="ar"?"تم نسخ كود الربط!":"Pairing code copied!","success"),setTimeout(()=>L(!1),2500))},he=async()=>{p(!1),await E($.unlinkSession,d==="ar"?"تم إلغاء ربط الجلسة بنجاح":"Session unlinked successfully.")},I=(te=n==null?void 0:n.user)!=null&&te.id?n.user.id.split("@")[0].split(":")[0]:null,ce=LE(),ie={key:"unlink",label:o("unlink"),icon:s.jsx(rj,{size:16}),danger:!0,onSelect:()=>p(!0)},fe={key:"restart",label:o("restart"),icon:s.jsx(dl,{size:16}),onSelect:()=>E($.restartBot,o("restart"))},C={key:"reconnect",label:o("reconnect"),icon:s.jsx(Ga,{size:16}),onSelect:()=>E($.reconnectSession,o("reconnecting"))},K=oe=>ce?oe:[...oe,fe],Y=K(J?[ie]:[]),me=oe=>{if(oe.length===0)return null;if(oe.length===1){const ve=oe[0];return s.jsx(Oe,{label:ve.label,icon:ve.icon,onClick:ve.onSelect,disabled:h})}return s.jsx(Yn,{label:o("moreActions"),children:oe.map(ve=>s.jsx(lt,{danger:ve.danger,icon:ve.icon,disabled:h,onSelect:ve.onSelect,children:ve.label},ve.key))})};return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsxs(Ze,{className:"flex flex-col gap-5",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 pb-4 border-b border-line",children:[s.jsxs("div",{className:"flex items-center gap-3.5",children:[s.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center shrink-0 border ${G?"bg-ok/15 text-ok border-ok/30 shadow-sm shadow-ok/20":R?"bg-warn/15 text-warn border-warn/30 shadow-sm shadow-warn/20":ne||U?"bg-brand-blue/15 text-brand-blue border-brand-blue/30 shadow-sm shadow-brand-blue/20":"bg-info/15 text-info border-info/30 shadow-sm shadow-info/20"}`,children:s.jsx(Or,{size:24})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg sm:text-xl font-extrabold text-text-main",children:o("connection")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5",children:G?o("sessionActive"):M?o("paused"):P?d==="ar"?"جلسة محفوظة — يمكن استئنافها":"Saved session — ready to resume":o("sessionOffline")})]})]}),s.jsx("div",{className:"flex items-center gap-3 self-start sm:self-auto",children:s.jsxs("span",{className:`inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full text-xs font-bold border ${G?"bg-ok/15 text-ok border-ok/30":R?"bg-warn/15 text-warn border-warn/30":ne||U?"bg-brand-blue/15 text-brand-blue border-brand-blue/30 animate-pulse":"bg-brand-cyan/15 text-brand-cyan border-brand-cyan/30"}`,children:[s.jsx("span",{className:"pulse-dot"}),s.jsx("span",{children:o(_,_)})]})})]}),n!=null&&n.retryInSeconds?s.jsxs("div",{className:"rounded-xl border border-warn/30 bg-warn/10 p-3.5 flex items-center gap-3 text-warn",children:[s.jsx(ll,{size:20,className:"shrink-0"}),s.jsxs("div",{className:"text-xs sm:text-sm",children:[s.jsx("span",{className:"font-bold",children:d==="ar"?"إعادة الاتصال قريباً":"Reconnecting soon"})," ","•"," ",s.jsx("span",{children:d==="ar"?`المحاولة التالية خلال ${n.retryInSeconds} ثانية`:`Next attempt in ${n.retryInSeconds}s`})]})]}):null,G&&I&&s.jsxs("div",{className:"rounded-xl border border-ok/30 bg-ok/10 p-3.5 sm:p-4 flex items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-ok/20 text-ok flex items-center justify-center shrink-0",children:s.jsx(Cs,{size:20})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-xs text-muted font-medium",children:o("connectedNumber")}),s.jsxs("div",{className:"text-sm sm:text-base font-mono font-bold text-text-main",dir:"ltr",children:["+",I]})]})]}),s.jsx(Nc,{tone:"ok",className:"shrink-0",children:d==="ar"?"متصل":"Online"})]}),s.jsxs("div",{children:[G&&s.jsxs("div",{className:"flex w-full items-center gap-2.5",children:[s.jsx(de,{variant:"danger",icon:s.jsx(Lm,{size:16}),onClick:()=>E($.stopSession,o("stop")),disabled:h,className:"flex-1 sm:flex-none",children:o("stop")}),me(K([C,ie]))]}),(ne||R||U)&&s.jsxs("div",{className:"flex w-full items-center gap-2.5",children:[s.jsx(de,{variant:"danger",icon:s.jsx(Lm,{size:16}),onClick:()=>E($.stopSession,o("stop")),disabled:h,className:"flex-1 sm:flex-none",children:d==="ar"?"إلغاء المحاولة":"Cancel Attempt"}),me(K([]))]}),!G&&!ne&&!R&&!U&&P&&s.jsxs("div",{className:"flex flex-col gap-3 w-full max-w-xl",children:[M&&s.jsx("p",{className:"text-xs sm:text-sm text-muted leading-relaxed",children:Z?d==="ar"?"الجلسة محفوظة. اضغط استئناف لإعادة استخدام نفس حساب واتساب.":"This WhatsApp session is saved. Resume to reconnect with the same account.":d==="ar"?"الاتصال متوقف بسبب انقطاع الإنترنت. سيُستأنف تلقائياً عند عودة الشبكة، أو اضغط استئناف.":"Paused while the device is offline. It will resume when the network returns, or tap Resume."}),s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx(de,{variant:"primary",icon:s.jsx(Or,{size:16}),onClick:()=>E($.startSession,se),disabled:h,className:"flex-1 sm:flex-none","data-tour":"connection-start",children:se}),me(Y)]})]}),!G&&!ne&&!R&&!U&&O&&s.jsxs("div",{className:"flex flex-col gap-4 w-full","data-tour":"connection-pairing",children:[s.jsx(Ia,{"aria-label":o("connection"),value:S,onChange:A,className:"w-full sm:w-fit",options:[{value:"pairing",label:d==="ar"?"كود الربط الرقمي (الهاتف)":"Pairing Code (Phone)",icon:s.jsx(_r,{size:16})},{value:"qr",label:d==="ar"?"مسح رمز QR":"QR Code Scan",icon:s.jsx(Hf,{size:16})}]}),S==="pairing"&&s.jsxs("form",{onSubmit:z,className:"flex w-full max-w-xl flex-col gap-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx(ej,{size:17,className:"absolute top-1/2 -translate-y-1/2 start-3.5 text-muted pointer-events-none"}),s.jsx(Be,{type:"tel",value:k,onChange:oe=>N(oe.target.value),placeholder:d==="ar"?"201012345678 (مع كود الدولة)":"e.g. 201012345678",dir:"ltr",className:"ps-10"})]}),s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx(de,{type:"submit",variant:"primary",icon:s.jsx(Rm,{size:16}),disabled:h,className:"flex-1 whitespace-nowrap sm:flex-none","data-tour":"connection-start",children:d==="ar"?"الحصول على كود الربط":"Get Pairing Code"}),me(Y)]}),s.jsx("p",{className:"text-xs text-muted leading-relaxed",children:d==="ar"?"💡 أدخل رقم هاتفك مسبوقاً بكود الدولة وبدون 0 في البداية (مثال: 2010... وليس 010...). سيظهر لك كود لإدخاله في واتساب فوراً.":"💡 Enter your number with country code, no leading zeros (e.g. 2010... not 010...). A code will appear to enter into WhatsApp."})]}),S==="qr"&&s.jsxs("div",{className:"flex w-full max-w-xl flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx(de,{variant:"primary",icon:s.jsx(Hf,{size:18}),onClick:F,disabled:h,className:"flex-1 whitespace-nowrap sm:flex-none","data-tour":"connection-start",children:d==="ar"?"بدء الربط عبر رمز QR":"Start QR Linking"}),me(Y)]}),s.jsx("p",{className:"text-xs text-muted",children:d==="ar"?"سيتم إنشاء رمز QR لمسحه من هاتف آخر أو من شاشة الحاسوب عبر كاميرا واتساب.":"Generates a QR code to be scanned using WhatsApp camera on another device or screen."})]})]})]})]}),ne&&s.jsxs(Ze,{className:"flex flex-col items-center text-center",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl bg-brand-blue/15 text-brand-blue flex items-center justify-center mb-4 border border-brand-blue/30",children:s.jsx(Ga,{size:24,className:"animate-spin"})}),s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main mb-1.5",children:_==="linking"?d==="ar"?"جارٍ إتمام الربط مع الهاتف...":"Finishing link handshake...":d==="ar"?"جارٍ بدء تشغيل الجلسة...":"Initializing WhatsApp session..."}),s.jsx("p",{className:"text-xs sm:text-sm text-muted max-w-md",children:d==="ar"?"يتم الآن إنشاء مقبس الاتصال، ستظهر بيانات الربط خلال ثوانٍ معدودة.":"Creating connection socket. Pairing details will appear in just a few seconds."})]}),R&&s.jsx(Ze,{className:"mx-auto flex w-full max-w-2xl flex-col items-center text-center",children:n!=null&&n.pairingCode?s.jsxs("div",{className:"flex flex-col items-center w-full animate-in fade-in zoom-in-95 duration-300",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl bg-brand-cyan/15 text-brand-cyan flex items-center justify-center mb-4 border border-brand-cyan/30",children:s.jsx(_r,{size:26})}),s.jsx("h3",{className:"text-lg sm:text-xl font-bold text-text-main mb-1.5",children:d==="ar"?"كود الربط الرقمي مع واتساب":"WhatsApp Pairing Code"}),s.jsx("p",{className:"text-xs sm:text-sm text-muted max-w-md mb-6",children:d==="ar"?"أدخل هذا الكود في تطبيق واتساب على هاتفك لتأكيد الربط مباشرة.":"Enter this code into WhatsApp on your phone to complete pairing."}),s.jsxs("div",{className:"rounded-2xl border-2 border-brand-cyan/40 bg-brand-cyan/10 p-5 sm:p-6 w-full max-w-md flex flex-col items-center gap-4 shadow-lg shadow-brand-cyan/10",children:[s.jsx("div",{className:"text-xs font-bold text-brand-cyan uppercase tracking-wider",children:d==="ar"?"كود الربط المكون من 8 خانات":"8-Digit Pairing Code"}),s.jsx("div",{className:"text-3xl sm:text-4xl font-mono font-extrabold tracking-widest text-brand-cyan select-all",dir:"ltr",children:n.pairingCode.length===8?`${n.pairingCode.slice(0,4)} - ${n.pairingCode.slice(4)}`:n.pairingCode}),s.jsx(de,{variant:"primary",icon:j?s.jsx(gi,{size:18}):s.jsx(Rv,{size:18}),onClick:pe,children:j?d==="ar"?"تم النسخ بنجاح!":"Copied!":d==="ar"?"نسخ كود الربط":"Copy Code"})]}),s.jsxs("div",{className:"mt-6 p-4 rounded-xl border border-line bg-panel-raised text-start w-full max-w-md",children:[s.jsx("div",{className:"text-xs font-bold text-text-main mb-3",children:d==="ar"?"خطوات الإدخال في واتساب:":"Steps to enter in WhatsApp:"}),s.jsxs("ol",{className:"text-xs text-muted space-y-2 list-decimal list-inside leading-relaxed",children:[s.jsx("li",{children:d==="ar"?"افتح تطبيق واتساب على هاتفك.":"Open WhatsApp on your phone."}),s.jsx("li",{children:d==="ar"?"اذهب إلى الإعدادات > الأجهزة المرتبطة > ربط جهاز.":"Go to Settings > Linked Devices > Link a Device."}),s.jsx("li",{children:s.jsx("strong",{className:"text-text-main",children:d==="ar"?"اضغط على «الربط باستخدام رقم الهاتف بدلاً من ذلك» أسفل الشاشة.":"Tap 'Link with phone number instead' at bottom of screen."})}),s.jsx("li",{children:d==="ar"?"اكتب هذا الكود وسيتم ربط البوت مباشرة!":"Enter the code above to connect immediately!"})]})]})]}):x?s.jsxs("div",{className:"flex flex-col items-center w-full",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl bg-brand-cyan/15 text-brand-cyan flex items-center justify-center mb-4 border border-brand-cyan/30",children:s.jsx(Hf,{size:26})}),s.jsx("h3",{className:"text-lg font-bold text-text-main mb-1.5",children:o("waiting_for_qr")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted max-w-md mb-6",children:d==="ar"?"افتح واتساب على هاتفك، اذهب إلى الأجهزة المرتبطة، ثم امسح هذا الرمز للربط.":"Open WhatsApp on your phone, go to Linked Devices, and scan this code to link."}),s.jsx("div",{className:"p-3 sm:p-4 bg-panel rounded-2xl shadow-xl border border-line animate-in fade-in zoom-in-95 duration-300",children:s.jsx("img",{src:x,alt:"WhatsApp QR Code",className:"w-56 h-56 sm:w-64 sm:h-64 block rounded-lg"})}),s.jsxs("div",{className:"mt-6 pt-5 border-t border-line w-full max-w-md flex flex-col items-center gap-2.5",children:[s.jsx("p",{className:"text-xs text-muted text-center",children:d==="ar"?"هل تستخدم التطبيق من نفس الهاتف ولا تستطيع مسح الرمز؟":"Using the app on the same phone and can't scan?"}),s.jsx(de,{variant:"secondary",icon:s.jsx(_r,{size:16}),onClick:le,disabled:h,className:"w-full",children:d==="ar"?"الربط برقم الهاتف (كود الربط الرقمي) بدلاً من QR":"Link with Phone Pairing Code Instead"})]})]}):s.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[s.jsx(va,{className:"size-8"}),s.jsx("span",{className:"text-xs sm:text-sm font-semibold text-muted animate-pulse",children:d==="ar"?"جارٍ تجهيز بيانات الربط من واتساب...":"Preparing pairing details from WhatsApp..."})]})}),s.jsxs(an,{isOpen:m,onClose:()=>p(!1),title:o("unlink"),footer:s.jsxs(s.Fragment,{children:[s.jsx(de,{variant:"secondary",onClick:()=>p(!1),children:o("cancel")}),s.jsx(de,{variant:"danger",onClick:he,children:o("unlink")})]}),children:[s.jsx("p",{className:"text-xs sm:text-sm text-text-main leading-relaxed",children:d==="ar"?"هل أنت متأكد من رغبتك في إلغاء ربط جلسة واتساب الحالية؟ ستحتاج إلى مسح رمز QR جديد أو إدخال كود ربط لإعادة ربط الحساب.":"Are you sure you want to unlink this WhatsApp session? You will need to scan a new QR code or enter a pairing code to reconnect."}),s.jsx("p",{className:"text-xs sm:text-sm text-muted leading-relaxed mt-2",children:o("unlinkStickersWarning")})]})]})},Tr={mode:"simple",limit:3,limitAction:"KICK",features:{antilink:null,media:null,forbidden:null,antispam:null},hitMerge:"max",weights:{antilink:1,media:1,forbidden:1,antispam:1,manual:1},flagAt:3,kickAt:5,decay:{mode:"off",days:30},membership:"clear",flag:{notify:"group",mentionAdmins:!0,cooldownMinutes:0,whileFlagged:"record",escalateAfter:3}},Mc={relaxed:{...Tr,limit:5,limitAction:"FLAG",decay:{mode:"expire",days:14},flag:{...Tr.flag,cooldownMinutes:60,whileFlagged:"hold"}},standard:Tr,strict:{...Tr,limit:2,features:{antilink:"KICK",media:"WARN",forbidden:"WARN",antispam:"KICK"}}};function Jb(n){return{policyMode:n.mode,policyLimit:n.limit,policyLimitAction:n.limitAction,policyLinkAction:n.features.antilink,policyMediaAction:n.features.media,policyForbiddenAction:n.features.forbidden,policySpamAction:n.features.antispam,policyHitMerge:n.hitMerge,policyWeightLink:n.weights.antilink,policyWeightMedia:n.weights.media,policyWeightForbidden:n.weights.forbidden,policyWeightSpam:n.weights.antispam,policyWeightManual:n.weights.manual,policyFlagAt:n.flagAt,policyKickAt:n.kickAt,policyDecayMode:n.decay.mode,policyDecayDays:n.decay.days,policyMembership:n.membership,policyNotify:n.flag.notify,policyMentionAdmins:n.flag.mentionAdmins,policyCooldown:n.flag.cooldownMinutes,policyWhileFlagged:n.flag.whileFlagged,policyEscalateAfter:n.flag.escalateAfter}}function Qm(n){return{mode:n.policyMode,limit:n.policyLimit,limitAction:n.policyLimitAction,features:{antilink:n.policyLinkAction,media:n.policyMediaAction,forbidden:n.policyForbiddenAction,antispam:n.policySpamAction},hitMerge:n.policyHitMerge,weights:{antilink:n.policyWeightLink,media:n.policyWeightMedia,forbidden:n.policyWeightForbidden,antispam:n.policyWeightSpam,manual:n.policyWeightManual},flagAt:n.policyFlagAt,kickAt:n.policyKickAt,decay:{mode:n.policyDecayMode,days:n.policyDecayDays},membership:n.policyMembership,flag:{notify:n.policyNotify,mentionAdmins:n.policyMentionAdmins,cooldownMinutes:n.policyCooldown,whileFlagged:n.policyWhileFlagged,escalateAfter:n.policyEscalateAfter}}}function Sm(n,i){return JSON.stringify(n)===JSON.stringify(i)}function BE(n){return Sm(n,Mc.relaxed)?"relaxed":Sm(n,Mc.standard)?"standard":Sm(n,Mc.strict)?"strict":"custom"}function UE(n,i){const r=Qm(n),o=[["mode",r.mode],["limit",r.limit],["limitAction",r.limitAction],["features.antilink",r.features.antilink],["features.media",r.features.media],["features.forbidden",r.features.forbidden],["features.antispam",r.features.antispam],["hitMerge",r.hitMerge],["weights.antilink",r.weights.antilink],["weights.media",r.weights.media],["weights.forbidden",r.weights.forbidden],["weights.antispam",r.weights.antispam],["weights.manual",r.weights.manual],["flagAt",r.flagAt],["kickAt",r.kickAt],["decay.mode",r.decay.mode],["decay.days",r.decay.days],["membership",r.membership],["flag.notify",r.flag.notify],["flag.mentionAdmins",r.flag.mentionAdmins],["flag.cooldownMinutes",r.flag.cooldownMinutes],["flag.whileFlagged",r.flag.whileFlagged],["flag.escalateAfter",r.flag.escalateAfter]],d={};let f=!1;for(const[m,p]of o){if(i[m]===!1)continue;f=!0;const h=m.split(".");let b=d;for(let x=0;x<h.length-1;x+=1){const v=b[h[x]];(typeof v!="object"||v===null)&&(b[h[x]]={}),b=b[h[x]]}b[h.at(-1)]=p}return f?d:void 0}function km(n){const i={};for(const r of n||[])r!=null&&r.field&&r.message&&!(r.field in i)&&(i[r.field]=r.message);return i}const jm={antilink:"any",welcome:"any",media:"any"};function HE(n,i,r){const o=i.trim().toLowerCase();if(o&&!`${n.subject||""} ${n.jid}`.toLowerCase().includes(o))return!1;const d=!!n.antilink.enabled;if(r.antilink==="on"&&!d||r.antilink==="off"&&d)return!1;const f=!!n.welcomeEnabled;return!(r.welcome==="on"&&!f||r.welcome==="off"&&f||r.media!=="any"&&(n.mediaRestriction||"none")!==r.media)}const PE=()=>{const{t:n,language:i}=Ue(),{toast:r}=Ct(),[o,d]=y.useState([]),[f,m]=y.useState(!0),[p,h]=y.useState(null),[b,x]=y.useState(0),[v,S]=y.useState(""),[A,k]=y.useState("name"),[N,j]=y.useState(jm),[L,_]=y.useState([]),[G,R]=y.useState("!"),ne=y.useRef(new Set),[U,M]=y.useState(new Set),T=y.useCallback(async()=>{m(!0);try{const ie=await $.getGroups();ie!=null&&ie.groups&&d(ie.groups),h(null)}catch(ie){h(ie.message),r(ie.message,"error")}finally{m(!1)}},[r]);y.useEffect(()=>{T()},[b,T]),y.useEffect(()=>{let ie=!0;return $.getCommands().then(fe=>{ie&&(_(fe.commands.filter(C=>C.chat==="group")),R(fe.prefix||"!"))}).catch(()=>{}),()=>{ie=!1}},[]);const P=ie=>{d(fe=>fe.map(C=>C.jid===ie.jid?ie:C))},O=async(ie,fe,C)=>{if(ne.current.has(ie))throw new Error(n("saving"));ne.current.add(ie),M(new Set(ne.current));try{const K=C==="kick"?await $.kickFlagged(ie,fe):C==="clear"?await $.clearFlagged(ie,fe):await $.dismissFlagged(ie,fe);K!=null&&K.group&&P(K.group),r(n("savedSuccessfully"),"success")}catch(K){throw r(K.message,"error"),K}finally{ne.current.delete(ie),M(new Set(ne.current))}},J=async(ie,fe)=>{if(ne.current.has(ie))throw new Error(n("saving"));ne.current.add(ie),M(new Set(ne.current));try{const C=await $.updateGroup(ie,fe);C!=null&&C.group&&P(C.group),r(n("savedSuccessfully"),"success")}catch(C){throw r(C.message,"error"),C}finally{ne.current.delete(ie),M(new Set(ne.current))}},Z=y.useMemo(()=>{const ie=o.filter(fe=>HE(fe,v,N));return ie.sort((fe,C)=>{const K=(fe.subject||fe.jid).localeCompare(C.subject||C.jid,i,{sensitivity:"base"});return A==="members"&&(C.memberCount||0)-(fe.memberCount||0)||K}),ie},[o,v,N,A,i]),se=`${v}|${A}|${N.antilink}|${N.welcome}|${N.media}`,{page:E,pageCount:z,pageItems:F,setPage:le,total:pe}=Zc(Z,20,se),he=(N.antilink!=="any"?1:0)+(N.welcome!=="any"?1:0)+(N.media!=="any"?1:0),I=()=>{S(""),j(jm)},ce=!f&&!p&&o.length>0;return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(gl,{icon:s.jsx(rl,{size:24}),title:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[n("groups"),s.jsx(We,{tone:"info",children:Bt(n("groupsCount"),{n:o.length})})]}),description:n("groupsSubtitle")}),ce&&s.jsxs(yl,{"data-tour":"groups-list",children:[s.jsx(Be,{type:"search",name:"group-search",autoComplete:"off",value:v,onChange:ie=>S(ie.target.value),placeholder:n("searchGroups"),"aria-label":n("searchGroups"),className:"min-w-48 flex-1"}),s.jsx(Pr,{label:n("sort"),value:A,onChange:k,options:[{value:"name",label:n("sortByName")},{value:"members",label:n("sortByMembers")}]}),s.jsxs(xl,{label:n("filter"),resetLabel:n("reset"),activeCount:he,onReset:()=>j(jm),children:[s.jsx(Sn,{label:n("thAntiLink"),name:"group-antilink",value:N.antilink,onChange:ie=>j(fe=>({...fe,antilink:ie})),options:[{value:"any",label:n("statusAny")},{value:"on",label:n("statusEnabled")},{value:"off",label:n("statusDisabled")}]}),s.jsx(Sn,{label:n("thWelcome"),name:"group-welcome",value:N.welcome,onChange:ie=>j(fe=>({...fe,welcome:ie})),options:[{value:"any",label:n("statusAny")},{value:"on",label:n("statusEnabled")},{value:"off",label:n("statusDisabled")}]}),s.jsx(Sn,{label:n("thMedia"),name:"group-media",value:N.media,onChange:ie=>j(fe=>({...fe,media:ie})),options:[{value:"any",label:n("statusAny")},{value:"none",label:n("mediaNone")},{value:"block_all",label:n("mediaBlockAll")},{value:"custom",label:n("mediaCustom")}]})]})]}),f&&s.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2","aria-busy":"true",children:["g1","g2","g3","g4"].map(ie=>s.jsxs(Ze,{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Gt,{className:"size-10 rounded-xl"}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s.jsx(Gt,{className:"h-5 w-40"}),s.jsx(Gt,{className:"h-4 w-28"})]})]}),s.jsx(Gt,{className:"h-10 w-full"}),s.jsx(Gt,{className:"h-10 w-full"})]},ie))}),!f&&p&&s.jsx(mt,{kind:"error",icon:s.jsx(Jy,{size:28}),description:p,action:s.jsx(de,{variant:"secondary",icon:s.jsx(dl,{size:16}),onClick:()=>x(ie=>ie+1),children:n("retryLoad")})}),!f&&!p&&o.length===0&&s.jsx(mt,{kind:"empty",icon:s.jsx(Jy,{size:28}),title:n("noGroupsTitle"),description:n("noGroupsBody")}),!f&&!p&&o.length>0&&Z.length===0&&s.jsx(mt,{kind:"no-results",action:s.jsx(de,{variant:"secondary",onClick:I,children:n("clearFilters")})}),!f&&!p&&Z.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 items-start gap-3 xl:grid-cols-2",children:F.map(ie=>s.jsx(rh,{summary:s.jsxs("span",{className:"flex items-center gap-3",children:[s.jsx(fj,{src:`/dashboard/api/groups/${encodeURIComponent(ie.jid)}/photo`,name:ie.subject||n("unnamedGroup")}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx(rn,{lines:2,className:"block font-bold text-text-main",children:ie.subject||n("unnamedGroup")}),s.jsxs("span",{className:"mt-1 flex flex-wrap gap-1.5",children:[s.jsxs(We,{children:[ie.memberCount??"—"," ",n("thMembers")]}),ie.antilink.enabled&&s.jsx(We,{tone:"info",children:n("thAntiLink")}),ie.antispam.enabled&&s.jsx(We,{tone:"ok",children:n("antiSpam")})]})]})]}),children:s.jsx(qE,{group:ie,pending:U.has(ie.jid),onSave:fe=>J(ie.jid,fe),onFlagged:(fe,C)=>O(ie.jid,fe,C),commands:L,prefix:G})},ie.jid))}),s.jsx(ki,{page:E,pageCount:z,total:pe,onPageChange:le})]})]})};function qE({group:n,pending:i,onSave:r,onFlagged:o,commands:d,prefix:f}){var J,Z,se;const{t:m,language:p}=Ue(),{permissionLabel:h}=qr(),b={...Tr,...n.moderation_policy},x=Pc({linkMode:n.antilink.mode,domains:n.antilink.allowed_domains.join(`
555
- `),spamWindow:n.antispam.time_window,spamLimit:n.antispam.message_count,rules:n.rules,welcome:n.welcome_system.messages.join(`
556
- `),...Jb(b)}),[v,S]=y.useState(n.moderation_policy_visibility??{}),[A,k]=y.useState({});y.useEffect(()=>{S(n.moderation_policy_visibility??{}),k({})},[n.moderation_policy_visibility]);const N=E=>v[E]!==!1,j=E=>A[E],L=BE(Qm(x.draft)),_=E=>{E!=="custom"&&x.setDraft(z=>({...z,...Jb(Mc[E])}))},G=E=>{r(E).catch(()=>{})},R=(E,z,F)=>s.jsx(Kn,{label:E,checked:z,disabled:i,onChange:le=>G(F(le))}),ne=y.useMemo(()=>{var E,z;return{antilink:{enabled:n.antilink.enabled,mode:x.draft.linkMode,allowed_domains:x.draft.domains.split(`
557
- `).map(F=>F.trim()).filter(Boolean)},antispam:{enabled:n.antispam.enabled,time_window:x.draft.spamWindow,message_count:x.draft.spamLimit},media_control:{enabled:n.media_control.enabled,blocked_types:n.media_control.blocked_types},forbidden_words:{enabled:!!((E=n.forbidden_words)!=null&&E.enabled),count:((z=n.forbidden_words)==null?void 0:z.count)||0},moderation_policy:Qm(x.draft)}},[x.draft,n.antilink.enabled,n.antispam.enabled,n.media_control,n.forbidden_words]),U=p==="en"?(J=n.moderation_summary)==null?void 0:J.en:(Z=n.moderation_summary)==null?void 0:Z.ar,[M,T]=y.useState(U||""),P=JSON.stringify(ne);y.useEffect(()=>{let E=!1;const z=window.setTimeout(()=>{$.previewModeration(ne).then(F=>{E||(T(p==="en"?F.en:F.ar),F.visibility&&S(F.visibility),k(km(F.errors)))}).catch(F=>{var le;E||(Array.isArray((le=F==null?void 0:F.data)==null?void 0:le.errors)?k(km(F.data.errors)):U&&T(U))})},200);return()=>{E=!0,window.clearTimeout(z)}},[P,p,U,ne]);const O=M||U||"";return s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx("p",{className:"text-xs text-muted",children:m("botAdminHint")}),s.jsx("form",{className:"flex flex-col gap-5",onSubmit:E=>{E.preventDefault(),x.save(async z=>{var F,le,pe;try{const he=UE(z,v);await r({antilink:{enabled:n.antilink.enabled,mode:z.linkMode,allowed_domains:z.domains.split(`
558
- `).map(I=>I.trim()).filter(Boolean)},antispam:{enabled:n.antispam.enabled,time_window:z.spamWindow,message_count:z.spamLimit},media_control:{enabled:n.media_control.enabled,blocked_types:n.media_control.blocked_types},forbidden_words:{enabled:!!((F=n.forbidden_words)!=null&&F.enabled),count:((le=n.forbidden_words)==null?void 0:le.count)||0},welcome_system:{...n.welcome_system,messages:z.welcome===n.welcome_system.messages.join(`
559
- `)?n.welcome_system.messages:z.welcome.split(`
560
- `).filter(Boolean)},rules:z.rules,moderation_policy:he}),k({})}catch(he){throw Array.isArray((pe=he==null?void 0:he.data)==null?void 0:pe.errors)&&k(km(he.data.errors)),he}})},children:s.jsxs("fieldset",{disabled:i,className:"flex min-w-0 flex-col gap-5",children:[s.jsxs(lb,{title:m("rulesAndModeration"),children:[R(m("thAntiLink"),n.antilink.enabled,E=>({antilink:{...n.antilink,enabled:E}})),R(m("antiSpam"),n.antispam.enabled,E=>({antispam:{...n.antispam,enabled:E}})),R(m("forbiddenWords"),!!((se=n.forbidden_words)!=null&&se.enabled),E=>{var z;return{forbidden_words:{...n.forbidden_words,enabled:E,count:((z=n.forbidden_words)==null?void 0:z.count)||0}}}),s.jsx("div",{className:"grid grid-cols-1 gap-x-5 sm:grid-cols-2",children:[["image","blockImages"],["video","blockVideos"],["audio","blockAudio"],["sticker","blockStickers"]].map(([E,z])=>s.jsx(Kn,{label:m(z),disabled:i,checked:n.media_control.enabled&&n.media_control.blocked_types.includes(E),onChange:F=>{const le=n.media_control.enabled?n.media_control.blocked_types:[],pe=F?[...new Set([...le,E])]:le.filter(he=>he!==E);G({media_control:{enabled:pe.length>0,blocked_types:pe}})}},E))}),s.jsx(_e,{label:m("linkMode"),children:s.jsxs(ft,{"aria-label":m("linkMode"),value:x.draft.linkMode,onChange:E=>x.setField("linkMode",E.target.value),children:[s.jsx("option",{value:"ALL",children:m("linkAll")}),s.jsx("option",{value:"WHITELIST",children:m("linkWhitelist")}),s.jsx("option",{value:"BLACKLIST",children:m("linkBlacklist")})]})}),s.jsx(_e,{label:m("allowedDomains"),children:s.jsx(ol,{"aria-label":m("allowedDomains"),dir:"ltr",value:x.draft.domains,onChange:E=>x.setField("domains",E.target.value)})}),s.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[s.jsx(_e,{label:m("spamWindow"),children:s.jsx(Be,{"aria-label":m("spamWindow"),type:"number",min:1,max:600,required:!0,value:x.draft.spamWindow,onChange:E=>x.setField("spamWindow",Number(E.target.value))})}),s.jsx(_e,{label:m("spamLimit"),children:s.jsx(Be,{"aria-label":m("spamLimit"),type:"number",min:2,max:100,required:!0,value:x.draft.spamLimit,onChange:E=>x.setField("spamLimit",Number(E.target.value))})})]}),s.jsx("p",{className:"text-sm font-bold text-text-main",children:m("policyBlockTitle")}),s.jsx(_e,{label:m("policyPreset"),children:s.jsx(Ia,{"aria-label":m("policyPreset"),value:L,onChange:_,options:[{value:"relaxed",label:m("presetRelaxed")},{value:"standard",label:m("presetStandard")},{value:"strict",label:m("presetStrict")},{value:"custom",label:m("presetCustom")}]})}),s.jsx(_e,{label:m("policyMode"),error:j("mode"),children:s.jsxs(ft,{"aria-label":m("policyMode"),value:x.draft.policyMode,onChange:E=>{const z=E.target.value==="severity"?"severity":"simple";x.setField("policyMode",z),z==="severity"&&x.draft.policyWhileFlagged==="escalate"&&x.setField("policyWhileFlagged","record")},children:[s.jsx("option",{value:"simple",children:m("policyModeSimple")}),s.jsx("option",{value:"severity",children:m("policyModeSeverity")})]})}),N("limit")&&s.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[s.jsx(_e,{label:m("warningLimit"),error:j("limit"),children:s.jsx(Be,{"aria-label":m("warningLimit"),type:"number",min:1,max:50,required:!0,value:x.draft.policyLimit,onChange:E=>x.setField("policyLimit",Number(E.target.value))})}),s.jsx(_e,{label:m("warningAction"),error:j("limitAction"),children:s.jsxs(ft,{"aria-label":m("warningAction"),value:x.draft.policyLimitAction,onChange:E=>x.setField("policyLimitAction",E.target.value==="FLAG"?"FLAG":"KICK"),children:[s.jsx("option",{value:"KICK",children:m("actionKick")}),s.jsx("option",{value:"FLAG",children:m("actionFlag")})]})})]}),N("flagAt")&&s.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[s.jsx(_e,{label:m("policyFlagAt"),error:j("flagAt"),children:s.jsx(Be,{"aria-label":m("policyFlagAt"),type:"number",min:1,max:49,required:!0,value:x.draft.policyFlagAt,onChange:E=>x.setField("policyFlagAt",Number(E.target.value))})}),s.jsx(_e,{label:m("policyKickAt"),error:j("kickAt"),children:s.jsx(Be,{"aria-label":m("policyKickAt"),type:"number",min:2,max:50,required:!0,value:x.draft.policyKickAt,onChange:E=>x.setField("policyKickAt",Number(E.target.value))})})]}),N("hitMerge")&&s.jsx(_e,{label:m("policyHitMerge"),error:j("hitMerge"),children:s.jsxs(ft,{"aria-label":m("policyHitMerge"),value:x.draft.policyHitMerge,onChange:E=>x.setField("policyHitMerge",E.target.value==="sum"?"sum":"max"),children:[s.jsx("option",{value:"max",children:m("policyHitMergeMax")}),s.jsx("option",{value:"sum",children:m("policyHitMergeSum")})]})}),N("weights.antilink")&&s.jsxs("div",{className:"grid grid-cols-1 gap-x-5 gap-y-3 sm:grid-cols-2",children:[s.jsx(_e,{label:m("policyWeightLink"),error:j("weights.antilink"),children:s.jsx(Be,{"aria-label":m("policyWeightLink"),type:"number",min:1,max:10,required:!0,value:x.draft.policyWeightLink,onChange:E=>x.setField("policyWeightLink",Number(E.target.value))})}),s.jsx(_e,{label:m("policyWeightMedia"),error:j("weights.media"),children:s.jsx(Be,{"aria-label":m("policyWeightMedia"),type:"number",min:1,max:10,required:!0,value:x.draft.policyWeightMedia,onChange:E=>x.setField("policyWeightMedia",Number(E.target.value))})}),s.jsx(_e,{label:m("policyWeightForbidden"),error:j("weights.forbidden"),children:s.jsx(Be,{"aria-label":m("policyWeightForbidden"),type:"number",min:1,max:10,required:!0,value:x.draft.policyWeightForbidden,onChange:E=>x.setField("policyWeightForbidden",Number(E.target.value))})}),s.jsx(_e,{label:m("policyWeightSpam"),error:j("weights.antispam"),children:s.jsx(Be,{"aria-label":m("policyWeightSpam"),type:"number",min:1,max:10,required:!0,value:x.draft.policyWeightSpam,onChange:E=>x.setField("policyWeightSpam",Number(E.target.value))})}),s.jsx(_e,{label:m("policyWeightManual"),error:j("weights.manual"),children:s.jsx(Be,{"aria-label":m("policyWeightManual"),type:"number",min:1,max:10,required:!0,value:x.draft.policyWeightManual,onChange:E=>x.setField("policyWeightManual",Number(E.target.value))})})]}),N("features.antilink")&&s.jsx(_e,{label:m("policyLinkLabel"),error:j("features.antilink"),children:s.jsxs(ft,{"aria-label":m("policyLinkLabel"),value:x.draft.policyLinkAction??"DEFAULT",onChange:E=>x.setField("policyLinkAction",E.target.value==="DEFAULT"?null:E.target.value),children:[s.jsx("option",{value:"DEFAULT",children:m("policyActionDefault")}),s.jsx("option",{value:"DELETE",children:m("actionDelete")}),s.jsx("option",{value:"WARN",children:m("actionDeleteWarn")}),s.jsx("option",{value:"KICK",children:m("actionDeleteKick")})]})}),N("features.media")&&s.jsx(_e,{label:m("policyMediaLabel"),error:j("features.media"),children:s.jsxs(ft,{"aria-label":m("policyMediaLabel"),value:x.draft.policyMediaAction??"DEFAULT",onChange:E=>x.setField("policyMediaAction",E.target.value==="DEFAULT"?null:E.target.value),children:[s.jsx("option",{value:"DEFAULT",children:m("policyActionDefault")}),s.jsx("option",{value:"DELETE",children:m("actionDelete")}),s.jsx("option",{value:"WARN",children:m("actionDeleteWarn")}),s.jsx("option",{value:"KICK",children:m("actionDeleteKick")})]})}),N("features.forbidden")&&s.jsx(_e,{label:m("policyForbiddenLabel"),error:j("features.forbidden"),children:s.jsxs(ft,{"aria-label":m("policyForbiddenLabel"),value:x.draft.policyForbiddenAction??"DEFAULT",onChange:E=>x.setField("policyForbiddenAction",E.target.value==="DEFAULT"?null:E.target.value),children:[s.jsx("option",{value:"DEFAULT",children:m("policyActionDefault")}),s.jsx("option",{value:"DELETE",children:m("actionDelete")}),s.jsx("option",{value:"WARN",children:m("actionDeleteWarn")}),s.jsx("option",{value:"KICK",children:m("actionDeleteKick")})]})}),N("features.antispam")&&s.jsx(_e,{label:m("policySpamLabel"),error:j("features.antispam"),children:s.jsxs(ft,{"aria-label":m("policySpamLabel"),value:x.draft.policySpamAction??"DEFAULT",onChange:E=>x.setField("policySpamAction",E.target.value==="DEFAULT"?null:E.target.value),children:[s.jsx("option",{value:"DEFAULT",children:m("policyActionDefault")}),s.jsx("option",{value:"WARN",children:m("actionWarn")}),s.jsx("option",{value:"KICK",children:m("actionKick")})]})}),s.jsx(_e,{label:m("policyDecay"),error:j("decay.mode"),children:s.jsxs(ft,{"aria-label":m("policyDecay"),value:x.draft.policyDecayMode,onChange:E=>x.setField("policyDecayMode",E.target.value==="expire"?"expire":E.target.value==="step"?"step":"off"),children:[s.jsx("option",{value:"off",children:m("policyDecayOff")}),s.jsx("option",{value:"expire",children:m("policyDecayExpire")}),s.jsx("option",{value:"step",children:m("policyDecayStep")})]})}),N("decay.days")&&s.jsx(_e,{label:m("policyDecayDays"),error:j("decay.days"),children:s.jsx(Be,{"aria-label":m("policyDecayDays"),type:"number",min:1,max:365,required:!0,value:x.draft.policyDecayDays,onChange:E=>x.setField("policyDecayDays",Number(E.target.value))})}),s.jsx(_e,{label:m("policyMembership"),error:j("membership"),children:s.jsxs(ft,{"aria-label":m("policyMembership"),value:x.draft.policyMembership,onChange:E=>x.setField("policyMembership",E.target.value==="clear"?"clear":"keep"),children:[s.jsx("option",{value:"keep",children:m("policyMembershipKeep")}),s.jsx("option",{value:"clear",children:m("policyMembershipClear")})]})}),N("flag.notify")&&s.jsx(_e,{label:m("policyFlagNotify"),error:j("flag.notify"),children:s.jsxs(ft,{"aria-label":m("policyFlagNotify"),value:x.draft.policyNotify,onChange:E=>x.setField("policyNotify",E.target.value==="silent"?"silent":"group"),children:[s.jsx("option",{value:"group",children:m("policyNotifyGroup")}),s.jsx("option",{value:"silent",children:m("policyNotifySilent")})]})}),N("flag.mentionAdmins")&&s.jsx(bi,{label:m("policyMentionAdmins"),checked:x.draft.policyMentionAdmins,disabled:i,onChange:E=>x.setField("policyMentionAdmins",E.target.checked)}),N("flag.cooldownMinutes")&&s.jsx(_e,{label:m("policyCooldown"),description:m("policyCooldownHint"),error:j("flag.cooldownMinutes"),children:s.jsx(Be,{"aria-label":m("policyCooldown"),type:"number",min:0,max:10080,required:!0,value:x.draft.policyCooldown,onChange:E=>x.setField("policyCooldown",Number(E.target.value))})}),N("flag.whileFlagged")&&s.jsx(_e,{label:m("policyWhileFlagged"),error:j("flag.whileFlagged"),children:s.jsxs(ft,{"aria-label":m("policyWhileFlagged"),value:x.draft.policyWhileFlagged,onChange:E=>{const z=E.target.value==="hold"?"hold":E.target.value==="escalate"?"escalate":"record";x.setField("policyWhileFlagged",z)},children:[s.jsx("option",{value:"record",children:m("policyWhileFlaggedRecord")}),s.jsx("option",{value:"hold",children:m("policyWhileFlaggedHold")}),x.draft.policyMode==="simple"&&s.jsx("option",{value:"escalate",children:m("policyWhileFlaggedEscalate")})]})}),N("flag.escalateAfter")&&x.draft.policyWhileFlagged==="escalate"&&s.jsx(_e,{label:m("policyEscalateAfter"),error:j("flag.escalateAfter"),children:s.jsx(Be,{"aria-label":m("policyEscalateAfter"),type:"number",min:1,max:50,required:!0,value:x.draft.policyEscalateAfter,onChange:E=>x.setField("policyEscalateAfter",Number(E.target.value))})}),s.jsx(_e,{label:m("groupRules"),children:s.jsx(ol,{"aria-label":m("groupRules"),dir:"auto",maxLength:4e3,value:x.draft.rules,onChange:E=>x.setField("rules",E.target.value)})}),s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx("p",{className:"text-sm font-bold text-text-main",children:m("flaggedMembers")}),(n.flagged_members||[]).length===0?s.jsx("p",{className:"text-sm text-muted",children:m("flaggedEmpty")}):s.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:(n.flagged_members||[]).map(E=>s.jsxs("li",{className:"flex min-w-0 items-center gap-2 rounded-xl border border-line bg-bg px-3 py-2",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx(rn,{className:"block text-sm font-bold text-text-main",children:E.name}),s.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted",dir:"ltr",children:[E.warn_count," · ",E.last_rule||"—",E.flagged_at?s.jsxs(s.Fragment,{children:[" · ",s.jsx(Br,{value:E.flagged_at})]}):null]})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(Oe,{label:m("kickFlagged"),icon:s.jsx(oj,{size:16}),disabled:i,onClick:()=>{o(E.user_id,"kick")}}),s.jsxs(Yn,{label:m("moreActions"),children:[s.jsx(lt,{icon:s.jsx(Hk,{size:16}),onSelect:()=>{o(E.user_id,"clear")},children:m("clearWarnings")}),s.jsx(lt,{onSelect:()=>{o(E.user_id,"dismiss")},children:m("dismissFlag")})]})]})]},E.user_id))})]}),s.jsx(_e,{label:m("moderationPreview"),description:m("moderationPreviewHint"),children:s.jsx("div",{dir:"auto",className:"min-h-10 whitespace-pre-wrap rounded-xl border border-line bg-bg p-3 text-sm text-text-main",children:O})})]}),s.jsxs(lb,{title:m("thWelcome"),children:[R(m("thWelcome"),n.welcome_system.enabled,E=>({welcome_system:{...n.welcome_system,enabled:E}})),R(m("autoApprove"),n.join_requests.auto_approve_enabled,E=>({join_requests:{auto_approve_enabled:E}})),s.jsx(_e,{label:m("welcomeMessages"),children:s.jsx(ol,{"aria-label":m("welcomeMessages"),dir:"auto",value:x.draft.welcome,onChange:E=>x.setField("welcome",E.target.value)})})]}),s.jsx(qc,{dirty:x.dirty,saving:i,justSaved:x.status==="saved",error:x.error,onDiscard:x.revert,saveLabel:m("save"),discardLabel:m("discard"),unsavedLabel:m("unsavedChanges"),savedLabel:m("saved")})]})}),d.length>0&&s.jsx(rh,{summary:m("groupCommands"),children:s.jsx("ul",{className:"flex list-none flex-col gap-3 p-0",children:d.map(E=>{var z;return s.jsxs("li",{className:"flex flex-col gap-1",children:[s.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("code",{dir:"ltr",className:"font-mono text-sm font-bold text-brand-cyan",children:[f,E.name]}),s.jsx(We,{children:h(E.permission)}),s.jsx(We,{tone:E.enabled?"ok":"neutral",children:E.enabled?m("statusEnabled"):m("statusDisabled")})]}),s.jsx("p",{dir:"auto",className:"text-xs text-muted",children:((z=E.descriptions)==null?void 0:z[p])||E.description})]},E.key||E.name)})})})]})}var cv;const Wb=typeof((cv=window.LevixHost)==null?void 0:cv.hostLog)=="function",FE=()=>{const{t:n}=Ue(),{toast:i}=Ct(),[r,o]=y.useState(!1),[d,f]=y.useState(!1),[m,p]=y.useState(!1),h=y.useRef(!1),b=y.useRef(0),[x,v]=y.useState([]),[S,A]=y.useState("all"),[k,N]=y.useState(!0),j=y.useRef(null),[L,_]=y.useState("bot"),[G,R]=y.useState([]),ne=y.useCallback(async()=>{var J;if(h.current)return;const O=b.current;try{if(L==="bot"){const Z=await $.getLogs();if(O!==b.current)return;v(Z.logs||[])}else{const Z=((J=window.LevixHost)==null?void 0:J.hostLog(500))??"";if(O!==b.current)return;R(Z.split(`
561
- `).filter(Boolean))}o(!1)}catch{O===b.current&&o(!0)}},[L]);y.useEffect(()=>{b.current+=1;let O=!1,J;const Z=async()=>{await ne(),O||(J=setTimeout(Z,3e3))};return Z(),()=>{O=!0,clearTimeout(J),b.current+=1}},[ne]);const U=async()=>{var O;if(!h.current){h.current=!0,p(!0),b.current+=1;try{if(L==="bot")await $.clearLogs();else if(!JSON.parse(((O=window.LevixHost)==null?void 0:O.clearHostLogs())||"{}").ok)throw new Error("clear failed");f(!1),i(n("logsCleared"),"success")}catch{i(n("logsClearFailed"),"error")}finally{h.current=!1,p(!1),await ne()}}};y.useEffect(()=>{k&&j.current&&j.current.scrollIntoView({behavior:"smooth"})},[x,G,k]);const M=x.filter(O=>S==="all"?!0:O.level===S),T=L==="bot"?M.length:G.length,P=O=>O==="error"?"danger":O==="warn"?"warn":"info";return s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(gl,{icon:s.jsx(fl,{size:20}),title:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[n("liveServerLogs"),s.jsx(We,{tone:"neutral",className:"font-mono",children:T})]}),description:n("logsSubtitle"),actions:s.jsxs(yl,{children:[Wb&&s.jsx(Ia,{"aria-label":n("logs"),value:L,onChange:O=>{h.current||_(O)},options:[{value:"bot",label:n("logSourceBot")},{value:"host",label:n("logSourceHost"),icon:s.jsx(_r,{size:14})}]}),L==="bot"&&s.jsx(xl,{label:n("filter"),resetLabel:n("reset"),activeCount:S==="all"?0:1,onReset:()=>A("all"),children:s.jsx(Sn,{name:"log-level",label:n("allLogs"),value:S,onChange:A,options:[{value:"all",label:n("allLogs")},{value:"info",label:"INFO"},{value:"warn",label:"WARN"},{value:"error",label:"ERROR"}]})}),L==="host"&&Wb&&s.jsx(Oe,{label:n("shareLogs"),icon:s.jsx(Hr,{size:18}),onClick:()=>{var O;try{(O=window.LevixHost)==null||O.shareHostLogs()}catch{}}}),s.jsx(Oe,{label:n("autoScroll"),pressed:k,icon:s.jsx(Ck,{size:18,className:k?"animate-bounce":""}),onClick:()=>N(O=>!O)}),s.jsx(Oe,{label:n("clearLogs"),variant:"ghost",icon:s.jsx(Mn,{size:18}),disabled:m,onClick:()=>f(!0)})]})}),s.jsxs(hl,{isOpen:d,onClose:()=>{m||f(!1)},onConfirm:U,title:n("clearLogsConfirm"),confirmLabel:n("clearLogs"),cancelLabel:n("cancel"),loading:m,children:[n("clearLogsBody")," · ",n(L==="host"?"logSourceHost":"logSourceBot")]}),r&&s.jsx("p",{role:"alert",className:"text-sm text-danger",children:n("logsLoadFailed")}),s.jsxs(Ze,{padded:!1,className:"h-[65vh] overflow-y-auto bg-bg p-4 font-mono text-xs leading-relaxed text-muted shadow-2xl md:p-5",dir:"ltr","data-tour":"logs-stream",children:[L==="bot"?M.length===0?s.jsx(mt,{icon:s.jsx(fl,{size:24}),text:n("noLogs")}):s.jsx("div",{className:"flex flex-col gap-1.5",children:M.map((O,J)=>s.jsxs("div",{className:"rounded px-1 py-0.5 hover:bg-panel-hover/40",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"shrink-0 select-none text-[11px] text-faint",children:O.time||new Date().toLocaleTimeString()}),s.jsx(We,{tone:P(O.level||"info"),className:"px-1.5 py-px font-mono text-[10px]",children:(O.level||"info").toUpperCase()})]}),s.jsx("span",{className:"whitespace-pre-wrap break-words font-mono text-text-main [overflow-wrap:anywhere]",children:O.msg})]},J))}):G.length===0?s.jsx(mt,{icon:s.jsx(_r,{size:24}),text:n("noLogs")}):s.jsx("div",{className:"flex flex-col gap-1.5",children:G.map((O,J)=>s.jsx("div",{className:"rounded px-1 py-0.5 hover:bg-panel-hover/40",children:s.jsx("span",{className:"break-all font-mono text-text-main",children:O})},J))}),s.jsx("div",{ref:j})]})]})},GE=n=>{if(!n||n.endsWith("@lid"))return null;const i=n.split("@")[0].split(":")[0].replace(/\D/g,"");return i?i.length===12?`+${i.slice(0,2)} ${i.slice(2,5)} ${i.slice(5,8)} ${i.slice(8)}`:i.length===11?`+${i.slice(0,1)} ${i.slice(1,4)} ${i.slice(4,7)} ${i.slice(7)}`:`+${i}`:null},IE=({status:n,onNavigate:i})=>{var _,G;const{t:r}=Ue(),{toast:o}=Ct(),[d,f]=y.useState(null),[m,p]=y.useState(!0),[h,b]=y.useState(null),x=!!((_=n==null?void 0:n.user)!=null&&_.id&&h===n.user.id);y.useEffect(()=>{(n==null?void 0:n.state)!=="connected"&&b(null)},[n==null?void 0:n.state]),y.useEffect(()=>{let R=!0;return $.getStats().then(ne=>{R&&(ne!=null&&ne.stats)&&f(ne.stats)}).catch(ne=>{o(ne.message,"error")}).finally(()=>{R&&p(!1)}),()=>{R=!1}},[o]);const v=R=>{const ne=Math.floor(R/86400),U=Math.floor(R%86400/3600),M=Math.floor(R%3600/60);return ne?`${ne} ${r("uptimeDayUnit")} ${U} ${r("uptimeHourUnit")}`:U?`${U} ${r("uptimeHourUnit")} ${M} ${r("uptimeMinuteUnit")}`:`${M} ${r("uptimeMinuteUnit")}`},S=(n==null?void 0:n.state)==="connected",A=GE((G=n==null?void 0:n.user)==null?void 0:G.id),k=async()=>{try{await $.startSession(),o(r("starting"),"info")}catch(R){o(R.message,"error")}},N=async()=>{try{await $.stopSession(),o(r("stop"),"info")}catch(R){o(R.message,"error")}},j=[{id:"connection",title:r("connection"),desc:S?r("connected"):r(n==null?void 0:n.state,"disconnected"),icon:Or,color:"border-brand-cyan/20 bg-brand-cyan/10 text-brand-cyan"},{id:"ai",title:r("ai"),desc:r("aiAssistantDesc")||"Autonomous tool-calling AI agent",icon:Wm,color:"border-brand-purple/20 bg-brand-purple/10 text-brand-purple"},{id:"commands",title:r("commands"),desc:r("quickCommandsDesc").replace("{n}",String((d==null?void 0:d.commandCount)??0)),icon:fl,color:"border-brand-blue/20 bg-brand-blue/10 text-brand-blue"},{id:"settings",title:r("settings"),desc:r("settingsSub")||"Prefix, ports, delays, security & storage",icon:M0,color:"border-ok/20 bg-ok/10 text-ok"}],L=[{label:r("totalGroups"),value:(d==null?void 0:d.totalGroups)??0,icon:rl,tone:"border-brand-blue/20 bg-brand-blue/10 text-brand-blue"},{label:r("commandCount"),value:(d==null?void 0:d.commandCount)??0,icon:fl,tone:"border-brand-cyan/20 bg-brand-cyan/10 text-brand-cyan"},{label:r("uptime"),value:v((d==null?void 0:d.uptime)||0),icon:_v,tone:"border-ok/20 bg-ok/10 text-ok"},{label:r("activeSchedules"),value:(d==null?void 0:d.activeSchedules)??0,icon:kc,tone:"border-brand-purple/20 bg-brand-purple/10 text-brand-purple"}];return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs(Ze,{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("div",{className:"min-w-0 pe-6 rtl:ps-6 rtl:pe-0",children:[s.jsx("h2",{className:"text-base font-extrabold tracking-tight text-text-main sm:text-lg",children:S?r("connected"):r(n==null?void 0:n.state,"disconnected")}),A&&S?s.jsxs("div",{className:"mt-1 flex min-h-10 items-center gap-2",children:[s.jsx("bdi",{dir:"ltr",className:"text-base font-bold text-text-main",children:x?A:"••• ••• ••••"}),s.jsx(Oe,{label:r(x?"hideNumber":"showNumber"),pressed:x,variant:"ghost",icon:x?s.jsx(Pv,{size:18}):s.jsx(Si,{size:18}),onClick:()=>{var R;return b(x?null:((R=n==null?void 0:n.user)==null?void 0:R.id)||null)}})]}):null,s.jsx("p",{className:"mt-1 text-sm text-muted",children:r(S?"activeListening":"pausedOrLinking")})]}),s.jsx("div",{className:"absolute end-0 top-1 rtl:start-0 rtl:end-auto",children:s.jsx(iN,{tone:S?"ok":"warn",label:r(S?"online":"offline")})})]}),s.jsxs("div",{className:"flex items-center gap-2.5",children:[S?s.jsx(de,{variant:"danger",icon:s.jsx(Lm,{size:16}),onClick:N,className:"flex-1 whitespace-nowrap sm:flex-none",children:r("stop")}):s.jsx(de,{variant:"primary",icon:s.jsx(tj,{size:16}),onClick:k,className:"flex-1 whitespace-nowrap sm:flex-none",children:r("start")}),s.jsx(de,{variant:"secondary",icon:s.jsx(Or,{size:16}),onClick:()=>i("connection"),className:"flex-1 whitespace-nowrap sm:flex-none",children:r("connection")})]})]}),s.jsx("div",{className:"grid grid-cols-2 gap-3 sm:gap-5 lg:grid-cols-4","data-tour":"overview-stats",children:L.map(R=>{const ne=R.icon;return s.jsxs(Ze,{children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("span",{className:"line-clamp-2 text-[11px] font-bold uppercase tracking-wider text-muted sm:text-xs",children:R.label}),s.jsx("div",{className:`flex size-10 shrink-0 items-center justify-center rounded-xl border ${R.tone}`,children:s.jsx(ne,{size:18})})]}),s.jsx("div",{className:"mt-2 font-mono text-2xl font-extrabold tracking-tight text-text-main sm:text-3xl",children:m?"—":R.value})]},R.label)})}),s.jsx("div",{className:"grid grid-cols-2 gap-3 sm:gap-4 lg:grid-cols-4",children:j.map(R=>{const ne=R.icon;return s.jsx(Ze,{padded:!1,className:"h-full transition-colors hover:border-brand-blue/30",children:s.jsxs(de,{variant:"ghost",onClick:()=>i(R.id),className:"h-full w-full flex-col items-stretch justify-between gap-3 rounded-2xl p-4 text-start sm:gap-4 sm:p-5",children:[s.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[s.jsx("div",{className:`flex size-10 shrink-0 items-center justify-center rounded-xl border ${R.color}`,children:s.jsx(ne,{size:18})}),s.jsx(Oc,{size:16,className:"shrink-0 text-faint rtl:-scale-x-100","aria-hidden":!0})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-xs font-bold text-text-main sm:text-sm",children:R.title}),s.jsx("p",{className:"mt-0.5 line-clamp-2 text-[11px] leading-relaxed text-muted sm:text-xs",children:R.desc})]})]})},R.id)})})]})},wi=()=>window.LevixHost,Mr=new Map;let ev=!1;function VE(){ev||(ev=!0,window.__levixHostDone=(n,i)=>{const r=Mr.get(n);Mr.delete(n),r==null||r(i)})}function Fr(n,i,r){const o=wi(),d=o==null?void 0:o[n];if(!o||typeof d!="function")return Promise.resolve({ok:!1,code:"UNAVAILABLE"});VE();const f=crypto.randomUUID();return new Promise(m=>{var h,b,x,v,S;const p=A=>{m(A)};Mr.set(f,p);try{const A=n==="pickStickerSource"?(h=o.pickStickerSource)==null?void 0:h.call(o,f):n==="pickFile"?(b=o.pickFile)==null?void 0:b.call(o,f):n==="uploadSource"?(x=o.uploadSource)==null?void 0:x.call(o,f,i[0],i[1],i[2]):n==="uploadForm"?(v=o.uploadForm)==null?void 0:v.call(o,f,i[0],i[1],i[2],i[3]):(S=o.exportFile)==null?void 0:S.call(o,f,i[0],i[1],i[2],i[3],i[4],i[5]),k=JSON.parse(A||"");k.ok||(Mr.delete(f),p(k))}catch{Mr.delete(f),p({ok:!1,code:"UNAVAILABLE"})}})}function Rc(){var n;return typeof((n=wi())==null?void 0:n.pickStickerSource)=="function"}function eu(){var n;return typeof((n=wi())==null?void 0:n.exportFile)=="function"}async function KE(){const n=await Fr("pickStickerSource",[]);if(!n.ok&&!n.cancelled)throw Gr(n);return n.ok&&n.token&&n.url?n:null}function YE(){try{const n=wi(),i=n!=null&&n.takePendingSticker?JSON.parse(n.takePendingSticker()):null;return i!=null&&i.ok&&i.token&&i.url&&["create","save"].includes(i.intent)?i:null}catch{return null}}function Gr(n){n.status===401&&(window.location.href="/login");const i=n.body,r=i?(()=>{try{return JSON.parse(i)}catch{return null}})():null,o=n.cancelled?"CANCELLED":n.code==="UNAVAILABLE"?"STORAGE_UNAVAILABLE":n.code;return new Dt(n.status||0,(r==null?void 0:r.error)||n.error||o||"Sticker operation failed",r||{code:o})}async function J1(n,i,r,o){const d=await Fr("uploadSource",[n,i,r]);if(!d.ok||!d.status||d.status<200||d.status>=300)throw Gr(d);try{return JSON.parse(d.body||"")}catch{throw new Dt(d.status,"Invalid upload response",{code:"INTERNAL"})}}function Gc(){var n,i;return typeof((n=wi())==null?void 0:n.uploadForm)=="function"&&typeof((i=wi())==null?void 0:i.pickFile)=="function"}async function W1(){const n=await Fr("pickFile",[]);if(!n.ok&&!n.cancelled)throw Gr(n);return n.ok&&n.token&&n.url?n:null}async function ew(n,i,r,o,d){const f=await Fr("uploadForm",[n,JSON.stringify(i),r,o]);if(!f.ok||!f.status||f.status<200||f.status>=300)throw Gr(f);try{return f.body?JSON.parse(f.body):{}}catch{throw new Dt(f.status||0,"Invalid upload response",{code:"INTERNAL"})}}async function QE(n,i,r,o,d,f){const m=await Fr("exportFile",[n,i,r,o,d,f]);if(!m.ok)throw Gr(m);return m}const XE=["weekdaySun","weekdayMon","weekdayTue","weekdayWed","weekdayThu","weekdayFri","weekdaySat"],ZE=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],$E=["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],tw=[1,2,3,4,6,8,12];function JE(){const n=window.LevixHost;return!!(n&&typeof n.pickContact=="function")}function WE(n){let i=String(n||"").replace(/\D/g,"");return i.startsWith("00")&&(i=i.slice(2)),i.length<8||i.length>15?null:`${i}@s.whatsapp.net`}function Vn(n){const i=String(n||"").trim();return!i||i.includes("@")||/^\d{8,}$/.test(i)?null:i}function eA(n,i){return Vn(n.savedName)||Vn(n.pushName)||Vn(n.name)||Vn(n.targetLabel)||n.phone||i}function Xm(n){return String(n).padStart(2,"0")}function tA(n,i){const r=n.map(o=>i?$E[o]:ZE[o]);return i?r.join(" و"):r.length===1?r[0]:r.length===2?`${r[0]} and ${r[1]}`:`${r.slice(0,-1).join(", ")} and ${r[r.length-1]}`}function nA(n){return n===1?"كل ساعة":n===2?"كل ساعتين":n>=3&&n<=10?`كل ${n} ساعات`:`كل ${n} ساعة`}function tv(n,i){return i==="image"?n("mediaKindImage"):i==="video"?n("mediaKindVideo"):i==="audio"?n("mediaKindAudio"):i==="document"?n("mediaKindDocument"):i}const Pa=({label:n,children:i})=>s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-3",children:[s.jsx("span",{className:"sm:w-32 shrink-0 font-bold text-muted",children:n}),s.jsx("span",{className:"min-w-0",children:i})]});function aA(n,i,r,o,d,f,m,p){const h=/^\d{1,2}:\d{2}$/.test(i),b=m||"UTC";if(n==="hourly")return!Number.isInteger(d)||!tw.includes(d)||!Number.isInteger(f)||f<0||f>59?null:p?`${`${nA(d)} عند الدقيقة ${f}`} (${b})`:`${d===1?`Every hour at minute ${f}`:`Every ${d} hours at minute ${f}`} (${b})`;if(!h)return null;const[x,v]=i.split(":").map(Number);if(x>23||v>59)return null;const S=`${Xm(x)}:${Xm(v)}`;if(n==="daily")return p?`يومياً الساعة ${S} (${b})`:`Daily at ${S} (${b})`;if(n==="weekly"){const A=[...new Set(r.filter(N=>N>=0&&N<=6))].sort((N,j)=>N-j);if(!A.length)return null;const k=tA(A,p);return p?`كل يوم ${k} الساعة ${S} (${b})`:`Every ${k} at ${S} (${b})`}return n==="monthly"?!Number.isInteger(o)||o<1||o>31?null:p?`كل شهر في اليوم ${o} الساعة ${S} (${b})`:`Every month on day ${o} at ${S} (${b})`:null}const Nm={type:"any",delivery:"any",media:"any"};function nv(n){return Vn(n.savedName)||Vn(n.pushName)||Vn(n.targetLabel)||n.targetPhone||n.phone||n.targetJid}function sA(n,i,r){const o=i.trim().toLowerCase();return!(o&&![n.message,n.targetLabel,n.savedName,n.pushName,n.phone,n.targetPhone,n.when,n.whenAr].filter(Boolean).join(" ").toLowerCase().includes(o)||r.type!=="any"&&n.type!==r.type||r.delivery==="failed"&&n.lastDeliveryStatus!=="failed"||r.delivery==="active"&&n.lastDeliveryStatus==="failed"||r.media==="with"&&!n.media||r.media==="without"&&n.media)}function lA(n,i,r){const o=[...n],d=(f,m)=>nv(f).localeCompare(nv(m),r,{sensitivity:"base"});if(i==="oldest")o.sort((f,m)=>(f.createdAt??0)-(m.createdAt??0)||d(f,m));else if(i==="target")o.sort(d);else if(i==="status"){const f=m=>m.lastDeliveryStatus==="failed"?0:1;o.sort((m,p)=>f(m)-f(p)||(p.createdAt??0)-(m.createdAt??0)||d(m,p))}else o.sort((f,m)=>(m.createdAt??0)-(f.createdAt??0)||d(f,m));return o}const iA=({isConnected:n=!1,onNavigate:i})=>{const{t:r,language:o}=Ue(),{toast:d}=Ct(),[f,m]=y.useState([]),[p,h]=y.useState("UTC"),[b,x]=y.useState(!0),[v,S]=y.useState(null),[A,k]=y.useState(0),[N,j]=y.useState(""),[L,_]=y.useState("newest"),[G,R]=y.useState(Nm),[ne,U]=y.useState([]),[M,T]=y.useState(!1),[P,O]=y.useState(null),[J,Z]=y.useState(""),[se,E]=y.useState(!1),[z,F]=y.useState(""),[le,pe]=y.useState("recurring"),[he,I]=y.useState("daily"),[ce,ie]=y.useState("09:00"),[fe,C]=y.useState([1]),[K,Y]=y.useState(1),[me,te]=y.useState(1),[oe,ve]=y.useState(0),[be,Se]=y.useState(""),[it,xt]=y.useState(!1),[Ce,Ie]=y.useState(null),[Fe,ue]=y.useState(null),Re=y.useRef(null),[je,Ke]=y.useState(null),yt=3,jt=20*1024*1024,B=20,ye=f.length>=yt,Le=o==="ar",Ge=y.useMemo(()=>aA(he,ce,fe,K,me,oe,p,Le),[he,ce,fe,K,me,oe,p,Le]),ut=async()=>{x(!0);try{const q=await $.getSchedules();q!=null&&q.schedules&&(m(q.schedules),q.timezone&&h(q.timezone)),S(null)}catch(q){S(q.message),d(q.message,"error")}finally{x(!1)}},Ut=async()=>{T(!0);try{const q=await $.getRecipients();q!=null&&q.recipients&&U(q.recipients)}catch{}finally{T(!1)}};y.useEffect(()=>{ut(),n&&Ut()},[n,A]);const on=y.useMemo(()=>lA(f.filter(q=>sA(q,N,G)),L,o),[f,N,G,L,o]),sn=`${N}|${L}|${G.type}|${G.delivery}|${G.media}`,{page:kn,pageCount:wl,pageItems:Va,setPage:Ms,total:Rs}=Zc(on,20,sn),Ni=(G.type!=="any"?1:0)+(G.delivery!=="any"?1:0)+(G.media!=="any"?1:0),Ka=()=>{j(""),R(Nm)},Ht=async q=>{try{await $.deleteSchedule(q),d(r("savedSuccessfully"),"success"),m(Ne=>Ne.filter(Ve=>Ve.id!==q))}catch(Ne){d(Ne.message,"error")}},Ya=async q=>{if(!n){d(o==="ar"?"واتساب غير متصل، يرجى بدء الاتصال أولاً":"WhatsApp is disconnected, please connect first","warning");return}try{await $.retrySchedule(q),d(o==="ar"?"تمت إعادة محاولة الإرسال":"Delivery retry triggered","info"),ut()}catch(Ne){d(Ne.message,"error")}},zs=async()=>{const q=window.LevixHost;if(!(q!=null&&q.pickContact)){d(o==="ar"?"دليل الهاتف متاح من تطبيق أندرويد فقط":"Phone book is available in the Android app","info");return}const Ne=await new Promise(Qn=>{var sa;const aa=Xn=>{window.removeEventListener("levix-contact",aa);const la=Xn.detail;if(!(la!=null&&la.phone)){Qn(null);return}Qn({name:String(la.name||""),phone:String(la.phone)})};window.addEventListener("levix-contact",aa);try{(sa=q.pickContact)==null||sa.call(q)}catch{window.removeEventListener("levix-contact",aa),Qn(null)}});if(!Ne)return;const Ve=WE(Ne.phone);if(!Ve){d(o==="ar"?"الرقم غير صالح. استخدم رقمًا مع كود الدولة.":"That number is not valid. Use a number with country code.","error");return}const Qt=`+${Ve.split("@")[0]}`,Xt=Vn(Ne.name);O({id:Ve,name:Xt||Qt,savedName:Xt,pushName:null,phone:Qt,type:"contact"})},Qa=()=>{O(null),Z(""),F(""),pe("recurring"),I("daily"),ie("09:00"),C([1]),Y(1),te(1),ve(0),Se(""),Ie(null),ue(null)},ka=()=>{Ie(null),ue(null)},Sl=async()=>{try{const q=await W1();if(!q)return;if(q.size>jt){d(r("feedbackFileTooLarge").replace("{max}",String(B)),"error");return}ue(q)}catch(q){d((q==null?void 0:q.message)||"Could not attach the file","error")}},Xa=()=>{if(!n){d(o==="ar"?"يلزم اتصال واتساب لجدولة الرسائل":"Active WhatsApp connection is required to schedule messages","warning");return}if(ye){d(r("maxSchedulesReached"),"warning");return}Qa(),E(!0),ne.length||Ut()},kl=q=>{C(Ne=>Ne.includes(q)?Ne.filter(Ve=>Ve!==q):[...Ne,q].sort((Ve,Qt)=>Ve-Qt))},re=async()=>{if(!P){d(o==="ar"?"يرجى اختيار المحادثة المستهدفة":"Please select a recipient chat","warning");return}if(!z.trim()&&!Ce&&!Fe){d(o==="ar"?"يرجى كتابة نص الرسالة أو إرفاق ملف":"Please write the message text or attach a file","warning");return}if(le==="once"&&(!be||new Date(be).getTime()<=Date.now())){d(o==="ar"?"يرجى تحديد وقت وتاريخ مستقبلي صالح":"Please select a valid future date and time","warning");return}if(le==="recurring"&&he==="weekly"&&fe.length===0){d(r("weekdayRequired"),"warning");return}xt(!0);const q={targetJid:P.id,message:z.trim(),type:le};if(P.type==="contact"){const Ne=Vn(P.savedName)||Vn(P.name);Ne&&Ne!==P.phone&&(q.targetName=Ne)}if(le==="recurring"){const Ne={kind:he};he==="hourly"?(Ne.everyHours=me,Ne.time=`00:${Xm(oe)}`):(Ne.time=ce,he==="weekly"&&(Ne.weekdays=fe),he==="monthly"&&(Ne.dayOfMonth=K)),q.recurrence=Ne}else q.scheduledTime=new Date(be).getTime();try{const Ne={};for(const[Ve,Qt]of Object.entries(q))Ne[Ve]=Ve==="recurrence"?JSON.stringify(Qt):String(Qt);Fe?await ew("/dashboard/api/schedules",Ne,Fe.token,jt+1024*1024):Ce?await $.postMultipart("/schedules",Ne,Ce):await $.createSchedule(q),d(r("savedSuccessfully"),"success"),E(!1),Qa(),ut()}catch(Ne){d(Ne.message,"error")}finally{xt(!1)}},Me=ne.filter(q=>{var Ve,Qt,Xt;const Ne=J.toLowerCase().trim();return Ne?q.name.toLowerCase().includes(Ne)||!!((Ve=q.savedName)!=null&&Ve.toLowerCase().includes(Ne))||!!((Qt=q.pushName)!=null&&Qt.toLowerCase().includes(Ne))||!!((Xt=q.phone)!=null&&Xt.toLowerCase().includes(Ne)):!0}),He=(q,Ne,Ve=!0)=>{var sa;if(q.type==="group"||q.targetKind==="group"||!!((sa=q.targetJid)!=null&&sa.includes("@g.us"))){const Xn=Vn(q.name)||(Vn(q.targetLabel)&&q.targetLabel!=="Group"?q.targetLabel:null)||r("groupFallback");return s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-brand-cyan min-w-0",children:[Ve&&s.jsx(rl,{size:14,className:"shrink-0"}),s.jsx("span",{className:`${Ne} truncate`,children:Xn})]})}const Xt=q.phone||q.targetPhone||null,Qn=eA(q,r("contactFallback")),aa=!!(Xt&&Qn!==Xt);return s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-ok min-w-0",children:[Ve&&s.jsx(hc,{size:14,className:"shrink-0"}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:`${Ne} truncate block`,children:Qn}),aa&&s.jsx("span",{className:"block text-[11px] text-muted font-mono",dir:"ltr",children:Xt})]})]})};return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[!n&&s.jsxs("div",{className:"rounded-2xl border border-warn/30 bg-warn/10 p-4 sm:p-5 flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-3.5",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-warn/20 text-warn flex items-center justify-center shrink-0",children:s.jsx(ll,{size:22})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm sm:text-base font-bold text-warn",children:o==="ar"?"واتساب غير متصل حالياً":"WhatsApp is Disconnected"}),s.jsx("p",{className:"text-xs sm:text-sm text-text-main/80 mt-0.5",children:o==="ar"?"يلزم وجود اتصال نشط بواتساب لجدولة الرسائل وإرسالها واختيار جهات الاتصال.":"An active WhatsApp connection is required to schedule messages, fetch chats, and deliver automated jobs."})]})]}),s.jsx(de,{variant:"primary",className:"shrink-0",onClick:()=>i==null?void 0:i("connection"),children:o==="ar"?"الذهاب للاتصال":"Go to Connection"})]}),s.jsx(gl,{icon:s.jsx(Mm,{size:24}),title:s.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:[r("schedules"),s.jsxs(We,{tone:ye?"warn":"info",children:[f.length," / ",yt," ",r("scheduledCount")]})]}),description:s.jsxs(s.Fragment,{children:[r("timezoneLabel"),":"," ",s.jsx("code",{className:"rounded border border-line bg-bg-soft px-1.5 py-0.5 font-mono font-semibold text-brand-cyan",children:p})," ","· ",r("headerSubtitle")]}),actions:f.length>0?s.jsx(de,{variant:"primary",size:"lg",className:"w-full sm:w-auto",icon:s.jsx(ul,{size:18}),onClick:Xa,disabled:ye||!n,children:n?r(ye?"limitReached":"scheduleNewMsg"):o==="ar"?"يلزم اتصال واتساب":"Connection Required"}):void 0}),!b&&!v&&f.length>0&&s.jsxs(yl,{"data-tour":"schedules-list",children:[s.jsx(Be,{type:"search",name:"schedule-search",autoComplete:"off",value:N,onChange:q=>j(q.target.value),placeholder:r("searchSchedules"),"aria-label":r("searchSchedules"),className:"min-w-48 flex-1"}),s.jsx(Pr,{label:r("sort"),value:L,onChange:_,options:[{value:"newest",label:r("sortNewest")},{value:"oldest",label:r("sortOldest")},{value:"target",label:r("thTarget")},{value:"status",label:r("thDelivery")}]}),s.jsxs(xl,{label:r("filter"),resetLabel:r("reset"),activeCount:Ni,onReset:()=>R(Nm),children:[s.jsx(Sn,{label:r("thType"),name:"schedule-type-filter",value:G.type,onChange:q=>R(Ne=>({...Ne,type:q})),options:[{value:"any",label:r("statusAny")},{value:"recurring",label:r("typeRecurring")},{value:"once",label:r("typeOnce")}]}),s.jsx(Sn,{label:r("thDelivery"),name:"schedule-delivery-filter",value:G.delivery,onChange:q=>R(Ne=>({...Ne,delivery:q})),options:[{value:"any",label:r("statusAny")},{value:"active",label:r("deliveryActive")},{value:"failed",label:r("deliveryFailed")}]}),s.jsx(Sn,{label:r("thMedia"),name:"schedule-media-filter",value:G.media,onChange:q=>R(Ne=>({...Ne,media:q})),options:[{value:"any",label:r("statusAny")},{value:"with",label:r("mediaWith")},{value:"without",label:r("mediaWithout")}]})]})]}),b&&s.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2","aria-busy":"true",children:["s1","s2","s3","s4"].map(q=>s.jsxs(Ze,{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Gt,{className:"size-10 rounded-xl"}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s.jsx(Gt,{className:"h-4 w-32"}),s.jsx(Gt,{className:"h-3 w-24"})]})]}),s.jsx(Gt,{className:"h-4 w-full"}),s.jsx(Gt,{className:"h-6 w-28"})]},q))}),!b&&v&&s.jsx(mt,{kind:"error",icon:s.jsx(ll,{size:28}),description:v,action:s.jsx(de,{variant:"secondary",icon:s.jsx(dl,{size:16}),onClick:()=>k(q=>q+1),children:r("retryLoad")})}),!b&&!v&&f.length===0&&s.jsx(mt,{kind:"empty",icon:s.jsx(Mm,{size:28}),text:r("noSchedules"),action:s.jsx(de,{variant:"primary",icon:s.jsx(ul,{size:16}),onClick:Xa,disabled:!n||ye,children:r("scheduleNewMsg")})}),!b&&!v&&f.length>0&&on.length===0&&s.jsx(mt,{kind:"no-results",action:s.jsx(de,{variant:"secondary",onClick:Ka,children:r("clearFilters")})}),!b&&!v&&on.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 gap-3 md:hidden",children:Va.map(q=>s.jsxs(Ze,{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[s.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-brand-blue/10 text-brand-cyan",children:q.targetKind==="group"||q.targetJid.includes("@g.us")?s.jsx(rl,{size:18}):s.jsx(hc,{size:18})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("bdi",{children:He({targetJid:q.targetJid,targetKind:q.targetKind,targetLabel:q.targetLabel,targetPhone:q.targetPhone,savedName:q.savedName,pushName:q.pushName,phone:q.phone},"text-sm font-bold text-text-main",!1)}),s.jsx("p",{className:"mt-0.5 truncate text-xs text-muted",dir:"auto",children:Le?q.whenAr||q.when:q.when||q.cronString||"—"})]})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[q.lastDeliveryStatus==="failed"&&s.jsx(Oe,{label:r("retryDelivery"),icon:s.jsx(Ga,{size:16}),onClick:()=>{Ya(q.id)}}),s.jsx(Oe,{label:r("scheduleDetails"),variant:"ghost",icon:s.jsx(Si,{size:16}),onClick:()=>Ke(q)}),s.jsx(Yn,{label:r("moreActions"),children:s.jsx(lt,{danger:!0,icon:s.jsx(Mn,{size:16}),onSelect:()=>{Ht(q.id)},children:r("delete")})})]})]}),s.jsx(rn,{lines:2,className:"text-sm text-text-main",children:q.media?`${q.media.fileName||""} ${q.message}`.trim():q.message||"—"}),s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[q.media&&s.jsxs(We,{tone:"info",children:[s.jsx(Er,{size:12}),tv(r,q.media.kind)]}),s.jsx(We,{tone:q.type==="recurring"?"info":"neutral",children:q.type==="recurring"?r("typeRecurring"):r("typeOnce")}),s.jsxs(Nc,{tone:q.lastDeliveryStatus==="failed"?"danger":q.status==="active"?"ok":"neutral",children:[q.lastDeliveryStatus==="failed"?s.jsx(ll,{size:13}):s.jsx(Cs,{size:13}),s.jsx("span",{children:q.lastDeliveryStatus==="failed"?r("deliveryFailed"):q.status==="active"?r("deliveryActive"):q.status})]})]})]},q.id))}),s.jsx(Ze,{padded:!1,className:"hidden overflow-hidden md:block",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full table-fixed border-collapse text-start text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-panel-raised border-b border-line text-xs font-bold text-muted uppercase tracking-wider",children:[s.jsx("th",{className:"w-[22%] px-4 py-4 text-start",children:r("thTarget")}),s.jsx("th",{className:"w-[30%] px-4 py-4 text-start",children:r("thMessage")}),s.jsx("th",{className:"w-[16%] px-4 py-4 text-start",children:r("thSchedule")}),s.jsx("th",{className:"w-[9%] px-4 py-4 text-start",children:r("thType")}),s.jsx("th",{className:"w-[13%] px-4 py-4 text-start",children:r("thDelivery")}),s.jsx("th",{className:"w-[10%] px-4 py-4 text-center",children:r("thActions")})]})}),s.jsx("tbody",{className:"divide-y divide-line/40",children:Va.map(q=>s.jsxs("tr",{onClick:()=>Ke(q),className:"cursor-pointer transition-colors hover:bg-panel-hover/50",children:[s.jsx("td",{className:"px-4 py-4 text-xs text-text-main",children:s.jsx("bdi",{children:He({targetJid:q.targetJid,targetKind:q.targetKind,targetLabel:q.targetLabel,targetPhone:q.targetPhone,savedName:q.savedName,pushName:q.pushName,phone:q.phone},"font-semibold")})}),s.jsx("td",{className:"px-4 py-4 text-xs text-text-main sm:text-sm",children:s.jsx(rn,{lines:2,children:q.media?`${q.media.fileName||""} ${q.message}`.trim():q.message||"—"})}),s.jsx("td",{className:"px-4 py-4 text-xs text-muted",children:s.jsx("span",{dir:"auto",children:Le?q.whenAr||q.when:q.when||q.cronString||"—"})}),s.jsx("td",{className:"px-4 py-4",children:s.jsx(We,{tone:q.type==="recurring"?"info":"neutral",children:q.type==="recurring"?r("typeRecurring"):r("typeOnce")})}),s.jsx("td",{className:"px-4 py-4",children:s.jsxs(Nc,{tone:q.lastDeliveryStatus==="failed"?"danger":q.status==="active"?"ok":"neutral",children:[q.lastDeliveryStatus==="failed"?s.jsx(ll,{size:13}):s.jsx(Cs,{size:13}),s.jsx("span",{children:q.lastDeliveryStatus==="failed"?r("deliveryFailed"):q.status==="active"?r("deliveryActive"):q.status})]})}),s.jsx("td",{className:"px-4 py-4 text-center",children:s.jsxs("div",{className:"flex items-center justify-center gap-1",onClick:Ne=>Ne.stopPropagation(),children:[q.lastDeliveryStatus==="failed"&&s.jsx(Oe,{label:r("retryDelivery"),icon:s.jsx(Ga,{size:16}),onClick:()=>{Ya(q.id)}}),s.jsx(Yn,{label:r("moreActions"),children:s.jsx(lt,{danger:!0,icon:s.jsx(Mn,{size:16}),onSelect:()=>{Ht(q.id)},children:r("delete")})})]})})]},q.id))})]})})}),s.jsx(ki,{page:kn,pageCount:wl,total:Rs,onPageChange:Ms})]}),s.jsx(an,{isOpen:se,onClose:()=>E(!1),title:r("scheduleNewMsg"),maxWidth:"560px",footer:s.jsxs(s.Fragment,{children:[s.jsx(de,{variant:"secondary",onClick:()=>E(!1),children:r("cancel")}),s.jsx(de,{variant:"primary",loading:it,onClick:re,disabled:it||!P||!z.trim()&&!Ce&&!Fe,children:r(it?"saving":"scheduleAction")})]}),children:s.jsxs("div",{className:"flex flex-col gap-4 py-1",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"block text-xs font-bold text-text-main",children:[r("selectRecipient")," ",s.jsx("span",{className:"text-danger",children:"*"})]}),P?s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl border border-brand-blue/40 bg-brand-blue/10",children:[s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-brand-blue/20 text-brand-cyan flex items-center justify-center shrink-0",children:P.type==="group"?s.jsx(rl,{size:16}):s.jsx(hc,{size:16})}),s.jsx("div",{className:"min-w-0",children:He(P,"text-xs sm:text-sm font-bold text-text-main",!1)})]}),s.jsx(Oe,{label:r("changeChat"),variant:"ghost",icon:s.jsx(Rn,{size:16}),onClick:()=>O(null)})]}):s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"relative min-w-0 flex-1",children:[s.jsx(eh,{size:16,className:"pointer-events-none absolute start-3 top-1/2 -translate-y-1/2 text-muted"}),s.jsx(Be,{type:"search",value:J,onChange:q=>Z(q.target.value),placeholder:r("searchRecipients"),"aria-label":r("searchRecipients"),className:"ps-9"})]}),JE()&&s.jsx(de,{variant:"secondary",size:"sm",className:"shrink-0",icon:s.jsx(Tk,{size:15}),onClick:zs,title:r("pickPhoneContactHint"),children:s.jsx("span",{className:"hidden sm:inline",children:r("pickPhoneContact")})})]}),s.jsx("div",{className:"max-h-48 overflow-y-auto rounded-xl border border-line bg-panel-raised divide-y divide-line/40",children:M?s.jsx("div",{className:"flex justify-center p-4",children:s.jsx(va,{label:r("loading")})}):Me.length===0?s.jsx(mt,{className:"px-4 py-4",text:r("noRecipientsFound")}):Me.map(q=>s.jsxs(de,{variant:"ghost",onClick:()=>O(q),className:"h-auto w-full justify-between gap-2 rounded-none px-2.5 py-2.5 text-start",children:[s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:"w-7 h-7 rounded-lg bg-panel border border-line flex items-center justify-center shrink-0 text-muted",children:q.type==="group"?s.jsx(rl,{size:14}):s.jsx(hc,{size:14})}),s.jsx("div",{className:"min-w-0",children:He(q,"text-xs font-bold text-text-main",!1)})]}),s.jsx(We,{tone:"neutral",className:"shrink-0",children:q.type==="group"?r("groupFallback"):r("contactFallback")})]},q.id))})]})]}),s.jsx(_e,{label:r("scheduleType"),htmlFor:"schedule-type",children:s.jsxs(ft,{id:"schedule-type",value:le,onChange:q=>pe(q.target.value),children:[s.jsx("option",{value:"recurring",children:r("scheduleRecurring")}),s.jsx("option",{value:"once",children:r("scheduleOnce")})]})}),le==="recurring"?s.jsxs("div",{className:"space-y-3 rounded-xl border border-line bg-panel-raised/40 p-3.5",children:[s.jsx(_e,{label:r("repeat"),htmlFor:"repeat-kind",children:s.jsxs(ft,{id:"repeat-kind",value:he,onChange:q=>I(q.target.value),children:[s.jsx("option",{value:"daily",children:r("repeatDaily")}),s.jsx("option",{value:"weekly",children:r("repeatWeekly")}),s.jsx("option",{value:"monthly",children:r("repeatMonthly")}),s.jsx("option",{value:"hourly",children:r("repeatHourly")})]})}),he==="weekly"&&s.jsxs("fieldset",{className:"space-y-1.5",children:[s.jsx("legend",{className:"block text-xs font-bold text-text-main",children:r("weekdays")}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:XE.map((q,Ne)=>{const Ve=fe.includes(Ne);return s.jsx(de,{size:"sm",variant:Ve?"primary":"secondary","aria-pressed":Ve,onClick:()=>kl(Ne),children:r(q)},q)})})]}),he==="monthly"&&s.jsx(_e,{label:r("dayOfMonth"),htmlFor:"day-of-month",description:r("monthDayHint"),children:s.jsx(Be,{id:"day-of-month",type:"number",min:1,max:31,inputMode:"numeric",value:K,onChange:q=>Y(Number(q.target.value))})}),he==="hourly"?s.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[s.jsx(_e,{label:r("everyHours"),htmlFor:"every-hours",children:s.jsx(ft,{id:"every-hours",value:me,onChange:q=>te(Number(q.target.value)),children:tw.map(q=>s.jsx("option",{value:q,children:q},q))})}),s.jsx(_e,{label:r("atMinute"),htmlFor:"hourly-minute",children:s.jsx(Be,{id:"hourly-minute",type:"number",min:0,max:59,inputMode:"numeric",value:oe,onChange:q=>ve(Number(q.target.value)),dir:"ltr"})})]}):s.jsx(_e,{label:s.jsxs(s.Fragment,{children:[r("sendTime"),s.jsxs("span",{className:"ms-1.5 font-semibold text-muted",children:["(",p,")"]})]}),htmlFor:"send-time",children:s.jsx(Be,{id:"send-time",type:"time",value:ce,onChange:q=>ie(q.target.value),dir:"ltr"})}),s.jsxs("p",{className:"text-xs text-text-main/90 bg-bg-soft border border-line rounded-lg px-3 py-2",children:[s.jsxs("span",{className:"font-bold text-muted",children:[r("recurrencePreview"),": "]}),s.jsx("span",{dir:"auto",children:Ge||"—"})]})]}):s.jsx(_e,{label:r("deliveryDateTime"),htmlFor:"one-off-time",children:s.jsx(Be,{id:"one-off-time",type:"datetime-local",value:be,onChange:q=>Se(q.target.value),dir:"ltr"})}),s.jsx(_e,{label:s.jsxs(s.Fragment,{children:[r("messageText")," ",!Ce&&!Fe&&s.jsx("span",{className:"text-danger",children:"*"})]}),htmlFor:"schedule-message",children:s.jsx(ol,{id:"schedule-message",rows:3,placeholder:r("messagePlaceholder"),value:z,onChange:q=>F(q.target.value)})}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("span",{className:"block text-xs font-bold text-text-main",children:r("scheduleAttachMedia")}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Fe||Ce?s.jsxs("span",{className:"inline-flex max-w-full items-center gap-2 rounded-xl border border-brand-blue/40 bg-brand-blue/10 ps-3 pe-1 text-xs text-text-main sm:text-sm",children:[s.jsx(Er,{size:14,className:"shrink-0 text-brand-cyan"}),s.jsx("span",{className:"max-w-[220px] truncate",children:(Fe==null?void 0:Fe.name)??(Ce==null?void 0:Ce.name)}),s.jsx(Oe,{label:r("scheduleRemoveMedia"),variant:"ghost",icon:s.jsx(Rn,{size:14}),onClick:ka})]}):s.jsx(de,{variant:"secondary",size:"sm",icon:s.jsx(Er,{size:14,className:"text-brand-cyan"}),onClick:()=>{var q;return Gc()?void Sl():(q=Re.current)==null?void 0:q.click()},children:r("scheduleAttachMedia")}),s.jsx("span",{className:"text-[11px] text-muted",children:r("scheduleMediaHint").replace("{max}",String(B))})]}),!Gc()&&s.jsx("input",{ref:Re,type:"file",className:"sr-only",onChange:q=>{var Ve;const Ne=((Ve=q.target.files)==null?void 0:Ve[0])??null;if(q.target.value="",!!Ne){if(Ne.size>jt){d(r("feedbackFileTooLarge").replace("{max}",String(B)),"error");return}Ie(Ne)}}})]})]})}),s.jsx(an,{isOpen:!!je,onClose:()=>Ke(null),title:r("scheduleDetails"),maxWidth:"560px",footer:s.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[(je==null?void 0:je.lastDeliveryStatus)==="failed"?s.jsx(Oe,{label:r("retryDelivery"),icon:s.jsx(Ga,{size:16}),onClick:()=>{const q=je.id;Ke(null),Ya(q)}}):s.jsx("span",{}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(de,{variant:"secondary",onClick:()=>Ke(null),children:r("close")}),s.jsx(Yn,{label:r("moreActions"),children:s.jsx(lt,{danger:!0,icon:s.jsx(Mn,{size:16}),onSelect:()=>{const q=je==null?void 0:je.id;Ke(null),q&&Ht(q)},children:r("delete")})})]})]}),children:je&&s.jsxs("div",{className:"flex flex-col gap-3.5 py-1 text-xs sm:text-sm",children:[s.jsx(Pa,{label:r("thTarget"),children:s.jsx("bdi",{children:He({targetJid:je.targetJid,targetKind:je.targetKind,targetLabel:je.targetLabel,targetPhone:je.targetPhone,savedName:je.savedName,pushName:je.pushName,phone:je.phone},"font-semibold",!1)})}),s.jsx(Pa,{label:r("thMessage"),children:je.message?s.jsx("span",{className:"whitespace-pre-wrap break-words",children:je.message}):s.jsx("span",{className:"text-muted",children:"—"})}),je.media&&s.jsx(Pa,{label:r("detailMedia"),children:s.jsxs("span",{className:"inline-flex items-center gap-1.5 min-w-0",children:[s.jsx(Er,{size:13,className:"text-brand-cyan shrink-0"}),s.jsxs("span",{className:"truncate",children:[tv(r,je.media.kind),je.media.fileName?` · ${je.media.fileName}`:""]})]})}),s.jsx(Pa,{label:r("thSchedule"),children:s.jsx("span",{dir:"auto",children:Le&&je.whenAr||je.when})}),s.jsx(Pa,{label:r("thType"),children:je.type==="recurring"?r("typeRecurring"):r("typeOnce")}),s.jsx(Pa,{label:r("thDelivery"),children:s.jsxs(Nc,{tone:je.lastDeliveryStatus==="failed"?"danger":je.status==="active"?"ok":"neutral",children:[je.lastDeliveryStatus==="failed"?s.jsx(ll,{size:13}):s.jsx(Cs,{size:13}),s.jsx("span",{children:je.lastDeliveryStatus==="failed"?r("deliveryFailed"):je.status==="active"?r("deliveryActive"):je.status})]})}),je.lastRunAt&&s.jsx(Pa,{label:r("detailLastRun"),children:new Date(je.lastRunAt).toLocaleString(o==="ar"?"ar-EG":"en-GB")}),je.lastError&&s.jsx(Pa,{label:r("detailError"),children:s.jsx("span",{className:"text-danger break-words",dir:"auto",children:je.lastError})}),je.createdAt&&s.jsx(Pa,{label:r("detailCreated"),children:new Date(je.createdAt).toLocaleString(o==="ar"?"ar-EG":"en-GB")})]})})]})};function nw(n,i){const r=Number.isFinite(n)&&n>0?n:0;return r>=1024*1024?i("fileSizeMb").replace("{size}",(r/(1024*1024)).toFixed(1)):i("fileSizeKb").replace("{size}",String(Math.max(1,Math.round(r/1024))))}const aw=({debugLog:n})=>{const{t:i}=Ue();if(!n)return null;const r=new TextEncoder().encode(n).length;return s.jsx("div",{className:"w-full min-w-0",children:s.jsxs(rh,{summary:s.jsxs("span",{className:"flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[s.jsx("span",{className:"min-w-0 break-words text-sm font-semibold text-text-main",children:i("debugLogSectionLabel")}),s.jsx("span",{className:"text-xs text-muted tabular-nums",children:nw(r,i)})]}),children:[s.jsx("p",{className:"mb-2 text-xs leading-relaxed text-muted",children:i("debugLogHint")}),s.jsx("pre",{dir:"ltr",className:"max-h-64 overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-line bg-panel-raised p-2.5 font-mono text-[11px] leading-relaxed text-text-main select-text",children:n})]})})},Cm={messageMin:10,messageMax:2e3,attachmentMax:20*1024*1024},Em={bug:{icon:_k,labelKey:"feedbackTopicBug"},idea:{icon:Kk,labelKey:"feedbackTopicIdea"},question:{icon:L0,labelKey:"feedbackTopicQuestion"},praise:{icon:Fk,labelKey:"feedbackTopicPraise"},other:{icon:yi,labelKey:"feedbackTopicOther"}},rA=["bug","idea","question","praise","other"],oA=()=>{var xt;const{t:n,language:i,theme:r}=Ue(),{toast:o}=Ct(),[d,f]=y.useState(null),[m,p]=y.useState("bug"),[h,b]=y.useState(""),[x,v]=y.useState(0),[S,A]=y.useState(""),[k,N]=y.useState(null),[j,L]=y.useState(null),[_,G]=y.useState(!1),[R,ne]=y.useState(null),[U,M]=y.useState(""),[T,P]=y.useState(""),[O,J]=y.useState(!1),[Z,se]=y.useState(!1),[E,z]=y.useState(null),[F,le]=y.useState(!1),[pe,he]=y.useState(!1),I=y.useRef(null);y.useEffect(()=>{$.getFeedbackMeta().then(f).catch(()=>{})},[]),y.useEffect(()=>{if(!_){ne(null),M(""),P("");return}const Ce=Bm(i,r);J(!0),$.getFeedbackDiagnosticsPreview(Ce).then(Ie=>{Ie!=null&&Ie.diagnostics?(ne(Ie.diagnostics),M(Ie.debugLog||""),P(typeof Ie.debugLogId=="string"?Ie.debugLogId:"")):(ne(Ce),M(""),P(""))}).catch(()=>{ne(Ce),M(""),P("")}).finally(()=>{J(!1)})},[_,i,r]);const ce=(d==null?void 0:d.messageMin)??Cm.messageMin,ie=(d==null?void 0:d.messageMax)??Cm.messageMax,fe=(d==null?void 0:d.attachmentMax)??Cm.attachmentMax,C=Math.round(fe/(1024*1024)),K=h.trim(),Y=Math.max(0,ce-K.length),me=Ce=>nw(Ce,n),te=((xt=d==null?void 0:d.topics)!=null&&xt.length?d.topics:rA).filter(Ce=>Ce in Em),oe=()=>o(n("feedbackFileTooLarge").replace("{max}",String(C)),"error"),ve=async()=>{try{const Ce=await W1();if(!Ce)return;if(Ce.size>fe){oe();return}L(Ce)}catch(Ce){o((Ce==null?void 0:Ce.message)||"Could not attach the file","error")}},be=async Ce=>{if(Ce.preventDefault(),Y>0||F)return;le(!0),z(j?0:null);const Ie=_?Bm(i,r):void 0,Fe={message:K,topic:m,rating:x||null,contact:S.trim()||null,...Ie?{diagnostics:Ie}:{},...Ie&&T?{debugLogId:T}:{}};try{j?await ew("/dashboard/api/feedback",{message:Fe.message,topic:Fe.topic,...Fe.rating?{rating:String(Fe.rating)}:{},...Fe.contact?{contact:Fe.contact}:{},...Ie?{diagnostics:JSON.stringify(Ie)}:{},...Ie&&T?{debugLogId:T}:{}},j.token,fe+1024*1024):k?await $.sendFeedbackMultipart(Fe,k,ue=>z(ue)):await $.sendFeedback(Fe),he(!0),o(n("feedbackSent"),"success")}catch(ue){o(ue==null?void 0:ue.message,"error")}finally{le(!1),z(null)}},Se=()=>{b(""),A(""),v(0),p("bug"),N(null),L(null),G(!1),ne(null),se(!1),he(!1)},it=()=>{N(null),L(null)};return pe?s.jsxs(Ze,{className:"border-ok/30 text-center",children:[s.jsx("div",{className:"mx-auto flex size-12 items-center justify-center rounded-full bg-ok/10 text-ok",children:s.jsx(Cs,{size:26})}),s.jsx("h3",{className:"mt-4 text-lg font-bold text-text-main",children:n("feedbackSent")}),s.jsx("p",{className:"mx-auto mt-2 max-w-md text-xs leading-relaxed text-muted sm:text-sm",children:n("feedbackSentDesc")}),s.jsx(de,{className:"mt-6",onClick:Se,children:n("feedbackSendAnother")})]}):s.jsx("div",{className:"flex flex-col gap-5",children:s.jsx(Ze,{children:s.jsxs("form",{onSubmit:be,className:"flex flex-col gap-5",children:[s.jsxs("div",{className:"flex items-center gap-3 pb-4 border-b border-line",children:[s.jsx("div",{className:"w-10 h-10 sm:w-11 sm:h-11 rounded-xl bg-brand-cyan/10 text-brand-cyan flex items-center justify-center shrink-0",children:s.jsx(yi,{size:20})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:n("feedbackTitle")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5",children:n("feedbackDesc")})]})]}),s.jsx(_e,{label:n("feedbackTopicLabel"),children:s.jsx($c,{"aria-label":n("feedbackTopicLabel"),value:m,onChange:p,className:"flex-wrap gap-1.5 sm:gap-2",options:te.map(Ce=>{const Ie=Em[Ce].icon;return{value:Ce,label:n(Em[Ce].labelKey),icon:s.jsx(Ie,{size:16})}})})}),s.jsxs(_e,{label:n("feedbackMessageLabel"),htmlFor:"feedback-message",children:[s.jsx(ol,{id:"feedback-message",rows:6,required:!0,maxLength:ie,value:h,onChange:Ce=>b(Ce.target.value),placeholder:n("feedbackMessagePlaceholder")}),s.jsx("span",{className:"self-end text-[11px] tabular-nums text-muted",children:Y>0?`${Y} ${n("feedbackCharsNeeded")}`:`${h.length} / ${ie}`})]}),s.jsxs(_e,{label:n("feedbackAttach"),description:n("feedbackAttachmentHint").replace("{max}",String(C)),children:[j||k?s.jsx("span",{className:"flex",children:s.jsx(Qc,{onRemove:it,removeLabel:n("feedbackRemoveAttachment"),className:"max-w-full",children:`${(j==null?void 0:j.name)??(k==null?void 0:k.name)} · ${me((j==null?void 0:j.size)??(k==null?void 0:k.size)??0)}`})}):s.jsx(de,{type:"button",variant:"secondary",icon:s.jsx(Er,{size:16,className:"text-brand-cyan"}),className:"w-full justify-center border-dashed",onClick:()=>{var Ce;return Gc()?void ve():(Ce=I.current)==null?void 0:Ce.click()},children:n("feedbackAttach")}),!Gc()&&s.jsx("input",{ref:I,type:"file",className:"sr-only",onChange:Ce=>{var Fe;const Ie=((Fe=Ce.target.files)==null?void 0:Fe[0])??null;if(Ce.target.value="",!!Ie){if(Ie.size>fe){oe();return}N(Ie)}}})]}),s.jsxs("fieldset",{className:"flex flex-col gap-2",children:[s.jsx("legend",{className:"text-xs sm:text-sm font-bold text-text-main mb-1",children:n("feedbackRatingLabel")}),s.jsx("div",{className:"flex items-center justify-center gap-1",children:[1,2,3,4,5].map(Ce=>s.jsx(Oe,{label:`${Ce} / 5`,variant:"ghost","aria-pressed":x===Ce,onClick:()=>v(x===Ce?0:Ce),icon:s.jsx(Kc,{size:22,className:Ce<=x?"fill-brand-cyan text-brand-cyan":"text-muted"})},Ce))})]}),s.jsx(_e,{label:n("feedbackContactLabel"),htmlFor:"feedback-contact",children:s.jsx(Be,{id:"feedback-contact",type:"text",maxLength:200,value:S,onChange:Ce=>A(Ce.target.value),placeholder:n("feedbackContactPlaceholder")})}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(bi,{id:"feedback-diagnostics-consent",checked:_,onChange:Ce=>G(Ce.target.checked),label:n("feedbackAttachDiagnostics")}),_&&s.jsxs("details",{open:Z,onToggle:Ce=>se(Ce.currentTarget.open),className:"group rounded-xl border border-line bg-panel-raised",children:[s.jsxs("summary",{className:"flex min-h-10 cursor-pointer list-none items-center gap-2 px-3 py-2 text-xs font-semibold text-muted select-none hover:text-text-main [&::-webkit-details-marker]:hidden",children:[s.jsx("span",{className:"flex-1",children:n("feedbackDiagnosticsPreview")}),O?s.jsx(va,{className:"size-3.5 shrink-0 text-muted"}):s.jsx(cl,{size:14,"aria-hidden":!0,className:"shrink-0 transition-transform group-open:rotate-180"})]}),s.jsx("div",{className:"border-t border-line px-3 py-2 text-xs",children:O&&!R?s.jsx("p",{className:"text-muted",children:n("feedbackDiagnosticsLoading")}):R?s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("pre",{dir:"ltr",className:"overflow-x-auto rounded-lg bg-panel p-2 font-mono text-[11px] leading-relaxed text-text-main border border-line select-text",children:JSON.stringify(R,null,2)}),s.jsx(aw,{debugLog:U})]}):s.jsx("p",{className:"text-muted",children:n("feedbackDiagnosticsEmpty")})})]})]}),F&&(j||k)&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{className:"h-2 rounded-full bg-line overflow-hidden",children:j?s.jsx("div",{className:"h-full w-1/3 rounded-full bg-brand-blue animate-pulse"}):s.jsx("div",{className:"h-full rounded-full bg-brand-blue transition-[width]",style:{width:`${Math.max(4,Math.round((E??0)*100))}%`}})}),s.jsxs("span",{className:"text-[11px] text-muted tabular-nums",children:[n("feedbackSending"),!j&&E!==null&&E>0?` ${Math.round(E*100)}%`:"…"]})]}),s.jsxs("div",{className:"flex flex-col gap-3 border-t border-line pt-4",children:[s.jsxs("div",{className:"flex flex-col gap-2.5 sm:flex-row sm:items-center sm:justify-between",children:[d!=null&&d.runtime?s.jsxs("span",{className:"text-[11px] text-muted",children:[n("feedbackRuntimeLabel"),": v",d.runtime.version," · ",d.runtime.platform]}):s.jsx("span",{}),s.jsx(de,{type:"submit",variant:"primary",disabled:Y>0,loading:F,icon:s.jsx(yi,{size:16}),className:"w-full sm:w-auto",children:n(F?"feedbackSending":"feedbackSendBtn")})]}),s.jsxs("details",{className:"group rounded-xl border border-line bg-panel-raised",children:[s.jsxs("summary",{className:"flex min-h-10 cursor-pointer list-none items-center gap-2 px-3 py-2 text-xs font-semibold text-muted select-none hover:text-text-main [&::-webkit-details-marker]:hidden",children:[s.jsx(th,{size:14,className:"shrink-0 text-brand-cyan"}),s.jsx("span",{className:"flex-1",children:n("feedbackWhatIsSent")}),s.jsx(cl,{size:14,"aria-hidden":!0,className:"shrink-0 transition-transform group-open:rotate-180"})]}),s.jsx("p",{className:"px-3 pb-3 text-xs leading-relaxed text-muted",children:n("feedbackWhatIsSentDesc")})]}),s.jsxs("p",{className:"text-xs leading-relaxed text-muted",children:[n("feedbackGithubHint")," ",s.jsxs("a",{href:"https://github.com/Abdodiab2005/levix/issues",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 font-semibold text-brand-cyan hover:underline",children:[n("feedbackOpenGithub"),s.jsx(Pk,{size:13,"aria-hidden":!0,className:"shrink-0"})]})]})]})]})})})},cA=()=>{const{t:n}=Ue(),{toast:i}=Ct(),[r,o]=y.useState([]),[d,f]=y.useState([]),[m,p]=y.useState(!0),[h,b]=y.useState(null),[x,v]=y.useState(null),[S,A]=y.useState(null),[k,N]=y.useState(!1),j=y.useCallback(async()=>{b(null);try{const R=await $.getCrashReports();R&&(o(R.reports||[]),f(R.sent||[]))}catch(R){b((R==null?void 0:R.message)||"Failed to load crash reports")}finally{p(!1)}},[]);y.useEffect(()=>{j()},[j]);const L=async(R,ne)=>{v(R);try{await $.sendCrashReport(R,ne),i(n("reportSentSuccess"),"success"),await j()}catch(U){i((U==null?void 0:U.message)||"Send failed","error"),await j()}finally{v(null)}},_=async R=>{try{await $.deleteCrashReport(R),i(n("reportDeleteSuccess"),"success"),await j()}catch(ne){i((ne==null?void 0:ne.message)||"Delete failed","error")}finally{A(null)}},G=async()=>{try{await $.deleteAllCrashReports(),i(n("allReportsDeleted"),"success"),await j()}catch(R){i((R==null?void 0:R.message)||"Delete all failed","error")}finally{N(!1)}};return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs(Ze,{className:"flex flex-col gap-5",children:[s.jsx(wn,{icon:s.jsx(Ur,{size:22}),title:n("diagnosticsTitle"),description:n("diagnosticsDesc"),actions:r.length>0?s.jsx(Yn,{label:n("more"),children:s.jsx(lt,{danger:!0,icon:s.jsx(Mn,{size:16}),onSelect:()=>N(!0),children:n("deleteAllReports")})}):void 0}),s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("h3",{className:"text-sm font-bold text-text-main flex items-center gap-2",children:[s.jsx("span",{children:n("pendingReports")}),r.length>0&&s.jsx(We,{tone:"info",className:"tabular-nums",children:r.length})]}),m?s.jsx(Ts,{text:n("loading")}):h?s.jsx(mt,{kind:"error",title:h,action:s.jsx(de,{variant:"secondary",onClick:j,children:n("retry")})}):r.length===0?s.jsx(mt,{kind:"empty",icon:s.jsx(Cs,{size:32,className:"text-ok"}),title:n("noPendingReports")}):s.jsx("div",{className:"flex flex-col gap-3",children:r.map(R=>{const{status:ne,lastError:U,debugLog:M,debugLogId:T,...P}=R;return s.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-line bg-panel-raised p-4 transition-colors",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 border-b border-line pb-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 min-w-0",children:[s.jsx(We,{tone:"neutral",children:R.category}),s.jsx("span",{className:"font-mono text-xs sm:text-sm font-bold text-text-main truncate",children:R.error.type}),s.jsx(Br,{value:R.createdAt,className:"text-xs text-muted"})]}),s.jsxs("div",{className:"flex items-center gap-2 self-end sm:self-auto shrink-0",children:[s.jsx(de,{variant:"primary",size:"sm",loading:x===R.id,disabled:x!==null,onClick:()=>L(R.id,T),icon:s.jsx(yi,{size:14}),children:x===R.id?n("sendingReport"):n("sendReport")}),s.jsx(Oe,{label:n("deleteReport"),icon:s.jsx(Mn,{size:16}),variant:"ghost",onClick:()=>A(R.id)})]})]}),s.jsx("p",{className:"text-xs leading-relaxed text-muted select-text",children:R.error.message}),R.lastError&&s.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-danger/30 bg-danger/10 p-2.5 text-xs text-danger",children:[s.jsx(ml,{size:15,className:"shrink-0 mt-0.5"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("span",{className:"font-semibold",children:[n("reportLastError"),": "]}),s.jsx("span",{children:R.lastError})]})]}),s.jsxs("details",{className:"group rounded-xl border border-line bg-panel mt-1",children:[s.jsxs("summary",{className:"flex min-h-10 cursor-pointer list-none items-center gap-2 px-3 py-2 text-xs font-semibold text-muted select-none hover:text-text-main [&::-webkit-details-marker]:hidden",children:[s.jsx("span",{className:"flex-1",children:n("crashReportPreview")}),s.jsx(cl,{size:14,"aria-hidden":!0,className:"shrink-0 transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"border-t border-line p-3",children:[s.jsx("pre",{dir:"ltr",className:"overflow-x-auto rounded-lg bg-panel-raised p-2.5 font-mono text-[11px] leading-relaxed text-text-main border border-line select-text",children:JSON.stringify(P,null,2)}),s.jsx("div",{className:"mt-2",children:s.jsx(aw,{debugLog:M})})]})]})]},R.id)})})]}),s.jsxs("div",{className:"flex flex-col gap-3 border-t border-line pt-4",children:[s.jsxs("h3",{className:"text-sm font-bold text-text-main flex items-center gap-2",children:[s.jsx("span",{children:n("sentReports")}),d.length>0&&s.jsx(We,{tone:"neutral",className:"tabular-nums",children:d.length})]}),d.length===0?s.jsx("p",{className:"text-xs text-muted py-2",children:n("noSentReports")}):s.jsx("div",{className:"flex flex-col gap-2",children:d.map(R=>s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 rounded-xl border border-line bg-panel-raised p-3 text-xs",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 min-w-0",children:[s.jsx(We,{tone:"neutral",className:"shrink-0",children:R.category}),s.jsx("span",{className:"font-mono font-semibold text-text-main select-all",children:R.id}),s.jsx("span",{className:"text-muted truncate",children:R.type})]}),s.jsx(Br,{value:R.sentAt,className:"text-muted shrink-0"})]},R.id))})]})]}),s.jsx(hl,{isOpen:S!==null,onClose:()=>A(null),onConfirm:()=>S&&_(S),title:n("confirmDeleteReport"),description:n("confirmDeleteReportDesc"),confirmLabel:n("deleteReport"),cancelLabel:n("cancel"),variant:"danger"}),s.jsx(hl,{isOpen:k,onClose:()=>N(!1),onConfirm:G,title:n("confirmDeleteAllReports"),description:n("confirmDeleteAllDesc"),confirmLabel:n("deleteAllReports"),cancelLabel:n("cancel"),variant:"danger"})]})},uA=["general","integrations","proxy","security","storage","feedback","diagnostics"];function av(){const n=window.location.hash.replace(/^#\/?/,"").split("/");return n[0]==="settings"&&n[1]&&uA.includes(n[1])?n[1]:"general"}const dA=["!","/",".","#","$","?"],fA="levix-settings";function mA(n){const i=new TextEncoder().encode(n);let r="";for(const o of i)r+=String.fromCharCode(o);return btoa(r)}function Am(n,i){const r=i instanceof Dt?i.data:null,o=typeof(r==null?void 0:r.error)=="string"?r.error:"",d=o==="expired"||o==="no_pending"||o==="too_many_attempts";switch(o){case"invalid_email":return{text:n("recoveryErrInvalidEmail"),backToEmail:d};case"wrong_password":return{text:n("recoveryErrWrongPassword"),backToEmail:d};case"throttled":return{text:Bt(n("recoveryErrThrottled"),{n:Number(r==null?void 0:r.retryAfter)||60}),backToEmail:d};case"rate_limited":return{text:r!=null&&r.retryAfter?Bt(n("recoveryErrThrottled"),{n:r.retryAfter}):n("recoveryErrRateLimited"),backToEmail:d};case"":case"unavailable":return{text:n("recoveryErrUnavailable"),backToEmail:d};case"invalid":return{text:n("recoveryErrInvalid"),backToEmail:d};case"wrong_code":{const f=(r==null?void 0:r.attemptsLeft)==null?"":` ${Bt(n("recoveryErrAttemptsLeft"),{n:r.attemptsLeft})}`;return{text:`${n("recoveryErrWrongCode")}${f}`,backToEmail:d}}case"expired":case"no_pending":case"too_many_attempts":return{text:n("recoveryErrExpired"),backToEmail:d};default:return{text:n("recoveryErrFailed"),backToEmail:!1}}}function hA(){const{t:n,language:i}=Ue(),{toast:r}=Ct(),[o,d]=y.useState(!1),[f,m]=y.useState(!1),[p,h]=y.useState(!1),[b,x]=y.useState(!1),[v,S]=y.useState(null),[A,k]=y.useState(!1),[N,j]=y.useState("email"),[L,_]=y.useState(""),[G,R]=y.useState(""),[ne,U]=y.useState(""),[M,T]=y.useState(!1),[P,O]=y.useState(null),[J,Z]=y.useState(null),[se,E]=y.useState(!1),[z,F]=y.useState(!1);y.useEffect(()=>{let fe=!1;return $.getRecoveryEmail().then(C=>{fe||(h(!!C.verified),x(!!C.needsVerification),S(typeof C.masked=="string"?C.masked:null),d(!0))}).catch(()=>{fe||(m(!0),d(!0))}),()=>{fe=!0}},[]);function le(){j("email"),_(""),R(""),U(""),O(null),Z(null)}function pe(){k(!0),le()}function he(){k(!1),le()}async function I(fe){if(fe.preventDefault(),!M){if(T(!0),N==="email"){O(null);try{await $.startRecoveryEmail(L.trim(),G,i==="ar"?"ar":"en"),j("code"),R(""),U(""),Z(null)}catch(C){O(Am(n,C).text)}finally{T(!1)}return}Z(null);try{const C=await $.verifyRecoveryEmail(ne.trim());h(!0),x(!1),S(C.masked),k(!1),le(),r(n("recoveryEmailVerified"),"success")}catch(C){const K=Am(n,C);K.backToEmail?(j("email"),U(""),Z(null),O(K.text)):Z(K.text)}finally{T(!1)}}}async function ce(){F(!0);try{await $.deleteRecoveryEmail(),h(!1),x(!1),S(null),k(!1),le(),E(!1),r(n("recoveryEmailRemoved"),"success")}catch(fe){r(Am(n,fe).text,"error")}finally{F(!1)}}const ie=!f&&o&&(!p||A||N==="code");return s.jsxs(Ze,{className:"flex max-w-xl flex-col gap-4",children:[s.jsx(wn,{icon:s.jsx(Qk,{size:20}),title:n("recoveryEmailTitle"),description:n("recoveryEmailDesc")}),s.jsx("p",{className:"text-xs text-muted",children:n("recoveryEmailTokenPolicy")}),b&&s.jsx("p",{role:"status",className:"text-sm text-warn",children:n("recoveryEmailReverify")}),f?s.jsx("p",{className:"text-sm text-danger",children:n("recoveryErrFailed")}):o?v&&!A&&N==="email"?s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs font-bold text-text-main",children:n("recoveryEmailCurrent")}),s.jsx(rn,{dir:"ltr",className:"font-mono text-sm text-text-main",children:v})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[p&&s.jsx(de,{variant:"secondary",onClick:pe,children:n("recoveryEmailChange")}),s.jsx(Oe,{label:n("recoveryEmailRemove"),variant:"danger",icon:s.jsx(Mn,{size:16}),onClick:()=>E(!0)})]})]}):null:s.jsx(va,{className:"size-5",label:n("loading")}),ie&&s.jsxs("form",{onSubmit:I,className:"flex flex-col gap-3.5",children:[p&&v&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("p",{className:"text-xs text-muted",children:n("recoveryEmailStays")}),s.jsx(rn,{dir:"ltr",className:"font-mono text-sm text-text-main",children:v})]}),N==="email"?s.jsxs(s.Fragment,{children:[s.jsx(_e,{label:n("recoveryEmailLabel"),htmlFor:"recovery-email",error:P,children:s.jsx(Be,{id:"recovery-email",type:"text",inputMode:"email",autoComplete:"email",technical:!0,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off",required:!0,value:L,onChange:fe=>_(fe.target.value)})}),s.jsx(_e,{label:n("currentPassword"),description:n("recoveryEmailPasswordHint"),htmlFor:"recovery-current-password",children:s.jsx(qa,{id:"recovery-current-password",autoComplete:"current-password",required:!0,value:G,onChange:fe=>R(fe.target.value)})})]}):s.jsx(_e,{label:n("recoveryEmailCode"),description:n("recoveryEmailCodeSent"),htmlFor:"recovery-code",error:J,children:s.jsx(Be,{id:"recovery-code",type:"text",inputMode:"numeric",autoComplete:"one-time-code",technical:!0,className:"font-mono",maxLength:6,required:!0,value:ne,onChange:fe=>U(fe.target.value)})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(de,{type:"submit",variant:"primary",loading:M,children:n(N==="email"?"recoveryEmailSendCode":"recoveryEmailVerify")}),N==="code"?s.jsx(de,{variant:"ghost",onClick:()=>{j("email"),U(""),Z(null)},disabled:M,children:n("cancel")}):A&&s.jsx(de,{variant:"ghost",onClick:he,disabled:M,children:n("cancel")})]})]}),s.jsx(hl,{isOpen:se,onClose:()=>{z||E(!1)},onConfirm:ce,title:n("recoveryEmailRemoveTitle"),description:n("recoveryEmailRemoveDesc"),confirmLabel:n("delete"),cancelLabel:n("cancel"),variant:"danger",loading:z})]})}const pA=()=>{var je,Ke,yt,jt;const{t:n,language:i,setLanguage:r}=Ue(),{toast:o}=Ct(),d=T1(),[f,m]=y.useState(av);y.useEffect(()=>{const B=()=>{const ye=av();m(Le=>Le!==ye?ye:Le)};return window.addEventListener("hashchange",B),()=>window.removeEventListener("hashchange",B)},[]);const p=B=>{m(B),window.location.hash=`settings/${B}`},[h,b]=y.useState({}),[x,v]=y.useState({}),[S,A]=y.useState(!0),[k,N]=y.useState("!"),[j,L]=y.useState("!"),[_,G]=y.useState(!1),[R,ne]=y.useState(""),[U,M]=y.useState(""),[T,P]=y.useState(""),[O,J]=y.useState(!1),[Z,se]=y.useState(!1),[E,z]=y.useState(!1),[F,le]=y.useState(null),pe=y.useRef(null),he=async(B,ye)=>{await $.updateSetting(B,ye),B.endsWith("_api_key")||B==="whatsapp_proxy_password"?(b(Ge=>({...Ge,[B]:""})),v(Ge=>({...Ge,[B]:!!String(ye||"").trim()}))):b(Ge=>({...Ge,[B]:ye}))},I=async(B,ye)=>{b(Le=>({...Le,[B]:ye}));try{await $.updateSetting(B,ye),o(n("savedSuccessfully"),"success")}catch(Le){o(Le.message,"error"),await Ce()}},ce=bn(i),ie=bn(String(h.bot_language||"auto")),fe=bn(String(h.bot_timezone||"Africa/Cairo")),C=bn(String(h.openweathermap_api_key||"")),K=bn(String(h.youtube_api_key||"")),Y=bn(Number(h.forward_score_ttl_days||30)),me=bn(Number(h.max_fetch_bytes||524288)),te=bn(Number(h.sticker_library_limit||1e3)),oe=bn(Number(h.auto_delete_keep_days||30)),ve=Pc({min:Number(h.bot_min_delay_ms??400),max:Number(h.bot_max_delay_ms??900)}),be=Pc({protocol:String(h.whatsapp_proxy_protocol||"http"),host:String(h.whatsapp_proxy_host||""),port:Number(h.whatsapp_proxy_port||0),username:String(h.whatsapp_proxy_username||""),password:String(h.whatsapp_proxy_password||"")}),Se=async()=>{var B;se(!0);try{const ye=await $.exportSettings(),Le=JSON.stringify(ye,null,2),Ge=`levix-settings-${((B=ye.exportedAt)==null?void 0:B.slice(0,10))||"export"}.json`,ut=window.LevixHost;if(ut&&typeof ut.saveExportFile=="function"){const kn=JSON.parse(ut.saveExportFile(Ge,mA(Le)));if(!(kn!=null&&kn.ok))throw new Error((kn==null?void 0:kn.error)||n("exportSettingsError"));o(`${n("exportSettingsSuccess")} — ${n("exportSavedTo")} ${kn.dir}`,"success");return}const Ut=new Blob([Le],{type:"application/json"}),on=URL.createObjectURL(Ut),sn=document.createElement("a");sn.href=on,sn.download=Ge,sn.click(),URL.revokeObjectURL(on),o(n("exportSettingsSuccess"),"success")}catch(ye){o(ye.message||n("exportSettingsError"),"error")}finally{se(!1)}},it=async B=>{var Ge;const ye=(Ge=B.target.files)==null?void 0:Ge[0];if(B.target.value="",!ye)return;let Le;try{Le=JSON.parse(await ye.text())}catch{o(n("importSettingsError"),"error");return}if((Le==null?void 0:Le.format)!==fA){o(n("importSettingsError"),"error");return}le(Le)},xt=async()=>{var B,ye,Le;if(F){z(!0);try{const Ge=await $.importSettings(F),ut=[`${((B=Ge.applied)==null?void 0:B.length)||0} ${n("importSettingsCount")}`];(ye=Ge.skipped)!=null&&ye.length&&ut.push(`${n("importSkipped")}: ${Ge.skipped.length}`),(Le=Ge.restartNeeded)!=null&&Le.length&&ut.push(`${n("importRestartNeeded")}: ${Ge.restartNeeded.join(", ")}`),o(`${n("importSuccess")} — ${ut.join(" · ")}`,"success"),le(null),await Ce()}catch(Ge){o(Ge.message,"error")}finally{z(!1)}}},Ce=async()=>{try{const B=await $.getSettings();if(B!=null&&B.settings){const ye={},Le={};B.settings.forEach(Ge=>{Ge.type==="secret"?(Le[Ge.key]=!!Ge.configured,ye[Ge.key]=""):ye[Ge.key]=Ge.value}),b(ye),v(Le)}B!=null&&B.prefix&&(N(B.prefix),L(B.prefix))}catch(B){o(B.message,"error")}finally{A(!1)}};y.useEffect(()=>{Ce()},[]);const Ie=async B=>{const ye=(B!==void 0?B:j).trim();if(!ye||ye.length>3){o(n("prefixValidation"),"error");return}G(!0);try{await $.updatePrefix(ye),N(ye),L(ye),o(`${n("prefixUpdated")} (${ye})`,"success")}catch(Le){o(Le.message,"error")}finally{G(!1)}},Fe=async B=>{if(B.preventDefault(),U!==T){o(n("passwordMatchError"),"error");return}if(U.length<8){o(n("passwordMinLength"),"error");return}J(!0);try{await $.changePassword(R,U),o(n("passwordChangedSuccess"),"success"),ne(""),M(""),P("")}catch(ye){o(ye.message,"error")}finally{J(!1)}},ue={saveLabel:n("save"),savedLabel:n("saved")},Re={saveLabel:n("save"),discardLabel:n("discard"),unsavedLabel:n("unsavedChanges"),savedLabel:n("saved")};return S?s.jsx("div",{className:"flex items-center justify-center p-12",children:s.jsx(va,{className:"size-6",label:n("loading")})}):s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsx($c,{value:f,onChange:B=>p(B),"aria-label":n("settings"),className:"overflow-x-auto no-scrollbar",options:[{value:"general",label:n("tabGeneral"),icon:s.jsx(M0,{size:17})},{value:"integrations",label:n("tabIntegrations"),icon:s.jsx(Rm,{size:17})},{value:"proxy",label:n("tabProxy"),icon:s.jsx(Bc,{size:17})},{value:"security",label:n("tabSecurity"),icon:s.jsx(th,{size:17})},{value:"storage",label:n("tabStorage"),icon:s.jsx($y,{size:17})},{value:"feedback",label:n("tabFeedback"),icon:s.jsx($k,{size:17})},{value:"diagnostics",label:n("tabDiagnostics"),icon:s.jsx(Ur,{size:17})}]}),f==="general"&&s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsxs(Ze,{className:"flex flex-col gap-4 sm:gap-5","data-tour":"settings-general",children:[s.jsx(wn,{icon:s.jsx(fl,{size:22}),title:n("prefixTitle"),description:n("prefixDesc"),actions:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-xs font-semibold text-muted",children:[n("activePrefix"),":"]}),s.jsx(We,{tone:"info",className:"font-mono",children:k})]})}),s.jsxs("div",{className:"flex flex-col items-stretch gap-4 sm:flex-row sm:items-center",children:[s.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5 sm:max-w-72",children:[s.jsx("span",{className:"text-xs font-semibold text-muted",children:n("prefixPresets")}),s.jsx("div",{className:"flex max-w-full items-center gap-2 overflow-x-auto no-scrollbar pb-1",children:dA.map(B=>{const ye=k===B;return s.jsx(Oe,{label:B,size:"md",variant:ye?"primary":"secondary",className:"shrink-0 font-mono",onClick:()=>{L(B),Ie(B)},children:B},B)})})]}),s.jsx(_e,{label:n("changePrefix"),className:"min-w-[200px] flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Be,{type:"text",className:"h-11 w-20 text-center font-mono sm:w-24",maxLength:3,placeholder:n("prefixPlaceholder"),value:j,onChange:B=>L(B.target.value),onKeyDown:B=>{B.key==="Enter"&&Ie()}}),s.jsx(de,{variant:"primary",icon:s.jsx(xi,{size:16}),onClick:()=>Ie(),disabled:_||j.trim()===k,loading:_,children:n(_?"saving":"prefixSaveBtn")})]})})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-xs font-semibold text-muted sm:text-sm",children:n("prefixPreview")}),s.jsx(We,{tone:"info",className:"font-mono",children:s.jsxs("code",{children:[j||k,"help"]})}),s.jsx(We,{tone:"info",className:"font-mono",children:s.jsxs("code",{children:[j||k,"lang ar"]})}),s.jsx(We,{tone:"info",className:"font-mono",children:s.jsxs("code",{children:[j||k,"sticker"]})})]})]}),s.jsxs(Ze,{className:"flex flex-col gap-4",children:[s.jsx(wn,{title:i==="ar"?"سلوك النظام والردود":"System Behavior & Delays"}),s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[s.jsx(vn,{label:n("interfaceLanguage"),description:n("interfaceLanguageDesc"),htmlFor:"panel-language",dirty:ce.dirty,saving:ce.status==="saving",justSaved:ce.status==="saved",error:ce.error,onSave:()=>ce.save(async B=>r(B)),onRevert:ce.revert,...ue,children:s.jsxs(ft,{id:"panel-language",value:ce.value,onChange:B=>{const ye=B.target.value;(ye==="ar"||ye==="en")&&ce.setValue(ye)},children:[s.jsx("option",{value:"ar",children:"العربية (RTL - اليمين لليسار)"}),s.jsx("option",{value:"en",children:"English (LTR - Left to Right)"})]})}),s.jsx(vn,{label:n("botLanguage"),description:n("botLanguageDesc"),htmlFor:"bot-language",dirty:ie.dirty,saving:ie.status==="saving",justSaved:ie.status==="saved",error:ie.error,onSave:()=>ie.save(B=>he("bot_language",B)),onRevert:ie.revert,...ue,children:s.jsxs(ft,{id:"bot-language",value:ie.value,onChange:B=>ie.setValue(B.target.value),children:[s.jsx("option",{value:"auto",children:n("langAuto")}),s.jsx("option",{value:"ar",children:n("langAr")}),s.jsx("option",{value:"en",children:n("langEn")})]})}),s.jsx(vn,{label:n("botTimezone"),description:n("botTimezoneDesc"),htmlFor:"bot-timezone",dirty:fe.dirty,saving:fe.status==="saving",justSaved:fe.status==="saved",error:fe.error,onSave:()=>fe.save(B=>he("bot_timezone",B)),onRevert:fe.revert,...ue,children:s.jsx(Be,{id:"bot-timezone",type:"text",technical:!0,className:"font-mono",placeholder:"Africa/Cairo",value:fe.value,onChange:B=>fe.setValue(B.target.value)})})]}),s.jsxs("form",{className:"flex flex-col gap-3",onSubmit:B=>{B.preventDefault(),ve.save(async ye=>{if(ye.min>ye.max)throw new Error(n("delayRangeError"));await he("bot_min_delay_ms",ye.min),await he("bot_max_delay_ms",ye.max)})},onKeyDown:B=>{B.key==="Escape"&&ve.revert()},children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[s.jsx(_e,{label:n("botMinDelay"),description:n("delaysDesc"),htmlFor:"bot-min-delay",children:s.jsx(Be,{id:"bot-min-delay",type:"number",value:ve.draft.min,onChange:B=>ve.setField("min",Number(B.target.value))})}),s.jsx(_e,{label:n("botMaxDelay"),htmlFor:"bot-max-delay",children:s.jsx(Be,{id:"bot-max-delay",type:"number",value:ve.draft.max,onChange:B=>ve.setField("max",Number(B.target.value))})})]}),s.jsx(qc,{dirty:ve.dirty,saving:ve.status==="saving",justSaved:ve.status==="saved",error:ve.error,onDiscard:ve.revert,...Re})]})]}),s.jsxs(Ze,{className:"flex flex-col gap-4",children:[s.jsx(wn,{icon:s.jsx(Hr,{size:20}),title:n("shareSettingsTitle"),description:n("shareSettingsDesc")}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(de,{variant:"secondary",icon:s.jsx(Y0,{size:16}),onClick:Se,loading:Z,children:n("exportAction")}),s.jsx(de,{variant:"secondary",icon:s.jsx(Vc,{size:16}),onClick:()=>{var B;return(B=pe.current)==null?void 0:B.click()},children:n("importSettings")})]}),s.jsx("input",{ref:pe,type:"file",accept:"application/json,.json",className:"hidden",onChange:it})]}),s.jsxs(Ze,{className:"flex flex-col gap-4",children:[s.jsx(wn,{icon:s.jsx(Ok,{size:20}),title:n("tourReplayTitle"),description:n("tourReplayDesc")}),s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:s.jsx(de,{variant:"secondary",icon:s.jsx(Mk,{size:16}),onClick:()=>d==null?void 0:d.startMainTour(),children:n("tourReplayAction")})})]})]}),f==="integrations"&&s.jsxs(Ze,{className:"flex flex-col gap-5",children:[s.jsx(wn,{icon:s.jsx(Rm,{size:22}),title:n("tabIntegrations"),description:n("integrationsDesc")}),s.jsxs("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-2",children:[s.jsx(vn,{label:n("weatherApiKey"),description:i==="ar"?"مطلوب لتشغيل أمر الطقس والأحوال الجوية !weather":"Required for the !weather forecast command",htmlFor:"weather-api-key",dirty:C.dirty,saving:C.status==="saving",justSaved:C.status==="saved",error:C.error,onSave:()=>C.save(async B=>{await he("openweathermap_api_key",B),C.setValue("")}),onRevert:C.revert,...ue,children:s.jsx(qa,{id:"weather-api-key",className:"font-mono",placeholder:x.openweathermap_api_key?"••••••••••••":"OpenWeatherMap API Key",value:C.value,onChange:B=>C.setValue(B.target.value)})}),s.jsx(vn,{label:n("youtubeApiKey"),description:i==="ar"?"مطلوب لأدوات البحث ومعلومات الفيديوهات من يوتيوب":"Required for YouTube search and video tools",htmlFor:"youtube-api-key",dirty:K.dirty,saving:K.status==="saving",justSaved:K.status==="saved",error:K.error,onSave:()=>K.save(async B=>{await he("youtube_api_key",B),K.setValue("")}),onRevert:K.revert,...ue,children:s.jsx(qa,{id:"youtube-api-key",className:"font-mono",placeholder:x.youtube_api_key?"••••••••••••":"YouTube Data API Key",value:K.value,onChange:B=>K.setValue(B.target.value)})})]})]}),f==="proxy"&&s.jsxs(Ze,{className:"flex flex-col gap-5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(wn,{className:"min-w-0 flex-1",icon:s.jsx(Bc,{size:22}),title:n("proxyTitle"),description:n("proxyDesc")}),s.jsx(Kn,{className:"shrink-0",checked:!!h.whatsapp_proxy_enabled,onChange:B=>I("whatsapp_proxy_enabled",B)})]}),s.jsxs("form",{className:"flex flex-col gap-4",onSubmit:B=>{B.preventDefault(),be.save(async ye=>{await he("whatsapp_proxy_protocol",ye.protocol),await he("whatsapp_proxy_host",ye.host),await he("whatsapp_proxy_port",ye.port),await he("whatsapp_proxy_username",ye.username),ye.password.trim()&&await he("whatsapp_proxy_password",ye.password),be.setDraft({...ye,password:""})})},onKeyDown:B=>{B.key==="Escape"&&be.revert()},children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[s.jsx(_e,{label:n("proxyProtocol"),htmlFor:"proxy-protocol",children:s.jsxs(ft,{id:"proxy-protocol",value:be.draft.protocol,onChange:B=>be.setField("protocol",B.target.value),children:[s.jsx("option",{value:"http",children:"HTTP"}),s.jsx("option",{value:"https",children:"HTTPS"}),s.jsx("option",{value:"socks5",children:"SOCKS5"})]})}),s.jsx(_e,{label:n("proxyHost"),htmlFor:"proxy-host",children:s.jsx(Be,{id:"proxy-host",type:"text",technical:!0,className:"font-mono",placeholder:"proxy.example.com",value:be.draft.host,onChange:B=>be.setField("host",B.target.value)})}),s.jsx(_e,{label:n("proxyPort"),htmlFor:"proxy-port",children:s.jsx(Be,{id:"proxy-port",type:"number",placeholder:"1080",value:be.draft.port,onChange:B=>be.setField("port",Number(B.target.value))})}),s.jsx(_e,{label:n("proxyUsername"),htmlFor:"proxy-username",children:s.jsx(Be,{id:"proxy-username",type:"text",technical:!0,className:"font-mono",value:be.draft.username,onChange:B=>be.setField("username",B.target.value)})}),s.jsx(_e,{label:n("proxyPassword"),htmlFor:"proxy-password",children:s.jsx(qa,{id:"proxy-password",placeholder:x.whatsapp_proxy_password?"••••••••••••":void 0,value:be.draft.password,onChange:B=>be.setField("password",B.target.value)})})]}),s.jsx(qc,{dirty:be.dirty,saving:be.status==="saving",justSaved:be.status==="saved",error:be.error,onDiscard:be.revert,...Re})]})]}),f==="security"&&s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsxs(Ze,{className:"flex max-w-xl flex-col gap-4","data-tour":"settings-password",children:[s.jsx(wn,{icon:s.jsx(e0,{size:20}),title:n("changePassword")}),s.jsxs("form",{onSubmit:Fe,className:"flex flex-col gap-3.5",children:[s.jsx(_e,{label:n("currentPassword"),htmlFor:"current-password",children:s.jsx(qa,{id:"current-password",required:!0,value:R,onChange:B=>ne(B.target.value)})}),s.jsx(_e,{label:n("newPassword"),description:n("passwordMinLength"),htmlFor:"new-password",children:s.jsx(qa,{id:"new-password",required:!0,minLength:8,value:U,onChange:B=>M(B.target.value)})}),s.jsx(_e,{label:n("confirmPassword"),htmlFor:"confirm-password",children:s.jsx(qa,{id:"confirm-password",required:!0,minLength:8,value:T,onChange:B=>P(B.target.value)})}),s.jsx(de,{type:"submit",variant:"primary",className:"mt-2 w-full self-start sm:w-auto",icon:s.jsx(xi,{size:16}),disabled:O,loading:O,children:n(O?"saving":"save")})]})]}),s.jsx(hA,{})]}),f==="storage"&&s.jsxs(Ze,{className:"flex flex-col gap-5",children:[s.jsx(wn,{icon:s.jsx($y,{size:22}),title:n("storageTitle"),description:n("storageDesc")}),s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[s.jsx(vn,{label:n("forwardTtl"),description:n("forwardTtlDesc"),htmlFor:"forward-ttl",dirty:Y.dirty,saving:Y.status==="saving",justSaved:Y.status==="saved",error:Y.error,onSave:()=>Y.save(B=>he("forward_score_ttl_days",B)),onRevert:Y.revert,...ue,children:s.jsx(Be,{id:"forward-ttl",type:"number",value:Y.value,onChange:B=>Y.setValue(Number(B.target.value))})}),s.jsx(vn,{label:n("maxFetchBytes"),description:n("maxFetchBytesDesc"),htmlFor:"max-fetch-bytes",dirty:me.dirty,saving:me.status==="saving",justSaved:me.status==="saved",error:me.error,onSave:()=>me.save(B=>he("max_fetch_bytes",B)),onRevert:me.revert,...ue,children:s.jsx(Be,{id:"max-fetch-bytes",type:"number",value:me.value,onChange:B=>me.setValue(Number(B.target.value))})}),s.jsx(vn,{label:n("stickerLibraryLimit"),htmlFor:"sticker-library-limit",description:n("stickerLibraryLimitDesc"),dirty:te.dirty,saving:te.status==="saving",justSaved:te.status==="saved",error:te.error,onSave:()=>te.save(B=>he("sticker_library_limit",B)),onRevert:te.revert,...ue,children:s.jsx(Be,{id:"sticker-library-limit",type:"number",min:1,max:1e5,value:te.value,onChange:B=>te.setValue(Number(B.target.value))})}),s.jsx(vn,{label:n("autoDeleteKeepDays"),htmlFor:"auto-delete-keep-days",description:n("autoDeleteKeepDaysDesc"),dirty:oe.dirty,saving:oe.status==="saving",justSaved:oe.status==="saved",error:oe.error,onSave:()=>oe.save(B=>he("auto_delete_keep_days",B)),onRevert:oe.revert,...ue,children:s.jsx(Be,{id:"auto-delete-keep-days",type:"number",min:1,max:365,value:oe.value,onChange:B=>oe.setValue(Number(B.target.value))})})]})]}),f==="feedback"&&s.jsx("div",{"data-tour":"settings-feedback",children:s.jsx(oA,{})}),f==="diagnostics"&&s.jsx("div",{"data-tour":"settings-diagnostics",children:s.jsx(cA,{})}),s.jsx(an,{isOpen:!!F,onClose:()=>le(null),title:n("importTitle"),footer:s.jsxs(s.Fragment,{children:[s.jsx(de,{variant:"secondary",onClick:()=>le(null),children:n("cancel")}),s.jsx(de,{variant:"primary",onClick:xt,disabled:E,loading:E,children:n("importApply")})]}),children:F&&s.jsxs("div",{className:"flex flex-col gap-3 text-xs text-text-main sm:text-sm",children:[s.jsx("p",{className:"text-muted",children:n("importSummary")}),s.jsxs("ul",{className:"flex flex-col gap-1.5 rounded-xl border border-line bg-panel-raised p-4",children:[s.jsxs("li",{children:[n("importPrefix"),":"," ",s.jsx("span",{className:"font-mono font-bold",children:(je=F.commands)==null?void 0:je.prefix})]}),s.jsxs("li",{children:[Object.keys(F.settings||{}).length," ",n("importSettingsCount")]}),s.jsxs("li",{children:[Object.keys(((Ke=F.commands)==null?void 0:Ke.permissions)||{}).length," ",n("importPermissionsCount")]}),s.jsxs("li",{children:[Object.keys(((yt=F.commands)==null?void 0:yt.aliases)||{}).length," ",n("importAliasesCount")]}),s.jsxs("li",{children:[(((jt=F.commands)==null?void 0:jt.disabled)||[]).length," ",n("importDisabledCount")]})]})]})})]})};function Ic(n,i){return`${[...(n||"sticker").replace(/[\\/:*?"<>|]+/g," ").trim()||"sticker"].slice(0,80).join("")}.${i}`}function sw(n,i){const r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=i,o.rel="noopener",document.body.appendChild(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(r),1500)}async function lw(n,i){return sw(n,i),{ok:!0,via:"browser"}}async function iw(n,i,r){const o=new File([n],i,{type:r});if(typeof navigator.share=="function"&&typeof navigator.canShare=="function"&&navigator.canShare({files:[o]}))try{return await navigator.share({files:[o]}),{ok:!0,via:"share"}}catch(f){if(f instanceof DOMException&&f.name==="AbortError")return{ok:!1,cancelled:!0}}return sw(n,i),{ok:!0,via:"browser"}}async function tu(n,i,r,o,d,f){const m=await QE(n,i,r,o,d,f);return n==="share"?{ok:!0,via:"share"}:{ok:!0,via:"host",name:m.name||d,dir:m.dir||"Downloads/Levix"}}const _s={webp:"image/webp",png:"image/png",gif:"image/gif",zip:"application/zip"};function nu(n,i,r,o){return{name:n||i,mime:r.type||o,blob:r}}async function Rr(n,i){if(eu())return tu("save",`/dashboard/api/stickers/${encodeURIComponent(n.id)}/export?format=${i}`,"GET","",Ic(n.name,i),_s[i]);const r=await $.exportSticker(n.id,i),o=nu(r.fileName,Ic(n.name,i),r.blob,_s[i]);return lw(o.blob,o.name)}async function rw(n,i){if(eu())return tu("share",`/dashboard/api/stickers/${encodeURIComponent(n.id)}/export?format=${i}`,"GET","",Ic(n.name,i),_s[i]);const r=await $.exportSticker(n.id,i),o=nu(r.fileName,Ic(n.name,i),r.blob,_s[i]);return iw(o.blob,o.name,o.mime)}async function gA(n,i){if(eu())return tu("save","/dashboard/api/stickers/export","POST",JSON.stringify({ids:n,format:i}),`stickers-${i}.zip`,_s.zip);const r=await $.exportStickers(n,i),o=nu(r.fileName,`stickers-${i}.zip`,r.blob,_s.zip);return lw(o.blob,o.name)}async function xA(n,i){if(eu())return tu("share","/dashboard/api/stickers/export","POST",JSON.stringify({ids:n,format:i}),`stickers-${i}.zip`,_s.zip);const r=await $.exportStickers(n,i),o=nu(r.fileName,`stickers-${i}.zip`,r.blob,_s.zip);return iw(o.blob,o.name,o.mime)}async function Zm(n){if(n.length)try{await $.bulkStickers({action:"touch",ids:n})}catch{}}const yA=16*1024*1024,sv=200,bA=10,ow=40,au=60,vA=[['"','"'],["'","'"],["“","”"],["«","»"],["„","‟"],["‹","›"]],lv=typeof Intl<"u"&&"Segmenter"in Intl?new Intl.Segmenter("en",{granularity:"grapheme"}):null;function wA(n){const i=n.trim();if(i.length<2)return i;for(const[r,o]of vA)if(i.startsWith(r)&&i.endsWith(o)&&i.length>r.length+o.length-1)return i.slice(r.length,i.length-o.length).trim();return i}function SA(n){if(!lv)return[...n].length;let i=0;for(const r of lv.segment(n))i+=1;return i}function zr(n){const i=wA(n).normalize("NFC").replace(/\s+/g," ").trim(),r=SA(i);return r<1?"empty":r>ow?"long":null}function kA(n){return n.type.startsWith("video/")||/\.(mp4|webm|mov|mkv)$/i.test(n.name)}function jA(n){return new Promise(i=>{const r=URL.createObjectURL(n),o=new Image;o.onload=()=>{URL.revokeObjectURL(r),i({width:o.naturalWidth,height:o.naturalHeight})},o.onerror=()=>{URL.revokeObjectURL(r),i(null)},o.src=r})}function NA(n){return new Promise(i=>{const r=URL.createObjectURL(n),o=document.createElement("video");o.preload="metadata",o.onloadedmetadata=()=>{const d={width:o.videoWidth,height:o.videoHeight,duration:o.duration};URL.revokeObjectURL(r),o.src="",i(d)},o.onerror=()=>{URL.revokeObjectURL(r),i(null)},o.src=r})}async function CA(n,i){if(n.size<=0)return"stickerErr_NO_MEDIA";if(n.size>i.uploadBytes)return"stickerErr_TOO_LARGE";if(kA(n)){const o=await NA(n);return o?o.width>i.maxSide||o.height>i.maxSide?"stickerErr_DIMENSIONS_TOO_LARGE":Number.isFinite(o.duration)&&o.duration>i.videoSeconds+.05?"stickerErr_VIDEO_TOO_LONG":null:null}const r=await jA(n);return r&&(r.width>i.maxSide||r.height>i.maxSide)?"stickerErr_DIMENSIONS_TOO_LARGE":null}function EA(n){return!n||n==="transparent"?"transparent":n==="#ffffff"?"white":n==="#000000"?"black":"custom"}const AA=({options:n,onChange:i,canRemoveBackground:r,name:o,onName:d,packId:f,onPack:m,packs:p})=>{var S,A,k;const{t:h}=Ue(),b=EA(n.background),x=((S=n.removeBackground)==null?void 0:S.tolerance)??.15,v=n.rotate??0;return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{children:[s.jsx(Es,{htmlFor:"sticker-fit",children:h("fit")}),s.jsxs(ft,{id:"sticker-fit",value:n.fit||"contain",onChange:N=>i({fit:N.target.value==="cover"?"cover":"contain"}),children:[s.jsx("option",{value:"contain",children:h("contain")}),s.jsx("option",{value:"cover",children:h("cover")})]})]}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-zoom",children:[h("zoom")," (",(n.zoom??1).toFixed(2),")"]}),s.jsx("input",{id:"sticker-zoom",type:"range",min:1,max:4,step:.01,value:n.zoom??1,onChange:N=>i({zoom:Number(N.target.value)}),className:"w-full accent-brand-blue"}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-pan-x",children:[h("panX")," (",(n.panX??0).toFixed(2),")"]}),s.jsx("input",{id:"sticker-pan-x",type:"range",min:-1,max:1,step:.01,value:n.panX??0,onChange:N=>i({panX:Number(N.target.value)}),className:"w-full accent-brand-blue"}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-pan-y",children:[h("panY")," (",(n.panY??0).toFixed(2),")"]}),s.jsx("input",{id:"sticker-pan-y",type:"range",min:-1,max:1,step:.01,value:n.panY??0,onChange:N=>i({panY:Number(N.target.value)}),className:"w-full accent-brand-blue"}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(de,{onClick:()=>i({panX:0,panY:0,zoom:1}),children:h("resetPan")}),s.jsxs(de,{onClick:()=>{const N=(v+90)%360;i({rotate:N})},children:[h("rotateQuarter")," (",v,"°)"]})]}),s.jsx(Ia,{"aria-label":h("background"),className:"max-w-full flex-wrap",value:b,onChange:N=>{i(N==="transparent"?{background:"transparent"}:N==="white"?{background:"#ffffff"}:N==="black"?{background:"#000000"}:{background:"#3366ff"})},options:[{value:"transparent",label:h("transparent")},{value:"white",label:h("white")},{value:"black",label:h("black")},{value:"custom",label:h("customColor")}]}),b==="custom"&&s.jsx("input",{type:"color","aria-label":h("customColor"),value:/^#[0-9a-f]{6}$/i.test(n.background||"")?n.background:"#3366ff",onChange:N=>i({background:N.target.value.toLowerCase()}),className:"h-10 w-full rounded-xl border border-line bg-panel-raised"}),r&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(bi,{checked:((A=n.removeBackground)==null?void 0:A.mode)==="plain",onChange:N=>i({removeBackground:N.target.checked?{mode:"plain",tolerance:.15}:null}),label:h("removePlainBackground"),description:h("stickerRemoveHint")}),((k=n.removeBackground)==null?void 0:k.mode)==="plain"&&s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-tolerance",children:[h("tolerance")," (",x.toFixed(2),")"]}),s.jsx("input",{id:"sticker-tolerance",type:"range",min:.02,max:.6,step:.01,value:x,onChange:N=>i({removeBackground:{mode:"plain",tolerance:Number(N.target.value)}}),className:"w-full accent-brand-blue"})]})]}),s.jsxs("div",{children:[s.jsx(Es,{htmlFor:"sticker-name",children:h("stickerName")}),s.jsx(Be,{id:"sticker-name",value:o,maxLength:au,dir:"auto",onChange:N=>d(N.target.value),placeholder:h("stickerNamePlaceholder")})]}),s.jsxs("div",{children:[s.jsx(Es,{htmlFor:"sticker-pack",children:h("targetPack")}),s.jsxs(ft,{id:"sticker-pack",value:f,onChange:N=>m(N.target.value),children:[s.jsx("option",{value:"",children:h("noPack")}),p.map(N=>s.jsx("option",{value:N.id,children:N.name},N.id))]})]})]})},TA=({options:n,onChange:i,kind:r,durationMs:o,limits:d,animatedOk:f})=>{const{t:m}=Ue();if(!(r==="video"||r==="gif"))return null;const h=o>0?o/1e3:d.videoSeconds,b=Math.min(d.videoSeconds,Math.max(0,h)),x=(v,S)=>{const A=Math.min(b,Math.max(0,v)),k=Math.min(d.stickerSeconds,Math.max(.5,S));i({trim:{start:A,duration:k}})};return s.jsxs(Ze,{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsx(bi,{checked:!!n.trim,onChange:v=>{v.target.checked?x(0,Math.min(d.stickerSeconds,Math.max(.5,h))):i({trim:null})},label:s.jsx("span",{className:"font-bold",children:m("trim")})}),n.trim&&s.jsxs("span",{className:"font-mono text-xs text-muted",dir:"ltr",children:[n.trim.start.toFixed(1),"s →"," ",(n.trim.start+n.trim.duration).toFixed(1),"s"]})]}),!f&&s.jsx("p",{className:"text-xs text-warn",children:m("animatedUnavailable")}),s.jsx("p",{className:"text-xs text-muted",children:m(r==="gif"?"gifTrimNote":"trimApplied")}),n.trim&&s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"text-xs font-bold",htmlFor:"trim-start",children:[m("trimStart")," (",n.trim.start.toFixed(1)," ",m("trimSeconds"),")"]}),s.jsx("input",{id:"trim-start",type:"range",min:0,max:b,step:.1,value:n.trim.start,onChange:v=>{var S;return x(Number(v.target.value),((S=n.trim)==null?void 0:S.duration)??.5)},className:"w-full accent-brand-blue"}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"trim-duration",children:[m("trimDuration")," (",n.trim.duration.toFixed(1)," ",m("trimSeconds"),")"]}),s.jsx("input",{id:"trim-duration",type:"range",min:.5,max:d.stickerSeconds,step:.1,value:n.trim.duration,onChange:v=>{var S;return x(((S=n.trim)==null?void 0:S.start)??0,Number(v.target.value))},className:"w-full accent-brand-blue"})]})]})},Ft=512;function _A(n,i,r){const o=r.fit||"contain",d=r.zoom??1,f=r.panX??0,m=r.panY??0,p=r.rotate??0,h=p===90||p===270,b=h?i:n,x=h?n:i,S=(o==="cover"?Ft/Math.min(b,x):Ft/Math.max(b,x))*d,A=Math.max(1,Math.round(b*S)),k=Math.max(1,Math.round(x*S)),N=Math.round((Ft-A)/2+f*Math.abs(Ft-A)/2),j=Math.round((Ft-k)/2+m*Math.abs(Ft-k)/2);return{width:A,height:k,x:N,y:j}}const DA='"Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif';function MA(n){return/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/.test(n)}function RA(n){const i=/^#([0-9a-f]{6})$/i.exec(n.trim());if(!i)return"#000000";const r=Number.parseInt(i[1],16),o=r>>16&255,d=r>>8&255,f=r&255;return(.2126*o+.7152*d+.0722*f)/255>.6?"#000000":"#ffffff"}function zA(n,i,r,o,d,f){const m=Math.max(0,Math.min(f,o/2,d/2));n.beginPath(),n.moveTo(i+m,r),n.arcTo(i+o,r,i+o,r+d,m),n.arcTo(i+o,r+d,i,r+d,m),n.arcTo(i,r+d,i,r,m),n.arcTo(i,r,i+o,r,m),n.closePath(),n.fill()}function LA(n,i,r,o){const d=n==="center"?"center":n==="start"?i==="rtl"?"right":"left":i==="rtl"?"left":"right";return d==="center"?-r/2-o:d==="right"?-r-o:-o}function cw(n,i,r){const o=[];for(const d of i){if(!d.text)continue;const f=MA(d.text)?"rtl":"ltr";n.save(),n.translate(d.x,d.y),n.rotate(d.rotate*Math.PI/180),n.direction=f,n.font=`${d.fontSize}px ${DA}`,n.textAlign=d.align,n.textBaseline="middle";const m=n.measureText(d.text).width,p=d.background?d.fontSize*.4:8,h=d.background?d.fontSize*.22:6,b=m+p*2,x=d.fontSize*1.25+h*2,v=LA(d.align,f,m,p),S=-x/2;d.background&&(n.fillStyle="rgba(0, 0, 0, 0.55)",zA(n,v,S,b,x,x/2)),r===d.id&&(n.strokeStyle=getComputedStyle(document.documentElement).getPropertyValue("--color-brand-cyan").trim(),n.lineWidth=2,n.strokeRect(v-3,S-3,b+6,x+6)),d.outline&&(n.lineJoin="round",n.miterLimit=2,n.lineWidth=Math.max(2,d.fontSize/10),n.strokeStyle=RA(d.color),n.strokeText(d.text,0,0)),n.fillStyle=d.color,n.fillText(d.text,0,0),n.restore(),o.push({id:d.id,cx:d.x,cy:d.y,rotate:d.rotate,left:v,top:S,right:v+b,bottom:S+x})}return o}function OA(n,i,r){for(let o=n.length-1;o>=0;o--){const d=n[o],f=i-d.cx,m=r-d.cy,p=-d.rotate*Math.PI/180,h=f*Math.cos(p)-m*Math.sin(p),b=f*Math.sin(p)+m*Math.cos(p);if(h>=d.left&&h<=d.right&&b>=d.top&&b<=d.bottom)return d.id}return null}function BA(n){const i=n.filter(d=>d.text.trim().length>0);if(!i.length)return;const r=document.createElement("canvas");r.width=512,r.height=512;const o=r.getContext("2d");if(o)return cw(o,i,null),r.toDataURL("image/png")}const UA=["😀","😂","❤️","🔥","👍","🎉","✨","💯","🙏","😎","🥳","💀","👀","💪","🌹","⭐","✅","😢","🤔","👋"];function Sc(n,i,r){return Math.min(r,Math.max(i,n))}const HA=({mediaUrl:n,kind:i,width:r,height:o,options:d,layers:f,selectedId:m,onPan:p,onSelect:h,onMoveLayer:b,label:x})=>{const v=y.useRef(null),S=y.useRef(null),A=y.useRef([]),k=y.useRef(null),N=y.useRef(null),j=y.useRef(1),L=d.rotate??0,_=r>0&&o>0?_A(r,o,{fit:d.fit,zoom:d.zoom,panX:d.panX,panY:d.panY,rotate:L}):null,G=L===90||L===270,R=_?G?_.height:_.width:0,ne=_?G?_.width:_.height:0,U=_?_.x+(_.width-R)/2:0,M=_?_.y+(_.height-ne)/2:0,T=d.background&&d.background!=="transparent"?d.background:null;y.useEffect(()=>{const E=v.current;if(!E)return;const z=()=>{const le=Math.min(E.clientWidth,512);j.current=le>0?le/Ft:1,E.style.setProperty("--stage-scale",String(j.current))};z();const F=new ResizeObserver(z);return F.observe(E),()=>F.disconnect()},[]),y.useEffect(()=>{const E=S.current;if(!E)return;const z=window.devicePixelRatio||1;E.width=Ft*z,E.height=Ft*z;const F=E.getContext("2d");F&&(F.setTransform(z,0,0,z,0,0),F.clearRect(0,0,Ft,Ft),A.current=cw(F,f,m))},[f,m]),y.useEffect(()=>{const E=N.current,z=d.trim;if(!E||!z||i!=="video"||!n)return;const F=z.start,le=z.start+z.duration,pe=()=>{(E.currentTime<F-.05||E.currentTime>=le-.02)&&(E.currentTime=F)};return E.addEventListener("timeupdate",pe),E.addEventListener("ended",pe),E.currentTime=F,()=>{E.removeEventListener("timeupdate",pe),E.removeEventListener("ended",pe)}},[d.trim,i,n]);const P=E=>{const z=E.currentTarget.getBoundingClientRect();return{x:(E.clientX-z.left)/z.width*Ft,y:(E.clientY-z.top)/z.height*Ft}},O=E=>{if(E.button!==0)return;E.currentTarget.setPointerCapture(E.pointerId);const z=P(E),F=OA(A.current,z.x,z.y);if(F){const le=f.find(pe=>pe.id===F);if(!le)return;h(F),k.current={kind:"layer",id:F,x:z.x,y:z.y,originX:le.x,originY:le.y};return}h(null),_&&(k.current={kind:"pan",x:z.x,y:z.y,panX:d.panX??0,panY:d.panY??0,placeW:_.width,placeH:_.height})},J=E=>{const z=k.current;if(!z)return;const F=P(E);if(z.kind==="layer"){b(z.id,Sc(z.originX+(F.x-z.x),0,Ft),Sc(z.originY+(F.y-z.y),0,Ft));return}const le=Math.abs(Ft-z.placeW),pe=Math.abs(Ft-z.placeH),he=le<1?z.panX:Sc(z.panX+(F.x-z.x)*2/le,-1,1),I=pe<1?z.panY:Sc(z.panY+(F.y-z.y)*2/pe,-1,1);p(he,I)},Z=()=>{k.current=null},se={position:"absolute",left:U,top:M,width:R,height:ne,transform:`rotate(${L}deg)`,transformOrigin:"center center",maxWidth:"none",pointerEvents:"none"};return s.jsx("div",{ref:v,className:"w-full",children:s.jsx("div",{className:"relative mx-auto overflow-hidden rounded-2xl border border-line",style:{width:"calc(512px * var(--stage-scale, 1))",height:"calc(512px * var(--stage-scale, 1))"},children:s.jsxs("div",{role:"img","aria-label":x,className:"absolute top-0 start-0 origin-top-left bg-[repeating-conic-gradient(var(--panel-raised)_0%_25%,var(--bg)_0%_50%)] bg-[length:32px_32px]",style:{width:Ft,height:Ft,transform:"scale(var(--stage-scale, 1))"},children:[T&&s.jsx("div",{className:"absolute inset-0",style:{background:T}}),_&&i==="video"?s.jsx("video",{ref:N,src:n,muted:!0,autoPlay:!0,playsInline:!0,loop:!d.trim,style:se}):_&&s.jsx("img",{src:n,alt:"",draggable:!1,style:se}),s.jsx("canvas",{ref:S,className:"absolute inset-0 w-full h-full touch-none",onPointerDown:O,onPointerMove:J,onPointerUp:Z,onPointerCancel:Z})]})})})},PA=({layers:n,selectedId:i,onSelect:r,onChange:o,onDelete:d,onAddText:f,onAddEmoji:m})=>{const{t:p}=Ue(),h=n.find(b=>b.id===i)||null;return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(de,{onClick:f,children:p("addText")}),s.jsx(de,{onClick:()=>m("😀"),children:p("addEmoji")})]}),s.jsxs("div",{children:[s.jsx(Es,{children:p("emojiPaletteLabel")}),s.jsx("div",{className:"flex flex-wrap gap-1",children:UA.map(b=>s.jsx(Oe,{label:b,variant:"secondary",onClick:()=>m(b),children:s.jsx("span",{className:"text-lg leading-none",children:b})},b))}),s.jsx(Es,{htmlFor:"emoji-free",children:p("customEmoji")}),s.jsx(Be,{id:"emoji-free",className:"mt-1",placeholder:p("emojiInputLabel"),onKeyDown:b=>{if(b.key==="Enter"){const x=b.currentTarget.value.trim();x&&(m(x),b.currentTarget.value="")}}})]}),n.length===0&&s.jsx("p",{className:"text-xs text-muted",children:p("noLayers")}),n.length>0&&s.jsx("div",{className:"flex flex-col gap-1",children:n.map(b=>{const x=b.id===i;return s.jsx(de,{variant:x?"secondary":"ghost","aria-pressed":x,onClick:()=>r(b.id),className:Pe("h-auto w-full justify-start",x&&"border-brand-blue bg-brand-blue/10"),children:s.jsx("span",{className:"truncate",children:b.text||p("textPlaceholder")})},b.id)})}),h&&s.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-line p-3",children:[s.jsx("p",{className:"text-xs font-bold",children:p("layerSelected")}),s.jsx(Es,{htmlFor:"layer-text",children:p("textContent")}),s.jsx(Be,{id:"layer-text",value:h.text,onChange:b=>o(h.id,{text:b.target.value})}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-size",children:p("textSize")}),s.jsx("input",{id:"layer-size",type:"range",min:16,max:200,value:h.fontSize,onChange:b=>o(h.id,{fontSize:Number(b.target.value)}),className:"w-full accent-brand-blue"}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-color",children:p("textColor")}),s.jsx("input",{id:"layer-color",type:"color",value:/^#[0-9a-f]{6}$/i.test(h.color)?h.color:"#ffffff",onChange:b=>o(h.id,{color:b.target.value}),className:"h-10 w-full rounded-xl border border-line bg-panel-raised"}),s.jsx(Ia,{"aria-label":p("textAlignment"),value:h.align,onChange:b=>o(h.id,{align:b}),options:[{value:"start",label:p("stickerAlignmentStart")},{value:"center",label:p("stickerAlignmentCenter")},{value:"end",label:p("stickerAlignmentEnd")}]}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-rotate",children:p("layerRotation")}),s.jsx("input",{id:"layer-rotate",type:"range",min:-180,max:180,value:h.rotate,onChange:b=>o(h.id,{rotate:Number(b.target.value)}),className:"w-full accent-brand-blue"}),s.jsx(bi,{checked:h.outline,onChange:b=>o(h.id,{outline:b.target.checked}),label:p("textOutline")}),s.jsx(bi,{checked:h.background,onChange:b=>o(h.id,{background:b.target.checked}),label:p("textBackground")}),s.jsx(de,{variant:"danger",onClick:()=>d(h.id),icon:s.jsx(Mn,{size:16}),children:p("deleteLayer")})]})]})},uw=({open:n,title:i,packs:r,onClose:o,onPick:d,onCreated:f})=>{const{t:m}=Ue(),{toast:p}=Ct(),[h,b]=y.useState(""),[x,v]=y.useState(null),[S,A]=y.useState(!1);y.useEffect(()=>{n||(b(""),v(null))},[n]);const k=async()=>{if(zr(h)){v(m("packNameLength"));return}A(!0),v(null);try{const j=await $.createPack(h.trim());b(""),f(j),d(j.id),p(m("packCreated"),"success")}catch(j){p(kt(m,j),"error")}finally{A(!1)}};return s.jsx(an,{isOpen:n,onClose:o,title:i,footer:s.jsx(de,{onClick:o,children:m("close")}),children:s.jsxs("div",{className:"flex flex-col gap-3",children:[r.length===0?s.jsx("p",{className:"text-sm text-muted",children:m("noPacks")}):s.jsx("div",{className:"flex max-h-64 flex-col gap-1.5 overflow-y-auto",children:r.map(N=>s.jsxs(de,{variant:"ghost",onClick:()=>d(N.id),className:"h-auto w-full min-w-0 justify-start px-3 py-2.5",children:[s.jsx(rn,{className:"flex-1 text-start",children:N.name}),s.jsx("span",{className:"ms-2 shrink-0 font-medium text-muted",children:N.count})]},N.id))}),s.jsxs("div",{className:"flex flex-col gap-1.5 border-t border-line pt-3",children:[s.jsx(Es,{htmlFor:"new-pack-name",children:m("newPack")}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Be,{id:"new-pack-name",value:h,onChange:N=>{const j=N.target.value;b(j),x&&v(zr(j)?m("packNameLength"):null)},placeholder:m("newPackPlaceholder"),maxLength:80,dir:"auto"}),s.jsx(de,{variant:"primary",onClick:k,disabled:S,children:m("createPack")})]}),x&&s.jsx("p",{className:"text-xs text-danger",children:x})]})]})})},qA=600;function FA(){const[n,i]=y.useState(null),[r,o]=y.useState(!1),[d,f]=y.useState(null),m=y.useRef(0);return y.useEffect(()=>()=>{m.current+=1},[]),{job:n,running:r,submitError:d,start:async b=>{const x=++m.current;f(null),i(null),o(!0);try{const{jobId:v}=await $.createStickerJob(b);for(;m.current===x;){const S=await $.getStickerJob(v);if(m.current!==x)return;if(i(S),S.state==="done"||S.state==="failed")break;await new Promise(A=>setTimeout(A,qA))}}catch(v){m.current===x&&f(v)}finally{m.current===x&&o(!1)}},reset:()=>{m.current+=1,i(null),f(null),o(!1)}}}const Tm={fit:"contain",zoom:1,panX:0,panY:0,rotate:0,background:"transparent",removeBackground:null,trim:null};function GA(n,i){return n(i==="gif"?"stickerKindGif":i==="video"?"stickerKindVideo":i==="webp"?"stickerKindWebp":"stickerKindImage")}const IA=({capabilities:n,capsError:i,onRetryCaps:r,incoming:o,onConsumedIncoming:d,isConnected:f,onGoLibrary:m,onCreated:p})=>{var Se,it,xt,Ce,Ie,Fe,ue,Re,je,Ke,yt,jt;const{t:h}=Ue(),{toast:b}=Ct(),x=FA(),[v,S]=y.useState(null),[A,k]=y.useState(null),[N,j]=y.useState("PANEL_UPLOAD"),[L,_]=y.useState(!1),[G,R]=y.useState(!1),[ne,U]=y.useState(Tm),[M,T]=y.useState([]),[P,O]=y.useState(null),[J,Z]=y.useState(""),[se,E]=y.useState(""),[z,F]=y.useState([]),[le,pe]=y.useState(!1),[he,I]=y.useState(!1),ce=y.useRef(null),ie=y.useRef(null),fe=y.useRef(async()=>{});y.useEffect(()=>($.getPacks().then(B=>F(B.packs)).catch(()=>{}),()=>{ce.current&&URL.revokeObjectURL(ce.current)}),[]);const C=B=>{ce.current&&URL.revokeObjectURL(ce.current);const ye=URL.createObjectURL(B);ce.current=ye,k(ye)},K=async(B,ye,Le,Ge,ut)=>{if(!(n!=null&&n.webp))return;const Ut=B instanceof File?B:new File([B],ye,{type:B.type}),on=await CA(Ut,n.limits);if(on){b(h(on),"error");return}_(!0),j(Le);try{const sn=Ge?await J1(Ge,ye,n.limits.uploadBytes):ut?await $.uploadExistingStickerSource(ut):await $.uploadStickerSource(Ut,ye);C(Ut),S(sn),U(Tm),b(h("uploadReady"),"success")}catch(sn){b(kt(h,sn),"error")}finally{_(!1)}};fe.current=K,y.useEffect(()=>{!o||!n||o===ie.current||(ie.current=o,d(),Promise.resolve(o.blob).then(B=>fe.current(B,o.name,o.source,o.token,o.existingId)).catch(B=>b(kt(h,B),"error")))},[o,n,d]);const Y=()=>{x.reset(),S(null),Z(""),E(""),T([]),O(null),U(Tm),j("PANEL_UPLOAD"),ce.current&&URL.revokeObjectURL(ce.current),ce.current=null,k(null),ie.current=null},me=()=>{if(!v)return null;const B=J.trim();if([...B].length>au)return b(h("stickerNameTooLong"),"warning"),null;const ye=BA(M);return{uploadId:v.uploadId,options:ne,...ye?{overlay:ye}:{},...B?{name:B}:{},...se?{packId:se}:{},source:N}},te=()=>{const B=me();B&&x.start(B)},oe=async(B,ye)=>{B.ok&&(B.via==="host"?b(Bt(h("stickerShareSaved"),{dir:B.dir}),"success"):B.via==="share"?b(h("shareDone"),"success"):b(h("downloaded"),"success"),await Zm([ye.id]),p())};if(i)return s.jsxs("div",{className:"flex flex-col items-center gap-3 py-16",children:[s.jsx("p",{className:"text-sm text-danger",children:i}),s.jsx(de,{onClick:r,children:h("retryLoad")})]});if(!n)return s.jsx(Ts,{text:h("loading")});if(!n.webp)return s.jsx("p",{className:"p-6 text-sm text-warn text-center",children:h("stickerErr_ENCODER_MISSING")});const ve=((Se=x.job)==null?void 0:Se.state)==="done"?x.job.sticker:null;if(ve)return s.jsxs("div",{className:"flex flex-col gap-4 max-w-md mx-auto",children:[s.jsx("div",{className:"aspect-square overflow-hidden rounded-2xl border border-line bg-[repeating-conic-gradient(var(--panel-raised)_0%_25%,var(--bg)_0%_50%)] bg-[length:20px_20px]",children:s.jsx("img",{src:ve.url,alt:ve.name||h("stickerPreview"),className:"w-full h-full object-contain"})}),((it=x.job)==null?void 0:it.created)===!1&&s.jsx("p",{className:"text-sm text-ok",children:h("alreadyInLibrary")}),((xt=x.job)==null?void 0:xt.qualityReduced)&&s.jsx("p",{className:"text-sm text-warn",children:h("qualityReduced")}),((Ce=x.job)==null?void 0:Ce.created)!==!1&&s.jsx("p",{className:"text-sm text-ok",children:h("stickerCreated")}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Oe,{label:h("downloadWebp"),icon:s.jsx(Vc,{size:18}),onClick:()=>{Rr(ve,"webp").then(B=>oe(B,ve)).catch(B=>b(kt(h,B),"error"))}}),s.jsx(Oe,{label:h("shareSticker"),icon:s.jsx(Hr,{size:18}),onClick:()=>{rw(ve,"webp").then(B=>oe(B,ve)).catch(B=>b(kt(h,B),"error"))}}),s.jsx(de,{disabled:!f,title:f?void 0:h("notConnectedHint"),onClick:()=>pe(!0),children:h("sendViaWhatsapp")}),s.jsx(de,{onClick:()=>I(!0),children:h("addToPack")}),s.jsx(de,{variant:"primary",onClick:Y,children:h("createAnother")}),s.jsx(de,{onClick:m,children:h("goToLibrary")}),s.jsxs(Yn,{label:h("moreActions"),children:[s.jsx(lt,{onSelect:()=>{ve.animated&&b(h("firstFrameHint"),"info"),Rr(ve,"png").then(B=>oe(B,ve)).catch(B=>b(kt(h,B),"error"))},children:h("downloadPng")}),ve.animated&&s.jsx(lt,{disabled:!n.gif,title:h("gifOnlyAnimated"),onSelect:()=>{Rr(ve,"gif").then(B=>oe(B,ve)).catch(B=>b(kt(h,B),"error"))},children:h("downloadGif")})]})]}),!f&&s.jsx("p",{className:"text-xs text-muted",children:h("notConnectedHint")}),s.jsx(gh,{open:le,busy:!1,onClose:()=>pe(!1),onPick:B=>{$.sendStickers({ids:[ve.id],jid:B}).then(ye=>{ye.sent>0?(b(h("stickerSent"),"success"),pe(!1),p()):b(h("stickerErr_NOT_CONNECTED"),"error")}).catch(ye=>b(kt(h,ye),"error"))}}),s.jsx(uw,{open:he,title:h("addToPack"),packs:z,onClose:()=>I(!1),onCreated:B=>F(ye=>[...ye,B]),onPick:B=>{$.bulkStickers({action:"addToPack",ids:[ve.id],packId:B}).then(()=>{b(h("addedToPack"),"success"),I(!1),p()}).catch(ye=>b(kt(h,ye),"error"))}})]});const be=x.submitError||((Ie=x.job)==null?void 0:Ie.state)==="failed";return s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_320px] gap-4",children:[s.jsxs("div",{className:"flex flex-col gap-3",children:[!v&&s.jsxs("label",{className:`flex flex-col items-center justify-center gap-2 min-h-64 rounded-2xl border border-dashed ${G?"border-brand-blue bg-brand-blue/10":"border-line bg-panel"} p-6 cursor-pointer`,onClick:B=>{Rc()&&(B.preventDefault(),KE().then(async ye=>{if(!ye)return;const Le=await fetch(ye.url);if(!Le.ok)throw new Error("source unavailable");await K(await Le.blob(),ye.name,"PANEL_UPLOAD",ye.token)}).catch(ye=>b(kt(h,ye),"error")))},onDragOver:B=>{B.preventDefault(),R(!0)},onDragLeave:()=>R(!1),onDrop:B=>{if(B.preventDefault(),R(!1),Rc())return;const ye=B.dataTransfer.files[0];ye&&K(ye,ye.name,"PANEL_UPLOAD")},children:[s.jsx(Y0,{size:28,className:"text-muted"}),s.jsx("span",{className:"text-sm font-bold text-text-main",children:h("stickerDrag")}),s.jsx("span",{className:"text-xs text-muted",children:h("uploadHint")}),s.jsx("input",{type:"file",accept:"image/*,video/*,.webp,.gif",className:"sr-only",disabled:Rc(),onChange:B=>{var Le;const ye=(Le=B.target.files)==null?void 0:Le[0];B.target.value="",ye&&K(ye,ye.name,"PANEL_UPLOAD")}})]}),L&&s.jsx(Ts,{text:h("loading")}),v&&A&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-xs text-muted",children:Bt(h("stickerUploadInfo"),{kind:GA(h,v.kind),size:Math.max(1,Math.round(v.size/1024))})}),s.jsx(HA,{mediaUrl:A,kind:v.kind,width:v.width,height:v.height,options:ne,layers:M,selectedId:P,label:h("previewStage"),onPan:(B,ye)=>U(Le=>({...Le,panX:B,panY:ye})),onSelect:O,onMoveLayer:(B,ye,Le)=>T(Ge=>Ge.map(ut=>ut.id===B?{...ut,x:ye,y:Le}:ut))}),s.jsx(TA,{options:ne,onChange:B=>U(ye=>({...ye,...B})),kind:v.kind,durationMs:v.durationMs,limits:n.limits,animatedOk:n.animated})]}),(x.running||((Fe=x.job)==null?void 0:Fe.state)==="queued"||((ue=x.job)==null?void 0:ue.state)==="running")&&s.jsxs("div",{children:[s.jsx("div",{className:"h-2 rounded-full bg-line overflow-hidden",children:s.jsx("div",{className:"h-full bg-brand-blue",style:{width:`${Math.round((((Re=x.job)==null?void 0:Re.progress)||0)*100)}%`}})}),s.jsx("p",{className:"text-xs text-muted mt-1",children:XC(h,((je=x.job)==null?void 0:je.state)==="queued"?"queued":(Ke=x.job)==null?void 0:Ke.stage)})]}),be&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-sm text-danger",children:x.submitError?kt(h,x.submitError):ph(h,(jt=(yt=x.job)==null?void 0:yt.error)==null?void 0:jt.code)}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(de,{variant:"primary",onClick:te,children:h("tryAgain")}),s.jsx(de,{onClick:Y,children:h("clearLbl")})]})]})]}),s.jsxs("div",{className:"flex flex-col gap-4",children:[v&&s.jsx(AA,{options:ne,onChange:B=>U(ye=>({...ye,...B})),canRemoveBackground:n.backgroundRemoval.includes("plain"),name:J,onName:Z,packId:se,onPack:E,packs:z}),v&&s.jsx(PA,{layers:M,selectedId:P,onSelect:O,onChange:(B,ye)=>T(Le=>Le.map(Ge=>Ge.id===B?{...Ge,...ye}:Ge)),onDelete:B=>{T(ye=>ye.filter(Le=>Le.id!==B)),O(ye=>ye===B?null:ye)},onAddText:()=>{const B=crypto.randomUUID();T(ye=>[...ye,{id:B,text:h("textPlaceholder"),x:256,y:256,fontSize:64,color:"#ffffff",align:"center",rotate:0,outline:!0,background:!1}]),O(B)},onAddEmoji:B=>{const ye=crypto.randomUUID();T(Le=>[...Le,{id:ye,text:B,x:256,y:240,fontSize:96,color:"#ffffff",align:"center",rotate:0,outline:!1,background:!1}]),O(ye)}}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(de,{variant:"primary",disabled:!v||x.running||L,onClick:te,icon:s.jsx(ul,{size:16}),children:h("createBtn")}),v&&s.jsx(de,{onClick:Y,disabled:x.running,children:h("clearLbl")})]})]})]})};let zc=null,Lc=!1,ba=null;function iv(n){ba=n}async function VA(n,i){var r;try{const o=await J1(n,i,yA),{jobId:d}=await $.createStickerJob({uploadId:o.uploadId,source:"MEDIA_HUB"});for(;;){const f=await $.getStickerJob(d);if(f.state==="done"){ba==null||ba({type:"saved",created:f.created!==!1,qualityReduced:f.qualityReduced===!0});return}if(f.state==="failed"){ba==null||ba({type:"error",code:(r=f.error)==null?void 0:r.code});return}await new Promise(m=>setTimeout(m,600))}}catch(o){ba==null||ba({type:"error",code:o instanceof Dt?o.code:void 0})}finally{Lc=!1}}function KA(){if(Lc)return zc;const n=YE();return(n==null?void 0:n.intent)==="create"?zc={blob:fetch(n.url).then(i=>{if(!i.ok)throw new Error("source unavailable");return i.blob()}),name:n.name||"sticker",source:"MEDIA_HUB",token:n.token}:(n==null?void 0:n.intent)==="save"&&!Lc&&(Lc=!0,VA(n.token,n.name||"sticker")),zc}function YA(){zc=null}const dw=({count:n,animatedSelected:i,canRemove:r,sendReason:o,exportReason:d,onSelectAll:f,selectAllLabel:m,onClear:p,onFavorite:h,onUnfavorite:b,onAdd:x,onMove:v,onRemove:S,onDownload:A,onConvert:k,onShare:N,onSend:j,onDelete:L})=>{const{t:_}=Ue();return n===0?null:s.jsx("div",{className:"sticky bottom-2 z-20 pb-[max(0.25rem,env(safe-area-inset-bottom))] sm:static sm:pb-0",children:s.jsxs(Ze,{className:"border-brand-blue/40 bg-panel/95 backdrop-blur-md shadow-lg shadow-black/15 p-2 sm:p-2.5",children:[s.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[s.jsx("span",{className:"me-auto min-w-0 truncate text-xs sm:text-sm font-bold text-text-main",children:Bt(_("nSelected"),{n})}),s.jsx(Oe,{label:n>1?_("downloadZip"):_("download"),icon:s.jsx(Vc,{size:16}),onClick:A,disabled:!!d}),s.jsx(Oe,{label:_("sendViaWhatsapp"),icon:s.jsx(yi,{size:16,className:"rtl:-scale-x-100"}),onClick:j,disabled:!!o}),s.jsx(Oe,{label:_("shareSticker"),icon:s.jsx(Hr,{size:16}),onClick:N}),s.jsxs(Yn,{label:_("moreActions"),children:[s.jsx(lt,{onSelect:f,children:m}),s.jsx(lt,{onSelect:p,children:_("clearSelection")}),s.jsx(Dr,{}),s.jsx(lt,{onSelect:h,children:_("favorite")}),s.jsx(lt,{onSelect:b,children:_("unfavorite")}),s.jsx(Dr,{}),s.jsx(lt,{onSelect:x,children:_("addToPack")}),s.jsx(lt,{onSelect:v,children:_("moveToPack")}),r&&s.jsx(lt,{onSelect:S,children:_("removeFromPack")}),s.jsx(lt,{onSelect:k,disabled:!!d,children:_("convertToImage")}),s.jsx(Dr,{}),s.jsx(lt,{danger:!0,onSelect:L,children:_("delete")})]}),s.jsx(Oe,{variant:"ghost",label:_("clearSelection"),icon:s.jsx(Rn,{size:16}),onClick:p})]}),(o||d||i)&&s.jsxs("div",{className:"mt-1.5 space-y-0.5 border-t border-line/50 pt-1 text-xs text-muted",children:[o&&s.jsx("p",{children:o}),d&&s.jsx("p",{children:d}),i&&s.jsx("p",{children:_("firstFrameHint")})]})]})})},QA=({open:n,busy:i,count:r,inUse:o,packs:d,onClose:f,onConfirm:m,onConfirmEverywhere:p})=>{const{t:h}=Ue();return s.jsx(an,{isOpen:n,onClose:f,title:h("deleteStickersTitle"),footer:s.jsxs("div",{className:"flex w-full flex-wrap justify-end gap-2",children:[s.jsx(de,{onClick:f,disabled:i,children:h("cancel")}),o?s.jsx(de,{variant:"danger",onClick:p,disabled:i,children:h("deleteEverywhere")}):s.jsx(de,{variant:"danger",onClick:m,disabled:i,children:h("delete")})]}),children:s.jsxs("div",{className:"flex flex-col gap-2 text-sm text-text-main",children:[s.jsx("p",{children:Bt(h("nSelected"),{n:r})}),o?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:h(r===1?"inUseBody":"inUseBulkBody")}),d.length>0&&s.jsxs("p",{children:[h("inUsePacksLabel"),":"," ",d.map((b,x)=>s.jsxs(y.Fragment,{children:[x>0&&", ",s.jsx(rn,{as:"bdi",children:b.name})]},b.id))]}),s.jsx("p",{className:"text-xs text-muted",children:h("deleteEverywhereHint")})]}):s.jsx("p",{children:h("deleteConfirm")})]})})},XA="bg-[repeating-conic-gradient(var(--panel-raised)_0%_25%,var(--bg)_0%_50%)] bg-[length:20px_20px]",ZA=({sticker:n,packs:i,isConnected:r,gifEnabled:o,onClose:d,onRename:f,onFavorite:m,onAddToPack:p,onRemoveFromPack:h,onDownload:b,onShare:x,onSend:v,onDelete:S,onOpenInCreate:A})=>{const{t:k}=Ue(),[N,j]=y.useState(""),[L,_]=y.useState("");if(y.useEffect(()=>{j((n==null?void 0:n.name)||""),_("")},[n]),!n)return null;const G=i.filter(U=>n.packIds.includes(U.id)),R=i.filter(U=>!n.packIds.includes(U.id)),ne=n.animated&&o?"gif":"webp";return s.jsx(an,{isOpen:!!n,onClose:d,title:s.jsx(rn,{children:n.name||k("stickerPreview")}),maxWidth:"38rem",footer:s.jsx("div",{className:"flex w-full justify-end gap-2",children:s.jsx(de,{onClick:d,children:k("close")})}),children:s.jsxs("div",{className:"flex flex-col gap-4 min-w-0",children:[s.jsxs("div",{className:`relative mx-auto aspect-square w-full max-w-[240px] sm:max-w-[280px] max-h-[min(40vh,280px)] overflow-hidden rounded-2xl border border-line ${XA}`,children:[s.jsx("img",{src:n.url,alt:n.name||k("stickerPreview"),className:"h-full w-full object-contain"}),s.jsxs("div",{className:"absolute end-2 top-2 flex gap-1",children:[s.jsx(Oe,{label:k(ne==="gif"?"downloadGif":"downloadWebp"),icon:s.jsx(Vc,{size:16}),onClick:()=>b(ne)}),s.jsx(Oe,{label:k("shareSticker"),icon:s.jsx(Hr,{size:16}),onClick:x})]})]}),s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(de,{variant:"primary",size:"sm",className:"h-auto min-w-0 flex-1 py-2",onClick:v,disabled:!r,title:r?void 0:k("notConnectedHint"),icon:s.jsx(yi,{size:16,className:"rtl:-scale-x-100"}),children:s.jsx("span",{className:"min-w-0 break-words",children:k("sendViaWhatsapp")})}),s.jsx(Oe,{label:n.favorite?k("unfavorite"):k("favorite"),"aria-pressed":n.favorite,onClick:()=>m(!n.favorite),icon:s.jsx(Kc,{size:16,className:n.favorite?"fill-warn text-warn":void 0})}),s.jsx("span",{className:"shrink-0",children:s.jsxs(Yn,{label:k("moreActions"),align:"end",children:[s.jsx(lt,{onSelect:()=>b("webp"),children:k("downloadWebp")}),s.jsx(lt,{title:n.animated?k("firstFrameHint"):void 0,onSelect:()=>b("png"),children:k("downloadPng")}),n.animated&&s.jsx(lt,{disabled:!o,title:k("gifOnlyAnimated"),onSelect:()=>b("gif"),children:k("downloadGif")}),s.jsx(lt,{onSelect:A,children:k("openInCreate")}),s.jsx(Dr,{}),s.jsx(lt,{danger:!0,onSelect:S,children:k("delete")})]})})]}),n.animated&&s.jsx("p",{className:"text-xs text-muted",children:k("firstFrameHint")}),!r&&s.jsx("p",{className:"text-xs text-muted",children:k("notConnectedHint")}),s.jsxs("div",{className:"flex gap-2 min-w-0",children:[s.jsx(Be,{value:N,onChange:U=>j(U.target.value),maxLength:au,dir:"auto","aria-label":k("stickerName"),placeholder:k("stickerNamePlaceholder"),className:"min-w-0 flex-1"}),s.jsx(de,{variant:"secondary",onClick:()=>f(N.trim()),children:k("rename")})]}),s.jsxs("div",{children:[s.jsx("p",{className:"mb-1.5 text-xs font-bold text-text-main",children:k("inUsePacksLabel")}),G.length===0?s.jsx("p",{className:"text-xs text-muted",children:k("notInPack")}):s.jsx("ul",{className:"flex flex-col gap-1.5",children:G.map(U=>s.jsxs("li",{className:"flex items-center justify-between gap-2",children:[s.jsx(rn,{className:"flex-1 text-sm",children:U.name}),s.jsx(Oe,{label:k("removeFromPack"),variant:"ghost",icon:s.jsx(Rn,{size:16}),onClick:()=>h(U.id)})]},U.id))}),R.length>0&&s.jsxs("div",{className:"mt-2 flex gap-2",children:[s.jsxs(ft,{value:L,onChange:U=>_(U.target.value),"aria-label":k("addToPack"),children:[s.jsx("option",{value:"",children:k("selectPack")}),R.map(U=>s.jsx("option",{value:U.id,children:U.name},U.id))]}),s.jsx(de,{variant:"primary",disabled:!L,onClick:()=>L&&p(L),children:k("addToPack")})]})]})]})})};function $A(n){const{t:i}=Ue(),{toast:r}=Ct(),[o,d]=y.useState(null),[f,m]=y.useState(!1);return{phase:o,busy:f,requestDelete:x=>{x.length&&d({kind:"ask",ids:x})},run:async(x,v)=>{var S;m(!0);try{if(x.length===1&&!v){try{await $.deleteSticker(x[0],!1),r(i("deleted"),"success"),d(null),n()}catch(j){if(j instanceof Dt&&j.code==="IN_USE"){const L=Array.isArray((S=j.data)==null?void 0:S.packs)?j.data.packs:[];d({kind:"inUse",ids:x,packs:L,otherSkipped:0})}else r(kt(i,j),"error")}return}const A=await $.bulkStickers({action:"delete",ids:x,confirm:v}),k=A.skipped.filter(j=>j.code==="IN_USE").map(j=>j.id),N=A.skipped.length-k.length;if(!v&&k.length>0){d({kind:"inUse",ids:k,packs:[],otherSkipped:N});return}N>0?r(i("skippedOther"),"warning"):r(i("deleted"),"success"),d(null),n()}catch(A){r(kt(i,A),"error")}finally{m(!1)}},close:()=>{f||d(null)}}}function JA(n,i,r){const o=new Map(r.map(f=>[f.id,f.name])),d=new Map;for(const f of n){const m=i.find(p=>p.id===f);for(const p of(m==null?void 0:m.packIds)??[])d.set(p,o.get(p)||p)}return[...d].map(([f,m])=>({id:f,name:m}))}function fw({items:n,packs:i,selectedIds:r,clearSelection:o,reload:d,fromPackId:f,isConnected:m,gifEnabled:p,onOpenInCreate:h,onPackCreated:b}){var pe,he,I;const{t:x}=Ue(),{toast:v}=Ct(),S=y.useRef(!1),[A,k]=y.useState(null),[N,j]=y.useState(null),[L,_]=y.useState([]),[G,R]=y.useState([]),[ne,U]=y.useState(!1),M=$A(()=>{k(null),o(),d()}),T=n.find(ce=>ce.id===A)||null,P=r.length>sv?x("stickerExportLimit"):null,O=m?r.length>bA?x("stickerSendLimit"):null:x("notConnectedHint"),J=((pe=M.phase)==null?void 0:pe.kind)==="inUse"?M.phase.packs.length?M.phase.packs:JA(M.phase.ids,n,i):[],Z=ce=>{ce.ok&&(ce.via==="host"?v(Bt(x("stickerShareSaved"),{dir:ce.dir}),"success"):ce.via==="share"?v(x("shareDone"),"success"):v(x("downloaded"),"success"))},se=async ce=>{if(!S.current){S.current=!0;try{await ce()}catch(ie){v(kt(x,ie),"error")}finally{S.current=!1}}},E=ce=>n.find(ie=>ie.id===ce),z=(ce,ie,fe)=>se(async()=>{if(!ce.length||ce.length>sv)return;const C=ce.length===1?E(ce[0]):null,K=ce.some(me=>{var te;return(te=E(me))==null?void 0:te.animated});ie==="png"&&K&&v(x("firstFrameHint"),"info");const Y=ce.length===1&&C?await(fe?rw(C,ie):Rr(C,ie)):await(fe?xA(ce,ie):gA(ce,ie));Z(Y),Y.ok&&(await Zm(ce),d())}),F=(ce,ie)=>se(async()=>{if(!ce.length)return;const fe=await $.bulkStickers({action:ie?"favorite":"unfavorite",ids:ce});v(fe.skipped.length?x("skippedOther"):x("saved"),fe.skipped.length?"warning":"success"),d()}),le=(ce,ie,fe)=>se(async()=>{if(!fe.length)return;const C=await $.bulkStickers({action:ce,ids:fe,packId:ie,...ce==="moveToPack"&&f?{fromPackId:f}:{}}),K=x(ce==="addToPack"?"addedToPack":"movedToPack");v(C.skipped.length?x("skippedOther"):K,C.skipped.length?"warning":"success"),j(null),d()});return{exportReason:P,sendReason:O,openDetail:ce=>k(ce.id),toggleFavorite:ce=>void F([ce.id],!ce.favorite),favorite:()=>void F(r,!0),unfavorite:()=>void F(r,!1),askAdd:()=>{_(r),j("add")},askMove:()=>{_(r),j("move")},remove:()=>{!f||!r.length||se(async()=>{const ce=await $.bulkStickers({action:"removeFromPack",ids:r,packId:f});v(ce.skipped.length?x("skippedOther"):x("removedFromPack"),ce.skipped.length?"warning":"success"),o(),d()})},download:()=>void z(r,"webp",!1),convert:()=>void z(r,"png",!1),share:()=>void z(r,"webp",!0),askSend:()=>{O||!r.length||R(r)},askDelete:()=>M.requestDelete(r),dialogs:s.jsxs(s.Fragment,{children:[s.jsx(uw,{open:N!==null,title:x(N==="move"?"moveToPack":"addToPack"),packs:i,onClose:()=>j(null),onCreated:b,onPick:ce=>void le(N==="move"?"moveToPack":"addToPack",ce,L)}),s.jsx(gh,{open:G.length>0,busy:ne,onClose:()=>R([]),onPick:ce=>{se(async()=>{U(!0);try{(await $.sendStickers({ids:G,jid:ce})).sent>0?(v(G.length>1?x("stickersSent"):x("stickerSent"),"success"),R([]),d()):v(x("stickerErr_NOT_CONNECTED"),"error")}finally{U(!1)}})}}),s.jsx(QA,{open:M.phase!==null,busy:M.busy,count:((he=M.phase)==null?void 0:he.ids.length)??0,inUse:((I=M.phase)==null?void 0:I.kind)==="inUse",packs:J,onClose:M.close,onConfirm:()=>{M.phase&&M.run(M.phase.ids,!1)},onConfirmEverywhere:()=>{M.phase&&M.run(M.phase.ids,!0)}}),s.jsx(ZA,{sticker:T,packs:i,isConnected:m,gifEnabled:p,onClose:()=>k(null),onRename:ce=>{if(T){if([...ce.trim()].length>au){v(x("stickerNameTooLong"),"warning");return}se(async()=>{await $.updateSticker(T.id,{name:ce.trim()}),v(x("renamed"),"success"),d()})}},onFavorite:ce=>{T&&se(async()=>{await $.updateSticker(T.id,{favorite:ce}),v(x("saved"),"success"),d()})},onAddToPack:ce=>{T&&le("addToPack",ce,[T.id])},onRemoveFromPack:ce=>{T&&se(async()=>{await $.bulkStickers({action:"removeFromPack",ids:[T.id],packId:ce}),v(x("removedFromPack"),"success"),d()})},onDownload:ce=>{if(T){if(ce==="gif"){se(async()=>{const ie=await Rr(T,"gif");Z(ie),ie.ok&&(await Zm([T.id]),d())});return}z([T.id],ce,!1)}},onShare:()=>{T&&z([T.id],"webp",!0)},onSend:()=>{T&&m&&R([T.id])},onDelete:()=>{T&&M.requestDelete([T.id])},onOpenInCreate:()=>{T&&(k(null),h(T))}})]})}}const WA="bg-[repeating-conic-gradient(var(--panel-raised)_0%_25%,var(--bg)_0%_50%)] bg-[length:16px_16px]",mw=({sticker:n,selected:i,onToggle:r,onOpen:o,onFavorite:d})=>{const{t:f}=Ue(),m=n.name||f("stickerPreview");return s.jsxs("div",{className:Pe("relative aspect-square overflow-hidden rounded-xl border bg-panel transition-shadow",i?"border-brand-blue ring-2 ring-brand-blue/50":"border-line"),children:[s.jsx(de,{variant:"ghost",onClick:()=>o(),"aria-label":f("stickerOpen"),className:"absolute inset-0 h-auto min-h-0 w-full rounded-none p-0 hover:bg-transparent focus-visible:ring-inset",children:s.jsx("img",{src:n.thumbUrl,alt:"",loading:"lazy",draggable:!1,className:Pe("h-full w-full object-contain",WA)})}),s.jsx(Oe,{label:f(i?"deselectSticker":"stickerSelect"),role:"checkbox","aria-checked":i,"aria-pressed":i,variant:"ghost",className:"absolute top-0.5 start-0.5 z-10 size-10 min-h-10 min-w-10 p-0 hover:bg-transparent focus-visible:ring-offset-0",onClick:p=>r(p.shiftKey),icon:s.jsx("span",{className:Pe("flex size-7 items-center justify-center rounded-lg border transition-all shadow-xs",i?"border-brand-blue bg-brand-blue text-white":"border-line/70 bg-panel/85 text-muted backdrop-blur-xs hover:border-line hover:text-text-main"),children:s.jsx(gi,{size:14,strokeWidth:i?3:2.5,className:i?void 0:"opacity-40"})})}),n.animated&&s.jsx(We,{tone:"neutral",className:"pointer-events-none absolute bottom-1 start-1 z-10 px-1.5 py-0.5 text-[10px] font-bold",children:f("gifBadge")}),s.jsx(Oe,{label:n.favorite?f("unfavorite"):f("favorite"),"aria-pressed":n.favorite,variant:"ghost",className:"absolute top-0.5 end-0.5 z-10 size-10 min-h-10 min-w-10 p-0 hover:bg-transparent focus-visible:ring-offset-0",onClick:d,icon:s.jsx("span",{className:Pe("flex size-7 items-center justify-center rounded-lg border transition-all shadow-xs",n.favorite?"border-warn/50 bg-panel/90 text-warn backdrop-blur-xs":"border-line/70 bg-panel/85 text-muted backdrop-blur-xs hover:border-line hover:text-text-main"),children:s.jsx(Kc,{size:14,className:n.favorite?"fill-warn text-warn":void 0})})}),s.jsx("span",{className:"sr-only",children:m})]})},eT=({items:n,total:i,page:r,pageCount:o,loading:d,error:f,emptyText:m,isFiltered:p,selected:h,onToggle:b,onOpen:x,onFavorite:v,onPageChange:S,onRetry:A,onClearFilters:k,onGoCreate:N})=>{const{t:j}=Ue();return s.jsxs("div",{className:"flex min-w-0 flex-col gap-4",children:[d&&n.length===0?s.jsx(Ts,{text:j("loading")}):f?s.jsx(mt,{kind:"error",description:f,action:s.jsx(de,{onClick:A,children:j("retryLoad")})}):n.length===0?p?s.jsx(mt,{kind:"no-results",description:m,action:k?s.jsx(de,{variant:"secondary",onClick:k,children:j("reset")}):void 0}):s.jsx(mt,{kind:"empty",icon:s.jsx(nh,{size:28,className:"text-muted"}),description:m,action:N?s.jsx(de,{variant:"primary",onClick:N,children:j("createBtn")}):void 0}):s.jsx("div",{className:Pe("grid grid-cols-3 min-[390px]:grid-cols-4 sm:grid-cols-5 md:grid-cols-6 lg:grid-cols-8 xl:grid-cols-10 gap-2 sm:gap-3 transition-opacity",d&&"opacity-60 pointer-events-none"),children:n.map((L,_)=>s.jsx(mw,{sticker:L,selected:h.has(L.id),onToggle:G=>b(_,G),onOpen:()=>x(L),onFavorite:()=>v(L)},L.id))}),i>0&&s.jsx(ki,{page:r,pageCount:o,total:i,onPageChange:S,className:"pt-1"})]})};function hw(n,i){const[r,o]=y.useState(new Set),d=y.useRef(null),f=y.useRef(i);return y.useEffect(()=>{f.current!==i&&(f.current=i,o(new Set),d.current=null)},[i]),{selected:r,toggle:(b,x)=>{const v=n[b];v&&o(S=>{const A=new Set(S);if(x&&d.current!=null){const k=Math.min(d.current,b),N=Math.max(d.current,b);for(let j=k;j<=N;j++){const L=n[j];L&&A.add(L)}return A}return A.has(v)?A.delete(v):A.add(v),d.current=b,A})},selectAll:()=>{o(b=>{const x=new Set(b);for(const v of n)v&&x.add(v);return x})},clear:()=>{d.current=null,o(new Set)}}}const Cr=24;function tT(n){const{t:i}=Ue(),{toast:r}=Ct(),[o,d]=y.useState(""),[f,m]=y.useState(""),[p,h]=y.useState(n==="recent"?"recent":"newest"),[b,x]=y.useState(n),[v,S]=y.useState(""),[A,k]=y.useState(1),[N,j]=y.useState(null),[L,_]=y.useState(0),[G,R]=y.useState([]),[ne,U]=y.useState(!0),[M,T]=y.useState(null),P=y.useRef(0),O=`${f}|${b}|${p}|${v}`;y.useEffect(()=>{x(n)},[n]),y.useEffect(()=>{const pe=setTimeout(()=>m(o),300);return()=>clearTimeout(pe)},[o]);const J=y.useCallback(()=>{$.getPacks().then(pe=>R(pe.packs)).catch(()=>{})},[]);y.useEffect(()=>{J()},[J]);const Z=y.useCallback(async pe=>{const he=++P.current;U(!0),T(null);const I=Math.max(0,(pe-1)*Cr);try{const ce=await $.getStickers({q:f||void 0,sort:p,filter:b,pack:v||void 0,offset:I,limit:Cr});if(he!==P.current)return;const ie=ce.total,fe=Math.max(1,Math.ceil(ie/Cr));if(pe>fe){k(fe);return}j({page:pe,filterKey:O,items:ce.items}),_(ie)}catch(ce){if(he!==P.current)return;const ie=kt(i,ce);T({page:pe,filterKey:O,message:ie}),r(ie,"error")}finally{he===P.current&&U(!1)}},[f,p,b,v,O,i,r]),se=y.useRef(O);y.useEffect(()=>{if(se.current!==O&&(se.current=O,A!==1)){k(1);return}Z(A)},[O,A,Z]);const E=y.useCallback(()=>{J(),Z(A)},[Z,J,A]),z=y.useCallback(pe=>{k(Math.max(1,Math.floor(pe)||1))},[]),F=(N==null?void 0:N.page)===A&&N.filterKey===O,le=(M==null?void 0:M.page)===A&&M.filterKey===O?M.message:null;return{q:o,setQ:d,sort:p,setSort:h,filter:b,setFilter:x,pack:v,setPack:S,page:A,setPage:z,pageCount:Math.max(1,Math.ceil(L/Cr)),pageSize:Cr,items:F?N.items:[],loadedItems:(N==null?void 0:N.items)??null,total:L,packs:G,loading:ne||!F&&!le,error:le,reload:E,loadPacks:J,lockedFilter:n!=="all"}}const _m=({preset:n,isConnected:i,gifEnabled:r,refreshKey:o,onOpenInCreate:d,onGoCreate:f})=>{const{t:m}=Ue(),p=tT(n),h=p.items.map(U=>U.id),b=`${p.q}|${p.filter}|${p.sort}|${p.pack}`,x=hw(h,b),v=[...x.selected],S=y.useRef({key:b,loadedItems:null,stickers:new Map});if(S.current.key!==b&&(S.current={key:b,loadedItems:p.loadedItems,stickers:new Map}),p.loadedItems&&S.current.loadedItems!==p.loadedItems){for(const U of p.loadedItems)S.current.stickers.set(U.id,U);S.current.loadedItems=p.loadedItems}const A=new Map(p.items.map(U=>[U.id,U]));for(const U of v){const M=S.current.stickers.get(U);M&&!A.has(U)&&A.set(U,M)}const k=p.pack&&p.pack!=="none"?p.pack:void 0,N=y.useRef(p.reload);N.current=p.reload,y.useEffect(()=>{o!==0&&N.current()},[o]);const j=fw({items:[...A.values()],packs:p.packs,selectedIds:v,clearSelection:x.clear,reload:p.reload,fromPackId:k,isConnected:i,gifEnabled:r,onOpenInCreate:d,onPackCreated:p.loadPacks}),L=!!(p.q||p.pack||!p.lockedFilter&&p.filter!=="all"),_=m(L?"noResults":n==="favorites"?"favoritesEmpty":n==="recent"?"recentEmpty":"emptyLibrary"),G=[...A.values()].some(U=>x.selected.has(U.id)&&U.animated),R=(p.lockedFilter||p.filter==="all"?0:1)+(p.pack?1:0),ne=()=>{p.setQ(""),p.lockedFilter||p.setFilter("all"),p.setPack("")};return s.jsxs("div",{className:Pe("flex flex-col gap-3 min-w-0",v.length>0&&"pb-16 sm:pb-0"),children:[s.jsxs(yl,{children:[s.jsx(Be,{type:"search",value:p.q,onChange:U=>p.setQ(U.target.value),placeholder:m("searchStickers"),"aria-label":m("searchStickers"),className:"min-w-48 flex-1"}),s.jsxs(xl,{label:m("filter"),resetLabel:m("reset"),activeCount:R,onReset:()=>{p.lockedFilter||p.setFilter("all"),p.setPack("")},children:[!p.lockedFilter&&s.jsxs(ft,{"aria-label":m("filterBy"),value:p.filter,onChange:U=>p.setFilter(U.target.value),children:[s.jsx("option",{value:"all",children:m("allStickers")}),s.jsx("option",{value:"favorites",children:m("favorites")}),s.jsx("option",{value:"recent",children:m("recent")}),s.jsx("option",{value:"animated",children:m("animated")}),s.jsx("option",{value:"static",children:m("static")})]}),s.jsxs(ft,{"aria-label":m("packFilter"),value:p.pack,onChange:U=>p.setPack(U.target.value),children:[s.jsx("option",{value:"",children:m("anyPack")}),s.jsx("option",{value:"none",children:m("noPack")}),p.packs.map(U=>s.jsx("option",{value:U.id,children:U.name},U.id))]})]}),s.jsx(Pr,{label:m("sort"),value:p.sort,onChange:U=>p.setSort(U),options:[{value:"newest",label:m("sortNewest")},{value:"oldest",label:m("sortOldest")},{value:"name",label:m("sortName")},{value:"recent",label:m("sortRecent")}]})]}),s.jsxs("div",{className:"flex items-center justify-between gap-2 px-0.5 text-xs text-muted",children:[s.jsx("span",{children:m("resultCount").replace("{n}",String(p.total))}),p.items.length>0&&s.jsx(de,{variant:"ghost",size:"sm",onClick:x.selectAll,children:m(p.pageCount>1?"selectCurrentPage":"selectAll")})]}),s.jsx(dw,{count:v.length,animatedSelected:G,canRemove:!!k,sendReason:v.length?j.sendReason:null,exportReason:v.length?j.exportReason:null,onSelectAll:x.selectAll,selectAllLabel:m(p.pageCount>1?"selectCurrentPage":"selectAll"),onClear:x.clear,onFavorite:j.favorite,onUnfavorite:j.unfavorite,onAdd:j.askAdd,onMove:j.askMove,onRemove:j.remove,onDownload:j.download,onConvert:j.convert,onShare:j.share,onSend:j.askSend,onDelete:j.askDelete}),s.jsx(eT,{items:p.items,total:p.total,page:p.page,pageCount:p.pageCount,loading:p.loading,error:p.error,emptyText:_,isFiltered:L,selected:x.selected,onToggle:x.toggle,onOpen:j.openDetail,onFavorite:j.toggleFavorite,onPageChange:p.setPage,onRetry:p.reload,onClearFilters:L?ne:void 0,onGoCreate:n==="all"&&!L?f:void 0}),j.dialogs]})},nT=({packId:n,isConnected:i,gifEnabled:r,onBack:o,onOpenInCreate:d})=>{const{t:f}=Ue(),{toast:m}=Ct(),[p,h]=y.useState(null),[b,x]=y.useState([]),[v,S]=y.useState([]),[A,k]=y.useState(!0),[N,j]=y.useState(null),[L,_]=y.useState(0),[G,R]=y.useState(!1),ne=y.useRef(""),{page:U,pageCount:M,pageItems:T,setPage:P,total:O}=Zc(b,48,n),J=T.map(I=>I.id),Z=hw(J,n),se=[...Z.selected];y.useEffect(()=>{if(L<0)return;let I=!0;return j(null),Promise.all([$.getPack(n),$.getPacks()]).then(([ce,ie])=>{I&&(h(ce.pack),x(ce.items),S(ie.packs))}).catch(ce=>{I&&j(kt(f,ce))}).finally(()=>{I&&k(!1)}),()=>{I=!1}},[n,L,f]);const E=()=>{k(b.length===0),_(I=>I+1)},z=fw({items:b,packs:v,selectedIds:se,clearSelection:Z.clear,reload:E,fromPackId:n,isConnected:i,gifEnabled:r,onOpenInCreate:d,onPackCreated:E}),F=async I=>{const ce=b;x(I),R(!0);try{await $.reorderPack(n,I.map(ie=>ie.id))}catch(ie){x(ce),m(kt(f,ie),"error")}finally{R(!1)}},le=(I,ce)=>{const ie=I+ce;if(G||ie<0||ie>=b.length)return;const fe=b.slice(),[C]=fe.splice(I,1);C&&(fe.splice(ie,0,C),F(fe))},pe=I=>{const ce=b.findIndex(K=>K.id===ne.current),ie=b.findIndex(K=>K.id===I);if(ne.current="",G||ce<0||ie<0||ce===ie)return;const fe=b.slice(),[C]=fe.splice(ce,1);C&&(fe.splice(ie,0,C),F(fe))},he=b.some(I=>Z.selected.has(I.id)&&I.animated);return s.jsxs("div",{className:Pe("flex flex-col gap-3 min-w-0",se.length>0&&"pb-16 sm:pb-0"),children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(de,{onClick:o,children:[s.jsx(Lr,{size:16,className:"rtl:-scale-x-100"}),f("backToPacks")]}),p&&s.jsxs("div",{className:"min-w-0 max-w-full",children:[s.jsx("h3",{className:"text-base font-bold text-text-main",children:s.jsx(rn,{children:p.name})}),s.jsx("p",{className:"text-xs text-muted",children:Bt(f("stickerCount"),{n:p.count})})]})]}),A&&b.length===0&&s.jsx(Ts,{text:f("loading")}),N&&b.length===0&&s.jsx(mt,{kind:"error",description:N,action:s.jsx(de,{onClick:E,children:f("retryLoad")})}),!A&&!N&&b.length===0&&s.jsx(mt,{kind:"empty",icon:s.jsx(Zy,{size:28,className:"text-muted"}),description:f("packEmpty")}),b.length>0&&s.jsxs(s.Fragment,{children:[se.length===0&&s.jsx("div",{children:s.jsx(de,{variant:"ghost",size:"sm",onClick:Z.selectAll,children:f(M>1?"selectCurrentPage":"selectAll")})}),s.jsx(dw,{count:se.length,animatedSelected:he,canRemove:!0,sendReason:se.length?z.sendReason:null,exportReason:se.length?z.exportReason:null,onSelectAll:Z.selectAll,selectAllLabel:f(M>1?"selectCurrentPage":"selectAll"),onClear:Z.clear,onFavorite:z.favorite,onUnfavorite:z.unfavorite,onAdd:z.askAdd,onMove:z.askMove,onRemove:z.remove,onDownload:z.download,onConvert:z.convert,onShare:z.share,onSend:z.askSend,onDelete:z.askDelete}),s.jsx("ul",{className:"flex flex-col gap-2",children:T.map((I,ce)=>{const ie=(U-1)*48+ce;return s.jsxs("li",{className:"flex items-center gap-2 rounded-xl border border-line bg-panel p-2",onDragOver:fe=>fe.preventDefault(),onDrop:fe=>{fe.preventDefault(),pe(I.id)},children:[s.jsx("div",{className:"w-16 shrink-0",children:s.jsx(mw,{sticker:I,selected:Z.selected.has(I.id),onToggle:fe=>Z.toggle(ce,fe),onOpen:()=>z.openDetail(I),onFavorite:()=>z.toggleFavorite(I)})}),s.jsx("p",{className:"flex-1 min-w-0 text-sm font-semibold",children:s.jsx(rn,{children:I.name||f("stickerPreview")})}),s.jsx(Oe,{label:f("reorderUp"),disabled:G||ie===0,onClick:()=>le(ie,-1),children:s.jsx(Dk,{size:14})}),s.jsx(Oe,{label:f("reorderDown"),disabled:G||ie===b.length-1,onClick:()=>le(ie,1),children:s.jsx(cl,{size:14})}),s.jsx(Oe,{label:f("reorderDragHint"),variant:"ghost",className:"cursor-grab",draggable:!G,onDragStart:fe=>{ne.current=I.id,fe.dataTransfer.effectAllowed="move",fe.dataTransfer.setData("text/plain",I.id)},icon:s.jsx(Zy,{size:16})})]},I.id)})}),s.jsx(ki,{page:U,pageCount:M,total:O,onPageChange:P})]}),z.dialogs]})},aT=({isConnected:n,gifEnabled:i,onOpenInCreate:r})=>{const{t:o}=Ue(),{toast:d}=Ct(),[f,m]=y.useState([]),[p,h]=y.useState(!0),[b,x]=y.useState(null),[v,S]=y.useState(""),[A,k]=y.useState(null),[N,j]=y.useState(!1),[L,_]=y.useState(null),[G,R]=y.useState(null),[ne,U]=y.useState(""),[M,T]=y.useState(null),[P,O]=y.useState(!1),[J,Z]=y.useState(null),[se,E]=y.useState(""),z=y.useCallback(()=>{x(null),$.getPacks().then(I=>m(I.packs)).catch(I=>x(kt(o,I))).finally(()=>h(!1))},[o]);y.useEffect(()=>{z()},[z]);const F=async()=>{if(zr(v)){k(o("packNameLength"));return}j(!0),k(null);try{await $.createPack(v.trim()),S(""),d(o("packCreated"),"success"),z()}catch(I){d(kt(o,I),"error")}finally{j(!1)}},le=async()=>{if(G){if(zr(ne)){d(o("packNameLength"),"warning");return}j(!0);try{await $.updatePack(G.id,ne.trim()),d(o("packRenamed"),"success"),R(null),z()}catch(I){d(kt(o,I),"error")}finally{j(!1)}}},pe=async()=>{if(M){j(!0);try{await $.deletePack(M.id,P),d(o("packDeleted"),"success"),T(null),O(!1),z()}catch(I){d(kt(o,I),"error")}finally{j(!1)}}},he=async()=>{if(J){if(!se){d(o("noDestinationPack"),"warning");return}j(!0);try{await $.mergePack(J.id,se),d(o("packsMerged"),"success"),Z(null),E(""),z()}catch(I){d(kt(o,I),"error")}finally{j(!1)}}};return L?s.jsx(nT,{packId:L,isConnected:n,gifEnabled:i,onOpenInCreate:r,onBack:()=>{_(null),z()}}):s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Be,{value:v,onChange:I=>{const ce=I.target.value;S(ce),A&&k(zr(ce)?o("packNameLength"):null)},onKeyDown:I=>{I.key==="Enter"&&(I.preventDefault(),F())},placeholder:o("newPackPlaceholder"),"aria-label":o("packName"),dir:"auto",maxLength:ow+20,className:"min-w-0 flex-1"}),s.jsxs(de,{variant:"primary",onClick:()=>void F(),disabled:N,icon:s.jsx(ul,{size:16}),className:"shrink-0 whitespace-nowrap",children:[s.jsx("span",{className:"sm:hidden",children:o("create")}),s.jsx("span",{className:"hidden sm:inline",children:o("createPack")})]})]}),A&&s.jsx("p",{className:"text-xs text-danger",children:A}),p&&s.jsx(Ts,{text:o("loading")}),b&&!p&&s.jsx(mt,{kind:"error",description:b,action:s.jsx(de,{onClick:z,children:o("retryLoad")})}),!p&&!b&&f.length===0&&s.jsx(mt,{kind:"empty",icon:s.jsx(zm,{size:28,className:"text-muted"}),description:o("noPacks")}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:f.map(I=>s.jsxs(Ze,{className:"flex items-center gap-3",children:[s.jsxs(de,{variant:"ghost",onClick:()=>_(I.id),className:"h-auto min-h-11 min-w-0 flex-1 justify-start gap-3 px-1","aria-label":o("openPack"),children:[I.coverUrl?s.jsx("img",{src:I.coverUrl,alt:"",loading:"lazy",className:"w-14 h-14 rounded-xl object-cover bg-panel-hover shrink-0"}):s.jsx("span",{className:"w-14 h-14 rounded-xl bg-panel-hover text-muted flex items-center justify-center shrink-0",children:s.jsx(zm,{size:20})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx(rn,{lines:2,className:"font-bold text-text-main text-start",children:I.name}),s.jsx("span",{className:"block text-xs text-muted",children:Bt(o("stickerCount"),{n:I.count})})]})]}),s.jsxs(Yn,{label:o("moreActions"),children:[s.jsx(lt,{icon:s.jsx(p0,{size:16}),onSelect:()=>{R(I),U(I.name)},children:o("renamePack")}),s.jsx(lt,{icon:s.jsx(Zk,{size:16}),onSelect:()=>{Z(I),E("")},children:o("merge")}),s.jsx(Dr,{}),s.jsx(lt,{danger:!0,icon:s.jsx(Mn,{size:16}),onSelect:()=>{T(I),O(!1)},children:o("deletePack")})]})]},I.id))}),s.jsx(an,{isOpen:G!==null,onClose:()=>R(null),title:o("renamePack"),footer:s.jsxs("div",{className:"flex w-full justify-end gap-2",children:[s.jsx(de,{onClick:()=>R(null),children:o("cancel")}),s.jsx(de,{variant:"primary",onClick:()=>void le(),disabled:N,children:o("save")})]}),children:s.jsx(Be,{value:ne,onChange:I=>U(I.target.value),"aria-label":o("packName"),dir:"auto"})}),s.jsx(an,{isOpen:M!==null,onClose:()=>T(null),title:o("deletePackTitle"),footer:s.jsxs("div",{className:"flex w-full justify-end gap-2",children:[s.jsx(de,{onClick:()=>T(null),children:o("cancel")}),s.jsx(de,{variant:"danger",onClick:()=>void pe(),disabled:N,children:o("delete")})]}),children:s.jsx(Sn,{name:"delete-pack-mode",value:P?"stickers":"keep",onChange:I=>O(I==="stickers"),options:[{value:"keep",label:o("deleteKeepStickers")},{value:"stickers",label:o("deletePackAndStickers")}]})}),s.jsx(an,{isOpen:J!==null,onClose:()=>Z(null),title:o("mergeTitle"),footer:s.jsxs("div",{className:"flex w-full justify-end gap-2",children:[s.jsx(de,{onClick:()=>Z(null),children:o("cancel")}),s.jsx(de,{variant:"primary",onClick:()=>void he(),disabled:N||!se,children:o("confirmMerge")})]}),children:s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx("p",{className:"text-sm text-text-main",children:o("mergeConfirmBody")}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"merge-into",children:o("mergeInto")}),s.jsxs(ft,{id:"merge-into",value:se,onChange:I=>E(I.target.value),children:[s.jsx("option",{value:"",children:o("selectPack")}),f.filter(I=>I.id!==(J==null?void 0:J.id)).map(I=>s.jsx("option",{value:I.id,children:I.name},I.id))]})]})})]})},sT=["library","packs","favorites","create","recent"];function rv(){const n=window.location.hash.replace(/^#/,"");if(n.startsWith("stickers/")){const i=n.slice(9);if(sT.includes(i))return i}return"library"}const lT=({isConnected:n})=>{const{t:i}=Ue(),{toast:r}=Ct(),[o,d]=y.useState(rv),[f,m]=y.useState(o==="create"),[p,h]=y.useState(null),[b,x]=y.useState(null),[v,S]=y.useState(0),[A,k]=y.useState(null),[N,j]=y.useState(0),L=y.useCallback(()=>{let M=!0;return x(null),$.getStickerCapabilities().then(T=>{M&&h(T)}).catch(T=>{M&&x(kt(i,T))}),()=>{M=!1}},[i]);y.useEffect(()=>{if(!(v<0))return L()},[L,v]);const _=y.useCallback(M=>{d(M),M==="create"&&m(!0);const T=`stickers/${M}`;window.location.hash.replace(/^#/,"")!==T&&(window.location.hash=T)},[]);y.useEffect(()=>{const M=()=>d(rv());return window.addEventListener("hashchange",M),()=>window.removeEventListener("hashchange",M)},[]),y.useEffect(()=>{o==="create"&&m(!0)},[o]),y.useEffect(()=>(iv(M=>{if(M.type==="saved"){r(M.created?i("stickerCreated"):i("alreadyInLibrary"),M.created?"success":"info"),M.qualityReduced&&r(i("qualityReduced"),"info"),j(T=>T+1);return}r(ph(i,M.code),"error")}),()=>iv(null)),[i,r]),y.useEffect(()=>{const M=()=>{const P=KA();P&&(k(P),m(!0),d("create"),window.location.hash.startsWith("#stickers/create")||(window.location.hash="stickers/create"))};M();const T=()=>{document.visibilityState==="visible"&&M()};return document.addEventListener("visibilitychange",T),()=>document.removeEventListener("visibilitychange",T)},[]);const G=y.useCallback(()=>{YA(),k(null)},[]),R=y.useCallback(async M=>{try{const T=await fetch(M.url,{credentials:"same-origin"});if(!T.ok)throw new Error(String(T.status));const P=await T.blob(),O=M.name.trim(),J=O?O.toLowerCase().endsWith(".webp")?O:`${O}.webp`:"sticker.webp";k({blob:P,name:J,source:"PANEL_UPLOAD",...Rc()?{existingId:M.id}:{}}),_("create")}catch(T){r(kt(i,T),"error")}},[_,i,r]),ne=p!==null&&!p.webp,U=[{id:"library",label:i("library"),icon:s.jsx(Gk,{size:16})},{id:"packs",label:i("packs"),icon:s.jsx(zm,{size:16})},{id:"favorites",label:i("favorites"),icon:s.jsx(Kc,{size:16})},{id:"create",label:i("create"),icon:s.jsx(Rk,{size:16})},{id:"recent",label:i("recent"),icon:s.jsx(_v,{size:16})}];return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6 min-w-0",children:[s.jsx(gl,{icon:s.jsx(nh,{size:24}),title:i("stickers"),description:i("stickersDesc")}),ne&&s.jsxs("div",{className:"rounded-2xl border border-warn/30 bg-warn/10 p-4 flex items-center gap-3",children:[s.jsx(ml,{size:20,className:"text-warn shrink-0"}),s.jsx("span",{className:"text-sm text-warn font-medium",children:i("stickerErr_ENCODER_MISSING")})]}),s.jsx("div",{className:"-mx-4 overflow-x-auto no-scrollbar px-4 sm:mx-0 sm:px-0","data-tour":"stickers-tabs",children:s.jsx($c,{"aria-label":i("stickers"),className:"min-w-max",value:o,onChange:_,options:U.map(M=>({value:M.id,label:M.label,icon:M.icon}))})}),o==="library"&&s.jsx(_m,{preset:"all",isConnected:n,gifEnabled:(p==null?void 0:p.gif)===!0,refreshKey:N,onOpenInCreate:M=>void R(M),onGoCreate:()=>_("create")}),o==="favorites"&&s.jsx(_m,{preset:"favorites",isConnected:n,gifEnabled:(p==null?void 0:p.gif)===!0,refreshKey:N,onOpenInCreate:M=>void R(M),onGoCreate:()=>_("create")}),o==="recent"&&s.jsx(_m,{preset:"recent",isConnected:n,gifEnabled:(p==null?void 0:p.gif)===!0,refreshKey:N,onOpenInCreate:M=>void R(M),onGoCreate:()=>_("create")}),o==="packs"&&s.jsx(aT,{isConnected:n,gifEnabled:(p==null?void 0:p.gif)===!0,onOpenInCreate:M=>void R(M)}),f&&s.jsx("div",{className:o==="create"?"":"hidden",children:s.jsx(IA,{capabilities:p,capsError:b,onRetryCaps:()=>S(M=>M+1),incoming:A,onConsumedIncoming:G,isConnected:n,onGoLibrary:()=>_("library"),onCreated:()=>j(M=>M+1)})})]})},pw=["overview","connection","commands","ai","groups","autodelete","schedules","settings","logs","stickers"];function iT(){const n=window.location.hash.replace(/^#/,"").split("/")[0];return pw.includes(n)?n:"overview"}const rT=()=>{const{t:n}=Ue(),{toast:i}=Ct(),[r,o]=y.useState(iT),[d,f]=y.useState(!1),{sessionStatus:m}=DC((k,N)=>{if(k==="status"){const j=N==null?void 0:N.state;i(`Connection state: ${j}`,"info")}}),[p,h]=y.useState(null),b=y.useCallback(async()=>{try{const k=await $.getSession();k!=null&&k.session?h({...k.session,qr:k.qr??null,pairingCode:k.pairingCode??null}):k!=null&&k.status&&h(k.status)}catch{}},[]);y.useEffect(()=>{b()},[b]);const x=p||m?{state:(m==null?void 0:m.state)||(p==null?void 0:p.state)||"idle",...p||{},...m||{}}:null,v=(x==null?void 0:x.connected)===!0||(x==null?void 0:x.state)==="connected";y.useEffect(()=>{const k=x==null?void 0:x.state,j=k==="starting"||k==="linking"||k==="reconnecting"||k==="waiting_for_qr"&&!(x!=null&&x.qr)&&!(x!=null&&x.pairingCode)?2e3:15e3,L=setInterval(()=>{b()},j);return()=>clearInterval(L)},[x==null?void 0:x.state,x==null?void 0:x.qr,x==null?void 0:x.pairingCode,b]);const S=k=>{o(k),window.location.hash=k};y.useEffect(()=>{const k=()=>{const N=window.location.hash.replace(/^#/,"").split("/")[0];pw.includes(N)&&o(N)};return window.addEventListener("hashchange",k),()=>window.removeEventListener("hashchange",k)},[]);const A={overview:n("overview"),connection:n("connection"),commands:n("commands"),ai:n("ai"),groups:n("groups"),autodelete:n("autoDelete"),schedules:n("schedules"),settings:n("settings"),logs:n("logs"),stickers:n("stickers")};return y.useEffect(()=>DN(),[]),s.jsxs("div",{className:"min-h-screen min-h-[100dvh] flex bg-bg text-text-main bg-ambient-glow overflow-x-clip relative",children:[s.jsx(BN,{currentView:r,onSelectView:S,isOpenMobile:d,onCloseMobile:()=>f(!1)}),s.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[s.jsx(ON,{onToggleMobileMenu:()=>f(k=>!k),title:A[r]||"Dashboard",view:r,status:x}),s.jsxs("main",{className:"flex-1 max-w-7xl w-full mx-auto p-4 sm:p-6 lg:p-8",children:[s.jsx(AN,{}),s.jsxs(C1,{children:[r==="overview"&&s.jsx(IE,{status:x,onNavigate:S}),r==="connection"&&s.jsx(OE,{status:x,onRefresh:b,onStatusUpdate:k=>h(N=>({...N||{},...k}))}),r==="ai"&&s.jsx(OC,{}),r==="commands"&&s.jsx(mE,{}),r==="schedules"&&s.jsx(iA,{isConnected:v,onNavigate:S}),r==="groups"&&s.jsx(PE,{}),r==="autodelete"&&s.jsx(eE,{}),r==="settings"&&s.jsx(pA,{}),r==="stickers"&&s.jsx(lT,{isConnected:v}),r==="logs"&&s.jsx(FE,{})]})]})]})]})},oT=()=>s.jsx(dj,{children:s.jsx(EN,{children:s.jsx(LN,{children:s.jsx(rT,{})})})}),ov=document.getElementById("root");ov&&hk.createRoot(ov).render(s.jsx(rk.StrictMode,{children:s.jsx(oT,{})}));