pixivflow 2.0.38 → 2.0.40

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 (213) hide show
  1. package/dist/cli/ArgumentParser.d.ts +2 -20
  2. package/dist/cli/ArgumentParser.d.ts.map +1 -1
  3. package/dist/cli/ArgumentParser.js +16 -29
  4. package/dist/cli/ArgumentParser.js.map +1 -1
  5. package/dist/commands/BackupCommand.d.ts +6 -0
  6. package/dist/commands/BackupCommand.d.ts.map +1 -1
  7. package/dist/commands/BackupCommand.js +6 -0
  8. package/dist/commands/BackupCommand.js.map +1 -1
  9. package/dist/commands/Command.d.ts +16 -0
  10. package/dist/commands/Command.d.ts.map +1 -1
  11. package/dist/commands/Command.js +9 -0
  12. package/dist/commands/Command.js.map +1 -1
  13. package/dist/commands/CommandRegistry.d.ts +24 -0
  14. package/dist/commands/CommandRegistry.d.ts.map +1 -1
  15. package/dist/commands/CommandRegistry.js +48 -0
  16. package/dist/commands/CommandRegistry.js.map +1 -1
  17. package/dist/commands/ConfigCommand.d.ts +6 -0
  18. package/dist/commands/ConfigCommand.d.ts.map +1 -1
  19. package/dist/commands/ConfigCommand.js +6 -0
  20. package/dist/commands/ConfigCommand.js.map +1 -1
  21. package/dist/commands/DirsCommand.d.ts +6 -0
  22. package/dist/commands/DirsCommand.d.ts.map +1 -1
  23. package/dist/commands/DirsCommand.js +6 -0
  24. package/dist/commands/DirsCommand.js.map +1 -1
  25. package/dist/commands/DownloadCommand.d.ts +6 -0
  26. package/dist/commands/DownloadCommand.d.ts.map +1 -1
  27. package/dist/commands/DownloadCommand.js +57 -3
  28. package/dist/commands/DownloadCommand.js.map +1 -1
  29. package/dist/commands/HealthCommand.d.ts +7 -0
  30. package/dist/commands/HealthCommand.d.ts.map +1 -1
  31. package/dist/commands/HealthCommand.js +7 -0
  32. package/dist/commands/HealthCommand.js.map +1 -1
  33. package/dist/commands/HelpCommand.d.ts +7 -0
  34. package/dist/commands/HelpCommand.d.ts.map +1 -1
  35. package/dist/commands/HelpCommand.js +22 -29
  36. package/dist/commands/HelpCommand.js.map +1 -1
  37. package/dist/commands/LoginCommand.d.ts +7 -0
  38. package/dist/commands/LoginCommand.d.ts.map +1 -1
  39. package/dist/commands/LoginCommand.js +7 -0
  40. package/dist/commands/LoginCommand.js.map +1 -1
  41. package/dist/commands/LoginHeadlessCommand.d.ts +7 -0
  42. package/dist/commands/LoginHeadlessCommand.d.ts.map +1 -1
  43. package/dist/commands/LoginHeadlessCommand.js +7 -0
  44. package/dist/commands/LoginHeadlessCommand.js.map +1 -1
  45. package/dist/commands/LogsCommand.d.ts +6 -0
  46. package/dist/commands/LogsCommand.d.ts.map +1 -1
  47. package/dist/commands/LogsCommand.js +6 -0
  48. package/dist/commands/LogsCommand.js.map +1 -1
  49. package/dist/commands/MaintainCommand.d.ts +6 -0
  50. package/dist/commands/MaintainCommand.d.ts.map +1 -1
  51. package/dist/commands/MaintainCommand.js +6 -0
  52. package/dist/commands/MaintainCommand.js.map +1 -1
  53. package/dist/commands/MigrateConfigCommand.d.ts +6 -0
  54. package/dist/commands/MigrateConfigCommand.d.ts.map +1 -1
  55. package/dist/commands/MigrateConfigCommand.js +6 -0
  56. package/dist/commands/MigrateConfigCommand.js.map +1 -1
  57. package/dist/commands/MonitorCommand.d.ts +6 -0
  58. package/dist/commands/MonitorCommand.d.ts.map +1 -1
  59. package/dist/commands/MonitorCommand.js +6 -0
  60. package/dist/commands/MonitorCommand.js.map +1 -1
  61. package/dist/commands/NormalizeCommand.d.ts +6 -0
  62. package/dist/commands/NormalizeCommand.d.ts.map +1 -1
  63. package/dist/commands/NormalizeCommand.js +6 -0
  64. package/dist/commands/NormalizeCommand.js.map +1 -1
  65. package/dist/commands/RandomDownloadCommand.d.ts +7 -1
  66. package/dist/commands/RandomDownloadCommand.d.ts.map +1 -1
  67. package/dist/commands/RandomDownloadCommand.js +7 -1
  68. package/dist/commands/RandomDownloadCommand.js.map +1 -1
  69. package/dist/commands/RefreshCommand.d.ts +12 -0
  70. package/dist/commands/RefreshCommand.d.ts.map +1 -1
  71. package/dist/commands/RefreshCommand.js +82 -0
  72. package/dist/commands/RefreshCommand.js.map +1 -1
  73. package/dist/commands/SchedulerCommand.d.ts +6 -0
  74. package/dist/commands/SchedulerCommand.d.ts.map +1 -1
  75. package/dist/commands/SchedulerCommand.js +7 -1
  76. package/dist/commands/SchedulerCommand.js.map +1 -1
  77. package/dist/commands/SetupCommand.d.ts +6 -0
  78. package/dist/commands/SetupCommand.d.ts.map +1 -1
  79. package/dist/commands/SetupCommand.js +6 -0
  80. package/dist/commands/SetupCommand.js.map +1 -1
  81. package/dist/commands/StatusCommand.d.ts +6 -0
  82. package/dist/commands/StatusCommand.d.ts.map +1 -1
  83. package/dist/commands/StatusCommand.js +6 -0
  84. package/dist/commands/StatusCommand.js.map +1 -1
  85. package/dist/commands/VersionCommand.d.ts +21 -0
  86. package/dist/commands/VersionCommand.d.ts.map +1 -0
  87. package/dist/commands/VersionCommand.js +81 -0
  88. package/dist/commands/VersionCommand.js.map +1 -0
  89. package/dist/commands/WebUICommand.d.ts +6 -0
  90. package/dist/commands/WebUICommand.d.ts.map +1 -1
  91. package/dist/commands/WebUICommand.js +6 -0
  92. package/dist/commands/WebUICommand.js.map +1 -1
  93. package/dist/commands/index.d.ts +2 -1
  94. package/dist/commands/index.d.ts.map +1 -1
  95. package/dist/commands/index.js +4 -1
  96. package/dist/commands/index.js.map +1 -1
  97. package/dist/commands/metadata.d.ts +38 -0
  98. package/dist/commands/metadata.d.ts.map +1 -0
  99. package/dist/commands/metadata.js +42 -0
  100. package/dist/commands/metadata.js.map +1 -0
  101. package/dist/commands/suggestions.d.ts +22 -0
  102. package/dist/commands/suggestions.d.ts.map +1 -0
  103. package/dist/commands/suggestions.js +85 -0
  104. package/dist/commands/suggestions.js.map +1 -0
  105. package/dist/config/validation.d.ts.map +1 -1
  106. package/dist/config/validation.js +11 -3
  107. package/dist/config/validation.js.map +1 -1
  108. package/dist/index.js +126 -320
  109. package/dist/index.js.map +1 -1
  110. package/dist/package.json +1 -1
  111. package/dist/pixiv/AuthClient.d.ts.map +1 -1
  112. package/dist/pixiv/AuthClient.js +56 -7
  113. package/dist/pixiv/AuthClient.js.map +1 -1
  114. package/dist/storage/Database.d.ts +22 -0
  115. package/dist/storage/Database.d.ts.map +1 -1
  116. package/dist/storage/Database.js +19 -0
  117. package/dist/storage/Database.js.map +1 -1
  118. package/dist/storage/DatabaseMigration.d.ts.map +1 -1
  119. package/dist/storage/DatabaseMigration.js +29 -0
  120. package/dist/storage/DatabaseMigration.js.map +1 -1
  121. package/dist/storage/repositories/TaskHistoryRepository.d.ts +61 -0
  122. package/dist/storage/repositories/TaskHistoryRepository.d.ts.map +1 -0
  123. package/dist/storage/repositories/TaskHistoryRepository.js +171 -0
  124. package/dist/storage/repositories/TaskHistoryRepository.js.map +1 -0
  125. package/dist/utils/errors.d.ts +14 -0
  126. package/dist/utils/errors.d.ts.map +1 -1
  127. package/dist/utils/errors.js +35 -12
  128. package/dist/utils/errors.js.map +1 -1
  129. package/dist/utils/pixiv-url-parser.d.ts +7 -1
  130. package/dist/utils/pixiv-url-parser.d.ts.map +1 -1
  131. package/dist/utils/pixiv-url-parser.js +75 -8
  132. package/dist/utils/pixiv-url-parser.js.map +1 -1
  133. package/dist/utils/token-manager.d.ts.map +1 -1
  134. package/dist/utils/token-manager.js +73 -5
  135. package/dist/utils/token-manager.js.map +1 -1
  136. package/dist/webui/package.json +1 -1
  137. package/dist/webui/routes/download.d.ts.map +1 -1
  138. package/dist/webui/routes/download.js +2 -0
  139. package/dist/webui/routes/download.js.map +1 -1
  140. package/dist/webui/routes/handlers/download-basic-handlers.d.ts +11 -0
  141. package/dist/webui/routes/handlers/download-basic-handlers.d.ts.map +1 -1
  142. package/dist/webui/routes/handlers/download-basic-handlers.js +199 -8
  143. package/dist/webui/routes/handlers/download-basic-handlers.js.map +1 -1
  144. package/dist/webui/services/DownloadTaskManager.d.ts.map +1 -1
  145. package/dist/webui/services/DownloadTaskManager.js +75 -3
  146. package/dist/webui/services/DownloadTaskManager.js.map +1 -1
  147. package/package.json +1 -1
  148. package/dist/webui/assets/ActionButton-DWq-fh3_.js +0 -2
  149. package/dist/webui/assets/ActionButton-DWq-fh3_.js.map +0 -1
  150. package/dist/webui/assets/CheckCircleOutlined-Can0-7ew.js +0 -2
  151. package/dist/webui/assets/CheckCircleOutlined-Can0-7ew.js.map +0 -1
  152. package/dist/webui/assets/CloseCircleOutlined-DfRmL2eG.js +0 -2
  153. package/dist/webui/assets/CloseCircleOutlined-DfRmL2eG.js.map +0 -1
  154. package/dist/webui/assets/Config-D9TWUGQR.js +0 -16
  155. package/dist/webui/assets/Config-D9TWUGQR.js.map +0 -1
  156. package/dist/webui/assets/Dashboard-CaGAH0y2.js +0 -2
  157. package/dist/webui/assets/Dashboard-CaGAH0y2.js.map +0 -1
  158. package/dist/webui/assets/DeleteOutlined-u-P2SpoK.js +0 -2
  159. package/dist/webui/assets/DeleteOutlined-u-P2SpoK.js.map +0 -1
  160. package/dist/webui/assets/Download-D9E4xrnM.js +0 -2
  161. package/dist/webui/assets/Download-D9E4xrnM.js.map +0 -1
  162. package/dist/webui/assets/Files-CKyc_PdW.js +0 -5
  163. package/dist/webui/assets/Files-CKyc_PdW.js.map +0 -1
  164. package/dist/webui/assets/PictureOutlined-C8Lbucj1.js +0 -2
  165. package/dist/webui/assets/PictureOutlined-C8Lbucj1.js.map +0 -1
  166. package/dist/webui/assets/SortDescendingOutlined-CR-hdhyW.js +0 -2
  167. package/dist/webui/assets/SortDescendingOutlined-CR-hdhyW.js.map +0 -1
  168. package/dist/webui/assets/ThunderboltOutlined-CiiB2de5.js +0 -2
  169. package/dist/webui/assets/ThunderboltOutlined-CiiB2de5.js.map +0 -1
  170. package/dist/webui/assets/UrlDownload-ClkUOXN_.js +0 -3
  171. package/dist/webui/assets/UrlDownload-ClkUOXN_.js.map +0 -1
  172. package/dist/webui/assets/dateUtils-CBk8bEa_.js +0 -2
  173. package/dist/webui/assets/dateUtils-CBk8bEa_.js.map +0 -1
  174. package/dist/webui/assets/errorCodeTranslator-DWsWq6B3.js +0 -3
  175. package/dist/webui/assets/errorCodeTranslator-DWsWq6B3.js.map +0 -1
  176. package/dist/webui/assets/index-BFgUdwJv.js +0 -214
  177. package/dist/webui/assets/index-BFgUdwJv.js.map +0 -1
  178. package/dist/webui/assets/index-CN3FylAF.js +0 -2
  179. package/dist/webui/assets/index-CN3FylAF.js.map +0 -1
  180. package/dist/webui/assets/index-CSoUPZat.js +0 -2
  181. package/dist/webui/assets/index-CSoUPZat.js.map +0 -1
  182. package/dist/webui/assets/index-CiHwNwrk.js +0 -19
  183. package/dist/webui/assets/index-CiHwNwrk.js.map +0 -1
  184. package/dist/webui/assets/index-DHwJxrFi.css +0 -1
  185. package/dist/webui/assets/index-DTU-FGA4.js +0 -2
  186. package/dist/webui/assets/index-DTU-FGA4.js.map +0 -1
  187. package/dist/webui/assets/index-DjpD0HQ5.js +0 -2
  188. package/dist/webui/assets/index-DjpD0HQ5.js.map +0 -1
  189. package/dist/webui/assets/index-Dycn6xoz.js +0 -2
  190. package/dist/webui/assets/index-Dycn6xoz.js.map +0 -1
  191. package/dist/webui/assets/index-G0EJCamt.js +0 -22
  192. package/dist/webui/assets/index-G0EJCamt.js.map +0 -1
  193. package/dist/webui/assets/index-WaraZQH0.js +0 -2
  194. package/dist/webui/assets/index-WaraZQH0.js.map +0 -1
  195. package/dist/webui/assets/index-k2rGFxEM.js +0 -8
  196. package/dist/webui/assets/index-k2rGFxEM.js.map +0 -1
  197. package/dist/webui/assets/index-lwTtspUb.js +0 -14
  198. package/dist/webui/assets/index-lwTtspUb.js.map +0 -1
  199. package/dist/webui/assets/index-pT0W4KjK.js +0 -47
  200. package/dist/webui/assets/index-pT0W4KjK.js.map +0 -1
  201. package/dist/webui/assets/index-wvielV9A.js +0 -2
  202. package/dist/webui/assets/index-wvielV9A.js.map +0 -1
  203. package/dist/webui/assets/row-FRqVdQDX.js +0 -20
  204. package/dist/webui/assets/row-FRqVdQDX.js.map +0 -1
  205. package/dist/webui/assets/useAuth-BMt6dHSB.js +0 -9
  206. package/dist/webui/assets/useAuth-BMt6dHSB.js.map +0 -1
  207. package/dist/webui/assets/useConfig-29Ugtjk4.js +0 -9
  208. package/dist/webui/assets/useConfig-29Ugtjk4.js.map +0 -1
  209. package/dist/webui/assets/useDownload-Dt6lsP8S.js +0 -2
  210. package/dist/webui/assets/useDownload-Dt6lsP8S.js.map +0 -1
  211. package/dist/webui/assets/useErrorHandler-DWHs3RlU.js +0 -84
  212. package/dist/webui/assets/useErrorHandler-DWHs3RlU.js.map +0 -1
  213. package/dist/webui/index.html +0 -15
@@ -1,2 +0,0 @@
1
- import{t as P,v as W,y as j,z as d,ab as H,H as T,r as c,m as D}from"./index-BFgUdwJv.js";const G=e=>{const{componentCls:t}=e;return{[t]:{"&-horizontal":{[`&${t}`]:{"&-sm":{marginBlock:e.marginXS},"&-md":{marginBlock:e.margin}}}}}},A=e=>{const{componentCls:t,sizePaddingEdgeHorizontal:o,colorSplit:r,lineWidth:n,textPaddingInline:g,orientationMargin:l,verticalMarginInline:s}=e;return{[t]:Object.assign(Object.assign({},j(e)),{borderBlockStart:`${d(n)} solid ${r}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:s,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${d(n)} solid ${r}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${d(e.marginLG)} 0`},[`&-horizontal${t}-with-text`]:{display:"flex",alignItems:"center",margin:`${d(e.dividerHorizontalWithTextGutterMargin)} 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${r}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${d(n)} solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${t}-with-text-start`]:{"&::before":{width:`calc(${l} * 100%)`},"&::after":{width:`calc(100% - ${l} * 100%)`}},[`&-horizontal${t}-with-text-end`]:{"&::before":{width:`calc(100% - ${l} * 100%)`},"&::after":{width:`calc(${l} * 100%)`}},[`${t}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:g},"&-dashed":{background:"none",borderColor:r,borderStyle:"dashed",borderWidth:`${d(n)} 0 0`},[`&-horizontal${t}-with-text${t}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${t}-dashed`]:{borderInlineStartWidth:n,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},"&-dotted":{background:"none",borderColor:r,borderStyle:"dotted",borderWidth:`${d(n)} 0 0`},[`&-horizontal${t}-with-text${t}-dotted`]:{"&::before, &::after":{borderStyle:"dotted none none"}},[`&-vertical${t}-dotted`]:{borderInlineStartWidth:n,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${t}-with-text`]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},[`&-horizontal${t}-with-text-start${t}-no-default-orientation-margin-start`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${t}-inner-text`]:{paddingInlineStart:o}},[`&-horizontal${t}-with-text-end${t}-no-default-orientation-margin-end`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${t}-inner-text`]:{paddingInlineEnd:o}}})}},L=e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}),V=P("Divider",e=>{const t=W(e,{dividerHorizontalWithTextGutterMargin:e.margin,sizePaddingEdgeHorizontal:0});return[A(t),G(t)]},L,{unitless:{orientationMargin:!0}});var X=function(e,t){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(o[r[n]]=e[r[n]]);return o};const _={small:"sm",middle:"md"},Y=e=>{const{getPrefixCls:t,direction:o,className:r,style:n}=H("divider"),{prefixCls:g,type:l="horizontal",orientation:s="center",orientationMargin:a,className:x,rootClassName:y,children:h,dashed:z,variant:b="solid",plain:v,style:w,size:C}=e,I=X(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","variant","plain","style","size"]),i=t("divider",g),[O,M,E]=V(i),B=T(C),f=_[B],$=!!h,m=c.useMemo(()=>s==="left"?o==="rtl"?"end":"start":s==="right"?o==="rtl"?"start":"end":s,[o,s]),p=m==="start"&&a!=null,S=m==="end"&&a!=null,N=D(i,r,M,E,`${i}-${l}`,{[`${i}-with-text`]:$,[`${i}-with-text-${m}`]:$,[`${i}-dashed`]:!!z,[`${i}-${b}`]:b!=="solid",[`${i}-plain`]:!!v,[`${i}-rtl`]:o==="rtl",[`${i}-no-default-orientation-margin-start`]:p,[`${i}-no-default-orientation-margin-end`]:S,[`${i}-${f}`]:!!f},x,y),u=c.useMemo(()=>typeof a=="number"?a:/^\d+$/.test(a)?Number(a):a,[a]),k={marginInlineStart:p?u:void 0,marginInlineEnd:S?u:void 0};return O(c.createElement("div",Object.assign({className:N,style:Object.assign(Object.assign({},n),w)},I,{role:"separator"}),h&&l!=="vertical"&&c.createElement("span",{className:`${i}-inner-text`,style:k},h)))};export{Y as D};
2
- //# sourceMappingURL=index-CN3FylAF.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-CN3FylAF.js","sources":["../../node_modules/antd/es/divider/style/index.js","../../node_modules/antd/es/divider/index.js"],"sourcesContent":["import { unit } from '@ant-design/cssinjs';\nimport { resetComponent } from '../../style';\nimport { genStyleHooks, mergeToken } from '../../theme/internal';\n// ============================== Size ================================\nconst genSizeDividerStyle = token => {\n const {\n componentCls\n } = token;\n return {\n [componentCls]: {\n '&-horizontal': {\n [`&${componentCls}`]: {\n '&-sm': {\n marginBlock: token.marginXS\n },\n '&-md': {\n marginBlock: token.margin\n }\n }\n }\n }\n };\n};\n// ============================== Shared ==============================\nconst genSharedDividerStyle = token => {\n const {\n componentCls,\n sizePaddingEdgeHorizontal,\n colorSplit,\n lineWidth,\n textPaddingInline,\n orientationMargin,\n verticalMarginInline\n } = token;\n return {\n [componentCls]: Object.assign(Object.assign({}, resetComponent(token)), {\n borderBlockStart: `${unit(lineWidth)} solid ${colorSplit}`,\n // vertical\n '&-vertical': {\n position: 'relative',\n top: '-0.06em',\n display: 'inline-block',\n height: '0.9em',\n marginInline: verticalMarginInline,\n marginBlock: 0,\n verticalAlign: 'middle',\n borderTop: 0,\n borderInlineStart: `${unit(lineWidth)} solid ${colorSplit}`\n },\n '&-horizontal': {\n display: 'flex',\n clear: 'both',\n width: '100%',\n minWidth: '100%',\n // Fix https://github.com/ant-design/ant-design/issues/10914\n margin: `${unit(token.marginLG)} 0`\n },\n [`&-horizontal${componentCls}-with-text`]: {\n display: 'flex',\n alignItems: 'center',\n margin: `${unit(token.dividerHorizontalWithTextGutterMargin)} 0`,\n color: token.colorTextHeading,\n fontWeight: 500,\n fontSize: token.fontSizeLG,\n whiteSpace: 'nowrap',\n textAlign: 'center',\n borderBlockStart: `0 ${colorSplit}`,\n '&::before, &::after': {\n position: 'relative',\n width: '50%',\n borderBlockStart: `${unit(lineWidth)} solid transparent`,\n // Chrome not accept `inherit` in `border-top`\n borderBlockStartColor: 'inherit',\n borderBlockEnd: 0,\n transform: 'translateY(50%)',\n content: \"''\"\n }\n },\n [`&-horizontal${componentCls}-with-text-start`]: {\n '&::before': {\n width: `calc(${orientationMargin} * 100%)`\n },\n '&::after': {\n width: `calc(100% - ${orientationMargin} * 100%)`\n }\n },\n [`&-horizontal${componentCls}-with-text-end`]: {\n '&::before': {\n width: `calc(100% - ${orientationMargin} * 100%)`\n },\n '&::after': {\n width: `calc(${orientationMargin} * 100%)`\n }\n },\n [`${componentCls}-inner-text`]: {\n display: 'inline-block',\n paddingBlock: 0,\n paddingInline: textPaddingInline\n },\n '&-dashed': {\n background: 'none',\n borderColor: colorSplit,\n borderStyle: 'dashed',\n borderWidth: `${unit(lineWidth)} 0 0`\n },\n [`&-horizontal${componentCls}-with-text${componentCls}-dashed`]: {\n '&::before, &::after': {\n borderStyle: 'dashed none none'\n }\n },\n [`&-vertical${componentCls}-dashed`]: {\n borderInlineStartWidth: lineWidth,\n borderInlineEnd: 0,\n borderBlockStart: 0,\n borderBlockEnd: 0\n },\n '&-dotted': {\n background: 'none',\n borderColor: colorSplit,\n borderStyle: 'dotted',\n borderWidth: `${unit(lineWidth)} 0 0`\n },\n [`&-horizontal${componentCls}-with-text${componentCls}-dotted`]: {\n '&::before, &::after': {\n borderStyle: 'dotted none none'\n }\n },\n [`&-vertical${componentCls}-dotted`]: {\n borderInlineStartWidth: lineWidth,\n borderInlineEnd: 0,\n borderBlockStart: 0,\n borderBlockEnd: 0\n },\n [`&-plain${componentCls}-with-text`]: {\n color: token.colorText,\n fontWeight: 'normal',\n fontSize: token.fontSize\n },\n [`&-horizontal${componentCls}-with-text-start${componentCls}-no-default-orientation-margin-start`]: {\n '&::before': {\n width: 0\n },\n '&::after': {\n width: '100%'\n },\n [`${componentCls}-inner-text`]: {\n paddingInlineStart: sizePaddingEdgeHorizontal\n }\n },\n [`&-horizontal${componentCls}-with-text-end${componentCls}-no-default-orientation-margin-end`]: {\n '&::before': {\n width: '100%'\n },\n '&::after': {\n width: 0\n },\n [`${componentCls}-inner-text`]: {\n paddingInlineEnd: sizePaddingEdgeHorizontal\n }\n }\n })\n };\n};\nexport const prepareComponentToken = token => ({\n textPaddingInline: '1em',\n orientationMargin: 0.05,\n verticalMarginInline: token.marginXS\n});\n// ============================== Export ==============================\nexport default genStyleHooks('Divider', token => {\n const dividerToken = mergeToken(token, {\n dividerHorizontalWithTextGutterMargin: token.margin,\n sizePaddingEdgeHorizontal: 0\n });\n return [genSharedDividerStyle(dividerToken), genSizeDividerStyle(dividerToken)];\n}, prepareComponentToken, {\n unitless: {\n orientationMargin: true\n }\n});","\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { devUseWarning } from '../_util/warning';\nimport { useComponentConfig } from '../config-provider/context';\nimport useSize from '../config-provider/hooks/useSize';\nimport useStyle from './style';\nconst sizeClassNameMap = {\n small: 'sm',\n middle: 'md'\n};\nconst Divider = props => {\n const {\n getPrefixCls,\n direction,\n className: dividerClassName,\n style: dividerStyle\n } = useComponentConfig('divider');\n const {\n prefixCls: customizePrefixCls,\n type = 'horizontal',\n orientation = 'center',\n orientationMargin,\n className,\n rootClassName,\n children,\n dashed,\n variant = 'solid',\n plain,\n style,\n size: customSize\n } = props,\n restProps = __rest(props, [\"prefixCls\", \"type\", \"orientation\", \"orientationMargin\", \"className\", \"rootClassName\", \"children\", \"dashed\", \"variant\", \"plain\", \"style\", \"size\"]);\n const prefixCls = getPrefixCls('divider', customizePrefixCls);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n const sizeFullName = useSize(customSize);\n const sizeCls = sizeClassNameMap[sizeFullName];\n const hasChildren = !!children;\n const mergedOrientation = React.useMemo(() => {\n if (orientation === 'left') {\n return direction === 'rtl' ? 'end' : 'start';\n }\n if (orientation === 'right') {\n return direction === 'rtl' ? 'start' : 'end';\n }\n return orientation;\n }, [direction, orientation]);\n const hasMarginStart = mergedOrientation === 'start' && orientationMargin != null;\n const hasMarginEnd = mergedOrientation === 'end' && orientationMargin != null;\n const classString = classNames(prefixCls, dividerClassName, hashId, cssVarCls, `${prefixCls}-${type}`, {\n [`${prefixCls}-with-text`]: hasChildren,\n [`${prefixCls}-with-text-${mergedOrientation}`]: hasChildren,\n [`${prefixCls}-dashed`]: !!dashed,\n [`${prefixCls}-${variant}`]: variant !== 'solid',\n [`${prefixCls}-plain`]: !!plain,\n [`${prefixCls}-rtl`]: direction === 'rtl',\n [`${prefixCls}-no-default-orientation-margin-start`]: hasMarginStart,\n [`${prefixCls}-no-default-orientation-margin-end`]: hasMarginEnd,\n [`${prefixCls}-${sizeCls}`]: !!sizeCls\n }, className, rootClassName);\n const memoizedOrientationMargin = React.useMemo(() => {\n if (typeof orientationMargin === 'number') {\n return orientationMargin;\n }\n if (/^\\d+$/.test(orientationMargin)) {\n return Number(orientationMargin);\n }\n return orientationMargin;\n }, [orientationMargin]);\n const innerStyle = {\n marginInlineStart: hasMarginStart ? memoizedOrientationMargin : undefined,\n marginInlineEnd: hasMarginEnd ? memoizedOrientationMargin : undefined\n };\n // Warning children not work in vertical mode\n if (process.env.NODE_ENV !== 'production') {\n const warning = devUseWarning('Divider');\n process.env.NODE_ENV !== \"production\" ? warning(!children || type !== 'vertical', 'usage', '`children` not working in `vertical` mode.') : void 0;\n }\n return wrapCSSVar(/*#__PURE__*/React.createElement(\"div\", Object.assign({\n className: classString,\n style: Object.assign(Object.assign({}, dividerStyle), style)\n }, restProps, {\n role: \"separator\"\n }), children && type !== 'vertical' && (/*#__PURE__*/React.createElement(\"span\", {\n className: `${prefixCls}-inner-text`,\n style: innerStyle\n }, children))));\n};\nif (process.env.NODE_ENV !== 'production') {\n Divider.displayName = 'Divider';\n}\nexport default Divider;"],"names":["genSizeDividerStyle","token","componentCls","genSharedDividerStyle","sizePaddingEdgeHorizontal","colorSplit","lineWidth","textPaddingInline","orientationMargin","verticalMarginInline","resetComponent","unit","prepareComponentToken","useStyle","genStyleHooks","dividerToken","mergeToken","__rest","s","e","t","p","i","sizeClassNameMap","Divider","props","getPrefixCls","direction","dividerClassName","dividerStyle","useComponentConfig","customizePrefixCls","type","orientation","className","rootClassName","children","dashed","variant","plain","style","customSize","restProps","prefixCls","wrapCSSVar","hashId","cssVarCls","sizeFullName","useSize","sizeCls","hasChildren","mergedOrientation","React.useMemo","hasMarginStart","hasMarginEnd","classString","classNames","memoizedOrientationMargin","innerStyle","React.createElement"],"mappings":"0FAIA,MAAMA,EAAsBC,GAAS,CACnC,KAAM,CACJ,aAAAC,CACJ,EAAMD,EACJ,MAAO,CACL,CAACC,CAAY,EAAG,CACd,eAAgB,CACd,CAAC,IAAIA,CAAY,EAAE,EAAG,CACpB,OAAQ,CACN,YAAaD,EAAM,QAC/B,EACU,OAAQ,CACN,YAAaA,EAAM,MAC/B,CACA,CACA,CACA,CACA,CACA,EAEME,EAAwBF,GAAS,CACrC,KAAM,CACJ,aAAAC,EACA,0BAAAE,EACA,WAAAC,EACA,UAAAC,EACA,kBAAAC,EACA,kBAAAC,EACA,qBAAAC,CACJ,EAAMR,EACJ,MAAO,CACL,CAACC,CAAY,EAAG,OAAO,OAAO,OAAO,OAAO,GAAIQ,EAAeT,CAAK,CAAC,EAAG,CACtE,iBAAkB,GAAGU,EAAKL,CAAS,CAAC,UAAUD,CAAU,GAExD,aAAc,CACZ,SAAU,WACV,IAAK,UACL,QAAS,eACT,OAAQ,QACR,aAAcI,EACd,YAAa,EACb,cAAe,SACf,UAAW,EACX,kBAAmB,GAAGE,EAAKL,CAAS,CAAC,UAAUD,CAAU,EACjE,EACM,eAAgB,CACd,QAAS,OACT,MAAO,OACP,MAAO,OACP,SAAU,OAEV,OAAQ,GAAGM,EAAKV,EAAM,QAAQ,CAAC,IACvC,EACM,CAAC,eAAeC,CAAY,YAAY,EAAG,CACzC,QAAS,OACT,WAAY,SACZ,OAAQ,GAAGS,EAAKV,EAAM,qCAAqC,CAAC,KAC5D,MAAOA,EAAM,iBACb,WAAY,IACZ,SAAUA,EAAM,WAChB,WAAY,SACZ,UAAW,SACX,iBAAkB,KAAKI,CAAU,GACjC,sBAAuB,CACrB,SAAU,WACV,MAAO,MACP,i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,CAAC,CAACA,CAAA,EAC9Bf,EAAWC,CAAa,EACrBsB,EAA4BL,EAAAA,QAAc,IAC1C,OAAO5C,GAAsB,SACxBA,EAEL,QAAQ,KAAKA,CAAiB,EACzB,OAAOA,CAAiB,EAE1BA,EACN,CAACA,CAAiB,CAAC,EAChBkD,EAAa,CACjB,kBAAmBL,EAAiBI,EAA4B,OAChE,gBAAiBH,EAAeG,EAA4B,MAAA,EAO9D,OAAOb,EAAwBe,EAAAA,cAAoB,MAAO,OAAO,OAAO,CACtE,UAAWJ,EACX,MAAO,OAAO,OAAO,OAAO,OAAO,CAAA,EAAI1B,CAAY,EAAGW,CAAK,CAAA,EAC1DE,EAAW,CACZ,KAAM,WAAA,CACP,EAAGN,GAAYJ,IAAS,YAA4B2B,EAAAA,cAAoB,OAAQ,CAC/E,UAAW,GAAGhB,CAAS,cACvB,MAAOe,CAAA,EACNtB,CAAQ,CAAE,CAAC,CAChB","x_google_ignoreList":[0,1]}
@@ -1,2 +0,0 @@
1
- import{r as a,I as O,_ as B,s as t,T as Y,Q as R,a as P,b as z,ah as J,u as H,bI as _,j as e,V as K,Y as $,B as D,bJ as X,R as Z,S as ee}from"./index-BFgUdwJv.js";import{e as N,t as U,R as M}from"./errorCodeTranslator-DWsWq6B3.js";import{u as te,F as E}from"./useAuth-BMt6dHSB.js";import{a as ne}from"./row-FRqVdQDX.js";import{T as W}from"./index-pT0W4KjK.js";import{R as C}from"./CheckCircleOutlined-Can0-7ew.js";import{S as oe,R as re}from"./ThunderboltOutlined-CiiB2de5.js";import{I as ie}from"./index-Dycn6xoz.js";import{D as q}from"./index-CN3FylAF.js";var se={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5l-41.1 41.1-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-65.3 65.3a8.03 8.03 0 000 11.3l42.3 42.3c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.06 304.06 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112zm161.2 465.2C726.2 620.3 668.9 644 608 644c-60.9 0-118.2-23.7-161.2-66.8-43.1-43-66.8-100.3-66.8-161.2 0-60.9 23.7-118.2 66.8-161.2 43-43.1 100.3-66.8 161.2-66.8 60.9 0 118.2 23.7 161.2 66.8 43.1 43 66.8 100.3 66.8 161.2 0 60.9-23.7 118.2-66.8 161.2z"}}]},name:"key",theme:"outlined"},ae=function(c,s){return a.createElement(O,B({},c,{ref:s,icon:se}))},V=a.forwardRef(ae),ce={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 736c0-111.6-65.4-208-160-252.9V317.3c0-15.1-5.3-29.7-15.1-41.2L536.5 95.4C530.1 87.8 521 84 512 84s-18.1 3.8-24.5 11.4L335.1 276.1a63.97 63.97 0 00-15.1 41.2v165.8C225.4 528 160 624.4 160 736h156.5c-2.3 7.2-3.5 15-3.5 23.8 0 22.1 7.6 43.7 21.4 60.8a97.2 97.2 0 0043.1 30.6c23.1 54 75.6 88.8 134.5 88.8 29.1 0 57.3-8.6 81.4-24.8 23.6-15.8 41.9-37.9 53-64a97 97 0 0043.1-30.5 97.52 97.52 0 0021.4-60.8c0-8.4-1.1-16.4-3.1-23.8H864zM762.3 621.4c9.4 14.6 17 30.3 22.5 46.6H700V558.7a211.6 211.6 0 0162.3 62.7zM388 483.1V318.8l124-147 124 147V668H388V483.1zM239.2 668c5.5-16.3 13.1-32 22.5-46.6 16.3-25.2 37.5-46.5 62.3-62.7V668h-84.8zm388.9 116.2c-5.2 3-11.2 4.2-17.1 3.4l-19.5-2.4-2.8 19.4c-5.4 37.9-38.4 66.5-76.7 66.5-38.3 0-71.3-28.6-76.7-66.5l-2.8-19.5-19.5 2.5a27.7 27.7 0 01-17.1-3.5c-8.7-5-14.1-14.3-14.1-24.4 0-10.6 5.9-19.4 14.6-23.8h231.3c8.8 4.5 14.6 13.3 14.6 23.8-.1 10.2-5.5 19.6-14.2 24.5zM464 400a48 48 0 1096 0 48 48 0 10-96 0z"}}]},name:"rocket",theme:"outlined"},le=function(c,s){return a.createElement(O,B({},c,{ref:s,icon:ce}))},ge=a.forwardRef(le),de={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64L128 192v384c0 212.1 171.9 384 384 384s384-171.9 384-384V192L512 64zm312 512c0 172.3-139.7 312-312 312S200 748.3 200 576V246l312-110 312 110v330z"}},{tag:"path",attrs:{d:"M378.4 475.1a35.91 35.91 0 00-50.9 0 35.91 35.91 0 000 50.9l129.4 129.4 2.1 2.1a33.98 33.98 0 0048.1 0L730.6 434a33.98 33.98 0 000-48.1l-2.8-2.8a33.98 33.98 0 00-48.1 0L483 579.7 378.4 475.1z"}}]},name:"safety",theme:"outlined"},ue=function(c,s){return a.createElement(O,B({},c,{ref:s,icon:de}))},G=a.forwardRef(ue);const fe=600*1e3;function he({enabled:n,onAuthenticated:c,refetchAuthStatus:s,isAuthenticated:l}){const o=a.useRef(null),r=a.useRef(null),i=a.useCallback(()=>{o.current&&(clearInterval(o.current),o.current=null),r.current=null},[]);return a.useEffect(()=>(n?(r.current||(r.current=Date.now(),console.log("[LoginPolling] Starting polling for interactive login...")),o.current||(o.current=setInterval(async()=>{try{if(r.current&&Date.now()-r.current>fe){console.log("[LoginPolling] Polling timeout reached, stopping..."),i(),t.warning("登录超时,请重试");return}console.log("[LoginPolling] Polling auth status...");const h=await s();l(h)&&(console.log("[LoginPolling] Authentication detected via polling!"),i(),c())}catch(h){console.error("[LoginPolling] Polling error:",h)}},2e3))):i(),()=>{i()}),[n,s,l,c,i]),{stopPolling:i}}function xe({onLoginSuccess:n,refetchAuthStatus:c,isAuthenticated:s,startPolling:l,stopPolling:o}){const r=Y(),i=a.useRef(!1),h=a.useCallback(async()=>{o(),i.current=!1,t.loading({content:"✅ 登录成功,正在验证登录状态...",key:"login-success",duration:0}),r.invalidateQueries({queryKey:R.AUTH_STATUS}),r.invalidateQueries({queryKey:R.CONFIG}),await new Promise(u=>setTimeout(u,1e3));let f=!1;const x=3;for(let u=0;u<x;u++)try{const w=await c();if(console.log(`[InteractiveLogin] Auth status check (attempt ${u+1}/${x}):`,w),s(w)){f=!0,console.log("[InteractiveLogin] Authentication confirmed");break}u<x-1&&await new Promise(p=>setTimeout(p,500))}catch(w){console.error(`[InteractiveLogin] Auth status check error (attempt ${u+1}/${x}):`,w),u<x-1&&await new Promise(p=>setTimeout(p,500))}t.destroy("login-success"),f?(console.log("[InteractiveLogin] Authentication confirmed, navigating to dashboard..."),t.success("✅ 登录成功!正在跳转到 Dashboard...",2),await new Promise(u=>setTimeout(u,800)),window.location.href="/dashboard"):(console.warn("[InteractiveLogin] Auth status not confirmed after retries"),t.warning('登录状态验证失败,请手动刷新页面或点击"检查登录状态"按钮',4)),n?.()},[o,r,c,s,n]);a.useEffect(()=>{if(!(typeof window<"u"&&window.electron)||!window.electron?.onLoginSuccess)return;console.log("[InteractiveLogin] Registering IPC event listeners for Electron login...");const x=async g=>{console.log("[InteractiveLogin] Received login-success event from Electron:",g);try{o(),i.current=!1,g.refreshToken?(console.log("[InteractiveLogin] RefreshToken received from Electron"),t.loading({content:"✅ 已获取授权码,正在交换 Token...",key:"login-progress",duration:0}),await new Promise(d=>setTimeout(d,500)),t.loading({content:"✅ Token 交换成功,正在保存到后端配置...",key:"login-progress",duration:0}),await new Promise(d=>setTimeout(d,1e3)),t.loading({content:"✅ Token 已保存,正在验证登录状态...",key:"login-progress",duration:0})):t.loading({content:"✅ 登录成功,正在验证登录状态...",key:"login-progress",duration:0}),r.invalidateQueries({queryKey:R.AUTH_STATUS}),r.invalidateQueries({queryKey:R.CONFIG}),await new Promise(d=>setTimeout(d,1e3));let m=!1;const b=3;for(let d=0;d<b;d++)try{const S=await c();if(console.log(`[InteractiveLogin] Auth status check (attempt ${d+1}/${b}):`,S),s(S)){m=!0,console.log("[InteractiveLogin] Authentication confirmed");break}d<b-1&&await new Promise(A=>setTimeout(A,500))}catch(S){console.error(`[InteractiveLogin] Auth status check error (attempt ${d+1}/${b}):`,S),d<b-1&&await new Promise(A=>setTimeout(A,500))}t.destroy("login-progress"),m?(console.log("[InteractiveLogin] Authentication confirmed, navigating to dashboard..."),t.success("✅ 登录成功!正在跳转到 Dashboard...",2),await new Promise(d=>setTimeout(d,800)),window.location.href="/dashboard"):g.refreshToken?(console.warn("[InteractiveLogin] Has token but auth status not confirmed, attempting navigation..."),t.warning("登录状态验证失败,但将尝试跳转...",3),await new Promise(d=>setTimeout(d,1e3)),window.location.href="/dashboard"):(console.error("[InteractiveLogin] Authentication not confirmed after retries"),t.warning('登录成功,但状态验证失败。请手动刷新页面或点击"检查登录状态"按钮。',4))}catch(m){const b=m instanceof Error?m.message:"未知错误";console.error("[InteractiveLogin] Error handling login-success event:",m),t.destroy("login-progress"),t.error("处理登录成功事件时出错: "+b,4)}},u=g=>{console.error("[InteractiveLogin] Received login-error event from Electron:",g),o(),i.current=!1;const m=g.message||"未知错误";t.error("登录失败: "+m,4)},w=window.electron.onLoginSuccess(x),p=window.electron.onLoginError(u);return()=>{console.log("[InteractiveLogin] Cleaning up IPC event listeners..."),w&&typeof w=="function"&&w(),p&&typeof p=="function"&&p()}},[r,c,s,o]);const k=a.useCallback(async f=>{if(typeof window<"u"&&window.electron&&window.electron?.openLoginWindow){console.log("[InteractiveLogin] Using Electron system browser login...");try{t.info("正在打开系统浏览器进行登录...",3),i.current=!0,l();const g=await window.electron.openLoginWindow();if(!g.success){if(g.cancelled){o(),i.current=!1,t.info("登录已取消",2);return}throw new Error(g.error||"无法打开登录窗口")}console.log("[InteractiveLogin] Login window opened, waiting for login-success or login-error event..."),t.info("请在浏览器中完成登录,系统会自动检测登录状态...",5)}catch(g){const m=g instanceof Error?g.message:"未知错误";console.error("[InteractiveLogin] Failed to open Electron login window:",g),t.error("无法打开登录窗口: "+m,4),o(),i.current=!1}return}const u="",w="",p=f?.data?.data?.network?.proxy?.enabled?f.data.data.network.proxy:void 0;o(),i.current=!0,l(),console.log("[InteractiveLogin] Starting interactive login via backend API, polling will begin...");try{await P.login(u,w,!1,p)}catch(g){const m=g;if(m?.code==="ECONNABORTED"||m?.message?.includes("timeout")){console.log("[InteractiveLogin] Interactive login API timeout, but continuing to poll for status..."),t.info("正在等待浏览器登录完成,系统会自动检测登录状态...",5);return}o(),i.current=!1;const d=m?.message||(g instanceof Error?g.message:"未知错误");throw new Error(d)}},[l,o]),j=a.useCallback(async()=>{try{t.loading({content:"正在检查登录状态...",key:"checkStatus",duration:0});const f=await c();t.destroy("checkStatus"),s(f)?(t.success("✅ 已登录,正在跳转...",2),h()):(t.info("尚未登录,请完成浏览器中的登录流程。系统会自动检测登录状态。",4),i.current||(i.current=!0,l()))}catch(f){t.destroy("checkStatus");const x=f instanceof Error?f.message:"未知错误";t.error("检查登录状态失败: "+x,4),console.error("[InteractiveLogin] Manual status check error:",f)}},[c,s,h,l]);return{handleInteractiveLogin:k,handleCheckStatus:j,isActive:i.current}}function me(){const{t:n}=z(),c=J(),[s,l]=a.useState("interactive"),[o,r]=a.useState(0),[i,h]=a.useState(!1),{data:k,isLoading:j,refetch:f}=H({queryKey:R.AUTH_STATUS,queryFn:()=>P.getAuthStatus(),retry:!1,refetchInterval:!1}),{data:x}=H({queryKey:R.CONFIG,queryFn:()=>P.getConfig()}),{loginWithTokenAsync:u,isLoggingInWithToken:w}=te(),p=a.useCallback(I=>{const v=_(I);return console.log("[Login] Auth check:",{authenticated:v,response:I}),v},[_]),g=a.useCallback(async()=>{h(!1),r(2),t.loading({content:"✅ 登录成功,正在验证登录状态...",key:"login-success",duration:0}),await new Promise(y=>setTimeout(y,1e3));let I=!1;const v=3;for(let y=0;y<v;y++)try{const L=await f();if(console.log(`[Login] Auth status check (attempt ${y+1}/${v}):`,L),p(L)){I=!0,console.log("[Login] Authentication confirmed");break}y<v-1&&await new Promise(T=>setTimeout(T,500))}catch(L){console.error(`[Login] Auth status check error (attempt ${y+1}/${v}):`,L),y<v-1&&await new Promise(T=>setTimeout(T,500))}t.destroy("login-success"),I?(console.log("[Login] Authentication confirmed, navigating to dashboard..."),t.success("✅ 登录成功!正在跳转到 Dashboard...",2),await new Promise(y=>setTimeout(y,800)),window.location.href="/dashboard"):(console.warn("[Login] Auth status not confirmed after retries"),t.warning('登录状态验证失败,请手动刷新页面或点击"检查登录状态"按钮',4))},[f,p]),m=a.useCallback(()=>{h(!0)},[]),b=a.useCallback(()=>{h(!1)},[]),d=a.useCallback(async()=>await f(),[f]);he({enabled:i,onAuthenticated:()=>{g()},refetchAuthStatus:d,isAuthenticated:p});const{handleInteractiveLogin:S,handleCheckStatus:A}=xe({onLoginSuccess:()=>r(2),refetchAuthStatus:d,isAuthenticated:p,startPolling:m,stopPolling:b}),Q=a.useCallback(async I=>{if(r(1),s==="token"){const v=I?.refreshToken;if(!v||v.trim()===""){t.error("请输入 refreshToken"),r(0);return}try{await u(v.trim()),g()}catch(y){const{errorCode:L,message:T}=N(y);r(0),L?t.error(U(L,n,void 0,T||n("AUTH_LOGIN_FAILED"))):t.error(T||n("AUTH_LOGIN_FAILED"))}return}try{await S(x)}catch(v){const{errorCode:y,message:L}=N(v);r(0),y?t.error(U(y,n,void 0,L||n("AUTH_LOGIN_FAILED"))):t.error(L||n("AUTH_LOGIN_FAILED"))}},[s,u,g,S,x,n]);return{loginMode:s,loginStep:o,isLoggingIn:i||o===1,isLoggingInWithToken:w,authStatusLoading:j,authStatus:k,isAuthenticated:p,setLoginMode:l,handleLogin:Q,handleCheckStatus:A,navigate:c}}function pe({children:n}){return e.jsxs("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",padding:"20px",position:"relative",overflow:"hidden"},children:[e.jsx("div",{style:{position:"absolute",top:"-10%",right:"-5%",width:"500px",height:"500px",borderRadius:"50%",background:"rgba(255, 255, 255, 0.1)",filter:"blur(60px)"}}),e.jsx("div",{style:{position:"absolute",bottom:"-10%",left:"-5%",width:"400px",height:"400px",borderRadius:"50%",background:"rgba(255, 255, 255, 0.1)",filter:"blur(60px)"}}),e.jsx(ne,{style:{width:"100%",maxWidth:480,boxShadow:"0 20px 60px rgba(0,0,0,0.3)",borderRadius:"16px",position:"relative",zIndex:1},children:n})]})}const{Title:ye,Text:ve}=W;function we(){const{t:n}=z();return e.jsxs("div",{style:{textAlign:"center",marginBottom:8},children:[e.jsx("div",{style:{width:"80px",height:"80px",margin:"0 auto 16px",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",borderRadius:"20px",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 8px 16px rgba(102, 126, 234, 0.4)"},children:e.jsx(ge,{style:{fontSize:"40px",color:"white"}})}),e.jsx(ye,{level:2,style:{margin:"0 0 8px 0",fontSize:"28px",fontWeight:700},children:"PixivFlow"}),e.jsx(ve,{type:"secondary",style:{fontSize:"15px"},children:n("login.subtitle")})]})}const{Text:F}=W;function be(){return e.jsx("div",{style:{background:"linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%)",padding:"16px",borderRadius:"12px",marginBottom:8},children:e.jsxs(K,{direction:"vertical",size:"small",style:{width:"100%"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[e.jsx(C,{style:{color:"#52c41a",fontSize:"16px"}}),e.jsx(F,{style:{fontSize:"13px"},children:"安全的 OAuth 认证流程"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[e.jsx(C,{style:{color:"#52c41a",fontSize:"16px"}}),e.jsx(F,{style:{fontSize:"13px"},children:"自动保存登录凭证"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[e.jsx(C,{style:{color:"#52c41a",fontSize:"16px"}}),e.jsx(F,{style:{fontSize:"13px"},children:"支持多种登录方式"})]})]})})}function Le({current:n}){return e.jsx(oe,{current:n,size:"small",items:[{title:"选择模式",icon:e.jsx(G,{})},{title:"认证中",icon:e.jsx(re,{})},{title:"完成",icon:e.jsx(C,{})}],style:{marginBottom:8}})}function ke({value:n,onChange:c,onResetFields:s}){const{t:l}=z();return e.jsxs(e.Fragment,{children:[e.jsx(E.Item,{label:e.jsx("span",{style:{fontSize:"15px",fontWeight:600},children:l("login.loginMode")}),style:{marginBottom:20},children:e.jsxs(M.Group,{value:n,onChange:o=>{c(o.target.value),setTimeout(()=>{s()},0)},buttonStyle:"solid",style:{width:"100%",display:"flex",flexWrap:"wrap",gap:"8px"},children:[e.jsxs(M.Button,{value:"interactive",style:{flex:1,minWidth:"120px",textAlign:"center",height:"48px",lineHeight:"48px",fontSize:"14px",fontWeight:500},children:[e.jsx(G,{})," ",l("login.loginModeInteractive")]}),e.jsxs(M.Button,{value:"token",style:{flex:1,minWidth:"120px",textAlign:"center",height:"48px",lineHeight:"48px",fontSize:"14px",fontWeight:500},children:[e.jsx(V,{})," Token 登录"]})]})}),n==="interactive"&&e.jsx($,{message:e.jsx("span",{style:{fontWeight:600},children:l("login.loginModeInteractive")}),description:e.jsxs("div",{style:{fontSize:"13px"},children:[e.jsx("div",{style:{marginBottom:8},children:l("login.loginModeInteractiveDesc")}),e.jsx("div",{style:{padding:"8px 12px",background:"rgba(24, 144, 255, 0.1)",borderRadius:"6px",borderLeft:"3px solid #1890ff"},children:l("login.browserWindowNote")})]}),type:"info",showIcon:!0,style:{marginBottom:20}}),n==="token"&&e.jsx($,{message:e.jsx("span",{style:{fontWeight:600},children:"Token 登录"}),description:e.jsxs("div",{style:{fontSize:"13px"},children:[e.jsx("div",{style:{marginBottom:8},children:"如果您已经有 Pixiv 的 refreshToken,可以直接粘贴使用。系统会自动验证并保存。"}),e.jsxs("div",{style:{padding:"8px 12px",background:"rgba(82, 196, 26, 0.1)",borderRadius:"6px",borderLeft:"3px solid #52c41a"},children:[e.jsx("strong",{children:"提示:"}),"refreshToken 可以从浏览器开发者工具中获取,或从其他已登录的配置文件中复制。"]})]}),type:"success",showIcon:!0,style:{marginBottom:20}})]})}function Ie({loginMode:n,isLoggingIn:c,isLoggingInWithToken:s,onLogin:l,onCheckStatus:o}){const{t:r}=z(),[i]=E.useForm(),h=c||s,k=()=>{n==="token"?i.validateFields(["refreshToken"]).then(()=>{const j=i.getFieldsValue();l(j)}).catch(()=>{}):l()};return e.jsxs(E,{form:i,name:"login",onFinish:k,layout:"vertical",size:"large",autoComplete:"off",children:[n==="token"&&e.jsx(E.Item,{name:"refreshToken",label:e.jsxs("span",{style:{fontSize:"14px",fontWeight:500},children:[e.jsx(V,{style:{marginRight:8}})," Refresh Token"]}),rules:[{required:!0,message:"请输入 refreshToken"},{min:10,message:"refreshToken 格式不正确"}],children:e.jsx(ie.TextArea,{placeholder:"粘贴您的 refreshToken here...",autoSize:{minRows:3,maxRows:6},style:{fontSize:"14px",fontFamily:"monospace"}})}),e.jsx(E.Item,{style:{marginBottom:16},children:e.jsx(D,{type:"primary",htmlType:"button",block:!0,icon:e.jsx(X,{}),loading:h,size:"large",onClick:k,style:{height:"48px",fontSize:"16px",fontWeight:600,borderRadius:"8px",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",border:"none",boxShadow:"0 4px 12px rgba(102, 126, 234, 0.4)"},children:r(h?"login.loggingIn":"login.loginButton")})}),h&&e.jsx($,{message:e.jsx("span",{style:{fontWeight:600},children:r("login.processing")}),description:e.jsx("div",{style:{fontSize:"13px",lineHeight:"1.6"},children:n==="interactive"?e.jsxs("div",{children:[e.jsx("div",{style:{marginBottom:12,color:"rgba(0, 0, 0, 0.65)"},children:r("login.processingInteractiveDesc")}),o&&e.jsxs("div",{style:{padding:"12px",background:"rgba(24, 144, 255, 0.08)",borderRadius:"8px",borderLeft:"3px solid #1890ff",marginTop:12},children:[e.jsxs("div",{style:{marginBottom:10,color:"rgba(0, 0, 0, 0.65)"},children:[e.jsx("strong",{style:{color:"#1890ff"},children:"💡 提示:"}),"如果您已经在浏览器中完成登录,请点击下方按钮检查登录状态。"]}),e.jsx(D,{type:"primary",size:"small",icon:e.jsx(Z,{}),onClick:o,style:{width:"100%",height:"32px",borderRadius:"6px"},children:"检查登录状态"})]})]}):n==="token"?e.jsx("div",{style:{color:"rgba(0, 0, 0, 0.65)"},children:"正在验证 refreshToken 并保存到配置文件..."}):null}),type:"info",showIcon:!0,style:{marginTop:0,borderRadius:"8px"}})]})}const{Paragraph:je}=W;function $e(){const{t:n}=z(),{loginMode:c,loginStep:s,isLoggingIn:l,isLoggingInWithToken:o,authStatusLoading:r,authStatus:i,isAuthenticated:h,setLoginMode:k,handleLogin:j,handleCheckStatus:f,navigate:x}=me();return a.useEffect(()=>{!r&&h(i)&&x("/dashboard",{replace:!0})},[r,i,x,h]),r?e.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)"},children:e.jsx(ee,{size:"large"})}):e.jsx(pe,{children:e.jsxs(K,{direction:"vertical",size:"large",style:{width:"100%"},children:[e.jsx(we,{}),(l||o)&&e.jsx(Le,{current:s}),!l&&!o&&e.jsx(be,{}),e.jsx(q,{style:{margin:"8px 0"}}),e.jsx(ke,{value:c,onChange:k,onResetFields:()=>{const u=document.querySelector('form[name="login"]');u&&u.reset()}}),e.jsx(Ie,{loginMode:c,isLoggingIn:l,isLoggingInWithToken:o,onLogin:j,onCheckStatus:f}),e.jsx(q,{style:{margin:"8px 0"}}),e.jsx("div",{style:{textAlign:"center"},children:e.jsx(je,{type:"secondary",style:{fontSize:"12px",margin:"0 0 12px 0",lineHeight:"1.6"},children:n("login.note")})})]})})}export{$e as default};
2
- //# sourceMappingURL=index-CSoUPZat.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-CSoUPZat.js","sources":["../../node_modules/@ant-design/icons-svg/es/asn/KeyOutlined.js","../../node_modules/@ant-design/icons/es/icons/KeyOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/RocketOutlined.js","../../node_modules/@ant-design/icons/es/icons/RocketOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/SafetyOutlined.js","../../node_modules/@ant-design/icons/es/icons/SafetyOutlined.js","../../src/hooks/useLoginPolling.ts","../../src/hooks/useInteractiveLogin.ts","../../src/pages/Login/hooks/useLoginFlow.ts","../../src/pages/Login/components/LoginCard.tsx","../../src/pages/Login/components/LoginHeader.tsx","../../src/pages/Login/components/LoginFeatures.tsx","../../src/pages/Login/components/LoginSteps.tsx","../../src/pages/Login/components/LoginModeSelector.tsx","../../src/pages/Login/components/LoginForm.tsx","../../src/pages/Login/Login.tsx"],"sourcesContent":["// This icon file is generated automatically.\nvar KeyOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5l-41.1 41.1-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-65.3 65.3a8.03 8.03 0 000 11.3l42.3 42.3c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.06 304.06 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112zm161.2 465.2C726.2 620.3 668.9 644 608 644c-60.9 0-118.2-23.7-161.2-66.8-43.1-43-66.8-100.3-66.8-161.2 0-60.9 23.7-118.2 66.8-161.2 43-43.1 100.3-66.8 161.2-66.8 60.9 0 118.2 23.7 161.2 66.8 43.1 43 66.8 100.3 66.8 161.2 0 60.9-23.7 118.2-66.8 161.2z\" } }] }, \"name\": \"key\", \"theme\": \"outlined\" };\nexport default KeyOutlined;\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nimport * as React from 'react';\nimport KeyOutlinedSvg from \"@ant-design/icons-svg/es/asn/KeyOutlined\";\nimport AntdIcon from \"../components/AntdIcon\";\nvar KeyOutlined = function KeyOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _extends({}, props, {\n ref: ref,\n icon: KeyOutlinedSvg\n }));\n};\n\n/**![key](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTYwOCAxMTJjLTE2Ny45IDAtMzA0IDEzNi4xLTMwNCAzMDQgMCA3MC4zIDIzLjkgMTM1IDYzLjkgMTg2LjVsLTQxLjEgNDEuMS02Mi4zLTYyLjNhOC4xNSA4LjE1IDAgMDAtMTEuNCAwbC0zOS44IDM5LjhhOC4xNSA4LjE1IDAgMDAwIDExLjRsNjIuMyA2Mi4zLTQ0LjkgNDQuOS02Mi4zLTYyLjNhOC4xNSA4LjE1IDAgMDAtMTEuNCAwbC0zOS44IDM5LjhhOC4xNSA4LjE1IDAgMDAwIDExLjRsNjIuMyA2Mi4zLTY1LjMgNjUuM2E4LjAzIDguMDMgMCAwMDAgMTEuM2w0Mi4zIDQyLjNjMy4xIDMuMSA4LjIgMy4xIDExLjMgMGwyNTMuNi0yNTMuNkEzMDQuMDYgMzA0LjA2IDAgMDA2MDggNzIwYzE2Ny45IDAgMzA0LTEzNi4xIDMwNC0zMDRTNzc1LjkgMTEyIDYwOCAxMTJ6bTE2MS4yIDQ2NS4yQzcyNi4yIDYyMC4zIDY2OC45IDY0NCA2MDggNjQ0Yy02MC45IDAtMTE4LjItMjMuNy0xNjEuMi02Ni44LTQzLjEtNDMtNjYuOC0xMDAuMy02Ni44LTE2MS4yIDAtNjAuOSAyMy43LTExOC4yIDY2LjgtMTYxLjIgNDMtNDMuMSAxMDAuMy02Ni44IDE2MS4yLTY2LjggNjAuOSAwIDExOC4yIDIzLjcgMTYxLjIgNjYuOCA0My4xIDQzIDY2LjggMTAwLjMgNjYuOCAxNjEuMiAwIDYwLjktMjMuNyAxMTguMi02Ni44IDE2MS4yeiIgLz48L3N2Zz4=) */\nvar RefIcon = /*#__PURE__*/React.forwardRef(KeyOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'KeyOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar RocketOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M864 736c0-111.6-65.4-208-160-252.9V317.3c0-15.1-5.3-29.7-15.1-41.2L536.5 95.4C530.1 87.8 521 84 512 84s-18.1 3.8-24.5 11.4L335.1 276.1a63.97 63.97 0 00-15.1 41.2v165.8C225.4 528 160 624.4 160 736h156.5c-2.3 7.2-3.5 15-3.5 23.8 0 22.1 7.6 43.7 21.4 60.8a97.2 97.2 0 0043.1 30.6c23.1 54 75.6 88.8 134.5 88.8 29.1 0 57.3-8.6 81.4-24.8 23.6-15.8 41.9-37.9 53-64a97 97 0 0043.1-30.5 97.52 97.52 0 0021.4-60.8c0-8.4-1.1-16.4-3.1-23.8H864zM762.3 621.4c9.4 14.6 17 30.3 22.5 46.6H700V558.7a211.6 211.6 0 0162.3 62.7zM388 483.1V318.8l124-147 124 147V668H388V483.1zM239.2 668c5.5-16.3 13.1-32 22.5-46.6 16.3-25.2 37.5-46.5 62.3-62.7V668h-84.8zm388.9 116.2c-5.2 3-11.2 4.2-17.1 3.4l-19.5-2.4-2.8 19.4c-5.4 37.9-38.4 66.5-76.7 66.5-38.3 0-71.3-28.6-76.7-66.5l-2.8-19.5-19.5 2.5a27.7 27.7 0 01-17.1-3.5c-8.7-5-14.1-14.3-14.1-24.4 0-10.6 5.9-19.4 14.6-23.8h231.3c8.8 4.5 14.6 13.3 14.6 23.8-.1 10.2-5.5 19.6-14.2 24.5zM464 400a48 48 0 1096 0 48 48 0 10-96 0z\" } }] }, \"name\": \"rocket\", \"theme\": \"outlined\" };\nexport default RocketOutlined;\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nimport * as React from 'react';\nimport RocketOutlinedSvg from \"@ant-design/icons-svg/es/asn/RocketOutlined\";\nimport AntdIcon from \"../components/AntdIcon\";\nvar RocketOutlined = function RocketOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _extends({}, props, {\n ref: ref,\n icon: RocketOutlinedSvg\n }));\n};\n\n/**![rocket](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTg2NCA3MzZjMC0xMTEuNi02NS40LTIwOC0xNjAtMjUyLjlWMzE3LjNjMC0xNS4xLTUuMy0yOS43LTE1LjEtNDEuMkw1MzYuNSA5NS40QzUzMC4xIDg3LjggNTIxIDg0IDUxMiA4NHMtMTguMSAzLjgtMjQuNSAxMS40TDMzNS4xIDI3Ni4xYTYzLjk3IDYzLjk3IDAgMDAtMTUuMSA0MS4ydjE2NS44QzIyNS40IDUyOCAxNjAgNjI0LjQgMTYwIDczNmgxNTYuNWMtMi4zIDcuMi0zLjUgMTUtMy41IDIzLjggMCAyMi4xIDcuNiA0My43IDIxLjQgNjAuOGE5Ny4yIDk3LjIgMCAwMDQzLjEgMzAuNmMyMy4xIDU0IDc1LjYgODguOCAxMzQuNSA4OC44IDI5LjEgMCA1Ny4zLTguNiA4MS40LTI0LjggMjMuNi0xNS44IDQxLjktMzcuOSA1My02NGE5NyA5NyAwIDAwNDMuMS0zMC41IDk3LjUyIDk3LjUyIDAgMDAyMS40LTYwLjhjMC04LjQtMS4xLTE2LjQtMy4xLTIzLjhIODY0ek03NjIuMyA2MjEuNGM5LjQgMTQuNiAxNyAzMC4zIDIyLjUgNDYuNkg3MDBWNTU4LjdhMjExLjYgMjExLjYgMCAwMTYyLjMgNjIuN3pNMzg4IDQ4My4xVjMxOC44bDEyNC0xNDcgMTI0IDE0N1Y2NjhIMzg4VjQ4My4xek0yMzkuMiA2NjhjNS41LTE2LjMgMTMuMS0zMiAyMi41LTQ2LjYgMTYuMy0yNS4yIDM3LjUtNDYuNSA2Mi4zLTYyLjdWNjY4aC04NC44em0zODguOSAxMTYuMmMtNS4yIDMtMTEuMiA0LjItMTcuMSAzLjRsLTE5LjUtMi40LTIuOCAxOS40Yy01LjQgMzcuOS0zOC40IDY2LjUtNzYuNyA2Ni41LTM4LjMgMC03MS4zLTI4LjYtNzYuNy02Ni41bC0yLjgtMTkuNS0xOS41IDIuNWEyNy43IDI3LjcgMCAwMS0xNy4xLTMuNWMtOC43LTUtMTQuMS0xNC4zLTE0LjEtMjQuNCAwLTEwLjYgNS45LTE5LjQgMTQuNi0yMy44aDIzMS4zYzguOCA0LjUgMTQuNiAxMy4zIDE0LjYgMjMuOC0uMSAxMC4yLTUuNSAxOS42LTE0LjIgMjQuNXpNNDY0IDQwMGE0OCA0OCAwIDEwOTYgMCA0OCA0OCAwIDEwLTk2IDB6IiAvPjwvc3ZnPg==) */\nvar RefIcon = /*#__PURE__*/React.forwardRef(RocketOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'RocketOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar SafetyOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"0 0 1024 1024\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64L128 192v384c0 212.1 171.9 384 384 384s384-171.9 384-384V192L512 64zm312 512c0 172.3-139.7 312-312 312S200 748.3 200 576V246l312-110 312 110v330z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M378.4 475.1a35.91 35.91 0 00-50.9 0 35.91 35.91 0 000 50.9l129.4 129.4 2.1 2.1a33.98 33.98 0 0048.1 0L730.6 434a33.98 33.98 0 000-48.1l-2.8-2.8a33.98 33.98 0 00-48.1 0L483 579.7 378.4 475.1z\" } }] }, \"name\": \"safety\", \"theme\": \"outlined\" };\nexport default SafetyOutlined;\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nimport * as React from 'react';\nimport SafetyOutlinedSvg from \"@ant-design/icons-svg/es/asn/SafetyOutlined\";\nimport AntdIcon from \"../components/AntdIcon\";\nvar SafetyOutlined = function SafetyOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _extends({}, props, {\n ref: ref,\n icon: SafetyOutlinedSvg\n }));\n};\n\n/**![safety](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTUxMiA2NEwxMjggMTkydjM4NGMwIDIxMi4xIDE3MS45IDM4NCAzODQgMzg0czM4NC0xNzEuOSAzODQtMzg0VjE5Mkw1MTIgNjR6bTMxMiA1MTJjMCAxNzIuMy0xMzkuNyAzMTItMzEyIDMxMlMyMDAgNzQ4LjMgMjAwIDU3NlYyNDZsMzEyLTExMCAzMTIgMTEwdjMzMHoiIC8+PHBhdGggZD0iTTM3OC40IDQ3NS4xYTM1LjkxIDM1LjkxIDAgMDAtNTAuOSAwIDM1LjkxIDM1LjkxIDAgMDAwIDUwLjlsMTI5LjQgMTI5LjQgMi4xIDIuMWEzMy45OCAzMy45OCAwIDAwNDguMSAwTDczMC42IDQzNGEzMy45OCAzMy45OCAwIDAwMC00OC4xbC0yLjgtMi44YTMzLjk4IDMzLjk4IDAgMDAtNDguMSAwTDQ4MyA1NzkuNyAzNzguNCA0NzUuMXoiIC8+PC9zdmc+) */\nvar RefIcon = /*#__PURE__*/React.forwardRef(SafetyOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'SafetyOutlined';\n}\nexport default RefIcon;","import { useEffect, useRef, useCallback } from 'react';\nimport { message } from 'antd';\n\nconst MAX_POLLING_DURATION = 10 * 60 * 1000; // 10 minutes\n\ninterface UseLoginPollingOptions {\n enabled: boolean;\n onAuthenticated: () => void;\n refetchAuthStatus: () => Promise<unknown>;\n isAuthenticated: (response: unknown) => boolean;\n}\n\n/**\n * Hook for polling authentication status during interactive login\n */\nexport function useLoginPolling({\n enabled,\n onAuthenticated,\n refetchAuthStatus,\n isAuthenticated,\n}: UseLoginPollingOptions) {\n const pollingIntervalRef = useRef<NodeJS.Timeout | null>(null);\n const pollingStartTimeRef = useRef<number | null>(null);\n\n const stopPolling = useCallback(() => {\n if (pollingIntervalRef.current) {\n clearInterval(pollingIntervalRef.current);\n pollingIntervalRef.current = null;\n }\n pollingStartTimeRef.current = null;\n }, []);\n\n useEffect(() => {\n if (enabled) {\n // Initialize polling start time if not set\n if (!pollingStartTimeRef.current) {\n pollingStartTimeRef.current = Date.now();\n console.log('[LoginPolling] Starting polling for interactive login...');\n }\n\n // Start polling every 2 seconds\n if (!pollingIntervalRef.current) {\n pollingIntervalRef.current = setInterval(async () => {\n try {\n // Check if we've exceeded max polling duration\n if (pollingStartTimeRef.current && Date.now() - pollingStartTimeRef.current > MAX_POLLING_DURATION) {\n console.log('[LoginPolling] Polling timeout reached, stopping...');\n stopPolling();\n message.warning('登录超时,请重试');\n return;\n }\n\n console.log('[LoginPolling] Polling auth status...');\n const result = await refetchAuthStatus();\n\n if (isAuthenticated(result)) {\n console.log('[LoginPolling] Authentication detected via polling!');\n stopPolling();\n onAuthenticated();\n }\n } catch (error) {\n console.error('[LoginPolling] Polling error:', error);\n // Continue polling even on error\n }\n }, 2000);\n }\n } else {\n // Stop polling when disabled\n stopPolling();\n }\n\n // Cleanup on unmount\n return () => {\n stopPolling();\n };\n }, [enabled, refetchAuthStatus, isAuthenticated, onAuthenticated, stopPolling]);\n\n return {\n stopPolling,\n };\n}\n\n","import { useEffect, useRef, useCallback } from 'react';\nimport { useQueryClient } from '@tanstack/react-query';\nimport { message } from 'antd';\nimport { api } from '../services/api';\nimport { QUERY_KEYS } from '../constants';\nimport type { ElectronLoginSuccessData, ElectronLoginError } from '../types/electron';\n\ninterface UseInteractiveLoginOptions {\n onLoginSuccess?: () => void;\n refetchAuthStatus: () => Promise<unknown>;\n isAuthenticated: (response: unknown) => boolean;\n startPolling: () => void;\n stopPolling: () => void;\n}\n\n/**\n * Hook for handling interactive login (Electron and backend API)\n */\nexport function useInteractiveLogin({\n onLoginSuccess,\n refetchAuthStatus,\n isAuthenticated,\n startPolling,\n stopPolling,\n}: UseInteractiveLoginOptions) {\n const queryClient = useQueryClient();\n const isInteractiveLoginActiveRef = useRef<boolean>(false);\n\n // Handle successful login\n const handleLoginSuccess = useCallback(async () => {\n stopPolling();\n isInteractiveLoginActiveRef.current = false;\n \n // Show progress messages\n message.loading({ content: '✅ 登录成功,正在验证登录状态...', key: 'login-success', duration: 0 });\n \n // Invalidate queries to refresh data\n queryClient.invalidateQueries({ queryKey: QUERY_KEYS.AUTH_STATUS });\n queryClient.invalidateQueries({ queryKey: QUERY_KEYS.CONFIG });\n \n // Wait for backend config to refresh\n await new Promise(resolve => setTimeout(resolve, 1000));\n \n // Wait for auth status to update before navigating\n let authenticated = false;\n const maxRetries = 3;\n \n for (let attempt = 0; attempt < maxRetries; attempt++) {\n try {\n const result = await refetchAuthStatus();\n console.log(`[InteractiveLogin] Auth status check (attempt ${attempt + 1}/${maxRetries}):`, result);\n \n if (isAuthenticated(result)) {\n authenticated = true;\n console.log('[InteractiveLogin] Authentication confirmed');\n break;\n }\n \n if (attempt < maxRetries - 1) {\n await new Promise(resolve => setTimeout(resolve, 500));\n }\n } catch (error) {\n console.error(`[InteractiveLogin] Auth status check error (attempt ${attempt + 1}/${maxRetries}):`, error);\n if (attempt < maxRetries - 1) {\n await new Promise(resolve => setTimeout(resolve, 500));\n }\n }\n }\n \n message.destroy('login-success');\n \n if (authenticated) {\n console.log('[InteractiveLogin] Authentication confirmed, navigating to dashboard...');\n message.success('✅ 登录成功!正在跳转到 Dashboard...', 2);\n \n await new Promise(resolve => setTimeout(resolve, 800));\n window.location.href = '/dashboard';\n } else {\n console.warn('[InteractiveLogin] Auth status not confirmed after retries');\n message.warning('登录状态验证失败,请手动刷新页面或点击\"检查登录状态\"按钮', 4);\n }\n \n onLoginSuccess?.();\n }, [stopPolling, queryClient, refetchAuthStatus, isAuthenticated, onLoginSuccess]);\n\n // Register IPC event listeners for Electron login\n useEffect(() => {\n const isElectron = typeof window !== 'undefined' && window.electron;\n if (!isElectron || !window.electron?.onLoginSuccess) {\n return;\n }\n\n console.log('[InteractiveLogin] Registering IPC event listeners for Electron login...');\n\n // Handle login success from Electron\n const handleElectronLoginSuccess = async (data: ElectronLoginSuccessData) => {\n console.log('[InteractiveLogin] Received login-success event from Electron:', data);\n \n try {\n stopPolling();\n isInteractiveLoginActiveRef.current = false;\n \n if (data.refreshToken) {\n console.log('[InteractiveLogin] RefreshToken received from Electron');\n message.loading({ content: '✅ 已获取授权码,正在交换 Token...', key: 'login-progress', duration: 0 });\n \n await new Promise(resolve => setTimeout(resolve, 500));\n \n message.loading({ content: '✅ Token 交换成功,正在保存到后端配置...', key: 'login-progress', duration: 0 });\n \n await new Promise(resolve => setTimeout(resolve, 1000));\n \n message.loading({ content: '✅ Token 已保存,正在验证登录状态...', key: 'login-progress', duration: 0 });\n } else {\n message.loading({ content: '✅ 登录成功,正在验证登录状态...', key: 'login-progress', duration: 0 });\n }\n \n queryClient.invalidateQueries({ queryKey: QUERY_KEYS.AUTH_STATUS });\n queryClient.invalidateQueries({ queryKey: QUERY_KEYS.CONFIG });\n \n await new Promise(resolve => setTimeout(resolve, 1000));\n \n // Check auth status with retries\n let authenticated = false;\n const maxRetries = 3;\n \n for (let attempt = 0; attempt < maxRetries; attempt++) {\n try {\n const result = await refetchAuthStatus();\n console.log(`[InteractiveLogin] Auth status check (attempt ${attempt + 1}/${maxRetries}):`, result);\n \n if (isAuthenticated(result)) {\n authenticated = true;\n console.log('[InteractiveLogin] Authentication confirmed');\n break;\n }\n \n if (attempt < maxRetries - 1) {\n await new Promise(resolve => setTimeout(resolve, 500));\n }\n } catch (error) {\n console.error(`[InteractiveLogin] Auth status check error (attempt ${attempt + 1}/${maxRetries}):`, error);\n if (attempt < maxRetries - 1) {\n await new Promise(resolve => setTimeout(resolve, 500));\n }\n }\n }\n \n message.destroy('login-progress');\n \n if (authenticated) {\n console.log('[InteractiveLogin] Authentication confirmed, navigating to dashboard...');\n message.success('✅ 登录成功!正在跳转到 Dashboard...', 2);\n \n await new Promise(resolve => setTimeout(resolve, 800));\n window.location.href = '/dashboard';\n } else if (data.refreshToken) {\n // 如果有 token 但验证失败,仍然尝试跳转\n console.warn('[InteractiveLogin] Has token but auth status not confirmed, attempting navigation...');\n message.warning('登录状态验证失败,但将尝试跳转...', 3);\n \n await new Promise(resolve => setTimeout(resolve, 1000));\n window.location.href = '/dashboard';\n } else {\n console.error('[InteractiveLogin] Authentication not confirmed after retries');\n message.warning('登录成功,但状态验证失败。请手动刷新页面或点击\"检查登录状态\"按钮。', 4);\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : '未知错误';\n console.error('[InteractiveLogin] Error handling login-success event:', error);\n message.destroy('login-progress');\n message.error('处理登录成功事件时出错: ' + errorMessage, 4);\n }\n };\n\n // Handle login error from Electron\n const handleElectronLoginError = (error: ElectronLoginError) => {\n console.error('[InteractiveLogin] Received login-error event from Electron:', error);\n stopPolling();\n isInteractiveLoginActiveRef.current = false;\n \n const errorMessage = error.message || '未知错误';\n message.error('登录失败: ' + errorMessage, 4);\n };\n\n // Register event listeners\n const cleanupLoginSuccess = window.electron.onLoginSuccess(handleElectronLoginSuccess);\n const cleanupLoginError = window.electron.onLoginError(handleElectronLoginError);\n\n // Cleanup\n return () => {\n console.log('[InteractiveLogin] Cleaning up IPC event listeners...');\n if (cleanupLoginSuccess && typeof cleanupLoginSuccess === 'function') {\n cleanupLoginSuccess();\n }\n if (cleanupLoginError && typeof cleanupLoginError === 'function') {\n cleanupLoginError();\n }\n };\n }, [queryClient, refetchAuthStatus, isAuthenticated, stopPolling]);\n\n // Handle interactive login\n const handleInteractiveLogin = useCallback(async (configData?: { data?: { data?: { network?: { proxy?: { enabled?: boolean; [key: string]: unknown } } } } }) => {\n const isElectron = typeof window !== 'undefined' && window.electron;\n \n if (isElectron && window.electron?.openLoginWindow) {\n // Use Electron system browser login\n console.log('[InteractiveLogin] Using Electron system browser login...');\n \n try {\n message.info('正在打开系统浏览器进行登录...', 3);\n \n isInteractiveLoginActiveRef.current = true;\n startPolling();\n \n const result = await window.electron.openLoginWindow();\n if (!result.success) {\n if (result.cancelled) {\n stopPolling();\n isInteractiveLoginActiveRef.current = false;\n message.info('登录已取消', 2);\n return;\n }\n throw new Error(result.error || '无法打开登录窗口');\n }\n \n console.log('[InteractiveLogin] Login window opened, waiting for login-success or login-error event...');\n message.info('请在浏览器中完成登录,系统会自动检测登录状态...', 5);\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : '未知错误';\n console.error('[InteractiveLogin] Failed to open Electron login window:', error);\n message.error('无法打开登录窗口: ' + errorMessage, 4);\n stopPolling();\n isInteractiveLoginActiveRef.current = false;\n }\n return;\n }\n \n // Fallback to backend API (Puppeteer/Python)\n const username = '';\n const password = '';\n \n const proxy = configData?.data?.data?.network?.proxy?.enabled \n ? configData.data.data.network.proxy \n : undefined;\n \n stopPolling();\n \n isInteractiveLoginActiveRef.current = true;\n startPolling();\n console.log('[InteractiveLogin] Starting interactive login via backend API, polling will begin...');\n \n try {\n await api.login(username, password, false, proxy);\n } catch (error) {\n const apiError = error as { code?: string; message?: string };\n const isTimeout = apiError?.code === 'ECONNABORTED' || apiError?.message?.includes('timeout');\n \n if (isTimeout) {\n console.log('[InteractiveLogin] Interactive login API timeout, but continuing to poll for status...');\n message.info('正在等待浏览器登录完成,系统会自动检测登录状态...', 5);\n return;\n }\n \n stopPolling();\n isInteractiveLoginActiveRef.current = false;\n \n const errorMessage = apiError?.message || (error instanceof Error ? error.message : '未知错误');\n throw new Error(errorMessage);\n }\n }, [startPolling, stopPolling]);\n\n // Manual check login status\n const handleCheckStatus = useCallback(async () => {\n try {\n message.loading({ content: '正在检查登录状态...', key: 'checkStatus', duration: 0 });\n const result = await refetchAuthStatus();\n message.destroy('checkStatus');\n \n if (isAuthenticated(result)) {\n message.success('✅ 已登录,正在跳转...', 2);\n handleLoginSuccess();\n } else {\n message.info('尚未登录,请完成浏览器中的登录流程。系统会自动检测登录状态。', 4);\n if (!isInteractiveLoginActiveRef.current) {\n isInteractiveLoginActiveRef.current = true;\n startPolling();\n }\n }\n } catch (error) {\n message.destroy('checkStatus');\n const errorMessage = error instanceof Error ? error.message : '未知错误';\n message.error('检查登录状态失败: ' + errorMessage, 4);\n console.error('[InteractiveLogin] Manual status check error:', error);\n }\n }, [refetchAuthStatus, isAuthenticated, handleLoginSuccess, startPolling]);\n\n return {\n handleInteractiveLogin,\n handleCheckStatus,\n isActive: isInteractiveLoginActiveRef.current,\n };\n}\n\n","import { useState, useCallback } from 'react';\nimport { useQuery } from '@tanstack/react-query';\nimport { useNavigate } from 'react-router-dom';\nimport { message } from 'antd';\nimport { useTranslation } from 'react-i18next';\nimport { api } from '../../../services/api';\nimport { translateErrorCode, extractErrorInfo } from '../../../utils/errorCodeTranslator';\nimport { QUERY_KEYS } from '../../../constants';\nimport { isAuthenticated } from '../../../utils/authUtils';\nimport { useAuth } from '../../../hooks/useAuth';\nimport { useLoginPolling } from '../../../hooks/useLoginPolling';\nimport { useInteractiveLogin } from '../../../hooks/useInteractiveLogin';\n\n/**\n * Hook for managing login flow\n * Handles login mode selection, login steps, polling, and navigation\n */\nexport function useLoginFlow() {\n const { t } = useTranslation();\n const navigate = useNavigate();\n const [loginMode, setLoginMode] = useState<'interactive' | 'token'>('interactive');\n const [loginStep, setLoginStep] = useState(0);\n const [pollingEnabled, setPollingEnabled] = useState(false);\n\n // Check if already logged in\n const { data: authStatus, isLoading: authStatusLoading, refetch: refetchAuthStatus } = useQuery({\n queryKey: QUERY_KEYS.AUTH_STATUS,\n queryFn: () => api.getAuthStatus(),\n retry: false,\n refetchInterval: false,\n });\n\n // Get config to read proxy settings\n const { data: configData } = useQuery({\n queryKey: QUERY_KEYS.CONFIG,\n queryFn: () => api.getConfig(),\n });\n\n // Use auth hook\n const {\n loginWithTokenAsync,\n isLoggingInWithToken,\n } = useAuth();\n\n // Helper to check if authenticated from API response\n const checkAuth = useCallback((response: unknown): boolean => {\n const authenticated = isAuthenticated(response);\n console.log('[Login] Auth check:', { authenticated, response });\n return authenticated;\n }, [isAuthenticated]);\n\n // Handle successful login\n const handleLoginSuccess = useCallback(async () => {\n setPollingEnabled(false);\n setLoginStep(2);\n \n message.loading({ content: '✅ 登录成功,正在验证登录状态...', key: 'login-success', duration: 0 });\n \n // Wait for backend config to refresh\n await new Promise(resolve => setTimeout(resolve, 1000));\n \n let authenticated = false;\n const maxRetries = 3;\n \n for (let attempt = 0; attempt < maxRetries; attempt++) {\n try {\n const result = await refetchAuthStatus();\n console.log(`[Login] Auth status check (attempt ${attempt + 1}/${maxRetries}):`, result);\n \n if (checkAuth(result)) {\n authenticated = true;\n console.log('[Login] Authentication confirmed');\n break;\n }\n \n if (attempt < maxRetries - 1) {\n await new Promise(resolve => setTimeout(resolve, 500));\n }\n } catch (error) {\n console.error(`[Login] Auth status check error (attempt ${attempt + 1}/${maxRetries}):`, error);\n if (attempt < maxRetries - 1) {\n await new Promise(resolve => setTimeout(resolve, 500));\n }\n }\n }\n \n message.destroy('login-success');\n \n if (authenticated) {\n console.log('[Login] Authentication confirmed, navigating to dashboard...');\n message.success('✅ 登录成功!正在跳转到 Dashboard...', 2);\n \n await new Promise(resolve => setTimeout(resolve, 800));\n window.location.href = '/dashboard';\n } else {\n console.warn('[Login] Auth status not confirmed after retries');\n message.warning('登录状态验证失败,请手动刷新页面或点击\"检查登录状态\"按钮', 4);\n }\n }, [refetchAuthStatus, checkAuth]);\n\n // Start/stop polling helpers\n const startPolling = useCallback(() => {\n setPollingEnabled(true);\n }, []);\n\n const stopPolling = useCallback(() => {\n setPollingEnabled(false);\n }, []);\n\n // Wrapper for refetchAuthStatus to match expected type\n const refetchAuthStatusWrapper = useCallback(async (): Promise<unknown> => {\n const result = await refetchAuthStatus();\n return result;\n }, [refetchAuthStatus]);\n\n // Use login polling hook\n useLoginPolling({\n enabled: pollingEnabled,\n onAuthenticated: () => {\n handleLoginSuccess();\n },\n refetchAuthStatus: refetchAuthStatusWrapper,\n isAuthenticated: checkAuth,\n });\n\n // Use interactive login hook\n const { handleInteractiveLogin, handleCheckStatus } = useInteractiveLogin({\n onLoginSuccess: () => setLoginStep(2),\n refetchAuthStatus: refetchAuthStatusWrapper,\n isAuthenticated: checkAuth,\n startPolling,\n stopPolling,\n });\n\n // Handle login\n const handleLogin = useCallback(async (values?: { refreshToken?: string }) => {\n setLoginStep(1);\n \n // Handle token login mode\n if (loginMode === 'token') {\n const refreshToken = values?.refreshToken;\n \n if (!refreshToken || refreshToken.trim() === '') {\n message.error('请输入 refreshToken');\n setLoginStep(0);\n return;\n }\n \n try {\n await loginWithTokenAsync(refreshToken.trim());\n handleLoginSuccess();\n } catch (error) {\n const { errorCode, message: errorMessage } = extractErrorInfo(error);\n setLoginStep(0);\n if (errorCode) {\n message.error(translateErrorCode(errorCode, t, undefined, errorMessage || t('AUTH_LOGIN_FAILED')));\n } else {\n message.error(errorMessage || t('AUTH_LOGIN_FAILED'));\n }\n }\n return;\n }\n \n // Interactive mode\n try {\n await handleInteractiveLogin(configData);\n } catch (error) {\n const { errorCode, message: errorMessage } = extractErrorInfo(error);\n setLoginStep(0);\n if (errorCode) {\n message.error(translateErrorCode(errorCode, t, undefined, errorMessage || t('AUTH_LOGIN_FAILED')));\n } else {\n message.error(errorMessage || t('AUTH_LOGIN_FAILED'));\n }\n }\n }, [loginMode, loginWithTokenAsync, handleLoginSuccess, handleInteractiveLogin, configData, t]);\n\n const isLoggingIn = pollingEnabled || loginStep === 1;\n\n return {\n // State\n loginMode,\n loginStep,\n isLoggingIn,\n isLoggingInWithToken,\n authStatusLoading,\n authStatus,\n isAuthenticated: checkAuth,\n \n // Actions\n setLoginMode,\n handleLogin,\n handleCheckStatus,\n \n // Navigation\n navigate,\n };\n}\n\n","import { ReactNode } from 'react';\nimport { Card } from 'antd';\n\ninterface LoginCardProps {\n children: ReactNode;\n}\n\n/**\n * Login card container component\n */\nexport function LoginCard({ children }: LoginCardProps) {\n return (\n <div\n style={{\n minHeight: '100vh',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',\n padding: '20px',\n position: 'relative',\n overflow: 'hidden',\n }}\n >\n {/* Background decorations */}\n <div style={{\n position: 'absolute',\n top: '-10%',\n right: '-5%',\n width: '500px',\n height: '500px',\n borderRadius: '50%',\n background: 'rgba(255, 255, 255, 0.1)',\n filter: 'blur(60px)',\n }} />\n <div style={{\n position: 'absolute',\n bottom: '-10%',\n left: '-5%',\n width: '400px',\n height: '400px',\n borderRadius: '50%',\n background: 'rgba(255, 255, 255, 0.1)',\n filter: 'blur(60px)',\n }} />\n\n <Card\n style={{\n width: '100%',\n maxWidth: 480,\n boxShadow: '0 20px 60px rgba(0,0,0,0.3)',\n borderRadius: '16px',\n position: 'relative',\n zIndex: 1,\n }}\n >\n {children}\n </Card>\n </div>\n );\n}\n\n","import { Typography } from 'antd';\nimport { RocketOutlined } from '@ant-design/icons';\nimport { useTranslation } from 'react-i18next';\n\nconst { Title, Text } = Typography;\n\n/**\n * Login page header component\n */\nexport function LoginHeader() {\n const { t } = useTranslation();\n\n return (\n <div style={{ textAlign: 'center', marginBottom: 8 }}>\n <div style={{\n width: '80px',\n height: '80px',\n margin: '0 auto 16px',\n background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',\n borderRadius: '20px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n boxShadow: '0 8px 16px rgba(102, 126, 234, 0.4)',\n }}>\n <RocketOutlined style={{ fontSize: '40px', color: 'white' }} />\n </div>\n <Title level={2} style={{ margin: '0 0 8px 0', fontSize: '28px', fontWeight: 700 }}>\n PixivFlow\n </Title>\n <Text type=\"secondary\" style={{ fontSize: '15px' }}>\n {t('login.subtitle')}\n </Text>\n </div>\n );\n}\n\n","import { Space, Typography } from 'antd';\nimport { CheckCircleOutlined } from '@ant-design/icons';\n\nconst { Text } = Typography;\n\n/**\n * Login features showcase component\n */\nexport function LoginFeatures() {\n return (\n <div style={{\n background: 'linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%)',\n padding: '16px',\n borderRadius: '12px',\n marginBottom: 8,\n }}>\n <Space direction=\"vertical\" size=\"small\" style={{ width: '100%' }}>\n <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>\n <CheckCircleOutlined style={{ color: '#52c41a', fontSize: '16px' }} />\n <Text style={{ fontSize: '13px' }}>安全的 OAuth 认证流程</Text>\n </div>\n <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>\n <CheckCircleOutlined style={{ color: '#52c41a', fontSize: '16px' }} />\n <Text style={{ fontSize: '13px' }}>自动保存登录凭证</Text>\n </div>\n <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>\n <CheckCircleOutlined style={{ color: '#52c41a', fontSize: '16px' }} />\n <Text style={{ fontSize: '13px' }}>支持多种登录方式</Text>\n </div>\n </Space>\n </div>\n );\n}\n\n","import { Steps } from 'antd';\nimport { SafetyOutlined, ThunderboltOutlined, CheckCircleOutlined } from '@ant-design/icons';\n\ninterface LoginStepsProps {\n current: number;\n}\n\n/**\n * Login steps indicator component\n */\nexport function LoginSteps({ current }: LoginStepsProps) {\n return (\n <Steps\n current={current}\n size=\"small\"\n items={[\n { title: '选择模式', icon: <SafetyOutlined /> },\n { title: '认证中', icon: <ThunderboltOutlined /> },\n { title: '完成', icon: <CheckCircleOutlined /> },\n ]}\n style={{ marginBottom: 8 }}\n />\n );\n}\n\n","import { Form, Radio, Alert } from 'antd';\nimport { SafetyOutlined, KeyOutlined } from '@ant-design/icons';\nimport { useTranslation } from 'react-i18next';\n\ninterface LoginModeSelectorProps {\n value: 'interactive' | 'token';\n onChange: (mode: 'interactive' | 'token') => void;\n onResetFields: () => void;\n}\n\n/**\n * Login mode selector component\n */\nexport function LoginModeSelector({ value, onChange, onResetFields }: LoginModeSelectorProps) {\n const { t } = useTranslation();\n\n return (\n <>\n <Form.Item\n label={\n <span style={{ fontSize: '15px', fontWeight: 600 }}>\n {t('login.loginMode')}\n </span>\n }\n style={{ marginBottom: 20 }}\n >\n <Radio.Group\n value={value}\n onChange={(e) => {\n onChange(e.target.value);\n setTimeout(() => {\n onResetFields();\n }, 0);\n }}\n buttonStyle=\"solid\"\n style={{ width: '100%', display: 'flex', flexWrap: 'wrap', gap: '8px' }}\n >\n <Radio.Button \n value=\"interactive\" \n style={{ \n flex: 1, \n minWidth: '120px',\n textAlign: 'center',\n height: '48px',\n lineHeight: '48px',\n fontSize: '14px',\n fontWeight: 500,\n }}\n >\n <SafetyOutlined /> {t('login.loginModeInteractive')}\n </Radio.Button>\n <Radio.Button \n value=\"token\" \n style={{ \n flex: 1, \n minWidth: '120px',\n textAlign: 'center',\n height: '48px',\n lineHeight: '48px',\n fontSize: '14px',\n fontWeight: 500,\n }}\n >\n <KeyOutlined /> Token 登录\n </Radio.Button>\n </Radio.Group>\n </Form.Item>\n\n {value === 'interactive' && (\n <Alert\n message={\n <span style={{ fontWeight: 600 }}>\n {t('login.loginModeInteractive')}\n </span>\n }\n description={\n <div style={{ fontSize: '13px' }}>\n <div style={{ marginBottom: 8 }}>{t('login.loginModeInteractiveDesc')}</div>\n <div style={{ \n padding: '8px 12px', \n background: 'rgba(24, 144, 255, 0.1)', \n borderRadius: '6px',\n borderLeft: '3px solid #1890ff',\n }}>\n {t('login.browserWindowNote')}\n </div>\n </div>\n }\n type=\"info\"\n showIcon\n style={{ marginBottom: 20 }}\n />\n )}\n\n {value === 'token' && (\n <Alert\n message={\n <span style={{ fontWeight: 600 }}>\n Token 登录\n </span>\n }\n description={\n <div style={{ fontSize: '13px' }}>\n <div style={{ marginBottom: 8 }}>\n 如果您已经有 Pixiv 的 refreshToken,可以直接粘贴使用。系统会自动验证并保存。\n </div>\n <div style={{ \n padding: '8px 12px', \n background: 'rgba(82, 196, 26, 0.1)', \n borderRadius: '6px',\n borderLeft: '3px solid #52c41a',\n }}>\n <strong>提示:</strong>refreshToken 可以从浏览器开发者工具中获取,或从其他已登录的配置文件中复制。\n </div>\n </div>\n }\n type=\"success\"\n showIcon\n style={{ marginBottom: 20 }}\n />\n )}\n </>\n );\n}\n\n","import { Form, Input, Button, Alert } from 'antd';\nimport { LoginOutlined, ReloadOutlined, KeyOutlined } from '@ant-design/icons';\nimport { useTranslation } from 'react-i18next';\n\ninterface LoginFormProps {\n loginMode: 'interactive' | 'token';\n isLoggingIn: boolean;\n isLoggingInWithToken: boolean;\n onLogin: (values?: { refreshToken?: string }) => void;\n onCheckStatus?: () => void;\n}\n\n/**\n * Login form component\n */\nexport function LoginForm({ \n loginMode, \n isLoggingIn, \n isLoggingInWithToken,\n onLogin,\n onCheckStatus,\n}: LoginFormProps) {\n const { t } = useTranslation();\n const [form] = Form.useForm();\n const isLoading = isLoggingIn || isLoggingInWithToken;\n\n const handleSubmit = () => {\n if (loginMode === 'token') {\n form.validateFields(['refreshToken']).then(() => {\n const values = form.getFieldsValue();\n onLogin(values);\n }).catch(() => {\n // Validation failed\n });\n } else {\n onLogin();\n }\n };\n\n return (\n <Form\n form={form}\n name=\"login\"\n onFinish={handleSubmit}\n layout=\"vertical\"\n size=\"large\"\n autoComplete=\"off\"\n >\n {loginMode === 'token' && (\n <Form.Item\n name=\"refreshToken\"\n label={\n <span style={{ fontSize: '14px', fontWeight: 500 }}>\n <KeyOutlined style={{ marginRight: 8 }} /> Refresh Token\n </span>\n }\n rules={[\n { required: true, message: '请输入 refreshToken' },\n { min: 10, message: 'refreshToken 格式不正确' },\n ]}\n >\n <Input.TextArea\n placeholder=\"粘贴您的 refreshToken here...\"\n autoSize={{ minRows: 3, maxRows: 6 }}\n style={{ fontSize: '14px', fontFamily: 'monospace' }}\n />\n </Form.Item>\n )}\n\n <Form.Item style={{ marginBottom: 16 }}>\n <Button\n type=\"primary\"\n htmlType=\"button\"\n block\n icon={<LoginOutlined />}\n loading={isLoading}\n size=\"large\"\n onClick={handleSubmit}\n style={{\n height: '48px',\n fontSize: '16px',\n fontWeight: 600,\n borderRadius: '8px',\n background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',\n border: 'none',\n boxShadow: '0 4px 12px rgba(102, 126, 234, 0.4)',\n }}\n >\n {isLoading ? t('login.loggingIn') : t('login.loginButton')}\n </Button>\n </Form.Item>\n\n {isLoading && (\n <Alert\n message={\n <span style={{ fontWeight: 600 }}>\n {t('login.processing')}\n </span>\n }\n description={\n <div style={{ fontSize: '13px', lineHeight: '1.6' }}>\n {loginMode === 'interactive' ? (\n <div>\n <div style={{ marginBottom: 12, color: 'rgba(0, 0, 0, 0.65)' }}>\n {t('login.processingInteractiveDesc')}\n </div>\n {onCheckStatus && (\n <div style={{ \n padding: '12px', \n background: 'rgba(24, 144, 255, 0.08)', \n borderRadius: '8px',\n borderLeft: '3px solid #1890ff',\n marginTop: 12,\n }}>\n <div style={{ marginBottom: 10, color: 'rgba(0, 0, 0, 0.65)' }}>\n <strong style={{ color: '#1890ff' }}>💡 提示:</strong>如果您已经在浏览器中完成登录,请点击下方按钮检查登录状态。\n </div>\n <Button\n type=\"primary\"\n size=\"small\"\n icon={<ReloadOutlined />}\n onClick={onCheckStatus}\n style={{ \n width: '100%',\n height: '32px',\n borderRadius: '6px',\n }}\n >\n 检查登录状态\n </Button>\n </div>\n )}\n </div>\n ) : loginMode === 'token' ? (\n <div style={{ color: 'rgba(0, 0, 0, 0.65)' }}>\n 正在验证 refreshToken 并保存到配置文件...\n </div>\n ) : null}\n </div>\n }\n type=\"info\"\n showIcon\n style={{ \n marginTop: 0,\n borderRadius: '8px',\n }}\n />\n )}\n </Form>\n );\n}\n\n","import { useEffect } from 'react';\nimport { Space, Spin, Divider, Typography } from 'antd';\nimport { useTranslation } from 'react-i18next';\nimport { useLoginFlow } from './hooks';\nimport {\n LoginCard,\n LoginHeader,\n LoginFeatures,\n LoginSteps,\n LoginModeSelector,\n LoginForm,\n} from './components';\n\nconst { Paragraph } = Typography;\n\n/**\n * Login page component\n * Simplified version that uses useLoginFlow hook for all login logic\n */\nexport default function Login() {\n const { t } = useTranslation();\n const {\n loginMode,\n loginStep,\n isLoggingIn,\n isLoggingInWithToken,\n authStatusLoading,\n authStatus,\n isAuthenticated,\n setLoginMode,\n handleLogin,\n handleCheckStatus,\n navigate,\n } = useLoginFlow();\n\n // Redirect to dashboard if already authenticated\n useEffect(() => {\n if (!authStatusLoading && isAuthenticated(authStatus)) {\n navigate('/dashboard', { replace: true });\n }\n }, [authStatusLoading, authStatus, navigate, isAuthenticated]);\n\n // Show loading while checking auth status\n if (authStatusLoading) {\n return (\n <div\n style={{\n minHeight: '100vh',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',\n }}\n >\n <Spin size=\"large\" />\n </div>\n );\n }\n\n return (\n <LoginCard>\n <Space direction=\"vertical\" size=\"large\" style={{ width: '100%' }}>\n <LoginHeader />\n\n {(isLoggingIn || isLoggingInWithToken) && (\n <LoginSteps current={loginStep} />\n )}\n\n {!isLoggingIn && !isLoggingInWithToken && (\n <LoginFeatures />\n )}\n\n <Divider style={{ margin: '8px 0' }} />\n\n <LoginModeSelector\n value={loginMode}\n onChange={setLoginMode}\n onResetFields={() => {\n const form = document.querySelector('form[name=\"login\"]') as HTMLFormElement;\n if (form) {\n form.reset();\n }\n }}\n />\n\n <LoginForm\n loginMode={loginMode}\n isLoggingIn={isLoggingIn}\n isLoggingInWithToken={isLoggingInWithToken}\n onLogin={handleLogin}\n onCheckStatus={handleCheckStatus}\n />\n\n <Divider style={{ margin: '8px 0' }} />\n\n <div style={{ textAlign: 'center' }}>\n <Paragraph \n type=\"secondary\" \n style={{ \n fontSize: '12px', \n margin: '0 0 12px 0',\n lineHeight: '1.6',\n }}\n >\n {t('login.note')}\n </Paragraph>\n </div>\n </Space>\n </LoginCard>\n );\n}\n\n"],"names":["KeyOutlined","props","ref","AntdIcon","_extends","KeyOutlinedSvg","RefIcon","React.forwardRef","RocketOutlined","RocketOutlinedSvg","SafetyOutlined","SafetyOutlinedSvg","MAX_POLLING_DURATION","useLoginPolling","enabled","onAuthenticated","refetchAuthStatus","isAuthenticated","pollingIntervalRef","useRef","pollingStartTimeRef","stopPolling","useCallback","useEffect","message","result","error","useInteractiveLogin","onLoginSuccess","startPolling","queryClient","useQueryClient","isInteractiveLoginActiveRef","handleLoginSuccess","QUERY_KEYS","resolve","authenticated","maxRetries","attempt","handleElectronLoginSuccess","data","errorMessage","handleElectronLoginError","cleanupLoginSuccess","cleanupLoginError","handleInteractiveLogin","configData","username","password","proxy","api","apiError","handleCheckStatus","useLoginFlow","t","useTranslation","navigate","useNavigate","loginMode","setLoginMode","useState","loginStep","setLoginStep","pollingEnabled","setPollingEnabled","authStatus","authStatusLoading","useQuery","loginWithTokenAsync","isLoggingInWithToken","useAuth","checkAuth","response","refetchAuthStatusWrapper","handleLogin","values","refreshToken","errorCode","extractErrorInfo","translateErrorCode","LoginCard","children","jsxs","jsx","Card","Title","Text","Typography","LoginHeader","LoginFeatures","Space","CheckCircleOutlined","LoginSteps","current","Steps","ThunderboltOutlined","LoginModeSelector","value","onChange","onResetFields","Fragment","Form","Radio","e","Alert","LoginForm","isLoggingIn","onLogin","onCheckStatus","form","isLoading","handleSubmit","Input","Button","LoginOutlined","ReloadOutlined","Paragraph","Login","Spin","Divider"],"mappings":"8iBACA,IAAIA,GAAc,CAAE,KAAQ,CAAE,IAAO,MAAO,MAAS,CAAE,QAAW,gBAAiB,UAAa,OAAO,EAAI,SAAY,CAAC,CAAE,IAAO,OAAQ,MAAS,CAAE,EAAK,snBAAsnB,EAAI,CAAC,EAAI,KAAQ,MAAO,MAAS,UAAU,ECMtzBA,GAAc,SAAqBC,EAAOC,EAAK,CACjD,uBAAwCC,EAAUC,EAAS,CAAA,EAAIH,EAAO,CACpE,IAAAC,EACA,KAAMG,EAAA,CACP,CAAC,CACJ,EAGIC,EAAuBC,EAAAA,WAAiBP,EAAW,ECdnDQ,GAAiB,CAAE,KAAQ,CAAE,IAAO,MAAO,MAAS,CAAE,QAAW,gBAAiB,UAAa,OAAO,EAAI,SAAY,CAAC,CAAE,IAAO,OAAQ,MAAS,CAAE,EAAK,m7BAAm7B,EAAI,CAAC,EAAI,KAAQ,SAAU,MAAS,UAAU,ECMznCA,GAAiB,SAAwBP,EAAOC,EAAK,CACvD,uBAAwCC,EAAUC,EAAS,CAAA,EAAIH,EAAO,CACpE,IAAAC,EACA,KAAMO,EAAA,CACP,CAAC,CACJ,EAGIH,GAAuBC,EAAAA,WAAiBC,EAAc,ECdtDE,GAAiB,CAAE,KAAQ,CAAE,IAAO,MAAO,MAAS,CAAE,QAAW,gBAAiB,UAAa,OAAO,EAAI,SAAY,CAAC,CAAE,IAAO,OAAQ,MAAS,CAAE,EAAK,0JAA0J,CAAE,EAAI,CAAE,IAAO,OAAQ,MAAS,CAAE,EAAK,iMAAi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A/C,EACA,YAAAgD,EACA,qBAAArC,EACA,QAASK,EACT,cAAetB,CAAA,CAAA,QAGhBmE,EAAA,CAAQ,MAAO,CAAE,OAAQ,SAAW,QAEpC,MAAA,CAAI,MAAO,CAAE,UAAW,UACvB,SAAApC,EAAAA,IAACiC,GAAA,CACC,KAAK,YACL,MAAO,CACL,SAAU,OACV,OAAQ,aACR,WAAY,KAAA,EAGb,WAAE,YAAY,CAAA,CAAA,CACjB,CACF,CAAA,CAAA,CACF,CAAA,CACF,CAEJ","x_google_ignoreList":[0,1,2,3,4,5]}
@@ -1,19 +0,0 @@
1
- import{t as at,v as zt,aI as ct,y as lt,aJ as H,z as F,r as f,C as Pe,aK as ht,m as D,ad as ut,a4 as Mt,I as dt,_ as ft,a as Xe,T as pt,u as Ut,Q as Re,b as ee,j as a,d as Vt,V as gt,B as Z,R as Ht,X as Te,c as Wt,aG as Kt,W as Ne,s as pe}from"./index-BFgUdwJv.js";import{u as Yt}from"./errorCodeTranslator-DWsWq6B3.js";import{u as Xt,F as Qt}from"./useErrorHandler-DWHs3RlU.js";import{R as Ie,C as I,a as J}from"./row-FRqVdQDX.js";import{S as oe}from"./index-DjpD0HQ5.js";import{S as Qe}from"./index-wvielV9A.js";import{P as Zt}from"./index-WaraZQH0.js";import{I as Jt}from"./index-Dycn6xoz.js";import{f as Ze}from"./dateUtils-CBk8bEa_.js";import{T as Je}from"./index-lwTtspUb.js";import{T as mt,R as Gt}from"./index-pT0W4KjK.js";import"./ActionButton-DWq-fh3_.js";const es=new H("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),ts=new H("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),ss=new H("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),ns=new H("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),rs=new H("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),is=new H("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),os=s=>{const{componentCls:e,iconCls:t,antCls:n,badgeShadowSize:r,textFontSize:i,textFontSizeSM:o,statusSize:c,dotSize:l,textFontWeight:y,indicatorHeight:d,indicatorHeightSM:h,marginXS:b,calc:x}=s,_=`${n}-scroll-number`,u=ct(s,(p,{darkColor:S})=>({[`&${e} ${e}-color-${p}`]:{background:S,[`&:not(${e}-count)`]:{color:S},"a:hover &":{background:S}}}));return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},lt(s)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,[`${e}-count`]:{display:"inline-flex",justifyContent:"center",zIndex:s.indicatorZIndex,minWidth:d,height:d,color:s.badgeTextColor,fontWeight:y,fontSize:i,lineHeight:F(d),whiteSpace:"nowrap",textAlign:"center",background:s.badgeColor,borderRadius:x(d).div(2).equal(),boxShadow:`0 0 0 ${F(r)} ${s.badgeShadowColor}`,transition:`background ${s.motionDurationMid}`,a:{color:s.badgeTextColor},"a:hover":{color:s.badgeTextColor},"a:hover &":{background:s.badgeColorHover}},[`${e}-count-sm`]:{minWidth:h,height:h,fontSize:o,lineHeight:F(h),borderRadius:x(h).div(2).equal()},[`${e}-multiple-words`]:{padding:`0 ${F(s.paddingXS)}`,bdi:{unicodeBidi:"plaintext"}},[`${e}-dot`]:{zIndex:s.indicatorZIndex,width:l,minWidth:l,height:l,background:s.badgeColor,borderRadius:"100%",boxShadow:`0 0 0 ${F(r)} ${s.badgeShadowColor}`},[`${e}-count, ${e}-dot, ${_}-custom-component`]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",[`&${t}-spin`]:{animationName:is,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&${e}-status`]:{lineHeight:"inherit",verticalAlign:"baseline",[`${e}-status-dot`]:{position:"relative",top:-1,display:"inline-block",width:c,height:c,verticalAlign:"middle",borderRadius:"50%"},[`${e}-status-success`]:{backgroundColor:s.colorSuccess},[`${e}-status-processing`]:{overflow:"visible",color:s.colorInfo,backgroundColor:s.colorInfo,borderColor:"currentcolor","&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:r,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:es,animationDuration:s.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},[`${e}-status-default`]:{backgroundColor:s.colorTextPlaceholder},[`${e}-status-error`]:{backgroundColor:s.colorError},[`${e}-status-warning`]:{backgroundColor:s.colorWarning},[`${e}-status-text`]:{marginInlineStart:b,color:s.colorText,fontSize:s.fontSize}}}),u),{[`${e}-zoom-appear, ${e}-zoom-enter`]:{animationName:ts,animationDuration:s.motionDurationSlow,animationTimingFunction:s.motionEaseOutBack,animationFillMode:"both"},[`${e}-zoom-leave`]:{animationName:ss,animationDuration:s.motionDurationSlow,animationTimingFunction:s.motionEaseOutBack,animationFillMode:"both"},[`&${e}-not-a-wrapper`]:{[`${e}-zoom-appear, ${e}-zoom-enter`]:{animationName:ns,animationDuration:s.motionDurationSlow,animationTimingFunction:s.motionEaseOutBack},[`${e}-zoom-leave`]:{animationName:rs,animationDuration:s.motionDurationSlow,animationTimingFunction:s.motionEaseOutBack},[`&:not(${e}-status)`]:{verticalAlign:"middle"},[`${_}-custom-component, ${e}-count`]:{transform:"none"},[`${_}-custom-component, ${_}`]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[_]:{overflow:"hidden",transition:`all ${s.motionDurationMid} ${s.motionEaseOutBack}`,[`${_}-only`]:{position:"relative",display:"inline-block",height:d,transition:`all ${s.motionDurationSlow} ${s.motionEaseOutBack}`,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",[`> p${_}-only-unit`]:{height:d,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},[`${_}-symbol`]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",[`${e}-count, ${e}-dot, ${_}-custom-component`]:{transform:"translate(-50%, -50%)"}}})}},yt=s=>{const{fontHeight:e,lineWidth:t,marginXS:n,colorBorderBg:r}=s,i=e,o=t,c=s.colorTextLightSolid,l=s.colorError,y=s.colorErrorHover;return zt(s,{badgeFontHeight:i,badgeShadowSize:o,badgeTextColor:c,badgeColor:l,badgeColorHover:y,badgeShadowColor:r,badgeProcessingDuration:"1.2s",badgeRibbonOffset:n,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},bt=s=>{const{fontSize:e,lineHeight:t,fontSizeSM:n,lineWidth:r}=s;return{indicatorZIndex:"auto",indicatorHeight:Math.round(e*t)-2*r,indicatorHeightSM:e,dotSize:n/2,textFontSize:n,textFontSizeSM:n,textFontWeight:"normal",statusSize:n/2}},as=at("Badge",s=>{const e=yt(s);return os(e)},bt),cs=s=>{const{antCls:e,badgeFontHeight:t,marginXS:n,badgeRibbonOffset:r,calc:i}=s,o=`${e}-ribbon`,c=`${e}-ribbon-wrapper`,l=ct(s,(y,{darkColor:d})=>({[`&${o}-color-${y}`]:{background:d,color:d}}));return{[c]:{position:"relative"},[o]:Object.assign(Object.assign(Object.assign(Object.assign({},lt(s)),{position:"absolute",top:n,padding:`0 ${F(s.paddingXS)}`,color:s.colorPrimary,lineHeight:F(t),whiteSpace:"nowrap",backgroundColor:s.colorPrimary,borderRadius:s.borderRadiusSM,[`${o}-text`]:{color:s.badgeTextColor},[`${o}-corner`]:{position:"absolute",top:"100%",width:r,height:r,color:"currentcolor",border:`${F(i(r).div(2).equal())} solid`,transform:s.badgeRibbonCornerTransform,transformOrigin:"top",filter:s.badgeRibbonCornerFilter}}),l),{[`&${o}-placement-end`]:{insetInlineEnd:i(r).mul(-1).equal(),borderEndEndRadius:0,[`${o}-corner`]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},[`&${o}-placement-start`]:{insetInlineStart:i(r).mul(-1).equal(),borderEndStartRadius:0,[`${o}-corner`]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}},ls=at(["Badge","Ribbon"],s=>{const e=yt(s);return cs(e)},bt),hs=s=>{const{className:e,prefixCls:t,style:n,color:r,children:i,text:o,placement:c="end",rootClassName:l}=s,{getPrefixCls:y,direction:d}=f.useContext(Pe),h=y("ribbon",t),b=`${h}-wrapper`,[x,_,u]=ls(h,b),p=ht(r,!1),S=D(h,`${h}-placement-${c}`,{[`${h}-rtl`]:d==="rtl",[`${h}-color-${r}`]:p},e),v={},O={};return r&&!p&&(v.background=r,O.color=r),x(f.createElement("div",{className:D(b,l,_,u)},i,f.createElement("div",{className:D(S,_),style:Object.assign(Object.assign({},v),n)},f.createElement("span",{className:`${h}-text`},o),f.createElement("div",{className:`${h}-corner`,style:O}))))},Ge=s=>{const{prefixCls:e,value:t,current:n,offset:r=0}=s;let i;return r&&(i={position:"absolute",top:`${r}00%`,left:0}),f.createElement("span",{style:i,className:D(`${e}-only-unit`,{current:n})},t)};function us(s,e,t){let n=s,r=0;for(;(n+10)%10!==e;)n+=t,r+=t;return r}const ds=s=>{const{prefixCls:e,count:t,value:n}=s,r=Number(n),i=Math.abs(t),[o,c]=f.useState(r),[l,y]=f.useState(i),d=()=>{c(r),y(i)};f.useEffect(()=>{const x=setTimeout(d,1e3);return()=>clearTimeout(x)},[r]);let h,b;if(o===r||Number.isNaN(r)||Number.isNaN(o))h=[f.createElement(Ge,Object.assign({},s,{key:r,current:!0}))],b={transition:"none"};else{h=[];const x=r+10,_=[];for(let v=r;v<=x;v+=1)_.push(v);const u=l<i?1:-1,p=_.findIndex(v=>v%10===o);h=(u<0?_.slice(0,p+1):_.slice(p)).map((v,O)=>{const R=v%10;return f.createElement(Ge,Object.assign({},s,{key:v,value:R,offset:u<0?O-p:O,current:O===p}))}),b={transform:`translateY(${-us(o,r,u)}00%)`}}return f.createElement("span",{className:`${e}-only`,style:b,onTransitionEnd:d},h)};var fs=function(s,e){var t={};for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&e.indexOf(n)<0&&(t[n]=s[n]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(s);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(s,n[r])&&(t[n[r]]=s[n[r]]);return t};const ps=f.forwardRef((s,e)=>{const{prefixCls:t,count:n,className:r,motionClassName:i,style:o,title:c,show:l,component:y="sup",children:d}=s,h=fs(s,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:b}=f.useContext(Pe),x=b("scroll-number",t),_=Object.assign(Object.assign({},h),{"data-show":l,style:o,className:D(x,r,i),title:c});let u=n;if(n&&Number(n)%1===0){const p=String(n).split("");u=f.createElement("bdi",null,p.map((S,v)=>f.createElement(ds,{prefixCls:x,count:Number(n),value:S,key:p.length-v})))}return o?.borderColor&&(_.style=Object.assign(Object.assign({},o),{boxShadow:`0 0 0 1px ${o.borderColor} inset`})),d?ut(d,p=>({className:D(`${x}-custom-component`,p?.className,i)})):f.createElement(y,Object.assign({},_,{ref:e}),u)});var gs=function(s,e){var t={};for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&e.indexOf(n)<0&&(t[n]=s[n]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(s);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(s,n[r])&&(t[n[r]]=s[n[r]]);return t};const ms=f.forwardRef((s,e)=>{var t,n,r,i,o;const{prefixCls:c,scrollNumberPrefixCls:l,children:y,status:d,text:h,color:b,count:x=null,overflowCount:_=99,dot:u=!1,size:p="default",title:S,offset:v,style:O,className:R,rootClassName:P,classNames:k,styles:T,showZero:z=!1}=s,te=gs(s,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:w,direction:K,badge:g}=f.useContext(Pe),C=w("badge",c),[se,Bt,Lt]=as(C),ye=x>_?`${_}+`:x,Y=ye==="0"||ye===0||h==="0"||h===0,Ue=x===null||Y&&!z,be=(d!=null||b!=null)&&Ue,$t=d!=null||!Y,X=u&&!Y,M=X?"":ye,U=f.useMemo(()=>((M==null||M==="")&&(h==null||h==="")||Y&&!z)&&!X,[M,Y,z,X,h]),Ve=f.useRef(x);U||(Ve.current=x);const V=Ve.current,He=f.useRef(M);U||(He.current=M);const ve=He.current,We=f.useRef(X);U||(We.current=X);const ne=f.useMemo(()=>{if(!v)return Object.assign(Object.assign({},g?.style),O);const B={marginTop:v[1]};return K==="rtl"?B.left=Number.parseInt(v[0],10):B.right=-Number.parseInt(v[0],10),Object.assign(Object.assign(Object.assign({},B),g?.style),O)},[K,v,O,g?.style]),jt=S??(typeof V=="string"||typeof V=="number"?V:void 0),Ke=!U&&(h===0?z:!!h&&h!==!0),Pt=Ke?f.createElement("span",{className:`${C}-status-text`},h):null,It=!V||typeof V!="object"?void 0:ut(V,B=>({style:Object.assign(Object.assign({},ne),B.style)})),re=ht(b,!1),Dt=D(k?.indicator,(t=g?.classNames)===null||t===void 0?void 0:t.indicator,{[`${C}-status-dot`]:be,[`${C}-status-${d}`]:!!d,[`${C}-color-${b}`]:re}),_e={};b&&!re&&(_e.color=b,_e.background=b);const Ye=D(C,{[`${C}-status`]:be,[`${C}-not-a-wrapper`]:!y,[`${C}-rtl`]:K==="rtl"},R,P,g?.className,(n=g?.classNames)===null||n===void 0?void 0:n.root,k?.root,Bt,Lt);if(!y&&be&&(h||$t||!Ue)){const B=ne.color;return se(f.createElement("span",Object.assign({},te,{className:Ye,style:Object.assign(Object.assign(Object.assign({},T?.root),(r=g?.styles)===null||r===void 0?void 0:r.root),ne)}),f.createElement("span",{className:Dt,style:Object.assign(Object.assign(Object.assign({},T?.indicator),(i=g?.styles)===null||i===void 0?void 0:i.indicator),_e)}),Ke&&f.createElement("span",{style:{color:B},className:`${C}-status-text`},h)))}return se(f.createElement("span",Object.assign({ref:e},te,{className:Ye,style:Object.assign(Object.assign({},(o=g?.styles)===null||o===void 0?void 0:o.root),T?.root)}),y,f.createElement(Mt,{visible:!U,motionName:`${C}-zoom`,motionAppear:!1,motionDeadline:1e3},({className:B})=>{var we,xe;const Ft=w("scroll-number",l),Ce=We.current,qt=D(k?.indicator,(we=g?.classNames)===null||we===void 0?void 0:we.indicator,{[`${C}-dot`]:Ce,[`${C}-count`]:!Ce,[`${C}-count-sm`]:p==="small",[`${C}-multiple-words`]:!Ce&&ve&&ve.toString().length>1,[`${C}-status-${d}`]:!!d,[`${C}-color-${b}`]:re});let ie=Object.assign(Object.assign(Object.assign({},T?.indicator),(xe=g?.styles)===null||xe===void 0?void 0:xe.indicator),ne);return b&&!re&&(ie=ie||{},ie.background=b),f.createElement(ps,{prefixCls:Ft,show:!U,motionClassName:B,className:qt,count:ve,title:jt,style:ie,key:"scrollNumber"},It)}),Pt))}),le=ms;le.Ribbon=hs;var ys={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},bs=function(e,t){return f.createElement(dt,ft({},e,{ref:t,icon:ys}))},vs=f.forwardRef(bs),_s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M859.9 780H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM505.7 669a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V176c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8z"}}]},name:"vertical-align-bottom",theme:"outlined"},ws=function(e,t){return f.createElement(dt,ft({},e,{ref:t,icon:_s}))},xs=f.forwardRef(ws);const et={async getLogs(s){return(await Xe.getLogs(s)).data.data},async clearLogs(){await Xe.clearLogs()}};function Cs(s){const e=pt(),{handleError:t}=Xt(),{data:n,isLoading:r,error:i,refetch:o}=Ut({queryKey:Re.LOGS(s),queryFn:()=>et.getLogs(s)}),c=Yt({mutationFn:()=>et.clearLogs(),onSuccess:()=>{e.invalidateQueries({queryKey:Re.LOGS()})},onError:l=>t(l)});return{logs:n?.logs??[],total:n?.total??0,page:n?.page??1,limit:n?.limit??20,isLoading:r,error:i,refetch:o,clear:c.mutate,clearAsync:c.mutateAsync,isClearing:c.isPending}}const j=Object.create(null);j.open="0";j.close="1";j.ping="2";j.pong="3";j.message="4";j.upgrade="5";j.noop="6";const he=Object.create(null);Object.keys(j).forEach(s=>{he[j[s]]=s});const ke={type:"error",data:"parser error"},vt=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",_t=typeof ArrayBuffer=="function",wt=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,De=({type:s,data:e},t,n)=>vt&&e instanceof Blob?t?n(e):tt(e,n):_t&&(e instanceof ArrayBuffer||wt(e))?t?n(e):tt(new Blob([e]),n):n(j[s]+(e||"")),tt=(s,e)=>{const t=new FileReader;return t.onload=function(){const n=t.result.split(",")[1];e("b"+(n||""))},t.readAsDataURL(s)};function st(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}let Se;function Ss(s,e){if(vt&&s.data instanceof Blob)return s.data.arrayBuffer().then(st).then(e);if(_t&&(s.data instanceof ArrayBuffer||wt(s.data)))return e(st(s.data));De(s,!1,t=>{Se||(Se=new TextEncoder),e(Se.encode(t))})}const nt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",G=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<nt.length;s++)G[nt.charCodeAt(s)]=s;const Es=s=>{let e=s.length*.75,t=s.length,n,r=0,i,o,c,l;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);const y=new ArrayBuffer(e),d=new Uint8Array(y);for(n=0;n<t;n+=4)i=G[s.charCodeAt(n)],o=G[s.charCodeAt(n+1)],c=G[s.charCodeAt(n+2)],l=G[s.charCodeAt(n+3)],d[r++]=i<<2|o>>4,d[r++]=(o&15)<<4|c>>2,d[r++]=(c&3)<<6|l&63;return y},Os=typeof ArrayBuffer=="function",Fe=(s,e)=>{if(typeof s!="string")return{type:"message",data:xt(s,e)};const t=s.charAt(0);return t==="b"?{type:"message",data:Rs(s.substring(1),e)}:he[t]?s.length>1?{type:he[t],data:s.substring(1)}:{type:he[t]}:ke},Rs=(s,e)=>{if(Os){const t=Es(s);return xt(t,e)}else return{base64:!0,data:s}},xt=(s,e)=>{switch(e){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}},Ct="",Ts=(s,e)=>{const t=s.length,n=new Array(t);let r=0;s.forEach((i,o)=>{De(i,!1,c=>{n[o]=c,++r===t&&e(n.join(Ct))})})},Ns=(s,e)=>{const t=s.split(Ct),n=[];for(let r=0;r<t.length;r++){const i=Fe(t[r],e);if(n.push(i),i.type==="error")break}return n};function ks(){return new TransformStream({transform(s,e){Ss(s,t=>{const n=t.length;let r;if(n<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,n);else if(n<65536){r=new Uint8Array(3);const i=new DataView(r.buffer);i.setUint8(0,126),i.setUint16(1,n)}else{r=new Uint8Array(9);const i=new DataView(r.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(n))}s.data&&typeof s.data!="string"&&(r[0]|=128),e.enqueue(r),e.enqueue(t)})}})}let Ee;function ae(s){return s.reduce((e,t)=>e+t.length,0)}function ce(s,e){if(s[0].length===e)return s.shift();const t=new Uint8Array(e);let n=0;for(let r=0;r<e;r++)t[r]=s[0][n++],n===s[0].length&&(s.shift(),n=0);return s.length&&n<s[0].length&&(s[0]=s[0].slice(n)),t}function As(s,e){Ee||(Ee=new TextDecoder);const t=[];let n=0,r=-1,i=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(n===0){if(ae(t)<1)break;const l=ce(t,1);i=(l[0]&128)===128,r=l[0]&127,r<126?n=3:r===126?n=1:n=2}else if(n===1){if(ae(t)<2)break;const l=ce(t,2);r=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),n=3}else if(n===2){if(ae(t)<8)break;const l=ce(t,8),y=new DataView(l.buffer,l.byteOffset,l.length),d=y.getUint32(0);if(d>Math.pow(2,21)-1){c.enqueue(ke);break}r=d*Math.pow(2,32)+y.getUint32(4),n=3}else{if(ae(t)<r)break;const l=ce(t,r);c.enqueue(Fe(i?l:Ee.decode(l),e)),n=0}if(r===0||r>s){c.enqueue(ke);break}}}})}const St=4;function E(s){if(s)return Bs(s)}function Bs(s){for(var e in E.prototype)s[e]=E.prototype[e];return s}E.prototype.on=E.prototype.addEventListener=function(s,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(e),this};E.prototype.once=function(s,e){function t(){this.off(s,t),e.apply(this,arguments)}return t.fn=e,this.on(s,t),this};E.prototype.off=E.prototype.removeListener=E.prototype.removeAllListeners=E.prototype.removeEventListener=function(s,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+s];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var n,r=0;r<t.length;r++)if(n=t[r],n===e||n.fn===e){t.splice(r,1);break}return t.length===0&&delete this._callbacks["$"+s],this};E.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+s],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,r=t.length;n<r;++n)t[n].apply(this,e)}return this};E.prototype.emitReserved=E.prototype.emit;E.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};E.prototype.hasListeners=function(s){return!!this.listeners(s).length};const ge=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),N=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Ls="arraybuffer";function Et(s,...e){return e.reduce((t,n)=>(s.hasOwnProperty(n)&&(t[n]=s[n]),t),{})}const $s=N.setTimeout,js=N.clearTimeout;function me(s,e){e.useNativeTimers?(s.setTimeoutFn=$s.bind(N),s.clearTimeoutFn=js.bind(N)):(s.setTimeoutFn=N.setTimeout.bind(N),s.clearTimeoutFn=N.clearTimeout.bind(N))}const Ps=1.33;function Is(s){return typeof s=="string"?Ds(s):Math.ceil((s.byteLength||s.size)*Ps)}function Ds(s){let e=0,t=0;for(let n=0,r=s.length;n<r;n++)e=s.charCodeAt(n),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(n++,t+=4);return t}function Ot(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Fs(s){let e="";for(let t in s)s.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(s[t]));return e}function qs(s){let e={},t=s.split("&");for(let n=0,r=t.length;n<r;n++){let i=t[n].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}class zs extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class qe extends E{constructor(e){super(),this.writable=!1,me(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new zs(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=Fe(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=Fs(e);return t.length?"?"+t:""}}class Ms extends qe{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||t()})),this.writable||(n++,this.once("drain",function(){--n||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};Ns(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Ts(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=Ot()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let Rt=!1;try{Rt=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Us=Rt;function Vs(){}class Hs extends Ms{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let n=location.port;n||(n=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",(r,i)=>{this.onError("xhr post error",r,i)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,n)=>{this.onError("xhr poll error",t,n)}),this.pollXhr=e}}class $ extends E{constructor(e,t,n){super(),this.createRequest=e,me(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;const t=Et(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(t);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this._opts.extraHeaders[r])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var r;n.readyState===3&&((r=this._opts.cookieJar)===null||r===void 0||r.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(r){this.setTimeoutFn(()=>{this._onError(r)},0);return}typeof document<"u"&&(this._index=$.requestsCount++,$.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Vs,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete $.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}$.requestsCount=0;$.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",rt);else if(typeof addEventListener=="function"){const s="onpagehide"in N?"pagehide":"unload";addEventListener(s,rt,!1)}}function rt(){for(let s in $.requests)$.requests.hasOwnProperty(s)&&$.requests[s].abort()}const Ws=(function(){const s=Tt({xdomain:!1});return s&&s.responseType!==null})();class Ks extends Hs{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=Ws&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new $(Tt,this.uri(),e)}}function Tt(s){const e=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Us))return new XMLHttpRequest}catch{}if(!e)try{return new N[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Nt=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Ys extends qe{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,n=Nt?{}:Et(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(r){return this.emitReserved("error",r)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;De(n,this.supportsBinary,i=>{try{this.doWrite(n,i)}catch{}r&&ge(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=Ot()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const Oe=N.WebSocket||N.MozWebSocket;class Xs extends Ys{createSocket(e,t,n){return Nt?new Oe(e,t,n):t?new Oe(e,t):new Oe(e)}doWrite(e,t){this.ws.send(t)}}class Qs extends qe{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=As(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=ks();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();const i=()=>{n.read().then(({done:c,value:l})=>{c||(this.onPacket(l),i())}).catch(c=>{})};i();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&ge(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Zs={websocket:Xs,webtransport:Qs,polling:Ks},Js=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Gs=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ae(s){if(s.length>8e3)throw"URI too long";const e=s,t=s.indexOf("["),n=s.indexOf("]");t!=-1&&n!=-1&&(s=s.substring(0,t)+s.substring(t,n).replace(/:/g,";")+s.substring(n,s.length));let r=Js.exec(s||""),i={},o=14;for(;o--;)i[Gs[o]]=r[o]||"";return t!=-1&&n!=-1&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=en(i,i.path),i.queryKey=tn(i,i.query),i}function en(s,e){const t=/\/{2,9}/g,n=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function tn(s,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,r,i){r&&(t[r]=i)}),t}const Be=typeof addEventListener=="function"&&typeof removeEventListener=="function",ue=[];Be&&addEventListener("offline",()=>{ue.forEach(s=>s())},!1);class q extends E{constructor(e,t){if(super(),this.binaryType=Ls,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const n=Ae(e);t.hostname=n.host,t.secure=n.protocol==="https"||n.protocol==="wss",t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=Ae(t.host).host);me(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(n=>{const r=n.prototype.name;this.transports.push(r),this._transportsByName[r]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=qs(this.opts.query)),Be&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ue.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=St,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&q.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",q.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(t+=Is(r)),n>0&&t>this._maxPayload)return this.writeBuffer.slice(0,n);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,ge(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,r){if(typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const i={type:e,data:t,options:n};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(q.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Be&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=ue.indexOf(this._offlineEventListener);n!==-1&&ue.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}q.protocol=St;class sn extends q{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;q.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",h=>{if(!n)if(h.type==="pong"&&h.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;q.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(d(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const b=new Error("probe error");b.transport=t.name,this.emitReserved("upgradeError",b)}}))};function i(){n||(n=!0,d(),t.close(),t=null)}const o=h=>{const b=new Error("probe error: "+h);b.transport=t.name,i(),this.emitReserved("upgradeError",b)};function c(){o("transport closed")}function l(){o("socket closed")}function y(h){t&&h.name!==t.name&&i()}const d=()=>{t.removeListener("open",r),t.removeListener("error",o),t.removeListener("close",c),this.off("close",l),this.off("upgrading",y)};t.once("open",r),t.once("error",o),t.once("close",c),this.once("close",l),this.once("upgrading",y),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}let nn=class extends sn{constructor(e,t={}){const n=typeof e=="object"?e:t;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(r=>Zs[r]).filter(r=>!!r)),super(e,n)}};function rn(s,e="",t){let n=s;t=t||typeof location<"u"&&location,s==null&&(s=t.protocol+"//"+t.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=t.protocol+s:s=t.host+s),/^(https?|wss?):\/\//.test(s)||(typeof t<"u"?s=t.protocol+"//"+s:s="https://"+s),n=Ae(s)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const i=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+i+":"+n.port+e,n.href=n.protocol+"://"+i+(t&&t.port===n.port?"":":"+n.port),n}const on=typeof ArrayBuffer=="function",an=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,kt=Object.prototype.toString,cn=typeof Blob=="function"||typeof Blob<"u"&&kt.call(Blob)==="[object BlobConstructor]",ln=typeof File=="function"||typeof File<"u"&&kt.call(File)==="[object FileConstructor]";function ze(s){return on&&(s instanceof ArrayBuffer||an(s))||cn&&s instanceof Blob||ln&&s instanceof File}function de(s,e){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let t=0,n=s.length;t<n;t++)if(de(s[t]))return!0;return!1}if(ze(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return de(s.toJSON(),!0);for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&de(s[t]))return!0;return!1}function hn(s){const e=[],t=s.data,n=s;return n.data=Le(t,e),n.attachments=e.length,{packet:n,buffers:e}}function Le(s,e){if(!s)return s;if(ze(s)){const t={_placeholder:!0,num:e.length};return e.push(s),t}else if(Array.isArray(s)){const t=new Array(s.length);for(let n=0;n<s.length;n++)t[n]=Le(s[n],e);return t}else if(typeof s=="object"&&!(s instanceof Date)){const t={};for(const n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=Le(s[n],e));return t}return s}function un(s,e){return s.data=$e(s.data,e),delete s.attachments,s}function $e(s,e){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<e.length)return e[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let t=0;t<s.length;t++)s[t]=$e(s[t],e);else if(typeof s=="object")for(const t in s)Object.prototype.hasOwnProperty.call(s,t)&&(s[t]=$e(s[t],e));return s}const dn=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],fn=5;var m;(function(s){s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK"})(m||(m={}));class pn{constructor(e){this.replacer=e}encode(e){return(e.type===m.EVENT||e.type===m.ACK)&&de(e)?this.encodeAsBinary({type:e.type===m.EVENT?m.BINARY_EVENT:m.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===m.BINARY_EVENT||e.type===m.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=hn(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}}function it(s){return Object.prototype.toString.call(s)==="[object Object]"}class Me extends E{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===m.BINARY_EVENT;n||t.type===m.BINARY_ACK?(t.type=n?m.EVENT:m.ACK,this.reconstructor=new gn(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(ze(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(m[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===m.BINARY_EVENT||n.type===m.BINARY_ACK){const i=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const o=e.substring(i,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");n.attachments=Number(o)}if(e.charAt(t+1)==="/"){const i=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(i,t)}else n.nsp="/";const r=e.charAt(t+1);if(r!==""&&Number(r)==r){const i=t+1;for(;++t;){const o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}n.id=Number(e.substring(i,t+1))}if(e.charAt(++t)){const i=this.tryParse(e.substr(t));if(Me.isPayloadValid(n.type,i))n.data=i;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case m.CONNECT:return it(t);case m.DISCONNECT:return t===void 0;case m.CONNECT_ERROR:return typeof t=="string"||it(t);case m.EVENT:case m.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&dn.indexOf(t[0])===-1);case m.ACK:case m.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class gn{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=un(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const mn=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Me,Encoder:pn,get PacketType(){return m},protocol:fn},Symbol.toStringTag,{value:"Module"}));function A(s,e,t){return s.on(e,t),function(){s.off(e,t)}}const yn=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class At extends E{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[A(e,"open",this.onopen.bind(this)),A(e,"packet",this.onpacket.bind(this)),A(e,"error",this.onerror.bind(this)),A(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var n,r,i;if(yn.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const o={type:m.EVENT,data:t};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const d=this.ids++,h=t.pop();this._registerAckCallback(d,h),o.id=d}const c=(r=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||r===void 0?void 0:r.writable,l=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!c||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,t){var n;const r=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(r===void 0){this.acks[e]=t;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===e&&this.sendBuffer.splice(c,1);t.call(this,new Error("operation has timed out"))},r),o=(...c)=>{this.io.clearTimeoutFn(i),t.apply(this,c)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((n,r)=>{const i=(o,c)=>o?r(o):n(c);i.withError=!0,t.push(i),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((r,...i)=>n!==this._queue[0]?void 0:(r!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(r)):(this._queue.shift(),t&&t(null,...i)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:m.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case m.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case m.EVENT:case m.BINARY_EVENT:this.onevent(e);break;case m.ACK:case m.BINARY_ACK:this.onack(e);break;case m.DISCONNECT:this.ondisconnect();break;case m.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:m.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:m.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function W(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}W.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*s);s=(Math.floor(e*10)&1)==0?s-t:s+t}return Math.min(s,this.max)|0};W.prototype.reset=function(){this.attempts=0};W.prototype.setMin=function(s){this.ms=s};W.prototype.setMax=function(s){this.max=s};W.prototype.setJitter=function(s){this.jitter=s};class je extends E{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,me(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((n=t.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new W({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||mn;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new nn(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=A(t,"open",function(){n.onopen(),e&&e()}),i=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},o=A(t,"error",i);if(this._timeout!==!1){const c=this._timeout,l=this.setTimeoutFn(()=>{r(),i(new Error("timeout")),t.close()},c);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(A(e,"ping",this.onping.bind(this)),A(e,"data",this.ondata.bind(this)),A(e,"error",this.onerror.bind(this)),A(e,"close",this.onclose.bind(this)),A(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){ge(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new At(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t)if(this.nsps[n].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(r=>{r?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",r)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Q={};function fe(s,e){typeof s=="object"&&(e=s,s=void 0),e=e||{};const t=rn(s,e.path||"/socket.io"),n=t.source,r=t.id,i=t.path,o=Q[r]&&i in Q[r].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return c?l=new je(n,e):(Q[r]||(Q[r]=new je(n,e)),l=Q[r]),t.query&&!e.query&&(e.query=t.queryKey),l.socket(t.path,e)}Object.assign(fe,{Manager:je,Socket:At,io:fe,connect:fe});function bn(s){const e=pt(),[t,n]=f.useState(null);return f.useEffect(()=>{if(s){const i=fe("",{transports:["websocket","polling"]});return i.on("connect",()=>{console.log("WebSocket connected"),i.emit("subscribe","logs")}),i.on("log",o=>{e.invalidateQueries({queryKey:Re.LOGS()})}),i.on("disconnect",()=>{console.log("WebSocket disconnected")}),n(i),()=>{i.close()}}else t&&(t.close(),n(null))},[s,e,t]),t}function vn(s,e,t,n){const r=f.useRef(null);f.useEffect(()=>(e&&s&&t.length>0&&(r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{const i=n.current?.querySelector(".ant-table-body");i&&(i.scrollTop=i.scrollHeight)},100)),()=>{r.current&&clearTimeout(r.current)}),[t,e,s,n])}function _n({total:s,error:e,warn:t,info:n}){const{t:r}=ee();return a.jsxs(Ie,{gutter:16,style:{marginBottom:16},children:[a.jsx(I,{span:6,children:a.jsx(J,{children:a.jsx(oe,{title:r("logs.totalLogs"),value:s,prefix:a.jsx(Vt,{}),valueStyle:{fontSize:"20px"}})})}),a.jsx(I,{span:6,children:a.jsx(J,{children:a.jsx(oe,{title:r("logs.errors"),value:e,prefix:a.jsx(le,{status:"error"}),valueStyle:{color:"#cf1322",fontSize:"20px"}})})}),a.jsx(I,{span:6,children:a.jsx(J,{children:a.jsx(oe,{title:r("logs.warnings"),value:t,prefix:a.jsx(le,{status:"warning"}),valueStyle:{color:"#fa8c16",fontSize:"20px"}})})}),a.jsx(I,{span:6,children:a.jsx(J,{children:a.jsx(oe,{title:r("logs.info"),value:n,prefix:a.jsx(le,{status:"processing"}),valueStyle:{color:"#1890ff",fontSize:"20px"}})})})]})}function wn({autoRefresh:s,autoScroll:e,isLoading:t,isClearing:n,hasLogs:r,onAutoRefreshChange:i,onAutoScrollChange:o,onRefresh:c,onScrollToBottom:l,onExport:y,onClear:d}){const{t:h}=ee();return a.jsxs(gt,{children:[a.jsx(Qe,{checked:s,onChange:i,checkedChildren:h("logs.autoRefresh"),unCheckedChildren:h("logs.manualRefresh")}),s&&a.jsx(Qe,{checked:e,onChange:o,checkedChildren:h("logs.autoScroll"),unCheckedChildren:h("logs.manualScroll"),size:"small"}),a.jsx(Z,{icon:a.jsx(Ht,{}),onClick:c,loading:t,children:h("logs.refresh")}),a.jsx(Te,{title:h("logs.scrollToBottom"),children:a.jsx(Z,{icon:a.jsx(xs,{}),onClick:l})}),a.jsx(Z,{icon:a.jsx(Wt,{}),onClick:y,disabled:!r,children:h("logs.export")}),a.jsx(Zt,{title:h("logs.confirmClear"),onConfirm:d,okText:h("common.ok"),cancelText:h("common.cancel"),children:a.jsx(Z,{danger:!0,icon:a.jsx(vs,{}),loading:n,children:h("logs.clearLogs")})})]})}const{Search:xn}=Jt,{Option:L}=Ne;function Cn({searchText:s,levelFilter:e,pageSize:t,onSearchChange:n,onSearch:r,onLevelFilterChange:i,onPageSizeChange:o}){const{t:c}=ee();return a.jsx(gt,{direction:"vertical",style:{width:"100%"},size:"middle",children:a.jsxs(Ie,{gutter:16,children:[a.jsx(I,{span:8,children:a.jsx(xn,{placeholder:c("logs.searchPlaceholder"),allowClear:!0,enterButton:a.jsx(Kt,{}),value:s,onChange:l=>n(l.target.value),onSearch:r})}),a.jsx(I,{span:6,children:a.jsxs(Ne,{placeholder:c("logs.filterLevel"),allowClear:!0,style:{width:"100%"},value:e,onChange:i,children:[a.jsx(L,{value:"DEBUG",children:"DEBUG"}),a.jsx(L,{value:"INFO",children:"INFO"}),a.jsx(L,{value:"WARN",children:"WARN"}),a.jsx(L,{value:"ERROR",children:"ERROR"}),a.jsx(L,{value:"FATAL",children:"FATAL"})]})}),a.jsx(I,{span:4,children:a.jsxs(Ne,{value:t,onChange:o,style:{width:"100%"},children:[a.jsxs(L,{value:50,children:["50 ",c("logs.pageSize")]}),a.jsxs(L,{value:100,children:["100 ",c("logs.pageSize")]}),a.jsxs(L,{value:200,children:["200 ",c("logs.pageSize")]}),a.jsxs(L,{value:500,children:["500 ",c("logs.pageSize")]}),a.jsxs(L,{value:1e3,children:["1000 ",c("logs.pageSize")]})]})})]})})}const{Text:ot}=mt;function Sn({entries:s,loading:e,page:t,pageSize:n,total:r,searchText:i,onPageChange:o,onAutoScrollDisable:c}){const{t:l}=ee(),y=u=>{switch(u){case"ERROR":case"FATAL":return"red";case"WARN":return"orange";case"INFO":return"blue";case"DEBUG":return"default";default:return"default"}},d=u=>u.replace(/\[\d{4}-\d{2}-\d{2}T[\d:\.]+Z\]/g,"").replace(/\[(DEBUG|INFO|WARN|ERROR|FATAL)\]/gi,"").trim(),h=(u,p)=>!p||!u?u:u.split(new RegExp(`(${p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi")).map((v,O)=>v.toLowerCase()===p.toLowerCase()?a.jsx("mark",{style:{backgroundColor:"#ffd666",padding:"0 2px"},children:v},O):v),b=u=>{if(!u)return"-";try{const p=new Date(u),v=new Date().getTime()-p.getTime(),O=Math.floor(v/6e4),R=Math.floor(v/36e5),P=Math.floor(v/864e5);return O<1?l("logs.justNow"):O<60?`${O} ${l("logs.minutesAgo")}`:R<24?`${R} ${l("logs.hoursAgo")}`:P<7?`${P} ${l("logs.daysAgo")}`:Ze(p)}catch{return u}},x=u=>{navigator.clipboard.writeText(u).then(()=>{pe.success(l("logs.copied"))}).catch(()=>{pe.error(l("logs.copyFailed"))})},_=[{title:l("logs.level"),dataIndex:"level",key:"level",width:90,fixed:"left",render:u=>u?a.jsx(Je,{color:y(u),children:u}):a.jsx(Je,{children:"-"})},{title:l("logs.time"),dataIndex:"timestamp",key:"timestamp",width:180,render:u=>{if(!u)return a.jsx(ot,{type:"secondary",children:"-"});const p=b(u),S=u?Ze(u):"";return a.jsx(Te,{title:S,children:a.jsx(ot,{type:"secondary",style:{fontSize:"12px"},children:p})})}},{title:l("logs.content"),dataIndex:"line",key:"line",ellipsis:{showTitle:!1},render:(u,p)=>{const S=d(u);return a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[a.jsx("code",{style:{fontSize:"12px",whiteSpace:"pre-wrap",wordBreak:"break-all",flex:1,fontFamily:'Monaco, Menlo, "Ubuntu Mono", Consolas, "source-code-pro", monospace'},children:i?h(S,i):S}),a.jsx(Te,{title:l("logs.copyLine"),children:a.jsx(Z,{type:"text",size:"small",icon:a.jsx(Gt,{}),onClick:()=>x(p.originalLine),style:{flexShrink:0}})})]})}}];return a.jsxs(a.Fragment,{children:[a.jsx(Qt,{columns:_,dataSource:s.map((u,p)=>({...u,key:`${t}-${p}-${u.timestamp||p}`})),loading:e,pagination:{current:t,pageSize:n,total:r,showSizeChanger:!1,showTotal:(u,p)=>l("logs.displaying",{start:p[0],end:p[1],total:u}),onChange:u=>{o(u),c()},showQuickJumper:!0},scroll:{y:600,x:"max-content"},size:"small",rowClassName:u=>u.level==="ERROR"||u.level==="FATAL"?"log-row-error":u.level==="WARN"?"log-row-warn":""}),a.jsx("style",{children:`
2
- .log-row-error {
3
- background-color: #fff1f0 !important;
4
- }
5
- .log-row-error:hover {
6
- background-color: #ffe7e5 !important;
7
- }
8
- .log-row-warn {
9
- background-color: #fffbe6 !important;
10
- }
11
- .log-row-warn:hover {
12
- background-color: #fff7d1 !important;
13
- }
14
- .ant-table-tbody > tr > td {
15
- padding: 8px 12px !important;
16
- }
17
- `})]})}const{Title:En}=mt,On=s=>{const e=s.match(/\[(DEBUG|INFO|WARN|ERROR|FATAL)\]/i),t=s.match(/\[(\d{4}-\d{2}-\d{2}T[\d:\.]+Z)\]/);return{line:s,originalLine:s,level:e?.[1]?e[1].toUpperCase():void 0,timestamp:t?.[1]||void 0}};function qn(){const{t:s}=ee(),[e,t]=f.useState(1),[n,r]=f.useState(100),[i,o]=f.useState(),[c,l]=f.useState(""),[y,d]=f.useState(!1),[h,b]=f.useState(!0),x=f.useRef(null),{logs:_,total:u,isLoading:p,refetch:S,clear:v,isClearing:O}=Cs({page:e,limit:n,level:i,search:c||void 0});bn(y);const R=_.map(w=>On(w));vn(y,h,R,x);const P={total:u,error:R.filter(w=>w.level==="ERROR"||w.level==="FATAL").length,warn:R.filter(w=>w.level==="WARN").length,info:R.filter(w=>w.level==="INFO").length},k=()=>{const w=R.map(se=>se.originalLine).join(`
18
- `),K=new Blob([w],{type:"text/plain;charset=utf-8"}),g=URL.createObjectURL(K),C=document.createElement("a");C.href=g,C.download=`logs_${new Date().toISOString().replace(/[:.]/g,"-")}.txt`,document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(g),pe.success(s("logs.logsExported"))},T=()=>{const w=x.current?.querySelector(".ant-table-body");w&&(w.scrollTop=w.scrollHeight,pe.success(s("logs.scrolledToBottom")))},z=()=>{t(1),S()},te=w=>{t(w),b(!1)};return a.jsxs("div",{children:[a.jsxs(Ie,{justify:"space-between",align:"middle",style:{marginBottom:16},children:[a.jsx(I,{children:a.jsx(En,{level:2,style:{margin:0},children:s("logs.title")})}),a.jsx(I,{children:a.jsx(wn,{autoRefresh:y,autoScroll:h,isLoading:p,isClearing:O,hasLogs:R.length>0,onAutoRefreshChange:d,onAutoScrollChange:b,onRefresh:()=>S(),onScrollToBottom:T,onExport:k,onClear:()=>v()})})]}),a.jsx(_n,{total:P.total,error:P.error,warn:P.warn,info:P.info}),a.jsxs(J,{children:[a.jsx(Cn,{searchText:c,levelFilter:i,pageSize:n,onSearchChange:w=>{l(w),t(1)},onSearch:z,onLevelFilterChange:w=>{o(w),t(1)},onPageSizeChange:w=>{r(w),t(1)}}),a.jsx("div",{ref:x,children:a.jsx(Sn,{entries:R,loading:p,page:e,pageSize:n,total:u,searchText:c,onPageChange:te,onAutoScrollDisable:()=>b(!1)})})]})]})}export{qn as default};
19
- //# sourceMappingURL=index-CiHwNwrk.js.map