@abtnode/webapp 1.17.4-beta-20251202-034514-637cd8e2 → 1.17.4-beta-20251202-122551-267b614d
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.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-DFNTS6uL.js → AdapterDayjs-B0zz8Pfq.js} +1 -1
- package/dist/assets/{Add-DMoAJUVW.js → Add-Gtq6YFn-.js} +1 -1
- package/dist/assets/ArrowDropDown-B89A1lOU.js +1 -0
- package/dist/assets/{Autocomplete-DzPelkmw.js → Autocomplete-uu6wfmNa.js} +1 -1
- package/dist/assets/{Breadcrumbs-4tdPlLhJ.js → Breadcrumbs-DgWhDGU0.js} +1 -1
- package/dist/assets/{ButtonGroup-Dlkb94HL.js → ButtonGroup-DvgjBww9.js} +1 -1
- package/dist/assets/CSSTransition-BogJvbBb.js +1 -0
- package/dist/assets/{CallMerge-B41lkD5_.js → CallMerge-CcvlTHub.js} +1 -1
- package/dist/assets/{CardContent-yvDYaO_0.js → CardContent-BCEd9f_A.js} +1 -1
- package/dist/assets/{ChevronLeft-CZ7VDJCP.js → ChevronLeft-DTda7bQ7.js} +1 -1
- package/dist/assets/{ChevronRight-W_01-zFQ.js → ChevronRight-CCJi3DLw.js} +1 -1
- package/dist/assets/{Clear-3aQ_ViuO.js → Clear-CC-EnLra.js} +1 -1
- package/dist/assets/{DeleteOutline-CduYjOSi.js → DeleteOutline-3XQ19e-k.js} +1 -1
- package/dist/assets/{Done-D_cfJoKY.js → Done-BkeI3rmg.js} +1 -1
- package/dist/assets/{Edit-CAoHCh26.js → Edit-D2KNu37J.js} +1 -1
- package/dist/assets/{ErrorOutline-ClBFY-zS.js → ErrorOutline-C8WHHmw8.js} +1 -1
- package/dist/assets/{FilterList-CoyfX8VL.js → FilterList-839Mhlnu.js} +1 -1
- package/dist/assets/{Google-QOJseWnL.js → Google-tMWG0iKI.js} +1 -1
- package/dist/assets/{HelpOutline-DNkRe_xv.js → HelpOutline-D3Ct5vbt.js} +1 -1
- package/dist/assets/{KeyboardArrowDown-DACNodoq.js → KeyboardArrowDown-C1sNFvX1.js} +1 -1
- package/dist/assets/{Launch-BOUgHkwm.js → Launch-aO5Atd5P.js} +1 -1
- package/dist/assets/{Link-BFLUKKmj.js → Link-BlZ3pAye.js} +1 -1
- package/dist/assets/{ListItemButton-BrJjYcfY.js → ListItemButton-CsMar7oS.js} +1 -1
- package/dist/assets/{ListSubheader-Dz5YbKqQ.js → ListSubheader-BwFIAesH.js} +1 -1
- package/dist/assets/{LoadingButton-DSQ0SJvD.js → LoadingButton-DPvkVwrd.js} +1 -1
- package/dist/assets/{MoreVert-Crfla2Nw.js → MoreVert-Dw6pPU62.js} +1 -1
- package/dist/assets/{OpenInNew-CMikwXJg.js → OpenInNew-Bx5eVWrm.js} +1 -1
- package/dist/assets/{Refresh-BRw0lNlx.js → Refresh-DOu5ktr4.js} +1 -1
- package/dist/assets/{Search-DihRAr8J.js → Search-BtTTZvHF.js} +1 -1
- package/dist/assets/{Stepper-DSYfudJh.js → Stepper-T-6xeMn2.js} +1 -1
- package/dist/assets/{Switch-DXK3jQx6.js → Switch-Qm-YCXDC.js} +1 -1
- package/dist/assets/{TableSearch-DTa-kQYq.js → TableSearch-BO1sUXnW.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-BgcjoBhH.js → ToggleButtonGroup-CwA7jHNf.js} +1 -1
- package/dist/assets/{UnfoldMore-Obeukjjc.js → UnfoldMore-D693nhEc.js} +1 -1
- package/dist/assets/{Verified-BkNsmE5y.js → Verified-BO5Sadcs.js} +1 -1
- package/dist/assets/{VerifiedUser-DF0KlG8V.js → VerifiedUser-ZRwd11pN.js} +1 -1
- package/dist/assets/{ViewList-Dsx5HTn1.js → ViewList-DFq1w8Pi.js} +1 -1
- package/dist/assets/{_createAggregator-ysrcf9Bc.js → _createAggregator-ChVlzoXX.js} +1 -1
- package/dist/assets/{actions-BQYoCyzD.js → actions-DMTLO9WN.js} +1 -1
- package/dist/assets/actions-leYRvkUh.js +1 -0
- package/dist/assets/{agreement-3umjEU1n.js → agreement-wW2ejTn5.js} +4 -4
- package/dist/assets/api-qtglKwG0.js +1 -0
- package/dist/assets/{appearance-BYqWOedE.js → appearance-Bu6FCwDl.js} +1 -1
- package/dist/assets/ar-C89Z16Ql.js +7 -0
- package/dist/assets/{audit-logs-C8Rj-VnC.js → audit-logs-uBKGjU8z.js} +1 -1
- package/dist/assets/{base-chart-C7SG2Os5.js → base-chart-CNZD_30a.js} +1 -1
- package/dist/assets/blocklet-DPbcf7C1.js +1 -0
- package/dist/assets/{chain-BLr2de5j.js → chain-B1iM_1N6.js} +1 -1
- package/dist/assets/{click-to-copy-_XuYTLfd.js → click-to-copy-DORdWIxb.js} +1 -1
- package/dist/assets/cloneDeep-CohUqOh0.js +1 -0
- package/dist/assets/{collapse-C4RswaYj.js → collapse-CCua-Mrl.js} +2 -2
- package/dist/assets/{config-navigation-m1HAHHAI.js → config-navigation-CzRNAjzb.js} +3 -3
- package/dist/assets/{connect-to-CQeSm0MO.js → connect-to-CmyBqJpc.js} +3 -3
- package/dist/assets/{cssMode-CMNPagen.js → cssMode-BJLiSeLr.js} +1 -1
- package/dist/assets/de-BsCDrfBl.js +7 -0
- package/dist/assets/{delete-confirm-B3AhdXCf.js → delete-confirm-B88I8Rgr.js} +1 -1
- package/dist/assets/{depsEqual-C1JyiMkY.js → depsEqual-SwRjoCtz.js} +1 -1
- package/dist/assets/{detail-C3pyFMHM.js → detail-C5vUVDqm.js} +3 -3
- package/dist/assets/{domains-DIeIwNFc.js → domains-BcMs6cUU.js} +2 -2
- package/dist/assets/{download-PFug1xLJ.js → download--wJUTk7R.js} +1 -1
- package/dist/assets/{edit.svg-BWsZcaur.js → edit.svg-CpaI3z2u.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-C_FnJ0Bl.js +1 -0
- package/dist/assets/engine-NlvHTBMs.js +1 -0
- package/dist/assets/es-BJh_XsEm.js +9 -0
- package/dist/assets/fr-DRJMwn7V.js +7 -0
- package/dist/assets/{freemarker2-D3LU0XC5.js → freemarker2-C-Nqxxua.js} +1 -1
- package/dist/assets/{get-safe-url-B8fUDSaQ.js → get-safe-url-UCXqZj50.js} +1 -1
- package/dist/assets/getValidReactChildren-Uq5KRZW0.js +1 -0
- package/dist/assets/{graphqlMode-CZh0WEg3.js → graphqlMode-CsiH86ux.js} +2 -2
- package/dist/assets/{handlebars-BoyJQaGG.js → handlebars-DBpJcfyo.js} +1 -1
- package/dist/assets/hi-h-9Yl5g9.js +5 -0
- package/dist/assets/{html-DiNtivy_.js → html-C6NCUnUk.js} +1 -1
- package/dist/assets/{html-title-DZPr9ErN.js → html-title-CmrSukp5.js} +1 -1
- package/dist/assets/{htmlMode-swm5QVbw.js → htmlMode-Cw1gsGQH.js} +1 -1
- package/dist/assets/id-BDWggRsa.js +7 -0
- package/dist/assets/{iframe-DloJgn9Q.js → iframe-B101zvHQ.js} +1 -1
- package/dist/assets/{index-D_Ja8zFw.js → index-2oGVUiSe.js} +1 -1
- package/dist/assets/{index-BNSnUR0A.js → index-6xE8itmu.js} +1 -1
- package/dist/assets/index-B2EvtQrO.js +5 -0
- package/dist/assets/{index-ClciYnBs.js → index-B4S7rBIj.js} +13 -13
- package/dist/assets/{index-BBE5QVnT.js → index-B8MHJVU-.js} +9 -9
- package/dist/assets/{index-Cwj1cT7X.js → index-BDMJMOPf.js} +1 -1
- package/dist/assets/index-BPaM5k8p.js +1 -0
- package/dist/assets/{index-CKHzfPKz.js → index-BXsHuAsW.js} +1 -1
- package/dist/assets/{index-CCqeWXbH.js → index-Bbycp2D5.js} +2 -2
- package/dist/assets/{index-BpTQAo8p.js → index-BeliRBVp.js} +1 -1
- package/dist/assets/{index-BktUsUuI.js → index-Bq8bnhOa.js} +1 -1
- package/dist/assets/{index-B0J8LV_Q.js → index-BrdbRq8W.js} +1 -1
- package/dist/assets/{index-BOgaS_mp.js → index-Bys7HiIg.js} +8 -8
- package/dist/assets/{index-BoLEbVjY.js → index-C0hdABC7.js} +1 -1
- package/dist/assets/{index-aiY7k_D_.js → index-C4cVrWzE.js} +1 -1
- package/dist/assets/{index-2MD_vALi.js → index-CAv7Pg_f.js} +1 -1
- package/dist/assets/{index-oVsaWj9v.js → index-CC6ahmMQ.js} +1 -1
- package/dist/assets/{index-Dosi9lN2.js → index-CDRCwlgY.js} +1 -1
- package/dist/assets/{index-UxFoihcG.js → index-CRG1Ye_e.js} +15 -15
- package/dist/assets/{index-aZK5B1rf.js → index-CVOTPgyE.js} +1 -1
- package/dist/assets/{index-C1n8OjtU.js → index-Ck4Ez83C.js} +1 -1
- package/dist/assets/{index-DzIQue5G.js → index-ClUoKjg9.js} +1 -1
- package/dist/assets/{index-EO1T3ubZ.js → index-Cn6qOw2w.js} +1 -1
- package/dist/assets/{index-DalOLs5N.js → index-CxJckAZ-.js} +1 -1
- package/dist/assets/{index-CIJ5EXA3.js → index-D2thcVr8.js} +1 -1
- package/dist/assets/{index-DW37Hc5m.js → index-DFGxTCyR.js} +1 -1
- package/dist/assets/{index-CI77BW6M.js → index-DL0fhO9l.js} +1 -1
- package/dist/assets/{index-BScjYdDP.js → index-DP399XDr.js} +3 -3
- package/dist/assets/{index-p4uzP6uF.js → index-DPfKGrL9.js} +1 -1
- package/dist/assets/{index-C6qm0jMc.js → index-DYXgsb5s.js} +1 -1
- package/dist/assets/{index-Cm4YjlwL.js → index-D_SIJkZn.js} +2 -2
- package/dist/assets/{index-BiECtx8f.js → index-DbJK6am8.js} +2 -2
- package/dist/assets/{index-DzMTdOui.js → index-DbppMzKl.js} +1 -1
- package/dist/assets/{index-BPL2xXU0.js → index-DdLIuXEV.js} +1 -1
- package/dist/assets/{index-CSzOTG6W.js → index-Do4VGAIZ.js} +9 -9
- package/dist/assets/index-DoAbNeVy.js +1 -0
- package/dist/assets/{index-BsUgU8Em.js → index-DpVOzQCq.js} +3 -3
- package/dist/assets/index-Dw30FoAb.js +328 -0
- package/dist/assets/{index-CqjL56RL.js → index-FBoROe_G.js} +1 -1
- package/dist/assets/{index-DN1FR838.js → index-ZAz6KyaD.js} +8 -8
- package/dist/assets/{index-B_irEVal.js → index-ZN-5ovc2.js} +1 -1
- package/dist/assets/{index-D_vvbtGZ.js → index-c7D-_Zef.js} +1 -1
- package/dist/assets/{index-B-t0c3Sa.js → index-gP7s6dRy.js} +1 -1
- package/dist/assets/index-iAPac6oV.js +16 -0
- package/dist/assets/{index-Dcx5YP4F.js → index-k5nSsUfG.js} +1 -1
- package/dist/assets/{index-DtEm4DlR.js → index-lmaPhzfF.js} +1 -1
- package/dist/assets/{index.esm-0qTLMRcM.js → index.esm-BwwyBWty.js} +1 -1
- package/dist/assets/{install-from-url-D4BZhujU.js → install-from-url-Bf7WPlJN.js} +1 -1
- package/dist/assets/{invitation-7JPfzYsz.js → invitation-BP0hoQf_.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-By5q4Tar.js → is-path-prefix-equal-CFCh1gdU.js} +1 -1
- package/dist/assets/{item-BIq4iEQn.js → item-Ct5y4zZr.js} +7 -7
- package/dist/assets/ja-R9EF3xbB.js +9 -0
- package/dist/assets/{javascript-B_b2FAHq.js → javascript-Dr5b-m5R.js} +1 -1
- package/dist/assets/{jsonMode-De4-g9Kb.js → jsonMode-fPKcefXi.js} +1 -1
- package/dist/assets/ko-C_QLPZyk.js +9 -0
- package/dist/assets/{liquid-gACWVLj5.js → liquid-oGLn5Hpj.js} +1 -1
- package/dist/assets/{list-header-DLDug_Pi.js → list-header-BIGrUqOT.js} +1 -1
- package/dist/assets/{lock.svg-BzS6KpeB.js → lock.svg-CaxCpnGL.js} +1 -1
- package/dist/assets/{log-B-hBZSCU.js → log-BDfTeg8T.js} +1 -1
- package/dist/assets/{lottie-react.esm-CIMHKb6b.js → lottie-react.esm-HaM_MXtV.js} +1 -1
- package/dist/assets/{mdx-QEop8_Eo.js → mdx-Bg7RhVjp.js} +1 -1
- package/dist/assets/{memory-B3cgfihx.js → memory-DXUL9_Ec.js} +1 -1
- package/dist/assets/{metric-Cof1oNBC.js → metric-EnBS4CvH.js} +1 -1
- package/dist/assets/omit-DlutqXDU.js +1 -0
- package/dist/assets/{overview-Bg8w97tG.js → overview-B32TEwfb.js} +1 -1
- package/dist/assets/{permission-BFEhHSn7.js → permission-Bv3920H2.js} +1 -1
- package/dist/assets/{preference-BruWxN0I.js → preference-BC0859XX.js} +7 -7
- package/dist/assets/pt-DpYO8djd.js +5 -0
- package/dist/assets/{python-BjdcRw1L.js → python-DUarVXTM.js} +1 -1
- package/dist/assets/{raf-schd.esm-CzegtaBG.js → raf-schd.esm-P9Vn8RQf.js} +1 -1
- package/dist/assets/{razor-IcRt_b4C.js → razor-dBjnUnrj.js} +1 -1
- package/dist/assets/{rotate-session-key-168u3XBv.js → rotate-session-key-MnVkfmWC.js} +1 -1
- package/dist/assets/ru-DkZtar3s.js +5 -0
- package/dist/assets/{runtime-_J5cuOkf.js → runtime-A3Och2ex.js} +1 -1
- package/dist/assets/schema-BAupCdsg.js +1 -0
- package/dist/assets/sdk-DnnjlzRP.js +1 -0
- package/dist/assets/{service-C07l8A9I.js → service-C8HkZKOs.js} +1 -1
- package/dist/assets/{shorten-label-lyN5fJdD.js → shorten-label-TTeW9jQE.js} +1 -1
- package/dist/assets/{simple-select-DstcGmRv.js → simple-select-1hCZ3ykh.js} +1 -1
- package/dist/assets/{spaces-DJOIEEkJ.js → spaces-CW7LOHEn.js} +1 -1
- package/dist/assets/{status-DQyrCw3T.js → status-BHvKi2o2.js} +1 -1
- package/dist/assets/{status-DjHRNPcT.js → status-CQbu08fM.js} +1 -1
- package/dist/assets/{switch-control-BmkF4vyJ.js → switch-control-DojiXTMP.js} +1 -1
- package/dist/assets/{table-icons-GRr0eBoB.js → table-icons-CpgEN6pZ.js} +18 -18
- package/dist/assets/{team-Dn5co06a.js → team-jjmnzq1j.js} +1 -1
- package/dist/assets/th-04iX5CrT.js +5 -0
- package/dist/assets/{toLower-ysbVZcXo.js → toLower-eS64JG-G.js} +1 -1
- package/dist/assets/toUpper-3t8tzOFw.js +1 -0
- package/dist/assets/{traffic-DlmGH1wr.js → traffic-YWyGUBQU.js} +1 -1
- package/dist/assets/{tsMode-CApNVpTQ.js → tsMode-r2wtJ5M9.js} +1 -1
- package/dist/assets/{typescript-C-UJmhZH.js → typescript-C5dngLzk.js} +1 -1
- package/dist/assets/{url-evaluation-D0KhcJoH.js → url-evaluation-CrYgWs9K.js} +1 -1
- package/dist/assets/{url-join-DF4J2tJs.js → url-join-CRdVlgCs.js} +1 -1
- package/dist/assets/{use-mobile-BRO-uubG.js → use-mobile-CgBFkYHF.js} +1 -1
- package/dist/assets/{use-mobile-BN298Cwf.js → use-mobile-u35CLVJ3.js} +1 -1
- package/dist/assets/{useAsync-ihOYfxyw.js → useAsync-Dcq_7X1o.js} +1 -1
- package/dist/assets/{useAsyncRetry-Bo43j2ED.js → useAsyncRetry-CV01iPe6.js} +1 -1
- package/dist/assets/{useLocalStorage-DdFQ0H8D.js → useLocalStorage-DQ8BZZZ0.js} +1 -1
- package/dist/assets/{useThemeProps-7IPePURq.js → useThemeProps-Bo_3CCZv.js} +1 -1
- package/dist/assets/{util-B8wHWVVx.js → util-BnCGqVWi.js} +1 -1
- package/dist/assets/vi-kOP0E9Ga.js +5 -0
- package/dist/assets/{wait-container-CYtuj1LZ.js → wait-container-u05dNEeS.js} +1 -1
- package/dist/assets/{without-wallet-BBF6F6X8.js → without-wallet-CY933xy-.js} +1 -1
- package/dist/assets/wrap-locale-CedwlL-K.js +1 -0
- package/dist/assets/{xml-CtHgzjfR.js → xml-BESQyF-n.js} +1 -1
- package/dist/assets/{yaml-UcfMMR9d.js → yaml-DvktTwLI.js} +1 -1
- package/dist/assets/{zh-98nxdLeR.js → zh-DZI4Yy2m.js} +3 -3
- package/dist/assets/{zh-tw-BdDE7n5E.js → zh-tw-BLapUUeq.js} +2 -2
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-BS1FI8Dx.js +0 -1
- package/dist/assets/CSSTransition-Cp9IAg_E.js +0 -1
- package/dist/assets/actions-B68pZ6f6.js +0 -1
- package/dist/assets/api-DtECYdKn.js +0 -1
- package/dist/assets/ar-BJZY7v5z.js +0 -7
- package/dist/assets/blocklet-BwZNRhqB.js +0 -1
- package/dist/assets/cloneDeep-9Rjs5zfn.js +0 -1
- package/dist/assets/de-BF0NHTXz.js +0 -7
- package/dist/assets/emotion-cache.browser.esm-DR87qH_k.js +0 -1
- package/dist/assets/engine-XiroAPK-.js +0 -1
- package/dist/assets/es-Dv2m4LXp.js +0 -9
- package/dist/assets/fr-BGhg9oO3.js +0 -7
- package/dist/assets/getValidReactChildren-Dxx0sUSA.js +0 -1
- package/dist/assets/hi-CPfDhW8g.js +0 -5
- package/dist/assets/id-9TUzKF6k.js +0 -7
- package/dist/assets/index-1u2jtyuS.js +0 -1
- package/dist/assets/index-C_lSg5BT.js +0 -5
- package/dist/assets/index-ClIHkf52.js +0 -1
- package/dist/assets/index-DS6pTkmU.js +0 -16
- package/dist/assets/index-PexLSZpT.js +0 -328
- package/dist/assets/ja-DT5bRsBF.js +0 -9
- package/dist/assets/ko-CJn9PyPz.js +0 -9
- package/dist/assets/omit-B3Qfr75J.js +0 -1
- package/dist/assets/pt-K9FK6Ube.js +0 -5
- package/dist/assets/ru-C_RwukUu.js +0 -5
- package/dist/assets/schema-C7mAV9wx.js +0 -1
- package/dist/assets/sdk-Dn9cGqw6.js +0 -1
- package/dist/assets/th-Bhii_FfA.js +0 -5
- package/dist/assets/toUpper-B_tZoZUo.js +0 -1
- package/dist/assets/vi-DVF2tjOG.js +0 -5
- package/dist/assets/wrap-locale-C5FvK0v2.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aF as le,j as e,hw as ce,bd as ue,bn as Z,V as G,gk as ee,f9 as te,aP as re,cw as u,H as S,hx as D,K as R,t as x,hy as V,aU as H,O as p,ay as de,v as N,s as ie,aV as ne,z as me,y as fe,aH as he,r as M,p as xe,bD as pe}from"./index-DN1FR838.js";import{T as ve}from"./html-title-DZPr9ErN.js";import{u as se,C as m}from"./index.esm-0qTLMRcM.js";import{S as h,A as je,a as be,b as ge,c as ye}from"./collapse-C4RswaYj.js";import{u as ae}from"./blocklet-BwZNRhqB.js";import{S as $}from"./Switch-DXK3jQx6.js";const Re=le(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 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}));var K={exports:{}},O={exports:{}},z={exports:{}},J;function ke(){return J||(J=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=t;function t(d){return d==null}c.exports=s.default,c.exports.default=s.default}(z,z.exports)),z.exports}var Q;function we(){return Q||(Q=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=E;var t=b(ce()),d=b(ke());function b(n){return n&&n.__esModule?n:{default:n}}var f=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,P=/^[-+]?[0-9]+$/;function E(n,i){(0,t.default)(n),i=i||{};var _=i.allow_leading_zeroes===!1?f:P,q=!i.hasOwnProperty("min")||(0,d.default)(i.min)||n>=i.min,l=!i.hasOwnProperty("max")||(0,d.default)(i.max)||n<=i.max,a=!i.hasOwnProperty("lt")||(0,d.default)(i.lt)||n<i.lt,C=!i.hasOwnProperty("gt")||(0,d.default)(i.gt)||n>i.gt;return _.test(n)&&q&&l&&a&&C}c.exports=s.default,c.exports.default=s.default}(O,O.exports)),O.exports}var X;function Te(){return X||(X=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=b;var t=d(we());function d(f){return f&&f.__esModule?f:{default:f}}function b(f){return(0,t.default)(f,{allow_leading_zeroes:!1,min:0,max:65535})}c.exports=s.default,c.exports.default=s.default}(K,K.exports)),K.exports}var Se=Te();const Ee=ue(Se),U={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Ce(){const{api:c}=Z(),{blocklet:s}=ae(),{t}=G(),{confirmApi:d,confirmHolder:b}=ee(),f=s?.meta?.did,P=Object.assign({...U},s?.settings?.notification?.email||{}),{handleSubmit:E,control:n,formState:i,watch:_,reset:q}=se({defaultValues:te(P,Object.keys(U))}),l=re({testReceiver:"",testReceiverError:""}),a=_("enabled"),C=u(async(r,g,T=!0)=>{try{const{blocklet:y}=await c.configNotification({input:{did:f,notification:JSON.stringify({email:r})}}),oe=Object.assign({...U},y?.settings?.notification?.email||{});q(oe),T&&S.success(t("oauth.saveSuccess"))}catch(y){if(T)S.error(y.message||t("oauth.saveFailed"));else throw y}}),W=u(async(r,g,T)=>{try{i.isDirty&&await C(r,g,!1),await c.sendEmail({input:{did:f,receiver:T,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification",attachments:[{type:"link",data:{url:"https://community.arcblock.io",title:"Community",image:"https://community.arcblock.io/.well-known/service/blocklet/logo-rect-dark",utm:{campaign:"test-campaign"}}}],utm:{content:"test-email-button"}})}}),S.success(t("notification.email.testSuccess"))}catch(y){S.error(y.message||t("notification.email.testfailed"))}}),A=u((r,g)=>{l.testReceiver=localStorage.getItem("test-receiver")||"",l.testReceiverError="",d.open({title:t("notification.email.testSendEmail"),content:()=>e.jsx(R,{sx:{width:"300px"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.email.inputTestReceiver"),value:l.testReceiver,onChange:T=>{l.testReceiver=T.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(T){const y=l.testReceiver?.trim();if(!y){l.testReceiverError=t("notification.email.receiverRequired");return}if(!D(y)){l.testReceiverError=t("notification.email.receiverInvalid");return}l.testReceiverError="",await W(r,g,y),T()}})}),F=u(r=>{const g=r?.trim();return g?D(g)?!0:t("notification.email.fromInvalid"):t("notification.email.fromRequired")}),L=u(r=>{const g=r?.trim();return g?V(g,{require_host:!1,protocols:[]})?!0:t("notification.email.hostInvalid"):t("notification.email.hostRequired")}),o=u(r=>r?Ee(r)?!0:t("notification.email.portInvalid"):t("notification.email.portRequired")),k=u(r=>r?.trim()?!0:t("notification.email.userRequired")),v=u(r=>r?.trim()?!0:t("notification.email.passwordRequired")),w=u(r=>r?.trim()&&!V(r,{protocols:["http","https"],require_protocol:!0})?t("notification.email.linkInvalid"):!0),I=u(r=>r?.trim()&&!D(r)?t("notification.email.emailInvalid"):!0),j=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(Pe,{component:"form",onSubmit:E(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.email.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:r})=>e.jsx(H,{control:e.jsx($,{checked:r.value,...r})})})}),e.jsx(h,{title:t("notification.email.from"),children:e.jsx(m,{name:"from",control:n,rules:{validate:a?F:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,label:t("notification.email.from"),error:!!i.errors[r.name],helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.host"),children:e.jsx(m,{name:"host",control:n,rules:{validate:a?L:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.host"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.port"),children:e.jsx(m,{name:"port",control:n,rules:{validate:a?o:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"number",error:!!i.errors[r.name],label:t("notification.email.port"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.user"),children:e.jsx(m,{name:"user",control:n,rules:{validate:a?k:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.user"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.password"),children:e.jsx(m,{name:"password",control:n,rules:{validate:a?v:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"password",error:!!i.errors[r.name],label:t("notification.email.password"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.secure"),children:e.jsx(m,{name:"secure",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(H,{control:e.jsx($,{checked:r.value,...r,disabled:!a})})})})}),e.jsxs(je,{children:[e.jsxs(be,{expandIcon:e.jsx(ge,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[t("notification.email.signature"),e.jsx(de,{title:t("notification.email.signatureTooltip"),children:e.jsx(Re,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(ye,{children:[e.jsx(h,{title:t("notification.email.companyName"),children:e.jsx(m,{name:"companyName",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyName"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.companyLink"),children:e.jsx(m,{name:"companyLink",control:n,rules:{validate:a?w:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyLink"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.companyAddress"),children:e.jsx(m,{name:"companyAddress",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyAddress"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.supportEmail"),children:e.jsx(m,{name:"supportEmail",control:n,rules:{validate:a?I:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",type:"email",error:!!i.errors[r.name],label:t("notification.email.supportEmail"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})})]})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(N,{variant:"outlined",color:"warning",onClick:E(A),disabled:!a,children:t("oauth.runTest")}),e.jsx(N,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const Pe=ie(ne)``,B={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function _e(){const{api:c}=Z(),{blocklet:s}=ae(),{t}=G(),{confirmApi:d,confirmHolder:b}=ee(),f=s?.meta?.did,P=Object.assign({...B},s?.settings?.notification?.pushKit||{}),{handleSubmit:E,control:n,formState:i,watch:_,reset:q}=se({defaultValues:te(P,Object.keys(B))}),l=re({testReceiver:"",testReceiverError:""}),a=_("enabled"),C=u(async(o,k,v=!0)=>{try{const{blocklet:w}=await c.configNotification({input:{did:f,notification:JSON.stringify({pushKit:o})}}),I=Object.assign({...B},w?.settings?.notification?.pushKit||{});q(I),v&&S.success(t("oauth.saveSuccess"))}catch(w){if(v)S.error(w.message||t("oauth.saveFailed"));else throw w}}),W=u(async(o,k)=>{try{i.isDirty&&await C(o,k,!1);const v=(s?.configs||[]).find(j=>j.key==="BLOCKLET_APP_URL")?.value,w=me(fe(v,he.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:s?.meta?.version,t:new Date(s?.updatedAt||0).getTime()}),I={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:s?.appDid,fullName:s?.meta?.title,avatar:w}}}};await c.sendPush({input:{did:f,receiver:l.testReceiver,notification:JSON.stringify(I)}}),S.success(t("notification.pushKit.testSuccess"))}catch(v){S.error(v.message||t("notification.pushKit.testfailed"))}}),A=u((o,k)=>{l.testReceiverError="",d.open({title:t("notification.pushKit.testSend"),content:()=>e.jsx(R,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.pushKit.inputTestReceiver"),value:l.testReceiver,onChange:v=>{l.testReceiver=v.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(v){if(!l.testReceiver?.trim()){l.testReceiverError=t("notification.pushKit.receiverRequired");return}l.testReceiverError="",await W(o,k),v()}})}),F=u(o=>{const k=o?.trim();return k?V(k)?!0:t("notification.pushKit.endpointInvalid"):t("notification.pushKit.endpointRequired")}),L=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(qe,{component:"form",onSubmit:E(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.pushKit.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:o})=>e.jsx(H,{control:e.jsx($,{checked:o.value,...o})})})}),e.jsx(h,{title:t("notification.pushKit.endpoint"),children:e.jsx(m,{name:"endpoint",control:n,rules:{validate:a?F:L},render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",required:!0,label:t("notification.pushKit.endpoint"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})})}),e.jsxs(h,{title:t("notification.pushKit.customOptions"),children:[e.jsx(m,{name:"did",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.did"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})}),e.jsx(m,{name:"pushPath",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.pushPath"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(N,{variant:"outlined",color:"warning",onClick:E(A),disabled:!a,children:t("oauth.runTest")}),e.jsx(N,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const qe=ie(ne)``,Y=[{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Email"}),value:"email"},{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Push Kit"}),value:"pushKit"}];function Ae(){const[c,s]=M.useState(Y[0].value),{locale:t}=M.useContext(xe),d=pe(()=>({email:e.jsx(Ce,{}),pushKit:e.jsx(_e,{})}),[t]),b=M.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(R,{children:[e.jsx(ve,{tabs:Y,current:c,onChange:s}),e.jsx(R,{style:b,children:d[c]})]})}export{Ae as B};
|
|
1
|
+
import{aF as le,j as e,hw as ce,be as ue,bo as Z,V as G,gk as ee,f9 as te,aP as re,aT as u,H as E,hx as M,K as R,t as x,hy as V,aV as H,O as p,ay as de,v as W,s as ie,aW as ne,z as me,y as fe,aH as he,r as B,p as xe,bE as pe}from"./index-ZAz6KyaD.js";import{T as ve}from"./html-title-CmrSukp5.js";import{u as ae,C as m}from"./index.esm-BwwyBWty.js";import{S as h,A as je,a as be,b as ge,c as ye}from"./collapse-CCua-Mrl.js";import{u as se}from"./blocklet-DPbcf7C1.js";import{S as $}from"./Switch-Qm-YCXDC.js";const Re=le(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 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}));var K={exports:{}},O={exports:{}},z={exports:{}},J;function ke(){return J||(J=1,function(c,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=t;function t(d){return d==null}c.exports=a.default,c.exports.default=a.default}(z,z.exports)),z.exports}var Q;function we(){return Q||(Q=1,function(c,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=S;var t=b(ce()),d=b(ke());function b(n){return n&&n.__esModule?n:{default:n}}var f=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,P=/^[-+]?[0-9]+$/;function S(n,i){(0,t.default)(n),i=i||{};var _=i.allow_leading_zeroes===!1?f:P,q=!i.hasOwnProperty("min")||(0,d.default)(i.min)||n>=i.min,l=!i.hasOwnProperty("max")||(0,d.default)(i.max)||n<=i.max,s=!i.hasOwnProperty("lt")||(0,d.default)(i.lt)||n<i.lt,C=!i.hasOwnProperty("gt")||(0,d.default)(i.gt)||n>i.gt;return _.test(n)&&q&&l&&s&&C}c.exports=a.default,c.exports.default=a.default}(O,O.exports)),O.exports}var X;function Te(){return X||(X=1,function(c,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=b;var t=d(we());function d(f){return f&&f.__esModule?f:{default:f}}function b(f){return(0,t.default)(f,{allow_leading_zeroes:!1,min:0,max:65535})}c.exports=a.default,c.exports.default=a.default}(K,K.exports)),K.exports}var Ee=Te();const Se=ue(Ee),D={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Ce(){const{api:c}=Z(),{blocklet:a}=se(),{t}=G(),{confirmApi:d,confirmHolder:b}=ee(),f=a?.meta?.did,P=Object.assign({...D},a?.settings?.notification?.email||{}),{handleSubmit:S,control:n,formState:i,watch:_,reset:q}=ae({defaultValues:te(P,Object.keys(D))}),l=re({testReceiver:"",testReceiverError:""}),s=_("enabled"),C=u(async(r,g,T=!0)=>{try{const{blocklet:y}=await c.configNotification({input:{did:f,notification:JSON.stringify({email:r})}}),oe=Object.assign({...D},y?.settings?.notification?.email||{});q(oe),T&&E.success(t("oauth.saveSuccess"))}catch(y){if(T)E.error(y.message||t("oauth.saveFailed"));else throw y}}),N=u(async(r,g,T)=>{try{i.isDirty&&await C(r,g,!1),await c.sendEmail({input:{did:f,receiver:T,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification",attachments:[{type:"link",data:{url:"https://community.arcblock.io",title:"Community",image:"https://community.arcblock.io/.well-known/service/blocklet/logo-rect-dark",utm:{campaign:"test-campaign"}}}],utm:{content:"test-email-button"}})}}),E.success(t("notification.email.testSuccess"))}catch(y){E.error(y.message||t("notification.email.testfailed"))}}),A=u((r,g)=>{l.testReceiver=localStorage.getItem("test-receiver")||"",l.testReceiverError="",d.open({title:t("notification.email.testSendEmail"),content:()=>e.jsx(R,{sx:{width:"300px"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.email.inputTestReceiver"),value:l.testReceiver,onChange:T=>{l.testReceiver=T.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(T){const y=l.testReceiver?.trim();if(!y){l.testReceiverError=t("notification.email.receiverRequired");return}if(!M(y)){l.testReceiverError=t("notification.email.receiverInvalid");return}l.testReceiverError="",await N(r,g,y),T()}})}),F=u(r=>{const g=r?.trim();return g?M(g)?!0:t("notification.email.fromInvalid"):t("notification.email.fromRequired")}),L=u(r=>{const g=r?.trim();return g?V(g,{require_host:!1,protocols:[]})?!0:t("notification.email.hostInvalid"):t("notification.email.hostRequired")}),o=u(r=>r?Se(r)?!0:t("notification.email.portInvalid"):t("notification.email.portRequired")),k=u(r=>r?.trim()?!0:t("notification.email.userRequired")),v=u(r=>r?.trim()?!0:t("notification.email.passwordRequired")),w=u(r=>r?.trim()&&!V(r,{protocols:["http","https"],require_protocol:!0})?t("notification.email.linkInvalid"):!0),I=u(r=>r?.trim()&&!M(r)?t("notification.email.emailInvalid"):!0),j=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(Pe,{component:"form",onSubmit:S(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.email.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:r})=>e.jsx(H,{control:e.jsx($,{checked:r.value,...r})})})}),e.jsx(h,{title:t("notification.email.from"),children:e.jsx(m,{name:"from",control:n,rules:{validate:s?F:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,label:t("notification.email.from"),error:!!i.errors[r.name],helperText:i.errors[r.name]?.message||" ",disabled:!s})})})}),e.jsx(h,{title:t("notification.email.host"),children:e.jsx(m,{name:"host",control:n,rules:{validate:s?L:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.host"),helperText:i.errors[r.name]?.message||" ",disabled:!s})})})}),e.jsx(h,{title:t("notification.email.port"),children:e.jsx(m,{name:"port",control:n,rules:{validate:s?o:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"number",error:!!i.errors[r.name],label:t("notification.email.port"),helperText:i.errors[r.name]?.message||" ",disabled:!s})})})}),e.jsx(h,{title:t("notification.email.user"),children:e.jsx(m,{name:"user",control:n,rules:{validate:s?k:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.user"),helperText:i.errors[r.name]?.message||" ",disabled:!s})})})}),e.jsx(h,{title:t("notification.email.password"),children:e.jsx(m,{name:"password",control:n,rules:{validate:s?v:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"password",error:!!i.errors[r.name],label:t("notification.email.password"),helperText:i.errors[r.name]?.message||" ",disabled:!s})})})}),e.jsx(h,{title:t("notification.email.secure"),children:e.jsx(m,{name:"secure",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(H,{control:e.jsx($,{checked:r.value,...r,disabled:!s})})})})}),e.jsxs(je,{children:[e.jsxs(be,{expandIcon:e.jsx(ge,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[t("notification.email.signature"),e.jsx(de,{title:t("notification.email.signatureTooltip"),children:e.jsx(Re,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(ye,{children:[e.jsx(h,{title:t("notification.email.companyName"),children:e.jsx(m,{name:"companyName",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyName"),helperText:i.errors[r.name]?.message||" ",disabled:!s})})})}),e.jsx(h,{title:t("notification.email.companyLink"),children:e.jsx(m,{name:"companyLink",control:n,rules:{validate:s?w:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyLink"),helperText:i.errors[r.name]?.message||" ",disabled:!s})})})}),e.jsx(h,{title:t("notification.email.companyAddress"),children:e.jsx(m,{name:"companyAddress",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyAddress"),helperText:i.errors[r.name]?.message||" ",disabled:!s})})})}),e.jsx(h,{title:t("notification.email.supportEmail"),children:e.jsx(m,{name:"supportEmail",control:n,rules:{validate:s?I:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",type:"email",error:!!i.errors[r.name],label:t("notification.email.supportEmail"),helperText:i.errors[r.name]?.message||" ",disabled:!s})})})})]})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(W,{variant:"outlined",color:"warning",onClick:S(A),disabled:!s,children:t("oauth.runTest")}),e.jsx(W,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const Pe=ie(ne)``,U={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function _e(){const{api:c}=Z(),{blocklet:a}=se(),{t}=G(),{confirmApi:d,confirmHolder:b}=ee(),f=a?.meta?.did,P=Object.assign({...U},a?.settings?.notification?.pushKit||{}),{handleSubmit:S,control:n,formState:i,watch:_,reset:q}=ae({defaultValues:te(P,Object.keys(U))}),l=re({testReceiver:"",testReceiverError:""}),s=_("enabled"),C=u(async(o,k,v=!0)=>{try{const{blocklet:w}=await c.configNotification({input:{did:f,notification:JSON.stringify({pushKit:o})}}),I=Object.assign({...U},w?.settings?.notification?.pushKit||{});q(I),v&&E.success(t("oauth.saveSuccess"))}catch(w){if(v)E.error(w.message||t("oauth.saveFailed"));else throw w}}),N=u(async(o,k)=>{try{i.isDirty&&await C(o,k,!1);const v=(a?.configs||[]).find(j=>j.key==="BLOCKLET_APP_URL")?.value,w=me(fe(v,he.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:a?.meta?.version,t:new Date(a?.updatedAt||0).getTime()}),I={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:a?.appDid,fullName:a?.meta?.title,avatar:w}}}};await c.sendPush({input:{did:f,receiver:l.testReceiver,notification:JSON.stringify(I)}}),E.success(t("notification.pushKit.testSuccess"))}catch(v){E.error(v.message||t("notification.pushKit.testfailed"))}}),A=u((o,k)=>{l.testReceiverError="",d.open({title:t("notification.pushKit.testSend"),content:()=>e.jsx(R,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.pushKit.inputTestReceiver"),value:l.testReceiver,onChange:v=>{l.testReceiver=v.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(v){if(!l.testReceiver?.trim()){l.testReceiverError=t("notification.pushKit.receiverRequired");return}l.testReceiverError="",await N(o,k),v()}})}),F=u(o=>{const k=o?.trim();return k?V(k)?!0:t("notification.pushKit.endpointInvalid"):t("notification.pushKit.endpointRequired")}),L=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(qe,{component:"form",onSubmit:S(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.pushKit.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:o})=>e.jsx(H,{control:e.jsx($,{checked:o.value,...o})})})}),e.jsx(h,{title:t("notification.pushKit.endpoint"),children:e.jsx(m,{name:"endpoint",control:n,rules:{validate:s?F:L},render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",required:!0,label:t("notification.pushKit.endpoint"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!s})})})}),e.jsxs(h,{title:t("notification.pushKit.customOptions"),children:[e.jsx(m,{name:"did",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.did"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!s})})}),e.jsx(m,{name:"pushPath",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.pushPath"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!s})})})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(W,{variant:"outlined",color:"warning",onClick:S(A),disabled:!s,children:t("oauth.runTest")}),e.jsx(W,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const qe=ie(ne)``,Y=[{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Email"}),value:"email"},{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Push Kit"}),value:"pushKit"}];function Ae(){const[c,a]=B.useState(Y[0].value),{locale:t}=B.useContext(xe),d=pe(()=>({email:e.jsx(Ce,{}),pushKit:e.jsx(_e,{})}),[t]),b=B.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(R,{children:[e.jsx(ve,{tabs:Y,current:c,onChange:a}),e.jsx(R,{style:b,children:d[c]})]})}export{Ae as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as Ge,j as e,bn as gt,r as g,bD as J,bf as H,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 Q,eO as Fe,O as Pe,ik as Ye,bj as Te,aU as Ie,R as Ee,bA as Ne,b3 as qe,b1 as Ae,C as Je,f as Qe,f0 as Xe,aP as De,W as yt,as as Ze,il as et,v as Oe,f2 as tt,bq as je,fJ as st,dD as St,s as ie,af as pe,G as Ue,au as vt,im as Ct,io as Nt,$ as nt,ip as wt,iq as Rt,ir as Tt,is as It,N as Et,bx as it,E as At,J as Dt,P as Ot,S as Lt,Q as $e,it as kt,a3 as Ft}from"./index-DN1FR838.js";import{d as Pt,H as at,g as _t}from"./index-DtEm4DlR.js";import{R as _e,S as Bt}from"./actions-BQYoCyzD.js";import{B as zt}from"./index-B_irEVal.js";import{S as me}from"./shorten-label-lyN5fJdD.js";import{v as ot}from"./index-Cwj1cT7X.js";import{T as Wt}from"./html-title-DZPr9ErN.js";import{R as Mt}from"./Refresh-BRw0lNlx.js";import{D as Kt,g as Ht}from"./traffic-DlmGH1wr.js";import{u as qt}from"./use-mobile-BRO-uubG.js";import"./FilterList-CoyfX8VL.js";import"./CSSTransition-Cp9IAg_E.js";import"./emotion-cache.browser.esm-DR87qH_k.js";import"./index-CIJ5EXA3.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-C1JyiMkY.js";import"./index-aiY7k_D_.js";import"./TableSearch-DTa-kQYq.js";import"./Search-DihRAr8J.js";import"./Clear-3aQ_ViuO.js";import"./MoreVert-Crfla2Nw.js";import"./useLocalStorage-DdFQ0H8D.js";import"./url-evaluation-D0KhcJoH.js";import"./get-safe-url-B8fUDSaQ.js";import"./ButtonGroup-Dlkb94HL.js";import"./getValidReactChildren-Dxx0sUSA.js";import"./permission-BFEhHSn7.js";import"./index.esm-0qTLMRcM.js";import"./collapse-C4RswaYj.js";import"./blocklet-BwZNRhqB.js";import"./Switch-DXK3jQx6.js";import"./iframe-DloJgn9Q.js";import"./ChevronLeft-CZ7VDJCP.js";import"./ChevronRight-W_01-zFQ.js";import"./index-DBii9-f-.js";import"./base-chart-C7SG2Os5.js";import"./index-C1n8OjtU.js";import"./AdapterDayjs-DFNTS6uL.js";import"./useThemeProps-7IPePURq.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=J(()=>s.meta?.did,[s]),[b,S]=g.useState([]),[B,_]=g.useState({}),R=J(()=>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?[H(O.dateRange[0]).toISOString(),H(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?[H(O.dateRange[0]).toISOString(),H(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 X={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:X},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 Jt=(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=Jt(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},Qt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Xt=(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=H().startOf("day");return t.filter(n=>H(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}=Q();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}=Q(),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}=Q(),r=H().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(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(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(Kt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:y})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();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 Ke({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}:{}})}Ke.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}=Q(),[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(Je,{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}=Q(),l=Qe(),x=g.useMemo(()=>Xe(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,X]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,N]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().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),X(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=[],K=[]]=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(K,m.emailSendStatus)||N(W=>({...W,emailSendStatus:K,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"?Qt(S,c):i==="pushKit"?Xt(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 K=i.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}V({channel:c});try{const K=await oe(c,a.receiver);await xe(1),V({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[a.receiver],z),k.anchorEl||(await xe(.5),ne()))}catch(K){q.error(K.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=J(()=>[{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:K=>j(K,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(Ke,{...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(Je,{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,bo as gt,r as g,bE as J,bg as H,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 Q,eO as Fe,O as Pe,ik as Ye,bk as Te,aV as Ie,R as Ee,bB as Ne,b4 as qe,b2 as Ae,C as Je,f as Qe,f0 as Xe,aP as De,W as yt,as as Ze,il as et,v as Oe,f2 as tt,br as je,fJ as st,dD as St,s as ie,af as pe,G as Ue,au as vt,im as Ct,io as Nt,$ as nt,ip as wt,iq as Rt,ir as Tt,is as It,N as Et,by as it,E as At,J as Dt,P as Ot,S as Lt,Q as $e,it as kt,a3 as Ft}from"./index-ZAz6KyaD.js";import{d as Pt,H as at,g as _t}from"./index-lmaPhzfF.js";import{R as _e,S as Bt}from"./actions-DMTLO9WN.js";import{B as zt}from"./index-ZN-5ovc2.js";import{S as me}from"./shorten-label-TTeW9jQE.js";import{v as ot}from"./index-BDMJMOPf.js";import{T as Wt}from"./html-title-CmrSukp5.js";import{R as Mt}from"./Refresh-DOu5ktr4.js";import{D as Kt,g as Ht}from"./traffic-YWyGUBQU.js";import{u as qt}from"./use-mobile-CgBFkYHF.js";import"./FilterList-839Mhlnu.js";import"./CSSTransition-BogJvbBb.js";import"./emotion-cache.browser.esm-C_FnJ0Bl.js";import"./index-D2thcVr8.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-SwRjoCtz.js";import"./index-C4cVrWzE.js";import"./TableSearch-BO1sUXnW.js";import"./Search-BtTTZvHF.js";import"./Clear-CC-EnLra.js";import"./MoreVert-Dw6pPU62.js";import"./useLocalStorage-DQ8BZZZ0.js";import"./url-evaluation-CrYgWs9K.js";import"./get-safe-url-UCXqZj50.js";import"./ButtonGroup-DvgjBww9.js";import"./getValidReactChildren-Uq5KRZW0.js";import"./permission-Bv3920H2.js";import"./index.esm-BwwyBWty.js";import"./collapse-CCua-Mrl.js";import"./blocklet-DPbcf7C1.js";import"./Switch-Qm-YCXDC.js";import"./iframe-B101zvHQ.js";import"./ChevronLeft-DTda7bQ7.js";import"./ChevronRight-CCJi3DLw.js";import"./index-DBii9-f-.js";import"./base-chart-CNZD_30a.js";import"./index-Ck4Ez83C.js";import"./AdapterDayjs-B0zz8Pfq.js";import"./useThemeProps-Bo_3CCZv.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=J(()=>s.meta?.did,[s]),[b,S]=g.useState([]),[B,_]=g.useState({}),R=J(()=>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?[H(O.dateRange[0]).toISOString(),H(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?[H(O.dateRange[0]).toISOString(),H(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 X={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:X},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 Jt=(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=Jt(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},Qt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Xt=(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=H().startOf("day");return t.filter(n=>H(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}=Q();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}=Q(),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}=Q(),r=H().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(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(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(Kt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:y})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();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 Ke({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}:{}})}Ke.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}=Q(),[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(Je,{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}=Q(),l=Qe(),x=g.useMemo(()=>Xe(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,X]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,N]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().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),X(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=[],K=[]]=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(K,m.emailSendStatus)||N(W=>({...W,emailSendStatus:K,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"?Qt(S,c):i==="pushKit"?Xt(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 K=i.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}V({channel:c});try{const K=await oe(c,a.receiver);await xe(1),V({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[a.receiver],z),k.anchorEl||(await xe(.5),ne()))}catch(K){q.error(K.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=J(()=>[{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:K=>j(K,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(Ke,{...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(Je,{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,4 +1,4 @@
|
|
|
1
|
-
import{j as e,K as g,Z as ue,s as R,_ as K,V as U,r as f,a0 as fe,y as v,a1 as Me,a2 as ze,o as E,a3 as oe,a4 as We,H as I,X as Q,T as $,a5 as He,v as B,$ as Ve,D as qe,t as Ye,U as xe,C as ge,a6 as Ke,a7 as Qe,a8 as Xe,u as N,p as Ze,a9 as M,n as se,B as Je,aa as re,A as ye,q as ne,ab as et,W as ae,L as X,w as we,x as Z,ac as tt,ad as ke,ae as st,b as P,af as le,ag as ot,I as rt,ah as nt,ai as at,M as it,i as lt,f as ct,aj as dt,ak as be,al as Se,am as ve,an as L,ao as je,ap as Re,aq as Ce,ar as Pe,as as Te,at as pt,au as ce}from"./index-
|
|
1
|
+
import{j as e,K as g,Z as ue,s as R,_ as K,V as U,r as f,a0 as fe,y as v,a1 as Me,a2 as ze,o as E,a3 as oe,a4 as We,H as I,X as Q,T as $,a5 as He,v as B,$ as Ve,D as qe,t as Ye,U as xe,C as ge,a6 as Ke,a7 as Qe,a8 as Xe,u as N,p as Ze,a9 as M,n as se,B as Je,aa as re,A as ye,q as ne,ab as et,W as ae,L as X,w as we,x as Z,ac as tt,ad as ke,ae as st,b as P,af as le,ag as ot,I as rt,ah as nt,ai as at,M as it,i as lt,f as ct,aj as dt,ak as be,al as Se,am as ve,an as L,ao as je,ap as Re,aq as Ce,ar as Pe,as as Te,at as pt,au as ce}from"./index-ZAz6KyaD.js";import{t as mt}from"./toLower-eS64JG-G.js";import{a as W,u as ht,W as ut,P as Ee,L as Be}from"./index-Bq8bnhOa.js";import{A as ft,D as ie,u as xt,W as gt,P as yt,a as De,L as Ue}from"./wait-container-u05dNEeS.js";import{g as J}from"./get-safe-url-UCXqZj50.js";import{u as de}from"./useLocalStorage-DQ8BZZZ0.js";import{L as wt}from"./Launch-aO5Atd5P.js";import{D as kt}from"./DeleteOutline-3XQ19e-k.js";import{g as bt,i as St}from"./spaces-CW7LOHEn.js";import{I as vt}from"./MoreVert-Dw6pPU62.js";import{y as jt}from"./index-C4cVrWzE.js";import"./url-join-CRdVlgCs.js";import"./use-mobile-CgBFkYHF.js";import"./api-qtglKwG0.js";function Oe({children:s,selected:a=!1}){return e.jsxs(Rt,{children:[s,e.jsx(g,{className:`selected-container ${a?"selected":""}`,children:e.jsx(ue,{className:"selected-icon"})})]})}const Rt=R(g)`
|
|
2
2
|
position: relative;
|
|
3
3
|
|
|
4
4
|
.selected-container {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{dI as M,r as o,Q as d,j as e,bB as c,b6 as C,dJ as I,bz as z,dK as E,bs as u,dL as L}from"./index-ZAz6KyaD.js";import{B as A}from"./ButtonGroup-DvgjBww9.js";function P({...r}){const{size:p="medium",color:i="primary",menu:a=[],children:s=null,variant:m="contained",onClick:x=M,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)},b=t=>{n.current&&n.current.contains(t.target)||l(!1)},k=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{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(C,{})})]}),e.jsx(w,{open:j,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(I,{children:e.jsx(z,{onClickAway:b,children:e.jsx(E,{onClick:k,children:g})})})})]})}P.Item=d;const v=u(A)`
|
|
2
|
+
> .MuiButtonBase-root:last-of-type {
|
|
3
|
+
min-width: 2em;
|
|
4
|
+
padding-left: 0;
|
|
5
|
+
padding-right: 0;
|
|
6
|
+
}
|
|
7
|
+
`,w=u(L)`
|
|
8
|
+
z-index: ${r=>r.theme.zIndex.tooltip};
|
|
9
|
+
.MuiList-root {
|
|
10
|
+
padding: 4px 0;
|
|
11
|
+
}
|
|
12
|
+
.MuiListItem-root {
|
|
13
|
+
padding-top: 4px;
|
|
14
|
+
padding-bottom: 4px;
|
|
15
|
+
}
|
|
16
|
+
`;export{P as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ez as k}from"./index-
|
|
1
|
+
import{ez as k}from"./index-ZAz6KyaD.js";var m,C;function S(){if(C)return m;C=1;function v(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,f=-1,t=0,n,l=0;l<=o.length;++l){if(l<o.length)n=o.charCodeAt(l);else{if(n===47)break;n=47}if(n===47){if(!(f===l-1||t===1))if(f!==l-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),f=l,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,f=l,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(f+1,l):r=o.slice(f+1,l),i=l-f-1;f=l,t=0}else n===46&&t!==-1?++t:t=-1}return r}function b(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,f=arguments.length-1;f>=-1&&!r;f--){var t;f>=0?t=arguments[f]:(i===void 0&&(i=k.cwd()),t=i),v(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(v(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return v(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];v(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(v(e),v(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var f=e.length,t=f-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var l=r.length,s=l-n,c=t<s?t:s,u=-1,a=0;a<=c;++a){if(a===c){if(s>c){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>c&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var h=e.charCodeAt(i+a),y=r.charCodeAt(n+a);if(h!==y)break;h===47&&(u=a)}var d="";for(a=i+u+1;a<=f;++a)(a===f||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(v(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,f=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){f=n;break}}else t=!1;return f===-1?i?"/":".":i&&f===1?"//":e.slice(0,f)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');v(e);var i=0,f=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var l=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(c===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),l>=0&&(c===r.charCodeAt(l)?--l===-1&&(f=n):(l=-1,f=s))}return i===f?f=s:f===-1&&(f=e.length),e.slice(i,f)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else f===-1&&(t=!1,f=n+1);return f===-1?"":e.slice(i,f)}},extname:function(e){v(e);for(var r=-1,i=0,f=-1,t=!0,n=0,l=e.length-1;l>=0;--l){var s=e.charCodeAt(l);if(s===47){if(!t){i=l+1;break}continue}f===-1&&(t=!1,f=l+1),s===46?r===-1?r=l:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||f===-1||n===0||n===1&&r===f-1&&r===i+1?"":e.slice(r,f)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return b("/",e)},parse:function(e){v(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),f=i===47,t;f?(r.root="/",t=1):t=0;for(var n=-1,l=0,s=-1,c=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!c){l=u+1;break}continue}s===-1&&(c=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===l+1?s!==-1&&(l===0&&f?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(l,s)):(l===0&&f?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(l,n),r.base=e.slice(l,s)),r.ext=e.slice(n,s)),l>0?r.dir=e.slice(0,l-1):f&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return g.posix=g,m=g,m}export{S as r};
|