@abtnode/webapp 1.16.24 → 1.16.25-beta-fe54d1bc

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.
Files changed (34) hide show
  1. package/README.md +1 -1
  2. package/blocklet.js +1 -1
  3. package/blocklet.yml +1 -1
  4. package/build/asset-manifest.json +22 -22
  5. package/build/index.html +1 -1
  6. package/build/service-worker.js +1 -1
  7. package/build/static/js/{1059.04403ac6.chunk.js → 1059.47c68713.chunk.js} +1 -1
  8. package/build/static/js/{1575.23c59d43.chunk.js → 1575.7c51888f.chunk.js} +1 -1
  9. package/build/static/js/{2019.aeb81cec.chunk.js → 2019.b2fd5835.chunk.js} +1 -1
  10. package/build/static/js/{233.17b4abe4.chunk.js → 233.6633c4f0.chunk.js} +1 -1
  11. package/build/static/js/{318.3075b48e.chunk.js → 318.169a3e69.chunk.js} +2 -2
  12. package/build/static/js/{3674.cbc6d802.chunk.js → 3674.c701bb70.chunk.js} +2 -2
  13. package/build/static/js/{3803.98a690a5.chunk.js → 3803.c0312e3c.chunk.js} +1 -1
  14. package/build/static/js/{3930.5e6cc374.chunk.js → 3930.bfa70d11.chunk.js} +1 -1
  15. package/build/static/js/{4423.15ad2bdc.chunk.js → 4423.bd20b413.chunk.js} +1 -1
  16. package/build/static/js/{4465.35605c67.chunk.js → 4465.0f74e0ab.chunk.js} +1 -1
  17. package/build/static/js/4550.af6850d6.chunk.js +1 -0
  18. package/build/static/js/{5672.a17eafba.chunk.js → 5672.066bb632.chunk.js} +1 -1
  19. package/build/static/js/{5748.7c8cbfe3.chunk.js → 5748.2d3e72b1.chunk.js} +1 -1
  20. package/build/static/js/{6906.2ffc3260.chunk.js → 6906.44480f01.chunk.js} +1 -1
  21. package/build/static/js/{6944.15144834.chunk.js → 6944.4c8d8699.chunk.js} +1 -1
  22. package/build/static/js/7022.f6c43a8f.chunk.js +1 -0
  23. package/build/static/js/{8170.3901a03b.chunk.js → 8170.7bcdd129.chunk.js} +1 -1
  24. package/build/static/js/{8590.637663f8.chunk.js → 8590.f6ea2144.chunk.js} +1 -1
  25. package/build/static/js/{9132.cb895073.chunk.js → 9132.edb81af8.chunk.js} +1 -1
  26. package/build/static/js/{9586.73537daa.chunk.js → 9586.ce440947.chunk.js} +1 -1
  27. package/build/static/js/main.0aca0cd7.js +2 -0
  28. package/package.json +1 -1
  29. package/build/static/js/2334.fc389087.chunk.js +0 -1
  30. package/build/static/js/7022.6a2b1919.chunk.js +0 -1
  31. package/build/static/js/main.1b19d449.js +0 -2
  32. /package/build/static/js/{318.3075b48e.chunk.js.LICENSE.txt → 318.169a3e69.chunk.js.LICENSE.txt} +0 -0
  33. /package/build/static/js/{3674.cbc6d802.chunk.js.LICENSE.txt → 3674.c701bb70.chunk.js.LICENSE.txt} +0 -0
  34. /package/build/static/js/{main.1b19d449.js.LICENSE.txt → main.0aca0cd7.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
- /*! For license information please see 318.3075b48e.chunk.js.LICENSE.txt */
2
- (self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[318],{20318:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>Ci});var o=t(5057),i=t(68420),l=t(71171),r=t(33518),a=t(55898),s=t.n(a),c=t(37541),d=t(39948),p=t(7278),m=t(6838),u=t(87971),h=t(99194),f=t(67680),x=t(44919),g=t(48037),y=t(55402),v=t(75239),b=t(48086),j=t(88092),k=t(26174),C=t(16147),Z=t(35432),w=t(44846),R=t(28726),E=t(25710),S=t(38242),P=t(86229),T=t(87363),I=t(44784),U=t(85531),N=t(96266);function D(e){let{children:n,...t}=e;const{t:o}=(0,i.PE)(),{updateAutoCheckUpdate:l,autoCheckUpdate:r}=(0,U.XN)(),a=Boolean(null===r||void 0===r?void 0:r.enabled);return(0,N.jsxs)(d.Z,{display:"flex",flexDirection:"row",alignItems:"center",children:[n,(0,N.jsx)(v.Z,{title:o("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:(0,N.jsx)("div",{children:(0,N.jsx)(I.Z,{checked:a,onChange:async()=>{try{const e=!(null!==r&&void 0!==r&&r.enabled);await l({enabled:e}),P.Z.success(o(e?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(e){P.Z.error(e.message)}},name:"enableWelcomePage",style:{...t.style,zoom:.8}})})})]})}D.propTypes={children:s().any},D.defaultProps={children:null};const A=D;var B,L,O=t(58238),F=t(14491),z=t(63406),M=t(76667),q=t(13128),G=t(94464),W=t(28358),V=t(47020),K=t(93938),H=t(77277),J=t(50185),_=t(35918),Q=t(74782),Y=t(55419);const X=(e,n)=>{let{description:t}=e;return(Object.values(H.CHAIN_PROP_MAP).includes(e.key)||(0,S.isEnvShareable)(e))&&(t=t?"".concat(t," (").concat(n("blocklet.config.sharedToAllComponents"),")"):n("blocklet.config.sharedToAllComponents")),t&&(0,N.jsx)("div",{style:{marginLeft:12},children:t})},$=function(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return!(null!==t&&void 0!==t&&t.length||e.custom||["CHAIN_ID","CHAIN_HOST"].includes(e.key)||n.meta.environments.find((n=>n.name===e.key))||!n.children.every((n=>!n.meta.environments.find((n=>n.name===e.key)))))||e.custom};function ee(e){let{blocklet:n,ancestors:t}=e;const l=(0,O.h6)(),{inService:r}=l,{t:a}=(0,o.useContext)(i.RD),s=[...t.map((e=>e.meta.did)),n.meta.did],c=()=>P.Z.success(a("blocklet.config.changedTip")),d=e=>$(e,n,t);if((0,F.wS)(n.status))return null;if("unknown"===n.status&&(0,F.wS)(n.status))return null;const p=(n.configs||[]).filter((e=>!H.BLOCKLET_CONFIGURABLE_KEY[e.key])),m=(0,S.getSharedConfigObj)(t[0],n),u=(0,S.getComponentMissingConfigs)(n,t[0]),h=p.map((e=>({...e,value:Object.values(H.CHAIN_PROP_MAP).includes(e.key)&&Object.keys(m).includes(e.key)?m[e.key]:m[e.key]||e.value}))),f=h.some((e=>e.key&&e.key.startsWith("BWA_"))),x={onRowAdd:async e=>{if(e.key.trim()&&e.value.trim())if(e.key.startsWith("BLOCKLET_")||e.key.startsWith("COMPONENT_"))P.Z.error(a("blocklet.config.environment.invalidKey"));else{e.custom=!0;try{const n=await l.api.configBlocklet({input:{did:s,configs:[e]}});c(n.blocklet)}catch(n){P.Z.error((0,F.Z)(n))}}else P.Z.error(a("blocklet.config.environment.keyValueRequired"))},onRowUpdate:async(e,o)=>{if(e.required&&(!e.key.trim()||!e.value.trim()))return void P.Z.error(a("blocklet.config.environment.keyValueRequired"));if(e.key.startsWith("BLOCKLET_")&&!H.BLOCKLET_CONFIGURABLE_KEY[e.key])return void P.Z.error(a("blocklet.config.environment.invalidKey"));if(e.key===H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const n=(0,F.I)(e);if(n)return void P.Z.error(n)}const i=[{...e,value:e.secure&&"__encrypted__"===e.value?"":e.value}];if(e.key!==o.key){if(!$(e,n,t))return void P.Z.error("Only key of custom env can be changed");i.push({key:o.key,custom:!0})}try{const e=await l.api.configBlocklet({input:{did:s,configs:i}});c(e.blocklet)}catch(r){P.Z.error((0,F.Z)(r))}},onRowDelete:async e=>{if(e.required)P.Z.error(a("blocklet.config.environment.deleteForbidden"));else if($(e,n,t))try{const n=await l.api.configBlocklet({input:{did:s,configs:[{key:e.key,custom:!0}]}});c(n.blocklet)}catch(o){P.Z.error((0,F.Z)(o))}else P.Z.error("Only key of custom env can be changed")},isDeletable:d};return(0,N.jsxs)(ne,{children:[!!u.length&&(0,N.jsx)(K.Z,{severity:"error",style:{marginTop:24},children:a("blocklet.config.missingRequired")}),f&&(0,N.jsx)(K.Z,{severity:"info",children:a("blocklet.config.environment.tip")}),(0,N.jsx)(z.Z,{permission:r?"":"mutate_blocklets",role:r?F.Wf:[],children:e=>(0,N.jsx)(Q.Z,{className:"config-table",children:(0,N.jsx)(W.ZP,{title:(0,N.jsx)("h4",{children:a("common.environment")}),columns:[{title:a("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:e=>(0,N.jsx)(J.Z,{value:e.value,style:{color:e.required&&!e.value?"#ff4436":"#222222",fontWeight:e.required?"bold":"normal"},children:e.key}),editComponent:e=>{const{value:n,rowData:t,onChange:o}=e;return(0,N.jsx)(te,{children:(0,N.jsx)(V.Z,{fullWidth:!0,size:"small",disabled:!1===d(t),value:n,onChange:e=>o(e.target.value),variant:"outlined",label:"Key",placeholder:a("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:a("common.value"),field:"value",initialEditValue:"Value",width:"calc((100% - (96px + 30%)) / 1)",render:e=>e.value?e.secure?"******":(0,N.jsx)(J.Z,{unstyled:!0,value:e.value,style:{wordBreak:"break-all"},children:e.value}):null,editComponent:e=>{const{value:n,rowData:t,onChange:o}=e;return(0,N.jsxs)(te,{children:[(0,N.jsx)(V.Z,{fullWidth:!0,size:"small",value:"__encrypted__"===n?"":n,onChange:e=>o(e.target.value),variant:"outlined",label:a("common.value"),placeholder:a("blocklet.config.environment.value"),margin:"dense",autoFocus:!0}),X(t,a)]})}}],icons:{...Y.Z,..._.Z},options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1},localization:{header:{actions:a("common.actions")},body:{emptyDataSourceMessage:a("common.noData")}},data:h,editable:e?x:{}})})})]})}ee.propTypes={blocklet:s().object.isRequired,ancestors:s().array},ee.defaultProps={ancestors:[]};const ne=r.Z.div(B||(B=(0,l.Z)(["\n .config-table {\n margin-bottom: 24px;\n position: relative;\n .hide-control {\n position: absolute;\n top: 10px;\n left: 200px;\n @media (max-width: ","px) {\n left: 160px;\n }\n }\n\n .MuiToolbar-root {\n display: flex;\n }\n\n .MuiTableRow-head {\n display: none;\n }\n\n &.hide-header {\n .MuiToolbar-root {\n display: none;\n }\n }\n }\n\n .accordion {\n margin-bottom: 16px;\n &:last-of-type {\n margin-bottom: 0;\n }\n padding: 8px 0 8px 0px;\n &.MuiAccordion-root {\n background: transparent;\n box-shadow: none;\n border: 1px solid #ddd;\n border-radius: 4px;\n &::before,\n &::after {\n height: 0;\n }\n .MuiAccordionSummary-root {\n padding-left: 0;\n }\n .accordion-title {\n font-weight: bold;\n padding-left: 16px;\n }\n }\n }\n"])),(e=>e.theme.breakpoints.values.sm)),te=r.Z.div(L||(L=(0,l.Z)(["\n height: 60px;\n"])));var oe,ie=t(45239),le=t.n(ie),re=t(28641);function ae(e){let{blocklet:n,ancestors:t,hasPermission:l,...r}=e;const{t:a}=(0,i.PE)(),{api:s}=(0,O.h6)(),c=!t.length,p=c?n.meta.did:t.map((e=>e.meta.did))[0],[m,u]=(0,o.useState)(""),[h,f]=(0,o.useState)(""),x=m||!l;if(!p)return null;if("unknown"===n.status&&(0,F.wS)(n.status))return null;return(0,N.jsx)(pe,{component:"div",...r,children:(0,N.jsx)(d.Z,{mt:3,children:(0,N.jsx)(re.Z,{label:a("blocklet.component.mountPoint"),style:{marginTop:-24},disabled:m||x,loading:m,required:!0,initialValue:n.mountPoint,onSubmit:async e=>{u(!0);try{const t={rootDid:p,mountPoint:le()(e)};return c||(t.did=n.meta.did),await s.updateComponentMountPoint({input:t}),u(!1),!0}catch(t){throw u(!1),t.message=(0,F.Z)(t),P.Z.error(t.message),t}},onChange:e=>{f(a("common.slugifyHint",{value:(0,F.LN)(e)}))},helperText:h,formatterBeforeSubmit:e=>le()(e)})})})}const se=(0,z.V)(ae,"mutate_blocklets"),ce=(0,z.V)(ae,"",F.Wf);function de(e){const{inService:n}=(0,O.h6)();return n?(0,N.jsx)(ce,{...e}):(0,N.jsx)(se,{...e})}ae.propTypes={blocklet:s().object.isRequired,ancestors:s().array,hasPermission:s().bool},ae.defaultProps={ancestors:[],hasPermission:!1};const pe=r.Z.div(oe||(oe=(0,l.Z)([""])));var me;function ue(e){let{blocklet:n,ancestors:t,children:l}=e;const[r,a]=(0,o.useState)(""),{t:s}=(0,i.PE)(),c=!!t.length,[p,m]=(0,o.useState)((0,S.hasStartEngine)(null===n||void 0===n?void 0:n.meta)?"settings":"environments"),u=c?(0,S.getDisplayName)(n,!0):s("blocklet.component.container");if((0,F.wS)(n.status))return null;if("unknown"===n.status&&(0,F.wS)(n.status))return null;const h=e=>{e.stopPropagation(),a(!0)},x={settings:(0,S.hasStartEngine)(n.meta)&&{label:s("blocklet.component.setting"),value:"settings",component:(0,N.jsx)(de,{blocklet:n,ancestors:t})},environments:{label:s("common.environment"),value:"environments",component:(0,N.jsx)(ee,{blocklet:n,ancestors:t})}},g=Object.values(x).filter(Boolean),y=g.map((e=>{let{label:n,value:t}=e;return{label:n,value:t}})),v=x[p]||g[0];return["function"===typeof l?l({open:h}):(0,N.jsx)(f.Z,{onClick:h,"data-cy":"action-config-component",children:(0,N.jsx)(M.default,{})}),r&&(0,N.jsx)(he,{open:!0,fullWidth:!0,maxWidth:"md",title:u,onClose:()=>{a(!1)},PaperProps:{style:{minHeight:"auto"}},children:c?(0,N.jsxs)(d.Z,{mt:1,children:[(0,N.jsx)(G.Z,{tabs:y,current:p,onChange:e=>{m(e)},scrollButtons:"auto"}),v.component]}):(0,N.jsx)(ee,{blocklet:n,ancestors:t})})]}ue.propTypes={blocklet:s().object.isRequired,ancestors:s().array,children:s().any},ue.defaultProps={ancestors:[],children:null};const he=(0,r.Z)(q.ZP)(me||(me=(0,l.Z)(["\n .MuiDialogContent-root {\n padding-top: 0;\n margin-top: -32px;\n }\n .MuiToolbar-root {\n padding-right: 12px;\n }\n .ux-dialog_right {\n padding-right: 20px;\n }\n"])));var fe=t(74490),xe=t(33271),ge=t(15715),ye=t(5952),ve=t(85493),be=t(30278),je=t.n(be),ke=t(79077),Ce=t.n(ke),Ze=t(75506),we=t.n(Ze),Re=t(3785),Ee=t.n(Re),Se=t(2660),Pe=t(11750),Te=t(42876),Ie=t(63902),Ue=t(51703),Ne=t(88574),De=t(35266),Ae=t(55309),Be=t(29054),Le=t(24558),Oe=t(13727),Fe=t(56184),ze=t(11819),Me=t(67486);const qe={description:s().string,editing:s().bool,onChange:s().func,required:s().bool,value:s().any,componentProps:s().object,render:s().func,renderFormItem:s().func};function Ge(e){let{editing:n,value:t,onChange:i}=e;const[l,r]=(0,o.useState)(!1),a=(0,o.useRef)(),s=(0,o.useRef)(t);(0,o.useEffect)((()=>{let e=null;return n&&(e=setTimeout((()=>{r(!0)}),50)),()=>{clearTimeout(e)}}),[n]);const c=(0,N.jsx)(d.Z,{className:"form-item-input slot",px:1,children:(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[t,"auto"!==t&&(0,N.jsx)("div",{style:{marginLeft:4,backgroundColor:t,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=(0,N.jsxs)(d.Z,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:()=>{r(!1),i(s.current)},children:[(0,N.jsx)(d.Z,{display:"flex",alignItems:"center",onClick:()=>r(!0),children:(0,N.jsx)("div",{ref:a,style:{flexShrink:0,marginLeft:"8px",backgroundColor:t,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:"auto"===t?"default":"pointer"}})}),(0,N.jsx)(ze.ZP,{open:l,anchorEl:a.current,onClose:()=>r(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:(0,N.jsx)(Me.AI,{color:t,onChange:e=>{return n=e.hex,s.current=n,void i(n);var n}})})]});return n?p:c}function We(e){let{editing:n,description:t,value:i,onChange:l,componentProps:r,...a}=e;const{placeholder:s}=r,c=(0,o.useRef)(i),p=e=>{"Enter"===e.key&&l(c.current,"confirm")};return n?(0,N.jsx)(V.Z,{style:{flex:1},fullWidth:!0,value:i,onChange:e=>{var n;e.persist(),n=e.target.value,c.current=n,l(n)},autoFocus:!0,size:"small",variant:"outlined",placeholder:t||s,onKeyDown:p,...a}):(0,N.jsx)(d.Z,{px:1,className:"form-item-input slot",children:i})}Ge.propTypes=qe,We.propTypes=qe,We.defaultProps={componentProps:{}};var Ve=t(49777),Ke=t.n(Ve),He=t(76818);function Je(e){let{editing:n,value:t,onChange:o,componentProps:i,...l}=e;const{blocklet:r}=i,a="auto"===t?(0,He.getPassportColorFromDid)(r.appDid):t;return(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,N.jsx)("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Ke()({title:"Owner",issuer:(0,S.getDisplayName)(r),issuerDid:r.appDid,ownerName:"Your Name",ownerDid:r.appDid,preferredColor:t||"auto"})}}),(0,N.jsx)(Ge,{...l,editing:n,value:n?a:t,onChange:o,componentProps:i})]})}Je.propTypes={...qe,componentProps:s().shape({blocklet:s().object.isRequired}).isRequired},Je.defaultProps={};var _e,Qe=t(35406),Ye=t(11875),Xe=t(59375);const $e={input:We,color:Ge,passport:Je,uploader:e=>(0,N.jsx)(Xe.Z,{...e.componentProps})};function en(e){let{schema:n,loading:t,value:i,defaultValue:l,onChange:r,style:a,disabled:s}=e;const c="[object Object]"===Object.prototype.toString.call(i),[p,m]=(0,o.useState)(null),[u,h]=(0,o.useState)(c?i:l),x=(0,o.useRef)();function g(e,n,t){const{key:o,secure:i}=e,l=u[o]!==n,a={...u,[o]:n};l&&h(a),r({[o]:n},{allValues:a,action:t,currentItem:e}),"confirm"===t&&i&&h({...u,[o]:"__encrypted__"}),["confirm","cancel"].includes(t)?y(null):y(e)}function y(e){if(e)return x.current=u[e.key],void m(e);x.current=null,m(null)}return(0,N.jsx)(nn,{className:"form",style:a,children:null===n||void 0===n?void 0:n.map((e=>{const{key:n,description:o,required:l,solo:r=!1,hidden:a=!1,componentProps:m={}}=e;if(a)return null;const h=!(!p||n!==p.key),y=function(e,n){let{editing:t=!1}=n;const{key:o}=e,l=c?i[o]:u[o];return"__encrypted__"===l?t?"":"******":l}(e,{editing:h}),v=function(e,n){let{editing:t=!1}=n;const{componentType:o="input",render:i,renderFormItem:l}=e;return t&&l?l:!t&&i?i:$e[null===o||void 0===o?void 0:o.toLowerCase()]}(e,{editing:h}),b={inputProps:{"data-cy":"schema-form-item-component"},key:n,description:o,editing:h,value:y,onChange:function(n){return g(e,n,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"change")},componentProps:m};return(0,N.jsxs)(d.Z,{className:"form-item",children:[!r&&(0,N.jsxs)(d.Z,{className:"form-item-label",style:{color:l&&!y?"#ff0000":"#333"},children:[o,l&&(0,N.jsx)(Qe.Z,{})]}),(0,N.jsxs)(d.Z,{className:"form-item-body",children:[(0,N.jsx)(d.Z,{className:"form-item-input",sx:{textAlign:r?"center":"left"},children:(0,N.jsx)(v,{...b})}),!r&&(0,N.jsx)(d.Z,{className:"form-item-action",children:h?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(f.Z,{"data-cy":"schema-form-item-confirm",onClick:()=>{g(e,y,"confirm")},disabled:s||t,size:"large",children:t?(0,N.jsx)(w.Z,{size:24}):(0,N.jsx)(Fe.Z,{})}),(0,N.jsx)(f.Z,{"data-cy":"schema-form-item-cancel",onClick:()=>{g(e,x.current,"cancel")},disabled:s||t,size:"large",children:(0,N.jsx)(Oe.default,{})})]}):(0,N.jsx)(f.Z,{"data-cy":"schema-form-item-edit",onClick:()=>{g(e,u[n],"edit")},disabled:s||p,size:"large",children:(0,N.jsx)(Le.Z,{})})})]})]},n)}))})}en.propTypes={schema:s().array.isRequired,loading:s().bool,onChange:s().func.isRequired,value:s().object,defaultValue:s().object,style:s().object,disabled:s().bool},en.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const nn=(0,r.Z)(Ye.Z)(_e||(_e=(0,l.Z)([""])));var tn=t(6352),on=t.n(tn),ln=t(22425),rn=t(28018),an=t.n(rn),sn=t(60344),cn=t(73170);function dn(e){let{meta:n,onCancel:t,mode:l,handlePaySuccess:r}=e;const{t:a,locale:s}=(0,i.PE)(),{info:c}=(0,O.h6)(),d=(0,F.yP)(c),[p,m]=(0,o.useState)(null),u=new URL(null===n||void 0===n?void 0:n.registryUrl).origin,h=(0,S.getDisplayName)({meta:n});if((0,o.useEffect)((()=>{if("purchase"===l){const t=new URL(u);t.pathname="/api/did/verify-purchase-blocklet/token",t.searchParams.set("serverDid",c.did),t.searchParams.set("blockletDid",null===n||void 0===n?void 0:n.did);try{sn.hi.get(t.href).then((e=>{let{data:n}=e;const t="".concat(n.url);m(t)}))}catch(e){console.error("get next workflow url error: ",e)}}return()=>{m(null)}}),[l]),"purchase"===l&&!p)return"";const f={verify:{action:"verify-purchase-blocklet",checkFn:sn.od.create({baseURL:u}).get,extraParams:{serverDid:c.did,blockletDid:null===n||void 0===n?void 0:n.did},messages:{title:a("store.purchase.verify.auth.title",{name:h}),scan:a("store.purchase.verify.auth.scan"),confirm:a("store.purchase.verify.auth.confirm"),success:a("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:sn.od.create({baseURL:on()(u,"/store")}).get,extraParams:{factory:n.nftFactory,nw:p},messages:{title:a("store.purchase.auth.title",{name:h}),scan:a("store.purchase.auth.scan"),confirm:a("store.purchase.auth.confirm"),success:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:a("store.purchase.auth.success")}),(0,N.jsx)("p",{children:a("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return(0,N.jsx)(ln.Z,{open:!0,locale:s,popup:!1,saveConnect:!1,className:"connect",baseUrl:u,onSuccess:async(e,n)=>{const o=e=>{let{downloadTokenList:n}=e;r({downloadTokenList:n})},i=e=>{P.Z.error(e),t(e)};if("purchase"===l&&p){const{statusUrl:e}=(0,F.Pi)(p);await(s=e,an()((()=>sn.hi.get(s).then((async e=>{let{data:n}=e;const t=null===n||void 0===n?void 0:n.downloadTokenList;return"succeed"===n.status?t&&t.length?(await o({downloadTokenList:t}),!0):(await i(a("blocklet.component.missDownloadTokenTip")),!0):"error"===n.status&&(console.error("vc error: ",n),await i(null===n||void 0===n?void 0:n.error),!0)}))),{interval:1e3}))}else await o({downloadTokenList:e.downloadTokenList&&n(e.downloadTokenList)});var s},cancelWhenScanned:t,onClose:t,checkTimeout:3e5,webWalletUrl:d,disableClose:!0,showDownload:!1,...f[l]})}dn.propTypes={...cn.$7,handlePaySuccess:s().func,mode:s().oneOf(["verify","purchase"]).isRequired},dn.defaultProps={handlePaySuccess:()=>{}};const pn=(0,o.forwardRef)(((e,n)=>{let{mode:t,...i}=e;const[l,r]=(0,o.useState)("both"!==t?t:"verify"),[a,s]=(0,o.useState)("both"!==t?2:1),c=e=>{e!==l&&r(e)},d=()=>{l&&2!==a&&s(2)};return(0,o.useImperativeHandle)(n,(()=>({onNext:d,getCurrentStep:()=>a}))),1===a?(0,N.jsx)("div",{style:{maxWidth:520},children:(0,N.jsx)(cn.AP,{action:l,onNext:null,onSelect:c})}):(0,N.jsx)(dn,{...i,mode:l})}));pn.propTypes={mode:s().oneOf(["both","verify","purchase"]).isRequired,ref:s().any},pn.defaultProps={ref:{}};const mn=pn;var un,hn=t(51233),fn=t(53927),xn=t(61813),gn=t(49390),yn=t(67654),vn=t(22714),bn=t(45170);function jn(e){let{onChange:n,loading:t,children:l,extra:r,stores:a,storageKey:s}=e;const{t:c}=(0,i.PE)(),{info:d,inService:p}=(0,O.h6)(),{blocklet:m}=(0,Be.y0)(),[u,h]=(0,o.useState)(!1),f=(0,o.useRef)(null),[x,g]=(0,o.useState)(),[y,v]=(0,yn.Z)(s||"tmp"),[b,j]=s?[y,v]:[x,g],{storeList:k,teamDid:C}=(0,F.dX)({fromBlocklet:p,blocklet:m,nodeInfo:d}),w=je()([...a.map((e=>({...e,protected:!0}))),...k],"url"),E=b&&w.find((e=>b===e.url))||w[0],S=d.mode===Z.NODE_MODES.SERVERLESS;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(kn,{children:[(0,N.jsx)(R.Z,{ref:f,color:"secondary","data-cy":"add-component-select-store",endIcon:(0,N.jsx)(gn.Z,{color:"secondary"}),onClick:()=>{h(!0)},style:{padding:"0 2px"},children:(0,N.jsx)(Pe.Z,{color:"secondary",children:E.name})}),(0,N.jsx)(Pe.Z,{color:"secondary",children:r})]}),(0,N.jsxs)(V.Z,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:c("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:E,autoFocus:!0,onChange:e=>{const t=e.target.value;j(t.url),n(t)},SelectProps:{open:u,MenuProps:{anchorEl:f.current},renderValue:e=>null===e||void 0===e?void 0:e.name,onClose:()=>{h(!1)}},style:{display:"none"},margin:"normal",children:[null===w||void 0===w?void 0:w.map((e=>(0,N.jsx)(fe.Z,{value:e,"data-cy":e.url,children:(0,N.jsx)(bn.Z,{teamDid:C,store:e,onDelete:()=>{var n;b===e.url&&j(null===(n=w[0])||void 0===n?void 0:n.url)}})},e.url))),!S&&(0,N.jsx)(vn.Z,{disabled:t,storeList:w,teamDid:C,onAdd:e=>{j(e)}})]}),l({currentRegistry:E})]})}jn.propTypes={onChange:s().func,loading:s().bool,children:s().any.isRequired,extra:s().node,storageKey:s().string,stores:s().arrayOf(s().shape({name:s().string.isRequired,url:s().string.isRequired}))},jn.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const kn=r.Z.div(un||(un=(0,l.Z)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 16px;\n\n span {\n font-size: 16px;\n color: ",";\n // font-weight: bold;\n }\n"])),(e=>e.theme.palette.common.black));var Cn,Zn=t(38898),wn=t(71569),Rn=t(52439),En=t(77121),Sn=t(44727);const Pn=(e,n)=>on()(n,"/blocklets/".concat(e.did)),Tn=e=>{let{blocklet:n,attribute:t,value:o}=e;return n._formatted?n._formatted[t]:o},In=e=>e.inStore&&!1===(0,S.isFreeBlocklet)(e);function Un(e){let{blocklet:n,blocklets:t,handleButtonClick:l,endpoint:r}=e;const{t:a}=(0,i.PE)();let s=on()(r,(0,F.lk)(n.did,n.logo||""));try{const e=new URL(s);e.searchParams.set("v",n.version||+new Date),s=e.href}catch{}const[c,d]=(0,o.useState)(!1),p=In(n)?a("common.purchase"):a("blocklet.component.choose");return(0,N.jsx)(Zn.Z,{href:Pn(n,r),style:{color:"initial",textDecoration:"none"},onClick:e=>!!e.currentTarget.contains(e.target)||(e.preventDefault(),!1),target:"_blank",children:(0,N.jsx)(Dn,{title:Tn({blocklet:n,attribute:"title",value:n.title||n.name}),did:n.did,description:Tn({blocklet:n,attribute:"description",value:n.description}),cover:n.logo?s:"",version:n.version,button:(0,N.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,N.jsx)(Sn.Kk,{children:(0,N.jsx)(R.Z,{onClick:async e=>{e.preventDefault(),e.stopPropagation();try{d(!0),await l({meta:n,registryUrl:r,blocklets:t})}catch(o){P.Z.error(o.message)}finally{d(!1)}},size:"small",disabled:c,variant:"outlined",color:"primary","data-cy":"install-blocklet",children:c?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(w.Z,{size:16,style:{marginRight:3}}),p]}):p},n.did)})})})})}function Nn(e){let{handleButtonClick:n,handleSearchSelect:t,storeUrl:l,handleBlockletRender:r,extraFilter:a,serverVersion:s,resourceType:c,resourceDid:d,...p}=e;const{locale:m}=(0,i.PE)(),[u,h]=(0,o.useState)(!1),[f,x]=(0,o.useState)({}),g=l;return(0,o.useEffect)((()=>{x({resourceType:c,resourceDid:d})}),[g,c,d]),(0,o.useEffect)((()=>{h(!0),x({resourceType:c,resourceDid:d})}),[]),(0,N.jsx)(Rn.ErrorBoundary,{FallbackComponent:wn.H,resetKeys:[g],children:(0,N.jsx)("div",{...p,children:u&&(0,N.jsx)(En.Z,{blockletRender:e=>{const t={...e,handleButtonClick:n,endpoint:g};return r({...e,defaultRender:(0,N.jsx)(Un,{...t})})},baseSearch:!0,endpoint:g,locale:m,onFilterChange:e=>{x(e)},onSearchSelect:t,filters:f,extraFilter:a,serverVersion:s,fetchCategoryDelay:500})})})}Un.propTypes={blocklet:s().object.isRequired,blocklets:s().array,handleButtonClick:s().func,endpoint:s().string},Un.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[]},Nn.propTypes={storeUrl:s().string.isRequired,handleButtonClick:s().func,handleSearchSelect:s().func,handleBlockletRender:s().func,extraFilter:s().func,serverVersion:s().string,resourceType:s().string,resourceDid:s().string},Nn.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:""};const Dn=(0,r.Z)(Sn.ZP)(Cn||(Cn=(0,l.Z)(["\n .ms-highlight {\n color: ",";\n }\n"])),(e=>e.theme.palette.primary.main));var An=t(35966);function Bn(e){let{...n}=e;return(0,N.jsx)(R.Z,{className:"bottom-button",variant:"contained",color:"primary",...n})}var Ln,On,Fn=t(96366);function zn(){let{key:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{key:"sm"};const n=(0,Fn.Z)();return(0,ge.Z)(n.breakpoints.down(e))}function Mn(e){let{blocklet:n,onStartNow:t,children:o,disabled:l}=e;const{t:r}=(0,i.PE)(),a=zn();return!n||(0,F.bg)(n.meta)?(0,N.jsx)(qn,{children:o}):(0,N.jsxs)(Gn,{isMobile:a,children:[(0,N.jsx)(Bn,{className:"start-now",variant:"contained",color:"primary",disabled:l,onClick:()=>t(),children:r("setup.startNow")}),(0,N.jsx)(d.Z,{display:"flex",alignItems:"center",children:o})]})}Mn.propTypes={blocklet:s().object,onStartNow:s().func,children:s().any,disabled:s().bool},Mn.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const qn=(0,r.Z)(d.Z)(Ln||(Ln=(0,l.Z)(["\n width: 100%;\n margin-top: auto;\n padding-top: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n .bottom-button {\n min-width: 200px;\n }\n "," {\n .bottom-button {\n width: 100%;\n }\n }\n"])),(e=>e.theme.breakpoints.down("md"))),Gn=(0,r.Z)(d.Z)(On||(On=(0,l.Z)(["\n padding-top: 24px;\n margin-top: auto;\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n .start-now {\n min-width: 140px;\n }\n .bottom-button {\n min-width: 120px;\n }\n "," {\n width: 100%;\n }\n\n "," {\n .start-now {\n min-width: inherit;\n }\n .bottom-button {\n min-width: 100px;\n }\n }\n\n "," {\n justify-content: space-between;\n gap: '32px',\n }}\n"])),(e=>e.theme.breakpoints.down("lg")),(e=>e.theme.breakpoints.down("md")),(e=>e.isMobile));var Wn=t(8790),Vn=function(e){return(0,N.jsxs)("svg",{...e,children:[(0,N.jsxs)("g",{filter:"url(#a)",children:[(0,N.jsx)("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97z",fill:"#DDD"}),(0,N.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.192 6.222l-40.97 40.97A11 11 0 0 0 5 54.971V240c0 6.075 4.925 11 11 11h196c6.075 0 11-4.925 11-11V14c0-6.075-4.925-11-11-11H56.97a11 11 0 0 0-7.778 3.222zm-.707-.707A12 12 0 0 1 56.971 2H212c6.627 0 12 5.373 12 12v226c0 6.627-5.373 12-12 12H16c-6.627 0-12-5.373-12-12V54.97a12 12 0 0 1 3.515-8.485l40.97-40.97z",fill:"#000",fillOpacity:".08"}),(0,N.jsx)("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:(0,N.jsx)("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97z",fill:"#D9D9D9"})}),(0,N.jsxs)("g",{mask:"url(#b)",children:[(0,N.jsx)("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),(0,N.jsx)("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),(0,N.jsx)("path",{d:"M33.045 169h-3.767v-11.636h3.887c1.14 0 2.12.233 2.937.698a4.61 4.61 0 0 1 1.881 1.995c.44.863.659 1.899.659 3.108 0 1.212-.222 2.254-.665 3.125a4.668 4.668 0 0 1-1.909 2.011c-.833.466-1.84.699-3.023.699zm-2.01-1.534h1.914c.886 0 1.623-.167 2.21-.5a3.152 3.152 0 0 0 1.318-1.46c.292-.64.438-1.421.438-2.341 0-.913-.146-1.688-.438-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568zm11.546-10.102V169h-1.756v-11.636h1.756zM48.905 169h-3.767v-11.636h3.886c1.14 0 2.12.233 2.938.698a4.609 4.609 0 0 1 1.88 1.995c.44.863.66 1.899.66 3.108 0 1.212-.222 2.254-.665 3.125a4.667 4.667 0 0 1-1.91 2.011c-.833.466-1.84.699-3.022.699zm-2.011-1.534h1.914c.887 0 1.623-.167 2.21-.5a3.151 3.151 0 0 0 1.319-1.46c.291-.64.437-1.421.437-2.341 0-.913-.146-1.688-.437-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568zm20.372-7.046a1.662 1.662 0 0 0-.75-1.25c-.44-.299-.993-.448-1.66-.448-.477 0-.89.075-1.238.227a1.91 1.91 0 0 0-.813.613c-.189.258-.284.552-.284.881 0 .277.065.515.194.716.132.201.304.369.516.506.216.132.447.244.694.335.246.087.483.159.71.216l1.136.295c.371.091.752.214 1.142.37.39.155.752.36 1.086.613.333.254.602.568.806.944.209.374.313.823.313 1.346 0 .659-.17 1.244-.511 1.756-.338.511-.828.915-1.472 1.21-.64.295-1.415.443-2.324.443-.871 0-1.625-.138-2.261-.415-.637-.276-1.135-.668-1.495-1.176-.36-.511-.558-1.117-.596-1.818h1.761c.034.421.17.771.41 1.051.242.277.55.483.925.62.38.132.794.198 1.245.198.496 0 .937-.077 1.324-.233.39-.159.697-.378.92-.659a1.56 1.56 0 0 0 .335-.994c0-.345-.098-.627-.295-.847a2.191 2.191 0 0 0-.79-.545 7.725 7.725 0 0 0-1.12-.381l-1.374-.375c-.932-.253-1.67-.627-2.216-1.119-.542-.492-.813-1.144-.813-1.955 0-.67.182-1.255.546-1.755.363-.5.856-.888 1.477-1.165.621-.28 1.322-.42 2.102-.42.788 0 1.483.138 2.085.414.607.277 1.084.658 1.432 1.142.349.481.53 1.034.546 1.659h-1.693zm3.813 11.853v-12h1.66v1.415h.142c.098-.182.24-.393.426-.631.185-.239.443-.447.772-.625.33-.182.766-.273 1.307-.273.705 0 1.334.178 1.887.534.553.356.987.869 1.3 1.54.319.67.478 1.477.478 2.42 0 .944-.157 1.752-.472 2.427-.314.67-.746 1.187-1.295 1.551-.55.36-1.176.539-1.88.539-.53 0-.965-.089-1.302-.267a2.457 2.457 0 0 1-.784-.625 4.667 4.667 0 0 1-.437-.636h-.103v4.631H71.08zm1.665-7.637c0 .614.09 1.152.267 1.614.178.462.436.824.773 1.085.337.258.75.387 1.239.387.507 0 .931-.135 1.273-.404.34-.273.598-.642.772-1.108.178-.466.267-.99.267-1.574 0-.575-.087-1.092-.261-1.551-.17-.458-.428-.82-.773-1.085-.34-.265-.767-.398-1.278-.398-.493 0-.91.127-1.25.381-.337.254-.593.608-.767 1.062-.175.455-.262.985-.262 1.591zm10.75 4.557a3.557 3.557 0 0 1-1.5-.307 2.523 2.523 0 0 1-1.062-.903c-.258-.394-.386-.877-.386-1.449 0-.492.094-.898.283-1.216.19-.318.446-.57.768-.756a4.036 4.036 0 0 1 1.08-.42c.397-.095.802-.167 1.215-.216l1.273-.148c.325-.041.562-.108.71-.198.148-.091.222-.239.222-.444v-.039c0-.497-.14-.881-.42-1.154-.277-.273-.69-.409-1.24-.409-.572 0-1.022.127-1.352.381-.325.25-.55.528-.676.835l-1.597-.364c.19-.53.466-.958.83-1.284.368-.329.79-.568 1.267-.716.477-.151.98-.227 1.506-.227.348 0 .718.042 1.108.125.394.08.761.227 1.102.443.345.216.627.525.847.926.22.398.33.915.33 1.552V169h-1.66v-1.193h-.068c-.11.22-.275.435-.495.648-.22.212-.501.388-.846.528s-.758.21-1.239.21zm.37-1.363c.47 0 .87-.093 1.204-.279.337-.185.593-.428.767-.727.178-.303.267-.627.267-.972v-1.125c-.06.061-.178.118-.352.171-.17.049-.365.093-.585.13-.22.034-.434.067-.642.097l-.523.068c-.33.042-.63.112-.903.21a1.553 1.553 0 0 0-.648.427c-.16.181-.239.424-.239.727 0 .42.156.738.466.954.31.212.707.319 1.188.319zm9.876 1.346c-.845 0-1.572-.191-2.182-.574a3.796 3.796 0 0 1-1.398-1.596c-.325-.678-.488-1.455-.488-2.33 0-.886.166-1.668.5-2.346a3.832 3.832 0 0 1 1.409-1.597c.606-.383 1.32-.574 2.142-.574.663 0 1.254.123 1.773.369.519.243.937.584 1.255 1.023.322.44.514.953.574 1.54h-1.653c-.091-.409-.3-.761-.625-1.057-.322-.295-.754-.443-1.296-.443a2.11 2.11 0 0 0-1.244.375c-.352.246-.627.598-.824 1.057-.197.454-.295.992-.295 1.613 0 .637.096 1.186.29 1.648.193.462.466.82.818 1.074.356.254.774.381 1.255.381.322 0 .614-.059.875-.177.266-.121.487-.293.665-.517.182-.223.309-.492.38-.806h1.654a3.211 3.211 0 0 1-.55 1.511 3.165 3.165 0 0 1-1.234 1.045c-.511.254-1.111.381-1.8.381zm9.163 0c-.859 0-1.6-.184-2.221-.551a3.732 3.732 0 0 1-1.432-1.563c-.333-.674-.5-1.464-.5-2.369 0-.894.167-1.682.5-2.363a3.887 3.887 0 0 1 1.409-1.597c.606-.383 1.314-.574 2.125-.574.493 0 .97.082 1.432.244.462.163.877.419 1.244.767.368.349.657.802.87 1.358.212.553.318 1.226.318 2.017v.603H99.71v-1.273h5.273c0-.447-.091-.843-.273-1.187a2.052 2.052 0 0 0-.767-.824c-.326-.201-.708-.302-1.148-.302a2.22 2.22 0 0 0-1.25.353 2.364 2.364 0 0 0-.818.909 2.626 2.626 0 0 0-.284 1.21v.994c0 .584.102 1.08.307 1.489.208.409.498.722.869.938.372.212.805.318 1.301.318a2.7 2.7 0 0 0 .881-.137c.265-.094.494-.234.688-.42.193-.186.341-.415.443-.688l1.608.29c-.129.474-.36.888-.693 1.244-.33.353-.745.627-1.245.824-.496.194-1.062.29-1.699.29z",fill:"#fff"}),(0,N.jsx)("path",{d:"M117.604 47.263L121.523 45h14.267v41.862h-14.267l-15.335-8.854V53.854l1.818-1.05 3.2 1.848-1.818 1.05V76.16l12.993 7.502h10.209V48.2h-10.209l-1.577.91-3.2-1.847z",fill:"url(#e)"}),(0,N.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.402 76.16V55.701L106.409 48.2H96.2v35.462h10.209l1.582-.913 3.2 1.847-3.924 2.266H93V45h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047z",fill:"url(#f)"}),(0,N.jsxs)("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[(0,N.jsx)("path",{d:"M50.928 216.089l1.034 2.852h-2.503l1.028-2.842a4.95 4.95 0 0 0 .107-.338 7.17 7.17 0 0 0 .111-.409c.075.297.15.542.223.737zm2.28 5.591h.796l-2.775-7.352h-1.043l-2.774 7.352h.795a.338.338 0 0 0 .223-.077.425.425 0 0 0 .127-.179l.615-1.705h3.07l.617 1.705a.399.399 0 0 0 .126.184.339.339 0 0 0 .223.072zm4.823-.963a2.023 2.023 0 0 1-.67.098h-1.455v-2.453h1.456c.5 0 .871.106 1.11.318.24.208.36.495.36.86 0 .184-.028.355-.083.512a1.005 1.005 0 0 1-.262.399 1.2 1.2 0 0 1-.456.266zm-2.125-3.128v-2.406h1.237c.498 0 .865.095 1.101.286.236.192.355.497.355.917 0 .369-.125.662-.374.881-.246.215-.623.322-1.13.322h-1.189zm2.358-3.128a4.106 4.106 0 0 0-1.12-.133h-2.27v7.352h2.507c.391 0 .74-.051 1.048-.154.307-.102.566-.247.776-.435.21-.188.37-.409.48-.665.11-.26.165-.547.165-.861 0-.904-.506-1.462-1.518-1.674.22-.075.41-.169.572-.281a1.79 1.79 0 0 0 .403-.379c.106-.144.186-.297.237-.461.052-.164.078-.335.078-.512a2.1 2.1 0 0 0-.146-.804 1.49 1.49 0 0 0-.441-.609 2.073 2.073 0 0 0-.771-.384zm7.535.778h-2.212v6.441h-1.028v-6.441h-2.222v-.911H65.8v.911zm2.439.564h-1.13v1.193h1.13v-1.193zm-1.13 2.983h1.13v1.193h-1.13v-1.193z",fillOpacity:".8"}),(0,N.jsx)("path",{d:"M28.247 221.771V214h3.894c.99.072 1.765.944 1.765 1.998v3.77c0 1.106-.85 2.003-1.897 2.003h-3.762zM36.355 214h-1.011v7.783h1.01V214zm-7.097 6.704v-5.642h2.751c.49 0 .886.419.886.936v3.77c0 .517-.396.936-.886.936h-2.75zM37.775 214v7.771h3.762c1.047 0 1.897-.897 1.897-2.003v-3.77c0-1.054-.774-1.926-1.765-1.998h-3.894zm6.946 1.803h1.13v1.193h-1.13v-1.193zm1.13 2.983h-1.13v1.193h1.13v-1.193zm-7.065-3.724v5.642h2.75c.49 0 .887-.419.887-.936v-3.77c0-.517-.397-.936-.886-.936h-2.751z"})]}),(0,N.jsx)("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),(0,N.jsx)("path",{d:"M192.064 213.333l.976-.564h3.554v10.427h-3.286a1 1 0 0 1-.5-.134l-3.588-2.071v-6.016l.453-.262.797.46-.453.262v5.096l3.237 1.868h2.543v-8.833h-2.543l-.393.227-.797-.46z",fill:"#fff"}),(0,N.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.512 220.531v-5.096l-3.237-1.869h-2.543v8.833h2.543l.394-.227.797.46-.977.564h-3.554v-10.427h3.554l3.82 2.206v6.016l-.452.261-.797-.461.452-.26z",fill:"#fff"})]})]}),(0,N.jsxs)("defs",{children:[(0,N.jsxs)("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,N.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,N.jsx)("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),(0,N.jsx)("feOffset",{dy:"2"}),(0,N.jsx)("feGaussianBlur",{stdDeviation:"2"}),(0,N.jsx)("feComposite",{in2:"hardAlpha",operator:"out"}),(0,N.jsx)("feColorMatrix",{values:"0 0 0 0 0.0631944 0 0 0 0 0.242785 0 0 0 0 0.403472 0 0 0 0.2 0"}),(0,N.jsx)("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),(0,N.jsx)("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),(0,N.jsx)("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:(0,N.jsx)("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),(0,N.jsxs)("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[(0,N.jsx)("stop",{stopColor:"#101010"}),(0,N.jsx)("stop",{offset:"1",stopColor:"#272727"})]}),(0,N.jsxs)("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[(0,N.jsx)("stop",{stopColor:"#fff",stopOpacity:".4"}),(0,N.jsx)("stop",{offset:"1",stopColor:"#fff"})]}),(0,N.jsxs)("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[(0,N.jsx)("stop",{stopColor:"#fff"}),(0,N.jsx)("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),(0,N.jsxs)("radialGradient",{id:"h",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(17 -8.76924 6.97565 13.52294 183.166 221)",children:[(0,N.jsx)("stop",{stopColor:"#016BED"}),(0,N.jsx)("stop",{offset:".699",stopColor:"#4498FB"}),(0,N.jsx)("stop",{offset:"1",stopColor:"#9DFFE8"})]}),(0,N.jsx)("clipPath",{id:"g",children:(0,N.jsx)("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),(0,N.jsx)("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAACABAMAAACSOBo+AAAAG1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUUeIgAAAACXRSTlMSFhkOHAsfCCOMH5MiAAAjjElEQVRo3hTQO3sjRRBG4a+qWzJhVfdIJqzuGXsJe2bkJe0e2UA4shdIJS2X1LBcUpbL/wae5yQnfVHGjp2+V08yKR7OwBDYte8pi5Aq9DObSBouqN9cidZyusonzWtGJO13phLebEn6xKEnlYyXe5hnySc53Ym9Abn7crTse8r7BMeIB8yBOVZK0trMjxT5S/cgc9G63BQqZoF3xSYZYeRk2hoIvEBFA7XMtaaF8TdY1GjiDDqgEswRDlWnRtmYzl5zRUq3sx3I+JL7sBJKXchDGJY9D+SfHAIoA+TuHCyYYYFjkhNB8tO5hhju0ANjdCITLx4/JDL+yyP0ErZR+m3M322bY8OKHzoOcAXLQMBHiIh+X59pv6udCJ7MAV9HARPtTEuFSdAzNVn7uPmkk3TpBGHb8DJZ3p36ScsuJVFQP6CUBXimN3BABZJUiEwBOMsHUisZiXU8k3bVSTrPcHsKEEg8gV/vP7U26vRWhl2UnfEbX3VlVbRHgSwmcy2tWTjsxmIb4YjgbAkmpyEOINs1gCtSC4YsjwnY9l1MJYRz1NMk5NAC3MffnLwiHnNH7IoyER5VEI6S4Um++uKyho0BwmD+1rA90yarpO4ZpjLgs8+BTUfU9w+gkwEi6ftxqyB9Wt6IBstE0E8kxJLeKaVhNA/uEwIslv1JmRwcSzAo+URPCF5M8AGzEF8yG+QVBFl53FqhfYqd7/PM6AmJouW4cVge9pZuMJga2NQH918Sp4VIXddVCKizUTFu3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D5yKI7vD/4iAW9KWHB7JsEZeCE1E/mdgVHZTOci8X+YIanJt7+aBd2k8f2RL45Z2puefelcXjUWbKdMSYwr58dAPaHymSU0o9/zjFt7/VoGmNAwCyvrKe2L1hYJqtd5gh6FGiCAGzqFk6on9pQdSAQzkctDTtXGbDih5iRPVIk9TwCJGwP3tpATkHsNwloUilnNMFce7twgDgrgWhsE8jWW+EBLlTDMn9pmtJOefTJc6Cxld039TN4XiwL4pMtU+8tXJ4g/LghG5APdF7/e3FSi4v8vnEBiIEm+5LlZtsk2LbbbY5hN9JkkJkd5BjQFPoUcwjJdTm0mx0024NmOvVgxASvU9TonFxUqG8cUTy3m5s3i7BqLbFkKcfxLQYhAXfjam0yFFd3PZE9wlXWfHYKlg2cFlTcnwRH6z8DpSfQHidMhElmCMb07li9ceHQHFknk/98f4KJRLpX6xQEXVAnJxlr8Aw6/qb0wu9SNolstScB0izxmMC5DiytBJd9Rcm3RGf42aiddmUTM4d4dgdjiT+vMPX0/RzfZdLoZ4aQqPzhx9plNI3QyvsMZHn2j2wOECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]})};function Kn(){const{t:e}=(0,i.PE)();return(0,N.jsx)(d.Z,{children:(0,N.jsxs)(d.Z,{minHeight:"40vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[(0,N.jsx)(Vn,{style:{width:200,height:250}}),(0,N.jsx)(Pe.Z,{marginTop:"24px",marginBottom:"24px",children:e("storage.spaces.connect.providerForStorage")})]})})}Vn.defaultProps={width:"228",height:"258",viewBox:"0 0 228 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},Kn.propTypes={};const Hn=Kn;var Jn=t(19654),_n=t(39565),Qn=t(84584),Yn=t(17450),Xn=t(47595),$n=t(60939),et=t(72443),nt=t.n(et);function tt(e){let{spaceGateway:n,onDeleteSpace:t}=e;const{t:l}=(0,i.PE)(),[r,a]=(0,o.useState)(!1),[s,c]=(0,o.useState)(!1),d=(e,n)=>{null===e||void 0===e||e.stopPropagation(),a(n)};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(f.Z,{size:"small",onClick:e=>d(e,!0),children:(0,N.jsx)(Xn.default,{})}),(0,N.jsx)($n.Z,{title:l("common.delConfirmDescription",{data:"".concat(null===n||void 0===n?void 0:n.name)}),open:r,confirmButton:{text:l("common.confirm"),props:{variant:"contained",color:"error",loading:s}},cancelButton:{text:l("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:async e=>{try{null===e||void 0===e||e.stopPropagation(),c(!0),await t(n),a(!1)}catch(o){console.error(o),P.Z.error("".concat(l("storage.spaces.gateway.delete.failed"),": ").concat(nt()(o)))}finally{c(!1)}},onCancel:e=>d(e,!1)})]})}tt.propTypes={onDeleteSpace:s().func,spaceGateway:s().shape({name:s().string.isRequired,url:s().string.isRequired,protected:s().bool}).isRequired},tt.defaultProps={onDeleteSpace:()=>{}};const ot=tt;var it,lt=function(e){return(0,N.jsx)("svg",{...e,children:(0,N.jsx)("circle",{cx:"4",cy:"4",r:"4",fill:"#25C99B"})})};function rt(e){let{spaceGateway:n,connected:t,onDisconnect:o,...l}=e;const r=zn(),{t:a}=(0,i.PE)();return(0,N.jsxs)(at,{style:{position:"relative"},children:[(0,N.jsxs)(d.Z,{sx:{backgroundColor:t?"#F0FDFF":"inherit","&:hover":{backgroundColor:t?"#F0FDFF":"#FBFBFB"},borderRadius:"8px"},display:"flex",padding:"12px 20px",...l,children:[(0,N.jsx)(d.Z,{display:"flex",children:(0,N.jsx)(_n.Z,{alt:n.did,src:(0,Qn.Jf)(n.endpoint)})}),(0,N.jsxs)(d.Z,{className:"spaces-info",display:"flex",flexGrow:1,flexDirection:"column",sx:{marginLeft:"20px",padding:"0px 0px"},children:[(0,N.jsxs)(d.Z,{className:"spaces-info",display:"flex",maxWidth:"360px",alignItems:"center",children:[(0,N.jsx)(Pe.Z,{color:t?"primary":"inherit",fontSize:"1rem",fontWeight:"bold",children:n.name}),(0,N.jsx)(Jn.Z,{label:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(lt,{style:{marginRight:"4px"}}),a("storage.spaces.connected.tag")]}),variant:"outlined",size:"small",style:{marginLeft:r?null:"20px",fontWeight:"bold"}})]}),(0,N.jsx)(d.Z,{className:"spaces-address",display:"flex",color:"#9397A1",marginTop:"8px",children:(0,N.jsx)(Pe.Z,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},color:"#9397A1",children:n.did&&(0,N.jsx)(Yn.Z,{copyable:!1,size:14,compact:!0,responsive:!1,did:n.did})})})]}),(0,N.jsx)(d.Z,{className:"spaces-backup",display:"flex",alignItems:"center",children:(0,N.jsx)(d.Z,{className:"backup-strategy",display:"flex",alignItems:"center",width:"100%",children:(0,N.jsx)(ot,{spaceGateway:n,onDeleteSpace:async()=>{try{await o(),P.Z.success(a("storage.spaces.gateway.delete.succeeded",{name:n.name}))}catch(e){console.error(e),P.Z.error((0,F.Z)(e))}}})})})]}),(0,N.jsx)(d.Z,{className:"selected-container selected",children:(0,N.jsx)(Te.default,{className:"selected-icon"})})]})}lt.defaultProps={width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt.propTypes={spaceGateway:s().shape({did:s().string.isRequired,name:s().string.isRequired,url:s().string.isRequired,endpoint:s().string.isRequired,protected:s().bool}).isRequired,connected:a.bool,onDisconnect:a.func},rt.defaultProps={connected:!1,onDisconnect:()=>{}};const at=(0,r.Z)(d.Z)(it||(it=(0,l.Z)(["\n .selected-container {\n position: absolute;\n right: 0px;\n bottom: 0px;\n display: flex;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 32px;\n height: 32px;\n border-radius: 0px 0px 8px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.4s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 60px;\n top: 60px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 16px;\n border-style: solid;\n border-color: transparent #1dc1c7 #1dc1c7 transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n\n .selected-container.selected {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n"]))),st=rt;var ct=t(65873),dt=t(41899);const pt=(0,o.createContext)({}),{Provider:mt,Consumer:ut}=pt;function ht(e){let{children:n}=e;const[t,i]=(0,o.useState)(!1),[l,r]=(0,o.useState)(null),{blocklet:a,actions:{refreshBlocklet:s}}=(0,Be.y0)(),{storageEndpoint:c}=function(){const[e,n]=(0,o.useState)(null),{blocklet:t}=(0,Be.y0)();return(0,o.useEffect)((()=>{n((0,Qn.EJ)(t))}),[t]),{storageEndpoint:e}}(),{api:d}=(0,O.h6)();(0,dt.Z)((async()=>{try{if(i(!0),(0,ct.isEmpty)(c))return void r(null);const e=await(0,Qn.UV)(c);r(e)}catch(e){console.error(e),P.Z.error(e.message)}finally{i(!1)}}),[c]);const p=async e=>{await d.configBlocklet({input:{did:[a.meta.did],configs:[{key:H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:e}]}}),s()};(0,o.useEffect)((()=>{!async function(){if(!l)return;const e=await(0,Qn.nU)(l.endpoint,l.name),n=(0,ct.merge)(l,{name:e});r(n)}()}),[]);const m=Boolean(c&&l);return(0,N.jsx)(mt,{value:{loading:t,spaceGateway:l,deleteSpaceGateway:()=>{r(null),s()},updateSpaceGateway:async e=>{r(e),await p(e.endpoint),s()},storageEndpoint:c,settingStorageEndpoint:p,hasStorageEndpoint:m},children:n})}function ft(){return(0,o.useContext)(pt)}ht.propTypes={children:a.node.isRequired},ht.defaultProps={};const xt=function(){const{t:e}=(0,i.PE)(),{spaceGateway:n,settingStorageEndpoint:t}=ft();return(0,N.jsxs)(d.Z,{display:"flex",flexDirection:"column",children:[(0,N.jsx)(d.Z,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",children:(0,N.jsx)(Pe.Z,{fontSize:"1.2rem",fontWeight:"bold",children:e("storage.spaces.connected.title")})}),(0,N.jsx)(d.Z,{children:(0,N.jsx)(st,{style:{marginTop:"12px"},spaceGateway:n,connected:!0,onDisconnect:()=>t(null)},n.endpoint)})]})};var gt=t(55372),yt=t(17682),vt=t(56277);function bt(e){let{onConnect:n,...t}=e;const{blocklet:l}=(0,Be.y0)(),{info:r}=(0,O.h6)(),{t:a,locale:s}=(0,i.PE)(),[c,p]=(0,o.useState)(""),[m,u]=(0,o.useState)(!1),[h,f]=(0,o.useState)(!1),[x,g]=(0,o.useState)(""),y=(0,vt.Z)({blocklet:l}),v=(0,F.yP)(r),{storageEndpoint:b}=ft(),[j,k]=(0,o.useState)({open:!1,action:"connect-to-did-spaces",checkTimeout:3e5,prefix:"/api/did",checkFn:sn.od.create({baseURL:on()(window.location.origin,(0,F.Y5)())}).get,messages:{title:a("storage.spaces.provideNFT.title",{appName:y.appName},s),scan:a("storage.spaces.provideNFT.scan",{appName:y.appName},s),confirm:"",success:(0,N.jsx)(Pe.Z,{gutterBottom:!0,children:a("storage.spaces.provideNFT.success")})},onClose:()=>{k((e=>({...e,open:!1})))}}),[C,Z]=(0,o.useState)({open:!1,action:"one-click-authorization",checkTimeout:3e5,messages:{title:a("storage.spaces.authorize.title",{appName:y.appName},s),scan:a("storage.spaces.authorize.scan",{appName:y.appName},s),confirm:"",success:(0,N.jsx)(Pe.Z,{gutterBottom:!0,children:a("storage.spaces.authorize.success")})},onClose:()=>{Z((e=>({...e,open:!1})))}}),E=async e=>{let{did:t,name:o,endpoint:i}=e;const l=await(0,Qn.Z3)(i);if(!await(0,Qn.w2)(l))return void P.Z.error(a("storage.spaces.gateway.add.invalidUrl"));const r={name:o,did:t,url:l,endpoint:i};await n(r),P.Z.success(a("storage.spaces.connectedWithName",{name:r.name}))},S=(e,n)=>{setTimeout((async()=>{if(Z((e=>({...e,open:!1}))),p(null),k((e=>({...e,open:!1}))),!we()(e.spaceGateway))return void await E(n(e.spaceGateway));const t=n(e.endpoint),o=e.space?n(e.space):{};await E({endpoint:t,did:(0,Qn.LQ)(t),name:"DID Space",...o})}),0)},T=async()=>{try{u(!0);const e=await(0,Qn.Z3)(c),n=(0,Qn.ag)(e),t=new URL(e).searchParams.get("spaceDid");if(!await(0,Qn.w2)(n))throw new Error(a("storage.spaces.gateway.add.invalidUrl"));Z((e=>({...e,open:!0,prefix:on()(n,"space/api/did"),baseUrl:new URL(n).origin,checkFn:sn.od.create({baseURL:on()(n,"space")}).get,extraParams:{appDid:y.appDid,appName:y.appName,appDescription:y.appDescription,scopes:y.scopes,appUrl:y.appUrl,referrer:y.referrer,nodeDid:r.did,spaceDid:t}}))),f(!1)}catch(e){const n="".concat(a("storage.spaces.gateway.add.failed",s),": ").concat((0,F.Z)(e));g(n)}finally{u(!1)}};return(0,N.jsxs)(d.Z,{children:[(0,N.jsx)(yt.Z,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:()=>{k((e=>({...e,open:!0,extraParams:{appPid:l.appPid,referrer:window.location.href}})))},variant:"outlined",menu:[(0,N.jsx)(yt.Z.Item,{sx:{textTransform:"none"},onClick:()=>f(!0),size:"small",...t,children:a(b?"storage.spaces.connect.useSpaceGatewayReconnect":"storage.spaces.connect.useSpaceGateway")},"1")],children:(0,N.jsx)(Pe.Z,{sx:{fontWeight:"bold",textTransform:"none"},children:a(b?"storage.spaces.connect.useWalletReconnect":"storage.spaces.connect.useWallet")})}),(0,N.jsx)(ln.Z,{forceConnected:!1,saveConnect:!1,prefix:j.prefix,open:j.open,popup:!0,action:j.action,webWalletUrl:v,baseUrl:j.baseUrl,checkFn:j.checkFn,onSuccess:S,onClose:j.onClose,checkTimeout:j.checkTimeout,extraParams:j.extraParams,messages:j.messages,locale:s}),(0,N.jsx)(ln.Z,{forceConnected:!1,saveConnect:!1,prefix:C.prefix,open:C.open,popup:!0,action:C.action,baseUrl:C.baseUrl,checkFn:C.checkFn,onSuccess:S,onClose:C.onClose,checkTimeout:C.checkTimeout,extraParams:C.extraParams,messages:C.messages,locale:s}),(0,N.jsxs)(q.ZP,{title:a("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:h,onClose:()=>f(!1),PaperProps:{style:{minHeight:"auto"}},actions:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(R.Z,{onClick:e=>{e.stopPropagation(),f(!1)},color:"inherit",children:a("common.cancel")}),(0,N.jsxs)(R.Z,{onClick:T,color:"primary",disabled:m||!c,variant:"contained",autoFocus:!0,children:[m&&(0,N.jsx)(w.Z,{size:16}),a("common.confirm")]})]}),children:[(0,N.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,N.jsx)(gt.Z,{component:"div",children:(0,N.jsx)(Pe.Z,{component:"div",children:(0,N.jsx)(V.Z,{label:a("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:c,onChange:e=>{g(null),p(e.target.value)},disabled:m,onKeyPress:async e=>{"Enter"===e.key&&await T()},autoFocus:!0})})})}),Boolean(x)&&(0,N.jsx)(Ne.Z,{type:"error",style:{width:"100%"},children:x})]})]})}bt.propTypes={onConnect:a.func},bt.defaultProps={onConnect:()=>{}};const jt=bt;var kt;function Ct(e){var n;let{blockletMeta:t,onEndpointUpdate:i}=e;const l=zn(),{blocklet:r}=(0,Be.y0)(),{updateSpaceGateway:a,loading:s,hasStorageEndpoint:c}=ft();return(0,o.useEffect)((()=>{null===i||void 0===i||i()}),[r]),s?(0,N.jsx)(An.Z,{relative:"parent",children:(0,N.jsx)(w.Z,{})}):(0,N.jsxs)(Zt,{children:[(0,N.jsx)(d.Z,{width:l?"360px":"720px",children:c?(0,N.jsx)(xt,{}):(0,N.jsx)(Hn,{})}),"required"===(null===t||void 0===t||null===(n=t.capabilities)||void 0===n?void 0:n.didSpace)&&(0,N.jsx)(Mn,{mt:8,children:(0,N.jsx)(jt,{onConnect:a})})]})}Ct.propTypes={blockletMeta:s().any.isRequired,onEndpointUpdate:a.func},Ct.defaultProps={onEndpointUpdate:()=>{}};const Zt=(0,r.Z)(Wn.Z)(kt||(kt=(0,l.Z)(["\n height: 100%;\n overflow-y: auto;\n padding-bottom: 32px;\n overflow-x: hidden;\n"]))),wt=Ct;var Rt,Et,St,Pt,Tt,It,Ut;const Nt=e=>e.inStore&&!1===(0,S.isFreeBlocklet)(e),Dt=e=>{var n;return[H.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,H.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(null===e||void 0===e||null===(n=e.capabilities)||void 0===n?void 0:n.didSpace)},At=e=>{var n,t;return(null===e||void 0===e||null===(n=e.configs)||void 0===n||null===(t=n.find((e=>e.key===H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)))||void 0===t?void 0:t.value)||null},Bt=e=>(e.environments||[]).some((e=>e.required)),Lt=(e,n)=>null===e||void 0===e?void 0:e.some((e=>e.required&&!n[e.key])),Ot=e=>{let{params:n,blocklet:t,t:o}=e;const i=n.title||n.name;if(!i)return o("common.next");return o(((null===t||void 0===t?void 0:t.children)||[]).find((e=>e.meta.bundleDid===n.bundleDid))?"blocklet.component.upgradeNext":"blocklet.component.addNext",{name:i})},Ft=(0,o.forwardRef)(((e,n)=>{let{meta:t,isMobile:l,onStepChange:r}=e;const{steps:a,activeStep:s,setActiveStepByKey:c,setActiveStepByIndex:d}=(0,Ue.s)(),{t:p,locale:m}=(0,i.PE)(),u=a[s];return(0,o.useEffect)((()=>{r(s)}),[r,s]),(0,o.useImperativeHandle)(n,(()=>({setActiveStepByKey:c,setActiveStepByIndex:d}))),(0,N.jsx)(Kt,{component:"div",className:l?"mobileStyle":"",sx:{height:"calc(100% - 56px)"},children:(0,N.jsx)(Ie.Z,{locale:m,blockletMeta:{title:" ",...t},pcWidth:"100%",pcHeight:"100%",logoUrl:t&&t.logo&&t.registryUrl?(0,F.aZ)({did:t.did,baseUrl:t.registryUrl,logoPath:t.logo}):null,stepTip:p("blocklet.component.add"),children:(0,N.jsx)(Wt,{children:null!==u&&void 0!==u&&u.body&&"function"===typeof u.body?u.body():u.body})})})}));Ft.propTypes={meta:s().any,onStepChange:s().func.isRequired,isMobile:s().bool.isRequired},Ft.defaultProps={meta:null};const zt=function(e){setTimeout((()=>{window.parent.postMessage({event:"component.installed",componentDid:e},"*")}),arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3)};function Mt(e){var n,t,l,r,a,s,c;let{onClose:p,mode:m,stores:u,resourceType:h,resourceDid:f,storageKey:x,inDialog:g,selectedMeta:y}=e;const{t:v,locale:b}=(0,i.PE)(),[j,k]=(0,o.useState)(!1),[C,E]=(0,o.useState)(null),[T,I]=(0,o.useState)(""),[U,D]=(0,o.useState)(""),{api:A,ws:{useSubscription:B},inService:L,info:z}=(0,O.h6)(),{blocklet:M,actions:{refreshBlocklet:q}}=(0,Be.y0)(),[G,W]=(0,o.useState)(null),[K,J]=(0,o.useState)(!1),_={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[Q,Y]=(0,o.useState)(_),[X,$]=(0,o.useState)(0),ee=(0,o.useRef)({}),ne=(0,o.useRef)({}),te=(0,o.useRef)({}),oe=(0,ge.Z)((e=>e.breakpoints.down("md"))),ie=(0,ve.useParams)(),[re,ae]=(0,o.useState)(!0),{meta:se}=ee.current,ce=z.mode===Z.NODE_MODES.SERVERLESS,de=e=>Y((n=>({...n,...e})));(0,o.useEffect)((()=>{if(Q.pathPrefix){const{errMsg:e}=ke({...Q,pathPrefix:Q.pathPrefix,locale:b});I(e)}}),[Q.pathPrefix]),(0,o.useEffect)((()=>{0===X&&Y(_)}),[X]);const pe=()=>{var e;const n=null!==(e=At(M))&&void 0!==e?e:"";de({didSpaceEndpoint:n})},me=()=>{var e;return null!==ee&&void 0!==ee&&null!==(e=ee.current)&&void 0!==e&&e.meta?(0,S.getDisplayName)(ee.current):""},ue=e=>{const n=t=>{de({installResultProps:{variant:"error",title:me(),subTitle:e,footer:(0,N.jsx)(R.Z,{className:"bottom-button",disabled:t,"data-cy":"retry-install-component",onClick:async()=>{n(!0),await be(ee.current.installInput)},children:(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[t&&(0,N.jsx)(w.Z,{size:16,style:{marginRight:8}}),v("common.retry")]})})}})};n()},he=e=>n=>{var t,o;((null===n||void 0===n||null===(t=n.meta)||void 0===t?void 0:t.did)||(null===n||void 0===n?void 0:n.meta))===(null===M||void 0===M||null===(o=M.meta)||void 0===o?void 0:o.did)&&e(n)};B(H.BlockletEvents.statusChange,he((e=>{if(e.status===H.BlockletStatus.upgrading)de({installResultProps:{variant:"success",title:me(),subTitle:v("blocklet.component.installSuccessTip")}}),zt(ie.componentDid);const n=At(M);de((e=>({...e,didSpaceEndpoint:n})))})),[null===M||void 0===M||null===(n=M.meta)||void 0===n?void 0:n.did]),B(H.BlockletEvents.downloadFailed,he((()=>{ue(v("blocklet.component.installComponentError"))})),[null===M||void 0===M||null===(t=M.meta)||void 0===t?void 0:t.did]),B(H.BlockletEvents.installFailed,he((()=>{ue(v("blocklet.component.installComponentError"))})),[null===M||void 0===M||null===(l=M.meta)||void 0===l?void 0:l.did]);const fe=()=>{k(!1),Y({}),ee.current={},p()},ye=e=>((null===M||void 0===M?void 0:M.children)||[]).some((n=>n.meta.did===e)),be=async e=>{var n,t;const{pathPrefix:o,bundleDid:i,title:l,componentName:r="",componentDid:a=""}=Q,{configs:s=[],registryUrl:c,inStore:d,inputUrl:p}=(null===(n=ee.current)||void 0===n?void 0:n.meta)||{},m=null===(t=ee.current)||void 0===t?void 0:t.downloadTokenList,u=d?(0,F.Rn)(c,i):p;k(!0);const h={rootDid:M.meta.did,url:u,mountPoint:le()(o),title:l,name:r,did:a,onlyRequired:!re,...Q.hasEnvironmentsStep&&s.length>0?{configs:s.map((e=>({...e,value:Q.configsValue[e.key]||""})))}:{},...m?{downloadTokenList:m}:{},...e};try{if(await A.installComponent({input:h}),c){const{teamDid:e,storeList:n}=(0,F.dX)({fromBlocklet:L,nodeInfo:z,blocklet:M}),{isNew:t,decoded:o}=(0,F.bQ)(c,n);t&&await A.addBlockletStore({input:{teamDid:e,url:o}})}de({installResultProps:{}}),q({showError:!1,attachRuntimeInfo:!1})}catch(f){const e=(0,F.Z)(f);P.Z.error(e),console.error("installComponent error: ",f),ue(e)}finally{k(!1),ee.current.installInput=h}},ke=e=>({errMsg:(0,hn.Rw)({params:{...e,did:e.bundleDid},blocklets:[M],blocklet:M,locale:b})}),Ze=async e=>{var n,t;const{errMsg:o}=ke({...Q,locale:b});I(o),X===Ie.length-2&&await be(e),null===(n=ne.current)||void 0===n||null===(t=n.setActiveStepByIndex)||void 0===t||t.call(n,(e=>e+1))},Re=()=>{var e,n;null===(e=ne.current)||void 0===e||null===(n=e.setActiveStepByIndex)||void 0===n||n.call(e,(e=>e-1))},Pe=e=>{var n,t;let{chooseParams:o=ee.current,componentDid:i,isInit:l=!1}=e;const{meta:r,registryUrl:a,inStore:s,inputUrl:c}=o,{did:d,title:p,name:m}=r,u=((null===(n=M.settings)||void 0===n?void 0:n.children)||[]).filter((e=>"deleted"===e.status&&e.meta.bundleDid===d)),h=i||"",f=null===(t=r.environments)||void 0===t?void 0:t.map((e=>{const{name:n,validation:t,...o}=e;return{...o,key:n,...{validation:Ee()(t)?"":t}}}));ee.current={...o,meta:{...r,configs:f,registryUrl:a,inStore:s,inputUrl:c}};let x={};if(l){const e=[M],n=f||[],t=[],o=je()(Ce()([...n,...t]),"key").filter((e=>!!e.key)).sort(((e,n)=>e.required&&!n.required?-1:n.required&&!e.required?1:0)),i=(0,S.getSharedConfigObj)(e[0],{configs:o}),l={},r=o.map((e=>{const{default:n,key:t,...o}=e;return l[t]=i[t]||n,{...o,key:t,hidden:!!H.BLOCKLET_CONFIGURABLE_KEY[t]}}));x={...x,configsList:r,configsValue:l,hasMissRequiredConfigs:Lt(r,l)}}const g=M.children.some((e=>"/"===e.mountPoint)),y=u.find((e=>e.meta.bundleDid===d)),v=M.children.find((e=>e.meta.bundleDid===d));if(x.title=p||"",y)x={...x,pathPrefix:y.mountPoint||"",componentName:y.meta.name,hasEnvironmentsStep:!1};else if(v)x={...x,pathPrefix:v.mountPoint||"",componentName:v.meta.name,hasEnvironmentsStep:!1};else{var b,j;x={...x,pathPrefix:g?"/".concat(le()(p)||le()(m)).toLowerCase():"/",componentName:"",hasEnvironmentsStep:(null===(b=ee.current.meta)||void 0===b||null===(j=b.environments)||void 0===j?void 0:j.length)>0}}const k=Nt(ee.current.meta),C=Dt(ee.current.meta),Z=At(M);de({bundleDid:d,componentDid:h,...x,hasRequiredEnvironments:Bt(ee.current.meta),requirePurchase:k,didSpaceIsRequiredSetup:C,didSpaceEndpoint:Z}),l&&k&&(()=>{const{pathPrefix:e,bundleDid:n,title:t,componentName:o="",componentDid:i=""}=Q,{meta:l={}}=ee.current||{},{registryUrl:r,inStore:a,inputUrl:s}=l,c=a?(0,F.Rn)(r,n):s;W({meta:l,installOpts:{type:"component",rootDid:M.meta.did,mountPoint:e,url:c,title:t,name:o,did:i}})})()};(0,o.useEffect)((()=>{y&&0===X&&(Pe({chooseParams:{blocklets:[y],meta:y,registryUrl:y.homepage,inStore:!0},isInit:!0}),de({showFromUrlDialog:!1}),Ze())}),[y,X]);const Ie=[{key:"selectComponent",name:v("blocklet.component.selectComponent"),body:(0,N.jsxs)(Gt,{component:"div",children:[Q.showFromUrlDialog&&(0,N.jsx)(xn.Z,{mode:"component",onCancel:()=>{de({showFromUrlDialog:!1})},onSuccess:e=>{let{meta:n,inputUrl:t,inStore:o,registryUrl:i}=e;Pe({chooseParams:{meta:n,inputUrl:t,inStore:o,registryUrl:i},isInit:!0}),de({showFromUrlDialog:!1}),Ze()},handleText:{title:v("blocklet.component.addComponentTip.fromUrl"),confirm:v("blocklet.component.choose")}}),(0,N.jsx)(jn,{stores:u,extra:ce?null:(0,N.jsxs)(R.Z,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{de({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[(0,N.jsx)(xe.Z,{style:{fontSize:20,marginRight:4}})," ",v("blocklet.component.addComponentTip.fromUrl")," "]}),loading:j,onChange:()=>{Y({}),ee.current={}},storageKey:x,children:e=>{let{currentRegistry:n}=e;return(0,N.jsx)(Nn,{serverVersion:null===z||void 0===z?void 0:z.version,style:oe?{height:"calc(100vh - 56px - 80px - 32px - 40px )"}:{height:"calc(100% - 40px)"},storeUrl:n.url,resourceType:h,resourceDid:f,handleButtonClick:e=>{Pe({chooseParams:{...e,inStore:!0},isInit:!0})},handleBlockletRender:e=>{let{blocklet:n,defaultRender:t}=e;const o=(null===Q||void 0===Q?void 0:Q.bundleDid)&&(null===Q||void 0===Q?void 0:Q.bundleDid)===(null===n||void 0===n?void 0:n.did);return(0,N.jsxs)(Jt,{children:[o&&(0,N.jsx)("div",{className:"check-container",children:(0,N.jsx)(Te.default,{className:"check-icon"})}),(0,N.jsx)("div",{className:o?"choose-blocklet":"",style:{marginLeft:16},children:t})]})}})}})]}),cancel:"embed"===m?void 0:v("common.cancel"),confirm:Ot({params:Q,blocklet:M,t:v}),onCancel:fe,onConfirm:()=>{Ze()}},{key:"agreement",name:v("launchBlocklet.introduction"),body:(0,N.jsxs)(Gt,{component:"div",className:"agreement-wrapper",children:[(0,N.jsx)(Se.Z,{title:v("launchBlocklet.introduction"),subTitle:v("blocklet.component.addComponentTip.introduction")}),(0,N.jsx)(fn.Z,{meta:se,onClickNext:Ze,installRelated:re,onChangeInstallRelated:ae,handleDescEle:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)("div",{dangerouslySetInnerHTML:{__html:v("blocklet.component.addComponentTip.".concat(Q.requirePurchase?"isPurchase":"isFree"),{name:me()})}})}),(0,N.jsx)("p",{children:v("blocklet.component.addComponentTip.belowInformation")})]})})]}),cancel:v(y?"common.cancel":"common.pre"),confirm:v("launchBlocklet.next"),onCancel:y?fe:Re,onConfirm:()=>{J(!1),Ze()}},se&&Q.requirePurchase&&{key:"purchase",name:(0,N.jsxs)(N.Fragment,{children:[v("common.verifyNFT"),(0,N.jsx)(Qe.Z,{})]}),body:(0,N.jsxs)(Gt,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(2===(null===(r=te.current)||void 0===r||null===(a=r.getCurrentStep)||void 0===a?void 0:a.call(r))||K)&&(0,N.jsx)(Ht,{title:v("common.verifyNFT"),subTitle:v("blocklet.component.addComponentTip.verifyNFT")}),we()(Q.purchaseResultProps)?G&&(0,N.jsx)(mn,{ref:te,meta:G.meta,mode:Q.componentDid?"verify":"both",onCancel:e=>{J(!1),de({purchaseResultProps:{variant:"error",title:me(),subTitle:e,style:{paddingTop:120},footer:(0,N.jsx)(R.Z,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{de({purchaseResultProps:{}})},children:v("common.retry")})}})},installOpts:G.installOpts,handlePaySuccess:e=>{let{downloadTokenList:n}=e;ee.current.downloadTokenList=n,J(!1),Ze()}}):(0,N.jsx)("div",{className:"flex-align-center flex-justify-center",children:(0,N.jsx)(Ae.Z,{...Q.purchaseResultProps})})]}),disabled:2===(null===(s=te.current)||void 0===s||null===(c=s.getCurrentStep)||void 0===c?void 0:c.call(s))||K,cancel:v("common.pre"),confirm:v("common.next"),onConfirm:()=>{"function"===typeof te.current.onNext&&(te.current.onNext(),J(!0))},onCancel:()=>{Re()}},(0,S.hasStartEngine)(se)&&!ye(se.did)&&{key:"config",name:v("common.config"),error:T,body:(0,N.jsxs)(Gt,{component:"div",children:[(0,N.jsx)(Ht,{title:v("common.config"),subTitle:v("blocklet.component.addComponentTip.config")}),(0,N.jsx)(V.Z,{label:v("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:U||v("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:Q.pathPrefix,onChange:e=>{const n=e.target.value;de({pathPrefix:n}),D(v("common.slugifyHint",{value:(0,F.LN)(n)}))}}),!!T&&(0,N.jsx)(Ne.Z,{type:"error",style:{width:"100%",marginTop:8},children:T})]}),cancel:v("common.pre"),confirm:v("common.next"),onCancel:Re,onConfirm:()=>{Ze()}},se&&!ye(se.did)&&(null===Q||void 0===Q?void 0:Q.hasEnvironmentsStep)&&{key:"environment",name:(0,N.jsxs)(N.Fragment,{children:[v("common.environment")," ",Q.hasRequiredEnvironments&&(0,N.jsx)(Qe.Z,{})]}),disabled:!!C||(null===Q||void 0===Q?void 0:Q.hasMissRequiredConfigs),body:()=>(0,N.jsxs)(Gt,{component:"div",children:[(0,N.jsx)(Ht,{title:v("common.environment"),subTitle:v("blocklet.component.addComponentTip.environment")}),(0,N.jsx)(en,{style:{marginTop:-12,width:"100%"},schema:Q.configsList,defaultValue:Q.configsValue,onChange:(e,n)=>{let{action:t,currentItem:o,allValues:i}=n;"confirm"===t&&de({hasMissRequiredConfigs:Lt(Q.configsList,i),configsValue:i}),"edit"===t?E(o):["cancel","confirm"].includes(t)&&E(null)}})]}),cancel:v("common.pre"),confirm:v("common.next"),onCancel:Re,onConfirm:Ze},se&&!ye(se.did)&&(null===Q||void 0===Q?void 0:Q.didSpaceIsRequiredSetup)&&{key:"didSpace",name:(0,N.jsxs)(N.Fragment,{children:[v("blocklet.component.didSpaceConfig")," ","required"===Q.didSpaceIsRequiredSetup&&(0,N.jsx)(Qe.Z,{})]}),disabled:(null===Q||void 0===Q?void 0:Q.didSpaceIsRequiredSetup)&&!Q.didSpaceEndpoint,body:()=>(0,N.jsx)(ht,{children:(0,N.jsxs)(Gt,{component:"div",children:[(0,N.jsx)(Ht,{title:v("blocklet.component.didSpaceConfig"),subTitle:v("blocklet.component.didSpaceConfigTip")}),(0,N.jsx)(d.Z,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:(0,N.jsx)(wt,{blockletMeta:ee.current.meta,onNext:()=>{Ze()},onEndpointUpdate:pe})})]})}),cancel:v("common.pre"),confirm:v("common.next"),onCancel:Re,onConfirm:Ze},{key:"install",name:ye(null===se||void 0===se?void 0:se.did)?v("common.upgrade"):v("common.install"),disabled:!1,loading:!1,body:(0,N.jsx)(Gt,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:we()(Q.installResultProps)?(0,N.jsx)(De.Z,{message:(0,N.jsx)(_t,{children:v("blocklet.component.installingCanCloseWindowTip")}),increaseSpeed:.3,messageLoop:!1}):(0,N.jsx)("div",{style:{marginTop:120},children:(0,N.jsx)(Ae.Z,{...Q.installResultProps})})}),confirm:v("common.complete"),onConfirm:()=>{zt(ie.componentDid),fe(),setTimeout((()=>{const e=document.getElementsByClassName("dashboard-main")[0];e&&(e.scrollTop=e.scrollHeight)}),200)}}].filter((e=>e)),Le=Ie[X]||{};return M?(0,N.jsxs)(qt,{sx:oe?{width:"100%",height:window.innerHeight}:{width:"100%",height:g?"72vh":"100vh"},children:[(0,N.jsx)(Ue.W,{steps:Ie,mode:"memory",children:(0,N.jsx)(Ft,{ref:ne,meta:se,isMobile:oe,onStepChange:e=>{$(e)}})}),(0,N.jsxs)(d.Z,{className:"action-bar",children:[Le.cancel&&(0,N.jsx)(R.Z,{onClick:e=>{e.stopPropagation(),Le.onCancel()},disabled:X===Ie.length-2&&j,color:"inherit",children:Le.cancel||v("common.cancel")}),Le.confirm&&(0,N.jsx)(R.Z,{onClick:e=>{e.stopPropagation(),Le.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:j||("boolean"===typeof Le.disabled?Le.disabled:!(!j&&!Le.error&&Q.bundleDid)||X>1&&!Q.pathPrefix),variant:"contained",autoFocus:!0,title:Le.confirm,style:{marginLeft:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[("boolean"===typeof Le.loading?Le.loading:j)&&(0,N.jsx)(w.Z,{style:{marginRight:8},size:16}),Le.confirm]})})]})]}):null}Mt.propTypes={onClose:s().func,mode:s().oneOf(["normal","embed"]),inDialog:s().bool,stores:s().arrayOf(s().string),resourceType:s().string,resourceDid:s().string,storageKey:s().string,selectedMeta:s().object},Mt.defaultProps={onClose:()=>{},mode:"normal",stores:[],resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null};const qt=(0,r.Z)(d.Z)(Rt||(Rt=(0,l.Z)(["\n .action-bar {\n display: flex;\n justify-content: flex-end;\n position: sticky;\n bottom: 0;\n padding-top: 16px;\n z-index: 100;\n width: 100%;\n background: #fff;\n border-top: 1px solid #eee;\n }\n"]))),Gt=(0,r.Z)(Pe.Z)(Et||(Et=(0,l.Z)(["\n width: 100%;\n height: 100%;\n"]))),Wt=r.Z.div(St||(St=(0,l.Z)(["\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n\n .bottom-button {\n min-width: 200px;\n }\n\n // blocklet-select-side\n aside {\n width: 140px;\n }\n"]))),Vt=e=>e.isMobile?"\n height: calc(100vh - 56px - 64px - 48px);\n ":"",Kt=(0,r.Z)(d.Z)(Pt||(Pt=(0,l.Z)(["\n ","\n\n & .flex-justify-center {\n display: flex;\n justify-content: center;\n }\n\n & .flex-align-center {\n display: flex;\n height: 100%;\n align-items: center;\n ","\n }\n\n & .agreement-wrapper {\n ","\n max-height: 60vh;\n .eula-trigger {\n padding-right: 0;\n }\n .next-button {\n display: none;\n }\n }\n\n & .connect {\n background: white;\n }\n"])),(e=>{let{className:n}=e;return"mobileStyle"===n?"\n & > div{\n height: 100%;\n }\n .root-header {\n .app-name-content {\n display: none;\n }\n }\n\n\n\n // content-panel\n .root-header + div{\n padding-top: 0;\n position: relative;\n & > div {\n padding-top: 0;\n }\n }\n\n header + div {\n padding-top: 0;\n }\n\n header {\n .header-title {\n margin-left: 0;\n }\n\n .header-title-name {\n max-width: 100% !important;\n }\n }\n ":"\n position: relative;\n .root-header {\n z-index: auto !important;\n position: fixed !important;\n }\n & > div {\n height: 100%;\n width: 100%;\n max-width: 100%;\n & > div {\n max-height: unset !important;\n max-width: 100%;\n & > div {\n // left-panel\n &:first-child {\n padding: 0;\n width: 25%;\n min-width: 240px;\n & > div:first-child {\n display: none;\n }\n // step\n & > div:last-child {\n // margin-top: 32px;\n margin-top: 0;\n }\n }\n // right-panel\n &:last-child {\n padding-top: 0;\n padding-right: 0px;\n overflow-y: hidden;\n .app-content {\n padding: 0 0 24px 0;\n }\n .button-container {\n padding-right: 0;\n }\n }\n }\n }\n }\n\n "}),(e=>Vt(e)),(e=>Vt(e))),Ht=(0,r.Z)(Se.Z)(Tt||(Tt=(0,l.Z)(["\n margin-bottom: 24px;\n"]))),Jt=r.Z.div(It||(It=(0,l.Z)(["\n position: relative;\n\n .choose-blocklet {\n background-color: rgb(236, 251, 253);\n border-color: rgb(236, 251, 253);\n border-radius: 8px;\n }\n\n .check-container {\n position: absolute;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: flex-end;\n align-items: flex-end;\n width: 30px;\n height: 30px;\n border-radius: 0 0 8px 0;\n color: ",";\n overflow: hidden;\n transition: all ease 0.3s;\n &:after {\n position: absolute;\n z-index: 0;\n display: block;\n width: 0;\n height: 0;\n border-top: transparent solid 15px;\n border-left: transparent solid 15px;\n border-bottom: "," solid 15px;\n border-right: "," solid 15px;\n transition: all ease 0.1s;\n content: '';\n }\n\n .check-icon {\n position: relative;\n z-index: 2;\n margin: 0 1px 1px 0;\n font-size: 16px;\n transition: all ease 0.2s;\n }\n }\n"])),(e=>e.theme.palette.common.white),(e=>e.theme.palette.primary.main),(e=>e.theme.palette.primary.main)),_t=r.Z.div(Ut||(Ut=(0,l.Z)(["\n color: ",";\n .msg-before {\n display: inline-block;\n color: #aaa;\n font-size: 14px;\n margin-right: 6px;\n }\n"])),(e=>e.theme.palette.primary.main));var Qt;function Yt(e){let{blocklet:n,showDialog:t,setShowDialog:o,selectedMeta:l}=e;const{t:r}=(0,i.PE)(),a=(0,ge.Z)((e=>e.breakpoints.down("md"))),{inService:s}=(0,O.h6)(),c=()=>{o(!1)};return t?(0,N.jsx)(Xt,{title:r("blocklet.component.addWithName",{name:(0,S.getDisplayName)(n)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:a?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(e,n)=>{"backdropClick"!==n&&c()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:(0,N.jsx)(Mt,{selectedMeta:l,onClose:c,storageKey:s?ye.K_:ye.WC})}):null}Yt.propTypes={selectedMeta:s().object,showDialog:s().bool.isRequired,setShowDialog:s().func.isRequired,blocklet:s().object.isRequired},Yt.defaultProps={selectedMeta:null};const Xt=(0,r.Z)(q.ZP)(Qt||(Qt=(0,l.Z)(["\n .MuiDialogContent-root {\n }\n"])));function $t(e){let{blocklet:n,children:t}=e;const{t:l}=(0,i.PE)(),[r,a]=(0,o.useState)(!1),s=e=>{e.stopPropagation(),a(!0)};return(0,N.jsxs)(N.Fragment,{children:["function"===typeof t?t({open:s}):(0,N.jsxs)(fe.Z,{onClick:s,className:"component-action","data-cy":"action-add-component",children:[(0,N.jsx)(xe.Z,{style:{fontSize:18,marginRight:5}}),l("blocklet.component.add")]}),(0,N.jsx)(Yt,{showDialog:r,setShowDialog:a,blocklet:n})]})}$t.propTypes={children:s().any,blocklet:s().object.isRequired},$t.defaultProps={children:null};var eo=t(70461);const no=e=>e.children.filter((e=>e.meta.interfaces.find((e=>e.type===H.BLOCKLET_INTERFACE_TYPE_WEB))));function to(e){let{params:n,setParams:t,setError:l,serviceTypes:r}=e;const{t:a}=(0,i.PE)(),{blocklet:s}=(0,Be.y0)(),c=s.meta.did,d=no(s),[p,m]=(0,o.useState)([]),u={301:a("common.redirectPermanently"),302:a("common.redirectTemporary"),307:a("common.redirectTemporary"),308:a("common.redirectPermanently")};return(0,o.useEffect)((()=>{if(n.type===Z.ROUTING_RULE_TYPES.COMPONENT&&n.componentId){const e=d.find((e=>e.meta.did===n.componentId)),o=(0,S.findWebInterface)(e.meta),i=(Array.isArray(null===o||void 0===o?void 0:o.pageGroups)?o.pageGroups:[]).map((e=>({value:e,label:"".concat(e," pages")})));i.length&&i.unshift({value:"",label:"All pages"}),m(i),n.pageGroup&&!1===i.find((e=>e.value===n.pageGroup))&&t({...n,pageGroups:""})}}),[n.componentId,n.type]),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(V.Z,{select:!0,label:a("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:n.type,onChange:e=>{l(""),t({...n,type:e.target.value,did:e.target.value===Z.ROUTING_RULE_TYPES.BLOCKLET?c:"",__disableConfirm:!1})},style:{marginBottom:32},SelectProps:{},children:r.map((e=>{let{name:n,value:t}=e;return(0,N.jsx)(fe.Z,{value:t,children:n},t)}))}),n.type===Z.ROUTING_RULE_TYPES.REDIRECT&&[(0,N.jsx)(V.Z,{select:!0,label:a("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:n.redirectCode,onChange:e=>t({...n,redirectCode:e.target.value}),style:{marginBottom:32},SelectProps:{},children:Object.keys(u).map((e=>(0,N.jsx)(fe.Z,{value:e,children:"".concat(u[e]," - ").concat(e)},e)))},"redirectCode"),(0,N.jsx)(V.Z,{label:a("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url",inputProps:{"data-cy":"redirect-url-input"},fullWidth:!0,value:n.url,helperText:a("router.urlHelperText"),style:{marginBottom:32},onChange:e=>{t({...n,url:e.target.value,__disableConfirm:!e.target.value.trim()}),e.target.value.trim()?l(""):l(a("router.validation.redirectUrlRequired"))}},"redirectUrl")],n.type===Z.ROUTING_RULE_TYPES.COMPONENT&&[(0,N.jsx)(V.Z,{select:!0,label:a("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:n.componentId,onChange:e=>{t({...n,componentId:e.target.value})},style:{marginBottom:32},SelectProps:{},children:d.map((e=>(0,N.jsx)(fe.Z,{value:e.meta.did,selected:e.meta.did===n.componentId,children:(0,S.getDisplayName)(e,!0)},e.meta.did)))},"componentId"),p.length?(0,N.jsx)(V.Z,{select:!0,label:a("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:n.pageGroup,helperText:a("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:e=>{t({...n,pageGroup:e.target.value})},SelectProps:{},children:p.map((e=>(0,N.jsx)(fe.Z,{value:e.value,selected:e.value===n.pageGroup,children:e.label},e.label)))},"pageGroup"):null].filter(Boolean),n.type===Z.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(0,N.jsx)(V.Z,{label:a("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:n.url,helperText:a("router.urlHelperText"),style:{marginBottom:32},onChange:e=>{t({...n,url:e.target.value,__disableConfirm:!e.target.value.trim()}),e.target.value.trim()?l(""):l(a("router.validation.rewriteUrlRequired"))}},"url")]})}function oo(e){let{children:n}=e;const{t:t}=(0,i.PE)(),{api:l}=(0,O.h6)(),{blocklet:r}=(0,Be.y0)(),[a,s]=(0,o.useState)(!1),[c,d]=(0,o.useState)(null),p=r.meta.did,m=r.site.id,u={title:t("router.rule.add.title"),description:(e,n,o)=>(0,N.jsxs)(Pe.Z,{component:"div",children:[(0,N.jsx)(V.Z,{label:t("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:e.pathPrefixHint||t("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:e.pathPrefix,onChange:i=>{let l=!1;const a=(0,hn.Rw)({params:{...e,pathPrefix:i.target.value},blocklets:[r]});o(a),e.type===Z.ROUTING_RULE_TYPES.BLOCKLET&&a&&(l=!0),e.type!==Z.ROUTING_RULE_TYPES.REDIRECT||e.url||(l=!0),e.type!==Z.ROUTING_RULE_TYPES.GENERAL_REWRITE||e.url||(l=!0),i.target.value.trim()||(l=!0,o(t("router.validation.pathPrefixRequired"))),l||o("");const s=t("common.slugifyHint",{value:(0,F.LN)(i.target.value)});n({...e,pathPrefix:i.target.value,pathPrefixHint:s,__disableConfirm:l})}}),(0,N.jsx)(to,{params:e,setParams:e=>{o(null);(0,hn.fX)(e,t)?n({...e,__disableConfirm:!0}):n({...e})},setError:o})]}),confirm:t("router.rule.add.confirm"),cancel:t("common.cancel"),params:{did:"",pathPrefix:"",type:Z.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,__disableConfirm:!0},onConfirm:async e=>{try{const n=await(0,hn.fX)(e,t);if(n)throw n;s(!0);const o={from:{pathPrefix:le()(e.pathPrefix)},to:{type:e.type}};e.type===Z.ROUTING_RULE_TYPES.REDIRECT&&(o.to.url=e.url.trim(),o.to.redirectCode=e.redirectCode),e.type===Z.ROUTING_RULE_TYPES.COMPONENT&&(o.to.did=p,o.to.componentId=e.componentId,o.to.pageGroup=e.pageGroup),e.type===Z.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(o.to.url=le()(e.url)),await l.addRoutingRule({input:{id:m,rule:o,teamDid:p}})}catch(n){P.Z.error(n.message)}finally{s(!1),d(null)}},onCancel:()=>{s(!1),d(null)}},h=e=>{e.stopPropagation(),d(u)};return(0,N.jsxs)(N.Fragment,{children:["function"===typeof n?n({loading:a,open:h}):(0,N.jsxs)(fe.Z,{onClick:h,className:"rule-action","data-cy":"action-add-rule",children:[a?(0,N.jsx)(w.Z,{size:16}):(0,N.jsx)(xe.Z,{style:{fontSize:18,marginRight:5}}),t("router.rule.add.title")]}),c&&(0,N.jsx)(eo.Z,{title:c.title,description:c.description,confirm:c.confirm,cancel:c.cancel,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel,color:"primary"})]})}to.propTypes={params:s().object,serviceTypes:s().array,setParams:s().func,setError:s().func},to.defaultProps={params:{},serviceTypes:[{name:"Redirect",value:Z.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:Z.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:Z.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Component - Pass traffic to blocklet component",value:Z.ROUTING_RULE_TYPES.COMPONENT}],setParams:()=>{},setError:()=>{}},oo.propTypes={children:s().any},oo.defaultProps={children:null};var io=t(82434),lo=t.n(io),ro=t(62681),ao=t(18067),so=t(74286),co=t(27773),po=t(94552),mo=t(71363);function uo(e){let{id:n,from:t,children:l}=e;const{t:r}=(0,i.PE)(),{api:a}=(0,O.h6)(),{blocklet:s}=(0,Be.y0)(),[c,d]=(0,o.useState)(!1),[p,m]=(0,o.useState)(null),u=s.meta.did,h=s.site.id,f=t.pathPrefix,x={keyName:f,title:r("router.rule.delete.title"),description:r("router.rule.delete.description",{name:"<b>".concat(f,"</b>")}),confirmPlaceholder:r("router.rule.delete.confirm_desc",{name:f}),confirm:r("common.delConfirm"),cancel:r("router.rule.delete.cancel"),onConfirm:async()=>{d(!0);try{await a.deleteRoutingRule({input:{id:h,ruleId:n,teamDid:u}})}catch(e){P.Z.error(e.message)}finally{m(null),d(!1)}},onCancel:()=>{d(!1),m(null)}},g=e=>{e.stopPropagation(),m(x)};return(0,N.jsxs)(N.Fragment,{children:["function"===typeof l?l({loading:c,open:g}):(0,N.jsxs)(fe.Z,{onClick:g,className:"rule-action","data-cy":"action-delete-rule",children:[c?(0,N.jsx)(w.Z,{size:16}):(0,N.jsx)(co.default,{style:{fontSize:18,marginRight:5}}),r("router.rule.delete.title")]}),p&&(0,N.jsx)(mo.Z,{keyName:p.keyName,title:p.title,description:p.description,confirmPlaceholder:p.confirmPlaceholder,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel})]})}function ho(e){let{id:n,from:t,to:l,children:r}=e;const{t:a}=(0,i.PE)(),{api:s}=(0,O.h6)(),{blocklet:c}=(0,Be.y0)(),[d,p]=(0,o.useState)(!1),[m,u]=(0,o.useState)(null),h=c.meta.did,f=c.site.id,x=t.pathPrefix,g={title:a("router.rule.update.title"),description:(e,n,t)=>(0,N.jsxs)(Pe.Z,{component:"div",children:[(0,N.jsx)(V.Z,{label:a("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:e.helperText||a("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:e.pathPrefix,onChange:o=>{let i=!1;e.type!==Z.ROUTING_RULE_TYPES.REDIRECT||e.url||(i=!0),e.type!==Z.ROUTING_RULE_TYPES.GENERAL_REWRITE||e.url||(i=!0),o.target.value.trim()||(i=!0,t(a("router.validation.pathPrefixRequired"))),i||t("");const l=a("common.slugifyHint",{value:(0,F.LN)(o.target.value)});n({...e,pathPrefix:o.target.value,helperText:l,__disableConfirm:i})}}),(0,N.jsx)(to,{params:e,setParams:e=>{(0,hn.fX)(e,a)?n({...e,__disableConfirm:!0}):n({...e})},setError:t})]}),confirm:a("router.rule.update.confirm"),cancel:a("router.rule.update.cancel"),color:"primary",params:{did:l.did||"",pathPrefix:"/"===x?x:x.replace(/^\/+/,"").replace(/\/+$/,""),type:l.type||Z.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:l.redirectCode||302,componentId:l.componentId||"",pageGroup:l.pageGroup||"",url:l.url||"",__disableConfirm:!1},onConfirm:async e=>{try{const t=await(0,hn.fX)(e,a);if(t)throw t;p(!0);const o={id:n,from:{pathPrefix:le()(e.pathPrefix)},to:{type:e.type}};e.type===Z.ROUTING_RULE_TYPES.REDIRECT&&(o.to.url=e.url,o.to.redirectCode=e.redirectCode),e.type===Z.ROUTING_RULE_TYPES.COMPONENT&&(o.to.did=h,o.to.componentId=e.componentId,o.to.pageGroup=e.pageGroup),e.type===Z.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(o.to.url=le()(e.url)),await s.updateRoutingRule({input:{id:f,rule:o,teamDid:h}})}catch(t){P.Z.error(t.message)}finally{p(!1),u(null)}},onCancel:()=>{p(!1),u(null)}},y=e=>{e.stopPropagation(),u(g)};return(0,N.jsxs)(N.Fragment,{children:["function"===typeof r?r({loading:d,open:y}):(0,N.jsxs)(fe.Z,{onClick:y,className:"rule-action","data-cy":"action-update-rule",children:[d?(0,N.jsx)(w.Z,{size:16}):(0,N.jsx)(M.default,{style:{fontSize:18,marginRight:5}}),a("router.rule.update.title")]}),m&&(0,N.jsx)(eo.Z,{title:m.title,description:m.description,confirm:m.confirm,color:m.color,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}function fo(e){const{locale:n}=(0,i.PE)(),{blocklet:t,recommendedDomain:o}=(0,Be.y0)(),l=(0,F.Sk)(o,e.from.pathPrefix,(0,F.f0)(t,n));return(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,N.jsx)("a",{target:"_blank",href:l,rel:"noopener noreferrer",title:l,children:(0,N.jsx)(f.Z,{size:"small",children:(0,N.jsx)(po.Z,{})})}),(0,N.jsx)(ho,{...e,children:n=>{let{open:t}=n;return(0,N.jsx)(f.Z,{size:"small",onClick:t,disabled:e.isProtected,"data-cy":"action-update-rule",children:(0,N.jsx)(g.Z,{})})}}),(0,N.jsx)(uo,{...e,children:n=>{let{open:t}=n;return(0,N.jsx)(f.Z,{size:"small",onClick:t,disabled:e.isProtected,"data-cy":"action-delete-rule",children:(0,N.jsx)(co.default,{})})}})]})}uo.propTypes={id:s().string.isRequired,from:s().object.isRequired,children:s().any},uo.defaultProps={children:null},ho.propTypes={id:s().string.isRequired,from:s().object.isRequired,to:s().object.isRequired,children:s().any},ho.defaultProps={children:null},fo.propTypes={isProtected:s().bool},fo.defaultProps={isProtected:!1};var xo=t(22228);function go(e){let{group:n,...t}=e;return n?(0,N.jsx)(xo.Z,{type:"reverse",...t,children:n}):null}function yo(e){let{domain:n,isHttps:t,toUrl:o}=e;const i=t?"https":"http";let l=o;return lo()(l)||(l="".concat(i,"://").concat(n).concat(o)),(0,N.jsx)(Zn.Z,{href:l,target:"_blank",style:{fontSize:14},underline:"hover",children:o},l)}function vo(e){let{hasPermission:n}=e;const{t:t,locale:o}=(0,i.PE)(),l=(0,Fn.Z)(),{blocklet:r,recommendedDomain:a}=(0,Be.y0)();return r.site.rules.filter((e=>e.to.type!==Z.ROUTING_RULE_TYPES.BLOCKLET)).map((e=>{let i=null,s=null;e.to.type===Z.ROUTING_RULE_TYPES.NONE?i="404":e.to.type===Z.ROUTING_RULE_TYPES.REDIRECT?i=e.to.redirectCode:e.to.type===Z.ROUTING_RULE_TYPES.GENERAL_REWRITE?i="R":e.to.type===Z.ROUTING_RULE_TYPES.COMPONENT&&(s=r.children.find((n=>n.meta.did===e.to.componentId)),i="C");const c=e.isProtected?(0,N.jsx)(v.Z,{title:t("blocklet.router.urlLockTooltip"),placement:"top",children:(0,N.jsx)("span",{children:(0,N.jsx)(f.Z,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:(0,N.jsx)(ao.Z,{style:{fill:l.palette.text.disabled}})})})}):(0,N.jsx)(fo,{...e});return[(0,N.jsxs)(d.Z,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,N.jsxs)(d.Z,{width:{xs:300,md:400},display:"flex",alignItems:"center",children:[(0,N.jsx)(d.Z,{width:28}),"object"===typeof i?i:(0,N.jsx)(ro.Z,{children:i}),(0,N.jsxs)(d.Z,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[(0,N.jsxs)(d.Z,{style:{color:"#222",fontSize:16},children:[e.to.type===Z.ROUTING_RULE_TYPES.NONE&&t("common.page404"),e.to.type===Z.ROUTING_RULE_TYPES.REDIRECT&&t("common.redirect"),e.to.type===Z.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t("common.rewrite"),e.to.type===Z.ROUTING_RULE_TYPES.COMPONENT&&(0,S.getDisplayName)(s,!0)]}),(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[e.to.type===Z.ROUTING_RULE_TYPES.REDIRECT&&(0,N.jsx)(yo,{domain:a,toUrl:e.to.url}),e.to.type===Z.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(0,N.jsx)(yo,{domain:a,toUrl:e.to.url}),e.to.type===Z.ROUTING_RULE_TYPES.COMPONENT&&(0,N.jsx)(go,{group:e.to.pageGroup})]})]})]}),(0,N.jsx)(d.Z,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:(0,N.jsx)(Zn.Z,{href:(0,F.Sk)(a,e.from.pathPrefix,(0,F.f0)(r,o)),target:"_blank",style:{fontSize:16},underline:"hover",children:e.from.pathPrefix})},e.from.pathPrefix),(0,N.jsx)(d.Z,{children:n&&(0,N.jsx)("div",{style:{textAlign:"right"},children:c})},"actions")]},"rule"),(0,N.jsx)(so.Z,{},"divider")]}))}go.propTypes={group:s().string.isRequired},yo.propTypes={domain:s().string.isRequired,toUrl:s().string.isRequired,isHttps:s().bool},yo.defaultProps={isHttps:!1},vo.propTypes={hasPermission:s().bool},vo.defaultProps={hasPermission:!1};const bo=(0,z.V)(vo,"mutate_blocklets"),jo=(0,z.V)(vo,"",F.Wf);function ko(e){const{inService:n}=(0,O.h6)();return n?(0,N.jsx)(jo,{...e}):(0,N.jsx)(bo,{...e})}var Co=t(44125);const Zo=function(){let{blocklet:e,scrollToComponent:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{blocklet:null,scrollToComponent:!1};const t=(0,ve.useNavigate)(),{t:l}=(0,i.PE)(),r=(0,o.useRef)(null),a=(0,o.useMemo)((()=>{if(!e||!e.optionalComponents)return null;const o=new URLSearchParams(window.location.search),i=o.get("install-component");if(i){r.current=i,o.delete("install-component"),t(o.toString());const a=e.optionalComponents.find((e=>e.meta.did===i));if(!a)return P.Z.success(l("notification.installComponentError",{did:i})),null;const{meta:s}=a;if(n){const e=document.getElementById("optional-component-".concat(i)),n=document.querySelector(".dashboard-main");if(e){const t=e.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTo({top:t.top-o.top+n.scrollTop,behavior:"smooth"})}}return s}return null}),[e,t,l,n]);return(0,o.useEffect)((()=>{var n;r.current&&window.opener&&window.opener.postMessage({blocklet:e,kind:"component-installer"},null===(n=window.blocklet)||void 0===n?void 0:n.appUrl)}),[e]),a};var wo=t(1340),Ro=t(34966),Eo=t(32207),So=t(35258),Po=t(55498),To=t(64886),Io=t(57156),Uo=t.n(Io),No=t(2078),Do=t.n(No),Ao=t(19778);function Bo(e){var n;let{sourceInfo:t,blocklet:l}=e;const{t:r}=(0,o.useContext)(i.RD);return(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,N.jsx)(Ao.Z,{type:"success",children:Do()(t.source)},"source"),"registry"===t.source&&(0,N.jsx)(Zn.Z,{href:on()(t.deployedFrom,"blocklets",(null===l||void 0===l||null===(n=l.meta)||void 0===n?void 0:n.bundleDid)||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:r("blocklet.overview.viewInStore")})]})}Bo.propTypes={sourceInfo:s().shape({source:s().string,deployedFrom:s().string}),blocklet:s().object},Bo.defaultProps={sourceInfo:{},blocklet:{}};var Lo=t(81010),Oo=t(40736);function Fo(e){let{blocklet:n,checkUpgrade:t,hasPermission:l,...r}=e;const{api:a}=(0,O.h6)(),{t:s}=(0,o.useContext)(i.RD),[c,d]=(0,o.useState)(!1),[p,m]=(0,o.useState)(""),[u,h]=(0,o.useState)(null),[x,g]=(0,o.useState)(null);(0,o.useEffect)((()=>{h(null),t&&(n.mode,H.BLOCKLET_MODES.DEVELOPMENT)}),[n,t]);const y={title:"".concat(s("common.upgrade")," ").concat(s("common.blocklet")," ").concat((0,S.getDisplayName)(n)),description:s("blocklet.action.upgradeDescription"),confirm:s("blocklet.action.confirmUpgrade"),cancel:s("common.cancel"),onConfirm:async()=>{d(!0);try{const e={did:n.meta.did,version:u.version,storeUrl:u.registryUrl||""};await(0,F._v)(2e3),await a.upgradeBlocklet({input:e})}catch(e){P.Z.error("Blocklet upgrade failed: ".concat((0,F.Z)(e)))}finally{d(!1),g(null)}},onCancel:()=>{d(!1),g(null)}};return l&&u&&!(0,S.isInProgress)(n.status)?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(xo.Z,{...r,children:n.meta.version}),(0,N.jsx)(v.Z,{title:s("common.updateAvailable",{version:u.version}),children:(0,N.jsx)(f.Z,{size:"small",style:{marginLeft:8},disabled:c,onClick:()=>g(y),children:c?(0,N.jsx)(w.Z,{size:16}):(0,N.jsx)(Oo.Z,{style:{fontSize:16,color:"red"}})})}),!!p&&(0,N.jsx)(P.Z,{variant:"error",message:p,onClose:()=>m("")}),x&&(0,N.jsx)(eo.Z,{title:x.title,description:x.description,confirm:x.confirm,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]}):(0,N.jsx)(xo.Z,{...r,children:n.meta.version})}Fo.propTypes={blocklet:s().object.isRequired,checkUpgrade:s().bool,hasPermission:s().bool},Fo.defaultProps={checkUpgrade:!1,hasPermission:!1};const zo=(0,z.V)(Fo,"mutate_blocklets"),Mo=(0,z.V)(Fo,"",F.Wf);function qo(e){const{inService:n}=(0,O.h6)();return n?(0,N.jsx)(Mo,{...e}):(0,N.jsx)(zo,{...e})}var Go,Wo=t(80378),Vo=t(32349),Ko=t(65140),Ho=t(87916);function Jo(e){let{component:n,remove:t,disabled:l,tip:r,showConfirm:a,hideBtn:s,onCancel:c}=e;const{t:d}=(0,o.useContext)(i.RD),[p,m]=(0,o.useState)(!1),[u,h]=(0,o.useState)(null),f=async e=>{m(!0),await t(e.component,e.removeType),m(!1),h(null)},x=l||p,g=()=>{h({title:"".concat(d("common.delete")," ").concat(n.meta.title||n.meta.name),description:(e,n)=>(0,N.jsxs)(Pe.Z,{component:"div",children:[(0,N.jsx)(Pe.Z,{gutterBottom:!0,children:d("blocklet.action.removeComponentDescription")}),(0,N.jsxs)(Ho.Z,{name:"removeType",value:e.removeType,onChange:t=>n({...e,removeType:t.target.value}),children:[(0,N.jsx)(k.Z,{value:"keepData",control:(0,N.jsx)(Ko.Z,{}),label:d("blocklet.action.removeComponentKeepData")}),(0,N.jsx)(k.Z,{value:"complete",control:(0,N.jsx)(Ko.Z,{}),label:d("blocklet.action.removeComponentComplete")})]})]}),confirm:d("common.confirm"),cancel:d("common.cancel"),params:{component:n,removeType:"keepData"},onConfirm:f,onCancel:()=>{h(null),c()}})};(0,o.useEffect)((()=>{a?g():(m(!1),h(null))}),[a]);const y=(0,N.jsx)(_o,{size:"small",disabled:x,onClick:()=>g,"data-cy":"delete-component-btn",children:(0,N.jsx)(co.default,{disabled:x})}),b=(0,N.jsx)(v.Z,{title:r||d("common.delete"),children:(0,N.jsx)("span",{children:y})});return(0,N.jsxs)(N.Fragment,{children:[!s&&b,u&&(0,N.jsx)(eo.Z,{title:u.title,description:u.description,confirm:u.confirm,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel})]})}Jo.propTypes={component:s().object.isRequired,remove:s().func,onCancel:s().func,disabled:s().bool,showConfirm:s().bool,hideBtn:s().bool,tip:s().string},Jo.defaultProps={remove:async()=>{},disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:()=>{},tip:""};const _o=(0,r.Z)(f.Z)(Go||(Go=(0,l.Z)(["\n &.Mui-disabled {\n opacity: 0.5;\n }\n"])));var Qo,Yo=t(22754),Xo=t(98451);function $o(e){let{component:n,onStart:t,onStop:l,disabled:r,tip:a}=e;const{t:s}=(0,o.useContext)(i.RD),[c,d]=(0,o.useState)(!1),[p,m]=(0,o.useState)(),u=r||c,h=["starting","running","stopping"].includes(n.status),f=h?Xo.Z:Yo.Z,x=(0,N.jsx)(ei,{disabled:u,onClick:()=>{var e;h?m({title:"".concat(s("common.stop")," ").concat(null===n||void 0===n||null===(e=n.meta)||void 0===e?void 0:e.title),description:s("blocklet.action.stopComponentDescription"),confirm:s("blocklet.action.confirmStop"),cancel:s("common.cancel"),onConfirm:()=>(m(null),(async()=>{d(!0);try{await l(n)}catch(e){P.Z.error(e.message)}d(!1)})()),onCancel:()=>m(null)}):(async()=>{d(!0);try{await t(n)}catch(e){P.Z.error(e.message)}d(!1)})()},"data-cy":"".concat(h?"stop":"start","-component-btn"),children:(0,N.jsx)(f,{disabled:u})});return[(0,N.jsx)(v.Z,{title:a||s("common.".concat(h?"stop":"start")),children:(0,N.jsx)("span",{children:x})},"btn"),p&&(0,N.jsx)(eo.Z,{title:p.title,description:p.description,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel},"connect")]}$o.propTypes={component:s().object.isRequired,onStart:s().func,onStop:s().func,disabled:s().bool,tip:s().string},$o.defaultProps={onStart:async()=>{},onStop:async()=>{},disabled:!1,tip:""};const ei=(0,r.Z)(f.Z)(Qo||(Qo=(0,l.Z)(["\n &.Mui-disabled {\n opacity: 0.5;\n }\n"])));var ni,ti,oi=t(92726);const ii=(e,n)=>e?[{name:n("common.name"),value:e.displayName},{name:n("common.description"),value:e.description},{name:n("common.version"),value:(0,N.jsx)(xo.Z,{children:e.version})}]:[],li=e=>{const{source:n,deployedFrom:t,bundleSource:o}=e;return n?{source:n,deployedFrom:t}:o?o.url?{source:"url",deployedFrom:t||Array.isArray(o.url)?o.url[0]:o.url}:o.store?{source:"registry",deployedFrom:t||Array.isArray(o.store)?o.store[0]:o.store}:{}:{source:"upload",deployedFrom:t}},ri=(e,n)=>{const t=e.split("/").slice(1);let o=n,i=0;const l=[];for(;o&&i<t.length;){const e=o.children.find((e=>e.meta.did===t[i]));o=e,i++,e&&l.push(e.meta.title)}return l.join(" / ")},ai=e=>{var n;return"pack"===(null===e||void 0===e||null===(n=e.meta)||void 0===n?void 0:n.group)};function si(e){var n,t,l,r,a;let{blocklet:s,ancestors:u,depth:h,onRemove:x,onStart:y,onStop:b,onRestart:j,onReload:k,getComponentUrl:C,app:Z}=e;const{t:w,locale:R}=(0,o.useContext)(i.RD),[E,P]=(0,o.useState)(),[I,U]=(0,o.useState)(!1),[D,A]=(0,o.useState)(!1),[B,L]=(0,o.useState)(null),{deletingBlocklets:O}=(0,T.K)();let{status:z}=s;1===h&&O.includes(s.meta.did)&&(z="deleting");const M="/".concat(s.mountPoint||"/").replace(/\/+/g,"/"),q=C(M),G=E?li(E):{},W=E?[{name:w("common.name"),value:(0,S.getDisplayName)(E,!0)},{name:w("common.version"),value:(0,N.jsx)(qo,{blocklet:E,checkUpgrade:!1})},{name:w("common.status"),value:(0,N.jsx)(Lo.Z,{status:z,source:E.source,progress:s.progress})},"running"===s.status?{name:w("blocklet.startedAt"),value:(0,F.B2)(s.startedAt,R)}:null,"running"!==s.status?{name:w("blocklet.stoppedAt"),value:(0,F.B2)(s.stoppedAt,R)}:null,s.installedAt?{name:w("blocklet.installedAt"),value:(0,F.B2)(s.installedAt,R)}:null,(0,S.hasStartEngine)(s.meta)?{name:w("common.mountPoint"),value:M}:null,E.meta.group?{name:w("common.group"),value:(0,N.jsx)(xo.Z,{type:"success",children:E.meta.group})}:null,{name:w("blocklet.overview.source"),value:(0,N.jsx)(Bo,{sourceInfo:G,blocklet:s})},{name:w("blocklet.overview.deployedFrom"),value:G.deployedFrom||"-"},{name:w("common.did"),value:(0,N.jsx)(Yn.Z,{did:E.meta.did})},{name:w("common.author"),value:(0,F.rq)(E.meta.author)},{name:w("common.engine"),value:ii(E.engine,w).map((e=>{let{name:n,value:t}=e;return(0,N.jsx)(To.Z,{style:{marginBottom:4},nameWidth:120,name:n,children:t},n)}))},null!==(n=s.dependents)&&void 0!==n&&n.length?{name:w("common.dependents"),value:(0,N.jsx)(d.Z,{children:s.dependents.map((e=>(0,N.jsx)(d.Z,{children:"".concat(ri(e.id,Z)," ").concat(e.required?"(".concat(w("common.required"),")"):"")},e.id)))})}:null,null!==(t=s.meta.resources)&&void 0!==t&&t.length?{name:w("common.resource"),value:s.meta.resources.join(", ")}:null].filter(Boolean):[],V=(0,S.isInProgress)(Z.status),K=(0,S.isInProgress)(s.status);let H="";if(V||K||1===h&&O.includes(s.meta.did))H=w("blocklet.component.tip.stopBlocklet");else if(null!==(l=s.dependents)&&void 0!==l&&l.length){const e=s.dependents.filter((e=>e.required));if(e.length){const n=e.map((e=>ri(e.id,Z)));H=w("blocklet.component.tip.requiredBy",{name:n.join(", ")})}}return[(0,N.jsxs)(di,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[(0,N.jsxs)(d.Z,{width:{xs:300,md:300},display:"flex",alignItems:"center",children:[(0,N.jsx)(Wo.Z,{blocklet:s,ancestors:u}),(0,N.jsxs)(d.Z,{ml:"16px",children:[(0,N.jsxs)(d.Z,{className:"component-header",onClick:()=>P(s),children:[(0,N.jsx)(d.Z,{className:"component-name",children:(0,S.getDisplayName)(s,!0)}),(0,N.jsx)(d.Z,{className:"component-version",children:null===s||void 0===s||null===(r=s.meta)||void 0===r?void 0:r.version})]}),(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",sx:{mt:"2px",ml:-.5},children:["unknown"!==z&&(0,N.jsx)(Lo.Z,{style:{marginLeft:4},status:z,source:s.source,progress:s.progress}),(0,N.jsx)(Vo.Z,{style:{marginLeft:4},mode:s.mode||""}),!(null===(a=s.dependents)||void 0===a||!a.length)&&(0,N.jsx)(v.Z,{title:["".concat(w("common.dependents"),": "),s.dependents.map((e=>(0,N.jsx)(d.Z,{pl:1,children:"".concat(ri(e.id,Z)," ").concat(e.required?"(".concat(w("common.required"),")"):"")},e.id)))],children:(0,N.jsx)(d.Z,{display:"flex",color:"primary.main",ml:1,children:(0,N.jsx)(Po.JO,{icon:"octicon:package-dependents-16"})})})]})]})]},s),(0,S.hasStartEngine)(s.meta)&&(0,N.jsx)(d.Z,{sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:(0,N.jsx)("a",{target:"_blank",href:q,rel:"noopener noreferrer",title:q,children:(0,N.jsx)(d.Z,{maxWidth:400,sx:{color:"secondary.main",fontSize:16,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:Uo()(M)})})},M),(0,N.jsx)("div",{style:{flex:1}}),(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,S.hasStartEngine)(s.meta)&&(0,N.jsx)(v.Z,{title:w("common.visit"),children:(0,N.jsx)("a",{target:"_blank",href:q,rel:"noopener noreferrer",children:(0,N.jsx)(f.Z,{size:"small",children:(0,N.jsx)(po.Z,{})})})}),(0,N.jsx)(ue,{blocklet:s,ancestors:u,children:e=>{let{open:n}=e;return(0,N.jsx)(v.Z,{title:w("common.config"),children:(0,N.jsx)(ci,{color:"error",badgeContent:"",variant:"dot",invisible:!(0,S.getComponentMissingConfigs)(s,u[0]).length,children:(0,N.jsx)(f.Z,{onClick:n,size:"small",children:(0,N.jsx)(g.Z,{})})})},"config")}}),(0,N.jsx)($o,{blocklet:Z,component:s,onStart:y,onStop:b,disabled:!["starting","stopping"].includes(Z.status)&&(0,S.isInProgress)(Z.status)}),(0,N.jsx)(oi.Z,{"data-cy":"component-actions",actions:[(0,S.hasStartEngine)(s.meta)?{icon:(0,N.jsx)(Ro.Z,{}),text:w("common.detail"),onClick:()=>{P(s)}}:null,!ai(s)&&{icon:(0,N.jsx)(Eo.default,{}),text:w("common.restart"),onClick:()=>{L({title:"".concat(w("common.restart")," ").concat(s.meta.title),description:w("blocklet.action.restartDescription"),confirm:w("blocklet.action.confirmRestart"),cancel:w("common.cancel"),onConfirm:async()=>{A(!0),await j(s),A(!1)},onCancel:()=>L(null)})},disabled:V||K||"running"!==s.status},!ai(s)&&{icon:(0,N.jsx)(So.Z,{}),text:w("common.reload"),onClick:async()=>{A(!0),await k(s),A(!1)},disabled:D||V||K||"running"!==s.status},{icon:(0,N.jsx)(co.default,{}),text:w("common.delete"),onClick:()=>{U(!0)},disabled:V||K||!!H,tip:H}].filter(Boolean)})]},"actions")]},"group-not-gateway-box"),(0,N.jsx)(so.Z,{},"line"),!!E&&(0,N.jsx)(c.Z,{open:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{P(null)},children:(0,N.jsxs)(d.Z,{paddingY:1.5,children:[(0,N.jsx)(m.Z,{children:w("common.componentBasicInfo")}),(0,N.jsx)(p.Z,{children:(J=W,J.map((e=>e.name===w("common.did")||e.name===w("blocklet.appId")?(0,N.jsx)(To.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:()=>e.name,children:e.value},e.name):(0,N.jsx)(To.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name))))})]},"dialog-wrapper")},"base-info-dialog"),(0,N.jsx)(Jo,{blocklet:Z,component:s,remove:async function(){A(!0);try{await x(...arguments)}catch{}A(!1),U(!1)},onCancel:()=>U(!1),hideBtn:!0,showConfirm:I},"delete-component"),B&&(0,N.jsx)(eo.Z,{title:B.title,description:B.description,confirm:B.confirm,cancel:B.cancel,params:B.params,onConfirm:B.onConfirm,onCancel:B.onCancel},"confirm-setting")];var J}si.propTypes={blocklet:s().object.isRequired,ancestors:s().array,depth:s().number,onRemove:s().func,onStart:s().func,onStop:s().func,onRestart:s().func,onReload:s().func,getComponentUrl:s().func,app:s().object},si.defaultProps={ancestors:[],depth:0,onRemove:()=>{},onStart:()=>{},onStop:()=>{},onRestart:()=>{},onReload:()=>{},getComponentUrl:()=>window.location.origin,app:null};const ci=(0,r.Z)(wo.Z)(ni||(ni=(0,l.Z)(["\n .BaseBadge-badge {\n top: ","px;\n right: ","px;\n }\n"])),(e=>8*e.top||6),(e=>8*e.right||6)),di=(0,r.Z)(d.Z)(ti||(ti=(0,l.Z)(["\n .component-header {\n display: flex;\n align-items: center;\n align-items: flex-end;\n cursor: pointer;\n }\n .component-name {\n color: #222;\n font-size: 16px;\n }\n .component-version {\n color: #999;\n font-size: 12px;\n margin-left: 4px;\n transform: translateY(-1px);\n }\n"])));var pi,mi=t(56556);function ui(e){let{meta:n,dependencies:t,logoUrl:o,setInstallComponentMeta:l}=e;const r=(0,O.h6)(),{t:a}=(0,i.PE)();return(0,N.jsxs)(hi,{id:"optional-component-".concat(n.did),children:[(0,N.jsxs)("div",{className:"cell",children:[(0,N.jsxs)("div",{className:"component-left",children:[(0,N.jsxs)(ro.Z,{className:"component-logo",style:{backgroundColor:"transparent",width:40,height:40,borderRadius:10},children:[(0,N.jsx)("img",{src:o,onError:()=>"".concat(r.imgPrefix,"/blocklet.png"),alt:n.title,style:{width:40}}),";"]}),(0,N.jsxs)("div",{className:"component-header",children:[(0,N.jsx)("div",{className:"component-name",children:n.title}),(0,N.jsx)("div",{className:"component-version",children:n.version})]}),(0,N.jsx)(v.Z,{title:["".concat(a("common.dependents"),": "),t.map((e=>(0,N.jsx)(d.Z,{pl:1,children:"".concat(e.parentTitle," ").concat(e.required?"(".concat(a("common.required"),")"):"")},e.parentName+e.mount_point)))],children:(0,N.jsx)(d.Z,{display:"flex",color:"primary.main",ml:1,children:(0,N.jsx)(Po.JO,{icon:"octicon:package-dependents-16"})})})]}),(0,N.jsx)("div",{style:{flex:1}}),(0,N.jsx)(mi.Z,{onClick:()=>{l(n)},startIcon:(0,N.jsx)(Po.JO,{icon:"ph:download-simple-bold"}),children:a("common.install")})]}),(0,N.jsx)(so.Z,{class:"line"},"line")]})}ui.propTypes={meta:s().object.isRequired,logoUrl:s().string,setInstallComponentMeta:s().func.isRequired,dependencies:s().arrayOf(s().shape({parentDid:s().string,parentName:s().string,parentPoint:s().string,required:s().bool}))},ui.defaultProps={logoUrl:"",dependencies:[]};const hi=(0,r.Z)(di)(pi||(pi=(0,l.Z)(["\n .line {\n opacity: 0.5;\n }\n .cell {\n display: flex;\n width: 100%;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n padding-top: 16px;\n padding-bottom: 16px;\n }\n .component-left {\n display: flex;\n flex-direction: row;\n padding-left: 4px;\n align-items: center;\n }\n .component-logo {\n opacity: 0.5;\n }\n .component-header {\n opacity: 0.5;\n margin-left: 12px;\n display: flex;\n align-items: center;\n align-items: flex-end;\n cursor: pointer;\n }\n .component-name {\n opacity: 0.5;\n color: #222;\n font-size: 16px;\n }\n .component-version {\n opacity: 0.8;\n color: #999;\n font-size: 12px;\n margin-left: 4px;\n transform: translateY(-1px);\n }\n"])));var fi,xi,gi;function yi(e){var n;let{blocklet:t,onUpdate:l,getComponentUrl:r,...a}=e;const{t:s}=(0,o.useContext)(i.RD),{api:I,inService:U,info:D}=(0,O.h6)(),{addDeletingDid:B,removeDeletingDid:L,matchDeletingDid:M}=(0,T.K)(),[q,G]=(0,o.useState)(!1),[W,V]=(0,o.useState)(null),[K,H]=(0,o.useState)(null),[J,_]=(0,o.useState)(!1),[Q,Y]=(0,o.useState)(null),X=t&&t.structVersion!==Z.APP_STRUCT_VERSION,[$,ee]=(0,o.useState)(!1),ne=[...t.children]||[];"gateway"!==t.meta.group&&ne.unshift(t),M(ne.map((e=>e.meta.did)));const te=async()=>{if(!q){G(!0);try{const{updateId:e,updateList:n}=(await I.checkComponentsForUpdates({input:{did:t.meta.did}})).preUpdateInfo||{};if(G(!1),!e)return void P.Z.info(s("blocklet.component.noUpdate"));const o=[];(0,S.forEachChildSync)(t,((e,t)=>{let{id:i,ancestors:l}=t;const r=n.find((e=>e.id===i));if(r){const n=l.slice(1).concat(e).map((e=>e.meta.title||e.meta.name)).join(" / "),t=(l[1]||e).meta.did;o.push({groupId:t,name:n,version:e.meta.version,newVersion:r.meta.version})}}));const i={};o.forEach((e=>{i[e.groupId]?e.disabled=!0:i[e.groupId]=!0})),V({params:{updateId:e},list:o,checks:i,hasChecks:!0})}catch(e){G(!1),P.Z.error((0,F.Z)(e))}}},oe=async(e,n)=>{B(e.meta.did);try{await I.deleteComponent({input:{did:e.meta.did,keepData:"keepData"===n,rootDid:t.meta.did}}),await(0,F._v)(800)}catch(o){P.Z.error((0,F.Z)(o)),L(e.meta.did)}},ie=async e=>{try{await I.startBlocklet({input:{did:t.meta.did,componentDids:[e.meta.did]}}),await(0,F._v)(800)}catch(n){P.Z.error((0,F.Z)(n))}},le=async e=>{try{await I.stopBlocklet({input:{did:t.meta.did,componentDids:[e.meta.did]}}),await(0,F._v)(800)}catch(n){P.Z.error((0,F.Z)(n))}},re=async e=>{try{await I.restartBlocklet({input:{did:t.meta.did,componentDids:[e.meta.did]}}),await(0,F._v)(800)}catch(n){P.Z.error((0,F.Z)(n))}},ae=async e=>{try{await I.reloadBlocklet({input:{did:t.meta.did,componentDids:[e.meta.did]}}),await(0,F._v)(800),P.Z.success(s("blocklet.reloadSuccess"))}catch(n){P.Z.error((0,F.Z)(n))}};(0,Co.Z)(te);const se=Zo({blocklet:t,scrollToComponent:!0}),ce=Q||se;return(0,N.jsxs)(vi,{component:"div",...a,children:[(0,N.jsxs)(bi,{display:"flex",children:[(0,N.jsxs)(ji,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[s("common.components"),!X&&(0,N.jsx)(z.Z,{permission:U?"":"mutate_blocklets",role:U?F.Wf:[],children:(0,N.jsx)(A,{children:(0,N.jsx)(ci,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!$,children:(0,N.jsxs)(R.Z,{disabled:q||(0,S.isInProgress)(t.status),color:"secondary",onClick:()=>{te()},"data-cy":"check-for-updates",children:[(0,N.jsx)(d.Z,{mr:.5,display:"flex",children:q?(0,N.jsx)(w.Z,{size:16}):(0,N.jsx)(h.Z,{style:{fontSize:"1em"}})}),s("blocklet.component.checkUpdateTitle")]})})})})]}),(0,N.jsx)(z.Z,{permission:U?"":"mutate_blocklets",role:U?F.Wf:[],children:(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,N.jsx)(oo,{children:e=>{let{open:n}=e;return(0,N.jsxs)(R.Z,{disabled:q||(0,S.isInProgress)(t.status),variant:"text",color:"primary","data-cy":"add-rule",className:"sm-hide-icon",onClick:n,children:[(0,N.jsx)(x.Z,{style:{fontSize:"1.3em",marginRight:4}}),s("router.rule.add.title")]})}}),!X&&(0,N.jsx)($t,{blocklet:t,serverVersion:D.version,children:e=>{let{open:n}=e;return(0,N.jsxs)(R.Z,{disabled:q||(0,S.isInProgress)(t.status),variant:"text",color:"primary","data-cy":"add-component",className:"sm-hide-icon",onClick:n,children:[(0,N.jsx)(x.Z,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.component.add")]})}}),!X&&(0,N.jsx)(ue,{blocklet:t,ancestors:[],children:e=>{let{open:n}=e;return(0,N.jsx)(v.Z,{title:"".concat(s("blocklet.component.container")).concat(s("common.config")),children:(0,N.jsx)(f.Z,{onClick:n,size:"small",color:"primary",children:(0,N.jsx)(g.Z,{style:{fontSize:18}})})},"config")}})]})})]}),null!==ne&&void 0!==ne&&ne.length?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(d.Z,{mt:2,children:["gateway"!==t.meta.group&&(0,N.jsx)(si,{blocklet:t,app:t,onRemove:oe,onStart:ie,onStop:le,onReload:ae,onRestart:re,getComponentUrl:r},"0-".concat(t.meta.did)),t.children.map((e=>(0,N.jsx)(si,{depth:1,blocklet:e,ancestors:[t],app:t,onRemove:oe,onStart:ie,onStop:le,onReload:ae,onRestart:re,getComponentUrl:r},"1-".concat(e.meta.did))))]},"top-blocklet-".concat(t.meta.did)),null===(n=t.optionalComponents)||void 0===n?void 0:n.map((e=>(0,N.jsx)(di,{children:(0,N.jsx)(ui,{setInstallComponentMeta:Y,...e})},e.meta.did)))]}):(0,N.jsx)(d.Z,{mt:8,children:(0,N.jsx)(E.Z,{children:s("blocklet.component.noComponent")})}),!!t.site.rules.length&&(0,N.jsx)(d.Z,{mt:0,ml:{xs:"-16px",md:"-28px"},children:(0,N.jsx)(ko,{})}),!!W&&(0,N.jsx)(c.Z,{open:!0,fullWidth:!0,children:(0,N.jsxs)(d.Z,{paddingY:1.5,children:[(0,N.jsx)(m.Z,{children:s("blocklet.component.updateTitle")}),(0,N.jsx)(d.Z,{component:p.Z,py:4,children:W.list.map((e=>(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,N.jsx)(j.Z,{checked:W.checks[e.groupId],onChange:n=>((e,n)=>{const{checked:t}=e.target;V((e=>{const o=Object.entries(e.checks).reduce(((e,o)=>{let[i,l]=o;return e[i]=n===i?t:l,e}),{}),i=Object.values(o).includes(!0);return{...e,checks:o,hasChecks:i}}))})(n,e.groupId),style:{marginLeft:e.disabled?16:0},defaultChecked:!0,disabled:e.disabled}),(0,N.jsxs)(d.Z,{flexGrow:1,mt:3,children:[(0,N.jsx)(d.Z,{item:!0,xs:8,children:e.name}),e.version&&(0,N.jsxs)(y.ZP,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[(0,N.jsx)(y.ZP,{item:!0,xs:3,children:e.version}),(0,N.jsx)(y.ZP,{item:!0,xs:1,children:(0,N.jsx)(b.Z,{style:{fontSize:"0.9em"}})}),(0,N.jsx)(y.ZP,{item:!0,xs:3,children:(0,N.jsx)(d.Z,{color:"secondary.main",children:e.newVersion})})]})]},"".concat(e.name,"-").concat(e.newVersion))]},e.name)))}),(0,N.jsxs)(u.Z,{style:{padding:"8px 24px 24px"},children:[(0,N.jsx)(R.Z,{onClick:()=>{V(null)},children:s("common.cancel")}),(0,N.jsxs)(R.Z,{onClick:e=>{e.stopPropagation(),(async()=>{if(!q)try{G(!0);const e=Object.keys(W.checks).filter((e=>W.checks[e])),n={updateId:W.params.updateId,rootDid:t.meta.did,selectedComponents:e};await I.upgradeComponents({input:n}),G(!1),V(null),ee(null)}catch(e){G(!1),P.Z.error((0,F.Z)(e))}})()},color:"primary",disabled:q||!W.hasChecks,variant:"contained",autoFocus:!0,children:[q&&(0,N.jsx)(w.Z,{size:16}),s("common.update")]})]})]})}),!!K&&(0,N.jsx)(c.Z,{open:!0,fullWidth:!0,onClose:()=>H(!1),children:(0,N.jsxs)(d.Z,{paddingY:1.5,children:[(0,N.jsx)(m.Z,{children:s("common.configuration")}),(0,N.jsx)(p.Z,{children:(0,N.jsx)(d.Z,{py:2,children:(0,N.jsx)(k.Z,{control:(0,N.jsx)(C.Z,{checked:J,onChange:e=>_(!!e.target.checked)}),label:s("blocklet.component.showContainer")})})})]})}),(0,N.jsx)(Yt,{selectedMeta:ce,blocklet:t,showDialog:!!ce,setShowDialog:()=>Y(null)})]})}yi.propTypes={blocklet:s().object.isRequired,onUpdate:s().func,getComponentUrl:s().func},yi.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const vi=r.Z.div(fi||(fi=(0,l.Z)(["\n .title {\n font-size: 1.2rem;\n font-weight: bold;\n }\n\n @keyframes showDelay {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n }\n\n .component-item {\n animation: showDelay 0.75s ease 1;\n }\n"]))),bi=(0,r.Z)(d.Z)(xi||(xi=(0,l.Z)(["\n "," {\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n }\n "," {\n flex-direction: column;\n justify-content: flex-end;\n align-items: flex-end;\n .sm-hide-icon > svg {\n display: none;\n }\n }\n"])),(e=>e.theme.breakpoints.up("sm")),(e=>e.theme.breakpoints.down("sm"))),ji=(0,r.Z)(d.Z)(gi||(gi=(0,l.Z)(["\n "," {\n width: 100%;\n justify-content: space-between;\n }\n"])),(e=>e.theme.breakpoints.down("sm")));var ki=t(21289);function Ci(e){const{locale:n}=(0,o.useContext)(i.RD),{blocklet:t,recommendedDomain:l}=(0,ki.y0)();return(0,N.jsx)(yi,{blocklet:t,getComponentUrl:e=>(0,F.vH)({blocklet:t,domain:{value:l},mountPoint:e,params:(0,F.f0)(t,n)}),...e})}Ci.defaultProps={}},44543:(e,n,t)=>{const o=t(57156);e.exports=(e,n)=>o(e)===o(n)},92726:(e,n,t)=>{"use strict";t.d(n,{Z:()=>x});var o,i=t(71171),l=t(5057),r=t(55898),a=t.n(r),s=t(33518),c=t(67680),d=t(61533),p=t(74490),m=t(45267),u=t(46954),h=t(44067),f=t(96266);function x(e){let{actions:n,size:t,...o}=e;const[i,r]=(0,l.useState)(null),a=Boolean(i),s=e=>{try{e.stopPropagation(),e.preventDefault()}catch{}r(null)};return(0,f.jsxs)(g,{...o,children:[(0,f.jsx)(c.Z,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"actions-menu-icon",onClick:e=>{try{e.stopPropagation(),e.preventDefault()}catch{}r(e.currentTarget)},size:t,children:(0,f.jsx)(m.Z,{})}),(0,f.jsx)(d.Z,{id:"actions-menu","data-cy":"actions-menu",anchorEl:i,keepMounted:!0,open:a,onClose:s,PaperProps:{},children:n.map(((e,n)=>{if("function"===typeof e)return e({close:s});const{icon:t,text:o,onClick:i,disabled:r=!1,...a}=e;return(0,l.createElement)(p.Z,{...a,disabled:r,dense:!0,onClick:async e=>{await i(e),s()},key:n,"data-cy":"actions-menu-".concat(n)},(0,f.jsx)(u.Z,{style:{minWidth:24,marginRight:8},children:t}),(0,f.jsx)(h.Z,{primary:o}))}))})]})}x.propTypes={actions:a().array,size:a().oneOf(["small","medium","large"])},x.defaultProps={actions:[],size:"small"};const g=s.Z.div(o||(o=(0,i.Z)([""])))},53927:(e,n,t)=>{"use strict";t.d(n,{Z:()=>S});var o=t(71171),i=t(55898),l=t.n(i),r=t(85493),a=t(33518),s=t(68420),c=t(40265),d=t(44566),p=t(55498),m=t(39948),u=t(26174),h=t(88092),f=t(67680),x=t(5057),g=t(35432),y=t(96266);function v(e){let{...n}=e;return(0,y.jsxs)("div",{...n,style:{width:"100%"},children:[(0,y.jsx)("h3",{children:"End User License Agreement for Application"}),(0,y.jsxs)("p",{children:["Blocklet Server License Agreement ",g.COPYRIGHT_OWNER," version 2020-08-28"]}),(0,y.jsx)("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),(0,y.jsx)("p",{children:"\u6682\u65e0"})]})}var b=t(13128),j=t(15715);function k(e){var n,t,o,i;return"".concat((null===(n=e.bundleSource)||void 0===n?void 0:n.store)||e.meta.homepage,"/assets/").concat(null===(t=e.meta)||void 0===t?void 0:t.did,"/").concat((null===(o=e.meta)||void 0===o?void 0:o.logo)||"logo.png","?v=").concat(null===(i=e.meta)||void 0===i?void 0:i.version)}function C(e){let{installRelated:n,meta:t,show:o,onClose:i,components:l,loading:r}=e;const{t:a}=(0,s.PE)(),c=(0,j.Z)((e=>e.breakpoints.down("md")));if(!o)return null;const d=!r&&0===l.length,u=!r&&0!==l.length;return(0,y.jsxs)(b.ZP,{title:a("blocklet.component.relatedComponents",{name:t.title}),maxWidth:!1,fullWidth:!1,onClose:(e,n)=>{"backdropClick"!==n&&i(!1)},PaperProps:{style:c?{width:"100%",height:window.innerHeight}:{maxWidth:500,minWidth:300,width:"80%"}},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:[r&&(0,y.jsx)(m.Z,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:(0,y.jsx)(m.Z,{sx:{fontSize:32},color:"primary.main",component:p.JO,icon:"line-md:loading-loop"})}),d&&(0,y.jsx)(m.Z,{sx:{textAlign:"center"},children:a("blocklet.component.noDependencies",{name:t.title})}),u&&(0,y.jsx)(m.Z,{sx:{marginBottom:2},children:l.map((e=>{if(!e.meta)return null;const{required:t}=e;let o;return o=n||t?1:.5,(0,y.jsxs)(m.Z,{sx:{opacity:o,padding:"10px 0px",paddingBottom:.5,marginTop:0,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[(0,y.jsx)("img",{style:{width:40,height:40,minWidth:40,minHeight:40},src:k(e),alt:e.meta.title}),(0,y.jsxs)(m.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[(0,y.jsxs)(m.Z,{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 n;window.open("".concat((null===(n=e.bundleSource)||void 0===n?void 0:n.store)||e.meta.homepage,"/blocklets/").concat(e.meta.did),"_blank")},children:[e.meta.title,(0,y.jsx)(m.Z,{sx:{display:t?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:a("blocklet.component.required")}),(0,y.jsxs)(m.Z,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[e.meta.version,(0,y.jsx)(m.Z,{className:"link-icon",icon:"fluent:open-20-filled",component:p.JO,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),(0,y.jsx)(m.Z,{sx:{marginTop:0,opacity:.7},children:e.meta.description})]})]},e.meta.did)}))})]})}C.propTypes={meta:l().object,show:l().bool,onClose:l().func.isRequired,installRelated:l().func,components:l().array.isRequired,loading:l().bool.isRequired},C.defaultProps={meta:null,show:!1,installRelated:!1};var Z=t(15849),w=t(58238);const R=function(e){const{api:n}=(0,w.h6)(),[t]=(0,Z.useSearchParams)(),o=t.get("blocklet_meta_url")||function(e){return e&&(e.registryUrl||e.homepage)&&e.did?"".concat(e.registryUrl||e.homepage,"/api/blocklets/").concat(null===e||void 0===e?void 0:e.did,"/blocklet.json"):""}(e),[i,l]=(0,x.useState)([]),[r,a]=(0,x.useState)(!1);return(0,x.useEffect)((()=>{!o||null!==e&&void 0!==e&&e.inputUrl||(a(!0),n.getDynamicComponents({input:{url:o}}).then((e=>{l(e.components)})).finally((()=>{a(!1)})))}),[o]),{components:i,loading:r}};var E;function S(e){let{installRelated:n,onChangeInstallRelated:t,meta:o,onClickNext:i,handleDescEle:l}=e;const a=(0,r.useNavigate)(),{t:g,locale:b}=(0,s.PE)(),[j,k]=(0,x.useState)(!1),{components:Z,loading:w}=R(o),E=i||(()=>{a("/launch-blocklet/install".concat(window.location.search))});return(0,y.jsxs)(P,{children:[(0,y.jsx)("div",{className:"app-content",children:(0,y.jsx)("div",{className:"agreement",children:(0,y.jsx)("div",{className:"agreement-content",children:(0,y.jsx)(d.Z,{blockletMeta:{data:o},locale:b,handleDescEle:l})})})}),(0,y.jsxs)(m.Z,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[w?(0,y.jsx)(p.JO,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,t&&null!==Z&&void 0!==Z&&Z.length?(0,y.jsxs)(m.Z,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[(0,y.jsx)(u.Z,{sx:{mr:.5},checked:n,onChange:e=>t(e.currentTarget.checked),control:(0,y.jsx)(h.Z,{}),label:(0,y.jsx)("span",{children:g("launchBlocklet.installRelatedComponents")})}),(0,y.jsx)(m.Z,{sx:{"> button svg":{color:"primary.main"}},children:(0,y.jsx)(f.Z,{size:"small",onClick:()=>{k(!0)},children:(0,y.jsx)(p.JO,{icon:"octicon:package-dependencies-16"})})})]}):null,(0,y.jsx)("div",{className:"button-container","data-cy":"agree-all",children:(0,y.jsx)(c.Z,{onContinue:E,description:(0,y.jsx)(v,{}),texts:{listenName:g("launchBlocklet.license"),buttonNext:g("launchBlocklet.next")}})})]}),(0,y.jsx)(C,{installRelated:n,meta:o,show:j,onClose:()=>{k(!1)},components:Z,loading:w})]})}S.propTypes={meta:l().object.isRequired,onClickNext:l().func,handleDescEle:l().node,installRelated:l().bool,onChangeInstallRelated:l().func},S.defaultProps={onClickNext:null,handleDescEle:"",installRelated:!0,onChangeInstallRelated:null};const P=a.Z.div(E||(E=(0,o.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n flex: 1;\n .app-content {\n padding: 2px 24px 24px;\n "," {\n padding-top: 10px;\n }\n width: 100%;\n flex: 1;\n letter-spacing: normal;\n }\n .agreement {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n border: 1px solid ",";\n border-radius: 12px;\n "," {\n margin-top: 24px;\n }\n "," {\n margin-top: 16px;\n }\n .agreement-content {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n font-size: 14px;\n overflow-y: auto;\n "," {\n padding: 0 24px;\n }\n "," {\n padding: 0 16px;\n }\n &:after {\n display: block;\n content: '';\n height: 24px;\n }\n }\n }\n .agreement-bottom {\n display: flex;\n width: 100%;\n padding: 24px;\n "," {\n flex-direction: row;\n align-items: center;\n margin-left: auto;\n }\n "," {\n flex-direction: column;\n align-items: center;\n padding-top: 0;\n padding-bottom: 16px;\n }\n }\n .button-container {\n "," {\n margin-left: auto;\n }\n "," {\n padding-top: 0;\n padding-bottom: 16px;\n }\n }\n"])),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.palette.grey[100]),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")))},80378:(e,n,t)=>{"use strict";t.d(n,{Z:()=>u});var o=t(55898),i=t.n(o),l=t(62681),r=t(72333),a=t(6352),s=t.n(a),c=t(35432),d=t(58238),p=t(14491);var m=t(96266);function u(e){let{blocklet:n,style:t,size:o,ancestors:i,...a}=e;const u=(0,d.h6)(),{logoUrl:h,inService:f}=function(e){var n;let{blocklet:t,ancestors:o=[]}=e;const i=(0,d.h6)(),{inService:l}=i,r="?v=".concat(null===t||void 0===t||null===(n=t.meta)||void 0===n?void 0:n.version).concat((0,p.XN)(null===t||void 0===t?void 0:t.status)?"~":"");let a=l?s()(p.zn,c.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",r):s()(i.imgPrefix,"blocklet.png");if("registry"===t.source&&t.deployedFrom&&t.meta.logo)a=s()(t.deployedFrom,(0,p.lk)(t.meta.bundleDid,t.meta.logo),r);else{const e=window.env.apiPrefix||"/",n=o.concat(t),i=l?n.slice(1):n;a=s()(e,"/blocklet/logo-bundle".concat(i.map((e=>"/".concat(e.meta.did))).join("")),r)}return{logoUrl:a,inService:l}}({blocklet:n,ancestors:i}),{variant:x}=a,g=f?()=>{}:e=>{e.target.src="".concat(u.imgPrefix,"/blocklet.png")};let y=(0,m.jsx)("img",{src:h,onError:g,alt:n.meta.name,style:{width:o}});return n.meta.logo||(y=(0,m.jsx)(r.Z,{did:n.meta.did||"",responsive:!0})),(0,m.jsx)(l.Z,{variant:x||"square",style:Object.assign({backgroundColor:"transparent",width:o,height:o,borderRadius:10},t),...a,children:y})}u.propTypes={blocklet:i().object.isRequired,style:i().object,size:i().oneOfType([i().number,i().string]),ancestors:i().array},u.defaultProps={style:{},size:40,ancestors:[]}},74286:(e,n,t)=>{"use strict";t.d(n,{Z:()=>a});var o=t(55898),i=t.n(o),l=t(39948),r=t(96266);function a(e){let{depth:n,className:t}=e;return(0,r.jsx)(l.Z,{ml:Math.max(2*(n-1),0),className:t,sx:{borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}a.propTypes={depth:i().number,className:i().string},a.defaultProps={depth:1,className:""}},61813:(e,n,t)=>{"use strict";t.d(n,{Z:()=>R});var o=t(5057),i=t(55898),l=t.n(i),r=t(13128),a=t(44846),s=t(55372),c=t(11750),d=t(47020),p=t(20870),m=t(31089),u=t(71767),h=t(64886),f=t(22425),x=t(68420),g=t(28726),y=t(88574),v=t(38242),b=t(58238),j=t(73545),k=t(14491),C=t(4651),Z=t(17450),w=t(96266);function R(e){let{defaultUrl:n,onCancel:t,onSuccess:i,onError:l,mode:R,handleText:E}=e;const{api:S}=(0,b.h6)(),{api:P}=(0,j.T)(),[T,I]=(0,o.useState)(!1),[U,N]=(0,o.useState)(""),{t:D}=(0,x.PE)(),A={dist:{}},[B,L]=(0,o.useState)(n),[O,F]=(0,o.useState)(n?1:0),[z,M]=(0,o.useState)(A),[q,G]=(0,o.useState)(!1),[W,V]=(0,o.useState)({}),K="component"===R,H=!!K||!n,J=async()=>{M(A),N(null),I(!0);try{const e=decodeURIComponent(B.trim());try{new URL(e)}catch{throw new Error("Invalid URL")}const{meta:n,inStore:t,registryUrl:o}=await S.getBlockletMetaFromUrl({input:{url:e}});M(n),V({inStore:t,registryUrl:o,inputUrl:B.trim()})}catch(e){console.error(e);const n="Blocklet Install failed: ".concat((0,k.Z)(e));N(n),l(e)}finally{I(!1)}};(0,o.useEffect)((()=>{n&&J()}),[n]);const _=[{name:D("common.name"),value:(0,v.getDisplayName)({meta:z},!0)},{name:D("common.version"),value:z.version},{name:D("common.did"),value:(0,w.jsx)(Z.Z,{did:z.did})},{name:D("common.author"),value:(0,k.rq)(z.author)},{name:D("blocklet.dist.downloadLink"),value:z.dist.tarball}],Q=[{label:D("blocklet.fromUrl.step0"),body:(0,w.jsx)(c.Z,{component:"div",children:(0,w.jsx)(d.Z,{label:D("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,style:{marginBottom:32},margin:"dense",helperText:D("blocklet.fromUrl.description"),value:B,onChange:e=>{N(null),L(e.target.value)},disabled:T,onKeyPress:e=>{"Enter"===e.key&&(e.preventDefault(),J(),F(1))}})}),cancel:D("common.cancel"),confirm:D("common.next"),onCancel:t,onConfirm:()=>{J(),F(1)}},{label:D("blocklet.fromUrl.step1"),body:T?(0,w.jsx)("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:(0,w.jsx)(a.Z,{})}):z.did?(0,w.jsx)("div",{style:{paddingLeft:"10%"},children:_.map((e=>e.name===D("common.did")?(0,w.jsx)(h.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:()=>D("common.did"),children:e.value},e.name):(0,w.jsx)(h.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name)))}):null,cancel:D(H?"common.pre":"common.cancel"),confirm:(null===E||void 0===E?void 0:E.confirm)||D("blocklet.fromUrl.confirm"),onCancel:()=>{H?F((e=>e-1)):t()},onConfirm:()=>{(()=>{if(K)return i({meta:z,...W}),void t();I(!0),G(!0)})()}}],Y=Q[O];return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(r.ZP,{title:(null===E||void 0===E?void 0:E.title)||D("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>Y.onCancel(),showCloseButton:0===O,disableEscapeKeyDown:!0,open:!0,actions:(0,w.jsxs)(w.Fragment,{children:[Y.cancel&&(0,w.jsx)(g.Z,{onClick:e=>{e.stopPropagation(),N(null),Y.onCancel()},color:"inherit",children:Y.cancel||D("common.cancel")}),(0,w.jsxs)(g.Z,{onClick:e=>{e.stopPropagation(),Y.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:T||!B||U,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[T&&0===O&&(0,w.jsx)(a.Z,{size:16}),Y.confirm]})]}),children:[H&&(0,w.jsx)(p.Z,{alternativeLabel:!0,activeStep:O,children:Q.map((e=>{let{label:n}=e;return(0,w.jsx)(m.Z,{children:(0,w.jsx)(u.Z,{children:n})},n)}))}),(0,w.jsx)(s.Z,{component:"div",style:{marginTop:24},children:Y.body}),!!U&&(0,w.jsx)(y.Z,{type:"error",style:{width:"100%",marginTop:8},children:U})]}),z&&q&&(0,w.jsx)(f.Z,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:P.get,checkTimeout:3e5,onSuccess:()=>{I(!1),G(!1),i({meta:z,...W}),t()},extraParams:{title:z.title,wt:(0,C.iK)(z),blockletMetaUrl:decodeURIComponent(B.trim())},messages:{title:D("setup.keyPair.title"),scan:D("setup.keyPair.scan"),confirm:D("setup.keyPair.confirm"),success:D("setup.keyPair.success")},onClose:()=>{I(!1),G(!1)}})]})}R.propTypes={defaultUrl:l().string,onCancel:l().func.isRequired,onSuccess:l().func.isRequired,onError:l().func,mode:l().oneOf(["install","component"]),handleText:l().object},R.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}}},59375:(e,n,t)=>{"use strict";t.d(n,{Z:()=>b});var o,i=t(71171),l=t(5057),r=t(55898),a=t.n(r),s=t(6352),c=t.n(s),d=t(33518),p=t(92706),m=t.n(p),u=t(39948),h=t(52277),f=t.n(h),x=t(68420),g=t(96266);const y=(0,l.lazy)((()=>Promise.all([t.e(6281),t.e(3674),t.e(9132)]).then(t.bind(t,84804)).then((e=>({default:e.Uploader}))))),v="/blocklet/logo/upload";function b(e){let{url:n,height:t,width:o,enabled:i,type:r,did:a,prefix:s,headers:d,onUploaded:p}=e;const{t:m}=(0,x.PE)(),h=(0,l.useRef)(null),b={cursor:i?"pointer":"default","&::after":{content:'"'.concat(m("common.switch"),'"')}};return(0,g.jsxs)(j,{id:"uploader-".concat(a,"-").concat(r),children:[(0,g.jsx)(y,{ref:h,popup:!0,onUploadFinish:()=>{var e;p(),null===(e=h.current)||void 0===e||e.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:c()(s,v,r,a),disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*",".jpg",".jpeg",".png",".gif",".svg"],maxFileSize:10485760,maxNumberOfFiles:1}},tusProps:{headers:d}}),(0,g.jsx)(u.Z,{className:f()("uploader-wrapper",i&&"enabled"),sx:b,onClick:()=>{var e;null===(e=h.current)||void 0===e||e.open()},children:(0,g.jsx)("img",{alt:"Logo",src:n,style:{height:t,width:o}})})]},"uploader-".concat(a,"-").concat(r))}b.propTypes={url:a().string.isRequired,type:a().oneOf(["square","rect","favicon"]).isRequired,did:a().string.isRequired,prefix:a().string.isRequired,headers:a().func,onUploaded:a().func,height:a().number,width:a().any,enabled:a().bool},b.defaultProps={height:80,width:"auto",enabled:!0,headers:()=>({}),onUploaded:m()};const j=d.Z.div(o||(o=(0,i.Z)(["\n .uploader-wrapper {\n display: inline-flex;\n position: relative;\n font-size: 0px;\n &.enabled {\n cursor: pointer;\n }\n &::after {\n display: none;\n }\n &.enabled::after {\n display: block;\n opacity: 0;\n position: absolute;\n bottom: 0;\n background: rgba(0, 0, 0, 0.2);\n left: 0;\n right: 0;\n height: 2.2em;\n color: white;\n text-align: center;\n font-size: 12px;\n line-height: 2em;\n transition: opacity 0.3s ease;\n }\n &:hover::after {\n opacity: 1;\n }\n }\n"])))},32349:(e,n,t)=>{"use strict";t.d(n,{Z:()=>a});var o=t(55898),i=t.n(o),l=t(22228),r=t(96266);function a(e){let{mode:n,...t}=e;return"development"===n?(0,r.jsx)(l.Z,{type:"primary",...t,children:"DEV"}):null}a.propTypes={mode:i().string.isRequired}},73170:(e,n,t)=>{"use strict";t.d(n,{$7:()=>x,AP:()=>y});var o=t(92877),i=t(55898),l=t.n(i),r=t(19577),a=t(2478),s=t(44067),c=t(46954),d=t(42507),p=t(40184),m=t(28726),u=t(76223),h=t(68420),f=t(96266);const x={meta:l().object.isRequired,onCancel:l().func.isRequired},g=(0,o.Z)((()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}})));function y(e){let{action:n,onSelect:t,onNext:o}=e;const i=g(),{t:l}=(0,h.PE)(),x=[{action:"purchase",title:l("store.purchase.purchase.title"),description:l("store.purchase.purchase.description")},{action:"verify",title:l("store.purchase.verify.title"),description:l("store.purchase.verify.description")}];return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(r.Z,{className:i.tabPanel,children:x.map((e=>(0,f.jsxs)(a.ZP,{button:!0,selected:n===e.action,onClick:()=>t(e.action),children:[(0,f.jsx)(c.Z,{className:i.iconRoot,children:"purchase"===e.action?(0,f.jsx)(d.Z,{style:{color:"purchase"===n?u.Z.primary.main:"#AAA",fontSize:32}}):(0,f.jsx)(p.Z,{style:{color:"verify"===n?u.Z.primary.main:"#AAA",fontSize:32}})}),(0,f.jsx)(s.Z,{primary:e.title,secondary:e.description})]},e.action)))}),o&&(0,f.jsx)(m.Z,{fullWidth:!0,disabled:!n,variant:"contained",color:"primary",style:{marginTop:16},onClick:o,children:l("common.next")})]})}y.propTypes={action:l().oneOf(["both","purchase","verify"]).isRequired,onSelect:l().func.isRequired,onNext:l().func.isRequired}},51233:(e,n,t)=>{"use strict";t.d(n,{Rw:()=>d,fX:()=>c,sf:()=>p});var o=t(35432),i=t(44543),l=t.n(i),r=t(77277),a=t(32828);const s=(e,n)=>{if(e.type===o.ROUTING_RULE_TYPES.REDIRECT){if(!e.url)return new Error("".concat(n("router.validation.redirectUrlRequired")));if(!e.redirectCode)return new Error("redirect ".concat(n("router.validation.redirectCodeRequired")))}else if(e.type===o.ROUTING_RULE_TYPES.BLOCKLET&&!e.did)return new Error(n("router.validation.didRequired"));return null},c=(e,n)=>{const t=s(e,n);return t||(e.pathPrefix.length?e.pathPrefix.length>150?new Error(n("router.validation.pathPrefixTooLong",{length:150})):null:new Error(n("router.validation.pathPrefixCannotBeEmpty")))},d=e=>{let{params:n,blocklets:t,blocklet:o,locale:i="en"}=e;if(o){let e=(o.children||[]).find((e=>(0,a.default)(e.meta)&&l()(e.mountPoint,n.pathPrefix)));if("gateway"!==o.meta.group&&"/"===n.pathPrefix&&(e="/"),e)return{zh:"\u6302\u8f7d\u70b9 ".concat(n.pathPrefix," \u5df2\u5b58\u5728\uff0c\u8bf7\u4f7f\u7528\u5176\u4ed6\u6302\u8f7d\u70b9"),en:"The mount point ".concat(n.pathPrefix," already exist, please use another mount point")}[i]}const s=t.find((e=>e.meta.did===n.did));if(!s)return"";const c=s.meta.interfaces.find((e=>"web"===e.type));return c&&c.prefix!==r.BLOCKLET_DYNAMIC_PATH_PREFIX&&n.pathPrefix!==c.prefix?{zh:"\u8be5 blocklet \u53ea\u80fd\u6302\u8f7d\u5728 ".concat(c.prefix),en:"This blocklet can only be mounted on ".concat(c.prefix)}[i]:""},p=e=>{if(!e||"string"!==typeof e)return e;let n=e.trim();try{return n=n.toLowerCase(),n.startsWith("http://")||n.startsWith("https://")?new URL(n).hostname:n}catch(t){return console.error("format domain failed",t),n}}},50185:(e,n,t)=>{"use strict";t.d(n,{Z:()=>c});var o=t(5057),i=t(55898),l=t.n(i),r=t(12937),a=t(68420),s=t(96266);function c(e){let{children:n,...t}=e;const{t:i}=(0,o.useContext)(a.RD);return(0,s.jsx)(r.Z,{tip:i("common.copyTip"),copiedTip:i("common.copiedTip"),...t,children:n})}c.propTypes={children:l().any.isRequired}},71363:(e,n,t)=>{"use strict";t.d(n,{Z:()=>m});var o=t(55898),i=t.n(o),l=t(11750),r=t(47020),a=t(93938),s=t(68420),c=t(50185),d=t(70461),p=t(96266);function m(e){let{title:n,description:t,confirmPlaceholder:o,cancel:i,confirm:m,params:u,onCancel:h,onConfirm:f,keyName:x}=e;const{t:g}=(0,s.PE)(),y={title:()=>(0,p.jsxs)("div",{children:[n," (".concat(x,")")]}),description:(e,n)=>(0,p.jsxs)("div",{children:[(0,p.jsx)(a.Z,{severity:"warning",style:{width:"100%"},children:g("common.notice")}),(0,p.jsx)("div",{style:{marginTop:24,marginBottom:24},dangerouslySetInnerHTML:{__html:t}}),(0,p.jsxs)("div",{style:{marginBottom:24},children:[g("common.click"),"\uff1a",(0,p.jsx)(c.Z,{"data-cy":"click-copy",children:x})]}),(0,p.jsx)(l.Z,{component:"div",children:(0,p.jsx)(r.Z,{label:o,autoComplete:"off","data-cy":"delete-confirm-input",variant:"outlined",fullWidth:!0,autoFocus:!0,value:e.inputVal,onChange:t=>{var o;o={...e,inputVal:t.target.value,__disableConfirm:x!==t.target.value},n({...o,__disableConfirm:o.__disableConfirm})}})})]}),confirm:m,cancel:i,onConfirm:f,onCancel:h,params:{inputVal:"",__disableConfirm:!0,...u}};return(0,p.jsx)(d.Z,{title:y.title,description:y.description,confirm:y.confirm,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})}m.propTypes={title:i().any.isRequired,keyName:i().any.isRequired,description:i().any.isRequired,confirmPlaceholder:i().any.isRequired,cancel:i().string,confirm:i().string,params:i().object,onCancel:i().func,onConfirm:i().func.isRequired},m.defaultProps={onCancel:()=>{},cancel:"",confirm:"Confirm",params:{}}},28641:(e,n,t)=>{"use strict";t.d(n,{Z:()=>g});var o=t(5057),i=t(55898),l=t.n(i),r=t(39948),a=t(47020),s=t(44846),c=t(13727),d=t(56184),p=t(67680),m=t(35406),u=t(11875),h=t(95890),f=t(96266);const x=(e,n,t)=>null===e&&n&&t?"******":e?n?"******":e:"";function g(e){let{label:n,disabled:t,required:i,initialValue:l,onChange:g,placeholder:y,style:v,onSubmit:b,secure:j,triggers:k,formatterBeforeSubmit:C,...Z}=e;const[w,R]=(0,o.useState)(!1),[E,S]=(0,o.useState)(!1),[P,T]=(0,o.useState)(j&&"__encrypted__"===l?null:l),[I,U]=(0,o.useState)(P),N=async()=>{S(!0);try{if(!1===await b(I))U(P);else{let e=I;"function"===typeof C&&(e=C(I)),U(e),T(e)}}catch(e){U(P)}finally{S(!1),R(!1)}},D=w?(0,f.jsx)(a.Z,{style:{flex:1},fullWidth:!0,value:I,onChange:e=>{var n;n=e.target.value,U(n),g(n)},autoFocus:!0,size:"small",variant:"outlined",placeholder:y,onKeyDown:e=>{"Enter"===e.key&&N()},disabled:t,type:j?"password":"text",...Z}):(0,f.jsx)(r.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:x(I,j,l)});return(0,f.jsx)(u.Z,{className:"form",style:v,children:(0,f.jsxs)(r.Z,{className:"form-item",children:[(0,f.jsxs)(r.Z,{className:"form-item-label",children:[n,i&&(0,f.jsx)(m.Z,{})]}),(0,f.jsxs)(r.Z,{className:"form-item-body",children:[(0,f.jsx)(r.Z,{className:"form-item-input",children:D}),(0,f.jsx)(r.Z,{className:"form-item-action",children:w?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(p.Z,{"data-cy":"schema-form-item-confirm",onClick:N,disabled:t||E,size:"large",children:E?(0,f.jsx)(s.Z,{size:24}):(0,f.jsx)(d.Z,{})}),(0,f.jsx)(p.Z,{"data-cy":"schema-form-item-cancel",onClick:()=>{U(P),R(!1)},disabled:t||E,size:"large",children:(0,f.jsx)(c.default,{})})]}):(0,f.jsx)(h.Z,{triggers:k,onEnterEdit:()=>R(!0),disabled:t})})]})]})})}g.propTypes={style:l().object,onSubmit:l().func,onChange:l().func,label:l().string,initialValue:l().string,placeholder:l().string,required:l().bool,disabled:l().bool,secure:l().bool,triggers:l().array,formatterBeforeSubmit:l().func},g.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",placeholder:"",required:!1,disabled:!1,secure:!1,triggers:[],formatterBeforeSubmit:null}},11875:(e,n,t)=>{"use strict";t.d(n,{Z:()=>a});var o,i=t(71171),l=t(33518),r=t(39948);const a=(0,l.Z)(r.Z)(o||(o=(0,i.Z)(["\n width: 100%;\n flex-grow: 1;\n overflow-y: auto;\n "," {\n width: 100%;\n flex-shrink: 0;\n padding: 0 24px;\n transform: translate(0, 0);\n /* max-height: 60vh; */\n }\n\n .form-item {\n width: 100%;\n margin-bottom: 24px;\n position: relative;\n "," {\n flex-wrap: wrap;\n justify-content: space-between;\n width: 100%;\n flex-shrink: 0;\n }\n }\n\n .form-item-body {\n display: flex;\n align-items: center;\n width: 100%;\n margin-top: 4px;\n }\n\n .form-item-label {\n line-height: 1.2;\n font-size: 14px;\n color: #888;\n font-weight: bold;\n\n "," {\n text-align: left;\n width: auto;\n flex-grow: 1;\n }\n }\n\n .form-item-input {\n flex-grow: 1;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n &.slot {\n height: 40px;\n line-height: 40px;\n background: #f8f8f8;\n font-size: 16px;\n\n .MuiChip-root {\n margin-top: -4px;\n }\n }\n\n .MuiSelect-select {\n padding: 8px;\n }\n }\n\n .form-item-action {\n // width: 100px;\n text-align: left;\n margin-left: 12px;\n flex-shrink: 0;\n "," {\n width: auto;\n margin-left: 0px;\n }\n .MuiIconButton-root {\n padding: 8px;\n svg {\n fill: #888;\n }\n &.Mui-disabled {\n opacity: 0.4;\n }\n }\n }\n"])),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md")))},95890:(e,n,t)=>{"use strict";t.d(n,{Z:()=>g});var o=t(5057),i=t(55898),l=t.n(i),r=t(24558),a=t(67680),s=t(56556),c=t(80633),d=t(49390),p=t(72113),m=t(25228),u=t(49020),h=t(74490),f=t(1733),x=t(96266);function g(e){let{triggers:n,onEnterEdit:t,disabled:i}=e;const l=o.useRef(null),[g,y]=o.useState(!1);return 0===n.length?(0,x.jsx)(a.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:i,size:"large",children:(0,x.jsx)(r.Z,{})}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(c.Z,{variant:"outlined",ref:l,"aria-label":"split button",children:[(0,x.jsx)(s.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:i,size:"large",children:(0,x.jsx)(r.Z,{})}),(0,x.jsx)(s.Z,{size:"small","aria-controls":g?"split-button-menu":void 0,"aria-expanded":g?"true":void 0,onClick:()=>{y((e=>!e))},children:(0,x.jsx)(d.Z,{})})]}),(0,x.jsx)(u.Z,{sx:{zIndex:9999},open:g,anchorEl:l.current,role:void 0,placement:"bottom-end",children:(0,x.jsx)(m.Z,{children:(0,x.jsx)(p.d,{onClickAway:e=>{l.current&&l.current.contains(e.target)||y(!1)},children:(0,x.jsx)(f.Z,{id:"split-button-menu",autoFocusItem:!0,children:n.map((e=>(0,x.jsx)(h.Z,{onClick:()=>{return n=e.handler,y(!1),void n();var n},children:e.title},e.key)))})})})})]})}g.propTypes={triggers:l().arrayOf(l().shape({key:l().string.isRequired,title:l().string.isRequired,handler:l().func.isRequired})),onEnterEdit:l().func.isRequired,disabled:l().bool.isRequired},g.defaultProps={triggers:[]}},35406:(e,n,t)=>{"use strict";t.d(n,{Z:()=>l});var o,i=t(71171);const l=t(33518).Z.span(o||(o=(0,i.Z)(["\n color: ",";\n &::before {\n content: '*';\n }\n"])),(e=>e.theme.palette.error.main))},8790:(e,n,t)=>{"use strict";t.d(n,{Z:()=>c});var o,i=t(71171),l=t(33518),r=t(55898),a=t.n(r),s=t(96266);function c(e){let{children:n,...t}=e;return(0,s.jsx)(d,{...t,children:n})}c.propTypes={children:a().any.isRequired};const d=l.Z.div(o||(o=(0,i.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n\n .header {\n text-align: center;\n }\n\n .body {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-top: 30px;\n width: 100%;\n min-height: 200px;\n flex: 1;\n\n "," {\n padding: 24px;\n }\n\n "," {\n padding: 0 16px 16px;\n }\n }\n\n .footer {\n display: flex;\n justify-content: center;\n\n "," {\n padding-bottom: 34px;\n }\n\n "," {\n margin-top: auto;\n padding-bottom: 10px;\n }\n }\n"])),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.up("sm")),(e=>e.theme.breakpoints.down("md")))},22714:(e,n,t)=>{"use strict";t.d(n,{Z:()=>j});var o=t(5057),i=t(55898),l=t.n(i),r=t(92877),a=t(44846),s=t(13128),c=t(55372),d=t(11750),p=t(47020),m=t(2478),u=t(44919),h=t(68420),f=t(28726),x=t(88574),g=t(58238),y=t(14491),v=t(96266);const b=(0,r.Z)((e=>({addMenuItemRoot:{justifyContent:"center",color:e.palette.primary.main,lineHeight:"3.2"}})));function j(e){let{disabled:n,storeList:t,teamDid:i,onAdd:l}=e;const{api:r}=(0,g.h6)(),[j,k]=(0,o.useState)(!1),[C,Z]=(0,o.useState)(!0),[w,R]=(0,o.useState)(!1),[E,S]=(0,o.useState)(""),[P,T]=(0,o.useState)(""),{t:I}=(0,h.PE)(),U=b(),N=async()=>{k(!0);try{const{isNew:e,decoded:n}=(0,y.bQ)(E,t);if(!e)throw new Error(I("store.blockletRegistry.haveSameRegistry"));await r.addBlockletStore({input:{teamDid:i,url:n}}),l(n),R(!1)}catch(e){const n="".concat(I("store.blockletRegistry.addFailed")," ").concat((0,y.Z)(e));T(n)}finally{k(!1)}};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(m.ZP,{button:!0,disabled:n,className:U.addMenuItemRoot,onClick:()=>{R(!0)},children:[(0,v.jsx)(u.Z,{font:!0}),(0,v.jsx)(d.Z,{variant:"inherit",children:I("store.blockletRegistry.addRegistry")})]}),(0,v.jsxs)(s.ZP,{title:I("store.blockletRegistry.addRegistry"),fullWidth:!0,maxWidth:"md",open:w,onClose:()=>R(!1),PaperProps:{style:{minHeight:"auto"}},actions:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(f.Z,{onClick:e=>{e.stopPropagation(),R(!1)},color:"inherit",children:I("common.cancel")}),(0,v.jsxs)(f.Z,{onClick:e=>{e.stopPropagation(),N()},color:"primary","data-cy":"install-blocklet-next-step",disabled:j||!E||C,variant:"contained",autoFocus:!0,children:[j&&(0,v.jsx)(a.Z,{size:16}),I("common.confirm")]})]}),children:[(0,v.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,v.jsx)(c.Z,{component:"div",children:(0,v.jsx)(d.Z,{component:"div",children:(0,v.jsx)(p.Z,{label:I("store.blockletRegistry.registryUrl"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:E,onChange:e=>{T(null);let n=!1;e.target.value.trim()||(n=!0),e.target.value.trim()||T(I("store.blockletRegistry.registryUrlEmpty")),S(e.target.value),Z(n)},disabled:j,onKeyPress:e=>{"Enter"===e.key&&(e.preventDefault(),e.target.value.trim()?N():T(I("store.blockletRegistry.registryUrlEmpty")))}})})})}),!!P&&(0,v.jsx)(x.Z,{type:"error",style:{width:"100%"},children:P})]})]})}j.propTypes={teamDid:l().string.isRequired,disabled:l().bool,storeList:l().array,onAdd:l().func},j.defaultProps={disabled:!1,storeList:[],onAdd:()=>{}}},45170:(e,n,t)=>{"use strict";t.d(n,{Z:()=>j});var o=t(92877),i=t(11750),l=t(83580),r=t(94552),a=t(67680),s=t(55898),c=t.n(s),d=t(5057),p=t(96366),m=t(68420),u=t(47595),h=t(86229),f=t(58238),x=t(71363),g=t(14491),y=t(96266);function v(e){let{store:n,teamDid:t,onDelete:o}=e;const{api:i}=(0,f.h6)(),{t:l}=(0,m.PE)(),[r,s]=(0,d.useState)(!1),[c,v]=(0,d.useState)(null),b=(0,p.Z)(),j={keyName:n.url,title:l("store.blockletRegistry.deleteRegistry"),description:l("store.blockletRegistry.deleteDesc",{name:"<b>".concat(n.url,"</b>"),color:b.palette.error.main}),confirmPlaceholder:l("store.blockletRegistry.confirmDesc",{name:n.url}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:async()=>{try{s(!0),await i.deleteBlockletStore({input:{teamDid:t,url:n.url}}),o&&"function"===typeof o&&o()}catch(e){h.Z.error("Remove Blocklet Store Error: ".concat((0,g.Z)(e)))}finally{s(!1),v(null)}},onCancel:()=>{s(!1),v(null)}};return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(a.Z,{disabled:r,onClick:e=>{e.stopPropagation(),v(j)},size:"large",children:(0,y.jsx)(u.default,{})}),c&&(0,y.jsx)(x.Z,{keyName:c.keyName,title:c.title,description:c.description,confirmPlaceholder:c.confirmPlaceholder,confirm:c.confirm,cancel:c.cancel,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel})]})}v.propTypes={teamDid:c().string.isRequired,store:c().object.isRequired,onDelete:c().func},v.defaultProps={onDelete:()=>{}};const b=(0,o.Z)((()=>({buttonText:{textTransform:"none !important"},iconRoot:{minWidth:24},menuName:{display:"flex",flexDirection:"column",marginRight:"100px","& span":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})));function j(e){let{teamDid:n,store:t,onDelete:o}=e;const s=b();return(0,y.jsxs)("div",{className:s.menuName,children:[(0,y.jsx)(i.Z,{component:"span",variant:"subtitle1",style:{fontWeight:"400"},children:t.name}),(0,y.jsx)(i.Z,{className:"url",component:"span",variant:"inherit",children:"".concat(t.url)}),(0,y.jsxs)(l.Z,{children:[(0,y.jsx)(a.Z,{onClick:e=>{e.stopPropagation(),window.open(t.url)},size:"large",children:(0,y.jsx)(r.Z,{})}),!t.protected&&(0,y.jsx)(v,{store:t,onDelete:o,teamDid:n})]})]})}j.propTypes={teamDid:c().string.isRequired,store:c().shape({name:c().string.isRequired,url:c().string.isRequired,protected:c().bool}).isRequired,onDelete:c().func},j.defaultProps={onDelete:()=>{}}},35918:(e,n,t)=>{"use strict";t.d(n,{Z:()=>y});var o=t(44919),i=t(42876),l=t(27773),r=t(11997),a=t(93734),s=t(76667),c=t(39293),d=t(36903),p=t(3422),m=t(92273),u=t(72906),h=t(57201),f=t(49390),x=t(33225),g=t(30770);const y={Add:o.Z,Check:i.default,Delete:l.default,Edit:s.default,Clear:r.default,DetailPanel:m.default,Filter:c.Z,FirstPage:d.default,LastPage:p.default,NextPage:m.default,PreviousPage:u.default,Search:h.default,ResetSearch:r.default,SortArrow:f.Z,Export:a.default,ThirdStateCheck:x.default,ViewColumn:g.default}},74782:(e,n,t)=>{"use strict";t.d(n,{Z:()=>l});var o,i=t(71171);const l=t(33518).Z.div(o||(o=(0,i.Z)(["\n .MuiPaper-root {\n box-shadow: none !important;\n border: none !important;\n border-radius: 0 !important;\n background: transparent;\n }\n .MuiToolbar-root {\n background: transparent;\n padding-left: 0;\n display: none;\n }\n\n &.show-pagination {\n .MuiTablePagination-toolbar {\n display: flex;\n }\n }\n\n .MuiTableHead-root th {\n min-width: 100px;\n background: transparent;\n }\n\n .MuiTable-root {\n overflow-y: hidden;\n }\n .MuiTableRow-root {\n border: none !important;\n }\n\n .MuiTableCell-root {\n padding-right: 16px;\n &:last-of-type {\n padding-right: 0;\n }\n }\n\n /* @material-table/core@next \u517c\u5bb9 mui v5, \u4f46 pagination \u6837\u5f0f\u4f3c\u4e4e\u6709\u4e9b\u95ee\u9898, \u6682\u5730\u5b9a\u5236\u4e0b\u9762\u7684\u6837\u5f0f\u4fee\u590d, \u540e\u9762\u8003\u8651\u5f03\u7528 material-table */\n .MuiTablePagination-selectLabel,\n .MuiTablePagination-displayedRows {\n display: none;\n }\n .MuiTypography-caption {\n display: inline-block;\n }\n .MuiTablePagination-selectLabel + .MuiInputBase-root {\n margin-right: 8px;\n }\n"])))},5952:(e,n,t)=>{"use strict";t.d(n,{K_:()=>o,WC:()=>i});const o="blocklet-add-component-registry",i="server-add-registry"},40736:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),l=t(96266);n.Z=(0,i.default)((0,l.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward")},56184:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),l=t(96266);n.Z=(0,i.default)((0,l.jsx)("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done")},34966:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),l=t(96266);n.Z=(0,i.default)((0,l.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined")},33271:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),l=t(96266);n.Z=(0,i.default)((0,l.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")},48037:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),l=t(96266);n.Z=(0,i.default)((0,l.jsx)("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.09-.16-.26-.25-.44-.25-.06 0-.12.01-.17.03l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.06-.02-.12-.03-.18-.03-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.09.16.26.25.44.25.06 0 .12-.01.17-.03l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"SettingsOutlined")},99194:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),l=t(96266);n.Z=(0,i.default)((0,l.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"}),"Update")},52277:(e,n)=>{var t;!function(){"use strict";var o={}.hasOwnProperty;function i(){for(var e=[],n=0;n<arguments.length;n++){var t=arguments[n];if(t){var l=typeof t;if("string"===l||"number"===l)e.push(t);else if(Array.isArray(t)){if(t.length){var r=i.apply(null,t);r&&e.push(r)}}else if("object"===l){if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]")){e.push(t.toString());continue}for(var a in t)o.call(t,a)&&t[a]&&e.push(a)}}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(t=function(){return i}.apply(n,[]))||(e.exports=t)}()},2078:(e,n,t)=>{var o=t(26849);e.exports=function(e){return o(e).toUpperCase()}},30278:(e,n,t)=>{var o=t(31104),i=t(43676);e.exports=function(e,n){return e&&e.length?i(e,o(n,2)):[]}}}]);
1
+ /*! For license information please see 318.169a3e69.chunk.js.LICENSE.txt */
2
+ (self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[318],{20318:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>Ci});var o=t(5057),i=t(68420),l=t(71171),r=t(33518),a=t(55898),s=t.n(a),c=t(37541),d=t(39948),p=t(7278),m=t(6838),u=t(87971),h=t(99194),f=t(67680),x=t(44919),g=t(48037),y=t(55402),v=t(75239),b=t(48086),j=t(88092),k=t(26174),C=t(16147),Z=t(35432),w=t(44846),R=t(28726),E=t(25710),S=t(38242),P=t(86229),T=t(87363),I=t(44784),U=t(85531),N=t(96266);function D(e){let{children:n,...t}=e;const{t:o}=(0,i.PE)(),{updateAutoCheckUpdate:l,autoCheckUpdate:r}=(0,U.XN)(),a=Boolean(null===r||void 0===r?void 0:r.enabled);return(0,N.jsxs)(d.Z,{display:"flex",flexDirection:"row",alignItems:"center",children:[n,(0,N.jsx)(v.Z,{title:o("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:(0,N.jsx)("div",{children:(0,N.jsx)(I.Z,{checked:a,onChange:async()=>{try{const e=!(null!==r&&void 0!==r&&r.enabled);await l({enabled:e}),P.Z.success(o(e?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(e){P.Z.error(e.message)}},name:"enableWelcomePage",style:{...t.style,zoom:.8}})})})]})}D.propTypes={children:s().any},D.defaultProps={children:null};const A=D;var B,L,O=t(58238),F=t(14491),z=t(63406),M=t(76667),q=t(13128),G=t(94464),W=t(28358),V=t(47020),K=t(93938),H=t(77277),J=t(50185),_=t(35918),Q=t(74782),Y=t(55419);const X=(e,n)=>{let{description:t}=e;return(Object.values(H.CHAIN_PROP_MAP).includes(e.key)||(0,S.isEnvShareable)(e))&&(t=t?"".concat(t," (").concat(n("blocklet.config.sharedToAllComponents"),")"):n("blocklet.config.sharedToAllComponents")),t&&(0,N.jsx)("div",{style:{marginLeft:12},children:t})},$=function(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return!(null!==t&&void 0!==t&&t.length||e.custom||["CHAIN_ID","CHAIN_HOST"].includes(e.key)||n.meta.environments.find((n=>n.name===e.key))||!n.children.every((n=>!n.meta.environments.find((n=>n.name===e.key)))))||e.custom};function ee(e){let{blocklet:n,ancestors:t}=e;const l=(0,O.h6)(),{inService:r}=l,{t:a}=(0,o.useContext)(i.RD),s=[...t.map((e=>e.meta.did)),n.meta.did],c=()=>P.Z.success(a("blocklet.config.changedTip")),d=e=>$(e,n,t);if((0,F.wS)(n.status))return null;if("unknown"===n.status&&(0,F.wS)(n.status))return null;const p=(n.configs||[]).filter((e=>!H.BLOCKLET_CONFIGURABLE_KEY[e.key])),m=(0,S.getSharedConfigObj)(t[0],n),u=(0,S.getComponentMissingConfigs)(n,t[0]),h=p.map((e=>({...e,value:Object.values(H.CHAIN_PROP_MAP).includes(e.key)&&Object.keys(m).includes(e.key)?m[e.key]:m[e.key]||e.value}))),f=h.some((e=>e.key&&e.key.startsWith("BWA_"))),x={onRowAdd:async e=>{if(e.key.trim()&&e.value.trim())if(e.key.startsWith("BLOCKLET_")||e.key.startsWith("COMPONENT_"))P.Z.error(a("blocklet.config.environment.invalidKey"));else{e.custom=!0;try{const n=await l.api.configBlocklet({input:{did:s,configs:[e]}});c(n.blocklet)}catch(n){P.Z.error((0,F.Z)(n))}}else P.Z.error(a("blocklet.config.environment.keyValueRequired"))},onRowUpdate:async(e,o)=>{if(e.required&&(!e.key.trim()||!e.value.trim()))return void P.Z.error(a("blocklet.config.environment.keyValueRequired"));if(e.key.startsWith("BLOCKLET_")&&!H.BLOCKLET_CONFIGURABLE_KEY[e.key])return void P.Z.error(a("blocklet.config.environment.invalidKey"));if(e.key===H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const n=(0,F.I)(e);if(n)return void P.Z.error(n)}const i=[{...e,value:e.secure&&"__encrypted__"===e.value?"":e.value}];if(e.key!==o.key){if(!$(e,n,t))return void P.Z.error("Only key of custom env can be changed");i.push({key:o.key,custom:!0})}try{const e=await l.api.configBlocklet({input:{did:s,configs:i}});c(e.blocklet)}catch(r){P.Z.error((0,F.Z)(r))}},onRowDelete:async e=>{if(e.required)P.Z.error(a("blocklet.config.environment.deleteForbidden"));else if($(e,n,t))try{const n=await l.api.configBlocklet({input:{did:s,configs:[{key:e.key,custom:!0}]}});c(n.blocklet)}catch(o){P.Z.error((0,F.Z)(o))}else P.Z.error("Only key of custom env can be changed")},isDeletable:d};return(0,N.jsxs)(ne,{children:[!!u.length&&(0,N.jsx)(K.Z,{severity:"error",style:{marginTop:24},children:a("blocklet.config.missingRequired")}),f&&(0,N.jsx)(K.Z,{severity:"info",children:a("blocklet.config.environment.tip")}),(0,N.jsx)(z.Z,{permission:r?"":"mutate_blocklets",role:r?F.Wf:[],children:e=>(0,N.jsx)(Q.Z,{className:"config-table",children:(0,N.jsx)(W.ZP,{title:(0,N.jsx)("h4",{children:a("common.environment")}),columns:[{title:a("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:e=>(0,N.jsx)(J.Z,{value:e.value,style:{color:e.required&&!e.value?"#ff4436":"#222222",fontWeight:e.required?"bold":"normal"},children:e.key}),editComponent:e=>{const{value:n,rowData:t,onChange:o}=e;return(0,N.jsx)(te,{children:(0,N.jsx)(V.Z,{fullWidth:!0,size:"small",disabled:!1===d(t),value:n,onChange:e=>o(e.target.value),variant:"outlined",label:"Key",placeholder:a("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:a("common.value"),field:"value",initialEditValue:"Value",width:"calc((100% - (96px + 30%)) / 1)",render:e=>e.value?e.secure?"******":(0,N.jsx)(J.Z,{unstyled:!0,value:e.value,style:{wordBreak:"break-all"},children:e.value}):null,editComponent:e=>{const{value:n,rowData:t,onChange:o}=e;return(0,N.jsxs)(te,{children:[(0,N.jsx)(V.Z,{fullWidth:!0,size:"small",value:"__encrypted__"===n?"":n,onChange:e=>o(e.target.value),variant:"outlined",label:a("common.value"),placeholder:a("blocklet.config.environment.value"),margin:"dense",autoFocus:!0}),X(t,a)]})}}],icons:{...Y.Z,..._.Z},options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1},localization:{header:{actions:a("common.actions")},body:{emptyDataSourceMessage:a("common.noData")}},data:h,editable:e?x:{}})})})]})}ee.propTypes={blocklet:s().object.isRequired,ancestors:s().array},ee.defaultProps={ancestors:[]};const ne=r.Z.div(B||(B=(0,l.Z)(["\n .config-table {\n margin-bottom: 24px;\n position: relative;\n .hide-control {\n position: absolute;\n top: 10px;\n left: 200px;\n @media (max-width: ","px) {\n left: 160px;\n }\n }\n\n .MuiToolbar-root {\n display: flex;\n }\n\n .MuiTableRow-head {\n display: none;\n }\n\n &.hide-header {\n .MuiToolbar-root {\n display: none;\n }\n }\n }\n\n .accordion {\n margin-bottom: 16px;\n &:last-of-type {\n margin-bottom: 0;\n }\n padding: 8px 0 8px 0px;\n &.MuiAccordion-root {\n background: transparent;\n box-shadow: none;\n border: 1px solid #ddd;\n border-radius: 4px;\n &::before,\n &::after {\n height: 0;\n }\n .MuiAccordionSummary-root {\n padding-left: 0;\n }\n .accordion-title {\n font-weight: bold;\n padding-left: 16px;\n }\n }\n }\n"])),(e=>e.theme.breakpoints.values.sm)),te=r.Z.div(L||(L=(0,l.Z)(["\n height: 60px;\n"])));var oe,ie=t(45239),le=t.n(ie),re=t(28641);function ae(e){let{blocklet:n,ancestors:t,hasPermission:l,...r}=e;const{t:a}=(0,i.PE)(),{api:s}=(0,O.h6)(),c=!t.length,p=c?n.meta.did:t.map((e=>e.meta.did))[0],[m,u]=(0,o.useState)(""),[h,f]=(0,o.useState)(""),x=m||!l;if(!p)return null;if("unknown"===n.status&&(0,F.wS)(n.status))return null;return(0,N.jsx)(pe,{component:"div",...r,children:(0,N.jsx)(d.Z,{mt:3,children:(0,N.jsx)(re.Z,{label:a("blocklet.component.mountPoint"),style:{marginTop:-24},disabled:m||x,loading:m,required:!0,initialValue:n.mountPoint,onSubmit:async e=>{u(!0);try{const t={rootDid:p,mountPoint:le()(e)};return c||(t.did=n.meta.did),await s.updateComponentMountPoint({input:t}),u(!1),!0}catch(t){throw u(!1),t.message=(0,F.Z)(t),P.Z.error(t.message),t}},onChange:e=>{f(a("common.slugifyHint",{value:(0,F.LN)(e)}))},helperText:h,formatterBeforeSubmit:e=>le()(e)})})})}const se=(0,z.V)(ae,"mutate_blocklets"),ce=(0,z.V)(ae,"",F.Wf);function de(e){const{inService:n}=(0,O.h6)();return n?(0,N.jsx)(ce,{...e}):(0,N.jsx)(se,{...e})}ae.propTypes={blocklet:s().object.isRequired,ancestors:s().array,hasPermission:s().bool},ae.defaultProps={ancestors:[],hasPermission:!1};const pe=r.Z.div(oe||(oe=(0,l.Z)([""])));var me;function ue(e){let{blocklet:n,ancestors:t,children:l}=e;const[r,a]=(0,o.useState)(""),{t:s}=(0,i.PE)(),c=!!t.length,[p,m]=(0,o.useState)((0,S.hasStartEngine)(null===n||void 0===n?void 0:n.meta)?"settings":"environments"),u=c?(0,S.getDisplayName)(n,!0):s("blocklet.component.container");if((0,F.wS)(n.status))return null;if("unknown"===n.status&&(0,F.wS)(n.status))return null;const h=e=>{e.stopPropagation(),a(!0)},x={settings:(0,S.hasStartEngine)(n.meta)&&{label:s("blocklet.component.setting"),value:"settings",component:(0,N.jsx)(de,{blocklet:n,ancestors:t})},environments:{label:s("common.environment"),value:"environments",component:(0,N.jsx)(ee,{blocklet:n,ancestors:t})}},g=Object.values(x).filter(Boolean),y=g.map((e=>{let{label:n,value:t}=e;return{label:n,value:t}})),v=x[p]||g[0];return["function"===typeof l?l({open:h}):(0,N.jsx)(f.Z,{onClick:h,"data-cy":"action-config-component",children:(0,N.jsx)(M.default,{})}),r&&(0,N.jsx)(he,{open:!0,fullWidth:!0,maxWidth:"md",title:u,onClose:()=>{a(!1)},PaperProps:{style:{minHeight:"auto"}},children:c?(0,N.jsxs)(d.Z,{mt:1,children:[(0,N.jsx)(G.Z,{tabs:y,current:p,onChange:e=>{m(e)},scrollButtons:"auto"}),v.component]}):(0,N.jsx)(ee,{blocklet:n,ancestors:t})})]}ue.propTypes={blocklet:s().object.isRequired,ancestors:s().array,children:s().any},ue.defaultProps={ancestors:[],children:null};const he=(0,r.Z)(q.ZP)(me||(me=(0,l.Z)(["\n .MuiDialogContent-root {\n padding-top: 0;\n margin-top: -32px;\n }\n .MuiToolbar-root {\n padding-right: 12px;\n }\n .ux-dialog_right {\n padding-right: 20px;\n }\n"])));var fe=t(74490),xe=t(33271),ge=t(15715),ye=t(5952),ve=t(85493),be=t(30278),je=t.n(be),ke=t(79077),Ce=t.n(ke),Ze=t(75506),we=t.n(Ze),Re=t(3785),Ee=t.n(Re),Se=t(2660),Pe=t(11750),Te=t(42876),Ie=t(63902),Ue=t(51703),Ne=t(88574),De=t(35266),Ae=t(55309),Be=t(29054),Le=t(24558),Oe=t(13727),Fe=t(56184),ze=t(11819),Me=t(67486);const qe={description:s().string,editing:s().bool,onChange:s().func,required:s().bool,value:s().any,componentProps:s().object,render:s().func,renderFormItem:s().func};function Ge(e){let{editing:n,value:t,onChange:i}=e;const[l,r]=(0,o.useState)(!1),a=(0,o.useRef)(),s=(0,o.useRef)(t);(0,o.useEffect)((()=>{let e=null;return n&&(e=setTimeout((()=>{r(!0)}),50)),()=>{clearTimeout(e)}}),[n]);const c=(0,N.jsx)(d.Z,{className:"form-item-input slot",px:1,children:(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[t,"auto"!==t&&(0,N.jsx)("div",{style:{marginLeft:4,backgroundColor:t,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=(0,N.jsxs)(d.Z,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:()=>{r(!1),i(s.current)},children:[(0,N.jsx)(d.Z,{display:"flex",alignItems:"center",onClick:()=>r(!0),children:(0,N.jsx)("div",{ref:a,style:{flexShrink:0,marginLeft:"8px",backgroundColor:t,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:"auto"===t?"default":"pointer"}})}),(0,N.jsx)(ze.ZP,{open:l,anchorEl:a.current,onClose:()=>r(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:(0,N.jsx)(Me.AI,{color:t,onChange:e=>{return n=e.hex,s.current=n,void i(n);var n}})})]});return n?p:c}function We(e){let{editing:n,description:t,value:i,onChange:l,componentProps:r,...a}=e;const{placeholder:s}=r,c=(0,o.useRef)(i),p=e=>{"Enter"===e.key&&l(c.current,"confirm")};return n?(0,N.jsx)(V.Z,{style:{flex:1},fullWidth:!0,value:i,onChange:e=>{var n;e.persist(),n=e.target.value,c.current=n,l(n)},autoFocus:!0,size:"small",variant:"outlined",placeholder:t||s,onKeyDown:p,...a}):(0,N.jsx)(d.Z,{px:1,className:"form-item-input slot",children:i})}Ge.propTypes=qe,We.propTypes=qe,We.defaultProps={componentProps:{}};var Ve=t(49777),Ke=t.n(Ve),He=t(76818);function Je(e){let{editing:n,value:t,onChange:o,componentProps:i,...l}=e;const{blocklet:r}=i,a="auto"===t?(0,He.getPassportColorFromDid)(r.appDid):t;return(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,N.jsx)("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Ke()({title:"Owner",issuer:(0,S.getDisplayName)(r),issuerDid:r.appDid,ownerName:"Your Name",ownerDid:r.appDid,preferredColor:t||"auto"})}}),(0,N.jsx)(Ge,{...l,editing:n,value:n?a:t,onChange:o,componentProps:i})]})}Je.propTypes={...qe,componentProps:s().shape({blocklet:s().object.isRequired}).isRequired},Je.defaultProps={};var _e,Qe=t(35406),Ye=t(11875),Xe=t(59375);const $e={input:We,color:Ge,passport:Je,uploader:e=>(0,N.jsx)(Xe.Z,{...e.componentProps})};function en(e){let{schema:n,loading:t,value:i,defaultValue:l,onChange:r,style:a,disabled:s}=e;const c="[object Object]"===Object.prototype.toString.call(i),[p,m]=(0,o.useState)(null),[u,h]=(0,o.useState)(c?i:l),x=(0,o.useRef)();function g(e,n,t){const{key:o,secure:i}=e,l=u[o]!==n,a={...u,[o]:n};l&&h(a),r({[o]:n},{allValues:a,action:t,currentItem:e}),"confirm"===t&&i&&h({...u,[o]:"__encrypted__"}),["confirm","cancel"].includes(t)?y(null):y(e)}function y(e){if(e)return x.current=u[e.key],void m(e);x.current=null,m(null)}return(0,N.jsx)(nn,{className:"form",style:a,children:null===n||void 0===n?void 0:n.map((e=>{const{key:n,description:o,required:l,solo:r=!1,hidden:a=!1,componentProps:m={}}=e;if(a)return null;const h=!(!p||n!==p.key),y=function(e,n){let{editing:t=!1}=n;const{key:o}=e,l=c?i[o]:u[o];return"__encrypted__"===l?t?"":"******":l}(e,{editing:h}),v=function(e,n){let{editing:t=!1}=n;const{componentType:o="input",render:i,renderFormItem:l}=e;return t&&l?l:!t&&i?i:$e[null===o||void 0===o?void 0:o.toLowerCase()]}(e,{editing:h}),b={inputProps:{"data-cy":"schema-form-item-component"},key:n,description:o,editing:h,value:y,onChange:function(n){return g(e,n,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"change")},componentProps:m};return(0,N.jsxs)(d.Z,{className:"form-item",children:[!r&&(0,N.jsxs)(d.Z,{className:"form-item-label",style:{color:l&&!y?"#ff0000":"#333"},children:[o,l&&(0,N.jsx)(Qe.Z,{})]}),(0,N.jsxs)(d.Z,{className:"form-item-body",children:[(0,N.jsx)(d.Z,{className:"form-item-input",sx:{textAlign:r?"center":"left"},children:(0,N.jsx)(v,{...b})}),!r&&(0,N.jsx)(d.Z,{className:"form-item-action",children:h?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(f.Z,{"data-cy":"schema-form-item-confirm",onClick:()=>{g(e,y,"confirm")},disabled:s||t,size:"large",children:t?(0,N.jsx)(w.Z,{size:24}):(0,N.jsx)(Fe.Z,{})}),(0,N.jsx)(f.Z,{"data-cy":"schema-form-item-cancel",onClick:()=>{g(e,x.current,"cancel")},disabled:s||t,size:"large",children:(0,N.jsx)(Oe.default,{})})]}):(0,N.jsx)(f.Z,{"data-cy":"schema-form-item-edit",onClick:()=>{g(e,u[n],"edit")},disabled:s||p,size:"large",children:(0,N.jsx)(Le.Z,{})})})]})]},n)}))})}en.propTypes={schema:s().array.isRequired,loading:s().bool,onChange:s().func.isRequired,value:s().object,defaultValue:s().object,style:s().object,disabled:s().bool},en.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const nn=(0,r.Z)(Ye.Z)(_e||(_e=(0,l.Z)([""])));var tn=t(6352),on=t.n(tn),ln=t(22425),rn=t(28018),an=t.n(rn),sn=t(60344),cn=t(73170);function dn(e){let{meta:n,onCancel:t,mode:l,handlePaySuccess:r}=e;const{t:a,locale:s}=(0,i.PE)(),{info:c}=(0,O.h6)(),d=(0,F.yP)(c),[p,m]=(0,o.useState)(null),u=new URL(null===n||void 0===n?void 0:n.registryUrl).origin,h=(0,S.getDisplayName)({meta:n});if((0,o.useEffect)((()=>{if("purchase"===l){const t=new URL(u);t.pathname="/api/did/verify-purchase-blocklet/token",t.searchParams.set("serverDid",c.did),t.searchParams.set("blockletDid",null===n||void 0===n?void 0:n.did);try{sn.hi.get(t.href).then((e=>{let{data:n}=e;const t="".concat(n.url);m(t)}))}catch(e){console.error("get next workflow url error: ",e)}}return()=>{m(null)}}),[l]),"purchase"===l&&!p)return"";const f={verify:{action:"verify-purchase-blocklet",checkFn:sn.od.create({baseURL:u}).get,extraParams:{serverDid:c.did,blockletDid:null===n||void 0===n?void 0:n.did},messages:{title:a("store.purchase.verify.auth.title",{name:h}),scan:a("store.purchase.verify.auth.scan"),confirm:a("store.purchase.verify.auth.confirm"),success:a("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:sn.od.create({baseURL:on()(u,"/store")}).get,extraParams:{factory:n.nftFactory,nw:p},messages:{title:a("store.purchase.auth.title",{name:h}),scan:a("store.purchase.auth.scan"),confirm:a("store.purchase.auth.confirm"),success:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:a("store.purchase.auth.success")}),(0,N.jsx)("p",{children:a("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return(0,N.jsx)(ln.Z,{open:!0,locale:s,popup:!1,saveConnect:!1,className:"connect",baseUrl:u,onSuccess:async(e,n)=>{const o=e=>{let{downloadTokenList:n}=e;r({downloadTokenList:n})},i=e=>{P.Z.error(e),t(e)};if("purchase"===l&&p){const{statusUrl:e}=(0,F.Pi)(p);await(s=e,an()((()=>sn.hi.get(s).then((async e=>{let{data:n}=e;const t=null===n||void 0===n?void 0:n.downloadTokenList;return"succeed"===n.status?t&&t.length?(await o({downloadTokenList:t}),!0):(await i(a("blocklet.component.missDownloadTokenTip")),!0):"error"===n.status&&(console.error("vc error: ",n),await i(null===n||void 0===n?void 0:n.error),!0)}))),{interval:1e3}))}else await o({downloadTokenList:e.downloadTokenList&&n(e.downloadTokenList)});var s},cancelWhenScanned:t,onClose:t,checkTimeout:3e5,webWalletUrl:d,disableClose:!0,showDownload:!1,...f[l]})}dn.propTypes={...cn.$7,handlePaySuccess:s().func,mode:s().oneOf(["verify","purchase"]).isRequired},dn.defaultProps={handlePaySuccess:()=>{}};const pn=(0,o.forwardRef)(((e,n)=>{let{mode:t,...i}=e;const[l,r]=(0,o.useState)("both"!==t?t:"verify"),[a,s]=(0,o.useState)("both"!==t?2:1),c=e=>{e!==l&&r(e)},d=()=>{l&&2!==a&&s(2)};return(0,o.useImperativeHandle)(n,(()=>({onNext:d,getCurrentStep:()=>a}))),1===a?(0,N.jsx)("div",{style:{maxWidth:520},children:(0,N.jsx)(cn.AP,{action:l,onNext:null,onSelect:c})}):(0,N.jsx)(dn,{...i,mode:l})}));pn.propTypes={mode:s().oneOf(["both","verify","purchase"]).isRequired,ref:s().any},pn.defaultProps={ref:{}};const mn=pn;var un,hn=t(51233),fn=t(53927),xn=t(61813),gn=t(49390),yn=t(67654),vn=t(22714),bn=t(45170);function jn(e){let{onChange:n,loading:t,children:l,extra:r,stores:a,storageKey:s}=e;const{t:c}=(0,i.PE)(),{info:d,inService:p}=(0,O.h6)(),{blocklet:m}=(0,Be.y0)(),[u,h]=(0,o.useState)(!1),f=(0,o.useRef)(null),[x,g]=(0,o.useState)(),[y,v]=(0,yn.Z)(s||"tmp"),[b,j]=s?[y,v]:[x,g],{storeList:k,teamDid:C}=(0,F.dX)({fromBlocklet:p,blocklet:m,nodeInfo:d}),w=je()([...a.map((e=>({...e,protected:!0}))),...k],"url"),E=b&&w.find((e=>b===e.url))||w[0],S=d.mode===Z.NODE_MODES.SERVERLESS;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(kn,{children:[(0,N.jsx)(R.Z,{ref:f,color:"secondary","data-cy":"add-component-select-store",endIcon:(0,N.jsx)(gn.Z,{color:"secondary"}),onClick:()=>{h(!0)},style:{padding:"0 2px"},children:(0,N.jsx)(Pe.Z,{color:"secondary",children:E.name})}),(0,N.jsx)(Pe.Z,{color:"secondary",children:r})]}),(0,N.jsxs)(V.Z,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:c("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:E,autoFocus:!0,onChange:e=>{const t=e.target.value;j(t.url),n(t)},SelectProps:{open:u,MenuProps:{anchorEl:f.current},renderValue:e=>null===e||void 0===e?void 0:e.name,onClose:()=>{h(!1)}},style:{display:"none"},margin:"normal",children:[null===w||void 0===w?void 0:w.map((e=>(0,N.jsx)(fe.Z,{value:e,"data-cy":e.url,children:(0,N.jsx)(bn.Z,{teamDid:C,store:e,onDelete:()=>{var n;b===e.url&&j(null===(n=w[0])||void 0===n?void 0:n.url)}})},e.url))),!S&&(0,N.jsx)(vn.Z,{disabled:t,storeList:w,teamDid:C,onAdd:e=>{j(e)}})]}),l({currentRegistry:E})]})}jn.propTypes={onChange:s().func,loading:s().bool,children:s().any.isRequired,extra:s().node,storageKey:s().string,stores:s().arrayOf(s().shape({name:s().string.isRequired,url:s().string.isRequired}))},jn.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const kn=r.Z.div(un||(un=(0,l.Z)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 16px;\n\n span {\n font-size: 16px;\n color: ",";\n // font-weight: bold;\n }\n"])),(e=>e.theme.palette.common.black));var Cn,Zn=t(38898),wn=t(71569),Rn=t(52439),En=t(77121),Sn=t(44727);const Pn=(e,n)=>on()(n,"/blocklets/".concat(e.did)),Tn=e=>{let{blocklet:n,attribute:t,value:o}=e;return n._formatted?n._formatted[t]:o},In=e=>e.inStore&&!1===(0,S.isFreeBlocklet)(e);function Un(e){let{blocklet:n,blocklets:t,handleButtonClick:l,endpoint:r}=e;const{t:a}=(0,i.PE)();let s=on()(r,(0,F.lk)(n.did,n.logo||""));try{const e=new URL(s);e.searchParams.set("v",n.version||+new Date),s=e.href}catch{}const[c,d]=(0,o.useState)(!1),p=In(n)?a("common.purchase"):a("blocklet.component.choose");return(0,N.jsx)(Zn.Z,{href:Pn(n,r),style:{color:"initial",textDecoration:"none"},onClick:e=>!!e.currentTarget.contains(e.target)||(e.preventDefault(),!1),target:"_blank",children:(0,N.jsx)(Dn,{title:Tn({blocklet:n,attribute:"title",value:n.title||n.name}),did:n.did,description:Tn({blocklet:n,attribute:"description",value:n.description}),cover:n.logo?s:"",version:n.version,button:(0,N.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,N.jsx)(Sn.Kk,{children:(0,N.jsx)(R.Z,{onClick:async e=>{e.preventDefault(),e.stopPropagation();try{d(!0),await l({meta:n,registryUrl:r,blocklets:t})}catch(o){P.Z.error(o.message)}finally{d(!1)}},size:"small",disabled:c,variant:"outlined",color:"primary","data-cy":"install-blocklet",children:c?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(w.Z,{size:16,style:{marginRight:3}}),p]}):p},n.did)})})})})}function Nn(e){let{handleButtonClick:n,handleSearchSelect:t,storeUrl:l,handleBlockletRender:r,extraFilter:a,serverVersion:s,resourceType:c,resourceDid:d,...p}=e;const{locale:m}=(0,i.PE)(),[u,h]=(0,o.useState)(!1),[f,x]=(0,o.useState)({}),g=l;return(0,o.useEffect)((()=>{x({resourceType:c,resourceDid:d})}),[g,c,d]),(0,o.useEffect)((()=>{h(!0),x({resourceType:c,resourceDid:d})}),[]),(0,N.jsx)(Rn.ErrorBoundary,{FallbackComponent:wn.H,resetKeys:[g],children:(0,N.jsx)("div",{...p,children:u&&(0,N.jsx)(En.Z,{blockletRender:e=>{const t={...e,handleButtonClick:n,endpoint:g};return r({...e,defaultRender:(0,N.jsx)(Un,{...t})})},baseSearch:!0,endpoint:g,locale:m,onFilterChange:e=>{x(e)},onSearchSelect:t,filters:f,extraFilter:a,serverVersion:s,fetchCategoryDelay:500})})})}Un.propTypes={blocklet:s().object.isRequired,blocklets:s().array,handleButtonClick:s().func,endpoint:s().string},Un.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[]},Nn.propTypes={storeUrl:s().string.isRequired,handleButtonClick:s().func,handleSearchSelect:s().func,handleBlockletRender:s().func,extraFilter:s().func,serverVersion:s().string,resourceType:s().string,resourceDid:s().string},Nn.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:""};const Dn=(0,r.Z)(Sn.ZP)(Cn||(Cn=(0,l.Z)(["\n .ms-highlight {\n color: ",";\n }\n"])),(e=>e.theme.palette.primary.main));var An=t(35966);function Bn(e){let{...n}=e;return(0,N.jsx)(R.Z,{className:"bottom-button",variant:"contained",color:"primary",...n})}var Ln,On,Fn=t(96366);function zn(){let{key:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{key:"sm"};const n=(0,Fn.Z)();return(0,ge.Z)(n.breakpoints.down(e))}function Mn(e){let{blocklet:n,onStartNow:t,children:o,disabled:l}=e;const{t:r}=(0,i.PE)(),a=zn();return!n||(0,F.bg)(n.meta)?(0,N.jsx)(qn,{children:o}):(0,N.jsxs)(Gn,{isMobile:a,children:[(0,N.jsx)(Bn,{className:"start-now",variant:"contained",color:"primary",disabled:l,onClick:()=>t(),children:r("setup.startNow")}),(0,N.jsx)(d.Z,{display:"flex",alignItems:"center",children:o})]})}Mn.propTypes={blocklet:s().object,onStartNow:s().func,children:s().any,disabled:s().bool},Mn.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const qn=(0,r.Z)(d.Z)(Ln||(Ln=(0,l.Z)(["\n width: 100%;\n margin-top: auto;\n padding-top: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n .bottom-button {\n min-width: 200px;\n }\n "," {\n .bottom-button {\n width: 100%;\n }\n }\n"])),(e=>e.theme.breakpoints.down("md"))),Gn=(0,r.Z)(d.Z)(On||(On=(0,l.Z)(["\n padding-top: 24px;\n margin-top: auto;\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n .start-now {\n min-width: 140px;\n }\n .bottom-button {\n min-width: 120px;\n }\n "," {\n width: 100%;\n }\n\n "," {\n .start-now {\n min-width: inherit;\n }\n .bottom-button {\n min-width: 100px;\n }\n }\n\n "," {\n justify-content: space-between;\n gap: '32px',\n }}\n"])),(e=>e.theme.breakpoints.down("lg")),(e=>e.theme.breakpoints.down("md")),(e=>e.isMobile));var Wn=t(8790),Vn=function(e){return(0,N.jsxs)("svg",{...e,children:[(0,N.jsxs)("g",{filter:"url(#a)",children:[(0,N.jsx)("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97z",fill:"#DDD"}),(0,N.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.192 6.222l-40.97 40.97A11 11 0 0 0 5 54.971V240c0 6.075 4.925 11 11 11h196c6.075 0 11-4.925 11-11V14c0-6.075-4.925-11-11-11H56.97a11 11 0 0 0-7.778 3.222zm-.707-.707A12 12 0 0 1 56.971 2H212c6.627 0 12 5.373 12 12v226c0 6.627-5.373 12-12 12H16c-6.627 0-12-5.373-12-12V54.97a12 12 0 0 1 3.515-8.485l40.97-40.97z",fill:"#000",fillOpacity:".08"}),(0,N.jsx)("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:(0,N.jsx)("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97z",fill:"#D9D9D9"})}),(0,N.jsxs)("g",{mask:"url(#b)",children:[(0,N.jsx)("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),(0,N.jsx)("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),(0,N.jsx)("path",{d:"M33.045 169h-3.767v-11.636h3.887c1.14 0 2.12.233 2.937.698a4.61 4.61 0 0 1 1.881 1.995c.44.863.659 1.899.659 3.108 0 1.212-.222 2.254-.665 3.125a4.668 4.668 0 0 1-1.909 2.011c-.833.466-1.84.699-3.023.699zm-2.01-1.534h1.914c.886 0 1.623-.167 2.21-.5a3.152 3.152 0 0 0 1.318-1.46c.292-.64.438-1.421.438-2.341 0-.913-.146-1.688-.438-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568zm11.546-10.102V169h-1.756v-11.636h1.756zM48.905 169h-3.767v-11.636h3.886c1.14 0 2.12.233 2.938.698a4.609 4.609 0 0 1 1.88 1.995c.44.863.66 1.899.66 3.108 0 1.212-.222 2.254-.665 3.125a4.667 4.667 0 0 1-1.91 2.011c-.833.466-1.84.699-3.022.699zm-2.011-1.534h1.914c.887 0 1.623-.167 2.21-.5a3.151 3.151 0 0 0 1.319-1.46c.291-.64.437-1.421.437-2.341 0-.913-.146-1.688-.437-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568zm20.372-7.046a1.662 1.662 0 0 0-.75-1.25c-.44-.299-.993-.448-1.66-.448-.477 0-.89.075-1.238.227a1.91 1.91 0 0 0-.813.613c-.189.258-.284.552-.284.881 0 .277.065.515.194.716.132.201.304.369.516.506.216.132.447.244.694.335.246.087.483.159.71.216l1.136.295c.371.091.752.214 1.142.37.39.155.752.36 1.086.613.333.254.602.568.806.944.209.374.313.823.313 1.346 0 .659-.17 1.244-.511 1.756-.338.511-.828.915-1.472 1.21-.64.295-1.415.443-2.324.443-.871 0-1.625-.138-2.261-.415-.637-.276-1.135-.668-1.495-1.176-.36-.511-.558-1.117-.596-1.818h1.761c.034.421.17.771.41 1.051.242.277.55.483.925.62.38.132.794.198 1.245.198.496 0 .937-.077 1.324-.233.39-.159.697-.378.92-.659a1.56 1.56 0 0 0 .335-.994c0-.345-.098-.627-.295-.847a2.191 2.191 0 0 0-.79-.545 7.725 7.725 0 0 0-1.12-.381l-1.374-.375c-.932-.253-1.67-.627-2.216-1.119-.542-.492-.813-1.144-.813-1.955 0-.67.182-1.255.546-1.755.363-.5.856-.888 1.477-1.165.621-.28 1.322-.42 2.102-.42.788 0 1.483.138 2.085.414.607.277 1.084.658 1.432 1.142.349.481.53 1.034.546 1.659h-1.693zm3.813 11.853v-12h1.66v1.415h.142c.098-.182.24-.393.426-.631.185-.239.443-.447.772-.625.33-.182.766-.273 1.307-.273.705 0 1.334.178 1.887.534.553.356.987.869 1.3 1.54.319.67.478 1.477.478 2.42 0 .944-.157 1.752-.472 2.427-.314.67-.746 1.187-1.295 1.551-.55.36-1.176.539-1.88.539-.53 0-.965-.089-1.302-.267a2.457 2.457 0 0 1-.784-.625 4.667 4.667 0 0 1-.437-.636h-.103v4.631H71.08zm1.665-7.637c0 .614.09 1.152.267 1.614.178.462.436.824.773 1.085.337.258.75.387 1.239.387.507 0 .931-.135 1.273-.404.34-.273.598-.642.772-1.108.178-.466.267-.99.267-1.574 0-.575-.087-1.092-.261-1.551-.17-.458-.428-.82-.773-1.085-.34-.265-.767-.398-1.278-.398-.493 0-.91.127-1.25.381-.337.254-.593.608-.767 1.062-.175.455-.262.985-.262 1.591zm10.75 4.557a3.557 3.557 0 0 1-1.5-.307 2.523 2.523 0 0 1-1.062-.903c-.258-.394-.386-.877-.386-1.449 0-.492.094-.898.283-1.216.19-.318.446-.57.768-.756a4.036 4.036 0 0 1 1.08-.42c.397-.095.802-.167 1.215-.216l1.273-.148c.325-.041.562-.108.71-.198.148-.091.222-.239.222-.444v-.039c0-.497-.14-.881-.42-1.154-.277-.273-.69-.409-1.24-.409-.572 0-1.022.127-1.352.381-.325.25-.55.528-.676.835l-1.597-.364c.19-.53.466-.958.83-1.284.368-.329.79-.568 1.267-.716.477-.151.98-.227 1.506-.227.348 0 .718.042 1.108.125.394.08.761.227 1.102.443.345.216.627.525.847.926.22.398.33.915.33 1.552V169h-1.66v-1.193h-.068c-.11.22-.275.435-.495.648-.22.212-.501.388-.846.528s-.758.21-1.239.21zm.37-1.363c.47 0 .87-.093 1.204-.279.337-.185.593-.428.767-.727.178-.303.267-.627.267-.972v-1.125c-.06.061-.178.118-.352.171-.17.049-.365.093-.585.13-.22.034-.434.067-.642.097l-.523.068c-.33.042-.63.112-.903.21a1.553 1.553 0 0 0-.648.427c-.16.181-.239.424-.239.727 0 .42.156.738.466.954.31.212.707.319 1.188.319zm9.876 1.346c-.845 0-1.572-.191-2.182-.574a3.796 3.796 0 0 1-1.398-1.596c-.325-.678-.488-1.455-.488-2.33 0-.886.166-1.668.5-2.346a3.832 3.832 0 0 1 1.409-1.597c.606-.383 1.32-.574 2.142-.574.663 0 1.254.123 1.773.369.519.243.937.584 1.255 1.023.322.44.514.953.574 1.54h-1.653c-.091-.409-.3-.761-.625-1.057-.322-.295-.754-.443-1.296-.443a2.11 2.11 0 0 0-1.244.375c-.352.246-.627.598-.824 1.057-.197.454-.295.992-.295 1.613 0 .637.096 1.186.29 1.648.193.462.466.82.818 1.074.356.254.774.381 1.255.381.322 0 .614-.059.875-.177.266-.121.487-.293.665-.517.182-.223.309-.492.38-.806h1.654a3.211 3.211 0 0 1-.55 1.511 3.165 3.165 0 0 1-1.234 1.045c-.511.254-1.111.381-1.8.381zm9.163 0c-.859 0-1.6-.184-2.221-.551a3.732 3.732 0 0 1-1.432-1.563c-.333-.674-.5-1.464-.5-2.369 0-.894.167-1.682.5-2.363a3.887 3.887 0 0 1 1.409-1.597c.606-.383 1.314-.574 2.125-.574.493 0 .97.082 1.432.244.462.163.877.419 1.244.767.368.349.657.802.87 1.358.212.553.318 1.226.318 2.017v.603H99.71v-1.273h5.273c0-.447-.091-.843-.273-1.187a2.052 2.052 0 0 0-.767-.824c-.326-.201-.708-.302-1.148-.302a2.22 2.22 0 0 0-1.25.353 2.364 2.364 0 0 0-.818.909 2.626 2.626 0 0 0-.284 1.21v.994c0 .584.102 1.08.307 1.489.208.409.498.722.869.938.372.212.805.318 1.301.318a2.7 2.7 0 0 0 .881-.137c.265-.094.494-.234.688-.42.193-.186.341-.415.443-.688l1.608.29c-.129.474-.36.888-.693 1.244-.33.353-.745.627-1.245.824-.496.194-1.062.29-1.699.29z",fill:"#fff"}),(0,N.jsx)("path",{d:"M117.604 47.263L121.523 45h14.267v41.862h-14.267l-15.335-8.854V53.854l1.818-1.05 3.2 1.848-1.818 1.05V76.16l12.993 7.502h10.209V48.2h-10.209l-1.577.91-3.2-1.847z",fill:"url(#e)"}),(0,N.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.402 76.16V55.701L106.409 48.2H96.2v35.462h10.209l1.582-.913 3.2 1.847-3.924 2.266H93V45h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047z",fill:"url(#f)"}),(0,N.jsxs)("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[(0,N.jsx)("path",{d:"M50.928 216.089l1.034 2.852h-2.503l1.028-2.842a4.95 4.95 0 0 0 .107-.338 7.17 7.17 0 0 0 .111-.409c.075.297.15.542.223.737zm2.28 5.591h.796l-2.775-7.352h-1.043l-2.774 7.352h.795a.338.338 0 0 0 .223-.077.425.425 0 0 0 .127-.179l.615-1.705h3.07l.617 1.705a.399.399 0 0 0 .126.184.339.339 0 0 0 .223.072zm4.823-.963a2.023 2.023 0 0 1-.67.098h-1.455v-2.453h1.456c.5 0 .871.106 1.11.318.24.208.36.495.36.86 0 .184-.028.355-.083.512a1.005 1.005 0 0 1-.262.399 1.2 1.2 0 0 1-.456.266zm-2.125-3.128v-2.406h1.237c.498 0 .865.095 1.101.286.236.192.355.497.355.917 0 .369-.125.662-.374.881-.246.215-.623.322-1.13.322h-1.189zm2.358-3.128a4.106 4.106 0 0 0-1.12-.133h-2.27v7.352h2.507c.391 0 .74-.051 1.048-.154.307-.102.566-.247.776-.435.21-.188.37-.409.48-.665.11-.26.165-.547.165-.861 0-.904-.506-1.462-1.518-1.674.22-.075.41-.169.572-.281a1.79 1.79 0 0 0 .403-.379c.106-.144.186-.297.237-.461.052-.164.078-.335.078-.512a2.1 2.1 0 0 0-.146-.804 1.49 1.49 0 0 0-.441-.609 2.073 2.073 0 0 0-.771-.384zm7.535.778h-2.212v6.441h-1.028v-6.441h-2.222v-.911H65.8v.911zm2.439.564h-1.13v1.193h1.13v-1.193zm-1.13 2.983h1.13v1.193h-1.13v-1.193z",fillOpacity:".8"}),(0,N.jsx)("path",{d:"M28.247 221.771V214h3.894c.99.072 1.765.944 1.765 1.998v3.77c0 1.106-.85 2.003-1.897 2.003h-3.762zM36.355 214h-1.011v7.783h1.01V214zm-7.097 6.704v-5.642h2.751c.49 0 .886.419.886.936v3.77c0 .517-.396.936-.886.936h-2.75zM37.775 214v7.771h3.762c1.047 0 1.897-.897 1.897-2.003v-3.77c0-1.054-.774-1.926-1.765-1.998h-3.894zm6.946 1.803h1.13v1.193h-1.13v-1.193zm1.13 2.983h-1.13v1.193h1.13v-1.193zm-7.065-3.724v5.642h2.75c.49 0 .887-.419.887-.936v-3.77c0-.517-.397-.936-.886-.936h-2.751z"})]}),(0,N.jsx)("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),(0,N.jsx)("path",{d:"M192.064 213.333l.976-.564h3.554v10.427h-3.286a1 1 0 0 1-.5-.134l-3.588-2.071v-6.016l.453-.262.797.46-.453.262v5.096l3.237 1.868h2.543v-8.833h-2.543l-.393.227-.797-.46z",fill:"#fff"}),(0,N.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.512 220.531v-5.096l-3.237-1.869h-2.543v8.833h2.543l.394-.227.797.46-.977.564h-3.554v-10.427h3.554l3.82 2.206v6.016l-.452.261-.797-.461.452-.26z",fill:"#fff"})]})]}),(0,N.jsxs)("defs",{children:[(0,N.jsxs)("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,N.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,N.jsx)("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),(0,N.jsx)("feOffset",{dy:"2"}),(0,N.jsx)("feGaussianBlur",{stdDeviation:"2"}),(0,N.jsx)("feComposite",{in2:"hardAlpha",operator:"out"}),(0,N.jsx)("feColorMatrix",{values:"0 0 0 0 0.0631944 0 0 0 0 0.242785 0 0 0 0 0.403472 0 0 0 0.2 0"}),(0,N.jsx)("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),(0,N.jsx)("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),(0,N.jsx)("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:(0,N.jsx)("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),(0,N.jsxs)("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[(0,N.jsx)("stop",{stopColor:"#101010"}),(0,N.jsx)("stop",{offset:"1",stopColor:"#272727"})]}),(0,N.jsxs)("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[(0,N.jsx)("stop",{stopColor:"#fff",stopOpacity:".4"}),(0,N.jsx)("stop",{offset:"1",stopColor:"#fff"})]}),(0,N.jsxs)("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[(0,N.jsx)("stop",{stopColor:"#fff"}),(0,N.jsx)("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),(0,N.jsxs)("radialGradient",{id:"h",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(17 -8.76924 6.97565 13.52294 183.166 221)",children:[(0,N.jsx)("stop",{stopColor:"#016BED"}),(0,N.jsx)("stop",{offset:".699",stopColor:"#4498FB"}),(0,N.jsx)("stop",{offset:"1",stopColor:"#9DFFE8"})]}),(0,N.jsx)("clipPath",{id:"g",children:(0,N.jsx)("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),(0,N.jsx)("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAACABAMAAACSOBo+AAAAG1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUUeIgAAAACXRSTlMSFhkOHAsfCCOMH5MiAAAjjElEQVRo3hTQO3sjRRBG4a+qWzJhVfdIJqzuGXsJe2bkJe0e2UA4shdIJS2X1LBcUpbL/wae5yQnfVHGjp2+V08yKR7OwBDYte8pi5Aq9DObSBouqN9cidZyusonzWtGJO13phLebEn6xKEnlYyXe5hnySc53Ym9Abn7crTse8r7BMeIB8yBOVZK0trMjxT5S/cgc9G63BQqZoF3xSYZYeRk2hoIvEBFA7XMtaaF8TdY1GjiDDqgEswRDlWnRtmYz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OECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]})};function Kn(){const{t:e}=(0,i.PE)();return(0,N.jsx)(d.Z,{children:(0,N.jsxs)(d.Z,{minHeight:"40vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[(0,N.jsx)(Vn,{style:{width:200,height:250}}),(0,N.jsx)(Pe.Z,{marginTop:"24px",marginBottom:"24px",children:e("storage.spaces.connect.providerForStorage")})]})})}Vn.defaultProps={width:"228",height:"258",viewBox:"0 0 228 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},Kn.propTypes={};const Hn=Kn;var Jn=t(19654),_n=t(39565),Qn=t(84584),Yn=t(17450),Xn=t(47595),$n=t(60939),et=t(72443),nt=t.n(et);function tt(e){let{spaceGateway:n,onDeleteSpace:t}=e;const{t:l}=(0,i.PE)(),[r,a]=(0,o.useState)(!1),[s,c]=(0,o.useState)(!1),d=(e,n)=>{null===e||void 0===e||e.stopPropagation(),a(n)};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(f.Z,{size:"small",onClick:e=>d(e,!0),children:(0,N.jsx)(Xn.default,{})}),(0,N.jsx)($n.Z,{title:l("common.delConfirmDescription",{data:"".concat(null===n||void 0===n?void 0:n.name)}),open:r,confirmButton:{text:l("common.confirm"),props:{variant:"contained",color:"error",loading:s}},cancelButton:{text:l("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:async e=>{try{null===e||void 0===e||e.stopPropagation(),c(!0),await t(n),a(!1)}catch(o){console.error(o),P.Z.error("".concat(l("storage.spaces.gateway.delete.failed"),": ").concat(nt()(o)))}finally{c(!1)}},onCancel:e=>d(e,!1)})]})}tt.propTypes={onDeleteSpace:s().func,spaceGateway:s().shape({name:s().string.isRequired,url:s().string.isRequired,protected:s().bool}).isRequired},tt.defaultProps={onDeleteSpace:()=>{}};const ot=tt;var it,lt=function(e){return(0,N.jsx)("svg",{...e,children:(0,N.jsx)("circle",{cx:"4",cy:"4",r:"4",fill:"#25C99B"})})};function rt(e){let{spaceGateway:n,connected:t,onDisconnect:o,...l}=e;const r=zn(),{t:a}=(0,i.PE)();return(0,N.jsxs)(at,{style:{position:"relative"},children:[(0,N.jsxs)(d.Z,{sx:{backgroundColor:t?"#F0FDFF":"inherit","&:hover":{backgroundColor:t?"#F0FDFF":"#FBFBFB"},borderRadius:"8px"},display:"flex",padding:"12px 20px",...l,children:[(0,N.jsx)(d.Z,{display:"flex",children:(0,N.jsx)(_n.Z,{alt:n.did,src:(0,Qn.Jf)(n.endpoint)})}),(0,N.jsxs)(d.Z,{className:"spaces-info",display:"flex",flexGrow:1,flexDirection:"column",sx:{marginLeft:"20px",padding:"0px 0px"},children:[(0,N.jsxs)(d.Z,{className:"spaces-info",display:"flex",maxWidth:"360px",alignItems:"center",children:[(0,N.jsx)(Pe.Z,{color:t?"primary":"inherit",fontSize:"1rem",fontWeight:"bold",children:n.name}),(0,N.jsx)(Jn.Z,{label:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(lt,{style:{marginRight:"4px"}}),a("storage.spaces.connected.tag")]}),variant:"outlined",size:"small",style:{marginLeft:r?null:"20px",fontWeight:"bold"}})]}),(0,N.jsx)(d.Z,{className:"spaces-address",display:"flex",color:"#9397A1",marginTop:"8px",children:(0,N.jsx)(Pe.Z,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},color:"#9397A1",children:n.did&&(0,N.jsx)(Yn.Z,{copyable:!1,size:14,compact:!0,responsive:!1,did:n.did})})})]}),(0,N.jsx)(d.Z,{className:"spaces-backup",display:"flex",alignItems:"center",children:(0,N.jsx)(d.Z,{className:"backup-strategy",display:"flex",alignItems:"center",width:"100%",children:(0,N.jsx)(ot,{spaceGateway:n,onDeleteSpace:async()=>{try{await o(),P.Z.success(a("storage.spaces.gateway.delete.succeeded",{name:n.name}))}catch(e){console.error(e),P.Z.error((0,F.Z)(e))}}})})})]}),(0,N.jsx)(d.Z,{className:"selected-container selected",children:(0,N.jsx)(Te.default,{className:"selected-icon"})})]})}lt.defaultProps={width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt.propTypes={spaceGateway:s().shape({did:s().string.isRequired,name:s().string.isRequired,url:s().string.isRequired,endpoint:s().string.isRequired,protected:s().bool}).isRequired,connected:a.bool,onDisconnect:a.func},rt.defaultProps={connected:!1,onDisconnect:()=>{}};const at=(0,r.Z)(d.Z)(it||(it=(0,l.Z)(["\n .selected-container {\n position: absolute;\n right: 0px;\n bottom: 0px;\n display: flex;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 32px;\n height: 32px;\n border-radius: 0px 0px 8px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.4s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 60px;\n top: 60px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 16px;\n border-style: solid;\n border-color: transparent #1dc1c7 #1dc1c7 transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n\n .selected-container.selected {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n"]))),st=rt;var ct=t(65873),dt=t(41899);const pt=(0,o.createContext)({}),{Provider:mt,Consumer:ut}=pt;function ht(e){let{children:n}=e;const[t,i]=(0,o.useState)(!1),[l,r]=(0,o.useState)(null),{blocklet:a,actions:{refreshBlocklet:s}}=(0,Be.y0)(),{storageEndpoint:c}=function(){const[e,n]=(0,o.useState)(null),{blocklet:t}=(0,Be.y0)();return(0,o.useEffect)((()=>{n((0,Qn.EJ)(t))}),[t]),{storageEndpoint:e}}(),{api:d}=(0,O.h6)();(0,dt.Z)((async()=>{try{if(i(!0),(0,ct.isEmpty)(c))return void r(null);const e=await(0,Qn.UV)(c);r(e)}catch(e){console.error(e),P.Z.error(e.message)}finally{i(!1)}}),[c]);const p=async e=>{await d.configBlocklet({input:{did:[a.meta.did],configs:[{key:H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:e}]}}),s()};(0,o.useEffect)((()=>{!async function(){if(!l)return;const e=await(0,Qn.nU)(l.endpoint,l.name),n=(0,ct.merge)(l,{name:e});r(n)}()}),[]);const m=Boolean(c&&l);return(0,N.jsx)(mt,{value:{loading:t,spaceGateway:l,deleteSpaceGateway:()=>{r(null),s()},updateSpaceGateway:async e=>{r(e),await p(e.endpoint),s()},storageEndpoint:c,settingStorageEndpoint:p,hasStorageEndpoint:m},children:n})}function ft(){return(0,o.useContext)(pt)}ht.propTypes={children:a.node.isRequired},ht.defaultProps={};const xt=function(){const{t:e}=(0,i.PE)(),{spaceGateway:n,settingStorageEndpoint:t}=ft();return(0,N.jsxs)(d.Z,{display:"flex",flexDirection:"column",children:[(0,N.jsx)(d.Z,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",children:(0,N.jsx)(Pe.Z,{fontSize:"1.2rem",fontWeight:"bold",children:e("storage.spaces.connected.title")})}),(0,N.jsx)(d.Z,{children:(0,N.jsx)(st,{style:{marginTop:"12px"},spaceGateway:n,connected:!0,onDisconnect:()=>t(null)},n.endpoint)})]})};var gt=t(55372),yt=t(17682),vt=t(56277);function bt(e){let{onConnect:n,...t}=e;const{blocklet:l}=(0,Be.y0)(),{info:r}=(0,O.h6)(),{t:a,locale:s}=(0,i.PE)(),[c,p]=(0,o.useState)(""),[m,u]=(0,o.useState)(!1),[h,f]=(0,o.useState)(!1),[x,g]=(0,o.useState)(""),y=(0,vt.Z)({blocklet:l}),v=(0,F.yP)(r),{storageEndpoint:b}=ft(),[j,k]=(0,o.useState)({open:!1,action:"connect-to-did-spaces",checkTimeout:3e5,prefix:"/api/did",checkFn:sn.od.create({baseURL:on()(window.location.origin,(0,F.Y5)())}).get,messages:{title:a("storage.spaces.provideNFT.title",{appName:y.appName},s),scan:a("storage.spaces.provideNFT.scan",{appName:y.appName},s),confirm:"",success:(0,N.jsx)(Pe.Z,{gutterBottom:!0,children:a("storage.spaces.provideNFT.success")})},onClose:()=>{k((e=>({...e,open:!1})))}}),[C,Z]=(0,o.useState)({open:!1,action:"one-click-authorization",checkTimeout:3e5,messages:{title:a("storage.spaces.authorize.title",{appName:y.appName},s),scan:a("storage.spaces.authorize.scan",{appName:y.appName},s),confirm:"",success:(0,N.jsx)(Pe.Z,{gutterBottom:!0,children:a("storage.spaces.authorize.success")})},onClose:()=>{Z((e=>({...e,open:!1})))}}),E=async e=>{let{did:t,name:o,endpoint:i}=e;const l=await(0,Qn.Z3)(i);if(!await(0,Qn.w2)(l))return void P.Z.error(a("storage.spaces.gateway.add.invalidUrl"));const r={name:o,did:t,url:l,endpoint:i};await n(r),P.Z.success(a("storage.spaces.connectedWithName",{name:r.name}))},S=(e,n)=>{setTimeout((async()=>{if(Z((e=>({...e,open:!1}))),p(null),k((e=>({...e,open:!1}))),!we()(e.spaceGateway))return void await E(n(e.spaceGateway));const t=n(e.endpoint),o=e.space?n(e.space):{};await E({endpoint:t,did:(0,Qn.LQ)(t),name:"DID Space",...o})}),0)},T=async()=>{try{u(!0);const e=await(0,Qn.Z3)(c),n=(0,Qn.ag)(e),t=new URL(e).searchParams.get("spaceDid");if(!await(0,Qn.w2)(n))throw new Error(a("storage.spaces.gateway.add.invalidUrl"));Z((e=>({...e,open:!0,prefix:on()(n,"space/api/did"),baseUrl:new URL(n).origin,checkFn:sn.od.create({baseURL:on()(n,"space")}).get,extraParams:{appDid:y.appDid,appName:y.appName,appDescription:y.appDescription,scopes:y.scopes,appUrl:y.appUrl,referrer:y.referrer,nodeDid:r.did,spaceDid:t}}))),f(!1)}catch(e){const n="".concat(a("storage.spaces.gateway.add.failed",s),": ").concat((0,F.Z)(e));g(n)}finally{u(!1)}};return(0,N.jsxs)(d.Z,{children:[(0,N.jsx)(yt.Z,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:()=>{k((e=>({...e,open:!0,extraParams:{appPid:l.appPid,referrer:window.location.href}})))},variant:"outlined",menu:[(0,N.jsx)(yt.Z.Item,{sx:{textTransform:"none"},onClick:()=>f(!0),size:"small",...t,children:a(b?"storage.spaces.connect.useSpaceGatewayReconnect":"storage.spaces.connect.useSpaceGateway")},"1")],children:(0,N.jsx)(Pe.Z,{sx:{fontWeight:"bold",textTransform:"none"},children:a(b?"storage.spaces.connect.useWalletReconnect":"storage.spaces.connect.useWallet")})}),(0,N.jsx)(ln.Z,{forceConnected:!1,saveConnect:!1,prefix:j.prefix,open:j.open,popup:!0,action:j.action,webWalletUrl:v,baseUrl:j.baseUrl,checkFn:j.checkFn,onSuccess:S,onClose:j.onClose,checkTimeout:j.checkTimeout,extraParams:j.extraParams,messages:j.messages,locale:s}),(0,N.jsx)(ln.Z,{forceConnected:!1,saveConnect:!1,prefix:C.prefix,open:C.open,popup:!0,action:C.action,baseUrl:C.baseUrl,checkFn:C.checkFn,onSuccess:S,onClose:C.onClose,checkTimeout:C.checkTimeout,extraParams:C.extraParams,messages:C.messages,locale:s}),(0,N.jsxs)(q.ZP,{title:a("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:h,onClose:()=>f(!1),PaperProps:{style:{minHeight:"auto"}},actions:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(R.Z,{onClick:e=>{e.stopPropagation(),f(!1)},color:"inherit",children:a("common.cancel")}),(0,N.jsxs)(R.Z,{onClick:T,color:"primary",disabled:m||!c,variant:"contained",autoFocus:!0,children:[m&&(0,N.jsx)(w.Z,{size:16}),a("common.confirm")]})]}),children:[(0,N.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,N.jsx)(gt.Z,{component:"div",children:(0,N.jsx)(Pe.Z,{component:"div",children:(0,N.jsx)(V.Z,{label:a("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:c,onChange:e=>{g(null),p(e.target.value)},disabled:m,onKeyPress:async e=>{"Enter"===e.key&&await T()},autoFocus:!0})})})}),Boolean(x)&&(0,N.jsx)(Ne.Z,{type:"error",style:{width:"100%"},children:x})]})]})}bt.propTypes={onConnect:a.func},bt.defaultProps={onConnect:()=>{}};const jt=bt;var kt;function Ct(e){var n;let{blockletMeta:t,onEndpointUpdate:i}=e;const l=zn(),{blocklet:r}=(0,Be.y0)(),{updateSpaceGateway:a,loading:s,hasStorageEndpoint:c}=ft();return(0,o.useEffect)((()=>{null===i||void 0===i||i()}),[r]),s?(0,N.jsx)(An.Z,{relative:"parent",children:(0,N.jsx)(w.Z,{})}):(0,N.jsxs)(Zt,{children:[(0,N.jsx)(d.Z,{width:l?"360px":"720px",children:c?(0,N.jsx)(xt,{}):(0,N.jsx)(Hn,{})}),"required"===(null===t||void 0===t||null===(n=t.capabilities)||void 0===n?void 0:n.didSpace)&&(0,N.jsx)(Mn,{mt:8,children:(0,N.jsx)(jt,{onConnect:a})})]})}Ct.propTypes={blockletMeta:s().any.isRequired,onEndpointUpdate:a.func},Ct.defaultProps={onEndpointUpdate:()=>{}};const Zt=(0,r.Z)(Wn.Z)(kt||(kt=(0,l.Z)(["\n height: 100%;\n overflow-y: auto;\n padding-bottom: 32px;\n overflow-x: hidden;\n"]))),wt=Ct;var Rt,Et,St,Pt,Tt,It,Ut;const Nt=e=>e.inStore&&!1===(0,S.isFreeBlocklet)(e),Dt=e=>{var n;return[H.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,H.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(null===e||void 0===e||null===(n=e.capabilities)||void 0===n?void 0:n.didSpace)},At=e=>{var n,t;return(null===e||void 0===e||null===(n=e.configs)||void 0===n||null===(t=n.find((e=>e.key===H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)))||void 0===t?void 0:t.value)||null},Bt=e=>(e.environments||[]).some((e=>e.required)),Lt=(e,n)=>null===e||void 0===e?void 0:e.some((e=>e.required&&!n[e.key])),Ot=e=>{let{params:n,blocklet:t,t:o}=e;const i=n.title||n.name;if(!i)return o("common.next");return o(((null===t||void 0===t?void 0:t.children)||[]).find((e=>e.meta.bundleDid===n.bundleDid))?"blocklet.component.upgradeNext":"blocklet.component.addNext",{name:i})},Ft=(0,o.forwardRef)(((e,n)=>{let{meta:t,isMobile:l,onStepChange:r}=e;const{steps:a,activeStep:s,setActiveStepByKey:c,setActiveStepByIndex:d}=(0,Ue.s)(),{t:p,locale:m}=(0,i.PE)(),u=a[s];return(0,o.useEffect)((()=>{r(s)}),[r,s]),(0,o.useImperativeHandle)(n,(()=>({setActiveStepByKey:c,setActiveStepByIndex:d}))),(0,N.jsx)(Kt,{component:"div",className:l?"mobileStyle":"",sx:{height:"calc(100% - 56px)"},children:(0,N.jsx)(Ie.Z,{locale:m,blockletMeta:{title:" ",...t},pcWidth:"100%",pcHeight:"100%",logoUrl:t&&t.logo&&t.registryUrl?(0,F.aZ)({did:t.did,baseUrl:t.registryUrl,logoPath:t.logo}):null,stepTip:p("blocklet.component.add"),children:(0,N.jsx)(Wt,{children:null!==u&&void 0!==u&&u.body&&"function"===typeof u.body?u.body():u.body})})})}));Ft.propTypes={meta:s().any,onStepChange:s().func.isRequired,isMobile:s().bool.isRequired},Ft.defaultProps={meta:null};const zt=function(e){setTimeout((()=>{window.parent.postMessage({event:"component.installed",componentDid:e},"*")}),arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3)};function Mt(e){var n,t,l,r,a,s,c;let{onClose:p,mode:m,stores:u,resourceType:h,resourceDid:f,storageKey:x,inDialog:g,selectedMeta:y}=e;const{t:v,locale:b}=(0,i.PE)(),[j,k]=(0,o.useState)(!1),[C,E]=(0,o.useState)(null),[T,I]=(0,o.useState)(""),[U,D]=(0,o.useState)(""),{api:A,ws:{useSubscription:B},inService:L,info:z}=(0,O.h6)(),{blocklet:M,actions:{refreshBlocklet:q}}=(0,Be.y0)(),[G,W]=(0,o.useState)(null),[K,J]=(0,o.useState)(!1),_={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[Q,Y]=(0,o.useState)(_),[X,$]=(0,o.useState)(0),ee=(0,o.useRef)({}),ne=(0,o.useRef)({}),te=(0,o.useRef)({}),oe=(0,ge.Z)((e=>e.breakpoints.down("md"))),ie=(0,ve.useParams)(),[re,ae]=(0,o.useState)(!0),{meta:se}=ee.current,ce=z.mode===Z.NODE_MODES.SERVERLESS,de=e=>Y((n=>({...n,...e})));(0,o.useEffect)((()=>{if(Q.pathPrefix){const{errMsg:e}=ke({...Q,pathPrefix:Q.pathPrefix,locale:b});I(e)}}),[Q.pathPrefix]),(0,o.useEffect)((()=>{0===X&&Y(_)}),[X]);const pe=()=>{var e;const n=null!==(e=At(M))&&void 0!==e?e:"";de({didSpaceEndpoint:n})},me=()=>{var e;return null!==ee&&void 0!==ee&&null!==(e=ee.current)&&void 0!==e&&e.meta?(0,S.getDisplayName)(ee.current):""},ue=e=>{const n=t=>{de({installResultProps:{variant:"error",title:me(),subTitle:e,footer:(0,N.jsx)(R.Z,{className:"bottom-button",disabled:t,"data-cy":"retry-install-component",onClick:async()=>{n(!0),await be(ee.current.installInput)},children:(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[t&&(0,N.jsx)(w.Z,{size:16,style:{marginRight:8}}),v("common.retry")]})})}})};n()},he=e=>n=>{var t,o;((null===n||void 0===n||null===(t=n.meta)||void 0===t?void 0:t.did)||(null===n||void 0===n?void 0:n.meta))===(null===M||void 0===M||null===(o=M.meta)||void 0===o?void 0:o.did)&&e(n)};B(H.BlockletEvents.statusChange,he((e=>{if(e.status===H.BlockletStatus.upgrading)de({installResultProps:{variant:"success",title:me(),subTitle:v("blocklet.component.installSuccessTip")}}),zt(ie.componentDid);const n=At(M);de((e=>({...e,didSpaceEndpoint:n})))})),[null===M||void 0===M||null===(n=M.meta)||void 0===n?void 0:n.did]),B(H.BlockletEvents.downloadFailed,he((()=>{ue(v("blocklet.component.installComponentError"))})),[null===M||void 0===M||null===(t=M.meta)||void 0===t?void 0:t.did]),B(H.BlockletEvents.installFailed,he((()=>{ue(v("blocklet.component.installComponentError"))})),[null===M||void 0===M||null===(l=M.meta)||void 0===l?void 0:l.did]);const fe=()=>{k(!1),Y({}),ee.current={},p()},ye=e=>((null===M||void 0===M?void 0:M.children)||[]).some((n=>n.meta.did===e)),be=async e=>{var n,t;const{pathPrefix:o,bundleDid:i,title:l,componentName:r="",componentDid:a=""}=Q,{configs:s=[],registryUrl:c,inStore:d,inputUrl:p}=(null===(n=ee.current)||void 0===n?void 0:n.meta)||{},m=null===(t=ee.current)||void 0===t?void 0:t.downloadTokenList,u=d?(0,F.Rn)(c,i):p;k(!0);const h={rootDid:M.meta.did,url:u,mountPoint:le()(o),title:l,name:r,did:a,onlyRequired:!re,...Q.hasEnvironmentsStep&&s.length>0?{configs:s.map((e=>({...e,value:Q.configsValue[e.key]||""})))}:{},...m?{downloadTokenList:m}:{},...e};try{if(await A.installComponent({input:h}),c){const{teamDid:e,storeList:n}=(0,F.dX)({fromBlocklet:L,nodeInfo:z,blocklet:M}),{isNew:t,decoded:o}=(0,F.bQ)(c,n);t&&await A.addBlockletStore({input:{teamDid:e,url:o}})}de({installResultProps:{}}),q({showError:!1,attachRuntimeInfo:!1})}catch(f){const e=(0,F.Z)(f);P.Z.error(e),console.error("installComponent error: ",f),ue(e)}finally{k(!1),ee.current.installInput=h}},ke=e=>({errMsg:(0,hn.Rw)({params:{...e,did:e.bundleDid},blocklets:[M],blocklet:M,locale:b})}),Ze=async e=>{var n,t;const{errMsg:o}=ke({...Q,locale:b});I(o),X===Ie.length-2&&await be(e),null===(n=ne.current)||void 0===n||null===(t=n.setActiveStepByIndex)||void 0===t||t.call(n,(e=>e+1))},Re=()=>{var e,n;null===(e=ne.current)||void 0===e||null===(n=e.setActiveStepByIndex)||void 0===n||n.call(e,(e=>e-1))},Pe=e=>{var n,t;let{chooseParams:o=ee.current,componentDid:i,isInit:l=!1}=e;const{meta:r,registryUrl:a,inStore:s,inputUrl:c}=o,{did:d,title:p,name:m}=r,u=((null===(n=M.settings)||void 0===n?void 0:n.children)||[]).filter((e=>"deleted"===e.status&&e.meta.bundleDid===d)),h=i||"",f=null===(t=r.environments)||void 0===t?void 0:t.map((e=>{const{name:n,validation:t,...o}=e;return{...o,key:n,...{validation:Ee()(t)?"":t}}}));ee.current={...o,meta:{...r,configs:f,registryUrl:a,inStore:s,inputUrl:c}};let x={};if(l){const e=[M],n=f||[],t=[],o=je()(Ce()([...n,...t]),"key").filter((e=>!!e.key)).sort(((e,n)=>e.required&&!n.required?-1:n.required&&!e.required?1:0)),i=(0,S.getSharedConfigObj)(e[0],{configs:o}),l={},r=o.map((e=>{const{default:n,key:t,...o}=e;return l[t]=i[t]||n,{...o,key:t,hidden:!!H.BLOCKLET_CONFIGURABLE_KEY[t]}}));x={...x,configsList:r,configsValue:l,hasMissRequiredConfigs:Lt(r,l)}}const g=M.children.some((e=>"/"===e.mountPoint)),y=u.find((e=>e.meta.bundleDid===d)),v=M.children.find((e=>e.meta.bundleDid===d));if(x.title=p||"",y)x={...x,pathPrefix:y.mountPoint||"",componentName:y.meta.name,hasEnvironmentsStep:!1};else if(v)x={...x,pathPrefix:v.mountPoint||"",componentName:v.meta.name,hasEnvironmentsStep:!1};else{var b,j;x={...x,pathPrefix:g?"/".concat(le()(p)||le()(m)).toLowerCase():"/",componentName:"",hasEnvironmentsStep:(null===(b=ee.current.meta)||void 0===b||null===(j=b.environments)||void 0===j?void 0:j.length)>0}}const k=Nt(ee.current.meta),C=Dt(ee.current.meta),Z=At(M);de({bundleDid:d,componentDid:h,...x,hasRequiredEnvironments:Bt(ee.current.meta),requirePurchase:k,didSpaceIsRequiredSetup:C,didSpaceEndpoint:Z}),l&&k&&(()=>{const{pathPrefix:e,bundleDid:n,title:t,componentName:o="",componentDid:i=""}=Q,{meta:l={}}=ee.current||{},{registryUrl:r,inStore:a,inputUrl:s}=l,c=a?(0,F.Rn)(r,n):s;W({meta:l,installOpts:{type:"component",rootDid:M.meta.did,mountPoint:e,url:c,title:t,name:o,did:i}})})()};(0,o.useEffect)((()=>{y&&0===X&&(Pe({chooseParams:{blocklets:[y],meta:y,registryUrl:y.homepage,inStore:!0},isInit:!0}),de({showFromUrlDialog:!1}),Ze())}),[y,X]);const Ie=[{key:"selectComponent",name:v("blocklet.component.selectComponent"),body:(0,N.jsxs)(Gt,{component:"div",children:[Q.showFromUrlDialog&&(0,N.jsx)(xn.Z,{mode:"component",onCancel:()=>{de({showFromUrlDialog:!1})},onSuccess:e=>{let{meta:n,inputUrl:t,inStore:o,registryUrl:i}=e;Pe({chooseParams:{meta:n,inputUrl:t,inStore:o,registryUrl:i},isInit:!0}),de({showFromUrlDialog:!1}),Ze()},handleText:{title:v("blocklet.component.addComponentTip.fromUrl"),confirm:v("blocklet.component.choose")}}),(0,N.jsx)(jn,{stores:u,extra:ce?null:(0,N.jsxs)(R.Z,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{de({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[(0,N.jsx)(xe.Z,{style:{fontSize:20,marginRight:4}})," ",v("blocklet.component.addComponentTip.fromUrl")," "]}),loading:j,onChange:()=>{Y({}),ee.current={}},storageKey:x,children:e=>{let{currentRegistry:n}=e;return(0,N.jsx)(Nn,{serverVersion:null===z||void 0===z?void 0:z.version,style:oe?{height:"calc(100vh - 56px - 80px - 32px - 40px )"}:{height:"calc(100% - 40px)"},storeUrl:n.url,resourceType:h,resourceDid:f,handleButtonClick:e=>{Pe({chooseParams:{...e,inStore:!0},isInit:!0})},handleBlockletRender:e=>{let{blocklet:n,defaultRender:t}=e;const o=(null===Q||void 0===Q?void 0:Q.bundleDid)&&(null===Q||void 0===Q?void 0:Q.bundleDid)===(null===n||void 0===n?void 0:n.did);return(0,N.jsxs)(Jt,{children:[o&&(0,N.jsx)("div",{className:"check-container",children:(0,N.jsx)(Te.default,{className:"check-icon"})}),(0,N.jsx)("div",{className:o?"choose-blocklet":"",style:{marginLeft:16},children:t})]})}})}})]}),cancel:"embed"===m?void 0:v("common.cancel"),confirm:Ot({params:Q,blocklet:M,t:v}),onCancel:fe,onConfirm:()=>{Ze()}},{key:"agreement",name:v("launchBlocklet.introduction"),body:(0,N.jsxs)(Gt,{component:"div",className:"agreement-wrapper",children:[(0,N.jsx)(Se.Z,{title:v("launchBlocklet.introduction"),subTitle:v("blocklet.component.addComponentTip.introduction")}),(0,N.jsx)(fn.Z,{meta:se,onClickNext:Ze,installRelated:re,onChangeInstallRelated:ae,handleDescEle:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)("div",{dangerouslySetInnerHTML:{__html:v("blocklet.component.addComponentTip.".concat(Q.requirePurchase?"isPurchase":"isFree"),{name:me()})}})}),(0,N.jsx)("p",{children:v("blocklet.component.addComponentTip.belowInformation")})]})})]}),cancel:v(y?"common.cancel":"common.pre"),confirm:v("launchBlocklet.next"),onCancel:y?fe:Re,onConfirm:()=>{J(!1),Ze()}},se&&Q.requirePurchase&&{key:"purchase",name:(0,N.jsxs)(N.Fragment,{children:[v("common.verifyNFT"),(0,N.jsx)(Qe.Z,{})]}),body:(0,N.jsxs)(Gt,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(2===(null===(r=te.current)||void 0===r||null===(a=r.getCurrentStep)||void 0===a?void 0:a.call(r))||K)&&(0,N.jsx)(Ht,{title:v("common.verifyNFT"),subTitle:v("blocklet.component.addComponentTip.verifyNFT")}),we()(Q.purchaseResultProps)?G&&(0,N.jsx)(mn,{ref:te,meta:G.meta,mode:Q.componentDid?"verify":"both",onCancel:e=>{J(!1),de({purchaseResultProps:{variant:"error",title:me(),subTitle:e,style:{paddingTop:120},footer:(0,N.jsx)(R.Z,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{de({purchaseResultProps:{}})},children:v("common.retry")})}})},installOpts:G.installOpts,handlePaySuccess:e=>{let{downloadTokenList:n}=e;ee.current.downloadTokenList=n,J(!1),Ze()}}):(0,N.jsx)("div",{className:"flex-align-center flex-justify-center",children:(0,N.jsx)(Ae.Z,{...Q.purchaseResultProps})})]}),disabled:2===(null===(s=te.current)||void 0===s||null===(c=s.getCurrentStep)||void 0===c?void 0:c.call(s))||K,cancel:v("common.pre"),confirm:v("common.next"),onConfirm:()=>{"function"===typeof te.current.onNext&&(te.current.onNext(),J(!0))},onCancel:()=>{Re()}},(0,S.hasStartEngine)(se)&&!ye(se.did)&&{key:"config",name:v("common.config"),error:T,body:(0,N.jsxs)(Gt,{component:"div",children:[(0,N.jsx)(Ht,{title:v("common.config"),subTitle:v("blocklet.component.addComponentTip.config")}),(0,N.jsx)(V.Z,{label:v("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:U||v("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:Q.pathPrefix,onChange:e=>{const n=e.target.value;de({pathPrefix:n}),D(v("common.slugifyHint",{value:(0,F.LN)(n)}))}}),!!T&&(0,N.jsx)(Ne.Z,{type:"error",style:{width:"100%",marginTop:8},children:T})]}),cancel:v("common.pre"),confirm:v("common.next"),onCancel:Re,onConfirm:()=>{Ze()}},se&&!ye(se.did)&&(null===Q||void 0===Q?void 0:Q.hasEnvironmentsStep)&&{key:"environment",name:(0,N.jsxs)(N.Fragment,{children:[v("common.environment")," ",Q.hasRequiredEnvironments&&(0,N.jsx)(Qe.Z,{})]}),disabled:!!C||(null===Q||void 0===Q?void 0:Q.hasMissRequiredConfigs),body:()=>(0,N.jsxs)(Gt,{component:"div",children:[(0,N.jsx)(Ht,{title:v("common.environment"),subTitle:v("blocklet.component.addComponentTip.environment")}),(0,N.jsx)(en,{style:{marginTop:-12,width:"100%"},schema:Q.configsList,defaultValue:Q.configsValue,onChange:(e,n)=>{let{action:t,currentItem:o,allValues:i}=n;"confirm"===t&&de({hasMissRequiredConfigs:Lt(Q.configsList,i),configsValue:i}),"edit"===t?E(o):["cancel","confirm"].includes(t)&&E(null)}})]}),cancel:v("common.pre"),confirm:v("common.next"),onCancel:Re,onConfirm:Ze},se&&!ye(se.did)&&(null===Q||void 0===Q?void 0:Q.didSpaceIsRequiredSetup)&&{key:"didSpace",name:(0,N.jsxs)(N.Fragment,{children:[v("blocklet.component.didSpaceConfig")," ","required"===Q.didSpaceIsRequiredSetup&&(0,N.jsx)(Qe.Z,{})]}),disabled:(null===Q||void 0===Q?void 0:Q.didSpaceIsRequiredSetup)&&!Q.didSpaceEndpoint,body:()=>(0,N.jsx)(ht,{children:(0,N.jsxs)(Gt,{component:"div",children:[(0,N.jsx)(Ht,{title:v("blocklet.component.didSpaceConfig"),subTitle:v("blocklet.component.didSpaceConfigTip")}),(0,N.jsx)(d.Z,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:(0,N.jsx)(wt,{blockletMeta:ee.current.meta,onNext:()=>{Ze()},onEndpointUpdate:pe})})]})}),cancel:v("common.pre"),confirm:v("common.next"),onCancel:Re,onConfirm:Ze},{key:"install",name:ye(null===se||void 0===se?void 0:se.did)?v("common.upgrade"):v("common.install"),disabled:!1,loading:!1,body:(0,N.jsx)(Gt,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:we()(Q.installResultProps)?(0,N.jsx)(De.Z,{message:(0,N.jsx)(_t,{children:v("blocklet.component.installingCanCloseWindowTip")}),increaseSpeed:.3,messageLoop:!1}):(0,N.jsx)("div",{style:{marginTop:120},children:(0,N.jsx)(Ae.Z,{...Q.installResultProps})})}),confirm:v("common.complete"),onConfirm:()=>{zt(ie.componentDid),fe(),setTimeout((()=>{const e=document.getElementsByClassName("dashboard-main")[0];e&&(e.scrollTop=e.scrollHeight)}),200)}}].filter((e=>e)),Le=Ie[X]||{};return M?(0,N.jsxs)(qt,{sx:oe?{width:"100%",height:window.innerHeight}:{width:"100%",height:g?"72vh":"100vh"},children:[(0,N.jsx)(Ue.W,{steps:Ie,mode:"memory",children:(0,N.jsx)(Ft,{ref:ne,meta:se,isMobile:oe,onStepChange:e=>{$(e)}})}),(0,N.jsxs)(d.Z,{className:"action-bar",children:[Le.cancel&&(0,N.jsx)(R.Z,{onClick:e=>{e.stopPropagation(),Le.onCancel()},disabled:X===Ie.length-2&&j,color:"inherit",children:Le.cancel||v("common.cancel")}),Le.confirm&&(0,N.jsx)(R.Z,{onClick:e=>{e.stopPropagation(),Le.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:j||("boolean"===typeof Le.disabled?Le.disabled:!(!j&&!Le.error&&Q.bundleDid)||X>1&&!Q.pathPrefix),variant:"contained",autoFocus:!0,title:Le.confirm,style:{marginLeft:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[("boolean"===typeof Le.loading?Le.loading:j)&&(0,N.jsx)(w.Z,{style:{marginRight:8},size:16}),Le.confirm]})})]})]}):null}Mt.propTypes={onClose:s().func,mode:s().oneOf(["normal","embed"]),inDialog:s().bool,stores:s().arrayOf(s().string),resourceType:s().string,resourceDid:s().string,storageKey:s().string,selectedMeta:s().object},Mt.defaultProps={onClose:()=>{},mode:"normal",stores:[],resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null};const qt=(0,r.Z)(d.Z)(Rt||(Rt=(0,l.Z)(["\n .action-bar {\n display: flex;\n justify-content: flex-end;\n position: sticky;\n bottom: 0;\n padding-top: 16px;\n z-index: 100;\n width: 100%;\n background: #fff;\n border-top: 1px solid #eee;\n }\n"]))),Gt=(0,r.Z)(Pe.Z)(Et||(Et=(0,l.Z)(["\n width: 100%;\n height: 100%;\n"]))),Wt=r.Z.div(St||(St=(0,l.Z)(["\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n\n .bottom-button {\n min-width: 200px;\n }\n\n // blocklet-select-side\n aside {\n width: 140px;\n }\n"]))),Vt=e=>e.isMobile?"\n height: calc(100vh - 56px - 64px - 48px);\n ":"",Kt=(0,r.Z)(d.Z)(Pt||(Pt=(0,l.Z)(["\n ","\n\n & .flex-justify-center {\n display: flex;\n justify-content: center;\n }\n\n & .flex-align-center {\n display: flex;\n height: 100%;\n align-items: center;\n ","\n }\n\n & .agreement-wrapper {\n ","\n max-height: 60vh;\n .eula-trigger {\n padding-right: 0;\n }\n .next-button {\n display: none;\n }\n }\n\n & .connect {\n background: white;\n }\n"])),(e=>{let{className:n}=e;return"mobileStyle"===n?"\n & > div{\n height: 100%;\n }\n .root-header {\n .app-name-content {\n display: none;\n }\n }\n\n\n\n // content-panel\n .root-header + div{\n padding-top: 0;\n position: relative;\n & > div {\n padding-top: 0;\n }\n }\n\n header + div {\n padding-top: 0;\n }\n\n header {\n .header-title {\n margin-left: 0;\n }\n\n .header-title-name {\n max-width: 100% !important;\n }\n }\n ":"\n position: relative;\n .root-header {\n z-index: auto !important;\n position: fixed !important;\n }\n & > div {\n height: 100%;\n width: 100%;\n max-width: 100%;\n & > div {\n max-height: unset !important;\n max-width: 100%;\n & > div {\n // left-panel\n &:first-child {\n padding: 0;\n width: 25%;\n min-width: 240px;\n & > div:first-child {\n display: none;\n }\n // step\n & > div:last-child {\n // margin-top: 32px;\n margin-top: 0;\n }\n }\n // right-panel\n &:last-child {\n padding-top: 0;\n padding-right: 0px;\n overflow-y: hidden;\n .app-content {\n padding: 0 0 24px 0;\n }\n .button-container {\n padding-right: 0;\n }\n }\n }\n }\n }\n\n "}),(e=>Vt(e)),(e=>Vt(e))),Ht=(0,r.Z)(Se.Z)(Tt||(Tt=(0,l.Z)(["\n margin-bottom: 24px;\n"]))),Jt=r.Z.div(It||(It=(0,l.Z)(["\n position: relative;\n\n .choose-blocklet {\n background-color: rgb(236, 251, 253);\n border-color: rgb(236, 251, 253);\n border-radius: 8px;\n }\n\n .check-container {\n position: absolute;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: flex-end;\n align-items: flex-end;\n width: 30px;\n height: 30px;\n border-radius: 0 0 8px 0;\n color: ",";\n overflow: hidden;\n transition: all ease 0.3s;\n &:after {\n position: absolute;\n z-index: 0;\n display: block;\n width: 0;\n height: 0;\n border-top: transparent solid 15px;\n border-left: transparent solid 15px;\n border-bottom: "," solid 15px;\n border-right: "," solid 15px;\n transition: all ease 0.1s;\n content: '';\n }\n\n .check-icon {\n position: relative;\n z-index: 2;\n margin: 0 1px 1px 0;\n font-size: 16px;\n transition: all ease 0.2s;\n }\n }\n"])),(e=>e.theme.palette.common.white),(e=>e.theme.palette.primary.main),(e=>e.theme.palette.primary.main)),_t=r.Z.div(Ut||(Ut=(0,l.Z)(["\n color: ",";\n .msg-before {\n display: inline-block;\n color: #aaa;\n font-size: 14px;\n margin-right: 6px;\n }\n"])),(e=>e.theme.palette.primary.main));var Qt;function Yt(e){let{blocklet:n,showDialog:t,setShowDialog:o,selectedMeta:l}=e;const{t:r}=(0,i.PE)(),a=(0,ge.Z)((e=>e.breakpoints.down("md"))),{inService:s}=(0,O.h6)(),c=()=>{o(!1)};return t?(0,N.jsx)(Xt,{title:r("blocklet.component.addWithName",{name:(0,S.getDisplayName)(n)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:a?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(e,n)=>{"backdropClick"!==n&&c()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:(0,N.jsx)(Mt,{selectedMeta:l,onClose:c,storageKey:s?ye.K_:ye.WC})}):null}Yt.propTypes={selectedMeta:s().object,showDialog:s().bool.isRequired,setShowDialog:s().func.isRequired,blocklet:s().object.isRequired},Yt.defaultProps={selectedMeta:null};const Xt=(0,r.Z)(q.ZP)(Qt||(Qt=(0,l.Z)(["\n .MuiDialogContent-root {\n }\n"])));function $t(e){let{blocklet:n,children:t}=e;const{t:l}=(0,i.PE)(),[r,a]=(0,o.useState)(!1),s=e=>{e.stopPropagation(),a(!0)};return(0,N.jsxs)(N.Fragment,{children:["function"===typeof t?t({open:s}):(0,N.jsxs)(fe.Z,{onClick:s,className:"component-action","data-cy":"action-add-component",children:[(0,N.jsx)(xe.Z,{style:{fontSize:18,marginRight:5}}),l("blocklet.component.add")]}),(0,N.jsx)(Yt,{showDialog:r,setShowDialog:a,blocklet:n})]})}$t.propTypes={children:s().any,blocklet:s().object.isRequired},$t.defaultProps={children:null};var eo=t(70461);const no=e=>e.children.filter((e=>e.meta.interfaces.find((e=>e.type===H.BLOCKLET_INTERFACE_TYPE_WEB))));function to(e){let{params:n,setParams:t,setError:l,serviceTypes:r}=e;const{t:a}=(0,i.PE)(),{blocklet:s}=(0,Be.y0)(),c=s.meta.did,d=no(s),[p,m]=(0,o.useState)([]),u={301:a("common.redirectPermanently"),302:a("common.redirectTemporary"),307:a("common.redirectTemporary"),308:a("common.redirectPermanently")};return(0,o.useEffect)((()=>{if(n.type===Z.ROUTING_RULE_TYPES.COMPONENT&&n.componentId){const e=d.find((e=>e.meta.did===n.componentId)),o=(0,S.findWebInterface)(e.meta),i=(Array.isArray(null===o||void 0===o?void 0:o.pageGroups)?o.pageGroups:[]).map((e=>({value:e,label:"".concat(e," pages")})));i.length&&i.unshift({value:"",label:"All pages"}),m(i),n.pageGroup&&!1===i.find((e=>e.value===n.pageGroup))&&t({...n,pageGroups:""})}}),[n.componentId,n.type]),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(V.Z,{select:!0,label:a("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:n.type,onChange:e=>{l(""),t({...n,type:e.target.value,did:e.target.value===Z.ROUTING_RULE_TYPES.BLOCKLET?c:"",__disableConfirm:!1})},style:{marginBottom:32},SelectProps:{},children:r.map((e=>{let{name:n,value:t}=e;return(0,N.jsx)(fe.Z,{value:t,children:n},t)}))}),n.type===Z.ROUTING_RULE_TYPES.REDIRECT&&[(0,N.jsx)(V.Z,{select:!0,label:a("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:n.redirectCode,onChange:e=>t({...n,redirectCode:e.target.value}),style:{marginBottom:32},SelectProps:{},children:Object.keys(u).map((e=>(0,N.jsx)(fe.Z,{value:e,children:"".concat(u[e]," - ").concat(e)},e)))},"redirectCode"),(0,N.jsx)(V.Z,{label:a("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url",inputProps:{"data-cy":"redirect-url-input"},fullWidth:!0,value:n.url,helperText:a("router.urlHelperText"),style:{marginBottom:32},onChange:e=>{t({...n,url:e.target.value,__disableConfirm:!e.target.value.trim()}),e.target.value.trim()?l(""):l(a("router.validation.redirectUrlRequired"))}},"redirectUrl")],n.type===Z.ROUTING_RULE_TYPES.COMPONENT&&[(0,N.jsx)(V.Z,{select:!0,label:a("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:n.componentId,onChange:e=>{t({...n,componentId:e.target.value})},style:{marginBottom:32},SelectProps:{},children:d.map((e=>(0,N.jsx)(fe.Z,{value:e.meta.did,selected:e.meta.did===n.componentId,children:(0,S.getDisplayName)(e,!0)},e.meta.did)))},"componentId"),p.length?(0,N.jsx)(V.Z,{select:!0,label:a("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:n.pageGroup,helperText:a("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:e=>{t({...n,pageGroup:e.target.value})},SelectProps:{},children:p.map((e=>(0,N.jsx)(fe.Z,{value:e.value,selected:e.value===n.pageGroup,children:e.label},e.label)))},"pageGroup"):null].filter(Boolean),n.type===Z.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(0,N.jsx)(V.Z,{label:a("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:n.url,helperText:a("router.urlHelperText"),style:{marginBottom:32},onChange:e=>{t({...n,url:e.target.value,__disableConfirm:!e.target.value.trim()}),e.target.value.trim()?l(""):l(a("router.validation.rewriteUrlRequired"))}},"url")]})}function oo(e){let{children:n}=e;const{t:t}=(0,i.PE)(),{api:l}=(0,O.h6)(),{blocklet:r}=(0,Be.y0)(),[a,s]=(0,o.useState)(!1),[c,d]=(0,o.useState)(null),p=r.meta.did,m=r.site.id,u={title:t("router.rule.add.title"),description:(e,n,o)=>(0,N.jsxs)(Pe.Z,{component:"div",children:[(0,N.jsx)(V.Z,{label:t("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:e.pathPrefixHint||t("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:e.pathPrefix,onChange:i=>{let l=!1;const a=(0,hn.Rw)({params:{...e,pathPrefix:i.target.value},blocklets:[r]});o(a),e.type===Z.ROUTING_RULE_TYPES.BLOCKLET&&a&&(l=!0),e.type!==Z.ROUTING_RULE_TYPES.REDIRECT||e.url||(l=!0),e.type!==Z.ROUTING_RULE_TYPES.GENERAL_REWRITE||e.url||(l=!0),i.target.value.trim()||(l=!0,o(t("router.validation.pathPrefixRequired"))),l||o("");const s=t("common.slugifyHint",{value:(0,F.LN)(i.target.value)});n({...e,pathPrefix:i.target.value,pathPrefixHint:s,__disableConfirm:l})}}),(0,N.jsx)(to,{params:e,setParams:e=>{o(null);(0,hn.fX)(e,t)?n({...e,__disableConfirm:!0}):n({...e})},setError:o})]}),confirm:t("router.rule.add.confirm"),cancel:t("common.cancel"),params:{did:"",pathPrefix:"",type:Z.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,__disableConfirm:!0},onConfirm:async e=>{try{const n=await(0,hn.fX)(e,t);if(n)throw n;s(!0);const o={from:{pathPrefix:le()(e.pathPrefix)},to:{type:e.type}};e.type===Z.ROUTING_RULE_TYPES.REDIRECT&&(o.to.url=e.url.trim(),o.to.redirectCode=e.redirectCode),e.type===Z.ROUTING_RULE_TYPES.COMPONENT&&(o.to.did=p,o.to.componentId=e.componentId,o.to.pageGroup=e.pageGroup),e.type===Z.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(o.to.url=le()(e.url)),await l.addRoutingRule({input:{id:m,rule:o,teamDid:p}})}catch(n){P.Z.error(n.message)}finally{s(!1),d(null)}},onCancel:()=>{s(!1),d(null)}},h=e=>{e.stopPropagation(),d(u)};return(0,N.jsxs)(N.Fragment,{children:["function"===typeof n?n({loading:a,open:h}):(0,N.jsxs)(fe.Z,{onClick:h,className:"rule-action","data-cy":"action-add-rule",children:[a?(0,N.jsx)(w.Z,{size:16}):(0,N.jsx)(xe.Z,{style:{fontSize:18,marginRight:5}}),t("router.rule.add.title")]}),c&&(0,N.jsx)(eo.Z,{title:c.title,description:c.description,confirm:c.confirm,cancel:c.cancel,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel,color:"primary"})]})}to.propTypes={params:s().object,serviceTypes:s().array,setParams:s().func,setError:s().func},to.defaultProps={params:{},serviceTypes:[{name:"Redirect",value:Z.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:Z.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:Z.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Component - Pass traffic to blocklet component",value:Z.ROUTING_RULE_TYPES.COMPONENT}],setParams:()=>{},setError:()=>{}},oo.propTypes={children:s().any},oo.defaultProps={children:null};var io=t(82434),lo=t.n(io),ro=t(62681),ao=t(18067),so=t(74286),co=t(27773),po=t(94552),mo=t(71363);function uo(e){let{id:n,from:t,children:l}=e;const{t:r}=(0,i.PE)(),{api:a}=(0,O.h6)(),{blocklet:s}=(0,Be.y0)(),[c,d]=(0,o.useState)(!1),[p,m]=(0,o.useState)(null),u=s.meta.did,h=s.site.id,f=t.pathPrefix,x={keyName:f,title:r("router.rule.delete.title"),description:r("router.rule.delete.description",{name:"<b>".concat(f,"</b>")}),confirmPlaceholder:r("router.rule.delete.confirm_desc",{name:f}),confirm:r("common.delConfirm"),cancel:r("router.rule.delete.cancel"),onConfirm:async()=>{d(!0);try{await a.deleteRoutingRule({input:{id:h,ruleId:n,teamDid:u}})}catch(e){P.Z.error(e.message)}finally{m(null),d(!1)}},onCancel:()=>{d(!1),m(null)}},g=e=>{e.stopPropagation(),m(x)};return(0,N.jsxs)(N.Fragment,{children:["function"===typeof l?l({loading:c,open:g}):(0,N.jsxs)(fe.Z,{onClick:g,className:"rule-action","data-cy":"action-delete-rule",children:[c?(0,N.jsx)(w.Z,{size:16}):(0,N.jsx)(co.default,{style:{fontSize:18,marginRight:5}}),r("router.rule.delete.title")]}),p&&(0,N.jsx)(mo.Z,{keyName:p.keyName,title:p.title,description:p.description,confirmPlaceholder:p.confirmPlaceholder,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel})]})}function ho(e){let{id:n,from:t,to:l,children:r}=e;const{t:a}=(0,i.PE)(),{api:s}=(0,O.h6)(),{blocklet:c}=(0,Be.y0)(),[d,p]=(0,o.useState)(!1),[m,u]=(0,o.useState)(null),h=c.meta.did,f=c.site.id,x=t.pathPrefix,g={title:a("router.rule.update.title"),description:(e,n,t)=>(0,N.jsxs)(Pe.Z,{component:"div",children:[(0,N.jsx)(V.Z,{label:a("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:e.helperText||a("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:e.pathPrefix,onChange:o=>{let i=!1;e.type!==Z.ROUTING_RULE_TYPES.REDIRECT||e.url||(i=!0),e.type!==Z.ROUTING_RULE_TYPES.GENERAL_REWRITE||e.url||(i=!0),o.target.value.trim()||(i=!0,t(a("router.validation.pathPrefixRequired"))),i||t("");const l=a("common.slugifyHint",{value:(0,F.LN)(o.target.value)});n({...e,pathPrefix:o.target.value,helperText:l,__disableConfirm:i})}}),(0,N.jsx)(to,{params:e,setParams:e=>{(0,hn.fX)(e,a)?n({...e,__disableConfirm:!0}):n({...e})},setError:t})]}),confirm:a("router.rule.update.confirm"),cancel:a("router.rule.update.cancel"),color:"primary",params:{did:l.did||"",pathPrefix:"/"===x?x:x.replace(/^\/+/,"").replace(/\/+$/,""),type:l.type||Z.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:l.redirectCode||302,componentId:l.componentId||"",pageGroup:l.pageGroup||"",url:l.url||"",__disableConfirm:!1},onConfirm:async e=>{try{const t=await(0,hn.fX)(e,a);if(t)throw t;p(!0);const o={id:n,from:{pathPrefix:le()(e.pathPrefix)},to:{type:e.type}};e.type===Z.ROUTING_RULE_TYPES.REDIRECT&&(o.to.url=e.url,o.to.redirectCode=e.redirectCode),e.type===Z.ROUTING_RULE_TYPES.COMPONENT&&(o.to.did=h,o.to.componentId=e.componentId,o.to.pageGroup=e.pageGroup),e.type===Z.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(o.to.url=le()(e.url)),await s.updateRoutingRule({input:{id:f,rule:o,teamDid:h}})}catch(t){P.Z.error(t.message)}finally{p(!1),u(null)}},onCancel:()=>{p(!1),u(null)}},y=e=>{e.stopPropagation(),u(g)};return(0,N.jsxs)(N.Fragment,{children:["function"===typeof r?r({loading:d,open:y}):(0,N.jsxs)(fe.Z,{onClick:y,className:"rule-action","data-cy":"action-update-rule",children:[d?(0,N.jsx)(w.Z,{size:16}):(0,N.jsx)(M.default,{style:{fontSize:18,marginRight:5}}),a("router.rule.update.title")]}),m&&(0,N.jsx)(eo.Z,{title:m.title,description:m.description,confirm:m.confirm,color:m.color,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}function fo(e){const{locale:n}=(0,i.PE)(),{blocklet:t,recommendedDomain:o}=(0,Be.y0)(),l=(0,F.Sk)(o,e.from.pathPrefix,(0,F.f0)(t,n));return(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,N.jsx)("a",{target:"_blank",href:l,rel:"noopener noreferrer",title:l,children:(0,N.jsx)(f.Z,{size:"small",children:(0,N.jsx)(po.Z,{})})}),(0,N.jsx)(ho,{...e,children:n=>{let{open:t}=n;return(0,N.jsx)(f.Z,{size:"small",onClick:t,disabled:e.isProtected,"data-cy":"action-update-rule",children:(0,N.jsx)(g.Z,{})})}}),(0,N.jsx)(uo,{...e,children:n=>{let{open:t}=n;return(0,N.jsx)(f.Z,{size:"small",onClick:t,disabled:e.isProtected,"data-cy":"action-delete-rule",children:(0,N.jsx)(co.default,{})})}})]})}uo.propTypes={id:s().string.isRequired,from:s().object.isRequired,children:s().any},uo.defaultProps={children:null},ho.propTypes={id:s().string.isRequired,from:s().object.isRequired,to:s().object.isRequired,children:s().any},ho.defaultProps={children:null},fo.propTypes={isProtected:s().bool},fo.defaultProps={isProtected:!1};var xo=t(22228);function go(e){let{group:n,...t}=e;return n?(0,N.jsx)(xo.Z,{type:"reverse",...t,children:n}):null}function yo(e){let{domain:n,isHttps:t,toUrl:o}=e;const i=t?"https":"http";let l=o;return lo()(l)||(l="".concat(i,"://").concat(n).concat(o)),(0,N.jsx)(Zn.Z,{href:l,target:"_blank",style:{fontSize:14},underline:"hover",children:o},l)}function vo(e){let{hasPermission:n}=e;const{t:t,locale:o}=(0,i.PE)(),l=(0,Fn.Z)(),{blocklet:r,recommendedDomain:a}=(0,Be.y0)();return r.site.rules.filter((e=>e.to.type!==Z.ROUTING_RULE_TYPES.BLOCKLET)).map((e=>{let i=null,s=null;e.to.type===Z.ROUTING_RULE_TYPES.NONE?i="404":e.to.type===Z.ROUTING_RULE_TYPES.REDIRECT?i=e.to.redirectCode:e.to.type===Z.ROUTING_RULE_TYPES.GENERAL_REWRITE?i="R":e.to.type===Z.ROUTING_RULE_TYPES.COMPONENT&&(s=r.children.find((n=>n.meta.did===e.to.componentId)),i="C");const c=e.isProtected?(0,N.jsx)(v.Z,{title:t("blocklet.router.urlLockTooltip"),placement:"top",children:(0,N.jsx)("span",{children:(0,N.jsx)(f.Z,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:(0,N.jsx)(ao.Z,{style:{fill:l.palette.text.disabled}})})})}):(0,N.jsx)(fo,{...e});return[(0,N.jsxs)(d.Z,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,N.jsxs)(d.Z,{width:{xs:300,md:400},display:"flex",alignItems:"center",children:[(0,N.jsx)(d.Z,{width:28}),"object"===typeof i?i:(0,N.jsx)(ro.Z,{children:i}),(0,N.jsxs)(d.Z,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[(0,N.jsxs)(d.Z,{style:{color:"#222",fontSize:16},children:[e.to.type===Z.ROUTING_RULE_TYPES.NONE&&t("common.page404"),e.to.type===Z.ROUTING_RULE_TYPES.REDIRECT&&t("common.redirect"),e.to.type===Z.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t("common.rewrite"),e.to.type===Z.ROUTING_RULE_TYPES.COMPONENT&&(0,S.getDisplayName)(s,!0)]}),(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[e.to.type===Z.ROUTING_RULE_TYPES.REDIRECT&&(0,N.jsx)(yo,{domain:a,toUrl:e.to.url}),e.to.type===Z.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(0,N.jsx)(yo,{domain:a,toUrl:e.to.url}),e.to.type===Z.ROUTING_RULE_TYPES.COMPONENT&&(0,N.jsx)(go,{group:e.to.pageGroup})]})]})]}),(0,N.jsx)(d.Z,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:(0,N.jsx)(Zn.Z,{href:(0,F.Sk)(a,e.from.pathPrefix,(0,F.f0)(r,o)),target:"_blank",style:{fontSize:16},underline:"hover",children:e.from.pathPrefix})},e.from.pathPrefix),(0,N.jsx)(d.Z,{children:n&&(0,N.jsx)("div",{style:{textAlign:"right"},children:c})},"actions")]},"rule"),(0,N.jsx)(so.Z,{},"divider")]}))}go.propTypes={group:s().string.isRequired},yo.propTypes={domain:s().string.isRequired,toUrl:s().string.isRequired,isHttps:s().bool},yo.defaultProps={isHttps:!1},vo.propTypes={hasPermission:s().bool},vo.defaultProps={hasPermission:!1};const bo=(0,z.V)(vo,"mutate_blocklets"),jo=(0,z.V)(vo,"",F.Wf);function ko(e){const{inService:n}=(0,O.h6)();return n?(0,N.jsx)(jo,{...e}):(0,N.jsx)(bo,{...e})}var Co=t(44125);const Zo=function(){let{blocklet:e,scrollToComponent:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{blocklet:null,scrollToComponent:!1};const t=(0,ve.useNavigate)(),{t:l}=(0,i.PE)(),r=(0,o.useRef)(null),a=(0,o.useMemo)((()=>{if(!e||!e.optionalComponents)return null;const o=new URLSearchParams(window.location.search),i=o.get("install-component");if(i){r.current=i,o.delete("install-component"),t(o.toString());const a=e.optionalComponents.find((e=>e.meta.did===i));if(!a)return P.Z.success(l("notification.installComponentError",{did:i})),null;const{meta:s}=a;if(n){const e=document.getElementById("optional-component-".concat(i)),n=document.querySelector(".dashboard-main");if(e){const t=e.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTo({top:t.top-o.top+n.scrollTop,behavior:"smooth"})}}return s}return null}),[e,t,l,n]);return(0,o.useEffect)((()=>{var n;r.current&&window.opener&&window.opener.postMessage({blocklet:e,kind:"component-installer"},null===(n=window.blocklet)||void 0===n?void 0:n.appUrl)}),[e]),a};var wo=t(1340),Ro=t(34966),Eo=t(32207),So=t(35258),Po=t(55498),To=t(64886),Io=t(57156),Uo=t.n(Io),No=t(2078),Do=t.n(No),Ao=t(19778);function Bo(e){var n;let{sourceInfo:t,blocklet:l}=e;const{t:r}=(0,o.useContext)(i.RD);return(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,N.jsx)(Ao.Z,{type:"success",children:Do()(t.source)},"source"),"registry"===t.source&&(0,N.jsx)(Zn.Z,{href:on()(t.deployedFrom,"blocklets",(null===l||void 0===l||null===(n=l.meta)||void 0===n?void 0:n.bundleDid)||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:r("blocklet.overview.viewInStore")})]})}Bo.propTypes={sourceInfo:s().shape({source:s().string,deployedFrom:s().string}),blocklet:s().object},Bo.defaultProps={sourceInfo:{},blocklet:{}};var Lo=t(81010),Oo=t(40736);function Fo(e){let{blocklet:n,checkUpgrade:t,hasPermission:l,...r}=e;const{api:a}=(0,O.h6)(),{t:s}=(0,o.useContext)(i.RD),[c,d]=(0,o.useState)(!1),[p,m]=(0,o.useState)(""),[u,h]=(0,o.useState)(null),[x,g]=(0,o.useState)(null);(0,o.useEffect)((()=>{h(null),t&&(n.mode,H.BLOCKLET_MODES.DEVELOPMENT)}),[n,t]);const y={title:"".concat(s("common.upgrade")," ").concat(s("common.blocklet")," ").concat((0,S.getDisplayName)(n)),description:s("blocklet.action.upgradeDescription"),confirm:s("blocklet.action.confirmUpgrade"),cancel:s("common.cancel"),onConfirm:async()=>{d(!0);try{const e={did:n.meta.did,version:u.version,storeUrl:u.registryUrl||""};await(0,F._v)(2e3),await a.upgradeBlocklet({input:e})}catch(e){P.Z.error("Blocklet upgrade failed: ".concat((0,F.Z)(e)))}finally{d(!1),g(null)}},onCancel:()=>{d(!1),g(null)}};return l&&u&&!(0,S.isInProgress)(n.status)?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(xo.Z,{...r,children:n.meta.version}),(0,N.jsx)(v.Z,{title:s("common.updateAvailable",{version:u.version}),children:(0,N.jsx)(f.Z,{size:"small",style:{marginLeft:8},disabled:c,onClick:()=>g(y),children:c?(0,N.jsx)(w.Z,{size:16}):(0,N.jsx)(Oo.Z,{style:{fontSize:16,color:"red"}})})}),!!p&&(0,N.jsx)(P.Z,{variant:"error",message:p,onClose:()=>m("")}),x&&(0,N.jsx)(eo.Z,{title:x.title,description:x.description,confirm:x.confirm,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]}):(0,N.jsx)(xo.Z,{...r,children:n.meta.version})}Fo.propTypes={blocklet:s().object.isRequired,checkUpgrade:s().bool,hasPermission:s().bool},Fo.defaultProps={checkUpgrade:!1,hasPermission:!1};const zo=(0,z.V)(Fo,"mutate_blocklets"),Mo=(0,z.V)(Fo,"",F.Wf);function qo(e){const{inService:n}=(0,O.h6)();return n?(0,N.jsx)(Mo,{...e}):(0,N.jsx)(zo,{...e})}var Go,Wo=t(80378),Vo=t(32349),Ko=t(65140),Ho=t(87916);function Jo(e){let{component:n,remove:t,disabled:l,tip:r,showConfirm:a,hideBtn:s,onCancel:c}=e;const{t:d}=(0,o.useContext)(i.RD),[p,m]=(0,o.useState)(!1),[u,h]=(0,o.useState)(null),f=async e=>{m(!0),await t(e.component,e.removeType),m(!1),h(null)},x=l||p,g=()=>{h({title:"".concat(d("common.delete")," ").concat(n.meta.title||n.meta.name),description:(e,n)=>(0,N.jsxs)(Pe.Z,{component:"div",children:[(0,N.jsx)(Pe.Z,{gutterBottom:!0,children:d("blocklet.action.removeComponentDescription")}),(0,N.jsxs)(Ho.Z,{name:"removeType",value:e.removeType,onChange:t=>n({...e,removeType:t.target.value}),children:[(0,N.jsx)(k.Z,{value:"keepData",control:(0,N.jsx)(Ko.Z,{}),label:d("blocklet.action.removeComponentKeepData")}),(0,N.jsx)(k.Z,{value:"complete",control:(0,N.jsx)(Ko.Z,{}),label:d("blocklet.action.removeComponentComplete")})]})]}),confirm:d("common.confirm"),cancel:d("common.cancel"),params:{component:n,removeType:"keepData"},onConfirm:f,onCancel:()=>{h(null),c()}})};(0,o.useEffect)((()=>{a?g():(m(!1),h(null))}),[a]);const y=(0,N.jsx)(_o,{size:"small",disabled:x,onClick:()=>g,"data-cy":"delete-component-btn",children:(0,N.jsx)(co.default,{disabled:x})}),b=(0,N.jsx)(v.Z,{title:r||d("common.delete"),children:(0,N.jsx)("span",{children:y})});return(0,N.jsxs)(N.Fragment,{children:[!s&&b,u&&(0,N.jsx)(eo.Z,{title:u.title,description:u.description,confirm:u.confirm,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel})]})}Jo.propTypes={component:s().object.isRequired,remove:s().func,onCancel:s().func,disabled:s().bool,showConfirm:s().bool,hideBtn:s().bool,tip:s().string},Jo.defaultProps={remove:async()=>{},disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:()=>{},tip:""};const _o=(0,r.Z)(f.Z)(Go||(Go=(0,l.Z)(["\n &.Mui-disabled {\n opacity: 0.5;\n }\n"])));var Qo,Yo=t(22754),Xo=t(98451);function $o(e){let{component:n,onStart:t,onStop:l,disabled:r,tip:a}=e;const{t:s}=(0,o.useContext)(i.RD),[c,d]=(0,o.useState)(!1),[p,m]=(0,o.useState)(),u=r||c,h=["starting","running","stopping"].includes(n.status),f=h?Xo.Z:Yo.Z,x=(0,N.jsx)(ei,{disabled:u,onClick:()=>{var e;h?m({title:"".concat(s("common.stop")," ").concat(null===n||void 0===n||null===(e=n.meta)||void 0===e?void 0:e.title),description:s("blocklet.action.stopComponentDescription"),confirm:s("blocklet.action.confirmStop"),cancel:s("common.cancel"),onConfirm:()=>(m(null),(async()=>{d(!0);try{await l(n)}catch(e){P.Z.error(e.message)}d(!1)})()),onCancel:()=>m(null)}):(async()=>{d(!0);try{await t(n)}catch(e){P.Z.error(e.message)}d(!1)})()},"data-cy":"".concat(h?"stop":"start","-component-btn"),children:(0,N.jsx)(f,{disabled:u})});return[(0,N.jsx)(v.Z,{title:a||s("common.".concat(h?"stop":"start")),children:(0,N.jsx)("span",{children:x})},"btn"),p&&(0,N.jsx)(eo.Z,{title:p.title,description:p.description,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel},"connect")]}$o.propTypes={component:s().object.isRequired,onStart:s().func,onStop:s().func,disabled:s().bool,tip:s().string},$o.defaultProps={onStart:async()=>{},onStop:async()=>{},disabled:!1,tip:""};const ei=(0,r.Z)(f.Z)(Qo||(Qo=(0,l.Z)(["\n &.Mui-disabled {\n opacity: 0.5;\n }\n"])));var ni,ti,oi=t(92726);const ii=(e,n)=>e?[{name:n("common.name"),value:e.displayName},{name:n("common.description"),value:e.description},{name:n("common.version"),value:(0,N.jsx)(xo.Z,{children:e.version})}]:[],li=e=>{const{source:n,deployedFrom:t,bundleSource:o}=e;return n?{source:n,deployedFrom:t}:o?o.url?{source:"url",deployedFrom:t||Array.isArray(o.url)?o.url[0]:o.url}:o.store?{source:"registry",deployedFrom:t||Array.isArray(o.store)?o.store[0]:o.store}:{}:{source:"upload",deployedFrom:t}},ri=(e,n)=>{const t=e.split("/").slice(1);let o=n,i=0;const l=[];for(;o&&i<t.length;){const e=o.children.find((e=>e.meta.did===t[i]));o=e,i++,e&&l.push(e.meta.title)}return l.join(" / ")},ai=e=>{var n;return"pack"===(null===e||void 0===e||null===(n=e.meta)||void 0===n?void 0:n.group)};function si(e){var n,t,l,r,a;let{blocklet:s,ancestors:u,depth:h,onRemove:x,onStart:y,onStop:b,onRestart:j,onReload:k,getComponentUrl:C,app:Z}=e;const{t:w,locale:R}=(0,o.useContext)(i.RD),[E,P]=(0,o.useState)(),[I,U]=(0,o.useState)(!1),[D,A]=(0,o.useState)(!1),[B,L]=(0,o.useState)(null),{deletingBlocklets:O}=(0,T.K)();let{status:z}=s;1===h&&O.includes(s.meta.did)&&(z="deleting");const M="/".concat(s.mountPoint||"/").replace(/\/+/g,"/"),q=C(M),G=E?li(E):{},W=E?[{name:w("common.name"),value:(0,S.getDisplayName)(E,!0)},{name:w("common.version"),value:(0,N.jsx)(qo,{blocklet:E,checkUpgrade:!1})},{name:w("common.status"),value:(0,N.jsx)(Lo.Z,{status:z,source:E.source,progress:s.progress})},"running"===s.status?{name:w("blocklet.startedAt"),value:(0,F.B2)(s.startedAt,R)}:null,"running"!==s.status?{name:w("blocklet.stoppedAt"),value:(0,F.B2)(s.stoppedAt,R)}:null,s.installedAt?{name:w("blocklet.installedAt"),value:(0,F.B2)(s.installedAt,R)}:null,(0,S.hasStartEngine)(s.meta)?{name:w("common.mountPoint"),value:M}:null,E.meta.group?{name:w("common.group"),value:(0,N.jsx)(xo.Z,{type:"success",children:E.meta.group})}:null,{name:w("blocklet.overview.source"),value:(0,N.jsx)(Bo,{sourceInfo:G,blocklet:s})},{name:w("blocklet.overview.deployedFrom"),value:G.deployedFrom||"-"},{name:w("common.did"),value:(0,N.jsx)(Yn.Z,{did:E.meta.did})},{name:w("common.author"),value:(0,F.rq)(E.meta.author)},{name:w("common.engine"),value:ii(E.engine,w).map((e=>{let{name:n,value:t}=e;return(0,N.jsx)(To.Z,{style:{marginBottom:4},nameWidth:120,name:n,children:t},n)}))},null!==(n=s.dependents)&&void 0!==n&&n.length?{name:w("common.dependents"),value:(0,N.jsx)(d.Z,{children:s.dependents.map((e=>(0,N.jsx)(d.Z,{children:"".concat(ri(e.id,Z)," ").concat(e.required?"(".concat(w("common.required"),")"):"")},e.id)))})}:null,null!==(t=s.meta.resources)&&void 0!==t&&t.length?{name:w("common.resource"),value:s.meta.resources.join(", ")}:null].filter(Boolean):[],V=(0,S.isInProgress)(Z.status),K=(0,S.isInProgress)(s.status);let H="";if(V||K||1===h&&O.includes(s.meta.did))H=w("blocklet.component.tip.stopBlocklet");else if(null!==(l=s.dependents)&&void 0!==l&&l.length){const e=s.dependents.filter((e=>e.required));if(e.length){const n=e.map((e=>ri(e.id,Z)));H=w("blocklet.component.tip.requiredBy",{name:n.join(", ")})}}return[(0,N.jsxs)(di,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[(0,N.jsxs)(d.Z,{pl:2,width:{xs:300,md:400},display:"flex",alignItems:"center",children:[(0,N.jsx)(Wo.Z,{blocklet:s,ancestors:u}),(0,N.jsxs)(d.Z,{ml:"16px",children:[(0,N.jsxs)(d.Z,{className:"component-header",onClick:()=>P(s),children:[(0,N.jsx)(d.Z,{className:"component-name",children:(0,S.getDisplayName)(s,!0)}),(0,N.jsx)(d.Z,{className:"component-version",children:null===s||void 0===s||null===(r=s.meta)||void 0===r?void 0:r.version})]}),(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",sx:{mt:"2px",ml:-.5},children:["unknown"!==z&&(0,N.jsx)(Lo.Z,{style:{marginLeft:4},status:z,source:s.source,progress:s.progress}),(0,N.jsx)(Vo.Z,{style:{marginLeft:4},mode:s.mode||""}),!(null===(a=s.dependents)||void 0===a||!a.length)&&(0,N.jsx)(v.Z,{title:["".concat(w("common.dependents"),": "),s.dependents.map((e=>(0,N.jsx)(d.Z,{pl:1,children:"".concat(ri(e.id,Z)," ").concat(e.required?"(".concat(w("common.required"),")"):"")},e.id)))],children:(0,N.jsx)(d.Z,{display:"flex",color:"primary.main",ml:1,children:(0,N.jsx)(Po.JO,{icon:"octicon:package-dependents-16"})})})]})]})]},s),(0,S.hasStartEngine)(s.meta)&&(0,N.jsx)(d.Z,{sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:(0,N.jsx)("a",{target:"_blank",href:q,rel:"noopener noreferrer",title:q,children:(0,N.jsx)(d.Z,{maxWidth:400,sx:{color:"secondary.main",fontSize:16,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:Uo()(M)})})},M),(0,N.jsx)("div",{style:{flex:1}}),(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,S.hasStartEngine)(s.meta)&&(0,N.jsx)(v.Z,{title:w("common.visit"),children:(0,N.jsx)("a",{target:"_blank",href:q,rel:"noopener noreferrer",children:(0,N.jsx)(f.Z,{size:"small",children:(0,N.jsx)(po.Z,{})})})}),(0,N.jsx)(ue,{blocklet:s,ancestors:u,children:e=>{let{open:n}=e;return(0,N.jsx)(v.Z,{title:w("common.config"),children:(0,N.jsx)(ci,{color:"error",badgeContent:"",variant:"dot",invisible:!(0,S.getComponentMissingConfigs)(s,u[0]).length,children:(0,N.jsx)(f.Z,{onClick:n,size:"small",children:(0,N.jsx)(g.Z,{})})})},"config")}}),(0,N.jsx)($o,{blocklet:Z,component:s,onStart:y,onStop:b,disabled:!["starting","stopping"].includes(Z.status)&&(0,S.isInProgress)(Z.status)}),(0,N.jsx)(oi.Z,{"data-cy":"component-actions",actions:[(0,S.hasStartEngine)(s.meta)?{icon:(0,N.jsx)(Ro.Z,{}),text:w("common.detail"),onClick:()=>{P(s)}}:null,!ai(s)&&{icon:(0,N.jsx)(Eo.default,{}),text:w("common.restart"),onClick:()=>{L({title:"".concat(w("common.restart")," ").concat(s.meta.title),description:w("blocklet.action.restartDescription"),confirm:w("blocklet.action.confirmRestart"),cancel:w("common.cancel"),onConfirm:async()=>{A(!0),await j(s),A(!1)},onCancel:()=>L(null)})},disabled:V||K||"running"!==s.status},!ai(s)&&{icon:(0,N.jsx)(So.Z,{}),text:w("common.reload"),onClick:async()=>{A(!0),await k(s),A(!1)},disabled:D||V||K||"running"!==s.status},{icon:(0,N.jsx)(co.default,{}),text:w("common.delete"),onClick:()=>{U(!0)},disabled:V||K||!!H,tip:H}].filter(Boolean)})]},"actions")]},"group-not-gateway-box"),(0,N.jsx)(so.Z,{},"line"),!!E&&(0,N.jsx)(c.Z,{open:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{P(null)},children:(0,N.jsxs)(d.Z,{paddingY:1.5,children:[(0,N.jsx)(m.Z,{children:w("common.componentBasicInfo")}),(0,N.jsx)(p.Z,{children:(J=W,J.map((e=>e.name===w("common.did")||e.name===w("blocklet.appId")?(0,N.jsx)(To.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:()=>e.name,children:e.value},e.name):(0,N.jsx)(To.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name))))})]},"dialog-wrapper")},"base-info-dialog"),(0,N.jsx)(Jo,{blocklet:Z,component:s,remove:async function(){A(!0);try{await x(...arguments)}catch{}A(!1),U(!1)},onCancel:()=>U(!1),hideBtn:!0,showConfirm:I},"delete-component"),B&&(0,N.jsx)(eo.Z,{title:B.title,description:B.description,confirm:B.confirm,cancel:B.cancel,params:B.params,onConfirm:B.onConfirm,onCancel:B.onCancel},"confirm-setting")];var J}si.propTypes={blocklet:s().object.isRequired,ancestors:s().array,depth:s().number,onRemove:s().func,onStart:s().func,onStop:s().func,onRestart:s().func,onReload:s().func,getComponentUrl:s().func,app:s().object},si.defaultProps={ancestors:[],depth:0,onRemove:()=>{},onStart:()=>{},onStop:()=>{},onRestart:()=>{},onReload:()=>{},getComponentUrl:()=>window.location.origin,app:null};const ci=(0,r.Z)(wo.Z)(ni||(ni=(0,l.Z)(["\n .BaseBadge-badge {\n top: ","px;\n right: ","px;\n }\n"])),(e=>8*e.top||6),(e=>8*e.right||6)),di=(0,r.Z)(d.Z)(ti||(ti=(0,l.Z)(["\n .component-header {\n display: flex;\n align-items: center;\n align-items: flex-end;\n cursor: pointer;\n }\n .component-name {\n color: #222;\n font-size: 16px;\n }\n .component-version {\n color: #999;\n font-size: 12px;\n margin-left: 4px;\n transform: translateY(-1px);\n }\n"])));var pi,mi=t(56556);function ui(e){let{meta:n,dependencies:t,logoUrl:o,setInstallComponentMeta:l}=e;const r=(0,O.h6)(),{t:a}=(0,i.PE)();return(0,N.jsxs)(hi,{id:"optional-component-".concat(n.did),children:[(0,N.jsxs)("div",{className:"cell",children:[(0,N.jsxs)("div",{className:"component-left",children:[(0,N.jsxs)(ro.Z,{className:"component-logo",style:{backgroundColor:"transparent",width:40,height:40,borderRadius:10},children:[(0,N.jsx)("img",{src:o,onError:()=>"".concat(r.imgPrefix,"/blocklet.png"),alt:n.title,style:{width:40}}),";"]}),(0,N.jsxs)("div",{className:"component-header",children:[(0,N.jsx)("div",{className:"component-name",children:n.title}),(0,N.jsx)("div",{className:"component-version",children:n.version})]}),(0,N.jsx)(v.Z,{title:["".concat(a("common.dependents"),": "),t.map((e=>(0,N.jsx)(d.Z,{pl:1,children:"".concat(e.parentTitle," ").concat(e.required?"(".concat(a("common.required"),")"):"")},e.parentName+e.mount_point)))],children:(0,N.jsx)(d.Z,{display:"flex",color:"primary.main",ml:1,children:(0,N.jsx)(Po.JO,{icon:"octicon:package-dependents-16"})})})]}),(0,N.jsx)("div",{style:{flex:1}}),(0,N.jsx)(mi.Z,{onClick:()=>{l(n)},startIcon:(0,N.jsx)(Po.JO,{icon:"ph:download-simple-bold"}),children:a("common.install")})]}),(0,N.jsx)(so.Z,{class:"line"},"line")]})}ui.propTypes={meta:s().object.isRequired,logoUrl:s().string,setInstallComponentMeta:s().func.isRequired,dependencies:s().arrayOf(s().shape({parentDid:s().string,parentName:s().string,parentPoint:s().string,required:s().bool}))},ui.defaultProps={logoUrl:"",dependencies:[]};const hi=(0,r.Z)(di)(pi||(pi=(0,l.Z)(["\n .line {\n opacity: 0.5;\n }\n .cell {\n display: flex;\n width: 100%;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n padding-top: 16px;\n padding-bottom: 16px;\n }\n .component-left {\n display: flex;\n flex-direction: row;\n padding-left: 4px;\n align-items: center;\n }\n .component-logo {\n opacity: 0.5;\n }\n .component-header {\n opacity: 0.5;\n margin-left: 12px;\n display: flex;\n align-items: center;\n align-items: flex-end;\n cursor: pointer;\n }\n .component-name {\n opacity: 0.5;\n color: #222;\n font-size: 16px;\n }\n .component-version {\n opacity: 0.8;\n color: #999;\n font-size: 12px;\n margin-left: 4px;\n transform: translateY(-1px);\n }\n"])));var fi,xi,gi;function yi(e){var n;let{blocklet:t,onUpdate:l,getComponentUrl:r,...a}=e;const{t:s}=(0,o.useContext)(i.RD),{api:I,inService:U,info:D}=(0,O.h6)(),{addDeletingDid:B,removeDeletingDid:L,matchDeletingDid:M}=(0,T.K)(),[q,G]=(0,o.useState)(!1),[W,V]=(0,o.useState)(null),[K,H]=(0,o.useState)(null),[J,_]=(0,o.useState)(!1),[Q,Y]=(0,o.useState)(null),X=t&&t.structVersion!==Z.APP_STRUCT_VERSION,[$,ee]=(0,o.useState)(!1),ne=[...t.children]||[];"gateway"!==t.meta.group&&ne.unshift(t),M(ne.map((e=>e.meta.did)));const te=async()=>{if(!q){G(!0);try{const{updateId:e,updateList:n}=(await I.checkComponentsForUpdates({input:{did:t.meta.did}})).preUpdateInfo||{};if(G(!1),!e)return void P.Z.info(s("blocklet.component.noUpdate"));const o=[];(0,S.forEachChildSync)(t,((e,t)=>{let{id:i,ancestors:l}=t;const r=n.find((e=>e.id===i));if(r){const n=l.slice(1).concat(e).map((e=>e.meta.title||e.meta.name)).join(" / "),t=(l[1]||e).meta.did;o.push({groupId:t,name:n,version:e.meta.version,newVersion:r.meta.version})}}));const i={};o.forEach((e=>{i[e.groupId]?e.disabled=!0:i[e.groupId]=!0})),V({params:{updateId:e},list:o,checks:i,hasChecks:!0})}catch(e){G(!1),P.Z.error((0,F.Z)(e))}}},oe=async(e,n)=>{B(e.meta.did);try{await I.deleteComponent({input:{did:e.meta.did,keepData:"keepData"===n,rootDid:t.meta.did}}),await(0,F._v)(800)}catch(o){P.Z.error((0,F.Z)(o)),L(e.meta.did)}},ie=async e=>{try{await I.startBlocklet({input:{did:t.meta.did,componentDids:[e.meta.did]}}),await(0,F._v)(800)}catch(n){P.Z.error((0,F.Z)(n))}},le=async e=>{try{await I.stopBlocklet({input:{did:t.meta.did,componentDids:[e.meta.did]}}),await(0,F._v)(800)}catch(n){P.Z.error((0,F.Z)(n))}},re=async e=>{try{await I.restartBlocklet({input:{did:t.meta.did,componentDids:[e.meta.did]}}),await(0,F._v)(800)}catch(n){P.Z.error((0,F.Z)(n))}},ae=async e=>{try{await I.reloadBlocklet({input:{did:t.meta.did,componentDids:[e.meta.did]}}),await(0,F._v)(800),P.Z.success(s("blocklet.reloadSuccess"))}catch(n){P.Z.error((0,F.Z)(n))}};(0,Co.Z)(te);const se=Zo({blocklet:t,scrollToComponent:!0}),ce=Q||se;return(0,N.jsxs)(vi,{component:"div",...a,children:[(0,N.jsxs)(bi,{display:"flex",children:[(0,N.jsxs)(ji,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[s("common.components"),!X&&(0,N.jsx)(z.Z,{permission:U?"":"mutate_blocklets",role:U?F.Wf:[],children:(0,N.jsx)(A,{children:(0,N.jsx)(ci,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!$,children:(0,N.jsxs)(R.Z,{disabled:q||(0,S.isInProgress)(t.status),color:"secondary",onClick:()=>{te()},"data-cy":"check-for-updates",children:[(0,N.jsx)(d.Z,{mr:.5,display:"flex",children:q?(0,N.jsx)(w.Z,{size:16}):(0,N.jsx)(h.Z,{style:{fontSize:"1em"}})}),s("blocklet.component.checkUpdateTitle")]})})})})]}),(0,N.jsx)(z.Z,{permission:U?"":"mutate_blocklets",role:U?F.Wf:[],children:(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,N.jsx)(oo,{children:e=>{let{open:n}=e;return(0,N.jsxs)(R.Z,{disabled:q||(0,S.isInProgress)(t.status),variant:"text",color:"primary","data-cy":"add-rule",className:"sm-hide-icon",onClick:n,children:[(0,N.jsx)(x.Z,{style:{fontSize:"1.3em",marginRight:4}}),s("router.rule.add.title")]})}}),!X&&(0,N.jsx)($t,{blocklet:t,serverVersion:D.version,children:e=>{let{open:n}=e;return(0,N.jsxs)(R.Z,{disabled:q||(0,S.isInProgress)(t.status),variant:"text",color:"primary","data-cy":"add-component",className:"sm-hide-icon",onClick:n,children:[(0,N.jsx)(x.Z,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.component.add")]})}}),!X&&(0,N.jsx)(ue,{blocklet:t,ancestors:[],children:e=>{let{open:n}=e;return(0,N.jsx)(v.Z,{title:"".concat(s("blocklet.component.container")).concat(s("common.config")),children:(0,N.jsx)(f.Z,{onClick:n,size:"small",color:"primary",children:(0,N.jsx)(g.Z,{style:{fontSize:18}})})},"config")}})]})})]}),null!==ne&&void 0!==ne&&ne.length?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(d.Z,{mt:2,children:["gateway"!==t.meta.group&&(0,N.jsx)(si,{blocklet:t,app:t,onRemove:oe,onStart:ie,onStop:le,onReload:ae,onRestart:re,getComponentUrl:r},"0-".concat(t.meta.did)),t.children.map((e=>(0,N.jsx)(si,{depth:1,blocklet:e,ancestors:[t],app:t,onRemove:oe,onStart:ie,onStop:le,onReload:ae,onRestart:re,getComponentUrl:r},"1-".concat(e.meta.did))))]},"top-blocklet-".concat(t.meta.did)),null===(n=t.optionalComponents)||void 0===n?void 0:n.map((e=>(0,N.jsx)(di,{children:(0,N.jsx)(ui,{setInstallComponentMeta:Y,...e})},e.meta.did)))]}):(0,N.jsx)(d.Z,{mt:8,children:(0,N.jsx)(E.Z,{children:s("blocklet.component.noComponent")})}),!!t.site.rules.length&&(0,N.jsx)(d.Z,{mt:0,ml:-1.5,children:(0,N.jsx)(ko,{})}),!!W&&(0,N.jsx)(c.Z,{open:!0,fullWidth:!0,children:(0,N.jsxs)(d.Z,{paddingY:1.5,children:[(0,N.jsx)(m.Z,{children:s("blocklet.component.updateTitle")}),(0,N.jsx)(d.Z,{component:p.Z,py:4,children:W.list.map((e=>(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,N.jsx)(j.Z,{checked:W.checks[e.groupId],onChange:n=>((e,n)=>{const{checked:t}=e.target;V((e=>{const o=Object.entries(e.checks).reduce(((e,o)=>{let[i,l]=o;return e[i]=n===i?t:l,e}),{}),i=Object.values(o).includes(!0);return{...e,checks:o,hasChecks:i}}))})(n,e.groupId),style:{marginLeft:e.disabled?16:0},defaultChecked:!0,disabled:e.disabled}),(0,N.jsxs)(d.Z,{flexGrow:1,mt:3,children:[(0,N.jsx)(d.Z,{item:!0,xs:8,children:e.name}),e.version&&(0,N.jsxs)(y.ZP,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[(0,N.jsx)(y.ZP,{item:!0,xs:3,children:e.version}),(0,N.jsx)(y.ZP,{item:!0,xs:1,children:(0,N.jsx)(b.Z,{style:{fontSize:"0.9em"}})}),(0,N.jsx)(y.ZP,{item:!0,xs:3,children:(0,N.jsx)(d.Z,{color:"secondary.main",children:e.newVersion})})]})]},"".concat(e.name,"-").concat(e.newVersion))]},e.name)))}),(0,N.jsxs)(u.Z,{style:{padding:"8px 24px 24px"},children:[(0,N.jsx)(R.Z,{onClick:()=>{V(null)},children:s("common.cancel")}),(0,N.jsxs)(R.Z,{onClick:e=>{e.stopPropagation(),(async()=>{if(!q)try{G(!0);const e=Object.keys(W.checks).filter((e=>W.checks[e])),n={updateId:W.params.updateId,rootDid:t.meta.did,selectedComponents:e};await I.upgradeComponents({input:n}),G(!1),V(null),ee(null)}catch(e){G(!1),P.Z.error((0,F.Z)(e))}})()},color:"primary",disabled:q||!W.hasChecks,variant:"contained",autoFocus:!0,children:[q&&(0,N.jsx)(w.Z,{size:16}),s("common.update")]})]})]})}),!!K&&(0,N.jsx)(c.Z,{open:!0,fullWidth:!0,onClose:()=>H(!1),children:(0,N.jsxs)(d.Z,{paddingY:1.5,children:[(0,N.jsx)(m.Z,{children:s("common.configuration")}),(0,N.jsx)(p.Z,{children:(0,N.jsx)(d.Z,{py:2,children:(0,N.jsx)(k.Z,{control:(0,N.jsx)(C.Z,{checked:J,onChange:e=>_(!!e.target.checked)}),label:s("blocklet.component.showContainer")})})})]})}),(0,N.jsx)(Yt,{selectedMeta:ce,blocklet:t,showDialog:!!ce,setShowDialog:()=>Y(null)})]})}yi.propTypes={blocklet:s().object.isRequired,onUpdate:s().func,getComponentUrl:s().func},yi.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const vi=r.Z.div(fi||(fi=(0,l.Z)(["\n .title {\n font-size: 1.2rem;\n font-weight: bold;\n }\n\n @keyframes showDelay {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n }\n\n .component-item {\n animation: showDelay 0.75s ease 1;\n }\n"]))),bi=(0,r.Z)(d.Z)(xi||(xi=(0,l.Z)(["\n "," {\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n }\n "," {\n flex-direction: column;\n justify-content: flex-end;\n align-items: flex-end;\n .sm-hide-icon > svg {\n display: none;\n }\n }\n"])),(e=>e.theme.breakpoints.up("sm")),(e=>e.theme.breakpoints.down("sm"))),ji=(0,r.Z)(d.Z)(gi||(gi=(0,l.Z)(["\n "," {\n width: 100%;\n justify-content: space-between;\n }\n"])),(e=>e.theme.breakpoints.down("sm")));var ki=t(21289);function Ci(e){const{locale:n}=(0,o.useContext)(i.RD),{blocklet:t,recommendedDomain:l}=(0,ki.y0)();return(0,N.jsx)(yi,{blocklet:t,getComponentUrl:e=>(0,F.vH)({blocklet:t,domain:{value:l},mountPoint:e,params:(0,F.f0)(t,n)}),...e})}Ci.defaultProps={}},44543:(e,n,t)=>{const o=t(57156);e.exports=(e,n)=>o(e)===o(n)},92726:(e,n,t)=>{"use strict";t.d(n,{Z:()=>x});var o,i=t(71171),l=t(5057),r=t(55898),a=t.n(r),s=t(33518),c=t(67680),d=t(61533),p=t(74490),m=t(45267),u=t(46954),h=t(44067),f=t(96266);function x(e){let{actions:n,size:t,...o}=e;const[i,r]=(0,l.useState)(null),a=Boolean(i),s=e=>{try{e.stopPropagation(),e.preventDefault()}catch{}r(null)};return(0,f.jsxs)(g,{...o,children:[(0,f.jsx)(c.Z,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"actions-menu-icon",onClick:e=>{try{e.stopPropagation(),e.preventDefault()}catch{}r(e.currentTarget)},size:t,children:(0,f.jsx)(m.Z,{})}),(0,f.jsx)(d.Z,{id:"actions-menu","data-cy":"actions-menu",anchorEl:i,keepMounted:!0,open:a,onClose:s,PaperProps:{},children:n.map(((e,n)=>{if("function"===typeof e)return e({close:s});const{icon:t,text:o,onClick:i,disabled:r=!1,...a}=e;return(0,l.createElement)(p.Z,{...a,disabled:r,dense:!0,onClick:async e=>{await i(e),s()},key:n,"data-cy":"actions-menu-".concat(n)},(0,f.jsx)(u.Z,{style:{minWidth:24,marginRight:8},children:t}),(0,f.jsx)(h.Z,{primary:o}))}))})]})}x.propTypes={actions:a().array,size:a().oneOf(["small","medium","large"])},x.defaultProps={actions:[],size:"small"};const g=s.Z.div(o||(o=(0,i.Z)([""])))},53927:(e,n,t)=>{"use strict";t.d(n,{Z:()=>S});var o=t(71171),i=t(55898),l=t.n(i),r=t(85493),a=t(33518),s=t(68420),c=t(40265),d=t(44566),p=t(55498),m=t(39948),u=t(26174),h=t(88092),f=t(67680),x=t(5057),g=t(35432),y=t(96266);function v(e){let{...n}=e;return(0,y.jsxs)("div",{...n,style:{width:"100%"},children:[(0,y.jsx)("h3",{children:"End User License Agreement for Application"}),(0,y.jsxs)("p",{children:["Blocklet Server License Agreement ",g.COPYRIGHT_OWNER," version 2020-08-28"]}),(0,y.jsx)("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),(0,y.jsx)("p",{children:"\u6682\u65e0"})]})}var b=t(13128),j=t(15715);function k(e){var n,t,o,i;return"".concat((null===(n=e.bundleSource)||void 0===n?void 0:n.store)||e.meta.homepage,"/assets/").concat(null===(t=e.meta)||void 0===t?void 0:t.did,"/").concat((null===(o=e.meta)||void 0===o?void 0:o.logo)||"logo.png","?v=").concat(null===(i=e.meta)||void 0===i?void 0:i.version)}function C(e){let{installRelated:n,meta:t,show:o,onClose:i,components:l,loading:r}=e;const{t:a}=(0,s.PE)(),c=(0,j.Z)((e=>e.breakpoints.down("md")));if(!o)return null;const d=!r&&0===l.length,u=!r&&0!==l.length;return(0,y.jsxs)(b.ZP,{title:a("blocklet.component.relatedComponents",{name:t.title}),maxWidth:!1,fullWidth:!1,onClose:(e,n)=>{"backdropClick"!==n&&i(!1)},PaperProps:{style:c?{width:"100%",height:window.innerHeight}:{maxWidth:500,minWidth:300,width:"80%"}},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:[r&&(0,y.jsx)(m.Z,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:(0,y.jsx)(m.Z,{sx:{fontSize:32},color:"primary.main",component:p.JO,icon:"line-md:loading-loop"})}),d&&(0,y.jsx)(m.Z,{sx:{textAlign:"center"},children:a("blocklet.component.noDependencies",{name:t.title})}),u&&(0,y.jsx)(m.Z,{sx:{marginBottom:2},children:l.map((e=>{if(!e.meta)return null;const{required:t}=e;let o;return o=n||t?1:.5,(0,y.jsxs)(m.Z,{sx:{opacity:o,padding:"10px 0px",paddingBottom:.5,marginTop:0,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[(0,y.jsx)("img",{style:{width:40,height:40,minWidth:40,minHeight:40},src:k(e),alt:e.meta.title}),(0,y.jsxs)(m.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[(0,y.jsxs)(m.Z,{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 n;window.open("".concat((null===(n=e.bundleSource)||void 0===n?void 0:n.store)||e.meta.homepage,"/blocklets/").concat(e.meta.did),"_blank")},children:[e.meta.title,(0,y.jsx)(m.Z,{sx:{display:t?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:a("blocklet.component.required")}),(0,y.jsxs)(m.Z,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[e.meta.version,(0,y.jsx)(m.Z,{className:"link-icon",icon:"fluent:open-20-filled",component:p.JO,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),(0,y.jsx)(m.Z,{sx:{marginTop:0,opacity:.7},children:e.meta.description})]})]},e.meta.did)}))})]})}C.propTypes={meta:l().object,show:l().bool,onClose:l().func.isRequired,installRelated:l().func,components:l().array.isRequired,loading:l().bool.isRequired},C.defaultProps={meta:null,show:!1,installRelated:!1};var Z=t(15849),w=t(58238);const R=function(e){const{api:n}=(0,w.h6)(),[t]=(0,Z.useSearchParams)(),o=t.get("blocklet_meta_url")||function(e){return e&&(e.registryUrl||e.homepage)&&e.did?"".concat(e.registryUrl||e.homepage,"/api/blocklets/").concat(null===e||void 0===e?void 0:e.did,"/blocklet.json"):""}(e),[i,l]=(0,x.useState)([]),[r,a]=(0,x.useState)(!1);return(0,x.useEffect)((()=>{!o||null!==e&&void 0!==e&&e.inputUrl||(a(!0),n.getDynamicComponents({input:{url:o}}).then((e=>{l(e.components)})).finally((()=>{a(!1)})))}),[o]),{components:i,loading:r}};var E;function S(e){let{installRelated:n,onChangeInstallRelated:t,meta:o,onClickNext:i,handleDescEle:l}=e;const a=(0,r.useNavigate)(),{t:g,locale:b}=(0,s.PE)(),[j,k]=(0,x.useState)(!1),{components:Z,loading:w}=R(o),E=i||(()=>{a("/launch-blocklet/install".concat(window.location.search))});return(0,y.jsxs)(P,{children:[(0,y.jsx)("div",{className:"app-content",children:(0,y.jsx)("div",{className:"agreement",children:(0,y.jsx)("div",{className:"agreement-content",children:(0,y.jsx)(d.Z,{blockletMeta:{data:o},locale:b,handleDescEle:l})})})}),(0,y.jsxs)(m.Z,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[w?(0,y.jsx)(p.JO,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,t&&null!==Z&&void 0!==Z&&Z.length?(0,y.jsxs)(m.Z,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[(0,y.jsx)(u.Z,{sx:{mr:.5},checked:n,onChange:e=>t(e.currentTarget.checked),control:(0,y.jsx)(h.Z,{}),label:(0,y.jsx)("span",{children:g("launchBlocklet.installRelatedComponents")})}),(0,y.jsx)(m.Z,{sx:{"> button svg":{color:"primary.main"}},children:(0,y.jsx)(f.Z,{size:"small",onClick:()=>{k(!0)},children:(0,y.jsx)(p.JO,{icon:"octicon:package-dependencies-16"})})})]}):null,(0,y.jsx)("div",{className:"button-container","data-cy":"agree-all",children:(0,y.jsx)(c.Z,{onContinue:E,description:(0,y.jsx)(v,{}),texts:{listenName:g("launchBlocklet.license"),buttonNext:g("launchBlocklet.next")}})})]}),(0,y.jsx)(C,{installRelated:n,meta:o,show:j,onClose:()=>{k(!1)},components:Z,loading:w})]})}S.propTypes={meta:l().object.isRequired,onClickNext:l().func,handleDescEle:l().node,installRelated:l().bool,onChangeInstallRelated:l().func},S.defaultProps={onClickNext:null,handleDescEle:"",installRelated:!0,onChangeInstallRelated:null};const P=a.Z.div(E||(E=(0,o.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n flex: 1;\n .app-content {\n padding: 2px 24px 24px;\n "," {\n padding-top: 10px;\n }\n width: 100%;\n flex: 1;\n letter-spacing: normal;\n }\n .agreement {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n border: 1px solid ",";\n border-radius: 12px;\n "," {\n margin-top: 24px;\n }\n "," {\n margin-top: 16px;\n }\n .agreement-content {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n font-size: 14px;\n overflow-y: auto;\n "," {\n padding: 0 24px;\n }\n "," {\n padding: 0 16px;\n }\n &:after {\n display: block;\n content: '';\n height: 24px;\n }\n }\n }\n .agreement-bottom {\n display: flex;\n width: 100%;\n padding: 24px;\n "," {\n flex-direction: row;\n align-items: center;\n margin-left: auto;\n }\n "," {\n flex-direction: column;\n align-items: center;\n padding-top: 0;\n padding-bottom: 16px;\n }\n }\n .button-container {\n "," {\n margin-left: auto;\n }\n "," {\n padding-top: 0;\n padding-bottom: 16px;\n }\n }\n"])),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.palette.grey[100]),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")))},80378:(e,n,t)=>{"use strict";t.d(n,{Z:()=>u});var o=t(55898),i=t.n(o),l=t(62681),r=t(72333),a=t(6352),s=t.n(a),c=t(35432),d=t(58238),p=t(14491);var m=t(96266);function u(e){let{blocklet:n,style:t,size:o,ancestors:i,...a}=e;const u=(0,d.h6)(),{logoUrl:h,inService:f}=function(e){var n;let{blocklet:t,ancestors:o=[]}=e;const i=(0,d.h6)(),{inService:l}=i,r="?v=".concat(null===t||void 0===t||null===(n=t.meta)||void 0===n?void 0:n.version).concat((0,p.XN)(null===t||void 0===t?void 0:t.status)?"~":"");let a=l?s()(p.zn,c.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",r):s()(i.imgPrefix,"blocklet.png");if("registry"===t.source&&t.deployedFrom&&t.meta.logo)a=s()(t.deployedFrom,(0,p.lk)(t.meta.bundleDid,t.meta.logo),r);else{const e=window.env.apiPrefix||"/",n=o.concat(t),i=l?n.slice(1):n;a=s()(e,"/blocklet/logo-bundle".concat(i.map((e=>"/".concat(e.meta.did))).join("")),r)}return{logoUrl:a,inService:l}}({blocklet:n,ancestors:i}),{variant:x}=a,g=f?()=>{}:e=>{e.target.src="".concat(u.imgPrefix,"/blocklet.png")};let y=(0,m.jsx)("img",{src:h,onError:g,alt:n.meta.name,style:{width:o}});return n.meta.logo||(y=(0,m.jsx)(r.Z,{did:n.meta.did||"",responsive:!0})),(0,m.jsx)(l.Z,{variant:x||"square",style:Object.assign({backgroundColor:"transparent",width:o,height:o,borderRadius:10},t),...a,children:y})}u.propTypes={blocklet:i().object.isRequired,style:i().object,size:i().oneOfType([i().number,i().string]),ancestors:i().array},u.defaultProps={style:{},size:40,ancestors:[]}},74286:(e,n,t)=>{"use strict";t.d(n,{Z:()=>a});var o=t(55898),i=t.n(o),l=t(39948),r=t(96266);function a(e){let{depth:n,className:t}=e;return(0,r.jsx)(l.Z,{ml:Math.max(2*(n-1),0),className:t,sx:{borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}a.propTypes={depth:i().number,className:i().string},a.defaultProps={depth:1,className:""}},61813:(e,n,t)=>{"use strict";t.d(n,{Z:()=>R});var o=t(5057),i=t(55898),l=t.n(i),r=t(13128),a=t(44846),s=t(55372),c=t(11750),d=t(47020),p=t(20870),m=t(31089),u=t(71767),h=t(64886),f=t(22425),x=t(68420),g=t(28726),y=t(88574),v=t(38242),b=t(58238),j=t(73545),k=t(14491),C=t(4651),Z=t(17450),w=t(96266);function R(e){let{defaultUrl:n,onCancel:t,onSuccess:i,onError:l,mode:R,handleText:E}=e;const{api:S}=(0,b.h6)(),{api:P}=(0,j.T)(),[T,I]=(0,o.useState)(!1),[U,N]=(0,o.useState)(""),{t:D}=(0,x.PE)(),A={dist:{}},[B,L]=(0,o.useState)(n),[O,F]=(0,o.useState)(n?1:0),[z,M]=(0,o.useState)(A),[q,G]=(0,o.useState)(!1),[W,V]=(0,o.useState)({}),K="component"===R,H=!!K||!n,J=async()=>{M(A),N(null),I(!0);try{const e=decodeURIComponent(B.trim());try{new URL(e)}catch{throw new Error("Invalid URL")}const{meta:n,inStore:t,registryUrl:o}=await S.getBlockletMetaFromUrl({input:{url:e}});M(n),V({inStore:t,registryUrl:o,inputUrl:B.trim()})}catch(e){console.error(e);const n="Blocklet Install failed: ".concat((0,k.Z)(e));N(n),l(e)}finally{I(!1)}};(0,o.useEffect)((()=>{n&&J()}),[n]);const _=[{name:D("common.name"),value:(0,v.getDisplayName)({meta:z},!0)},{name:D("common.version"),value:z.version},{name:D("common.did"),value:(0,w.jsx)(Z.Z,{did:z.did})},{name:D("common.author"),value:(0,k.rq)(z.author)},{name:D("blocklet.dist.downloadLink"),value:z.dist.tarball}],Q=[{label:D("blocklet.fromUrl.step0"),body:(0,w.jsx)(c.Z,{component:"div",children:(0,w.jsx)(d.Z,{label:D("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,style:{marginBottom:32},margin:"dense",helperText:D("blocklet.fromUrl.description"),value:B,onChange:e=>{N(null),L(e.target.value)},disabled:T,onKeyPress:e=>{"Enter"===e.key&&(e.preventDefault(),J(),F(1))}})}),cancel:D("common.cancel"),confirm:D("common.next"),onCancel:t,onConfirm:()=>{J(),F(1)}},{label:D("blocklet.fromUrl.step1"),body:T?(0,w.jsx)("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:(0,w.jsx)(a.Z,{})}):z.did?(0,w.jsx)("div",{style:{paddingLeft:"10%"},children:_.map((e=>e.name===D("common.did")?(0,w.jsx)(h.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:()=>D("common.did"),children:e.value},e.name):(0,w.jsx)(h.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name)))}):null,cancel:D(H?"common.pre":"common.cancel"),confirm:(null===E||void 0===E?void 0:E.confirm)||D("blocklet.fromUrl.confirm"),onCancel:()=>{H?F((e=>e-1)):t()},onConfirm:()=>{(()=>{if(K)return i({meta:z,...W}),void t();I(!0),G(!0)})()}}],Y=Q[O];return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(r.ZP,{title:(null===E||void 0===E?void 0:E.title)||D("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>Y.onCancel(),showCloseButton:0===O,disableEscapeKeyDown:!0,open:!0,actions:(0,w.jsxs)(w.Fragment,{children:[Y.cancel&&(0,w.jsx)(g.Z,{onClick:e=>{e.stopPropagation(),N(null),Y.onCancel()},color:"inherit",children:Y.cancel||D("common.cancel")}),(0,w.jsxs)(g.Z,{onClick:e=>{e.stopPropagation(),Y.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:T||!B||U,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[T&&0===O&&(0,w.jsx)(a.Z,{size:16}),Y.confirm]})]}),children:[H&&(0,w.jsx)(p.Z,{alternativeLabel:!0,activeStep:O,children:Q.map((e=>{let{label:n}=e;return(0,w.jsx)(m.Z,{children:(0,w.jsx)(u.Z,{children:n})},n)}))}),(0,w.jsx)(s.Z,{component:"div",style:{marginTop:24},children:Y.body}),!!U&&(0,w.jsx)(y.Z,{type:"error",style:{width:"100%",marginTop:8},children:U})]}),z&&q&&(0,w.jsx)(f.Z,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:P.get,checkTimeout:3e5,onSuccess:()=>{I(!1),G(!1),i({meta:z,...W}),t()},extraParams:{title:z.title,wt:(0,C.iK)(z),blockletMetaUrl:decodeURIComponent(B.trim())},messages:{title:D("setup.keyPair.title"),scan:D("setup.keyPair.scan"),confirm:D("setup.keyPair.confirm"),success:D("setup.keyPair.success")},onClose:()=>{I(!1),G(!1)}})]})}R.propTypes={defaultUrl:l().string,onCancel:l().func.isRequired,onSuccess:l().func.isRequired,onError:l().func,mode:l().oneOf(["install","component"]),handleText:l().object},R.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}}},59375:(e,n,t)=>{"use strict";t.d(n,{Z:()=>b});var o,i=t(71171),l=t(5057),r=t(55898),a=t.n(r),s=t(6352),c=t.n(s),d=t(33518),p=t(92706),m=t.n(p),u=t(39948),h=t(52277),f=t.n(h),x=t(68420),g=t(96266);const y=(0,l.lazy)((()=>Promise.all([t.e(6281),t.e(3674),t.e(9132)]).then(t.bind(t,84804)).then((e=>({default:e.Uploader}))))),v="/blocklet/logo/upload";function b(e){let{url:n,height:t,width:o,enabled:i,type:r,did:a,prefix:s,headers:d,onUploaded:p}=e;const{t:m}=(0,x.PE)(),h=(0,l.useRef)(null),b={cursor:i?"pointer":"default","&::after":{content:'"'.concat(m("common.switch"),'"')}};return(0,g.jsxs)(j,{id:"uploader-".concat(a,"-").concat(r),children:[(0,g.jsx)(y,{ref:h,popup:!0,onUploadFinish:()=>{var e;p(),null===(e=h.current)||void 0===e||e.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:c()(s,v,r,a),disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*",".jpg",".jpeg",".png",".gif",".svg"],maxFileSize:10485760,maxNumberOfFiles:1}},tusProps:{headers:d}}),(0,g.jsx)(u.Z,{className:f()("uploader-wrapper",i&&"enabled"),sx:b,onClick:()=>{var e;null===(e=h.current)||void 0===e||e.open()},children:(0,g.jsx)("img",{alt:"Logo",src:n,style:{height:t,width:o}})})]},"uploader-".concat(a,"-").concat(r))}b.propTypes={url:a().string.isRequired,type:a().oneOf(["square","rect","favicon"]).isRequired,did:a().string.isRequired,prefix:a().string.isRequired,headers:a().func,onUploaded:a().func,height:a().number,width:a().any,enabled:a().bool},b.defaultProps={height:80,width:"auto",enabled:!0,headers:()=>({}),onUploaded:m()};const j=d.Z.div(o||(o=(0,i.Z)(["\n .uploader-wrapper {\n display: inline-flex;\n position: relative;\n font-size: 0px;\n &.enabled {\n cursor: pointer;\n }\n &::after {\n display: none;\n }\n &.enabled::after {\n display: block;\n opacity: 0;\n position: absolute;\n bottom: 0;\n background: rgba(0, 0, 0, 0.2);\n left: 0;\n right: 0;\n height: 2.2em;\n color: white;\n text-align: center;\n font-size: 12px;\n line-height: 2em;\n transition: opacity 0.3s ease;\n }\n &:hover::after {\n opacity: 1;\n }\n }\n"])))},32349:(e,n,t)=>{"use strict";t.d(n,{Z:()=>a});var o=t(55898),i=t.n(o),l=t(22228),r=t(96266);function a(e){let{mode:n,...t}=e;return"development"===n?(0,r.jsx)(l.Z,{type:"primary",...t,children:"DEV"}):null}a.propTypes={mode:i().string.isRequired}},73170:(e,n,t)=>{"use strict";t.d(n,{$7:()=>x,AP:()=>y});var o=t(92877),i=t(55898),l=t.n(i),r=t(19577),a=t(2478),s=t(44067),c=t(46954),d=t(42507),p=t(40184),m=t(28726),u=t(76223),h=t(68420),f=t(96266);const x={meta:l().object.isRequired,onCancel:l().func.isRequired},g=(0,o.Z)((()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}})));function y(e){let{action:n,onSelect:t,onNext:o}=e;const i=g(),{t:l}=(0,h.PE)(),x=[{action:"purchase",title:l("store.purchase.purchase.title"),description:l("store.purchase.purchase.description")},{action:"verify",title:l("store.purchase.verify.title"),description:l("store.purchase.verify.description")}];return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(r.Z,{className:i.tabPanel,children:x.map((e=>(0,f.jsxs)(a.ZP,{button:!0,selected:n===e.action,onClick:()=>t(e.action),children:[(0,f.jsx)(c.Z,{className:i.iconRoot,children:"purchase"===e.action?(0,f.jsx)(d.Z,{style:{color:"purchase"===n?u.Z.primary.main:"#AAA",fontSize:32}}):(0,f.jsx)(p.Z,{style:{color:"verify"===n?u.Z.primary.main:"#AAA",fontSize:32}})}),(0,f.jsx)(s.Z,{primary:e.title,secondary:e.description})]},e.action)))}),o&&(0,f.jsx)(m.Z,{fullWidth:!0,disabled:!n,variant:"contained",color:"primary",style:{marginTop:16},onClick:o,children:l("common.next")})]})}y.propTypes={action:l().oneOf(["both","purchase","verify"]).isRequired,onSelect:l().func.isRequired,onNext:l().func.isRequired}},51233:(e,n,t)=>{"use strict";t.d(n,{Rw:()=>d,fX:()=>c,sf:()=>p});var o=t(35432),i=t(44543),l=t.n(i),r=t(77277),a=t(32828);const s=(e,n)=>{if(e.type===o.ROUTING_RULE_TYPES.REDIRECT){if(!e.url)return new Error("".concat(n("router.validation.redirectUrlRequired")));if(!e.redirectCode)return new Error("redirect ".concat(n("router.validation.redirectCodeRequired")))}else if(e.type===o.ROUTING_RULE_TYPES.BLOCKLET&&!e.did)return new Error(n("router.validation.didRequired"));return null},c=(e,n)=>{const t=s(e,n);return t||(e.pathPrefix.length?e.pathPrefix.length>150?new Error(n("router.validation.pathPrefixTooLong",{length:150})):null:new Error(n("router.validation.pathPrefixCannotBeEmpty")))},d=e=>{let{params:n,blocklets:t,blocklet:o,locale:i="en"}=e;if(o){let e=(o.children||[]).find((e=>(0,a.default)(e.meta)&&l()(e.mountPoint,n.pathPrefix)));if("gateway"!==o.meta.group&&"/"===n.pathPrefix&&(e="/"),e)return{zh:"\u6302\u8f7d\u70b9 ".concat(n.pathPrefix," \u5df2\u5b58\u5728\uff0c\u8bf7\u4f7f\u7528\u5176\u4ed6\u6302\u8f7d\u70b9"),en:"The mount point ".concat(n.pathPrefix," already exist, please use another mount point")}[i]}const s=t.find((e=>e.meta.did===n.did));if(!s)return"";const c=s.meta.interfaces.find((e=>"web"===e.type));return c&&c.prefix!==r.BLOCKLET_DYNAMIC_PATH_PREFIX&&n.pathPrefix!==c.prefix?{zh:"\u8be5 blocklet \u53ea\u80fd\u6302\u8f7d\u5728 ".concat(c.prefix),en:"This blocklet can only be mounted on ".concat(c.prefix)}[i]:""},p=e=>{if(!e||"string"!==typeof e)return e;let n=e.trim();try{return n=n.toLowerCase(),n.startsWith("http://")||n.startsWith("https://")?new URL(n).hostname:n}catch(t){return console.error("format domain failed",t),n}}},50185:(e,n,t)=>{"use strict";t.d(n,{Z:()=>c});var o=t(5057),i=t(55898),l=t.n(i),r=t(12937),a=t(68420),s=t(96266);function c(e){let{children:n,...t}=e;const{t:i}=(0,o.useContext)(a.RD);return(0,s.jsx)(r.Z,{tip:i("common.copyTip"),copiedTip:i("common.copiedTip"),...t,children:n})}c.propTypes={children:l().any.isRequired}},71363:(e,n,t)=>{"use strict";t.d(n,{Z:()=>m});var o=t(55898),i=t.n(o),l=t(11750),r=t(47020),a=t(93938),s=t(68420),c=t(50185),d=t(70461),p=t(96266);function m(e){let{title:n,description:t,confirmPlaceholder:o,cancel:i,confirm:m,params:u,onCancel:h,onConfirm:f,keyName:x}=e;const{t:g}=(0,s.PE)(),y={title:()=>(0,p.jsxs)("div",{children:[n," (".concat(x,")")]}),description:(e,n)=>(0,p.jsxs)("div",{children:[(0,p.jsx)(a.Z,{severity:"warning",style:{width:"100%"},children:g("common.notice")}),(0,p.jsx)("div",{style:{marginTop:24,marginBottom:24},dangerouslySetInnerHTML:{__html:t}}),(0,p.jsxs)("div",{style:{marginBottom:24},children:[g("common.click"),"\uff1a",(0,p.jsx)(c.Z,{"data-cy":"click-copy",children:x})]}),(0,p.jsx)(l.Z,{component:"div",children:(0,p.jsx)(r.Z,{label:o,autoComplete:"off","data-cy":"delete-confirm-input",variant:"outlined",fullWidth:!0,autoFocus:!0,value:e.inputVal,onChange:t=>{var o;o={...e,inputVal:t.target.value,__disableConfirm:x!==t.target.value},n({...o,__disableConfirm:o.__disableConfirm})}})})]}),confirm:m,cancel:i,onConfirm:f,onCancel:h,params:{inputVal:"",__disableConfirm:!0,...u}};return(0,p.jsx)(d.Z,{title:y.title,description:y.description,confirm:y.confirm,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})}m.propTypes={title:i().any.isRequired,keyName:i().any.isRequired,description:i().any.isRequired,confirmPlaceholder:i().any.isRequired,cancel:i().string,confirm:i().string,params:i().object,onCancel:i().func,onConfirm:i().func.isRequired},m.defaultProps={onCancel:()=>{},cancel:"",confirm:"Confirm",params:{}}},28641:(e,n,t)=>{"use strict";t.d(n,{Z:()=>g});var o=t(5057),i=t(55898),l=t.n(i),r=t(39948),a=t(47020),s=t(44846),c=t(13727),d=t(56184),p=t(67680),m=t(35406),u=t(11875),h=t(95890),f=t(96266);const x=(e,n,t)=>null===e&&n&&t?"******":e?n?"******":e:"";function g(e){let{label:n,disabled:t,required:i,initialValue:l,onChange:g,placeholder:y,style:v,onSubmit:b,secure:j,triggers:k,formatterBeforeSubmit:C,...Z}=e;const[w,R]=(0,o.useState)(!1),[E,S]=(0,o.useState)(!1),[P,T]=(0,o.useState)(j&&"__encrypted__"===l?null:l),[I,U]=(0,o.useState)(P),N=async()=>{S(!0);try{if(!1===await b(I))U(P);else{let e=I;"function"===typeof C&&(e=C(I)),U(e),T(e)}}catch(e){U(P)}finally{S(!1),R(!1)}},D=w?(0,f.jsx)(a.Z,{style:{flex:1},fullWidth:!0,value:I,onChange:e=>{var n;n=e.target.value,U(n),g(n)},autoFocus:!0,size:"small",variant:"outlined",placeholder:y,onKeyDown:e=>{"Enter"===e.key&&N()},disabled:t,type:j?"password":"text",...Z}):(0,f.jsx)(r.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:x(I,j,l)});return(0,f.jsx)(u.Z,{className:"form",style:v,children:(0,f.jsxs)(r.Z,{className:"form-item",children:[(0,f.jsxs)(r.Z,{className:"form-item-label",children:[n,i&&(0,f.jsx)(m.Z,{})]}),(0,f.jsxs)(r.Z,{className:"form-item-body",children:[(0,f.jsx)(r.Z,{className:"form-item-input",children:D}),(0,f.jsx)(r.Z,{className:"form-item-action",children:w?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(p.Z,{"data-cy":"schema-form-item-confirm",onClick:N,disabled:t||E,size:"large",children:E?(0,f.jsx)(s.Z,{size:24}):(0,f.jsx)(d.Z,{})}),(0,f.jsx)(p.Z,{"data-cy":"schema-form-item-cancel",onClick:()=>{U(P),R(!1)},disabled:t||E,size:"large",children:(0,f.jsx)(c.default,{})})]}):(0,f.jsx)(h.Z,{triggers:k,onEnterEdit:()=>R(!0),disabled:t})})]})]})})}g.propTypes={style:l().object,onSubmit:l().func,onChange:l().func,label:l().string,initialValue:l().string,placeholder:l().string,required:l().bool,disabled:l().bool,secure:l().bool,triggers:l().array,formatterBeforeSubmit:l().func},g.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",placeholder:"",required:!1,disabled:!1,secure:!1,triggers:[],formatterBeforeSubmit:null}},11875:(e,n,t)=>{"use strict";t.d(n,{Z:()=>a});var o,i=t(71171),l=t(33518),r=t(39948);const a=(0,l.Z)(r.Z)(o||(o=(0,i.Z)(["\n width: 100%;\n flex-grow: 1;\n overflow-y: auto;\n "," {\n width: 100%;\n flex-shrink: 0;\n padding: 0 24px;\n transform: translate(0, 0);\n /* max-height: 60vh; */\n }\n\n .form-item {\n width: 100%;\n margin-bottom: 24px;\n position: relative;\n "," {\n flex-wrap: wrap;\n justify-content: space-between;\n width: 100%;\n flex-shrink: 0;\n }\n }\n\n .form-item-body {\n display: flex;\n align-items: center;\n width: 100%;\n margin-top: 4px;\n }\n\n .form-item-label {\n line-height: 1.2;\n font-size: 14px;\n color: #888;\n font-weight: bold;\n\n "," {\n text-align: left;\n width: auto;\n flex-grow: 1;\n }\n }\n\n .form-item-input {\n flex-grow: 1;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n &.slot {\n height: 40px;\n line-height: 40px;\n background: #f8f8f8;\n font-size: 16px;\n\n .MuiChip-root {\n margin-top: -4px;\n }\n }\n\n .MuiSelect-select {\n padding: 8px;\n }\n }\n\n .form-item-action {\n // width: 100px;\n text-align: left;\n margin-left: 12px;\n flex-shrink: 0;\n "," {\n width: auto;\n margin-left: 0px;\n }\n .MuiIconButton-root {\n padding: 8px;\n svg {\n fill: #888;\n }\n &.Mui-disabled {\n opacity: 0.4;\n }\n }\n }\n"])),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md")))},95890:(e,n,t)=>{"use strict";t.d(n,{Z:()=>g});var o=t(5057),i=t(55898),l=t.n(i),r=t(24558),a=t(67680),s=t(56556),c=t(80633),d=t(49390),p=t(72113),m=t(25228),u=t(49020),h=t(74490),f=t(1733),x=t(96266);function g(e){let{triggers:n,onEnterEdit:t,disabled:i}=e;const l=o.useRef(null),[g,y]=o.useState(!1);return 0===n.length?(0,x.jsx)(a.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:i,size:"large",children:(0,x.jsx)(r.Z,{})}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(c.Z,{variant:"outlined",ref:l,"aria-label":"split button",children:[(0,x.jsx)(s.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:i,size:"large",children:(0,x.jsx)(r.Z,{})}),(0,x.jsx)(s.Z,{size:"small","aria-controls":g?"split-button-menu":void 0,"aria-expanded":g?"true":void 0,onClick:()=>{y((e=>!e))},children:(0,x.jsx)(d.Z,{})})]}),(0,x.jsx)(u.Z,{sx:{zIndex:9999},open:g,anchorEl:l.current,role:void 0,placement:"bottom-end",children:(0,x.jsx)(m.Z,{children:(0,x.jsx)(p.d,{onClickAway:e=>{l.current&&l.current.contains(e.target)||y(!1)},children:(0,x.jsx)(f.Z,{id:"split-button-menu",autoFocusItem:!0,children:n.map((e=>(0,x.jsx)(h.Z,{onClick:()=>{return n=e.handler,y(!1),void n();var n},children:e.title},e.key)))})})})})]})}g.propTypes={triggers:l().arrayOf(l().shape({key:l().string.isRequired,title:l().string.isRequired,handler:l().func.isRequired})),onEnterEdit:l().func.isRequired,disabled:l().bool.isRequired},g.defaultProps={triggers:[]}},35406:(e,n,t)=>{"use strict";t.d(n,{Z:()=>l});var o,i=t(71171);const l=t(33518).Z.span(o||(o=(0,i.Z)(["\n color: ",";\n &::before {\n content: '*';\n }\n"])),(e=>e.theme.palette.error.main))},8790:(e,n,t)=>{"use strict";t.d(n,{Z:()=>c});var o,i=t(71171),l=t(33518),r=t(55898),a=t.n(r),s=t(96266);function c(e){let{children:n,...t}=e;return(0,s.jsx)(d,{...t,children:n})}c.propTypes={children:a().any.isRequired};const d=l.Z.div(o||(o=(0,i.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n\n .header {\n text-align: center;\n }\n\n .body {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-top: 30px;\n width: 100%;\n min-height: 200px;\n flex: 1;\n\n "," {\n padding: 24px;\n }\n\n "," {\n padding: 0 16px 16px;\n }\n }\n\n .footer {\n display: flex;\n justify-content: center;\n\n "," {\n padding-bottom: 34px;\n }\n\n "," {\n margin-top: auto;\n padding-bottom: 10px;\n }\n }\n"])),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.up("sm")),(e=>e.theme.breakpoints.down("md")))},22714:(e,n,t)=>{"use strict";t.d(n,{Z:()=>j});var o=t(5057),i=t(55898),l=t.n(i),r=t(92877),a=t(44846),s=t(13128),c=t(55372),d=t(11750),p=t(47020),m=t(2478),u=t(44919),h=t(68420),f=t(28726),x=t(88574),g=t(58238),y=t(14491),v=t(96266);const b=(0,r.Z)((e=>({addMenuItemRoot:{justifyContent:"center",color:e.palette.primary.main,lineHeight:"3.2"}})));function j(e){let{disabled:n,storeList:t,teamDid:i,onAdd:l}=e;const{api:r}=(0,g.h6)(),[j,k]=(0,o.useState)(!1),[C,Z]=(0,o.useState)(!0),[w,R]=(0,o.useState)(!1),[E,S]=(0,o.useState)(""),[P,T]=(0,o.useState)(""),{t:I}=(0,h.PE)(),U=b(),N=async()=>{k(!0);try{const{isNew:e,decoded:n}=(0,y.bQ)(E,t);if(!e)throw new Error(I("store.blockletRegistry.haveSameRegistry"));await r.addBlockletStore({input:{teamDid:i,url:n}}),l(n),R(!1)}catch(e){const n="".concat(I("store.blockletRegistry.addFailed")," ").concat((0,y.Z)(e));T(n)}finally{k(!1)}};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(m.ZP,{button:!0,disabled:n,className:U.addMenuItemRoot,onClick:()=>{R(!0)},children:[(0,v.jsx)(u.Z,{font:!0}),(0,v.jsx)(d.Z,{variant:"inherit",children:I("store.blockletRegistry.addRegistry")})]}),(0,v.jsxs)(s.ZP,{title:I("store.blockletRegistry.addRegistry"),fullWidth:!0,maxWidth:"md",open:w,onClose:()=>R(!1),PaperProps:{style:{minHeight:"auto"}},actions:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(f.Z,{onClick:e=>{e.stopPropagation(),R(!1)},color:"inherit",children:I("common.cancel")}),(0,v.jsxs)(f.Z,{onClick:e=>{e.stopPropagation(),N()},color:"primary","data-cy":"install-blocklet-next-step",disabled:j||!E||C,variant:"contained",autoFocus:!0,children:[j&&(0,v.jsx)(a.Z,{size:16}),I("common.confirm")]})]}),children:[(0,v.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,v.jsx)(c.Z,{component:"div",children:(0,v.jsx)(d.Z,{component:"div",children:(0,v.jsx)(p.Z,{label:I("store.blockletRegistry.registryUrl"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:E,onChange:e=>{T(null);let n=!1;e.target.value.trim()||(n=!0),e.target.value.trim()||T(I("store.blockletRegistry.registryUrlEmpty")),S(e.target.value),Z(n)},disabled:j,onKeyPress:e=>{"Enter"===e.key&&(e.preventDefault(),e.target.value.trim()?N():T(I("store.blockletRegistry.registryUrlEmpty")))}})})})}),!!P&&(0,v.jsx)(x.Z,{type:"error",style:{width:"100%"},children:P})]})]})}j.propTypes={teamDid:l().string.isRequired,disabled:l().bool,storeList:l().array,onAdd:l().func},j.defaultProps={disabled:!1,storeList:[],onAdd:()=>{}}},45170:(e,n,t)=>{"use strict";t.d(n,{Z:()=>j});var o=t(92877),i=t(11750),l=t(83580),r=t(94552),a=t(67680),s=t(55898),c=t.n(s),d=t(5057),p=t(96366),m=t(68420),u=t(47595),h=t(86229),f=t(58238),x=t(71363),g=t(14491),y=t(96266);function v(e){let{store:n,teamDid:t,onDelete:o}=e;const{api:i}=(0,f.h6)(),{t:l}=(0,m.PE)(),[r,s]=(0,d.useState)(!1),[c,v]=(0,d.useState)(null),b=(0,p.Z)(),j={keyName:n.url,title:l("store.blockletRegistry.deleteRegistry"),description:l("store.blockletRegistry.deleteDesc",{name:"<b>".concat(n.url,"</b>"),color:b.palette.error.main}),confirmPlaceholder:l("store.blockletRegistry.confirmDesc",{name:n.url}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:async()=>{try{s(!0),await i.deleteBlockletStore({input:{teamDid:t,url:n.url}}),o&&"function"===typeof o&&o()}catch(e){h.Z.error("Remove Blocklet Store Error: ".concat((0,g.Z)(e)))}finally{s(!1),v(null)}},onCancel:()=>{s(!1),v(null)}};return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(a.Z,{disabled:r,onClick:e=>{e.stopPropagation(),v(j)},size:"large",children:(0,y.jsx)(u.default,{})}),c&&(0,y.jsx)(x.Z,{keyName:c.keyName,title:c.title,description:c.description,confirmPlaceholder:c.confirmPlaceholder,confirm:c.confirm,cancel:c.cancel,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel})]})}v.propTypes={teamDid:c().string.isRequired,store:c().object.isRequired,onDelete:c().func},v.defaultProps={onDelete:()=>{}};const b=(0,o.Z)((()=>({buttonText:{textTransform:"none !important"},iconRoot:{minWidth:24},menuName:{display:"flex",flexDirection:"column",marginRight:"100px","& span":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})));function j(e){let{teamDid:n,store:t,onDelete:o}=e;const s=b();return(0,y.jsxs)("div",{className:s.menuName,children:[(0,y.jsx)(i.Z,{component:"span",variant:"subtitle1",style:{fontWeight:"400"},children:t.name}),(0,y.jsx)(i.Z,{className:"url",component:"span",variant:"inherit",children:"".concat(t.url)}),(0,y.jsxs)(l.Z,{children:[(0,y.jsx)(a.Z,{onClick:e=>{e.stopPropagation(),window.open(t.url)},size:"large",children:(0,y.jsx)(r.Z,{})}),!t.protected&&(0,y.jsx)(v,{store:t,onDelete:o,teamDid:n})]})]})}j.propTypes={teamDid:c().string.isRequired,store:c().shape({name:c().string.isRequired,url:c().string.isRequired,protected:c().bool}).isRequired,onDelete:c().func},j.defaultProps={onDelete:()=>{}}},35918:(e,n,t)=>{"use strict";t.d(n,{Z:()=>y});var o=t(44919),i=t(42876),l=t(27773),r=t(11997),a=t(93734),s=t(76667),c=t(39293),d=t(36903),p=t(3422),m=t(92273),u=t(72906),h=t(57201),f=t(49390),x=t(33225),g=t(30770);const y={Add:o.Z,Check:i.default,Delete:l.default,Edit:s.default,Clear:r.default,DetailPanel:m.default,Filter:c.Z,FirstPage:d.default,LastPage:p.default,NextPage:m.default,PreviousPage:u.default,Search:h.default,ResetSearch:r.default,SortArrow:f.Z,Export:a.default,ThirdStateCheck:x.default,ViewColumn:g.default}},74782:(e,n,t)=>{"use strict";t.d(n,{Z:()=>l});var o,i=t(71171);const l=t(33518).Z.div(o||(o=(0,i.Z)(["\n .MuiPaper-root {\n box-shadow: none !important;\n border: none !important;\n border-radius: 0 !important;\n background: transparent;\n }\n .MuiToolbar-root {\n background: transparent;\n padding-left: 0;\n display: none;\n }\n\n &.show-pagination {\n .MuiTablePagination-toolbar {\n display: flex;\n }\n }\n\n .MuiTableHead-root th {\n min-width: 100px;\n background: transparent;\n }\n\n .MuiTable-root {\n overflow-y: hidden;\n }\n .MuiTableRow-root {\n border: none !important;\n }\n\n .MuiTableCell-root {\n padding-right: 16px;\n &:last-of-type {\n padding-right: 0;\n }\n }\n\n /* @material-table/core@next \u517c\u5bb9 mui v5, \u4f46 pagination \u6837\u5f0f\u4f3c\u4e4e\u6709\u4e9b\u95ee\u9898, \u6682\u5730\u5b9a\u5236\u4e0b\u9762\u7684\u6837\u5f0f\u4fee\u590d, \u540e\u9762\u8003\u8651\u5f03\u7528 material-table */\n .MuiTablePagination-selectLabel,\n .MuiTablePagination-displayedRows {\n display: none;\n }\n .MuiTypography-caption {\n display: inline-block;\n }\n .MuiTablePagination-selectLabel + .MuiInputBase-root {\n margin-right: 8px;\n }\n"])))},5952:(e,n,t)=>{"use strict";t.d(n,{K_:()=>o,WC:()=>i});const o="blocklet-add-component-registry",i="server-add-registry"},40736:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),l=t(96266);n.Z=(0,i.default)((0,l.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward")},56184:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),l=t(96266);n.Z=(0,i.default)((0,l.jsx)("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done")},34966:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),l=t(96266);n.Z=(0,i.default)((0,l.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined")},33271:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),l=t(96266);n.Z=(0,i.default)((0,l.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")},48037:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),l=t(96266);n.Z=(0,i.default)((0,l.jsx)("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.09-.16-.26-.25-.44-.25-.06 0-.12.01-.17.03l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.06-.02-.12-.03-.18-.03-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.09.16.26.25.44.25.06 0 .12-.01.17-.03l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"SettingsOutlined")},99194:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),l=t(96266);n.Z=(0,i.default)((0,l.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"}),"Update")},52277:(e,n)=>{var t;!function(){"use strict";var o={}.hasOwnProperty;function i(){for(var e=[],n=0;n<arguments.length;n++){var t=arguments[n];if(t){var l=typeof t;if("string"===l||"number"===l)e.push(t);else if(Array.isArray(t)){if(t.length){var r=i.apply(null,t);r&&e.push(r)}}else if("object"===l){if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]")){e.push(t.toString());continue}for(var a in t)o.call(t,a)&&t[a]&&e.push(a)}}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(t=function(){return i}.apply(n,[]))||(e.exports=t)}()},2078:(e,n,t)=>{var o=t(26849);e.exports=function(e){return o(e).toUpperCase()}},30278:(e,n,t)=>{var o=t(31104),i=t(43676);e.exports=function(e,n){return e&&e.length?i(e,o(n,2)):[]}}}]);