@abtnode/blocklet-services 1.16.29-beta-2eaf40bc → 1.16.29-beta-cbfd116d
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/libs/connect/session.js +79 -5
- package/api/routes/user.js +34 -0
- package/api/services/auth/connect/switch-profile.js +1 -0
- package/api/services/auth/session.js +2 -1
- package/api/state/profile.js +84 -0
- package/api/util/index.js +7 -0
- package/dist/assets/{Add-C5zWPWbi.js → Add-DUVzKYFm.js} +1 -1
- package/dist/assets/{AddBox-C4A7DDm4.js → AddBox-CT33z_Zw.js} +1 -1
- package/dist/assets/{Alert-D91U5h--.js → Alert-bNqYhcqn.js} +1 -1
- package/dist/assets/{ArrowDropDown-Cq32DOpt.js → ArrowDropDown-D8Cz7Mn2.js} +1 -1
- package/dist/assets/{Avatar-XXXVLUFk.js → Avatar-BOUPLUwk.js} +1 -1
- package/dist/assets/{ButtonGroup-k3SZjeUa.js → ButtonGroup-D4mZO4Fl.js} +1 -1
- package/dist/assets/{CheckCircle-CbXxG2JL.js → CheckCircle-Ocnhk6Zm.js} +1 -1
- package/dist/assets/{ChevronRight-BKcNccG9.js → ChevronRight-DTp0tWJx.js} +1 -1
- package/dist/assets/{Close-CdBP5F4J.js → Close-Dv0WBlnZ.js} +1 -1
- package/dist/assets/CloseOutlined-D-KrmlLZ.js +1 -0
- package/dist/assets/{Delete-DlfFien6.js → Delete-DVuHYKCF.js} +1 -1
- package/dist/assets/{DeleteOutline-De4xAGvs.js → DeleteOutline-Djc7fx6t.js} +1 -1
- package/dist/assets/{Done-DO1tfb2_.js → Done-hVgZPg46.js} +1 -1
- package/dist/assets/{Download-CVseEK0o.js → Download-CaohbVSv.js} +1 -1
- package/dist/assets/{Edit-DOJCHJ5p.js → Edit-B6Q6agid.js} +1 -1
- package/dist/assets/{EditIcon-Bg4AkV00.js → EditIcon-CoTYxPVa.js} +1 -1
- package/dist/assets/{Error-CQmWghPs.js → Error-DPX7wzQI.js} +1 -1
- package/dist/assets/{ExpandMore-DD2GykPj.js → ExpandMore-Dlsr2tPH.js} +1 -1
- package/dist/assets/{FilterList-QafrkXbd.js → FilterList-CxPULTD0.js} +4 -4
- package/dist/assets/{FormControl-Kt4xANtI.js → FormControl-DS4KaFHq.js} +1 -1
- package/dist/assets/{FormControlLabel-B6ISinfm.js → FormControlLabel-C0hZddbx.js} +1 -1
- package/dist/assets/{FormGroup-BEMyIGSj.js → FormGroup-C3fjarrl.js} +1 -1
- package/dist/assets/{Google-DGP2JaKw.js → Google-BlxdY2rj.js} +3 -3
- package/dist/assets/{Hidden-kl5Tbw1B.js → Hidden-B431iBU_.js} +1 -1
- package/dist/assets/{InfoOutlined-BRuBRFbl.js → InfoOutlined-v3x0TY6V.js} +1 -1
- package/dist/assets/{InputAdornment-C5IWgB4u.js → InputAdornment-DobS7Kox.js} +1 -1
- package/dist/assets/{InputLabel-DbdmcDbJ.js → InputLabel-B1CW0pkO.js} +1 -1
- package/dist/assets/{LastPage-DXISIPs8.js → LastPage-C4NAdMRF.js} +1 -1
- package/dist/assets/{Launch-CDcio2Tm.js → Launch-ByMOsCzr.js} +1 -1
- package/dist/assets/{LaunchOutlined-D8a8pCOt.js → LaunchOutlined-D4Flylz3.js} +1 -1
- package/dist/assets/{Link-DFzOJFD-.js → Link-C3mczvyl.js} +1 -1
- package/dist/assets/{ListItemText-Bnnk7Gbj.js → ListItemText-CgBEGXWT.js} +1 -1
- package/dist/assets/{LoadingButton-DGVicOWa.js → LoadingButton-Dlsz1Ms3.js} +1 -1
- package/dist/assets/{LockIcon-CTWJWfSc.js → LockIcon-sRezRxDg.js} +1 -1
- package/dist/assets/{Loop-CbV2fFUd.js → Loop-B8_3BEHM.js} +1 -1
- package/dist/assets/{MoreVert-er-bltGF.js → MoreVert-a-kv_ER7.js} +1 -1
- package/dist/assets/{OpenInNew-Bu6iI6eA.js → OpenInNew-CzbN8XuL.js} +1 -1
- package/dist/assets/{Pagination-Dz7kgZlB.js → Pagination-DFx6ff11.js} +1 -1
- package/dist/assets/{PlayArrow-2r36AAmk.js → PlayArrow-aNY7jbBC.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-CoIXItlb.js → QuestionMarkCircle-B_rw-f43.js} +1 -1
- package/dist/assets/{RadioGroup-C7j1KJ7y.js → RadioGroup-BfWqVp9t.js} +1 -1
- package/dist/assets/{Search-CMyGk9R2.js → Search-M7JhBg8T.js} +1 -1
- package/dist/assets/{Select-BeNQ99oP.js → Select-D9POEHyN.js} +2 -2
- package/dist/assets/{ServerLogo-D12k9g2u.js → ServerLogo-CmEIITqo.js} +1 -1
- package/dist/assets/{Skeleton-FXGSJdkA.js → Skeleton-DSmw4PBH.js} +5 -5
- package/dist/assets/{Slider-GjDHfyBj.js → Slider-DwSRUy4d.js} +1 -1
- package/dist/assets/{Stepper-BF6lz4ut.js → Stepper-LW_MLyom.js} +1 -1
- package/dist/assets/{TextField-D3XEyFR4.js → TextField-tzVHCyGP.js} +1 -1
- package/dist/assets/{Toolbar-_9it32pJ.js → Toolbar-DJupn0f9.js} +1 -1
- package/dist/assets/{ViewList-BhIE_M4V.js → ViewList-C1U7sxhd.js} +1 -1
- package/dist/assets/{access-control-BWh_6uO-.js → access-control-DOWWWYql.js} +1 -1
- package/dist/assets/{actions-DLO5dlyV.js → actions-BVhLyZpR.js} +1 -1
- package/dist/assets/{add-component-core-C3OBXrft.js → add-component-core-DDx1WDjh.js} +21 -23
- package/dist/assets/add-resource-CBt30k1E.js +1 -0
- package/dist/assets/{addon-1j40gf6h.js → addon-B0cj0mfg.js} +1 -1
- package/dist/assets/{analytics-DVd3xO2s.js → analytics-Ct3JnUhl.js} +9 -9
- package/dist/assets/api-CkjkeCdA.js +1 -0
- package/dist/assets/audit-logs-CfrqWHnt.js +58 -0
- package/dist/assets/blocklet-storage-DHTHeqHC.js +1 -0
- package/dist/assets/{button-2f4tapJk.js → button-BTJqPnHF.js} +1 -1
- package/dist/assets/{click-to-copy-CNizZfqS.js → click-to-copy-eJ8KblZ5.js} +1 -1
- package/dist/assets/{complete-CTg4NtH_.js → complete-C1e5FlMJ.js} +4 -4
- package/dist/assets/{component-DyLPRRkR.js → component-BacRXbI5.js} +6 -6
- package/dist/assets/{config-Cl9yfIWh.js → config-7HPh0OPK.js} +1 -1
- package/dist/assets/{config-BBl1Og8k.js → config-BKEljyRy.js} +2 -2
- package/dist/assets/{config-navigation-RZ9QpkFv.js → config-navigation-9PNvdTi2.js} +2 -2
- package/dist/assets/confirm-BUGn-2W8.js +7 -0
- package/dist/assets/{connect-B-qpRVvn.js → connect-C-nA2wuT.js} +1 -1
- package/dist/assets/{connect-DDELE721.js → connect-Cis6vi3E.js} +1 -1
- package/dist/assets/connect-to-CmyzTb62.js +54 -0
- package/dist/assets/{content-layout-CK5XQfmW.js → content-layout-DimpCafz.js} +1 -1
- package/dist/assets/dashboard--jZHvPJB.js +165 -0
- package/dist/assets/{did-address-GzRMEyk7.js → did-address-2bWEhCPb.js} +1 -1
- package/dist/assets/{domain-C3D9kcXD.js → domain-C7z_PdCP.js} +1 -1
- package/dist/assets/{domain-list-BRcBrFVB.js → domain-list-SF-C3yfn.js} +2 -2
- package/dist/assets/{exchange-passport-B9ZrHETZ.js → exchange-passport-bFf5UOyl.js} +1 -1
- package/dist/assets/{fallback-rg9fefdL.js → fallback-26RC6JHo.js} +1 -1
- package/dist/assets/{format-error-B3RYdl6q.js → format-error-HsQXURX_.js} +1 -1
- package/dist/assets/{fuel-BDMvUxVC.js → fuel-BTmuGQUQ.js} +1 -1
- package/dist/assets/{fullpage-DFMbQYE_.js → fullpage-Cjsv3Wf9.js} +1 -1
- package/dist/assets/{home-YZ2dUhxo.js → home-C5blY9H6.js} +1 -1
- package/dist/assets/{iframe-s25HWReH.js → iframe-B-dRGYkN.js} +1 -1
- package/dist/assets/{index-CHJwugzh.js → index-24yb3A6v.js} +4 -4
- package/dist/assets/{index-BU9mgEVG.js → index-B-WWT0RB.js} +1 -1
- package/dist/assets/{index-BPSr4f2j.js → index-B0FNhvZR.js} +1 -1
- package/dist/assets/index-B0pqmro3.js +1 -0
- package/dist/assets/{index-Cx1j9azw.js → index-BDw9WR4Y.js} +1 -1
- package/dist/assets/{index-Bva9FLKW.js → index-BRh4m4iG.js} +1 -1
- package/dist/assets/{index-D12KUiCG.js → index-BhroV0sn.js} +1 -1
- package/dist/assets/{index-CvOK9BmX.js → index-BnDpXkQD.js} +1 -1
- package/dist/assets/index-Bo6_cvnJ.js +4 -0
- package/dist/assets/{index-Db5U7Aba.js → index-BvABiWhK.js} +1 -1
- package/dist/assets/index-C8pZezDf.js +11 -0
- package/dist/assets/{index-DOU4d3bN.js → index-C97B1afx.js} +18 -18
- package/dist/assets/{index-CHbscbku.js → index-CBouf4h_.js} +1 -1
- package/dist/assets/{index-u_IDQFrq.js → index-CEIhpkQ8.js} +1 -1
- package/dist/assets/{config-space-DTE8U19b.js → index-CEzHaZQX.js} +61 -30
- package/dist/assets/{index-Xh4BYwzS.js → index-CIjX7CkA.js} +1 -1
- package/dist/assets/index-CM5JeGjL.js +54 -0
- package/dist/assets/{index-DMq0_62n.js → index-Cj8_nBBf.js} +7 -7
- package/dist/assets/{index-BCpZXkUS.js → index-CrOnhTCB.js} +1 -1
- package/dist/assets/{index-CcddEj1V.js → index-Cs_U4e7a.js} +1 -1
- package/dist/assets/{index-DU7-35nh.js → index-D03FwDOh.js} +1 -1
- package/dist/assets/{index-VRudjsk_.js → index-DATcoDW2.js} +4 -4
- package/dist/assets/{index-Ce3CP3Jp.js → index-DTwcC2c1.js} +6 -6
- package/dist/assets/{index-nyOsFIwy.js → index-DhM5yf8I.js} +1 -1
- package/dist/assets/{index-WDF_phnR.js → index-DuTXpR60.js} +1 -1
- package/dist/assets/index-DzOteYvH.js +1 -0
- package/dist/assets/{index-5qacoeSv.js → index-Hr_Wbh6L.js} +1 -1
- package/dist/assets/index-IcQQOgM-.js +1290 -0
- package/dist/assets/{index-DJLK29SJ.js → index-JXy24O4H.js} +1 -1
- package/dist/assets/index-UfxSCCrt.js +16 -0
- package/dist/assets/{index-UmXxvIz7.js → index-XJYhE0w4.js} +1 -1
- package/dist/assets/{index-Dcp0-2H6.js → index-lx_CUTL7.js} +1 -1
- package/dist/assets/{index-CGXAjTXD.js → index-p63x9Zq5.js} +5 -5
- package/dist/assets/{index.es-BySfVRax.js → index.es-CM1Yp6_h.js} +2 -2
- package/dist/assets/{index.esm-Cpbu1bqz.js → index.esm-ChzwWoAD.js} +1 -1
- package/dist/assets/info-outline-rounded-DSoVZkGR.js +1 -0
- package/dist/assets/{invitation-ZiYOpo0m.js → invitation-DrXYTbOJ.js} +1 -1
- package/dist/assets/{invite-CP_9mlTp.js → invite-DuTRLxo9.js} +1 -1
- package/dist/assets/{issue-passport-OdsEQRgF.js → issue-passport-BlE3WUbc.js} +1 -1
- package/dist/assets/{item-B9vXmxNy.js → item-CADE3Q1i.js} +1 -1
- package/dist/assets/{jss-plugin-props-sort.esm-InWevx1Y.js → jss-plugin-props-sort.esm-BLFIN_3Q.js} +1 -1
- package/dist/assets/{launch-result-message-Z1C1sG3K.js → launch-result-message-ePDZL2vD.js} +1 -1
- package/dist/assets/{layout-BJYUy5aS.js → layout-FpvhR73S.js} +1 -1
- package/dist/assets/{list-header-7mHFR-6j.js → list-header-DXsvXmu-.js} +1 -1
- package/dist/assets/localization-SCjgzakh.js +1 -0
- package/dist/assets/{log-D0ihnCPe.js → log-BRlbvBGI.js} +1 -1
- package/dist/assets/{login-BJ99c8Da.js → login-CWtJouqB.js} +1 -1
- package/dist/assets/{login-oauth-callback-DXPZbXE8.js → login-oauth-callback-BZ0EO56v.js} +1 -1
- package/dist/assets/logo-uploader-CmT8ckaw.js +122 -0
- package/dist/assets/{lost-passport-PezCqF0f.js → lost-passport-YsMU9JSe.js} +3 -3
- package/dist/assets/{lottie-BCG4dny2.js → lottie-BoxmSqiv.js} +1 -1
- package/dist/assets/notifications-W8YDjym1.js +62 -0
- package/dist/assets/{open-window-CuGAzF2Z.js → open-window-CocULKZD.js} +1 -1
- package/dist/assets/overview-DFBre46m.js +12 -0
- package/dist/assets/{page-header-C5ecJ6Qd.js → page-header-DHrt0NLM.js} +1 -1
- package/dist/assets/{permission-BEPRmEw3.js → permission-DC5jJJsJ.js} +1 -1
- package/dist/assets/{preferences-knw56gSD.js → preferences-CeJNU9ax.js} +1 -1
- package/dist/assets/publish-resource-Bv1oefVi.js +1 -0
- package/dist/assets/react-Bq9Lc-LH.js +379 -0
- package/dist/assets/{redux-tOVF_oDT.js → redux-BxhlcuLd.js} +1 -1
- package/dist/assets/resource-dialog-DFiUROrY.js +57 -0
- package/dist/assets/{selector-CNsCKDRb.js → selector-Bgt80Coe.js} +1 -1
- package/dist/assets/session-CxUjHNzI.js +1 -0
- package/dist/assets/setup-DQJXHOhw.js +14 -0
- package/dist/assets/{shorten-label-CunJMulX.js → shorten-label-Cykg6Lz7.js} +1 -1
- package/dist/assets/{slicedToArray-C9-uQLEN.js → slicedToArray-BZ87qXGO.js} +2 -2
- package/dist/assets/{spaces-Dm4toCmL.js → spaces-fGVCv7ID.js} +1 -1
- package/dist/assets/{start-CrrzSOx-.js → start-DHS9hXkS.js} +1 -1
- package/dist/assets/{step-actions-BkxasUm3.js → step-actions-O0ph47PU.js} +1 -1
- package/dist/assets/{studio-Cz2NXhoj.js → studio-DVDs4sAk.js} +1 -1
- package/dist/assets/{switch-control-BOre_YDJ.js → switch-control-PRHugKgV.js} +1 -1
- package/dist/assets/{toUpper-6wIhNvu3.js → toUpper-BfLoBzn-.js} +1 -1
- package/dist/assets/{transfer-DQPf7r9j.js → transfer-NH0JDMM6.js} +1 -1
- package/dist/assets/{uniqBy-C3O4Rmks.js → uniqBy-5dSXPjpT.js} +1 -1
- package/dist/assets/{unsubscribe-DhdgpWxi.js → unsubscribe-DHLJvqL7.js} +1 -1
- package/dist/assets/{url-join-DH_b1eAH.js → url-join-slhKS0RS.js} +1 -1
- package/dist/assets/use-blocklet-info-for-connect-did-spaces-CGcx0VhM.js +1 -0
- package/dist/assets/{use-mobile-CnnusHmf.js → use-mobile-D7_VFCeM.js} +1 -1
- package/dist/assets/useAsync-xzt4qFZd.js +1 -0
- package/dist/assets/{useFormControl-DUzGwbSY.js → useFormControl-DzLIycge.js} +1 -1
- package/dist/assets/{useLocalStorage-B-I-NsSz.js → useLocalStorage-C42lOP94.js} +1 -1
- package/dist/assets/{useSetState-Be-I2Gl-.js → useSetState-Cg2fSW48.js} +1 -1
- package/dist/assets/{useSlot-LBVvloQJ.js → useSlot-D6gCQKPz.js} +1 -1
- package/dist/assets/user-center-BPr1Hwe7.js +1 -0
- package/dist/assets/{util-CoWq6oMk.js → util-DEsBTM-7.js} +1 -1
- package/dist/assets/{wrap-locale-Cn1jipF7.js → wrap-locale-HDcgra7k.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +27 -26
- package/dist/assets/CloseOutlined-Crg0BDr4.js +0 -1
- package/dist/assets/add-resource-DdlMvNYe.js +0 -1
- package/dist/assets/api-C37A8mCN.js +0 -1
- package/dist/assets/audit-logs-CJh_A9OZ.js +0 -58
- package/dist/assets/confirm-CD6_CMUq.js +0 -7
- package/dist/assets/connect-to-DMAPIkc9.js +0 -54
- package/dist/assets/dashboard-BOQEjKT8.js +0 -165
- package/dist/assets/index-BEbMx7tF.js +0 -54
- package/dist/assets/index-BfhVorqV.js +0 -1290
- package/dist/assets/index-CscyFLCJ.js +0 -4
- package/dist/assets/index-Dn7MhkOZ.js +0 -11
- package/dist/assets/index-_y2ZXCMC.js +0 -16
- package/dist/assets/localization-DH4Rcoxd.js +0 -1
- package/dist/assets/logo-uploader-Cb8u4LYv.js +0 -122
- package/dist/assets/notifications-CKxrvr1-.js +0 -62
- package/dist/assets/overview-BSBWgzbj.js +0 -12
- package/dist/assets/publish-resource-D_KlfXTF.js +0 -1
- package/dist/assets/react-Di5TTO9l.js +0 -56
- package/dist/assets/resource-dialog-5vdlaAuh.js +0 -57
- package/dist/assets/session-Cf-ZqG4P.js +0 -1
- package/dist/assets/setup-CbG6rF4U.js +0 -14
- package/dist/assets/use-blocklet-info-for-connect-did-spaces-gtr1x-_o.js +0 -1
- package/dist/assets/useAsync-6Zzjy7PW.js +0 -1
- package/dist/assets/user-center-BXOQaeTd.js +0 -1
- package/dist/assets/user-sessions-CdgU8G0J.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as A,v as R,p as w,e as p}from"./index-
|
|
1
|
+
import{d as A,v as R,p as w,e as p}from"./index-CrOnhTCB.js";const O=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,x=/^[a-zA-Z]:\\/;function N(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return x.test(e)?!1:O.test(e)}const _=["http","https"],z=["nofollow"],L={};function T(e){const r=e||L,g=r.protocols||_,u=A(r.test);return function(h){R(h,"element",function(t,y,E){if(t.tagName==="a"&&typeof t.properties.href=="string"&&u(t,y,E)){const o=t.properties.href;if(N(o)?g.includes(o.slice(0,o.indexOf(":"))):o.startsWith("//")){const n=s(r.content,t),c=n&&!Array.isArray(n)?[n]:n,i=s(r.rel,t)||z,a=typeof i=="string"?w(i):i,f=s(r.target,t),l=s(r.properties,t);if(l&&Object.assign(t.properties,p(l)),a.length>0&&(t.properties.rel=[...a]),f&&(t.properties.target=f),c){const m=s(r.contentProperties,t)||{};t.children.push({type:"element",tagName:"span",properties:p(m),children:p(c)})}}}})}}function s(e,r){return typeof e=="function"?e(r):e}export{T as r};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__fileDeps=["assets/react-
|
|
2
|
-
import{ao as J0,j as o,aD as oe,cE as u0,aG as A,fh as U1,aF as be,aB as Be,aC as Ee,T as Q,r as R,aK as Ae,aH as p0,aI as Oe,aJ as He,cK as Q0,fi as Je,X as Pe,Y as Te,B as z,l as We,P as f,$ as $e,E as q,e as p1,u as te,aM as ye,aV as Ne,bx as Qe,a1 as Ge,L as he,bG as h0,a as ve,az as ce,I as Y0,q as $,Z as de,dq as Z0,a9 as Re,c as fe,F as e2,bU as h1,ce as f0,cz as t2,cI as _e,cJ as x0,bj as o2,cZ as l2,cD as qe,bB as Ke,c1 as r1,f2 as r2,b as ae,bm as s2,dt as n2,ae as m0,bn as i2,ck as a2,aQ as q1,aP as c2,a2 as v0,bk as d2,eT as Me,fj as W1,cQ as u2,ap as p2,h as h2,ay as f2,al as x2,am as Ze}from"./index-BfhVorqV.js";import{d as f1}from"./Add-C5zWPWbi.js";import{d as m2}from"./AddBox-C4A7DDm4.js";import{d as g0}from"./Delete-DlfFien6.js";import{d as v2}from"./Error-CQmWghPs.js";import{D as x1}from"./index-5qacoeSv.js";import{T as b0,b as g2}from"./index-Xh4BYwzS.js";import{C as m1}from"./confirm-CD6_CMUq.js";import{u as Ye}from"./session-Cf-ZqG4P.js";import{W as G1}from"./did-address-GzRMEyk7.js";import{B as v1,d as b2}from"./ChevronRight-BKcNccG9.js";import{S as ge}from"./shorten-label-CunJMulX.js";import{A as j0}from"./Avatar-XXXVLUFk.js";import{d as j2}from"./Download-CVseEK0o.js";import{d as w2}from"./QuestionMarkCircle-CoIXItlb.js";import{b as R2,c as K1,T as C2}from"./index-DJLK29SJ.js";import{_ as ke}from"./useSetState-Be-I2Gl-.js";import{c as g1}from"./index-DU7-35nh.js";import{C as s1,F as n1,S as y2}from"./FormControlLabel-B6ISinfm.js";import{A as w0}from"./Alert-D91U5h--.js";import{p as i1}from"./index-HqFqdQ4r.js";import"./api-C37A8mCN.js";import{i as z2}from"./index-UmXxvIz7.js";import{d as S2}from"./ExpandMore-DD2GykPj.js";import{d as k2}from"./OpenInNew-Bu6iI6eA.js";import{d as M2}from"./DeleteOutline-De4xAGvs.js";import{d as I2}from"./ArrowDropDown-Cq32DOpt.js";import{f as Le}from"./format-error-B3RYdl6q.js";import{c as L2,A as R0,u as P2,S as T2,U as N2}from"./item-B9vXmxNy.js";import{B as V2}from"./ButtonGroup-k3SZjeUa.js";import{T as Ie}from"./TextField-D3XEyFR4.js";import{M as b1}from"./InputAdornment-C5IWgB4u.js";import{d as D2}from"./Launch-CDcio2Tm.js";import{L as _2}from"./MoreVert-er-bltGF.js";import{a as B2}from"./ListItemText-Bnnk7Gbj.js";import{C as E2}from"./click-to-copy-CNizZfqS.js";import{M as A2}from"./index-BCpZXkUS.js";import{r as O2}from"./index-CcddEj1V.js";import{d as H2}from"./Done-DO1tfb2_.js";import{c as C0,d as y0,b as $2,S as F2,a as U2}from"./Stepper-BF6lz4ut.js";import{R as q2,a as X1}from"./RadioGroup-C7j1KJ7y.js";import"./FilterList-QafrkXbd.js";import"./toPropertyKey-hKuLU48H.js";import"./FormControl-Kt4xANtI.js";import"./useFormControl-DUzGwbSY.js";import"./FormGroup-BEMyIGSj.js";import"./InputLabel-DbdmcDbJ.js";import"./Select-BeNQ99oP.js";import"./LastPage-DXISIPs8.js";import"./Toolbar-_9it32pJ.js";import"./index-BPSr4f2j.js";import"./redux-tOVF_oDT.js";import"./Search-CMyGk9R2.js";import"./index-D12KUiCG.js";import"./Link-DFzOJFD-.js";import"./useSlot-LBVvloQJ.js";import"./jss-plugin-props-sort.esm-InWevx1Y.js";const W2=J0(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"),G2=["slots","slotProps"],K2=oe(u0)(({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:U1(e.palette.grey[200],.12)}:{backgroundColor:U1(e.palette.grey[600],.12)})})),X2=oe(W2)({width:24,height:16});function J2(e){const{slots:t={},slotProps:l={}}=e,s=be(e,G2),n=e;return o.jsx("li",{children:o.jsx(K2,A({focusRipple:!0},s,{ownerState:n,children:o.jsx(X2,A({as:t.CollapsedIcon,ownerState:n},l.collapsedIcon))}))})}function Q2(e){return Ee("MuiBreadcrumbs",e)}const Y2=Be("MuiBreadcrumbs",["root","ol","li","separator"]),Z2=Y2,et=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],tt=e=>{const{classes:t}=e;return He({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},Q2,t)},ot=oe(Q,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${Z2.li}`]:t.li},t.root]})({}),lt=oe("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),rt=oe("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function st(e,t,l,s){return e.reduce((n,c,d)=>(d<e.length-1?n=n.concat(c,o.jsx(rt,{"aria-hidden":!0,className:t,ownerState:s,children:l},`separator-${d}`)):n.push(c),n),[])}const nt=R.forwardRef(function(t,l){const s=Ae({props:t,name:"MuiBreadcrumbs"}),{children:n,className:c,component:d="nav",slots:a={},slotProps:u={},expandText:h="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:g=1,maxItems:y=8,separator:p="/"}=s,i=be(s,et),[m,w]=R.useState(!1),v=A({},s,{component:d,expanded:m,expandText:h,itemsAfterCollapse:x,itemsBeforeCollapse:g,maxItems:y,separator:p}),C=tt(v),S=p0({elementType:a.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),N=R.useRef(null),T=k=>{const F=()=>{w(!0);const V=N.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return g+x>=k.length?k:[...k.slice(0,g),o.jsx(J2,{"aria-label":h,slots:{CollapsedIcon:a.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:F},"ellipsis"),...k.slice(k.length-x,k.length)]},I=R.Children.toArray(n).filter(k=>R.isValidElement(k)).map((k,F)=>o.jsx("li",{className:C.li,children:k},`child-${F}`));return o.jsx(ot,A({ref:l,component:d,color:"text.secondary",className:Oe(C.root,c),ownerState:v},i,{children:o.jsx(lt,{className:C.ol,ref:N,ownerState:v,children:st(m||y&&I.length<=y?I:T(I),C.separator,p,v)})}))}),z0=nt;function it(e){return Ee("MuiStepButton",e)}const at=Be("MuiStepButton",["root","horizontal","vertical","touchRipple"]),J1=at,ct=["children","className","icon","optional"],dt=e=>{const{classes:t,orientation:l}=e;return He({root:["root",l],touchRipple:["touchRipple"]},it,t)},ut=oe(u0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${J1.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"},{[`& .${J1.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),pt=R.forwardRef(function(t,l){const s=Ae({props:t,name:"MuiStepButton"}),{children:n,className:c,icon:d,optional:a}=s,u=be(s,ct),{disabled:h,active:x}=R.useContext(C0),{orientation:g}=R.useContext(y0),y=A({},s,{orientation:g}),p=dt(y),i={icon:d,optional:a},m=Q0(n,["StepLabel"])?R.cloneElement(n,i):o.jsx($2,A({},i,{children:n}));return o.jsx(ut,A({focusRipple:!0,disabled:h,TouchRippleProps:{className:p.touchRipple},className:Oe(p.root,c),ref:l,ownerState:y,"aria-current":x?"step":void 0},u,{children:m}))}),ht=pt;function ft(e){return Ee("MuiStepContent",e)}Be("MuiStepContent",["root","last","transition"]);const xt=["children","className","TransitionComponent","transitionDuration","TransitionProps"],mt=e=>{const{classes:t,last:l}=e;return He({root:["root",l&&"last"],transition:["transition"]},ft,t)},vt=oe("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"})),gt=oe(Je,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),bt=R.forwardRef(function(t,l){const s=Ae({props:t,name:"MuiStepContent"}),{children:n,className:c,TransitionComponent:d=Je,transitionDuration:a="auto",TransitionProps:u}=s,h=be(s,xt);R.useContext(y0);const{active:x,last:g,expanded:y}=R.useContext(C0),p=A({},s,{last:g}),i=mt(p);let m=a;return a==="auto"&&!d.muiSupportAuto&&(m=void 0),o.jsx(vt,A({className:Oe(i.root,c),ref:l,ownerState:p},h,{children:o.jsx(gt,A({as:d,in:x||y,className:i.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:n}))}))}),jt=bt;var j1={},wt=Te;Object.defineProperty(j1,"__esModule",{value:!0});var S0=j1.default=void 0,Rt=wt(Pe()),Ct=o;S0=j1.default=(0,Rt.default)((0,Ct.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 w1={},yt=Te;Object.defineProperty(w1,"__esModule",{value:!0});var k0=w1.default=void 0,zt=yt(Pe()),St=o;k0=w1.default=(0,zt.default)((0,St.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 ze({size:e,...t}){return o.jsx(z,{display:"flex",mt:4,...t,children:o.jsx(We,{size:e})})}ze.propTypes={size:f.number};ze.defaultProps={size:24};function R1({did:e,projectId:t,title:l,logo:s,describe:n}){const d=`${`${q.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${s}`,[a,u]=R.useState(!1),h=$e(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(j0,{sx:{borderRadius:1},src:d}),o.jsxs(z,{children:[o.jsx(ge,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:h?"primary.main":""},children:l||"/"}),o.jsx(ge,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:h||a?"primary.main":"grey.700"},children:n||"/"})]})]})}R1.propTypes={projectId:f.string.isRequired,did:f.string.isRequired,title:f.string.isRequired,logo:f.string.isRequired,describe:f.string.isRequired};function C1({initUrl:e}){const t=p1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:s,locale:n}=te(),{api:c}=ye(),{api:d}=Ye(),[a,u]=R.useState(!0),{blocklet:h}=Ne(),[x,g]=R.useState(null),[y,p]=R.useState(!1),i=$e(M=>M.breakpoints.down("xl")),{componentDid:m=""}=Qe(),[w,v]=R.useState(null),C=()=>{c.getProjects({input:{did:h.meta.did,componentDid:m,tenantScope:l}}).then(M=>{const L=(M==null?void 0:M.projects)||[];u(!1),v(L)}).catch(M=>{u(!1),$.error(M.message)})},S=()=>{t(`${q.UNOWNED_DID}/create/none`,{replace:!0})},N=M=>{g(M)},T=()=>{u(!1),p(!0)},I=()=>{p(!1),g(null)},k=M=>{$.error(M.message),p(!1),g(null)},F=M=>{if(!(M!=null&&M.deleted)){$.error("Delete project failed");return}C(),p(!1),g(null)};if(R.useEffect(()=>{C()},[]),!w&&a)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(ze,{})});if(!w)return null;if(!w.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(Ge,{onClick:S,variant:"contained",children:s("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:M=>{const L=w[M];return o.jsx(he,{to:`${L.id}`,children:o.jsx(R1,{did:h.meta.did,projectId:L.id,logo:L.blockletLogo,title:L.blockletTitle,describe:L.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:M=>M?o.jsx(b0,{type:"success",children:M}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:M=>M?o.jsx(G1,{size:14,compact:!0,responsive:!1,did:M}):null}},i||m?null:{label:s("common.createdBy"),name:"createdBy",options:{customBodyRender:M=>M?o.jsx(G1,{onClick:()=>{t(`/.well-known/service/admin/members?did=${M}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:M}):null}},i||m?null:{label:s("common.scope"),name:"componentDid",options:{customBodyRender:M=>{const L=(h.children||[]).find(H=>H.meta.did===M);return L?o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(v1,{size:14,blocklet:L,ancestors:[h]}),o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:L.meta.title})]},M):""}}},i||l?null:{label:s("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:M=>o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(ge,{children:M})})}},{label:s("common.updatedAt"),name:"updatedAt",options:{customBodyRender:M=>o.jsx(h0,{value:Number(M),locale:n})}},{label:s("common.actions"),name:"actions",options:{customBodyRenderLite:M=>{const L=w[M];return o.jsxs(z,{display:"flex",children:[o.jsx(he,{to:`${L.id}/new-release/${L.lastReleaseId}`,children:o.jsx(ve,{title:s("blocklet.publish.createRelease"),placement:"top",children:o.jsx(ce,{color:"primary","aria-label":"create",children:o.jsx(m2,{style:{fontSize:18}})})})}),!!L.lastReleaseId&&o.jsx(ve,{title:s("blocklet.publish.viewLastRelease",{name:L.blockletTitle}),placement:"top",children:o.jsx(ce,{color:"secondary","aria-label":"create",children:o.jsx(he,{style:{display:"flex"},to:`${L.id}/view/${L.lastReleaseId}`,children:o.jsx(S0,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:s("blocklet.publish.delete",{name:L.blockletTitle}),placement:"top",children:o.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>N(L),children:o.jsx(g0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),P=y?o.jsx(Y0,{open:!0,popup:!0,onClose:I,action:"check-has-project-id",locale:n,checkFn:d.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:F,onError:k,extraParams:{projectId:x.id,did:h.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(kt,{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(k0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(Ge,{onClick:S,variant:"contained",children:[o.jsx(f1,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.publish.createBlocklet")]})]}),o.jsx(z,{mt:3}),o.jsx(x1,{className:"main-table",locale:n,data:w,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(m1,{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(M=>o.jsxs(z,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(v2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(Q,{component:"span",variant:"inherit",color:"text.secondary",children:M})]}))})}),P]})}C1.propTypes={initUrl:f.object};C1.defaultProps={initUrl:null};const kt=de(z)`
|
|
1
|
+
const __vite__fileDeps=["assets/react-Bq9Lc-LH.js","assets/index-IcQQOgM-.js","assets/index-CCovGSMB.css","assets/index-DuTXpR60.js","assets/preact.module-B1z5cdvs.js","assets/index-BnDpXkQD.js","assets/index-D03FwDOh.js","assets/toUpper-BfLoBzn-.js","assets/fallback-26RC6JHo.js","assets/index-DTwcC2c1.js","assets/Toolbar-DJupn0f9.js","assets/Hidden-B431iBU_.js","assets/index-C8pZezDf.js","assets/MoreVert-a-kv_ER7.js","assets/Avatar-BOUPLUwk.js","assets/useSlot-D6gCQKPz.js","assets/selector-Bgt80Coe.js","assets/ExpandMore-Dlsr2tPH.js","assets/index-JXy24O4H.js","assets/index-BhroV0sn.js","assets/info-outline-rounded-DSoVZkGR.js","assets/index-DhM5yf8I.js","assets/FormControlLabel-C0hZddbx.js","assets/useFormControl-DzLIycge.js","assets/index-B0pqmro3.js","assets/index-Hr_Wbh6L.js","assets/FilterList-CxPULTD0.js","assets/toPropertyKey-hKuLU48H.js","assets/FormControl-DS4KaFHq.js","assets/FormGroup-C3fjarrl.js","assets/InputLabel-B1CW0pkO.js","assets/ListItemText-CgBEGXWT.js","assets/Select-D9POEHyN.js","assets/TextField-tzVHCyGP.js","assets/LastPage-C4NAdMRF.js","assets/index-B0FNhvZR.js","assets/redux-BxhlcuLd.js","assets/Search-M7JhBg8T.js","assets/Delete-DVuHYKCF.js","assets/url-join-slhKS0RS.js","assets/uniqBy-5dSXPjpT.js","assets/react-BW7E7-P9.css"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
|
|
2
|
+
import{ao as J0,j as o,aD as oe,cK as u0,aG as A,fl as U1,aF as be,aB as Be,aC as Ee,T as Q,r as R,aK as Ae,aH as p0,aI as Oe,aJ as He,cQ as Q0,fm as Je,X as Pe,Y as Te,B as z,l as We,P as f,$ as $e,E as q,e as p1,u as te,aM as ye,aV as Ne,bv as Qe,a1 as Ge,L as he,bI as h0,a as ve,az as ce,I as Y0,q as $,Z as de,dR as Z0,a9 as Re,c as fe,F as e2,bT as h1,ce as f0,cG as t2,cO as _e,cP as x0,bh as o2,d3 as l2,cJ as qe,bC as Ke,c1 as r1,f7 as r2,b as ae,bk as s2,dy as n2,ae as m0,bl as i2,ck as a2,aQ as q1,aP as c2,a2 as v0,bi as d2,eY as Me,fn as W1,cW as u2,ap as p2,h as h2,ay as f2,al as x2,am as Ze}from"./index-IcQQOgM-.js";import{d as f1}from"./Add-DUVzKYFm.js";import{d as m2}from"./AddBox-CT33z_Zw.js";import{d as g0}from"./Delete-DVuHYKCF.js";import{d as v2}from"./Error-DPX7wzQI.js";import{D as x1}from"./index-Hr_Wbh6L.js";import{T as b0,b as g2}from"./index-CIjX7CkA.js";import{C as m1}from"./confirm-BUGn-2W8.js";import{u as Ye}from"./session-CxUjHNzI.js";import{W as G1}from"./did-address-2bWEhCPb.js";import{B as v1,d as b2}from"./ChevronRight-DTp0tWJx.js";import{S as ge}from"./shorten-label-Cykg6Lz7.js";import{A as j0}from"./Avatar-BOUPLUwk.js";import{d as j2}from"./Download-CaohbVSv.js";import{d as w2}from"./QuestionMarkCircle-B_rw-f43.js";import{b as R2,c as K1,T as C2}from"./index-JXy24O4H.js";import{_ as ke}from"./useSetState-Cg2fSW48.js";import{c as g1}from"./index-D03FwDOh.js";import{C as s1,F as n1,S as y2}from"./FormControlLabel-C0hZddbx.js";import{A as w0}from"./Alert-bNqYhcqn.js";import{p as i1}from"./index-HqFqdQ4r.js";import"./api-CkjkeCdA.js";import{i as z2}from"./index-XJYhE0w4.js";import{d as S2}from"./ExpandMore-Dlsr2tPH.js";import{d as k2}from"./OpenInNew-CzbN8XuL.js";import{d as M2}from"./DeleteOutline-Djc7fx6t.js";import{d as I2}from"./ArrowDropDown-D8Cz7Mn2.js";import{f as Le}from"./format-error-HsQXURX_.js";import{c as L2,A as R0,u as P2,S as T2,U as N2}from"./item-CADE3Q1i.js";import{B as V2}from"./ButtonGroup-D4mZO4Fl.js";import{T as Ie}from"./TextField-tzVHCyGP.js";import{I as b1}from"./InputAdornment-DobS7Kox.js";import{d as D2}from"./Launch-ByMOsCzr.js";import{L as _2}from"./MoreVert-a-kv_ER7.js";import{a as B2}from"./ListItemText-CgBEGXWT.js";import{C as E2}from"./click-to-copy-eJ8KblZ5.js";import{M as A2}from"./index-CrOnhTCB.js";import{r as O2}from"./index-Cs_U4e7a.js";import{d as H2}from"./Done-hVgZPg46.js";import{c as C0,d as y0,b as $2,S as F2,a as U2}from"./Stepper-LW_MLyom.js";import{R as q2,a as X1}from"./RadioGroup-BfWqVp9t.js";import"./FilterList-CxPULTD0.js";import"./toPropertyKey-hKuLU48H.js";import"./FormControl-DS4KaFHq.js";import"./useFormControl-DzLIycge.js";import"./FormGroup-C3fjarrl.js";import"./InputLabel-B1CW0pkO.js";import"./Select-D9POEHyN.js";import"./LastPage-C4NAdMRF.js";import"./Toolbar-DJupn0f9.js";import"./index-B0FNhvZR.js";import"./redux-BxhlcuLd.js";import"./Search-M7JhBg8T.js";import"./index-BhroV0sn.js";import"./Link-C3mczvyl.js";import"./useSlot-D6gCQKPz.js";import"./jss-plugin-props-sort.esm-BLFIN_3Q.js";const W2=J0(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"),G2=["slots","slotProps"],K2=oe(u0)(({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:U1(e.palette.grey[200],.12)}:{backgroundColor:U1(e.palette.grey[600],.12)})})),X2=oe(W2)({width:24,height:16});function J2(e){const{slots:t={},slotProps:l={}}=e,s=be(e,G2),n=e;return o.jsx("li",{children:o.jsx(K2,A({focusRipple:!0},s,{ownerState:n,children:o.jsx(X2,A({as:t.CollapsedIcon,ownerState:n},l.collapsedIcon))}))})}function Q2(e){return Ee("MuiBreadcrumbs",e)}const Y2=Be("MuiBreadcrumbs",["root","ol","li","separator"]),Z2=Y2,et=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],tt=e=>{const{classes:t}=e;return He({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},Q2,t)},ot=oe(Q,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${Z2.li}`]:t.li},t.root]})({}),lt=oe("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),rt=oe("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function st(e,t,l,s){return e.reduce((n,c,d)=>(d<e.length-1?n=n.concat(c,o.jsx(rt,{"aria-hidden":!0,className:t,ownerState:s,children:l},`separator-${d}`)):n.push(c),n),[])}const nt=R.forwardRef(function(t,l){const s=Ae({props:t,name:"MuiBreadcrumbs"}),{children:n,className:c,component:d="nav",slots:a={},slotProps:u={},expandText:h="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:g=1,maxItems:y=8,separator:p="/"}=s,i=be(s,et),[m,w]=R.useState(!1),v=A({},s,{component:d,expanded:m,expandText:h,itemsAfterCollapse:x,itemsBeforeCollapse:g,maxItems:y,separator:p}),C=tt(v),S=p0({elementType:a.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),N=R.useRef(null),T=k=>{const F=()=>{w(!0);const V=N.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return g+x>=k.length?k:[...k.slice(0,g),o.jsx(J2,{"aria-label":h,slots:{CollapsedIcon:a.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:F},"ellipsis"),...k.slice(k.length-x,k.length)]},I=R.Children.toArray(n).filter(k=>R.isValidElement(k)).map((k,F)=>o.jsx("li",{className:C.li,children:k},`child-${F}`));return o.jsx(ot,A({ref:l,component:d,color:"text.secondary",className:Oe(C.root,c),ownerState:v},i,{children:o.jsx(lt,{className:C.ol,ref:N,ownerState:v,children:st(m||y&&I.length<=y?I:T(I),C.separator,p,v)})}))}),z0=nt;function it(e){return Ee("MuiStepButton",e)}const at=Be("MuiStepButton",["root","horizontal","vertical","touchRipple"]),J1=at,ct=["children","className","icon","optional"],dt=e=>{const{classes:t,orientation:l}=e;return He({root:["root",l],touchRipple:["touchRipple"]},it,t)},ut=oe(u0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${J1.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"},{[`& .${J1.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),pt=R.forwardRef(function(t,l){const s=Ae({props:t,name:"MuiStepButton"}),{children:n,className:c,icon:d,optional:a}=s,u=be(s,ct),{disabled:h,active:x}=R.useContext(C0),{orientation:g}=R.useContext(y0),y=A({},s,{orientation:g}),p=dt(y),i={icon:d,optional:a},m=Q0(n,["StepLabel"])?R.cloneElement(n,i):o.jsx($2,A({},i,{children:n}));return o.jsx(ut,A({focusRipple:!0,disabled:h,TouchRippleProps:{className:p.touchRipple},className:Oe(p.root,c),ref:l,ownerState:y,"aria-current":x?"step":void 0},u,{children:m}))}),ht=pt;function ft(e){return Ee("MuiStepContent",e)}Be("MuiStepContent",["root","last","transition"]);const xt=["children","className","TransitionComponent","transitionDuration","TransitionProps"],mt=e=>{const{classes:t,last:l}=e;return He({root:["root",l&&"last"],transition:["transition"]},ft,t)},vt=oe("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"})),gt=oe(Je,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),bt=R.forwardRef(function(t,l){const s=Ae({props:t,name:"MuiStepContent"}),{children:n,className:c,TransitionComponent:d=Je,transitionDuration:a="auto",TransitionProps:u}=s,h=be(s,xt);R.useContext(y0);const{active:x,last:g,expanded:y}=R.useContext(C0),p=A({},s,{last:g}),i=mt(p);let m=a;return a==="auto"&&!d.muiSupportAuto&&(m=void 0),o.jsx(vt,A({className:Oe(i.root,c),ref:l,ownerState:p},h,{children:o.jsx(gt,A({as:d,in:x||y,className:i.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:n}))}))}),jt=bt;var j1={},wt=Te;Object.defineProperty(j1,"__esModule",{value:!0});var S0=j1.default=void 0,Rt=wt(Pe()),Ct=o;S0=j1.default=(0,Rt.default)((0,Ct.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 w1={},yt=Te;Object.defineProperty(w1,"__esModule",{value:!0});var k0=w1.default=void 0,zt=yt(Pe()),St=o;k0=w1.default=(0,zt.default)((0,St.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 ze({size:e,...t}){return o.jsx(z,{display:"flex",mt:4,...t,children:o.jsx(We,{size:e})})}ze.propTypes={size:f.number};ze.defaultProps={size:24};function R1({did:e,projectId:t,title:l,logo:s,describe:n}){const d=`${`${q.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${s}`,[a,u]=R.useState(!1),h=$e(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(j0,{sx:{borderRadius:1},src:d}),o.jsxs(z,{children:[o.jsx(ge,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:h?"primary.main":""},children:l||"/"}),o.jsx(ge,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:h||a?"primary.main":"grey.700"},children:n||"/"})]})]})}R1.propTypes={projectId:f.string.isRequired,did:f.string.isRequired,title:f.string.isRequired,logo:f.string.isRequired,describe:f.string.isRequired};function C1({initUrl:e}){const t=p1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:s,locale:n}=te(),{api:c}=ye(),{api:d}=Ye(),[a,u]=R.useState(!0),{blocklet:h}=Ne(),[x,g]=R.useState(null),[y,p]=R.useState(!1),i=$e(M=>M.breakpoints.down("xl")),{componentDid:m=""}=Qe(),[w,v]=R.useState(null),C=()=>{c.getProjects({input:{did:h.meta.did,componentDid:m,tenantScope:l}}).then(M=>{const L=(M==null?void 0:M.projects)||[];u(!1),v(L)}).catch(M=>{u(!1),$.error(M.message)})},S=()=>{t(`${q.UNOWNED_DID}/create/none`,{replace:!0})},N=M=>{g(M)},T=()=>{u(!1),p(!0)},I=()=>{p(!1),g(null)},k=M=>{$.error(M.message),p(!1),g(null)},F=M=>{if(!(M!=null&&M.deleted)){$.error("Delete project failed");return}C(),p(!1),g(null)};if(R.useEffect(()=>{C()},[]),!w&&a)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(ze,{})});if(!w)return null;if(!w.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(Ge,{onClick:S,variant:"contained",children:s("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:M=>{const L=w[M];return o.jsx(he,{to:`${L.id}`,children:o.jsx(R1,{did:h.meta.did,projectId:L.id,logo:L.blockletLogo,title:L.blockletTitle,describe:L.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:M=>M?o.jsx(b0,{type:"success",children:M}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:M=>M?o.jsx(G1,{size:14,compact:!0,responsive:!1,did:M}):null}},i||m?null:{label:s("common.createdBy"),name:"createdBy",options:{customBodyRender:M=>M?o.jsx(G1,{onClick:()=>{t(`/.well-known/service/admin/members?did=${M}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:M}):null}},i||m?null:{label:s("common.scope"),name:"componentDid",options:{customBodyRender:M=>{const L=(h.children||[]).find(H=>H.meta.did===M);return L?o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(v1,{size:14,blocklet:L,ancestors:[h]}),o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:L.meta.title})]},M):""}}},i||l?null:{label:s("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:M=>o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(ge,{children:M})})}},{label:s("common.updatedAt"),name:"updatedAt",options:{customBodyRender:M=>o.jsx(h0,{value:Number(M),locale:n})}},{label:s("common.actions"),name:"actions",options:{customBodyRenderLite:M=>{const L=w[M];return o.jsxs(z,{display:"flex",children:[o.jsx(he,{to:`${L.id}/new-release/${L.lastReleaseId}`,children:o.jsx(ve,{title:s("blocklet.publish.createRelease"),placement:"top",children:o.jsx(ce,{color:"primary","aria-label":"create",children:o.jsx(m2,{style:{fontSize:18}})})})}),!!L.lastReleaseId&&o.jsx(ve,{title:s("blocklet.publish.viewLastRelease",{name:L.blockletTitle}),placement:"top",children:o.jsx(ce,{color:"secondary","aria-label":"create",children:o.jsx(he,{style:{display:"flex"},to:`${L.id}/view/${L.lastReleaseId}`,children:o.jsx(S0,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:s("blocklet.publish.delete",{name:L.blockletTitle}),placement:"top",children:o.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>N(L),children:o.jsx(g0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),P=y?o.jsx(Y0,{open:!0,popup:!0,onClose:I,action:"check-has-project-id",locale:n,checkFn:d.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:F,onError:k,extraParams:{projectId:x.id,did:h.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(kt,{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(k0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(Ge,{onClick:S,variant:"contained",children:[o.jsx(f1,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.publish.createBlocklet")]})]}),o.jsx(z,{mt:3}),o.jsx(x1,{className:"main-table",locale:n,data:w,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(m1,{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(M=>o.jsxs(z,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(v2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(Q,{component:"span",variant:"inherit",color:"text.secondary",children:M})]}))})}),P]})}C1.propTypes={initUrl:f.object};C1.defaultProps={initUrl:null};const kt=de(z)`
|
|
3
3
|
.main-table > div:first-child {
|
|
4
4
|
display: none;
|
|
5
5
|
}
|
|
@@ -133,7 +133,7 @@ import{ao as J0,j as o,aD as oe,cE as u0,aG as A,fh as U1,aF as be,aB as Be,aC a
|
|
|
133
133
|
background: #fff;
|
|
134
134
|
z-index: 10;
|
|
135
135
|
}
|
|
136
|
-
`,_0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:s})=>{var d,a;const n=e?(d=l==null?void 0:l.meta)==null?void 0:d.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 c=c.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===s),{teamDid:n,storeList:c}};function V1({blocklet:e,store:t,onChangeStore:l,onClick:s,disabled:n,loading:c,componentDid:d}){var L,H,O;const{t:a}=te(),{session:u}=Ye(),{api:h,info:x,inService:g}=ye(),y=Ne(),[p,i]=R.useState(!1),m=R.useRef(null),[w,v]=R.useState(!1),[C,S]=R.useState(null),N=E=>{l(E),i(!1)},T=()=>{i(!0)},I=E=>{m.current&&m.current.contains(E.target)||i(!1)},k=()=>{v(!0)},F=()=>{v(!1)},V=async()=>{var E;if(C)try{await h.deleteBlockletStore({input:{teamDid:e.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await((E=y==null?void 0:y.actions)==null?void 0:E.refreshBlocklet())}catch(G){$.error(`Remove Blocklet Store Error: ${Le(G)}`)}finally{S(null)}},{storeList:P}=_0({fromBlocklet:g,blocklet:e,nodeInfo:x,componentDid:d,userDid:(L=u==null?void 0:u.user)==null?void 0:L.did}),M=(H=e==null?void 0:e.meta)==null?void 0:H.did;return o.jsxs(o.Fragment,{children:[o.jsxs(V2,{disabled:n,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(ae,{onClick:s,children:[c&&o.jsx(We,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${(t==null?void 0:t.name)||""}`]}),o.jsx(ae,{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(I2,{})})]}),o.jsx(s2,{sx:{zIndex:10},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:E})=>o.jsx(n2,{...E,style:{transformOrigin:"center top"},children:o.jsx(m0,{children:o.jsx(i2,{onClickAway:I,children:o.jsxs(a2,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto"},children:[P.map(G=>{var K;return o.jsxs(q1,{selected:G.id===t.id,sx:{height:56},onClick:()=>N(G),children:[o.jsxs(z,{children:[o.jsx(ge,{sx:{fontSize:"16px"},maxLength:24,children:G.name}),o.jsx(ge,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:G.url})]}),L2({store:G,userDid:(K=u==null?void 0:u.user)==null?void 0:K.did})&&o.jsx(ce,{sx:{ml:1},onClick:X=>{X.preventDefault(),X.stopPropagation(),S(G)},children:o.jsx(Ke,{icon:"ic:outline-delete"})})]},G.url)}),o.jsx(c2,{}),o.jsxs(q1,{onClick:k,children:[o.jsx(f1,{font:!0}),o.jsx(Q,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),w&&o.jsx(R0,{hiddenChildren:!0,open:!0,onClose:F,teamDid:M,storeList:P,scope:"studio",onAdd:(O=y==null?void 0:y.actions)==null?void 0:O.refreshBlocklet}),C&&o.jsx(m1,{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)})]})}V1.propTypes={store:f.object,blocklet:f.object,onChangeStore:f.func.isRequired,onClick:f.func.isRequired,loading:f.bool.isRequired,disabled:f.bool.isRequired,componentDid:f.string.isRequired,projectType:f.string.isRequired,getData:f.func.isRequired};V1.defaultProps={store:null,blocklet:null};const o1={};async function B0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:s=4e3,timerKey:n=""}){o1[n]&&clearTimeout(o1[n]),await new Promise(a=>setTimeout(a,s));const c=Date.now(),d=async(a,u)=>{try{const h=await e();a(h)}catch(h){Date.now()-c>l?u(h):n?o1[n]=setTimeout(()=>d(a,u),t):setTimeout(()=>d(a,u),t)}};return new Promise(d)}function Al(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Ol(e,{did:t,projectId:l,messageId:s}){return B0(async()=>{var c;const n=await e.getProject({input:{did:t,projectId:l,messageId:s}});if(!((c=n==null?void 0:n.project)!=null&&c.blockletDid))throw new Error("Connected store not found");return n.project.blockletDid},{timerKey:"connect-studio"})}function Hl(e,{did:t,projectId:l,storeId:s}){return B0(async()=>{var d,a;const n=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((a=(d=n==null?void 0:n.project)==null?void 0:d.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!n.project.connectedStores.find(u=>u.storeId===s))throw new Error("Connected store not found")},{timerKey:`connect-store-${s}`})}const l0="lastWantToConnectStoreId";function $l(e){var a,u;const[t,l]=R.useState(null),{session:s}=Ye(),n=R.useCallback(h=>{l(h),localStorage.setItem(l0,h==null?void 0:h.id)},[l]),c=R.useMemo(()=>{var g,y;const h=localStorage.getItem(l0),x=h?(((g=e==null?void 0:e.settings)==null?void 0:g.storeList)||[]).find(p=>p.id===h):null;return x||(((y=e==null?void 0:e.settings)==null?void 0:y.storeList)||[]).find(p=>{var i;return!(p.id!==q.BLOCKLET_STORE.id||p.scope&&p.scope!=="studio"&&p.scope!==((i=s==null?void 0:s.user)==null?void 0:i.did))})},[(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,n]}const r0=[".webp",".jpg",".jpeg",".png",".gif",".svg"],s0=1024*1024*10,n0=R.lazy(()=>v0(()=>import("./react-Di5TTO9l.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])).then(e=>({default:e.Uploader})));function E0({projectId:e,readOnly:t,loading:l,blocklet:s,params:n,setParams:c,paramsErrTip:d,setParamsErrTip:a,setLoading:u,initUrl:h,initLogoUrl:x,setInitLogoUrl:g,componentDid:y}){const{t:p}=te(),{api:i}=ye(),m=p1(),w=R.useRef(null),v=R.useRef(null),[C,S]=$l(s),N=P2({messageType:"connect-store-message",onOpen:()=>u(!0),onClose:()=>u(!1)}),T=async L=>{const H=setTimeout(()=>{u(!1)},2e4),O=await Ol(i,L);u(!1),clearTimeout(H),window.parent.postMessage({event:"studioDialog.connected",componentDid:y},"*"),m(window.location.pathname.replace(`${q.UNOWNED_DID}/create`,`${O}/create`),{replace:!0})},I=()=>{if(!n.blockletTitle){$.error(p("blocklet.publish.errorTip.noTitle"));return}if(!C){$.error("No store found");return}const L=Al();N(async(H,O)=>{var E,G,K;try{const X=await i.connectByStudio({input:{did:(E=s==null?void 0:s.meta)==null?void 0:E.did,blockletTitle:n==null?void 0:n.blockletTitle,storeUrl:C.url,storeId:C.id,storeName:C.name,type:((G=n==null?void 0:n.blockletComponents)==null?void 0:G.length)>0?"pack":"resource",componentDid:y,messageId:L,tenantScope:(h==null?void 0:h.searchParams.get("tenantScope"))||""}});if(!(X!=null&&X.url)){$.error("failed to connect to store");return}O(X.url),T({did:(K=s==null?void 0:s.meta)==null?void 0:K.did,projectId:"",messageId:L})}catch(X){const se=Le(X);$.error(se),u(!1)}})},k=`${q.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/logo/upload`,F=`${q.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/screenshot/upload`,V=n!=null&&n.blockletLogo?`${k}/${n.blockletLogo}`:`${q.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,P=((n==null?void 0:n.blockletScreenshots)||[]).filter(Boolean).map(L=>`${F}/${L}`),M=()=>t?!1:!e||e===q.UNOWNED_DID?($.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0;return o.jsxs(Fl,{children:[o.jsx(z,{display:"flex",className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Ie,{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:n.blockletTitle||"",onChange:L=>{a({blockletTitle:""}),c({blockletTitle:L.target.value})},error:!!d.blockletTitle,helperText:d.blockletTitle||""}),o.jsx(Ie,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===q.UNOWNED_DID&&o.jsx(b1,{position:"end",children:o.jsx(V1,{blocklet:s,store:C,componentDid:y,onChangeStore:S,disabled:!n.blockletTitle||t||l,loading:l,onClick:I})})},error:!!d.projectId,helperText:d.projectId||"",value:e===q.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Ie,{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:n.blockletDescription||"",onChange:L=>{a({blockletDescription:""}),c({blockletDescription:L.target.value})},error:!!d.blockletDescription,helperText:d.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(Q,{variant:"subtitle1",sx:{mr:2},children:p("common.logo")}),o.jsx(z,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(j0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||V,onClick:()=>{M()&&w.current.open()}})})]}),o.jsxs(z,{display:"flex",mt:3,children:[o.jsx(Q,{variant:"subtitle1",sx:{mr:2},children:p("common.screenshot")}),o.jsxs(z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[P.map((L,H)=>o.jsxs(z,{className:"screenshot",children:[o.jsx("img",{alt:"screenshot",src:L}),!t&&o.jsx(ce,{className:"action",onClick:()=>{c(O=>{const E=[...O.blockletScreenshots];return E.splice(H,1),{...O,blockletScreenshots:E}})},children:o.jsx(M2,{})})]},L)),P.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:()=>{M()&&v.current.open()},children:"+"})]})]})]})}),o.jsxs(R.Suspense,{fallback:o.jsx(ze,{}),children:[o.jsx(n0,{ref:w,popup:!0,onUploadFinish:L=>{c({blockletLogo:L.data.filename}),g(""),w.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:k,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:r0,maxFileSize:s0,maxNumberOfFiles:1}}},"uploader-logo"),o.jsx(n0,{ref:v,popup:!0,onUploadFinish:L=>{c(H=>{var E;const O=H.blockletScreenshots||[];return O.push((E=L.data)==null?void 0:E.filename),{...H,blockletScreenshots:O}}),v.current.close()},plugins:["ImageEditor"],apiPathProps:{uploader:F,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:r0,maxFileSize:s0,maxNumberOfFiles:5-P.length}}},"uploader-screenshot")]})]})}E0.propTypes={projectId:f.string.isRequired,readOnly:f.bool.isRequired,params:f.object.isRequired,setParams:f.func.isRequired,paramsErrTip:f.object.isRequired,setParamsErrTip:f.func.isRequired,loading:f.bool.isRequired,blocklet:f.object.isRequired,setLoading:f.func.isRequired,initUrl:f.object.isRequired,componentDid:f.isRequired,initLogoUrl:f.string.isRequired,setInitLogoUrl:f.func.isRequired};const Fl=de.div`
|
|
136
|
+
`,_0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:s})=>{var d,a;const n=e?(d=l==null?void 0:l.meta)==null?void 0:d.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 c=c.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===s),{teamDid:n,storeList:c}};function V1({blocklet:e,store:t,onChangeStore:l,onClick:s,disabled:n,loading:c,componentDid:d}){var L,H,O;const{t:a}=te(),{session:u}=Ye(),{api:h,info:x,inService:g}=ye(),y=Ne(),[p,i]=R.useState(!1),m=R.useRef(null),[w,v]=R.useState(!1),[C,S]=R.useState(null),N=E=>{l(E),i(!1)},T=()=>{i(!0)},I=E=>{m.current&&m.current.contains(E.target)||i(!1)},k=()=>{v(!0)},F=()=>{v(!1)},V=async()=>{var E;if(C)try{await h.deleteBlockletStore({input:{teamDid:e.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await((E=y==null?void 0:y.actions)==null?void 0:E.refreshBlocklet())}catch(G){$.error(`Remove Blocklet Store Error: ${Le(G)}`)}finally{S(null)}},{storeList:P}=_0({fromBlocklet:g,blocklet:e,nodeInfo:x,componentDid:d,userDid:(L=u==null?void 0:u.user)==null?void 0:L.did}),M=(H=e==null?void 0:e.meta)==null?void 0:H.did;return o.jsxs(o.Fragment,{children:[o.jsxs(V2,{disabled:n,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(ae,{onClick:s,children:[c&&o.jsx(We,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${(t==null?void 0:t.name)||""}`]}),o.jsx(ae,{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(I2,{})})]}),o.jsx(s2,{sx:{zIndex:10},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:E})=>o.jsx(n2,{...E,style:{transformOrigin:"center top"},children:o.jsx(m0,{children:o.jsx(i2,{onClickAway:I,children:o.jsxs(a2,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto"},children:[P.map(G=>{var K;return o.jsxs(q1,{selected:G.id===t.id,sx:{height:56},onClick:()=>N(G),children:[o.jsxs(z,{children:[o.jsx(ge,{sx:{fontSize:"16px"},maxLength:24,children:G.name}),o.jsx(ge,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:G.url})]}),L2({store:G,userDid:(K=u==null?void 0:u.user)==null?void 0:K.did})&&o.jsx(ce,{sx:{ml:1},onClick:X=>{X.preventDefault(),X.stopPropagation(),S(G)},children:o.jsx(Ke,{icon:"ic:outline-delete"})})]},G.url)}),o.jsx(c2,{}),o.jsxs(q1,{onClick:k,children:[o.jsx(f1,{font:!0}),o.jsx(Q,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),w&&o.jsx(R0,{hiddenChildren:!0,open:!0,onClose:F,teamDid:M,storeList:P,scope:"studio",onAdd:(O=y==null?void 0:y.actions)==null?void 0:O.refreshBlocklet}),C&&o.jsx(m1,{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)})]})}V1.propTypes={store:f.object,blocklet:f.object,onChangeStore:f.func.isRequired,onClick:f.func.isRequired,loading:f.bool.isRequired,disabled:f.bool.isRequired,componentDid:f.string.isRequired,projectType:f.string.isRequired,getData:f.func.isRequired};V1.defaultProps={store:null,blocklet:null};const o1={};async function B0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:s=4e3,timerKey:n=""}){o1[n]&&clearTimeout(o1[n]),await new Promise(a=>setTimeout(a,s));const c=Date.now(),d=async(a,u)=>{try{const h=await e();a(h)}catch(h){Date.now()-c>l?u(h):n?o1[n]=setTimeout(()=>d(a,u),t):setTimeout(()=>d(a,u),t)}};return new Promise(d)}function Al(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Ol(e,{did:t,projectId:l,messageId:s}){return B0(async()=>{var c;const n=await e.getProject({input:{did:t,projectId:l,messageId:s}});if(!((c=n==null?void 0:n.project)!=null&&c.blockletDid))throw new Error("Connected store not found");return n.project.blockletDid},{timerKey:"connect-studio"})}function Hl(e,{did:t,projectId:l,storeId:s}){return B0(async()=>{var d,a;const n=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((a=(d=n==null?void 0:n.project)==null?void 0:d.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!n.project.connectedStores.find(u=>u.storeId===s))throw new Error("Connected store not found")},{timerKey:`connect-store-${s}`})}const l0="lastWantToConnectStoreId";function $l(e){var a,u;const[t,l]=R.useState(null),{session:s}=Ye(),n=R.useCallback(h=>{l(h),localStorage.setItem(l0,h==null?void 0:h.id)},[l]),c=R.useMemo(()=>{var g,y;const h=localStorage.getItem(l0),x=h?(((g=e==null?void 0:e.settings)==null?void 0:g.storeList)||[]).find(p=>p.id===h):null;return x||(((y=e==null?void 0:e.settings)==null?void 0:y.storeList)||[]).find(p=>{var i;return!(p.id!==q.BLOCKLET_STORE.id||p.scope&&p.scope!=="studio"&&p.scope!==((i=s==null?void 0:s.user)==null?void 0:i.did))})},[(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,n]}const r0=[".webp",".jpg",".jpeg",".png",".gif",".svg"],s0=1024*1024*10,n0=R.lazy(()=>v0(()=>import("./react-Bq9Lc-LH.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])).then(e=>({default:e.Uploader})));function E0({projectId:e,readOnly:t,loading:l,blocklet:s,params:n,setParams:c,paramsErrTip:d,setParamsErrTip:a,setLoading:u,initUrl:h,initLogoUrl:x,setInitLogoUrl:g,componentDid:y}){const{t:p}=te(),{api:i}=ye(),m=p1(),w=R.useRef(null),v=R.useRef(null),[C,S]=$l(s),N=P2({messageType:"connect-store-message",onOpen:()=>u(!0),onClose:()=>u(!1)}),T=async L=>{const H=setTimeout(()=>{u(!1)},2e4),O=await Ol(i,L);u(!1),clearTimeout(H),window.parent.postMessage({event:"studioDialog.connected",componentDid:y},"*"),m(window.location.pathname.replace(`${q.UNOWNED_DID}/create`,`${O}/create`),{replace:!0})},I=()=>{if(!n.blockletTitle){$.error(p("blocklet.publish.errorTip.noTitle"));return}if(!C){$.error("No store found");return}const L=Al();N(async(H,O)=>{var E,G,K;try{const X=await i.connectByStudio({input:{did:(E=s==null?void 0:s.meta)==null?void 0:E.did,blockletTitle:n==null?void 0:n.blockletTitle,storeUrl:C.url,storeId:C.id,storeName:C.name,type:((G=n==null?void 0:n.blockletComponents)==null?void 0:G.length)>0?"pack":"resource",componentDid:y,messageId:L,tenantScope:(h==null?void 0:h.searchParams.get("tenantScope"))||""}});if(!(X!=null&&X.url)){$.error("failed to connect to store");return}O(X.url),T({did:(K=s==null?void 0:s.meta)==null?void 0:K.did,projectId:"",messageId:L})}catch(X){const se=Le(X);$.error(se),u(!1)}})},k=`${q.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/logo/upload`,F=`${q.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/screenshot/upload`,V=n!=null&&n.blockletLogo?`${k}/${n.blockletLogo}`:`${q.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,P=((n==null?void 0:n.blockletScreenshots)||[]).filter(Boolean).map(L=>`${F}/${L}`),M=()=>t?!1:!e||e===q.UNOWNED_DID?($.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0;return o.jsxs(Fl,{children:[o.jsx(z,{display:"flex",className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Ie,{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:n.blockletTitle||"",onChange:L=>{a({blockletTitle:""}),c({blockletTitle:L.target.value})},error:!!d.blockletTitle,helperText:d.blockletTitle||""}),o.jsx(Ie,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===q.UNOWNED_DID&&o.jsx(b1,{position:"end",children:o.jsx(V1,{blocklet:s,store:C,componentDid:y,onChangeStore:S,disabled:!n.blockletTitle||t||l,loading:l,onClick:I})})},error:!!d.projectId,helperText:d.projectId||"",value:e===q.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Ie,{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:n.blockletDescription||"",onChange:L=>{a({blockletDescription:""}),c({blockletDescription:L.target.value})},error:!!d.blockletDescription,helperText:d.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(Q,{variant:"subtitle1",sx:{mr:2},children:p("common.logo")}),o.jsx(z,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(j0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||V,onClick:()=>{M()&&w.current.open()}})})]}),o.jsxs(z,{display:"flex",mt:3,children:[o.jsx(Q,{variant:"subtitle1",sx:{mr:2},children:p("common.screenshot")}),o.jsxs(z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[P.map((L,H)=>o.jsxs(z,{className:"screenshot",children:[o.jsx("img",{alt:"screenshot",src:L}),!t&&o.jsx(ce,{className:"action",onClick:()=>{c(O=>{const E=[...O.blockletScreenshots];return E.splice(H,1),{...O,blockletScreenshots:E}})},children:o.jsx(M2,{})})]},L)),P.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:()=>{M()&&v.current.open()},children:"+"})]})]})]})}),o.jsxs(R.Suspense,{fallback:o.jsx(ze,{}),children:[o.jsx(n0,{ref:w,popup:!0,onUploadFinish:L=>{c({blockletLogo:L.data.filename}),g(""),w.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:k,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:r0,maxFileSize:s0,maxNumberOfFiles:1}}},"uploader-logo"),o.jsx(n0,{ref:v,popup:!0,onUploadFinish:L=>{c(H=>{var E;const O=H.blockletScreenshots||[];return O.push((E=L.data)==null?void 0:E.filename),{...H,blockletScreenshots:O}}),v.current.close()},plugins:["ImageEditor"],apiPathProps:{uploader:F,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:r0,maxFileSize:s0,maxNumberOfFiles:5-P.length}}},"uploader-screenshot")]})]})}E0.propTypes={projectId:f.string.isRequired,readOnly:f.bool.isRequired,params:f.object.isRequired,setParams:f.func.isRequired,paramsErrTip:f.object.isRequired,setParamsErrTip:f.func.isRequired,loading:f.bool.isRequired,blocklet:f.object.isRequired,setLoading:f.func.isRequired,initUrl:f.object.isRequired,componentDid:f.isRequired,initLogoUrl:f.string.isRequired,setInitLogoUrl:f.func.isRequired};const Fl=de.div`
|
|
137
137
|
margin-top: 24px;
|
|
138
138
|
.screenshot {
|
|
139
139
|
margin-bottom: 16px;
|
|
@@ -178,7 +178,7 @@ import{ao as J0,j as o,aD as oe,cE as u0,aG as A,fh as U1,aF as be,aB as Be,aC a
|
|
|
178
178
|
padding-bottom: 12px;
|
|
179
179
|
border-bottom: ${({theme:e})=>`1px solid ${e.palette.divider}`};
|
|
180
180
|
}
|
|
181
|
-
`;function $0({text:e}){return e?o.jsx(A2,{wrapperElement:{"data-color-mode":"light"},source:e,rehypePlugins:[[O2,{target:"_blank"}]]}):o.jsx(Ce,{Icon:Fe})}$0.propTypes={text:f.string.isRequired};function F0({params:e,setParams:t,paramsErrTip:l,loading:s,setParamsErrTip:n,readOnly:c}){var x;const{t:d}=te(),[a,u]=R.useState(c?"preview":"write"),h=(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(Q,{variant:"h6",fontWeight:"bold",sx:{},children:d("common.introduction")}),o.jsxs(R2,{value:a,onChange:h,"aria-label":"wrapped label tabs example",children:[o.jsx(K1,{value:"write",label:"Write"}),o.jsx(K1,{value:"preview",label:"Preview"})]})]}),o.jsx(z,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Ie,{disabled:s||c,sx:{border:"none"},placeholder:`Blocklet ${d("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:o.jsxs(b1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",Re.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{n({blockletIntroduction:""}),t({blockletIntroduction:g.target.value.slice(0,Re.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(z,{display:a==="preview"?"block":"none",mt:3,children:o.jsx($0,{text:e.blockletIntroduction||""})})]})}F0.propTypes={params:f.object.isRequired,setParams:f.func.isRequired,paramsErrTip:f.object.isRequired,setParamsErrTip:f.func.isRequired,readOnly:f.bool.isRequired,loading:f.bool.isRequired};var B1={},Yl=Te;Object.defineProperty(B1,"__esModule",{value:!0});var U0=B1.default=void 0,Zl=Yl(Pe()),i0=o;U0=B1.default=(0,Zl.default)([(0,i0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,i0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function E1({step:e,ok:t,active:l,error:s}){let n="grey.500",c=e+1;return t&&(c=o.jsx(H2,{sx:{fontSize:18,margin:0},color:"white"})),s||!t&&l>e?(n="error.main",c=o.jsx(U0,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(n="primary.main"),o.jsx(z,{width:24,height:24,bgcolor:n,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:c})}E1.propTypes={step:f.number,ok:f.bool,active:f.number,error:f.string};E1.defaultProps={step:0,ok:!1,active:0,error:""};function q0({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:s,params:n,loading:c,paramsErrTip:d,viewMode:a,projectId:u}){const{t:h}=te(),x=()=>{l(i=>i+1)},g=()=>{l(i=>i-1)},y=i=>i===0?(d==null?void 0:d.blockletTitle)||(d==null?void 0:d.projectId)||(d==null?void 0:d.blockletDescription):i===2?d==null?void 0:d.blockletResource:i>=4?(d==null?void 0:d.blockletVersion)||(d==null?void 0:d.note):"",p=a||O0({hasSelectedResources:s,params:n,projectId:u,t:h})===null;return o.jsxs(z,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(F2,{activeStep:t,orientation:"vertical",children:e.map((i,m)=>{const w={},v=c||!Gl({hasSelectedResources:s,params:n,projectId:u,step:m,t:h}),C=c?"":y(m);return C&&(w.optional=o.jsx(Q,{variant:"caption",color:"error",children:C}),w.error=!0),o.jsxs(U2,{children:[o.jsx(ht,{icon:o.jsx(E1,{error:C,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...w,children:o.jsx(Q,{fontSize:"14px",fontWeight:"500",color:C||!v&&t>m?"error.main":"inherit",children:i.label})}),o.jsxs(jt,{children:[o.jsx(Q,{fontSize:12,children:i.description}),!p&&o.jsx(z,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(ae,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:C||!v,children:h("common.continue")}),m>0&&o.jsx(ae,{disabled:m===0,onClick:g,sx:{mt:1,mr:1},children:h("common.back")})]})})]})]},i.label)})}),t>=e.length-1&&o.jsx(m0,{square:!0,elevation:0,sx:{p:3},children:o.jsx(Q,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}q0.propTypes={steps:f.array.isRequired,activeStep:f.number.isRequired,setActiveStep:f.func.isRequired,params:f.object.isRequired,viewMode:f.string.isRequired,loading:f.bool.isRequired,projectId:f.string.isRequired,hasSelectedResources:f.bool.isRequired,paramsErrTip:f.shape({projectId:f.string,blockletVersion:f.string,blockletTitle:f.string,blockletDescription:f.string,note:f.string,blockletResource:f.string}).isRequired};const e3=[".zip",".gz"],t3=1024*1024*100,o3=R.lazy(()=>v0(()=>import("./react-Di5TTO9l.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])).then(e=>({default:e.Uploader})));function A1({app:e,projectId:t,readOnly:l,params:s,setParams:n,setParamsErrTip:c,error:d}){const{t:a}=te(),u=R.useRef(null),h=()=>l?!1:!t||t===q.UNOWNED_DID?($.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${q.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(z,{sx:{mt:3},children:[o.jsx(Q,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),o.jsxs(y2,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!s.uploadedResource&&o.jsx(Q,{component:"a",href:`${x}/params.uploadedResource`,children:s.uploadedResource}),!l&&o.jsx(ae,{variant:"outlined",size:"small",onClick:()=>{var g;h()&&((g=u.current)==null||g.open())},children:s.uploadedResource?a("common.change"):a("common.upload")})]}),o.jsx(R.Suspense,{fallback:o.jsx(ze,{}),children:o.jsx(o3,{ref:u,popup:!0,onUploadFinish:g=>{var y;n({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:e3,maxFileSize:t3,maxNumberOfFiles:1}}},"uploader-resource")}),!!d&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:d})]})}A1.propTypes={app:f.object.isRequired,projectId:f.string.isRequired,readOnly:f.bool.isRequired,params:f.object.isRequired,setParams:f.func.isRequired,error:f.string.isRequired,setParamsErrTip:f.func.isRequired};A1.defaultProps={};function Xe({readOnly:e,params:t,setParams:l,paramsErrTip:s,setParamsErrTip:n,loading:c}){var a;const{t:d}=te();return o.jsx(z,{display:"flex",mt:3,className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Ie,{required:!0,disabled:c||e,label:`Blocklet ${d("common.version")}`,placeholder:`Blocklet ${d("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:u=>{n({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!s.blockletVersion,helperText:s.blockletVersion||""}),o.jsx(Ie,{label:d("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(b1,{position:"end",children:[((a=t==null?void 0:t.note)==null?void 0:a.length)||0," / ",Re.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{n({note:""}),l({note:u.target.value.slice(0,Re.PROJECT.MAX_NOTE_LENGTH)})},error:!!s.note,helperText:s.note||"",sx:{mt:3}})]})})}Xe.propTypes={readOnly:f.bool.isRequired,params:f.object.isRequired,setParams:f.func.isRequired,paramsErrTip:f.object.isRequired,setParamsErrTip:f.func.isRequired,loading:f.bool.isRequired};Xe.defaultProps={};const l3=({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(v1,{size:24,blocklet:t,ancestors:l}),o.jsx(z,{ml:"4px",className:"text",children:o.jsx(z,{children:t.meta.title})})]},s),value:s})},a0=(e,t)=>{const l=h1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","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},r3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},c0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function O1({initUrl:e,...t}){var F1;const{projectId:l,mode:s,releaseId:n,componentDid:c=""}=Qe(),{t:d}=te(),{blocklet:a}=Ne(),[u,h]=ke({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,g]=ke({}),[y,p]=R.useState(!1),[i,m]=ke(null),{api:w}=ye(),v=$e(D=>D.breakpoints.down("md")),[C,S]=R.useState({}),[N,T]=R.useState(!1),I=R.useRef({}),[k,F]=ke({}),[V,P]=R.useState(""),[M,L]=ke({}),H=e==null?void 0:e.searchParams.get("dependentComponentsMode"),O=H==="readonly",E=R.useCallback(D=>{O&&h({blockletComponents:[]}),L(D)},[O,L,h]),G=R.useCallback((...D)=>{F(...D),g({blockletResource:""})},[]),K=n==="none"?(u==null?void 0:u.lastReleaseId)||"":n,[X,se]=R.useState(s==="new-release"?4:0);R.useEffect(()=>{l&&g({projectId:""})},[l,g]);const je=R.useMemo(()=>{var D;return(D=u==null?void 0:u.blockletComponents)!=null&&D.some(B=>B.included)||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource]),le=[],re=((a==null?void 0:a.children)||[]).filter(D=>{var B;return(B=D.meta.resource)==null?void 0:B.exportApi}).filter(D=>!c||D.meta.did===c);re.forEach(D=>{l3({tabs:le,blocklet:D,t:d,ancestors:[a]})});const[W,Y]=R.useState((F1=le[0])==null?void 0:F1.value),U=!N&&(i==null?void 0:i.status)==="published",ee=U,ue=R.useMemo(()=>{const D={};return Object.keys(M).forEach(B=>{const Ue=M[B];Ue&&Ue.forEach(X0=>{D[X0]=!0})}),D},[M]),xe=h2(()=>{if(!e)return;P(e.searchParams.get("logo")),h(B=>({...B,blockletTitle:(B==null?void 0:B.blockletTitle)||e.searchParams.get("title"),blockletDescription:(B==null?void 0:B.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(B==null?void 0:B.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(B==null?void 0:B.blockletComponents)||JSON.parse(e.searchParams.get("components")||"[]"),note:(B==null?void 0:B.note)||e.searchParams.get("note")||"No note"}));const D=e.searchParams.get("resources");try{const B=JSON.parse(D);S(B)}catch{}}),Z=async()=>{if(K)try{const D=await w.getRelease({input:{did:a.meta.did,projectId:l,releaseId:K}});if(p(!1),!D.release){$.error("Release not found");return}s!=="view"&&(D.release.note=""),h(B=>a0({...B,...D.release,blockletVersion:s==="create"||s==="new-release"?Me.inc(D.release.blockletVersion,"patch"):D.release.blockletVersion},a)),m(D.release)}catch(D){p(!1),$.error(Le(D))}},ne=async()=>{if(l===q.UNOWNED_DID){h({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){$.error(d("blocklet.publish.errorTip.noDid"));return}try{const D=await w.getProject({input:{did:a.meta.did,projectId:l}});p(!1);const B=D.project||{};B.blockletVersion?(s==="create"||s==="new-release")&&Me.valid(B.blockletVersion)&&(B.blockletVersion=Me.inc(B.blockletVersion,"patch")):B.blockletVersion="1.0.0";const Ue=a0(B,a);h(Ue),B.lastReleaseId||xe()}catch(D){p(!1),$.error(Le(D))}},ie=R.useCallback(async()=>{if(s==="view"){if(!K){$.error("Empty release id");return}await ne(),await Z();return}await ne(),K&&(T(!0),await Z())},[s,K]),_=D=>{h({blockletComponents:D})};R.useEffect(()=>{ie()},[ie]),R.useEffect(()=>{l===q.UNOWNED_DID&&(s==="create"||s==="new-release")&&e&&xe()},[l,e,s,xe]);const J=R.useMemo(()=>!!Object.keys(k).find(D=>!!k[D].length),[k]);if(!u&&y)return o.jsx(ze,{});if(!u)return null;const pe=re.find(D=>D.meta.did===W);if(re.every(D=>D.status!=="running"))return o.jsx(Ce,{children:d("blocklet.publish.allComponentsNotRunning")});const G0=D=>{Y(D)},H1=e==null?void 0:e.searchParams.get("resourcesTitle"),$1=e==null?void 0:e.searchParams.get("componentsTitle"),Se=[{label:d("blocklet.publish.branding"),description:d("blocklet.publish.steps.branding")},{label:d("common.introduction"),description:d("blocklet.publish.steps.introduction")},{label:H1||d("blocklet.publish.resourceTitle"),description:d("blocklet.publish.steps.resources")},{label:$1||d("common.components"),description:d("blocklet.publish.steps.blocklets")},{label:d("blocklet.publish.versionTitle"),description:d("blocklet.publish.steps.version")}],K0=Se[X]||Se[Se.length-1],we=r3[X];return o.jsxs(s3,{...t,children:[o.jsx(H0,{blocklet:a,release:i,getData:ie,getRelease:Z,mode:s,params:u,setParams:h,setParamsErrTip:g,readOnly:ee,isPublished:U,loading:y,setLoading:p,initLogoUrl:V,releaseId:K,projectId:l,projectType:je,resourceComponents:re,resourceComponentsMap:M,resourceRelateComponents:ue,resourceItem:pe,saveSelectedEventsRef:I,hasSelectedResources:J,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(q0,{steps:Se,viewMode:s==="view",params:u,hasSelectedResources:J||u.uploadedResource,paramsErrTip:x,activeStep:X,setActiveStep:se,projectId:l,resourcesUrlTitle:H1,componentsUrlTitle:$1}),o.jsxs(z,{flex:"1",maxWidth:"720px",children:[!v&&we!=="introduction"&&o.jsxs(Q,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[K0.label,we==="branding"&&o.jsx(ve,{title:d("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(w2,{})})})]}),(v||we==="branding")&&o.jsx(z,{flexDirection:"column",children:o.jsx(E0,{projectId:l,setParams:h,setParamsErrTip:g,params:u,componentDid:c,blocklet:a,initUrl:e,loading:y,setLoading:p,paramsErrTip:x,readOnly:ee,initLogoUrl:V,setInitLogoUrl:P})}),v&&o.jsx(z,{flexDirection:"column",children:o.jsx(Xe,{loading:y,params:u,paramsErrTip:x,setParams:h,setParamsErrTip:g,readOnly:ee})}),(v||we==="introduction")&&o.jsx(z,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(F0,{loading:y,readOnly:ee,params:u,setParams:h,paramsErrTip:x,setParamsErrTip:g})}),v&&o.jsx(Q,{variant:"h6",fontWeight:"bold",mt:5,children:Se[c0.resources].label}),o.jsx(z,{display:v||we==="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(q2,{onChange:()=>h({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(n1,{value:"select",disabled:ee,control:o.jsx(X1,{size:"small",checked:u.resourceFromSelect}),label:d("blocklet.publish.resourceSelect")}),o.jsx(n1,{value:"select",disabled:ee,control:o.jsx(X1,{size:"small",checked:!u.resourceFromSelect}),label:d("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!c&&o.jsx(C2,{tabs:le,current:W,onChange:G0,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx(N1,{loading:y,initialResources:C,saveSelectedEventsRef:I,selectedResourceIds:k,setSelectedResourceIds:G,setResourceComponentsMap:E,error:x.blockletResource,app:a,readOnly:ee,component:pe,componentDid:c,initUrl:e,params:u,setParams:h,projectId:l===q.UNOWNED_DID?"":l,releaseUsedLast:N,release:{...i,id:K}})]}),!u.resourceFromSelect&&o.jsx(A1,{app:a,readOnly:ee,projectId:l===q.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:h,setParamsErrTip:g})]})})}),v&&o.jsx(Q,{variant:"h6",fontWeight:"bold",mt:5,children:Se[c0.blocklets].label}),(v||we==="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(S1,{projectType:je,disabled:y||ee,app:a,value:(u==null?void 0:u.blockletComponents)||[],onChange:_,resourceRelateComponents:ue,dependentComponentsMode:H})})})}),!v&&we==="version"&&o.jsx(z,{flexDirection:"column",children:o.jsx(Xe,{loading:y,params:u,paramsErrTip:x,setParams:h,setParamsErrTip:g,readOnly:ee})})]})]})]})]})}O1.propTypes={initUrl:f.object};O1.defaultProps={initUrl:null};const s3=de.div`
|
|
181
|
+
`;function $0({text:e}){return e?o.jsx(A2,{wrapperElement:{"data-color-mode":"light"},source:e,rehypePlugins:[[O2,{target:"_blank"}]]}):o.jsx(Ce,{Icon:Fe})}$0.propTypes={text:f.string.isRequired};function F0({params:e,setParams:t,paramsErrTip:l,loading:s,setParamsErrTip:n,readOnly:c}){var x;const{t:d}=te(),[a,u]=R.useState(c?"preview":"write"),h=(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(Q,{variant:"h6",fontWeight:"bold",sx:{},children:d("common.introduction")}),o.jsxs(R2,{value:a,onChange:h,"aria-label":"wrapped label tabs example",children:[o.jsx(K1,{value:"write",label:"Write"}),o.jsx(K1,{value:"preview",label:"Preview"})]})]}),o.jsx(z,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Ie,{disabled:s||c,sx:{border:"none"},placeholder:`Blocklet ${d("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:o.jsxs(b1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",Re.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{n({blockletIntroduction:""}),t({blockletIntroduction:g.target.value.slice(0,Re.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(z,{display:a==="preview"?"block":"none",mt:3,children:o.jsx($0,{text:e.blockletIntroduction||""})})]})}F0.propTypes={params:f.object.isRequired,setParams:f.func.isRequired,paramsErrTip:f.object.isRequired,setParamsErrTip:f.func.isRequired,readOnly:f.bool.isRequired,loading:f.bool.isRequired};var B1={},Yl=Te;Object.defineProperty(B1,"__esModule",{value:!0});var U0=B1.default=void 0,Zl=Yl(Pe()),i0=o;U0=B1.default=(0,Zl.default)([(0,i0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,i0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function E1({step:e,ok:t,active:l,error:s}){let n="grey.500",c=e+1;return t&&(c=o.jsx(H2,{sx:{fontSize:18,margin:0},color:"white"})),s||!t&&l>e?(n="error.main",c=o.jsx(U0,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(n="primary.main"),o.jsx(z,{width:24,height:24,bgcolor:n,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:c})}E1.propTypes={step:f.number,ok:f.bool,active:f.number,error:f.string};E1.defaultProps={step:0,ok:!1,active:0,error:""};function q0({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:s,params:n,loading:c,paramsErrTip:d,viewMode:a,projectId:u}){const{t:h}=te(),x=()=>{l(i=>i+1)},g=()=>{l(i=>i-1)},y=i=>i===0?(d==null?void 0:d.blockletTitle)||(d==null?void 0:d.projectId)||(d==null?void 0:d.blockletDescription):i===2?d==null?void 0:d.blockletResource:i>=4?(d==null?void 0:d.blockletVersion)||(d==null?void 0:d.note):"",p=a||O0({hasSelectedResources:s,params:n,projectId:u,t:h})===null;return o.jsxs(z,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(F2,{activeStep:t,orientation:"vertical",children:e.map((i,m)=>{const w={},v=c||!Gl({hasSelectedResources:s,params:n,projectId:u,step:m,t:h}),C=c?"":y(m);return C&&(w.optional=o.jsx(Q,{variant:"caption",color:"error",children:C}),w.error=!0),o.jsxs(U2,{children:[o.jsx(ht,{icon:o.jsx(E1,{error:C,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...w,children:o.jsx(Q,{fontSize:"14px",fontWeight:"500",color:C||!v&&t>m?"error.main":"inherit",children:i.label})}),o.jsxs(jt,{children:[o.jsx(Q,{fontSize:12,children:i.description}),!p&&o.jsx(z,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(ae,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:C||!v,children:h("common.continue")}),m>0&&o.jsx(ae,{disabled:m===0,onClick:g,sx:{mt:1,mr:1},children:h("common.back")})]})})]})]},i.label)})}),t>=e.length-1&&o.jsx(m0,{square:!0,elevation:0,sx:{p:3},children:o.jsx(Q,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}q0.propTypes={steps:f.array.isRequired,activeStep:f.number.isRequired,setActiveStep:f.func.isRequired,params:f.object.isRequired,viewMode:f.string.isRequired,loading:f.bool.isRequired,projectId:f.string.isRequired,hasSelectedResources:f.bool.isRequired,paramsErrTip:f.shape({projectId:f.string,blockletVersion:f.string,blockletTitle:f.string,blockletDescription:f.string,note:f.string,blockletResource:f.string}).isRequired};const e3=[".zip",".gz"],t3=1024*1024*100,o3=R.lazy(()=>v0(()=>import("./react-Bq9Lc-LH.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])).then(e=>({default:e.Uploader})));function A1({app:e,projectId:t,readOnly:l,params:s,setParams:n,setParamsErrTip:c,error:d}){const{t:a}=te(),u=R.useRef(null),h=()=>l?!1:!t||t===q.UNOWNED_DID?($.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${q.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(z,{sx:{mt:3},children:[o.jsx(Q,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),o.jsxs(y2,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!s.uploadedResource&&o.jsx(Q,{component:"a",href:`${x}/params.uploadedResource`,children:s.uploadedResource}),!l&&o.jsx(ae,{variant:"outlined",size:"small",onClick:()=>{var g;h()&&((g=u.current)==null||g.open())},children:s.uploadedResource?a("common.change"):a("common.upload")})]}),o.jsx(R.Suspense,{fallback:o.jsx(ze,{}),children:o.jsx(o3,{ref:u,popup:!0,onUploadFinish:g=>{var y;n({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:e3,maxFileSize:t3,maxNumberOfFiles:1}}},"uploader-resource")}),!!d&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:d})]})}A1.propTypes={app:f.object.isRequired,projectId:f.string.isRequired,readOnly:f.bool.isRequired,params:f.object.isRequired,setParams:f.func.isRequired,error:f.string.isRequired,setParamsErrTip:f.func.isRequired};A1.defaultProps={};function Xe({readOnly:e,params:t,setParams:l,paramsErrTip:s,setParamsErrTip:n,loading:c}){var a;const{t:d}=te();return o.jsx(z,{display:"flex",mt:3,className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Ie,{required:!0,disabled:c||e,label:`Blocklet ${d("common.version")}`,placeholder:`Blocklet ${d("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:u=>{n({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!s.blockletVersion,helperText:s.blockletVersion||""}),o.jsx(Ie,{label:d("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(b1,{position:"end",children:[((a=t==null?void 0:t.note)==null?void 0:a.length)||0," / ",Re.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{n({note:""}),l({note:u.target.value.slice(0,Re.PROJECT.MAX_NOTE_LENGTH)})},error:!!s.note,helperText:s.note||"",sx:{mt:3}})]})})}Xe.propTypes={readOnly:f.bool.isRequired,params:f.object.isRequired,setParams:f.func.isRequired,paramsErrTip:f.object.isRequired,setParamsErrTip:f.func.isRequired,loading:f.bool.isRequired};Xe.defaultProps={};const l3=({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(v1,{size:24,blocklet:t,ancestors:l}),o.jsx(z,{ml:"4px",className:"text",children:o.jsx(z,{children:t.meta.title})})]},s),value:s})},a0=(e,t)=>{const l=h1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","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},r3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},c0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function O1({initUrl:e,...t}){var F1;const{projectId:l,mode:s,releaseId:n,componentDid:c=""}=Qe(),{t:d}=te(),{blocklet:a}=Ne(),[u,h]=ke({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,g]=ke({}),[y,p]=R.useState(!1),[i,m]=ke(null),{api:w}=ye(),v=$e(D=>D.breakpoints.down("md")),[C,S]=R.useState({}),[N,T]=R.useState(!1),I=R.useRef({}),[k,F]=ke({}),[V,P]=R.useState(""),[M,L]=ke({}),H=e==null?void 0:e.searchParams.get("dependentComponentsMode"),O=H==="readonly",E=R.useCallback(D=>{O&&h({blockletComponents:[]}),L(D)},[O,L,h]),G=R.useCallback((...D)=>{F(...D),g({blockletResource:""})},[]),K=n==="none"?(u==null?void 0:u.lastReleaseId)||"":n,[X,se]=R.useState(s==="new-release"?4:0);R.useEffect(()=>{l&&g({projectId:""})},[l,g]);const je=R.useMemo(()=>{var D;return(D=u==null?void 0:u.blockletComponents)!=null&&D.some(B=>B.included)||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource]),le=[],re=((a==null?void 0:a.children)||[]).filter(D=>{var B;return(B=D.meta.resource)==null?void 0:B.exportApi}).filter(D=>!c||D.meta.did===c);re.forEach(D=>{l3({tabs:le,blocklet:D,t:d,ancestors:[a]})});const[W,Y]=R.useState((F1=le[0])==null?void 0:F1.value),U=!N&&(i==null?void 0:i.status)==="published",ee=U,ue=R.useMemo(()=>{const D={};return Object.keys(M).forEach(B=>{const Ue=M[B];Ue&&Ue.forEach(X0=>{D[X0]=!0})}),D},[M]),xe=h2(()=>{if(!e)return;P(e.searchParams.get("logo")),h(B=>({...B,blockletTitle:(B==null?void 0:B.blockletTitle)||e.searchParams.get("title"),blockletDescription:(B==null?void 0:B.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(B==null?void 0:B.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(B==null?void 0:B.blockletComponents)||JSON.parse(e.searchParams.get("components")||"[]"),note:(B==null?void 0:B.note)||e.searchParams.get("note")||"No note"}));const D=e.searchParams.get("resources");try{const B=JSON.parse(D);S(B)}catch{}}),Z=async()=>{if(K)try{const D=await w.getRelease({input:{did:a.meta.did,projectId:l,releaseId:K}});if(p(!1),!D.release){$.error("Release not found");return}s!=="view"&&(D.release.note=""),h(B=>a0({...B,...D.release,blockletVersion:s==="create"||s==="new-release"?Me.inc(D.release.blockletVersion,"patch"):D.release.blockletVersion},a)),m(D.release)}catch(D){p(!1),$.error(Le(D))}},ne=async()=>{if(l===q.UNOWNED_DID){h({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){$.error(d("blocklet.publish.errorTip.noDid"));return}try{const D=await w.getProject({input:{did:a.meta.did,projectId:l}});p(!1);const B=D.project||{};B.blockletVersion?(s==="create"||s==="new-release")&&Me.valid(B.blockletVersion)&&(B.blockletVersion=Me.inc(B.blockletVersion,"patch")):B.blockletVersion="1.0.0";const Ue=a0(B,a);h(Ue),B.lastReleaseId||xe()}catch(D){p(!1),$.error(Le(D))}},ie=R.useCallback(async()=>{if(s==="view"){if(!K){$.error("Empty release id");return}await ne(),await Z();return}await ne(),K&&(T(!0),await Z())},[s,K]),_=D=>{h({blockletComponents:D})};R.useEffect(()=>{ie()},[ie]),R.useEffect(()=>{l===q.UNOWNED_DID&&(s==="create"||s==="new-release")&&e&&xe()},[l,e,s,xe]);const J=R.useMemo(()=>!!Object.keys(k).find(D=>!!k[D].length),[k]);if(!u&&y)return o.jsx(ze,{});if(!u)return null;const pe=re.find(D=>D.meta.did===W);if(re.every(D=>D.status!=="running"))return o.jsx(Ce,{children:d("blocklet.publish.allComponentsNotRunning")});const G0=D=>{Y(D)},H1=e==null?void 0:e.searchParams.get("resourcesTitle"),$1=e==null?void 0:e.searchParams.get("componentsTitle"),Se=[{label:d("blocklet.publish.branding"),description:d("blocklet.publish.steps.branding")},{label:d("common.introduction"),description:d("blocklet.publish.steps.introduction")},{label:H1||d("blocklet.publish.resourceTitle"),description:d("blocklet.publish.steps.resources")},{label:$1||d("common.components"),description:d("blocklet.publish.steps.blocklets")},{label:d("blocklet.publish.versionTitle"),description:d("blocklet.publish.steps.version")}],K0=Se[X]||Se[Se.length-1],we=r3[X];return o.jsxs(s3,{...t,children:[o.jsx(H0,{blocklet:a,release:i,getData:ie,getRelease:Z,mode:s,params:u,setParams:h,setParamsErrTip:g,readOnly:ee,isPublished:U,loading:y,setLoading:p,initLogoUrl:V,releaseId:K,projectId:l,projectType:je,resourceComponents:re,resourceComponentsMap:M,resourceRelateComponents:ue,resourceItem:pe,saveSelectedEventsRef:I,hasSelectedResources:J,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(q0,{steps:Se,viewMode:s==="view",params:u,hasSelectedResources:J||u.uploadedResource,paramsErrTip:x,activeStep:X,setActiveStep:se,projectId:l,resourcesUrlTitle:H1,componentsUrlTitle:$1}),o.jsxs(z,{flex:"1",maxWidth:"720px",children:[!v&&we!=="introduction"&&o.jsxs(Q,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[K0.label,we==="branding"&&o.jsx(ve,{title:d("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(w2,{})})})]}),(v||we==="branding")&&o.jsx(z,{flexDirection:"column",children:o.jsx(E0,{projectId:l,setParams:h,setParamsErrTip:g,params:u,componentDid:c,blocklet:a,initUrl:e,loading:y,setLoading:p,paramsErrTip:x,readOnly:ee,initLogoUrl:V,setInitLogoUrl:P})}),v&&o.jsx(z,{flexDirection:"column",children:o.jsx(Xe,{loading:y,params:u,paramsErrTip:x,setParams:h,setParamsErrTip:g,readOnly:ee})}),(v||we==="introduction")&&o.jsx(z,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(F0,{loading:y,readOnly:ee,params:u,setParams:h,paramsErrTip:x,setParamsErrTip:g})}),v&&o.jsx(Q,{variant:"h6",fontWeight:"bold",mt:5,children:Se[c0.resources].label}),o.jsx(z,{display:v||we==="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(q2,{onChange:()=>h({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(n1,{value:"select",disabled:ee,control:o.jsx(X1,{size:"small",checked:u.resourceFromSelect}),label:d("blocklet.publish.resourceSelect")}),o.jsx(n1,{value:"select",disabled:ee,control:o.jsx(X1,{size:"small",checked:!u.resourceFromSelect}),label:d("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!c&&o.jsx(C2,{tabs:le,current:W,onChange:G0,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx(N1,{loading:y,initialResources:C,saveSelectedEventsRef:I,selectedResourceIds:k,setSelectedResourceIds:G,setResourceComponentsMap:E,error:x.blockletResource,app:a,readOnly:ee,component:pe,componentDid:c,initUrl:e,params:u,setParams:h,projectId:l===q.UNOWNED_DID?"":l,releaseUsedLast:N,release:{...i,id:K}})]}),!u.resourceFromSelect&&o.jsx(A1,{app:a,readOnly:ee,projectId:l===q.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:h,setParamsErrTip:g})]})})}),v&&o.jsx(Q,{variant:"h6",fontWeight:"bold",mt:5,children:Se[c0.blocklets].label}),(v||we==="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(S1,{projectType:je,disabled:y||ee,app:a,value:(u==null?void 0:u.blockletComponents)||[],onChange:_,resourceRelateComponents:ue,dependentComponentsMode:H})})})}),!v&&we==="version"&&o.jsx(z,{flexDirection:"column",children:o.jsx(Xe,{loading:y,params:u,paramsErrTip:x,setParams:h,setParamsErrTip:g,readOnly:ee})})]})]})]})]})}O1.propTypes={initUrl:f.object};O1.defaultProps={initUrl:null};const s3=de.div`
|
|
182
182
|
.section {
|
|
183
183
|
&.full-width {
|
|
184
184
|
max-width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aC as Pe,aB as ze,aD as Z,ae as Ne,aE as _,aG as $,r as p,aK as Ce,aF as re,j as n,aI as R,aJ as Me,
|
|
1
|
+
import{aC as Pe,aB as ze,aD as Z,ae as Ne,aE as _,aG as $,r as p,aK as Ce,aF as re,j as n,aI as R,aJ as Me,de as no,d0 as ro,bh as ee,cN as to,df as ao,V as so,dg as io,dh as lo,U as co,c2 as po,ao as se,P as r,X as ie,Y as le,br as y,ac as uo,ay as de,L as K,T as D,b as ho,az as Re,B as C,bs as xo,F as q,di as Ie,H as Te,$ as mo,N as Be,f as te,dj as fo,h as X,dk as go,dl as bo}from"./index-IcQQOgM-.js";import{T as vo}from"./Toolbar-DJupn0f9.js";import{H as Le}from"./Hidden-B431iBU_.js";const ae={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5"};function yo(e){return Pe("MuiAppBar",e)}ze("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const jo=["className","color","enableColorOnDark","position"],wo=e=>{const{color:o,position:t,classes:a}=e,l={root:["root",`color${_(o)}`,`position${_(t)}`]};return Me(l,yo,a)},J=(e,o)=>e?`${e==null?void 0:e.replace(")","")}, ${o})`:o,ko=Z(Ne,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,o[`position${_(t.position)}`],o[`color${_(t.color)}`]]}})(({theme:e,ownerState:o})=>{const t=e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[900];return $({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},o.position==="fixed"&&{position:"fixed",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},o.position==="absolute"&&{position:"absolute",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0},o.position==="sticky"&&{position:"sticky",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0},o.position==="static"&&{position:"static"},o.position==="relative"&&{position:"relative"},!e.vars&&$({},o.color==="default"&&{backgroundColor:t,color:e.palette.getContrastText(t)},o.color&&o.color!=="default"&&o.color!=="inherit"&&o.color!=="transparent"&&{backgroundColor:e.palette[o.color].main,color:e.palette[o.color].contrastText},o.color==="inherit"&&{color:"inherit"},e.palette.mode==="dark"&&!o.enableColorOnDark&&{backgroundColor:null,color:null},o.color==="transparent"&&$({backgroundColor:"transparent",color:"inherit"},e.palette.mode==="dark"&&{backgroundImage:"none"})),e.vars&&$({},o.color==="default"&&{"--AppBar-background":o.enableColorOnDark?e.vars.palette.AppBar.defaultBg:J(e.vars.palette.AppBar.darkBg,e.vars.palette.AppBar.defaultBg),"--AppBar-color":o.enableColorOnDark?e.vars.palette.text.primary:J(e.vars.palette.AppBar.darkColor,e.vars.palette.text.primary)},o.color&&!o.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":o.enableColorOnDark?e.vars.palette[o.color].main:J(e.vars.palette.AppBar.darkBg,e.vars.palette[o.color].main),"--AppBar-color":o.enableColorOnDark?e.vars.palette[o.color].contrastText:J(e.vars.palette.AppBar.darkColor,e.vars.palette[o.color].contrastText)},{backgroundColor:"var(--AppBar-background)",color:o.color==="inherit"?"inherit":"var(--AppBar-color)"},o.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),$o=p.forwardRef(function(o,t){const a=Ce({props:o,name:"MuiAppBar"}),{className:l,color:c="primary",enableColorOnDark:d=!1,position:i="fixed"}=a,u=re(a,jo),s=$({},a,{color:c,position:i,enableColorOnDark:d}),x=wo(s);return n.jsx(ko,$({square:!0,component:"header",ownerState:s,elevation:4,className:R(x.root,l,i==="fixed"&&"mui-fixed"),ref:t},u))}),Po=$o;function zo(e){return Pe("MuiDrawer",e)}ze("MuiDrawer",["root","docked","paper","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const No=["BackdropProps"],Co=["anchor","BackdropProps","children","className","elevation","hideBackdrop","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"],Ae=(e,o)=>{const{ownerState:t}=e;return[o.root,(t.variant==="permanent"||t.variant==="persistent")&&o.docked,o.modal]},Mo=e=>{const{classes:o,anchor:t,variant:a}=e,l={root:["root"],docked:[(a==="permanent"||a==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${_(t)}`,a!=="temporary"&&`paperAnchorDocked${_(t)}`]};return Me(l,zo,o)},Ro=Z(no,{name:"MuiDrawer",slot:"Root",overridesResolver:Ae})(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer})),ke=Z("div",{shouldForwardProp:ro,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:Ae})({flex:"0 0 auto"}),Io=Z(Ne,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.paper,o[`paperAnchor${_(t.anchor)}`],t.variant!=="temporary"&&o[`paperAnchorDocked${_(t.anchor)}`]]}})(({theme:e,ownerState:o})=>$({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},o.anchor==="left"&&{left:0},o.anchor==="top"&&{top:0,left:0,right:0,height:"auto",maxHeight:"100%"},o.anchor==="right"&&{right:0},o.anchor==="bottom"&&{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},o.anchor==="left"&&o.variant!=="temporary"&&{borderRight:`1px solid ${(e.vars||e).palette.divider}`},o.anchor==="top"&&o.variant!=="temporary"&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`},o.anchor==="right"&&o.variant!=="temporary"&&{borderLeft:`1px solid ${(e.vars||e).palette.divider}`},o.anchor==="bottom"&&o.variant!=="temporary"&&{borderTop:`1px solid ${(e.vars||e).palette.divider}`})),De={left:"right",right:"left",top:"down",bottom:"up"};function To(e){return["left","right"].indexOf(e)!==-1}function Bo({direction:e},o){return e==="rtl"&&To(o)?De[o]:o}const Lo=p.forwardRef(function(o,t){const a=Ce({props:o,name:"MuiDrawer"}),l=ee(),c=to(),d={enter:l.transitions.duration.enteringScreen,exit:l.transitions.duration.leavingScreen},{anchor:i="left",BackdropProps:u,children:s,className:x,elevation:m=16,hideBackdrop:j=!1,ModalProps:{BackdropProps:w}={},onClose:P,open:b=!1,PaperProps:f={},SlideProps:z,TransitionComponent:M=ao,transitionDuration:L=d,variant:I="temporary"}=a,N=re(a.ModalProps,No),g=re(a,Co),k=p.useRef(!1);p.useEffect(()=>{k.current=!0},[]);const A=Bo({direction:c?"rtl":"ltr"},i),F=$({},a,{anchor:i,elevation:m,open:b,variant:I},g),T=Mo(F),h=n.jsx(Io,$({elevation:I==="temporary"?m:0,square:!0},f,{className:R(T.paper,f.className),ownerState:F,children:s}));if(I==="permanent")return n.jsx(ke,$({className:R(T.root,T.docked,x),ownerState:F,ref:t},g,{children:h}));const v=n.jsx(M,$({in:b,direction:De[A],timeout:L,appear:k.current},z,{children:h}));return I==="persistent"?n.jsx(ke,$({className:R(T.root,T.docked,x),ownerState:F,ref:t},g,{children:v})):n.jsx(Ro,$({BackdropProps:$({},u,w,{transitionDuration:L}),className:R(T.root,T.modal,x),open:b,ownerState:F,onClose:P,hideBackdrop:j,ref:t},g,N,{children:v}))}),_e=Lo;function Ao(e,o){var t,a=so(e),l=(t=o==null?void 0:o.wait)!==null&&t!==void 0?t:1e3,c=p.useMemo(function(){return io(function(){for(var d=[],i=0;i<arguments.length;i++)d[i]=arguments[i];return a.current.apply(a,lo([],co(d),!1))},l,o)},[]);return po(function(){c.cancel()}),{run:c,cancel:c.cancel,flush:c.flush}}const Do=se(n.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),_o=se(n.jsx("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu"),Fo=se(n.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreHoriz"),Fe=p.createContext(),Wo=e=>{const o=p.useContext(Fe);return p.useLayoutEffect(()=>{e&&o.configure(e)},[]),o};function We({children:e,...o}){const[t,a]=p.useState({inFullPage:!1,showToggleButton:!1,headerVisibleInFullPage:!0,footerVisibleInFullPage:!1,sidebarVisibleInFullPage:!1}),l=()=>{a(d=>({...d,inFullPage:!d.inFullPage}))},c=p.useMemo(()=>({...t,headerVisible:!t.inFullPage||t.headerVisibleInFullPage,footerVisible:!t.inFullPage||t.footerVisibleInFullPage,sidebarVisible:!t.inFullPage||t.sidebarVisibleInFullPage,toggleFullPage:l,configure:d=>a(i=>({...i,...d}))}),[t]);return n.jsx(Fe.Provider,{value:c,...o,children:e})}We.propTypes={children:r.node.isRequired};var ce={},Ho=le;Object.defineProperty(ce,"__esModule",{value:!0});var He=ce.default=void 0,Oo=Ho(ie()),Vo=n;He=ce.default=(0,Oo.default)((0,Vo.jsx)("path",{d:"M21 11V3h-8l3.29 3.29-10 10L3 13v8h8l-3.29-3.29 10-10z"}),"OpenInFull");var pe={},Eo=le;Object.defineProperty(pe,"__esModule",{value:!0});var Oe=pe.default=void 0,qo=Eo(ie()),Uo=n;Oe=pe.default=(0,qo.default)((0,Uo.jsx)("path",{d:"M22 3.41 16.71 8.7 20 12h-8V4l3.29 3.29L20.59 2zM3.41 22l5.29-5.29L12 20v-8H4l3.29 3.29L2 20.59z"}),"CloseFullscreen");function ue({name:e,size:o,alt:t,color:a,style:l,prefix:c,showBadge:d,...i}){const u=`${c}/${e}-${a.replace(/^#/,"")}.png`;return n.jsxs(So,{style:{width:o,height:o},children:[n.jsx(uo,{width:o,height:o,alt:t||e,src:u,style:Object.assign({width:o},l),...i}),d&&n.jsx("i",{className:"badge-point"})]})}ue.propTypes={name:r.string.isRequired,size:r.number,color:r.string,alt:r.string,style:r.object,prefix:r.string,showBadge:r.bool};ue.defaultProps={size:36,color:"#000000",alt:"",style:{},prefix:"/images",showBadge:!1};const So=y("div")`
|
|
2
2
|
position: relative;
|
|
3
3
|
.badge-point {
|
|
4
4
|
position: absolute;
|
|
@@ -230,7 +230,7 @@ import{aC as Pe,aB as ze,aD as Z,ae as Ne,aE as _,aG as $,r as p,aK as Ce,aF as
|
|
|
230
230
|
box-shadow: 2px 16px 10px 0 rgba(0, 0, 0, ${e=>e.theme.mode==="light"?.05:.5});
|
|
231
231
|
border: 0;
|
|
232
232
|
}
|
|
233
|
-
`;function ge({children:e,title:o,brand:t,description:a,brandAddon:l,headerAddon:c,images:d,links:i,prefix:u,fullWidth:s,contentLayout:x,className:m,homeUrl:j,logo:w,...P}){const f=Ie(document.body),z=(f==null?void 0:f.width)||0,[M,L]=p.useState(z>=960?"permanent":"temporary"),[I,N]=p.useState(M==="permanent");p.useEffect(()=>{const A=z>=960?"permanent":"temporary";L(A),N(A!=="temporary")},[z]);const
|
|
233
|
+
`;function ge({children:e,title:o,brand:t,description:a,brandAddon:l,headerAddon:c,images:d,links:i,prefix:u,fullWidth:s,contentLayout:x,className:m,homeUrl:j,logo:w,...P}){const f=Ie(document.body),z=(f==null?void 0:f.width)||0,[M,L]=p.useState(z>=960?"permanent":"temporary"),[I,N]=p.useState(M==="permanent");p.useEffect(()=>{const A=z>=960?"permanent":"temporary";L(A),N(A!=="temporary")},[z]);const g=()=>{N(!I)},k=s||x==="row";return n.jsxs(on,{className:`dashboard ${m}`,...P,children:[n.jsx(Te,{title:`${o}-${t}`}),n.jsx(fe,{className:"dashboard__header",onToggleMenu:g,brand:t,brandAddon:l,description:a,addons:c,homeUrl:j,logo:w}),n.jsxs(C,{display:"flex",className:"dashboard__body",children:[n.jsx(_e,{variant:M,className:"drawer",classes:{paper:"drawerPaper"},open:I,onClose:g,ModalProps:{disablePortal:!0,keepMounted:!0},children:n.jsx(he,{className:"dashboard__sidebar",images:d,links:i,prefix:u,logo:w})}),n.jsxs(C,{className:"dashboard__main",children:[n.jsx(q,{maxWidth:k?!1:"lg",className:"dashboard__content",children:e}),n.jsx(O,{})]})]})]})}ge.propTypes={children:r.any.isRequired,title:r.string,brand:r.string.isRequired,links:r.array.isRequired,images:r.object.isRequired,brandAddon:r.object,description:r.any.isRequired,headerAddon:r.any,prefix:r.string,contentLayout:r.oneOf(["row","column"]),fullWidth:r.bool,className:r.string,homeUrl:r.string,logo:r.any};ge.defaultProps={title:"Home",contentLayout:"column",headerAddon:null,brandAddon:null,prefix:"/images",fullWidth:!1,className:"",homeUrl:"/",logo:null};function Se({height:e,...o}){return n.jsx(nn,{height:e,...o})}Se.propTypes={height:r.oneOfType([r.number,r.string]).isRequired};const nn=y(C)`
|
|
234
234
|
overflow: hidden;
|
|
235
235
|
&:before {
|
|
236
236
|
content: '';
|
|
@@ -243,7 +243,7 @@ import{aC as Pe,aB as ze,aD as Z,ae as Ne,aE as _,aG as $,r as p,aK as Ce,aF as
|
|
|
243
243
|
float: left;
|
|
244
244
|
white-space: nowrap;
|
|
245
245
|
}
|
|
246
|
-
`;function V({logo:e,brand:o,brandAddon:t,description:a,children:l,addons:c,prepend:d,align:i,maxWidth:u,homeLink:s,...x}){const m=p.useRef(),[j,w]=p.useState("0px"),P={minWidth:j};p.useEffect(()=>{m.current&&w(`${m.current.offsetWidth}px`)},[]);const b=()=>{const f=n.jsxs(n.Fragment,{children:[e&&n.jsx("div",{className:"header-logo",ref:m,children:e}),o&&n.jsx(Se,{height:44,sx:{flexShrink:{xs:1}},children:n.jsxs("div",{className:"header-brand",children:[n.jsx("div",{className:"header-brand-title",children:n.jsx("h2",{children:o})}),n.jsx("div",{className:"header-brand-desc",children:a})]})})]});return typeof s=="function"?s(f):n.jsx("a",{href:s,children:f})};return n.jsx(rn,{...x,children:n.jsxs(q,{maxWidth:u,className:"header-container",children:[d,n.jsx("div",{className:"header-brand-wrapper",style:P,children:b()}),n.jsx("div",{className:"header-brand-addon",children:t}),i==="right"&&n.jsx(C,{display:"inline-block",flexGrow:1}),l,i==="left"&&n.jsx(C,{display:"inline-block",flexGrow:1}),n.jsx("div",{className:"header-addons",children:c})]})})}V.propTypes={logo:r.node,brand:r.node,brandAddon:r.node,description:r.node,children:r.node,addons:r.node,prepend:r.node,align:r.oneOf(["left","right"]),maxWidth:r.oneOfType([r.string,r.oneOf(["xs","sm","md","lg","xl",!1])]),homeLink:r.oneOfType([r.string,r.func])};V.defaultProps={logo:null,brand:null,brandAddon:null,description:null,children:null,addons:null,prepend:null,align:"left",maxWidth:void 0,homeLink:"/"};const rn=y(
|
|
246
|
+
`;function V({logo:e,brand:o,brandAddon:t,description:a,children:l,addons:c,prepend:d,align:i,maxWidth:u,homeLink:s,...x}){const m=p.useRef(),[j,w]=p.useState("0px"),P={minWidth:j};p.useEffect(()=>{m.current&&w(`${m.current.offsetWidth}px`)},[]);const b=()=>{const f=n.jsxs(n.Fragment,{children:[e&&n.jsx("div",{className:"header-logo",ref:m,children:e}),o&&n.jsx(Se,{height:44,sx:{flexShrink:{xs:1}},children:n.jsxs("div",{className:"header-brand",children:[n.jsx("div",{className:"header-brand-title",children:n.jsx("h2",{children:o})}),n.jsx("div",{className:"header-brand-desc",children:a})]})})]});return typeof s=="function"?s(f):n.jsx("a",{href:s,children:f})};return n.jsx(rn,{...x,children:n.jsxs(q,{maxWidth:u,className:"header-container",children:[d,n.jsx("div",{className:"header-brand-wrapper",style:P,children:b()}),n.jsx("div",{className:"header-brand-addon",children:t}),i==="right"&&n.jsx(C,{display:"inline-block",flexGrow:1}),l,i==="left"&&n.jsx(C,{display:"inline-block",flexGrow:1}),n.jsx("div",{className:"header-addons",children:c})]})})}V.propTypes={logo:r.node,brand:r.node,brandAddon:r.node,description:r.node,children:r.node,addons:r.node,prepend:r.node,align:r.oneOf(["left","right"]),maxWidth:r.oneOfType([r.string,r.oneOf(["xs","sm","md","lg","xl",!1])]),homeLink:r.oneOfType([r.string,r.func])};V.defaultProps={logo:null,brand:null,brandAddon:null,description:null,children:null,addons:null,prepend:null,align:"left",maxWidth:void 0,homeLink:"/"};const rn=y(C)`
|
|
247
247
|
position: relative;
|
|
248
248
|
z-index: ${e=>e.theme.zIndex.appBar};
|
|
249
249
|
font-size: 14px;
|
|
@@ -339,7 +339,7 @@ import{aC as Pe,aB as ze,aD as Z,ae as Ne,aE as _,aG as $,r as p,aK as Ce,aF as
|
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
`;function be({menu:e,prepend:o,children:t,...a}){const l=ee(),c=mo(l.breakpoints.down("md")),[d,i]=p.useState(!1),u=typeof t=="function"?t({isMobile:c,closeMenu:()=>i(!1)}):t,s=Be({changed:!1,value:"",priority:""});return te(()=>{var x;if((x=document.documentElement)!=null&&x.style){const m=()=>{s.changed&&(s.value?document.documentElement.style.setProperty("overflow",s.value,s.priority):document.documentElement.style.removeProperty("overflow"),s.value="",s.priority="",s.changed=!1)};return d?(s.changed=!0,s.value=document.documentElement.style.getPropertyValue("overflow"),s.priority=document.documentElement.style.getPropertyPriority("overflow"),document.documentElement.style.setProperty("overflow","
|
|
342
|
+
`;function be({menu:e,prepend:o,children:t,...a}){const l=ee(),c=mo(l.breakpoints.down("md")),[d,i]=p.useState(!1),u=typeof t=="function"?t({isMobile:c,closeMenu:()=>i(!1)}):t,s=Be({changed:!1,value:"",priority:""});return te(()=>{var x;if((x=document.documentElement)!=null&&x.style){const m=()=>{s.changed&&(s.value?document.documentElement.style.setProperty("overflow",s.value,s.priority):document.documentElement.style.removeProperty("overflow"),s.value="",s.priority="",s.changed=!1)};return d?(s.changed=!0,s.value=document.documentElement.style.getPropertyValue("overflow"),s.priority=document.documentElement.style.getPropertyPriority("overflow"),document.documentElement.style.setProperty("overflow","revert","important")):m(),m}return()=>{}},[d]),t?n.jsxs(tn,{prepend:o||n.jsx(Re,{sx:{color:l.palette.grey[500]},edge:"start",className:"header-menu","aria-label":"header menu button",onClick:()=>i(!d),children:d?n.jsx(fo,{}):n.jsx(me,{})}),...a,children:[!c&&u,c&&n.jsx(_e,{open:d,onClose:()=>i(!1),ModalProps:{disablePortal:!1,keepMounted:!0,BackdropComponent:null},anchor:"top",sx:{top:64,zIndex:l.zIndex.appBar-1},PaperProps:{style:{top:64,bottom:0,boxShadow:"none"}},children:n.jsx(an,{children:u})})]}):n.jsx(V,{prepend:o,...a})}be.propTypes={...V.PropTypes,children:r.oneOfType([r.node,r.func])};be.defaultProps={...V.defaultProps};const tn=y(V)`
|
|
343
343
|
.header-menu {
|
|
344
344
|
display: none;
|
|
345
345
|
}
|
|
@@ -536,7 +536,7 @@ import{aC as Pe,aB as ze,aD as Z,ae as Ne,aE as _,aG as $,r as p,aK as Ce,aF as
|
|
|
536
536
|
.navmenu-sub--opened > .navmenu-sub-container {
|
|
537
537
|
display: block;
|
|
538
538
|
}
|
|
539
|
-
`,ve=p.createContext();function Ye(e){return e?p.Children.toArray(e).filter(o=>o.type===G||o.type===H):null}function Xe(e){return p.useRef(e||`navmenu-item-id-${Math.random().toString(36).slice(2)}`).current}function S({items:e,mode:o,children:t,activeId:a,textColor:l,activeTextColor:c,bgColor:d,onSelected:i,...u}){var T;if(t=Ye(t),!(e!=null&&e.length)&&!(t!=null&&t.length))throw new Error("One of 'items' or 'children' is required by NavMenu component.");const s=Be({activeId:a,openedIds:[],hiddenItemCount:0}),x=X(h=>{s.activeId=h,i==null||i(h)}),m=X(h=>{s.openedIds.push(h)}),j=X(h=>{s.openedIds=s.openedIds.filter(
|
|
539
|
+
`,ve=p.createContext();function Ye(e){return e?p.Children.toArray(e).filter(o=>o.type===G||o.type===H):null}function Xe(e){return p.useRef(e||`navmenu-item-id-${Math.random().toString(36).slice(2)}`).current}function S({items:e,mode:o,children:t,activeId:a,textColor:l,activeTextColor:c,bgColor:d,onSelected:i,...u}){var T;if(t=Ye(t),!(e!=null&&e.length)&&!(t!=null&&t.length))throw new Error("One of 'items' or 'children' is required by NavMenu component.");const s=Be({activeId:a,openedIds:[],hiddenItemCount:0}),x=X(h=>{s.activeId=h,i==null||i(h)}),m=X(h=>{s.openedIds.push(h)}),j=X(h=>{s.openedIds=s.openedIds.filter(v=>v!==h)}),w=te(()=>({...s,mode:o,activate:x,open:m,close:j}),[s.activeId,s.hiddenItemCount,s.openedIds,o,x,m,j]),P=p.useRef(),b=p.useRef([]),f=p.useRef(),z=s.hiddenItemCount===((T=b.current)==null?void 0:T.length),M=z?{marginLeft:"0px"}:void 0,L=te(()=>z?n.jsx(_o,{}):n.jsx(Fo,{}),[z]),I=h=>p.Children.map(h,(v,W)=>p.cloneElement(v,{ref:B=>{b.current[W]=B}})),N=Ie(P.current),{run:g}=Ao(X(()=>{let h=0,v=0,W=!1;const B=(N==null?void 0:N.width)||0,ne=f.current?f.current.offsetWidth+parseFloat(window.getComputedStyle(f.current).marginLeft):0;b.current.forEach((E,eo)=>{if(E){E.style.display="flex";const oo=eo>0?parseFloat(window.getComputedStyle(E).marginLeft):0,we=E.offsetWidth+oo;B-ne>=h+we&&!W?h+=we:(E.style.display="none",W=!0,v++)}}),v!==s.hiddenItemCount&&(s.hiddenItemCount=v)}),{wait:100});p.useLayoutEffect(()=>{o==="horizontal"&&g()},[N==null?void 0:N.width,o]),p.useEffect(()=>{if(o==="horizontal")return g(),window.addEventListener("resize",g),()=>{window.removeEventListener("resize",g)}},[o,e]),p.useEffect(()=>{a!=null&&(s.activeId=a)},[a]);const k=R("navmenu",`navmenu--${o}`,u.className),A=(h,v,W=!1)=>h!=null&&h.children?n.jsx(H,{id:h.id,icon:h.icon,label:h.label,ref:W?B=>{b.current[v]=B}:void 0,children:h.children.map((B,ne)=>A(B,ne,!1))},h.id):n.jsx(G,{id:h.id,icon:h.icon,label:h.label,active:h.active,ref:W?B=>{b.current[v]=B}:void 0},h.id),je=e?e==null?void 0:e.slice(-s.hiddenItemCount).map((h,v)=>A(h,v)):t==null?void 0:t.slice(-s.hiddenItemCount),F=o==="inline"?ln:sn;return n.jsx(ve.Provider,{value:w,children:n.jsx(F,{...u,className:k,$textColor:l,$activeTextColor:c,$bgColor:d,children:n.jsxs("ul",{className:"navmenu-root",ref:P,children:[e?e.map((h,v)=>A(h,v,!0)):I(t),s.hiddenItemCount>0&&n.jsx(H,{expandIcon:!1,icon:L,label:"",ref:f,style:M,children:je})]})})})}S.propTypes={items:r.array,mode:r.oneOf(["horizontal","vertical","inline"]),children:r.array,activeId:r.string,textColor:r.string,activeTextColor:r.string,bgColor:r.string,onSelected:r.func};S.defaultProps={items:null,mode:"horizontal",children:null,activeId:null,textColor:"#9397a1",activeTextColor:"#25292f",bgColor:"#fff",onSelected:null};const G=p.forwardRef(({id:e,icon:o,label:t,active:a,onClick:l,...c},d)=>{const i=Xe(e),{activeId:u,activate:s}=p.useContext(ve),x=R("navmenu-item",{"navmenu-item--active":u===i},c.className);p.useEffect(()=>{a&&s(i)},[a]);const m=()=>{l==null||l(),s(i)};return n.jsxs("li",{...c,className:x,onClick:m,ref:d,children:[o&&n.jsx("span",{className:"navmenu-item-icon",children:o}),n.jsx("span",{className:"navmenu-item-label",children:t})]})});G.propTypes={id:r.string,icon:r.element,label:r.node,active:r.bool,onClick:r.func};G.defaultProps={id:null,icon:null,label:"",active:!1,onClick:null};const H=p.forwardRef(({id:e,icon:o,label:t,children:a,expandIcon:l,...c},d)=>{const i=Xe(e),{openedIds:u,open:s,close:x,mode:m}=p.useContext(ve),j=u.includes(i),w=R("navmenu-sub",{"navmenu-sub--opened":j},c.className),P=m==="inline",b=P?{onClick:()=>{u.includes(i)?x(i):s(i)}}:{onMouseEnter:()=>s(i),onMouseLeave:()=>x(i)},f=P?{onClick:z=>z.stopPropagation()}:{};return n.jsxs("li",{...c,className:w,...b,ref:d,children:[o&&n.jsx("span",{className:"navmenu-sub-icon",children:o}),n.jsx("span",{className:"navmenu-sub-label",children:t}),l&&n.jsx("span",{className:"navmenu-sub-expand-icon",children:(l==null?void 0:l({isOpen:j}))||l}),n.jsx("div",{className:"navmenu-sub-container",...f,children:n.jsx("ul",{className:"navmenu-sub-list",children:Ye(a)})})]})});H.propTypes={id:r.string,icon:r.element,label:r.node.isRequired,children:r.array.isRequired,expandIcon:r.oneOfType([r.node,r.func])};H.defaultProps={id:null,icon:null,expandIcon:({isOpen:e})=>n.jsx(Do,{style:{transform:`rotate(${e?180:0}deg)`}})};S.Item=G;S.Sub=H;function oe({children:e,routerLinkComponent:o,to:t,external:a,...l}){return a?n.jsx("a",{href:t,...l,children:e}):n.jsx(o,{to:t,...l,children:e})}oe.propTypes={children:r.any.isRequired,routerLinkComponent:r.elementType.isRequired,external:r.bool,to:r.oneOfType([r.string,r.object]).isRequired};oe.defaultProps={external:!1};function Je(e){return n.jsx(oe,{routerLinkComponent:K,...e})}function ye({className:e,...o}){const t=o.external&&typeof e=="function"?e({}):e;return n.jsx(oe,{routerLinkComponent:go,className:t,...o})}ye.propTypes={className:r.oneOfType([r.string,r.func])};ye.defaultProps={className:""};function Ke(e,o){var u;if((u=e.children)!=null&&u.length)return dn(e,o);const{url:t,icon:a,title:l,showBadge:c,external:d,active:i}=e;return n.jsx("li",{className:"layout-sidebar-item",children:n.jsxs(ye,{external:d,to:t,className:({isActive:s})=>R("layout-sidebar-link",{"layout-sidebar-link--active":d?i:s}),children:[a&&n.jsx("span",{className:`layout-sidebar-icon ${c?"layout-sidebar-badge":""}`,children:a}),n.jsx(D,{component:"span",className:"layout-sidebar-link-text",children:l})]})},`${t}-${o}`)}function dn(e,o){return n.jsxs("li",{className:"layout-sidebar-group",children:[n.jsx("span",{className:"layout-sidebar-group-title",children:e.title}),n.jsx("ul",{children:e.children.map(Ke)})]},`group-${e.title}-${o}`)}function Q({links:e,addons:o,dense:t,...a}){return n.jsxs(pn,{...a,className:R({"layout-sidebar-dense":t}),children:[n.jsx("ul",{children:e.map(Ke)}),n.jsx("div",{style:{flex:1}}),o]})}Q.propTypes={links:r.array.isRequired,addons:r.any,dense:r.bool};Q.defaultProps={addons:null,dense:!1};const cn="linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))",pn=y("div")`
|
|
540
540
|
display: flex;
|
|
541
541
|
flex-direction: column;
|
|
542
542
|
ul {
|
|
@@ -661,7 +661,7 @@ import{aC as Pe,aB as ze,aD as Z,ae as Ne,aE as _,aG as $,r as p,aK as Ce,aF as
|
|
|
661
661
|
margin-top: 16px;
|
|
662
662
|
}
|
|
663
663
|
}
|
|
664
|
-
`;function un({closeMenu:e,...o}){const t=de();return p.useEffect(()=>{e()},[t]),n.jsx(S,{...o})}function Qe(e,o){return e.map(t=>{var a;return(a=t.children)!=null&&a.length?{...t,label:t.title,children:Qe(t.children,o)}:{...t,label:n.jsx(Je,{to:t.url,external:t.external,children:t.title}),active:t.external?t.active:!!bo({path:t.url,end:!1},o.pathname)}})}function Y({children:e,title:o,headerProps:t,links:a=[],fullWidth:l,dense:c,footerProps:d,...i}){const u=ee(),{inFullPage:s,showToggleButton:x,headerVisible:m,footerVisible:j,sidebarVisible:w,toggleFullPage:P}=Wo(),b=de(),f=p.useMemo(()=>Qe(a,b),[b,a]),z=f.some(
|
|
664
|
+
`;function un({closeMenu:e,...o}){const t=de();return p.useEffect(()=>{e()},[t]),n.jsx(S,{...o})}function Qe(e,o){return e.map(t=>{var a;return(a=t.children)!=null&&a.length?{...t,label:t.title,children:Qe(t.children,o)}:{...t,label:n.jsx(Je,{to:t.url,external:t.external,children:t.title}),active:t.external?t.active:!!bo({path:t.url,end:!1},o.pathname)}})}function Y({children:e,title:o,headerProps:t,links:a=[],fullWidth:l,dense:c,footerProps:d,...i}){const u=ee(),{inFullPage:s,showToggleButton:x,headerVisible:m,footerVisible:j,sidebarVisible:w,toggleFullPage:P}=Wo(),b=de(),f=p.useMemo(()=>Qe(a,b),[b,a]),z=f.some(g=>{var k;return!!((k=g.children)!=null&&k.length)}),M=c==="auto"?f.length>=8||z:c,L=R("dashboard",{"dashboard-dense":M},i.className),N={homeLink:g=>{var k;return n.jsx(Je,{to:((k=window.blocklet)==null?void 0:k.prefix)||"/",children:g})},...t};return n.jsxs(hn,{...i,className:L,children:[n.jsx(Te,{title:o},o),m&&n.jsx(xn,{...N,className:"dashboard-header",children:a!=null&&a.length?({isMobile:g,closeMenu:k})=>g?n.jsx(un,{mode:"inline",items:f,closeMenu:k,bgColor:"transparent",activeTextColor:u.palette.primary.main}):null:null}),n.jsxs(C,{display:"flex",className:"dashboard-body",children:[n.jsx(Le,{mdDown:!0,children:!!(a!=null&&a.length)&&w&&n.jsx(C,{className:"dashboard-sidebar",children:M?n.jsx(Q,{links:a,dense:M}):n.jsx(C,{className:"dashboard-sidebar-container",children:n.jsx(Q,{links:a,dense:M})})})}),n.jsxs(C,{className:"dashboard-main",children:[x&&n.jsx(C,{sx:{position:"absolute",top:4,right:4,display:"flex",justifyContent:"center",alignItems:"center",width:24,height:24,color:"#fff",bgcolor:"rgba(158,158,158, 0.6);",borderRadius:1,cursor:"pointer"},onClick:P,children:s?n.jsx(Oe,{style:{fontSize:18}}):n.jsx(He,{style:{fontSize:18}})}),n.jsx(q,{className:"dashboard-content",...l&&{maxWidth:!1},children:e}),j&&n.jsx(O,{...d})]})]})]})}Y.propTypes={children:r.any.isRequired,title:r.string,links:r.array.isRequired,headerProps:r.object,fullWidth:r.bool,sidebarWidth:r.number,dense:r.oneOf([!0,!1,"auto"])};Y.defaultProps={title:"Home",headerProps:{},fullWidth:!1,sidebarWidth:120,dense:"auto"};const hn=y("div",{shouldForwardProp:e=>e!=="sidebarWidth"})`
|
|
665
665
|
&.dashboard {
|
|
666
666
|
display: flex;
|
|
667
667
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aB as $,aC as x,aD as d,aE as e,ch as k,cb as y,ca as m,r as C,aF as M,aG as l,j as s,aI as z,aJ as j,
|
|
1
|
+
import{aB as $,aC as x,aD as d,aE as e,ch as k,cb as y,ca as m,r as C,aF as M,aG as l,j as s,aI as z,aJ as j,br as R,P as B}from"./index-IcQQOgM-.js";import{a as T,F as E}from"./FormControlLabel-C0hZddbx.js";import{c as P}from"./useSlot-D6gCQKPz.js";function D(t){return x("MuiSwitch",t)}const o=$("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),I=["className","color","edge","size","sx"],N=P(),O=t=>{const{classes:a,edge:i,size:r,color:p,checked:u,disabled:h}=t,g={root:["root",i&&`edge${e(i)}`,`size${e(r)}`],switchBase:["switchBase",`color${e(p)}`,u&&"checked",h&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},b=j(g,D,a);return l({},a,b)},_=d("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,a)=>{const{ownerState:i}=t;return[a.root,i.edge&&a[`edge${e(i.edge)}`],a[`size${e(i.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${o.thumb}`]:{width:16,height:16},[`& .${o.switchBase}`]:{padding:4,[`&.${o.checked}`]:{transform:"translateX(16px)"}}}}]}),U=d(T,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,a)=>{const{ownerState:i}=t;return[a.switchBase,{[`& .${o.input}`]:a.input},i.color!=="default"&&a[`color${e(i.color)}`]]}})(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${o.checked}`]:{transform:"translateX(20px)"},[`&.${o.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${o.checked} + .${o.track}`]:{opacity:.5},[`&.${o.disabled} + .${o.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${o.input}`]:{left:"-100%",width:"300%"}}),({theme:t})=>({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:k(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(([,a])=>a.main&&a.light).map(([a])=>({props:{color:a},style:{[`&.${o.checked}`]:{color:(t.vars||t).palette[a].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[a].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:k(t.palette[a].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${o.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${a}DisabledColor`]:`${t.palette.mode==="light"?y(t.palette[a].main,.62):m(t.palette[a].main,.55)}`}},[`&.${o.checked} + .${o.track}`]:{backgroundColor:(t.vars||t).palette[a].main}}}))]})),A=d("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,a)=>a.track})(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`})),F=d("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,a)=>a.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),L=C.forwardRef(function(a,i){const r=N({props:a,name:"MuiSwitch"}),{className:p,color:u="primary",edge:h=!1,size:g="medium",sx:b}=r,f=M(r,I),c=l({},r,{color:u,edge:h,size:g}),n=O(c),w=s.jsx(F,{className:n.thumb,ownerState:c});return s.jsxs(_,{className:z(n.root,p),sx:b,ownerState:c,children:[s.jsx(U,l({type:"checkbox",icon:w,checkedIcon:w,ref:i,ownerState:c},f,{classes:l({},n,{root:n.switchBase})})),s.jsx(A,{className:n.track,ownerState:c})]})}),V=L,v=R(t=>s.jsx(V,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...t}))(({theme:t})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:t.palette.mode==="dark"?"#2ECA45":"#65C466",opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:"#33cf4d",border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:t.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:t.palette.mode==="light"?"#E9E9EA":"#39393D",opacity:1,transition:t.transitions.create(["background-color"],{duration:500})}}));function S({labelProps:t,...a}){return t?s.jsx(E,{control:s.jsx(v,{...a}),...t}):s.jsx(v,{...a})}S.propTypes={labelProps:B.object};S.defaultProps={labelProps:null};export{S,V as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{gx as V,r as x,gy as W,V as P,eJ as $,gz as S,gA as j,R as B,bw as Q,dF as U}from"./index-IcQQOgM-.js";var X=function(i,e){return i===void 0&&(i=[]),e===void 0&&(e=[]),V(i,e)},Y=function(i,e,r){var n=x.useRef(),t=x.useRef(0);X(e,n.current)||(n.current=e,t.current+=1),W(i,[t.current],r)},Z=/(mac|iphone|ipod|ipad)/i.test(typeof navigator<"u"?navigator==null?void 0:navigator.platform:""),D={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pausebreak:19,capslock:20,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,leftarrow:37,uparrow:38,rightarrow:39,downarrow:40,insert:45,delete:46,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftwindowkey:91,rightwindowkey:92,meta:Z?[91,93]:[91,92],selectkey:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,multiply:106,add:107,subtract:109,decimalpoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,semicolon:186,equalsign:187,comma:188,dash:189,period:190,forwardslash:191,graveaccent:192,openbracket:219,backslash:220,closebracket:221,singlequote:222},R={ctrl:function(i){return i.ctrlKey},shift:function(i){return i.shiftKey},alt:function(i){return i.altKey},meta:function(i){return i.type==="keyup"?D.meta.includes(i.keyCode):i.metaKey}};function G(i){return j(i)||B(i)}function p(i){var e=Object.keys(R).reduce(function(r,n){return R[n](i)?r+1:r},0);return[16,17,18,91,92].includes(i.keyCode)?e:e+1}function z(i,e,r){var n,t;if(!i.key)return!1;if(B(e))return i.keyCode===e?e:!1;var l=e.split("."),a=0;try{for(var f=S(l),o=f.next();!o.done;o=f.next()){var c=o.value,s=R[c],u=D[c.toLowerCase()];(s&&s(i)||u&&u===i.keyCode)&&a++}}catch(b){n={error:b}}finally{try{o&&!o.done&&(t=f.return)&&t.call(f)}finally{if(n)throw n.error}}return r?a===l.length&&p(i)===l.length?e:!1:a===l.length?e:!1}function N(i,e){return Q(i)?i:G(i)?function(r){return z(r,i,e)}:Array.isArray(i)?function(r){return i.find(function(n){return z(r,n,e)})}:function(){return!!i}}var O=["keydown"];function _(i,e,r){var n=r||{},t=n.events,l=t===void 0?O:t,a=n.target,f=n.exactMatch,o=f===void 0?!1:f,c=n.useCapture,s=c===void 0?!1:c,u=P(e),b=P(i);Y(function(){var A,m,L,v=$(a,window);if(v){var T=function(g){var C,E=N(b.current,o),y=E(g),h=G(y)?y:g.key;if(y)return(C=u.current)===null||C===void 0?void 0:C.call(u,g,h)};try{for(var K=S(l),k=K.next();!k.done;k=K.next()){var H=k.value;(L=v==null?void 0:v.addEventListener)===null||L===void 0||L.call(v,H,T,s)}}catch(g){A={error:g}}finally{try{k&&!k.done&&(m=K.return)&&m.call(K)}finally{if(A)throw A.error}}return function(){var g,C,E;try{for(var y=S(l),h=y.next();!h.done;h=y.next()){var J=h.value;(E=v==null?void 0:v.removeEventListener)===null||E===void 0||E.call(v,J,T,s)}}catch(M){g={error:M}}finally{try{h&&!h.done&&(C=y.return)&&C.call(y)}finally{if(g)throw g.error}}}}},[l],a)}function d(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}function q(i,e){for(var r="",n=0,t=-1,l=0,a,f=0;f<=i.length;++f){if(f<i.length)a=i.charCodeAt(f);else{if(a===47)break;a=47}if(a===47){if(!(t===f-1||l===1))if(t!==f-1&&l===2){if(r.length<2||n!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var o=r.lastIndexOf("/");if(o!==r.length-1){o===-1?(r="",n=0):(r=r.slice(0,o),n=r.length-1-r.lastIndexOf("/")),t=f,l=0;continue}}else if(r.length===2||r.length===1){r="",n=0,t=f,l=0;continue}}e&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+="/"+i.slice(t+1,f):r=i.slice(t+1,f),n=f-t-1;t=f,l=0}else a===46&&l!==-1?++l:l=-1}return r}function I(i,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+i+n:n}var w={resolve:function(){for(var e="",r=!1,n,t=arguments.length-1;t>=-1&&!r;t--){var l;t>=0?l=arguments[t]:(n===void 0&&(n=U.cwd()),l=n),d(l),l.length!==0&&(e=l+"/"+e,r=l.charCodeAt(0)===47)}return e=q(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(d(e),e.length===0)return".";var r=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47;return e=q(e,!r),e.length===0&&!r&&(e="."),e.length>0&&n&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return d(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 n=arguments[r];d(n),n.length>0&&(e===void 0?e=n:e+="/"+n)}return e===void 0?".":w.normalize(e)},relative:function(e,r){if(d(e),d(r),e===r||(e=w.resolve(e),r=w.resolve(r),e===r))return"";for(var n=1;n<e.length&&e.charCodeAt(n)===47;++n);for(var t=e.length,l=t-n,a=1;a<r.length&&r.charCodeAt(a)===47;++a);for(var f=r.length,o=f-a,c=l<o?l:o,s=-1,u=0;u<=c;++u){if(u===c){if(o>c){if(r.charCodeAt(a+u)===47)return r.slice(a+u+1);if(u===0)return r.slice(a+u)}else l>c&&(e.charCodeAt(n+u)===47?s=u:u===0&&(s=0));break}var b=e.charCodeAt(n+u),A=r.charCodeAt(a+u);if(b!==A)break;b===47&&(s=u)}var m="";for(u=n+s+1;u<=t;++u)(u===t||e.charCodeAt(u)===47)&&(m.length===0?m+="..":m+="/..");return m.length>0?m+r.slice(a+s):(a+=s,r.charCodeAt(a)===47&&++a,r.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(d(e),e.length===0)return".";for(var r=e.charCodeAt(0),n=r===47,t=-1,l=!0,a=e.length-1;a>=1;--a)if(r=e.charCodeAt(a),r===47){if(!l){t=a;break}}else l=!1;return t===-1?n?"/":".":n&&t===1?"//":e.slice(0,t)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');d(e);var n=0,t=-1,l=!0,a;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var f=r.length-1,o=-1;for(a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(c===47){if(!l){n=a+1;break}}else o===-1&&(l=!1,o=a+1),f>=0&&(c===r.charCodeAt(f)?--f===-1&&(t=a):(f=-1,t=o))}return n===t?t=o:t===-1&&(t=e.length),e.slice(n,t)}else{for(a=e.length-1;a>=0;--a)if(e.charCodeAt(a)===47){if(!l){n=a+1;break}}else t===-1&&(l=!1,t=a+1);return t===-1?"":e.slice(n,t)}},extname:function(e){d(e);for(var r=-1,n=0,t=-1,l=!0,a=0,f=e.length-1;f>=0;--f){var o=e.charCodeAt(f);if(o===47){if(!l){n=f+1;break}continue}t===-1&&(l=!1,t=f+1),o===46?r===-1?r=f:a!==1&&(a=1):r!==-1&&(a=-1)}return r===-1||t===-1||a===0||a===1&&r===t-1&&r===n+1?"":e.slice(r,t)},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 I("/",e)},parse:function(e){d(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var n=e.charCodeAt(0),t=n===47,l;t?(r.root="/",l=1):l=0;for(var a=-1,f=0,o=-1,c=!0,s=e.length-1,u=0;s>=l;--s){if(n=e.charCodeAt(s),n===47){if(!c){f=s+1;break}continue}o===-1&&(c=!1,o=s+1),n===46?a===-1?a=s:u!==1&&(u=1):a!==-1&&(u=-1)}return a===-1||o===-1||u===0||u===1&&a===o-1&&a===f+1?o!==-1&&(f===0&&t?r.base=r.name=e.slice(1,o):r.base=r.name=e.slice(f,o)):(f===0&&t?(r.name=e.slice(1,a),r.base=e.slice(1,o)):(r.name=e.slice(f,a),r.base=e.slice(f,o)),r.ext=e.slice(a,o)),f>0?r.dir=e.slice(0,f-1):t&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};w.posix=w;var ee=w;export{ee as p,_ as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{P as r,r as b,bA as W,u as C,j as d,aA as _,_ as F,y as $}from"./index-IcQQOgM-.js";import{S as q}from"./index-C8pZezDf.js";import{D as B}from"./index-DTwcC2c1.js";import{L as V}from"./selector-Bgt80Coe.js";const G=r.shape({appLogo:r.node,appName:r.string,theme:r.shape({background:r.string}),enableConnect:r.bool,enableLocale:r.bool,navigation:r.arrayOf(r.shape({title:r.oneOfType([r.string,r.object]),link:r.oneOfType([r.string,r.object]),icon:r.string,items:r.arrayOf(r.shape({title:r.oneOfType([r.string,r.object]),link:r.oneOfType([r.string,r.object])}))}))}),D=r.shape({showText:r.bool,showRole:r.bool,switchDid:r.bool,switchProfile:r.bool,switchPassport:r.bool,disableLogout:r.bool,onLogin:r.func,onLogout:r.func,onSwitchDid:r.func,onSwitchProfile:r.func,onSwitchPassport:r.func,menu:r.array,menuRender:r.func,dark:r.bool,size:r.number}),A=(n,o,t="children")=>n.map(s=>Array.isArray(s[t])?o({...s,[t]:A(s[t],o,t)}):o(s)),J=(n,o="children")=>{const t=[];return A(n,s=>t.push(s),o),t},S=(n,o,t="children")=>n.map(s=>({...s})).filter(s=>{const e=s[t];if(Array.isArray(e)){const c=S(e,o,t);s[t]=c!=null&&c.length?c:void 0}const a={filteredChildren:s[t],isLeaf:!(e!=null&&e.length)};return o(s,a)}),Q=n=>/^https?:\/\//.test(n),ie=n=>/^[\w-]+:[\w-]+$/.test(n),X=n=>{if(!n||!(n!=null&&n.startsWith("/")))return!1;const o=e=>e.endsWith("/")?e:`${e}/`,t=o(window.location.pathname),s=o(new URL(n,window.location.origin).pathname);return t.startsWith(s)},Y=(n=[])=>{const o=n.map((s,e)=>({path:s,index:e})).filter(s=>X(s.path));return o!=null&&o.length?o.slice(1).reduce((s,e)=>s.path.length>=e.path.length?s:e,o[0]).index:-1};var z,E;const N=((z=window==null?void 0:window.blocklet)==null?void 0:z.groupPrefix)||((E=window==null?void 0:window.blocklet)==null?void 0:E.prefix)||"/",Z=n=>{const o={...n},t=n==null?void 0:n.background;return typeof t=="string"?o.background={header:t,footer:t,default:t}:t&&typeof t=="object"&&(o.background={header:t.header||t.default,footer:t.footer||t.default,default:t.default}),o},I=(n,o="en")=>{if(!(n!=null&&n.length))return n;const t=(e,a)=>typeof e=="string"?e:typeof e=="object"?e[a]||(e==null?void 0:e.en)||(e==null?void 0:e.zh):e,s=(e,a)=>{if(typeof e=="string"){if(Q(e)){const h=new URL(e);return h.searchParams.set("locale",a),h.href}const c=new URL(e,window.location.origin);return c.searchParams.set("locale",a),c.pathname+c.search}return typeof e=="object"?e[a]||(e==null?void 0:e.en)||(e==null?void 0:e.zh):e};return A(n,e=>{var a;return{...e,title:t(e.title,o),link:(a=e.items)!=null&&a.length?e.link:s(e.link,o),_rawLink:e.link}},"items")},K=n=>A(n,o=>o.role?{...o,role:Array.isArray(o.role)?o.role:[o.role]}:o,"items"),ee=n=>{if(!(n!=null&&n.length))return null;const o=K(n),t={header:[],footer:[],social:[],bottom:[],dashboard:[],sessionManager:[],userCenter:[]};return o.forEach(s=>{var e;s.section?Array.isArray(s.section)?s.section.forEach(a=>{var c;(c=t[a])==null||c.push(s)}):typeof s.section=="string"&&((e=t[s.section])==null||e.push(s)):t.header.push(s)}),t},oe=n=>{if(!n)return null;const o={...n};return o.theme=Z(o.theme),o.navigation=ee(ne(o.navigation)),o},ne=(n=[])=>S(n,(o,t)=>{var s;return!!o.link||((s=t.filteredChildren)==null?void 0:s.length)},"items"),U=(n,o)=>S(n,(t,s)=>{var a;const e=!t.role||o&&t.role.includes(o);return s.isLeaf?e:e&&((a=s.filteredChildren)==null?void 0:a.length)},"items");function M({formattedBlocklet:n,addons:o,sessionManagerProps:t}){var L,l,m,j;const s=b.useContext(W),{locale:e}=C()||{},{enableConnect:a=!0,enableLocale:c=!0}=n,h=!!((L=s==null?void 0:s.session)!=null&&L.user);let i=I((l=n==null?void 0:n.navigation)==null?void 0:l.sessionManager,e)||[];i=U(i,(j=(m=s==null?void 0:s.session)==null?void 0:m.user)==null?void 0:j.role);const w=(()=>{if(o&&typeof o!="function")return Array.isArray(o)?o:[o];let g=[];if(c&&e&&g.push(d.jsx(V,{showText:!1},"locale-selector")),a&&s){const x=[];h&&(i?i.slice(0,5):[]).forEach(y=>{x.push({label:y.title,icon:y.icon?d.jsx("iconify-icon",{icon:y.icon,height:24,style:{marginRight:8}}):null,component:"a",href:y.link,key:y.link})}),g.push(d.jsx(q,{session:s.session,locale:e},"session-blocklet")),g.push(d.jsx(_,{session:s.session,locale:e,menu:x,showRole:!0,...t},"session-user"))}return typeof o=="function"&&(g=o(g)||[]),g})();return b.createElement(d.Fragment,null,...Array.isArray(w)?w:[w])}M.propTypes={formattedBlocklet:r.object.isRequired,addons:r.oneOfType([r.func,r.node]),sessionManagerProps:D};M.defaultProps={addons:null,sessionManagerProps:{showRole:!0}};const re=()=>{const n=F();b.useEffect(()=>{n.wallet&&$.call("arcHideTopBar","{}")},[n])};function H({meta:n,fallbackUrl:o,invalidPathFallback:t,headerAddons:s,sessionManagerProps:e,links:a,...c}){var O;re();const h=b.useContext(W),i=(O=h==null?void 0:h.session)==null?void 0:O.user,R=i==null?void 0:i.role,{locale:w}=C()||{},p=b.useMemo(()=>{const u=Object.assign({},window.blocklet,n);try{return oe(u)}catch(P){return console.error("Failed to format blocklet info",P,u),u}},[n]),{localizedNav:L,flattened:l,matchedIndex:m}=b.useMemo(()=>{var k;let u=I((k=p==null?void 0:p.navigation)==null?void 0:k.dashboard,w)||[];u=U(u,R),u=A(u,f=>({title:f.title,url:f.link,icon:f.icon?d.jsx("iconify-icon",{height:"100%",width:"100%",icon:f.icon}):null,external:!0,children:f.items}),"items");const P=J(u).filter(f=>!!f.url),T=Y(P.map(f=>f.url));return T!==-1&&(P[T].active=!0),{localizedNav:u,flattened:P,matchedIndex:T}},[p,w,R]),j=typeof a=="function"?a(L):[...L,...a];if(b.useLayoutEffect(()=>{i&&!(l!=null&&l.length)&&o&&(window.location.href=o)},[o]),b.useLayoutEffect(()=>{i&&(l!=null&&l.length)&&m===-1&&t&&t()},[t,l,m]),!p.appName)return null;const{appLogo:g,appLogoRect:x,appName:v}=p,y=d.jsx(M,{formattedBlocklet:p,addons:s,sessionManagerProps:e});return d.jsx(B,{title:v,fullWidth:!0,sidebarWidth:128,legacy:!1,links:j,...c,headerProps:{homeLink:N,logo:d.jsx("img",{src:x||g,alt:"logo"}),addons:y,...c.headerProps}})}H.propTypes={meta:G,fallbackUrl:r.string,invalidPathFallback:r.func,headerAddons:r.oneOfType([r.func,r.node]),sessionManagerProps:D,links:r.oneOfType([r.array,r.func])};H.defaultProps={meta:{},fallbackUrl:N,invalidPathFallback:null,headerAddons:void 0,sessionManagerProps:{showRole:!0,onLogout:()=>{window.location.href=N}},links:[]};export{G as B,H as D,M as H,ie as a,J as b,Y as c,oe as f,I as g,Q as i,A as m,N as p,re as u};
|