@abtnode/webapp 1.16.54-beta-20251030-092518-0e109845 → 1.17.0-beta-20251031-063309-13d088fe

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 (188) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-DenpZUIq.js → AdapterDayjs-BQhqZd8R.js} +1 -1
  4. package/dist/assets/{Add-C7LRvIC3.js → Add-DaNU9Vkn.js} +1 -1
  5. package/dist/assets/ArrowDropDown-DMPX6uVd.js +1 -0
  6. package/dist/assets/{Autocomplete-CdGK2sfo.js → Autocomplete-DB_xZW4q.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-CALUKrKQ.js → Breadcrumbs-DzUXRqKQ.js} +1 -1
  8. package/dist/assets/{ButtonGroup-CK4D_Ln2.js → ButtonGroup-BAvFNy2i.js} +1 -1
  9. package/dist/assets/{CSSTransition-Dwgb1QPW.js → CSSTransition-YK8aX8nK.js} +1 -1
  10. package/dist/assets/{CallMerge-8YDqybOh.js → CallMerge-D_gwsj0k.js} +1 -1
  11. package/dist/assets/{CardContent-CVZJ4z1h.js → CardContent-BCchlH2G.js} +1 -1
  12. package/dist/assets/{ChevronLeft-CEo37UIa.js → ChevronLeft-CSCmHm5m.js} +1 -1
  13. package/dist/assets/{ChevronRight-ByhLYhtZ.js → ChevronRight-qIIkSnQ7.js} +1 -1
  14. package/dist/assets/{Clear-Cw2o-hjt.js → Clear-4n0vKAse.js} +1 -1
  15. package/dist/assets/{DeleteOutline-C2P0A6Ux.js → DeleteOutline-CoQ7wmqT.js} +1 -1
  16. package/dist/assets/{Done-Bo9YVoGQ.js → Done-Cc4L9Foc.js} +1 -1
  17. package/dist/assets/{Edit-DAdo7ch2.js → Edit-BNY88SKu.js} +1 -1
  18. package/dist/assets/{ErrorOutline-VCscB3DM.js → ErrorOutline-BzGlqq16.js} +1 -1
  19. package/dist/assets/{FilterList-sINld31b.js → FilterList-B1C7unqT.js} +1 -1
  20. package/dist/assets/{Google-ItITGWAJ.js → Google-CwyoAMMB.js} +1 -1
  21. package/dist/assets/{HelpOutline-QBu85sCP.js → HelpOutline-DTDV8qzL.js} +1 -1
  22. package/dist/assets/{KeyboardArrowDown-Ctt8B4kp.js → KeyboardArrowDown-Mi5aUj7A.js} +1 -1
  23. package/dist/assets/{Launch-nOPSX3Xw.js → Launch-Bgnt4dnJ.js} +1 -1
  24. package/dist/assets/{Link-CCkeWWJ4.js → Link-DNvDZnMC.js} +1 -1
  25. package/dist/assets/{ListItemButton-BdFzmSa7.js → ListItemButton-8ftrSfoo.js} +1 -1
  26. package/dist/assets/{ListSubheader-BicxfAd1.js → ListSubheader-Dtz-xi9-.js} +1 -1
  27. package/dist/assets/{LoadingButton-BkRqIXaM.js → LoadingButton-C4EStBea.js} +1 -1
  28. package/dist/assets/{MoreVert-CI4HEjN0.js → MoreVert-B909vYzl.js} +1 -1
  29. package/dist/assets/{OpenInNew-CNsJ4BFR.js → OpenInNew-Izq7Bt-3.js} +1 -1
  30. package/dist/assets/{Refresh-D8ICG9YW.js → Refresh-VB_fFdY-.js} +1 -1
  31. package/dist/assets/{Search-BuS9kxDD.js → Search-DYBL-x4y.js} +1 -1
  32. package/dist/assets/{Stepper-C9zuG0lI.js → Stepper-tTKANW81.js} +1 -1
  33. package/dist/assets/{Switch-C_P2C8Xa.js → Switch-Bb-rNPtt.js} +1 -1
  34. package/dist/assets/{TableSearch-D9jLZhkp.js → TableSearch-U9rZfIzu.js} +1 -1
  35. package/dist/assets/{ToggleButtonGroup-zhxAcoRO.js → ToggleButtonGroup-DllrYs9I.js} +1 -1
  36. package/dist/assets/{UnfoldMore-CuZG_lwm.js → UnfoldMore-CvwQJb-a.js} +1 -1
  37. package/dist/assets/{Verified-DeUAmldO.js → Verified-DRT_g89L.js} +1 -1
  38. package/dist/assets/{VerifiedUser-DQAD_Zf4.js → VerifiedUser-C11cj6r8.js} +1 -1
  39. package/dist/assets/{ViewList-BncCYLkI.js → ViewList-D4XmJ9U0.js} +1 -1
  40. package/dist/assets/{_createAggregator-CCg6154Y.js → _createAggregator-BEnlFxIE.js} +1 -1
  41. package/dist/assets/{actions-lsvecBT1.js → actions-BeMJBeZS.js} +1 -1
  42. package/dist/assets/{actions-CsBw5W6U.js → actions-CQRwSERj.js} +1 -1
  43. package/dist/assets/{agreement-BUjmPRc2.js → agreement-CZn2P4zt.js} +1 -1
  44. package/dist/assets/api-CFN0QrWp.js +1 -0
  45. package/dist/assets/{appearance-bv3rI7lk.js → appearance-pSINhSXc.js} +1 -1
  46. package/dist/assets/{audit-logs-kv4f2FwD.js → audit-logs-CROZ_WeS.js} +1 -1
  47. package/dist/assets/{base-chart-CXk2GzK7.js → base-chart-SmGCWPp4.js} +1 -1
  48. package/dist/assets/{blocklet-DwHEwBiZ.js → blocklet-DAH77r3I.js} +1 -1
  49. package/dist/assets/{chain-C7UmgQl6.js → chain-Cx_Kwvvk.js} +1 -1
  50. package/dist/assets/{click-to-copy-Deba7opf.js → click-to-copy-DUObPiIX.js} +1 -1
  51. package/dist/assets/cloneDeep-BqrZti_p.js +1 -0
  52. package/dist/assets/{collapse-Pv0Zul5P.js → collapse-XOI3eY05.js} +1 -1
  53. package/dist/assets/{config-navigation-COyT0pBq.js → config-navigation-DkbC13Wz.js} +3 -3
  54. package/dist/assets/{connect-to-Ds9JfRig.js → connect-to-BBdZysbI.js} +1 -1
  55. package/dist/assets/{cssMode-vJ8GoqNb.js → cssMode-C61rzvz6.js} +1 -1
  56. package/dist/assets/{delete-confirm-COg-Kyx9.js → delete-confirm-DmwS-waR.js} +1 -1
  57. package/dist/assets/{depsEqual-C_BH-hM0.js → depsEqual-BKRl_wlt.js} +1 -1
  58. package/dist/assets/{detail-BP3meRyi.js → detail-CMFXn2sE.js} +3 -3
  59. package/dist/assets/{domains-BgYJ9l-y.js → domains-BJ95cum-.js} +1 -1
  60. package/dist/assets/{download-h98wBvTQ.js → download-CJgs-EUD.js} +1 -1
  61. package/dist/assets/{edit.svg-BR_aQB1u.js → edit.svg-CTCbuAl5.js} +1 -1
  62. package/dist/assets/emotion-cache.browser.esm-B4PDkYd9.js +1 -0
  63. package/dist/assets/engine-WQwoCQo7.js +1 -0
  64. package/dist/assets/{freemarker2-DsLYTJ4D.js → freemarker2-DecxbyLU.js} +1 -1
  65. package/dist/assets/{get-safe-url-D-cF2nX-.js → get-safe-url-GLo4lMcu.js} +1 -1
  66. package/dist/assets/getValidReactChildren-DmUPqavH.js +1 -0
  67. package/dist/assets/{graphqlMode-sfVuma8f.js → graphqlMode-RRYdnqJj.js} +2 -2
  68. package/dist/assets/{handlebars-DRbnxjAX.js → handlebars-BLvfXb97.js} +1 -1
  69. package/dist/assets/{html-isoT3Ltk.js → html-sJ4Nfb5L.js} +1 -1
  70. package/dist/assets/{html-title-C0ZWlysm.js → html-title-3cSvLxbM.js} +1 -1
  71. package/dist/assets/{htmlMode-BHIP1cFY.js → htmlMode-BH8IFPfN.js} +1 -1
  72. package/dist/assets/{iframe-DFPz5jZg.js → iframe-b7qWsXni.js} +1 -1
  73. package/dist/assets/{index-CDvh7GeF.js → index-5_DkNrKV.js} +1 -1
  74. package/dist/assets/{index-CywXCFTo.js → index-9PkC8D-D.js} +1 -1
  75. package/dist/assets/{index-CLLICC2z.js → index-B4qKQt-w.js} +1 -1
  76. package/dist/assets/{index-DfjJClPZ.js → index-B8gee_2L.js} +1 -1
  77. package/dist/assets/{index-CiPRigy-.js → index-BCXR4Ftk.js} +1 -1
  78. package/dist/assets/{index-fK2TFREh.js → index-BGo2ji7B.js} +1 -1
  79. package/dist/assets/{index-VCTk1BN0.js → index-BKazYwLa.js} +1 -1
  80. package/dist/assets/{index-aUYmGzbh.js → index-BPe78k6O.js} +1 -1
  81. package/dist/assets/{index-CE07KwkJ.js → index-BTeQyE9h.js} +1 -1
  82. package/dist/assets/{index-DxTV8NxB.js → index-BUXGT_ps.js} +1 -1
  83. package/dist/assets/{index-uKViDkd6.js → index-BUsRmWrQ.js} +1 -1
  84. package/dist/assets/{index-DpQpV_b_.js → index-BdCFcn5n.js} +1 -1
  85. package/dist/assets/{index-B7LBtGVg.js → index-BpbQbuPw.js} +1 -1
  86. package/dist/assets/{index-D5TSjYwo.js → index-C4Up6pys.js} +1 -1
  87. package/dist/assets/{index-DkI6knq_.js → index-C5x2cR57.js} +2 -2
  88. package/dist/assets/{index-7dhA_sHk.js → index-C76P2oZA.js} +3 -3
  89. package/dist/assets/{index-D8tp1rSW.js → index-C7u44WUx.js} +1 -1
  90. package/dist/assets/{index-mOCIkNdQ.js → index-C8k-wIkI.js} +1 -1
  91. package/dist/assets/{index-BX8TIOlx.js → index-CKujShY4.js} +1 -1
  92. package/dist/assets/{index-BvQkWF2c.js → index-CQXhp4qK.js} +3 -3
  93. package/dist/assets/{index-DA08Z61I.js → index-CY-DQJlJ.js} +9 -9
  94. package/dist/assets/{index-HVpfUEsS.js → index-CY7IUyTQ.js} +1 -1
  95. package/dist/assets/{index-DJypfjpv.js → index-CdTvqOME.js} +1 -1
  96. package/dist/assets/{index-Ce2QiSVh.js → index-CeSdCZbW.js} +3 -3
  97. package/dist/assets/{index-CDuEhJSp.js → index-ClNNfRgL.js} +1 -1
  98. package/dist/assets/{index-xeh44vu3.js → index-CnKKagRA.js} +1 -1
  99. package/dist/assets/{index-BBfrnytq.js → index-CwQXKxtM.js} +1 -1
  100. package/dist/assets/{index-BoLX042h.js → index-D8P50S6m.js} +1 -1
  101. package/dist/assets/{index-BCbmqTUZ.js → index-D9BFE-KZ.js} +1 -1
  102. package/dist/assets/{index-CXWQi8L0.js → index-DCku-75F.js} +1 -1
  103. package/dist/assets/{index-D4MQDk9z.js → index-DEol2fO5.js} +1 -1
  104. package/dist/assets/{index-CKt7JY59.js → index-DM_ZE9pB.js} +1 -1
  105. package/dist/assets/{index-CfyiyNfx.js → index-DQDzrpet.js} +1 -1
  106. package/dist/assets/{index-UpEYMAvU.js → index-DR4wKA9U.js} +1 -1
  107. package/dist/assets/{index-CHl2w7db.js → index-Daqes2Jo.js} +1 -1
  108. package/dist/assets/{index-roMS8d9X.js → index-DuXo6h3x.js} +1 -1
  109. package/dist/assets/{index-C9BjuzFT.js → index-DzMtvg-l.js} +1 -1
  110. package/dist/assets/{index-DbK31dFt.js → index-Dzuc8iT3.js} +3 -3
  111. package/dist/assets/{index-CUYhzHNx.js → index-R1YPOZ_R.js} +1 -1
  112. package/dist/assets/{index-DuXssMw-.js → index-RiT8KfYO.js} +1 -1
  113. package/dist/assets/{index-BX8O0ZHV.js → index-V6W4s-Vq.js} +1 -1
  114. package/dist/assets/index-aNMEeMCp.js +1 -0
  115. package/dist/assets/{index-Cdhabg4y.js → index-d0DSkbLN.js} +1 -1
  116. package/dist/assets/{index-1KXTwIqr.js → index-kdOFyCzK.js} +1 -1
  117. package/dist/assets/{index-WuP8F7wO.js → index-qTsCZuXh.js} +3 -3
  118. package/dist/assets/{index-D9scRZrq.js → index-wAxFAH22.js} +1 -1
  119. package/dist/assets/{index-C6l5hpTj.js → index-yJnNzvvC.js} +1 -1
  120. package/dist/assets/{index.esm-DfrzxWuO.js → index.esm-DfXlzNxJ.js} +1 -1
  121. package/dist/assets/{install-from-url-D3DrZQJS.js → install-from-url-C-sswCsg.js} +1 -1
  122. package/dist/assets/{invitation-CH_Lzck2.js → invitation-DYBpGYHd.js} +1 -1
  123. package/dist/assets/{is-path-prefix-equal-CcoUfdQX.js → is-path-prefix-equal-D9JGKIeT.js} +1 -1
  124. package/dist/assets/{item-9zvzeQYB.js → item-B_RGzu57.js} +1 -1
  125. package/dist/assets/{javascript-DdnSMb4b.js → javascript-G_Ki5rLs.js} +1 -1
  126. package/dist/assets/{jsonMode-Bg0Q4n_0.js → jsonMode-CgCjEry4.js} +1 -1
  127. package/dist/assets/{liquid-CXdUQAQf.js → liquid-8Y_Hjzxa.js} +1 -1
  128. package/dist/assets/{list-header-Cl8gLzfo.js → list-header-BgLs_nU8.js} +1 -1
  129. package/dist/assets/{lock.svg-B_LWkLVc.js → lock.svg-DKwAmrmM.js} +1 -1
  130. package/dist/assets/{log-ayIsHfiS.js → log-SquOXmP7.js} +1 -1
  131. package/dist/assets/{lottie-react.esm-CH2GSfx5.js → lottie-react.esm-B4tYA9FY.js} +1 -1
  132. package/dist/assets/{mdx-BfILcfPl.js → mdx-CejS69kk.js} +1 -1
  133. package/dist/assets/{memory-BOVBleTW.js → memory-Cuur0WuU.js} +1 -1
  134. package/dist/assets/{metric-D-t8b3PS.js → metric-D7ZLfEZL.js} +1 -1
  135. package/dist/assets/omit-B6Em65Pi.js +1 -0
  136. package/dist/assets/{overview-C_qhYB7p.js → overview-Dit0jZd_.js} +1 -1
  137. package/dist/assets/{permission-C9Y2XRsP.js → permission-DCAf_gW3.js} +1 -1
  138. package/dist/assets/{preference-CqWbCajg.js → preference-USV6ZnpJ.js} +3 -3
  139. package/dist/assets/{python-DEhmOuwB.js → python-9xl8LFOF.js} +1 -1
  140. package/dist/assets/{raf-schd.esm-mo0KJqn3.js → raf-schd.esm-DOQwQgek.js} +1 -1
  141. package/dist/assets/{razor-BRS1KTKZ.js → razor-Bh3jB7rP.js} +1 -1
  142. package/dist/assets/{rotate-session-key-8bwJGNzn.js → rotate-session-key-C0GGERLw.js} +1 -1
  143. package/dist/assets/{runtime-BFIA0peM.js → runtime-a63NycI4.js} +1 -1
  144. package/dist/assets/schema-DILw2ZhE.js +1 -0
  145. package/dist/assets/sdk-CrF6oAGx.js +1 -0
  146. package/dist/assets/{service-Carp72X0.js → service-p6Kz-Ebl.js} +1 -1
  147. package/dist/assets/{shorten-label-SgarF_Ma.js → shorten-label-ByAddcRT.js} +1 -1
  148. package/dist/assets/{simple-select-DvScotEA.js → simple-select-54E6Mx7r.js} +1 -1
  149. package/dist/assets/{spaces-DT0rG8Ke.js → spaces-D11mVhTA.js} +1 -1
  150. package/dist/assets/{status-D8QofLif.js → status-BOrqQCOU.js} +1 -1
  151. package/dist/assets/{status-Cq_pMyWm.js → status-DN8224TB.js} +1 -1
  152. package/dist/assets/{switch-control-lkjjrTch.js → switch-control-DIsd4bYh.js} +1 -1
  153. package/dist/assets/{table-icons-DTHGIjyx.js → table-icons-DE8O65AZ.js} +1 -1
  154. package/dist/assets/{team-CWK-YI0_.js → team-D5YTqCCQ.js} +1 -1
  155. package/dist/assets/{toLower-Cg__GXKz.js → toLower-BLHPf6nS.js} +1 -1
  156. package/dist/assets/toUpper-BO6HuJgG.js +1 -0
  157. package/dist/assets/{traffic-BzgoMKvP.js → traffic-D2tJoibq.js} +1 -1
  158. package/dist/assets/{tsMode-DQfrAplw.js → tsMode-BP4eh0TA.js} +1 -1
  159. package/dist/assets/{typescript-CIO-eep4.js → typescript-CO8UB8Ph.js} +1 -1
  160. package/dist/assets/{url-evaluation-CqBTA_SW.js → url-evaluation-CRBdYFML.js} +1 -1
  161. package/dist/assets/{url-join-DeVtpQ7K.js → url-join-D0OB7xve.js} +1 -1
  162. package/dist/assets/{use-mobile-BAXyhqNj.js → use-mobile-CplJbK7t.js} +1 -1
  163. package/dist/assets/{use-mobile-C3U3R5Q3.js → use-mobile-ENQw9KmE.js} +1 -1
  164. package/dist/assets/{useAsync-CQocXlD2.js → useAsync-ng0xVRWA.js} +1 -1
  165. package/dist/assets/{useAsyncRetry-XGg3A4Qt.js → useAsyncRetry-DQznqjsq.js} +1 -1
  166. package/dist/assets/{useLocalStorage-BMre6evC.js → useLocalStorage-BfHKsdtC.js} +1 -1
  167. package/dist/assets/{useThemeProps-DhBxLZiP.js → useThemeProps-BqRQljgd.js} +1 -1
  168. package/dist/assets/{util-BGedStqW.js → util-BrkrFgTY.js} +1 -1
  169. package/dist/assets/{wait-container-DcW-2Rk6.js → wait-container-CaFqAYZl.js} +1 -1
  170. package/dist/assets/{without-wallet-BCJJXxIm.js → without-wallet-DT7YhPXQ.js} +1 -1
  171. package/dist/assets/wrap-locale-BucbsnFR.js +1 -0
  172. package/dist/assets/{xml-BWysbc0z.js → xml-sQyE-LAY.js} +1 -1
  173. package/dist/assets/{yaml-DPrHMwAz.js → yaml-DVrLI7b8.js} +1 -1
  174. package/dist/index.html +1 -1
  175. package/dist/service-worker.js +1 -1
  176. package/package.json +1 -1
  177. package/dist/assets/ArrowDropDown-DT6bL4ID.js +0 -1
  178. package/dist/assets/api-VW_-gBps.js +0 -1
  179. package/dist/assets/cloneDeep-DtvXQkbq.js +0 -1
  180. package/dist/assets/emotion-cache.browser.esm-D_e1cJtm.js +0 -1
  181. package/dist/assets/engine-DSF2IlH7.js +0 -1
  182. package/dist/assets/getValidReactChildren-BAFkQ3fw.js +0 -1
  183. package/dist/assets/index-DuHKLnMJ.js +0 -1
  184. package/dist/assets/omit-DZ74swD3.js +0 -1
  185. package/dist/assets/schema-utl-s0UR.js +0 -1
  186. package/dist/assets/sdk-BXxj54Wv.js +0 -1
  187. package/dist/assets/toUpper-DO7qEtmV.js +0 -1
  188. package/dist/assets/wrap-locale-CHnqR1BC.js +0 -1
@@ -1 +1 @@
1
- import{bX as bt,bY as pt,r as u,bZ as ft,b$ as W,j as p,b8 as N,cc as At,c0 as ht,bU as Ft,bV as St,d4 as ho,d5 as Ot,d6 as Dt,d7 as Xt,d8 as So,d9 as vo,b_ as lt,f as mo,da as dt,cb as D,db as xo,dc as yo,u as go,bz as Co,dd as wo,de as Bo}from"./index-DbK31dFt.js";function To(o){return pt("MuiTab",o)}const x=bt("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),Io=o=>{const{classes:t,textColor:l,fullWidth:s,wrapped:n,icon:a,label:i,selected:b,disabled:f}=o,v={root:["root",a&&i&&"labelIcon",`textColor${At(l)}`,s&&"fullWidth",n&&"wrapped",b&&"selected",f&&"disabled"],icon:["iconWrapper","icon"]};return ht(v,To,t)},Mo=N(Ft,{name:"MuiTab",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[t.root,l.label&&l.icon&&t.labelIcon,t[`textColor${At(l.textColor)}`],l.fullWidth&&t.fullWidth,l.wrapped&&t.wrapped,{[`& .${x.iconWrapper}`]:t.iconWrapper},{[`& .${x.icon}`]:t.icon}]}})(St(({theme:o})=>({...o.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:t})=>t.label&&(t.iconPosition==="top"||t.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:t})=>t.label&&t.iconPosition!=="top"&&t.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:t})=>t.icon&&t.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="top",style:{[`& > .${x.icon}`]:{marginBottom:6}}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="bottom",style:{[`& > .${x.icon}`]:{marginTop:6}}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="start",style:{[`& > .${x.icon}`]:{marginRight:o.spacing(1)}}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="end",style:{[`& > .${x.icon}`]:{marginLeft:o.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${x.selected}`]:{opacity:1},[`&.${x.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(o.vars||o).palette.text.secondary,[`&.${x.selected}`]:{color:(o.vars||o).palette.primary.main},[`&.${x.disabled}`]:{color:(o.vars||o).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(o.vars||o).palette.text.secondary,[`&.${x.selected}`]:{color:(o.vars||o).palette.secondary.main},[`&.${x.disabled}`]:{color:(o.vars||o).palette.text.disabled}}},{props:({ownerState:t})=>t.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:t})=>t.wrapped,style:{fontSize:o.typography.pxToRem(12)}}]}))),vt=u.forwardRef(function(t,l){const s=ft({props:t,name:"MuiTab"}),{className:n,disabled:a=!1,disableFocusRipple:i=!1,fullWidth:b,icon:f,iconPosition:v="top",indicator:C,label:m,onChange:S,onClick:w,onFocus:j,selected:B,selectionFollowsFocus:y,textColor:Z="inherit",value:M,wrapped:rt=!1,...E}=s,A={...s,disabled:a,disableFocusRipple:i,selected:B,icon:!!f,iconPosition:v,label:!!m,fullWidth:b,textColor:Z,wrapped:rt},K=Io(A),U=f&&m&&u.isValidElement(f)?u.cloneElement(f,{className:W(K.icon,f.props.className)}):f,_=P=>{!B&&S&&S(P,M),w&&w(P)},F=P=>{y&&!B&&S&&S(P,M),j&&j(P)};return p.jsxs(Mo,{focusRipple:!i,className:W(K.root,n),ref:l,role:"tab","aria-selected":B,disabled:a,onClick:_,onFocus:F,ownerState:A,tabIndex:B?0:-1,...E,children:[v==="top"||v==="start"?p.jsxs(u.Fragment,{children:[U,m]}):p.jsxs(u.Fragment,{children:[m,U]}),C]})});function Eo(o){return(1+Math.sin(Math.PI*o-Math.PI/2))/2}function Po(o,t,l,s={},n=()=>{}){const{ease:a=Eo,duration:i=300}=s;let b=null;const f=t[o];let v=!1;const C=()=>{v=!0},m=S=>{if(v){n(new Error("Animation cancelled"));return}b===null&&(b=S);const w=Math.min(1,(S-b)/i);if(t[o]=a(w)*(l-f)+f,w>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(m)};return f===l?(n(new Error("Element already at target position")),C):(requestAnimationFrame(m),C)}const Ro={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function ko(o){const{onChange:t,...l}=o,s=u.useRef(),n=u.useRef(null),a=()=>{s.current=n.current.offsetHeight-n.current.clientHeight};return ho(()=>{const i=Ot(()=>{const f=s.current;a(),f!==s.current&&t(s.current)}),b=Dt(n.current);return b.addEventListener("resize",i),()=>{i.clear(),b.removeEventListener("resize",i)}},[t]),u.useEffect(()=>{a(),t(s.current)},[t]),p.jsx("div",{style:Ro,...l,ref:n})}function zo(o){return pt("MuiTabScrollButton",o)}const Wo=bt("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),jo=o=>{const{classes:t,orientation:l,disabled:s}=o;return ht({root:["root",l,s&&"disabled"]},zo,t)},Ho=N(Ft,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[t.root,l.orientation&&t[l.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${Wo.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),$o=u.forwardRef(function(t,l){const s=ft({props:t,name:"MuiTabScrollButton"}),{className:n,slots:a={},slotProps:i={},direction:b,orientation:f,disabled:v,...C}=s,m=Xt(),S={isRtl:m,...s},w=jo(S),j=a.StartScrollButtonIcon??So,B=a.EndScrollButtonIcon??vo,y=lt({elementType:j,externalSlotProps:i.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S}),Z=lt({elementType:B,externalSlotProps:i.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S});return p.jsx(Ho,{component:"div",className:W(w.root,n),ref:l,role:null,ownerState:S,tabIndex:null,...C,style:{...C.style,...f==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${m?-90:90}deg)`}},children:b==="left"?p.jsx(j,{...y}):p.jsx(B,{...Z})})});function Lo(o){return pt("MuiTabs",o)}const ut=bt("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Ht=(o,t)=>o===t?o.firstChild:t&&t.nextElementSibling?t.nextElementSibling:o.firstChild,$t=(o,t)=>o===t?o.lastChild:t&&t.previousElementSibling?t.previousElementSibling:o.lastChild,et=(o,t,l)=>{let s=!1,n=l(o,t);for(;n;){if(n===o.firstChild){if(s)return;s=!0}const a=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||a)n=l(o,n);else{n.focus();return}}},No=o=>{const{vertical:t,fixed:l,hideScrollbar:s,scrollableX:n,scrollableY:a,centered:i,scrollButtonsHideMobile:b,classes:f}=o;return ht({root:["root",t&&"vertical"],scroller:["scroller",l&&"fixed",s&&"hideScrollbar",n&&"scrollableX",a&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",i&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",b&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[s&&"hideScrollbar"]},Lo,f)},Ao=N("div",{name:"MuiTabs",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[{[`& .${ut.scrollButtons}`]:t.scrollButtons},{[`& .${ut.scrollButtons}`]:l.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,l.vertical&&t.vertical]}})(St(({theme:o})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.scrollButtonsHideMobile,style:{[`& .${ut.scrollButtons}`]:{[o.breakpoints.down("sm")]:{display:"none"}}}}]}))),Fo=N("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[t.scroller,l.fixed&&t.fixed,l.hideScrollbar&&t.hideScrollbar,l.scrollableX&&t.scrollableX,l.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:o})=>o.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:o})=>o.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:o})=>o.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:o})=>o.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),Oo=N("div",{name:"MuiTabs",slot:"List",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[t.list,t.flexContainer,l.vertical&&t.flexContainerVertical,l.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:o})=>o.vertical,style:{flexDirection:"column"}},{props:({ownerState:o})=>o.centered,style:{justifyContent:"center"}}]}),Do=N("span",{name:"MuiTabs",slot:"Indicator"})(St(({theme:o})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:o.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(o.vars||o).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(o.vars||o).palette.secondary.main}},{props:({ownerState:t})=>t.vertical,style:{height:"100%",width:2,right:0}}]}))),Xo=N(ko)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Lt={},mt=u.forwardRef(function(t,l){const s=ft({props:t,name:"MuiTabs"}),n=mo(),a=Xt(),{"aria-label":i,"aria-labelledby":b,action:f,centered:v=!1,children:C,className:m,component:S="div",allowScrollButtonsMobile:w=!1,indicatorColor:j="primary",onChange:B,orientation:y="horizontal",ScrollButtonComponent:Z,scrollButtons:M="auto",selectionFollowsFocus:rt,slots:E={},slotProps:A={},TabIndicatorProps:K={},TabScrollButtonProps:U={},textColor:_="primary",value:F,variant:P="standard",visibleScrollbar:nt=!1,...Kt}=s,T=P==="scrollable",g=y==="vertical",Y=g?"scrollTop":"scrollLeft",J=g?"top":"left",Q=g?"bottom":"right",st=g?"clientHeight":"clientWidth",V=g?"height":"width",R={...s,component:S,allowScrollButtonsMobile:w,indicatorColor:j,orientation:y,vertical:g,scrollButtons:M,textColor:_,variant:P,visibleScrollbar:nt,fixed:!T,hideScrollbar:T&&!nt,scrollableX:T&&!g,scrollableY:T&&g,centered:v&&!T,scrollButtonsHideMobile:!w},z=No(R),Ut=lt({elementType:E.StartScrollButtonIcon,externalSlotProps:A.startScrollButtonIcon,ownerState:R}),Yt=lt({elementType:E.EndScrollButtonIcon,externalSlotProps:A.endScrollButtonIcon,ownerState:R}),[xt,Vt]=u.useState(!1),[H,yt]=u.useState(Lt),[gt,qt]=u.useState(!1),[Ct,Gt]=u.useState(!1),[wt,Zt]=u.useState(!1),[Bt,_t]=u.useState({overflow:"hidden",scrollbarWidth:0}),Tt=new Map,k=u.useRef(null),$=u.useRef(null),O={slots:E,slotProps:{indicator:K,scrollButton:U,...A}},It=()=>{const e=k.current;let r;if(e){const c=e.getBoundingClientRect();r={clientWidth:e.clientWidth,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollWidth:e.scrollWidth,top:c.top,bottom:c.bottom,left:c.left,right:c.right}}let d;if(e&&F!==!1){const c=$.current.children;if(c.length>0){const h=c[Tt.get(F)];d=h?h.getBoundingClientRect():null}}return{tabsMeta:r,tabMeta:d}},q=dt(()=>{const{tabsMeta:e,tabMeta:r}=It();let d=0,c;g?(c="top",r&&e&&(d=r.top-e.top+e.scrollTop)):(c=a?"right":"left",r&&e&&(d=(a?-1:1)*(r[c]-e[c]+e.scrollLeft)));const h={[c]:d,[V]:r?r[V]:0};if(typeof H[c]!="number"||typeof H[V]!="number")yt(h);else{const I=Math.abs(H[c]-h[c]),L=Math.abs(H[V]-h[V]);(I>=1||L>=1)&&yt(h)}}),at=(e,{animation:r=!0}={})=>{r?Po(Y,k.current,e,{duration:n.transitions.duration.standard}):k.current[Y]=e},Mt=e=>{let r=k.current[Y];g?r+=e:r+=e*(a?-1:1),at(r)},Et=()=>{const e=k.current[st];let r=0;const d=Array.from($.current.children);for(let c=0;c<d.length;c+=1){const h=d[c];if(r+h[st]>e){c===0&&(r=e);break}r+=h[st]}return r},Jt=()=>{Mt(-1*Et())},Qt=()=>{Mt(Et())},[to,{onChange:Pt,...oo}]=D("scrollbar",{className:W(z.scrollableX,z.hideScrollbar),elementType:Xo,shouldForwardComponentProp:!0,externalForwardedProps:O,ownerState:R}),eo=u.useCallback(e=>{Pt?.(e),_t({overflow:null,scrollbarWidth:e})},[Pt]),[Rt,kt]=D("scrollButtons",{className:W(z.scrollButtons,U.className),elementType:$o,externalForwardedProps:O,ownerState:R,additionalProps:{orientation:y,slots:{StartScrollButtonIcon:E.startScrollButtonIcon||E.StartScrollButtonIcon,EndScrollButtonIcon:E.endScrollButtonIcon||E.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:Ut,endScrollButtonIcon:Yt}}}),lo=()=>{const e={};e.scrollbarSizeListener=T?p.jsx(to,{...oo,onChange:eo}):null;const d=T&&(M==="auto"&&(gt||Ct)||M===!0);return e.scrollButtonStart=d?p.jsx(Rt,{direction:a?"right":"left",onClick:Jt,disabled:!gt,...kt}):null,e.scrollButtonEnd=d?p.jsx(Rt,{direction:a?"left":"right",onClick:Qt,disabled:!Ct,...kt}):null,e},zt=dt(e=>{const{tabsMeta:r,tabMeta:d}=It();if(!(!d||!r)){if(d[J]<r[J]){const c=r[Y]+(d[J]-r[J]);at(c,{animation:e})}else if(d[Q]>r[Q]){const c=r[Y]+(d[Q]-r[Q]);at(c,{animation:e})}}}),tt=dt(()=>{T&&M!==!1&&Zt(!wt)});u.useEffect(()=>{const e=Ot(()=>{k.current&&q()});let r;const d=I=>{I.forEach(L=>{L.removedNodes.forEach(G=>{r?.unobserve(G)}),L.addedNodes.forEach(G=>{r?.observe(G)})}),e(),tt()},c=Dt(k.current);c.addEventListener("resize",e);let h;return typeof ResizeObserver<"u"&&(r=new ResizeObserver(e),Array.from($.current.children).forEach(I=>{r.observe(I)})),typeof MutationObserver<"u"&&(h=new MutationObserver(d),h.observe($.current,{childList:!0})),()=>{e.clear(),c.removeEventListener("resize",e),h?.disconnect(),r?.disconnect()}},[q,tt]),u.useEffect(()=>{const e=Array.from($.current.children),r=e.length;if(typeof IntersectionObserver<"u"&&r>0&&T&&M!==!1){const d=e[0],c=e[r-1],h={root:k.current,threshold:.99},I=ct=>{qt(!ct[0].isIntersecting)},L=new IntersectionObserver(I,h);L.observe(d);const G=ct=>{Gt(!ct[0].isIntersecting)},jt=new IntersectionObserver(G,h);return jt.observe(c),()=>{L.disconnect(),jt.disconnect()}}},[T,M,wt,C?.length]),u.useEffect(()=>{Vt(!0)},[]),u.useEffect(()=>{q()}),u.useEffect(()=>{zt(Lt!==H)},[zt,H]),u.useImperativeHandle(f,()=>({updateIndicator:q,updateScrollButtons:tt}),[q,tt]);const[ro,no]=D("indicator",{className:W(z.indicator,K.className),elementType:Do,externalForwardedProps:O,ownerState:R,additionalProps:{style:H}}),Wt=p.jsx(ro,{...no});let ot=0;const so=u.Children.map(C,e=>{if(!u.isValidElement(e))return null;const r=e.props.value===void 0?ot:e.props.value;Tt.set(r,ot);const d=r===F;return ot+=1,u.cloneElement(e,{fullWidth:P==="fullWidth",indicator:d&&!xt&&Wt,selected:d,selectionFollowsFocus:rt,onChange:B,textColor:_,value:r,...ot===1&&F===!1&&!e.props.tabIndex?{tabIndex:0}:{}})}),ao=e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey)return;const r=$.current,d=xo(r).activeElement;if(d.getAttribute("role")!=="tab")return;let h=y==="horizontal"?"ArrowLeft":"ArrowUp",I=y==="horizontal"?"ArrowRight":"ArrowDown";switch(y==="horizontal"&&a&&(h="ArrowRight",I="ArrowLeft"),e.key){case h:e.preventDefault(),et(r,d,$t);break;case I:e.preventDefault(),et(r,d,Ht);break;case"Home":e.preventDefault(),et(r,null,Ht);break;case"End":e.preventDefault(),et(r,null,$t);break}},it=lo(),[io,co]=D("root",{ref:l,className:W(z.root,m),elementType:Ao,externalForwardedProps:{...O,...Kt,component:S},ownerState:R}),[uo,bo]=D("scroller",{ref:k,className:z.scroller,elementType:Fo,externalForwardedProps:O,ownerState:R,additionalProps:{style:{overflow:Bt.overflow,[g?`margin${a?"Left":"Right"}`:"marginBottom"]:nt?void 0:-Bt.scrollbarWidth}}}),[po,fo]=D("list",{ref:$,className:W(z.list,z.flexContainer),elementType:Oo,externalForwardedProps:O,ownerState:R,getSlotProps:e=>({...e,onKeyDown:r=>{ao(r),e.onKeyDown?.(r)}})});return p.jsxs(io,{...co,children:[it.scrollButtonStart,it.scrollbarSizeListener,p.jsxs(uo,{...bo,children:[p.jsx(po,{"aria-label":i,"aria-labelledby":b,"aria-orientation":y==="vertical"?"vertical":null,role:"tablist",...fo,children:so}),xt&&Wt]}),it.scrollButtonEnd]})}),Nt="index",X={tabs:`${Nt}-tabs`,tab:`${Nt}-tab`},Ko=yo(mt)(({theme:o})=>({[`& .${X.tabs}`]:{},[`& .${X.tab}`]:{fontSize:"0.875rem",[o.breakpoints.up("md")]:{fontSize:"1rem"}}}));function Uo({tabs:o,current:t,onChange:l,iconPosition:s=void 0,enableTabClick:n=!1,...a}){return p.jsx(mt,{scrollButtons:"auto",value:t,onChange:(i,b)=>!n&&l(b),...a,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":{borderRadius:"100vw"},".MuiTabs-flexContainer":{borderRadius:"100vw",backgroundColor:"grey.100",padding:.5,display:"inline-flex",columnGap:.25,maxWidth:"100%",overflowX:"auto"},".MuiTab-root":{borderRadius:"100vw",border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,color:"text.secondary",fontSize:"13px",fontWeight:"normal",textTransform:"capitalize",transition:"background-color 0.2s ease","&.Mui-selected, &:hover":{backgroundColor:"action.selected",borderColor:"grey.100",color:"grey.A700"}},".MuiTabs-indicator":{display:"none"},...a.sx},children:o.map(i=>p.jsx(vt,{className:X.tab,value:i.value,label:i.label,icon:i.icon,iconPosition:s,onClick:()=>n&&l(i.value)},i.value))})}function Yo({tabs:o,current:t,onChange:l,iconPosition:s=void 0,enableTabClick:n=!1,...a}){return p.jsx(mt,{scrollButtons:"auto",value:t,onChange:(i,b)=>!n&&l(b),...a,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":a.orientation!=="vertical"?{"&::after":{content:'""',display:"block",position:"sticky",left:0,zIndex:-1,width:"100%",height:"1px",backgroundColor:"grey.300"}}:{},".MuiTabs-flexContainer":{display:"inline-flex",columnGap:2.5,px:0,pb:.5},".MuiTab-root":{border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,px:0,color:"text.secondary",fontSize:"14px",fontWeight:500,textTransform:"capitalize",minWidth:"auto","&.Mui-selected, &:hover":{color:"primary.main"}},".MuiTabs-indicator":{height:"1px",backgroundColor:"primary.main"},...a.sx},children:o.map(i=>p.jsx(vt,{className:X.tab,value:i.value,label:i.label,icon:i.icon,iconPosition:s,onClick:()=>n&&l(i.value)},i.value))})}function qo({tabs:o,current:t,onChange:l,variant:s=void 0,iconPosition:n=void 0,enableTabClick:a=!1,...i}){return s==="card"?p.jsx(Uo,{...i,tabs:o,current:t,enableTabClick:a,onChange:l,iconPosition:n}):s==="line"?p.jsx(Yo,{...i,tabs:o,current:t,enableTabClick:a,onChange:l,iconPosition:n}):p.jsx(Ko,{scrollButtons:"auto",variant:"scrollable",value:t,onChange:(b,f)=>!a&&l(f),indicatorColor:"primary",...i,className:[X.tabs,i.className||""].join(" "),children:o.map(b=>p.jsx(vt,{className:X.tab,value:b.value,label:b.label,icon:b.icon,iconPosition:n,onClick:()=>a&&l(b.value)},b.value))})}function Go(o,t=""){const{info:l}=go(),s=Co(()=>{const n=o?.breadcrumbsLabel||o?.label||"";return wo(n,t,l)},[o,t,l]);return s?p.jsx(Bo,{children:p.jsx("title",{children:s})}):null}export{qo as T,vt as a,mt as b,ut as t,Go as u};
1
+ import{bX as bt,bY as pt,r as u,bZ as ft,b$ as W,j as p,b8 as N,cc as At,c0 as ht,bU as Ft,bV as St,d4 as ho,d5 as Ot,d6 as Dt,d7 as Xt,d8 as So,d9 as vo,b_ as lt,f as mo,da as dt,cb as D,db as xo,dc as yo,u as go,bz as Co,dd as wo,de as Bo}from"./index-Dzuc8iT3.js";function To(o){return pt("MuiTab",o)}const x=bt("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),Io=o=>{const{classes:t,textColor:l,fullWidth:s,wrapped:n,icon:a,label:i,selected:b,disabled:f}=o,v={root:["root",a&&i&&"labelIcon",`textColor${At(l)}`,s&&"fullWidth",n&&"wrapped",b&&"selected",f&&"disabled"],icon:["iconWrapper","icon"]};return ht(v,To,t)},Mo=N(Ft,{name:"MuiTab",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[t.root,l.label&&l.icon&&t.labelIcon,t[`textColor${At(l.textColor)}`],l.fullWidth&&t.fullWidth,l.wrapped&&t.wrapped,{[`& .${x.iconWrapper}`]:t.iconWrapper},{[`& .${x.icon}`]:t.icon}]}})(St(({theme:o})=>({...o.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:t})=>t.label&&(t.iconPosition==="top"||t.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:t})=>t.label&&t.iconPosition!=="top"&&t.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:t})=>t.icon&&t.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="top",style:{[`& > .${x.icon}`]:{marginBottom:6}}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="bottom",style:{[`& > .${x.icon}`]:{marginTop:6}}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="start",style:{[`& > .${x.icon}`]:{marginRight:o.spacing(1)}}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="end",style:{[`& > .${x.icon}`]:{marginLeft:o.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${x.selected}`]:{opacity:1},[`&.${x.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(o.vars||o).palette.text.secondary,[`&.${x.selected}`]:{color:(o.vars||o).palette.primary.main},[`&.${x.disabled}`]:{color:(o.vars||o).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(o.vars||o).palette.text.secondary,[`&.${x.selected}`]:{color:(o.vars||o).palette.secondary.main},[`&.${x.disabled}`]:{color:(o.vars||o).palette.text.disabled}}},{props:({ownerState:t})=>t.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:t})=>t.wrapped,style:{fontSize:o.typography.pxToRem(12)}}]}))),vt=u.forwardRef(function(t,l){const s=ft({props:t,name:"MuiTab"}),{className:n,disabled:a=!1,disableFocusRipple:i=!1,fullWidth:b,icon:f,iconPosition:v="top",indicator:C,label:m,onChange:S,onClick:w,onFocus:j,selected:B,selectionFollowsFocus:y,textColor:Z="inherit",value:M,wrapped:rt=!1,...E}=s,A={...s,disabled:a,disableFocusRipple:i,selected:B,icon:!!f,iconPosition:v,label:!!m,fullWidth:b,textColor:Z,wrapped:rt},K=Io(A),U=f&&m&&u.isValidElement(f)?u.cloneElement(f,{className:W(K.icon,f.props.className)}):f,_=P=>{!B&&S&&S(P,M),w&&w(P)},F=P=>{y&&!B&&S&&S(P,M),j&&j(P)};return p.jsxs(Mo,{focusRipple:!i,className:W(K.root,n),ref:l,role:"tab","aria-selected":B,disabled:a,onClick:_,onFocus:F,ownerState:A,tabIndex:B?0:-1,...E,children:[v==="top"||v==="start"?p.jsxs(u.Fragment,{children:[U,m]}):p.jsxs(u.Fragment,{children:[m,U]}),C]})});function Eo(o){return(1+Math.sin(Math.PI*o-Math.PI/2))/2}function Po(o,t,l,s={},n=()=>{}){const{ease:a=Eo,duration:i=300}=s;let b=null;const f=t[o];let v=!1;const C=()=>{v=!0},m=S=>{if(v){n(new Error("Animation cancelled"));return}b===null&&(b=S);const w=Math.min(1,(S-b)/i);if(t[o]=a(w)*(l-f)+f,w>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(m)};return f===l?(n(new Error("Element already at target position")),C):(requestAnimationFrame(m),C)}const Ro={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function ko(o){const{onChange:t,...l}=o,s=u.useRef(),n=u.useRef(null),a=()=>{s.current=n.current.offsetHeight-n.current.clientHeight};return ho(()=>{const i=Ot(()=>{const f=s.current;a(),f!==s.current&&t(s.current)}),b=Dt(n.current);return b.addEventListener("resize",i),()=>{i.clear(),b.removeEventListener("resize",i)}},[t]),u.useEffect(()=>{a(),t(s.current)},[t]),p.jsx("div",{style:Ro,...l,ref:n})}function zo(o){return pt("MuiTabScrollButton",o)}const Wo=bt("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),jo=o=>{const{classes:t,orientation:l,disabled:s}=o;return ht({root:["root",l,s&&"disabled"]},zo,t)},Ho=N(Ft,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[t.root,l.orientation&&t[l.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${Wo.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),$o=u.forwardRef(function(t,l){const s=ft({props:t,name:"MuiTabScrollButton"}),{className:n,slots:a={},slotProps:i={},direction:b,orientation:f,disabled:v,...C}=s,m=Xt(),S={isRtl:m,...s},w=jo(S),j=a.StartScrollButtonIcon??So,B=a.EndScrollButtonIcon??vo,y=lt({elementType:j,externalSlotProps:i.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S}),Z=lt({elementType:B,externalSlotProps:i.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S});return p.jsx(Ho,{component:"div",className:W(w.root,n),ref:l,role:null,ownerState:S,tabIndex:null,...C,style:{...C.style,...f==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${m?-90:90}deg)`}},children:b==="left"?p.jsx(j,{...y}):p.jsx(B,{...Z})})});function Lo(o){return pt("MuiTabs",o)}const ut=bt("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Ht=(o,t)=>o===t?o.firstChild:t&&t.nextElementSibling?t.nextElementSibling:o.firstChild,$t=(o,t)=>o===t?o.lastChild:t&&t.previousElementSibling?t.previousElementSibling:o.lastChild,et=(o,t,l)=>{let s=!1,n=l(o,t);for(;n;){if(n===o.firstChild){if(s)return;s=!0}const a=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||a)n=l(o,n);else{n.focus();return}}},No=o=>{const{vertical:t,fixed:l,hideScrollbar:s,scrollableX:n,scrollableY:a,centered:i,scrollButtonsHideMobile:b,classes:f}=o;return ht({root:["root",t&&"vertical"],scroller:["scroller",l&&"fixed",s&&"hideScrollbar",n&&"scrollableX",a&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",i&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",b&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[s&&"hideScrollbar"]},Lo,f)},Ao=N("div",{name:"MuiTabs",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[{[`& .${ut.scrollButtons}`]:t.scrollButtons},{[`& .${ut.scrollButtons}`]:l.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,l.vertical&&t.vertical]}})(St(({theme:o})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.scrollButtonsHideMobile,style:{[`& .${ut.scrollButtons}`]:{[o.breakpoints.down("sm")]:{display:"none"}}}}]}))),Fo=N("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[t.scroller,l.fixed&&t.fixed,l.hideScrollbar&&t.hideScrollbar,l.scrollableX&&t.scrollableX,l.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:o})=>o.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:o})=>o.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:o})=>o.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:o})=>o.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),Oo=N("div",{name:"MuiTabs",slot:"List",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[t.list,t.flexContainer,l.vertical&&t.flexContainerVertical,l.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:o})=>o.vertical,style:{flexDirection:"column"}},{props:({ownerState:o})=>o.centered,style:{justifyContent:"center"}}]}),Do=N("span",{name:"MuiTabs",slot:"Indicator"})(St(({theme:o})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:o.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(o.vars||o).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(o.vars||o).palette.secondary.main}},{props:({ownerState:t})=>t.vertical,style:{height:"100%",width:2,right:0}}]}))),Xo=N(ko)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Lt={},mt=u.forwardRef(function(t,l){const s=ft({props:t,name:"MuiTabs"}),n=mo(),a=Xt(),{"aria-label":i,"aria-labelledby":b,action:f,centered:v=!1,children:C,className:m,component:S="div",allowScrollButtonsMobile:w=!1,indicatorColor:j="primary",onChange:B,orientation:y="horizontal",ScrollButtonComponent:Z,scrollButtons:M="auto",selectionFollowsFocus:rt,slots:E={},slotProps:A={},TabIndicatorProps:K={},TabScrollButtonProps:U={},textColor:_="primary",value:F,variant:P="standard",visibleScrollbar:nt=!1,...Kt}=s,T=P==="scrollable",g=y==="vertical",Y=g?"scrollTop":"scrollLeft",J=g?"top":"left",Q=g?"bottom":"right",st=g?"clientHeight":"clientWidth",V=g?"height":"width",R={...s,component:S,allowScrollButtonsMobile:w,indicatorColor:j,orientation:y,vertical:g,scrollButtons:M,textColor:_,variant:P,visibleScrollbar:nt,fixed:!T,hideScrollbar:T&&!nt,scrollableX:T&&!g,scrollableY:T&&g,centered:v&&!T,scrollButtonsHideMobile:!w},z=No(R),Ut=lt({elementType:E.StartScrollButtonIcon,externalSlotProps:A.startScrollButtonIcon,ownerState:R}),Yt=lt({elementType:E.EndScrollButtonIcon,externalSlotProps:A.endScrollButtonIcon,ownerState:R}),[xt,Vt]=u.useState(!1),[H,yt]=u.useState(Lt),[gt,qt]=u.useState(!1),[Ct,Gt]=u.useState(!1),[wt,Zt]=u.useState(!1),[Bt,_t]=u.useState({overflow:"hidden",scrollbarWidth:0}),Tt=new Map,k=u.useRef(null),$=u.useRef(null),O={slots:E,slotProps:{indicator:K,scrollButton:U,...A}},It=()=>{const e=k.current;let r;if(e){const c=e.getBoundingClientRect();r={clientWidth:e.clientWidth,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollWidth:e.scrollWidth,top:c.top,bottom:c.bottom,left:c.left,right:c.right}}let d;if(e&&F!==!1){const c=$.current.children;if(c.length>0){const h=c[Tt.get(F)];d=h?h.getBoundingClientRect():null}}return{tabsMeta:r,tabMeta:d}},q=dt(()=>{const{tabsMeta:e,tabMeta:r}=It();let d=0,c;g?(c="top",r&&e&&(d=r.top-e.top+e.scrollTop)):(c=a?"right":"left",r&&e&&(d=(a?-1:1)*(r[c]-e[c]+e.scrollLeft)));const h={[c]:d,[V]:r?r[V]:0};if(typeof H[c]!="number"||typeof H[V]!="number")yt(h);else{const I=Math.abs(H[c]-h[c]),L=Math.abs(H[V]-h[V]);(I>=1||L>=1)&&yt(h)}}),at=(e,{animation:r=!0}={})=>{r?Po(Y,k.current,e,{duration:n.transitions.duration.standard}):k.current[Y]=e},Mt=e=>{let r=k.current[Y];g?r+=e:r+=e*(a?-1:1),at(r)},Et=()=>{const e=k.current[st];let r=0;const d=Array.from($.current.children);for(let c=0;c<d.length;c+=1){const h=d[c];if(r+h[st]>e){c===0&&(r=e);break}r+=h[st]}return r},Jt=()=>{Mt(-1*Et())},Qt=()=>{Mt(Et())},[to,{onChange:Pt,...oo}]=D("scrollbar",{className:W(z.scrollableX,z.hideScrollbar),elementType:Xo,shouldForwardComponentProp:!0,externalForwardedProps:O,ownerState:R}),eo=u.useCallback(e=>{Pt?.(e),_t({overflow:null,scrollbarWidth:e})},[Pt]),[Rt,kt]=D("scrollButtons",{className:W(z.scrollButtons,U.className),elementType:$o,externalForwardedProps:O,ownerState:R,additionalProps:{orientation:y,slots:{StartScrollButtonIcon:E.startScrollButtonIcon||E.StartScrollButtonIcon,EndScrollButtonIcon:E.endScrollButtonIcon||E.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:Ut,endScrollButtonIcon:Yt}}}),lo=()=>{const e={};e.scrollbarSizeListener=T?p.jsx(to,{...oo,onChange:eo}):null;const d=T&&(M==="auto"&&(gt||Ct)||M===!0);return e.scrollButtonStart=d?p.jsx(Rt,{direction:a?"right":"left",onClick:Jt,disabled:!gt,...kt}):null,e.scrollButtonEnd=d?p.jsx(Rt,{direction:a?"left":"right",onClick:Qt,disabled:!Ct,...kt}):null,e},zt=dt(e=>{const{tabsMeta:r,tabMeta:d}=It();if(!(!d||!r)){if(d[J]<r[J]){const c=r[Y]+(d[J]-r[J]);at(c,{animation:e})}else if(d[Q]>r[Q]){const c=r[Y]+(d[Q]-r[Q]);at(c,{animation:e})}}}),tt=dt(()=>{T&&M!==!1&&Zt(!wt)});u.useEffect(()=>{const e=Ot(()=>{k.current&&q()});let r;const d=I=>{I.forEach(L=>{L.removedNodes.forEach(G=>{r?.unobserve(G)}),L.addedNodes.forEach(G=>{r?.observe(G)})}),e(),tt()},c=Dt(k.current);c.addEventListener("resize",e);let h;return typeof ResizeObserver<"u"&&(r=new ResizeObserver(e),Array.from($.current.children).forEach(I=>{r.observe(I)})),typeof MutationObserver<"u"&&(h=new MutationObserver(d),h.observe($.current,{childList:!0})),()=>{e.clear(),c.removeEventListener("resize",e),h?.disconnect(),r?.disconnect()}},[q,tt]),u.useEffect(()=>{const e=Array.from($.current.children),r=e.length;if(typeof IntersectionObserver<"u"&&r>0&&T&&M!==!1){const d=e[0],c=e[r-1],h={root:k.current,threshold:.99},I=ct=>{qt(!ct[0].isIntersecting)},L=new IntersectionObserver(I,h);L.observe(d);const G=ct=>{Gt(!ct[0].isIntersecting)},jt=new IntersectionObserver(G,h);return jt.observe(c),()=>{L.disconnect(),jt.disconnect()}}},[T,M,wt,C?.length]),u.useEffect(()=>{Vt(!0)},[]),u.useEffect(()=>{q()}),u.useEffect(()=>{zt(Lt!==H)},[zt,H]),u.useImperativeHandle(f,()=>({updateIndicator:q,updateScrollButtons:tt}),[q,tt]);const[ro,no]=D("indicator",{className:W(z.indicator,K.className),elementType:Do,externalForwardedProps:O,ownerState:R,additionalProps:{style:H}}),Wt=p.jsx(ro,{...no});let ot=0;const so=u.Children.map(C,e=>{if(!u.isValidElement(e))return null;const r=e.props.value===void 0?ot:e.props.value;Tt.set(r,ot);const d=r===F;return ot+=1,u.cloneElement(e,{fullWidth:P==="fullWidth",indicator:d&&!xt&&Wt,selected:d,selectionFollowsFocus:rt,onChange:B,textColor:_,value:r,...ot===1&&F===!1&&!e.props.tabIndex?{tabIndex:0}:{}})}),ao=e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey)return;const r=$.current,d=xo(r).activeElement;if(d.getAttribute("role")!=="tab")return;let h=y==="horizontal"?"ArrowLeft":"ArrowUp",I=y==="horizontal"?"ArrowRight":"ArrowDown";switch(y==="horizontal"&&a&&(h="ArrowRight",I="ArrowLeft"),e.key){case h:e.preventDefault(),et(r,d,$t);break;case I:e.preventDefault(),et(r,d,Ht);break;case"Home":e.preventDefault(),et(r,null,Ht);break;case"End":e.preventDefault(),et(r,null,$t);break}},it=lo(),[io,co]=D("root",{ref:l,className:W(z.root,m),elementType:Ao,externalForwardedProps:{...O,...Kt,component:S},ownerState:R}),[uo,bo]=D("scroller",{ref:k,className:z.scroller,elementType:Fo,externalForwardedProps:O,ownerState:R,additionalProps:{style:{overflow:Bt.overflow,[g?`margin${a?"Left":"Right"}`:"marginBottom"]:nt?void 0:-Bt.scrollbarWidth}}}),[po,fo]=D("list",{ref:$,className:W(z.list,z.flexContainer),elementType:Oo,externalForwardedProps:O,ownerState:R,getSlotProps:e=>({...e,onKeyDown:r=>{ao(r),e.onKeyDown?.(r)}})});return p.jsxs(io,{...co,children:[it.scrollButtonStart,it.scrollbarSizeListener,p.jsxs(uo,{...bo,children:[p.jsx(po,{"aria-label":i,"aria-labelledby":b,"aria-orientation":y==="vertical"?"vertical":null,role:"tablist",...fo,children:so}),xt&&Wt]}),it.scrollButtonEnd]})}),Nt="index",X={tabs:`${Nt}-tabs`,tab:`${Nt}-tab`},Ko=yo(mt)(({theme:o})=>({[`& .${X.tabs}`]:{},[`& .${X.tab}`]:{fontSize:"0.875rem",[o.breakpoints.up("md")]:{fontSize:"1rem"}}}));function Uo({tabs:o,current:t,onChange:l,iconPosition:s=void 0,enableTabClick:n=!1,...a}){return p.jsx(mt,{scrollButtons:"auto",value:t,onChange:(i,b)=>!n&&l(b),...a,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":{borderRadius:"100vw"},".MuiTabs-flexContainer":{borderRadius:"100vw",backgroundColor:"grey.100",padding:.5,display:"inline-flex",columnGap:.25,maxWidth:"100%",overflowX:"auto"},".MuiTab-root":{borderRadius:"100vw",border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,color:"text.secondary",fontSize:"13px",fontWeight:"normal",textTransform:"capitalize",transition:"background-color 0.2s ease","&.Mui-selected, &:hover":{backgroundColor:"action.selected",borderColor:"grey.100",color:"grey.A700"}},".MuiTabs-indicator":{display:"none"},...a.sx},children:o.map(i=>p.jsx(vt,{className:X.tab,value:i.value,label:i.label,icon:i.icon,iconPosition:s,onClick:()=>n&&l(i.value)},i.value))})}function Yo({tabs:o,current:t,onChange:l,iconPosition:s=void 0,enableTabClick:n=!1,...a}){return p.jsx(mt,{scrollButtons:"auto",value:t,onChange:(i,b)=>!n&&l(b),...a,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":a.orientation!=="vertical"?{"&::after":{content:'""',display:"block",position:"sticky",left:0,zIndex:-1,width:"100%",height:"1px",backgroundColor:"grey.300"}}:{},".MuiTabs-flexContainer":{display:"inline-flex",columnGap:2.5,px:0,pb:.5},".MuiTab-root":{border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,px:0,color:"text.secondary",fontSize:"14px",fontWeight:500,textTransform:"capitalize",minWidth:"auto","&.Mui-selected, &:hover":{color:"primary.main"}},".MuiTabs-indicator":{height:"1px",backgroundColor:"primary.main"},...a.sx},children:o.map(i=>p.jsx(vt,{className:X.tab,value:i.value,label:i.label,icon:i.icon,iconPosition:s,onClick:()=>n&&l(i.value)},i.value))})}function qo({tabs:o,current:t,onChange:l,variant:s=void 0,iconPosition:n=void 0,enableTabClick:a=!1,...i}){return s==="card"?p.jsx(Uo,{...i,tabs:o,current:t,enableTabClick:a,onChange:l,iconPosition:n}):s==="line"?p.jsx(Yo,{...i,tabs:o,current:t,enableTabClick:a,onChange:l,iconPosition:n}):p.jsx(Ko,{scrollButtons:"auto",variant:"scrollable",value:t,onChange:(b,f)=>!a&&l(f),indicatorColor:"primary",...i,className:[X.tabs,i.className||""].join(" "),children:o.map(b=>p.jsx(vt,{className:X.tab,value:b.value,label:b.label,icon:b.icon,iconPosition:n,onClick:()=>a&&l(b.value)},b.value))})}function Go(o,t=""){const{info:l}=go(),s=Co(()=>{const n=o?.breadcrumbsLabel||o?.label||"";return wo(n,t,l)},[o,t,l]);return s?p.jsx(Bo,{children:p.jsx("title",{children:s})}):null}export{qo as T,vt as a,mt as b,ut as t,Go as u};
@@ -1,4 +1,4 @@
1
- import{m as lt}from"./index-DA08Z61I.js";import"./index-DbK31dFt.js";import"./decode-DPztD6kB.js";/*!-----------------------------------------------------------------------------
1
+ import{m as lt}from"./index-CY-DQJlJ.js";import"./index-Dzuc8iT3.js";import"./decode-DPztD6kB.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1 +1 @@
1
- import{gZ as E,be as L}from"./index-DbK31dFt.js";const U=({url:r,allowFullScreen:o,position:a,display:u,height:i,width:y,overflow:c,styles:f,onLoad:p,onMouseOver:b,onMouseOut:w,scrolling:d,id:m,frameBorder:t,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:P,name:v,target:A,loading:F,importance:I,referrerpolicy:M,allowpaymentrequest:S,src:q,key:x})=>{const n=E({src:q||r,target:A||null,style:{position:a||null,display:u||"initial",overflow:c||null},scrolling:d||null,allowpaymentrequest:S||null,importance:I||null,sandbox:s&&[...s].join(" ")||null,loading:F||null,styles:f||null,name:v||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:m||null,"aria-labelledby":P||null,"aria-hidden":O||null,"aria-label":k||null,width:y||null,height:i||null,onLoad:p||null,onMouseOver:b||null,onMouseOut:w||null,key:x||"iframe"});let l=Object.create(null);for(let e of Object.keys(n))n[e]!=null&&(l[e]=n[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(o)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return t>=0&&(l.style.hasOwnProperty("border")||(l.style.border=t)),L.createElement("iframe",Object.assign({},l))};export{U as I};
1
+ import{gZ as E,be as L}from"./index-Dzuc8iT3.js";const U=({url:r,allowFullScreen:o,position:a,display:u,height:i,width:y,overflow:c,styles:f,onLoad:p,onMouseOver:b,onMouseOut:w,scrolling:d,id:m,frameBorder:t,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:P,name:v,target:A,loading:F,importance:I,referrerpolicy:M,allowpaymentrequest:S,src:q,key:x})=>{const n=E({src:q||r,target:A||null,style:{position:a||null,display:u||"initial",overflow:c||null},scrolling:d||null,allowpaymentrequest:S||null,importance:I||null,sandbox:s&&[...s].join(" ")||null,loading:F||null,styles:f||null,name:v||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:m||null,"aria-labelledby":P||null,"aria-hidden":O||null,"aria-label":k||null,width:y||null,height:i||null,onLoad:p||null,onMouseOver:b||null,onMouseOut:w||null,key:x||"iframe"});let l=Object.create(null);for(let e of Object.keys(n))n[e]!=null&&(l[e]=n[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(o)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return t>=0&&(l.style.hasOwnProperty("border")||(l.style.border=t)),L.createElement("iframe",Object.assign({},l))};export{U as I};
@@ -1,4 +1,4 @@
1
- import{aF as Ge,j as e,bn as gt,r as g,bz as Q,bf as K,H as q,aH as D,g as xt,o as d,h as ee,at as bt,ay as jt,K as C,T as U,V as X,eM as Fe,O as Pe,ij as Ye,bj as Te,aU as Ie,R as Ee,dG as Ne,b3 as qe,b1 as Ae,C as Qe,f as Xe,e_ as Je,aP as De,W as yt,as as Ze,ik as et,v as Oe,f0 as tt,fn as je,fH as st,dA as St,s as ie,af as pe,G as Ue,au as vt,il as Ct,im as Nt,$ as nt,io as wt,ip as Rt,iq as Tt,ir as It,N as Et,bu as it,E as At,J as Dt,P as Ot,S as Lt,Q as $e,is as kt,a3 as Ft}from"./index-DbK31dFt.js";import{d as Pt,H as at,g as _t}from"./index-fK2TFREh.js";import{R as _e,S as Bt}from"./actions-CsBw5W6U.js";import{B as zt}from"./index-mOCIkNdQ.js";import{S as me}from"./shorten-label-SgarF_Ma.js";import{v as ot}from"./index-CE07KwkJ.js";import{T as Wt}from"./html-title-C0ZWlysm.js";import{R as Mt}from"./Refresh-D8ICG9YW.js";import{D as Ht,g as Kt}from"./traffic-BzgoMKvP.js";import{u as qt}from"./use-mobile-C3U3R5Q3.js";import"./FilterList-sINld31b.js";import"./CSSTransition-Dwgb1QPW.js";import"./emotion-cache.browser.esm-D_e1cJtm.js";import"./index-BX8O0ZHV.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-C_BH-hM0.js";import"./index-DJypfjpv.js";import"./TableSearch-D9jLZhkp.js";import"./Search-BuS9kxDD.js";import"./Clear-Cw2o-hjt.js";import"./MoreVert-CI4HEjN0.js";import"./useLocalStorage-BMre6evC.js";import"./url-evaluation-CqBTA_SW.js";import"./get-safe-url-D-cF2nX-.js";import"./ButtonGroup-CK4D_Ln2.js";import"./getValidReactChildren-BAFkQ3fw.js";import"./permission-C9Y2XRsP.js";import"./index.esm-DfrzxWuO.js";import"./collapse-Pv0Zul5P.js";import"./blocklet-DwHEwBiZ.js";import"./Switch-C_P2C8Xa.js";import"./iframe-DFPz5jZg.js";import"./ChevronLeft-CEo37UIa.js";import"./ChevronRight-ByhLYhtZ.js";import"./index-DBii9-f-.js";import"./base-chart-CXk2GzK7.js";import"./index-CLLICC2z.js";import"./AdapterDayjs-DenpZUIq.js";import"./useThemeProps-DhBxLZiP.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),$t=Ge(e.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),rt=g.createContext({}),{Provider:Vt,Consumer:on}=rt;function Gt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=gt(),[l,x]=g.useState([]),[f,y]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),h=Q(()=>s.meta?.did,[s]),[b,S]=g.useState([]),[B,_]=g.useState({}),R=Q(()=>l.length?new Set(l.map(m=>m.id)):new Set,[l]),$=async({page:m=1,pageSize:N=20,...O}={})=>{if(!h)return[];try{const A={paging:{page:m,pageSize:N},...O,teamDid:h,dateRange:O.dateRange?[K(O.dateRange[0]).toISOString(),K(O.dateRange[1]).toISOString()]:void 0},{dids:w,...L}=A;let P="";w&&w.includes("system")&&(P="system");const ae=w?w.filter(oe=>oe!=="system"):[],se={...L,source:P,componentDids:ae},Z=await n.getNotificationSendLog({input:se});return _(se),x(Z.list),y(Z.paging),Z.list}catch(A){return q.error(A.message),[]}},M=async()=>{const m=await n.getNotificationComponents({input:{teamDid:h}});S(m.componentDids)},k=g.useCallback(m=>{const N=s.children.find(O=>O.meta?.did===m);if(N)return N.ancestors=[s],N},[s]),F=async({notificationId:m,receivers:N,channels:O,...A})=>{await n.resendNotification({input:{teamDid:h,notificationId:m,receivers:N,channels:O.map(w=>w==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:w==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:w),...A}})},V=g.useCallback(async m=>(await n.getUser({input:{teamDid:h,user:{did:m},options:{enableConnectedAccount:!0}}})).user,[n,h]),G=g.useCallback(async({page:m=1,pageSize:N=20,...O}={})=>{try{const A={paging:{page:m,pageSize:N},...O,userName:O.searchText||"",teamDid:h,dateRange:O.dateRange?[K(O.dateRange[0]).toISOString(),K(O.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:A})}catch(A){throw q.error(A.message),A}},[n,h]);g.useEffect(()=>{h&&M()},[h]),o(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,m=>{R.has(m.notificationId)&&$(B)},[R,B]),o(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,m=>{R.has(m.id)||$(B)},[R,B]);const J={fetch:$,data:l,paging:f,blocklet:s,getComponent:k,resendNotification:F,getUser:V,componentDids:b,getReceivers:G,inService:r,teamDid:h};return e.jsx(Vt,{value:{notificationRecords:J},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Yt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Yt[t],children:t})}const Qt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:o,reason:l="",channel:x="wallet"}=n,f=o?t("notification.sendStatus.sentTime",{date:bt(o,s)}):"",y=Qt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:y}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:y,sentTime:f}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Jt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Zt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),es=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ts=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=K().startOf("day");return t.filter(n=>K(n.sendAt).isSame(s,"day")).length},ss=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=ee(t,l,[]);return be(x)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return be(l)}const o={};return ke.forEach(l=>{const x=`${l}SendRecord`,f=ee(t,x,[]),y=be(f);o[l]=y}),r.length>0&&r.forEach(l=>{const x=n[l]??[],f=be(x);o[l]=f}),o},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Se=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ns=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:o,title:l="",sentTime:x="",reason:f=""}=t,y=[l,f].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(U,{color:"inherit",sx:{fontSize:12},children:y}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(C,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[o]}}),e.jsx(C,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[o]}})]}),e.jsx(U,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ve.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ve({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:o}=X();return e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(U,{children:[s,": "]}),t.map(l=>{const x=lt(r,o,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(C,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:x,enableTooltip:!1,children:x.title})}),onDelete:f=>n(f,l)},l)})]})}ze.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function ze({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:o.map(f=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(f.value??f)>-1,onChange:y=>{const h=[...t];y.target.checked?h[n]=[...h[n],f.value??f]:h[n]=h[n].filter(b=>b!==(f.value??f)),s(h[n],n,r)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(f)})},f.value??f))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:l,locale:x}=X(),f=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(Ne,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=X(),r=K().toDate(),[o,l]=g.useState(null),x=g.useCallback(h=>{l(o?null:h.currentTarget)},[o]),f=!!o,y=g.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(K(h.startDate).isAfter(h.endDate)||!K(h.startDate).isValid()||!K(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(U,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ne,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:f,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Ht,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Kt(r),onChange:y})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=X();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Pt.TableFilterList,{...s,ItemComponent:t})})]})}function He({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...o&&l?{onDelete:o}:{}})}He.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const is=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=X(),[o,l]=g.useState(is),[x,f]=g.useState(!0),y=(b,S)=>{S.checked=b.target.checked;const B=o.map(_=>({..._,checked:_.value===S.value?S.checked:_.checked}));l(B)},h=b=>{b.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(U,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(b=>e.jsx(Ie,{control:e.jsx(Ee,{checked:b.checked,onChange:S=>y(S,b),name:b.value}),label:b.label},b.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:b=>f(b.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ne,{onClick:b=>{b.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ne,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Qe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=X(),l=Xe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:f,inService:y,teamDid:h,getUser:b,blocklet:S}=Be(),[B,_]=g.useState(!1),[R,$]=g.useState([]),M=De({anchorEl:null,position:null}),k=De({anchorEl:null,position:null}),[F,V]=g.useState(null),[G,J]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,N]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[K().subtract(1,"month").startOf("day").toDate(),K().endOf("day").toDate()]}),[O,A]=g.useState([]),w=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],L=async()=>{if(!B&&t)try{_(!0);const i=await f({notificationId:t,...m}),a=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,y)}}));$(a),J(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{L()},[m]);const P=i=>{i.stopPropagation();const a=i.currentTarget;k.anchorEl=a;const c=a.getBoundingClientRect();k.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:P,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:G.page-1,rowsPerPage:G.pageSize,count:G.total,searchText:m.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:O,onRowSelectionChange:(i,a)=>{A(a.map(c=>c.dataIndex))},customToolbarSelect:ae},Z=({page:i,rowsPerPage:a,searchText:c,filterList:v})=>{const[,z=[],Y=[],H=[]]=v;m.pageSize!==a?N(W=>({...W,pageSize:a,page:1})):m.page!==i+1?N(W=>({...W,page:i+1})):m.searchText!==c?N(W=>({...W,searchText:c,page:1})):pe(z,m.walletSendStatus)?pe(Y,m.pushKitSendStatus)?pe(H,m.emailSendStatus)||N(W=>({...W,emailSendStatus:H,page:1})):N(W=>({...W,pushKitSendStatus:Y,page:1})):N(W=>({...W,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,a)=>{if(!a)return!1;const c=await b(a);return c?i==="wallet"?Zt(c):i==="email"?Xt(S,c):i==="pushKit"?Jt(S,c):i==="webhook"?es(c):!0:!1},[b,S]),we=g.useCallback(i=>ts(r,i),[r]),ne=()=>{M.anchorEl=null,M.position=null,V(null)},re=()=>{k.anchorEl=null,k.position=null},ge=async(i,a,c=!0,v="")=>{if(!(!a.length||!i.length))try{s(i,a,c,v),k.anchorEl||(await xe(.5),ne())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:a})=>{const c=O.map(v=>R[v].receiver);await ge(i,c,a),await xe(.5),re(),A([])},u=async(i,a=[],c=!0)=>{try{await ge(["webhook"],[i.receiver],c,a)}catch(v){q.error(v.response?v.response.statusText:v.message)}},j=async(i,a,c,v=[],z=!0)=>{if(i.stopPropagation(),ss(a,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await u(a,v,z);return}if(i){const H=i.currentTarget,W=H.getBoundingClientRect();M.anchorEl=H,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}V({channel:c});try{const H=await oe(c,a.receiver);await xe(1),V({channel:c,result:H}),(typeof H=="boolean"&&H||St(H)&&Object.values(H).every(W=>!!W))&&(await s([c],[a.receiver],z),k.anchorEl||(await xe(.5),ne()))}catch(H){q.error(H.message)}},I=i=>{N(a=>({...a,dateRange:i,page:1}))},E=(i,a,c,v)=>{i.stopPropagation();const z=c.filter(Y=>Y!==a);N(Y=>({...Y,[v]:z,page:1}))},T=Q(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:a,receiver:c}=R[i];return a?e.jsxs(C,{"data-cy":`member-name-${a.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${a.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:a.fullName})]},c):e.jsx(yt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:m.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Wallet",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:a,index:c,column:v,filterValues:w})},customBodyRenderLite:i=>{const{walletSendStatus:a,walletSendAt:c,walletSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"wallet",onResend:z=>j(z,R[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:a,pushKitSendAt:c,pushKitSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"pushkit",onResend:z=>j(z,R[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:m.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Push Kit",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:a,emailSendAt:c,emailSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"email",onResend:z=>j(z,R[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:m.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Email",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Email",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:a}=R[i];if(!a)return null;const c=Object.entries(a)[0];if(!c)return null;const[v,z]=c,Y=z[0];return e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(C,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:v},v),e.jsx(ce,{status:Y.status,updatedAt:Y.sendAt,reason:Y.failedReason,channel:"webhook",onResend:H=>j(H,R[i],"webhook",[v],!1)})]},v)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:a}=R[i];return e.jsx(et,{value:a,locale:o,shouldUpdate:!0})}}}],[R,o,m,r]),le=[e.jsx(We,{value:m.dateRange,onChange:I},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Mt,{}),onClick:()=>L(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(os,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:o,loading:B,columns:T,data:R,onChange:Z,options:se,customButtons:le,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:a=>e.jsx(He,{...a,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ae,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:ne,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rs,{children:[e.jsxs(U,{variant:"body1",component:"div",className:"check-title",children:[F?.channel," Checking"]}),e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:we(F?.channel).map(i=>{const{type:a,pass:c,fail:v}=i;return!F?.result||F?.result?.[a]?e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:F?.result?.[a]?je.success.main:"inherit"},children:[F?.result?e.jsx($t,{}):e.jsx(Qe,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},a):e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:je.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:v})]},a)})})]})}),k.anchorEl&&e.jsx(Ae,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:re,onConfirm:p})})]})})})}const as=g.memo(ft),os=ie.div`
1
+ import{aF as Ge,j as e,bn as gt,r as g,bz as Q,bf as K,H as q,aH as D,g as xt,o as d,h as ee,at as bt,ay as jt,K as C,T as U,V as X,eM as Fe,O as Pe,ij as Ye,bj as Te,aU as Ie,R as Ee,dG as Ne,b3 as qe,b1 as Ae,C as Qe,f as Xe,e_ as Je,aP as De,W as yt,as as Ze,ik as et,v as Oe,f0 as tt,fn as je,fH as st,dA as St,s as ie,af as pe,G as Ue,au as vt,il as Ct,im as Nt,$ as nt,io as wt,ip as Rt,iq as Tt,ir as It,N as Et,bu as it,E as At,J as Dt,P as Ot,S as Lt,Q as $e,is as kt,a3 as Ft}from"./index-Dzuc8iT3.js";import{d as Pt,H as at,g as _t}from"./index-BGo2ji7B.js";import{R as _e,S as Bt}from"./actions-CQRwSERj.js";import{B as zt}from"./index-C8k-wIkI.js";import{S as me}from"./shorten-label-ByAddcRT.js";import{v as ot}from"./index-BTeQyE9h.js";import{T as Wt}from"./html-title-3cSvLxbM.js";import{R as Mt}from"./Refresh-VB_fFdY-.js";import{D as Ht,g as Kt}from"./traffic-D2tJoibq.js";import{u as qt}from"./use-mobile-ENQw9KmE.js";import"./FilterList-B1C7unqT.js";import"./CSSTransition-YK8aX8nK.js";import"./emotion-cache.browser.esm-B4PDkYd9.js";import"./index-V6W4s-Vq.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-BKRl_wlt.js";import"./index-CdTvqOME.js";import"./TableSearch-U9rZfIzu.js";import"./Search-DYBL-x4y.js";import"./Clear-4n0vKAse.js";import"./MoreVert-B909vYzl.js";import"./useLocalStorage-BfHKsdtC.js";import"./url-evaluation-CRBdYFML.js";import"./get-safe-url-GLo4lMcu.js";import"./ButtonGroup-BAvFNy2i.js";import"./getValidReactChildren-DmUPqavH.js";import"./permission-DCAf_gW3.js";import"./index.esm-DfXlzNxJ.js";import"./collapse-XOI3eY05.js";import"./blocklet-DAH77r3I.js";import"./Switch-Bb-rNPtt.js";import"./iframe-b7qWsXni.js";import"./ChevronLeft-CSCmHm5m.js";import"./ChevronRight-qIIkSnQ7.js";import"./index-DBii9-f-.js";import"./base-chart-SmGCWPp4.js";import"./index-B4qKQt-w.js";import"./AdapterDayjs-BQhqZd8R.js";import"./useThemeProps-BqRQljgd.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),$t=Ge(e.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),rt=g.createContext({}),{Provider:Vt,Consumer:on}=rt;function Gt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=gt(),[l,x]=g.useState([]),[f,y]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),h=Q(()=>s.meta?.did,[s]),[b,S]=g.useState([]),[B,_]=g.useState({}),R=Q(()=>l.length?new Set(l.map(m=>m.id)):new Set,[l]),$=async({page:m=1,pageSize:N=20,...O}={})=>{if(!h)return[];try{const A={paging:{page:m,pageSize:N},...O,teamDid:h,dateRange:O.dateRange?[K(O.dateRange[0]).toISOString(),K(O.dateRange[1]).toISOString()]:void 0},{dids:w,...L}=A;let P="";w&&w.includes("system")&&(P="system");const ae=w?w.filter(oe=>oe!=="system"):[],se={...L,source:P,componentDids:ae},Z=await n.getNotificationSendLog({input:se});return _(se),x(Z.list),y(Z.paging),Z.list}catch(A){return q.error(A.message),[]}},M=async()=>{const m=await n.getNotificationComponents({input:{teamDid:h}});S(m.componentDids)},k=g.useCallback(m=>{const N=s.children.find(O=>O.meta?.did===m);if(N)return N.ancestors=[s],N},[s]),F=async({notificationId:m,receivers:N,channels:O,...A})=>{await n.resendNotification({input:{teamDid:h,notificationId:m,receivers:N,channels:O.map(w=>w==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:w==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:w),...A}})},V=g.useCallback(async m=>(await n.getUser({input:{teamDid:h,user:{did:m},options:{enableConnectedAccount:!0}}})).user,[n,h]),G=g.useCallback(async({page:m=1,pageSize:N=20,...O}={})=>{try{const A={paging:{page:m,pageSize:N},...O,userName:O.searchText||"",teamDid:h,dateRange:O.dateRange?[K(O.dateRange[0]).toISOString(),K(O.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:A})}catch(A){throw q.error(A.message),A}},[n,h]);g.useEffect(()=>{h&&M()},[h]),o(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,m=>{R.has(m.notificationId)&&$(B)},[R,B]),o(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,m=>{R.has(m.id)||$(B)},[R,B]);const J={fetch:$,data:l,paging:f,blocklet:s,getComponent:k,resendNotification:F,getUser:V,componentDids:b,getReceivers:G,inService:r,teamDid:h};return e.jsx(Vt,{value:{notificationRecords:J},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Yt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Yt[t],children:t})}const Qt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:o,reason:l="",channel:x="wallet"}=n,f=o?t("notification.sendStatus.sentTime",{date:bt(o,s)}):"",y=Qt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:y}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:y,sentTime:f}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Jt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Zt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),es=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ts=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=K().startOf("day");return t.filter(n=>K(n.sendAt).isSame(s,"day")).length},ss=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=ee(t,l,[]);return be(x)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return be(l)}const o={};return ke.forEach(l=>{const x=`${l}SendRecord`,f=ee(t,x,[]),y=be(f);o[l]=y}),r.length>0&&r.forEach(l=>{const x=n[l]??[],f=be(x);o[l]=f}),o},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Se=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ns=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:o,title:l="",sentTime:x="",reason:f=""}=t,y=[l,f].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(U,{color:"inherit",sx:{fontSize:12},children:y}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(C,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[o]}}),e.jsx(C,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[o]}})]}),e.jsx(U,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ve.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ve({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:o}=X();return e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(U,{children:[s,": "]}),t.map(l=>{const x=lt(r,o,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(C,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:x,enableTooltip:!1,children:x.title})}),onDelete:f=>n(f,l)},l)})]})}ze.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function ze({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:o.map(f=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(f.value??f)>-1,onChange:y=>{const h=[...t];y.target.checked?h[n]=[...h[n],f.value??f]:h[n]=h[n].filter(b=>b!==(f.value??f)),s(h[n],n,r)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(f)})},f.value??f))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:l,locale:x}=X(),f=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(Ne,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=X(),r=K().toDate(),[o,l]=g.useState(null),x=g.useCallback(h=>{l(o?null:h.currentTarget)},[o]),f=!!o,y=g.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(K(h.startDate).isAfter(h.endDate)||!K(h.startDate).isValid()||!K(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(U,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ne,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:f,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Ht,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Kt(r),onChange:y})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=X();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Pt.TableFilterList,{...s,ItemComponent:t})})]})}function He({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...o&&l?{onDelete:o}:{}})}He.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const is=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=X(),[o,l]=g.useState(is),[x,f]=g.useState(!0),y=(b,S)=>{S.checked=b.target.checked;const B=o.map(_=>({..._,checked:_.value===S.value?S.checked:_.checked}));l(B)},h=b=>{b.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(U,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(b=>e.jsx(Ie,{control:e.jsx(Ee,{checked:b.checked,onChange:S=>y(S,b),name:b.value}),label:b.label},b.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:b=>f(b.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ne,{onClick:b=>{b.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ne,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Qe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=X(),l=Xe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:f,inService:y,teamDid:h,getUser:b,blocklet:S}=Be(),[B,_]=g.useState(!1),[R,$]=g.useState([]),M=De({anchorEl:null,position:null}),k=De({anchorEl:null,position:null}),[F,V]=g.useState(null),[G,J]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,N]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[K().subtract(1,"month").startOf("day").toDate(),K().endOf("day").toDate()]}),[O,A]=g.useState([]),w=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],L=async()=>{if(!B&&t)try{_(!0);const i=await f({notificationId:t,...m}),a=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,y)}}));$(a),J(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{L()},[m]);const P=i=>{i.stopPropagation();const a=i.currentTarget;k.anchorEl=a;const c=a.getBoundingClientRect();k.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:P,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:G.page-1,rowsPerPage:G.pageSize,count:G.total,searchText:m.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:O,onRowSelectionChange:(i,a)=>{A(a.map(c=>c.dataIndex))},customToolbarSelect:ae},Z=({page:i,rowsPerPage:a,searchText:c,filterList:v})=>{const[,z=[],Y=[],H=[]]=v;m.pageSize!==a?N(W=>({...W,pageSize:a,page:1})):m.page!==i+1?N(W=>({...W,page:i+1})):m.searchText!==c?N(W=>({...W,searchText:c,page:1})):pe(z,m.walletSendStatus)?pe(Y,m.pushKitSendStatus)?pe(H,m.emailSendStatus)||N(W=>({...W,emailSendStatus:H,page:1})):N(W=>({...W,pushKitSendStatus:Y,page:1})):N(W=>({...W,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,a)=>{if(!a)return!1;const c=await b(a);return c?i==="wallet"?Zt(c):i==="email"?Xt(S,c):i==="pushKit"?Jt(S,c):i==="webhook"?es(c):!0:!1},[b,S]),we=g.useCallback(i=>ts(r,i),[r]),ne=()=>{M.anchorEl=null,M.position=null,V(null)},re=()=>{k.anchorEl=null,k.position=null},ge=async(i,a,c=!0,v="")=>{if(!(!a.length||!i.length))try{s(i,a,c,v),k.anchorEl||(await xe(.5),ne())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:a})=>{const c=O.map(v=>R[v].receiver);await ge(i,c,a),await xe(.5),re(),A([])},u=async(i,a=[],c=!0)=>{try{await ge(["webhook"],[i.receiver],c,a)}catch(v){q.error(v.response?v.response.statusText:v.message)}},j=async(i,a,c,v=[],z=!0)=>{if(i.stopPropagation(),ss(a,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await u(a,v,z);return}if(i){const H=i.currentTarget,W=H.getBoundingClientRect();M.anchorEl=H,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}V({channel:c});try{const H=await oe(c,a.receiver);await xe(1),V({channel:c,result:H}),(typeof H=="boolean"&&H||St(H)&&Object.values(H).every(W=>!!W))&&(await s([c],[a.receiver],z),k.anchorEl||(await xe(.5),ne()))}catch(H){q.error(H.message)}},I=i=>{N(a=>({...a,dateRange:i,page:1}))},E=(i,a,c,v)=>{i.stopPropagation();const z=c.filter(Y=>Y!==a);N(Y=>({...Y,[v]:z,page:1}))},T=Q(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:a,receiver:c}=R[i];return a?e.jsxs(C,{"data-cy":`member-name-${a.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${a.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:a.fullName})]},c):e.jsx(yt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:m.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Wallet",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:a,index:c,column:v,filterValues:w})},customBodyRenderLite:i=>{const{walletSendStatus:a,walletSendAt:c,walletSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"wallet",onResend:z=>j(z,R[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:a,pushKitSendAt:c,pushKitSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"pushkit",onResend:z=>j(z,R[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:m.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Push Kit",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:a,emailSendAt:c,emailSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"email",onResend:z=>j(z,R[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:m.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Email",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Email",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:a}=R[i];if(!a)return null;const c=Object.entries(a)[0];if(!c)return null;const[v,z]=c,Y=z[0];return e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(C,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:v},v),e.jsx(ce,{status:Y.status,updatedAt:Y.sendAt,reason:Y.failedReason,channel:"webhook",onResend:H=>j(H,R[i],"webhook",[v],!1)})]},v)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:a}=R[i];return e.jsx(et,{value:a,locale:o,shouldUpdate:!0})}}}],[R,o,m,r]),le=[e.jsx(We,{value:m.dateRange,onChange:I},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Mt,{}),onClick:()=>L(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(os,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:o,loading:B,columns:T,data:R,onChange:Z,options:se,customButtons:le,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:a=>e.jsx(He,{...a,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ae,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:ne,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rs,{children:[e.jsxs(U,{variant:"body1",component:"div",className:"check-title",children:[F?.channel," Checking"]}),e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:we(F?.channel).map(i=>{const{type:a,pass:c,fail:v}=i;return!F?.result||F?.result?.[a]?e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:F?.result?.[a]?je.success.main:"inherit"},children:[F?.result?e.jsx($t,{}):e.jsx(Qe,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},a):e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:je.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:v})]},a)})})]})}),k.anchorEl&&e.jsx(Ae,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:re,onConfirm:p})})]})})})}const as=g.memo(ft),os=ie.div`
2
2
  td.MuiTableCell-footer {
3
3
  border: none !important;
4
4
  }
@@ -1 +1 @@
1
- import{eF as D}from"./index-DbK31dFt.js";function f(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function $(e){return f(e)==="object"}function re(e){return Array.isArray(e)&&e.length>0&&e.every(m=>"message"in m)}function Y(e,m){return e.length<124?e:m}const ne="graphql-transport-ws";var g;(function(e){e[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(g||(g={}));var c;(function(e){e.ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete"})(c||(c={}));function v(e){if(!$(e))throw new Error(`Message is expected to be an object, but got ${f(e)}`);if(!e.type)throw new Error("Message is missing the 'type' property");if(typeof e.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${f(e.type)}`);switch(e.type){case c.ConnectionInit:case c.ConnectionAck:case c.Ping:case c.Pong:{if(e.payload!=null&&!$(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break}case c.Subscribe:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!$(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${f(e.payload)}`);if(typeof e.payload.query!="string")throw new Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${f(e.payload.query)}`);if(e.payload.variables!=null&&!$(e.payload.variables))throw new Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${f(e.payload.variables)}`);if(e.payload.operationName!=null&&f(e.payload.operationName)!=="string")throw new Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${f(e.payload.operationName)}`);if(e.payload.extensions!=null&&!$(e.payload.extensions))throw new Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${f(e.payload.extensions)}`);break}case c.Next:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!$(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${f(e.payload)}`);break}case c.Error:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!re(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break}case c.Complete:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${e.type}"`)}return e}function oe(e,m){return v(typeof e=="string"?JSON.parse(e,m):e)}function W(e,m){return v(e),JSON.stringify(e,m)}var A=function(e){return this instanceof A?(this.v=e,this):new A(e)},ie=function(e,m,R){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var M=R.apply(e,m||[]),b,w=[];return b={},E("next"),E("throw"),E("return"),b[Symbol.asyncIterator]=function(){return this},b;function E(u){M[u]&&(b[u]=function(r){return new Promise(function(S,L){w.push([u,r,S,L])>1||I(u,r)})})}function I(u,r){try{q(M[u](r))}catch(S){F(w[0][3],S)}}function q(u){u.value instanceof A?Promise.resolve(u.value.v).then(z,G):F(w[0][2],u)}function z(u){I("next",u)}function G(u){I("throw",u)}function F(u,r){u(r),w.shift(),w.length&&I(w[0][0],w[0][1])}};function pe(e){const{url:m,connectionParams:R,lazy:M=!0,onNonLazyError:b=console.error,lazyCloseTimeout:w=0,keepAlive:E=0,disablePong:I,connectionAckWaitTimeout:q=0,retryAttempts:z=5,retryWait:G=async function(a){let t=1e3;for(let o=0;o<a;o++)t*=2;await new Promise(o=>setTimeout(o,t+Math.floor(Math.random()*2700+300)))},shouldRetry:F=J,isFatalConnectionProblem:u,on:r,webSocketImpl:S,generateID:L=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{const t=Math.random()*16|0;return(a=="x"?t:t&3|8).toString(16)})},jsonMessageReplacer:U,jsonMessageReviver:ee}=e;let T;if(S){if(!ae(S))throw new Error("Invalid WebSocket implementation provided");T=S}else typeof WebSocket<"u"?T=WebSocket:typeof D<"u"?T=D.WebSocket||D.MozWebSocket:typeof window<"u"&&(T=window.WebSocket||window.MozWebSocket);if(!T)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const N=T,d=(()=>{const n=(()=>{const t={};return{on(o,s){return t[o]=s,()=>{delete t[o]}},emit(o){var s;"id"in o&&((s=t[o.id])===null||s===void 0||s.call(t,o))}}})(),a={connecting:r?.connecting?[r.connecting]:[],opened:r?.opened?[r.opened]:[],connected:r?.connected?[r.connected]:[],ping:r?.ping?[r.ping]:[],pong:r?.pong?[r.pong]:[],message:r?.message?[n.emit,r.message]:[n.emit],closed:r?.closed?[r.closed]:[],error:r?.error?[r.error]:[]};return{onMessage:n.on,on(t,o){const s=a[t];return s.push(o),()=>{s.splice(s.indexOf(o),1)}},emit(t,...o){for(const s of[...a[t]])s(...o)}}})();function Q(n){const a=[d.on("error",t=>{a.forEach(o=>o()),n(t)}),d.on("closed",t=>{a.forEach(o=>o()),n(t)})]}let h,k=0,H,O=!1,j=0,C=!1;async function K(){clearTimeout(H);const[n,a]=await(h??(h=new Promise((s,y)=>(async()=>{if(O){if(await G(j),!k)return h=void 0,y({code:1e3,reason:"All Subscriptions Gone"});j++}d.emit("connecting",O);const i=new N(typeof m=="function"?await m():m,ne);let x,_;function B(){isFinite(E)&&E>0&&(clearTimeout(_),_=setTimeout(()=>{i.readyState===N.OPEN&&(i.send(W({type:c.Ping})),d.emit("ping",!1,void 0))},E))}Q(l=>{h=void 0,clearTimeout(x),clearTimeout(_),y(l),l instanceof Z&&(i.close(4499,"Terminated"),i.onerror=null,i.onclose=null)}),i.onerror=l=>d.emit("error",l),i.onclose=l=>d.emit("closed",l),i.onopen=async()=>{try{d.emit("opened",i);const l=typeof R=="function"?await R():R;if(i.readyState!==N.OPEN)return;i.send(W(l?{type:c.ConnectionInit,payload:l}:{type:c.ConnectionInit},U)),isFinite(q)&&q>0&&(x=setTimeout(()=>{i.close(g.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},q)),B()}catch(l){d.emit("error",l),i.close(g.InternalClientError,Y(l instanceof Error?l.message:new Error(l).message,"Internal client error"))}};let P=!1;i.onmessage=({data:l})=>{try{const p=oe(l,ee);if(d.emit("message",p),p.type==="ping"||p.type==="pong"){d.emit(p.type,!0,p.payload),p.type==="pong"?B():I||(i.send(W(p.payload?{type:c.Pong,payload:p.payload}:{type:c.Pong})),d.emit("pong",!1,p.payload));return}if(P)return;if(p.type!==c.ConnectionAck)throw new Error(`First message cannot be of type ${p.type}`);clearTimeout(x),P=!0,d.emit("connected",i,p.payload,O),O=!1,j=0,s([i,new Promise((ce,te)=>Q(te))])}catch(p){i.onmessage=null,d.emit("error",p),i.close(g.BadResponse,Y(p instanceof Error?p.message:new Error(p).message,"Bad response"))}}})())));n.readyState===N.CLOSING&&await a;let t=()=>{};const o=new Promise(s=>t=s);return[n,t,Promise.race([o.then(()=>{if(!k){const s=()=>n.close(1e3,"Normal Closure");isFinite(w)&&w>0?H=setTimeout(()=>{n.readyState===N.OPEN&&s()},w):s()}}),a])]}function V(n){if(J(n)&&(se(n.code)||[g.InternalServerError,g.InternalClientError,g.BadRequest,g.BadResponse,g.Unauthorized,g.SubprotocolNotAcceptable,g.SubscriberAlreadyExists,g.TooManyInitialisationRequests].includes(n.code)))throw n;if(C)return!1;if(J(n)&&n.code===1e3)return k>0;if(!z||j>=z||!F(n)||u?.(n))throw n;return O=!0}M||(async()=>{for(k++;;)try{const[,,n]=await K();await n}catch(n){try{if(!V(n))return}catch(a){return b?.(a)}}})();function X(n,a){const t=L(n);let o=!1,s=!1,y=()=>{k--,o=!0};return(async()=>{for(k++;;)try{const[i,x,_]=await K();if(o)return x();const B=d.onMessage(t,P=>{switch(P.type){case c.Next:{a.next(P.payload);return}case c.Error:{s=!0,o=!0,a.error(P.payload),y();return}case c.Complete:{o=!0,y();return}}});i.send(W({id:t,type:c.Subscribe,payload:n},U)),y=()=>{!o&&i.readyState===N.OPEN&&i.send(W({id:t,type:c.Complete},U)),k--,o=!0,x()},await _.finally(B);return}catch(i){if(!V(i))return}})().then(()=>{s||a.complete()}).catch(i=>{a.error(i)}),()=>{o||y()}}return{on:d.on,subscribe:X,iterate(n){const a=[],t={done:!1,error:null,resolve:()=>{}},o=X(n,{next(y){a.push(y),t.resolve()},error(y){t.done=!0,t.error=y,t.resolve()},complete(){t.done=!0,t.resolve()}}),s=function(){return ie(this,arguments,function*(){for(;;){for(a.length||(yield A(new Promise(x=>t.resolve=x)));a.length;)yield yield A(a.shift());if(t.error)throw t.error;if(t.done)return yield A(void 0)}})}();return s.throw=async y=>(t.done||(t.done=!0,t.error=y,t.resolve()),{done:!0,value:void 0}),s.return=async()=>(o(),{done:!0,value:void 0}),s},async dispose(){if(C=!0,h){const[n]=await h;n.close(1e3,"Normal Closure")}},terminate(){h&&d.emit("closed",new Z)}}}class Z extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function J(e){return $(e)&&"code"in e&&"reason"in e}function se(e){return[1e3,1001,1006,1005,1012,1013,1014].includes(e)?!1:e>=1e3&&e<=1999}function ae(e){return typeof e=="function"&&"constructor"in e&&"CLOSED"in e&&"CLOSING"in e&&"CONNECTING"in e&&"OPEN"in e}export{g as CloseCode,ne as GRAPHQL_TRANSPORT_WS_PROTOCOL,c as MessageType,Z as TerminatedCloseEvent,pe as createClient,oe as parseMessage,W as stringifyMessage,v as validateMessage};
1
+ import{eF as D}from"./index-Dzuc8iT3.js";function f(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function $(e){return f(e)==="object"}function re(e){return Array.isArray(e)&&e.length>0&&e.every(m=>"message"in m)}function Y(e,m){return e.length<124?e:m}const ne="graphql-transport-ws";var g;(function(e){e[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(g||(g={}));var c;(function(e){e.ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete"})(c||(c={}));function v(e){if(!$(e))throw new Error(`Message is expected to be an object, but got ${f(e)}`);if(!e.type)throw new Error("Message is missing the 'type' property");if(typeof e.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${f(e.type)}`);switch(e.type){case c.ConnectionInit:case c.ConnectionAck:case c.Ping:case c.Pong:{if(e.payload!=null&&!$(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break}case c.Subscribe:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!$(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${f(e.payload)}`);if(typeof e.payload.query!="string")throw new Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${f(e.payload.query)}`);if(e.payload.variables!=null&&!$(e.payload.variables))throw new Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${f(e.payload.variables)}`);if(e.payload.operationName!=null&&f(e.payload.operationName)!=="string")throw new Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${f(e.payload.operationName)}`);if(e.payload.extensions!=null&&!$(e.payload.extensions))throw new Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${f(e.payload.extensions)}`);break}case c.Next:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!$(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${f(e.payload)}`);break}case c.Error:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!re(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break}case c.Complete:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${e.type}"`)}return e}function oe(e,m){return v(typeof e=="string"?JSON.parse(e,m):e)}function W(e,m){return v(e),JSON.stringify(e,m)}var A=function(e){return this instanceof A?(this.v=e,this):new A(e)},ie=function(e,m,R){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var M=R.apply(e,m||[]),b,w=[];return b={},E("next"),E("throw"),E("return"),b[Symbol.asyncIterator]=function(){return this},b;function E(u){M[u]&&(b[u]=function(r){return new Promise(function(S,L){w.push([u,r,S,L])>1||I(u,r)})})}function I(u,r){try{q(M[u](r))}catch(S){F(w[0][3],S)}}function q(u){u.value instanceof A?Promise.resolve(u.value.v).then(z,G):F(w[0][2],u)}function z(u){I("next",u)}function G(u){I("throw",u)}function F(u,r){u(r),w.shift(),w.length&&I(w[0][0],w[0][1])}};function pe(e){const{url:m,connectionParams:R,lazy:M=!0,onNonLazyError:b=console.error,lazyCloseTimeout:w=0,keepAlive:E=0,disablePong:I,connectionAckWaitTimeout:q=0,retryAttempts:z=5,retryWait:G=async function(a){let t=1e3;for(let o=0;o<a;o++)t*=2;await new Promise(o=>setTimeout(o,t+Math.floor(Math.random()*2700+300)))},shouldRetry:F=J,isFatalConnectionProblem:u,on:r,webSocketImpl:S,generateID:L=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{const t=Math.random()*16|0;return(a=="x"?t:t&3|8).toString(16)})},jsonMessageReplacer:U,jsonMessageReviver:ee}=e;let T;if(S){if(!ae(S))throw new Error("Invalid WebSocket implementation provided");T=S}else typeof WebSocket<"u"?T=WebSocket:typeof D<"u"?T=D.WebSocket||D.MozWebSocket:typeof window<"u"&&(T=window.WebSocket||window.MozWebSocket);if(!T)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const N=T,d=(()=>{const n=(()=>{const t={};return{on(o,s){return t[o]=s,()=>{delete t[o]}},emit(o){var s;"id"in o&&((s=t[o.id])===null||s===void 0||s.call(t,o))}}})(),a={connecting:r?.connecting?[r.connecting]:[],opened:r?.opened?[r.opened]:[],connected:r?.connected?[r.connected]:[],ping:r?.ping?[r.ping]:[],pong:r?.pong?[r.pong]:[],message:r?.message?[n.emit,r.message]:[n.emit],closed:r?.closed?[r.closed]:[],error:r?.error?[r.error]:[]};return{onMessage:n.on,on(t,o){const s=a[t];return s.push(o),()=>{s.splice(s.indexOf(o),1)}},emit(t,...o){for(const s of[...a[t]])s(...o)}}})();function Q(n){const a=[d.on("error",t=>{a.forEach(o=>o()),n(t)}),d.on("closed",t=>{a.forEach(o=>o()),n(t)})]}let h,k=0,H,O=!1,j=0,C=!1;async function K(){clearTimeout(H);const[n,a]=await(h??(h=new Promise((s,y)=>(async()=>{if(O){if(await G(j),!k)return h=void 0,y({code:1e3,reason:"All Subscriptions Gone"});j++}d.emit("connecting",O);const i=new N(typeof m=="function"?await m():m,ne);let x,_;function B(){isFinite(E)&&E>0&&(clearTimeout(_),_=setTimeout(()=>{i.readyState===N.OPEN&&(i.send(W({type:c.Ping})),d.emit("ping",!1,void 0))},E))}Q(l=>{h=void 0,clearTimeout(x),clearTimeout(_),y(l),l instanceof Z&&(i.close(4499,"Terminated"),i.onerror=null,i.onclose=null)}),i.onerror=l=>d.emit("error",l),i.onclose=l=>d.emit("closed",l),i.onopen=async()=>{try{d.emit("opened",i);const l=typeof R=="function"?await R():R;if(i.readyState!==N.OPEN)return;i.send(W(l?{type:c.ConnectionInit,payload:l}:{type:c.ConnectionInit},U)),isFinite(q)&&q>0&&(x=setTimeout(()=>{i.close(g.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},q)),B()}catch(l){d.emit("error",l),i.close(g.InternalClientError,Y(l instanceof Error?l.message:new Error(l).message,"Internal client error"))}};let P=!1;i.onmessage=({data:l})=>{try{const p=oe(l,ee);if(d.emit("message",p),p.type==="ping"||p.type==="pong"){d.emit(p.type,!0,p.payload),p.type==="pong"?B():I||(i.send(W(p.payload?{type:c.Pong,payload:p.payload}:{type:c.Pong})),d.emit("pong",!1,p.payload));return}if(P)return;if(p.type!==c.ConnectionAck)throw new Error(`First message cannot be of type ${p.type}`);clearTimeout(x),P=!0,d.emit("connected",i,p.payload,O),O=!1,j=0,s([i,new Promise((ce,te)=>Q(te))])}catch(p){i.onmessage=null,d.emit("error",p),i.close(g.BadResponse,Y(p instanceof Error?p.message:new Error(p).message,"Bad response"))}}})())));n.readyState===N.CLOSING&&await a;let t=()=>{};const o=new Promise(s=>t=s);return[n,t,Promise.race([o.then(()=>{if(!k){const s=()=>n.close(1e3,"Normal Closure");isFinite(w)&&w>0?H=setTimeout(()=>{n.readyState===N.OPEN&&s()},w):s()}}),a])]}function V(n){if(J(n)&&(se(n.code)||[g.InternalServerError,g.InternalClientError,g.BadRequest,g.BadResponse,g.Unauthorized,g.SubprotocolNotAcceptable,g.SubscriberAlreadyExists,g.TooManyInitialisationRequests].includes(n.code)))throw n;if(C)return!1;if(J(n)&&n.code===1e3)return k>0;if(!z||j>=z||!F(n)||u?.(n))throw n;return O=!0}M||(async()=>{for(k++;;)try{const[,,n]=await K();await n}catch(n){try{if(!V(n))return}catch(a){return b?.(a)}}})();function X(n,a){const t=L(n);let o=!1,s=!1,y=()=>{k--,o=!0};return(async()=>{for(k++;;)try{const[i,x,_]=await K();if(o)return x();const B=d.onMessage(t,P=>{switch(P.type){case c.Next:{a.next(P.payload);return}case c.Error:{s=!0,o=!0,a.error(P.payload),y();return}case c.Complete:{o=!0,y();return}}});i.send(W({id:t,type:c.Subscribe,payload:n},U)),y=()=>{!o&&i.readyState===N.OPEN&&i.send(W({id:t,type:c.Complete},U)),k--,o=!0,x()},await _.finally(B);return}catch(i){if(!V(i))return}})().then(()=>{s||a.complete()}).catch(i=>{a.error(i)}),()=>{o||y()}}return{on:d.on,subscribe:X,iterate(n){const a=[],t={done:!1,error:null,resolve:()=>{}},o=X(n,{next(y){a.push(y),t.resolve()},error(y){t.done=!0,t.error=y,t.resolve()},complete(){t.done=!0,t.resolve()}}),s=function(){return ie(this,arguments,function*(){for(;;){for(a.length||(yield A(new Promise(x=>t.resolve=x)));a.length;)yield yield A(a.shift());if(t.error)throw t.error;if(t.done)return yield A(void 0)}})}();return s.throw=async y=>(t.done||(t.done=!0,t.error=y,t.resolve()),{done:!0,value:void 0}),s.return=async()=>(o(),{done:!0,value:void 0}),s},async dispose(){if(C=!0,h){const[n]=await h;n.close(1e3,"Normal Closure")}},terminate(){h&&d.emit("closed",new Z)}}}class Z extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function J(e){return $(e)&&"code"in e&&"reason"in e}function se(e){return[1e3,1001,1006,1005,1012,1013,1014].includes(e)?!1:e>=1e3&&e<=1999}function ae(e){return typeof e=="function"&&"constructor"in e&&"CLOSED"in e&&"CLOSING"in e&&"CONNECTING"in e&&"OPEN"in e}export{g as CloseCode,ne as GRAPHQL_TRANSPORT_WS_PROTOCOL,c as MessageType,Z as TerminatedCloseEvent,pe as createClient,oe as parseMessage,W as stringifyMessage,v as validateMessage};
@@ -1,4 +1,4 @@
1
- import{cF as $m,bd as jL,g_ as oT,ba as Xm,bb as Zm,cS as qm,be as JL,r as QL}from"./index-DbK31dFt.js";/*! *****************************************************************************
1
+ import{cF as $m,bd as jL,g_ as oT,ba as Xm,bb as Zm,cS as qm,be as JL,r as QL}from"./index-Dzuc8iT3.js";/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -1,4 +1,4 @@
1
- import{aH as L,bn as I,bo as Ke,V as S,j as e,N as B,r as h,O as X,P as G,S as Q,Q as J,K as p,bp as ce,o as x,n as Re,v as U,C as Se,ac as le,aV as Y,t as H,p as De,y as _,$ as de,aU as Ie,R as $e,s as P,at as Be,H as Pe,m as Ne,bq as W,W as Ee,br as pe,bs as me,bt as ue,bu as _e,i as ze,T as $,bv as Le,ay as ie,a3 as ae,aR as re,bk as We,bw as Me,U as qe,X as Ue,A as He,u as Fe,bm as Oe,d as Ve,bx as Xe}from"./index-DbK31dFt.js";import{u as Ge,T as Qe}from"./html-title-C0ZWlysm.js";import Je from"./audit-logs-kv4f2FwD.js";import{T as xe,M as Ye}from"./index-D9scRZrq.js";import{r as he,P as Ze}from"./index-C6l5hpTj.js";import{u as z,T as et}from"./team-CWK-YI0_.js";import{g as tt,H as st}from"./index-fK2TFREh.js";import{D as nt}from"./url-evaluation-CqBTA_SW.js";import{E as ot}from"./Edit-DAdo7ch2.js";import{y as it}from"./index-DJypfjpv.js";import{A as at}from"./Add-C7LRvIC3.js";import{l as F}from"./index-1KXTwIqr.js";import{C as O}from"./click-to-copy-Deba7opf.js";import{f as rt}from"./index-BojVbZw0.js";import{D as ct}from"./delete-confirm-COg-Kyx9.js";import{P as lt}from"./permission-C9Y2XRsP.js";import{u as dt}from"./blocklet-DwHEwBiZ.js";import{u as Z}from"./use-mobile-C3U3R5Q3.js";import{A as pt}from"./actions-lsvecBT1.js";import{u as mt}from"./useAsyncRetry-XGg3A4Qt.js";import"./TableSearch-D9jLZhkp.js";import"./Search-BuS9kxDD.js";import"./Clear-Cw2o-hjt.js";import"./useLocalStorage-BMre6evC.js";import"./index-CXWQi8L0.js";import"./decode-DPztD6kB.js";import"./UnfoldMore-CuZG_lwm.js";import"./shorten-label-SgarF_Ma.js";import"./ViewList-BncCYLkI.js";import"./index-CiPRigy-.js";import"./ButtonGroup-CK4D_Ln2.js";import"./getValidReactChildren-BAFkQ3fw.js";import"./index.esm-DfrzxWuO.js";import"./Google-ItITGWAJ.js";import"./cloneDeep-DtvXQkbq.js";import"./Autocomplete-CdGK2sfo.js";import"./ListSubheader-BicxfAd1.js";import"./AdapterDayjs-DenpZUIq.js";import"./useThemeProps-DhBxLZiP.js";import"./CSSTransition-Dwgb1QPW.js";import"./visuallyHidden-Dan1xhjv.js";import"./index-CE07KwkJ.js";import"./Verified-DeUAmldO.js";import"./DeleteOutline-C2P0A6Ux.js";import"./ErrorOutline-VCscB3DM.js";import"./index-DuXssMw-.js";import"./emotion-cache.browser.esm-D_e1cJtm.js";import"./sdk-BXxj54Wv.js";import"./index-xeh44vu3.js";import"./ua-parser-DP5omx3I.js";import"./edit.svg-BR_aQB1u.js";import"./list-header-Cl8gLzfo.js";import"./chain-C7UmgQl6.js";import"./ToggleButtonGroup-zhxAcoRO.js";import"./lock.svg-B_LWkLVc.js";import"./FilterList-sINld31b.js";import"./index-BX8O0ZHV.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-C_BH-hM0.js";import"./MoreVert-CI4HEjN0.js";import"./useAsync-CQocXlD2.js";function ee({value:s}){const{t,locale:n}=S(),i=new Date;return new Date(s)<i?e.jsxs("span",{style:{color:"red"},children:[e.jsx(B,{value:s,locale:n}),`${t("setting.accessKey.expired",{time:""})}`]}):e.jsx(B,{mode:"daysLeft",value:s,locale:n,type:"all"})}ee.propTypes={value:x.string.isRequired};function te({value:s,onChange:t,...n}){const{t:i}=S(),a=h.useMemo(()=>[{value:"signature",title:i("setting.accessKey.signature"),description:i("setting.accessKey.signatureDesc")},{value:"simple",title:i("setting.accessKey.simple"),description:i("setting.accessKey.simpleDesc")}],[i]);return e.jsxs(X,{style:{width:"100%"},variant:"outlined",...n,children:[e.jsx(G,{children:i("setting.accessKey.authType")}),e.jsx(Q,{value:s,onChange:t,fullWidth:!0,label:i("setting.accessKey.authType"),IconComponent:r=>e.jsx(ce,{...r,width:20,height:20}),children:a.map(r=>e.jsx(J,{value:r.value,children:e.jsxs(p,{children:[e.jsx("span",{children:r.title}),e.jsx(p,{sx:{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal"},children:r.description})]})},r.value))})]})}te.propTypes={value:x.string.isRequired,onChange:x.func.isRequired};const se=()=>{const s=L.RBAC_CONFIG.roles.filter(a=>a.passport),{inService:t}=I(),{roles:n}=z(),i=[...s,...t?n:[]];return Ke(i,"name").filter(a=>a.name!==L.ROLES.OWNER)};function fe(){const{session:s}=Re(),t=se();return h.useMemo(()=>{if(!s?.user?.role)return[];if(["owner","admin"].includes(s.user.role))return t;const i=t.filter(r=>r.name==="guest");return[...t.filter(r=>r.name!=="guest").filter(r=>s.user.passports.find(f=>f.role===r.name)),...i]},[t,s?.user?.passports,s?.user?.role])}function ge({onCreate:s=()=>{},remark:t=""}){const{api:n}=I(),{teamDid:i}=z(),{t:a}=S(),[r,f]=h.useState(!1),[m,b]=h.useState(null),u=fe(),T=()=>{f(!1),b(null)},v=async l=>{const{remark:k,passport:g,authType:o}=l;f(!0);const j=await n.createAccessKey({input:{teamDid:i,remark:k.trim(),passport:g,expireAt:l.expireAt?new Date(l.expireAt).getTime():null,authType:o}}),{data:A}=j;s(A),b(null),f(!1)},c={title:`${a("common.create")} ${a("accessKey")}`,description:(l,k,g)=>e.jsxs(Y,{sx:{gap:3},children:[e.jsx(H,{label:a("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,margin:"dense",value:l.remark,onChange:o=>{k({...l,remark:o.target.value,__disableConfirm:!l.passport||!o.target.value.trim()}),o.target.value.trim()?g(""):g(a("setting.accessKey.remarkInvalid"))},slotProps:{htmlInput:{"data-cy":"remark-input"}}}),e.jsxs(X,{style:{width:"100%"},variant:"outlined",children:[e.jsx(G,{sx:{width:"calc(100% - 46px)"},children:a("setting.accessKey.passport")}),e.jsx(Q,{"data-cy":"create-access-key-select-passport",value:l.passport,onChange:o=>{const j=o.target.value;g(null),k({...l,passport:j,__disableConfirm:!l.remark||!j})},fullWidth:!0,label:a("setting.accessKey.passport"),disabled:r,IconComponent:o=>e.jsx(ce,{...o,width:20,height:20}),children:u.map(o=>e.jsx(J,{value:o.name,"data-cy":`create-access-key-passport-option-${o.name}`,children:e.jsxs(p,{children:[e.jsx("span",{children:o.title||o.name}),e.jsx(p,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:o.description})]})},o.name))})]}),e.jsx(te,{value:l.authType,onChange:o=>{k({...l,authType:o.target.value})}}),e.jsx(xe,{placeholder:a("setting.accessKey.expireTime"),value:l.expireAt,onChange:o=>{k({...l,expireAt:o,__disableConfirm:!l.passport||!l.remark||!o})}})]}),confirm:a("common.confirm"),cancel:a("common.cancel"),color:"primary",params:{remark:t,authType:"signature",__disableConfirm:!t.trim()},onConfirm:v,onCancel:T};return e.jsxs(e.Fragment,{children:[e.jsxs(U,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>b(c),className:"rule-action",children:[r?e.jsx(Se,{size:16}):e.jsx(at,{style:{fontSize:16}}),a("common.create")]}),m&&e.jsx(le,{title:m.title,description:m.description,confirm:m.confirm,color:m.color,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}ge.propTypes={remark:x.string,onCreate:x.func};function ye({onConfirm:s=()=>{},accessKeyId:t,accessKeySecret:n,hideSecret:i=!0}){const{t:a}=h.useContext(De),[r,f]=h.useState(!1),[m,b]=h.useState(()=>i),u=I(),T=()=>{b(!m)},v=g=>{f(g.target.checked)},c=_(window.location.origin,u?.info?.routing?.adminPath),l=h.useMemo(()=>i?`const Client = require('@blocklet/server-js');
1
+ import{aH as L,bn as I,bo as Ke,V as S,j as e,N as B,r as h,O as X,P as G,S as Q,Q as J,K as p,bp as ce,o as x,n as Re,v as U,C as Se,ac as le,aV as Y,t as H,p as De,y as _,$ as de,aU as Ie,R as $e,s as P,at as Be,H as Pe,m as Ne,bq as W,W as Ee,br as pe,bs as me,bt as ue,bu as _e,i as ze,T as $,bv as Le,ay as ie,a3 as ae,aR as re,bk as We,bw as Me,U as qe,X as Ue,A as He,u as Fe,bm as Oe,d as Ve,bx as Xe}from"./index-Dzuc8iT3.js";import{u as Ge,T as Qe}from"./html-title-3cSvLxbM.js";import Je from"./audit-logs-CROZ_WeS.js";import{T as xe,M as Ye}from"./index-wAxFAH22.js";import{r as he,P as Ze}from"./index-yJnNzvvC.js";import{u as z,T as et}from"./team-D5YTqCCQ.js";import{g as tt,H as st}from"./index-BGo2ji7B.js";import{D as nt}from"./url-evaluation-CRBdYFML.js";import{E as ot}from"./Edit-BNY88SKu.js";import{y as it}from"./index-CdTvqOME.js";import{A as at}from"./Add-DaNU9Vkn.js";import{l as F}from"./index-kdOFyCzK.js";import{C as O}from"./click-to-copy-DUObPiIX.js";import{f as rt}from"./index-BojVbZw0.js";import{D as ct}from"./delete-confirm-DmwS-waR.js";import{P as lt}from"./permission-DCAf_gW3.js";import{u as dt}from"./blocklet-DAH77r3I.js";import{u as Z}from"./use-mobile-ENQw9KmE.js";import{A as pt}from"./actions-BeMJBeZS.js";import{u as mt}from"./useAsyncRetry-DQznqjsq.js";import"./TableSearch-U9rZfIzu.js";import"./Search-DYBL-x4y.js";import"./Clear-4n0vKAse.js";import"./useLocalStorage-BfHKsdtC.js";import"./index-DCku-75F.js";import"./decode-DPztD6kB.js";import"./UnfoldMore-CvwQJb-a.js";import"./shorten-label-ByAddcRT.js";import"./ViewList-D4XmJ9U0.js";import"./index-BCXR4Ftk.js";import"./ButtonGroup-BAvFNy2i.js";import"./getValidReactChildren-DmUPqavH.js";import"./index.esm-DfXlzNxJ.js";import"./Google-CwyoAMMB.js";import"./cloneDeep-BqrZti_p.js";import"./Autocomplete-DB_xZW4q.js";import"./ListSubheader-Dtz-xi9-.js";import"./AdapterDayjs-BQhqZd8R.js";import"./useThemeProps-BqRQljgd.js";import"./CSSTransition-YK8aX8nK.js";import"./visuallyHidden-Dan1xhjv.js";import"./index-BTeQyE9h.js";import"./Verified-DRT_g89L.js";import"./DeleteOutline-CoQ7wmqT.js";import"./ErrorOutline-BzGlqq16.js";import"./index-RiT8KfYO.js";import"./emotion-cache.browser.esm-B4PDkYd9.js";import"./sdk-CrF6oAGx.js";import"./index-CnKKagRA.js";import"./ua-parser-DP5omx3I.js";import"./edit.svg-CTCbuAl5.js";import"./list-header-BgLs_nU8.js";import"./chain-Cx_Kwvvk.js";import"./ToggleButtonGroup-DllrYs9I.js";import"./lock.svg-DKwAmrmM.js";import"./FilterList-B1C7unqT.js";import"./index-V6W4s-Vq.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-BKRl_wlt.js";import"./MoreVert-B909vYzl.js";import"./useAsync-ng0xVRWA.js";function ee({value:s}){const{t,locale:n}=S(),i=new Date;return new Date(s)<i?e.jsxs("span",{style:{color:"red"},children:[e.jsx(B,{value:s,locale:n}),`${t("setting.accessKey.expired",{time:""})}`]}):e.jsx(B,{mode:"daysLeft",value:s,locale:n,type:"all"})}ee.propTypes={value:x.string.isRequired};function te({value:s,onChange:t,...n}){const{t:i}=S(),a=h.useMemo(()=>[{value:"signature",title:i("setting.accessKey.signature"),description:i("setting.accessKey.signatureDesc")},{value:"simple",title:i("setting.accessKey.simple"),description:i("setting.accessKey.simpleDesc")}],[i]);return e.jsxs(X,{style:{width:"100%"},variant:"outlined",...n,children:[e.jsx(G,{children:i("setting.accessKey.authType")}),e.jsx(Q,{value:s,onChange:t,fullWidth:!0,label:i("setting.accessKey.authType"),IconComponent:r=>e.jsx(ce,{...r,width:20,height:20}),children:a.map(r=>e.jsx(J,{value:r.value,children:e.jsxs(p,{children:[e.jsx("span",{children:r.title}),e.jsx(p,{sx:{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal"},children:r.description})]})},r.value))})]})}te.propTypes={value:x.string.isRequired,onChange:x.func.isRequired};const se=()=>{const s=L.RBAC_CONFIG.roles.filter(a=>a.passport),{inService:t}=I(),{roles:n}=z(),i=[...s,...t?n:[]];return Ke(i,"name").filter(a=>a.name!==L.ROLES.OWNER)};function fe(){const{session:s}=Re(),t=se();return h.useMemo(()=>{if(!s?.user?.role)return[];if(["owner","admin"].includes(s.user.role))return t;const i=t.filter(r=>r.name==="guest");return[...t.filter(r=>r.name!=="guest").filter(r=>s.user.passports.find(f=>f.role===r.name)),...i]},[t,s?.user?.passports,s?.user?.role])}function ge({onCreate:s=()=>{},remark:t=""}){const{api:n}=I(),{teamDid:i}=z(),{t:a}=S(),[r,f]=h.useState(!1),[m,b]=h.useState(null),u=fe(),T=()=>{f(!1),b(null)},v=async l=>{const{remark:k,passport:g,authType:o}=l;f(!0);const j=await n.createAccessKey({input:{teamDid:i,remark:k.trim(),passport:g,expireAt:l.expireAt?new Date(l.expireAt).getTime():null,authType:o}}),{data:A}=j;s(A),b(null),f(!1)},c={title:`${a("common.create")} ${a("accessKey")}`,description:(l,k,g)=>e.jsxs(Y,{sx:{gap:3},children:[e.jsx(H,{label:a("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,margin:"dense",value:l.remark,onChange:o=>{k({...l,remark:o.target.value,__disableConfirm:!l.passport||!o.target.value.trim()}),o.target.value.trim()?g(""):g(a("setting.accessKey.remarkInvalid"))},slotProps:{htmlInput:{"data-cy":"remark-input"}}}),e.jsxs(X,{style:{width:"100%"},variant:"outlined",children:[e.jsx(G,{sx:{width:"calc(100% - 46px)"},children:a("setting.accessKey.passport")}),e.jsx(Q,{"data-cy":"create-access-key-select-passport",value:l.passport,onChange:o=>{const j=o.target.value;g(null),k({...l,passport:j,__disableConfirm:!l.remark||!j})},fullWidth:!0,label:a("setting.accessKey.passport"),disabled:r,IconComponent:o=>e.jsx(ce,{...o,width:20,height:20}),children:u.map(o=>e.jsx(J,{value:o.name,"data-cy":`create-access-key-passport-option-${o.name}`,children:e.jsxs(p,{children:[e.jsx("span",{children:o.title||o.name}),e.jsx(p,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:o.description})]})},o.name))})]}),e.jsx(te,{value:l.authType,onChange:o=>{k({...l,authType:o.target.value})}}),e.jsx(xe,{placeholder:a("setting.accessKey.expireTime"),value:l.expireAt,onChange:o=>{k({...l,expireAt:o,__disableConfirm:!l.passport||!l.remark||!o})}})]}),confirm:a("common.confirm"),cancel:a("common.cancel"),color:"primary",params:{remark:t,authType:"signature",__disableConfirm:!t.trim()},onConfirm:v,onCancel:T};return e.jsxs(e.Fragment,{children:[e.jsxs(U,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>b(c),className:"rule-action",children:[r?e.jsx(Se,{size:16}):e.jsx(at,{style:{fontSize:16}}),a("common.create")]}),m&&e.jsx(le,{title:m.title,description:m.description,confirm:m.confirm,color:m.color,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}ge.propTypes={remark:x.string,onCreate:x.func};function ye({onConfirm:s=()=>{},accessKeyId:t,accessKeySecret:n,hideSecret:i=!0}){const{t:a}=h.useContext(De),[r,f]=h.useState(!1),[m,b]=h.useState(()=>i),u=I(),T=()=>{b(!m)},v=g=>{f(g.target.checked)},c=_(window.location.origin,u?.info?.routing?.adminPath),l=h.useMemo(()=>i?`const Client = require('@blocklet/server-js');
2
2
  const ensureServerEndpoint = require('@abtnode/util/lib/ensure-server-endpoint');
3
3
  const { joinURL } = require('ufo');
4
4
 
@@ -1,4 +1,4 @@
1
- import{dF as C,r as o,Q as d,j as e,dG as c,b5 as b,dH as I,bv as E,dI as v,dc as u,dJ as z}from"./index-DbK31dFt.js";import{B as A}from"./ButtonGroup-CK4D_Ln2.js";function L({...r}){const{size:p="medium",color:i="primary",menu:a=[],children:s=null,variant:m="contained",onClick:x=C,menuButtonProps:f={},...h}=r,[j,l]=o.useState(!1),n=o.useRef(null),g=Array.isArray(a)?a.map((t,B)=>o.isValidElement(t)?t:o.createElement(d,{...t,key:B})):a,y=()=>{l(t=>!t)},k=t=>{n.current&&n.current.contains(t.target)||l(!1)},M=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(P,{variant:m,size:p,color:i,ref:n,...h,children:[typeof s=="function"?s():e.jsx(c,{onClick:x,color:i,children:s}),e.jsx(c,{onClick:y,color:i,...f,"aria-label":"more functions",children:e.jsx(b,{})})]}),e.jsx(w,{open:j,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(I,{children:e.jsx(E,{onClickAway:k,children:e.jsx(v,{onClick:M,children:g})})})})]})}L.Item=d;const P=u(A)`
1
+ import{dF as C,r as o,Q as d,j as e,dG as c,b5 as b,dH as I,bv as E,dI as v,dc as u,dJ as z}from"./index-Dzuc8iT3.js";import{B as A}from"./ButtonGroup-BAvFNy2i.js";function L({...r}){const{size:p="medium",color:i="primary",menu:a=[],children:s=null,variant:m="contained",onClick:x=C,menuButtonProps:f={},...h}=r,[j,l]=o.useState(!1),n=o.useRef(null),g=Array.isArray(a)?a.map((t,B)=>o.isValidElement(t)?t:o.createElement(d,{...t,key:B})):a,y=()=>{l(t=>!t)},k=t=>{n.current&&n.current.contains(t.target)||l(!1)},M=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(P,{variant:m,size:p,color:i,ref:n,...h,children:[typeof s=="function"?s():e.jsx(c,{onClick:x,color:i,children:s}),e.jsx(c,{onClick:y,color:i,...f,"aria-label":"more functions",children:e.jsx(b,{})})]}),e.jsx(w,{open:j,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(I,{children:e.jsx(E,{onClickAway:k,children:e.jsx(v,{onClick:M,children:g})})})})]})}L.Item=d;const P=u(A)`
2
2
  > .MuiButtonBase-root:last-of-type {
3
3
  min-width: 2em;
4
4
  padding-left: 0;