@abtnode/blocklet-services 1.16.42-beta-20250416-010627-a89e72e0 → 1.16.42-beta-20250415-222652-04c5d2fe
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/{AdapterDayjs-B7fWFwN5.js → AdapterDayjs-BLBXeg9J.js} +1 -1
- package/dist/assets/{ArrowDropDown-DO9H_COV.js → ArrowDropDown--dAaadP8.js} +1 -1
- package/dist/assets/{CheckCircle-B_wWOO2P.js → CheckCircle-Av1UotA-.js} +1 -1
- package/dist/assets/{ChevronLeft-BdrBCIFt.js → ChevronLeft-De8Da-PB.js} +1 -1
- package/dist/assets/{ChevronRight-CO9My6tF.js → ChevronRight-CQOI2CyK.js} +1 -1
- package/dist/assets/{DeleteOutline-7AloJjcV.js → DeleteOutline-Cgoi-K0i.js} +1 -1
- package/dist/assets/{Done-BXISjL2g.js → Done-BYuUlh_s.js} +1 -1
- package/dist/assets/{Download-B0rKRcTB.js → Download-DUKR_Wkm.js} +1 -1
- package/dist/assets/{Edit-C1mcIe4c.js → Edit-D2RQMivt.js} +1 -1
- package/dist/assets/{Error-BnWmSZ5k.js → Error-By0ZMWzh.js} +1 -1
- package/dist/assets/{ExpandLess-DRlih5VO.js → ExpandLess-BNGLjxae.js} +1 -1
- package/dist/assets/{Google-1eG1YH-u.js → Google-tZCjvU7D.js} +1 -1
- package/dist/assets/{InfoOutlined-DO0_Vjz-.js → InfoOutlined-DSoJjRQo.js} +1 -1
- package/dist/assets/{Launch-CIC8rZgo.js → Launch-B161pSEw.js} +1 -1
- package/dist/assets/{LaunchOutlined-CkYWJcA9.js → LaunchOutlined-wehxIahb.js} +1 -1
- package/dist/assets/{MoreHoriz-B8cBSV22.js → MoreHoriz-Bo_R2nuS.js} +1 -1
- package/dist/assets/{PlayArrow-NjIpSDwJ.js → PlayArrow-D38lbyGo.js} +1 -1
- package/dist/assets/{TuneOutlined-Bry0vSC0.js → TuneOutlined-DMMtKa6E.js} +1 -1
- package/dist/assets/{ViewList-BzGRahvc.js → ViewList-CMIoKrN6.js} +1 -1
- package/dist/assets/{access-control-7Ih10vY9.js → access-control-DLD9n3S7.js} +1 -1
- package/dist/assets/{actions-BOikuUJD.js → actions-CMsM02NP.js} +1 -1
- package/dist/assets/{add-component-core-DRJSzr-6.js → add-component-core-FnU4dwXM.js} +1 -1
- package/dist/assets/{add-resource-VgacdokL.js → add-resource-CubCXHBS.js} +1 -1
- package/dist/assets/{addon-F4fsk4Yi.js → addon-5JaI2ctX.js} +1 -1
- package/dist/assets/{advanced-a-1InjKG.js → advanced-D4wfoh0v.js} +1 -1
- package/dist/assets/{appearance-BWtF9DZd.js → appearance-BUsj4DWC.js} +1 -1
- package/dist/assets/{audit-logs-DqFf6jS-.js → audit-logs-rk_iUYcM.js} +1 -1
- package/dist/assets/{authorize-BKpxW7YW.js → authorize-CDJXjmiI.js} +1 -1
- package/dist/assets/{base32-CQfYcymN.js → base32-BhlNgZPk.js} +1 -1
- package/dist/assets/{branding--Qk4aIi4.js → branding-BBbE2Klb.js} +1 -1
- package/dist/assets/{branding-DoPxX3nU.js → branding-JQ1914RB.js} +2 -2
- package/dist/assets/{bundle-avatar-DNxC8z4b.js → bundle-avatar-woUZoGoi.js} +1 -1
- package/dist/assets/{button-leITu2bm.js → button-Rx3uHycr.js} +1 -1
- package/dist/assets/{click-to-copy-Cygm8U3_.js → click-to-copy-BxZJa7n5.js} +1 -1
- package/dist/assets/{complete-Cnzbqj4O.js → complete-KnPBZq-P.js} +1 -1
- package/dist/assets/{component-BBRNk4Tr.js → component-fD-EGTLm.js} +1 -1
- package/dist/assets/{config-Ba-WdcGO.js → config-8xeoVfWN.js} +1 -1
- package/dist/assets/{config-Dko9yBri.js → config-DbqQgRSU.js} +1 -1
- package/dist/assets/{config-navigation-CDw3CW3J.js → config-navigation-DrgPbe5I.js} +3 -3
- package/dist/assets/{config-space-CSSDG-WO.js → config-space-DZ9w_4_9.js} +1 -1
- package/dist/assets/{confirm-BX8_-j-l.js → confirm-_RIb3OmR.js} +1 -1
- package/dist/assets/connect-CJOq1BXE.js +5 -0
- package/dist/assets/{connect-ByA6PdRd.js → connect-CPIImVme.js} +1 -1
- package/dist/assets/{connect-to-yIsMDJbM.js → connect-to-BdhN0BHi.js} +1 -1
- package/dist/assets/{dashboard-oxsbu66O.js → dashboard-vsk4QHJ1.js} +3 -3
- package/dist/assets/{delete-confirm-C0cAQSXq.js → delete-confirm-DaoAi4Gz.js} +1 -1
- package/dist/assets/{did-address-GAxLGeWB.js → did-address-CGHn52xI.js} +1 -1
- package/dist/assets/domain-BJUSWYGQ.js +9 -0
- package/dist/assets/{domain-action-card-BKzC5bbv.js → domain-action-card-9r42-rWK.js} +2 -2
- package/dist/assets/domains-BNDFk-7R.js +1 -0
- package/dist/assets/{email-B9kMynU0.js → email-fp1LVcF6.js} +1 -1
- package/dist/assets/{exchange-passport-CgO3iLVh.js → exchange-passport-DIyhYtFS.js} +1 -1
- package/dist/assets/{fuel-C6fpJHcg.js → fuel-aGwI1uP2.js} +1 -1
- package/dist/assets/{gen-access-key-jNw5st5h.js → gen-access-key-DMS1kzry.js} +1 -1
- package/dist/assets/{get-safe-url-CRmmLBFf.js → get-safe-url-DMordnyN.js} +1 -1
- package/dist/assets/{get-safe-url-ZRaKUVld.js → get-safe-url-DW2Z07ex.js} +1 -1
- package/dist/assets/{home-AJ00GuT0.js → home-B_gUzcjU.js} +1 -1
- package/dist/assets/{iframe-C4N_8Wwh.js → iframe-BEanRyio.js} +1 -1
- package/dist/assets/{index-D6v3bOtJ.js → index-4rY7Xp2W.js} +1 -1
- package/dist/assets/{index-PfRsNX8F.js → index-AhbLOD9c.js} +1 -1
- package/dist/assets/{index-EBUaBME3.js → index-BDNlzmD0.js} +1 -1
- package/dist/assets/{index-tjRN_EVx.js → index-BPa_QtWl.js} +3 -3
- package/dist/assets/{index-8Co4tmLR.js → index-BjN8LAYh.js} +4 -4
- package/dist/assets/{index-CyBxUW5e.js → index-BmexzVQt.js} +1 -1
- package/dist/assets/{index-BSlpaPEE.js → index-C0hr4pkt.js} +1 -1
- package/dist/assets/{index-Cv9H4C1K.js → index-CFJtmMCn.js} +1 -1
- package/dist/assets/{index-DyO7bYXp.js → index-CFkRKsyT.js} +1 -1
- package/dist/assets/{index-CNl-IhR2.js → index-CbW18ndN.js} +1 -1
- package/dist/assets/{index-DKLLCs8G.js → index-CcjD0qiY.js} +1 -1
- package/dist/assets/{index-BRz2myBK.js → index-D22ZWGxu.js} +1 -1
- package/dist/assets/{index-B64a4BbE.js → index-D22lazSG.js} +3 -3
- package/dist/assets/{index-BP62CTBB.js → index-D2EAXstd.js} +1 -1
- package/dist/assets/{index-Dc-Oeqo9.js → index-DBZZ-U66.js} +1 -1
- package/dist/assets/{index-C1H5SEVx.js → index-DUQK_NaI.js} +1 -1
- package/dist/assets/{index-BS5tohCn.js → index-D_gSWW1P.js} +1 -1
- package/dist/assets/{index-B5bNvBjf.js → index-DbpVrp8z.js} +1 -1
- package/dist/assets/{index-DIckhHU5.js → index-xa5W6ExD.js} +1 -1
- package/dist/assets/{invitation-DVbBeS8B.js → invitation-D-l4US6a.js} +1 -1
- package/dist/assets/{invite-t8rB5ZWZ.js → invite-DPswrm4J.js} +1 -1
- package/dist/assets/{issue-passport-CSlA5ioP.js → issue-passport-AJghkFHK.js} +1 -1
- package/dist/assets/{item--dgEgBvz.js → item-zk7clNKz.js} +1 -1
- package/dist/assets/{landing-page-aHOyrHWC.js → landing-page-D13wALfk.js} +1 -1
- package/dist/assets/{layout-B4YOjaNK.js → layout-aS-gjZH3.js} +1 -1
- package/dist/assets/{list-Bny5F0T2.js → list-CJt5nOcn.js} +1 -1
- package/dist/assets/localization-Us9buoy1.js +1 -0
- package/dist/assets/{log-CP1_Zl5R.js → log-DFaz-U9x.js} +1 -1
- package/dist/assets/{logger-B9-TWjbH.js → logger-DXlQ8ejK.js} +1 -1
- package/dist/assets/{login-C8k7kmim.js → login-DKSu0ge6.js} +1 -1
- package/dist/assets/{login-oauth-callback-DqejBHsA.js → login-oauth-callback-CP7cNspN.js} +1 -1
- package/dist/assets/{logo-uploader-zhddoC5p.js → logo-uploader-B7i5QemW.js} +3 -3
- package/dist/assets/{lost-passport-Croi_0xR.js → lost-passport-QRUn4RXe.js} +1 -1
- package/dist/assets/{open-window-plauGxNl.js → open-window-B6LZyZAW.js} +1 -1
- package/dist/assets/{overview-C8MR_9r7.js → overview-B3A_5sHO.js} +1 -1
- package/dist/assets/{page-header-Cu9lHawO.js → page-header-DUh_2MUQ.js} +1 -1
- package/dist/assets/{passport-item-DDktLU4q.js → passport-item-BY6VS7Ot.js} +1 -1
- package/dist/assets/{permission-C5Df-sxb.js → permission-DKFJEWNH.js} +1 -1
- package/dist/assets/{preferences-BUVHMy7R.js → preferences-CA76rfbp.js} +1 -1
- package/dist/assets/{profile-embed-BKX2YBaX.js → profile-embed-DHFHXO1W.js} +1 -1
- package/dist/assets/{publish-resource-tDbEc2CN.js → publish-resource-rxvf6s83.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-BQ3hEDNY.js → react-beautiful-dnd.esm-D0nBCaor.js} +1 -1
- package/dist/assets/{relative-time-DESntOZH.js → relative-time-BK3hjJNN.js} +1 -1
- package/dist/assets/{runtime-8Gq50HDL.js → runtime-D_bXZ0w0.js} +1 -1
- package/dist/assets/sdk-Hg_BMu_u.js +1 -0
- package/dist/assets/{security-CRd92J54.js → security-DEmFjZiu.js} +1 -1
- package/dist/assets/{session-DaQ4KCFD.js → session-DB9Du-lc.js} +1 -1
- package/dist/assets/setup-kkb6SvQ7.js +19 -0
- package/dist/assets/{spaces-D1rqZVaX.js → spaces-25E9GQ6_.js} +1 -1
- package/dist/assets/{start-Df0wvo1-.js → start-DfEUlPuS.js} +1 -1
- package/dist/assets/{status-D7e11K9q.js → status-CUyAteC9.js} +1 -1
- package/dist/assets/{step-actions-BAf7tRyq.js → step-actions-CAgwlOEY.js} +1 -1
- package/dist/assets/{studio-CJpRZ6Af.js → studio-2U2-FOOC.js} +1 -1
- package/dist/assets/{switch-control-DPANzJ8H.js → switch-control-DwTxPESj.js} +1 -1
- package/dist/assets/{traffic-Brsh4OZD.js → traffic-B94bYvtf.js} +1 -1
- package/dist/assets/{transfer-CBAuvpGA.js → transfer-DWjvJtPs.js} +1 -1
- package/dist/assets/{unsubscribe-Cyuj6w2n.js → unsubscribe-CTZlUfqc.js} +1 -1
- package/dist/assets/useAsync-DKE0K0bz.js +1 -0
- package/dist/assets/{useAsyncRetry-k063P8TB.js → useAsyncRetry-BBomZj1z.js} +2 -2
- package/dist/assets/{useLocalStorage-BXnF_60k.js → useLocalStorage-DKl7XFfI.js} +1 -1
- package/dist/assets/{user-center-DOyIfHWq.js → user-center-Du6EtGgy.js} +1 -1
- package/dist/assets/{util-C9b90o5T.js → util-BEvdQ5nP.js} +1 -1
- package/dist/assets/{util-Csa0tyHO.js → util-DkIhTuT7.js} +1 -1
- package/dist/assets/{vendor-arcblock-BtlDhznp.js → vendor-arcblock-ACo-BN0q.js} +1 -1
- package/dist/assets/{vendor-ux-did-connect-CiLSrCOH.js → vendor-ux-did-connect-DOjsg91L.js} +1 -1
- package/dist/assets/{wrap-locale--aKPMOdK.js → wrap-locale-DjpRZNtr.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/service-worker.js +1 -1
- package/package.json +42 -41
- package/dist/assets/connect-DBfZH_8M.js +0 -5
- package/dist/assets/domain-BB7h2xMD.js +0 -9
- package/dist/assets/domains-CQPZJx98.js +0 -1
- package/dist/assets/localization-DS_PbFVL.js +0 -1
- package/dist/assets/sdk-DRKovxXZ.js +0 -1
- package/dist/assets/setup-DXwqTfxV.js +0 -19
- package/dist/assets/useAsync-BmW5cnbx.js +0 -1
- package/dist/assets/useAsync-DkPaceIy.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{H as h,j as t,bo as ye,bn as Ce,q as we,aa as y,y as L,v as ge,bM as je,I as ke,b3 as Me,T as J,bN as oe,w as ne,bs as re,bO as se,O as Se,N as Pe,E as ae,ag as he,bP as Ie,bQ as Re,a9 as ie}from"./vendor-mui-core-DxD1UA4o.js";import{A as Te,l as Ee,n as Be,H as Fe,U as Oe}from"./vendor-arcblock-BtlDhznp.js";import{r as a,b as Ne,f as ze,l as Ae}from"./vendor-react-DoD83n6N.js";import{f as z}from"./vendor-hooks-BwVH-TAd.js";import{a$ as Z,o as S,h as le,d as $e,u as We,p as Le}from"./vendor-ux-did-connect-CiLSrCOH.js";import{t as xe,C as De,y as He}from"./vendor-utils-CTIzdAFg.js";import{N as _e,c as ce}from"./list-Bny5F0T2.js";import{d as qe}from"./ExpandLess-DRlih5VO.js";import{B as de}from"./bundle-avatar-DNxC8z4b.js";import{Q as Ue}from"./index-tjRN_EVx.js";import"./lottie-web-B6s7dDoL.js";import"./index-D1fVmwHN.js";import"./index-DIckhHU5.js";import"./relative-time-DESntOZH.js";import"./InfoOutlined-DO0_Vjz-.js";import"./sdk-DRKovxXZ.js";import"./CheckCircle-B_wWOO2P.js";import"./index-D6v3bOtJ.js";import"./Location-B6FoL795.js";import"./Email-RGD-rKFl.js";import"./Timezone-bYzGwn3x.js";import"./util-Csa0tyHO.js";import"./base32-CQfYcymN.js";function Ye(){let l=new Map;function c({root:f,rootMargin:p,threshold:g}){let b=l.get(f);b||(b=new Map,l.set(f,b));let m=JSON.stringify({rootMargin:p,threshold:g}),i=b.get(m);if(!i){let o=new Map;i={observer:new IntersectionObserver(d=>{d.forEach(x=>{var n;(n=o.get(x.target))==null||n(x)})},{root:f,rootMargin:p,threshold:g}),entryCallbacks:o},b.set(m,i)}return{observe:(o,d)=>{i.entryCallbacks.set(o,d),i.observer.observe(o)},unobserve:o=>{i.entryCallbacks.delete(o),i.observer.unobserve(o)}}}return{getObserver:c}}var Ke="0px",Qe=[0],Ve=Ye();function Ge(l){let c=(l==null?void 0:l.rootMargin)??Ke,f=(l==null?void 0:l.threshold)??Qe,p=a.useRef(null),g=a.useRef(null),b=a.useRef(null),[m,i]=a.useState(),o=a.useCallback(()=>{let j=p.current;if(!j){i(void 0);return}let k=Ve.getObserver({root:g.current,rootMargin:c,threshold:f});k.observe(j,R=>{i(R)}),b.current=k},[c,f]),d=a.useCallback(()=>{let j=b.current,k=p.current;k&&(j==null||j.unobserve(k)),b.current=null},[]),x=a.useCallback(j=>{d(),p.current=j,o()},[o,d]),n=a.useCallback(j=>{d(),g.current=j,o()},[o,d]);return[x,{entry:m,rootRef:n}]}var Je=Ge;function Xe(l){var m;let[c,f]=Je(l),p=!!((m=f.entry)!=null&&m.isIntersecting),[g,b]=a.useState(p);return p&&!g&&b(!0),[c,{...f,isVisible:p,wasEverVisible:g}]}var Ze=Xe,et=100;function tt({loading:l,hasNextPage:c,onLoadMore:f,rootMargin:p,disabled:g,delayInMs:b=et}){let m=a.useRef(f),[i,{rootRef:o,isVisible:d}]=Ze({rootMargin:p});a.useEffect(()=>{m.current=f},[f]);let x=!g&&!l&&d&&c;return a.useEffect(()=>{if(x){let n=setTimeout(()=>{m.current()},b);return()=>{clearTimeout(n)}}},[x,b]),[i,{rootRef:o}]}var ot=tt;const X={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};D.propTypes={severity:h.oneOf(["info","success","warning","error",""]).isRequired,size:h.number};D.defaultProps={size:8};function D({severity:l,size:c}){return X[l]?t.jsx(y,{component:"span",sx:{display:"inline-block",width:c,height:c,borderRadius:"50%",backgroundColor:X[l]||X.info}}):null}be.propTypes={theme:h.string,type:h.oneOf(["button","line","select"]),onSelectType:h.func,extra:h.node,loading:h.bool,currentTab:h.oneOf(["info","success","warning","error",""])};function be({theme:l="dark",type:c="button",onSelectType:f,extra:p=void 0,currentTab:g="",loading:b=!1,...m}){const{t:i}=a.useContext(Z),o=[{label:i("notification.allSeverity"),value:""},{label:i("notification.severityType.info"),value:"info"},{label:i("notification.severityType.success"),value:"success"},{label:i("notification.severityType.warning"),value:"warning"},{label:i("notification.severityType.error"),value:"error"}],d=r=>{(r!==g||!b)&&f(r)},x=a.useMemo(()=>{const r={width:"100%",bgcolor:l==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:c==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return c==="line"?Object.assign(r,{}):r},[c,l]),n=(r,C,w)=>t.jsx(L,{disabled:b,onClick:()=>d(r.value),className:`profile-button ${C?"active":""}`,...m,children:r.label},r.value||w),j=(r,C,w)=>t.jsx(L,{variant:"text",disabled:b,onClick:()=>d(r.value),className:`profile-line-button ${C?"active":""}`,...m,children:r.label},r.value||w),k=()=>o==null?void 0:o.map((r,C)=>{const w=g===(r==null?void 0:r.value);return c==="line"?t.jsx(a.Fragment,{children:j(r,w,C)},r.value||C):t.jsx(a.Fragment,{children:n(r,w,C)},r.value||C)}),R=r=>{const{value:C}=r.target;d(C==="all"?"":C)};return c==="select"?t.jsx(ye,{sx:{maxWidth:300},children:t.jsx(Ce,{value:g||"all",onChange:R,size:"small",label:"Severity",IconComponent:r=>t.jsx(Te,{...r,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:o.map((r,C)=>t.jsx(we,{value:r.value||"all",children:t.jsxs(y,{display:"flex",alignItems:"center",gap:1,children:[t.jsx(D,{severity:r.value}),r.label]})},r.value||C))})}):t.jsxs(y,{className:"severity-tabs",sx:x,children:[t.jsx(y,{sx:{...c==="line"?{flex:1,borderBottom:"1px solid rgba(209, 213, 219, 1)"}:{display:"flex",gap:"24px"}},children:k()}),p]})}me.propTypes={paging:h.objectOf(h.any).isRequired,loading:h.bool.isRequired,onChange:h.func.isRequired};function me({loading:l,paging:c,onChange:f}){const{t:p}=a.useContext(Z),g=ge(o=>o.breakpoints.down("md"));if(c.pageCount<=0||g)return null;const b=(o,d)=>{f({page:d+1})},m=o=>{const d=Number(o.target.value);f({page:1,pageSize:d})},i=c.page-1<=0?0:c.page-1;return t.jsx(y,{mt:2,display:"flex",justifyContent:"flex-end",children:t.jsx(je,{disabled:l,count:c.total,page:i,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:p("pagination.rowsPerPage"),labelDisplayedRows:({from:o,to:d,count:x})=>`${o}–${d} / ${x!==-1?x:`${p()}more than ${d}`}`,rowsPerPage:c.pageSize,onPageChange:b,onRowsPerPageChange:m})})}const nt=a.memo(me),rt={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},st={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0m18 11l-6-6"/>'},ue=6,pe={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:S.dividerColor},"& .MuiCheckbox-root.Mui-checked":{color:"#18181B"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:S.dividerColor,strokeWidth:.7}},at={border:`1px solid ${S.dividerColor}`,borderRadius:1,overflow:"hidden",transition:"all 0.2s ease-in-out"},fe=()=>({...at,width:"calc(50% - 8px)"});ee.propTypes={loading:h.bool,type:h.oneOf(["server","service"]),onFilterChange:h.func,blockletMap:h.object,filterType:h.oneOf(["component","entity"]),selectedId:h.array,severity:h.array,enableMarkAllAsRead:h.bool,unReadCount:h.number,onReadFilterChange:h.func,currentReadFilter:h.string};ee.defaultProps={loading:!1,onFilterChange:()=>{},type:"service",blockletMap:{},filterType:"component",selectedId:[],severity:[],enableMarkAllAsRead:!0,unReadCount:0,onReadFilterChange:()=>{},currentReadFilter:"all"};function ee({onFilterChange:l,loading:c,type:f,blockletMap:p,filterType:g="component",selectedId:b=[],severity:m=[],enableMarkAllAsRead:i=!0,unReadCount:o=0,onReadFilterChange:d,currentReadFilter:x="all"}){const{t:n}=a.useContext(Z),[j,k]=a.useState(null),R=!!j,[r,C]=a.useState(b),[w,P]=a.useState(m),[B,H]=a.useState(!1),[I,A]=a.useState(""),[T,F]=a.useState([]);a.useEffect(()=>{C(b),P(m)},[b,m]);const _=[{label:"All",value:"all"},{label:"Unread",value:"unread"}],q=e=>{(e!==x||!c)&&d(e)},$=[{label:n("notification.severityType.info"),value:"info"},{label:n("notification.severityType.success"),value:"success"},{label:n("notification.severityType.warning"),value:"warning"},{label:n("notification.severityType.error"),value:"error"}],K=e=>{k(e.currentTarget),A(""),H(!1)},Q=()=>{k(null)},U=e=>{const s=r.includes(e)?r.filter(v=>v!==e):[...r,e];C(s),l({id:s,severity:w})},Y=e=>{const s=w.includes(e)?w.filter(v=>v!==e):[...w,e];P(s),l({severity:s,id:r})},V=e=>{A(e.target.value)},G=()=>{H(!B)},O=Ne.useMemo(()=>{if(!p.size)return[];const e=[];return g==="component"&&e.push({label:n("notification.system"),id:"system"}),Array.from(p).forEach(([,s])=>{var M,E;const v=s.did||((M=s.meta)==null?void 0:M.did),N=s.title||((E=s.meta)==null?void 0:E.title)||"",W=s.appPid||s.appDid;(g==="component"&&W!==v||g==="entity"&&W===v)&&e.push({label:N,id:v,blocklet:s,ancestors:s.ancestors})}),e},[p,g,n]);a.useEffect(()=>{if(I.trim()==="")F(O);else{const e=I.toLowerCase(),s=O.filter(v=>v.label.toLowerCase().includes(e));F(s)}},[I,O]);const u=I.trim()!==""||B?T:T.slice(0,ue);return t.jsxs(y,{children:[t.jsxs(y,{sx:{display:"flex",justifyContent:i?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[i&&t.jsx(y,{display:"flex",gap:1.5,children:_.map(e=>t.jsxs(L,{disabled:c,onClick:()=>q(e.value),className:`profile-button ${x===e.value?"active":""}`,sx:{...f==="service"&&x===e.value?{color:"rgb(59, 130, 246)"}:{},fontWeight:x===e.value?"bold":"normal"},children:[e.label,e.value==="unread"&&o>0&&` (${o})`]},e.value))}),t.jsxs(y,{display:"flex",justifyContent:"flex-end",gap:2,children:[t.jsx(ke,{size:"small",onClick:K,disabled:c,sx:{minWidth:"auto",borderRadius:2,border:`1px solid ${S.dividerColor}`,"&:hover":{backgroundColor:"action.hover"}},children:t.jsx(le,{icon:rt,hFlip:!0})}),t.jsx(Me,{open:R,anchorEl:j,onClose:Q,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}},children:t.jsxs(y,{children:[t.jsxs(y,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px",children:[t.jsx(J,{variant:"subtitle1",fontWeight:"bold",children:n("notification.severity")}),t.jsx(y,{minWidth:"60px",display:"flex",justifyContent:"flex-end",children:(r.length>0||w.length>0)&&t.jsx(L,{size:"small",onClick:()=>{C([]),P([]),l({severity:[],id:[]})},startIcon:t.jsx($e,{fontSize:"small"}),sx:{color:"rgb(153, 153, 153)",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:n("notification.clear")})})]}),t.jsx(y,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:t.jsx(oe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:$.map(e=>t.jsx(ne,{elevation:0,sx:fe(w.includes(e.value)),children:t.jsx(re,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...pe},control:t.jsx(se,{checked:w.includes(e.value),onChange:()=>Y(e.value),disabled:c,size:"small"}),label:t.jsxs(y,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,children:[t.jsx(D,{severity:e.value}),e.label]})})},e.value))})}),t.jsxs(y,{mb:2,children:[t.jsxs(y,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5,children:[t.jsx(J,{variant:"subtitle1",fontWeight:"bold",width:"calc(100% - 36px)",children:n("notification.from")}),t.jsx(y,{display:"flex",alignItems:"center",width:"calc(100% - 36px)",children:t.jsx(Se,{size:"small",placeholder:"search",value:I,onChange:V,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:S.dividerColor}},"&.Mui-focused":{fieldset:{borderColor:S.dividerColor}}},fieldset:{borderColor:S.dividerColor}},InputProps:{size:"small",startAdornment:t.jsx(Pe,{position:"start",sx:{marginRight:"2px"},children:t.jsx(le,{icon:st})})}})})]}),t.jsx(oe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:u.map(e=>t.jsx(ne,{elevation:0,sx:fe(r.includes(e.id)),children:t.jsx(re,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...pe},control:t.jsx(se,{checked:r.includes(e.id),onChange:()=>U(e.id),disabled:c,size:"small"}),label:t.jsxs(y,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,sx:{minWidth:0,width:"100%"},children:[e.blocklet&&t.jsx(de,{size:20,blocklet:e.blocklet,ancestors:e.ancestors,style:{borderRadius:4,flexShrink:0}}),t.jsx(J,{noWrap:!0,variant:"body2",component:"span",title:e.label,flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:e.label})]})})},e.id))}),T.length>ue&&I.trim()===""&&t.jsx(L,{fullWidth:!0,size:"small",onClick:G,sx:{mt:1},endIcon:B?t.jsx(qe,{}):t.jsx(Ee,{})})]})]})})]})]}),r.length>0||w.length>0?t.jsxs(y,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[w.map(e=>{const s=$.find(v=>v.value===e);return t.jsx(ae,{label:t.jsxs(y,{display:"flex",alignItems:"center",gap:.5,children:[t.jsx(D,{severity:e}),s?s.label:e]}),onDelete:()=>Y(e),size:"small",variant:"outlined",sx:{borderRadius:2,color:"rgb(153, 153, 153)",borderColor:S.dividerColor,"& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${e}`)}),r.map(e=>{const s=O.find(v=>v.id===e);return t.jsx(ae,{label:t.jsxs(y,{display:"flex",alignItems:"center",gap:.5,children:[(s==null?void 0:s.blocklet)&&t.jsx(de,{size:16,blocklet:s.blocklet,ancestors:s.ancestors,style:{borderRadius:4,flexShrink:0}}),s?s.label:e]}),variant:"outlined",onDelete:()=>U(e),size:"small",sx:{borderRadius:2,color:"rgb(153, 153, 153)",borderColor:S.dividerColor,"& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${e}`)})]}):null]})}const it=he(Ie)`
|
|
1
|
+
import{H as h,j as t,bo as ye,bn as Ce,q as we,aa as y,y as L,v as ge,bM as je,I as ke,b3 as Me,T as J,bN as oe,w as ne,bs as re,bO as se,O as Se,N as Pe,E as ae,ag as he,bP as Ie,bQ as Re,a9 as ie}from"./vendor-mui-core-DxD1UA4o.js";import{A as Te,l as Ee,n as Be,H as Fe,U as Oe}from"./vendor-arcblock-ACo-BN0q.js";import{r as a,b as Ne,f as ze,l as Ae}from"./vendor-react-DoD83n6N.js";import{f as z}from"./vendor-hooks-BwVH-TAd.js";import{a$ as Z,o as S,h as le,d as $e,u as We,p as Le}from"./vendor-ux-did-connect-DOjsg91L.js";import{t as xe,C as De,y as He}from"./vendor-utils-CTIzdAFg.js";import{N as _e,c as ce}from"./list-CJt5nOcn.js";import{d as qe}from"./ExpandLess-BNGLjxae.js";import{B as de}from"./bundle-avatar-woUZoGoi.js";import{Q as Ue}from"./index-BPa_QtWl.js";import"./lottie-web-B6s7dDoL.js";import"./index-D1fVmwHN.js";import"./index-xa5W6ExD.js";import"./relative-time-BK3hjJNN.js";import"./InfoOutlined-DSoJjRQo.js";import"./sdk-Hg_BMu_u.js";import"./CheckCircle-Av1UotA-.js";import"./index-4rY7Xp2W.js";import"./Location-B6FoL795.js";import"./Email-RGD-rKFl.js";import"./Timezone-bYzGwn3x.js";import"./util-DkIhTuT7.js";import"./base32-BhlNgZPk.js";function Ye(){let l=new Map;function c({root:f,rootMargin:p,threshold:g}){let b=l.get(f);b||(b=new Map,l.set(f,b));let m=JSON.stringify({rootMargin:p,threshold:g}),i=b.get(m);if(!i){let o=new Map;i={observer:new IntersectionObserver(d=>{d.forEach(x=>{var n;(n=o.get(x.target))==null||n(x)})},{root:f,rootMargin:p,threshold:g}),entryCallbacks:o},b.set(m,i)}return{observe:(o,d)=>{i.entryCallbacks.set(o,d),i.observer.observe(o)},unobserve:o=>{i.entryCallbacks.delete(o),i.observer.unobserve(o)}}}return{getObserver:c}}var Ke="0px",Qe=[0],Ve=Ye();function Ge(l){let c=(l==null?void 0:l.rootMargin)??Ke,f=(l==null?void 0:l.threshold)??Qe,p=a.useRef(null),g=a.useRef(null),b=a.useRef(null),[m,i]=a.useState(),o=a.useCallback(()=>{let j=p.current;if(!j){i(void 0);return}let k=Ve.getObserver({root:g.current,rootMargin:c,threshold:f});k.observe(j,R=>{i(R)}),b.current=k},[c,f]),d=a.useCallback(()=>{let j=b.current,k=p.current;k&&(j==null||j.unobserve(k)),b.current=null},[]),x=a.useCallback(j=>{d(),p.current=j,o()},[o,d]),n=a.useCallback(j=>{d(),g.current=j,o()},[o,d]);return[x,{entry:m,rootRef:n}]}var Je=Ge;function Xe(l){var m;let[c,f]=Je(l),p=!!((m=f.entry)!=null&&m.isIntersecting),[g,b]=a.useState(p);return p&&!g&&b(!0),[c,{...f,isVisible:p,wasEverVisible:g}]}var Ze=Xe,et=100;function tt({loading:l,hasNextPage:c,onLoadMore:f,rootMargin:p,disabled:g,delayInMs:b=et}){let m=a.useRef(f),[i,{rootRef:o,isVisible:d}]=Ze({rootMargin:p});a.useEffect(()=>{m.current=f},[f]);let x=!g&&!l&&d&&c;return a.useEffect(()=>{if(x){let n=setTimeout(()=>{m.current()},b);return()=>{clearTimeout(n)}}},[x,b]),[i,{rootRef:o}]}var ot=tt;const X={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};D.propTypes={severity:h.oneOf(["info","success","warning","error",""]).isRequired,size:h.number};D.defaultProps={size:8};function D({severity:l,size:c}){return X[l]?t.jsx(y,{component:"span",sx:{display:"inline-block",width:c,height:c,borderRadius:"50%",backgroundColor:X[l]||X.info}}):null}be.propTypes={theme:h.string,type:h.oneOf(["button","line","select"]),onSelectType:h.func,extra:h.node,loading:h.bool,currentTab:h.oneOf(["info","success","warning","error",""])};function be({theme:l="dark",type:c="button",onSelectType:f,extra:p=void 0,currentTab:g="",loading:b=!1,...m}){const{t:i}=a.useContext(Z),o=[{label:i("notification.allSeverity"),value:""},{label:i("notification.severityType.info"),value:"info"},{label:i("notification.severityType.success"),value:"success"},{label:i("notification.severityType.warning"),value:"warning"},{label:i("notification.severityType.error"),value:"error"}],d=r=>{(r!==g||!b)&&f(r)},x=a.useMemo(()=>{const r={width:"100%",bgcolor:l==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:c==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return c==="line"?Object.assign(r,{}):r},[c,l]),n=(r,C,w)=>t.jsx(L,{disabled:b,onClick:()=>d(r.value),className:`profile-button ${C?"active":""}`,...m,children:r.label},r.value||w),j=(r,C,w)=>t.jsx(L,{variant:"text",disabled:b,onClick:()=>d(r.value),className:`profile-line-button ${C?"active":""}`,...m,children:r.label},r.value||w),k=()=>o==null?void 0:o.map((r,C)=>{const w=g===(r==null?void 0:r.value);return c==="line"?t.jsx(a.Fragment,{children:j(r,w,C)},r.value||C):t.jsx(a.Fragment,{children:n(r,w,C)},r.value||C)}),R=r=>{const{value:C}=r.target;d(C==="all"?"":C)};return c==="select"?t.jsx(ye,{sx:{maxWidth:300},children:t.jsx(Ce,{value:g||"all",onChange:R,size:"small",label:"Severity",IconComponent:r=>t.jsx(Te,{...r,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:o.map((r,C)=>t.jsx(we,{value:r.value||"all",children:t.jsxs(y,{display:"flex",alignItems:"center",gap:1,children:[t.jsx(D,{severity:r.value}),r.label]})},r.value||C))})}):t.jsxs(y,{className:"severity-tabs",sx:x,children:[t.jsx(y,{sx:{...c==="line"?{flex:1,borderBottom:"1px solid rgba(209, 213, 219, 1)"}:{display:"flex",gap:"24px"}},children:k()}),p]})}me.propTypes={paging:h.objectOf(h.any).isRequired,loading:h.bool.isRequired,onChange:h.func.isRequired};function me({loading:l,paging:c,onChange:f}){const{t:p}=a.useContext(Z),g=ge(o=>o.breakpoints.down("md"));if(c.pageCount<=0||g)return null;const b=(o,d)=>{f({page:d+1})},m=o=>{const d=Number(o.target.value);f({page:1,pageSize:d})},i=c.page-1<=0?0:c.page-1;return t.jsx(y,{mt:2,display:"flex",justifyContent:"flex-end",children:t.jsx(je,{disabled:l,count:c.total,page:i,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:p("pagination.rowsPerPage"),labelDisplayedRows:({from:o,to:d,count:x})=>`${o}–${d} / ${x!==-1?x:`${p()}more than ${d}`}`,rowsPerPage:c.pageSize,onPageChange:b,onRowsPerPageChange:m})})}const nt=a.memo(me),rt={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},st={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0m18 11l-6-6"/>'},ue=6,pe={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:S.dividerColor},"& .MuiCheckbox-root.Mui-checked":{color:"#18181B"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:S.dividerColor,strokeWidth:.7}},at={border:`1px solid ${S.dividerColor}`,borderRadius:1,overflow:"hidden",transition:"all 0.2s ease-in-out"},fe=()=>({...at,width:"calc(50% - 8px)"});ee.propTypes={loading:h.bool,type:h.oneOf(["server","service"]),onFilterChange:h.func,blockletMap:h.object,filterType:h.oneOf(["component","entity"]),selectedId:h.array,severity:h.array,enableMarkAllAsRead:h.bool,unReadCount:h.number,onReadFilterChange:h.func,currentReadFilter:h.string};ee.defaultProps={loading:!1,onFilterChange:()=>{},type:"service",blockletMap:{},filterType:"component",selectedId:[],severity:[],enableMarkAllAsRead:!0,unReadCount:0,onReadFilterChange:()=>{},currentReadFilter:"all"};function ee({onFilterChange:l,loading:c,type:f,blockletMap:p,filterType:g="component",selectedId:b=[],severity:m=[],enableMarkAllAsRead:i=!0,unReadCount:o=0,onReadFilterChange:d,currentReadFilter:x="all"}){const{t:n}=a.useContext(Z),[j,k]=a.useState(null),R=!!j,[r,C]=a.useState(b),[w,P]=a.useState(m),[B,H]=a.useState(!1),[I,A]=a.useState(""),[T,F]=a.useState([]);a.useEffect(()=>{C(b),P(m)},[b,m]);const _=[{label:"All",value:"all"},{label:"Unread",value:"unread"}],q=e=>{(e!==x||!c)&&d(e)},$=[{label:n("notification.severityType.info"),value:"info"},{label:n("notification.severityType.success"),value:"success"},{label:n("notification.severityType.warning"),value:"warning"},{label:n("notification.severityType.error"),value:"error"}],K=e=>{k(e.currentTarget),A(""),H(!1)},Q=()=>{k(null)},U=e=>{const s=r.includes(e)?r.filter(v=>v!==e):[...r,e];C(s),l({id:s,severity:w})},Y=e=>{const s=w.includes(e)?w.filter(v=>v!==e):[...w,e];P(s),l({severity:s,id:r})},V=e=>{A(e.target.value)},G=()=>{H(!B)},O=Ne.useMemo(()=>{if(!p.size)return[];const e=[];return g==="component"&&e.push({label:n("notification.system"),id:"system"}),Array.from(p).forEach(([,s])=>{var M,E;const v=s.did||((M=s.meta)==null?void 0:M.did),N=s.title||((E=s.meta)==null?void 0:E.title)||"",W=s.appPid||s.appDid;(g==="component"&&W!==v||g==="entity"&&W===v)&&e.push({label:N,id:v,blocklet:s,ancestors:s.ancestors})}),e},[p,g,n]);a.useEffect(()=>{if(I.trim()==="")F(O);else{const e=I.toLowerCase(),s=O.filter(v=>v.label.toLowerCase().includes(e));F(s)}},[I,O]);const u=I.trim()!==""||B?T:T.slice(0,ue);return t.jsxs(y,{children:[t.jsxs(y,{sx:{display:"flex",justifyContent:i?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[i&&t.jsx(y,{display:"flex",gap:1.5,children:_.map(e=>t.jsxs(L,{disabled:c,onClick:()=>q(e.value),className:`profile-button ${x===e.value?"active":""}`,sx:{...f==="service"&&x===e.value?{color:"rgb(59, 130, 246)"}:{},fontWeight:x===e.value?"bold":"normal"},children:[e.label,e.value==="unread"&&o>0&&` (${o})`]},e.value))}),t.jsxs(y,{display:"flex",justifyContent:"flex-end",gap:2,children:[t.jsx(ke,{size:"small",onClick:K,disabled:c,sx:{minWidth:"auto",borderRadius:2,border:`1px solid ${S.dividerColor}`,"&:hover":{backgroundColor:"action.hover"}},children:t.jsx(le,{icon:rt,hFlip:!0})}),t.jsx(Me,{open:R,anchorEl:j,onClose:Q,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}},children:t.jsxs(y,{children:[t.jsxs(y,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px",children:[t.jsx(J,{variant:"subtitle1",fontWeight:"bold",children:n("notification.severity")}),t.jsx(y,{minWidth:"60px",display:"flex",justifyContent:"flex-end",children:(r.length>0||w.length>0)&&t.jsx(L,{size:"small",onClick:()=>{C([]),P([]),l({severity:[],id:[]})},startIcon:t.jsx($e,{fontSize:"small"}),sx:{color:"rgb(153, 153, 153)",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:n("notification.clear")})})]}),t.jsx(y,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:t.jsx(oe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:$.map(e=>t.jsx(ne,{elevation:0,sx:fe(w.includes(e.value)),children:t.jsx(re,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...pe},control:t.jsx(se,{checked:w.includes(e.value),onChange:()=>Y(e.value),disabled:c,size:"small"}),label:t.jsxs(y,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,children:[t.jsx(D,{severity:e.value}),e.label]})})},e.value))})}),t.jsxs(y,{mb:2,children:[t.jsxs(y,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5,children:[t.jsx(J,{variant:"subtitle1",fontWeight:"bold",width:"calc(100% - 36px)",children:n("notification.from")}),t.jsx(y,{display:"flex",alignItems:"center",width:"calc(100% - 36px)",children:t.jsx(Se,{size:"small",placeholder:"search",value:I,onChange:V,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:S.dividerColor}},"&.Mui-focused":{fieldset:{borderColor:S.dividerColor}}},fieldset:{borderColor:S.dividerColor}},InputProps:{size:"small",startAdornment:t.jsx(Pe,{position:"start",sx:{marginRight:"2px"},children:t.jsx(le,{icon:st})})}})})]}),t.jsx(oe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:u.map(e=>t.jsx(ne,{elevation:0,sx:fe(r.includes(e.id)),children:t.jsx(re,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...pe},control:t.jsx(se,{checked:r.includes(e.id),onChange:()=>U(e.id),disabled:c,size:"small"}),label:t.jsxs(y,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,sx:{minWidth:0,width:"100%"},children:[e.blocklet&&t.jsx(de,{size:20,blocklet:e.blocklet,ancestors:e.ancestors,style:{borderRadius:4,flexShrink:0}}),t.jsx(J,{noWrap:!0,variant:"body2",component:"span",title:e.label,flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:e.label})]})})},e.id))}),T.length>ue&&I.trim()===""&&t.jsx(L,{fullWidth:!0,size:"small",onClick:G,sx:{mt:1},endIcon:B?t.jsx(qe,{}):t.jsx(Ee,{})})]})]})})]})]}),r.length>0||w.length>0?t.jsxs(y,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[w.map(e=>{const s=$.find(v=>v.value===e);return t.jsx(ae,{label:t.jsxs(y,{display:"flex",alignItems:"center",gap:.5,children:[t.jsx(D,{severity:e}),s?s.label:e]}),onDelete:()=>Y(e),size:"small",variant:"outlined",sx:{borderRadius:2,color:"rgb(153, 153, 153)",borderColor:S.dividerColor,"& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${e}`)}),r.map(e=>{const s=O.find(v=>v.id===e);return t.jsx(ae,{label:t.jsxs(y,{display:"flex",alignItems:"center",gap:.5,children:[(s==null?void 0:s.blocklet)&&t.jsx(de,{size:16,blocklet:s.blocklet,ancestors:s.ancestors,style:{borderRadius:4,flexShrink:0}}),s?s.label:e]}),variant:"outlined",onDelete:()=>U(e),size:"small",sx:{borderRadius:2,color:"rgb(153, 153, 153)",borderColor:S.dividerColor,"& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${e}`)})]}):null]})}const it=he(Ie)`
|
|
2
2
|
position: fixed;
|
|
3
3
|
bottom: 20px;
|
|
4
4
|
right: 20px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a8 as s,j as h}from"./vendor-mui-core-DxD1UA4o.js";import{r as c,p as d}from"./vendor-ux-did-connect-
|
|
1
|
+
import{a8 as s,j as h}from"./vendor-mui-core-DxD1UA4o.js";import{r as c,p as d}from"./vendor-ux-did-connect-DOjsg91L.js";import{g as p}from"./vendor-react-DoD83n6N.js";import{a8 as v,a2 as P}from"./index-BPa_QtWl.js";import{c as x}from"./vendor-arcblock-ACo-BN0q.js";var f={},E=s;Object.defineProperty(f,"__esModule",{value:!0});var R=f.default=void 0,_=E(c()),m=h;R=f.default=(0,_.default)((0,m.jsx)("path",{d:"M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2M1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2"}),"ShoppingCart");var u={},g=s;Object.defineProperty(u,"__esModule",{value:!0});var y=u.default=void 0,L=g(c()),T=h;y=u.default=(0,L.default)((0,T.jsx)("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-2 16-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z"}),"VerifiedUser");const l=v;var $=(e,r)=>l(e)===l(r);const b=p($),S=(e,r)=>{if(e.type===d.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===d.ROUTING_RULE_TYPES.BLOCKLET&&!e.did)return new Error(r("router.validation.didRequired"));return null},z=(e,r)=>{const t=S(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")))},j=({params:e,blocklet:r})=>{if(r){const t=(r.children||[]).find(n=>P.hasStartEngine(n.meta)&&b(n.mountPoint,e.pathPrefix));let i="";return t&&(i=t.mountPoint),r.meta.group!=="gateway"&&e.pathPrefix==="/"&&(i="/"),i}return""},M=({params:e,blocklets:r,blocklet:t,locale:i="en"})=>{if(t&&j({params:e,blocklet:t}))return{zh:`挂载点 ${e.pathPrefix} 已存在,请使用其他挂载点`,en:`The mount point ${e.pathPrefix} already exist, please use another mount point`}[i];const n=r.find(o=>o.meta.did===e.did);if(!n)return"";const a=n.meta.interfaces.find(o=>o.type==="web");return a&&a.prefix!==x.BLOCKLET_DYNAMIC_PATH_PREFIX&&e.pathPrefix!==a.prefix?{zh:`该 blocklet 只能挂载在 ${a.prefix}`,en:`This blocklet can only be mounted on ${a.prefix}`}[i]:""},O=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{y as a,z as b,R as d,j as e,O as p,M as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{y as A}from"./vendor-utils-CTIzdAFg.js";import{b as E}from"./base32-
|
|
1
|
+
import{y as A}from"./vendor-utils-CTIzdAFg.js";import{b as E}from"./base32-BhlNgZPk.js";import{p as r}from"./vendor-ux-did-connect-DOjsg91L.js";function l(e,i,o,s=!1){var R,_;if(e&&e.startsWith(r.USER_AVATAR_URL_PREFIX)){const n=window.env.apiPrefix||"/";if(o){if(s&&((R=window.blocklet)!=null&&R.serverDid)){const t=`https://${E.encode((_=window.blocklet)==null?void 0:_.serverDid)}.${r.DEFAULT_DID_DOMAIN}`;return`${A(t,r.USER_AVATAR_PATH_PREFIX,i,e.replace(r.USER_AVATAR_URL_PREFIX,""))}?imageFilter=resize&w=64&h=64`}return`${A(n,r.USER_AVATAR_PATH_PREFIX,e.replace(r.USER_AVATAR_URL_PREFIX,""))}?imageFilter=resize&w=64&h=64`}return`${A(n,r.USER_AVATAR_PATH_PREFIX,i,e.replace(r.USER_AVATAR_URL_PREFIX,""))}?imageFilter=resize&w=64&h=64`}return e}const w=(e,i)=>e.nodeOwner&&e.nodeOwner.did===i,U=(e,i)=>e&&e.did===i;export{U as a,w as i,l as p};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Location-B6FoL795.js","assets/vendor-react-DoD83n6N.js","assets/vendor-mui-core-DxD1UA4o.js","assets/Timezone-bYzGwn3x.js","assets/Email-RGD-rKFl.js","assets/Phone-_lRBpoVi.js","assets/Meeting-BfKca-xn.js","assets/Community-B_YqAP9P.js","assets/Holiday-C_1hMIGZ.js","assets/OffSick-QPPyYyU6.js","assets/WorkingRemotely-BK9_vlZ-.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var K6=Object.defineProperty;var Y6=(e,t,o)=>t in e?K6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var Wn=(e,t,o)=>Y6(e,typeof t!="symbol"?t+"":t,o);import{H as v,j as b,aa as T,a8 as G1,e as s2,aj as Nd,b7 as J6,T as z0,b2 as Q6,l as F1,au as pe,v as r3,I as C1,am as xd,ag as g1,ah as Ne,a9 as xe,a0 as el,a1 as tl,b8 as ol,b9 as Wc,ba as rb,y as U1,bb as nl,bc as pl,a6 as xp,bd as Ml,be as bl,bf as cl,bg as Tr,P as yd,F as vd,w as mc,L as zl,A as rl,bh as al,ao as k3,ac as il,bi as dl,bj as ab,bk as Bd,D as gc,t as Rc,z as Cd,bl as qM,Z as Td,bm as Ol,E as Ed,bn as ht,O as ye,q as ve,ab as V2,bo as Vn,bp as sl,an as ll,al as Al,bq as ul,ai as fl,br as Er,b4 as wr,X as wd,C as ql,bs as ib,bt as hl,N as Wl,ak as Lc,bu as ml,bv as Sr,ar as gl,M as Rl,bw as Ll,bx as Nl,by as xl}from"./vendor-mui-core-DxD1UA4o.js";import{s as T0,r as Z1,u as V0,B as F2,a as yl,b as vl,c as Bl,d as go,I as Nc,e as Cl,f as Tl,C as Sd,l as kd,L as _d,F as Xd,t as M1,g as h3,h as d1,i as db,j as El,S as Id,N as wl,k as Ee,m as Sl,n as jd,o as Z,p as Ro,q as kl,v as $d,w as _l,x as Xl,y as Dd,z as Il,A as jl,D as Pd,T as Fd,E as $l,G as Dl,H as Pl,J as Fl,K as _3,M as Ul,O as Hl,P as Vl,Q as Ud,R as b1,U as Hd,V as Gn,W as xc,X as yc,Y as f2,Z as Gl,_ as Ao,$ as Zl,a0 as Kl,a1 as yp,a2 as kr,a3 as Yl,a4 as vp,a5 as Jl,a6 as Ql,a7 as eA,a8 as tA,a9 as oA,aa as nA,ab as pA,ac as MA,ad as bA,ae as hM,af as cA,ag as _r,ah as vc,ai as Vd,aj as zA,ak as rA,al as Xr,am as aA,an as iA,ao as dA,ap as OA,aq as sA,ar as R3}from"./vendor-ux-did-connect-
|
|
2
|
+
var K6=Object.defineProperty;var Y6=(e,t,o)=>t in e?K6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var Wn=(e,t,o)=>Y6(e,typeof t!="symbol"?t+"":t,o);import{H as v,j as b,aa as T,a8 as G1,e as s2,aj as Nd,b7 as J6,T as z0,b2 as Q6,l as F1,au as pe,v as r3,I as C1,am as xd,ag as g1,ah as Ne,a9 as xe,a0 as el,a1 as tl,b8 as ol,b9 as Wc,ba as rb,y as U1,bb as nl,bc as pl,a6 as xp,bd as Ml,be as bl,bf as cl,bg as Tr,P as yd,F as vd,w as mc,L as zl,A as rl,bh as al,ao as k3,ac as il,bi as dl,bj as ab,bk as Bd,D as gc,t as Rc,z as Cd,bl as qM,Z as Td,bm as Ol,E as Ed,bn as ht,O as ye,q as ve,ab as V2,bo as Vn,bp as sl,an as ll,al as Al,bq as ul,ai as fl,br as Er,b4 as wr,X as wd,C as ql,bs as ib,bt as hl,N as Wl,ak as Lc,bu as ml,bv as Sr,ar as gl,M as Rl,bw as Ll,bx as Nl,by as xl}from"./vendor-mui-core-DxD1UA4o.js";import{s as T0,r as Z1,u as V0,B as F2,a as yl,b as vl,c as Bl,d as go,I as Nc,e as Cl,f as Tl,C as Sd,l as kd,L as _d,F as Xd,t as M1,g as h3,h as d1,i as db,j as El,S as Id,N as wl,k as Ee,m as Sl,n as jd,o as Z,p as Ro,q as kl,v as $d,w as _l,x as Xl,y as Dd,z as Il,A as jl,D as Pd,T as Fd,E as $l,G as Dl,H as Pl,J as Fl,K as _3,M as Ul,O as Hl,P as Vl,Q as Ud,R as b1,U as Hd,V as Gn,W as xc,X as yc,Y as f2,Z as Gl,_ as Ao,$ as Zl,a0 as Kl,a1 as yp,a2 as kr,a3 as Yl,a4 as vp,a5 as Jl,a6 as Ql,a7 as eA,a8 as tA,a9 as oA,aa as nA,ab as pA,ac as MA,ad as bA,ae as hM,af as cA,ag as _r,ah as vc,ai as Vd,aj as zA,ak as rA,al as Xr,am as aA,an as iA,ao as dA,ap as OA,aq as sA,ar as R3}from"./vendor-ux-did-connect-DOjsg91L.js";import{g as Zn,T as lA,D as Bc,U as AA,c as uA,F as Gd,n as j2,A as Zd,y as F0,z as Cc,x as Be,V as fA,C as Tc,W as qA,G as Kd,a as A1,X as hA,d as WA,L as ro,Y as mA,Z as gA,_ as Ir,I as RA,$ as Yd,H as LA,a0 as NA,a1 as jr}from"./vendor-utils-CTIzdAFg.js";import{e as Wt,g as a3,r as R,b as Je,a as Jd,d as xA,u as Ec,L as l1,N as yA,m as vA}from"./vendor-react-DoD83n6N.js";import{p as BA,i as wc,a as M2,f as M0,b as Qd,q as e4,u as d0,r as CA,g as TA,s as t4,m as n3,l as EA}from"./vendor-hooks-BwVH-TAd.js";const wA="modulepreload",SA=function(e){return"/.well-known/service/static/"+e},$r={},we=function(t,o,n){let p=Promise.resolve();if(o&&o.length>0){document.getElementsByTagName("link");const M=document.querySelector("meta[property=csp-nonce]"),c=(M==null?void 0:M.nonce)||(M==null?void 0:M.getAttribute("nonce"));p=Promise.allSettled(o.map(z=>{if(z=SA(z),z in $r)return;$r[z]=!0;const a=z.endsWith(".css"),r=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${z}"]${r}`))return;const i=document.createElement("link");if(i.rel=a?"stylesheet":wA,a||(i.as="script"),i.crossOrigin="",i.href=z,c&&i.setAttribute("nonce",c),document.head.appendChild(i),a)return new Promise((s,O)=>{i.addEventListener("load",s),i.addEventListener("error",()=>O(new Error(`Unable to preload CSS for ${z}`)))})}))}return p.then(M=>{for(const c of M||[]){if(c.status!=="rejected")continue;const z=new Event("vite:preloadError",{cancelable:!0});if(z.payload=c.reason,window.dispatchEvent(z),!z.defaultPrevented)throw c.reason}return t()})};var kA={exports:{}};(function(e,t){(function(o,n){e.exports=n()})(Wt,function(){return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(o){var n=["th","st","nd","rd"],p=o%100;return"["+o+(n[(p-20)%10]||n[p]||n[0])+"]"}}})})(kA);function _A(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var o4=R,XA=_A(o4);function Dr(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function IA(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var jA=!!(typeof window<"u"&&window.document&&window.document.createElement);function $A(e,t,o){if(typeof e!="function")throw new Error("Expected reducePropsToState to be a function.");if(typeof t!="function")throw new Error("Expected handleStateChangeOnClient to be a function.");if(typeof o<"u"&&typeof o!="function")throw new Error("Expected mapStateOnServer to either be undefined or a function.");function n(p){return p.displayName||p.name||"Component"}return function(M){if(typeof M!="function")throw new Error("Expected WrappedComponent to be a React component.");var c=[],z;function a(){z=e(c.map(function(i){return i.props})),r.canUseDOM?t(z):o&&(z=o(z))}var r=function(i){IA(s,i);function s(){return i.apply(this,arguments)||this}s.peek=function(){return z},s.rewind=function(){if(s.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var q=z;return z=void 0,c=[],q};var O=s.prototype;return O.UNSAFE_componentWillMount=function(){c.push(this),a()},O.componentDidUpdate=function(){a()},O.componentWillUnmount=function(){var q=c.indexOf(this);c.splice(q,1),a()},O.render=function(){return XA.createElement(M,this.props)},s}(o4.PureComponent);return Dr(r,"displayName","SideEffect("+n(M)+")"),Dr(r,"canUseDOM",jA),r}}var DA=$A;const PA=a3(DA);/*
|
|
3
3
|
object-assign
|
|
4
4
|
(c) Sindre Sorhus
|
|
5
5
|
@license MIT
|
|
@@ -246,7 +246,7 @@ ${T}-----END CERTIFICATE-----
|
|
|
246
246
|
`+X+"}":"{"+Q.join(",")+"}",u=X,U}}return stringify$3=function(O,B,V){var j;if(u="",_="",typeof V=="number")for(j=0;j<V;j+=1)_+=" ";else typeof V=="string"&&(_=V);if(T=B,B&&typeof B!="function"&&(typeof B!="object"||typeof B.length!="number"))throw new Error("JSON.stringify");return P("",{"":O})},stringify$3}var hasRequiredJsonify;function requireJsonify(){return hasRequiredJsonify||(hasRequiredJsonify=1,jsonify.parse=requireParse(),jsonify.stringify=requireStringify()),jsonify}var toString$h={}.toString,isarray$2=Array.isArray||function(a){return toString$h.call(a)=="[object Array]"},toStr=Object.prototype.toString,isArguments$1=function a(u){var _=toStr.call(u),E=_==="[object Arguments]";return E||(E=_!=="[object Array]"&&u!==null&&typeof u=="object"&&typeof u.length=="number"&&u.length>=0&&toStr.call(u.callee)==="[object Function]"),E},implementation,hasRequiredImplementation;function requireImplementation(){if(hasRequiredImplementation)return implementation;hasRequiredImplementation=1;var a;if(!Object.keys){var u=Object.prototype.hasOwnProperty,_=Object.prototype.toString,E=isArguments$1,T=Object.prototype.propertyIsEnumerable,S=!T.call({toString:null},"toString"),P=T.call(function(){},"prototype"),O=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],B=function(W){var X=W.constructor;return X&&X.prototype===W},V={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},j=function(){if(typeof window>"u")return!1;for(var W in window)try{if(!V["$"+W]&&u.call(window,W)&&window[W]!==null&&typeof window[W]=="object")try{B(window[W])}catch{return!0}}catch{return!0}return!1}(),U=function(W){if(typeof window>"u"||!j)return B(W);try{return B(W)}catch{return!1}};a=function(X){var Q=X!==null&&typeof X=="object",J=_.call(X)==="[object Function]",ee=E(X),te=Q&&_.call(X)==="[object String]",oe=[];if(!Q&&!J&&!ee)throw new TypeError("Object.keys called on a non-object");var ae=P&&J;if(te&&X.length>0&&!u.call(X,0))for(var se=0;se<X.length;++se)oe.push(String(se));if(ee&&X.length>0)for(var xe=0;xe<X.length;++xe)oe.push(String(xe));else for(var _e in X)!(ae&&_e==="prototype")&&u.call(X,_e)&&oe.push(String(_e));if(S)for(var Ie=U(X),Be=0;Be<O.length;++Be)!(Ie&&O[Be]==="constructor")&&u.call(X,O[Be])&&oe.push(O[Be]);return oe}}return implementation=a,implementation}var slice$7=Array.prototype.slice,isArgs=isArguments$1,origKeys=Object.keys,keysShim=origKeys?function a(u){return origKeys(u)}:requireImplementation(),originalKeys=Object.keys;keysShim.shim=function a(){if(Object.keys){var u=function(){var _=Object.keys(arguments);return _&&_.length===arguments.length}(1,2);u||(Object.keys=function(E){return isArgs(E)?originalKeys(slice$7.call(E)):originalKeys(E)})}else Object.keys=keysShim;return Object.keys||keysShim};var objectKeys$8=keysShim,jsonStringify=(typeof JSON<"u"?JSON:requireJsonify()).stringify,isArray$e=isarray$2,objectKeys$7=objectKeys$8,callBind=callBindExports,callBound=callBound$2,$join=callBound("Array.prototype.join"),$indexOf$1=callBound("Array.prototype.indexOf"),$splice=callBound("Array.prototype.splice"),$sort=callBound("Array.prototype.sort"),strRepeat=function a(u,_){for(var E="",T=0;T<u;T+=1)E+=_;return E},defaultReplacer=function(a,u,_){return _},jsonStableStringify=function a(u){var _=arguments.length>1?arguments[1]:void 0,E=_&&_.space||"";typeof E=="number"&&(E=strRepeat(E," "));var T=!!_&&typeof _.cycles=="boolean"&&_.cycles,S=_&&_.replacer?callBind(_.replacer):defaultReplacer,P=typeof _=="function"?_:_&&_.cmp,O=P&&function(V){var j=P.length>2&&function(W){return V[W]};return function(U,W){return P({key:U,value:V[U]},{key:W,value:V[W]},j?{__proto__:null,get:j}:void 0)}},B=[];return function V(j,U,W,X){var Q=E?`
|
|
247
247
|
`+strRepeat(X,E):"",J=E?": ":":";if(W&&W.toJSON&&typeof W.toJSON=="function"&&(W=W.toJSON()),W=S(j,U,W),W!==void 0){if(typeof W!="object"||W===null)return jsonStringify(W);if(isArray$e(W)){for(var ae=[],ee=0;ee<W.length;ee++){var te=V(W,ee,W[ee],X+1)||jsonStringify(null);ae[ae.length]=Q+E+te}return"["+$join(ae,",")+Q+"]"}if($indexOf$1(B,W)!==-1){if(T)return jsonStringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}else B[B.length]=W;for(var oe=$sort(objectKeys$7(W),O&&O(W)),ae=[],ee=0;ee<oe.length;ee++){var U=oe[ee],se=V(W,U,W[U],X+1);if(se){var xe=jsonStringify(U)+J+se;ae[ae.length]=Q+E+xe}}return $splice(B,$indexOf$1(B,W),1),"{"+$join(ae,",")+Q+"}"}}({"":u},"",u,0)};const zt=getDefaultExportFromCjs(jsonStableStringify);var lib$4={},lib$3={},type={};const require$$0$2=getAugmentedNamespace(isEqual$2),require$$2$1=getAugmentedNamespace(pick);var util$3={},__importDefault$3=commonjsGlobal&&commonjsGlobal.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(util$3,"__esModule",{value:!0});util$3.toStrictHex=util$3.toBytes=util$3.toBits=util$3.DID_PREFIX=void 0;const padStart_1=__importDefault$3(require$$0$5),util_1$2=lib$5,DID_PREFIX="did:abt:";util$3.DID_PREFIX=DID_PREFIX;const toBytes=a=>{try{if((0,util_1$2.isHexStrict)(a))return Buffer$3.from((0,util_1$2.stripHexPrefix)(a),"hex");let u=(0,util_1$2.fromBase58)(a.replace(DID_PREFIX,""));for(;u.length<26;)u=Buffer$3.concat([Buffer$3.from([0]),u]);return u}catch(u){throw new Error(`Cannot convert DID string to byte array: ${u.message}`)}};util$3.toBytes=toBytes;const toBits=(a,u)=>(0,padStart_1.default)((0,util_1$2.toBN)(a).toString(2),u,"0");util$3.toBits=toBits;const toStrictHex=(a,u)=>{const _=a.replace(/^0x/i,"");return typeof u=="number"&&u%2===0?(0,padStart_1.default)(a,u,"0"):_.length%2===0?_:`0${_}`};util$3.toStrictHex=toStrictHex;var __importDefault$2=commonjsGlobal&&commonjsGlobal.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(type,"__esModule",{value:!0});type.toChecksumAddress=type.isEthereumDid=type.isEthereumType=type.toTypeInfoStr=type.toTypeInfo=type.fromTypeInfo=type.DID_TYPE_PASSKEY=type.DID_TYPE_ETHEREUM=type.DID_TYPE_ARCBLOCK=void 0;type.DidType=DidType;const util_1$1=lib$5,upperFirst_1=__importDefault$2(require$$1$5),isEqual_1=__importDefault$2(require$$0$2),pick_1=__importDefault$2(require$$2$1),mcrypto_1$1=lib$6,util_2=util$3,mapping={pk:"key",address:"encoding"},DID_TYPE_ARCBLOCK={role:mcrypto_1$1.types.RoleType.ROLE_ACCOUNT,pk:mcrypto_1$1.types.KeyType.ED25519,hash:mcrypto_1$1.types.HashType.SHA3,address:mcrypto_1$1.types.EncodingType.BASE58};type.DID_TYPE_ARCBLOCK=DID_TYPE_ARCBLOCK;const DID_TYPE_PASSKEY={role:mcrypto_1$1.types.RoleType.ROLE_PASSKEY,pk:mcrypto_1$1.types.KeyType.PASSKEY,hash:mcrypto_1$1.types.HashType.SHA2,address:mcrypto_1$1.types.EncodingType.BASE58};type.DID_TYPE_PASSKEY=DID_TYPE_PASSKEY;const DID_TYPE_ETHEREUM={role:mcrypto_1$1.types.RoleType.ROLE_ACCOUNT,pk:mcrypto_1$1.types.KeyType.ETHEREUM,hash:mcrypto_1$1.types.HashType.KECCAK,address:mcrypto_1$1.types.EncodingType.BASE16};type.DID_TYPE_ETHEREUM=DID_TYPE_ETHEREUM;const isEthereumType=a=>{const u=["pk","hash","address"];return(0,isEqual_1.default)((0,pick_1.default)(a,u),(0,pick_1.default)(DID_TYPE_ETHEREUM,u))};type.isEthereumType=isEthereumType;const isEthereumDid=a=>{const u=(0,util_1$1.toAddress)(a);return/^(0x)?[0-9a-f]{40}$/i.test(u)?/^(0x|0X)?[0-9a-f]{40}$/.test(u)||/^(0x|0X)?[0-9A-F]{40}$/.test(u)?!0:checkAddressChecksum(u):!1};type.isEthereumDid=isEthereumDid;const checkAddressChecksum=a=>{const u=a.replace(/^0x/i,""),_=mcrypto_1$1.Hasher.Keccak.hash256(u.toLowerCase()).replace(/^0x/i,"");for(let E=0;E<40;E++)if(parseInt(_[E],16)>7&&u[E].toUpperCase()!==u[E]||parseInt(_[E],16)<=7&&u[E].toLowerCase()!==u[E])return!1;return!0},toChecksumAddress=a=>{if(typeof a>"u")return"";if(!/^(0x)?[0-9a-f]{40}$/i.test(a))throw new Error(`Given address "${a}" is not a valid Ethereum address.`);const u=a.toLowerCase().replace(/^0x/i,""),_=mcrypto_1$1.Hasher.Keccak.hash256(u).replace(/^0x/i,"");let E="0x";for(let T=0;T<u.length;T++)parseInt(_[T],16)>7?E+=u[T].toUpperCase():E+=u[T];return E};type.toChecksumAddress=toChecksumAddress;function DidType(a={}){let u={};["default","arcblock"].includes(a)?u=DID_TYPE_ARCBLOCK:["eth","ethereum"].includes(a)?u=DID_TYPE_ETHEREUM:["passkey"].includes(a)?u=DID_TYPE_PASSKEY:u={...DID_TYPE_ARCBLOCK,...a};const{role:_,pk:E,hash:T,address:S}=u;Object.keys(u).forEach(O=>{const B=(0,upperFirst_1.default)(`${mapping[O]||O}Type`);if(Object.values(mcrypto_1$1.types[B]).includes(u[O])===!1)throw new Error(`Unsupported ${O} type: ${u[O]}`)});const P={role:_,pk:E,hash:T,address:S};return isEthereumType(P)===!1&&[mcrypto_1$1.types.RoleType.ROLE_NODE,mcrypto_1$1.types.RoleType.ROLE_VALIDATOR,mcrypto_1$1.types.RoleType.ROLE_TETHER,mcrypto_1$1.types.RoleType.ROLE_SWAP].includes(P.role)&&(P.hash=mcrypto_1$1.types.HashType.SHA2),P}DidType.toJSON=a=>Object.keys(a).reduce((u,_)=>{const E=(0,upperFirst_1.default)(`${mapping[_]||_}Type`),T=Object.keys(mcrypto_1$1.types[E]),S=Object.values(mcrypto_1$1.types[E]);return u[_]=T[S.indexOf(a[_])],u},{});DidType.fromJSON=a=>Object.keys(a).reduce((u,_)=>{const E=(0,upperFirst_1.default)(`${mapping[_]||_}Type`),T=Object.keys(mcrypto_1$1.types[E]),S=Object.values(mcrypto_1$1.types[E]);return u[_]=S[T.indexOf(a[_])],u},{});const fromTypeInfo=a=>{const u=DidType(a),_=(0,util_2.toBits)(u.role,6),E=(0,util_2.toBits)(u.pk,5),T=(0,util_2.toBits)(u.hash,5),S=`${_}${E}${T}`,P=(0,util_1$1.stripHexPrefix)((0,util_1$1.numberToHex)(parseInt(S,2)));return(0,util_2.toStrictHex)(P,4)};type.fromTypeInfo=fromTypeInfo;const toTypeInfo=a=>{let u={};try{if(isEthereumDid(a))u=DID_TYPE_ETHEREUM;else{const E=(0,util_2.toBytes)(a).slice(0,2),T=(0,util_2.toStrictHex)(Buffer$3.from(E).toString("hex")),S=(0,util_2.toBits)(new util_1$1.BN(T,16),16),P=S.slice(0,6),O=S.slice(6,11),B=S.slice(11,16);u={role:parseInt(P,2),pk:parseInt(O,2),hash:parseInt(B,2),address:(0,util_1$1.isHex)((0,util_1$1.toAddress)(a))?mcrypto_1$1.types.EncodingType.BASE16:mcrypto_1$1.types.EncodingType.BASE58}}return Object.keys(u).forEach(_=>{Object.values(mcrypto_1$1.types[`${(0,upperFirst_1.default)(mapping[_]||_)}Type`]).includes(u[_])===!1&&delete u[_]}),u}catch{return u}};type.toTypeInfo=toTypeInfo;const toTypeInfoStr=a=>{const u=toTypeInfo(a);return Object.keys(u).reduce((_,E)=>{const T=mcrypto_1$1.types[`${(0,upperFirst_1.default)(mapping[E]||E)}Type`];return _[E]=Object.keys(T).find(S=>T[S]===u[E]),_},{})};type.toTypeInfoStr=toTypeInfoStr;(function(a){Object.defineProperty(a,"__esModule",{value:!0}),a.DID_TYPE_PASSKEY=a.DID_TYPE_ETHEREUM=a.DID_TYPE_ARCBLOCK=a.DID_PREFIX=a.DidType=a.fromTypeInfo=a.toTypeInfoStr=a.toTypeInfo=a.isEthereumType=a.isEthereumDid=a.isValid=a.isFromPublicKey=a.toDid=a.toAddress=a.fromHash=a.fromPublicKeyHash=a.fromPublicKey=a.fromSecretKey=a.toStrictHex=a.types=void 0;const u=lib$6;Object.defineProperty(a,"types",{enumerable:!0,get:function(){return u.types}});const _=lib$5;Object.defineProperty(a,"toAddress",{enumerable:!0,get:function(){return _.toAddress}}),Object.defineProperty(a,"toDid",{enumerable:!0,get:function(){return _.toDid}});const E=type;Object.defineProperty(a,"DidType",{enumerable:!0,get:function(){return E.DidType}}),Object.defineProperty(a,"DID_TYPE_ARCBLOCK",{enumerable:!0,get:function(){return E.DID_TYPE_ARCBLOCK}}),Object.defineProperty(a,"DID_TYPE_ETHEREUM",{enumerable:!0,get:function(){return E.DID_TYPE_ETHEREUM}}),Object.defineProperty(a,"DID_TYPE_PASSKEY",{enumerable:!0,get:function(){return E.DID_TYPE_PASSKEY}}),Object.defineProperty(a,"fromTypeInfo",{enumerable:!0,get:function(){return E.fromTypeInfo}}),Object.defineProperty(a,"isEthereumDid",{enumerable:!0,get:function(){return E.isEthereumDid}}),Object.defineProperty(a,"isEthereumType",{enumerable:!0,get:function(){return E.isEthereumType}}),Object.defineProperty(a,"toTypeInfo",{enumerable:!0,get:function(){return E.toTypeInfo}}),Object.defineProperty(a,"toTypeInfoStr",{enumerable:!0,get:function(){return E.toTypeInfoStr}});const T=util$3;Object.defineProperty(a,"DID_PREFIX",{enumerable:!0,get:function(){return T.DID_PREFIX}}),Object.defineProperty(a,"toStrictHex",{enumerable:!0,get:function(){return T.toStrictHex}});const S=(U,W)=>{const X=(0,E.DidType)(W),Q=(0,u.getSigner)(X.pk).getPublicKey(U);return P(Q.indexOf("0x")===0?Q:`0x${Q}`,X)};a.fromSecretKey=S;const P=(U,W)=>{const X=(0,E.DidType)(W),J=(0,u.getHasher)(X.hash)(U,1);return O(J,X)};a.fromPublicKey=P;const O=(U,W)=>{const X=(0,E.DidType)(W),Q=(0,_.stripHexPrefix)(U).slice(0,40),J=(0,u.getHasher)(X.hash),ee=(0,E.fromTypeInfo)(X),te=(0,_.stripHexPrefix)(J(`0x${ee}${Q}`,1)).slice(0,8),oe=`0x${ee}${Q}${te}`;return(0,E.isEthereumType)(X)?(0,E.toChecksumAddress)(`0x${U.slice(-40)}`):X.address===u.types.EncodingType.BASE58?(0,_.toBase58)(oe):oe};a.fromPublicKeyHash=O;const B=(U,W=u.types.RoleType.ROLE_ACCOUNT)=>{const X=Object.keys(u.types.RoleType),Q=Object.values(u.types.RoleType);if(Q.indexOf(W)===-1)throw new Error(`Unsupported role type ${W} when gen ddi from hash`);const J=(0,E.DidType)({role:u.types.RoleType[X[Q.indexOf(W)]]});return O(U,J)};a.fromHash=B;const V=(U,W)=>{if(j(U)===!1)return!1;const X=(0,E.toTypeInfo)(U),Q=P(W,X),J=U.replace(T.DID_PREFIX,"");return Q===J};a.isFromPublicKey=V;const j=U=>{if(!U)return!1;const W=(0,_.toAddress)(String(U)),{hash:X}=(0,E.toTypeInfo)(W);if(typeof X>"u")return!1;if((0,E.isEthereumDid)(W))return!0;const Q=(0,u.getHasher)(X),J=(0,T.toBytes)(W),ee=(0,T.toStrictHex)(Buffer$3.from(J.slice(0,22)).toString("hex")),te=(0,T.toStrictHex)(Buffer$3.from(J.slice(22,26)).toString("hex")),oe=(0,_.stripHexPrefix)(Q(`0x${ee}`,1)).slice(0,8);return te===oe};a.isValid=j})(lib$3);Object.defineProperty(lib$4,"__esModule",{value:!0});lib$4.WalletType=void 0;lib$4.Wallet=Wallet;lib$4.fromSecretKey=fromSecretKey;var fromPublicKey_1=lib$4.fromPublicKey=fromPublicKey;lib$4.fromAddress=fromAddress;lib$4.fromRandom=fromRandom;lib$4.fromJSON=fromJSON;lib$4.isValid=isValid;const util_1=lib$5,mcrypto_1=lib$6,did_1=lib$3;lib$4.WalletType=did_1.DidType;function Wallet(a,u="default"){const _=(0,did_1.DidType)(u),E=(0,mcrypto_1.getSigner)(_.pk),T=(0,mcrypto_1.getHasher)(_.hash);return{type:_,secretKey:a.sk,publicKey:a.pk,address:a.pk?(0,did_1.fromPublicKey)(a.pk,_):a.address,hash(S,P=1,O="hex"){return T(S,P,O)},sign(S,P=!0,O="hex"){if(!a.sk)throw new Error("Cannot sign data without a secretKey");if(P){const B=T(S,1);return E.sign(B,a.sk,O)}return E.sign(S,a.sk,O)},async verify(S,P,O=!0,B){if(!a.pk)throw new Error("Cannot verify data without a publicKey");const V=O?T(S,1):S;return E.verify(V,P,a.pk,B)},ethHash(S){if(typeof E.ethHash!="function")throw new Error("ethHash is not supported by signer");return E.ethHash(S)},ethSign(S,P=!0){if(!a.sk)throw new Error("Cannot sign data without a secretKey");if(typeof E.ethHash!="function")throw new Error("ethSign is not supported by signer");return P?E.ethSign(E.ethHash(S),(0,util_1.toHex)(a.sk)):E.ethSign(S,(0,util_1.toHex)(a.sk))},ethVerify(S,P,O=!0){if(typeof E.ethHash!="function")throw new Error("ethVerify is not supported by signer");const B=O?E.ethHash(S):S;return E.ethRecover(B,P)===this.address},toAddress(){return a.pk?(0,did_1.fromPublicKey)(a.pk,_):a.address},toJSON(){return{type:did_1.DidType.toJSON(_),sk:(0,util_1.toHex)(a.sk),pk:(0,util_1.toHex)(a.pk),address:this.address}}}}function fromSecretKey(a,u="default"){const _=(0,did_1.DidType)(u),E={sk:a,pk:(0,mcrypto_1.getSigner)(_.pk).getPublicKey(a)};return Wallet(E,_)}function fromPublicKey(a,u="default"){return Wallet({pk:a},(0,did_1.DidType)(u))}function fromAddress(a){return Wallet({address:(0,did_1.toAddress)(a)},(0,did_1.toTypeInfo)(a))}function fromRandom(a="default"){const u=(0,did_1.DidType)(a),E=(0,mcrypto_1.getSigner)(u.pk).genKeyPair();return Wallet({sk:E.secretKey,pk:E.publicKey},u)}function fromJSON(a){const u=did_1.DidType.fromJSON(a.type);return Wallet(a,u)}function isValid(a,u=!0){return!(!a||typeof a!="object"||typeof a.verify!="function"||typeof a.toAddress!="function"||typeof a.toJSON!="function"||!a.type||!a.publicKey||u&&(!a.secretKey||typeof a.sign!="function"))}var isUrl_1=isUrl,protocolAndDomainRE=/^(?:\w+:)?\/\/(\S+)$/,localhostDomainRE=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,nonLocalhostDomainRE=/^[^\s\.]+\.\S{2,}$/;function isUrl(a){if(typeof a!="string")return!1;var u=a.match(protocolAndDomainRE);if(!u)return!1;var _=u[1];return _?!!(localhostDomainRE.test(_)||nonLocalhostDomainRE.test(_)):!1}const isUrl$1=getDefaultExportFromCjs(isUrl_1);var __defProp$4=Object.defineProperty,__defNormalProp$4=(a,u,_)=>u in a?__defProp$4(a,u,{enumerable:!0,configurable:!0,writable:!0,value:_}):a[u]=_,__publicField$4=(a,u,_)=>(__defNormalProp$4(a,u+"",_),_);class AuthService{constructor({api:u}){__publicField$4(this,"api"),this.api=u}async getUserPublicInfo({did:u}){const{data:_}=await this.api.get("/api/user",{params:{did:u}});return _}async getUserPrivacyConfig({did:u}){const{data:_}=await this.api.get("/api/user/privacy/config",{params:{did:u}});return _}async saveUserPrivacyConfig(u){const{data:_}=await this.api.post("/api/user/privacy/config",u);return _}async getUserNotificationConfig(){const{data:u}=await this.api.get("/api/user/notification/config");return u}async saveUserNotificationConfig(u){const{data:_}=await this.api.post("/api/user/notification/config",u);return _}async testNotificationWebhook(u){const{data:_}=await this.api.put("/api/user/notification/webhook",u);return _}async getProfileUrl({did:u,locale:_}){const E=`${constant.WELLKNOWN_SERVICE_PATH_PREFIX}/user`;return withQuery(E,{did:u,locale:_})}async getProfile(){const{data:u}=await this.api.get("/api/user/profile");return u}async refreshProfile(){await this.api.put("/api/user/refreshProfile")}async saveProfile({locale:u,inviter:_,metadata:E,address:T}){const{data:S}=await this.api.put("/api/user/profile",{locale:u,inviter:_,metadata:E,address:T});return S}async updateDidSpace({spaceGateway:u}){await this.api.put("/api/user/updateDidSpace",{spaceGateway:u})}async logout({visitorId:u,status:_}){const{data:E}=await this.api.post("/api/user/logout",{visitorId:u,status:_});return E}async destroyMyself(){const{data:u}=await this.api.delete("/api/user");return u}}class TokenService{getSessionToken(u){return api$1.get(constant.SESSION_TOKEN_STORAGE_KEY)?api$1.get(constant.SESSION_TOKEN_STORAGE_KEY):u.sessionTokenKey?window.localStorage.getItem(u.sessionTokenKey):""}setSessionToken(u){api$1.set(constant.SESSION_TOKEN_STORAGE_KEY,u)}removeSessionToken(){api$1.remove(constant.SESSION_TOKEN_STORAGE_KEY)}getRefreshToken(){return localStorage.getItem(constant.REFRESH_TOKEN_STORAGE_KEY)}setRefreshToken(u){localStorage.setItem(constant.REFRESH_TOKEN_STORAGE_KEY,u)}removeRefreshToken(){localStorage.removeItem(constant.REFRESH_TOKEN_STORAGE_KEY)}}const blockletCache=new QuickLRU({maxSize:30,maxAge:60*1e3});class BlockletService{getBlocklet(u,_=!1){if(!u){if(typeof window>"u"||typeof document>"u")throw new Error("Cannot get blocklet in server side without baseUrl");return window.blocklet}if(!_&&blockletCache.has(u))return blockletCache.get(u);const E=withQuery(joinURL(u,"__blocklet__.js"),{type:"json",t:Date.now()});return new Promise(async T=>{const P=await(await fetch(E)).json();blockletCache.set(u,P),T(P)})}loadBlocklet(){return new Promise((u,_)=>{if(typeof window>"u"||typeof document>"u"){_();return}const E=document.createElement("script");let T="/";window.blocklet&&window.blocklet.prefix&&(T=window.blocklet.prefix),E.src=withQuery(joinURL(T,"__blocklet__.js"),{t:Date.now()}),E.onload=()=>{u()},E.onerror=()=>{_()},document.head.append(E)})}getPrefix(u){var _;return u?(u==null?void 0:u.prefix)||"/":typeof window>"u"||typeof document>"u"?null:((_=window.blocklet)==null?void 0:_.prefix)||"/"}}var __defProp$3=Object.defineProperty,__defNormalProp$3=(a,u,_)=>u in a?__defProp$3(a,u,{enumerable:!0,configurable:!0,writable:!0,value:_}):a[u]=_,__publicField$3=(a,u,_)=>(__defNormalProp$3(a,typeof u!="symbol"?u+"":u,_),_);class UserSessionService{constructor({api:u,blocklet:_}){__publicField$3(this,"api"),__publicField$3(this,"blocklet"),this.api=u,this.blocklet=_||new BlockletService}getBaseUrl(u){return u?joinURL(u,constant.WELLKNOWN_SERVICE_PATH_PREFIX):void 0}async getUserSessions({did:u,appUrl:_}){const E=this.getBaseUrl(_),T=await this.blocklet.getBlocklet(),{data:S}=await this.api.get("/api/user-session",{baseURL:E,params:{userDid:u,appPid:T.appPid}});return S}async getMyLoginSessions({appUrl:u}={},_={page:1,pageSize:10}){const E=this.getBaseUrl(u),{data:T}=await this.api.get("/api/user-session/myself",{baseURL:E,params:_});return T}async loginByUserSession({id:u,appPid:_,userDid:E,passportId:T,appUrl:S}){const P=this.getBaseUrl(S),{data:O}=await this.api.post("/api/user-session/login",{id:u,appPid:_,userDid:E,passportId:T},{baseURL:P});return O}}var __defProp$2=Object.defineProperty,__defNormalProp$2=(a,u,_)=>u in a?__defProp$2(a,u,{enumerable:!0,configurable:!0,writable:!0,value:_}):a[u]=_,__publicField$2=(a,u,_)=>(__defNormalProp$2(a,u+"",_),_);class ComponentService{constructor({blocklet:u=window.blocklet}={}){__publicField$2(this,"blocklet"),this.blocklet=u}getComponent(u){var T;return(((T=this.blocklet)==null?void 0:T.componentMountPoints)||[]).find(S=>[S.title,S.name,S.did].includes(u))}getComponentMountPoint(u){const _=this.getComponent(u);return(_==null?void 0:_.mountPoint)||""}getUrl(u,..._){var S;const E=this.getComponentMountPoint(u),T=((S=this.blocklet)==null?void 0:S.appUrl)||"";return joinURL(T,E,..._)}}var __defProp$1=Object.defineProperty,__defNormalProp$1=(a,u,_)=>u in a?__defProp$1(a,u,{enumerable:!0,configurable:!0,writable:!0,value:_}):a[u]=_,__publicField$1=(a,u,_)=>(__defNormalProp$1(a,typeof u!="symbol"?u+"":u,_),_);class FederatedService{constructor({api:u,blocklet:_}){__publicField$1(this,"api"),__publicField$1(this,"blocklet"),__publicField$1(this,"blockletDataCache",{}),this.api=u,this.blocklet=_||new BlockletService}async getTrustedDomains(){const{data:u}=await this.api.get("/api/federated/getTrustedDomains");return u}getMaster(u=this.blocklet.getBlocklet()){var E;const _=(E=u==null?void 0:u.settings)==null?void 0:E.federated;return _==null?void 0:_.master}getConfig(u=this.blocklet.getBlocklet()){var E;const _=(E=u==null?void 0:u.settings)==null?void 0:E.federated;return _==null?void 0:_.config}getFederatedEnabled(u=this.blocklet.getBlocklet()){const _=this.getConfig(u);return(_==null?void 0:_.status)==="approved"}getSourceAppPid(u=this.blocklet.getBlocklet()){const _=this.getMaster(u);return _==null?void 0:_.appPid}getFederatedApp(u=this.blocklet.getBlocklet()){const _=this.getMaster(u);return isEmpty(_)?null:{appId:_.appId,appName:_.appName,appDescription:_.appDescription,appLogo:_.appLogo,appPid:_.appPid,appUrl:_.appUrl,version:_.version,sourceAppPid:_.appPid,provider:"wallet"}}getCurrentApp(u=this.blocklet.getBlocklet()){if(u)return{appId:u.appId,appName:u.appName,appDescription:u.appDescription,appLogo:u.appLogo,appPid:u.appPid,appUrl:u.appUrl,version:u.version,sourceAppPid:null,provider:"wallet"};if(window.env){const _=window.env;return{appId:_.appId,appName:_.appName,appDescription:_.appDescription,appUrl:_.baseUrl,sourceAppPid:null,provider:"wallet",type:"server"}}return null}getApps(u=this.blocklet.getBlocklet()){const _=[],E=this.getFederatedApp(u),T=this.getCurrentApp(u),S=this.getFederatedEnabled(u);return T&&_.push(T),E&&(E==null?void 0:E.appId)!==(T==null?void 0:T.appId)&&S&&_.push(E),_.reverse()}async getBlockletData(u,_=!1){if(!_&&this.blockletDataCache[u])return this.blockletDataCache[u];try{const E=new URL("__blocklet__.js",u);E.searchParams.set("type","json");const S=await(await fetch(E.href)).json();return this.blockletDataCache[u]=S,S}catch(E){return console.error(`Failed to get blocklet data: ${u}`,E),null}}}const version$4="1.16.41",sleep$1=(a=0)=>new Promise(u=>{setTimeout(()=>{u()},a)}),getBearerToken=a=>`Bearer ${encodeURIComponent(a)}`,visitorIdKey="__visitor_id",getVisitorId=()=>localStorage.getItem(visitorIdKey),verifyResponse=(a,u)=>{if(isObject$k(a.data)&&a.status>=200&&a.status<300&&window.blocklet&&window.blocklet.appId&&window.blocklet.appPk){if(!a.data.$signature)throw u(),new Error("Invalid response");const{appId:_,appPk:E}=window.blocklet;if(fromPublicKey_1(E,lib$3.toTypeInfo(_)).verify(zt(omit(a.data,["$signature"])),a.data.$signature)===!1)throw u(),new Error("Invalid response")}return a};function getCSRFToken(){return api$1.get("x-csrf-token")}async function sleepForLoading(a,u=300){a.metaData.endTime=+new Date;const{startTime:_,endTime:E}=a.metaData,T=E-_;T<u&&await sleep$1(u-T),delete a.metaData}const createAxios$1=(a,u)=>{const _={...a==null?void 0:a.headers,"x-blocklet-js-sdk-version":version$4},E=new ComponentService,T=getVisitorId();[void 0,null].includes(T)||(_["x-blocklet-visitor-id"]=T);const S=axios.create({...a,headers:_});return u!=null&&u.lazy&&(S.interceptors.request.use(P=>(P.metaData={startTime:+new Date},P),P=>Promise.reject(P)),S.interceptors.response.use(async P=>(P.config&&await sleepForLoading(P.config,u==null?void 0:u.lazyTime),P),async P=>(P.response&&await sleepForLoading(P.response.config,u==null?void 0:u.lazyTime),Promise.reject(P)))),S.interceptors.request.use(P=>{var B,V;const O=(u==null?void 0:u.componentDid)??((V=(B=window.blocklet)==null?void 0:B.componentId)==null?void 0:V.split("/").pop());return P.baseURL=P.baseURL||E.getComponentMountPoint(O),P.timeout=P.timeout||20*1e3,P.headers["x-csrf-token"]=getCSRFToken(),P},P=>Promise.reject(P)),S};async function renewRefreshToken$1(a){if(!a)throw new Error("Refresh token not found");const u=createAxios$1({baseURL:constant.WELLKNOWN_SERVICE_PATH_PREFIX,timeout:10*1e3,secure:!0,headers:{authorization:getBearerToken(a)}}),{data:_}=await u.post("/api/did/refreshSession");return _}function createRequest$1({getSessionToken:a,setSessionToken:u,removeSessionToken:_,getRefreshToken:E,setRefreshToken:T,removeRefreshToken:S,onRefreshTokenError:P,onRefreshTokenSuccess:O},B,V){let j=null;const U=createAxios$1({timeout:30*1e3,...B},V);return U.interceptors.request.use(async W=>{if(!api$1.get(constant.SESSION_TOKEN_STORAGE_KEY)){const X=a(W);X&&(W.headers.authorization=getBearerToken(X))}return j&&await j,W},W=>Promise.reject(W)),U.interceptors.response.use(W=>{var X;return(X=W.config)!=null&&X.secure?verifyResponse(W,()=>{_(),S()}):W},async W=>{var Q;const X=W.config;if(X&&(X.headers=X!=null&&X.headers?{...X.headers}:{},((Q=W==null?void 0:W.response)==null?void 0:Q.status)===401&&!X._retry)){X._retry=!0;try{j||(j=renewRefreshToken$1(E()));const J=await j;return u(J.nextToken),T(J.nextRefreshToken),typeof O=="function"&&O(J),U(X)}catch(J){return _(),S(),typeof P=="function"&&P(J),Promise.reject(W)}finally{j=null}}return Promise.reject(W)}),U}var __defProp$5=Object.defineProperty,__defNormalProp=(a,u,_)=>u in a?__defProp$5(a,u,{enumerable:!0,configurable:!0,writable:!0,value:_}):a[u]=_,__publicField=(a,u,_)=>(__defNormalProp(a,typeof u!="symbol"?u+"":u,_),_);class BlockletSDK{constructor(){__publicField(this,"api"),__publicField(this,"user"),__publicField(this,"userSession"),__publicField(this,"token"),__publicField(this,"blocklet"),__publicField(this,"federated");const u=new TokenService,_=createRequest$1({getSessionToken:u.getSessionToken,setSessionToken:u.setSessionToken,removeSessionToken:u.removeSessionToken,getRefreshToken:u.getRefreshToken,setRefreshToken:u.setRefreshToken,removeRefreshToken:u.removeRefreshToken,onRefreshTokenError:()=>{console.error("Failed to refresh token")},onRefreshTokenSuccess:()=>{}},{baseURL:constant.WELLKNOWN_SERVICE_PATH_PREFIX}),E=new BlockletService;this.user=new AuthService({api:_}),this.federated=new FederatedService({api:_,blocklet:E}),this.userSession=new UserSessionService({api:_,blocklet:E}),this.token=u,this.blocklet=E,this.api=_}}function createAxios$2(a={},u={}){const _=new TokenService;return createRequest$1({getSessionToken:_.getSessionToken,setSessionToken:_.setSessionToken,removeSessionToken:_.removeSessionToken,getRefreshToken:_.getRefreshToken,setRefreshToken:_.setRefreshToken,removeRefreshToken:_.removeRefreshToken,onRefreshTokenError:()=>{console.error("Failed to refresh token")},onRefreshTokenSuccess:()=>{}},a,u)}const getBlockletSDK=(()=>{let a;return()=>(a||(a=new BlockletSDK),a)})();var lib$2={},dsbridge={};Object.defineProperty(dsbridge,"__esModule",{value:!0});dsbridge.default=void 0;var bridge={call:function a(u,_,E){var T="";typeof _=="function"&&(E=_,_={});var S={data:_===void 0?null:_};if(typeof E=="function"){var P="dscb"+window.dscb++;window[P]=E,S._dscbstub=P}return S=JSON.stringify(S),window._dsbridge?T=_dsbridge.call(u,S):(window._dswk||navigator.userAgent.indexOf("_dsbridge")!=-1)&&(T=prompt("_dsbridge="+u,S)),JSON.parse(T||"{}").data},register:function a(u,_,E){var T=E?window._dsaf:window._dsf;window._dsInit||(window._dsInit=!0,setTimeout(function(){bridge.call("_dsb.dsinit")},0)),typeof _=="object"?T._obs[u]=_:T[u]=_},registerAsyn:function a(u,_){this.register(u,_,!0)},hasNativeMethod:function a(u,_){return this.call("_dsb.hasNativeMethod",{name:u,type:_||"all"})},disableJavascriptDialogBlock:function a(u){this.call("_dsb.disableJavascriptDialogBlock",{disable:u!==!1})},canUseBridge(){return!!(window._dsbridge||window._dswk||navigator.userAgent.indexOf("_dsbridge")!=-1)}};(function(){if(!bridge.canUseBridge()||window._dsf)return;const a=window.close;var u={_dsf:{_obs:{}},_dsaf:{_obs:{}},dscb:0,dsBridge:bridge,close:function(){bridge.call("_dsb.closePage"),a()},_handleMessageFromNative:function(T){var S=JSON.parse(T.data),P={id:T.callbackId,complete:!0},O=this._dsf[T.method],B=this._dsaf[T.method],V=function(oe,ae){P.data=oe.apply(ae,S),bridge.call("_dsb.returnValue",P)},j=function(oe,ae){S.push(function(se,xe){P.data=se,P.complete=xe!==!1,bridge.call("_dsb.returnValue",P)}),oe.apply(ae,S)};if(O)V(O,this._dsf);else if(B)j(B,this._dsaf);else{var U=T.method.split(".");if(U.length<2)return;var W=U.pop(),X=U.join("."),Q=this._dsf._obs,J=Q[X]||{},ee=J[W];if(ee&&typeof ee=="function"){V(ee,J);return}if(Q=this._dsaf._obs,J=Q[X]||{},ee=J[W],ee&&typeof ee=="function"){j(ee,J);return}}}};for(var _ in u)window[_]=u[_];bridge.register("_hasJavascriptMethod",function(E,T){var S=E.split(".");if(S.length<2)return!!(_dsf[S]||_dsaf[S]);var E=S.pop(),P=S.join("."),O=_dsf._obs[P]||_dsaf._obs[P];return O&&!!O[E]})})();dsbridge.default=bridge;Object.defineProperty(lib$2,"__esModule",{value:!0});var default_1$a=lib$2.default=void 0,_dsbridge$1=_interopRequireDefault$c(dsbridge);function _interopRequireDefault$c(a){return a&&a.__esModule?a:{default:a}}function ownKeys$8(a,u){var _=Object.keys(a);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(a);u&&(E=E.filter(function(T){return Object.getOwnPropertyDescriptor(a,T).enumerable})),_.push.apply(_,E)}return _}function _objectSpread$5(a){for(var u=1;u<arguments.length;u++){var _=arguments[u]!=null?arguments[u]:{};u%2?ownKeys$8(Object(_),!0).forEach(function(E){_defineProperty$7(a,E,_[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(_)):ownKeys$8(Object(_)).forEach(function(E){Object.defineProperty(a,E,Object.getOwnPropertyDescriptor(_,E))})}return a}function _defineProperty$7(a,u,_){return(u=_toPropertyKey(u))in a?Object.defineProperty(a,u,{value:_,enumerable:!0,configurable:!0,writable:!0}):a[u]=_,a}function _toPropertyKey(a){var u=_toPrimitive(a,"string");return typeof u=="symbol"?u:u+""}function _toPrimitive(a,u){if(typeof a!="object"||!a)return a;var _=a[Symbol.toPrimitive];if(_!==void 0){var E=_.call(a,u||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(a)}const BRIDGE_VERSION="1";default_1$a=lib$2.default={register(){_dsbridge$1.default.canUseBridge()?_dsbridge$1.default.register(...arguments):console.warn("dsbridge is not available")},registerAsyn(){_dsbridge$1.default.canUseBridge()?_dsbridge$1.default.registerAsyn(...arguments):console.warn("dsbridge is not available")},call(){_dsbridge$1.default.call(...arguments)},asyncCall(){for(var a=arguments.length,u=new Array(a),_=0;_<a;_++)u[_]=arguments[_];return new Promise((E,T)=>{_dsbridge$1.default.call(...u,S=>{try{const P=JSON.parse(S);if(P.code===0){const O=JSON.parse(P.data);E(O)}else T(new Error(P.error))}catch{E(S)}})})},shareMessage(a){const{content:u,imgUrl:_,success:E,fail:T}=a;if(!u&&!_){T("params error");return}_dsbridge$1.default.call("arcShare",JSON.stringify({content:u,imgUrl:_}),S=>{const P=JSON.parse(S);P&&P.code===0?typeof E=="function"&&E(S):typeof T=="function"&&T(S)})},showLoading(){_dsbridge$1.default.call("arcShowLoading")},hideLoading(){_dsbridge$1.default.call("arcHideLoading")},showToast(a){a&&typeof a=="string"&&_dsbridge$1.default.call("arcToast",a)},chooseImgs(a){const{limit:u,success:_,fail:E}=a;_dsbridge$1.default.call("arcChooseImgs",JSON.stringify({limit:u}),T=>{const S=JSON.parse(T);S&&S.code===0?typeof _=="function"&&_(T):typeof E=="function"&&E(T)})},previewImgs(a){const{imgs:u}=a;!u||u.length===0||_dsbridge$1.default.call("arcPreviewImgs",JSON.stringify(a))},isSetPWD(a){const{success:u,fail:_}=a;_dsbridge$1.default.call("arcIsSetPWD","",E=>{const T=JSON.parse(E);T&&T.code===0?typeof u=="function"&&u(E):typeof _=="function"&&_(E)})},isCodeABOk(a){const{success:u,fail:_}=a;_dsbridge$1.default.call("arcIsCodeABOk","",E=>{const T=JSON.parse(E);T&&T.code===0?typeof u=="function"&&u(E):typeof _=="function"&&_(E)})},callArc(a){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise((_,E)=>{const S=["arc",a].join("__"),P=_objectSpread$5(_objectSpread$5({},u),{},{_version:BRIDGE_VERSION});_dsbridge$1.default.call(S,P,O=>{try{const B=JSON.parse(O);if((B==null?void 0:B._version)===BRIDGE_VERSION)if(B.code===0)try{const V=JSON.parse(B.data);_(V)}catch{console.warn("Failed to parse result.data"),_(B.data)}else E(new Error(B.error));else _(B)}catch{console.warn("Failed to parse resString"),_(O)}})})},registerBlocklet(a){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>{};if(_dsbridge$1.default.canUseBridge()){const E=["blocklet",a].join("__");_dsbridge$1.default.registerAsyn(E,function(){for(var T=arguments.length,S=new Array(T),P=0;P<T;P++)S[P]=arguments[P];const O=S.map(B=>{try{return JSON.parse(B)}catch{return B}});u(...O)})}else console.warn("dsbridge is not available")}};const cacheBlockletData={};function getMaster(a=window.blocklet){var _;return(((_=a==null?void 0:a.settings)==null?void 0:_.federated)||{}).master}function getConfig(a=window.blocklet){var _;return(((_=a==null?void 0:a.settings)==null?void 0:_.federated)||{}).config}function getFederatedEnabled(a=window.blocklet){const u=getConfig(a);return(u==null?void 0:u.status)==="approved"}function getFederatedApp(a=window.blocklet){const u=getMaster(a);return!isEmpty(u)?{appId:u.appId,appName:u.appName,appDescription:u.appDescription,appLogo:u.appLogo,appPid:u.appPid,appUrl:u.appUrl,version:u.version,sourceAppPid:u.appPid,provider:"wallet"}:null}function getCurrentApp(a=window.blocklet){return a?{appId:a.appId,appName:a.appName,appDescription:a.appDescription,appLogo:a.appLogo,appPid:a.appPid,appUrl:a.appUrl,currentAppUrl:a===window.blocklet?window.location.origin:void 0,version:a.version,sourceAppPid:null,provider:"wallet"}:window.env?(a=window.env,{appId:a.appId,appName:a.appName,appDescription:a.appDescription,appUrl:a.baseUrl,currentAppUrl:window.location.origin,sourceAppPid:null,provider:"wallet",type:"server"}):null}function getApps(a){const u=[],_=getFederatedApp(a),E=getCurrentApp(a),T=getFederatedEnabled(a);return E&&u.push(E),_&&(_==null?void 0:_.appId)!==(E==null?void 0:E.appId)&&T&&u.push(_),u.reverse()}async function getBlockletData(a,u=!1){if(!u&&cacheBlockletData[a])return cacheBlockletData[a];try{const _=new URL("__blocklet__.js",a);_.searchParams.set("type","json");const T=await(await fetch(_.href)).json();return cacheBlockletData[a]=T,T}catch(_){return console.error(`Failed to get blocklet data: ${a}`,_),null}}class CookieStorageEngine{constructor(u,_){this.storageKey=u,this.options=_||{}}setToken(u){return Cookies.set(this.storageKey,u,{...getCookieOptions(this.options)})}getToken(){return Cookies.get(this.storageKey)}removeToken(){return Cookies.remove(this.storageKey,getCookieOptions(this.options))}}function e$1(a){this.message=a}e$1.prototype=new Error,e$1.prototype.name="InvalidCharacterError";var r$2=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(a){var u=String(a).replace(/=+$/,"");if(u.length%4==1)throw new e$1("'atob' failed: The string to be decoded is not correctly encoded.");for(var _,E,T=0,S=0,P="";E=u.charAt(S++);~E&&(_=T%4?64*_+E:E,T++%4)?P+=String.fromCharCode(255&_>>(-2*T&6)):0)E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(E);return P};function t$4(a){var u=a.replace(/-/g,"+").replace(/_/g,"/");switch(u.length%4){case 0:break;case 2:u+="==";break;case 3:u+="=";break;default:throw"Illegal base64url string!"}try{return function(_){return decodeURIComponent(r$2(_).replace(/(.)/g,function(E,T){var S=T.charCodeAt(0).toString(16).toUpperCase();return S.length<2&&(S="0"+S),"%"+S}))}(u)}catch{return r$2(u)}}function n$1(a){this.message=a}function o(a,u){if(typeof a!="string")throw new n$1("Invalid token specified");var _=(u=u||{}).header===!0?0:1;try{return JSON.parse(t$4(a.split(".")[_]))}catch(E){throw new n$1("Invalid token specified: "+E.message)}}n$1.prototype=new Error,n$1.prototype.name="InvalidTokenError";class LocalStorageEngine{constructor(u){this.storageKey=u}setToken(u){if(!(typeof window>"u"||typeof window.localStorage>"u"))return localStorage.setItem(this.storageKey,u)}getToken(){if(typeof window>"u"||typeof window.localStorage>"u")return;const u=localStorage.getItem(this.storageKey);let _,E;try{if({value:_,exp:E}=JSON.parse(u),E===void 0||_===void 0)return u}catch{_=u}try{E=o(_).exp}catch{return}if(!(new Date().getTime()>E*1e3))return _}removeToken(){if(!(typeof window>"u"||typeof window.localStorage>"u"))return localStorage.removeItem(this.storageKey)}}function createStorage(a="did.auth.token",u="ls",_={}){if(!a)throw new Error("storageKey must be specified to create a storage");let E=null;if(u==="ls")E=new LocalStorageEngine(a);else if(u==="cookie")E=new CookieStorageEngine(a,_);else throw new Error("storageEngine must be ls or cookie");return{getToken:E.getToken.bind(E),setToken:E.setToken.bind(E),removeToken:E.removeToken.bind(E),engine:u,key:a}}const overheadLength=tweetnacl.box.publicKeyLength+tweetnacl.box.overheadLength,ERROR_MSG_INPUT="Input must be an string, Buffer or Uint8Array";function normalizeInput(a){let u;if(a instanceof Uint8Array)u=a;else if(typeof a=="string")u=new TextEncoder().encode(a);else throw new Error(ERROR_MSG_INPUT);return u}function toHex(a){return Array.prototype.map.call(a,function(u){return(u<16?"0":"")+u.toString(16)}).join("")}function uint32ToHex(a){return(4294967296+a).toString(16).substring(1)}function debugPrint(a,u,_){let E=`
|
|
248
248
|
`+a+" = ";for(let T=0;T<u.length;T+=2){if(_===32)E+=uint32ToHex(u[T]).toUpperCase(),E+=" ",E+=uint32ToHex(u[T+1]).toUpperCase();else if(_===64)E+=uint32ToHex(u[T+1]).toUpperCase(),E+=uint32ToHex(u[T]).toUpperCase();else throw new Error("Invalid size "+_);T%6===4?E+=`
|
|
249
|
-
`+new Array(a.length+4).join(" "):T<u.length-2&&(E+=" ")}console.log(E)}function testSpeed(a,u,_){let E=new Date().getTime();const T=new Uint8Array(u);for(let P=0;P<u;P++)T[P]=P%256;const S=new Date().getTime();console.log("Generated random input in "+(S-E)+"ms"),E=S;for(let P=0;P<_;P++){const O=a(T),B=new Date().getTime(),V=B-E;E=B,console.log("Hashed in "+V+"ms: "+O.substring(0,20)+"..."),console.log(Math.round(u/(1<<20)/(V/1e3)*100)/100+" MB PER SECOND")}}var util$2={normalizeInput,toHex,debugPrint,testSpeed};const util$1=util$2;function ADD64AA(a,u,_){const E=a[u]+a[_];let T=a[u+1]+a[_+1];E>=4294967296&&T++,a[u]=E,a[u+1]=T}function ADD64AC(a,u,_,E){let T=a[u]+_;_<0&&(T+=4294967296);let S=a[u+1]+E;T>=4294967296&&S++,a[u]=T,a[u+1]=S}function B2B_GET32(a,u){return a[u]^a[u+1]<<8^a[u+2]<<16^a[u+3]<<24}function B2B_G(a,u,_,E,T,S){const P=m$1[T],O=m$1[T+1],B=m$1[S],V=m$1[S+1];ADD64AA(v$2,a,u),ADD64AC(v$2,a,P,O);let j=v$2[E]^v$2[a],U=v$2[E+1]^v$2[a+1];v$2[E]=U,v$2[E+1]=j,ADD64AA(v$2,_,E),j=v$2[u]^v$2[_],U=v$2[u+1]^v$2[_+1],v$2[u]=j>>>24^U<<8,v$2[u+1]=U>>>24^j<<8,ADD64AA(v$2,a,u),ADD64AC(v$2,a,B,V),j=v$2[E]^v$2[a],U=v$2[E+1]^v$2[a+1],v$2[E]=j>>>16^U<<16,v$2[E+1]=U>>>16^j<<16,ADD64AA(v$2,_,E),j=v$2[u]^v$2[_],U=v$2[u+1]^v$2[_+1],v$2[u]=U>>>31^j<<1,v$2[u+1]=j>>>31^U<<1}const BLAKE2B_IV32=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),SIGMA8=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],SIGMA82=new Uint8Array(SIGMA8.map(function(a){return a*2})),v$2=new Uint32Array(32),m$1=new Uint32Array(32);function blake2bCompress(a,u){let _=0;for(_=0;_<16;_++)v$2[_]=a.h[_],v$2[_+16]=BLAKE2B_IV32[_];for(v$2[24]=v$2[24]^a.t,v$2[25]=v$2[25]^a.t/4294967296,u&&(v$2[28]=~v$2[28],v$2[29]=~v$2[29]),_=0;_<32;_++)m$1[_]=B2B_GET32(a.b,4*_);for(_=0;_<12;_++)B2B_G(0,8,16,24,SIGMA82[_*16+0],SIGMA82[_*16+1]),B2B_G(2,10,18,26,SIGMA82[_*16+2],SIGMA82[_*16+3]),B2B_G(4,12,20,28,SIGMA82[_*16+4],SIGMA82[_*16+5]),B2B_G(6,14,22,30,SIGMA82[_*16+6],SIGMA82[_*16+7]),B2B_G(0,10,20,30,SIGMA82[_*16+8],SIGMA82[_*16+9]),B2B_G(2,12,22,24,SIGMA82[_*16+10],SIGMA82[_*16+11]),B2B_G(4,14,16,26,SIGMA82[_*16+12],SIGMA82[_*16+13]),B2B_G(6,8,18,28,SIGMA82[_*16+14],SIGMA82[_*16+15]);for(_=0;_<16;_++)a.h[_]=a.h[_]^v$2[_]^v$2[_+16]}const parameterBlock=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function blake2bInit(a,u,_,E){if(a===0||a>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(u&&u.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(_&&_.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(E&&E.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const T={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:a};parameterBlock.fill(0),parameterBlock[0]=a,u&&(parameterBlock[1]=u.length),parameterBlock[2]=1,parameterBlock[3]=1,_&¶meterBlock.set(_,32),E&¶meterBlock.set(E,48);for(let S=0;S<16;S++)T.h[S]=BLAKE2B_IV32[S]^B2B_GET32(parameterBlock,S*4);return u&&(blake2bUpdate(T,u),T.c=128),T}function blake2bUpdate(a,u){for(let _=0;_<u.length;_++)a.c===128&&(a.t+=a.c,blake2bCompress(a,!1),a.c=0),a.b[a.c++]=u[_]}function blake2bFinal(a){for(a.t+=a.c;a.c<128;)a.b[a.c++]=0;blake2bCompress(a,!0);const u=new Uint8Array(a.outlen);for(let _=0;_<a.outlen;_++)u[_]=a.h[_>>2]>>8*(_&3);return u}function blake2b(a,u,_,E,T){_=_||64,a=util$1.normalizeInput(a),E&&(E=util$1.normalizeInput(E)),T&&(T=util$1.normalizeInput(T));const S=blake2bInit(_,u,E,T);return blake2bUpdate(S,a),blake2bFinal(S)}function blake2bHex(a,u,_,E,T){const S=blake2b(a,u,_,E,T);return util$1.toHex(S)}var blake2b_1={blake2b,blake2bHex,blake2bInit,blake2bUpdate,blake2bFinal};const blake=getDefaultExportFromCjs(blake2b_1);function nonce(a,u){var _=blake.blake2bInit(tweetnacl.box.nonceLength,null);return blake.blake2bUpdate(_,a),blake.blake2bUpdate(_,u),blake.blake2bFinal(_)}function zero(a){for(var u=0;u<a.length;u++)a[u]=0}function seal(a,u){var _=new Uint8Array(overheadLength+a.length),E=tweetnacl.box.keyPair();_.set(E.publicKey);var T=nonce(E.publicKey,u),S=tweetnacl.box(a,T,u,E.secretKey);return _.set(S,E.publicKey.length),zero(E.secretKey),_}function open(a,u,_){var E=a.subarray(0,tweetnacl.box.publicKeyLength),T=nonce(E,u),S=a.subarray(tweetnacl.box.publicKeyLength);return tweetnacl.box.open(S,T,E,_)}const SealedBox={seal,open};class CustomError extends Error{}function getSafeUrl(a,{throwOnError:u=!0,returnRaw:_=!1,allowProtocols:E=["https:","http:"],allowDomains:T=void 0}={}){var S;T===void 0&&(T=((S=window.blocklet)==null?void 0:S.domainAliases)||[],T.push(window.location.href));try{let P;a.startsWith("/")?P=window.location.origin:a.startsWith("./")&&(P=window.location.href);const O=new URL(a,P),B=T&&T.map(V=>{try{return new URL(V).hostname}catch{return new URL(`https://${V}`).hostname}});if(E!==null&&!E.includes(O.protocol)){if(console.error(`Invalid protocol: ${O.protocol}`),u)throw new CustomError(`Invalid protocol: ${O.protocol}`);return null}if(B!==null&&!B.includes(O.hostname)){if(console.error(`Invalid host: ${O.hostname}`),u)throw new CustomError(`Invalid host: ${O.hostname}`);return null}return _?a:O.href}catch(P){if(P instanceof CustomError){if(u)throw P;return null}if(console.error(`Failed to convert url: ${a}`),u)throw new Error(`Failed to convert url: ${a}`);return null}}const createDebug=debug$4,createLogger$1=a=>new Proxy(window.console,{get(u,_){return(...E)=>{try{return["log","debug","info","warn","error"].includes(_)?u[_](a,...E):u[_]instanceof Function?u[_](...E):u[_]}catch(T){console.error(`Logger error in ${a}:`,T);return}}}}),cssKeywords={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},reverseKeywords={};for(const a of Object.keys(cssKeywords))reverseKeywords[cssKeywords[a]]=a;const convert$1={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},LAB_FT=(6/29)**3;for(const a of Object.keys(convert$1)){if(!("channels"in convert$1[a]))throw new Error("missing channels property: "+a);if(!("labels"in convert$1[a]))throw new Error("missing channel labels property: "+a);if(convert$1[a].labels.length!==convert$1[a].channels)throw new Error("channel and label counts mismatch: "+a);const{channels:u,labels:_}=convert$1[a];delete convert$1[a].channels,delete convert$1[a].labels,Object.defineProperty(convert$1[a],"channels",{value:u}),Object.defineProperty(convert$1[a],"labels",{value:_})}convert$1.rgb.hsl=function(a){const u=a[0]/255,_=a[1]/255,E=a[2]/255,T=Math.min(u,_,E),S=Math.max(u,_,E),P=S-T;let O,B;switch(S){case T:{O=0;break}case u:{O=(_-E)/P;break}case _:{O=2+(E-u)/P;break}case E:{O=4+(u-_)/P;break}}O=Math.min(O*60,360),O<0&&(O+=360);const V=(T+S)/2;return S===T?B=0:V<=.5?B=P/(S+T):B=P/(2-S-T),[O,B*100,V*100]};convert$1.rgb.hsv=function(a){let u,_,E,T,S;const P=a[0]/255,O=a[1]/255,B=a[2]/255,V=Math.max(P,O,B),j=V-Math.min(P,O,B),U=function(W){return(V-W)/6/j+1/2};if(j===0)T=0,S=0;else{switch(S=j/V,u=U(P),_=U(O),E=U(B),V){case P:{T=E-_;break}case O:{T=1/3+u-E;break}case B:{T=2/3+_-u;break}}T<0?T+=1:T>1&&(T-=1)}return[T*360,S*100,V*100]};convert$1.rgb.hwb=function(a){const u=a[0],_=a[1];let E=a[2];const T=convert$1.rgb.hsl(a)[0],S=1/255*Math.min(u,Math.min(_,E));return E=1-1/255*Math.max(u,Math.max(_,E)),[T,S*100,E*100]};convert$1.rgb.cmyk=function(a){const u=a[0]/255,_=a[1]/255,E=a[2]/255,T=Math.min(1-u,1-_,1-E),S=(1-u-T)/(1-T)||0,P=(1-_-T)/(1-T)||0,O=(1-E-T)/(1-T)||0;return[S*100,P*100,O*100,T*100]};function comparativeDistance(a,u){return(a[0]-u[0])**2+(a[1]-u[1])**2+(a[2]-u[2])**2}convert$1.rgb.keyword=function(a){const u=reverseKeywords[a];if(u)return u;let _=Number.POSITIVE_INFINITY,E;for(const T of Object.keys(cssKeywords)){const S=cssKeywords[T],P=comparativeDistance(a,S);P<_&&(_=P,E=T)}return E};convert$1.keyword.rgb=function(a){return cssKeywords[a]};convert$1.rgb.xyz=function(a){let u=a[0]/255,_=a[1]/255,E=a[2]/255;u=u>.04045?((u+.055)/1.055)**2.4:u/12.92,_=_>.04045?((_+.055)/1.055)**2.4:_/12.92,E=E>.04045?((E+.055)/1.055)**2.4:E/12.92;const T=u*.4124564+_*.3575761+E*.1804375,S=u*.2126729+_*.7151522+E*.072175,P=u*.0193339+_*.119192+E*.9503041;return[T*100,S*100,P*100]};convert$1.rgb.lab=function(a){const u=convert$1.rgb.xyz(a);let _=u[0],E=u[1],T=u[2];_/=95.047,E/=100,T/=108.883,_=_>LAB_FT?_**(1/3):7.787*_+16/116,E=E>LAB_FT?E**(1/3):7.787*E+16/116,T=T>LAB_FT?T**(1/3):7.787*T+16/116;const S=116*E-16,P=500*(_-E),O=200*(E-T);return[S,P,O]};convert$1.hsl.rgb=function(a){const u=a[0]/360,_=a[1]/100,E=a[2]/100;let T,S;if(_===0)return S=E*255,[S,S,S];const P=E<.5?E*(1+_):E+_-E*_,O=2*E-P,B=[0,0,0];for(let V=0;V<3;V++)T=u+1/3*-(V-1),T<0&&T++,T>1&&T--,6*T<1?S=O+(P-O)*6*T:2*T<1?S=P:3*T<2?S=O+(P-O)*(2/3-T)*6:S=O,B[V]=S*255;return B};convert$1.hsl.hsv=function(a){const u=a[0];let _=a[1]/100,E=a[2]/100,T=_;const S=Math.max(E,.01);E*=2,_*=E<=1?E:2-E,T*=S<=1?S:2-S;const P=(E+_)/2,O=E===0?2*T/(S+T):2*_/(E+_);return[u,O*100,P*100]};convert$1.hsv.rgb=function(a){const u=a[0]/60,_=a[1]/100;let E=a[2]/100;const T=Math.floor(u)%6,S=u-Math.floor(u),P=255*E*(1-_),O=255*E*(1-_*S),B=255*E*(1-_*(1-S));switch(E*=255,T){case 0:return[E,B,P];case 1:return[O,E,P];case 2:return[P,E,B];case 3:return[P,O,E];case 4:return[B,P,E];case 5:return[E,P,O]}};convert$1.hsv.hsl=function(a){const u=a[0],_=a[1]/100,E=a[2]/100,T=Math.max(E,.01);let S,P;P=(2-_)*E;const O=(2-_)*T;return S=_*T,S/=O<=1?O:2-O,S=S||0,P/=2,[u,S*100,P*100]};convert$1.hwb.rgb=function(a){const u=a[0]/360;let _=a[1]/100,E=a[2]/100;const T=_+E;let S;T>1&&(_/=T,E/=T);const P=Math.floor(6*u),O=1-E;S=6*u-P,P&1&&(S=1-S);const B=_+S*(O-_);let V,j,U;switch(P){default:case 6:case 0:{V=O,j=B,U=_;break}case 1:{V=B,j=O,U=_;break}case 2:{V=_,j=O,U=B;break}case 3:{V=_,j=B,U=O;break}case 4:{V=B,j=_,U=O;break}case 5:{V=O,j=_,U=B;break}}return[V*255,j*255,U*255]};convert$1.cmyk.rgb=function(a){const u=a[0]/100,_=a[1]/100,E=a[2]/100,T=a[3]/100,S=1-Math.min(1,u*(1-T)+T),P=1-Math.min(1,_*(1-T)+T),O=1-Math.min(1,E*(1-T)+T);return[S*255,P*255,O*255]};convert$1.xyz.rgb=function(a){const u=a[0]/100,_=a[1]/100,E=a[2]/100;let T,S,P;return T=u*3.2404542+_*-1.5371385+E*-.4985314,S=u*-.969266+_*1.8760108+E*.041556,P=u*.0556434+_*-.2040259+E*1.0572252,T=T>.0031308?1.055*T**(1/2.4)-.055:T*12.92,S=S>.0031308?1.055*S**(1/2.4)-.055:S*12.92,P=P>.0031308?1.055*P**(1/2.4)-.055:P*12.92,T=Math.min(Math.max(0,T),1),S=Math.min(Math.max(0,S),1),P=Math.min(Math.max(0,P),1),[T*255,S*255,P*255]};convert$1.xyz.lab=function(a){let u=a[0],_=a[1],E=a[2];u/=95.047,_/=100,E/=108.883,u=u>LAB_FT?u**(1/3):7.787*u+16/116,_=_>LAB_FT?_**(1/3):7.787*_+16/116,E=E>LAB_FT?E**(1/3):7.787*E+16/116;const T=116*_-16,S=500*(u-_),P=200*(_-E);return[T,S,P]};convert$1.lab.xyz=function(a){const u=a[0],_=a[1],E=a[2];let T,S,P;S=(u+16)/116,T=_/500+S,P=S-E/200;const O=S**3,B=T**3,V=P**3;return S=O>LAB_FT?O:(S-16/116)/7.787,T=B>LAB_FT?B:(T-16/116)/7.787,P=V>LAB_FT?V:(P-16/116)/7.787,T*=95.047,S*=100,P*=108.883,[T,S,P]};convert$1.lab.lch=function(a){const u=a[0],_=a[1],E=a[2];let T;T=Math.atan2(E,_)*360/2/Math.PI,T<0&&(T+=360);const P=Math.sqrt(_*_+E*E);return[u,P,T]};convert$1.lch.lab=function(a){const u=a[0],_=a[1],T=a[2]/360*2*Math.PI,S=_*Math.cos(T),P=_*Math.sin(T);return[u,S,P]};convert$1.rgb.ansi16=function(a,u=null){const[_,E,T]=a;let S=u===null?convert$1.rgb.hsv(a)[2]:u;if(S=Math.round(S/50),S===0)return 30;let P=30+(Math.round(T/255)<<2|Math.round(E/255)<<1|Math.round(_/255));return S===2&&(P+=60),P};convert$1.hsv.ansi16=function(a){return convert$1.rgb.ansi16(convert$1.hsv.rgb(a),a[2])};convert$1.rgb.ansi256=function(a){const u=a[0],_=a[1],E=a[2];return u>>4===_>>4&&_>>4===E>>4?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(_/255*5)+Math.round(E/255*5)};convert$1.ansi16.rgb=function(a){a=a[0];let u=a%10;if(u===0||u===7)return a>50&&(u+=3.5),u=u/10.5*255,[u,u,u];const _=(Math.trunc(a>50)+1)*.5,E=(u&1)*_*255,T=(u>>1&1)*_*255,S=(u>>2&1)*_*255;return[E,T,S]};convert$1.ansi256.rgb=function(a){if(a=a[0],a>=232){const S=(a-232)*10+8;return[S,S,S]}a-=16;let u;const _=Math.floor(a/36)/5*255,E=Math.floor((u=a%36)/6)/5*255,T=u%6/5*255;return[_,E,T]};convert$1.rgb.hex=function(a){const _=(((Math.round(a[0])&255)<<16)+((Math.round(a[1])&255)<<8)+(Math.round(a[2])&255)).toString(16).toUpperCase();return"000000".slice(_.length)+_};convert$1.hex.rgb=function(a){const u=a.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!u)return[0,0,0];let _=u[0];u[0].length===3&&(_=[..._].map(O=>O+O).join(""));const E=Number.parseInt(_,16),T=E>>16&255,S=E>>8&255,P=E&255;return[T,S,P]};convert$1.rgb.hcg=function(a){const u=a[0]/255,_=a[1]/255,E=a[2]/255,T=Math.max(Math.max(u,_),E),S=Math.min(Math.min(u,_),E),P=T-S;let O;const B=P<1?S/(1-P):0;return P<=0?O=0:T===u?O=(_-E)/P%6:T===_?O=2+(E-u)/P:O=4+(u-_)/P,O/=6,O%=1,[O*360,P*100,B*100]};convert$1.hsl.hcg=function(a){const u=a[1]/100,_=a[2]/100,E=_<.5?2*u*_:2*u*(1-_);let T=0;return E<1&&(T=(_-.5*E)/(1-E)),[a[0],E*100,T*100]};convert$1.hsv.hcg=function(a){const u=a[1]/100,_=a[2]/100,E=u*_;let T=0;return E<1&&(T=(_-E)/(1-E)),[a[0],E*100,T*100]};convert$1.hcg.rgb=function(a){const u=a[0]/360,_=a[1]/100,E=a[2]/100;if(_===0)return[E*255,E*255,E*255];const T=[0,0,0],S=u%1*6,P=S%1,O=1-P;let B=0;switch(Math.floor(S)){case 0:{T[0]=1,T[1]=P,T[2]=0;break}case 1:{T[0]=O,T[1]=1,T[2]=0;break}case 2:{T[0]=0,T[1]=1,T[2]=P;break}case 3:{T[0]=0,T[1]=O,T[2]=1;break}case 4:{T[0]=P,T[1]=0,T[2]=1;break}default:T[0]=1,T[1]=0,T[2]=O}return B=(1-_)*E,[(_*T[0]+B)*255,(_*T[1]+B)*255,(_*T[2]+B)*255]};convert$1.hcg.hsv=function(a){const u=a[1]/100,_=a[2]/100,E=u+_*(1-u);let T=0;return E>0&&(T=u/E),[a[0],T*100,E*100]};convert$1.hcg.hsl=function(a){const u=a[1]/100,E=a[2]/100*(1-u)+.5*u;let T=0;return E>0&&E<.5?T=u/(2*E):E>=.5&&E<1&&(T=u/(2*(1-E))),[a[0],T*100,E*100]};convert$1.hcg.hwb=function(a){const u=a[1]/100,_=a[2]/100,E=u+_*(1-u);return[a[0],(E-u)*100,(1-E)*100]};convert$1.hwb.hcg=function(a){const u=a[1]/100,E=1-a[2]/100,T=E-u;let S=0;return T<1&&(S=(E-T)/(1-T)),[a[0],T*100,S*100]};convert$1.apple.rgb=function(a){return[a[0]/65535*255,a[1]/65535*255,a[2]/65535*255]};convert$1.rgb.apple=function(a){return[a[0]/255*65535,a[1]/255*65535,a[2]/255*65535]};convert$1.gray.rgb=function(a){return[a[0]/100*255,a[0]/100*255,a[0]/100*255]};convert$1.gray.hsl=function(a){return[0,0,a[0]]};convert$1.gray.hsv=convert$1.gray.hsl;convert$1.gray.hwb=function(a){return[0,100,a[0]]};convert$1.gray.cmyk=function(a){return[0,0,0,a[0]]};convert$1.gray.lab=function(a){return[a[0],0,0]};convert$1.gray.hex=function(a){const u=Math.round(a[0]/100*255)&255,E=((u<<16)+(u<<8)+u).toString(16).toUpperCase();return"000000".slice(E.length)+E};convert$1.rgb.gray=function(a){return[(a[0]+a[1]+a[2])/3/255*100]};function buildGraph(){const a={},u=Object.keys(convert$1);for(let{length:_}=u,E=0;E<_;E++)a[u[E]]={distance:-1,parent:null};return a}function deriveBFS(a){const u=buildGraph(),_=[a];for(u[a].distance=0;_.length>0;){const E=_.pop(),T=Object.keys(convert$1[E]);for(let{length:S}=T,P=0;P<S;P++){const O=T[P],B=u[O];B.distance===-1&&(B.distance=u[E].distance+1,B.parent=E,_.unshift(O))}}return u}function link(a,u){return function(_){return u(a(_))}}function wrapConversion(a,u){const _=[u[a].parent,a];let E=convert$1[u[a].parent][a],T=u[a].parent;for(;u[T].parent;)_.unshift(u[T].parent),E=link(convert$1[u[T].parent][T],E),T=u[T].parent;return E.conversion=_,E}function route(a){const u=deriveBFS(a),_={},E=Object.keys(u);for(let{length:T}=E,S=0;S<T;S++){const P=E[S];u[P].parent!==null&&(_[P]=wrapConversion(P,u))}return _}const convert={},models=Object.keys(convert$1);function wrapRaw(a){const u=function(..._){const E=_[0];return E==null?E:(E.length>1&&(_=E),a(_))};return"conversion"in a&&(u.conversion=a.conversion),u}function wrapRounded(a){const u=function(..._){const E=_[0];if(E==null)return E;E.length>1&&(_=E);const T=a(_);if(typeof T=="object")for(let{length:S}=T,P=0;P<S;P++)T[P]=Math.round(T[P]);return T};return"conversion"in a&&(u.conversion=a.conversion),u}for(const a of models){convert[a]={},Object.defineProperty(convert[a],"channels",{value:convert$1[a].channels}),Object.defineProperty(convert[a],"labels",{value:convert$1[a].labels});const u=route(a),_=Object.keys(u);for(const E of _){const T=u[E];convert[a][E]=wrapRounded(T),convert[a][E].raw=wrapRaw(T)}}const name="@arcblock/did-connect",version$3="2.13.0",description="Client side library to work with DID Connect by ArcBlock.",keywords$1=["react","arcblock","component"],author="wangshijun<wangshijun2010@gmail.com>",homepage="https://github.com/ArcBlock/ux#readme",license="Apache-2.0",main="lib/index.js",module="lib/index.js",repository={type:"git",url:"git+https://github.com/ArcBlock/ux.git"},scripts={lint:"eslint src tests --ext js --ext jsx","lint:fix":"npm run lint -- --fix",build:"babel --config-file ./babel.config.es.js src --out-dir lib --copy-files --no-copy-ignored",autoexports:"node tools/auto-exports.js",watch:"babel --config-file ./babel.config.es.js src --out-dir lib -w --copy-files --no-copy-ignored",precommit:"CI=1 npm run lint",prepush:"CI=1 npm run lint",prepublish:"npm run build",test:"node tools/jest.js",coverage:"npm run test -- --coverage"},bugs={url:"https://github.com/ArcBlock/ux/issues"},dependencies={"@arcblock/bridge":"^2.13.0","@arcblock/did":"^1.20.0","@arcblock/icons":"^2.13.0","@arcblock/react-hooks":"^2.13.0","@arcblock/ws":"^1.20.0","@fontsource/lexend":"^5.1.1","@iconify-icons/logos":"^1.2.36","@iconify-icons/material-symbols":"^1.2.58","@iconify/react":"^5.2.0","@simplewebauthn/browser":"^13.0.0",ahooks:"^3.7.10",axios:"^1.7.5","base64-url":"^2.3.3",buffer:"^6.0.3","color-convert":"^3.0.1","core-js":"^3.25.5",eventemitter3:"^5.0.1",flat:"^5.0.2","js-cookie":"^2.2.1","jwt-decode":"^3.1.2",lodash:"^4.17.21","mdi-material-ui":"^7.5.0","p-queue":"^6.6.2","p-wait-for":"^5.0.2","path-to-regexp":"^1.8.0",semver:"^7.6.3",tweetnacl:"^1.0.3","tweetnacl-sealedbox-js":"^1.2.0",ufo:"^1.5.3"},peerDependencies={"@arcblock/ux":"^2.11.48","@blocklet/js-sdk":"^1.16.41","@emotion/react":"^11.10.4","@emotion/styled":"^11.10.4","@mui/material":"^5.15.0",react:"^18.2.0","react-dom":"^18.2.0"},publishConfig={access:"public"},devDependencies={"@babel/cli":"^7.19.3","@babel/core":"^7.19.3","@babel/preset-env":"^7.19.3","@babel/preset-react":"^7.18.6","eslint-plugin-react-hooks":"^4.6.0",glob:"^10.3.3",jest:"^29.7.0"},gitHead="6f5c451c75845608ebc3c559ef64c739238b65e1",pkg={name,version:version$3,description,keywords:keywords$1,author,homepage,license,main,module,repository,scripts,bugs,dependencies,peerDependencies,publishConfig,devDependencies,gitHead},DEFAULT_TIMEOUT$1=5*60,DEFAULT_WINDOW_TIMEOUT=30*60,BLOCKLET_SERVICE_PATH_PREFIX="/.well-known/service",SESSION_TOKEN_STORAGE_KEY="login_token",REFRESH_TOKEN_STORAGE_KEY="refresh_token",RELAY_SOCKET_PREFIX="/.well-known/service",API_DID_PREFIX="/api/did",DID_CONNECT_URL_PARAMS_NAME="__did-connect__",BUSY_STATUS=["scanned","succeed","error","busy"],EXT_DOWNLOAD_URL={chrome:"https://chromewebstore.google.com/detail/did-wallet/ibjflpbmadchofnbpppegdbnifdgincp",edge:"https://microsoftedge.microsoft.com/addons/detail/did-wallet/hjgoblidjnnnamdkinbichnfbmghmafd"},SMALL_WIDTH=420,MEDIUM_WIDTH=576,CHECK_STATUS_INTERVAL=2*1e3,VERIFY_CODE_LENGTH$1=6;class NotOpenError extends Error{constructor(){super("Failed to open popup")}}const providerName="wallet_url",getWebWalletUrl=()=>{var a,u;return window.localStorage.getItem(providerName)||((a=window.env)==null?void 0:a.webWalletUrl)||((u=window.blocklet)==null?void 0:u.webWalletUrl)||"https://web.abtwallet.io/"},checkSameProtocol=a=>{const{protocol:u}=window.location;let _="";try{_=new URL(a).protocol}catch{_=""}return u===_},{version:version$2}=pkg,debug$3=createDebug("did-connect"),logger$2=createLogger$1("did-connect");function unescape$1(a){return(a+"===".slice((a.length+3)%4)).replace(/-/g,"+").replace(/_/g,"/")}function escape$2(a){return a.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}const encodeConnectUrl=a=>escape$2(window.btoa(a)),decodeConnectUrl=a=>window.atob(unescape$1(a)),parseTokenFromConnectUrl=a=>{const u=new URL(a),_=decodeURIComponent(u.searchParams.get("url"));return new URL(_).searchParams.get("_t_")},getAppId$1=(a,u)=>{var E,T,S;let _=u==null?void 0:u.publisher;if(!_){if(a!=null&&a.agentDid)return a.agentDid;_=a==null?void 0:a.publisher}return _?_.replace("did:abt:",""):((E=globalThis.blocklet)==null?void 0:E.appPid)||((T=globalThis.blocklet)==null?void 0:T.appId)||((S=globalThis.env)==null?void 0:S.appId)||""},getConnectedInfo=a=>{var _;const u={connected_did:a.did||"",connected_pk:a.pk||"",connected_app:getAppId$1(a.appInfo,a.memberAppInfo)};return(_=a==null?void 0:a.connectedWallet)!=null&&_.os&&(u.connected_wallet_os=a.connectedWallet.os),u},updateConnectedInfo=(a,u=!1)=>{if(!a)return;u||(a=getConnectedInfo(a));const _=getCookieOptions({expireInDays:7,returnDomain:!1});!isNil(a.connected_did)&&!isNil(a.connected_pk)&&lib$3.isValid(a.connected_did)&&lib$3.isFromPublicKey(a.connected_did,a.connected_pk)&&(Cookies.set("connected_did",a.connected_did,_),Cookies.set("connected_pk",a.connected_pk,_)),!isNil(a.connected_app)&&lib$3.isValid(a.connected_app)&&Cookies.set("connected_app",a.connected_app,_),a.connected_wallet_os&&Cookies.set("connected_wallet_os",a.connected_wallet_os,_)},encodeKey=a=>escape$2(Buffer$1$1.from(a).toString("base64")),decodeKey=a=>Uint8Array.from(Buffer$1$1.from(unescape$1(a),"base64")),decrypt$1=(a,u,_)=>{const E=SealedBox.open(Uint8Array.from(Buffer$1$1.from(a,"base64")),decodeKey(u),decodeKey(_));return JSON.parse(Buffer$1$1.from(E).toString("utf8"))},encrypt=(a,u)=>Buffer$1$1.from(SealedBox.seal(Uint8Array.from(Buffer$1$1.from(a)),decodeKey(u))).toString("base64"),parseNextWorkflow=(a,u="_t_")=>{const _=new URL(a),E={baseUrl:_.origin,prefix:_.pathname.replace(/\/auth$/,""),token:_.searchParams.get(u)||""};if(!E.baseUrl)throw new Error("Invalid next workflow: origin empty");if(!E.token)throw new Error("Invalid next workflow: token not found");return E},getApiErrorMessage=(a,u)=>{var T,S;let _=a.message;const{response:E}=a;return E&&(_=((T=E.data)==null?void 0:T.error)||((S=E.data)==null?void 0:S.message)||E.data||u,_=typeof _=="object"?u:_),_},createAxios=(a={},{lazy:u=!1,lazyTime:_=300}={})=>createAxios$2({...a,headers:{...a.headers,"x-did-connect-version":version$2}},{lazy:u,lazyTime:_}),sleep=(a=0)=>new Promise(u=>{setTimeout(()=>{u()},a)});function getBrowserLang(){if(typeof window>"u")return null;const a=window.navigator.languages&&window.navigator.languages[0]||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage||window.navigator.systemLanguage||null;return{"zh-CN":"zh","zh-TW":"zh",zh:"zh",en:"en"}[a]||"en"}function formatCacheTtl(a,u){return[void 0,null,""].includes(a)?u:a/86400}async function decodeUrlParams(){const a=window.location.href;try{const u=new URL(a),_=u.searchParams.get(DID_CONNECT_URL_PARAMS_NAME);if(_){u.searchParams.delete(DID_CONNECT_URL_PARAMS_NAME);const E=JSON.parse(Buffer$1$1.from(_,"base64").toString("utf-8"));if(isString$1(E.forceConnected)&&isUndefined$1(E.sourceAppPid)){const S=await new BlockletSDK().user.getUserPublicInfo({did:E.forceConnected});isUndefined$1(S==null?void 0:S.sourceAppPid)||(E.sourceAppPid=S.sourceAppPid)}return{params:E,url:u.href}}}catch{console.warn("Failed to decode did-connect url params")}return{params:null,url:a}}const openPopup=(a,{width:u=680,height:_=720,name:E="did-connect:popup",offsetX:T=0,offsetY:S=0}={})=>{const P=getSafeUrl(a,{allowDomains:null}),O=window.screenX+(window.innerWidth-u)/2+T,B=window.screenY+(window.innerHeight-_)/2+S,V=[`left=${O}`,`top=${B}`,`width=${u}`,`height=${_}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],j=window.open("",E,V.join(","));if(j===null)throw new NotOpenError;return j.location.href=withQuery(P,{opener:window.location.origin}),j},runPopup=a=>new Promise((u,_)=>{let E,T;const S=({data:P})=>{if(P&&P.type==="authorization_response"){if(P!=null&&P.error){console.error(P.error);return}setTimeout(()=>{var O;(O=a.popup)==null||O.close(),clearTimeout(T),clearInterval(E),window.removeEventListener("message",S,!1),u(P)},a.closeTimeout||0)}};T=setTimeout(()=>{clearInterval(E),_(new Error("Timeout")),window.removeEventListener("message",S,!1)},(a.timeoutInSeconds||DEFAULT_WINDOW_TIMEOUT)*1e3),E=setInterval(()=>{var P;(P=a.popup)!=null&&P.closed&&(clearInterval(E),clearTimeout(T),window.removeEventListener("message",S,!1),_(new Error("Popup closed")))},1e3),window.addEventListener("message",S)});function hexToRgba(a,u=1){const[_,E,T]=convert.hex.rgb(a);return`rgba(${_}, ${E}, ${T}, ${u})`}function WindowFocusAware({callback:a}){const u=useDebounceFn(a),_=useMemoizedFn(()=>{document.hidden||u.run()});return reactExports.useEffect(()=>(window.addEventListener("focus",u.run),document.addEventListener("visibilitychange",_),()=>{window.removeEventListener("focus",u.run),document.removeEventListener("visibilitychange",_)}),[]),null}WindowFocusAware.propTypes={callback:PropTypes.func.isRequired};var No;const DID_SPACES_BASE_URL=((No=window==null?void 0:window.blocklet)==null?void 0:No.DID_SPACES_BASE_URL)||"https://www.didspaces.com/app",DID_SPACES_DID="z8iZnaYxnkMD5AKRjTKiCb8pQr1ut8UantAcf";class Space{constructor({token:u}){this.token=u,this.prefix=this.getPrefix()}async createForOAuthAccount(){const{data:u}=await axios.put(joinURL(this.prefix,"/api/space/createForOAuthAccount"),{},{headers:{Authorization:`Bearer ${this.token}`,"x-csrf-token":getCSRFToken()}});return u}async authorizeAppForOAuthAccount({extraParams:u}){await this.createForOAuthAccount();const{data:_}=await axios.put(joinURL(this.prefix,"/api/space/authorizeAppForOAuthAccount"),{app:{metadata:{},...u}},{headers:{Authorization:`Bearer ${this.token}`,"x-csrf-token":getCSRFToken()}});return _}getPrefix(){const u=window.blocklet.componentMountPoints.find(_=>_.did===DID_SPACES_DID);return u==null?void 0:u.mountPoint}}function CardSelector({list:a=[],width:u=300,height:_=400,cardSpace:E=40,onSelect:T=noop$6,defaultIndex:S=0}){const[P,O]=reactExports.useState(0),[B,V]=reactExports.useState(0),j=reactExports.useRef(null),U=J=>{if(!(J<0||J>a.length-1)){if(O(J),j.current){const ee=j.current.clientWidth;V(J*(u+E)-(ee-u)/2+E*.5)}T(J)}};reactExports.useEffect(()=>{var J;U(S),(J=j.current)==null||J.addEventListener("touchmove",ee=>ee.preventDefault(),{passive:!1})},[]);let W;const X=J=>{W=J.touches[0].clientX},Q=J=>{const ee=J.changedTouches[0],te=W-ee.clientX;Math.abs(te)>60&&(te>0?U(P+1):U(P-1))};return jsxRuntimeExports.jsx(Container$6,{ref:j,onTouchStart:X,onTouchEnd:Q,children:jsxRuntimeExports.jsx("div",{className:"card-container",style:{transform:`translate(${-B}px, 0)`},children:a.map((J,ee)=>J instanceof Function?jsxRuntimeExports.jsx("div",{className:`card-item ${ee===P?"selected":""}`,style:{width:u,height:_,margin:E/2},onClick:()=>U(ee),children:J(ee)},ee):jsxRuntimeExports.jsx("div",{className:`card-item ${ee===P?"selected":""}`,style:{width:u,height:_,margin:E/2},onClick:()=>U(ee),children:jsxRuntimeExports.jsx("img",{src:J.src,alt:J.name})},ee))})})}const Container$6=newStyled.div`
|
|
249
|
+
`+new Array(a.length+4).join(" "):T<u.length-2&&(E+=" ")}console.log(E)}function testSpeed(a,u,_){let E=new Date().getTime();const T=new Uint8Array(u);for(let P=0;P<u;P++)T[P]=P%256;const S=new Date().getTime();console.log("Generated random input in "+(S-E)+"ms"),E=S;for(let P=0;P<_;P++){const O=a(T),B=new Date().getTime(),V=B-E;E=B,console.log("Hashed in "+V+"ms: "+O.substring(0,20)+"..."),console.log(Math.round(u/(1<<20)/(V/1e3)*100)/100+" MB PER SECOND")}}var util$2={normalizeInput,toHex,debugPrint,testSpeed};const util$1=util$2;function ADD64AA(a,u,_){const E=a[u]+a[_];let T=a[u+1]+a[_+1];E>=4294967296&&T++,a[u]=E,a[u+1]=T}function ADD64AC(a,u,_,E){let T=a[u]+_;_<0&&(T+=4294967296);let S=a[u+1]+E;T>=4294967296&&S++,a[u]=T,a[u+1]=S}function B2B_GET32(a,u){return a[u]^a[u+1]<<8^a[u+2]<<16^a[u+3]<<24}function B2B_G(a,u,_,E,T,S){const P=m$1[T],O=m$1[T+1],B=m$1[S],V=m$1[S+1];ADD64AA(v$2,a,u),ADD64AC(v$2,a,P,O);let j=v$2[E]^v$2[a],U=v$2[E+1]^v$2[a+1];v$2[E]=U,v$2[E+1]=j,ADD64AA(v$2,_,E),j=v$2[u]^v$2[_],U=v$2[u+1]^v$2[_+1],v$2[u]=j>>>24^U<<8,v$2[u+1]=U>>>24^j<<8,ADD64AA(v$2,a,u),ADD64AC(v$2,a,B,V),j=v$2[E]^v$2[a],U=v$2[E+1]^v$2[a+1],v$2[E]=j>>>16^U<<16,v$2[E+1]=U>>>16^j<<16,ADD64AA(v$2,_,E),j=v$2[u]^v$2[_],U=v$2[u+1]^v$2[_+1],v$2[u]=U>>>31^j<<1,v$2[u+1]=j>>>31^U<<1}const BLAKE2B_IV32=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),SIGMA8=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],SIGMA82=new Uint8Array(SIGMA8.map(function(a){return a*2})),v$2=new Uint32Array(32),m$1=new Uint32Array(32);function blake2bCompress(a,u){let _=0;for(_=0;_<16;_++)v$2[_]=a.h[_],v$2[_+16]=BLAKE2B_IV32[_];for(v$2[24]=v$2[24]^a.t,v$2[25]=v$2[25]^a.t/4294967296,u&&(v$2[28]=~v$2[28],v$2[29]=~v$2[29]),_=0;_<32;_++)m$1[_]=B2B_GET32(a.b,4*_);for(_=0;_<12;_++)B2B_G(0,8,16,24,SIGMA82[_*16+0],SIGMA82[_*16+1]),B2B_G(2,10,18,26,SIGMA82[_*16+2],SIGMA82[_*16+3]),B2B_G(4,12,20,28,SIGMA82[_*16+4],SIGMA82[_*16+5]),B2B_G(6,14,22,30,SIGMA82[_*16+6],SIGMA82[_*16+7]),B2B_G(0,10,20,30,SIGMA82[_*16+8],SIGMA82[_*16+9]),B2B_G(2,12,22,24,SIGMA82[_*16+10],SIGMA82[_*16+11]),B2B_G(4,14,16,26,SIGMA82[_*16+12],SIGMA82[_*16+13]),B2B_G(6,8,18,28,SIGMA82[_*16+14],SIGMA82[_*16+15]);for(_=0;_<16;_++)a.h[_]=a.h[_]^v$2[_]^v$2[_+16]}const parameterBlock=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function blake2bInit(a,u,_,E){if(a===0||a>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(u&&u.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(_&&_.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(E&&E.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const T={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:a};parameterBlock.fill(0),parameterBlock[0]=a,u&&(parameterBlock[1]=u.length),parameterBlock[2]=1,parameterBlock[3]=1,_&¶meterBlock.set(_,32),E&¶meterBlock.set(E,48);for(let S=0;S<16;S++)T.h[S]=BLAKE2B_IV32[S]^B2B_GET32(parameterBlock,S*4);return u&&(blake2bUpdate(T,u),T.c=128),T}function blake2bUpdate(a,u){for(let _=0;_<u.length;_++)a.c===128&&(a.t+=a.c,blake2bCompress(a,!1),a.c=0),a.b[a.c++]=u[_]}function blake2bFinal(a){for(a.t+=a.c;a.c<128;)a.b[a.c++]=0;blake2bCompress(a,!0);const u=new Uint8Array(a.outlen);for(let _=0;_<a.outlen;_++)u[_]=a.h[_>>2]>>8*(_&3);return u}function blake2b(a,u,_,E,T){_=_||64,a=util$1.normalizeInput(a),E&&(E=util$1.normalizeInput(E)),T&&(T=util$1.normalizeInput(T));const S=blake2bInit(_,u,E,T);return blake2bUpdate(S,a),blake2bFinal(S)}function blake2bHex(a,u,_,E,T){const S=blake2b(a,u,_,E,T);return util$1.toHex(S)}var blake2b_1={blake2b,blake2bHex,blake2bInit,blake2bUpdate,blake2bFinal};const blake=getDefaultExportFromCjs(blake2b_1);function nonce(a,u){var _=blake.blake2bInit(tweetnacl.box.nonceLength,null);return blake.blake2bUpdate(_,a),blake.blake2bUpdate(_,u),blake.blake2bFinal(_)}function zero(a){for(var u=0;u<a.length;u++)a[u]=0}function seal(a,u){var _=new Uint8Array(overheadLength+a.length),E=tweetnacl.box.keyPair();_.set(E.publicKey);var T=nonce(E.publicKey,u),S=tweetnacl.box(a,T,u,E.secretKey);return _.set(S,E.publicKey.length),zero(E.secretKey),_}function open(a,u,_){var E=a.subarray(0,tweetnacl.box.publicKeyLength),T=nonce(E,u),S=a.subarray(tweetnacl.box.publicKeyLength);return tweetnacl.box.open(S,T,E,_)}const SealedBox={seal,open};class CustomError extends Error{}function getSafeUrl(a,{throwOnError:u=!0,returnRaw:_=!1,allowProtocols:E=["https:","http:"],allowDomains:T=void 0}={}){var S;T===void 0&&(T=((S=window.blocklet)==null?void 0:S.domainAliases)||[],T.push(window.location.href));try{let P;a.startsWith("/")?P=window.location.origin:a.startsWith("./")&&(P=window.location.href);const O=new URL(a,P),B=T&&T.map(V=>{try{return new URL(V).hostname}catch{return new URL(`https://${V}`).hostname}});if(E!==null&&!E.includes(O.protocol)){if(console.error(`Invalid protocol: ${O.protocol}`),u)throw new CustomError(`Invalid protocol: ${O.protocol}`);return null}if(B!==null&&!B.includes(O.hostname)){if(console.error(`Invalid host: ${O.hostname}`),u)throw new CustomError(`Invalid host: ${O.hostname}`);return null}return _?a:O.href}catch(P){if(P instanceof CustomError){if(u)throw P;return null}if(console.error(`Failed to convert url: ${a}`),u)throw new Error(`Failed to convert url: ${a}`);return null}}const createDebug=debug$4,createLogger$1=a=>new Proxy(window.console,{get(u,_){return(...E)=>{try{return["log","debug","info","warn","error"].includes(_)?u[_](a,...E):u[_]instanceof Function?u[_](...E):u[_]}catch(T){console.error(`Logger error in ${a}:`,T);return}}}}),cssKeywords={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},reverseKeywords={};for(const a of Object.keys(cssKeywords))reverseKeywords[cssKeywords[a]]=a;const convert$1={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},LAB_FT=(6/29)**3;for(const a of Object.keys(convert$1)){if(!("channels"in convert$1[a]))throw new Error("missing channels property: "+a);if(!("labels"in convert$1[a]))throw new Error("missing channel labels property: "+a);if(convert$1[a].labels.length!==convert$1[a].channels)throw new Error("channel and label counts mismatch: "+a);const{channels:u,labels:_}=convert$1[a];delete convert$1[a].channels,delete convert$1[a].labels,Object.defineProperty(convert$1[a],"channels",{value:u}),Object.defineProperty(convert$1[a],"labels",{value:_})}convert$1.rgb.hsl=function(a){const u=a[0]/255,_=a[1]/255,E=a[2]/255,T=Math.min(u,_,E),S=Math.max(u,_,E),P=S-T;let O,B;switch(S){case T:{O=0;break}case u:{O=(_-E)/P;break}case _:{O=2+(E-u)/P;break}case E:{O=4+(u-_)/P;break}}O=Math.min(O*60,360),O<0&&(O+=360);const V=(T+S)/2;return S===T?B=0:V<=.5?B=P/(S+T):B=P/(2-S-T),[O,B*100,V*100]};convert$1.rgb.hsv=function(a){let u,_,E,T,S;const P=a[0]/255,O=a[1]/255,B=a[2]/255,V=Math.max(P,O,B),j=V-Math.min(P,O,B),U=function(W){return(V-W)/6/j+1/2};if(j===0)T=0,S=0;else{switch(S=j/V,u=U(P),_=U(O),E=U(B),V){case P:{T=E-_;break}case O:{T=1/3+u-E;break}case B:{T=2/3+_-u;break}}T<0?T+=1:T>1&&(T-=1)}return[T*360,S*100,V*100]};convert$1.rgb.hwb=function(a){const u=a[0],_=a[1];let E=a[2];const T=convert$1.rgb.hsl(a)[0],S=1/255*Math.min(u,Math.min(_,E));return E=1-1/255*Math.max(u,Math.max(_,E)),[T,S*100,E*100]};convert$1.rgb.cmyk=function(a){const u=a[0]/255,_=a[1]/255,E=a[2]/255,T=Math.min(1-u,1-_,1-E),S=(1-u-T)/(1-T)||0,P=(1-_-T)/(1-T)||0,O=(1-E-T)/(1-T)||0;return[S*100,P*100,O*100,T*100]};function comparativeDistance(a,u){return(a[0]-u[0])**2+(a[1]-u[1])**2+(a[2]-u[2])**2}convert$1.rgb.keyword=function(a){const u=reverseKeywords[a];if(u)return u;let _=Number.POSITIVE_INFINITY,E;for(const T of Object.keys(cssKeywords)){const S=cssKeywords[T],P=comparativeDistance(a,S);P<_&&(_=P,E=T)}return E};convert$1.keyword.rgb=function(a){return cssKeywords[a]};convert$1.rgb.xyz=function(a){let u=a[0]/255,_=a[1]/255,E=a[2]/255;u=u>.04045?((u+.055)/1.055)**2.4:u/12.92,_=_>.04045?((_+.055)/1.055)**2.4:_/12.92,E=E>.04045?((E+.055)/1.055)**2.4:E/12.92;const T=u*.4124564+_*.3575761+E*.1804375,S=u*.2126729+_*.7151522+E*.072175,P=u*.0193339+_*.119192+E*.9503041;return[T*100,S*100,P*100]};convert$1.rgb.lab=function(a){const u=convert$1.rgb.xyz(a);let _=u[0],E=u[1],T=u[2];_/=95.047,E/=100,T/=108.883,_=_>LAB_FT?_**(1/3):7.787*_+16/116,E=E>LAB_FT?E**(1/3):7.787*E+16/116,T=T>LAB_FT?T**(1/3):7.787*T+16/116;const S=116*E-16,P=500*(_-E),O=200*(E-T);return[S,P,O]};convert$1.hsl.rgb=function(a){const u=a[0]/360,_=a[1]/100,E=a[2]/100;let T,S;if(_===0)return S=E*255,[S,S,S];const P=E<.5?E*(1+_):E+_-E*_,O=2*E-P,B=[0,0,0];for(let V=0;V<3;V++)T=u+1/3*-(V-1),T<0&&T++,T>1&&T--,6*T<1?S=O+(P-O)*6*T:2*T<1?S=P:3*T<2?S=O+(P-O)*(2/3-T)*6:S=O,B[V]=S*255;return B};convert$1.hsl.hsv=function(a){const u=a[0];let _=a[1]/100,E=a[2]/100,T=_;const S=Math.max(E,.01);E*=2,_*=E<=1?E:2-E,T*=S<=1?S:2-S;const P=(E+_)/2,O=E===0?2*T/(S+T):2*_/(E+_);return[u,O*100,P*100]};convert$1.hsv.rgb=function(a){const u=a[0]/60,_=a[1]/100;let E=a[2]/100;const T=Math.floor(u)%6,S=u-Math.floor(u),P=255*E*(1-_),O=255*E*(1-_*S),B=255*E*(1-_*(1-S));switch(E*=255,T){case 0:return[E,B,P];case 1:return[O,E,P];case 2:return[P,E,B];case 3:return[P,O,E];case 4:return[B,P,E];case 5:return[E,P,O]}};convert$1.hsv.hsl=function(a){const u=a[0],_=a[1]/100,E=a[2]/100,T=Math.max(E,.01);let S,P;P=(2-_)*E;const O=(2-_)*T;return S=_*T,S/=O<=1?O:2-O,S=S||0,P/=2,[u,S*100,P*100]};convert$1.hwb.rgb=function(a){const u=a[0]/360;let _=a[1]/100,E=a[2]/100;const T=_+E;let S;T>1&&(_/=T,E/=T);const P=Math.floor(6*u),O=1-E;S=6*u-P,P&1&&(S=1-S);const B=_+S*(O-_);let V,j,U;switch(P){default:case 6:case 0:{V=O,j=B,U=_;break}case 1:{V=B,j=O,U=_;break}case 2:{V=_,j=O,U=B;break}case 3:{V=_,j=B,U=O;break}case 4:{V=B,j=_,U=O;break}case 5:{V=O,j=_,U=B;break}}return[V*255,j*255,U*255]};convert$1.cmyk.rgb=function(a){const u=a[0]/100,_=a[1]/100,E=a[2]/100,T=a[3]/100,S=1-Math.min(1,u*(1-T)+T),P=1-Math.min(1,_*(1-T)+T),O=1-Math.min(1,E*(1-T)+T);return[S*255,P*255,O*255]};convert$1.xyz.rgb=function(a){const u=a[0]/100,_=a[1]/100,E=a[2]/100;let T,S,P;return T=u*3.2404542+_*-1.5371385+E*-.4985314,S=u*-.969266+_*1.8760108+E*.041556,P=u*.0556434+_*-.2040259+E*1.0572252,T=T>.0031308?1.055*T**(1/2.4)-.055:T*12.92,S=S>.0031308?1.055*S**(1/2.4)-.055:S*12.92,P=P>.0031308?1.055*P**(1/2.4)-.055:P*12.92,T=Math.min(Math.max(0,T),1),S=Math.min(Math.max(0,S),1),P=Math.min(Math.max(0,P),1),[T*255,S*255,P*255]};convert$1.xyz.lab=function(a){let u=a[0],_=a[1],E=a[2];u/=95.047,_/=100,E/=108.883,u=u>LAB_FT?u**(1/3):7.787*u+16/116,_=_>LAB_FT?_**(1/3):7.787*_+16/116,E=E>LAB_FT?E**(1/3):7.787*E+16/116;const T=116*_-16,S=500*(u-_),P=200*(_-E);return[T,S,P]};convert$1.lab.xyz=function(a){const u=a[0],_=a[1],E=a[2];let T,S,P;S=(u+16)/116,T=_/500+S,P=S-E/200;const O=S**3,B=T**3,V=P**3;return S=O>LAB_FT?O:(S-16/116)/7.787,T=B>LAB_FT?B:(T-16/116)/7.787,P=V>LAB_FT?V:(P-16/116)/7.787,T*=95.047,S*=100,P*=108.883,[T,S,P]};convert$1.lab.lch=function(a){const u=a[0],_=a[1],E=a[2];let T;T=Math.atan2(E,_)*360/2/Math.PI,T<0&&(T+=360);const P=Math.sqrt(_*_+E*E);return[u,P,T]};convert$1.lch.lab=function(a){const u=a[0],_=a[1],T=a[2]/360*2*Math.PI,S=_*Math.cos(T),P=_*Math.sin(T);return[u,S,P]};convert$1.rgb.ansi16=function(a,u=null){const[_,E,T]=a;let S=u===null?convert$1.rgb.hsv(a)[2]:u;if(S=Math.round(S/50),S===0)return 30;let P=30+(Math.round(T/255)<<2|Math.round(E/255)<<1|Math.round(_/255));return S===2&&(P+=60),P};convert$1.hsv.ansi16=function(a){return convert$1.rgb.ansi16(convert$1.hsv.rgb(a),a[2])};convert$1.rgb.ansi256=function(a){const u=a[0],_=a[1],E=a[2];return u>>4===_>>4&&_>>4===E>>4?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(_/255*5)+Math.round(E/255*5)};convert$1.ansi16.rgb=function(a){a=a[0];let u=a%10;if(u===0||u===7)return a>50&&(u+=3.5),u=u/10.5*255,[u,u,u];const _=(Math.trunc(a>50)+1)*.5,E=(u&1)*_*255,T=(u>>1&1)*_*255,S=(u>>2&1)*_*255;return[E,T,S]};convert$1.ansi256.rgb=function(a){if(a=a[0],a>=232){const S=(a-232)*10+8;return[S,S,S]}a-=16;let u;const _=Math.floor(a/36)/5*255,E=Math.floor((u=a%36)/6)/5*255,T=u%6/5*255;return[_,E,T]};convert$1.rgb.hex=function(a){const _=(((Math.round(a[0])&255)<<16)+((Math.round(a[1])&255)<<8)+(Math.round(a[2])&255)).toString(16).toUpperCase();return"000000".slice(_.length)+_};convert$1.hex.rgb=function(a){const u=a.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!u)return[0,0,0];let _=u[0];u[0].length===3&&(_=[..._].map(O=>O+O).join(""));const E=Number.parseInt(_,16),T=E>>16&255,S=E>>8&255,P=E&255;return[T,S,P]};convert$1.rgb.hcg=function(a){const u=a[0]/255,_=a[1]/255,E=a[2]/255,T=Math.max(Math.max(u,_),E),S=Math.min(Math.min(u,_),E),P=T-S;let O;const B=P<1?S/(1-P):0;return P<=0?O=0:T===u?O=(_-E)/P%6:T===_?O=2+(E-u)/P:O=4+(u-_)/P,O/=6,O%=1,[O*360,P*100,B*100]};convert$1.hsl.hcg=function(a){const u=a[1]/100,_=a[2]/100,E=_<.5?2*u*_:2*u*(1-_);let T=0;return E<1&&(T=(_-.5*E)/(1-E)),[a[0],E*100,T*100]};convert$1.hsv.hcg=function(a){const u=a[1]/100,_=a[2]/100,E=u*_;let T=0;return E<1&&(T=(_-E)/(1-E)),[a[0],E*100,T*100]};convert$1.hcg.rgb=function(a){const u=a[0]/360,_=a[1]/100,E=a[2]/100;if(_===0)return[E*255,E*255,E*255];const T=[0,0,0],S=u%1*6,P=S%1,O=1-P;let B=0;switch(Math.floor(S)){case 0:{T[0]=1,T[1]=P,T[2]=0;break}case 1:{T[0]=O,T[1]=1,T[2]=0;break}case 2:{T[0]=0,T[1]=1,T[2]=P;break}case 3:{T[0]=0,T[1]=O,T[2]=1;break}case 4:{T[0]=P,T[1]=0,T[2]=1;break}default:T[0]=1,T[1]=0,T[2]=O}return B=(1-_)*E,[(_*T[0]+B)*255,(_*T[1]+B)*255,(_*T[2]+B)*255]};convert$1.hcg.hsv=function(a){const u=a[1]/100,_=a[2]/100,E=u+_*(1-u);let T=0;return E>0&&(T=u/E),[a[0],T*100,E*100]};convert$1.hcg.hsl=function(a){const u=a[1]/100,E=a[2]/100*(1-u)+.5*u;let T=0;return E>0&&E<.5?T=u/(2*E):E>=.5&&E<1&&(T=u/(2*(1-E))),[a[0],T*100,E*100]};convert$1.hcg.hwb=function(a){const u=a[1]/100,_=a[2]/100,E=u+_*(1-u);return[a[0],(E-u)*100,(1-E)*100]};convert$1.hwb.hcg=function(a){const u=a[1]/100,E=1-a[2]/100,T=E-u;let S=0;return T<1&&(S=(E-T)/(1-T)),[a[0],T*100,S*100]};convert$1.apple.rgb=function(a){return[a[0]/65535*255,a[1]/65535*255,a[2]/65535*255]};convert$1.rgb.apple=function(a){return[a[0]/255*65535,a[1]/255*65535,a[2]/255*65535]};convert$1.gray.rgb=function(a){return[a[0]/100*255,a[0]/100*255,a[0]/100*255]};convert$1.gray.hsl=function(a){return[0,0,a[0]]};convert$1.gray.hsv=convert$1.gray.hsl;convert$1.gray.hwb=function(a){return[0,100,a[0]]};convert$1.gray.cmyk=function(a){return[0,0,0,a[0]]};convert$1.gray.lab=function(a){return[a[0],0,0]};convert$1.gray.hex=function(a){const u=Math.round(a[0]/100*255)&255,E=((u<<16)+(u<<8)+u).toString(16).toUpperCase();return"000000".slice(E.length)+E};convert$1.rgb.gray=function(a){return[(a[0]+a[1]+a[2])/3/255*100]};function buildGraph(){const a={},u=Object.keys(convert$1);for(let{length:_}=u,E=0;E<_;E++)a[u[E]]={distance:-1,parent:null};return a}function deriveBFS(a){const u=buildGraph(),_=[a];for(u[a].distance=0;_.length>0;){const E=_.pop(),T=Object.keys(convert$1[E]);for(let{length:S}=T,P=0;P<S;P++){const O=T[P],B=u[O];B.distance===-1&&(B.distance=u[E].distance+1,B.parent=E,_.unshift(O))}}return u}function link(a,u){return function(_){return u(a(_))}}function wrapConversion(a,u){const _=[u[a].parent,a];let E=convert$1[u[a].parent][a],T=u[a].parent;for(;u[T].parent;)_.unshift(u[T].parent),E=link(convert$1[u[T].parent][T],E),T=u[T].parent;return E.conversion=_,E}function route(a){const u=deriveBFS(a),_={},E=Object.keys(u);for(let{length:T}=E,S=0;S<T;S++){const P=E[S];u[P].parent!==null&&(_[P]=wrapConversion(P,u))}return _}const convert={},models=Object.keys(convert$1);function wrapRaw(a){const u=function(..._){const E=_[0];return E==null?E:(E.length>1&&(_=E),a(_))};return"conversion"in a&&(u.conversion=a.conversion),u}function wrapRounded(a){const u=function(..._){const E=_[0];if(E==null)return E;E.length>1&&(_=E);const T=a(_);if(typeof T=="object")for(let{length:S}=T,P=0;P<S;P++)T[P]=Math.round(T[P]);return T};return"conversion"in a&&(u.conversion=a.conversion),u}for(const a of models){convert[a]={},Object.defineProperty(convert[a],"channels",{value:convert$1[a].channels}),Object.defineProperty(convert[a],"labels",{value:convert$1[a].labels});const u=route(a),_=Object.keys(u);for(const E of _){const T=u[E];convert[a][E]=wrapRounded(T),convert[a][E].raw=wrapRaw(T)}}const name="@arcblock/did-connect",version$3="2.12.76",description="Client side library to work with DID Connect by ArcBlock.",keywords$1=["react","arcblock","component"],author="wangshijun<wangshijun2010@gmail.com>",homepage="https://github.com/ArcBlock/ux#readme",license="Apache-2.0",main="lib/index.js",module="lib/index.js",repository={type:"git",url:"git+https://github.com/ArcBlock/ux.git"},scripts={lint:"eslint src tests --ext js --ext jsx","lint:fix":"npm run lint -- --fix",build:"babel --config-file ./babel.config.es.js src --out-dir lib --copy-files --no-copy-ignored",autoexports:"node tools/auto-exports.js",watch:"babel --config-file ./babel.config.es.js src --out-dir lib -w --copy-files --no-copy-ignored",precommit:"CI=1 npm run lint",prepush:"CI=1 npm run lint",prepublish:"npm run build",test:"node tools/jest.js",coverage:"npm run test -- --coverage"},bugs={url:"https://github.com/ArcBlock/ux/issues"},dependencies={"@arcblock/bridge":"^2.12.76","@arcblock/did":"^1.19.20","@arcblock/icons":"^2.12.76","@arcblock/react-hooks":"^2.12.76","@arcblock/ws":"^1.19.20","@fontsource/lexend":"^5.1.1","@iconify-icons/logos":"^1.2.36","@iconify-icons/material-symbols":"^1.2.58","@iconify/react":"^5.2.0","@simplewebauthn/browser":"^13.0.0",ahooks:"^3.7.10",axios:"^1.7.5","base64-url":"^2.3.3",buffer:"^6.0.3","color-convert":"^3.0.1","core-js":"^3.25.5",eventemitter3:"^5.0.1",flat:"^5.0.2","js-cookie":"^2.2.1","jwt-decode":"^3.1.2",lodash:"^4.17.21","mdi-material-ui":"^7.5.0","p-queue":"^6.6.2","p-wait-for":"^5.0.2","path-to-regexp":"^1.8.0",semver:"^7.6.3",tweetnacl:"^1.0.3","tweetnacl-sealedbox-js":"^1.2.0",ufo:"^1.5.3"},peerDependencies={"@arcblock/ux":"^2.11.48","@blocklet/js-sdk":"^1.16.41","@emotion/react":"^11.10.4","@emotion/styled":"^11.10.4","@mui/material":"^5.15.0",react:"^18.2.0","react-dom":"^18.2.0"},publishConfig={access:"public"},devDependencies={"@babel/cli":"^7.19.3","@babel/core":"^7.19.3","@babel/preset-env":"^7.19.3","@babel/preset-react":"^7.18.6","eslint-plugin-react-hooks":"^4.6.0",glob:"^10.3.3",jest:"^29.7.0"},gitHead="15a960186fc10bdaa1c5b4f9d3693010f168d711",pkg={name,version:version$3,description,keywords:keywords$1,author,homepage,license,main,module,repository,scripts,bugs,dependencies,peerDependencies,publishConfig,devDependencies,gitHead},DEFAULT_TIMEOUT$1=5*60,DEFAULT_WINDOW_TIMEOUT=30*60,BLOCKLET_SERVICE_PATH_PREFIX="/.well-known/service",SESSION_TOKEN_STORAGE_KEY="login_token",REFRESH_TOKEN_STORAGE_KEY="refresh_token",RELAY_SOCKET_PREFIX="/.well-known/service",API_DID_PREFIX="/api/did",DID_CONNECT_URL_PARAMS_NAME="__did-connect__",BUSY_STATUS=["scanned","succeed","error","busy"],EXT_DOWNLOAD_URL={chrome:"https://chromewebstore.google.com/detail/did-wallet/ibjflpbmadchofnbpppegdbnifdgincp",edge:"https://microsoftedge.microsoft.com/addons/detail/did-wallet/hjgoblidjnnnamdkinbichnfbmghmafd"},SMALL_WIDTH=420,MEDIUM_WIDTH=576,CHECK_STATUS_INTERVAL=2*1e3,VERIFY_CODE_LENGTH$1=6;class NotOpenError extends Error{constructor(){super("Failed to open popup")}}const providerName="wallet_url",getWebWalletUrl=()=>{var a,u;return window.localStorage.getItem(providerName)||((a=window.env)==null?void 0:a.webWalletUrl)||((u=window.blocklet)==null?void 0:u.webWalletUrl)||"https://web.abtwallet.io/"},checkSameProtocol=a=>{const{protocol:u}=window.location;let _="";try{_=new URL(a).protocol}catch{_=""}return u===_},{version:version$2}=pkg,debug$3=createDebug("did-connect"),logger$2=createLogger$1("did-connect");function unescape$1(a){return(a+"===".slice((a.length+3)%4)).replace(/-/g,"+").replace(/_/g,"/")}function escape$2(a){return a.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}const encodeConnectUrl=a=>escape$2(window.btoa(a)),decodeConnectUrl=a=>window.atob(unescape$1(a)),parseTokenFromConnectUrl=a=>{const u=new URL(a),_=decodeURIComponent(u.searchParams.get("url"));return new URL(_).searchParams.get("_t_")},getAppId$1=(a,u)=>{var E,T,S;let _=u==null?void 0:u.publisher;if(!_){if(a!=null&&a.agentDid)return a.agentDid;_=a==null?void 0:a.publisher}return _?_.replace("did:abt:",""):((E=globalThis.blocklet)==null?void 0:E.appPid)||((T=globalThis.blocklet)==null?void 0:T.appId)||((S=globalThis.env)==null?void 0:S.appId)||""},getConnectedInfo=a=>{var _;const u={connected_did:a.did||"",connected_pk:a.pk||"",connected_app:getAppId$1(a.appInfo,a.memberAppInfo)};return(_=a==null?void 0:a.connectedWallet)!=null&&_.os&&(u.connected_wallet_os=a.connectedWallet.os),u},updateConnectedInfo=(a,u=!1)=>{if(!a)return;u||(a=getConnectedInfo(a));const _=getCookieOptions({expireInDays:7,returnDomain:!1});!isNil(a.connected_did)&&!isNil(a.connected_pk)&&lib$3.isValid(a.connected_did)&&lib$3.isFromPublicKey(a.connected_did,a.connected_pk)&&(Cookies.set("connected_did",a.connected_did,_),Cookies.set("connected_pk",a.connected_pk,_)),!isNil(a.connected_app)&&lib$3.isValid(a.connected_app)&&Cookies.set("connected_app",a.connected_app,_),a.connected_wallet_os&&Cookies.set("connected_wallet_os",a.connected_wallet_os,_)},encodeKey=a=>escape$2(Buffer$1$1.from(a).toString("base64")),decodeKey=a=>Uint8Array.from(Buffer$1$1.from(unescape$1(a),"base64")),decrypt$1=(a,u,_)=>{const E=SealedBox.open(Uint8Array.from(Buffer$1$1.from(a,"base64")),decodeKey(u),decodeKey(_));return JSON.parse(Buffer$1$1.from(E).toString("utf8"))},encrypt=(a,u)=>Buffer$1$1.from(SealedBox.seal(Uint8Array.from(Buffer$1$1.from(a)),decodeKey(u))).toString("base64"),parseNextWorkflow=(a,u="_t_")=>{const _=new URL(a),E={baseUrl:_.origin,prefix:_.pathname.replace(/\/auth$/,""),token:_.searchParams.get(u)||""};if(!E.baseUrl)throw new Error("Invalid next workflow: origin empty");if(!E.token)throw new Error("Invalid next workflow: token not found");return E},getApiErrorMessage=(a,u)=>{var T,S;let _=a.message;const{response:E}=a;return E&&(_=((T=E.data)==null?void 0:T.error)||((S=E.data)==null?void 0:S.message)||E.data||u,_=typeof _=="object"?u:_),_},createAxios=(a={},{lazy:u=!1,lazyTime:_=300}={})=>createAxios$2({...a,headers:{...a.headers,"x-did-connect-version":version$2}},{lazy:u,lazyTime:_}),sleep=(a=0)=>new Promise(u=>{setTimeout(()=>{u()},a)});function getBrowserLang(){if(typeof window>"u")return null;const a=window.navigator.languages&&window.navigator.languages[0]||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage||window.navigator.systemLanguage||null;return{"zh-CN":"zh","zh-TW":"zh",zh:"zh",en:"en"}[a]||"en"}function formatCacheTtl(a,u){return[void 0,null,""].includes(a)?u:a/86400}async function decodeUrlParams(){const a=window.location.href;try{const u=new URL(a),_=u.searchParams.get(DID_CONNECT_URL_PARAMS_NAME);if(_){u.searchParams.delete(DID_CONNECT_URL_PARAMS_NAME);const E=JSON.parse(Buffer$1$1.from(_,"base64").toString("utf-8"));if(isString$1(E.forceConnected)&&isUndefined$1(E.sourceAppPid)){const S=await new BlockletSDK().user.getUserPublicInfo({did:E.forceConnected});isUndefined$1(S==null?void 0:S.sourceAppPid)||(E.sourceAppPid=S.sourceAppPid)}return{params:E,url:u.href}}}catch{console.warn("Failed to decode did-connect url params")}return{params:null,url:a}}const openPopup=(a,{width:u=680,height:_=720,name:E="did-connect:popup",offsetX:T=0,offsetY:S=0}={})=>{const P=getSafeUrl(a,{allowDomains:null}),O=window.screenX+(window.innerWidth-u)/2+T,B=window.screenY+(window.innerHeight-_)/2+S,V=[`left=${O}`,`top=${B}`,`width=${u}`,`height=${_}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],j=window.open("",E,V.join(","));if(j===null)throw new NotOpenError;return j.location.href=withQuery(P,{opener:window.location.origin}),j},runPopup=a=>new Promise((u,_)=>{let E,T;const S=({data:P})=>{if(P&&P.type==="authorization_response"){if(P!=null&&P.error){console.error(P.error);return}setTimeout(()=>{var O;(O=a.popup)==null||O.close(),clearTimeout(T),clearInterval(E),window.removeEventListener("message",S,!1),u(P)},a.closeTimeout||0)}};T=setTimeout(()=>{clearInterval(E),_(new Error("Timeout")),window.removeEventListener("message",S,!1)},(a.timeoutInSeconds||DEFAULT_WINDOW_TIMEOUT)*1e3),E=setInterval(()=>{var P;(P=a.popup)!=null&&P.closed&&(clearInterval(E),clearTimeout(T),window.removeEventListener("message",S,!1),_(new Error("Popup closed")))},1e3),window.addEventListener("message",S)});function hexToRgba(a,u=1){const[_,E,T]=convert.hex.rgb(a);return`rgba(${_}, ${E}, ${T}, ${u})`}function WindowFocusAware({callback:a}){const u=useDebounceFn(a),_=useMemoizedFn(()=>{document.hidden||u.run()});return reactExports.useEffect(()=>(window.addEventListener("focus",u.run),document.addEventListener("visibilitychange",_),()=>{window.removeEventListener("focus",u.run),document.removeEventListener("visibilitychange",_)}),[]),null}WindowFocusAware.propTypes={callback:PropTypes.func.isRequired};var No;const DID_SPACES_BASE_URL=((No=window==null?void 0:window.blocklet)==null?void 0:No.DID_SPACES_BASE_URL)||"https://www.didspaces.com/app",DID_SPACES_DID="z8iZnaYxnkMD5AKRjTKiCb8pQr1ut8UantAcf";class Space{constructor({token:u}){this.token=u,this.prefix=this.getPrefix()}async createForOAuthAccount(){const{data:u}=await axios.put(joinURL(this.prefix,"/api/space/createForOAuthAccount"),{},{headers:{Authorization:`Bearer ${this.token}`,"x-csrf-token":getCSRFToken()}});return u}async authorizeAppForOAuthAccount({extraParams:u}){await this.createForOAuthAccount();const{data:_}=await axios.put(joinURL(this.prefix,"/api/space/authorizeAppForOAuthAccount"),{app:{metadata:{},...u}},{headers:{Authorization:`Bearer ${this.token}`,"x-csrf-token":getCSRFToken()}});return _}getPrefix(){const u=window.blocklet.componentMountPoints.find(_=>_.did===DID_SPACES_DID);return u==null?void 0:u.mountPoint}}function CardSelector({list:a=[],width:u=300,height:_=400,cardSpace:E=40,onSelect:T=noop$6,defaultIndex:S=0}){const[P,O]=reactExports.useState(0),[B,V]=reactExports.useState(0),j=reactExports.useRef(null),U=J=>{if(!(J<0||J>a.length-1)){if(O(J),j.current){const ee=j.current.clientWidth;V(J*(u+E)-(ee-u)/2+E*.5)}T(J)}};reactExports.useEffect(()=>{var J;U(S),(J=j.current)==null||J.addEventListener("touchmove",ee=>ee.preventDefault(),{passive:!1})},[]);let W;const X=J=>{W=J.touches[0].clientX},Q=J=>{const ee=J.changedTouches[0],te=W-ee.clientX;Math.abs(te)>60&&(te>0?U(P+1):U(P-1))};return jsxRuntimeExports.jsx(Container$6,{ref:j,onTouchStart:X,onTouchEnd:Q,children:jsxRuntimeExports.jsx("div",{className:"card-container",style:{transform:`translate(${-B}px, 0)`},children:a.map((J,ee)=>J instanceof Function?jsxRuntimeExports.jsx("div",{className:`card-item ${ee===P?"selected":""}`,style:{width:u,height:_,margin:E/2},onClick:()=>U(ee),children:J(ee)},ee):jsxRuntimeExports.jsx("div",{className:`card-item ${ee===P?"selected":""}`,style:{width:u,height:_,margin:E/2},onClick:()=>U(ee),children:jsxRuntimeExports.jsx("img",{src:J.src,alt:J.name})},ee))})})}const Container$6=newStyled.div`
|
|
250
250
|
overflow: hidden;
|
|
251
251
|
mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);
|
|
252
252
|
overflow: hidden;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aw as _,ao as i}from"./vendor-ux-did-connect-
|
|
1
|
+
import{aw as _,ao as i}from"./vendor-ux-did-connect-DOjsg91L.js";import{_ as e}from"./vendor-arcblock-ACo-BN0q.js";import{y as a}from"./index-BPa_QtWl.js";import{j as r}from"./vendor-mui-core-DxD1UA4o.js";const u={en:_(a),ar:()=>e(()=>import("./ar-CMzth4YC.js"),[]).then(t=>_(t.default)),de:()=>e(()=>import("./de-BkBUnf4o.js"),[]).then(t=>_(t.default)),es:()=>e(()=>import("./es-C47yMWlQ.js"),[]).then(t=>_(t.default)),fr:()=>e(()=>import("./fr-CXUB715N.js"),[]).then(t=>_(t.default)),hi:()=>e(()=>import("./hi-DCG5QxbH.js"),[]).then(t=>_(t.default)),id:()=>e(()=>import("./id-BjbrrkXh.js"),[]).then(t=>_(t.default)),ja:()=>e(()=>import("./ja-DmNZQIta.js"),[]).then(t=>_(t.default)),ko:()=>e(()=>import("./ko-CfYwMwZz.js"),[]).then(t=>_(t.default)),pt:()=>e(()=>import("./pt-DD_rP5GH.js"),[]).then(t=>_(t.default)),ru:()=>e(()=>import("./ru-CwgUUzV8.js"),[]).then(t=>_(t.default)),th:()=>e(()=>import("./th-KqE3tuDR.js"),[]).then(t=>_(t.default)),vi:()=>e(()=>import("./vi-BSkiIyr-.js"),[]).then(t=>_(t.default)),"zh-TW":()=>e(()=>import("./zh-tw-Dcs2VpLv.js"),[]).then(t=>_(t.default)),zh:()=>e(()=>import("./zh-BYP8UvRZ.js"),[]).then(t=>_(t.default))};function f(t){return function(o){return r.jsx(i,{translations:u,children:r.jsx(t,{...o})})}}export{f as w};
|
package/dist/index.html
CHANGED
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
background-color: transparent;
|
|
16
16
|
}
|
|
17
17
|
</style>
|
|
18
|
-
<script type="module" crossorigin src="/.well-known/service/static/assets/index-
|
|
18
|
+
<script type="module" crossorigin src="/.well-known/service/static/assets/index-BPa_QtWl.js"></script>
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/.well-known/service/static/assets/vendor-react-DoD83n6N.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/.well-known/service/static/assets/vendor-mui-core-DxD1UA4o.js">
|
|
21
21
|
<link rel="modulepreload" crossorigin href="/.well-known/service/static/assets/vendor-utils-CTIzdAFg.js">
|
|
22
22
|
<link rel="modulepreload" crossorigin href="/.well-known/service/static/assets/vendor-hooks-BwVH-TAd.js">
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/.well-known/service/static/assets/lottie-web-B6s7dDoL.js">
|
|
24
|
-
<link rel="modulepreload" crossorigin href="/.well-known/service/static/assets/vendor-ux-did-connect-
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/.well-known/service/static/assets/vendor-arcblock-
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/.well-known/service/static/assets/vendor-ux-did-connect-DOjsg91L.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/.well-known/service/static/assets/vendor-arcblock-ACo-BN0q.js">
|
|
26
26
|
<link rel="stylesheet" crossorigin href="/.well-known/service/static/assets/vendor-ux-did-connect-2GapMFC4.css">
|
|
27
27
|
<link rel="manifest" href="/.well-known/service/static/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/.well-known/service/static/registerSW.js"></script></head>
|
|
28
28
|
|