@abtnode/blocklet-services 1.16.40-beta-20250305-115031-9569f29a → 1.16.40-beta-20250310-113951-17556f90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/index.js +3 -1
- package/api/routes/ocap.js +37 -0
- package/api/routes/user-session.js +69 -42
- package/api/routes/user.js +83 -38
- package/dist/assets/ArrowDropDown-Cm4c8BlY.js +1 -0
- package/dist/assets/CheckCircle-sJN5S1iC.js +1 -0
- package/dist/assets/ChevronLeft-BeX0eKuU.js +1 -0
- package/dist/assets/ChevronRight-BWxZ0GT9.js +1 -0
- package/dist/assets/Community-CjBbjelR.js +1 -0
- package/dist/assets/DeleteOutline-DnZa0RcQ.js +1 -0
- package/dist/assets/Done-CUONuiq7.js +1 -0
- package/dist/assets/Download-BymJGiyd.js +1 -0
- package/dist/assets/EditIcon-ejHqaqyS.js +1 -0
- package/dist/assets/Email-5VJNIBMV.js +1 -0
- package/dist/assets/Error-B8-wyPeq.js +1 -0
- package/dist/assets/ExpandLess-1p_uqVHy.js +1 -0
- package/dist/assets/{Google-Bdmd8THj.js → Google-CtwTVSPC.js} +1 -1
- package/dist/assets/Holiday-cZPVLjRi.js +1 -0
- package/dist/assets/InfoOutlined-aPcuFKow.js +1 -0
- package/dist/assets/Launch-CNY19G4F.js +1 -0
- package/dist/assets/LaunchOutlined-CBLNAogt.js +1 -0
- package/dist/assets/Location-Ddaqgs_o.js +1 -0
- package/dist/assets/LockIcon-BSkJrAvs.js +1 -0
- package/dist/assets/Meeting-B1Wf1UR0.js +1 -0
- package/dist/assets/MoreHoriz-BTnTEmyW.js +1 -0
- package/dist/assets/OffSick-DjJVy-QB.js +1 -0
- package/dist/assets/Phone-CRdqD7Iq.js +1 -0
- package/dist/assets/PlayArrow-BWaTV7IU.js +1 -0
- package/dist/assets/QuestionMarkCircle-mj_OeUT2.js +1 -0
- package/dist/assets/ServerLogo-DaTXUmCj.js +1 -0
- package/dist/assets/Timezone-D9FI_BOf.js +1 -0
- package/dist/assets/ViewList-gKXyJK1z.js +1 -0
- package/dist/assets/WorkingRemotely-DPFHPJzl.js +1 -0
- package/dist/assets/access-control-CRSnnV6w.js +13 -0
- package/dist/assets/{actions-BLxaYaFH.js → actions-D8Lw3xe3.js} +1 -1
- package/dist/assets/add-component-core-BzFnxw8D.js +765 -0
- package/dist/assets/add-resource-C5MQEh_d.js +1 -0
- package/dist/assets/addon-DThNrUvh.js +14 -0
- package/dist/assets/analytics-BEGoboDQ.js +84 -0
- package/dist/assets/api-Dia2_ulr.js +1 -0
- package/dist/assets/ar-7cNXWZ2M.js +3 -0
- package/dist/assets/audit-logs-BP-xi6Ls.js +35 -0
- package/dist/assets/base32-CkPppFg3.js +1 -0
- package/dist/assets/branding-D1FesAUj.js +40 -0
- package/dist/assets/bundle-avatar-Ne6xQFVO.js +1 -0
- package/dist/assets/button-Bzt1WONY.js +1 -0
- package/dist/assets/click-to-copy-Ds1jMEk3.js +1 -0
- package/dist/assets/{cloneDeep-6qDcDoTp.js → cloneDeep-B_ounxQq.js} +1 -1
- package/dist/assets/{complete-D578HSm9.js → complete-Cw_4hnLS.js} +4 -4
- package/dist/assets/{component-DCe18oJu.js → component-InzHICwc.js} +1 -1
- package/dist/assets/config-Chl1wmCe.js +1 -0
- package/dist/assets/{config-BUwSAf4L.js → config-Dneb0aPp.js} +2 -2
- package/dist/assets/{config-navigation-CaYhfgdu.js → config-navigation-pBPU0Hd1.js} +6 -6
- package/dist/assets/config-space-DAxx03my.js +1 -0
- package/dist/assets/confirm-twAiL-Pg.js +7 -0
- package/dist/assets/connect-CCL_tilR.js +1 -0
- package/dist/assets/connect-CcqhkXJt.js +5 -0
- package/dist/assets/connect-to-CdxZm7ze.js +1 -0
- package/dist/assets/{content-layout-B8euliPp.js → content-layout-GiaabWKJ.js} +1 -1
- package/dist/assets/dashboard-j9G-KyD0.js +218 -0
- package/dist/assets/{de-D18LzkQY.js → de-CaFcE4Pk.js} +1 -1
- package/dist/assets/delete-confirm-B7RqZZsx.js +1 -0
- package/dist/assets/did-address-aMjKReYC.js +1 -0
- package/dist/assets/domain-BoBqD6my.js +9 -0
- package/dist/assets/domain-action-card-BK6VL21y.js +29 -0
- package/dist/assets/domains-CzuWJAXa.js +1 -0
- package/dist/assets/{email-KAJlxYPo.js → email-D62rIr3r.js} +2 -2
- package/dist/assets/es-D3MSycJa.js +3 -0
- package/dist/assets/exchange-passport-C6QFYPcO.js +1 -0
- package/dist/assets/form-text-input-BeH6diu_.js +11 -0
- package/dist/assets/fr-CFHLZm_-.js +3 -0
- package/dist/assets/fuel-D-BDqeNn.js +32 -0
- package/dist/assets/fullpage-CaydfTeK.js +1 -0
- package/dist/assets/get-safe-url-DmtG3OsE.js +1 -0
- package/dist/assets/get-safe-url-DpCrXjD2.js +1 -0
- package/dist/assets/hi-yZjHgxBy.js +1 -0
- package/dist/assets/home-Cuc7_BZ5.js +1 -0
- package/dist/assets/id-CEzizPO2.js +3 -0
- package/dist/assets/iframe-BDXgtf3V.js +1 -0
- package/dist/assets/index--Cpu5zj7.js +11 -0
- package/dist/assets/{index-BhSRK58N.js → index-B17pt9EP.js} +6 -6
- package/dist/assets/{index-DoNZBHNi.js → index-BJbC-Qjr.js} +52 -52
- package/dist/assets/index-Bcdz6ivm.js +291 -0
- package/dist/assets/{index-Mj8Kilqv.js → index-BjppTGHl.js} +1 -1
- package/dist/assets/{index-CikqCCcV.js → index-BkVeJ_e6.js} +7 -7
- package/dist/assets/index-BxEJpAM1.js +134 -0
- package/dist/assets/{index-3unD3ckH.js → index-C0wrMJu_.js} +1 -1
- package/dist/assets/{index-Brx6-WRV.js → index-C1klzBZN.js} +1 -1
- package/dist/assets/{index-D-W1QzOs.js → index-CMRvG2xO.js} +1 -1
- package/dist/assets/index-CTjSo_AM.js +138 -0
- package/dist/assets/index-CUYPBPCk.js +1 -0
- package/dist/assets/{index-CQoDmhBj.js → index-CVOcFexA.js} +8 -8
- package/dist/assets/index-CXzEtZ8-.js +5 -0
- package/dist/assets/{index-DmFVT2Y_.js → index-DC8p-aHz.js} +1 -1
- package/dist/assets/{index-KQ6M4B59.js → index-DloKVD7k.js} +3 -3
- package/dist/assets/index-HAqfkqId.js +4 -0
- package/dist/assets/index-KCwqCBtZ.js +1 -0
- package/dist/assets/{index-BZu4MJFr.js → index-NOMtolNQ.js} +1 -1
- package/dist/assets/index-Y2eFnQMq.js +109 -0
- package/dist/assets/index-uoDarD9I.js +1 -0
- package/dist/assets/{invitation-C7DIKmu_.js → invitation-CZiw6z3M.js} +7 -7
- package/dist/assets/invite-Dsc4lS8l.js +5 -0
- package/dist/assets/issue-passport-RgE7dNyX.js +1 -0
- package/dist/assets/item-zC83d6Jc.js +2 -0
- package/dist/assets/ja-BzgY_7dF.js +3 -0
- package/dist/assets/ko-VZQe2VvU.js +3 -0
- package/dist/assets/{launch-result-message-DgQUOIWL.js → launch-result-message-DvBZHCJ7.js} +1 -1
- package/dist/assets/{layout-C5Uy45Tb.js → layout--BSYMlCG.js} +2 -2
- package/dist/assets/list-DTzzPxLP.js +193 -0
- package/dist/assets/list-header-Cb3sYAQH.js +57 -0
- package/dist/assets/localization-DFOGQYul.js +1 -0
- package/dist/assets/{log-5sot6gUJ.js → log-DyxPA0PM.js} +1 -1
- package/dist/assets/login-DPEenGU7.js +1 -0
- package/dist/assets/login-oauth-callback-B4CoyqBw.js +1 -0
- package/dist/assets/logo-uploader-G4QDSsmU.js +133 -0
- package/dist/assets/lost-passport-CfqCVhZZ.js +168 -0
- package/dist/assets/lottie-web-B6s7dDoL.js +9 -0
- package/dist/assets/{omit-CxKFl3YR.js → omit-B4UQ3GvX.js} +1 -1
- package/dist/assets/open-window-Ctz49LJV.js +1 -0
- package/dist/assets/overview-B32B6ff2.js +12 -0
- package/dist/assets/{page-header-BxFwzzsQ.js → page-header-CmCHR1mk.js} +1 -1
- package/dist/assets/{permission-CFzf76RO.js → permission-BPUMaZy_.js} +1 -1
- package/dist/assets/preferences-BJxsqezy.js +1 -0
- package/dist/assets/pt-DpDK-Gpl.js +1 -0
- package/dist/assets/publish-resource-DosFKyd_.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-iBp-yx3f.js → react-beautiful-dnd.esm-BxnrNcYv.js} +4 -4
- package/dist/assets/relative-time-BPP0lNWq.js +1 -0
- package/dist/assets/ru-BV_Z5dZ0.js +1 -0
- package/dist/assets/sdk-DT6U58At.js +1 -0
- package/dist/assets/session-BpknZId5.js +1 -0
- package/dist/assets/setup-B50yc7wk.js +19 -0
- package/dist/assets/{shorten-label-DXP5M5GB.js → shorten-label-dPKLJRIw.js} +1 -1
- package/dist/assets/{simple-select-NHdBjvAy.js → simple-select-B4jrDuc2.js} +1 -1
- package/dist/assets/{slicedToArray-DPt500Gd.js → slicedToArray-CQCWut1L.js} +2 -2
- package/dist/assets/start-N83AUhRn.js +187 -0
- package/dist/assets/status-DCrcVds4.js +2 -0
- package/dist/assets/{step-actions-DTx1d1Sw.js → step-actions-CQeRAM0V.js} +1 -1
- package/dist/assets/studio-BKW7u_X7.js +6 -0
- package/dist/assets/{switch-control-BBeZvEAE.js → switch-control-BF9Q5dT3.js} +1 -1
- package/dist/assets/th-CbQMXNrp.js +1 -0
- package/dist/assets/traffic-DIZGb0Wa.js +37 -0
- package/dist/assets/transfer-13oWu-Fn.js +16 -0
- package/dist/assets/unsubscribe-BcN3c7Ba.js +1 -0
- package/dist/assets/{use-mobile-B-PzRAbm.js → use-mobile-DAiUO9Qj.js} +1 -1
- package/dist/assets/{useAsync-DG6gLBRZ.js → useAsync-DOwDXG5n.js} +1 -1
- package/dist/assets/{useAsyncRetry-DGf8Nzkx.js → useAsyncRetry-Cbcg1dvJ.js} +2 -2
- package/dist/assets/useLocalStorage-BmgSZ9f3.js +1 -0
- package/dist/assets/user-center-CI8PKX42.js +79 -0
- package/dist/assets/util-CmPA8v8L.js +1 -0
- package/dist/assets/util-LJfbsxXq.js +1 -0
- package/dist/assets/vendor-arcblock-BSReIGUe.js +2381 -0
- package/dist/assets/vendor-hooks-B7GuuzU5.js +7 -0
- package/dist/assets/vendor-mui-core-BGkzVIkr.js +266 -0
- package/dist/assets/{vendor-mui-x-l1ezRCJc.js → vendor-mui-x-ZeS-_tC0.js} +1 -1
- package/dist/assets/{vendor-utils-oUOK1Lc7.js → vendor-utils-DDG_VdF0.js} +1 -1
- package/dist/assets/vendor-ux-did-connect-yBp5D51w.js +1073 -0
- package/dist/assets/vi-Bz70uJJ-.js +1 -0
- package/dist/assets/wrap-locale-DyYbMONP.js +1 -0
- package/dist/assets/{zh-Cw2E9SuI.js → zh-nXsPl6mo.js} +1 -1
- package/dist/assets/zh-tw-B6GPK4BD.js +3 -0
- package/dist/index.html +8 -6
- package/dist/service-worker.js +1 -1
- package/package.json +31 -30
- package/dist/assets/Add-hDPhgcb8.js +0 -1
- package/dist/assets/ArrowDropDown-S78kvSgg.js +0 -1
- package/dist/assets/CheckCircle-KfKBnFRW.js +0 -1
- package/dist/assets/ChevronLeft-CbtVFRMC.js +0 -1
- package/dist/assets/ChevronRight-WXIi0AqM.js +0 -1
- package/dist/assets/DeleteOutline-CDgHO4-2.js +0 -1
- package/dist/assets/Done-Ck5ymNM-.js +0 -1
- package/dist/assets/Download-BCt5_Xtj.js +0 -1
- package/dist/assets/EditIcon-CMs1pbEF.js +0 -1
- package/dist/assets/Error-DunMaBzN.js +0 -1
- package/dist/assets/ExpandLess-JQZdwBbU.js +0 -1
- package/dist/assets/InfoOutlined-C4DBI2hZ.js +0 -1
- package/dist/assets/Launch-C-Inbjf1.js +0 -1
- package/dist/assets/LaunchOutlined-CMeuETnG.js +0 -1
- package/dist/assets/LockIcon-8k0MoCr8.js +0 -1
- package/dist/assets/MoreHoriz-SXaWAchr.js +0 -1
- package/dist/assets/PlayArrow-Drngi6DM.js +0 -1
- package/dist/assets/QuestionMarkCircle-DRDWkVkn.js +0 -1
- package/dist/assets/ServerLogo-zTW7vice.js +0 -1
- package/dist/assets/ViewList-CIudz6A1.js +0 -1
- package/dist/assets/access-control-f3_Azppj.js +0 -13
- package/dist/assets/add-component-core-B7Gu6G9O.js +0 -765
- package/dist/assets/add-resource-Dod13n0P.js +0 -1
- package/dist/assets/addon-D0oJMRF-.js +0 -14
- package/dist/assets/analytics-CgyKfOXs.js +0 -11
- package/dist/assets/api-C4EBZ3D8.js +0 -1
- package/dist/assets/ar-BvRDrl-h.js +0 -3
- package/dist/assets/audit-logs-D3uqnYW7.js +0 -35
- package/dist/assets/base32-BkXUMliK.js +0 -1
- package/dist/assets/branding-DNZx02j9.js +0 -40
- package/dist/assets/bundle-avatar-CPxLfXrI.js +0 -1
- package/dist/assets/button-B6x_cuep.js +0 -1
- package/dist/assets/click-to-copy-CGY-KfC1.js +0 -1
- package/dist/assets/config-AUN0KmC2.js +0 -1
- package/dist/assets/config-space-CYs5vTpU.js +0 -1
- package/dist/assets/confirm-DysGsWlb.js +0 -7
- package/dist/assets/connect-CGmwjDQl.js +0 -5
- package/dist/assets/connect-CswAw6jx.js +0 -1
- package/dist/assets/connect-to-BQCKg6lB.js +0 -1
- package/dist/assets/dashboard-BYP0lFc1.js +0 -218
- package/dist/assets/delete-confirm-CxJ_xq3P.js +0 -1
- package/dist/assets/did-address-Bf8qM4uR.js +0 -1
- package/dist/assets/domain-DziiMtvO.js +0 -9
- package/dist/assets/domain-action-card-BhI9_vPO.js +0 -17
- package/dist/assets/domains-DQHyaAeW.js +0 -1
- package/dist/assets/es-is1Q8RnK.js +0 -3
- package/dist/assets/exchange-passport-C3AhVaU1.js +0 -1
- package/dist/assets/form-text-input-DGrWoQps.js +0 -11
- package/dist/assets/fr-Buu4BG5m.js +0 -3
- package/dist/assets/fuel-DerZDNtI.js +0 -32
- package/dist/assets/fullpage-DasvZmzb.js +0 -1
- package/dist/assets/get-safe-url-Cjj-SJ8P.js +0 -1
- package/dist/assets/get-safe-url-D4LuJrKT.js +0 -1
- package/dist/assets/hi-DGeeysYm.js +0 -1
- package/dist/assets/home-JWShj3xG.js +0 -1
- package/dist/assets/id-NlIgbQ92.js +0 -3
- package/dist/assets/iframe-CaPZffPT.js +0 -1
- package/dist/assets/index--xsUDxoE.js +0 -138
- package/dist/assets/index-BLXh-rLN.js +0 -11
- package/dist/assets/index-BVEhbxkj.js +0 -1
- package/dist/assets/index-C24CwgC5.js +0 -1
- package/dist/assets/index-CxSfbL8C.js +0 -4
- package/dist/assets/index-D-_kJXEQ.js +0 -134
- package/dist/assets/index-DBdIGGHk.js +0 -5
- package/dist/assets/index-Doq3Vtou.js +0 -1
- package/dist/assets/index-dmAbWYEg.js +0 -291
- package/dist/assets/index-javzz5zL.js +0 -109
- package/dist/assets/invite-BL1KzmsJ.js +0 -5
- package/dist/assets/isEmail-DKEyei-O.js +0 -1
- package/dist/assets/issue-passport-00ieW7dP.js +0 -1
- package/dist/assets/item-CZ7lE3uJ.js +0 -2
- package/dist/assets/ja-ZWJjus9M.js +0 -3
- package/dist/assets/ko-BhHmR8oQ.js +0 -3
- package/dist/assets/list-DS7ThX70.js +0 -189
- package/dist/assets/list-header-CIWer9RC.js +0 -57
- package/dist/assets/localization-BqlHRVPq.js +0 -1
- package/dist/assets/login-CGLjmpPa.js +0 -1
- package/dist/assets/login-oauth-callback-2BZORM7d.js +0 -1
- package/dist/assets/logo-uploader-BUbZey33.js +0 -133
- package/dist/assets/lost-passport-CsnG9qDe.js +0 -168
- package/dist/assets/open-window-OGNFGaoa.js +0 -1
- package/dist/assets/overview-DMYIOaJ3.js +0 -12
- package/dist/assets/preferences-BcS_Bi9F.js +0 -1
- package/dist/assets/pt-BhvKzxfK.js +0 -1
- package/dist/assets/publish-resource-PsYRscNX.js +0 -1
- package/dist/assets/relative-time-DKp6opcA.js +0 -1
- package/dist/assets/ru-Cc01DBPA.js +0 -1
- package/dist/assets/sdk-cfSPGhz-.js +0 -1
- package/dist/assets/session-OA-ygaPp.js +0 -1
- package/dist/assets/setup-58gBrv4L.js +0 -19
- package/dist/assets/start-A6ay_10_.js +0 -187
- package/dist/assets/status-Ds_eN-NY.js +0 -2
- package/dist/assets/studio-DfQNKV55.js +0 -6
- package/dist/assets/th-DMmvF5EW.js +0 -1
- package/dist/assets/traffic-Gc0h4-UU.js +0 -37
- package/dist/assets/transfer-DQE_fCzw.js +0 -16
- package/dist/assets/unsubscribe-CdrwBtFq.js +0 -1
- package/dist/assets/useLocalStorage-D_fQAujG.js +0 -1
- package/dist/assets/user-center-BDUUKdSj.js +0 -71
- package/dist/assets/util-Ca9j-VTa.js +0 -1
- package/dist/assets/util-x3peBGqE.js +0 -1
- package/dist/assets/vendor-arcblock-o7bY298v.js +0 -3401
- package/dist/assets/vendor-hooks-Bxo1qD_4.js +0 -7
- package/dist/assets/vendor-mui-core-Dh3XBxY7.js +0 -266
- package/dist/assets/vi-Bxs4l6dO.js +0 -1
- package/dist/assets/wrap-locale-DOh7YZzw.js +0 -1
- package/dist/assets/zh-tw-Dqct16yD.js +0 -3
- /package/dist/assets/{vendor-arcblock-DhgPdlEj.css → vendor-ux-did-connect-DhgPdlEj.css} +0 -0
|
@@ -0,0 +1,765 @@
|
|
|
1
|
+
import{a1 as Zr,j as i,E as P,a2 as vt,a9 as He,a3 as Y,T as ge,t as Xt,bk as ei,bM as ti,I as Wo,bz as zo,bN as qo,z as Ko,be as Ia,b1 as Vo,bO as Pa,M as mr,bs as _a,bt as La,bu as Na,bo as Aa,ac as Go,L as Da,b0 as Ma,a_ as Fa,aj as ni,a4 as Ho,a6 as Ba,ad as tt,e as tr,bB as $a,x as nr,R as Xo,V as Yo,ai as Qo,bI as Jo,af as Ua,aa as Ht,bd as Qi,A as Ji,Z as Wa,P as za,G as qa,v as Ka,$ as Va,D as Ga,K as Zi,bm as Ha}from"./vendor-mui-core-BGkzVIkr.js";import{r as L,g as ri,f as Xa,k as Ya,a as ii,e as Se,b as Qa,l as Ja}from"./vendor-react-DoD83n6N.js";import{j as Zo,d as Za,S as el,s as es,A as tl}from"./item-zC83d6Jc.js";import{r as oi,B as dt,ai as si,M as ts,p as ns,u as yt,i as at,a as nl,l as rl,ah as gr,aW as il,ak as rs,ba as eo,an as ol,Q as ai,C as sl,s as Qt,P as hr,au as to,ad as is,bb as ur,f as li,a$ as os,g as ss,V as al,bc as ll,ag as qr,bd as cl}from"./vendor-ux-did-connect-yBp5D51w.js";import{z as Nn,f as Bt,Z as ul,_ as dl,h as Rt,$ as hl,D as pl,a0 as fl,a1 as ml,a2 as gl,C as vr,a3 as as,X as vl,a4 as yl,a5 as bl,a6 as xl,a7 as ir,a8 as no,a9 as wl}from"./index-BJbC-Qjr.js";import{j as ro,c as El,E as yr,e as Sl,f as Tl,L as jl,S as Ol}from"./vendor-arcblock-BSReIGUe.js";import{L as io}from"./launch-result-message-DvBZHCJ7.js";import{P as ls}from"./page-header-CmCHR1mk.js";import{b as ut,p as kl,B as Rl,C as oo,x as Jn,X as cs,$ as Cl,aa as Il,G as Pl,K as jr,w as ci,V as _l,ab as Ll,ac as Nl,ad as Al,y as Xn,ae as Dl,c as Ml}from"./vendor-utils-DDG_VdF0.js";import{u as Fl,C as Bl}from"./config-space-DAxx03my.js";import{R as Or}from"./logo-uploader-G4QDSsmU.js";import{S as $l}from"./index--Cpu5zj7.js";import{s as us,h as Ul,w as Wl,f as zl,a as ql,b as Kl,c as Vl,M as Gl}from"./index-CMRvG2xO.js";import{l as rr,f as Hl,a as Xl,e as ds,w as Yl}from"./vendor-hooks-B7GuuzU5.js";import{g as Ql}from"./get-safe-url-DmtG3OsE.js";import{p as Jl}from"./index-NOMtolNQ.js";import{r as Zl}from"./cloneDeep-B_ounxQq.js";import{I as so}from"./index-C1klzBZN.js";import{u as ec}from"./session-BpknZId5.js";import{W as tc}from"./did-address-aMjKReYC.js";import{_ as hs}from"./useLocalStorage-BmgSZ9f3.js";import{f as ps}from"./format-error-LAoTjvJe.js";import{a as ao}from"./api-Dia2_ulr.js";import{d as nc,a as rc,v as ic,e as oc}from"./util-CmPA8v8L.js";import{u as fs}from"./use-mobile-DAiUO9Qj.js";import{C as sc}from"./content-layout-GiaabWKJ.js";import{C as ac,D as lc,a as cc}from"./connect-to-CdxZm7ze.js";import{d as uc}from"./ArrowDropDown-Cm4c8BlY.js";import{d as dc}from"./ChevronLeft-BeX0eKuU.js";import{d as hc}from"./ChevronRight-BWxZ0GT9.js";const cf="blocklet-add-component-registry",uf="server-add-registry",df=e=>`resource-${e}-add-registry`;var ui={},pc=Zr;Object.defineProperty(ui,"__esModule",{value:!0});var ms=ui.default=void 0,fc=pc(oi()),mc=i;ms=ui.default=(0,fc.default)((0,mc.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 gs(e){const{info:t}=Nn();return L.useMemo(()=>{var n,r,o;return!e||!((n=e.docker)!=null&&n.image)||(r=e.docker)!=null&&r.image&&((o=e.docker)!=null&&o.runBaseScript)?!0:window.blocklet?window.blocklet.enableDocker&&window.blocklet.enableDockerNetwork:t.enableDocker&&t.enableDockerNetwork},[e,t])}function di({disabled:e,children:t,onConfirm:n}){return L.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}di.propTypes={disabled:P.bool,children:P.any.isRequired,onConfirm:P.func.isRequired};di.defaultProps={disabled:!1};function hi({onContinue:e,nextDisabled:t,launching:n,texts:r,description:o}){const[u,d]=L.useState(!1),h=()=>d(b=>!b);return i.jsxs(i.Fragment,{children:[i.jsx(gc,{children:i.jsxs(di,{disabled:t,onConfirm:e,children:[i.jsx("div",{className:"eula-trigger",onClick:h,children:r.listenName}),i.jsx(dt,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:n?i.jsxs(i.Fragment,{children:[i.jsx(vt,{size:14}),r.launchingText]}):r.buttonNext})]})}),i.jsx(si,{open:u,title:r.listenName,onClose:()=>d(!1),children:o})]})}hi.propTypes={onContinue:P.func.isRequired,nextDisabled:P.bool,launching:P.bool,description:P.any,texts:P.object};hi.defaultProps={nextDisabled:!1,launching:!1,description:"",texts:{listenName:"",launchingText:"",buttonNext:""}};const gc=He.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 pi={exports:{}},lo=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,vc=/\n/g,yc=/^\s*/,bc=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,xc=/^:\s*/,wc=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ec=/^[;\s]*/,Sc=/^\s+|\s+$/g,Tc=`
|
|
31
|
+
`,co="/",uo="*",mn="",jc="comment",Oc="declaration",kc=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 k=S.match(vc);k&&(n+=k.length);var _=S.lastIndexOf(Tc);r=~_?S.length-_:r+S.length}function u(){var S={line:n,column:r};return function(k){return k.position=new d(S),x(),k}}function d(S){this.start=S,this.end={line:n,column:r},this.source=t.source}d.prototype.content=e;function h(S){var k=new Error(t.source+":"+n+":"+r+": "+S);if(k.reason=S,k.filename=t.source,k.line=n,k.column=r,k.source=e,!t.silent)throw k}function b(S){var k=S.exec(e);if(k){var _=k[0];return o(_),e=e.slice(_.length),k}}function x(){b(yc)}function s(S){var k;for(S=S||[];k=a();)k!==!1&&S.push(k);return S}function a(){var S=u();if(!(co!=e.charAt(0)||uo!=e.charAt(1))){for(var k=2;mn!=e.charAt(k)&&(uo!=e.charAt(k)||co!=e.charAt(k+1));)++k;if(k+=2,mn===e.charAt(k-1))return h("End of comment missing");var _=e.slice(2,k-2);return r+=2,o(_),e=e.slice(k),r+=2,S({type:jc,comment:_})}}function O(){var S=u(),k=b(bc);if(k){if(a(),!b(xc))return h("property missing ':'");var _=b(wc),D=S({type:Oc,property:ho(k[0].replace(lo,mn)),value:_?ho(_[0].replace(lo,mn)):mn});return b(Ec),D}}function v(){var S=[];s(S);for(var k;k=O();)k!==!1&&(S.push(k),s(S));return S}return x(),v()};function ho(e){return e?e.replace(Sc,mn):mn}var Rc=kc;function vs(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,o=Rc(e),u=typeof t=="function",d,h,b=0,x=o.length;b<x;b++)r=o[b],d=r.property,h=r.value,u?t(d,h,r):h&&(n||(n={}),n[d]=h);return n}pi.exports=vs;pi.exports.default=vs;var Cc=pi.exports;const Ic=ri(Cc),Pc={}.hasOwnProperty;function _c(e,t,n){if(typeof e!="function")throw new TypeError("h is not a function");const r=Nc(e),o=Mc(e),u=Dc(e);let d,h;if(typeof n=="string"||typeof n=="boolean"?(d=n,n={}):(n||(n={}),d=n.prefix),t&&t.type==="root"){const b=t.children[0];h=t.children.length===1&&b.type==="element"?b:{type:"element",tagName:"div",properties:{},children:t.children}}else if(t&&t.type==="element")h=t;else throw new Error("Expected root or element, not `"+(t&&t.type||t)+"`");return ys(e,h,{schema:n.space==="svg"?us:Ul,prefix:d==null?r||o||u?"h-":void 0:typeof d=="string"?d:d?"h-":void 0,key:0,react:r,vue:o,vdom:u,hyperscript:Ac(e)})}function ys(e,t,n){const r=n.schema;let o=r,u=t.tagName;const d={},h=[];let b=-1,x;r.space==="html"&&u.toLowerCase()==="svg"&&(o=us,n.schema=o);for(x in t.properties)t.properties&&Pc.call(t.properties,x)&&Lc(d,x,t.properties[x],n,u);if(n.vdom&&(o.space==="html"?u=u.toUpperCase():o.space&&(d.namespace=Wl[o.space])),n.prefix&&(n.key++,d.key=n.prefix+n.key),t.children)for(;++b<t.children.length;){const s=t.children[b];s.type==="element"?h.push(ys(e,s,n)):s.type==="text"&&h.push(s.value)}return n.schema=r,h.length>0?e.call(t,u,d,h):e.call(t,u,d)}function Lc(e,t,n,r,o){const u=zl(r.schema,t);let d;n==null||typeof n=="number"&&Number.isNaN(n)||n===!1&&(r.vue||r.vdom||r.hyperscript)||!n&&u.boolean&&(r.vue||r.vdom||r.hyperscript)||(Array.isArray(n)&&(n=u.commaSeparated?ql(n):Kl(n)),u.boolean&&r.hyperscript&&(n=""),u.property==="style"&&typeof n=="string"&&(r.react||r.vue||r.vdom)&&(n=Fc(n,o)),r.vue?u.property!=="style"&&(d="attrs"):u.mustUseProperty||(r.vdom?u.property!=="style"&&(d="attributes"):r.hyperscript&&(d="attrs")),d?e[d]=Object.assign(e[d]||{},{[u.attribute]:n}):u.space&&r.react?e[Vl[u.property]||u.property]=n:e[u.attribute]=n)}function Nc(e){const t=e("div",{});return!!(t&&("_owner"in t||"_store"in t)&&(t.key===void 0||t.key===null))}function Ac(e){return"context"in e&&"cleanup"in e}function Dc(e){return e("div",{}).type==="VirtualNode"}function Mc(e){const t=e("div",{});return!!(t&&t.context&&t.context._isVue)}function Fc(e,t){const n={};try{Ic(e,(r,o)=>{r.slice(0,4)==="-ms-"&&(r="ms-"+r.slice(4)),n[r.replace(/-([a-z])/g,(u,d)=>d.toUpperCase())]=o})}catch(r){const o=r;throw o.message=t+"[style]"+o.message.slice(9),o}return n}var Bc=bs;function bs(e){if(typeof e=="string")return zc(e);if(e==null)return qc;if(typeof e=="object")return("length"in e?Wc:Uc)(e);if(typeof e=="function")return e;throw new Error("Expected function, string, or object as test")}function $c(e){for(var t=[],n=e.length,r=-1;++r<n;)t[r]=bs(e[r]);return t}function Uc(e){return t;function t(n){var r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function Wc(e){var t=$c(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 zc(e){return t;function t(n){return!!(n&&n.type===e)}}function qc(){return!0}var Kc=br,Vc=Bc,xs=!0,ws="skip",dr=!1;br.CONTINUE=xs;br.SKIP=ws;br.EXIT=dr;function br(e,t,n,r){var o;typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),o=Vc(t),u(e,null,[]);function u(h,b,x){var s=[],a;return(!t||o(h,b,x[x.length-1]||null))&&(s=po(n(h,x)),s[0]===dr)?s:h.children&&s[0]!==ws?(a=po(d(h.children,x.concat(h))),a[0]===dr?a:s):s}function d(h,b){for(var x=-1,s=r?-1:1,a=(r?h.length:x)+s,O;a>x&&a<h.length;){if(O=u(h[a],a,b),O[0]===dr)return O;a=typeof O[1]=="number"?O[1]:a+s}}}function po(e){return e!==null&&typeof e=="object"&&"length"in e?e:typeof e=="number"?[xs,e]:[e]}var Gc=wr,xr=Kc,Hc=xr.CONTINUE,Xc=xr.SKIP,Yc=xr.EXIT;wr.CONTINUE=Hc;wr.SKIP=Xc;wr.EXIT=Yc;function wr(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),xr(e,t,o,r);function o(u,d){var h=d[d.length-1],b=h?h.children.indexOf(u):null;return n(u,b,h)}}var Qc=Gc,Jc=Object.prototype.hasOwnProperty,kr={align:"text-align",valign:"vertical-align",height:"height",width:"width"},Zc=function(t){return Qc(t,"element",eu),t};function eu(e){if(!(e.tagName!=="tr"&&e.tagName!=="td"&&e.tagName!=="th")){var t,n;for(t in kr)!Jc.call(kr,t)||e.properties[t]===void 0||(n=kr[t],tu(e,n,e.properties[t]),delete e.properties[t])}}function tu(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 nu=ri(Zc);function ru(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 iu={}.hasOwnProperty,ou=new Set(["table","thead","tbody","tfoot","tr"]);function su(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(u){let d=_c(o,n?nu(u):u,e.prefix);return u.type==="root"?(d=d&&typeof d=="object"&&"type"in d&&"props"in d&&d.type==="div"&&(u.children.length!==1||u.children[0].type!=="element")?d.props.children:[d],t(e.Fragment||"div",{},d)):d}function o(u,d,h){if(h&&ou.has(u)&&(h=h.filter(b=>!ru(b))),e.components&&iu.call(e.components,u)){const b=e.components[u];return e.passNode&&typeof b=="function"&&(d=Object.assign({node:this},d)),t(b,d,h)}return t(u,d,h)}}function fi({children:e}){return i.jsx(au,{children:e})}const fo="source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important",au=He(Y)`
|
|
32
|
+
.highlight pre,
|
|
33
|
+
pre {
|
|
34
|
+
border-radius: 5px;
|
|
35
|
+
}
|
|
36
|
+
code {
|
|
37
|
+
font-family: ${fo};
|
|
38
|
+
}
|
|
39
|
+
pre code {
|
|
40
|
+
font-size: 14px;
|
|
41
|
+
font-family: ${fo};
|
|
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
|
+
`;fi.propTypes={children:P.any.isRequired};fi.defaultProps={};function Es({infoList:e=[]}){return i.jsx(Y,{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(Y,{component:"span",sx:{fontWeight:"bold",whiteSpace:"nowrap"},children:t.key}),i.jsx(Y,{component:"span",sx:{marginTop:{xs:-1,md:0}},children:t.value})]}))})}Es.propTypes={infoList:P.arrayOf(P.shape({key:P.string,value:P.string}))};const lu=e=>e.payment?(e.payment.price||[]).map(n=>n.value||0).every(n=>n===0):!0,cu=new su({createElement:L.createElement}).Compiler,kt={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 mi({blockletMeta:e,locale:t,handleDescEle:n}){const{data:r}=e,{registryUrl:o,did:u}=r,d=Bt.getDisplayName({meta:r}),h=rr(()=>o&&u?fetch(ro(o,"/api/blocklets",u,"readme")).then(S=>S.json()):null,{refreshDeps:[o,u]}),b=Hl(()=>h.data?h.data[t]||h.data.en||h.data[Object.keys(h.data)[0]]:"",[h]),x=r&&r.htmlAst?cu(r.htmlAst):"",s=lu(r);let a=ut(r,"owner.fullName");if(a){const S=ut(r,"owner.did");S&&(a=i.jsxs(Y,{sx:{display:"flex",alignItems:"center",gap:1},children:[a,i.jsx(ts,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:S,compact:!0,size:14,locale:t})]}))}else a=ut(r,"author.name");const O=[{key:ut(kt[t],"appinfo.name"),value:Bt.getDisplayName({meta:r})},{key:ut(kt[t],"appinfo.version"),value:r.version},{key:ut(kt[t],"appinfo.author"),value:a},{type:"description",key:ut(kt[t],"appinfo.description"),value:r.description}];r.requirements&&O.push({key:ut(kt[t],"appinfo.requirements"),value:r.requirements.server}),r.community&&O.push({key:ut(kt[t],"appinfo.community"),value:i.jsx("a",{href:r.community,target:"_blank",rel:"noreferrer",children:r.community})}),r.documentation&&O.push({key:ut(kt[t],"appinfo.documentation"),value:i.jsx("a",{href:r.documentation,target:"_blank",rel:"noreferrer",children:r.documentation})}),r.support&&O.push({key:ut(kt[t],"appinfo.support"),value:i.jsx("a",{href:`mailto:${r.support}`,target:"_blank",rel:"noreferrer",children:r.support})}),x&&O.push({key:ut(kt[t],"appinfo.overview"),value:""});let v;return t==="zh"?v=i.jsxs(i.Fragment,{children:[s?i.jsxs("p",{children:["您可以免费使用 ",i.jsx("b",{children:d}),";"]}):i.jsxs("p",{children:["您需要购买才能使用 ",i.jsx("b",{children:d}),";"]}),i.jsx("p",{children:"在应用启动前,需要选择您的节点;"}),i.jsx("p",{children:"如果您没有节点,我们会引导您创建新的节点;"}),i.jsx("p",{children:"下面为该应用的信息:"})]}):v=i.jsxs(i.Fragment,{children:[s?i.jsxs("p",{children:["You can use ",i.jsx("b",{children:d})," for free;"]}):i.jsxs("p",{children:["You need to purchase before launch ",i.jsx("b",{children:d}),";"]}),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(du,{children:[n||v,i.jsx(Es,{infoList:O}),b?i.jsxs("div",{className:"app-overview",children:[i.jsx(ge,{variant:"h5",gutterBottom:!0,children:ut(kt[t],"appinfo.overview")}),i.jsx(fi,{children:i.jsx(uu,{component:"div",className:"content-wrapper post-content",children:i.jsx(Gl,{source:b,wrapperElement:{"data-color-mode":"light"},urlTransform:(S,k,_)=>S.startsWith("/")?ro(o,S):S})})})]}):x?i.jsx("div",{className:"app-overview",children:x}):null]})}const uu=He(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
|
+
`,du=He.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
|
+
`;mi.propTypes={blockletMeta:P.object.isRequired,locale:P.string.isRequired,handleDescEle:P.node};mi.defaultProps={handleDescEle:""};function hu({...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 ",ns.COPYRIGHT_OWNER," version 2020-08-28"]}),i.jsx("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),i.jsx("p",{children:"暂无"})]})}function pu(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 gi({installRelated:e,meta:t,show:n,onClose:r,components:o,loading:u}){const{t:d}=yt(),h=Xt(a=>a.breakpoints.down("md"));if(!n)return null;const b=!u&&o.length===0,x=!u&&o.length!==0,s=40;return i.jsxs(si,{title:d("blocklet.component.relatedComponents",{name:t.title}),maxWidth:!1,fullWidth:!1,onClose:(a,O)=>{O!=="backdropClick"&&r(!1)},PaperProps:{style:h?{width:"100%",height:window.innerHeight}:{maxWidth:500,minWidth:300,width:"80%"}},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:[u&&i.jsx(Y,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:i.jsx(Y,{sx:{fontSize:32},color:"primary.main",component:at,icon:"line-md:loading-loop"})}),b&&i.jsx(Y,{sx:{textAlign:"center"},children:d("blocklet.component.noDependencies",{name:t.title})}),x&&i.jsx(Y,{sx:{marginBottom:2},children:o.map(a=>{if(!a.meta)return null;const{required:O}=a;let v;return e||O?v=1:v=.5,i.jsxs(Y,{sx:{opacity:v,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:pu(a),alt:a.meta.title}),i.jsxs(Y,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[i.jsxs(Y,{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(Ql(`${((S=a.bundleSource)==null?void 0:S.store)||a.meta.homepage}/blocklets/${a.meta.did}`,{allowDomains:null}),"_blank")},children:[a.meta.title,i.jsx(Y,{sx:{display:O?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:d("blocklet.component.required")}),i.jsxs(Y,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[a.meta.version,i.jsx(Y,{className:"link-icon",icon:"fluent:open-20-filled",component:at,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),i.jsx(Y,{sx:{marginTop:0,opacity:.7},children:a.meta.description})]})]},a.meta.did)})})]})}gi.propTypes={meta:P.object,show:P.bool,onClose:P.func.isRequired,installRelated:P.func,components:P.array.isRequired,loading:P.bool.isRequired};gi.defaultProps={meta:null,show:!1,installRelated:!1};function fu(e){return e&&(e.registryUrl||e.homepage)&&e.did?`${e.registryUrl||e.homepage}/api/blocklets/${e==null?void 0:e.did}/blocklet.json`:""}function mu(e){const{api:t}=Nn(),[n]=Xa(),r=n.get("blocklet_meta_url")||fu(e),[o,u]=L.useState([]),[d,h]=L.useState(!1);return L.useEffect(()=>{!r||e!=null&&e.inputUrl||(h(!0),t.getDynamicComponents({input:{url:r}}).then(b=>{u(b.components)}).finally(()=>{h(!1)}))},[r]),{components:o,loading:d}}function vi({installRelated:e,onChangeInstallRelated:t,meta:n,onClickNext:r,handleDescEle:o}){const u=Ya(),{t:d,locale:h}=yt(),[b,x]=L.useState(!1),{components:s,loading:a}=mu(n),O=gs(n),v=r||(()=>{u(`/launch-blocklet/install${window.location.search}`)}),S=()=>{x(!0)},k=()=>{x(!1)};return i.jsxs(gu,{children:[i.jsx("div",{className:"app-content",children:i.jsx("div",{className:"agreement",children:i.jsx("div",{className:"agreement-content",children:O?i.jsx(mi,{blockletMeta:{data:n},locale:h,handleDescEle:o}):i.jsx(Y,{sx:{p:3},children:i.jsx(ge,{children:d("launchBlocklet.dockerBlockletCantInstall")})})})})}),i.jsxs(Y,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[a?i.jsx(at,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,O&&t&&(s!=null&&s.length)?i.jsxs(Y,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[i.jsx(ei,{sx:{mr:.5},checked:e,onChange:_=>t(_.currentTarget.checked),control:i.jsx(ti,{}),label:i.jsx("span",{children:d("launchBlocklet.installRelatedComponents")})}),i.jsx(Y,{sx:{"> button svg":{color:"primary.main"}},children:i.jsx(Wo,{size:"small",onClick:S,children:i.jsx(at,{icon:"octicon:package-dependencies-16"})})})]}):null,i.jsx("div",{className:"button-container","data-cy":"agree-all",children:O?i.jsx(hi,{onContinue:v,description:i.jsx(hu,{}),texts:{listenName:d("launchBlocklet.license"),buttonNext:d("launchBlocklet.next")}}):null})]}),i.jsx(gi,{installRelated:e,meta:n,show:b,onClose:k,components:s,loading:a})]})}vi.propTypes={meta:P.object.isRequired,onClickNext:P.func,handleDescEle:P.node,installRelated:P.bool,onChangeInstallRelated:P.func};vi.defaultProps={onClickNext:null,handleDescEle:"",installRelated:!0,onChangeInstallRelated:null};const gu=He.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 Ss={},yi={exports:{}},Ts={exports:{}},Kn=Ts.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-"+js(e)}}},mo={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:js};Object.keys(Kn).forEach(function(e){Object.keys(mo).forEach(function(t){Kn[e][t]||(Kn[e][t]=mo[t])}),Kn[e].protocols_re=RegExp("^("+Kn[e].protocols.map(function(t){return t.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function js(e){return e.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var Os=Ts.exports,go=Os,Pn=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},vu=Qe;function Qe(e,t,n,r,o,u,d){var h=this;h.type=e,Object.keys(go[e]).forEach(function(b){h[b]=go[e][b]}),h.user=t,h.auth=n,h.project=r,h.committish=o,h.default=u,h.opts=d||{}}Qe.prototype.hash=function(){return this.committish?"#"+this.committish:""};Qe.prototype._fill=function(e,t){if(e){var n=Pn({},t);n.path=n.path?n.path.replace(/^[/]+/g,""):"",t=Pn(Pn({},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,u=n.committish,d=n.fragment,h=n.path,b=n.project;Object.keys(n).forEach(function(s){var a=n[s];(s==="path"||s==="project")&&typeof a=="string"?n[s]=a.split("/").map(function(O){return encodeURIComponent(O)}).join("/"):s!=="domain"&&(n[s]=encodeURIComponent(a))}),n["auth@"]=o?o+"@":"",n["#fragment"]=d?"#"+this.hashformat(d):"",n.fragment=n.fragment?n.fragment:"",n["#path"]=h?"#"+this.hashformat(h):"",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"]=u?"#"+u:"",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}};Qe.prototype.ssh=function(e){return this._fill(this.sshtemplate,e)};Qe.prototype.sshurl=function(e){return this._fill(this.sshurltemplate,e)};Qe.prototype.browse=function(e,t,n){return typeof e=="string"?(typeof t!="string"&&(n=t,t=null),this._fill(this.browsefiletemplate,Pn({fragment:t,path:e},n))):this._fill(this.browsetemplate,e)};Qe.prototype.docs=function(e){return this._fill(this.docstemplate,e)};Qe.prototype.bugs=function(e){return this._fill(this.bugstemplate,e)};Qe.prototype.https=function(e){return this._fill(this.httpstemplate,e)};Qe.prototype.git=function(e){return this._fill(this.gittemplate,e)};Qe.prototype.shortcut=function(e){return this._fill(this.shortcuttemplate,e)};Qe.prototype.path=function(e){return this._fill(this.pathtemplate,e)};Qe.prototype.tarball=function(e){var t=Pn({},e,{noCommittish:!1});return this._fill(this.tarballtemplate,t)};Qe.prototype.file=function(e,t){return this._fill(this.filetemplate,Pn({path:e},t))};Qe.prototype.getDefaultRepresentation=function(){return this.default};Qe.prototype.toString=function(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)};var Rr,vo;function yu(){return vo||(vo=1,Rr=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Rr}var bu=be;be.Node=yn;be.create=be;function be(e){var t=this;if(t instanceof be||(t=new be),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}be.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};be.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++}};be.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++}};be.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)wu(this,arguments[e]);return this.length};be.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)Eu(this,arguments[e]);return this.length};be.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}};be.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}};be.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};be.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};be.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};be.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};be.prototype.map=function(e,t){t=t||this;for(var n=new be,r=this.head;r!==null;)n.push(e.call(t,r.value,this)),r=r.next;return n};be.prototype.mapReverse=function(e,t){t=t||this;for(var n=new be,r=this.tail;r!==null;)n.push(e.call(t,r.value,this)),r=r.prev;return n};be.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};be.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};be.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};be.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};be.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 be;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};be.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 be;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};be.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 u=[],r=0;o&&r<t;r++)u.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=xu(this,o,n[r]);return u};be.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 xu(e,t,n){var r=t===e.head?new yn(n,null,t,e):new yn(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function wu(e,t){e.tail=new yn(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function Eu(e,t){e.head=new yn(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function yn(e,t,n,r){if(!(this instanceof yn))return new yn(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{yu()(be)}catch{}const Su=bu,gn=Symbol("max"),Ft=Symbol("length"),In=Symbol("lengthCalculator"),Yn=Symbol("allowStale"),vn=Symbol("maxAge"),Mt=Symbol("dispose"),yo=Symbol("noDisposeOnSet"),qe=Symbol("lruList"),wt=Symbol("cache"),ks=Symbol("updateAgeOnGet"),Cr=()=>1;class Tu{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[gn]=t.max||1/0;const n=t.length||Cr;if(this[In]=typeof n!="function"?Cr:n,this[Yn]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[vn]=t.maxAge||0,this[Mt]=t.dispose,this[yo]=t.noDisposeOnSet||!1,this[ks]=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[gn]=t||1/0,Vn(this)}get max(){return this[gn]}set allowStale(t){this[Yn]=!!t}get allowStale(){return this[Yn]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[vn]=t,Vn(this)}get maxAge(){return this[vn]}set lengthCalculator(t){typeof t!="function"&&(t=Cr),t!==this[In]&&(this[In]=t,this[Ft]=0,this[qe].forEach(n=>{n.length=this[In](n.value,n.key),this[Ft]+=n.length})),Vn(this)}get lengthCalculator(){return this[In]}get length(){return this[Ft]}get itemCount(){return this[qe].length}rforEach(t,n){n=n||this;for(let r=this[qe].tail;r!==null;){const o=r.prev;bo(this,t,r,n),r=o}}forEach(t,n){n=n||this;for(let r=this[qe].head;r!==null;){const o=r.next;bo(this,t,r,n),r=o}}keys(){return this[qe].toArray().map(t=>t.key)}values(){return this[qe].toArray().map(t=>t.value)}reset(){this[Mt]&&this[qe]&&this[qe].length&&this[qe].forEach(t=>this[Mt](t.key,t.value)),this[wt]=new Map,this[qe]=new Su,this[Ft]=0}dump(){return this[qe].map(t=>pr(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[qe]}set(t,n,r){if(r=r||this[vn],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const o=r?Date.now():0,u=this[In](n,t);if(this[wt].has(t)){if(u>this[gn])return _n(this,this[wt].get(t)),!1;const b=this[wt].get(t).value;return this[Mt]&&(this[yo]||this[Mt](t,b.value)),b.now=o,b.maxAge=r,b.value=n,this[Ft]+=u-b.length,b.length=u,this.get(t),Vn(this),!0}const d=new ju(t,n,u,o,r);return d.length>this[gn]?(this[Mt]&&this[Mt](t,n),!1):(this[Ft]+=d.length,this[qe].unshift(d),this[wt].set(t,this[qe].head),Vn(this),!0)}has(t){if(!this[wt].has(t))return!1;const n=this[wt].get(t).value;return!pr(this,n)}get(t){return Ir(this,t,!0)}peek(t){return Ir(this,t,!1)}pop(){const t=this[qe].tail;return t?(_n(this,t),t.value):null}del(t){_n(this,this[wt].get(t))}load(t){this.reset();const n=Date.now();for(let r=t.length-1;r>=0;r--){const o=t[r],u=o.e||0;if(u===0)this.set(o.k,o.v);else{const d=u-n;d>0&&this.set(o.k,o.v,d)}}}prune(){this[wt].forEach((t,n)=>Ir(this,n,!1))}}const Ir=(e,t,n)=>{const r=e[wt].get(t);if(r){const o=r.value;if(pr(e,o)){if(_n(e,r),!e[Yn])return}else n&&(e[ks]&&(r.value.now=Date.now()),e[qe].unshiftNode(r));return o.value}},pr=(e,t)=>{if(!t||!t.maxAge&&!e[vn])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[vn]&&n>e[vn]},Vn=e=>{if(e[Ft]>e[gn])for(let t=e[qe].tail;e[Ft]>e[gn]&&t!==null;){const n=t.prev;_n(e,t),t=n}},_n=(e,t)=>{if(t){const n=t.value;e[Mt]&&e[Mt](n.key,n.value),e[Ft]-=n.length,e[wt].delete(n.key),e[qe].removeNode(t)}};class ju{constructor(t,n,r,o,u){this.key=t,this.value=n,this.length=r,this.now=o,this.maxAge=u||0}}const bo=(e,t,n,r)=>{let o=n.value;pr(e,o)&&(_n(e,n),e[Yn]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};var Ou=Tu,Kr=ul,xo=Os,ku=yi.exports=vu,Ru=Ou,Pr=new Ru({max:1e3}),Cu={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function Iu(e){return Cu[e]||e.slice(0,-1)}var Pu={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};yi.exports.fromUrl=function(e,t){if(typeof e=="string"){var n=e+JSON.stringify(t||{});return Pr.has(n)||Pr.set(n,_u(e,t)),Pr.get(n)}};function _u(e,t){if(!(e==null||e==="")){var n=Nu(Lu(e)?"github:"+e:e),r=Au(n),o=n.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),u=Object.keys(xo).map(function(d){try{var h=xo[d],b=null;r.auth&&Pu[r.protocol]&&(b=r.auth);var x=r.hash?decodeURIComponent(r.hash.substr(1)):null,s=null,a=null,O=null;if(o&&o[1]===d)s=o[2]&&decodeURIComponent(o[2]),a=decodeURIComponent(o[3].replace(/\.git$/,"")),O="shortcut";else{if(r.host&&r.host!==h.domain&&r.host.replace(/^www[.]/,"")!==h.domain||!h.protocols_re.test(r.protocol)||!r.path)return;var v=h.pathmatch,S=r.path.match(v);if(!S)return;S[1]!==null&&S[1]!==void 0&&(s=decodeURIComponent(S[1].replace(/^:/,""))),a=decodeURIComponent(S[2]),O=Iu(r.protocol)}return new ku(d,s,b,a,x,O,t)}catch(k){if(!(k instanceof URIError))throw k}}).filter(function(d){return d});if(u.length===1)return u[0]}}function Lu(e){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(e)}function Nu(e){var t=Kr.parse(e);return t.protocol==="gist:"&&t.host&&!t.path?t.protocol+"/"+t.host:e}function Au(e){var t=e.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!t){var n=Kr.parse(e);if(n.auth){const o=e.match(/[^@]+@[^:/]+/);if(o){var r=new Kr.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 Du=yi.exports,bn={},re={},Mu=null;const Fu=Object.freeze(Object.defineProperty({__proto__:null,default:Mu},Symbol.toStringTag,{value:"Module"})),Rs=ii(Fu),Bu=["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],$u=["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"];var Uu={charsWide:Bu,charsFullWidth:$u};const{charsWide:Wu,charsFullWidth:zu}=Uu,Cs=new RegExp(`[${Wu.join("")}${zu.join("")}]`,"g"),qu=e=>e.replace(Cs,"xx").length;var Ku={default:qu,charsRegex:Cs};/*!
|
|
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 Vu=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 Gu=Vu,Is={"{":"}","(":")","[":"]"},Hu=function(e){if(e[0]==="!")return!0;for(var t=0,n=-2,r=-2,o=-2,u=-2,d=-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&&(d===-1||d>r||(d=e.indexOf("\\",t),d===-1||d>r)))||o!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(o=e.indexOf("}",t),o>t&&(d=e.indexOf("\\",t),d===-1||d>o))||u!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(u=e.indexOf(")",t),u>t&&(d=e.indexOf("\\",t),d===-1||d>u))||n!==-1&&e[t]==="("&&e[t+1]!=="|"&&(n<t&&(n=e.indexOf("|",t)),n!==-1&&e[n+1]!==")"&&(u=e.indexOf(")",n),u>n&&(d=e.indexOf("\\",n),d===-1||d>u))))return!0;if(e[t]==="\\"){var h=e[t+1];t+=2;var b=Is[h];if(b){var x=e.indexOf(b,t);x!==-1&&(t=x+1)}if(e[t]==="!")return!0}else t++}return!1},Xu=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=Is[n];if(r){var o=e.indexOf(r,t);o!==-1&&(t=o+1)}if(e[t]==="!")return!0}else t++}return!1},Yu=function(t,n){if(typeof t!="string"||t==="")return!1;if(Gu(t))return!0;var r=Hu;return n&&n.strict===!1&&(r=Xu),r(t)},Vr={exports:{}};(function(e,t){var n={};t=e.exports=B;var r;typeof kl=="object"&&n&&n.NODE_DEBUG&&/\bsemver\b/i.test(n.NODE_DEBUG)?r=function(){var l=Array.prototype.slice.call(arguments,0);l.unshift("SEMVER"),console.log.apply(console,l)}:r=function(){},t.SEMVER_SPEC_VERSION="2.0.0";var o=256,u=Number.MAX_SAFE_INTEGER||9007199254740991,d=16,h=o-6,b=t.re=[],x=t.safeRe=[],s=t.src=[],a=t.tokens={},O=0;function v(l){a[l]=O++}var S="[a-zA-Z0-9-]",k=[["\\s",1],["\\d",o],[S,h]];function _(l){for(var y=0;y<k.length;y++){var w=k[y][0],C=k[y][1];l=l.split(w+"*").join(w+"{0,"+C+"}").split(w+"+").join(w+"{1,"+C+"}")}return l}v("NUMERICIDENTIFIER"),s[a.NUMERICIDENTIFIER]="0|[1-9]\\d*",v("NUMERICIDENTIFIERLOOSE"),s[a.NUMERICIDENTIFIERLOOSE]="\\d+",v("NONNUMERICIDENTIFIER"),s[a.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+S+"*",v("MAINVERSION"),s[a.MAINVERSION]="("+s[a.NUMERICIDENTIFIER]+")\\.("+s[a.NUMERICIDENTIFIER]+")\\.("+s[a.NUMERICIDENTIFIER]+")",v("MAINVERSIONLOOSE"),s[a.MAINVERSIONLOOSE]="("+s[a.NUMERICIDENTIFIERLOOSE]+")\\.("+s[a.NUMERICIDENTIFIERLOOSE]+")\\.("+s[a.NUMERICIDENTIFIERLOOSE]+")",v("PRERELEASEIDENTIFIER"),s[a.PRERELEASEIDENTIFIER]="(?:"+s[a.NUMERICIDENTIFIER]+"|"+s[a.NONNUMERICIDENTIFIER]+")",v("PRERELEASEIDENTIFIERLOOSE"),s[a.PRERELEASEIDENTIFIERLOOSE]="(?:"+s[a.NUMERICIDENTIFIERLOOSE]+"|"+s[a.NONNUMERICIDENTIFIER]+")",v("PRERELEASE"),s[a.PRERELEASE]="(?:-("+s[a.PRERELEASEIDENTIFIER]+"(?:\\."+s[a.PRERELEASEIDENTIFIER]+")*))",v("PRERELEASELOOSE"),s[a.PRERELEASELOOSE]="(?:-?("+s[a.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+s[a.PRERELEASEIDENTIFIERLOOSE]+")*))",v("BUILDIDENTIFIER"),s[a.BUILDIDENTIFIER]=S+"+",v("BUILD"),s[a.BUILD]="(?:\\+("+s[a.BUILDIDENTIFIER]+"(?:\\."+s[a.BUILDIDENTIFIER]+")*))",v("FULL"),v("FULLPLAIN"),s[a.FULLPLAIN]="v?"+s[a.MAINVERSION]+s[a.PRERELEASE]+"?"+s[a.BUILD]+"?",s[a.FULL]="^"+s[a.FULLPLAIN]+"$",v("LOOSEPLAIN"),s[a.LOOSEPLAIN]="[v=\\s]*"+s[a.MAINVERSIONLOOSE]+s[a.PRERELEASELOOSE]+"?"+s[a.BUILD]+"?",v("LOOSE"),s[a.LOOSE]="^"+s[a.LOOSEPLAIN]+"$",v("GTLT"),s[a.GTLT]="((?:<|>)?=?)",v("XRANGEIDENTIFIERLOOSE"),s[a.XRANGEIDENTIFIERLOOSE]=s[a.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",v("XRANGEIDENTIFIER"),s[a.XRANGEIDENTIFIER]=s[a.NUMERICIDENTIFIER]+"|x|X|\\*",v("XRANGEPLAIN"),s[a.XRANGEPLAIN]="[v=\\s]*("+s[a.XRANGEIDENTIFIER]+")(?:\\.("+s[a.XRANGEIDENTIFIER]+")(?:\\.("+s[a.XRANGEIDENTIFIER]+")(?:"+s[a.PRERELEASE]+")?"+s[a.BUILD]+"?)?)?",v("XRANGEPLAINLOOSE"),s[a.XRANGEPLAINLOOSE]="[v=\\s]*("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:"+s[a.PRERELEASELOOSE]+")?"+s[a.BUILD]+"?)?)?",v("XRANGE"),s[a.XRANGE]="^"+s[a.GTLT]+"\\s*"+s[a.XRANGEPLAIN]+"$",v("XRANGELOOSE"),s[a.XRANGELOOSE]="^"+s[a.GTLT]+"\\s*"+s[a.XRANGEPLAINLOOSE]+"$",v("COERCE"),s[a.COERCE]="(^|[^\\d])(\\d{1,"+d+"})(?:\\.(\\d{1,"+d+"}))?(?:\\.(\\d{1,"+d+"}))?(?:$|[^\\d])",v("COERCERTL"),b[a.COERCERTL]=new RegExp(s[a.COERCE],"g"),x[a.COERCERTL]=new RegExp(_(s[a.COERCE]),"g"),v("LONETILDE"),s[a.LONETILDE]="(?:~>?)",v("TILDETRIM"),s[a.TILDETRIM]="(\\s*)"+s[a.LONETILDE]+"\\s+",b[a.TILDETRIM]=new RegExp(s[a.TILDETRIM],"g"),x[a.TILDETRIM]=new RegExp(_(s[a.TILDETRIM]),"g");var D="$1~";v("TILDE"),s[a.TILDE]="^"+s[a.LONETILDE]+s[a.XRANGEPLAIN]+"$",v("TILDELOOSE"),s[a.TILDELOOSE]="^"+s[a.LONETILDE]+s[a.XRANGEPLAINLOOSE]+"$",v("LONECARET"),s[a.LONECARET]="(?:\\^)",v("CARETTRIM"),s[a.CARETTRIM]="(\\s*)"+s[a.LONECARET]+"\\s+",b[a.CARETTRIM]=new RegExp(s[a.CARETTRIM],"g"),x[a.CARETTRIM]=new RegExp(_(s[a.CARETTRIM]),"g");var Q="$1^";v("CARET"),s[a.CARET]="^"+s[a.LONECARET]+s[a.XRANGEPLAIN]+"$",v("CARETLOOSE"),s[a.CARETLOOSE]="^"+s[a.LONECARET]+s[a.XRANGEPLAINLOOSE]+"$",v("COMPARATORLOOSE"),s[a.COMPARATORLOOSE]="^"+s[a.GTLT]+"\\s*("+s[a.LOOSEPLAIN]+")$|^$",v("COMPARATOR"),s[a.COMPARATOR]="^"+s[a.GTLT]+"\\s*("+s[a.FULLPLAIN]+")$|^$",v("COMPARATORTRIM"),s[a.COMPARATORTRIM]="(\\s*)"+s[a.GTLT]+"\\s*("+s[a.LOOSEPLAIN]+"|"+s[a.XRANGEPLAIN]+")",b[a.COMPARATORTRIM]=new RegExp(s[a.COMPARATORTRIM],"g"),x[a.COMPARATORTRIM]=new RegExp(_(s[a.COMPARATORTRIM]),"g");var z="$1$2$3";v("HYPHENRANGE"),s[a.HYPHENRANGE]="^\\s*("+s[a.XRANGEPLAIN]+")\\s+-\\s+("+s[a.XRANGEPLAIN]+")\\s*$",v("HYPHENRANGELOOSE"),s[a.HYPHENRANGELOOSE]="^\\s*("+s[a.XRANGEPLAINLOOSE]+")\\s+-\\s+("+s[a.XRANGEPLAINLOOSE]+")\\s*$",v("STAR"),s[a.STAR]="(<|>)?=?\\s*\\*";for(var J=0;J<O;J++)r(J,s[J]),b[J]||(b[J]=new RegExp(s[J]),x[J]=new RegExp(_(s[J])));t.parse=j;function j(l,y){if((!y||typeof y!="object")&&(y={loose:!!y,includePrerelease:!1}),l instanceof B)return l;if(typeof l!="string"||l.length>o)return null;var w=y.loose?x[a.LOOSE]:x[a.FULL];if(!w.test(l))return null;try{return new B(l,y)}catch{return null}}t.valid=q;function q(l,y){var w=j(l,y);return w?w.version:null}t.clean=Z;function Z(l,y){var w=j(l.trim().replace(/^[=v]+/,""),y);return w?w.version:null}t.SemVer=B;function B(l,y){if((!y||typeof y!="object")&&(y={loose:!!y,includePrerelease:!1}),l instanceof B){if(l.loose===y.loose)return l;l=l.version}else if(typeof l!="string")throw new TypeError("Invalid Version: "+l);if(l.length>o)throw new TypeError("version is longer than "+o+" characters");if(!(this instanceof B))return new B(l,y);r("SemVer",l,y),this.options=y,this.loose=!!y.loose;var w=l.trim().match(y.loose?x[a.LOOSE]:x[a.FULL]);if(!w)throw new TypeError("Invalid Version: "+l);if(this.raw=l,this.major=+w[1],this.minor=+w[2],this.patch=+w[3],this.major>u||this.major<0)throw new TypeError("Invalid major version");if(this.minor>u||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>u||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 N=+C;if(N>=0&&N<u)return N}return C}):this.prerelease=[],this.build=w[5]?w[5].split("."):[],this.format()}B.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},B.prototype.toString=function(){return this.version},B.prototype.compare=function(l){return r("SemVer.compare",this.version,this.options,l),l instanceof B||(l=new B(l,this.options)),this.compareMain(l)||this.comparePre(l)},B.prototype.compareMain=function(l){return l instanceof B||(l=new B(l,this.options)),Te(this.major,l.major)||Te(this.minor,l.minor)||Te(this.patch,l.patch)},B.prototype.comparePre=function(l){if(l instanceof B||(l=new B(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;var y=0;do{var w=this.prerelease[y],C=l.prerelease[y];if(r("prerelease compare",y,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 Te(w,C)}while(++y)},B.prototype.compareBuild=function(l){l instanceof B||(l=new B(l,this.options));var y=0;do{var w=this.build[y],C=l.build[y];if(r("prerelease compare",y,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 Te(w,C)}while(++y)},B.prototype.inc=function(l,y){switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",y);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",y);break;case"prepatch":this.prerelease.length=0,this.inc("patch",y),this.inc("pre",y);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",y),this.inc("pre",y);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)}y&&(this.prerelease[0]===y?isNaN(this.prerelease[1])&&(this.prerelease=[y,0]):this.prerelease=[y,0]);break;default:throw new Error("invalid increment argument: "+l)}return this.format(),this.raw=this.version,this},t.inc=ue;function ue(l,y,w,C){typeof w=="string"&&(C=w,w=void 0);try{return new B(l,w).inc(y,C).version}catch{return null}}t.diff=ee;function ee(l,y){if(It(l,y))return null;var w=j(l),C=j(y),N="";if(w.prerelease.length||C.prerelease.length){N="pre";var V="prerelease"}for(var X in w)if((X==="major"||X==="minor"||X==="patch")&&w[X]!==C[X])return N+X;return V}t.compareIdentifiers=Te;var ae=/^[0-9]+$/;function Te(l,y){var w=ae.test(l),C=ae.test(y);return w&&C&&(l=+l,y=+y),l===y?0:w&&!C?-1:C&&!w?1:l<y?-1:1}t.rcompareIdentifiers=Fe;function Fe(l,y){return Te(y,l)}t.major=$e;function $e(l,y){return new B(l,y).major}t.minor=rt;function rt(l,y){return new B(l,y).minor}t.patch=ne;function ne(l,y){return new B(l,y).patch}t.compare=fe;function fe(l,y,w){return new B(l,w).compare(new B(y,w))}t.compareLoose=K;function K(l,y){return fe(l,y,!0)}t.compareBuild=je;function je(l,y,w){var C=new B(l,w),N=new B(y,w);return C.compare(N)||C.compareBuild(N)}t.rcompare=se;function se(l,y,w){return fe(y,l,w)}t.sort=pt;function pt(l,y){return l.sort(function(w,C){return t.compareBuild(w,C,y)})}t.rsort=Ee;function Ee(l,y){return l.sort(function(w,C){return t.compareBuild(C,w,y)})}t.gt=Je;function Je(l,y,w){return fe(l,y,w)>0}t.lt=Ke;function Ke(l,y,w){return fe(l,y,w)<0}t.eq=It;function It(l,y,w){return fe(l,y,w)===0}t.neq=Jt;function Jt(l,y,w){return fe(l,y,w)!==0}t.gte=$t;function $t(l,y,w){return fe(l,y,w)>=0}t.lte=Zt;function Zt(l,y,w){return fe(l,y,w)<=0}t.cmp=Le;function Le(l,y,w,C){switch(y){case"===":return typeof l=="object"&&(l=l.version),typeof w=="object"&&(w=w.version),l===w;case"!==":return typeof l=="object"&&(l=l.version),typeof w=="object"&&(w=w.version),l!==w;case"":case"=":case"==":return It(l,w,C);case"!=":return Jt(l,w,C);case">":return Je(l,w,C);case">=":return $t(l,w,C);case"<":return Ke(l,w,C);case"<=":return Zt(l,w,C);default:throw new TypeError("Invalid operator: "+y)}}t.Comparator=Ne;function Ne(l,y){if((!y||typeof y!="object")&&(y={loose:!!y,includePrerelease:!1}),l instanceof Ne){if(l.loose===!!y.loose)return l;l=l.value}if(!(this instanceof Ne))return new Ne(l,y);l=l.trim().split(/\s+/).join(" "),r("comparator",l,y),this.options=y,this.loose=!!y.loose,this.parse(l),this.semver===Ze?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var Ze={};Ne.prototype.parse=function(l){var y=this.options.loose?x[a.COMPARATORLOOSE]:x[a.COMPARATOR],w=l.match(y);if(!w)throw new TypeError("Invalid comparator: "+l);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new B(w[2],this.options.loose):this.semver=Ze},Ne.prototype.toString=function(){return this.value},Ne.prototype.test=function(l){if(r("Comparator.test",l,this.options.loose),this.semver===Ze||l===Ze)return!0;if(typeof l=="string")try{l=new B(l,this.options)}catch{return!1}return Le(l,this.operator,this.semver,this.options)},Ne.prototype.intersects=function(l,y){if(!(l instanceof Ne))throw new TypeError("a Comparator is required");(!y||typeof y!="object")&&(y={loose:!!y,includePrerelease:!1});var w;if(this.operator==="")return this.value===""?!0:(w=new ye(l.value,y),Pe(this.value,w,y));if(l.operator==="")return l.value===""?!0:(w=new ye(this.value,y),Pe(l.semver,w,y));var C=(this.operator===">="||this.operator===">")&&(l.operator===">="||l.operator===">"),N=(this.operator==="<="||this.operator==="<")&&(l.operator==="<="||l.operator==="<"),V=this.semver.version===l.semver.version,X=(this.operator===">="||this.operator==="<=")&&(l.operator===">="||l.operator==="<="),A=Le(this.semver,"<",l.semver,y)&&(this.operator===">="||this.operator===">")&&(l.operator==="<="||l.operator==="<"),F=Le(this.semver,">",l.semver,y)&&(this.operator==="<="||this.operator==="<")&&(l.operator===">="||l.operator===">");return C||N||V&&X||A||F},t.Range=ye;function ye(l,y){if((!y||typeof y!="object")&&(y={loose:!!y,includePrerelease:!1}),l instanceof ye)return l.loose===!!y.loose&&l.includePrerelease===!!y.includePrerelease?l:new ye(l.raw,y);if(l instanceof Ne)return new ye(l.value,y);if(!(this instanceof ye))return new ye(l,y);if(this.options=y,this.loose=!!y.loose,this.includePrerelease=!!y.includePrerelease,this.raw=l.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()}ye.prototype.format=function(){return this.range=this.set.map(function(l){return l.join(" ").trim()}).join("||").trim(),this.range},ye.prototype.toString=function(){return this.range},ye.prototype.parseRange=function(l){var y=this.options.loose,w=y?x[a.HYPHENRANGELOOSE]:x[a.HYPHENRANGE];l=l.replace(w,ft),r("hyphen replace",l),l=l.replace(x[a.COMPARATORTRIM],z),r("comparator trim",l,x[a.COMPARATORTRIM]),l=l.replace(x[a.TILDETRIM],D),l=l.replace(x[a.CARETTRIM],Q),l=l.split(/\s+/).join(" ");var C=y?x[a.COMPARATORLOOSE]:x[a.COMPARATOR],N=l.split(" ").map(function(V){return Dn(V,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(N=N.filter(function(V){return!!V.match(C)})),N=N.map(function(V){return new Ne(V,this.options)},this),N},ye.prototype.intersects=function(l,y){if(!(l instanceof ye))throw new TypeError("a Range is required");return this.set.some(function(w){return bt(w,y)&&l.set.some(function(C){return bt(C,y)&&w.every(function(N){return C.every(function(V){return N.intersects(V,y)})})})})};function bt(l,y){for(var w=!0,C=l.slice(),N=C.pop();w&&C.length;)w=C.every(function(V){return N.intersects(V,y)}),N=C.pop();return w}t.toComparators=Ue;function Ue(l,y){return new ye(l,y).set.map(function(w){return w.map(function(C){return C.value}).join(" ").trim().split(" ")})}function Dn(l,y){return r("comp",l,y),l=Ut(l,y),r("caret",l),l=en(l,y),r("tildes",l),l=Xe(l,y),r("xrange",l),l=St(l,y),r("stars",l),l}function Re(l){return!l||l.toLowerCase()==="x"||l==="*"}function en(l,y){return l.trim().split(/\s+/).map(function(w){return tn(w,y)}).join(" ")}function tn(l,y){var w=y.loose?x[a.TILDELOOSE]:x[a.TILDE];return l.replace(w,function(C,N,V,X,A){r("tilde",l,C,N,V,X,A);var F;return Re(N)?F="":Re(V)?F=">="+N+".0.0 <"+(+N+1)+".0.0":Re(X)?F=">="+N+"."+V+".0 <"+N+"."+(+V+1)+".0":A?(r("replaceTilde pr",A),F=">="+N+"."+V+"."+X+"-"+A+" <"+N+"."+(+V+1)+".0"):F=">="+N+"."+V+"."+X+" <"+N+"."+(+V+1)+".0",r("tilde return",F),F})}function Ut(l,y){return l.trim().split(/\s+/).map(function(w){return Wt(w,y)}).join(" ")}function Wt(l,y){r("caret",l,y);var w=y.loose?x[a.CARETLOOSE]:x[a.CARET];return l.replace(w,function(C,N,V,X,A){r("caret",l,C,N,V,X,A);var F;return Re(N)?F="":Re(V)?F=">="+N+".0.0 <"+(+N+1)+".0.0":Re(X)?N==="0"?F=">="+N+"."+V+".0 <"+N+"."+(+V+1)+".0":F=">="+N+"."+V+".0 <"+(+N+1)+".0.0":A?(r("replaceCaret pr",A),N==="0"?V==="0"?F=">="+N+"."+V+"."+X+"-"+A+" <"+N+"."+V+"."+(+X+1):F=">="+N+"."+V+"."+X+"-"+A+" <"+N+"."+(+V+1)+".0":F=">="+N+"."+V+"."+X+"-"+A+" <"+(+N+1)+".0.0"):(r("no pr"),N==="0"?V==="0"?F=">="+N+"."+V+"."+X+" <"+N+"."+V+"."+(+X+1):F=">="+N+"."+V+"."+X+" <"+N+"."+(+V+1)+".0":F=">="+N+"."+V+"."+X+" <"+(+N+1)+".0.0"),r("caret return",F),F})}function Xe(l,y){return r("replaceXRanges",l,y),l.split(/\s+/).map(function(w){return nn(w,y)}).join(" ")}function nn(l,y){l=l.trim();var w=y.loose?x[a.XRANGELOOSE]:x[a.XRANGE];return l.replace(w,function(C,N,V,X,A,F){r("xRange",l,C,N,V,X,A,F);var de=Re(V),me=de||Re(X),ke=me||Re(A),Ce=ke;return N==="="&&Ce&&(N=""),F=y.includePrerelease?"-0":"",de?N===">"||N==="<"?C="<0.0.0-0":C="*":N&&Ce?(me&&(X=0),A=0,N===">"?(N=">=",me?(V=+V+1,X=0,A=0):(X=+X+1,A=0)):N==="<="&&(N="<",me?V=+V+1:X=+X+1),C=N+V+"."+X+"."+A+F):me?C=">="+V+".0.0"+F+" <"+(+V+1)+".0.0"+F:ke&&(C=">="+V+"."+X+".0"+F+" <"+V+"."+(+X+1)+".0"+F),r("xRange return",C),C})}function St(l,y){return r("replaceStars",l,y),l.trim().replace(x[a.STAR],"")}function ft(l,y,w,C,N,V,X,A,F,de,me,ke,Ce){return Re(w)?y="":Re(C)?y=">="+w+".0.0":Re(N)?y=">="+w+"."+C+".0":y=">="+y,Re(F)?A="":Re(de)?A="<"+(+F+1)+".0.0":Re(me)?A="<"+F+"."+(+de+1)+".0":ke?A="<="+F+"."+de+"."+me+"-"+ke:A="<="+A,(y+" "+A).trim()}ye.prototype.test=function(l){if(!l)return!1;if(typeof l=="string")try{l=new B(l,this.options)}catch{return!1}for(var y=0;y<this.set.length;y++)if(xt(this.set[y],l,this.options))return!0;return!1};function xt(l,y,w){for(var C=0;C<l.length;C++)if(!l[C].test(y))return!1;if(y.prerelease.length&&!w.includePrerelease){for(C=0;C<l.length;C++)if(r(l[C].semver),l[C].semver!==Ze&&l[C].semver.prerelease.length>0){var N=l[C].semver;if(N.major===y.major&&N.minor===y.minor&&N.patch===y.patch)return!0}return!1}return!0}t.satisfies=Pe;function Pe(l,y,w){try{y=new ye(y,w)}catch{return!1}return y.test(l)}t.maxSatisfying=it;function it(l,y,w){var C=null,N=null;try{var V=new ye(y,w)}catch{return null}return l.forEach(function(X){V.test(X)&&(!C||N.compare(X)===-1)&&(C=X,N=new B(C,w))}),C}t.minSatisfying=rn;function rn(l,y,w){var C=null,N=null;try{var V=new ye(y,w)}catch{return null}return l.forEach(function(X){V.test(X)&&(!C||N.compare(X)===1)&&(C=X,N=new B(C,w))}),C}t.minVersion=En;function En(l,y){l=new ye(l,y);var w=new B("0.0.0");if(l.test(w)||(w=new B("0.0.0-0"),l.test(w)))return w;w=null;for(var C=0;C<l.set.length;++C){var N=l.set[C];N.forEach(function(V){var X=new B(V.semver.version);switch(V.operator){case">":X.prerelease.length===0?X.patch++:X.prerelease.push(0),X.raw=X.format();case"":case">=":(!w||Je(w,X))&&(w=X);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+V.operator)}})}return w&&l.test(w)?w:null}t.validRange=Sn;function Sn(l,y){try{return new ye(l,y).range||"*"}catch{return null}}t.ltr=zt;function zt(l,y,w){return I(l,y,"<",w)}t.gtr=Ye;function Ye(l,y,w){return I(l,y,">",w)}t.outside=I;function I(l,y,w,C){l=new B(l,C),y=new ye(y,C);var N,V,X,A,F;switch(w){case">":N=Je,V=Zt,X=Ke,A=">",F=">=";break;case"<":N=Ke,V=$t,X=Je,A="<",F="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Pe(l,y,C))return!1;for(var de=0;de<y.set.length;++de){var me=y.set[de],ke=null,Ce=null;if(me.forEach(function(We){We.semver===Ze&&(We=new Ne(">=0.0.0")),ke=ke||We,Ce=Ce||We,N(We.semver,ke.semver,C)?ke=We:X(We.semver,Ce.semver,C)&&(Ce=We)}),ke.operator===A||ke.operator===F||(!Ce.operator||Ce.operator===A)&&V(l,Ce.semver))return!1;if(Ce.operator===F&&X(l,Ce.semver))return!1}return!0}t.prerelease=Tt;function Tt(l,y){var w=j(l,y);return w&&w.prerelease.length?w.prerelease:null}t.intersects=on;function on(l,y,w){return l=new ye(l,w),y=new ye(y,w),l.intersects(y)}t.coerce=sn;function sn(l,y){if(l instanceof B)return l;if(typeof l=="number"&&(l=String(l)),typeof l!="string")return null;y=y||{};var w=null;if(!y.rtl)w=l.match(x[a.COERCE]);else{for(var C;(C=x[a.COERCERTL].exec(l))&&(!w||w.index+w[0].length!==l.length);)(!w||C.index+C[0].length!==w.index+w[0].length)&&(w=C),x[a.COERCERTL].lastIndex=C.index+C[1].length+C[2].length;x[a.COERCERTL].lastIndex=-1}return w===null?null:j(w[2]+"."+(w[3]||"0")+"."+(w[4]||"0"),y)}})(Vr,Vr.exports);var Qu=Vr.exports;const Ps=Zo,Ct=Qu,Be="semver",Ju={base:Ps.string(),type:"semverRange",validate:function(e,{error:t}){return Ct.validRange(e)?{value:e}:{errors:t(`${Be}.valid`)}},messages:{[`${Be}.valid`]:"{{#label}} needs to be a valid semver range"}},wn={};wn.compare={method:!1,validate:function(e,t,{exp:n},{name:r}){return Ct[r](e,n)?e:t.error(`${Be}.${r}`,{exp:n})},args:[{name:"exp",assert:Ct.valid,message:"needs to be a valid semver expression"}]};["gt","gte","lt","lte","eq","neq"].forEach(function(e){wn[e]={method:function(t){return this.$_addRule({name:e,method:"compare",args:{exp:t}})}}});wn.cmp={method:function(e,t){return this.$_addRule({name:"cmp",args:{cmp:e,exp:t}})},validate:function(e,t,{cmp:n,exp:r}){return Ct.cmp(e,n,r)?e:t.error(`${Be}.cmp`,{cmp:n,exp:r})},args:[{name:"cmp",assert:e=>["===","!==","","=","==","!=",">",">=","<","<="].includes(e),message:"needs to be a valid comparator"},{name:"exp",assert:Ct.valid,message:"needs to be a valid semver expression"}]};wn.compareRange={method:!1,validate:function(e,t,{rng:n},{name:r}){return Ct[r](e,n)?e:t.error(`${Be}.${r}`,{rng:n})},args:[{name:"rng",assert:Ct.validRange,message:"needs to be a valid semver range"}]};["satisfies","gtr","ltr"].forEach(function(e){wn[e]={method:function(t){return this.$_addRule({name:e,method:"compareRange",args:{rng:t}})}}});wn.outside={method:function(e,t){return this.$_addRule({name:"outside",args:{hilo:e,rng:t}})},validate:function(e,t,{hilo:n,rng:r}){return Ct.outside(e,r,n)?e:t.error(`${Be}.outside`,{hilo:n,rng:r})},args:[{name:"hilo",assert:e=>[">","<"].includes(e),message:"needs to be a valid comparator"},{name:"rng",assert:Ct.validRange,message:"needs to be a valid semver range"}]};const Zu={base:Ps.string(),type:"semver",validate:function(e,{error:t}){return Ct.valid(e)?{value:e}:{errors:t(`${Be}.valid`)}},messages:{[`${Be}.valid`]:"{{#label}} needs to be a valid semver expression",[`${Be}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${Be}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${Be}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${Be}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${Be}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${Be}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${Be}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${Be}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${Be}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${Be}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${Be}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:wn};var ed={semver:Zu,semverRange:Ju};/*!
|
|
200
|
+
* is-var-name | ISC (c) Shinnosuke Watanabe
|
|
201
|
+
* https://github.com/shinnn/is-var-name
|
|
202
|
+
*/function td(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const nd=Object.freeze(Object.defineProperty({__proto__:null,default:td},Symbol.toStringTag,{value:"Module"})),rd=ii(nd),id=ii(Za),od=nl,sd=rl,wo=gr,ad=e=>{if((0,wo.isValid)(e))return e;const t=(0,sd.toHex)(Rl.from(typeof e=="string"?e.trim():e));return(0,wo.fromPublicKey)(t,{role:od.types.RoleType.ROLE_ANY})};var ld=ad,xn={},_s=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xn,"__esModule",{value:!0});xn.didExtension=xn.fileExtension=void 0;const Eo=_s(Rs),cd=_s(Jl),ud=gr,Ls=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=>Eo.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 Eo.default.statSync(cd.default.join(r,t)),t}catch(u){switch(u.code){case"ENOENT":return n("file.enoent",{file:t})}return n("file.error.generic",{message:u.message})}}}}});xn.fileExtension=Ls;const Ns=e=>({type:"DID",base:e.string(),validate(t,{error:n}){return!t||typeof t!="string"?{errors:n("did.empty",{did:t})}:(0,ud.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'}});xn.didExtension=Ns;xn.default={fileExtension:Ls,didExtension:Ns};var bi={},As={exports:{}};const dd=["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 Ds=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),hd=dd,pd=["node_modules","favicon.ico"],fd=As.exports=function(e){var t=[],n=[];if(e===null)return n.push("name cannot be null"),Gn(t,n);if(e===void 0)return n.push("name cannot be undefined"),Gn(t,n);if(typeof e!="string")return n.push("name must be a string"),Gn(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"),pd.forEach(function(d){e.toLowerCase()===d&&n.push(d+" is a blacklisted name")}),hd.forEach(function(d){e.toLowerCase()===d&&t.push(d+" 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(Ds);if(r){var o=r[1],u=r[2];if(encodeURIComponent(o)===o&&encodeURIComponent(u)===u)return Gn(t,n)}n.push("name can only contain URL-friendly characters")}return Gn(t,n)};fd.scopedPackagePattern=Ds;var Gn=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},md=As.exports;(function(e){var t=Se&&Se.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const n=gr,r=t(md),o=32,u=h=>{if((0,n.toTypeInfo)(h).role!==n.types.RoleType.ROLE_BLOCKLET)throw new Error("Blocklet DID's type must be ROLE_BLOCKLET")};e.validateNewDid=u;const d=(h,{checkDid:b=!0}={})=>{if((0,n.isValid)(h))b&&(0,e.validateNewDid)(h);else{const{validForNewPackages:x,errors:s=[],warnings:a=[]}=(0,r.default)(h);if(!x)throw new Error(s[0]||a[0]);if(h.length>o)throw new Error("Blocklet name is too long")}};e.validateName=d,e.default={validateName:e.validateName,validateNewDid:e.validateNewDid}})(bi);var gd=Se&&Se.__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]}),vd=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),yd=Se&&Se.__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"&&gd(n,t,r[o]);return vd(n,t),n}}(),An=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(re,"__esModule",{value:!0});re.Joi=re.eventsSchema=re.installBlockletDescriptionSchema=re.installBlockletTitleSchema=re.resourceBundleSchema=re.authConfigSchema=re.cacheableSchema=re.statsSchema=re.titleSchema=re.themeSchema=re.signatureSchema=re.serviceSchema=re.scriptsSchema=re.personSchema=re.navigationSchema=re.navigationItemSchema=re.updateMountPointSchema=re.mountPointSchema=re.logoSchema=re.interfaceSchema=re.environmentNameSchema=re.environmentSchema=re.engineSchema=re.endpointSchema=re.distSchema=re.descriptionSchema=re.createBlockletSchema=re.componentSchema=re.blockletNameSchema=re.blockletMetaSchema=void 0;const bd=An(Rs),xd=An(Zo),wd=An(Ku),Ed=An(Yu),So=ed,Sd=An(rd),To=ns,Td=gr,jd=id,De=Rt,Od=An(ld),jo=xn,Gr=bi,xi=yd(dl),kd=wd.default.default,Oo="/.well-known",c=xd.default.extend(So.semver).extend(So.semverRange).extend(jo.fileExtension).extend(jo.didExtension);re.Joi=c;const ko=(e,t)=>(0,xi.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
|
+
`),Rd=(e,t)=>!e||(0,Sd.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
|
+
`),Er=c.string().trim().min(1).custom(e=>{if(kd(e)>De.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${De.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);return e}).meta({className:"TTitle"});re.titleSchema=Er;const Sr=c.string().trim().min(3).max(160).meta({className:"TDescription"});re.descriptionSchema=Sr;const Ms=c.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});re.installBlockletTitleSchema=Ms;const Fs=c.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});re.installBlockletDescriptionSchema=Fs;const Bs=c.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((e,t)=>e.includes(To.WELLKNOWN_BLOCKLET_LOGO_PATH)?t.message(`logo url should not include ${To.WELLKNOWN_BLOCKLET_LOGO_PATH}`):e).meta({className:"TLogo"});re.logoSchema=Bs;const $s=c.string().trim().min(1),wi=$s.meta({className:"TMountPoint"}).custom((e,t)=>(0,xi.isValidUrlPath)(e)?e:t.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));re.mountPointSchema=wi;const Us=$s.meta({className:"TUpdateMountPoint"}).custom(e=>(0,xi.default)(e));re.updateMountPointSchema=Us;const Ln=c.string().custom(e=>((0,Gr.validateName)(e),e)).meta({className:"TBlockletName"});re.blockletNameSchema=Ln;const Cd=[],Ei=c.string().trim().min(1).max(50).required().custom((e,t)=>e.startsWith("BLOCKLET")&&!Cd.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"});re.environmentNameSchema=Ei;const Si=c.object({name:Ei.required(),description:c.string().trim().required(),default:c.string().optional().allow("").default(""),required:c.boolean().default(!1),secure:c.boolean().default(!1),validation:c.string().optional(),shared:c.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"});re.environmentSchema=Si;const Ti=c.object({dev:c.string().trim().min(1),e2eDev:c.string().trim().min(1),preFlight:c.string().trim().min(1),preInstall:c.string().trim().min(1),postInstall:c.string().trim().min(1),preStart:c.string().trim().min(1),postStart:c.string().trim().min(1),preStop:c.string().trim().min(1),preUninstall:c.string().trim().min(1),preConfig:c.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"});re.scriptsSchema=Ti;const ji=c.object({name:c.string().required().trim(),config:c.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});re.serviceSchema=ji;const Oi=c.object({type:c.string().trim(!0).min(1).required(),path:c.string().required(),meta:c.object({vcType:c.string(),payable:c.boolean(),params:c.array().items({name:c.string().required().trim(),description:c.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});re.endpointSchema=Oi;const Ws=c.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"});re.cacheableSchema=Ws;const ki=c.object({type:c.string().lowercase().valid(...De.BLOCKLET_INTERFACE_TYPES).required(),name:c.string().trim().required(),path:c.string().trim().default("/"),prefix:c.string().trim().min(1).default(De.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:c.number().port().optional(),hostIP:c.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:c.string().lowercase().valid(...De.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:c.alternatives().try(c.string().uppercase().default(De.BLOCKLET_DEFAULT_PORT_NAME),c.object({internal:c.string().uppercase().required(),external:c.number().port().required()})).default(De.BLOCKLET_DEFAULT_PORT_NAME),cacheable:c.array().items(Ws).unique(),services:c.array().items(ji).unique("name"),endpoints:c.array().items(Oi).unique("type"),pageGroups:c.array().items(c.string().min(1).max(255).trim()).unique()}).meta({className:"TInterface",unknownType:"any"});re.interfaceSchema=ki;const Id=c.alternatives().try(c.string().required(),c.object({url:c.string().uri({scheme:["http","https","file"]}).required(),name:Ln.required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid())}),c.object({store:c.string().uri({scheme:["http","https"]}).required(),name:Ln.required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid()).default("latest")})),Hr=c.object({platform:c.string().valid(...De.BLOCKLET_PLATFORMS).optional(),interpreter:c.string().valid("binary","node","blocklet").default("node"),source:Id,args:c.array().items(c.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});re.engineSchema=Hr;const Qn=c.object({name:c.string().min(1).required(),email:c.string().email({tlds:!1}).optional(),url:c.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});re.personSchema=Qn;const Zn=c.object({tarball:c.alternatives().try(c.string().uri(),c.string()).required(),integrity:c.string().required(),size:c.number().optional()}).meta({className:"TDist",unknownType:"any"});re.distSchema=Zn;const zs=c.object({downloads:c.number().integer().greater(-1),star:c.number().default(0),purchases:c.number().default(0)}).meta({className:"TStats",unknownType:"any"});re.statsSchema=zs;const Pd=c.alternatives().try(c.object({url:c.alternatives().try(c.string().uri(),c.array().items(c.string().uri()).min(1)).required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid())}),c.object({store:c.string().uri({scheme:["http","https"]}),name:Ln.required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid()).default("latest")})),qs={source:Pd.required(),required:c.boolean(),title:Er,description:Sr,mountPoint:wi,name:Ln},Ks=(e,t)=>c.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),Ri=Ks(qs).meta({className:"TComponent",unknownType:"any"});re.componentSchema=Ri;const _d=Ks(qs,!0),Vs=({checkStore:e}={})=>{const t=[Ri,_d];return c.array().items(e?t[0]:t[1]).optional().default([])},Gs=c.object({type:c.string().required(),name:c.string().required(),signer:c.string().required(),pk:c.string().required(),created:c.string().isoDate().required(),sig:c.string().required(),excludes:c.array().items(c.string()).optional(),appended:c.array().items(c.string()).optional(),delegatee:c.string(),delegateePk:c.string(),delegation:c.string()}).meta({className:"TSignature",unknownType:"any"});re.signatureSchema=Gs;const Ro=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],Co={id:c.string().custom(Rd),title:c.alternatives().try(c.string().min(1).max(De.MAX_TITLE_LENGTH),c.object().min(1).pattern(c.string().valid(...Ro),c.string().min(1).max(De.MAX_TITLE_LENGTH))).required(),link:c.alternatives().try(c.string().custom(ko),c.object().min(1).pattern(c.string().valid(...Ro),c.string().custom(ko))),component:c.string().min(1),section:c.array().items(c.string().min(1)).single(),role:c.array().items(c.string().min(1)).single(),icon:c.string().min(1),visible:c.boolean()},Hs=c.object({...Co,items:c.array().items(c.object({...Co}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});re.navigationItemSchema=Hs;const Ci=c.array().items(Hs).unique((e,t)=>e.id&&t.id?e.id===t.id:!1).meta({className:"TNavigation",unknownType:"any"});re.navigationSchema=Ci;const Ii=c.object({background:c.alternatives().try(c.string().min(1),c.object({header:c.string().min(1),footer:c.string().min(1),default:c.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});re.themeSchema=Ii;const Xs=c.object({whoCanAccess:c.string().valid("owner","invited","all"),profileFields:c.array().items(c.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:c.array().items(c.string().min(1)),allowSwitchProfile:c.boolean(),blockUnauthenticated:c.boolean(),blockUnauthorized:c.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});re.authConfigSchema=Xs;const Ld=c.object({type:c.string().trim().min(1).required(),description:c.string().trim().min(1)}),Pi=c.object({did:c.DID().trim().required(),type:c.string().trim().min(1).required(),public:c.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});re.resourceBundleSchema=Pi;const _i=c.array().items(c.object({type:c.string().trim().min(1).max(128).pattern(/^(?!blocklet\.)[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/).message('Event type must be in format of "[noun.]verb" like "post.published" or "post.comment.published", and prefix "blocklet." is reserved').required(),description:c.string().trim().min(1).max(256).required()})).unique("type").meta({className:"TEvent",unknownType:"any"});re.eventsSchema=_i;const Ys={did:c.DID().trim().required(),version:c.semver().valid().required(),name:c.string().optional(),description:Sr.required(),group:c.string().valid(...De.BLOCKLET_GROUPS),main:c.string().trim(),title:Er.optional().allow(""),logo:c.string().trim().optional(),specVersion:c.semver().valid().gte("1.0.0").optional(),author:Qn.optional(),contributors:c.array().items(Qn).optional(),maintainers:c.array().items(Qn).optional(),community:c.string().uri().optional().allow("").default(""),documentation:c.string().uri().optional().allow("").default(""),homepage:c.string().uri().optional().allow("").default(""),license:c.string().optional().allow("").default(""),support:c.alternatives().try(c.string().uri(),c.string().email({tlds:!1})).optional(),nftFactory:c.DID().optional().allow("").default(""),payment:c.object({price:c.array().max(1).items(c.object({value:c.number().greater(0).required(),address:c.DID().required()})).default([]),share:c.array().max(4).items(c.object({name:c.string().required(),address:c.DID().required(),value:c.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:c.array().items(c.object({parentPriceRange:c.array().items(c.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:c.string().valid("fixed","percentage").required(),value:c.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:c.alternatives().try(c.string().trim().min(1),c.array().items(c.string().min(1))).optional(),tags:c.alternatives().try(c.string().trim().min(1),c.array().items(c.string().min(1))).optional(),gitHash:c.string().optional().allow(""),repository:c.alternatives().try(c.string().min(1),c.object({type:c.string().valid("git","https","svn").required(),url:c.string().uri().required(),directory:c.string()})).optional(),timeout:c.object({start:c.number().min(10).max(600),script:c.number().min(1).max(1800)}).default({start:60}),requirements:c.object({abtnode:c.semverRange().valid(),server:c.semverRange().valid(),os:c.alternatives().try(c.string().valid("*",...De.BLOCKLET_PLATFORMS),c.array().items(c.string().valid(...De.BLOCKLET_PLATFORMS)).min(1)),cpu:c.alternatives().try(c.string().valid("*",...De.BLOCKLET_ARCHITECTURES),c.array().items(c.string().valid(...De.BLOCKLET_ARCHITECTURES)).min(1)),fuels:c.array().items(c.object({endpoint:c.string().trim().required(),address:c.string().trim(),value:c.string().trim().required(),reason:c.string().trim().required()})),nodejs:c.semverRange().valid()}).default({server:De.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:c.array().items(ki).unique("name").custom((e,t)=>{if(e.filter(o=>o.type===De.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return t.message(`Only one ${De.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const r=e.filter(o=>o.type===De.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const o of r)if(!o.prefix.startsWith(Oo))return t.message(`Wellknown path prefix must start with: ${Oo}`);return e}).default([]),environments:c.array().items(Si).default([]).optional().custom((e,t)=>{if(e&&e.length){const n=e.filter((r,o)=>e.findIndex(u=>u.name===r.name)!==o);if(n.length)return t.message(`find duplicate environment names ${n.map(r=>r.name).join(", ")}`)}return e}),scripts:Ti,capabilities:c.object({clusterMode:c.boolean(),didSpace:c.string().valid(...Object.values(De.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:c.boolean().default(!0),serverless:c.boolean().optional(),component:c.boolean(),sitemap:c.boolean().optional()}).default({}),files:c.array().items(c.string().trim()).optional(),resource:c.object({exportApi:c.string().trim(),bundles:c.array().items(Pi),types:c.array().items(Ld).max(10)}),engine:c.alternatives().try(Hr,c.array().items(Hr)).optional(),screenshots:c.array().items(c.string().min(1)).optional().default([]),videos:c.array().items(c.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:c.string().optional().allow(""),dist:Zn.optional(),stats:zs.optional(),htmlAst:c.any().optional(),path:c.string().optional(),signatures:c.array().items(Gs).optional(),lastPublishedAt:c.string().isoDate().optional().allow(null),components:Vs(),navigation:Ci,theme:Ii,copyright:c.object({owner:c.string().min(1),year:c.alternatives().try(c.string(),c.number())}),bundleName:c.string(),bundleDid:c.DID().trim(),storeId:c.string(),events:_i.optional()},Nd=c.object(Ys).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});re.blockletMetaSchema=Nd;const Qs=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:o=!1,skipValidateDidName:u=!1,...d}={})=>((!e||!bd.default.existsSync(e))&&(t=!1),c.object({...Ys,owner:c.object({avatar:c.string().optional(),did:c.DID().trim().required(),fullName:c.string().trim().required(),email:c.string().optional().allow(null).empty("").default("")}).optional(),logo:t?c.file().trim().exists({baseDir:e}).optional():c.string().trim().optional(),files:c.array().items(t?c.file().exists({baseDir:e,canSkip:(h,b)=>[De.BLOCKLET_ENTRY_FILE,De.BLOCKLET_BUNDLE_FILE].includes(b)||(0,Ed.default)(b)}):c.string().trim()).optional(),dist:n?Zn.required():Zn.optional(),components:Vs({checkStore:r}),name:o?c.string().optional():c.string().required(),egress:c.boolean().optional().default(!0),docker:jd.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...d}).rename("children","components").custom((h,b)=>{const{did:x,name:s,docker:a}=h;if(a){const{image:v,dockerfile:S,network:k}=a;if(!v&&!S)return b.message("Image or dockerfile must be set");if(v&&S)return b.message("Image and dockerfile cannot be set at the same time");if(k)return b.message("ExportPorts and network cannot be set at the same time");if(S&&(h.files||(h.files=[]),h.files.push(S)),a.volumes)for(const _ of a.volumes){if(!_.startsWith("$BLOCKLET_APP_DIR/")&&!_.startsWith("$BLOCKLET_DATA_DIR/"))return b.message("Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR");if(_.indexOf("..")>-1)return b.message('Volume cannot contain ".."')}}let O;if((0,Td.isValid)(x))try{return(0,Gr.validateNewDid)(x),h}catch(v){O=v}if(s){(0,Gr.validateName)(s,{checkDid:!u});const v=(0,Od.default)(s);return v!==x?b.message(`The did of name "${s}" should be "${v}"`):h}return O?b.message(O.message):h}));re.createBlockletSchema=Qs;re.default={blockletNameSchema:Ln,componentSchema:Ri,endpointSchema:Oi,serviceSchema:ji,createBlockletSchema:Qs,interfaceSchema:ki,environmentSchema:Si,environmentNameSchema:Ei,scriptsSchema:Ti,personSchema:Qn,distSchema:Zn,titleSchema:Er,descriptionSchema:Sr,logoSchema:Bs,navigationSchema:Ci,themeSchema:Ii,mountPointSchema:wi,updateMountPointSchema:Us,authConfigSchema:Xs,resourceBundleSchema:Pi,installBlockletTitleSchema:Ms,installBlockletDescriptionSchema:Fs,eventsSchema:_i,Joi:c};var Et={},Ad=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Et,"__esModule",{value:!0});Et.setService=Et.findService=Et.getDefaultServiceConfig=Et.getServiceConfig=void 0;const Dd=Ad(Zl),Md=re,Js={},Li=e=>{Js[e.name]={validate:e.schema.validate.bind(e.schema),defaultConfig:e.default}};Et.setService=Li;Li({name:"auth",schema:Md.authConfigSchema,default:{}});const Zs=e=>{if(!e)throw new Error("service name should not be empty");const t=Js[e];if(!t)throw new Error(`service ${e} does not exist`);return t},ea=(e,t,{validate:n}={})=>{const r=Zs(e),o=(0,Dd.default)(t||{}),{value:u,error:d}=r.validate(o);if(n&&d)throw new Error(`Invalid blocklet service config: ${d.details.map(h=>h.message).join(", ")}`);return u};Et.getServiceConfig=ea;const ta=e=>{const{defaultConfig:t}=Zs(e);return t};Et.getDefaultServiceConfig=ta;const na=(e,t)=>{const n=[t];return(e||[]).find(r=>n.includes(r.name))};Et.findService=na;Et.default={getServiceConfig:ea,getDefaultServiceConfig:ta,findService:na,setService:Li};Object.defineProperty(bn,"__esModule",{value:!0});bn.fixAndValidateService=bn.validateMeta=void 0;const Fd=re,Bd=Et,$d=e=>(!e.interfaces||!e.interfaces.length||e.interfaces.forEach(t=>{t.services&&t.services.length&&t.services.forEach(n=>{n.config=(0,Bd.getServiceConfig)(n.name,n.config,{validate:!0})})}),e);bn.fixAndValidateService=$d;const ra=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:o=!1,skipValidateDidName:u=!1,schemaOptions:d={}}={})=>{const h=(0,Fd.createBlockletSchema)(null,{ensureFiles:t,ensureDist:n,ensureComponentStore:r,ensureName:o,skipValidateDidName:u,...d}),{value:b,error:x}=h.validate(e);if(x)throw new Error(`Invalid blocklet meta: ${x.details.map(s=>s.message).join(", ")}`);return b};bn.validateMeta=ra;bn.default=ra;(function(e){var t=Se&&Se.__createBinding||(Object.create?function(j,q,Z,B){B===void 0&&(B=Z);var ue=Object.getOwnPropertyDescriptor(q,Z);(!ue||("get"in ue?!q.__esModule:ue.writable||ue.configurable))&&(ue={enumerable:!0,get:function(){return q[Z]}}),Object.defineProperty(j,B,ue)}:function(j,q,Z,B){B===void 0&&(B=Z),j[B]=q[Z]}),n=Se&&Se.__setModuleDefault||(Object.create?function(j,q){Object.defineProperty(j,"default",{enumerable:!0,value:q})}:function(j,q){j.default=q}),r=Se&&Se.__importStar||function(){var j=function(q){return j=Object.getOwnPropertyNames||function(Z){var B=[];for(var ue in Z)Object.prototype.hasOwnProperty.call(Z,ue)&&(B[B.length]=ue);return B},j(q)};return function(q){if(q&&q.__esModule)return q;var Z={};if(q!=null)for(var B=j(q),ue=0;ue<B.length;ue++)B[ue]!=="default"&&t(Z,q,B[ue]);return n(Z,q),Z}}(),o=Se&&Se.__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 u=o(hl),d=r(Du),h=Rt,b=bn;Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return b.fixAndValidateService}});const x=bi,s=(j,q)=>{j.description||(j.description=`Blocklet from ${q}`),j.version||(j.version=h.BLOCKLET_DEFAULT_VERSION)};e.fixRequired=s;const a=j=>{if(j.repository&&(typeof j.repository=="string"&&(j.repository={type:"git",url:j.repository}),j.repository.url)){const q=d.fromUrl(j.repository.url);q&&(j.repository.url=q.getDefaultRepresentation()==="shortcut"?q.https():q.toString())}};e.fixRepository=a;const O=j=>{Array.isArray(j.files)?j.files&&(j.files=j.files.filter(q=>!(!q||typeof q!="string"))):delete j.files};e.fixFiles=O;const v=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(q=>!(typeof q!="string"||!q)))};e.fixKeywords=v;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(q=>!(typeof q!="string"||!q)))};e.fixTags=S;const k=(j,q)=>(j.author&&(j.author=q(j.author)),["maintainers","contributors"].forEach(Z=>{Array.isArray(j[Z])&&(j[Z]=j[Z].map(q))}),j),_=j=>{if(!j)return"";if(typeof j=="string")return j;const q=j.name||"",Z=j.url||j.web,B=Z?` (${Z})`:"",ue=j.email||j.mail,ee=ue?` <${ue}>`:"";return q+ee+B};e.formatPerson=_;const D=j=>{if(typeof j!="string")return j;const q=j.match(/^([^(<]+)/),Z=j.match(/\(([^)]+)\)/),B=j.match(/<([^>]+)>/),ue={};return q&&q[0].trim()&&(ue.name=q[0].trim()),B&&([,ue.email]=B),Z&&([,ue.url]=Z),ue};e.parsePerson=D;const Q=j=>(k(j,_),k(j,D),j);e.fixPerson=Q;const z=(j,q=!0)=>{if(Array.isArray(j.interfaces)||(j.interfaces=[]),j.interfaces.length)return j.interfaces.forEach(ee=>{ee.type===h.BLOCKLET_INTERFACE_TYPE_WEB&&(ee.protocol="http")}),j;const B=(0,u.default)(j,"capabilities.dynamicPathPrefix",!0)?h.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",ue=({type:ee="web",name:ae,path:Te="/",protocol:Fe="http",port:$e=h.BLOCKLET_DEFAULT_PORT_NAME})=>{j.interfaces.push({type:ee,name:ae,path:Te,prefix:B,port:$e,protocol:Fe})};return[h.BLOCKLET_INTERFACE_PUBLIC].forEach(ee=>{j[ee]&&ue({name:ee,path:j[ee]})}),Array.isArray(j.exposeServices)&&j.exposeServices.forEach(ee=>{ue({type:"service",name:ee.protocol,protocol:ee.protocol,port:{internal:`BLOCKLET_${ee.protocol}_PORT`.toUpperCase(),external:ee.port}})}),q&&(delete j.publicUrl,delete j.adminUrl,delete j.configUrl,delete j.docUrl,delete j.exposeServices,j.capabilities&&delete j.capabilities.dynamicPathPrefix),j};e.fixInterfaces=z;const J=j=>{const{did:q}=j;try{(0,x.validateNewDid)(q),j.name=q}catch{}return j};e.fixName=J,e.default={fixRequired:s,fixRepository:a,fixFiles:O,fixKeywords:v,fixPerson:Q,fixTags:S,fixName:J,formatPerson:_,parsePerson:D,fixInterfaces:z,fixService:b.fixAndValidateService}})(Ss);function ia({owner:e,locale:t}){return i.jsxs(Y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?i.jsx(ts,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:t}):null]})}ia.propTypes={owner:P.object.isRequired,locale:P.string.isRequired};const Ud="install-blocklet-from-URL",oa=()=>{const[e,t]=hs(Ud,"[]",{raw:!0}),n=o=>{const u=o.trim(),d=JSON.parse(e),h=d.findIndex(b=>b===u);h!==0&&(h>0&&d.splice(h,1),d.length>=10&&d.splice(9),d.unshift(u),t(JSON.stringify(d)))},r=o=>{if(!o)return;const u=JSON.parse(e),d=o.trim(),h=u.findIndex(b=>b===d);h>-1&&(u.splice(h,1),t(JSON.stringify(u)))};return{urls:e?JSON.parse(e):[],addUrlRecord:n,removeUrlRecord:r}},Wd=zo(()=>({listItemText:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}));function Ni(e){const{value:t,onValueChange:n,children:r,helperText:o}=e,{urls:u,removeUrlRecord:d}=oa(),h=(x,s)=>{x.preventDefault(),x.stopPropagation(),d(s)},b=Wd();return i.jsxs(Y,{children:[i.jsx(qo,{freeSolo:!0,options:u,inputValue:t,onInputChange:(x,s)=>{n(s)},disableClearable:!0,popupIcon:null,renderInput:x=>Qa.cloneElement(r,{...x}),renderOption:(x,s)=>L.createElement(Ko,{...x,key:s,secondaryAction:i.jsx(Wo,{edge:"end","aria-label":"delete",onClick:a=>h(a,s),children:i.jsx(il,{})})},i.jsx(Ia,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:i.jsx(Vo,{primary:s,className:b.listItemText})})),ListboxProps:{sx:{maxHeight:300,overflow:"auto"}}}),i.jsx(Pa,{style:{margin:0},children:o})]})}Ni.propTypes={onValueChange:P.func,children:P.node,value:P.string,helperText:P.string};Ni.defaultProps={onValueChange:()=>{},children:null,value:"",helperText:""};function Ai({defaultUrl:e,onCancel:t,onSuccess:n,onError:r,mode:o,handleText:u}){const{api:d}=Nn(),{api:h}=ec(),[b,x]=L.useState(!1),[s,a]=L.useState(""),{t:O,locale:v}=yt(),S={dist:{}},[k,_]=L.useState(e),[D,Q]=L.useState(e?1:0),[z,J]=L.useState(S),[j,q]=L.useState(!1),[Z,B]=L.useState({}),ue=o==="component",ee=ue?!0:!e,{addUrlRecord:ae}=oa(),Te=async()=>{J(S),a(null),x(!0);let se=k.trim();!se.startsWith("https://")&&!se.startsWith("http://")&&!se.startsWith("file://")&&(se=`file://${se}`);try{const pt=decodeURIComponent(se);try{new URL(pt)}catch{throw new Error("Invalid URL")}const{meta:Ee,inStore:Je,registryUrl:Ke}=await d.getBlockletMetaFromUrl({input:{url:pt}});J(Ee),B({inStore:Je,registryUrl:Ke,inputUrl:se}),ae(se)}catch(pt){console.error(pt);const Ee=`Blocklet Install failed: ${ps(pt)}`;a(Ee),r(pt)}finally{x(!1)}},Fe=()=>{if(ue){n({meta:z,...Z}),t();return}x(!0),q(!0)},$e=()=>{x(!1),q(!1),n({meta:z,...Z}),t()},rt=()=>{x(!1),q(!1)};L.useEffect(()=>{e&&Te()},[e]);const ne=[{name:O("common.name"),value:Bt.getDisplayName({meta:z},!0)},{name:O("common.version"),value:z.version},{name:O("common.did"),value:z.did?i.jsx(tc,{did:z.did}):null},{name:O("common.author"),value:z.owner?i.jsx(ia,{owner:z.owner,locale:v}):Ss.formatPerson(z.author)},{name:O("blocklet.dist.downloadLink"),value:z.dist.tarball}],fe=()=>b?i.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:i.jsx(vt,{})}):z.did?i.jsx("div",{style:{paddingLeft:"10%"},children:ne.map(se=>se.name===O("common.did")?i.jsx(so,{valueComponent:"div",nameWidth:120,name:se.name,nameFormatter:()=>O("common.did"),children:se.value},se.name):i.jsx(so,{valueComponent:"div",nameWidth:120,name:se.name,children:se.value},se.name))}):null,K=[{label:O("blocklet.fromUrl.step0"),body:i.jsx(ge,{component:"div",children:i.jsx(Ni,{style:{marginBottom:32},value:k,helperText:O("blocklet.fromUrl.description"),onValueChange:se=>{a(null),_(se)},children:i.jsx(mr,{label:O("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:k,onChange:se=>{a(null),_(se.target.value)},disabled:b,onKeyPress:se=>{se.key==="Enter"&&(se.preventDefault(),Te(),Q(1))}})})}),cancel:O("common.cancel"),confirm:O("common.next"),onCancel:t,onConfirm:()=>{Te(),Q(1)}},{label:O("blocklet.fromUrl.step1"),body:fe(),cancel:O(ee?"common.pre":"common.cancel"),confirm:(u==null?void 0:u.confirm)||O("blocklet.fromUrl.confirm"),onCancel:()=>{ee?Q(se=>se-1):t()},onConfirm:()=>{Fe()}}],je=K[D];return i.jsxs(i.Fragment,{children:[i.jsxs(si,{title:(u==null?void 0:u.title)||O("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>je.onCancel(),showCloseButton:D===0,disableEscapeKeyDown:!0,open:!0,actions:i.jsxs(i.Fragment,{children:[je.cancel&&i.jsx(dt,{onClick:se=>{se.stopPropagation(),a(null),je.onCancel()},color:"inherit",children:je.cancel||O("common.cancel")}),i.jsxs(dt,{onClick:se=>{se.stopPropagation(),je.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:b||!k||s,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[b&&D===0&&i.jsx(vt,{size:16}),je.confirm]})]}),children:[ee&&i.jsx(_a,{alternativeLabel:!0,activeStep:D,children:K.map(({label:se})=>i.jsx(La,{children:i.jsx(Na,{children:se})},se))}),i.jsx(Aa,{component:"div",style:{marginTop:24},children:je.body}),!!s&&i.jsx(Go,{severity:"error",style:{width:"100%",marginTop:8},children:s})]}),z&&j&&i.jsx(rs,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:h.get,checkTimeout:5*60*1e3,onSuccess:$e,extraParams:{title:z.title,wt:pl(z),blockletMetaUrl:decodeURIComponent(k.trim())},messages:{title:O("setup.keyPair.title"),scan:O("setup.keyPair.scan"),confirm:O("setup.keyPair.confirm"),success:O("setup.keyPair.success")},onClose:rt})]})}Ai.propTypes={defaultUrl:P.string,onCancel:P.func.isRequired,onSuccess:P.func.isRequired,onError:P.func,mode:P.oneOf(["install","component"]),handleText:P.object};Ai.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};const zd={meta:P.object.isRequired,onCancel:P.func.isRequired},qd=zo(()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}}));function sa({action:e,onSelect:t,onNext:n}){const r=qd(),{t:o}=yt(),u=[{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(Da,{className:r.tabPanel,children:u.map(d=>i.jsxs(Ko,{button:!0,selected:e===d.action,onClick:()=>t(d.action),children:[i.jsx(Ma,{className:r.iconRoot,children:d.action==="purchase"?i.jsx(nc,{style:{color:e==="purchase"?eo.primary.main:"#AAA",fontSize:32}}):i.jsx(rc,{style:{color:e==="verify"?eo.primary.main:"#AAA",fontSize:32}})}),i.jsx(Vo,{primary:d.title,secondary:d.description})]},d.action))}),n&&i.jsx(dt,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:n,children:o("common.next")})]})}sa.propTypes={action:P.oneOf(["both","purchase","verify"]).isRequired,onSelect:P.func.isRequired,onNext:P.func.isRequired};function Di({meta:e,onCancel:t,mode:n,handlePaySuccess:r}){const{t:o,locale:u}=yt(),{info:d}=Nn(),h=fl(d),[b,x]=L.useState(null),s=new URL(e==null?void 0:e.registryUrl).origin,a=Bt.getDisplayName({meta:e}),O=async(S,k)=>{const _=({downloadTokenList:z})=>{r({downloadTokenList:z})},D=z=>{ai.error(z),t(z)};function Q(z){return ol(()=>ao.get(z).then(async({data:J})=>{const j=J==null?void 0:J.downloadTokenList;if(J.status==="succeed"){if(j&&j.length)await _({downloadTokenList:j});else return await D(o("blocklet.component.missDownloadTokenTip")),!0;return!0}return J.status==="error"?(console.error("vc error: ",J),await D(J==null?void 0:J.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&b){const{statusUrl:z}=ml(b);await Q(z)}else await _({downloadTokenList:S.downloadTokenList&&k(S.downloadTokenList)})};if(L.useEffect(()=>{if(n==="purchase"){const S=new URL(s);S.pathname="/api/did/verify-purchase-blocklet/token",S.searchParams.set("serverDid",d.did),S.searchParams.set("blockletDid",e==null?void 0:e.did);try{ao.get(S.href).then(({data:k})=>{const _=`${k.url}`;x(_)})}catch(k){console.error("get next workflow url error: ",k)}}return()=>{x(null)}},[n]),n==="purchase"&&!b)return"";const v={verify:{action:"verify-purchase-blocklet",checkFn:oo.create({baseURL:s}).get,extraParams:{serverDid:d.did,blockletDid:e==null?void 0:e.did},messages:{title:o("store.purchase.verify.auth.title",{name:a}),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:oo.create({baseURL:Jn(s,"/store")}).get,extraParams:{factory:e.nftFactory,nw:b},messages:{title:o("store.purchase.auth.title",{name:a}),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(rs,{open:!0,locale:u,popup:!1,saveConnect:!1,className:"connect",baseUrl:s,onSuccess:O,cancelWhenScanned:t,onClose:t,checkTimeout:60*5e3,webWalletUrl:h,disableClose:!0,showDownload:!1,...v[n]})}Di.propTypes={...zd,handlePaySuccess:P.func,mode:P.oneOf(["verify","purchase"]).isRequired};Di.defaultProps={handlePaySuccess:()=>{}};const Mi=L.forwardRef(({mode:e,...t},n)=>{const[r,o]=L.useState(e!=="both"?e:"verify"),[u,d]=L.useState(e!=="both"?2:1),h=x=>{x!==r&&o(x)},b=()=>{r&&u!==2&&d(2)};return L.useImperativeHandle(n,()=>({onNext:b,getCurrentStep:()=>u})),u===1?i.jsx("div",{style:{maxWidth:520},children:i.jsx(sa,{action:r,onNext:null,onSelect:h})}):i.jsx(Di,{...t,mode:r})});Mi.propTypes={mode:P.oneOf(["both","verify","purchase"]).isRequired,ref:P.any};Mi.defaultProps={ref:{}};const Kd=Mi;function Vd({...e}){return i.jsx(dt,{className:"bottom-button",variant:"contained",color:"primary",...e})}function Fi({blocklet:e,onStartNow:t,children:n,disabled:r}){const{t:o}=yt(),u=fs();return!e||gl(e.meta)?i.jsx(Gd,{children:n}):i.jsxs(Hd,{isMobile:u,children:[i.jsx(Vd,{className:"start-now",variant:"contained",color:"primary",disabled:r,onClick:()=>t(),children:o("setup.startNow")}),i.jsx(Y,{display:"flex",alignItems:"center",children:n})]})}Fi.propTypes={blocklet:P.object,onStartNow:P.func,children:P.any,disabled:P.bool};Fi.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Gd=He(Y)`
|
|
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
|
+
`,Hd=He(Y)`
|
|
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 Bi({blockletMeta:e,onEndpointUpdate:t}){var h;const n=fs(),{blocklet:r}=vr(),{updateSpaceGateway:o,loading:u,hasStorageEndpoint:d}=Fl();return L.useEffect(()=>{t==null||t()},[r]),u?i.jsx(sl,{relative:"parent",children:i.jsx(vt,{})}):i.jsxs(Xd,{children:[i.jsx(Y,{width:n?"360px":"720px",children:d?i.jsx(ac,{}):i.jsx(lc,{})}),((h=e==null?void 0:e.capabilities)==null?void 0:h.didSpace)==="required"&&i.jsx(Fi,{mt:8,children:i.jsx(cc,{onConnect:o})})]})}Bi.propTypes={blockletMeta:P.any.isRequired,onEndpointUpdate:Fa.func};Bi.defaultProps={onEndpointUpdate:()=>{}};const Xd=He(sc)`
|
|
262
|
+
height: 100%;
|
|
263
|
+
overflow-y: auto;
|
|
264
|
+
padding-bottom: 32px;
|
|
265
|
+
overflow-x: hidden;
|
|
266
|
+
`;function $i({onChange:e,loading:t,children:n,extra:r,stores:o,storageKey:u}){const{t:d}=yt(),{info:h,inService:b}=Nn(),{blocklet:x}=vr(),[s,a]=L.useState(!1),O=L.useRef(null),[v,S]=L.useState(),[k,_]=hs(u||"tmp"),[D,Q]=u?[k,_]:[v,S],{storeList:z,teamDid:J}=as({fromBlocklet:b,blocklet:x,nodeInfo:h}),j=cs([...o.map(Z=>({...Z,protected:!0})),...z],"url"),q=D&&j.find(Z=>D===Z.url)||j[0];return i.jsxs(i.Fragment,{children:[i.jsxs(Yd,{children:[i.jsx(dt,{ref:O,color:"primary","data-cy":"add-component-select-store",endIcon:i.jsx(uc,{color:"primary"}),onClick:()=>{a(!0)},style:{padding:"0 2px"},children:i.jsx(ge,{color:"primary",children:q.name})}),i.jsx(ge,{color:"primary",children:r})]}),i.jsxs(mr,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:d("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:q,autoFocus:!0,onChange:Z=>{const B=Z.target.value;Q(B.url),e(B)},SelectProps:{open:s,MenuProps:{anchorEl:O.current},renderValue:Z=>Z==null?void 0:Z.name,onClose:()=>{a(!1)}},style:{display:"none"},margin:"normal",children:[j==null?void 0:j.map(Z=>i.jsx(ni,{sx:{width:"400px",maxWidth:"90vw"},value:Z,"data-cy":Z.url,children:i.jsx(el,{teamDid:J,store:Z,onDelete:()=>{var B;D===Z.url&&Q((B=j[0])==null?void 0:B.url)}})},Z.url)),!es.isInServerlessMode(h)&&i.jsx(tl,{disabled:t,storeList:j,teamDid:J,onAdd:Z=>{Q(Z)}})]}),n({currentRegistry:q})]})}$i.propTypes={onChange:P.func,loading:P.bool,children:P.any.isRequired,extra:P.node,storageKey:P.string,stores:P.arrayOf(P.shape({name:P.string.isRequired,url:P.string.isRequired}))};$i.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Yd=He.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
|
+
`,Qd=Qt("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
|
+
`;Qt("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
|
+
`;P.string||P.node,P.string,P.string||P.node,P.string,P.string,P.bool,P.bool,P.element,P.string,P.func,P.func,P.string;Qt("div")`
|
|
437
|
+
background-color: transparent !important;
|
|
438
|
+
& > :not(.Mui-disabled) {
|
|
439
|
+
position: relative;
|
|
440
|
+
z-index: 1;
|
|
441
|
+
&::before {
|
|
442
|
+
content: '';
|
|
443
|
+
position: absolute;
|
|
444
|
+
height: 100%;
|
|
445
|
+
width: 100%;
|
|
446
|
+
left: 0;
|
|
447
|
+
top: 0;
|
|
448
|
+
transition: opacity 0.3s;
|
|
449
|
+
}
|
|
450
|
+
&:hover::before {
|
|
451
|
+
opacity: 0;
|
|
452
|
+
}
|
|
453
|
+
&::after {
|
|
454
|
+
content: '';
|
|
455
|
+
position: absolute;
|
|
456
|
+
height: 100%;
|
|
457
|
+
width: 100%;
|
|
458
|
+
top: 0;
|
|
459
|
+
left: 0;
|
|
460
|
+
border-radius: 2px;
|
|
461
|
+
background-color: ${e=>e.theme.palette.primary.main};
|
|
462
|
+
transform: scale(0.1);
|
|
463
|
+
opacity: 0;
|
|
464
|
+
z-index: -1;
|
|
465
|
+
transition:
|
|
466
|
+
transform 0.3s,
|
|
467
|
+
opacity 0.3s,
|
|
468
|
+
background-color 0.3s;
|
|
469
|
+
}
|
|
470
|
+
&:hover::after {
|
|
471
|
+
opacity: 1;
|
|
472
|
+
transform-origin: center;
|
|
473
|
+
transform: scale(1);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
& > :not(.Mui-disabled) {
|
|
477
|
+
background-color: transparent !important;
|
|
478
|
+
color: ${e=>e.theme.palette.primary.main}!important;
|
|
479
|
+
}
|
|
480
|
+
& > :not(.Mui-disabled) {
|
|
481
|
+
&:hover {
|
|
482
|
+
color: ${e=>e.theme.palette.common.white}!important;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
`;const Io=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),Jd=(e="")=>{const t=parseInt(e,10);return Number.isNaN(t)?e:t<1e3?t:t<1e6?`${(t/1e3).toFixed(1)}k`:t<1e9?`${(t/1e6).toFixed(1)}m`:`${(t/1e9).toFixed(1)}b`},aa={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"/>'};function Xr({title:e,sx:t,children:n,slotProps:r,fontSize:o=12,fontWeight:u=500,color:d="text.secondary",...h}){var b,x;return e?i.jsx(Ho,{title:e,placement:"top",...h,slotProps:{popper:{...r==null?void 0:r.popper,sx:[{[`& .${Ba.tooltip}`]:{backgroundColor:"common.white",fontSize:o,fontWeight:u,boxShadow:"0px 4px 8px 0px #03071214, 0px 0px 0px 1px #03071214",marginBottom:"6px !important",borderRadius:"8px",cursor:"default",color:d,display:"flex",alignItems:"center"}},...Array.isArray((b=r==null?void 0:r.popper)==null?void 0:b.sx)?r.popper.sx:[(x=r==null?void 0:r.popper)==null?void 0:x.sx]]}},children:n}):n}function or({icon:e,children:t,maxWidth:n=100,title:r,sx:o}){return(t===0||t)&&i.jsxs(tt,{direction:"row",alignItems:"center",gap:.5,sx:[{maxWidth:n,overflow:"hidden"},...Array.isArray(o)?o:[o]],children:[e,i.jsx(Xr,{title:r||(typeof t=="string"?t:""),children:i.jsx(ge,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function Zd(e){const{title:t,description:n="",cover:r="",avatar:o,author:u,download:d,did:h,official:b,buttonText:x="Install",buttonDisabled:s,buttonLoading:a,button:O,onButtonClick:v=()=>{},onMainClick:S,className:k,ref:_,icons:D,status:Q,...z}=e,J=tr(),j=(ee,ae=()=>!1)=>(Te,...Fe)=>{const $e=ee instanceof Function;(ae()||$e)&&(Te.preventDefault(),Te.stopPropagation(),$e&&ee(...Fe))},q=S&&j(S),Z=j(v,()=>!!(O||s||a)),B=L.isValidElement(t)?{children:t}:{title:Io(t),dangerouslySetInnerHTML:{__html:t}},ue=L.isValidElement(n)?{children:n}:{title:Io(n),dangerouslySetInnerHTML:{__html:n}};return i.jsxs($a,{variant:"outlined",onClick:q,...z,sx:{p:{xs:2,md:3},borderRadius:2,...z.sx},children:[i.jsxs(tt,{flex:1,direction:"row",gap:1,alignItems:"center",overflow:"hidden",sx:{"& > *":{flexShrink:0}},children:[i.jsx(hr,{src:r,did:h,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),i.jsx(ge,{className:"blocklet-title",fontWeight:"fontWeightMedium",sx:{fontSize:16,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"default",pl:.5,"&&":{flexShrink:1}},...B}),i.jsxs(Y,{flex:1,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1,children:[b&&i.jsx(Xr,{title:b.tooltip,children:i.jsx(El,{sx:{color:b.color||"#D97706",fontSize:b.size||18}})}),D==null?void 0:D.map(ee=>i.jsx(Xr,{title:ee.title,children:typeof ee.icon=="string"?i.jsx(at,{icon:ee.icon,style:{color:ee.color}}):ee.icon},ee.key))]}),v&&i.jsxs(dt,{color:"reverse",variant:"outlined",size:"small",disabled:s||a,style:{borderColor:J.palette.grey[300],borderRadius:8,fontSize:13,fontWeight:J.typography.fontWeightMedium},onClick:Z,children:[a&&i.jsx(vt,{size:15,style:{marginRight:3,color:"inherit"}}),x]}),O]}),i.jsx(tt,{py:2,children:i.jsx(ge,{className:"blocklet-description",variant:"body2",color:"text.secondary",sx:{display:"-webkit-box",lineClamp:2,WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",cursor:"default",height:40},...ue})}),i.jsxs(tt,{direction:"row",alignItems:"center",gap:2,color:"text.secondary",children:[i.jsx(or,{icon:i.jsx(hr,{src:o,did:h,size:20,variant:"circle"}),maxWidth:200,children:u}),i.jsx(or,{icon:i.jsx(at,{icon:aa}),title:d,children:Jd(d)}),Q==null?void 0:Q.filter(ee=>ee.align!=="right").map(ee=>i.jsx(or,{icon:typeof ee.icon=="string"?i.jsx(at,{icon:ee.icon}):ee.icon,title:ee.title,maxWidth:ee.maxWidth,children:ee.text},ee.key)),i.jsx(Y,{sx:{flex:1}}),Q==null?void 0:Q.filter(ee=>ee.align==="right").map(ee=>i.jsx(or,{icon:typeof ee.icon=="string"?i.jsx(at,{icon:ee.icon}):ee.icon,title:ee.title,maxWidth:ee.maxWidth,sx:{color:ee.color},children:ee.text},ee.key))]})]})}const eh={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 Ui={},th=Zr;Object.defineProperty(Ui,"__esModule",{value:!0});var la=Ui.default=void 0,nh=th(oi()),rh=i;la=Ui.default=(0,nh.default)((0,rh.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");var ca={exports:{}};(function(e,t){(function(n,r){e.exports=r(L)})(Se,n=>(()=>{var r={703:(h,b,x)=>{var s=x(414);function a(){}function O(){}O.resetWarningCache=a,h.exports=function(){function v(_,D,Q,z,J,j){if(j!==s){var q=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 q.name="Invariant Violation",q}}function S(){return v}v.isRequired=v;var k={array:v,bool:v,func:v,number:v,object:v,string:v,symbol:v,any:v,arrayOf:S,element:v,elementType:v,instanceOf:S,node:v,objectOf:S,oneOf:S,oneOfType:S,shape:S,exact:S,checkPropTypes:O,resetWarningCache:a};return k.PropTypes=k,k}},697:(h,b,x)=>{h.exports=x(703)()},414:h=>{h.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:h=>{var b=typeof Element<"u",x=typeof Map=="function",s=typeof Set=="function",a=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function O(v,S){if(v===S)return!0;if(v&&S&&typeof v=="object"&&typeof S=="object"){if(v.constructor!==S.constructor)return!1;var k,_,D,Q;if(Array.isArray(v)){if((k=v.length)!=S.length)return!1;for(_=k;_--!=0;)if(!O(v[_],S[_]))return!1;return!0}if(x&&v instanceof Map&&S instanceof Map){if(v.size!==S.size)return!1;for(Q=v.entries();!(_=Q.next()).done;)if(!S.has(_.value[0]))return!1;for(Q=v.entries();!(_=Q.next()).done;)if(!O(_.value[1],S.get(_.value[0])))return!1;return!0}if(s&&v instanceof Set&&S instanceof Set){if(v.size!==S.size)return!1;for(Q=v.entries();!(_=Q.next()).done;)if(!S.has(_.value[0]))return!1;return!0}if(a&&ArrayBuffer.isView(v)&&ArrayBuffer.isView(S)){if((k=v.length)!=S.length)return!1;for(_=k;_--!=0;)if(v[_]!==S[_])return!1;return!0}if(v.constructor===RegExp)return v.source===S.source&&v.flags===S.flags;if(v.valueOf!==Object.prototype.valueOf)return v.valueOf()===S.valueOf();if(v.toString!==Object.prototype.toString)return v.toString()===S.toString();if((k=(D=Object.keys(v)).length)!==Object.keys(S).length)return!1;for(_=k;_--!=0;)if(!Object.prototype.hasOwnProperty.call(S,D[_]))return!1;if(b&&v instanceof Element)return!1;for(_=k;_--!=0;)if((D[_]!=="_owner"&&D[_]!=="__v"&&D[_]!=="__o"||!v.$$typeof)&&!O(v[D[_]],S[D[_]]))return!1;return!0}return v!=v&&S!=S}h.exports=function(v,S){try{return O(v,S)}catch(k){if((k.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw k}}},359:h=>{h.exports=n}},o={};function u(h){var b=o[h];if(b!==void 0)return b.exports;var x=o[h]={exports:{}};return r[h](x,x.exports,u),x.exports}u.n=h=>{var b=h&&h.__esModule?()=>h.default:()=>h;return u.d(b,{a:b}),b},u.d=(h,b)=>{for(var x in b)u.o(b,x)&&!u.o(h,x)&&Object.defineProperty(h,x,{enumerable:!0,get:b[x]})},u.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),u.o=(h,b)=>Object.prototype.hasOwnProperty.call(h,b),u.r=h=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(h,"__esModule",{value:!0})};var d={};return(()=>{function h(g){var p,E,T="";if(typeof g=="string"||typeof g=="number")T+=g;else if(typeof g=="object")if(Array.isArray(g))for(p=0;p<g.length;p++)g[p]&&(E=h(g[p]))&&(T&&(T+=" "),T+=E);else for(p in g)g[p]&&(T&&(T+=" "),T+=p);return T}function b(){for(var g,p,E=0,T="";E<arguments.length;)(g=arguments[E++])&&(p=h(g))&&(T&&(T+=" "),T+=p);return T}u.r(d),u.d(d,{default:()=>Ra});var x=u(359),s=u.n(x);const a=function(g){var p=typeof g;return g!=null&&(p=="object"||p=="function")},O=typeof Se=="object"&&Se&&Se.Object===Object&&Se;var v=typeof self=="object"&&self&&self.Object===Object&&self;const S=O||v||Function("return this")(),k=function(){return S.Date.now()};var _=/\s/,D=/^\s+/;const Q=function(g){return g&&g.slice(0,function(p){for(var E=p.length;E--&&_.test(p.charAt(E)););return E}(g)+1).replace(D,"")},z=S.Symbol;var J=Object.prototype,j=J.hasOwnProperty,q=J.toString,Z=z?z.toStringTag:void 0,B=Object.prototype.toString,ue=z?z.toStringTag:void 0;const ee=function(g){return g==null?g===void 0?"[object Undefined]":"[object Null]":ue&&ue in Object(g)?function(p){var E=j.call(p,Z),T=p[Z];try{p[Z]=void 0;var U=!0}catch{}var ie=q.call(p);return U&&(E?p[Z]=T:delete p[Z]),ie}(g):function(p){return B.call(p)}(g)};var ae=/^[-+]0x[0-9a-f]+$/i,Te=/^0b[01]+$/i,Fe=/^0o[0-7]+$/i,$e=parseInt;const rt=function(g){if(typeof g=="number")return g;if(function(T){return typeof T=="symbol"||function(U){return U!=null&&typeof U=="object"}(T)&&ee(T)=="[object Symbol]"}(g))return NaN;if(a(g)){var p=typeof g.valueOf=="function"?g.valueOf():g;g=a(p)?p+"":p}if(typeof g!="string")return g===0?g:+g;g=Q(g);var E=Te.test(g);return E||Fe.test(g)?$e(g.slice(2),E?2:8):ae.test(g)?NaN:+g};var ne=Math.max,fe=Math.min;const K=function(g,p,E){var T,U,ie,ve,m,f,R=0,M=!1,W=!1,$=!0;if(typeof g!="function")throw new TypeError("Expected a function");function ce(oe){var pe=T,xe=U;return T=U=void 0,R=oe,ve=g.apply(xe,pe)}function le(oe){return R=oe,m=setTimeout(G,p),M?ce(oe):ve}function he(oe){var pe=oe-f;return f===void 0||pe>=p||pe<0||W&&oe-R>=ie}function G(){var oe=k();if(he(oe))return H(oe);m=setTimeout(G,function(pe){var xe=p-(pe-f);return W?fe(xe,ie-(pe-R)):xe}(oe))}function H(oe){return m=void 0,$&&T?ce(oe):(T=U=void 0,ve)}function te(){var oe=k(),pe=he(oe);if(T=arguments,U=this,f=oe,pe){if(m===void 0)return le(f);if(W)return clearTimeout(m),m=setTimeout(G,p),ce(f)}return m===void 0&&(m=setTimeout(G,p)),ve}return p=rt(p)||0,a(E)&&(M=!!E.leading,ie=(W="maxWait"in E)?ne(rt(E.maxWait)||0,p):ie,$="trailing"in E?!!E.trailing:$),te.cancel=function(){m!==void 0&&clearTimeout(m),R=0,T=f=U=m=void 0},te.flush=function(){return m===void 0?ve:H(k())},te},je=function(g,p,E){var T=!0,U=!0;if(typeof g!="function")throw new TypeError("Expected a function");return a(E)&&(T="leading"in E?!!E.leading:T,U="trailing"in E?!!E.trailing:U),K(g,p,{leading:T,maxWait:p,trailing:U})};var se=u(590),pt=u.n(se),Ee=function(){if(typeof Map<"u")return Map;function g(p,E){var T=-1;return p.some(function(U,ie){return U[0]===E&&(T=ie,!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=g(this.__entries__,E),U=this.__entries__[T];return U&&U[1]},p.prototype.set=function(E,T){var U=g(this.__entries__,E);~U?this.__entries__[U][1]=T:this.__entries__.push([E,T])},p.prototype.delete=function(E){var T=this.__entries__,U=g(T,E);~U&&T.splice(U,1)},p.prototype.has=function(E){return!!~g(this.__entries__,E)},p.prototype.clear=function(){this.__entries__.splice(0)},p.prototype.forEach=function(E,T){T===void 0&&(T=null);for(var U=0,ie=this.__entries__;U<ie.length;U++){var ve=ie[U];E.call(T,ve[1],ve[0])}},p}()}(),Je=typeof window<"u"&&typeof document<"u"&&window.document===document,Ke=u.g!==void 0&&u.g.Math===Math?u.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),It=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ke):function(g){return setTimeout(function(){return g(Date.now())},1e3/60)},Jt=["top","right","bottom","left","width","height","size","weight"],$t=typeof MutationObserver<"u",Zt=function(){function g(){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,U=!1,ie=0;function ve(){T&&(T=!1,p()),U&&f()}function m(){It(ve)}function f(){var R=Date.now();if(T){if(R-ie<2)return;U=!0}else T=!0,U=!1,setTimeout(m,20);ie=R}return f}(this.refresh.bind(this))}return g.prototype.addObserver=function(p){~this.observers_.indexOf(p)||this.observers_.push(p),this.connected_||this.connect_()},g.prototype.removeObserver=function(p){var E=this.observers_,T=E.indexOf(p);~T&&E.splice(T,1),!E.length&&this.connected_&&this.disconnect_()},g.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},g.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},g.prototype.connect_=function(){Je&&!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)},g.prototype.disconnect_=function(){Je&&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)},g.prototype.onTransitionEnd_=function(p){var E=p.propertyName,T=E===void 0?"":E;Jt.some(function(U){return!!~T.indexOf(U)})&&this.refresh()},g.getInstance=function(){return this.instance_||(this.instance_=new g),this.instance_},g.instance_=null,g}(),Le=function(g,p){for(var E=0,T=Object.keys(p);E<T.length;E++){var U=T[E];Object.defineProperty(g,U,{value:p[U],enumerable:!1,writable:!1,configurable:!0})}return g},Ne=function(g){return g&&g.ownerDocument&&g.ownerDocument.defaultView||Ke},Ze=Re(0,0,0,0);function ye(g){return parseFloat(g)||0}function bt(g){for(var p=[],E=1;E<arguments.length;E++)p[E-1]=arguments[E];return p.reduce(function(T,U){return T+ye(g["border-"+U+"-width"])},0)}var Ue=typeof SVGGraphicsElement<"u"?function(g){return g instanceof Ne(g).SVGGraphicsElement}:function(g){return g instanceof Ne(g).SVGElement&&typeof g.getBBox=="function"};function Dn(g){return Je?Ue(g)?function(p){var E=p.getBBox();return Re(0,0,E.width,E.height)}(g):function(p){var E=p.clientWidth,T=p.clientHeight;if(!E&&!T)return Ze;var U=Ne(p).getComputedStyle(p),ie=function($){for(var ce={},le=0,he=["top","right","bottom","left"];le<he.length;le++){var G=he[le],H=$["padding-"+G];ce[G]=ye(H)}return ce}(U),ve=ie.left+ie.right,m=ie.top+ie.bottom,f=ye(U.width),R=ye(U.height);if(U.boxSizing==="border-box"&&(Math.round(f+ve)!==E&&(f-=bt(U,"left","right")+ve),Math.round(R+m)!==T&&(R-=bt(U,"top","bottom")+m)),!function($){return $===Ne($).document.documentElement}(p)){var M=Math.round(f+ve)-E,W=Math.round(R+m)-T;Math.abs(M)!==1&&(f-=M),Math.abs(W)!==1&&(R-=W)}return Re(ie.left,ie.top,f,R)}(g):Ze}function Re(g,p,E,T){return{x:g,y:p,width:E,height:T}}var en=function(){function g(p){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Re(0,0,0,0),this.target=p}return g.prototype.isActive=function(){var p=Dn(this.target);return this.contentRect_=p,p.width!==this.broadcastWidth||p.height!==this.broadcastHeight},g.prototype.broadcastRect=function(){var p=this.contentRect_;return this.broadcastWidth=p.width,this.broadcastHeight=p.height,p},g}(),tn=function(g,p){var E,T,U,ie,ve,m,f,R=(T=(E=p).x,U=E.y,ie=E.width,ve=E.height,m=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,f=Object.create(m.prototype),Le(f,{x:T,y:U,width:ie,height:ve,top:U,right:T+ie,bottom:ve+U,left:T}),f);Le(this,{target:g,contentRect:R})},Ut=function(){function g(p,E,T){if(this.activeObservations_=[],this.observations_=new Ee,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 g.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 Ne(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(p)||(E.set(p,new en(p)),this.controller_.addObserver(this),this.controller_.refresh())}},g.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 Ne(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))}},g.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},g.prototype.gatherActive=function(){var p=this;this.clearActive(),this.observations_.forEach(function(E){E.isActive()&&p.activeObservations_.push(E)})},g.prototype.broadcastActive=function(){if(this.hasActive()){var p=this.callbackCtx_,E=this.activeObservations_.map(function(T){return new tn(T.target,T.broadcastRect())});this.callback_.call(p,E,p),this.clearActive()}},g.prototype.clearActive=function(){this.activeObservations_.splice(0)},g.prototype.hasActive=function(){return this.activeObservations_.length>0},g}(),Wt=typeof WeakMap<"u"?new WeakMap:new Ee,Xe=function g(p){if(!(this instanceof g))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=Zt.getInstance(),T=new Ut(p,E,this);Wt.set(this,T)};["observe","unobserve","disconnect"].forEach(function(g){Xe.prototype[g]=function(){var p;return(p=Wt.get(this))[g].apply(p,arguments)}});const nn=Ke.ResizeObserver!==void 0?Ke.ResizeObserver:Xe,St="Left",ft="Right",xt="Up",Pe="Down",it={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},rn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},En="mousemove",Sn="mouseup";function zt(g,p){if(p===0)return g;const E=Math.PI/180*p;return[g[0]*Math.cos(E)+g[1]*Math.sin(E),g[1]*Math.cos(E)-g[0]*Math.sin(E)]}function Ye(g){const{trackMouse:p}=g,E=x.useRef(Object.assign({},rn)),T=x.useRef(Object.assign({},it)),U=x.useRef(Object.assign({},T.current));let ie;for(ie in U.current=Object.assign({},T.current),T.current=Object.assign(Object.assign({},it),g),it)T.current[ie]===void 0&&(T.current[ie]=it[ie]);const[ve,m]=x.useMemo(()=>function(f,R){const M=G=>{const H="touches"in G;H&&G.touches.length>1||f((te,oe)=>{oe.trackMouse&&!H&&(document.addEventListener(En,W),document.addEventListener(Sn,ce));const{clientX:pe,clientY:xe}=H?G.touches[0]:G,Ae=zt([pe,xe],oe.rotationAngle);return oe.onTouchStartOrOnMouseDown&&oe.onTouchStartOrOnMouseDown({event:G}),Object.assign(Object.assign(Object.assign({},te),rn),{initial:Ae.slice(),xy:Ae,start:G.timeStamp||0})})},W=G=>{f((H,te)=>{const oe="touches"in G;if(oe&&G.touches.length>1)return H;if(G.timeStamp-H.start>te.swipeDuration)return H.swiping?Object.assign(Object.assign({},H),{swiping:!1}):H;const{clientX:pe,clientY:xe}=oe?G.touches[0]:G,[Ae,st]=zt([pe,xe],te.rotationAngle),et=Ae-H.xy[0],Ve=st-H.xy[1],_e=Math.abs(et),we=Math.abs(Ve),Gt=(G.timeStamp||0)-H.start,Un=Math.sqrt(_e*_e+we*we)/(Gt||1),Wn=[et/(Gt||1),Ve/(Gt||1)],Dt=function(zn,Cn,qn,ct){return zn>Cn?qn>0?ft:St:ct>0?Pe:xt}(_e,we,et,Ve),pn=typeof te.delta=="number"?te.delta:te.delta[Dt.toLowerCase()]||it.delta;if(_e<pn&&we<pn&&!H.swiping)return H;const Ot={absX:_e,absY:we,deltaX:et,deltaY:Ve,dir:Dt,event:G,first:H.first,initial:H.initial,velocity:Un,vxvy:Wn};Ot.first&&te.onSwipeStart&&te.onSwipeStart(Ot),te.onSwiping&&te.onSwiping(Ot);let Rn=!1;return(te.onSwiping||te.onSwiped||te[`onSwiped${Dt}`])&&(Rn=!0),Rn&&te.preventScrollOnSwipe&&te.trackTouch&&G.cancelable&&G.preventDefault(),Object.assign(Object.assign({},H),{first:!1,eventData:Ot,swiping:!0})})},$=G=>{f((H,te)=>{let oe;if(H.swiping&&H.eventData){if(G.timeStamp-H.start<te.swipeDuration){oe=Object.assign(Object.assign({},H.eventData),{event:G}),te.onSwiped&&te.onSwiped(oe);const pe=te[`onSwiped${oe.dir}`];pe&&pe(oe)}}else te.onTap&&te.onTap({event:G});return te.onTouchEndOrOnMouseUp&&te.onTouchEndOrOnMouseUp({event:G}),Object.assign(Object.assign(Object.assign({},H),rn),{eventData:oe})})},ce=G=>{document.removeEventListener(En,W),document.removeEventListener(Sn,ce),$(G)},le=(G,H)=>{let te=()=>{};if(G&&G.addEventListener){const oe=Object.assign(Object.assign({},it.touchEventOptions),H.touchEventOptions),pe=[["touchstart",M,oe],["touchmove",W,Object.assign(Object.assign({},oe),H.preventScrollOnSwipe?{passive:!1}:{})],["touchend",$,oe]];pe.forEach(([xe,Ae,st])=>G.addEventListener(xe,Ae,st)),te=()=>pe.forEach(([xe,Ae])=>G.removeEventListener(xe,Ae))}return te},he={ref:G=>{G!==null&&f((H,te)=>{if(H.el===G)return H;const oe={};return H.el&&H.el!==G&&H.cleanUpTouch&&(H.cleanUpTouch(),oe.cleanUpTouch=void 0),te.trackTouch&&G&&(oe.cleanUpTouch=le(G,te)),Object.assign(Object.assign(Object.assign({},H),{el:G}),oe)})}};return R.trackMouse&&(he.onMouseDown=M),[he,le]}(f=>E.current=f(E.current,T.current),{trackMouse:p}),[p]);return E.current=function(f,R,M,W){return R.trackTouch&&f.el?f.cleanUpTouch?R.preventScrollOnSwipe!==M.preventScrollOnSwipe||R.touchEventOptions.passive!==M.touchEventOptions.passive?(f.cleanUpTouch(),Object.assign(Object.assign({},f),{cleanUpTouch:W(f.el,R)})):f:Object.assign(Object.assign({},f),{cleanUpTouch:W(f.el,R)}):(f.cleanUpTouch&&f.cleanUpTouch(),Object.assign(Object.assign({},f),{cleanUpTouch:void 0}))}(E.current,T.current,U.current,m),ve}var I=u(697);function Tt(g){return Tt=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},Tt(g)}function on(g,p){var E=Object.keys(g);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(g);p&&(T=T.filter(function(U){return Object.getOwnPropertyDescriptor(g,U).enumerable})),E.push.apply(E,T)}return E}function sn(g){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?on(Object(E),!0).forEach(function(T){l(g,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(E)):on(Object(E)).forEach(function(T){Object.defineProperty(g,T,Object.getOwnPropertyDescriptor(E,T))})}return g}function l(g,p,E){return(p=function(T){var U=function(ie,ve){if(Tt(ie)!=="object"||ie===null)return ie;var m=ie[Symbol.toPrimitive];if(m!==void 0){var f=m.call(ie,ve);if(Tt(f)!=="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ie)}(T,"string");return Tt(U)==="symbol"?U:String(U)}(p))in g?Object.defineProperty(g,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):g[p]=E,g}var y={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},w=s().memo(function(g){var p=sn(sn({},y),g),E=p.description,T=p.fullscreen,U=p.handleImageLoaded,ie=p.isFullscreen,ve=p.onImageError,m=p.original,f=p.originalAlt,R=p.originalHeight,M=p.originalWidth,W=p.originalTitle,$=p.sizes,ce=p.srcSet,le=p.loading,he=ie&&T||m;return s().createElement(s().Fragment,null,s().createElement("img",{className:"image-gallery-image",src:he,alt:f,srcSet:ce,height:R,width:M,sizes:$,title:W,onLoad:function(G){return U(G,m)},onError:ve,loading:le}),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 N(g){return N=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},N(g)}function V(g,p){var E=Object.keys(g);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(g);p&&(T=T.filter(function(U){return Object.getOwnPropertyDescriptor(g,U).enumerable})),E.push.apply(E,T)}return E}function X(g){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?V(Object(E),!0).forEach(function(T){A(g,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(E)):V(Object(E)).forEach(function(T){Object.defineProperty(g,T,Object.getOwnPropertyDescriptor(E,T))})}return g}function A(g,p,E){return(p=function(T){var U=function(ie,ve){if(N(ie)!=="object"||ie===null)return ie;var m=ie[Symbol.toPrimitive];if(m!==void 0){var f=m.call(ie,ve);if(N(f)!=="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ie)}(T,"string");return N(U)==="symbol"?U:String(U)}(p))in g?Object.defineProperty(g,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):g[p]=E,g}var F={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"}))},de={strokeWidth:1,viewBox:"0 0 24 24"},me=function(g){var p=X(X({},de),g),E=p.strokeWidth,T=p.viewBox,U=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"},F[U])};me.propTypes={strokeWidth:I.number,viewBox:I.string,icon:(0,I.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const ke=me;var Ce=s().memo(function(g){var p=g.isFullscreen,E=g.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:E,"aria-label":"Open Fullscreen"},s().createElement(ke,{strokeWidth:2,icon:p?"minimize":"maximize"}))});Ce.displayName="Fullscreen",Ce.propTypes={isFullscreen:I.bool.isRequired,onClick:I.func.isRequired};const We=Ce;var lt=s().memo(function(g){var p=g.disabled,E=g.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(ke,{icon:"left",viewBox:"6 0 12 24"}))});lt.displayName="LeftNav",lt.propTypes={disabled:I.bool.isRequired,onClick:I.func.isRequired};const jt=lt;var Pt=s().memo(function(g){var p=g.disabled,E=g.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(ke,{icon:"right",viewBox:"6 0 12 24"}))});Pt.displayName="RightNav",Pt.propTypes={disabled:I.bool.isRequired,onClick:I.func.isRequired};const an=Pt;var ln=s().memo(function(g){var p=g.isPlaying,E=g.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(ke,{strokeWidth:2,icon:p?"pause":"play"}))});ln.displayName="PlayPause",ln.propTypes={isPlaying:I.bool.isRequired,onClick:I.func.isRequired};const cn=ln;function ze(g){return ze=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},ze(g)}function qt(){return qt=Object.assign?Object.assign.bind():function(g){for(var p=1;p<arguments.length;p++){var E=arguments[p];for(var T in E)Object.prototype.hasOwnProperty.call(E,T)&&(g[T]=E[T])}return g},qt.apply(this,arguments)}function _t(g,p){var E=Object.keys(g);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(g);p&&(T=T.filter(function(U){return Object.getOwnPropertyDescriptor(g,U).enumerable})),E.push.apply(E,T)}return E}function Lt(g){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?_t(Object(E),!0).forEach(function(T){mt(g,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(E)):_t(Object(E)).forEach(function(T){Object.defineProperty(g,T,Object.getOwnPropertyDescriptor(E,T))})}return g}function mt(g,p,E){return(p=function(T){var U=function(ie,ve){if(ze(ie)!=="object"||ie===null)return ie;var m=ie[Symbol.toPrimitive];if(m!==void 0){var f=m.call(ie,ve);if(ze(f)!=="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ie)}(T,"string");return ze(U)==="symbol"?U:String(U)}(p))in g?Object.defineProperty(g,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):g[p]=E,g}var Kt={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},Tn=function(g){var p=Lt(Lt({},Kt),g),E=p.children,T=p.className,U=Ye({delta:p.delta,onSwiping:p.onSwiping,onSwiped:p.onSwiped});return s().createElement("div",qt({},U,{className:T}),E)};Tn.propTypes={children:I.node.isRequired,className:I.string,delta:I.number,onSwiped:I.func,onSwiping:I.func};const un=Tn;function Nt(g){return Nt=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},Nt(g)}function Mn(g,p){var E=Object.keys(g);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(g);p&&(T=T.filter(function(U){return Object.getOwnPropertyDescriptor(g,U).enumerable})),E.push.apply(E,T)}return E}function Fn(g){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Mn(Object(E),!0).forEach(function(T){On(g,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(E)):Mn(Object(E)).forEach(function(T){Object.defineProperty(g,T,Object.getOwnPropertyDescriptor(E,T))})}return g}function ot(g,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(g,Bn(T.key),T)}}function dn(g,p){return dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,T){return E.__proto__=T,E},dn(g,p)}function jn(g,p){if(p&&(Nt(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oe(g)}function Oe(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function Vt(g){return Vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(p){return p.__proto__||Object.getPrototypeOf(p)},Vt(g)}function On(g,p,E){return(p=Bn(p))in g?Object.defineProperty(g,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):g[p]=E,g}function Bn(g){var p=function(E,T){if(Nt(E)!=="object"||E===null)return E;var U=E[Symbol.toPrimitive];if(U!==void 0){var ie=U.call(E,T);if(Nt(ie)!=="object")return ie;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}(g,"string");return Nt(p)==="symbol"?p:String(p)}var At=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],kn=(0,I.arrayOf)((0,I.shape)({srcSet:I.string,media:I.string}));function hn(g){var p=parseInt(g.keyCode||g.which||0,10);return p===66||p===62}var $n=function(g){(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&&dn(m,f)})(ve,g);var p,E,T,U,ie=(T=ve,U=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=Vt(T);if(U){var R=Vt(this).constructor;m=Reflect.construct(f,arguments,R)}else m=f.apply(this,arguments);return jn(this,m)});function ve(m){var f;return function(R,M){if(!(R instanceof M))throw new TypeError("Cannot call a class as a function")}(this,ve),On(Oe(f=ie.call(this,m)),"onBulletClick",function(R,M){var W=f.props,$=W.onBulletClick,ce=W.items,le=f.state.currentIndex;R.target.blur(),le!==M&&(ce.length===2?f.slideToIndexWithStyleReset(M,R):f.slideToIndex(M,R)),$&&$(R,M)}),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(Oe(f)),f.handleKeyDown=f.handleKeyDown.bind(Oe(f)),f.handleMouseDown=f.handleMouseDown.bind(Oe(f)),f.handleResize=f.handleResize.bind(Oe(f)),f.handleTouchMove=f.handleTouchMove.bind(Oe(f)),f.handleOnSwiped=f.handleOnSwiped.bind(Oe(f)),f.handleScreenChange=f.handleScreenChange.bind(Oe(f)),f.handleSwiping=f.handleSwiping.bind(Oe(f)),f.handleThumbnailSwiping=f.handleThumbnailSwiping.bind(Oe(f)),f.handleOnThumbnailSwiped=f.handleOnThumbnailSwiped.bind(Oe(f)),f.onThumbnailMouseLeave=f.onThumbnailMouseLeave.bind(Oe(f)),f.handleImageError=f.handleImageError.bind(Oe(f)),f.pauseOrPlay=f.pauseOrPlay.bind(Oe(f)),f.renderThumbInner=f.renderThumbInner.bind(Oe(f)),f.renderItem=f.renderItem.bind(Oe(f)),f.slideLeft=f.slideLeft.bind(Oe(f)),f.slideRight=f.slideRight.bind(Oe(f)),f.toggleFullScreen=f.toggleFullScreen.bind(Oe(f)),f.togglePlay=f.togglePlay.bind(Oe(f)),f.unthrottledSlideToIndex=f.slideToIndex,f.slideToIndex=je(f.unthrottledSlideToIndex,m.slideDuration,{trailing:!1}),m.lazyLoad&&(f.lazyLoaded=[]),f}return p=ve,E=[{key:"componentDidMount",value:function(){var m=this.props,f=m.autoPlay,R=m.useWindowKeyDown;f&&this.play(),R?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 R=this.props,M=R.items,W=R.lazyLoad,$=R.slideDuration,ce=R.slideInterval,le=R.startIndex,he=R.thumbnailPosition,G=R.showThumbnails,H=R.useWindowKeyDown,te=this.state,oe=te.currentIndex,pe=te.isPlaying,xe=m.items.length!==M.length,Ae=!pt()(m.items,M),st=m.startIndex!==le,et=m.thumbnailPosition!==he,Ve=m.showThumbnails!==G;ce===m.slideInterval&&$===m.slideDuration||pe&&(this.pause(),this.play()),et&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),Ve&&G&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),Ve&&!G&&this.removeThumbnailsResizeObserver(),(xe||Ve)&&this.handleResize(),f.currentIndex!==oe&&this.slideThumbnailBar(),m.slideDuration!==$&&(this.slideToIndex=je(this.unthrottledSlideToIndex,$,{trailing:!1})),!W||m.lazyLoad&&!Ae||(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))),(st||Ae)&&this.setState({currentIndex:le,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,R=f.currentIndex,M=f.isTransitioning,W=this.props,$=W.onSlide,ce=W.slideDuration;this.transitionTimer=window.setTimeout(function(){M&&(m.setState({isTransitioning:!M,isSwipingThumbnail:!1}),$&&$(R))},ce+50)}},{key:"onThumbnailClick",value:function(m,f){var R=this.props,M=R.onThumbnailClick,W=R.items,$=this.state.currentIndex;m.target.parentNode.parentNode.blur(),$!==f&&(W.length===2?this.slideToIndexWithStyleReset(f,m):this.slideToIndex(f,m)),M&&M(m,f)}},{key:"onThumbnailMouseOver",value:function(m,f){var R=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){R.slideToIndex(f),R.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,R=this.props,M=R.disableThumbnailScroll,W=R.items,$=this.state,ce=$.thumbnailsWrapperWidth,le=$.thumbnailsWrapperHeight,he=this.thumbnails&&this.thumbnails.current;if(M)return 0;if(he){if(this.isThumbnailVertical()){if(he.scrollHeight<=le)return 0;f=he.scrollHeight-le}else{if(he.scrollWidth<=ce||ce<=0)return 0;f=he.scrollWidth-ce}return m*(f/(W.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,R=this.props,M=R.infinite,W=R.items,$="",ce="image-gallery-left",le="image-gallery-right";switch(m){case f-1:$=" ".concat(ce);break;case f:$=" ".concat("image-gallery-center");break;case f+1:$=" ".concat(le)}return W.length>=3&&M&&(m===0&&f===W.length-1?$=" ".concat(le):m===W.length-1&&f===0&&($=" ".concat(ce))),$}},{key:"getTranslateXForTwoSlide",value:function(m){var f=this.state,R=f.currentIndex,M=f.currentSlideOffset,W=f.previousIndex,$=R!==W,ce=m===0&&W===0,le=m===1&&W===1,he=m===0&&R===1,G=m===1&&R===0,H=M===0,te=-100*R+100*m+M;return M>0?this.direction="left":M<0&&(this.direction="right"),G&&M>0&&(te=-100+M),he&&M<0&&(te=100+M),$?ce&&H&&this.direction==="left"?te=100:le&&H&&this.direction==="right"&&(te=-100):(G&&H&&this.direction==="left"&&(te=-100),he&&H&&this.direction==="right"&&(te=100)),te}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(m){var f=this.state,R=f.currentIndex,M=f.currentSlideOffset,W=f.slideStyle,$=this.props,ce=$.infinite,le=$.items,he=$.useTranslate3D,G=$.isRTL,H=-100*R,te=le.length-1,oe=(H+100*m)*(G?-1:1)+M;ce&&le.length>2&&(R===0&&m===te?oe=-100*(G?-1:1)+M:R===te&&m===0&&(oe=100*(G?-1:1)+M)),ce&&le.length===2&&(oe=this.getTranslateXForTwoSlide(m));var pe="translate(".concat(oe,"%, 0)");return he&&(pe="translate3d(".concat(oe,"%, 0, 0)")),Fn({display:this.isSlideVisible(m)?"inherit":"none",WebkitTransform:pe,MozTransform:pe,msTransform:pe,OTransform:pe,transform:pe},W)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var m,f=this.props,R=f.useTranslate3D,M=f.isRTL,W=this.state,$=W.thumbsTranslate,ce=W.thumbsStyle,le=M?-1*$:$;return this.isThumbnailVertical()?(m="translate(0, ".concat($,"px)"),R&&(m="translate3d(0, ".concat($,"px, 0)"))):(m="translate(".concat(le,"px, 0)"),R&&(m="translate3d(".concat(le,"px, 0, 0)"))),Fn({WebkitTransform:m,MozTransform:m,msTransform:m,OTransform:m,transform:m},ce)}},{key:"getSlideItems",value:function(){var m=this,f=this.state.currentIndex,R=this.props,M=R.items,W=R.slideOnThumbnailOver,$=R.onClick,ce=R.lazyLoad,le=R.onTouchMove,he=R.onTouchEnd,G=R.onTouchStart,H=R.onMouseOver,te=R.onMouseLeave,oe=R.renderItem,pe=R.renderThumbInner,xe=R.showThumbnails,Ae=R.showBullets,st=[],et=[],Ve=[];return M.forEach(function(_e,we){var Gt=m.getAlignmentClassName(we),Un=_e.originalClass?" ".concat(_e.originalClass):"",Wn=_e.thumbnailClass?" ".concat(_e.thumbnailClass):"",Dt=_e.renderItem||oe||m.renderItem,pn=_e.renderThumbInner||pe||m.renderThumbInner,Ot=!ce||Gt||m.lazyLoaded[we];Ot&&ce&&!m.lazyLoaded[we]&&(m.lazyLoaded[we]=!0);var Rn=m.getSlideStyle(we),zn=s().createElement("div",{"aria-label":"Go to Slide ".concat(we+1),key:"slide-".concat(we),tabIndex:"-1",className:"image-gallery-slide ".concat(Gt," ").concat(Un),style:Rn,onClick:$,onKeyUp:m.handleSlideKeyUp,onTouchMove:le,onTouchEnd:he,onTouchStart:G,onMouseOver:H,onFocus:H,onMouseLeave:te,role:"button"},Ot?Dt(_e):s().createElement("div",{style:{height:"100%"}}));if(st.push(zn),xe&&_e.thumbnail){var Cn=b("image-gallery-thumbnail",Wn,{active:f===we});et.push(s().createElement("button",{key:"thumbnail-".concat(we),type:"button",tabIndex:"0","aria-pressed":f===we?"true":"false","aria-label":"Go to Slide ".concat(we+1),className:Cn,onMouseLeave:W?m.onThumbnailMouseLeave:null,onMouseOver:function(ct){return m.handleThumbnailMouseOver(ct,we)},onFocus:function(ct){return m.handleThumbnailMouseOver(ct,we)},onKeyUp:function(ct){return m.handleThumbnailKeyUp(ct,we)},onClick:function(ct){return m.onThumbnailClick(ct,we)}},pn(_e)))}if(Ae){var qn=b("image-gallery-bullet",_e.bulletClass,{active:f===we});Ve.push(s().createElement("button",{type:"button",key:"bullet-".concat(we),className:qn,onClick:function(ct){return m.onBulletClick(ct,we)},"aria-pressed":f===we?"true":"false","aria-label":"Go to Slide ".concat(we+1)}))}}),{slides:st,thumbnails:et,bullets:Ve}}},{key:"ignoreIsTransitioning",value:function(){var m=this.props.items,f=this.state,R=f.previousIndex,M=f.currentIndex,W=m.length-1;return Math.abs(R-M)>1&&!(R===0&&M===W)&&!(R===W&&M===0)}},{key:"isFirstOrLastSlide",value:function(m){return m===this.props.items.length-1||m===0}},{key:"slideIsTransitioning",value:function(m){var f=this.state,R=f.isTransitioning,M=f.previousIndex,W=f.currentIndex;return R&&!(m===M||m===W)}},{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,R=m.isSwipingThumbnail,M=-this.getThumbsTranslate(f);R||(f===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:M,thumbsSwipedTranslate:M}))}},{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,R=m.absX,M=m.dir,W=this.props,$=W.disableSwipe,ce=W.stopPropagation,le=this.state,he=le.galleryWidth,G=le.isTransitioning,H=le.swipingUpDown,te=le.swipingLeftRight;if(M!==xt&&M!==Pe&&!H||te){if(M!==St&&M!==ft||te||this.setState({swipingLeftRight:!0}),!$){var oe=this.props.swipingTransitionDuration;if(ce&&f.preventDefault(),G)this.setState({currentSlideOffset:0});else{var pe=M===ft?1:-1,xe=R/he*100;Math.abs(xe)>=100&&(xe=100);var Ae={transition:"transform ".concat(oe,"ms ease-out")};this.setState({currentSlideOffset:pe*xe,slideStyle:Ae})}}}else H||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(m){var f=m.event,R=m.absX,M=m.absY,W=m.dir,$=this.props,ce=$.stopPropagation,le=$.swipingThumbnailTransitionDuration,he=this.state,G=he.thumbsSwipedTranslate,H=he.thumbnailsWrapperHeight,te=he.thumbnailsWrapperWidth,oe=he.swipingUpDown,pe=he.swipingLeftRight;if(this.isThumbnailVertical()){if((W===St||W===ft||pe)&&!oe)return void(pe||this.setState({swipingLeftRight:!0}));W!==xt&&W!==Pe||oe||this.setState({swipingUpDown:!0})}else{if((W===xt||W===Pe||oe)&&!pe)return void(oe||this.setState({swipingUpDown:!0}));W!==St&&W!==ft||pe||this.setState({swipingLeftRight:!0})}var xe,Ae,st,et,Ve,_e=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(xe=G+(W===Pe?M:-M),Ae=_e.scrollHeight-H+20,st=Math.abs(xe)>Ae,et=xe>20,Ve=_e.scrollHeight<=H):(xe=G+(W===ft?R:-R),Ae=_e.scrollWidth-te+20,st=Math.abs(xe)>Ae,et=xe>20,Ve=_e.scrollWidth<=te),!Ve&&(W!==St&&W!==xt||!st)&&(W!==ft&&W!==Pe||!et)){ce&&f.stopPropagation();var we={transition:"transform ".concat(le,"ms ease-out")};this.setState({thumbsTranslate:xe,thumbsStyle:we})}}},{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,R=m.swipingLeftRight;f&&this.setState({swipingUpDown:!1}),R&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(m){var f=m.event,R=m.dir,M=m.velocity,W=this.props,$=W.disableSwipe,ce=W.stopPropagation,le=W.flickThreshold;if(!$){var he=this.props.isRTL;ce&&f.stopPropagation(),this.resetSwipingDirection();var G=(R===St?1:-1)*(he?-1:1),H=M>le&&!(R===xt||R===Pe);this.handleOnSwipedTo(G,H)}}},{key:"handleOnSwipedTo",value:function(m,f){var R=this.state,M=R.currentIndex,W=R.isTransitioning,$=M;!this.sufficientSwipe()&&!f||W||($+=m),(m===-1&&!this.canSlideLeft()||m===1&&!this.canSlideRight())&&($=M),this.unthrottledSlideToIndex($)}},{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,R=f.disableKeyDown,M=f.useBrowserFullscreen,W=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!R)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:W&&!M&&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 nn(K(function(R){R&&R.forEach(function(M){f.setState({thumbnailsWrapperWidth:M.contentRect.width},f.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(m.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(m){var f=this;m&&!m.current||(this.resizeThumbnailWrapperObserver=new nn(K(function(R){R&&R.forEach(function(M){f.setState({thumbnailsWrapperHeight:M.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,R=m.useBrowserFullscreen,M=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,W=this.imageGallery.current===M;f&&f(W),R&&this.setState({isFullscreen:W})}},{key:"slideToIndex",value:function(m,f){var R=this.state,M=R.currentIndex,W=R.isTransitioning,$=this.props,ce=$.items,le=$.slideDuration,he=$.onBeforeSlide;if(!W){f&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var G=ce.length-1,H=m;m<0?H=G:m>G&&(H=0),he&&H!==M&&he(H),this.setState({previousIndex:M,currentIndex:H,isTransitioning:H!==M,currentSlideOffset:0,slideStyle:{transition:"all ".concat(le,"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 R=this.state,M=R.currentIndex,W=R.isTransitioning,$=this.props.items,ce=M+(f==="left"?-1:1);W||($.length===2?this.slideToIndexWithStyleReset(ce,m):this.slideToIndex(ce,m))}},{key:"slideToIndexWithStyleReset",value:function(m,f){var R=this,M=this.state,W=M.currentIndex,$=M.currentSlideOffset;this.setState({currentSlideOffset:$+(W>m?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return R.slideToIndex(m,f)},25)})}},{key:"handleThumbnailMouseOver",value:function(m,f){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(m,f)}},{key:"handleThumbnailKeyUp",value:function(m,f){hn(m)&&this.onThumbnailClick(m,f)}},{key:"handleSlideKeyUp",value:function(m){hn(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;At.forEach(function(f){document.addEventListener(f,m.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var m=this;At.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,R=f.onPlay,M=f.slideInterval,W=f.slideDuration,$=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(M,W)),R&&m&&R($))}},{key:"pause",value:function(){var m=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],f=this.props.onPause,R=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),f&&m&&f(R))}},{key:"isImageLoaded",value:function(m){return!!this.loadedImages[m.original]||(this.loadedImages[m.original]=!0,!1)}},{key:"handleImageLoaded",value:function(m,f){var R=this.props.onImageLoad;!this.loadedImages[f]&&R&&(this.loadedImages[f]=!0,R(m))}},{key:"renderItem",value:function(m){var f=this.state.isFullscreen,R=this.props.onImageError||this.handleImageError;return s().createElement(C,{description:m.description,fullscreen:m.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:f,onImageError:R,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,R=m.isFullscreen,M=m.modalFullscreen,W=m.isPlaying,$=this.props,ce=$.additionalClass,le=$.disableThumbnailSwipe,he=$.indexSeparator,G=$.isRTL,H=$.items,te=$.thumbnailPosition,oe=$.renderFullscreenButton,pe=$.renderCustomControls,xe=$.renderLeftNav,Ae=$.renderRightNav,st=$.showBullets,et=$.showFullscreenButton,Ve=$.showIndex,_e=$.showThumbnails,we=$.showNav,Gt=$.showPlayButton,Un=$.renderPlayPauseButton,Wn=this.getThumbnailStyle(),Dt=this.getSlideItems(),pn=Dt.slides,Ot=Dt.thumbnails,Rn=Dt.bullets,zn=b("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(te),{"image-gallery-rtl":G}),Cn=s().createElement("div",{ref:this.imageGallerySlideWrapper,className:zn},pe&&pe(),this.canSlide()?s().createElement(s().Fragment,null,we&&s().createElement(s().Fragment,null,xe(this.slideLeft,!this.canSlideLeft()),Ae(this.slideRight,!this.canSlideRight())),s().createElement(un,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},s().createElement("div",{className:"image-gallery-slides"},pn))):s().createElement("div",{className:"image-gallery-slides"},pn),Gt&&Un(this.togglePlay,W),st&&s().createElement("div",{className:"image-gallery-bullets"},s().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},Rn)),et&&oe(this.toggleFullScreen,R),Ve&&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))),qn=b("image-gallery",ce,{"fullscreen-modal":M}),ct=b("image-gallery-content",this.getThumbnailPositionClassName(te),{fullscreen:R}),Ca=b("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(te),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&G},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!le},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!le});return s().createElement("div",{ref:this.imageGallery,className:qn,"aria-live":"polite"},s().createElement("div",{className:ct},(te==="bottom"||te==="right")&&Cn,_e&&Ot.length>0?s().createElement(un,{className:Ca,delta:0,onSwiping:!le&&this.handleThumbnailSwiping,onSwiped:!le&&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:Wn,"aria-label":"Thumbnail Navigation"},Ot))):null,(te==="top"||te==="left")&&Cn))}}],E&&ot(p.prototype,E),Object.defineProperty(p,"prototype",{writable:!1}),ve}(s().Component);$n.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:kn,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},$n.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(g,p){return s().createElement(jt,{onClick:g,disabled:p})},renderRightNav:function(g,p){return s().createElement(an,{onClick:g,disabled:p})},renderPlayPauseButton:function(g,p){return s().createElement(cn,{onClick:g,isPlaying:p})},renderFullscreenButton:function(g,p){return s().createElement(We,{onClick:g,isFullscreen:p})},useWindowKeyDown:!0};const Ra=$n})(),d})())})(ca);var ih=ca.exports;const oh=ri(ih);function sh(){var e=new Map;function t(n){var r=n.root,o=n.rootMargin,u=n.threshold,d=e.get(r);d||(d=new Map,e.set(r,d));var h=JSON.stringify({rootMargin:o,threshold:u}),b=d.get(h);if(!b){var x=new Map,s=new IntersectionObserver(function(a){a.forEach(function(O){var v=x.get(O.target);v==null||v(O)})},{root:r,rootMargin:o,threshold:u});b={observer:s,entryCallbacks:x},d.set(h,b)}return{observe:function(O,v){var S,k;(S=b)==null||S.entryCallbacks.set(O,v),(k=b)==null||k.observer.observe(O)},unobserve:function(O){var v,S;(v=b)==null||v.entryCallbacks.delete(O),(S=b)==null||S.observer.unobserve(O)}}}return{getObserver:t}}var ah="0px",lh=[0],ch=sh();function uh(e){var t,n,r=(t=e==null?void 0:e.rootMargin)!=null?t:ah,o=(n=e==null?void 0:e.threshold)!=null?n:lh,u=L.useRef(null),d=L.useRef(null),h=L.useRef(null),b=L.useState(),x=b[0],s=b[1],a=L.useCallback(function(){var k=u.current;if(!k){s(void 0);return}var _=ch.getObserver({root:d.current,rootMargin:r,threshold:o});_.observe(k,function(D){s(D)}),h.current=_},[r,o]),O=L.useCallback(function(){var k=h.current,_=u.current;_&&(k==null||k.unobserve(_)),h.current=null},[]),v=L.useCallback(function(k){O(),u.current=k,a()},[a,O]),S=L.useCallback(function(k){O(),d.current=k,a()},[a,O]);return[v,{entry:x,rootRef:S}]}function Yr(){return Yr=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},Yr.apply(this,arguments)}function dh(e){var t,n=uh(e),r=n[0],o=n[1],u=!!((t=o.entry)!=null&&t.isIntersecting),d=L.useState(u),h=d[0],b=d[1];return u&&!h&&b(!0),[r,Yr({},o,{isVisible:u,wasEverVisible:h})]}var hh=100;function ph(e){var t=e.loading,n=e.hasNextPage,r=e.onLoadMore,o=e.rootMargin,u=e.disabled,d=e.delayInMs,h=d===void 0?hh:d,b=dh({rootMargin:o}),x=b[0],s=b[1],a=s.rootRef,O=s.isVisible,v=!u&&!t&&O&&n;return L.useEffect(function(){if(v){var S=setTimeout(function(){r()},h);return function(){clearTimeout(S)}}},[r,v,h]),[x,{rootRef:a}]}const fh={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"/>'},mh={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 _r=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Lr(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function ua(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 da(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 gh(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,o=!0,u=0;u<n.length;u++)r.indexOf(n[u])===-1&&(o=!1);return o}var Wi={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,"-":_r?173:189,"=":_r?61:187,";":_r?59:186,"'":222,"[":219,"]":221,"\\":220},Yt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Qr={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Ge={16:!1,18:!1,17:!1,91:!1},Me={};for(var sr=1;sr<20;sr++)Wi["f".concat(sr)]=111+sr;var Ie=[],Po=!1,ha="all",pa=[],Tr=function(t){return Wi[t.toLowerCase()]||Yt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function fa(e){ha=e||"all"}function er(){return ha||"all"}function vh(){return Ie.slice(0)}function yh(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 bh(e){return typeof e=="string"&&(e=Tr(e)),Ie.indexOf(e)!==-1}function xh(e,t){var n,r;e||(e=er());for(var o in Me)if(Object.prototype.hasOwnProperty.call(Me,o))for(n=Me[o],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;er()===e&&fa(t||"all")}function wh(e){var t=e.keyCode||e.which||e.charCode,n=Ie.indexOf(t);if(n>=0&&Ie.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&Ie.splice(0,Ie.length),(t===93||t===224)&&(t=91),t in Ge){Ge[t]=!1;for(var r in Yt)Yt[r]===t&&(ht[r]=!1)}}function Eh(e){if(typeof e>"u")Object.keys(Me).forEach(function(d){return delete Me[d]});else if(Array.isArray(e))e.forEach(function(d){d.key&&Nr(d)});else if(typeof e=="object")e.key&&Nr(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],u=n[1];typeof o=="function"&&(u=o,o=""),Nr({key:e,scope:o,method:u,splitKey:"+"})}}var Nr=function(t){var n=t.key,r=t.scope,o=t.method,u=t.splitKey,d=u===void 0?"+":u,h=da(n);h.forEach(function(b){var x=b.split(d),s=x.length,a=x[s-1],O=a==="*"?"*":Tr(a);if(Me[O]){r||(r=er());var v=s>1?ua(Yt,x):[];Me[O]=Me[O].filter(function(S){var k=o?S.method===o:!0;return!(k&&S.scope===r&&gh(S.mods,v))})}})};function _o(e,t,n,r){if(t.element===r){var o;if(t.scope===n||t.scope==="all"){o=t.mods.length>0;for(var u in Ge)Object.prototype.hasOwnProperty.call(Ge,u)&&(!Ge[u]&&t.mods.indexOf(+u)>-1||Ge[u]&&t.mods.indexOf(+u)===-1)&&(o=!1);(t.mods.length===0&&!Ge[16]&&!Ge[18]&&!Ge[17]&&!Ge[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 Lo(e,t){var n=Me["*"],r=e.keyCode||e.which||e.charCode;if(ht.filter.call(this,e)){if((r===93||r===224)&&(r=91),Ie.indexOf(r)===-1&&r!==229&&Ie.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(S){var k=Qr[S];e[S]&&Ie.indexOf(k)===-1?Ie.push(k):!e[S]&&Ie.indexOf(k)>-1?Ie.splice(Ie.indexOf(k),1):S==="metaKey"&&e[S]&&Ie.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Ie=Ie.slice(Ie.indexOf(k))))}),r in Ge){Ge[r]=!0;for(var o in Yt)Yt[o]===r&&(ht[o]=!0);if(!n)return}for(var u in Ge)Object.prototype.hasOwnProperty.call(Ge,u)&&(Ge[u]=e[Qr[u]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Ie.indexOf(17)===-1&&Ie.push(17),Ie.indexOf(18)===-1&&Ie.push(18),Ge[17]=!0,Ge[18]=!0);var d=er();if(n)for(var h=0;h<n.length;h++)n[h].scope===d&&(e.type==="keydown"&&n[h].keydown||e.type==="keyup"&&n[h].keyup)&&_o(e,n[h],d,t);if(r in Me){for(var b=0;b<Me[r].length;b++)if((e.type==="keydown"&&Me[r][b].keydown||e.type==="keyup"&&Me[r][b].keyup)&&Me[r][b].key){for(var x=Me[r][b],s=x.splitKey,a=x.key.split(s),O=[],v=0;v<a.length;v++)O.push(Tr(a[v]));O.sort().join("")===Ie.sort().join("")&&_o(e,x,d,t)}}}}function Sh(e){return pa.indexOf(e)>-1}function ht(e,t,n){Ie=[];var r=da(e),o=[],u="all",d=document,h=0,b=!1,x=!0,s="+",a=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(u=t.scope),t.element&&(d=t.element),t.keyup&&(b=t.keyup),t.keydown!==void 0&&(x=t.keydown),t.capture!==void 0&&(a=t.capture),typeof t.splitKey=="string"&&(s=t.splitKey)),typeof t=="string"&&(u=t);h<r.length;h++)e=r[h].split(s),o=[],e.length>1&&(o=ua(Yt,e)),e=e[e.length-1],e=e==="*"?"*":Tr(e),e in Me||(Me[e]=[]),Me[e].push({keyup:b,keydown:x,scope:u,mods:o,shortcut:r[h],method:n,key:r[h],splitKey:s,element:d});typeof d<"u"&&!Sh(d)&&window&&(pa.push(d),Lr(d,"keydown",function(O){Lo(O,d)},a),Po||(Po=!0,Lr(window,"focus",function(){Ie=[]},a)),Lr(d,"keyup",function(O){Lo(O,d),wh(O)},a))}function Th(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(Me).forEach(function(n){var r=Me[n].find(function(o){return o.scope===t&&o.shortcut===e});r&&r.method&&r.method()})}var Ar={setScope:fa,getScope:er,deleteScope:xh,getPressedKeyCodes:vh,isPressed:bh,filter:yh,trigger:Th,unbind:Eh,keyMap:Wi,modifier:Yt,modifierMap:Qr};for(var Dr in Ar)Object.prototype.hasOwnProperty.call(Ar,Dr)&&(ht[Dr]=Ar[Dr]);if(typeof window<"u"){var jh=window.hotkeys;ht.noConflict=function(e){return e&&window.hotkeys===ht&&(window.hotkeys=jh),ht},window.hotkeys=ht}ht.filter=function(){return!0};var ma=function(t,n){var r=t.target,o=r&&r.tagName;return!!(o&&n&&n.includes(o))},Oh=function(t){return ma(t,["INPUT","TEXTAREA","SELECT"])};function kh(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var o=n||{},u=o.enableOnTags,d=o.filter,h=o.keyup,b=o.keydown,x=o.filterPreventDefault,s=x===void 0?!0:x,a=o.enabled,O=a===void 0?!0:a,v=o.enableOnContentEditable,S=v===void 0?!1:v,k=L.useRef(null),_=L.useCallback(function(D,Q){var z,J;return d&&!d(D)?!s:Oh(D)&&!ma(D,u)||(z=D.target)!=null&&z.isContentEditable&&!S?!0:k.current===null||document.activeElement===k.current||(J=k.current)!=null&&J.contains(document.activeElement)?(t(D,Q),!0):!1},r?[k,u,d].concat(r):[k,u,d]);return L.useEffect(function(){if(!O){ht.unbind(e,_);return}return h&&b!==!0&&(n.keydown=!1),ht(e,n||{},_),function(){return ht.unbind(e,_)}},[_,e,O]),k}ht.isPressed;const ga=L.createContext({open:!1,toggleOpen:e=>{}});function Rh({children:e}){const[t,n]=L.useState(!1),r=u=>{n(u??!u)},o=L.useMemo(()=>({open:t,toggleOpen:r}),[t]);return i.jsx(ga.Provider,{value:o,children:e})}function zi(){return L.useContext(ga)}const gt={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},Ch=e=>rr(async()=>{const{data:t}=await e.get(gt.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function Ih(e,t){const n=e.menu?{sortBy:"popularity",sortDirection:"desc",showResources:"true",...Pl(e,["sortBy","sortDirection","showResources"])}:{sortBy:"popularity",sortDirection:"desc",showResources:"true",...e,menu:void 0},{onFilterChange:r,onSearchSelect:o=h=>{t.onFilterChange({...n,keyword:h.title})},emptyCategory:u}=t;!n.category&&!u&&(n.category="All");const d=h=>{const b={...n,...h};r(jr(b,x=>x===""||x===void 0))};return{filters:e,cleanFilter:h=>{const b=h?jr(n,(x,s)=>h.includes(s)):{};r(jr(b,x=>x===""||x===void 0))},handleActiveMenu:h=>{h!==e.menu&&r({menu:h})},handleSort:(h,b)=>{d({sortBy:h,sortDirection:b||h==="nameAsc"?"asc":"desc"})},handleKeyword:h=>{d({category:void 0,keyword:h||void 0})},handlePrice:h=>{d({price:h===e.price?void 0:h})},handleCategory:h=>{d({category:h===e.category?"":h})},handleDeveloper:h=>{d({owner:h||void 0})},handlePage:h=>{d({currentPage:h})},handleSwitchShowResources:h=>{d({showResources:h})},handleSearchSelect:h=>{o(h)}}}const Ph=(e,t,n)=>e&&t||!n,va=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],ya=(e,t,n)=>{var r,o;const u=_l(e),d=Ll(u.search);if((r=Nl(e,{strict:!0}))!=null&&r.endsWith(".gif"))return d.imageFilter?Al({...u,search:""}):e;if(d.imageFilter)return e;const h=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 ci(e,{...b||x?{imageFilter:"resize",w:b,h:x}:{},v:h})},_h=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],Lh=(e=[],t="en")=>e.map(n=>({name:n.locales[t]||n.locales.en,value:n._id})),Nh=(e,t)=>e==null?void 0:e.replace(/{(\w*)}/g,(n,r)=>t.hasOwnProperty(r)?t[r]:""),Ah=()=>window.innerWidth<=600,Dh={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}"'}},Mh={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}” 的所有搜索结果"}},Mr={en:to(Dh),zh:to(Mh)},ba=(e,t)=>{const n={};return e&&(n["x-blocklet-server-version"]=e),t&&(n["x-blocklet-store-version"]=t),n},Fh=e=>(t,n)=>{const r=Mr[e]?Mr[e][t]:Mr.en[t];return Nh(r,n)||t},xa={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:()=>{}}},wa=L.createContext(xa),{Provider:Bh,Consumer:hf}=wa;function $h(e){const{locale:t="zh",filters:n={},serverVersion:r="",onFilterChange:o=()=>{},minItemWidth:u=350,queryFilter:d=!0,layout:h={},wrapChildren:b=K=>K,extraFilter:x=K=>K,baseSearch:s=!1,fetchCategoryDelay:a=0,showResourcesSwitch:O=!1,showCategory:v=!0,tagFilters:S=[],children:k,storeVersion:_,onSearchSelect:D=()=>{},endpoint:Q,blockletRender:z}=e,J=ba(r,_),j=L.useMemo(()=>is({baseURL:Q,headers:J}),[Q]),q=Ih(n,{onFilterChange:o,emptyCategory:!h.showExplore,onSearchSelect:D}),[Z,B]=L.useState(""),{data:ue=[],error:ee,loading:ae,run:Te}=Ch(j),Fe=L.useMemo(()=>{const K=Il(ue,[se=>se.name],["asc"]),je=K.findIndex(se=>se.name==="All"||se.locales.en==="All");return je>-1?[{...K[je],_id:"All"},...K.slice(0,je),...K.slice(je+1)]:K},[ue]),$e=L.useCallback(Fh(t),[t]),rt=L.useMemo(()=>Lh(Fe,t),[Fe,t]),ne=_h($e),fe={search:q,errors:{fetchCategoriesError:ee},loadings:{fetchCategoriesLoading:ae},extraFilter:x,endpoint:Q,queryFilter:d,layout:{showExplore:h.showExplore??!1,showCategory:h.showCategory??!0,showTitle:h.showTitle??!0,showSearch:h.showSearch??!0},minItemWidth:u,wrapChildren:b,t:$e,storeVersion:_,serverVersion:r,selectedCategory:q.filters.category||(h.showExplore?"":"All"),categoryList:Fe,blockletRender:z,locale:t,categoryOptions:rt,priceOptions:ne,storeApi:j,baseSearch:s,showResourcesSwitch:O,showCategory:v,tagFilters:S,onFilterChange:o,getCategoryLocale:K=>{if(!K)return null;const je=ue.find(se=>se._id===K||se.locales.en==="All");return je?je.locales[t]||je.locales.en:null},get developerName(){return Z},updateDeveloperName:B};return L.useEffect(()=>{setTimeout(Te,a||0)},[Q,Te,a]),i.jsx(Bh,{value:fe,children:k})}function nt(){return L.useContext(wa)||xa}function Ea({children:e,onClick:t,size:n=32,...r}){return i.jsx(nr,{...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 ar(e,t){return e===void 0?t:e}function qi({xs:e,sm:t,md:n,lg:r,xl:o,exact:u}){const d=tr(),h=Xt(d.breakpoints.down("sm")),b=Xt(d.breakpoints.between("sm","md")),x=Xt(d.breakpoints.between("md","lg")),s=Xt(d.breakpoints.between("lg","xl"));if(u)return h?e||null:b?t||null:x?n||null:s?r||null:o||null;let a=e;return h||(a=ar(t,a),b)||(a=ar(n,a),x)||(a=ar(r,a),s)?a:ar(o,a)}function Uh({children:e}){const{open:t,toggleOpen:n}=zi();return i.jsx(qi,{xs:i.jsx(Ua,{open:t,onClose:()=>n(!1),children:e}),md:i.jsx(Y,{children:e})})}const Wh=L.forwardRef(({loading:e,disabled:t,...n},r)=>i.jsx(nr,{ref:r,disableElevation:!0,disabled:t||e,...n,sx:[{borderRadius:"4px"},...Array.isArray(n.sx)?n.sx:[n.sx]],startIcon:e&&i.jsx(vt,{size:"1em"})}));function Sa({value:e,options:t,onChange:n,placeholder:r,...o}){var u;const d=L.useRef(null),h=tr(),[b,x]=L.useState(!1),[s,a]=L.useState(e!==null?e:""),O=Xt(h.breakpoints.down("sm"));L.useEffect(()=>{a(e!==null?e:"")},[e]);const v=L.useCallback(()=>{x(!1)},[]),S=L.useCallback(()=>{x(!0)},[]);function k(D){a(D.value),n(D.value),O&&v()}function _(D){return D===s}return i.jsxs(i.Fragment,{children:[i.jsxs(zh,{ref:d,onClick:S,variant:"outlined",size:"medium",className:["my-select__selector",Xn(s)?"":"my-select__selector--active"].join(" "),sx:{minWidth:"auto",color:"text.primary",borderRadius:"8px"},...o,children:[((u=t.find(D=>D.value===s))==null?void 0:u.name)||r,i.jsx(Wa,{className:"my-select__arrowdown",component:la,sx:{width:18,height:18}})]}),i.jsx(za,{open:b,anchorEl:d.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:D,placement:Q})=>i.jsx(qa,{...D,style:{transformOrigin:Q==="bottom"?"center top":"center bottom"},children:i.jsx(Ka,{children:i.jsx(Va,{onClickAway:v,children:i.jsx(qh,{autoFocusItem:b,onMouseEnter:S,onMouseLeave:v,children:t.map(z=>i.jsxs(ni,{onClick:()=>k(z),sx:{fontSize:14},children:[i.jsx(ss,{sx:{mr:1,fontSize:16,visibility:_(z.value)?"visible":"hidden"}}),z.name]},z.value))})})})})})]})}const zh=Qt(Wh)`
|
|
486
|
+
border: 1px solid #f0f0f0;
|
|
487
|
+
padding: 6px 8px 6px 12px;
|
|
488
|
+
font-weight: ${e=>e.theme.typography.fontWeightRegular};
|
|
489
|
+
font-size: 14px;
|
|
490
|
+
color: #666;
|
|
491
|
+
line-height: 1;
|
|
492
|
+
text-transform: none;
|
|
493
|
+
& + & {
|
|
494
|
+
margin-left: 10px;
|
|
495
|
+
}
|
|
496
|
+
&.my-select__selector--active {
|
|
497
|
+
&,
|
|
498
|
+
.my-select__arrowdown,
|
|
499
|
+
}
|
|
500
|
+
.my-select__arrowdown {
|
|
501
|
+
color: #999;
|
|
502
|
+
font-size: 14px;
|
|
503
|
+
margin-left: 6px;
|
|
504
|
+
}
|
|
505
|
+
.my-select__icon {
|
|
506
|
+
font-size: 0;
|
|
507
|
+
svg {
|
|
508
|
+
color: #999;
|
|
509
|
+
font-size: 18px;
|
|
510
|
+
margin-right: 3px;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
`,qh=Qt(Qo)`
|
|
514
|
+
.my-select__option__icon {
|
|
515
|
+
color: transparent;
|
|
516
|
+
font-size: 14px;
|
|
517
|
+
margin: 0 3px 0 -5px;
|
|
518
|
+
}
|
|
519
|
+
.my-select__option {
|
|
520
|
+
font-size: 14px;
|
|
521
|
+
color: #999;
|
|
522
|
+
}
|
|
523
|
+
.my-select__option--active {
|
|
524
|
+
&,
|
|
525
|
+
.my-select__option__icon {
|
|
526
|
+
color: ${e=>e.theme.palette.primary.main};
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
`;function Ta(){const{search:e,t}=nt(),{filters:n,handleSort:r,handlePrice:o}=e,u=va(t);return i.jsxs(tt,{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(ei,{control:i.jsx(ti,{checked:n.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.lighter"}},onChange:d=>o(d.target.checked?"free":"")}),label:t("blocklet.free")}),i.jsx(Sa,{value:n.sortBy||u[0].value,options:u,onChange:d=>r(d),placeholder:t("sort.sort")})]})}function Kh({menus:e}){const{selectedCategory:t,search:n,t:r,categoryOptions:o,loadings:u,layout:d,baseSearch:h}=nt(),{filters:b,handleActiveMenu:x,handleCategory:s,cleanFilter:a}=n,{toggleOpen:O}=zi();L.useEffect(()=>{O(!1)},[Object.values(b).join("")]);const v=Ph(h,d.showSearch,b.keyword);return d.showCategory?i.jsxs(Uh,{children:[i.jsx(qi,{xs:i.jsxs(tt,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[i.jsx(Ea,{onClick:()=>O(!1),children:i.jsx(li,{})}),i.jsx(ge,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:r("common.category")})]}),md:null}),i.jsx(tt,{visibility:u.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:v?i.jsxs(i.Fragment,{children:[d.showExplore&&i.jsxs(Y,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[i.jsxs(Y,{display:"flex",alignItems:"center",gap:1,children:[i.jsx(at,{icon:eh,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),a()},children:r("explore.title")})]}),e==null?void 0:e.map(S=>i.jsxs(Y,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof S.icon=="string"?i.jsx(at,{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 k;O(!1),x(S.key),(k=S.onClick)==null||k.call(S)},children:S.title})]},S.key))]}),!!o.length&&i.jsx(tt,{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?a():s(S.value),O(!1)},children:S.name},S.value))})]}):i.jsx(Ta,{})})]}):null}function Ki(){const{endpoint:e,serverVersion:t,storeVersion:n}=nt(),r=ba(t,n),o=L.useMemo(()=>is({baseURL:e,headers:r}),[e]);return{get:async u=>{const{data:d}=await o.get(u);return d},post:async(u,d)=>{const{data:h}=await o.post(u,d);return h}}}const ja=L.memo(function(e){return i.jsx(Y,{height:60,display:"flex",alignItems:"center",justifyContent:"center",...e,children:i.jsx(vt,{})})});function No({icon:e,children:t,maxWidth:n=100,title:r}){return(t===0||t)&&i.jsxs(tt,{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 Vh=16/9,Fr=292,Jr=189,fr=336;function Gh(){var e,t;const{t:n,search:r}=nt(),{get:o}=Ki(),u=tr(),d=Xt(u.breakpoints.down("md")),h=((t=(e=window.blocklet)==null?void 0:e.preferences)==null?void 0:t.homeBanner)||[],{data:b=[],error:x,loading:s}=rr(async()=>{const D=await o(ci(gt.blockletsPath,{didList:h.map(Q=>Q.did).join(",")}));return D!=null&&D.dataList?h.map(Q=>D.dataList.find(z=>z.did===Q.did)):[]});x&&console.error("Get Banner Blocklets error:",x);const a={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.lighter"};return!x&&h.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(Y,{height:{xs:"auto",md:Fr},minHeight:Fr,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden",children:s?i.jsxs(Y,{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center",children:[i.jsx(Ht,{variant:"rounded",height:Jr,width:fr}),i.jsxs(Y,{flex:1,height:"100%",children:[i.jsx(Ht,{variant:"text",height:50,width:100}),i.jsx(Ht,{variant:"text",height:40,width:"100%"}),i.jsx(Ht,{variant:"text",height:40,width:300}),i.jsxs(Y,{display:"flex",gap:1,my:2,children:[i.jsx(Ht,{variant:"circular",height:20,width:20}),i.jsx(Ht,{variant:"text",height:20,width:50})]}),i.jsx(Ht,{variant:"rounded",height:30,width:100})]})]}):i.jsx(oh,{showNav:!0,autoPlay:!0,slideDuration:d?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:D=>i.jsx(Y,{onClick:D,sx:{display:{xs:"none",md:"block"}},children:i.jsx(dc,{sx:{...a,left:5}})}),renderRightNav:D=>i.jsx(Y,{onClick:D,sx:{display:{xs:"none",md:"block"}},children:i.jsx(hc,{sx:{...a,right:5}})}),items:h.map((D,Q)=>({original:D.did,renderItem:()=>{var z;const J=b[Q]||{},j=D.cover||Xh(D.did,(z=J.screenshots)==null?void 0:z[0]),q=ya(j,u.breakpoints.values.md*2);return i.jsxs(tt,{height:{xs:"auto",md:Fr},sx:{cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${q}")`,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(J),gap:{xs:2,md:5},children:[O(q),i.jsxs(tt,{flex:1,height:"100%",gap:3,children:[i.jsxs(Y,{flex:1,children:[v(D.name||J.title||D.name),S(D.desc||J.description)]}),J.did&&k(J,D.baseNum),_(J)]})]})}}))})})]}):null;function O(D){return i.jsx(Y,{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:fr},children:i.jsx(Yh,{url:D})})}function v(D){return i.jsx(ge,{variant:"h2",width:"100%",children:D})}function S(D){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:D})}function k(D,Q=0){const{did:z,owner:J,stats:j}=D;return i.jsxs(Y,{display:"flex",alignItems:"center",gap:2,color:"text.secondary",children:[i.jsx(No,{icon:i.jsx(hr,{src:J.avatar,did:z,size:20,variant:"circle"}),children:J.fullName}),i.jsx(No,{icon:i.jsx(at,{icon:aa}),title:`${j.downloads+Q}`,children:Hh(j.downloads+Q)})]})}function _(D){return i.jsx(nr,{variant:"outlined",size:"small",onClick:()=>r.handleSearchSelect(D),sx:{width:"fit-content",textTransform:"none",bgcolor:"white",borderRadius:"8px",borderColor:"divider","&:hover":{borderColor:"divider"}},children:n("explore.viewDetail")})}}const Hh=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`,Xh=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function Yh({url:e}){const[t,n]=L.useState(!0);return i.jsxs(i.Fragment,{children:[t&&i.jsx(Ht,{variant:"rectangular",sx:{width:{xs:"100%",md:fr},height:{xs:"auto",md:Jr}}}),i.jsx(Y,{display:t?"none":"block",component:"img",src:e,alt:"",width:{xs:"100%",md:fr},height:{xs:"auto",md:Jr},borderRadius:2,border:1,borderColor:"divider",sx:{objectFit:"container",cursor:"pointer",aspectRatio:Vh},onLoad:()=>n(!1),onError:()=>n(!1)})]})}function Qh({title:e,blocklets:t}){const{blockletRender:n,serverVersion:r}=nt();return i.jsxs(Y,{mt:3,children:[i.jsx(ge,{component:"h3",variant:"h3",sx:{mb:2},children:e}),i.jsx(Qi,{container:!0,spacing:2,boxSizing:"border-box",maxWidth:"calc(100vw - 16px)",children:t.map(o=>i.jsx(Qi,{item:!0,xs:12,md:6,p:"2px","data-blocklet-did":o.did,children:i.jsx(Y,{padding:"1px",children:n({blocklet:o,blocklets:t,serverVersion:r})})},o.did))})]})}function Jh(){const{get:e}=Ki(),{t}=nt(),{data:n=[],error:r,loading:o}=rr(async()=>{const u=await e(gt.explorePath);return Array.isArray(u)?u:[]});return r?i.jsx(yr,{error:new Error(`Failed to fetch blocklets from ${gt.explorePath}`)}):o?i.jsx(ja,{mt:15}):i.jsxs(i.Fragment,{children:[i.jsx(Gh,{}),n.map(u=>{var d;return((d=u.blocklets)==null?void 0:d.length)>0?i.jsx(Qh,{title:t(`explore.${u.type}`),blocklets:u.blocklets},u.type):null})]})}const Br="__FREE_TEXT__",Ao="__NO_RESULT__",$r=40;function Zh({endpoint:e,t,locale:n,filters:r,handleKeyword:o,handleSearchSelect:u,...d}){const h=L.useRef(null),b=L.useRef(!1),[x,s]=L.useState(!1),[a,O]=L.useState(""),[v,S]=L.useState(!1),k=Ki(),[_,D]=L.useState(!1),Q=(d==null?void 0:d.placeholder)||t("common.searchStore"),z=async ne=>{D(!0);const fe=await k.get(Jn(e,ci(gt.blockletsPath,ne)));return D(!1),fe.dataList||[]},{data:J,run:j}=rr(ne=>ne?z({sortBy:gt.nameDesc,page:1,pageSize:10,keyword:ne,showResources:"true"}):Promise.resolve([]),{manual:!0});L.useEffect(()=>{D(!0),j(r.keyword),O(r.keyword||"")},[r.keyword,j]),kh("ctrl + k, command + k",ne=>{var fe,K;return ne.stopPropagation(),ne.preventDefault(),(K=(fe=h.current)==null?void 0:fe.querySelector("input"))==null||K.focus(),!1},{enableOnTags:["INPUT"]});const q=ds(ne=>j(ne),{wait:300}),Z={name:Br,title:a,did:""};let B=[];return a&&(_?B=[Z]:J!=null&&J.length?B=[Z,...J]:B=[{name:Ao,title:t("blocklet.noResults"),did:""}]),i.jsxs(i.Fragment,{children:[i.jsxs(Ga,{fullScreen:!0,open:v,sx:{display:{md:"none"}},children:[i.jsxs(Y,{p:2,pb:0,display:"flex",alignItems:"center",gap:2,children:[i.jsx(Jo,{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:Q,className:"bl-autocomplete-input",value:a,onChange:ne=>ue(ne.target.value),startAdornment:$e(v),endAdornment:rt()}),i.jsx(nr,{variant:"outlined",onClick:()=>{S(!1),O(r.keyword||"")},children:t("common.cancel")})]}),i.jsx(Qo,{sx:{p:.5},children:B.map(ne=>Te(ne))})]}),i.jsx(ur,{sx:{display:{sx:"block",md:"none"},fontSize:28,color:"text.lighter"},onClick:()=>S(!0)}),i.jsx(qo,{ref:h,open:!!a&&x,size:"small",onOpen:()=>s(!0),onClose:(ne,fe)=>{s(!1),fe==="selectOption"&&!b.current&&o(a)},onKeyDown:ne=>{ne.key==="Enter"&&!a&&ee()},disableClearable:!0,inputValue:a,onInputChange:(ne,fe)=>ue(fe),isOptionEqualToValue:(ne,fe)=>ne.name===fe.name,getOptionLabel:ne=>ne.title,getOptionKey:ne=>ne.name,noOptionsText:t("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:ne=>i.jsx(mr,{...ne,InputProps:{...ne.InputProps,autoFocus:!0,placeholder:Q,className:"bl-autocomplete-input",value:a,startAdornment:$e(x),endAdornment:rt()}}),filterOptions:ne=>ne,...d,options:B,renderOption:(ne,fe)=>Te(fe),value:Z,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(d.sx)?d.sx:[d.sx]]})]});function ue(ne){D(!0),O(ne),b.current=!1,q.run(ne)}function ee(){S(!1),O(""),ue(""),o("")}function ae(ne){ne!=null&&ne.did?(S(!1),b.current=!0,O(""),u(ne)):ne.name===Br&&(S(!1),o(a))}function Te(ne){var fe,K;return i.jsxs(ni,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>ae(ne),children:[Fe(ne),i.jsxs(ge,{variant:"body1",children:[i.jsx(ge,{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1,children:ne.title}),i.jsx(ge,{sx:{color:"text.lighter"},fontSize:"13px",children:((K=(fe=ne.category)==null?void 0:fe.locales)==null?void 0:K[n||"en"])||""})]})]},ne.did)}function Fe(ne){if([Br,Ao].includes(ne.name))return i.jsx(Y,{width:$r,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.lighter",bgcolor:"#F1F3F5",borderRadius:"8px",children:i.jsx(ur,{sx:{fontSize:28}})});let fe="";return ne.logo&&(fe=Jn(e,"assets",ne.did,ya(ne.logo,$r,ne.version))),i.jsx(hr,{src:fe,size:$r,style:{borderRadius:"8px",overflow:"hidden"}})}function $e(ne=!0){return i.jsx(Y,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.lighter"},children:ne&&a&&_?i.jsx(vt,{color:"inherit",size:16}):i.jsx(ur,{sx:{fontSize:16,cursor:"default"}})})}function rt(){return a?i.jsx(Y,{sx:{display:"flex",alignItems:"center",color:"text.lighter"},children:i.jsx(li,{sx:{fontSize:20,cursor:"pointer"},onClick:()=>ee()})}):null}}function ep({placeholder:e="Type to search...",...t}){const{search:n}=nt(),{filters:r,handleKeyword:o}=n,[u,d]=L.useState(r.keyword||""),h=ds(o,{wait:300}),b=s=>{const{value:a}=s.target;d(a),h.run(a)},x=()=>{d(""),o("")};return L.useEffect(()=>{d(r.keyword||"")},[r.keyword]),i.jsx(tp,{inputProps:{"data-cy":"search-blocklet"},startAdornment:i.jsx(Zi,{position:"start",children:i.jsx(np,{})}),onChange:b,placeholder:e,value:u,title:e,"data-cy":"search",endAdornment:u&&i.jsx(Zi,{position:"end",children:i.jsx(rp,{"data-cy":"search-delete",onClick:x})}),...t})}const tp=Qt(Jo)`
|
|
530
|
+
background-color: ${e=>e.theme.palette.grey[50]};
|
|
531
|
+
font-size: 14px;
|
|
532
|
+
border-radius: 6px;
|
|
533
|
+
width: 100%;
|
|
534
|
+
.MuiInputBase-input {
|
|
535
|
+
padding: 8px 0 8px 10px;
|
|
536
|
+
}
|
|
537
|
+
.MuiOutlinedInput-notchedOutline {
|
|
538
|
+
border: none;
|
|
539
|
+
}
|
|
540
|
+
.Mui-focused {
|
|
541
|
+
background-color: #f6f6f6;
|
|
542
|
+
.MuiInputBase-input::placeholder {
|
|
543
|
+
color: transparent;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
`,np=Qt(ur)`
|
|
547
|
+
color: ${e=>e.theme.palette.grey[500]};
|
|
548
|
+
font-size: 28px;
|
|
549
|
+
@media (max-width: ${e=>e.theme.breakpoints.values.md}px) {
|
|
550
|
+
font-size: 24px;
|
|
551
|
+
}
|
|
552
|
+
`,rp=Qt(li)`
|
|
553
|
+
color: ${e=>e.theme.palette.grey[500]};
|
|
554
|
+
font-size: 16px;
|
|
555
|
+
cursor: pointer;
|
|
556
|
+
`;function ip(){const{search:e,t,endpoint:n,locale:r,getCategoryLocale:o,developerName:u,showResourcesSwitch:d,layout:h,baseSearch:b}=nt(),{filters:x,handleSort:s,handlePrice:a,handleDeveloper:O,handleSwitchShowResources:v,cleanFilter:S}=e,k=va(t);return i.jsxs(tt,{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(tt,{flex:1,direction:"row",alignItems:"center",width:"100%",justifyContent:{xs:"space-between",md:"flex-end"},gap:2,children:[h.showSearch?i.jsx(Y,{flex:1,children:b?i.jsx(ep,{}):i.jsx(Zh,{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&&u&&i.jsx(Ji,{label:t("blocklet.authorTag",{name:u}),size:"small",onDelete:()=>O("")}),x.resourceDid&&x.resourceBlocklet&&i.jsx(Ji,{label:t("blocklet.resourceTag",{name:x.resourceBlocklet}),size:"small",onDelete:()=>S(["resourceDid","resourceBlocklet","showResources"])}),d?i.jsx(Do,{checked:x.showResources!=="false",onChange:_=>v(_?"true":"false"),label:t("common.showResources")}):null,i.jsx(Do,{checked:x.price==="free",onChange:_=>a(_?"free":""),label:t("blocklet.free")}),i.jsx(Sa,{value:x.sortBy||k[0].value,options:k,placeholder:t("sort.sort"),onChange:_=>s(_)})]})]})}function Do({checked:e,onChange:t,label:n}){return i.jsx(ei,{sx:{m:0,p:0},className:"check-button",control:i.jsx(ti,{checked:e,icon:i.jsx(at,{style:{padding:0},icon:fh}),checkedIcon:i.jsx(at,{style:{padding:0,color:"#3478E2"},icon:mh}),size:"large",sx:{p:0,mr:1},onChange:r=>t(r.target.checked)}),label:n})}function lr({children:e}){return i.jsxs(Y,{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.lighter",children:[i.jsx(al,{}),e]})}function Mo(){const{t:e}=nt();return i.jsx(ge,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function Ur({filterTip:e,keywordTip:t}){const{t:n,locale:r}=nt(),o=()=>r==="zh"?"、":" , ";return i.jsxs(Y,{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 Wr({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 op(){const{t:e,search:t,getCategoryLocale:n,selectedCategory:r}=nt(),{filters:o}=t,u=!!r||!!o.price;if(o.keyword&&u)return i.jsxs(lr,{children:[i.jsx(Wr,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:o.keyword}),i.jsx(Ur,{keywordTip:!0,filterTip:!0})]});if(o.keyword)return i.jsxs(lr,{children:[i.jsx(Wr,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:o.keyword}),i.jsx(Ur,{keywordTip:!0})]});if(u){const d=n(r);return i.jsxs(lr,{children:[d?i.jsx(Wr,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:d}):i.jsx(Mo,{}),i.jsx(Ur,{filterTip:!0})]})}return i.jsx(lr,{children:i.jsx(Mo,{})})}const sp=(e,t,n,r)=>Yl(async o=>{o||(n.currentPage=n.defaultCurrentPage);const{currentPage:u,pageSize:d}=n,h={...t,category:t.category==="All"?"":t.category,sortBy:gt[t.sortBy],page:u,pageSize:d};r(null);const{data:b={}}=await e.get(gt.blockletsPath,{params:h});return n.currentPage++,{page:u,pageSize:d,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,ll(t)],onError:r});function ap(){var e;const{storeApi:t,search:n,extraFilter:r,errors:o,updateDeveloperName:u}=nt(),{filters:d}=n,h=Xl({currentPage:gt.currentPage,pageSize:Ah()?gt.mobilePageSize:gt.pageSize,defaultCurrentPage:gt.defaultCurrentPage}),[b,x]=L.useState(null),s=sp(t,d,h,x),a=L.useMemo(()=>{var O,v;return r?r(((O=s.data)==null?void 0:O.list)||[]):((v=s.data)==null?void 0:v.list)||[]},[s.data,r]);return L.useEffect(()=>{const O=a.find(v=>v.owner.did===d.owner);u((O==null?void 0:O.owner.fullName)||(O==null?void 0:O.author.name)||"")},[d.owner,a,u]),{blocklets:a,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 lp(){const{t:e,search:t,endpoint:n,blockletRender:r,serverVersion:o,minItemWidth:u,layout:d,baseSearch:h}=nt(),{filters:b}=t,{blocklets:x,errors:s,loadMore:a,loadings:O,hasNextPage:v,total:S}=ap(),[k]=ph({loading:O.fetchBlockletsLoading||O.loadingMore,hasNextPage:v,onLoadMore:a});if(s.fetchBlockletsError){const z=new Error(`Failed to fetch blocklets from ${n}: ${s.fetchBlockletsError.message}`);return i.jsx(yr,{error:z})}const _=h&&d.showSearch||!b.keyword;return i.jsxs(i.Fragment,{children:[_?i.jsx(ip,{}):i.jsxs(i.Fragment,{children:[i.jsx(qi,{xs:i.jsx(Ta,{}),md:null}),Q()]}),D(),!O.fetchBlockletsLoading&&v&&i.jsx(Y,{height:60,display:"flex",justifyContent:"center",py:2,ref:k,children:i.jsx(vt,{})})]});function D(){return O.fetchBlockletsLoading?i.jsx(ja,{mt:15}):x.length?i.jsx(Y,{className:"blocklet-list",display:"grid",gridTemplateColumns:{xs:"1fr",sm:`repeat(auto-fill, minmax(${u}px, 1fr))`},p:"2px",gap:2,children:x.map(z=>i.jsx(Y,{"data-blocklet-did":z.did,minWidth:{xs:"100%",sm:u},maxWidth:"calc(100vw - 32px)",children:r({blocklet:z,blocklets:x,serverVersion:o})},z.did))}):i.jsx(op,{})}function Q(){return i.jsxs(tt,{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 cp(){const{t:e,selectedCategory:t,getCategoryLocale:n}=nt(),{toggleOpen:r}=zi();return i.jsxs(ge,{variant:"body1",display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium",children:[i.jsx(Ea,{onClick:()=>r(!0),children:i.jsx(Sl,{})}),n(t)||e("common.category")]})}function up({menus:e,children:t}){var n;const{search:r,layout:o}=nt(),{filters:u}=r,d=u.category||u.keyword||u.price,h=(n=e==null?void 0:e.find(b=>b.key===u.menu))==null?void 0:n.key;return i.jsx(Rh,{children:i.jsxs(os,{FallbackComponent:yr,children:[i.jsx(cp,{}),i.jsxs(Y,{display:"flex",height:"100%",className:"list-container",pt:{xs:0,md:5},children:[i.jsx(Kh,{menus:e}),i.jsxs(tt,{height:"100%",position:"relative",flex:1,overflow:"visible",children:[h&&(t==null?void 0:t(h)),!h&&(o.showExplore&&!d?i.jsx(Jh,{}):i.jsx(lp,{}))]})]})]})})}function dp(e){const{menus:t,children:n,...r}=e,o=tr(),u=Xo(Cl({...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(Yo,{theme:u,children:i.jsx($h,{...r,children:i.jsx(up,{menus:t,children:n})})})}const hp={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M22 12.54c-1.804-.345-2.701-1.08-3.523-2.94c-.487.696-1.102 1.568-.92 2.4c.028.238-.32 1-.557 1H3c0 5.208 3.164 7 6.196 7c4.124.022 7.828-1.376 9.854-5c1.146-.101 2.296-1.505 2.95-2.46z"/><path d="M5 10h3v3H5zm3 0h3v3H8zm3 0h3v3h-3zM8 7h3v3H8zm3 0h3v3h-3zm0-3h3v3h-3zM4.571 18c1.5 0 2.047-.074 2.958-.78M10 16v.01"/></g>'},pp=hp;var Vi={},fp=Zr;Object.defineProperty(Vi,"__esModule",{value:!0});var Oa=Vi.default=void 0,mp=fp(oi()),gp=i;Oa=Vi.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:qr.satisfies(qr.coerce(e),t);function Gi({children:e,serverVersion:t="",requirementVersion:n="",...r}){const{t:o}=yt();return vp(t,n)?e:i.jsx(Ho,{title:o("store.tooltip.upgradeServer",{serverVersion:t,version:n}),arrow:!0,children:i.jsx(ge,{children:i.jsx(nr,{disabled:!0,variant:"outlined",...r,children:o("common.upgradeServer")})})})}Gi.propTypes={children:P.node.isRequired,serverVersion:P.string,requirementVersion:P.string};Gi.defaultProps={serverVersion:"",requirementVersion:""};const Hn=getComputedStyle(document.documentElement),yp=Xo({palette:{primary:{main:"#1DC1C7",contrastText:"#fff"},secondary:{main:"#030712",contrastText:"#fff"},storeSecondary:{main:"#EBFEFF",contrastText:"#fff"},divider:Hn.getPropertyValue("--stroke-sep").trim()||"#EFF1F5",text:{primary:Hn.getPropertyValue("--foregrounds-fg-base").trim()||"#030712",secondary:Hn.getPropertyValue("--foregrounds-fg-subtle").trim()||"#4b5563",lighter:Hn.getPropertyValue("--foregrounds-fg-muted").trim()||"#9ca3af",link:Hn.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)=>Jn(t,`/blocklets/${e.did}`),Fo=({blocklet:e,attribute:t,value:n})=>e._formatted?e._formatted[t]:n,xp=e=>e.inStore&&Bt.isFreeBlocklet(e)===!1;function Hi({blocklet:e,blocklets:t,handleButtonClick:n,endpoint:r,serverVersion:o}){var D,Q;const{t:u}=yt();let d=Jn(r,vl(e.did,e.logo||""));try{const z=new URL(d);z.searchParams.set("v",e.version||+new Date),d=z.href}catch{}const[h,b]=L.useState(!1),x=z=>z.currentTarget.contains(z.target)?!0:(z.preventDefault(),!1),s=async z=>{z.preventDefault(),z.stopPropagation();try{b(!0),await n({meta:e,registryUrl:r,blocklets:t})}catch(J){ai.error(J.message)}finally{b(!1)}},{blocklet:a}=vr(),O=()=>((a==null?void 0:a.children)||[]).find(j=>j.meta.bundleDid===e.did).meta.version,S=(()=>{const z=((a==null?void 0:a.children)||[]).find(J=>J.meta.bundleDid===e.did);if(z){try{const J=z.meta.version,j=e.version;if(qr.gt(j,J))return"upgrade"}catch{return"install"}return"disable"}return"install"})();let k=u("blocklet.component.choose");S==="upgrade"?k=u("blocklet.component.upgrade"):S==="disable"?k=u("blocklet.component.installed"):xp(e)&&(k=u("common.purchase"));const _=(D=e.requirements)==null?void 0:D.server;return i.jsx(Ha,{href:bp(e,r),style:{color:"initial",textDecoration:"none"},onClick:x,target:"_blank",children:i.jsx(wp,{title:Fo({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Fo({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?d:"",version:e.version,onButtonClick:null,icons:(Q=e.docker)!=null&&Q.image?[{key:"docker",icon:i.jsx(Y,{display:"flex",color:"primary.main",children:i.jsx(at,{icon:pp})}),title:u("blocklet.dockerImage")}]:[],button:i.jsx(Gi,{serverVersion:o,requirementVersion:_,size:"small",children:i.jsx("div",{style:{display:"flex",alignItems:"center"},children:i.jsx(Qd,{children:i.jsxs(dt,{onClick:s,size:"small",disabled:h||S==="disable",variant:"outlined",color:"primary","data-cy":"install-blocklet",title:S==="upgrade"?`${O()} -> ${e.version}`:"",children:[h?i.jsxs(i.Fragment,{children:[i.jsx(vt,{size:16,style:{marginRight:3}}),k]}):k,S==="upgrade"?i.jsx(Oa,{style:{fontSize:"1.2rem"}}):null]},e.did)})})})})})}Hi.propTypes={blocklet:P.object.isRequired,blocklets:P.array,handleButtonClick:P.func,endpoint:P.string,serverVersion:P.string};Hi.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function Xi({handleButtonClick:e,handleSearchSelect:t,storeUrl:n,handleBlockletRender:r,extraFilter:o,serverVersion:u,resourceType:d,resourceDid:h,showResourcesSwitch:b,showCategory:x,...s}){const{locale:a}=yt(),[O,v]=L.useState(!1),[S,k]=L.useState({}),_=Q=>{k(Q)},D=n;return L.useEffect(()=>{k({showResources:!0,resourceType:d,resourceDid:h})},[D,d,h]),L.useEffect(()=>{v(!0),k({showResources:!0,resourceType:d,resourceDid:h})},[]),i.jsx(Yo,{theme:yp,children:i.jsx(os,{FallbackComponent:yr,resetKeys:[D],children:i.jsxs(Y,{...s,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(s.sx)?s.sx:[s.sx]],children:[O&&i.jsx(dp,{showCategory:x,showResourcesSwitch:b,blockletRender:Q=>{const z={...Q,handleButtonClick:e,endpoint:D};return r({...Q,defaultRender:i.jsx(Hi,{...z})})},baseSearch:!0,endpoint:D,locale:a,onFilterChange:_,onSearchSelect:t,filters:S,extraFilter:o,serverVersion:u,fetchCategoryDelay:500}),i.jsx(Y,{sx:{mt:2},children:" "})]})})})}Xi.propTypes={storeUrl:P.string.isRequired,handleButtonClick:P.func,handleSearchSelect:P.func,handleBlockletRender:P.func,extraFilter:P.func,serverVersion:P.string,resourceType:P.string,resourceDid:P.string,showResourcesSwitch:P.bool,showCategory:P.bool};Xi.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0};const wp=He(Zd)`
|
|
557
|
+
.ms-highlight {
|
|
558
|
+
color: ${e=>e.theme.palette.primary.main};
|
|
559
|
+
}
|
|
560
|
+
`,Yi=L.forwardRef(({meta:e,isMobile:t,onStepChange:n},r)=>{const{steps:o,activeStep:u,setActiveStepByKey:d,setActiveStepByIndex:h}=Tl(),{t:b,locale:x}=yt(),s=o[u];return L.useEffect(()=>{n(u)},[n,u]),L.useImperativeHandle(r,()=>({setActiveStepByKey:d,setActiveStepByIndex:h})),i.jsx(Sp,{component:"div",className:t?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:i.jsx(jl,{locale:x,blockletMeta:{title:" ",...e},pcWidth:"100%",pcHeight:"100%",logoUrl:e&&e.logo&&e.registryUrl?yl({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})})})});Yi.propTypes={meta:P.any,onStepChange:P.func.isRequired,isMobile:P.bool.isRequired};Yi.defaultProps={meta:null};const Bo=e=>e.isMobile?`
|
|
561
|
+
height: calc(100vh - 56px - 64px - 48px);
|
|
562
|
+
`:"",Ep=He.div`
|
|
563
|
+
width: 100%;
|
|
564
|
+
height: 100%;
|
|
565
|
+
display: flex;
|
|
566
|
+
flex-direction: column;
|
|
567
|
+
justify-content: flex-start;
|
|
568
|
+
align-items: flex-start;
|
|
569
|
+
|
|
570
|
+
.bottom-button {
|
|
571
|
+
min-width: 200px;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
// blocklet-select-side
|
|
575
|
+
aside {
|
|
576
|
+
width: 140px;
|
|
577
|
+
}
|
|
578
|
+
`,Sp=He(Y)`
|
|
579
|
+
${({className:e})=>e==="mobileStyle"?`
|
|
580
|
+
& > div{
|
|
581
|
+
height: 100%;
|
|
582
|
+
}
|
|
583
|
+
.root-header {
|
|
584
|
+
.app-name-content {
|
|
585
|
+
display: none;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
// content-panel
|
|
590
|
+
.root-header + div{
|
|
591
|
+
padding-top: 0;
|
|
592
|
+
position: relative;
|
|
593
|
+
& > div {
|
|
594
|
+
padding-top: 0;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
header + div {
|
|
599
|
+
padding-top: 0;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
header {
|
|
603
|
+
.header-title {
|
|
604
|
+
margin-left: 0;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
.header-title-name {
|
|
608
|
+
max-width: 100% !important;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
.app-content {
|
|
612
|
+
padding: 0!important;
|
|
613
|
+
}
|
|
614
|
+
`:`
|
|
615
|
+
position: relative;
|
|
616
|
+
.ll-container { // 通过 Launcher Layout 组件约定的 .ll-container class 自定义 Layout 样式
|
|
617
|
+
width: 100%;
|
|
618
|
+
height: 100%;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.root-header {
|
|
622
|
+
z-index: auto !important;
|
|
623
|
+
position: fixed !important;
|
|
624
|
+
}
|
|
625
|
+
& > div {
|
|
626
|
+
height: 100%;
|
|
627
|
+
width: 100%;
|
|
628
|
+
max-width: 100%;
|
|
629
|
+
& > div {
|
|
630
|
+
max-height: unset !important;
|
|
631
|
+
max-width: 100%;
|
|
632
|
+
& > div {
|
|
633
|
+
// left-panel
|
|
634
|
+
&:first-child {
|
|
635
|
+
padding: 0;
|
|
636
|
+
width: 20%;
|
|
637
|
+
min-width: 180px;
|
|
638
|
+
|
|
639
|
+
& > div:first-child {
|
|
640
|
+
display: none;
|
|
641
|
+
}
|
|
642
|
+
// step
|
|
643
|
+
& > div:last-child {
|
|
644
|
+
// margin-top: 32px;
|
|
645
|
+
margin-top: 0;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
// right-panel
|
|
649
|
+
&:last-child {
|
|
650
|
+
padding-top: 0;
|
|
651
|
+
padding-right: 0px;
|
|
652
|
+
overflow-y: hidden;
|
|
653
|
+
.app-content {
|
|
654
|
+
padding: 0 0 24px 0;
|
|
655
|
+
}
|
|
656
|
+
.button-container {
|
|
657
|
+
padding-right: 0;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
`}
|
|
665
|
+
|
|
666
|
+
& .app-overview {
|
|
667
|
+
margin-left: 0 !important;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
& .flex-justify-center {
|
|
671
|
+
display: flex;
|
|
672
|
+
justify-content: center;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
& .flex-align-center {
|
|
676
|
+
display: flex;
|
|
677
|
+
height: 100%;
|
|
678
|
+
align-items: center;
|
|
679
|
+
${e=>Bo(e)}
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
& .agreement-wrapper {
|
|
683
|
+
${e=>Bo(e)}
|
|
684
|
+
max-height: 60vh;
|
|
685
|
+
.eula-trigger {
|
|
686
|
+
padding-right: 0;
|
|
687
|
+
}
|
|
688
|
+
.next-button {
|
|
689
|
+
display: none;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
& .connect {
|
|
694
|
+
background: white;
|
|
695
|
+
}
|
|
696
|
+
`,Tp=Yi,jp=e=>e.inStore&&Bt.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)},zr=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},kp=e=>(e.environments||[]).some(t=>t.required),$o=(e,t)=>e==null?void 0:e.some(n=>n.required&&!t[n.key]),Rp=({params:e,blocklet:t,t:n})=>{const r=e.title||e.name;return r?((t==null?void 0:t.children)||[]).find(u=>u.meta.bundleDid===e.bundleDid)?n("blocklet.component.upgradeNext",{name:r}):n("blocklet.component.addNext",{name:r}):n("common.next")},Uo=({componentDid:e,timeout:t=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},t)};function ka({onClose:e,mode:t,stores:n,resourceType:r,resourceDid:o,storageKey:u,inDialog:d,selectedMeta:h,storeUrl:b,showResourcesSwitch:x,showFromUrl:s,enableRunBackground:a,showCategory:O}){var Tt,on,sn,l,y,w,C,N,V,X;const{t:v,locale:S}=yt(),[k,_]=L.useState(!1),[D,Q]=L.useState(null),[z,J]=L.useState(""),[j,q]=L.useState(""),{api:Z,ws:{useSubscription:B},inService:ue,info:ee}=Nn(),{blocklet:ae,actions:{refreshBlocklet:Te}}=vr(),[Fe,$e]=L.useState(null),[rt,ne]=L.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},[K,je]=L.useState(fe),[se,pt]=L.useState(0),Ee=L.useRef({}),Je=L.useRef({}),Ke=L.useRef({}),It=Xt(A=>A.breakpoints.down("md")),Jt=Ja(),[$t,Zt]=L.useState(!0),{meta:Le}=Ee.current,Ne=gs(Le),Ze=L.useRef(!1),[ye,bt]=L.useState(null),Ue=A=>je(F=>({...F,...A}));L.useEffect(()=>{if(K.pathPrefix){const{errMsg:A}=xt({...K,pathPrefix:K.pathPrefix,locale:S});J(A)}},[K.pathPrefix]),L.useEffect(()=>{se===0&&je(fe)},[se]);const Dn=()=>{const A=zr(ae)??"";Ue({didSpaceEndpoint:A})},Re=()=>{var A;return(A=Ee==null?void 0:Ee.current)!=null&&A.meta?Bt.getDisplayName(Ee.current):""},en=()=>{_(!1),je({}),bt(null),Ze.current=!1,Ee.current={},e()},tn=A=>{const F=de=>{Ue({installResultProps:{variant:"error",title:Re(),subTitle:A,footer:i.jsx(dt,{className:"bottom-button",disabled:de,"data-cy":"retry-install-component",onClick:async()=>{F(!0),await ft(Ee.current.installInput)},children:i.jsxs(Y,{display:"flex",alignItems:"center",children:[de&&i.jsx(vt,{size:16,style:{marginRight:8}}),v("common.retry")]})})}})};F()},Ut=A=>F=>{var de,me;(((de=F==null?void 0:F.meta)==null?void 0:de.did)||(F==null?void 0:F.meta))===((me=ae==null?void 0:ae.meta)==null?void 0:me.did)&&A(F)},Wt=()=>{Uo({timeout:0,componentDid:Jt.componentDid,manual:!0}),en(),setTimeout(()=>{const A=document.getElementsByClassName("dashboard-main")[0];A&&(A.scrollTop=A.scrollHeight)},200)};B(Rt.BlockletEvents.componentInstalled,Ut(A=>{Ue({installResultProps:{variant:"success",title:Re(),subTitle:v("blocklet.component.installSuccessTip")}}),bt(A.componentDids),Uo({componentDid:Jt.componentDid})}),[(Tt=ae==null?void 0:ae.meta)==null?void 0:Tt.did]),B(Rt.BlockletEvents.statusChange,Ut(()=>{const A=zr(ae);Ue(F=>({...F,didSpaceEndpoint:A}))}),[(on=ae==null?void 0:ae.meta)==null?void 0:on.did]),B(Rt.BlockletEvents.downloadFailed,Ut(()=>{Ze.current=!1,bt([]),tn(v("blocklet.component.installComponentError"))}),[(sn=ae==null?void 0:ae.meta)==null?void 0:sn.did]),B(Rt.BlockletEvents.installFailed,Ut(()=>{Ze.current=!1,bt([]),tn(v("blocklet.component.installComponentError"))}),[(l=ae==null?void 0:ae.meta)==null?void 0:l.did]);const Xe=[],nn=A=>((ae==null?void 0:ae.children)||[]).find(F=>F.meta.did===A),St=()=>{Z.startBlocklet({input:{did:ae.meta.did,componentDids:ye}}),Wt()},ft=async A=>{var _t,Lt;Ze.current=!0,bt(null);const{pathPrefix:F,bundleDid:de,title:me,componentName:ke="",componentDid:Ce=""}=K,We=((_t=Ee.current)==null?void 0:_t.meta)||{},{configs:lt=[],registryUrl:jt,inStore:Pt,inputUrl:an,dist:ln}=We,cn=(Lt=Ee.current)==null?void 0:Lt.downloadTokenList,ze=an||(Pt?no(jt,de,ln):"");_(!0);const qt={rootDid:ae.meta.did,url:ze,mountPoint:F?ir(F):`/${ir(We.title||We.name)}`,title:me,name:ke,did:Ce,onlyRequired:!$t,...K.hasEnvironmentsStep&<.length>0?{configs:lt.map(mt=>({...mt,value:K.configsValue[mt.key]||""}))}:{},...cn?{downloadTokenList:cn}:{},...A};try{if(await Z.installComponent({input:qt}),jt){const{teamDid:mt,storeList:Kt}=as({fromBlocklet:ue,nodeInfo:ee,blocklet:ae}),{isNew:Tn,decoded:un}=wl(jt,Kt);Tn&&await Z.addBlockletStore({input:{teamDid:mt,url:un}})}Ue({installResultProps:{}}),Te({showError:!1,attachRuntimeInfo:!1})}catch(mt){const Kt=ps(mt);ai.error(Kt),console.error("installComponent error: ",mt),tn(Kt)}finally{_(!1),Ee.current.installInput=qt}},xt=A=>{const F=ic({params:{...A,did:A.bundleDid},blocklets:[ae],blocklet:ae,locale:S});if(F){const de=nn(A.bundleDid),me=oc({params:{...A,did:A.bundleDid},blocklet:ae});if(de&&de.mountPoint===me)return{errMsg:""}}return{errMsg:F}},Pe=async A=>{var de,me;const{errMsg:F}=xt({...K,locale:S});J(F),se===Xe.length-2&&!Ze.current&&await ft(A),(me=(de=Je.current)==null?void 0:de.setActiveStepByIndex)==null||me.call(de,ke=>ke+1)},it=()=>{var A,F;(F=(A=Je.current)==null?void 0:A.setActiveStepByIndex)==null||F.call(A,de=>de-1)},rn=()=>{const{pathPrefix:A,bundleDid:F,title:de,componentName:me="",componentDid:ke=""}=K,{meta:Ce={}}=Ee.current||{},{registryUrl:We,inStore:lt,inputUrl:jt,dist:Pt}=Ce,an=lt?no(We,F,Pt):jt;$e({meta:Ce,installOpts:{type:"component",rootDid:ae.meta.did,mountPoint:A,url:an,title:de,name:me,did:ke}})},En=A=>{ne(!1),Ue({purchaseResultProps:{variant:"error",title:Re(),subTitle:A,style:{paddingTop:120},footer:i.jsx(dt,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{Ue({purchaseResultProps:{}})},children:v("common.retry")})}})},Sn=({downloadTokenList:A})=>{Ee.current.downloadTokenList=A,ne(!1),Pe()},zt=({chooseParams:A=Ee.current,componentDid:F,isInit:de=!1})=>{var un,Nt,Mn,Fn;const{meta:me,registryUrl:ke,inStore:Ce,inputUrl:We}=A,{did:lt,title:jt,name:Pt}=me,an=(((un=ae.settings)==null?void 0:un.children)||[]).filter(ot=>ot.status==="deleted"&&ot.meta.bundleDid===lt),ln=F||"",cn=(Nt=me.environments)==null?void 0:Nt.map(ot=>{const{name:dn,validation:jn,...Oe}=ot,Vt={validation:Ml(jn)?"":jn};return{...Oe,key:dn,...Vt}});Ee.current={...A,meta:{...me,configs:cn,registryUrl:ke,inStore:Ce,inputUrl:We}};let ze={};if(de){const ot=[ae],dn=cn||[],jn=[],Oe=cs(Dl([...dn,...jn]),"key").filter(At=>!!At.key).sort((At,kn)=>At.required&&!kn.required?-1:kn.required&&!At.required?1:0),Vt=Bt.getSharedConfigObj(ot[0],{configs:Oe}),On={},Bn=Oe.map(At=>{const{default:kn,key:hn,...$n}=At;return On[hn]=Vt[hn]||kn,{...$n,key:hn,hidden:!!Rt.BLOCKLET_CONFIGURABLE_KEY[hn]}});ze={...ze,configsList:Bn,configsValue:On,hasMissRequiredConfigs:$o(Bn,On)}}const qt=ae.children.some(ot=>ot.mountPoint==="/"),_t=an.find(ot=>ot.meta.bundleDid===lt),Lt=ae.children.find(ot=>ot.meta.bundleDid===lt);ze.title=jt||"",_t?ze={...ze,pathPrefix:_t.mountPoint||"",componentName:_t.meta.name,hasEnvironmentsStep:!1}:Lt?ze={...ze,pathPrefix:Lt.mountPoint||"",componentName:Lt.meta.name,hasEnvironmentsStep:!1}:ze={...ze,pathPrefix:qt?`/${ir(jt)||ir(Pt)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Fn=(Mn=Ee.current.meta)==null?void 0:Mn.environments)==null?void 0:Fn.length)>0};const mt=jp(Ee.current.meta),Kt=Op(Ee.current.meta),Tn=zr(ae);Ue({bundleDid:lt,componentDid:ln,...ze,hasRequiredEnvironments:kp(Ee.current.meta),requirePurchase:mt,didSpaceIsRequiredSetup:Kt,didSpaceEndpoint:Tn}),de&&mt&&rn()};L.useEffect(()=>{!h||se!==0||!ae||(zt({chooseParams:{blocklets:[h],meta:h,registryUrl:b||h.homepage,inStore:!0},isInit:!0}),Ue({showFromUrlDialog:!1}),Pe())},[h,se,ae]),Xe.push({key:"selectComponent",name:v("blocklet.component.selectComponent"),body:i.jsxs(fn,{sx:{width:400},component:"div",children:[s&&K.showFromUrlDialog&&i.jsx(Ai,{mode:"component",onCancel:()=>{Ue({showFromUrlDialog:!1})},onSuccess:({meta:A,inputUrl:F,inStore:de,registryUrl:me})=>{zt({chooseParams:{meta:A,inputUrl:F,inStore:de,registryUrl:me},isInit:!0}),Ue({showFromUrlDialog:!1}),Pe()},handleText:{title:v("blocklet.component.addComponentTip.fromUrl"),confirm:v("blocklet.component.choose")}}),i.jsx($i,{stores:n,extra:es.isInServerlessMode(ee)?null:s?i.jsxs(dt,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{Ue({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[i.jsx(ms,{style:{fontSize:20,marginRight:4}})," ",v("blocklet.component.addComponentTip.fromUrl")," "]}):null,loading:k,onChange:()=>{je({}),Ee.current={}},storageKey:u,children:({currentRegistry:A})=>i.jsx(Xi,{showResourcesSwitch:x,showCategory:O,serverVersion:ee==null?void 0:ee.version,style:It?{height:"calc(100vh - 56px - 80px - 32px - 10px )"}:{height:"calc(100% - 10px)"},storeUrl:A.url,resourceType:r,resourceDid:o,handleButtonClick:F=>{zt({chooseParams:{...F,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:F,defaultRender:de})=>{const me=(K==null?void 0:K.bundleDid)&&(K==null?void 0:K.bundleDid)===(F==null?void 0:F.did);return i.jsxs(Ip,{children:[me&&i.jsx("div",{className:"check-container",children:i.jsx(ss,{className:"check-icon"})}),i.jsx("div",{className:me?"choose-blocklet":"",style:{marginLeft:16},children:de})]})}})})]}),cancel:t==="embed"?void 0:v("common.cancel"),confirm:Rp({params:K,blocklet:ae,t:v}),onCancel:en,onConfirm:()=>{Pe()}}),Xe.push({key:"agreement",name:v("launchBlocklet.introduction"),body:i.jsxs(fn,{component:"div",className:"agreement-wrapper",children:[i.jsx(ls,{title:v("launchBlocklet.introduction"),subTitle:v("blocklet.component.addComponentTip.introduction")}),i.jsx(vi,{meta:Le,onClickNext:Pe,installRelated:$t,onChangeInstallRelated:Zt,handleDescEle:i.jsx("p",{children:v("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:h?void 0:v("common.pre"),disabled:!Ne,confirm:v(Ne?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:h?en:it,onConfirm:()=>{ne(!1),Pe()}}),Le&&K.requirePurchase&&Xe.push({key:"purchase",name:i.jsxs(i.Fragment,{children:[v("common.verifyNFT"),i.jsx(Or,{})]}),body:i.jsxs(fn,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((w=(y=Ke.current)==null?void 0:y.getCurrentStep)==null?void 0:w.call(y))===2||rt)&&i.jsx(cr,{title:v("common.verifyNFT"),subTitle:v("blocklet.component.addComponentTip.verifyNFT")}),Xn(K.purchaseResultProps)?Fe&&i.jsx(Kd,{ref:Ke,meta:Fe.meta,mode:K.componentDid?"verify":"both",onCancel:En,installOpts:Fe.installOpts,handlePaySuccess:Sn}):i.jsx("div",{className:"flex-align-center flex-justify-center",children:i.jsx(io,{...K.purchaseResultProps})})]}),disabled:((N=(C=Ke.current)==null?void 0:C.getCurrentStep)==null?void 0:N.call(C))===2||rt,cancel:v("common.pre"),confirm:v("common.next"),onConfirm:()=>{typeof Ke.current.onNext=="function"&&(Ke.current.onNext(),ne(!0))},onCancel:()=>{it()}}),Bt.hasStartEngine(Le)&&bl.hasMountPoint(Le)?Xe.push({key:"config",name:v("common.config"),error:z,body:i.jsxs(fn,{component:"div",children:[i.jsx(cr,{title:v("common.config"),subTitle:v("blocklet.component.addComponentTip.config")}),i.jsx(mr,{label:v("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:j||v("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:K.pathPrefix,onChange:A=>{const F=A.target.value;Ue({pathPrefix:F}),q(v("common.slugifyHint",{value:xl(F)}))}}),!!z&&i.jsx(Go,{severity:"error",style:{width:"100%",marginTop:8},children:z})]}),cancel:v("common.pre"),confirm:v("common.next"),onCancel:it,onConfirm:()=>{Pe()}}):Le&&(K.pathPrefix=((X=(V=Le.interfaces)==null?void 0:V[0])==null?void 0:X.path)||`/${Le.did}`),Le&&(K!=null&&K.hasEnvironmentsStep)&&Xe.push({key:"environment",name:i.jsxs(i.Fragment,{children:[v("common.environment")," ",K.hasRequiredEnvironments&&i.jsx(Or,{})]}),disabled:!!D||(K==null?void 0:K.hasMissRequiredConfigs),body:()=>i.jsxs(fn,{component:"div",style:{overflowY:"auto"},children:[i.jsx(cr,{title:v("common.environment"),subTitle:v("blocklet.component.addComponentTip.environment")}),i.jsx($l,{style:{marginTop:-12,width:"100%"},schema:K.configsList,defaultValue:K.configsValue,onChange:(A,{action:F,currentItem:de,allValues:me})=>{F==="confirm"&&Ue({hasMissRequiredConfigs:$o(K.configsList,me),configsValue:me}),F==="edit"?Q(de):["cancel","confirm"].includes(F)&&Q(null)}})]}),cancel:v("common.pre"),confirm:v("common.next"),onCancel:it,onConfirm:Pe}),Le&&(K!=null&&K.didSpaceIsRequiredSetup)&&Xe.push({key:"didSpace",name:i.jsxs(i.Fragment,{children:[v("blocklet.component.didSpaceConfig")," ",K.didSpaceIsRequiredSetup==="required"&&i.jsx(Or,{})]}),disabled:(K==null?void 0:K.didSpaceIsRequiredSetup)&&!K.didSpaceEndpoint,body:()=>i.jsx(Bl,{children:i.jsxs(fn,{component:"div",children:[i.jsx(cr,{title:v("blocklet.component.didSpaceConfig"),subTitle:v("blocklet.component.didSpaceConfigTip")}),i.jsx(Y,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:i.jsx(Bi,{blockletMeta:Ee.current.meta,onNext:()=>{Pe()},onEndpointUpdate:Dn})})]})}),cancel:v("common.pre"),confirm:v("common.next"),onCancel:it,onConfirm:Pe}),Xe.push({key:"install",name:nn(Le==null?void 0:Le.did)?v("common.upgrade"):v("common.install"),disabled:a?!1:Xn(K.installResultProps),loading:a?!1:Xn(K.installResultProps),body:i.jsx(fn,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Xn(K.installResultProps)?i.jsx(cl,{message:i.jsxs(i.Fragment,{children:[i.jsx(Pp,{children:v(a?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),i.jsx(ge,{sx:{marginTop:2,color:"text.secondary",fontStyle:"italic"},children:v("blocklet.component.startTip")})]}),increaseSpeed:.3,messageLoop:!1}):i.jsx("div",{style:{marginTop:120},children:i.jsx(io,{...K.installResultProps})})}),cancel:ye?v("common.complete"):void 0,onCancel:Wt,confirm:v(ye?"common.start":"common.complete"),onConfirm:ye?St:Wt});const Ye=Xe[se]||{},I=()=>k||Ye.error||!K.bundleDid?!0:se>1?!K.pathPrefix:!1;return ae?i.jsxs(Cp,{sx:{width:"100%",height:It?window.innerHeight:d?"72vh":"100vh"},children:[i.jsx(Ol,{steps:Xe,mode:"memory",children:i.jsx(Tp,{ref:Je,meta:Le,isMobile:It,onStepChange:A=>{pt(A)}})}),i.jsxs(Y,{className:"action-bar",children:[Ye.cancel&&i.jsx(dt,{onClick:A=>{A.stopPropagation(),Ye.onCancel()},disabled:se===Xe.length-2&&k,color:"inherit",children:Ye.cancel||v("common.cancel")}),Ye.confirm&&i.jsx(dt,{onClick:A=>{A.stopPropagation(),Ye.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:k||(typeof Ye.disabled=="boolean"?Ye.disabled:I()),variant:"contained",autoFocus:!0,title:Ye.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:i.jsxs(Y,{display:"flex",alignItems:"center",overflow:"hidden",children:[(typeof Ye.loading=="boolean"?Ye.loading:k)&&i.jsx(vt,{style:{marginRight:8},size:16}),i.jsx(Y,{component:"span",flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ye.confirm})]})})]})]}):null}ka.propTypes={onClose:P.func,mode:P.oneOf(["normal","embed"]),inDialog:P.bool,stores:P.arrayOf(P.string),storeUrl:P.string,resourceType:P.string,resourceDid:P.string,storageKey:P.string,selectedMeta:P.object,showResourcesSwitch:P.bool,showFromUrl:P.bool,enableRunBackground:P.bool,showCategory:P.bool};ka.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const Cp=He(Y)`
|
|
697
|
+
.action-bar {
|
|
698
|
+
display: flex;
|
|
699
|
+
justify-content: flex-end;
|
|
700
|
+
position: sticky;
|
|
701
|
+
bottom: 0;
|
|
702
|
+
padding-top: 16px;
|
|
703
|
+
z-index: 100;
|
|
704
|
+
width: 100%;
|
|
705
|
+
background: #fff;
|
|
706
|
+
border-top: 1px solid #eee;
|
|
707
|
+
}
|
|
708
|
+
`,fn=He(ge)`
|
|
709
|
+
width: 100%;
|
|
710
|
+
height: 100%;
|
|
711
|
+
`,cr=He(ls)`
|
|
712
|
+
margin-bottom: 24px;
|
|
713
|
+
`,Ip=He.div`
|
|
714
|
+
position: relative;
|
|
715
|
+
|
|
716
|
+
.choose-blocklet {
|
|
717
|
+
background-color: rgb(236, 251, 253);
|
|
718
|
+
border-color: rgb(236, 251, 253);
|
|
719
|
+
border-radius: 8px;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
.check-container {
|
|
723
|
+
position: absolute;
|
|
724
|
+
right: 0;
|
|
725
|
+
bottom: 0;
|
|
726
|
+
display: flex;
|
|
727
|
+
justify-content: flex-end;
|
|
728
|
+
align-items: flex-end;
|
|
729
|
+
width: 30px;
|
|
730
|
+
height: 30px;
|
|
731
|
+
border-radius: 0 0 8px 0;
|
|
732
|
+
color: ${e=>e.theme.palette.common.white};
|
|
733
|
+
overflow: hidden;
|
|
734
|
+
transition: all ease 0.3s;
|
|
735
|
+
&:after {
|
|
736
|
+
position: absolute;
|
|
737
|
+
z-index: 0;
|
|
738
|
+
display: block;
|
|
739
|
+
width: 0;
|
|
740
|
+
height: 0;
|
|
741
|
+
border-top: transparent solid 15px;
|
|
742
|
+
border-left: transparent solid 15px;
|
|
743
|
+
border-bottom: ${e=>e.theme.palette.primary.main} solid 15px;
|
|
744
|
+
border-right: ${e=>e.theme.palette.primary.main} solid 15px;
|
|
745
|
+
transition: all ease 0.1s;
|
|
746
|
+
content: '';
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
.check-icon {
|
|
750
|
+
position: relative;
|
|
751
|
+
z-index: 2;
|
|
752
|
+
margin: 0 1px 1px 0;
|
|
753
|
+
font-size: 16px;
|
|
754
|
+
transition: all ease 0.2s;
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
`,Pp=He.div`
|
|
758
|
+
color: ${e=>e.theme.palette.primary.main};
|
|
759
|
+
.msg-before {
|
|
760
|
+
display: inline-block;
|
|
761
|
+
color: #aaa;
|
|
762
|
+
font-size: 14px;
|
|
763
|
+
margin-right: 6px;
|
|
764
|
+
}
|
|
765
|
+
`;export{ka as A,ia as B,df as S,cf as a,uf as b,pp as c,ms as d,Ss as f};
|