@abtnode/blocklet-services 1.16.32-beta-5463e017 → 1.16.32-beta-93e1a798
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/api/index.js +3 -1
- package/api/libs/kyc.js +2 -2
- package/api/routes/blocklet.js +13 -6
- package/api/services/kyc/index.js +14 -12
- package/api/services/notification/blocklet-events-notifier.js +3 -1
- package/api/state/profile.js +5 -4
- package/dist/assets/{Add-DPWETbuH.js → Add-D8jHDZuh.js} +1 -1
- package/dist/assets/{Alert-DDr4PUmN.js → Alert-CRD24aa1.js} +1 -1
- package/dist/assets/{ArrowDropDown-BCZ8iqaM.js → ArrowDropDown-CFc0zow6.js} +1 -1
- package/dist/assets/{Avatar-Der2Q3Zi.js → Avatar-BIWwirOj.js} +1 -1
- package/dist/assets/{ButtonGroup-zMm3edlK.js → ButtonGroup-DcU8GHuP.js} +1 -1
- package/dist/assets/{CheckCircle-BfztTFob.js → CheckCircle-BrcbSmIK.js} +1 -1
- package/dist/assets/{ChevronLeft-CrTHRIqK.js → ChevronLeft-Cyjchnxw.js} +1 -1
- package/dist/assets/{ChevronRight-CIt5KDbd.js → ChevronRight-j0-gJxyM.js} +1 -1
- package/dist/assets/{Close-CgA7Qef8.js → Close-B2vbXcur.js} +1 -1
- package/dist/assets/{CloseOutlined-OBzuC30j.js → CloseOutlined-BWhWoWD_.js} +1 -1
- package/dist/assets/{Delete-DVYTl7-n.js → Delete-B2j1UcE8.js} +1 -1
- package/dist/assets/{DeleteOutline-DKoxIRL9.js → DeleteOutline-C2h-KiXe.js} +1 -1
- package/dist/assets/{DialogContentText-BnQAOkxN.js → DialogContentText-D5Xxal_F.js} +1 -1
- package/dist/assets/{Done-D1_3yhtX.js → Done-B-JT0RXC.js} +1 -1
- package/dist/assets/{Download-CvngcFRX.js → Download-DP_lDlx2.js} +1 -1
- package/dist/assets/{Edit-DQ3aLTS3.js → Edit-B3J8-Twv.js} +1 -1
- package/dist/assets/{EditIcon-C5DCIJQ3.js → EditIcon-R508XR9R.js} +1 -1
- package/dist/assets/{Error-DOhq8cCM.js → Error-B4vCt6tb.js} +1 -1
- package/dist/assets/{ExpandMore-BgcTT2Bb.js → ExpandMore-IE6fvawl.js} +1 -1
- package/dist/assets/{FormControl-D00yHDcj.js → FormControl-Chtq9AE7.js} +1 -1
- package/dist/assets/{FormControlLabel-BJXWJJky.js → FormControlLabel-BmopTtvW.js} +1 -1
- package/dist/assets/{FormGroup-CBgybl1l.js → FormGroup-C54kQ9N4.js} +1 -1
- package/dist/assets/{Google-Be2TlnTX.js → Google-DBXwxuV5.js} +1 -1
- package/dist/assets/{Hidden-Bg6BPxEd.js → Hidden-DPIGUAMJ.js} +1 -1
- package/dist/assets/{InfoOutlined-BxTwuqiu.js → InfoOutlined-BmUBc2r2.js} +1 -1
- package/dist/assets/{InputAdornment-BGOXKboF.js → InputAdornment-DXkRELYA.js} +1 -1
- package/dist/assets/{InputLabel-BaHBEVm2.js → InputLabel-DMWY4sIp.js} +1 -1
- package/dist/assets/{LastPage-DyrTuTrl.js → LastPage-D0B9CdNo.js} +1 -1
- package/dist/assets/{Launch-CNWKbDVj.js → Launch-DhHbLKKF.js} +1 -1
- package/dist/assets/{LaunchOutlined-BuQ3n0Nq.js → LaunchOutlined-CvTIL2cU.js} +1 -1
- package/dist/assets/{Link-CiVKLn7B.js → Link-CYqMveft.js} +1 -1
- package/dist/assets/{ListItemText-BW_owdy0.js → ListItemText-BR6T5ZDu.js} +1 -1
- package/dist/assets/{LoadingButton-AM-IIW_5.js → LoadingButton-DmCdDxLA.js} +1 -1
- package/dist/assets/{LockIcon-0vWjHODV.js → LockIcon-C1x7LbhO.js} +1 -1
- package/dist/assets/{Loop-C8sLBH67.js → Loop-BwgmQ4ke.js} +1 -1
- package/dist/assets/{MoreHoriz-i1hLrklo.js → MoreHoriz-NGD3jXnn.js} +1 -1
- package/dist/assets/{MoreVert-D_g6Th6c.js → MoreVert-MUbtAQHv.js} +1 -1
- package/dist/assets/{OpenInNew-DBNjDxil.js → OpenInNew-CJl5exgf.js} +1 -1
- package/dist/assets/{Pagination-DLYy7jWI.js → Pagination-IHWKke1i.js} +1 -1
- package/dist/assets/{PlayArrow-ywjbMR8A.js → PlayArrow-DzoHzRoJ.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-UZOXHzIe.js → QuestionMarkCircle-TnBpzaSI.js} +1 -1
- package/dist/assets/{RadioGroup-BOq5mI1A.js → RadioGroup-C6M_sifl.js} +1 -1
- package/dist/assets/{Search-Cm2FDsnl.js → Search-wiijyIeu.js} +1 -1
- package/dist/assets/{Select-_ZzhxUOz.js → Select-CIDtym3x.js} +1 -1
- package/dist/assets/{ServerLogo-DeFJVAh8.js → ServerLogo-Bal3ugu3.js} +1 -1
- package/dist/assets/{Skeleton-D6pzHOGJ.js → Skeleton-BXCyEPW7.js} +1 -1
- package/dist/assets/{Slider-ZYL8jZ1U.js → Slider-Ntyz_Q-E.js} +1 -1
- package/dist/assets/{Stack-DuNNAX-1.js → Stack-CYabuVI4.js} +1 -1
- package/dist/assets/{Stepper-DJcNoyk4.js → Stepper-DuAngjIl.js} +1 -1
- package/dist/assets/{TextField-DvTYZ6EA.js → TextField-x4CoNOlz.js} +1 -1
- package/dist/assets/{Toolbar-DbekG5v-.js → Toolbar-DlYXwq_K.js} +1 -1
- package/dist/assets/{ViewColumn-BOqfI3PF.js → ViewColumn-8HGbbav-.js} +1 -1
- package/dist/assets/{ViewList-DloAt_wk.js → ViewList-DjDLjZbQ.js} +1 -1
- package/dist/assets/{access-control-Coh2AROp.js → access-control-BSvhOxQQ.js} +1 -1
- package/dist/assets/{actions-DU4pTpmF.js → actions-byFcd21l.js} +1 -1
- package/dist/assets/{add-component-core-DT8eSr6D.js → add-component-core-BaGwMeTq.js} +60 -60
- package/dist/assets/{add-resource-CSMNGPH3.js → add-resource-R3DTTpMs.js} +1 -1
- package/dist/assets/{addon-DImOcoyp.js → addon-B9HdZ1hJ.js} +1 -1
- package/dist/assets/{analytics-CdJi4q2Q.js → analytics-Drr9ic2m.js} +7 -7
- package/dist/assets/api-DHCXgKlp.js +1 -0
- package/dist/assets/{audit-logs-Bf2mKt3i.js → audit-logs-tviTMDA1.js} +1 -1
- package/dist/assets/{button-LdgYe-Yo.js → button-D68lNTBN.js} +1 -1
- package/dist/assets/{click-to-copy-GLcS-PQh.js → click-to-copy-Cy7g0c_W.js} +1 -1
- package/dist/assets/{complete-d1PDQlj9.js → complete-N8h-bC0Y.js} +1 -1
- package/dist/assets/{component-Ny_sGfYr.js → component-CyfiUp-R.js} +1 -1
- package/dist/assets/{config-CFU2n19a.js → config-BEOq9uec.js} +1 -1
- package/dist/assets/{config-CpPqNxWJ.js → config-BZSxOwu6.js} +1 -1
- package/dist/assets/{config-navigation-BQEWPLSH.js → config-navigation-C6EN0Fwq.js} +1 -1
- package/dist/assets/{confirm-BdJlZzQ-.js → confirm-Bz_GmEiI.js} +1 -1
- package/dist/assets/{connect-ndruP8fv.js → connect-BZC3CdFF.js} +1 -1
- package/dist/assets/{connect-BDR3XUNJ.js → connect-Cr0AxBUc.js} +1 -1
- package/dist/assets/{connect-to-D6gkq_5F.js → connect-to-BmqBRB3U.js} +1 -1
- package/dist/assets/{content-layout-9pObqqwC.js → content-layout-2vv5OZW9.js} +1 -1
- package/dist/assets/{dashboard-Clr7sJbb.js → dashboard-Cwcji3JN.js} +3 -3
- package/dist/assets/{did-address-DNmiCCjI.js → did-address-BIfBoDiQ.js} +1 -1
- package/dist/assets/{domain-BM3Ias2K.js → domain-CRovIqk7.js} +1 -1
- package/dist/assets/{domain-list-BdKqoNlW.js → domain-list-DcneFIba.js} +1 -1
- package/dist/assets/{email-03xGEqer.js → email-CeOASC0F.js} +3 -3
- package/dist/assets/{exchange-passport-BwiQ670F.js → exchange-passport-D-WRM3Wn.js} +1 -1
- package/dist/assets/{fallback-BLJkxLTK.js → fallback-DTP7cYpM.js} +1 -1
- package/dist/assets/{format-error-C43xGCjC.js → format-error-BOzcbfGa.js} +1 -1
- package/dist/assets/{fuel-C7otG6Kf.js → fuel-Bn4-TEHO.js} +1 -1
- package/dist/assets/{fullpage-C4Et_NyD.js → fullpage-rvVF1rz8.js} +1 -1
- package/dist/assets/{home-CZCCRVbe.js → home-DR7GS6ca.js} +1 -1
- package/dist/assets/{iframe-CPKiwkND.js → iframe-glv0Poq3.js} +1 -1
- package/dist/assets/{index-DR40cJFL.js → index-3hwSska-.js} +3 -3
- package/dist/assets/{index-CFpdZL6w.js → index-B5vlCSnw.js} +1 -1
- package/dist/assets/{index-BCMjvLku.js → index-B6NXai6_.js} +1 -1
- package/dist/assets/{index-CzxDEhmG.js → index-B8cOlg3J.js} +1 -1
- package/dist/assets/{index-CD6yQnY4.js → index-BNFvQJs8.js} +1 -1
- package/dist/assets/{index-CWjTgh2V.js → index-BNm1w4Av.js} +1 -1
- package/dist/assets/{index-BRnCFYx3.js → index-BNnk2PUZ.js} +1 -1
- package/dist/assets/{index-ChWrF7R7.js → index-BQQSQ70k.js} +1 -1
- package/dist/assets/{index-CbBjirNE.js → index-BZqmUYmf.js} +1 -1
- package/dist/assets/{index-BrFlqDrV.js → index-BbBRjIRQ.js} +1 -1
- package/dist/assets/{index-CT70Tuv9.js → index-BcUb67P2.js} +1 -1
- package/dist/assets/{index-CH2n2mOS.js → index-BreZlHA5.js} +1 -1
- package/dist/assets/{index-Dp6zROo4.js → index-Bsh1JZ9i.js} +1 -1
- package/dist/assets/{index-BlvJrvQX.js → index-Bukl4DJp.js} +1 -1
- package/dist/assets/{index-B3ThwVSS.js → index-CE9qCuXL.js} +1 -1
- package/dist/assets/{index-BaC4EhQh.js → index-CEaTcEQs.js} +16 -16
- package/dist/assets/{index-BK9kuqs5.js → index-CJPYlJzX.js} +1 -1
- package/dist/assets/{index-TwQfcdR0.js → index-C_flIkR0.js} +1 -1
- package/dist/assets/index-CeEJtkL-.js +126 -0
- package/dist/assets/{index-AgTn3eU4.js → index-ChqFEpi4.js} +2 -2
- package/dist/assets/{index-BzY4clAs.js → index-DFZwS5zQ.js} +1 -1
- package/dist/assets/{index-D9e3uQkW.js → index-DWAL5jyd.js} +1 -1
- package/dist/assets/{index-DiOkeCOc.js → index-DYNsUZaH.js} +1 -1
- package/dist/assets/{index-DPXmNWqb.js → index-DZIjChbd.js} +1 -1
- package/dist/assets/{index-s95vTNww.js → index-DgFd31_6.js} +1 -1
- package/dist/assets/{index-hkkOggLS.js → index-DsNs234N.js} +1 -1
- package/dist/assets/{index-BWVDn9BP.js → index-MgF3lCRP.js} +1 -1
- package/dist/assets/{index-Cfnr_7cH.js → index-bxrR9ubG.js} +4 -4
- package/dist/assets/{index-Ez2y1Lea.js → index-j8Uq5XuX.js} +1 -1
- package/dist/assets/{index-CTil0VJz.js → index-mmP1Lkjm.js} +1 -1
- package/dist/assets/{index-lVfYf5Oq.js → index-wMDpYZdf.js} +1 -1
- package/dist/assets/{index.es-CkGqU4MQ.js → index.es-Dz_wpH3d.js} +1 -1
- package/dist/assets/{index.esm-8yCk0S5h.js → index.esm-CoLXjYXU.js} +1 -1
- package/dist/assets/{invitation-DAGy7I2M.js → invitation-Bxk7RQM2.js} +1 -1
- package/dist/assets/{invite-06pBNgrg.js → invite-DxTtxFmK.js} +1 -1
- package/dist/assets/{issue-passport-CbtgsLgQ.js → issue-passport-SKwEWQ_s.js} +1 -1
- package/dist/assets/item-B-EBHzLe.js +1 -0
- package/dist/assets/{jss-plugin-props-sort.esm-D4wv_NcC.js → jss-plugin-props-sort.esm-Bm1tsMYs.js} +1 -1
- package/dist/assets/{launch-result-message-BGkFHBr0.js → launch-result-message-CaImC-I4.js} +1 -1
- package/dist/assets/{layout-C1fJ0PwQ.js → layout-DskBhVxG.js} +1 -1
- package/dist/assets/{list-header-D2TsmXsU.js → list-header-CfS2OSwd.js} +1 -1
- package/dist/assets/localization-BW8TQLcf.js +1 -0
- package/dist/assets/{log-Bx1CDJfR.js → log-BSUm2QeV.js} +1 -1
- package/dist/assets/{login-Ci8kprd2.js → login-BXwy09YT.js} +1 -1
- package/dist/assets/{login-oauth-callback-OcVe-Pko.js → login-oauth-callback-CrNNy4ro.js} +1 -1
- package/dist/assets/{logo-uploader-DPtvNrwp.js → logo-uploader-Blhm721C.js} +3 -3
- package/dist/assets/{lost-passport-DQYzD5oM.js → lost-passport-r7tegJSQ.js} +3 -3
- package/dist/assets/{lottie-Dtcij0yx.js → lottie-Bw0llhbP.js} +1 -1
- package/dist/assets/{notifications-u_yxMKF9.js → notifications-CymYmkqD.js} +1 -1
- package/dist/assets/{open-window-Ca8SnnJR.js → open-window-EH5UZ1B9.js} +1 -1
- package/dist/assets/{overview-hyt-Fv0L.js → overview-BpKMkNIP.js} +1 -1
- package/dist/assets/{page-header-DZBo2jY4.js → page-header-CGrnydWl.js} +1 -1
- package/dist/assets/{permission-DDD12SuE.js → permission-VH_Fm7Pw.js} +1 -1
- package/dist/assets/{preferences-BzxjYd2D.js → preferences-D4Eq55c6.js} +1 -1
- package/dist/assets/publish-resource-CtKz6A2f.js +1 -0
- package/dist/assets/{react-iXxw1Yhu.js → react-DJuQ-Z9X.js} +3 -3
- package/dist/assets/{redux-Bma4eNss.js → redux-DN6s-mdl.js} +1 -1
- package/dist/assets/{resource-dialog-DhmviK8K.js → resource-dialog-uAYGlGhi.js} +1 -1
- package/dist/assets/sdk-BYKTwfxu.js +1 -0
- package/dist/assets/{selector-B8IAFODK.js → selector-LFwadlX9.js} +1 -1
- package/dist/assets/session-BG5hlQoH.js +1 -0
- package/dist/assets/{setup-TXTEwwLA.js → setup-DckNmKNu.js} +3 -3
- package/dist/assets/{shorten-label-DWH-tsmz.js → shorten-label-DZrPE8HL.js} +1 -1
- package/dist/assets/{slicedToArray-Doa8i3Sy.js → slicedToArray-DEmwrQWd.js} +2 -2
- package/dist/assets/{spaces-DPfrZKXe.js → spaces-D6Mid5Z_.js} +1 -1
- package/dist/assets/{start-DwEZv43D.js → start-Dgs20fUu.js} +1 -1
- package/dist/assets/{step-actions-B1vsf_QO.js → step-actions-CQZle7ap.js} +1 -1
- package/dist/assets/{studio-CTK5QQPt.js → studio-Bk3f_TnH.js} +1 -1
- package/dist/assets/{switch-control-DJhTvGtn.js → switch-control-XeRJBgck.js} +1 -1
- package/dist/assets/{toUpper-Bff1Q0mA.js → toUpper-D3wJMACz.js} +1 -1
- package/dist/assets/{transfer-IRhzEeuE.js → transfer-CJn1-1Hv.js} +1 -1
- package/dist/assets/{uniqBy-DIeGY4K_.js → uniqBy-DA6z7OdT.js} +1 -1
- package/dist/assets/{unsubscribe-CwygyLJZ.js → unsubscribe-FfeRFV57.js} +1 -1
- package/dist/assets/{url-join-D5TK65dM.js → url-join-5MzXbhiU.js} +1 -1
- package/dist/assets/{use-blocklet-info-for-connect-did-spaces-DaNxIRBj.js → use-blocklet-info-for-connect-did-spaces-C5KUrb2h.js} +1 -1
- package/dist/assets/{use-mobile-BA_cO1yG.js → use-mobile-mkcGNRhM.js} +1 -1
- package/dist/assets/{useAsync-Bl2lmnoD.js → useAsync-ByBqdjCT.js} +1 -1
- package/dist/assets/{useFormControl-CAWQrhew.js → useFormControl-BA79DoOc.js} +1 -1
- package/dist/assets/{useLocalStorage-DkK4fk62.js → useLocalStorage-CmGNzDHX.js} +1 -1
- package/dist/assets/{useSetState-OuMAH4bG.js → useSetState-Cz7xEaUb.js} +1 -1
- package/dist/assets/{useSlot-nO86v-Bn.js → useSlot-CDa1PttK.js} +1 -1
- package/dist/assets/{useSlotProps-B8lkbwkT.js → useSlotProps-4qJAhdYR.js} +1 -1
- package/dist/assets/{useThemeProps-CIT7yB5m.js → useThemeProps-B-j4MceL.js} +1 -1
- package/dist/assets/{user-center-BEb-hcxI.js → user-center-lM3dah3G.js} +1 -1
- package/dist/assets/{user-sessions-D_s7CT2k.js → user-sessions-Bf8PBzsX.js} +1 -1
- package/dist/assets/{util-znUxW1sG.js → util-CxaUEagR.js} +1 -1
- package/dist/assets/{wrap-locale-BjkpLOO0.js → wrap-locale-aLhwmHYY.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +18 -18
- package/dist/assets/api-DUETbHv8.js +0 -1
- package/dist/assets/index-Bc3FFnWG.js +0 -126
- package/dist/assets/item-B0XIEv1j.js +0 -1
- package/dist/assets/localization-IrbI0TJr.js +0 -1
- package/dist/assets/publish-resource-BL3ifBGp.js +0 -1
- package/dist/assets/sdk-B37oViy1.js +0 -1
- package/dist/assets/session-D3mS3Gz5.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-
|
|
2
|
-
import{at as d2,j as o,aG as se,cJ as g0,aK as A,fw as X1,aJ as je,aE as $e,aF as Fe,T as G,r as R,aI as m1,aL as u2,aM as Ue,aN as qe,cP as p2,fx as l1,X as Se,Y as ke,B as z,n as Oe,P as h,$ as We,G as X,e as v1,u as te,aP as we,aY as Ve,bx as n1,a1 as e1,L as ue,bL as b0,a as ve,aC as ge,K as h2,t as $,Z as ae,dw as f2,aa as ye,c as pe,I as x2,bW as g1,ch as j0,cE as m2,cN as He,cO as w0,aj as v2,d2 as g2,cI as Je,bF as re,c3 as Qe,fi as b2,a8 as J1,b as ne,bm as R0,ec as C0,ai as b1,bn as y0,co as z0,aT as Ae,aS as j2,a3 as S0,fy as Q1,f7 as Le,bk as w2,au as k0,cV as R2,l as C2,aB as y2,aq as z2,ar as i1}from"./index-BaC4EhQh.js";import{d as j1}from"./Add-DPWETbuH.js";import{d as I0}from"./Delete-DVYTl7-n.js";import{d as S2}from"./Error-DOhq8cCM.js";import{D as w1}from"./index-CT70Tuv9.js";import{T as M0,b as k2}from"./index-Dp6zROo4.js";import{C as R1}from"./confirm-BdJlZzQ-.js";import{u as s1}from"./session-D3mS3Gz5.js";import{W as Y1}from"./did-address-DNmiCCjI.js";import{B as C1,d as I2}from"./ChevronRight-CIt5KDbd.js";import{S as be}from"./shorten-label-DWH-tsmz.js";import{A as P0}from"./Avatar-Der2Q3Zi.js";import{d as M2}from"./Download-CvngcFRX.js";import{d as P2}from"./QuestionMarkCircle-UZOXHzIe.js";import{b as L2,c as Z1,T as T2}from"./index-BK9kuqs5.js";import{_ as Pe}from"./useSetState-OuMAH4bG.js";import{c as y1}from"./index-DPXmNWqb.js";import{C as u1,F as p1}from"./FormControlLabel-BJXWJJky.js";import{A as L0}from"./Alert-DDr4PUmN.js";import{p as t1}from"./index-HqFqdQ4r.js";import"./api-DUETbHv8.js";import{i as N2}from"./index-CD6yQnY4.js";import{d as V2}from"./ExpandMore-BgcTT2Bb.js";import{d as D2}from"./OpenInNew-DBNjDxil.js";import{u as T0}from"./useThemeProps-CIT7yB5m.js";import{u as _2}from"./useSlotProps-B8lkbwkT.js";import{d as E2}from"./DeleteOutline-DKoxIRL9.js";import{c as B2,A as N0,u as A2,S as O2,U as H2}from"./item-B0XIEv1j.js";import{d as $2}from"./ArrowDropDown-BCZ8iqaM.js";import{f as Ne}from"./format-error-C43xGCjC.js";import{B as h1}from"./ButtonGroup-zMm3edlK.js";import{T as Te}from"./TextField-DvTYZ6EA.js";import{I as z1}from"./InputAdornment-BGOXKboF.js";import{C as F2}from"./click-to-copy-GLcS-PQh.js";import{d as U2}from"./Launch-CNWKbDVj.js";import{L as q2}from"./MoreVert-D_g6Th6c.js";import{a as W2}from"./ListItemText-BW_owdy0.js";import{S as e0}from"./index-ChWrF7R7.js";import{M as G2}from"./index-BrFlqDrV.js";import{r as K2}from"./index-CzxDEhmG.js";import{d as X2}from"./Done-D1_3yhtX.js";import{c as V0,d as D0,b as J2,S as Q2,a as Y2}from"./Stepper-DJcNoyk4.js";import{S as Z2}from"./Stack-DuNNAX-1.js";import{R as et,a as t0}from"./RadioGroup-BOq5mI1A.js";import"./toPropertyKey-PLuKRk1e.js";import"./index-s95vTNww.js";import"./redux-Bma4eNss.js";import"./ViewColumn-BOqfI3PF.js";import"./FormControl-D00yHDcj.js";import"./useFormControl-CAWQrhew.js";import"./FormGroup-CBgybl1l.js";import"./Select-_ZzhxUOz.js";import"./InputLabel-BaHBEVm2.js";import"./LastPage-DyrTuTrl.js";import"./Toolbar-DbekG5v-.js";import"./Search-Cm2FDsnl.js";import"./index-B3ThwVSS.js";import"./DialogContentText-BnQAOkxN.js";import"./Link-CiVKLn7B.js";import"./useSlot-nO86v-Bn.js";import"./jss-plugin-props-sort.esm-D4wv_NcC.js";const tt=d2(o.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),ot=["slots","slotProps"],lt=se(g0)(({theme:e})=>A({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`},e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":A({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":A({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:X1(e.palette.grey[200],.12)}:{backgroundColor:X1(e.palette.grey[600],.12)})})),nt=se(tt)({width:24,height:16});function st(e){const{slots:t={},slotProps:l={}}=e,s=je(e,ot),r=e;return o.jsx("li",{children:o.jsx(lt,A({focusRipple:!0},s,{ownerState:r,children:o.jsx(nt,A({as:t.CollapsedIcon,ownerState:r},l.collapsedIcon))}))})}function rt(e){return Fe("MuiBreadcrumbs",e)}const it=$e("MuiBreadcrumbs",["root","ol","li","separator"]),at=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],ct=e=>{const{classes:t}=e;return qe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},rt,t)},dt=se(G,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${it.li}`]:t.li},t.root]})({}),ut=se("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),pt=se("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function ht(e,t,l,s){return e.reduce((r,c,i)=>(i<e.length-1?r=r.concat(c,o.jsx(pt,{"aria-hidden":!0,className:t,ownerState:s,children:l},`separator-${i}`)):r.push(c),r),[])}const _0=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiBreadcrumbs"}),{children:r,className:c,component:i="nav",slots:a={},slotProps:u={},expandText:f="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:g=1,maxItems:y=8,separator:p="/"}=s,d=je(s,at),[m,b]=R.useState(!1),v=A({},s,{component:i,expanded:m,expandText:f,itemsAfterCollapse:x,itemsBeforeCollapse:g,maxItems:y,separator:p}),C=ct(v),S=u2({elementType:a.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),N=R.useRef(null),T=I=>{const U=()=>{b(!0);const V=N.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return g+x>=I.length?I:[...I.slice(0,g),o.jsx(st,{"aria-label":f,slots:{CollapsedIcon:a.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:U},"ellipsis"),...I.slice(I.length-x,I.length)]},P=R.Children.toArray(r).filter(I=>R.isValidElement(I)).map((I,U)=>o.jsx("li",{className:C.li,children:I},`child-${U}`));return o.jsx(dt,A({ref:l,component:i,color:"text.secondary",className:Ue(C.root,c),ownerState:v},d,{children:o.jsx(ut,{className:C.ol,ref:N,ownerState:v,children:ht(m||y&&P.length<=y?P:T(P),C.separator,p,v)})}))});function ft(e){return Fe("MuiStepButton",e)}const o0=$e("MuiStepButton",["root","horizontal","vertical","touchRipple"]),xt=["children","className","icon","optional"],mt=e=>{const{classes:t,orientation:l}=e;return qe({root:["root",l],touchRipple:["touchRipple"]},ft,t)},vt=se(g0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${o0.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>A({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${o0.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),gt=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepButton"}),{children:r,className:c,icon:i,optional:a}=s,u=je(s,xt),{disabled:f,active:x}=R.useContext(V0),{orientation:g}=R.useContext(D0),y=A({},s,{orientation:g}),p=mt(y),d={icon:i,optional:a},m=p2(r,["StepLabel"])?R.cloneElement(r,d):o.jsx(J2,A({},d,{children:r}));return o.jsx(vt,A({focusRipple:!0,disabled:f,TouchRippleProps:{className:p.touchRipple},className:Ue(p.root,c),ref:l,ownerState:y,"aria-current":x?"step":void 0},u,{children:m}))});function bt(e){return Fe("MuiStepContent",e)}$e("MuiStepContent",["root","last","transition"]);const jt=["children","className","TransitionComponent","transitionDuration","TransitionProps"],wt=e=>{const{classes:t,last:l}=e;return qe({root:["root",l&&"last"],transition:["transition"]},bt,t)},Rt=se("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.last&&t.last]}})(({ownerState:e,theme:t})=>A({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:t.vars?`1px solid ${t.vars.palette.StepContent.border}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[600]}`},e.last&&{borderLeft:"none"})),Ct=se(l1,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),yt=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepContent"}),{children:r,className:c,TransitionComponent:i=l1,transitionDuration:a="auto",TransitionProps:u}=s,f=je(s,jt);R.useContext(D0);const{active:x,last:g,expanded:y}=R.useContext(V0),p=A({},s,{last:g}),d=wt(p);let m=a;return a==="auto"&&!i.muiSupportAuto&&(m=void 0),o.jsx(Rt,A({className:Ue(d.root,c),ref:l,ownerState:p},f,{children:o.jsx(Ct,A({as:i,in:x||y,className:d.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:r}))}))});var S1={},zt=ke;Object.defineProperty(S1,"__esModule",{value:!0});var E0=S1.default=void 0,St=zt(Se()),kt=o;E0=S1.default=(0,St.default)((0,kt.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var k1={},It=ke;Object.defineProperty(k1,"__esModule",{value:!0});var B0=k1.default=void 0,Mt=It(Se()),Pt=o;B0=k1.default=(0,Mt.default)((0,Pt.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var I1={},Lt=ke;Object.defineProperty(I1,"__esModule",{value:!0});var A0=I1.default=void 0,Tt=Lt(Se()),Nt=o;A0=I1.default=(0,Tt.default)((0,Nt.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function Ie({size:e,...t}){return o.jsx(z,{display:"flex",mt:4,...t,children:o.jsx(Oe,{size:e})})}Ie.propTypes={size:h.number};Ie.defaultProps={size:24};function M1({did:e,projectId:t,title:l,logo:s,describe:r}){const i=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${s}`,[a,u]=R.useState(!1),f=We(x=>x.breakpoints.down("md"));return o.jsxs(z,{sx:{display:"flex",flexDirection:"row",color:a?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[o.jsx(P0,{sx:{borderRadius:1},src:i}),o.jsxs(z,{children:[o.jsx(be,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:l||"/"}),o.jsx(be,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||a?"primary.main":"grey.700"},children:r||"/"})]})]})}M1.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function P1({initUrl:e}){const t=v1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:s,locale:r}=te(),{api:c}=we(),{api:i}=s1(),[a,u]=R.useState(!0),{blocklet:f}=Ve(),[x,g]=R.useState(null),[y,p]=R.useState(!1),d=We(k=>k.breakpoints.down("xl")),{componentDid:m=""}=n1(),[b,v]=R.useState(null),C=()=>{c.getProjects({input:{did:f.meta.did,componentDid:m,tenantScope:l}}).then(k=>{const L=(k==null?void 0:k.projects)||[];u(!1),v(L)}).catch(k=>{u(!1),$.error(k.message)})},S=()=>{t(`${X.UNOWNED_DID}/create/none`,{replace:!0})},N=k=>{g(k)},T=()=>{u(!1),p(!0)},P=()=>{p(!1),g(null)},I=k=>{$.error(k.message),p(!1),g(null)},U=k=>{if(!(k!=null&&k.deleted)){$.error("Delete project failed");return}C(),p(!1),g(null)};if(R.useEffect(()=>{C()},[]),!b&&a)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(Ie,{})});if(!b)return null;if(!b.length)return o.jsxs(z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:s("blocklet.publish.blockletEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:s("blocklet.publish.createBlockletTip")}),o.jsx(e1,{onClick:S,variant:"contained",children:s("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:k=>{const L=b[k];return o.jsx(ue,{to:`${L.id}`,children:o.jsx(M1,{did:f.meta.did,projectId:L.id,logo:L.blockletLogo,title:L.blockletTitle,describe:L.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:k=>k?o.jsx(M0,{type:"success",children:k}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:k=>k?o.jsx(Y1,{size:14,compact:!0,responsive:!1,did:k}):null}},d||m?null:{label:s("common.createdBy"),name:"createdBy",options:{customBodyRender:k=>k?o.jsx(Y1,{onClick:()=>{t(`/.well-known/service/admin/members?did=${k}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:k}):null}},d||m?null:{label:s("common.scope"),name:"componentDid",options:{customBodyRender:k=>{const L=(f.children||[]).find(E=>E.meta.did===k);return L?o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:14,blocklet:L,ancestors:[f]}),o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:L.meta.title})]},k):""}}},d||l?null:{label:s("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:k=>o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(be,{children:k})})}},{label:s("common.updatedAt"),name:"updatedAt",options:{customBodyRender:k=>o.jsx(b0,{value:Number(k),locale:r})}},{label:s("common.actions"),name:"actions",options:{customBodyRenderLite:k=>{const L=b[k];return o.jsxs(z,{display:"flex",children:[o.jsx(ue,{to:`${L.id}/new-release/${L.lastReleaseId}`,children:o.jsx(ve,{title:s("blocklet.publish.createRelease"),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"create",children:o.jsx(E0,{style:{fontSize:18}})})})}),!!L.lastReleaseId&&o.jsx(ve,{title:s("blocklet.publish.viewLastRelease",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"secondary","aria-label":"create",children:o.jsx(ue,{style:{display:"flex"},to:`${L.id}/view/${L.lastReleaseId}`,children:o.jsx(B0,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:s("blocklet.publish.delete",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"delete",onClick:()=>N(L),children:o.jsx(I0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),M=y?o.jsx(h2,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:r,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:U,onError:I,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:s("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:s("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:s("blocklet.publish.deleteProject.confirm"),success:s("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(Vt,{children:[o.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(z,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(z,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("common.blockletStudio")}),o.jsx(ve,{title:s("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(A0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(e1,{onClick:S,variant:"contained",children:[o.jsx(j1,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.publish.createBlocklet")]})]}),o.jsx(z,{mt:3}),o.jsx(w1,{className:"main-table",locale:r,data:b,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(R1,{title:`${s("common.delete")} ${x.blockletTitle}`,description:s("blocklet.publish.deleteProject.description"),confirm:s("common.confirm"),onConfirm:T,onCancel:()=>g(null),children:o.jsx(z,{sx:{marginTop:2},children:[s("blocklet.publish.deleteProject.tip1"),s("blocklet.publish.deleteProject.tip2"),s("blocklet.publish.deleteProject.tip3")].map(k=>o.jsxs(z,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(S2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(G,{component:"span",variant:"inherit",color:"text.secondary",children:k})]}))})}),M]})}P1.propTypes={initUrl:h.object};P1.defaultProps={initUrl:null};const Vt=ae(z)`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-DJuQ-Z9X.js","assets/index-CEaTcEQs.js","assets/index-D8NuaJ66.css","assets/index-BreZlHA5.js","assets/preact.module-DJUF--8d.js","assets/index-DsNs234N.js","assets/index-DZIjChbd.js","assets/toUpper-D3wJMACz.js","assets/index-B5vlCSnw.js","assets/fallback-DTP7cYpM.js","assets/index-DYNsUZaH.js","assets/Toolbar-DlYXwq_K.js","assets/Hidden-DPIGUAMJ.js","assets/index-B6NXai6_.js","assets/MoreVert-MUbtAQHv.js","assets/selector-LFwadlX9.js","assets/ExpandMore-IE6fvawl.js","assets/Avatar-BIWwirOj.js","assets/useSlot-CDa1PttK.js","assets/resource-dialog-uAYGlGhi.js","assets/OpenInNew-CJl5exgf.js","assets/CloseOutlined-BWhWoWD_.js","assets/use-mobile-mkcGNRhM.js","assets/Link-CYqMveft.js","assets/index-CJPYlJzX.js","assets/index-CE9qCuXL.js","assets/index-BQQSQ70k.js","assets/FormControlLabel-BmopTtvW.js","assets/useFormControl-BA79DoOc.js","assets/Stack-CYabuVI4.js","assets/index-BcUb67P2.js","assets/useThemeProps-B-j4MceL.js","assets/toPropertyKey-PLuKRk1e.js","assets/index-DgFd31_6.js","assets/redux-DN6s-mdl.js","assets/ViewColumn-8HGbbav-.js","assets/FormControl-Chtq9AE7.js","assets/FormGroup-C54kQ9N4.js","assets/Select-CIDtym3x.js","assets/InputLabel-DMWY4sIp.js","assets/ListItemText-BR6T5ZDu.js","assets/TextField-x4CoNOlz.js","assets/LastPage-D0B9CdNo.js","assets/Search-wiijyIeu.js","assets/Delete-B2j1UcE8.js","assets/index-j8Uq5XuX.js","assets/url-join-5MzXbhiU.js","assets/uniqBy-DA6z7OdT.js","assets/react-BW7E7-P9.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{at as d2,j as o,aG as se,cJ as g0,aK as A,fw as X1,aJ as je,aE as $e,aF as Fe,T as G,r as R,aI as m1,aL as u2,aM as Ue,aN as qe,cP as p2,fx as l1,X as Se,Y as ke,B as z,n as Oe,P as h,$ as We,G as X,e as v1,u as te,aP as we,aY as Ve,bx as n1,a1 as e1,L as ue,bL as b0,a as ve,aC as ge,K as h2,t as $,Z as ae,dw as f2,aa as ye,c as pe,I as x2,bW as g1,ch as j0,cE as m2,cN as He,cO as w0,aj as v2,d2 as g2,cI as Je,bF as re,c3 as Qe,fj as b2,a8 as J1,b as ne,bm as R0,ec as C0,ai as b1,bn as y0,co as z0,aT as Ae,aS as j2,a3 as S0,fy as Q1,f7 as Le,bk as w2,au as k0,cV as R2,l as C2,aB as y2,aq as z2,ar as i1}from"./index-CEaTcEQs.js";import{d as j1}from"./Add-D8jHDZuh.js";import{d as I0}from"./Delete-B2j1UcE8.js";import{d as S2}from"./Error-B4vCt6tb.js";import{D as w1}from"./index-BcUb67P2.js";import{T as M0,b as k2}from"./index-Bsh1JZ9i.js";import{C as R1}from"./confirm-Bz_GmEiI.js";import{u as s1}from"./session-BG5hlQoH.js";import{W as Y1}from"./did-address-BIfBoDiQ.js";import{B as C1,d as I2}from"./ChevronRight-j0-gJxyM.js";import{S as be}from"./shorten-label-DZrPE8HL.js";import{A as P0}from"./Avatar-BIWwirOj.js";import{d as M2}from"./Download-DP_lDlx2.js";import{d as P2}from"./QuestionMarkCircle-TnBpzaSI.js";import{b as L2,c as Z1,T as T2}from"./index-CJPYlJzX.js";import{_ as Pe}from"./useSetState-Cz7xEaUb.js";import{c as y1}from"./index-DZIjChbd.js";import{C as u1,F as p1}from"./FormControlLabel-BmopTtvW.js";import{A as L0}from"./Alert-CRD24aa1.js";import{p as t1}from"./index-HqFqdQ4r.js";import"./api-DHCXgKlp.js";import{i as N2}from"./index-BNFvQJs8.js";import{d as V2}from"./ExpandMore-IE6fvawl.js";import{d as D2}from"./OpenInNew-CJl5exgf.js";import{u as T0}from"./useThemeProps-B-j4MceL.js";import{u as _2}from"./useSlotProps-4qJAhdYR.js";import{d as E2}from"./DeleteOutline-C2h-KiXe.js";import{c as B2,A as N0,u as A2,S as O2,U as H2}from"./item-B-EBHzLe.js";import{d as $2}from"./ArrowDropDown-CFc0zow6.js";import{f as Ne}from"./format-error-BOzcbfGa.js";import{B as h1}from"./ButtonGroup-DcU8GHuP.js";import{T as Te}from"./TextField-x4CoNOlz.js";import{I as z1}from"./InputAdornment-DXkRELYA.js";import{C as F2}from"./click-to-copy-Cy7g0c_W.js";import{d as U2}from"./Launch-DhHbLKKF.js";import{L as q2}from"./MoreVert-MUbtAQHv.js";import{a as W2}from"./ListItemText-BR6T5ZDu.js";import{S as e0}from"./index-BQQSQ70k.js";import{M as G2}from"./index-BbBRjIRQ.js";import{r as K2}from"./index-B8cOlg3J.js";import{d as X2}from"./Done-B-JT0RXC.js";import{c as V0,d as D0,b as J2,S as Q2,a as Y2}from"./Stepper-DuAngjIl.js";import{S as Z2}from"./Stack-CYabuVI4.js";import{R as et,a as t0}from"./RadioGroup-C6M_sifl.js";import"./toPropertyKey-PLuKRk1e.js";import"./index-DgFd31_6.js";import"./redux-DN6s-mdl.js";import"./ViewColumn-8HGbbav-.js";import"./FormControl-Chtq9AE7.js";import"./useFormControl-BA79DoOc.js";import"./FormGroup-C54kQ9N4.js";import"./Select-CIDtym3x.js";import"./InputLabel-DMWY4sIp.js";import"./LastPage-D0B9CdNo.js";import"./Toolbar-DlYXwq_K.js";import"./Search-wiijyIeu.js";import"./index-CE9qCuXL.js";import"./DialogContentText-D5Xxal_F.js";import"./Link-CYqMveft.js";import"./useSlot-CDa1PttK.js";import"./jss-plugin-props-sort.esm-Bm1tsMYs.js";const tt=d2(o.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),ot=["slots","slotProps"],lt=se(g0)(({theme:e})=>A({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`},e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":A({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":A({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:X1(e.palette.grey[200],.12)}:{backgroundColor:X1(e.palette.grey[600],.12)})})),nt=se(tt)({width:24,height:16});function st(e){const{slots:t={},slotProps:l={}}=e,s=je(e,ot),r=e;return o.jsx("li",{children:o.jsx(lt,A({focusRipple:!0},s,{ownerState:r,children:o.jsx(nt,A({as:t.CollapsedIcon,ownerState:r},l.collapsedIcon))}))})}function rt(e){return Fe("MuiBreadcrumbs",e)}const it=$e("MuiBreadcrumbs",["root","ol","li","separator"]),at=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],ct=e=>{const{classes:t}=e;return qe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},rt,t)},dt=se(G,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${it.li}`]:t.li},t.root]})({}),ut=se("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),pt=se("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function ht(e,t,l,s){return e.reduce((r,c,i)=>(i<e.length-1?r=r.concat(c,o.jsx(pt,{"aria-hidden":!0,className:t,ownerState:s,children:l},`separator-${i}`)):r.push(c),r),[])}const _0=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiBreadcrumbs"}),{children:r,className:c,component:i="nav",slots:a={},slotProps:u={},expandText:f="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:g=1,maxItems:y=8,separator:p="/"}=s,d=je(s,at),[m,b]=R.useState(!1),v=A({},s,{component:i,expanded:m,expandText:f,itemsAfterCollapse:x,itemsBeforeCollapse:g,maxItems:y,separator:p}),C=ct(v),S=u2({elementType:a.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),N=R.useRef(null),T=I=>{const U=()=>{b(!0);const V=N.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return g+x>=I.length?I:[...I.slice(0,g),o.jsx(st,{"aria-label":f,slots:{CollapsedIcon:a.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:U},"ellipsis"),...I.slice(I.length-x,I.length)]},P=R.Children.toArray(r).filter(I=>R.isValidElement(I)).map((I,U)=>o.jsx("li",{className:C.li,children:I},`child-${U}`));return o.jsx(dt,A({ref:l,component:i,color:"text.secondary",className:Ue(C.root,c),ownerState:v},d,{children:o.jsx(ut,{className:C.ol,ref:N,ownerState:v,children:ht(m||y&&P.length<=y?P:T(P),C.separator,p,v)})}))});function ft(e){return Fe("MuiStepButton",e)}const o0=$e("MuiStepButton",["root","horizontal","vertical","touchRipple"]),xt=["children","className","icon","optional"],mt=e=>{const{classes:t,orientation:l}=e;return qe({root:["root",l],touchRipple:["touchRipple"]},ft,t)},vt=se(g0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${o0.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>A({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${o0.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),gt=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepButton"}),{children:r,className:c,icon:i,optional:a}=s,u=je(s,xt),{disabled:f,active:x}=R.useContext(V0),{orientation:g}=R.useContext(D0),y=A({},s,{orientation:g}),p=mt(y),d={icon:i,optional:a},m=p2(r,["StepLabel"])?R.cloneElement(r,d):o.jsx(J2,A({},d,{children:r}));return o.jsx(vt,A({focusRipple:!0,disabled:f,TouchRippleProps:{className:p.touchRipple},className:Ue(p.root,c),ref:l,ownerState:y,"aria-current":x?"step":void 0},u,{children:m}))});function bt(e){return Fe("MuiStepContent",e)}$e("MuiStepContent",["root","last","transition"]);const jt=["children","className","TransitionComponent","transitionDuration","TransitionProps"],wt=e=>{const{classes:t,last:l}=e;return qe({root:["root",l&&"last"],transition:["transition"]},bt,t)},Rt=se("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.last&&t.last]}})(({ownerState:e,theme:t})=>A({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:t.vars?`1px solid ${t.vars.palette.StepContent.border}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[600]}`},e.last&&{borderLeft:"none"})),Ct=se(l1,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),yt=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepContent"}),{children:r,className:c,TransitionComponent:i=l1,transitionDuration:a="auto",TransitionProps:u}=s,f=je(s,jt);R.useContext(D0);const{active:x,last:g,expanded:y}=R.useContext(V0),p=A({},s,{last:g}),d=wt(p);let m=a;return a==="auto"&&!i.muiSupportAuto&&(m=void 0),o.jsx(Rt,A({className:Ue(d.root,c),ref:l,ownerState:p},f,{children:o.jsx(Ct,A({as:i,in:x||y,className:d.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:r}))}))});var S1={},zt=ke;Object.defineProperty(S1,"__esModule",{value:!0});var E0=S1.default=void 0,St=zt(Se()),kt=o;E0=S1.default=(0,St.default)((0,kt.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var k1={},It=ke;Object.defineProperty(k1,"__esModule",{value:!0});var B0=k1.default=void 0,Mt=It(Se()),Pt=o;B0=k1.default=(0,Mt.default)((0,Pt.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var I1={},Lt=ke;Object.defineProperty(I1,"__esModule",{value:!0});var A0=I1.default=void 0,Tt=Lt(Se()),Nt=o;A0=I1.default=(0,Tt.default)((0,Nt.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function Ie({size:e,...t}){return o.jsx(z,{display:"flex",mt:4,...t,children:o.jsx(Oe,{size:e})})}Ie.propTypes={size:h.number};Ie.defaultProps={size:24};function M1({did:e,projectId:t,title:l,logo:s,describe:r}){const i=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${s}`,[a,u]=R.useState(!1),f=We(x=>x.breakpoints.down("md"));return o.jsxs(z,{sx:{display:"flex",flexDirection:"row",color:a?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[o.jsx(P0,{sx:{borderRadius:1},src:i}),o.jsxs(z,{children:[o.jsx(be,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:l||"/"}),o.jsx(be,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||a?"primary.main":"grey.700"},children:r||"/"})]})]})}M1.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function P1({initUrl:e}){const t=v1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:s,locale:r}=te(),{api:c}=we(),{api:i}=s1(),[a,u]=R.useState(!0),{blocklet:f}=Ve(),[x,g]=R.useState(null),[y,p]=R.useState(!1),d=We(k=>k.breakpoints.down("xl")),{componentDid:m=""}=n1(),[b,v]=R.useState(null),C=()=>{c.getProjects({input:{did:f.meta.did,componentDid:m,tenantScope:l}}).then(k=>{const L=(k==null?void 0:k.projects)||[];u(!1),v(L)}).catch(k=>{u(!1),$.error(k.message)})},S=()=>{t(`${X.UNOWNED_DID}/create/none`,{replace:!0})},N=k=>{g(k)},T=()=>{u(!1),p(!0)},P=()=>{p(!1),g(null)},I=k=>{$.error(k.message),p(!1),g(null)},U=k=>{if(!(k!=null&&k.deleted)){$.error("Delete project failed");return}C(),p(!1),g(null)};if(R.useEffect(()=>{C()},[]),!b&&a)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(Ie,{})});if(!b)return null;if(!b.length)return o.jsxs(z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:s("blocklet.publish.blockletEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:s("blocklet.publish.createBlockletTip")}),o.jsx(e1,{onClick:S,variant:"contained",children:s("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:k=>{const L=b[k];return o.jsx(ue,{to:`${L.id}`,children:o.jsx(M1,{did:f.meta.did,projectId:L.id,logo:L.blockletLogo,title:L.blockletTitle,describe:L.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:k=>k?o.jsx(M0,{type:"success",children:k}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:k=>k?o.jsx(Y1,{size:14,compact:!0,responsive:!1,did:k}):null}},d||m?null:{label:s("common.createdBy"),name:"createdBy",options:{customBodyRender:k=>k?o.jsx(Y1,{onClick:()=>{t(`/.well-known/service/admin/members?did=${k}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:k}):null}},d||m?null:{label:s("common.scope"),name:"componentDid",options:{customBodyRender:k=>{const L=(f.children||[]).find(E=>E.meta.did===k);return L?o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:14,blocklet:L,ancestors:[f]}),o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:L.meta.title})]},k):""}}},d||l?null:{label:s("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:k=>o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(be,{children:k})})}},{label:s("common.updatedAt"),name:"updatedAt",options:{customBodyRender:k=>o.jsx(b0,{value:Number(k),locale:r})}},{label:s("common.actions"),name:"actions",options:{customBodyRenderLite:k=>{const L=b[k];return o.jsxs(z,{display:"flex",children:[o.jsx(ue,{to:`${L.id}/new-release/${L.lastReleaseId}`,children:o.jsx(ve,{title:s("blocklet.publish.createRelease"),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"create",children:o.jsx(E0,{style:{fontSize:18}})})})}),!!L.lastReleaseId&&o.jsx(ve,{title:s("blocklet.publish.viewLastRelease",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"secondary","aria-label":"create",children:o.jsx(ue,{style:{display:"flex"},to:`${L.id}/view/${L.lastReleaseId}`,children:o.jsx(B0,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:s("blocklet.publish.delete",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"delete",onClick:()=>N(L),children:o.jsx(I0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),M=y?o.jsx(h2,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:r,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:U,onError:I,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:s("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:s("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:s("blocklet.publish.deleteProject.confirm"),success:s("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(Vt,{children:[o.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(z,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(z,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("common.blockletStudio")}),o.jsx(ve,{title:s("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(A0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(e1,{onClick:S,variant:"contained",children:[o.jsx(j1,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.publish.createBlocklet")]})]}),o.jsx(z,{mt:3}),o.jsx(w1,{className:"main-table",locale:r,data:b,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(R1,{title:`${s("common.delete")} ${x.blockletTitle}`,description:s("blocklet.publish.deleteProject.description"),confirm:s("common.confirm"),onConfirm:T,onCancel:()=>g(null),children:o.jsx(z,{sx:{marginTop:2},children:[s("blocklet.publish.deleteProject.tip1"),s("blocklet.publish.deleteProject.tip2"),s("blocklet.publish.deleteProject.tip3")].map(k=>o.jsxs(z,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(S2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(G,{component:"span",variant:"inherit",color:"text.secondary",children:k})]}))})}),M]})}P1.propTypes={initUrl:h.object};P1.defaultProps={initUrl:null};const Vt=ae(z)`
|
|
3
3
|
.main-table > div:first-child {
|
|
4
4
|
display: none;
|
|
5
5
|
}
|
|
@@ -133,7 +133,7 @@ import{at as d2,j as o,aG as se,cJ as g0,aK as A,fw as X1,aJ as je,aE as $e,aF a
|
|
|
133
133
|
background: #fff;
|
|
134
134
|
z-index: 10;
|
|
135
135
|
}
|
|
136
|
-
`,c0="lastWantToConnectStoreId";function Wl(e){var a,u;const[t,l]=R.useState(null),{session:s}=s1(),r=R.useCallback(f=>{l(f),localStorage.setItem(c0,f==null?void 0:f.id)},[l]),c=R.useMemo(()=>{var y,p,d,m;const f=localStorage.getItem(c0),x=f?(((y=e==null?void 0:e.settings)==null?void 0:y.storeList)||[]).find(b=>b.id===f):null;if(x)return x;let g=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(b=>{var v;return!(b.id!==X.BLOCKLET_STORE.id||b.scope&&b.scope!=="studio"&&b.scope!==((v=s==null?void 0:s.user)==null?void 0:v.did))});return g||(g=(m=(d=e==null?void 0:e.settings)==null?void 0:d.storeList)==null?void 0:m[0]),g},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(u=s==null?void 0:s.user)==null?void 0:u.did]);return[t||c||{},r]}const d1={};async function K0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:s=4e3,timerKey:r=""}){d1[r]&&clearTimeout(d1[r]),await new Promise(a=>setTimeout(a,s));const c=Date.now(),i=async(a,u)=>{try{const f=await e();a(f)}catch(f){Date.now()-c>l?u(f):r?d1[r]=setTimeout(()=>i(a,u),t):setTimeout(()=>i(a,u),t)}};return new Promise(i)}function Gl(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Kl(e,{did:t,projectId:l,messageId:s}){return K0(async()=>{var c;const r=await e.getProject({input:{did:t,projectId:l,messageId:s}});if(!((c=r==null?void 0:r.project)!=null&&c.blockletDid))throw new Error("Connected store not found");return r.project.blockletDid},{timerKey:"connect-studio"})}function Xl(e,{did:t,projectId:l,storeId:s}){return K0(async()=>{var i,a;const r=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((a=(i=r==null?void 0:r.project)==null?void 0:i.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!r.project.connectedStores.find(u=>u.storeId===s))throw new Error("Connected store not found")},{timerKey:`connect-store-${s}`})}const X0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:s})=>{var i,a;const r=e?(i=l==null?void 0:l.meta)==null?void 0:i.did:t==null?void 0:t.did;let c=e?((a=l==null?void 0:l.settings)==null?void 0:a.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(c)||(c=[]),c=c.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===s),{teamDid:r,storeList:c}};function H1({blocklet:e,store:t={},onChangeStore:l,onClick:s,disabled:r,loading:c,componentDid:i}){var L,E,B;const{t:a}=te(),{session:u}=s1(),{api:f,info:x,inService:g}=we(),y=Ve(),[p,d]=R.useState(!1),m=R.useRef(null),[b,v]=R.useState(!1),[C,S]=R.useState(null),N=O=>{l(O),d(!1)},T=()=>{d(!p)},P=O=>{m.current&&m.current.contains(O.target)||d(!1)},I=()=>{v(!0)},U=()=>{v(!1)},V=async()=>{var O;if(C)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await((O=y==null?void 0:y.actions)==null?void 0:O.refreshBlocklet())}catch(K){$.error(`Remove Blocklet Store Error: ${Ne(K)}`)}finally{S(null)}},{storeList:M}=X0({fromBlocklet:g,blocklet:e,nodeInfo:x,componentDid:i,userDid:(L=u==null?void 0:u.user)==null?void 0:L.did}),k=(E=e==null?void 0:e.meta)==null?void 0:E.did;return o.jsxs(o.Fragment,{children:[o.jsxs(h1,{disabled:r,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(ne,{onClick:s,children:[c&&o.jsx(Oe,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${t.name||""}`]}),o.jsx(ne,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:T,children:o.jsx($2,{})})]}),o.jsx(R0,{sx:{zIndex:10},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:O})=>o.jsx(C0,{...O,style:{transformOrigin:"center top"},children:o.jsx(b1,{children:o.jsx(y0,{onClickAway:P,children:o.jsxs(z0,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[M==null?void 0:M.map(K=>{var J;return o.jsxs(Ae,{selected:K.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>N(K),children:[o.jsxs(z,{children:[o.jsx(be,{sx:{fontSize:"16px"},maxLength:24,children:K.name}),o.jsx(be,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:K.url})]}),B2({store:K,userDid:(J=u==null?void 0:u.user)==null?void 0:J.did})&&o.jsx(ge,{sx:{ml:1},onClick:W=>{W.preventDefault(),W.stopPropagation(),S(K)},children:o.jsx(re,{icon:"ic:outline-delete"})})]},K.url)}),o.jsx(j2,{}),o.jsxs(Ae,{onClick:I,children:[o.jsx(j1,{font:!0}),o.jsx(G,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),b&&o.jsx(N0,{hiddenChildren:!0,open:!0,onClose:U,teamDid:k,storeList:M,scope:"studio",onAdd:(B=y==null?void 0:y.actions)==null?void 0:B.refreshBlocklet}),C&&o.jsx(R1,{displayError:!0,title:`${a("common.delete")} ${C.name}`,description:a("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:a("common.confirm"),onConfirm:V,onCancel:()=>S(null)})]})}H1.propTypes={store:h.object,blocklet:h.object,onChangeStore:h.func.isRequired,onClick:h.func.isRequired,loading:h.bool.isRequired,disabled:h.bool.isRequired,componentDid:h.string.isRequired,projectType:h.string.isRequired,getData:h.func.isRequired};H1.defaultProps={store:null,blocklet:null};const d0=[".webp",".jpg",".jpeg",".png",".gif",".svg"],u0=1024*1024*10,p0=R.lazy(()=>S0(()=>import("./react-iXxw1Yhu.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48])).then(e=>({default:e.Uploader})));function J0({projectId:e,readOnly:t,loading:l,blocklet:s,params:r,setParams:c,paramsErrTip:i,setParamsErrTip:a,setLoading:u,initUrl:f,initLogoUrl:x,setInitLogoUrl:g,componentDid:y}){const{t:p}=te(),{api:d}=we(),m=v1(),b=R.useRef(null),v=R.useRef(null),[C,S]=Wl(s),N=A2({messageType:"connect-store-message",onOpen:()=>u(!0),onClose:()=>u(!1)}),T=async L=>{const E=setTimeout(()=>{u(!1)},2e4),B=await Kl(d,L);u(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:y},"*"),m(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${B}/create`),{replace:!0})},P=()=>{if(!r.blockletTitle){$.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(C!=null&&C.url)){$.error(p("blocklet.publish.noStoreSelected"));return}const L=Gl();N(async(E,B)=>{var O,K,J;try{const W=await d.connectByStudio({input:{did:(O=s==null?void 0:s.meta)==null?void 0:O.did,blockletTitle:r==null?void 0:r.blockletTitle,storeUrl:C.url,storeId:C.id,storeName:C.name,type:((K=r==null?void 0:r.blockletComponents)==null?void 0:K.length)>0?"pack":"resource",componentDid:y,messageId:L,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(W!=null&&W.url)){$.error("failed to connect to store");return}B(W.url),T({did:(J=s==null?void 0:s.meta)==null?void 0:J.did,projectId:"",messageId:L})}catch(W){const Z=Ne(W);$.error(Z),u(!1)}})},I=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/logo/upload`,U=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/screenshot/upload`,V=r!=null&&r.blockletLogo?`${I}/${r.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,M=((r==null?void 0:r.blockletScreenshots)||[]).filter(Boolean).map(L=>`${U}/${L}`),k=()=>t?!1:!e||e===X.UNOWNED_DID?($.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0;return o.jsxs(Jl,{children:[o.jsx(z,{display:"flex",className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:r.blockletTitle||"",onChange:L=>{a({blockletTitle:""}),c({blockletTitle:L.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Te,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===X.UNOWNED_DID&&o.jsx(z1,{position:"end",children:o.jsx(H1,{blocklet:s,store:C,componentDid:y,onChangeStore:S,disabled:!r.blockletTitle||t||l,loading:l,onClick:P})})},error:!!i.projectId,helperText:i.projectId||"",value:e===X.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletDescription||"",onChange:L=>{a({blockletDescription:""}),c({blockletDescription:L.target.value})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(z,{display:"flex",children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.logo")}),o.jsx(z,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(P0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||V,onClick:()=>{k()&&b.current.open()}})})]}),o.jsxs(z,{display:"flex",mt:3,children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.screenshot")}),o.jsxs(z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[M.map((L,E)=>o.jsxs(z,{className:"screenshot",children:[o.jsx("img",{alt:"screenshot",src:L}),!t&&o.jsx(ge,{className:"action",onClick:()=>{c(B=>{const O=[...B.blockletScreenshots];return O.splice(E,1),{...B,blockletScreenshots:O}})},children:o.jsx(E2,{})})]},L)),M.length<5&&o.jsx(z,{sx:{width:200,height:140,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{k()&&v.current.open()},children:"+"})]})]})]})}),o.jsxs(R.Suspense,{fallback:o.jsx(Ie,{}),children:[o.jsx(p0,{ref:b,popup:!0,onUploadFinish:L=>{c({blockletLogo:L.data.filename}),g(""),b.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:I,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:d0,maxFileSize:u0,maxNumberOfFiles:1}}},"uploader-logo"),o.jsx(p0,{ref:v,popup:!0,onUploadFinish:L=>{c(E=>{var O;const B=E.blockletScreenshots||[];return B.push((O=L.data)==null?void 0:O.filename),{...E,blockletScreenshots:B}}),v.current.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:U,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:d0,maxFileSize:u0,maxNumberOfFiles:5-M.length}}},"uploader-screenshot")]})]})}J0.propTypes={projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,setLoading:h.func.isRequired,initUrl:h.object.isRequired,componentDid:h.isRequired,initLogoUrl:h.string.isRequired,setInitLogoUrl:h.func.isRequired};const Jl=ae.div`
|
|
136
|
+
`,c0="lastWantToConnectStoreId";function Wl(e){var a,u;const[t,l]=R.useState(null),{session:s}=s1(),r=R.useCallback(f=>{l(f),localStorage.setItem(c0,f==null?void 0:f.id)},[l]),c=R.useMemo(()=>{var y,p,d,m;const f=localStorage.getItem(c0),x=f?(((y=e==null?void 0:e.settings)==null?void 0:y.storeList)||[]).find(b=>b.id===f):null;if(x)return x;let g=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(b=>{var v;return!(b.id!==X.BLOCKLET_STORE.id||b.scope&&b.scope!=="studio"&&b.scope!==((v=s==null?void 0:s.user)==null?void 0:v.did))});return g||(g=(m=(d=e==null?void 0:e.settings)==null?void 0:d.storeList)==null?void 0:m[0]),g},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(u=s==null?void 0:s.user)==null?void 0:u.did]);return[t||c||{},r]}const d1={};async function K0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:s=4e3,timerKey:r=""}){d1[r]&&clearTimeout(d1[r]),await new Promise(a=>setTimeout(a,s));const c=Date.now(),i=async(a,u)=>{try{const f=await e();a(f)}catch(f){Date.now()-c>l?u(f):r?d1[r]=setTimeout(()=>i(a,u),t):setTimeout(()=>i(a,u),t)}};return new Promise(i)}function Gl(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Kl(e,{did:t,projectId:l,messageId:s}){return K0(async()=>{var c;const r=await e.getProject({input:{did:t,projectId:l,messageId:s}});if(!((c=r==null?void 0:r.project)!=null&&c.blockletDid))throw new Error("Connected store not found");return r.project.blockletDid},{timerKey:"connect-studio"})}function Xl(e,{did:t,projectId:l,storeId:s}){return K0(async()=>{var i,a;const r=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((a=(i=r==null?void 0:r.project)==null?void 0:i.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!r.project.connectedStores.find(u=>u.storeId===s))throw new Error("Connected store not found")},{timerKey:`connect-store-${s}`})}const X0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:s})=>{var i,a;const r=e?(i=l==null?void 0:l.meta)==null?void 0:i.did:t==null?void 0:t.did;let c=e?((a=l==null?void 0:l.settings)==null?void 0:a.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(c)||(c=[]),c=c.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===s),{teamDid:r,storeList:c}};function H1({blocklet:e,store:t={},onChangeStore:l,onClick:s,disabled:r,loading:c,componentDid:i}){var L,E,B;const{t:a}=te(),{session:u}=s1(),{api:f,info:x,inService:g}=we(),y=Ve(),[p,d]=R.useState(!1),m=R.useRef(null),[b,v]=R.useState(!1),[C,S]=R.useState(null),N=O=>{l(O),d(!1)},T=()=>{d(!p)},P=O=>{m.current&&m.current.contains(O.target)||d(!1)},I=()=>{v(!0)},U=()=>{v(!1)},V=async()=>{var O;if(C)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await((O=y==null?void 0:y.actions)==null?void 0:O.refreshBlocklet())}catch(K){$.error(`Remove Blocklet Store Error: ${Ne(K)}`)}finally{S(null)}},{storeList:M}=X0({fromBlocklet:g,blocklet:e,nodeInfo:x,componentDid:i,userDid:(L=u==null?void 0:u.user)==null?void 0:L.did}),k=(E=e==null?void 0:e.meta)==null?void 0:E.did;return o.jsxs(o.Fragment,{children:[o.jsxs(h1,{disabled:r,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(ne,{onClick:s,children:[c&&o.jsx(Oe,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${t.name||""}`]}),o.jsx(ne,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:T,children:o.jsx($2,{})})]}),o.jsx(R0,{sx:{zIndex:10},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:O})=>o.jsx(C0,{...O,style:{transformOrigin:"center top"},children:o.jsx(b1,{children:o.jsx(y0,{onClickAway:P,children:o.jsxs(z0,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[M==null?void 0:M.map(K=>{var J;return o.jsxs(Ae,{selected:K.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>N(K),children:[o.jsxs(z,{children:[o.jsx(be,{sx:{fontSize:"16px"},maxLength:24,children:K.name}),o.jsx(be,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:K.url})]}),B2({store:K,userDid:(J=u==null?void 0:u.user)==null?void 0:J.did})&&o.jsx(ge,{sx:{ml:1},onClick:W=>{W.preventDefault(),W.stopPropagation(),S(K)},children:o.jsx(re,{icon:"ic:outline-delete"})})]},K.url)}),o.jsx(j2,{}),o.jsxs(Ae,{onClick:I,children:[o.jsx(j1,{font:!0}),o.jsx(G,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),b&&o.jsx(N0,{hiddenChildren:!0,open:!0,onClose:U,teamDid:k,storeList:M,scope:"studio",onAdd:(B=y==null?void 0:y.actions)==null?void 0:B.refreshBlocklet}),C&&o.jsx(R1,{displayError:!0,title:`${a("common.delete")} ${C.name}`,description:a("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:a("common.confirm"),onConfirm:V,onCancel:()=>S(null)})]})}H1.propTypes={store:h.object,blocklet:h.object,onChangeStore:h.func.isRequired,onClick:h.func.isRequired,loading:h.bool.isRequired,disabled:h.bool.isRequired,componentDid:h.string.isRequired,projectType:h.string.isRequired,getData:h.func.isRequired};H1.defaultProps={store:null,blocklet:null};const d0=[".webp",".jpg",".jpeg",".png",".gif",".svg"],u0=1024*1024*10,p0=R.lazy(()=>S0(()=>import("./react-DJuQ-Z9X.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48])).then(e=>({default:e.Uploader})));function J0({projectId:e,readOnly:t,loading:l,blocklet:s,params:r,setParams:c,paramsErrTip:i,setParamsErrTip:a,setLoading:u,initUrl:f,initLogoUrl:x,setInitLogoUrl:g,componentDid:y}){const{t:p}=te(),{api:d}=we(),m=v1(),b=R.useRef(null),v=R.useRef(null),[C,S]=Wl(s),N=A2({messageType:"connect-store-message",onOpen:()=>u(!0),onClose:()=>u(!1)}),T=async L=>{const E=setTimeout(()=>{u(!1)},2e4),B=await Kl(d,L);u(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:y},"*"),m(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${B}/create`),{replace:!0})},P=()=>{if(!r.blockletTitle){$.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(C!=null&&C.url)){$.error(p("blocklet.publish.noStoreSelected"));return}const L=Gl();N(async(E,B)=>{var O,K,J;try{const W=await d.connectByStudio({input:{did:(O=s==null?void 0:s.meta)==null?void 0:O.did,blockletTitle:r==null?void 0:r.blockletTitle,storeUrl:C.url,storeId:C.id,storeName:C.name,type:((K=r==null?void 0:r.blockletComponents)==null?void 0:K.length)>0?"pack":"resource",componentDid:y,messageId:L,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(W!=null&&W.url)){$.error("failed to connect to store");return}B(W.url),T({did:(J=s==null?void 0:s.meta)==null?void 0:J.did,projectId:"",messageId:L})}catch(W){const Z=Ne(W);$.error(Z),u(!1)}})},I=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/logo/upload`,U=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/screenshot/upload`,V=r!=null&&r.blockletLogo?`${I}/${r.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,M=((r==null?void 0:r.blockletScreenshots)||[]).filter(Boolean).map(L=>`${U}/${L}`),k=()=>t?!1:!e||e===X.UNOWNED_DID?($.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0;return o.jsxs(Jl,{children:[o.jsx(z,{display:"flex",className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:r.blockletTitle||"",onChange:L=>{a({blockletTitle:""}),c({blockletTitle:L.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Te,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===X.UNOWNED_DID&&o.jsx(z1,{position:"end",children:o.jsx(H1,{blocklet:s,store:C,componentDid:y,onChangeStore:S,disabled:!r.blockletTitle||t||l,loading:l,onClick:P})})},error:!!i.projectId,helperText:i.projectId||"",value:e===X.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletDescription||"",onChange:L=>{a({blockletDescription:""}),c({blockletDescription:L.target.value})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(z,{display:"flex",children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.logo")}),o.jsx(z,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(P0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||V,onClick:()=>{k()&&b.current.open()}})})]}),o.jsxs(z,{display:"flex",mt:3,children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.screenshot")}),o.jsxs(z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[M.map((L,E)=>o.jsxs(z,{className:"screenshot",children:[o.jsx("img",{alt:"screenshot",src:L}),!t&&o.jsx(ge,{className:"action",onClick:()=>{c(B=>{const O=[...B.blockletScreenshots];return O.splice(E,1),{...B,blockletScreenshots:O}})},children:o.jsx(E2,{})})]},L)),M.length<5&&o.jsx(z,{sx:{width:200,height:140,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{k()&&v.current.open()},children:"+"})]})]})]})}),o.jsxs(R.Suspense,{fallback:o.jsx(Ie,{}),children:[o.jsx(p0,{ref:b,popup:!0,onUploadFinish:L=>{c({blockletLogo:L.data.filename}),g(""),b.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:I,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:d0,maxFileSize:u0,maxNumberOfFiles:1}}},"uploader-logo"),o.jsx(p0,{ref:v,popup:!0,onUploadFinish:L=>{c(E=>{var O;const B=E.blockletScreenshots||[];return B.push((O=L.data)==null?void 0:O.filename),{...E,blockletScreenshots:B}}),v.current.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:U,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:d0,maxFileSize:u0,maxNumberOfFiles:5-M.length}}},"uploader-screenshot")]})]})}J0.propTypes={projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,setLoading:h.func.isRequired,initUrl:h.object.isRequired,componentDid:h.isRequired,initLogoUrl:h.string.isRequired,setInitLogoUrl:h.func.isRequired};const Jl=ae.div`
|
|
137
137
|
margin-top: 24px;
|
|
138
138
|
.screenshot {
|
|
139
139
|
margin-bottom: 16px;
|
|
@@ -178,7 +178,7 @@ import{at as d2,j as o,aG as se,cJ as g0,aK as A,fw as X1,aJ as je,aE as $e,aF a
|
|
|
178
178
|
padding-bottom: 12px;
|
|
179
179
|
border-bottom: ${({theme:e})=>`1px solid ${e.palette.divider}`};
|
|
180
180
|
}
|
|
181
|
-
`;function o2({text:e}){return e?o.jsx(G2,{wrapperElement:{"data-color-mode":"light"},source:e,rehypePlugins:[[K2,{target:"_blank"}]]}):o.jsx(ze,{Icon:Ge})}o2.propTypes={text:h.string.isRequired};function l2({params:e,setParams:t,paramsErrTip:l,loading:s,setParamsErrTip:r,readOnly:c}){var x;const{t:i}=te(),[a,u]=R.useState(c?"preview":"write"),f=(g,y)=>{u(y)};return o.jsxs(z,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(z,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(G,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(L2,{value:a,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(Z1,{value:"write",label:"Write"}),o.jsx(Z1,{value:"preview",label:"Preview"})]})]}),o.jsx(z,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Te,{disabled:s||c,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:o.jsxs(z1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",ye.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{r({blockletIntroduction:""}),t({blockletIntroduction:g.target.value.slice(0,ye.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(z,{display:a==="preview"?"block":"none",mt:3,children:o.jsx(o2,{text:e.blockletIntroduction||""})})]})}l2.propTypes={params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired};var U1={},r3=ke;Object.defineProperty(U1,"__esModule",{value:!0});var n2=U1.default=void 0,i3=r3(Se()),f0=o;n2=U1.default=(0,i3.default)([(0,f0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,f0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function q1({step:e,ok:t,active:l,error:s}){let r="grey.500",c=e+1;return t&&(c=o.jsx(X2,{sx:{fontSize:18,margin:0},color:"white"})),s||!t&&l>e?(r="error.main",c=o.jsx(n2,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(r="primary.main"),o.jsx(z,{width:24,height:24,bgcolor:r,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:c})}q1.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};q1.defaultProps={step:0,ok:!1,active:0,error:""};function s2({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:s,params:r,loading:c,paramsErrTip:i,viewMode:a,projectId:u}){const{t:f}=te(),x=()=>{l(d=>d+1)},g=()=>{l(d=>d-1)},y=d=>d===0?(i==null?void 0:i.blockletTitle)||(i==null?void 0:i.projectId)||(i==null?void 0:i.blockletDescription):d===2?i==null?void 0:i.blockletResource:d>=4?(i==null?void 0:i.blockletVersion)||(i==null?void 0:i.note):"",p=a||Y0({hasSelectedResources:s,params:r,projectId:u,t:f})===null;return o.jsxs(z,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(Q2,{activeStep:t,orientation:"vertical",children:e.map((d,m)=>{const b={},v=c||!n3({hasSelectedResources:s,params:r,projectId:u,step:m,t:f}),C=c?"":y(m);return C&&(b.optional=o.jsx(G,{variant:"caption",color:"error",children:C}),b.error=!0),o.jsxs(Y2,{children:[o.jsx(gt,{icon:o.jsx(q1,{error:C,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...b,children:o.jsx(G,{fontSize:"14px",fontWeight:"500",color:C||!v&&t>m?"error.main":"inherit",children:d.label})}),o.jsxs(yt,{children:[o.jsx(G,{fontSize:12,children:d.description}),!p&&o.jsx(z,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(ne,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:C||!v,children:f("common.continue")}),m>0&&o.jsx(ne,{disabled:m===0,onClick:g,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},d.label)})}),t>=e.length-1&&o.jsx(b1,{square:!0,elevation:0,sx:{p:3},children:o.jsx(G,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}s2.propTypes={steps:h.array.isRequired,activeStep:h.number.isRequired,setActiveStep:h.func.isRequired,params:h.object.isRequired,viewMode:h.string.isRequired,loading:h.bool.isRequired,projectId:h.string.isRequired,hasSelectedResources:h.bool.isRequired,paramsErrTip:h.shape({projectId:h.string,blockletVersion:h.string,blockletTitle:h.string,blockletDescription:h.string,note:h.string,blockletResource:h.string}).isRequired};const a3=[".zip",".gz"],c3=1024*1024*100,d3=R.lazy(()=>S0(()=>import("./react-iXxw1Yhu.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48])).then(e=>({default:e.Uploader})));function W1({app:e,projectId:t,readOnly:l,params:s,setParams:r,setParamsErrTip:c,error:i}){const{t:a}=te(),u=R.useRef(null),f=()=>l?!1:!t||t===X.UNOWNED_DID?($.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(z,{sx:{mt:3},children:[o.jsx(G,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),o.jsxs(Z2,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!s.uploadedResource&&o.jsx(G,{component:"a",href:`${x}/params.uploadedResource`,children:s.uploadedResource}),!l&&o.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var g;f()&&((g=u.current)==null||g.open())},children:s.uploadedResource?a("common.change"):a("common.upload")})]}),o.jsx(R.Suspense,{fallback:o.jsx(Ie,{}),children:o.jsx(d3,{ref:u,popup:!0,onUploadFinish:g=>{var y;r({uploadedResource:g.data.filename}),c({blockletResource:""}),(y=u.current)==null||y.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:a3,maxFileSize:c3,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:i})]})}W1.propTypes={app:h.object.isRequired,projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,error:h.string.isRequired,setParamsErrTip:h.func.isRequired};W1.defaultProps={};function o1({readOnly:e,params:t,setParams:l,paramsErrTip:s,setParamsErrTip:r,loading:c}){var a;const{t:i}=te();return o.jsx(z,{display:"flex",mt:3,className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Te,{required:!0,disabled:c||e,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:u=>{r({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!s.blockletVersion,helperText:s.blockletVersion||""}),o.jsx(Te,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(z1,{position:"end",children:[((a=t==null?void 0:t.note)==null?void 0:a.length)||0," / ",ye.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{r({note:""}),l({note:u.target.value.slice(0,ye.PROJECT.MAX_NOTE_LENGTH)})},error:!!s.note,helperText:s.note||"",sx:{mt:3}})]})})}o1.propTypes={readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired};o1.defaultProps={};function r2(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&r2(e[t]);return e}const u3=({tabs:e,blocklet:t,ancestors:l=[]})=>{const s=t.meta.did;e.push({label:o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:24,blocklet:t,ancestors:l}),o.jsx(z,{ml:"4px",className:"text",children:o.jsx(z,{children:t.meta.title})})]},s),value:s})},x0=(e,t)=>{const l=g1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(s=>({...s,included:!0})):l.blockletComponents=(t.children||[]).map(s=>({did:s.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},p3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},m0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function G1({initUrl:e,...t}){var K1;const{projectId:l,mode:s,releaseId:r,componentDid:c=""}=n1(),{t:i}=te(),{blocklet:a}=Ve(),[u,f]=Pe({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,g]=Pe({}),[y,p]=R.useState(!1),[d,m]=Pe(null),{api:b}=we(),v=We(D=>D.breakpoints.down("md")),[C,S]=R.useState({}),[N,T]=R.useState(!1),P=R.useRef({}),[I,U]=Pe({}),[V,M]=R.useState(""),[k,L]=Pe({}),E=e==null?void 0:e.searchParams.get("dependentComponentsMode"),B=E==="readonly",O=R.useMemo(()=>{const D={};return Object.keys(k).forEach(_=>{const Ce=k[_];Ce&&Ce.forEach(c2=>{D[c2]=!0})}),D},[k]),K=R.useCallback(D=>{B&&f({blockletComponents:[]}),L(D)},[B,L,f]),J=R.useCallback((...D)=>{U(...D),g({blockletResource:""})},[]),W=r==="none"?(u==null?void 0:u.lastReleaseId)||"":r,[Z,Me]=R.useState(s==="new-release"?4:0);R.useEffect(()=>{l&&g({projectId:""})},[l,g]);const he=R.useMemo(()=>{var D;return(D=u==null?void 0:u.blockletComponents)!=null&&D.some(_=>_.included)||Object.keys(O).length||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource,O]),ce=[],oe=((a==null?void 0:a.children)||[]).filter(D=>{var _;return(_=D.meta.resource)==null?void 0:_.exportApi}).filter(D=>!c||D.meta.did===c);oe.forEach(D=>{u3({tabs:ce,blocklet:D,t:i,ancestors:[a]})});const[ee,ie]=R.useState((K1=ce[0])==null?void 0:K1.value),fe=!N&&(d==null?void 0:d.status)==="published",Q=fe,xe=C2(()=>{if(!e)return;M(e.searchParams.get("logo")),f(_=>{var Ce;return{..._,blockletTitle:(_==null?void 0:_.blockletTitle)||e.searchParams.get("title"),blockletDescription:(_==null?void 0:_.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(_==null?void 0:_.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(Ce=_==null?void 0:_.blockletComponents)!=null&&Ce.length?_==null?void 0:_.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(_==null?void 0:_.note)||e.searchParams.get("note")||"No note"}});const D=e.searchParams.get("resources");try{const _=JSON.parse(D);S(_)}catch{}}),q=async()=>{if(W)try{const D=await b.getRelease({input:{did:a.meta.did,projectId:l,releaseId:W}});if(p(!1),!D.release){$.error("Release not found");return}D.release=r2(D.release),s!=="view"&&(D.release.note=""),f(_=>x0({..._,...D.release,blockletVersion:s==="create"||s==="new-release"?Le.inc(D.release.blockletVersion,"patch"):D.release.blockletVersion},a)),m(D.release)}catch(D){p(!1),$.error(Ne(D))}},le=async()=>{if(l===X.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){$.error(i("blocklet.publish.errorTip.noDid"));return}try{const _=(await b.getProject({input:{did:a.meta.did,projectId:l}})).project||{};_.blockletVersion?(s==="create"||s==="new-release")&&Le.valid(_.blockletVersion)&&(_.blockletVersion=Le.inc(_.blockletVersion,"patch")):_.blockletVersion="1.0.0";const Ce=x0(_,a);f(Ce),_.lastReleaseId||xe()}catch(D){$.error(Ne(D))}},H=R.useCallback(async()=>{p(!0);try{if(s==="view"){if(!W){$.error("Empty release id");return}await le(),await q();return}await le(),W&&(T(!0),await q())}finally{p(!1)}},[s,W]),Ke=D=>{f({blockletComponents:D})};R.useEffect(()=>{H()},[H]),R.useEffect(()=>{l===X.UNOWNED_DID&&(s==="create"||s==="new-release")&&e&&xe()},[l,e,s,xe]);const _e=R.useMemo(()=>!!Object.keys(I).find(D=>!!I[D].length),[I]);if(!u&&y)return o.jsx(Ie,{});if(!u)return null;const Ee=oe.find(D=>D.meta.did===ee);if(oe.every(D=>D.status!=="running")&&(oe!=null&&oe.length))return o.jsx(ze,{children:i("blocklet.publish.allComponentsNotRunning")});const Xe=D=>{ie(D)},F=e==null?void 0:e.searchParams.get("resourcesTitle"),Y=e==null?void 0:e.searchParams.get("componentsTitle"),de=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:F||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:Y||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],a2=de[Z]||de[de.length-1],Re=p3[Z];return o.jsxs(h3,{...t,children:[o.jsx(t2,{blocklet:a,release:d,getData:H,getRelease:q,mode:s,params:u,setParams:f,setParamsErrTip:g,readOnly:Q,isPublished:fe,loading:y,setLoading:p,initLogoUrl:V,releaseId:W,projectId:l,projectType:he,resourceComponents:oe,resourceComponentsMap:k,resourceRelateComponents:O,resourceItem:Ee,saveSelectedEventsRef:P,hasSelectedResources:_e,releaseUsedLast:N,setReleaseUsedLast:T,setRelease:m}),o.jsxs(z,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(z,{pt:3}),o.jsxs(z,{sx:{gap:3},display:"flex",flexDirection:v?"column":"row",children:[!v&&o.jsx(s2,{steps:de,loading:y,viewMode:s==="view",params:u,hasSelectedResources:_e||u.uploadedResource,paramsErrTip:x,activeStep:Z,setActiveStep:Me,projectId:l,resourcesUrlTitle:F,componentsUrlTitle:Y}),o.jsxs(z,{flex:"1",maxWidth:"720px",children:[!v&&Re!=="introduction"&&o.jsxs(G,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[a2.label,Re==="branding"&&o.jsx(ve,{title:i("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(z,{component:"a",target:"_blank",href:"https://www.arcblock.io/docs/blocklet-store/en/blocklet-detail-page",sx:{paddingTop:1,marginLeft:1},style:{color:"gray"},children:o.jsx(P2,{})})})]}),(v||Re==="branding")&&o.jsx(z,{flexDirection:"column",children:o.jsx(J0,{projectId:l,setParams:f,setParamsErrTip:g,params:u,componentDid:c,blocklet:a,initUrl:e,loading:y,setLoading:p,paramsErrTip:x,readOnly:Q,initLogoUrl:V,setInitLogoUrl:M})}),v&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})}),(v||Re==="introduction")&&o.jsx(z,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(l2,{loading:y,readOnly:Q,params:u,setParams:f,paramsErrTip:x,setParamsErrTip:g})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[m0.resources].label}),o.jsx(z,{display:v||Re==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(et,{onChange:()=>f({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(t0,{size:"small",checked:u.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(t0,{size:"small",checked:!u.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!c&&o.jsx(T2,{tabs:ce,current:ee,onChange:Xe,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx(O1,{loading:y,initialResources:C,saveSelectedEventsRef:P,selectedResourceIds:I,setSelectedResourceIds:J,setResourceComponentsMap:K,error:x.blockletResource,app:a,readOnly:Q,component:Ee,componentDid:c,initUrl:e,params:u,setParams:f,projectId:l===X.UNOWNED_DID?"":l,releaseUsedLast:N,release:{...d,id:W}})]}),!u.resourceFromSelect&&o.jsx(W1,{app:a,readOnly:Q,projectId:l===X.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:f,setParamsErrTip:g})]})})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[m0.blocklets].label}),(v||Re==="blocklets")&&o.jsx(z,{flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsx(z,{sx:{flex:1},children:o.jsx(N1,{projectType:he,disabled:y||Q,app:a,value:(u==null?void 0:u.blockletComponents)||[],onChange:Ke,resourceRelateComponents:O,dependentComponentsMode:E})})})}),!v&&Re==="version"&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})})]})]})]})]})}G1.propTypes={initUrl:h.object};G1.defaultProps={initUrl:null};const h3=ae.div`
|
|
181
|
+
`;function o2({text:e}){return e?o.jsx(G2,{wrapperElement:{"data-color-mode":"light"},source:e,rehypePlugins:[[K2,{target:"_blank"}]]}):o.jsx(ze,{Icon:Ge})}o2.propTypes={text:h.string.isRequired};function l2({params:e,setParams:t,paramsErrTip:l,loading:s,setParamsErrTip:r,readOnly:c}){var x;const{t:i}=te(),[a,u]=R.useState(c?"preview":"write"),f=(g,y)=>{u(y)};return o.jsxs(z,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(z,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(G,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(L2,{value:a,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(Z1,{value:"write",label:"Write"}),o.jsx(Z1,{value:"preview",label:"Preview"})]})]}),o.jsx(z,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Te,{disabled:s||c,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:o.jsxs(z1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",ye.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{r({blockletIntroduction:""}),t({blockletIntroduction:g.target.value.slice(0,ye.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(z,{display:a==="preview"?"block":"none",mt:3,children:o.jsx(o2,{text:e.blockletIntroduction||""})})]})}l2.propTypes={params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired};var U1={},r3=ke;Object.defineProperty(U1,"__esModule",{value:!0});var n2=U1.default=void 0,i3=r3(Se()),f0=o;n2=U1.default=(0,i3.default)([(0,f0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,f0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function q1({step:e,ok:t,active:l,error:s}){let r="grey.500",c=e+1;return t&&(c=o.jsx(X2,{sx:{fontSize:18,margin:0},color:"white"})),s||!t&&l>e?(r="error.main",c=o.jsx(n2,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(r="primary.main"),o.jsx(z,{width:24,height:24,bgcolor:r,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:c})}q1.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};q1.defaultProps={step:0,ok:!1,active:0,error:""};function s2({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:s,params:r,loading:c,paramsErrTip:i,viewMode:a,projectId:u}){const{t:f}=te(),x=()=>{l(d=>d+1)},g=()=>{l(d=>d-1)},y=d=>d===0?(i==null?void 0:i.blockletTitle)||(i==null?void 0:i.projectId)||(i==null?void 0:i.blockletDescription):d===2?i==null?void 0:i.blockletResource:d>=4?(i==null?void 0:i.blockletVersion)||(i==null?void 0:i.note):"",p=a||Y0({hasSelectedResources:s,params:r,projectId:u,t:f})===null;return o.jsxs(z,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(Q2,{activeStep:t,orientation:"vertical",children:e.map((d,m)=>{const b={},v=c||!n3({hasSelectedResources:s,params:r,projectId:u,step:m,t:f}),C=c?"":y(m);return C&&(b.optional=o.jsx(G,{variant:"caption",color:"error",children:C}),b.error=!0),o.jsxs(Y2,{children:[o.jsx(gt,{icon:o.jsx(q1,{error:C,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...b,children:o.jsx(G,{fontSize:"14px",fontWeight:"500",color:C||!v&&t>m?"error.main":"inherit",children:d.label})}),o.jsxs(yt,{children:[o.jsx(G,{fontSize:12,children:d.description}),!p&&o.jsx(z,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(ne,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:C||!v,children:f("common.continue")}),m>0&&o.jsx(ne,{disabled:m===0,onClick:g,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},d.label)})}),t>=e.length-1&&o.jsx(b1,{square:!0,elevation:0,sx:{p:3},children:o.jsx(G,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}s2.propTypes={steps:h.array.isRequired,activeStep:h.number.isRequired,setActiveStep:h.func.isRequired,params:h.object.isRequired,viewMode:h.string.isRequired,loading:h.bool.isRequired,projectId:h.string.isRequired,hasSelectedResources:h.bool.isRequired,paramsErrTip:h.shape({projectId:h.string,blockletVersion:h.string,blockletTitle:h.string,blockletDescription:h.string,note:h.string,blockletResource:h.string}).isRequired};const a3=[".zip",".gz"],c3=1024*1024*100,d3=R.lazy(()=>S0(()=>import("./react-DJuQ-Z9X.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48])).then(e=>({default:e.Uploader})));function W1({app:e,projectId:t,readOnly:l,params:s,setParams:r,setParamsErrTip:c,error:i}){const{t:a}=te(),u=R.useRef(null),f=()=>l?!1:!t||t===X.UNOWNED_DID?($.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(z,{sx:{mt:3},children:[o.jsx(G,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),o.jsxs(Z2,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!s.uploadedResource&&o.jsx(G,{component:"a",href:`${x}/params.uploadedResource`,children:s.uploadedResource}),!l&&o.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var g;f()&&((g=u.current)==null||g.open())},children:s.uploadedResource?a("common.change"):a("common.upload")})]}),o.jsx(R.Suspense,{fallback:o.jsx(Ie,{}),children:o.jsx(d3,{ref:u,popup:!0,onUploadFinish:g=>{var y;r({uploadedResource:g.data.filename}),c({blockletResource:""}),(y=u.current)==null||y.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:a3,maxFileSize:c3,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:i})]})}W1.propTypes={app:h.object.isRequired,projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,error:h.string.isRequired,setParamsErrTip:h.func.isRequired};W1.defaultProps={};function o1({readOnly:e,params:t,setParams:l,paramsErrTip:s,setParamsErrTip:r,loading:c}){var a;const{t:i}=te();return o.jsx(z,{display:"flex",mt:3,className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Te,{required:!0,disabled:c||e,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:u=>{r({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!s.blockletVersion,helperText:s.blockletVersion||""}),o.jsx(Te,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(z1,{position:"end",children:[((a=t==null?void 0:t.note)==null?void 0:a.length)||0," / ",ye.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{r({note:""}),l({note:u.target.value.slice(0,ye.PROJECT.MAX_NOTE_LENGTH)})},error:!!s.note,helperText:s.note||"",sx:{mt:3}})]})})}o1.propTypes={readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired};o1.defaultProps={};function r2(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&r2(e[t]);return e}const u3=({tabs:e,blocklet:t,ancestors:l=[]})=>{const s=t.meta.did;e.push({label:o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:24,blocklet:t,ancestors:l}),o.jsx(z,{ml:"4px",className:"text",children:o.jsx(z,{children:t.meta.title})})]},s),value:s})},x0=(e,t)=>{const l=g1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(s=>({...s,included:!0})):l.blockletComponents=(t.children||[]).map(s=>({did:s.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},p3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},m0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function G1({initUrl:e,...t}){var K1;const{projectId:l,mode:s,releaseId:r,componentDid:c=""}=n1(),{t:i}=te(),{blocklet:a}=Ve(),[u,f]=Pe({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,g]=Pe({}),[y,p]=R.useState(!1),[d,m]=Pe(null),{api:b}=we(),v=We(D=>D.breakpoints.down("md")),[C,S]=R.useState({}),[N,T]=R.useState(!1),P=R.useRef({}),[I,U]=Pe({}),[V,M]=R.useState(""),[k,L]=Pe({}),E=e==null?void 0:e.searchParams.get("dependentComponentsMode"),B=E==="readonly",O=R.useMemo(()=>{const D={};return Object.keys(k).forEach(_=>{const Ce=k[_];Ce&&Ce.forEach(c2=>{D[c2]=!0})}),D},[k]),K=R.useCallback(D=>{B&&f({blockletComponents:[]}),L(D)},[B,L,f]),J=R.useCallback((...D)=>{U(...D),g({blockletResource:""})},[]),W=r==="none"?(u==null?void 0:u.lastReleaseId)||"":r,[Z,Me]=R.useState(s==="new-release"?4:0);R.useEffect(()=>{l&&g({projectId:""})},[l,g]);const he=R.useMemo(()=>{var D;return(D=u==null?void 0:u.blockletComponents)!=null&&D.some(_=>_.included)||Object.keys(O).length||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource,O]),ce=[],oe=((a==null?void 0:a.children)||[]).filter(D=>{var _;return(_=D.meta.resource)==null?void 0:_.exportApi}).filter(D=>!c||D.meta.did===c);oe.forEach(D=>{u3({tabs:ce,blocklet:D,t:i,ancestors:[a]})});const[ee,ie]=R.useState((K1=ce[0])==null?void 0:K1.value),fe=!N&&(d==null?void 0:d.status)==="published",Q=fe,xe=C2(()=>{if(!e)return;M(e.searchParams.get("logo")),f(_=>{var Ce;return{..._,blockletTitle:(_==null?void 0:_.blockletTitle)||e.searchParams.get("title"),blockletDescription:(_==null?void 0:_.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(_==null?void 0:_.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(Ce=_==null?void 0:_.blockletComponents)!=null&&Ce.length?_==null?void 0:_.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(_==null?void 0:_.note)||e.searchParams.get("note")||"No note"}});const D=e.searchParams.get("resources");try{const _=JSON.parse(D);S(_)}catch{}}),q=async()=>{if(W)try{const D=await b.getRelease({input:{did:a.meta.did,projectId:l,releaseId:W}});if(p(!1),!D.release){$.error("Release not found");return}D.release=r2(D.release),s!=="view"&&(D.release.note=""),f(_=>x0({..._,...D.release,blockletVersion:s==="create"||s==="new-release"?Le.inc(D.release.blockletVersion,"patch"):D.release.blockletVersion},a)),m(D.release)}catch(D){p(!1),$.error(Ne(D))}},le=async()=>{if(l===X.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){$.error(i("blocklet.publish.errorTip.noDid"));return}try{const _=(await b.getProject({input:{did:a.meta.did,projectId:l}})).project||{};_.blockletVersion?(s==="create"||s==="new-release")&&Le.valid(_.blockletVersion)&&(_.blockletVersion=Le.inc(_.blockletVersion,"patch")):_.blockletVersion="1.0.0";const Ce=x0(_,a);f(Ce),_.lastReleaseId||xe()}catch(D){$.error(Ne(D))}},H=R.useCallback(async()=>{p(!0);try{if(s==="view"){if(!W){$.error("Empty release id");return}await le(),await q();return}await le(),W&&(T(!0),await q())}finally{p(!1)}},[s,W]),Ke=D=>{f({blockletComponents:D})};R.useEffect(()=>{H()},[H]),R.useEffect(()=>{l===X.UNOWNED_DID&&(s==="create"||s==="new-release")&&e&&xe()},[l,e,s,xe]);const _e=R.useMemo(()=>!!Object.keys(I).find(D=>!!I[D].length),[I]);if(!u&&y)return o.jsx(Ie,{});if(!u)return null;const Ee=oe.find(D=>D.meta.did===ee);if(oe.every(D=>D.status!=="running")&&(oe!=null&&oe.length))return o.jsx(ze,{children:i("blocklet.publish.allComponentsNotRunning")});const Xe=D=>{ie(D)},F=e==null?void 0:e.searchParams.get("resourcesTitle"),Y=e==null?void 0:e.searchParams.get("componentsTitle"),de=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:F||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:Y||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],a2=de[Z]||de[de.length-1],Re=p3[Z];return o.jsxs(h3,{...t,children:[o.jsx(t2,{blocklet:a,release:d,getData:H,getRelease:q,mode:s,params:u,setParams:f,setParamsErrTip:g,readOnly:Q,isPublished:fe,loading:y,setLoading:p,initLogoUrl:V,releaseId:W,projectId:l,projectType:he,resourceComponents:oe,resourceComponentsMap:k,resourceRelateComponents:O,resourceItem:Ee,saveSelectedEventsRef:P,hasSelectedResources:_e,releaseUsedLast:N,setReleaseUsedLast:T,setRelease:m}),o.jsxs(z,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(z,{pt:3}),o.jsxs(z,{sx:{gap:3},display:"flex",flexDirection:v?"column":"row",children:[!v&&o.jsx(s2,{steps:de,loading:y,viewMode:s==="view",params:u,hasSelectedResources:_e||u.uploadedResource,paramsErrTip:x,activeStep:Z,setActiveStep:Me,projectId:l,resourcesUrlTitle:F,componentsUrlTitle:Y}),o.jsxs(z,{flex:"1",maxWidth:"720px",children:[!v&&Re!=="introduction"&&o.jsxs(G,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[a2.label,Re==="branding"&&o.jsx(ve,{title:i("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(z,{component:"a",target:"_blank",href:"https://www.arcblock.io/docs/blocklet-store/en/blocklet-detail-page",sx:{paddingTop:1,marginLeft:1},style:{color:"gray"},children:o.jsx(P2,{})})})]}),(v||Re==="branding")&&o.jsx(z,{flexDirection:"column",children:o.jsx(J0,{projectId:l,setParams:f,setParamsErrTip:g,params:u,componentDid:c,blocklet:a,initUrl:e,loading:y,setLoading:p,paramsErrTip:x,readOnly:Q,initLogoUrl:V,setInitLogoUrl:M})}),v&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})}),(v||Re==="introduction")&&o.jsx(z,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(l2,{loading:y,readOnly:Q,params:u,setParams:f,paramsErrTip:x,setParamsErrTip:g})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[m0.resources].label}),o.jsx(z,{display:v||Re==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(et,{onChange:()=>f({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(t0,{size:"small",checked:u.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(t0,{size:"small",checked:!u.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!c&&o.jsx(T2,{tabs:ce,current:ee,onChange:Xe,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx(O1,{loading:y,initialResources:C,saveSelectedEventsRef:P,selectedResourceIds:I,setSelectedResourceIds:J,setResourceComponentsMap:K,error:x.blockletResource,app:a,readOnly:Q,component:Ee,componentDid:c,initUrl:e,params:u,setParams:f,projectId:l===X.UNOWNED_DID?"":l,releaseUsedLast:N,release:{...d,id:W}})]}),!u.resourceFromSelect&&o.jsx(W1,{app:a,readOnly:Q,projectId:l===X.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:f,setParamsErrTip:g})]})})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[m0.blocklets].label}),(v||Re==="blocklets")&&o.jsx(z,{flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsx(z,{sx:{flex:1},children:o.jsx(N1,{projectType:he,disabled:y||Q,app:a,value:(u==null?void 0:u.blockletComponents)||[],onChange:Ke,resourceRelateComponents:O,dependentComponentsMode:E})})})}),!v&&Re==="version"&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})})]})]})]})]})}G1.propTypes={initUrl:h.object};G1.defaultProps={initUrl:null};const h3=ae.div`
|
|
182
182
|
.section {
|
|
183
183
|
&.full-width {
|
|
184
184
|
max-width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{eS as b}from"./index-
|
|
1
|
+
import{eS as b}from"./index-CEaTcEQs.js";function c(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,l=-1,t=0,n,f=0;f<=o.length;++f){if(f<o.length)n=o.charCodeAt(f);else{if(n===47)break;n=47}if(n===47){if(!(l===f-1||t===1))if(l!==f-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("/")),l=f,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,l=f,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(l+1,f):r=o.slice(l+1,f),i=f-l-1;l=f,t=0}else n===46&&t!==-1?++t:t=-1}return r}function h(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,l=arguments.length-1;l>=-1&&!r;l--){var t;l>=0?t=arguments[l]:(i===void 0&&(i=b.cwd()),t=i),c(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(c(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 c(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];c(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(c(e),c(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 l=e.length,t=l-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var f=r.length,s=f-n,v=t<s?t:s,u=-1,a=0;a<=v;++a){if(a===v){if(s>v){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>v&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var m=e.charCodeAt(i+a),C=r.charCodeAt(n+a);if(m!==C)break;m===47&&(u=a)}var d="";for(a=i+u+1;a<=l;++a)(a===l||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(c(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,l=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){l=n;break}}else t=!1;return l===-1?i?"/":".":i&&l===1?"//":e.slice(0,l)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');c(e);var i=0,l=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var f=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var v=e.charCodeAt(n);if(v===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),f>=0&&(v===r.charCodeAt(f)?--f===-1&&(l=n):(f=-1,l=s))}return i===l?l=s:l===-1&&(l=e.length),e.slice(i,l)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else l===-1&&(t=!1,l=n+1);return l===-1?"":e.slice(i,l)}},extname:function(e){c(e);for(var r=-1,i=0,l=-1,t=!0,n=0,f=e.length-1;f>=0;--f){var s=e.charCodeAt(f);if(s===47){if(!t){i=f+1;break}continue}l===-1&&(t=!1,l=f+1),s===46?r===-1?r=f:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||l===-1||n===0||n===1&&r===l-1&&r===i+1?"":e.slice(r,l)},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 h("/",e)},parse:function(e){c(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),l=i===47,t;l?(r.root="/",t=1):t=0;for(var n=-1,f=0,s=-1,v=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!v){f=u+1;break}continue}s===-1&&(v=!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===f+1?s!==-1&&(f===0&&l?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(f,s)):(f===0&&l?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(f,n),r.base=e.slice(f,s)),r.ext=e.slice(n,s)),f>0?r.dir=e.slice(0,f-1):l&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};g.posix=g;var y=g;export{y as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as o,r as x,j as e,B as u,bi as K,bA as B,
|
|
1
|
+
import{P as o,r as x,j as e,B as u,bi as K,bA as B,fh as W,a8 as v,aC as R,n as A,d8 as M,Z as $}from"./index-CEaTcEQs.js";import{d as G}from"./EditIcon-R508XR9R.js";import{d as H}from"./Done-B-JT0RXC.js";import{C as U}from"./Google-DBXwxuV5.js";import{T as Y}from"./TextField-x4CoNOlz.js";import{R as Z,F as J,L as Q}from"./logo-uploader-Blhm721C.js";const S={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function V({editing:n,value:r,onChange:s}){const[a,l]=x.useState(!1),c=x.useRef(),d=x.useRef(r);x.useEffect(()=>{let p=null;return n&&(p=setTimeout(()=>{l(!0)},50)),()=>{clearTimeout(p)}},[n]);const g=p=>{d.current=p,s(p)},y=()=>{l(!1),s(d.current)},b=e.jsx(u,{className:"form-item-input slot",px:1,children:e.jsxs(u,{display:"flex",alignItems:"center",children:[r,r!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:r,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),i=e.jsxs(u,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:y,children:[e.jsx(u,{display:"flex",alignItems:"center",onClick:()=>l(!0),children:e.jsx("div",{ref:c,style:{flexShrink:0,marginLeft:"8px",backgroundColor:r,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:r==="auto"?"default":"pointer"}})}),e.jsx(K,{open:a,anchorEl:c.current,onClose:()=>l(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(U,{color:r,onChange:p=>g(p.hex)})})]});return n?i:b}V.propTypes=S;function _({editing:n,description:r,value:s,onChange:a,componentProps:l,...c}){const{placeholder:d}=l,g=x.useRef(s),y=i=>{i.key==="Enter"&&a(g.current,"confirm")},b=i=>{g.current=i,a(i)};return n?e.jsx(Y,{style:{flex:1},fullWidth:!0,value:s,onChange:i=>{i.persist(),b(i.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:r||d,onKeyDown:y,...c}):e.jsx(u,{px:1,className:"form-item-input slot",children:s})}_.propTypes=S;_.defaultProps={componentProps:{}};function F({editing:n,value:r,onChange:s,componentProps:a,...l}){const{blocklet:c}=a,d=r==="auto"?B.getPassportColorFromDid(c.appDid):r;return e.jsxs(u,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:W({title:"Owner",issuer:v.getDisplayName(c),issuerDid:c.appDid,ownerName:"Your Name",ownerDid:c.appDid,preferredColor:r||"auto"})}}),e.jsx(V,{...l,editing:n,value:n?d:r,onChange:s,componentProps:a})]})}F.propTypes={...S,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};F.defaultProps={};const X={input:_,color:V,passport:F,uploader:n=>e.jsx(Q,{...n.componentProps})};function ee(n,{editing:r=!1}){const{componentType:s="input",render:a,renderFormItem:l}=n;return r&&l?l:!r&&a?a:X[s==null?void 0:s.toLowerCase()]}function D({schema:n,loading:r,value:s,defaultValue:a,onChange:l,style:c,disabled:d}){const g=Object.prototype.toString.call(s)==="[object Object]",[y,b]=x.useState(null),[i,p]=x.useState(g?s:a),P=x.useRef();function I(t,m,h){const{key:f,secure:C}=t,k=i[f]!==m,j={...i,[f]:m};k&&p(j),l({[f]:m},{allValues:j,action:h,currentItem:t}),h==="confirm"&&C&&p({...i,[f]:"__encrypted__"}),["confirm","cancel"].includes(h)?N(null):N(t)}function N(t){if(t){P.current=i[t.key],b(t);return}P.current=null,b(null)}function E(t,{editing:m=!1}){const{key:h}=t,f=g?s[h]:i[h];return f==="__encrypted__"?m?"":"******":f}return e.jsx(re,{className:"form",style:c,children:n==null?void 0:n.map(t=>{const{key:m,description:h,required:f,solo:C=!1,hidden:T=!1,componentProps:k={}}=t;if(T)return null;const j=!!(y&&m===y.key),w=E(t,{editing:j}),z=ee(t,{editing:j}),q={inputProps:{"data-cy":"schema-form-item-component"},key:m,description:h,editing:j,value:w,onChange:(L,O="change")=>I(t,L,O),componentProps:k};return e.jsxs(u,{className:"form-item",children:[!C&&e.jsxs(u,{className:"form-item-label",style:{color:f&&!w?"#ff0000":"#333"},children:[h,f&&e.jsx(Z,{})]}),e.jsxs(u,{className:"form-item-body",children:[e.jsx(u,{className:"form-item-input",sx:{textAlign:C?"center":"left"},children:e.jsx(z,{...q})}),!C&&e.jsx(u,{className:"form-item-action",children:j?e.jsxs(e.Fragment,{children:[e.jsx(R,{"data-cy":"schema-form-item-confirm",onClick:()=>{I(t,w,"confirm")},disabled:d||r,size:"large",children:r?e.jsx(A,{size:24}):e.jsx(H,{})}),e.jsx(R,{"data-cy":"schema-form-item-cancel",onClick:()=>{I(t,P.current,"cancel")},disabled:d||r,size:"large",children:e.jsx(M,{})})]}):e.jsx(R,{"data-cy":"schema-form-item-edit",onClick:()=>{I(t,i[m],"edit")},disabled:d||y,size:"large",children:e.jsx(G,{})})})]})]},m)})})}D.propTypes={schema:o.array.isRequired,loading:o.bool,onChange:o.func.isRequired,value:o.object,defaultValue:o.object,style:o.object,disabled:o.bool};D.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const re=$(J)``;export{D as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as H,j as i,fV as Gn,l as ur,fW as Yn,eV as pn,eU as dn,eT as Rt,fX as ft,eS as Te,fY as Zn,fZ as mn,f_ as hn,f$ as Xn,g0 as Jn,g1 as gn,g2 as fr,g3 as Qn,g4 as ei,g5 as ti,g6 as ri,eL as er,b7 as ni,cv as Dr,eN as ii,a8 as oi,aP as Ce,u as Fe,N as yn,B as ce,aT as wt,A as vn,D as ai,T as Le,g7 as pr,af as pt,au as Ge,a1 as Se,n as rt,P as M,bC as si,cw as tr,K as ci,eY as li,Z as De,d8 as ui,a0 as mt,bl as Ze,t as nt,g8 as fi,aa as Ye,dw as pi,aY as bn,G as je,a as dt,c as rr,b as di,bF as mi,g9 as xn,bL as wn,aV as hi,X as gi,Y as yi,bQ as En,m as vi,aC as bi,bH as xi}from"./index-BaC4EhQh.js";import{c as wi}from"./index-DPXmNWqb.js";import{d as Et}from"./Add-DPWETbuH.js";import{d as Ei}from"./Loop-C8sLBH67.js";import{d as ji}from"./ViewList-DloAt_wk.js";import{L as Si,S as Pi,d as jn}from"./list-header-D2TsmXsU.js";import{D as Sn,g as Oi}from"./index-CT70Tuv9.js";import"./index-CFpdZL6w.js";import"./index-BCMjvLku.js";import{h as Pn}from"./resource-dialog-DhmviK8K.js";import{T as Ai}from"./index-BK9kuqs5.js";import{E as On}from"./index-B3ThwVSS.js";import"./fallback-BLJkxLTK.js";import"./index-ChWrF7R7.js";import{d as Ri,U as Ii}from"./user-sessions-D_s7CT2k.js";import{u as $e,d as Ur,W as An,a as Ti}from"./dashboard-Clr7sJbb.js";import{W as jt}from"./did-address-DNmiCCjI.js";import{P as ke}from"./permission-DDD12SuE.js";import{C as It}from"./click-to-copy-GLcS-PQh.js";import{F as nr}from"./FormControl-D00yHDcj.js";import{I as ir}from"./InputLabel-BaHBEVm2.js";import{S as or}from"./Select-_ZzhxUOz.js";import{T as Rn}from"./TextField-DvTYZ6EA.js";import{D as dr}from"./DialogContentText-BnQAOkxN.js";import{A as tt}from"./Alert-DDr4PUmN.js";import{f as Xe}from"./format-error-C43xGCjC.js";import{_ as _i}from"./useAsync-Bl2lmnoD.js";import{I as ar}from"./index-TwQfcdR0.js";import{C as Tt}from"./confirm-BdJlZzQ-.js";import{u as In}from"./session-D3mS3Gz5.js";import{b as Ni}from"./sdk-B37oViy1.js";import{A as Ci}from"./Avatar-Der2Q3Zi.js";import{d as Di}from"./Delete-DVYTl7-n.js";import{p as Ui}from"./index-HqFqdQ4r.js";import{A as Li}from"./actions-DU4pTpmF.js";import{L as qi,a as Ki}from"./ListItemText-BW_owdy0.js";import{S as ki}from"./shorten-label-DWH-tsmz.js";import{F as Bi,C as Fi}from"./FormControlLabel-BJXWJJky.js";import"./Search-Cm2FDsnl.js";import"./useThemeProps-CIT7yB5m.js";import"./toPropertyKey-PLuKRk1e.js";import"./index-s95vTNww.js";import"./redux-Bma4eNss.js";import"./ViewColumn-BOqfI3PF.js";import"./useFormControl-CAWQrhew.js";import"./FormGroup-CBgybl1l.js";import"./LastPage-DyrTuTrl.js";import"./Toolbar-DbekG5v-.js";import"./MoreVert-D_g6Th6c.js";import"./index-DiOkeCOc.js";import"./Hidden-Bg6BPxEd.js";import"./ExpandMore-BgcTT2Bb.js";import"./selector-B8IAFODK.js";import"./OpenInNew-DBNjDxil.js";import"./CloseOutlined-OBzuC30j.js";import"./use-mobile-BA_cO1yG.js";import"./Link-CiVKLn7B.js";import"./useLocalStorage-DkK4fk62.js";import"./PlayArrow-ywjbMR8A.js";import"./ButtonGroup-zMm3edlK.js";import"./RadioGroup-BOq5mI1A.js";import"./index-Dp6zROo4.js";import"./useSetState-OuMAH4bG.js";import"./useSlot-nO86v-Bn.js";import"./MoreHoriz-i1hLrklo.js";import"./Stack-DuNNAX-1.js";var mr={};Object.defineProperty(mr,"__esModule",{value:!0});var Tn=mr.default=void 0;$i(H);var Qe=i;function $i(e){return e&&e.__esModule?e:{default:e}}function Lr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function qr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lr(Object(r),!0).forEach(function(n){Mi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mi(e,t,r){return(t=zi(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zi(e){var t=Vi(e,"string");return typeof t=="symbol"?t:t+""}function Vi(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hr=function(t){return(0,Qe.jsxs)("svg",qr(qr({},t),{},{children:[(0,Qe.jsx)("g",{clipPath:"url(#clip0)",children:(0,Qe.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 1.598A4.092 4.092 0 1 0 9 9.78a4.092 4.092 0 0 0 0-8.183zM7.274 3.964a2.44 2.44 0 1 1 3.452 3.451 2.44 2.44 0 0 1-3.452-3.451zm.093 6.343A4.091 4.091 0 0 0 3.275 14.4v2.722c0 .155.126.281.281.281h1.09a.281.281 0 0 0 .28-.281v-2.722a2.44 2.44 0 0 1 2.44-2.44h3.267a2.442 2.442 0 0 1 2.44 2.44v2.722c0 .155.127.281.282.281h1.088a.281.281 0 0 0 .282-.281v-2.722a4.091 4.091 0 0 0-4.092-4.091H7.367z"})}),(0,Qe.jsx)("defs",{children:(0,Qe.jsx)("clipPath",{id:"clip0",children:(0,Qe.jsx)("path",{transform:"translate(0 .5)",d:"M0 0h18v18H0z"})})})]}))};hr.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};hr.displayName="person";Tn=mr.default=hr;var xt={},Wi=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),_n="%[a-f0-9]{2}",Kr=new RegExp("("+_n+")|([^%]+?)","gi"),kr=new RegExp("("+_n+")+","gi");function sr(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],sr(r),sr(n))}function Hi(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(Kr)||[],r=1;r<t.length;r++)e=sr(t,r).join(""),t=e.match(Kr)||[];return e}}function Gi(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=kr.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch{var n=Hi(r[0]);n!==r[0]&&(t[r[0]]=n)}r=kr.exec(e)}t["%C2"]="�";for(var s=Object.keys(t),u=0;u<s.length;u++){var p=s[u];e=e.replace(new RegExp(p,"g"),t[p])}return e}var Yi=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return Gi(e)}},Zi=(e,t)=>{if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t==="")return[e];const r=e.indexOf(t);return r===-1?[e]:[e.slice(0,r),e.slice(r+t.length)]},Xi=function(e,t){for(var r={},n=Object.keys(e),s=Array.isArray(t),u=0;u<n.length;u++){var p=n[u],S=e[p];(s?t.indexOf(p)!==-1:t(p,S,e))&&(r[p]=S)}return r};(function(e){const t=Wi,r=Yi,n=Zi,s=Xi,u=a=>a==null;function p(a){switch(a.arrayFormat){case"index":return o=>(l,d)=>{const x=l.length;return d===void 0||a.skipNull&&d===null||a.skipEmptyString&&d===""?l:d===null?[...l,[w(o,a),"[",x,"]"].join("")]:[...l,[w(o,a),"[",w(x,a),"]=",w(d,a)].join("")]};case"bracket":return o=>(l,d)=>d===void 0||a.skipNull&&d===null||a.skipEmptyString&&d===""?l:d===null?[...l,[w(o,a),"[]"].join("")]:[...l,[w(o,a),"[]=",w(d,a)].join("")];case"comma":case"separator":return o=>(l,d)=>d==null||d.length===0?l:l.length===0?[[w(o,a),"=",w(d,a)].join("")]:[[l,w(d,a)].join(a.arrayFormatSeparator)];default:return o=>(l,d)=>d===void 0||a.skipNull&&d===null||a.skipEmptyString&&d===""?l:d===null?[...l,w(o,a)]:[...l,[w(o,a),"=",w(d,a)].join("")]}}function S(a){let o;switch(a.arrayFormat){case"index":return(l,d,x)=>{if(o=/\[(\d*)\]$/.exec(l),l=l.replace(/\[\d*\]$/,""),!o){x[l]=d;return}x[l]===void 0&&(x[l]={}),x[l][o[1]]=d};case"bracket":return(l,d,x)=>{if(o=/(\[\])$/.exec(l),l=l.replace(/\[\]$/,""),!o){x[l]=d;return}if(x[l]===void 0){x[l]=[d];return}x[l]=[].concat(x[l],d)};case"comma":case"separator":return(l,d,x)=>{const N=typeof d=="string"&&d.includes(a.arrayFormatSeparator),j=typeof d=="string"&&!N&&f(d,a).includes(a.arrayFormatSeparator);d=j?f(d,a):d;const C=N||j?d.split(a.arrayFormatSeparator).map(W=>f(W,a)):d===null?d:f(d,a);x[l]=C};default:return(l,d,x)=>{if(x[l]===void 0){x[l]=d;return}x[l]=[].concat(x[l],d)}}}function b(a){if(typeof a!="string"||a.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function w(a,o){return o.encode?o.strict?t(a):encodeURIComponent(a):a}function f(a,o){return o.decode?r(a):a}function D(a){return Array.isArray(a)?a.sort():typeof a=="object"?D(Object.keys(a)).sort((o,l)=>Number(o)-Number(l)).map(o=>a[o]):a}function v(a){const o=a.indexOf("#");return o!==-1&&(a=a.slice(0,o)),a}function P(a){let o="";const l=a.indexOf("#");return l!==-1&&(o=a.slice(l)),o}function E(a){a=v(a);const o=a.indexOf("?");return o===-1?"":a.slice(o+1)}function L(a,o){return o.parseNumbers&&!Number.isNaN(Number(a))&&typeof a=="string"&&a.trim()!==""?a=Number(a):o.parseBooleans&&a!==null&&(a.toLowerCase()==="true"||a.toLowerCase()==="false")&&(a=a.toLowerCase()==="true"),a}function R(a,o){o=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},o),b(o.arrayFormatSeparator);const l=S(o),d=Object.create(null);if(typeof a!="string"||(a=a.trim().replace(/^[?#&]/,""),!a))return d;for(const x of a.split("&")){if(x==="")continue;let[N,j]=n(o.decode?x.replace(/\+/g," "):x,"=");j=j===void 0?null:["comma","separator"].includes(o.arrayFormat)?j:f(j,o),l(f(N,o),j,d)}for(const x of Object.keys(d)){const N=d[x];if(typeof N=="object"&&N!==null)for(const j of Object.keys(N))N[j]=L(N[j],o);else d[x]=L(N,o)}return o.sort===!1?d:(o.sort===!0?Object.keys(d).sort():Object.keys(d).sort(o.sort)).reduce((x,N)=>{const j=d[N];return j&&typeof j=="object"&&!Array.isArray(j)?x[N]=D(j):x[N]=j,x},Object.create(null))}e.extract=E,e.parse=R,e.stringify=(a,o)=>{if(!a)return"";o=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},o),b(o.arrayFormatSeparator);const l=j=>o.skipNull&&u(a[j])||o.skipEmptyString&&a[j]==="",d=p(o),x={};for(const j of Object.keys(a))l(j)||(x[j]=a[j]);const N=Object.keys(x);return o.sort!==!1&&N.sort(o.sort),N.map(j=>{const C=a[j];return C===void 0?"":C===null?w(j,o):Array.isArray(C)?C.reduce(d(j),[]).join("&"):w(j,o)+"="+w(C,o)}).filter(j=>j.length>0).join("&")},e.parseUrl=(a,o)=>{o=Object.assign({decode:!0},o);const[l,d]=n(a,"#");return Object.assign({url:l.split("?")[0]||"",query:R(E(a),o)},o&&o.parseFragmentIdentifier&&d?{fragmentIdentifier:f(d,o)}:{})},e.stringifyUrl=(a,o)=>{o=Object.assign({encode:!0,strict:!0},o);const l=v(a.url).split("?")[0]||"",d=e.extract(a.url),x=e.parse(d,{sort:!1}),N=Object.assign(x,a.query);let j=e.stringify(N,o);j&&(j=`?${j}`);let C=P(a.url);return a.fragmentIdentifier&&(C=`#${w(a.fragmentIdentifier,o)}`),`${l}${j}${C}`},e.pick=(a,o,l)=>{l=Object.assign({parseFragmentIdentifier:!0},l);const{url:d,query:x,fragmentIdentifier:N}=e.parseUrl(a,l);return e.stringifyUrl({url:d,query:s(x,o),fragmentIdentifier:N},l)},e.exclude=(a,o,l)=>{const d=Array.isArray(o)?x=>!o.includes(x):(x,N)=>!o(x,N);return e.pick(a,d,l)}})(xt);const ct=Yn,Ji={parseNumbers:!1,parseBooleans:!1},Qi={skipNull:!1,skipEmptyString:!1},eo=(e,t)=>{var r,n;const{navigateMode:s="push",parseOptions:u,stringifyOptions:p}={},S=Object.assign(Object.assign({},Ji),u),b=Object.assign(Object.assign({},Qi),p),w=ct.useLocation(),f=(r=ct.useHistory)===null||r===void 0?void 0:r.call(ct),D=(n=ct.useNavigate)===null||n===void 0?void 0:n.call(ct),v=Gn(),P=H.useRef(typeof e=="function"?e():e||{}),E=H.useMemo(()=>xt.parse(w.search,S),[w.search]),L=H.useMemo(()=>Object.assign(Object.assign({},P.current),E),[E]);return[L,ur(a=>{const o=typeof a=="function"?a(L):a;v(),f&&f[s]({hash:w.hash,search:xt.stringify(Object.assign(Object.assign({},E),o),b)||"?"},w.state),D&&D({hash:w.hash,search:xt.stringify(Object.assign(Object.assign({},E),o),b)||"?"},{replace:s==="replace",state:w.state})})]},to=eo;var he={};Object.defineProperty(he,"__esModule",{value:!0});he.isValid=he.fromJSON=he.fromRandom=he.fromAddress=he.fromPublicKey=he.fromSecretKey=he.Wallet=he.WalletType=void 0;const ht=dn,St=Rt,Ae=pn;he.WalletType=Ae.DidType;function it(e,t="default"){const r=(0,Ae.DidType)(t),n=(0,St.getSigner)(r.pk),s=(0,St.getHasher)(r.hash);return{type:r,secretKey:e.sk,publicKey:e.pk,address:e.pk?(0,Ae.fromPublicKey)(e.pk,r):e.address,hash(u,p=1,S="hex"){return s(u,p,S)},sign(u,p=!0,S="hex"){if(!e.sk)throw new Error("Cannot sign data without a secretKey");if(p){const b=s(u,1);return n.sign(b,e.sk,S)}return n.sign(u,e.sk,S)},verify(u,p,S=!0){if(!e.pk)throw new Error("Cannot verify data without a publicKey");const b=S?s(u,1):u;return n.verify(b,p,e.pk)},ethHash(u){if(typeof n.ethHash!="function")throw new Error("ethHash is not supported by signer");return n.ethHash(u)},ethSign(u,p=!0){if(!e.sk)throw new Error("Cannot sign data without a secretKey");if(typeof n.ethHash!="function")throw new Error("ethSign is not supported by signer");return p?n.ethSign(n.ethHash(u),(0,ht.toHex)(e.sk)):n.ethSign(u,(0,ht.toHex)(e.sk))},ethVerify(u,p,S=!0){if(typeof n.ethHash!="function")throw new Error("ethVerify is not supported by signer");const b=S?n.ethHash(u):u;return n.ethRecover(b,p)===this.address},toAddress(){return e.pk?(0,Ae.fromPublicKey)(e.pk,r):e.address},toJSON(){return{type:Ae.DidType.toJSON(r),sk:(0,ht.toHex)(e.sk),pk:(0,ht.toHex)(e.pk),address:this.address}}}}he.Wallet=it;function ro(e,t="default"){const r=(0,Ae.DidType)(t),n={sk:e,pk:(0,St.getSigner)(r.pk).getPublicKey(e)};return it(n,r)}he.fromSecretKey=ro;function no(e,t="default"){return it({pk:e},(0,Ae.DidType)(t))}he.fromPublicKey=no;function io(e){return it({address:(0,Ae.toAddress)(e)},(0,Ae.toTypeInfo)(e))}he.fromAddress=io;function oo(e="default"){const t=(0,Ae.DidType)(e),n=(0,St.getSigner)(t.pk).genKeyPair();return it({sk:n.secretKey,pk:n.publicKey},t)}he.fromRandom=oo;function ao(e){const t=Ae.DidType.fromJSON(e.type);return it(e,t)}he.fromJSON=ao;function so(e,t=!0){return!(!e||typeof e!="object"||typeof e.verify!="function"||typeof e.toAddress!="function"||typeof e.toJSON!="function"||!e.type||!e.publicKey||t&&(!e.secretKey||typeof e.sign!="function"))}he.isValid=so;var Lt={exports:{}},qt={},Br;function Nn(){if(Br)return qt;Br=1;function e(o){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},e(o)}function t(o,l,d){return Object.defineProperty(o,"prototype",{writable:!1}),o}function r(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}function n(o,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),l&&s(o,l)}function s(o,l){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,N){return x.__proto__=N,x},s(o,l)}function u(o){var l=b();return function(){var x=w(o),N;if(l){var j=w(this).constructor;N=Reflect.construct(x,arguments,j)}else N=x.apply(this,arguments);return p(this,N)}}function p(o,l){if(l&&(e(l)==="object"||typeof l=="function"))return l;if(l!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return S(o)}function S(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function b(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function w(o){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(d){return d.__proto__||Object.getPrototypeOf(d)},w(o)}var f={},D,v;function P(o,l,d){d||(d=Error);function x(j,C,W){return typeof l=="string"?l:l(j,C,W)}var N=function(j){n(W,j);var C=u(W);function W(ee,X,G){var J;return r(this,W),J=C.call(this,x(ee,X,G)),J.code=o,J}return t(W)}(d);f[o]=N}function E(o,l){if(Array.isArray(o)){var d=o.length;return o=o.map(function(x){return String(x)}),d>2?"one of ".concat(l," ").concat(o.slice(0,d-1).join(", "),", or ")+o[d-1]:d===2?"one of ".concat(l," ").concat(o[0]," or ").concat(o[1]):"of ".concat(l," ").concat(o[0])}else return"of ".concat(l," ").concat(String(o))}function L(o,l,d){return o.substr(0,l.length)===l}function R(o,l,d){return(d===void 0||d>o.length)&&(d=o.length),o.substring(d-l.length,d)===l}function a(o,l,d){return typeof d!="number"&&(d=0),d+l.length>o.length?!1:o.indexOf(l,d)!==-1}return P("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),P("ERR_INVALID_ARG_TYPE",function(o,l,d){D===void 0&&(D=cr()),D(typeof o=="string","'name' must be a string");var x;typeof l=="string"&&L(l,"not ")?(x="must not be",l=l.replace(/^not /,"")):x="must be";var N;if(R(o," argument"))N="The ".concat(o," ").concat(x," ").concat(E(l,"type"));else{var j=a(o,".")?"property":"argument";N='The "'.concat(o,'" ').concat(j," ").concat(x," ").concat(E(l,"type"))}return N+=". Received type ".concat(e(d)),N},TypeError),P("ERR_INVALID_ARG_VALUE",function(o,l){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";v===void 0&&(v=ft);var x=v.inspect(l);return x.length>128&&(x="".concat(x.slice(0,128),"...")),"The argument '".concat(o,"' ").concat(d,". Received ").concat(x)},TypeError),P("ERR_INVALID_RETURN_VALUE",function(o,l,d){var x;return d&&d.constructor&&d.constructor.name?x="instance of ".concat(d.constructor.name):x="type ".concat(e(d)),"Expected ".concat(o,' to be returned from the "').concat(l,'"')+" function but got ".concat(x,".")},TypeError),P("ERR_MISSING_ARGS",function(){for(var o=arguments.length,l=new Array(o),d=0;d<o;d++)l[d]=arguments[d];D===void 0&&(D=cr()),D(l.length>0,"At least one arg needs to be specified");var x="The ",N=l.length;switch(l=l.map(function(j){return'"'.concat(j,'"')}),N){case 1:x+="".concat(l[0]," argument");break;case 2:x+="".concat(l[0]," and ").concat(l[1]," arguments");break;default:x+=l.slice(0,N-1).join(", "),x+=", and ".concat(l[N-1]," arguments");break}return"".concat(x," must be specified")},TypeError),qt.codes=f,qt}var Kt,Fr;function co(){if(Fr)return Kt;Fr=1;function e(O,A){var B=Object.keys(O);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(O);A&&(T=T.filter(function(V){return Object.getOwnPropertyDescriptor(O,V).enumerable})),B.push.apply(B,T)}return B}function t(O){for(var A=1;A<arguments.length;A++){var B=arguments[A]!=null?arguments[A]:{};A%2?e(Object(B),!0).forEach(function(T){r(O,T,B[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(B)):e(Object(B)).forEach(function(T){Object.defineProperty(O,T,Object.getOwnPropertyDescriptor(B,T))})}return O}function r(O,A,B){return A=p(A),A in O?Object.defineProperty(O,A,{value:B,enumerable:!0,configurable:!0,writable:!0}):O[A]=B,O}function n(O,A){if(!(O instanceof A))throw new TypeError("Cannot call a class as a function")}function s(O,A){for(var B=0;B<A.length;B++){var T=A[B];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(O,p(T.key),T)}}function u(O,A,B){return A&&s(O.prototype,A),Object.defineProperty(O,"prototype",{writable:!1}),O}function p(O){var A=S(O,"string");return o(A)==="symbol"?A:String(A)}function S(O,A){if(o(O)!=="object"||O===null)return O;var B=O[Symbol.toPrimitive];if(B!==void 0){var T=B.call(O,A||"default");if(o(T)!=="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(A==="string"?String:Number)(O)}function b(O,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function");O.prototype=Object.create(A&&A.prototype,{constructor:{value:O,writable:!0,configurable:!0}}),Object.defineProperty(O,"prototype",{writable:!1}),A&&R(O,A)}function w(O){var A=E();return function(){var T=a(O),V;if(A){var g=a(this).constructor;V=Reflect.construct(T,arguments,g)}else V=T.apply(this,arguments);return f(this,V)}}function f(O,A){if(A&&(o(A)==="object"||typeof A=="function"))return A;if(A!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return D(O)}function D(O){if(O===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O}function v(O){var A=typeof Map=="function"?new Map:void 0;return v=function(T){if(T===null||!L(T))return T;if(typeof T!="function")throw new TypeError("Super expression must either be null or a function");if(typeof A<"u"){if(A.has(T))return A.get(T);A.set(T,V)}function V(){return P(T,arguments,a(this).constructor)}return V.prototype=Object.create(T.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),R(V,T)},v(O)}function P(O,A,B){return E()?P=Reflect.construct.bind():P=function(V,g,m){var y=[null];y.push.apply(y,g);var U=Function.bind.apply(V,y),_=new U;return m&&R(_,m.prototype),_},P.apply(null,arguments)}function E(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function L(O){return Function.toString.call(O).indexOf("[native code]")!==-1}function R(O,A){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(T,V){return T.__proto__=V,T},R(O,A)}function a(O){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(B){return B.__proto__||Object.getPrototypeOf(B)},a(O)}function o(O){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},o(O)}var l=ft,d=l.inspect,x=Nn(),N=x.codes.ERR_INVALID_ARG_TYPE;function j(O,A,B){return(B===void 0||B>O.length)&&(B=O.length),O.substring(B-A.length,B)===A}function C(O,A){if(A=Math.floor(A),O.length==0||A==0)return"";var B=O.length*A;for(A=Math.floor(Math.log(A)/Math.log(2));A;)O+=O,A--;return O+=O.substring(0,B-O.length),O}var W="",ee="",X="",G="",J={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},xe=10;function Y(O){var A=Object.keys(O),B=Object.create(Object.getPrototypeOf(O));return A.forEach(function(T){B[T]=O[T]}),Object.defineProperty(B,"message",{value:O.message}),B}function pe(O){return d(O,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function we(O,A,B){var T="",V="",g=0,m="",y=!1,U=pe(O),_=U.split(`
|
|
1
|
+
import{r as H,j as i,fV as Gn,l as ur,fW as Yn,eV as pn,eU as dn,eT as Rt,fX as ft,eS as Te,fY as Zn,fZ as mn,f_ as hn,f$ as Xn,g0 as Jn,g1 as gn,g2 as fr,g3 as Qn,g4 as ei,g5 as ti,g6 as ri,eL as er,b7 as ni,cv as Dr,eN as ii,a8 as oi,aP as Ce,u as Fe,N as yn,B as ce,aT as wt,A as vn,D as ai,T as Le,g7 as pr,af as pt,au as Ge,a1 as Se,n as rt,P as M,bC as si,cw as tr,K as ci,eY as li,Z as De,d8 as ui,a0 as mt,bl as Ze,t as nt,g8 as fi,aa as Ye,dw as pi,aY as bn,G as je,a as dt,c as rr,b as di,bF as mi,g9 as xn,bL as wn,aV as hi,X as gi,Y as yi,bQ as En,m as vi,aC as bi,bH as xi}from"./index-CEaTcEQs.js";import{c as wi}from"./index-DZIjChbd.js";import{d as Et}from"./Add-D8jHDZuh.js";import{d as Ei}from"./Loop-BwgmQ4ke.js";import{d as ji}from"./ViewList-DjDLjZbQ.js";import{L as Si,S as Pi,d as jn}from"./list-header-CfS2OSwd.js";import{D as Sn,g as Oi}from"./index-BcUb67P2.js";import"./index-B5vlCSnw.js";import"./index-B6NXai6_.js";import{h as Pn}from"./resource-dialog-uAYGlGhi.js";import{T as Ai}from"./index-CJPYlJzX.js";import{E as On}from"./index-CE9qCuXL.js";import"./fallback-DTP7cYpM.js";import"./index-BQQSQ70k.js";import{d as Ri,U as Ii}from"./user-sessions-Bf8PBzsX.js";import{u as $e,d as Ur,W as An,a as Ti}from"./dashboard-Cwcji3JN.js";import{W as jt}from"./did-address-BIfBoDiQ.js";import{P as ke}from"./permission-VH_Fm7Pw.js";import{C as It}from"./click-to-copy-Cy7g0c_W.js";import{F as nr}from"./FormControl-Chtq9AE7.js";import{I as ir}from"./InputLabel-DMWY4sIp.js";import{S as or}from"./Select-CIDtym3x.js";import{T as Rn}from"./TextField-x4CoNOlz.js";import{D as dr}from"./DialogContentText-D5Xxal_F.js";import{A as tt}from"./Alert-CRD24aa1.js";import{f as Xe}from"./format-error-BOzcbfGa.js";import{_ as _i}from"./useAsync-ByBqdjCT.js";import{I as ar}from"./index-C_flIkR0.js";import{C as Tt}from"./confirm-Bz_GmEiI.js";import{u as In}from"./session-BG5hlQoH.js";import{b as Ni}from"./sdk-BYKTwfxu.js";import{A as Ci}from"./Avatar-BIWwirOj.js";import{d as Di}from"./Delete-B2j1UcE8.js";import{p as Ui}from"./index-HqFqdQ4r.js";import{A as Li}from"./actions-byFcd21l.js";import{L as qi,a as Ki}from"./ListItemText-BR6T5ZDu.js";import{S as ki}from"./shorten-label-DZrPE8HL.js";import{F as Bi,C as Fi}from"./FormControlLabel-BmopTtvW.js";import"./Search-wiijyIeu.js";import"./useThemeProps-B-j4MceL.js";import"./toPropertyKey-PLuKRk1e.js";import"./index-DgFd31_6.js";import"./redux-DN6s-mdl.js";import"./ViewColumn-8HGbbav-.js";import"./useFormControl-BA79DoOc.js";import"./FormGroup-C54kQ9N4.js";import"./LastPage-D0B9CdNo.js";import"./Toolbar-DlYXwq_K.js";import"./MoreVert-MUbtAQHv.js";import"./index-DYNsUZaH.js";import"./Hidden-DPIGUAMJ.js";import"./ExpandMore-IE6fvawl.js";import"./selector-LFwadlX9.js";import"./OpenInNew-CJl5exgf.js";import"./CloseOutlined-BWhWoWD_.js";import"./use-mobile-mkcGNRhM.js";import"./Link-CYqMveft.js";import"./useLocalStorage-CmGNzDHX.js";import"./PlayArrow-DzoHzRoJ.js";import"./ButtonGroup-DcU8GHuP.js";import"./RadioGroup-C6M_sifl.js";import"./index-Bsh1JZ9i.js";import"./useSetState-Cz7xEaUb.js";import"./useSlot-CDa1PttK.js";import"./MoreHoriz-NGD3jXnn.js";import"./Stack-CYabuVI4.js";var mr={};Object.defineProperty(mr,"__esModule",{value:!0});var Tn=mr.default=void 0;$i(H);var Qe=i;function $i(e){return e&&e.__esModule?e:{default:e}}function Lr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function qr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lr(Object(r),!0).forEach(function(n){Mi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mi(e,t,r){return(t=zi(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zi(e){var t=Vi(e,"string");return typeof t=="symbol"?t:t+""}function Vi(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hr=function(t){return(0,Qe.jsxs)("svg",qr(qr({},t),{},{children:[(0,Qe.jsx)("g",{clipPath:"url(#clip0)",children:(0,Qe.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 1.598A4.092 4.092 0 1 0 9 9.78a4.092 4.092 0 0 0 0-8.183zM7.274 3.964a2.44 2.44 0 1 1 3.452 3.451 2.44 2.44 0 0 1-3.452-3.451zm.093 6.343A4.091 4.091 0 0 0 3.275 14.4v2.722c0 .155.126.281.281.281h1.09a.281.281 0 0 0 .28-.281v-2.722a2.44 2.44 0 0 1 2.44-2.44h3.267a2.442 2.442 0 0 1 2.44 2.44v2.722c0 .155.127.281.282.281h1.088a.281.281 0 0 0 .282-.281v-2.722a4.091 4.091 0 0 0-4.092-4.091H7.367z"})}),(0,Qe.jsx)("defs",{children:(0,Qe.jsx)("clipPath",{id:"clip0",children:(0,Qe.jsx)("path",{transform:"translate(0 .5)",d:"M0 0h18v18H0z"})})})]}))};hr.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};hr.displayName="person";Tn=mr.default=hr;var xt={},Wi=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),_n="%[a-f0-9]{2}",Kr=new RegExp("("+_n+")|([^%]+?)","gi"),kr=new RegExp("("+_n+")+","gi");function sr(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],sr(r),sr(n))}function Hi(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(Kr)||[],r=1;r<t.length;r++)e=sr(t,r).join(""),t=e.match(Kr)||[];return e}}function Gi(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=kr.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch{var n=Hi(r[0]);n!==r[0]&&(t[r[0]]=n)}r=kr.exec(e)}t["%C2"]="�";for(var s=Object.keys(t),u=0;u<s.length;u++){var p=s[u];e=e.replace(new RegExp(p,"g"),t[p])}return e}var Yi=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return Gi(e)}},Zi=(e,t)=>{if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t==="")return[e];const r=e.indexOf(t);return r===-1?[e]:[e.slice(0,r),e.slice(r+t.length)]},Xi=function(e,t){for(var r={},n=Object.keys(e),s=Array.isArray(t),u=0;u<n.length;u++){var p=n[u],S=e[p];(s?t.indexOf(p)!==-1:t(p,S,e))&&(r[p]=S)}return r};(function(e){const t=Wi,r=Yi,n=Zi,s=Xi,u=a=>a==null;function p(a){switch(a.arrayFormat){case"index":return o=>(l,d)=>{const x=l.length;return d===void 0||a.skipNull&&d===null||a.skipEmptyString&&d===""?l:d===null?[...l,[w(o,a),"[",x,"]"].join("")]:[...l,[w(o,a),"[",w(x,a),"]=",w(d,a)].join("")]};case"bracket":return o=>(l,d)=>d===void 0||a.skipNull&&d===null||a.skipEmptyString&&d===""?l:d===null?[...l,[w(o,a),"[]"].join("")]:[...l,[w(o,a),"[]=",w(d,a)].join("")];case"comma":case"separator":return o=>(l,d)=>d==null||d.length===0?l:l.length===0?[[w(o,a),"=",w(d,a)].join("")]:[[l,w(d,a)].join(a.arrayFormatSeparator)];default:return o=>(l,d)=>d===void 0||a.skipNull&&d===null||a.skipEmptyString&&d===""?l:d===null?[...l,w(o,a)]:[...l,[w(o,a),"=",w(d,a)].join("")]}}function S(a){let o;switch(a.arrayFormat){case"index":return(l,d,x)=>{if(o=/\[(\d*)\]$/.exec(l),l=l.replace(/\[\d*\]$/,""),!o){x[l]=d;return}x[l]===void 0&&(x[l]={}),x[l][o[1]]=d};case"bracket":return(l,d,x)=>{if(o=/(\[\])$/.exec(l),l=l.replace(/\[\]$/,""),!o){x[l]=d;return}if(x[l]===void 0){x[l]=[d];return}x[l]=[].concat(x[l],d)};case"comma":case"separator":return(l,d,x)=>{const N=typeof d=="string"&&d.includes(a.arrayFormatSeparator),j=typeof d=="string"&&!N&&f(d,a).includes(a.arrayFormatSeparator);d=j?f(d,a):d;const C=N||j?d.split(a.arrayFormatSeparator).map(W=>f(W,a)):d===null?d:f(d,a);x[l]=C};default:return(l,d,x)=>{if(x[l]===void 0){x[l]=d;return}x[l]=[].concat(x[l],d)}}}function b(a){if(typeof a!="string"||a.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function w(a,o){return o.encode?o.strict?t(a):encodeURIComponent(a):a}function f(a,o){return o.decode?r(a):a}function D(a){return Array.isArray(a)?a.sort():typeof a=="object"?D(Object.keys(a)).sort((o,l)=>Number(o)-Number(l)).map(o=>a[o]):a}function v(a){const o=a.indexOf("#");return o!==-1&&(a=a.slice(0,o)),a}function P(a){let o="";const l=a.indexOf("#");return l!==-1&&(o=a.slice(l)),o}function E(a){a=v(a);const o=a.indexOf("?");return o===-1?"":a.slice(o+1)}function L(a,o){return o.parseNumbers&&!Number.isNaN(Number(a))&&typeof a=="string"&&a.trim()!==""?a=Number(a):o.parseBooleans&&a!==null&&(a.toLowerCase()==="true"||a.toLowerCase()==="false")&&(a=a.toLowerCase()==="true"),a}function R(a,o){o=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},o),b(o.arrayFormatSeparator);const l=S(o),d=Object.create(null);if(typeof a!="string"||(a=a.trim().replace(/^[?#&]/,""),!a))return d;for(const x of a.split("&")){if(x==="")continue;let[N,j]=n(o.decode?x.replace(/\+/g," "):x,"=");j=j===void 0?null:["comma","separator"].includes(o.arrayFormat)?j:f(j,o),l(f(N,o),j,d)}for(const x of Object.keys(d)){const N=d[x];if(typeof N=="object"&&N!==null)for(const j of Object.keys(N))N[j]=L(N[j],o);else d[x]=L(N,o)}return o.sort===!1?d:(o.sort===!0?Object.keys(d).sort():Object.keys(d).sort(o.sort)).reduce((x,N)=>{const j=d[N];return j&&typeof j=="object"&&!Array.isArray(j)?x[N]=D(j):x[N]=j,x},Object.create(null))}e.extract=E,e.parse=R,e.stringify=(a,o)=>{if(!a)return"";o=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},o),b(o.arrayFormatSeparator);const l=j=>o.skipNull&&u(a[j])||o.skipEmptyString&&a[j]==="",d=p(o),x={};for(const j of Object.keys(a))l(j)||(x[j]=a[j]);const N=Object.keys(x);return o.sort!==!1&&N.sort(o.sort),N.map(j=>{const C=a[j];return C===void 0?"":C===null?w(j,o):Array.isArray(C)?C.reduce(d(j),[]).join("&"):w(j,o)+"="+w(C,o)}).filter(j=>j.length>0).join("&")},e.parseUrl=(a,o)=>{o=Object.assign({decode:!0},o);const[l,d]=n(a,"#");return Object.assign({url:l.split("?")[0]||"",query:R(E(a),o)},o&&o.parseFragmentIdentifier&&d?{fragmentIdentifier:f(d,o)}:{})},e.stringifyUrl=(a,o)=>{o=Object.assign({encode:!0,strict:!0},o);const l=v(a.url).split("?")[0]||"",d=e.extract(a.url),x=e.parse(d,{sort:!1}),N=Object.assign(x,a.query);let j=e.stringify(N,o);j&&(j=`?${j}`);let C=P(a.url);return a.fragmentIdentifier&&(C=`#${w(a.fragmentIdentifier,o)}`),`${l}${j}${C}`},e.pick=(a,o,l)=>{l=Object.assign({parseFragmentIdentifier:!0},l);const{url:d,query:x,fragmentIdentifier:N}=e.parseUrl(a,l);return e.stringifyUrl({url:d,query:s(x,o),fragmentIdentifier:N},l)},e.exclude=(a,o,l)=>{const d=Array.isArray(o)?x=>!o.includes(x):(x,N)=>!o(x,N);return e.pick(a,d,l)}})(xt);const ct=Yn,Ji={parseNumbers:!1,parseBooleans:!1},Qi={skipNull:!1,skipEmptyString:!1},eo=(e,t)=>{var r,n;const{navigateMode:s="push",parseOptions:u,stringifyOptions:p}={},S=Object.assign(Object.assign({},Ji),u),b=Object.assign(Object.assign({},Qi),p),w=ct.useLocation(),f=(r=ct.useHistory)===null||r===void 0?void 0:r.call(ct),D=(n=ct.useNavigate)===null||n===void 0?void 0:n.call(ct),v=Gn(),P=H.useRef(typeof e=="function"?e():e||{}),E=H.useMemo(()=>xt.parse(w.search,S),[w.search]),L=H.useMemo(()=>Object.assign(Object.assign({},P.current),E),[E]);return[L,ur(a=>{const o=typeof a=="function"?a(L):a;v(),f&&f[s]({hash:w.hash,search:xt.stringify(Object.assign(Object.assign({},E),o),b)||"?"},w.state),D&&D({hash:w.hash,search:xt.stringify(Object.assign(Object.assign({},E),o),b)||"?"},{replace:s==="replace",state:w.state})})]},to=eo;var he={};Object.defineProperty(he,"__esModule",{value:!0});he.isValid=he.fromJSON=he.fromRandom=he.fromAddress=he.fromPublicKey=he.fromSecretKey=he.Wallet=he.WalletType=void 0;const ht=dn,St=Rt,Ae=pn;he.WalletType=Ae.DidType;function it(e,t="default"){const r=(0,Ae.DidType)(t),n=(0,St.getSigner)(r.pk),s=(0,St.getHasher)(r.hash);return{type:r,secretKey:e.sk,publicKey:e.pk,address:e.pk?(0,Ae.fromPublicKey)(e.pk,r):e.address,hash(u,p=1,S="hex"){return s(u,p,S)},sign(u,p=!0,S="hex"){if(!e.sk)throw new Error("Cannot sign data without a secretKey");if(p){const b=s(u,1);return n.sign(b,e.sk,S)}return n.sign(u,e.sk,S)},verify(u,p,S=!0){if(!e.pk)throw new Error("Cannot verify data without a publicKey");const b=S?s(u,1):u;return n.verify(b,p,e.pk)},ethHash(u){if(typeof n.ethHash!="function")throw new Error("ethHash is not supported by signer");return n.ethHash(u)},ethSign(u,p=!0){if(!e.sk)throw new Error("Cannot sign data without a secretKey");if(typeof n.ethHash!="function")throw new Error("ethSign is not supported by signer");return p?n.ethSign(n.ethHash(u),(0,ht.toHex)(e.sk)):n.ethSign(u,(0,ht.toHex)(e.sk))},ethVerify(u,p,S=!0){if(typeof n.ethHash!="function")throw new Error("ethVerify is not supported by signer");const b=S?n.ethHash(u):u;return n.ethRecover(b,p)===this.address},toAddress(){return e.pk?(0,Ae.fromPublicKey)(e.pk,r):e.address},toJSON(){return{type:Ae.DidType.toJSON(r),sk:(0,ht.toHex)(e.sk),pk:(0,ht.toHex)(e.pk),address:this.address}}}}he.Wallet=it;function ro(e,t="default"){const r=(0,Ae.DidType)(t),n={sk:e,pk:(0,St.getSigner)(r.pk).getPublicKey(e)};return it(n,r)}he.fromSecretKey=ro;function no(e,t="default"){return it({pk:e},(0,Ae.DidType)(t))}he.fromPublicKey=no;function io(e){return it({address:(0,Ae.toAddress)(e)},(0,Ae.toTypeInfo)(e))}he.fromAddress=io;function oo(e="default"){const t=(0,Ae.DidType)(e),n=(0,St.getSigner)(t.pk).genKeyPair();return it({sk:n.secretKey,pk:n.publicKey},t)}he.fromRandom=oo;function ao(e){const t=Ae.DidType.fromJSON(e.type);return it(e,t)}he.fromJSON=ao;function so(e,t=!0){return!(!e||typeof e!="object"||typeof e.verify!="function"||typeof e.toAddress!="function"||typeof e.toJSON!="function"||!e.type||!e.publicKey||t&&(!e.secretKey||typeof e.sign!="function"))}he.isValid=so;var Lt={exports:{}},qt={},Br;function Nn(){if(Br)return qt;Br=1;function e(o){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},e(o)}function t(o,l,d){return Object.defineProperty(o,"prototype",{writable:!1}),o}function r(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}function n(o,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),l&&s(o,l)}function s(o,l){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,N){return x.__proto__=N,x},s(o,l)}function u(o){var l=b();return function(){var x=w(o),N;if(l){var j=w(this).constructor;N=Reflect.construct(x,arguments,j)}else N=x.apply(this,arguments);return p(this,N)}}function p(o,l){if(l&&(e(l)==="object"||typeof l=="function"))return l;if(l!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return S(o)}function S(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function b(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function w(o){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(d){return d.__proto__||Object.getPrototypeOf(d)},w(o)}var f={},D,v;function P(o,l,d){d||(d=Error);function x(j,C,W){return typeof l=="string"?l:l(j,C,W)}var N=function(j){n(W,j);var C=u(W);function W(ee,X,G){var J;return r(this,W),J=C.call(this,x(ee,X,G)),J.code=o,J}return t(W)}(d);f[o]=N}function E(o,l){if(Array.isArray(o)){var d=o.length;return o=o.map(function(x){return String(x)}),d>2?"one of ".concat(l," ").concat(o.slice(0,d-1).join(", "),", or ")+o[d-1]:d===2?"one of ".concat(l," ").concat(o[0]," or ").concat(o[1]):"of ".concat(l," ").concat(o[0])}else return"of ".concat(l," ").concat(String(o))}function L(o,l,d){return o.substr(0,l.length)===l}function R(o,l,d){return(d===void 0||d>o.length)&&(d=o.length),o.substring(d-l.length,d)===l}function a(o,l,d){return typeof d!="number"&&(d=0),d+l.length>o.length?!1:o.indexOf(l,d)!==-1}return P("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),P("ERR_INVALID_ARG_TYPE",function(o,l,d){D===void 0&&(D=cr()),D(typeof o=="string","'name' must be a string");var x;typeof l=="string"&&L(l,"not ")?(x="must not be",l=l.replace(/^not /,"")):x="must be";var N;if(R(o," argument"))N="The ".concat(o," ").concat(x," ").concat(E(l,"type"));else{var j=a(o,".")?"property":"argument";N='The "'.concat(o,'" ').concat(j," ").concat(x," ").concat(E(l,"type"))}return N+=". Received type ".concat(e(d)),N},TypeError),P("ERR_INVALID_ARG_VALUE",function(o,l){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";v===void 0&&(v=ft);var x=v.inspect(l);return x.length>128&&(x="".concat(x.slice(0,128),"...")),"The argument '".concat(o,"' ").concat(d,". Received ").concat(x)},TypeError),P("ERR_INVALID_RETURN_VALUE",function(o,l,d){var x;return d&&d.constructor&&d.constructor.name?x="instance of ".concat(d.constructor.name):x="type ".concat(e(d)),"Expected ".concat(o,' to be returned from the "').concat(l,'"')+" function but got ".concat(x,".")},TypeError),P("ERR_MISSING_ARGS",function(){for(var o=arguments.length,l=new Array(o),d=0;d<o;d++)l[d]=arguments[d];D===void 0&&(D=cr()),D(l.length>0,"At least one arg needs to be specified");var x="The ",N=l.length;switch(l=l.map(function(j){return'"'.concat(j,'"')}),N){case 1:x+="".concat(l[0]," argument");break;case 2:x+="".concat(l[0]," and ").concat(l[1]," arguments");break;default:x+=l.slice(0,N-1).join(", "),x+=", and ".concat(l[N-1]," arguments");break}return"".concat(x," must be specified")},TypeError),qt.codes=f,qt}var Kt,Fr;function co(){if(Fr)return Kt;Fr=1;function e(O,A){var B=Object.keys(O);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(O);A&&(T=T.filter(function(V){return Object.getOwnPropertyDescriptor(O,V).enumerable})),B.push.apply(B,T)}return B}function t(O){for(var A=1;A<arguments.length;A++){var B=arguments[A]!=null?arguments[A]:{};A%2?e(Object(B),!0).forEach(function(T){r(O,T,B[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(B)):e(Object(B)).forEach(function(T){Object.defineProperty(O,T,Object.getOwnPropertyDescriptor(B,T))})}return O}function r(O,A,B){return A=p(A),A in O?Object.defineProperty(O,A,{value:B,enumerable:!0,configurable:!0,writable:!0}):O[A]=B,O}function n(O,A){if(!(O instanceof A))throw new TypeError("Cannot call a class as a function")}function s(O,A){for(var B=0;B<A.length;B++){var T=A[B];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(O,p(T.key),T)}}function u(O,A,B){return A&&s(O.prototype,A),Object.defineProperty(O,"prototype",{writable:!1}),O}function p(O){var A=S(O,"string");return o(A)==="symbol"?A:String(A)}function S(O,A){if(o(O)!=="object"||O===null)return O;var B=O[Symbol.toPrimitive];if(B!==void 0){var T=B.call(O,A||"default");if(o(T)!=="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(A==="string"?String:Number)(O)}function b(O,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function");O.prototype=Object.create(A&&A.prototype,{constructor:{value:O,writable:!0,configurable:!0}}),Object.defineProperty(O,"prototype",{writable:!1}),A&&R(O,A)}function w(O){var A=E();return function(){var T=a(O),V;if(A){var g=a(this).constructor;V=Reflect.construct(T,arguments,g)}else V=T.apply(this,arguments);return f(this,V)}}function f(O,A){if(A&&(o(A)==="object"||typeof A=="function"))return A;if(A!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return D(O)}function D(O){if(O===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O}function v(O){var A=typeof Map=="function"?new Map:void 0;return v=function(T){if(T===null||!L(T))return T;if(typeof T!="function")throw new TypeError("Super expression must either be null or a function");if(typeof A<"u"){if(A.has(T))return A.get(T);A.set(T,V)}function V(){return P(T,arguments,a(this).constructor)}return V.prototype=Object.create(T.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),R(V,T)},v(O)}function P(O,A,B){return E()?P=Reflect.construct.bind():P=function(V,g,m){var y=[null];y.push.apply(y,g);var U=Function.bind.apply(V,y),_=new U;return m&&R(_,m.prototype),_},P.apply(null,arguments)}function E(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function L(O){return Function.toString.call(O).indexOf("[native code]")!==-1}function R(O,A){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(T,V){return T.__proto__=V,T},R(O,A)}function a(O){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(B){return B.__proto__||Object.getPrototypeOf(B)},a(O)}function o(O){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},o(O)}var l=ft,d=l.inspect,x=Nn(),N=x.codes.ERR_INVALID_ARG_TYPE;function j(O,A,B){return(B===void 0||B>O.length)&&(B=O.length),O.substring(B-A.length,B)===A}function C(O,A){if(A=Math.floor(A),O.length==0||A==0)return"";var B=O.length*A;for(A=Math.floor(Math.log(A)/Math.log(2));A;)O+=O,A--;return O+=O.substring(0,B-O.length),O}var W="",ee="",X="",G="",J={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},xe=10;function Y(O){var A=Object.keys(O),B=Object.create(Object.getPrototypeOf(O));return A.forEach(function(T){B[T]=O[T]}),Object.defineProperty(B,"message",{value:O.message}),B}function pe(O){return d(O,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function we(O,A,B){var T="",V="",g=0,m="",y=!1,U=pe(O),_=U.split(`
|
|
2
2
|
`),K=pe(A).split(`
|
|
3
3
|
`),F=0,ne="";if(B==="strictEqual"&&o(O)==="object"&&o(A)==="object"&&O!==null&&A!==null&&(B="strictEqualObject"),_.length===1&&K.length===1&&_[0]!==K[0]){var ue=_[0].length+K[0].length;if(ue<=xe){if((o(O)!=="object"||O===null)&&(o(A)!=="object"||A===null)&&(O!==0||A!==0))return"".concat(J[B],`
|
|
4
4
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{l as q}from"./lottie-
|
|
1
|
+
import{l as q}from"./lottie-Bw0llhbP.js";import{r as D,eF as z}from"./index-CEaTcEQs.js";function G(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,u,c,i,b=[],f=!0,A=!1;try{if(c=(r=r.call(t)).next,e!==0)for(;!(f=(n=c.call(r)).done)&&(b.push(n.value),b.length!==e);f=!0);}catch(g){A=!0,u=g}finally{try{if(!f&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(A)throw u}}return b}}function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable})),r.push.apply(r,n)}return r}function I(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?E(Object(r),!0).forEach(function(n){J(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function J(t,e,r){return e=ae(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q(t,e){if(t==null)return{};var r={},n=Object.keys(t),u,c;for(c=0;c<n.length;c++)u=n[c],!(e.indexOf(u)>=0)&&(r[u]=t[u]);return r}function x(t,e){if(t==null)return{};var r=Q(t,e),n,u;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(u=0;u<c.length;u++)n=c[u],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Z(t,e){return ee(t)||G(t,e)||te(t,e)||ne()}function ee(t){if(Array.isArray(t))return t}function te(t,e){if(t){if(typeof t=="string")return j(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(t,e)}}function j(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function re(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ae(t){var e=re(t,"string");return typeof e=="symbol"?e:String(e)}var oe=["animationData","loop","autoplay","initialSegment","onComplete","onLoopComplete","onEnterFrame","onSegmentStart","onConfigReady","onDataReady","onDataFailed","onLoadedImages","onDOMLoaded","onDestroy","lottieRef","renderer","name","assetsPath","rendererSettings"],ie=function(e,r){var n=e.animationData,u=e.loop,c=e.autoplay,i=e.initialSegment,b=e.onComplete,f=e.onLoopComplete,A=e.onEnterFrame,g=e.onSegmentStart,O=e.onConfigReady,w=e.onDataReady,h=e.onDataFailed,l=e.onLoadedImages,L=e.onDOMLoaded,S=e.onDestroy;e.lottieRef,e.renderer,e.name,e.assetsPath,e.rendererSettings;var p=x(e,oe),P=D.useState(!1),s=Z(P,2),C=s[0],_=s[1],o=D.useRef(),v=D.useRef(null),F=function(){var a;(a=o.current)===null||a===void 0||a.play()},H=function(){var a;(a=o.current)===null||a===void 0||a.stop()},M=function(){var a;(a=o.current)===null||a===void 0||a.pause()},V=function(a){var d;(d=o.current)===null||d===void 0||d.setSpeed(a)},N=function(a,d){var m;(m=o.current)===null||m===void 0||m.goToAndPlay(a,d)},B=function(a,d){var m;(m=o.current)===null||m===void 0||m.goToAndStop(a,d)},$=function(a){var d;(d=o.current)===null||d===void 0||d.setDirection(a)},k=function(a,d){var m;(m=o.current)===null||m===void 0||m.playSegments(a,d)},W=function(a){var d;(d=o.current)===null||d===void 0||d.setSubframe(a)},K=function(a){var d;return(d=o.current)===null||d===void 0?void 0:d.getDuration(a)},U=function(){var a;(a=o.current)===null||a===void 0||a.destroy(),o.current=void 0},X=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d;if(v.current){(d=o.current)===null||d===void 0||d.destroy();var m=I(I(I({},e),a),{},{container:v.current});return o.current=q.loadAnimation(m),_(!!o.current),function(){var R;(R=o.current)===null||R===void 0||R.destroy(),o.current=void 0}}};D.useEffect(function(){var y=X();return function(){return y==null?void 0:y()}},[n,u]),D.useEffect(function(){o.current&&(o.current.autoplay=!!c)},[c]),D.useEffect(function(){if(o.current){if(!i){o.current.resetSegments(!0);return}!Array.isArray(i)||!i.length||((o.current.currentRawFrame<i[0]||o.current.currentRawFrame>i[1])&&(o.current.currentRawFrame=i[0]),o.current.setSegment(i[0],i[1]))}},[i]),D.useEffect(function(){var y=[{name:"complete",handler:b},{name:"loopComplete",handler:f},{name:"enterFrame",handler:A},{name:"segmentStart",handler:g},{name:"config_ready",handler:O},{name:"data_ready",handler:w},{name:"data_failed",handler:h},{name:"loaded_images",handler:l},{name:"DOMLoaded",handler:L},{name:"destroy",handler:S}],a=y.filter(function(m){return m.handler!=null});if(a.length){var d=a.map(function(m){var R;return(R=o.current)===null||R===void 0||R.addEventListener(m.name,m.handler),function(){var T;(T=o.current)===null||T===void 0||T.removeEventListener(m.name,m.handler)}});return function(){d.forEach(function(m){return m()})}}},[b,f,A,g,O,w,h,l,L,S]);var Y=z.createElement("div",I({style:r,ref:v},p));return{View:Y,play:F,stop:H,pause:M,setSpeed:V,goToAndStop:B,goToAndPlay:N,setDirection:$,playSegments:k,setSubframe:W,getDuration:K,destroy:U,animationContainerRef:v,animationLoaded:C,animationItem:o.current}};function ue(t){var e=t.getBoundingClientRect(),r=e.top,n=e.height,u=window.innerHeight-r,c=window.innerHeight+n;return u/c}function le(t,e,r){var n=t.getBoundingClientRect(),u=n.top,c=n.left,i=n.width,b=n.height,f=(e-c)/i,A=(r-u)/b;return{x:f,y:A}}var se=function(e){var r=e.wrapperRef,n=e.animationItem,u=e.mode,c=e.actions;D.useEffect(function(){var i=r.current;if(!(!i||!n||!c.length)){n.stop();var b=function(){var g=null,O=function(){var h=ue(i),l=c.find(function(S){var p=S.visibility;return p&&h>=p[0]&&h<=p[1]});if(l){if(l.type==="seek"&&l.visibility&&l.frames.length===2){var L=l.frames[0]+Math.ceil((h-l.visibility[0])/(l.visibility[1]-l.visibility[0])*l.frames[1]);//! goToAndStop must be relative to the start of the current segment
|
|
3
3
|
n.goToAndStop(L-n.firstFrame-1,!0)}l.type==="loop"&&(g===null||g!==l.frames||n.isPaused)&&(n.playSegments(l.frames,!0),g=l.frames),l.type==="play"&&n.isPaused&&(n.resetSegments(!0),n.play()),l.type==="stop"&&n.goToAndStop(l.frames[0]-n.firstFrame-1,!0)}};return document.addEventListener("scroll",O),function(){document.removeEventListener("scroll",O)}},f=function(){var g=function(l,L){var S=l,p=L;if(S!==-1&&p!==-1){var P=le(i,S,p);S=P.x,p=P.y}var s=c.find(function(o){var v=o.position;return v&&Array.isArray(v.x)&&Array.isArray(v.y)?S>=v.x[0]&&S<=v.x[1]&&p>=v.y[0]&&p<=v.y[1]:v&&!Number.isNaN(v.x)&&!Number.isNaN(v.y)?S===v.x&&p===v.y:!1});if(s){if(s.type==="seek"&&s.position&&Array.isArray(s.position.x)&&Array.isArray(s.position.y)&&s.frames.length===2){var C=(S-s.position.x[0])/(s.position.x[1]-s.position.x[0]),_=(p-s.position.y[0])/(s.position.y[1]-s.position.y[0]);n.playSegments(s.frames,!0),n.goToAndStop(Math.ceil((C+_)/2*(s.frames[1]-s.frames[0])),!0)}s.type==="loop"&&n.playSegments(s.frames,!0),s.type==="play"&&(n.isPaused&&n.resetSegments(!1),n.playSegments(s.frames)),s.type==="stop"&&n.goToAndStop(s.frames[0],!0)}},O=function(l){g(l.clientX,l.clientY)},w=function(){g(-1,-1)};return i.addEventListener("mousemove",O),i.addEventListener("mouseout",w),function(){i.removeEventListener("mousemove",O),i.removeEventListener("mouseout",w)}};switch(u){case"scroll":return b();case"cursor":return f()}}},[u,n])},de=function(e){var r=e.actions,n=e.mode,u=e.lottieObj,c=u.animationItem,i=u.View,b=u.animationContainerRef;return se({actions:r,animationItem:c,mode:n,wrapperRef:b}),i},fe=["style","interactivity"],ve=function(e){var r,n,u,c=e.style,i=e.interactivity,b=x(e,fe),f=ie(b,c),A=f.View,g=f.play,O=f.stop,w=f.pause,h=f.setSpeed,l=f.goToAndStop,L=f.goToAndPlay,S=f.setDirection,p=f.playSegments,P=f.setSubframe,s=f.getDuration,C=f.destroy,_=f.animationContainerRef,o=f.animationLoaded,v=f.animationItem;return D.useEffect(function(){e.lottieRef&&(e.lottieRef.current={play:g,stop:O,pause:w,setSpeed:h,goToAndPlay:L,goToAndStop:l,setDirection:S,playSegments:p,setSubframe:P,getDuration:s,destroy:C,animationContainerRef:_,animationLoaded:o,animationItem:v})},[(r=e.lottieRef)===null||r===void 0?void 0:r.current]),de({lottieObj:{View:A,play:g,stop:O,pause:w,setSpeed:h,goToAndStop:l,goToAndPlay:L,setDirection:S,playSegments:p,setSubframe:P,getDuration:s,destroy:C,animationContainerRef:_,animationLoaded:o,animationItem:v},actions:(n=i==null?void 0:i.actions)!==null&&n!==void 0?n:[],mode:(u=i==null?void 0:i.mode)!==null&&u!==void 0?u:"scroll"})};export{q as LottiePlayer,ve as default,ie as useLottie,de as useLottieInteractivity};
|