@abtnode/webapp 1.16.28-beta-17c98819 → 1.16.28-beta-641c9f13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{Add-DdfKyAdP.js → Add-CazR0vZK.js} +1 -1
- package/dist/assets/{ArrowDropDown-qBw97pL-.js → ArrowDropDown-BUrSvBpJ.js} +1 -1
- package/dist/assets/{Autocomplete-BReAy6iG.js → Autocomplete-DtvRC-0f.js} +1 -1
- package/dist/assets/{Breadcrumbs-FWiDSZgQ.js → Breadcrumbs-D_LYBn3C.js} +1 -1
- package/dist/assets/{ButtonGroup-CbxNRMKE.js → ButtonGroup-DxRrpbFw.js} +1 -1
- package/dist/assets/{CheckCircle-dALAsbHQ.js → CheckCircle-DbpNufE5.js} +1 -1
- package/dist/assets/{ChevronLeft-Cf-5wtBt.js → ChevronLeft-Bqynugte.js} +1 -1
- package/dist/assets/{ChevronRight-BaQf9l-O.js → ChevronRight-C8sGT-T0.js} +1 -1
- package/dist/assets/{Close-BneTv7Xy.js → Close-uiQeu7_r.js} +1 -1
- package/dist/assets/{Delete-DXKhZTtc.js → Delete-DHiwhVmP.js} +1 -1
- package/dist/assets/{DeleteOutline-DkrRhsKv.js → DeleteOutline-CnmOxEUl.js} +1 -1
- package/dist/assets/{Done-89WeLZcz.js → Done-LyiBXZqg.js} +1 -1
- package/dist/assets/{Edit-CbzkqV44.js → Edit-BgU3t9-z.js} +1 -1
- package/dist/assets/{EditIcon-BSBLuyj1.js → EditIcon-CeWwrlQZ.js} +1 -1
- package/dist/assets/{FilterList-nvbrBFgI.js → FilterList-usqmRCGh.js} +1 -1
- package/dist/assets/{Google-ur2xY4JS.js → Google-BzTTYoLn.js} +1 -1
- package/dist/assets/{Https-OdxMf6s_.js → Https-B3r3YjjJ.js} +1 -1
- package/dist/assets/{InputAdornment-Bz3jTEed.js → InputAdornment-0DnARlEj.js} +1 -1
- package/dist/assets/{InputLabel-Bb9-Zb4y.js → InputLabel-Csh1ynXt.js} +1 -1
- package/dist/assets/{LastPage-b5Zg6Pue.js → LastPage-DnsJsUIR.js} +1 -1
- package/dist/assets/{Launch-D3J61EvG.js → Launch-BOea_wCy.js} +1 -1
- package/dist/assets/{Link-B0Z7PitM.js → Link-ByQdtjfh.js} +1 -1
- package/dist/assets/{LoadingButton-g3UG3r3Q.js → LoadingButton-Cj_wXKeI.js} +1 -1
- package/dist/assets/{LockIcon-BIvEaDW_.js → LockIcon-C082WeKw.js} +1 -1
- package/dist/assets/{Loop-CvEhoguC.js → Loop-m_399M1H.js} +1 -1
- package/dist/assets/{MoreVert--N-SWxBs.js → MoreVert-BzXa-i1R.js} +1 -1
- package/dist/assets/{Pagination-Cu8asTOi.js → Pagination-DSEqJST1.js} +1 -1
- package/dist/assets/{Public-Dm9eNERj.js → Public-0DIMrFya.js} +1 -1
- package/dist/assets/{SchemaReference.es-Rht2H7VZ.js → SchemaReference.es-ISuYhpDf.js} +1 -1
- package/dist/assets/{Search-DifTFgaN.js → Search-CQMDHt0w.js} +1 -1
- package/dist/assets/{Select-BazOq14-.js → Select-DXPyl9dO.js} +1 -1
- package/dist/assets/{Skeleton-DzFzNaqT.js → Skeleton-URH_1vdL.js} +1 -1
- package/dist/assets/{Slider-Bl9ZTB5-.js → Slider-Bs8PTrpt.js} +1 -1
- package/dist/assets/{Stepper-CPSfsr8I.js → Stepper-F9lgPB4i.js} +1 -1
- package/dist/assets/{TextField-CedO329E.js → TextField-B9TZBqQf.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-Ce7WBAl0.js → ToggleButtonGroup-B4DF013K.js} +1 -1
- package/dist/assets/{ViewList-DovmYLzP.js → ViewList-BsKNUMlP.js} +1 -1
- package/dist/assets/{actions-BeKlqO4e.js → actions-B9P9hAjw.js} +1 -1
- package/dist/assets/{actions-DnYxUqme.js → actions-Dunvsfuf.js} +1 -1
- package/dist/assets/{agreement-yWupKN3O.js → agreement-C1qfhTtQ.js} +1 -1
- package/dist/assets/api-BM9dJimB.js +1 -0
- package/dist/assets/app-avatar-DQiSEUVG.js +1 -0
- package/dist/assets/{ar-BKJrehco.js → ar-BV2QgAob.js} +1 -1
- package/dist/assets/{audit-logs-jhEVyJaR.js → audit-logs-C18DG_HF.js} +1 -1
- package/dist/assets/{brace-fold.es-CFridbwI.js → brace-fold.es-5N33ToDI.js} +1 -1
- package/dist/assets/bundle-avatar-6edO3WvW.js +1 -0
- package/dist/assets/{chart-CP8mBtBC.js → chart-DxusdyLS.js} +1 -1
- package/dist/assets/{click-to-copy-BXxUHt8e.js → click-to-copy-DdhnSrH5.js} +1 -1
- package/dist/assets/{closebrackets.es-_N2Hw_sF.js → closebrackets.es-iyZsaRgi.js} +1 -1
- package/dist/assets/{codemirror.es-B7W38ouq.js → codemirror.es-DeO7gDXr.js} +1 -1
- package/dist/assets/{comment.es-j4ympnEk.js → comment.es-CfO1lV_o.js} +1 -1
- package/dist/assets/{config-navigation-BwONACZe.js → config-navigation-CcJGg9PY.js} +2 -2
- package/dist/assets/{de-Byp7vRl4.js → de-D6Ok_WHi.js} +1 -1
- package/dist/assets/{delete-confirm-CHP8pMt1.js → delete-confirm-C4Bk8D3q.js} +1 -1
- package/dist/assets/{detail-D7XGmf6a.js → detail-ByJGw6CQ.js} +3 -3
- package/dist/assets/{dialog.es-BOmAJ2tY.js → dialog.es-CQHFFbgC.js} +1 -1
- package/dist/assets/{download-4eDwdyWv.js → download-DjWKDAKk.js} +1 -1
- package/dist/assets/{es-O_BI7nAs.js → es-DiLJksPa.js} +1 -1
- package/dist/assets/{foldgutter.es-CpEL5ZIC.js → foldgutter.es-D2ybLApJ.js} +1 -1
- package/dist/assets/{fr-DyVRrA5G.js → fr-CrYEbJK3.js} +1 -1
- package/dist/assets/getValidReactChildren-BhT8Dia7.js +1 -0
- package/dist/assets/{hi-BpaB7ujL.js → hi-D0zLUK6N.js} +1 -1
- package/dist/assets/{hint.es-BpaHJ1HV.js → hint.es-U_5yDQ-L.js} +1 -1
- package/dist/assets/{hint.es2-D5kC37e7.js → hint.es2-B5AxTcUD.js} +1 -1
- package/dist/assets/{id-D7fl0yX3.js → id-Cx-4j40c.js} +1 -1
- package/dist/assets/{iframe-D-cUXJPs.js → iframe-CN6X1zkC.js} +1 -1
- package/dist/assets/{index-DLz4Hi3Z.js → index-7hmZo5yz.js} +1 -1
- package/dist/assets/{index-DjsDiQcb.js → index-9FRtImOR.js} +1 -1
- package/dist/assets/index-BO1T0fz0.js +11 -0
- package/dist/assets/{index-BFf4j7Ww.js → index-BUQuICIV.js} +1 -1
- package/dist/assets/{index-B6TlGEJh.js → index-BXxemGex.js} +1 -1
- package/dist/assets/{index-5av-A8Se.js → index-BiYiUZU0.js} +10 -10
- package/dist/assets/{index-Bzz51kzM.js → index-Bj3d2EwJ.js} +4 -4
- package/dist/assets/{index-B6XDQWKd.js → index-Bpjx7556.js} +1 -1
- package/dist/assets/{index-BBSo4Kre.js → index-BsRcoDUD.js} +1 -1
- package/dist/assets/{index-BuyQWayQ.js → index-BysoAAKf.js} +3 -3
- package/dist/assets/{index-jkMpqxhG.js → index-C5VGS0or.js} +1 -1
- package/dist/assets/{index-DaLAdjV1.js → index-CBFgpWWt.js} +1 -1
- package/dist/assets/{index-BQiUEEfD.js → index-CBQDge9H.js} +1 -1
- package/dist/assets/{index-Dgz6y_sw.js → index-CBcjH65j.js} +1 -1
- package/dist/assets/{index-DrN8Ygwh.js → index-CDk9gqwO.js} +1 -1
- package/dist/assets/{index-Xp6JtBc6.js → index-CNEFxICJ.js} +1 -1
- package/dist/assets/{index-n8r9cN9d.js → index-CYqmm0Sa.js} +1 -1
- package/dist/assets/{index-CBX-R_fM.js → index-CaM460rw.js} +1 -1
- package/dist/assets/{index-DnYL7SmU.js → index-CiB-ceGd.js} +1 -1
- package/dist/assets/{index-DBtfr-g8.js → index-ClMriVhA.js} +1 -1
- package/dist/assets/{index-P39Qd5P6.js → index-CmUhV6b0.js} +1 -1
- package/dist/assets/{index-CfAX8o1m.js → index-Cqf3kTsw.js} +1 -1
- package/dist/assets/{index-BUk5N7af.js → index-CsJW-E3u.js} +7 -7
- package/dist/assets/{index-CulJYPiw.js → index-CtlJtm28.js} +1 -1
- package/dist/assets/{index-D-o-DXlo.js → index-CzxambID.js} +5 -5
- package/dist/assets/{index-i-porPUL.js → index-D3isMJCC.js} +11 -11
- package/dist/assets/{index-DWayuvwj.js → index-D6XxoBY_.js} +1 -1
- package/dist/assets/{index-zHybkvc3.js → index-DB54SdYK.js} +1 -1
- package/dist/assets/{index-CkzoIPXc.js → index-DHvVD3rl.js} +212 -208
- package/dist/assets/{index-CD-Lt__N.js → index-DINuwc4O.js} +3 -3
- package/dist/assets/{index-hQvDKtXn.js → index-DRwkxXBX.js} +1 -1
- package/dist/assets/{index-B5xa9VAq.js → index-DqHjW7tc.js} +1 -1
- package/dist/assets/{index-DSZjoNB8.js → index-DrZqlcHr.js} +1 -1
- package/dist/assets/{index-6y7fW5zM.js → index-Dw6syXvl.js} +2 -2
- package/dist/assets/{index-D1poLYtV.js → index-JuXoqefL.js} +1 -1
- package/dist/assets/{index-B0nGAy1U.js → index-KnfQ44ac.js} +1 -1
- package/dist/assets/{index-CaSOHyUU.js → index-LuGhm-KA.js} +1 -1
- package/dist/assets/{index-Djimj0Ja.js → index-UfVz51n9.js} +9 -9
- package/dist/assets/{index-BamwV6lX.js → index-Ur9l5Pkv.js} +1 -1
- package/dist/assets/{index-CptiWA5V.js → index-edI690Jp.js} +3 -3
- package/dist/assets/{index-UNdpHp7m.js → index-jYLpiIQq.js} +2 -2
- package/dist/assets/index-oWv9ehU5.js +302 -0
- package/dist/assets/{index-DH55mhhr.js → index-oxLMT1TZ.js} +1 -1
- package/dist/assets/{index.es-CLAf8rQ0.js → index.es-BaoJVcS0.js} +1 -1
- package/dist/assets/index.esm-D5EJdopB.js +1 -0
- package/dist/assets/{info-addon.es-Cfolj5ET.js → info-addon.es-BF8YxAo6.js} +1 -1
- package/dist/assets/{info.es-D3Yd6cKh.js → info.es-BG-sFq93.js} +1 -1
- package/dist/assets/{install-from-url-NnkVYELF.js → install-from-url-D_JUSXN1.js} +1 -1
- package/dist/assets/{invitation-BBnyeKGK.js → invitation-B9fShyCE.js} +5 -5
- package/dist/assets/is-path-prefix-equal-DTqcyXik.js +1 -0
- package/dist/assets/{isEqual-DQGyAi5I.js → isEqual-BT0_AVZN.js} +1 -1
- package/dist/assets/{item-wk2MJlrI.js → item-k8JU-j43.js} +31 -31
- package/dist/assets/{ja-xLR8soVq.js → ja-CtQcd1E5.js} +1 -1
- package/dist/assets/{javascript.es-CqW0BR4Z.js → javascript.es-BxU6I3W8.js} +1 -1
- package/dist/assets/{jump-to-line.es-C-Ofosy7.js → jump-to-line.es-BJmdmPwT.js} +1 -1
- package/dist/assets/{jump.es-EY-vdsrN.js → jump.es-DdndOalg.js} +1 -1
- package/dist/assets/{ko-CdC91nMA.js → ko-B-N9xtBl.js} +1 -1
- package/dist/assets/{line-BJiZY-Na.js → line-h_bDsdkk.js} +4 -4
- package/dist/assets/{lint.es-DCPumBx-.js → lint.es-S1IqD8Ty.js} +1 -1
- package/dist/assets/{lint.es2-D7ziml_k.js → lint.es2-Pg9vOGzA.js} +1 -1
- package/dist/assets/{lint.es3-CQ3RJFPm.js → lint.es3-S5rsbMt9.js} +1 -1
- package/dist/assets/{list-header-2M6faCjv.js → list-header-sMQeptfh.js} +1 -1
- package/dist/assets/{log-DOLydL84.js → log-cMe-yCc9.js} +1 -1
- package/dist/assets/{lottie-DR9cYUcR.js → lottie-oKugLW27.js} +1 -1
- package/dist/assets/{matchbrackets.es-DMbNa-Dz.js → matchbrackets.es-CedBfYiO.js} +1 -1
- package/dist/assets/{memory-XTtEtBxW.js → memory-DtZsgQku.js} +1 -1
- package/dist/assets/{mode.es-4hNpjLfH.js → mode.es-BCvVo63y.js} +1 -1
- package/dist/assets/{mode.es2-Pi_OeoUI.js → mode.es2-ahvvTvAM.js} +1 -1
- package/dist/assets/{mode.es3-DqEODLL1.js → mode.es3-Bhh5S718.js} +1 -1
- package/dist/assets/{onlineParser.es-LEndSaRN.js → onlineParser.es-D5Qe3rjM.js} +1 -1
- package/dist/assets/overview-C8aXpNrX.js +23 -0
- package/dist/assets/{pt-CrWN8vvS.js → pt-Bbu04bsN.js} +1 -1
- package/dist/assets/{react-DfJCVmkR.js → react-UY6g3dsd.js} +18 -23
- package/dist/assets/{redux-ELJtQoC2.js → redux-DYjmRPcE.js} +1 -1
- package/dist/assets/resource-dialog-C82ZhW4T.js +57 -0
- package/dist/assets/{ru-DYnq26fF.js → ru-B2kEUdnW.js} +1 -1
- package/dist/assets/{runtime-aFzgxTMx.js → runtime-D1eyE8B1.js} +1 -1
- package/dist/assets/{search.es-dkimuVIV.js → search.es-0GT84-M2.js} +1 -1
- package/dist/assets/{searchcursor.es-Cgy0Dkqz.js → searchcursor.es-CX66aj_i.js} +1 -1
- package/dist/assets/service-DOjp5s19.js +1 -0
- package/dist/assets/{show-hint.es-C9i0xJlO.js → show-hint.es-vCcUyQMQ.js} +1 -1
- package/dist/assets/{slicedToArray-Bc32ss_C.js → slicedToArray-I-ObepI-.js} +1 -1
- package/dist/assets/spaces-m3k1wtEz.js +1 -0
- package/dist/assets/{sublime.es-BcF48CMJ.js → sublime.es-wltndpKH.js} +1 -1
- package/dist/assets/{switch-control-BoZOKX0C.js → switch-control-DSzxDtfl.js} +1 -1
- package/dist/assets/{table-icons-B2dymBbK.js → table-icons-D70UZfU7.js} +1 -1
- package/dist/assets/{tag-Bd5v37NR.js → tag-BDr72C87.js} +1 -1
- package/dist/assets/{team-C-DXj-V_.js → team-Ch-Gj2hO.js} +1 -1
- package/dist/assets/{th-Bfmczss9.js → th-hxX0mxam.js} +1 -1
- package/dist/assets/{toUpper-14sgZgOq.js → toUpper-Bqm-4sXI.js} +1 -1
- package/dist/assets/{traffic-BZOD1k45.js → traffic-BS6Lfitp.js} +1 -1
- package/dist/assets/{url-evaluation-ClVD1OGC.js → url-evaluation-ceiaoY0M.js} +2 -2
- package/dist/assets/url-join-Bsj5KCM1.js +1 -0
- package/dist/assets/{use-blocklet-info-for-connect-did-spaces-BtXC5kfM.js → use-blocklet-info-for-connect-did-spaces-BQtm5420.js} +1 -1
- package/dist/assets/{useLocalStorage-BG3mT3Wr.js → useLocalStorage-BOaGasKr.js} +1 -1
- package/dist/assets/util-CMnoIJSr.js +1 -0
- package/dist/assets/{vi-Cyl8BHvR.js → vi-BvdHaGW6.js} +1 -1
- package/dist/assets/{wait-container-CnoPKjU3.js → wait-container-CtbhxRrL.js} +1 -1
- package/dist/assets/{withStyles-DCBbgotO.js → withStyles-CjmLVNUl.js} +1 -1
- package/dist/assets/wrap-locale-K8WYS2HB.js +1 -0
- package/dist/assets/{zh-Dttm4AuY.js → zh-D9mkCsIM.js} +2 -2
- package/dist/assets/{zh-tw-BSAV-ffK.js → zh-tw-D-Z5mIZW.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/InfoOutlined-BaBR5WTh.js +0 -1
- package/dist/assets/api-Cex76yJU.js +0 -1
- package/dist/assets/app-avatar-DmCjOAyS.js +0 -1
- package/dist/assets/bundle-avatar-DUPs0-m4.js +0 -1
- package/dist/assets/getValidReactChildren-qfgxz0Xv.js +0 -1
- package/dist/assets/index-KCymnL8f.js +0 -11
- package/dist/assets/index-MncUxq-k.js +0 -302
- package/dist/assets/index.esm-nYmTtYeB.js +0 -1
- package/dist/assets/overview-DG3ws5aa.js +0 -23
- package/dist/assets/resource-dialog-ZbHwdUpF.js +0 -57
- package/dist/assets/service-BvyV0xti.js +0 -1
- package/dist/assets/spaces-D6AOV9xA.js +0 -1
- package/dist/assets/util-9Xuj0MWG.js +0 -1
- package/dist/assets/wrap-locale-B30EgQCX.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ba as D}from"./index-CkzoIPXc.js";var fe=e=>e.type==="checkbox",ie=e=>e instanceof Date,O=e=>e==null;const et=e=>typeof e=="object";var R=e=>!O(e)&&!Array.isArray(e)&&et(e)&&!ie(e),tt=e=>R(e)&&e.target?fe(e.target)?e.target.checked:e.target.value:e,At=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,rt=(e,s)=>e.has(At(s)),xt=e=>{const s=e.constructor&&e.constructor.prototype;return R(s)&&s.hasOwnProperty("isPrototypeOf")},Re=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function p(e){let s;const t=Array.isArray(e);if(e instanceof Date)s=new Date(e);else if(e instanceof Set)s=new Set(e);else if(!(Re&&(e instanceof Blob||e instanceof FileList))&&(t||R(e)))if(s=t?[]:{},!t&&!xt(e))s=e;else for(const u in e)e.hasOwnProperty(u)&&(s[u]=p(e[u]));else return e;return s}var ce=e=>Array.isArray(e)?e.filter(Boolean):[],w=e=>e===void 0,f=(e,s,t)=>{if(!s||!R(e))return t;const u=ce(s.split(/[,[\].]+?/)).reduce((n,a)=>O(n)?n:n[a],e);return w(u)||u===e?w(e[s])?t:e[s]:u},W=e=>typeof e=="boolean";const _e={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},H={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},z={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},mt=D.createContext(null),Le=()=>D.useContext(mt);var st=(e,s,t,u=!0)=>{const n={defaultValues:s._defaultValues};for(const a in e)Object.defineProperty(n,a,{get:()=>{const y=a;return s._proxyFormState[y]!==H.all&&(s._proxyFormState[y]=!u||H.all),t&&(t[y]=!0),e[y]}});return n},B=e=>R(e)&&!Object.keys(e).length,it=(e,s,t,u)=>{t(e);const{name:n,...a}=e;return B(a)||Object.keys(a).length>=Object.keys(s).length||Object.keys(a).find(y=>s[y]===(!u||H.all))},he=e=>Array.isArray(e)?e:[e],ut=(e,s,t)=>!e||!s||e===s||he(e).some(u=>u&&(t?u===s:u.startsWith(s)||s.startsWith(u)));function Te(e){const s=D.useRef(e);s.current=e,D.useEffect(()=>{const t=!e.disabled&&s.current.subject&&s.current.subject.subscribe({next:s.current.next});return()=>{t&&t.unsubscribe()}},[e.disabled])}function Dt(e){const s=Le(),{control:t=s.control,disabled:u,name:n,exact:a}=e||{},[y,h]=D.useState(t._formState),m=D.useRef(!0),S=D.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),_=D.useRef(n);return _.current=n,Te({disabled:u,next:v=>m.current&&ut(_.current,v.name,a)&&it(v,S.current,t._updateFormState)&&h({...t._formState,...v}),subject:t._subjects.state}),D.useEffect(()=>(m.current=!0,S.current.isValid&&t._updateValid(!0),()=>{m.current=!1}),[t]),st(y,t,S.current,!1)}var $=e=>typeof e=="string",lt=(e,s,t,u,n)=>$(e)?(u&&s.watch.add(e),f(t,e,n)):Array.isArray(e)?e.map(a=>(u&&s.watch.add(a),f(t,a))):(u&&(s.watchAll=!0),t);function wt(e){const s=Le(),{control:t=s.control,name:u,defaultValue:n,disabled:a,exact:y}=e||{},h=D.useRef(u);h.current=u,Te({disabled:a,subject:t._subjects.values,next:_=>{ut(h.current,_.name,y)&&S(p(lt(h.current,t._names,_.values||t._formValues,!1,n)))}});const[m,S]=D.useState(t._getWatch(u,n));return D.useEffect(()=>t._removeUnmounted()),m}var Ue=e=>/^\w*$/.test(e),at=e=>ce(e.replace(/["|']|\]/g,"").split(/\.|\[/)),x=(e,s,t)=>{let u=-1;const n=Ue(s)?[s]:at(s),a=n.length,y=a-1;for(;++u<a;){const h=n[u];let m=t;if(u!==y){const S=e[h];m=R(S)||Array.isArray(S)?S:isNaN(+n[u+1])?{}:[]}e[h]=m,e=e[h]}return e};function St(e){const s=Le(),{name:t,disabled:u,control:n=s.control,shouldUnregister:a}=e,y=rt(n._names.array,t),h=wt({control:n,name:t,defaultValue:f(n._formValues,t,f(n._defaultValues,t,e.defaultValue)),exact:!0}),m=Dt({control:n,name:t}),S=D.useRef(n.register(t,{...e.rules,value:h,...W(e.disabled)?{disabled:e.disabled}:{}}));return D.useEffect(()=>{const _=n._options.shouldUnregister||a,v=(N,j)=>{const T=f(n._fields,N);T&&(T._f.mount=j)};if(v(t,!0),_){const N=p(f(n._options.defaultValues,t));x(n._defaultValues,t,N),w(f(n._formValues,t))&&x(n._formValues,t,N)}return()=>{(y?_&&!n._state.action:_)?n.unregister(t):v(t,!1)}},[t,n,y,a]),D.useEffect(()=>{f(n._fields,t)&&n._updateDisabledField({disabled:u,fields:n._fields,name:t,value:f(n._fields,t)._f.value})},[u,t,n]),{field:{name:t,value:h,...W(u)||m.disabled?{disabled:m.disabled||u}:{},onChange:D.useCallback(_=>S.current.onChange({target:{value:tt(_),name:t},type:_e.CHANGE}),[t]),onBlur:D.useCallback(()=>S.current.onBlur({target:{value:f(n._formValues,t),name:t},type:_e.BLUR}),[t,n]),ref:_=>{const v=f(n._fields,t);v&&_&&(v._f.ref={focus:()=>_.focus(),select:()=>_.select(),setCustomValidity:N=>_.setCustomValidity(N),reportValidity:()=>_.reportValidity()})}},formState:m,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!f(m.errors,t)},isDirty:{enumerable:!0,get:()=>!!f(m.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!f(m.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!f(m.validatingFields,t)},error:{enumerable:!0,get:()=>f(m.errors,t)}})}}const Wt=e=>e.render(St(e));var kt=(e,s,t,u,n)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[u]:n||!0}}:{},Ke=e=>({isOnSubmit:!e||e===H.onSubmit,isOnBlur:e===H.onBlur,isOnChange:e===H.onChange,isOnAll:e===H.all,isOnTouch:e===H.onTouched}),Ge=(e,s,t)=>!t&&(s.watchAll||s.watch.has(e)||[...s.watch].some(u=>e.startsWith(u)&&/^\.\w+/.test(e.slice(u.length))));const oe=(e,s,t,u)=>{for(const n of t||Object.keys(e)){const a=f(e,n);if(a){const{_f:y,...h}=a;if(y){if(y.refs&&y.refs[0]&&s(y.refs[0],n)&&!u)break;if(y.ref&&s(y.ref,y.name)&&!u)break;oe(h,s)}else R(h)&&oe(h,s)}}};var Et=(e,s,t)=>{const u=ce(f(e,t));return x(u,"root",s[t]),x(e,t,u),e},Oe=e=>e.type==="file",X=e=>typeof e=="function",be=e=>{if(!Re)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},ve=e=>$(e),pe=e=>e.type==="radio",Ve=e=>e instanceof RegExp;const ze={value:!1,isValid:!1},Je={value:!0,isValid:!0};var nt=e=>{if(Array.isArray(e)){if(e.length>1){const s=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:s,isValid:!!s.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!w(e[0].attributes.value)?w(e[0].value)||e[0].value===""?Je:{value:e[0].value,isValid:!0}:Je:ze}return ze};const Qe={isValid:!1,value:null};var ot=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,Qe):Qe;function Xe(e,s,t="validate"){if(ve(e)||Array.isArray(e)&&e.every(ve)||W(e)&&!e)return{type:t,message:ve(e)?e:"",ref:s}}var se=e=>R(e)&&!Ve(e)?e:{value:e,message:""},Ye=async(e,s,t,u,n)=>{const{ref:a,refs:y,required:h,maxLength:m,minLength:S,min:_,max:v,pattern:N,validate:j,name:T,valueAsNumber:xe,mount:J,disabled:Q}=e._f,V=f(s,T);if(!J||Q)return{};const K=y?y[0]:a,G=b=>{u&&K.reportValidity&&(K.setCustomValidity(W(b)?"":b||""),K.reportValidity())},k={},ee=pe(a),de=fe(a),Y=ee||de,te=(xe||Oe(a))&&w(a.value)&&w(V)||be(a)&&a.value===""||V===""||Array.isArray(V)&&!V.length,P=kt.bind(null,T,t,k),ye=(b,F,E,U=z.maxLength,q=z.minLength)=>{const I=b?F:E;k[T]={type:b?U:q,message:I,ref:a,...P(b?U:q,I)}};if(n?!Array.isArray(V)||!V.length:h&&(!Y&&(te||O(V))||W(V)&&!V||de&&!nt(y).isValid||ee&&!ot(y).isValid)){const{value:b,message:F}=ve(h)?{value:!!h,message:h}:se(h);if(b&&(k[T]={type:z.required,message:F,ref:K,...P(z.required,F)},!t))return G(F),k}if(!te&&(!O(_)||!O(v))){let b,F;const E=se(v),U=se(_);if(!O(V)&&!isNaN(V)){const q=a.valueAsNumber||V&&+V;O(E.value)||(b=q>E.value),O(U.value)||(F=q<U.value)}else{const q=a.valueAsDate||new Date(V),I=ae=>new Date(new Date().toDateString()+" "+ae),ue=a.type=="time",le=a.type=="week";$(E.value)&&V&&(b=ue?I(V)>I(E.value):le?V>E.value:q>new Date(E.value)),$(U.value)&&V&&(F=ue?I(V)<I(U.value):le?V<U.value:q<new Date(U.value))}if((b||F)&&(ye(!!b,E.message,U.message,z.max,z.min),!t))return G(k[T].message),k}if((m||S)&&!te&&($(V)||n&&Array.isArray(V))){const b=se(m),F=se(S),E=!O(b.value)&&V.length>+b.value,U=!O(F.value)&&V.length<+F.value;if((E||U)&&(ye(E,b.message,F.message),!t))return G(k[T].message),k}if(N&&!te&&$(V)){const{value:b,message:F}=se(N);if(Ve(b)&&!V.match(b)&&(k[T]={type:z.pattern,message:F,ref:a,...P(z.pattern,F)},!t))return G(F),k}if(j){if(X(j)){const b=await j(V,s),F=Xe(b,K);if(F&&(k[T]={...F,...P(z.validate,F.message)},!t))return G(F.message),k}else if(R(j)){let b={};for(const F in j){if(!B(b)&&!t)break;const E=Xe(await j[F](V,s),K,F);E&&(b={...E,...P(F,E.message)},G(E.message),t&&(k[T]=b))}if(!B(b)&&(k[T]={ref:K,...b},!t))return k}}return G(!0),k};function Ct(e,s){const t=s.slice(0,-1).length;let u=0;for(;u<t;)e=w(e)?u++:e[s[u++]];return e}function Rt(e){for(const s in e)if(e.hasOwnProperty(s)&&!w(e[s]))return!1;return!0}function C(e,s){const t=Array.isArray(s)?s:Ue(s)?[s]:at(s),u=t.length===1?e:Ct(e,t),n=t.length-1,a=t[n];return u&&delete u[a],n!==0&&(R(u)&&B(u)||Array.isArray(u)&&Rt(u))&&C(e,t.slice(0,-1)),e}var ke=()=>{let e=[];return{get observers(){return e},next:n=>{for(const a of e)a.next&&a.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(a=>a!==n)}}),unsubscribe:()=>{e=[]}}},Fe=e=>O(e)||!et(e);function Z(e,s){if(Fe(e)||Fe(s))return e===s;if(ie(e)&&ie(s))return e.getTime()===s.getTime();const t=Object.keys(e),u=Object.keys(s);if(t.length!==u.length)return!1;for(const n of t){const a=e[n];if(!u.includes(n))return!1;if(n!=="ref"){const y=s[n];if(ie(a)&&ie(y)||R(a)&&R(y)||Array.isArray(a)&&Array.isArray(y)?!Z(a,y):a!==y)return!1}}return!0}var ft=e=>e.type==="select-multiple",Lt=e=>pe(e)||fe(e),Ee=e=>be(e)&&e.isConnected,ct=e=>{for(const s in e)if(X(e[s]))return!0;return!1};function Ae(e,s={}){const t=Array.isArray(e);if(R(e)||t)for(const u in e)Array.isArray(e[u])||R(e[u])&&!ct(e[u])?(s[u]=Array.isArray(e[u])?[]:{},Ae(e[u],s[u])):O(e[u])||(s[u]=!0);return s}function dt(e,s,t){const u=Array.isArray(e);if(R(e)||u)for(const n in e)Array.isArray(e[n])||R(e[n])&&!ct(e[n])?w(s)||Fe(t[n])?t[n]=Array.isArray(e[n])?Ae(e[n],[]):{...Ae(e[n])}:dt(e[n],O(s)?{}:s[n],t[n]):t[n]=!Z(e[n],s[n]);return t}var ge=(e,s)=>dt(e,s,Ae(s)),yt=(e,{valueAsNumber:s,valueAsDate:t,setValueAs:u})=>w(e)?e:s?e===""?NaN:e&&+e:t&&$(e)?new Date(e):u?u(e):e;function Ce(e){const s=e.ref;if(!(e.refs?e.refs.every(t=>t.disabled):s.disabled))return Oe(s)?s.files:pe(s)?ot(e.refs).value:ft(s)?[...s.selectedOptions].map(({value:t})=>t):fe(s)?nt(e.refs).value:yt(w(s.value)?e.ref.value:s.value,e)}var Tt=(e,s,t,u)=>{const n={};for(const a of e){const y=f(s,a);y&&x(n,a,y._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:u}},ne=e=>w(e)?e:Ve(e)?e.source:R(e)?Ve(e.value)?e.value.source:e.value:e,Ut=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Ze(e,s,t){const u=f(e,t);if(u||Ue(t))return{error:u,name:t};const n=t.split(".");for(;n.length;){const a=n.join("."),y=f(s,a),h=f(e,a);if(y&&!Array.isArray(y)&&t!==a)return{name:t};if(h&&h.type)return{name:a,error:h};n.pop()}return{name:t}}var Ot=(e,s,t,u,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(s||e):(t?u.isOnBlur:n.isOnBlur)?!e:(t?u.isOnChange:n.isOnChange)?e:!0,pt=(e,s)=>!ce(f(e,s)).length&&C(e,s);const Mt={mode:H.onSubmit,reValidateMode:H.onChange,shouldFocusError:!0};function Bt(e={}){let s={...Mt,...e},t={submitCount:0,isDirty:!1,isLoading:X(s.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:s.errors||{},disabled:s.disabled||!1},u={},n=R(s.defaultValues)||R(s.values)?p(s.defaultValues||s.values)||{}:{},a=s.shouldUnregister?{}:p(n),y={action:!1,mount:!1,watch:!1},h={mount:new Set,unMount:new Set,array:new Set,watch:new Set},m,S=0;const _={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={values:ke(),array:ke(),state:ke()},N=Ke(s.mode),j=Ke(s.reValidateMode),T=s.criteriaMode===H.all,xe=r=>i=>{clearTimeout(S),S=setTimeout(r,i)},J=async r=>{if(_.isValid||r){const i=s.resolver?B((await Y()).errors):await P(u,!0);i!==t.isValid&&v.state.next({isValid:i})}},Q=(r,i)=>{(_.isValidating||_.validatingFields)&&((r||Array.from(h.mount)).forEach(l=>{l&&(i?x(t.validatingFields,l,i):C(t.validatingFields,l))}),v.state.next({validatingFields:t.validatingFields,isValidating:!B(t.validatingFields)}))},V=(r,i=[],l,d,c=!0,o=!0)=>{if(d&&l){if(y.action=!0,o&&Array.isArray(f(u,r))){const g=l(f(u,r),d.argA,d.argB);c&&x(u,r,g)}if(o&&Array.isArray(f(t.errors,r))){const g=l(f(t.errors,r),d.argA,d.argB);c&&x(t.errors,r,g),pt(t.errors,r)}if(_.touchedFields&&o&&Array.isArray(f(t.touchedFields,r))){const g=l(f(t.touchedFields,r),d.argA,d.argB);c&&x(t.touchedFields,r,g)}_.dirtyFields&&(t.dirtyFields=ge(n,a)),v.state.next({name:r,isDirty:b(r,i),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else x(a,r,i)},K=(r,i)=>{x(t.errors,r,i),v.state.next({errors:t.errors})},G=r=>{t.errors=r,v.state.next({errors:t.errors,isValid:!1})},k=(r,i,l,d)=>{const c=f(u,r);if(c){const o=f(a,r,w(l)?f(n,r):l);w(o)||d&&d.defaultChecked||i?x(a,r,i?o:Ce(c._f)):U(r,o),y.mount&&J()}},ee=(r,i,l,d,c)=>{let o=!1,g=!1;const A={name:r},L=!!(f(u,r)&&f(u,r)._f.disabled);if(!l||d){_.isDirty&&(g=t.isDirty,t.isDirty=A.isDirty=b(),o=g!==A.isDirty);const M=L||Z(f(n,r),i);g=!!(!L&&f(t.dirtyFields,r)),M||L?C(t.dirtyFields,r):x(t.dirtyFields,r,!0),A.dirtyFields=t.dirtyFields,o=o||_.dirtyFields&&g!==!M}if(l){const M=f(t.touchedFields,r);M||(x(t.touchedFields,r,l),A.touchedFields=t.touchedFields,o=o||_.touchedFields&&M!==l)}return o&&c&&v.state.next(A),o?A:{}},de=(r,i,l,d)=>{const c=f(t.errors,r),o=_.isValid&&W(i)&&t.isValid!==i;if(e.delayError&&l?(m=xe(()=>K(r,l)),m(e.delayError)):(clearTimeout(S),m=null,l?x(t.errors,r,l):C(t.errors,r)),(l?!Z(c,l):c)||!B(d)||o){const g={...d,...o&&W(i)?{isValid:i}:{},errors:t.errors,name:r};t={...t,...g},v.state.next(g)}},Y=async r=>{Q(r,!0);const i=await s.resolver(a,s.context,Tt(r||h.mount,u,s.criteriaMode,s.shouldUseNativeValidation));return Q(r),i},te=async r=>{const{errors:i}=await Y(r);if(r)for(const l of r){const d=f(i,l);d?x(t.errors,l,d):C(t.errors,l)}else t.errors=i;return i},P=async(r,i,l={valid:!0})=>{for(const d in r){const c=r[d];if(c){const{_f:o,...g}=c;if(o){const A=h.array.has(o.name);Q([d],!0);const L=await Ye(c,a,T,s.shouldUseNativeValidation&&!i,A);if(Q([d]),L[o.name]&&(l.valid=!1,i))break;!i&&(f(L,o.name)?A?Et(t.errors,L,o.name):x(t.errors,o.name,L[o.name]):C(t.errors,o.name))}g&&await P(g,i,l)}}return l.valid},ye=()=>{for(const r of h.unMount){const i=f(u,r);i&&(i._f.refs?i._f.refs.every(l=>!Ee(l)):!Ee(i._f.ref))&&me(r)}h.unMount=new Set},b=(r,i)=>(r&&i&&x(a,r,i),!Z(Me(),n)),F=(r,i,l)=>lt(r,h,{...y.mount?a:w(i)?n:$(r)?{[r]:i}:i},l,i),E=r=>ce(f(y.mount?a:n,r,e.shouldUnregister?f(n,r,[]):[])),U=(r,i,l={})=>{const d=f(u,r);let c=i;if(d){const o=d._f;o&&(!o.disabled&&x(a,r,yt(i,o)),c=be(o.ref)&&O(i)?"":i,ft(o.ref)?[...o.ref.options].forEach(g=>g.selected=c.includes(g.value)):o.refs?fe(o.ref)?o.refs.length>1?o.refs.forEach(g=>(!g.defaultChecked||!g.disabled)&&(g.checked=Array.isArray(c)?!!c.find(A=>A===g.value):c===g.value)):o.refs[0]&&(o.refs[0].checked=!!c):o.refs.forEach(g=>g.checked=g.value===c):Oe(o.ref)?o.ref.value="":(o.ref.value=c,o.ref.type||v.values.next({name:r,values:{...a}})))}(l.shouldDirty||l.shouldTouch)&&ee(r,c,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&ae(r)},q=(r,i,l)=>{for(const d in i){const c=i[d],o=`${r}.${d}`,g=f(u,o);(h.array.has(r)||!Fe(c)||g&&!g._f)&&!ie(c)?q(o,c,l):U(o,c,l)}},I=(r,i,l={})=>{const d=f(u,r),c=h.array.has(r),o=p(i);x(a,r,o),c?(v.array.next({name:r,values:{...a}}),(_.isDirty||_.dirtyFields)&&l.shouldDirty&&v.state.next({name:r,dirtyFields:ge(n,a),isDirty:b(r,o)})):d&&!d._f&&!O(o)?q(r,o,l):U(r,o,l),Ge(r,h)&&v.state.next({...t}),v.values.next({name:y.mount?r:void 0,values:{...a}})},ue=async r=>{y.mount=!0;const i=r.target;let l=i.name,d=!0;const c=f(u,l),o=()=>i.type?Ce(c._f):tt(r),g=A=>{d=Number.isNaN(A)||A===f(a,l,A)};if(c){let A,L;const M=o(),re=r.type===_e.BLUR||r.type===_e.FOCUS_OUT,bt=!Ut(c._f)&&!s.resolver&&!f(t.errors,l)&&!c._f.deps||Ot(re,f(t.touchedFields,l),t.isSubmitted,j,N),we=Ge(l,h,re);x(a,l,M),re?(c._f.onBlur&&c._f.onBlur(r),m&&m(0)):c._f.onChange&&c._f.onChange(r);const Se=ee(l,M,re,!1),Vt=!B(Se)||we;if(!re&&v.values.next({name:l,type:r.type,values:{...a}}),bt)return _.isValid&&J(),Vt&&v.state.next({name:l,...we?{}:Se});if(!re&&we&&v.state.next({...t}),s.resolver){const{errors:je}=await Y([l]);if(g(M),d){const Ft=Ze(t.errors,u,l),$e=Ze(je,u,Ft.name||l);A=$e.error,l=$e.name,L=B(je)}}else Q([l],!0),A=(await Ye(c,a,T,s.shouldUseNativeValidation))[l],Q([l]),g(M),d&&(A?L=!1:_.isValid&&(L=await P(u,!0)));d&&(c._f.deps&&ae(c._f.deps),de(l,L,A,Se))}},le=(r,i)=>{if(f(t.errors,i)&&r.focus)return r.focus(),1},ae=async(r,i={})=>{let l,d;const c=he(r);if(s.resolver){const o=await te(w(r)?r:c);l=B(o),d=r?!c.some(g=>f(o,g)):l}else r?(d=(await Promise.all(c.map(async o=>{const g=f(u,o);return await P(g&&g._f?{[o]:g}:g)}))).every(Boolean),!(!d&&!t.isValid)&&J()):d=l=await P(u);return v.state.next({...!$(r)||_.isValid&&l!==t.isValid?{}:{name:r},...s.resolver||!r?{isValid:l}:{},errors:t.errors}),i.shouldFocus&&!d&&oe(u,le,r?c:h.mount),d},Me=r=>{const i={...y.mount?a:n};return w(r)?i:$(r)?f(i,r):r.map(l=>f(i,l))},Be=(r,i)=>({invalid:!!f((i||t).errors,r),isDirty:!!f((i||t).dirtyFields,r),isTouched:!!f((i||t).touchedFields,r),isValidating:!!f((i||t).validatingFields,r),error:f((i||t).errors,r)}),gt=r=>{r&&he(r).forEach(i=>C(t.errors,i)),v.state.next({errors:r?t.errors:{}})},Pe=(r,i,l)=>{const d=(f(u,r,{_f:{}})._f||{}).ref;x(t.errors,r,{...i,ref:d}),v.state.next({name:r,errors:t.errors,isValid:!1}),l&&l.shouldFocus&&d&&d.focus&&d.focus()},ht=(r,i)=>X(r)?v.values.subscribe({next:l=>r(F(void 0,i),l)}):F(r,i,!0),me=(r,i={})=>{for(const l of r?he(r):h.mount)h.mount.delete(l),h.array.delete(l),i.keepValue||(C(u,l),C(a,l)),!i.keepError&&C(t.errors,l),!i.keepDirty&&C(t.dirtyFields,l),!i.keepTouched&&C(t.touchedFields,l),!i.keepIsValidating&&C(t.validatingFields,l),!s.shouldUnregister&&!i.keepDefaultValue&&C(n,l);v.values.next({values:{...a}}),v.state.next({...t,...i.keepDirty?{isDirty:b()}:{}}),!i.keepIsValid&&J()},Ie=({disabled:r,name:i,field:l,fields:d,value:c})=>{if(W(r)){const o=r?void 0:w(c)?Ce(l?l._f:f(d,i)._f):c;x(a,i,o),ee(i,o,!1,!1,!0)}},De=(r,i={})=>{let l=f(u,r);const d=W(i.disabled);return x(u,r,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:r}},name:r,mount:!0,...i}}),h.mount.add(r),l?Ie({field:l,disabled:i.disabled,name:r,value:i.value}):k(r,!0,i.value),{...d?{disabled:i.disabled}:{},...s.progressive?{required:!!i.required,min:ne(i.min),max:ne(i.max),minLength:ne(i.minLength),maxLength:ne(i.maxLength),pattern:ne(i.pattern)}:{},name:r,onChange:ue,onBlur:ue,ref:c=>{if(c){De(r,i),l=f(u,r);const o=w(c.value)&&c.querySelectorAll&&c.querySelectorAll("input,select,textarea")[0]||c,g=Lt(o),A=l._f.refs||[];if(g?A.find(L=>L===o):o===l._f.ref)return;x(u,r,{_f:{...l._f,...g?{refs:[...A.filter(Ee),o,...Array.isArray(f(n,r))?[{}]:[]],ref:{type:o.type,name:r}}:{ref:o}}}),k(r,!1,void 0,o)}else l=f(u,r,{}),l._f&&(l._f.mount=!1),(s.shouldUnregister||i.shouldUnregister)&&!(rt(h.array,r)&&y.action)&&h.unMount.add(r)}}},Ne=()=>s.shouldFocusError&&oe(u,le,h.mount),vt=r=>{W(r)&&(v.state.next({disabled:r}),oe(u,(i,l)=>{let d=r;const c=f(u,l);c&&W(c._f.disabled)&&(d||(d=c._f.disabled)),i.disabled=d},0,!1))},qe=(r,i)=>async l=>{let d;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let c=p(a);if(v.state.next({isSubmitting:!0}),s.resolver){const{errors:o,values:g}=await Y();t.errors=o,c=g}else await P(u);if(C(t.errors,"root"),B(t.errors)){v.state.next({errors:{}});try{await r(c,l)}catch(o){d=o}}else i&&await i({...t.errors},l),Ne(),setTimeout(Ne);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:B(t.errors)&&!d,submitCount:t.submitCount+1,errors:t.errors}),d)throw d},_t=(r,i={})=>{f(u,r)&&(w(i.defaultValue)?I(r,p(f(n,r))):(I(r,i.defaultValue),x(n,r,p(i.defaultValue))),i.keepTouched||C(t.touchedFields,r),i.keepDirty||(C(t.dirtyFields,r),t.isDirty=i.defaultValue?b(r,p(f(n,r))):b()),i.keepError||(C(t.errors,r),_.isValid&&J()),v.state.next({...t}))},We=(r,i={})=>{const l=r?p(r):n,d=p(l),c=B(r),o=c?n:d;if(i.keepDefaultValues||(n=l),!i.keepValues){if(i.keepDirtyValues)for(const g of h.mount)f(t.dirtyFields,g)?x(o,g,f(a,g)):I(g,f(o,g));else{if(Re&&w(r))for(const g of h.mount){const A=f(u,g);if(A&&A._f){const L=Array.isArray(A._f.refs)?A._f.refs[0]:A._f.ref;if(be(L)){const M=L.closest("form");if(M){M.reset();break}}}}u={}}a=e.shouldUnregister?i.keepDefaultValues?p(n):{}:p(o),v.array.next({values:{...o}}),v.values.next({values:{...o}})}h={mount:i.keepDirtyValues?h.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},y.mount=!_.isValid||!!i.keepIsValid||!!i.keepDirtyValues,y.watch=!!e.shouldUnregister,v.state.next({submitCount:i.keepSubmitCount?t.submitCount:0,isDirty:c?!1:i.keepDirty?t.isDirty:!!(i.keepDefaultValues&&!Z(r,n)),isSubmitted:i.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:c?[]:i.keepDirtyValues?i.keepDefaultValues&&a?ge(n,a):t.dirtyFields:i.keepDefaultValues&&r?ge(n,r):{},touchedFields:i.keepTouched?t.touchedFields:{},errors:i.keepErrors?t.errors:{},isSubmitSuccessful:i.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1})},He=(r,i)=>We(X(r)?r(a):r,i);return{control:{register:De,unregister:me,getFieldState:Be,handleSubmit:qe,setError:Pe,_executeSchema:Y,_getWatch:F,_getDirty:b,_updateValid:J,_removeUnmounted:ye,_updateFieldArray:V,_updateDisabledField:Ie,_getFieldArray:E,_reset:We,_resetDefaultValues:()=>X(s.defaultValues)&&s.defaultValues().then(r=>{He(r,s.resetOptions),v.state.next({isLoading:!1})}),_updateFormState:r=>{t={...t,...r}},_disableForm:vt,_subjects:v,_proxyFormState:_,_setErrors:G,get _fields(){return u},get _formValues(){return a},get _state(){return y},set _state(r){y=r},get _defaultValues(){return n},get _names(){return h},set _names(r){h=r},get _formState(){return t},set _formState(r){t=r},get _options(){return s},set _options(r){s={...s,...r}}},trigger:ae,register:De,handleSubmit:qe,watch:ht,setValue:I,getValues:Me,reset:He,resetField:_t,clearErrors:gt,unregister:me,setError:Pe,setFocus:(r,i={})=>{const l=f(u,r),d=l&&l._f;if(d){const c=d.refs?d.refs[0]:d.ref;c.focus&&(c.focus(),i.shouldSelect&&c.select())}},getFieldState:Be}}function Ht(e={}){const s=D.useRef(),t=D.useRef(),[u,n]=D.useState({isDirty:!1,isValidating:!1,isLoading:X(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:X(e.defaultValues)?void 0:e.defaultValues});s.current||(s.current={...Bt(e),formState:u});const a=s.current.control;return a._options=e,Te({subject:a._subjects.state,next:y=>{it(y,a._proxyFormState,a._updateFormState,!0)&&n({...a._formState})}}),D.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),D.useEffect(()=>{if(a._proxyFormState.isDirty){const y=a._getDirty();y!==u.isDirty&&a._subjects.state.next({isDirty:y})}},[a,u.isDirty]),D.useEffect(()=>{e.values&&!Z(e.values,t.current)?(a._reset(e.values,a._options.resetOptions),t.current=e.values,n(y=>({...y}))):a._resetDefaultValues()},[e.values,a]),D.useEffect(()=>{e.errors&&a._setErrors(e.errors)},[e.errors,a]),D.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),D.useEffect(()=>{e.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})},[e.shouldUnregister,a]),s.current.formState=st(u,a),s.current}export{Wt as C,wt as a,Ht as u};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import{bb as K,H as le,aK as ce,aL as de,j as e,cK as mt,dA as ut,P as r,aU as ze,q as E,r as S,bl as U,e as pt,b as Re,J as ft,ax as F,C as H,ad as G,A as O,gs as ht,g as Fe,gt as xt,gu as gt,gv as yt,gw as jt,gx as vt,X as bt,v as me,gy as Me,gz as Dt,gA as wt,O as h,m as T,gB as Ct,aS as St,V as Ee,i as At,x as It,av as Tt,dv as Pe,c6 as Be,S as Oe,B as V,aN as kt,aD as Rt,a9 as Et,a$ as Ue,b0 as We,b1 as He,k as Pt,b2 as _e,a_ as _t,bH as Ve,n as Qe,cd as Lt,gC as Ke,b3 as $t,gD as Nt,M as J,aO as qt,b4 as Je,a2 as zt,W as B,cF as Ft,at as Mt,T as Bt}from"./index-CkzoIPXc.js";import{I as Ge}from"./index-DWayuvwj.js";import{u as ue}from"./team-C-DXj-V_.js";import{D as Le,B as Ot}from"./url-evaluation-ClVD1OGC.js";import{d as Ut}from"./Add-DdfKyAdP.js";import{d as Wt}from"./LockIcon-BIvEaDW_.js";import{E as Ht}from"./index-P39Qd5P6.js";import{d as Vt,a as Ye}from"./Https-OdxMf6s_.js";import{d as Qt}from"./InfoOutlined-BaBR5WTh.js";import{r as Kt}from"./index-hQvDKtXn.js";import"./api-Cex76yJU.js";import{p as $e}from"./util-9Xuj0MWG.js";import{T as Jt}from"./TextField-CedO329E.js";import{L as Gt}from"./LoadingButton-g3UG3r3Q.js";import{d as Xe}from"./Delete-DXKhZTtc.js";import{A as Yt}from"./actions-BeKlqO4e.js";import"./tag-Bd5v37NR.js";import"./Select-BazOq14-.js";import"./InputLabel-Bb9-Zb4y.js";function Xt({key:n="sm"}){const t=K();return le(t.breakpoints.down(n))}var pe={},Zt=de;Object.defineProperty(pe,"__esModule",{value:!0});var Ze=pe.default=void 0,en=Zt(ce()),tn=e;Ze=pe.default=(0,en.default)((0,tn.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"OpenInNew");var fe={},nn=de;Object.defineProperty(fe,"__esModule",{value:!0});var he=fe.default=void 0,on=nn(ce()),sn=e;he=fe.default=(0,on.default)((0,sn.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");var xe={},rn=de;Object.defineProperty(xe,"__esModule",{value:!0});var oe=xe.default=void 0,an=rn(ce()),ln=e;oe=xe.default=(0,an.default)((0,ln.jsx)("path",{d:"M12.16 3h-.32L9.21 8.25h5.58zm4.3 5.25h5.16L19 3h-5.16zm4.92 1.5h-8.63V20.1zM11.25 20.1V9.75H2.62zM7.54 8.25 10.16 3H5L2.38 8.25z"}),"Diamond");class cn{constructor(t,o,s){this.name=t,this.prefix=o,this.baseEncode=s}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class dn{constructor(t,o,s){if(this.name=t,this.prefix=o,o.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=o.codePointAt(0),this.baseDecode=s}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return et(this,t)}}class mn{constructor(t){this.decoders=t}or(t){return et(this,t)}decode(t){const o=t[0],s=this.decoders[o];if(s)return s.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const et=(n,t)=>new mn({...n.decoders||{[n.prefix]:n},...t.decoders||{[t.prefix]:t}});class un{constructor(t,o,s,a){this.name=t,this.prefix=o,this.baseEncode=s,this.baseDecode=a,this.encoder=new cn(t,o,s),this.decoder=new dn(t,o,a)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const pn=({name:n,prefix:t,encode:o,decode:s})=>new un(n,t,o,s),fn=(n,t,o,s)=>{const a={};for(let u=0;u<t.length;++u)a[t[u]]=u;let l=n.length;for(;n[l-1]==="=";)--l;const i=new Uint8Array(l*o/8|0);let c=0,d=0,p=0;for(let u=0;u<l;++u){const g=a[n[u]];if(g===void 0)throw new SyntaxError(`Non-${s} character`);d=d<<o|g,c+=o,c>=8&&(c-=8,i[p++]=255&d>>c)}if(c>=o||255&d<<8-c)throw new SyntaxError("Unexpected end of data");return i},hn=(n,t,o)=>{const s=t[t.length-1]==="=",a=(1<<o)-1;let l="",i=0,c=0;for(let d=0;d<n.length;++d)for(c=c<<8|n[d],i+=8;i>o;)i-=o,l+=t[a&c>>i];if(i&&(l+=t[a&c<<o-i]),s)for(;l.length*o&7;)l+="=";return l},N=({name:n,prefix:t,bitsPerChar:o,alphabet:s})=>pn({prefix:t,name:n,encode(a){return hn(a,s,o)},decode(a){return fn(a,s,o,n)}}),xn=N({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),gn=N({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),yn=N({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),jn=N({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),vn=N({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),bn=N({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Dn=N({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),wn=N({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Cn=N({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Sn=Object.freeze(Object.defineProperty({__proto__:null,base32:xn,base32hex:vn,base32hexpad:Dn,base32hexpadupper:wn,base32hexupper:bn,base32pad:yn,base32padupper:jn,base32upper:gn,base32z:Cn},Symbol.toStringTag,{value:"Module"})),An=mt(Sn),{toBuffer:In,toAddress:Tn,toBase58:kn,toHex:Rn}=ut,{base32:tt}=An,En=n=>{if(!n)return n;const t=In(Tn(n));return tt.encode(t)},Pn=n=>{if(!n)return n;const t=tt.decode(n),o=kn(t);return o.length>30?o:Rn(t)};var _n={encode:En,decode:Pn};const Ln=n=>["waiting","creating","renewaling"].includes(n);function ge(n){var v,w;const{t}=E(),[o,s]=S.useState(!1),{inService:a}=U(),[l,i]=S.useState(null),{siteId:c,domain:d,onAdd:p,children:u,did:g}=n,[P,j]=S.useState(!1),{api:C,ws:{useSubscription:k}}=U(),{mode:R,actions:{refreshDomainStatus:f}}=ue(),b=pt(async()=>{const{cert:y}=await C.findCertificateByDomain({input:{domain:d,did:g}});return y}),A=(y,L)=>{y.domain===d&&(j(!1),s(!1),a&&R!=="setup"&&(L==="success"?O.success(t("setup.domain.genCertSuccess",{domain:y.domain})):L==="error"&&O.error(t("setup.domain.genCertFailed",{domain:y.domain,message:y.message}))))};if(S.useEffect(()=>{var y;b.loading||j(Ln((y=b.value)==null?void 0:y.status))},[b.loading,(v=b.value)==null?void 0:v.status]),k(Re.BlockletEvents.certError,y=>A(y,"error")),k(Re.BlockletEvents.certIssued,y=>{b.retry(),f(y.domain),A(y,"success")}),b.loading||((w=b.value)==null?void 0:w.status)==="normal")return"";const D=()=>{s(!1),i(null)},m=async()=>{s(!0);try{await C.issueLetsEncryptCert({input:{siteId:c,domain:d,did:g,inBlockletSetup:R==="setup"}}),p(),j(!0)}catch(y){console.error(y),j(!1)}finally{s(!1),i(null)}},_={title:t("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(ft,{type:"success",children:t("router.cert.genLetsEncryptCert.dnsTip")}),t("router.cert.genLetsEncryptCert.description")]}),confirm:t("common.confirm"),onConfirm:m,onCancel:D},W=y=>{y.stopPropagation(),i(_)};return e.jsxs(e.Fragment,{children:[P?e.jsx(F,{title:t("router.cert.issuing"),children:e.jsx(H,{size:12})}):u({loading:o,open:W}),l&&e.jsx(G,{color:"primary",title:l.title,description:l.description,confirm:l.confirm,params:l.params,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}ge.propTypes={domain:r.string.isRequired,did:r.string.isRequired,siteId:r.string.isRequired,onAdd:r.func,children:r.any};ge.defaultProps={onAdd:()=>{},children:null};function ye(n){const{domain:t,domainStatus:o,...s}=n;return!ze(t)||o!=null&&o.isHttps?"":e.jsx(ge,{domain:t,...s})}ye.propTypes={domain:r.string.isRequired,domainStatus:r.shape({isHttps:r.bool}).isRequired,did:r.string.isRequired,onAdd:r.func,children:r.any};ye.defaultProps={onAdd:()=>{},children:null};var $n=ht;function Nn(n,t){for(var o=-1,s=n.length;++o<s&&$n(t,n[o],0)>-1;);return o}var qn=Nn,zn=xt,Fn=gt,Mn=yt,Bn=jt,On=qn,Ne=vt,Un=bt;function Wn(n,t,o){if(n=Un(n),n&&(o||t===void 0))return Fn(n);if(!n||!(t=zn(t)))return n;var s=Ne(n),a=Ne(t),l=On(s,a),i=Bn(s,a)+1;return Mn(s,l,i).join("")}var Hn=Wn;const nt=Fe(Hn),ot=S.createContext({}),{Provider:Vn,Consumer:Ro}=ot;function Qn({children:n}){const[t,o]=me({domain:"",error:null}),{locale:s}=E(),a={error:t.error,domain:t.domain,setError:l=>{o({error:l})},setDomain:l=>{const i=nt(l),c=Me(i,s);o({domain:i,error:c})}};return e.jsx(Vn,{value:{value:a},children:n})}function Kn(){const{value:n}=S.useContext(ot);return n}const qe=Dt,Jn=wt,st="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",Gn=async n=>{var c;if(!n||!(n!=null&&n.trim()))return null;const t=new URL(n);t.pathname="__blocklet__.js",t.searchParams.set("type","json");const{data:o}=await Jn.get(t.toString()),s=(c=o==null?void 0:o.componentMountPoints)==null?void 0:c.find(d=>d.did===st),a=new URL(n);a.pathname=s==null?void 0:s.mountPoint;const l=a.toString(),i=qe(l,"/api");return{base:l,api:i,domain:qe(i,"/domains")}};var Yn={DID_DOMAIN_SERVICE_DID:st,getDidDomainServiceURL:Gn},Y={exports:{}};const Xn=Kt,Zn=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class it extends Error{constructor(t){super(),t instanceof Error?(this.originalError=t,{message:t}=t):(this.originalError=new Error(t),this.originalError.stack=this.stack),this.name="AbortError",this.message=t}}const eo=(n,t,o)=>{const s=o.retries-(t-1);return n.attemptNumber=t,n.retriesLeft=s,n},to=n=>Zn.includes(n),rt=(n,t)=>new Promise((o,s)=>{t={onFailedAttempt:()=>{},retries:10,...t};const a=Xn.operation(t);a.attempt(async l=>{try{o(await n(l))}catch(i){if(!(i instanceof Error)){s(new TypeError(`Non-error was thrown: "${i}". You should only throw errors.`));return}if(i instanceof it)a.stop(),s(i.originalError);else if(i instanceof TypeError&&!to(i.message))a.stop(),s(i);else{eo(i,l,t);try{await t.onFailedAttempt(i)}catch(c){s(c);return}a.retry(i)||s(a.mainError())}}})});Y.exports=rt;Y.exports.default=rt;Y.exports.AbortError=it;var no=Y.exports;const oo=Fe(no);function je({domain:n,resolvedTarget:t,...o}){const{t:s,locale:a}=E();return e.jsxs(h,{sx:{backgroundColor:"rgb(236, 251, 253)",borderColor:"rgb(236, 251, 253)",borderRadius:"8px",padding:"12px"},...o,children:[e.jsxs(h,{display:"flex",children:[s("router.domain.setup.tipStart"),n&&e.jsx(h,{mx:.5,color:"primary.main",fontWeight:"fontWeightBold",children:n}),s("router.domain.setup.tipEnd"),":"]}),e.jsxs(h,{sx:{"&>div":{mb:0},marginTop:"8px"},children:[e.jsx(se,{label:s("router.domain.setup.recordType"),value:"CNAME",locale:a}),e.jsx(se,{label:s("router.domain.setup.recordValue"),value:t,locale:a})]})]})}je.propTypes={domain:r.string,resolvedTarget:r.string.isRequired};je.defaultProps={domain:""};function se({locale:n,label:t,value:o}){const s=le(l=>l.breakpoints.down("md")),a=K();return e.jsx(Ge,{name:t,nameWidth:120,children:e.jsxs(h,{sx:{display:"flex",alignItems:"center",lineHeight:1},children:[e.jsx(T,{component:"span",color:"primary.main",overflow:"auto",sx:s?{maxWidth:"95%",wordWrap:"break-word"}:{wordWrap:"break-word"},children:o}),e.jsx(Ct,{content:o,locale:n,style:{marginLeft:"4px",color:a.palette.text.secondary}})]})})}se.propTypes={locale:r.string.isRequired,label:r.string.isRequired,value:r.string.isRequired};function ve({siteId:n,teamDid:t,cnameDomain:o,defaultCustomDomain:s,onInputDomain:a,appId:l,appPk:i,onSuccess:c,onError:d,disabled:p,autoFocus:u,inBlockletSetup:g,shouldCheckDomain:P,onStateChange:j,currentIp:C,resolveDomain:k,...R}){const{t:f,locale:b}=E(),{api:A,info:D}=U(),m=Kn(),_=K(),W=Xt({key:"sm"}),[v,w]=me({submittingDomain:!1,domain:s,error:null,type:D!=null&&D.nftDomainUrl?"nftDomain":"inputDomain",showNFTDomainAuth:!1,showDnsTip:!1}),y=St(()=>Yn.getDidDomainServiceURL(D==null?void 0:D.nftDomainUrl));if(D!=null&&D.nftDomainUrl&&y.loading)return e.jsx(h,{...R,children:e.jsx(Ee,{relative:"parent",children:e.jsx(H,{})})});if(y.error)return e.jsx(h,{...R,children:e.jsx(Ee,{relative:"parent",children:y.error.message})});const L=y.value,at=()=>{w({invalidDNSDomain:null})},ee=async x=>{j(f("setup.domain.addingDomain")),await A.addDomainAlias({input:{id:n,domainAlias:x,teamDid:t,inBlockletSetup:!0}}),w({submittingDomain:!1}),c({domain:x,type:"inputDomain"})},Ae=async({domain:x,type:I,nftDid:M,chainHost:$})=>{try{if(!P){if(I==="inputDomain"){await ee(x);return}c({domain:x,type:I,nftDid:M,chainHost:$});return}j({text:f("setup.domain.checkingResolvable")});let q=30;const te=3e3,dt=q*1e3/te,Te=setInterval(()=>{if(q<=0){clearInterval(Te);return}j({text:`${f("setup.domain.checkingResolvable")} (${q--}s)`})},1e3),ke=await oo(async()=>{const{data:z}=await k(x);if(!z.address)throw new Error("Cannot resolve domain");return z.address},{retries:dt,minTimeout:te,maxTimeout:te,onFailedAttempt:console.error}).catch(console.error);if(clearInterval(Te),!ke){const z=f("setup.domain.cannotResolve",{domain:x});if(I==="nftDomain"){O.error(z),c({domain:x,type:"nftDomain"});return}j({text:""}),w({invalidDNSDomain:{domain:x,error:z},domain:x,type:I,submittingDomain:!1});return}if(ke!==C){const z=f("setup.domain.resolvedAddressError",{domain:x,curDomain:window.location.hostname});if(I==="nftDomain"){O.error(z),c({domain:x,type:"nftDomain"});return}j({text:""}),w({invalidDNSDomain:{domain:x,error:z},domain:x,type:I,submittingDomain:!1});return}if(I==="nftDomain"){c({domain:x,type:"nftDomain"});return}await ee(x)}catch(q){O.error(q.message),j({text:""}),w({submittingDomain:!1})}},lt=async({domain:x,nftDid:I,chainHost:M})=>{try{const $=$e(x);w({submittingDomain:!0}),await A.addDomainAlias({input:{id:n,type:"nft-domain",domainAlias:$,nftDid:I,chainHost:M,teamDid:t,inBlockletSetup:g}});const q="nftDomain";w({showNFTDomainAuth:!1,type:q}),await Ae({domain:$,type:q,nftDid:I,chainHost:M})}catch($){O.error($.message)}finally{w({showNFTDomainAuth:!1,submittingDomain:!1})}},ct=async()=>{try{w({submittingDomain:!0});const x=$e(v.domain);if(D.nftDomainUrl&&L&&(await A.isDidDomain({input:{domain:x}})).value===!0){w({showNFTDomainAuth:!0});return}await Ae({domain:x,type:v.type})}catch(x){w({submittingDomain:!1}),m.setError(x.message)}},Ie=m.error||v.error;return e.jsx(h,{...R,children:e.jsxs(h,{sx:{display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:"1em"},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:"8px"},children:[D.nftDomainUrl&&L&&e.jsxs(h,{sx:{color:_.palette.text.primary},children:[e.jsx(T,{children:f("router.domainAlias.addDomainNFT.tips")}),e.jsxs(T,{component:"div",children:[f("router.domainAlias.addDomainNFT.buyTip"),e.jsxs(At,{href:L.base,sx:{display:"inline-flex",alignItems:"center"},target:"_blank",children:[e.jsx("i",{children:f("router.domainAlias.addDomainNFT.buy")}),e.jsx(Ze,{fontSize:"small"})]})]})]}),e.jsx(Jt,{sx:{display:"block",marginTop:"8px"},label:f("router.domainAlias.add.domainDescription"),helperText:v.type==="inputDomain"&&Ie||f("router.domainAlias.add.helperText"),inputProps:{"data-cy":"domain-name-input"},fullWidth:!0,disabled:p,value:v.domain,size:"small",variant:"outlined",error:!!Ie&&v.type==="inputDomain",onChange:x=>{var $;const I=nt(($=x.target)==null?void 0:$.value);m.setDomain(I);const M=Me(I,b);w({domain:I,error:M,type:"inputDomain"}),a({domain:I,error:M,type:"inputDomain"})},autoFocus:u,onBlur:()=>{m.domain||(w({error:null}),m.setError(null))}}),e.jsx(h,{sx:{width:"100%",display:"flex",justifyContent:"flex-end"},children:e.jsx(Gt,{"data-cy":"confirm-add-domain",fullWidth:W,variant:"contained",loading:v.submittingDomain,onClick:ct,children:f("common.add")})}),e.jsxs(h,{sx:{cursor:"pointer",fontSize:"14px",display:"flex",alignItems:"center",gap:"4px",lineHeight:1,color:_.palette.primary.main},onClick:()=>w({showDnsTip:!v.showDnsTip}),children:[e.jsx(Qt,{fontSize:"1em"}),f("router.domainAlias.showTipHint")]}),v.showDnsTip&&e.jsx(je,{domain:v.domain,resolvedTarget:o,style:{marginTop:"4px"}})]}),v.invalidDNSDomain&&e.jsx(G,{title:f("common.reminder"),description:f("setup.domain.invalidDNSReminder",{error:v.invalidDNSDomain.error}),color:"primary",confirm:f("setup.domain.continueAdd"),onConfirm:()=>ee(v.invalidDNSDomain.domain,v.type),onCancel:at}),L&&e.jsx(It,{open:v.showNFTDomainAuth,popup:!0,useSocket:!1,action:"authorize",baseUrl:L.api,checkFn:Tt.create({baseURL:L.api}).get,extraParams:{delegatee:l,delegateePk:i,domain:v.domain},onSuccess:lt,onClose:()=>w({showNFTDomainAuth:!1,submittingDomain:!1}),checkTimeout:60*5e3,showDownload:!1,messages:{title:f("router.domainAlias.addDomainNFT.connect.title"),scan:f("router.domainAlias.addDomainNFT.connect.scan"),confirm:f("router.domainAlias.addDomainNFT.connect.confirm"),success:f("router.domainAlias.addDomainNFT.connect.success")}})]})})}ve.propTypes={siteId:r.string.isRequired,currentIp:r.string,teamDid:r.string.isRequired,cnameDomain:r.string.isRequired,defaultCustomDomain:r.string,onInputDomain:r.func,onSuccess:r.func,appId:r.string,appPk:r.string,disabled:r.bool,autoFocus:r.bool,inBlockletSetup:r.bool,shouldCheckDomain:r.bool,onStateChange:r.func,resolveDomain:r.func,onError:r.func};ve.defaultProps={defaultCustomDomain:"",currentIp:"",onInputDomain:Pe,onSuccess:Pe,appId:"",appPk:"",disabled:!1,autoFocus:!0,inBlockletSetup:!1,shouldCheckDomain:!1,onStateChange:()=>{},resolveDomain:()=>{},onError:()=>{}};function be({id:n,children:t,title:o,teamDid:s,systemDomains:a,appId:l,appPk:i}){const{t:c}=E(),[d,p]=me({loading:!1,confirmSetting:null}),u=a.find(C=>Be.isDidDomain(C)),g=()=>{p({loading:!1,confirmSetting:null})},P={title:o||c("router.domainAlias.add.title"),description:function(k,R,f){return e.jsx(ve,{siteId:n,teamDid:s,cnameDomain:u,onSuccess:()=>p({confirmSetting:null}),onInputDomain:({domain:b,type:A,error:D})=>{R({...k,domain:b,type:A,__disableConfirm:!!D}),f(D)},appId:l,appPk:i})},confirm:c("common.confirm"),cancel:c("common.cancel"),params:{domain:"",__disableConfirm:!0},onCancel:g},j=C=>{C.stopPropagation(),p({confirmSetting:P})};return e.jsxs(e.Fragment,{children:[typeof t=="function"?t({loading:d.loading,open:j}):e.jsxs(Oe,{onClick:j,className:"rule-action","data-cy":"action-add-domain-alias",children:[d.loading?e.jsx(H,{size:16}):e.jsx(Vt,{style:{fontSize:18,marginRight:5}}),c("router.domainAlias.add.title")]}),d.confirmSetting&&e.jsx(G,{title:d.confirmSetting.title,description:d.confirmSetting.description,confirm:d.confirmSetting.confirm,cancel:d.confirmSetting.cancel,params:d.confirmSetting.params,onCancel:d.confirmSetting.onCancel,showConfirm:!1,showCancel:!0,displayError:!1,color:"primary",loading:d.loading,maxWidth:"sm"})]})}be.propTypes={id:r.string.isRequired,children:r.any,title:r.string,teamDid:r.string,systemDomains:r.arrayOf(r.string).isRequired,appId:r.string,appPk:r.string.isRequired};be.defaultProps={children:null,title:"",teamDid:"",appId:null};function so(n){return e.jsx(Qn,{children:e.jsx(be,{...n})})}function De(n){const{t}=E(),[o,s]=S.useState(!1),[a,l]=S.useState(null),{id:i,domain:c,children:d,teamDid:p}=n,{api:u}=U(),g=()=>{s(!1),l(null)},P=async()=>{s(!0);try{await u.deleteDomainAlias({input:{id:i,domainAlias:c,teamDid:p}}),await kt(2e3)}catch(k){O.error(k.message)}finally{l(null),s(!1)}},j={title:t("router.domainAlias.delete.title"),description:t("router.domainAlias.delete.description"),confirm:t("common.confirm"),onConfirm:P,onCancel:g},C=k=>{k.stopPropagation(),l(j)};return e.jsxs(e.Fragment,{children:[typeof d=="function"?d({loading:o,open:C}):e.jsxs(V,{edge:"end",onClick:C,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[o?e.jsx(H,{size:16}):e.jsx(Xe,{style:{fontSize:16}}),t("router.domainAlias.delete.title")]}),a&&e.jsx(G,{title:a.title,description:a.description,confirm:a.confirm,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})]})}De.propTypes={id:r.string.isRequired,domain:r.string.isRequired,children:r.any,teamDid:r.string};De.defaultProps={children:null,teamDid:""};function we({site:n,domain:t,blocklet:o}){const{t:s}=E(),a=t.value===window.location.hostname;return e.jsx(Yt,{"data-cy":"domain-actions",size:"large",actions:[({close:l})=>{var i;return e.jsx(De,{id:n.id,domain:t.value,teamDid:(i=o==null?void 0:o.meta)==null?void 0:i.did,children:({open:c})=>e.jsx(F,{title:a?s("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Oe,{disabled:t.isProtected||a,dense:!0,onClick:d=>{l(),c(d)},"data-cy":"action-toggle-block",children:[e.jsx(Rt,{style:{minWidth:24,marginRight:8},children:e.jsx(Xe,{})}),e.jsx(Et,{primary:s("common.delete")})]},"remove")})})})}]})}we.propTypes={site:r.object.isRequired,domain:r.object.isRequired,blocklet:r.object.isRequired};we.defaultProps={};const X=r.shape({href:r.string,accessibility:r.shape({loading:r.bool,accessible:r.bool}),domainStatus:r.shape({isHttps:r.bool,matchedCert:r.object}),dns:r.shape({resolved:r.bool,ip:r.string})});function Ce({certificate:n}){const[t,o]=S.useState(null),s=U(),{t:a,locale:l}=E(),i=p=>{o(p.currentTarget)},c=()=>{o(null)},d=!!t;return e.jsxs(e.Fragment,{children:[e.jsx(Ye,{"aria-owns":d?"mouse-over-popover":void 0,onMouseEnter:i,onMouseLeave:c,style:{color:"#44cdc6",fontSize:20,cursor:"pointer"}}),e.jsx(Ue,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:d,anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:c,disableRestoreFocus:!0,children:e.jsx(We,{children:e.jsxs(He,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${s.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(T,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(T,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(T,{component:"div",children:`${a("common.issuer")}: ${Pt(n,"issuer.commonName","")}`}),e.jsx(T,{component:"div",children:`${a("router.cert.issuedOn")}: ${_e(n.validFrom,l)}`}),e.jsx(T,{component:"div",children:`${a("router.cert.expiryOn")}: ${_e(n.validTo,l)}`})]})]})})})]})}Ce.propTypes={certificate:r.object};Ce.defaultProps={certificate:{}};function Q({domain:n,filters:t}){const{t:o}=E(),{value:s,domainStatus:a}=n;if(!ze(s))return null;let l=null,i=null;const{isHttps:c,matchedCert:d}=a;if(!_t(s)){const{dns:{resolved:u,ip:g}={}}=a;u||g==="127.0.0.1"?l=e.jsx(F,{title:o("router.domain.verify.ok"),children:e.jsx(Le,{color:"success"})}):l=e.jsx(F,{title:o("router.domain.verify.notResolved"),children:e.jsx(Le,{color:"error"})})}c?i=e.jsx(Ce,{certificate:d}):i=e.jsx(F,{title:o("router.domain.https.bad"),children:e.jsx(Ye,{style:{color:"#D0021B",fontSize:20,cursor:"pointer"}})});const p=t.map(u=>u==="domain"?l:u==="http"?i:null);return S.createElement(S.Fragment,null,...p)}Q.propTypes={domain:X.isRequired,filters:r.array};Q.defaultProps={filters:["domain","http"]};const io=Ve(Z,"mutate_blocklets"),ro=Ve(Z,"",Lt);function Se(n){const{inService:t}=U(),{blocklet:o,loadingRuntimeInfo:s}=ue();let a=io;return t&&(a=ro),e.jsx(a,{...n,blocklet:o,inService:t,loadingRuntimeInfo:s})}Se.propTypes={listOnly:r.bool};Se.defaultProps={listOnly:!1};function Z({hasPermission:n,blocklet:t,loadingRuntimeInfo:o,inService:s,listOnly:a}){var f,b,A,D;const{t:l}=E(),[i,c]=S.useState(!1),d=le(m=>m.breakpoints.down("md")),p=S.useMemo(()=>{let m=n;return Ke(t)&&(m=m&&s),m},[n,s,t]),{site:u}=t,g=S.useMemo(()=>{var m;return $t((m=t.site)==null?void 0:m.domainAliases)},[(f=t.site)==null?void 0:f.domainAliases]),P=[],j=[],C=_n.encode(t.appPid),k=(A=(b=t.environments)==null?void 0:b.find(m=>m.key==="BLOCKLET_APP_PK"))==null?void 0:A.value,R=Nt(g);return g.forEach(m=>{const _=m.value||"";Be.isDidDomain(_)&&!_.startsWith(C)?j.push(m):P.push(m)}),e.jsxs(e.Fragment,{children:[!a&&e.jsxs(e.Fragment,{children:[e.jsxs(h,{className:"title first",display:"flex",justifyContent:"space-between",alignItems:"center",children:[e.jsx(h,{children:l("common.domain")}),p&&e.jsx(so,{id:u.id,title:l("router.domain.add.title"),teamDid:(D=t.meta)==null?void 0:D.did,appId:t.appPid,appPk:k,systemDomains:R==null?void 0:R.map(m=>m.value),children:({open:m})=>e.jsxs(V,{style:{marginLeft:16},variant:"contained",color:"primary","data-cy":"add-domain-alias",onClick:m,disabled:J.isInProgress(t.status),children:[e.jsx(Ut,{style:{fontSize:"1.3em",marginRight:4}}),l("common.add")]})})]}),J.isAccessible(t.status)===!1&&e.jsx(h,{mt:1.5,mb:1.5,children:e.jsx(qt,{severity:"warning",children:l("blocklet.router.noRunning")})})]}),e.jsx(h,{sx:{display:"flex",flexDirection:"column",gap:1},children:(i?g:P).map(m=>{var W,v;const _=m.value;return e.jsxs(S.Fragment,{children:[d&&e.jsxs(h,{display:"flex",flexDirection:"column",children:[e.jsx(h,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:e.jsx(ie,{domain:m,target:"_blank",children:m.value})}),e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1},children:[e.jsx(Q,{domain:m,filters:["domain"]},`${m.value}-domain`),e.jsx(ae,{siteId:(W=t.site)==null?void 0:W.id,domain:m,blocklet:t,hasMutatePermission:p})]}),e.jsx(h,{sx:{button:{padding:0}},children:e.jsx(re,{hasMutatePermission:p,site:u,domain:m,blocklet:t})})]})]},_),!d&&e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(Q,{domain:m,filters:["domain"]},`${m.value}-domain`),e.jsx(h,{sx:{ml:2,mr:.5},children:e.jsx(ie,{domain:m,target:"_blank",children:m.value})}),e.jsx(ae,{siteId:(v=t.site)==null?void 0:v.id,domain:m,blocklet:t,hasMutatePermission:p})]}),e.jsx(h,{sx:{button:{padding:0}},children:e.jsx(re,{hasMutatePermission:p,site:u,domain:m,blocklet:t})})]},_)]},_)})}),j.length>0&&e.jsx("div",{style:{marginLeft:"20px",marginTop:"12px"},children:e.jsx(V,{endIcon:i?e.jsx(he,{}):e.jsx(Je,{}),onClick:()=>c(!i),children:l(i?"common.collapseAll":"blocklet.router.showAllDomains")})}),!g.length&&(o?e.jsx(H,{size:16}):e.jsx(Ht,{children:l("common.empty")}))]})}Z.propTypes={hasPermission:r.bool,blocklet:r.object.isRequired,loadingRuntimeInfo:r.bool,inService:r.bool.isRequired,listOnly:r.bool};Z.defaultProps={hasPermission:!1,loadingRuntimeInfo:!1,listOnly:!1};function ie({domain:n,children:t,...o}){const{t:s}=E(),{href:a,accessibility:l}=n;return!l||l.loading?e.jsxs(ne,{...o,children:[t,e.jsx(F,{title:s("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx("span",{className:"status",children:e.jsx(H,{size:12})})})]}):l.accessible?e.jsx(ne,{...o,children:e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",children:t})}):e.jsx(ne,{...o,children:e.jsx(F,{title:s("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx("span",{children:t})})})}ie.propTypes={domain:X.isRequired,children:r.any.isRequired};const ne=Qe.span`
|
|
2
|
-
&,
|
|
3
|
-
& > * {
|
|
4
|
-
color: #222;
|
|
5
|
-
font-size: 18px;
|
|
6
|
-
word-break: break-all;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.status {
|
|
10
|
-
margin-left: 8px;
|
|
11
|
-
}
|
|
12
|
-
`;function re({hasMutatePermission:n,site:t,domain:o,blocklet:s}){const a=K(),{t:l}=E();return n&&!o.isProtected?e.jsx(we,{site:t,domain:o,blocklet:s}):e.jsx(F,{title:l("blocklet.router.domainLockTooltip"),placement:"top",children:e.jsx(zt,{disabled:!0,size:"large",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0},children:e.jsx(Wt,{style:{fill:a.palette.text.disabled}})})})}re.propTypes={hasMutatePermission:r.bool.isRequired,site:r.object.isRequired,domain:X.isRequired,blocklet:r.object.isRequired};function ae({siteId:n,domain:t,blocklet:o,hasMutatePermission:s}){const a=K(),{t:l}=E(),[i,c]=S.useState(null),d=u=>{c(u.currentTarget)},p=()=>{c(null)};return e.jsxs(h,{sx:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:1},children:[t.type==="nft-domain"&&e.jsxs(e.Fragment,{children:[e.jsx(oe,{onMouseEnter:d,onMouseLeave:p,style:{cursor:"pointer",fill:a.palette.primary.main}}),e.jsx(Ue,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:!!i,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:p,disableRestoreFocus:!0,children:e.jsx(We,{children:e.jsxs(He,{style:{display:"flex",flexDirection:"column"},children:[e.jsxs(T,{component:"div",style:{display:"flex",alignItems:"center"},children:[e.jsx(oe,{style:{fill:a.palette.primary.main}}),e.jsx(T,{component:"span",style:{marginLeft:"8px",fontSize:"18px",fontWeight:"bolder"},children:l("router.domainAlias.nftDomain")})]}),e.jsxs(T,{component:"div",style:{display:"flex",marginTop:"12px"},children:[e.jsx(T,{component:"span",style:{width:"80px",marginRight:"8px"},children:l("common.domain")}),e.jsx(T,{component:"span",children:t.value})]}),e.jsxs(T,{component:"div",style:{display:"flex"},children:[e.jsx(T,{component:"span",style:{width:"80px",marginRight:"8px"},children:"NFT"}),e.jsx(B,{did:t.nftDid})]})]})})})]}),e.jsx(Q,{domain:t,filters:["http"]},`${t.value}-http`),s&&e.jsx(ye,{siteId:n,domain:t.value,domainStatus:t.domainStatus,did:o.meta.did,children:({open:u})=>e.jsx(V,{sx:{padding:0},size:"small",onClick:g=>u(g),children:l("router.cert.genLetsEncryptCert.title")})})]})}ae.propTypes={siteId:r.string.isRequired,domain:X.isRequired,blocklet:r.object.isRequired,hasMutatePermission:r.bool.isRequired};const ao={arcblock:"ArcBlock",ethereum:"Ethereum"};function lo(){var j,C,k,R,f;const{t:n,locale:t}=E(),{info:o,inService:s}=U(),[a,l]=S.useState(!1),{blocklet:i}=ue(),{appDid:c,appPid:d,migratedFrom:p=[]}=i,u=(j=i.environments.find(b=>b.key==="BLOCKLET_APP_CHAIN_TYPE"))==null?void 0:j.value,g=[c?{name:n("blocklet.appId"),value:e.jsx(B,{did:c,showQrcode:!0})}:null,d?{name:n("blocklet.appPid"),value:e.jsx(B,{did:d,showQrcode:!0})}:null,(p==null?void 0:p.length)>1?{name:n("blocklet.alsoKnownAs"),value:e.jsxs("div",{children:[(a?p.slice(1):p.slice(1,2)).map(b=>e.jsx(B,{did:b.appDid,showQrcode:!0})),p.length>2&&e.jsx(V,{style:{marginLeft:"18px"},endIcon:a?e.jsx(he,{}):e.jsx(Je,{}),onClick:()=>l(!a),children:n(a?"common.collapseAll":"blocklet.router.showAllDIDs")})]})}:null,{name:n("common.name"),value:J.getDisplayName(i,!0)},{name:n("common.status"),value:e.jsx(Ot,{status:i.status,source:i.source,progress:i.progress})},Ke(i)?{name:"NFT",value:e.jsx(B,{external:!0,href:Ft((C=i==null?void 0:i.controller)==null?void 0:C.chainHost,(k=i==null?void 0:i.controller)==null?void 0:k.nftId,"asset"),did:(R=i==null?void 0:i.controller)==null?void 0:R.nftId,showQrcode:!0})}:null,{name:n("blocklet.installedAt"),value:Mt(i.installedAt,t)},{name:n("blocklet.overview.accessControl"),value:n(`team.whoCanAccess.${J.getWhoCanAccess(i)}.title`)},{name:n("common.owner"),value:(f=i.settings)!=null&&f.owner?e.jsx(B,{did:i.settings.owner.did,showQrcode:!0}):"-"},{name:n("blocklet.config.walletType.name"),value:ao[u||"arcblock"]||u},i.externalSkSource?{name:n("blocklet.skSource"),value:i.externalSkSource}:null].filter(Boolean);s&&g.push({name:n("common.serverDid"),value:e.jsx(B,{did:o.did,showQrcode:!0})},{name:n("common.serverVersion"),value:e.jsx(Bt,{children:o.version})});const P=b=>b.map(A=>e.jsx(Ge,{style:{display:"flex",alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:A.name,nameFormatter:()=>A.name,children:A.value},A.name));return e.jsxs(co,{component:"div",children:[e.jsx(Se,{}),e.jsx("div",{className:"title",children:e.jsx("span",{children:n("common.basicInfo")})}),e.jsx("div",{className:"basicInfo",children:P(g)})]})}lo.propTypes={};const co=Qe(T)`
|
|
13
|
-
.title {
|
|
14
|
-
font-size: 1.2rem;
|
|
15
|
-
font-weight: bold;
|
|
16
|
-
margin-top: ${n=>n.theme.spacing(5)};
|
|
17
|
-
margin-bottom: ${n=>n.theme.spacing(3)};
|
|
18
|
-
|
|
19
|
-
&.first {
|
|
20
|
-
margin-top: 0;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
`;export{lo as default};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import{P as x,j as c,O as S,d2 as F,fP as re,dM as be,r as D,bK as Me,cC as ot,q as nt,cj as We,fx as rt,fz as at,fU as st,dO as lt,fQ as ct,dN as dt,a2 as Ue,f8 as Be,g1 as ut,av as we,n as qe,cP as pt,g as Et,fa as bt,g2 as _t}from"./index-CkzoIPXc.js";import"./index-DBtfr-g8.js";function Te({optionalComponent:i,index:t,installStatus:a,hasPermission:l,t:b}){const _=()=>{window.open(i==null?void 0:i.installUrl,"_blank")},T=()=>{window.open(i==null?void 0:i.storeUrl,"_blank")},h=()=>{window.location.reload()},v=a==="stopped"||a==="running",I=60;return c.jsxs(S,{children:[t===0?null:c.jsx(S,{sx:{width:"100%",height:"1px",backgroundColor:F.gray6}}),c.jsxs(S,{sx:{padding:"20px 24px",paddingTop:.5,marginTop:2,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[c.jsx("img",{style:{width:I,height:I,minWidth:I,minHeight:I},src:i.logoUrl,alt:i.meta.title}),c.jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",marginLeft:2},children:[c.jsxs(S,{sx:{fontSize:"16px",fontWeight:"bold",cursor:"pointer",".link-icon":{opacity:0},":hover .link-icon":{opacity:1}},onClick:()=>{var O;return T((O=i.meta)==null?void 0:O.did)},children:[i.meta.title,c.jsxs(S,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[i.meta.version,c.jsx(re,{className:"link-icon",icon:"fluent:open-20-filled",style:{color:F.primaryBase,fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.3s"}})]})]}),c.jsx(S,{sx:{marginTop:0,opacity:.7},children:i.meta.description}),c.jsx(S,{sx:{display:l?"flex":"none",flexDirection:"row",gap:1},children:a?c.jsx(S,{sx:{marginTop:2,opacity:.7},children:v?c.jsx(be,{variant:"contained",onClick:h,children:b("componentInstallerRefresh")},"refresh"):c.jsx(be,{disabled:!0,sx:{color:"#333"},startIcon:c.jsx(re,{icon:"line-md:loading-loop",style:{color:"#333",fontSize:16}}),variant:"contained",children:a},"status")}):c.jsx(be,{sx:{marginTop:2},variant:"contained",className:"button",onClick:()=>{var O;return _((O=i.meta)==null?void 0:O.did)},children:b("componentInstallerInstall")},"install")}),v?c.jsx(S,{sx:{marginTop:2,opacity:.7},children:b("componentInstallerSuccessInstalled")}):null]})]})]})}Te.propTypes={t:x.func.isRequired,optionalComponent:x.object.isRequired,index:x.number.isRequired,installStatus:x.string,hasPermission:x.bool.isRequired};Te.defaultProps={installStatus:""};const mt={zh:{componentInstallerTitle:"缺少组件",componentInstallerInstall:"安装",componentInstallerClose:"关闭",componentInstallerRefresh:"重载页面",componentInstallerSuccessInstalled:"安装成功,请重载页面查看变化。",componentInstallerSuggestions:"请联系系统管理员安装该组件。",componentInstallerNoDefinedInBlockletYML:"组件未在 blocklet.yml 中定义"},en:{componentInstallerTitle:"Missing component",componentInstallerInstall:"Install",componentInstallerClose:"Close",componentInstallerRefresh:"Refresh",componentInstallerSuccessInstalled:"Successfully installed, please refresh the page to see the changes.",componentInstallerSuggestions:"Please contact the system administrator to install the component.",componentInstallerNoDefinedInBlockletYML:"The component is not defined in blocklet.yml"}},_e=i=>typeof i=="string"?new Set(i.split(";;")):new Set(i);function ft({did:i,onInstalled:t,onError:a}){const l=Array.isArray(i)?i.join(";;"):i,[b,_]=D.useState({}),T=D.useRef({onInstalled:t,onError:a});T.current={onInstalled:t,onError:a};const{optionalComponents:h,componentMountPoints:v}=window.blocklet,I=D.useMemo(()=>{var r;if(!h||!h.length)return[];const m=_e(l),e=h.filter(o=>m.has(o.meta.did));return(r=e?T.current.onError:T.current.onInstalled)==null||r(e),e},[l,h]),O=D.useMemo(()=>{if(I.length)return!0;const m=_e(l);return(v||[]).find(e=>m.has(e.did))},[I,v,l]);return I.forEach(m=>{m.storeUrl=Me(m.meta.homepage,"blocklets",m.meta.did),m.installUrl=Me(window.blocklet.appUrl,ot,`/admin/components?install-component=${m.meta.did}`)}),D.useEffect(()=>{const m=e=>{var r,o,n,s,L;if(e.origin===window.blocklet.appUrl&&((r=e.data)==null?void 0:r.kind)==="component-installer"&&(n=(o=e.data)==null?void 0:o.blocklet)!=null&&n.children){let k=!1;const u=_e(l);(L=(s=e.data)==null?void 0:s.blocklet)==null||L.children.forEach(d=>{var N;u.has((N=d.meta)==null?void 0:N.did)&&(k=!0,_(C=>{var B;return{...C,[(B=d.meta)==null?void 0:B.did]:d.status||"waiting"}}))}),k||_({})}};return window.addEventListener("message",m),()=>{window.removeEventListener("message",m)}},[l]),{optComponents:I,installed:!I.length&&O,installStatus:b,setInstallStatus:_,definedInBlockletYML:O}}function W({warnIcon:i,did:t,noPermissionMute:a,onInstalled:l,onError:b,children:_,closeByOutSize:T,onClose:h,fallback:v,disabled:I,roles:O=["owner","admin"]}){const{locale:m}=nt(),e=We((u,d={})=>rt(mt,u,m,"en",d)),{installed:r,optComponents:o,installStatus:n,definedInBlockletYML:s}=ft({did:t,onInstalled:l,onError:b}),L=D.useContext(at),k=()=>{h==null||h(!1)};return I?_:c.jsx(st,{session:L==null?void 0:L.session,roles:O,children:({hasPermission:u})=>r?_:a&&!u?v||null:typeof _=="function"?c.jsxs(c.Fragment,{children:[v,_({hasPermission:u,optComponents:o,installStatus:n})]}):c.jsxs(c.Fragment,{children:[v,c.jsx(lt,{onClickAway:d=>{d.preventDefault(),d.stopPropagation(),T&&k()},children:c.jsx(ct,{in:!0,timeout:350,children:c.jsx(dt,{variant:"outlined",sx:{position:"fixed",top:20,right:20,zIndex:3e3,borderRadius:3,width:400,maxWidth:"90vw",borderColor:F.lineStep,border:"0 !important",fontSize:"14px",textAlign:"left",boxShadow:`0px 8px 16px 0px ${F.gray6}, 0px 0px 0px 1px ${F.gray6}`},children:s?c.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[c.jsxs(S,{sx:{padding:"20px 24px",marginLeft:0,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"},children:[i||c.jsx(re,{icon:"mdi:warning-box",style:{color:"yellowgreen",fontSize:24}}),c.jsx(S,{sx:{marginLeft:1,fontSize:"16px",fontWeight:"bold"},children:e("componentInstallerTitle")}),c.jsx(S,{sx:{flex:1}}),h?c.jsx(Ue,{variant:"outlined",className:"button",onClick:k,children:c.jsx(Be,{})}):null]}),c.jsx(S,{sx:{width:"100%",height:"1px",backgroundColor:F.gray6}}),c.jsx(S,{sx:{maxHeight:"70vh",overflowY:"auto"},children:o.map((d,N)=>{var C,B;return c.jsx(Te,{t:e,hasPermission:u,index:N,optionalComponent:d,installStatus:n[(C=d.meta)==null?void 0:C.did]},((B=d.meta)==null?void 0:B.did)||N)})}),u?null:c.jsxs(c.Fragment,{children:[c.jsx(S,{sx:{width:"100%",height:"1px",backgroundColor:F.gray6}}),c.jsx(S,{sx:{padding:"20px 24px"},children:c.jsx(S,{sx:{opacity:1},children:e("componentInstallerSuggestions")})})]})]}):c.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[c.jsxs(S,{sx:{padding:"20px 24px",marginLeft:0,display:"flex",alignItems:"center",flexDirection:"row",justifyContent:"flex-start"},children:[i||c.jsx(re,{icon:"mdi:warning-box",style:{color:"yellowgreen",fontSize:24}}),c.jsx(S,{sx:{marginLeft:1,fontSize:"16px",fontWeight:"bold"},children:e("componentInstallerTitle")}),c.jsx(S,{sx:{flex:1}}),h?c.jsx(Ue,{variant:"outlined",className:"button",onClick:k,children:c.jsx(Be,{})}):null]}),c.jsx(S,{sx:{width:"100%",height:"1px",backgroundColor:F.gray6}}),c.jsxs(S,{sx:{padding:"20px 24px",marginTop:0},children:[e("componentInstallerNoDefinedInBlockletYML"),": ",t]})]})})})})]})})}W.propTypes={disabled:x.bool,warnIcon:x.node,did:x.oneOfType([x.string,x.arrayOf(x.string)]).isRequired,noPermissionMute:x.bool,onInstalled:x.func,onError:x.func,children:x.any.isRequired,closeByOutSize:x.bool,onClose:x.func,fallback:x.node,roles:x.array};W.defaultProps={disabled:!1,warnIcon:null,noPermissionMute:!1,onInstalled:null,onError:null,closeByOutSize:!1,onClose:null,fallback:null,roles:["owner","admin"]};function Ye(i){return window.blocklet?c.jsx(W,{...i}):i.children}Ye.propTypes={...W.propTypes,children:x.any.isRequired};Ye.defaultProps={...W.defaultProps};var ge={};Object.defineProperty(ge,"__esModule",{value:!0});var wt=ge.default=void 0;Tt(D);var je=c;function Tt(i){return i&&i.__esModule?i:{default:i}}function Fe(i,t){var a=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);t&&(l=l.filter(function(b){return Object.getOwnPropertyDescriptor(i,b).enumerable})),a.push.apply(a,l)}return a}function Ke(i){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?Fe(Object(a),!0).forEach(function(l){gt(i,l,a[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):Fe(Object(a)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(a,l))})}return i}function gt(i,t,a){return t=ht(t),t in i?Object.defineProperty(i,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[t]=a,i}function ht(i){var t=Ot(i,"string");return typeof t=="symbol"?t:String(t)}function Ot(i,t){if(typeof i!="object"||!i)return i;var a=i[Symbol.toPrimitive];if(a!==void 0){var l=a.call(i,t||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}var he=function(t){return(0,je.jsx)("svg",Ke(Ke({},t),{},{children:(0,je.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.25 10a6.75 6.75 0 1 1 13.5 0 6.75 6.75 0 0 1-13.5 0zM10 1.75a8.25 8.25 0 1 0 0 16.5 8.25 8.25 0 0 0 0-16.5zM8.03 6.97a.75.75 0 0 0-1.06 1.06l5 5a.75.75 0 1 0 1.06-1.06l-5-5z"})}))};he.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};he.displayName="revoke";wt=ge.default=he;x.any.isRequired,x.any.isRequired,x.string.isRequired,x.func.isRequired,x.any,x.any,x.number;D.createContext({});const Oe=Object.freeze({AUTH:"auth",AUTH_SERVICE:"@abtnode/auth-service"}),Rt=Object.freeze({AUTH_SERVICE:`/.service/${Oe.AUTH_SERVICE}`}),Re=Object.freeze({OWNER:"owner",ADMIN:"admin",MEMBER:"member",GUEST:"guest"}),w=Object.freeze({...Re,CI:"ci",CERTIFICATE:"certificate",BLOCKLET_OWNER:"blocklet-owner",BLOCKLET_ADMIN:"blocklet-admin",BLOCKLET_MEMBER:"blocklet-member",BLOCKLET_SDK:"blocklet-sdk",EXTERNAL_BLOCKLET_CONTROLLER:"external-blocklet-controller",EXTERNAL_BLOCKLETS_MANAGER:"external-blocklets-manager"}),Xe=[w.BLOCKLET_OWNER,w.BLOCKLET_ADMIN,w.BLOCKLET_MEMBER,w.BLOCKLET_SDK],St=i=>i&&Xe.includes(i),xt={USER:"user",OWNERSHIP_NFT:"ownership_nft",BLOCKLET_USER:"blocklet_user",BLOCKLET_CONTROLLER:"blocklet_controller"},vt={roles:Object.freeze([{name:w.OWNER,title:"Owner",description:"Has full administrative access to the Blocklet Server",passport:!0},{name:w.ADMIN,title:"Admin",description:"Has full permissions to manage blocklet and Blocklet Server such as install/remove/start/stop blocklet, manage blocklet URL mapping and certificates, manage blocklet team, manage node integrations and access keys, upgrade node to a new version",passport:!0},{name:w.MEMBER,title:"Member",description:"Has permissions to manage blocklets, such as install/remove/start/stop blocklet, manage blocklet URL mapping and certificates",passport:!0},{name:w.GUEST,title:"Guest",description:"Has all read permissions on Blocklet Server",passport:!0},{name:w.CI,title:"CI",description:"Deploy blocklet to Blocklet Server",passport:!0,noHuman:!0},{name:w.CERTIFICATE,title:"Certificate",description:"Manage https certificates for blocklets on the Blocklet Server",passport:!0,noHuman:!0},{name:w.BLOCKLET_OWNER,title:"Blocklet Owner"},{name:w.BLOCKLET_ADMIN,title:"Blocklet Admin"},{name:w.BLOCKLET_MEMBER,title:"Blocklet Member"},{name:w.BLOCKLET_SDK,title:"Blocklet SDK"},{name:w.EXTERNAL_BLOCKLET_CONTROLLER,title:"External Blocklet Controller"},{name:w.EXTERNAL_BLOCKLETS_MANAGER,title:"External Blocklets Manager",description:"Manage external blocklets in the Blocklet Server",passport:!0,noHuman:!0},{name:Oe.AUTH_SERVICE,title:"Auth Service"}]),permissions:Object.freeze([{name:"query_node",description:"View node data, include dashboard and node settings, log stream for both Blocklet Server and blocklets"},{name:"mutate_node",description:"Change node settings, upgrade node to a new version"},{name:"query_session",description:"Get data from a long running session"},{name:"mutate_session",description:"Start/update/end a long running session"},{name:"query_accessKey",description:"View access keys for Blocklet Server"},{name:"mutate_accessKey",description:"Manage access keys for Blocklet Server, such as create/update/delete"},{name:"query_team",description:"View team data(members/roles/permissions) for Blocklet Server and blocklets"},{name:"mutate_team",description:"Manage team data(members/roles/permissions) for Blocklet Server and blocklets"},{name:"query_blocklets",description:"View store and installed blocklets, including blocklet runtime configuration, domains and urls"},{name:"mutate_blocklets",description:"Perform state changing actions on blocklets, such as install/upgrade/config/start/stop/remove"},{name:"query_router",description:"View sites, URL mapping and certificates in service gateway"},{name:"mutate_router",description:"Manage sites, URL mapping and certificates in service gateway"},{name:"query_certificate",description:"View certificates in service gateway"},{name:"mutate_certificate",description:"Manage certificates in service gateway"},{name:"query_notification",description:"View notifications"},{name:"mutate_notification",description:"Manage notifications, such as mark notifications as read"},{name:"query_webhook",description:"View integrations"},{name:"mutate_webhook",description:"Manage integrations"},{name:"query_blocklet",description:"View a blocklet, including blocklet runtime configuration, domains and urls"},{name:"mutate_blocklet",description:"Perform state changing actions on a blocklet, such as upgrade/config/start/stop"}]),grants:Object.freeze({[w.GUEST]:["query_blocklets","query_router","query_webhook","query_notification","query_team","query_accessKey","query_node","query_session"],[w.MEMBER]:[w.GUEST,"mutate_blocklets","mutate_router","mutate_notification","mutate_session"],[w.ADMIN]:[w.MEMBER,"mutate_team","mutate_webhook","mutate_accessKey","mutate_node","mutate_certificate"],[w.OWNER]:[Re.ADMIN],[w.CI]:["query_blocklets","mutate_blocklets"],[w.CERTIFICATE]:["query_certificate","mutate_certificate"],[w.BLOCKLET_SDK]:["query_team","mutate_team","query_blocklet"],[w.BLOCKLET_OWNER]:[w.BLOCKLET_ADMIN],[w.BLOCKLET_ADMIN]:[w.BLOCKLET_MEMBER,"mutate_team","mutate_blocklet","mutate_notification"],[w.BLOCKLET_MEMBER]:["query_team","query_blocklet","query_notification"],[w.EXTERNAL_BLOCKLET_CONTROLLER]:["query_blocklets","mutate_blocklets"],[w.EXTERNAL_BLOCKLETS_MANAGER]:["query_blocklets","mutate_blocklets"]})},ze=24*60*60*1e3,At={NOTIFICATION_CREATE:"notification.create",NOTIFICATION_BLOCKLET_CREATE:"notification.blockletCreate",ROUTING_UPDATED:"routing.updated",NODE_UPDATED:"node.updated",NODE_MAINTAIN_PROGRESS:"node.upgrade.progress",NODE_STARTED:"node.started",NODE_STOPPED:"node.stopped",NODE_ADDED_OWNER:"node.addedOwner",NODE_RUNTIME_INFO:"node.runtimeInfo",BLOCKLETS_RUNTIME_INFO:"node.blockletsRuntimeInfo",DOMAIN_STATUS:"domain.status",CERT_ADDED:"cert.added",CERT_ISSUED:"cert.issued",CERT_UPDATED:"cert.updated",CERT_REMOVED:"cert.removed",CERT_ERROR:"cert.error",RELOAD_GATEWAY:"gateway.reload"},It={OWNER:"owner",INVITED:"invited",ALL:"all"},He="https://store.blocklet.dev",Ge="https://dev.store.blocklet.dev",Nt="https://main.abtnetwork.io/api/",Lt=Object.freeze({DERIVED:"derived",WALLET:"wallet"}),kt={STATUS:{PROGRESS:null,SUCCEEDED:0,FAILED:1},TIMEOUT_HOURS:6,STRATEGY:{AUTO:0,MANUAL:1},JOB:{INTERVAL:2*60*60}},Ct={STATUS:{PROGRESS:null,SUCCEEDED:0,FAILED:1},TIMEOUT_HOURS:6,STRATEGY:{AUTO:0,MANUAL:1},JOB:{INTERVAL:2*60*60}},Ze=10,yt=86400/Ze,Dt={SYNC_LIMIT:3},Pt=[{text:"Plain Text",value:"text/plain"},{text:"JSON",value:"application/json"},{text:"XML",value:"application/xml"},{text:"HTML Document",value:"text/html"},{text:"YAML",value:"application/x-yaml"},{text:"TOML",value:"application/toml"},{text:"CSS",value:"text/css"},{text:"JavaScript",value:"application/javascript"},{text:"CSV",value:"text/csv"},{text:"Markdown",value:"text/markdown"},{text:"SVG",value:"image/svg+xml"}],Mt=Object.freeze({created:0,selected:10,connected:20,paid:30,nftMinted:35,allocated:40,consuming:46,installed:50,expired:60,terminated:70,timeout:80,transferred:90});var U=Object.freeze({NODE_MODES:Object.freeze({PRODUCTION:"production",DEBUG:"debug",MAINTENANCE:"maintenance",SERVERLESS:"serverless"}),DEFAULT_DESCRIPTION:"Web Interface to manage your Blocklet Server",NODE_MAINTAIN_PROGRESS:Object.freeze({SETUP:"setup",INSTALLING:"installing",VERIFYING:"verifying",RESTARTING:"restarting",CLEANUP:"cleanup",COMPLETE:"complete",ROLLBACK:"rollback"}),VC_TYPE_BLOCKLET_PURCHASE:"BlockletPurchaseCredential",VC_TYPE_NODE_PASSPORT:"ABTNodePassport",VC_TYPE_GENERAL_PASSPORT:"NFTPassport",NFT_TYPE_SERVER_OWNERSHIP:"BlockletServerOwnershipNFT",NFT_TYPE_SERVERLESS:"BlockletServerServerlessNFT",NODE_PACKAGE_NAME:"@abtnode/cli",NODE_COMMAND_NAME:"abtnode",NODE_DATA_DIR_NAME:"_abtnode",USER_AVATAR_DIR:"/.assets/avatar",USER_AVATAR_URL_PREFIX:"bn://avatar",USER_AVATAR_PATH_PREFIX:"/user/avatar",PROCESS_NAME_DAEMON:"abt-node-daemon",PROCESS_NAME_PROXY:"abt-node-db-hub",PROCESS_NAME_UPDATER:"abt-node-updater",PROCESS_NAME_SERVICE:"abt-node-service",PROCESS_NAME_ROUTER:"abt-node-router",PROCESS_NAME_LOG_ROTATE:"abt-node-log-rotate",PROCESS_NAME_EVENT_HUB:"abt-node-event-hub",NODE_REGISTER_URL:"https://install.arcblock.io/",WEB_WALLET_URL:"https://web.abtwallet.io",BLOCKLET_STORE_URL:He,BLOCKLET_STORE_URL_DEV:Ge,BLOCKLET_STORE_API_PREFIX:"/api",BLOCKLET_STORE_API_BLOCKLET_PREFIX:"/api/blocklets",BLOCKLET_STORE_META_PATH:"/api/store.json",BLOCKLET_STORE:{id:"zNKqX7D8ZAYa77HgzpoFfnV3BFbcmSRrE9aT",name:"Official Store",description:"ArcBlock official blocklet registry",url:He,logoUrl:"/logo.png",maintainer:"arcblock"},BLOCKLET_STORE_DEV:{id:"zNKmfUatDhzfMVACfr3u97eqndj8f1yXXw3m",name:"Dev Store",description:"ArcBlock dev registry that contains demo and example blocklets",url:Ge,maintainer:"arcblock",logoUrl:"/logo.png"},APP_STRUCT_VERSION:"2",DEFAULT_DID_REGISTRY:"https://registry.abtnet.io",DEFAULT_SLP_DOMAIN:"slp.abtnet.io",DEFAULT_DID_DOMAIN:"did.abtnet.io",DEFAULT_IP_DOMAIN:"*.ip.abtnet.io",DEFAULT_IP_DOMAIN_SUFFIX:"ip.abtnet.io",DEFAULT_WILDCARD_CERT_HOST:"https://releases.arcblock.io/",DEFAULT_NFT_DOMAIN_URL:"https://domain.didlabs.org/",DEFAULT_CERTIFICATE_EMAIL:"certs@arcblock.io",CONFIG_FILENAME:"config.yml",CONFIG_FILENAME_OLD:"abtnode.yml",CONFIG_FOLDER_NAME:".blocklet-server",CONFIG_FOLDER_NAME_OLD:".abtnode",EXPORTED_FOLDER_NAME:"exported_blocklet_server",StatusCode:Object.freeze({ok:0,blocklet_not_found:1,blocklet_not_purchased:2,forbidden:403,internal:500,timeout:504}),IP:new RegExp("-(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\-(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}"),DOMAIN_FOR_IP_SITE:"",DOMAIN_FOR_IP_SITE_REGEXP:"~^\\d+.\\d+.\\d+.\\d+$",DOMAIN_FOR_DEFAULT_SITE:"*",DOMAIN_FOR_INTERNAL_SITE:"127.0.0.1",NAME_FOR_WELLKNOWN_SITE:"wellknown",WELLKNOWN_PATH_PREFIX:"/.well-known",WELLKNOWN_ACME_CHALLENGE_PREFIX:"/.well-known/acme-challenge",WELLKNOWN_DID_RESOLVER_PREFIX:"/.well-known/did.json",WELLKNOWN_PING_PREFIX:"/.well-known/ping",WELLKNOWN_ANALYTICS_PREFIX:"/.well-known/analytics",WELLKNOWN_SERVICE_PATH_PREFIX:"/.well-known/service",WELLKNOWN_BLOCKLET_ADMIN_PATH:"/.well-known/service/admin",WELLKNOWN_BLOCKLET_HEALTH_PATH:"/.well-known/service/health",WELLKNOWN_BLOCKLET_LOGO_PATH:"/.well-known/service/blocklet/logo",SLOT_FOR_IP_DNS_SITE:"888-888-888-888",DEFAULT_ADMIN_PATH:"/admin",WELLKNOWN_SERVER_ADMIN_PATH:"/.well-known/server/admin",DEFAULT_SERVICE_PATH:"/.abtnode/service",DEFAULT_HTTP_PORT:80,DEFAULT_HTTPS_PORT:443,MAX_UPLOAD_FILE_SIZE:500,DEFAULT_DAEMON_PORT:8089,MAX_NGINX_WORKER_CONNECTIONS:10240,BLOCKLET_PROXY_PATH_PREFIX:"/.blocklet/proxy",BLOCKLET_SITE_GROUP_SUFFIX:".blocklet-domain-group",DAY_IN_MS:ze,DAEMON_MAX_MEM_LIMIT_IN_MB:800,PROXY_MAX_MEM_LIMIT_IN_MB:800,BLOCKLET_MAX_MEM_LIMIT_IN_MB:800,CERTIFICATE_EXPIRES_OFFSET:10*ze,ROUTING_RESPONSE_TYPES:Pt,ROUTING_RULE_TYPES:Object.freeze({NONE:"none",DAEMON:"daemon",SERVICE:"service",BLOCKLET:"blocklet",REDIRECT:"redirect",GENERAL_REWRITE:"rewrite",GENERAL_PROXY:"general_proxy",DIRECT_RESPONSE:"direct_response",COMPONENT:"component"}),ROLES:Re,SERVER_ROLES:w,BLOCKLET_ROLES:Xe,isBlockletRole:St,AUTH_CERT_TYPE:xt,RBAC_CONFIG:vt,genPermissionName:(i,t="access")=>`${t}_${i.replace("_","-")}`,PASSPORT_STATUS:{VALID:"valid",REVOKED:"revoked"},NODE_SERVICES:Oe,NODE_SERVICES_PREFIX:Rt,DISK_ALERT_THRESHOLD_PERCENT:80,EVENTS:At,WHO_CAN_ACCESS:It,WHO_CAN_ACCESS_PREFIX_ROLES:"roles:",GATEWAY_REQ_LIMIT:Object.freeze({min:10,max:100}),STORE_DETAIL_PAGE_PATH_PREFIX:"/blocklets",MAX_USER_PAGE_SIZE:100,SERVER_STATUS:{RUNNING:1,STOPPED:2,START_FROM_CRASH:3},LOG_RETAIN_IN_DAYS:60,BLOCKLET_INSTALL_TYPE:{STORE:"store",URL:"url",DEV:"dev",CREATE:"create",RESTORE:"restore"},ROUTER_CACHE_GROUPS:{blockletProxy:{minSize:"1m",maxSize:"2g",period:"30d"}},MAIN_CHAIN_ENDPOINT:Nt,USER_TYPE:Lt,SERVER_CACHE_TTL:300*1e3,BLOCKLET_CACHE_TTL:3600*1e3,SESSION_CACHE_TTL:3600,SESSION_TTL:7*86400,BACKUPS:kt,CHECK_UPDATE:Ct,MONITOR_HISTORY_LENGTH:yt,MONITOR_RECORD_INTERVAL_SEC:Ze,INSTALL_ACTIONS:{INSTALL:"install",INSTALL_COMPONENT:"installComponent",UPGRADE_COMPONENT:"upgradeComponent"},COPYRIGHT_OWNER:"ArcBlock",FEDERATED:Dt,SESSION_TOKEN_STORAGE_KEY:"login_token",REFRESH_TOKEN_STORAGE_KEY:"refresh_token",LAUNCH_SESSION_STATUS:Mt,UNOWNED_DID:"z".repeat(35),STUDIO_CONNECTED_STORE:"studio_connected_store"});/*! js-cookie v3.0.5 | MIT */function ie(i){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)i[l]=a[l]}return i}var Ut={read:function(i){return i[0]==='"'&&(i=i.slice(1,-1)),i.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(i){return encodeURIComponent(i).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function me(i,t){function a(b,_,T){if(!(typeof document>"u")){T=ie({},t,T),typeof T.expires=="number"&&(T.expires=new Date(Date.now()+T.expires*864e5)),T.expires&&(T.expires=T.expires.toUTCString()),b=encodeURIComponent(b).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var h="";for(var v in T)T[v]&&(h+="; "+v,T[v]!==!0&&(h+="="+T[v].split(";")[0]));return document.cookie=b+"="+i.write(_,b)+h}}function l(b){if(!(typeof document>"u"||arguments.length&&!b)){for(var _=document.cookie?document.cookie.split("; "):[],T={},h=0;h<_.length;h++){var v=_[h].split("="),I=v.slice(1).join("=");try{var O=decodeURIComponent(v[0]);if(T[O]=i.read(I,O),b===O)break}catch{}}return b?T[b]:T}}return Object.create({set:a,get:l,remove:function(b,_){a(b,"",ie({},_,{expires:-1}))},withAttributes:function(b){return me(this.converter,ie({},this.attributes,b))},withConverter:function(b){return me(ie({},this.converter,b),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(i)}})}var ne=me(Ut,{path:"/"}),Bt=Object.defineProperty,jt=(i,t,a)=>t in i?Bt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[t]=a,Ft=(i,t,a)=>(jt(i,typeof t!="symbol"?t+"":t,a),a);class Kt{constructor({api:t}){Ft(this,"api"),this.api=t}async getUserPublicInfo({did:t}){const{data:a}=await this.api.get("/api/user",{params:{did:t}});return a}async getUserPrivacyConfig({did:t}){const{data:a}=await this.api.get("/api/user/privacy/config",{params:{did:t}});return a}async saveUserPrivacyConfig(t){const{data:a}=await this.api.post("/api/user/privacy/config",t);return a}async getUserNotificationConfig(){const{data:t}=await this.api.get("/api/user/notification/config");return t}async saveUserNotificationConfig(t){const{data:a}=await this.api.post("/api/user/notification/config",t);return a}async testNotificationWebhook(t){const{data:a}=await this.api.put("/api/user/notification/webhook",t);return a}async getProfileUrl({did:t,locale:a}){const l=`${U.WELLKNOWN_SERVICE_PATH_PREFIX}/user`;return ut(l,{did:t,locale:a})}async logout({visitorId:t}){const{data:a}=await this.api.post("/api/user/logout",{visitorId:t});return a}}class zt{getSessionToken(){return ne.get(U.SESSION_TOKEN_STORAGE_KEY)}setSessionToken(t){ne.set(U.SESSION_TOKEN_STORAGE_KEY,t)}removeSessionToken(){ne.remove(U.SESSION_TOKEN_STORAGE_KEY)}getRefreshToken(){return localStorage.getItem(U.REFRESH_TOKEN_STORAGE_KEY)}setRefreshToken(t){localStorage.setItem(U.REFRESH_TOKEN_STORAGE_KEY,t)}removeRefreshToken(){localStorage.removeItem(U.REFRESH_TOKEN_STORAGE_KEY)}}var Ht=Object.defineProperty,Gt=(i,t,a)=>t in i?Ht(i,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[t]=a,Vt=(i,t,a)=>(Gt(i,typeof t!="symbol"?t+"":t,a),a);class Wt{constructor({api:t}){Vt(this,"api"),this.api=t}async getUserSessions({did:t}){const{data:a}=await this.api.get("/api/user-session",{params:{userDid:t}});return a}}const qt="1.16.26",Yt=(i=0)=>new Promise(t=>{setTimeout(()=>{t()},i)}),Je=i=>`Bearer ${encodeURIComponent(i)}`,Xt="__visitor_id",Zt=()=>localStorage.getItem(Xt);async function Ve(i,t=300){i.metaData.endTime=+new Date;const{startTime:a,endTime:l}=i.metaData,b=l-a;b<t&&await Yt(t-b),delete i.metaData}const $e=(i,t)=>{const a={...i==null?void 0:i.headers,"x-blocklet-js-sdk-version":qt},l=Zt();[void 0,null].includes(l)||(a["x-blocklet-visitor-id"]=l);const b=we.create({...i,headers:a});return t!=null&&t.lazy&&(b.interceptors.request.use(_=>(_.metaData={startTime:+new Date},_),_=>Promise.reject(_)),b.interceptors.response.use(async _=>(await Ve(_.config,t==null?void 0:t.lazyTime),_),async _=>(await Ve(_.response.config,t==null?void 0:t.lazyTime),Promise.reject(_)))),b};async function Jt(i){if(!i)throw new Error("Refresh token not found");const t=$e({baseURL:U.WELLKNOWN_SERVICE_PATH_PREFIX,timeout:10*1e3,headers:{authorization:Je(i)}}),{data:a}=await t.post("/api/did/refreshSession");return a}function $t({getSessionToken:i,setSessionToken:t,removeSessionToken:a,getRefreshToken:l,setRefreshToken:b,removeRefreshToken:_,onRefreshTokenError:T,onRefreshTokenSuccess:h},v,I){let O=null;const m=$e({timeout:30*1e3,...v},I);return m.interceptors.request.use(async e=>{if(!ne.get(U.SESSION_TOKEN_STORAGE_KEY)){const r=i();r&&(e.headers.authorization=Je(r))}return O&&await O,e},e=>Promise.reject(e)),m.interceptors.response.use(e=>e,async e=>{var o;const r=e.config;if(r.headers={...r==null?void 0:r.headers},((o=e==null?void 0:e.response)==null?void 0:o.status)===401&&!r._retry){r._retry=!0;try{O||(O=Jt(l()));const n=await O;return t(n.nextToken),b(n.nextRefreshToken),typeof h=="function"&&h(n),m(r)}catch(n){return a(),_(),typeof T=="function"&&T(n),Promise.reject(e)}finally{O=null}}return Promise.reject(e)}),m}var Qt=Object.defineProperty,ei=(i,t,a)=>t in i?Qt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[t]=a,oe=(i,t,a)=>(ei(i,typeof t!="symbol"?t+"":t,a),a);class ti{constructor(){oe(this,"api"),oe(this,"user"),oe(this,"userSession"),oe(this,"token");const t=new zt,a=$t({getSessionToken:t.getSessionToken,setSessionToken:t.setSessionToken,removeSessionToken:t.removeSessionToken,getRefreshToken:t.getRefreshToken,setRefreshToken:t.setRefreshToken,removeRefreshToken:t.removeRefreshToken,onRefreshTokenError:()=>{console.error("Failed to refresh token")},onRefreshTokenSuccess:()=>{}},{baseURL:U.WELLKNOWN_SERVICE_PATH_PREFIX});this.user=new Kt({api:a}),this.userSession=new Wt({api:a}),this.token=t,this.api=a}}const ai=new ti;we.defaults.timeout=10*1e3;we.create();qe(S)`
|
|
2
|
-
.selected-container {
|
|
3
|
-
position: absolute;
|
|
4
|
-
right: 0px;
|
|
5
|
-
bottom: 0px;
|
|
6
|
-
display: flex;
|
|
7
|
-
-webkit-box-pack: end;
|
|
8
|
-
justify-content: flex-end;
|
|
9
|
-
align-items: flex-end;
|
|
10
|
-
width: 32px;
|
|
11
|
-
height: 32px;
|
|
12
|
-
border-radius: 0px 0px 8px;
|
|
13
|
-
color: rgb(255, 255, 255);
|
|
14
|
-
overflow: hidden;
|
|
15
|
-
transition: all 0.4s ease 0s;
|
|
16
|
-
|
|
17
|
-
&::after {
|
|
18
|
-
position: absolute;
|
|
19
|
-
z-index: 0;
|
|
20
|
-
left: 60px;
|
|
21
|
-
top: 60px;
|
|
22
|
-
display: block;
|
|
23
|
-
width: 0px;
|
|
24
|
-
height: 0px;
|
|
25
|
-
border-width: 16px;
|
|
26
|
-
border-style: solid;
|
|
27
|
-
border-color: transparent #1dc1c7 #1dc1c7 transparent;
|
|
28
|
-
transition: all 0.1s ease 0s;
|
|
29
|
-
content: '';
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.selected-icon {
|
|
33
|
-
visibility: hidden;
|
|
34
|
-
width: 60%;
|
|
35
|
-
height: 60%;
|
|
36
|
-
position: relative;
|
|
37
|
-
z-index: 2;
|
|
38
|
-
margin: 0px 1px 1px 0px;
|
|
39
|
-
font-size: 16px;
|
|
40
|
-
transition: all 0.2s ease 0s;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.selected-container.selected {
|
|
45
|
-
&::after {
|
|
46
|
-
left: 0px;
|
|
47
|
-
top: 0px;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.selected-icon {
|
|
51
|
-
visibility: visible;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
`;qe(S)`
|
|
55
|
-
height: 100%;
|
|
56
|
-
overflow-y: auto;
|
|
57
|
-
`;var fe={exports:{}};(function(i,t){(function(a,l){var b="1.0.37",_="",T="?",h="function",v="undefined",I="object",O="string",m="major",e="model",r="name",o="type",n="vendor",s="version",L="architecture",k="console",u="mobile",d="tablet",N="smarttv",C="wearable",B="embedded",ae=500,q="Amazon",H="Apple",Se="ASUS",xe="BlackBerry",K="Browser",Y="Chrome",Qe="Edge",X="Firefox",Z="Google",ve="Huawei",se="LG",le="Microsoft",Ae="Motorola",J="Opera",$="Samsung",Ie="Sharp",Q="Sony",ce="Xiaomi",de="Zebra",Ne="Facebook",Le="Chromium OS",ke="Mac OS",et=function(f,R){var E={};for(var A in f)R[A]&&R[A].length%2===0?E[A]=R[A].concat(f[A]):E[A]=f[A];return E},ee=function(f){for(var R={},E=0;E<f.length;E++)R[f[E].toUpperCase()]=f[E];return R},Ce=function(f,R){return typeof f===O?G(R).indexOf(G(f))!==-1:!1},G=function(f){return f.toLowerCase()},tt=function(f){return typeof f===O?f.replace(/[^\d\.]/g,_).split(".")[0]:l},ue=function(f,R){if(typeof f===O)return f=f.replace(/^\s\s*/,_),typeof R===v?f:f.substring(0,ae)},V=function(f,R){for(var E=0,A,j,P,g,p,M;E<R.length&&!p;){var Ee=R[E],Pe=R[E+1];for(A=j=0;A<Ee.length&&!p&&Ee[A];)if(p=Ee[A++].exec(f),p)for(P=0;P<Pe.length;P++)M=p[++j],g=Pe[P],typeof g===I&&g.length>0?g.length===2?typeof g[1]==h?this[g[0]]=g[1].call(this,M):this[g[0]]=g[1]:g.length===3?typeof g[1]===h&&!(g[1].exec&&g[1].test)?this[g[0]]=M?g[1].call(this,M,g[2]):l:this[g[0]]=M?M.replace(g[1],g[2]):l:g.length===4&&(this[g[0]]=M?g[3].call(this,M.replace(g[1],g[2])):l):this[g]=M||l;E+=2}},pe=function(f,R){for(var E in R)if(typeof R[E]===I&&R[E].length>0){for(var A=0;A<R[E].length;A++)if(Ce(R[E][A],f))return E===T?l:E}else if(Ce(R[E],f))return E===T?l:E;return f},it={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},ye={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},De={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[s,[r,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[s,[r,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[r,s],[/opios[\/ ]+([\w\.]+)/i],[s,[r,J+" Mini"]],[/\bopr\/([\w\.]+)/i],[s,[r,J]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[s,[r,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[r,s],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[s,[r,"UC"+K]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[s,[r,"WeChat"]],[/konqueror\/([\w\.]+)/i],[s,[r,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[s,[r,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[s,[r,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[s,[r,"Smart Lenovo "+K]],[/(avast|avg)\/([\w\.]+)/i],[[r,/(.+)/,"$1 Secure "+K],s],[/\bfocus\/([\w\.]+)/i],[s,[r,X+" Focus"]],[/\bopt\/([\w\.]+)/i],[s,[r,J+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[s,[r,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[s,[r,"Dolphin"]],[/coast\/([\w\.]+)/i],[s,[r,J+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[s,[r,"MIUI "+K]],[/fxios\/([-\w\.]+)/i],[s,[r,X]],[/\bqihu|(qi?ho?o?|360)browser/i],[[r,"360 "+K]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[r,/(.+)/,"$1 "+K],s],[/samsungbrowser\/([\w\.]+)/i],[s,[r,$+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[r,/_/g," "],s],[/metasr[\/ ]?([\d\.]+)/i],[s,[r,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[r,"Sogou Mobile"],s],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[r,s],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[r],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[r,Ne],s],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[r,s],[/\bgsa\/([\w\.]+) .*safari\//i],[s,[r,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[s,[r,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[s,[r,Y+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[r,Y+" WebView"],s],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[s,[r,"Android "+K]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[r,s],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[s,[r,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[s,r],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[r,[s,pe,it]],[/(webkit|khtml)\/([\w\.]+)/i],[r,s],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[r,"Netscape"],s],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[s,[r,X+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[r,s],[/(cobalt)\/([\w\.]+)/i],[r,[s,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[L,"amd64"]],[/(ia32(?=;))/i],[[L,G]],[/((?:i[346]|x)86)[;\)]/i],[[L,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[L,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[L,"armhf"]],[/windows (ce|mobile); ppc;/i],[[L,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[L,/ower/,_,G]],[/(sun4\w)[;\)]/i],[[L,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[L,G]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[e,[n,$],[o,d]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[e,[n,$],[o,u]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[e,[n,H],[o,u]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[e,[n,H],[o,d]],[/(macintosh);/i],[e,[n,H]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[e,[n,Ie],[o,u]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[e,[n,ve],[o,d]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[e,[n,ve],[o,u]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[e,/_/g," "],[n,ce],[o,u]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[e,/_/g," "],[n,ce],[o,d]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[e,[n,"OPPO"],[o,u]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[e,[n,"Vivo"],[o,u]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[e,[n,"Realme"],[o,u]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[e,[n,Ae],[o,u]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[e,[n,Ae],[o,d]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[e,[n,se],[o,d]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[e,[n,se],[o,u]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[e,[n,"Lenovo"],[o,d]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[e,/_/g," "],[n,"Nokia"],[o,u]],[/(pixel c)\b/i],[e,[n,Z],[o,d]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[e,[n,Z],[o,u]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[e,[n,Q],[o,u]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[e,"Xperia Tablet"],[n,Q],[o,d]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[e,[n,"OnePlus"],[o,u]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[e,[n,q],[o,d]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[e,/(.+)/g,"Fire Phone $1"],[n,q],[o,u]],[/(playbook);[-\w\),; ]+(rim)/i],[e,n,[o,d]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[e,[n,xe],[o,u]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[e,[n,Se],[o,d]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[e,[n,Se],[o,u]],[/(nexus 9)/i],[e,[n,"HTC"],[o,d]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[n,[e,/_/g," "],[o,u]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[e,[n,"Acer"],[o,d]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[e,[n,"Meizu"],[o,u]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[e,[n,"Ulefone"],[o,u]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[n,e,[o,u]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[n,e,[o,d]],[/(surface duo)/i],[e,[n,le],[o,d]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[e,[n,"Fairphone"],[o,u]],[/(u304aa)/i],[e,[n,"AT&T"],[o,u]],[/\bsie-(\w*)/i],[e,[n,"Siemens"],[o,u]],[/\b(rct\w+) b/i],[e,[n,"RCA"],[o,d]],[/\b(venue[\d ]{2,7}) b/i],[e,[n,"Dell"],[o,d]],[/\b(q(?:mv|ta)\w+) b/i],[e,[n,"Verizon"],[o,d]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[e,[n,"Barnes & Noble"],[o,d]],[/\b(tm\d{3}\w+) b/i],[e,[n,"NuVision"],[o,d]],[/\b(k88) b/i],[e,[n,"ZTE"],[o,d]],[/\b(nx\d{3}j) b/i],[e,[n,"ZTE"],[o,u]],[/\b(gen\d{3}) b.+49h/i],[e,[n,"Swiss"],[o,u]],[/\b(zur\d{3}) b/i],[e,[n,"Swiss"],[o,d]],[/\b((zeki)?tb.*\b) b/i],[e,[n,"Zeki"],[o,d]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[n,"Dragon Touch"],e,[o,d]],[/\b(ns-?\w{0,9}) b/i],[e,[n,"Insignia"],[o,d]],[/\b((nxa|next)-?\w{0,9}) b/i],[e,[n,"NextBook"],[o,d]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[n,"Voice"],e,[o,u]],[/\b(lvtel\-)?(v1[12]) b/i],[[n,"LvTel"],e,[o,u]],[/\b(ph-1) /i],[e,[n,"Essential"],[o,u]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[e,[n,"Envizen"],[o,d]],[/\b(trio[-\w\. ]+) b/i],[e,[n,"MachSpeed"],[o,d]],[/\btu_(1491) b/i],[e,[n,"Rotor"],[o,d]],[/(shield[\w ]+) b/i],[e,[n,"Nvidia"],[o,d]],[/(sprint) (\w+)/i],[n,e,[o,u]],[/(kin\.[onetw]{3})/i],[[e,/\./g," "],[n,le],[o,u]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[e,[n,de],[o,d]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[e,[n,de],[o,u]],[/smart-tv.+(samsung)/i],[n,[o,N]],[/hbbtv.+maple;(\d+)/i],[[e,/^/,"SmartTV"],[n,$],[o,N]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[n,se],[o,N]],[/(apple) ?tv/i],[n,[e,H+" TV"],[o,N]],[/crkey/i],[[e,Y+"cast"],[n,Z],[o,N]],[/droid.+aft(\w+)( bui|\))/i],[e,[n,q],[o,N]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[e,[n,Ie],[o,N]],[/(bravia[\w ]+)( bui|\))/i],[e,[n,Q],[o,N]],[/(mitv-\w{5}) bui/i],[e,[n,ce],[o,N]],[/Hbbtv.*(technisat) (.*);/i],[n,e,[o,N]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[n,ue],[e,ue],[o,N]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[o,N]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[n,e,[o,k]],[/droid.+; (shield) bui/i],[e,[n,"Nvidia"],[o,k]],[/(playstation [345portablevi]+)/i],[e,[n,Q],[o,k]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[e,[n,le],[o,k]],[/((pebble))app/i],[n,e,[o,C]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[e,[n,H],[o,C]],[/droid.+; (glass) \d/i],[e,[n,Z],[o,C]],[/droid.+; (wt63?0{2,3})\)/i],[e,[n,de],[o,C]],[/(quest( 2| pro)?)/i],[e,[n,Ne],[o,C]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[n,[o,B]],[/(aeobc)\b/i],[e,[n,q],[o,B]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[e,[o,u]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[e,[o,d]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[o,d]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[o,u]],[/(android[-\w\. ]{0,9});.+buil/i],[e,[n,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[s,[r,Qe+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[s,[r,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[r,s],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[s,r]],os:[[/microsoft (windows) (vista|xp)/i],[r,s],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[r,[s,pe,ye]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[s,pe,ye],[r,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[s,/_/g,"."],[r,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[r,ke],[s,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[s,r],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[r,s],[/\(bb(10);/i],[s,[r,xe]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[s,[r,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[s,[r,X+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[s,[r,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[s,[r,"watchOS"]],[/crkey\/([\d\.]+)/i],[s,[r,Y+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[r,Le],s],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[r,s],[/(sunos) ?([\w\.\d]*)/i],[[r,"Solaris"],s],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[r,s]]},y=function(f,R){if(typeof f===I&&(R=f,f=l),!(this instanceof y))return new y(f,R).getResult();var E=typeof a!==v&&a.navigator?a.navigator:l,A=f||(E&&E.userAgent?E.userAgent:_),j=E&&E.userAgentData?E.userAgentData:l,P=R?et(De,R):De,g=E&&E.userAgent==A;return this.getBrowser=function(){var p={};return p[r]=l,p[s]=l,V.call(p,A,P.browser),p[m]=tt(p[s]),g&&E&&E.brave&&typeof E.brave.isBrave==h&&(p[r]="Brave"),p},this.getCPU=function(){var p={};return p[L]=l,V.call(p,A,P.cpu),p},this.getDevice=function(){var p={};return p[n]=l,p[e]=l,p[o]=l,V.call(p,A,P.device),g&&!p[o]&&j&&j.mobile&&(p[o]=u),g&&p[e]=="Macintosh"&&E&&typeof E.standalone!==v&&E.maxTouchPoints&&E.maxTouchPoints>2&&(p[e]="iPad",p[o]=d),p},this.getEngine=function(){var p={};return p[r]=l,p[s]=l,V.call(p,A,P.engine),p},this.getOS=function(){var p={};return p[r]=l,p[s]=l,V.call(p,A,P.os),g&&!p[r]&&j&&j.platform!="Unknown"&&(p[r]=j.platform.replace(/chrome os/i,Le).replace(/macos/i,ke)),p},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return A},this.setUA=function(p){return A=typeof p===O&&p.length>ae?ue(p,ae):p,this},this.setUA(A),this};y.VERSION=b,y.BROWSER=ee([r,s,m]),y.CPU=ee([L]),y.DEVICE=ee([e,n,o,k,u,N,d,C,B]),y.ENGINE=y.OS=ee([r,s]),i.exports&&(t=i.exports=y),t.UAParser=y;var z=typeof a!==v&&(a.jQuery||a.Zepto);if(z&&!z.ua){var te=new y;z.ua=te.getResult(),z.ua.get=function(){return te.getUA()},z.ua.set=function(f){te.setUA(f);var R=te.getResult();for(var E in R)z.ua[E]=R[E]}}})(typeof window=="object"?window:pt)})(fe,fe.exports);var ii=fe.exports;const si=Et(ii);function oi({src:i,open:t=!1,componentDid:a,loading:l=!0,storeUrl:b,onClose:_=()=>{},onComplete:T=()=>{},onLoad:h=()=>{}},v){const I=D.useRef(null),O=We(m=>{var e,r,o;t&&(((e=m==null?void 0:m.data)==null?void 0:e.event)==="resourceDialog.close"&&_(),((r=m==null?void 0:m.data)==null?void 0:r.event)==="resourceDialog.complete"&&T(),((o=m==null?void 0:m.data)==null?void 0:o.event)==="resourceDialog.loaded"&&h())});return bt(()=>{window.addEventListener("message",O)}),_t(()=>{window.removeEventListener("message",O)}),D.useImperativeHandle(v,()=>({selectBlocklet:m=>{var e;(e=I.current)!=null&&e.contentWindow&&I.current.contentWindow.postMessage({event:"resourceDialog.select",data:m,componentDid:a,storeUrl:b},"*")}})),t?c.jsx("iframe",{ref:I,src:i,title:"Resource Dialog",style:{position:"fixed",top:0,left:l?"-100vw":0,width:"100vw",height:"100vh",zIndex:9999,backgroundColor:"transparent",border:"none"}}):null}D.forwardRef(oi);export{si as U,Ye as W,ai as c,wt as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as m,f as l,M as s,j as o,P as a}from"./index-CkzoIPXc.js";import{T as c,M as n,t as u}from"./table-icons-B2dymBbK.js";import"./FilterList-nvbrBFgI.js";import"./Select-BazOq14-.js";import"./Delete-DXKhZTtc.js";import"./InputLabel-Bb9-Zb4y.js";import"./TextField-CedO329E.js";import"./LastPage-b5Zg6Pue.js";import"./slicedToArray-Bc32ss_C.js";import"./Search-DifTFgaN.js";import"./actions-DnYxUqme.js";import"./useLocalStorage-BG3mT3Wr.js";import"./MoreVert--N-SWxBs.js";import"./ButtonGroup-CbxNRMKE.js";import"./getValidReactChildren-qfgxz0Xv.js";import"./url-evaluation-ClVD1OGC.js";import"./tag-Bd5v37NR.js";import"./ChevronLeft-Cf-5wtBt.js";import"./Edit-CbzkqV44.js";import"./ChevronRight-BaQf9l-O.js";import"./DeleteOutline-DkrRhsKv.js";import"./redux-ELJtQoC2.js";import"./Skeleton-DzFzNaqT.js";import"./InputAdornment-Bz3jTEed.js";import"./index-B6TlGEJh.js";import"./memoize-one.esm-BdPwpGay.js";import"./Add-DdfKyAdP.js";import"./ArrowDropDown-qBw97pL-.js";function d({blocklet:i,...r}){const{t}=m.useContext(l),e=s.getBlockletServices(i);if(e.length===0)return o.jsx("div",{children:t("blocklet.noService")});const p=[{title:t("common.name"),field:"name"},{title:t("common.protocol"),field:"protocol"},{title:t("common.port"),field:"port"},{title:t("blocklet.upstreamPort"),field:"upstreamPort"}];return o.jsx(c,{...r,children:o.jsx(n,{columns:p,icons:{...u},options:{sorting:!1,emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",search:!1,pageSize:1e3,pageSizeOptions:[1e3]},localization:{body:{emptyDataSourceMessage:t("blocklet.noService")}},data:e})})}d.propTypes={blocklet:a.object.isRequired};export{d as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as d,b6 as i,bK as s,$ as l}from"./index-CkzoIPXc.js";import{a as n}from"./api-Cex76yJU.js";function S(a){const t=a.replace(/\/api\/space\/.+/,""),r=a.replace(/\/$/,"").split("/"),e=r.at(-4),c=r.at(-2);return s(t,"space",e,"apps",c,`explorer?key=/apps/${c}/.did-objects/${c}/`)}function U(a){const t=a.replace(/\/api\/space\/.+/,""),e=a.replace(/\/$/,"").split("/").at(-4);return s(t,"space",e)}function m(a){return a.replace(/\/$/,"").split("/").at(-4)}async function P(a){try{if(!i(a))return!1;const{headers:t}=await n.head(a,{timeout:5e3});return t["x-listable"]==="true"&&t["x-readable"]==="true"&&t["x-writeable"]==="true"}catch(t){return console.error(t),!1}}function C(a){var t;return((t=a==null?void 0:a.find(r=>r.key===d.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT))==null?void 0:t.value)||""}function y(a){return a==null?void 0:a.replace(/\/api\/space\/.+/,"")}function h(a){const t=new URL(a);return s(t.origin,t.pathname)}async function A(a){try{if(!i(a))return!1;const t=h(a),r=s(t,"space/api/did/one-click-authorization/token"),{status:e,data:c}=await n.get(r,{timeout:5e3});return e===200&&l.isObject(c)}catch(t){return console.error(t),!1}}async function D(a,{timeout:t}={timeout:3e3}){try{if(!i(a))return"";const{headers:r}=await n.head(a,{timeout:t}),e=r["x-space-name"];return e?decodeURIComponent(e):""}catch(r){return console.error(r),""}}function L(a){const t=a.replace(/\/api\/space\/.+/,""),e=a.replace(/\/$/,"").split("/").at(-4);return s(t,`/api/space/nft/display?spaceDid=${e}`)}const _=a=>{var t,r;return((r=(t=a==null?void 0:a.configs)==null?void 0:t.find(e=>e.key===d.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:r.value)||null};async function x(a){const t={};return t.did=m(a),t.name=await D(a),t.url=y(a),t.endpoint=a,t}async function $(a,t={timeout:3e4,withSearchParams:!0}){var u;if(!l.isString(a))throw new Error(`url(${a}) must be a string`);const r=a.startsWith("http")?a:`https://${a}`,e=new URL(r),{data:c}=await n.get(s(e.origin,"/__blocklet__.js?type=json"),{timeout:t.timeout}),o=(u=c.componentMountPoints.findLast(f=>f.did==="z8iZnaYxnkMD5AKRjTKiCb8pQr1ut8UantAcf"))==null?void 0:u.mountPoint;if(!o)throw new Error(`MountPoint(${o}) not found`);const p=s(e.origin,o);return t.withSearchParams&&e.searchParams.get("spaceDid")?s(p,`?spaceDid=${e.searchParams.get("spaceDid")}`):p}export{D as a,C as b,_ as c,x as d,L as e,m as f,$ as g,h,A as i,U as j,S as k,P as l};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aC as u,b as h,F as d}from"./index-CkzoIPXc.js";import{i as l}from"./InfoOutlined-BaBR5WTh.js";const 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},c=(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")))},p=({params:e,blocklets:r,blocklet:t,locale:o="en"})=>{if(t){let i=(t.children||[]).find(a=>u.hasStartEngine(a.meta)&&l(a.mountPoint,e.pathPrefix));if(t.meta.group!=="gateway"&&e.pathPrefix==="/"&&(i="/"),i)return{zh:`挂载点 ${e.pathPrefix} 已存在,请使用其他挂载点`,en:`The mount point ${e.pathPrefix} already exist, please use another mount point`}[o]}const f=r.find(i=>i.meta.did===e.did);if(!f)return"";const n=f.meta.interfaces.find(i=>i.type==="web");return n&&n.prefix!==h.BLOCKLET_DYNAMIC_PATH_PREFIX&&e.pathPrefix!==n.prefix?{zh:`该 blocklet 只能挂载在 ${n.prefix}`,en:`This blocklet can only be mounted on ${n.prefix}`}[o]:""},R=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{c as a,R as p,p as v};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cH as r,cI as i,bo as e,j as _,cJ as u}from"./index-CkzoIPXc.js";const a={en:r(i),ar:()=>e(()=>import("./ar-BKJrehco.js"),[],import.meta.url).then(t=>r(t.default)),de:()=>e(()=>import("./de-Byp7vRl4.js"),[],import.meta.url).then(t=>r(t.default)),es:()=>e(()=>import("./es-O_BI7nAs.js"),[],import.meta.url).then(t=>r(t.default)),fr:()=>e(()=>import("./fr-DyVRrA5G.js"),[],import.meta.url).then(t=>r(t.default)),hi:()=>e(()=>import("./hi-BpaB7ujL.js"),[],import.meta.url).then(t=>r(t.default)),id:()=>e(()=>import("./id-D7fl0yX3.js"),[],import.meta.url).then(t=>r(t.default)),ja:()=>e(()=>import("./ja-xLR8soVq.js"),[],import.meta.url).then(t=>r(t.default)),ko:()=>e(()=>import("./ko-CdC91nMA.js"),[],import.meta.url).then(t=>r(t.default)),pt:()=>e(()=>import("./pt-CrWN8vvS.js"),[],import.meta.url).then(t=>r(t.default)),ru:()=>e(()=>import("./ru-DYnq26fF.js"),[],import.meta.url).then(t=>r(t.default)),th:()=>e(()=>import("./th-Bfmczss9.js"),[],import.meta.url).then(t=>r(t.default)),vi:()=>e(()=>import("./vi-Cyl8BHvR.js"),[],import.meta.url).then(t=>r(t.default)),"zh-TW":()=>e(()=>import("./zh-tw-BSAV-ffK.js"),[],import.meta.url).then(t=>r(t.default)),zh:()=>e(()=>import("./zh-Dttm4AuY.js"),[],import.meta.url).then(t=>r(t.default))};function p(t){return function(o){return _.jsx(u,{translations:a,children:_.jsx(t,{...o})})}}export{p as w};
|