@abtnode/blocklet-services 1.16.42-beta-20250412-074212-ef879757 → 1.16.42-beta-20250412-084444-20b0cf19
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/{access-control-CkJaSWqQ.js → access-control-wqGz9JCo.js} +1 -1
- package/dist/assets/{add-component-core-CcE5hcL-.js → add-component-core-DqvSoT6a.js} +1 -1
- package/dist/assets/{add-resource-CWB03UX7.js → add-resource-DmN1IY_o.js} +1 -1
- package/dist/assets/{advanced-xfBXRmMb.js → advanced-CzJgEcda.js} +1 -1
- package/dist/assets/{appearance-CSHu4pbk.js → appearance-Bn0kYJHu.js} +1 -1
- package/dist/assets/{audit-logs-JU-7pKhW.js → audit-logs-DU66CSpw.js} +1 -1
- package/dist/assets/{branding-BWmZMyhk.js → branding-C5rNAfwW.js} +1 -1
- package/dist/assets/{branding-CcjXuXBu.js → branding-CiE421Dn.js} +2 -2
- package/dist/assets/{bundle-avatar-DW07bLBG.js → bundle-avatar-vSofRY4G.js} +1 -1
- package/dist/assets/{complete-DJafaAbP.js → complete-BeWyfTmK.js} +1 -1
- package/dist/assets/{component-Dixh8MiE.js → component-CZ948vh4.js} +1 -1
- package/dist/assets/{config-DnWRl-e4.js → config-CFbM7U_5.js} +1 -1
- package/dist/assets/{config-navigation-Dy2e3bWx.js → config-navigation-hrdLDyFZ.js} +3 -3
- package/dist/assets/{config-space-D9XSZ43O.js → config-space-Drp9NI7a.js} +1 -1
- package/dist/assets/{confirm-D36_98HC.js → confirm-B9OqaJpT.js} +1 -1
- package/dist/assets/connect-0zFqdTRm.js +5 -0
- package/dist/assets/{connect-DfFQY1g3.js → connect-CpUC5BAX.js} +1 -1
- package/dist/assets/{connect-to-nV6QlEXH.js → connect-to-BasQxweP.js} +1 -1
- package/dist/assets/{dashboard-BX25tvc1.js → dashboard-BYUKOMAe.js} +3 -3
- package/dist/assets/{delete-confirm-DXKGHbZ0.js → delete-confirm-CM4f-ajO.js} +1 -1
- package/dist/assets/domain-D0xqhxvZ.js +9 -0
- package/dist/assets/{domain-action-card-CE5RoGLV.js → domain-action-card-pHkmKFE3.js} +2 -2
- package/dist/assets/domains-BrNRyjCn.js +1 -0
- package/dist/assets/{email-Blo2BcBK.js → email-C5iUsSjP.js} +1 -1
- package/dist/assets/{exchange-passport-C2ib3_Sn.js → exchange-passport-CyGvLDal.js} +1 -1
- package/dist/assets/{fuel-Dy1g5bbZ.js → fuel-C5H_z1Ay.js} +1 -1
- package/dist/assets/{index-DF8FqhFx.js → index-B8FtPEFx.js} +1 -1
- package/dist/assets/{index-FiEfCjCd.js → index-Bee_YcJC.js} +1 -1
- package/dist/assets/{index-CwaFNZTA.js → index-BjYech25.js} +2 -2
- package/dist/assets/{index-rMaglH7e.js → index-C5lvlGzp.js} +3 -3
- package/dist/assets/{index-CAftUN2f.js → index-CVIeQOoE.js} +1 -1
- package/dist/assets/{index-CH6NslvK.js → index-CYAgDp3G.js} +1 -1
- package/dist/assets/{index-9fAsRy5T.js → index-CjmXl7jW.js} +1 -1
- package/dist/assets/{index-uyugLR5M.js → index-Cp_gD4ZQ.js} +1 -1
- package/dist/assets/{index-lIOjK585.js → index-Ctl8J5Z5.js} +1 -1
- package/dist/assets/{index-DW20Eg1X.js → index-D3YZfNxX.js} +1 -1
- package/dist/assets/{index-B0eRJvP0.js → index-DFoYVoMG.js} +1 -1
- package/dist/assets/{index-BFJrqJbJ.js → index-DUU3hQpo.js} +1 -1
- package/dist/assets/{index-BqFOxrIh.js → index-Dzvf3kMf.js} +4 -4
- package/dist/assets/{index-_bdib4_X.js → index-Kaq7tC6c.js} +1 -1
- package/dist/assets/{index-C_bxIWi7.js → index-d34Q6nXR.js} +1 -1
- package/dist/assets/{invitation-BhpO2wrv.js → invitation-C9hFp_wD.js} +1 -1
- package/dist/assets/{invite-Dho4ZotB.js → invite-CzfqL5Tx.js} +1 -1
- package/dist/assets/{issue-passport-ChG1IKWf.js → issue-passport-D3F63x7z.js} +1 -1
- package/dist/assets/{item-CuaUMkzc.js → item-C_TigVeC.js} +1 -1
- package/dist/assets/{layout-DMTV9CZD.js → layout-D5ALyxXA.js} +1 -1
- package/dist/assets/{list-BpDs72YC.js → list-DuzdV0Wa.js} +1 -1
- package/dist/assets/{log-BHx8x694.js → log-Dg8IZoeo.js} +1 -1
- package/dist/assets/{login-C8IgtQHG.js → login-B9XiO8eS.js} +1 -1
- package/dist/assets/{logo-uploader-COdhJAZk.js → logo-uploader-ChABQ_cS.js} +2 -2
- package/dist/assets/{lost-passport-D7rMK1P8.js → lost-passport-gGzRW--h.js} +1 -1
- package/dist/assets/{overview-d6gDgxnh.js → overview-ClfPLbRa.js} +1 -1
- package/dist/assets/{publish-resource-KUiHUSOS.js → publish-resource-C6TOyrHC.js} +1 -1
- package/dist/assets/{relative-time-B-K8BXmq.js → relative-time-CE47D6s7.js} +1 -1
- package/dist/assets/{runtime-BLeEmHaM.js → runtime-CdKbOwQM.js} +1 -1
- package/dist/assets/{security-4VIghIsi.js → security-DmjkCoJ_.js} +1 -1
- package/dist/assets/setup-DLCw2h80.js +19 -0
- package/dist/assets/{start-D0qy1O4h.js → start-CwSXw9Xs.js} +1 -1
- package/dist/assets/{status-B9rkBROD.js → status-CgfGREVl.js} +1 -1
- package/dist/assets/{step-actions-BxdcbLc6.js → step-actions-BNW8I1sI.js} +1 -1
- package/dist/assets/{traffic-Diahv-s-.js → traffic-ChJb5Oyl.js} +1 -1
- package/dist/assets/{transfer-DIxD0NHy.js → transfer-BHifjdxl.js} +1 -1
- package/dist/assets/{unsubscribe-C3uPy6Yj.js → unsubscribe-CcyOqX8E.js} +1 -1
- package/dist/assets/useAsync-BENTIUEf.js +1 -0
- package/dist/assets/{useAsyncRetry-W2lp7mi1.js → useAsyncRetry-DSYkC9r5.js} +2 -2
- package/dist/assets/{user-center-CcFqKY18.js → user-center-DfDG_giT.js} +1 -1
- package/dist/assets/{util-B_UMdXQ8.js → util-BmbbisPE.js} +1 -1
- package/dist/assets/{wrap-locale-D2zd2sgL.js → wrap-locale-5LSB6OAr.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +21 -22
- package/dist/assets/connect-XFyjVd39.js +0 -5
- package/dist/assets/domain-BwDvbkr6.js +0 -9
- package/dist/assets/domains-D7bzAvx0.js +0 -1
- package/dist/assets/setup-Bbl0UvNZ.js +0 -19
- package/dist/assets/useAsync-BxB2TpDl.js +0 -1
- package/dist/assets/useAsync-L7_fHBH5.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as ne,Y as U,bW as Ee,bX as Ue,o as le,h as K,bS as We,bT as Me,aa as _e,ab as $e,a9 as Ve,bY as Ne,b1 as Ce,p as he,r as Je,a$ as X,bZ as xe,ak as je,B as z,bI as He,a4 as Ke,b_ as Ge,a5 as Ze,a1 as Ye,_ as Xe,aq as De}from"./vendor-ux-did-connect-DEbq97Xz.js";import{u as p,a as se,f as te,c as Qe}from"./vendor-hooks-DN4nZ7TU.js";import{r as R}from"./vendor-react-DEoibe3W.js";import{j as e,a4 as m,br as W,bn as E,M as B,x as $,E as N,T as fe,I as ae,al as re,aa as Re,ae as H,cw as et,a2 as tt,e as be,a3 as ge,$ as Ae,a5 as nt}from"./vendor-mui-core-1jJmAutq.js";import{I as Y,a2 as st,b as qe,C as ot,n as Z,aE as at,y as rt,z as it}from"./vendor-utils-C3FZIS9A.js";import{a as oe,S as I,C,e as Fe}from"./dashboard-BX25tvc1.js";import{z as J,C as V}from"./index-CwaFNZTA.js";import{S as ie}from"./switch-control-DpvMHPLC.js";import{K as lt}from"./keyboard-arrow-down-rounded-DadBVmpO.js";import{z as Pe,G as ct,c as dt}from"./vendor-arcblock-V3HYELzG.js";import{I as ut}from"./index-Du2DtxVt.js";import{b as mt}from"./base32-CLGITfm-.js";import{u as pt}from"./use-mobile-DjnNmGRG.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-Cq9THoCr.js";import"./confirm-D36_98HC.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-DpcMtsY5.js";import"./get-safe-url-D_Puq_oh.js";import"./index-uyugLR5M.js";import"./session-0rF5SuCk.js";import"./useAsyncRetry-W2lp7mi1.js";import"./useAsync-BxB2TpDl.js";import"./InfoOutlined-CEHciuDy.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DpXDDjat.js";const ce={enabled:!1,domain:"",clientId:"",clientSecret:""};function ht(){var b,y,i;const{api:S}=J(),{blocklet:r}=V(),{t:n}=ne(),s=(b=r==null?void 0:r.meta)==null?void 0:b.did,w=Object.assign({...ce},((i=(y=r==null?void 0:r.settings)==null?void 0:y.oauth)==null?void 0:i.auth0)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(ce))}),d=h("enabled"),k=p(async a=>{var T,o;try{const{blocklet:j}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({auth0:a})}}),u=Object.assign({...ce},((o=(T=j==null?void 0:j.settings)==null?void 0:T.oauth)==null?void 0:o.auth0)||{});l(u),U.success(n("oauth.saveSuccess"))}catch(j){U.error(j.message||n("oauth.saveFailed"))}}),L=p(a=>a!=null&&a.trim()?!0:n("oauth.auth0.domainDescription")),x=p(a=>a!=null&&a.trim()?!0:n("oauth.auth0.clientIdDescription")),g=p(a=>a!=null&&a.trim()?!0:n("oauth.auth0.clientSecretDescription")),v=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(I,{title:n("oauth.auth0.enable"),mb:2.5,children:e.jsx(C,{name:"enabled",control:f,render:({field:a})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:a.value,...a})})})}),e.jsx(I,{title:n("oauth.auth0.domain"),children:e.jsx(C,{name:"domain",control:f,rules:{validate:d?L:v},render:({field:a})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...a,size:"small",label:n("oauth.auth0.domain"),error:!!c.errors[a.name],helperText:((T=c.errors[a.name])==null?void 0:T.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.auth0.clientId"),children:e.jsx(C,{name:"clientId",control:f,rules:{validate:d?x:v},render:({field:a})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...a,size:"small",label:n("oauth.auth0.clientId"),error:!!c.errors[a.name],helperText:((T=c.errors[a.name])==null?void 0:T.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.auth0.clientSecret"),children:e.jsx(C,{name:"clientSecret",control:f,rules:{validate:d?g:v},render:({field:a})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...a,size:"small",type:"password",label:n("oauth.auth0.clientSecret"),error:!!c.errors[a.name],helperText:((T=c.errors[a.name])==null?void 0:T.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const de={enabled:!1,clientId:"",clientSecret:""};function xt(){var v,b,y;const{api:S}=J(),{blocklet:r}=V(),{t:n}=ne(),s=(v=r==null?void 0:r.meta)==null?void 0:v.did,w=Object.assign({...de},((y=(b=r==null?void 0:r.settings)==null?void 0:b.oauth)==null?void 0:y.github)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(de))}),d=h("enabled"),k=p(async i=>{var a,T;try{const{blocklet:o}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({github:i})}}),j=Object.assign({...de},((T=(a=o==null?void 0:o.settings)==null?void 0:a.oauth)==null?void 0:T.github)||{});l(j),U.success(n("oauth.saveSuccess"))}catch(o){U.error(o.message||n("oauth.saveFailed"))}}),L=p(i=>i!=null&&i.trim()?!0:n("oauth.github.clientIdDescription")),x=p(i=>i!=null&&i.trim()?!0:n("oauth.github.clientSecretDescription")),g=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(I,{title:n("oauth.github.enable"),mb:2.5,children:e.jsx(C,{name:"enabled",control:f,render:({field:i})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:i.value,...i})})})}),e.jsx(I,{title:n("oauth.github.clientId"),children:e.jsx(C,{name:"clientId",control:f,rules:{validate:d?L:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...i,size:"small",label:n("oauth.github.clientId"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.github.clientSecret"),children:e.jsx(C,{name:"clientSecret",control:f,rules:{validate:d?x:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...i,size:"small",type:"password",label:n("oauth.github.clientSecret"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const ue={enabled:!1,clientId:"",clientSecret:""};function ft(){var v,b,y;const{api:S}=J(),{blocklet:r}=V(),{t:n}=ne(),s=(v=r==null?void 0:r.meta)==null?void 0:v.did,w=Object.assign({...ue},((y=(b=r==null?void 0:r.settings)==null?void 0:b.oauth)==null?void 0:y.google)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(ue))}),d=h("enabled"),k=p(async i=>{var a,T;try{const{blocklet:o}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({google:i})}}),j=Object.assign({...ue},((T=(a=o==null?void 0:o.settings)==null?void 0:a.oauth)==null?void 0:T.google)||{});l(j),U.success(n("oauth.saveSuccess"))}catch(o){U.error(o.message||n("oauth.saveFailed"))}}),L=p(i=>i!=null&&i.trim()?!0:n("oauth.google.clientIdDescription")),x=p(i=>i!=null&&i.trim()?!0:n("oauth.google.clientSecretDescription")),g=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(I,{title:n("oauth.google.enable"),mb:2.5,children:e.jsx(C,{name:"enabled",control:f,render:({field:i})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:i.value,...i})})})}),e.jsx(I,{title:n("oauth.google.clientId"),children:e.jsx(C,{name:"clientId",control:f,rules:{validate:d?L:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...i,size:"small",label:n("oauth.google.clientId"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.google.clientSecret"),children:e.jsx(C,{name:"clientSecret",control:f,rules:{validate:d?x:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...i,size:"small",type:"password",label:n("oauth.google.clientSecret"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const me={enabled:!1,teamId:"",serviceId:"",keyId:"",authKey:"",bundleId:""};function gt(){var i,a,T;const{api:S}=J(),{blocklet:r}=V(),{t:n}=ne(),s=(i=r==null?void 0:r.meta)==null?void 0:i.did,w=Object.assign({...me},((T=(a=r==null?void 0:r.settings)==null?void 0:a.oauth)==null?void 0:T.apple)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(me))}),d=h("enabled"),k=p(async o=>{var j,u;try{const{blocklet:P}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({apple:o})}}),A=Object.assign({...me},((u=(j=P==null?void 0:P.settings)==null?void 0:j.oauth)==null?void 0:u.apple)||{});l(A),U.success(n("oauth.saveSuccess"))}catch(P){U.error(P.message||n("oauth.saveFailed"))}}),L=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.teamIdDescription")),x=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.serviceIdDescription")),g=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.keyIdDescription")),v=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.authKeyDescription")),b=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.bundleIdDescription")),y=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(I,{title:n("oauth.apple.enable"),mb:2.5,children:e.jsx(C,{name:"enabled",control:f,render:({field:o})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:o.value,...o})})})}),e.jsx(I,{title:n("oauth.apple.teamId"),children:e.jsx(C,{name:"teamId",control:f,rules:{validate:d?L:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",label:n("oauth.apple.teamId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.apple.bundleId"),children:e.jsx(C,{name:"bundleId",control:f,rules:{validate:d?b:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",label:n("oauth.apple.bundleId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.apple.serviceId"),children:e.jsx(C,{name:"serviceId",control:f,rules:{validate:d?x:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",label:n("oauth.apple.serviceId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.apple.keyId"),children:e.jsx(C,{name:"keyId",control:f,rules:{validate:d?g:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",label:n("oauth.apple.keyId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.apple.authKey"),children:e.jsx(C,{name:"authKey",control:f,rules:{validate:d?v:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",type:"password",label:n("oauth.apple.authKey"),multiline:!0,rows:4,error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const jt={width:24,height:24,body:'<path fill="currentColor" d="M9 20q-.825 0-1.413-.588T7 18q0-.825.588-1.413T9 16q.825 0 1.413.588T11 18q0 .825-.588 1.413T9 20Zm6 0q-.825 0-1.413-.588T13 18q0-.825.588-1.413T15 16q.825 0 1.413.588T17 18q0 .825-.588 1.413T15 20Zm-6-6q-.825 0-1.413-.588T7 12q0-.825.588-1.413T9 10q.825 0 1.413.588T11 12q0 .825-.588 1.413T9 14Zm6 0q-.825 0-1.413-.588T13 12q0-.825.588-1.413T15 10q.825 0 1.413.588T17 12q0 .825-.588 1.413T15 14ZM9 8q-.825 0-1.413-.588T7 6q0-.825.588-1.413T9 4q.825 0 1.413.588T11 6q0 .825-.588 1.413T9 8Zm6 0q-.825 0-1.413-.588T13 6q0-.825.588-1.413T15 4q.825 0 1.413.588T17 6q0 .825-.588 1.413T15 8Z"/>'};function ve({title:S,id:r,children:n,index:s,onMove:w,defaultExpand:t,onEnd:f}){const[c,h]=R.useState(t),l=R.useRef(null),d=R.useRef(null),[{handlerId:k},L]=Ee({accept:"dragItem",collect(y){return{handlerId:y.getHandlerId()}},hover(y,i){var _,Q;if(!l.current)return;const a=y.index,T=s;if(a===T)return;const o=(_=l.current)==null?void 0:_.getBoundingClientRect(),j=(Q=d.current)==null?void 0:Q.getBoundingClientRect(),u=(j.bottom-j.top)/2,A=i.getClientOffset().y-o.top;a<T&&A<u||a>T&&A>u||(w(a,T),y.index=T)}}),[{isDragging:x},g]=Ue({item:{index:s,type:"dragItem"},collect:y=>({isDragging:y.isDragging()}),end:f});g(d),L(l);const v=x?.5:1,b=p(y=>{y.preventDefault(),y.stopPropagation(),h(!c)});return e.jsxs(m,{ref:l,children:[e.jsxs(m,{sx:{cursor:"pointer","&:hover":{backgroundColor:le.backgroundsBgSubtileHover}},ref:d,"data-handler-id":k,children:[e.jsxs(m,{sx:{py:2,px:1,opacity:v,display:"flex",alignItems:"center",gap:.5},draggable:!1,onClick:b,children:[e.jsx(m,{sx:{pointerEvents:"auto",cursor:"grab","&:active":{cursor:"grabbing"},fontSize:0,color:le.textMuted,"&:hover":{color:le.textSubtitle}},children:e.jsx(K,{fontSize:20,icon:jt})}),e.jsx(fe,{sx:{flex:1},children:S}),e.jsx(ae,{size:"small",sx:{pointerEvents:"auto",transform:c?"":"rotate(180deg)",transition:"transform 0.3s ease"},children:e.jsx(K,{icon:lt,style:{transform:"scale(1.5)"}})})]}),e.jsx(re,{})]}),e.jsx(m,{sx:{pl:4,py:2.5,display:c?"block":"none"},children:n})]})}ve.propTypes={title:N.string.isRequired,id:N.string.isRequired,children:N.node.isRequired,index:N.number.isRequired,onMove:N.func.isRequired,onEnd:N.func.isRequired,defaultExpand:N.bool};ve.defaultProps={defaultExpand:!1};const bt=[{name:"github",title:"GitHub",icon:e.jsx(K,{icon:_e}),component:e.jsx(xt,{})},{name:"google",title:"Google",icon:e.jsx(K,{icon:$e}),component:e.jsx(ft,{})},{name:"apple",title:"Apple",icon:e.jsx(K,{icon:Ve}),component:e.jsx(gt,{})},{name:"auth0",title:"Auth0",icon:e.jsx(K,{icon:Ne}),component:e.jsx(ht,{})}],vt=["github","google","apple","auth0"];function yt(){var k,L;const{api:S}=J(),{blocklet:r}=V(),n=(k=r==null?void 0:r.meta)==null?void 0:k.did,s=((L=r==null?void 0:r.settings)==null?void 0:L.oauth)||{},w=Object.keys(s).sort((x,g)=>{var v,b,y;return((v=s[x])==null?void 0:v.order)!==void 0&&((b=s[g])==null?void 0:b.order)!==void 0?s[x].order-s[g].order:((y=s[x])==null?void 0:y.order)!==void 0?-1:1});for(const x of vt)w.includes(x)||w.push(x);const t=se(w.reduce((x,g,v)=>Object.assign(x,{[g]:v}),{})),f=te(()=>{const x=[...bt];return x.sort((g,v)=>t[g.name]-t[v.name]),x},[t.auth0,t.github,t.google]),c={};typeof window<"u"&&(c.context=window);const h=p(async x=>{const g={};Object.keys(x).forEach(v=>{g[v]={order:x[v]}}),await S.configOAuth({input:{did:n,oauth:JSON.stringify(g)}})}),l=p((x,g)=>{const v=f[x],b=f[g];t[v.name]=g,t[b.name]=x}),d=p(async()=>{await h(t)});return e.jsx(m,{sx:{".section-left":{width:"160px"}},children:e.jsx(We,{backend:Me,...c,children:f.map((x,g)=>e.jsx(ve,{index:g,id:x.name,title:x.title,icon:x.icon,onMove:l,onEnd:d,defaultExpand:x.enabled,children:x.component},x.name))})})}const G={ttl:he.SESSION_TTL,cacheTtl:he.SESSION_CACHE_TTL,email:{enabled:!1,requireVerified:!1,requireUnique:!1,trustOauthProviders:!1,trustedIssuers:[],enableDomainBlackList:!1,domainBlackList:[],enableDomainWhiteList:!1,domainWhiteList:[]},phone:{enabled:!1,requireVerified:!1,requireUnique:!1,regionBlackList:[],trustedIssuers:[]}};function M(S){return e.jsx(ct,{...S,sx:{transform:"scale(0.75)"}})}function pe(S,r=!1){const n=r?S.ttl*86400:S.ttl/86400;return{...S,ttl:n}}function St(){var o,j;const{api:S}=J(),{blocklet:r}=V(),n=(o=r==null?void 0:r.meta)==null?void 0:o.did,s=st({},G,((j=r==null?void 0:r.settings)==null?void 0:j.session)||{});qe(s.ttl)&&(s.ttl=G.ttl),qe(s.cacheTtl)&&(s.cacheTtl=G.cacheTtl),s.phone||(s.phone=G.phone),s.email||(s.email=G.email);const{handleSubmit:w,control:t,formState:f,reset:c,watch:h}=oe({defaultValues:Y(pe(s),["ttl","cacheTtl","email","phone"])}),{t:l}=ne(),d=h("email.enabled"),k=h("phone.enabled"),L=h("email.enableDomainBlackList"),x=h("email.enableDomainWhiteList"),{fields:g,append:v,remove:b}=Fe({control:t,name:"email.domainBlackList"}),{fields:y,append:i,remove:a}=Fe({control:t,name:"email.domainWhiteList"}),T=p(async u=>{var P;try{const{blocklet:A}=await S.updateAppSessionConfig({input:{did:n,config:ot(pe(u,!0),["phone"])}}),_=Object.assign({},G,Y(((P=A==null?void 0:A.settings)==null?void 0:P.session)||{},["ttl","cacheTtl","email","phone"]));c(pe(_)),U.success(l("common.configSuccess"))}catch(A){U.error(A.message)}});return e.jsx(wt,{onSubmit:w(T),children:e.jsxs(H,{direction:"column",gap:6,children:[e.jsxs(m,{children:[e.jsxs(m,{children:[e.jsx(fe,{variant:"h6",fontWeight:600,children:l("blocklet.config.session.profile")}),e.jsx(m,{component:re,my:3})]}),e.jsxs(H,{gap:2,children:[e.jsx(I,{title:l("blocklet.config.session.fullNameEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(M,{disabled:!0,checked:!0})})}),e.jsx(I,{title:l("blocklet.config.session.avatarEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(M,{disabled:!0,checked:!0})})}),e.jsx(I,{title:l("blocklet.config.session.emailEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.enabled",control:t,render:({field:u})=>e.jsx(M,{...u,checked:u.value})})})}),d&&e.jsxs(H,{direction:"column",ml:2,children:[e.jsx(I,{title:l("blocklet.config.session.emailRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.requireVerified",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(I,{title:l("blocklet.config.session.emailRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.requireUnique",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(I,{title:l("blocklet.config.session.emailTrustOauthProviders"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.trustOauthProviders",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(I,{title:l("blocklet.config.session.enableDomainBlackList"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.enableDomainBlackList",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),L&&e.jsxs(m,{children:[g.map((u,P)=>e.jsxs(H,{direction:"row",alignItems:"center",my:1,maxWidth:"720px",children:[e.jsx(C,{name:`email.domainBlackList.${P}`,control:t,render:A=>e.jsx(B,{...A.field,size:"small",fullWidth:!0})}),e.jsx(ae,{onClick:()=>b(P),children:e.jsx(Ce,{})})]},u.id)),e.jsx($,{startIcon:e.jsx(Pe,{}),onClick:()=>v(""),children:l("blocklet.config.session.addDomain")})]}),e.jsx(I,{title:l("blocklet.config.session.enableDomainWhiteList"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.enableDomainWhiteList",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),x&&e.jsxs(m,{children:[y.map((u,P)=>e.jsxs(H,{direction:"row",alignItems:"center",my:1,maxWidth:"720px",children:[e.jsx(C,{name:`email.domainWhiteList.${P}`,control:t,render:A=>e.jsx(B,{...A.field,size:"small",fullWidth:!0})}),e.jsx(ae,{onClick:()=>a(P),children:e.jsx(Ce,{})})]},u.id)),e.jsx($,{startIcon:e.jsx(Pe,{}),onClick:()=>i(""),children:l("blocklet.config.session.addDomain")})]})]}),e.jsxs(m,{sx:{display:"none"},children:[e.jsx(I,{title:l("blocklet.config.session.phoneEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"phone.enabled",control:t,disabled:!0,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),k&&e.jsxs(H,{direction:"column",ml:2,mt:1,children:[e.jsx(I,{title:l("blocklet.config.session.phoneRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"phone.requireVerified",control:t,render:({field:u})=>e.jsx(W,{control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(I,{title:l("blocklet.config.session.phoneRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"phone.requireUnique",control:t,render:({field:u})=>e.jsx(W,{control:e.jsx(M,{...u,checked:u.value})})})})})]})]})]})]}),e.jsxs(m,{children:[e.jsx(fe,{variant:"h6",fontWeight:600,children:l("blocklet.config.session.period")}),e.jsx(m,{component:re,my:3}),e.jsx(H,{direction:"column",spacing:2,children:e.jsx(C,{name:"ttl",control:t,rules:{min:1,max:30},render:({field:u})=>e.jsx(E,{fullWidth:!0,sx:{mb:2},children:e.jsx(I,{title:l("blocklet.config.session.ttl",{day:u.value}),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{maxWidth:500,ml:1},children:e.jsx(et,{...u,defaultValue:7,step:1,marks:[{value:1,label:l("blocklet.config.session.day",{day:1})},{value:7,label:l("blocklet.config.session.days",{day:7})},{value:14,label:l("blocklet.config.session.days",{day:14})},{value:21,label:l("blocklet.config.session.days",{day:21})},{value:30,label:l("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto"})})})})})})]}),e.jsx(m,{children:e.jsx($,{type:"submit",variant:"contained",disabled:!f.isDirty,children:l("oauth.save")})})]})})}const wt=Re.form`
|
|
1
|
+
import{u as ne,Y as U,bW as Ee,bX as Ue,o as le,h as K,bS as We,bT as Me,aa as _e,ab as $e,a9 as Ve,bY as Ne,b1 as Ce,p as he,r as Je,a$ as X,bZ as xe,ak as je,B as z,bI as He,a4 as Ke,b_ as Ge,a5 as Ze,a1 as Ye,_ as Xe,aq as De}from"./vendor-ux-did-connect-DEbq97Xz.js";import{u as p,a as se,f as te,c as Qe}from"./vendor-hooks-DN4nZ7TU.js";import{r as R}from"./vendor-react-DEoibe3W.js";import{j as e,a4 as m,br as W,bn as E,M as B,x as $,E as N,T as fe,I as ae,al as re,aa as Re,ae as H,cw as et,a2 as tt,e as be,a3 as ge,$ as Ae,a5 as nt}from"./vendor-mui-core-1jJmAutq.js";import{I as Y,a2 as st,b as qe,C as ot,n as Z,aE as at,y as rt,z as it}from"./vendor-utils-C3FZIS9A.js";import{a as oe,S as I,C,e as Fe}from"./dashboard-BYUKOMAe.js";import{z as J,C as V}from"./index-BjYech25.js";import{S as ie}from"./switch-control-DpvMHPLC.js";import{K as lt}from"./keyboard-arrow-down-rounded-DadBVmpO.js";import{z as Pe,G as ct,c as dt}from"./vendor-arcblock-V3HYELzG.js";import{I as ut}from"./index-Du2DtxVt.js";import{b as mt}from"./base32-CLGITfm-.js";import{u as pt}from"./use-mobile-DpXDDjat.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-Cq9THoCr.js";import"./confirm-B9OqaJpT.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-DpcMtsY5.js";import"./get-safe-url-D_Puq_oh.js";import"./index-Cp_gD4ZQ.js";import"./session-0rF5SuCk.js";import"./useAsyncRetry-DSYkC9r5.js";import"./useAsync-BENTIUEf.js";import"./InfoOutlined-CEHciuDy.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DjnNmGRG.js";const ce={enabled:!1,domain:"",clientId:"",clientSecret:""};function ht(){var b,y,i;const{api:S}=J(),{blocklet:r}=V(),{t:n}=ne(),s=(b=r==null?void 0:r.meta)==null?void 0:b.did,w=Object.assign({...ce},((i=(y=r==null?void 0:r.settings)==null?void 0:y.oauth)==null?void 0:i.auth0)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(ce))}),d=h("enabled"),k=p(async a=>{var T,o;try{const{blocklet:j}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({auth0:a})}}),u=Object.assign({...ce},((o=(T=j==null?void 0:j.settings)==null?void 0:T.oauth)==null?void 0:o.auth0)||{});l(u),U.success(n("oauth.saveSuccess"))}catch(j){U.error(j.message||n("oauth.saveFailed"))}}),L=p(a=>a!=null&&a.trim()?!0:n("oauth.auth0.domainDescription")),x=p(a=>a!=null&&a.trim()?!0:n("oauth.auth0.clientIdDescription")),g=p(a=>a!=null&&a.trim()?!0:n("oauth.auth0.clientSecretDescription")),v=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(I,{title:n("oauth.auth0.enable"),mb:2.5,children:e.jsx(C,{name:"enabled",control:f,render:({field:a})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:a.value,...a})})})}),e.jsx(I,{title:n("oauth.auth0.domain"),children:e.jsx(C,{name:"domain",control:f,rules:{validate:d?L:v},render:({field:a})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...a,size:"small",label:n("oauth.auth0.domain"),error:!!c.errors[a.name],helperText:((T=c.errors[a.name])==null?void 0:T.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.auth0.clientId"),children:e.jsx(C,{name:"clientId",control:f,rules:{validate:d?x:v},render:({field:a})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...a,size:"small",label:n("oauth.auth0.clientId"),error:!!c.errors[a.name],helperText:((T=c.errors[a.name])==null?void 0:T.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.auth0.clientSecret"),children:e.jsx(C,{name:"clientSecret",control:f,rules:{validate:d?g:v},render:({field:a})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...a,size:"small",type:"password",label:n("oauth.auth0.clientSecret"),error:!!c.errors[a.name],helperText:((T=c.errors[a.name])==null?void 0:T.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const de={enabled:!1,clientId:"",clientSecret:""};function xt(){var v,b,y;const{api:S}=J(),{blocklet:r}=V(),{t:n}=ne(),s=(v=r==null?void 0:r.meta)==null?void 0:v.did,w=Object.assign({...de},((y=(b=r==null?void 0:r.settings)==null?void 0:b.oauth)==null?void 0:y.github)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(de))}),d=h("enabled"),k=p(async i=>{var a,T;try{const{blocklet:o}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({github:i})}}),j=Object.assign({...de},((T=(a=o==null?void 0:o.settings)==null?void 0:a.oauth)==null?void 0:T.github)||{});l(j),U.success(n("oauth.saveSuccess"))}catch(o){U.error(o.message||n("oauth.saveFailed"))}}),L=p(i=>i!=null&&i.trim()?!0:n("oauth.github.clientIdDescription")),x=p(i=>i!=null&&i.trim()?!0:n("oauth.github.clientSecretDescription")),g=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(I,{title:n("oauth.github.enable"),mb:2.5,children:e.jsx(C,{name:"enabled",control:f,render:({field:i})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:i.value,...i})})})}),e.jsx(I,{title:n("oauth.github.clientId"),children:e.jsx(C,{name:"clientId",control:f,rules:{validate:d?L:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...i,size:"small",label:n("oauth.github.clientId"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.github.clientSecret"),children:e.jsx(C,{name:"clientSecret",control:f,rules:{validate:d?x:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...i,size:"small",type:"password",label:n("oauth.github.clientSecret"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const ue={enabled:!1,clientId:"",clientSecret:""};function ft(){var v,b,y;const{api:S}=J(),{blocklet:r}=V(),{t:n}=ne(),s=(v=r==null?void 0:r.meta)==null?void 0:v.did,w=Object.assign({...ue},((y=(b=r==null?void 0:r.settings)==null?void 0:b.oauth)==null?void 0:y.google)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(ue))}),d=h("enabled"),k=p(async i=>{var a,T;try{const{blocklet:o}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({google:i})}}),j=Object.assign({...ue},((T=(a=o==null?void 0:o.settings)==null?void 0:a.oauth)==null?void 0:T.google)||{});l(j),U.success(n("oauth.saveSuccess"))}catch(o){U.error(o.message||n("oauth.saveFailed"))}}),L=p(i=>i!=null&&i.trim()?!0:n("oauth.google.clientIdDescription")),x=p(i=>i!=null&&i.trim()?!0:n("oauth.google.clientSecretDescription")),g=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(I,{title:n("oauth.google.enable"),mb:2.5,children:e.jsx(C,{name:"enabled",control:f,render:({field:i})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:i.value,...i})})})}),e.jsx(I,{title:n("oauth.google.clientId"),children:e.jsx(C,{name:"clientId",control:f,rules:{validate:d?L:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...i,size:"small",label:n("oauth.google.clientId"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.google.clientSecret"),children:e.jsx(C,{name:"clientSecret",control:f,rules:{validate:d?x:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...i,size:"small",type:"password",label:n("oauth.google.clientSecret"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const me={enabled:!1,teamId:"",serviceId:"",keyId:"",authKey:"",bundleId:""};function gt(){var i,a,T;const{api:S}=J(),{blocklet:r}=V(),{t:n}=ne(),s=(i=r==null?void 0:r.meta)==null?void 0:i.did,w=Object.assign({...me},((T=(a=r==null?void 0:r.settings)==null?void 0:a.oauth)==null?void 0:T.apple)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(me))}),d=h("enabled"),k=p(async o=>{var j,u;try{const{blocklet:P}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({apple:o})}}),A=Object.assign({...me},((u=(j=P==null?void 0:P.settings)==null?void 0:j.oauth)==null?void 0:u.apple)||{});l(A),U.success(n("oauth.saveSuccess"))}catch(P){U.error(P.message||n("oauth.saveFailed"))}}),L=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.teamIdDescription")),x=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.serviceIdDescription")),g=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.keyIdDescription")),v=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.authKeyDescription")),b=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.bundleIdDescription")),y=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(I,{title:n("oauth.apple.enable"),mb:2.5,children:e.jsx(C,{name:"enabled",control:f,render:({field:o})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:o.value,...o})})})}),e.jsx(I,{title:n("oauth.apple.teamId"),children:e.jsx(C,{name:"teamId",control:f,rules:{validate:d?L:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",label:n("oauth.apple.teamId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.apple.bundleId"),children:e.jsx(C,{name:"bundleId",control:f,rules:{validate:d?b:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",label:n("oauth.apple.bundleId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.apple.serviceId"),children:e.jsx(C,{name:"serviceId",control:f,rules:{validate:d?x:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",label:n("oauth.apple.serviceId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.apple.keyId"),children:e.jsx(C,{name:"keyId",control:f,rules:{validate:d?g:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",label:n("oauth.apple.keyId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(I,{title:n("oauth.apple.authKey"),children:e.jsx(C,{name:"authKey",control:f,rules:{validate:d?v:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(B,{...o,size:"small",type:"password",label:n("oauth.apple.authKey"),multiline:!0,rows:4,error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const jt={width:24,height:24,body:'<path fill="currentColor" d="M9 20q-.825 0-1.413-.588T7 18q0-.825.588-1.413T9 16q.825 0 1.413.588T11 18q0 .825-.588 1.413T9 20Zm6 0q-.825 0-1.413-.588T13 18q0-.825.588-1.413T15 16q.825 0 1.413.588T17 18q0 .825-.588 1.413T15 20Zm-6-6q-.825 0-1.413-.588T7 12q0-.825.588-1.413T9 10q.825 0 1.413.588T11 12q0 .825-.588 1.413T9 14Zm6 0q-.825 0-1.413-.588T13 12q0-.825.588-1.413T15 10q.825 0 1.413.588T17 12q0 .825-.588 1.413T15 14ZM9 8q-.825 0-1.413-.588T7 6q0-.825.588-1.413T9 4q.825 0 1.413.588T11 6q0 .825-.588 1.413T9 8Zm6 0q-.825 0-1.413-.588T13 6q0-.825.588-1.413T15 4q.825 0 1.413.588T17 6q0 .825-.588 1.413T15 8Z"/>'};function ve({title:S,id:r,children:n,index:s,onMove:w,defaultExpand:t,onEnd:f}){const[c,h]=R.useState(t),l=R.useRef(null),d=R.useRef(null),[{handlerId:k},L]=Ee({accept:"dragItem",collect(y){return{handlerId:y.getHandlerId()}},hover(y,i){var _,Q;if(!l.current)return;const a=y.index,T=s;if(a===T)return;const o=(_=l.current)==null?void 0:_.getBoundingClientRect(),j=(Q=d.current)==null?void 0:Q.getBoundingClientRect(),u=(j.bottom-j.top)/2,A=i.getClientOffset().y-o.top;a<T&&A<u||a>T&&A>u||(w(a,T),y.index=T)}}),[{isDragging:x},g]=Ue({item:{index:s,type:"dragItem"},collect:y=>({isDragging:y.isDragging()}),end:f});g(d),L(l);const v=x?.5:1,b=p(y=>{y.preventDefault(),y.stopPropagation(),h(!c)});return e.jsxs(m,{ref:l,children:[e.jsxs(m,{sx:{cursor:"pointer","&:hover":{backgroundColor:le.backgroundsBgSubtileHover}},ref:d,"data-handler-id":k,children:[e.jsxs(m,{sx:{py:2,px:1,opacity:v,display:"flex",alignItems:"center",gap:.5},draggable:!1,onClick:b,children:[e.jsx(m,{sx:{pointerEvents:"auto",cursor:"grab","&:active":{cursor:"grabbing"},fontSize:0,color:le.textMuted,"&:hover":{color:le.textSubtitle}},children:e.jsx(K,{fontSize:20,icon:jt})}),e.jsx(fe,{sx:{flex:1},children:S}),e.jsx(ae,{size:"small",sx:{pointerEvents:"auto",transform:c?"":"rotate(180deg)",transition:"transform 0.3s ease"},children:e.jsx(K,{icon:lt,style:{transform:"scale(1.5)"}})})]}),e.jsx(re,{})]}),e.jsx(m,{sx:{pl:4,py:2.5,display:c?"block":"none"},children:n})]})}ve.propTypes={title:N.string.isRequired,id:N.string.isRequired,children:N.node.isRequired,index:N.number.isRequired,onMove:N.func.isRequired,onEnd:N.func.isRequired,defaultExpand:N.bool};ve.defaultProps={defaultExpand:!1};const bt=[{name:"github",title:"GitHub",icon:e.jsx(K,{icon:_e}),component:e.jsx(xt,{})},{name:"google",title:"Google",icon:e.jsx(K,{icon:$e}),component:e.jsx(ft,{})},{name:"apple",title:"Apple",icon:e.jsx(K,{icon:Ve}),component:e.jsx(gt,{})},{name:"auth0",title:"Auth0",icon:e.jsx(K,{icon:Ne}),component:e.jsx(ht,{})}],vt=["github","google","apple","auth0"];function yt(){var k,L;const{api:S}=J(),{blocklet:r}=V(),n=(k=r==null?void 0:r.meta)==null?void 0:k.did,s=((L=r==null?void 0:r.settings)==null?void 0:L.oauth)||{},w=Object.keys(s).sort((x,g)=>{var v,b,y;return((v=s[x])==null?void 0:v.order)!==void 0&&((b=s[g])==null?void 0:b.order)!==void 0?s[x].order-s[g].order:((y=s[x])==null?void 0:y.order)!==void 0?-1:1});for(const x of vt)w.includes(x)||w.push(x);const t=se(w.reduce((x,g,v)=>Object.assign(x,{[g]:v}),{})),f=te(()=>{const x=[...bt];return x.sort((g,v)=>t[g.name]-t[v.name]),x},[t.auth0,t.github,t.google]),c={};typeof window<"u"&&(c.context=window);const h=p(async x=>{const g={};Object.keys(x).forEach(v=>{g[v]={order:x[v]}}),await S.configOAuth({input:{did:n,oauth:JSON.stringify(g)}})}),l=p((x,g)=>{const v=f[x],b=f[g];t[v.name]=g,t[b.name]=x}),d=p(async()=>{await h(t)});return e.jsx(m,{sx:{".section-left":{width:"160px"}},children:e.jsx(We,{backend:Me,...c,children:f.map((x,g)=>e.jsx(ve,{index:g,id:x.name,title:x.title,icon:x.icon,onMove:l,onEnd:d,defaultExpand:x.enabled,children:x.component},x.name))})})}const G={ttl:he.SESSION_TTL,cacheTtl:he.SESSION_CACHE_TTL,email:{enabled:!1,requireVerified:!1,requireUnique:!1,trustOauthProviders:!1,trustedIssuers:[],enableDomainBlackList:!1,domainBlackList:[],enableDomainWhiteList:!1,domainWhiteList:[]},phone:{enabled:!1,requireVerified:!1,requireUnique:!1,regionBlackList:[],trustedIssuers:[]}};function M(S){return e.jsx(ct,{...S,sx:{transform:"scale(0.75)"}})}function pe(S,r=!1){const n=r?S.ttl*86400:S.ttl/86400;return{...S,ttl:n}}function St(){var o,j;const{api:S}=J(),{blocklet:r}=V(),n=(o=r==null?void 0:r.meta)==null?void 0:o.did,s=st({},G,((j=r==null?void 0:r.settings)==null?void 0:j.session)||{});qe(s.ttl)&&(s.ttl=G.ttl),qe(s.cacheTtl)&&(s.cacheTtl=G.cacheTtl),s.phone||(s.phone=G.phone),s.email||(s.email=G.email);const{handleSubmit:w,control:t,formState:f,reset:c,watch:h}=oe({defaultValues:Y(pe(s),["ttl","cacheTtl","email","phone"])}),{t:l}=ne(),d=h("email.enabled"),k=h("phone.enabled"),L=h("email.enableDomainBlackList"),x=h("email.enableDomainWhiteList"),{fields:g,append:v,remove:b}=Fe({control:t,name:"email.domainBlackList"}),{fields:y,append:i,remove:a}=Fe({control:t,name:"email.domainWhiteList"}),T=p(async u=>{var P;try{const{blocklet:A}=await S.updateAppSessionConfig({input:{did:n,config:ot(pe(u,!0),["phone"])}}),_=Object.assign({},G,Y(((P=A==null?void 0:A.settings)==null?void 0:P.session)||{},["ttl","cacheTtl","email","phone"]));c(pe(_)),U.success(l("common.configSuccess"))}catch(A){U.error(A.message)}});return e.jsx(wt,{onSubmit:w(T),children:e.jsxs(H,{direction:"column",gap:6,children:[e.jsxs(m,{children:[e.jsxs(m,{children:[e.jsx(fe,{variant:"h6",fontWeight:600,children:l("blocklet.config.session.profile")}),e.jsx(m,{component:re,my:3})]}),e.jsxs(H,{gap:2,children:[e.jsx(I,{title:l("blocklet.config.session.fullNameEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(M,{disabled:!0,checked:!0})})}),e.jsx(I,{title:l("blocklet.config.session.avatarEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(M,{disabled:!0,checked:!0})})}),e.jsx(I,{title:l("blocklet.config.session.emailEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.enabled",control:t,render:({field:u})=>e.jsx(M,{...u,checked:u.value})})})}),d&&e.jsxs(H,{direction:"column",ml:2,children:[e.jsx(I,{title:l("blocklet.config.session.emailRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.requireVerified",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(I,{title:l("blocklet.config.session.emailRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.requireUnique",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(I,{title:l("blocklet.config.session.emailTrustOauthProviders"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.trustOauthProviders",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(I,{title:l("blocklet.config.session.enableDomainBlackList"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.enableDomainBlackList",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),L&&e.jsxs(m,{children:[g.map((u,P)=>e.jsxs(H,{direction:"row",alignItems:"center",my:1,maxWidth:"720px",children:[e.jsx(C,{name:`email.domainBlackList.${P}`,control:t,render:A=>e.jsx(B,{...A.field,size:"small",fullWidth:!0})}),e.jsx(ae,{onClick:()=>b(P),children:e.jsx(Ce,{})})]},u.id)),e.jsx($,{startIcon:e.jsx(Pe,{}),onClick:()=>v(""),children:l("blocklet.config.session.addDomain")})]}),e.jsx(I,{title:l("blocklet.config.session.enableDomainWhiteList"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"email.enableDomainWhiteList",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),x&&e.jsxs(m,{children:[y.map((u,P)=>e.jsxs(H,{direction:"row",alignItems:"center",my:1,maxWidth:"720px",children:[e.jsx(C,{name:`email.domainWhiteList.${P}`,control:t,render:A=>e.jsx(B,{...A.field,size:"small",fullWidth:!0})}),e.jsx(ae,{onClick:()=>a(P),children:e.jsx(Ce,{})})]},u.id)),e.jsx($,{startIcon:e.jsx(Pe,{}),onClick:()=>i(""),children:l("blocklet.config.session.addDomain")})]})]}),e.jsxs(m,{sx:{display:"none"},children:[e.jsx(I,{title:l("blocklet.config.session.phoneEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"phone.enabled",control:t,disabled:!0,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),k&&e.jsxs(H,{direction:"column",ml:2,mt:1,children:[e.jsx(I,{title:l("blocklet.config.session.phoneRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"phone.requireVerified",control:t,render:({field:u})=>e.jsx(W,{control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(I,{title:l("blocklet.config.session.phoneRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(C,{name:"phone.requireUnique",control:t,render:({field:u})=>e.jsx(W,{control:e.jsx(M,{...u,checked:u.value})})})})})]})]})]})]}),e.jsxs(m,{children:[e.jsx(fe,{variant:"h6",fontWeight:600,children:l("blocklet.config.session.period")}),e.jsx(m,{component:re,my:3}),e.jsx(H,{direction:"column",spacing:2,children:e.jsx(C,{name:"ttl",control:t,rules:{min:1,max:30},render:({field:u})=>e.jsx(E,{fullWidth:!0,sx:{mb:2},children:e.jsx(I,{title:l("blocklet.config.session.ttl",{day:u.value}),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{maxWidth:500,ml:1},children:e.jsx(et,{...u,defaultValue:7,step:1,marks:[{value:1,label:l("blocklet.config.session.day",{day:1})},{value:7,label:l("blocklet.config.session.days",{day:7})},{value:14,label:l("blocklet.config.session.days",{day:14})},{value:21,label:l("blocklet.config.session.days",{day:21})},{value:30,label:l("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto"})})})})})})]}),e.jsx(m,{children:e.jsx($,{type:"submit",variant:"contained",disabled:!f.isDirty,children:l("oauth.save")})})]})})}const wt=Re.form`
|
|
2
2
|
max-width: 1536px;
|
|
3
3
|
|
|
4
4
|
.advanced-config {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{E as i,aa as f,j as s,bB as D,a4 as N,a3 as E}from"./vendor-mui-core-1jJmAutq.js";import{a as A,l as $,u as P,m as M}from"./vendor-hooks-DN4nZ7TU.js";import{N as q,R as F}from"./vendor-arcblock-V3HYELzG.js";import{r as m}from"./vendor-react-DEoibe3W.js";import{a$ as U,ak as H,u as j,aO as O,p as B,b0 as S,X as Y}from"./vendor-ux-did-connect-DEbq97Xz.js";import{t as W,v as X,w as L,x as z}from"./index-
|
|
1
|
+
import{E as i,aa as f,j as s,bB as D,a4 as N,a3 as E}from"./vendor-mui-core-1jJmAutq.js";import{a as A,l as $,u as P,m as M}from"./vendor-hooks-DN4nZ7TU.js";import{N as q,R as F}from"./vendor-arcblock-V3HYELzG.js";import{r as m}from"./vendor-react-DEoibe3W.js";import{a$ as U,ak as H,u as j,aO as O,p as B,b0 as S,X as Y}from"./vendor-ux-did-connect-DEbq97Xz.js";import{t as W,v as X,w as L,x as z}from"./index-BjYech25.js";import{y as V}from"./vendor-utils-C3FZIS9A.js";import{u as J}from"./use-passport-id-B-b-_oYF.js";import{u as K}from"./session-0rF5SuCk.js";import{b as G}from"./sdk-j4w1A_X4.js";import{d as Q}from"./CheckCircle-D7Ntmb2o.js";import{w as Z}from"./wrap-locale-5LSB6OAr.js";function b({invitation:e,createPassportSvg:a,passportColor:c}){const[p,n]=m.useState(!1),{t}=m.useContext(U),l=m.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),u=m.useMemo(()=>a({title:l,issuer:e.info.name,issuerDid:e.info.appDid,ownerName:"Your Name",ownerDid:e.info.appDid,preferredColor:e.info.passportColor||c,extra:e.passportExpireTime?{key:"Exp",value:W(e.passportExpireTime).format("YYYY-MM-DD HH:mm:ss")}:void 0}),[e,l]),x=m.useCallback(()=>{n(!0)},[]),r=m.useCallback(()=>{n(!1)},[]);return s.jsxs(s.Fragment,{children:[s.jsx(ee,{children:s.jsxs("div",{className:"invite-passport__card",onClick:x,children:[!!e.display&&s.jsx(q,{data:e.display,style:{width:"100%",height:"100%"}}),!e.display&&s.jsx("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:u}})]})}),s.jsx(H,{open:p,title:t("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:r,children:e.role.permissions&&e.role.permissions.length>0?s.jsx("ul",{style:{listStyle:"circle",padding:"0 20px"},children:e.role.permissions.map(o=>s.jsx("li",{style:{listStyle:"circle"},children:o.description},o.name))}):s.jsxs("div",{style:{color:"#999",textAlign:"center"},children:[s.jsx(D,{style:{width:"30px",height:"30px"}}),s.jsx("div",{children:t("invite.emptyPermission")})]})})]})}b.propTypes={invitation:i.object.isRequired,createPassportSvg:i.func.isRequired,passportColor:i.string};b.defaultProps={passportColor:"auto"};const ee=f.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
max-width: 350px;
|
|
4
4
|
margin: 30px auto;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i,a4 as g}from"./vendor-mui-core-1jJmAutq.js";import{f as x,r as u}from"./vendor-react-DEoibe3W.js";import{u as v}from"./vendor-hooks-DN4nZ7TU.js";import{I as w}from"./invitation-
|
|
1
|
+
import{j as i,a4 as g}from"./vendor-mui-core-1jJmAutq.js";import{f as x,r as u}from"./vendor-react-DEoibe3W.js";import{u as v}from"./vendor-hooks-DN4nZ7TU.js";import{I as w}from"./invitation-C9hFp_wD.js";import{L as I}from"./landing-page-B5nKEn_3.js";import{u as S,aQ as P,p as T}from"./vendor-ux-did-connect-DEbq97Xz.js";import{H as j}from"./vendor-arcblock-V3HYELzG.js";import{g as k}from"./get-safe-url-BOY9UAaI.js";import{u as E,d as L,c as R,s as W,a as C}from"./index-BjYech25.js";import"./vendor-utils-C3FZIS9A.js";import"./use-passport-id-B-b-_oYF.js";import"./session-0rF5SuCk.js";import"./sdk-j4w1A_X4.js";import"./CheckCircle-D7Ntmb2o.js";import"./wrap-locale-5LSB6OAr.js";import"./lottie-web-jYmAQWuC.js";function q(c){var r;const m=x(),{searchParams:s}=new URL(window.location.href),{api:p,session:d}=E(),{t:f}=S(),a=s.get("inviteId"),n=s.get("redirect"),h=u.useCallback(async()=>{const{data:t}=await L.get("invitation",{params:{inviteId:a}});return t},[a]),l=v(async(t,o=e=>e)=>{t&&(W(o(t.sessionToken)),C(o(t.refreshToken)),t.visitorId&&P(o(t.visitorId))),await d.refresh(),setTimeout(()=>{if(n){const e=decodeURIComponent(n);e.startsWith(T.WELLKNOWN_SERVICE_PATH_PREFIX)?m(e,{replace:!0}):window.location.href=k(e)}else window.location.href=window.env.pathPrefix||"/"},50)});return i.jsxs(I,{did:(r=window.blocklet)==null?void 0:r.appPid,children:[i.jsx(j,{children:i.jsx("title",{children:f("pageTitle.invite")})}),i.jsx(g,{sx:{width:"560px",maxWidth:"100%",height:"100%"},className:"page-invite",children:i.jsx(w,{...c,getDataFn:h,checkFn:p.get,createPassportSvg:t=>R({...t}),onLoginSuccess:l,inService:!0})})]})}export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,a3 as w,a4 as v}from"./vendor-mui-core-1jJmAutq.js";import{a as I,m as P,u as p}from"./vendor-hooks-DN4nZ7TU.js";import{I as T}from"./invitation-
|
|
1
|
+
import{j as e,a3 as w,a4 as v}from"./vendor-mui-core-1jJmAutq.js";import{a as I,m as P,u as p}from"./vendor-hooks-DN4nZ7TU.js";import{I as T}from"./invitation-C9hFp_wD.js";import{L as j}from"./landing-page-B5nKEn_3.js";import{u as k,aQ as R,p as S}from"./vendor-ux-did-connect-DEbq97Xz.js";import{H as L}from"./vendor-arcblock-V3HYELzG.js";import{g as E}from"./get-safe-url-BOY9UAaI.js";import{u as C,c as W,s as F,a as N}from"./index-BjYech25.js";import{f as H}from"./vendor-react-DEoibe3W.js";import"./vendor-utils-C3FZIS9A.js";import"./use-passport-id-B-b-_oYF.js";import"./session-0rF5SuCk.js";import"./sdk-j4w1A_X4.js";import"./CheckCircle-D7Ntmb2o.js";import"./wrap-locale-5LSB6OAr.js";import"./lottie-web-jYmAQWuC.js";function J(f){var m;const{searchParams:a}=new URL(window.location.href),{api:r,session:d}=C(),u=H(),{t:h}=k(),n=a.get("id"),c=a.get("redirect"),g=I({state:""}),s=P(async()=>{if(!n)return null;const{data:t}=await r.get("/api/invitation",{params:{inviteId:n,mode:"issue-passport"}});return t}),l=p(()=>{if(s.error)throw s.error;return s==null?void 0:s.data}),x=p(async(t,i=o=>o)=>{t&&(t.sessionToken&&F(i(t.sessionToken)),t.refreshToken&&N(i(t.refreshToken)),t.visitorId&&R(i(t.visitorId)),await d.refresh()),setTimeout(()=>{if(c){const o=decodeURIComponent(c);o.startsWith(S.WELLKNOWN_SERVICE_PATH_PREFIX)?u(o,{replace:!0}):window.location.href=E(o)}else window.location.href=window.env.pathPrefix||"/"},50)});return s.loading?e.jsx(w,{}):e.jsxs(j,{did:(m=window.blocklet)==null?void 0:m.appPid,children:[e.jsx(L,{children:e.jsx("title",{children:h("pageTitle.issuePassport")})}),e.jsx(v,{className:"page-invite",sx:{width:"560px",maxWidth:"100%",height:"100%"},children:e.jsx(T,{...f,action:"issue-passport",getDataFn:l,checkFn:r.get,createPassportSvg:W,onLoginSuccess:x,inService:!0,status:g.state})})]})}export{J as default};
|