@abtnode/blocklet-services 1.16.21-beta-e828f413 → 1.16.21-beta-bd0e2503
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/dist/assets/{Add-280b55d6.js → Add-0fa52156.js} +1 -1
- package/dist/assets/{Alert-18856afa.js → Alert-037193c9.js} +1 -1
- package/dist/assets/{ArrowDropDown-0147576b.js → ArrowDropDown-72517964.js} +1 -1
- package/dist/assets/{Autocomplete-033ea918.js → Autocomplete-a10f99e0.js} +1 -1
- package/dist/assets/{Avatar-6a058f2c.js → Avatar-45cfefc3.js} +1 -1
- package/dist/assets/{ButtonGroup-0a58968f.js → ButtonGroup-f91d24e2.js} +1 -1
- package/dist/assets/{CardContent-a3c41a0c.js → CardContent-3db164ef.js} +1 -1
- package/dist/assets/{CheckCircle-420400e3.js → CheckCircle-272b0fa1.js} +1 -1
- package/dist/assets/{Checkbox-92349aed.js → Checkbox-e5abf3e7.js} +1 -1
- package/dist/assets/{ChevronRight-9d781657.js → ChevronRight-ad424d62.js} +1 -1
- package/dist/assets/{DeleteOutline-9e947dc9.js → DeleteOutline-9cba8fb2.js} +1 -1
- package/dist/assets/{DialogContentText-ef0138ce.js → DialogContentText-83546651.js} +1 -1
- package/dist/assets/{Done-70ebcf6d.js → Done-515b6971.js} +1 -1
- package/dist/assets/{Download-ccbc24f3.js → Download-2be25bd9.js} +1 -1
- package/dist/assets/{Edit-863e159a.js → Edit-acf0e713.js} +1 -1
- package/dist/assets/{EditIcon-12f4ff59.js → EditIcon-9f26e207.js} +1 -1
- package/dist/assets/{ExpandMore-5e89e7bd.js → ExpandMore-affb00ec.js} +1 -1
- package/dist/assets/{FilterList-7817f456.js → FilterList-4d23556a.js} +1 -1
- package/dist/assets/{FormControl-4556d3f8.js → FormControl-776d5fa1.js} +1 -1
- package/dist/assets/{FormControlLabel-a7fff241.js → FormControlLabel-2ee3fa4b.js} +1 -1
- package/dist/assets/{FormGroup-d856dc86.js → FormGroup-502e9f4e.js} +1 -1
- package/dist/assets/{Google-d28b2347.js → Google-8aa094b0.js} +1 -1
- package/dist/assets/{Grid-dcf85761.js → Grid-e588a591.js} +1 -1
- package/dist/assets/{Hidden-4067f85a.js → Hidden-4855abd5.js} +1 -1
- package/dist/assets/{Icon-ad9c5b26.js → Icon-7576b0de.js} +1 -1
- package/dist/assets/{InfoOutlined-da2cfef7.js → InfoOutlined-516f0f5e.js} +1 -1
- package/dist/assets/{InputAdornment-65e20722.js → InputAdornment-6977d85a.js} +1 -1
- package/dist/assets/{InputLabel-b97f286b.js → InputLabel-4899f2ad.js} +1 -1
- package/dist/assets/{LastPage-830dc7b7.js → LastPage-68881e08.js} +1 -1
- package/dist/assets/{Launch-c5a2e753.js → Launch-40ac7bb5.js} +1 -1
- package/dist/assets/{LaunchOutlined-fbf3b2b2.js → LaunchOutlined-f2e3acb1.js} +1 -1
- package/dist/assets/{ListItem-1faf6af2.js → ListItem-768ed029.js} +1 -1
- package/dist/assets/{LockIcon-5bf90304.js → LockIcon-f7bc794a.js} +1 -1
- package/dist/assets/{Loop-4b03c2e0.js → Loop-74bde14b.js} +1 -1
- package/dist/assets/{MoreVert-b4ec66e0.js → MoreVert-07b57b33.js} +1 -1
- package/dist/assets/{OpenInNew-e91f9d7e.js → OpenInNew-acb47561.js} +1 -1
- package/dist/assets/{Pagination-babd41d1.js → Pagination-fc24638e.js} +1 -1
- package/dist/assets/{PlayArrow-b569df74.js → PlayArrow-d3193b6d.js} +1 -1
- package/dist/assets/{RadioGroup-c422200c.js → RadioGroup-3beb2b33.js} +1 -1
- package/dist/assets/{Search-29f3b44d.js → Search-d3d559ed.js} +1 -1
- package/dist/assets/{Select-3544f27a.js → Select-c9c71312.js} +1 -1
- package/dist/assets/{ServerLogo-cd4b028b.js → ServerLogo-6cf48c4f.js} +1 -1
- package/dist/assets/{Slider-fb0e6a6c.js → Slider-6bcdb3ad.js} +1 -1
- package/dist/assets/{Stepper-e3579a23.js → Stepper-58c95989.js} +1 -1
- package/dist/assets/{Switch-3533da1c.js → Switch-572c6623.js} +1 -1
- package/dist/assets/{TableRow-d12808ad.js → TableRow-2ff7461b.js} +1 -1
- package/dist/assets/{TextField-3d8b540c.js → TextField-9def9dd1.js} +1 -1
- package/dist/assets/{Toolbar-63186941.js → Toolbar-58430b9d.js} +1 -1
- package/dist/assets/{access-control-b2ba0303.js → access-control-17d1ef9c.js} +1 -1
- package/dist/assets/{actions-1c072ea2.js → actions-6a1d12bc.js} +1 -1
- package/dist/assets/{add-component-core-2a808729.js → add-component-core-0b1b4342.js} +1 -1
- package/dist/assets/add-resource-6825acb3.js +1 -0
- package/dist/assets/{addon-2882fd1c.js → addon-6378289d.js} +1 -1
- package/dist/assets/{analytics-f360a10e.js → analytics-41b1c113.js} +1 -1
- package/dist/assets/api-75ef978a.js +1 -0
- package/dist/assets/{audit-logs-da4fd599.js → audit-logs-aa0926e8.js} +1 -1
- package/dist/assets/{button-b114c402.js → button-b9e224ed.js} +1 -1
- package/dist/assets/{click-to-copy-d2e126fa.js → click-to-copy-011eba01.js} +1 -1
- package/dist/assets/{complete-07d681f3.js → complete-c2324df2.js} +1 -1
- package/dist/assets/{component-d565750a.js → component-a8ae0bd3.js} +1 -1
- package/dist/assets/{config-ce013610.js → config-1833951a.js} +1 -1
- package/dist/assets/{config-70b23d9e.js → config-d5e2cf8e.js} +1 -1
- package/dist/assets/{config-navigation-90a993c6.js → config-navigation-753fcb5c.js} +1 -1
- package/dist/assets/{confirm-2f20e316.js → confirm-0a872969.js} +1 -1
- package/dist/assets/{confirm-59642196.js → confirm-37e025f8.js} +1 -1
- package/dist/assets/{connect-1437aa9e.js → connect-a95acc3b.js} +1 -1
- package/dist/assets/{connect-127e0b85.js → connect-fe6d1f89.js} +1 -1
- package/dist/assets/{content-layout-80ff1eb2.js → content-layout-3e926711.js} +1 -1
- package/dist/assets/{dashboard-b2b1d1e1.js → dashboard-adcdef94.js} +2 -2
- package/dist/assets/{did-address-deca4ec1.js → did-address-75f80f5d.js} +1 -1
- package/dist/assets/{did-utils-163d9ee1.js → did-utils-4012db50.js} +1 -1
- package/dist/assets/domain-e4165149.js +9 -0
- package/dist/assets/domain-list-8a8a0d19.js +12 -0
- package/dist/assets/{exchange-passport-266caf87.js → exchange-passport-488fb54a.js} +1 -1
- package/dist/assets/{fallback-27e04c22.js → fallback-e6908990.js} +1 -1
- package/dist/assets/{format-error-86f361f1.js → format-error-89fc5b13.js} +1 -1
- package/dist/assets/{fuel-e62977ca.js → fuel-8062b1cb.js} +1 -1
- package/dist/assets/{home-8a5b734d.js → home-e193c644.js} +1 -1
- package/dist/assets/{iframe-6a308731.js → iframe-fa15b0d6.js} +1 -1
- package/dist/assets/{index-4010c313.js → index-03db2990.js} +1 -1
- package/dist/assets/{index-a76e3a95.js → index-0ce26e3b.js} +1 -1
- package/dist/assets/{index-b4384904.js → index-110fb170.js} +1 -1
- package/dist/assets/{index-51dd35dc.js → index-171ab69f.js} +1 -1
- package/dist/assets/{index-f602c035.js → index-24e445a7.js} +1 -1
- package/dist/assets/{index-79a0407d.js → index-2580c7d8.js} +1 -1
- package/dist/assets/{index-cf61f7db.js → index-2668c3ea.js} +5 -5
- package/dist/assets/{index-c78d61fc.js → index-2c4ca7b3.js} +1 -1
- package/dist/assets/{index-035e11b9.js → index-32a94750.js} +1 -1
- package/dist/assets/{index-997aa7a6.js → index-35962c8a.js} +1 -1
- package/dist/assets/{index-013c3cfd.js → index-408ef489.js} +1 -1
- package/dist/assets/{index-1202a7b7.js → index-45230b38.js} +1 -1
- package/dist/assets/{index-6c3c2979.js → index-4b84d3b2.js} +1 -1
- package/dist/assets/{index-0473b500.js → index-4effadb2.js} +1 -1
- package/dist/assets/{index-894d7b33.js → index-4f076ed3.js} +1 -1
- package/dist/assets/{index-ea69217a.js → index-5e26b138.js} +1 -1
- package/dist/assets/{index-cedf1548.js → index-74681384.js} +1 -1
- package/dist/assets/{index-0c77b65e.js → index-78c79b7d.js} +1 -1
- package/dist/assets/{index-9f3316ac.js → index-7cfe9bef.js} +12 -12
- package/dist/assets/{index-10f7644c.js → index-82b46fb5.js} +1 -1
- package/dist/assets/{index-8641a8fb.js → index-95ed5c0e.js} +1 -1
- package/dist/assets/{index-752c69a0.js → index-9871b95b.js} +2 -2
- package/dist/assets/{index-118e2531.js → index-ab44e574.js} +1 -1
- package/dist/assets/{index-304ff849.js → index-c014ee1d.js} +1 -1
- package/dist/assets/{index-3d5c8add.js → index-ed3b9f25.js} +1 -1
- package/dist/assets/{index-cdb9820e.js → index-f112ae7e.js} +1 -1
- package/dist/assets/{index-47788371.js → index-f2a9779e.js} +1 -1
- package/dist/assets/{index-9ca240c4.js → index-f43e988e.js} +2 -2
- package/dist/assets/{index.es-b04262e4.js → index.es-c9de3081.js} +1 -1
- package/dist/assets/{index.esm-670d1e23.js → index.esm-3acd0530.js} +1 -1
- package/dist/assets/{invite-14ea792e.js → invite-46602c25.js} +1 -1
- package/dist/assets/{issue-passport-27422a15.js → issue-passport-c6316a00.js} +1 -1
- package/dist/assets/{launch-result-message-5cb7523a.js → launch-result-message-bc3d34f8.js} +1 -1
- package/dist/assets/{layout-fe001017.js → layout-d2846d27.js} +1 -1
- package/dist/assets/{list-header-456bfa74.js → list-header-4d0954bf.js} +1 -1
- package/dist/assets/localization-0b26d7a6.js +1 -0
- package/dist/assets/{log-da7be89b.js → log-957c206d.js} +1 -1
- package/dist/assets/{login-f7c787e7.js → login-7abb482f.js} +1 -1
- package/dist/assets/{logo-uploader-d3b0ef9a.js → logo-uploader-2897cb85.js} +2 -2
- package/dist/assets/{lost-passport-d5fefbfb.js → lost-passport-ca597911.js} +2 -2
- package/dist/assets/{lottie-1efa41ad.js → lottie-a8abc821.js} +1 -1
- package/dist/assets/{makeStyles-49c189a4.js → makeStyles-af672e02.js} +1 -1
- package/dist/assets/{memoize-one.esm-c0ea98d3.js → memoize-one.esm-c8bea7a2.js} +1 -1
- package/dist/assets/{nav-menu-e5bda5b1.js → nav-menu-33b9a238.js} +1 -1
- package/dist/assets/{notifications-cfc0d657.js → notifications-97251050.js} +1 -1
- package/dist/assets/{overview-cac9ec94.js → overview-97d0a79e.js} +1 -1
- package/dist/assets/{page-header-63e0831d.js → page-header-8a4c9c50.js} +1 -1
- package/dist/assets/{permission-d80dce81.js → permission-dd5ceeea.js} +1 -1
- package/dist/assets/{preferences-2e48e277.js → preferences-0280505b.js} +1 -1
- package/dist/assets/publish-resource-9e2fd88b.js +1 -0
- package/dist/assets/{react-f9aac7a1.js → react-8bf99ad0.js} +33 -27
- package/dist/assets/{redux-8efd18d4.js → redux-4a13b1ee.js} +1 -1
- package/dist/assets/{selector-b882811a.js → selector-e7537a43.js} +1 -1
- package/dist/assets/session-f52f379b.js +1 -0
- package/dist/assets/{setup-017ccdf9.js → setup-017ee02c.js} +2 -2
- package/dist/assets/{slicedToArray-51036cb1.js → slicedToArray-b9314e6c.js} +1 -1
- package/dist/assets/{spaces-30889313.js → spaces-4402bfd9.js} +1 -1
- package/dist/assets/{start-6b901ad4.js → start-95b58f88.js} +1 -1
- package/dist/assets/{step-actions-cc9fccda.js → step-actions-c99de83a.js} +1 -1
- package/dist/assets/{studio-75f7cd30.js → studio-e0d343f5.js} +1 -1
- package/dist/assets/{switch-control-1a270bab.js → switch-control-944b9c84.js} +1 -1
- package/dist/assets/{toPropertyKey-d63e044c.js → toPropertyKey-ceeedea6.js} +1 -1
- package/dist/assets/{transfer-82dd6dbc.js → transfer-a19f0df2.js} +1 -1
- package/dist/assets/{uniqBy-b149d2ef.js → uniqBy-11474d2a.js} +1 -1
- package/dist/assets/{unsubscribe-2f8458c6.js → unsubscribe-84f56731.js} +1 -1
- package/dist/assets/{use-blocklet-info-for-connect-did-spaces-e4c92196.js → use-blocklet-info-for-connect-did-spaces-2c0b4729.js} +1 -1
- package/dist/assets/{useAsync-aeba6414.js → useAsync-2a7bf586.js} +1 -1
- package/dist/assets/{useFormControl-b7cc7d69.js → useFormControl-1b3cb36f.js} +1 -1
- package/dist/assets/{useSetState-49e815fe.js → useSetState-483ba319.js} +1 -1
- package/dist/assets/{user-55074d20.js → user-6d82a43f.js} +1 -1
- package/dist/assets/{util-ab8d703d.js → util-c52b3ea9.js} +1 -1
- package/dist/assets/{wallet-hidden-topbar-94881797.js → wallet-hidden-topbar-91b1f489.js} +2 -2
- package/dist/assets/wrap-locale-7898963f.js +1 -0
- package/dist/index.html +1 -1
- package/package.json +18 -18
- package/dist/assets/add-resource-acb27726.js +0 -1
- package/dist/assets/api-71b66169.js +0 -1
- package/dist/assets/domain-70882483.js +0 -9
- package/dist/assets/domain-list-b5d9635e.js +0 -12
- package/dist/assets/localization-fdf9467e.js +0 -1
- package/dist/assets/publish-resource-0da6fec5.js +0 -1
- package/dist/assets/session-2a0eb2cb.js +0 -1
- package/dist/assets/wrap-locale-358982b3.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aj as w,j as e,d as L,ao as $,S as K,u as S,bF as J,bG as X,au as Y,e as _,h as Q,T as d,G as f,bH as H,b5 as R,av as U,bI as B,n as C,bE as Z,J as ee,X as te,B as V,bj as ne,bJ as D,bo as F,w as O,N as se,y as oe,K as ae}from"./index-
|
|
1
|
+
import{aj as w,j as e,d as L,ao as $,S as K,u as S,bF as J,bG as X,au as Y,e as _,h as Q,T as d,G as f,bH as H,b5 as R,av as U,bI as B,n as C,bE as Z,J as ee,X as te,B as V,bj as ne,bJ as D,bo as F,w as O,N as se,y as oe,K as ae}from"./index-2668c3ea.js";import{H as re}from"./index-95ed5c0e.js";import{I as P}from"./index-24e445a7.js";import{T as ie}from"./index-0ce26e3b.js";import{W as le}from"./did-address-75f80f5d.js";import{g as ce,U as me,P as de}from"./did-utils-4012db50.js";import{i as pe}from"./index-35962c8a.js";import{u as ue,a as he,C as v}from"./index.esm-3acd0530.js";import{u as xe}from"./confirm-37e025f8.js";import{A as ge}from"./Alert-037193c9.js";import{S as c,F as I}from"./FormControlLabel-2ee3fa4b.js";import{C as T}from"./Checkbox-e5abf3e7.js";import{S as fe}from"./Select-c9c71312.js";import{T as je}from"./TextField-9def9dd1.js";import{M as be}from"./InputAdornment-6977d85a.js";import{f as N}from"./format-error-89fc5b13.js";import{A as ve}from"./Avatar-45cfefc3.js";import"./fallback-e6908990.js";import"./nav-menu-33b9a238.js";import"./ExpandMore-affb00ec.js";import"./wallet-hidden-topbar-91b1f489.js";import"./selector-e7537a43.js";import"./useFormControl-1b3cb36f.js";import"./FormControl-776d5fa1.js";import"./InputLabel-4899f2ad.js";const ye=w(e.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"AddOutlined"),Ce=w(e.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5-1-1h-5l-1 1H5v2h14V4h-3.5z"}),"DeleteOutlineOutlined"),we=w(e.jsx("path",{d:"M12 2 4 5v6.09c0 5.05 3.41 9.76 8 10.91 4.59-1.15 8-5.86 8-10.91V5l-8-3zm6 9.09c0 4-2.55 7.7-6 8.83-3.45-1.13-6-4.82-6-8.83V6.31l6-2.12 6 2.12v4.78zm-9.18-.5L7.4 12l3.54 3.54 5.66-5.66-1.41-1.41-4.24 4.24-2.13-2.12z"}),"GppGoodOutlined"),Se=w(e.jsx("path",{d:"m4.01 6.03 7.51 3.22-7.52-1 .01-2.22m7.5 8.72L4 17.97v-2.22l7.51-1M2.01 3 2 10l15 2-15 2 .01 7L23 12 2.01 3z"}),"SendOutlined");function ke({data:n,user:o,onChange:i}){const{t}=S(),{api:r}=L(),[a,p]=J({editing:!1,dirty:!1}),{control:h,getValues:g,setValue:m,formState:x,handleSubmit:k}=ue({defaultValues:X({notifications:{email:!0,wallet:!0,phone:!1},webhooks:[]},n)}),{confirmApi:A,confirmHolder:y}=xe(),E=Y(),W=new URLSearchParams(E.search),G=_(),j=he({control:h,name:"webhooks"}),z=async s=>{try{await r.post("/api/user/extra",s),C.success(t("common.saveSuccess")),p({editing:!1}),await i()}catch(l){C.error(N(l))}};Q(()=>{if(W.get("action")==="unsubscribe"){const s=W.get("channel");["email","wallet","phone"].includes(s)&&(G(E.pathname,{replace:!0}),A.open({title:t("notification.email.disable"),content:t("notification.email.disableDescription"),async onConfirm(l){await z({notifications:{[s]:!1}}),l()}}))}});const q=async s=>{try{const l=g();await r.put("/api/user/extra",l.webhooks[s]),C.success(t("team.member.settings.tested"))}catch(l){C.error(N(l))}};return e.jsxs(c,{spacing:3,children:[e.jsxs(c,{sx:{width:"100%"},children:[e.jsxs(c,{direction:"row",justifyContent:"space-between",children:[e.jsx(d,{variant:"h6",gutterBottom:!0,children:t("team.member.settings.notification")}),e.jsx(f,{variant:"contained",size:"small",color:"primary",style:{height:"32px"},onClick:k(z),disabled:x.isSubmitting,children:t("common.save")})]}),e.jsx(v,{name:"notifications.wallet",control:h,render:({field:s})=>e.jsx(I,{control:e.jsx(T,{checked:g().notifications.wallet,...s,onChange:(l,u)=>m(s.name,u)}),disableTypography:!0,label:e.jsxs(d,{color:"text.primary",children:[t("team.member.settings.wallet"),e.jsx(d,{component:"span",color:"text.secondary",ml:1,children:ce(o)})]})})}),e.jsx(v,{name:"notifications.email",control:h,render:({field:s})=>e.jsx(I,{control:e.jsx(T,{checked:g().notifications.email,...s,onChange:(l,u)=>m(s.name,u)}),disableTypography:!0,label:e.jsxs(d,{color:"text.primary",children:[t("team.member.settings.email"),e.jsx(d,{component:"span",color:"text.secondary",ml:1,children:o.email||""})]})})}),e.jsx(v,{name:"notifications.phone",control:h,render:({field:s})=>e.jsx(I,{control:e.jsx(T,{checked:g().notifications.phone,...s,onChange:(l,u)=>m(s.name,u)}),disableTypography:!0,disabled:!0,label:e.jsxs(d,{color:"text.primary",children:[t("team.member.settings.phone"),e.jsx(d,{component:"span",color:"text.secondary",ml:1,children:o.phone||""})]})})})]}),e.jsxs(c,{children:[e.jsxs(c,{direction:"row",justifyContent:"space-between",children:[e.jsx(d,{variant:"h6",gutterBottom:!0,children:t("team.member.settings.webhook")}),e.jsxs(c,{direction:"row",children:[a.editing&&e.jsx(f,{variant:"text",size:"small",color:"primary",style:{height:"32px"},onClick:()=>p({editing:!1}),children:t("common.cancel")}),e.jsx(f,{variant:"contained",size:"small",color:"primary",style:{height:"32px"},onClick:a.editing?k(z):()=>p({editing:!0}),disabled:x.isSubmitting,children:a.editing?t("common.save"):t("common.edit")})]})]}),j.fields.map((s,l)=>{var M;const u=(M=H(x.errors,`webhooks.${l}.url`))==null?void 0:M.message;return a.editing?e.jsxs(c,{mt:2,spacing:2,sx:{width:"100%"},direction:"row",alignItems:"center",children:[e.jsxs(c,{direction:"row",spacing:2,sx:{width:"80%"},children:[e.jsx(v,{name:`webhooks.${l}.type`,control:h,rules:{required:t("common.required")},render:({field:b})=>e.jsxs(fe,{...b,sx:{flex:1},fullWidth:!0,size:"small",children:[e.jsx(R,{value:"api",children:t("team.member.settings.url")}),e.jsx(R,{value:"slack",children:t("team.member.settings.slack")})]})}),e.jsx(v,{name:`webhooks.${l}.url`,control:h,rules:{required:t("common.required"),validate:b=>pe(b)||t("common.invalid")},render:({field:b})=>e.jsx(je,{sx:{flex:4},fullWidth:!0,size:"small",required:!0,...b,error:!!u,InputProps:{endAdornment:u?e.jsx(be,{position:"end",children:e.jsx(d,{component:"span",color:"error",children:u})}):null}})})]}),e.jsxs(c,{direction:"row",spacing:1,children:[e.jsx(U,{size:"small",onClick:()=>q(l),children:e.jsx(Se,{color:"primary",sx:{opacity:.75}})}),e.jsx(U,{size:"small",onClick:()=>j.remove(l),children:e.jsx(Ce,{color:"error",sx:{opacity:.75}})})]})]},s.id):e.jsx(P,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:s.type,children:s.url},s.id)}),!a.editing&&!j.fields.length&&e.jsx(B,{children:t("common.empty")}),a.editing&&e.jsx(c,{mt:j.fields.length?2:1,direction:"row",justifyContent:"space-between",children:e.jsxs(f,{size:"small",variant:"outlined",color:"primary",onClick:()=>j.append({type:"slack",url:""}),children:[e.jsx(ye,{fontSize:"small"})," ",t("team.member.settings.add")]})})]}),y]})}function Ae({user:n}){const{api:o}=L(),{loading:i,error:t,runAsync:r,data:a}=$(()=>o.get("/api/user/extra").then(p=>p.data));return t?e.jsx(ge,{severity:"error",children:t.message}):i||!a?e.jsx(K,{}):e.jsx(ke,{data:a,user:n,onChange:r})}function ze({user:n}){const{t:o,locale:i}=S(),t={auth0:"Auth0",wallet:"DID wallet",federated:"Federated"};return[{name:o("team.member.name"),value:n.fullName},{name:o("common.email"),value:n.email},{name:o("common.phone"),value:n.phone},{name:o("team.member.lastLogin"),value:F(n.lastLoginAt,i)},{name:o("team.member.lastLoginIp"),value:n.lastLoginIp||""},{name:o("common.createdAt"),value:F(n.createdAt,i)},{name:o("team.member.source"),value:t[(n==null?void 0:n.sourceProvider)||O.USER_TYPE.WALLET]||(n==null?void 0:n.sourceProvider)}].filter(Boolean).map(a=>a.name===o("common.did")?e.jsx(P,{valueComponent:"div",nameWidth:120,name:a.name,nameFormatter:()=>o("common.did"),children:a.value},a.name):e.jsx(P,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:a.name,children:a.value},a.name))}function Ie({user:n}){const{t:o}=S(),i=(H(n,"passports")||[]).map(t=>({...t,revoked:t.status===O.PASSPORT_STATUS.REVOKED}));return i.length===0?e.jsx(B,{children:o("common.empty")}):e.jsx(c,{direction:"row",spacing:3,children:i.map(t=>e.jsx(de,{passport:t,user:n,width:200,color:window.blocklet.passportColor,createPassportSvg:se,sx:{flexDirection:"column",alignItems:"center"}},t.id))})}function tt(){const n=_(),o=Z(),{t:i}=S(),{session:t}=L(),r=ee({user:t.user,tab:o.tab||"profile"}),a=m=>{r.tab=m,n(`${O.WELLKNOWN_SERVICE_PATH_PREFIX}/user/${m}`)},p={info:{label:i("common.profile"),value:"profile",component:ze},oauth:{label:i("team.member.connections"),value:"connections",component:me},passports:{label:i("team.member.passports"),value:"passports",component:Ie},settings:{label:i("common.setting"),value:"settings",component:Ae}},h=Object.values(p).map(({label:m,value:x})=>({label:m,value:x})).filter(m=>{var x;return m.value==="connections"?(((x=r.user)==null?void 0:x.connectedAccounts)||[]).find(A=>{var y;return A.provider!==(((y=r.user)==null?void 0:y.sourceProvider)||te.LOGIN_PROVIDER.WALLET)}):!0}),g=p[r.tab]||p.info;return e.jsxs(e.Fragment,{children:[e.jsx(re,{}),e.jsxs(Te,{sx:{mt:4},children:[e.jsxs(c,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(c,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(ve,{src:r.user.avatar,variant:"rounded",style:{width:80,height:80,backgroundColor:"transparent",marginRight:8}}),e.jsxs(c,{direction:"column",spacing:.5,children:[e.jsx(d,{variant:"h4",fontWeight:"bold",children:r.user.fullName}),e.jsx(V,{children:e.jsx(ne,{label:r.user.role.toUpperCase(),size:"small",variant:"outlined",color:"success",sx:{height:"auto",fontWeight:"bold",fontSize:"12px"},icon:e.jsx(we,{sx:{fontSize:"0.8em"}})})}),e.jsx(le,{did:r.user.did})]})]}),e.jsxs(c,{children:[r.tab==="profile"&&e.jsx(f,{variant:"contained",size:"small",color:"primary",onClick:()=>t.switchProfile(D,{}),children:i("team.member.switch.profile")}),r.tab==="passports"&&e.jsx(f,{variant:"contained",size:"small",color:"primary",onClick:()=>t.switchPassport(D,{}),children:i("team.member.switch.passport")})]})]}),e.jsx(V,{className:"tabs",sx:{my:3},children:e.jsx(ie,{tabs:h,current:r.tab,onChange:a})}),e.jsx("div",{className:"body",children:e.jsx(g.component,{user:r.user})})]})]})}const Te=oe(ae)`
|
|
2
2
|
.MuiTab-root {
|
|
3
3
|
padding: 0;
|
|
4
4
|
margin-right: 24px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aW as l,ec as s,ed as h,X as P,w as u}from"./index-
|
|
1
|
+
import{aW as l,ec as s,ed as h,X as P,w as u}from"./index-2668c3ea.js";const d=s;var c=(e,r)=>d(e)===d(r);const E=l(c),x=(e,r)=>{if(e.type===u.ROUTING_RULE_TYPES.REDIRECT){if(!e.url)return new Error(`${r("router.validation.redirectUrlRequired")}`);if(!e.redirectCode)return new Error(`redirect ${r("router.validation.redirectCodeRequired")}`)}else if(e.type===u.ROUTING_RULE_TYPES.BLOCKLET&&!e.did)return new Error(r("router.validation.didRequired"));return null},R=(e,r)=>{const t=x(e,r);return t||(e.pathPrefix.length?e.pathPrefix.length>150?new Error(r("router.validation.pathPrefixTooLong",{length:150})):null:new Error(r("router.validation.pathPrefixCannotBeEmpty")))},v=({params:e,blocklets:r,blocklet:t,locale:o="en"})=>{if(t){let i=(t.children||[]).find(f=>h(f.meta)&&E(f.mountPoint,e.pathPrefix));if(t.meta.group!=="gateway"&&e.pathPrefix==="/"&&(i="/"),i)return{zh:`挂载点 ${e.pathPrefix} 已存在,请使用其他挂载点`,en:`The mount point ${e.pathPrefix} already exist, please use another mount point`}[o]}const a=r.find(i=>i.meta.did===e.did);if(!a)return"";const n=a.meta.interfaces.find(i=>i.type==="web");return n&&n.prefix!==P.BLOCKLET_DYNAMIC_PATH_PREFIX&&e.pathPrefix!==n.prefix?{zh:`该 blocklet 只能挂载在 ${n.prefix}`,en:`This blocklet can only be mounted on ${n.prefix}`}[o]:""},T=e=>{if(!e||typeof e!="string")return e;let r=e.trim();try{return r=r.toLowerCase(),r.startsWith("http://")||r.startsWith("https://")?new URL(r).hostname:r}catch(t){return console.error("format domain failed",t),r}};export{R as a,T as p,v};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ne=Object.defineProperty;var oe=(t,e,n)=>e in t?ne(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var R=(t,e,n)=>(oe(t,typeof e!="symbol"?e+"":e,n),n);import{P as f,r as Z,bh as re,u as se,j as F,aw as ie,_ as ce,M as ae}from"./index-
|
|
1
|
+
var ne=Object.defineProperty;var oe=(t,e,n)=>e in t?ne(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var R=(t,e,n)=>(oe(t,typeof e!="symbol"?e+"":e,n),n);import{P as f,r as Z,bh as re,u as se,j as F,aw as ie,_ as ce,M as ae}from"./index-2668c3ea.js";import{L as ue}from"./selector-e7537a43.js";/**
|
|
2
2
|
* (c) Iconify
|
|
3
3
|
*
|
|
4
4
|
* For the full copyright and license information, please view the license.txt
|
|
@@ -8,4 +8,4 @@ var ne=Object.defineProperty;var oe=(t,e,n)=>e in t?ne(t,e,{enumerable:!0,config
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
* @version 1.0.8
|
|
11
|
-
*/const Et=Object.freeze({left:0,top:0,width:16,height:16}),Q=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),L=Object.freeze({...Et,...Q}),K=Object.freeze({...L,body:"",hidden:!1}),le=Object.freeze({width:null,height:null}),Lt=Object.freeze({...le,...Q});function fe(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(t);return isNaN(o)?0:r(o)}else if(n!==t){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(t.slice(0,t.length-n.length));return isNaN(s)?0:(s=s/o,s%1===0?r(s):0)}}return e}const de=/[\s,]+/;function he(t,e){e.split(de).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}const Mt={...Lt,preserveAspectRatio:""};function ht(t){const e={...Mt},n=(r,o)=>t.getAttribute(r)||o;return e.width=n("width",null),e.height=n("height",null),e.rotate=fe(n("rotate","")),he(e,n("flip","")),e.preserveAspectRatio=n("preserveAspectRatio",n("preserveaspectratio","")),e}function pe(t,e){for(const n in Mt)if(t[n]!==e[n])return!0;return!1}const k=/^[a-z0-9]+(-[a-z0-9]+)*$/,M=(t,e,n,r="")=>{const o=t.split(":");if(t.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),c=o.pop(),u={provider:o.length>0?o[0]:r,prefix:c,name:a};return e&&!z(u)?null:u}const s=o[0],i=s.split("-");if(i.length>1){const a={provider:r,prefix:i.shift(),name:i.join("-")};return e&&!z(a)?null:a}if(n&&r===""){const a={provider:r,prefix:"",name:s};return e&&!z(a,n)?null:a}return null},z=(t,e)=>t?!!((t.provider===""||t.provider.match(k))&&(e&&t.prefix===""||t.prefix.match(k))&&t.name.match(k)):!1;function ge(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const r=((t.rotate||0)+(e.rotate||0))%4;return r&&(n.rotate=r),n}function pt(t,e){const n=ge(t,e);for(const r in K)r in Q?r in t&&!(r in n)&&(n[r]=Q[r]):r in e?n[r]=e[r]:r in t&&(n[r]=t[r]);return n}function me(t,e){const n=t.icons,r=t.aliases||Object.create(null),o=Object.create(null);function s(i){if(n[i])return o[i]=[];if(!(i in o)){o[i]=null;const a=r[i]&&r[i].parent,c=a&&s(a);c&&(o[i]=[a].concat(c))}return o[i]}return(e||Object.keys(n).concat(Object.keys(r))).forEach(s),o}function ye(t,e,n){const r=t.icons,o=t.aliases||Object.create(null);let s={};function i(a){s=pt(r[a]||o[a],s)}return i(e),n.forEach(i),pt(t,s)}function Nt(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(o=>{e(o,null),n.push(o)});const r=me(t);for(const o in r){const s=r[o];s&&(e(o,ye(t,o,s)),n.push(o))}return n}const be={provider:"",aliases:{},not_found:{},...Et};function G(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function Rt(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!G(t,be))return null;const n=e.icons;for(const o in n){const s=n[o];if(!o.match(k)||typeof s.body!="string"||!G(s,K))return null}const r=e.aliases||Object.create(null);for(const o in r){const s=r[o],i=s.parent;if(!o.match(k)||typeof i!="string"||!n[i]&&!r[i]||!G(s,K))return null}return e}const $=Object.create(null);function we(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function S(t,e){const n=$[t]||($[t]=Object.create(null));return n[e]||(n[e]=we(t,e))}function ct(t,e){return Rt(e)?Nt(e,(n,r)=>{r?t.icons[n]=r:t.missing.add(n)}):[]}function Ie(t,e,n){try{if(typeof n.body=="string")return t.icons[e]={...n},!0}catch{}return!1}function xe(t,e){let n=[];return(typeof t=="string"?[t]:Object.keys($)).forEach(o=>{(typeof o=="string"&&typeof e=="string"?[e]:Object.keys($[o]||{})).forEach(i=>{const a=S(o,i);n=n.concat(Object.keys(a.icons).map(c=>(o!==""?"@"+o+":":"")+i+":"+c))})}),n}let _=!1;function Ft(t){return typeof t=="boolean"&&(_=t),_}function O(t){const e=typeof t=="string"?M(t,!0,_):t;if(e){const n=S(e.provider,e.prefix),r=e.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Dt(t,e){const n=M(t,!0,_);if(!n)return!1;const r=S(n.provider,n.prefix);return Ie(r,n.name,e)}function gt(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),_&&!e&&!t.prefix){let o=!1;return Rt(t)&&(t.prefix="",Nt(t,(s,i)=>{i&&Dt(s,i)&&(o=!0)})),o}const n=t.prefix;if(!z({provider:e,prefix:n,name:"a"}))return!1;const r=S(e,n);return!!ct(r,t)}function Se(t){return!!O(t)}function Ce(t){const e=O(t);return e?{...L,...e}:null}function Ae(t){const e={loaded:[],missing:[],pending:[]},n=Object.create(null);t.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return t.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const s=o.provider,i=o.prefix,a=o.name,c=n[s]||(n[s]=Object.create(null)),u=c[i]||(c[i]=S(s,i));let l;a in u.icons?l=e.loaded:i===""||u.missing.has(a)?l=e.missing:l=e.pending;const d={provider:s,prefix:i,name:a};l.push(d)}),e}function zt(t,e){t.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(o=>o.id!==e))})}function ve(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let n=!1;const r=t.provider,o=t.prefix;e.forEach(s=>{const i=s.icons,a=i.pending.length;i.pending=i.pending.filter(c=>{if(c.prefix!==o)return!0;const u=c.name;if(t.icons[u])i.loaded.push({provider:r,prefix:o,name:u});else if(t.missing.has(u))i.missing.push({provider:r,prefix:o,name:u});else return n=!0,!0;return!1}),i.pending.length!==a&&(n||zt([t],s.id),s.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),s.abort))})}))}let Pe=0;function Te(t,e,n){const r=Pe++,o=zt.bind(null,n,r);if(!e.pending.length)return o;const s={id:r,icons:e,callback:t,abort:o};return n.forEach(i=>{(i.loaderCallbacks||(i.loaderCallbacks=[])).push(s)}),o}const tt=Object.create(null);function mt(t,e){tt[t]=e}function et(t){return tt[t]||tt[""]}function ke(t,e=!0,n=!1){const r=[];return t.forEach(o=>{const s=typeof o=="string"?M(o,e,n):o;s&&r.push(s)}),r}var je={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function _e(t,e,n,r){const o=t.resources.length,s=t.random?Math.floor(Math.random()*o):t.index;let i;if(t.random){let p=t.resources.slice(0);for(i=[];p.length>1;){const I=Math.floor(Math.random()*p.length);i.push(p[I]),p=p.slice(0,I).concat(p.slice(I+1))}i=i.concat(p)}else i=t.resources.slice(s).concat(t.resources.slice(0,s));const a=Date.now();let c="pending",u=0,l,d=null,h=[],m=[];typeof r=="function"&&m.push(r);function y(){d&&(clearTimeout(d),d=null)}function b(){c==="pending"&&(c="aborted"),y(),h.forEach(p=>{p.status==="pending"&&(p.status="aborted")}),h=[]}function x(p,I){I&&(m=[]),typeof p=="function"&&m.push(p)}function C(){return{startTime:a,payload:e,status:c,queriesSent:u,queriesPending:h.length,subscribe:x,abort:b}}function w(){c="failed",m.forEach(p=>{p(void 0,l)})}function g(){h.forEach(p=>{p.status==="pending"&&(p.status="aborted")}),h=[]}function ee(p,I,P){const N=I!=="success";switch(h=h.filter(A=>A!==p),c){case"pending":break;case"failed":if(N||!t.dataAfterTimeout)return;break;default:return}if(I==="abort"){l=P,w();return}if(N){l=P,h.length||(i.length?W():w());return}if(y(),g(),!t.random){const A=t.resources.indexOf(p.resource);A!==-1&&A!==t.index&&(t.index=A)}c="completed",m.forEach(A=>{A(P)})}function W(){if(c!=="pending")return;y();const p=i.shift();if(p===void 0){if(h.length){d=setTimeout(()=>{y(),c==="pending"&&(g(),w())},t.timeout);return}w();return}const I={status:"pending",resource:p,callback:(P,N)=>{ee(I,P,N)}};h.push(I),u++,d=setTimeout(W,t.rotate),n(p,e,I.callback)}return setTimeout(W),C}function Ht(t){const e={...je,...t};let n=[];function r(){n=n.filter(a=>a().status==="pending")}function o(a,c,u){const l=_e(e,a,c,(d,h)=>{r(),u&&u(d,h)});return n.push(l),l}function s(a){return n.find(c=>a(c))||null}return{query:o,find:s,setIndex:a=>{e.index=a},getIndex:()=>e.index,cleanup:r}}function at(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const q=Object.create(null),T=["https://api.simplesvg.com","https://api.unisvg.com"],H=[];for(;T.length>0;)T.length===1||Math.random()>.5?H.push(T.shift()):H.push(T.pop());q[""]=at({resources:["https://api.iconify.design"].concat(H)});function yt(t,e){const n=at(e);return n===null?!1:(q[t]=n,!0)}function V(t){return q[t]}function Oe(){return Object.keys(q)}function bt(){}const J=Object.create(null);function Ee(t){if(!J[t]){const e=V(t);if(!e)return;const n=Ht(e),r={config:e,redundancy:n};J[t]=r}return J[t]}function Qt(t,e,n){let r,o;if(typeof t=="string"){const s=et(t);if(!s)return n(void 0,424),bt;o=s.send;const i=Ee(t);i&&(r=i.redundancy)}else{const s=at(t);if(s){r=Ht(s);const i=t.resources?t.resources[0]:"",a=et(i);a&&(o=a.send)}}return!r||!o?(n(void 0,424),bt):r.query(e,o,n)().abort}const wt="iconify2",E="iconify",$t=E+"-count",It=E+"-version",Ut=36e5,Le=168;function nt(t,e){try{return t.getItem(e)}catch{}}function ut(t,e,n){try{return t.setItem(e,n),!0}catch{}}function xt(t,e){try{t.removeItem(e)}catch{}}function ot(t,e){return ut(t,$t,e.toString())}function rt(t){return parseInt(nt(t,$t))||0}const v={local:!0,session:!0},qt={local:new Set,session:new Set};let lt=!1;function Me(t){lt=t}let D=typeof window>"u"?{}:window;function Vt(t){const e=t+"Storage";try{if(D&&D[e]&&typeof D[e].length=="number")return D[e]}catch{}v[t]=!1}function Bt(t,e){const n=Vt(t);if(!n)return;const r=nt(n,It);if(r!==wt){if(r){const a=rt(n);for(let c=0;c<a;c++)xt(n,E+c.toString())}ut(n,It,wt),ot(n,0);return}const o=Math.floor(Date.now()/Ut)-Le,s=a=>{const c=E+a.toString(),u=nt(n,c);if(typeof u=="string"){try{const l=JSON.parse(u);if(typeof l=="object"&&typeof l.cached=="number"&&l.cached>o&&typeof l.provider=="string"&&typeof l.data=="object"&&typeof l.data.prefix=="string"&&e(l,a))return!0}catch{}xt(n,c)}};let i=rt(n);for(let a=i-1;a>=0;a--)s(a)||(a===i-1?(i--,ot(n,i)):qt[t].add(a))}function Wt(){if(!lt){Me(!0);for(const t in v)Bt(t,e=>{const n=e.data,r=e.provider,o=n.prefix,s=S(r,o);if(!ct(s,n).length)return!1;const i=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,i):i,!0})}}function Ne(t,e){const n=t.lastModifiedCached;if(n&&n>=e)return n===e;if(t.lastModifiedCached=e,n)for(const r in v)Bt(r,o=>{const s=o.data;return o.provider!==t.provider||s.prefix!==t.prefix||s.lastModified===e});return!0}function Re(t,e){lt||Wt();function n(r){let o;if(!v[r]||!(o=Vt(r)))return;const s=qt[r];let i;if(s.size)s.delete(i=Array.from(s).shift());else if(i=rt(o),!ot(o,i+1))return;const a={cached:Math.floor(Date.now()/Ut),provider:t.provider,data:e};return ut(o,E+i.toString(),JSON.stringify(a))}e.lastModified&&!Ne(t,e.lastModified)||Object.keys(e.icons).length&&(e.not_found&&(e=Object.assign({},e),delete e.not_found),n("local")||n("session"))}function St(){}function Fe(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,ve(t)}))}function De(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:n,prefix:r}=t,o=t.iconsToLoad;delete t.iconsToLoad;let s;if(!o||!(s=et(n)))return;s.prepare(n,r,o).forEach(a=>{Qt(n,a,c=>{if(typeof c!="object")a.icons.forEach(u=>{t.missing.add(u)});else try{const u=ct(t,c);if(!u.length)return;const l=t.pendingIcons;l&&u.forEach(d=>{l.delete(d)}),Re(t,c)}catch(u){console.error(u)}Fe(t)})})}))}const ft=(t,e)=>{const n=ke(t,!0,Ft()),r=Ae(n);if(!r.pending.length){let c=!0;return e&&setTimeout(()=>{c&&e(r.loaded,r.missing,r.pending,St)}),()=>{c=!1}}const o=Object.create(null),s=[];let i,a;return r.pending.forEach(c=>{const{provider:u,prefix:l}=c;if(l===a&&u===i)return;i=u,a=l,s.push(S(u,l));const d=o[u]||(o[u]=Object.create(null));d[l]||(d[l]=[])}),r.pending.forEach(c=>{const{provider:u,prefix:l,name:d}=c,h=S(u,l),m=h.pendingIcons||(h.pendingIcons=new Set);m.has(d)||(m.add(d),o[u][l].push(d))}),s.forEach(c=>{const{provider:u,prefix:l}=c;o[u][l].length&&De(c,o[u][l])}),e?Te(e,r,s):St},ze=t=>new Promise((e,n)=>{const r=typeof t=="string"?M(t,!0):t;if(!r){n(t);return}ft([r||t],o=>{if(o.length&&r){const s=O(r);if(s){e({...L,...s});return}}n(t)})});function He(t){try{const e=typeof t=="string"?JSON.parse(t):t;if(typeof e.body=="string")return{...e}}catch{}}function Qe(t,e){const n=typeof t=="string"?M(t,!0,!0):null;if(!n){const s=He(t);return{value:t,data:s}}const r=O(n);if(r!==void 0||!n.prefix)return{value:t,name:n,data:r};const o=ft([n],()=>e(t,n,O(n)));return{value:t,name:n,loading:o}}function X(t){return t.hasAttribute("inline")}let Gt=!1;try{Gt=navigator.vendor.indexOf("Apple")===0}catch{}function $e(t,e){switch(e){case"svg":case"bg":case"mask":return e}return e!=="style"&&(Gt||t.indexOf("<a")===-1)?"svg":t.indexOf("currentColor")===-1?"bg":"mask"}const Ue=/(-?[0-9.]*[0-9]+[0-9.]*)/g,qe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function st(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const r=t.split(Ue);if(r===null||!r.length)return t;const o=[];let s=r.shift(),i=qe.test(s);for(;;){if(i){const a=parseFloat(s);isNaN(a)?o.push(s):o.push(Math.ceil(a*e*n)/n)}else o.push(s);if(s=r.shift(),s===void 0)return o.join("");i=!i}}const Ve=t=>t==="unset"||t==="undefined"||t==="none";function Jt(t,e){const n={...L,...t},r={...Lt,...e},o={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(y=>{const b=[],x=y.hFlip,C=y.vFlip;let w=y.rotate;x?C?w+=2:(b.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),b.push("scale(-1 1)"),o.top=o.left=0):C&&(b.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),b.push("scale(1 -1)"),o.top=o.left=0);let g;switch(w<0&&(w-=Math.floor(w/4)*4),w=w%4,w){case 1:g=o.height/2+o.top,b.unshift("rotate(90 "+g.toString()+" "+g.toString()+")");break;case 2:b.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:g=o.width/2+o.left,b.unshift("rotate(-90 "+g.toString()+" "+g.toString()+")");break}w%2===1&&(o.left!==o.top&&(g=o.left,o.left=o.top,o.top=g),o.width!==o.height&&(g=o.width,o.width=o.height,o.height=g)),b.length&&(s='<g transform="'+b.join(" ")+'">'+s+"</g>")});const i=r.width,a=r.height,c=o.width,u=o.height;let l,d;i===null?(d=a===null?"1em":a==="auto"?u:a,l=st(d,c/u)):(l=i==="auto"?c:i,d=a===null?st(l,u/c):a==="auto"?u:a);const h={},m=(y,b)=>{Ve(b)||(h[y]=b.toString())};return m("width",l),m("height",d),h.viewBox=o.left.toString()+" "+o.top.toString()+" "+c.toString()+" "+u.toString(),{attributes:h,body:s}}const Be=()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}};let U=Be();function We(t){U=t}function Ge(){return U}function Je(t,e){const n=V(t);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let o=0;n.resources.forEach(i=>{o=Math.max(o,i.length)});const s=e+".json?icons=";r=n.maxURL-o-n.path.length-s.length}return r}function Xe(t){return t===404}const Ye=(t,e,n)=>{const r=[],o=Je(t,e),s="icons";let i={type:s,provider:t,prefix:e,icons:[]},a=0;return n.forEach((c,u)=>{a+=c.length+1,a>=o&&u>0&&(r.push(i),i={type:s,provider:t,prefix:e,icons:[]},a=c.length),i.icons.push(c)}),r.push(i),r};function Ze(t){if(typeof t=="string"){const e=V(t);if(e)return e.path}return"/"}const Ke=(t,e,n)=>{if(!U){n("abort",424);return}let r=Ze(e.provider);switch(e.type){case"icons":{const s=e.prefix,a=e.icons.join(","),c=new URLSearchParams({icons:a});r+=s+".json?"+c.toString();break}case"custom":{const s=e.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let o=503;U(t+r).then(s=>{const i=s.status;if(i!==200){setTimeout(()=>{n(Xe(i)?"abort":"next",i)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",o)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",o)})},tn={prepare:Ye,send:Ke};function Ct(t,e){switch(t){case"local":case"session":v[t]=e;break;case"all":for(const n in v)v[n]=e;break}}const Y="data-style";let Xt="";function en(t){Xt=t}function At(t,e){let n=Array.from(t.childNodes).find(r=>r.hasAttribute&&r.hasAttribute(Y));n||(n=document.createElement("style"),n.setAttribute(Y,Y),t.appendChild(n)),n.textContent=":host{display:inline-block;vertical-align:"+(e?"-0.125em":"0")+"}span,svg{display:block}"+Xt}function Yt(){mt("",tn),Ft(!0);let t;try{t=window}catch{}if(t){if(Wt(),t.IconifyPreload!==void 0){const n=t.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof n=="object"&&n!==null&&(n instanceof Array?n:[n]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!gt(o))&&console.error(r)}catch{console.error(r)}})}if(t.IconifyProviders!==void 0){const n=t.IconifyProviders;if(typeof n=="object"&&n!==null)for(const r in n){const o="IconifyProviders["+r+"] is invalid.";try{const s=n[r];if(typeof s!="object"||!s||s.resources===void 0)continue;yt(r,s)||console.error(o)}catch{console.error(o)}}}}return{enableCache:n=>Ct(n,!0),disableCache:n=>Ct(n,!1),iconExists:Se,getIcon:Ce,listIcons:xe,addIcon:Dt,addCollection:gt,calculateSize:st,buildIcon:Jt,loadIcons:ft,loadIcon:ze,addAPIProvider:yt,appendCustomStyle:en,_api:{getAPIConfig:V,setAPIModule:mt,sendAPIQuery:Qt,setFetch:We,getFetch:Ge,listAPIProviders:Oe}}}function Zt(t,e){let n=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in e)n+=" "+r+'="'+e[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}function nn(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function on(t){return"data:image/svg+xml,"+nn(t)}function rn(t){return'url("'+on(t)+'")'}const it={"background-color":"currentColor"},Kt={"background-color":"transparent"},vt={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Pt={"-webkit-mask":it,mask:it,background:Kt};for(const t in Pt){const e=Pt[t];for(const n in vt)e[t+"-"+n]=vt[n]}function Tt(t){return t?t+(t.match(/^[-0-9.]+$/)?"px":""):"inherit"}function sn(t,e,n){const r=document.createElement("span");let o=t.body;o.indexOf("<a")!==-1&&(o+="<!-- "+Date.now()+" -->");const s=t.attributes,i=Zt(o,{...s,width:e.width+"",height:e.height+""}),a=rn(i),c=r.style,u={"--svg":a,width:Tt(s.width),height:Tt(s.height),...n?it:Kt};for(const l in u)c.setProperty(l,u[l]);return r}let j;function cn(){try{j=window.trustedTypes.createPolicy("iconify",{createHTML:t=>t})}catch{j=null}}function an(t){return j===void 0&&cn(),j?j.createHTML(t):t}function un(t){const e=document.createElement("span"),n=t.attributes;let r="";n.width||(r="width: inherit;"),n.height||(r+="height: inherit;"),r&&(n.style=r);const o=Zt(t.body,n);return e.innerHTML=an(o),e.firstChild}function kt(t,e){const n=e.icon.data,r=e.customisations,o=Jt(n,r);r.preserveAspectRatio&&(o.attributes.preserveAspectRatio=r.preserveAspectRatio);const s=e.renderedMode;let i;switch(s){case"svg":i=un(o);break;default:i=sn(o,{...L,...n},s==="mask")}const a=Array.from(t.childNodes).find(c=>{const u=c.tagName&&c.tagName.toUpperCase();return u==="SPAN"||u==="SVG"});a?i.tagName==="SPAN"&&a.tagName===i.tagName?a.setAttribute("style",i.getAttribute("style")):t.replaceChild(i,a):t.appendChild(i)}function jt(t,e,n){const r=n&&(n.rendered?n:n.lastRender);return{rendered:!1,inline:e,icon:t,lastRender:r}}function ln(t="iconify-icon"){let e,n;try{e=window.customElements,n=window.HTMLElement}catch{return}if(!e||!n)return;const r=e.get(t);if(r)return r;const o=["icon","mode","inline","width","height","rotate","flip"],s=class extends n{constructor(){super();R(this,"_shadowRoot");R(this,"_state");R(this,"_checkQueued",!1);const c=this._shadowRoot=this.attachShadow({mode:"open"}),u=X(this);At(c,u),this._state=jt({value:""},u),this._queueCheck()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(c){if(c==="inline"){const u=X(this),l=this._state;u!==l.inline&&(l.inline=u,At(this._shadowRoot,u))}else this._queueCheck()}get icon(){const c=this.getAttribute("icon");if(c&&c.slice(0,1)==="{")try{return JSON.parse(c)}catch{}return c}set icon(c){typeof c=="object"&&(c=JSON.stringify(c)),this.setAttribute("icon",c)}get inline(){return X(this)}set inline(c){c?this.setAttribute("inline","true"):this.removeAttribute("inline")}restartAnimation(){const c=this._state;if(c.rendered){const u=this._shadowRoot;if(c.renderedMode==="svg")try{u.lastChild.setCurrentTime(0);return}catch{}kt(u,c)}}get status(){const c=this._state;return c.rendered?"rendered":c.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const c=this._state,u=this.getAttribute("icon");if(u!==c.icon.value){this._iconChanged(u);return}if(!c.rendered)return;const l=this.getAttribute("mode"),d=ht(this);(c.attrMode!==l||pe(c.customisations,d))&&this._renderIcon(c.icon,d,l)}_iconChanged(c){const u=Qe(c,(l,d,h)=>{const m=this._state;if(m.rendered||this.getAttribute("icon")!==l)return;const y={value:l,name:d,data:h};y.data?this._gotIconData(y):m.icon=y});u.data?this._gotIconData(u):this._state=jt(u,this._state.inline,this._state)}_gotIconData(c){this._checkQueued=!1,this._renderIcon(c,ht(this),this.getAttribute("mode"))}_renderIcon(c,u,l){const d=$e(c.data.body,l),h=this._state.inline;kt(this._shadowRoot,this._state={rendered:!0,icon:c,inline:h,customisations:u,attrMode:l,renderedMode:d})}};o.forEach(a=>{a in s.prototype||Object.defineProperty(s.prototype,a,{get:function(){return this.getAttribute(a)},set:function(c){c!==null?this.setAttribute(a,c):this.removeAttribute(a)}})});const i=Yt();for(const a in i)s[a]=s.prototype[a]=i[a];return e.define(t,s),s}ln()||Yt();const Cn=f.shape({appLogo:f.node,appName:f.string,theme:f.shape({background:f.string}),enableConnect:f.bool,enableLocale:f.bool,navigation:f.arrayOf(f.shape({title:f.oneOfType([f.string,f.object]),link:f.oneOfType([f.string,f.object]),icon:f.string,items:f.arrayOf(f.shape({title:f.oneOfType([f.string,f.object]),link:f.oneOfType([f.string,f.object])}))}))}),fn=f.shape({showText:f.bool,showRole:f.bool,switchDid:f.bool,switchProfile:f.bool,switchPassport:f.bool,disableLogout:f.bool,onLogin:f.func,onLogout:f.func,onSwitchDid:f.func,onSwitchProfile:f.func,onSwitchPassport:f.func,menu:f.array,menuRender:f.func,dark:f.bool,size:f.number}),B=(t,e,n="children")=>t.map(r=>Array.isArray(r[n])?e({...r,[n]:B(r[n],e,n)}):e(r)),An=(t,e="children")=>{const n=[];return B(t,r=>n.push(r),e),n},dt=(t,e,n="children")=>t.map(r=>({...r})).filter(r=>{const o=r[n];if(Array.isArray(o)){const i=dt(o,e,n);r[n]=i!=null&&i.length?i:void 0}const s={filteredChildren:r[n],isLeaf:!(o!=null&&o.length)};return e(r,s)}),dn=t=>/^https?:\/\//.test(t),vn=t=>/^[\w-]+:[\w-]+$/.test(t),hn=t=>{if(!t||!(t!=null&&t.startsWith("/")))return!1;const e=o=>o.endsWith("/")?o:`${o}/`,n=e(window.location.pathname),r=e(new URL(t,window.location.origin).pathname);return n.startsWith(r)},Pn=(t=[])=>{const e=t.map((r,o)=>({path:r,index:o})).filter(r=>hn(r.path));return e!=null&&e.length?e.slice(1).reduce((r,o)=>r.path.length>=o.path.length?r:o,e[0]).index:-1};var _t,Ot;const Tn=((_t=window==null?void 0:window.blocklet)==null?void 0:_t.groupPrefix)||((Ot=window==null?void 0:window.blocklet)==null?void 0:Ot.prefix)||"/",pn=t=>{const e={...t},n=t==null?void 0:t.background;return typeof n=="string"?e.background={header:n,footer:n,default:n}:n&&typeof n=="object"&&(e.background={header:n.header||n.default,footer:n.footer||n.default,default:n.default}),e},gn=(t,e="en")=>{if(!(t!=null&&t.length))return t;const n=(o,s)=>typeof o=="string"?o:typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o,r=(o,s)=>{if(typeof o=="string"){if(dn(o)){const a=new URL(o);return a.searchParams.set("locale",s),a.href}const i=new URL(o,window.location.origin);return i.searchParams.set("locale",s),i.pathname+i.search}return typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o};return B(t,o=>{var s;return{...o,title:n(o.title,e),link:(s=o.items)!=null&&s.length?o.link:r(o.link,e)}},"items")},mn=t=>B(t,e=>e.role?{...e,role:Array.isArray(e.role)?e.role:[e.role]}:e,"items"),yn=t=>{if(!(t!=null&&t.length))return null;const e=mn(t),n={header:[],footer:[],social:[],bottom:[],dashboard:[],sessionManager:[]};return e.forEach(r=>{var o;r.section?Array.isArray(r.section)?r.section.forEach(s=>{var i;(i=n[s])==null||i.push(r)}):typeof r.section=="string"&&((o=n[r.section])==null||o.push(r)):n.header.push(r)}),n},kn=t=>{if(!t)return null;const e={...t};return e.theme=pn(e.theme),e.navigation=yn(bn(e.navigation)),e},bn=(t=[])=>dt(t,(e,n)=>{var r;return!!e.link||((r=n.filteredChildren)==null?void 0:r.length)},"items"),wn=(t,e)=>dt(t,(n,r)=>{var s;const o=!n.role||e&&n.role.includes(e);return r.isLeaf?o:o&&((s=r.filteredChildren)==null?void 0:s.length)},"items");function te({formattedBlocklet:t,addons:e,sessionManagerProps:n}){var h,m,y,b;const r=Z.useContext(re),{locale:o}=se()||{},{enableConnect:s=!0,enableLocale:i=!0}=t,a=!!((h=r==null?void 0:r.session)!=null&&h.user);let c=gn((m=t==null?void 0:t.navigation)==null?void 0:m.sessionManager,o)||[];c=wn(c,(b=(y=r==null?void 0:r.session)==null?void 0:y.user)==null?void 0:b.role);const l=(()=>{if(e&&typeof e!="function")return Array.isArray(e)?e:[e];let x=[];if(i&&o&&x.push(F.jsx(ue,{showText:!1},"locale-selector")),s&&r){const C=[];a&&(c?c.slice(0,5):[]).forEach(g=>{C.push({label:g.title,icon:g.icon?F.jsx("iconify-icon",{icon:g.icon,height:24,style:{marginRight:8}}):null,component:"a",href:g.link,key:g.link})}),x.push(F.jsx(ie,{session:r.session,locale:o,menu:C,showRole:!0,...n},"session-manager"))}return typeof e=="function"&&(x=e(x)||[]),x})();return Z.createElement(F.Fragment,null,...Array.isArray(l)?l:[l])}te.propTypes={formattedBlocklet:f.object.isRequired,addons:f.oneOfType([f.func,f.node]),sessionManagerProps:fn};te.defaultProps={addons:null,sessionManagerProps:{showRole:!0}};const jn=()=>{const t=ce();Z.useEffect(()=>{t.wallet&&ae(()=>import("./index-035e11b9.js").then(e=>e.i),["assets/index-035e11b9.js","assets/index-cf61f7db.js","assets/index-d8bbb108.css"]).then(e=>{e.call||(e=e.default),e.call("arcHideTopBar","{}")}).catch(e=>{console.error("load dsbridge error",e)})},[t])};export{te as H,wn as a,Cn as b,An as c,Pn as d,vn as e,kn as f,gn as g,dn as i,B as m,Tn as p,fn as s,jn as u};
|
|
11
|
+
*/const Et=Object.freeze({left:0,top:0,width:16,height:16}),Q=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),L=Object.freeze({...Et,...Q}),K=Object.freeze({...L,body:"",hidden:!1}),le=Object.freeze({width:null,height:null}),Lt=Object.freeze({...le,...Q});function fe(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(t);return isNaN(o)?0:r(o)}else if(n!==t){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(t.slice(0,t.length-n.length));return isNaN(s)?0:(s=s/o,s%1===0?r(s):0)}}return e}const de=/[\s,]+/;function he(t,e){e.split(de).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}const Mt={...Lt,preserveAspectRatio:""};function ht(t){const e={...Mt},n=(r,o)=>t.getAttribute(r)||o;return e.width=n("width",null),e.height=n("height",null),e.rotate=fe(n("rotate","")),he(e,n("flip","")),e.preserveAspectRatio=n("preserveAspectRatio",n("preserveaspectratio","")),e}function pe(t,e){for(const n in Mt)if(t[n]!==e[n])return!0;return!1}const k=/^[a-z0-9]+(-[a-z0-9]+)*$/,M=(t,e,n,r="")=>{const o=t.split(":");if(t.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),c=o.pop(),u={provider:o.length>0?o[0]:r,prefix:c,name:a};return e&&!z(u)?null:u}const s=o[0],i=s.split("-");if(i.length>1){const a={provider:r,prefix:i.shift(),name:i.join("-")};return e&&!z(a)?null:a}if(n&&r===""){const a={provider:r,prefix:"",name:s};return e&&!z(a,n)?null:a}return null},z=(t,e)=>t?!!((t.provider===""||t.provider.match(k))&&(e&&t.prefix===""||t.prefix.match(k))&&t.name.match(k)):!1;function ge(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const r=((t.rotate||0)+(e.rotate||0))%4;return r&&(n.rotate=r),n}function pt(t,e){const n=ge(t,e);for(const r in K)r in Q?r in t&&!(r in n)&&(n[r]=Q[r]):r in e?n[r]=e[r]:r in t&&(n[r]=t[r]);return n}function me(t,e){const n=t.icons,r=t.aliases||Object.create(null),o=Object.create(null);function s(i){if(n[i])return o[i]=[];if(!(i in o)){o[i]=null;const a=r[i]&&r[i].parent,c=a&&s(a);c&&(o[i]=[a].concat(c))}return o[i]}return(e||Object.keys(n).concat(Object.keys(r))).forEach(s),o}function ye(t,e,n){const r=t.icons,o=t.aliases||Object.create(null);let s={};function i(a){s=pt(r[a]||o[a],s)}return i(e),n.forEach(i),pt(t,s)}function Nt(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(o=>{e(o,null),n.push(o)});const r=me(t);for(const o in r){const s=r[o];s&&(e(o,ye(t,o,s)),n.push(o))}return n}const be={provider:"",aliases:{},not_found:{},...Et};function G(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function Rt(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!G(t,be))return null;const n=e.icons;for(const o in n){const s=n[o];if(!o.match(k)||typeof s.body!="string"||!G(s,K))return null}const r=e.aliases||Object.create(null);for(const o in r){const s=r[o],i=s.parent;if(!o.match(k)||typeof i!="string"||!n[i]&&!r[i]||!G(s,K))return null}return e}const $=Object.create(null);function we(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function S(t,e){const n=$[t]||($[t]=Object.create(null));return n[e]||(n[e]=we(t,e))}function ct(t,e){return Rt(e)?Nt(e,(n,r)=>{r?t.icons[n]=r:t.missing.add(n)}):[]}function Ie(t,e,n){try{if(typeof n.body=="string")return t.icons[e]={...n},!0}catch{}return!1}function xe(t,e){let n=[];return(typeof t=="string"?[t]:Object.keys($)).forEach(o=>{(typeof o=="string"&&typeof e=="string"?[e]:Object.keys($[o]||{})).forEach(i=>{const a=S(o,i);n=n.concat(Object.keys(a.icons).map(c=>(o!==""?"@"+o+":":"")+i+":"+c))})}),n}let _=!1;function Ft(t){return typeof t=="boolean"&&(_=t),_}function O(t){const e=typeof t=="string"?M(t,!0,_):t;if(e){const n=S(e.provider,e.prefix),r=e.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Dt(t,e){const n=M(t,!0,_);if(!n)return!1;const r=S(n.provider,n.prefix);return Ie(r,n.name,e)}function gt(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),_&&!e&&!t.prefix){let o=!1;return Rt(t)&&(t.prefix="",Nt(t,(s,i)=>{i&&Dt(s,i)&&(o=!0)})),o}const n=t.prefix;if(!z({provider:e,prefix:n,name:"a"}))return!1;const r=S(e,n);return!!ct(r,t)}function Se(t){return!!O(t)}function Ce(t){const e=O(t);return e?{...L,...e}:null}function Ae(t){const e={loaded:[],missing:[],pending:[]},n=Object.create(null);t.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return t.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const s=o.provider,i=o.prefix,a=o.name,c=n[s]||(n[s]=Object.create(null)),u=c[i]||(c[i]=S(s,i));let l;a in u.icons?l=e.loaded:i===""||u.missing.has(a)?l=e.missing:l=e.pending;const d={provider:s,prefix:i,name:a};l.push(d)}),e}function zt(t,e){t.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(o=>o.id!==e))})}function ve(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let n=!1;const r=t.provider,o=t.prefix;e.forEach(s=>{const i=s.icons,a=i.pending.length;i.pending=i.pending.filter(c=>{if(c.prefix!==o)return!0;const u=c.name;if(t.icons[u])i.loaded.push({provider:r,prefix:o,name:u});else if(t.missing.has(u))i.missing.push({provider:r,prefix:o,name:u});else return n=!0,!0;return!1}),i.pending.length!==a&&(n||zt([t],s.id),s.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),s.abort))})}))}let Pe=0;function Te(t,e,n){const r=Pe++,o=zt.bind(null,n,r);if(!e.pending.length)return o;const s={id:r,icons:e,callback:t,abort:o};return n.forEach(i=>{(i.loaderCallbacks||(i.loaderCallbacks=[])).push(s)}),o}const tt=Object.create(null);function mt(t,e){tt[t]=e}function et(t){return tt[t]||tt[""]}function ke(t,e=!0,n=!1){const r=[];return t.forEach(o=>{const s=typeof o=="string"?M(o,e,n):o;s&&r.push(s)}),r}var je={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function _e(t,e,n,r){const o=t.resources.length,s=t.random?Math.floor(Math.random()*o):t.index;let i;if(t.random){let p=t.resources.slice(0);for(i=[];p.length>1;){const I=Math.floor(Math.random()*p.length);i.push(p[I]),p=p.slice(0,I).concat(p.slice(I+1))}i=i.concat(p)}else i=t.resources.slice(s).concat(t.resources.slice(0,s));const a=Date.now();let c="pending",u=0,l,d=null,h=[],m=[];typeof r=="function"&&m.push(r);function y(){d&&(clearTimeout(d),d=null)}function b(){c==="pending"&&(c="aborted"),y(),h.forEach(p=>{p.status==="pending"&&(p.status="aborted")}),h=[]}function x(p,I){I&&(m=[]),typeof p=="function"&&m.push(p)}function C(){return{startTime:a,payload:e,status:c,queriesSent:u,queriesPending:h.length,subscribe:x,abort:b}}function w(){c="failed",m.forEach(p=>{p(void 0,l)})}function g(){h.forEach(p=>{p.status==="pending"&&(p.status="aborted")}),h=[]}function ee(p,I,P){const N=I!=="success";switch(h=h.filter(A=>A!==p),c){case"pending":break;case"failed":if(N||!t.dataAfterTimeout)return;break;default:return}if(I==="abort"){l=P,w();return}if(N){l=P,h.length||(i.length?W():w());return}if(y(),g(),!t.random){const A=t.resources.indexOf(p.resource);A!==-1&&A!==t.index&&(t.index=A)}c="completed",m.forEach(A=>{A(P)})}function W(){if(c!=="pending")return;y();const p=i.shift();if(p===void 0){if(h.length){d=setTimeout(()=>{y(),c==="pending"&&(g(),w())},t.timeout);return}w();return}const I={status:"pending",resource:p,callback:(P,N)=>{ee(I,P,N)}};h.push(I),u++,d=setTimeout(W,t.rotate),n(p,e,I.callback)}return setTimeout(W),C}function Ht(t){const e={...je,...t};let n=[];function r(){n=n.filter(a=>a().status==="pending")}function o(a,c,u){const l=_e(e,a,c,(d,h)=>{r(),u&&u(d,h)});return n.push(l),l}function s(a){return n.find(c=>a(c))||null}return{query:o,find:s,setIndex:a=>{e.index=a},getIndex:()=>e.index,cleanup:r}}function at(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const q=Object.create(null),T=["https://api.simplesvg.com","https://api.unisvg.com"],H=[];for(;T.length>0;)T.length===1||Math.random()>.5?H.push(T.shift()):H.push(T.pop());q[""]=at({resources:["https://api.iconify.design"].concat(H)});function yt(t,e){const n=at(e);return n===null?!1:(q[t]=n,!0)}function V(t){return q[t]}function Oe(){return Object.keys(q)}function bt(){}const J=Object.create(null);function Ee(t){if(!J[t]){const e=V(t);if(!e)return;const n=Ht(e),r={config:e,redundancy:n};J[t]=r}return J[t]}function Qt(t,e,n){let r,o;if(typeof t=="string"){const s=et(t);if(!s)return n(void 0,424),bt;o=s.send;const i=Ee(t);i&&(r=i.redundancy)}else{const s=at(t);if(s){r=Ht(s);const i=t.resources?t.resources[0]:"",a=et(i);a&&(o=a.send)}}return!r||!o?(n(void 0,424),bt):r.query(e,o,n)().abort}const wt="iconify2",E="iconify",$t=E+"-count",It=E+"-version",Ut=36e5,Le=168;function nt(t,e){try{return t.getItem(e)}catch{}}function ut(t,e,n){try{return t.setItem(e,n),!0}catch{}}function xt(t,e){try{t.removeItem(e)}catch{}}function ot(t,e){return ut(t,$t,e.toString())}function rt(t){return parseInt(nt(t,$t))||0}const v={local:!0,session:!0},qt={local:new Set,session:new Set};let lt=!1;function Me(t){lt=t}let D=typeof window>"u"?{}:window;function Vt(t){const e=t+"Storage";try{if(D&&D[e]&&typeof D[e].length=="number")return D[e]}catch{}v[t]=!1}function Bt(t,e){const n=Vt(t);if(!n)return;const r=nt(n,It);if(r!==wt){if(r){const a=rt(n);for(let c=0;c<a;c++)xt(n,E+c.toString())}ut(n,It,wt),ot(n,0);return}const o=Math.floor(Date.now()/Ut)-Le,s=a=>{const c=E+a.toString(),u=nt(n,c);if(typeof u=="string"){try{const l=JSON.parse(u);if(typeof l=="object"&&typeof l.cached=="number"&&l.cached>o&&typeof l.provider=="string"&&typeof l.data=="object"&&typeof l.data.prefix=="string"&&e(l,a))return!0}catch{}xt(n,c)}};let i=rt(n);for(let a=i-1;a>=0;a--)s(a)||(a===i-1?(i--,ot(n,i)):qt[t].add(a))}function Wt(){if(!lt){Me(!0);for(const t in v)Bt(t,e=>{const n=e.data,r=e.provider,o=n.prefix,s=S(r,o);if(!ct(s,n).length)return!1;const i=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,i):i,!0})}}function Ne(t,e){const n=t.lastModifiedCached;if(n&&n>=e)return n===e;if(t.lastModifiedCached=e,n)for(const r in v)Bt(r,o=>{const s=o.data;return o.provider!==t.provider||s.prefix!==t.prefix||s.lastModified===e});return!0}function Re(t,e){lt||Wt();function n(r){let o;if(!v[r]||!(o=Vt(r)))return;const s=qt[r];let i;if(s.size)s.delete(i=Array.from(s).shift());else if(i=rt(o),!ot(o,i+1))return;const a={cached:Math.floor(Date.now()/Ut),provider:t.provider,data:e};return ut(o,E+i.toString(),JSON.stringify(a))}e.lastModified&&!Ne(t,e.lastModified)||Object.keys(e.icons).length&&(e.not_found&&(e=Object.assign({},e),delete e.not_found),n("local")||n("session"))}function St(){}function Fe(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,ve(t)}))}function De(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:n,prefix:r}=t,o=t.iconsToLoad;delete t.iconsToLoad;let s;if(!o||!(s=et(n)))return;s.prepare(n,r,o).forEach(a=>{Qt(n,a,c=>{if(typeof c!="object")a.icons.forEach(u=>{t.missing.add(u)});else try{const u=ct(t,c);if(!u.length)return;const l=t.pendingIcons;l&&u.forEach(d=>{l.delete(d)}),Re(t,c)}catch(u){console.error(u)}Fe(t)})})}))}const ft=(t,e)=>{const n=ke(t,!0,Ft()),r=Ae(n);if(!r.pending.length){let c=!0;return e&&setTimeout(()=>{c&&e(r.loaded,r.missing,r.pending,St)}),()=>{c=!1}}const o=Object.create(null),s=[];let i,a;return r.pending.forEach(c=>{const{provider:u,prefix:l}=c;if(l===a&&u===i)return;i=u,a=l,s.push(S(u,l));const d=o[u]||(o[u]=Object.create(null));d[l]||(d[l]=[])}),r.pending.forEach(c=>{const{provider:u,prefix:l,name:d}=c,h=S(u,l),m=h.pendingIcons||(h.pendingIcons=new Set);m.has(d)||(m.add(d),o[u][l].push(d))}),s.forEach(c=>{const{provider:u,prefix:l}=c;o[u][l].length&&De(c,o[u][l])}),e?Te(e,r,s):St},ze=t=>new Promise((e,n)=>{const r=typeof t=="string"?M(t,!0):t;if(!r){n(t);return}ft([r||t],o=>{if(o.length&&r){const s=O(r);if(s){e({...L,...s});return}}n(t)})});function He(t){try{const e=typeof t=="string"?JSON.parse(t):t;if(typeof e.body=="string")return{...e}}catch{}}function Qe(t,e){const n=typeof t=="string"?M(t,!0,!0):null;if(!n){const s=He(t);return{value:t,data:s}}const r=O(n);if(r!==void 0||!n.prefix)return{value:t,name:n,data:r};const o=ft([n],()=>e(t,n,O(n)));return{value:t,name:n,loading:o}}function X(t){return t.hasAttribute("inline")}let Gt=!1;try{Gt=navigator.vendor.indexOf("Apple")===0}catch{}function $e(t,e){switch(e){case"svg":case"bg":case"mask":return e}return e!=="style"&&(Gt||t.indexOf("<a")===-1)?"svg":t.indexOf("currentColor")===-1?"bg":"mask"}const Ue=/(-?[0-9.]*[0-9]+[0-9.]*)/g,qe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function st(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const r=t.split(Ue);if(r===null||!r.length)return t;const o=[];let s=r.shift(),i=qe.test(s);for(;;){if(i){const a=parseFloat(s);isNaN(a)?o.push(s):o.push(Math.ceil(a*e*n)/n)}else o.push(s);if(s=r.shift(),s===void 0)return o.join("");i=!i}}const Ve=t=>t==="unset"||t==="undefined"||t==="none";function Jt(t,e){const n={...L,...t},r={...Lt,...e},o={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(y=>{const b=[],x=y.hFlip,C=y.vFlip;let w=y.rotate;x?C?w+=2:(b.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),b.push("scale(-1 1)"),o.top=o.left=0):C&&(b.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),b.push("scale(1 -1)"),o.top=o.left=0);let g;switch(w<0&&(w-=Math.floor(w/4)*4),w=w%4,w){case 1:g=o.height/2+o.top,b.unshift("rotate(90 "+g.toString()+" "+g.toString()+")");break;case 2:b.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:g=o.width/2+o.left,b.unshift("rotate(-90 "+g.toString()+" "+g.toString()+")");break}w%2===1&&(o.left!==o.top&&(g=o.left,o.left=o.top,o.top=g),o.width!==o.height&&(g=o.width,o.width=o.height,o.height=g)),b.length&&(s='<g transform="'+b.join(" ")+'">'+s+"</g>")});const i=r.width,a=r.height,c=o.width,u=o.height;let l,d;i===null?(d=a===null?"1em":a==="auto"?u:a,l=st(d,c/u)):(l=i==="auto"?c:i,d=a===null?st(l,u/c):a==="auto"?u:a);const h={},m=(y,b)=>{Ve(b)||(h[y]=b.toString())};return m("width",l),m("height",d),h.viewBox=o.left.toString()+" "+o.top.toString()+" "+c.toString()+" "+u.toString(),{attributes:h,body:s}}const Be=()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}};let U=Be();function We(t){U=t}function Ge(){return U}function Je(t,e){const n=V(t);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let o=0;n.resources.forEach(i=>{o=Math.max(o,i.length)});const s=e+".json?icons=";r=n.maxURL-o-n.path.length-s.length}return r}function Xe(t){return t===404}const Ye=(t,e,n)=>{const r=[],o=Je(t,e),s="icons";let i={type:s,provider:t,prefix:e,icons:[]},a=0;return n.forEach((c,u)=>{a+=c.length+1,a>=o&&u>0&&(r.push(i),i={type:s,provider:t,prefix:e,icons:[]},a=c.length),i.icons.push(c)}),r.push(i),r};function Ze(t){if(typeof t=="string"){const e=V(t);if(e)return e.path}return"/"}const Ke=(t,e,n)=>{if(!U){n("abort",424);return}let r=Ze(e.provider);switch(e.type){case"icons":{const s=e.prefix,a=e.icons.join(","),c=new URLSearchParams({icons:a});r+=s+".json?"+c.toString();break}case"custom":{const s=e.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let o=503;U(t+r).then(s=>{const i=s.status;if(i!==200){setTimeout(()=>{n(Xe(i)?"abort":"next",i)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",o)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",o)})},tn={prepare:Ye,send:Ke};function Ct(t,e){switch(t){case"local":case"session":v[t]=e;break;case"all":for(const n in v)v[n]=e;break}}const Y="data-style";let Xt="";function en(t){Xt=t}function At(t,e){let n=Array.from(t.childNodes).find(r=>r.hasAttribute&&r.hasAttribute(Y));n||(n=document.createElement("style"),n.setAttribute(Y,Y),t.appendChild(n)),n.textContent=":host{display:inline-block;vertical-align:"+(e?"-0.125em":"0")+"}span,svg{display:block}"+Xt}function Yt(){mt("",tn),Ft(!0);let t;try{t=window}catch{}if(t){if(Wt(),t.IconifyPreload!==void 0){const n=t.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof n=="object"&&n!==null&&(n instanceof Array?n:[n]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!gt(o))&&console.error(r)}catch{console.error(r)}})}if(t.IconifyProviders!==void 0){const n=t.IconifyProviders;if(typeof n=="object"&&n!==null)for(const r in n){const o="IconifyProviders["+r+"] is invalid.";try{const s=n[r];if(typeof s!="object"||!s||s.resources===void 0)continue;yt(r,s)||console.error(o)}catch{console.error(o)}}}}return{enableCache:n=>Ct(n,!0),disableCache:n=>Ct(n,!1),iconExists:Se,getIcon:Ce,listIcons:xe,addIcon:Dt,addCollection:gt,calculateSize:st,buildIcon:Jt,loadIcons:ft,loadIcon:ze,addAPIProvider:yt,appendCustomStyle:en,_api:{getAPIConfig:V,setAPIModule:mt,sendAPIQuery:Qt,setFetch:We,getFetch:Ge,listAPIProviders:Oe}}}function Zt(t,e){let n=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in e)n+=" "+r+'="'+e[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}function nn(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function on(t){return"data:image/svg+xml,"+nn(t)}function rn(t){return'url("'+on(t)+'")'}const it={"background-color":"currentColor"},Kt={"background-color":"transparent"},vt={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Pt={"-webkit-mask":it,mask:it,background:Kt};for(const t in Pt){const e=Pt[t];for(const n in vt)e[t+"-"+n]=vt[n]}function Tt(t){return t?t+(t.match(/^[-0-9.]+$/)?"px":""):"inherit"}function sn(t,e,n){const r=document.createElement("span");let o=t.body;o.indexOf("<a")!==-1&&(o+="<!-- "+Date.now()+" -->");const s=t.attributes,i=Zt(o,{...s,width:e.width+"",height:e.height+""}),a=rn(i),c=r.style,u={"--svg":a,width:Tt(s.width),height:Tt(s.height),...n?it:Kt};for(const l in u)c.setProperty(l,u[l]);return r}let j;function cn(){try{j=window.trustedTypes.createPolicy("iconify",{createHTML:t=>t})}catch{j=null}}function an(t){return j===void 0&&cn(),j?j.createHTML(t):t}function un(t){const e=document.createElement("span"),n=t.attributes;let r="";n.width||(r="width: inherit;"),n.height||(r+="height: inherit;"),r&&(n.style=r);const o=Zt(t.body,n);return e.innerHTML=an(o),e.firstChild}function kt(t,e){const n=e.icon.data,r=e.customisations,o=Jt(n,r);r.preserveAspectRatio&&(o.attributes.preserveAspectRatio=r.preserveAspectRatio);const s=e.renderedMode;let i;switch(s){case"svg":i=un(o);break;default:i=sn(o,{...L,...n},s==="mask")}const a=Array.from(t.childNodes).find(c=>{const u=c.tagName&&c.tagName.toUpperCase();return u==="SPAN"||u==="SVG"});a?i.tagName==="SPAN"&&a.tagName===i.tagName?a.setAttribute("style",i.getAttribute("style")):t.replaceChild(i,a):t.appendChild(i)}function jt(t,e,n){const r=n&&(n.rendered?n:n.lastRender);return{rendered:!1,inline:e,icon:t,lastRender:r}}function ln(t="iconify-icon"){let e,n;try{e=window.customElements,n=window.HTMLElement}catch{return}if(!e||!n)return;const r=e.get(t);if(r)return r;const o=["icon","mode","inline","width","height","rotate","flip"],s=class extends n{constructor(){super();R(this,"_shadowRoot");R(this,"_state");R(this,"_checkQueued",!1);const c=this._shadowRoot=this.attachShadow({mode:"open"}),u=X(this);At(c,u),this._state=jt({value:""},u),this._queueCheck()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(c){if(c==="inline"){const u=X(this),l=this._state;u!==l.inline&&(l.inline=u,At(this._shadowRoot,u))}else this._queueCheck()}get icon(){const c=this.getAttribute("icon");if(c&&c.slice(0,1)==="{")try{return JSON.parse(c)}catch{}return c}set icon(c){typeof c=="object"&&(c=JSON.stringify(c)),this.setAttribute("icon",c)}get inline(){return X(this)}set inline(c){c?this.setAttribute("inline","true"):this.removeAttribute("inline")}restartAnimation(){const c=this._state;if(c.rendered){const u=this._shadowRoot;if(c.renderedMode==="svg")try{u.lastChild.setCurrentTime(0);return}catch{}kt(u,c)}}get status(){const c=this._state;return c.rendered?"rendered":c.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const c=this._state,u=this.getAttribute("icon");if(u!==c.icon.value){this._iconChanged(u);return}if(!c.rendered)return;const l=this.getAttribute("mode"),d=ht(this);(c.attrMode!==l||pe(c.customisations,d))&&this._renderIcon(c.icon,d,l)}_iconChanged(c){const u=Qe(c,(l,d,h)=>{const m=this._state;if(m.rendered||this.getAttribute("icon")!==l)return;const y={value:l,name:d,data:h};y.data?this._gotIconData(y):m.icon=y});u.data?this._gotIconData(u):this._state=jt(u,this._state.inline,this._state)}_gotIconData(c){this._checkQueued=!1,this._renderIcon(c,ht(this),this.getAttribute("mode"))}_renderIcon(c,u,l){const d=$e(c.data.body,l),h=this._state.inline;kt(this._shadowRoot,this._state={rendered:!0,icon:c,inline:h,customisations:u,attrMode:l,renderedMode:d})}};o.forEach(a=>{a in s.prototype||Object.defineProperty(s.prototype,a,{get:function(){return this.getAttribute(a)},set:function(c){c!==null?this.setAttribute(a,c):this.removeAttribute(a)}})});const i=Yt();for(const a in i)s[a]=s.prototype[a]=i[a];return e.define(t,s),s}ln()||Yt();const Cn=f.shape({appLogo:f.node,appName:f.string,theme:f.shape({background:f.string}),enableConnect:f.bool,enableLocale:f.bool,navigation:f.arrayOf(f.shape({title:f.oneOfType([f.string,f.object]),link:f.oneOfType([f.string,f.object]),icon:f.string,items:f.arrayOf(f.shape({title:f.oneOfType([f.string,f.object]),link:f.oneOfType([f.string,f.object])}))}))}),fn=f.shape({showText:f.bool,showRole:f.bool,switchDid:f.bool,switchProfile:f.bool,switchPassport:f.bool,disableLogout:f.bool,onLogin:f.func,onLogout:f.func,onSwitchDid:f.func,onSwitchProfile:f.func,onSwitchPassport:f.func,menu:f.array,menuRender:f.func,dark:f.bool,size:f.number}),B=(t,e,n="children")=>t.map(r=>Array.isArray(r[n])?e({...r,[n]:B(r[n],e,n)}):e(r)),An=(t,e="children")=>{const n=[];return B(t,r=>n.push(r),e),n},dt=(t,e,n="children")=>t.map(r=>({...r})).filter(r=>{const o=r[n];if(Array.isArray(o)){const i=dt(o,e,n);r[n]=i!=null&&i.length?i:void 0}const s={filteredChildren:r[n],isLeaf:!(o!=null&&o.length)};return e(r,s)}),dn=t=>/^https?:\/\//.test(t),vn=t=>/^[\w-]+:[\w-]+$/.test(t),hn=t=>{if(!t||!(t!=null&&t.startsWith("/")))return!1;const e=o=>o.endsWith("/")?o:`${o}/`,n=e(window.location.pathname),r=e(new URL(t,window.location.origin).pathname);return n.startsWith(r)},Pn=(t=[])=>{const e=t.map((r,o)=>({path:r,index:o})).filter(r=>hn(r.path));return e!=null&&e.length?e.slice(1).reduce((r,o)=>r.path.length>=o.path.length?r:o,e[0]).index:-1};var _t,Ot;const Tn=((_t=window==null?void 0:window.blocklet)==null?void 0:_t.groupPrefix)||((Ot=window==null?void 0:window.blocklet)==null?void 0:Ot.prefix)||"/",pn=t=>{const e={...t},n=t==null?void 0:t.background;return typeof n=="string"?e.background={header:n,footer:n,default:n}:n&&typeof n=="object"&&(e.background={header:n.header||n.default,footer:n.footer||n.default,default:n.default}),e},gn=(t,e="en")=>{if(!(t!=null&&t.length))return t;const n=(o,s)=>typeof o=="string"?o:typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o,r=(o,s)=>{if(typeof o=="string"){if(dn(o)){const a=new URL(o);return a.searchParams.set("locale",s),a.href}const i=new URL(o,window.location.origin);return i.searchParams.set("locale",s),i.pathname+i.search}return typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o};return B(t,o=>{var s;return{...o,title:n(o.title,e),link:(s=o.items)!=null&&s.length?o.link:r(o.link,e)}},"items")},mn=t=>B(t,e=>e.role?{...e,role:Array.isArray(e.role)?e.role:[e.role]}:e,"items"),yn=t=>{if(!(t!=null&&t.length))return null;const e=mn(t),n={header:[],footer:[],social:[],bottom:[],dashboard:[],sessionManager:[]};return e.forEach(r=>{var o;r.section?Array.isArray(r.section)?r.section.forEach(s=>{var i;(i=n[s])==null||i.push(r)}):typeof r.section=="string"&&((o=n[r.section])==null||o.push(r)):n.header.push(r)}),n},kn=t=>{if(!t)return null;const e={...t};return e.theme=pn(e.theme),e.navigation=yn(bn(e.navigation)),e},bn=(t=[])=>dt(t,(e,n)=>{var r;return!!e.link||((r=n.filteredChildren)==null?void 0:r.length)},"items"),wn=(t,e)=>dt(t,(n,r)=>{var s;const o=!n.role||e&&n.role.includes(e);return r.isLeaf?o:o&&((s=r.filteredChildren)==null?void 0:s.length)},"items");function te({formattedBlocklet:t,addons:e,sessionManagerProps:n}){var h,m,y,b;const r=Z.useContext(re),{locale:o}=se()||{},{enableConnect:s=!0,enableLocale:i=!0}=t,a=!!((h=r==null?void 0:r.session)!=null&&h.user);let c=gn((m=t==null?void 0:t.navigation)==null?void 0:m.sessionManager,o)||[];c=wn(c,(b=(y=r==null?void 0:r.session)==null?void 0:y.user)==null?void 0:b.role);const l=(()=>{if(e&&typeof e!="function")return Array.isArray(e)?e:[e];let x=[];if(i&&o&&x.push(F.jsx(ue,{showText:!1},"locale-selector")),s&&r){const C=[];a&&(c?c.slice(0,5):[]).forEach(g=>{C.push({label:g.title,icon:g.icon?F.jsx("iconify-icon",{icon:g.icon,height:24,style:{marginRight:8}}):null,component:"a",href:g.link,key:g.link})}),x.push(F.jsx(ie,{session:r.session,locale:o,menu:C,showRole:!0,...n},"session-manager"))}return typeof e=="function"&&(x=e(x)||[]),x})();return Z.createElement(F.Fragment,null,...Array.isArray(l)?l:[l])}te.propTypes={formattedBlocklet:f.object.isRequired,addons:f.oneOfType([f.func,f.node]),sessionManagerProps:fn};te.defaultProps={addons:null,sessionManagerProps:{showRole:!0}};const jn=()=>{const t=ce();Z.useEffect(()=>{t.wallet&&ae(()=>import("./index-32a94750.js").then(e=>e.i),["assets/index-32a94750.js","assets/index-2668c3ea.js","assets/index-d8bbb108.css"]).then(e=>{e.call||(e=e.default),e.call("arcHideTopBar","{}")}).catch(e=>{console.error("load dsbridge error",e)})},[t])};export{te as H,wn as a,Cn as b,An as c,Pn as d,vn as e,kn as f,gn as g,dn as i,B as m,Tn as p,fn as s,jn as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aq as a,ar as t,as as e,j as r,at as o}from"./index-2668c3ea.js";const i={zh:a(t),en:a(e)};function p(s){return function(n){return r.jsx(o,{translations:i,children:r.jsx(s,{...n})})}}export{p as w};
|
package/dist/index.html
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
padding: 0;
|
|
15
15
|
}
|
|
16
16
|
</style>
|
|
17
|
-
<script type="module" crossorigin src="/.well-known/service/static/assets/index-
|
|
17
|
+
<script type="module" crossorigin src="/.well-known/service/static/assets/index-2668c3ea.js"></script>
|
|
18
18
|
<link rel="stylesheet" href="/.well-known/service/static/assets/index-d8bbb108.css">
|
|
19
19
|
</head>
|
|
20
20
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.21-beta-
|
|
6
|
+
"version": "1.16.21-beta-bd0e2503",
|
|
7
7
|
"description": "Provide unified services for every blocklet",
|
|
8
8
|
"main": "api/index.js",
|
|
9
9
|
"files": [
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
33
33
|
"license": "Apache-2.0",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@abtnode/analytics": "1.16.21-beta-
|
|
36
|
-
"@abtnode/auth": "1.16.21-beta-
|
|
37
|
-
"@abtnode/client": "1.16.21-beta-
|
|
38
|
-
"@abtnode/connect-storage": "1.16.21-beta-
|
|
39
|
-
"@abtnode/constant": "1.16.21-beta-
|
|
40
|
-
"@abtnode/core": "1.16.21-beta-
|
|
41
|
-
"@abtnode/cron": "1.16.21-beta-
|
|
42
|
-
"@abtnode/logger": "1.16.21-beta-
|
|
43
|
-
"@abtnode/models": "1.16.21-beta-
|
|
44
|
-
"@abtnode/router-templates": "1.16.21-beta-
|
|
45
|
-
"@abtnode/util": "1.16.21-beta-
|
|
35
|
+
"@abtnode/analytics": "1.16.21-beta-bd0e2503",
|
|
36
|
+
"@abtnode/auth": "1.16.21-beta-bd0e2503",
|
|
37
|
+
"@abtnode/client": "1.16.21-beta-bd0e2503",
|
|
38
|
+
"@abtnode/connect-storage": "1.16.21-beta-bd0e2503",
|
|
39
|
+
"@abtnode/constant": "1.16.21-beta-bd0e2503",
|
|
40
|
+
"@abtnode/core": "1.16.21-beta-bd0e2503",
|
|
41
|
+
"@abtnode/cron": "1.16.21-beta-bd0e2503",
|
|
42
|
+
"@abtnode/logger": "1.16.21-beta-bd0e2503",
|
|
43
|
+
"@abtnode/models": "1.16.21-beta-bd0e2503",
|
|
44
|
+
"@abtnode/router-templates": "1.16.21-beta-bd0e2503",
|
|
45
|
+
"@abtnode/util": "1.16.21-beta-bd0e2503",
|
|
46
46
|
"@arcblock/did": "^1.18.107",
|
|
47
47
|
"@arcblock/did-auth": "1.18.107",
|
|
48
48
|
"@arcblock/did-ext": "^1.18.107",
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
"@arcblock/jwt": "1.18.107",
|
|
52
52
|
"@arcblock/validator": "^1.18.107",
|
|
53
53
|
"@arcblock/ws": "1.18.107",
|
|
54
|
-
"@blocklet/constant": "1.16.21-beta-
|
|
54
|
+
"@blocklet/constant": "1.16.21-beta-bd0e2503",
|
|
55
55
|
"@blocklet/form-builder": "^0.1.11",
|
|
56
56
|
"@blocklet/form-collector": "^0.1.6",
|
|
57
|
-
"@blocklet/meta": "1.16.21-beta-
|
|
58
|
-
"@blocklet/sdk": "1.16.21-beta-
|
|
57
|
+
"@blocklet/meta": "1.16.21-beta-bd0e2503",
|
|
58
|
+
"@blocklet/sdk": "1.16.21-beta-bd0e2503",
|
|
59
59
|
"@did-connect/authenticator": "^2.2.1",
|
|
60
60
|
"@did-connect/relay-adapter-express": "^2.2.1",
|
|
61
61
|
"@ocap/client": "1.18.107",
|
|
@@ -94,12 +94,12 @@
|
|
|
94
94
|
},
|
|
95
95
|
"resolutions": {},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"@abtnode/ux": "1.16.21-beta-
|
|
97
|
+
"@abtnode/ux": "1.16.21-beta-bd0e2503",
|
|
98
98
|
"@arcblock/did-connect": "^2.8.23",
|
|
99
99
|
"@arcblock/icons": "^2.8.23",
|
|
100
100
|
"@arcblock/ux": "^2.8.23",
|
|
101
101
|
"@blocklet/launcher-layout": "2.2.48",
|
|
102
|
-
"@blocklet/tracker": "1.16.21-beta-
|
|
102
|
+
"@blocklet/tracker": "1.16.21-beta-bd0e2503",
|
|
103
103
|
"@blocklet/ui-react": "^2.8.23",
|
|
104
104
|
"@emotion/react": "^11.10.4",
|
|
105
105
|
"@emotion/styled": "^11.10.4",
|
|
@@ -171,5 +171,5 @@
|
|
|
171
171
|
"url": "https://github.com/ArcBlock/blocklet-server/issues",
|
|
172
172
|
"email": "shijun@arcblock.io"
|
|
173
173
|
},
|
|
174
|
-
"gitHead": "
|
|
174
|
+
"gitHead": "f4550e061b661cb67d7f1413ada51f3f6491f0b8"
|
|
175
175
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as y,a6 as x,q as R,bE as j,O as P,r as s,c as D,bW as S,bD as W,j as c,ak as O}from"./index-cf61f7db.js";import{A as k,S as A}from"./add-component-core-2a808729.js";import"./uniqBy-b149d2ef.js";import"./page-header-63e0831d.js";import"./index-118e2531.js";import"./Hidden-4067f85a.js";import"./index-4010c313.js";import"./lottie-1efa41ad.js";import"./launch-result-message-5cb7523a.js";import"./index-ea69217a.js";import"./EditIcon-12f4ff59.js";import"./Done-70ebcf6d.js";import"./Google-d28b2347.js";import"./TextField-3d8b540c.js";import"./FormControl-4556d3f8.js";import"./useFormControl-b7cc7d69.js";import"./InputLabel-b97f286b.js";import"./Select-3544f27a.js";import"./logo-uploader-d3b0ef9a.js";import"./index-47788371.js";import"./api-71b66169.js";import"./makeStyles-49c189a4.js";import"./toPropertyKey-d63e044c.js";import"./confirm-2f20e316.js";import"./DialogContentText-ef0138ce.js";import"./Alert-18856afa.js";import"./format-error-86f361f1.js";import"./ListItem-1faf6af2.js";import"./util-ab8d703d.js";import"./index-013c3cfd.js";import"./TableRow-d12808ad.js";import"./index-f602c035.js";import"./session-2a0eb2cb.js";import"./did-address-deca4ec1.js";import"./Stepper-e3579a23.js";import"./ArrowDropDown-0147576b.js";import"./Add-280b55d6.js";import"./Launch-c5a2e753.js";import"./DeleteOutline-9e947dc9.js";import"./click-to-copy-d2e126fa.js";import"./fallback-27e04c22.js";import"./index-6c3c2979.js";import"./Search-29f3b44d.js";import"./Grid-dcf85761.js";import"./InputAdornment-65e20722.js";import"./preact.module-783a6d9f.js";import"./content-layout-80ff1eb2.js";import"./use-blocklet-info-for-connect-did-spaces-e4c92196.js";import"./spaces-30889313.js";import"./index-997aa7a6.js";import"./index-79a0407d.js";import"./ExpandMore-5e89e7bd.js";import"./ButtonGroup-0a58968f.js";function At(){var n;const{t:l}=y(),{blocklet:r}=x(),[u]=R(),{componentDid:d}=j(),h=P(t=>t.breakpoints.down("md")),f=u.get("mode")==="dialog",e=(n=r==null?void 0:r.meta)==null?void 0:n.did,a=new URL(window.location.href),i=(a.searchParams.get("store")||"").split(",").filter(Boolean).map(t=>{try{return new URL(t.startsWith("http")?t:`https://${t}`).origin}catch(o){return console.error(o),null}}).filter(Boolean),[w,g]=s.useState(i.map(t=>({url:t,name:t.replace("https://","")}))),m=a.searchParams.get("resourceType")||"";s.useEffect(()=>{(async()=>{try{const t=await Promise.all(i.map(async o=>{const E=D(o,"/api/store.json"),{data:b}=await S.get(E);return{url:o,name:b.name}}));g(t||[])}catch(t){console.error(t)}})()},[i.join(",")]);const C=()=>{window.parent.postMessage({event:"resourceDialog.close",componentDid:d},"*")};s.useEffect(()=>{const t=W();return e&&t.connect(),()=>{e&&t.isConnected()&&t.disconnect()}},[e]);const p=({inDialog:t=!0}={})=>c.jsx(k,{stores:w,resourceType:m,mode:"embed",inDialog:t,storageKey:A(m)});return f?c.jsx(O,{className:"resource-dialog",title:l("blocklet.publish.addResource"),maxWidth:!1,fullWidth:!1,PaperProps:{style:h?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(t,o)=>{o!=="backdropClick"&&C()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:p()}):p({inDialog:!1})}export{At as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bW as a}from"./index-cf61f7db.js";a.defaults.timeout=10*1e3;const o=a.create();export{o as a};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{aW as O,j as e,r as f,F as Y,a6 as q,ci as M,cj as Q,Q as N,B as c,P as I,y as U,U as G,n as y}from"./index-cf61f7db.js";import{D as J,u as V,a as X,A as Z}from"./domain-list-b5d9635e.js";import{C as tt}from"./confirm-2f20e316.js";import{P as rt}from"./page-header-63e0831d.js";import{r as et}from"./index-cdb9820e.js";import{_ as ot}from"./useSetState-49e815fe.js";import{S as w}from"./button-b114c402.js";import{S as it}from"./layout-fe001017.js";import{S as nt}from"./step-actions-cc9fccda.js";import"./Add-280b55d6.js";import"./ExpandMore-5e89e7bd.js";import"./LockIcon-5bf90304.js";import"./did-address-deca4ec1.js";import"./permission-d80dce81.js";import"./useAsync-aeba6414.js";import"./session-2a0eb2cb.js";import"./index-4010c313.js";import"./InfoOutlined-da2cfef7.js";import"./OpenInNew-e91f9d7e.js";import"./api-71b66169.js";import"./index-f602c035.js";import"./util-ab8d703d.js";import"./TextField-3d8b540c.js";import"./FormControl-4556d3f8.js";import"./useFormControl-b7cc7d69.js";import"./InputLabel-b97f286b.js";import"./Select-3544f27a.js";import"./actions-1c072ea2.js";import"./CardContent-a3c41a0c.js";import"./Alert-18856afa.js";import"./DialogContentText-ef0138ce.js";import"./format-error-86f361f1.js";import"./content-layout-80ff1eb2.js";var x={exports:{}};const st=et,at=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class L extends Error{constructor(i){super(),i instanceof Error?(this.originalError=i,{message:i}=i):(this.originalError=new Error(i),this.originalError.stack=this.stack),this.name="AbortError",this.message=i}}const lt=(o,i,r)=>{const n=r.retries-(i-1);return o.attemptNumber=i,o.retriesLeft=n,o},dt=o=>at.includes(o),$=(o,i)=>new Promise((r,n)=>{i={onFailedAttempt:()=>{},retries:10,...i};const a=st.operation(i);a.attempt(async h=>{try{r(await o(h))}catch(s){if(!(s instanceof Error)){n(new TypeError(`Non-error was thrown: "${s}". You should only throw errors.`));return}if(s instanceof L)a.stop(),n(s.originalError);else if(s instanceof TypeError&&!dt(s.message))a.stop(),n(s);else{lt(s,h,i);try{await i.onFailedAttempt(s)}catch(l){n(l);return}a.retry(s)||n(a.mainError())}}})});x.exports=$;x.exports.default=$;x.exports.AbortError=L;var mt=x.exports;const ct=O(mt);function E({onNext:o,onPrevious:i}){var C,T;const{t:r}=f.useContext(Y),[n,a]=f.useState(""),[h,s]=f.useState(!1),{blocklet:l}=q(),[S,F]=f.useState(""),g=V(),W=(((l==null?void 0:l.site)||{}).domainAliases||[]).map(t=>M(t.value,S)),[p,u]=ot({domain:"",invalidDNSDomain:null,type:""}),_=(T=(C=l.environments)==null?void 0:C.find(t=>t.key==="BLOCKLET_APP_PK"))==null?void 0:T.value,z=W.find(t=>Q.isDidDomain(t)),k=async t=>{a(r("setup.domain.addingDomain")),await g.validateDomain(t)&&(await G.addDomainAlias({input:{id:l.site.id,domainAlias:t,teamDid:l.meta.did,inBlockletSetup:!0}}).finally(()=>{u(null)}),o())},j=async({domain:t,type:d,nftDid:A,chainHost:P})=>{if(!n)try{if(a(r("setup.domain.checkingResolvable")),!await g.validateDomain(t)){a(""),s(r("setup.domain.invalidDomain"));return}let D=30;const v=3e3,K=D*1e3/v,R=setInterval(()=>{if(D<=0){clearInterval(R);return}a(`${r("setup.domain.checkingResolvable")} (${D--}s)`)},1e3),B=await ct(async()=>{const{data:m}=await N.get(`/dns-resolve?hostname=${t}`);if(!m.address)throw new Error("Cannot resolve domain");return m.address},{retries:K,minTimeout:v,maxTimeout:v,onFailedAttempt:console.error}).catch(console.error);if(clearInterval(R),!B){const m=r("setup.domain.cannotResolve",{domain:t});if(d==="nftDomain"){y.error(m),o();return}u({invalidDNSDomain:{domain:t,error:m},domain:t,type:d,nftDid:A,chainHost:P});return}if(B!==S){const m=r("setup.domain.resolvedAddressError",{domain:t,curDomain:window.location.hostname});if(d==="nftDomain"){y.error(m),o();return}u({invalidDNSDomain:{domain:t,error:m},domain:t,type:d,nftDid:A,chainHost:P});return}if(d==="nftDomain"){o();return}await k(t)}catch(b){y.error(b.message),a("")}},H=()=>{a(""),u({invalidDNSDomain:null})};return f.useEffect(()=>{N.get(`/dns-resolve?hostname=${window.location.hostname}`).then(({data:t})=>{F(t.address||"")}).catch(t=>{console.error(t.message)})},[]),e.jsxs(pt,{children:[e.jsx("div",{className:"header",children:e.jsx(rt,{title:r("setup.domain.title"),subTitle:r("setup.domain.subTitle"),onClickBack:i})}),e.jsxs(c,{className:"form",sx:{display:"flex",flexDirection:"column",gap:3,overflowY:"auto"},children:[e.jsxs(c,{children:[e.jsxs(c,{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem",children:[e.jsx(c,{display:"inline",children:r("setup.domain.skipStart")}),e.jsx(w,{variant:"text",size:"small",disabled:!!n,onClick:()=>o(),style:{paddingTop:0},children:e.jsx("span",{style:{textDecoration:"underline"},children:r("setup.domain.skip")})}),e.jsx(c,{display:"inline",children:r("setup.domain.skipEnd")})]}),e.jsx(c,{sx:{marginTop:"12px"},children:e.jsx(X,{listOnly:!0,inSetup:!0})})]}),e.jsxs(c,{children:[e.jsx(c,{fontWeight:"fontWeightBold",fontSize:"1.125rem",children:r("setup.domain.addTitle")}),e.jsx(Z,{autoFocus:!1,appPk:_,disabled:!!n,appId:l.appPid,siteId:l.site.id,teamDid:l.meta.did,sx:{marginTop:"12px"},cnameDomain:z,inBlockletSetup:!0,onInputDomain:t=>{u({domain:t.domain,type:t.type}),s(t.error)},onSuccess:async t=>{const d={domain:t.domain,type:t.type,nftDid:t.nftDid,chainHost:t.chainHost};u(d),await j(d)},onError:s})]})]}),p.invalidDNSDomain&&e.jsx(tt,{title:r("common.reminder"),description:r("setup.domain.invalidDNSReminder",{error:p.invalidDNSDomain.error}),color:"primary",confirm:r("setup.domain.continueAdd"),onConfirm:()=>k(p.invalidDNSDomain.domain),onCancel:H}),e.jsx(nt,{mt:8,disabled:!!n,blocklet:l,onStartNow:()=>o("complete"),children:p.domain?e.jsx(w,{variant:"contained",loading:!!n,disabled:h||!!n||!p.domain,onClick:()=>j(p),children:n||r("setup.next")}):e.jsx(w,{variant:"contained",disabled:!!n,onClick:()=>o(),children:r("setup.skip")})})]})}function Ut(o){return e.jsx(J,{children:e.jsx(E,{...o})})}E.propTypes={onNext:I.func,onPrevious:I.func};E.defaultProps={onNext:()=>{},onPrevious:()=>{}};const pt=U(it)`
|
|
2
|
-
height: 100%;
|
|
3
|
-
overflow-y: hidden;
|
|
4
|
-
.form {
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 100%;
|
|
7
|
-
word-break: break-all;
|
|
8
|
-
}
|
|
9
|
-
`;export{Ut as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{H as O,I as B,j as e,cv as Me,cB as Ne,P as o,cC as be,u as w,r as v,a7 as F,a$ as ve,X as he,a as z,S as N,n as J,cD as Oe,aW as Be,cE as We,cF as He,cG as Ue,cH as Ve,cI as Je,cJ as Ke,cK as De,B as h,O as Ce,bp as W,T as A,cL as Ge,c as Qe,a0 as Xe,G as L,x as Ye,bW as Ze,b8 as Z,bJ as xe,cj as Se,b5 as Te,bn as Ae,c7 as we,bH as et,cM as ge,cN as tt,y as nt,br as st,bC as it,cO as ot,cP as rt,a_ as at,cQ as lt,bI as ct,av as dt}from"./index-cf61f7db.js";import{d as mt}from"./Add-280b55d6.js";import{d as ut}from"./ExpandMore-5e89e7bd.js";import{d as pt}from"./LockIcon-5bf90304.js";import{W as ft}from"./did-address-deca4ec1.js";import{_ as ht,D as je,w as Ie}from"./permission-d80dce81.js";import{A as xt}from"./index-4010c313.js";import{C as ee,L as gt,a as jt}from"./confirm-2f20e316.js";import{_ as te,d as Re}from"./useSetState-49e815fe.js";import{d as yt}from"./InfoOutlined-da2cfef7.js";import{d as bt}from"./OpenInNew-e91f9d7e.js";import"./api-71b66169.js";import{I as vt}from"./index-f602c035.js";import{p as Pe}from"./util-ab8d703d.js";import{T as Dt}from"./TextField-3d8b540c.js";import{A as Ct}from"./actions-1c072ea2.js";import{C as _e}from"./CardContent-a3c41a0c.js";import{A as St}from"./Alert-18856afa.js";var ne={},Tt=B;Object.defineProperty(ne,"__esModule",{value:!0});var K=ne.default=void 0,At=Tt(O()),wt=e,It=(0,At.default)((0,wt.jsx)("path",{d:"M12.16 3h-.32L9.21 8.25h5.58zm4.3 5.25h5.16L19 3h-5.16zm4.92 1.5h-8.63V20.1zM11.25 20.1V9.75H2.62zM7.54 8.25 10.16 3H5L2.38 8.25z"}),"Diamond");K=ne.default=It;var se={},Rt=B;Object.defineProperty(se,"__esModule",{value:!0});var ke=se.default=void 0,Pt=Rt(O()),_t=e,kt=(0,Pt.default)((0,_t.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");ke=se.default=kt;class Et{constructor(t,n,i){this.name=t,this.prefix=n,this.baseEncode=i}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class $t{constructor(t,n,i){if(this.name=t,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=i}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Ee(this,t)}}class qt{constructor(t){this.decoders=t}or(t){return Ee(this,t)}decode(t){const n=t[0],i=this.decoders[n];if(i)return i.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Ee=(s,t)=>new qt({...s.decoders||{[s.prefix]:s},...t.decoders||{[t.prefix]:t}});class zt{constructor(t,n,i,a){this.name=t,this.prefix=n,this.baseEncode=i,this.baseDecode=a,this.encoder=new Et(t,n,i),this.decoder=new $t(t,n,a)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const Ft=({name:s,prefix:t,encode:n,decode:i})=>new zt(s,t,n,i),Lt=(s,t,n,i)=>{const a={};for(let p=0;p<t.length;++p)a[t[p]]=p;let r=s.length;for(;s[r-1]==="=";)--r;const l=new Uint8Array(r*n/8|0);let c=0,m=0,u=0;for(let p=0;p<r;++p){const j=a[s[p]];if(j===void 0)throw new SyntaxError(`Non-${i} character`);m=m<<n|j,c+=n,c>=8&&(c-=8,l[u++]=255&m>>c)}if(c>=n||255&m<<8-c)throw new SyntaxError("Unexpected end of data");return l},Mt=(s,t,n)=>{const i=t[t.length-1]==="=",a=(1<<n)-1;let r="",l=0,c=0;for(let m=0;m<s.length;++m)for(c=c<<8|s[m],l+=8;l>n;)l-=n,r+=t[a&c>>l];if(l&&(r+=t[a&c<<n-l]),i)for(;r.length*n&7;)r+="=";return r},$=({name:s,prefix:t,bitsPerChar:n,alphabet:i})=>Ft({prefix:t,name:s,encode(a){return Mt(a,i,n)},decode(a){return Lt(a,i,n,s)}}),Nt=$({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ot=$({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Bt=$({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Wt=$({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ht=$({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Ut=$({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Vt=$({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Jt=$({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Kt=$({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Gt=Object.freeze(Object.defineProperty({__proto__:null,base32:Nt,base32hex:Ht,base32hexpad:Vt,base32hexpadupper:Jt,base32hexupper:Ut,base32pad:Bt,base32padupper:Wt,base32upper:Ot,base32z:Kt},Symbol.toStringTag,{value:"Module"})),Qt=Me(Gt),{toBuffer:Xt,toAddress:Yt}=Ne,{base32:Zt}=Qt,en=s=>{if(!s)return s;const t=Xt(Yt(s));return Zt.encode(t)};var tn={encode:en};const nn=s=>["waiting","creating","renewaling"].includes(s);function ie(s){var E,I;const{t}=w(),[n,i]=v.useState(!1),{inService:a}=F(),[r,l]=v.useState(null),{siteId:c,domain:m,onAdd:u,children:p,did:j}=s,[g,T]=v.useState(!1),{api:R,ws:{useSubscription:y}}=F(),{mode:D,actions:{refreshDomainStatus:C}}=ve(),x=ht(async()=>{const{cert:f}=await R.findCertificateByDomain({input:{domain:m,did:j}});return f}),b=(f,P)=>{f.domain===m&&(T(!1),i(!1),a&&D!=="setup"&&(P==="success"?J.success(t("setup.domain.genCertSuccess",{domain:f.domain})):P==="error"&&J.error(t("setup.domain.genCertFailed",{domain:f.domain,message:f.message}))))};if(v.useEffect(()=>{var f;x.loading||T(nn((f=x.value)==null?void 0:f.status))},[x.loading,(E=x.value)==null?void 0:E.status]),y(he.BlockletEvents.certError,f=>b(f,"error")),y(he.BlockletEvents.certIssued,f=>{x.retry(),C(f.domain),b(f,"success")}),x.loading||((I=x.value)==null?void 0:I.status)==="normal")return"";const _=()=>{i(!1),l(null)},d=async()=>{i(!0);try{await R.issueLetsEncryptCert({input:{siteId:c,domain:m,did:j,inBlockletSetup:D==="setup"}}),u(),T(!0)}catch(f){console.error(f),T(!1)}finally{i(!1),l(null)}},S={title:t("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(xt,{type:"success",children:t("router.cert.genLetsEncryptCert.dnsTip")}),t("router.cert.genLetsEncryptCert.description")]}),confirm:t("common.confirm"),onConfirm:d,onCancel:_},k=f=>{f.stopPropagation(),l(S)};return e.jsxs(e.Fragment,{children:[g?e.jsx(z,{title:t("router.cert.issuing"),children:e.jsx(N,{size:12})}):p({loading:n,open:k}),r&&e.jsx(ee,{color:"primary",title:r.title,description:r.description,confirm:r.confirm,params:r.params,onConfirm:r.onConfirm,onCancel:r.onCancel})]})}ie.propTypes={domain:o.string.isRequired,did:o.string.isRequired,siteId:o.string.isRequired,onAdd:o.func,children:o.any};ie.defaultProps={onAdd:()=>{},children:null};function oe(s){const{domain:t,domainStatus:n,...i}=s;return!be(t)||n!=null&&n.isHttps?"":e.jsx(ie,{domain:t,...i})}oe.propTypes={domain:o.string.isRequired,domainStatus:o.shape({isHttps:o.bool}).isRequired,did:o.string.isRequired,onAdd:o.func,children:o.any};oe.defaultProps={onAdd:()=>{},children:null};var re={},sn=B;Object.defineProperty(re,"__esModule",{value:!0});var $e=re.default=void 0,on=sn(O()),rn=e,an=(0,on.default)((0,rn.jsx)("path",{d:"M17 20.41 18.41 19 15 15.59 13.59 17 17 20.41zM7.5 8H11v5.59L5.59 19 7 20.41l6-6V8h3.5L12 3.5 7.5 8z"}),"CallMerge");$e=re.default=an;var ln=Oe;function cn(s,t){for(var n=-1,i=s.length;++n<i&&ln(t,s[n],0)>-1;);return n}var dn=cn,mn=We,un=He,pn=Ue,fn=Ve,hn=dn,ye=Je,xn=Ke;function gn(s,t,n){if(s=xn(s),s&&(n||t===void 0))return un(s);if(!s||!(t=mn(t)))return s;var i=ye(s),a=ye(t),r=hn(i,a),l=fn(i,a)+1;return pn(i,r,l).join("")}var jn=gn;const qe=Be(jn),ze=v.createContext({}),{Provider:yn,Consumer:Vn}=ze;function bn({children:s}){const[t,n]=te({domain:"",error:null}),{locale:i,t:a}=w(),{api:r}=F(),l={error:t.error,domain:t.domain,setError:c=>{n({error:c})},setDomain:c=>{const m=qe(c),u=De(m,i);n({domain:m,error:u})},validateDomain:async c=>!t.error&&(await r.isDidDomain({input:{domain:c}})).value===!0?(n({error:a("router.domainAlias.add.isDidDomainError")}),!1):!0};return e.jsx(yn,{value:{value:l},children:s})}function Fe(){const{value:s}=v.useContext(ze);return s}function ae({domain:s,resolvedTarget:t,...n}){const{t:i,locale:a}=w();return e.jsxs(h,{sx:{backgroundColor:"rgb(236, 251, 253)",borderColor:"rgb(236, 251, 253)",borderRadius:"8px",padding:"12px"},...n,children:[e.jsxs(h,{display:"flex",children:[i("router.domain.setup.tipStart"),s&&e.jsx(h,{mx:.5,color:"primary.main",fontWeight:"fontWeightBold",children:s}),i("router.domain.setup.tipEnd"),":"]}),e.jsxs(h,{sx:{"&>div":{mb:0},marginTop:"8px"},children:[e.jsx(G,{label:i("router.domain.setup.recordType"),value:"CNAME",locale:a}),e.jsx(G,{label:i("router.domain.setup.recordValue"),value:t,locale:a})]})]})}ae.propTypes={domain:o.string,resolvedTarget:o.string.isRequired};ae.defaultProps={domain:""};function G({locale:s,label:t,value:n}){const i=Ce(r=>r.breakpoints.down("md")),a=W();return e.jsx(vt,{name:t,nameWidth:120,children:e.jsxs(h,{sx:{display:"flex",alignItems:"center",lineHeight:1},children:[e.jsx(A,{component:"span",color:"primary.main",overflow:"auto",sx:i?{maxWidth:"95%",wordWrap:"break-word"}:{wordWrap:"break-word"},children:n}),e.jsx(Ge,{content:n,locale:s,style:{marginLeft:"4px",color:a.palette.text.secondary}})]})})}G.propTypes={locale:o.string.isRequired,label:o.string.isRequired,value:o.string.isRequired};function le({siteId:s,teamDid:t,cnameDomain:n,defaultCustomDomain:i,onInputDomain:a,appId:r,appPk:l,onSuccess:c,disabled:m,autoFocus:u,inBlockletSetup:p,...j}){const{t:g,locale:T}=w(),{api:R,info:y}=F(),D=Fe(),C=W(),[x,b]=te({domain:i,error:null,type:y!=null&&y.nftDomainUrl?"nftDomain":"inputDomain",showNFTDomainAuth:!1,showDnsTip:!1});let _="";y.nftDomainUrl&&(_=Qe(y.nftDomainUrl,"/api"));const d=async({domain:I,nftDid:f,chainHost:P})=>{try{const q=Pe(I);await R.addDomainAlias({input:{id:s,type:"nft-domain",domainAlias:q,nftDid:f,chainHost:P,teamDid:t,inBlockletSetup:p}}),await Z(2e3),b({confirmSetting:null,showNFTDomainAuth:!1}),c({domain:q,type:x.type,nftDid:f,chainHost:P})}finally{b({openAuthNFTDomain:!1})}},S=x.error||D.error,k={inputDomain:{name:g("router.domainAlias.inputDomain"),component:e.jsxs(e.Fragment,{children:[e.jsx(Dt,{label:g("router.domainAlias.add.domainDescription"),helperText:S||g("router.domainAlias.add.helperText"),inputProps:{"data-cy":"domain-name-input"},fullWidth:!0,disabled:m,value:x.domain,size:"small",variant:"outlined",error:!!S,onChange:I=>{var q;const f=qe((q=I.target)==null?void 0:q.value);D.setDomain(f);const P=De(f,T);b({domain:f,error:P}),a({domain:f,error:P})},autoFocus:u,onBlur:()=>{D.domain||(b({error:null}),D.setError(null))}}),e.jsxs(h,{sx:{cursor:"pointer",fontSize:"14px",display:"flex",alignItems:"center",gap:"4px",marginTop:"8px",lineHeight:1,color:C.palette.primary.main},onClick:()=>b({showDnsTip:!x.showDnsTip}),children:[e.jsx(yt,{fontSize:"1em"}),g("router.domainAlias.showTipHint")]}),x.showDnsTip&&e.jsx(ae,{domain:x.domain,resolvedTarget:n,style:{marginTop:"4px"}})]})}};y!=null&&y.nftDomainUrl&&(k.nftDomain={name:g("router.domainAlias.nftDomain"),component:e.jsxs(e.Fragment,{children:[e.jsxs(h,{sx:{maxWidth:"640px",color:"text.secondary",fontSize:"14px"},children:[e.jsx("div",{children:g("router.domainAlias.addDomainNFT.tips")}),e.jsxs("div",{children:[g("router.domainAlias.addDomainNFT.buyTip"),e.jsxs(Xe,{href:y.nftDomainUrl,sx:{fontSize:"14px",display:"inline-flex",alignItems:"center"},target:"_blank",children:[e.jsx("i",{children:g("router.domainAlias.addDomainNFT.buy")}),e.jsx(bt,{fontSize:"small"})]})]})]}),e.jsx(L,{sx:{marginTop:"8px"},disabled:m,onClick:()=>b({showNFTDomainAuth:!0}),variant:"contained",children:g("router.domainAlias.addDomainNFT.showNFT")}),e.jsx(Ye,{open:x.showNFTDomainAuth,popup:!0,useSocket:!1,action:"authorize",baseUrl:_,checkFn:Ze.create({baseURL:_}).get,extraParams:{delegatee:r,delegateePk:l},onSuccess:d,onClose:()=>b({showNFTDomainAuth:!1}),checkTimeout:60*5e3,showDownload:!1,messages:{title:g("router.domainAlias.addDomainNFT.connect.title"),scan:g("router.domainAlias.addDomainNFT.connect.scan"),confirm:g("router.domainAlias.addDomainNFT.connect.confirm"),success:g("router.domainAlias.addDomainNFT.connect.success")}})]})});const E=Object.keys(k);return E.sort(I=>I==="inputDomain"?1:-1),e.jsx(h,{...j,children:e.jsx(h,{sx:{display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:"1em"},children:E.map((I,f)=>{var P,q;return e.jsxs(h,{children:[E.length>1&&e.jsx(h,{sx:{fontWeight:700,color:C.palette.text.primary},children:`${g(`optionsOrder.${f+1}`)}: ${(P=k[I])==null?void 0:P.name}`}),e.jsx(h,{sx:{marginTop:"8px"},children:(q=k[I])==null?void 0:q.component})]},I)})})})}le.propTypes={siteId:o.string.isRequired,teamDid:o.string.isRequired,cnameDomain:o.string.isRequired,defaultCustomDomain:o.string,onInputDomain:o.func,onSuccess:o.func,appId:o.string,appPk:o.string,disabled:o.bool,autoFocus:o.bool,inBlockletSetup:o.bool};le.defaultProps={defaultCustomDomain:"",onInputDomain:xe,onSuccess:xe,appId:"",appPk:"",disabled:!1,autoFocus:!0,inBlockletSetup:!1};function ce({id:s,children:t,title:n,teamDid:i,systemDomains:a,appId:r,appPk:l}){const{t:c}=w(),{api:m}=F(),[u,p]=te({loading:!1,confirmSetting:null}),j=a.find(C=>Se.isDidDomain(C)),g=Fe(),T=()=>{p({loading:!1,confirmSetting:null})},R=async C=>{if(!u.loading){p({loading:!0});try{const x=Pe(C.domain);if(!await g.validateDomain(x))return!1;await m.addDomainAlias({input:{id:s,domainAlias:x,teamDid:i}}),await Z(2e3),p({confirmSetting:null})}catch(x){return g.setError(x.message),!1}finally{p({loading:!1})}}},y={title:n||c("router.domainAlias.add.title"),description:function(x,b,_){return e.jsx(le,{siteId:s,teamDid:i,cnameDomain:j,onSuccess:()=>p({confirmSetting:null}),onInputDomain:({domain:d,error:S})=>{b({...x,domain:d,__disableConfirm:!!S}),_(S)},appId:r,appPk:l})},confirm:c("common.confirm"),cancel:c("common.cancel"),params:{domain:"",__disableConfirm:!0},onConfirm:R,onCancel:T},D=C=>{C.stopPropagation(),p({confirmSetting:y})};return e.jsxs(e.Fragment,{children:[typeof t=="function"?t({loading:u.loading,open:D}):e.jsxs(Te,{onClick:D,className:"rule-action","data-cy":"action-add-domain-alias",children:[u.loading?e.jsx(N,{size:16}):e.jsx($e,{style:{fontSize:18,marginRight:5}}),c("router.domainAlias.add.title")]}),u.confirmSetting&&e.jsx(ee,{title:u.confirmSetting.title,description:u.confirmSetting.description,confirm:u.confirmSetting.confirm,cancel:u.confirmSetting.cancel,params:u.confirmSetting.params,onConfirm:u.confirmSetting.onConfirm,onCancel:u.confirmSetting.onCancel,displayError:!1,color:"primary",loading:u.loading,maxWidth:"lg"})]})}ce.propTypes={id:o.string.isRequired,children:o.any,title:o.string,teamDid:o.string,systemDomains:o.arrayOf(o.string).isRequired,appId:o.string,appPk:o.string.isRequired};ce.defaultProps={children:null,title:"",teamDid:"",appId:null};function vn(s){return e.jsx(bn,{children:e.jsx(ce,{...s})})}function de(s){const{t}=w(),[n,i]=v.useState(!1),[a,r]=v.useState(null),{id:l,domain:c,children:m,teamDid:u}=s,{api:p}=F(),j=()=>{i(!1),r(null)},g=async()=>{i(!0);try{await p.deleteDomainAlias({input:{id:l,domainAlias:c,teamDid:u}}),await Z(2e3)}catch(y){J.error(y.message)}finally{r(null),i(!1)}},T={title:t("router.domainAlias.delete.title"),description:t("router.domainAlias.delete.description"),confirm:t("common.confirm"),onConfirm:g,onCancel:j},R=y=>{y.stopPropagation(),r(T)};return e.jsxs(e.Fragment,{children:[typeof m=="function"?m({loading:n,open:R}):e.jsxs(L,{edge:"end",onClick:R,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[n?e.jsx(N,{size:16}):e.jsx(Re,{style:{fontSize:16}}),t("router.domainAlias.delete.title")]}),a&&e.jsx(ee,{title:a.title,description:a.description,confirm:a.confirm,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})]})}de.propTypes={id:o.string.isRequired,domain:o.string.isRequired,children:o.any,teamDid:o.string};de.defaultProps={children:null,teamDid:""};function me({site:s,domain:t,blocklet:n}){const{t:i}=w(),a=t.value===window.location.hostname;return e.jsx(Ct,{"data-cy":"domain-actions",size:"large",actions:[({close:r})=>{var l;return e.jsx(de,{id:s.id,domain:t.value,teamDid:(l=n==null?void 0:n.meta)==null?void 0:l.did,children:({open:c})=>e.jsx(z,{title:a?i("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Te,{disabled:t.isProtected||a,dense:!0,onClick:m=>{r(),c(m)},"data-cy":"action-toggle-block",children:[e.jsx(gt,{style:{minWidth:24,marginRight:8},children:e.jsx(Re,{})}),e.jsx(jt,{primary:i("common.delete")})]},"remove")})})})}]})}me.propTypes={site:o.object.isRequired,domain:o.object.isRequired,blocklet:o.object.isRequired};me.defaultProps={};var ue={},Dn=B;Object.defineProperty(ue,"__esModule",{value:!0});var pe=ue.default=void 0,Cn=Dn(O()),Sn=e,Tn=(0,Cn.default)((0,Sn.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"}),"Https");pe=ue.default=Tn;const H=o.shape({href:o.string,accessibility:o.shape({loading:o.bool,accessible:o.bool}),domainStatus:o.shape({isHttps:o.bool,matchedCert:o.object}),dns:o.shape({resolved:o.bool,ip:o.string})});function fe({certificate:s}){const[t,n]=v.useState(null),i=F(),{t:a,locale:r}=w(),l=u=>{n(u.currentTarget)},c=()=>{n(null)},m=!!t;return e.jsxs(e.Fragment,{children:[e.jsx(pe,{"aria-owns":m?"mouse-over-popover":void 0,onMouseEnter:l,onMouseLeave:c,style:{color:"#44cdc6",fontSize:20,cursor:"pointer"}}),e.jsx(Ae,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:m,anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:c,disableRestoreFocus:!0,children:e.jsx(we,{children:e.jsxs(_e,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${i.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(A,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(A,{component:"div",style:{fontWeight:"bold"},children:s.domain}),e.jsx(A,{component:"div",children:`${a("common.issuer")}: ${et(s,"issuer.commonName","")}`}),e.jsx(A,{component:"div",children:`${a("router.cert.issuedOn")}: ${ge(s.validFrom,r)}`}),e.jsx(A,{component:"div",children:`${a("router.cert.expiryOn")}: ${ge(s.validTo,r)}`})]})]})})})]})}fe.propTypes={certificate:o.object};fe.defaultProps={certificate:{}};function M({domain:s,filters:t}){const{t:n}=w(),{value:i,domainStatus:a}=s;if(!be(i))return null;let r=null,l=null;const{isHttps:c,matchedCert:m}=a;if(!tt(i)){const{dns:{resolved:p,ip:j}={}}=a;p||j==="127.0.0.1"?r=e.jsx(z,{title:n("router.domain.verify.ok"),children:e.jsx(je,{color:"success"})}):r=e.jsx(z,{title:n("router.domain.verify.notResolved"),children:e.jsx(je,{color:"error"})})}c?l=e.jsx(fe,{certificate:m}):l=e.jsx(z,{title:n("router.domain.https.bad"),children:e.jsx(pe,{style:{color:"#D0021B",fontSize:20,cursor:"pointer"}})});const u=t.map(p=>p==="domain"?r:p==="http"?l:null);return v.createElement(v.Fragment,null,...u)}M.propTypes={domain:H.isRequired,filters:o.array};M.defaultProps={filters:["domain","http"]};const An=Ie(U,"mutate_blocklets"),wn=Ie(U,"",st);function Le(s){const{inService:t}=F(),{blocklet:n,loadingRuntimeInfo:i}=ve();let a=An;return t&&(a=wn),e.jsx(a,{...s,blocklet:n,inService:t,loadingRuntimeInfo:i})}Le.propTypes={listOnly:o.bool};Le.defaultProps={listOnly:!1};function U({hasPermission:s,blocklet:t,loadingRuntimeInfo:n,inService:i,listOnly:a}){var C,x,b,_;const{t:r}=w(),[l,c]=v.useState(!1),m=Ce(d=>d.breakpoints.down("md")),u=v.useMemo(()=>{let d=s;return it(t)&&(d=d&&i),d},[s,i,t]),{site:p}=t,j=v.useMemo(()=>{var d;return ot((d=t.site)==null?void 0:d.domainAliases)},[(C=t.site)==null?void 0:C.domainAliases]),g=[],T=[],R=tn.encode(t.appPid),y=(b=(x=t.environments)==null?void 0:x.find(d=>d.key==="BLOCKLET_APP_PK"))==null?void 0:b.value,D=rt(j);return j.forEach(d=>{const S=d.value||"";Se.isDidDomain(S)&&!S.startsWith(R)?T.push(d):g.push(d)}),e.jsxs(e.Fragment,{children:[!a&&e.jsxs(e.Fragment,{children:[e.jsxs(h,{className:"title first",display:"flex",justifyContent:"space-between",alignItems:"center",children:[e.jsx(h,{children:r("common.domain")}),u&&e.jsx(vn,{id:p.id,title:r("router.domain.add.title"),teamDid:(_=t.meta)==null?void 0:_.did,appId:t.appPid,appPk:y,systemDomains:D==null?void 0:D.map(d=>d.value),children:({open:d})=>e.jsxs(L,{style:{marginLeft:16},variant:"contained",color:"primary","data-cy":"add-domain-alias",onClick:d,disabled:at(t.status),children:[e.jsx(mt,{style:{fontSize:"1.3em",marginRight:4}}),r("common.add")]})})]}),lt(t.status)===!1&&e.jsx(h,{mt:1.5,mb:1.5,children:e.jsx(St,{severity:"warning",children:r("blocklet.router.noRunning")})})]}),e.jsx(h,{sx:{display:"flex",flexDirection:"column",gap:1},children:(l?j:g).map(d=>{var k,E;const S=d.value;return e.jsxs(v.Fragment,{children:[m&&e.jsxs(h,{display:"flex",flexDirection:"column",children:[e.jsx(h,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:e.jsx(Q,{domain:d,target:"_blank",children:d.value})}),e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1},children:[e.jsx(M,{domain:d,filters:["domain"]},`${d.value}-domain`),e.jsx(Y,{siteId:(k=t.site)==null?void 0:k.id,domain:d,blocklet:t,hasMutatePermission:u})]}),e.jsx(h,{sx:{button:{padding:0}},children:e.jsx(X,{hasMutatePermission:u,site:p,domain:d,blocklet:t})})]})]},S),!m&&e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(M,{domain:d,filters:["domain"]},`${d.value}-domain`),e.jsx(h,{sx:{ml:2,mr:.5},children:e.jsx(Q,{domain:d,target:"_blank",children:d.value})}),e.jsx(Y,{siteId:(E=t.site)==null?void 0:E.id,domain:d,blocklet:t,hasMutatePermission:u})]}),e.jsx(h,{sx:{button:{padding:0}},children:e.jsx(X,{hasMutatePermission:u,site:p,domain:d,blocklet:t})})]},S)]},S)})}),T.length>0&&e.jsx("div",{style:{marginLeft:"20px",marginTop:"12px"},children:e.jsx(L,{endIcon:l?e.jsx(ke,{}):e.jsx(ut,{}),onClick:()=>c(!l),children:r(l?"common.collapseAll":"blocklet.router.showAllDomains")})}),!j.length&&(n?e.jsx(N,{size:16}):e.jsx(ct,{children:r("common.empty")}))]})}U.propTypes={hasPermission:o.bool,blocklet:o.object.isRequired,loadingRuntimeInfo:o.bool,inService:o.bool.isRequired,listOnly:o.bool};U.defaultProps={hasPermission:!1,loadingRuntimeInfo:!1,listOnly:!1};function Q({domain:s,children:t,...n}){const{t:i}=w(),{href:a,accessibility:r}=s;return!r||r.loading?e.jsxs(V,{...n,children:[t,e.jsx(z,{title:i("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx("span",{className:"status",children:e.jsx(N,{size:12})})})]}):r.accessible?e.jsx(V,{...n,children:e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",children:t})}):e.jsx(V,{...n,children:e.jsx(z,{title:i("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx("span",{children:t})})})}Q.propTypes={domain:H.isRequired,children:o.any.isRequired};const V=nt.span`
|
|
2
|
-
&,
|
|
3
|
-
& > * {
|
|
4
|
-
color: #222;
|
|
5
|
-
font-size: 18px;
|
|
6
|
-
word-break: break-all;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.status {
|
|
10
|
-
margin-left: 8px;
|
|
11
|
-
}
|
|
12
|
-
`;function X({hasMutatePermission:s,site:t,domain:n,blocklet:i}){const a=W(),{t:r}=w();return s&&!n.isProtected?e.jsx(me,{site:t,domain:n,blocklet:i}):e.jsx(z,{title:r("blocklet.router.domainLockTooltip"),placement:"top",children:e.jsx(dt,{disabled:!0,size:"large",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0},children:e.jsx(pt,{style:{fill:a.palette.text.disabled}})})})}X.propTypes={hasMutatePermission:o.bool.isRequired,site:o.object.isRequired,domain:H.isRequired,blocklet:o.object.isRequired};function Y({siteId:s,domain:t,blocklet:n,hasMutatePermission:i}){const a=W(),{t:r}=w(),[l,c]=v.useState(null),m=p=>{c(p.currentTarget)},u=()=>{c(null)};return e.jsxs(h,{sx:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:1},children:[t.type==="nft-domain"&&e.jsxs(e.Fragment,{children:[e.jsx(K,{onMouseEnter:m,onMouseLeave:u,style:{cursor:"pointer",fill:a.palette.primary.main}}),e.jsx(Ae,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:!!l,anchorEl:l,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:u,disableRestoreFocus:!0,children:e.jsx(we,{children:e.jsxs(_e,{style:{display:"flex",flexDirection:"column"},children:[e.jsxs(A,{component:"div",style:{display:"flex",alignItems:"center"},children:[e.jsx(K,{style:{fill:a.palette.primary.main}}),e.jsx(A,{component:"span",style:{marginLeft:"8px",fontSize:"18px",fontWeight:"bolder"},children:r("router.domainAlias.nftDomain")})]}),e.jsxs(A,{component:"div",style:{display:"flex",marginTop:"12px"},children:[e.jsx(A,{component:"span",style:{width:"80px",marginRight:"8px"},children:r("common.domain")}),e.jsx(A,{component:"span",children:t.value})]}),e.jsxs(A,{component:"div",style:{display:"flex"},children:[e.jsx(A,{component:"span",style:{width:"80px",marginRight:"8px"},children:"NFT"}),e.jsx(ft,{did:t.nftDid})]})]})})})]}),e.jsx(M,{domain:t,filters:["http"]},`${t.value}-http`),i&&e.jsx(oe,{siteId:s,domain:t.value,domainStatus:t.domainStatus,did:n.meta.did,children:({open:p})=>e.jsx(L,{sx:{padding:0},size:"small",onClick:j=>p(j),children:r("router.cert.genLetsEncryptCert.title")})})]})}Y.propTypes={siteId:o.string.isRequired,domain:H.isRequired,blocklet:o.object.isRequired,hasMutatePermission:o.bool.isRequired};export{le as A,bn as D,Le as a,ke as d,Fe as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-cf61f7db.js";import{S as t}from"./studio-75f7cd30.js";import"./index-304ff849.js";import"./nav-menu-e5bda5b1.js";import"./ExpandMore-5e89e7bd.js";import"./Toolbar-63186941.js";import"./Hidden-4067f85a.js";import"./fallback-27e04c22.js";function e(){return o.jsx(t,{children:"Coming soon..."})}export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as n,bE as l,O as c,j as o,ak as d,B as u}from"./index-cf61f7db.js";import h from"./index-752c69a0.js";import"./useSetState-49e815fe.js";import"./index-c78d61fc.js";import"./FilterList-7817f456.js";import"./TableRow-d12808ad.js";import"./Checkbox-92349aed.js";import"./FormControlLabel-a7fff241.js";import"./useFormControl-b7cc7d69.js";import"./FormControl-4556d3f8.js";import"./FormGroup-d856dc86.js";import"./InputLabel-b97f286b.js";import"./confirm-2f20e316.js";import"./DialogContentText-ef0138ce.js";import"./Alert-18856afa.js";import"./format-error-86f361f1.js";import"./Select-3544f27a.js";import"./TextField-3d8b540c.js";import"./index-a76e3a95.js";import"./LastPage-830dc7b7.js";import"./Toolbar-63186941.js";import"./index-894d7b33.js";import"./redux-8efd18d4.js";import"./toPropertyKey-d63e044c.js";import"./Grid-dcf85761.js";import"./Search-29f3b44d.js";import"./MoreVert-b4ec66e0.js";import"./did-address-deca4ec1.js";import"./ChevronRight-9d781657.js";import"./Avatar-6a058f2c.js";import"./session-2a0eb2cb.js";import"./InputAdornment-65e20722.js";import"./Download-ccbc24f3.js";import"./DeleteOutline-9e947dc9.js";import"./index-47788371.js";import"./index-997aa7a6.js";import"./ExpandMore-5e89e7bd.js";import"./OpenInNew-e91f9d7e.js";import"./api-71b66169.js";const i=new URL(window.location.href),r=i.searchParams.get("mode")==="dialog",g=r?"":i.searchParams.get("padding")||"";function to(){const{t:e}=n(),{componentDid:s}=l(),p=c(a=>a.breakpoints.down("md")),m=()=>{window.parent.postMessage({event:"resourceDialog.close",componentDid:s},"*")},t=o.jsx(h,{padding:g});return r?o.jsx(d,{className:"resource-dialog",title:e("blocklet.publish.createResource"),maxWidth:!1,fullWidth:!1,PaperProps:{style:p?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:m,showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:o.jsx(u,{sx:{height:"72vh",overflow:"auto",position:"relative"},children:t})}):t}export{to as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,bh as t}from"./index-cf61f7db.js";function e(){return o.useContext(t)}export{e as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aq as a,ar as t,as as e,j as r,at as o}from"./index-cf61f7db.js";const i={zh:a(t),en:a(e)};function p(s){return function(n){return r.jsx(o,{translations:i,children:r.jsx(s,{...n})})}}export{p as w};
|