@abtnode/webapp 1.16.49-beta-20250829-075052-2563fcb3 → 1.16.49
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/{AdapterDayjs-DEjpOuYM.js → AdapterDayjs-DimT2cks.js} +1 -1
- package/dist/assets/{Add-ZXw0xLrb.js → Add-B2ZDVqat.js} +1 -1
- package/dist/assets/ArrowDropDown-DTUdke6O.js +1 -0
- package/dist/assets/{Autocomplete-CK-9Ss3q.js → Autocomplete-B6hdnAbf.js} +1 -1
- package/dist/assets/{Breadcrumbs-TCiC4Qkr.js → Breadcrumbs-C0NyAgW3.js} +1 -1
- package/dist/assets/{ButtonGroup-QoT5b0rj.js → ButtonGroup-BxZjrpDd.js} +1 -1
- package/dist/assets/{CSSTransition-Cjz4QCFv.js → CSSTransition-D9w1WbTD.js} +1 -1
- package/dist/assets/{CallMerge-Bn5ZQujz.js → CallMerge-CT9kGdYw.js} +1 -1
- package/dist/assets/{CardContent-NiCok_GZ.js → CardContent-DZQbbzze.js} +1 -1
- package/dist/assets/{ChevronLeft-WevXcbvT.js → ChevronLeft-C1WpAw9J.js} +1 -1
- package/dist/assets/{ChevronRight-DAJ57fQY.js → ChevronRight-BHex1y5g.js} +1 -1
- package/dist/assets/{Clear-BMrit09h.js → Clear-CY2XI9UL.js} +1 -1
- package/dist/assets/{DeleteOutline-B_ebn78a.js → DeleteOutline-DCwd4zu5.js} +1 -1
- package/dist/assets/{Done-BssJlxXF.js → Done-DvjnHsf4.js} +1 -1
- package/dist/assets/{Edit-DvJ7niyi.js → Edit-CQvdC-gs.js} +1 -1
- package/dist/assets/{ErrorOutline-keam6I0v.js → ErrorOutline-3x65gte5.js} +1 -1
- package/dist/assets/{FilterList-BpQVWjO7.js → FilterList-C7CgIPm8.js} +1 -1
- package/dist/assets/{Google-CuTp6K5l.js → Google-Bli8mQj2.js} +1 -1
- package/dist/assets/{HelpOutline-c9xWNXYj.js → HelpOutline-DK_qkp2M.js} +1 -1
- package/dist/assets/{Launch-C19ynGFM.js → Launch-Cazur-Fl.js} +1 -1
- package/dist/assets/{Link-OosiOUml.js → Link-B32ARgrh.js} +1 -1
- package/dist/assets/{ListItemButton-D3mT9pyo.js → ListItemButton-BOWa6EsK.js} +1 -1
- package/dist/assets/{ListSubheader-JaIza3kA.js → ListSubheader-59vUoVIT.js} +1 -1
- package/dist/assets/{LoadingButton-Bu-RMxo0.js → LoadingButton-ClNP4uj0.js} +1 -1
- package/dist/assets/{MoreVert-DCZ34SEU.js → MoreVert-Dnv5meLi.js} +1 -1
- package/dist/assets/{OpenInNew-qPio7v19.js → OpenInNew-CVZ7jhVw.js} +1 -1
- package/dist/assets/{Refresh-KVD21gJ3.js → Refresh-BU7QWHYu.js} +1 -1
- package/dist/assets/{Search-Bu66uiUL.js → Search-CviyP5PC.js} +1 -1
- package/dist/assets/{Slider-SLDVySsH.js → Slider-DEcPJiVm.js} +1 -1
- package/dist/assets/{Stepper-D9KKzkTp.js → Stepper-BXOkpPZl.js} +1 -1
- package/dist/assets/{Switch-D1I5dz3C.js → Switch-C_vix7qp.js} +1 -1
- package/dist/assets/{TableSearch-MDaph9_3.js → TableSearch-Dsfp_XUr.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-CLtFaWIk.js → ToggleButtonGroup-BRuEkEDq.js} +1 -1
- package/dist/assets/{Verified-CEUKiCvL.js → Verified-C1OHOKpp.js} +1 -1
- package/dist/assets/{VerifiedUser-CHrqY4DV.js → VerifiedUser-C0M9SrH7.js} +1 -1
- package/dist/assets/{ViewList-CKoaOL8s.js → ViewList-_seGVlfH.js} +1 -1
- package/dist/assets/{_createAggregator-YIpAp9ni.js → _createAggregator-s6UGbWKk.js} +1 -1
- package/dist/assets/{actions-CyCFMA6d.js → actions-BTM30cO2.js} +1 -1
- package/dist/assets/{actions-Fl5IcNig.js → actions-DaFcSF4Q.js} +1 -1
- package/dist/assets/{agreement-DlFMZUIl.js → agreement-DSL1Z9Z4.js} +1 -1
- package/dist/assets/api-BDClPnhH.js +1 -0
- package/dist/assets/{appearance-BliwBII_.js → appearance-B5Fxj0pt.js} +1 -1
- package/dist/assets/{audit-logs-Dt3Zm8Yo.js → audit-logs-DfhTX_zm.js} +1 -1
- package/dist/assets/{base-chart-Cgo222Iz.js → base-chart-CUBovNRp.js} +1 -1
- package/dist/assets/{blocklet-By8mMht1.js → blocklet-Clk0KDdY.js} +1 -1
- package/dist/assets/{chain-3qQXGmRA.js → chain-Bpi260c_.js} +1 -1
- package/dist/assets/{click-to-copy-BTxnhIi6.js → click-to-copy-BZWirPDQ.js} +1 -1
- package/dist/assets/client-BeAJe0yS.js +1 -0
- package/dist/assets/cloneDeep-BPw0K7hq.js +1 -0
- package/dist/assets/{collapse-Te61TlLa.js → collapse-BOYOLC_4.js} +1 -1
- package/dist/assets/{config-navigation-CK3bpGBt.js → config-navigation-BEIEFUiN.js} +46 -46
- package/dist/assets/connect-to-CKfgySWf.js +30 -0
- package/dist/assets/{cssMode-CjZUDAr9.js → cssMode-B5RVclx-.js} +1 -1
- package/dist/assets/{delete-confirm-B7t36usI.js → delete-confirm-BrhseXop.js} +1 -1
- package/dist/assets/{depsEqual-BvgcJ7Lu.js → depsEqual-msOq5b5x.js} +1 -1
- package/dist/assets/{detail-6E-dkGL-.js → detail-BlLW7YjN.js} +3 -3
- package/dist/assets/{domains-B_IwXIbE.js → domains-C_4AnOp5.js} +1 -1
- package/dist/assets/{download-BGGdBoo-.js → download-DY09iblB.js} +1 -1
- package/dist/assets/{edit.svg-C_SspFrp.js → edit.svg-D-BTMQSd.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-B-0g7s2E.js +1 -0
- package/dist/assets/engine-CjGipQ8H.js +1 -0
- package/dist/assets/{freemarker2-W5A6lREg.js → freemarker2-qOqeJDqa.js} +1 -1
- package/dist/assets/{get-safe-url-Ddlf6-ls.js → get-safe-url-0GDhhKMb.js} +1 -1
- package/dist/assets/getValidReactChildren-CS8vN0Dc.js +1 -0
- package/dist/assets/{graphqlMode-Dc1_ukwq.js → graphqlMode-K6gJ3gBf.js} +2 -2
- package/dist/assets/{handlebars-CVB3APXr.js → handlebars-CpCfM6TO.js} +1 -1
- package/dist/assets/{html-JqjfPaeH.js → html-fUKduY5C.js} +1 -1
- package/dist/assets/{html-title-Bzc9ddB_.js → html-title-HtPlSvGf.js} +1 -1
- package/dist/assets/{htmlMode-BU01m9PW.js → htmlMode-B-5GmxUH.js} +1 -1
- package/dist/assets/{iframe-toMt-kqs.js → iframe-CiaMOw3l.js} +1 -1
- package/dist/assets/{index-Ba-NPtma.js → index--IDE3zqS.js} +1 -1
- package/dist/assets/{index-B6-mWTPF.js → index-31DGwfk5.js} +4 -4
- package/dist/assets/{index-B6fAmfbh.js → index-B09qWXEi.js} +1 -1
- package/dist/assets/{index-BF3lDsjk.js → index-B58pv6JK.js} +1 -1
- package/dist/assets/{index-DQfEOUZ1.js → index-BCDhEJAj.js} +1 -1
- package/dist/assets/{index-Y3OPWyRK.js → index-BMlarUaU.js} +1 -1
- package/dist/assets/{index-Ga4GQQwB.js → index-BQl82i43.js} +1 -1
- package/dist/assets/{index-0wnayxHS.js → index-BVwfeTfE.js} +1 -1
- package/dist/assets/{index-DTA3-trG.js → index-BcMFt6jn.js} +3 -3
- package/dist/assets/{index-BpslFkWB.js → index-BcVAgGLo.js} +1 -1
- package/dist/assets/{index-cyH3qxmb.js → index-BhIGrRjA.js} +1 -1
- package/dist/assets/{index-sVwZa-Us.js → index-BniP3-Ka.js} +2 -2
- package/dist/assets/{index-CXToIdzn.js → index-BuNutR9F.js} +1 -1
- package/dist/assets/{index-Dg5xaFaR.js → index-Bz1WmE2z.js} +1 -1
- package/dist/assets/index-C0cmjlmK.js +363 -0
- package/dist/assets/{index-CPzdonhn.js → index-C21lcN-6.js} +3 -3
- package/dist/assets/{index-cJ8mqL4n.js → index-CB3gF2be.js} +1 -1
- package/dist/assets/{index-RR0ylab2.js → index-CB6io54J.js} +1 -1
- package/dist/assets/{index-CTSgdYTQ.js → index-CEcRkbK_.js} +1 -1
- package/dist/assets/{index-W_FxxPkG.js → index-C_Fk7Rzr.js} +1 -1
- package/dist/assets/{index-BfnW7izn.js → index-C_i8vZPM.js} +1 -1
- package/dist/assets/{index-CEs-_h3p.js → index-Cp668Jsm.js} +471 -468
- package/dist/assets/{index-aaIwkeLh.js → index-Cs7boeoz.js} +1 -1
- package/dist/assets/{index-BFArq4QY.js → index-CwANiKOk.js} +1 -1
- package/dist/assets/{index-CfKAChZk.js → index-D1AKo-x3.js} +1 -1
- package/dist/assets/{index-DkZuQt-p.js → index-DCr9iA79.js} +1 -1
- package/dist/assets/{index-D0yM2V0B.js → index-DGDwJTNO.js} +1 -1
- package/dist/assets/{index-BRFV_6XG.js → index-DLs4lvkb.js} +1 -1
- package/dist/assets/{index-Bb_IBo4s.js → index-DMSf9VmZ.js} +1 -1
- package/dist/assets/{index-Aruj3q0j.js → index-DNBJ_q-W.js} +1 -1
- package/dist/assets/index-DWCHUGMU.js +1 -0
- package/dist/assets/{index-DDa-PgAC.js → index-De5Caszn.js} +1 -1
- package/dist/assets/{index-BOoA_8JB.js → index-DiVM7PAR.js} +1 -1
- package/dist/assets/{index-8IOOvVIH.js → index-Dm676q-V.js} +1 -1
- package/dist/assets/{index-9QWNsjgH.js → index-N8fONOxR.js} +9 -9
- package/dist/assets/{index-wXVKNPUK.js → index-NeEbDyYj.js} +1 -1
- package/dist/assets/{index-BLjRs6Ba.js → index-QEEYyfjs.js} +1 -1
- package/dist/assets/{index-0QY3J8oX.js → index-Rr_K0vXu.js} +1 -1
- package/dist/assets/{index-DJvxZ00R.js → index-daIR3ecn.js} +2 -2
- package/dist/assets/{index-0IGVpdYK.js → index-k6Jydhg7.js} +1 -1
- package/dist/assets/{index-DWcByat0.js → index-n4_kY89C.js} +1 -1
- package/dist/assets/{index-BReYGikN.js → index-nbCQMVdu.js} +1 -1
- package/dist/assets/{index-40xZF0CX.js → index-sz3uFV7b.js} +1 -1
- package/dist/assets/{index-Onb6C8Vx.js → index-tE5HA0JS.js} +1 -1
- package/dist/assets/{index-MedijPFp.js → index-wdj0FEUp.js} +3 -3
- package/dist/assets/{index.esm-BUUAAL09.js → index.esm-BWXMXe80.js} +1 -1
- package/dist/assets/{install-from-url-CGq8j4wF.js → install-from-url-CvXm7zrQ.js} +1 -1
- package/dist/assets/{invitation-vC0PSQ_r.js → invitation-Bbd0EUPN.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-BEgzcrKA.js → is-path-prefix-equal-9dPZdPqq.js} +1 -1
- package/dist/assets/{item-BkJpv1Bb.js → item-Czk-LxVv.js} +1 -1
- package/dist/assets/{javascript-CGqww4TO.js → javascript-Df4-_tCH.js} +1 -1
- package/dist/assets/{jsonMode-CPjnv_mU.js → jsonMode-lPvmVuEc.js} +1 -1
- package/dist/assets/{liquid-BUJogEZ3.js → liquid-iErrkmsS.js} +1 -1
- package/dist/assets/{list-header-CC4bqg_J.js → list-header-D9Jtipco.js} +1 -1
- package/dist/assets/{log-DgeUtrB_.js → log-D_Iy4G-2.js} +1 -1
- package/dist/assets/{lottie-react.esm-cJsgfzzd.js → lottie-react.esm-CLF_w70g.js} +1 -1
- package/dist/assets/{mdx-4nWtXnPd.js → mdx-CpiXAgeN.js} +1 -1
- package/dist/assets/{memory-D5iAd2IO.js → memory-0tMnFTeS.js} +1 -1
- package/dist/assets/{metric-DJsad5Cf.js → metric-Blz-YEnp.js} +1 -1
- package/dist/assets/omit-kqOgzbK4.js +1 -0
- package/dist/assets/{overview-DKy33514.js → overview-DQoppCkb.js} +1 -1
- package/dist/assets/{permission-9QXWzXg1.js → permission-Dq4G1Nhn.js} +1 -1
- package/dist/assets/{preference-DHg_HxRj.js → preference-5drfcglD.js} +3 -3
- package/dist/assets/{python-D4feWuz2.js → python-DXxIcyYN.js} +1 -1
- package/dist/assets/{raf-schd.esm-BrPOppB7.js → raf-schd.esm-le4x5qzb.js} +1 -1
- package/dist/assets/{razor-L3ctEfp9.js → razor-DEo7ceFX.js} +1 -1
- package/dist/assets/{rotate-session-key-CA9ENqfL.js → rotate-session-key-omld1AuK.js} +1 -1
- package/dist/assets/{runtime-BGqVXEzJ.js → runtime-myPRlwBo.js} +1 -1
- package/dist/assets/schema-B6D_WZyG.js +1 -0
- package/dist/assets/sdk-BbOdEeFV.js +1 -0
- package/dist/assets/{service-BmVdIXDk.js → service-M1mmil55.js} +1 -1
- package/dist/assets/{shorten-label-9dGUasPc.js → shorten-label-Dwsld825.js} +1 -1
- package/dist/assets/{simple-select-D22jL4Z4.js → simple-select-C7PnNUpe.js} +1 -1
- package/dist/assets/{spaces-CrjBCgnE.js → spaces-Dz6osU8D.js} +1 -1
- package/dist/assets/{status-DJy3aS5P.js → status-DC_uFdhU.js} +1 -1
- package/dist/assets/{status-DXxPNVJi.js → status-Dk7whVRe.js} +1 -1
- package/dist/assets/{switch-control-vwKpD-hx.js → switch-control-Dg5zSUdo.js} +1 -1
- package/dist/assets/{table-icons-BNwdYNHR.js → table-icons-jOs3s3dQ.js} +1 -1
- package/dist/assets/{team-DRiDufJD.js → team-D3LeaCxJ.js} +1 -1
- package/dist/assets/{toLower-Bx5_jlnW.js → toLower-D7KlZyXh.js} +1 -1
- package/dist/assets/toUpper-j7Or1KIp.js +1 -0
- package/dist/assets/{traffic-CAjpS6xG.js → traffic-Dh32_ebe.js} +1 -1
- package/dist/assets/{tsMode-Co-fr-VC.js → tsMode-BXE5NTFR.js} +1 -1
- package/dist/assets/{typescript-pLJSjS9f.js → typescript-Cyw-SWET.js} +1 -1
- package/dist/assets/{url-evaluation-Dx7Up5AZ.js → url-evaluation-ZlHZwvb8.js} +1 -1
- package/dist/assets/{url-join-BdgYWkAo.js → url-join-BaK21hdG.js} +1 -1
- package/dist/assets/{use-mobile-Bfe2NQYE.js → use-mobile-DmPwZVyR.js} +1 -1
- package/dist/assets/{use-mobile-CfF2Dwfb.js → use-mobile-fb1R4sTD.js} +1 -1
- package/dist/assets/{useAsync-Cx9qmI1n.js → useAsync-mK5hkfXk.js} +1 -1
- package/dist/assets/{useAsyncRetry-BCDpfxkE.js → useAsyncRetry-Bz9aJRiB.js} +1 -1
- package/dist/assets/{useLocalStorage-ZXHKUuQ3.js → useLocalStorage-D39oHiv_.js} +1 -1
- package/dist/assets/{useThemeProps-CgnjFBCx.js → useThemeProps-CEesX7e5.js} +1 -1
- package/dist/assets/{util-BDHNyUKP.js → util-B3o9CH5x.js} +1 -1
- package/dist/assets/{wait-container-CtaPbMQB.js → wait-container-Cq-OhUMI.js} +1 -1
- package/dist/assets/{without-wallet-BGmbjqUT.js → without-wallet-BK9y4GG-.js} +1 -1
- package/dist/assets/{wrap-locale-FW1OiiQu.js → wrap-locale-BDWmzfGR.js} +1 -1
- package/dist/assets/{xml-tX57m6nM.js → xml-C7AOEa-o.js} +1 -1
- package/dist/assets/{yaml-fstMoHtX.js → yaml-D87QX20d.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-S7J75cd9.js +0 -1
- package/dist/assets/api-1uVGKylc.js +0 -1
- package/dist/assets/client-powqd2q0.js +0 -1
- package/dist/assets/cloneDeep-Cj2I-3EJ.js +0 -1
- package/dist/assets/connect-to-gjBtyZwF.js +0 -29
- package/dist/assets/emotion-cache.browser.esm-CN4wN0Q-.js +0 -1
- package/dist/assets/engine-CifWoWKx.js +0 -1
- package/dist/assets/getValidReactChildren-Y4g3roaS.js +0 -1
- package/dist/assets/index-C6jlNrOG.js +0 -363
- package/dist/assets/index-Crk_Rkot.js +0 -1
- package/dist/assets/omit-BQvRKGhV.js +0 -1
- package/dist/assets/schema-Bwrwlo2F.js +0 -1
- package/dist/assets/sdk-BASq25ZU.js +0 -1
- package/dist/assets/toUpper-CPtDcnc2.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bX as W,bW as V,r as y,bY as G,j as e,h2 as Bt,b8 as X,b_ as Y,b$ as Q,bU as Ke,h3 as Te,av as ve,aG as Je,f7 as et,y as ae,h4 as Ft,z as Nt,c_ as tt,d0 as zt,m as S,cq as $t,cr as ne,h5 as Ht,$ as Ot,N as x,C as N,b7 as _t,T,X as de,q as ue,f as Z,F as me,az as E,b1 as nt,h6 as Wt,aY as ot,O as Vt,bn as L,e as Gt,b as Be,ad as pe,H as M,o,v as fe,aS as Xt,U as st,aF as Yt,a9 as Qt,b2 as Zt,h as Kt,b3 as Fe,b0 as Jt,bz as en,g$ as it,b4 as rt,cj as Ce,aV as O,dI as at,h7 as tn,b5 as nn,fF as lt,gm as ke,s as on,h8 as ct,h9 as sn,ha as rn,dw as dt,hb as an,bd as ln,hc as cn,L as dn,hd as H,Y as z,J as le,he as un,aW as mn,dG as oe,Z as Ne,t as pn,aR as fn,hf as xn}from"./index-CEs-_h3p.js";import{y as hn}from"./index-DDa-PgAC.js";import{u as gn}from"./useAsync-Cx9qmI1n.js";import{u as K}from"./blocklet-By8mMht1.js";import{w as ut}from"./permission-9QXWzXg1.js";import{D as mt}from"./url-evaluation-Dx7Up5AZ.js";import{A as yn}from"./actions-CyCFMA6d.js";import{D as Dn}from"./delete-confirm-B7t36usI.js";import{D as ze}from"./status-DJy3aS5P.js";import{S as bn,V as jn}from"./VerifiedUser-CHrqY4DV.js";import{C as vn}from"./CardContent-NiCok_GZ.js";import{A as Cn}from"./Add-ZXw0xLrb.js";import{A as wn}from"./CallMerge-Bn5ZQujz.js";import{a as Rn}from"./toLower-Bx5_jlnW.js";import{u as Sn}from"./use-mobile-CfF2Dwfb.js";import{v as Tn}from"./index-BFArq4QY.js";import{g as kn,p as $e}from"./util-BDHNyUKP.js";import{O as An}from"./OpenInNew-qPio7v19.js";import{C as In}from"./click-to-copy-BTxnhIi6.js";import{L as pt}from"./LoadingButton-Bu-RMxo0.js";import{u as Pn}from"./index-Crk_Rkot.js";import"./is-path-prefix-equal-BEgzcrKA.js";import"./engine-CifWoWKx.js";function qn(t){return W("MuiTable",t)}V("MuiTable",["root","stickyHeader"]);const Mn=t=>{const{classes:n,stickyHeader:s}=t;return Q({root:["root",s&&"stickyHeader"]},qn,n)},En=X("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,n)=>{const{ownerState:s}=t;return[n.root,s.stickyHeader&&n.stickyHeader]}})(Ke(({theme:t})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...t.typography.body2,padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:n})=>n.stickyHeader,style:{borderCollapse:"separate"}}]}))),He="table",Ln=y.forwardRef(function(n,s){const a=G({props:n,name:"MuiTable"}),{className:i,component:r=He,padding:c="normal",size:l="medium",stickyHeader:d=!1,...p}=a,f={...a,component:r,padding:c,size:l,stickyHeader:d},u=Mn(f),g=y.useMemo(()=>({padding:c,size:l,stickyHeader:d}),[c,l,d]);return e.jsx(Bt.Provider,{value:g,children:e.jsx(En,{as:r,role:r===He?null:"table",ref:s,className:Y(u.root,i),ownerState:f,...p})})});function Un(t){return W("MuiTableBody",t)}V("MuiTableBody",["root"]);const Bn=t=>{const{classes:n}=t;return Q({root:["root"]},Un,n)},Fn=X("tbody",{name:"MuiTableBody",slot:"Root"})({display:"table-row-group"}),Nn={variant:"body"},Oe="tbody",zn=y.forwardRef(function(n,s){const a=G({props:n,name:"MuiTableBody"}),{className:i,component:r=Oe,...c}=a,l={...a,component:r},d=Bn(l);return e.jsx(Te.Provider,{value:Nn,children:e.jsx(Fn,{className:Y(d.root,i),as:r,ref:s,role:r===Oe?null:"rowgroup",ownerState:l,...c})})});function $n(t){return W("MuiTableContainer",t)}V("MuiTableContainer",["root"]);const Hn=t=>{const{classes:n}=t;return Q({root:["root"]},$n,n)},On=X("div",{name:"MuiTableContainer",slot:"Root"})({width:"100%",overflowX:"auto"}),_n=y.forwardRef(function(n,s){const a=G({props:n,name:"MuiTableContainer"}),{className:i,component:r="div",...c}=a,l={...a,component:r},d=Hn(l);return e.jsx(On,{ref:s,as:r,className:Y(d.root,i),ownerState:l,...c})});function Wn(t){return W("MuiTableHead",t)}V("MuiTableHead",["root"]);const Vn=t=>{const{classes:n}=t;return Q({root:["root"]},Wn,n)},Gn=X("thead",{name:"MuiTableHead",slot:"Root"})({display:"table-header-group"}),Xn={variant:"head"},_e="thead",Yn=y.forwardRef(function(n,s){const a=G({props:n,name:"MuiTableHead"}),{className:i,component:r=_e,...c}=a,l={...a,component:r},d=Vn(l);return e.jsx(Te.Provider,{value:Xn,children:e.jsx(Gn,{as:r,className:Y(d.root,i),ref:s,role:r===_e?null:"rowgroup",ownerState:l,...c})})});function Qn(t){return W("MuiTableRow",t)}const We=V("MuiTableRow",["root","selected","hover","head","footer"]),Zn=t=>{const{classes:n,selected:s,hover:a,head:i,footer:r}=t;return Q({root:["root",s&&"selected",a&&"hover",i&&"head",r&&"footer"]},Qn,n)},Kn=X("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(t,n)=>{const{ownerState:s}=t;return[n.root,s.head&&n.head,s.footer&&n.footer]}})(Ke(({theme:t})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${We.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${We.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:ve(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:ve(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}}))),Ve="tr",Ge=y.forwardRef(function(n,s){const a=G({props:n,name:"MuiTableRow"}),{className:i,component:r=Ve,hover:c=!1,selected:l=!1,...d}=a,p=y.useContext(Te),f={...a,component:r,hover:c,selected:l,head:p&&p.variant==="head",footer:p&&p.variant==="footer"},u=Zn(f);return e.jsx(Kn,{as:r,ref:s,className:Y(u.root,i),role:r===Ve?null:"row",ownerState:f,...d})}),Jn=Je(e.jsx("path",{d:"M19 15v4H5v-4zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1M7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5M19 5v4H5V5zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1M7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5"})),eo=Je(e.jsx("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-1 6h2v2h-2zm0 4h2v6h-2z"})),to=et({});to.interceptors.request.use(t=>{const n=window.blocklet?window.blocklet.prefix:"/";return t.baseURL=n||"",t.url=ae("/api",String(t.url)),t.timeout=2e5,t.params=t.params||{},new URLSearchParams(t.url.split("?")[1]).has("locale")||(t.params.locale=Ft()),t},t=>Promise.reject(t));const ft=(...t)=>et(...t),no=(t,n)=>n?t?[t,...Array.isArray(n)?n:[n]]:n:t,oo=(t,{width:n=600,height:s=700,name:a="did-domain:popup"}={})=>{const i=window.screenX+(window.innerWidth-n)/2,r=window.screenY+(window.innerHeight-s)/2,c=[`left=${i}`,`top=${r}`,`width=${n}`,`height=${s}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],l=window.open("",a,c.join(","));if(l===null)throw new Error("Failed to open popup");return l.location.href=Nt(t,{opener:window.location.origin}),l},so="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",xt=async t=>{if(!t||!t?.trim())return null;const n=ft(),s=new URL(t);s.pathname="__blocklet__.js",s.searchParams.set("type","json");const{data:a}=await n.get(s.toString()),i=a?.componentMountPoints?.find(d=>d.did===so),r=new URL(t);r.pathname=i?.mountPoint;const c=r.toString(),l=ae(c,"/api");return{base:c,api:l}},io=tt({embed:{iconTip:"Click to view subscription details"},buy:{button:{title:"Buy DID Domain"},status:{inProgress:"Please wait while we are processing your request, the domain will be automatically resolved to the current app after the purchase...",success:"Purchase completed!"},error:{failedToCreateSession:"Failed to create session"}}}),ro=tt({embed:{iconTip:"点击查看订阅详情"},buy:{button:{title:"购买 DID 域名"},status:{inProgress:"请稍等,我们正在处理您的请求,购买域名后会自动解析到当前的应用...",success:"购买完成!"},error:{failedToCreateSession:"创建会话失败"}}}),ao={zh:ro,en:io},lo=async({didDomainURL:t,delegatee:n,delegateePk:s})=>{const a=await xt(t);if(!a)return null;const i=ft({baseURL:a.api}),{data:r}=await i.post("/payment/session",{delegatee:n,delegateePk:s});return{sessionId:r.sessionId,baseURL:a.base}};function co({delegatee:t,delegateePk:n,didDomainURL:s,locale:a,title:i="",onSuccess:r=()=>{},...c}){const{t:l}=S(),[d,p]=Pn({currentState:1}),f=y.useRef(null),u=$t(async()=>{const m=await lo({didDomainURL:s,delegatee:t,delegateePk:n});return m},{debounceWait:500,debounceLeading:!0,debounceTrailing:!1,debounceMaxWait:3e3,refreshDeps:[],onError(m){console.error(m)}}),g=ne(m=>{m.data.type==="didDomain.success"&&(r?.({nftDid:m.data?.nftDid,domain:m.data?.domain,chainHost:m.data?.chainHost}),f.current?.close(),f.current=null,p({currentState:4}),setTimeout(()=>{p({currentState:8})},2e3))});Ht(()=>{try{window.removeEventListener("message",g),f.current?.close(),f.current=null}catch(m){console.warn("Failed to close popup",m)}});const b=ne(()=>{p({currentState:1})}),h=ne(()=>{if(p({currentState:2}),!u.data){console.error("Failed to create session");return}j({sessionId:u.data.sessionId,baseURL:u.data.baseURL})}),j=ne(({sessionId:m,baseURL:w})=>{window.addEventListener("message",g);const C=new URL(w);C.searchParams.set("sessionId",m),C.searchParams.set("locale",a),C.searchParams.set("embed","1"),f.current=oo(C.toString());const q=setInterval(()=>{f.current?.closed&&(clearInterval(q),b())},1e3);return()=>clearInterval(q)});return e.jsxs(e.Fragment,{children:[e.jsx(pt,{loading:u.loading,onClick:h,variant:"contained",startIcon:e.jsx(bn,{}),...c,children:i||l("buy.button.title")}),e.jsxs(Ot,{fullWidth:!0,maxWidth:"xs",open:d.currentState>1&&d.currentState<8,onClose:b,children:[!u.error&&e.jsxs(x,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:2},children:[d.currentState===2&&e.jsx(N,{size:50}),d.currentState===4&&e.jsx(_t,{sx:{color:"primary.main",fontSize:"5rem"}}),d.currentState===2&&e.jsx(T,{children:l("buy.status.inProgress")}),d.currentState===4&&e.jsx(T,{children:l("buy.status.success")})]}),u.error&&e.jsx(de,{severity:"error",children:l("buy.error.failedToCreateSession")})]})]})}function uo(t){return e.jsx(zt,{locale:t.locale,translations:ao,children:e.jsx(co,{...t})})}function mo({nftDid:t,didDomainURL:n,locale:s,sx:a={}}){const{t:i}=S(),[r,c]=ue({safeIframeRef:null,popoverAnchorEl:null}),l=y.useRef(null),d=Z(),p=me(d.breakpoints.down("md")),f=h=>{c({popoverAnchorEl:h.currentTarget})},u=()=>{c({popoverAnchorEl:null})},g=gn(async()=>{const h=await xt(n);return h?h.base:null});if(!g.value)return null;if(g.loading)return e.jsx(N,{});const b=ae(g.value,`/embed/domain?nft-did=${t}&locale=${s}`);return e.jsxs(e.Fragment,{children:[e.jsx(E,{title:i("embed.iconTip"),children:e.jsx(x,{component:"img",src:ae(n,"/.well-known/service/blocklet/logo"),alt:"logo",onClick:f,sx:[{width:16,height:16},no({cursor:"pointer"},a)]})}),e.jsx(nt,{id:"popover-info",open:!!r.popoverAnchorEl,anchorEl:r.popoverAnchorEl,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:e.jsx("iframe",{ref:l,title:i("common.subscription"),width:p?"320px":"400px",height:"350px",style:{border:0,display:"block"},src:b})})]})}const po=t=>["waiting","creating","renewaling"].includes(t);function ht({siteId:t,domain:n,onAdd:s=()=>{},children:a=null,did:i,issuing:r=!1,setIssuing:c=()=>{}}){const{t:l}=S(),[d,p]=y.useState(!1),{inService:f}=L(),[u,g]=y.useState(null),{api:b,ws:{useSubscription:h}}=L(),{mode:j,actions:{refreshDomainStatus:m}}=K(),w=Gt(async()=>{const{cert:A}=await b.findCertificateByDomain({input:{domain:n,did:i}});return A}),C=(A,R)=>{A.domain===n&&(c(!1),p(!1),f&&j!=="setup"&&(R==="success"?M.success(l("setup.domain.genCertSuccess",{domain:A.domain})):R==="error"&&M.error(l("setup.domain.genCertFailed",{domain:A.domain,message:A.message}))))};if(y.useEffect(()=>{w.loading||c(po(w.value?.status))},[w.loading,w.value?.status,c]),h(Be.BlockletEvents.certError,A=>C(A,"error")),h(Be.BlockletEvents.certIssued,A=>{w.retry(),m(A.domain),C(A,"success")}),w.loading||w.value?.status==="normal")return"";const q=()=>{p(!1),g(null)},B=async()=>{p(!0);try{await b.issueLetsEncryptCert({input:{siteId:t,domain:n,did:i,inBlockletSetup:j==="setup"}}),s(),c(!0)}catch(A){console.error(A),c(!1)}finally{p(!1),g(null)}},U={title:l("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(de,{severity:"success",children:l("router.cert.genLetsEncryptCert.dnsTip")}),l("router.cert.genLetsEncryptCert.description")]}),confirm:l("common.confirm"),onConfirm:B,onCancel:q},F=A=>{A.stopPropagation(),g(U)};return e.jsxs(e.Fragment,{children:[r?e.jsx(E,{title:l("router.cert.issuing"),children:e.jsx(N,{size:13,style:{fontSize:"13px"}})}):a({loading:d,open:F}),u&&e.jsx(pe,{color:"primary",title:u.title,description:u.description,confirm:u.confirm,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel})]})}ht.propTypes={domain:o.string.isRequired,did:o.string.isRequired,siteId:o.string.isRequired,onAdd:o.func,children:o.any,issuing:o.bool,setIssuing:o.func};function gt({domain:t,domainStatus:n,did:s,onAdd:a=()=>{},children:i=null,issuing:r=!1,setIssuing:c=()=>{},...l}){return Wt(t)||!ot(t)||Vt(n)||n?.isHttps?"":e.jsx(ht,{...l,domain:t,did:s,onAdd:a,issuing:r,setIssuing:c,children:i})}gt.propTypes={domain:o.string.isRequired,domainStatus:o.shape({isHttps:o.bool}).isRequired,did:o.string.isRequired,onAdd:o.func,children:o.any,issuing:o.bool,setIssuing:o.func};function yt({id:t,domain:n,children:s=null,teamDid:a="",onDelete:i=null}){const{t:r}=S(),[c,l]=y.useState(!1),[d,p]=y.useState(null),{api:f}=L(),u=()=>{l(!1),p(null)},g=async()=>{l(!0);try{await f.deleteDomainAlias({input:{id:t,domainAlias:n,teamDid:a}}),i?.(),await Xt(2e3)}catch(j){M.error(j.message)}finally{p(null),l(!1)}},b={keyName:n,title:r("router.domainAlias.delete.title"),description:r("router.domainAlias.delete.description",{domain:n}),confirmPlaceholder:r("router.domainAlias.delete.confirmPlaceholder",{domain:n}),confirm:r("common.delete"),onConfirm:g,onCancel:u},h=j=>{j.stopPropagation(),p(b)};return e.jsxs(e.Fragment,{children:[typeof s=="function"?s({loading:c,open:h}):e.jsxs(fe,{edge:"end",onClick:h,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[c?e.jsx(N,{size:16}):e.jsx(mt,{style:{fontSize:16}}),r("common.delete")]}),d&&e.jsx(Dn,{keyName:d.keyName,title:d.title,description:d.description,confirmPlaceholder:d.confirmPlaceholder,confirm:d.confirm,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}yt.propTypes={id:o.string.isRequired,domain:o.string.isRequired,children:o.any,teamDid:o.string,onDelete:o.func};function Dt({site:t,domain:n,blocklet:s,onDelete:a=()=>{}}){const{t:i}=S(),r=n.value===window.location.hostname;return e.jsx(yn,{"data-cy":"domain-actions",size:"large",actions:[({close:c})=>e.jsx(yt,{id:t.id,domain:n.value,teamDid:s?.meta?.did,onDelete:a,children:({open:l})=>e.jsx(E,{title:r?i("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(st,{disabled:n.isProtected||r,dense:!0,onClick:d=>{c(),l(d)},"data-cy":"action-toggle-block",children:[e.jsx(Yt,{style:{minWidth:24,marginRight:8},children:e.jsx(mt,{})}),e.jsx(Qt,{primary:i("common.delete")})]},"remove")})})})]})}Dt.propTypes={site:o.object.isRequired,domain:o.object.isRequired,blocklet:o.object.isRequired,onDelete:o.func};const xe=o.shape({href:o.string,accessibility:o.shape({loading:o.bool,accessible:o.bool}),domainStatus:o.shape({isHttps:o.bool,matchedCert:o.object}),dns:o.shape({resolved:o.bool,ip:o.string})});function bt({certificate:t={}}){const[n,s]=y.useState(null),a=L(),{t:i,locale:r}=S(),c=p=>{s(p.currentTarget)},l=()=>{s(null)},d=!!n;return e.jsxs(e.Fragment,{children:[e.jsx(jn,{"aria-owns":d?"mouse-over-popover":void 0,onMouseEnter:c,onMouseLeave:l,style:{color:"#44cdc6",fontSize:"1em",cursor:"pointer"}}),e.jsx(nt,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:d,anchorEl:n,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:l,disableRestoreFocus:!0,children:e.jsx(Zt,{children:e.jsxs(vn,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${a.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:t.domain}),e.jsx(T,{component:"div",children:`${i("common.issuer")}: ${Kt(t,"issuer.commonName","")}`}),e.jsx(T,{component:"div",children:`${i("router.cert.issuedOn")}: ${Fe(t.validFrom,r)}`}),e.jsx(T,{component:"div",children:`${i("router.cert.expiryOn")}: ${Fe(t.validTo,r)}`})]})]})})})]})}bt.propTypes={certificate:o.object};function ce({domain:t,filters:n=["domain","http"]}){const{t:s}=S(),{value:a,domainStatus:i}=t;if(!ot(a))return null;let r=null,c=null;const{isHttps:l,matchedCert:d}=i,{dns:{ip:p,isDnsResolved:f,isCnameMatch:u}={}}=i,g=f&&u;Jt(a)||(g||p==="127.0.0.1"?r=e.jsx(E,{title:s("router.domain.verify.ok"),children:e.jsx(ze,{color:"success"})}):r=e.jsx(E,{title:s("router.domain.verify.notResolved"),children:e.jsx(ze,{color:"error"})})),g?l?c=e.jsx(bt,{certificate:d}):c=e.jsx(E,{title:s("router.domain.https.bad"),children:e.jsx(eo,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})}):c=e.jsx(E,{title:s("router.domain.verify.notResolved"),children:e.jsx(Jn,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})});const b=n.map(h=>h==="domain"?r:h==="http"?c:null);return y.createElement(y.Fragment,null,...b)}ce.propTypes={domain:xe.isRequired,filters:o.array};const fo=ut(Ae,"mutate_blocklets"),xo=ut(Ae,"",en);function ho(t){const{inService:n}=L(),{blocklet:s,loadingRuntimeInfo:a}=K();let i=fo;return n&&(i=xo),e.jsx(i,{...t,blocklet:s,inService:n,loadingRuntimeInfo:a})}const Xe="nft-domain";function Ae({hasPermission:t=!1,blocklet:n,loadingRuntimeInfo:s=!1,inService:a=!1,showAllDomains:i=!1,updateBlockletDomainAliases:r=()=>{},systemTips:c=null}){const{t:l}=S(),d=me(m=>m.breakpoints.down("md")),p=y.useMemo(()=>{let m=t;return it(n)&&(m=m&&a),m},[t,a,n]),{site:f}=n,u=y.useMemo(()=>rt(n.site?.domainAliases),[n.site?.domainAliases]),g=y.useMemo(()=>u.filter(m=>!Ce.isCustomDomain(m.value)),[u]),b=y.useMemo(()=>u.filter(m=>Ce.isCustomDomain(m.value)),[u]),h=y.useMemo(()=>b.filter(m=>m.type!==Xe),[b]),j=y.useMemo(()=>b.filter(m=>m.type===Xe),[b]);return e.jsxs(e.Fragment,{children:[e.jsxs(O,{sx:{gap:3},children:[!!j.length&&e.jsx(re,{title:l("common.didDomains"),description:l("common.didDomainsDescription"),domains:j,hasMutatePermission:p,blocklet:n,site:f,mobile:d,showAllDomains:i,updateBlockletDomainAliases:r}),!!h.length&&e.jsx(re,{title:l("common.manualDomains"),description:l("common.manualDomainsDescription"),domains:h,hasMutatePermission:p,blocklet:n,site:f,mobile:d,showAllDomains:i,updateBlockletDomainAliases:r}),!!g.length&&e.jsxs(x,{children:[c,e.jsx(re,{title:l("common.systemDomains"),description:l("common.systemDomainsDescription"),domains:g,hasMutatePermission:p,blocklet:n,site:f,mobile:d,updateBlockletDomainAliases:r})]})]}),!u.length&&(s?e.jsx(N,{size:16}):e.jsx(hn,{children:l("common.empty")}))]})}Ae.propTypes={hasPermission:o.bool,blocklet:o.object.isRequired,loadingRuntimeInfo:o.bool,inService:o.bool.isRequired,showAllDomains:o.bool,updateBlockletDomainAliases:o.func,systemTips:o.node};function se({children:t=null}){return e.jsx(x,{component:"span",sx:{verticalAlign:"bottom"},children:t})}se.propTypes={children:o.node};function we({domain:t,children:n,suffix:s=null,...a}){const{t:i,locale:r}=S(),c=Z(),{href:l,accessibility:d,value:p}=t,f=y.useCallback(()=>e.jsx(lt,{content:ke(p),locale:r,style:{marginLeft:"4px",color:c.palette.text.secondary,fontSize:"0.8em"}}),[p,r,c]);return!d||d.loading?e.jsxs(De,{component:"span",...a,children:[e.jsx(E,{title:void 0,placement:"top-end",children:e.jsx(x,{component:"span",children:n})}),f(),e.jsx(se,{children:s}),e.jsx(E,{title:i("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx(x,{component:"span",className:"status",children:e.jsx(N,{size:13,style:{fontSize:"13px"}})})})]}):d.accessible?e.jsxs(De,{component:"span",...a,children:[e.jsx(x,{component:"a",href:l,target:"_blank",rel:"noopener noreferrer",sx:{color:t.loading?"text.disabled":void 0},children:e.jsx(E,{title:void 0,placement:"top-end",children:e.jsx(x,{component:"span",children:n})})}),f(),e.jsx(se,{children:s})]}):e.jsxs(De,{component:"span",...a,children:[e.jsx(E,{title:i("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx(x,{component:"span",children:n})}),!t.loading&&f(),e.jsx(se,{children:s})]})}we.propTypes={domain:xe.isRequired,children:o.any.isRequired,suffix:o.node};const De=on(x)`
|
|
1
|
+
import{bX as W,bW as V,r as y,bY as G,j as e,h2 as Bt,b8 as X,b_ as Y,b$ as Q,bU as Ke,h3 as Te,av as ve,aG as Je,f7 as et,y as ae,h4 as Ft,z as Nt,c_ as tt,d0 as zt,m as S,cq as $t,cr as ne,h5 as Ht,$ as Ot,N as x,C as N,b7 as _t,T,X as de,q as ue,f as Z,F as me,az as E,b1 as nt,h6 as Wt,aY as ot,O as Vt,bn as L,e as Gt,b as Be,ad as pe,H as M,o,v as fe,aS as Xt,U as st,aF as Yt,a9 as Qt,b2 as Zt,h as Kt,b3 as Fe,b0 as Jt,bz as en,g$ as it,b4 as rt,cj as Ce,aV as O,dI as at,h7 as tn,b5 as nn,fF as lt,gm as ke,s as on,h8 as ct,h9 as sn,ha as rn,dw as dt,hb as an,bd as ln,hc as cn,L as dn,hd as H,Y as z,J as le,he as un,aW as mn,dG as oe,Z as Ne,t as pn,aR as fn,hf as xn}from"./index-Cp668Jsm.js";import{y as hn}from"./index-De5Caszn.js";import{u as gn}from"./useAsync-mK5hkfXk.js";import{u as K}from"./blocklet-Clk0KDdY.js";import{w as ut}from"./permission-Dq4G1Nhn.js";import{D as mt}from"./url-evaluation-ZlHZwvb8.js";import{A as yn}from"./actions-BTM30cO2.js";import{D as Dn}from"./delete-confirm-BrhseXop.js";import{D as ze}from"./status-DC_uFdhU.js";import{S as bn,V as jn}from"./VerifiedUser-C0M9SrH7.js";import{C as vn}from"./CardContent-DZQbbzze.js";import{A as Cn}from"./Add-B2ZDVqat.js";import{A as wn}from"./CallMerge-CT9kGdYw.js";import{a as Rn}from"./toLower-D7KlZyXh.js";import{u as Sn}from"./use-mobile-fb1R4sTD.js";import{v as Tn}from"./index-CwANiKOk.js";import{g as kn,p as $e}from"./util-B3o9CH5x.js";import{O as An}from"./OpenInNew-CVZ7jhVw.js";import{C as In}from"./click-to-copy-BZWirPDQ.js";import{L as pt}from"./LoadingButton-ClNP4uj0.js";import{u as Pn}from"./index-DWCHUGMU.js";import"./is-path-prefix-equal-9dPZdPqq.js";import"./engine-CjGipQ8H.js";function qn(t){return W("MuiTable",t)}V("MuiTable",["root","stickyHeader"]);const Mn=t=>{const{classes:n,stickyHeader:s}=t;return Q({root:["root",s&&"stickyHeader"]},qn,n)},En=X("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,n)=>{const{ownerState:s}=t;return[n.root,s.stickyHeader&&n.stickyHeader]}})(Ke(({theme:t})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...t.typography.body2,padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:n})=>n.stickyHeader,style:{borderCollapse:"separate"}}]}))),He="table",Ln=y.forwardRef(function(n,s){const a=G({props:n,name:"MuiTable"}),{className:i,component:r=He,padding:c="normal",size:l="medium",stickyHeader:d=!1,...p}=a,f={...a,component:r,padding:c,size:l,stickyHeader:d},u=Mn(f),g=y.useMemo(()=>({padding:c,size:l,stickyHeader:d}),[c,l,d]);return e.jsx(Bt.Provider,{value:g,children:e.jsx(En,{as:r,role:r===He?null:"table",ref:s,className:Y(u.root,i),ownerState:f,...p})})});function Un(t){return W("MuiTableBody",t)}V("MuiTableBody",["root"]);const Bn=t=>{const{classes:n}=t;return Q({root:["root"]},Un,n)},Fn=X("tbody",{name:"MuiTableBody",slot:"Root"})({display:"table-row-group"}),Nn={variant:"body"},Oe="tbody",zn=y.forwardRef(function(n,s){const a=G({props:n,name:"MuiTableBody"}),{className:i,component:r=Oe,...c}=a,l={...a,component:r},d=Bn(l);return e.jsx(Te.Provider,{value:Nn,children:e.jsx(Fn,{className:Y(d.root,i),as:r,ref:s,role:r===Oe?null:"rowgroup",ownerState:l,...c})})});function $n(t){return W("MuiTableContainer",t)}V("MuiTableContainer",["root"]);const Hn=t=>{const{classes:n}=t;return Q({root:["root"]},$n,n)},On=X("div",{name:"MuiTableContainer",slot:"Root"})({width:"100%",overflowX:"auto"}),_n=y.forwardRef(function(n,s){const a=G({props:n,name:"MuiTableContainer"}),{className:i,component:r="div",...c}=a,l={...a,component:r},d=Hn(l);return e.jsx(On,{ref:s,as:r,className:Y(d.root,i),ownerState:l,...c})});function Wn(t){return W("MuiTableHead",t)}V("MuiTableHead",["root"]);const Vn=t=>{const{classes:n}=t;return Q({root:["root"]},Wn,n)},Gn=X("thead",{name:"MuiTableHead",slot:"Root"})({display:"table-header-group"}),Xn={variant:"head"},_e="thead",Yn=y.forwardRef(function(n,s){const a=G({props:n,name:"MuiTableHead"}),{className:i,component:r=_e,...c}=a,l={...a,component:r},d=Vn(l);return e.jsx(Te.Provider,{value:Xn,children:e.jsx(Gn,{as:r,className:Y(d.root,i),ref:s,role:r===_e?null:"rowgroup",ownerState:l,...c})})});function Qn(t){return W("MuiTableRow",t)}const We=V("MuiTableRow",["root","selected","hover","head","footer"]),Zn=t=>{const{classes:n,selected:s,hover:a,head:i,footer:r}=t;return Q({root:["root",s&&"selected",a&&"hover",i&&"head",r&&"footer"]},Qn,n)},Kn=X("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(t,n)=>{const{ownerState:s}=t;return[n.root,s.head&&n.head,s.footer&&n.footer]}})(Ke(({theme:t})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${We.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${We.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:ve(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:ve(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}}))),Ve="tr",Ge=y.forwardRef(function(n,s){const a=G({props:n,name:"MuiTableRow"}),{className:i,component:r=Ve,hover:c=!1,selected:l=!1,...d}=a,p=y.useContext(Te),f={...a,component:r,hover:c,selected:l,head:p&&p.variant==="head",footer:p&&p.variant==="footer"},u=Zn(f);return e.jsx(Kn,{as:r,ref:s,className:Y(u.root,i),role:r===Ve?null:"row",ownerState:f,...d})}),Jn=Je(e.jsx("path",{d:"M19 15v4H5v-4zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1M7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5M19 5v4H5V5zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1M7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5"})),eo=Je(e.jsx("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-1 6h2v2h-2zm0 4h2v6h-2z"})),to=et({});to.interceptors.request.use(t=>{const n=window.blocklet?window.blocklet.prefix:"/";return t.baseURL=n||"",t.url=ae("/api",String(t.url)),t.timeout=2e5,t.params=t.params||{},new URLSearchParams(t.url.split("?")[1]).has("locale")||(t.params.locale=Ft()),t},t=>Promise.reject(t));const ft=(...t)=>et(...t),no=(t,n)=>n?t?[t,...Array.isArray(n)?n:[n]]:n:t,oo=(t,{width:n=600,height:s=700,name:a="did-domain:popup"}={})=>{const i=window.screenX+(window.innerWidth-n)/2,r=window.screenY+(window.innerHeight-s)/2,c=[`left=${i}`,`top=${r}`,`width=${n}`,`height=${s}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],l=window.open("",a,c.join(","));if(l===null)throw new Error("Failed to open popup");return l.location.href=Nt(t,{opener:window.location.origin}),l},so="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",xt=async t=>{if(!t||!t?.trim())return null;const n=ft(),s=new URL(t);s.pathname="__blocklet__.js",s.searchParams.set("type","json");const{data:a}=await n.get(s.toString()),i=a?.componentMountPoints?.find(d=>d.did===so),r=new URL(t);r.pathname=i?.mountPoint;const c=r.toString(),l=ae(c,"/api");return{base:c,api:l}},io=tt({embed:{iconTip:"Click to view subscription details"},buy:{button:{title:"Buy DID Domain"},status:{inProgress:"Please wait while we are processing your request, the domain will be automatically resolved to the current app after the purchase...",success:"Purchase completed!"},error:{failedToCreateSession:"Failed to create session"}}}),ro=tt({embed:{iconTip:"点击查看订阅详情"},buy:{button:{title:"购买 DID 域名"},status:{inProgress:"请稍等,我们正在处理您的请求,购买域名后会自动解析到当前的应用...",success:"购买完成!"},error:{failedToCreateSession:"创建会话失败"}}}),ao={zh:ro,en:io},lo=async({didDomainURL:t,delegatee:n,delegateePk:s})=>{const a=await xt(t);if(!a)return null;const i=ft({baseURL:a.api}),{data:r}=await i.post("/payment/session",{delegatee:n,delegateePk:s});return{sessionId:r.sessionId,baseURL:a.base}};function co({delegatee:t,delegateePk:n,didDomainURL:s,locale:a,title:i="",onSuccess:r=()=>{},...c}){const{t:l}=S(),[d,p]=Pn({currentState:1}),f=y.useRef(null),u=$t(async()=>{const m=await lo({didDomainURL:s,delegatee:t,delegateePk:n});return m},{debounceWait:500,debounceLeading:!0,debounceTrailing:!1,debounceMaxWait:3e3,refreshDeps:[],onError(m){console.error(m)}}),g=ne(m=>{m.data.type==="didDomain.success"&&(r?.({nftDid:m.data?.nftDid,domain:m.data?.domain,chainHost:m.data?.chainHost}),f.current?.close(),f.current=null,p({currentState:4}),setTimeout(()=>{p({currentState:8})},2e3))});Ht(()=>{try{window.removeEventListener("message",g),f.current?.close(),f.current=null}catch(m){console.warn("Failed to close popup",m)}});const b=ne(()=>{p({currentState:1})}),h=ne(()=>{if(p({currentState:2}),!u.data){console.error("Failed to create session");return}j({sessionId:u.data.sessionId,baseURL:u.data.baseURL})}),j=ne(({sessionId:m,baseURL:w})=>{window.addEventListener("message",g);const C=new URL(w);C.searchParams.set("sessionId",m),C.searchParams.set("locale",a),C.searchParams.set("embed","1"),f.current=oo(C.toString());const q=setInterval(()=>{f.current?.closed&&(clearInterval(q),b())},1e3);return()=>clearInterval(q)});return e.jsxs(e.Fragment,{children:[e.jsx(pt,{loading:u.loading,onClick:h,variant:"contained",startIcon:e.jsx(bn,{}),...c,children:i||l("buy.button.title")}),e.jsxs(Ot,{fullWidth:!0,maxWidth:"xs",open:d.currentState>1&&d.currentState<8,onClose:b,children:[!u.error&&e.jsxs(x,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:2},children:[d.currentState===2&&e.jsx(N,{size:50}),d.currentState===4&&e.jsx(_t,{sx:{color:"primary.main",fontSize:"5rem"}}),d.currentState===2&&e.jsx(T,{children:l("buy.status.inProgress")}),d.currentState===4&&e.jsx(T,{children:l("buy.status.success")})]}),u.error&&e.jsx(de,{severity:"error",children:l("buy.error.failedToCreateSession")})]})]})}function uo(t){return e.jsx(zt,{locale:t.locale,translations:ao,children:e.jsx(co,{...t})})}function mo({nftDid:t,didDomainURL:n,locale:s,sx:a={}}){const{t:i}=S(),[r,c]=ue({safeIframeRef:null,popoverAnchorEl:null}),l=y.useRef(null),d=Z(),p=me(d.breakpoints.down("md")),f=h=>{c({popoverAnchorEl:h.currentTarget})},u=()=>{c({popoverAnchorEl:null})},g=gn(async()=>{const h=await xt(n);return h?h.base:null});if(!g.value)return null;if(g.loading)return e.jsx(N,{});const b=ae(g.value,`/embed/domain?nft-did=${t}&locale=${s}`);return e.jsxs(e.Fragment,{children:[e.jsx(E,{title:i("embed.iconTip"),children:e.jsx(x,{component:"img",src:ae(n,"/.well-known/service/blocklet/logo"),alt:"logo",onClick:f,sx:[{width:16,height:16},no({cursor:"pointer"},a)]})}),e.jsx(nt,{id:"popover-info",open:!!r.popoverAnchorEl,anchorEl:r.popoverAnchorEl,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:e.jsx("iframe",{ref:l,title:i("common.subscription"),width:p?"320px":"400px",height:"350px",style:{border:0,display:"block"},src:b})})]})}const po=t=>["waiting","creating","renewaling"].includes(t);function ht({siteId:t,domain:n,onAdd:s=()=>{},children:a=null,did:i,issuing:r=!1,setIssuing:c=()=>{}}){const{t:l}=S(),[d,p]=y.useState(!1),{inService:f}=L(),[u,g]=y.useState(null),{api:b,ws:{useSubscription:h}}=L(),{mode:j,actions:{refreshDomainStatus:m}}=K(),w=Gt(async()=>{const{cert:A}=await b.findCertificateByDomain({input:{domain:n,did:i}});return A}),C=(A,R)=>{A.domain===n&&(c(!1),p(!1),f&&j!=="setup"&&(R==="success"?M.success(l("setup.domain.genCertSuccess",{domain:A.domain})):R==="error"&&M.error(l("setup.domain.genCertFailed",{domain:A.domain,message:A.message}))))};if(y.useEffect(()=>{w.loading||c(po(w.value?.status))},[w.loading,w.value?.status,c]),h(Be.BlockletEvents.certError,A=>C(A,"error")),h(Be.BlockletEvents.certIssued,A=>{w.retry(),m(A.domain),C(A,"success")}),w.loading||w.value?.status==="normal")return"";const q=()=>{p(!1),g(null)},B=async()=>{p(!0);try{await b.issueLetsEncryptCert({input:{siteId:t,domain:n,did:i,inBlockletSetup:j==="setup"}}),s(),c(!0)}catch(A){console.error(A),c(!1)}finally{p(!1),g(null)}},U={title:l("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(de,{severity:"success",children:l("router.cert.genLetsEncryptCert.dnsTip")}),l("router.cert.genLetsEncryptCert.description")]}),confirm:l("common.confirm"),onConfirm:B,onCancel:q},F=A=>{A.stopPropagation(),g(U)};return e.jsxs(e.Fragment,{children:[r?e.jsx(E,{title:l("router.cert.issuing"),children:e.jsx(N,{size:13,style:{fontSize:"13px"}})}):a({loading:d,open:F}),u&&e.jsx(pe,{color:"primary",title:u.title,description:u.description,confirm:u.confirm,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel})]})}ht.propTypes={domain:o.string.isRequired,did:o.string.isRequired,siteId:o.string.isRequired,onAdd:o.func,children:o.any,issuing:o.bool,setIssuing:o.func};function gt({domain:t,domainStatus:n,did:s,onAdd:a=()=>{},children:i=null,issuing:r=!1,setIssuing:c=()=>{},...l}){return Wt(t)||!ot(t)||Vt(n)||n?.isHttps?"":e.jsx(ht,{...l,domain:t,did:s,onAdd:a,issuing:r,setIssuing:c,children:i})}gt.propTypes={domain:o.string.isRequired,domainStatus:o.shape({isHttps:o.bool}).isRequired,did:o.string.isRequired,onAdd:o.func,children:o.any,issuing:o.bool,setIssuing:o.func};function yt({id:t,domain:n,children:s=null,teamDid:a="",onDelete:i=null}){const{t:r}=S(),[c,l]=y.useState(!1),[d,p]=y.useState(null),{api:f}=L(),u=()=>{l(!1),p(null)},g=async()=>{l(!0);try{await f.deleteDomainAlias({input:{id:t,domainAlias:n,teamDid:a}}),i?.(),await Xt(2e3)}catch(j){M.error(j.message)}finally{p(null),l(!1)}},b={keyName:n,title:r("router.domainAlias.delete.title"),description:r("router.domainAlias.delete.description",{domain:n}),confirmPlaceholder:r("router.domainAlias.delete.confirmPlaceholder",{domain:n}),confirm:r("common.delete"),onConfirm:g,onCancel:u},h=j=>{j.stopPropagation(),p(b)};return e.jsxs(e.Fragment,{children:[typeof s=="function"?s({loading:c,open:h}):e.jsxs(fe,{edge:"end",onClick:h,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[c?e.jsx(N,{size:16}):e.jsx(mt,{style:{fontSize:16}}),r("common.delete")]}),d&&e.jsx(Dn,{keyName:d.keyName,title:d.title,description:d.description,confirmPlaceholder:d.confirmPlaceholder,confirm:d.confirm,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}yt.propTypes={id:o.string.isRequired,domain:o.string.isRequired,children:o.any,teamDid:o.string,onDelete:o.func};function Dt({site:t,domain:n,blocklet:s,onDelete:a=()=>{}}){const{t:i}=S(),r=n.value===window.location.hostname;return e.jsx(yn,{"data-cy":"domain-actions",size:"large",actions:[({close:c})=>e.jsx(yt,{id:t.id,domain:n.value,teamDid:s?.meta?.did,onDelete:a,children:({open:l})=>e.jsx(E,{title:r?i("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(st,{disabled:n.isProtected||r,dense:!0,onClick:d=>{c(),l(d)},"data-cy":"action-toggle-block",children:[e.jsx(Yt,{style:{minWidth:24,marginRight:8},children:e.jsx(mt,{})}),e.jsx(Qt,{primary:i("common.delete")})]},"remove")})})})]})}Dt.propTypes={site:o.object.isRequired,domain:o.object.isRequired,blocklet:o.object.isRequired,onDelete:o.func};const xe=o.shape({href:o.string,accessibility:o.shape({loading:o.bool,accessible:o.bool}),domainStatus:o.shape({isHttps:o.bool,matchedCert:o.object}),dns:o.shape({resolved:o.bool,ip:o.string})});function bt({certificate:t={}}){const[n,s]=y.useState(null),a=L(),{t:i,locale:r}=S(),c=p=>{s(p.currentTarget)},l=()=>{s(null)},d=!!n;return e.jsxs(e.Fragment,{children:[e.jsx(jn,{"aria-owns":d?"mouse-over-popover":void 0,onMouseEnter:c,onMouseLeave:l,style:{color:"#44cdc6",fontSize:"1em",cursor:"pointer"}}),e.jsx(nt,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:d,anchorEl:n,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:l,disableRestoreFocus:!0,children:e.jsx(Zt,{children:e.jsxs(vn,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${a.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:t.domain}),e.jsx(T,{component:"div",children:`${i("common.issuer")}: ${Kt(t,"issuer.commonName","")}`}),e.jsx(T,{component:"div",children:`${i("router.cert.issuedOn")}: ${Fe(t.validFrom,r)}`}),e.jsx(T,{component:"div",children:`${i("router.cert.expiryOn")}: ${Fe(t.validTo,r)}`})]})]})})})]})}bt.propTypes={certificate:o.object};function ce({domain:t,filters:n=["domain","http"]}){const{t:s}=S(),{value:a,domainStatus:i}=t;if(!ot(a))return null;let r=null,c=null;const{isHttps:l,matchedCert:d}=i,{dns:{ip:p,isDnsResolved:f,isCnameMatch:u}={}}=i,g=f&&u;Jt(a)||(g||p==="127.0.0.1"?r=e.jsx(E,{title:s("router.domain.verify.ok"),children:e.jsx(ze,{color:"success"})}):r=e.jsx(E,{title:s("router.domain.verify.notResolved"),children:e.jsx(ze,{color:"error"})})),g?l?c=e.jsx(bt,{certificate:d}):c=e.jsx(E,{title:s("router.domain.https.bad"),children:e.jsx(eo,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})}):c=e.jsx(E,{title:s("router.domain.verify.notResolved"),children:e.jsx(Jn,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})});const b=n.map(h=>h==="domain"?r:h==="http"?c:null);return y.createElement(y.Fragment,null,...b)}ce.propTypes={domain:xe.isRequired,filters:o.array};const fo=ut(Ae,"mutate_blocklets"),xo=ut(Ae,"",en);function ho(t){const{inService:n}=L(),{blocklet:s,loadingRuntimeInfo:a}=K();let i=fo;return n&&(i=xo),e.jsx(i,{...t,blocklet:s,inService:n,loadingRuntimeInfo:a})}const Xe="nft-domain";function Ae({hasPermission:t=!1,blocklet:n,loadingRuntimeInfo:s=!1,inService:a=!1,showAllDomains:i=!1,updateBlockletDomainAliases:r=()=>{},systemTips:c=null}){const{t:l}=S(),d=me(m=>m.breakpoints.down("md")),p=y.useMemo(()=>{let m=t;return it(n)&&(m=m&&a),m},[t,a,n]),{site:f}=n,u=y.useMemo(()=>rt(n.site?.domainAliases),[n.site?.domainAliases]),g=y.useMemo(()=>u.filter(m=>!Ce.isCustomDomain(m.value)),[u]),b=y.useMemo(()=>u.filter(m=>Ce.isCustomDomain(m.value)),[u]),h=y.useMemo(()=>b.filter(m=>m.type!==Xe),[b]),j=y.useMemo(()=>b.filter(m=>m.type===Xe),[b]);return e.jsxs(e.Fragment,{children:[e.jsxs(O,{sx:{gap:3},children:[!!j.length&&e.jsx(re,{title:l("common.didDomains"),description:l("common.didDomainsDescription"),domains:j,hasMutatePermission:p,blocklet:n,site:f,mobile:d,showAllDomains:i,updateBlockletDomainAliases:r}),!!h.length&&e.jsx(re,{title:l("common.manualDomains"),description:l("common.manualDomainsDescription"),domains:h,hasMutatePermission:p,blocklet:n,site:f,mobile:d,showAllDomains:i,updateBlockletDomainAliases:r}),!!g.length&&e.jsxs(x,{children:[c,e.jsx(re,{title:l("common.systemDomains"),description:l("common.systemDomainsDescription"),domains:g,hasMutatePermission:p,blocklet:n,site:f,mobile:d,updateBlockletDomainAliases:r})]})]}),!u.length&&(s?e.jsx(N,{size:16}):e.jsx(hn,{children:l("common.empty")}))]})}Ae.propTypes={hasPermission:o.bool,blocklet:o.object.isRequired,loadingRuntimeInfo:o.bool,inService:o.bool.isRequired,showAllDomains:o.bool,updateBlockletDomainAliases:o.func,systemTips:o.node};function se({children:t=null}){return e.jsx(x,{component:"span",sx:{verticalAlign:"bottom"},children:t})}se.propTypes={children:o.node};function we({domain:t,children:n,suffix:s=null,...a}){const{t:i,locale:r}=S(),c=Z(),{href:l,accessibility:d,value:p}=t,f=y.useCallback(()=>e.jsx(lt,{content:ke(p),locale:r,style:{marginLeft:"4px",color:c.palette.text.secondary,fontSize:"0.8em"}}),[p,r,c]);return!d||d.loading?e.jsxs(De,{component:"span",...a,children:[e.jsx(E,{title:void 0,placement:"top-end",children:e.jsx(x,{component:"span",children:n})}),f(),e.jsx(se,{children:s}),e.jsx(E,{title:i("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx(x,{component:"span",className:"status",children:e.jsx(N,{size:13,style:{fontSize:"13px"}})})})]}):d.accessible?e.jsxs(De,{component:"span",...a,children:[e.jsx(x,{component:"a",href:l,target:"_blank",rel:"noopener noreferrer",sx:{color:t.loading?"text.disabled":void 0},children:e.jsx(E,{title:void 0,placement:"top-end",children:e.jsx(x,{component:"span",children:n})})}),f(),e.jsx(se,{children:s})]}):e.jsxs(De,{component:"span",...a,children:[e.jsx(E,{title:i("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx(x,{component:"span",children:n})}),!t.loading&&f(),e.jsx(se,{children:s})]})}we.propTypes={domain:xe.isRequired,children:o.any.isRequired,suffix:o.node};const De=on(x)`
|
|
2
2
|
display: inline-block;
|
|
3
3
|
vertical-align: middle;
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aG as Ne,j as Y,ey as ke,s as ge,be as $e,fB as je,dG as Le,o as te,r as he,fC as ze,fD as Ke,bn as Ie,F as qe,dH as Ve,bd as Ge,m as Ye,N as pe,v as De,C as Re,$ as Xe,Q as Je,S as Ze,U as Qe,bf as et,H as tt}from"./index-
|
|
1
|
+
import{aG as Ne,j as Y,ey as ke,s as ge,be as $e,fB as je,dG as Le,o as te,r as he,fC as ze,fD as Ke,bn as Ie,F as qe,dH as Ve,bd as Ge,m as Ye,N as pe,v as De,C as Re,$ as Xe,Q as Je,S as Ze,U as Qe,bf as et,H as tt}from"./index-Cp668Jsm.js";import{B as it}from"./ButtonGroup-BxZjrpDd.js";const rt=Ne(Y.jsx("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"}));var we={exports:{}},Ae;function st(){return Ae||(Ae=1,function(X,q){(function(j,V){X.exports=V()})(globalThis,()=>(()=>{var j={4567:function(A,s,o){var d=this&&this.__decorate||function(e,r,a,f){var p,g=arguments.length,l=g<3?r:f===null?f=Object.getOwnPropertyDescriptor(r,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,r,a,f);else for(var m=e.length-1;m>=0;m--)(p=e[m])&&(l=(g<3?p(l):g>3?p(r,a,l):p(r,a))||l);return g>3&&l&&Object.defineProperty(r,a,l),l},_=this&&this.__param||function(e,r){return function(a,f){r(a,f,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const n=o(9042),c=o(9924),u=o(844),v=o(4725),h=o(2585),t=o(3656);let i=s.AccessibilityManager=class extends u.Disposable{constructor(e,r,a,f){super(),this._terminal=e,this._coreBrowserService=a,this._renderService=f,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let p=0;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);if(this._topBoundaryFocusListener=p=>this._handleBoundaryFocus(p,0),this._bottomBoundaryFocusListener=p=>this._handleBoundaryFocus(p,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new c.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(p=>this._handleResize(p.rows))),this.register(this._terminal.onRender(p=>this._refreshRows(p.start,p.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(p=>this._handleChar(p))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
2
2
|
`))),this.register(this._terminal.onA11yTab(p=>this._handleTab(p))),this.register(this._terminal.onKey(p=>this._handleKey(p.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,t.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,u.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let r=0;r<e;r++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
3
3
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,r){this._liveRegionDebouncer.refresh(e,r,this._terminal.rows)}_renderRows(e,r){const a=this._terminal.buffer,f=a.lines.length.toString();for(let p=e;p<=r;p++){const g=a.lines.get(a.ydisp+p),l=[],m=g?.translateToString(!0,void 0,void 0,l)||"",E=(a.ydisp+p+1).toString(),x=this._rowElements[p];x&&(m.length===0?(x.innerText=" ",this._rowColumns.set(x,[0,1])):(x.textContent=m,this._rowColumns.set(x,l)),x.setAttribute("aria-posinset",E),x.setAttribute("aria-setsize",f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,r){const a=e.target,f=this._rowElements[r===0?1:this._rowElements.length-2];if(a.getAttribute("aria-posinset")===(r===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==f)return;let p,g;if(r===0?(p=a,g=this._rowElements.pop(),this._rowContainer.removeChild(g)):(p=this._rowElements.shift(),g=a,this._rowContainer.removeChild(p)),p.removeEventListener("focus",this._topBoundaryFocusListener),g.removeEventListener("focus",this._bottomBoundaryFocusListener),r===0){const l=this._createAccessibilityTreeNode();this._rowElements.unshift(l),this._rowContainer.insertAdjacentElement("afterbegin",l)}else{const l=this._createAccessibilityTreeNode();this._rowElements.push(l),this._rowContainer.appendChild(l)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(r===0?-1:1),this._rowElements[r===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let r={node:e.anchorNode,offset:e.anchorOffset},a={node:e.focusNode,offset:e.focusOffset};if((r.node.compareDocumentPosition(a.node)&Node.DOCUMENT_POSITION_PRECEDING||r.node===a.node&&r.offset>a.offset)&&([r,a]=[a,r]),r.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(r={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(r.node))return;const f=this._rowElements.slice(-1)[0];if(a.node.compareDocumentPosition(f)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(a={node:f,offset:f.textContent?.length??0}),!this._rowContainer.contains(a.node))return;const p=({node:m,offset:E})=>{const x=m instanceof Text?m.parentNode:m;let L=parseInt(x?.getAttribute("aria-posinset"),10)-1;if(isNaN(L))return console.warn("row is invalid. Race condition?"),null;const b=this._rowColumns.get(x);if(!b)return console.warn("columns is null. Race condition?"),null;let R=E<b.length?b[E]:b.slice(-1)[0]+1;return R>=this._terminal.cols&&(++L,R=0),{row:L,column:R}},g=p(r),l=p(a);if(g&&l){if(g.row>l.row||g.row===l.row&&g.column>=l.column)throw new Error("invalid range");this._terminal.select(g.column,g.row,(l.row-g.row)*this._terminal.cols-g.column+l.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let r=this._rowContainer.children.length;r<this._terminal.rows;r++)this._rowElements[r]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[r]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=i=d([_(1,h.IInstantiationService),_(2,v.ICoreBrowserService),_(3,v.IRenderService)],i)},3614:(A,s)=>{function o(c){return c.replace(/\r?\n/g,"\r")}function d(c,u){return u?"\x1B[200~"+c+"\x1B[201~":c}function _(c,u,v,h){c=d(c=o(c),v.decPrivateModes.bracketedPasteMode&&h.rawOptions.ignoreBracketedPasteMode!==!0),v.triggerDataEvent(c,!0),u.value=""}function n(c,u,v){const h=v.getBoundingClientRect(),t=c.clientX-h.left-10,i=c.clientY-h.top-10;u.style.width="20px",u.style.height="20px",u.style.left=`${t}px`,u.style.top=`${i}px`,u.style.zIndex="1000",u.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=o,s.bracketTextForPaste=d,s.copyHandler=function(c,u){c.clipboardData&&c.clipboardData.setData("text/plain",u.selectionText),c.preventDefault()},s.handlePasteEvent=function(c,u,v,h){c.stopPropagation(),c.clipboardData&&_(c.clipboardData.getData("text/plain"),u,v,h)},s.paste=_,s.moveTextAreaUnderMouseCursor=n,s.rightClickHandler=function(c,u,v,h,t){n(c,u,v),t&&h.rightClickSelect(c),u.value=h.selectionText,u.select()}},7239:(A,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const d=o(1505);s.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(_,n,c){this._css.set(_,n,c)}getCss(_,n){return this._css.get(_,n)}setColor(_,n,c){this._color.set(_,n,c)}getColor(_,n){return this._color.get(_,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(A,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(o,d,_,n){o.addEventListener(d,_,n);let c=!1;return{dispose:()=>{c||(c=!0,o.removeEventListener(d,_,n))}}}},3551:function(A,s,o){var d=this&&this.__decorate||function(i,e,r,a){var f,p=arguments.length,g=p<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,r):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,e,r,a);else for(var l=i.length-1;l>=0;l--)(f=i[l])&&(g=(p<3?f(g):p>3?f(e,r,g):f(e,r))||g);return p>3&&g&&Object.defineProperty(e,r,g),g},_=this&&this.__param||function(i,e){return function(r,a){e(r,a,i)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const n=o(3656),c=o(8460),u=o(844),v=o(2585),h=o(4725);let t=s.Linkifier=class extends u.Disposable{get currentLink(){return this._currentLink}constructor(i,e,r,a,f){super(),this._element=i,this._mouseService=e,this._renderService=r,this._bufferService=a,this._linkProviderService=f,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new c.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new c.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,u.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,u.toDisposable)(()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(i){this._lastMouseEvent=i;const e=this._positionFromMouseEvent(i,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const r=i.composedPath();for(let a=0;a<r.length;a++){const f=r[a];if(f.classList.contains("xterm"))break;if(f.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(i){if(this._activeLine!==i.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(i,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,i)||(this._clearCurrentLink(),this._askForLink(i,!0))}_askForLink(i,e){this._activeProviderReplies&&e||(this._activeProviderReplies?.forEach(a=>{a?.forEach(f=>{f.link.dispose&&f.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=i.y);let r=!1;for(const[a,f]of this._linkProviderService.linkProviders.entries())e?this._activeProviderReplies?.get(a)&&(r=this._checkLinkProviderResult(a,i,r)):f.provideLinks(i.y,p=>{if(this._isMouseOut)return;const g=p?.map(l=>({link:l}));this._activeProviderReplies?.set(a,g),r=this._checkLinkProviderResult(a,i,r),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(i.y,this._activeProviderReplies)})}_removeIntersectingLinks(i,e){const r=new Set;for(let a=0;a<e.size;a++){const f=e.get(a);if(f)for(let p=0;p<f.length;p++){const g=f[p],l=g.link.range.start.y<i?0:g.link.range.start.x,m=g.link.range.end.y>i?this._bufferService.cols:g.link.range.end.x;for(let E=l;E<=m;E++){if(r.has(E)){f.splice(p--,1);break}r.add(E)}}}}_checkLinkProviderResult(i,e,r){if(!this._activeProviderReplies)return r;const a=this._activeProviderReplies.get(i);let f=!1;for(let p=0;p<i;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(f=!0);if(!f&&a){const p=a.find(g=>this._linkAtPosition(g.link,e));p&&(r=!0,this._handleNewLink(p))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let p=0;p<this._activeProviderReplies.size;p++){const g=this._activeProviderReplies.get(p)?.find(l=>this._linkAtPosition(l.link,e));if(g){r=!0,this._handleNewLink(g);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(i){if(!this._currentLink)return;const e=this._positionFromMouseEvent(i,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(i,this._currentLink.link.text)}_clearCurrentLink(i,e){this._currentLink&&this._lastMouseEvent&&(!i||!e||this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,u.disposeArray)(this._linkCacheDisposables))}_handleNewLink(i){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(i.link,e)&&(this._currentLink=i,this._currentLink.state={decorations:{underline:i.link.decorations===void 0||i.link.decorations.underline,pointerCursor:i.link.decorations===void 0||i.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,i.link,this._lastMouseEvent),i.link.decorations={},Object.defineProperties(i.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:r=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:r=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(i.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;const a=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,f=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=f&&(this._clearCurrentLink(a,f),this._lastMouseEvent)){const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._askForLink(p,!1)}})))}_linkHover(i,e,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&i.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(r,e.text)}_fireUnderlineEvent(i,e){const r=i.range,a=this._bufferService.buffer.ydisp,f=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-a-1,r.end.x,r.end.y-a-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(f)}_linkLeave(i,e,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&i.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(r,e.text)}_linkAtPosition(i,e){const r=i.range.start.y*this._bufferService.cols+i.range.start.x,a=i.range.end.y*this._bufferService.cols+i.range.end.x,f=e.y*this._bufferService.cols+e.x;return r<=f&&f<=a}_positionFromMouseEvent(i,e,r){const a=r.getCoords(i,e,this._bufferService.cols,this._bufferService.rows);if(a)return{x:a[0],y:a[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(i,e,r,a,f){return{x1:i,y1:e,x2:r,y2:a,cols:this._bufferService.cols,fg:f}}};s.Linkifier=t=d([_(1,h.IMouseService),_(2,h.IRenderService),_(3,v.IBufferService),_(4,h.ILinkProviderService)],t)},9042:(A,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(A,s,o){var d=this&&this.__decorate||function(h,t,i,e){var r,a=arguments.length,f=a<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,i):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(h,t,i,e);else for(var p=h.length-1;p>=0;p--)(r=h[p])&&(f=(a<3?r(f):a>3?r(t,i,f):r(t,i))||f);return a>3&&f&&Object.defineProperty(t,i,f),f},_=this&&this.__param||function(h,t){return function(i,e){t(i,e,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const n=o(511),c=o(2585);let u=s.OscLinkProvider=class{constructor(h,t,i){this._bufferService=h,this._optionsService=t,this._oscLinkService=i}provideLinks(h,t){const i=this._bufferService.buffer.lines.get(h-1);if(!i)return void t(void 0);const e=[],r=this._optionsService.rawOptions.linkHandler,a=new n.CellData,f=i.getTrimmedLength();let p=-1,g=-1,l=!1;for(let m=0;m<f;m++)if(g!==-1||i.hasContent(m)){if(i.loadCell(m,a),a.hasExtendedAttrs()&&a.extended.urlId){if(g===-1){g=m,p=a.extended.urlId;continue}l=a.extended.urlId!==p}else g!==-1&&(l=!0);if(l||g!==-1&&m===f-1){const E=this._oscLinkService.getLinkData(p)?.uri;if(E){const x={start:{x:g+1,y:h},end:{x:m+(l||m!==f-1?0:1),y:h}};let L=!1;if(!r?.allowNonHttpProtocols)try{const b=new URL(E);["http:","https:"].includes(b.protocol)||(L=!0)}catch{L=!0}L||e.push({text:E,range:x,activate:(b,R)=>r?r.activate(b,R,x):v(0,R),hover:(b,R)=>r?.hover?.(b,R,x),leave:(b,R)=>r?.leave?.(b,R,x)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(g=m,p=a.extended.urlId):(g=-1,p=-1)}}t(e)}};function v(h,t){if(confirm(`Do you want to navigate to ${t}?
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as C}from"./index-
|
|
1
|
+
import{r as C}from"./index-Cp668Jsm.js";const L=t=>C.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...t},C.createElement("path",{d:"M6.03984 17.625C6.08672 17.625 6.13359 17.6203 6.18047 17.6133L10.1227 16.9219C10.1695 16.9125 10.2141 16.8914 10.2469 16.8563L20.182 6.92109C20.2038 6.89941 20.221 6.87366 20.2328 6.8453C20.2445 6.81695 20.2506 6.78656 20.2506 6.75586C20.2506 6.72516 20.2445 6.69477 20.2328 6.66642C20.221 6.63806 20.2038 6.61231 20.182 6.59063L16.2867 2.69297C16.2422 2.64844 16.1836 2.625 16.1203 2.625C16.057 2.625 15.9984 2.64844 15.9539 2.69297L6.01875 12.6281C5.98359 12.6633 5.9625 12.7055 5.95312 12.7523L5.26172 16.6945C5.23892 16.8201 5.24707 16.9493 5.28545 17.071C5.32384 17.1927 5.39132 17.3032 5.48203 17.393C5.63672 17.543 5.83125 17.625 6.03984 17.625ZM7.61953 13.5375L16.1203 5.03906L17.8383 6.75703L9.3375 15.2555L7.25391 15.6234L7.61953 13.5375ZM20.625 19.5938H3.375C2.96016 19.5938 2.625 19.9289 2.625 20.3438V21.1875C2.625 21.2906 2.70937 21.375 2.8125 21.375H21.1875C21.2906 21.375 21.375 21.2906 21.375 21.1875V20.3438C21.375 19.9289 21.0398 19.5938 20.625 19.5938Z"}));export{L as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{dw as e,eV as r,eW as s}from"./index-Cp668Jsm.js";const a=e(r),t=e(s);export{a,t as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{fo as e}from"./index-Cp668Jsm.js";var o=e();export{o as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as f}from"./index-
|
|
1
|
+
import{m as f}from"./index-N8fONOxR.js";import"./index-Cp668Jsm.js";import"./decode-DPztD6kB.js";/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
4
|
* Released under the MIT license
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cS as t,H as o}from"./index-
|
|
1
|
+
import{cS as t,H as o}from"./index-Cp668Jsm.js";function c(...e){try{return t(...e)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{c as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r}from"./index-Cp668Jsm.js";function a(t){return r.Children.toArray(t).filter(e=>r.isValidElement(e))}export{a as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{e as h,g as v,a as f,U as M,l as m,C as r}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-N8fONOxR.js","./index-Cp668Jsm.js","./index-DGkT7afN.css","./decode-DPztD6kB.js","./index-CX3PrUL2.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{e as h,g as v,a as f,U as M,l as m,C as r}from"./index-N8fONOxR.js";import{bE as T}from"./index-Cp668Jsm.js";import"./decode-DPztD6kB.js";const x=2*60*1e3;class b{_defaults;_idleCheckInterval;_lastUsedTime=0;_configChangeListener;_worker=null;_client=null;constructor(e){this._defaults=e,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._configChangeListener=this._defaults.onDidChange(()=>{this._stopWorker()})}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>x&&this._stopWorker()}async _getClient(){if(this._lastUsedTime=Date.now(),!this._client&&!this._worker)try{const{languageId:e,formattingOptions:s,schemas:c,externalFragmentDefinitions:a,completionSettings:l}=this._defaults;this._worker=h.createWebWorker({moduleId:"monaco-graphql/esm/GraphQLWorker.js",label:e,createData:{languageId:e,formattingOptions:s,languageConfig:{schemas:c?.map(v),externalFragmentDefinitions:a,fillLeafsOnComplete:l.__experimental__fillLeafsOnComplete}}}),this._client=this._worker.getProxy()}catch(e){console.error("error loading worker",e)}return this._client}async getLanguageServiceWorker(...e){const s=await this._getClient();return await this._worker.withSyncedResources(e),s}}class F{defaults;_worker;_disposables=[];_listener=Object.create(null);constructor(e,s){this.defaults=e,this._worker=s,this._worker=s;let c;const a=t=>{const d=f(t);if(d!==this.defaults.languageId)return;const g=t.uri.toString(),u=e.diagnosticSettings.validateVariablesJSON?.[g];c=setTimeout(()=>{this._doValidate(t.uri,d,u)},400),this._listener[g]=t.onDidChangeContent(()=>{clearTimeout(c),c=setTimeout(()=>{this._doValidate(t.uri,d,u)},400)})},l=t=>{h.setModelMarkers(t,this.defaults.languageId,[]);const d=t.uri.toString(),g=this._listener[d];g&&(g.dispose(),delete this._listener[d])};this._disposables.push(h.onDidCreateModel(a),{dispose(){clearTimeout(c)}},h.onWillDisposeModel(t=>{l(t)}),h.onDidChangeModelLanguage(t=>{l(t.model),a(t.model)}),{dispose:()=>{for(const t of Object.values(this._listener))t.dispose()}},e.onDidChange(()=>{for(const t of h.getModels())f(t)===this.defaults.languageId&&(l(t),a(t))}));for(const t of h.getModels())f(t)===this.defaults.languageId&&a(t)}dispose(){for(const e of this._disposables)e.dispose();this._disposables=[]}async _doValidate(e,s,c){const a=await this._worker(e);if(!a)return;const l=await a.doValidation(e.toString());if(h.setModelMarkers(h.getModel(e),s,l),c){if(await T(()=>import("./index-N8fONOxR.js").then(p=>p.b),__vite__mapDeps([0,1,2,3,4]),import.meta.url),!c.length)throw new Error("No variables URI strings provided to validate");const t=await a.doGetVariablesJSONSchema(e.toString());if(!t)return;const d=M.file(c[0].replace(".json","-schema.json")).toString(),g={uri:d,schema:t,fileMatch:c},u=m.json.jsonDefaults.diagnosticsOptions.schemas?.filter(p=>p.uri!==d)||[];m.json.jsonDefaults.setDiagnosticsOptions({schemaValidation:"error",validate:!0,...this.defaults.diagnosticSettings.jsonDiagnosticSettings,schemas:[...u,g],enableSchemaRequest:!1})}}}const i=m.CompletionItemKind,C={[r.Text]:i.Text,[r.Method]:i.Method,[r.Function]:i.Function,[r.Constructor]:i.Constructor,[r.Field]:i.Field,[r.Variable]:i.Variable,[r.Class]:i.Class,[r.Interface]:i.Interface,[r.Module]:i.Module,[r.Property]:i.Property,[r.Unit]:i.Unit,[r.Value]:i.Value,[r.Enum]:i.Enum,[r.Keyword]:i.Keyword,[r.Snippet]:i.Snippet,[r.Color]:i.Color,[r.File]:i.File,[r.Reference]:i.Reference,[r.Folder]:i.Folder,[r.EnumMember]:i.EnumMember,[r.Constant]:i.Constant,[r.Struct]:i.Struct,[r.Event]:i.Event,[r.Operator]:i.Operator,[r.TypeParameter]:i.TypeParameter};function E(o){return o in C?C[o]:i.Text}function O(o){return{range:o.range,kind:E(o.kind),label:o.label,insertText:o.insertText??o.label,insertTextRules:o.insertText?m.CompletionItemInsertTextRule.InsertAsSnippet:void 0,sortText:o.sortText,filterText:o.filterText,documentation:o.documentation,detail:o.detail,command:o.command}}class L{_worker;constructor(e){this._worker=e,this._worker=e}get triggerCharacters(){return[":","$"," ","(","@"]}async provideCompletionItems(e,s,c,a){try{return{incomplete:!0,suggestions:(await(await this._worker(e.uri)).doComplete(e.uri.toString(),s)).map(O)}}catch(l){return console.error("Error fetching completion items",l),{suggestions:[]}}}}class P{_worker;constructor(e){this._worker=e,this._worker=e}async provideDocumentFormattingEdits(e,s,c){const l=await(await this._worker(e.uri)).doFormat(e.uri.toString());return l?[{range:e.getFullModelRange(),text:l}]:[]}}class V{_worker;constructor(e){this._worker=e}async provideHover(e,s,c){const a=e.uri,t=await(await this._worker(e.uri)).doHover(a.toString(),s);return t?{range:t.range,contents:[{value:t.content}]}:{contents:[]}}dispose(){}}function W(o){const e=[],s=[],c=new b(o);e.push(c);const a=(...n)=>{try{return c.getLanguageServiceWorker(...n)}catch{throw new Error("Error fetching graphql language service worker")}};function l(){const{modeConfiguration:n,languageId:_}=o;n.documentFormattingEdits&&s.push(m.registerDocumentFormattingEditProvider(_,new P(a)))}function t(n){const{modeConfiguration:_,languageId:w}=o;S(s),_.completionItems&&s.push(m.registerCompletionItemProvider(w,new L(a))),_.diagnostics&&s.push(new F(n,a)),_.hovers&&s.push(m.registerHoverProvider(w,new V(a))),l()}let{modeConfiguration:d,formattingOptions:g,diagnosticSettings:u,externalFragmentDefinitions:p,schemas:k}=o;return t(o),o.onDidChange(n=>{n.modeConfiguration!==d&&(d=n.modeConfiguration,t(n)),n.formattingOptions!==g&&(g=n.formattingOptions,l()),n.externalFragmentDefinitions!==p&&(p=n.externalFragmentDefinitions,t(n)),n.diagnosticSettings!==u&&(u=n.diagnosticSettings,t(n)),n.schemas!==k&&(k=n.schemas,t(n))}),e.push(I(s)),I(e)}function I(o){return{dispose:()=>S(o)}}function S(o){for(;o.length;)o.pop().dispose()}export{W as setupMode};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as i}from"./index-
|
|
1
|
+
import{m as i}from"./index-N8fONOxR.js";import"./index-Cp668Jsm.js";import"./decode-DPztD6kB.js";/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
4
|
* Released under the MIT license
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as s}from"./index-
|
|
1
|
+
import{m as s}from"./index-N8fONOxR.js";import"./index-Cp668Jsm.js";import"./decode-DPztD6kB.js";/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
4
|
* Released under the MIT license
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bW as bt,bX as pt,r as u,bY as ft,b_ as W,j as p,b8 as N,cb as At,b$ as ht,bT as Ft,bU as St,d5 as ho,d6 as Ot,d7 as Dt,d8 as Xt,d9 as So,da as vo,bZ as lt,f as mo,db as dt,ca as D,dc as xo,dd as yo,u as go,by as Co,de as wo,df as Bo}from"./index-CEs-_h3p.js";function To(o){return pt("MuiTab",o)}const x=bt("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),Io=o=>{const{classes:t,textColor:l,fullWidth:s,wrapped:n,icon:a,label:i,selected:b,disabled:f}=o,v={root:["root",a&&i&&"labelIcon",`textColor${At(l)}`,s&&"fullWidth",n&&"wrapped",b&&"selected",f&&"disabled"],icon:["iconWrapper","icon"]};return ht(v,To,t)},Mo=N(Ft,{name:"MuiTab",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[t.root,l.label&&l.icon&&t.labelIcon,t[`textColor${At(l.textColor)}`],l.fullWidth&&t.fullWidth,l.wrapped&&t.wrapped,{[`& .${x.iconWrapper}`]:t.iconWrapper},{[`& .${x.icon}`]:t.icon}]}})(St(({theme:o})=>({...o.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:t})=>t.label&&(t.iconPosition==="top"||t.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:t})=>t.label&&t.iconPosition!=="top"&&t.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:t})=>t.icon&&t.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="top",style:{[`& > .${x.icon}`]:{marginBottom:6}}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="bottom",style:{[`& > .${x.icon}`]:{marginTop:6}}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="start",style:{[`& > .${x.icon}`]:{marginRight:o.spacing(1)}}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="end",style:{[`& > .${x.icon}`]:{marginLeft:o.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${x.selected}`]:{opacity:1},[`&.${x.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(o.vars||o).palette.text.secondary,[`&.${x.selected}`]:{color:(o.vars||o).palette.primary.main},[`&.${x.disabled}`]:{color:(o.vars||o).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(o.vars||o).palette.text.secondary,[`&.${x.selected}`]:{color:(o.vars||o).palette.secondary.main},[`&.${x.disabled}`]:{color:(o.vars||o).palette.text.disabled}}},{props:({ownerState:t})=>t.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:t})=>t.wrapped,style:{fontSize:o.typography.pxToRem(12)}}]}))),vt=u.forwardRef(function(t,l){const s=ft({props:t,name:"MuiTab"}),{className:n,disabled:a=!1,disableFocusRipple:i=!1,fullWidth:b,icon:f,iconPosition:v="top",indicator:C,label:m,onChange:S,onClick:w,onFocus:j,selected:B,selectionFollowsFocus:y,textColor:Z="inherit",value:M,wrapped:rt=!1,...E}=s,A={...s,disabled:a,disableFocusRipple:i,selected:B,icon:!!f,iconPosition:v,label:!!m,fullWidth:b,textColor:Z,wrapped:rt},K=Io(A),U=f&&m&&u.isValidElement(f)?u.cloneElement(f,{className:W(K.icon,f.props.className)}):f,_=P=>{!B&&S&&S(P,M),w&&w(P)},F=P=>{y&&!B&&S&&S(P,M),j&&j(P)};return p.jsxs(Mo,{focusRipple:!i,className:W(K.root,n),ref:l,role:"tab","aria-selected":B,disabled:a,onClick:_,onFocus:F,ownerState:A,tabIndex:B?0:-1,...E,children:[v==="top"||v==="start"?p.jsxs(u.Fragment,{children:[U,m]}):p.jsxs(u.Fragment,{children:[m,U]}),C]})});function Eo(o){return(1+Math.sin(Math.PI*o-Math.PI/2))/2}function Po(o,t,l,s={},n=()=>{}){const{ease:a=Eo,duration:i=300}=s;let b=null;const f=t[o];let v=!1;const C=()=>{v=!0},m=S=>{if(v){n(new Error("Animation cancelled"));return}b===null&&(b=S);const w=Math.min(1,(S-b)/i);if(t[o]=a(w)*(l-f)+f,w>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(m)};return f===l?(n(new Error("Element already at target position")),C):(requestAnimationFrame(m),C)}const Ro={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function ko(o){const{onChange:t,...l}=o,s=u.useRef(),n=u.useRef(null),a=()=>{s.current=n.current.offsetHeight-n.current.clientHeight};return ho(()=>{const i=Ot(()=>{const f=s.current;a(),f!==s.current&&t(s.current)}),b=Dt(n.current);return b.addEventListener("resize",i),()=>{i.clear(),b.removeEventListener("resize",i)}},[t]),u.useEffect(()=>{a(),t(s.current)},[t]),p.jsx("div",{style:Ro,...l,ref:n})}function zo(o){return pt("MuiTabScrollButton",o)}const Wo=bt("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),jo=o=>{const{classes:t,orientation:l,disabled:s}=o;return ht({root:["root",l,s&&"disabled"]},zo,t)},Ho=N(Ft,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[t.root,l.orientation&&t[l.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${Wo.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),$o=u.forwardRef(function(t,l){const s=ft({props:t,name:"MuiTabScrollButton"}),{className:n,slots:a={},slotProps:i={},direction:b,orientation:f,disabled:v,...C}=s,m=Xt(),S={isRtl:m,...s},w=jo(S),j=a.StartScrollButtonIcon??So,B=a.EndScrollButtonIcon??vo,y=lt({elementType:j,externalSlotProps:i.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S}),Z=lt({elementType:B,externalSlotProps:i.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S});return p.jsx(Ho,{component:"div",className:W(w.root,n),ref:l,role:null,ownerState:S,tabIndex:null,...C,style:{...C.style,...f==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${m?-90:90}deg)`}},children:b==="left"?p.jsx(j,{...y}):p.jsx(B,{...Z})})});function Lo(o){return pt("MuiTabs",o)}const ut=bt("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Ht=(o,t)=>o===t?o.firstChild:t&&t.nextElementSibling?t.nextElementSibling:o.firstChild,$t=(o,t)=>o===t?o.lastChild:t&&t.previousElementSibling?t.previousElementSibling:o.lastChild,et=(o,t,l)=>{let s=!1,n=l(o,t);for(;n;){if(n===o.firstChild){if(s)return;s=!0}const a=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||a)n=l(o,n);else{n.focus();return}}},No=o=>{const{vertical:t,fixed:l,hideScrollbar:s,scrollableX:n,scrollableY:a,centered:i,scrollButtonsHideMobile:b,classes:f}=o;return ht({root:["root",t&&"vertical"],scroller:["scroller",l&&"fixed",s&&"hideScrollbar",n&&"scrollableX",a&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",i&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",b&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[s&&"hideScrollbar"]},Lo,f)},Ao=N("div",{name:"MuiTabs",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[{[`& .${ut.scrollButtons}`]:t.scrollButtons},{[`& .${ut.scrollButtons}`]:l.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,l.vertical&&t.vertical]}})(St(({theme:o})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.scrollButtonsHideMobile,style:{[`& .${ut.scrollButtons}`]:{[o.breakpoints.down("sm")]:{display:"none"}}}}]}))),Fo=N("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[t.scroller,l.fixed&&t.fixed,l.hideScrollbar&&t.hideScrollbar,l.scrollableX&&t.scrollableX,l.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:o})=>o.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:o})=>o.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:o})=>o.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:o})=>o.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),Oo=N("div",{name:"MuiTabs",slot:"List",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[t.list,t.flexContainer,l.vertical&&t.flexContainerVertical,l.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:o})=>o.vertical,style:{flexDirection:"column"}},{props:({ownerState:o})=>o.centered,style:{justifyContent:"center"}}]}),Do=N("span",{name:"MuiTabs",slot:"Indicator"})(St(({theme:o})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:o.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(o.vars||o).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(o.vars||o).palette.secondary.main}},{props:({ownerState:t})=>t.vertical,style:{height:"100%",width:2,right:0}}]}))),Xo=N(ko)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Lt={},mt=u.forwardRef(function(t,l){const s=ft({props:t,name:"MuiTabs"}),n=mo(),a=Xt(),{"aria-label":i,"aria-labelledby":b,action:f,centered:v=!1,children:C,className:m,component:S="div",allowScrollButtonsMobile:w=!1,indicatorColor:j="primary",onChange:B,orientation:y="horizontal",ScrollButtonComponent:Z,scrollButtons:M="auto",selectionFollowsFocus:rt,slots:E={},slotProps:A={},TabIndicatorProps:K={},TabScrollButtonProps:U={},textColor:_="primary",value:F,variant:P="standard",visibleScrollbar:nt=!1,...Kt}=s,T=P==="scrollable",g=y==="vertical",Y=g?"scrollTop":"scrollLeft",J=g?"top":"left",Q=g?"bottom":"right",st=g?"clientHeight":"clientWidth",V=g?"height":"width",R={...s,component:S,allowScrollButtonsMobile:w,indicatorColor:j,orientation:y,vertical:g,scrollButtons:M,textColor:_,variant:P,visibleScrollbar:nt,fixed:!T,hideScrollbar:T&&!nt,scrollableX:T&&!g,scrollableY:T&&g,centered:v&&!T,scrollButtonsHideMobile:!w},z=No(R),Ut=lt({elementType:E.StartScrollButtonIcon,externalSlotProps:A.startScrollButtonIcon,ownerState:R}),Yt=lt({elementType:E.EndScrollButtonIcon,externalSlotProps:A.endScrollButtonIcon,ownerState:R}),[xt,Vt]=u.useState(!1),[H,yt]=u.useState(Lt),[gt,qt]=u.useState(!1),[Ct,Gt]=u.useState(!1),[wt,Zt]=u.useState(!1),[Bt,_t]=u.useState({overflow:"hidden",scrollbarWidth:0}),Tt=new Map,k=u.useRef(null),$=u.useRef(null),O={slots:E,slotProps:{indicator:K,scrollButton:U,...A}},It=()=>{const e=k.current;let r;if(e){const c=e.getBoundingClientRect();r={clientWidth:e.clientWidth,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollWidth:e.scrollWidth,top:c.top,bottom:c.bottom,left:c.left,right:c.right}}let d;if(e&&F!==!1){const c=$.current.children;if(c.length>0){const h=c[Tt.get(F)];d=h?h.getBoundingClientRect():null}}return{tabsMeta:r,tabMeta:d}},q=dt(()=>{const{tabsMeta:e,tabMeta:r}=It();let d=0,c;g?(c="top",r&&e&&(d=r.top-e.top+e.scrollTop)):(c=a?"right":"left",r&&e&&(d=(a?-1:1)*(r[c]-e[c]+e.scrollLeft)));const h={[c]:d,[V]:r?r[V]:0};if(typeof H[c]!="number"||typeof H[V]!="number")yt(h);else{const I=Math.abs(H[c]-h[c]),L=Math.abs(H[V]-h[V]);(I>=1||L>=1)&&yt(h)}}),at=(e,{animation:r=!0}={})=>{r?Po(Y,k.current,e,{duration:n.transitions.duration.standard}):k.current[Y]=e},Mt=e=>{let r=k.current[Y];g?r+=e:r+=e*(a?-1:1),at(r)},Et=()=>{const e=k.current[st];let r=0;const d=Array.from($.current.children);for(let c=0;c<d.length;c+=1){const h=d[c];if(r+h[st]>e){c===0&&(r=e);break}r+=h[st]}return r},Jt=()=>{Mt(-1*Et())},Qt=()=>{Mt(Et())},[to,{onChange:Pt,...oo}]=D("scrollbar",{className:W(z.scrollableX,z.hideScrollbar),elementType:Xo,shouldForwardComponentProp:!0,externalForwardedProps:O,ownerState:R}),eo=u.useCallback(e=>{Pt?.(e),_t({overflow:null,scrollbarWidth:e})},[Pt]),[Rt,kt]=D("scrollButtons",{className:W(z.scrollButtons,U.className),elementType:$o,externalForwardedProps:O,ownerState:R,additionalProps:{orientation:y,slots:{StartScrollButtonIcon:E.startScrollButtonIcon||E.StartScrollButtonIcon,EndScrollButtonIcon:E.endScrollButtonIcon||E.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:Ut,endScrollButtonIcon:Yt}}}),lo=()=>{const e={};e.scrollbarSizeListener=T?p.jsx(to,{...oo,onChange:eo}):null;const d=T&&(M==="auto"&&(gt||Ct)||M===!0);return e.scrollButtonStart=d?p.jsx(Rt,{direction:a?"right":"left",onClick:Jt,disabled:!gt,...kt}):null,e.scrollButtonEnd=d?p.jsx(Rt,{direction:a?"left":"right",onClick:Qt,disabled:!Ct,...kt}):null,e},zt=dt(e=>{const{tabsMeta:r,tabMeta:d}=It();if(!(!d||!r)){if(d[J]<r[J]){const c=r[Y]+(d[J]-r[J]);at(c,{animation:e})}else if(d[Q]>r[Q]){const c=r[Y]+(d[Q]-r[Q]);at(c,{animation:e})}}}),tt=dt(()=>{T&&M!==!1&&Zt(!wt)});u.useEffect(()=>{const e=Ot(()=>{k.current&&q()});let r;const d=I=>{I.forEach(L=>{L.removedNodes.forEach(G=>{r?.unobserve(G)}),L.addedNodes.forEach(G=>{r?.observe(G)})}),e(),tt()},c=Dt(k.current);c.addEventListener("resize",e);let h;return typeof ResizeObserver<"u"&&(r=new ResizeObserver(e),Array.from($.current.children).forEach(I=>{r.observe(I)})),typeof MutationObserver<"u"&&(h=new MutationObserver(d),h.observe($.current,{childList:!0})),()=>{e.clear(),c.removeEventListener("resize",e),h?.disconnect(),r?.disconnect()}},[q,tt]),u.useEffect(()=>{const e=Array.from($.current.children),r=e.length;if(typeof IntersectionObserver<"u"&&r>0&&T&&M!==!1){const d=e[0],c=e[r-1],h={root:k.current,threshold:.99},I=ct=>{qt(!ct[0].isIntersecting)},L=new IntersectionObserver(I,h);L.observe(d);const G=ct=>{Gt(!ct[0].isIntersecting)},jt=new IntersectionObserver(G,h);return jt.observe(c),()=>{L.disconnect(),jt.disconnect()}}},[T,M,wt,C?.length]),u.useEffect(()=>{Vt(!0)},[]),u.useEffect(()=>{q()}),u.useEffect(()=>{zt(Lt!==H)},[zt,H]),u.useImperativeHandle(f,()=>({updateIndicator:q,updateScrollButtons:tt}),[q,tt]);const[ro,no]=D("indicator",{className:W(z.indicator,K.className),elementType:Do,externalForwardedProps:O,ownerState:R,additionalProps:{style:H}}),Wt=p.jsx(ro,{...no});let ot=0;const so=u.Children.map(C,e=>{if(!u.isValidElement(e))return null;const r=e.props.value===void 0?ot:e.props.value;Tt.set(r,ot);const d=r===F;return ot+=1,u.cloneElement(e,{fullWidth:P==="fullWidth",indicator:d&&!xt&&Wt,selected:d,selectionFollowsFocus:rt,onChange:B,textColor:_,value:r,...ot===1&&F===!1&&!e.props.tabIndex?{tabIndex:0}:{}})}),ao=e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey)return;const r=$.current,d=xo(r).activeElement;if(d.getAttribute("role")!=="tab")return;let h=y==="horizontal"?"ArrowLeft":"ArrowUp",I=y==="horizontal"?"ArrowRight":"ArrowDown";switch(y==="horizontal"&&a&&(h="ArrowRight",I="ArrowLeft"),e.key){case h:e.preventDefault(),et(r,d,$t);break;case I:e.preventDefault(),et(r,d,Ht);break;case"Home":e.preventDefault(),et(r,null,Ht);break;case"End":e.preventDefault(),et(r,null,$t);break}},it=lo(),[io,co]=D("root",{ref:l,className:W(z.root,m),elementType:Ao,externalForwardedProps:{...O,...Kt,component:S},ownerState:R}),[uo,bo]=D("scroller",{ref:k,className:z.scroller,elementType:Fo,externalForwardedProps:O,ownerState:R,additionalProps:{style:{overflow:Bt.overflow,[g?`margin${a?"Left":"Right"}`:"marginBottom"]:nt?void 0:-Bt.scrollbarWidth}}}),[po,fo]=D("list",{ref:$,className:W(z.list,z.flexContainer),elementType:Oo,externalForwardedProps:O,ownerState:R,getSlotProps:e=>({...e,onKeyDown:r=>{ao(r),e.onKeyDown?.(r)}})});return p.jsxs(io,{...co,children:[it.scrollButtonStart,it.scrollbarSizeListener,p.jsxs(uo,{...bo,children:[p.jsx(po,{"aria-label":i,"aria-labelledby":b,"aria-orientation":y==="vertical"?"vertical":null,role:"tablist",...fo,children:so}),xt&&Wt]}),it.scrollButtonEnd]})}),Nt="index",X={tabs:`${Nt}-tabs`,tab:`${Nt}-tab`},Ko=yo(mt)(({theme:o})=>({[`& .${X.tabs}`]:{},[`& .${X.tab}`]:{fontSize:"0.875rem",[o.breakpoints.up("md")]:{fontSize:"1rem"}}}));function Uo({tabs:o,current:t,onChange:l,iconPosition:s=void 0,enableTabClick:n=!1,...a}){return p.jsx(mt,{scrollButtons:"auto",value:t,onChange:(i,b)=>!n&&l(b),...a,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":{borderRadius:"100vw"},".MuiTabs-flexContainer":{borderRadius:"100vw",backgroundColor:"grey.100",padding:.5,display:"inline-flex",columnGap:.25,maxWidth:"100%",overflowX:"auto"},".MuiTab-root":{borderRadius:"100vw",border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,color:"text.secondary",fontSize:"13px",fontWeight:"normal",textTransform:"capitalize",transition:"background-color 0.2s ease","&.Mui-selected, &:hover":{backgroundColor:"action.selected",borderColor:"grey.100",color:"grey.A700"}},".MuiTabs-indicator":{display:"none"},...a.sx},children:o.map(i=>p.jsx(vt,{className:X.tab,value:i.value,label:i.label,icon:i.icon,iconPosition:s,onClick:()=>n&&l(i.value)},i.value))})}function Yo({tabs:o,current:t,onChange:l,iconPosition:s=void 0,enableTabClick:n=!1,...a}){return p.jsx(mt,{scrollButtons:"auto",value:t,onChange:(i,b)=>!n&&l(b),...a,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":a.orientation!=="vertical"?{"&::after":{content:'""',display:"block",position:"sticky",left:0,zIndex:-1,width:"100%",height:"1px",backgroundColor:"grey.300"}}:{},".MuiTabs-flexContainer":{display:"inline-flex",columnGap:2.5,px:0,pb:.5},".MuiTab-root":{border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,px:0,color:"text.secondary",fontSize:"14px",fontWeight:500,textTransform:"capitalize",minWidth:"auto","&.Mui-selected, &:hover":{color:"primary.main"}},".MuiTabs-indicator":{height:"1px",backgroundColor:"primary.main"},...a.sx},children:o.map(i=>p.jsx(vt,{className:X.tab,value:i.value,label:i.label,icon:i.icon,iconPosition:s,onClick:()=>n&&l(i.value)},i.value))})}function qo({tabs:o,current:t,onChange:l,variant:s=void 0,iconPosition:n=void 0,enableTabClick:a=!1,...i}){return s==="card"?p.jsx(Uo,{...i,tabs:o,current:t,enableTabClick:a,onChange:l,iconPosition:n}):s==="line"?p.jsx(Yo,{...i,tabs:o,current:t,enableTabClick:a,onChange:l,iconPosition:n}):p.jsx(Ko,{scrollButtons:"auto",variant:"scrollable",value:t,onChange:(b,f)=>!a&&l(f),indicatorColor:"primary",...i,className:[X.tabs,i.className||""].join(" "),children:o.map(b=>p.jsx(vt,{className:X.tab,value:b.value,label:b.label,icon:b.icon,iconPosition:n,onClick:()=>a&&l(b.value)},b.value))})}function Go(o,t=""){const{info:l}=go(),s=Co(()=>{const n=o?.breadcrumbsLabel||o?.label||"";return wo(n,t,l)},[o,t,l]);return s?p.jsx(Bo,{children:p.jsx("title",{children:s})}):null}export{qo as T,vt as a,mt as b,ut as t,Go as u};
|
|
1
|
+
import{bW as bt,bX as pt,r as u,bY as ft,b_ as W,j as p,b8 as N,cb as At,b$ as ht,bT as Ft,bU as St,d5 as ho,d6 as Ot,d7 as Dt,d8 as Xt,d9 as So,da as vo,bZ as lt,f as mo,db as dt,ca as D,dc as xo,dd as yo,u as go,by as Co,de as wo,df as Bo}from"./index-Cp668Jsm.js";function To(o){return pt("MuiTab",o)}const x=bt("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),Io=o=>{const{classes:t,textColor:l,fullWidth:s,wrapped:n,icon:a,label:i,selected:b,disabled:f}=o,v={root:["root",a&&i&&"labelIcon",`textColor${At(l)}`,s&&"fullWidth",n&&"wrapped",b&&"selected",f&&"disabled"],icon:["iconWrapper","icon"]};return ht(v,To,t)},Mo=N(Ft,{name:"MuiTab",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[t.root,l.label&&l.icon&&t.labelIcon,t[`textColor${At(l.textColor)}`],l.fullWidth&&t.fullWidth,l.wrapped&&t.wrapped,{[`& .${x.iconWrapper}`]:t.iconWrapper},{[`& .${x.icon}`]:t.icon}]}})(St(({theme:o})=>({...o.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:t})=>t.label&&(t.iconPosition==="top"||t.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:t})=>t.label&&t.iconPosition!=="top"&&t.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:t})=>t.icon&&t.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="top",style:{[`& > .${x.icon}`]:{marginBottom:6}}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="bottom",style:{[`& > .${x.icon}`]:{marginTop:6}}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="start",style:{[`& > .${x.icon}`]:{marginRight:o.spacing(1)}}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="end",style:{[`& > .${x.icon}`]:{marginLeft:o.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${x.selected}`]:{opacity:1},[`&.${x.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(o.vars||o).palette.text.secondary,[`&.${x.selected}`]:{color:(o.vars||o).palette.primary.main},[`&.${x.disabled}`]:{color:(o.vars||o).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(o.vars||o).palette.text.secondary,[`&.${x.selected}`]:{color:(o.vars||o).palette.secondary.main},[`&.${x.disabled}`]:{color:(o.vars||o).palette.text.disabled}}},{props:({ownerState:t})=>t.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:t})=>t.wrapped,style:{fontSize:o.typography.pxToRem(12)}}]}))),vt=u.forwardRef(function(t,l){const s=ft({props:t,name:"MuiTab"}),{className:n,disabled:a=!1,disableFocusRipple:i=!1,fullWidth:b,icon:f,iconPosition:v="top",indicator:C,label:m,onChange:S,onClick:w,onFocus:j,selected:B,selectionFollowsFocus:y,textColor:Z="inherit",value:M,wrapped:rt=!1,...E}=s,A={...s,disabled:a,disableFocusRipple:i,selected:B,icon:!!f,iconPosition:v,label:!!m,fullWidth:b,textColor:Z,wrapped:rt},K=Io(A),U=f&&m&&u.isValidElement(f)?u.cloneElement(f,{className:W(K.icon,f.props.className)}):f,_=P=>{!B&&S&&S(P,M),w&&w(P)},F=P=>{y&&!B&&S&&S(P,M),j&&j(P)};return p.jsxs(Mo,{focusRipple:!i,className:W(K.root,n),ref:l,role:"tab","aria-selected":B,disabled:a,onClick:_,onFocus:F,ownerState:A,tabIndex:B?0:-1,...E,children:[v==="top"||v==="start"?p.jsxs(u.Fragment,{children:[U,m]}):p.jsxs(u.Fragment,{children:[m,U]}),C]})});function Eo(o){return(1+Math.sin(Math.PI*o-Math.PI/2))/2}function Po(o,t,l,s={},n=()=>{}){const{ease:a=Eo,duration:i=300}=s;let b=null;const f=t[o];let v=!1;const C=()=>{v=!0},m=S=>{if(v){n(new Error("Animation cancelled"));return}b===null&&(b=S);const w=Math.min(1,(S-b)/i);if(t[o]=a(w)*(l-f)+f,w>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(m)};return f===l?(n(new Error("Element already at target position")),C):(requestAnimationFrame(m),C)}const Ro={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function ko(o){const{onChange:t,...l}=o,s=u.useRef(),n=u.useRef(null),a=()=>{s.current=n.current.offsetHeight-n.current.clientHeight};return ho(()=>{const i=Ot(()=>{const f=s.current;a(),f!==s.current&&t(s.current)}),b=Dt(n.current);return b.addEventListener("resize",i),()=>{i.clear(),b.removeEventListener("resize",i)}},[t]),u.useEffect(()=>{a(),t(s.current)},[t]),p.jsx("div",{style:Ro,...l,ref:n})}function zo(o){return pt("MuiTabScrollButton",o)}const Wo=bt("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),jo=o=>{const{classes:t,orientation:l,disabled:s}=o;return ht({root:["root",l,s&&"disabled"]},zo,t)},Ho=N(Ft,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[t.root,l.orientation&&t[l.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${Wo.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),$o=u.forwardRef(function(t,l){const s=ft({props:t,name:"MuiTabScrollButton"}),{className:n,slots:a={},slotProps:i={},direction:b,orientation:f,disabled:v,...C}=s,m=Xt(),S={isRtl:m,...s},w=jo(S),j=a.StartScrollButtonIcon??So,B=a.EndScrollButtonIcon??vo,y=lt({elementType:j,externalSlotProps:i.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S}),Z=lt({elementType:B,externalSlotProps:i.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S});return p.jsx(Ho,{component:"div",className:W(w.root,n),ref:l,role:null,ownerState:S,tabIndex:null,...C,style:{...C.style,...f==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${m?-90:90}deg)`}},children:b==="left"?p.jsx(j,{...y}):p.jsx(B,{...Z})})});function Lo(o){return pt("MuiTabs",o)}const ut=bt("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Ht=(o,t)=>o===t?o.firstChild:t&&t.nextElementSibling?t.nextElementSibling:o.firstChild,$t=(o,t)=>o===t?o.lastChild:t&&t.previousElementSibling?t.previousElementSibling:o.lastChild,et=(o,t,l)=>{let s=!1,n=l(o,t);for(;n;){if(n===o.firstChild){if(s)return;s=!0}const a=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||a)n=l(o,n);else{n.focus();return}}},No=o=>{const{vertical:t,fixed:l,hideScrollbar:s,scrollableX:n,scrollableY:a,centered:i,scrollButtonsHideMobile:b,classes:f}=o;return ht({root:["root",t&&"vertical"],scroller:["scroller",l&&"fixed",s&&"hideScrollbar",n&&"scrollableX",a&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",i&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",b&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[s&&"hideScrollbar"]},Lo,f)},Ao=N("div",{name:"MuiTabs",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[{[`& .${ut.scrollButtons}`]:t.scrollButtons},{[`& .${ut.scrollButtons}`]:l.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,l.vertical&&t.vertical]}})(St(({theme:o})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.scrollButtonsHideMobile,style:{[`& .${ut.scrollButtons}`]:{[o.breakpoints.down("sm")]:{display:"none"}}}}]}))),Fo=N("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[t.scroller,l.fixed&&t.fixed,l.hideScrollbar&&t.hideScrollbar,l.scrollableX&&t.scrollableX,l.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:o})=>o.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:o})=>o.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:o})=>o.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:o})=>o.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),Oo=N("div",{name:"MuiTabs",slot:"List",overridesResolver:(o,t)=>{const{ownerState:l}=o;return[t.list,t.flexContainer,l.vertical&&t.flexContainerVertical,l.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:o})=>o.vertical,style:{flexDirection:"column"}},{props:({ownerState:o})=>o.centered,style:{justifyContent:"center"}}]}),Do=N("span",{name:"MuiTabs",slot:"Indicator"})(St(({theme:o})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:o.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(o.vars||o).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(o.vars||o).palette.secondary.main}},{props:({ownerState:t})=>t.vertical,style:{height:"100%",width:2,right:0}}]}))),Xo=N(ko)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Lt={},mt=u.forwardRef(function(t,l){const s=ft({props:t,name:"MuiTabs"}),n=mo(),a=Xt(),{"aria-label":i,"aria-labelledby":b,action:f,centered:v=!1,children:C,className:m,component:S="div",allowScrollButtonsMobile:w=!1,indicatorColor:j="primary",onChange:B,orientation:y="horizontal",ScrollButtonComponent:Z,scrollButtons:M="auto",selectionFollowsFocus:rt,slots:E={},slotProps:A={},TabIndicatorProps:K={},TabScrollButtonProps:U={},textColor:_="primary",value:F,variant:P="standard",visibleScrollbar:nt=!1,...Kt}=s,T=P==="scrollable",g=y==="vertical",Y=g?"scrollTop":"scrollLeft",J=g?"top":"left",Q=g?"bottom":"right",st=g?"clientHeight":"clientWidth",V=g?"height":"width",R={...s,component:S,allowScrollButtonsMobile:w,indicatorColor:j,orientation:y,vertical:g,scrollButtons:M,textColor:_,variant:P,visibleScrollbar:nt,fixed:!T,hideScrollbar:T&&!nt,scrollableX:T&&!g,scrollableY:T&&g,centered:v&&!T,scrollButtonsHideMobile:!w},z=No(R),Ut=lt({elementType:E.StartScrollButtonIcon,externalSlotProps:A.startScrollButtonIcon,ownerState:R}),Yt=lt({elementType:E.EndScrollButtonIcon,externalSlotProps:A.endScrollButtonIcon,ownerState:R}),[xt,Vt]=u.useState(!1),[H,yt]=u.useState(Lt),[gt,qt]=u.useState(!1),[Ct,Gt]=u.useState(!1),[wt,Zt]=u.useState(!1),[Bt,_t]=u.useState({overflow:"hidden",scrollbarWidth:0}),Tt=new Map,k=u.useRef(null),$=u.useRef(null),O={slots:E,slotProps:{indicator:K,scrollButton:U,...A}},It=()=>{const e=k.current;let r;if(e){const c=e.getBoundingClientRect();r={clientWidth:e.clientWidth,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollWidth:e.scrollWidth,top:c.top,bottom:c.bottom,left:c.left,right:c.right}}let d;if(e&&F!==!1){const c=$.current.children;if(c.length>0){const h=c[Tt.get(F)];d=h?h.getBoundingClientRect():null}}return{tabsMeta:r,tabMeta:d}},q=dt(()=>{const{tabsMeta:e,tabMeta:r}=It();let d=0,c;g?(c="top",r&&e&&(d=r.top-e.top+e.scrollTop)):(c=a?"right":"left",r&&e&&(d=(a?-1:1)*(r[c]-e[c]+e.scrollLeft)));const h={[c]:d,[V]:r?r[V]:0};if(typeof H[c]!="number"||typeof H[V]!="number")yt(h);else{const I=Math.abs(H[c]-h[c]),L=Math.abs(H[V]-h[V]);(I>=1||L>=1)&&yt(h)}}),at=(e,{animation:r=!0}={})=>{r?Po(Y,k.current,e,{duration:n.transitions.duration.standard}):k.current[Y]=e},Mt=e=>{let r=k.current[Y];g?r+=e:r+=e*(a?-1:1),at(r)},Et=()=>{const e=k.current[st];let r=0;const d=Array.from($.current.children);for(let c=0;c<d.length;c+=1){const h=d[c];if(r+h[st]>e){c===0&&(r=e);break}r+=h[st]}return r},Jt=()=>{Mt(-1*Et())},Qt=()=>{Mt(Et())},[to,{onChange:Pt,...oo}]=D("scrollbar",{className:W(z.scrollableX,z.hideScrollbar),elementType:Xo,shouldForwardComponentProp:!0,externalForwardedProps:O,ownerState:R}),eo=u.useCallback(e=>{Pt?.(e),_t({overflow:null,scrollbarWidth:e})},[Pt]),[Rt,kt]=D("scrollButtons",{className:W(z.scrollButtons,U.className),elementType:$o,externalForwardedProps:O,ownerState:R,additionalProps:{orientation:y,slots:{StartScrollButtonIcon:E.startScrollButtonIcon||E.StartScrollButtonIcon,EndScrollButtonIcon:E.endScrollButtonIcon||E.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:Ut,endScrollButtonIcon:Yt}}}),lo=()=>{const e={};e.scrollbarSizeListener=T?p.jsx(to,{...oo,onChange:eo}):null;const d=T&&(M==="auto"&&(gt||Ct)||M===!0);return e.scrollButtonStart=d?p.jsx(Rt,{direction:a?"right":"left",onClick:Jt,disabled:!gt,...kt}):null,e.scrollButtonEnd=d?p.jsx(Rt,{direction:a?"left":"right",onClick:Qt,disabled:!Ct,...kt}):null,e},zt=dt(e=>{const{tabsMeta:r,tabMeta:d}=It();if(!(!d||!r)){if(d[J]<r[J]){const c=r[Y]+(d[J]-r[J]);at(c,{animation:e})}else if(d[Q]>r[Q]){const c=r[Y]+(d[Q]-r[Q]);at(c,{animation:e})}}}),tt=dt(()=>{T&&M!==!1&&Zt(!wt)});u.useEffect(()=>{const e=Ot(()=>{k.current&&q()});let r;const d=I=>{I.forEach(L=>{L.removedNodes.forEach(G=>{r?.unobserve(G)}),L.addedNodes.forEach(G=>{r?.observe(G)})}),e(),tt()},c=Dt(k.current);c.addEventListener("resize",e);let h;return typeof ResizeObserver<"u"&&(r=new ResizeObserver(e),Array.from($.current.children).forEach(I=>{r.observe(I)})),typeof MutationObserver<"u"&&(h=new MutationObserver(d),h.observe($.current,{childList:!0})),()=>{e.clear(),c.removeEventListener("resize",e),h?.disconnect(),r?.disconnect()}},[q,tt]),u.useEffect(()=>{const e=Array.from($.current.children),r=e.length;if(typeof IntersectionObserver<"u"&&r>0&&T&&M!==!1){const d=e[0],c=e[r-1],h={root:k.current,threshold:.99},I=ct=>{qt(!ct[0].isIntersecting)},L=new IntersectionObserver(I,h);L.observe(d);const G=ct=>{Gt(!ct[0].isIntersecting)},jt=new IntersectionObserver(G,h);return jt.observe(c),()=>{L.disconnect(),jt.disconnect()}}},[T,M,wt,C?.length]),u.useEffect(()=>{Vt(!0)},[]),u.useEffect(()=>{q()}),u.useEffect(()=>{zt(Lt!==H)},[zt,H]),u.useImperativeHandle(f,()=>({updateIndicator:q,updateScrollButtons:tt}),[q,tt]);const[ro,no]=D("indicator",{className:W(z.indicator,K.className),elementType:Do,externalForwardedProps:O,ownerState:R,additionalProps:{style:H}}),Wt=p.jsx(ro,{...no});let ot=0;const so=u.Children.map(C,e=>{if(!u.isValidElement(e))return null;const r=e.props.value===void 0?ot:e.props.value;Tt.set(r,ot);const d=r===F;return ot+=1,u.cloneElement(e,{fullWidth:P==="fullWidth",indicator:d&&!xt&&Wt,selected:d,selectionFollowsFocus:rt,onChange:B,textColor:_,value:r,...ot===1&&F===!1&&!e.props.tabIndex?{tabIndex:0}:{}})}),ao=e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey)return;const r=$.current,d=xo(r).activeElement;if(d.getAttribute("role")!=="tab")return;let h=y==="horizontal"?"ArrowLeft":"ArrowUp",I=y==="horizontal"?"ArrowRight":"ArrowDown";switch(y==="horizontal"&&a&&(h="ArrowRight",I="ArrowLeft"),e.key){case h:e.preventDefault(),et(r,d,$t);break;case I:e.preventDefault(),et(r,d,Ht);break;case"Home":e.preventDefault(),et(r,null,Ht);break;case"End":e.preventDefault(),et(r,null,$t);break}},it=lo(),[io,co]=D("root",{ref:l,className:W(z.root,m),elementType:Ao,externalForwardedProps:{...O,...Kt,component:S},ownerState:R}),[uo,bo]=D("scroller",{ref:k,className:z.scroller,elementType:Fo,externalForwardedProps:O,ownerState:R,additionalProps:{style:{overflow:Bt.overflow,[g?`margin${a?"Left":"Right"}`:"marginBottom"]:nt?void 0:-Bt.scrollbarWidth}}}),[po,fo]=D("list",{ref:$,className:W(z.list,z.flexContainer),elementType:Oo,externalForwardedProps:O,ownerState:R,getSlotProps:e=>({...e,onKeyDown:r=>{ao(r),e.onKeyDown?.(r)}})});return p.jsxs(io,{...co,children:[it.scrollButtonStart,it.scrollbarSizeListener,p.jsxs(uo,{...bo,children:[p.jsx(po,{"aria-label":i,"aria-labelledby":b,"aria-orientation":y==="vertical"?"vertical":null,role:"tablist",...fo,children:so}),xt&&Wt]}),it.scrollButtonEnd]})}),Nt="index",X={tabs:`${Nt}-tabs`,tab:`${Nt}-tab`},Ko=yo(mt)(({theme:o})=>({[`& .${X.tabs}`]:{},[`& .${X.tab}`]:{fontSize:"0.875rem",[o.breakpoints.up("md")]:{fontSize:"1rem"}}}));function Uo({tabs:o,current:t,onChange:l,iconPosition:s=void 0,enableTabClick:n=!1,...a}){return p.jsx(mt,{scrollButtons:"auto",value:t,onChange:(i,b)=>!n&&l(b),...a,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":{borderRadius:"100vw"},".MuiTabs-flexContainer":{borderRadius:"100vw",backgroundColor:"grey.100",padding:.5,display:"inline-flex",columnGap:.25,maxWidth:"100%",overflowX:"auto"},".MuiTab-root":{borderRadius:"100vw",border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,color:"text.secondary",fontSize:"13px",fontWeight:"normal",textTransform:"capitalize",transition:"background-color 0.2s ease","&.Mui-selected, &:hover":{backgroundColor:"action.selected",borderColor:"grey.100",color:"grey.A700"}},".MuiTabs-indicator":{display:"none"},...a.sx},children:o.map(i=>p.jsx(vt,{className:X.tab,value:i.value,label:i.label,icon:i.icon,iconPosition:s,onClick:()=>n&&l(i.value)},i.value))})}function Yo({tabs:o,current:t,onChange:l,iconPosition:s=void 0,enableTabClick:n=!1,...a}){return p.jsx(mt,{scrollButtons:"auto",value:t,onChange:(i,b)=>!n&&l(b),...a,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":a.orientation!=="vertical"?{"&::after":{content:'""',display:"block",position:"sticky",left:0,zIndex:-1,width:"100%",height:"1px",backgroundColor:"grey.300"}}:{},".MuiTabs-flexContainer":{display:"inline-flex",columnGap:2.5,px:0,pb:.5},".MuiTab-root":{border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,px:0,color:"text.secondary",fontSize:"14px",fontWeight:500,textTransform:"capitalize",minWidth:"auto","&.Mui-selected, &:hover":{color:"primary.main"}},".MuiTabs-indicator":{height:"1px",backgroundColor:"primary.main"},...a.sx},children:o.map(i=>p.jsx(vt,{className:X.tab,value:i.value,label:i.label,icon:i.icon,iconPosition:s,onClick:()=>n&&l(i.value)},i.value))})}function qo({tabs:o,current:t,onChange:l,variant:s=void 0,iconPosition:n=void 0,enableTabClick:a=!1,...i}){return s==="card"?p.jsx(Uo,{...i,tabs:o,current:t,enableTabClick:a,onChange:l,iconPosition:n}):s==="line"?p.jsx(Yo,{...i,tabs:o,current:t,enableTabClick:a,onChange:l,iconPosition:n}):p.jsx(Ko,{scrollButtons:"auto",variant:"scrollable",value:t,onChange:(b,f)=>!a&&l(f),indicatorColor:"primary",...i,className:[X.tabs,i.className||""].join(" "),children:o.map(b=>p.jsx(vt,{className:X.tab,value:b.value,label:b.label,icon:b.icon,iconPosition:n,onClick:()=>a&&l(b.value)},b.value))})}function Go(o,t=""){const{info:l}=go(),s=Co(()=>{const n=o?.breadcrumbsLabel||o?.label||"";return wo(n,t,l)},[o,t,l]);return s?p.jsx(Bo,{children:p.jsx("title",{children:s})}):null}export{qo as T,vt as a,mt as b,ut as t,Go as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as lt}from"./index-
|
|
1
|
+
import{m as lt}from"./index-N8fONOxR.js";import"./index-Cp668Jsm.js";import"./decode-DPztD6kB.js";/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
4
|
* Released under the MIT license
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{gZ as E,be as L}from"./index-
|
|
1
|
+
import{gZ as E,be as L}from"./index-Cp668Jsm.js";const U=({url:r,allowFullScreen:o,position:a,display:u,height:i,width:y,overflow:c,styles:f,onLoad:p,onMouseOver:b,onMouseOut:w,scrolling:d,id:m,frameBorder:t,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:P,name:v,target:A,loading:F,importance:I,referrerpolicy:M,allowpaymentrequest:S,src:q,key:x})=>{const n=E({src:q||r,target:A||null,style:{position:a||null,display:u||"initial",overflow:c||null},scrolling:d||null,allowpaymentrequest:S||null,importance:I||null,sandbox:s&&[...s].join(" ")||null,loading:F||null,styles:f||null,name:v||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:m||null,"aria-labelledby":P||null,"aria-hidden":O||null,"aria-label":k||null,width:y||null,height:i||null,onLoad:p||null,onMouseOver:b||null,onMouseOut:w||null,key:x||"iframe"});let l=Object.create(null);for(let e of Object.keys(n))n[e]!=null&&(l[e]=n[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(o)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return t>=0&&(l.style.hasOwnProperty("border")||(l.style.border=t)),L.createElement("iframe",Object.assign({},l))};export{U as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as g,bm as v,u as y,j as r,Q as f,S as x,U as h}from"./index-
|
|
1
|
+
import{A as g,bm as v,u as y,j as r,Q as f,S as x,U as h}from"./index-Cp668Jsm.js";import{L as S,D as j}from"./download-DY09iblB.js";import{u as L}from"./useLocalStorage-D39oHiv_.js";import"./ButtonGroup-BxZjrpDd.js";import"./getValidReactChildren-CS8vN0Dc.js";function I(){const c=g(),[s,i]=L("server-logs-filter",{name:"abtnode",type:{abtnode:"error"}}),{name:t=s.name}=v(),{info:l}=y(),n=l.routing.provider,a=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr","pm2"]},{id:"blocklet-services",name:"Blocklet Services",types:["error","info","access","stdout","stderr"]}];if(n){const e=`Service Gateway(${n})`;a.push({id:`service-gateway-${n}`,name:e,types:["error","access","security"]})}const d=e=>{i({...s,name:e.target.value}),c(`/logs/${e.target.value}`)},m=r.jsx(f,{sx:{minWidth:240},children:r.jsx(x,{value:t,onChange:d,size:"small",children:a.map(e=>r.jsx(h,{value:e.id,children:e.name},e.id))})}),o=a.find(e=>e.id===t)||a[0],p=o.types.indexOf(s.type[t]||"error"),u=e=>{i({name:t,type:{...s.type,[t]:e}})};return r.jsx(S,{name:o.name,logId:o.id,types:o.types,prepend:m,postpend:r.jsx(j,{id:l.did,name:"blocklet-server"}),defaultTypeIndex:p,onTypeChange:u},o.id)}export{I as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{aG as qe,j as e,dr as js,gv as ws,ir as _s,m as ae,bn as ge,N as O,az as Ce,H as Y,o as g,f as gt,r as S,g as be,bA as st,b as ye,J as ne,X as Dn,bz as ft,Y as he,is as Ss,t as xe,s as re,a4 as fe,aV as oo,T as ie,$ as Yt,dG as mt,y as Se,b8 as Es,bE as ks,E as G,b1 as Rs,gi as Ts,gj as Ps,C as ve,f4 as so,hv as zn,x as Is,ax as Gt,w as Ds,it as Bs,iu as Us,v as Be,iv as Os,Z as Ns,a0 as Ls,iw as io,bo as ao,U as Ne,f6 as As,f1 as Ms,aB as zs,aC as qs,bk as Fs,aD as $s,aE as ue,aO as Ws,cN as Hs,S as Gs,eN as or,bi as Ks,h as Vs,dv as It,ix as Ys,g1 as lo,iy as Zs,iz as Qs,ey as pe,iA as co,dE as Xs,gM as Js,h9 as ei,iB as ti,cE as sr,hq as qn,av as ni,dH as Zt,dn as Me,bq as ri,br as ir,z as uo,cq as oi,G as ze,aP as ar,fO as po,cr as Ke,h5 as si,by as kt,hy as ii,fl as lr,bg as ai,L as xt,F as fo,bm as li,_ as ci,O as Rt,aZ as Fn,iC as di,a_ as Le,aA as cr,cL as ui,ad as it,aM as mo,bS as $n,cw as pi,iD as fi,b9 as mi,A as ho,aU as Bn,p as hi,aS as ut,P as dn,W as gi,bB as go,aJ as xi,bt as yi,aR as vi,fc as dr,iE as ur,gF as pr,V as fr,cK as Ci,gD as bi,bR as ji,iF as wi}from"./index-CEs-_h3p.js";import{y as _i}from"./index-DDa-PgAC.js";import{a as Si,c as Ei,d as ki,u as Wn,R as Ri}from"./actions-Fl5IcNig.js";import{S as Ti}from"./switch-control-vwKpD-hx.js";import{u as Ie}from"./blocklet-By8mMht1.js";import{P as Un,w as Qt}from"./permission-9QXWzXg1.js";import{E as xo}from"./Edit-DvJ7niyi.js";import{T as Pi,M as Ii,t as Di}from"./table-icons-BNwdYNHR.js";import{s as Bi,F as yo,L as Ui,I as Oi,a as Tt,S as Ni,B as Li}from"./preference-DHg_HxRj.js";import{C as mr}from"./click-to-copy-BTxnhIi6.js";import{v as un}from"./index-Bb_IBo4s.js";import{A as Ai}from"./Add-ZXw0xLrb.js";import{A as Xt}from"./Link-OosiOUml.js";import{C as Mi,c as zi,b as qi,f as vo,A as Fi,_ as $i,a as Wi,e as Hi,d as Co,s as Gi,L as Ki,u as Vi,g as Yi,S as Zi}from"./item-BkJpv1Bb.js";import{T as Qi,L as Xi,a as On,u as hr,W as Ji,P as ea}from"./index-DkZuQt-p.js";import{e as bo}from"./engine-CifWoWKx.js";import{u as ta,C as na,D as ra,a as oa,b as sa}from"./connect-to-gjBtyZwF.js";import{C as ia,u as aa,A as la}from"./agreement-DlFMZUIl.js";import{A as ca,a as da,b as ua,c as pa,R as ot,S as dt}from"./collapse-Te61TlLa.js";import{D as jo}from"./Done-BssJlxXF.js";import{C as fa,a as ma}from"./Google-CuTp6K5l.js";import{I as wo,f as ha,a as ga,B as xa}from"./install-from-url-CGq8j4wF.js";import{a as gr}from"./api-1uVGKylc.js";import{v as _o,e as ya,a as Kt}from"./util-BDHNyUKP.js";import{u as So}from"./use-mobile-Bfe2NQYE.js";import{A as va}from"./ArrowDropDown-S7J75cd9.js";import{u as Ca}from"./useLocalStorage-ZXHKUuQ3.js";import{r as Jt}from"./index-DWcByat0.js";import{b as Hn}from"./without-wallet-BGmbjqUT.js";import{E as Eo}from"./ErrorOutline-keam6I0v.js";import{H as ba}from"./HelpOutline-c9xWNXYj.js";import{D as en,W as ht,R as ja,a as xr}from"./url-evaluation-Dx7Up5AZ.js";import{L as ko}from"./Launch-C19ynGFM.js";import{D as wa}from"./delete-confirm-B7t36usI.js";import{B as Ro}from"./status-DJy3aS5P.js";import{A as To}from"./actions-CyCFMA6d.js";import{v as pn}from"./index-BFArq4QY.js";import{t as _a}from"./toUpper-CPtDcnc2.js";import{S as Sa}from"./Switch-D1I5dz3C.js";import{a as Ea}from"./team-DRiDufJD.js";import"./MoreVert-DCZ34SEU.js";import"./get-safe-url-Ddlf6-ls.js";import"./ButtonGroup-QoT5b0rj.js";import"./getValidReactChildren-Y4g3roaS.js";import"./FilterList-BpQVWjO7.js";import"./CSSTransition-Cjz4QCFv.js";import"./emotion-cache.browser.esm-CN4wN0Q-.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-BrPOppB7.js";import"./redux-DfszZyTl.js";import"./useThemeProps-CgnjFBCx.js";import"./html-title-Bzc9ddB_.js";import"./Clear-BMrit09h.js";import"./ChevronRight-DAJ57fQY.js";import"./ChevronLeft-WevXcbvT.js";import"./Search-Bu66uiUL.js";import"./omit-BQvRKGhV.js";import"./edit.svg-C_SspFrp.js";import"./index-cyH3qxmb.js";import"./iframe-toMt-kqs.js";import"./Verified-CEUKiCvL.js";import"./Autocomplete-CK-9Ss3q.js";import"./ListSubheader-JaIza3kA.js";import"./VerifiedUser-CHrqY4DV.js";import"./DeleteOutline-B_ebn78a.js";import"./url-join-BdgYWkAo.js";import"./index-BojVbZw0.js";import"./spaces-CrjBCgnE.js";import"./OpenInNew-qPio7v19.js";import"./index-DRYJ0xIl.js";import"./index-CXToIdzn.js";import"./decode-DPztD6kB.js";import"./cloneDeep-Cj2I-3EJ.js";import"./ListItemButton-D3mT9pyo.js";import"./Stepper-D9KKzkTp.js";import"./is-path-prefix-equal-BEgzcrKA.js";const ka=qe(e.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),Ra=qe(e.jsx("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4z"})),Po=qe(e.jsx("path",{d:"M22 5.18 10.59 16.6l-4.24-4.24 1.41-1.41 2.83 2.83 10-10zm-2.21 5.04c.13.57.21 1.17.21 1.78 0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8c1.58 0 3.04.46 4.28 1.25l1.44-1.44C16.1 2.67 14.13 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.19-.22-2.33-.6-3.39z"})),Ta=qe(e.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"})),Io=qe(e.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),Pa=qe(e.jsx("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"})),Ia=qe(e.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"})),Da=qe(e.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"})),Ba=qe(e.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}));function yr(t,r){var n={};return r=js(r),ws(t,function(i,a,s){_s(n,a,r(i,a,s))}),n}function Do({children:t=null,...r}){const{t:n}=ae(),{api:i}=ge(),{blocklet:a}=Ie(),s=a?.settings?.autoCheckUpdate,m=async l=>{await i.updateAutoCheckUpdate({input:{did:a.meta.did,autoCheckUpdate:l}})},c=async()=>{try{const l=!s?.enabled;await m({enabled:l}),Y.success(n(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){Y.error(l.message)}},d=!!s?.enabled;return e.jsxs(O,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[t,e.jsx(Ce,{title:n("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(Ti,{checked:d,onChange:c,name:"enableWelcomePage",style:{...r.style,zoom:.8}})})})]})}Do.propTypes={children:g.any};function vr(t){function r({sx:n,...i}){return e.jsx(t,{...i,sx:{color:"text.primary",...n}})}return r}const Ua={...yr(Di,vr),...yr(Si,vr)},Oa=(t,r)=>{let{description:n}=t;return(Object.values(ye.CHAIN_PROP_MAP).includes(t.key)||ne.isEnvShareable(t))&&(n?n=`${n} (${r("blocklet.config.sharedToAllComponents")})`:n=r("blocklet.config.sharedToAllComponents")),n&&e.jsx("div",{style:{marginLeft:12},children:n})},fn=(t,r,n=[])=>!n?.length&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!r.meta.environments.find(i=>i.name===t.key)&&r.children.every(i=>!i.meta.environments.find(a=>a.name===t.key))?!0:t.custom,Cr=t=>[ye.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)?!0:!(t.startsWith("BLOCKLET_")||t.startsWith("COMPONENT_")),mn=t=>[ye.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)===!1;function Bo({blocklet:t,ancestors:r=[]}){const n=ge(),{palette:i}=gt(),{inService:a}=n,{t:s}=S.useContext(be),m=[...r.map(o=>o.meta.did),t.meta.did],c=()=>Y.success(s("blocklet.config.changedTip")),d=o=>fn(o,t,r);if(st(t.status)||t.status==="unknown"&&st(t.status))return null;const l=o=>new Promise(async(h,C)=>{if(!o.key.trim()||!o.value.trim()){Y.error(s("blocklet.config.environment.keyValueRequired")),C();return}if(Cr(o.key)===!1){Y.error(s("blocklet.config.environment.invalidKey")),C();return}o.custom=mn(o.key);try{const E=await n.api.configBlocklet({input:{did:m,configs:[o]}});c(E.blocklet),h()}catch(E){Y.error(he(E)),C()}}),y=(o,h)=>new Promise(async(C,E)=>{if(o.required&&(!o.key.trim()||!o.value.trim())){Y.error(s("blocklet.config.environment.keyValueRequired")),E();return}if(Cr(o.key)===!1){Y.error(s("blocklet.config.environment.invalidKey")),E();return}if(o.key===ye.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const M=Ss(o);if(M){Y.error(M),E();return}}const _=[{...o,value:o.secure&&o.value==="__encrypted__"?"":o.value}];if(o.key!==h.key){if(!fn(o,t,r)){Y.error("Only key of custom env can be changed"),E();return}_.push({key:h.key,custom:mn(o.key)})}try{const M=await n.api.configBlocklet({input:{did:m,configs:_}});c(M.blocklet),C()}catch(M){Y.error(he(M)),E()}}),p=o=>new Promise(async(h,C)=>{if(o.required){Y.error(s("blocklet.config.environment.deleteForbidden")),C();return}if(!fn(o,t,r)){Y.error("Only key of custom env can be changed"),C();return}try{const E=await n.api.configBlocklet({input:{did:m,configs:[{key:o.key,custom:mn(o.key)}]}});c(E.blocklet),h()}catch(E){Y.error(he(E)),C()}}),v=(t.configs||[]).filter(o=>!ye.BLOCKLET_CONFIGURABLE_KEY[o.key]||[ye.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(o.key)),f=ne.getSharedConfigObj(r[0],t),x=ne.getComponentMissingConfigs(t,r[0]),w=v.map(o=>({...o,value:Object.values(ye.CHAIN_PROP_MAP).includes(o.key)&&Object.keys(f).includes(o.key)?f[o.key]:f[o.key]||o.value})),b=w.some(o=>o.key&&o.key.startsWith("BWA_")),k={onRowAdd:l,onRowUpdate:y,onRowDelete:p,isDeletable:d},u=()=>[{title:s("common.key"),field:"key",initialEditValue:"",width:"30%",render:o=>e.jsx(mr,{value:o.value,style:{color:o.required&&!o.value?i.error.main:i.text.primary,fontWeight:o.required?"bold":"normal"},children:o.key}),editComponent:o=>{const{value:h,rowData:C,onChange:E}=o;return e.jsx(br,{children:e.jsx(xe,{fullWidth:!0,size:"small",value:Bi.escapeTag(h),onChange:_=>E(_.target.value),variant:"outlined",label:"Key",placeholder:s("blocklet.config.environment.key"),margin:"dense",autoFocus:!0,slotProps:{input:{readOnly:d(C)===!1}}})})}},{title:s("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:o=>o.value?o.secure?"******":e.jsx(mr,{unstyled:!0,value:o.value,style:{wordBreak:"break-all"},children:o.value}):null,editComponent:o=>{const{value:h,rowData:C,onChange:E}=o;return e.jsxs(br,{children:[e.jsx(xe,{fullWidth:!0,size:"small",value:h==="__encrypted__"?"":h,onChange:_=>E(_.target.value),variant:"outlined",label:s("common.value"),placeholder:s("blocklet.config.environment.value"),margin:"dense"}),Oa(C,s)]})}}];return e.jsxs(Na,{children:[!!x.length&&e.jsx(Dn,{severity:"error",style:{marginTop:24},children:s("blocklet.config.missingRequired")}),b&&e.jsx(Dn,{severity:"info",children:s("blocklet.config.environment.tip")}),e.jsx(Un,{permission:a?"":"mutate_blocklets",role:a?ft:[],children:o=>e.jsx(Pi,{className:"config-table",children:e.jsx(Ii,{title:e.jsx(O,{sx:{fontWeight:"bold"},children:s("common.environments")}),columns:u(),icons:Ua,options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:s("common.actions")},body:{emptyDataSourceMessage:s("common.noData")}},data:w,editable:o?k:{}})})})]})}Bo.propTypes={blocklet:g.object.isRequired,ancestors:g.array};const Na=re.div`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-wdj0FEUp.js","./index-Cp668Jsm.js","./index-DGkT7afN.css","./url-join-BaK21hdG.js","./index-n4_kY89C.js","./_createAggregator-s6UGbWKk.js","./depsEqual-msOq5b5x.js","./index-BhIGrRjA.js","./index-DRYJ0xIl.js","./toUpper-j7Or1KIp.js","./index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{aG as qe,j as e,dr as js,gv as ws,is as _s,m as ae,bn as ge,N as O,az as Ce,H as Y,o as g,f as gt,r as S,g as be,bA as st,b as ye,J as ne,X as Dn,bz as ft,Y as he,it as Ss,t as xe,s as re,a4 as fe,aV as oo,T as ie,$ as Yt,dG as mt,y as Se,b8 as Es,bE as ks,E as G,b1 as Rs,gi as Ts,gj as Ps,C as ve,f4 as so,hv as zn,x as Is,ax as Gt,w as Ds,iu as Bs,iv as Us,v as Be,iw as Os,Z as Ns,a0 as Ls,ix as io,bo as ao,U as Ne,f6 as As,f1 as Ms,aB as zs,aC as qs,bk as Fs,aD as $s,aE as ue,aO as Ws,cN as Hs,S as Gs,eN as or,bi as Ks,h as Vs,dv as It,iy as Ys,g1 as lo,iz as Zs,iA as Qs,ey as pe,iB as co,dE as Xs,gM as Js,h9 as ei,iC as ti,cE as sr,hq as qn,av as ni,dH as Zt,dn as Me,bq as ri,br as ir,z as uo,cq as oi,G as ze,aP as ar,fO as po,cr as Ke,h5 as si,by as kt,hy as ii,fl as lr,bg as ai,L as xt,F as fo,bm as li,_ as ci,O as Rt,aZ as Fn,iD as di,a_ as Le,aA as cr,cL as ui,ad as it,aM as mo,bS as $n,cw as pi,iE as fi,b9 as mi,A as ho,aU as Bn,p as hi,aS as ut,P as dn,W as gi,bB as go,aJ as xi,bt as yi,aR as vi,fc as dr,iF as ur,gF as pr,V as fr,cK as Ci,gD as bi,bR as ji,iG as wi}from"./index-Cp668Jsm.js";import{y as _i}from"./index-De5Caszn.js";import{a as Si,c as Ei,d as ki,u as Wn,R as Ri}from"./actions-DaFcSF4Q.js";import{S as Ti}from"./switch-control-Dg5zSUdo.js";import{u as Ie}from"./blocklet-Clk0KDdY.js";import{P as Un,w as Qt}from"./permission-Dq4G1Nhn.js";import{E as xo}from"./Edit-CQvdC-gs.js";import{T as Pi,M as Ii,t as Di}from"./table-icons-jOs3s3dQ.js";import{s as Bi,F as yo,L as Ui,I as Oi,a as Tt,S as Ni,B as Li}from"./preference-5drfcglD.js";import{C as mr}from"./click-to-copy-BZWirPDQ.js";import{v as un}from"./index-DMSf9VmZ.js";import{A as Ai}from"./Add-B2ZDVqat.js";import{A as Xt}from"./Link-B32ARgrh.js";import{C as Mi,c as zi,b as qi,f as vo,A as Fi,_ as $i,a as Wi,e as Hi,d as Co,s as Gi,L as Ki,u as Vi,g as Yi,S as Zi}from"./item-Czk-LxVv.js";import{T as Qi,L as Xi,a as On,u as hr,W as Ji,P as ea}from"./index-DCr9iA79.js";import{e as bo}from"./engine-CjGipQ8H.js";import{u as ta,C as na,D as ra,a as oa,b as sa}from"./connect-to-CKfgySWf.js";import{C as ia,u as aa,A as la}from"./agreement-DSL1Z9Z4.js";import{A as ca,a as da,b as ua,c as pa,R as ot,S as dt}from"./collapse-BOYOLC_4.js";import{D as jo}from"./Done-DvjnHsf4.js";import{C as fa,a as ma}from"./Google-Bli8mQj2.js";import{I as wo,f as ha,a as ga,B as xa}from"./install-from-url-CvXm7zrQ.js";import{a as gr}from"./api-BDClPnhH.js";import{v as _o,e as ya,a as Kt}from"./util-B3o9CH5x.js";import{u as So}from"./use-mobile-DmPwZVyR.js";import{A as va}from"./ArrowDropDown-DTUdke6O.js";import{u as Ca}from"./useLocalStorage-D39oHiv_.js";import{r as Jt}from"./index-n4_kY89C.js";import{b as Hn}from"./without-wallet-BK9y4GG-.js";import{E as Eo}from"./ErrorOutline-3x65gte5.js";import{H as ba}from"./HelpOutline-DK_qkp2M.js";import{D as en,W as ht,R as ja,a as xr}from"./url-evaluation-ZlHZwvb8.js";import{L as ko}from"./Launch-Cazur-Fl.js";import{D as wa}from"./delete-confirm-BrhseXop.js";import{B as Ro}from"./status-DC_uFdhU.js";import{A as To}from"./actions-BTM30cO2.js";import{v as pn}from"./index-CwANiKOk.js";import{t as _a}from"./toUpper-j7Or1KIp.js";import{S as Sa}from"./Switch-C_vix7qp.js";import{a as Ea}from"./team-D3LeaCxJ.js";import"./MoreVert-Dnv5meLi.js";import"./get-safe-url-0GDhhKMb.js";import"./ButtonGroup-BxZjrpDd.js";import"./getValidReactChildren-CS8vN0Dc.js";import"./FilterList-C7CgIPm8.js";import"./CSSTransition-D9w1WbTD.js";import"./emotion-cache.browser.esm-B-0g7s2E.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-le4x5qzb.js";import"./redux-DfszZyTl.js";import"./useThemeProps-CEesX7e5.js";import"./html-title-HtPlSvGf.js";import"./Clear-CY2XI9UL.js";import"./ChevronRight-BHex1y5g.js";import"./ChevronLeft-C1WpAw9J.js";import"./Search-CviyP5PC.js";import"./omit-kqOgzbK4.js";import"./edit.svg-D-BTMQSd.js";import"./index-BhIGrRjA.js";import"./iframe-CiaMOw3l.js";import"./Verified-C1OHOKpp.js";import"./Autocomplete-B6hdnAbf.js";import"./ListSubheader-59vUoVIT.js";import"./VerifiedUser-C0M9SrH7.js";import"./DeleteOutline-DCwd4zu5.js";import"./url-join-BaK21hdG.js";import"./index-BojVbZw0.js";import"./spaces-Dz6osU8D.js";import"./OpenInNew-CVZ7jhVw.js";import"./index-DRYJ0xIl.js";import"./index-BuNutR9F.js";import"./decode-DPztD6kB.js";import"./cloneDeep-BPw0K7hq.js";import"./ListItemButton-BOWa6EsK.js";import"./Stepper-BXOkpPZl.js";import"./is-path-prefix-equal-9dPZdPqq.js";const ka=qe(e.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),Ra=qe(e.jsx("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4z"})),Po=qe(e.jsx("path",{d:"M22 5.18 10.59 16.6l-4.24-4.24 1.41-1.41 2.83 2.83 10-10zm-2.21 5.04c.13.57.21 1.17.21 1.78 0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8c1.58 0 3.04.46 4.28 1.25l1.44-1.44C16.1 2.67 14.13 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.19-.22-2.33-.6-3.39z"})),Ta=qe(e.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"})),Io=qe(e.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),Pa=qe(e.jsx("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"})),Ia=qe(e.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"})),Da=qe(e.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"})),Ba=qe(e.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}));function yr(t,r){var n={};return r=js(r),ws(t,function(i,a,s){_s(n,a,r(i,a,s))}),n}function Do({children:t=null,...r}){const{t:n}=ae(),{api:i}=ge(),{blocklet:a}=Ie(),s=a?.settings?.autoCheckUpdate,m=async l=>{await i.updateAutoCheckUpdate({input:{did:a.meta.did,autoCheckUpdate:l}})},c=async()=>{try{const l=!s?.enabled;await m({enabled:l}),Y.success(n(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){Y.error(l.message)}},d=!!s?.enabled;return e.jsxs(O,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[t,e.jsx(Ce,{title:n("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(Ti,{checked:d,onChange:c,name:"enableWelcomePage",style:{...r.style,zoom:.8}})})})]})}Do.propTypes={children:g.any};function vr(t){function r({sx:n,...i}){return e.jsx(t,{...i,sx:{color:"text.primary",...n}})}return r}const Ua={...yr(Di,vr),...yr(Si,vr)},Oa=(t,r)=>{let{description:n}=t;return(Object.values(ye.CHAIN_PROP_MAP).includes(t.key)||ne.isEnvShareable(t))&&(n?n=`${n} (${r("blocklet.config.sharedToAllComponents")})`:n=r("blocklet.config.sharedToAllComponents")),n&&e.jsx("div",{style:{marginLeft:12},children:n})},fn=(t,r,n=[])=>!n?.length&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!r.meta.environments.find(i=>i.name===t.key)&&r.children.every(i=>!i.meta.environments.find(a=>a.name===t.key))?!0:t.custom,Cr=t=>[ye.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)?!0:!(t.startsWith("BLOCKLET_")||t.startsWith("COMPONENT_")),mn=t=>[ye.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)===!1;function Bo({blocklet:t,ancestors:r=[]}){const n=ge(),{palette:i}=gt(),{inService:a}=n,{t:s}=S.useContext(be),m=[...r.map(o=>o.meta.did),t.meta.did],c=()=>Y.success(s("blocklet.config.changedTip")),d=o=>fn(o,t,r);if(st(t.status)||t.status==="unknown"&&st(t.status))return null;const l=o=>new Promise(async(h,C)=>{if(!o.key.trim()||!o.value.trim()){Y.error(s("blocklet.config.environment.keyValueRequired")),C();return}if(Cr(o.key)===!1){Y.error(s("blocklet.config.environment.invalidKey")),C();return}o.custom=mn(o.key);try{const E=await n.api.configBlocklet({input:{did:m,configs:[o]}});c(E.blocklet),h()}catch(E){Y.error(he(E)),C()}}),y=(o,h)=>new Promise(async(C,E)=>{if(o.required&&(!o.key.trim()||!o.value.trim())){Y.error(s("blocklet.config.environment.keyValueRequired")),E();return}if(Cr(o.key)===!1){Y.error(s("blocklet.config.environment.invalidKey")),E();return}if(o.key===ye.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const M=Ss(o);if(M){Y.error(M),E();return}}const _=[{...o,value:o.secure&&o.value==="__encrypted__"?"":o.value}];if(o.key!==h.key){if(!fn(o,t,r)){Y.error("Only key of custom env can be changed"),E();return}_.push({key:h.key,custom:mn(o.key)})}try{const M=await n.api.configBlocklet({input:{did:m,configs:_}});c(M.blocklet),C()}catch(M){Y.error(he(M)),E()}}),p=o=>new Promise(async(h,C)=>{if(o.required){Y.error(s("blocklet.config.environment.deleteForbidden")),C();return}if(!fn(o,t,r)){Y.error("Only key of custom env can be changed"),C();return}try{const E=await n.api.configBlocklet({input:{did:m,configs:[{key:o.key,custom:mn(o.key)}]}});c(E.blocklet),h()}catch(E){Y.error(he(E)),C()}}),v=(t.configs||[]).filter(o=>!ye.BLOCKLET_CONFIGURABLE_KEY[o.key]||[ye.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(o.key)),f=ne.getSharedConfigObj(r[0],t),x=ne.getComponentMissingConfigs(t,r[0]),w=v.map(o=>({...o,value:Object.values(ye.CHAIN_PROP_MAP).includes(o.key)&&Object.keys(f).includes(o.key)?f[o.key]:f[o.key]||o.value})),b=w.some(o=>o.key&&o.key.startsWith("BWA_")),k={onRowAdd:l,onRowUpdate:y,onRowDelete:p,isDeletable:d},u=()=>[{title:s("common.key"),field:"key",initialEditValue:"",width:"30%",render:o=>e.jsx(mr,{value:o.value,style:{color:o.required&&!o.value?i.error.main:i.text.primary,fontWeight:o.required?"bold":"normal"},children:o.key}),editComponent:o=>{const{value:h,rowData:C,onChange:E}=o;return e.jsx(br,{children:e.jsx(xe,{fullWidth:!0,size:"small",value:Bi.escapeTag(h),onChange:_=>E(_.target.value),variant:"outlined",label:"Key",placeholder:s("blocklet.config.environment.key"),margin:"dense",autoFocus:!0,slotProps:{input:{readOnly:d(C)===!1}}})})}},{title:s("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:o=>o.value?o.secure?"******":e.jsx(mr,{unstyled:!0,value:o.value,style:{wordBreak:"break-all"},children:o.value}):null,editComponent:o=>{const{value:h,rowData:C,onChange:E}=o;return e.jsxs(br,{children:[e.jsx(xe,{fullWidth:!0,size:"small",value:h==="__encrypted__"?"":h,onChange:_=>E(_.target.value),variant:"outlined",label:s("common.value"),placeholder:s("blocklet.config.environment.value"),margin:"dense"}),Oa(C,s)]})}}];return e.jsxs(Na,{children:[!!x.length&&e.jsx(Dn,{severity:"error",style:{marginTop:24},children:s("blocklet.config.missingRequired")}),b&&e.jsx(Dn,{severity:"info",children:s("blocklet.config.environment.tip")}),e.jsx(Un,{permission:a?"":"mutate_blocklets",role:a?ft:[],children:o=>e.jsx(Pi,{className:"config-table",children:e.jsx(Ii,{title:e.jsx(O,{sx:{fontWeight:"bold"},children:s("common.environments")}),columns:u(),icons:Ua,options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:s("common.actions")},body:{emptyDataSourceMessage:s("common.noData")}},data:w,editable:o?k:{}})})})]})}Bo.propTypes={blocklet:g.object.isRequired,ancestors:g.array};const Na=re.div`
|
|
3
3
|
.config-table {
|
|
4
4
|
margin-bottom: 24px;
|
|
5
5
|
position: relative;
|
|
@@ -66,7 +66,7 @@ import{aG as qe,j as e,dr as js,gv as ws,ir as _s,m as ae,bn as ge,N as O,az as
|
|
|
66
66
|
.ux-dialog_closeButton {
|
|
67
67
|
margin: 0;
|
|
68
68
|
}
|
|
69
|
-
`,Aa=S.lazy(()=>ks(()=>import("./index-
|
|
69
|
+
`,Aa=S.lazy(()=>ks(()=>import("./index-wdj0FEUp.js").then(t=>t.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url).then(t=>({default:t.Uploader}))),Ma="/blocklet/component/upload",jr=[".html",".htm",".tgz",".zip"],za=Number(window.env?.MAX_UPLOAD_FILE_SIZE)||G.MAX_UPLOAD_FILE_SIZE,qa=za*1024*1024;function Uo({did:t,prefix:r,headers:n=()=>({}),onUploaded:i=mt,open:a=!1,onClose:s=mt}){const{t:m,locale:c}=ae(),d=S.useRef(null),l=S.useCallback(y=>{const{status:p,data:v}=y;if(p===200){i(v);return}Y.error(m("blocklet.component.addComponentTip.uploadFailed"))},[i,m]);return S.useEffect(()=>{a?d.current?.open():d.current?.close()},[a]),e.jsx(Fa,{id:`component-uploader-${t}`,children:e.jsx(Aa,{ref:d,locale:c,popup:!0,onUploadFinish:l,plugins:[],onClose:s,installerProps:{disabled:!0},apiPathProps:{uploader:Se(r,Ma,t),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:jr,maxFileSize:qa,maxNumberOfFiles:1}},tusProps:{headers:n},dashboardProps:{note:m("blocklet.component.addComponentTip.allowedFileTypes",{types:jr.map(y=>y.replace(".","")).join(", ")})}})},`component-uploader-${t}`)}Uo.propTypes={did:g.string.isRequired,prefix:g.string.isRequired,open:g.bool,headers:g.func,onUploaded:g.func,onClose:g.func};const Fa=Es(O)`
|
|
70
70
|
.uploader-wrapper {
|
|
71
71
|
display: inline-flex;
|
|
72
72
|
position: relative;
|
|
@@ -344,7 +344,7 @@ import{aG as qe,j as e,dr as js,gv as ws,ir as _s,m as ae,bn as ge,N as O,az as
|
|
|
344
344
|
to {
|
|
345
345
|
transform: rotate(360deg);
|
|
346
346
|
}
|
|
347
|
-
`,c=S.useMemo(()=>!r?.enableCredit,[r]),d=S.useMemo(()=>Number(r?.creditBalance?.balance)<=0&&Number(r?.creditBalance?.pendingCredit)>0,[r]);if(!r&&!t)return null;const{creditBalance:l,profileLink:y="",paymentLink:p=""}=r||{};return e.jsx(tn,{children:t?e.jsxs(O,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",gap:2,height:"100%"},children:[e.jsxs(O,{sx:{width:"100%",display:"flex",flexDirection:"column",gap:1},children:[e.jsx(Me,{variant:"rounded",sx:{width:"80%",height:20}}),e.jsx(Me,{variant:"rounded",sx:{width:"50%",height:20}})]}),e.jsxs(O,{sx:{width:"100%",display:"flex",justifyContent:"space-between",gap:1},children:[e.jsx(Me,{variant:"rounded",sx:{width:"100%",height:20}}),e.jsx(Me,{variant:"rounded",sx:{width:"100%",height:20}})]})]}):e.jsxs(O,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",height:"100%",width:"100%"},children:[e.jsxs(O,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[e.jsx(ie,{variant:"body1",children:"AIGNE Hub Credits"}),e.jsxs(ie,{variant:"h2",sx:{color:!c&&d?"error.main":"text.primary"},children:[e.jsx("span",{children:c?s("setting.aigne.infinite"):d?`- ${eo(l?.pendingCredit)}`:eo(l.balance)}),c?null:e.jsx(Ce,{title:s("common.refresh"),children:e.jsx(Ra,{sx:{fontSize:14,ml:1,cursor:"pointer",animation:a?`${m} 1s linear infinite`:"none"},onClick:i})})]})]}),c?null:e.jsxs(O,{sx:{width:"100%",display:"flex",gap:1},children:[e.jsx(Nn,{fullWidth:!0,variant:"outlined",disabled:n,onClick:()=>{p&&window.open(p,"_blank")},startIcon:e.jsx(ue,{style:{fontSize:16},icon:"tabler:credit-card"}),children:s("setting.aigne.addCredits")}),e.jsx(Nn,{fullWidth:!0,disabled:n,onClick:()=>{y&&window.open(uo(y,{appDid:window.blocklet.appPid}),"_blank")},variant:"outlined",startIcon:e.jsx(ue,{style:{fontSize:16},icon:"hugeicons:transaction"}),children:s("setting.aigne.transaction")})]})]})})}Xo.propTypes={loading:g.bool,credit:g.object,connecting:g.bool,onRefresh:g.func,refreshing:g.bool};function Jo({url:t,apiKey:r,switchUser:n=mt,connecting:i=!1}){const{t:a}=S.useContext(be),[s,m]=S.useState(!1),{data:c,loading:d,error:l,refresh:y}=oi(()=>cd({baseUrl:t,accessKey:r}),{ready:!!(t&&r),refreshDeps:[t,r],onSuccess:()=>{m(!1)},onError:()=>{m(!1)}}),p=S.useCallback(()=>{d||s||(m(!0),y())},[y,d,s]);return l?null:e.jsxs(O,{children:[e.jsx(ie,{variant:"h5",sx:{fontSize:18,mb:2},children:a("setting.aigne.account")}),e.jsxs(ze,{container:!0,className:"config-container",spacing:2,sx:{width:"100%"},children:[e.jsx(ze,{size:{xs:12,md:6},children:e.jsx(Qo,{loading:d&&!s,user:c?.user,switchUser:n,connecting:i,url:t})}),e.jsx(ze,{size:{xs:12,md:6},children:e.jsx(Xo,{refreshing:s,loading:d&&!s,credit:c,connecting:i,onRefresh:p})})]})]})}Jo.propTypes={url:g.string.isRequired,apiKey:g.string.isRequired,connecting:g.bool,switchUser:g.func};function es({url:t,providerName:r,disconnect:n=mt,disabled:i=!1,loading:a=!1,validationResult:s=""}){const{t:m}=S.useContext(be),c=S.useMemo(()=>s&&s!=="success",[s]);return e.jsx(tn,{minHeight:80,height:"none",children:e.jsxs(O,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"flex-start",alignItems:"center",gap:2},children:[c?e.jsx(Ce,{title:s,children:e.jsx(Eo,{sx:{fontSize:24,color:"error.main",cursor:"pointer",flexShrink:0}})}):e.jsx(Po,{sx:{fontSize:24,color:"success.main",cursor:"pointer",flexShrink:0}}),e.jsxs(O,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flex:1,flexWrap:"wrap"},children:[e.jsxs(O,{children:[e.jsx(ie,{variant:"h5",sx:{fontSize:18},children:c?m("setting.aigne.testFailed"):m("setting.aigne.connected",{provider:r})}),e.jsxs(ie,{variant:"body1",sx:{color:"text.secondary",fontSize:14},children:[m("setting.aigne.baseUrl",{provider:r}),": ",t]})]}),e.jsx(Zt,{variant:"outlined",color:"error",startIcon:a?e.jsx(ve,{size:16,sx:{mr:1}}):e.jsx(Ki,{}),onClick:n,disabled:i||a,sx:{lineHeight:1.5},children:m("setting.aigne.disconnect")})]})]})})}es.propTypes={url:g.string.isRequired,providerName:g.string.isRequired,disabled:g.bool,disconnect:g.func,loading:g.bool,validationResult:g.string};function rt({desc:t,docLink:r=null,provider:n="",orientation:i="vertical"}){const{t:a}=S.useContext(be);return e.jsxs(ie,{variant:"body2",sx:{lineHeight:1.6,color:"text.secondary",fontSize:12,...i==="vertical"&&{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},title:t,children:[t,r&&e.jsx(Ce,{title:e.jsxs(e.Fragment,{children:[a("setting.aigne.desc.docLink"),r&&e.jsxs(e.Fragment,{children:[":"," ",e.jsx(xt,{href:r,target:"_blank",rel:"noopener noreferrer",sx:{ml:.5},children:n||"documentation"})]})]}),arrow:!0,children:e.jsx(ba,{fontSize:"small",sx:{ml:.25,fontSize:14,cursor:"pointer",verticalAlign:"middle"}})})]})}const Pn={provider:"",model:"",url:"",key:"",accessKeyId:"",testConnection:""};rt.propTypes={desc:g.string.isRequired,docLink:g.string,provider:g.string,orientation:g.oneOf(["vertical","horizontal"])};function ts({orientation:t="vertical",hideDivider:r=!1,source:n="dashboard",forceValidate:i=!1},a){const[s,m]=S.useState(!1),[c,d]=S.useState(!1),[l,y]=S.useState(!1),[p,v]=S.useState(!1),{t:f}=S.useContext(be),x=ge(),{api:w}=x,{did:b,blocklet:k,actions:u}=Ie(),[o,h]=S.useState(!1),C=ar({...Pn}),E=ar({loading:!1,success:!1}),{confirmApi:_,confirmHolder:M}=po(),F=S.useMemo(()=>`connect-aigne-${b}`,[b]),R=ad(x),U=Vi({messageType:"connect-aigne-message",onOpen:()=>m(!0),onClose:()=>m(!1)}),B=S.useMemo(()=>s||c||l||E.loading,[s,c,l,E.loading]),N=Ke(A=>R.find(ee=>ee.provider===A)),$=Ke(A=>N(A)?.models||[]);si(()=>{F&&dl(F)});const H=Ke(A=>{if(A)return A;const ee=R[0]?.provider;return $(ee)[0]?.name||"auto"}),K=Ke(()=>{Object.keys(Pn).forEach(A=>{C[A]=Pn[A]})}),V=kt(()=>{const{aigne:A={}}=k?.settings||{};return A},[k]),z=kt(()=>{const A={...V},ee=A?.provider||R[0]?.provider,te=N(ee),me=pt(ee),vt=Ht(ee);return{...A,url:A?.url||me&&te?.baseURL||"",provider:ee,model:H(A?.model),key:Tn(A?.key,b),accessKeyId:vt?Tn(A?.accessKeyId,b):A?.accessKeyId,secretAccessKey:vt?Tn(A?.secretAccessKey,b):A?.secretAccessKey}},[k,N,H]),[T,q]=S.useState(z);S.useEffect(()=>{q(z)},[z]);const I=S.useMemo(()=>T?.url&&T?.key&&T?.provider==="aigneHub",[T]),D=kt(()=>N(T.provider)?.name||T.provider,[T,N]),j=S.useMemo(()=>id(T),[T]),P=kt(()=>N(T.provider)?.documentation||"",[T,N]),L=async()=>{try{m(!0);const A=new Set(["running","error"]),ee=k.children.filter(te=>A.has(te.status)).map(te=>te.meta.did);await w.restartBlocklet({input:{did:b,componentDids:ee}}),u.refreshBlocklet()}catch(A){console.error("error",A),Y.error(he(A))}finally{m(!1)}},J=(A=!0)=>{if(n!=="setup")return new Promise(ee=>{_.open({title:f("setting.aigne.restart.title"),content:A?f("setting.aigne.restart.connectedContent",{provider:D}):f("setting.aigne.restart.notConnectedContent",{provider:D}),confirmButtonText:f("setting.aigne.restart.confirm"),cancelButtonText:f("setting.aigne.restart.cancel"),onConfirm(te){te(),L(),ee(!0)},onCancel(){ee(!1)}})})},X=Ke(()=>new Promise(A=>{_.open({title:f("setting.aigne.revokeUrlAuthTitle",{url:f("setting.aigne.baseUrl",{provider:D})}),content:f("setting.aigne.revokeUrlAuth",{url:f("setting.aigne.baseUrl",{provider:D})}),confirmButtonText:f("common.confirm"),cancelButtonText:f("common.cancel"),onConfirm(ee){ee(),A(!0)},onCancel(){A(!1)}})})),Z=async(A,ee)=>{const te={};if(q({...T,[A]:ee}),A==="provider"){const me=$(ee);me.length>0&&(te.model=me[0].name),te.key=""}return I&&A==="url"&&ee!==T.url&&(await X()?(te.key="",te.validationResult=""):te.url=T.url),setTimeout(()=>{q({...T,[A]:ee,...te})},100),h(!0),!0},ce=S.useMemo(()=>T.provider,[T.provider]),oe=Ke(A=>ii(A)?"":f("setting.aigne.invalidUrl",{provider:D})),De=(A=[])=>{const ee=j.filter(me=>!A.includes(me));if(ee.length)return ee.forEach(me=>{C[me]="required"}),!ee.includes("url")&&pt(T.provider)&&(C.url=oe(T.url)),!1;const te=pt(T.provider)&&oe(T.url);return te?(C.url=te,!1):!0},Ee=async()=>{try{y(!0),await w.disconnectToAigne({input:{did:b,url:T.url,key:T.key}}),h(!1),Y.success(f("setting.aigne.disconnectSuccess")),setTimeout(()=>{J(!1)},300)}catch(A){console.error("disconnect error:",A),Y.error(he(A)||f("setting.aigne.disconnectFailed"))}finally{y(!1)}},je=()=>{_.open({title:f("setting.aigne.disconnect"),content:f("setting.aigne.disconnectConfirm"),confirmButtonText:f("setting.aigne.disconnect"),cancelButtonText:f("common.cancel"),onConfirm(A){A(),Ee()}})},le=async()=>{if(!De())return;K();const A={...T,model:"auto",key:Rn(T.key,b)};Ht(A.provider)?(A.key="",T.accessKeyId&&(A.accessKeyId=Rn(T.accessKeyId,b)),T.secretAccessKey&&(A.secretAccessKey=Rn(T.secretAccessKey,b))):(A.accessKeyId="",A.secretAccessKey="");const ee=await w.updateBlockletSettings({input:{did:b,aigne:A}});return u.refreshBlocklet(),ee},Ve=async()=>{try{if(!o&&!i)return;m(!0);const A=await le();return A?(h(!1),Y.success(f("oauth.saveSuccess")),A):void 0}catch(A){throw console.error("error",A),Y.error(he(A)||f("setting.aigne.failed")),A}finally{m(!1)}},Ye=async(A=!1)=>{C.testConnection="";try{if(E.loading=!0,!A&&(await le())?.code!=="ok")return;await w.verifyAigneConnection({input:{did:b}}),Y.success(f("setting.aigne.testSuccess",{provider:D})),E.success=!0}catch(ee){throw console.error("error",ee),C.testConnection=ee.message,Y.error(f("setting.aigne.testFailed")),ee}finally{E.loading=!1,u.refreshBlocklet()}},at=async()=>{try{await pl(w,{did:b,refresh:u.refreshBlocklet,t:f,providerName:D,timerKey:F,values:{...V}}).catch(A=>{throw console.error("waitGetConnectedAigne error",A),Y.error(he(A)),A}).then(()=>Ye(!0).catch(A=>{throw console.error("onVerifyConnection error",A),A})),J(!0)}catch(A){console.error("error",A)}finally{h(!1)}},Ze=()=>{De(["key"])&&(K(),U(async(A,ee)=>{try{d(!0);const te=await w.connectToAigne({input:{did:b,baseUrl:T.url||new URL(window.location.origin).origin,provider:T.provider,model:"auto"}});if(!te?.url){Y.error("failed to connect to endpoint");return}ee(te.url),await at(),d(!1)}catch(te){const me=he(te);Y.error(me),d(!1)}}))};S.useImperativeHandle(a,()=>({onSubmit:Ve,loading:s||c||l})),$(ce);const Qe=ce==="aigneHub",rn=()=>{v(!p)},we=A=>{A.preventDefault()},yt=S.useMemo(()=>C.url==="required"?f("common.requiredErrorText",{name:f("setting.aigne.baseUrl",{provider:D})}):C.url?C.url:C.key==="required"?f("setting.aigne.apiKeyNotAuthorized",{provider:D}):"",[C.url,C.key,f,D]);return e.jsxs(ud,{source:n,children:[e.jsx(O,{sx:{mb:3},children:e.jsx(ie,{variant:"body2",color:"text.primary",sx:{lineHeight:1.6,"& a":{color:"primary.main"}},dangerouslySetInnerHTML:{__html:f("setting.aigne.configDesc",{url:"https://store.blocklet.dev/blocklets/z8ia3xzq2tMq8CRHfaXj1BTYJyYnEcHbqP8cJ"})}})}),e.jsx(ie,{variant:"h5",sx:{fontSize:18},children:f("setting.aigne.authorizeAigneHub",{name:D})}),I&&T.validationResult?e.jsx(es,{url:T.url,providerName:D,disconnect:je,validationResult:T.validationResult,disabled:B,loading:l}):e.jsx(tn,{height:"none",minHeight:"none",children:e.jsxs(O,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:2},children:[e.jsx(dt,{orientation:t,title:f("setting.aigne.baseUrl",{provider:D}),required:pt(T.provider),desc:e.jsx(rt,{desc:f("setting.aigne.desc.baseUrl",{example:"https://hub.aigne.io"})}),children:e.jsx(Tt,{disabled:B,initialValue:T.url||"",directEditing:!0,onSubmit:A=>{Z("url",A)},autoFocus:!1,errorTips:yt,InputProps:I?{endAdornment:e.jsx(lr,{position:"end",children:E.loading||c?e.jsx(ve,{size:16}):e.jsxs(e.Fragment,{children:[T.validationResult==="success"?e.jsx(Ce,{title:f("setting.aigne.testSuccess",{provider:D}),children:e.jsx(Po,{sx:{fontSize:16,color:"success.main",cursor:"pointer"}})}):null,T.validationResult&&T.validationResult!=="success"?e.jsx(Ce,{title:T.validationResult,children:e.jsx(Eo,{sx:{fontSize:16,color:"error.main",cursor:"pointer"}})}):null,T.validationResult?null:e.jsx(fe,{"aria-label":"test connection",onClick:Ye,edge:"end",children:E.loading?e.jsx(ve,{size:16}):e.jsx(Ce,{title:f("setting.aigne.testConnection",{provider:D}),children:e.jsx(ue,{style:{fontSize:16},icon:"tabler:location-check"})})})]})})}:{}})}),e.jsx(Zt,{variant:"contained",onClick:Ze,startIcon:c?e.jsx(ve,{size:16,sx:{mr:1}}):e.jsx(Xt,{}),disabled:B||!T.url,sx:{flexShrink:0},children:f("setting.aigne.authorizeAigneHub",{name:"AIGNE Hub"})})]})}),e.jsxs(ze,{container:!0,className:"config-container",spacing:2,sx:{display:"none"},children:[e.jsx(ze,{size:{xs:12,md:4},children:e.jsx(dt,{orientation:t,title:f("setting.aigne.modelAdapter"),required:!0,desc:e.jsx(rt,{desc:f("setting.aigne.desc.modelAdapter")}),children:e.jsx(Go,{disabled:B,options:R,config:{multiple:!1,labelField:"name",valueField:"provider"},initialValue:T.provider,directEditing:!0,searchable:!1,helperText:C.provider==="required"?f("common.requiredErrorText",{name:f("setting.aigne.modelAdapter")}):C.provider,onChange:A=>Z("provider",A)})})}),null,Qe?null:e.jsx(e.Fragment,{children:Ht(T.provider)?e.jsxs(e.Fragment,{children:[e.jsx(dt,{orientation:t,title:"Access Key ID",required:!0,desc:e.jsx(rt,{desc:f("setting.aigne.desc.accessKeyId"),docLink:P,provider:D}),children:e.jsx(Tt,{disabled:B,initialValue:T.accessKeyId||"",type:p?"text":"password",onChange:A=>Z("accessKeyId",A),directEditing:!0,autoFocus:!1})}),!r&&e.jsx(O,{className:"config-form",component:ai,sx:{my:3}}),e.jsx(dt,{orientation:t,title:"Secret Access Key",required:!0,desc:e.jsx(rt,{desc:f("setting.aigne.desc.secretAccessKey"),docLink:P,provider:D}),children:e.jsx(Tt,{disabled:B,initialValue:T.secretAccessKey||"",type:p?"text":"password",onChange:A=>Z("secretAccessKey",A),directEditing:!0,autoFocus:!1})})]}):e.jsx(dt,{orientation:t,title:"API Key",required:!0,desc:e.jsx(rt,{desc:f("setting.aigne.desc.key",{provider:D}),docLink:P,provider:D}),children:e.jsx(Tt,{disabled:B,initialValue:T.key||"",type:p?"text":"password",onChange:A=>Z("key",A),directEditing:!0,autoFocus:!1,InputProps:{endAdornment:e.jsx(lr,{position:"end",children:e.jsx(fe,{"aria-label":"toggle password visibility",onClick:rn,onMouseDown:we,edge:"end",children:p?e.jsx(Da,{}):e.jsx(Ba,{})})})}})})})]}),I&&T.validationResult==="success"?e.jsx(Jo,{switchUser:Ze,url:T.url||"",apiKey:T.key||"",connecting:c||l}):null,n!=="setup"&&e.jsxs(ie,{sx:{fontSize:12,color:"text.secondary",mt:3,fontStyle:"italic"},children:["* ",f("setting.aigne.description",{name:ne.getDisplayName(k,!0)})]}),M]})}ts.propTypes={orientation:g.oneOf(["vertical","horizontal"]),hideDivider:g.bool,source:g.oneOf(["dashboard","setup"]),forceValidate:g.bool};const ud=re.div`
|
|
347
|
+
`,c=S.useMemo(()=>!r?.enableCredit,[r]),d=S.useMemo(()=>Number(r?.creditBalance?.balance)<=0&&Number(r?.creditBalance?.pendingCredit)>0,[r]);if(!r&&!t)return null;const{creditBalance:l,profileLink:y="",paymentLink:p=""}=r||{};return e.jsx(tn,{children:t?e.jsxs(O,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",gap:2,height:"100%"},children:[e.jsxs(O,{sx:{width:"100%",display:"flex",flexDirection:"column",gap:1},children:[e.jsx(Me,{variant:"rounded",sx:{width:"80%",height:20}}),e.jsx(Me,{variant:"rounded",sx:{width:"50%",height:20}})]}),e.jsxs(O,{sx:{width:"100%",display:"flex",justifyContent:"space-between",gap:1},children:[e.jsx(Me,{variant:"rounded",sx:{width:"100%",height:20}}),e.jsx(Me,{variant:"rounded",sx:{width:"100%",height:20}})]})]}):e.jsxs(O,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",height:"100%",width:"100%"},children:[e.jsxs(O,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[e.jsx(ie,{variant:"body1",children:"AIGNE Hub Credits"}),e.jsxs(ie,{variant:"h2",sx:{color:!c&&d?"error.main":"text.primary"},children:[e.jsx("span",{children:c?s("setting.aigne.infinite"):d?`- ${eo(l?.pendingCredit)}`:eo(l.balance)}),c?null:e.jsx(Ce,{title:s("common.refresh"),children:e.jsx(Ra,{sx:{fontSize:14,ml:1,cursor:"pointer",animation:a?`${m} 1s linear infinite`:"none"},onClick:i})})]})]}),c?null:e.jsxs(O,{sx:{width:"100%",display:"flex",gap:1},children:[e.jsx(Nn,{fullWidth:!0,variant:"outlined",disabled:n,onClick:()=>{p&&window.open(p,"_blank")},startIcon:e.jsx(ue,{style:{fontSize:16},icon:"tabler:credit-card"}),children:s("setting.aigne.addCredits")}),e.jsx(Nn,{fullWidth:!0,disabled:n,onClick:()=>{y&&window.open(uo(y,{appDid:window.blocklet.appPid}),"_blank")},variant:"outlined",startIcon:e.jsx(ue,{style:{fontSize:16},icon:"hugeicons:transaction"}),children:s("setting.aigne.transaction")})]})]})})}Xo.propTypes={loading:g.bool,credit:g.object,connecting:g.bool,onRefresh:g.func,refreshing:g.bool};function Jo({url:t,apiKey:r,switchUser:n=mt,connecting:i=!1}){const{t:a}=S.useContext(be),[s,m]=S.useState(!1),{data:c,loading:d,error:l,refresh:y}=oi(()=>cd({baseUrl:t,accessKey:r}),{ready:!!(t&&r),refreshDeps:[t,r],onSuccess:()=>{m(!1)},onError:()=>{m(!1)}}),p=S.useCallback(()=>{d||s||(m(!0),y())},[y,d,s]);return l?null:e.jsxs(O,{children:[e.jsx(ie,{variant:"h5",sx:{fontSize:18,mb:2},children:a("setting.aigne.account")}),e.jsxs(ze,{container:!0,className:"config-container",spacing:2,sx:{width:"100%"},children:[e.jsx(ze,{size:{xs:12,md:6},children:e.jsx(Qo,{loading:d&&!s,user:c?.user,switchUser:n,connecting:i,url:t})}),e.jsx(ze,{size:{xs:12,md:6},children:e.jsx(Xo,{refreshing:s,loading:d&&!s,credit:c,connecting:i,onRefresh:p})})]})]})}Jo.propTypes={url:g.string.isRequired,apiKey:g.string.isRequired,connecting:g.bool,switchUser:g.func};function es({url:t,providerName:r,disconnect:n=mt,disabled:i=!1,loading:a=!1,validationResult:s=""}){const{t:m}=S.useContext(be),c=S.useMemo(()=>s&&s!=="success",[s]);return e.jsx(tn,{minHeight:80,height:"none",children:e.jsxs(O,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"flex-start",alignItems:"center",gap:2},children:[c?e.jsx(Ce,{title:s,children:e.jsx(Eo,{sx:{fontSize:24,color:"error.main",cursor:"pointer",flexShrink:0}})}):e.jsx(Po,{sx:{fontSize:24,color:"success.main",cursor:"pointer",flexShrink:0}}),e.jsxs(O,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flex:1,flexWrap:"wrap"},children:[e.jsxs(O,{children:[e.jsx(ie,{variant:"h5",sx:{fontSize:18},children:c?m("setting.aigne.testFailed"):m("setting.aigne.connected",{provider:r})}),e.jsxs(ie,{variant:"body1",sx:{color:"text.secondary",fontSize:14},children:[m("setting.aigne.baseUrl",{provider:r}),": ",t]})]}),e.jsx(Zt,{variant:"outlined",color:"error",startIcon:a?e.jsx(ve,{size:16,sx:{mr:1}}):e.jsx(Ki,{}),onClick:n,disabled:i||a,sx:{lineHeight:1.5},children:m("setting.aigne.disconnect")})]})]})})}es.propTypes={url:g.string.isRequired,providerName:g.string.isRequired,disabled:g.bool,disconnect:g.func,loading:g.bool,validationResult:g.string};function rt({desc:t,docLink:r=null,provider:n="",orientation:i="vertical"}){const{t:a}=S.useContext(be);return e.jsxs(ie,{variant:"body2",sx:{lineHeight:1.6,color:"text.secondary",fontSize:12,...i==="vertical"&&{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},title:t,children:[t,r&&e.jsx(Ce,{title:e.jsxs(e.Fragment,{children:[a("setting.aigne.desc.docLink"),r&&e.jsxs(e.Fragment,{children:[":"," ",e.jsx(xt,{href:r,target:"_blank",rel:"noopener noreferrer",sx:{ml:.5},children:n||"documentation"})]})]}),arrow:!0,children:e.jsx(ba,{fontSize:"small",sx:{ml:.25,fontSize:14,cursor:"pointer",verticalAlign:"middle"}})})]})}const Pn={provider:"",model:"",url:"",key:"",accessKeyId:"",testConnection:""};rt.propTypes={desc:g.string.isRequired,docLink:g.string,provider:g.string,orientation:g.oneOf(["vertical","horizontal"])};function ts({orientation:t="vertical",hideDivider:r=!1,source:n="dashboard",forceValidate:i=!1},a){const[s,m]=S.useState(!1),[c,d]=S.useState(!1),[l,y]=S.useState(!1),[p,v]=S.useState(!1),{t:f}=S.useContext(be),x=ge(),{api:w}=x,{did:b,blocklet:k,actions:u}=Ie(),[o,h]=S.useState(!1),C=ar({...Pn}),E=ar({loading:!1,success:!1}),{confirmApi:_,confirmHolder:M}=po(),F=S.useMemo(()=>`connect-aigne-${b}`,[b]),R=ad(x),U=Vi({messageType:"connect-aigne-message",onOpen:()=>m(!0),onClose:()=>m(!1)}),B=S.useMemo(()=>s||c||l||E.loading,[s,c,l,E.loading]),N=Ke(A=>R.find(ee=>ee.provider===A)),$=Ke(A=>N(A)?.models||[]);si(()=>{F&&dl(F)});const H=Ke(A=>{if(A)return A;const ee=R[0]?.provider;return $(ee)[0]?.name||"auto"}),K=Ke(()=>{Object.keys(Pn).forEach(A=>{C[A]=Pn[A]})}),V=kt(()=>{const{aigne:A={}}=k?.settings||{};return A},[k]),z=kt(()=>{const A={...V},ee=A?.provider||R[0]?.provider,te=N(ee),me=pt(ee),vt=Ht(ee);return{...A,url:A?.url||me&&te?.baseURL||"",provider:ee,model:H(A?.model),key:Tn(A?.key,b),accessKeyId:vt?Tn(A?.accessKeyId,b):A?.accessKeyId,secretAccessKey:vt?Tn(A?.secretAccessKey,b):A?.secretAccessKey}},[k,N,H]),[T,q]=S.useState(z);S.useEffect(()=>{q(z)},[z]);const I=S.useMemo(()=>T?.url&&T?.key&&T?.provider==="aigneHub",[T]),D=kt(()=>N(T.provider)?.name||T.provider,[T,N]),j=S.useMemo(()=>id(T),[T]),P=kt(()=>N(T.provider)?.documentation||"",[T,N]),L=async()=>{try{m(!0);const A=new Set(["running","error"]),ee=k.children.filter(te=>A.has(te.status)).map(te=>te.meta.did);await w.restartBlocklet({input:{did:b,componentDids:ee}}),u.refreshBlocklet()}catch(A){console.error("error",A),Y.error(he(A))}finally{m(!1)}},J=(A=!0)=>{if(n!=="setup")return new Promise(ee=>{_.open({title:f("setting.aigne.restart.title"),content:A?f("setting.aigne.restart.connectedContent",{provider:D}):f("setting.aigne.restart.notConnectedContent",{provider:D}),confirmButtonText:f("setting.aigne.restart.confirm"),cancelButtonText:f("setting.aigne.restart.cancel"),onConfirm(te){te(),L(),ee(!0)},onCancel(){ee(!1)}})})},X=Ke(()=>new Promise(A=>{_.open({title:f("setting.aigne.revokeUrlAuthTitle",{url:f("setting.aigne.baseUrl",{provider:D})}),content:f("setting.aigne.revokeUrlAuth",{url:f("setting.aigne.baseUrl",{provider:D})}),confirmButtonText:f("common.confirm"),cancelButtonText:f("common.cancel"),onConfirm(ee){ee(),A(!0)},onCancel(){A(!1)}})})),Z=async(A,ee)=>{const te={};if(q({...T,[A]:ee}),A==="provider"){const me=$(ee);me.length>0&&(te.model=me[0].name),te.key=""}return I&&A==="url"&&ee!==T.url&&(await X()?(te.key="",te.validationResult=""):te.url=T.url),setTimeout(()=>{q({...T,[A]:ee,...te})},100),h(!0),!0},ce=S.useMemo(()=>T.provider,[T.provider]),oe=Ke(A=>ii(A)?"":f("setting.aigne.invalidUrl",{provider:D})),De=(A=[])=>{const ee=j.filter(me=>!A.includes(me));if(ee.length)return ee.forEach(me=>{C[me]="required"}),!ee.includes("url")&&pt(T.provider)&&(C.url=oe(T.url)),!1;const te=pt(T.provider)&&oe(T.url);return te?(C.url=te,!1):!0},Ee=async()=>{try{y(!0),await w.disconnectToAigne({input:{did:b,url:T.url,key:T.key}}),h(!1),Y.success(f("setting.aigne.disconnectSuccess")),setTimeout(()=>{J(!1)},300)}catch(A){console.error("disconnect error:",A),Y.error(he(A)||f("setting.aigne.disconnectFailed"))}finally{y(!1)}},je=()=>{_.open({title:f("setting.aigne.disconnect"),content:f("setting.aigne.disconnectConfirm"),confirmButtonText:f("setting.aigne.disconnect"),cancelButtonText:f("common.cancel"),onConfirm(A){A(),Ee()}})},le=async()=>{if(!De())return;K();const A={...T,model:"auto",key:Rn(T.key,b)};Ht(A.provider)?(A.key="",T.accessKeyId&&(A.accessKeyId=Rn(T.accessKeyId,b)),T.secretAccessKey&&(A.secretAccessKey=Rn(T.secretAccessKey,b))):(A.accessKeyId="",A.secretAccessKey="");const ee=await w.updateBlockletSettings({input:{did:b,aigne:A}});return u.refreshBlocklet(),ee},Ve=async()=>{try{if(!o&&!i)return;m(!0);const A=await le();return A?(h(!1),Y.success(f("oauth.saveSuccess")),A):void 0}catch(A){throw console.error("error",A),Y.error(he(A)||f("setting.aigne.failed")),A}finally{m(!1)}},Ye=async(A=!1)=>{C.testConnection="";try{if(E.loading=!0,!A&&(await le())?.code!=="ok")return;await w.verifyAigneConnection({input:{did:b}}),Y.success(f("setting.aigne.testSuccess",{provider:D})),E.success=!0}catch(ee){throw console.error("error",ee),C.testConnection=ee.message,Y.error(f("setting.aigne.testFailed")),ee}finally{E.loading=!1,u.refreshBlocklet()}},at=async()=>{try{await pl(w,{did:b,refresh:u.refreshBlocklet,t:f,providerName:D,timerKey:F,values:{...V}}).catch(A=>{throw console.error("waitGetConnectedAigne error",A),Y.error(he(A)),A}).then(()=>Ye(!0).catch(A=>{throw console.error("onVerifyConnection error",A),A})),J(!0)}catch(A){console.error("error",A)}finally{h(!1)}},Ze=()=>{De(["key"])&&(K(),U(async(A,ee)=>{try{d(!0);const te=await w.connectToAigne({input:{did:b,baseUrl:T.url||new URL(window.location.origin).origin,provider:T.provider,model:"auto"}});if(!te?.url){Y.error("failed to connect to endpoint"),d(!1),m(!1);return}ee(te.url),await at(),d(!1)}catch(te){const me=he(te);Y.error(me),d(!1)}}))};S.useImperativeHandle(a,()=>({onSubmit:Ve,loading:s||c||l})),$(ce);const Qe=ce==="aigneHub",rn=()=>{v(!p)},we=A=>{A.preventDefault()},yt=S.useMemo(()=>C.url==="required"?f("common.requiredErrorText",{name:f("setting.aigne.baseUrl",{provider:D})}):C.url?C.url:C.key==="required"?f("setting.aigne.apiKeyNotAuthorized",{provider:D}):"",[C.url,C.key,f,D]);return e.jsxs(ud,{source:n,children:[e.jsx(O,{sx:{mb:3},children:e.jsx(ie,{variant:"body2",color:"text.primary",sx:{lineHeight:1.6,"& a":{color:"primary.main"}},dangerouslySetInnerHTML:{__html:f("setting.aigne.configDesc",{url:"https://store.blocklet.dev/blocklets/z8ia3xzq2tMq8CRHfaXj1BTYJyYnEcHbqP8cJ"})}})}),e.jsx(ie,{variant:"h5",sx:{fontSize:18},children:f("setting.aigne.authorizeAigneHub",{name:D})}),I&&T.validationResult?e.jsx(es,{url:T.url,providerName:D,disconnect:je,validationResult:T.validationResult,disabled:B,loading:l}):e.jsx(tn,{height:"none",minHeight:"none",children:e.jsxs(O,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:2},children:[e.jsx(dt,{orientation:t,title:f("setting.aigne.baseUrl",{provider:D}),required:pt(T.provider),desc:e.jsx(rt,{desc:f("setting.aigne.desc.baseUrl",{example:"https://hub.aigne.io"})}),children:e.jsx(Tt,{disabled:B,initialValue:T.url||"",directEditing:!0,onSubmit:A=>{Z("url",A)},autoFocus:!1,errorTips:yt,InputProps:I?{endAdornment:e.jsx(lr,{position:"end",children:E.loading||c?e.jsx(ve,{size:16}):e.jsxs(e.Fragment,{children:[T.validationResult==="success"?e.jsx(Ce,{title:f("setting.aigne.testSuccess",{provider:D}),children:e.jsx(Po,{sx:{fontSize:16,color:"success.main",cursor:"pointer"}})}):null,T.validationResult&&T.validationResult!=="success"?e.jsx(Ce,{title:T.validationResult,children:e.jsx(Eo,{sx:{fontSize:16,color:"error.main",cursor:"pointer"}})}):null,T.validationResult?null:e.jsx(fe,{"aria-label":"test connection",onClick:Ye,edge:"end",children:E.loading?e.jsx(ve,{size:16}):e.jsx(Ce,{title:f("setting.aigne.testConnection",{provider:D}),children:e.jsx(ue,{style:{fontSize:16},icon:"tabler:location-check"})})})]})})}:{}})}),e.jsx(Zt,{variant:"contained",onClick:Ze,startIcon:c?e.jsx(ve,{size:16,sx:{mr:1}}):e.jsx(Xt,{}),disabled:B||!T.url,sx:{flexShrink:0},children:f("setting.aigne.authorizeAigneHub",{name:"AIGNE Hub"})})]})}),e.jsxs(ze,{container:!0,className:"config-container",spacing:2,sx:{display:"none"},children:[e.jsx(ze,{size:{xs:12,md:4},children:e.jsx(dt,{orientation:t,title:f("setting.aigne.modelAdapter"),required:!0,desc:e.jsx(rt,{desc:f("setting.aigne.desc.modelAdapter")}),children:e.jsx(Go,{disabled:B,options:R,config:{multiple:!1,labelField:"name",valueField:"provider"},initialValue:T.provider,directEditing:!0,searchable:!1,helperText:C.provider==="required"?f("common.requiredErrorText",{name:f("setting.aigne.modelAdapter")}):C.provider,onChange:A=>Z("provider",A)})})}),null,Qe?null:e.jsx(e.Fragment,{children:Ht(T.provider)?e.jsxs(e.Fragment,{children:[e.jsx(dt,{orientation:t,title:"Access Key ID",required:!0,desc:e.jsx(rt,{desc:f("setting.aigne.desc.accessKeyId"),docLink:P,provider:D}),children:e.jsx(Tt,{disabled:B,initialValue:T.accessKeyId||"",type:p?"text":"password",onChange:A=>Z("accessKeyId",A),directEditing:!0,autoFocus:!1})}),!r&&e.jsx(O,{className:"config-form",component:ai,sx:{my:3}}),e.jsx(dt,{orientation:t,title:"Secret Access Key",required:!0,desc:e.jsx(rt,{desc:f("setting.aigne.desc.secretAccessKey"),docLink:P,provider:D}),children:e.jsx(Tt,{disabled:B,initialValue:T.secretAccessKey||"",type:p?"text":"password",onChange:A=>Z("secretAccessKey",A),directEditing:!0,autoFocus:!1})})]}):e.jsx(dt,{orientation:t,title:"API Key",required:!0,desc:e.jsx(rt,{desc:f("setting.aigne.desc.key",{provider:D}),docLink:P,provider:D}),children:e.jsx(Tt,{disabled:B,initialValue:T.key||"",type:p?"text":"password",onChange:A=>Z("key",A),directEditing:!0,autoFocus:!1,InputProps:{endAdornment:e.jsx(lr,{position:"end",children:e.jsx(fe,{"aria-label":"toggle password visibility",onClick:rn,onMouseDown:we,edge:"end",children:p?e.jsx(Da,{}):e.jsx(Ba,{})})})}})})})]}),I&&T.validationResult==="success"?e.jsx(Jo,{switchUser:Ze,url:T.url||"",apiKey:T.key||"",connecting:c||l}):null,n!=="setup"&&e.jsxs(ie,{sx:{fontSize:12,color:"text.secondary",mt:3,fontStyle:"italic"},children:["* ",f("setting.aigne.description",{name:ne.getDisplayName(k,!0)})]}),M]})}ts.propTypes={orientation:g.oneOf(["vertical","horizontal"]),hideDivider:g.bool,source:g.oneOf(["dashboard","setup"]),forceValidate:g.bool};const ud=re.div`
|
|
348
348
|
max-width: 920px;
|
|
349
349
|
display: flex;
|
|
350
350
|
flex-direction: column;
|