@abtnode/blocklet-services 1.16.38-beta-20250116-083413-dbd33222 → 1.16.38-beta-20250120-112111-55c032e8
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 +8 -3
- package/api/routes/env.js +2 -0
- package/dist/assets/{Add-DA06or_T.js → Add-DwDyMZjP.js} +1 -1
- package/dist/assets/{ArrowDropDown-ByvmY1fG.js → ArrowDropDown-6xgUlX8W.js} +1 -1
- package/dist/assets/{CheckCircle-61kAAbS7.js → CheckCircle-D3qBEHQS.js} +1 -1
- package/dist/assets/{ChevronLeft-BEMgr19u.js → ChevronLeft-DgLREh72.js} +1 -1
- package/dist/assets/{ChevronRight-C9Sf_Tx7.js → ChevronRight-IFh5bkgF.js} +1 -1
- package/dist/assets/{DeleteOutline-CUlVP0SU.js → DeleteOutline-DQMkPBvg.js} +1 -1
- package/dist/assets/{Done-DBzH2QOU.js → Done-DLCsccPu.js} +1 -1
- package/dist/assets/{Download-CufGBMcn.js → Download-DTpNGuLl.js} +1 -1
- package/dist/assets/{Error-BRj42iX7.js → Error-UtB5QYSZ.js} +1 -1
- package/dist/assets/{Google-C9fXfahB.js → Google-BOAVI-Xc.js} +1 -1
- package/dist/assets/{InfoOutlined-CB0cJwBU.js → InfoOutlined-DQLlyyVh.js} +1 -1
- package/dist/assets/{Launch-DhDcxyle.js → Launch-Dh_xOrs9.js} +1 -1
- package/dist/assets/{LaunchOutlined--NsW2V4X.js → LaunchOutlined-foAf5c3n.js} +1 -1
- package/dist/assets/{Loop-DecQ6hrf.js → Loop-C4-HT3aE.js} +1 -1
- package/dist/assets/{MoreHoriz-jR1hvlRv.js → MoreHoriz-CUpIy534.js} +1 -1
- package/dist/assets/{PlayArrow-BQPL8ZKx.js → PlayArrow-DXnaLQNG.js} +1 -1
- package/dist/assets/{ViewList-COpI8i9D.js → ViewList-CRla7mfM.js} +1 -1
- package/dist/assets/_createAggregator-B36dTDyD.js +1 -0
- package/dist/assets/{access-control-CyOr5O9b.js → access-control-vt3SOToF.js} +1 -1
- package/dist/assets/{actions-DDDMPf_w.js → actions-Ca8zHti6.js} +1 -1
- package/dist/assets/add-component-core-CacRzL5C.js +716 -0
- package/dist/assets/{add-resource-Znwa5ovp.js → add-resource-ZEGylpES.js} +1 -1
- package/dist/assets/{addon-DRWTut9y.js → addon-CD5JNqbI.js} +1 -1
- package/dist/assets/{analytics-iIAmuHjx.js → analytics-hNGjKcAT.js} +1 -1
- package/dist/assets/api-CjgpDSsI.js +1 -0
- package/dist/assets/ar-4M8AtNpp.js +3 -0
- package/dist/assets/{ar-Da8oOZhL.js → ar-DoIWDL3Q.js} +1 -1
- package/dist/assets/{audit-logs-8Mi-fbdp.js → audit-logs-BKvkrneR.js} +1 -1
- package/dist/assets/{base32-BJ0zdvwj.js → base32-uGF9kxBw.js} +1 -1
- package/dist/assets/{branding-Y_Xiasx4.js → branding-BfuJue_R.js} +2 -2
- package/dist/assets/{bundle-avatar-vdPLynfx.js → bundle-avatar-BkNNM9he.js} +1 -1
- package/dist/assets/{button-bqdvVuzW.js → button-6RO042tO.js} +1 -1
- package/dist/assets/{click-to-copy-CmMy3CrF.js → click-to-copy-DSvEXBYz.js} +1 -1
- package/dist/assets/{complete-CS43JIHv.js → complete-DOx-lUao.js} +1 -1
- package/dist/assets/{component-BCTw0GKP.js → component-DuXXl9Wb.js} +1 -1
- package/dist/assets/{config-DmjSKN24.js → config-BY9NHNw2.js} +2 -2
- package/dist/assets/{config-CJbVE0vv.js → config-_Ff2iSUC.js} +1 -1
- package/dist/assets/{config-navigation-CNspwqbG.js → config-navigation-m1gKN3Qh.js} +3 -3
- package/dist/assets/{config-space-DmPh1bZ_.js → config-space-DFc6Pvuv.js} +1 -1
- package/dist/assets/{confirm-Cx-IVcgq.js → confirm-DUAXonUU.js} +1 -1
- package/dist/assets/{connect-Czw6WbQF.js → connect-B8cD_Man.js} +1 -1
- package/dist/assets/{connect-B6MpXaBD.js → connect-CywmqoEu.js} +1 -1
- package/dist/assets/{connect-to-DYBaYeJc.js → connect-to-DrkQpX8j.js} +1 -1
- package/dist/assets/{dashboard-CPxg5LvZ.js → dashboard-ChoAkepn.js} +3 -3
- package/dist/assets/{de-BYtQQOr-.js → de-BVgb1fEg.js} +1 -1
- package/dist/assets/de-D7CG0ov1.js +3 -0
- package/dist/assets/{did-address-DsOFwsmU.js → did-address-BD4xjcb5.js} +1 -1
- package/dist/assets/{domain-CZsQei8I.js → domain-C3fxr6Yg.js} +1 -1
- package/dist/assets/{domain-list-D4Clgh5O.js → domain-list-Do_JR9rl.js} +2 -2
- package/dist/assets/{email-CtCPE15h.js → email-Bne33m4E.js} +3 -3
- package/dist/assets/{es-BYjXKvnd.js → es-CWcVPAna.js} +1 -1
- package/dist/assets/es-DDr-aesw.js +3 -0
- package/dist/assets/{exchange-passport-CZFdfxAy.js → exchange-passport-De6icZUJ.js} +1 -1
- package/dist/assets/{form-text-input-s_8M9qAU.js → form-text-input-BCHcrKD9.js} +1 -1
- package/dist/assets/{fr-Di7fDhg9.js → fr-C8Jr_C8u.js} +1 -1
- package/dist/assets/fr-CsECkLCu.js +3 -0
- package/dist/assets/{fuel-DQb6QtRb.js → fuel-BCXVQ7L0.js} +1 -1
- package/dist/assets/{fullpage-vhYlt62g.js → fullpage-Dd-4ilXd.js} +1 -1
- package/dist/assets/{get-safe-url-Bg-eYJFz.js → get-safe-url-CWTjw4O_.js} +1 -1
- package/dist/assets/{get-safe-url-CUm2E-jn.js → get-safe-url-g5s2_Tjs.js} +1 -1
- package/dist/assets/hi-Bojespkc.js +1 -0
- package/dist/assets/{hi-JrL4jTWL.js → hi-DTqZQNNB.js} +1 -1
- package/dist/assets/{home-X6wxlptK.js → home-Cy8ZPRh3.js} +1 -1
- package/dist/assets/{id-CgtYzmhQ.js → id-CUsGyKYW.js} +1 -1
- package/dist/assets/id-PvpxFUDg.js +3 -0
- package/dist/assets/{iframe-CVBJbqTp.js → iframe-B1rCM9Eo.js} +1 -1
- package/dist/assets/{index-BfVR8O43.js → index-0YXNPVgm.js} +26 -26
- package/dist/assets/index-3ytyTrcC.js +2 -0
- package/dist/assets/{index-8FWcj3Y4.js → index-BEw2AyDT.js} +7 -7
- package/dist/assets/index-BJ7_xt0j.js +104 -0
- package/dist/assets/{index-IvME2p33.js → index-Bj0uuh8o.js} +1 -1
- package/dist/assets/{index-JFhSGIs6.js → index-BnIb4VTf.js} +1 -1
- package/dist/assets/{index-COiVRnOM.js → index-C1Xq6XBK.js} +1 -1
- package/dist/assets/{index-Dl6rjJDp.js → index-C73dl7Hb.js} +1 -1
- package/dist/assets/{index-BFfaWqP3.js → index-CWMVCzCZ.js} +1 -1
- package/dist/assets/{index-DcwCauP3.js → index-CfrumxV3.js} +1 -1
- package/dist/assets/index-D2ZJq7sT.js +228 -0
- package/dist/assets/{index-B0QYqr2A.js → index-D5GvmQYq.js} +15 -15
- package/dist/assets/{index-iqfmQPLo.js → index-DKA7-XNE.js} +1 -1
- package/dist/assets/{index-BGO2DsWz.js → index-Dtif7RsI.js} +1 -1
- package/dist/assets/{index-BtxzZ9SO.js → index-HfngL4ZQ.js} +1 -1
- package/dist/assets/{index-BbrJG83p.js → index-wVbkSf51.js} +1 -1
- package/dist/assets/{invitation-CN9oEvb3.js → invitation-HSZrTxov.js} +1 -1
- package/dist/assets/{invite-C2OM8i63.js → invite-Bq0wk8ts.js} +1 -1
- package/dist/assets/{issue-passport-B6l3ZIL0.js → issue-passport-CVJgqjoO.js} +1 -1
- package/dist/assets/{item-BG6Y4B38.js → item-ClsWGBWW.js} +2 -2
- package/dist/assets/{ja-kNnm5FIs.js → ja-B0U7M2t1.js} +1 -1
- package/dist/assets/ja-B9wMKQOb.js +3 -0
- package/dist/assets/ko-C_Flkwn-.js +3 -0
- package/dist/assets/{ko-Bp4AGMi0.js → ko-CpDA9JjF.js} +1 -1
- package/dist/assets/{layout-mYIHD_Mg.js → layout-C4CjSZo6.js} +1 -1
- package/dist/assets/{list-header-Bce1kvpA.js → list-header-DH99VXjo.js} +1 -1
- package/dist/assets/localization-CBcpjiaX.js +1 -0
- package/dist/assets/{log-CBfX52Lz.js → log-DURqeXoL.js} +3 -3
- package/dist/assets/{login-b0vBgUs0.js → login-Bspf2QPd.js} +1 -1
- package/dist/assets/{login-oauth-callback-BVkafEHi.js → login-oauth-callback-C_wyWhiQ.js} +1 -1
- package/dist/assets/{logo-uploader-B7OF9E82.js → logo-uploader-Dd2aFjos.js} +3 -3
- package/dist/assets/{lost-passport-z5GhQRa9.js → lost-passport-BSTbRq2w.js} +1 -1
- package/dist/assets/{open-window-CIN-c_8i.js → open-window-CbZilAH2.js} +1 -1
- package/dist/assets/{overview-BPRG92Fe.js → overview-fXNI1ek4.js} +1 -1
- package/dist/assets/{page-header-PFRlhj0j.js → page-header-CjQ-ywzU.js} +1 -1
- package/dist/assets/{permission-BwvfjqYI.js → permission-7KeKIEKG.js} +1 -1
- package/dist/assets/{preferences-DY1qnOCx.js → preferences-BvdZgVe4.js} +1 -1
- package/dist/assets/{pt-DWGzgF0H.js → pt-7r06GaNd.js} +1 -1
- package/dist/assets/pt-BqEVlA-1.js +1 -0
- package/dist/assets/publish-resource-DKGi8v_y.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-DZo8yE8C.js → react-beautiful-dnd.esm-1AJr8vv6.js} +4 -4
- package/dist/assets/{relative-time-D0LbFIi3.js → relative-time-DXGmoAYD.js} +1 -1
- package/dist/assets/{ru-KetZJtiW.js → ru-MS-ksi2g.js} +1 -1
- package/dist/assets/ru-u0x_icQc.js +1 -0
- package/dist/assets/sdk-iUaLet3q.js +1 -0
- package/dist/assets/session-Cz3pOVxP.js +1 -0
- package/dist/assets/{setup-LILji8SV.js → setup-BoMrIrRo.js} +3 -3
- package/dist/assets/{start-DXNq6pym.js → start-DbCciQyK.js} +1 -1
- package/dist/assets/{step-actions-ChI-f31y.js → step-actions-BF4Z-WD4.js} +1 -1
- package/dist/assets/{studio-C8ceaGGk.js → studio-DJOlNVRZ.js} +1 -1
- package/dist/assets/{switch-control-DzGhrJO3.js → switch-control-Df6SSLH9.js} +1 -1
- package/dist/assets/th-BX_96cb2.js +1 -0
- package/dist/assets/{th-DbGao18H.js → th-gcuRSNHo.js} +1 -1
- package/dist/assets/{toUpper-Ch8IcBS5.js → toUpper-BYBs387H.js} +1 -1
- package/dist/assets/{transfer-C_2vz0eA.js → transfer-CoIJ2-Fh.js} +1 -1
- package/dist/assets/{unsubscribe-CbRJLLVz.js → unsubscribe-DHlZPuAs.js} +1 -1
- package/dist/assets/{useAsync-cdOzMWPw.js → useAsync-D2wKH3Wq.js} +1 -1
- package/dist/assets/{useAsyncRetry-ng-QDeMG.js → useAsyncRetry-B87-aW-H.js} +1 -1
- package/dist/assets/{useLocalStorage-CM8R1gkX.js → useLocalStorage-Dsxa7zZV.js} +1 -1
- package/dist/assets/user-center-BY7PdrGc.js +203 -0
- package/dist/assets/{util-D7vfOed5.js → util-DzhfzPwC.js} +1 -1
- package/dist/assets/vendor-arcblock-D-SOxQ_x.js +3509 -0
- package/dist/assets/{vendor-hooks-CLzfFpO7.js → vendor-hooks-CAfthYak.js} +1 -1
- package/dist/assets/vendor-utils-B7sI0FpJ.js +11 -0
- package/dist/assets/vi-7r8InJhP.js +1 -0
- package/dist/assets/{vi-hrya0JxD.js → vi-CGYOhf_R.js} +1 -1
- package/dist/assets/wrap-locale-CjCBeQlY.js +1 -0
- package/dist/assets/{zh-CHioW4ik.js → zh-BYS_9r4v.js} +1 -1
- package/dist/assets/zh-D0JQ3A7z.js +4 -0
- package/dist/assets/{zh-tw-LiaeDjuy.js → zh-tw-BR5CO3an.js} +1 -1
- package/dist/assets/zh-tw-CnxtpiBO.js +3 -0
- package/dist/index.html +4 -4
- package/dist/service-worker.js +1 -1
- package/package.json +21 -21
- package/dist/assets/_createAggregator-D73d37er.js +0 -1
- package/dist/assets/add-component-core-BTs2P_Jp.js +0 -716
- package/dist/assets/api-C0C4sDJA.js +0 -1
- package/dist/assets/ar-7ttREm7R.js +0 -3
- package/dist/assets/de-rZ-qvWqU.js +0 -3
- package/dist/assets/es-BU9x-PJk.js +0 -3
- package/dist/assets/fr-DW8hDuav.js +0 -3
- package/dist/assets/hi-BBATPy58.js +0 -1
- package/dist/assets/id-B3tqmZ1i.js +0 -3
- package/dist/assets/index-BP4o1Jjj.js +0 -228
- package/dist/assets/index-CYQoZJsb.js +0 -104
- package/dist/assets/ja-B7dx7PB1.js +0 -3
- package/dist/assets/ko-BuKH8Xym.js +0 -3
- package/dist/assets/localization-_hzGA-9a.js +0 -1
- package/dist/assets/pt-SFtgVKOC.js +0 -1
- package/dist/assets/publish-resource-Co4IkWOk.js +0 -1
- package/dist/assets/ru-DW4CEx4a.js +0 -1
- package/dist/assets/sdk-CrCNIpAP.js +0 -1
- package/dist/assets/session-Ku4cwX2M.js +0 -1
- package/dist/assets/th-C-m_sG2U.js +0 -1
- package/dist/assets/user-center-Dvw2MR8N.js +0 -202
- package/dist/assets/vendor-arcblock-BlPSuvWz.js +0 -3506
- package/dist/assets/vendor-utils-DCpRgzMR.js +0 -11
- package/dist/assets/vi-DFWs_XTe.js +0 -1
- package/dist/assets/wrap-locale-Df7FBKhT.js +0 -1
- package/dist/assets/zh-C84g18sR.js +0 -4
- package/dist/assets/zh-tw-DBzp3T8D.js +0 -3
|
@@ -1,716 +0,0 @@
|
|
|
1
|
-
import{a1 as sr,j as i,E as _,a2 as ht,aa as Ve,a3 as te,T as ge,t as Mt,aN as Gr,bJ as Hr,I as $o,bK as Uo,bL as Wo,z as zo,aJ as ka,bn as qo,bM as Ca,M as ar,bt as Ia,bu as _a,bv as Pa,br as La,ad as Ko,L as Na,bm as Aa,aw as Da,al as Xr,e as Kn,x as Vn,R as Vo,V as Go,ar as Ho,bH as Xo,ac as yt,aF as Ma,as as Kt,bN as Hi,A as Xi,Z as Fa,P as Ba,G as $a,v as Ua,$ as Wa,D as za,K as Yi,a4 as qa,bp as Ka}from"./vendor-mui-core-jh6OMVvU.js";import{r as N,g as lr,u as Va,k as Ga,a as Yr,e as je,b as Ha,l as Xa}from"./vendor-react-D-afvo_7.js";import{j as Yo,d as Ya,S as Ja,s as Jo,A as Qa}from"./item-BG6Y4B38.js";import{ad as cr,ag as st,al as Jr,b0 as ot,U as Qo,b1 as Ji,d as Zo,g as pt,b2 as Bt,F as Za,D as el,E as ur,b3 as tl,s as nl,ao as rl,ab as es,b4 as Qi,b5 as il,z as Qr,C as ol,b6 as ts,b7 as ln,ai as sl,Q as Zr,b8 as al,b9 as ll,f as Zi,ba as ns,bb as nr,bc as ei,aD as rs,a6 as dr,bd as xr,be as cl,v as Bn,bf as is,aN as ul,bg as dl,bh as Br,bi as hl,ak as pl,bj as fl,aj as ml,$ as gl,bk as vl}from"./vendor-arcblock-BlPSuvWz.js";import{f as Ft,y as Gn,Y as yl,Z as bl,h as Rt,C as xl,$ as wl,a0 as El,a1 as Sl,B as hr,a2 as os,U as Tl,W as jl,a3 as Ol,a4 as Rl,a5 as Jn,a6 as eo,a7 as kl}from"./index-CYQoZJsb.js";import{L as to}from"./launch-result-message-CeThGm85.js";import{P as ss}from"./page-header-PFRlhj0j.js";import{u as Cl,C as Il}from"./config-space-DmPh1bZ_.js";import{R as wr}from"./logo-uploader-B7OF9E82.js";import{S as _l}from"./index-BtxzZ9SO.js";import{s as as,h as Pl,w as Ll,f as Nl,a as Al,b as Dl,c as Ml,M as Fl}from"./index-CzV3SmGK.js";import{B as Hn,o as Bl,k as $l,q as ls,K as Ul}from"./vendor-hooks-CLzfFpO7.js";import{g as Wl}from"./get-safe-url-CUm2E-jn.js";import{p as zl,B as ql,a as no,j as Wn,w as ti,q as Kl,s as Vl,t as Gl,u as Hl}from"./vendor-utils-DCpRgzMR.js";import{p as Xl}from"./index-BGO2DsWz.js";import{I as ro}from"./index-JFhSGIs6.js";import{u as Yl}from"./session-Ku4cwX2M.js";import{W as Jl}from"./did-address-DsOFwsmU.js";import{_ as cs}from"./useLocalStorage-CM8R1gkX.js";import{f as us}from"./format-error-C0Ke3VXF.js";import{a as io}from"./api-C0C4sDJA.js";import{d as Ql,v as Zl,e as ec}from"./util-D7vfOed5.js";import{u as ds}from"./use-mobile-DoeLOxx6.js";import{C as tc}from"./content-layout-DAGIv17a.js";import{C as nc,D as rc,a as ic}from"./connect-to-DYBaYeJc.js";import{d as oc}from"./ArrowDropDown-ByvmY1fG.js";import{d as sc}from"./ChevronLeft-BEMgr19u.js";import{d as ac}from"./ChevronRight-C9Sf_Tx7.js";const af="blocklet-add-component-registry",lf="server-add-registry",cf=e=>`resource-${e}-add-registry`;var ni={},lc=sr;Object.defineProperty(ni,"__esModule",{value:!0});var hs=ni.default=void 0,cc=lc(cr()),uc=i;hs=ni.default=(0,cc.default)((0,uc.jsx)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link");function ri({disabled:e,children:t,onConfirm:n}){return N.useEffect(()=>{if(e)return()=>{};const r=o=>{o.code==="Enter"&&(o.metaKey===!0||o.ctrlKey===!0)&&(o.preventDefault(),o.stopPropagation(),n())};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[e,n]),t}ri.propTypes={disabled:_.bool,children:_.any.isRequired,onConfirm:_.func.isRequired};ri.defaultProps={disabled:!1};function ii({onContinue:e,nextDisabled:t,launching:n,texts:r,description:o}){const[c,h]=N.useState(!1),d=()=>h(b=>!b);return i.jsxs(i.Fragment,{children:[i.jsx(dc,{children:i.jsxs(ri,{disabled:t,onConfirm:e,children:[i.jsx("div",{className:"eula-trigger",onClick:d,children:r.listenName}),i.jsx(st,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:n?i.jsxs(i.Fragment,{children:[i.jsx(ht,{size:14}),r.launchingText]}):r.buttonNext})]})}),i.jsx(Jr,{open:c,title:r.listenName,onClose:()=>h(!1),children:o})]})}ii.propTypes={onContinue:_.func.isRequired,nextDisabled:_.bool,launching:_.bool,description:_.any,texts:_.object};ii.defaultProps={nextDisabled:!1,launching:!1,description:"",texts:{listenName:"",launchingText:"",buttonNext:""}};const dc=Ve.div`
|
|
2
|
-
margin: 0 auto;
|
|
3
|
-
display: flex;
|
|
4
|
-
justify-content: space-between;
|
|
5
|
-
align-items: center;
|
|
6
|
-
|
|
7
|
-
@media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.eula-trigger {
|
|
12
|
-
cursor: pointer;
|
|
13
|
-
text-decoration: underline;
|
|
14
|
-
${e=>e.theme.breakpoints.up("md")} {
|
|
15
|
-
padding-right: 24px;
|
|
16
|
-
}
|
|
17
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
18
|
-
padding: 16px;
|
|
19
|
-
}
|
|
20
|
-
font-size: 14px;
|
|
21
|
-
white-space: nowrap;
|
|
22
|
-
&:hover {
|
|
23
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.next-button {
|
|
28
|
-
min-width: 200px;
|
|
29
|
-
}
|
|
30
|
-
`;var oi={exports:{}},oo=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,hc=/\n/g,pc=/^\s*/,fc=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,mc=/^:\s*/,gc=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,vc=/^[;\s]*/,yc=/^\s+|\s+$/g,bc=`
|
|
31
|
-
`,so="/",ao="*",tn="",xc="comment",wc="declaration",Ec=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(S){var R=S.match(hc);R&&(n+=R.length);var P=S.lastIndexOf(bc);r=~P?S.length-P:r+S.length}function c(){var S={line:n,column:r};return function(R){return R.position=new h(S),x(),R}}function h(S){this.start=S,this.end={line:n,column:r},this.source=t.source}h.prototype.content=e;function d(S){var R=new Error(t.source+":"+n+":"+r+": "+S);if(R.reason=S,R.filename=t.source,R.line=n,R.column=r,R.source=e,!t.silent)throw R}function b(S){var R=S.exec(e);if(R){var P=R[0];return o(P),e=e.slice(P.length),R}}function x(){b(pc)}function s(S){var R;for(S=S||[];R=l();)R!==!1&&S.push(R);return S}function l(){var S=c();if(!(so!=e.charAt(0)||ao!=e.charAt(1))){for(var R=2;tn!=e.charAt(R)&&(ao!=e.charAt(R)||so!=e.charAt(R+1));)++R;if(R+=2,tn===e.charAt(R-1))return d("End of comment missing");var P=e.slice(2,R-2);return r+=2,o(P),e=e.slice(R),r+=2,S({type:xc,comment:P})}}function O(){var S=c(),R=b(fc);if(R){if(l(),!b(mc))return d("property missing ':'");var P=b(gc),A=S({type:wc,property:lo(R[0].replace(oo,tn)),value:P?lo(P[0].replace(oo,tn)):tn});return b(vc),A}}function y(){var S=[];s(S);for(var R;R=O();)R!==!1&&(S.push(R),s(S));return S}return x(),y()};function lo(e){return e?e.replace(yc,tn):tn}var Sc=Ec;function ps(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,o=Sc(e),c=typeof t=="function",h,d,b=0,x=o.length;b<x;b++)r=o[b],h=r.property,d=r.value,c?t(h,d,r):d&&(n||(n={}),n[h]=d);return n}oi.exports=ps;oi.exports.default=ps;var Tc=oi.exports;const jc=lr(Tc),Oc={}.hasOwnProperty;function Rc(e,t,n){if(typeof e!="function")throw new TypeError("h is not a function");const r=Cc(e),o=Pc(e),c=_c(e);let h,d;if(typeof n=="string"||typeof n=="boolean"?(h=n,n={}):(n||(n={}),h=n.prefix),t&&t.type==="root"){const b=t.children[0];d=t.children.length===1&&b.type==="element"?b:{type:"element",tagName:"div",properties:{},children:t.children}}else if(t&&t.type==="element")d=t;else throw new Error("Expected root or element, not `"+(t&&t.type||t)+"`");return fs(e,d,{schema:n.space==="svg"?as:Pl,prefix:h==null?r||o||c?"h-":void 0:typeof h=="string"?h:h?"h-":void 0,key:0,react:r,vue:o,vdom:c,hyperscript:Ic(e)})}function fs(e,t,n){const r=n.schema;let o=r,c=t.tagName;const h={},d=[];let b=-1,x;r.space==="html"&&c.toLowerCase()==="svg"&&(o=as,n.schema=o);for(x in t.properties)t.properties&&Oc.call(t.properties,x)&&kc(h,x,t.properties[x],n,c);if(n.vdom&&(o.space==="html"?c=c.toUpperCase():o.space&&(h.namespace=Ll[o.space])),n.prefix&&(n.key++,h.key=n.prefix+n.key),t.children)for(;++b<t.children.length;){const s=t.children[b];s.type==="element"?d.push(fs(e,s,n)):s.type==="text"&&d.push(s.value)}return n.schema=r,d.length>0?e.call(t,c,h,d):e.call(t,c,h)}function kc(e,t,n,r,o){const c=Nl(r.schema,t);let h;n==null||typeof n=="number"&&Number.isNaN(n)||n===!1&&(r.vue||r.vdom||r.hyperscript)||!n&&c.boolean&&(r.vue||r.vdom||r.hyperscript)||(Array.isArray(n)&&(n=c.commaSeparated?Al(n):Dl(n)),c.boolean&&r.hyperscript&&(n=""),c.property==="style"&&typeof n=="string"&&(r.react||r.vue||r.vdom)&&(n=Lc(n,o)),r.vue?c.property!=="style"&&(h="attrs"):c.mustUseProperty||(r.vdom?c.property!=="style"&&(h="attributes"):r.hyperscript&&(h="attrs")),h?e[h]=Object.assign(e[h]||{},{[c.attribute]:n}):c.space&&r.react?e[Ml[c.property]||c.property]=n:e[c.attribute]=n)}function Cc(e){const t=e("div",{});return!!(t&&("_owner"in t||"_store"in t)&&(t.key===void 0||t.key===null))}function Ic(e){return"context"in e&&"cleanup"in e}function _c(e){return e("div",{}).type==="VirtualNode"}function Pc(e){const t=e("div",{});return!!(t&&t.context&&t.context._isVue)}function Lc(e,t){const n={};try{jc(e,(r,o)=>{r.slice(0,4)==="-ms-"&&(r="ms-"+r.slice(4)),n[r.replace(/-([a-z])/g,(c,h)=>h.toUpperCase())]=o})}catch(r){const o=r;throw o.message=t+"[style]"+o.message.slice(9),o}return n}var Nc=ms;function ms(e){if(typeof e=="string")return Fc(e);if(e==null)return Bc;if(typeof e=="object")return("length"in e?Mc:Dc)(e);if(typeof e=="function")return e;throw new Error("Expected function, string, or object as test")}function Ac(e){for(var t=[],n=e.length,r=-1;++r<n;)t[r]=ms(e[r]);return t}function Dc(e){return t;function t(n){var r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function Mc(e){var t=Ac(e),n=t.length;return r;function r(){for(var o=-1;++o<n;)if(t[o].apply(this,arguments))return!0;return!1}}function Fc(e){return t;function t(n){return!!(n&&n.type===e)}}function Bc(){return!0}var $c=pr,Uc=Nc,gs=!0,vs="skip",rr=!1;pr.CONTINUE=gs;pr.SKIP=vs;pr.EXIT=rr;function pr(e,t,n,r){var o;typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),o=Uc(t),c(e,null,[]);function c(d,b,x){var s=[],l;return(!t||o(d,b,x[x.length-1]||null))&&(s=co(n(d,x)),s[0]===rr)?s:d.children&&s[0]!==vs?(l=co(h(d.children,x.concat(d))),l[0]===rr?l:s):s}function h(d,b){for(var x=-1,s=r?-1:1,l=(r?d.length:x)+s,O;l>x&&l<d.length;){if(O=c(d[l],l,b),O[0]===rr)return O;l=typeof O[1]=="number"?O[1]:l+s}}}function co(e){return e!==null&&typeof e=="object"&&"length"in e?e:typeof e=="number"?[gs,e]:[e]}var Wc=mr,fr=$c,zc=fr.CONTINUE,qc=fr.SKIP,Kc=fr.EXIT;mr.CONTINUE=zc;mr.SKIP=qc;mr.EXIT=Kc;function mr(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),fr(e,t,o,r);function o(c,h){var d=h[h.length-1],b=d?d.children.indexOf(c):null;return n(c,b,d)}}var Vc=Wc,Gc=Object.prototype.hasOwnProperty,Er={align:"text-align",valign:"vertical-align",height:"height",width:"width"},Hc=function(t){return Vc(t,"element",Xc),t};function Xc(e){if(!(e.tagName!=="tr"&&e.tagName!=="td"&&e.tagName!=="th")){var t,n;for(t in Er)!Gc.call(Er,t)||e.properties[t]===void 0||(n=Er[t],Yc(e,n,e.properties[t]),delete e.properties[t])}}function Yc(e,t,n){var r=(e.properties.style||"").trim();r&&!/;\s*/.test(r)&&(r+=";"),r&&(r+=" ");var o=r+t+": "+n+";";e.properties.style=o}const Jc=lr(Hc);function Qc(e){const t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}const Zc={}.hasOwnProperty,eu=new Set(["table","thead","tbody","tfoot","tr"]);function tu(e){if(!e||typeof e.createElement!="function")throw new TypeError("createElement is not a function");const t=e.createElement,n=e.fixTableCellAlign!==!1;Object.assign(this,{Compiler:r});function r(c){let h=Rc(o,n?Jc(c):c,e.prefix);return c.type==="root"?(h=h&&typeof h=="object"&&"type"in h&&"props"in h&&h.type==="div"&&(c.children.length!==1||c.children[0].type!=="element")?h.props.children:[h],t(e.Fragment||"div",{},h)):h}function o(c,h,d){if(d&&eu.has(c)&&(d=d.filter(b=>!Qc(b))),e.components&&Zc.call(e.components,c)){const b=e.components[c];return e.passNode&&typeof b=="function"&&(h=Object.assign({node:this},h)),t(b,h,d)}return t(c,h,d)}}function si({children:e}){return i.jsx(nu,{children:e})}const uo="source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important",nu=Ve(te)`
|
|
32
|
-
.highlight pre,
|
|
33
|
-
pre {
|
|
34
|
-
border-radius: 5px;
|
|
35
|
-
}
|
|
36
|
-
code {
|
|
37
|
-
font-family: ${uo};
|
|
38
|
-
}
|
|
39
|
-
pre code {
|
|
40
|
-
font-size: 14px;
|
|
41
|
-
font-family: ${uo};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
h1,
|
|
45
|
-
h2,
|
|
46
|
-
h3,
|
|
47
|
-
h4,
|
|
48
|
-
h5,
|
|
49
|
-
h6 {
|
|
50
|
-
font-weight: 700 !important;
|
|
51
|
-
font-size: 1.2rem !important;
|
|
52
|
-
line-height: 1.5 !important;
|
|
53
|
-
margin-bottom: 16px;
|
|
54
|
-
margin-top: 24px;
|
|
55
|
-
border-bottom: initial !important;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.CodeMirror pre {
|
|
59
|
-
background: #f6f8fa !important;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.anchor {
|
|
63
|
-
display: none;
|
|
64
|
-
}
|
|
65
|
-
`;si.propTypes={children:_.any.isRequired};si.defaultProps={};function ys({infoList:e=[]}){return i.jsx(te,{className:"info-table",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"max-content 1fr"},columnGap:4,rowGap:1.5},children:e.map(t=>i.jsxs(i.Fragment,{children:[i.jsx(te,{component:"span",sx:{fontWeight:"bold",whiteSpace:"nowrap"},children:t.key}),i.jsx(te,{component:"span",sx:{marginTop:{xs:-1,md:0}},children:t.value})]}))})}ys.propTypes={infoList:_.arrayOf(_.shape({key:_.string,value:_.string}))};const ru=e=>e.payment?(e.payment.price||[]).map(n=>n.value||0).every(n=>n===0):!0,iu=new tu({createElement:N.createElement}).Compiler,Ot={zh:{appinfo:{name:"应用名",version:"版本号",author:"开发者",description:"描述",community:"社区地址",documentation:"文档手册",support:"服务支持",overview:"概述",requirements:"节点版本要求"}},en:{appinfo:{name:"Name",version:"Version",author:"Author",description:"Description",community:"Community",documentation:"Documentation",support:"Support",overview:"Overview",requirements:"Server requirements"}}};function ai({blockletMeta:e,locale:t,handleDescEle:n}){const{data:r}=e,{registryUrl:o,did:c}=r,h=Ft.getDisplayName({meta:r}),d=Hn(()=>o&&c?fetch(Ji(o,"/api/blocklets",c,"readme")).then(S=>S.json()):null,{refreshDeps:[o,c]}),b=Bl(()=>d.data?d.data[t]||d.data.en||d.data[Object.keys(d.data)[0]]:"",[d]),x=r&&r.htmlAst?iu(r.htmlAst):"",s=ru(r);let l=ot(r,"owner.fullName");if(l){const S=ot(r,"owner.did");S&&(l=i.jsxs(te,{sx:{display:"flex",alignItems:"center",gap:1},children:[l,i.jsx(Qo,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:S,compact:!0,size:14,locale:t})]}))}else l=ot(r,"author.name");const O=[{key:ot(Ot[t],"appinfo.name"),value:Ft.getDisplayName({meta:r})},{key:ot(Ot[t],"appinfo.version"),value:r.version},{key:ot(Ot[t],"appinfo.author"),value:l},{type:"description",key:ot(Ot[t],"appinfo.description"),value:r.description}];r.requirements&&O.push({key:ot(Ot[t],"appinfo.requirements"),value:r.requirements.server}),r.community&&O.push({key:ot(Ot[t],"appinfo.community"),value:i.jsx("a",{href:r.community,target:"_blank",rel:"noreferrer",children:r.community})}),r.documentation&&O.push({key:ot(Ot[t],"appinfo.documentation"),value:i.jsx("a",{href:r.documentation,target:"_blank",rel:"noreferrer",children:r.documentation})}),r.support&&O.push({key:ot(Ot[t],"appinfo.support"),value:i.jsx("a",{href:`mailto:${r.support}`,target:"_blank",rel:"noreferrer",children:r.support})}),x&&O.push({key:ot(Ot[t],"appinfo.overview"),value:""});let y;return t==="zh"?y=i.jsxs(i.Fragment,{children:[s?i.jsxs("p",{children:["您可以免费使用 ",i.jsx("b",{children:h}),";"]}):i.jsxs("p",{children:["您需要购买才能使用 ",i.jsx("b",{children:h}),";"]}),i.jsx("p",{children:"在应用启动前,需要选择您的节点;"}),i.jsx("p",{children:"如果您没有节点,我们会引导您创建新的节点;"}),i.jsx("p",{children:"下面为该应用的信息:"})]}):y=i.jsxs(i.Fragment,{children:[s?i.jsxs("p",{children:["You can use ",i.jsx("b",{children:h})," for free;"]}):i.jsxs("p",{children:["You need to purchase before launch ",i.jsx("b",{children:h}),";"]}),i.jsx("p",{children:"Before the blocklet starts, you need to select your Blocklet Server; "}),i.jsx("p",{children:"If you do not have any Blocklet Server, we will guide you to create a new one; "}),i.jsx("p",{children:"Below is the information for the blocklet: "})]}),i.jsxs(su,{children:[n||y,i.jsx(ys,{infoList:O}),b?i.jsxs("div",{className:"app-overview",children:[i.jsx(ge,{variant:"h5",gutterBottom:!0,children:ot(Ot[t],"appinfo.overview")}),i.jsx(si,{children:i.jsx(ou,{component:"div",className:"content-wrapper post-content",children:i.jsx(Fl,{source:b,wrapperElement:{"data-color-mode":"light"},urlTransform:(S,R,P)=>S.startsWith("/")?Ji(o,S):S})})})]}):x?i.jsx("div",{className:"app-overview",children:x}):null]})}const ou=Ve(ge)`
|
|
66
|
-
width: 100%;
|
|
67
|
-
word-wrap: break-word;
|
|
68
|
-
word-break: break-word;
|
|
69
|
-
line-height: 1.5em;
|
|
70
|
-
min-height: 10vh;
|
|
71
|
-
margin-bottom: 40px !important;
|
|
72
|
-
|
|
73
|
-
.alert-content {
|
|
74
|
-
max-width: 100%;
|
|
75
|
-
p:last-of-type {
|
|
76
|
-
margin-bottom: 0;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
iframe {
|
|
81
|
-
width: 100% !important;
|
|
82
|
-
}
|
|
83
|
-
`,su=Ve.div`
|
|
84
|
-
.info-table {
|
|
85
|
-
a {
|
|
86
|
-
word-break: break-all;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
.app-overview {
|
|
90
|
-
font-size: 16px;
|
|
91
|
-
margin: 16px 0 0 16px;
|
|
92
|
-
h1 {
|
|
93
|
-
margin: 8px 0;
|
|
94
|
-
font-size: 20px;
|
|
95
|
-
}
|
|
96
|
-
h2 {
|
|
97
|
-
margin: 8px 0;
|
|
98
|
-
font-size: 18px;
|
|
99
|
-
}
|
|
100
|
-
ul {
|
|
101
|
-
display: block;
|
|
102
|
-
list-style-type: disc;
|
|
103
|
-
padding-left: 2em;
|
|
104
|
-
li {
|
|
105
|
-
display: list-item;
|
|
106
|
-
list-style: disc;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
blockquote {
|
|
110
|
-
margin-left: 2em;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
`;ai.propTypes={blockletMeta:_.object.isRequired,locale:_.string.isRequired,handleDescEle:_.node};ai.defaultProps={handleDescEle:""};function au({...e}){return i.jsxs("div",{...e,style:{width:"100%"},children:[i.jsx("h3",{children:"End User License Agreement for Application"}),i.jsxs("p",{children:["Blocklet Server License Agreement ",Zo.COPYRIGHT_OWNER," version 2020-08-28"]}),i.jsx("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),i.jsx("p",{children:"暂无"})]})}function lu(e){var t,n,r,o;return`${((t=e.bundleSource)==null?void 0:t.store)||e.meta.homepage}/assets/${(n=e.meta)==null?void 0:n.did}/${((r=e.meta)==null?void 0:r.logo)||"logo.png"}?v=${(o=e.meta)==null?void 0:o.version}`}function li({installRelated:e,meta:t,show:n,onClose:r,components:o,loading:c}){const{t:h}=pt(),d=Mt(l=>l.breakpoints.down("md"));if(!n)return null;const b=!c&&o.length===0,x=!c&&o.length!==0,s=40;return i.jsxs(Jr,{title:h("blocklet.component.relatedComponents",{name:t.title}),maxWidth:!1,fullWidth:!1,onClose:(l,O)=>{O!=="backdropClick"&&r(!1)},PaperProps:{style:d?{width:"100%",height:window.innerHeight}:{maxWidth:500,minWidth:300,width:"80%"}},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:[c&&i.jsx(te,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:i.jsx(te,{sx:{fontSize:32},color:"primary.main",component:Bt,icon:"line-md:loading-loop"})}),b&&i.jsx(te,{sx:{textAlign:"center"},children:h("blocklet.component.noDependencies",{name:t.title})}),x&&i.jsx(te,{sx:{marginBottom:2},children:o.map(l=>{if(!l.meta)return null;const{required:O}=l;let y;return e||O?y=1:y=.5,i.jsxs(te,{sx:{opacity:y,padding:"10px 0px",paddingBottom:.5,marginTop:0,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[i.jsx("img",{style:{width:s,height:s,minWidth:s,minHeight:s},src:lu(l),alt:l.meta.title}),i.jsxs(te,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[i.jsxs(te,{sx:{display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",fontSize:"16px",fontWeight:"bold",cursor:"pointer",".link-icon":{opacity:0},":hover .link-icon":{opacity:1}},onClick:()=>{var S;window.open(Wl(`${((S=l.bundleSource)==null?void 0:S.store)||l.meta.homepage}/blocklets/${l.meta.did}`,{allowDomains:null}),"_blank")},children:[l.meta.title,i.jsx(te,{sx:{display:O?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:h("blocklet.component.required")}),i.jsxs(te,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[l.meta.version,i.jsx(te,{className:"link-icon",icon:"fluent:open-20-filled",component:Bt,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),i.jsx(te,{sx:{marginTop:0,opacity:.7},children:l.meta.description})]})]},l.meta.did)})})]})}li.propTypes={meta:_.object,show:_.bool,onClose:_.func.isRequired,installRelated:_.func,components:_.array.isRequired,loading:_.bool.isRequired};li.defaultProps={meta:null,show:!1,installRelated:!1};function cu(e){return e&&(e.registryUrl||e.homepage)&&e.did?`${e.registryUrl||e.homepage}/api/blocklets/${e==null?void 0:e.did}/blocklet.json`:""}function uu(e){const{api:t}=Gn(),[n]=Va(),r=n.get("blocklet_meta_url")||cu(e),[o,c]=N.useState([]),[h,d]=N.useState(!1);return N.useEffect(()=>{!r||e!=null&&e.inputUrl||(d(!0),t.getDynamicComponents({input:{url:r}}).then(b=>{c(b.components)}).finally(()=>{d(!1)}))},[r]),{components:o,loading:h}}function ci({installRelated:e,onChangeInstallRelated:t,meta:n,onClickNext:r,handleDescEle:o}){const c=Ga(),{t:h,locale:d}=pt(),[b,x]=N.useState(!1),{components:s,loading:l}=uu(n),O=r||(()=>{c(`/launch-blocklet/install${window.location.search}`)}),y=()=>{x(!0)},S=()=>{x(!1)};return i.jsxs(du,{children:[i.jsx("div",{className:"app-content",children:i.jsx("div",{className:"agreement",children:i.jsx("div",{className:"agreement-content",children:i.jsx(ai,{blockletMeta:{data:n},locale:d,handleDescEle:o})})})}),i.jsxs(te,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[l?i.jsx(Bt,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,t&&(s!=null&&s.length)?i.jsxs(te,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[i.jsx(Gr,{sx:{mr:.5},checked:e,onChange:R=>t(R.currentTarget.checked),control:i.jsx(Hr,{}),label:i.jsx("span",{children:h("launchBlocklet.installRelatedComponents")})}),i.jsx(te,{sx:{"> button svg":{color:"primary.main"}},children:i.jsx($o,{size:"small",onClick:y,children:i.jsx(Bt,{icon:"octicon:package-dependencies-16"})})})]}):null,i.jsx("div",{className:"button-container","data-cy":"agree-all",children:i.jsx(ii,{onContinue:O,description:i.jsx(au,{}),texts:{listenName:h("launchBlocklet.license"),buttonNext:h("launchBlocklet.next")}})})]}),i.jsx(li,{installRelated:e,meta:n,show:b,onClose:S,components:s,loading:l})]})}ci.propTypes={meta:_.object.isRequired,onClickNext:_.func,handleDescEle:_.node,installRelated:_.bool,onChangeInstallRelated:_.func};ci.defaultProps={onClickNext:null,handleDescEle:"",installRelated:!0,onChangeInstallRelated:null};const du=Ve.div`
|
|
114
|
-
display: flex;
|
|
115
|
-
flex-direction: column;
|
|
116
|
-
align-items: center;
|
|
117
|
-
width: 100%;
|
|
118
|
-
height: 100%;
|
|
119
|
-
flex: 1;
|
|
120
|
-
.app-content {
|
|
121
|
-
padding: 2px 24px 24px;
|
|
122
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
123
|
-
padding-top: 10px;
|
|
124
|
-
}
|
|
125
|
-
width: 100%;
|
|
126
|
-
flex: 1;
|
|
127
|
-
letter-spacing: normal;
|
|
128
|
-
}
|
|
129
|
-
.agreement {
|
|
130
|
-
position: relative;
|
|
131
|
-
display: flex;
|
|
132
|
-
flex-direction: column;
|
|
133
|
-
width: 100%;
|
|
134
|
-
height: 100%;
|
|
135
|
-
border: 1px solid ${e=>e.theme.palette.grey[100]};
|
|
136
|
-
border-radius: 12px;
|
|
137
|
-
${e=>e.theme.breakpoints.up("md")} {
|
|
138
|
-
margin-top: 24px;
|
|
139
|
-
}
|
|
140
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
141
|
-
margin-top: 16px;
|
|
142
|
-
}
|
|
143
|
-
.agreement-content {
|
|
144
|
-
position: absolute;
|
|
145
|
-
left: 0;
|
|
146
|
-
top: 0;
|
|
147
|
-
width: 100%;
|
|
148
|
-
height: 100%;
|
|
149
|
-
font-size: 14px;
|
|
150
|
-
overflow-y: auto;
|
|
151
|
-
${e=>e.theme.breakpoints.up("md")} {
|
|
152
|
-
padding: 0 24px;
|
|
153
|
-
}
|
|
154
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
155
|
-
padding: 0 16px;
|
|
156
|
-
}
|
|
157
|
-
&:after {
|
|
158
|
-
display: block;
|
|
159
|
-
content: '';
|
|
160
|
-
height: 24px;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
.agreement-bottom {
|
|
165
|
-
display: flex;
|
|
166
|
-
width: 100%;
|
|
167
|
-
padding: 24px;
|
|
168
|
-
${e=>e.theme.breakpoints.up("md")} {
|
|
169
|
-
flex-direction: row;
|
|
170
|
-
align-items: center;
|
|
171
|
-
margin-left: auto;
|
|
172
|
-
}
|
|
173
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
174
|
-
flex-direction: column;
|
|
175
|
-
align-items: center;
|
|
176
|
-
padding-top: 0;
|
|
177
|
-
padding-bottom: 16px;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
.button-container {
|
|
181
|
-
${e=>e.theme.breakpoints.up("md")} {
|
|
182
|
-
margin-left: auto;
|
|
183
|
-
}
|
|
184
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
185
|
-
padding-top: 0;
|
|
186
|
-
padding-bottom: 16px;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
`;var bs={},ui={exports:{}},xs={exports:{}},An=xs.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^\/([^/]+)\/((?!.*(\/-\/|\/repository(\/[^/]+)?\/archive\.tar\.gz)).*?)(?:\.git|\/)?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{7,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(e){return"file-"+ws(e)}}},ho={sshtemplate:"git@{domain}:{user}/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{user}/{project}.git{#committish}",browsetemplate:"https://{domain}/{user}/{project}{/tree/committish}",browsefiletemplate:"https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",docstemplate:"https://{domain}/{user}/{project}{/tree/committish}#readme",httpstemplate:"git+https://{auth@}{domain}/{user}/{project}.git{#committish}",filetemplate:"https://{domain}/{user}/{project}/raw/{committish}/{path}",shortcuttemplate:"{type}:{user}/{project}{#committish}",pathtemplate:"{user}/{project}{#committish}",pathmatch:/^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,hashformat:ws};Object.keys(An).forEach(function(e){Object.keys(ho).forEach(function(t){An[e][t]||(An[e][t]=ho[t])}),An[e].protocols_re=RegExp("^("+An[e].protocols.map(function(t){return t.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function ws(e){return e.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var Es=xs.exports,po=Es,jn=Object.assign||function(t,n){if(n===null||typeof n!="object")return t;const r=Object.keys(n);let o=r.length;for(;o--;)t[r[o]]=n[r[o]];return t},hu=He;function He(e,t,n,r,o,c,h){var d=this;d.type=e,Object.keys(po[e]).forEach(function(b){d[b]=po[e][b]}),d.user=t,d.auth=n,d.project=r,d.committish=o,d.default=c,d.opts=h||{}}He.prototype.hash=function(){return this.committish?"#"+this.committish:""};He.prototype._fill=function(e,t){if(e){var n=jn({},t);n.path=n.path?n.path.replace(/^[/]+/g,""):"",t=jn(jn({},this.opts),t);var r=this;Object.keys(this).forEach(function(s){r[s]!=null&&n[s]==null&&(n[s]=r[s])});var o=n.auth,c=n.committish,h=n.fragment,d=n.path,b=n.project;Object.keys(n).forEach(function(s){var l=n[s];(s==="path"||s==="project")&&typeof l=="string"?n[s]=l.split("/").map(function(O){return encodeURIComponent(O)}).join("/"):s!=="domain"&&(n[s]=encodeURIComponent(l))}),n["auth@"]=o?o+"@":"",n["#fragment"]=h?"#"+this.hashformat(h):"",n.fragment=n.fragment?n.fragment:"",n["#path"]=d?"#"+this.hashformat(d):"",n["/path"]=n.path?"/"+n.path:"",n.projectPath=b.split("/").map(encodeURIComponent).join("/"),t.noCommittish?(n["#committish"]="",n["/tree/committish"]="",n["/committish"]="",n.committish=""):(n["#committish"]=c?"#"+c:"",n["/tree/committish"]=n.committish?"/"+n.treepath+"/"+n.committish:"",n["/committish"]=n.committish?"/"+n.committish:"",n.committish=n.committish||"master");var x=e;return Object.keys(n).forEach(function(s){x=x.replace(new RegExp("[{]"+s+"[}]","g"),n[s])}),t.noGitPlus?x.replace(/^git[+]/,""):x}};He.prototype.ssh=function(e){return this._fill(this.sshtemplate,e)};He.prototype.sshurl=function(e){return this._fill(this.sshurltemplate,e)};He.prototype.browse=function(e,t,n){return typeof e=="string"?(typeof t!="string"&&(n=t,t=null),this._fill(this.browsefiletemplate,jn({fragment:t,path:e},n))):this._fill(this.browsetemplate,e)};He.prototype.docs=function(e){return this._fill(this.docstemplate,e)};He.prototype.bugs=function(e){return this._fill(this.bugstemplate,e)};He.prototype.https=function(e){return this._fill(this.httpstemplate,e)};He.prototype.git=function(e){return this._fill(this.gittemplate,e)};He.prototype.shortcut=function(e){return this._fill(this.shortcuttemplate,e)};He.prototype.path=function(e){return this._fill(this.pathtemplate,e)};He.prototype.tarball=function(e){var t=jn({},e,{noCommittish:!1});return this._fill(this.tarballtemplate,t)};He.prototype.file=function(e,t){return this._fill(this.filetemplate,jn({path:e},t))};He.prototype.getDefaultRepresentation=function(){return this.default};He.prototype.toString=function(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)};var Sr,fo;function pu(){return fo||(fo=1,Sr=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Sr}var fu=xe;xe.Node=on;xe.create=xe;function xe(e){var t=this;if(t instanceof xe||(t=new xe),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(o){t.push(o)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)t.push(arguments[n]);return t}xe.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t};xe.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};xe.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};xe.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)gu(this,arguments[e]);return this.length};xe.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)vu(this,arguments[e]);return this.length};xe.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};xe.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};xe.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;n!==null;r++)e.call(t,n.value,r,this),n=n.next};xe.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;n!==null;r--)e.call(t,n.value,r,this),n=n.prev};xe.prototype.get=function(e){for(var t=0,n=this.head;n!==null&&t<e;t++)n=n.next;if(t===e&&n!==null)return n.value};xe.prototype.getReverse=function(e){for(var t=0,n=this.tail;n!==null&&t<e;t++)n=n.prev;if(t===e&&n!==null)return n.value};xe.prototype.map=function(e,t){t=t||this;for(var n=new xe,r=this.head;r!==null;)n.push(e.call(t,r.value,this)),r=r.next;return n};xe.prototype.mapReverse=function(e,t){t=t||this;for(var n=new xe,r=this.tail;r!==null;)n.push(e.call(t,r.value,this)),r=r.prev;return n};xe.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=0;r!==null;o++)n=e(n,r.value,o),r=r.next;return n};xe.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=this.length-1;r!==null;o--)n=e(n,r.value,o),r=r.prev;return n};xe.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e};xe.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e};xe.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new xe;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=0,o=this.head;o!==null&&r<e;r++)o=o.next;for(;o!==null&&r<t;r++,o=o.next)n.push(o.value);return n};xe.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new xe;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=this.length,o=this.tail;o!==null&&r>t;r--)o=o.prev;for(;o!==null&&r>e;r--,o=o.prev)n.push(o.value);return n};xe.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,o=this.head;o!==null&&r<e;r++)o=o.next;for(var c=[],r=0;o&&r<t;r++)c.push(o.value),o=this.removeNode(o);o===null&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(var r=0;r<n.length;r++)o=mu(this,o,n[r]);return c};xe.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};function mu(e,t,n){var r=t===e.head?new on(n,null,t,e):new on(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function gu(e,t){e.tail=new on(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function vu(e,t){e.head=new on(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function on(e,t,n,r){if(!(this instanceof on))return new on(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{pu()(xe)}catch{}const yu=fu,nn=Symbol("max"),Dt=Symbol("length"),Tn=Symbol("lengthCalculator"),$n=Symbol("allowStale"),rn=Symbol("maxAge"),At=Symbol("dispose"),mo=Symbol("noDisposeOnSet"),Be=Symbol("lruList"),gt=Symbol("cache"),Ss=Symbol("updateAgeOnGet"),Tr=()=>1;class bu{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[nn]=t.max||1/0;const n=t.length||Tr;if(this[Tn]=typeof n!="function"?Tr:n,this[$n]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[rn]=t.maxAge||0,this[At]=t.dispose,this[mo]=t.noDisposeOnSet||!1,this[Ss]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[nn]=t||1/0,Dn(this)}get max(){return this[nn]}set allowStale(t){this[$n]=!!t}get allowStale(){return this[$n]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[rn]=t,Dn(this)}get maxAge(){return this[rn]}set lengthCalculator(t){typeof t!="function"&&(t=Tr),t!==this[Tn]&&(this[Tn]=t,this[Dt]=0,this[Be].forEach(n=>{n.length=this[Tn](n.value,n.key),this[Dt]+=n.length})),Dn(this)}get lengthCalculator(){return this[Tn]}get length(){return this[Dt]}get itemCount(){return this[Be].length}rforEach(t,n){n=n||this;for(let r=this[Be].tail;r!==null;){const o=r.prev;go(this,t,r,n),r=o}}forEach(t,n){n=n||this;for(let r=this[Be].head;r!==null;){const o=r.next;go(this,t,r,n),r=o}}keys(){return this[Be].toArray().map(t=>t.key)}values(){return this[Be].toArray().map(t=>t.value)}reset(){this[At]&&this[Be]&&this[Be].length&&this[Be].forEach(t=>this[At](t.key,t.value)),this[gt]=new Map,this[Be]=new yu,this[Dt]=0}dump(){return this[Be].map(t=>ir(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[Be]}set(t,n,r){if(r=r||this[rn],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const o=r?Date.now():0,c=this[Tn](n,t);if(this[gt].has(t)){if(c>this[nn])return On(this,this[gt].get(t)),!1;const b=this[gt].get(t).value;return this[At]&&(this[mo]||this[At](t,b.value)),b.now=o,b.maxAge=r,b.value=n,this[Dt]+=c-b.length,b.length=c,this.get(t),Dn(this),!0}const h=new xu(t,n,c,o,r);return h.length>this[nn]?(this[At]&&this[At](t,n),!1):(this[Dt]+=h.length,this[Be].unshift(h),this[gt].set(t,this[Be].head),Dn(this),!0)}has(t){if(!this[gt].has(t))return!1;const n=this[gt].get(t).value;return!ir(this,n)}get(t){return jr(this,t,!0)}peek(t){return jr(this,t,!1)}pop(){const t=this[Be].tail;return t?(On(this,t),t.value):null}del(t){On(this,this[gt].get(t))}load(t){this.reset();const n=Date.now();for(let r=t.length-1;r>=0;r--){const o=t[r],c=o.e||0;if(c===0)this.set(o.k,o.v);else{const h=c-n;h>0&&this.set(o.k,o.v,h)}}}prune(){this[gt].forEach((t,n)=>jr(this,n,!1))}}const jr=(e,t,n)=>{const r=e[gt].get(t);if(r){const o=r.value;if(ir(e,o)){if(On(e,r),!e[$n])return}else n&&(e[Ss]&&(r.value.now=Date.now()),e[Be].unshiftNode(r));return o.value}},ir=(e,t)=>{if(!t||!t.maxAge&&!e[rn])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[rn]&&n>e[rn]},Dn=e=>{if(e[Dt]>e[nn])for(let t=e[Be].tail;e[Dt]>e[nn]&&t!==null;){const n=t.prev;On(e,t),t=n}},On=(e,t)=>{if(t){const n=t.value;e[At]&&e[At](n.key,n.value),e[Dt]-=n.length,e[gt].delete(n.key),e[Be].removeNode(t)}};class xu{constructor(t,n,r,o,c){this.key=t,this.value=n,this.length=r,this.now=o,this.maxAge=c||0}}const go=(e,t,n,r)=>{let o=n.value;ir(e,o)&&(On(e,n),e[$n]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};var wu=bu,$r=yl,vo=Es,Eu=ui.exports=hu,Su=wu,Or=new Su({max:1e3}),Tu={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function ju(e){return Tu[e]||e.slice(0,-1)}var Ou={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};ui.exports.fromUrl=function(e,t){if(typeof e=="string"){var n=e+JSON.stringify(t||{});return Or.has(n)||Or.set(n,Ru(e,t)),Or.get(n)}};function Ru(e,t){if(!(e==null||e==="")){var n=Cu(ku(e)?"github:"+e:e),r=Iu(n),o=n.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),c=Object.keys(vo).map(function(h){try{var d=vo[h],b=null;r.auth&&Ou[r.protocol]&&(b=r.auth);var x=r.hash?decodeURIComponent(r.hash.substr(1)):null,s=null,l=null,O=null;if(o&&o[1]===h)s=o[2]&&decodeURIComponent(o[2]),l=decodeURIComponent(o[3].replace(/\.git$/,"")),O="shortcut";else{if(r.host&&r.host!==d.domain&&r.host.replace(/^www[.]/,"")!==d.domain||!d.protocols_re.test(r.protocol)||!r.path)return;var y=d.pathmatch,S=r.path.match(y);if(!S)return;S[1]!==null&&S[1]!==void 0&&(s=decodeURIComponent(S[1].replace(/^:/,""))),l=decodeURIComponent(S[2]),O=ju(r.protocol)}return new Eu(h,s,b,l,x,O,t)}catch(R){if(!(R instanceof URIError))throw R}}).filter(function(h){return h});if(c.length===1)return c[0]}}function ku(e){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(e)}function Cu(e){var t=$r.parse(e);return t.protocol==="gist:"&&t.host&&!t.path?t.protocol+"/"+t.host:e}function Iu(e){var t=e.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!t){var n=$r.parse(e);if(n.auth){const o=e.match(/[^@]+@[^:/]+/);if(o){var r=new $r.URL(o[0]);n.auth=r.username||"",r.password&&(n.auth+=":"+r.password)}}return n}return{protocol:"git+ssh:",slashes:!0,auth:t[1],host:t[2],port:null,hostname:t[2],hash:t[4],search:null,query:null,pathname:"/"+t[3],path:"/"+t[3],href:"git+ssh://"+t[1]+"@"+t[2]+"/"+t[3]+(t[4]||"")}}var _u=ui.exports,sn={},Z={},Pu=null;const Lu=Object.freeze(Object.defineProperty({__proto__:null,default:Pu},Symbol.toStringTag,{value:"Module"})),Ts=Yr(Lu),Nu=["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],Au=["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"];var Du={charsWide:Nu,charsFullWidth:Au};const{charsWide:Mu,charsFullWidth:Fu}=Du,js=new RegExp(`[${Mu.join("")}${Fu.join("")}]`,"g"),Bu=e=>e.replace(js,"xx").length;var $u={default:Bu,charsRegex:js};/*!
|
|
190
|
-
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
191
|
-
*
|
|
192
|
-
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
193
|
-
* Licensed under the MIT License.
|
|
194
|
-
*/var Uu=function(t){if(typeof t!="string"||t==="")return!1;for(var n;n=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(n[2])return!0;t=t.slice(n.index+n[0].length)}return!1};/*!
|
|
195
|
-
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
196
|
-
*
|
|
197
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
198
|
-
* Released under the MIT License.
|
|
199
|
-
*/var Wu=Uu,Os={"{":"}","(":")","[":"]"},zu=function(e){if(e[0]==="!")return!0;for(var t=0,n=-2,r=-2,o=-2,c=-2,h=-2;t<e.length;){if(e[t]==="*"||e[t+1]==="?"&&/[\].+)]/.test(e[t])||r!==-1&&e[t]==="["&&e[t+1]!=="]"&&(r<t&&(r=e.indexOf("]",t)),r>t&&(h===-1||h>r||(h=e.indexOf("\\",t),h===-1||h>r)))||o!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(o=e.indexOf("}",t),o>t&&(h=e.indexOf("\\",t),h===-1||h>o))||c!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(c=e.indexOf(")",t),c>t&&(h=e.indexOf("\\",t),h===-1||h>c))||n!==-1&&e[t]==="("&&e[t+1]!=="|"&&(n<t&&(n=e.indexOf("|",t)),n!==-1&&e[n+1]!==")"&&(c=e.indexOf(")",n),c>n&&(h=e.indexOf("\\",n),h===-1||h>c))))return!0;if(e[t]==="\\"){var d=e[t+1];t+=2;var b=Os[d];if(b){var x=e.indexOf(b,t);x!==-1&&(t=x+1)}if(e[t]==="!")return!0}else t++}return!1},qu=function(e){if(e[0]==="!")return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]==="\\"){var n=e[t+1];t+=2;var r=Os[n];if(r){var o=e.indexOf(r,t);o!==-1&&(t=o+1)}if(e[t]==="!")return!0}else t++}return!1},Ku=function(t,n){if(typeof t!="string"||t==="")return!1;if(Wu(t))return!0;var r=zu;return n&&n.strict===!1&&(r=qu),r(t)},Ur={exports:{}};(function(e,t){var n={};t=e.exports=$;var r;typeof zl=="object"&&n&&n.NODE_DEBUG&&/\bsemver\b/i.test(n.NODE_DEBUG)?r=function(){var a=Array.prototype.slice.call(arguments,0);a.unshift("SEMVER"),console.log.apply(console,a)}:r=function(){},t.SEMVER_SPEC_VERSION="2.0.0";var o=256,c=Number.MAX_SAFE_INTEGER||9007199254740991,h=16,d=o-6,b=t.re=[],x=t.safeRe=[],s=t.src=[],l=t.tokens={},O=0;function y(a){l[a]=O++}var S="[a-zA-Z0-9-]",R=[["\\s",1],["\\d",o],[S,d]];function P(a){for(var g=0;g<R.length;g++){var w=R[g][0],C=R[g][1];a=a.split(w+"*").join(w+"{0,"+C+"}").split(w+"+").join(w+"{1,"+C+"}")}return a}y("NUMERICIDENTIFIER"),s[l.NUMERICIDENTIFIER]="0|[1-9]\\d*",y("NUMERICIDENTIFIERLOOSE"),s[l.NUMERICIDENTIFIERLOOSE]="\\d+",y("NONNUMERICIDENTIFIER"),s[l.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+S+"*",y("MAINVERSION"),s[l.MAINVERSION]="("+s[l.NUMERICIDENTIFIER]+")\\.("+s[l.NUMERICIDENTIFIER]+")\\.("+s[l.NUMERICIDENTIFIER]+")",y("MAINVERSIONLOOSE"),s[l.MAINVERSIONLOOSE]="("+s[l.NUMERICIDENTIFIERLOOSE]+")\\.("+s[l.NUMERICIDENTIFIERLOOSE]+")\\.("+s[l.NUMERICIDENTIFIERLOOSE]+")",y("PRERELEASEIDENTIFIER"),s[l.PRERELEASEIDENTIFIER]="(?:"+s[l.NUMERICIDENTIFIER]+"|"+s[l.NONNUMERICIDENTIFIER]+")",y("PRERELEASEIDENTIFIERLOOSE"),s[l.PRERELEASEIDENTIFIERLOOSE]="(?:"+s[l.NUMERICIDENTIFIERLOOSE]+"|"+s[l.NONNUMERICIDENTIFIER]+")",y("PRERELEASE"),s[l.PRERELEASE]="(?:-("+s[l.PRERELEASEIDENTIFIER]+"(?:\\."+s[l.PRERELEASEIDENTIFIER]+")*))",y("PRERELEASELOOSE"),s[l.PRERELEASELOOSE]="(?:-?("+s[l.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+s[l.PRERELEASEIDENTIFIERLOOSE]+")*))",y("BUILDIDENTIFIER"),s[l.BUILDIDENTIFIER]=S+"+",y("BUILD"),s[l.BUILD]="(?:\\+("+s[l.BUILDIDENTIFIER]+"(?:\\."+s[l.BUILDIDENTIFIER]+")*))",y("FULL"),y("FULLPLAIN"),s[l.FULLPLAIN]="v?"+s[l.MAINVERSION]+s[l.PRERELEASE]+"?"+s[l.BUILD]+"?",s[l.FULL]="^"+s[l.FULLPLAIN]+"$",y("LOOSEPLAIN"),s[l.LOOSEPLAIN]="[v=\\s]*"+s[l.MAINVERSIONLOOSE]+s[l.PRERELEASELOOSE]+"?"+s[l.BUILD]+"?",y("LOOSE"),s[l.LOOSE]="^"+s[l.LOOSEPLAIN]+"$",y("GTLT"),s[l.GTLT]="((?:<|>)?=?)",y("XRANGEIDENTIFIERLOOSE"),s[l.XRANGEIDENTIFIERLOOSE]=s[l.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",y("XRANGEIDENTIFIER"),s[l.XRANGEIDENTIFIER]=s[l.NUMERICIDENTIFIER]+"|x|X|\\*",y("XRANGEPLAIN"),s[l.XRANGEPLAIN]="[v=\\s]*("+s[l.XRANGEIDENTIFIER]+")(?:\\.("+s[l.XRANGEIDENTIFIER]+")(?:\\.("+s[l.XRANGEIDENTIFIER]+")(?:"+s[l.PRERELEASE]+")?"+s[l.BUILD]+"?)?)?",y("XRANGEPLAINLOOSE"),s[l.XRANGEPLAINLOOSE]="[v=\\s]*("+s[l.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[l.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[l.XRANGEIDENTIFIERLOOSE]+")(?:"+s[l.PRERELEASELOOSE]+")?"+s[l.BUILD]+"?)?)?",y("XRANGE"),s[l.XRANGE]="^"+s[l.GTLT]+"\\s*"+s[l.XRANGEPLAIN]+"$",y("XRANGELOOSE"),s[l.XRANGELOOSE]="^"+s[l.GTLT]+"\\s*"+s[l.XRANGEPLAINLOOSE]+"$",y("COERCE"),s[l.COERCE]="(^|[^\\d])(\\d{1,"+h+"})(?:\\.(\\d{1,"+h+"}))?(?:\\.(\\d{1,"+h+"}))?(?:$|[^\\d])",y("COERCERTL"),b[l.COERCERTL]=new RegExp(s[l.COERCE],"g"),x[l.COERCERTL]=new RegExp(P(s[l.COERCE]),"g"),y("LONETILDE"),s[l.LONETILDE]="(?:~>?)",y("TILDETRIM"),s[l.TILDETRIM]="(\\s*)"+s[l.LONETILDE]+"\\s+",b[l.TILDETRIM]=new RegExp(s[l.TILDETRIM],"g"),x[l.TILDETRIM]=new RegExp(P(s[l.TILDETRIM]),"g");var A="$1~";y("TILDE"),s[l.TILDE]="^"+s[l.LONETILDE]+s[l.XRANGEPLAIN]+"$",y("TILDELOOSE"),s[l.TILDELOOSE]="^"+s[l.LONETILDE]+s[l.XRANGEPLAINLOOSE]+"$",y("LONECARET"),s[l.LONECARET]="(?:\\^)",y("CARETTRIM"),s[l.CARETTRIM]="(\\s*)"+s[l.LONECARET]+"\\s+",b[l.CARETTRIM]=new RegExp(s[l.CARETTRIM],"g"),x[l.CARETTRIM]=new RegExp(P(s[l.CARETTRIM]),"g");var V="$1^";y("CARET"),s[l.CARET]="^"+s[l.LONECARET]+s[l.XRANGEPLAIN]+"$",y("CARETLOOSE"),s[l.CARETLOOSE]="^"+s[l.LONECARET]+s[l.XRANGEPLAINLOOSE]+"$",y("COMPARATORLOOSE"),s[l.COMPARATORLOOSE]="^"+s[l.GTLT]+"\\s*("+s[l.LOOSEPLAIN]+")$|^$",y("COMPARATOR"),s[l.COMPARATOR]="^"+s[l.GTLT]+"\\s*("+s[l.FULLPLAIN]+")$|^$",y("COMPARATORTRIM"),s[l.COMPARATORTRIM]="(\\s*)"+s[l.GTLT]+"\\s*("+s[l.LOOSEPLAIN]+"|"+s[l.XRANGEPLAIN]+")",b[l.COMPARATORTRIM]=new RegExp(s[l.COMPARATORTRIM],"g"),x[l.COMPARATORTRIM]=new RegExp(P(s[l.COMPARATORTRIM]),"g");var W="$1$2$3";y("HYPHENRANGE"),s[l.HYPHENRANGE]="^\\s*("+s[l.XRANGEPLAIN]+")\\s+-\\s+("+s[l.XRANGEPLAIN]+")\\s*$",y("HYPHENRANGELOOSE"),s[l.HYPHENRANGELOOSE]="^\\s*("+s[l.XRANGEPLAINLOOSE]+")\\s+-\\s+("+s[l.XRANGEPLAINLOOSE]+")\\s*$",y("STAR"),s[l.STAR]="(<|>)?=?\\s*\\*";for(var ee=0;ee<O;ee++)r(ee,s[ee]),b[ee]||(b[ee]=new RegExp(s[ee]),x[ee]=new RegExp(P(s[ee])));t.parse=j;function j(a,g){if((!g||typeof g!="object")&&(g={loose:!!g,includePrerelease:!1}),a instanceof $)return a;if(typeof a!="string"||a.length>o)return null;var w=g.loose?x[l.LOOSE]:x[l.FULL];if(!w.test(a))return null;try{return new $(a,g)}catch{return null}}t.valid=z;function z(a,g){var w=j(a,g);return w?w.version:null}t.clean=Q;function Q(a,g){var w=j(a.trim().replace(/^[=v]+/,""),g);return w?w.version:null}t.SemVer=$;function $(a,g){if((!g||typeof g!="object")&&(g={loose:!!g,includePrerelease:!1}),a instanceof $){if(a.loose===g.loose)return a;a=a.version}else if(typeof a!="string")throw new TypeError("Invalid Version: "+a);if(a.length>o)throw new TypeError("version is longer than "+o+" characters");if(!(this instanceof $))return new $(a,g);r("SemVer",a,g),this.options=g,this.loose=!!g.loose;var w=a.trim().match(g.loose?x[l.LOOSE]:x[l.FULL]);if(!w)throw new TypeError("Invalid Version: "+a);if(this.raw=a,this.major=+w[1],this.minor=+w[2],this.patch=+w[3],this.major>c||this.major<0)throw new TypeError("Invalid major version");if(this.minor>c||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>c||this.patch<0)throw new TypeError("Invalid patch version");w[4]?this.prerelease=w[4].split(".").map(function(C){if(/^[0-9]+$/.test(C)){var L=+C;if(L>=0&&L<c)return L}return C}):this.prerelease=[],this.build=w[5]?w[5].split("."):[],this.format()}$.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},$.prototype.toString=function(){return this.version},$.prototype.compare=function(a){return r("SemVer.compare",this.version,this.options,a),a instanceof $||(a=new $(a,this.options)),this.compareMain(a)||this.comparePre(a)},$.prototype.compareMain=function(a){return a instanceof $||(a=new $(a,this.options)),Ie(this.major,a.major)||Ie(this.minor,a.minor)||Ie(this.patch,a.patch)},$.prototype.comparePre=function(a){if(a instanceof $||(a=new $(a,this.options)),this.prerelease.length&&!a.prerelease.length)return-1;if(!this.prerelease.length&&a.prerelease.length)return 1;if(!this.prerelease.length&&!a.prerelease.length)return 0;var g=0;do{var w=this.prerelease[g],C=a.prerelease[g];if(r("prerelease compare",g,w,C),w===void 0&&C===void 0)return 0;if(C===void 0)return 1;if(w===void 0)return-1;if(w===C)continue;return Ie(w,C)}while(++g)},$.prototype.compareBuild=function(a){a instanceof $||(a=new $(a,this.options));var g=0;do{var w=this.build[g],C=a.build[g];if(r("prerelease compare",g,w,C),w===void 0&&C===void 0)return 0;if(C===void 0)return 1;if(w===void 0)return-1;if(w===C)continue;return Ie(w,C)}while(++g)},$.prototype.inc=function(a,g){switch(a){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",g);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",g);break;case"prepatch":this.prerelease.length=0,this.inc("patch",g),this.inc("pre",g);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",g),this.inc("pre",g);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var w=this.prerelease.length;--w>=0;)typeof this.prerelease[w]=="number"&&(this.prerelease[w]++,w=-2);w===-1&&this.prerelease.push(0)}g&&(this.prerelease[0]===g?isNaN(this.prerelease[1])&&(this.prerelease=[g,0]):this.prerelease=[g,0]);break;default:throw new Error("invalid increment argument: "+a)}return this.format(),this.raw=this.version,this},t.inc=ue;function ue(a,g,w,C){typeof w=="string"&&(C=w,w=void 0);try{return new $(a,w).inc(g,C).version}catch{return null}}t.diff=ve;function ve(a,g){if(Ct(a,g))return null;var w=j(a),C=j(g),L="";if(w.prerelease.length||C.prerelease.length){L="pre";var U="prerelease"}for(var K in w)if((K==="major"||K==="minor"||K==="patch")&&w[K]!==C[K])return L+K;return U}t.compareIdentifiers=Ie;var ce=/^[0-9]+$/;function Ie(a,g){var w=ce.test(a),C=ce.test(g);return w&&C&&(a=+a,g=+g),a===g?0:w&&!C?-1:C&&!w?1:a<g?-1:1}t.rcompareIdentifiers=$e;function $e(a,g){return Ie(g,a)}t.major=Xe;function Xe(a,g){return new $(a,g).major}t.minor=nt;function nt(a,g){return new $(a,g).minor}t.patch=Y;function Y(a,g){return new $(a,g).patch}t.compare=fe;function fe(a,g,w){return new $(a,w).compare(new $(g,w))}t.compareLoose=q;function q(a,g){return fe(a,g,!0)}t.compareBuild=Oe;function Oe(a,g,w){var C=new $(a,w),L=new $(g,w);return C.compare(L)||C.compareBuild(L)}t.rcompare=ie;function ie(a,g,w){return fe(g,a,w)}t.sort=lt;function lt(a,g){return a.sort(function(w,C){return t.compareBuild(w,C,g)})}t.rsort=Te;function Te(a,g){return a.sort(function(w,C){return t.compareBuild(C,w,g)})}t.gt=Ye;function Ye(a,g,w){return fe(a,g,w)>0}t.lt=Ue;function Ue(a,g,w){return fe(a,g,w)<0}t.eq=Ct;function Ct(a,g,w){return fe(a,g,w)===0}t.neq=Gt;function Gt(a,g,w){return fe(a,g,w)!==0}t.gte=$t;function $t(a,g,w){return fe(a,g,w)>=0}t.lte=Ht;function Ht(a,g,w){return fe(a,g,w)<=0}t.cmp=We;function We(a,g,w,C){switch(g){case"===":return typeof a=="object"&&(a=a.version),typeof w=="object"&&(w=w.version),a===w;case"!==":return typeof a=="object"&&(a=a.version),typeof w=="object"&&(w=w.version),a!==w;case"":case"=":case"==":return Ct(a,w,C);case"!=":return Gt(a,w,C);case">":return Ye(a,w,C);case">=":return $t(a,w,C);case"<":return Ue(a,w,C);case"<=":return Ht(a,w,C);default:throw new TypeError("Invalid operator: "+g)}}t.Comparator=ye;function ye(a,g){if((!g||typeof g!="object")&&(g={loose:!!g,includePrerelease:!1}),a instanceof ye){if(a.loose===!!g.loose)return a;a=a.value}if(!(this instanceof ye))return new ye(a,g);a=a.trim().split(/\s+/).join(" "),r("comparator",a,g),this.options=g,this.loose=!!g.loose,this.parse(a),this.semver===ft?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var ft={};ye.prototype.parse=function(a){var g=this.options.loose?x[l.COMPARATORLOOSE]:x[l.COMPARATOR],w=a.match(g);if(!w)throw new TypeError("Invalid comparator: "+a);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new $(w[2],this.options.loose):this.semver=ft},ye.prototype.toString=function(){return this.value},ye.prototype.test=function(a){if(r("Comparator.test",a,this.options.loose),this.semver===ft||a===ft)return!0;if(typeof a=="string")try{a=new $(a,this.options)}catch{return!1}return We(a,this.operator,this.semver,this.options)},ye.prototype.intersects=function(a,g){if(!(a instanceof ye))throw new TypeError("a Comparator is required");(!g||typeof g!="object")&&(g={loose:!!g,includePrerelease:!1});var w;if(this.operator==="")return this.value===""?!0:(w=new be(a.value,g),Re(this.value,w,g));if(a.operator==="")return a.value===""?!0:(w=new be(this.value,g),Re(a.semver,w,g));var C=(this.operator===">="||this.operator===">")&&(a.operator===">="||a.operator===">"),L=(this.operator==="<="||this.operator==="<")&&(a.operator==="<="||a.operator==="<"),U=this.semver.version===a.semver.version,K=(this.operator===">="||this.operator==="<=")&&(a.operator===">="||a.operator==="<="),de=We(this.semver,"<",a.semver,g)&&(this.operator===">="||this.operator===">")&&(a.operator==="<="||a.operator==="<"),se=We(this.semver,">",a.semver,g)&&(this.operator==="<="||this.operator==="<")&&(a.operator===">="||a.operator===">");return C||L||U&&K||de||se},t.Range=be;function be(a,g){if((!g||typeof g!="object")&&(g={loose:!!g,includePrerelease:!1}),a instanceof be)return a.loose===!!g.loose&&a.includePrerelease===!!g.includePrerelease?a:new be(a.raw,g);if(a instanceof ye)return new be(a.value,g);if(!(this instanceof be))return new be(a,g);if(this.options=g,this.loose=!!g.loose,this.includePrerelease=!!g.includePrerelease,this.raw=a.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(w){return this.parseRange(w.trim())},this).filter(function(w){return w.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}be.prototype.format=function(){return this.range=this.set.map(function(a){return a.join(" ").trim()}).join("||").trim(),this.range},be.prototype.toString=function(){return this.range},be.prototype.parseRange=function(a){var g=this.options.loose,w=g?x[l.HYPHENRANGELOOSE]:x[l.HYPHENRANGE];a=a.replace(w,mt),r("hyphen replace",a),a=a.replace(x[l.COMPARATORTRIM],W),r("comparator trim",a,x[l.COMPARATORTRIM]),a=a.replace(x[l.TILDETRIM],A),a=a.replace(x[l.CARETTRIM],V),a=a.split(/\s+/).join(" ");var C=g?x[l.COMPARATORLOOSE]:x[l.COMPARATOR],L=a.split(" ").map(function(U){return Je(U,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(L=L.filter(function(U){return!!U.match(C)})),L=L.map(function(U){return new ye(U,this.options)},this),L},be.prototype.intersects=function(a,g){if(!(a instanceof be))throw new TypeError("a Range is required");return this.set.some(function(w){return It(w,g)&&a.set.some(function(C){return It(C,g)&&w.every(function(L){return C.every(function(U){return L.intersects(U,g)})})})})};function It(a,g){for(var w=!0,C=a.slice(),L=C.pop();w&&C.length;)w=C.every(function(U){return L.intersects(U,g)}),L=C.pop();return w}t.toComparators=Xt;function Xt(a,g){return new be(a,g).set.map(function(w){return w.map(function(C){return C.value}).join(" ").trim().split(" ")})}function Je(a,g){return r("comp",a,g),a=hn(a,g),r("caret",a),a=un(a,g),r("tildes",a),a=bt(a,g),r("xrange",a),a=xt(a,g),r("stars",a),a}function ke(a){return!a||a.toLowerCase()==="x"||a==="*"}function un(a,g){return a.trim().split(/\s+/).map(function(w){return dn(w,g)}).join(" ")}function dn(a,g){var w=g.loose?x[l.TILDELOOSE]:x[l.TILDE];return a.replace(w,function(C,L,U,K,de){r("tilde",a,C,L,U,K,de);var se;return ke(L)?se="":ke(U)?se=">="+L+".0.0 <"+(+L+1)+".0.0":ke(K)?se=">="+L+"."+U+".0 <"+L+"."+(+U+1)+".0":de?(r("replaceTilde pr",de),se=">="+L+"."+U+"."+K+"-"+de+" <"+L+"."+(+U+1)+".0"):se=">="+L+"."+U+"."+K+" <"+L+"."+(+U+1)+".0",r("tilde return",se),se})}function hn(a,g){return a.trim().split(/\s+/).map(function(w){return Qe(w,g)}).join(" ")}function Qe(a,g){r("caret",a,g);var w=g.loose?x[l.CARETLOOSE]:x[l.CARET];return a.replace(w,function(C,L,U,K,de){r("caret",a,C,L,U,K,de);var se;return ke(L)?se="":ke(U)?se=">="+L+".0.0 <"+(+L+1)+".0.0":ke(K)?L==="0"?se=">="+L+"."+U+".0 <"+L+"."+(+U+1)+".0":se=">="+L+"."+U+".0 <"+(+L+1)+".0.0":de?(r("replaceCaret pr",de),L==="0"?U==="0"?se=">="+L+"."+U+"."+K+"-"+de+" <"+L+"."+U+"."+(+K+1):se=">="+L+"."+U+"."+K+"-"+de+" <"+L+"."+(+U+1)+".0":se=">="+L+"."+U+"."+K+"-"+de+" <"+(+L+1)+".0.0"):(r("no pr"),L==="0"?U==="0"?se=">="+L+"."+U+"."+K+" <"+L+"."+U+"."+(+K+1):se=">="+L+"."+U+"."+K+" <"+L+"."+(+U+1)+".0":se=">="+L+"."+U+"."+K+" <"+(+L+1)+".0.0"),r("caret return",se),se})}function bt(a,g){return r("replaceXRanges",a,g),a.split(/\s+/).map(function(w){return pn(w,g)}).join(" ")}function pn(a,g){a=a.trim();var w=g.loose?x[l.XRANGELOOSE]:x[l.XRANGE];return a.replace(w,function(C,L,U,K,de,se){r("xRange",a,C,L,U,K,de,se);var Ge=ke(U),Me=Ge||ke(K),we=Me||ke(de),Pe=we;return L==="="&&Pe&&(L=""),se=g.includePrerelease?"-0":"",Ge?L===">"||L==="<"?C="<0.0.0-0":C="*":L&&Pe?(Me&&(K=0),de=0,L===">"?(L=">=",Me?(U=+U+1,K=0,de=0):(K=+K+1,de=0)):L==="<="&&(L="<",Me?U=+U+1:K=+K+1),C=L+U+"."+K+"."+de+se):Me?C=">="+U+".0.0"+se+" <"+(+U+1)+".0.0"+se:we&&(C=">="+U+"."+K+".0"+se+" <"+U+"."+(+K+1)+".0"+se),r("xRange return",C),C})}function xt(a,g){return r("replaceStars",a,g),a.trim().replace(x[l.STAR],"")}function mt(a,g,w,C,L,U,K,de,se,Ge,Me,we,Pe){return ke(w)?g="":ke(C)?g=">="+w+".0.0":ke(L)?g=">="+w+"."+C+".0":g=">="+g,ke(se)?de="":ke(Ge)?de="<"+(+se+1)+".0.0":ke(Me)?de="<"+se+"."+(+Ge+1)+".0":we?de="<="+se+"."+Ge+"."+Me+"-"+we:de="<="+de,(g+" "+de).trim()}be.prototype.test=function(a){if(!a)return!1;if(typeof a=="string")try{a=new $(a,this.options)}catch{return!1}for(var g=0;g<this.set.length;g++)if(ct(this.set[g],a,this.options))return!0;return!1};function ct(a,g,w){for(var C=0;C<a.length;C++)if(!a[C].test(g))return!1;if(g.prerelease.length&&!w.includePrerelease){for(C=0;C<a.length;C++)if(r(a[C].semver),a[C].semver!==ft&&a[C].semver.prerelease.length>0){var L=a[C].semver;if(L.major===g.major&&L.minor===g.minor&&L.patch===g.patch)return!0}return!1}return!0}t.satisfies=Re;function Re(a,g,w){try{g=new be(g,w)}catch{return!1}return g.test(a)}t.maxSatisfying=wt;function wt(a,g,w){var C=null,L=null;try{var U=new be(g,w)}catch{return null}return a.forEach(function(K){U.test(K)&&(!C||L.compare(K)===-1)&&(C=K,L=new $(C,w))}),C}t.minSatisfying=Ut;function Ut(a,g,w){var C=null,L=null;try{var U=new be(g,w)}catch{return null}return a.forEach(function(K){U.test(K)&&(!C||L.compare(K)===1)&&(C=K,L=new $(C,w))}),C}t.minVersion=Yt;function Yt(a,g){a=new be(a,g);var w=new $("0.0.0");if(a.test(w)||(w=new $("0.0.0-0"),a.test(w)))return w;w=null;for(var C=0;C<a.set.length;++C){var L=a.set[C];L.forEach(function(U){var K=new $(U.semver.version);switch(U.operator){case">":K.prerelease.length===0?K.patch++:K.prerelease.push(0),K.raw=K.format();case"":case">=":(!w||Ye(w,K))&&(w=K);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+U.operator)}})}return w&&a.test(w)?w:null}t.validRange=Jt;function Jt(a,g){try{return new be(a,g).range||"*"}catch{return null}}t.ltr=_t;function _t(a,g,w){return I(a,g,"<",w)}t.gtr=fn;function fn(a,g,w){return I(a,g,">",w)}t.outside=I;function I(a,g,w,C){a=new $(a,C),g=new be(g,C);var L,U,K,de,se;switch(w){case">":L=Ye,U=Ht,K=Ue,de=">",se=">=";break;case"<":L=Ue,U=$t,K=Ye,de="<",se="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Re(a,g,C))return!1;for(var Ge=0;Ge<g.set.length;++Ge){var Me=g.set[Ge],we=null,Pe=null;if(Me.forEach(function(ze){ze.semver===ft&&(ze=new ye(">=0.0.0")),we=we||ze,Pe=Pe||ze,L(ze.semver,we.semver,C)?we=ze:K(ze.semver,Pe.semver,C)&&(Pe=ze)}),we.operator===de||we.operator===se||(!Pe.operator||Pe.operator===de)&&U(a,Pe.semver))return!1;if(Pe.operator===se&&K(a,Pe.semver))return!1}return!0}t.prerelease=Et;function Et(a,g){var w=j(a,g);return w&&w.prerelease.length?w.prerelease:null}t.intersects=J;function J(a,g,w){return a=new be(a,w),g=new be(g,w),a.intersects(g)}t.coerce=oe;function oe(a,g){if(a instanceof $)return a;if(typeof a=="number"&&(a=String(a)),typeof a!="string")return null;g=g||{};var w=null;if(!g.rtl)w=a.match(x[l.COERCE]);else{for(var C;(C=x[l.COERCERTL].exec(a))&&(!w||w.index+w[0].length!==a.length);)(!w||C.index+C[0].length!==w.index+w[0].length)&&(w=C),x[l.COERCERTL].lastIndex=C.index+C[1].length+C[2].length;x[l.COERCERTL].lastIndex=-1}return w===null?null:j(w[2]+"."+(w[3]||"0")+"."+(w[4]||"0"),g)}})(Ur,Ur.exports);var Vu=Ur.exports;const Rs=Yo,kt=Vu,Fe="semver",Gu={base:Rs.string(),type:"semverRange",validate:function(e,{error:t}){return kt.validRange(e)?{value:e}:{errors:t(`${Fe}.valid`)}},messages:{[`${Fe}.valid`]:"{{#label}} needs to be a valid semver range"}},cn={};cn.compare={method:!1,validate:function(e,t,{exp:n},{name:r}){return kt[r](e,n)?e:t.error(`${Fe}.${r}`,{exp:n})},args:[{name:"exp",assert:kt.valid,message:"needs to be a valid semver expression"}]};["gt","gte","lt","lte","eq","neq"].forEach(function(e){cn[e]={method:function(t){return this.$_addRule({name:e,method:"compare",args:{exp:t}})}}});cn.cmp={method:function(e,t){return this.$_addRule({name:"cmp",args:{cmp:e,exp:t}})},validate:function(e,t,{cmp:n,exp:r}){return kt.cmp(e,n,r)?e:t.error(`${Fe}.cmp`,{cmp:n,exp:r})},args:[{name:"cmp",assert:e=>["===","!==","","=","==","!=",">",">=","<","<="].includes(e),message:"needs to be a valid comparator"},{name:"exp",assert:kt.valid,message:"needs to be a valid semver expression"}]};cn.compareRange={method:!1,validate:function(e,t,{rng:n},{name:r}){return kt[r](e,n)?e:t.error(`${Fe}.${r}`,{rng:n})},args:[{name:"rng",assert:kt.validRange,message:"needs to be a valid semver range"}]};["satisfies","gtr","ltr"].forEach(function(e){cn[e]={method:function(t){return this.$_addRule({name:e,method:"compareRange",args:{rng:t}})}}});cn.outside={method:function(e,t){return this.$_addRule({name:"outside",args:{hilo:e,rng:t}})},validate:function(e,t,{hilo:n,rng:r}){return kt.outside(e,r,n)?e:t.error(`${Fe}.outside`,{hilo:n,rng:r})},args:[{name:"hilo",assert:e=>[">","<"].includes(e),message:"needs to be a valid comparator"},{name:"rng",assert:kt.validRange,message:"needs to be a valid semver range"}]};const Hu={base:Rs.string(),type:"semver",validate:function(e,{error:t}){return kt.valid(e)?{value:e}:{errors:t(`${Fe}.valid`)}},messages:{[`${Fe}.valid`]:"{{#label}} needs to be a valid semver expression",[`${Fe}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${Fe}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${Fe}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${Fe}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${Fe}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${Fe}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${Fe}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${Fe}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${Fe}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${Fe}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${Fe}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:cn};var Xu={semver:Hu,semverRange:Gu};/*!
|
|
200
|
-
* is-var-name | ISC (c) Shinnosuke Watanabe
|
|
201
|
-
* https://github.com/shinnn/is-var-name
|
|
202
|
-
*/function Yu(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const Ju=Object.freeze(Object.defineProperty({__proto__:null,default:Yu},Symbol.toStringTag,{value:"Module"})),Qu=Yr(Ju),Zu=Yr(Ya),ed=Za,td=el,yo=ur,nd=e=>{if((0,yo.isValid)(e))return e;const t=(0,td.toHex)(ql.from(typeof e=="string"?e.trim():e));return(0,yo.fromPublicKey)(t,{role:ed.types.RoleType.ROLE_ANY})};var rd=nd,an={},ks=je&&je.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(an,"__esModule",{value:!0});an.didExtension=an.fileExtension=void 0;const bo=ks(Ts),id=ks(Xl),od=ur,Cs=e=>({type:"file",base:e.string(),validate(t,{error:n}){return t&&typeof t=="string"?{value:t}:{errors:n("file.empty",{file:t})}},messages:{"file.empty":'file "{{#file}}" must be non-empty string',"file.enoent":'file "{{#file}}" does not exist',"file.error.generic":'file could not be read. message: "{{#message}}"'},rules:{exists:{multi:!1,method({baseDir:t=null,canSkip:n=()=>!1}={}){return this.$_addRule({name:"exists",args:{baseDir:t,canSkip:n}})},args:[{name:"baseDir",assert:t=>bo.default.existsSync(t),message:"baseDir must exist"},{name:"canSkip",assert:t=>typeof t=="function",message:"canSkip must be a function"}],validate(t,{error:n},{baseDir:r,canSkip:o}={}){if(typeof o=="function"&&o(r,t))return t;try{return bo.default.statSync(id.default.join(r,t)),t}catch(c){switch(c.code){case"ENOENT":return n("file.enoent",{file:t})}return n("file.error.generic",{message:c.message})}}}}});an.fileExtension=Cs;const Is=e=>({type:"DID",base:e.string(),validate(t,{error:n}){return!t||typeof t!="string"?{errors:n("did.empty",{did:t})}:(0,od.isValid)(t)===!1?{errors:n("did.invalid",{did:t})}:{value:t}},messages:{"did.empty":'did "{{#did}}" must be non-empty string',"did.invalid":'did "{{#did}}" is not valid'}});an.didExtension=Is;an.default={fileExtension:Cs,didExtension:Is};var di={},_s={exports:{}};const sd=["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","tty","url","util","v8","vm","zlib"];var Ps=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),ad=sd,ld=["node_modules","favicon.ico"],cd=_s.exports=function(e){var t=[],n=[];if(e===null)return n.push("name cannot be null"),Mn(t,n);if(e===void 0)return n.push("name cannot be undefined"),Mn(t,n);if(typeof e!="string")return n.push("name must be a string"),Mn(t,n);if(e.length||n.push("name length must be greater than zero"),e.match(/^\./)&&n.push("name cannot start with a period"),e.match(/^_/)&&n.push("name cannot start with an underscore"),e.trim()!==e&&n.push("name cannot contain leading or trailing spaces"),ld.forEach(function(h){e.toLowerCase()===h&&n.push(h+" is a blacklisted name")}),ad.forEach(function(h){e.toLowerCase()===h&&t.push(h+" is a core module name")}),e.length>214&&t.push("name can no longer contain more than 214 characters"),e.toLowerCase()!==e&&t.push("name can no longer contain capital letters"),/[~'!()*]/.test(e.split("/").slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var r=e.match(Ps);if(r){var o=r[1],c=r[2];if(encodeURIComponent(o)===o&&encodeURIComponent(c)===c)return Mn(t,n)}n.push("name can only contain URL-friendly characters")}return Mn(t,n)};cd.scopedPackagePattern=Ps;var Mn=function(e,t){var n={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};return n.warnings.length||delete n.warnings,n.errors.length||delete n.errors,n},ud=_s.exports;(function(e){var t=je&&je.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const n=ur,r=t(ud),o=32,c=d=>{if((0,n.toTypeInfo)(d).role!==n.types.RoleType.ROLE_BLOCKLET)throw new Error("Blocklet DID's type must be ROLE_BLOCKLET")};e.validateNewDid=c;const h=(d,{checkDid:b=!0}={})=>{if((0,n.isValid)(d))b&&(0,e.validateNewDid)(d);else{const{validForNewPackages:x,errors:s=[],warnings:l=[]}=(0,r.default)(d);if(!x)throw new Error(s[0]||l[0]);if(d.length>o)throw new Error("Blocklet name is too long")}};e.validateName=h,e.default={validateName:e.validateName,validateNewDid:e.validateNewDid}})(di);var dd=je&&je.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),hd=je&&je.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),pd=je&&je.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[r.length]=o);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),o=0;o<r.length;o++)r[o]!=="default"&&dd(n,t,r[o]);return hd(n,t),n}}(),kn=je&&je.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Z,"__esModule",{value:!0});Z.Joi=Z.installBlockletDescriptionSchema=Z.installBlockletTitleSchema=Z.resourceBundleSchema=Z.authConfigSchema=Z.cacheableSchema=Z.statsSchema=Z.titleSchema=Z.themeSchema=Z.signatureSchema=Z.serviceSchema=Z.scriptsSchema=Z.personSchema=Z.navigationSchema=Z.navigationItemSchema=Z.updateMountPointSchema=Z.mountPointSchema=Z.logoSchema=Z.interfaceSchema=Z.environmentNameSchema=Z.environmentSchema=Z.engineSchema=Z.endpointSchema=Z.distSchema=Z.descriptionSchema=Z.createBlockletSchema=Z.componentSchema=Z.blockletNameSchema=Z.blockletMetaSchema=void 0;const fd=kn(Ts),md=kn(Yo),gd=kn($u),vd=kn(Ku),xo=Xu,yd=kn(Qu),wo=Zo,bd=ur,xd=Zu,Ne=Rt,wd=kn(rd),Eo=an,Wr=di,hi=pd(bl),Ed=gd.default.default,So="/.well-known",u=md.default.extend(xo.semver).extend(xo.semverRange).extend(Eo.fileExtension).extend(Eo.didExtension);Z.Joi=u;const To=(e,t)=>(0,hi.checkLink)(e)?e:t.message(`Invalid navigation link: ${e}
|
|
203
|
-
|
|
204
|
-
A valid navigation link should be a relative url which start with '/' or a absolute url, such as:
|
|
205
|
-
- /en/home
|
|
206
|
-
- /zh/home
|
|
207
|
-
- https://www.arcblock.io
|
|
208
|
-
`),Sd=(e,t)=>!e||(0,yd.default)(e)?e:t.message(`Invalid navigation id: ${e}
|
|
209
|
-
|
|
210
|
-
A valid navigation id is should follow the rules of javascript variables, such as:
|
|
211
|
-
- foo
|
|
212
|
-
- fooBar
|
|
213
|
-
- foo123
|
|
214
|
-
|
|
215
|
-
see detail in https://www.npmjs.com/package/is-var-name
|
|
216
|
-
`),gr=u.string().trim().min(1).custom(e=>{if(Ed(e)>Ne.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${Ne.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);if(e.includes("."))throw new Error('title cannot contain "."');return e}).meta({className:"TTitle"});Z.titleSchema=gr;const vr=u.string().trim().min(3).max(160).meta({className:"TDescription"});Z.descriptionSchema=vr;const Ls=u.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});Z.installBlockletTitleSchema=Ls;const Ns=u.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});Z.installBlockletDescriptionSchema=Ns;const As=u.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((e,t)=>e.includes(wo.WELLKNOWN_BLOCKLET_LOGO_PATH)?t.message(`logo url should not include ${wo.WELLKNOWN_BLOCKLET_LOGO_PATH}`):e).meta({className:"TLogo"});Z.logoSchema=As;const Ds=u.string().trim().min(1),pi=Ds.meta({className:"TMountPoint"}).custom((e,t)=>(0,hi.isValidUrlPath)(e)?e:t.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));Z.mountPointSchema=pi;const Ms=Ds.meta({className:"TUpdateMountPoint"}).custom(e=>(0,hi.default)(e));Z.updateMountPointSchema=Ms;const Rn=u.string().custom(e=>((0,Wr.validateName)(e),e)).meta({className:"TBlockletName"});Z.blockletNameSchema=Rn;const Td=[],fi=u.string().trim().min(1).max(50).required().custom((e,t)=>e.startsWith("BLOCKLET")&&!Td.includes(e)?t.message("Env name can not start with BLOCKLET_"):e.startsWith("COMPONENT")?t.message("Env name can not start with COMPONENT_"):e.startsWith("ABTNODE")?t.message("Env name can not start with ABTNODE_"):/[^\w]/.test(e)?t.message('Env name can include only numbers or letters or "_"'):e).meta({className:"TEnvironmentName",unknownType:"any"});Z.environmentNameSchema=fi;const mi=u.object({name:fi.required(),description:u.string().trim().required(),default:u.string().optional().allow("").default(""),required:u.boolean().default(!1),secure:u.boolean().default(!1),validation:u.string().optional(),shared:u.boolean().default(e=>e.secure?!1:void 0)}).custom((e,t)=>e.secure&&e.default?t.message(`Cannot declare default value for secure env ${e.name}`):e).meta({className:"TEnvironment",unknownType:"any"});Z.environmentSchema=mi;const gi=u.object({dev:u.string().trim().min(1),e2eDev:u.string().trim().min(1),preFlight:u.string().trim().min(1),preInstall:u.string().trim().min(1),postInstall:u.string().trim().min(1),preStart:u.string().trim().min(1),postStart:u.string().trim().min(1),preStop:u.string().trim().min(1),preUninstall:u.string().trim().min(1),preConfig:u.string().trim().min(1)}).rename("pre-flight","preFlight").rename("pre-install","preInstall").rename("post-install","postInstall").rename("pre-start","preStart").rename("post-start","postStart").rename("pre-stop","preStop").rename("pre-uninstall","preUninstall").rename("pre-config","preConfig").optional().meta({className:"TScripts",unknownType:"any"});Z.scriptsSchema=gi;const vi=u.object({name:u.string().required().trim(),config:u.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});Z.serviceSchema=vi;const yi=u.object({type:u.string().trim(!0).min(1).required(),path:u.string().required(),meta:u.object({vcType:u.string(),payable:u.boolean(),params:u.array().items({name:u.string().required().trim(),description:u.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});Z.endpointSchema=yi;const Fs=u.string().trim().custom((e,t)=>{const n=e.split("/").filter(Boolean);return n.length===0?t.message("cacheable path must be a valid pathname that is not /"):`/${n.join("/")}`}).meta({className:"TPathPrefix",unknownType:"any"});Z.cacheableSchema=Fs;const bi=u.object({type:u.string().lowercase().valid(...Ne.BLOCKLET_INTERFACE_TYPES).required(),name:u.string().trim().required(),path:u.string().trim().default("/"),prefix:u.string().trim().min(1).default(Ne.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:u.number().port().optional(),hostIP:u.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:u.string().lowercase().valid(...Ne.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:u.alternatives().try(u.string().uppercase().default(Ne.BLOCKLET_DEFAULT_PORT_NAME),u.object({internal:u.string().uppercase().required(),external:u.number().port().required()})).default(Ne.BLOCKLET_DEFAULT_PORT_NAME),cacheable:u.array().items(Fs).unique(),services:u.array().items(vi).unique("name"),endpoints:u.array().items(yi).unique("type"),pageGroups:u.array().items(u.string().min(1).max(255).trim()).unique()}).meta({className:"TInterface",unknownType:"any"});Z.interfaceSchema=bi;const jd=u.alternatives().try(u.string().required(),u.object({url:u.string().uri({scheme:["http","https","file"]}).required(),name:Rn.required(),version:u.alternatives().try(u.string().valid("latest"),u.semverRange().valid())}),u.object({store:u.string().uri({scheme:["http","https"]}).required(),name:Rn.required(),version:u.alternatives().try(u.string().valid("latest"),u.semverRange().valid()).default("latest")})),zr=u.object({platform:u.string().valid(...Ne.BLOCKLET_PLATFORMS).optional(),interpreter:u.string().valid("binary","node","blocklet").default("node"),source:jd,args:u.array().items(u.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});Z.engineSchema=zr;const Un=u.object({name:u.string().min(1).required(),email:u.string().email({tlds:!1}).optional(),url:u.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});Z.personSchema=Un;const zn=u.object({tarball:u.alternatives().try(u.string().uri(),u.string()).required(),integrity:u.string().required(),size:u.number().optional()}).meta({className:"TDist",unknownType:"any"});Z.distSchema=zn;const Bs=u.object({downloads:u.number().integer().greater(-1),star:u.number().default(0),purchases:u.number().default(0)}).meta({className:"TStats",unknownType:"any"});Z.statsSchema=Bs;const Od=u.alternatives().try(u.object({url:u.alternatives().try(u.string().uri(),u.array().items(u.string().uri()).min(1)).required(),version:u.alternatives().try(u.string().valid("latest"),u.semverRange().valid())}),u.object({store:u.string().uri({scheme:["http","https"]}),name:Rn.required(),version:u.alternatives().try(u.string().valid("latest"),u.semverRange().valid()).default("latest")})),$s={source:Od.required(),required:u.boolean(),title:gr,description:vr,mountPoint:pi,name:Rn},Us=(e,t)=>u.object(e).custom((n,r)=>!t&&n.source&&n.source.name&&!n.source.store?r.message(`missing 'store' in source of component ${n.name}`):n),xi=Us($s).meta({className:"TComponent",unknownType:"any"});Z.componentSchema=xi;const Rd=Us($s,!0),Ws=({checkStore:e}={})=>{const t=[xi,Rd];return u.array().items(e?t[0]:t[1]).optional().default([])},zs=u.object({type:u.string().required(),name:u.string().required(),signer:u.string().required(),pk:u.string().required(),created:u.string().isoDate().required(),sig:u.string().required(),excludes:u.array().items(u.string()).optional(),appended:u.array().items(u.string()).optional(),delegatee:u.string(),delegateePk:u.string(),delegation:u.string()}).meta({className:"TSignature",unknownType:"any"});Z.signatureSchema=zs;const jo=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],Oo={id:u.string().custom(Sd),title:u.alternatives().try(u.string().min(1).max(Ne.MAX_TITLE_LENGTH),u.object().min(1).pattern(u.string().valid(...jo),u.string().min(1).max(Ne.MAX_TITLE_LENGTH))).required(),link:u.alternatives().try(u.string().custom(To),u.object().min(1).pattern(u.string().valid(...jo),u.string().custom(To))),component:u.string().min(1),section:u.array().items(u.string().min(1)).single(),role:u.array().items(u.string().min(1)).single(),icon:u.string().min(1),visible:u.boolean()},qs=u.object({...Oo,items:u.array().items(u.object({...Oo}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});Z.navigationItemSchema=qs;const wi=u.array().items(qs).unique((e,t)=>e.id&&t.id?e.id===t.id:!1).meta({className:"TNavigation",unknownType:"any"});Z.navigationSchema=wi;const Ei=u.object({background:u.alternatives().try(u.string().min(1),u.object({header:u.string().min(1),footer:u.string().min(1),default:u.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});Z.themeSchema=Ei;const Ks=u.object({whoCanAccess:u.string().valid("owner","invited","all"),profileFields:u.array().items(u.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:u.array().items(u.string().min(1)),allowSwitchProfile:u.boolean(),blockUnauthenticated:u.boolean(),blockUnauthorized:u.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});Z.authConfigSchema=Ks;const kd=u.object({type:u.string().trim().min(1).required(),description:u.string().trim().min(1)}),Si=u.object({did:u.DID().trim().required(),type:u.string().trim().min(1).required(),public:u.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});Z.resourceBundleSchema=Si;const Vs={did:u.DID().trim().required(),version:u.semver().valid().required(),name:u.string().optional(),description:vr.required(),group:u.string().valid(...Ne.BLOCKLET_GROUPS),main:u.string().trim(),title:gr.optional().allow(""),logo:u.string().trim().optional(),specVersion:u.semver().valid().gte("1.0.0").optional(),author:Un.optional(),contributors:u.array().items(Un).optional(),maintainers:u.array().items(Un).optional(),community:u.string().uri().optional().allow("").default(""),documentation:u.string().uri().optional().allow("").default(""),homepage:u.string().uri().optional().allow("").default(""),license:u.string().optional().allow("").default(""),support:u.alternatives().try(u.string().uri(),u.string().email({tlds:!1})).optional(),nftFactory:u.DID().optional().allow("").default(""),payment:u.object({price:u.array().max(1).items(u.object({value:u.number().greater(0).required(),address:u.DID().required()})).default([]),share:u.array().max(4).items(u.object({name:u.string().required(),address:u.DID().required(),value:u.number().greater(0).max(1).required()})).default([]).custom(e=>{if(e.length===0)return e;const t=e.reduce((n,r)=>n+r.value,0);if(t!==1)throw new Error(`Invalid blocklet payment share config: total share must be 1, got ${t}`);return e},"invalid blocklet share"),componentPrice:u.array().items(u.object({parentPriceRange:u.array().items(u.number()).custom((e,t)=>e.length!==2?t.message("length of range should be 2"):e[0]<0?t.message("the first value should not less than 0 in range"):e[1]<=e[0]?t.message("the second value should greater than the first value in range"):e),type:u.string().valid("fixed","percentage").required(),value:u.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:u.alternatives().try(u.string().trim().min(1),u.array().items(u.string().min(1))).optional(),tags:u.alternatives().try(u.string().trim().min(1),u.array().items(u.string().min(1))).optional(),gitHash:u.string().optional().allow(""),repository:u.alternatives().try(u.string().min(1),u.object({type:u.string().valid("git","https","svn").required(),url:u.string().uri().required(),directory:u.string()})).optional(),timeout:u.object({start:u.number().min(10).max(600),script:u.number().min(1).max(1800)}).default({start:60}),requirements:u.object({abtnode:u.semverRange().valid(),server:u.semverRange().valid(),os:u.alternatives().try(u.string().valid("*",...Ne.BLOCKLET_PLATFORMS),u.array().items(u.string().valid(...Ne.BLOCKLET_PLATFORMS)).min(1)),cpu:u.alternatives().try(u.string().valid("*",...Ne.BLOCKLET_ARCHITECTURES),u.array().items(u.string().valid(...Ne.BLOCKLET_ARCHITECTURES)).min(1)),fuels:u.array().items(u.object({endpoint:u.string().trim().required(),address:u.string().trim(),value:u.string().trim().required(),reason:u.string().trim().required()})),nodejs:u.semverRange().valid()}).default({server:Ne.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:u.array().items(bi).unique("name").custom((e,t)=>{if(e.filter(o=>o.type===Ne.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return t.message(`Only one ${Ne.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const r=e.filter(o=>o.type===Ne.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const o of r)if(!o.prefix.startsWith(So))return t.message(`Wellknown path prefix must start with: ${So}`);return e}).default([]),environments:u.array().items(mi).default([]).optional().custom((e,t)=>{if(e&&e.length){const n=e.filter((r,o)=>e.findIndex(c=>c.name===r.name)!==o);if(n.length)return t.message(`find duplicate environment names ${n.map(r=>r.name).join(", ")}`)}return e}),scripts:gi,capabilities:u.object({clusterMode:u.boolean(),didSpace:u.string().valid(...Object.values(Ne.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:u.boolean().default(!0),serverless:u.boolean().optional(),component:u.boolean(),sitemap:u.boolean().optional()}).default({}),files:u.array().items(u.string().trim()).optional(),resource:u.object({exportApi:u.string().trim(),bundles:u.array().items(Si),types:u.array().items(kd).max(10)}),engine:u.alternatives().try(zr,u.array().items(zr)).optional(),screenshots:u.array().items(u.string().min(1)).optional().default([]),videos:u.array().items(u.string().pattern(/^https:\/\/(www\.)?(youtube\.com|youtu\.be|vimeo\.com)\/[\w\-/?&=]+/).message("Each video URL must be a valid YouTube or Vimeo link")).max(3).optional(),logoUrl:u.string().optional().allow(""),dist:zn.optional(),stats:Bs.optional(),htmlAst:u.any().optional(),path:u.string().optional(),signatures:u.array().items(zs).optional(),lastPublishedAt:u.string().isoDate().optional().allow(null),components:Ws(),navigation:wi,theme:Ei,copyright:u.object({owner:u.string().min(1),year:u.alternatives().try(u.string(),u.number())}),bundleName:u.string(),bundleDid:u.DID().trim(),storeId:u.string()},Cd=u.object(Vs).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});Z.blockletMetaSchema=Cd;const Gs=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:o=!1,skipValidateDidName:c=!1,...h}={})=>((!e||!fd.default.existsSync(e))&&(t=!1),u.object({...Vs,owner:u.object({avatar:u.string().optional(),did:u.DID().trim().required(),fullName:u.string().trim().required(),email:u.string().optional().allow(null).empty("").default("")}).optional(),logo:t?u.file().trim().exists({baseDir:e}).optional():u.string().trim().optional(),files:u.array().items(t?u.file().exists({baseDir:e,canSkip:(d,b)=>[Ne.BLOCKLET_ENTRY_FILE,Ne.BLOCKLET_BUNDLE_FILE].includes(b)||(0,vd.default)(b)}):u.string().trim()).optional(),dist:n?zn.required():zn.optional(),components:Ws({checkStore:r}),name:o?u.string().optional():u.string().required(),egress:u.boolean().optional().default(!0),docker:xd.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...h}).rename("children","components").custom((d,b)=>{const{did:x,name:s,docker:l}=d;if(l){const{image:y,dockerfile:S,network:R}=l;if(!y&&!S)return b.message("Image or dockerfile must be set");if(y&&S)return b.message("Image and dockerfile cannot be set at the same time");if(R)return b.message("ExportPorts and network cannot be set at the same time");if(S&&(d.files||(d.files=[]),d.files.push(S)),l.volumes)for(const P of l.volumes){if(!P.startsWith("$BLOCKLET_APP_DIR/")&&!P.startsWith("$BLOCKLET_DATA_DIR/"))return b.message("Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR");if(P.indexOf("..")>-1)return b.message('Volume cannot contain ".."')}}let O;if((0,bd.isValid)(x))try{return(0,Wr.validateNewDid)(x),d}catch(y){O=y}if(s){(0,Wr.validateName)(s,{checkDid:!c});const y=(0,wd.default)(s);return y!==x?b.message(`The did of name "${s}" should be "${y}"`):d}return O?b.message(O.message):d}));Z.createBlockletSchema=Gs;Z.default={blockletNameSchema:Rn,componentSchema:xi,endpointSchema:yi,serviceSchema:vi,createBlockletSchema:Gs,interfaceSchema:bi,environmentSchema:mi,environmentNameSchema:fi,scriptsSchema:gi,personSchema:Un,distSchema:zn,titleSchema:gr,descriptionSchema:vr,logoSchema:As,navigationSchema:wi,themeSchema:Ei,mountPointSchema:pi,updateMountPointSchema:Ms,authConfigSchema:Ks,resourceBundleSchema:Si,installBlockletTitleSchema:Ls,installBlockletDescriptionSchema:Ns,Joi:u};var vt={},Id=je&&je.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vt,"__esModule",{value:!0});vt.setService=vt.findService=vt.getDefaultServiceConfig=vt.getServiceConfig=void 0;const _d=Id(tl),Pd=Z,Hs={},Ti=e=>{Hs[e.name]={validate:e.schema.validate.bind(e.schema),defaultConfig:e.default}};vt.setService=Ti;Ti({name:"auth",schema:Pd.authConfigSchema,default:{}});const Xs=e=>{if(!e)throw new Error("service name should not be empty");const t=Hs[e];if(!t)throw new Error(`service ${e} does not exist`);return t},Ys=(e,t,{validate:n}={})=>{const r=Xs(e),o=(0,_d.default)(t||{}),{value:c,error:h}=r.validate(o);if(n&&h)throw new Error(`Invalid blocklet service config: ${h.details.map(d=>d.message).join(", ")}`);return c};vt.getServiceConfig=Ys;const Js=e=>{const{defaultConfig:t}=Xs(e);return t};vt.getDefaultServiceConfig=Js;const Qs=(e,t)=>{const n=[t];return(e||[]).find(r=>n.includes(r.name))};vt.findService=Qs;vt.default={getServiceConfig:Ys,getDefaultServiceConfig:Js,findService:Qs,setService:Ti};Object.defineProperty(sn,"__esModule",{value:!0});sn.fixAndValidateService=sn.validateMeta=void 0;const Ld=Z,Nd=vt,Ad=e=>(!e.interfaces||!e.interfaces.length||e.interfaces.forEach(t=>{t.services&&t.services.length&&t.services.forEach(n=>{n.config=(0,Nd.getServiceConfig)(n.name,n.config,{validate:!0})})}),e);sn.fixAndValidateService=Ad;const Zs=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:o=!1,skipValidateDidName:c=!1,schemaOptions:h={}}={})=>{const d=(0,Ld.createBlockletSchema)(null,{ensureFiles:t,ensureDist:n,ensureComponentStore:r,ensureName:o,skipValidateDidName:c,...h}),{value:b,error:x}=d.validate(e);if(x)throw new Error(`Invalid blocklet meta: ${x.details.map(s=>s.message).join(", ")}`);return b};sn.validateMeta=Zs;sn.default=Zs;(function(e){var t=je&&je.__createBinding||(Object.create?function(j,z,Q,$){$===void 0&&($=Q);var ue=Object.getOwnPropertyDescriptor(z,Q);(!ue||("get"in ue?!z.__esModule:ue.writable||ue.configurable))&&(ue={enumerable:!0,get:function(){return z[Q]}}),Object.defineProperty(j,$,ue)}:function(j,z,Q,$){$===void 0&&($=Q),j[$]=z[Q]}),n=je&&je.__setModuleDefault||(Object.create?function(j,z){Object.defineProperty(j,"default",{enumerable:!0,value:z})}:function(j,z){j.default=z}),r=je&&je.__importStar||function(){var j=function(z){return j=Object.getOwnPropertyNames||function(Q){var $=[];for(var ue in Q)Object.prototype.hasOwnProperty.call(Q,ue)&&($[$.length]=ue);return $},j(z)};return function(z){if(z&&z.__esModule)return z;var Q={};if(z!=null)for(var $=j(z),ue=0;ue<$.length;ue++)$[ue]!=="default"&&t(Q,z,$[ue]);return n(Q,z),Q}}(),o=je&&je.__importDefault||function(j){return j&&j.__esModule?j:{default:j}};Object.defineProperty(e,"__esModule",{value:!0}),e.fixService=e.fixInterfaces=e.parsePerson=e.formatPerson=e.fixName=e.fixTags=e.fixPerson=e.fixKeywords=e.fixFiles=e.fixRepository=e.fixRequired=void 0;const c=o(nl),h=r(_u),d=Rt,b=sn;Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return b.fixAndValidateService}});const x=di,s=(j,z)=>{j.description||(j.description=`Blocklet from ${z}`),j.version||(j.version=d.BLOCKLET_DEFAULT_VERSION)};e.fixRequired=s;const l=j=>{if(j.repository&&(typeof j.repository=="string"&&(j.repository={type:"git",url:j.repository}),j.repository.url)){const z=h.fromUrl(j.repository.url);z&&(j.repository.url=z.getDefaultRepresentation()==="shortcut"?z.https():z.toString())}};e.fixRepository=l;const O=j=>{Array.isArray(j.files)?j.files&&(j.files=j.files.filter(z=>!(!z||typeof z!="string"))):delete j.files};e.fixFiles=O;const y=j=>{typeof j.keywords=="string"&&(j.keywords=j.keywords.split(/,\s+/)),j.keywords&&!Array.isArray(j.keywords)?delete j.keywords:j.keywords&&(j.keywords=j.keywords.filter(z=>!(typeof z!="string"||!z)))};e.fixKeywords=y;const S=j=>{typeof j.tags=="string"&&(j.tags=j.tags.split(/,\s+/)),j.tags&&!Array.isArray(j.tags)?delete j.tags:j.tags&&(j.tags=j.tags.filter(z=>!(typeof z!="string"||!z)))};e.fixTags=S;const R=(j,z)=>(j.author&&(j.author=z(j.author)),["maintainers","contributors"].forEach(Q=>{Array.isArray(j[Q])&&(j[Q]=j[Q].map(z))}),j),P=j=>{if(!j)return"";if(typeof j=="string")return j;const z=j.name||"",Q=j.url||j.web,$=Q?` (${Q})`:"",ue=j.email||j.mail,ve=ue?` <${ue}>`:"";return z+ve+$};e.formatPerson=P;const A=j=>{if(typeof j!="string")return j;const z=j.match(/^([^(<]+)/),Q=j.match(/\(([^)]+)\)/),$=j.match(/<([^>]+)>/),ue={};return z&&z[0].trim()&&(ue.name=z[0].trim()),$&&([,ue.email]=$),Q&&([,ue.url]=Q),ue};e.parsePerson=A;const V=j=>(R(j,P),R(j,A),j);e.fixPerson=V;const W=(j,z=!0)=>{if(Array.isArray(j.interfaces)||(j.interfaces=[]),j.interfaces.length)return j.interfaces.forEach(ve=>{ve.type===d.BLOCKLET_INTERFACE_TYPE_WEB&&(ve.protocol="http")}),j;const $=(0,c.default)(j,"capabilities.dynamicPathPrefix",!0)?d.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",ue=({type:ve="web",name:ce,path:Ie="/",protocol:$e="http",port:Xe=d.BLOCKLET_DEFAULT_PORT_NAME})=>{j.interfaces.push({type:ve,name:ce,path:Ie,prefix:$,port:Xe,protocol:$e})};return[d.BLOCKLET_INTERFACE_PUBLIC].forEach(ve=>{j[ve]&&ue({name:ve,path:j[ve]})}),Array.isArray(j.exposeServices)&&j.exposeServices.forEach(ve=>{ue({type:"service",name:ve.protocol,protocol:ve.protocol,port:{internal:`BLOCKLET_${ve.protocol}_PORT`.toUpperCase(),external:ve.port}})}),z&&(delete j.publicUrl,delete j.adminUrl,delete j.configUrl,delete j.docUrl,delete j.exposeServices,j.capabilities&&delete j.capabilities.dynamicPathPrefix),j};e.fixInterfaces=W;const ee=j=>{const{did:z}=j;try{(0,x.validateNewDid)(z),j.name=z}catch{}return j};e.fixName=ee,e.default={fixRequired:s,fixRepository:l,fixFiles:O,fixKeywords:y,fixPerson:V,fixTags:S,fixName:ee,formatPerson:P,parsePerson:A,fixInterfaces:W,fixService:b.fixAndValidateService}})(bs);function ea({owner:e,locale:t}){return i.jsxs(te,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?i.jsx(Qo,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:t}):null]})}ea.propTypes={owner:_.object.isRequired,locale:_.string.isRequired};const Dd="install-blocklet-from-URL",ta=()=>{const[e,t]=cs(Dd,"[]",{raw:!0}),n=o=>{const c=o.trim(),h=JSON.parse(e),d=h.findIndex(b=>b===c);d!==0&&(d>0&&h.splice(d,1),h.length>=10&&h.splice(9),h.unshift(c),t(JSON.stringify(h)))},r=o=>{if(!o)return;const c=JSON.parse(e),h=o.trim(),d=c.findIndex(b=>b===h);d>-1&&(c.splice(d,1),t(JSON.stringify(c)))};return{urls:e?JSON.parse(e):[],addUrlRecord:n,removeUrlRecord:r}},Md=Uo(()=>({listItemText:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}));function ji(e){const{value:t,onValueChange:n,children:r,helperText:o}=e,{urls:c,removeUrlRecord:h}=ta(),d=(x,s)=>{x.preventDefault(),x.stopPropagation(),h(s)},b=Md();return i.jsxs(te,{children:[i.jsx(Wo,{freeSolo:!0,options:c,inputValue:t,onInputChange:(x,s)=>{n(s)},disableClearable:!0,popupIcon:null,renderInput:x=>Ha.cloneElement(r,{...x}),renderOption:(x,s)=>N.createElement(zo,{...x,key:s,secondaryAction:i.jsx($o,{edge:"end","aria-label":"delete",onClick:l=>d(l,s),children:i.jsx(rl,{})})},i.jsx(ka,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:i.jsx(qo,{primary:s,className:b.listItemText})})),ListboxProps:{sx:{maxHeight:300,overflow:"auto"}}}),i.jsx(Ca,{style:{margin:0},children:o})]})}ji.propTypes={onValueChange:_.func,children:_.node,value:_.string,helperText:_.string};ji.defaultProps={onValueChange:()=>{},children:null,value:"",helperText:""};function Oi({defaultUrl:e,onCancel:t,onSuccess:n,onError:r,mode:o,handleText:c}){const{api:h}=Gn(),{api:d}=Yl(),[b,x]=N.useState(!1),[s,l]=N.useState(""),{t:O,locale:y}=pt(),S={dist:{}},[R,P]=N.useState(e),[A,V]=N.useState(e?1:0),[W,ee]=N.useState(S),[j,z]=N.useState(!1),[Q,$]=N.useState({}),ue=o==="component",ve=ue?!0:!e,{addUrlRecord:ce}=ta(),Ie=async()=>{ee(S),l(null),x(!0);let ie=R.trim();!ie.startsWith("https://")&&!ie.startsWith("http://")&&!ie.startsWith("file://")&&(ie=`file://${ie}`);try{const lt=decodeURIComponent(ie);try{new URL(lt)}catch{throw new Error("Invalid URL")}const{meta:Te,inStore:Ye,registryUrl:Ue}=await h.getBlockletMetaFromUrl({input:{url:lt}});ee(Te),$({inStore:Ye,registryUrl:Ue,inputUrl:ie}),ce(ie)}catch(lt){console.error(lt);const Te=`Blocklet Install failed: ${us(lt)}`;l(Te),r(lt)}finally{x(!1)}},$e=()=>{if(ue){n({meta:W,...Q}),t();return}x(!0),z(!0)},Xe=()=>{x(!1),z(!1),n({meta:W,...Q}),t()},nt=()=>{x(!1),z(!1)};N.useEffect(()=>{e&&Ie()},[e]);const Y=[{name:O("common.name"),value:Ft.getDisplayName({meta:W},!0)},{name:O("common.version"),value:W.version},{name:O("common.did"),value:W.did?i.jsx(Jl,{did:W.did}):null},{name:O("common.author"),value:W.owner?i.jsx(ea,{owner:W.owner,locale:y}):bs.formatPerson(W.author)},{name:O("blocklet.dist.downloadLink"),value:W.dist.tarball}],fe=()=>b?i.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:i.jsx(ht,{})}):W.did?i.jsx("div",{style:{paddingLeft:"10%"},children:Y.map(ie=>ie.name===O("common.did")?i.jsx(ro,{valueComponent:"div",nameWidth:120,name:ie.name,nameFormatter:()=>O("common.did"),children:ie.value},ie.name):i.jsx(ro,{valueComponent:"div",nameWidth:120,name:ie.name,children:ie.value},ie.name))}):null,q=[{label:O("blocklet.fromUrl.step0"),body:i.jsx(ge,{component:"div",children:i.jsx(ji,{style:{marginBottom:32},value:R,helperText:O("blocklet.fromUrl.description"),onValueChange:ie=>{l(null),P(ie)},children:i.jsx(ar,{label:O("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:R,onChange:ie=>{l(null),P(ie.target.value)},disabled:b,onKeyPress:ie=>{ie.key==="Enter"&&(ie.preventDefault(),Ie(),V(1))}})})}),cancel:O("common.cancel"),confirm:O("common.next"),onCancel:t,onConfirm:()=>{Ie(),V(1)}},{label:O("blocklet.fromUrl.step1"),body:fe(),cancel:O(ve?"common.pre":"common.cancel"),confirm:(c==null?void 0:c.confirm)||O("blocklet.fromUrl.confirm"),onCancel:()=>{ve?V(ie=>ie-1):t()},onConfirm:()=>{$e()}}],Oe=q[A];return i.jsxs(i.Fragment,{children:[i.jsxs(Jr,{title:(c==null?void 0:c.title)||O("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>Oe.onCancel(),showCloseButton:A===0,disableEscapeKeyDown:!0,open:!0,actions:i.jsxs(i.Fragment,{children:[Oe.cancel&&i.jsx(st,{onClick:ie=>{ie.stopPropagation(),l(null),Oe.onCancel()},color:"inherit",children:Oe.cancel||O("common.cancel")}),i.jsxs(st,{onClick:ie=>{ie.stopPropagation(),Oe.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:b||!R||s,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[b&&A===0&&i.jsx(ht,{size:16}),Oe.confirm]})]}),children:[ve&&i.jsx(Ia,{alternativeLabel:!0,activeStep:A,children:q.map(({label:ie})=>i.jsx(_a,{children:i.jsx(Pa,{children:ie})},ie))}),i.jsx(La,{component:"div",style:{marginTop:24},children:Oe.body}),!!s&&i.jsx(Ko,{severity:"error",style:{width:"100%",marginTop:8},children:s})]}),W&&j&&i.jsx(es,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:d.get,checkTimeout:5*60*1e3,onSuccess:Xe,extraParams:{title:W.title,wt:xl(W),blockletMetaUrl:decodeURIComponent(R.trim())},messages:{title:O("setup.keyPair.title"),scan:O("setup.keyPair.scan"),confirm:O("setup.keyPair.confirm"),success:O("setup.keyPair.success")},onClose:nt})]})}Oi.propTypes={defaultUrl:_.string,onCancel:_.func.isRequired,onSuccess:_.func.isRequired,onError:_.func,mode:_.oneOf(["install","component"]),handleText:_.object};Oi.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};var Ri={},Fd=sr;Object.defineProperty(Ri,"__esModule",{value:!0});var na=Ri.default=void 0,Bd=Fd(cr()),$d=i;na=Ri.default=(0,Bd.default)((0,$d.jsx)("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-2 16-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z"}),"VerifiedUser");const Ud={meta:_.object.isRequired,onCancel:_.func.isRequired},Wd=Uo(()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}}));function ra({action:e,onSelect:t,onNext:n}){const r=Wd(),{t:o}=pt(),c=[{action:"purchase",title:o("store.purchase.purchase.title"),description:o("store.purchase.purchase.description")},{action:"verify",title:o("store.purchase.verify.title"),description:o("store.purchase.verify.description")}];return i.jsxs(i.Fragment,{children:[i.jsx(Na,{className:r.tabPanel,children:c.map(h=>i.jsxs(zo,{button:!0,selected:e===h.action,onClick:()=>t(h.action),children:[i.jsx(Aa,{className:r.iconRoot,children:h.action==="purchase"?i.jsx(Ql,{style:{color:e==="purchase"?Qi.primary.main:"#AAA",fontSize:32}}):i.jsx(na,{style:{color:e==="verify"?Qi.primary.main:"#AAA",fontSize:32}})}),i.jsx(qo,{primary:h.title,secondary:h.description})]},h.action))}),n&&i.jsx(st,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:n,children:o("common.next")})]})}ra.propTypes={action:_.oneOf(["both","purchase","verify"]).isRequired,onSelect:_.func.isRequired,onNext:_.func.isRequired};function ki({meta:e,onCancel:t,mode:n,handlePaySuccess:r}){const{t:o,locale:c}=pt(),{info:h}=Gn(),d=wl(h),[b,x]=N.useState(null),s=new URL(e==null?void 0:e.registryUrl).origin,l=Ft.getDisplayName({meta:e}),O=async(S,R)=>{const P=({downloadTokenList:W})=>{r({downloadTokenList:W})},A=W=>{Qr.error(W),t(W)};function V(W){return il(()=>io.get(W).then(async({data:ee})=>{const j=ee==null?void 0:ee.downloadTokenList;if(ee.status==="succeed"){if(j&&j.length)await P({downloadTokenList:j});else return await A(o("blocklet.component.missDownloadTokenTip")),!0;return!0}return ee.status==="error"?(console.error("vc error: ",ee),await A(ee==null?void 0:ee.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&b){const{statusUrl:W}=El(b);await V(W)}else await P({downloadTokenList:S.downloadTokenList&&R(S.downloadTokenList)})};if(N.useEffect(()=>{if(n==="purchase"){const S=new URL(s);S.pathname="/api/did/verify-purchase-blocklet/token",S.searchParams.set("serverDid",h.did),S.searchParams.set("blockletDid",e==null?void 0:e.did);try{io.get(S.href).then(({data:R})=>{const P=`${R.url}`;x(P)})}catch(R){console.error("get next workflow url error: ",R)}}return()=>{x(null)}},[n]),n==="purchase"&&!b)return"";const y={verify:{action:"verify-purchase-blocklet",checkFn:no.create({baseURL:s}).get,extraParams:{serverDid:h.did,blockletDid:e==null?void 0:e.did},messages:{title:o("store.purchase.verify.auth.title",{name:l}),scan:o("store.purchase.verify.auth.scan"),confirm:o("store.purchase.verify.auth.confirm"),success:o("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:no.create({baseURL:Wn(s,"/store")}).get,extraParams:{factory:e.nftFactory,nw:b},messages:{title:o("store.purchase.auth.title",{name:l}),scan:o("store.purchase.auth.scan"),confirm:o("store.purchase.auth.confirm"),success:i.jsxs(i.Fragment,{children:[i.jsx("p",{children:o("store.purchase.auth.success")}),i.jsx("p",{children:o("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return i.jsx(es,{open:!0,locale:c,popup:!1,saveConnect:!1,className:"connect",baseUrl:s,onSuccess:O,cancelWhenScanned:t,onClose:t,checkTimeout:60*5e3,webWalletUrl:d,disableClose:!0,showDownload:!1,...y[n]})}ki.propTypes={...Ud,handlePaySuccess:_.func,mode:_.oneOf(["verify","purchase"]).isRequired};ki.defaultProps={handlePaySuccess:()=>{}};const Ci=N.forwardRef(({mode:e,...t},n)=>{const[r,o]=N.useState(e!=="both"?e:"verify"),[c,h]=N.useState(e!=="both"?2:1),d=x=>{x!==r&&o(x)},b=()=>{r&&c!==2&&h(2)};return N.useImperativeHandle(n,()=>({onNext:b,getCurrentStep:()=>c})),c===1?i.jsx("div",{style:{maxWidth:520},children:i.jsx(ra,{action:r,onNext:null,onSelect:d})}):i.jsx(ki,{...t,mode:r})});Ci.propTypes={mode:_.oneOf(["both","verify","purchase"]).isRequired,ref:_.any};Ci.defaultProps={ref:{}};const zd=Ci;function qd({...e}){return i.jsx(st,{className:"bottom-button",variant:"contained",color:"primary",...e})}function Ii({blocklet:e,onStartNow:t,children:n,disabled:r}){const{t:o}=pt(),c=ds();return!e||Sl(e.meta)?i.jsx(Kd,{children:n}):i.jsxs(Vd,{isMobile:c,children:[i.jsx(qd,{className:"start-now",variant:"contained",color:"primary",disabled:r,onClick:()=>t(),children:o("setup.startNow")}),i.jsx(te,{display:"flex",alignItems:"center",children:n})]})}Ii.propTypes={blocklet:_.object,onStartNow:_.func,children:_.any,disabled:_.bool};Ii.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Kd=Ve(te)`
|
|
217
|
-
width: 100%;
|
|
218
|
-
margin-top: auto;
|
|
219
|
-
padding-top: 24px;
|
|
220
|
-
display: flex;
|
|
221
|
-
align-items: center;
|
|
222
|
-
justify-content: center;
|
|
223
|
-
.bottom-button {
|
|
224
|
-
min-width: 200px;
|
|
225
|
-
}
|
|
226
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
227
|
-
.bottom-button {
|
|
228
|
-
width: 100%;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
`,Vd=Ve(te)`
|
|
232
|
-
padding-top: 24px;
|
|
233
|
-
margin-top: auto;
|
|
234
|
-
width: 100%;
|
|
235
|
-
display: flex;
|
|
236
|
-
align-items: center;
|
|
237
|
-
justify-content: space-between;
|
|
238
|
-
.start-now {
|
|
239
|
-
min-width: 140px;
|
|
240
|
-
}
|
|
241
|
-
.bottom-button {
|
|
242
|
-
min-width: 120px;
|
|
243
|
-
}
|
|
244
|
-
${e=>e.theme.breakpoints.down("lg")} {
|
|
245
|
-
width: 100%;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
249
|
-
.start-now {
|
|
250
|
-
min-width: inherit;
|
|
251
|
-
}
|
|
252
|
-
.bottom-button {
|
|
253
|
-
min-width: 100px;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
${e=>e.isMobile} {
|
|
258
|
-
justify-content: space-between;
|
|
259
|
-
gap: '32px',
|
|
260
|
-
}}
|
|
261
|
-
`;function _i({blockletMeta:e,onEndpointUpdate:t}){var d;const n=ds(),{blocklet:r}=hr(),{updateSpaceGateway:o,loading:c,hasStorageEndpoint:h}=Cl();return N.useEffect(()=>{t==null||t()},[r]),c?i.jsx(ol,{relative:"parent",children:i.jsx(ht,{})}):i.jsxs(Gd,{children:[i.jsx(te,{width:n?"360px":"720px",children:h?i.jsx(nc,{}):i.jsx(rc,{})}),((d=e==null?void 0:e.capabilities)==null?void 0:d.didSpace)==="required"&&i.jsx(Ii,{mt:8,children:i.jsx(ic,{onConnect:o})})]})}_i.propTypes={blockletMeta:_.any.isRequired,onEndpointUpdate:Da.func};_i.defaultProps={onEndpointUpdate:()=>{}};const Gd=Ve(tc)`
|
|
262
|
-
height: 100%;
|
|
263
|
-
overflow-y: auto;
|
|
264
|
-
padding-bottom: 32px;
|
|
265
|
-
overflow-x: hidden;
|
|
266
|
-
`;function Pi({onChange:e,loading:t,children:n,extra:r,stores:o,storageKey:c}){const{t:h}=pt(),{info:d,inService:b}=Gn(),{blocklet:x}=hr(),[s,l]=N.useState(!1),O=N.useRef(null),[y,S]=N.useState(),[R,P]=cs(c||"tmp"),[A,V]=c?[R,P]:[y,S],{storeList:W,teamDid:ee}=os({fromBlocklet:b,blocklet:x,nodeInfo:d}),j=ts([...o.map(Q=>({...Q,protected:!0})),...W],"url"),z=A&&j.find(Q=>A===Q.url)||j[0];return i.jsxs(i.Fragment,{children:[i.jsxs(Hd,{children:[i.jsx(st,{ref:O,color:"primary","data-cy":"add-component-select-store",endIcon:i.jsx(oc,{color:"primary"}),onClick:()=>{l(!0)},style:{padding:"0 2px"},children:i.jsx(ge,{color:"primary",children:z.name})}),i.jsx(ge,{color:"primary",children:r})]}),i.jsxs(ar,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:h("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:z,autoFocus:!0,onChange:Q=>{const $=Q.target.value;V($.url),e($)},SelectProps:{open:s,MenuProps:{anchorEl:O.current},renderValue:Q=>Q==null?void 0:Q.name,onClose:()=>{l(!1)}},style:{display:"none"},margin:"normal",children:[j==null?void 0:j.map(Q=>i.jsx(Xr,{sx:{width:"400px",maxWidth:"90vw"},value:Q,"data-cy":Q.url,children:i.jsx(Ja,{teamDid:ee,store:Q,onDelete:()=>{var $;A===Q.url&&V(($=j[0])==null?void 0:$.url)}})},Q.url)),!Jo.isInServerlessMode(d)&&i.jsx(Qa,{disabled:t,storeList:j,teamDid:ee,onAdd:Q=>{V(Q)}})]}),n({currentRegistry:z})]})}Pi.propTypes={onChange:_.func,loading:_.bool,children:_.any.isRequired,extra:_.node,storageKey:_.string,stores:_.arrayOf(_.shape({name:_.string.isRequired,url:_.string.isRequired}))};Pi.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Hd=Ve.div`
|
|
267
|
-
display: flex;
|
|
268
|
-
justify-content: space-between;
|
|
269
|
-
align-items: center;
|
|
270
|
-
margin-bottom: 16px;
|
|
271
|
-
|
|
272
|
-
span {
|
|
273
|
-
font-size: 16px;
|
|
274
|
-
color: ${e=>e.theme.palette.common.black};
|
|
275
|
-
// font-weight: bold;
|
|
276
|
-
}
|
|
277
|
-
`,Xd=ln("div")`
|
|
278
|
-
background-color: transparent !important;
|
|
279
|
-
& > :not(.Mui-disabled) {
|
|
280
|
-
position: relative;
|
|
281
|
-
z-index: 1;
|
|
282
|
-
&::before {
|
|
283
|
-
content: '';
|
|
284
|
-
position: absolute;
|
|
285
|
-
height: 100%;
|
|
286
|
-
width: 100%;
|
|
287
|
-
left: 0;
|
|
288
|
-
top: 0;
|
|
289
|
-
transition: opacity 0.3s;
|
|
290
|
-
}
|
|
291
|
-
&:hover::before {
|
|
292
|
-
opacity: 0;
|
|
293
|
-
}
|
|
294
|
-
&::after {
|
|
295
|
-
content: '';
|
|
296
|
-
position: absolute;
|
|
297
|
-
height: 100%;
|
|
298
|
-
width: 100%;
|
|
299
|
-
top: 0;
|
|
300
|
-
left: 0;
|
|
301
|
-
border-radius: 2px;
|
|
302
|
-
background-color: ${e=>e.theme.palette.primary.main};
|
|
303
|
-
transform: scale(0.1);
|
|
304
|
-
opacity: 0;
|
|
305
|
-
z-index: -1;
|
|
306
|
-
transition:
|
|
307
|
-
transform 0.3s,
|
|
308
|
-
opacity 0.3s,
|
|
309
|
-
background-color 0.3s;
|
|
310
|
-
}
|
|
311
|
-
&:hover::after {
|
|
312
|
-
opacity: 1;
|
|
313
|
-
transform-origin: center;
|
|
314
|
-
transform: scale(1);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
& > :not(.Mui-disabled) {
|
|
318
|
-
background-color: transparent !important;
|
|
319
|
-
color: ${e=>e.theme.palette.primary.main}!important;
|
|
320
|
-
}
|
|
321
|
-
& > :not(.Mui-disabled) {
|
|
322
|
-
&:hover {
|
|
323
|
-
color: ${e=>e.theme.palette.common.white}!important;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
`,Ro=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),Yd=ln("div")`
|
|
327
|
-
&.arcblock-blocklet {
|
|
328
|
-
padding: ${e=>e.theme.spacing(2)} ${e=>e.theme.spacing(2)} 0
|
|
329
|
-
${e=>e.theme.spacing(2)};
|
|
330
|
-
}
|
|
331
|
-
.arcblock-blocklet__content {
|
|
332
|
-
cursor: pointer;
|
|
333
|
-
display: flex;
|
|
334
|
-
${e=>e.theme.breakpoints.up("sm")} {
|
|
335
|
-
align-items: center;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
.arcblock-blocklet__cover {
|
|
339
|
-
width: 64px;
|
|
340
|
-
height: 64px;
|
|
341
|
-
margin-right: ${e=>e.theme.spacing(2)};
|
|
342
|
-
overflow: hidden;
|
|
343
|
-
border-radius: 12px;
|
|
344
|
-
/* see: https://stackoverflow.com/questions/49066011/overflow-hidden-with-border-radius-not-working-on-safari */
|
|
345
|
-
transform: translateZ(0);
|
|
346
|
-
${e=>e.theme.breakpoints.up("sm")} {
|
|
347
|
-
width: 80px;
|
|
348
|
-
height: 80px;
|
|
349
|
-
margin-bottom: 12px;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
.arcblock-blocklet__button--hover {
|
|
353
|
-
&:not(.Mui-disabled) {
|
|
354
|
-
position: relative;
|
|
355
|
-
z-index: 1;
|
|
356
|
-
&::before {
|
|
357
|
-
content: '';
|
|
358
|
-
position: absolute;
|
|
359
|
-
height: 100%;
|
|
360
|
-
width: 100%;
|
|
361
|
-
left: 0;
|
|
362
|
-
top: 0;
|
|
363
|
-
transition: opacity 0.3s;
|
|
364
|
-
}
|
|
365
|
-
&:hover::before {
|
|
366
|
-
opacity: 0;
|
|
367
|
-
}
|
|
368
|
-
&::after {
|
|
369
|
-
content: '';
|
|
370
|
-
position: absolute;
|
|
371
|
-
height: 100%;
|
|
372
|
-
width: 100%;
|
|
373
|
-
background-color: ${e=>e.theme.palette.primary.main};
|
|
374
|
-
transform: scale(0.1);
|
|
375
|
-
opacity: 0;
|
|
376
|
-
z-index: -1;
|
|
377
|
-
transition:
|
|
378
|
-
transform 0.3s,
|
|
379
|
-
opacity 0.3s,
|
|
380
|
-
background-color 0.3s;
|
|
381
|
-
}
|
|
382
|
-
&:hover::after {
|
|
383
|
-
opacity: 1;
|
|
384
|
-
transform-origin: center;
|
|
385
|
-
transform: scale(1);
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
&:not(.Mui-disabled) {
|
|
390
|
-
background-color: transparent !important;
|
|
391
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
392
|
-
}
|
|
393
|
-
&:not(.Mui-disabled) {
|
|
394
|
-
&:hover {
|
|
395
|
-
color: ${e=>e.theme.palette.common.white};
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
.arcblock-blocklet__info {
|
|
400
|
-
flex: 1;
|
|
401
|
-
overflow: hidden;
|
|
402
|
-
border-bottom: 1px solid ${e=>e.theme.palette.divider};
|
|
403
|
-
padding-bottom: ${e=>e.theme.spacing(2)};
|
|
404
|
-
}
|
|
405
|
-
.arcblock-blocklet__text {
|
|
406
|
-
height: 65px;
|
|
407
|
-
overflow: hidden;
|
|
408
|
-
}
|
|
409
|
-
/* 设置多行文本溢出显示省略号 兼容fireFox、safari */
|
|
410
|
-
.arcblock-blocklet__title {
|
|
411
|
-
margin: 0;
|
|
412
|
-
font-size: 16px;
|
|
413
|
-
font-weight: 500;
|
|
414
|
-
overflow: hidden;
|
|
415
|
-
text-overflow: ellipsis;
|
|
416
|
-
white-space: nowrap;
|
|
417
|
-
}
|
|
418
|
-
.arcblock-blocklet__describe {
|
|
419
|
-
margin-top: ${e=>e.theme.spacing(.5)};
|
|
420
|
-
color: ${e=>e.theme.palette.grey[600]};
|
|
421
|
-
font-size: 14px;
|
|
422
|
-
font-weight: 500;
|
|
423
|
-
line-height: 17px;
|
|
424
|
-
max-height: 34px;
|
|
425
|
-
overflow: hidden;
|
|
426
|
-
text-overflow: ellipsis;
|
|
427
|
-
display: -webkit-box;
|
|
428
|
-
-webkit-line-clamp: 2;
|
|
429
|
-
-webkit-box-orient: vertical;
|
|
430
|
-
word-break: break-word;
|
|
431
|
-
}
|
|
432
|
-
.arcblock-blocklet__version {
|
|
433
|
-
color: ${e=>e.theme.palette.grey[600]};
|
|
434
|
-
font-size: 12px;
|
|
435
|
-
}
|
|
436
|
-
`;function Li({title:e,did:t,description:n,cover:r,version:o,button:c,buttonText:h,buttonDisabled:d,buttonLoading:b,onButtonClick:x,onMainClick:s,className:l,...O}){const y=(W,ee=()=>!1)=>(j,...z)=>{ee()?(j.preventDefault(),j.stopPropagation()):W instanceof Function&&(j.preventDefault(),j.stopPropagation(),W(...z))},S=y(x,()=>!!(c||d||b)),R=Kn(),P=Mt(R.breakpoints.up("sm")),A=y(s),V=P?80:64;return i.jsx(Yd,{className:`${l} arcblock-blocklet`,...O,children:i.jsxs("div",{className:"arcblock-blocklet__content",onClick:A,children:[r?i.jsx("div",{className:"arcblock-blocklet__cover",children:i.jsx(sl,{src:r})}):t&&i.jsx("div",{className:"arcblock-blocklet__cover",children:i.jsx(Zr,{did:t,size:V})}),i.jsxs("div",{className:"arcblock-blocklet__info",children:[i.jsxs("div",{className:"arcblock-blocklet__text",children:[N.isValidElement(e)?i.jsx(ge,{component:"h3",variant:"h3",className:"arcblock-blocklet__title",children:e}):i.jsx(ge,{component:"h3",variant:"h3",className:"arcblock-blocklet__title",title:Ro(e),dangerouslySetInnerHTML:{__html:e}}),N.isValidElement(n)?i.jsx(ge,{component:"div",variant:"body2",className:"arcblock-blocklet__describe",children:n}):i.jsx(ge,{component:"div",variant:"body2",className:"arcblock-blocklet__describe",title:Ro(n),dangerouslySetInnerHTML:{__html:n}})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:"10px",flexFlow:"wrap"},children:[i.jsx("div",{onClick:S,style:{marginRight:"12px"},children:c||x&&i.jsxs(st,{className:"arcblock-blocklet__button--hover",variant:"outlined",color:"primary",size:"small",disabled:d||b,style:{padding:"3px 6px",fontSize:"14px",minWidth:"92px",textAlign:"center"},children:[b&&i.jsx(ht,{size:15,style:{marginRight:3,color:"inherit"}}),h]})}),i.jsx("div",{className:"arcblock-blocklet__version",children:o&&`v${o}`})]})]})]})})}Li.propTypes={title:_.string||_.node,did:_.string,description:_.string||_.node,cover:_.string,buttonText:_.string,buttonDisabled:_.bool,buttonLoading:_.bool,button:_.element,version:_.string,onButtonClick:_.func,onMainClick:_.func,className:_.string};Li.defaultProps={title:"",description:"",cover:null,did:null,buttonText:"Install",buttonDisabled:!1,buttonLoading:!1,button:null,version:null,onButtonClick:null,onMainClick:null,className:null};const Jd={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m8 16l2-6l6-2l-2 6l-6 2"/><path d="M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0m9-9v2m0 14v2m-9-9h2m14 0h2"/></g>'};var Qd=al,ko=ll;function Zd(e,t,n,r){return e==null?[]:(ko(t)||(t=t==null?[]:[t]),n=r?void 0:n,ko(n)||(n=n==null?[]:[n]),Qd(e,t,n))}var eh=Zd;const th=lr(eh);var Ni={},nh=sr;Object.defineProperty(Ni,"__esModule",{value:!0});var ia=Ni.default=void 0,rh=nh(cr()),ih=i;ia=Ni.default=(0,rh.default)((0,ih.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");const oh={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 18a3.5 3.5 0 0 0 0-7h-1A5 4.5 0 0 0 7 9a4.6 4.4 0 0 0-2.1 8.4M12 13v9m-3-3l3 3l3-3"/>'};var oa={exports:{}};(function(e,t){(function(n,r){e.exports=r(N)})(je,n=>(()=>{var r={703:(d,b,x)=>{var s=x(414);function l(){}function O(){}O.resetWarningCache=l,d.exports=function(){function y(P,A,V,W,ee,j){if(j!==s){var z=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw z.name="Invariant Violation",z}}function S(){return y}y.isRequired=y;var R={array:y,bool:y,func:y,number:y,object:y,string:y,symbol:y,any:y,arrayOf:S,element:y,elementType:y,instanceOf:S,node:y,objectOf:S,oneOf:S,oneOfType:S,shape:S,exact:S,checkPropTypes:O,resetWarningCache:l};return R.PropTypes=R,R}},697:(d,b,x)=>{d.exports=x(703)()},414:d=>{d.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:d=>{var b=typeof Element<"u",x=typeof Map=="function",s=typeof Set=="function",l=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function O(y,S){if(y===S)return!0;if(y&&S&&typeof y=="object"&&typeof S=="object"){if(y.constructor!==S.constructor)return!1;var R,P,A,V;if(Array.isArray(y)){if((R=y.length)!=S.length)return!1;for(P=R;P--!=0;)if(!O(y[P],S[P]))return!1;return!0}if(x&&y instanceof Map&&S instanceof Map){if(y.size!==S.size)return!1;for(V=y.entries();!(P=V.next()).done;)if(!S.has(P.value[0]))return!1;for(V=y.entries();!(P=V.next()).done;)if(!O(P.value[1],S.get(P.value[0])))return!1;return!0}if(s&&y instanceof Set&&S instanceof Set){if(y.size!==S.size)return!1;for(V=y.entries();!(P=V.next()).done;)if(!S.has(P.value[0]))return!1;return!0}if(l&&ArrayBuffer.isView(y)&&ArrayBuffer.isView(S)){if((R=y.length)!=S.length)return!1;for(P=R;P--!=0;)if(y[P]!==S[P])return!1;return!0}if(y.constructor===RegExp)return y.source===S.source&&y.flags===S.flags;if(y.valueOf!==Object.prototype.valueOf)return y.valueOf()===S.valueOf();if(y.toString!==Object.prototype.toString)return y.toString()===S.toString();if((R=(A=Object.keys(y)).length)!==Object.keys(S).length)return!1;for(P=R;P--!=0;)if(!Object.prototype.hasOwnProperty.call(S,A[P]))return!1;if(b&&y instanceof Element)return!1;for(P=R;P--!=0;)if((A[P]!=="_owner"&&A[P]!=="__v"&&A[P]!=="__o"||!y.$$typeof)&&!O(y[A[P]],S[A[P]]))return!1;return!0}return y!=y&&S!=S}d.exports=function(y,S){try{return O(y,S)}catch(R){if((R.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw R}}},359:d=>{d.exports=n}},o={};function c(d){var b=o[d];if(b!==void 0)return b.exports;var x=o[d]={exports:{}};return r[d](x,x.exports,c),x.exports}c.n=d=>{var b=d&&d.__esModule?()=>d.default:()=>d;return c.d(b,{a:b}),b},c.d=(d,b)=>{for(var x in b)c.o(b,x)&&!c.o(d,x)&&Object.defineProperty(d,x,{enumerable:!0,get:b[x]})},c.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),c.o=(d,b)=>Object.prototype.hasOwnProperty.call(d,b),c.r=d=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(d,"__esModule",{value:!0})};var h={};return(()=>{function d(v){var p,E,T="";if(typeof v=="string"||typeof v=="number")T+=v;else if(typeof v=="object")if(Array.isArray(v))for(p=0;p<v.length;p++)v[p]&&(E=d(v[p]))&&(T&&(T+=" "),T+=E);else for(p in v)v[p]&&(T&&(T+=" "),T+=p);return T}function b(){for(var v,p,E=0,T="";E<arguments.length;)(v=arguments[E++])&&(p=d(v))&&(T&&(T+=" "),T+=p);return T}c.r(h),c.d(h,{default:()=>Oa});var x=c(359),s=c.n(x);const l=function(v){var p=typeof v;return v!=null&&(p=="object"||p=="function")},O=typeof je=="object"&&je&&je.Object===Object&&je;var y=typeof self=="object"&&self&&self.Object===Object&&self;const S=O||y||Function("return this")(),R=function(){return S.Date.now()};var P=/\s/,A=/^\s+/;const V=function(v){return v&&v.slice(0,function(p){for(var E=p.length;E--&&P.test(p.charAt(E)););return E}(v)+1).replace(A,"")},W=S.Symbol;var ee=Object.prototype,j=ee.hasOwnProperty,z=ee.toString,Q=W?W.toStringTag:void 0,$=Object.prototype.toString,ue=W?W.toStringTag:void 0;const ve=function(v){return v==null?v===void 0?"[object Undefined]":"[object Null]":ue&&ue in Object(v)?function(p){var E=j.call(p,Q),T=p[Q];try{p[Q]=void 0;var F=!0}catch{}var ne=z.call(p);return F&&(E?p[Q]=T:delete p[Q]),ne}(v):function(p){return $.call(p)}(v)};var ce=/^[-+]0x[0-9a-f]+$/i,Ie=/^0b[01]+$/i,$e=/^0o[0-7]+$/i,Xe=parseInt;const nt=function(v){if(typeof v=="number")return v;if(function(T){return typeof T=="symbol"||function(F){return F!=null&&typeof F=="object"}(T)&&ve(T)=="[object Symbol]"}(v))return NaN;if(l(v)){var p=typeof v.valueOf=="function"?v.valueOf():v;v=l(p)?p+"":p}if(typeof v!="string")return v===0?v:+v;v=V(v);var E=Ie.test(v);return E||$e.test(v)?Xe(v.slice(2),E?2:8):ce.test(v)?NaN:+v};var Y=Math.max,fe=Math.min;const q=function(v,p,E){var T,F,ne,me,m,f,k=0,D=!1,B=!1,M=!0;if(typeof v!="function")throw new TypeError("Expected a function");function le(re){var pe=T,Ee=F;return T=F=void 0,k=re,me=v.apply(Ee,pe)}function ae(re){return k=re,m=setTimeout(G,p),D?le(re):me}function he(re){var pe=re-f;return f===void 0||pe>=p||pe<0||B&&re-k>=ne}function G(){var re=R();if(he(re))return H(re);m=setTimeout(G,function(pe){var Ee=p-(pe-f);return B?fe(Ee,ne-(pe-k)):Ee}(re))}function H(re){return m=void 0,M&&T?le(re):(T=F=void 0,me)}function X(){var re=R(),pe=he(re);if(T=arguments,F=this,f=re,pe){if(m===void 0)return ae(f);if(B)return clearTimeout(m),m=setTimeout(G,p),le(f)}return m===void 0&&(m=setTimeout(G,p)),me}return p=nt(p)||0,l(E)&&(D=!!E.leading,ne=(B="maxWait"in E)?Y(nt(E.maxWait)||0,p):ne,M="trailing"in E?!!E.trailing:M),X.cancel=function(){m!==void 0&&clearTimeout(m),k=0,T=f=F=m=void 0},X.flush=function(){return m===void 0?me:H(R())},X},Oe=function(v,p,E){var T=!0,F=!0;if(typeof v!="function")throw new TypeError("Expected a function");return l(E)&&(T="leading"in E?!!E.leading:T,F="trailing"in E?!!E.trailing:F),q(v,p,{leading:T,maxWait:p,trailing:F})};var ie=c(590),lt=c.n(ie),Te=function(){if(typeof Map<"u")return Map;function v(p,E){var T=-1;return p.some(function(F,ne){return F[0]===E&&(T=ne,!0)}),T}return function(){function p(){this.__entries__=[]}return Object.defineProperty(p.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),p.prototype.get=function(E){var T=v(this.__entries__,E),F=this.__entries__[T];return F&&F[1]},p.prototype.set=function(E,T){var F=v(this.__entries__,E);~F?this.__entries__[F][1]=T:this.__entries__.push([E,T])},p.prototype.delete=function(E){var T=this.__entries__,F=v(T,E);~F&&T.splice(F,1)},p.prototype.has=function(E){return!!~v(this.__entries__,E)},p.prototype.clear=function(){this.__entries__.splice(0)},p.prototype.forEach=function(E,T){T===void 0&&(T=null);for(var F=0,ne=this.__entries__;F<ne.length;F++){var me=ne[F];E.call(T,me[1],me[0])}},p}()}(),Ye=typeof window<"u"&&typeof document<"u"&&window.document===document,Ue=c.g!==void 0&&c.g.Math===Math?c.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),Ct=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ue):function(v){return setTimeout(function(){return v(Date.now())},1e3/60)},Gt=["top","right","bottom","left","width","height","size","weight"],$t=typeof MutationObserver<"u",Ht=function(){function v(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(p,E){var T=!1,F=!1,ne=0;function me(){T&&(T=!1,p()),F&&f()}function m(){Ct(me)}function f(){var k=Date.now();if(T){if(k-ne<2)return;F=!0}else T=!0,F=!1,setTimeout(m,20);ne=k}return f}(this.refresh.bind(this))}return v.prototype.addObserver=function(p){~this.observers_.indexOf(p)||this.observers_.push(p),this.connected_||this.connect_()},v.prototype.removeObserver=function(p){var E=this.observers_,T=E.indexOf(p);~T&&E.splice(T,1),!E.length&&this.connected_&&this.disconnect_()},v.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},v.prototype.updateObservers_=function(){var p=this.observers_.filter(function(E){return E.gatherActive(),E.hasActive()});return p.forEach(function(E){return E.broadcastActive()}),p.length>0},v.prototype.connect_=function(){Ye&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),$t?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},v.prototype.disconnect_=function(){Ye&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},v.prototype.onTransitionEnd_=function(p){var E=p.propertyName,T=E===void 0?"":E;Gt.some(function(F){return!!~T.indexOf(F)})&&this.refresh()},v.getInstance=function(){return this.instance_||(this.instance_=new v),this.instance_},v.instance_=null,v}(),We=function(v,p){for(var E=0,T=Object.keys(p);E<T.length;E++){var F=T[E];Object.defineProperty(v,F,{value:p[F],enumerable:!1,writable:!1,configurable:!0})}return v},ye=function(v){return v&&v.ownerDocument&&v.ownerDocument.defaultView||Ue},ft=ke(0,0,0,0);function be(v){return parseFloat(v)||0}function It(v){for(var p=[],E=1;E<arguments.length;E++)p[E-1]=arguments[E];return p.reduce(function(T,F){return T+be(v["border-"+F+"-width"])},0)}var Xt=typeof SVGGraphicsElement<"u"?function(v){return v instanceof ye(v).SVGGraphicsElement}:function(v){return v instanceof ye(v).SVGElement&&typeof v.getBBox=="function"};function Je(v){return Ye?Xt(v)?function(p){var E=p.getBBox();return ke(0,0,E.width,E.height)}(v):function(p){var E=p.clientWidth,T=p.clientHeight;if(!E&&!T)return ft;var F=ye(p).getComputedStyle(p),ne=function(M){for(var le={},ae=0,he=["top","right","bottom","left"];ae<he.length;ae++){var G=he[ae],H=M["padding-"+G];le[G]=be(H)}return le}(F),me=ne.left+ne.right,m=ne.top+ne.bottom,f=be(F.width),k=be(F.height);if(F.boxSizing==="border-box"&&(Math.round(f+me)!==E&&(f-=It(F,"left","right")+me),Math.round(k+m)!==T&&(k-=It(F,"top","bottom")+m)),!function(M){return M===ye(M).document.documentElement}(p)){var D=Math.round(f+me)-E,B=Math.round(k+m)-T;Math.abs(D)!==1&&(f-=D),Math.abs(B)!==1&&(k-=B)}return ke(ne.left,ne.top,f,k)}(v):ft}function ke(v,p,E,T){return{x:v,y:p,width:E,height:T}}var un=function(){function v(p){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ke(0,0,0,0),this.target=p}return v.prototype.isActive=function(){var p=Je(this.target);return this.contentRect_=p,p.width!==this.broadcastWidth||p.height!==this.broadcastHeight},v.prototype.broadcastRect=function(){var p=this.contentRect_;return this.broadcastWidth=p.width,this.broadcastHeight=p.height,p},v}(),dn=function(v,p){var E,T,F,ne,me,m,f,k=(T=(E=p).x,F=E.y,ne=E.width,me=E.height,m=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,f=Object.create(m.prototype),We(f,{x:T,y:F,width:ne,height:me,top:F,right:T+ne,bottom:me+F,left:T}),f);We(this,{target:v,contentRect:k})},hn=function(){function v(p,E,T){if(this.activeObservations_=[],this.observations_=new Te,typeof p!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=p,this.controller_=E,this.callbackCtx_=T}return v.prototype.observe=function(p){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(p instanceof ye(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(p)||(E.set(p,new un(p)),this.controller_.addObserver(this),this.controller_.refresh())}},v.prototype.unobserve=function(p){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(p instanceof ye(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(p)&&(E.delete(p),E.size||this.controller_.removeObserver(this))}},v.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},v.prototype.gatherActive=function(){var p=this;this.clearActive(),this.observations_.forEach(function(E){E.isActive()&&p.activeObservations_.push(E)})},v.prototype.broadcastActive=function(){if(this.hasActive()){var p=this.callbackCtx_,E=this.activeObservations_.map(function(T){return new dn(T.target,T.broadcastRect())});this.callback_.call(p,E,p),this.clearActive()}},v.prototype.clearActive=function(){this.activeObservations_.splice(0)},v.prototype.hasActive=function(){return this.activeObservations_.length>0},v}(),Qe=typeof WeakMap<"u"?new WeakMap:new Te,bt=function v(p){if(!(this instanceof v))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var E=Ht.getInstance(),T=new hn(p,E,this);Qe.set(this,T)};["observe","unobserve","disconnect"].forEach(function(v){bt.prototype[v]=function(){var p;return(p=Qe.get(this))[v].apply(p,arguments)}});const pn=Ue.ResizeObserver!==void 0?Ue.ResizeObserver:bt,xt="Left",mt="Right",ct="Up",Re="Down",wt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Ut={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Yt="mousemove",Jt="mouseup";function _t(v,p){if(p===0)return v;const E=Math.PI/180*p;return[v[0]*Math.cos(E)+v[1]*Math.sin(E),v[1]*Math.cos(E)-v[0]*Math.sin(E)]}function fn(v){const{trackMouse:p}=v,E=x.useRef(Object.assign({},Ut)),T=x.useRef(Object.assign({},wt)),F=x.useRef(Object.assign({},T.current));let ne;for(ne in F.current=Object.assign({},T.current),T.current=Object.assign(Object.assign({},wt),v),wt)T.current[ne]===void 0&&(T.current[ne]=wt[ne]);const[me,m]=x.useMemo(()=>function(f,k){const D=G=>{const H="touches"in G;H&&G.touches.length>1||f((X,re)=>{re.trackMouse&&!H&&(document.addEventListener(Yt,B),document.addEventListener(Jt,le));const{clientX:pe,clientY:Ee}=H?G.touches[0]:G,Le=_t([pe,Ee],re.rotationAngle);return re.onTouchStartOrOnMouseDown&&re.onTouchStartOrOnMouseDown({event:G}),Object.assign(Object.assign(Object.assign({},X),Ut),{initial:Le.slice(),xy:Le,start:G.timeStamp||0})})},B=G=>{f((H,X)=>{const re="touches"in G;if(re&&G.touches.length>1)return H;if(G.timeStamp-H.start>X.swipeDuration)return H.swiping?Object.assign(Object.assign({},H),{swiping:!1}):H;const{clientX:pe,clientY:Ee}=re?G.touches[0]:G,[Le,rt]=_t([pe,Ee],X.rotationAngle),et=Le-H.xy[0],qe=rt-H.xy[1],_e=Math.abs(et),Se=Math.abs(qe),qt=(G.timeStamp||0)-H.start,_n=Math.sqrt(_e*_e+Se*Se)/(qt||1),Pn=[et/(qt||1),qe/(qt||1)],Nt=function(Ln,Sn,Nn,it){return Ln>Sn?Nn>0?mt:xt:it>0?Re:ct}(_e,Se,et,qe),Zt=typeof X.delta=="number"?X.delta:X.delta[Nt.toLowerCase()]||wt.delta;if(_e<Zt&&Se<Zt&&!H.swiping)return H;const jt={absX:_e,absY:Se,deltaX:et,deltaY:qe,dir:Nt,event:G,first:H.first,initial:H.initial,velocity:_n,vxvy:Pn};jt.first&&X.onSwipeStart&&X.onSwipeStart(jt),X.onSwiping&&X.onSwiping(jt);let En=!1;return(X.onSwiping||X.onSwiped||X[`onSwiped${Nt}`])&&(En=!0),En&&X.preventScrollOnSwipe&&X.trackTouch&&G.cancelable&&G.preventDefault(),Object.assign(Object.assign({},H),{first:!1,eventData:jt,swiping:!0})})},M=G=>{f((H,X)=>{let re;if(H.swiping&&H.eventData){if(G.timeStamp-H.start<X.swipeDuration){re=Object.assign(Object.assign({},H.eventData),{event:G}),X.onSwiped&&X.onSwiped(re);const pe=X[`onSwiped${re.dir}`];pe&&pe(re)}}else X.onTap&&X.onTap({event:G});return X.onTouchEndOrOnMouseUp&&X.onTouchEndOrOnMouseUp({event:G}),Object.assign(Object.assign(Object.assign({},H),Ut),{eventData:re})})},le=G=>{document.removeEventListener(Yt,B),document.removeEventListener(Jt,le),M(G)},ae=(G,H)=>{let X=()=>{};if(G&&G.addEventListener){const re=Object.assign(Object.assign({},wt.touchEventOptions),H.touchEventOptions),pe=[["touchstart",D,re],["touchmove",B,Object.assign(Object.assign({},re),H.preventScrollOnSwipe?{passive:!1}:{})],["touchend",M,re]];pe.forEach(([Ee,Le,rt])=>G.addEventListener(Ee,Le,rt)),X=()=>pe.forEach(([Ee,Le])=>G.removeEventListener(Ee,Le))}return X},he={ref:G=>{G!==null&&f((H,X)=>{if(H.el===G)return H;const re={};return H.el&&H.el!==G&&H.cleanUpTouch&&(H.cleanUpTouch(),re.cleanUpTouch=void 0),X.trackTouch&&G&&(re.cleanUpTouch=ae(G,X)),Object.assign(Object.assign(Object.assign({},H),{el:G}),re)})}};return k.trackMouse&&(he.onMouseDown=D),[he,ae]}(f=>E.current=f(E.current,T.current),{trackMouse:p}),[p]);return E.current=function(f,k,D,B){return k.trackTouch&&f.el?f.cleanUpTouch?k.preventScrollOnSwipe!==D.preventScrollOnSwipe||k.touchEventOptions.passive!==D.touchEventOptions.passive?(f.cleanUpTouch(),Object.assign(Object.assign({},f),{cleanUpTouch:B(f.el,k)})):f:Object.assign(Object.assign({},f),{cleanUpTouch:B(f.el,k)}):(f.cleanUpTouch&&f.cleanUpTouch(),Object.assign(Object.assign({},f),{cleanUpTouch:void 0}))}(E.current,T.current,F.current,m),me}var I=c(697);function Et(v){return Et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},Et(v)}function J(v,p){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);p&&(T=T.filter(function(F){return Object.getOwnPropertyDescriptor(v,F).enumerable})),E.push.apply(E,T)}return E}function oe(v){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?J(Object(E),!0).forEach(function(T){a(v,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):J(Object(E)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(E,T))})}return v}function a(v,p,E){return(p=function(T){var F=function(ne,me){if(Et(ne)!=="object"||ne===null)return ne;var m=ne[Symbol.toPrimitive];if(m!==void 0){var f=m.call(ne,me);if(Et(f)!=="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ne)}(T,"string");return Et(F)==="symbol"?F:String(F)}(p))in v?Object.defineProperty(v,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[p]=E,v}var g={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},w=s().memo(function(v){var p=oe(oe({},g),v),E=p.description,T=p.fullscreen,F=p.handleImageLoaded,ne=p.isFullscreen,me=p.onImageError,m=p.original,f=p.originalAlt,k=p.originalHeight,D=p.originalWidth,B=p.originalTitle,M=p.sizes,le=p.srcSet,ae=p.loading,he=ne&&T||m;return s().createElement(s().Fragment,null,s().createElement("img",{className:"image-gallery-image",src:he,alt:f,srcSet:le,height:k,width:D,sizes:M,title:B,onLoad:function(G){return F(G,m)},onError:me,loading:ae}),E&&s().createElement("span",{className:"image-gallery-description"},E))});w.displayName="Item",w.propTypes={description:I.string,fullscreen:I.string,handleImageLoaded:I.func.isRequired,isFullscreen:I.bool,onImageError:I.func.isRequired,original:I.string.isRequired,originalAlt:I.string,originalHeight:I.string,originalWidth:I.string,originalTitle:I.string,sizes:I.string,srcSet:I.string,loading:I.string};const C=w;function L(v){return L=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},L(v)}function U(v,p){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);p&&(T=T.filter(function(F){return Object.getOwnPropertyDescriptor(v,F).enumerable})),E.push.apply(E,T)}return E}function K(v){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?U(Object(E),!0).forEach(function(T){de(v,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):U(Object(E)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(E,T))})}return v}function de(v,p,E){return(p=function(T){var F=function(ne,me){if(L(ne)!=="object"||ne===null)return ne;var m=ne[Symbol.toPrimitive];if(m!==void 0){var f=m.call(ne,me);if(L(f)!=="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ne)}(T,"string");return L(F)==="symbol"?F:String(F)}(p))in v?Object.defineProperty(v,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[p]=E,v}var se={left:s().createElement("polyline",{points:"15 18 9 12 15 6"}),right:s().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:s().createElement("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"}),minimize:s().createElement("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"}),play:s().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:s().createElement(s().Fragment,null,s().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),s().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},Ge={strokeWidth:1,viewBox:"0 0 24 24"},Me=function(v){var p=K(K({},Ge),v),E=p.strokeWidth,T=p.viewBox,F=p.icon;return s().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:T,fill:"none",stroke:"currentColor",strokeWidth:E,strokeLinecap:"round",strokeLinejoin:"round"},se[F])};Me.propTypes={strokeWidth:I.number,viewBox:I.string,icon:(0,I.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const we=Me;var Pe=s().memo(function(v){var p=v.isFullscreen,E=v.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:E,"aria-label":"Open Fullscreen"},s().createElement(we,{strokeWidth:2,icon:p?"minimize":"maximize"}))});Pe.displayName="Fullscreen",Pe.propTypes={isFullscreen:I.bool.isRequired,onClick:I.func.isRequired};const ze=Pe;var St=s().memo(function(v){var p=v.disabled,E=v.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:p,onClick:E,"aria-label":"Previous Slide"},s().createElement(we,{icon:"left",viewBox:"6 0 12 24"}))});St.displayName="LeftNav",St.propTypes={disabled:I.bool.isRequired,onClick:I.func.isRequired};const ut=St;var Tt=s().memo(function(v){var p=v.disabled,E=v.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:p,onClick:E,"aria-label":"Next Slide"},s().createElement(we,{icon:"right",viewBox:"6 0 12 24"}))});Tt.displayName="RightNav",Tt.propTypes={disabled:I.bool.isRequired,onClick:I.func.isRequired};const Cn=Tt;var Wt=s().memo(function(v){var p=v.isPlaying,E=v.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:E,"aria-label":"Play or Pause Slideshow"},s().createElement(we,{strokeWidth:2,icon:p?"pause":"play"}))});Wt.displayName="PlayPause",Wt.propTypes={isPlaying:I.bool.isRequired,onClick:I.func.isRequired};const Xn=Wt;function zt(v){return zt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},zt(v)}function mn(){return mn=Object.assign?Object.assign.bind():function(v){for(var p=1;p<arguments.length;p++){var E=arguments[p];for(var T in E)Object.prototype.hasOwnProperty.call(E,T)&&(v[T]=E[T])}return v},mn.apply(this,arguments)}function Ze(v,p){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);p&&(T=T.filter(function(F){return Object.getOwnPropertyDescriptor(v,F).enumerable})),E.push.apply(E,T)}return E}function gn(v){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Ze(Object(E),!0).forEach(function(T){vn(v,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):Ze(Object(E)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(E,T))})}return v}function vn(v,p,E){return(p=function(T){var F=function(ne,me){if(zt(ne)!=="object"||ne===null)return ne;var m=ne[Symbol.toPrimitive];if(m!==void 0){var f=m.call(ne,me);if(zt(f)!=="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ne)}(T,"string");return zt(F)==="symbol"?F:String(F)}(p))in v?Object.defineProperty(v,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[p]=E,v}var yn={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},bn=function(v){var p=gn(gn({},yn),v),E=p.children,T=p.className,F=fn({delta:p.delta,onSwiping:p.onSwiping,onSwiped:p.onSwiped});return s().createElement("div",mn({},F,{className:T}),E)};bn.propTypes={children:I.node.isRequired,className:I.string,delta:I.number,onSwiped:I.func,onSwiping:I.func};const xn=bn;function Pt(v){return Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},Pt(v)}function Lt(v,p){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);p&&(T=T.filter(function(F){return Object.getOwnPropertyDescriptor(v,F).enumerable})),E.push.apply(E,T)}return E}function Qt(v){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Lt(Object(E),!0).forEach(function(T){qi(v,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):Lt(Object(E)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(E,T))})}return v}function wn(v,p){for(var E=0;E<p.length;E++){var T=p[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(v,Ki(T.key),T)}}function In(v,p){return In=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,T){return E.__proto__=T,E},In(v,p)}function Ta(v,p){if(p&&(Pt(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ae(v)}function Ae(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function Yn(v){return Yn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(p){return p.__proto__||Object.getPrototypeOf(p)},Yn(v)}function qi(v,p,E){return(p=Ki(p))in v?Object.defineProperty(v,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[p]=E,v}function Ki(v){var p=function(E,T){if(Pt(E)!=="object"||E===null)return E;var F=E[Symbol.toPrimitive];if(F!==void 0){var ne=F.call(E,T);if(Pt(ne)!=="object")return ne;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}(v,"string");return Pt(p)==="symbol"?p:String(p)}var Vi=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],ja=(0,I.arrayOf)((0,I.shape)({srcSet:I.string,media:I.string}));function Gi(v){var p=parseInt(v.keyCode||v.which||0,10);return p===66||p===62}var br=function(v){(function(m,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(f&&f.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),Object.defineProperty(m,"prototype",{writable:!1}),f&&In(m,f)})(me,v);var p,E,T,F,ne=(T=me,F=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var m,f=Yn(T);if(F){var k=Yn(this).constructor;m=Reflect.construct(f,arguments,k)}else m=f.apply(this,arguments);return Ta(this,m)});function me(m){var f;return function(k,D){if(!(k instanceof D))throw new TypeError("Cannot call a class as a function")}(this,me),qi(Ae(f=ne.call(this,m)),"onBulletClick",function(k,D){var B=f.props,M=B.onBulletClick,le=B.items,ae=f.state.currentIndex;k.target.blur(),ae!==D&&(le.length===2?f.slideToIndexWithStyleReset(D,k):f.slideToIndex(D,k)),M&&M(k,D)}),f.state={currentIndex:m.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(m.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},f.loadedImages={},f.imageGallery=s().createRef(),f.thumbnailsWrapper=s().createRef(),f.thumbnails=s().createRef(),f.imageGallerySlideWrapper=s().createRef(),f.handleImageLoaded=f.handleImageLoaded.bind(Ae(f)),f.handleKeyDown=f.handleKeyDown.bind(Ae(f)),f.handleMouseDown=f.handleMouseDown.bind(Ae(f)),f.handleResize=f.handleResize.bind(Ae(f)),f.handleTouchMove=f.handleTouchMove.bind(Ae(f)),f.handleOnSwiped=f.handleOnSwiped.bind(Ae(f)),f.handleScreenChange=f.handleScreenChange.bind(Ae(f)),f.handleSwiping=f.handleSwiping.bind(Ae(f)),f.handleThumbnailSwiping=f.handleThumbnailSwiping.bind(Ae(f)),f.handleOnThumbnailSwiped=f.handleOnThumbnailSwiped.bind(Ae(f)),f.onThumbnailMouseLeave=f.onThumbnailMouseLeave.bind(Ae(f)),f.handleImageError=f.handleImageError.bind(Ae(f)),f.pauseOrPlay=f.pauseOrPlay.bind(Ae(f)),f.renderThumbInner=f.renderThumbInner.bind(Ae(f)),f.renderItem=f.renderItem.bind(Ae(f)),f.slideLeft=f.slideLeft.bind(Ae(f)),f.slideRight=f.slideRight.bind(Ae(f)),f.toggleFullScreen=f.toggleFullScreen.bind(Ae(f)),f.togglePlay=f.togglePlay.bind(Ae(f)),f.unthrottledSlideToIndex=f.slideToIndex,f.slideToIndex=Oe(f.unthrottledSlideToIndex,m.slideDuration,{trailing:!1}),m.lazyLoad&&(f.lazyLoaded=[]),f}return p=me,E=[{key:"componentDidMount",value:function(){var m=this.props,f=m.autoPlay,k=m.useWindowKeyDown;f&&this.play(),k?window.addEventListener("keydown",this.handleKeyDown):this.imageGallery.current.addEventListener("keydown",this.handleKeyDown),window.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),this.addScreenChangeEvent()}},{key:"componentDidUpdate",value:function(m,f){var k=this.props,D=k.items,B=k.lazyLoad,M=k.slideDuration,le=k.slideInterval,ae=k.startIndex,he=k.thumbnailPosition,G=k.showThumbnails,H=k.useWindowKeyDown,X=this.state,re=X.currentIndex,pe=X.isPlaying,Ee=m.items.length!==D.length,Le=!lt()(m.items,D),rt=m.startIndex!==ae,et=m.thumbnailPosition!==he,qe=m.showThumbnails!==G;le===m.slideInterval&&M===m.slideDuration||pe&&(this.pause(),this.play()),et&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),qe&&G&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),qe&&!G&&this.removeThumbnailsResizeObserver(),(Ee||qe)&&this.handleResize(),f.currentIndex!==re&&this.slideThumbnailBar(),m.slideDuration!==M&&(this.slideToIndex=Oe(this.unthrottledSlideToIndex,M,{trailing:!1})),!B||m.lazyLoad&&!Le||(this.lazyLoaded=[]),H!==m.useWindowKeyDown&&(H?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(rt||Le)&&this.setState({currentIndex:ae,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var m=this.props.useWindowKeyDown;window.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("touchmove",this.handleTouchMove),this.removeScreenChangeEvent(),this.removeResizeObserver(),this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null),this.transitionTimer&&window.clearTimeout(this.transitionTimer),m?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var m=this,f=this.state,k=f.currentIndex,D=f.isTransitioning,B=this.props,M=B.onSlide,le=B.slideDuration;this.transitionTimer=window.setTimeout(function(){D&&(m.setState({isTransitioning:!D,isSwipingThumbnail:!1}),M&&M(k))},le+50)}},{key:"onThumbnailClick",value:function(m,f){var k=this.props,D=k.onThumbnailClick,B=k.items,M=this.state.currentIndex;m.target.parentNode.parentNode.blur(),M!==f&&(B.length===2?this.slideToIndexWithStyleReset(f,m):this.slideToIndex(f,m)),D&&D(m,f)}},{key:"onThumbnailMouseOver",value:function(m,f){var k=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){k.slideToIndex(f),k.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var m=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,m&&this.play()}}},{key:"setThumbsTranslate",value:function(m){this.setState({thumbsTranslate:m})}},{key:"setModalFullscreen",value:function(m){var f=this.props.onScreenChange;this.setState({modalFullscreen:m}),f&&f(m)}},{key:"getThumbsTranslate",value:function(m){var f,k=this.props,D=k.disableThumbnailScroll,B=k.items,M=this.state,le=M.thumbnailsWrapperWidth,ae=M.thumbnailsWrapperHeight,he=this.thumbnails&&this.thumbnails.current;if(D)return 0;if(he){if(this.isThumbnailVertical()){if(he.scrollHeight<=ae)return 0;f=he.scrollHeight-ae}else{if(he.scrollWidth<=le||le<=0)return 0;f=he.scrollWidth-le}return m*(f/(B.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(m){switch(m){case"left":m=" ".concat("image-gallery-thumbnails-left");break;case"right":m=" ".concat("image-gallery-thumbnails-right");break;case"bottom":m=" ".concat("image-gallery-thumbnails-bottom");break;case"top":m=" ".concat("image-gallery-thumbnails-top")}return m}},{key:"getAlignmentClassName",value:function(m){var f=this.state.currentIndex,k=this.props,D=k.infinite,B=k.items,M="",le="image-gallery-left",ae="image-gallery-right";switch(m){case f-1:M=" ".concat(le);break;case f:M=" ".concat("image-gallery-center");break;case f+1:M=" ".concat(ae)}return B.length>=3&&D&&(m===0&&f===B.length-1?M=" ".concat(ae):m===B.length-1&&f===0&&(M=" ".concat(le))),M}},{key:"getTranslateXForTwoSlide",value:function(m){var f=this.state,k=f.currentIndex,D=f.currentSlideOffset,B=f.previousIndex,M=k!==B,le=m===0&&B===0,ae=m===1&&B===1,he=m===0&&k===1,G=m===1&&k===0,H=D===0,X=-100*k+100*m+D;return D>0?this.direction="left":D<0&&(this.direction="right"),G&&D>0&&(X=-100+D),he&&D<0&&(X=100+D),M?le&&H&&this.direction==="left"?X=100:ae&&H&&this.direction==="right"&&(X=-100):(G&&H&&this.direction==="left"&&(X=-100),he&&H&&this.direction==="right"&&(X=100)),X}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(m){var f=this.state,k=f.currentIndex,D=f.currentSlideOffset,B=f.slideStyle,M=this.props,le=M.infinite,ae=M.items,he=M.useTranslate3D,G=M.isRTL,H=-100*k,X=ae.length-1,re=(H+100*m)*(G?-1:1)+D;le&&ae.length>2&&(k===0&&m===X?re=-100*(G?-1:1)+D:k===X&&m===0&&(re=100*(G?-1:1)+D)),le&&ae.length===2&&(re=this.getTranslateXForTwoSlide(m));var pe="translate(".concat(re,"%, 0)");return he&&(pe="translate3d(".concat(re,"%, 0, 0)")),Qt({display:this.isSlideVisible(m)?"inherit":"none",WebkitTransform:pe,MozTransform:pe,msTransform:pe,OTransform:pe,transform:pe},B)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var m,f=this.props,k=f.useTranslate3D,D=f.isRTL,B=this.state,M=B.thumbsTranslate,le=B.thumbsStyle,ae=D?-1*M:M;return this.isThumbnailVertical()?(m="translate(0, ".concat(M,"px)"),k&&(m="translate3d(0, ".concat(M,"px, 0)"))):(m="translate(".concat(ae,"px, 0)"),k&&(m="translate3d(".concat(ae,"px, 0, 0)"))),Qt({WebkitTransform:m,MozTransform:m,msTransform:m,OTransform:m,transform:m},le)}},{key:"getSlideItems",value:function(){var m=this,f=this.state.currentIndex,k=this.props,D=k.items,B=k.slideOnThumbnailOver,M=k.onClick,le=k.lazyLoad,ae=k.onTouchMove,he=k.onTouchEnd,G=k.onTouchStart,H=k.onMouseOver,X=k.onMouseLeave,re=k.renderItem,pe=k.renderThumbInner,Ee=k.showThumbnails,Le=k.showBullets,rt=[],et=[],qe=[];return D.forEach(function(_e,Se){var qt=m.getAlignmentClassName(Se),_n=_e.originalClass?" ".concat(_e.originalClass):"",Pn=_e.thumbnailClass?" ".concat(_e.thumbnailClass):"",Nt=_e.renderItem||re||m.renderItem,Zt=_e.renderThumbInner||pe||m.renderThumbInner,jt=!le||qt||m.lazyLoaded[Se];jt&&le&&!m.lazyLoaded[Se]&&(m.lazyLoaded[Se]=!0);var En=m.getSlideStyle(Se),Ln=s().createElement("div",{"aria-label":"Go to Slide ".concat(Se+1),key:"slide-".concat(Se),tabIndex:"-1",className:"image-gallery-slide ".concat(qt," ").concat(_n),style:En,onClick:M,onKeyUp:m.handleSlideKeyUp,onTouchMove:ae,onTouchEnd:he,onTouchStart:G,onMouseOver:H,onFocus:H,onMouseLeave:X,role:"button"},jt?Nt(_e):s().createElement("div",{style:{height:"100%"}}));if(rt.push(Ln),Ee&&_e.thumbnail){var Sn=b("image-gallery-thumbnail",Pn,{active:f===Se});et.push(s().createElement("button",{key:"thumbnail-".concat(Se),type:"button",tabIndex:"0","aria-pressed":f===Se?"true":"false","aria-label":"Go to Slide ".concat(Se+1),className:Sn,onMouseLeave:B?m.onThumbnailMouseLeave:null,onMouseOver:function(it){return m.handleThumbnailMouseOver(it,Se)},onFocus:function(it){return m.handleThumbnailMouseOver(it,Se)},onKeyUp:function(it){return m.handleThumbnailKeyUp(it,Se)},onClick:function(it){return m.onThumbnailClick(it,Se)}},Zt(_e)))}if(Le){var Nn=b("image-gallery-bullet",_e.bulletClass,{active:f===Se});qe.push(s().createElement("button",{type:"button",key:"bullet-".concat(Se),className:Nn,onClick:function(it){return m.onBulletClick(it,Se)},"aria-pressed":f===Se?"true":"false","aria-label":"Go to Slide ".concat(Se+1)}))}}),{slides:rt,thumbnails:et,bullets:qe}}},{key:"ignoreIsTransitioning",value:function(){var m=this.props.items,f=this.state,k=f.previousIndex,D=f.currentIndex,B=m.length-1;return Math.abs(k-D)>1&&!(k===0&&D===B)&&!(k===B&&D===0)}},{key:"isFirstOrLastSlide",value:function(m){return m===this.props.items.length-1||m===0}},{key:"slideIsTransitioning",value:function(m){var f=this.state,k=f.isTransitioning,D=f.previousIndex,B=f.currentIndex;return k&&!(m===D||m===B)}},{key:"isSlideVisible",value:function(m){return!this.slideIsTransitioning(m)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(m)}},{key:"slideThumbnailBar",value:function(){var m=this.state,f=m.currentIndex,k=m.isSwipingThumbnail,D=-this.getThumbsTranslate(f);k||(f===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:D,thumbsSwipedTranslate:D}))}},{key:"canSlide",value:function(){return this.props.items.length>=2}},{key:"canSlideLeft",value:function(){return this.props.infinite||this.canSlidePrevious()}},{key:"canSlideRight",value:function(){return this.props.infinite||this.canSlideNext()}},{key:"canSlidePrevious",value:function(){return this.state.currentIndex>0}},{key:"canSlideNext",value:function(){return this.state.currentIndex<this.props.items.length-1}},{key:"handleSwiping",value:function(m){var f=m.event,k=m.absX,D=m.dir,B=this.props,M=B.disableSwipe,le=B.stopPropagation,ae=this.state,he=ae.galleryWidth,G=ae.isTransitioning,H=ae.swipingUpDown,X=ae.swipingLeftRight;if(D!==ct&&D!==Re&&!H||X){if(D!==xt&&D!==mt||X||this.setState({swipingLeftRight:!0}),!M){var re=this.props.swipingTransitionDuration;if(le&&f.preventDefault(),G)this.setState({currentSlideOffset:0});else{var pe=D===mt?1:-1,Ee=k/he*100;Math.abs(Ee)>=100&&(Ee=100);var Le={transition:"transform ".concat(re,"ms ease-out")};this.setState({currentSlideOffset:pe*Ee,slideStyle:Le})}}}else H||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(m){var f=m.event,k=m.absX,D=m.absY,B=m.dir,M=this.props,le=M.stopPropagation,ae=M.swipingThumbnailTransitionDuration,he=this.state,G=he.thumbsSwipedTranslate,H=he.thumbnailsWrapperHeight,X=he.thumbnailsWrapperWidth,re=he.swipingUpDown,pe=he.swipingLeftRight;if(this.isThumbnailVertical()){if((B===xt||B===mt||pe)&&!re)return void(pe||this.setState({swipingLeftRight:!0}));B!==ct&&B!==Re||re||this.setState({swipingUpDown:!0})}else{if((B===ct||B===Re||re)&&!pe)return void(re||this.setState({swipingUpDown:!0}));B!==xt&&B!==mt||pe||this.setState({swipingLeftRight:!0})}var Ee,Le,rt,et,qe,_e=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(Ee=G+(B===Re?D:-D),Le=_e.scrollHeight-H+20,rt=Math.abs(Ee)>Le,et=Ee>20,qe=_e.scrollHeight<=H):(Ee=G+(B===mt?k:-k),Le=_e.scrollWidth-X+20,rt=Math.abs(Ee)>Le,et=Ee>20,qe=_e.scrollWidth<=X),!qe&&(B!==xt&&B!==ct||!rt)&&(B!==mt&&B!==Re||!et)){le&&f.stopPropagation();var Se={transition:"transform ".concat(ae,"ms ease-out")};this.setState({thumbsTranslate:Ee,thumbsStyle:Se})}}},{key:"handleOnThumbnailSwiped",value:function(){var m=this.state.thumbsTranslate,f=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:m,thumbsStyle:{transition:"all ".concat(f,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var m=this.state.currentSlideOffset,f=this.props.swipeThreshold;return Math.abs(m)>f}},{key:"resetSwipingDirection",value:function(){var m=this.state,f=m.swipingUpDown,k=m.swipingLeftRight;f&&this.setState({swipingUpDown:!1}),k&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(m){var f=m.event,k=m.dir,D=m.velocity,B=this.props,M=B.disableSwipe,le=B.stopPropagation,ae=B.flickThreshold;if(!M){var he=this.props.isRTL;le&&f.stopPropagation(),this.resetSwipingDirection();var G=(k===xt?1:-1)*(he?-1:1),H=D>ae&&!(k===ct||k===Re);this.handleOnSwipedTo(G,H)}}},{key:"handleOnSwipedTo",value:function(m,f){var k=this.state,D=k.currentIndex,B=k.isTransitioning,M=D;!this.sufficientSwipe()&&!f||B||(M+=m),(m===-1&&!this.canSlideLeft()||m===1&&!this.canSlideRight())&&(M=D),this.unthrottledSlideToIndex(M)}},{key:"handleTouchMove",value:function(m){this.state.swipingLeftRight&&m.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(m){var f=this.props,k=f.disableKeyDown,D=f.useBrowserFullscreen,B=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!k)switch(parseInt(m.keyCode||m.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(m);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(m);break;case 27:B&&!D&&this.exitFullScreen()}}},{key:"handleImageError",value:function(m){var f=this.props.onErrorImageURL;f&&m.target.src.indexOf(f)===-1&&(m.target.src=f)}},{key:"removeThumbnailsResizeObserver",value:function(){this.resizeThumbnailWrapperObserver&&this.thumbnailsWrapper&&this.thumbnailsWrapper.current&&(this.resizeThumbnailWrapperObserver.unobserve(this.thumbnailsWrapper.current),this.resizeThumbnailWrapperObserver=null)}},{key:"removeResizeObserver",value:function(){this.resizeSlideWrapperObserver&&this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&(this.resizeSlideWrapperObserver.unobserve(this.imageGallerySlideWrapper.current),this.resizeSlideWrapperObserver=null),this.removeThumbnailsResizeObserver()}},{key:"handleResize",value:function(){var m=this.state.currentIndex;this.imageGallery&&(this.imageGallery&&this.imageGallery.current&&this.setState({galleryWidth:this.imageGallery.current.offsetWidth}),this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&this.setState({gallerySlideWrapperHeight:this.imageGallerySlideWrapper.current.offsetHeight}),this.setThumbsTranslate(-this.getThumbsTranslate(m)))}},{key:"initSlideWrapperResizeObserver",value:function(m){var f=this;m&&!m.current||(this.resizeSlideWrapperObserver=new pn(q(function(k){k&&k.forEach(function(D){f.setState({thumbnailsWrapperWidth:D.contentRect.width},f.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(m.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(m){var f=this;m&&!m.current||(this.resizeThumbnailWrapperObserver=new pn(q(function(k){k&&k.forEach(function(D){f.setState({thumbnailsWrapperHeight:D.contentRect.height},f.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(m.current))}},{key:"toggleFullScreen",value:function(){this.state.isFullscreen?this.exitFullScreen():this.fullScreen()}},{key:"togglePlay",value:function(){this.playPauseIntervalId?this.pause():this.play()}},{key:"handleScreenChange",value:function(){var m=this.props,f=m.onScreenChange,k=m.useBrowserFullscreen,D=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,B=this.imageGallery.current===D;f&&f(B),k&&this.setState({isFullscreen:B})}},{key:"slideToIndex",value:function(m,f){var k=this.state,D=k.currentIndex,B=k.isTransitioning,M=this.props,le=M.items,ae=M.slideDuration,he=M.onBeforeSlide;if(!B){f&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var G=le.length-1,H=m;m<0?H=G:m>G&&(H=0),he&&H!==D&&he(H),this.setState({previousIndex:D,currentIndex:H,isTransitioning:H!==D,currentSlideOffset:0,slideStyle:{transition:"all ".concat(ae,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(m){var f=this.props.isRTL;this.slideTo(m,f?"right":"left")}},{key:"slideRight",value:function(m){var f=this.props.isRTL;this.slideTo(m,f?"left":"right")}},{key:"slideTo",value:function(m,f){var k=this.state,D=k.currentIndex,B=k.isTransitioning,M=this.props.items,le=D+(f==="left"?-1:1);B||(M.length===2?this.slideToIndexWithStyleReset(le,m):this.slideToIndex(le,m))}},{key:"slideToIndexWithStyleReset",value:function(m,f){var k=this,D=this.state,B=D.currentIndex,M=D.currentSlideOffset;this.setState({currentSlideOffset:M+(B>m?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return k.slideToIndex(m,f)},25)})}},{key:"handleThumbnailMouseOver",value:function(m,f){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(m,f)}},{key:"handleThumbnailKeyUp",value:function(m,f){Gi(m)&&this.onThumbnailClick(m,f)}},{key:"handleSlideKeyUp",value:function(m){Gi(m)&&(0,this.props.onClick)(m)}},{key:"isThumbnailVertical",value:function(){var m=this.props.thumbnailPosition;return m==="left"||m==="right"}},{key:"addScreenChangeEvent",value:function(){var m=this;Vi.forEach(function(f){document.addEventListener(f,m.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var m=this;Vi.forEach(function(f){document.removeEventListener(f,m.handleScreenChange)})}},{key:"fullScreen",value:function(){var m=this.props.useBrowserFullscreen,f=this.imageGallery.current;m?f.requestFullscreen?f.requestFullscreen():f.msRequestFullscreen?f.msRequestFullscreen():f.mozRequestFullScreen?f.mozRequestFullScreen():f.webkitRequestFullscreen?f.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var m=this.state.isFullscreen,f=this.props.useBrowserFullscreen;m&&(f?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():this.setModalFullscreen(!1):this.setModalFullscreen(!1),this.setState({isFullscreen:!1}))}},{key:"pauseOrPlay",value:function(){var m=this.props.infinite,f=this.state.currentIndex;m||this.canSlideRight()?this.slideToIndex(f+1):this.pause()}},{key:"play",value:function(){var m=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],f=this.props,k=f.onPlay,D=f.slideInterval,B=f.slideDuration,M=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(D,B)),k&&m&&k(M))}},{key:"pause",value:function(){var m=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],f=this.props.onPause,k=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),f&&m&&f(k))}},{key:"isImageLoaded",value:function(m){return!!this.loadedImages[m.original]||(this.loadedImages[m.original]=!0,!1)}},{key:"handleImageLoaded",value:function(m,f){var k=this.props.onImageLoad;!this.loadedImages[f]&&k&&(this.loadedImages[f]=!0,k(m))}},{key:"renderItem",value:function(m){var f=this.state.isFullscreen,k=this.props.onImageError||this.handleImageError;return s().createElement(C,{description:m.description,fullscreen:m.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:f,onImageError:k,original:m.original,originalAlt:m.originalAlt,originalHeight:m.originalHeight,originalWidth:m.originalWidth,originalTitle:m.originalTitle,sizes:m.sizes,loading:m.loading,srcSet:m.srcSet})}},{key:"renderThumbInner",value:function(m){var f=this.props.onThumbnailError||this.handleImageError;return s().createElement("span",{className:"image-gallery-thumbnail-inner"},s().createElement("img",{className:"image-gallery-thumbnail-image",src:m.thumbnail,height:m.thumbnailHeight,width:m.thumbnailWidth,alt:m.thumbnailAlt,title:m.thumbnailTitle,loading:m.thumbnailLoading,onError:f}),m.thumbnailLabel&&s().createElement("div",{className:"image-gallery-thumbnail-label"},m.thumbnailLabel))}},{key:"render",value:function(){var m=this.state,f=m.currentIndex,k=m.isFullscreen,D=m.modalFullscreen,B=m.isPlaying,M=this.props,le=M.additionalClass,ae=M.disableThumbnailSwipe,he=M.indexSeparator,G=M.isRTL,H=M.items,X=M.thumbnailPosition,re=M.renderFullscreenButton,pe=M.renderCustomControls,Ee=M.renderLeftNav,Le=M.renderRightNav,rt=M.showBullets,et=M.showFullscreenButton,qe=M.showIndex,_e=M.showThumbnails,Se=M.showNav,qt=M.showPlayButton,_n=M.renderPlayPauseButton,Pn=this.getThumbnailStyle(),Nt=this.getSlideItems(),Zt=Nt.slides,jt=Nt.thumbnails,En=Nt.bullets,Ln=b("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(X),{"image-gallery-rtl":G}),Sn=s().createElement("div",{ref:this.imageGallerySlideWrapper,className:Ln},pe&&pe(),this.canSlide()?s().createElement(s().Fragment,null,Se&&s().createElement(s().Fragment,null,Ee(this.slideLeft,!this.canSlideLeft()),Le(this.slideRight,!this.canSlideRight())),s().createElement(xn,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},s().createElement("div",{className:"image-gallery-slides"},Zt))):s().createElement("div",{className:"image-gallery-slides"},Zt),qt&&_n(this.togglePlay,B),rt&&s().createElement("div",{className:"image-gallery-bullets"},s().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},En)),et&&re(this.toggleFullScreen,k),qe&&s().createElement("div",{className:"image-gallery-index"},s().createElement("span",{className:"image-gallery-index-current"},f+1),s().createElement("span",{className:"image-gallery-index-separator"},he),s().createElement("span",{className:"image-gallery-index-total"},H.length))),Nn=b("image-gallery",le,{"fullscreen-modal":D}),it=b("image-gallery-content",this.getThumbnailPositionClassName(X),{fullscreen:k}),Ra=b("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(X),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&G},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!ae},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!ae});return s().createElement("div",{ref:this.imageGallery,className:Nn,"aria-live":"polite"},s().createElement("div",{className:it},(X==="bottom"||X==="right")&&Sn,_e&&jt.length>0?s().createElement(xn,{className:Ra,delta:0,onSwiping:!ae&&this.handleThumbnailSwiping,onSwiped:!ae&&this.handleOnThumbnailSwiped},s().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},s().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:Pn,"aria-label":"Thumbnail Navigation"},jt))):null,(X==="top"||X==="left")&&Sn))}}],E&&wn(p.prototype,E),Object.defineProperty(p,"prototype",{writable:!1}),me}(s().Component);br.propTypes={flickThreshold:I.number,items:(0,I.arrayOf)((0,I.shape)({bulletClass:I.string,bulletOnClick:I.func,description:I.string,original:I.string,originalHeight:I.number,originalWidth:I.number,loading:I.string,thumbnailHeight:I.number,thumbnailWidth:I.number,thumbnailLoading:I.string,fullscreen:I.string,originalAlt:I.string,originalTitle:I.string,thumbnail:I.string,thumbnailAlt:I.string,thumbnailLabel:I.string,thumbnailTitle:I.string,originalClass:I.string,thumbnailClass:I.string,renderItem:I.func,renderThumbInner:I.func,imageSet:ja,srcSet:I.string,sizes:I.string})).isRequired,showNav:I.bool,autoPlay:I.bool,lazyLoad:I.bool,infinite:I.bool,showIndex:I.bool,showBullets:I.bool,showThumbnails:I.bool,showPlayButton:I.bool,showFullscreenButton:I.bool,disableThumbnailScroll:I.bool,disableKeyDown:I.bool,disableSwipe:I.bool,disableThumbnailSwipe:I.bool,useBrowserFullscreen:I.bool,onErrorImageURL:I.string,indexSeparator:I.string,thumbnailPosition:(0,I.oneOf)(["top","bottom","left","right"]),startIndex:I.number,slideDuration:I.number,slideInterval:I.number,slideOnThumbnailOver:I.bool,swipeThreshold:I.number,swipingTransitionDuration:I.number,swipingThumbnailTransitionDuration:I.number,onSlide:I.func,onBeforeSlide:I.func,onScreenChange:I.func,onPause:I.func,onPlay:I.func,onClick:I.func,onImageLoad:I.func,onImageError:I.func,onTouchMove:I.func,onTouchEnd:I.func,onTouchStart:I.func,onMouseOver:I.func,onMouseLeave:I.func,onBulletClick:I.func,onThumbnailError:I.func,onThumbnailClick:I.func,renderCustomControls:I.func,renderLeftNav:I.func,renderRightNav:I.func,renderPlayPauseButton:I.func,renderFullscreenButton:I.func,renderItem:I.func,renderThumbInner:I.func,stopPropagation:I.bool,additionalClass:I.string,useTranslate3D:I.bool,isRTL:I.bool,useWindowKeyDown:I.bool},br.defaultProps={onErrorImageURL:"",additionalClass:"",showNav:!0,autoPlay:!1,lazyLoad:!1,infinite:!0,showIndex:!1,showBullets:!1,showThumbnails:!0,showPlayButton:!0,showFullscreenButton:!0,disableThumbnailScroll:!1,disableKeyDown:!1,disableSwipe:!1,disableThumbnailSwipe:!1,useTranslate3D:!0,isRTL:!1,useBrowserFullscreen:!0,flickThreshold:.4,stopPropagation:!1,indexSeparator:" / ",thumbnailPosition:"bottom",startIndex:0,slideDuration:450,swipingTransitionDuration:0,swipingThumbnailTransitionDuration:0,onSlide:null,onBeforeSlide:null,onScreenChange:null,onPause:null,onPlay:null,onClick:null,onImageLoad:null,onImageError:null,onTouchMove:null,onTouchEnd:null,onTouchStart:null,onMouseOver:null,onMouseLeave:null,onBulletClick:null,onThumbnailError:null,onThumbnailClick:null,renderCustomControls:null,renderThumbInner:null,renderItem:null,slideInterval:3e3,slideOnThumbnailOver:!1,swipeThreshold:30,renderLeftNav:function(v,p){return s().createElement(ut,{onClick:v,disabled:p})},renderRightNav:function(v,p){return s().createElement(Cn,{onClick:v,disabled:p})},renderPlayPauseButton:function(v,p){return s().createElement(Xn,{onClick:v,isPlaying:p})},renderFullscreenButton:function(v,p){return s().createElement(ze,{onClick:v,isFullscreen:p})},useWindowKeyDown:!0};const Oa=br})(),h})())})(oa);var sh=oa.exports;const ah=lr(sh);function lh(){var e=new Map;function t(n){var r=n.root,o=n.rootMargin,c=n.threshold,h=e.get(r);h||(h=new Map,e.set(r,h));var d=JSON.stringify({rootMargin:o,threshold:c}),b=h.get(d);if(!b){var x=new Map,s=new IntersectionObserver(function(l){l.forEach(function(O){var y=x.get(O.target);y==null||y(O)})},{root:r,rootMargin:o,threshold:c});b={observer:s,entryCallbacks:x},h.set(d,b)}return{observe:function(O,y){var S,R;(S=b)==null||S.entryCallbacks.set(O,y),(R=b)==null||R.observer.observe(O)},unobserve:function(O){var y,S;(y=b)==null||y.entryCallbacks.delete(O),(S=b)==null||S.observer.unobserve(O)}}}return{getObserver:t}}var ch="0px",uh=[0],dh=lh();function hh(e){var t,n,r=(t=e==null?void 0:e.rootMargin)!=null?t:ch,o=(n=e==null?void 0:e.threshold)!=null?n:uh,c=N.useRef(null),h=N.useRef(null),d=N.useRef(null),b=N.useState(),x=b[0],s=b[1],l=N.useCallback(function(){var R=c.current;if(!R){s(void 0);return}var P=dh.getObserver({root:h.current,rootMargin:r,threshold:o});P.observe(R,function(A){s(A)}),d.current=P},[r,o]),O=N.useCallback(function(){var R=d.current,P=c.current;P&&(R==null||R.unobserve(P)),d.current=null},[]),y=N.useCallback(function(R){O(),c.current=R,l()},[l,O]),S=N.useCallback(function(R){O(),h.current=R,l()},[l,O]);return[y,{entry:x,rootRef:S}]}function qr(){return qr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qr.apply(this,arguments)}function ph(e){var t,n=hh(e),r=n[0],o=n[1],c=!!((t=o.entry)!=null&&t.isIntersecting),h=N.useState(c),d=h[0],b=h[1];return c&&!d&&b(!0),[r,qr({},o,{isVisible:c,wasEverVisible:d})]}var fh=100;function mh(e){var t=e.loading,n=e.hasNextPage,r=e.onLoadMore,o=e.rootMargin,c=e.disabled,h=e.delayInMs,d=h===void 0?fh:h,b=ph({rootMargin:o}),x=b[0],s=b[1],l=s.rootRef,O=s.isVisible,y=!c&&!t&&O&&n;return N.useEffect(function(){if(y){var S=setTimeout(function(){r()},d);return function(){clearTimeout(S)}}},[r,y,d]),[x,{rootRef:l}]}const gh={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>'},vh={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M18.333 2c1.96 0 3.56 1.537 3.662 3.472l.005.195v12.666c0 1.96-1.537 3.56-3.472 3.662l-.195.005H5.667a3.667 3.667 0 0 1-3.662-3.472L2 18.333V5.667c0-1.96 1.537-3.56 3.472-3.662L5.667 2h12.666zm-2.626 7.293a1 1 0 0 0-1.414 0L11 12.585l-1.293-1.292l-.094-.083a1 1 0 0 0-1.32 1.497l2 2l.094.083a1 1 0 0 0 1.32-.083l4-4l.083-.094a1 1 0 0 0-.083-1.32z"/></g>'};var Rr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function kr(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function sa(e,t){for(var n=t.slice(0,t.length-1),r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function aa(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");for(var t=e.split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function yh(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,o=!0,c=0;c<n.length;c++)r.indexOf(n[c])===-1&&(o=!1);return o}var Ai={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Rr?173:189,"=":Rr?61:187,";":Rr?59:186,"'":222,"[":219,"]":221,"\\":220},Vt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Kr={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Ke={16:!1,18:!1,17:!1,91:!1},De={};for(var Qn=1;Qn<20;Qn++)Ai["f".concat(Qn)]=111+Qn;var Ce=[],Co=!1,la="all",ca=[],yr=function(t){return Ai[t.toLowerCase()]||Vt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function ua(e){la=e||"all"}function qn(){return la||"all"}function bh(){return Ce.slice(0)}function xh(e){var t=e.target||e.srcElement,n=t.tagName,r=!0;return(t.isContentEditable||(n==="INPUT"||n==="TEXTAREA"||n==="SELECT")&&!t.readOnly)&&(r=!1),r}function wh(e){return typeof e=="string"&&(e=yr(e)),Ce.indexOf(e)!==-1}function Eh(e,t){var n,r;e||(e=qn());for(var o in De)if(Object.prototype.hasOwnProperty.call(De,o))for(n=De[o],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;qn()===e&&ua(t||"all")}function Sh(e){var t=e.keyCode||e.which||e.charCode,n=Ce.indexOf(t);if(n>=0&&Ce.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&Ce.splice(0,Ce.length),(t===93||t===224)&&(t=91),t in Ke){Ke[t]=!1;for(var r in Vt)Vt[r]===t&&(at[r]=!1)}}function Th(e){if(typeof e>"u")Object.keys(De).forEach(function(h){return delete De[h]});else if(Array.isArray(e))e.forEach(function(h){h.key&&Cr(h)});else if(typeof e=="object")e.key&&Cr(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=n[0],c=n[1];typeof o=="function"&&(c=o,o=""),Cr({key:e,scope:o,method:c,splitKey:"+"})}}var Cr=function(t){var n=t.key,r=t.scope,o=t.method,c=t.splitKey,h=c===void 0?"+":c,d=aa(n);d.forEach(function(b){var x=b.split(h),s=x.length,l=x[s-1],O=l==="*"?"*":yr(l);if(De[O]){r||(r=qn());var y=s>1?sa(Vt,x):[];De[O]=De[O].filter(function(S){var R=o?S.method===o:!0;return!(R&&S.scope===r&&yh(S.mods,y))})}})};function Io(e,t,n,r){if(t.element===r){var o;if(t.scope===n||t.scope==="all"){o=t.mods.length>0;for(var c in Ke)Object.prototype.hasOwnProperty.call(Ke,c)&&(!Ke[c]&&t.mods.indexOf(+c)>-1||Ke[c]&&t.mods.indexOf(+c)===-1)&&(o=!1);(t.mods.length===0&&!Ke[16]&&!Ke[18]&&!Ke[17]&&!Ke[91]||o||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function _o(e,t){var n=De["*"],r=e.keyCode||e.which||e.charCode;if(at.filter.call(this,e)){if((r===93||r===224)&&(r=91),Ce.indexOf(r)===-1&&r!==229&&Ce.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(S){var R=Kr[S];e[S]&&Ce.indexOf(R)===-1?Ce.push(R):!e[S]&&Ce.indexOf(R)>-1?Ce.splice(Ce.indexOf(R),1):S==="metaKey"&&e[S]&&Ce.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Ce=Ce.slice(Ce.indexOf(R))))}),r in Ke){Ke[r]=!0;for(var o in Vt)Vt[o]===r&&(at[o]=!0);if(!n)return}for(var c in Ke)Object.prototype.hasOwnProperty.call(Ke,c)&&(Ke[c]=e[Kr[c]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Ce.indexOf(17)===-1&&Ce.push(17),Ce.indexOf(18)===-1&&Ce.push(18),Ke[17]=!0,Ke[18]=!0);var h=qn();if(n)for(var d=0;d<n.length;d++)n[d].scope===h&&(e.type==="keydown"&&n[d].keydown||e.type==="keyup"&&n[d].keyup)&&Io(e,n[d],h,t);if(r in De){for(var b=0;b<De[r].length;b++)if((e.type==="keydown"&&De[r][b].keydown||e.type==="keyup"&&De[r][b].keyup)&&De[r][b].key){for(var x=De[r][b],s=x.splitKey,l=x.key.split(s),O=[],y=0;y<l.length;y++)O.push(yr(l[y]));O.sort().join("")===Ce.sort().join("")&&Io(e,x,h,t)}}}}function jh(e){return ca.indexOf(e)>-1}function at(e,t,n){Ce=[];var r=aa(e),o=[],c="all",h=document,d=0,b=!1,x=!0,s="+",l=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(c=t.scope),t.element&&(h=t.element),t.keyup&&(b=t.keyup),t.keydown!==void 0&&(x=t.keydown),t.capture!==void 0&&(l=t.capture),typeof t.splitKey=="string"&&(s=t.splitKey)),typeof t=="string"&&(c=t);d<r.length;d++)e=r[d].split(s),o=[],e.length>1&&(o=sa(Vt,e)),e=e[e.length-1],e=e==="*"?"*":yr(e),e in De||(De[e]=[]),De[e].push({keyup:b,keydown:x,scope:c,mods:o,shortcut:r[d],method:n,key:r[d],splitKey:s,element:h});typeof h<"u"&&!jh(h)&&window&&(ca.push(h),kr(h,"keydown",function(O){_o(O,h)},l),Co||(Co=!0,kr(window,"focus",function(){Ce=[]},l)),kr(h,"keyup",function(O){_o(O,h),Sh(O)},l))}function Oh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(De).forEach(function(n){var r=De[n].find(function(o){return o.scope===t&&o.shortcut===e});r&&r.method&&r.method()})}var Ir={setScope:ua,getScope:qn,deleteScope:Eh,getPressedKeyCodes:bh,isPressed:wh,filter:xh,trigger:Oh,unbind:Th,keyMap:Ai,modifier:Vt,modifierMap:Kr};for(var _r in Ir)Object.prototype.hasOwnProperty.call(Ir,_r)&&(at[_r]=Ir[_r]);if(typeof window<"u"){var Rh=window.hotkeys;at.noConflict=function(e){return e&&window.hotkeys===at&&(window.hotkeys=Rh),at},window.hotkeys=at}at.filter=function(){return!0};var da=function(t,n){var r=t.target,o=r&&r.tagName;return!!(o&&n&&n.includes(o))},kh=function(t){return da(t,["INPUT","TEXTAREA","SELECT"])};function Ch(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var o=n||{},c=o.enableOnTags,h=o.filter,d=o.keyup,b=o.keydown,x=o.filterPreventDefault,s=x===void 0?!0:x,l=o.enabled,O=l===void 0?!0:l,y=o.enableOnContentEditable,S=y===void 0?!1:y,R=N.useRef(null),P=N.useCallback(function(A,V){var W,ee;return h&&!h(A)?!s:kh(A)&&!da(A,c)||(W=A.target)!=null&&W.isContentEditable&&!S?!0:R.current===null||document.activeElement===R.current||(ee=R.current)!=null&&ee.contains(document.activeElement)?(t(A,V),!0):!1},r?[R,c,h].concat(r):[R,c,h]);return N.useEffect(function(){if(!O){at.unbind(e,P);return}return d&&b!==!0&&(n.keydown=!1),at(e,n||{},P),function(){return at.unbind(e,P)}},[P,e,O]),R}at.isPressed;const ha=N.createContext({open:!1,toggleOpen:e=>{}});function Ih({children:e}){const[t,n]=N.useState(!1),r=c=>{n(c??!c)},o=N.useMemo(()=>({open:t,toggleOpen:r}),[t]);return i.jsx(ha.Provider,{value:o,children:e})}function Di(){return N.useContext(ha)}const dt={nameAsc:"title",nameDesc:"title",popularity:"stats.downloads",publishAt:"lastPublishedAt",mobilePageSize:10,pageSize:18,currentPage:1,defaultCurrentPage:1,blockletsPath:"/api/v2/blocklets.json",categoriesPath:"/api/blocklets/categories",explorePath:"/api/blocklets/explore",exploreDidsPath:"/api/blocklets/dids",cacheSize:100},_h=e=>Hn(async()=>{const{data:t}=await e.get(dt.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function Ph(e,t){const n={sortBy:"popularity",sortDirection:"desc",showResources:"true",...e,menu:void 0},{onFilterChange:r,onSearchSelect:o=d=>{t.onFilterChange({...n,keyword:d.title})},emptyCategory:c}=t;!n.category&&!c&&(n.category="All");const h=d=>{const b={...n,...d};r(xr(b,x=>x===""||x===void 0))};return{filters:e,cleanFilter:d=>{const b=d?xr(n,(x,s)=>d.includes(s)):{};r(xr(b,x=>x===""||x===void 0))},handleActiveMenu:d=>{d!==e.menu&&r({menu:d})},handleSort:(d,b)=>{h({sortBy:d,sortDirection:b||d==="nameAsc"?"asc":"desc"})},handleKeyword:d=>{h({category:void 0,keyword:d||void 0})},handlePrice:d=>{h({price:d===e.price?void 0:d})},handleCategory:d=>{h({category:d===e.category?"":d})},handleDeveloper:d=>{h({owner:d||void 0})},handlePage:d=>{h({currentPage:d})},handleSwitchShowResources:d=>{h({showResources:d})},handleSearchSelect:d=>{o(d)}}}const Lh=(e,t,n)=>e&&t||!n,pa=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],fa=(e,t,n)=>{var r,o;const c=Kl(e),h=Vl(c.search);if((r=Gl(e,{strict:!0}))!=null&&r.endsWith(".gif"))return h.imageFilter?Hl({...c,search:""}):e;if(h.imageFilter)return e;const d=n||((o=window.blocklet)==null?void 0:o.version),{w:b,h:x}=typeof t=="object"?{w:t.w,h:t.h}:{w:t,h:t};return ti(e,{...b||x?{imageFilter:"resize",w:b,h:x}:{},v:d})},Nh=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],Ah=(e=[],t="en")=>e.map(n=>({name:n.locales[t]||n.locales.en,value:n._id})),Dh=(e,t)=>e==null?void 0:e.replace(/{(\w*)}/g,(n,r)=>t.hasOwnProperty(r)?t[r]:""),Mh=()=>window.innerWidth<=600,Fh={common:{title:"Blocklet Store",searchStore:"Search Blocklet",showResources:"Show extensions",price:"Price",category:"Category",categories:"Categories",resourceType:"Resource Type",clear:"Clear",cancel:"Cancel",search:"Search",fetchError:"Failed to fetch data, please try again later"},explore:{title:"Explore",trending:"Trending",topRated:"Top Rated",recentlyUpdated:"Recently Updated",viewDetail:"View Details"},sort:{sort:"Sort",rating:"Rating",popularity:"Most Popular",lastPublished:"Latest Published"},category:{all:"All",placeholder:"Category name",helperText:"Please select a category"},blocklet:{noResults:"No blocklet found.",free:"Free",search:'Results for "{keyword}"',authorTag:"Blocklet by {name}",resourceTag:"Extensions for {name}",resultCount:"{count} Blocklets",emptyTip:"Tips:",filterTip:"Appropriately reduce the filter conditions",keywordTip:"Try other keywords",owner:"Blocklets from {name}",noBlockletPart1:'No Blocklets associated with"',noBlockletPart2:'"were found',noCategoryResults1:'No "',noCategoryResults2:'" Blocklets'},autocomplete:{expandResult:'View all search results for "{name}"'}},Bh={common:{title:"Blocklet 商店",searchStore:"搜索 Blocklet",showResources:"显示扩展",price:"价格",category:"类别",categories:"类别",resourceType:"资源类型",clear:"清除",cancel:"取消",search:"搜索",fetchError:"获取数据失败, 请稍后再试"},explore:{title:"探索",trending:"趋势",topRated:"评分最高",recentlyUpdated:"最近更新",viewDetail:"查看详情"},sort:{sort:"排序",rating:"评分",popularity:"最热门",lastPublished:"最新发布"},category:{all:"全部",placeholder:"分类名称",helperText:"请选择分类"},blocklet:{noResults:"未搜索到 Blocklet",free:"免费",search:'搜索 "{keyword}" 的结果',authorTag:"{name} 的 Blocklet",resourceTag:"{name} 的拓展",resultCount:"{count} 个 Blocklet",emptyTip:"建议:",filterTip:"适当减少筛选条件",keywordTip:"尝试其他关键字",owner:"来自 {name} 的 Blocklets",noBlockletPart1:'没有找到与"',noBlockletPart2:'"相关的 Blocklets',noCategoryResults1:'无 "',noCategoryResults2:'" 类别的 Blocklets'},autocomplete:{expandResult:"查看 “{name}” 的所有搜索结果"}},Pr={en:Zi(Fh),zh:Zi(Bh)},ma=(e,t)=>{const n={};return e&&(n["x-blocklet-server-version"]=e),t&&(n["x-blocklet-store-version"]=t),n},$h=e=>(t,n)=>{const r=Pr[e]?Pr[e][t]:Pr.en[t];return Dh(r,n)||t},ga={errors:{fetchCategoriesError:null},loadings:{fetchCategoriesLoading:!1},endpoint:"",wrapChildren:()=>null,t:e=>e,storeVersion:"",minItemWidth:350,serverVersion:"",layout:{},selectedCategory:void 0,categoryList:[],blockletRender:()=>null,locale:"en",categoryOptions:[],priceOptions:[],storeApi:null,baseSearch:!1,showResourcesSwitch:!1,showCategory:!1,tagFilters:[],developerName:"",onFilterChange:()=>{},updateDeveloperName:()=>{},getCategoryLocale:()=>null,search:{filters:{},cleanFilter:()=>{},handleActiveMenu:()=>{},handleSort:()=>{},handleKeyword:()=>{},handlePrice:()=>{},handleCategory:()=>{},handleDeveloper:()=>{},handleSwitchShowResources:()=>{},handleSearchSelect:()=>{},handlePage:()=>{}}},va=N.createContext(ga),{Provider:Uh,Consumer:uf}=va;function Wh(e){const{locale:t="zh",filters:n={},serverVersion:r="",onFilterChange:o=()=>{},minItemWidth:c=350,queryFilter:h=!0,layout:d={},wrapChildren:b=q=>q,extraFilter:x=q=>q,baseSearch:s=!1,fetchCategoryDelay:l=0,showResourcesSwitch:O=!1,showCategory:y=!0,tagFilters:S=[],children:R,storeVersion:P,onSearchSelect:A=()=>{},endpoint:V,blockletRender:W}=e,ee=ma(r,P),j=N.useMemo(()=>ns({baseURL:V,headers:ee}),[V]),z=Ph(n,{onFilterChange:o,emptyCategory:!d.showExplore,onSearchSelect:A}),[Q,$]=N.useState(""),{data:ue=[],error:ve,loading:ce,run:Ie}=_h(j),$e=N.useMemo(()=>{const q=th(ue,[ie=>ie.name],["asc"]),Oe=q.findIndex(ie=>ie.name==="All"||ie.locales.en==="All");return Oe>-1?[{...q[Oe],_id:"All"},...q.slice(0,Oe),...q.slice(Oe+1)]:q},[ue]),Xe=N.useCallback($h(t),[t]),nt=N.useMemo(()=>Ah($e,t),[$e,t]),Y=Nh(Xe),fe={search:z,errors:{fetchCategoriesError:ve},loadings:{fetchCategoriesLoading:ce},extraFilter:x,endpoint:V,queryFilter:h,layout:{showExplore:d.showExplore??!1,showCategory:d.showCategory??!0,showTitle:d.showTitle??!0,showSearch:d.showSearch??!0},minItemWidth:c,wrapChildren:b,t:Xe,storeVersion:P,serverVersion:r,selectedCategory:z.filters.category||(d.showExplore?"":"All"),categoryList:$e,blockletRender:W,locale:t,categoryOptions:nt,priceOptions:Y,storeApi:j,baseSearch:s,showResourcesSwitch:O,showCategory:y,tagFilters:S,onFilterChange:o,getCategoryLocale:q=>{if(!q)return null;const Oe=ue.find(ie=>ie._id===q||ie.locales.en==="All");return Oe?Oe.locales[t]||Oe.locales.en:null},get developerName(){return Q},updateDeveloperName:$};return N.useEffect(()=>{setTimeout(Ie,l||0)},[V,Ie,l]),i.jsx(Uh,{value:fe,children:R})}function tt(){return N.useContext(va)||ga}function ya({children:e,onClick:t,size:n=32,...r}){return i.jsx(Vn,{...r,onClick:t,variant:"outlined",sx:[{minWidth:n,height:n,p:0,borderColor:"divider","&:hover":{borderColor:"divider"},borderRadius:2,color:"text.secondary"},...Array.isArray(r.sx)?r.sx:[r.sx]],children:e})}function Zn(e,t){return e===void 0?t:e}function Mi({xs:e,sm:t,md:n,lg:r,xl:o,exact:c}){const h=Kn(),d=Mt(h.breakpoints.down("sm")),b=Mt(h.breakpoints.between("sm","md")),x=Mt(h.breakpoints.between("md","lg")),s=Mt(h.breakpoints.between("lg","xl"));if(c)return d?e||null:b?t||null:x?n||null:s?r||null:o||null;let l=e;return d||(l=Zn(t,l),b)||(l=Zn(n,l),x)||(l=Zn(r,l),s)?l:Zn(o,l)}function zh({children:e}){const{open:t,toggleOpen:n}=Di();return i.jsx(Mi,{xs:i.jsx(Ma,{open:t,onClose:()=>n(!1),children:e}),md:i.jsx(te,{children:e})})}const qh=N.forwardRef(({loading:e,disabled:t,...n},r)=>i.jsx(Vn,{ref:r,disableElevation:!0,disabled:t||e,...n,sx:[{borderRadius:"4px"},...Array.isArray(n.sx)?n.sx:[n.sx]],startIcon:e&&i.jsx(ht,{size:"1em"})}));function ba({value:e,options:t,onChange:n,placeholder:r,...o}){var c;const h=N.useRef(null),d=Kn(),[b,x]=N.useState(!1),[s,l]=N.useState(e!==null?e:""),O=Mt(d.breakpoints.down("sm"));N.useEffect(()=>{l(e!==null?e:"")},[e]);const y=N.useCallback(()=>{x(!1)},[]),S=N.useCallback(()=>{x(!0)},[]);function R(A){l(A.value),n(A.value),O&&y()}function P(A){return A===s}return i.jsxs(i.Fragment,{children:[i.jsxs(Kh,{ref:h,onClick:S,variant:"outlined",size:"medium",className:["my-select__selector",Bn(s)?"":"my-select__selector--active"].join(" "),sx:{minWidth:"auto",color:"text.primary",borderRadius:"8px"},...o,children:[((c=t.find(A=>A.value===s))==null?void 0:c.name)||r,i.jsx(Fa,{className:"my-select__arrowdown",component:ia,sx:{width:18,height:18}})]}),i.jsx(Ba,{open:b,anchorEl:h.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:A,placement:V})=>i.jsx($a,{...A,style:{transformOrigin:V==="bottom"?"center top":"center bottom"},children:i.jsx(Ua,{children:i.jsx(Wa,{onClickAway:y,children:i.jsx(Vh,{autoFocusItem:b,onMouseEnter:S,onMouseLeave:y,children:t.map(W=>i.jsxs(Xr,{onClick:()=>R(W),sx:{fontSize:14},children:[i.jsx(is,{sx:{mr:1,fontSize:16,visibility:P(W.value)?"visible":"hidden"}}),W.name]},W.value))})})})})})]})}const Kh=ln(qh)`
|
|
437
|
-
border: 1px solid #f0f0f0;
|
|
438
|
-
padding: 6px 8px 6px 12px;
|
|
439
|
-
font-weight: ${e=>e.theme.typography.fontWeightRegular};
|
|
440
|
-
font-size: 14px;
|
|
441
|
-
color: #666;
|
|
442
|
-
line-height: 1;
|
|
443
|
-
text-transform: none;
|
|
444
|
-
& + & {
|
|
445
|
-
margin-left: 10px;
|
|
446
|
-
}
|
|
447
|
-
&.my-select__selector--active {
|
|
448
|
-
&,
|
|
449
|
-
.my-select__arrowdown,
|
|
450
|
-
}
|
|
451
|
-
.my-select__arrowdown {
|
|
452
|
-
color: #999;
|
|
453
|
-
font-size: 14px;
|
|
454
|
-
margin-left: 6px;
|
|
455
|
-
}
|
|
456
|
-
.my-select__icon {
|
|
457
|
-
font-size: 0;
|
|
458
|
-
svg {
|
|
459
|
-
color: #999;
|
|
460
|
-
font-size: 18px;
|
|
461
|
-
margin-right: 3px;
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
`,Vh=ln(Ho)`
|
|
465
|
-
.my-select__option__icon {
|
|
466
|
-
color: transparent;
|
|
467
|
-
font-size: 14px;
|
|
468
|
-
margin: 0 3px 0 -5px;
|
|
469
|
-
}
|
|
470
|
-
.my-select__option {
|
|
471
|
-
font-size: 14px;
|
|
472
|
-
color: #999;
|
|
473
|
-
}
|
|
474
|
-
.my-select__option--active {
|
|
475
|
-
&,
|
|
476
|
-
.my-select__option__icon {
|
|
477
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
`;function xa(){const{search:e,t}=tt(),{filters:n,handleSort:r,handlePrice:o}=e,c=pa(t);return i.jsxs(yt,{direction:{xs:"row",md:"column"},alignItems:{xs:"center",md:"flex-start"},gap:{xs:1,md:2},width:{xs:"100%",md:"auto"},justifyContent:"space-between",children:[i.jsx(Gr,{control:i.jsx(Hr,{checked:n.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.lighter"}},onChange:h=>o(h.target.checked?"free":"")}),label:t("blocklet.free")}),i.jsx(ba,{value:n.sortBy||c[0].value,options:c,onChange:h=>r(h),placeholder:t("sort.sort")})]})}function Gh({menus:e}){const{selectedCategory:t,search:n,t:r,categoryOptions:o,loadings:c,layout:h,baseSearch:d}=tt(),{filters:b,handleActiveMenu:x,handleCategory:s,cleanFilter:l}=n,{toggleOpen:O}=Di();N.useEffect(()=>{O(!1)},[Object.values(b).join("")]);const y=Lh(d,h.showSearch,b.keyword);return h.showCategory?i.jsxs(zh,{children:[i.jsx(Mi,{xs:i.jsxs(yt,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[i.jsx(ya,{onClick:()=>O(!1),children:i.jsx(ei,{})}),i.jsx(ge,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:r("common.category")})]}),md:null}),i.jsx(yt,{visibility:c.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:y?i.jsxs(i.Fragment,{children:[h.showExplore&&i.jsxs(te,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[i.jsxs(te,{display:"flex",alignItems:"center",gap:1,children:[i.jsx(Bt,{icon:Jd,width:20,height:20}),i.jsx(ge,{variant:"body1",color:!t&&!b.menu?"text.primary":"text.lighter",fontWeight:!t&&!b.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{O(!1),l()},children:r("explore.title")})]}),e==null?void 0:e.map(S=>i.jsxs(te,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof S.icon=="string"?i.jsx(Bt,{icon:S.icon,width:20,height:20}):S.icon,i.jsx(ge,{variant:"body1",color:b.menu===S.key?"text.primary":"text.lighter",fontWeight:b.menu===S.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{var R;O(!1),x(S.key),(R=S.onClick)==null||R.call(S)},children:S.title})]},S.key))]}),!!o.length&&i.jsx(yt,{gap:2,children:o.map(S=>i.jsx(ge,{variant:"body1",title:S.name,sx:{cursor:"pointer"},"data-cy":"filter",color:t===S.value?"text.primary":"text.lighter",textTransform:"capitalize",onClick:()=>{t===S.value?l():s(S.value),O(!1)},children:S.name},S.value))})]}):i.jsx(xa,{})})]}):null}function Fi(){const{endpoint:e,serverVersion:t,storeVersion:n}=tt(),r=ma(t,n),o=N.useMemo(()=>ns({baseURL:e,headers:r}),[e]);return{get:async c=>{const{data:h}=await o.get(c);return h},post:async(c,h)=>{const{data:d}=await o.post(c,h);return d}}}const wa=N.memo(function(e){return i.jsx(te,{height:60,display:"flex",alignItems:"center",justifyContent:"center",...e,children:i.jsx(ht,{})})});function Po({icon:e,children:t,maxWidth:n=100,title:r}){return(t===0||t)&&i.jsxs(yt,{direction:"row",alignItems:"center",gap:1,sx:{maxWidth:n,overflow:"hidden"},children:[e,i.jsx(ge,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:r||(typeof t=="string"?t:void 0),children:t})]})}const Hh=16/9,Lr=292,Vr=189,or=336;function Xh(){var e,t;const{t:n,search:r}=tt(),{get:o}=Fi(),c=Kn(),h=Mt(c.breakpoints.down("md")),d=((t=(e=window.blocklet)==null?void 0:e.preferences)==null?void 0:t.homeBanner)||[],{data:b=[],error:x,loading:s}=Hn(async()=>{const A=await o(ti(dt.blockletsPath,{didList:d.map(V=>V.did).join(",")}));return A!=null&&A.dataList?d.map(V=>A.dataList.find(W=>W.did===V.did)):[]});x&&console.error("Get Banner Blocklets error:",x);const l={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.lighter"};return!x&&d.length>0?i.jsxs(i.Fragment,{children:[i.jsx(ge,{component:"h2",variant:"h2",mt:{xs:2,md:0},mb:3,children:n("explore.title")}),i.jsx(te,{height:{xs:"auto",md:Lr},minHeight:Lr,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden",children:s?i.jsxs(te,{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center",children:[i.jsx(Kt,{variant:"rounded",height:Vr,width:or}),i.jsxs(te,{flex:1,height:"100%",children:[i.jsx(Kt,{variant:"text",height:50,width:100}),i.jsx(Kt,{variant:"text",height:40,width:"100%"}),i.jsx(Kt,{variant:"text",height:40,width:300}),i.jsxs(te,{display:"flex",gap:1,my:2,children:[i.jsx(Kt,{variant:"circular",height:20,width:20}),i.jsx(Kt,{variant:"text",height:20,width:50})]}),i.jsx(Kt,{variant:"rounded",height:30,width:100})]})]}):i.jsx(ah,{showNav:!0,autoPlay:!0,slideDuration:h?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:A=>i.jsx(te,{onClick:A,sx:{display:{xs:"none",md:"block"}},children:i.jsx(sc,{sx:{...l,left:5}})}),renderRightNav:A=>i.jsx(te,{onClick:A,sx:{display:{xs:"none",md:"block"}},children:i.jsx(ac,{sx:{...l,right:5}})}),items:d.map((A,V)=>({original:A.did,renderItem:()=>{var W;const ee=b[V]||{},j=A.cover||Jh(A.did,(W=ee.screenshots)==null?void 0:W[0]),z=fa(j,c.breakpoints.values.md*2);return i.jsxs(yt,{height:{xs:"auto",md:Lr},sx:{cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${z}")`,backgroundSize:"cover",filter:"blur(50px)",opacity:.15,zIndex:0}},display:"flex",direction:{xs:"column",md:"row"},justifyContent:"center",alignItems:{xs:"flex-start",md:"center"},p:{xs:2,md:5},onClick:()=>r.handleSearchSelect(ee),gap:{xs:2,md:5},children:[O(z),i.jsxs(yt,{flex:1,height:"100%",gap:3,children:[i.jsxs(te,{flex:1,children:[y(A.name||ee.title||A.name),S(A.desc||ee.description)]}),ee.did&&R(ee,A.baseNum),P(ee)]})]})}}))})})]}):null;function O(A){return i.jsx(te,{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:or},children:i.jsx(Qh,{url:A})})}function y(A){return i.jsx(ge,{variant:"h2",width:"100%",children:A})}function S(A){return i.jsx(ge,{variant:"body2",color:"text.secondary",textAlign:"left",width:"100%",minHeight:70,maxHeight:70,pt:1,sx:{display:"-webkit-box",lineClamp:3,WebkitLineClamp:3,maxHeight:71,textWrap:"wrap",overflow:"hidden",WebkitBoxOrient:"vertical"},children:A})}function R(A,V=0){const{did:W,owner:ee,stats:j}=A;return i.jsxs(te,{display:"flex",alignItems:"center",gap:2,color:"text.secondary",children:[i.jsx(Po,{icon:i.jsx(Zr,{src:ee.avatar,did:W,size:20,variant:"circle"}),children:ee.fullName}),i.jsx(Po,{icon:i.jsx(Bt,{icon:oh}),title:`${j.downloads+V}`,children:Yh(j.downloads+V)})]})}function P(A){return i.jsx(Vn,{variant:"outlined",size:"small",onClick:()=>r.handleSearchSelect(A),sx:{width:"fit-content",textTransform:"none",bgcolor:"white",borderRadius:"8px",borderColor:"divider","&:hover":{borderColor:"divider"}},children:n("explore.viewDetail")})}}const Yh=e=>Number.isNaN(e)?0:e<1e3?e:e<1e6?`${(e/1e3).toFixed(1)}k`:e<1e9?`${(e/1e6).toFixed(1)}m`:`${(e/1e9).toFixed(1)}b`,Jh=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function Qh({url:e}){const[t,n]=N.useState(!0);return i.jsxs(i.Fragment,{children:[t&&i.jsx(Kt,{variant:"rectangular",sx:{width:{xs:"100%",md:or},height:{xs:"auto",md:Vr}}}),i.jsx(te,{display:t?"none":"block",component:"img",src:e,alt:"",width:{xs:"100%",md:or},height:{xs:"auto",md:Vr},borderRadius:2,border:1,borderColor:"divider",sx:{objectFit:"container",cursor:"pointer",aspectRatio:Hh},onLoad:()=>n(!1),onError:()=>n(!1)})]})}function Zh({title:e,blocklets:t}){const{blockletRender:n,serverVersion:r}=tt();return i.jsxs(te,{mt:3,children:[i.jsx(ge,{component:"h3",variant:"h3",sx:{mb:2},children:e}),i.jsx(Hi,{container:!0,spacing:2,children:t.map(o=>i.jsx(Hi,{item:!0,xs:12,md:6,p:"2px","data-blocklet-did":o.did,children:i.jsx(te,{padding:"1px",children:n({blocklet:o,blocklets:t,serverVersion:r})})},o.did))})]})}function ep(){const{get:e}=Fi(),{t}=tt(),{data:n=[],error:r,loading:o}=Hn(async()=>{const c=await e(dt.explorePath);return Array.isArray(c)?c:[]});return r?i.jsx(dr,{error:new Error(`Failed to fetch blocklets from ${dt.explorePath}`)}):o?i.jsx(wa,{mt:15}):i.jsxs(i.Fragment,{children:[i.jsx(Xh,{}),n.map(c=>c.blocklets.length>0?i.jsx(Zh,{title:t(`explore.${c.type}`),blocklets:c.blocklets},c.type):null)]})}const Nr="__FREE_TEXT__",Lo="__NO_RESULT__",Ar=40;function tp({endpoint:e,t,locale:n,filters:r,handleKeyword:o,handleSearchSelect:c,...h}){const d=N.useRef(null),b=N.useRef(!1),[x,s]=N.useState(!1),[l,O]=N.useState(""),[y,S]=N.useState(!1),R=Fi(),[P,A]=N.useState(!1),V=(h==null?void 0:h.placeholder)||t("common.searchStore"),W=async Y=>{A(!0);const fe=await R.get(Wn(e,ti(dt.blockletsPath,Y)));return A(!1),fe.dataList||[]},{data:ee,run:j}=Hn(Y=>Y?W({sortBy:dt.nameDesc,page:1,pageSize:10,keyword:Y,showResources:"true"}):Promise.resolve([]),{manual:!0});N.useEffect(()=>{A(!0),j(r.keyword),O(r.keyword||"")},[r.keyword,j]),Ch("ctrl + k, command + k",Y=>{var fe,q;return Y.stopPropagation(),Y.preventDefault(),(q=(fe=d.current)==null?void 0:fe.querySelector("input"))==null||q.focus(),!1},{enableOnTags:["INPUT"]});const z=ls(Y=>j(Y),{wait:300}),Q={name:Nr,title:l,did:""};let $=[];return l&&(P?$=[Q]:ee!=null&&ee.length?$=[Q,...ee]:$=[{name:Lo,title:t("blocklet.noResults"),did:""}]),i.jsxs(i.Fragment,{children:[i.jsxs(za,{fullScreen:!0,open:y,sx:{display:{md:"none"}},children:[i.jsxs(te,{p:2,pb:0,display:"flex",alignItems:"center",gap:2,children:[i.jsx(Xo,{fullWidth:!0,sx:{bgcolor:"#F9FAFB",px:1,py:.5,".MuiInputBase-input":{p:1},".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},autoFocus:!0,placeholder:V,className:"bl-autocomplete-input",value:l,onChange:Y=>ue(Y.target.value),startAdornment:Xe(y),endAdornment:nt()}),i.jsx(Vn,{variant:"outlined",onClick:()=>{S(!1),O(r.keyword||"")},children:t("common.cancel")})]}),i.jsx(Ho,{sx:{p:.5},children:$.map(Y=>Ie(Y))})]}),i.jsx(nr,{sx:{display:{sx:"block",md:"none"},fontSize:28,color:"text.lighter"},onClick:()=>S(!0)}),i.jsx(Wo,{ref:d,open:!!l&&x,size:"small",onOpen:()=>s(!0),onClose:(Y,fe)=>{s(!1),fe==="selectOption"&&!b.current&&o(l)},onKeyDown:Y=>{Y.key==="Enter"&&!l&&ve()},disableClearable:!0,inputValue:l,onInputChange:(Y,fe)=>ue(fe),isOptionEqualToValue:(Y,fe)=>Y.name===fe.name,getOptionLabel:Y=>Y.title,getOptionKey:Y=>Y.name,noOptionsText:t("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:Y=>i.jsx(ar,{...Y,InputProps:{...Y.InputProps,autoFocus:!0,placeholder:V,className:"bl-autocomplete-input",value:l,startAdornment:Xe(x),endAdornment:nt()}}),filterOptions:Y=>Y,...h,options:$,renderOption:(Y,fe)=>Ie(fe),value:Q,sx:[{bgcolor:"#F9FAFB",borderRadius:"8px",overflow:"hidden",".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},...Array.isArray(h.sx)?h.sx:[h.sx]]})]});function ue(Y){A(!0),O(Y),b.current=!1,z.run(Y)}function ve(){S(!1),O(""),ue(""),o("")}function ce(Y){Y!=null&&Y.did?(S(!1),b.current=!0,O(""),c(Y)):Y.name===Nr&&(S(!1),o(l))}function Ie(Y){var fe,q;return i.jsxs(Xr,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>ce(Y),children:[$e(Y),i.jsxs(ge,{variant:"body1",children:[i.jsx(ge,{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1,children:Y.title}),i.jsx(ge,{sx:{color:"text.lighter"},fontSize:"13px",children:((q=(fe=Y.category)==null?void 0:fe.locales)==null?void 0:q[n||"en"])||""})]})]},Y.did)}function $e(Y){if([Nr,Lo].includes(Y.name))return i.jsx(te,{width:Ar,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.lighter",bgcolor:"#F1F3F5",borderRadius:"8px",children:i.jsx(nr,{sx:{fontSize:28}})});let fe="";return Y.logo&&(fe=Wn(e,"assets",Y.did,fa(Y.logo,Ar,Y.version))),i.jsx(Zr,{src:fe,size:Ar,style:{borderRadius:"8px",overflow:"hidden"}})}function Xe(Y=!0){return i.jsx(te,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.lighter"},children:Y&&l&&P?i.jsx(ht,{color:"inherit",size:16}):i.jsx(nr,{sx:{fontSize:16,cursor:"default"}})})}function nt(){return l?i.jsx(te,{sx:{display:"flex",alignItems:"center",color:"text.lighter"},children:i.jsx(ei,{sx:{fontSize:20,cursor:"pointer"},onClick:()=>ve()})}):null}}function np({placeholder:e="Type to search...",...t}){const{search:n}=tt(),{filters:r,handleKeyword:o}=n,[c,h]=N.useState(r.keyword||""),d=ls(o,{wait:300}),b=s=>{const{value:l}=s.target;h(l),d.run(l)},x=()=>{h(""),o("")};return N.useEffect(()=>{h(r.keyword||"")},[r.keyword]),i.jsx(rp,{inputProps:{"data-cy":"search-blocklet"},startAdornment:i.jsx(Yi,{position:"start",children:i.jsx(ip,{})}),onChange:b,placeholder:e,value:c,title:e,"data-cy":"search",endAdornment:c&&i.jsx(Yi,{position:"end",children:i.jsx(op,{"data-cy":"search-delete",onClick:x})}),...t})}const rp=ln(Xo)`
|
|
481
|
-
background-color: ${e=>e.theme.palette.grey[50]};
|
|
482
|
-
font-size: 14px;
|
|
483
|
-
border-radius: 6px;
|
|
484
|
-
width: 100%;
|
|
485
|
-
.MuiInputBase-input {
|
|
486
|
-
padding: 8px 0 8px 10px;
|
|
487
|
-
}
|
|
488
|
-
.MuiOutlinedInput-notchedOutline {
|
|
489
|
-
border: none;
|
|
490
|
-
}
|
|
491
|
-
.Mui-focused {
|
|
492
|
-
background-color: #f6f6f6;
|
|
493
|
-
.MuiInputBase-input::placeholder {
|
|
494
|
-
color: transparent;
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
`,ip=ln(nr)`
|
|
498
|
-
color: ${e=>e.theme.palette.grey[500]};
|
|
499
|
-
font-size: 28px;
|
|
500
|
-
@media (max-width: ${e=>e.theme.breakpoints.values.md}px) {
|
|
501
|
-
font-size: 24px;
|
|
502
|
-
}
|
|
503
|
-
`,op=ln(ei)`
|
|
504
|
-
color: ${e=>e.theme.palette.grey[500]};
|
|
505
|
-
font-size: 16px;
|
|
506
|
-
cursor: pointer;
|
|
507
|
-
`;function sp(){const{search:e,t,endpoint:n,locale:r,getCategoryLocale:o,developerName:c,showResourcesSwitch:h,layout:d,baseSearch:b}=tt(),{filters:x,handleSort:s,handlePrice:l,handleDeveloper:O,handleSwitchShowResources:y,cleanFilter:S}=e,R=pa(t);return i.jsxs(yt,{className:"filter-bar",direction:{xs:"column",md:"row"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",gap:2,spacing:{xs:1,md:0},pt:{xs:2,md:0},px:0,pb:3,children:[i.jsx(ge,{variant:"h2",textTransform:"capitalize",children:o(x.category)}),i.jsxs(yt,{flex:1,direction:"row",alignItems:"center",width:"100%",justifyContent:{xs:"space-between",md:"flex-end"},gap:2,children:[d.showSearch?i.jsx(te,{flex:1,children:b?i.jsx(np,{}):i.jsx(tp,{locale:r,endpoint:n,sx:{display:{md:"block",xs:"none"},flex:1,mr:1,width:"350px"},t,filters:e.filters,handleKeyword:e.handleKeyword,handleSearchSelect:e.handleSearchSelect})}):null,x.owner&&c&&i.jsx(Xi,{label:t("blocklet.authorTag",{name:c}),size:"small",onDelete:()=>O("")}),x.resourceDid&&x.resourceBlocklet&&i.jsx(Xi,{label:t("blocklet.resourceTag",{name:x.resourceBlocklet}),size:"small",onDelete:()=>S(["resourceDid","resourceBlocklet","showResources"])}),h?i.jsx(No,{checked:x.showResources!=="false",onChange:P=>y(P?"true":"false"),label:t("common.showResources")}):null,i.jsx(No,{checked:x.price==="free",onChange:P=>l(P?"free":""),label:t("blocklet.free")}),i.jsx(ba,{value:x.sortBy||R[0].value,options:R,placeholder:t("sort.sort"),onChange:P=>s(P)})]})]})}function No({checked:e,onChange:t,label:n}){return i.jsx(Gr,{sx:{m:0,p:0},className:"check-button",control:i.jsx(Hr,{checked:e,icon:i.jsx(Bt,{style:{padding:0},icon:gh}),checkedIcon:i.jsx(Bt,{style:{padding:0,color:"#3478E2"},icon:vh}),size:"large",sx:{p:0,mr:1},onChange:r=>t(r.target.checked)}),label:n})}function er({children:e}){return i.jsxs(te,{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.lighter",children:[i.jsx(ul,{}),e]})}function Ao(){const{t:e}=tt();return i.jsx(ge,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function Dr({filterTip:e,keywordTip:t}){const{t:n,locale:r}=tt(),o=()=>r==="zh"?"、":" , ";return i.jsxs(te,{mt:1,display:"flex",children:[i.jsx(ge,{style:{marginRight:"16px"},children:n("blocklet.emptyTip")}),e&&i.jsx(ge,{children:n("blocklet.filterTip")}),e&&t&&o(),t&&i.jsx(ge,{children:n("blocklet.keywordTip")})]})}function Mr({primaryStart:e,primaryEnd:t,filter:n}){return i.jsxs(ge,{variant:"subtitle2",display:"flex",gap:.5,mx:.5,children:[i.jsx(ge,{children:e}),i.jsx(ge,{color:"primary",children:n}),i.jsxs(ge,{children:[t," "]})]})}function ap(){const{t:e,search:t,getCategoryLocale:n,selectedCategory:r}=tt(),{filters:o}=t,c=!!r||!!o.price;if(o.keyword&&c)return i.jsxs(er,{children:[i.jsx(Mr,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:o.keyword}),i.jsx(Dr,{keywordTip:!0,filterTip:!0})]});if(o.keyword)return i.jsxs(er,{children:[i.jsx(Mr,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:o.keyword}),i.jsx(Dr,{keywordTip:!0})]});if(c){const h=n(r);return i.jsxs(er,{children:[h?i.jsx(Mr,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:h}):i.jsx(Ao,{}),i.jsx(Dr,{filterTip:!0})]})}return i.jsx(er,{children:i.jsx(Ao,{})})}const lp=(e,t,n,r)=>Ul(async o=>{o||(n.currentPage=n.defaultCurrentPage);const{currentPage:c,pageSize:h}=n,d={...t,category:t.category==="All"?"":t.category,sortBy:dt[t.sortBy],page:c,pageSize:h};r(null);const{data:b={}}=await e.get(dt.blockletsPath,{params:d});return n.currentPage++,{page:c,pageSize:h,list:(b==null?void 0:b.dataList)||[],total:(b==null?void 0:b.total)||0}},{isNoMore:o=>o?o.page*o.pageSize>=o.total:!1,reloadDeps:[e,dl(t)],onError:r});function cp(){var e;const{storeApi:t,search:n,extraFilter:r,errors:o,updateDeveloperName:c}=tt(),{filters:h}=n,d=$l({currentPage:dt.currentPage,pageSize:Mh()?dt.mobilePageSize:dt.pageSize,defaultCurrentPage:dt.defaultCurrentPage}),[b,x]=N.useState(null),s=lp(t,h,d,x),l=N.useMemo(()=>{var O,y;return r?r(((O=s.data)==null?void 0:O.list)||[]):((y=s.data)==null?void 0:y.list)||[]},[s.data,r]);return N.useEffect(()=>{const O=l.find(y=>y.owner.did===h.owner);c((O==null?void 0:O.owner.fullName)||(O==null?void 0:O.author.name)||"")},[h.owner,l,c]),{blocklets:l,fetchBlockletsError:b,loadMore:s.loadMore,hasNextPage:!s.noMore,total:((e=s.data)==null?void 0:e.total)||0,loadings:{fetchBlockletsLoading:s.loading,loadingMore:s.loadingMore},errors:{...o,fetchBlockletsError:b}}}function up(){const{t:e,search:t,endpoint:n,blockletRender:r,serverVersion:o,minItemWidth:c,layout:h,baseSearch:d}=tt(),{filters:b}=t,{blocklets:x,errors:s,loadMore:l,loadings:O,hasNextPage:y,total:S}=cp(),[R]=mh({loading:O.fetchBlockletsLoading||O.loadingMore,hasNextPage:y,onLoadMore:l});if(s.fetchBlockletsError){const W=new Error(`Failed to fetch blocklets from ${n}: ${s.fetchBlockletsError.message}`);return i.jsx(dr,{error:W})}const P=d&&h.showSearch||!b.keyword;return i.jsxs(i.Fragment,{children:[P?i.jsx(sp,{}):i.jsxs(i.Fragment,{children:[i.jsx(Mi,{xs:i.jsx(xa,{}),md:null}),V()]}),A(),!O.fetchBlockletsLoading&&y&&i.jsx(te,{height:60,display:"flex",justifyContent:"center",py:2,ref:R,children:i.jsx(ht,{})})]});function A(){return O.fetchBlockletsLoading?i.jsx(wa,{mt:15}):x.length?i.jsx(te,{className:"blocklet-list",display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${c}px, 1fr))`,p:"2px",gap:2,children:x.map(W=>i.jsx(te,{"data-blocklet-did":W.did,sx:{minWidth:c},children:r({blocklet:W,blocklets:x,serverVersion:o})},W.did))}):i.jsx(ap,{})}function V(){return i.jsxs(yt,{direction:"row",className:"search-result-title",alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0},children:[i.jsx(ge,{variant:"h3",children:e("blocklet.search",{keyword:b.keyword})}),i.jsx(ge,{variant:"body1",color:"text.lighter",fontSize:13,children:e("blocklet.resultCount",{count:S})})]})}}function dp(){const{t:e,selectedCategory:t,getCategoryLocale:n}=tt(),{toggleOpen:r}=Di();return i.jsxs(ge,{variant:"body1",display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium",children:[i.jsx(ya,{onClick:()=>r(!0),children:i.jsx(cl,{})}),n(t)||e("common.category")]})}function hp({menus:e,children:t}){var n;const{search:r,layout:o}=tt(),{filters:c}=r,h=c.category||c.keyword||c.price,d=(n=e==null?void 0:e.find(b=>b.key===c.menu))==null?void 0:n.key;return i.jsx(Ih,{children:i.jsxs(rs,{FallbackComponent:dr,children:[i.jsx(dp,{}),i.jsxs(te,{display:"flex",height:"100%",className:"list-container",pt:{xs:0,md:5},children:[i.jsx(Gh,{menus:e}),i.jsxs(yt,{height:"100%",position:"relative",flex:1,overflow:"visible",children:[d&&(t==null?void 0:t(d)),!d&&(o.showExplore&&!h?i.jsx(ep,{}):i.jsx(up,{}))]})]})]})})}function pp(e){const{menus:t,children:n,...r}=e,o=Kn(),c=Vo(Tl({...o,typography:{h1:{fontSize:32,fontWeight:700,lineHeight:1.375,textAlign:"left"},h2:{fontSize:24,fontWeight:700,lineHeight:1.3333333,textAlign:"left"},h3:{fontSize:18,fontWeight:600,lineHeight:1.5,textAlign:"left"},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700}}));return i.jsx(Go,{theme:c,children:i.jsx(Wh,{...r,children:i.jsx(hp,{menus:t,children:n})})})}var Bi={},fp=sr;Object.defineProperty(Bi,"__esModule",{value:!0});var Ea=Bi.default=void 0,mp=fp(cr()),gp=i;Ea=Bi.default=(0,mp.default)((0,gp.jsx)("path",{d:"M16 18v2H8v-2zM11 7.99V16h2V7.99h3L12 4 8 7.99z"}),"Upgrade");const vp=(e,t)=>!t||!e?!0:Br.satisfies(Br.coerce(e),t);function $i({children:e,serverVersion:t="",requirementVersion:n="",...r}){const{t:o}=pt();return vp(t,n)?e:i.jsx(qa,{title:o("store.tooltip.upgradeServer",{serverVersion:t,version:n}),arrow:!0,children:i.jsx(ge,{children:i.jsx(Vn,{disabled:!0,variant:"outlined",...r,children:o("common.upgradeServer")})})})}$i.propTypes={children:_.node.isRequired,serverVersion:_.string,requirementVersion:_.string};$i.defaultProps={serverVersion:"",requirementVersion:""};const Fn=getComputedStyle(document.documentElement),yp=Vo({palette:{primary:{main:"#1DC1C7",contrastText:"#fff"},secondary:{main:"#030712",contrastText:"#fff"},storeSecondary:{main:"#EBFEFF",contrastText:"#fff"},divider:Fn.getPropertyValue("--stroke-sep").trim()||"#EFF1F5",text:{primary:Fn.getPropertyValue("--foregrounds-fg-base").trim()||"#030712",secondary:Fn.getPropertyValue("--foregrounds-fg-subtle").trim()||"#4b5563",lighter:Fn.getPropertyValue("--foregrounds-fg-muted").trim()||"#9ca3af",link:Fn.getPropertyValue("--foregrounds-fg-interactive").trim()||"#0086FF"}},typography:{fontSize:14,button:{textTransform:"none"},allVariants:{textTransform:"none"},h1:{fontSize:32,fontWeight:700,lineHeight:1.375,textAlign:"left"},h2:{fontSize:24,fontWeight:700,lineHeight:1.3333333,textAlign:"left"},h3:{fontSize:18,fontWeight:600,lineHeight:1.5,textAlign:"left"},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700},overrides:{MuiTableRow:{root:{"&:nth-child(even)":{backgroundColor:"rgba(0, 0, 0, 0.02)"}},head:{backgroundColor:"transparent"}}},breakpoints:{values:{xs:0,sm:600,md:960,lg:1280,xl:1920}}}),bp=(e,t)=>Wn(t,`/blocklets/${e.did}`),Do=({blocklet:e,attribute:t,value:n})=>e._formatted?e._formatted[t]:n,xp=e=>e.inStore&&Ft.isFreeBlocklet(e)===!1;function Ui({blocklet:e,blocklets:t,handleButtonClick:n,endpoint:r,serverVersion:o}){var A;const{t:c}=pt();let h=Wn(r,jl(e.did,e.logo||""));try{const V=new URL(h);V.searchParams.set("v",e.version||+new Date),h=V.href}catch{}const[d,b]=N.useState(!1),x=V=>V.currentTarget.contains(V.target)?!0:(V.preventDefault(),!1),s=async V=>{V.preventDefault(),V.stopPropagation();try{b(!0),await n({meta:e,registryUrl:r,blocklets:t})}catch(W){Qr.error(W.message)}finally{b(!1)}},{blocklet:l}=hr(),O=()=>((l==null?void 0:l.children)||[]).find(ee=>ee.meta.bundleDid===e.did).meta.version,S=(()=>{const V=((l==null?void 0:l.children)||[]).find(W=>W.meta.bundleDid===e.did);if(V){try{const W=V.meta.version,ee=e.version;if(Br.gt(ee,W))return"upgrade"}catch{return"install"}return"disable"}return"install"})();let R=c("blocklet.component.choose");S==="upgrade"?R=c("blocklet.component.upgrade"):S==="disable"?R=c("blocklet.component.installed"):xp(e)&&(R=c("common.purchase"));const P=(A=e.requirements)==null?void 0:A.server;return i.jsx(Ka,{href:bp(e,r),style:{color:"initial",textDecoration:"none"},onClick:x,target:"_blank",children:i.jsx(wp,{title:Do({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Do({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?h:"",version:e.version,button:i.jsx($i,{serverVersion:o,requirementVersion:P,size:"small",children:i.jsx("div",{style:{display:"flex",alignItems:"center"},children:i.jsx(Xd,{children:i.jsxs(st,{onClick:s,size:"small",disabled:d||S==="disable",variant:"outlined",color:"primary","data-cy":"install-blocklet",title:S==="upgrade"?`${O()} -> ${e.version}`:"",children:[d?i.jsxs(i.Fragment,{children:[i.jsx(ht,{size:16,style:{marginRight:3}}),R]}):R,S==="upgrade"?i.jsx(Ea,{style:{fontSize:"1.2rem"}}):null]},e.did)})})})})})}Ui.propTypes={blocklet:_.object.isRequired,blocklets:_.array,handleButtonClick:_.func,endpoint:_.string,serverVersion:_.string};Ui.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function Wi({handleButtonClick:e,handleSearchSelect:t,storeUrl:n,handleBlockletRender:r,extraFilter:o,serverVersion:c,resourceType:h,resourceDid:d,showResourcesSwitch:b,showCategory:x,...s}){const{locale:l}=pt(),[O,y]=N.useState(!1),[S,R]=N.useState({}),P=V=>{R(V)},A=n;return N.useEffect(()=>{R({showResources:!0,resourceType:h,resourceDid:d})},[A,h,d]),N.useEffect(()=>{y(!0),R({showResources:!0,resourceType:h,resourceDid:d})},[]),i.jsx(Go,{theme:yp,children:i.jsx(rs,{FallbackComponent:dr,resetKeys:[A],children:i.jsxs(te,{...s,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(s.sx)?s.sx:[s.sx]],children:[O&&i.jsx(pp,{showCategory:x,showResourcesSwitch:b,blockletRender:V=>{const W={...V,handleButtonClick:e,endpoint:A};return r({...V,defaultRender:i.jsx(Ui,{...W})})},baseSearch:!0,endpoint:A,locale:l,onFilterChange:P,onSearchSelect:t,filters:S,extraFilter:o,serverVersion:c,fetchCategoryDelay:500}),i.jsx(te,{sx:{mt:2},children:" "})]})})})}Wi.propTypes={storeUrl:_.string.isRequired,handleButtonClick:_.func,handleSearchSelect:_.func,handleBlockletRender:_.func,extraFilter:_.func,serverVersion:_.string,resourceType:_.string,resourceDid:_.string,showResourcesSwitch:_.bool,showCategory:_.bool};Wi.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0};const wp=Ve(Li)`
|
|
508
|
-
.ms-highlight {
|
|
509
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
510
|
-
}
|
|
511
|
-
`,zi=N.forwardRef(({meta:e,isMobile:t,onStepChange:n},r)=>{const{steps:o,activeStep:c,setActiveStepByKey:h,setActiveStepByIndex:d}=hl(),{t:b,locale:x}=pt(),s=o[c];return N.useEffect(()=>{n(c)},[n,c]),N.useImperativeHandle(r,()=>({setActiveStepByKey:h,setActiveStepByIndex:d})),i.jsx(Sp,{component:"div",className:t?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:i.jsx(pl,{locale:x,blockletMeta:{title:" ",...e},pcWidth:"100%",pcHeight:"100%",logoUrl:e&&e.logo&&e.registryUrl?Ol({did:e.did,version:e.version,baseUrl:e.registryUrl,logoPath:e.logo}):null,stepTip:b("blocklet.component.add"),children:i.jsx(Ep,{children:typeof(s==null?void 0:s.body)=="function"?s.body():s==null?void 0:s.body})})})});zi.propTypes={meta:_.any,onStepChange:_.func.isRequired,isMobile:_.bool.isRequired};zi.defaultProps={meta:null};const Mo=e=>e.isMobile?`
|
|
512
|
-
height: calc(100vh - 56px - 64px - 48px);
|
|
513
|
-
`:"",Ep=Ve.div`
|
|
514
|
-
width: 100%;
|
|
515
|
-
height: 100%;
|
|
516
|
-
display: flex;
|
|
517
|
-
flex-direction: column;
|
|
518
|
-
justify-content: flex-start;
|
|
519
|
-
align-items: flex-start;
|
|
520
|
-
|
|
521
|
-
.bottom-button {
|
|
522
|
-
min-width: 200px;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
// blocklet-select-side
|
|
526
|
-
aside {
|
|
527
|
-
width: 140px;
|
|
528
|
-
}
|
|
529
|
-
`,Sp=Ve(te)`
|
|
530
|
-
${({className:e})=>e==="mobileStyle"?`
|
|
531
|
-
& > div{
|
|
532
|
-
height: 100%;
|
|
533
|
-
}
|
|
534
|
-
.root-header {
|
|
535
|
-
.app-name-content {
|
|
536
|
-
display: none;
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
// content-panel
|
|
541
|
-
.root-header + div{
|
|
542
|
-
padding-top: 0;
|
|
543
|
-
position: relative;
|
|
544
|
-
& > div {
|
|
545
|
-
padding-top: 0;
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
header + div {
|
|
550
|
-
padding-top: 0;
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
header {
|
|
554
|
-
.header-title {
|
|
555
|
-
margin-left: 0;
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
.header-title-name {
|
|
559
|
-
max-width: 100% !important;
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
.app-content {
|
|
563
|
-
padding: 0!important;
|
|
564
|
-
}
|
|
565
|
-
`:`
|
|
566
|
-
position: relative;
|
|
567
|
-
.ll-container { // 通过 Launcher Layout 组件约定的 .ll-container class 自定义 Layout 样式
|
|
568
|
-
width: 100%;
|
|
569
|
-
height: 100%;
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
.root-header {
|
|
573
|
-
z-index: auto !important;
|
|
574
|
-
position: fixed !important;
|
|
575
|
-
}
|
|
576
|
-
& > div {
|
|
577
|
-
height: 100%;
|
|
578
|
-
width: 100%;
|
|
579
|
-
max-width: 100%;
|
|
580
|
-
& > div {
|
|
581
|
-
max-height: unset !important;
|
|
582
|
-
max-width: 100%;
|
|
583
|
-
& > div {
|
|
584
|
-
// left-panel
|
|
585
|
-
&:first-child {
|
|
586
|
-
padding: 0;
|
|
587
|
-
width: 20%;
|
|
588
|
-
min-width: 180px;
|
|
589
|
-
|
|
590
|
-
& > div:first-child {
|
|
591
|
-
display: none;
|
|
592
|
-
}
|
|
593
|
-
// step
|
|
594
|
-
& > div:last-child {
|
|
595
|
-
// margin-top: 32px;
|
|
596
|
-
margin-top: 0;
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
// right-panel
|
|
600
|
-
&:last-child {
|
|
601
|
-
padding-top: 0;
|
|
602
|
-
padding-right: 0px;
|
|
603
|
-
overflow-y: hidden;
|
|
604
|
-
.app-content {
|
|
605
|
-
padding: 0 0 24px 0;
|
|
606
|
-
}
|
|
607
|
-
.button-container {
|
|
608
|
-
padding-right: 0;
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
`}
|
|
616
|
-
|
|
617
|
-
& .app-overview {
|
|
618
|
-
margin-left: 0 !important;
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
& .flex-justify-center {
|
|
622
|
-
display: flex;
|
|
623
|
-
justify-content: center;
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
& .flex-align-center {
|
|
627
|
-
display: flex;
|
|
628
|
-
height: 100%;
|
|
629
|
-
align-items: center;
|
|
630
|
-
${e=>Mo(e)}
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
& .agreement-wrapper {
|
|
634
|
-
${e=>Mo(e)}
|
|
635
|
-
max-height: 60vh;
|
|
636
|
-
.eula-trigger {
|
|
637
|
-
padding-right: 0;
|
|
638
|
-
}
|
|
639
|
-
.next-button {
|
|
640
|
-
display: none;
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
& .connect {
|
|
645
|
-
background: white;
|
|
646
|
-
}
|
|
647
|
-
`,Tp=zi,jp=e=>e.inStore&&Ft.isFreeBlocklet(e)===!1,Op=e=>{var t;return[Rt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,Rt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((t=e==null?void 0:e.capabilities)==null?void 0:t.didSpace)},Fr=e=>{var t,n;return((n=(t=e==null?void 0:e.configs)==null?void 0:t.find(r=>r.key===Rt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:n.value)||null},Rp=e=>(e.environments||[]).some(t=>t.required),Fo=(e,t)=>e==null?void 0:e.some(n=>n.required&&!t[n.key]),kp=({params:e,blocklet:t,t:n})=>{const r=e.title||e.name;return r?((t==null?void 0:t.children)||[]).find(c=>c.meta.bundleDid===e.bundleDid)?n("blocklet.component.upgradeNext",{name:r}):n("blocklet.component.addNext",{name:r}):n("common.next")},Bo=({componentDid:e,timeout:t=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},t)};function Sa({onClose:e,mode:t,stores:n,resourceType:r,resourceDid:o,storageKey:c,inDialog:h,selectedMeta:d,storeUrl:b,showResourcesSwitch:x,showFromUrl:s,enableRunBackground:l,showCategory:O}){var Ut,Yt,Jt,_t,fn,I,Et;const{t:y,locale:S}=pt(),[R,P]=N.useState(!1),[A,V]=N.useState(null),[W,ee]=N.useState(""),[j,z]=N.useState(""),{api:Q,ws:{useSubscription:$},inService:ue,info:ve}=Gn(),{blocklet:ce,actions:{refreshBlocklet:Ie}}=hr(),[$e,Xe]=N.useState(null),[nt,Y]=N.useState(!1),fe={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[q,Oe]=N.useState(fe),[ie,lt]=N.useState(0),Te=N.useRef({}),Ye=N.useRef({}),Ue=N.useRef({}),Ct=Mt(J=>J.breakpoints.down("md")),Gt=Xa(),[$t,Ht]=N.useState(!0),{meta:We}=Te.current,ye=J=>Oe(oe=>({...oe,...J}));N.useEffect(()=>{if(q.pathPrefix){const{errMsg:J}=hn({...q,pathPrefix:q.pathPrefix,locale:S});ee(J)}},[q.pathPrefix]),N.useEffect(()=>{ie===0&&Oe(fe)},[ie]);const ft=()=>{const J=Fr(ce)??"";ye({didSpaceEndpoint:J})},be=()=>{var J;return(J=Te==null?void 0:Te.current)!=null&&J.meta?Ft.getDisplayName(Te.current):""},It=J=>{const oe=a=>{ye({installResultProps:{variant:"error",title:be(),subTitle:J,footer:i.jsx(st,{className:"bottom-button",disabled:a,"data-cy":"retry-install-component",onClick:async()=>{oe(!0),await dn(Te.current.installInput)},children:i.jsxs(te,{display:"flex",alignItems:"center",children:[a&&i.jsx(ht,{size:16,style:{marginRight:8}}),y("common.retry")]})})}})};oe()},Xt=J=>oe=>{var a,g;(((a=oe==null?void 0:oe.meta)==null?void 0:a.did)||(oe==null?void 0:oe.meta))===((g=ce==null?void 0:ce.meta)==null?void 0:g.did)&&J(oe)};$(Rt.BlockletEvents.statusChange,Xt(J=>{switch(J.status){case Rt.BlockletStatus.upgrading:ye({installResultProps:{variant:"success",title:be(),subTitle:y("blocklet.component.installSuccessTip")}}),Bo({componentDid:Gt.componentDid});break}const oe=Fr(ce);ye(a=>({...a,didSpaceEndpoint:oe}))}),[(Ut=ce==null?void 0:ce.meta)==null?void 0:Ut.did]),$(Rt.BlockletEvents.downloadFailed,Xt(()=>{It(y("blocklet.component.installComponentError"))}),[(Yt=ce==null?void 0:ce.meta)==null?void 0:Yt.did]),$(Rt.BlockletEvents.installFailed,Xt(()=>{It(y("blocklet.component.installComponentError"))}),[(Jt=ce==null?void 0:ce.meta)==null?void 0:Jt.did]);const Je=[],ke=()=>{P(!1),Oe({}),Te.current={},e()},un=J=>((ce==null?void 0:ce.children)||[]).find(oe=>oe.meta.did===J),dn=async J=>{var ze,St;const{pathPrefix:oe,bundleDid:a,title:g,componentName:w="",componentDid:C=""}=q,L=((ze=Te.current)==null?void 0:ze.meta)||{},{configs:U=[],registryUrl:K,inStore:de,inputUrl:se,dist:Ge}=L,Me=(St=Te.current)==null?void 0:St.downloadTokenList,we=se||(de?eo(K,a,Ge):"");P(!0);const Pe={rootDid:ce.meta.did,url:we,mountPoint:oe?Jn(oe):`/${Jn(L.title||L.name)}`,title:g,name:w,did:C,onlyRequired:!$t,...q.hasEnvironmentsStep&&U.length>0?{configs:U.map(ut=>({...ut,value:q.configsValue[ut.key]||""}))}:{},...Me?{downloadTokenList:Me}:{},...J};try{if(await Q.installComponent({input:Pe}),K){const{teamDid:ut,storeList:Tt}=os({fromBlocklet:ue,nodeInfo:ve,blocklet:ce}),{isNew:Cn,decoded:Wt}=kl(K,Tt);Cn&&await Q.addBlockletStore({input:{teamDid:ut,url:Wt}})}ye({installResultProps:{}}),Ie({showError:!1,attachRuntimeInfo:!1})}catch(ut){const Tt=us(ut);Qr.error(Tt),console.error("installComponent error: ",ut),It(Tt)}finally{P(!1),Te.current.installInput=Pe}},hn=J=>{const oe=Zl({params:{...J,did:J.bundleDid},blocklets:[ce],blocklet:ce,locale:S});if(oe){const a=un(J.bundleDid),g=ec({params:{...J,did:J.bundleDid},blocklet:ce});if(a&&a.mountPoint===g)return{errMsg:""}}return{errMsg:oe}},Qe=async J=>{var a,g;const{errMsg:oe}=hn({...q,locale:S});ee(oe),ie===Je.length-2&&await dn(J),(g=(a=Ye.current)==null?void 0:a.setActiveStepByIndex)==null||g.call(a,w=>w+1)},bt=()=>{var J,oe;(oe=(J=Ye.current)==null?void 0:J.setActiveStepByIndex)==null||oe.call(J,a=>a-1)},pn=()=>{const{pathPrefix:J,bundleDid:oe,title:a,componentName:g="",componentDid:w=""}=q,{meta:C={}}=Te.current||{},{registryUrl:L,inStore:U,inputUrl:K,dist:de}=C,se=U?eo(L,oe,de):K;Xe({meta:C,installOpts:{type:"component",rootDid:ce.meta.did,mountPoint:J,url:se,title:a,name:g,did:w}})},xt=J=>{Y(!1),ye({purchaseResultProps:{variant:"error",title:be(),subTitle:J,style:{paddingTop:120},footer:i.jsx(st,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{ye({purchaseResultProps:{}})},children:y("common.retry")})}})},mt=({downloadTokenList:J})=>{Te.current.downloadTokenList=J,Y(!1),Qe()},ct=({chooseParams:J=Te.current,componentDid:oe,isInit:a=!1})=>{var Wt,Xn,zt,mn;const{meta:g,registryUrl:w,inStore:C,inputUrl:L}=J,{did:U,title:K,name:de}=g,se=(((Wt=ce.settings)==null?void 0:Wt.children)||[]).filter(Ze=>Ze.status==="deleted"&&Ze.meta.bundleDid===U),Ge=oe||"",Me=(Xn=g.environments)==null?void 0:Xn.map(Ze=>{const{name:gn,validation:vn,...yn}=Ze,bn={validation:gl(vn)?"":vn};return{...yn,key:gn,...bn}});Te.current={...J,meta:{...g,configs:Me,registryUrl:w,inStore:C,inputUrl:L}};let we={};if(a){const Ze=[ce],gn=Me||[],vn=[],yn=ts(vl([...gn,...vn]),"key").filter(Lt=>!!Lt.key).sort((Lt,Qt)=>Lt.required&&!Qt.required?-1:Qt.required&&!Lt.required?1:0),bn=Ft.getSharedConfigObj(Ze[0],{configs:yn}),xn={},Pt=yn.map(Lt=>{const{default:Qt,key:wn,...In}=Lt;return xn[wn]=bn[wn]||Qt,{...In,key:wn,hidden:!!Rt.BLOCKLET_CONFIGURABLE_KEY[wn]}});we={...we,configsList:Pt,configsValue:xn,hasMissRequiredConfigs:Fo(Pt,xn)}}const Pe=ce.children.some(Ze=>Ze.mountPoint==="/"),ze=se.find(Ze=>Ze.meta.bundleDid===U),St=ce.children.find(Ze=>Ze.meta.bundleDid===U);we.title=K||"",ze?we={...we,pathPrefix:ze.mountPoint||"",componentName:ze.meta.name,hasEnvironmentsStep:!1}:St?we={...we,pathPrefix:St.mountPoint||"",componentName:St.meta.name,hasEnvironmentsStep:!1}:we={...we,pathPrefix:Pe?`/${Jn(K)||Jn(de)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((mn=(zt=Te.current.meta)==null?void 0:zt.environments)==null?void 0:mn.length)>0};const ut=jp(Te.current.meta),Tt=Op(Te.current.meta),Cn=Fr(ce);ye({bundleDid:U,componentDid:Ge,...we,hasRequiredEnvironments:Rp(Te.current.meta),requirePurchase:ut,didSpaceIsRequiredSetup:Tt,didSpaceEndpoint:Cn}),a&&ut&&pn()};N.useEffect(()=>{!d||ie!==0||!ce||(ct({chooseParams:{blocklets:[d],meta:d,registryUrl:b||d.homepage,inStore:!0},isInit:!0}),ye({showFromUrlDialog:!1}),Qe())},[d,ie,ce]),Je.push({key:"selectComponent",name:y("blocklet.component.selectComponent"),body:i.jsxs(en,{sx:{width:400},component:"div",children:[s&&q.showFromUrlDialog&&i.jsx(Oi,{mode:"component",onCancel:()=>{ye({showFromUrlDialog:!1})},onSuccess:({meta:J,inputUrl:oe,inStore:a,registryUrl:g})=>{ct({chooseParams:{meta:J,inputUrl:oe,inStore:a,registryUrl:g},isInit:!0}),ye({showFromUrlDialog:!1}),Qe()},handleText:{title:y("blocklet.component.addComponentTip.fromUrl"),confirm:y("blocklet.component.choose")}}),i.jsx(Pi,{stores:n,extra:Jo.isInServerlessMode(ve)?null:s?i.jsxs(st,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{ye({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[i.jsx(hs,{style:{fontSize:20,marginRight:4}})," ",y("blocklet.component.addComponentTip.fromUrl")," "]}):null,loading:R,onChange:()=>{Oe({}),Te.current={}},storageKey:c,children:({currentRegistry:J})=>i.jsx(Wi,{showResourcesSwitch:x,showCategory:O,serverVersion:ve==null?void 0:ve.version,style:Ct?{height:"calc(100vh - 56px - 80px - 32px - 10px )"}:{height:"calc(100% - 10px)"},storeUrl:J.url,resourceType:r,resourceDid:o,handleButtonClick:oe=>{ct({chooseParams:{...oe,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:oe,defaultRender:a})=>{const g=(q==null?void 0:q.bundleDid)&&(q==null?void 0:q.bundleDid)===(oe==null?void 0:oe.did);return i.jsxs(Ip,{children:[g&&i.jsx("div",{className:"check-container",children:i.jsx(is,{className:"check-icon"})}),i.jsx("div",{className:g?"choose-blocklet":"",style:{marginLeft:16},children:a})]})}})})]}),cancel:t==="embed"?void 0:y("common.cancel"),confirm:kp({params:q,blocklet:ce,t:y}),onCancel:ke,onConfirm:()=>{Qe()}}),Je.push({key:"agreement",name:y("launchBlocklet.introduction"),body:i.jsxs(en,{component:"div",className:"agreement-wrapper",children:[i.jsx(ss,{title:y("launchBlocklet.introduction"),subTitle:y("blocklet.component.addComponentTip.introduction")}),i.jsx(ci,{meta:We,onClickNext:Qe,installRelated:$t,onChangeInstallRelated:Ht,handleDescEle:i.jsx("p",{children:y("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:d?void 0:y("common.pre"),confirm:y("launchBlocklet.next"),onCancel:d?ke:bt,onConfirm:()=>{Y(!1),Qe()}}),We&&q.requirePurchase&&Je.push({key:"purchase",name:i.jsxs(i.Fragment,{children:[y("common.verifyNFT"),i.jsx(wr,{})]}),body:i.jsxs(en,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((fn=(_t=Ue.current)==null?void 0:_t.getCurrentStep)==null?void 0:fn.call(_t))===2||nt)&&i.jsx(tr,{title:y("common.verifyNFT"),subTitle:y("blocklet.component.addComponentTip.verifyNFT")}),Bn(q.purchaseResultProps)?$e&&i.jsx(zd,{ref:Ue,meta:$e.meta,mode:q.componentDid?"verify":"both",onCancel:xt,installOpts:$e.installOpts,handlePaySuccess:mt}):i.jsx("div",{className:"flex-align-center flex-justify-center",children:i.jsx(to,{...q.purchaseResultProps})})]}),disabled:((Et=(I=Ue.current)==null?void 0:I.getCurrentStep)==null?void 0:Et.call(I))===2||nt,cancel:y("common.pre"),confirm:y("common.next"),onConfirm:()=>{typeof Ue.current.onNext=="function"&&(Ue.current.onNext(),Y(!0))},onCancel:()=>{bt()}}),Ft.hasStartEngine(We)&&Je.push({key:"config",name:y("common.config"),error:W,body:i.jsxs(en,{component:"div",children:[i.jsx(tr,{title:y("common.config"),subTitle:y("blocklet.component.addComponentTip.config")}),i.jsx(ar,{label:y("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:j||y("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:q.pathPrefix,onChange:J=>{const oe=J.target.value;ye({pathPrefix:oe}),z(y("common.slugifyHint",{value:Rl(oe)}))}}),!!W&&i.jsx(Ko,{severity:"error",style:{width:"100%",marginTop:8},children:W})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:bt,onConfirm:()=>{Qe()}}),We&&(q!=null&&q.hasEnvironmentsStep)&&Je.push({key:"environment",name:i.jsxs(i.Fragment,{children:[y("common.environment")," ",q.hasRequiredEnvironments&&i.jsx(wr,{})]}),disabled:!!A||(q==null?void 0:q.hasMissRequiredConfigs),body:()=>i.jsxs(en,{component:"div",style:{overflowY:"auto"},children:[i.jsx(tr,{title:y("common.environment"),subTitle:y("blocklet.component.addComponentTip.environment")}),i.jsx(_l,{style:{marginTop:-12,width:"100%"},schema:q.configsList,defaultValue:q.configsValue,onChange:(J,{action:oe,currentItem:a,allValues:g})=>{oe==="confirm"&&ye({hasMissRequiredConfigs:Fo(q.configsList,g),configsValue:g}),oe==="edit"?V(a):["cancel","confirm"].includes(oe)&&V(null)}})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:bt,onConfirm:Qe}),We&&(q!=null&&q.didSpaceIsRequiredSetup)&&Je.push({key:"didSpace",name:i.jsxs(i.Fragment,{children:[y("blocklet.component.didSpaceConfig")," ",q.didSpaceIsRequiredSetup==="required"&&i.jsx(wr,{})]}),disabled:(q==null?void 0:q.didSpaceIsRequiredSetup)&&!q.didSpaceEndpoint,body:()=>i.jsx(Il,{children:i.jsxs(en,{component:"div",children:[i.jsx(tr,{title:y("blocklet.component.didSpaceConfig"),subTitle:y("blocklet.component.didSpaceConfigTip")}),i.jsx(te,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:i.jsx(_i,{blockletMeta:Te.current.meta,onNext:()=>{Qe()},onEndpointUpdate:ft})})]})}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:bt,onConfirm:Qe}),Je.push({key:"install",name:un(We==null?void 0:We.did)?y("common.upgrade"):y("common.install"),disabled:l?!1:Bn(q.installResultProps),loading:l?!1:Bn(q.installResultProps),body:i.jsx(en,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Bn(q.installResultProps)?i.jsx(fl,{message:i.jsx(_p,{children:y(l?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):i.jsx("div",{style:{marginTop:120},children:i.jsx(to,{...q.installResultProps})})}),confirm:y("common.complete"),onConfirm:()=>{Bo({timeout:0,componentDid:Gt.componentDid,manual:!0}),ke(),setTimeout(()=>{const J=document.getElementsByClassName("dashboard-main")[0];J&&(J.scrollTop=J.scrollHeight)},200)}});const Re=Je[ie]||{},wt=()=>R||Re.error||!q.bundleDid?!0:ie>1?!q.pathPrefix:!1;return ce?i.jsxs(Cp,{sx:{width:"100%",height:Ct?window.innerHeight:h?"72vh":"100vh"},children:[i.jsx(ml,{steps:Je,mode:"memory",children:i.jsx(Tp,{ref:Ye,meta:We,isMobile:Ct,onStepChange:J=>{lt(J)}})}),i.jsxs(te,{className:"action-bar",children:[Re.cancel&&i.jsx(st,{onClick:J=>{J.stopPropagation(),Re.onCancel()},disabled:ie===Je.length-2&&R,color:"inherit",children:Re.cancel||y("common.cancel")}),Re.confirm&&i.jsx(st,{onClick:J=>{J.stopPropagation(),Re.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:R||(typeof Re.disabled=="boolean"?Re.disabled:wt()),variant:"contained",autoFocus:!0,title:Re.confirm,style:{marginLeft:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:i.jsxs(te,{display:"flex",alignItems:"center",children:[(typeof Re.loading=="boolean"?Re.loading:R)&&i.jsx(ht,{style:{marginRight:8},size:16}),Re.confirm]})})]})]}):null}Sa.propTypes={onClose:_.func,mode:_.oneOf(["normal","embed"]),inDialog:_.bool,stores:_.arrayOf(_.string),storeUrl:_.string,resourceType:_.string,resourceDid:_.string,storageKey:_.string,selectedMeta:_.object,showResourcesSwitch:_.bool,showFromUrl:_.bool,enableRunBackground:_.bool,showCategory:_.bool};Sa.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const Cp=Ve(te)`
|
|
648
|
-
.action-bar {
|
|
649
|
-
display: flex;
|
|
650
|
-
justify-content: flex-end;
|
|
651
|
-
position: sticky;
|
|
652
|
-
bottom: 0;
|
|
653
|
-
padding-top: 16px;
|
|
654
|
-
z-index: 100;
|
|
655
|
-
width: 100%;
|
|
656
|
-
background: #fff;
|
|
657
|
-
border-top: 1px solid #eee;
|
|
658
|
-
}
|
|
659
|
-
`,en=Ve(ge)`
|
|
660
|
-
width: 100%;
|
|
661
|
-
height: 100%;
|
|
662
|
-
`,tr=Ve(ss)`
|
|
663
|
-
margin-bottom: 24px;
|
|
664
|
-
`,Ip=Ve.div`
|
|
665
|
-
position: relative;
|
|
666
|
-
|
|
667
|
-
.choose-blocklet {
|
|
668
|
-
background-color: rgb(236, 251, 253);
|
|
669
|
-
border-color: rgb(236, 251, 253);
|
|
670
|
-
border-radius: 8px;
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
.check-container {
|
|
674
|
-
position: absolute;
|
|
675
|
-
right: 0;
|
|
676
|
-
bottom: 0;
|
|
677
|
-
display: flex;
|
|
678
|
-
justify-content: flex-end;
|
|
679
|
-
align-items: flex-end;
|
|
680
|
-
width: 30px;
|
|
681
|
-
height: 30px;
|
|
682
|
-
border-radius: 0 0 8px 0;
|
|
683
|
-
color: ${e=>e.theme.palette.common.white};
|
|
684
|
-
overflow: hidden;
|
|
685
|
-
transition: all ease 0.3s;
|
|
686
|
-
&:after {
|
|
687
|
-
position: absolute;
|
|
688
|
-
z-index: 0;
|
|
689
|
-
display: block;
|
|
690
|
-
width: 0;
|
|
691
|
-
height: 0;
|
|
692
|
-
border-top: transparent solid 15px;
|
|
693
|
-
border-left: transparent solid 15px;
|
|
694
|
-
border-bottom: ${e=>e.theme.palette.primary.main} solid 15px;
|
|
695
|
-
border-right: ${e=>e.theme.palette.primary.main} solid 15px;
|
|
696
|
-
transition: all ease 0.1s;
|
|
697
|
-
content: '';
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
.check-icon {
|
|
701
|
-
position: relative;
|
|
702
|
-
z-index: 2;
|
|
703
|
-
margin: 0 1px 1px 0;
|
|
704
|
-
font-size: 16px;
|
|
705
|
-
transition: all ease 0.2s;
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
`,_p=Ve.div`
|
|
709
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
710
|
-
.msg-before {
|
|
711
|
-
display: inline-block;
|
|
712
|
-
color: #aaa;
|
|
713
|
-
font-size: 14px;
|
|
714
|
-
margin-right: 6px;
|
|
715
|
-
}
|
|
716
|
-
`;export{Sa as A,ea as B,cf as S,af as a,lf as b,hs as d,bs as f};
|