@fudanda/admin-antd 1.20261015.1-beta.1 → 2.20261024.1-beta.1

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 (176) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +58 -42
  3. package/THIRD_PARTY_NOTICES.md +55 -55
  4. package/dist/automation.js +3 -3
  5. package/dist/chunks/App-DNjXLysb.js +79 -0
  6. package/dist/chunks/{AppModal-B_xvSaeq.js → AppModal-DJzQA6FR.js} +1 -1
  7. package/dist/chunks/ArcBaseAdmin-BZrHGq2f.js +1 -0
  8. package/dist/chunks/ConfigurableTable-DzmZDd8F.js +55 -0
  9. package/dist/chunks/{DashboardPage-BTLufKzi.js → DashboardPage-BohGodSl.js} +1 -1
  10. package/dist/chunks/DataScopePanel-B2-x8Jcz.js +1 -0
  11. package/dist/chunks/{DateTimeText-rk9NeYgA.js → DateTimeText-CIt0Qy45.js} +1 -1
  12. package/dist/chunks/DepartmentsPage-DMWY__Y_.js +1 -0
  13. package/dist/chunks/DictTag-2-adKbYg.js +1 -0
  14. package/dist/chunks/DictsPage-DILDyHi-.js +15 -0
  15. package/dist/chunks/EditFormModal-DNHOZHxM.js +1 -0
  16. package/dist/chunks/EntityContextRuntime-DMklAv-k.js +1 -0
  17. package/dist/chunks/{EntityContextRuntime-BrAz-aCV.js → EntityContextRuntime-sslBZqYD.js} +1 -1
  18. package/dist/chunks/{EntityRelationButton-C8Cl8wyh.js → EntityRelationButton-DWn1rC2J.js} +2 -2
  19. package/dist/chunks/{ExportButton-D4IvZKHy.js → ExportButton-AzH4D0oW.js} +1 -1
  20. package/dist/chunks/FileNameCell-DPyi64Rv.js +1 -0
  21. package/dist/chunks/FileStorageConfigsPage-CzuOgeK0.js +15 -0
  22. package/dist/chunks/FileTypeIcon-DIih3XQG.js +1 -0
  23. package/dist/chunks/{FileViewerPreviewPanel-wbXzgqxc.js → FileViewerPreviewPanel-CMqVtGCr.js} +2 -2
  24. package/dist/chunks/FilesPage-BaEBCOCs.js +43 -0
  25. package/dist/chunks/IdentitySecurityPage-BO7nY8id.js +1 -0
  26. package/dist/chunks/{JsonPreviewPanel-D8YpZD1A.js → JsonPreviewPanel-Dhbza-Uu.js} +1 -1
  27. package/dist/chunks/LogStatsScaffold-CLycj3da.js +1 -0
  28. package/dist/chunks/LoginLogsPage-DTmHi8u0.js +1 -0
  29. package/dist/chunks/LoginLogsTable-DVmHnC6V.js +1 -0
  30. package/dist/chunks/{MasterDetailLayout-DDVFodpX.js → MasterDetailLayout-sjPWw8BI.js} +2 -2
  31. package/dist/chunks/{MemberAssignmentSheet-NWm5vThg.js → MemberAssignmentSheet-Czbt6_zv.js} +1 -1
  32. package/dist/chunks/MenuCommandPalette-BCOzf-Kq.js +8 -0
  33. package/dist/chunks/MenusPage-DN8DTGB1.js +1 -0
  34. package/dist/chunks/{ModalFooter-vXDpmYTM.js → ModalFooter-RMlvqrO9.js} +1 -1
  35. package/dist/chunks/NavListPanel-vjIOIqK0.js +1 -0
  36. package/dist/chunks/OnlineSessionsPage-FoHYZKlR.js +1 -0
  37. package/dist/chunks/OperationLogsPage-BeRnGcBJ.js +1 -0
  38. package/dist/chunks/OperationLogsTable-COI-Lp-y.js +1 -0
  39. package/dist/chunks/PDFPreviewPanel-BIQuBnZZ.js +37 -0
  40. package/dist/chunks/PasswordInput-DGEJO9yx.js +1 -0
  41. package/dist/chunks/PositionsPage-DohI0luX.js +1 -0
  42. package/dist/chunks/PreferencesSheetBody-B9niQABW.js +43 -0
  43. package/dist/chunks/ProfilePage-CVTRv7xb.js +15 -0
  44. package/dist/chunks/RelationPanel-B1X6AVaM.js +36 -0
  45. package/dist/chunks/RolesPage-CtUw93L8.js +1 -0
  46. package/dist/chunks/{SearchToolbar-BAh56OAa.js → SearchToolbar-CvgYKUjr.js} +1 -1
  47. package/dist/chunks/{SessionClientTag-DafwXf-o.js → SessionClientTag-DIwnYodW.js} +2 -2
  48. package/dist/chunks/SessionConflictModal-BLNuDsN_.js +1 -0
  49. package/dist/chunks/SettingRow-DVNmTJWC.js +1 -0
  50. package/dist/chunks/SettingsPage-BRnCxYQm.js +26 -0
  51. package/dist/chunks/StatCard-Czjfs0fa.js +4 -0
  52. package/dist/chunks/{UserDisplay-BYhcfa84.js → UserDisplay-J0Re8z-7.js} +1 -1
  53. package/dist/chunks/UserGroupsPage-CNwbejx-.js +1 -0
  54. package/dist/chunks/{UserLogsPanels-3ZlKQsCu.js → UserLogsPanels-BHeSxWrk.js} +2 -2
  55. package/dist/chunks/UserTransferSelect-CAeyxdor.js +22 -0
  56. package/dist/chunks/UsersPage-BXt9fOru.js +36 -0
  57. package/dist/chunks/{archive-D0BSMQmn.js → archive-B_IKvysI.js} +4 -4
  58. package/dist/chunks/chart-data-DImT_Mzn.js +5 -0
  59. package/dist/chunks/{chart-renderer-BWLqOvLF.js → chart-renderer-k-Rd8vdL.js} +1 -1
  60. package/dist/chunks/{user-cC0uCe3d.js → chevron-right-EBApfX6q.js} +2 -2
  61. package/dist/chunks/{clipboard-BKPNFY58.js → clipboard-ERcMSMRH.js} +1 -1
  62. package/dist/chunks/{confirm-CC2F8XXe.js → confirm-BtBBEqk8.js} +1 -1
  63. package/dist/chunks/{data-DPCozzrG.js → data-B05HzECj.js} +1 -1
  64. package/dist/chunks/{deleteAction-NGTDhZud.js → deleteAction-CCocr5uV.js} +1 -1
  65. package/dist/chunks/{diagram-vBbcsoK2.js → diagram-D9cwc7QH.js} +3 -3
  66. package/dist/chunks/dist-Bauqz5on.js +1 -0
  67. package/dist/chunks/{drawing-CUAfa3D5.js → drawing-D2Qrun-P.js} +2 -2
  68. package/dist/chunks/{email-U025DuXM.js → email-ByshRsFv.js} +2 -2
  69. package/dist/chunks/{export-CCaKk9VN.js → export-DlTz5dc2.js} +5 -5
  70. package/dist/chunks/{eye-DNBTmA6c.js → eye-off-BtJoIT5n.js} +1 -8
  71. package/dist/chunks/feedback-BnjMKZpz.js +1 -0
  72. package/dist/chunks/file-utils-DyvnVEoH.js +1 -0
  73. package/dist/chunks/fit-CsnhEncA.js +1 -0
  74. package/dist/chunks/{form-DhQiOMvp.js → form-CQutQFiD.js} +1 -1
  75. package/dist/chunks/geo-DR0fL7r2.js +38 -0
  76. package/dist/chunks/{image-C52XMTxg.js → image-ez9hvzKT.js} +1 -1
  77. package/dist/chunks/{lib-DZsU27Fn.js → lib-BlRm3nk1.js} +4 -4
  78. package/dist/chunks/line-BV7qVRkM.js +1 -0
  79. package/dist/chunks/{msg-DNXH9mKo.js → msg-BzZbudMm.js} +1 -1
  80. package/dist/chunks/{ofd-B0_-rey2.js → ofd-C7DKqJ6Z.js} +1 -1
  81. package/dist/chunks/{openDocument-DW7w0HpR.js → openDocument-DGzqlyJg.js} +1 -1
  82. package/dist/chunks/parse-6ZQGx714.js +1 -0
  83. package/dist/chunks/{parser-BFNqF7wU.js → parser-DC3PvpL4.js} +1 -1
  84. package/dist/chunks/ppt-B0WY5Gks.js +30 -0
  85. package/dist/chunks/pptx-DX5KDFZ7.js +109 -0
  86. package/dist/chunks/{print-mask-DTiml6Ox.js → print-mask-Dguzv0rv.js} +2 -2
  87. package/dist/chunks/{psd-yU36O76Y.js → psd-hjeNFQZ-.js} +1 -1
  88. package/dist/chunks/{search-filters-BoRMIesR.js → search-filters-CRIhZ0gL.js} +1 -1
  89. package/dist/chunks/spreadsheet-BzbBEhmY.js +1 -0
  90. package/dist/chunks/{spreadsheet-DiZ31XlH.js → spreadsheet-LR3SOG-x.js} +3 -3
  91. package/dist/chunks/toolbar-controls-CThS0xuP.js +15 -0
  92. package/dist/chunks/ui-BFsHoY7a.js +1 -0
  93. package/dist/chunks/{useCrudOperationColumn-PObQMk2y.js → useCrudOperationColumn-D935tixd.js} +1 -1
  94. package/dist/chunks/useListPage-CbcOQG4m.js +1 -0
  95. package/dist/chunks/{useStatusToggle-B7KSIN75.js → useStatusToggle-B2qZaoc-.js} +1 -1
  96. package/dist/chunks/wordDoc-BZY3ZnxN.js +152 -0
  97. package/dist/chunks/wordDocx-Bt2mlB3C.js +77 -0
  98. package/dist/chunks/{xmind-B9BtGBNI.js → xmind-CF9YwkOD.js} +2 -2
  99. package/dist/file-viewer/flyfish-viewer-assets.json +5 -5
  100. package/dist/file-viewer/vendor/docx/jszip.min.js +0 -0
  101. package/dist/file-viewer/wasm/data/sql-wasm.wasm +0 -0
  102. package/dist/index.js +1 -1
  103. package/dist/{src-DVwjbBTf.js → src-LbWcrSWe.js} +1 -1
  104. package/dist/styles.css +1 -1
  105. package/package.json +7 -7
  106. package/dist/chunks/App-DX7JOOmP.js +0 -79
  107. package/dist/chunks/ArcBaseAdmin-CdB_roNY.js +0 -1
  108. package/dist/chunks/ConfigurableTable-CyfZLgG0.js +0 -55
  109. package/dist/chunks/DataScopePanel-CubtBhTT.js +0 -1
  110. package/dist/chunks/DepartmentsPage-ECexbzsK.js +0 -1
  111. package/dist/chunks/DictTag-BerYvaUM.js +0 -1
  112. package/dist/chunks/DictsPage-65kAxYFd.js +0 -15
  113. package/dist/chunks/DirectoryLoginModal-rRXvoqV7.js +0 -1
  114. package/dist/chunks/EditFormModal-D68dOnaj.js +0 -1
  115. package/dist/chunks/EntityContextRuntime-D9mWi5xC.js +0 -1
  116. package/dist/chunks/FileNameCell-C_V1k0q-.js +0 -1
  117. package/dist/chunks/FilePreviewModal-D7v5seXB.js +0 -1
  118. package/dist/chunks/FileStorageConfigsPage-D2UYESb5.js +0 -15
  119. package/dist/chunks/FileTypeIcon-C77EVWXZ.js +0 -1
  120. package/dist/chunks/FilesPage-By81A2i7.js +0 -43
  121. package/dist/chunks/ForgotPasswordModal-DTlunJpM.js +0 -1
  122. package/dist/chunks/IdentitySecurityPage-Dp5EP7aT.js +0 -1
  123. package/dist/chunks/LogStatsScaffold-BFwbN_MU.js +0 -1
  124. package/dist/chunks/LoginField-Bu4C0-Mk.js +0 -1
  125. package/dist/chunks/LoginLogsPage-BuMJ6U8I.js +0 -1
  126. package/dist/chunks/LoginLogsTable-DfAlWPZb.js +0 -1
  127. package/dist/chunks/MenuCommandPalette-BvW2kEU4.js +0 -8
  128. package/dist/chunks/MenusPage-DT3kxAfi.js +0 -1
  129. package/dist/chunks/NavListPanel-agMt2kc6.js +0 -1
  130. package/dist/chunks/OnlineSessionsPage-BJJAB2pV.js +0 -1
  131. package/dist/chunks/OperationLogsPage-CP-wUt_N.js +0 -1
  132. package/dist/chunks/OperationLogsTable-BX0vV3fT.js +0 -1
  133. package/dist/chunks/PDFPreviewPanel-D8-74Zqs.js +0 -30
  134. package/dist/chunks/PasswordInput--G8GKd5g.js +0 -1
  135. package/dist/chunks/PositionsPage-Cs7xq89s.js +0 -1
  136. package/dist/chunks/PreferencesSheetBody-CdA4Ig_g.js +0 -43
  137. package/dist/chunks/ProfilePage-Bt3yP6D-.js +0 -15
  138. package/dist/chunks/RelationPanel-B-KAfl9B.js +0 -36
  139. package/dist/chunks/RolesPage-DDNGkGAq.js +0 -1
  140. package/dist/chunks/SessionConflictModal-DgFNCU3j.js +0 -1
  141. package/dist/chunks/SettingRow-BIb1ruW2.js +0 -1
  142. package/dist/chunks/SettingsPage-rhqkPOJ9.js +0 -16
  143. package/dist/chunks/StatCard-BwhGDWpE.js +0 -4
  144. package/dist/chunks/UserGroupsPage-D3_aji58.js +0 -1
  145. package/dist/chunks/UserTransferSelect-S-GUw2Y9.js +0 -1
  146. package/dist/chunks/UsersPage-CLRJX-V9.js +0 -29
  147. package/dist/chunks/WorkflowPrintButton-BVa-xw-8.js +0 -1
  148. package/dist/chunks/chart-data-DOMSCLwj.js +0 -5
  149. package/dist/chunks/chevron-left-DnDEG_PI.js +0 -8
  150. package/dist/chunks/chevron-right-CzizTV5i.js +0 -8
  151. package/dist/chunks/dist-BqNhxPp5.js +0 -1
  152. package/dist/chunks/feedback-D4BIfDNd.js +0 -1
  153. package/dist/chunks/file-utils-DJ9ksj-g.js +0 -1
  154. package/dist/chunks/geo-Bf8ymo43.js +0 -38
  155. package/dist/chunks/line-DSFA8EqT.js +0 -1
  156. package/dist/chunks/mail-Cduf1OFr.js +0 -8
  157. package/dist/chunks/mono-icons-CxCoktev.js +0 -1
  158. package/dist/chunks/plus-Bvdn6bx1.js +0 -8
  159. package/dist/chunks/ppt-C9RgrmNU.js +0 -30
  160. package/dist/chunks/pptx-_T8ZPVQn.js +0 -109
  161. package/dist/chunks/printer-DL8WQci4.js +0 -8
  162. package/dist/chunks/shield-check-DZGK8n9u.js +0 -8
  163. package/dist/chunks/spreadsheet-CHFSQY8j.js +0 -1
  164. package/dist/chunks/table-columns-XaoxVUJN.js +0 -1
  165. package/dist/chunks/toolbar-controls-BFOuV86W.js +0 -8
  166. package/dist/chunks/ui-DoIHGuTR.js +0 -1
  167. package/dist/chunks/useDebouncedValue-DFoJN77o.js +0 -22
  168. package/dist/chunks/useListPage-1Upr_ala.js +0 -1
  169. package/dist/chunks/wordDoc-CtetBfzo.js +0 -152
  170. package/dist/chunks/wordDocx-8ak39HcF.js +0 -77
  171. package/dist/chunks/zoom-8Eo2fTNd.js +0 -1
  172. package/dist/public/monaco/vs/editor/editor.worker.js +0 -1
  173. package/dist/public/monaco/vs/language/css/css.worker.js +0 -66
  174. package/dist/public/monaco/vs/language/html/html.worker.js +0 -443
  175. package/dist/public/monaco/vs/language/json/json.worker.js +0 -17
  176. package/dist/public/monaco/vs/language/typescript/ts.worker.js +0 -67693
@@ -0,0 +1,43 @@
1
+ import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{i as t,o as n}from"../src-LbWcrSWe.js";import{a as r,i,n as a,o,r as s,s as c}from"./controls-C5dPckUT.js";import{n as l,t as u}from"./createLucideIcon-BtwfYE6A.js";import{i as d,n as f,r as p,t as m}from"./menu-mQgsexFx.js";import{i as h,n as g,r as ee,t as te}from"./chevron-right-EBApfX6q.js";import{n as _,t as v}from"./info-BQa8C31Y.js";import{C as y,S as b,a as x,p as S,s as C}from"./ui-BFsHoY7a.js";import{n as w,t as T}from"./ScrollArea-DqjJmHDN.js";import{c as E,l as ne,n as D,o as re,s as ie,t as O}from"./SettingRow-DVNmTJWC.js";import{useCallback as k,useEffect as ae,useRef as oe,useState as se}from"react";import{DARK_SURFACE_TONE_OPTIONS as ce,FONT_FAMILY_OPTIONS as le,LOADING_STYLE_OPTIONS as ue,UI_SCALE_OPTIONS as de,isScheduleTime as fe,usePreferences as pe}from"@fudanda/react-core/hooks/usePreferences";import{Fragment as A,jsx as j,jsxs as M}from"react/jsx-runtime";import{Button as me,Empty as N}from"antd";import{THEME_COLOR_PRESETS as he}from"@fudanda/react-core/lib/theme-color";import{textMatches as P}from"@fudanda/react-core/utils/pinyin";import{preferenceDefinitionMap as ge,preferenceDefinitions as _e,preferenceOverridesSchema as ve}from"@fudanda/shared/preferences";import{clearAllListFilterSnapshots as ye}from"@fudanda/react-core/lib/list-filter-memory";var F,I;function L(){return(L=e((()=>{
2
+ /**
3
+ * @license lucide-react v1.53.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ l(),F={name:`columns-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]],aliases:[`panels-left-right`]},F.node,I=u(F)})))()}var R,z;function B(){return(B=e((()=>{
9
+ /**
10
+ * @license lucide-react v1.53.0 - ISC
11
+ *
12
+ * This source code is licensed under the ISC license.
13
+ * See the LICENSE file in the root directory of this source tree.
14
+ */
15
+ l(),R={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]},R.node,z=u(R)})))()}var V,H;function U(){return(U=e((()=>{
16
+ /**
17
+ * @license lucide-react v1.53.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */
22
+ l(),V={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]},V.node,H=u(V)})))()}var W,G;function be(){return(be=e((()=>{
23
+ /**
24
+ * @license lucide-react v1.53.0 - ISC
25
+ *
26
+ * This source code is licensed under the ISC license.
27
+ * See the LICENSE file in the root directory of this source tree.
28
+ */
29
+ l(),W={name:`navigation`,size:24,node:[[`polygon`,{points:`3 11 22 2 13 21 11 13 3 11`,key:`1ltx0t`}]]},W.node,G=u(W)})))()}var K,q;function J(){return(J=e((()=>{
30
+ /**
31
+ * @license lucide-react v1.53.0 - ISC
32
+ *
33
+ * This source code is licensed under the ISC license.
34
+ * See the LICENSE file in the root directory of this source tree.
35
+ */
36
+ l(),K={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]},K.node,q=u(K)})))()}var Y,xe;function Se(){return(Se=e((()=>{
37
+ /**
38
+ * @license lucide-react v1.53.0 - ISC
39
+ *
40
+ * This source code is licensed under the ISC license.
41
+ * See the LICENSE file in the root directory of this source tree.
42
+ */
43
+ l(),Y={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]},Y.node,xe=u(Y)})))()}function Ce(e,t){let n=t.trim();if(!n)return!0;let r=X.find(t=>t.key===e.group),i=Te[e.path]??[];return[e.label,e.path,e.description??``,r?.label??``,...e.options?.flatMap(e=>[e.label,String(e.value)])??[],...i].some(e=>P(e,n))}function we(e,t,n,r,i){let a=!e.trim()||[`通用`,`锁屏`,`屏幕锁`,`锁屏密码`,`密码`,`锁定`,`自动锁屏`,`无操作`,`空闲`,`闲置`].some(t=>P(t,e.trim()));return X.map(n=>({...n,fields:_e.filter(r=>r.group===n.key&&t(r.path)&&Ce(r,e)),localCount:n.key===`general`&&a?r?3:2:0})).filter(e=>e.fields.length>0||e.localCount>0)}var X,Te;function Z(){return(Z=e((()=>{X=[{key:`layout`,label:`布局`,description:`选择导航结构和内容区域的呈现方式。`},{key:`appearance`,label:`外观`,description:`调整主题、颜色、字体和界面动效。`},{key:`navigation`,label:`导航`,description:`设置面包屑、顶栏工具和时钟。`},{key:`sidebar`,label:`侧栏`,description:`调整菜单宽度、展开方式和滚动行为。`},{key:`tabs`,label:`标签页`,description:`设置多页浏览、页面缓存和切换行为。`},{key:`table`,label:`表格`,description:`设置列表样式、分页和筛选记忆。单张表格的独立设置优先,可在表格中选择“跟随全局偏好”恢复。`},{key:`general`,label:`通用`,description:`调整首页、时间显示、交互和锁屏设置。`}],Te={colorMode:[`主题`,`主题模式`],themeColor:[`主题色`,`配色`,`品牌色`],homePath:[`默认首页`,`登录跳转`,`落地页`],sidebarWidth:[`侧栏宽度`],loadingStyle:[`Loading`],reduceMotion:[`减少动画`,`关闭动画`]}})))()}function Ee({value:e,onChange:t,options:n,allowCustom:r=!0,customTitle:i=`自定义颜色`,allowClear:a=!1,clearTitle:o=`无颜色`}){let s=e.startsWith(`#`)&&!n.some(t=>t.key===e);return/* @__PURE__ */ M(`div`,{className:`swatch-color-picker`,children:[a&&/* @__PURE__ */ j(b,{content:o,position:`top`,children:/* @__PURE__ */ j(`button`,{type:`button`,"aria-label":o,"aria-pressed":e===``,className:`swatch-color-swatch swatch-color-swatch--clear${e===``?` swatch-color-swatch--active`:``}`,onClick:()=>t(``),children:e===``&&/* @__PURE__ */ j(`span`,{className:`swatch-color-swatch__check`,children:/* @__PURE__ */ j(p,{size:14,strokeWidth:2.5})})})}),n.map(n=>{let r=e===n.key;return/* @__PURE__ */ j(b,{content:n.label,position:`top`,children:/* @__PURE__ */ j(`button`,{type:`button`,"aria-label":n.label,"aria-pressed":r,className:`swatch-color-swatch${r?` swatch-color-swatch--active`:``}`,style:{backgroundColor:n.color,color:n.color},onClick:()=>t(n.key),title:n.label,children:r&&/* @__PURE__ */ j(`span`,{className:`swatch-color-swatch__check`,children:/* @__PURE__ */ j(p,{size:14,strokeWidth:2.5})})})},n.key)}),r&&/* @__PURE__ */ j(C,{alpha:!1,usePopover:!0,value:s?C.colorStringToValue(e):void 0,onChange:e=>t(e.hex),popoverProps:{position:`top`,zIndex:10010},children:/* @__PURE__ */ j(`button`,{type:`button`,"aria-label":i,"aria-pressed":s,className:`swatch-color-swatch swatch-color-swatch--custom${s?` swatch-color-swatch--active`:``}`,style:s?{backgroundColor:e,color:e}:{},title:i,children:s?/* @__PURE__ */ j(`span`,{className:`swatch-color-swatch__check`,children:/* @__PURE__ */ j(p,{size:14,strokeWidth:2.5})}):/* @__PURE__ */ j(`span`,{className:`swatch-color-swatch__icon`,children:/* @__PURE__ */ j(q,{size:14})})})})]})}function De(){return(De=e((()=>{y(),d(),J()})))()}function Oe({prefSection:e,matchesPref:t,preferences:n,setPreferences:a,navLayout:o}){return/* @__PURE__ */ M(D,{title:e(`布局`),children:[t([`导航布局`,`布局`,`左侧菜单`,`顶部菜单`,`混合菜单`,`双列菜单`])&&/* @__PURE__ */ j(O,{path:`navLayout`,children:/* @__PURE__ */ M(`div`,{children:[/* @__PURE__ */ j(`div`,{style:{marginBottom:12,fontSize:13,fontWeight:500,color:`var(--arc-antd-color-text-0)`},children:`导航布局`}),/* @__PURE__ */ j(`div`,{className:`arc-preferences__layout-options`,children:[{value:`vertical`,label:`左侧菜单`},{value:`horizontal`,label:`顶部菜单`},{value:`mixed`,label:`混合菜单`},{value:`double`,label:`双列菜单`}].map(({value:e,label:t})=>/* @__PURE__ */ M(`button`,{type:`button`,className:`layout-picker__option${o===e?` layout-picker__option--active`:``}`,"aria-pressed":o===e,onClick:()=>a({navLayout:e}),children:[/* @__PURE__ */ M(`div`,{className:`layout-picker__preview layout-picker__preview--${e}`,"aria-hidden":`true`,children:[/* @__PURE__ */ j(`i`,{className:`layout-preview__rail`}),/* @__PURE__ */ j(`i`,{className:`layout-preview__menu`}),/* @__PURE__ */ j(`i`,{className:`layout-preview__header`}),/* @__PURE__ */ M(`i`,{className:`layout-preview__content`,children:[/* @__PURE__ */ j(`i`,{}),/* @__PURE__ */ j(`i`,{}),/* @__PURE__ */ j(`i`,{})]})]}),/* @__PURE__ */ M(`span`,{className:`layout-picker__label`,children:[t,o===e&&/* @__PURE__ */ j(p,{size:14})]})]},e))})]})}),o===`double`&&t([`双列`,`双列菜单`,`首列`,`双列首列`,`图标`,`图标文字`])&&/* @__PURE__ */ j(O,{path:`doubleRailStyle`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`双列首列形式`,/* @__PURE__ */ j(b,{content:`仅图标:与左侧菜单收起时同宽,名称靠悬浮提示,可容纳更多一级模块;图标 + 文字:名称直接可读,但条目更高,矮窗口需要滚动`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ M(r,{type:`button`,value:n.doubleRailStyle??`icon`,onChange:e=>a({doubleRailStyle:e.target.value}),children:[/* @__PURE__ */ j(i,{value:`icon`,children:`仅图标`}),/* @__PURE__ */ j(i,{value:`icon-text`,children:`图标 + 文字`})]})]})}),t([`内容宽度`,`固定宽度`,`居中`,`内容区`])&&/* @__PURE__ */ j(O,{path:`contentWidth`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`固定内容宽度`,/* @__PURE__ */ j(b,{content:`开启后内容区最大宽度为 1440px 并居中,适合宽屏显示器`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:(n.contentWidth??`fluid`)===`fixed`,onChange:e=>a({contentWidth:e?`fixed`:`fluid`})})]})}),t([`Logo`,`Logo图标`,`图标`,`显示Logo`])&&/* @__PURE__ */ j(O,{path:`showLogo`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`显示 Logo 图标`}),/* @__PURE__ */ j(c,{checked:n.showLogo??!0,onChange:e=>a({showLogo:e})})]})})]})}function Q({label:e,hint:t,value:n,onChange:a}){return/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[e,/* @__PURE__ */ j(b,{content:t,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(r,{type:`button`,value:n,onChange:e=>a(e.target.value),children:ce.map(e=>/* @__PURE__ */ j(i,{value:e.value,children:e.label},e.value))})]})}function ke({path:e,label:t,value:n,onCommit:r}){return/* @__PURE__ */ j(O,{path:e,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:t}),/* @__PURE__ */ j(a,{defaultValue:n,placeholder:`18:00`,"aria-label":t,style:{width:96},onChange:e=>{fe(e)&&r(e)}},n)]})})}function Ae({prefSection:e,matchesPref:n,preferences:a,setPreferences:s,mode:l,handleThemeModeChange:u,isDark:d,themeColor:f,setThemeColor:p}){let m=oe(null),h=oe(null),g=ne()(`loadingStyle`)&&n([`加载动画`,`加载效果`,`Loading`,...ue.map(e=>e.label)]),[_,y]=se({canPrev:!1,canNext:!1}),S=k(()=>{let e=m.current;e&&y({canPrev:e.scrollLeft>1,canNext:e.scrollLeft+e.clientWidth<e.scrollWidth-1})},[]);ae(()=>{if(!g)return;let e=m.current;if(!e)return;S();let t=new ResizeObserver(S);return t.observe(e),()=>t.disconnect()},[g,S]),ae(()=>{let e=m.current,t=h.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.left<n.left?e.scrollLeft-=n.left-r.left:r.right>n.right&&(e.scrollLeft+=r.right-n.right)},[g,a.loadingStyle]);let C=k(e=>{let t=m.current;t&&t.scrollBy({left:e*t.clientWidth,behavior:`smooth`})},[]);return/* @__PURE__ */ M(D,{title:e(`外观`),children:[n([`颜色模式`,`深色`,`浅色`,`系统`,`主题模式`])&&/* @__PURE__ */ j(O,{path:`colorMode`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`颜色模式`}),/* @__PURE__ */ M(r,{type:`button`,value:l,onChange:e=>{let t=e.target.value;u(t)},children:[/* @__PURE__ */ j(i,{value:`light`,children:`浅色`}),/* @__PURE__ */ j(i,{value:`dark`,children:`深色`}),/* @__PURE__ */ j(i,{value:`system`,children:`系统`})]})]})}),n([`主题颜色`,`主题色`,`颜色`,`品牌色`,`自定义颜色`])&&/* @__PURE__ */ j(O,{path:`themeColor`,children:/* @__PURE__ */ M(`div`,{children:[/* @__PURE__ */ j(`div`,{style:{marginBottom:12,fontSize:13,fontWeight:500,color:`var(--arc-antd-color-text-0)`},children:`主题颜色`}),/* @__PURE__ */ j(Ee,{value:f,onChange:p,options:he.map(e=>({key:e.key,label:e.name,color:d?e.dark.primary:e.light.primary}))})]})}),n([`定时深色`,`夜间深色`,`自动深色`,`深色定时`,`深色时段`])&&/* @__PURE__ */ j(O,{path:`scheduledDarkMode`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`定时深色`,/* @__PURE__ */ j(b,{content:`时段内无条件使用深色;时段外跟随颜色模式`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ M(r,{type:`button`,value:a.scheduledDarkMode??`off`,onChange:e=>s({scheduledDarkMode:e.target.value}),children:[/* @__PURE__ */ j(i,{value:`off`,children:`关闭`}),/* @__PURE__ */ j(i,{value:`custom`,children:`自定义时段`})]})]})}),n([`深色开始时间`,`开始时间`,`定时深色`,`夜间开始`])&&/* @__PURE__ */ j(ke,{path:`scheduledDarkStart`,label:`深色开始时间`,value:a.scheduledDarkStart??`18:00`,onCommit:e=>s({scheduledDarkStart:e})}),n([`深色结束时间`,`结束时间`,`定时深色`,`夜间结束`])&&/* @__PURE__ */ j(ke,{path:`scheduledDarkEnd`,label:`深色结束时间`,value:a.scheduledDarkEnd??`06:00`,onCommit:e=>s({scheduledDarkEnd:e})}),!d&&n([`顶部栏深色`,`深色`,`深色模式`,`顶部栏`,`顶部导航`])&&/* @__PURE__ */ j(O,{path:`headerDarkMode`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`顶部栏深色模式`}),/* @__PURE__ */ j(c,{checked:a.headerDarkMode??!1,onChange:e=>s({headerDarkMode:e})})]})}),!d&&n([`侧边栏深色`,`深色`,`深色模式`,`侧边栏`])&&/* @__PURE__ */ j(O,{path:`sidebarDarkMode`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`侧边栏深色模式`}),/* @__PURE__ */ j(c,{checked:a.sidebarDarkMode??!1,onChange:e=>s({sidebarDarkMode:e})})]})}),(d||a.sidebarDarkMode)&&n([`侧边栏底色`,`底色`,`色调`,`深浅`,`侧边栏`])&&/* @__PURE__ */ j(O,{path:`darkSidebarTone`,children:/* @__PURE__ */ j(Q,{label:`侧边栏底色`,hint:`标准与卡片、表格同色;更深会比标准再暗一档,让侧边栏从内容中分离出来`,value:a.darkSidebarTone??`bg-1`,onChange:e=>s({darkSidebarTone:e})})}),(d||a.headerDarkMode)&&n([`顶部底色`,`底色`,`色调`,`深浅`,`顶部`,`顶栏`,`标签栏`,`面包屑`])&&/* @__PURE__ */ j(O,{path:`darkHeaderTone`,children:/* @__PURE__ */ j(Q,{label:`顶部底色`,hint:`作用于顶栏、头部、面包屑栏与标签栏;更深会让整条顶部区域比内容更暗`,value:a.darkHeaderTone??`bg-1`,onChange:e=>s({darkHeaderTone:e})})}),d&&n([`主区域底色`,`底色`,`色调`,`深浅`,`主区域`,`内容区`,`画布`])&&/* @__PURE__ */ j(O,{path:`darkContentTone`,children:/* @__PURE__ */ j(Q,{label:`主区域底色`,hint:`作用于内容画布;更深时卡片与表格会从画布中浮起,形成明度层次`,value:a.darkContentTone??`bg-1`,onChange:e=>s({darkContentTone:e})})}),n([`圆角`,`圆角大小`,`直角`,`边框圆角`,`radius`,`外观`])&&/* @__PURE__ */ j(O,{path:`borderRadius`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`圆角大小`,/* @__PURE__ */ j(b,{content:`调整按钮、卡片、弹窗等组件的圆角风格:直角更硬朗,大圆角更柔和`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ M(r,{type:`button`,value:a.borderRadius??`medium`,onChange:e=>s({borderRadius:e.target.value}),children:[/* @__PURE__ */ j(i,{value:`none`,children:`直角`}),/* @__PURE__ */ j(i,{value:`small`,children:`小`}),/* @__PURE__ */ j(i,{value:`medium`,children:`默认`}),/* @__PURE__ */ j(i,{value:`large`,children:`大`})]})]})}),n([`界面缩放`,`缩放`,`字号`,`字体大小`,`放大`,`缩小`,`外观`,`无障碍`])&&/* @__PURE__ */ j(O,{path:`uiScale`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:12},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4,flexShrink:0},children:[`界面缩放`,/* @__PURE__ */ j(b,{content:`整体放大或缩小界面(含文字、控件与弹层),适合高分屏或需要更大字号的场景`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(o,{value:a.uiScale??100,optionList:de.map(e=>({value:e.value,label:e.label})),onChange:e=>s({uiScale:e}),style:{width:100}})]})}),n([`字体`,`界面字体`,`Inter`,`思源`,`等宽`,`外观`])&&/* @__PURE__ */ j(O,{path:`fontFamily`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:12},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4,flexShrink:0},children:[`界面字体`,/* @__PURE__ */ j(b,{content:`只使用系统已安装的字体,未安装时按预设回退到系统默认字体`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(o,{value:a.fontFamily??`system`,optionList:le.map(e=>({value:e.value,label:e.label})),onChange:e=>s({fontFamily:e}),style:{width:140}})]})}),n([`标签栏尺寸`,`Tabs尺寸`,`Tabs 大小`,`标签控件尺寸`,`small`,`medium`,`large`,`外观`])&&/* @__PURE__ */ j(O,{path:`tabsSize`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`标签栏尺寸`,/* @__PURE__ */ j(b,{content:`控制页面内部标签栏的尺寸,与多标签页开关无关`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ M(r,{type:`button`,value:a.tabsSize??`small`,onChange:e=>s({tabsSize:e.target.value}),children:[/* @__PURE__ */ j(i,{value:`small`,children:`小`}),/* @__PURE__ */ j(i,{value:`medium`,children:`中`}),/* @__PURE__ */ j(i,{value:`large`,children:`大`})]})]})}),n([`标签栏样式`,`Tabs样式`,`Tabs 类型`,`line`,`button`,`card`,`slash`,`外观`])&&/* @__PURE__ */ j(O,{path:`tabsType`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`标签栏样式`,/* @__PURE__ */ j(b,{content:`控制页面内部标签栏的显示样式`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(o,{value:a.tabsType??`line`,optionList:[{value:`line`,label:`线条`},{value:`button`,label:`按钮`},{value:`card`,label:`卡片`},{value:`slash`,label:`斜线`}],onChange:e=>s({tabsType:e}),style:{width:120}})]})}),g&&/* @__PURE__ */ j(O,{path:`loadingStyle`,children:/* @__PURE__ */ M(`div`,{children:[/* @__PURE__ */ M(`div`,{className:`loading-style-picker__heading`,children:[/* @__PURE__ */ j(`span`,{children:`加载动画`}),/* @__PURE__ */ j(b,{content:`用于首次进入系统、菜单首载和页面懒加载`,position:`right`,children:/* @__PURE__ */ j(v,{size:13})})]}),/* @__PURE__ */ M(`div`,{className:`loading-style-picker__nav`,children:[/* @__PURE__ */ j(x,{theme:`borderless`,size:`small`,className:`loading-style-picker__nav-button`,icon:/* @__PURE__ */ j(ee,{size:14}),"aria-label":`上一个加载动画`,title:`上一个`,disabled:!_.canPrev,onClick:()=>C(-1)}),/* @__PURE__ */ j(T,{className:`loading-style-picker`,scrollRef:m,horizontal:!0,vertical:!1,onScroll:S,"aria-label":`加载动画预览`,children:ue.map(e=>{let n=a.loadingStyle===e.value;return/* @__PURE__ */ M(`button`,{type:`button`,ref:n?h:void 0,className:`loading-style-picker__option${n?` loading-style-picker__option--active`:``}`,"aria-pressed":n,title:e.isDefault?`${e.label}(默认)`:e.label,onClick:()=>s({loadingStyle:e.value}),children:[/* @__PURE__ */ j(`span`,{className:`loading-style-picker__preview`,children:/* @__PURE__ */ j(t,{variant:e.value})}),/* @__PURE__ */ j(`span`,{className:`loading-style-picker__label`,children:e.label})]},e.value)})}),/* @__PURE__ */ j(x,{theme:`borderless`,size:`small`,className:`loading-style-picker__nav-button`,icon:/* @__PURE__ */ j(te,{size:14}),"aria-label":`下一个加载动画`,title:`下一个`,disabled:!_.canNext,onClick:()=>C(1)})]})]})}),n([`灰色`,`灰色模式`,`无障碍`,`公祭日`,`去色`])&&/* @__PURE__ */ j(O,{path:`grayscale`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`灰色模式`,/* @__PURE__ */ j(b,{content:`适用于国家公祭日等场景,全局去除色彩`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:a.grayscale??!1,onChange:e=>s({grayscale:e,...e?{colorBlind:!1}:{}})})]})}),n([`色弱`,`色弱模式`,`无障碍`,`对比度`,`色觉`])&&/* @__PURE__ */ j(O,{path:`colorBlind`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`色弱模式`,/* @__PURE__ */ j(b,{content:`提高界面对比度,辅助色觉障碍用户`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:a.colorBlind??!1,onChange:e=>s({colorBlind:e,...e?{grayscale:!1}:{}})})]})}),n([`动效`,`动画`,`减弱动效`,`性能`,`晕动`,`过渡`])&&/* @__PURE__ */ j(O,{path:`reduceMotion`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`减弱动效`,/* @__PURE__ */ j(b,{content:`关闭路由切换、标签页、主题切换扩散等装饰性动画与过渡;加载指示不受影响。适合低配设备或对动效敏感的用户`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:a.reduceMotion??!1,onChange:e=>s({reduceMotion:e})})]})})]})}function je({prefSection:e,matchesPref:t,preferences:n,setPreferences:a,prefsSearch:o}){return/* @__PURE__ */ M(D,{title:e(`导航与工具栏`),children:[t([`动态标题`,`浏览器标题`,`页面标题`,`标题`])&&/* @__PURE__ */ j(O,{path:`dynamicTitle`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`动态浏览器标题`,/* @__PURE__ */ j(b,{content:`开启后浏览器标签页标题会随当前页面变化,如「用户管理 - ArcBase」;关闭后固定显示应用名称`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.dynamicTitle??!0,onChange:e=>a({dynamicTitle:e})})]})}),t([`面包屑`,`面包屑导航`,`导航栏`,`路径导航`])&&/* @__PURE__ */ j(O,{path:`showBreadcrumb`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`显示面包屑导航`,/* @__PURE__ */ j(b,{content:`在页面顶部显示路径导航(如:首页 / 系统管理 / 用户管理),帮助定位当前位置`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.showBreadcrumb,onChange:e=>a({showBreadcrumb:e})})]})}),(n.showBreadcrumb||!!o.trim())&&t([`面包屑图标`,`图标`,`面包屑`])&&/* @__PURE__ */ j(O,{path:`breadcrumbIcon`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`面包屑显示图标`}),/* @__PURE__ */ j(c,{checked:n.breadcrumbIcon??!1,onChange:e=>a({breadcrumbIcon:e})})]})}),(n.showBreadcrumb||!!o.trim())&&t([`面包屑首页`,`首页`,`面包屑`])&&/* @__PURE__ */ j(O,{path:`breadcrumbShowHome`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`面包屑从首页开始`,/* @__PURE__ */ j(b,{content:`开启后面包屑导航会以「首页」作为第一项,关闭后直接从当前页面的父级路径开始`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.breadcrumbShowHome??!0,onChange:e=>a({breadcrumbShowHome:e})})]})}),(n.showBreadcrumb||!!o.trim())&&t([`面包屑可点击`,`点击`,`面包屑跳转`,`面包屑`])&&/* @__PURE__ */ j(O,{path:`breadcrumbClickable`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`面包屑可点击`,/* @__PURE__ */ j(b,{content:`关闭后面包屑仅展示路径文字,不可点击跳转`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.breadcrumbClickable??!0,onChange:e=>a({breadcrumbClickable:e})})]})}),(n.showBreadcrumb||!!o.trim())&&t([`面包屑子菜单`,`子菜单`,`面包屑悬浮`,`面包屑展开`])&&/* @__PURE__ */ j(O,{path:`breadcrumbSubMenu`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`面包屑子菜单`,/* @__PURE__ */ j(b,{content:`悬停目录层级时弹出子菜单快速导航,支持多级展开`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.breadcrumbSubMenu??!1,onChange:e=>a({breadcrumbSubMenu:e})})]})}),t([`菜单搜索`,`搜索框`,`搜索`,`搜索菜单`])&&/* @__PURE__ */ j(O,{path:`showMenuSearch`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`显示菜单搜索框`}),/* @__PURE__ */ j(c,{checked:n.showMenuSearch??!0,onChange:e=>a({showMenuSearch:e})})]})}),t([`收藏`,`收藏菜单`,`收藏按钮`,`显示收藏`,`收藏入口`,`快捷收藏`])&&/* @__PURE__ */ j(O,{path:`showFavorites`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`显示收藏入口`}),/* @__PURE__ */ j(c,{checked:n.showFavorites??!1,onChange:e=>a({showFavorites:e})})]})}),t([`全屏`,`全屏按钮`,`显示全屏`])&&/* @__PURE__ */ j(O,{path:`showFullscreen`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`显示全屏按钮`}),/* @__PURE__ */ j(c,{checked:n.showFullscreen??!0,onChange:e=>a({showFullscreen:e})})]})}),t([`回到顶部`,`BackTop`,`返回顶部`,`回到顶`,`顶部按钮`])&&/* @__PURE__ */ j(O,{path:`showBackTop`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`显示回到顶部按钮`,/* @__PURE__ */ j(b,{content:`内容区域滚动超过 400px 后,右下角浮现回顶按钮`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.showBackTop??!0,onChange:e=>a({showBackTop:e})})]})}),t([`顶栏时钟`,`时钟`,`时钟显示`,`12小时`,`24小时`])&&/* @__PURE__ */ j(O,{path:`topbarClock`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`顶栏时钟`}),/* @__PURE__ */ M(r,{type:`button`,value:n.topbarClock??`off`,onChange:e=>a({topbarClock:e.target.value}),children:[/* @__PURE__ */ j(i,{value:`off`,children:`关闭`}),/* @__PURE__ */ j(i,{value:`12h`,children:`12小时制`}),/* @__PURE__ */ j(i,{value:`24h`,children:`24小时制`})]})]})}),t([`时钟显示日期`,`日期`,`时钟日期`,`星期`])&&/* @__PURE__ */ j(O,{path:`topbarClockShowDate`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`时钟显示日期`}),/* @__PURE__ */ j(c,{checked:n.topbarClockShowDate??!0,onChange:e=>a({topbarClockShowDate:e})})]})})]})}function Me({prefSection:e,matchesPref:t,preferences:n,setPreferences:a,navLayout:o}){return/* @__PURE__ */ M(D,{title:e(`侧边栏`),children:[t([`侧边栏宽度`,`侧边栏`,`菜单宽度`,`展开宽度`])&&o!==`horizontal`&&/* @__PURE__ */ j(O,{path:`sidebarWidth`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:12},children:[/* @__PURE__ */ j(`span`,{style:{flexShrink:0},children:`侧边栏宽度`}),/* @__PURE__ */ j(s,{style:{width:110},size:`small`,min:160,max:320,step:4,suffix:`px`,value:n.sidebarWidth??216,onChange:e=>a({sidebarWidth:Number(e)||216})})]})}),t([`箭头`,`展开箭头`,`箭头位置`,`展开收起`,`子菜单箭头`,`侧边栏`])&&/* @__PURE__ */ j(O,{path:`sidebarToggleIconPosition`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`子菜单箭头位置`,/* @__PURE__ */ j(b,{content:`侧边栏可展开子菜单的展开/收起箭头显示位置:默认在菜单项右端,可改为显示在左侧`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ M(r,{type:`button`,value:n.sidebarToggleIconPosition??`right`,onChange:e=>a({sidebarToggleIconPosition:e.target.value}),children:[/* @__PURE__ */ j(i,{value:`left`,children:`左侧`}),/* @__PURE__ */ j(i,{value:`right`,children:`右侧`})]})]})}),t([`侧边栏`,`分组标题`,`滚动固定`,`侧边栏分组`])&&/* @__PURE__ */ j(O,{path:`sidebarStickyScroll`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`侧边栏分组标题滚动固定`,/* @__PURE__ */ j(b,{content:`侧边栏菜单滚动时,分组标题吸附固定在顶部,便于识别当前菜单所属分组`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.sidebarStickyScroll??!0,onChange:e=>a({sidebarStickyScroll:e})})]})}),t([`侧边栏`,`手风琴`,`排他展开`,`侧栏排他`])&&/* @__PURE__ */ j(O,{path:`sidebarAccordion`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`侧栏排他展开`,/* @__PURE__ */ j(b,{content:`开启后侧边栏同级菜单同时只允许展开一项,点击其他分组时自动收起之前展开的分组`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.sidebarAccordion??!1,onChange:e=>a({sidebarAccordion:e})})]})}),t([`悬浮展开`,`侧边栏悬浮`,`侧边栏`,`hover`])&&/* @__PURE__ */ j(O,{path:`sidebarHoverTrigger`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`悬浮展开侧边栏`,/* @__PURE__ */ j(b,{content:`开启后侧边栏收起时,鼠标悬浮即可临时展开,移开后自动收起`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.sidebarHoverTrigger??!1,onChange:e=>a({sidebarHoverTrigger:e})})]})}),t([`菜单滚动`,`自动定位`,`菜单`,`滚动定位`])&&/* @__PURE__ */ j(O,{path:`scrollMenuIntoView`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`菜单自动滚动定位`,/* @__PURE__ */ j(b,{content:`开启后切换菜单时,侧边栏自动平滑滚动使激活项居中可见`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.scrollMenuIntoView??!0,onChange:e=>a({scrollMenuIntoView:e})})]})})]})}function Ne({prefSection:e,matchesPref:t,preferences:n,setPreferences:a,homePathOptions:s,autoLockMinutes:l,setAutoLockMinutes:u,hasPassword:d,clearLockPassword:f,openLockPasswordModal:p}){return/* @__PURE__ */ M(D,{title:e(`通用`),children:[t([`默认首页`,`首页`,`登录跳转`,`落地页`,`默认页面`,`登录页面`])&&/* @__PURE__ */ j(O,{path:`homePath`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:12},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4,flexShrink:0},children:[`登录默认页面`,/* @__PURE__ */ j(b,{content:`登录成功后进入的页面;不影响日常点击「首页」菜单的行为`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(o,{filter:!0,style:{width:170},value:n.homePath??`/`,onChange:e=>{let t=ve.safeParse({homePath:e||`/`});t.success&&a(t.data)},optionList:s})]})}),t([`时间显示`,`相对时间`,`绝对时间`,`分钟前`,`时间格式`,`时间戳`])&&/* @__PURE__ */ j(O,{path:`timeDisplay`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`时间显示方式`,/* @__PURE__ */ j(b,{content:`列表、消息与时间线里的时间:绝对时间显示完整日期时刻;相对时间显示「3 分钟前」,悬停查看精确时刻。详情页字段始终为绝对时间`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ M(r,{type:`button`,value:n.timeDisplay??`absolute`,onChange:e=>a({timeDisplay:e.target.value}),children:[/* @__PURE__ */ j(i,{value:`absolute`,children:`绝对`}),/* @__PURE__ */ j(i,{value:`relative`,children:`相对`})]})]})}),t([`一周起始日`,`周一`,`周日`,`星期`,`日历`,`日期选择器`,`起始日`])&&/* @__PURE__ */ j(O,{path:`weekStart`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`一周起始日`,/* @__PURE__ */ j(b,{content:`日期选择器与日历面板每周从哪一天开始排列`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ M(r,{type:`button`,value:n.weekStart??`monday`,onChange:e=>a({weekStart:e.target.value}),children:[/* @__PURE__ */ j(i,{value:`monday`,children:`周一`}),/* @__PURE__ */ j(i,{value:`sunday`,children:`周日`})]})]})}),t([`自动刷新`,`聚焦`,`切回`,`窗口`,`页签`,`重新获取`,`过期数据`,`refetch`])&&/* @__PURE__ */ j(O,{path:`refetchOnFocus`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`切回窗口时自动刷新数据`,/* @__PURE__ */ j(b,{content:`从其他窗口或页签切回时,自动重新获取已过期的列表与详情数据;网络较差时可关闭`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.refetchOnFocus??!1,onChange:e=>a({refetchOnFocus:e})})]})}),t([`进度条`,`加载进度`,`页面加载`,`顶部进度`,`NProgress`])&&/* @__PURE__ */ j(O,{path:`showProgressBar`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`页面加载进度条`,/* @__PURE__ */ j(b,{content:`页面切换时在内容区顶部显示加载进度条`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.showProgressBar??!0,onChange:e=>a({showProgressBar:e})})]})}),t([`快捷键`,`键盘`,`热键`,`Alt`,`Ctrl`,`组合键`])&&/* @__PURE__ */ j(O,{path:`enableShortcuts`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`启用全局快捷键`,/* @__PURE__ */ j(b,{content:`Alt+L 锁屏、Alt+S 收起/展开侧边栏、Alt+C 内容全屏、Ctrl+K 搜索菜单;关闭后这些组合键不再生效`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.enableShortcuts??!0,onChange:e=>a({enableShortcuts:e})})]})}),t([`地址栏`,`URL`,`深链`,`页面状态`,`查询参数`,`分享`,`书签`,`标签参数`,`tab参数`,`选中项`])&&/* @__PURE__ */ j(O,{path:`syncPageStateToUrl`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`页面状态同步到地址栏`,/* @__PURE__ */ j(b,{content:`页面内的 Tab 与分栏选中项以查询参数写入地址栏(如 ?tab=),刷新、收藏或分享链接可直达当前视图;关闭时地址栏保持干净,外部带参链接进入仍会生效一次`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.syncPageStateToUrl??!1,onChange:e=>a({syncPageStateToUrl:e})})]})}),t([`退出确认`,`退出登录`,`二次确认`,`注销`,`登出`])&&/* @__PURE__ */ j(O,{path:`confirmLogout`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`退出登录二次确认`,/* @__PURE__ */ j(b,{content:`关闭后点击「退出登录」将直接退出,不再弹出确认框`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.confirmLogout??!0,onChange:e=>a({confirmLogout:e})})]})}),t([`弹窗`,`模态框`,`遮罩`,`蒙层`,`点击关闭`,`maskClosable`,`误触`])&&/* @__PURE__ */ j(O,{path:`modalClickMaskToClose`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`弹窗点击遮罩关闭`,/* @__PURE__ */ j(b,{content:`开启后,点击弹窗外的遮罩区域可直接关闭弹窗(按 Esc 关闭不受影响);关闭时需点击右上角或底部按钮,可防止误触丢失表单内容`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.modalClickMaskToClose??!1,onChange:e=>a({modalClickMaskToClose:e})})]})}),t([`文件视图`,`文件列表`,`文件管理`,`列表`,`网格`,`文件`])&&/* @__PURE__ */ j(O,{path:`filesViewMode`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`文件列表默认视图`}),/* @__PURE__ */ M(r,{type:`button`,value:n.filesViewMode??`list`,onChange:e=>a({filesViewMode:e.target.value}),children:[/* @__PURE__ */ j(i,{value:`list`,children:`列表`}),/* @__PURE__ */ j(i,{value:`grid`,children:`网格`})]})]})}),t([`锁屏`,`屏幕锁`,`密码`,`锁定`])&&/* @__PURE__ */ j(A,{children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`开启屏幕锁`,/* @__PURE__ */ j(b,{content:`开启后可通过 Alt+L 快捷键或用户菜单锁定屏幕,解锁需输入密码`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:d(),onChange:e=>{e?p(`set`):f()}})]})}),t([`锁屏`,`密码`,`锁屏密码`])&&/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`锁屏密码`}),/* @__PURE__ */ j(x,{size:`small`,theme:`light`,onClick:()=>{p(d()?`change`:`set`)},children:d()?`修改密码`:`设置密码`})]}),d()&&t([`自动锁屏`,`锁屏`,`无操作`,`空闲`,`闲置`])&&/* @__PURE__ */ j(A,{children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`无操作自动锁屏`,/* @__PURE__ */ j(b,{content:`超过设定时长没有任何鼠标/键盘操作时自动锁定屏幕`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(o,{style:{width:110},value:l,onChange:e=>{(e===0||e===5||e===10||e===30)&&u(e)},optionList:[{value:0,label:`关闭`},{value:5,label:`5 分钟`},{value:10,label:`10 分钟`},{value:30,label:`30 分钟`}]})]})})]})}function Pe({prefSection:e,matchesPref:t,preferences:n,setPreferences:a}){return/* @__PURE__ */ M(D,{title:e(`表格`),children:[t([`表格`,`边框`,`斦马纹`,`尺寸`,`分页`,`列设置`,`显示表格`,`启用斦马纹`])&&/* @__PURE__ */ M(A,{children:[/* @__PURE__ */ j(O,{path:`tableBordered`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`显示表格边框`}),/* @__PURE__ */ j(c,{checked:n.tableBordered??!0,onChange:e=>a({tableBordered:e})})]})}),/* @__PURE__ */ j(O,{path:`tableStriped`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`启用斑马纹`}),/* @__PURE__ */ j(c,{checked:n.tableStriped??!1,onChange:e=>a({tableStriped:e})})]})}),/* @__PURE__ */ j(O,{path:`tableSize`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`表格尺寸`}),/* @__PURE__ */ M(r,{type:`button`,value:n.tableSize??`default`,onChange:e=>a({tableSize:e.target.value}),children:[/* @__PURE__ */ j(i,{value:`small`,children:`紧凑`}),/* @__PURE__ */ j(i,{value:`middle`,children:`适中`}),/* @__PURE__ */ j(i,{value:`default`,children:`宽松`})]})]})}),/* @__PURE__ */ j(O,{path:`tablePageSize`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`默认分页大小`}),/* @__PURE__ */ j(o,{value:n.tablePageSize??10,onChange:e=>a({tablePageSize:e}),style:{width:100},optionList:[10,20,50,100].map(e=>({value:e,label:`${e} 条`}))})]})}),/* @__PURE__ */ j(O,{path:`showTableColumnSettings`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`显示表格列设置按钮`}),/* @__PURE__ */ j(c,{checked:n.showTableColumnSettings??!0,onChange:e=>a({showTableColumnSettings:e})})]})})]}),t([`筛选`,`筛选条件`,`记住`,`搜索条件`,`恢复`,`查询条件`,`表格`])&&/* @__PURE__ */ j(O,{path:`rememberListFilters`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`记住列表筛选条件`,/* @__PURE__ */ j(b,{content:`离开列表页再回来时恢复上次查询的筛选条件(分页回到第 1 页);关闭浏览器即清除`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.rememberListFilters??!1,onChange:e=>{e||ye(),a({rememberListFilters:e})}})]})})]})}function Fe({prefSection:e,matchesPref:t,preferences:n,setPreferences:a,prefsSearch:l}){return/* @__PURE__ */ M(D,{title:e(`标签页`),children:[t([`多标签页`,`标签页`,`标签`,`启用标签`])&&/* @__PURE__ */ j(O,{path:`enableTabs`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`启用多标签页`}),/* @__PURE__ */ j(c,{checked:n.enableTabs,onChange:e=>a({enableTabs:e})})]})}),(n.enableTabs||!!l.trim())&&t([`保存标签`,`恢复标签`,`标签页`,`标签`])&&/* @__PURE__ */ j(O,{path:`keepTabs`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`保存标签页`,/* @__PURE__ */ j(b,{content:`刷新页面或重新登录后,自动恢复上次打开的标签页`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.keepTabs??!0,onChange:e=>a({keepTabs:e})})]})}),(n.enableTabs||!!l.trim())&&t([`页面缓存`,`keepalive`,`keep-alive`,`缓存`,`标签页`,`标签`])&&/* @__PURE__ */ j(O,{path:`enablePageCache`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`页面缓存`,/* @__PURE__ */ j(b,{content:`菜单管理中开启「页面缓存」的页面,切换标签页时保留状态(搜索条件、滚动位置等),关闭标签页时释放`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.enablePageCache??!0,onChange:e=>a({enablePageCache:e})})]})}),(n.enableTabs||!!l.trim())&&t([`标签图标`,`图标`,`标签页`,`标签`])&&/* @__PURE__ */ j(O,{path:`showTabIcon`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`标签页显示图标`}),/* @__PURE__ */ j(c,{checked:n.showTabIcon,onChange:e=>a({showTabIcon:e})})]})}),(n.enableTabs||!!l.trim())&&t([`紧凑标签`,`紧凑模式`,`页签密度`,`标签页`,`标签`])&&/* @__PURE__ */ j(O,{path:`compactTabs`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`紧凑标签页`,/* @__PURE__ */ j(b,{content:`减少标签栏的高度与页签间距,适合同时打开较多页面`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.compactTabs??!0,onChange:e=>a({compactTabs:e})})]})}),(n.enableTabs||!!l.trim())&&t([`标签切换器`,`切换器`,`chevron`,`标签页`,`标签`])&&/* @__PURE__ */ j(O,{path:`showTabSwitcher`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`显示标签切换器`}),/* @__PURE__ */ j(c,{checked:n.showTabSwitcher??!0,onChange:e=>a({showTabSwitcher:e})})]})}),(n.enableTabs||!!l.trim())&&t([`自动隐藏`,`隐藏标签`,`程序坞`,`dock`,`标签页`,`标签`])&&/* @__PURE__ */ j(O,{path:`autoHideTabs`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`自动隐藏标签栏`,/* @__PURE__ */ j(b,{content:`平时收起为一条细线,鼠标悬停或键盘聚焦时展开;触屏设备上保持常显`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ j(c,{checked:n.autoHideTabs??!1,onChange:e=>a({autoHideTabs:e})})]})}),(n.enableTabs||!!l.trim())&&t([`最大标签`,`标签数量`,`标签页`,`标签`])&&/* @__PURE__ */ j(O,{path:`tabsMaxCount`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`最大标签数`}),/* @__PURE__ */ j(s,{min:5,max:50,value:n.tabsMaxCount,onChange:e=>a({tabsMaxCount:e}),style:{width:100}})]})}),(n.enableTabs||!!l.trim())&&t([`超限策略`,`FIFO`,`LRU`,`关闭策略`,`标签页`,`标签`])&&/* @__PURE__ */ j(O,{path:`tabEvictPolicy`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`超限关闭策略`,/* @__PURE__ */ j(b,{content:`FIFO: 关闭最早打开的标签;LRU: 关闭最久未使用的标签`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ M(r,{type:`button`,value:n.tabEvictPolicy??`fifo`,onChange:e=>a({tabEvictPolicy:e.target.value}),children:[/* @__PURE__ */ j(i,{value:`fifo`,children:`FIFO`}),/* @__PURE__ */ j(i,{value:`lru`,children:`LRU`})]})]})}),(n.enableTabs||!!l.trim())&&t([`插入位置`,`新标签位置`,`标签插入`,`标签页`,`标签`])&&/* @__PURE__ */ j(O,{path:`openTabBehavior`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ M(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`新标签插入位置`,/* @__PURE__ */ j(b,{content:`末尾:新标签始终排在最右侧;当前后方:新标签紧跟在当前标签之后插入`,position:`right`,children:/* @__PURE__ */ j(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ M(r,{type:`button`,value:n.openTabBehavior??`append`,onChange:e=>a({openTabBehavior:e.target.value}),children:[/* @__PURE__ */ j(i,{value:`append`,children:`末尾`}),/* @__PURE__ */ j(i,{value:`insert-next`,children:`当前后方`})]})]})}),(n.enableTabs||!!l.trim())&&t([`双击标签`,`双击`,`标签行为`,`标签页`,`标签`])&&/* @__PURE__ */ j(O,{path:`tabDoubleClickAction`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`双击标签行为`}),/* @__PURE__ */ M(r,{type:`button`,value:n.tabDoubleClickAction??`refresh`,onChange:e=>a({tabDoubleClickAction:e.target.value}),children:[/* @__PURE__ */ j(i,{value:`refresh`,children:`刷新`}),/* @__PURE__ */ j(i,{value:`close`,children:`关闭`}),/* @__PURE__ */ j(i,{value:`none`,children:`无`})]})]})}),(n.enableTabs||!!l.trim())&&t([`标签风格`,`风格`,`线条`,`胶囊`,`卡片`,`chrome`,`谷歌`,`极简`,`minimal`,`分段`,`segment`,`方块`,`block`,`短线`,`shortline`,`圆点`,`dot`,`顶线`,`topline`,`标签页`,`标签`])&&/* @__PURE__ */ j(O,{path:`tabStyle`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`标签页风格`}),/* @__PURE__ */ j(o,{value:n.tabStyle??`line`,optionList:[{value:`line`,label:`线条`},{value:`pill`,label:`胶囊`},{value:`card`,label:`卡片`},{value:`chrome`,label:`谷歌`},{value:`minimal`,label:`极简`},{value:`segment`,label:`分段`},{value:`block`,label:`方块`},{value:`shortline`,label:`短线`},{value:`dot`,label:`圆点`},{value:`topline`,label:`顶线`}],onChange:e=>a({tabStyle:e}),style:{width:120}})]})}),(n.enableTabs||!!l.trim())&&t([`标签动画`,`动画`,`淡入`,`滑入`,`缩放`,`标签页`,`标签`])&&/* @__PURE__ */ j(O,{path:`tabAnimation`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`标签页动画`}),/* @__PURE__ */ j(r,{type:`button`,value:n.tabAnimation??`none`,onChange:e=>a({tabAnimation:e.target.value}),children:[`none`,`fade`,`slide`,`scale`].map(e=>{let t=/* @__PURE__ */ j(i,{value:e,children:{none:`无`,fade:`淡入`,slide:`滑入`,scale:`缩放`}[e]},e);return e===`none`?t:/* @__PURE__ */ j(S,{trigger:`hover`,position:`bottom`,mouseEnterDelay:100,mouseLeaveDelay:100,content:/* @__PURE__ */ M(`div`,{className:`tab-anim-preview`,"data-anim":e,children:[/* @__PURE__ */ j(`span`,{className:`tab-anim-preview__pill`,children:`首页`}),/* @__PURE__ */ j(`span`,{className:`tab-anim-preview__pill tab-anim-preview__pill--active`,children:`用户管理`}),/* @__PURE__ */ j(`span`,{className:`tab-anim-preview__pill tab-anim-preview__demo`,children:`角色管理`})]}),children:t},e)})})]})}),t([`路由动画`,`切换动画`,`动画`,`淡入`,`上滑`,`左滑`])&&/* @__PURE__ */ j(O,{path:`routeAnimation`,children:/* @__PURE__ */ M(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ j(`span`,{children:`路由切换动画`}),/* @__PURE__ */ j(r,{type:`button`,value:n.routeAnimation??`fade`,onChange:e=>a({routeAnimation:e.target.value}),children:[`none`,`fade`,`slide-up`,`slide-left`].map(e=>{let t=/* @__PURE__ */ j(i,{value:e,children:{none:`无`,fade:`淡入`,"slide-up":`上滑`,"slide-left":`左滑`}[e]},e);return e===`none`?t:/* @__PURE__ */ j(S,{trigger:`hover`,position:`bottom`,mouseEnterDelay:100,mouseLeaveDelay:100,content:/* @__PURE__ */ j(`div`,{className:`route-anim-preview`,"data-anim":e,children:/* @__PURE__ */ M(`div`,{className:`route-anim-preview__page`,children:[/* @__PURE__ */ j(`div`,{className:`route-anim-preview__title`}),/* @__PURE__ */ j(`div`,{className:`route-anim-preview__line`}),/* @__PURE__ */ j(`div`,{className:`route-anim-preview__line route-anim-preview__line--short`})]})}),children:t},e)})})]})})]})}function Ie(){return(Ie=e((()=>{y(),d(),h(),g(),_(),E(),De(),w(),n(),re()})))()}function Le(e){let{canEditPreference:t,hasManagedPreferences:n}=pe(),[r,i]=se(`layout`),a=!!e.prefsSearch.trim(),o=we(``,t,e.quickChatEnabled,e.hasPassword(),e.hasPassword()),s=we(e.prefsSearch,t,e.quickChatEnabled,e.hasPassword(),e.hasPassword()),c=o.find(e=>e.key===r)??o[0],l=a?s:c?[c]:[],u={prefSection:ze,matchesPref:t=>!e.prefsSearch.trim()||t.some(t=>P(t,e.prefsSearch.trim())),preferences:e.preferences,setPreferences:e.setPreferences},d={layout:/* @__PURE__ */ j(Oe,{...u,navLayout:e.navLayout}),appearance:/* @__PURE__ */ j(Ae,{...u,mode:e.mode,handleThemeModeChange:e.handleThemeModeChange,isDark:e.isDark,themeColor:e.themeColor,setThemeColor:e.setThemeColor}),navigation:/* @__PURE__ */ j(je,{...u,prefsSearch:e.prefsSearch,quickChatEnabled:e.quickChatEnabled}),sidebar:/* @__PURE__ */ j(Me,{...u,navLayout:e.navLayout}),general:/* @__PURE__ */ j(Ne,{...u,homePathOptions:e.homePathOptions,autoLockMinutes:e.autoLockMinutes,setAutoLockMinutes:e.setAutoLockMinutes,hasPassword:e.hasPassword,clearLockPassword:e.clearLockPassword,openLockPasswordModal:e.openLockPasswordModal}),table:/* @__PURE__ */ j(Pe,{...u}),tabs:/* @__PURE__ */ j(Fe,{...u,prefsSearch:e.prefsSearch})};return/* @__PURE__ */ j(ie.Provider,{value:t=>Ce(ge[t],e.prefsSearch),children:/* @__PURE__ */ M(`div`,{className:`arc-preferences__browser${a?` arc-preferences__browser--search`:``}`,children:[!a&&o.length>0&&/* @__PURE__ */ j(T,{as:`nav`,className:`arc-preferences__categories`,"aria-label":`偏好分类`,children:o.map(e=>{let t=Re[e.key];return/* @__PURE__ */ M(`button`,{type:`button`,"aria-pressed":e.key===c?.key,onClick:()=>i(e.key),children:[/* @__PURE__ */ j(t,{size:16}),/* @__PURE__ */ j(`span`,{children:e.label})]},e.key)})}),/* @__PURE__ */ M(T,{className:`arc-preferences__content`,"aria-label":`偏好设置内容`,children:[a&&/* @__PURE__ */ M(`div`,{className:`arc-preferences__result-summary`,role:`status`,children:[`找到 `,s.reduce((e,t)=>e+t.fields.length+t.localCount,0),` 项可调整的设置`]}),l.map(e=>/* @__PURE__ */ M(`section`,{className:`arc-preferences__section`,"aria-label":`${e.label}设置`,children:[/* @__PURE__ */ M(`div`,{className:`arc-preferences__section-heading`,children:[/* @__PURE__ */ j(`h3`,{children:e.label}),/* @__PURE__ */ j(`p`,{children:e.description})]}),d[e.key]]},e.key)),l.length===0&&/* @__PURE__ */ j(N,{image:N.PRESENTED_IMAGE_SIMPLE,description:a?`没有找到匹配的设置`:`当前没有可调整的个人设置`,children:a&&/* @__PURE__ */ j(me,{onClick:e.onClearSearch,children:`清空搜索`})}),n&&/* @__PURE__ */ j(`p`,{className:`arc-preferences__policy-note`,children:`部分设置由系统统一管理,此处仅展示可调整的项目。`})]},a?`search`:c?.key)]})})}var Re,ze;function $(){return($=e((()=>{L(),B(),U(),f(),be(),J(),Se(),w(),E(),Z(),Ie(),Re={layout:z,appearance:q,navigation:G,sidebar:m,tabs:I,table:H,general:xe},ze=()=>null})))()}$();export{Le as default};
@@ -0,0 +1,15 @@
1
+ import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{n as t,t as n}from"./controls-C5dPckUT.js";import{t as r}from"./typography-DKK_iHcj.js";import{i,n as a}from"./feedback-BnjMKZpz.js";import{n as o}from"./tabs-BobA_IcO.js";import{a as s,i as c,n as l,o as u,t as ee}from"./ConfigurableTable-DzmZDd8F.js";import{n as d,t as f}from"./createLucideIcon-BtwfYE6A.js";import{c as te,l as p}from"./toolbar-controls-CThS0xuP.js";import{a as m,c as ne,i as re,l as h,n as ie,o as ae,r as g,s as _,t as oe}from"./UserLogsPanels-BHeSxWrk.js";import{n as v,t as se}from"./copy-ofLPH1I0.js";import{a as y,i as b,o as ce,r as x,s as S,t as C}from"./SessionClientTag-DIwnYodW.js";import{n as le,t as ue}from"./list-DCcWnjUg.js";import{i as w,n as T,r as de,t as fe}from"./user-round-kYfBkPNu.js";import{o as E,t as D}from"./form-CQutQFiD.js";import{n as O}from"./list-0CbyOlT9.js";import{C as k,_ as A,a as j,c as pe,g as M,l as me,r as N,y as P}from"./ui-BFsHoY7a.js";import{i as F,t as he}from"./confirm-BtBBEqk8.js";import{r as ge,t as _e}from"./deleteAction-CCocr5uV.js";import{n as ve,t as I}from"./useCrudOperationColumn-D935tixd.js";import{n as ye}from"./listTableProps-DDynsnLF.js";import{n as be,t as L}from"./DateTimeText-CIt0Qy45.js";import{a as xe,o as Se,r as Ce,t as we}from"./EditFormModal-DNHOZHxM.js";import{r as Te,t as Ee}from"./clipboard-ERcMSMRH.js";import{n as R,t as De}from"./UserAvatar-B8CFnTCn.js";import{n as Oe,t as z}from"./PasswordInput-DGEJO9yx.js";import{n as ke,t as Ae}from"./DictTag-2-adKbYg.js";import{useState as B}from"react";import{Fragment as je,jsx as V,jsxs as H}from"react/jsx-runtime";import{abortSubmit as Me}from"@fudanda/react-core/lib/abort-submit";import{useDictItems as Ne}from"@fudanda/react-core/hooks/useDictItems";import{formatDateForApi as Pe,formatDateTime as Fe}from"@fudanda/react-core/utils/date";import{TOKEN_PERMISSION_KIND_LABELS as U,tokenPermissionGroups as W,tokenPermissionPreset as G,tokenPermissionPreview as Ie,useApiKeyPermissions as Le,useApiTokenDetail as Re,useApiTokenSecret as ze,useChangeProfilePassword as Be,useDeleteApiToken as Ve,useKickOtherProfileSessions as He,useKickProfileSession as Ue,useProfileApiTokens as We,useProfileSessions as Ge,useSaveApiToken as Ke,useUpdateProfile as qe}from"@fudanda/react-core/hooks/queries/profile";import{uploadAvatarBlobToFileCenter as Je}from"@fudanda/react-core/utils/avatar-upload";import{formatSessionPolicyHint as Ye}from"@fudanda/shared/settings";import{useMySettings as Xe}from"@fudanda/react-core/hooks/queries/settings";import{useUrlTabState as Ze}from"@fudanda/react-core/hooks/useUrlTabState";var K,Qe;function q(){return(q=e((()=>{
2
+ /**
3
+ * @license lucide-react v1.53.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ d(),K={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`}]]},K.node,Qe=f(K)})))()}var J,Y;function $e(){return($e=e((()=>{
9
+ /**
10
+ * @license lucide-react v1.53.0 - ISC
11
+ *
12
+ * This source code is licensed under the ISC license.
13
+ * See the LICENSE file in the root directory of this source tree.
14
+ */
15
+ d(),J={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`}]]},J.node,Y=f(J)})))()}function et({permissions:e}){let t=Ie(e);return/* @__PURE__ */ H(`div`,{className:`token-permission-preview`,children:[/* @__PURE__ */ H(`p`,{role:`status`,children:[`已选 `,new Set(e).size,` 项权限 · 内置 MCP 工具 `,t.tools.length,` 项 · 已知 API 接口 `,t.operations.length,` 项`]}),/* @__PURE__ */ V(`p`,{children:`实际访问仍受账号当前权限、数据范围和宿主已开放接口限制。这些权限也可用于普通 API,MCP 查询预设不限制 Token 的接入方式。`}),t.tools.length>0&&/* @__PURE__ */ V(`div`,{className:`token-permission-tools`,children:t.tools.map(e=>/* @__PURE__ */ H(P,{children:[e.label,` `,/* @__PURE__ */ V(`code`,{children:e.name})]},e.name))}),t.operations.length>0&&/* @__PURE__ */ H(`details`,{children:[/* @__PURE__ */ V(`summary`,{children:`查看已知 API 接口`}),/* @__PURE__ */ V(`ul`,{children:t.operations.map(e=>/* @__PURE__ */ V(`li`,{children:/* @__PURE__ */ H(`code`,{children:[e.method,` `,e.path]})},e.id))})]}),t.extensions.length>0&&/* @__PURE__ */ H(`p`,{children:[`扩展权限的具体能力请核对宿主说明:`,t.extensions.join(`、`),`。`]})]})}function tt({permissions:e}){return/* @__PURE__ */ H(je,{children:[W(e).map(e=>/* @__PURE__ */ H(`section`,{className:`token-permission-group`,children:[/* @__PURE__ */ V(`h4`,{children:e.label}),e.items.map(e=>/* @__PURE__ */ H(`div`,{className:`token-permission-row`,children:[/* @__PURE__ */ H(`span`,{className:`token-permission-label`,children:[e.label,/* @__PURE__ */ V(`code`,{children:e.code})]}),/* @__PURE__ */ V(P,{className:`token-permission-kind`,children:U[e.kind]})]},e.code))]},e.label)),/* @__PURE__ */ V(et,{permissions:e})]})}function nt({permissions:e,onDetails:t}){let n=W(e);return/* @__PURE__ */ H(`div`,{className:`token-permission-summary`,children:[/* @__PURE__ */ V(`span`,{children:e.length?`${new Set(e).size} 项 · ${n.slice(0,3).map(e=>e.label).join(`、`)}${n.length>3?`等`:``}`:`未授予权限`}),/* @__PURE__ */ V(j,{theme:`borderless`,size:`small`,onClick:t,children:`查看范围`})]})}function rt({value:e=[],onChange:r,permissions:i,disabled:a}){let[o,s]=B(``),c=W(i,o),l=new Set(e),u=e=>r?.(G(i,e)),ee=(t,n)=>r?.(n?[.../* @__PURE__ */ new Set([...e,t])]:e.filter(e=>e!==t));return/* @__PURE__ */ H(`div`,{className:`token-permission-picker`,children:[/* @__PURE__ */ H(M,{wrap:!0,children:[/* @__PURE__ */ V(j,{size:`small`,disabled:a||!G(i,`mcp`).length,onClick:()=>u(`mcp`),children:`MCP 查询`}),/* @__PURE__ */ V(j,{size:`small`,disabled:a||!G(i,`read`).length,onClick:()=>u(`read`),children:`API 只读`}),/* @__PURE__ */ V(j,{size:`small`,disabled:a||!e.length,onClick:()=>r?.([]),children:`清空选择`})]}),/* @__PURE__ */ V(`p`,{className:`token-permission-hint`,children:`快捷选择会替换当前勾选;也可逐项自定义。只读按已知接口判断,未知扩展权限需手动选择。`}),/* @__PURE__ */ V(t,{"aria-label":`搜索权限`,placeholder:`搜索模块、中文名称或权限代码`,value:o,onChange:s,showClear:!0,disabled:a}),/* @__PURE__ */ H(`div`,{className:`token-permission-options`,"aria-label":`可授予权限`,children:[c.map(e=>/* @__PURE__ */ H(`fieldset`,{className:`token-permission-group`,children:[/* @__PURE__ */ V(`legend`,{children:e.label}),e.items.map(e=>/* @__PURE__ */ H(`div`,{className:`token-permission-row`,children:[/* @__PURE__ */ V(n,{disabled:a,checked:l.has(e.code),onChange:t=>ee(e.code,!!t.target.checked),children:/* @__PURE__ */ H(`span`,{className:`token-permission-label`,children:[e.label,/* @__PURE__ */ V(`code`,{children:e.code})]})}),/* @__PURE__ */ V(P,{className:`token-permission-kind`,children:U[e.kind]})]},e.code))]},e.label)),!c.length&&/* @__PURE__ */ V(`p`,{children:i.length?`没有匹配的权限,已选项仍然保留。`:`当前没有可授予的权限。`})]}),e.some(e=>!i.includes(e))&&/* @__PURE__ */ V(N,{type:`warning`,description:`部分已选权限当前不可授予,请清空并重新选择。`}),/* @__PURE__ */ V(et,{permissions:e})]})}var it;function at(){return(at=e((()=>{k(),it=E(rt)})))()}function ot({policy:e}){return!e||e.maxSessions<=0?null:/* @__PURE__ */ V(N,{type:`info`,closeIcon:null,fullMode:!1,style:{marginBottom:12},description:`当前策略:${Ye(e)}`})}function st({sessions:e,loading:t,onKick:n}){return/* @__PURE__ */ V(O,{className:`session-list`,dataSource:e,emptyContent:/* @__PURE__ */ V(`div`,{className:`session-list-empty`,children:`暂无在线设备信息`}),loading:t,renderItem:e=>/* @__PURE__ */ V(O.Item,{align:`center`,className:`session-list-item`,main:/* @__PURE__ */ H(`div`,{className:`session-list-main`,children:[/* @__PURE__ */ V(C,{client:e.client,size:16,className:`session-list-client`}),/* @__PURE__ */ V(X,{strong:!0,children:e.browser}),/* @__PURE__ */ V(X,{type:`tertiary`,size:`small`,children:y(e.client)}),e.isCurrent&&/* @__PURE__ */ V(P,{color:`blue`,size:`small`,children:`当前设备`}),/* @__PURE__ */ H(X,{type:`tertiary`,size:`small`,className:`session-list-meta`,children:[e.os,` · `,`IP: ${e.ip}`,` · `,`登录 `,/* @__PURE__ */ V(L,{value:e.loginAt}),` · `,`活跃 `,/* @__PURE__ */ V(L,{value:e.lastActiveAt})]})]}),extra:!e.isCurrent&&/* @__PURE__ */ V(j,{theme:`borderless`,type:`danger`,size:`small`,onClick:()=>{he({title:`确定要退出该设备吗?`,onOk:()=>n(e.tokenId)})},children:`退出`})},e.tokenId)})}function ct({user:e}){let[t,n]=Ze([`profile`,`security`,`devices`,`login`,`operation`,`api-tokens`],`profile`),{options:r}=Ne(`user_gender`),[l,u]=B(!1),[d,f]=B(``);B(``);let[p,m]=B(null),h=ze(e.id,t===`api-tokens`),g=h.value,[_,v]=B(!1),y=Xe(),b=Ge(t===`devices`),x=We(t===`api-tokens`),S=Le(t===`api-tokens`),C=y.data?.identitySecurity.password??null,le=b.data??[],w=qe(),T=qe(),E=Be(),O=He(),k=Ue(),F=Ke(e.id,t===`api-tokens`),ge=Ve(),I=Se({save:{mutateAsync:({id:e,values:t})=>F.mutateAsync({id:e,values:t}),isPending:F.isPending},useDetail:Re,toValues:e=>({name:e.name,expiresAt:`expiresAt`in e?e.expiresAt:void 0,permissions:`permissions`in e?e.permissions:[]}),beforeSave:e=>{let t=e.name.trim();return t||(i.error(`请填写 Token 名称`),Me(`validation`)),e.permissions?.length||(i.error(`请选择 API Key 权限`),Me(`validation`)),{name:t,...e.expiresAt?{expiresAt:new Date(e.expiresAt).toISOString()}:{},permissions:e.permissions}},defaults:{name:``,permissions:[]},successMessage:({isEdit:e})=>e?`Token 已更新`:null,onSaved:e=>{e&&`token`in e&&(v(!1),h.showCreated(e))}}),be=w.isPending,L=E.isPending,xe=b.isFetching,Ce=O.isPending,Te=x.isFetching,R=T.isPending;async function Oe(e){await w.mutateAsync({body:{nickname:e.nickname,email:e.email||void 0,phone:e.phone||void 0,gender:e.gender||void 0,birthDate:e.birthDate?Pe(e.birthDate):void 0,clearFields:[...e.email?[]:[`email`],...e.phone?[]:[`phone`],...e.gender?[]:[`gender`],...e.birthDate?[]:[`birthDate`]]}}),i.success(`资料已更新`)}async function ke(e){e.newPassword===e.confirmPassword?(await E.mutateAsync({body:{oldPassword:e.oldPassword,newPassword:e.newPassword}}),i.success(`密码修改成功,请重新登录`),f(``)):i.error(`两次密码输入不一致`)}async function U(){await O.mutateAsync({}),i.success(`操作成功`)}async function W(e){await k.mutateAsync({params:{tokenId:e}}),i.success(`已退出该设备`)}async function G(e){await ge.mutateAsync({params:{id:e}}),i.success(`Token 已撤销`)}function Ie(e){Ee(e).then(e=>{e?(v(!0),setTimeout(()=>v(!1),2e3)):i.error(`复制失败,请手动复制`)})}async function Ye(){_e({title:`确定要移除头像吗?`,content:`移除后将使用昵称缩写作为默认头像。`,run:()=>T.mutateAsync({body:{clearFields:[`avatar`]}}),successMessage:`头像已移除`})}function K(){u(!0)}async function q(e){u(!1),await T.mutateAsync({body:{avatar:e}}),i.success(`头像已更新`)}let J=ve({edit:e=>I.openEdit(e),remove:e=>G(e.id),title:`确定要撤销该 Token 吗?`,content:`撤销后将无法恢复,使用该 Token 的调用将立即失效。`,successMessage:null,removeLabel:`撤销`,width:200,extra:e=>[{key:`view`,label:`查看 Key`,disabled:!e.canReveal,onClick:()=>{v(!1),h.reveal(e.id)}}]});return/* @__PURE__ */ H(`div`,{className:`page-container page-tabs-page`,children:[/* @__PURE__ */ V(`div`,{className:`profile-content-card`,children:/* @__PURE__ */ H(o,{collapsible:`auto`,activeKey:t,onChange:e=>n(e),className:`profile-tabs`,children:[/* @__PURE__ */ V(o.TabPane,{itemKey:`profile`,tab:/* @__PURE__ */ H(`span`,{className:`profile-tab-label`,children:[/* @__PURE__ */ V(fe,{size:14}),/* @__PURE__ */ V(`span`,{children:`基本信息`})]}),children:/* @__PURE__ */ H(`div`,{className:`profile-section`,children:[/* @__PURE__ */ V(`div`,{className:`section-title`,children:`基本信息`}),e.accountSource===`casdoor`&&/* @__PURE__ */ V(N,{type:`info`,description:`统一账户资料由 Casdoor 管理;请联系管理员修改。`,closeIcon:null}),/* @__PURE__ */ H(`div`,{className:`profile-basic-overview`,children:[/* @__PURE__ */ H(`div`,{className:`avatar-column`,children:[/* @__PURE__ */ V(`button`,{type:`button`,className:`avatar-upload-trigger`,disabled:e.accountSource===`casdoor`,onClick:K,"aria-label":`更换头像`,children:R?/* @__PURE__ */ V(`div`,{className:`avatar-loading-wrapper`,style:{width:80,height:80},children:/* @__PURE__ */ V(A,{})}):/* @__PURE__ */ H(je,{children:[/* @__PURE__ */ V(De,{name:e.nickname||`用户`,avatar:e.avatar,size:80,style:{fontSize:28}}),/* @__PURE__ */ V(`div`,{className:`avatar-upload-mask`,children:`更换头像`})]})}),/* @__PURE__ */ V(j,{size:`small`,theme:`light`,loading:R,disabled:e.accountSource===`casdoor`,onClick:K,style:{width:`100%`},children:`更换头像`})]}),/* @__PURE__ */ H(`div`,{className:`profile-basic-summary`,children:[/* @__PURE__ */ H(`div`,{className:`profile-basic-heading`,children:[/* @__PURE__ */ V(lt,{heading:5,style:{margin:0},children:e.nickname}),/* @__PURE__ */ H(X,{type:`tertiary`,size:`small`,children:[`@`,e.username]})]}),/* @__PURE__ */ V(pe,{align:`plain`,layout:`horizontal`,column:2,style:{width:`100%`},data:[{key:`手机号`,value:e.phone,hidden:!e.phone},{key:`邮箱`,value:e.email},{key:`性别`,value:/* @__PURE__ */ V(Ae,{dictCode:`user_gender`,value:e.gender}),hidden:!e.gender},{key:`出生日期`,value:e.birthDate,hidden:!e.birthDate},{key:`部门`,value:e.departmentName,hidden:!e.departmentName},{key:`岗位`,value:e.positions?.length?/* @__PURE__ */ V(M,{spacing:4,style:{display:`inline-flex`,flexWrap:`wrap`},children:e.positions.map(e=>/* @__PURE__ */ V(P,{size:`small`,style:Z,children:e.name},e.id))}):void 0,hidden:!e.positions?.length},{key:`角色`,value:e.roles?.length?/* @__PURE__ */ V(M,{spacing:4,style:{display:`inline-flex`,flexWrap:`wrap`},children:e.roles.map(e=>/* @__PURE__ */ V(P,{size:`small`,style:Z,children:e.name},e.id))}):`无角色`},{key:`注册时间`,value:Fe(e.createdAt)}]})]})]}),/* @__PURE__ */ V(me,{margin:28}),/* @__PURE__ */ V(`div`,{className:`section-title`,children:`资料编辑`}),/* @__PURE__ */ H(D,{initValues:{nickname:e.nickname,email:e.email??``,phone:e.phone??``,gender:e.gender??void 0,birthDate:e.birthDate??void 0},disabled:e.accountSource===`casdoor`,onSubmit:Oe,allowEmpty:!0,labelPosition:`left`,labelWidth:80,children:[/* @__PURE__ */ V(D.Input,{field:`nickname`,label:`昵称`,placeholder:`请输入昵称`,rules:[{required:!0,message:`昵称不能为空`}],style:{width:320}}),/* @__PURE__ */ V(D.Input,{field:`phone`,label:`手机号`,placeholder:`请输入手机号(选填)`,rules:[{pattern:/^1[3-9]\d{9}$/,message:`请输入正确的手机号码`}],style:{width:320}}),/* @__PURE__ */ V(D.Input,{field:`email`,label:`邮箱`,placeholder:`请输入邮箱(选填)`,rules:[{type:`email`,message:`邮箱格式不正确`}],style:{width:320}}),/* @__PURE__ */ V(D.Select,{field:`gender`,label:`性别`,style:{width:320},showClear:!0,optionList:r,placeholder:`请选择性别(选填)`}),/* @__PURE__ */ V(D.DatePicker,{field:`birthDate`,label:`出生日期`,type:`date`,style:{width:320},placeholder:`请选择出生日期(选填)`,showClear:!0}),/* @__PURE__ */ V(D.Slot,{children:/* @__PURE__ */ V(j,{htmlType:`submit`,type:`primary`,loading:be,children:`保存修改`})})]})]})}),!1,/* @__PURE__ */ V(o.TabPane,{itemKey:`security`,tab:/* @__PURE__ */ H(`span`,{className:`profile-tab-label`,children:[/* @__PURE__ */ V(Y,{size:14}),/* @__PURE__ */ V(`span`,{children:`账号安全`})]}),children:/* @__PURE__ */ H(`div`,{className:`profile-section`,children:[/* @__PURE__ */ V(`div`,{className:`section-title`,children:`修改密码`}),e.accountSource===`casdoor`&&/* @__PURE__ */ V(N,{type:`info`,description:`密码及 MFA 请在 Casdoor 中管理。`,closeIcon:null}),/* @__PURE__ */ H(D,{disabled:e.accountSource===`casdoor`,onSubmit:ke,labelPosition:`left`,labelWidth:100,children:[/* @__PURE__ */ V(z,{field:`oldPassword`,label:`原密码`,placeholder:`请输入原密码`,rules:[{required:!0,message:`请输入原密码`}],style:{width:320}}),/* @__PURE__ */ V(z,{field:`newPassword`,label:`新密码`,placeholder:`请输入新密码`,rules:[{required:!0,message:`请输入新密码`},...C?.minLength?[{min:C.minLength,message:`密码至少${C.minLength}个字符`}]:[]],style:{width:320},onChange:e=>f(String(e??``)),helpText:/* @__PURE__ */ V(re,{password:d,policy:C})}),/* @__PURE__ */ V(z,{field:`confirmPassword`,label:`确认密码`,placeholder:`请再次输入新密码`,rules:[{required:!0,message:`请确认新密码`}],style:{width:320}}),/* @__PURE__ */ V(D.Slot,{children:/* @__PURE__ */ V(j,{htmlType:`submit`,type:`primary`,loading:L,children:`修改密码`})})]}),!1]})}),!1,/* @__PURE__ */ V(o.TabPane,{itemKey:`devices`,tab:/* @__PURE__ */ H(`span`,{className:`profile-tab-label`,children:[/* @__PURE__ */ V(ce,{size:14}),/* @__PURE__ */ V(`span`,{children:`我的设备`})]}),children:/* @__PURE__ */ H(`div`,{className:`profile-section`,children:[/* @__PURE__ */ H(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:20},children:[/* @__PURE__ */ V(`div`,{className:`section-title`,style:{margin:0},children:`在线设备`}),/* @__PURE__ */ V(j,{type:`danger`,theme:`light`,size:`small`,loading:Ce,icon:/* @__PURE__ */ V(de,{size:14}),onClick:()=>{he({title:`确定要退出其他所有设备吗?`,content:`退出后其他设备将需要重新登录。`,onOk:U})},children:`退出其他设备`})]}),/* @__PURE__ */ V(ot,{policy:y.data?.identitySecurity.session}),/* @__PURE__ */ V(st,{sessions:le,loading:xe,onKick:W})]})}),/* @__PURE__ */ V(o.TabPane,{itemKey:`login`,tab:/* @__PURE__ */ H(`span`,{className:`profile-tab-label`,children:[/* @__PURE__ */ V(ue,{size:14}),/* @__PURE__ */ V(`span`,{children:`登录记录`})]}),children:/* @__PURE__ */ V(`div`,{className:`profile-section`,children:/* @__PURE__ */ V(oe,{scope:Q,enabled:t===`login`,columnSettingsKey:`profile-login-logs`})})}),/* @__PURE__ */ V(o.TabPane,{itemKey:`operation`,tab:/* @__PURE__ */ H(`span`,{className:`profile-tab-label`,children:[/* @__PURE__ */ V(ue,{size:14}),/* @__PURE__ */ V(`span`,{children:`操作记录`})]}),children:/* @__PURE__ */ V(`div`,{className:`profile-section`,children:/* @__PURE__ */ V(ie,{scope:Q,enabled:t===`operation`,columnSettingsKey:`profile-operation-logs`})})}),/* @__PURE__ */ V(o.TabPane,{itemKey:`api-tokens`,tab:/* @__PURE__ */ H(`span`,{className:`profile-tab-label`,children:[/* @__PURE__ */ V(Qe,{size:14}),/* @__PURE__ */ V(`span`,{children:`API Token`})]}),children:/* @__PURE__ */ H(`div`,{className:`profile-section`,children:[/* @__PURE__ */ H(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:8},children:[/* @__PURE__ */ V(`div`,{className:`section-title`,style:{margin:0},children:`API Token`}),/* @__PURE__ */ V(j,{type:`primary`,size:`small`,icon:/* @__PURE__ */ V(te,{size:14}),onClick:I.openCreate,children:`新建 Token`})]}),/* @__PURE__ */ H(X,{type:`tertiary`,size:`small`,style:{display:`block`,marginBottom:16},children:[`Token 可通过 `,/* @__PURE__ */ V(`code`,{children:`Authorization: Bearer YOUR_TOKEN`}),` 头访问 API,每人最多 20 个。`]}),Te?/* @__PURE__ */ V(`div`,{style:{textAlign:`center`,padding:40},children:/* @__PURE__ */ V(A,{})}):/* @__PURE__ */ V(ee,{...ye(x),columns:[{title:`名称`,dataIndex:`name`,minWidth:150,render:e=>/* @__PURE__ */ V(X,{strong:!0,children:e})},{title:`权限范围`,dataIndex:`permissions`,width:260,render:(e,t)=>/* @__PURE__ */ V(nt,{permissions:e,onDetails:()=>m(t)})},{title:`Token 前缀`,dataIndex:`tokenPrefix`,width:180,render:(e,t)=>/* @__PURE__ */ H(`div`,{children:[/* @__PURE__ */ V(`code`,{style:{fontSize:12},children:e}),!t.canReveal&&/* @__PURE__ */ V(`div`,{children:/* @__PURE__ */ V(X,{type:`tertiary`,size:`small`,children:`仅存摘要,无法查看原文`})})]})},s(`最后使用`,`lastUsedAt`,{empty:`未使用`}),s(`过期时间`,`expiresAt`,{empty:`永久有效`}),c,J]})]})}),!1]})}),/* @__PURE__ */ V(ae,{visible:l,currentAvatar:e.avatar,confirmLoading:T.isPending,uploadBlob:Je,onCancel:()=>u(!1),onSelect:e=>void q(e),onRemove:e.avatar?Ye:void 0}),!1,/* @__PURE__ */ H(we,{modal:I,title:I.isEdit?`编辑 API Token`:`新建 API Token`,okText:I.isEdit?`保存`:`创建`,cancelText:`取消`,width:740,centered:!0,formProps:{labelPosition:`top`},okButtonProps:{...I.modalProps.okButtonProps,disabled:I.detailLoading||S.isPending||!!S.error},children:[/* @__PURE__ */ V(D.Input,{field:`name`,maxLength:64,label:`名称`,placeholder:`如:本地开发、CI/CD 环境`,rules:[{required:!0,message:`请填写 Token 名称`}],style:{width:`100%`}}),S.error&&/* @__PURE__ */ V(N,{type:`danger`,description:/* @__PURE__ */ H(`span`,{children:[`权限范围加载失败。`,/* @__PURE__ */ V(j,{theme:`borderless`,onClick:()=>void S.refetch(),children:`重试`})]})}),/* @__PURE__ */ V(it,{field:`permissions`,label:`权限范围`,permissions:S.data??[],disabled:S.isPending||!!S.error,rules:[{validator:(e,t)=>Array.isArray(t)&&t.length>0,message:`请选择至少一项权限`}],extraText:`Token 权限不会超过账号当前权限;权限撤销、停用和改密后立即失效。`}),/* @__PURE__ */ V(D.DatePicker,{field:`expiresAt`,label:`过期时间`,type:`dateTime`,placeholder:`不填则永久有效`,style:{width:`100%`},disabledDate:e=>!!e&&e<new Date((/* @__PURE__ */ new Date()).setHours(0,0,0,0))})]}),/* @__PURE__ */ V(a,{title:p?`Token 权限范围 · ${p.name}`:`Token 权限范围`,visible:!!p,onCancel:()=>m(null),footer:/* @__PURE__ */ V(j,{onClick:()=>m(null),children:`关闭`}),width:740,centered:!0,children:p&&/* @__PURE__ */ V(tt,{permissions:p.permissions})}),/* @__PURE__ */ H(a,{title:h.created?`Token 创建成功`:`查看 API Token`,visible:!!g||h.pending,closeOnEsc:!0,onCancel:h.close,footer:/* @__PURE__ */ V(j,{type:`primary`,onClick:h.close,children:`关闭`}),width:520,centered:!0,children:[/* @__PURE__ */ V(X,{type:`warning`,style:{display:`block`,marginBottom:12,padding:`8px 12px`,background:`var(--arc-antd-color-warning-light-default)`,borderRadius:`var(--arc-antd-border-radius-medium)`},children:g?.canReveal?`请妥善保管此 Token,可在列表中再次查看或复制。`:`请立即复制并安全保存此 Token,关闭后将无法再次查看完整内容。`}),h.pending&&/* @__PURE__ */ V(A,{}),g&&/* @__PURE__ */ H(`div`,{className:`token-display`,children:[/* @__PURE__ */ V(`code`,{style:{flex:1,wordBreak:`break-all`,fontSize:12,lineHeight:1.6},children:g.token}),/* @__PURE__ */ V(j,{icon:V(_?ne:se,{size:14}),type:_?`tertiary`:`primary`,onClick:()=>Ie(g.token),style:{flexShrink:0},children:_?`已复制`:`复制`})]})]})]})}var lt,X,Z,Q;function $(){return($=e((()=>{Oe(),at(),k(),T(),$e(),S(),le(),q(),w(),p(),v(),h(),_(),R(),b(),x(),be(),m(),l(),ke(),ge(),I(),F(),Te(),u(),xe(),g(),Ce(),{Title:lt,Text:X}=r,Z={color:`var(--arc-antd-color-primary)`,backgroundColor:`var(--arc-antd-color-primary-light-default)`,borderColor:`transparent`},Q={kind:`self`}})))()}$();export{ct as default};
@@ -0,0 +1,36 @@
1
+ import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{t}from"./controls-C5dPckUT.js";import{t as n}from"./typography-DKK_iHcj.js";import{o as r,r as i,t as a}from"./search-filters-CRIhZ0gL.js";import{n as o,t as s}from"./createLucideIcon-BtwfYE6A.js";import{n as c,t as l}from"./activity-DBu4axwF.js";import{n as u,t as d}from"./circle-check-RKAno__V.js";import{n as f,t as p}from"./eye-off-BtJoIT5n.js";import{n as m,t as h}from"./funnel-BwQjQI4Y.js";import{a as g,i as _,r as v,t as ee}from"./EntityRelationButton-DWn1rC2J.js";import{n as te,t as ne}from"./refresh-cw-Dz8O9-Hp.js";import{n as y,t as b}from"./list-0CbyOlT9.js";import{C as x,S,_ as re,a as C,d as w,g as T,y as ie}from"./ui-BFsHoY7a.js";import{n as ae,t as oe}from"./DateTimeText-CIt0Qy45.js";import{Suspense as se,useCallback as ce,useContext as E,useEffect as D,useMemo as le,useState as O}from"react";import{Fragment as ue,jsx as k,jsxs as A}from"react/jsx-runtime";import{useLocation as de,useNavigate as fe}from"react-router-dom";import{entityRelationsContract as j}from"@fudanda/react-core/lib/native-operations";import{contractKey as M}from"@fudanda/react-core/lib/contract-query";import{useFilterQuery as pe}from"@fudanda/react-core/hooks/useFilterQuery";import{useListSearch as N}from"@fudanda/react-core/hooks/useListSearch";import{formatDateTime as P,formatDateTimeRangeForApi as me}from"@fudanda/react-core/utils/date";import{useQueryClient as he}from"@tanstack/react-query";import{useEntityAccessKey as F,useEntityRelationSection as ge,useEntityRelations as _e}from"@fudanda/react-core/hooks/queries/entity-relations";import{entityDetailRoute as ve,entityRelationKindLabel as I,entityRelationLabel as L,entityStatusLabel as R,entityTypeLabel as ye}from"@fudanda/react-core/utils/entity-relations";import{EntityNavigationContext as be,EntityRelationViewStateContext as xe,beginEntityRelationNavigation as Se,entityRelationSourceUrl as Ce}from"@fudanda/react-core/components/entity-relations/entity-navigation";var z,B;function V(){return(V=e((()=>{
2
+ /**
3
+ * @license lucide-react v1.53.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ o(),z={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`]},z.node,B=s(z)})))()}var H,U;function W(){return(W=e((()=>{
9
+ /**
10
+ * @license lucide-react v1.53.0 - ISC
11
+ *
12
+ * This source code is licensed under the ISC license.
13
+ * See the LICENSE file in the root directory of this source tree.
14
+ */
15
+ o(),H={name:`circle-off`,size:24,node:[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.35 2.69A10 10 0 0 1 21.3 15.65`,key:`1pfsoa`}],[`path`,{d:`M19.08 19.08A10 10 0 1 1 4.92 4.92`,key:`1ablyi`}]]},H.node,U=s(H)})))()}var G,K;function q(){return(q=e((()=>{
16
+ /**
17
+ * @license lucide-react v1.53.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */
22
+ o(),G={name:`circle-slash-2`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M22 2 2 22`,key:`y4kqgn`}]],aliases:[`circle-slashed`]},G.node,K=s(G)})))()}var J,Y;function we(){return(we=e((()=>{
23
+ /**
24
+ * @license lucide-react v1.53.0 - ISC
25
+ *
26
+ * This source code is licensed under the ISC license.
27
+ * See the LICENSE file in the root directory of this source tree.
28
+ */
29
+ o(),J={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]},J.node,Y=s(J)})))()}var X,Te;function Z(){return(Z=e((()=>{
30
+ /**
31
+ * @license lucide-react v1.53.0 - ISC
32
+ *
33
+ * This source code is licensed under the ISC license.
34
+ * See the LICENSE file in the root directory of this source tree.
35
+ */
36
+ o(),X={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]},X.node,Te=s(X)})))()}function Ee({entityRef:e,capabilities:t,children:r}){let i=fe(),a=de(),o=E(be),s=JSON.stringify(F()),[c,l]=O(!1),u=r??`${ye(e.type)} #${e.key}`;return t.view?t.open?/* @__PURE__ */ A(ue,{children:[/* @__PURE__ */ k(C,{theme:`borderless`,size:`small`,style:{maxWidth:`100%`,paddingLeft:0,justifyContent:`flex-start`},onClick:t=>{if(t.stopPropagation(),o){o(e);return}let n=ve(e);n?(Se({url:Ce(a),locationKey:a.key,state:a.state,kind:`page`,pageScrollTop:document.querySelector(`.admin-content`)?.scrollTop??0},n,s,a.pathname),i(n)):l(!0)},children:/* @__PURE__ */ k(n.Text,{ellipsis:{showTooltip:!0},style:{color:`inherit`},children:u})}),c&&/* @__PURE__ */ k(se,{fallback:null,children:/* @__PURE__ */ k(ee,{entityRef:e,onClose:()=>l(!1)})})]}):/* @__PURE__ */ k(n.Text,{children:u}):null}function De(){return(De=e((()=>{x(),v()})))()}function Oe({section:e,search:n}){let r=e.filters;return/* @__PURE__ */ A(T,{wrap:!0,spacing:8,style:{padding:`4px 0 12px`,width:`100%`},children:[r?.keyword&&/* @__PURE__ */ k(i,{"aria-label":`关联记录关键词`,placeholder:`搜索关联记录`,...n.bindKeyword(`keyword`),width:180}),r?.dateRange&&/* @__PURE__ */ k(a,{...n.bind(`range`)}),r?.attentionOnly&&/* @__PURE__ */ k(t,{checked:n.draftParams.attentionOnly,onChange:e=>n.setField(`attentionOnly`)(!!e.target.checked),children:`仅看需处理`}),/* @__PURE__ */ k(C,{size:`small`,onClick:n.handleSearch,children:`查询`}),/* @__PURE__ */ k(C,{size:`small`,theme:`borderless`,onClick:n.handleReset,children:`重置`})]})}function ke(){return(ke=e((()=>{x(),r()})))()}function Ae({section:e,summaryState:t}){let n=L(e.labelKey,e.targetTypes),r=Le[t],i=`${n}:${r.label}`,a=r.Icon,o=Q[e.kind],s=o.Icon,c=`关联来源:${I(e.kind)}`;return/* @__PURE__ */ A(T,{spacing:6,children:[/* @__PURE__ */ k(S,{content:i,children:/* @__PURE__ */ k(`span`,{role:`img`,"aria-label":i,style:{color:r.color,display:`inline-flex`},children:/* @__PURE__ */ k(a,{size:15,"aria-hidden":`true`})})}),/* @__PURE__ */ k(S,{content:c,children:/* @__PURE__ */ k(`span`,{role:`img`,"aria-label":c,style:{color:o.color,display:`inline-flex`},children:/* @__PURE__ */ k(s,{size:14,"aria-hidden":`true`})})}),/* @__PURE__ */ k(`span`,{children:n})]})}function je({section:e,item:t}){let n=t.origin?.kind??e.kind,r=Q[n],i=r.Icon,a=[`关联来源:${I(n)}`];t.origin?.explanation&&a.push(t.origin.explanation),t.origin?.eventType&&a.push(`来源事件:${t.origin.eventType}`),t.origin?.relatedAt&&a.push(`关联建立时间:${P(t.origin.relatedAt)}`),t.occurredAt&&a.push(`记录时间:${P(t.occurredAt)}`);let o=a.join(` · `);return/* @__PURE__ */ k(S,{content:o,children:/* @__PURE__ */ k(`span`,{role:`img`,"aria-label":o,style:{color:r.color,display:`inline-flex`},children:/* @__PURE__ */ k(i,{size:14,"aria-hidden":`true`})})})}function Me({entityType:e,entityKey:t,section:r,active:i,canManageLinks:a,onSummaryStateChange:o,query:s,filtered:c,filters:l,filterToggle:u}){let d=he(),f=()=>{s.refetch(),d.invalidateQueries({queryKey:M(j.describe,{params:{type:e,key:t}})})},p=s.data?.pages??[],m=p.flatMap(e=>e.items).filter(e=>e.capabilities.view),h=p.some(e=>e.degraded),g=s.isError,_=s.data!==void 0;D(()=>{!i||s.isFetching||c||(g||h?o(r.key,`unavailable`):_&&o(r.key,m.length>0?r.summaryState===`attention`?`attention`:`has-data`:s.hasNextPage?`unavailable`:`empty`))},[i,h,c,_,m.length,o,s.hasNextPage,s.isFetching,r.key,r.summaryState,g]);let v=L(r.labelKey,r.targetTypes);return/* @__PURE__ */ A(`div`,{style:{position:`relative`},children:[u&&/* @__PURE__ */ k(`span`,{style:{position:`absolute`,top:0,right:32,zIndex:1,lineHeight:0},children:u}),/* @__PURE__ */ k(`span`,{style:{position:`absolute`,top:0,right:0,zIndex:1,lineHeight:0},children:/* @__PURE__ */ k(S,{content:`刷新${v}`,children:/* @__PURE__ */ k(C,{size:`small`,theme:`borderless`,icon:/* @__PURE__ */ k(ne,{size:14}),loading:s.isFetching,"aria-label":`刷新${v}`,onClick:e=>{e.stopPropagation(),f()}})})}),/* @__PURE__ */ A(`div`,{style:{paddingTop:4,paddingRight:u?64:32},children:[l,(s.isError||h)&&/* @__PURE__ */ A(T,{wrap:!0,spacing:8,children:[/* @__PURE__ */ k(n.Text,{type:`danger`,children:h?`部分关联记录暂时不可用`:`关联记录加载失败`}),/* @__PURE__ */ k(C,{size:`small`,onClick:()=>void(s.isFetchNextPageError?s.fetchNextPage():s.refetch()),children:`重试`})]}),_&&!g&&!h&&m.length===0&&/* @__PURE__ */ k(w,{description:s.hasNextPage?`继续加载以查找可见的匹配记录`:c?`没有符合筛选条件的关联记录`:`暂无关联记录`}),m.length>0&&/* @__PURE__ */ k(y,{size:`small`,split:!0,dataSource:m,renderItem:e=>/* @__PURE__ */ k(y.Item,{main:/* @__PURE__ */ A(`div`,{style:{minWidth:0},children:[/* @__PURE__ */ A(T,{wrap:!0,spacing:8,children:[/* @__PURE__ */ k(Ee,{entityRef:e.ref,capabilities:{view:e.capabilities.view&&r.capabilities.view,open:e.capabilities.open&&r.capabilities.open},children:e.title}),/* @__PURE__ */ k(je,{section:r,item:e}),R(e.status)&&/* @__PURE__ */ k(ie,{size:`small`,children:R(e.status)})]}),e.subtitle&&/* @__PURE__ */ k(`div`,{children:/* @__PURE__ */ k(n.Text,{type:`tertiary`,children:e.subtitle})}),e.description&&/* @__PURE__ */ k(`div`,{children:/* @__PURE__ */ k(n.Text,{type:`tertiary`,children:e.description})}),e.occurredAt&&/* @__PURE__ */ k(`div`,{children:/* @__PURE__ */ k(n.Text,{type:`tertiary`,children:/* @__PURE__ */ k(oe,{value:e.occurredAt})})})]})},`${e.ref.type}:${e.ref.key}:${e.relationKey}`)}),s.hasNextPage&&/* @__PURE__ */ k(C,{size:`small`,loading:s.isFetchingNextPage,onClick:()=>void s.fetchNextPage(),children:`加载更多`})]})]})}function Ne({entityType:e,entityKey:t,section:n,active:r,summaryState:i,canManageLinks:a,onSummaryStateChange:o}){let s=N({defaults:Ie,listKey:M(j.section,{params:{type:e,key:t,sectionKey:n.key},query:{}})}),c=pe({keyword:s.submittedParams.keyword,status:s.submittedParams.status,...me(s.submittedParams.range),attentionOnly:s.submittedParams.attentionOnly?!0:void 0}),l=Object.keys(c).length>0,[u,d]=O(l),f=!!(n.filters?.keyword||n.filters?.dateRange||n.filters?.attentionOnly),p=ge(e,t,n.key,r,5,c);return/* @__PURE__ */ k(b.Panel,{itemKey:n.key,header:/* @__PURE__ */ k(Ae,{section:n,summaryState:i}),children:/* @__PURE__ */ k(Me,{entityType:e,entityKey:t,section:n,active:r,canManageLinks:a,onSummaryStateChange:o,query:p,filtered:l,filters:f&&u?/* @__PURE__ */ k(Oe,{section:n,search:s}):void 0,filterToggle:f?/* @__PURE__ */ k(S,{content:`筛选关联记录`,children:/* @__PURE__ */ k(C,{size:`small`,theme:l?`light`:`borderless`,"aria-label":`筛选关联记录`,"aria-expanded":u,icon:/* @__PURE__ */ k(h,{size:14}),onClick:()=>d(e=>!e)})}):void 0})},n.key)}function Pe({entityType:e,entityKey:t,sections:n,canManageLinks:r,hideEmpty:i}){let a=E(xe),[o,s]=O([]),c=a?.expandedGroups??o,l=a?.setExpandedGroups??s,u=le(()=>Object.fromEntries(n.map(e=>[e.key,e.summaryState])),[n]),[d,f]=O(()=>Object.fromEntries(n.map(e=>[e.key,e.summaryState])));D(()=>{f(u)},[u]);let p=ce((e,t)=>{f(n=>n[e]===t?n:{...n,[e]:t})},[]);return/* @__PURE__ */ k(b,{activeKey:c,onChange:e=>l(Array.isArray(e)?e.map(String):[String(e)]),children:n.filter(e=>e.capabilities.view&&(!i||(d[e.key]??e.summaryState)!==`empty`)).map(n=>/* @__PURE__ */ k(Ne,{entityType:e,entityKey:t,section:n,active:c.includes(n.key),summaryState:d[n.key]??`unavailable`,canManageLinks:r,onSummaryStateChange:p},n.key))})}function Fe({entityType:e,entityKey:t,enabled:r=!0,showAnchor:i=!1}){let a=_e(e,t,r),o=F(),s=N({defaults:{hideEmpty:!1},listKey:[`entity-relation-display`,e,t,o],refetchOnSearch:!1});if(!r||!t)return null;if(a.isLoading)return/* @__PURE__ */ k(re,{size:`small`});if(a.isError)return/* @__PURE__ */ A(T,{wrap:!0,children:[/* @__PURE__ */ k(n.Text,{type:`danger`,children:`对象不可用或关联信息加载失败`}),/* @__PURE__ */ k(C,{size:`small`,onClick:()=>void a.refetch(),children:`重试`})]});let c=a.data?.sections??[];return/* @__PURE__ */ A(`div`,{style:{paddingTop:12},children:[i&&a.data&&/* @__PURE__ */ k(n.Title,{heading:6,children:a.data.anchor.title}),/* @__PURE__ */ A(T,{spacing:8,style:{marginBottom:8},children:[!1,/* @__PURE__ */ k(S,{content:s.submittedParams.hideEmpty?`显示空分组`:`隐藏空分组`,children:/* @__PURE__ */ k(C,{size:`small`,theme:s.submittedParams.hideEmpty?`light`:`borderless`,"aria-label":`隐藏空分组`,"aria-pressed":s.submittedParams.hideEmpty,icon:/* @__PURE__ */ k(p,{size:14}),onClick:()=>s.applySearch({hideEmpty:!s.submittedParams.hideEmpty})})})]}),c.length===0?/* @__PURE__ */ k(w,{description:`暂无可见关联信息`}):/* @__PURE__ */ k(Pe,{entityType:e,entityKey:t,sections:c,canManageLinks:a.data?.canManageLinks??!1,hideEmpty:s.submittedParams.hideEmpty},`groups:${e}:${t}:${JSON.stringify(o)}`)]})}var Ie,Le,Q;function $(){return($=e((()=>{x(),c(),V(),u(),W(),q(),f(),m(),we(),g(),te(),Z(),ae(),De(),ke(),Ie=()=>({keyword:``,status:void 0,range:null,attentionOnly:!1}),Le={"has-data":{label:`有记录`,Icon:d,color:`var(--arc-antd-color-success)`},empty:{label:`暂无记录`,Icon:K,color:`var(--arc-antd-color-tertiary)`},attention:{label:`需处理`,Icon:B,color:`var(--arc-antd-color-warning)`},unavailable:{label:`暂不可用`,Icon:U,color:`var(--arc-antd-color-danger)`}},Q={direct:{Icon:_,color:`var(--arc-antd-color-primary)`},derived:{Icon:Y,color:`var(--arc-antd-color-info)`},causal:{Icon:Te,color:`var(--arc-antd-color-warning)`},activity:{Icon:l,color:`var(--arc-antd-color-tertiary)`}}})))()}export{$ as n,Fe as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{i as t,r as n}from"./feedback-BnjMKZpz.js";import{_ as r,g as ee,i as te,l as i,n as a,o,t as ne}from"./ConfigurableTable-DzmZDd8F.js";import{o as s,t as re}from"./search-filters-CRIhZ0gL.js";import{r as ie,s as c}from"./toolbar-controls-CThS0xuP.js";import{t as l}from"./form-CQutQFiD.js";import{C as u,_ as ae}from"./ui-BFsHoY7a.js";import{n as oe,t as d}from"./useStatusToggle-B2qZaoc-.js";import{n as se,t as f}from"./useCrudOperationColumn-D935tixd.js";import{n as ce,t as p}from"./useListPage-CbcOQG4m.js";import{a as m,i as le,o as ue,r as h,t as de}from"./EditFormModal-DNHOZHxM.js";import{n as g,t as fe}from"./ModalFooter-RMlvqrO9.js";import{n as _,t as v}from"./AppModal-DJzQA6FR.js";import{n as y,t as pe}from"./ExportButton-AzH4D0oW.js";import{i as b,n as x,r as me,t as he}from"./UserTransferSelect-CAeyxdor.js";import{a as S,i as ge,n as _e,r as C}from"./DataScopePanel-B2-x8Jcz.js";import{useEffect as w,useMemo as T,useState as E}from"react";import{jsx as D,jsxs as O}from"react/jsx-runtime";import{enumValueOf as ve}from"@fudanda/shared/core";import{useDictItems as ye}from"@fudanda/react-core/hooks/useDictItems";import{roleContract as k}from"@fudanda/react-core/lib/native-operations";import{usePermission as be}from"@fudanda/react-core/hooks/usePermission";import{useAllUsers as A}from"@fudanda/react-core/hooks/queries/users";import{useMenuTree as j}from"@fudanda/react-core/hooks/queries/menus";import{DATA_SCOPES as M}from"@fudanda/shared/identity";import{departmentTreeToTreeData as N,useDepartmentTree as xe}from"@fudanda/react-core/hooks/queries/departments";import{useAssignRoleMenus as Se,useAssignRoleUsers as Ce,useDeleteRoles as we,useRoleDetail as P,useRoleList as Te,useRoleUsers as Ee,useSaveRole as F,useUpdateRoleDataScope as De}from"@fudanda/react-core/hooks/queries/roles";function I(){let{hasPermission:e}=be(),{options:r}=ye(`common_status`),a=ce({contract:k,useList:Te}),{tableProps:o,filterQuery:s}=a,[c,u]=E(!1),[d,f]=E(null),[p,m]=E([]),[h,g]=E(!1),[_,y]=E(null),[b,x]=E([]),[S,C]=E(!1),[I,L]=E(null),[R,z]=E(`all`),[B,V]=E([]),H=j({enabled:c}),U=P(d?.id,c),W=A({enabled:h}),G=Ee(_?.id,h),K=P(I?.id,S),q=xe(),J=T(()=>q.data??[],[q.data]),Oe=F(),Y=ue({entityName:`角色`,save:le(Oe,{create:k.create.input.shape.body,update:k.update.input.shape.body}),useDetail:P,defaults:{status:`enabled`},toValues:e=>({name:e.name,code:e.code,description:e.description??void 0,deptScopeIds:e.deptScopeIds,status:e.status}),beforeSave:(e,{editing:t})=>({...e,description:e.description||void 0,...t?{clearFields:e.description?[]:[`description`]}:{}})}),ke=Y.editing,Ae=F(),je=we(),X=Se(),Z=Ce(),Q=De(),Me=oe({toggle:(e,t)=>Ae.mutateAsync({id:e.id,values:{status:t?`enabled`:`disabled`}}),confirmDisable:e=>({danger:!0,title:`确认禁用角色「${e.name}」?`,content:`禁用后持有该角色的用户将不能登录。`,okText:`确认禁用`}),disabled:t=>t.code===`super_admin`||!e(`system:role:update`),messages:{disabled:`已禁用`}});w(()=>{c&&m(U.data?.menuIds??[])},[c,U.data]),w(()=>{h&&x((G.data??[]).map(e=>e.id))},[h,G.data]),w(()=>{S&&K.data&&V(K.data.deptScopeIds??[])},[S,K.data]);let Ne=e=>{f(e),u(!0)},Pe=async()=>{d&&(await X.mutateAsync({params:{id:d.id},body:{menuIds:p}}),t.success(`菜单权限已更新`),u(!1))},Fe=T(()=>{let e=[],t=n=>{n.forEach(n=>{e.push(n),n.children&&t(n.children)})};return t(J),e},[J]),Ie=T(()=>W.data??[],[W.data]),Le=e=>{y(e),g(!0)},$=async()=>{_&&(await Z.mutateAsync({params:{id:_.id},body:{userIds:b}}),t.success(`用户分配已更新`),g(!1))},Re=e=>{L(e),z(e.dataScope??`all`),V([]),C(!0)},ze=async()=>{if(!I)return;let e=ve(M,R)??`all`;await Q.mutateAsync({params:{id:I.id},body:e===`custom`?{dataScope:e,deptScopeIds:B}:{dataScope:e}}),t.success(`数据权限已更新`),C(!1)},Be=se({permission:`system:role`,edit:Y,remove:je,title:`确认删除此角色?`,disabled:{remove:e=>e.code===`super_admin`,reason:`超级管理员角色不允许删除`},extraBetween:t=>[{key:`menu`,label:`菜单权限`,hidden:!e(`system:role:assign`),onClick:()=>Ne(t)}],extraAfter:t=>[{key:`users`,label:`分配用户`,hidden:!e(`system:role:assign`),onClick:()=>Le(t)},{key:`dataScope`,label:`数据权限`,hidden:!e(`system:role:update`),onClick:()=>Re(t)}],width:260,desktopInlineKeys:[`edit`,`menu`,`delete`]}),Ve=[{title:`角色名称`,dataIndex:`name`,width:160,render:i},{title:`角色编码`,dataIndex:`code`,width:160,render:i},{title:`描述`,dataIndex:`description`,minWidth:200,render:(e,t)=>i(t.description)},{title:`数据权限`,dataIndex:`dataScope`,width:140,align:`center`,render:e=>({all:`全部数据`,dept:`本部门及以下`,self:`仅本人数据`})[e]??e},{title:`用户`,dataIndex:`userPreview`,width:180,render:(e,t)=>/* @__PURE__ */ D(me,{preview:t.userPreview,count:t.userCount,scope:{type:`role`,id:t.id,name:t.name}})},te,Me.column(),Be];return/* @__PURE__ */ O(`div`,{className:`page-container`,children:[/* @__PURE__ */ D(ne,{searchConfig:ee({page:a,filters:[`keyword`,`status`,[`startTime`,`endTime`]],overrides:{startTime:e=>/* @__PURE__ */ D(re,{placeholder:[`开始时间`,`结束时间`],...e.bindRange([`startTime`,`endTime`])})},create:/* @__PURE__ */ D(ie,{permission:`system:role:create`,onClick:Y.openCreate}),actions:/* @__PURE__ */ D(pe,{entity:`system.roles`,query:s}),filterTitle:`角色筛选`,actionTitle:`角色操作`}),columns:Ve,...o}),/* @__PURE__ */ O(de,{modal:Y,width:480,children:[/* @__PURE__ */ D(l.Input,{field:`name`,label:`角色名称`,placeholder:`请输入角色名称`,rules:[{required:!0,message:`请输入角色名称`}]}),/* @__PURE__ */ D(l.Input,{field:`code`,label:`角色编码`,placeholder:`请输入角色编码`,rules:[{required:!0,message:`请输入角色编码`}]}),/* @__PURE__ */ D(l.Input,{field:`description`,label:`描述`,placeholder:`请输入描述`}),/* @__PURE__ */ D(l.TreeSelect,{field:`deptScopeIds`,label:`管理范围`,placeholder:`默认全员(用于工作流「角色」审批人按部门过滤)`,multiple:!0,filterTreeNode:!0,treeData:N(J),style:{width:`100%`}}),/* @__PURE__ */ D(l.Select,{field:`status`,label:`状态`,style:{width:`100%`},disabled:ke?.code===`super_admin`,optionList:r,placeholder:`请选择状态`})]}),/* @__PURE__ */ D(v,{title:`分配菜单权限 — ${d?.name}`,visible:c,onCancel:()=>u(!1),onOk:Pe,okButtonProps:{disabled:!U.isSuccess,loading:X.isPending},width:640,children:/* @__PURE__ */ D(ge,{allMenus:H.data??[],checkedMenuIds:p,onChange:m,loading:H.isFetching||U.isFetching})}),/* @__PURE__ */ D(v,{title:`数据权限 — ${I?.name}`,visible:S,onCancel:()=>C(!1),onOk:ze,okButtonProps:{disabled:!K.isSuccess,loading:Q.isPending},width:400,children:/* @__PURE__ */ D(_e,{dataScope:R,deptScopeIds:B,deptTree:J,onScopeChange:e=>z(e??`all`),onDeptIdsChange:V,loading:q.isFetching||K.isFetching})}),/* @__PURE__ */ D(n,{title:/* @__PURE__ */ O(`span`,{children:[`分配用户 — `,_?.name]}),visible:h,onCancel:()=>g(!1),width:720,footer:/* @__PURE__ */ D(fe,{onCancel:()=>g(!1),onOk:$,okText:`保存`,loading:Z.isPending,disabled:!G.isSuccess||!W.isSuccess}),children:W.isFetching||G.isFetching?/* @__PURE__ */ D(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:/* @__PURE__ */ D(ae,{})}):/* @__PURE__ */ D(he,{dataSource:Ie,value:b,onChange:x,departments:Fe})})]})}function L(){return(L=e((()=>{u(),x(),b(),y(),_(),a(),o(),S(),C(),m(),c(),s(),r(),d(),f(),g(),p(),h()})))()}L();export{I as default};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{r as t}from"./feedback-D4BIfDNd.js";import{a as n,o as r,s as i}from"./toolbar-controls-BFOuV86W.js";import{n as a,t as o}from"./ellipsis-Dux1Nxa5.js";import{n as s,t as c}from"./funnel-BwQjQI4Y.js";import{_ as l,a as u,u as d,w as f}from"./ui-DoIHGuTR.js";import{n as p,t as m}from"./rendered-slot-YhfmcMJr.js";import{useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{ToolbarSlotContext as v}from"@fudanda/react-core/components/toolbar-slot-context";import{useRenderedSlot as y}from"@fudanda/react-core/hooks/useRenderedSlot";function b({children:e,className:i,primary:a,filters:s,actions:f,mobilePrimary:p,mobileFilters:b,mobileActions:x,filterTitle:S=`筛选条件`,actionTitle:C=`更多操作`,onFilterApply:w,onFilterReset:T}){let[E,D]=h(!1),O=y(),k=!!(a||s||f),A=[`responsive-toolbar`,k?`responsive-toolbar--structured`:``,i??``].filter(Boolean).join(` `);if(!k)return/* @__PURE__ */ g(`div`,{className:`search-area`,children:/* @__PURE__ */ g(`div`,{className:A,children:/* @__PURE__ */ g(l,{wrap:!0,style:{width:`100%`},children:e})})});let j=p??a,M=b??s,N=x??f,P=!!M,F=x===void 0?O.rendered:!!N,I=!!(w||T);return/* @__PURE__ */ _(`div`,{className:`search-area`,children:[/* @__PURE__ */ _(`div`,{className:A,children:[/* @__PURE__ */ g(`div`,{className:`responsive-toolbar__desktop`,children:/* @__PURE__ */ _(l,{wrap:!0,style:{width:`100%`},children:[a,s,/* @__PURE__ */ g(m,{ref:O.probeRef,children:f})]})}),/* @__PURE__ */ _(`div`,{className:`responsive-toolbar__mobile`,children:[/* @__PURE__ */ g(`div`,{className:`responsive-toolbar__mobile-primary`,children:/* @__PURE__ */ g(l,{wrap:!0,style:{width:`100%`},children:j})}),(P||F)&&/* @__PURE__ */ _(l,{className:`responsive-toolbar__mobile-extra`,spacing:8,children:[P&&/* @__PURE__ */ g(u,{icon:/* @__PURE__ */ g(c,{size:14}),onClick:()=>D(!0),children:`筛选`}),F&&/* @__PURE__ */ g(d,{trigger:`click`,position:`bottomRight`,clickToHide:!0,render:/* @__PURE__ */ _(`div`,{className:`responsive-toolbar__mobile-actions`,children:[/* @__PURE__ */ g(`div`,{className:`responsive-toolbar__mobile-actions-title`,children:C}),/* @__PURE__ */ g(l,{vertical:!0,align:`start`,spacing:8,style:{width:`100%`},children:/* @__PURE__ */ g(v.Provider,{value:`mobile-actions`,children:N})})]}),children:/* @__PURE__ */ g(u,{icon:/* @__PURE__ */ g(o,{size:14}),"aria-label":C})})]})]})]}),P&&/* @__PURE__ */ g(t,{className:`search-toolbar-filter-sheet`,title:S,visible:E,onCancel:()=>D(!1),placement:`bottom`,height:`min(72vh, 420px)`,footer:I?/* @__PURE__ */ _(l,{children:[T&&/* @__PURE__ */ g(n,{onClick:()=>{T(),D(!1)}}),w&&/* @__PURE__ */ g(r,{onClick:()=>{w(),D(!1)}})]}):null,children:/* @__PURE__ */ g(l,{vertical:!0,align:`start`,spacing:12,style:{width:`100%`},children:M})})]})}function x(){return(x=e((()=>{f(),s(),a(),i(),p()})))()}export{x as n,b as t};
1
+ import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{r as t}from"./feedback-BnjMKZpz.js";import{a as n,o as r,s as i}from"./toolbar-controls-CThS0xuP.js";import{n as a,t as o}from"./ellipsis-Dux1Nxa5.js";import{n as s,t as c}from"./funnel-BwQjQI4Y.js";import{C as l,a as u,g as d,u as f}from"./ui-BFsHoY7a.js";import{n as p,t as m}from"./rendered-slot-YhfmcMJr.js";import{useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{ToolbarSlotContext as v}from"@fudanda/react-core/components/toolbar-slot-context";import{useRenderedSlot as y}from"@fudanda/react-core/hooks/useRenderedSlot";function b({children:e,className:i,primary:a,filters:s,actions:l,mobilePrimary:p,mobileFilters:b,mobileActions:x,filterTitle:S=`筛选条件`,actionTitle:C=`更多操作`,onFilterApply:w,onFilterReset:T}){let[E,D]=h(!1),O=y(),k=!!(a||s||l),A=[`responsive-toolbar`,k?`responsive-toolbar--structured`:``,i??``].filter(Boolean).join(` `);if(!k)return/* @__PURE__ */ g(`div`,{className:`search-area`,children:/* @__PURE__ */ g(`div`,{className:A,children:/* @__PURE__ */ g(d,{wrap:!0,style:{width:`100%`},children:e})})});let j=p??a,M=b??s,N=x??l,P=!!M,F=x===void 0?O.rendered:!!N,I=!!(w||T);return/* @__PURE__ */ _(`div`,{className:`search-area`,children:[/* @__PURE__ */ _(`div`,{className:A,children:[/* @__PURE__ */ g(`div`,{className:`responsive-toolbar__desktop`,children:/* @__PURE__ */ _(d,{wrap:!0,style:{width:`100%`},children:[a,s,/* @__PURE__ */ g(m,{ref:O.probeRef,children:l})]})}),/* @__PURE__ */ _(`div`,{className:`responsive-toolbar__mobile`,children:[/* @__PURE__ */ g(`div`,{className:`responsive-toolbar__mobile-primary`,children:/* @__PURE__ */ g(d,{wrap:!0,style:{width:`100%`},children:j})}),(P||F)&&/* @__PURE__ */ _(d,{className:`responsive-toolbar__mobile-extra`,spacing:8,children:[P&&/* @__PURE__ */ g(u,{icon:/* @__PURE__ */ g(c,{size:14}),onClick:()=>D(!0),children:`筛选`}),F&&/* @__PURE__ */ g(f,{trigger:`click`,position:`bottomRight`,clickToHide:!0,render:/* @__PURE__ */ _(`div`,{className:`responsive-toolbar__mobile-actions`,children:[/* @__PURE__ */ g(`div`,{className:`responsive-toolbar__mobile-actions-title`,children:C}),/* @__PURE__ */ g(d,{vertical:!0,align:`start`,spacing:8,style:{width:`100%`},children:/* @__PURE__ */ g(v.Provider,{value:`mobile-actions`,children:N})})]}),children:/* @__PURE__ */ g(u,{icon:/* @__PURE__ */ g(o,{size:14}),"aria-label":C})})]})]})]}),P&&/* @__PURE__ */ g(t,{className:`search-toolbar-filter-sheet`,title:S,visible:E,onCancel:()=>D(!1),placement:`bottom`,height:`min(72vh, 420px)`,footer:I?/* @__PURE__ */ _(d,{children:[T&&/* @__PURE__ */ g(n,{onClick:()=>{T(),D(!1)}}),w&&/* @__PURE__ */ g(r,{onClick:()=>{w(),D(!1)}})]}):null,children:/* @__PURE__ */ g(d,{vertical:!0,align:`start`,spacing:12,style:{width:`100%`},children:M})})]})}function x(){return(x=e((()=>{l(),s(),a(),i(),p()})))()}export{x as n,b as t};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{n as t,t as n}from"./createLucideIcon-BtwfYE6A.js";import{b as r,w as i}from"./ui-DoIHGuTR.js";import{jsx as a}from"react/jsx-runtime";import{SESSION_CLIENT_KIND_LABELS as o}from"@fudanda/shared/identity";var s,c;function l(){return(l=e((()=>{
1
+ import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{n as t,t as n}from"./createLucideIcon-BtwfYE6A.js";import{C as r,y as i}from"./ui-BFsHoY7a.js";import{jsx as a}from"react/jsx-runtime";import{SESSION_CLIENT_KIND_LABELS as o}from"@fudanda/shared/identity";var s,c;function l(){return(l=e((()=>{
2
2
  /**
3
3
  * @license lucide-react v1.53.0 - ISC
4
4
  *
@@ -19,4 +19,4 @@ t(),u={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
21
  */
22
- t(),p={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`}]]},p.node,m=n(p)})))()}function g({client:e,size:t=16,className:n}){let r=v[e]??d;return/* @__PURE__ */ a(r,{size:t,className:n,"aria-label":o[e]??e})}function _({client:e,size:t=`small`}){let n=v[e]??d;return/* @__PURE__ */ a(r,{color:y[e]??`grey`,size:t,prefixIcon:/* @__PURE__ */ a(n,{size:12,"aria-hidden":!0}),children:o[e]??e})}var v,y;function b(){return(b=e((()=>{i(),l(),f(),h(),v={web:d,mobile:m,desktop:c},y={web:`blue`,mobile:`green`,desktop:`violet`}})))()}export{f as a,d as i,_ as n,b as r,g as t};
22
+ t(),p={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`}]]},p.node,m=n(p)})))()}function g(e){return Object.entries(o).find(([t])=>t===e)?.[1]??e}function _(){return(_=e((()=>{})))()}function v({client:e,size:t=16,className:n}){let r=e===`web`||e===`mobile`||e===`desktop`?e:void 0,i=r?b[r]:d;return/* @__PURE__ */ a(i,{size:t,className:n,"aria-label":g(e)})}function y({client:e,size:t=`small`}){let n=e===`web`||e===`mobile`||e===`desktop`?e:void 0,r=n?b[n]:d;return/* @__PURE__ */ a(i,{color:n?x[n]:`grey`,size:t,prefixIcon:/* @__PURE__ */ a(r,{size:12,"aria-hidden":!0}),children:g(e)})}var b,x;function S(){return(S=e((()=>{r(),l(),f(),h(),_(),b={web:d,mobile:m,desktop:c},x={web:`blue`,mobile:`green`,desktop:`violet`}})))()}export{g as a,_ as i,y as n,d as o,S as r,f as s,v as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{t}from"./typography-DKK_iHcj.js";import{a as n,i as r,r as i,t as a}from"./SessionClientTag-DIwnYodW.js";import{n as o,t as s}from"./shield-alert-De_Hx56I.js";import{C as c,a as l}from"./ui-BFsHoY7a.js";import{n as u,t as d}from"./DateTimeText-CIt0Qy45.js";import{n as f,t as p}from"./AppModal-DJzQA6FR.js";import{jsx as m,jsxs as h}from"react/jsx-runtime";function g({conflict:e,loading:t,onConfirm:r,onCancel:i}){let o=e?.sessions??[];return/* @__PURE__ */ h(p,{title:`该账号已在其他设备登录`,visible:e!==null,onCancel:i,maskClosable:!1,width:440,footer:/* @__PURE__ */ h(`div`,{className:`session-conflict-footer`,children:[/* @__PURE__ */ m(l,{theme:`borderless`,type:`tertiary`,onClick:i,disabled:t,children:`取消`}),/* @__PURE__ */ m(l,{type:`danger`,theme:`solid`,loading:t,onClick:r,children:`下线其他设备并登录`})]}),children:[/* @__PURE__ */ h(`div`,{className:`session-conflict-intro`,children:[/* @__PURE__ */ m(s,{size:18,"aria-hidden":!0}),/* @__PURE__ */ h(_,{type:`secondary`,children:[`受安全策略限制,该账号最多同时在 `,e?.maxSessions??1,` 处登录。下线以下设备后即可继续;如不是您本人的登录,请尽快修改密码。`]})]}),/* @__PURE__ */ m(`ul`,{className:`session-conflict-list`,"aria-label":`占用名额的设备`,children:o.map((e,t)=>/* @__PURE__ */ h(`li`,{className:`session-conflict-item`,children:[/* @__PURE__ */ m(a,{client:e.client,size:20,className:`session-conflict-icon`}),/* @__PURE__ */ h(`div`,{className:`session-conflict-body`,children:[/* @__PURE__ */ m(`div`,{className:`session-conflict-title`,children:/* @__PURE__ */ h(_,{strong:!0,children:[n(e.client),` · `,e.browser,` / `,e.os]})}),/* @__PURE__ */ h(_,{type:`tertiary`,size:`small`,className:`session-conflict-meta`,children:[`IP: ${e.ip}`,` · `,`登录 `,/* @__PURE__ */ m(d,{value:e.loginAt}),` · `,`活跃 `,/* @__PURE__ */ m(d,{value:e.lastActiveAt})]})]})]},`${e.ip}-${e.loginAt}-${t}`))})]})}var _;function v(){return(v=e((()=>{c(),o(),f(),u(),r(),i(),{Text:_}=t})))()}v();export{g as default};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{t}from"./typography-DKK_iHcj.js";import{n,t as r}from"./rotate-ccw-D2__Zisi.js";import{C as i,S as a,a as o,l as s,y as c}from"./ui-BFsHoY7a.js";import{n as l,t as u}from"./rendered-slot-YhfmcMJr.js";import{createContext as d,useContext as f}from"react";import{usePreferences as p}from"@fudanda/react-core/hooks/usePreferences";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{useRenderedSlot as _}from"@fudanda/react-core/hooks/useRenderedSlot";import{preferenceDefinitionMap as v}from"@fudanda/shared/preferences";function y(){return f(b)}var b;function x(){return(x=e((()=>{b=d(()=>!0)})))()}function S({title:e,description:t,control:n,overridden:r,extra:i,style:a}){return/* @__PURE__ */ g(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:16,padding:`14px 0`,...a},children:[/* @__PURE__ */ g(`div`,{style:{minWidth:0},children:[/* @__PURE__ */ g(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[/* @__PURE__ */ h(k,{heading:6,style:{margin:0},children:e}),r?/* @__PURE__ */ h(c,{size:`small`,color:`blue`,children:`已覆盖`}):null,i]}),t?/* @__PURE__ */ h(O,{type:`tertiary`,size:`small`,children:t}):null]}),/* @__PURE__ */ h(`div`,{style:{flexShrink:0},children:n})]})}function C({title:e,description:t,children:n}){return/* @__PURE__ */ g(`section`,{children:[/* @__PURE__ */ h(k,{heading:6,style:{margin:`24px 0 4px`,color:`var(--arc-antd-color-text-2)`,fontWeight:600},children:e}),t?/* @__PURE__ */ h(O,{type:`tertiary`,size:`small`,children:t}):null,n]})}function w(){return/* @__PURE__ */ h(s,{margin:0})}function T({path:e}){let{canEditPreference:t,isPreferenceOverridden:n,resetPreference:i}=p();return!t(e)||!n(e)?null:/* @__PURE__ */ h(a,{content:`清除这项个人选择,跟随系统当前默认值`,styles:{root:{pointerEvents:`none`}},children:/* @__PURE__ */ h(o,{size:`small`,theme:`borderless`,type:`tertiary`,icon:/* @__PURE__ */ h(r,{size:12}),"aria-label":`${e}恢复系统默认`,onClick:()=>i(e),children:`跟随系统`})})}function E({path:e,children:t,inline:n=!1}){let{canEditPreference:r,isPreferenceOverridden:i}=p(),a=y();if(!r(e)||!a(e))return null;let o=v[e];return/* @__PURE__ */ g(`div`,{className:`preference-control${n?` preference-control--inline`:``}`,"data-preference-path":e,role:`group`,"aria-label":o.label,children:[t,!n&&o.description?/* @__PURE__ */ h(`div`,{className:`preference-control__description`,children:o.description}):null,i(e)?/* @__PURE__ */ h(`span`,{className:`preference-control__reset`,children:/* @__PURE__ */ h(T,{path:e})}):null]})}function D({title:e,children:t}){p();let{probeRef:n,rendered:r}=_();return/* @__PURE__ */ g(m,{children:[r?e:null,/* @__PURE__ */ h(u,{ref:n,children:t})]})}var O,k;function A(){return(A=e((()=>{i(),n(),x(),l(),{Text:O,Title:k}=t})))()}export{C as a,x as c,S as i,y as l,D as n,A as o,w as r,b as s,E as t};
@@ -0,0 +1,26 @@
1
+ import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{n as t,o as n,r,s as i,t as a}from"./controls-C5dPckUT.js";import{t as o}from"./typography-DKK_iHcj.js";import{i as s}from"./feedback-BnjMKZpz.js";import{n as c,o as l,r as u}from"./search-filters-CRIhZ0gL.js";import{n as d,t as f}from"./createLucideIcon-BtwfYE6A.js";import{n as p,t as m}from"./MasterDetailLayout-sjPWw8BI.js";import{a as h,i as g,s as ee}from"./toolbar-controls-CThS0xuP.js";import{n as te,t as _}from"./rotate-ccw-D2__Zisi.js";import{n as ne,t as re}from"./save-w-NwiMMY.js";import{C as ie,S as ae,_ as oe,a as se,d as ce,g as le,r as ue,s as de,x as fe,y as v}from"./ui-BFsHoY7a.js";import{$ as y,A as pe,B as b,C as me,D as he,E as ge,F as _e,G as x,H as S,I as ve,J as ye,K as be,L as xe,M as Se,N as C,O as Ce,P as we,Q as Te,R as Ee,S as De,T as w,U as Oe,V as ke,W as Ae,X as je,Y as Me,Z as Ne,_ as Pe,a as Fe,b as T,c as Ie,d as Le,f as Re,g as ze,h as Be,i as Ve,j as He,k as Ue,l as We,n as Ge,o as Ke,p as qe,q as Je,r as Ye,s as Xe,t as Ze,u as Qe,v as $e,w as et,x as tt,y as E,z as nt}from"./parse-6ZQGx714.js";import{n as rt,t as it}from"./rendered-slot-YhfmcMJr.js";import{n as at,t as ot}from"./SearchToolbar-CvgYKUjr.js";import{n as st,t as ct}from"./EmptyIllustration-DUC3RZmF.js";import{a as lt,i as ut,o as dt,r as ft}from"./SettingRow-DVNmTJWC.js";import{i as pt,r as mt,t as ht}from"./NavListPanel-vjIOIqK0.js";import{Fragment as gt,useEffect as _t,useMemo as D,useState as vt}from"react";import{Fragment as O,jsx as k,jsxs as A}from"react/jsx-runtime";import{GoaError as yt}from"@fudanda/client";import{Link as bt}from"react-router-dom";import{settingsWriteOperations as xt}from"@fudanda/react-core/lib/native-operations";import{usePermission as St}from"@fudanda/react-core/hooks/usePermission";import{useRenderedSlot as Ct}from"@fudanda/react-core/hooks/useRenderedSlot";import{useListSearch as wt}from"@fudanda/react-core/hooks/useListSearch";import{useCurrentUserMenuTree as Tt,useMenuTree as Et}from"@fudanda/react-core/hooks/queries/menus";import{THEME_COLOR_PRESETS as Dt}from"@fudanda/react-core/lib/theme-color";import{textMatches as Ot}from"@fudanda/react-core/utils/pinyin";import{usePinyinReady as kt}from"@fudanda/react-core/hooks/usePinyinReady";import{canOverridePreference as j,defaultPreferences as At,describePreferenceCondition as jt,getPreferenceValue as M,isPreferenceApplicable as Mt,preferenceDefinitions as N,preferenceGroups as Nt,resolvePreferences as Pt,setPreferenceValue as P}from"@fudanda/shared/preferences";import{CAPTCHA_COMPLEXITY_LABELS as Ft,SETTINGS_MODULES as It}from"@fudanda/shared/settings";import{settingsKeys as Lt,useSaveSettings as Rt,useSettings as zt,useSettingsModules as Bt}from"@fudanda/react-core/hooks/queries/settings";import{useUrlSelectionState as Vt}from"@fudanda/react-core/hooks/useUrlSelectionState";import{foundationSettingSchemas as Ht}from"@fudanda/shared/settings/foundation";var Ut,Wt;function Gt(){return(Gt=e((()=>{
2
+ /**
3
+ * @license lucide-react v1.53.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ d(),Ut={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`}]]},Ut.node,Wt=f(Ut)})))()}var Kt,qt;function Jt(){return(Jt=e((()=>{
9
+ /**
10
+ * @license lucide-react v1.53.0 - ISC
11
+ *
12
+ * This source code is licensed under the ISC license.
13
+ * See the LICENSE file in the root directory of this source tree.
14
+ */
15
+ d(),Kt={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]},Kt.node,qt=f(Kt)})))()}function Yt(){return(Yt=e((()=>{})))()}var F,I,Xt,Zt,Qt,$t;function en(){return(en=e((()=>{De(),b(),F=/*@__PURE__*/ E(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),I=e=>{let t=e.value;return!be(t)&&t.length!==void 0},Xt=/*@__PURE__*/ E(`$ZodCheckMaxLength`,(e,t)=>{var n;F.init(e,t),(n=e._zod.def).when??(n.when=I),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?pe(r):i)<=t.maximum)return;let a=Ee(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Zt=/*@__PURE__*/ E(`$ZodCheckMinLength`,(e,t)=>{var n;F.init(e,t),(n=e._zod.def).when??(n.when=I),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?pe(r):i)>=t.minimum)return;let a=Ee(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Qt=/*@__PURE__*/ E(`$ZodCheckLengthEquals`,(e,t)=>{var n;F.init(e,t),(n=e._zod.def).when??(n.when=I),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?pe(r):i;if(a===t.length)return;let o=Ee(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),$t=/*@__PURE__*/ E(`$ZodCheckOverwrite`,(e,t)=>{F.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}})})))()}var tn;function nn(){return(nn=e((()=>{tn={major:4,minor:6,patch:5}})))()}async function rn(e,t){let n={async:!0};return gn(await e._zod.run({value:t,issues:[]},n),n)}function an(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return gn(r,n)}catch{}return rn(e,t)},vendor:`zod`,version:1}}function on(e,t,n){e.issues.length&&t.issues.push(...Me(n,e.issues)),t.value[n]=e.value}function sn(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!w(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ve(e,r,T())))}),t)}function cn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ke(e)&&ke(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=cn(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=cn(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ln(e,t,n){let r=/* @__PURE__ */ new Map,i,a=/* @__PURE__ */ new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=cn(t.value,n.value);if(!c.valid){if(w(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}function un(e,t){return e.value=t.issues.length?void 0:t.value,e}function dn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function fn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function pn(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>ve(e,r,T()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}function L(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}function mn(e){return e.memo||(e.value=Object.freeze(e.value)),e}function hn(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(S(e))}}var R,gn,_n,vn,yn,bn,xn,Sn,Cn,wn,Tn,En,Dn,On,kn,An,jn,Mn,Nn;function Pn(){return(Pn=e((()=>{en(),De(),b(),nn(),R=/*@__PURE__*/ E(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tn;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=w(t),a;for(let o of n){if(o._zod.def.when){if(_e(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new Pe;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(he(t.issues,n,e),i||=w(t,n))});else{if(t.issues.length===n)continue;he(t.issues,n,e),i||=w(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(w(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Pe;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new Pe;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return nt(this,`~standard`,an(this))},set"~standard"(e){Je(this,`~standard`,e)}}),gn=(e,t)=>e.issues.length?{issues:e.issues.map(e=>ve(e,t,T()))}:{value:e.value},_n=/*@__PURE__*/ E(`$ZodArray`,(e,t)=>{R.init(e,t);let n=tt.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>on(t,r,e)));else if(on(c,r,e),s&&c.issues.length!==0&&w(c))break}return o.length?Promise.all(o).then(()=>r):r}}),vn=/*@__PURE__*/ E(`$ZodUnion`,(e,t)=>{R.init(e,t),C(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),C(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),C(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),C(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Ce(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>sn(t,r,e,i)):sn(o,r,e,i)}}),yn=/*@__PURE__*/ E(`$ZodIntersection`,(e,t)=>{R.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>ln(e,t,n)):ln(e,i,a)}}),bn=/*@__PURE__*/ E(`$ZodEnum`,(e,t)=>{R.init(e,t);let n=xe(t.entries),r=new Set(n);e._zod.values=r,C(e,`pattern`,e=>{let t=xe(e.def.entries).filter(e=>je.has(typeof e));return RegExp(t.length?`^(${t.map(e=>we(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),xn=/*@__PURE__*/ E(`$ZodLiteral`,(e,t)=>{R.init(e,t);let n=new Set(t.values);e._zod.values=n,C(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?we(e):e?we(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Sn=/*@__PURE__*/ E(`$ZodTransform`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,tt.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new $e(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Pe;return n.value=i,n}}),Cn=/*@__PURE__*/ E(`$ZodOptional`,(e,t)=>{R.init(e,t),C(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,C(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),C(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ce(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>un(e,t)):un(e,r)}return t.innerType._zod.run(e,n)}}),wn=/*@__PURE__*/ E(`$ZodExactOptional`,(e,t)=>{Cn.init(e,t),C(e,`values`,e=>e.def.innerType._zod.values),C(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Tn=/*@__PURE__*/ E(`$ZodNullable`,(e,t)=>{R.init(e,t),C(e,`optin`,e=>e.def.innerType._zod.optin),C(e,`optout`,e=>e.def.innerType._zod.optout),C(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ce(t.source)}|null)$`):void 0}),C(e,`values`,e=>e.def.innerType._zod.values?/* @__PURE__ */ new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),En=/*@__PURE__*/ E(`$ZodDefault`,(e,t)=>{R.init(e,t),e._zod.optin=`defaulted`,C(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>dn(e,t)):dn(r,t)}}),Dn=/*@__PURE__*/ E(`$ZodPrefault`,(e,t)=>{R.init(e,t),e._zod.optin=`defaulted`,C(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),On=/*@__PURE__*/ E(`$ZodNonOptional`,(e,t)=>{R.init(e,t),C(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>fn(t,e)):fn(i,e)}}),kn=/*@__PURE__*/ E(`$ZodCatch`,(e,t)=>{R.init(e,t),C(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),C(e,`optout`,e=>e.def.innerType._zod.optout),C(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>pn(e,r,t,n)):pn(e,r,t,n)}}),An=/*@__PURE__*/ E(`$ZodPipe`,(e,t)=>{R.init(e,t),C(e,`values`,e=>e.def.in._zod.values),C(e,`optin`,e=>e.def.in._zod.optin),C(e,`optout`,e=>e.def.out._zod.optout),C(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>L(e,t.in,n)):L(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>L(e,t.out,n)):L(r,t.out,n)}}),jn=/*@__PURE__*/ E(`$ZodReadonly`,(e,t)=>{R.init(e,t),C(e,`propValues`,e=>e.def.innerType._zod.propValues),C(e,`values`,e=>e.def.innerType._zod.values),C(e,`optin`,e=>e.def.innerType?._zod?.optin),C(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(mn):mn(r)}}),Mn=/*@__PURE__*/ E(`$ZodLazy`,(e,t)=>{R.init(e,t),Se(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),C(e,`pattern`,e=>e.innerType?._zod?.pattern),C(e,`propValues`,e=>e.innerType?._zod?.propValues),C(e,`optin`,e=>e.innerType?._zod?.optin??void 0),C(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Nn=/*@__PURE__*/ E(`$ZodCustom`,(e,t)=>{F.init(e,t),R.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>hn(t,n,r,e));hn(i,n,r,e)}})})))()}function Fn(e){return typeof e==`object`&&!!e}function In(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}function Ln(e,t,n){let r=Gn.get(e);if(r!==void 0)return r?V:z;if(t.has(e))return V;t.add(e);let i=z,a=e=>{if(i!==V&&e?._zod){let r=Ln(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=z;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?B:o.value?._zod?Ln(o.value,t,n):z;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Ne(c);s(e?o(e,!0):B),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Ln(r,t,!1):B);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Rn(e,i)}function Rn(e,t){return t!==B&&Gn.set(e,t===V),t}function zn(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}function Bn(){return qn}function Vn(e,t){let n=e[Un]?.backEdges;return n!==void 0&&Fn(t)&&n.has(t)}var Hn,Un,Wn,Gn,z,B,V,Kn,H,qn;function Jn(){return(Jn=e((()=>{b(),Hn=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Un=`~memo`,Wn=[],Gn=/*@__PURE__*/ new WeakMap,z=0,B=1,V=2,H=[],qn={alloc(e,t,n){let r=Kn;if(!r)return n;Kn=void 0;let i={value:n,issues:null};return r.set(t.value,i),H.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Vn(n,e.value))throw new Hn;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Ln(e,/* @__PURE__ */ new Set,!1);if(i===z)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===V||r?n=!0:r=!0}let l=s.value;if(!Fn(l))return t(s,c);let u=c[Un];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[Un]=u);let d;i===c?d=a:(d=zn(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...In(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;Kn=d;let p=H.length,m=t(s,c);Kn=void 0;let h=H.length>p?H.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?In(e.issues):Wn),e)):(h&&(h.issues=m.issues.length?In(m.issues):Wn),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}}})))()}function Yn(){return{localeError:Xn()}}var Xn;function Zn(){return(Zn=e((()=>{b(),Xn=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(ye(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${y(e.values[0])}`:`Invalid option: expected one of ${Oe(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Oe(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}}})))()}function Qn(){return new er}var $n,er,U;function tr(){return(tr=e((()=>{er=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}},($n=globalThis).__zod_globalRegistry??($n.__zod_globalRegistry=Qn()),U=globalThis.__zod_globalRegistry})))()}// @__NO_SIDE_EFFECTS__
16
+ function nr(e,t){return new Xt({check:`max_length`,...x(t),maximum:e})}// @__NO_SIDE_EFFECTS__
17
+ function rr(e,t){return new Zt({check:`min_length`,...x(t),minimum:e})}// @__NO_SIDE_EFFECTS__
18
+ function ir(e,t){return new Qt({check:`length_equals`,...x(t),length:e})}// @__NO_SIDE_EFFECTS__
19
+ function ar(e){return new $t({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
20
+ function or(e,t,n){return new e({type:`array`,element:t,...x(n)})}// @__NO_SIDE_EFFECTS__
21
+ function sr(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...x(n)})}// @__NO_SIDE_EFFECTS__
22
+ function cr(e,t){let n=/* @__PURE__ */ lr(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(S(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(S(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
23
+ function lr(e,t){let n=new F({check:`custom`,...x(t)});return n._zod.check=e,n}function ur(){return(ur=e((()=>{en(),b()})))()}function W(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&ge(e,t,n[t]);return e}function dr(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??U,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function G(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function K(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,K(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&W(o.schema,c),t.io===`input`&&q(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function fr(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function pr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${fr(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+fr(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
24
+
25
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function mr(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;mr(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}function hr(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function gr(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!yr.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??hr(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}let i=e.length===1?e[0]:gr(e)??{allOf:e};ge(n,r,i)}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=hr(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function _r(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of yr)if(t in e)return;let n=t.filter(e=>br.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=gr(t);else{let e=n[0],i=br.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>gr([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,W(e,r))}function vr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):W(i,s),W(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())mr(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])_r(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}W(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,ge(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:J(t,`input`,e.processors),output:J(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function q(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return q(r.element,n);if(r.type===`set`)return q(r.valueType,n);if(r.type===`lazy`)return q(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return q(r.innerType,n);if(r.type===`intersection`)return q(r.left,n)||q(r.right,n);if(r.type===`record`||r.type===`map`)return q(r.keyType,n)||q(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:q(r.in,n)||q(r.out,n);if(r.type===`object`){for(let e in r.shape)if(q(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(q(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(q(e,n))return!0;return!!(r.rest&&q(r.rest,n))}return!1}var yr,br,xr,J;function Sr(){return(Sr=e((()=>{tr(),b(),yr=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),br=[`oneOf`,`anyOf`],xr=(e,t={})=>n=>{let r=dr({...n,processors:t});return K(e,r),pr(r,e),vr(r,e)},J=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=dr({...i??{},target:a,io:t,processors:n});return K(e,o),pr(o,e),vr(o,e)}})))()}function Cr(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Nr[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Y(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Y(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&X(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&X(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Er(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Or(t,i.mime);for(let e of i.patterns??[])Dr(t,e);return t}function wr(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(G(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Ur):JSON.parse(o)}var Y,X,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br,Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr;function Zr(){return(Zr=e((()=>{Yt(),Pn(),Sr(),b(),Y=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},X=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Tr=(e,t)=>{Y(e,`minimum`,t),X(e,`maximum`,t)},Er=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Dr=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},Or=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},kr=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Ar=(e,t)=>Y(e,`minimum`,t.minimum),jr=(e,t)=>X(e,`maximum`,t.maximum),Mr=e=>(t,n)=>{kr(t,n.format);let[r,i]=e[n.format];Y(t,`minimum`,r),X(t,`maximum`,i)},Nr={greater_than:(e,t)=>Y(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>X(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Er(e,t.value),number_format:Mr(et),bigint_format:Mr(me),min_length:Ar,max_length:jr,length_equals:(e,t)=>Tr(e,t.length),min_size:Ar,max_size:jr,size_equals:(e,t)=>Tr(e,t.size),string_format:(e,t)=>{kr(e,t.format),t.pattern&&Dr(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Or(e,t.mime)},Pr=(e,t,n,r)=>{let i=e._zod.def,a=xe(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Fr=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(G(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(G(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Ir=(e,t,n,r)=>{G(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Lr=(e,t,n,r)=>{G(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Rr=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Cr(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=K(a.element,t,{...r,path:[...r.path,`items`]})},zr=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>K(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Br=(e,t,n,r)=>{let i=e._zod.def,a=K(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=K(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Vr=(e,t,n,r)=>{let i=e._zod.def,a=K(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Hr=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ur=Symbol(),Wr=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=wr(i.defaultValue,e,t,n,r);o!==Ur&&(n.default=o)},Gr=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=wr(i.defaultValue,e,t,n,r);o!==Ur&&(n._prefault=o)},Kr=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{G(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},qr=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;K(o,t,r);let s=t.seen.get(e);s.ref=o},Jr=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Yr=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Xr=(e,t,n,r)=>{let i=e._zod.innerType;K(i,t,r);let a=t.seen.get(e);a.ref=i}})))()}function Qr(){tt.localeError||T(Yn())}function $r(){tt.memoizer||T({memoizer:Bn()})}function ei(e,t){return/* @__PURE__ */ or(hi,e,t)}function ti(e,t){return new gi({type:`union`,options:e,...x(t)})}function ni(e,t){return new _i({type:`intersection`,left:e,right:t})}function ri(e){return new bi({type:`transform`,transform:e})}function ii(e){return new xi({type:`optional`,innerType:e})}function ai(e){return new Si({type:`optional`,innerType:e})}function oi(e){return new Ci({type:`nullable`,innerType:e})}function si(e,t){return new wi({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Te(t)}})}function ci(e,t){return new Ti({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Te(t)}})}function li(e,t){return new Ei({type:`nonoptional`,innerType:e,...x(t)})}function ui(e,t){return new Di({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:He(t)})}function di(e,t){return new Oi({type:`pipe`,in:e,out:t})}function fi(e){return new ki({type:`readonly`,innerType:e})}function pi(e,t={}){return/* @__PURE__ */ sr(ji,e,t)}function mi(e,t){return/* @__PURE__ */ cr(e,t)}var Z,hi,gi,_i,vi,yi,bi,xi,Si,Ci,wi,Ti,Ei,Di,Oi,ki,Ai,ji;function Mi(){return(Mi=e((()=>{De(),Jn(),Pn(),b(),tr(),ur(),Zr(),Sr(),Zn(),Fe(),Z=/*@__PURE__*/ E(`ZodType`,(e,t)=>(Qr(),R.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Ae(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ue(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(pi(e,t))},superRefine(e,t){return this.check(mi(e,t))},overwrite(e){return this.check(/* @__PURE__ */ ar(e))},optional(){return ii(this)},exactOptional(){return ai(this)},nullable(){return oi(this)},nullish(){return ii(oi(this))},nonoptional(e){return li(this,e)},array(){return ei(this)},or(e){return ti([this,e])},and(e){return ni(this,e)},transform(e){return di(this,ri(e))},default(e){return si(this,e)},prefault(e){return ci(this,e)},catch(e){return ui(this,e)},pipe(e){return di(this,e)},readonly(){return fi(this)},describe(e){let t=this.clone();return U.add(t,{description:e}),t},meta(...e){if(e.length===0)return U.get(this);let t=this.clone();return U.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return nt(this,`~standard`,{...an(this),jsonSchema:{input:J(this,`input`),output:J(this,`output`)}})},set"~standard"(e){Je(this,`~standard`,e)},parse:function e(t,n){return Ke(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Xe(this,t,n,{callee:e})},safeParse(e,t){return Re(this,e,t)},async safeParseAsync(e,t){return qe(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Je(this,`spa`,e)},validate(e,t){return Be(this,e,t)},validateAsync(e,t){return ze(this,e,t)},encode:function e(t,n){return Ye(this,t,n,{callee:e})},decode:function e(t,n){return Ze(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Ve(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Ge(this,t,n,{callee:e})},safeEncode(e,t){return Qe(this,e,t)},safeDecode(e,t){return Ie(this,e,t)},async safeEncodeAsync(e,t){return Le(this,e,t)},async safeDecodeAsync(e,t){return We(this,e,t)},toJSONSchema(e){return xr(this,{})(e)},get description(){return U.get(this)?.description},get _def(){return this._zod.def}}),hi=/*@__PURE__*/ E(`ZodArray`,(e,t)=>{$r(),_n.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rr(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ rr(e,t))},nonempty(e){return this.check(/* @__PURE__ */ rr(1,e))},max(e,t){return this.check(/* @__PURE__ */ nr(e,t))},length(e,t){return this.check(/* @__PURE__ */ ir(e,t))},unwrap(){return this.element}}),gi=/*@__PURE__*/ E(`ZodUnion`,(e,t)=>{vn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zr(e,t,n,r),e.options=t.options}),_i=/*@__PURE__*/ E(`ZodIntersection`,(e,t)=>{yn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Br(e,t,n,r)}),vi=/*@__PURE__*/ E(`ZodEnum`,(e,t)=>{bn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pr(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new vi({...t,checks:[],...x(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new vi({...t,checks:[],...x(r),entries:i})}}),yi=/*@__PURE__*/ E(`ZodLiteral`,(e,t)=>{xn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fr(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})}),bi=/*@__PURE__*/ E(`ZodTransform`,(e,t)=>{$r(),Sn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lr(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new $e(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(S(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(S(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}}),xi=/*@__PURE__*/ E(`ZodOptional`,(e,t)=>{Cn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Si=/*@__PURE__*/ E(`ZodExactOptional`,(e,t)=>{wn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Ci=/*@__PURE__*/ E(`ZodNullable`,(e,t)=>{Tn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),wi=/*@__PURE__*/ E(`ZodDefault`,(e,t)=>{En.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),Ti=/*@__PURE__*/ E(`ZodPrefault`,(e,t)=>{Dn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Ei=/*@__PURE__*/ E(`ZodNonOptional`,(e,t)=>{On.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Di=/*@__PURE__*/ E(`ZodCatch`,(e,t)=>{kn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),Oi=/*@__PURE__*/ E(`ZodPipe`,(e,t)=>{An.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qr(e,t,n,r),e.in=t.in,e.out=t.out}),ki=/*@__PURE__*/ E(`ZodReadonly`,(e,t)=>{jn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Ai=/*@__PURE__*/ E(`ZodLazy`,(e,t)=>{Mn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xr(e,t,n,r),e.unwrap=()=>e._zod.def.getter()}),ji=/*@__PURE__*/ E(`ZodCustom`,(e,t)=>{Nn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ir(e,t,n,r)})})))()}function Ni({primary:e,filters:t,onRefresh:n,refreshing:r,onReset:i,actions:a,mobileActions:o,extra:s,filterTitle:c,actionTitle:l,className:u}){let d=n?/* @__PURE__ */ k(g,{onClick:n,loading:r}):null,f=Ct(),p=Pi(a)||Pi(s)?/* @__PURE__ */ A(O,{children:[/* @__PURE__ */ k(it,{ref:f.probeRef,children:a}),s]}):void 0;return/* @__PURE__ */ k(ot,{className:u,primary:/* @__PURE__ */ A(O,{children:[e,t,d,i?/* @__PURE__ */ k(h,{onClick:i}):null]}),actions:p,mobilePrimary:/* @__PURE__ */ A(O,{children:[e,d]}),mobileFilters:Pi(t)?t:void 0,mobileActions:o??(f.rendered?a:!1),filterTitle:c,actionTitle:l,onFilterReset:i})}var Pi;function Fi(){return(Fi=e((()=>{at(),ee(),rt(),Pi=e=>!!e})))()}var Ii;function Li(){return(Li=e((()=>{Ii={captchaEnabled:{title:`登录验证码`,description:`开启后登录必须输入图形验证码`},captchaComplexity:{title:`验证码复杂度`,description:`仅在开启登录验证码后生效`},uploadValidateType:{title:`校验真实文件类型`,description:`基于 magic bytes 识别,防止伪造 MIME type 绕过校验`},uploadAllowedTypes:{title:`允许的 MIME 类型`,description:`支持通配符(如 image/*);填 * 或 */* 放行全部类型`},uploadMaxSizeMb:{title:`单文件大小上限(MB)`,description:`0 表示不限制;超过的上传(含分片)将被拒绝`},chunkThresholdMb:{title:`分片上传阈值(MB)`,description:`超过该大小的文件走分片上传 + 断点续传,不超过则单请求上传;受反向代理请求体上限约束`},chunkSizeMb:{title:`分片大小(MB)`,description:`服务端裁定的分片基线,不低于对象存储要求的最小分片;文件过大时自动上调以不超过片数上限`},watermark:{title:`水印`},"watermark.enabled":{title:`页面水印`,description:`开启后全站叠加水印(防截图泄漏)`},"watermark.content":{title:`水印文本`,description:`留空则显示当前用户名`},"watermark.fontSize":{title:`字体大小(px)`},"watermark.opacity":{title:`透明度(1-100)`},preferencesEntryEnabled:{title:`偏好设置入口`,description:`显示在用户头像下拉菜单,关闭后隐藏“偏好设置”(含锁屏密码设置)`}}})))()}function Ri(e){return(e.def.checks??[]).map(e=>e._zod.def)}function Q(e){if(e instanceof Ai)return Q(e.unwrap());if(e instanceof vi)return Object.values(e.enum).filter(e=>typeof e==`string`);if(e instanceof yi){let t=[...e.values];return t.every(e=>typeof e==`string`)?t:void 0}if(e instanceof gi){let t=e.options.map(e=>Q(e));return t.every(e=>e!==void 0)?t.flat():void 0}if(e instanceof _i){let t=Q(e.def.left),n=Q(e.def.right);return t&&n?t.filter(e=>n.includes(e)):t??n}}function $(e){let t=e,n={},r=!1;for(;;){let e=t.meta();if(e&&(e.title||e.description)&&!n.title&&(n={title:e.title,description:e.description}),t instanceof Ai){let e=t.unwrap();if(!(e instanceof Z))return{meta:n,leaf:{kind:`unknown`}};t=e;continue}let i=t.def;if(i.type===`nullable`&&(r=!0),(i.type==="default"||i.type===`prefault`||i.type===`optional`||i.type===`nullable`)&&i.innerType)t=i.innerType;else break}let i=t.def,a=Q(t);if(a?.length)return{meta:n,leaf:{kind:`enum`,options:a}};switch(i.type){case`boolean`:return{meta:n,leaf:{kind:`boolean`}};case`number`:{let e=Ri(t),i=e.find(e=>e.check===`greater_than`),a=e.find(e=>e.check===`less_than`),o=e.some(e=>e.check===`number_format`)||t.def.format===`safeint`,s=(e,t)=>e?.value===void 0?void 0:e.inclusive===!1&&o?e.value+t:e.value;return{meta:n,leaf:{kind:`number`,int:o,min:s(i,1),max:s(a,-1),nullable:r}}}case`enum`:return{meta:n,leaf:{kind:`enum`,options:Object.values(i.entries??{})}};case`string`:return{meta:n,leaf:{kind:`string`,maxLength:Ri(t).find(e=>e.check===`max_length`)?.maximum}};case`array`:{let e=i.element?$(i.element):null;return e?.leaf.kind===`string`||e?.leaf.kind===`enum`?{meta:n,leaf:{kind:`string-array`,maxItems:Ri(t).find(e=>e.check===`max_length`)?.maximum}}:{meta:n,leaf:{kind:`unknown`}}}case`object`:return{meta:n,leaf:{kind:`object`,shape:t.shape}};default:return{meta:n,leaf:{kind:`unknown`}}}}function zi(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Bi(e,t,n){if(t.length===1)return{...e,[t[0]]:n};let[r,...i]=t,a=e[r]??{};return{...e,[r]:Bi(a,i,n)}}function Vi(e,t){return t.reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e)}function Hi({schema:e,value:a,inheritedValue:o,onChange:s,disabled:c,allowRevert:l=!0,enumLabels:u,excludeFields:d,fieldLabels:f}){let p=(e,t)=>s(Bi(a,e,t)),m=(e,s)=>{let d=e.join(`.`),m=Vi(a,e),h=o?Vi(o,e):void 0,g=o!==void 0&&!zi(m,h),ee=l&&g&&!c?/* @__PURE__ */ k(se,{size:`small`,theme:`borderless`,onClick:()=>p(e,h),children:`恢复继承`}):null,te=s.meta.title??f?.[d]?.title??e[e.length-1],_;switch(s.leaf.kind){case`boolean`:_=/* @__PURE__ */ k(i,{checked:!!m,disabled:c,onChange:t=>p(e,t)});break;case`number`:{let{min:t,max:n,int:i,nullable:a}=s.leaf;_=/* @__PURE__ */ k(r,{style:{width:160},min:t,max:n,precision:i?0:void 0,disabled:c,value:typeof m==`number`?m:void 0,placeholder:a?`留空 = 未设置`:void 0,onChange:t=>{typeof t==`number`&&Number.isFinite(t)?p(e,i?Math.trunc(t):t):a&&p(e,null)}});break}case`enum`:_=/* @__PURE__ */ k(n,{style:{width:200},disabled:c,value:typeof m==`string`?m:void 0,optionList:s.leaf.options.map(e=>({value:e,label:u?.[d]?.[e]??e})),onChange:t=>p(e,t)});break;case`string`:_=/* @__PURE__ */ k(t,{style:{width:280},disabled:c,maxLength:s.leaf.maxLength,value:typeof m==`string`?m:``,onChange:t=>p(e,t)});break;case`string-array`:_=/* @__PURE__ */ k(fe,{style:{width:360,maxWidth:`100%`},disabled:c,max:s.leaf.maxItems,value:Array.isArray(m)?m:[],allowDuplicates:!1,separator:[`,`,` `,`
26
+ `],addOnBlur:!0,placeholder:`输入后按回车添加`,onChange:t=>p(e,t)});break;default:_=/* @__PURE__ */ k(`span`,{style:{color:`var(--arc-antd-color-text-2)`},children:`该字段类型暂不支持在通用设置页编辑`})}return/* @__PURE__ */ k(ut,{title:te,description:s.meta.description??f?.[d]?.description,control:_,overridden:g,extra:ee},d)},h=(e,t)=>{let n=Object.entries(e).filter(([e])=>!d?.includes([...t,e].join(`.`))),r=n.filter(([,e])=>$(e).leaf.kind!==`object`),i=n.filter(([,e])=>$(e).leaf.kind===`object`);return/* @__PURE__ */ A(O,{children:[r.map(([e,n],r)=>/* @__PURE__ */ A(gt,{children:[r>0?/* @__PURE__ */ k(ft,{}):null,m([...t,e],$(n))]},e)),i.map(([e,n])=>{let r=$(n);return r.leaf.kind===`object`?/* @__PURE__ */ k(lt,{title:r.meta.title??f?.[[...t,e].join(`.`)]?.title??e,description:r.meta.description??f?.[[...t,e].join(`.`)]?.description,children:h(r.leaf.shape,[...t,e])},e):null})]})},g=$(e);return/* @__PURE__ */ k(`div`,{children:g.leaf.kind===`object`?h(g.leaf.shape,[]):null})}function Ui(){return(Ui=e((()=>{ie(),Mi(),dt()})))()}function Wi(e){return D(()=>{let t=[],n=(e,r)=>{for(let i of e){if(i.type===`menu`&&i.path&&i.status===`enabled`&&i.visible){let e=i.isExternal&&i.embed?`/embed/${i.id}`:i.path;t.push({id:i.id,title:i.title,path:e,icon:i.icon,breadcrumb:r})}i.children?.length&&n(i.children,i.type===`directory`?[...r,i.title]:r)}};return n(e,[]),t},[e])}function Gi(){return(Gi=e((()=>{})))()}function Ki(e,t){return!j(t,e)||M(e.defaults,t)!==M(At,t)}function qi({value:e,disabled:t,onChange:r,label:i}){let a=Dt.find(t=>t.key===e),o=a?.light.primary??e,s=Dt.map(e=>({value:e.key,label:e.name}));return a||s.push({value:e,label:e}),/* @__PURE__ */ A(`div`,{className:`preference-policy-editor__color`,children:[/* @__PURE__ */ k(n,{"aria-label":i,value:e,optionList:s,disabled:t,onChange:e=>{typeof e==`string`&&r(e)}}),/* @__PURE__ */ k(de,{alpha:!1,usePopover:!0,value:de.colorStringToValue(o),onChange:e=>{t||r(e.hex)},children:/* @__PURE__ */ k(`button`,{type:`button`,className:`preference-policy-editor__swatch`,disabled:t,"aria-label":`自定义主题色`,title:`自定义主题色`,style:{backgroundColor:o}})})]})}function Ji({value:e,onChange:s,disabled:l}){let{hasPermission:d}=St(),f=d(`system:menu:list`),p=Et({enabled:f}),m=Tt(),h=Wi(p.data??m.data??[]),{draftParams:g,bind:ee,setField:te,handleReset:ne}=wt({defaults:Yi,listKey:Lt.module(`ui`),refetchOnSearch:!1}),re=D(()=>{let t=[{value:`/`,label:`首页(默认)`}],n=/* @__PURE__ */ new Set([`/`]);for(let e of h)!e.path.startsWith(`/`)||e.path.startsWith(`//`)||n.has(e.path)||(n.add(e.path),t.push({value:e.path,label:[...e.breadcrumb,e.title].join(` / `)}));let r=e.defaults.homePath;return n.has(r)||t.push({value:r,label:`${r}(当前已配置)`}),t},[h,e.defaults.homePath]),ie=kt(),oe=D(()=>{let t=g.keyword.trim();return N.filter(n=>g.group&&n.group!==g.group||g.changedOnly&&!Ki(e,n.path)||g.lockedOnly&&j(n.path,e)?!1:!t||[n.label,n.path,n.description,Nt.find(e=>e.id===n.group)?.label,n.applicableWhen&&jt(n.applicableWhen)].filter(Boolean).some(e=>Ot(String(e),t)))},[g,e,ie]),de=N.filter(t=>Ki(e,t.path)).length,fe=N.filter(t=>!j(t.path,e)).length,v=Pt(e,{});function y(t,n){s({...e,defaults:P(e.defaults,t,n)})}function pe(t){s({defaults:P(e.defaults,t,M(At,t)),allowUserOverride:P(e.allowUserOverride,t,!0)})}function b(i){let{path:a,kind:o}=i,s=M(e.defaults,a),c=`${i.label}默认值`;return o===`boolean`?/* @__PURE__ */ k(n,{"aria-label":c,value:String(s),optionList:Zi,disabled:l,onChange:e=>y(a,e===`true`)}):o===`number`?/* @__PURE__ */ k(r,{"aria-label":c,value:typeof s==`number`?s:void 0,min:i.min,max:i.max,step:i.step??1,precision:i.step&&i.step<1?void 0:0,suffix:i.unit,disabled:l,onChange:e=>{typeof e==`number`&&Number.isFinite(e)&&y(a,e)}}):o===`color`?/* @__PURE__ */ k(qi,{value:String(s),disabled:l,label:c,onChange:e=>y(a,e)}):o===`home-path`?/* @__PURE__ */ k(n,{"aria-label":c,value:String(s),optionList:re,filter:!0,disabled:l,loading:f?p.isFetching:m.isFetching,onChange:e=>{typeof e==`string`&&y(a,e)}}):o===`select`?/* @__PURE__ */ k(n,{"aria-label":c,value:typeof s==`number`?s:String(s),optionList:[...i.options??[]],disabled:l,onChange:e=>{(typeof e==`string`||typeof e==`number`)&&y(a,e)}}):/* @__PURE__ */ k(t,{"aria-label":c,value:String(s),disabled:l,onChange:e=>y(a,e)})}function me(e){let t=Mt(e.path,v);return/* @__PURE__ */ A(`span`,{className:`preference-policy-editor__description`,children:[e.description?/* @__PURE__ */ k(`span`,{children:e.description}):null,e.applicableWhen?/* @__PURE__ */ A(`span`,{children:[`适用条件:`,jt(e.applicableWhen)]}):null,t?null:/* @__PURE__ */ k(`span`,{className:`preference-policy-editor__hint`,children:`当前系统默认组合不满足条件,满足条件后生效。`}),e.path===`homePath`?/* @__PURE__ */ A(`span`,{children:[`用户无权访问指定页面时回到可访问的首页。`,f?``:`当前仅列出你可访问的页面。`]}):null]})}return/* @__PURE__ */ k(`div`,{className:`preference-policy-editor`,children:/* @__PURE__ */ A(lt,{title:`偏好策略`,description:`设置每项偏好的系统默认值,并决定用户是否可以修改。`,children:[/* @__PURE__ */ k(ue,{type:`info`,closeIcon:null,className:`preference-policy-editor__intro`,description:`禁止用户修改的项目会在个人偏好中隐藏并使用系统值;子项是否显示取决于父项的生效值。更改将在保存后统一生效。`}),/* @__PURE__ */ k(Ni,{primary:/* @__PURE__ */ k(u,{placeholder:`搜索偏好名称 / 说明`,...ee(`keyword`)}),filters:/* @__PURE__ */ A(O,{children:[/* @__PURE__ */ k(c,{placeholder:`全部分组`,items:Xi,...ee(`group`)}),/* @__PURE__ */ k(a,{checked:g.changedOnly,onChange:e=>te(`changedOnly`)(!!e.target.checked),children:`仅看已调整`}),/* @__PURE__ */ k(a,{checked:g.lockedOnly,onChange:e=>te(`lockedOnly`)(!!e.target.checked),children:`仅看禁止修改`})]}),onReset:ne}),/* @__PURE__ */ A(o.Text,{type:`tertiary`,size:`small`,children:[`共 `,N.length,` 项 · 已调整 `,de,` 项 · 禁止修改 `,fe,` 项 · 当前显示 `,oe.length,` 项`]}),oe.length===0?/* @__PURE__ */ k(ce,{description:`没有符合筛选条件的偏好`}):null,Nt.map(t=>{let n=oe.filter(e=>e.group===t.id);return n.length===0?null:/* @__PURE__ */ A(lt,{title:t.label,children:[/* @__PURE__ */ A(`div`,{className:`preference-policy-editor__head`,"aria-hidden":`true`,children:[/* @__PURE__ */ k(`span`,{children:`偏好设置`}),/* @__PURE__ */ A(`div`,{className:`preference-policy-editor__controls`,children:[/* @__PURE__ */ k(`span`,{children:`系统默认值`}),/* @__PURE__ */ k(`span`,{children:`用户可修改`}),/* @__PURE__ */ k(`span`,{})]})]}),n.map((t,n)=>/* @__PURE__ */ A(gt,{children:[n>0?/* @__PURE__ */ k(ft,{}):null,/* @__PURE__ */ k(`div`,{className:`preference-policy-editor__row`,"data-preference-path":t.path,children:/* @__PURE__ */ k(ut,{title:t.label,description:me(t),style:{flexWrap:`wrap`},control:/* @__PURE__ */ A(`div`,{className:`preference-policy-editor__controls`,children:[/* @__PURE__ */ A(`div`,{className:`preference-policy-editor__value`,children:[/* @__PURE__ */ k(`span`,{className:`preference-policy-editor__mobile-label`,children:`系统默认值`}),b(t)]}),/* @__PURE__ */ A(`div`,{className:`preference-policy-editor__override`,children:[/* @__PURE__ */ k(`span`,{className:`preference-policy-editor__mobile-label`,children:`用户可修改`}),/* @__PURE__ */ k(i,{"aria-label":`${t.label}用户可修改`,disabled:l,checked:j(t.path,e),onChange:n=>s({...e,allowUserOverride:P(e.allowUserOverride,t.path,n)})})]}),/* @__PURE__ */ k(ae,{content:`恢复内置默认值并允许用户修改`,children:/* @__PURE__ */ k(le,{children:/* @__PURE__ */ k(se,{theme:`borderless`,size:`small`,"aria-label":`恢复${t.label}内置策略`,icon:/* @__PURE__ */ k(_,{size:14}),disabled:l||!Ki(e,t.path),onClick:()=>pe(t.path)})})})]})})})]},t.path))]},t.id)})]})})}var Yi,Xi,Zi;function Qi(){return(Qi=e((()=>{ie(),te(),Fi(),l(),dt(),Gi(),Yi={keyword:``,group:void 0,changedOnly:!1,lockedOnly:!1},Xi=Nt.map(e=>({value:e.id,label:e.label})),Zi=[{value:`true`,label:`开启`},{value:`false`,label:`关闭`}]})))()}function $i(){let e=Bt(),t=D(()=>(e.data??[]).filter(({module:e})=>e!==`identitySecurity`),[e.data]),[n,r]=Vt(`module`),[i,a]=vt(!1),o=n===null?null:t.find(e=>e.module===n)??null,s=o??(i?null:t[0]??null),c=s?.module??null;return _t(()=>{n!==null&&o===null&&e.data&&!e.isFetching&&r(null)},[n,o,e.data,e.isFetching,r]),/* @__PURE__ */ k(`div`,{className:`page-container page-container--stretch`,children:/* @__PURE__ */ k(m,{defaultSize:260,minSize:200,maxSize:400,persistKey:`system-settings`,style:{flex:1,minHeight:0,overflow:`hidden`},showDetail:c!==null,onBack:()=>r(null),onResponsiveChange:a,master:/* @__PURE__ */ k(mt,{title:`设置模块`,loading:e.isLoading,emptyText:`没有可访问的设置模块`,dataSource:t,renderItem:e=>/* @__PURE__ */ k(ht,{active:e.module===c,onClick:()=>r(e.module),icon:/* @__PURE__ */ k(qt,{size:16}),primary:e.title,secondary:e.version>0?`v${e.version}`:void 0,meta:/* @__PURE__ */ A(`span`,{style:{display:`inline-flex`,gap:6,alignItems:`center`},children:[/* @__PURE__ */ k(v,{size:`small`,color:`grey`,children:`系统级`}),e.overriddenCount>0?/* @__PURE__ */ A(v,{size:`small`,color:`orange`,children:[e.overriddenCount,` 项覆盖`]}):null]}),extra:e.page?/* @__PURE__ */ k(ae,{content:`有专用设置页面`,children:/* @__PURE__ */ k(Wt,{size:14,style:{display:`block`,color:`var(--arc-antd-color-text-2)`}})}):void 0,extraAlwaysVisible:!!e.page},e.module)}),detail:c&&s?/* @__PURE__ */ k(ea,{module:c,meta:s},c):/* @__PURE__ */ k(`div`,{style:{padding:48},children:/* @__PURE__ */ k(ce,{...ct(`NoContent`,120),description:`选择左侧模块查看或修改设置`})})})})}function ea({module:e,meta:t}){let n=It[e],r=zt(e),i=Rt(e),a=r.data,[o,c]=vt(null);_t(()=>{c(null)},[a?.version]);let l=D(()=>o??a?.effective??null,[o,a]),u=o!==null&&JSON.stringify(o)!==JSON.stringify(a?.effective),d=e===`ui`&&l?l:null,f=e===`ui`&&a?a.effective:null,p=d&&f?N.filter(({path:e})=>M(d.preferences.defaults,e)!==M(f.preferences.defaults,e)||M(d.preferences.allowUserOverride,e)!==M(f.preferences.allowUserOverride,e)):[],h=p.filter(({path:e})=>d&&!M(d.preferences.allowUserOverride,e)).length;async function g(){if(!a||!l)return;let t=xt[e].input.safeParse({body:{version:a.version,data:l}});if(t.success)try{await i.mutateAsync(t.data),c(null),s.success(`设置已保存`)}catch(e){e instanceof yt&&e.status===409&&(c(null),r.refetch())}else{let e=t.error.issues[0];s.error(`${e.path.join(`.`)||`表单`}:${e.message}`)}}return/* @__PURE__ */ k(m.Body,{padding:24,children:/* @__PURE__ */ A(`div`,{style:{maxWidth:e===`ui`?1040:760},children:[/* @__PURE__ */ A(`div`,{style:{display:`flex`,alignItems:`flex-start`,justifyContent:`space-between`,gap:16,marginBottom:8},children:[/* @__PURE__ */ A(`div`,{children:[/* @__PURE__ */ k(na,{heading:5,style:{margin:0},children:n.title}),/* @__PURE__ */ k(ta,{type:`tertiary`,children:n.description})]}),!t.page&&t.canWrite?/* @__PURE__ */ k(se,{theme:`solid`,icon:/* @__PURE__ */ k(re,{size:14}),loading:i.isPending,disabled:!u,onClick:()=>void g(),children:`保存`}):null]}),/* @__PURE__ */ A(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`,marginBottom:12},children:[/* @__PURE__ */ k(v,{color:`grey`,children:`系统级`}),a?/* @__PURE__ */ A(v,{children:[`版本 `,a.version]}):null,t.overriddenCount>0?/* @__PURE__ */ A(v,{color:`orange`,children:[t.overriddenCount,` 项覆盖`]}):null,a?.updatedAt?/* @__PURE__ */ A(ta,{type:`tertiary`,size:`small`,children:[`最后修改 `,a.updatedAt]}):null]}),t.page?/* @__PURE__ */ k(ue,{type:`info`,closeIcon:null,description:/* @__PURE__ */ A(`span`,{children:[`该模块有专用设置页面,请前往`,/* @__PURE__ */ A(bt,{to:t.page,style:{margin:`0 4px`,display:`inline-flex`,alignItems:`center`,gap:4},children:[n.title,/* @__PURE__ */ k(Wt,{size:12})]}),`修改。`]})}):null,!t.page&&!t.canWrite?/* @__PURE__ */ k(ue,{type:`warning`,closeIcon:null,description:t.scope===`platform`?`平台级设置仅平台管理员可修改,当前为只读。`:`当前账号没有修改权限,当前为只读。`}):null,p.length>0?/* @__PURE__ */ k(ue,{type:`info`,closeIcon:null,description:`待保存 ${p.length} 项偏好策略,其中 ${h} 项将统一使用系统值;允许修改的项目保留用户已有选择。`}):null,/* @__PURE__ */ k(oe,{spinning:r.isLoading,children:a&&l?/* @__PURE__ */ A(O,{children:[/* @__PURE__ */ k(Hi,{schema:Ht[e],excludeFields:e===`ui`?[`preferences`]:void 0,fieldLabels:Ii,value:l,inheritedValue:a.inherited,onChange:e=>c({...l,...e}),disabled:!!t.page||!t.canWrite,enumLabels:ra}),d?/* @__PURE__ */ k(Ji,{value:d.preferences,onChange:e=>c({...l,preferences:e}),disabled:!t.canWrite}):null]}):null})]})})}var ta,na,ra;function ia(){return(ia=e((()=>{ie(),Gt(),ne(),Jt(),st(),p(),pt(),Li(),Ui(),Qi(),{Text:ta,Title:na}=o,ra={captchaComplexity:Ft}})))()}ia();export{$i as default};