@abtnode/webapp 1.16.23 → 1.16.24-beta-6975c2c0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/build/asset-manifest.json +15 -13
- package/build/index.html +1 -1
- package/build/service-worker.js +1 -1
- package/build/static/js/2079.31496984.chunk.js +1 -0
- package/build/static/js/2842.80969a8e.chunk.js +1 -0
- package/build/static/js/{318.4a7b69c2.chunk.js → 318.76c424b5.chunk.js} +1 -1
- package/build/static/js/3389.57a8a3d4.chunk.js +1 -0
- package/build/static/js/3674.3d65b55c.chunk.js +2 -0
- package/build/static/js/{5526.49b50c85.chunk.js → 5526.0ba2a9b5.chunk.js} +2 -2
- package/build/static/js/{5526.49b50c85.chunk.js.LICENSE.txt → 5526.0ba2a9b5.chunk.js.LICENSE.txt} +1 -1
- package/build/static/js/6230.0ae40a58.chunk.js +1 -0
- package/build/static/js/6406.dab41af2.chunk.js +1 -0
- package/build/static/js/6511.9dbc41c0.chunk.js +1 -0
- package/build/static/js/7109.6cfb3ae7.chunk.js +1 -0
- package/build/static/js/{3910.b00c998d.chunk.js → 8174.19131f98.chunk.js} +2 -2
- package/build/static/js/9132.cb895073.chunk.js +1 -0
- package/build/static/js/main.a97118dd.js +2 -0
- package/package.json +1 -1
- package/build/static/js/2201.071b5207.chunk.js +0 -1
- package/build/static/js/3389.36682ebb.chunk.js +0 -1
- package/build/static/js/4804.7049a883.chunk.js +0 -2
- package/build/static/js/6230.9dd9dcab.chunk.js +0 -1
- package/build/static/js/6511.0db15ff3.chunk.js +0 -1
- package/build/static/js/7288.d65f1021.chunk.js +0 -1
- package/build/static/js/7880.0efe986f.chunk.js +0 -1
- package/build/static/js/main.54b2704e.js +0 -2
- /package/build/static/css/{4804.a5e3e6d6.chunk.css → 3674.a5e3e6d6.chunk.css} +0 -0
- /package/build/static/js/{4804.7049a883.chunk.js.LICENSE.txt → 3674.3d65b55c.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{3910.b00c998d.chunk.js.LICENSE.txt → 8174.19131f98.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{main.54b2704e.js.LICENSE.txt → main.a97118dd.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6230],{80378:(e,n,t)=>{t.d(n,{Z:()=>u});var i=t(55898),o=t.n(i),a=t(56869),l=t(72333),r=t(6352),s=t.n(r),c=t(35432),d=t(58238),m=t(14491);var p=t(96266);function u(e){let{blocklet:n,style:t,size:i,ancestors:o,...r}=e;const u=(0,d.h6)(),{logoUrl:h,inService:f}=function(e){var n;let{blocklet:t,ancestors:i=[]}=e;const o=(0,d.h6)(),{inService:a}=o,l="?v=".concat(null===t||void 0===t||null===(n=t.meta)||void 0===n?void 0:n.version).concat((0,m.XN)(null===t||void 0===t?void 0:t.status)?"~":"");let r=a?s()(m.zn,c.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",l):s()(o.imgPrefix,"blocklet.png");if("registry"===t.source&&t.deployedFrom&&t.meta.logo)r=s()(t.deployedFrom,(0,m.lk)(t.meta.bundleDid,t.meta.logo),l);else{const e=window.env.apiPrefix||"/",n=i.concat(t),o=a?n.slice(1):n;r=s()(e,"/blocklet/logo-bundle".concat(o.map((e=>"/".concat(e.meta.did))).join("")),l)}return{logoUrl:r,inService:a}}({blocklet:n,ancestors:o}),{variant:g}=r,x=f?()=>{}:e=>{e.target.src="".concat(u.imgPrefix,"/blocklet.png")};let b=(0,p.jsx)("img",{src:h,onError:x,alt:n.meta.name,style:{width:i}});return n.meta.logo||(b=(0,p.jsx)(l.Z,{did:n.meta.did||"",responsive:!0})),(0,p.jsx)(a.Z,{variant:g||"square",style:Object.assign({backgroundColor:"transparent",width:i,height:i,borderRadius:10},t),...r,children:b})}u.propTypes={blocklet:o().object.isRequired,style:o().object,size:o().oneOfType([o().number,o().string]),ancestors:o().array},u.defaultProps={style:{},size:40,ancestors:[]}},74286:(e,n,t)=>{t.d(n,{Z:()=>r});var i=t(55898),o=t.n(i),a=t(87543),l=t(96266);function r(e){let{depth:n,className:t}=e;return(0,l.jsx)(a.Z,{ml:Math.max(2*(n-1),0),className:t,sx:{borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}r.propTypes={depth:o().number,className:o().string},r.defaultProps={depth:1,className:""}},44784:(e,n,t)=>{t.d(n,{Z:()=>d});var i,o=t(71171),a=t(33518),l=t(44736),r=t(96266);function s(e){let{labelProps:n,className:t,style:i,...o}=e;const a={...n,labelPlacement:(null===n||void 0===n?void 0:n.labelPlacement)||"start"};return(0,r.jsx)(c,{className:t,style:i,children:(0,r.jsx)(l.Z,{labelProps:a,...o})})}s.propTypes=l.Z.propTypes,s.defaultProps=l.Z.defaultProps;const c=a.Z.div(i||(i=(0,o.Z)(["\n max-width: 300px;\n > label {\n display: flex;\n justify-content: space-between;\n width: 100%;\n margin-left: 0;\n margin-right: 0;\n }\n "," {\n max-width: 100%;\n }\n"])),(e=>{let{theme:n}=e;return n.breakpoints.down("sm")})),d=s},59375:(e,n,t)=>{t.d(n,{Z:()=>Z});var i,o=t(71171),a=t(5057),l=t(55898),r=t.n(l),s=t(6352),c=t.n(s),d=t(33518),m=t(92706),p=t.n(m),u=t(87543),h=t(52277),f=t.n(h),g=t(68420),x=t(96266);const b=(0,a.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 Z(e){let{url:n,height:t,width:i,enabled:o,type:l,did:r,prefix:s,headers:d,onUploaded:m}=e;const{t:p}=(0,g.PE)(),h=(0,a.useRef)(null),Z={cursor:o?"pointer":"default","&::after":{content:'"'.concat(p("common.switch"),'"')}};return(0,x.jsxs)(j,{id:"uploader-".concat(r,"-").concat(l),children:[(0,x.jsx)(b,{ref:h,popup:!0,onUploadFinish:()=>{var e;m(),null===(e=h.current)||void 0===e||e.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:c()(s,v,l,r),disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*",".jpg",".jpeg",".png",".gif",".svg"],maxFileSize:10485760,maxNumberOfFiles:1}},tusProps:{headers:d}}),(0,x.jsx)(u.Z,{className:f()("uploader-wrapper",o&&"enabled"),sx:Z,onClick:()=>{var e;null===(e=h.current)||void 0===e||e.open()},children:(0,x.jsx)("img",{alt:"Logo",src:n,style:{height:t,width:i}})})]},"uploader-".concat(r,"-").concat(l))}Z.propTypes={url:r().string.isRequired,type:r().oneOf(["square","rect","favicon"]).isRequired,did:r().string.isRequired,prefix:r().string.isRequired,headers:r().func,onUploaded:r().func,height:r().number,width:r().any,enabled:r().bool},Z.defaultProps={height:80,width:"auto",enabled:!0,headers:()=>({}),onUploaded:p()};const j=d.Z.div(i||(i=(0,o.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"])))},64558:(e,n,t)=>{t.r(n),t.d(n,{default:()=>mt});var i,o=t(71171),a=t(5057),l=t(33518),r=t(55898),s=t.n(r),c=t(96181),d=t(6352),m=t.n(d),p=t(35432),u=t(87543),h=t(6296),f=t(89969),g=t(37570),x=t(86205),b=t(47998),v=t(38312),Z=t(73529),j=t(5534),y=t(15849),C=t(68420),k=t(94464),w=t(38242),S=t(80378),E=t(1722),L=t(43681),P=t.n(L),R=t(50482),A=t.n(R),T=t(41843),_=t(56195),N=t(28726),O=t(89439),I=t(77277),F=t(86229),B=t(28641),z=t(69544),U=t(46568),D=t(28763),K=t(53066),W=t(54047),q=t(9222),G=t(91330),V=t(42915),H=t(72739),M=t(90820),Y=t(35406),J=t(11875),Q=t(95890),X=t(96266);function $(e){let{label:n,disabled:t,required:i,initialValue:o,onChange:l,style:r,onSubmit:s,triggers:c,options:d,formatterBeforeSubmit:m,helperText:p,placeholder:h,renderImage:f,renderLabel:g,filterKeys:x,noEmpty:b,...v}=e;const[Z,j]=(0,a.useState)(!1),[y,C]=(0,a.useState)(!1),[k,w]=a.useState(""),[S,E]=(0,a.useState)(o),[L,P]=(0,a.useState)(S),R=(0,a.useMemo)((()=>{if(!d)return{};const e={};return d.forEach((n=>{e[n.code]=n})),e}),[d]),A=Z?(0,X.jsx)(G.Z,{options:d,value:L,onChange:(e,n)=>{if(!Array.isArray(n))return P([]),void l([]);const t=n.filter((e=>R[e]));if(!t.length)return P([]),void l([]);P(t),l(t)},inputValue:k,onInputChange:(e,n)=>{w(n)},PopperComponent:ne,fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:()=>{if(!d)return[];if(!k)return d.map((e=>e.code));const e=new RegExp(k.toLowerCase());return d.filter((n=>{for(let i=0;i<x.length;i++){var t;const o=x[i];if(e.test(null===(t=n[o])||void 0===t?void 0:t.toLowerCase()))return!0}return!1})).map((e=>e.code))},getOptionLabel:e=>{var n;return null===(n=R[e])||void 0===n?void 0:n.name},renderInput:e=>(0,X.jsx)(H.Z,{...e,label:"",placeholder:h}),renderOption:(e,n)=>{var t;const i=-1!==L.indexOf(n);return(0,a.createElement)(ee,{component:"li",...e,key:n},f(R[n]||{}),(0,X.jsx)(u.Z,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:i?"700":"normal"},children:g(n,R[n])||(null===(t=R[n])||void 0===t?void 0:t.name)}),(0,X.jsx)(u.Z,{component:U.Z,sx:{opacity:.5,width:18,height:18},style:{visibility:i?"visible":"hidden"}}))},...v}):(0,X.jsx)(u.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:L.filter((e=>d.some((n=>n.code===e)))).map((e=>(0,X.jsx)(W.Z,{label:d.find((n=>n.code===e)).name,style:{marginRight:8},size:"small"},e)))});return(0,X.jsx)(J.Z,{className:"form",style:r,children:(0,X.jsxs)(u.Z,{className:"form-item",children:[(0,X.jsxs)(u.Z,{className:"form-item-label",children:[n,i&&(0,X.jsx)(Y.Z,{})]}),(0,X.jsxs)(u.Z,{className:"form-item-body",children:[(0,X.jsx)(u.Z,{className:"form-item-input",children:A}),(0,X.jsx)(u.Z,{className:"form-item-action",children:Z?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(K.Z,{"data-cy":"schema-form-item-confirm",onClick:async()=>{C(!0);try{!1===await s("function"===typeof m?m(L):L)?P(S):b&&!L.length?(P(o),E(o)):(P(L),E(L))}catch(e){P(S)}finally{C(!1),j(!1)}},disabled:t||y,size:"large",children:y?(0,X.jsx)(z.Z,{size:24}):(0,X.jsx)(D.Z,{})}),(0,X.jsx)(K.Z,{"data-cy":"schema-form-item-cancel",onClick:()=>{P(S),j(!1)},disabled:t||y,size:"large",children:(0,X.jsx)(U.Z,{})})]}):(0,X.jsx)(Q.Z,{triggers:c,onEnterEdit:()=>j(!0),disabled:t})})]}),Z&&p&&(0,X.jsx)(q.Z,{children:p})]})})}$.propTypes={style:s().object,onSubmit:s().func,onChange:s().func,label:s().string,initialValue:s().string,required:s().bool,disabled:s().bool,triggers:s().array,options:s().array,helperText:s().string,formatterBeforeSubmit:s().func,placeholder:s().string,renderImage:s().func,filterKeys:s().arrayOf(s().string),noEmpty:s().bool,renderLabel:s().func},$.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],helperText:"",formatterBeforeSubmit:e=>e.join(","),placeholder:"",filterKeys:["name"],renderImage:()=>null,renderLabel:(e,n)=>"",noEmpty:!1};const ee=l.Z.div(i||(i=(0,o.Z)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 48px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\n font-size: 1.1em;\n"]))),ne=(0,l.Z)(M.Z)((()=>({["& .".concat(V.Z.paper)]:{boxShadow:"0px 8px 12px rgba(92, 92, 92, 0.04), 0px -10px 12px rgba(92, 92, 92, 0.04)",borderRadius:"6px",width:"100%",border:"1px solid rgba(0, 0, 0, 0.12)",color:"inherit",fontSize:13,position:"absolute",left:0,top:0},["& .".concat(V.Z.listbox)]:{padding:0}})));var te,ie=t(58238),oe=t(14491),ae=t(54063),le=t(63406),re=t(78410),se=t(31853),ce=t(27212),de=t(70461),me=t(73545),pe=t(29054);function ue(e){let{initialValue:n,onChange:t,disabled:i,loading:o}=e;const{t:a}=(0,C.PE)(),{api:l}=(0,me.T)(),{blocklet:r}=(0,pe.y0)(),[s,c]=(0,se.Z)({newAppSk:"",isConnectOpen:!1}),d=()=>c({isConnectOpen:!1}),m=r.structVersion===p.APP_STRUCT_VERSION?[{key:"rotate-with-did-wallet",title:"Migrate with DID Wallet",handler:()=>{(0,oe.An)(r.status)?F.Z.error(a("blocklet.error.isRunning")):(0,w.isInProgress)(r.status)?F.Z.error(a("blocklet.error.isInProgress")):c({isConnectOpen:!0})}}]:[];return[(0,X.jsx)(B.Z,{disabled:i,loading:o,initialValue:n,onSubmit:e=>(c({newAppSk:e}),!1),triggers:m,secure:!0}),s.newAppSk&&(0,X.jsx)(de.Z,{title:a("blocklet.config.appSkTitle"),description:(0,X.jsxs)(u.Z,{children:[(0,X.jsx)(u.Z,{children:a("blocklet.config.appSkChangeTip")}),(0,X.jsx)(u.Z,{fontWeight:"bold",mt:2,children:a("blocklet.config.appDidChangeTip")}),(0,X.jsxs)(he,{children:[(0,X.jsx)("li",{children:a("blocklet.config.appDidChangeTipL1")}),(0,X.jsx)("li",{children:a("blocklet.config.appDidChangeTipL2")})]})]}),confirm:a("confirm"),cancel:a("cancel"),onConfirm:()=>(async e=>{try{await t(e)}finally{c({newAppSk:""})}})(s.newAppSk),onCancel:()=>c({newAppSk:""})}),(0,X.jsx)(ce.Z,{popup:!0,open:s.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:l.get,checkTimeout:3e5,onSuccess:d,extraParams:{appDid:r.appDid},messages:{title:a("setup.keyPair.title"),scan:a("setup.keyPair.scan"),confirm:a("setup.keyPair.confirm"),success:a("setup.keyPair.success")},onClose:d})]}ue.propTypes={initialValue:s().string,onChange:s().func,disabled:s().bool,loading:s().bool},ue.defaultProps={initialValue:"default",onChange:()=>{},disabled:!1,loading:!1};const he=(0,l.Z)("ul")(te||(te=(0,o.Z)(["\n padding-left: 16px;\n li {\n margin-top: 8px;\n list-style: disk;\n font-weight: bold;\n }\n"])));var fe,ge=t(13128),xe=t(81289),be=t(60967),ve=t(88574),Ze=t(54272),je=t(44024),ye=t(50185),Ce=t(17425);function ke(e){let{onCancel:n,onSuccess:t,onError:i}=e;const{api:o}=(0,a.useContext)(me.B),[l,r]=(0,a.useState)(!1),{t:s,locale:c}=(0,C.PE)(),[d,m]=(0,a.useState)(""),[p,h]=(0,a.useState)(!1),[f,g]=(0,a.useState)(0),[x,b]=(0,a.useState)(""),{endpoint:v}=(0,Ce.DJ)(),[Z,j]=(0,a.useState)(!1),y=e=>{m(null),r(!0);try{b(e.result),g(w.length-1)}catch(n){const e=(0,oe.Z)(n);m(e),i(n)}finally{r(!1)}},k=()=>{h(!1),g(0)},w=[{body:(0,X.jsxs)(u.Z,{children:[(0,X.jsx)(be.Z,{children:s("team.transferApp.transferDialog.tips.progress")}),(0,X.jsx)(be.Z,{mt:3,mb:2,children:s("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:s("common.cancel"),confirm:s("team.transferApp.transferDialog.createTransferLink"),onCancel:n,onConfirm:()=>{h(!0),g(1)}},{body:()=>(0,X.jsx)(ce.Z,{action:"transfer-app-owner",open:p,locale:c,checkFn:o.get,onClose:k,onSuccess:y,checkTimeout:3e5,extraParams:{},messages:{title:s("team.transferApp.connectDialog.title"),scan:s("team.transferApp.connectDialog.scan"),confirm:s("team.transferApp.connectDialog.confirm"),success:s("team.transferApp.connectDialog.success")},popup:!0})},{body:()=>{const e=(0,oe.VP)({transferId:x.transferId,endpoint:v});return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(u.Z,{component:we,dangerouslySetInnerHTML:{__html:s("team.transferApp.transferDialog.createSuccessTip1")}}),(0,X.jsx)(u.Z,{component:we,mt:2,children:(0,X.jsx)(we,{children:s("team.transferApp.transferDialog.createSuccessTip3")})}),(0,X.jsxs)(u.Z,{children:[(0,X.jsx)(u.Z,{component:we,mt:2,children:(0,X.jsx)(we,{children:s("team.transferApp.transferDialog.createSuccessTip2",{expireDate:(0,oe.B2)(x.expireDate,c)})})}),(0,X.jsx)(u.Z,{my:1,children:(0,X.jsx)(ye.Z,{children:e})})]}),(0,X.jsx)("div",{children:(0,X.jsx)(Ze.Z,{value:"end",control:(0,X.jsx)(je.Z,{checked:Z,onChange:e=>j(e.target.checked)}),label:s("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:s("common.confirm"),onConfirm:t}],S=w[f];return(0,X.jsxs)(ge.ZP,{title:(0,X.jsx)(we,{className:"title",children:s("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:(0,X.jsxs)(X.Fragment,{children:[S.cancel&&(0,X.jsx)(N.Z,{onClick:S.onCancel,color:"inherit",children:S.cancel}),(0,X.jsxs)(N.Z,{onClick:S.onConfirm,color:"error",disabled:l||f===w.length-1&&!Z,variant:"contained",autoFocus:!0,children:[l&&(0,X.jsx)(z.Z,{size:16}),S.confirm]})]}),children:[(0,X.jsx)(xe.Z,{component:"div",children:"function"===typeof S.body?S.body():S.body}),!!d&&(0,X.jsx)(ve.Z,{type:"error",variant:"icon",children:d})]})}ke.propTypes={onCancel:s().func.isRequired,onSuccess:s().func.isRequired,onError:s().func},ke.defaultProps={onError:()=>{}};const we=l.Z.div(fe||(fe=(0,o.Z)(["\n font-size: 16px;\n font-weight: bold;\n &.title {\n font-size: 20px;\n }\n"])));var Se,Ee=t(49522),Le=t(59375);const Pe=Object.keys(I.SUPPORTED_LANGUAGES).map((e=>({code:e,name:I.SUPPORTED_LANGUAGES[e].nativeName,enName:I.SUPPORTED_LANGUAGES[e].name}))),Re=["name","enName","code"];function Ae(e){var n;let{blocklet:t,onUpdate:i,hasPermission:o,...l}=e;const{api:r,inService:s,prefix:c,getSessionInHeader:d,ws:{useSubscription:m}}=(0,ie.h6)(),{t:h}=(0,a.useContext)(C.RD),[f,g]=(0,a.useState)(""),[x,b]=(0,a.useState)(""),[v,Z]=(0,a.useState)(!1),j=(0,w.getWhoCanAccess)(t),y=null===t||void 0===t||null===(n=t.settings)||void 0===n?void 0:n.publicToStore,k=x||!o,{logoUrl:S,rectLogoUrl:E,faviconUrl:L}=(0,Ee.Z)({blocklet:t}),{did:R}=t.meta,{site:z}=t,U=P()(t.meta,"capabilities.clusterMode",!1);if(m(p.EVENTS.NODE_RUNTIME_INFO,(e=>{U&&g(P()(e,"cpu.physicalCores",""))})),(0,oe.wS)(t.status))return null;const D=t.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE)),K=!D||"yes"===D.value,W=t.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LANGUAGES)),q=t.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL)),G=t.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER)),V=t.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR)),H=[{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,description:h("blocklet.config.name"),value:t.environments.find((e=>"BLOCKLET_APP_NAME"===e.key)).value},{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,description:h("blocklet.config.description"),value:t.environments.find((e=>"BLOCKLET_APP_DESCRIPTION"===e.key)).value},{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL,description:h("blocklet.config.appUrl"),value:q?q.value:""},{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER,description:h("blocklet.config.copyrightOwner"),value:G?G.value:""},{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR,description:h("blocklet.config.copyrightYear"),value:V?V.value:""}];if(U){const e=t.configs.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE)),n=e?e.value:f;H.push({key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE,description:h("blocklet.config.clusterSize"),value:n,cpuCores:f})}const M=async(e,n)=>{if(e===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const e=(0,oe.I)({value:n,cpuCores:f});if(e)return void F.Z.error(e)}const o=[{key:e,value:n}];try{b(!0);const{blocklet:e}=await r.configBlocklet({input:{did:t.meta.did,configs:o}});i(e)}catch(a){F.Z.error(a.message)}finally{b(!1)}};return(0,X.jsxs)(Oe,{...l,children:[H.map((e=>(0,X.jsxs)(u.Z,{className:"config-form",mt:2,children:[(0,X.jsx)(u.Z,{className:"config-label",fontSize:14,mb:0,children:e.description}),(0,X.jsx)(B.Z,{style:{marginTop:0},disabled:x||k,loading:x,initialValue:e.value,onSubmit:n=>M(e.key,n)})]}))),(0,X.jsx)(u.Z,{className:"config-form",component:_.Z,my:3}),(0,X.jsx)(u.Z,{className:"config-label",fontSize:14,mb:1,sx:{flexGrow:0,width:"auto"},children:h("blocklet.config.logoSquare")}),(0,X.jsx)(Le.Z,{did:t.meta.did,height:80,width:80,type:"square",prefix:c,url:S,enabled:o,headers:d}),(0,X.jsx)(u.Z,{className:"config-label",fontSize:14,mt:4,children:h("blocklet.config.logoRect")}),(0,X.jsx)(u.Z,{mb:1.5,className:"config-desc",children:h("blocklet.config.logoRectDesc")}),(0,X.jsx)(Le.Z,{did:t.meta.did,height:80,type:"rect",prefix:c,url:E,enabled:o,headers:d}),(0,X.jsx)(u.Z,{className:"config-label",fontSize:14,mt:4,children:h("blocklet.config.logoFavicon")}),(0,X.jsx)(u.Z,{mb:1.5,className:"config-desc",children:h("blocklet.config.logoFaviconDesc")}),(0,X.jsx)(Le.Z,{did:t.meta.did,height:25,width:25,type:"favicon",prefix:c,url:L,enabled:o,headers:d}),(0,X.jsx)(u.Z,{className:"config-form",children:"all"===j&&"registry"===t.source&&(0,X.jsxs)(u.Z,{className:"config-item",children:[(0,X.jsxs)(u.Z,{className:"config-label",children:[h("blocklet.config.access.publicToStore"),(0,X.jsx)(u.Z,{className:"config-desc",children:h("blocklet.config.access.publicInstanceTip")})]}),(0,X.jsx)(T.Z,{disabled:k,checked:y,defaultChecked:!0,onChange:async e=>{if(!x){b(!0);try{const{checked:n}=e.target,{blocklet:o}=await r.configPublicToStore({input:{did:t.meta.did,publicToStore:n}});i(o)}catch(n){F.Z.error(n.message)}finally{b(!1)}}}})]})}),(0,X.jsx)(u.Z,{className:"config-form",component:_.Z,my:3}),(0,X.jsxs)(u.Z,{className:"config-form",mt:2,children:[(0,X.jsx)(u.Z,{className:"config-label",fontSize:14,mb:0,children:h("blocklet.config.languages")}),(0,X.jsx)($,{style:{marginTop:0},disabled:x||k,loading:x,options:Pe,noEmpty:!0,initialValue:W?W.value.split(","):["en","zh"],onSubmit:e=>M("BLOCKLET_APP_LANGUAGES",e),helperText:h("blocklet.config.selectLanguagesTip"),placeholder:h("blocklet.config.languagesSearch"),filterKeys:Re,renderLabel:(e,n)=>n.name===n.enName?"".concat(n.name," (").concat(e.toUpperCase(),")"):"".concat(n.name,", ").concat(n.enName," (").concat(e.toUpperCase(),")")})]}),(0,X.jsx)(u.Z,{className:"config-form",component:_.Z,my:3}),(0,X.jsx)(u.Z,{className:"config-form",mt:2,children:(0,X.jsx)(u.Z,{className:"config-label",mb:0,children:h("common.security")})}),(0,X.jsxs)(u.Z,{className:"config-form",mt:2,children:[(0,X.jsx)(u.Z,{className:"config-label",fontSize:14,mb:0,children:h("router.domainSecurity.cors.title")}),(0,X.jsx)(u.Z,{mb:1.5,className:"config-desc",children:h("router.domainSecurity.cors.description",{name:"the blocklet"})}),(0,X.jsx)(B.Z,{style:{marginTop:0},disabled:x||k,loading:x,initialValue:(z.corsAllowedOrigins||[]).join(", "),onSubmit:async e=>{const n=z.corsAllowedOrigins||[],i=e.split(",").map((e=>e.trim())).filter(Boolean);if(A()(n,i))return!1;try{b(!0);const e=i.length?i:["__none__"];await r.updateRoutingSite({input:{id:z.id,corsAllowedOrigins:e,teamDid:t.meta.did}}),b(!1)}catch(o){return F.Z.error(o.message),b(!1),!1}return!0}})]}),(0,X.jsx)(u.Z,{className:"config-form",component:_.Z,my:3}),(0,X.jsx)(u.Z,{mb:2,className:"config-label",fontSize:20,children:h("blocklet.config.dangerZone")}),(0,X.jsxs)(u.Z,{px:2,py:1,sx:{border:"1px solid red",borderRadius:2},children:[(0,X.jsx)(u.Z,{className:"config-form",mt:2,children:!s&&(0,X.jsxs)(u.Z,{className:"config-item",children:[(0,X.jsxs)(u.Z,{className:"config-label",children:[h("blocklet.config.deletable.name"),(0,X.jsx)(u.Z,{className:"config-desc",children:h(K?"blocklet.config.deletable.disable":"blocklet.config.deletable.enable")})]}),(0,X.jsx)(T.Z,{disabled:k,checked:!K,defaultChecked:!0,onChange:async e=>{if(!x){b(!0);try{const{checked:n}=e.target,{blocklet:o}=await r.configBlocklet({input:{did:t.meta.did,configs:[{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE,value:n?"no":"yes"}]}});i(o)}catch(n){F.Z.error(n.message)}finally{b(!1)}}}})]})}),(0,X.jsxs)(u.Z,{className:"config-form",mt:2,children:[(0,X.jsx)(u.Z,{className:"config-label",fontSize:14,mb:0,children:h("blocklet.config.sk")}),(0,X.jsx)(ue,{disabled:x||k,loading:x,initialValue:t.environments.find((e=>"BLOCKLET_APP_SK"===e.key)).value,onChange:async e=>{if(!x){b(!0);try{const{blocklet:n}=await r.configBlocklet({input:{did:t.meta.did,configs:[{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SK,value:e}]}});i(n)}catch(n){F.Z.error(n.message)}finally{b(!1)}}}})]}),s&&(0,X.jsx)(le.Z,{role:"owner",children:e=>(e||ae.C)&&(0,X.jsxs)(u.Z,{className:"config-form",mt:2,children:[(0,X.jsxs)(u.Z,{className:"config-item",children:[(0,X.jsx)(u.Z,{className:"config-label",mb:0,children:h("team.transferApp.name")}),(0,X.jsxs)(N.Z,{style:{flexShrink:0},variant:"contained",edge:"end",color:"error",size:"small","data-cy":"transfer-app",onClick:()=>Z(!0),children:[(0,X.jsx)(O.Z,{style:{fontSize:"1.3em",marginRight:4}}),h("team.transferApp.name")]})]}),v&&(0,X.jsx)(ke,{onCancel:()=>Z(!1),onSuccess:()=>Z(!1)})]})}),(0,X.jsx)(u.Z,{className:"config-form",mt:2,children:(0,X.jsxs)(u.Z,{className:"config-item",children:[(0,X.jsxs)(u.Z,{className:"config-label",children:[h("blocklet.config.clearCache.name"),(0,X.jsx)(u.Z,{className:"config-desc",children:h("blocklet.config.clearCache.purpose")})]}),(0,X.jsx)(re.Z,{teamDid:R})]})})]})]})}const Te=(0,le.V)(Ae,"mutate_blocklets"),_e=(0,le.V)(Ae,"",oe.Wf);function Ne(e){const{inService:n}=(0,ie.h6)();return n?(0,X.jsx)(_e,{...e}):(0,X.jsx)(Te,{...e})}Ae.propTypes={blocklet:s().object.isRequired,onUpdate:s().func,hasPermission:s().bool},Ae.defaultProps={onUpdate:()=>{},hasPermission:!1};const Oe=l.Z.div(Se||(Se=(0,o.Z)(["\n padding-top: 24px;\n .config-form {\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 }\n }\n\n .config-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin: 16px 0;\n }\n\n .config-label {\n font-weight: bold;\n }\n\n .config-desc {\n font-weight: normal;\n font-size: 12px;\n color: #666;\n }\n\n .form-item {\n margin-top: 0;\n }\n"])),(e=>e.theme.breakpoints.down("md")));var Ie=t(25710),Fe=t(93066),Be=t(35214),ze=t(8708),Ue=t.n(ze),De=t(12673),Ke=t(99360),We=t(80506),qe=t(766),Ge=t.n(qe),Ve=t(24529),He=t.n(Ve),Me=t(16727),Ye=t.n(Me),Je=t(92706),Qe=t.n(Je);const Xe=(0,a.forwardRef)(((e,n)=>{const{t:t}=(0,a.useContext)(C.RD),i=(0,De.Z)({show:!1,title:"",content:"",onConfirm:Qe(),onCancel:Qe(),loading:!1}),o=(0,Ke.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i.show=!0,i.title=e.title,i.content=e.content,i.onConfirm=e.onConfirm||Qe(),i.onCancel=e.onCancel||Qe(),i.loading=!1})),l=(0,Ke.Z)((()=>{i.title="",i.content="",i.onConfirm=Qe(),i.onCancel=Qe()})),r=(0,Ke.Z)((()=>{i.show=!1,setTimeout((()=>{l()}),300)})),s=(0,Ke.Z)((()=>{r(),null===i||void 0===i||i.onCancel()}),[]),c=(0,Ke.Z)((async()=>{i.loading=!0;try{await(null===i||void 0===i?void 0:i.onConfirm(r))}finally{i.loading=!1}}),[]);return(0,a.useImperativeHandle)(n,(()=>({open:o,close:r})),[o,r]),(0,X.jsx)(ge.I4,{open:i.show,title:i.title,onConfirm:c,onCancel:s,confirmButton:{text:t("common.confirm"),props:{variant:"contained",color:"primary",loading:i.loading}},cancelButton:{text:t("common.cancel"),props:{variant:"outlined",color:"primary"}},children:i.content instanceof Function?i.content():i.content})}));function $e(){const e=(0,a.useRef)(null),n=(0,Ke.Z)((function(){for(var n,t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];null===(n=e.current)||void 0===n||n.open(...i)})),t=(0,Ke.Z)((function(){for(var n,t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];null===(n=e.current)||void 0===n||n.close(...i)})),i={open:n,close:t};return{confirmHolder:(0,X.jsx)(Xe,{ref:e}),confirmApi:i}}const en={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:""};const nn=function(){var e,n,t;const{api:i}=(0,ie.h6)(),{blocklet:o}=(0,pe.y0)(),{t:a}=(0,C.PE)(),{confirmApi:l,confirmHolder:r}=$e(),s=null===o||void 0===o||null===(e=o.meta)||void 0===e?void 0:e.did,c=Object.assign({...en},(null===o||void 0===o||null===(n=o.settings)||void 0===n||null===(t=n.notification)||void 0===t?void 0:t.email)||{}),{handleSubmit:d,control:m,formState:p,watch:h,reset:f}=(0,We.cI)({defaultValues:Ue()(c,Object.keys(en))}),g=(0,De.Z)({testReceiver:"",testReceiverError:""}),x=h("enabled"),b=(0,Ke.Z)((async function(e,n){let t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];try{var o,l;const{blocklet:n}=await i.configNotification({input:{did:s,notification:JSON.stringify({email:e})}}),r=Object.assign({...en},(null===n||void 0===n||null===(o=n.settings)||void 0===o||null===(l=o.notification)||void 0===l?void 0:l.email)||{});f(r),t&&F.Z.success(a("oauth.saveSuccess"))}catch(r){if(!t)throw r;F.Z.error(r.message||a("oauth.saveFailed"))}})),v=(0,Ke.Z)((async(e,n,t)=>{try{p.isDirty&&await b(e,n,!1),await i.sendEmail({input:{did:s,receiver:t,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification"})}}),F.Z.success(a("notification.email.testSuccess"))}catch(o){F.Z.error(o.message||a("notification.email.testfailed"))}})),Z=(0,Ke.Z)(((e,n)=>{g.testReceiver="",g.testReceiverError="",l.open({title:a("notification.email.testSendEmail"),content:()=>(0,X.jsx)(u.Z,{sx:{width:"300px"},children:(0,X.jsx)(H.Z,{fullWidth:!0,name:"testReceiver",label:a("notification.email.inputTestReceiver"),value:g.testReceiver,onChange:e=>{g.testReceiver=e.target.value},error:!!g.testReceiverError,helperText:g.testReceiverError||"\u3000"})}),async onConfirm(t){var i;const o=null===(i=g.testReceiver)||void 0===i?void 0:i.trim();o?Ge()(o)?(g.testReceiverError="",await v(e,n,o),t()):g.testReceiverError=a("notification.email.receiverInvalid"):g.testReceiverError=a("notification.email.receiverRequired")}})})),j=(0,Ke.Z)((e=>{const n=null===e||void 0===e?void 0:e.trim();return n?!!Ge()(n)||a("notification.email.fromInvalid"):a("notification.email.fromRequired")})),y=(0,Ke.Z)((e=>{const n=null===e||void 0===e?void 0:e.trim();return n?!!He()(n,{require_host:!1,protocols:[]})||a("notification.email.hostInvalid"):a("notification.email.hostRequired")})),k=(0,Ke.Z)((e=>e?!!Ye()(e)||a("notification.email.portInvalid"):a("notification.email.portRequired"))),w=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||a("notification.email.userRequired"))),S=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||a("notification.email.passwordRequired"))),E=(0,Ke.Z)((()=>!0));return(0,X.jsxs)(u.Z,{children:[(0,X.jsxs)("form",{onSubmit:d(b),disabled:!0,children:[(0,X.jsx)(We.Qr,{name:"enabled",control:m,render:e=>{let{field:n}=e;return(0,X.jsx)(Ze.Z,{control:(0,X.jsx)(T.Z,{checked:n.value,...n}),label:a("notification.email.enable"),sx:{marginBottom:"8px"}})}}),(0,X.jsx)(We.Qr,{name:"from",control:m,rules:{validate:x?j:E},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,label:a("notification.email.from"),error:!!p.errors[t.name],helperText:(null===(n=p.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!x})})}}),(0,X.jsx)(We.Qr,{name:"host",control:m,rules:{validate:x?y:E},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,error:!!p.errors[t.name],label:a("notification.email.host"),helperText:(null===(n=p.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!x})})}}),(0,X.jsx)(We.Qr,{name:"port",control:m,rules:{validate:x?k:E},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,type:"number",error:!!p.errors[t.name],label:a("notification.email.port"),helperText:(null===(n=p.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!x})})}}),(0,X.jsx)(We.Qr,{name:"user",control:m,rules:{validate:x?w:E},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,error:!!p.errors[t.name],label:a("notification.email.user"),helperText:(null===(n=p.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!x})})}}),(0,X.jsx)(We.Qr,{name:"password",control:m,rules:{validate:x?S:E},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,type:"password",error:!!p.errors[t.name],label:a("notification.email.password"),helperText:(null===(n=p.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!x})})}}),(0,X.jsx)(We.Qr,{name:"secure",control:m,rules:{validate:E},render:e=>{let{field:n}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(Ze.Z,{control:(0,X.jsx)(T.Z,{checked:n.value,...n,disabled:!x}),label:a("notification.email.secure"),style:{marginBottom:16}})})}}),(0,X.jsx)(N.Z,{variant:"outlined",color:"warning",onClick:d(Z),sx:{mr:2},disabled:!x,children:a("oauth.runTest")}),(0,X.jsx)(N.Z,{type:"submit",variant:"contained",disabled:!p.isDirty,children:a("oauth.save")})]}),r]})},tn=[{label:(0,X.jsx)(u.Z,{textAlign:"center",width:"100%",children:"Email"}),value:"email"},{label:(0,X.jsx)(u.Z,{textAlign:"center",width:"100%",children:"More"}),value:"more"}];const on=function(){const[e,n]=(0,a.useState)(tn[0].value),{t:t}=(0,a.useContext)(C.RD),i=(0,Fe.Z)((()=>({email:(0,X.jsx)(nn,{}),more:(0,X.jsx)(u.Z,{children:(0,X.jsx)(Ie.Z,{children:t("notification.comingSoon")})})})),[t]);return(0,X.jsxs)(u.Z,{children:[(0,X.jsx)(k.Z,{tabs:tn,current:e,onChange:n}),(0,X.jsx)(u.Z,{marginTop:"10px",children:i[e]})]})};var an=t(8262),ln=t(69292),rn=t(65700),sn=t(7549),cn=t(24558),dn=t(74286),mn=t(76282),pn=t(15410),un=t(19403),hn=t(15598),fn=t(77699),gn=t(27006),xn=t(8650);const bn=[{value:p.WHO_CAN_ACCESS.ALL,icon:xn.Z,title:{zh:"\u6240\u6709\u4eba\u53ef\u8bbf\u95ee",en:"Accessible to all"},description:{zh:"\u5411\u6240\u6709\u4eba\u5f00\u653e\uff0c\u65e0\u9700\u901a\u884c\u8bc1\u5373\u53ef\u8bbf\u95ee\u5e94\u7528",en:"Open to the world anyone can access without passport"}},{value:p.WHO_CAN_ACCESS.INVITED,icon:gn.Z,title:{zh:"\u53ea\u6709\u88ab\u9080\u8bf7\u7684\u4eba\u53ef\u4ee5\u8bbf\u95ee",en:"Only invited people can access"},description:{zh:"\u7a0d\u540e\u60a8\u53ef\u4ee5\u5728\u7ba1\u7406\u9875\u9762\u4e2d\u9080\u8bf7\u6210\u5458",en:"You can invite members later in the admin page"}},{value:p.WHO_CAN_ACCESS.OWNER,icon:fn.Z,title:{zh:"\u53ea\u6709\u5e94\u7528\u6240\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee",en:"Only Owner of the blocklet can access"},description:{zh:"\u5fc5\u987b\u63d0\u4f9b\u6240\u6709\u8005\u901a\u884c\u8bc1\u624d\u80fd\u8bbf\u95ee\u5e94\u7528",en:"You must provide owner passport to access this application"}}];var vn,Zn;const jn="roles",yn=[...bn,{value:jn,icon:un.Z,title:{zh:"\u6307\u5b9a\u901a\u884c\u8bc1\u53ef\u8bbf\u95ee",en:"Accessible to selected passports"},description:{zh:"\u53ea\u6709\u6307\u5b9a\u7684\u901a\u884c\u8bc1\u53ef\u4ee5\u8bbf\u95ee",en:"Only specified passports can access"}}],Cn=(e,n)=>{if(e&&e.startsWith(p.WHO_CAN_ACCESS_PREFIX_ROLES)){const t=(0,w.getRolesFromAuthConfig)({whoCanAccess:e}),i=n.filter((e=>t.includes(e.name)));return{access:jn,roles:i}}return{access:e,roles:[]}},kn=function(e,n){let{roles:t=[]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=(e.configs||[]).find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.COMPONENT_ACCESS_WHO));if(i)return Cn(i.value,t);if(n&&P()(n,"settings.whoCanAccess")&&P()(n,"settings.whoCanAccess")!==p.WHO_CAN_ACCESS.ALL)return Cn(P()(n,"settings.whoCanAccess"),t);const o=(0,w.findServiceFromMeta)(e.meta,p.NODE_SERVICES.AUTH);return P()(o,"config.whoCanAccess")?Cn(o.config.whoCanAccess,t):{access:p.WHO_CAN_ACCESS.ALL,roles:[]}};function wn(e){let{blocklet:n,ancestors:t,children:i}=e;const o=(0,an.Z)(),[l,r]=(0,a.useState)(""),{t:s,locale:c}=(0,C.PE)(),{api:d}=(0,ie.h6)(),{roles:m}=(0,Ce.DJ)(),[h,f]=(0,a.useState)(""),g=t[0]||n,{access:x,roles:b}=kn(n,g,{roles:m}),[v,Z]=(0,a.useState)(x),[j,y]=(0,a.useState)(b),k=[...t.map((e=>e.meta.did)),n.meta.did],S={marginRight:4,fontSize:18,verticalAlign:"text-bottom",color:o.palette.text.secondary},E=t.concat(n).map((e=>(0,w.getDisplayName)(e,!0))).join(" / ");if((0,oe.wS)(n.status))return null;if("unknown"===n.status&&(0,oe.wS)(n.status))return null;const L=()=>{r(!1)},P=e=>{e.stopPropagation(),r(!0)},R=h||v===jn&&!j.length;return["function"===typeof i?i({open:P}):(0,X.jsx)(K.Z,{onClick:P,"data-cy":"action-config-component",children:(0,X.jsx)(pn.Z,{})}),l&&(0,X.jsxs)(Sn,{open:!0,fullWidth:!0,title:E,onClose:L,PaperProps:{style:{minHeight:"auto"}},actions:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(N.Z,{onClick:L,color:"inherit","data-cy":"config-access-cancel",children:s("common.cancel")}),(0,X.jsxs)(N.Z,{onClick:async()=>{if(!h){f(!0);try{let e=v;e===jn&&(e="".concat(p.WHO_CAN_ACCESS_PREFIX_ROLES).concat(j.map((e=>e.name)).join(","))),await d.updateWhoCanAccess({input:{did:k,whoCanAccess:e}}),F.Z.success(s("blocklet.config.access.updatedTip")),L(),f(!1)}catch(e){f(!1),F.Z.error((0,oe.Z)(e))}}},color:"primary",disabled:R,variant:"contained",autoFocus:!0,"data-cy":"config-access-confirm",children:[h&&(0,X.jsx)(z.Z,{size:16}),s("common.confirm")]})]}),children:[(0,X.jsx)(u.Z,{mt:4,mb:3,children:(0,X.jsx)(H.Z,{label:s("blocklet.config.access.description"),select:!0,fullWidth:!0,value:v,onChange:e=>{const{value:n}=e.target;Z(n)},"data-cy":"config-access-select",SelectProps:{renderValue:e=>{const n=yn.find((n=>n.value===e));return n?(0,X.jsxs)(u.Z,{children:[(0,X.jsx)(n.icon,{style:S}),n.title[c]]}):null}},children:yn.map((e=>(0,X.jsxs)(En,{value:e.value,sx:{display:"block"},"data-cy":"config-access-opt-".concat(e.value),children:[(0,X.jsxs)(u.Z,{display:"flex",alignItems:"center",children:[(0,X.jsx)(e.icon,{style:S}),(0,X.jsx)(u.Z,{children:e.title[c]})]}),(0,X.jsx)(u.Z,{children:(0,X.jsx)(u.Z,{className:"tip",children:e.description[c]})})]})))})}),v===jn&&(0,X.jsx)(u.Z,{mt:4,mb:3,children:(0,X.jsx)(H.Z,{label:s("blocklet.config.access.description"),select:!0,fullWidth:!0,value:j.map((e=>e.name)),onChange:e=>{y(m.filter((n=>(e.target.value||[]).includes(n.name))))},SelectProps:{multiple:!0,renderValue:e=>(0,X.jsx)(u.Z,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:e.map((e=>{const n=m.find((n=>n.name===e));return(0,X.jsx)(W.Z,{label:n.title},n.text)}))})},children:m.map((e=>{let{name:n,title:t}=e;return(0,X.jsxs)(mn.Z,{value:n,children:[(0,X.jsx)(je.Z,{checked:j.some((e=>e.name===n))}),(0,X.jsx)(hn.Z,{primary:t})]},n)}))})})]})]}wn.propTypes={blocklet:s().object.isRequired,ancestors:s().array,children:s().any},wn.defaultProps={ancestors:[],children:null};const Sn=(0,l.Z)(ge.ZP)(vn||(vn=(0,o.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"]))),En=(0,l.Z)(mn.Z)(Zn||(Zn=(0,o.Z)(["\n .tip {\n font-size: 12px;\n color: ",";\n }\n"])),(e=>e.theme.palette.text.secondary));var Ln;function Pn(e){var n;let{blocklet:t,ancestors:i,depth:o}=e;const l=(0,an.Z)(),{t:r,locale:s}=(0,C.PE)(),{roles:c}=(0,Ce.DJ)(),[d,m]=(0,a.useState)(!0),{recommendedDomain:p}=(0,pe.y0)(),h=i[0]||t,f="/".concat(i.map((e=>e.mountPoint||"/")).join("/"),"/").concat(t.mountPoint||"/").replace(/\/+/g,"/"),g=(0,oe.vH)({blocklet:h,domain:{value:p},mountPoint:f,params:(0,oe.f0)(h,s)}),x={fill:l.palette.text.secondary},b=o>0&&t.children.length>0,v=(0,X.jsx)(K.Z,{size:"small",children:d?(0,X.jsx)(j.Z,{fontSize:"inherit"}):(0,X.jsx)(Z.Z,{fontSize:"inherit"})}),{access:y,roles:k}=kn(t,h,{roles:c});let E;if("roles"!==y)E=bn.find((e=>e.value===y))||bn[2];else{const e=k.map((e=>e.title)).join("/");E={title:{zh:"\u53ea\u6709 ".concat(e," \u53ef\u4ee5\u8bbf\u95ee"),en:"Only ".concat(e," can access")}}}return[(o>0||"gateway"!==t.meta.group)&&(0,X.jsxs)(u.Z,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,X.jsxs)(u.Z,{pl:Math.max(2*(o-1),0),width:{xs:300,md:400},display:"flex",alignItems:"center",style:{cursor:b?"pointer":"cursor"},onClick:()=>b&&m(!d),children:[b?v:(0,X.jsx)(u.Z,{width:28}),(0,X.jsx)(S.Z,{blocklet:t,ancestors:i}),(0,X.jsxs)(u.Z,{ml:"16px",children:[(0,X.jsx)(u.Z,{style:{color:"#222",fontSize:18},children:(0,w.getDisplayName)(t,!0)}),(0,X.jsx)(u.Z,{display:"flex",alignItems:"center",children:(0,X.jsx)(u.Z,{color:"text.secondary",children:E.title[s]})})]})]},t),(0,X.jsxs)(u.Z,{children:[(0,X.jsx)(ln.Z,{title:r("common.visit"),children:(0,X.jsx)("a",{target:"_blank",href:g,rel:"noopener noreferrer",title:g,children:(0,X.jsx)(K.Z,{children:(0,X.jsx)(sn.Z,{})})})}),(0,X.jsx)(wn,{blocklet:t,ancestors:i,children:e=>{let{open:n}=e;return(0,X.jsx)(ln.Z,{title:r("common.edit"),children:(0,X.jsx)(K.Z,{onClick:n,"data-cy":"btn-edit-".concat(t.meta.did),children:(0,X.jsx)(cn.Z,{style:x})})})}})]},"actions")]},"group-not-gateway-box"),(0,X.jsx)(dn.Z,{depth:o},"line"),null!==(n=t.children)&&void 0!==n&&n.length?(0,X.jsx)(rn.Z,{in:d,children:t.children.map((e=>(0,X.jsx)(Pn,{blocklet:e,ancestors:[...i,t],depth:o+1},"".concat(o+1,"-").concat(e.meta.did))))},"blocklet-collapse"):null]}function Rn(){const{t:e}=(0,C.PE)(),{blocklet:n}=(0,pe.y0)(),t=[...n.children]||[];return"gateway"!==n.meta.group&&t.unshift(n),(0,X.jsx)(An,{component:"div",children:t&&t.length?[(0,X.jsx)(u.Z,{mt:2,ml:{xs:"-12px",md:"-24px"},style:{maxWidth:1080},children:(0,X.jsx)(Pn,{blocklet:n},"0-".concat(n.meta.did))},"top-blocklet-".concat(n.meta.did))]:(0,X.jsx)(u.Z,{mt:8,children:(0,X.jsx)(Ie.Z,{children:e("blocklet.component.noComponent")})})})}Pn.propTypes={blocklet:s().object.isRequired,ancestors:s().array,depth:s().number},Pn.defaultProps={ancestors:[],depth:0},Rn.propTypes={};const An=(0,l.Z)(u.Z)(Ln||(Ln=(0,o.Z)(["\n .title {\n font-size: 1.2rem;\n font-weight: bold;\n margin-top: ",";\n margin-bottom: ",";\n &.first {\n margin-top: 0;\n }\n }\n"])),(e=>e.theme.spacing(5)),(e=>e.theme.spacing(3)));var Tn=t(12958),_n=t(44784);const Nn=function(){var e,n,t;const{api:i}=(0,ie.h6)(),{blocklet:o}=(0,pe.y0)(),{t:a}=(0,C.PE)(),l=null===o||void 0===o||null===(e=o.meta)||void 0===e?void 0:e.did,r=Object.assign({enabled:!1,domain:"",clientId:""},(null===o||void 0===o||null===(n=o.settings)||void 0===n||null===(t=n.oauth)||void 0===t?void 0:t.auth0)||{}),{handleSubmit:s,control:c,formState:d,watch:m,reset:p}=(0,We.cI)({defaultValues:Ue()(r,["domain","clientId","enabled"])}),h=m("enabled"),f=(0,Ke.Z)((async e=>{try{var n,t;const{blocklet:o}=await i.configOAuth({input:{did:l,oauth:JSON.stringify({auth0:e})}}),r=Object.assign({enabled:!1,domain:"",clientId:""},(null===o||void 0===o||null===(n=o.settings)||void 0===n||null===(t=n.oauth)||void 0===t?void 0:t.auth0)||{});p(r),F.Z.success(a("oauth.saveSuccess"))}catch(o){F.Z.error(o.message||a("oauth.saveFailed"))}})),g=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||a("oauth.auth0.domainDescribe"))),x=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||a("oauth.auth0.clientIdDescribe"))),b=(0,Ke.Z)((()=>!0));return(0,X.jsx)(u.Z,{children:(0,X.jsxs)("form",{onSubmit:s(f),disabled:!0,children:[(0,X.jsx)(We.Qr,{name:"enabled",control:c,render:e=>{let{field:n}=e;return(0,X.jsx)(Ze.Z,{control:(0,X.jsx)(_n.Z,{checked:n.value,style:{marginRight:"6px"},...n}),label:a("oauth.auth0.enable"),sx:{marginBottom:2,ml:1}})}}),(0,X.jsx)(We.Qr,{name:"domain",control:c,rules:{validate:h?g:b},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,label:a("oauth.auth0.domain"),error:!!d.errors[t.name],helperText:(null===(n=d.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h})})}}),(0,X.jsx)(We.Qr,{name:"clientId",control:c,rules:{validate:h?x:b},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,error:!!d.errors[t.name],label:a("oauth.auth0.clientId"),helperText:(null===(n=d.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h})})}}),(0,X.jsx)(Tn.Z,{type:"submit",variant:"contained",onSubmit:s(f),disabled:!d.isDirty,children:a("oauth.save")})]})})};var On=t(85723),In=t(28145);const Fn={ttl:604800};function Bn(e){const n=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?86400*e.ttl:e.ttl/86400;return{...e,ttl:n}}function zn(){var e,n;const{api:t}=(0,ie.h6)(),{blocklet:i}=(0,pe.y0)(),o=null===i||void 0===i||null===(e=i.meta)||void 0===e?void 0:e.did,a=Object.assign({},Fn,(null===i||void 0===i||null===(n=i.settings)||void 0===n?void 0:n.session)||{}),{handleSubmit:l,control:r,formState:s,reset:c}=(0,We.cI)({defaultValues:Ue()(Bn(a),["ttl"])}),{t:d}=(0,C.PE)(),m=(0,Ke.Z)((async e=>{try{var n;const{blocklet:i}=await t.updateAppSessionConfig({input:{did:o,config:Bn(e,!0)}}),a=Object.assign({},Fn,Ue()((null===i||void 0===i||null===(n=i.settings)||void 0===n?void 0:n.session)||{},["ttl"]));c(Bn(a)),F.Z.success(d("common.configSuccess"))}catch(i){F.Z.error(i.message)}}));return(0,X.jsx)(u.Z,{children:(0,X.jsxs)("form",{onSubmit:l(m),disabled:!0,children:[(0,X.jsx)(We.Qr,{name:"ttl",control:r,render:e=>{let{field:n}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,sx:{mb:2},children:(0,X.jsxs)(In.Z,{px:3,children:[(0,X.jsx)(u.Z,{mx:-3,my:.5,children:d("blocklet.config.session.ttl",{day:n.value})}),(0,X.jsx)(On.ZP,{...n,defaultValue:7,step:1,marks:[{value:1,label:d("blocklet.config.session.day",{day:1})},{value:7,label:d("blocklet.config.session.days",{day:7})},{value:14,label:d("blocklet.config.session.days",{day:14})},{value:21,label:d("blocklet.config.session.days",{day:21})},{value:30,label:d("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto",style:{maxWidth:"360px"}})]})})}}),(0,X.jsx)(Tn.Z,{type:"submit",variant:"contained",onSubmit:l(m),disabled:!s.isDirty,children:d("oauth.save")})]})})}var Un=t(94755),Dn=t(94324),Kn=t(63748),Wn=t(97038),qn=t(64886),Gn=t(42080),Vn=t.n(Gn),Hn=t(75506),Mn=t.n(Hn),Yn=t(47685),Jn=t(13260),Qn=t(82434),Xn=t.n(Qn);const $n=(0,a.forwardRef)(((e,n)=>{var t,i;const{t:o}=(0,a.useContext)(C.RD),{blocklet:l}=(0,pe.y0)(),{api:r}=(0,ie.h6)(),s=(0,De.Z)({mode:"view",show:!1,data:{},callback:Qe()}),c=(0,Yn.Fg)(),d=(null===c||void 0===c||null===(t=c.transitions)||void 0===t||null===(i=t.duration)||void 0===i?void 0:i.leavingScreen)||300,p=(0,Ke.Z)((()=>{s.mode="view",s.data={},s.callback=Qe()}),[]),h=(0,Ke.Z)((()=>{s.show=!1,setTimeout((()=>{p()}),d)}),[]),f=(0,Ke.Z)((e=>{s.mode="view",s.show=!0,s.data=e}),[]),g=(0,Ke.Z)((function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qe();s.mode="approve",s.show=!0,s.data=e,s.callback=n}),[]);(0,a.useImperativeHandle)(n,(()=>({open:f,close:h,approve:g})),[f,h,g]);const x=(0,Fe.Z)((()=>{if(!s.show)return[];s.data.migratedFrom=[s.data.appId,s.data.appPid];const e=["appName","appLogo","appId","appPid","migratedFrom","appDescription","appUrl","version","appliedAt","status","serverId","serverVersion"];return!1!==s.data.isMaster&&Vn()(e,"appliedAt","status"),e.map((e=>{const n=o("federated.info.".concat(e));let t=s.data[e];if("appName"===e&&s.data.isMaster&&(t=(0,X.jsxs)(u.Z,{children:[(0,X.jsx)(Un.Z,{component:Dn.Z}),t]})),["appId","appPid","serverId"].includes(e)&&(t=(0,X.jsx)(Jn.kL,{children:t})),["appUrl"].includes(e)&&(t=(0,X.jsx)(u.Z,{component:"a",href:t,target:"_blank",children:t})),["appLogo"].includes(e)){const e=Xn()(t)?t:m()(s.data.appUrl||"",t||"");try{const n=new URL(e);n.searchParams.set("imageFilter","resize"),n.searchParams.set("w","80"),n.searchParams.set("h","80"),t=(0,X.jsx)("img",{src:n.href,width:"60",height:"60",alt:s.data.appName})}catch{t=(0,X.jsx)("img",{src:e,width:"60",height:"60",alt:s.data.appName})}}if("status"===e&&(t=t&&o("federated.status.".concat(t))),"migratedFrom"===e){t=(s.data.migratedFrom||[]).filter((e=>![s.data.appId,s.data.appPid].includes(e))).map((e=>(0,X.jsx)(Jn.kL,{children:e})))}return Mn()(t)&&(t="-"),{name:n,value:t}}))}),[s.data]),b="approve"===s.mode,v=(0,Ke.Z)((async()=>{await r.auditFederatedLogin({input:{memberPid:s.data.appPid,did:l.appPid,status:"rejected"}}),h(),null===s||void 0===s||s.callback(!1)})),Z=(0,Ke.Z)((async()=>{await r.auditFederatedLogin({input:{memberPid:s.data.appPid,did:l.appPid,status:"approved"}}),h(),null===s||void 0===s||s.callback(!0)}));return(0,X.jsx)(ge.ZP,{open:s.show,title:o(b?"federated.approveToJoinLogin":"federated.siteDetail"),onClose:h,actions:b?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Tn.Z,{color:"error",variant:"contained",onClick:v,children:o("common.reject")}),(0,X.jsx)(Tn.Z,{variant:"contained",onClick:Z,children:o("common.approve")})]}):(0,X.jsx)(Tn.Z,{variant:"outlined",onClick:h,children:o("common.close")}),children:x.map((e=>(0,X.jsx)(qn.Z,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:180,name:e.name,children:e.value},e.name)))})}));var et=t(79842),nt=t(85408),tt=t.n(nt);const it=(0,a.forwardRef)(((e,n)=>{var t,i;const o=(0,Yn.Fg)(),l=(null===o||void 0===o||null===(t=o.transitions)||void 0===t||null===(i=t.duration)||void 0===i?void 0:i.leavingScreen)||300,{t:r}=(0,a.useContext)(C.RD),s=(0,De.Z)({show:!1,data:{link:""}}),c=(0,Ke.Z)((()=>{s.data.link=""}),[]),d=(0,Ke.Z)((()=>{s.show=!1,setTimeout((()=>{c()}),l)}),[]),m=(0,Ke.Z)((e=>{let{link:n}=e;s.show=!0,s.data.link=n}),[]);(0,a.useImperativeHandle)(n,(()=>({open:m,close:d})),[m,d]);const p=(0,Ke.Z)((()=>{tt()(s.data.link),d()}),[d]);return(0,X.jsxs)(ge.ZP,{open:s.show,title:r("federated.joinFederatedLogin"),onClose:d,PaperProps:{style:{minHeight:"unset"}},actions:(0,X.jsx)(N.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:p,children:r("common.copyAndClose")}),children:[(0,X.jsx)(u.Z,{mb:1,children:r("federated.inviteJoinFederatedLoginDescription")}),(0,X.jsx)(u.Z,{sx:{"& .copy-button":{display:"none !important"}},children:(0,X.jsx)(et.Z,{language:"shell",style:{marginBottom:0},children:s.data.link})})]})}));function ot(e){var n,t,i,o,l;let{mode:r}=e;const s=(0,a.useRef)(null),c=(0,a.useRef)(null),{t:d,locale:m}=(0,a.useContext)(C.RD),{blocklet:p,actions:{refreshBlocklet:h}}=(0,pe.y0)(),{confirmApi:f,confirmHolder:g}=$e(),{api:x}=(0,ie.h6)(),b=(null===(n=p.settings.federated)||void 0===n?void 0:n.sites)||[],v=(null===(t=p.settings.federated)||void 0===t?void 0:t.config)||{},Z=!1!==v.isMaster,j=(0,Ke.Z)((e=>{var n;null===(n=c.current)||void 0===n||n.open(e)})),y=(0,Ke.Z)((e=>{var n;null===(n=c.current)||void 0===n||n.approve(e,h)})),k=(0,Ke.Z)((e=>{f.open({title:d("federated.disableFederatedLogin"),content:d("federated.disableFederatedLoginDescription"),async onConfirm(n){await x.auditFederatedLogin({input:{memberPid:e.appPid,did:p.appPid,status:"revoked"}}),n()}})})),w=(0,Ke.Z)((e=>{f.open({title:d("federated.enableFederatedLogin"),content:d("federated.enableFederatedLoginDescription"),async onConfirm(n){await x.auditFederatedLogin({input:{memberPid:e.appPid,did:p.appPid,status:"approved"}}),n()}})})),S=(0,Fe.Z)((()=>{const e=[{label:d("common.name"),name:"appName",options:{customBodyRenderLite:e=>{const n=b[e],t=!1!==n.isMaster;return(0,X.jsx)(u.Z,{display:"inline-block",children:(0,X.jsxs)(u.Z,{component:"a",display:"flex",alignItems:"center",href:n.appUrl,target:"_blank",onClick:e=>{e.stopPropagation()},children:[t&&(0,X.jsx)(Un.Z,{component:Dn.Z,style:{marginRight:"4px"}}),n.appName]})})}}},{label:d("common.did"),name:"appId",options:{customBodyRenderLite:e=>{const n=b[e];return(0,X.jsx)(Wn.Z,{children:n.appId})}}},{label:d("common.status"),name:"status",options:{customBodyRenderLite:e=>{const n=b[e],t=!1!==n.isMaster;return(0,X.jsx)(u.Z,{children:t?"-":d("federated.status.".concat(n.status))})}}}];return Z&&e.push({label:d("common.actions"),name:"actions",options:{customBodyRenderLite:e=>{const n=b[e],t=!1!==n.isMaster;return(0,X.jsx)(u.Z,{display:"flex",gap:1,children:t?(0,X.jsxs)(X.Fragment,{children:["rejected"===n.status&&(0,X.jsx)(N.Z,{variant:"contained",color:"error",size:"small",onClick:e=>{e.stopPropagation()},children:d("federated.status.rejected")}),"revoked"===n.status&&(0,X.jsx)(N.Z,{variant:"contained",color:"secondary",size:"small",onClick:e=>{e.stopPropagation()},children:d("federated.status.revoked")})]}):(0,X.jsxs)(X.Fragment,{children:["pending"===n.status&&(0,X.jsx)(N.Z,{variant:"contained",color:"primary",size:"small",onClick:e=>{e.stopPropagation(),y(n)},children:d("federated.status.pending")}),"approved"===n.status&&(0,X.jsx)(N.Z,{variant:"contained",color:"error",size:"small",onClick:e=>{e.stopPropagation(),k(n)},style:{whiteSpace:"nowrap"},children:d("federated.revoke")}),"revoked"===n.status&&(0,X.jsx)(N.Z,{variant:"contained",color:"warning",size:"small",onClick:e=>{e.stopPropagation(),w(n)},style:{whiteSpace:"nowrap"},children:d("federated.approve")})]})})}}}),e}),[v.appId,b,Z,d]),E=(0,Fe.Z)((()=>({sort:!0,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick(e,n){let{dataIndex:t}=n;const i=b[t];j(i)}})),[]),L=(0,Ke.Z)((()=>{const e=p.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL));var n;null!==e&&void 0!==e&&e.value?null===(n=s.current)||void 0===n||n.open({link:e.value}):F.Z.error(d("federated.failedToGetFederatedLoginLink"))}),[null===(i=p.site)||void 0===i||null===(o=i.domainAliases)||void 0===o||null===(l=o[0])||void 0===l?void 0:l.href]),P=(0,Ke.Z)((()=>{f.open({title:d("federated.quitFederatedLogin"),content:d("federated.quitFederatedLoginDescription"),async onConfirm(e){await x.quitFederatedLogin({input:{did:p.appPid}}),e()}})})),R=(0,Ke.Z)((()=>{f.open({title:d("federated.disbandFederatedLogin"),content:d("federated.disbandFederatedLoginDescription"),async onConfirm(e){await x.disbandFederatedLogin({input:{did:p.appPid}}),e()}})})),A=[];return"master"!==r?A.push((0,X.jsx)(N.Z,{size:"small",variant:"contained",color:"error",onClick:P,sx:{ml:1},children:d("federated.quitFederatedLogin")},"quitFederatedLogin")):(A.push((0,X.jsx)(N.Z,{size:"small",variant:"contained",onClick:L,sx:{ml:1},children:d("federated.inviteJoinFederatedLogin")},"inviteJoinFederatedLogin")),A.push((0,X.jsx)(N.Z,{color:"error",size:"small",variant:"contained",onClick:R,sx:{ml:1},children:d("federated.disbandFederatedLogin")},"disbandFederatedLogin"))),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Kn.Z,{className:"main-table",locale:m,data:b,columns:S,customButtons:A,title:(0,X.jsx)(u.Z,{className:"table-toolbar-left",children:d("oauth.federated")}),options:E}),g,(0,X.jsx)(it,{ref:s}),(0,X.jsx)($n,{ref:c})]})}ot.propTypes={mode:s().oneOf(["member","master"])},ot.defaultProps={mode:"member"};const at=ot,lt=(0,a.forwardRef)(((e,n)=>{var t,i;const{t:o}=(0,a.useContext)(C.RD),{api:l}=(0,ie.h6)(),{blocklet:r}=(0,pe.y0)(),s=null===r||void 0===r?void 0:r.appPid,c=(0,Yn.Fg)(),d=(null===c||void 0===c||null===(t=c.transitions)||void 0===t||null===(i=t.duration)||void 0===i?void 0:i.leavingScreen)||300,m=(0,De.Z)({show:!1,appUrl:"",appUrlError:"",callback:Qe()}),p=(0,Ke.Z)((()=>{m.appUrl="",m.appUrlError="",m.callback=Qe()}),[]),h=(0,Ke.Z)((()=>{m.show=!1,setTimeout((()=>{p()}),d)}),[]),f=(0,Ke.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qe();m.show=!0,m.callback=e}),[]);(0,a.useImperativeHandle)(n,(()=>({open:f,close:h})),[f,h]);const g=(0,Ke.Z)((e=>{if(!e)throw new Error(o("federated.federatedJoinAppUrlRequired"));if(!Xn()(e))throw new Error(o("federated.federatedJoinAppUrlInvalid"))})),x=(0,Ke.Z)((async()=>{try{g(m.appUrl);const e=await l.joinFederatedLogin({input:{did:s,appUrl:m.appUrl}});m.show=!1,h(),null===m||void 0===m||m.callback(e)}catch(e){m.appUrlError=e.message}}),[h,s]);return(0,X.jsxs)(ge.ZP,{open:m.show,title:o("federated.joinFederatedLogin"),onClose:h,PaperProps:{style:{minHeight:"unset"}},actions:(0,X.jsx)(N.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:x,children:o("common.confirm")}),children:[(0,X.jsx)(u.Z,{mb:1,children:o("federated.joinFederatedLoginDescription")}),(0,X.jsx)(H.Z,{fullWidth:!0,variant:"outlined",margin:"dense",placeholder:o("federated.federatedJoinAppUrl"),label:o("federated.federatedJoinAppUrl"),value:m.appUrl,error:!!m.appUrlError,helperText:m.appUrlError||"eg: https://www.arcblock.io",onChange:e=>{m.appUrl=e.target.value}})]})}));function rt(){var e,n,t,i;const o=(0,a.useRef)(null),l=(0,a.useRef)(null),{t:r}=(0,a.useContext)(C.RD),{blocklet:s,actions:{refreshBlocklet:c}}=(0,pe.y0)(),d=(0,Ke.Z)((()=>{var e,n,t;const i=null===(e=s.site)||void 0===e||null===(n=e.domainAliases)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.href;if(i)try{var a;const e=new URL(i);null===(a=o.current)||void 0===a||a.open({link:e.origin})}catch{F.Z.error(r("federated.failedToGetFederatedLoginLink"))}}),[null===(e=s.site)||void 0===e||null===(n=e.domainAliases)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.href]),m=(0,Ke.Z)((()=>{var e;null===(e=l.current)||void 0===e||e.open((()=>{c()}))}),[c]);if((null===(i=s.settings.federated)||void 0===i?void 0:i.sites.length)>0){var p;const e=!1!==(null===(p=s.settings.federated)||void 0===p?void 0:p.config.isMaster);return(0,X.jsx)(at,{mode:e?"master":"member"})}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(u.Z,{display:"flex",flexDirection:"column",gap:2,justifyContent:"center",alignItems:"center",minHeight:"200px",children:[(0,X.jsx)(N.Z,{variant:"contained",onClick:d,children:r("federated.inviteJoinFederatedLogin")}),(0,X.jsx)(_.Z,{sx:{width:"150px",color:"rgba(0, 0, 0, 0.3)"},children:"OR"}),(0,X.jsx)(N.Z,{variant:"outlined",onClick:m,children:r("federated.joinFederatedLogin")})]}),(0,X.jsx)(it,{ref:o}),(0,X.jsx)(lt,{ref:l})]})}const st=function(){const{t:e}=(0,a.useContext)(C.RD),n=[{label:(0,X.jsx)(u.Z,{textAlign:"center",width:"100%",children:e("oauth.commonSettings")}),value:"settings"},{label:(0,X.jsx)(u.Z,{textAlign:"center",width:"100%",children:e("oauth.federated")}),value:"federated"},{label:(0,X.jsx)(u.Z,{textAlign:"center",width:"100%",children:"Auth0"}),value:"auth0"},{label:(0,X.jsx)(u.Z,{textAlign:"center",width:"100%",children:e("oauth.moreLogin")}),value:"more"}],[t,i]=(0,a.useState)(n[0].value),o=(0,Fe.Z)((()=>({auth0:(0,X.jsx)(Nn,{}),federated:(0,X.jsx)(rt,{}),more:(0,X.jsx)(u.Z,{children:(0,X.jsx)(Ie.Z,{children:e("oauth.comingSoon")})}),settings:(0,X.jsx)(u.Z,{children:(0,X.jsx)(zn,{})})})),[e]);return(0,X.jsxs)(u.Z,{children:[(0,X.jsx)(k.Z,{tabs:n,current:t,onChange:i}),(0,X.jsx)(u.Z,{marginTop:"10px",children:o[t]})]})};var ct;const dt=e=>{let{tabs:n,blocklet:t,ancestors:i=[],depth:o=1,t:a}=e;const l=[...i.map((e=>e.meta.did)),t.meta.did].join("/"),r=!(null!==i&&void 0!==i&&i.length);n.push({label:(0,X.jsxs)(u.Z,{pl:2*Math.max(1,o-1),display:"flex",alignItems:"center",justifyContent:"flex-start",children:[r?(0,X.jsx)(E.Z,{size:24,blocklet:t}):(0,X.jsx)(S.Z,{size:24,blocklet:t,ancestors:i}),(0,X.jsx)(u.Z,{ml:"16px",children:(0,X.jsx)(u.Z,{style:{color:"#222"},children:r?a("blocklet.component.container"):(0,w.getDisplayName)(t,!0)})})]},l),value:l}),t.children.length>0&&t.children.forEach((e=>{dt({tabs:n,blocklet:e,ancestors:[...i,t],depth:o+1,t:a})}))};function mt(e){let{blocklet:n,onUpdate:t,...i}=e;const{t:o}=(0,a.useContext)(C.RD),{info:l,inService:r}=(0,ie.h6)(),[s,d]=(0,a.useState)(!0),[w,S]=(0,y.useSearchParams)(),E=w.get("tab")||"general",L=[{label:(0,X.jsxs)(u.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-general",children:[(0,X.jsx)(f.Z,{sx:{fontSize:24}}),(0,X.jsx)(u.Z,{ml:"16px",children:(0,X.jsx)(u.Z,{style:{color:"#222"},children:o("common.general")})})]},"general"),value:"general"},{label:(0,X.jsxs)(u.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-access",children:[(0,X.jsx)(g.Z,{sx:{fontSize:24}}),(0,X.jsx)(u.Z,{ml:"16px",children:(0,X.jsx)(u.Z,{style:{color:"#222"},children:o("common.access")})})]},"access"),value:"access"},{label:(0,X.jsxs)(u.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-oauth",children:[(0,X.jsx)(x.Z,{sx:{fontSize:24}}),(0,X.jsx)(u.Z,{ml:"16px",children:(0,X.jsx)(u.Z,{style:{color:"#222"},children:o("common.login")})})]},"oauth"),value:"oauth"},{label:(0,X.jsxs)(u.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-notification",children:[(0,X.jsx)(b.Z,{sx:{fontSize:24}}),(0,X.jsx)(u.Z,{ml:"16px",children:(0,X.jsx)(u.Z,{style:{color:"#222"},children:o("common.notification")})})]},"notification"),value:"notification"},{label:(0,X.jsxs)(u.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-preference",children:[(0,X.jsx)(u.Z,{ml:-2,style:{transform:"translateY(2px)"},children:s?(0,X.jsx)(j.Z,{fontSize:"inherit"}):(0,X.jsx)(Z.Z,{fontSize:"inherit"})}),(0,X.jsx)(v.Z,{sx:{fontSize:24}}),(0,X.jsx)(u.Z,{ml:"16px",children:(0,X.jsx)(u.Z,{style:{color:"#222"},children:o("common.preferences")})})]},"preference"),value:"preference"}];s&&dt({tabs:L,blocklet:n,t:o});let P=null;if("general"===E)P=(0,X.jsx)(Ne,{blocklet:n,onUpdate:t});else if("access"===E)P=(0,X.jsx)(Rn,{});else if("oauth"===E)P=(0,X.jsx)(st,{});else if("notification"===E)P=(0,X.jsx)(on,{});else{const e=r?p.WELLKNOWN_SERVICE_PATH_PREFIX:l.routing.adminPath,n=new URLSearchParams;r||n.set("authKey","__sst"),n.set("schemaKey",m()(window.location.origin,e,"/api/preferences?id=".concat(encodeURIComponent(E)))),P=(0,X.jsx)(c.Z,{url:"".concat(m()(window.location.origin,e,"/hosted/form-collector/"),"?").concat(n.toString()),width:"100%",height:"100%",frameBorder:0,styles:{border:0}})}return(0,X.jsx)(pt,{...i,children:(0,X.jsxs)(h.ZP,{container:!0,spacing:4,columns:24,children:[(0,X.jsx)(h.ZP,{item:!0,sm:7,md:5,children:(0,X.jsx)(k.Z,{tabs:L,current:E,orientation:"vertical",onChange:e=>{"preference"===e?d(!s):S((n=>("general"===e?n.delete("tab"):n.set("tab",e),n)))},sx:{borderRight:1,height:"100%",borderColor:"divider"}})}),(0,X.jsx)(h.ZP,{item:!0,sm:17,md:19,children:(0,X.jsx)(u.Z,{style:{minHeight:"66vh",height:"100%",position:"relative",overflow:"hidden"},children:P})})]})})}mt.propTypes={blocklet:s().object.isRequired,onUpdate:s().func},mt.defaultProps={onUpdate:()=>{}};const pt=l.Z.div(ct||(ct=(0,o.Z)(["\n .MuiTab-root {\n text-align: left;\n align-items: flex-start;\n font-weight: normal;\n }\n .Mui-selected {\n font-weight: bold;\n }\n"])))},78410:(e,n,t)=>{t.d(n,{Z:()=>p});var i=t(5057),o=t(86229),a=t(28726),l=t(69544),r=t(68420),s=t(14491),c=t(58238),d=t(70461),m=t(96266);function p(e){let{teamDid:n,size:t="small",...p}=e;const{t:u}=(0,r.PE)(),{api:h}=(0,c.h6)(),[f,g]=(0,i.useState)(!1),[x,b]=(0,i.useState)(null),v={title:u("blocklet.config.clearCache.title"),description:u("blocklet.config.clearCache.description"),confirm:u("common.confirm"),cancel:u("common.cancel"),onConfirm:async()=>{try{var e;g(!0);const t=await h.clearCache({input:{teamDid:n}});o.Z.success(u("blocklet.config.clearCache.success",{count:(null===(e=t.removed)||void 0===e?void 0:e.length)||0}))}catch(t){o.Z.error((0,s.Z)(t))}finally{g(!1),b(null)}},onCancel:()=>{g(!1),b(null)}};return(0,m.jsxs)("div",{...p,children:[(0,m.jsxs)(a.Z,{onClick:()=>b(v),color:"error",variant:"outlined",size:t,children:[f?(0,m.jsx)(l.Z,{size:16,style:{marginRight:5}}):null,u("blocklet.config.clearCache.action")]}),x&&(0,m.jsx)(d.Z,{title:x.title,description:x.description,confirm:x.confirm,cancel:x.cancel,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}},50185:(e,n,t)=>{t.d(n,{Z:()=>c});var i=t(5057),o=t(55898),a=t.n(o),l=t(12937),r=t(68420),s=t(96266);function c(e){let{children:n,...t}=e;const{t:o}=(0,i.useContext)(r.RD);return(0,s.jsx)(l.Z,{tip:o("common.copyTip"),copiedTip:o("common.copiedTip"),...t,children:n})}c.propTypes={children:a().any.isRequired}},28641:(e,n,t)=>{t.d(n,{Z:()=>x});var i=t(5057),o=t(55898),a=t.n(o),l=t(87543),r=t(72739),s=t(69544),c=t(46568),d=t(28763),m=t(53066),p=t(35406),u=t(11875),h=t(95890),f=t(96266);const g=(e,n,t)=>null===e&&n&&t?"******":e?n?"******":e:"";function x(e){let{label:n,disabled:t,required:o,initialValue:a,onChange:x,placeholder:b,style:v,onSubmit:Z,secure:j,triggers:y,formatterBeforeSubmit:C,...k}=e;const[w,S]=(0,i.useState)(!1),[E,L]=(0,i.useState)(!1),[P,R]=(0,i.useState)(j&&"__encrypted__"===a?null:a),[A,T]=(0,i.useState)(P),_=async()=>{L(!0);try{if(!1===await Z(A))T(P);else{let e=A;"function"===typeof C&&(e=C(A)),T(e),R(e)}}catch(e){T(P)}finally{L(!1),S(!1)}},N=w?(0,f.jsx)(r.Z,{style:{flex:1},fullWidth:!0,value:A,onChange:e=>{var n;n=e.target.value,T(n),x(n)},autoFocus:!0,size:"small",variant:"outlined",placeholder:b,onKeyDown:e=>{"Enter"===e.key&&_()},disabled:t,type:j?"password":"text",...k}):(0,f.jsx)(l.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:g(A,j,a)});return(0,f.jsx)(u.Z,{className:"form",style:v,children:(0,f.jsxs)(l.Z,{className:"form-item",children:[(0,f.jsxs)(l.Z,{className:"form-item-label",children:[n,o&&(0,f.jsx)(p.Z,{})]}),(0,f.jsxs)(l.Z,{className:"form-item-body",children:[(0,f.jsx)(l.Z,{className:"form-item-input",children:N}),(0,f.jsx)(l.Z,{className:"form-item-action",children:w?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(m.Z,{"data-cy":"schema-form-item-confirm",onClick:_,disabled:t||E,size:"large",children:E?(0,f.jsx)(s.Z,{size:24}):(0,f.jsx)(d.Z,{})}),(0,f.jsx)(m.Z,{"data-cy":"schema-form-item-cancel",onClick:()=>{T(P),S(!1)},disabled:t||E,size:"large",children:(0,f.jsx)(c.Z,{})})]}):(0,f.jsx)(h.Z,{triggers:y,onEnterEdit:()=>S(!0),disabled:t})})]})]})})}x.propTypes={style:a().object,onSubmit:a().func,onChange:a().func,label:a().string,initialValue:a().string,placeholder:a().string,required:a().bool,disabled:a().bool,secure:a().bool,triggers:a().array,formatterBeforeSubmit:a().func},x.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",placeholder:"",required:!1,disabled:!1,secure:!1,triggers:[],formatterBeforeSubmit:null}},11875:(e,n,t)=>{t.d(n,{Z:()=>r});var i,o=t(71171),a=t(33518),l=t(87543);const r=(0,a.Z)(l.Z)(i||(i=(0,o.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)=>{t.d(n,{Z:()=>x});var i=t(5057),o=t(55898),a=t.n(o),l=t(24558),r=t(53066),s=t(12958),c=t(83388),d=t(87669),m=t(15418),p=t(38473),u=t(90820),h=t(76282),f=t(58870),g=t(96266);function x(e){let{triggers:n,onEnterEdit:t,disabled:o}=e;const a=i.useRef(null),[x,b]=i.useState(!1);return 0===n.length?(0,g.jsx)(r.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:o,size:"large",children:(0,g.jsx)(l.Z,{})}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(c.Z,{variant:"outlined",ref:a,"aria-label":"split button",children:[(0,g.jsx)(s.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:o,size:"large",children:(0,g.jsx)(l.Z,{})}),(0,g.jsx)(s.Z,{size:"small","aria-controls":x?"split-button-menu":void 0,"aria-expanded":x?"true":void 0,onClick:()=>{b((e=>!e))},children:(0,g.jsx)(d.Z,{})})]}),(0,g.jsx)(u.Z,{sx:{zIndex:9999},open:x,anchorEl:a.current,role:void 0,placement:"bottom-end",children:(0,g.jsx)(p.Z,{children:(0,g.jsx)(m.d,{onClickAway:e=>{a.current&&a.current.contains(e.target)||b(!1)},children:(0,g.jsx)(f.Z,{id:"split-button-menu",autoFocusItem:!0,children:n.map((e=>(0,g.jsx)(h.Z,{onClick:()=>{return n=e.handler,b(!1),void n();var n},children:e.title},e.key)))})})})})]})}x.propTypes={triggers:a().arrayOf(a().shape({key:a().string.isRequired,title:a().string.isRequired,handler:a().func.isRequired})),onEnterEdit:a().func.isRequired,disabled:a().bool.isRequired},x.defaultProps={triggers:[]}},35406:(e,n,t)=>{t.d(n,{Z:()=>a});var i,o=t(71171);const a=t(33518).Z.span(i||(i=(0,o.Z)(["\n color: ",";\n &::before {\n content: '*';\n }\n"])),(e=>e.theme.palette.error.main))},54063:(e,n,t)=>{t.d(n,{C:()=>i});const i="true"===localStorage.getItem("enableDebug")}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6406],{98221:(t,r,e)=>{"use strict";var o=e(71600);r.Z=void 0;var n=o(e(84115)),a=e(96266);r.Z=(0,n.default)((0,a.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add")},72601:(t,r,e)=>{"use strict";var o=e(38713),n=e(45807),a=n(o("String.prototype.indexOf"));t.exports=function(t,r){var e=o(t,!!r);return"function"===typeof e&&a(t,".prototype.")>-1?n(e):e}},45807:(t,r,e)=>{"use strict";var o=e(47462),n=e(38713),a=e(14580),i=n("%TypeError%"),p=n("%Function.prototype.apply%"),y=n("%Function.prototype.call%"),f=n("%Reflect.apply%",!0)||o.call(y,p),u=n("%Object.defineProperty%",!0),c=n("%Math.max%");if(u)try{u({},"a",{value:1})}catch(s){u=null}t.exports=function(t){if("function"!==typeof t)throw new i("a function is required");var r=f(o,y,arguments);return a(r,1+c(0,t.length-(arguments.length-1)),!0)};var l=function(){return f(o,p,arguments)};u?u(t.exports,"apply",{value:l}):t.exports.apply=l},8840:(t,r,e)=>{"use strict";var o=e(61211)(),n=e(38713),a=o&&n("%Object.defineProperty%",!0);if(a)try{a({},"a",{value:1})}catch(f){a=!1}var i=n("%SyntaxError%"),p=n("%TypeError%"),y=e(93911);t.exports=function(t,r,e){if(!t||"object"!==typeof t&&"function"!==typeof t)throw new p("`obj` must be an object or a function`");if("string"!==typeof r&&"symbol"!==typeof r)throw new p("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!==typeof arguments[3]&&null!==arguments[3])throw new p("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!==typeof arguments[4]&&null!==arguments[4])throw new p("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!==typeof arguments[5]&&null!==arguments[5])throw new p("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!==typeof arguments[6])throw new p("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],c=!!y&&y(t,r);if(a)a(t,r,{configurable:null===f&&c?c.configurable:!f,enumerable:null===o&&c?c.enumerable:!o,value:e,writable:null===n&&c?c.writable:!n});else{if(!u&&(o||n||f))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[r]=e}}},2904:t=>{"use strict";var r=Object.prototype.toString,e=Math.max,o=function(t,r){for(var e=[],o=0;o<t.length;o+=1)e[o]=t[o];for(var n=0;n<r.length;n+=1)e[n+t.length]=r[n];return e};t.exports=function(t){var n=this;if("function"!==typeof n||"[object Function]"!==r.apply(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var a,i=function(t,r){for(var e=[],o=r||0,n=0;o<t.length;o+=1,n+=1)e[n]=t[o];return e}(arguments,1),p=e(0,n.length-i.length),y=[],f=0;f<p;f++)y[f]="$"+f;if(a=Function("binder","return function ("+function(t,r){for(var e="",o=0;o<t.length;o+=1)e+=t[o],o+1<t.length&&(e+=r);return e}(y,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof a){var r=n.apply(this,o(i,arguments));return Object(r)===r?r:this}return n.apply(t,o(i,arguments))})),n.prototype){var u=function(){};u.prototype=n.prototype,a.prototype=new u,u.prototype=null}return a}},47462:(t,r,e)=>{"use strict";var o=e(2904);t.exports=Function.prototype.bind||o},38713:(t,r,e)=>{"use strict";var o,n=SyntaxError,a=Function,i=TypeError,p=function(t){try{return a('"use strict"; return ('+t+").constructor;")()}catch(r){}},y=Object.getOwnPropertyDescriptor;if(y)try{y({},"")}catch(U){y=null}var f=function(){throw new i},u=y?function(){try{return f}catch(t){try{return y(arguments,"callee").get}catch(r){return f}}}():f,c=e(49211)(),l=e(71495)(),s=Object.getPrototypeOf||(l?function(t){return t.__proto__}:null),b={},g="undefined"!==typeof Uint8Array&&s?s(Uint8Array):o,d={"%AggregateError%":"undefined"===typeof AggregateError?o:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"===typeof ArrayBuffer?o:ArrayBuffer,"%ArrayIteratorPrototype%":c&&s?s([][Symbol.iterator]()):o,"%AsyncFromSyncIteratorPrototype%":o,"%AsyncFunction%":b,"%AsyncGenerator%":b,"%AsyncGeneratorFunction%":b,"%AsyncIteratorPrototype%":b,"%Atomics%":"undefined"===typeof Atomics?o:Atomics,"%BigInt%":"undefined"===typeof BigInt?o:BigInt,"%BigInt64Array%":"undefined"===typeof BigInt64Array?o:BigInt64Array,"%BigUint64Array%":"undefined"===typeof BigUint64Array?o:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"===typeof DataView?o:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"===typeof Float32Array?o:Float32Array,"%Float64Array%":"undefined"===typeof Float64Array?o:Float64Array,"%FinalizationRegistry%":"undefined"===typeof FinalizationRegistry?o:FinalizationRegistry,"%Function%":a,"%GeneratorFunction%":b,"%Int8Array%":"undefined"===typeof Int8Array?o:Int8Array,"%Int16Array%":"undefined"===typeof Int16Array?o:Int16Array,"%Int32Array%":"undefined"===typeof Int32Array?o:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":c&&s?s(s([][Symbol.iterator]())):o,"%JSON%":"object"===typeof JSON?JSON:o,"%Map%":"undefined"===typeof Map?o:Map,"%MapIteratorPrototype%":"undefined"!==typeof Map&&c&&s?s((new Map)[Symbol.iterator]()):o,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"===typeof Promise?o:Promise,"%Proxy%":"undefined"===typeof Proxy?o:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"===typeof Reflect?o:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"===typeof Set?o:Set,"%SetIteratorPrototype%":"undefined"!==typeof Set&&c&&s?s((new Set)[Symbol.iterator]()):o,"%SharedArrayBuffer%":"undefined"===typeof SharedArrayBuffer?o:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":c&&s?s(""[Symbol.iterator]()):o,"%Symbol%":c?Symbol:o,"%SyntaxError%":n,"%ThrowTypeError%":u,"%TypedArray%":g,"%TypeError%":i,"%Uint8Array%":"undefined"===typeof Uint8Array?o:Uint8Array,"%Uint8ClampedArray%":"undefined"===typeof Uint8ClampedArray?o:Uint8ClampedArray,"%Uint16Array%":"undefined"===typeof Uint16Array?o:Uint16Array,"%Uint32Array%":"undefined"===typeof Uint32Array?o:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"===typeof WeakMap?o:WeakMap,"%WeakRef%":"undefined"===typeof WeakRef?o:WeakRef,"%WeakSet%":"undefined"===typeof WeakSet?o:WeakSet};if(s)try{null.error}catch(U){var h=s(s(U));d["%Error.prototype%"]=h}var v=function t(r){var e;if("%AsyncFunction%"===r)e=p("async function () {}");else if("%GeneratorFunction%"===r)e=p("function* () {}");else if("%AsyncGeneratorFunction%"===r)e=p("async function* () {}");else if("%AsyncGenerator%"===r){var o=t("%AsyncGeneratorFunction%");o&&(e=o.prototype)}else if("%AsyncIteratorPrototype%"===r){var n=t("%AsyncGenerator%");n&&s&&(e=s(n.prototype))}return d[r]=e,e},A={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},m=e(47462),w=e(85869),S=m.call(Function.call,Array.prototype.concat),P=m.call(Function.apply,Array.prototype.splice),O=m.call(Function.call,String.prototype.replace),j=m.call(Function.call,String.prototype.slice),x=m.call(Function.call,RegExp.prototype.exec),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,F=/\\(\\)?/g,I=function(t,r){var e,o=t;if(w(A,o)&&(o="%"+(e=A[o])[0]+"%"),w(d,o)){var a=d[o];if(a===b&&(a=v(o)),"undefined"===typeof a&&!r)throw new i("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:e,name:o,value:a}}throw new n("intrinsic "+t+" does not exist!")};t.exports=function(t,r){if("string"!==typeof t||0===t.length)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!==typeof r)throw new i('"allowMissing" argument must be a boolean');if(null===x(/^%?[^%]*%?$/,t))throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var e=function(t){var r=j(t,0,1),e=j(t,-1);if("%"===r&&"%"!==e)throw new n("invalid intrinsic syntax, expected closing `%`");if("%"===e&&"%"!==r)throw new n("invalid intrinsic syntax, expected opening `%`");var o=[];return O(t,E,(function(t,r,e,n){o[o.length]=e?O(n,F,"$1"):r||t})),o}(t),o=e.length>0?e[0]:"",a=I("%"+o+"%",r),p=a.name,f=a.value,u=!1,c=a.alias;c&&(o=c[0],P(e,S([0,1],c)));for(var l=1,s=!0;l<e.length;l+=1){var b=e[l],g=j(b,0,1),h=j(b,-1);if(('"'===g||"'"===g||"`"===g||'"'===h||"'"===h||"`"===h)&&g!==h)throw new n("property names with quotes must have matching quotes");if("constructor"!==b&&s||(u=!0),w(d,p="%"+(o+="."+b)+"%"))f=d[p];else if(null!=f){if(!(b in f)){if(!r)throw new i("base intrinsic for "+t+" exists, but the property is not available.");return}if(y&&l+1>=e.length){var v=y(f,b);f=(s=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:f[b]}else s=w(f,b),f=f[b];s&&!u&&(d[p]=f)}}return f}},93911:(t,r,e)=>{"use strict";var o=e(38713)("%Object.getOwnPropertyDescriptor%",!0);if(o)try{o([],"length")}catch(n){o=null}t.exports=o},61211:(t,r,e)=>{"use strict";var o=e(38713)("%Object.defineProperty%",!0),n=function(){if(o)try{return o({},"a",{value:1}),!0}catch(t){return!1}return!1};n.hasArrayLengthDefineBug=function(){if(!n())return null;try{return 1!==o([],"length",{value:1}).length}catch(t){return!0}},t.exports=n},71495:t=>{"use strict";var r={foo:{}},e=Object;t.exports=function(){return{__proto__:r}.foo===r.foo&&!({__proto__:null}instanceof e)}},49211:(t,r,e)=>{"use strict";var o="undefined"!==typeof Symbol&&Symbol,n=e(22888);t.exports=function(){return"function"===typeof o&&("function"===typeof Symbol&&("symbol"===typeof o("foo")&&("symbol"===typeof Symbol("bar")&&n())))}},22888:t=>{"use strict";t.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var t={},r=Symbol("test"),e=Object(r);if("string"===typeof r)return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;for(r in t[r]=42,t)return!1;if("function"===typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==r)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,r);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},85869:(t,r,e)=>{"use strict";var o=Function.prototype.call,n=Object.prototype.hasOwnProperty,a=e(47462);t.exports=a.call(o,n)},85866:t=>{var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},33938:(t,r,e)=>{"use strict";var o=("undefined"!==typeof JSON?JSON:e(99426)).stringify,n=e(85866),a=e(4521),i=e(45807),p=e(72601),y=p("Array.prototype.join"),f=p("Array.prototype.push"),u=function(t,r){for(var e="",o=0;o<t;o+=1)e+=r;return e},c=function(t,r,e){return e};t.exports=function(t){var r=arguments.length>1?arguments[1]:void 0,e=r&&r.space||"";"number"===typeof e&&(e=u(e," "));var p=!!r&&"boolean"===typeof r.cycles&&r.cycles,l=r&&r.replacer?i(r.replacer):c,s="function"===typeof r?r:r&&r.cmp,b=s&&function(t){var r=s.length>2&&function(r){return t[r]};return function(e,o){return s({key:e,value:t[e]},{key:o,value:t[o]},r?{__proto__:null,get:r}:void 0)}},g=[];return function t(r,i,c,s){var d=e?"\n"+u(s,e):"",h=e?": ":":";if(c&&c.toJSON&&"function"===typeof c.toJSON&&(c=c.toJSON()),void 0!==(c=l(r,i,c))){if("object"!==typeof c||null===c)return o(c);if(n(c)){for(var v=[],A=0;A<c.length;A++){var m=t(c,A,c[A],s+1)||o(null);f(v,d+e+m)}return"["+y(v,",")+d+"]"}if(-1!==g.indexOf(c)){if(p)return o("__cycle__");throw new TypeError("Converting circular structure to JSON")}f(g,c);var w=a(c).sort(b&&b(c));for(v=[],A=0;A<w.length;A++){var S=t(c,i=w[A],c[i],s+1);if(S){var P=o(i)+h+S;f(v,d+e+P)}}return g.splice(g.indexOf(c),1),"{"+y(v,",")+d+"}"}}({"":t},"",t,0)}},99426:(t,r,e)=>{"use strict";r.parse=e(1329),r.stringify=e(17326)},1329:t=>{"use strict";var r,e,o,n={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function a(t){throw{name:"SyntaxError",message:t,at:r,text:o}}function i(t){return t&&t!==e&&a("Expected '"+t+"' instead of '"+e+"'"),e=o.charAt(r),r+=1,e}function p(){var t,r="";for("-"===e&&(r="-",i("-"));e>="0"&&e<="9";)r+=e,i();if("."===e)for(r+=".";i()&&e>="0"&&e<="9";)r+=e;if("e"===e||"E"===e)for(r+=e,i(),"-"!==e&&"+"!==e||(r+=e,i());e>="0"&&e<="9";)r+=e,i();return t=Number(r),isFinite(t)||a("Bad number"),t}function y(){var t,r,o,p="";if('"'===e)for(;i();){if('"'===e)return i(),p;if("\\"===e)if(i(),"u"===e){for(o=0,r=0;r<4&&(t=parseInt(i(),16),isFinite(t));r+=1)o=16*o+t;p+=String.fromCharCode(o)}else{if("string"!==typeof n[e])break;p+=n[e]}else p+=e}a("Bad string")}function f(){for(;e&&e<=" ";)i()}function u(){switch(f(),e){case"{":return function(){var t,r={};if("{"===e){if(i("{"),f(),"}"===e)return i("}"),r;for(;e;){if(t=y(),f(),i(":"),Object.prototype.hasOwnProperty.call(r,t)&&a('Duplicate key "'+t+'"'),r[t]=u(),f(),"}"===e)return i("}"),r;i(","),f()}}a("Bad object")}();case"[":return function(){var t=[];if("["===e){if(i("["),f(),"]"===e)return i("]"),t;for(;e;){if(t.push(u()),f(),"]"===e)return i("]"),t;i(","),f()}}a("Bad array")}();case'"':return y();case"-":return p();default:return e>="0"&&e<="9"?p():function(){switch(e){case"t":return i("t"),i("r"),i("u"),i("e"),!0;case"f":return i("f"),i("a"),i("l"),i("s"),i("e"),!1;case"n":return i("n"),i("u"),i("l"),i("l"),null;default:a("Unexpected '"+e+"'")}}()}}t.exports=function(t,n){var i;return o=t,r=0,e=" ",i=u(),f(),e&&a("Syntax error"),"function"===typeof n?function t(r,e){var o,a,i=r[e];if(i&&"object"===typeof i)for(o in u)Object.prototype.hasOwnProperty.call(i,o)&&("undefined"===typeof(a=t(i,o))?delete i[o]:i[o]=a);return n.call(r,e,i)}({"":i},""):i}},17326:t=>{"use strict";var r,e,o,n=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function i(t){return n.lastIndex=0,n.test(t)?'"'+t.replace(n,(function(t){var r=a[t];return"string"===typeof r?r:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+t+'"'}function p(t,n){var a,y,f,u,c,l=r,s=n[t];switch(s&&"object"===typeof s&&"function"===typeof s.toJSON&&(s=s.toJSON(t)),"function"===typeof o&&(s=o.call(n,t,s)),typeof s){case"string":return i(s);case"number":return isFinite(s)?String(s):"null";case"boolean":case"null":return String(s);case"object":if(!s)return"null";if(r+=e,c=[],"[object Array]"===Object.prototype.toString.apply(s)){for(u=s.length,a=0;a<u;a+=1)c[a]=p(a,s)||"null";return f=0===c.length?"[]":r?"[\n"+r+c.join(",\n"+r)+"\n"+l+"]":"["+c.join(",")+"]",r=l,f}if(o&&"object"===typeof o)for(u=o.length,a=0;a<u;a+=1)"string"===typeof(y=o[a])&&(f=p(y,s))&&c.push(i(y)+(r?": ":":")+f);else for(y in s)Object.prototype.hasOwnProperty.call(s,y)&&(f=p(y,s))&&c.push(i(y)+(r?": ":":")+f);return f=0===c.length?"{}":r?"{\n"+r+c.join(",\n"+r)+"\n"+l+"}":"{"+c.join(",")+"}",r=l,f}}t.exports=function(t,n,a){var i;if(r="",e="","number"===typeof a)for(i=0;i<a;i+=1)e+=" ";else"string"===typeof a&&(e=a);if(o=n,n&&"function"!==typeof n&&("object"!==typeof n||"number"!==typeof n.length))throw new Error("JSON.stringify");return p("",{"":t})}},54652:(t,r,e)=>{"use strict";var o;if(!Object.keys){var n=Object.prototype.hasOwnProperty,a=Object.prototype.toString,i=e(18076),p=Object.prototype.propertyIsEnumerable,y=!p.call({toString:null},"toString"),f=p.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(t){var r=t.constructor;return r&&r.prototype===t},l={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},s=function(){if("undefined"===typeof window)return!1;for(var t in window)try{if(!l["$"+t]&&n.call(window,t)&&null!==window[t]&&"object"===typeof window[t])try{c(window[t])}catch(r){return!0}}catch(r){return!0}return!1}();o=function(t){var r=null!==t&&"object"===typeof t,e="[object Function]"===a.call(t),o=i(t),p=r&&"[object String]"===a.call(t),l=[];if(!r&&!e&&!o)throw new TypeError("Object.keys called on a non-object");var b=f&&e;if(p&&t.length>0&&!n.call(t,0))for(var g=0;g<t.length;++g)l.push(String(g));if(o&&t.length>0)for(var d=0;d<t.length;++d)l.push(String(d));else for(var h in t)b&&"prototype"===h||!n.call(t,h)||l.push(String(h));if(y)for(var v=function(t){if("undefined"===typeof window||!s)return c(t);try{return c(t)}catch(r){return!1}}(t),A=0;A<u.length;++A)v&&"constructor"===u[A]||!n.call(t,u[A])||l.push(u[A]);return l}}t.exports=o},4521:(t,r,e)=>{"use strict";var o=Array.prototype.slice,n=e(18076),a=Object.keys,i=a?function(t){return a(t)}:e(54652),p=Object.keys;i.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return n(t)?p(o.call(t)):p(t)})}else Object.keys=i;return Object.keys||i},t.exports=i},18076:t=>{"use strict";var r=Object.prototype.toString;t.exports=function(t){var e=r.call(t),o="[object Arguments]"===e;return o||(o="[object Array]"!==e&&null!==t&&"object"===typeof t&&"number"===typeof t.length&&t.length>=0&&"[object Function]"===r.call(t.callee)),o}},14580:(t,r,e)=>{"use strict";var o=e(38713),n=e(8840),a=e(61211)(),i=e(93911),p=o("%TypeError%"),y=o("%Math.floor%");t.exports=function(t,r){if("function"!==typeof t)throw new p("`fn` is not a function");if("number"!==typeof r||r<0||r>4294967295||y(r)!==r)throw new p("`length` must be a positive 32-bit integer");var e=arguments.length>2&&!!arguments[2],o=!0,f=!0;if("length"in t&&i){var u=i(t,"length");u&&!u.configurable&&(o=!1),u&&!u.writable&&(f=!1)}return(o||f||!e)&&(a?n(t,"length",r,!0,!0):n(t,"length",r)),t}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6511],{86511:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ae});var a=n(71171),i=n(5057),o=n(33518),l=n(85493),s=n(15849),c=n(68420),r=n(82084),d=n(59793),u=n(47125),p=n(31765),m=n(94464),v=n(88574),h=n(28726),g=n(38242),b=n(81010),f=n(87363),y=(n(5892),n(86229)),k=n(1722),x=n(87543),w=n(35432),P=n(27212),j=n(58238),S=n(29054),B=n(73545),Z=n(14491),C=n(4651),E=n(96266);const L=e=>{const t={};let n=null;return(0,g.forEachBlockletSync)(e,(e=>{t[e.meta.bundleDid]?n=(0,g.getDisplayName)(e,!0):e.meta.bundleDid&&(t[e.meta.bundleDid]=!0)})),n},_=(e,t,n)=>{const{hostname:a,href:i}=e;if(!t)return i;if(n){var o;const e=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(a);if(!e)return i;const n=e[0],l=(((null===(o=t.site)||void 0===o?void 0:o.domainAliases)||[]).map((e=>e.value)).filter(Boolean).find((e=>e.endsWith(w.DEFAULT_DID_DOMAIN)))||"").replace(".".concat(w.DEFAULT_DID_DOMAIN),"");return l?i.replace(a,"".concat(l,"-").concat(n,".").concat(w.DEFAULT_IP_DOMAIN_SUFFIX)):i}return i.replace(t.meta.bundleDid,t.appPid)};function D(){const{t:e}=(0,c.PE)(),{api:t}=(0,B.T)(),{blocklet:n}=(0,S.y0)(),{inService:a}=(0,j.h6)(),[o,l]=(0,i.useState)(!1),[s,r]=(0,i.useState)(5),d=n&&n.structVersion!==w.APP_STRUCT_VERSION;return[d&&(0,E.jsxs)(v.Z,{type:"warning",style:{margin:"12px 0"},children:[(0,E.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,E.jsx)(h.Z,{variant:"contained",size:"small",color:"primary",onClick:()=>(()=>{try{if("running"===n.status)return void y.Z.error(e("blocklet.migrate.tip.running"));const t=L(n);if(t)return void y.Z.error(e("blocklet.migrate.tip.duplicate",{name:t}));l(!0)}catch(t){y.Z.error((0,Z.Z)(t))}})(),style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),(0,E.jsx)("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map((t=>(0,E.jsx)(x.Z,{display:"flex",alignItems:"center",children:e("blocklet.migrate.intro.".concat(t))},t)))]},"alert"),n&&(0,E.jsx)(P.Z,{popup:!0,open:o,saveConnect:!1,forceConnected:!1,action:"migrate-app-to-struct-v2",checkFn:t.get,checkTimeout:3e5,onSuccess:()=>{const e=_(window.location,n,a);setTimeout((()=>{window.location.href=e}),5e3),r(5),setInterval((()=>{r((e=>e-1))}),1e3)},extraParams:{appDid:n.appDid,did:n.meta.did,wt:(0,C.iK)(n,!0),title:(0,g.getDisplayName)(n)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:s>=0?e("blocklet.migrate.success",{sec:s}):"Redirecting..."},onClose:()=>l(!1)},"connect")]}D.propTypes={};var A,N=n(35966),G=n(85531),U=n(13798),T=n(78123),I=n(75793),O=n(17022),K=n(21289),z=n(74094),R=n(7199);const F=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(2739),n.e(730),n.e(4549)]).then(n.bind(n,64549)))),M=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(2739),n.e(8537),n.e(4631),n.e(2294),n.e(1279),n.e(6547),n.e(3748),n.e(6296),n.e(506),n.e(6240),n.e(5545),n.e(345),n.e(6230)]).then(n.bind(n,64558)))),V=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(2739),n.e(4631),n.e(6547),n.e(6296),n.e(6771),n.e(506),n.e(6281),n.e(6240),n.e(1255),n.e(5462),n.e(4775)]).then(n.bind(n,14775)))),Y=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(6771),n.e(442),n.e(9636),n.e(7676),n.e(3239)]).then(n.bind(n,13239)))),$=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(2739),n.e(6406),n.e(7109),n.e(6974),n.e(5979),n.e(2537)]).then(n.bind(n,75979)))),W=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(2739),n.e(8537),n.e(4631),n.e(2294),n.e(1279),n.e(6547),n.e(3748),n.e(9364),n.e(5672),n.e(5217)]).then(n.bind(n,75672)))),X=(0,i.lazy)((()=>Promise.all([n.e(8537),n.e(4631),n.e(2294),n.e(1279),n.e(5539),n.e(4335),n.e(5015)]).then(n.bind(n,85555)))),J=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(2739),n.e(8537),n.e(4631),n.e(2294),n.e(1279),n.e(6296),n.e(2251),n.e(2911),n.e(5539),n.e(6406),n.e(442),n.e(5526),n.e(7109),n.e(6076),n.e(4335),n.e(9811),n.e(7558),n.e(5545),n.e(5165),n.e(1846),n.e(318)]).then(n.bind(n,20318)))),Q=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(7998),n.e(8219)]).then(n.bind(n,92379)))),q=(0,i.lazy)((()=>Promise.all([n.e(8537),n.e(4631),n.e(2294),n.e(1279),n.e(6547),n.e(3748),n.e(6296),n.e(7534)]).then(n.bind(n,87534)))),H=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(2739),n.e(6296),n.e(2251),n.e(5539),n.e(7560),n.e(2611)]).then(n.bind(n,42611)))),ee=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(2739),n.e(8537),n.e(4631),n.e(2294),n.e(1279),n.e(6547),n.e(3748),n.e(9940),n.e(1846),n.e(9552)]).then(n.bind(n,39552)))),te=e=>{let{children:t}=e;return t};function ne(){var e;const t=(0,l.useNavigate)(),{tab:n="overview"}=(0,l.useParams)(),{did:a,blocklet:o,error:x,client:P,actions:{setBlocklet:j,refreshBlocklet:S}}=(0,K.y0)(),{refresh:B}=(0,I.h6)(),{t:Z}=(0,c.PE)(),C=(0,i.useCallback)((()=>(0,E.jsx)(Y,{scope:a})),[a]),L=(null===o||void 0===o||null===(e=o.environments.find((e=>"BLOCKLET_APP_URL"===e.key)))||void 0===e?void 0:e.value)||window.location.origin,_=e=>(0,z.bV)(e,L),A=e=>{t("/blocklets/".concat(a,"/").concat(e))},G=e=>{e&&j(e),S()},ne=!o||(0,z.wS)(o.status)?[]:(0,g.getAppMissingConfigs)(o);let ae=null;const oe=[{label:Z("common.overview"),value:"overview"},{breadcrumbsLabel:Z("common.components"),label:(0,E.jsx)(p.Z,{color:"error",variant:"dot",invisible:!ne.length,children:Z("common.components")}),value:"components"}];if(x)ae=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(v.Z,{type:"error",variant:"icon",children:(0,z.Z)(x)}),(0,E.jsx)(h.Z,{onClick:()=>S(),children:(0,E.jsx)("span",{style:{textDecoration:"underline"},children:Z("common.retry")})})]});else if(o){var le;const e={overview:(0,E.jsx)(F,{}),configuration:M,navigation:V,services:X,members:(0,E.jsx)(W,{type:"blocklet",createPassportSvg:_}),passports:$,components:J,"audit-logs":C,logs:Q,runtime:(0,E.jsx)(q,{}),traffic:(0,E.jsx)(H,{client:P,did:a}),storage:(0,E.jsx)(ee,{})};"configuration"===n&&(0,z.wS)(o.status)&&A("overview"),(0,z.wS)(o.status)||(oe.push({label:Z("common.members"),value:"members"}),oe.push({label:Z("common.passport"),value:"passports"}),oe.push({label:Z("common.configuration"),value:"configuration"})),oe.push({label:Z("common.auditLogs"),value:"audit-logs"}),o&&null!==(le=o.children)&&void 0!==le&&le.length&&o.structVersion===w.APP_STRUCT_VERSION&&oe.push({label:Z("common.logs"),value:"logs"}),oe.push({label:Z("common.configNavigation"),value:"navigation"}),oe.push({label:Z("common.runtime"),value:"runtime"}),oe.push({label:Z("common.traffic"),value:"traffic"}),oe.push({label:Z("common.storage"),value:"storage"});(0,g.getBlockletServices)(o).length&&oe.splice(2,0,{label:Z("blocklet.services"),value:"services"});const t=e[n]||e.overview;ae=(0,E.jsxs)(f.g,{type:"components",children:[!(0,g.isExternalBlocklet)(o)&&(0,E.jsx)(m.Z,{tabs:oe,current:n,onChange:A,scrollButtons:"auto"}),(0,E.jsx)("div",{className:"page-content",children:(0,E.jsx)(i.Suspense,{fallback:(0,E.jsx)(N.Z,{relative:"parent",children:(0,E.jsx)(U.Z,{})}),children:(0,i.isValidElement)(t)?t:(0,E.jsx)(t,{blocklet:o,onUpdate:G,createPassportSvg:_})})})]})}else ae=(0,E.jsx)(N.Z,{relative:"parent",children:(0,E.jsx)(U.Z,{})});const se=oe.find((e=>e.value===n)),ce=o?O.G6:te;return(0,E.jsx)(ce,{teamDid:a,children:(0,E.jsxs)(ie,{children:[(0,E.jsxs)(d.Z,{separator:"\u203a","aria-label":"breadcrumb",className:"page-breadcrumb",children:[(0,E.jsx)(s.Link,{color:"textSecondary",to:"/blocklets",children:Z("common.blocklets")}),(0,E.jsx)(s.NavLink,{to:"/blocklets/".concat(a,"/overview"),style:e=>e?{color:"inherit"}:{},children:Z("common.detail")}),(0,E.jsx)(r.Z,{color:"textSecondary",children:se?se.breadcrumbsLabel||se.label:""})]}),(0,E.jsxs)(r.Z,{component:"div",className:"page-header",children:[(0,E.jsxs)(r.Z,{component:"h2",variant:"h4",className:"page-title",color:"textPrimary",children:[o?(0,E.jsx)(k.Z,{blocklet:o,style:{marginRight:16}}):null,o?(0,E.jsxs)(u.Z,{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,children:[(0,E.jsx)(u.Z,{children:(0,g.getDisplayName)(o)}),"unknown"!==(null===o||void 0===o?void 0:o.status)&&(0,E.jsx)(b.Z,{size:"12px",status:o.status,source:o.source,progress:o.progress})]}):"".concat(Z("common.blocklet")," ").concat(Z("common.detail"))]}),(0,E.jsx)(R.Z,{permission:"mutate_blocklets",children:!!o&&!(0,g.isExternalBlocklet)(o)&&(0,E.jsx)(T.Z,{className:"page-actions",blocklet:o,onStart:()=>{},onComplete:e=>{let{action:n,error:a}=e;a?y.Z.error(a.message):"remove"===n?(B(),t("/blocklets")):S()},variant:"group"})})]}),(0,E.jsx)(D,{}),ae]})})}function ae(){const{did:e}=(0,l.useParams)();return e?(0,E.jsx)(K.$8,{did:e,children:(0,E.jsx)(G.wV,{children:(0,E.jsx)(ne,{})})}):null}const ie=o.Z.main(A||(A=(0,a.Z)(["\n .page-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-wrap: wrap;\n gap: 16px;\n }\n\n .page-title {\n display: flex;\n align-items: center;\n\n .page-link {\n font-size: 15px;\n margin-top: 8px;\n margin-left: 8px;\n }\n }\n\n .page-content {\n margin-top: 16px;\n }\n\n @media (max-width: ","px) {\n .page-header {\n flex-direction: column;\n align-items: flex-start;\n .page-actions,\n .MuiButtonGroup-root {\n width: 100%;\n }\n .MuiButtonGroup-root {\n .MuiButtonBase-root {\n flex: 1;\n }\n .blocklet-action-text {\n display: none;\n }\n }\n }\n\n .page-title {\n margin-bottom: 15px;\n }\n }\n"])),(e=>e.theme.breakpoints.values.md))},85531:(e,t,n)=>{n.d(t,{wV:()=>w,XN:()=>P});var a=n(5057),i=n(55898),o=n.n(i),l=n(86229),s=n(68420),c=n(77277),r=n(29054),d=n(84584),u=n(41899),p=n(58238),m=n(65873);var v=n(14491);function h(){var e;let{setLoading:t,refresh:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{blocklet:i,actions:{refreshBlocklet:o}}=(0,r.y0)(),s=null===i||void 0===i||null===(e=i.meta)||void 0===e?void 0:e.did,[c,h]=(0,a.useState)([]),{api:g}=(0,p.h6)();return(0,u.Z)((async()=>{try{if(!s)return void h([]);null===t||void 0===t||t(!0);const{spaceGateways:e}=await g.getBlockletSpaceGateways({input:{did:s}}),n=await async function(e){let{blockletDid:t,nodeApi:n,spaceGateways:a}=e,i=!1;const o=await Promise.all(a.map((async e=>{let{name:t}=e;const n=await(0,d.nU)(e.endpoint);return(0,m.isEmpty)(n)||n===t||(t=n,i=!0),{...e,name:t}})));return i&&await Promise.all(o.filter((e=>e.did)).map((e=>n.updateBlockletSpaceGateway({input:{did:t,where:{did:e.did},spaceGateway:{...e}}})))),o}({blockletDid:s,nodeApi:g,spaceGateways:e});h(null!==n&&void 0!==n?n:[])}catch(e){console.error(e),l.Z.error((0,v.Z)(e))}finally{null===t||void 0===t||t(!1)}}),[s,o,n]),{spaceGateways:c}}function g(){var e;let{deps:t,setLoading:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{deps:[],setLoading:()=>{}};const{blocklet:i}=(0,r.y0)(),[o,s]=(0,a.useState)([]),{api:c}=(0,p.h6)(),d=(0,m.debounce)((async()=>{try{if(n(!0),!i)return void s([]);const{backups:e}=await c.getBlockletBackups({input:{did:i.meta.did}});s(null!==e&&void 0!==e?e:[])}catch(e){console.error(e),l.Z.error((0,v.Z)(e))}finally{n(!1)}}),2e3);return(0,u.Z)((async()=>{d()}),[null===i||void 0===i||null===(e=i.meta)||void 0===e?void 0:e.did].concat(t)),{backups:o}}const b=function(e){let{appDid:t}=e;const{backups:n}=g(),[i,o]=(0,a.useState)({message:"",progress:0,completed:!1}),l=(0,p.h6)(),{ws:{useSubscription:s}}=l;return s(c.BlockletEvents.backupProgress,(e=>{t===(null===e||void 0===e?void 0:e.appDid)&&o((()=>({...e})))}),[t]),(0,a.useEffect)((()=>{var e;if(null!==n&&void 0!==n&&n.length&&(0,m.isNull)(null===(e=n[0])||void 0===e?void 0:e.status)){const[e]=n;o((()=>({message:e.message,progress:e.progress,completed:Boolean(e.progress>=100)})))}}),[n]),i};var f=n(96266);const y=(0,a.createContext)({}),{Provider:k,Consumer:x}=y;function w(e){let{children:t}=e;const{t:n}=(0,s.PE)(),{api:i}=(0,p.h6)(),{blocklet:o}=(0,r.y0)(),[m,v]=(0,a.useState)(!1),[y,x]=(0,a.useState)(!1),{spaceGateways:w}=h({refresh:y,setLoading:v}),P=b({appDid:null===o||void 0===o?void 0:o.appDid}),[j,S]=(0,a.useState)(!1),B=(0,a.useMemo)((()=>(0,d.mo)(null===o||void 0===o?void 0:o.environments)),[o,y,j]),[Z,C]=(0,a.useState)(!1),{backups:E}=g({deps:[P],setLoading:C}),[L,_]=(0,a.useState)(null===w||void 0===w?void 0:w.find((e=>e.endpoint===B))),[D,A]=(0,a.useState)(!1),N=function(){var e;let{deps:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{deps:[]};const{blocklet:n}=(0,r.y0)(),{api:i}=(0,p.h6)(),[o,l]=(0,a.useState)(null);return(0,u.Z)((async()=>{var e;if(null!==n&&void 0!==n&&null!==(e=n.meta)&&void 0!==e&&e.did){const{autoBackup:e}=await i.getAutoBackup({input:{did:n.meta.did}});l(e)}}),[null===n||void 0===n||null===(e=n.meta)||void 0===e?void 0:e.did].concat(t)),o}({deps:[D]}),[G,U]=(0,a.useState)(!1),T=function(){var e;let{deps:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{deps:[]};const{blocklet:n}=(0,r.y0)(),{api:i}=(0,p.h6)(),[o,l]=(0,a.useState)(null);return(0,u.Z)((async()=>{var e;if(null!==n&&void 0!==n&&null!==(e=n.meta)&&void 0!==e&&e.did){const{autoCheckUpdate:e}=await i.getAutoCheckUpdate({input:{did:n.meta.did}});l(e)}}),[null===n||void 0===n||null===(e=n.meta)||void 0===e?void 0:e.did].concat(t)),o}({deps:[G]}),I=()=>{x((e=>!e))};return(0,f.jsx)(k,{value:{spaceGateways:w,selectedSpaceGateway:L,addSpaceGateway:async(e,t)=>{w.push({...e,loading:!0}),await i.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:e}}),B!==t&&await i.configBlocklet({input:{did:[o.meta.did],configs:[{key:c.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t}]}}),I(),_(e)},deleteSpaceGateway:async e=>{e&&(e.endpoint!==B?(await i.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:null===e||void 0===e?void 0:e.did}}),I(),_(e)):l.Z.warning(n("storage.spaces.gateway.delete.failedForConnected")))},updateSpaceGateway:async e=>{var t;await i.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:e.did},spaceGateway:e}}),B!==e.endpoint&&await i.configBlocklet({input:{did:[o.meta.did],configs:[{key:c.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:e.endpoint}]}}),l.Z.success(n("storage.spaces.connectedWithName",{name:null!==(t=null===e||void 0===e?void 0:e.name)&&void 0!==t?t:"DID Spaces"})),I()},refreshSpaceGateways:I,spaceGatewaysLoading:m,spaceGatewayIsSelected:e=>(null===e||void 0===e?void 0:e.endpoint)===B,updateAutoBackup:async e=>{await i.updateAutoBackup({input:{did:o.meta.did,autoBackup:e}}),A((e=>!e))},updateAutoCheckUpdate:async e=>{await i.updateAutoCheckUpdate({input:{did:o.meta.did,autoCheckUpdate:e}}),U((e=>!e))},autoCheckUpdate:T,backupEndpoint:B,backupProgress:P,backups:E,backupsLoading:Z,refreshBackupEndpoint:()=>{S((e=>!e))},autoBackup:N},children:t})}function P(){return(0,a.useContext)(y)}w.propTypes={children:o().any.isRequired},w.defaultProps={}},60344:(e,t,n)=>{n.d(t,{hi:()=>o,od:()=>i.a});var a=n(10458),i=n.n(a);i().defaults.timeout=1e4;const o=i().create()},84584:(e,t,n)=>{n.d(t,{EJ:()=>f,Jf:()=>b,LQ:()=>u,Nb:()=>p,UV:()=>y,Xv:()=>r,Z3:()=>k,ag:()=>v,mo:()=>m,nD:()=>d,nU:()=>g,w2:()=>h});var a=n(82434),i=n.n(a),o=n(77277),l=n(65873),s=n(2842),c=n(60344);function r(e){const t=e.replace(/\/api\/space\/.+/,""),n=e.replace(/\/$/,"").split("/"),a=n.at(-4),i=n.at(-2);return(0,s.xn)(t,"space",a,"apps",i,"explorer?key=/apps/".concat(i,"/.did-objects/").concat(i,"/"))}function d(e){const t=e.replace(/\/api\/space\/.+/,""),n=e.replace(/\/$/,"").split("/").at(-4);return(0,s.xn)(t,"space",n)}function u(e){return e.replace(/\/$/,"").split("/").at(-4)}async function p(e){try{if(!i()(e))return!1;const{headers:t}=await c.hi.head(e,{timeout:5e3});return"true"===t["x-listable"]&&"true"===t["x-readable"]&&"true"===t["x-writeable"]}catch(t){return console.error(t),!1}}function m(e){var t;return(null===e||void 0===e||null===(t=e.find((e=>e.key===o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT)))||void 0===t?void 0:t.value)||""}function v(e){const t=new URL(e);return(0,s.xn)(t.origin,t.pathname)}async function h(e){try{if(!i()(e))return!1;const t=v(e),n=(0,s.xn)(t,"space/api/did/one-click-authorization/token"),{status:a,data:o}=await c.hi.get(n,{timeout:5e3});return 200===a&&(0,l.isObject)(o)}catch(t){return console.error(t),!1}}async function g(e){let{timeout:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeout:3e3};try{if(!i()(e))return"";const{headers:n}=await c.hi.head(e,{timeout:t}),a=n["x-space-name"];return a?decodeURIComponent(a):""}catch(n){return console.error(n),""}}function b(e){const t=e.replace(/\/api\/space\/.+/,""),n=e.replace(/\/$/,"").split("/").at(-4);return(0,s.xn)(t,"/api/space/nft/display?spaceDid=".concat(n))}const f=e=>{var t,n;return(null===e||void 0===e||null===(t=e.configs)||void 0===t||null===(n=t.find((e=>e.key===o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)))||void 0===n?void 0:n.value)||null};async function y(e){const t={};return t.did=u(e),t.name=await g(e),t.url=function(e){return null===e||void 0===e?void 0:e.replace(/\/api\/space\/.+/,"")}(e),t.endpoint=e,t}async function k(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeout:3e4,withSearchParams:!0};if(!(0,l.isString)(e))throw new Error("url(".concat(e,") must be a string"));const a=e.startsWith("http")?e:"https://".concat(e),i=new URL(a),{data:o}=await c.hi.get((0,s.xn)(i.origin,"/__blocklet__.js?type=json"),{timeout:n.timeout}),r=null===(t=o.componentMountPoints.findLast((e=>"z8iZnaYxnkMD5AKRjTKiCb8pQr1ut8UantAcf"===e.did)))||void 0===t?void 0:t.mountPoint;if(!r)throw new Error("MountPoint(".concat(r,") not found"));const d=(0,s.xn)(i.origin,r);return n.withSearchParams&&i.searchParams.get("spaceDid")?(0,s.xn)(d,"?spaceDid=".concat(i.searchParams.get("spaceDid"))):d}}}]);
|