@abtnode/webapp 1.16.32-beta-0593a408 → 1.16.32-beta-17be26d7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{Add-81TWUj7G.js → Add-DaKGD4dI.js} +1 -1
- package/dist/assets/{ArrowDropDown-W2gnellS.js → ArrowDropDown-ChTH4y6x.js} +1 -1
- package/dist/assets/{Autocomplete-DRfXMy8R.js → Autocomplete-4JAYTzWy.js} +1 -1
- package/dist/assets/{Breadcrumbs-BF9t0QkH.js → Breadcrumbs-CSvwbIEG.js} +1 -1
- package/dist/assets/{ButtonGroup-D47AV17G.js → ButtonGroup-CZh258li.js} +1 -1
- package/dist/assets/{CheckCircle-lV3-9PUC.js → CheckCircle-C9wvczio.js} +1 -1
- package/dist/assets/{ChevronLeft-AKgxrSNT.js → ChevronLeft-BcAe4jGL.js} +1 -1
- package/dist/assets/{ChevronRight-O02U5LWB.js → ChevronRight-D3x_9psV.js} +1 -1
- package/dist/assets/{Close-DqDL5IGH.js → Close-Yb6PTPgZ.js} +1 -1
- package/dist/assets/{Delete-I9FOITt6.js → Delete-DUmhYiAq.js} +1 -1
- package/dist/assets/{DeleteOutline--7c4aVEh.js → DeleteOutline-D5ZTK7Ka.js} +1 -1
- package/dist/assets/{Done-DE0Vi7h5.js → Done-DlneRio5.js} +1 -1
- package/dist/assets/{Edit-DN51u9dR.js → Edit-Bxg4cu8b.js} +1 -1
- package/dist/assets/{EditIcon-Q92uw68H.js → EditIcon-DZ4AA4ec.js} +1 -1
- package/dist/assets/{ExpandMore-dpwD8Lmx.js → ExpandMore-DpwumCaI.js} +1 -1
- package/dist/assets/{Google-D2zJo9bo.js → Google-ppCuuQRJ.js} +1 -1
- package/dist/assets/{Https-Cus_KF7e.js → Https-ChBXh5m-.js} +1 -1
- package/dist/assets/{InputAdornment-BgFOKd9J.js → InputAdornment-I3Qa54dS.js} +1 -1
- package/dist/assets/{InputLabel-CtuX3xye.js → InputLabel-x5fGAphs.js} +1 -1
- package/dist/assets/{LastPage-vVLkX2R1.js → LastPage-CFPei4j4.js} +1 -1
- package/dist/assets/{Launch-COfgZp_i.js → Launch-DawysiT2.js} +1 -1
- package/dist/assets/{Link-DjPgPJYq.js → Link-Cl6uWJH_.js} +1 -1
- package/dist/assets/{LoadingButton-oQ94CQjB.js → LoadingButton-Bw0KBLnj.js} +1 -1
- package/dist/assets/{LockIcon-DvVuvp7X.js → LockIcon-CnkvxSHY.js} +1 -1
- package/dist/assets/{Loop-CbgoVN2D.js → Loop-BuLkY4qW.js} +1 -1
- package/dist/assets/{MoreHoriz-D5pKNfuj.js → MoreHoriz-C_qvzy_d.js} +1 -1
- package/dist/assets/{MoreVert-hA4JYyTS.js → MoreVert-DSqbsAYy.js} +1 -1
- package/dist/assets/{Pagination-C3WkpJF7.js → Pagination-CtEI84NR.js} +1 -1
- package/dist/assets/{Public-Bs_mVNKZ.js → Public-DTWYgdJa.js} +1 -1
- package/dist/assets/{SchemaReference.es-CXzqh_NZ.js → SchemaReference.es-DDBbuRq5.js} +1 -1
- package/dist/assets/{Search-DGfKsHG9.js → Search-LvG1ITyu.js} +1 -1
- package/dist/assets/{Select-DZPpYZ0d.js → Select-DsA6mJ7A.js} +1 -1
- package/dist/assets/{Skeleton-BCyCy5SR.js → Skeleton-DkInRABR.js} +1 -1
- package/dist/assets/{Slider-B_o7lOai.js → Slider-ZuZU2f6x.js} +1 -1
- package/dist/assets/{Stepper-BsBYZb8R.js → Stepper-AWCpL8Wp.js} +1 -1
- package/dist/assets/{TextField-BsNlIaqS.js → TextField-CRqdsKdk.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-D-arcvca.js → ToggleButtonGroup-AtNMdn7e.js} +1 -1
- package/dist/assets/{ViewColumn-Cfa2KTUG.js → ViewColumn-BCkzYaEc.js} +1 -1
- package/dist/assets/{ViewList-qlPkPfcy.js → ViewList-5t3FBolC.js} +1 -1
- package/dist/assets/{actions-D84M4oE6.js → actions-BkAN9H2U.js} +1 -1
- package/dist/assets/{actions-C9VYlVZQ.js → actions-S3zHaigm.js} +1 -1
- package/dist/assets/{agreement-DsaxP3q4.js → agreement-mUf-NNwH.js} +1 -1
- package/dist/assets/api-DaQrSR6d.js +1 -0
- package/dist/assets/{app-avatar-y7pLSnm0.js → app-avatar-CZMX5yC0.js} +1 -1
- package/dist/assets/{audit-logs-B7rpZVRE.js → audit-logs-C6NHUyCb.js} +1 -1
- package/dist/assets/blocklet-_qJbakx7.js +1 -0
- package/dist/assets/{brace-fold.es-B9T-AvwE.js → brace-fold.es-BL24oDCP.js} +1 -1
- package/dist/assets/{bundle-avatar-Bu_A2cMf.js → bundle-avatar-B_KhS55w.js} +1 -1
- package/dist/assets/{chart-d7Hz6F4Y.js → chart-TH03FheV.js} +1 -1
- package/dist/assets/{click-to-copy-CeEC05qf.js → click-to-copy-DLjgvWtN.js} +1 -1
- package/dist/assets/{closebrackets.es-D1yT11Rb.js → closebrackets.es-CRue5Lj9.js} +1 -1
- package/dist/assets/{codemirror.es-B-bTLQrR.js → codemirror.es-D6n4hw-Q.js} +1 -1
- package/dist/assets/{comment.es-BDq2v7Vm.js → comment.es-CMqHFDro.js} +1 -1
- package/dist/assets/{config-navigation-DKZSEBT3.js → config-navigation-BkjjlNR1.js} +1 -1
- package/dist/assets/{delete-confirm-TyC4FVPi.js → delete-confirm-DSDxj3rA.js} +1 -1
- package/dist/assets/{detail-CqXxlDri.js → detail-BXayVQVW.js} +3 -3
- package/dist/assets/{dialog.es-RmaTmDcl.js → dialog.es-D689jSEc.js} +1 -1
- package/dist/assets/{download-CxeiDHKn.js → download-BzRIfvfp.js} +1 -1
- package/dist/assets/{foldgutter.es-BpulhhM9.js → foldgutter.es-B9YVusGB.js} +1 -1
- package/dist/assets/getValidReactChildren-DAG74NDJ.js +1 -0
- package/dist/assets/{hint.es-C4_XIR8M.js → hint.es-CskV4nd4.js} +1 -1
- package/dist/assets/{hint.es2-_il0iOC6.js → hint.es2-CfwqzILV.js} +1 -1
- package/dist/assets/{iframe-DV2HF1WR.js → iframe-ZIaXI_5u.js} +1 -1
- package/dist/assets/{index-CNaxpzMo.js → index-2hMSNFcX.js} +1 -1
- package/dist/assets/{index-BxfaKgnf.js → index-2il1V33n.js} +1 -1
- package/dist/assets/{index-BmWjwKCI.js → index-B1dhqxPU.js} +1 -1
- package/dist/assets/{index-BH_LfNlV.js → index-B5btqJ4H.js} +1 -1
- package/dist/assets/{index-Bz69I2lh.js → index-BEhFvOUG.js} +1 -1
- package/dist/assets/{index-BjxrhAPw.js → index-BGLg0vvo.js} +1 -1
- package/dist/assets/{index-Ccn_78eY.js → index-BISktdZp.js} +1 -1
- package/dist/assets/{index-CBgOYn4R.js → index-BZ5mGJWw.js} +1 -1
- package/dist/assets/{index-CGvEh9ip.js → index-BZeec5qC.js} +1 -1
- package/dist/assets/{index-Bfmgpw5_.js → index-BmM7M1I1.js} +1 -1
- package/dist/assets/{index-CQRdVDZQ.js → index-By4cIMG9.js} +1 -1
- package/dist/assets/{index-Dcjg8igY.js → index-C-WTI7Cb.js} +3 -3
- package/dist/assets/{index-DtzNIJ9v.js → index-CAr2bcCQ.js} +1 -1
- package/dist/assets/{index-BLGKjj6E.js → index-CGxA_e3u.js} +3 -3
- package/dist/assets/{index-B0Gk-5E6.js → index-CK4JTdjQ.js} +1 -1
- package/dist/assets/{index-C0MyvZkB.js → index-CNUQDecb.js} +1 -1
- package/dist/assets/{index-T1D0phLU.js → index-CPveBdmQ.js} +1 -1
- package/dist/assets/{index-BDMiG6Uz.js → index-CnJqCwcF.js} +1 -1
- package/dist/assets/{index-C87WpOvX.js → index-CqCsZC4C.js} +1 -1
- package/dist/assets/{index-CCVx6lLg.js → index-Cr3n4oxk.js} +1 -1
- package/dist/assets/{index-CUEISfg0.js → index-CrJbtDDR.js} +1 -1
- package/dist/assets/{index-BB8Tx0yG.js → index-CrvugMt9.js} +1 -1
- package/dist/assets/{index-CYfBSsnU.js → index-Cw0JQB9z.js} +1 -1
- package/dist/assets/{index-CBU498FZ.js → index-D7RYoUXY.js} +1 -1
- package/dist/assets/{index-Cdkc-3f6.js → index-D7uj8y87.js} +1 -1
- package/dist/assets/{index-CnbL2tpL.js → index-D8MQ9ZVB.js} +1 -1
- package/dist/assets/{index-C87i5P5O.js → index-D8jEuOKc.js} +19 -19
- package/dist/assets/{index-99uQGtgn.js → index-DAyoBn_4.js} +1 -1
- package/dist/assets/{index-u17sC7i2.js → index-DDuCsifa.js} +1 -1
- package/dist/assets/{index-BIYql5q6.js → index-DJbyuP0k.js} +1 -1
- package/dist/assets/{index-T-64JlMP.js → index-DK-C26MA.js} +1 -1
- package/dist/assets/{index-3aofV6nB.js → index-DKtCLP01.js} +1 -1
- package/dist/assets/{index-CuBDEMRq.js → index-DToDGE56.js} +1 -1
- package/dist/assets/{index-Djmycn1v.js → index-Dew8IExT.js} +1 -1
- package/dist/assets/{index-CuqMshCu.js → index-Do26lepM.js} +5 -5
- package/dist/assets/{index-DnbqFjiK.js → index-IhPupL71.js} +1 -1
- package/dist/assets/{index-Xym45k52.js → index-UkVmuOk4.js} +1 -1
- package/dist/assets/{index-BNI-Fp0S.js → index-X_twkRjU.js} +1 -1
- package/dist/assets/{index-DI1xj9t6.js → index-ZzQVQqI_.js} +1 -1
- package/dist/assets/{index-CDS9Hial.js → index-cBkUep-u.js} +1 -1
- package/dist/assets/{index-CHhqsbtW.js → index-ePYaxWaQ.js} +1 -1
- package/dist/assets/{index-45iXmL9s.js → index-ikTCZuew.js} +1 -1
- package/dist/assets/{index-CnV8LmTC.js → index-zAZnE_sV.js} +1 -1
- package/dist/assets/{index.es-BXC1lkQf.js → index.es-Ce1reDLt.js} +1 -1
- package/dist/assets/{index.esm-as9kElM3.js → index.esm-D4aSKUKj.js} +1 -1
- package/dist/assets/{info-addon.es-CVKSPi1c.js → info-addon.es-Gw4G3zLm.js} +1 -1
- package/dist/assets/{info.es-HJGLmzv5.js → info.es-DwIeLjFc.js} +1 -1
- package/dist/assets/{install-from-url-CEY4dC_1.js → install-from-url-41g9-VzW.js} +1 -1
- package/dist/assets/{invitation-evdMCfyK.js → invitation-Cn2oy3yS.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-CrQHcn5m.js → is-path-prefix-equal-DNcDIcWb.js} +1 -1
- package/dist/assets/{isEqual-CuoJFFI2.js → isEqual-Bqorz6b9.js} +1 -1
- package/dist/assets/{item-D6A0cv19.js → item-SOaEd0D1.js} +1 -1
- package/dist/assets/{javascript.es-rMzGfy7N.js → javascript.es-H569uOzV.js} +1 -1
- package/dist/assets/{jump-to-line.es-Cpa8i7PL.js → jump-to-line.es-BEsHX6V3.js} +1 -1
- package/dist/assets/{jump.es-BLaBRIq3.js → jump.es-Ckm7XeeY.js} +1 -1
- package/dist/assets/{line-BCg6WLy-.js → line-BpgEsi16.js} +3 -3
- package/dist/assets/{lint.es-itOm8eut.js → lint.es-BqlNOL8M.js} +1 -1
- package/dist/assets/{lint.es2-Br2Jseat.js → lint.es2-BDoZAwzu.js} +1 -1
- package/dist/assets/{lint.es3-DTnJdvr7.js → lint.es3-_dkyqTUe.js} +1 -1
- package/dist/assets/{list-header-CsWJ8RPD.js → list-header-dggL7_n2.js} +1 -1
- package/dist/assets/{log-CkiYiCpI.js → log-Dl3vYHcH.js} +1 -1
- package/dist/assets/{lottie-Duv0wu-W.js → lottie-C3nxmlxK.js} +1 -1
- package/dist/assets/{matchbrackets.es-rEJDOfNn.js → matchbrackets.es-tA0nPUuc.js} +1 -1
- package/dist/assets/{memory-CuMXgGIH.js → memory-Bu0JELz3.js} +1 -1
- package/dist/assets/{mode.es-Bs_6rgrU.js → mode.es-D4L5Xyl2.js} +1 -1
- package/dist/assets/{mode.es2-C6Zvy8D5.js → mode.es2-CUsDPFgy.js} +1 -1
- package/dist/assets/{mode.es3-DgePL-lk.js → mode.es3-Ch4z8bv5.js} +1 -1
- package/dist/assets/{onlineParser.es-C3POG7wL.js → onlineParser.es-DzN1JLcS.js} +1 -1
- package/dist/assets/{overview-DbahK4Kk.js → overview-C7jzc_u_.js} +1 -1
- package/dist/assets/{react-WoXEty6I.js → react-X622xIru.js} +3 -3
- package/dist/assets/{redux-Cf4FUKVZ.js → redux-rfMuaiI1.js} +1 -1
- package/dist/assets/{resource-dialog-CCAmiBTD.js → resource-dialog-D-vI8e9q.js} +1 -1
- package/dist/assets/{runtime-CUPVOXCy.js → runtime-DP943eRP.js} +1 -1
- package/dist/assets/{schema-BuTyc1B1.js → schema-DeVB3oly.js} +1 -1
- package/dist/assets/sdk-BqXPS3TR.js +1 -0
- package/dist/assets/{search.es-ByPtS76S.js → search.es-BaUbACv2.js} +1 -1
- package/dist/assets/{searchcursor.es-BxfHGeD5.js → searchcursor.es-39IycBFs.js} +1 -1
- package/dist/assets/{service-G6-8wV0m.js → service-BimlVy43.js} +1 -1
- package/dist/assets/{shorten-label-CmwkaCnD.js → shorten-label-CBdfm00-.js} +1 -1
- package/dist/assets/{show-hint.es-Bi5eJ-nO.js → show-hint.es-DMpxvfoA.js} +1 -1
- package/dist/assets/{slicedToArray-D1jYg_Db.js → slicedToArray-7c7-iQ0t.js} +1 -1
- package/dist/assets/{spaces-DaTfPIZI.js → spaces-UaG0_4_u.js} +1 -1
- package/dist/assets/{status-BrIel7yA.js → status-BGxv0mkt.js} +1 -1
- package/dist/assets/{sublime.es-BRPc_Rx8.js → sublime.es-qDoQTC8D.js} +1 -1
- package/dist/assets/{switch-control-D6307Ep2.js → switch-control-D6_lOJtw.js} +1 -1
- package/dist/assets/{table-icons-K0jdQRYo.js → table-icons-C1Wv7bvQ.js} +1 -1
- package/dist/assets/{team-DtdwQJxz.js → team-BOnxiYnY.js} +1 -1
- package/dist/assets/{toUpper-B5GnUtFV.js → toUpper-C-8-jotc.js} +1 -1
- package/dist/assets/{traffic-Cat9rasT.js → traffic-Hfc3zrFY.js} +1 -1
- package/dist/assets/{url-evaluation-Bsz6aSOl.js → url-evaluation-DRU1r0m1.js} +1 -1
- package/dist/assets/{url-join-DNBjtoKk.js → url-join-gOj2D4JC.js} +1 -1
- package/dist/assets/{use-blocklet-info-for-connect-did-spaces-COobAHN5.js → use-blocklet-info-for-connect-did-spaces-BqkHUfqx.js} +1 -1
- package/dist/assets/{useLocalStorage-DZviLQmZ.js → useLocalStorage-VUDmm0Mk.js} +1 -1
- package/dist/assets/{useThemeProps-B9dRlIPP.js → useThemeProps-_vPkb6TM.js} +1 -1
- package/dist/assets/{util-C4LslHq9.js → util-CKYVxmGJ.js} +1 -1
- package/dist/assets/{wait-container-Coxp7sOC.js → wait-container-BbsYBUX1.js} +1 -1
- package/dist/assets/{withStyles-DBGJv_MR.js → withStyles-DM17B_mO.js} +1 -1
- package/dist/assets/{wrap-locale-PwADRgtG.js → wrap-locale-BYabtx-L.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/api-n1RgJfYp.js +0 -1
- package/dist/assets/blocklet-DaPMEa6v.js +0 -1
- package/dist/assets/getValidReactChildren-BY1C2s5l.js +0 -1
- package/dist/assets/sdk-CMnoHYH1.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{C}from"./codemirror.es-
|
|
1
|
+
import{C}from"./codemirror.es-D6n4hw-Q.js";import"./show-hint.es-DMpxvfoA.js";import{R as a,C as m,g as A,i as F,T as fe,S as Te,a as ge,I as Ee,G as H,b as O,d as me,e as ve,f as Se,h as ye,j as Ie,D as E,v as De,p as Fe,k as w,l as Ne,m as P,n as z,K as Y,o as be,q as _e,r as Ae}from"./index-Do26lepM.js";import{P as ke,C as Q}from"./Range.es-DaV7MD2W.js";import{o as Oe}from"./onlineParser.es-DzN1JLcS.js";import{S as J,T as K,a as $}from"./introspection.es-CPJcz6nz.js";import"./index-D8jEuOKc.js";var Me=Object.defineProperty,T=(t,r)=>Me(t,"name",{value:r,configurable:!0});function W(t){let r;return j(t,i=>{switch(i.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":r=i;break}}),r}T(W,"getDefinitionState");function V(t,r,i){return i===J.name&&t.getQueryType()===r?J:i===K.name&&t.getQueryType()===r?K:i===$.name&&F(r)?$:"getFields"in r?r.getFields()[i]:null}T(V,"getFieldDef");function j(t,r){const i=[];let n=t;for(;n!=null&&n.kind;)i.push(n),n=n.prevState;for(let e=i.length-1;e>=0;e--)r(i[e])}T(j,"forEachState");function N(t){const r=Object.keys(t),i=r.length,n=new Array(i);for(let e=0;e<i;++e)n[e]=t[r[e]];return n}T(N,"objectValues");function I(t,r){return X(r,G(t.string))}T(I,"hintList");function X(t,r){if(!r)return h(t,n=>!n.isDeprecated);const i=t.map(n=>({proximity:Z(G(n.label),r),entry:n}));return h(h(i,n=>n.proximity<=2),n=>!n.entry.isDeprecated).sort((n,e)=>(n.entry.isDeprecated?1:0)-(e.entry.isDeprecated?1:0)||n.proximity-e.proximity||n.entry.label.length-e.entry.label.length).map(n=>n.entry)}T(X,"filterAndSortList");function h(t,r){const i=t.filter(r);return i.length===0?t:i}T(h,"filterNonEmpty");function G(t){return t.toLowerCase().replace(/\W/g,"")}T(G,"normalizeText");function Z(t,r){let i=q(r,t);return t.length>r.length&&(i-=t.length-r.length-1,i+=t.indexOf(r)===0?0:.5),i}T(Z,"getProximity");function q(t,r){let i,n;const e=[],l=t.length,o=r.length;for(i=0;i<=l;i++)e[i]=[i];for(n=1;n<=o;n++)e[0][n]=n;for(i=1;i<=l;i++)for(n=1;n<=o;n++){const u=t[i-1]===r[n-1]?0:1;e[i][n]=Math.min(e[i-1][n]+1,e[i][n-1]+1,e[i-1][n-1]+u),i>1&&n>1&&t[i-1]===r[n-2]&&t[i-2]===r[n-1]&&(e[i][n]=Math.min(e[i][n],e[i-2][n-2]+u))}return e[l][o]}T(q,"lexicalDistance");const ee={command:"editor.action.triggerSuggest",title:"Suggestions"},Le=T(t=>{const r=[];if(t)try{De(Fe(t),{FragmentDefinition(i){r.push(i)}})}catch{return[]}return r},"collectFragmentDefs");function ne(t,r,i,n,e,l){var o;const u=Object.assign(Object.assign({},l),{schema:t}),s=n||ue(r,i),c=s.state.kind==="Invalid"?s.state.prevState:s.state;if(!c)return[];const p=c.kind,g=c.step,S=pe(t,s.state);if(p===a.DOCUMENT)return I(s,[{label:"query",kind:m.Function},{label:"mutation",kind:m.Function},{label:"subscription",kind:m.Function},{label:"fragment",kind:m.Function},{label:"{",kind:m.Constructor}]);if(p===a.IMPLEMENTS||p===a.NAMED_TYPE&&((o=c.prevState)===null||o===void 0?void 0:o.kind)===a.IMPLEMENTS)return re(s,c,t,r,S);if(p===a.SELECTION_SET||p===a.FIELD||p===a.ALIASED_FIELD)return te(s,S,u);if(p===a.ARGUMENTS||p===a.ARGUMENT&&g===0){const d=S.argDefs;if(d)return I(s,d.map(f=>{var v;return{label:f.name,insertText:f.name+": ",command:ee,detail:String(f.type),documentation:(v=f.description)!==null&&v!==void 0?v:void 0,kind:m.Variable,type:f.type}}))}if((p===a.OBJECT_VALUE||p===a.OBJECT_FIELD&&g===0)&&S.objectFieldDefs){const d=N(S.objectFieldDefs),f=p===a.OBJECT_VALUE?m.Value:m.Field;return I(s,d.map(v=>{var D;return{label:v.name,detail:String(v.type),documentation:(D=v.description)!==null&&D!==void 0?D:void 0,kind:f,type:v.type}}))}if(p===a.ENUM_VALUE||p===a.LIST_VALUE&&g===1||p===a.OBJECT_FIELD&&g===2||p===a.ARGUMENT&&g===2)return ie(s,S,r,t);if(p===a.VARIABLE&&g===1){const d=A(S.inputType),f=B(r,t,s);return I(s,f.filter(v=>v.detail===(d==null?void 0:d.name)))}return p===a.TYPE_CONDITION&&g===1||p===a.NAMED_TYPE&&c.prevState!=null&&c.prevState.kind===a.TYPE_CONDITION?ae(s,S,t):p===a.FRAGMENT_SPREAD&&g===1?oe(s,S,t,r,Array.isArray(e)?e:Le(e)):p===a.VARIABLE_DEFINITION&&g===2||p===a.LIST_TYPE&&g===1||p===a.NAMED_TYPE&&c.prevState&&(c.prevState.kind===a.VARIABLE_DEFINITION||c.prevState.kind===a.LIST_TYPE||c.prevState.kind===a.NON_NULL_TYPE)?le(s,t):p===a.DIRECTIVE?ce(s,c,t):[]}T(ne,"getAutocompleteSuggestions");const R=` {
|
|
2
2
|
$1
|
|
3
3
|
}`,Ce=T(t=>{const r=t.type;return F(r)||w(r)&&F(r.ofType)||Ne(r)&&(F(r.ofType)||w(r.ofType)&&F(r.ofType.ofType))?R:null},"getInsertText");function te(t,r,i){var n;if(r.parentType){const e=r.parentType;let l=[];return"getFields"in e&&(l=N(e.getFields())),F(e)&&l.push(fe),e===((n=i==null?void 0:i.schema)===null||n===void 0?void 0:n.getQueryType())&&l.push(Te,ge),I(t,l.map((o,u)=>{var s;const c={sortText:String(u)+o.name,label:o.name,detail:String(o.type),documentation:(s=o.description)!==null&&s!==void 0?s:void 0,deprecated:!!o.deprecationReason,isDeprecated:!!o.deprecationReason,deprecationReason:o.deprecationReason,kind:m.Field,type:o.type},p=Ce(o);return p&&(c.insertText=o.name+p,c.insertTextFormat=Ee.Snippet,c.command=ee),c}))}return[]}T(te,"getSuggestionsForFieldNames");function ie(t,r,i,n){const e=A(r.inputType),l=B(i,n,t).filter(o=>o.detail===e.name);if(e instanceof H){const o=e.getValues();return I(t,o.map(u=>{var s;return{label:u.name,detail:String(e),documentation:(s=u.description)!==null&&s!==void 0?s:void 0,deprecated:!!u.deprecationReason,isDeprecated:!!u.deprecationReason,deprecationReason:u.deprecationReason,kind:m.EnumMember,type:e}}).concat(l))}else if(e===O)return I(t,l.concat([{label:"true",detail:String(O),documentation:"Not false.",kind:m.Variable,type:O},{label:"false",detail:String(O),documentation:"Not true.",kind:m.Variable,type:O}]));return l}T(ie,"getSuggestionsForInputValues");function re(t,r,i,n,e){if(r.needsSeparator)return[];const l=i.getTypeMap(),o=N(l).filter(me),u=o.map(({name:d})=>d),s=new Set;M(n,(d,f)=>{var v,D,_,b,y;if(f.name&&(f.kind===a.INTERFACE_DEF&&!u.includes(f.name)&&s.add(f.name),f.kind===a.NAMED_TYPE&&((v=f.prevState)===null||v===void 0?void 0:v.kind)===a.IMPLEMENTS)){if(e.interfaceDef){if((D=e.interfaceDef)===null||D===void 0?void 0:D.getInterfaces().find(({name:x})=>x===f.name))return;const U=i.getType(f.name),k=(_=e.interfaceDef)===null||_===void 0?void 0:_.toConfig();e.interfaceDef=new P(Object.assign(Object.assign({},k),{interfaces:[...k.interfaces,U||new P({name:f.name,fields:{}})]}))}else if(e.objectTypeDef){if((b=e.objectTypeDef)===null||b===void 0?void 0:b.getInterfaces().find(({name:x})=>x===f.name))return;const U=i.getType(f.name),k=(y=e.objectTypeDef)===null||y===void 0?void 0:y.toConfig();e.objectTypeDef=new z(Object.assign(Object.assign({},k),{interfaces:[...k.interfaces,U||new P({name:f.name,fields:{}})]}))}}});const c=e.interfaceDef||e.objectTypeDef,g=((c==null?void 0:c.getInterfaces())||[]).map(({name:d})=>d),S=o.concat([...s].map(d=>({name:d}))).filter(({name:d})=>d!==(c==null?void 0:c.name)&&!g.includes(d));return I(t,S.map(d=>{const f={label:d.name,kind:m.Interface,type:d};return d!=null&&d.description&&(f.documentation=d.description),f}))}T(re,"getSuggestionsForImplements");function ae(t,r,i,n){let e;if(r.parentType)if(ve(r.parentType)){const l=Se(r.parentType),o=i.getPossibleTypes(l),u=Object.create(null);o.forEach(s=>{s.getInterfaces().forEach(c=>{u[c.name]=c})}),e=o.concat(N(u))}else e=[r.parentType];else{const l=i.getTypeMap();e=N(l).filter(F)}return I(t,e.map(l=>{const o=A(l);return{label:String(l),documentation:(o==null?void 0:o.description)||"",kind:m.Field}}))}T(ae,"getSuggestionsForFragmentTypeConditions");function oe(t,r,i,n,e){if(!n)return[];const l=i.getTypeMap(),o=W(t.state),u=se(n);e&&e.length>0&&u.push(...e);const s=u.filter(c=>l[c.typeCondition.name.value]&&!(o&&o.kind===a.FRAGMENT_DEFINITION&&o.name===c.name.value)&&F(r.parentType)&&F(l[c.typeCondition.name.value])&&ye(i,r.parentType,l[c.typeCondition.name.value]));return I(t,s.map(c=>({label:c.name.value,detail:String(l[c.typeCondition.name.value]),documentation:`fragment ${c.name.value} on ${c.typeCondition.name.value}`,kind:m.Field,type:l[c.typeCondition.name.value]})))}T(oe,"getSuggestionsForFragmentSpread");const Re=T((t,r)=>{var i,n,e,l,o,u,s,c,p,g;if(((i=t.prevState)===null||i===void 0?void 0:i.kind)===r)return t.prevState;if(((e=(n=t.prevState)===null||n===void 0?void 0:n.prevState)===null||e===void 0?void 0:e.kind)===r)return t.prevState.prevState;if(((u=(o=(l=t.prevState)===null||l===void 0?void 0:l.prevState)===null||o===void 0?void 0:o.prevState)===null||u===void 0?void 0:u.kind)===r)return t.prevState.prevState.prevState;if(((g=(p=(c=(s=t.prevState)===null||s===void 0?void 0:s.prevState)===null||c===void 0?void 0:c.prevState)===null||p===void 0?void 0:p.prevState)===null||g===void 0?void 0:g.kind)===r)return t.prevState.prevState.prevState.prevState},"getParentDefinition");function B(t,r,i){let n=null,e;const l=Object.create({});return M(t,(o,u)=>{if((u==null?void 0:u.kind)===a.VARIABLE&&u.name&&(n=u.name),(u==null?void 0:u.kind)===a.NAMED_TYPE&&n){const s=Re(u,a.TYPE);s!=null&&s.type&&(e=r.getType(s==null?void 0:s.type))}n&&e&&(l[n]||(l[n]={detail:e.toString(),insertText:i.string==="$"?n:"$"+n,label:n,type:e,kind:m.Variable},n=null,e=null))}),N(l)}T(B,"getVariableCompletions");function se(t){const r=[];return M(t,(i,n)=>{n.kind===a.FRAGMENT_DEFINITION&&n.name&&n.type&&r.push({kind:a.FRAGMENT_DEFINITION,name:{kind:Y.NAME,value:n.name},selectionSet:{kind:a.SELECTION_SET,selections:[]},typeCondition:{kind:a.NAMED_TYPE,name:{kind:Y.NAME,value:n.type}}})}),r}T(se,"getFragmentDefinitions");function le(t,r,i){const n=r.getTypeMap(),e=N(n).filter(Ie);return I(t,e.map(l=>({label:l.name,documentation:l.description,kind:m.Variable})))}T(le,"getSuggestionsForVariableDefinition");function ce(t,r,i,n){var e;if(!((e=r.prevState)===null||e===void 0)&&e.kind){const l=i.getDirectives().filter(o=>de(r.prevState,o));return I(t,l.map(o=>({label:o.name,documentation:o.description||"",kind:m.Function})))}return[]}T(ce,"getSuggestionsForDirective");function ue(t,r){let i=null,n=null,e=null;const l=M(t,(o,u,s,c)=>{if(c===r.line&&o.getCurrentPosition()>=r.character)return i=s,n=Object.assign({},u),e=o.current(),"BREAK"});return{start:l.start,end:l.end,string:e||l.string,state:n||l.state,style:i||l.style}}T(ue,"getTokenAtPosition");function M(t,r){const i=t.split(`
|
|
4
4
|
`),n=Oe();let e=n.startState(),l="",o=new Q("");for(let u=0;u<i.length;u++){for(o=new Q(i[u]);!o.eol()&&(l=n.token(o,e),r(o,e,l,u)!=="BREAK"););r(o,e,l,u),e.kind||(e=n.startState())}return{start:o.getStartOfToken(),end:o.getCurrentPosition(),string:o.current(),state:e,style:l}}T(M,"runOnlineParser");function de(t,r){var i;if(!t||!t.kind)return!1;const n=t.kind,e=r.locations;switch(n){case a.QUERY:return e.indexOf(E.QUERY)!==-1;case a.MUTATION:return e.indexOf(E.MUTATION)!==-1;case a.SUBSCRIPTION:return e.indexOf(E.SUBSCRIPTION)!==-1;case a.FIELD:case a.ALIASED_FIELD:return e.indexOf(E.FIELD)!==-1;case a.FRAGMENT_DEFINITION:return e.indexOf(E.FRAGMENT_DEFINITION)!==-1;case a.FRAGMENT_SPREAD:return e.indexOf(E.FRAGMENT_SPREAD)!==-1;case a.INLINE_FRAGMENT:return e.indexOf(E.INLINE_FRAGMENT)!==-1;case a.SCHEMA_DEF:return e.indexOf(E.SCHEMA)!==-1;case a.SCALAR_DEF:return e.indexOf(E.SCALAR)!==-1;case a.OBJECT_TYPE_DEF:return e.indexOf(E.OBJECT)!==-1;case a.FIELD_DEF:return e.indexOf(E.FIELD_DEFINITION)!==-1;case a.INTERFACE_DEF:return e.indexOf(E.INTERFACE)!==-1;case a.UNION_DEF:return e.indexOf(E.UNION)!==-1;case a.ENUM_DEF:return e.indexOf(E.ENUM)!==-1;case a.ENUM_VALUE:return e.indexOf(E.ENUM_VALUE)!==-1;case a.INPUT_DEF:return e.indexOf(E.INPUT_OBJECT)!==-1;case a.INPUT_VALUE_DEF:switch((i=t.prevState)===null||i===void 0?void 0:i.kind){case a.ARGUMENTS_DEF:return e.indexOf(E.ARGUMENT_DEFINITION)!==-1;case a.INPUT_DEF:return e.indexOf(E.INPUT_FIELD_DEFINITION)!==-1}}return!1}T(de,"canUseDirective");function pe(t,r){let i,n,e,l,o,u,s,c,p,g,S;return j(r,d=>{var f;switch(d.kind){case a.QUERY:case"ShortQuery":g=t.getQueryType();break;case a.MUTATION:g=t.getMutationType();break;case a.SUBSCRIPTION:g=t.getSubscriptionType();break;case a.INLINE_FRAGMENT:case a.FRAGMENT_DEFINITION:d.type&&(g=t.getType(d.type));break;case a.FIELD:case a.ALIASED_FIELD:{!g||!d.name?o=null:(o=p?V(t,p,d.name):null,g=o?o.type:null);break}case a.SELECTION_SET:p=A(g);break;case a.DIRECTIVE:e=d.name?t.getDirective(d.name):null;break;case a.INTERFACE_DEF:d.name&&(s=null,S=new P({name:d.name,interfaces:[],fields:{}}));break;case a.OBJECT_TYPE_DEF:d.name&&(S=null,s=new z({name:d.name,interfaces:[],fields:{}}));break;case a.ARGUMENTS:{if(!d.prevState)n=null;else switch(d.prevState.kind){case a.FIELD:n=o&&o.args;break;case a.DIRECTIVE:n=e&&e.args;break;case a.ALIASED_FIELD:{const y=(f=d.prevState)===null||f===void 0?void 0:f.name;if(!y){n=null;break}const L=p?V(t,p,y):null;if(!L){n=null;break}n=L.args;break}default:n=null;break}break}case a.ARGUMENT:if(n){for(let y=0;y<n.length;y++)if(n[y].name===d.name){i=n[y];break}}u=i==null?void 0:i.type;break;case a.ENUM_VALUE:const v=A(u);l=v instanceof H?v.getValues().find(y=>y.value===d.name):null;break;case a.LIST_VALUE:const D=_e(u);u=D instanceof Ae?D.ofType:null;break;case a.OBJECT_VALUE:const _=A(u);c=_ instanceof be?_.getFields():null;break;case a.OBJECT_FIELD:const b=d.name&&c?c[d.name]:null;u=b==null?void 0:b.type;break;case a.NAMED_TYPE:d.name&&(g=t.getType(d.name));break}}),{argDef:i,argDefs:n,directiveDef:e,enumValue:l,fieldDef:o,inputType:u,objectFieldDefs:c,parentType:p,type:g,interfaceDef:S,objectTypeDef:s}}T(pe,"getTypeInfo");C.registerHelper("hint","graphql",(t,r)=>{const i=r.schema;if(!i)return;const n=t.getCursor(),e=t.getTokenAt(n),l=e.type!==null&&/"|\w/.test(e.string[0])?e.start:e.end,o=new ke(n.line,l),s={list:ne(i,t.getValue(),o,e,r.externalFragments).map(c=>({text:c.label,type:c.type,description:c.documentation,isDeprecated:c.isDeprecated,deprecationReason:c.deprecationReason})),from:{line:n.line,ch:l},to:{line:n.line,ch:e.end}};return s!=null&&s.list&&s.list.length>0&&(s.from=C.Pos(s.from.line,s.from.ch),s.to=C.Pos(s.to.line,s.to.ch),C.signal(t,"hasCompletion",t,s,e)),s});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as u}from"./codemirror.es-
|
|
1
|
+
import{C as u}from"./codemirror.es-D6n4hw-Q.js";import{f as j}from"./forEachState.es-D8bf0zSr.js";import{g,o as b,G as O,b as d,q as N,r as D}from"./index-Do26lepM.js";import"./index-D8jEuOKc.js";var M=Object.defineProperty,p=(r,n)=>M(r,"name",{value:n,configurable:!0});function f(r,n,t){const i=x(t,m(n.string));if(!i)return;const e=n.type!==null&&/"|\w/.test(n.string[0])?n.start:n.end;return{list:i,from:{line:r.line,ch:e},to:{line:r.line,ch:n.end}}}p(f,"hintList");function x(r,n){if(!n)return y(r,l=>!l.isDeprecated);const t=r.map(l=>({proximity:T(m(l.text),n),entry:l}));return y(y(t,l=>l.proximity<=2),l=>!l.entry.isDeprecated).sort((l,o)=>(l.entry.isDeprecated?1:0)-(o.entry.isDeprecated?1:0)||l.proximity-o.proximity||l.entry.text.length-o.entry.text.length).map(l=>l.entry)}p(x,"filterAndSortList");function y(r,n){const t=r.filter(n);return t.length===0?r:t}p(y,"filterNonEmpty");function m(r){return r.toLowerCase().replace(/\W/g,"")}p(m,"normalizeText");function T(r,n){let t=v(n,r);return r.length>n.length&&(t-=r.length-n.length-1,t+=r.indexOf(n)===0?0:.5),t}p(T,"getProximity");function v(r,n){let t,i;const e=[],l=r.length,o=n.length;for(t=0;t<=l;t++)e[t]=[t];for(i=1;i<=o;i++)e[0][i]=i;for(t=1;t<=l;t++)for(i=1;i<=o;i++){const c=r[t-1]===n[i-1]?0:1;e[t][i]=Math.min(e[t-1][i]+1,e[t][i-1]+1,e[t-1][i-1]+c),t>1&&i>1&&r[t-1]===n[i-2]&&r[t-2]===n[i-1]&&(e[t][i]=Math.min(e[t][i],e[t-2][i-2]+c))}return e[l][o]}p(v,"lexicalDistance");u.registerHelper("hint","graphql-variables",(r,n)=>{const t=r.getCursor(),i=r.getTokenAt(t),e=L(t,i,n);return e!=null&&e.list&&e.list.length>0&&(e.from=u.Pos(e.from.line,e.from.ch),e.to=u.Pos(e.to.line,e.to.ch),u.signal(r,"hasCompletion",r,e,i)),e});function L(r,n,t){const i=n.state.kind==="Invalid"?n.state.prevState:n.state,e=i.kind,l=i.step;if(e==="Document"&&l===0)return f(r,n,[{text:"{"}]);const o=t.variableToType;if(!o)return;const c=V(o,n.state);if(e==="Document"||e==="Variable"&&l===0){const a=Object.keys(o);return f(r,n,a.map(s=>({text:`"${s}": `,type:o[s]})))}if((e==="ObjectValue"||e==="ObjectField"&&l===0)&&c.fields){const a=Object.keys(c.fields).map(s=>c.fields[s]);return f(r,n,a.map(s=>({text:`"${s.name}": `,type:s.type,description:s.description})))}if(e==="StringValue"||e==="NumberValue"||e==="BooleanValue"||e==="NullValue"||e==="ListValue"&&l===1||e==="ObjectField"&&l===2||e==="Variable"&&l===2){const a=c.type?g(c.type):void 0;if(a instanceof b)return f(r,n,[{text:"{"}]);if(a instanceof O){const s=a.getValues();return f(r,n,s.map(h=>({text:`"${h.name}"`,type:a,description:h.description})))}else if(a===d)return f(r,n,[{text:"true",type:d,description:"Not false."},{text:"false",type:d,description:"Not true."}])}}p(L,"getVariablesHint");function V(r,n){const t={type:null,fields:null};return j(n,i=>{if(i.kind==="Variable")t.type=r[i.name];else if(i.kind==="ListValue"){const e=t.type?N(t.type):void 0;t.type=e instanceof D?e.ofType:null}else if(i.kind==="ObjectValue"){const e=t.type?g(t.type):void 0;t.fields=e instanceof b?e.getFields():null}else if(i.kind==="ObjectField"){const e=i.name&&t.fields?t.fields[i.name]:null;t.type=e==null?void 0:e.type}}),t}p(V,"getTypeInfo");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{gB as x,bb as E}from"./index-
|
|
1
|
+
import{gB as x,bb as E}from"./index-D8jEuOKc.js";const L=({url:r,allowFullScreen:o,position:a,display:u,height:i,width:c,overflow:y,styles:f,onLoad:p,onMouseOver:b,onMouseOut:w,scrolling:d,id:m,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:I,name:P,target:v,loading:A,importance:F,referrerpolicy:M,allowpaymentrequest:S,src:$,key:q})=>{const t=x({src:$||r,target:v||null,style:{position:a||null,display:u||"initial",overflow:y||null},scrolling:d||null,allowpaymentrequest:S||null,importance:F||null,sandbox:s&&[...s].join(" ")||null,loading:A||null,styles:f||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:m||null,"aria-labelledby":I||null,"aria-hidden":O||null,"aria-label":k||null,width:c||null,height:i||null,onLoad:p||null,onMouseOver:b||null,onMouseOut:w||null,key:q||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[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 n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),E.createElement("iframe",Object.assign({},l))},R=L;export{R as I};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aj as X,A as N,r as p,a as Z,b as ee,P as x,t as j,u as P,z as te,au as $,N as _,j as t,y as q,av as se,q as S,m as v,D as M,aw as oe,V as O,ax as re,B as W,C as z,ay as ne,E as K,M as V,az as ae,aA as ie,aB as le,H as ce,aC as B,i as ue,n as H,a9 as de,a4 as pe,a6 as he,a7 as fe,aD as me,a8 as ge,Q as xe}from"./index-
|
|
1
|
+
import{aj as X,A as N,r as p,a as Z,b as ee,P as x,t as j,u as P,z as te,au as $,N as _,j as t,y as q,av as se,q as S,m as v,D as M,aw as oe,V as O,ax as re,B as W,C as z,ay as ne,E as K,M as V,az as ae,aA as ie,aB as le,H as ce,aC as B,i as ue,n as H,a9 as de,a4 as pe,a6 as he,a7 as fe,aD as me,a8 as ge,Q as xe}from"./index-D8jEuOKc.js";import{_ as D}from"./useLocalStorage-VUDmm0Mk.js";import{c as be,C as ke,A as ye,D as Se,B as je,S as G,a as Pe,b as we}from"./item-SOaEd0D1.js";import{d as Re}from"./ArrowDropDown-ChTH4y6x.js";import{B as ve}from"./Breadcrumbs-CSvwbIEG.js";import"./index-ikTCZuew.js";import"./index-ZG7jWpak.js";import"./index-DK-C26MA.js";import"./Search-LvG1ITyu.js";import"./index-Cw0JQB9z.js";import"./Select-DsA6mJ7A.js";import"./InputAdornment-I3Qa54dS.js";import"./preact.module-DJUF--8d.js";import"./Add-DaKGD4dI.js";import"./TextField-CRqdsKdk.js";import"./InputLabel-x5fGAphs.js";import"./Launch-DawysiT2.js";import"./Done-DlneRio5.js";import"./DeleteOutline-D5ZTK7Ka.js";import"./delete-confirm-DSDxj3rA.js";import"./click-to-copy-DLjgvWtN.js";import"./shorten-label-CBdfm00-.js";import"./blocklet-_qJbakx7.js";import"./MoreVert-DSqbsAYy.js";import"./ButtonGroup-CZh258li.js";import"./getValidReactChildren-DAG74NDJ.js";function Ce(e){const n=X(),c=N(),[s,o]=D(`sid:blocklet:purchase:${e}`),[l,u]=p.useState(!1),[h,a]=p.useState(null),d=()=>{const{pathname:r,searchParams:m}=new URL(window.location.href),b=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";m.get("sid")&&(o(""),c(r.replace(b,"/"),{replace:!0}))},i=!!(n.get("assetDid")&&s&&n.get("sid")===s);return Z(ee.BlockletEvents.purchaseChange,r=>{r.did===e&&(a(r.session),["declined","confirmed","error"].includes(r.session.status)&&(u(!0),setTimeout(d,2e3)))}),p.useEffect(()=>{h&&h.id!==s&&o(h.id)},[h]),{hasCompleted:l,hasPurchased:i,session:h,setSession:a,doRedirect:d}}function E({meta:e,onCancel:n,handlePaySuccess:c,storeUrl:s}){const{t:o}=j(),{info:l}=P(),[u,h]=p.useState("both"),[a,d]=p.useState(1),i=te(l),r=$(e,l,s),m=R=>{R!==u&&h(R)},b=()=>{u&&(d(2),u==="verify"&&(window.location.href=r))},k=(R,L)=>{L!=="backdropClick"&&n()},w=()=>{c(r)},f=_.getDisplayName({meta:e});if(u==="purchase"&&a===2)return t.jsx(q,{open:!0,popup:!0,baseUrl:s,action:"acquire-asset",checkFn:se.create({baseURL:S(s,"/store")}).get,onSuccess:w,onClose:n,checkTimeout:60*5e3,extraParams:{factory:e.nftFactory},webWalletUrl:i,disableClose:!0,saveConnect:!1,showDownload:!1,messages:{title:o("store.purchase.auth.title",{name:f}),scan:o("store.purchase.auth.scan"),confirm:o("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx(v,{gutterBottom:!0,children:o("store.purchase.auth.success")}),t.jsxs(v,{variant:"subtitle2",children:[" ",o("store.purchase.autoLaunch",{name:f})]})]})}});const g=M;return t.jsx(g,{title:o("store.purchase.title",{name:f}),disableEscapeKeyDown:!0,open:!0,fullWidth:!0,onClose:k,children:t.jsx("div",{style:{marginBottom:16},children:t.jsx(ke,{action:u,onNext:b,onSelect:m})})})}E.propTypes={...be,storeUrl:x.string.isRequired,handlePaySuccess:x.func};E.defaultProps={handlePaySuccess:e=>{setTimeout(()=>{window.location.href=e},1e3)}};function U({meta:e,buttonText:n,storeUrl:c,isResource:s}){const{t:o}=j(),l=N(),{info:u}=P(),{api:h}=oe(),a=_.isFreeBlocklet(e)===!1,[d,i]=p.useState(!1),{hasPurchased:r}=Ce(e.did),[m,b]=p.useState(!1),[k]=D("instant-blocklet-install",!1),[w,f]=p.useState(!1),g=p.useMemo(()=>d?o(a?"blocklet.status.purchasing":"blocklet.status.waiting"):"",[d,o,a]),R=p.useMemo(()=>s?o("blocklet.status.resource"):a?n.purchase:n.launch,[a,n,s]),L=y=>{y.preventDefault(),y.stopPropagation();try{if(i(!0),a){b(!0);return}if(k){f(!0);return}if(!a){const C=$(e,u,c);window.location.href=C}}catch(C){K.error(V(C),{autoHideDuration:5e3}),console.error("Blocklet installed failed",C)}finally{i(!1)}},Q=()=>{i(!1),b(!1)},Y=y=>{i(!1),f(!1),l(`/blocklets/${y.appDid}/components`)},J=()=>{i(!1),f(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(ye,{children:t.jsx(O,{permission:"mutate_blocklets",children:y=>t.jsx(re,{title:s?o("launchBlocklet.error.resourceBlocklet"):"",children:t.jsx(W,{onClick:L,size:"small",sx:{cursor:s?"not-allowed":"pointer"},disabled:!!(g||!y),variant:"outlined",color:"primary","data-cy":"install-blocklet",children:g?t.jsxs(t.Fragment,{children:[t.jsx(z,{size:16,style:{marginRight:3}}),g]}):R},e.did)})})}),(r||m)&&t.jsx(E,{method:"launch",meta:e,mode:"both",onCancel:Q,storeUrl:c}),w&&t.jsx(q,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:h.get,checkTimeout:5*60*1e3,onSuccess:Y,extraParams:{title:e.title,blockletMetaUrl:decodeURIComponent(ne(c,e.did).trim())},messages:{title:o("setup.keyPair.title"),scan:o("setup.keyPair.scan"),confirm:o("setup.keyPair.confirm"),success:o("setup.keyPair.success")},onClose:J})]})}U.propTypes={isResource:x.bool,meta:x.object.isRequired,buttonText:x.shape({purchase:x.string.isRequired,launch:x.string.isRequired}).isRequired,storeUrl:x.string.isRequired};U.defaultProps={isResource:!1};const De=(e,n,c)=>{const s=de(n);return S(c,`/blocklets/${e.did}/?server-url=${s}`)},F=({meta:e,attribute:n,value:c})=>e._formatted?e._formatted[n]:c;function T({blocklet:e,endpoint:n}){const{t:c}=j(),s=P();let o=S(s.imgPrefix,"blocklet.png");const l=n;if(l.startsWith("http")&&e.logo)o=S(l,le(e.did,e.logo,e.version));else{let r=(window.env.apiPrefix||"/").replace(/^\/+/,"").replace(/\/+$/,"");r&&(r=`/${r}`),o=S(r,`/blocklet/logo/${e.did}`)}try{const i=new URL(o);i.searchParams.set("v",e.version||+new Date),o=i.href}catch{}const u=(s==null?void 0:s.info.mode)!==ce.NODE_MODES.SERVERLESS,h=i=>i.currentTarget.contains(i.target)?!0:(i.preventDefault(),!1),a={meta:e,buttonText:{purchase:c("common.purchase"),launch:c("common.launch")},storeUrl:l};let d=null;return u&&(d=t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(U,{isResource:!(B.hasStartEngine(e)||B.isGatewayBlocklet(e)||B.isPackBlocklet(e)),...a})})),t.jsx(ue,{href:De(e,s.info,n),style:{color:"initial",textDecoration:"none"},onClick:h,target:"_blank",children:t.jsx(Le,{title:F({meta:e,attribute:"title",value:e.title||e.name}),did:e.did,description:F({meta:e,attribute:"description",value:e.description}),cover:e.logo?o:"",version:e.version,button:d})})}T.propTypes={blocklet:x.object.isRequired,endpoint:x.string};T.defaultProps={endpoint:""};function I({storeUrl:e,handleSearchSelect:n,extraFilter:c,...s}){var r;const{locale:o}=j(),l=P(),[u,h]=p.useState({}),a=m=>{h(m)},d=e,i=(r=l==null?void 0:l.info)==null?void 0:r.version;return p.useEffect(()=>{h({})},[d]),t.jsx(ae,{FallbackComponent:ie,resetKeys:[d],children:t.jsx("div",{...s,children:t.jsx(Se,{blockletRender:m=>{const b={...m,endpoint:d};return t.jsx(T,{...b})},baseSearch:!0,endpoint:d,locale:o,onFilterChange:a,onSearchSelect:n,filters:u,extraFilter:c,serverVersion:i})})})}I.propTypes={storeUrl:x.string.isRequired,handleSearchSelect:x.func,extraFilter:x.func};I.defaultProps={handleSearchSelect:null,extraFilter:void 0};const Le=H(je)`
|
|
2
2
|
.ms-highlight {
|
|
3
3
|
color: ${e=>e.theme.palette.primary.main};
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as s,j as t,B as i,gl as r}from"./index-
|
|
1
|
+
import{P as s,j as t,B as i,gl as r}from"./index-D8jEuOKc.js";function n({children:e,...o}){return t.jsxs(i,{color:"did",variant:"contained",...o,children:[t.jsx("span",{style:{fontWeight:400},children:e||"Continue With"}),t.jsx(r,{style:{width:"auto",height:"1.2em",margin:"0 4px 0 8px"}})]})}n.propTypes={children:s.any};n.defaultProps={children:""};export{n as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cO as P,eC as M,eD as E,eE as g,eF as Y,eG as N,eH as j}from"./index-
|
|
1
|
+
import{cO as P,eC as M,eD as E,eE as g,eF as Y,eG as N,eH as j}from"./index-D8jEuOKc.js";import{a as X}from"./isEqual-Bqorz6b9.js";var V={},i={},d={},G=P&&P.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(d,"__esModule",{value:!0});d.toStrictHex=d.toBytes=d.toBits=d.DID_PREFIX=void 0;const K=G(M),H=g,v="did:abt:";d.DID_PREFIX=v;const q=e=>{try{if((0,H.isHexStrict)(e))return E.from((0,H.stripHexPrefix)(e),"hex");let t=(0,H.fromBase58)(e.replace(v,""));for(;t.length<26;)t=E.concat([E.from([0]),t]);return t}catch(t){throw new Error(`Cannot convert DID string to byte array: ${t.message}`)}};d.toBytes=q;const J=(e,t)=>(0,K.default)((0,H.toBN)(e).toString(2),t,"0");d.toBits=J;const W=(e,t)=>{const s=e.replace(/^0x/i,"");return typeof t=="number"&&t%2===0?(0,K.default)(e,t,"0"):s.length%2===0?s:`0${s}`};d.toStrictHex=W;var C=P&&P.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0});i.DidType=i.toChecksumAddress=i.isEthereumDid=i.isEthereumType=i.toTypeInfoStr=i.toTypeInfo=i.fromTypeInfo=i.DID_TYPE_ETHEREUM=i.DID_TYPE_ARCBLOCK=void 0;const m=g,D=C(Y),z=C(X),A=C(N),o=j,T=d,b={pk:"key",address:"encoding"},B={role:o.types.RoleType.ROLE_ACCOUNT,pk:o.types.KeyType.ED25519,hash:o.types.HashType.SHA3,address:o.types.EncodingType.BASE58};i.DID_TYPE_ARCBLOCK=B;const R={role:o.types.RoleType.ROLE_ACCOUNT,pk:o.types.KeyType.ETHEREUM,hash:o.types.HashType.KECCAK,address:o.types.EncodingType.BASE16};i.DID_TYPE_ETHEREUM=R;const F=e=>{const t=["pk","hash","address"];return(0,z.default)((0,A.default)(e,t),(0,A.default)(R,t))};i.isEthereumType=F;const L=e=>{const t=(0,m.toAddress)(e);return/^(0x)?[0-9a-f]{40}$/i.test(t)?/^(0x|0X)?[0-9a-f]{40}$/.test(t)||/^(0x|0X)?[0-9A-F]{40}$/.test(t)?!0:Q(t):!1};i.isEthereumDid=L;const Q=e=>{const t=e.replace(/^0x/i,""),s=o.Hasher.Keccak.hash256(t.toLowerCase()).replace(/^0x/i,"");for(let r=0;r<40;r++)if(parseInt(s[r],16)>7&&t[r].toUpperCase()!==t[r]||parseInt(s[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},Z=e=>{if(typeof e>"u")return"";if(!/^(0x)?[0-9a-f]{40}$/i.test(e))throw new Error(`Given address "${e}" is not a valid Ethereum address.`);const t=e.toLowerCase().replace(/^0x/i,""),s=o.Hasher.Keccak.hash256(t).replace(/^0x/i,"");let r="0x";for(let n=0;n<t.length;n++)parseInt(s[n],16)>7?r+=t[n].toUpperCase():r+=t[n];return r};i.toChecksumAddress=Z;function k(e={}){let t={};["default","arcblock"].includes(e)?t=B:["eth","ethereum"].includes(e)?t=R:t={...B,...e};const{role:s,pk:r,hash:n,address:u}=t;Object.keys(t).forEach(l=>{const _=(0,D.default)(`${b[l]||l}Type`);if(Object.values(o.types[_]).includes(t[l])===!1)throw new Error(`Unsupported ${l} type: ${t[l]}`)});const p={role:s,pk:r,hash:n,address:u};return F(p)===!1&&[o.types.RoleType.ROLE_NODE,o.types.RoleType.ROLE_VALIDATOR,o.types.RoleType.ROLE_TETHER,o.types.RoleType.ROLE_SWAP].includes(p.role)&&(p.hash=o.types.HashType.SHA2),p}i.DidType=k;k.toJSON=e=>Object.keys(e).reduce((t,s)=>{const r=(0,D.default)(`${b[s]||s}Type`),n=Object.keys(o.types[r]),u=Object.values(o.types[r]);return t[s]=n[u.indexOf(e[s])],t},{});k.fromJSON=e=>Object.keys(e).reduce((t,s)=>{const r=(0,D.default)(`${b[s]||s}Type`),n=Object.keys(o.types[r]),u=Object.values(o.types[r]);return t[s]=u[n.indexOf(e[s])],t},{});const x=e=>{const t=k(e),s=(0,T.toBits)(t.role,6),r=(0,T.toBits)(t.pk,5),n=(0,T.toBits)(t.hash,5),u=`${s}${r}${n}`,p=(0,m.stripHexPrefix)((0,m.numberToHex)(parseInt(u,2)));return(0,T.toStrictHex)(p,4)};i.fromTypeInfo=x;const w=e=>{let t={};try{if(L(e))t=R;else{const r=(0,T.toBytes)(e).slice(0,2),n=(0,T.toStrictHex)(E.from(r).toString("hex")),u=(0,T.toBits)(new m.BN(n,16),16),p=u.slice(0,6),l=u.slice(6,11),_=u.slice(11,16);t={role:parseInt(p,2),pk:parseInt(l,2),hash:parseInt(_,2),address:(0,m.isHex)((0,m.toAddress)(e))?o.types.EncodingType.BASE16:o.types.EncodingType.BASE58}}return Object.keys(t).forEach(s=>{Object.values(o.types[`${(0,D.default)(b[s]||s)}Type`]).includes(t[s])===!1&&delete t[s]}),t}catch{return t}};i.toTypeInfo=w;const ee=e=>{const t=w(e);return Object.keys(t).reduce((s,r)=>{const n=o.types[`${(0,D.default)(b[r]||r)}Type`];return s[r]=Object.keys(n).find(u=>n[u]===t[r]),s},{})};i.toTypeInfoStr=ee;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DID_TYPE_ETHEREUM=e.DID_TYPE_ARCBLOCK=e.DID_PREFIX=e.DidType=e.fromTypeInfo=e.toTypeInfoStr=e.toTypeInfo=e.isEthereumType=e.isEthereumDid=e.isValid=e.isFromPublicKey=e.toDid=e.toAddress=e.fromHash=e.fromPublicKeyHash=e.fromPublicKey=e.fromSecretKey=e.toStrictHex=e.types=void 0;const t=j;Object.defineProperty(e,"types",{enumerable:!0,get:function(){return t.types}});const s=g;Object.defineProperty(e,"toAddress",{enumerable:!0,get:function(){return s.toAddress}}),Object.defineProperty(e,"toDid",{enumerable:!0,get:function(){return s.toDid}});const r=i;Object.defineProperty(e,"DidType",{enumerable:!0,get:function(){return r.DidType}}),Object.defineProperty(e,"DID_TYPE_ARCBLOCK",{enumerable:!0,get:function(){return r.DID_TYPE_ARCBLOCK}}),Object.defineProperty(e,"DID_TYPE_ETHEREUM",{enumerable:!0,get:function(){return r.DID_TYPE_ETHEREUM}}),Object.defineProperty(e,"fromTypeInfo",{enumerable:!0,get:function(){return r.fromTypeInfo}}),Object.defineProperty(e,"isEthereumDid",{enumerable:!0,get:function(){return r.isEthereumDid}}),Object.defineProperty(e,"isEthereumType",{enumerable:!0,get:function(){return r.isEthereumType}}),Object.defineProperty(e,"toTypeInfo",{enumerable:!0,get:function(){return r.toTypeInfo}}),Object.defineProperty(e,"toTypeInfoStr",{enumerable:!0,get:function(){return r.toTypeInfoStr}});const n=d;Object.defineProperty(e,"DID_PREFIX",{enumerable:!0,get:function(){return n.DID_PREFIX}}),Object.defineProperty(e,"toStrictHex",{enumerable:!0,get:function(){return n.toStrictHex}});const u=(y,a)=>{const c=(0,r.DidType)(a),f=(0,t.getSigner)(c.pk).getPublicKey(y);return p(f.indexOf("0x")===0?f:`0x${f}`,c)};e.fromSecretKey=u;const p=(y,a)=>{const c=(0,r.DidType)(a),h=(0,t.getHasher)(c.hash)(y,1);return l(h,c)};e.fromPublicKey=p;const l=(y,a)=>{const c=(0,r.DidType)(a),f=(0,s.stripHexPrefix)(y).slice(0,40),h=(0,t.getHasher)(c.hash),I=(0,r.fromTypeInfo)(c),S=(0,s.stripHexPrefix)(h(`0x${I}${f}`,1)).slice(0,8),O=`0x${I}${f}${S}`;return(0,r.isEthereumType)(c)?(0,r.toChecksumAddress)(`0x${y.slice(-40)}`):c.address===t.types.EncodingType.BASE58?(0,s.toBase58)(O):O};e.fromPublicKeyHash=l;const _=(y,a=t.types.RoleType.ROLE_ACCOUNT)=>{const c=Object.keys(t.types.RoleType),f=Object.values(t.types.RoleType);if(f.indexOf(a)===-1)throw new Error(`Unsupported role type ${a} when gen ddi from hash`);const h=(0,r.DidType)({role:t.types.RoleType[c[f.indexOf(a)]]});return l(y,h)};e.fromHash=_;const U=(y,a)=>{if($(y)===!1)return!1;const c=(0,r.toTypeInfo)(y),f=p(a,c),h=y.replace(n.DID_PREFIX,"");return f===h};e.isFromPublicKey=U;const $=y=>{if(!y)return!1;const a=(0,s.toAddress)(String(y)),{hash:c}=(0,r.toTypeInfo)(a);if(typeof c>"u")return!1;if((0,r.isEthereumDid)(a))return!0;const f=(0,t.getHasher)(c),h=(0,n.toBytes)(a),I=(0,n.toStrictHex)(E.from(h.slice(0,22)).toString("hex")),S=(0,n.toStrictHex)(E.from(h.slice(22,26)).toString("hex")),O=(0,s.stripHexPrefix)(f(`0x${I}`,1)).slice(0,8);return S===O};e.isValid=$})(V);export{V as l};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{q as ge,n as N,P as S,r as D,f as ke,j as e,C as V,i as je,u as me,t as K,v as ye,w as Ce,D as ve,B as z,x as Se,m as E,y as Be,z as we,A as de,E as $,F as De,d as Te,H as Ae,J as Ee,K as se,M as Ie,N as W,O as oe,Q as j,R as Le,S as R,U as Pe,V as Re,X as _e}from"./index-
|
|
1
|
+
import{q as ge,n as N,P as S,r as D,f as ke,j as e,C as V,i as je,u as me,t as K,v as ye,w as Ce,D as ve,B as z,x as Se,m as E,y as Be,z as we,A as de,E as $,F as De,d as Te,H as Ae,J as Ee,K as se,M as Ie,N as W,O as oe,Q as j,R as Le,S as R,U as Pe,V as Re,X as _e}from"./index-D8jEuOKc.js";import{_ as Fe}from"./useLocalStorage-VUDmm0Mk.js";import{g as Ne,D as Ue}from"./index-UkVmuOk4.js";import{E as Oe}from"./index-DK-C26MA.js";import{B as ne}from"./status-BGxv0mkt.js";import{D as Me,u as We,B as le}from"./actions-S3zHaigm.js";import{l as re}from"./index-B1dhqxPU.js";import{u as pe,W as ze}from"./url-evaluation-DRU1r0m1.js";import{I as $e,B as qe}from"./install-from-url-41g9-VzW.js";import{B as ae}from"./app-avatar-CZMX5yC0.js";import{d as Ve}from"./Add-DaKGD4dI.js";import{S as A}from"./index-cBkUep-u.js";import{i as Ke,a as Qe}from"./schema-DeVB3oly.js";import{T as ie}from"./TextField-CRqdsKdk.js";import{F as Xe,S as He}from"./Select-DsA6mJ7A.js";import"./useThemeProps-_vPkb6TM.js";import"./index-ZzQVQqI_.js";import"./redux-rfMuaiI1.js";import"./ViewColumn-BCkzYaEc.js";import"./Delete-DUmhYiAq.js";import"./InputLabel-x5fGAphs.js";import"./LastPage-CFPei4j4.js";import"./Search-LvG1ITyu.js";import"./MoreVert-DSqbsAYy.js";import"./ButtonGroup-CZh258li.js";import"./getValidReactChildren-DAG74NDJ.js";import"./isEqual-Bqorz6b9.js";import"./index-zAZnE_sV.js";import"./Stepper-AWCpL8Wp.js";import"./ExpandMore-DpwumCaI.js";import"./index-D7RYoUXY.js";const Je=(p,c)=>{if(!p)return"";const m=new URL(p),l=new URLSearchParams(m.searchParams),b=new URL(ge(m.origin,c));return b.search=l.toString(),b.toString()};function F({blocklet:p,skipAccessibilityCheck:c=!1,...m}){const{t:l}=D.useContext(ke),{urls:b,loading:n,recommendedUrl:u}=pe(p);if(n&&!c)return e.jsx(V,{size:12,...m});const f=c?b[0]:u;return f?e.jsx(Ye,{...m,children:e.jsx(Ge,{children:e.jsx(je,{href:f,target:"_blank",className:"blocklet-interface",underline:"hover",children:l("common.open")})})}):l("blocklet.router.noAccessibleUrl")}const Ge=N.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
margin: 4px 0;
|
|
4
4
|
`,Ye=N.div`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as p,c as me,u as Z,e as Ie,aE as Er,j as e,H as E,aF as cn,aG as Bn,aH as Pr,aI as dn,aJ as qe,aK as xe,aL as ye,P as u,n as V,t as $,ac as re,aM as un,aN as Ar,aO as mn,aP as Ir,E as te,R as fn,m as L,V as ne,ax as de,C as K,K as he,B as Y,aQ as Wn,M as ue,Q as ee,f as Rt,S as qn,aR as kr,aS as Lr,a9 as Or,aT as Fr,aU as Nr,aV as Ur,A as Hn,W as pn,T as gn,k as Q,aW as Tt,a as yt,U as oe,b as et,aX as Kn,aY as Gn,aZ as Yn,a_ as $r,a2 as Mr,a$ as zr,b0 as Br,b1 as Wr,b2 as qr,b3 as Hr,b4 as He,a7 as Kr,d as Vn,N as Gr,b5 as Yr,aD as ze,a8 as ft,a5 as pt,b6 as Vr,a6 as vt,i as Xn,O as Xr,b7 as Qr,b8 as we,b9 as _e,ba as Zr,bb as Jr,D as Qn,x as bt,ai as ei,h as ti,at as hn,bc as ni,bd as xn,aj as ri,be as ii,bf as oi,bg as ai}from"./index-
|
|
1
|
+
import{r as p,c as me,u as Z,e as Ie,aE as Er,j as e,H as E,aF as cn,aG as Bn,aH as Pr,aI as dn,aJ as qe,aK as xe,aL as ye,P as u,n as V,t as $,ac as re,aM as un,aN as Ar,aO as mn,aP as Ir,E as te,R as fn,m as L,V as ne,ax as de,C as K,K as he,B as Y,aQ as Wn,M as ue,Q as ee,f as Rt,S as qn,aR as kr,aS as Lr,a9 as Or,aT as Fr,aU as Nr,aV as Ur,A as Hn,W as pn,T as gn,k as Q,aW as Tt,a as yt,U as oe,b as et,aX as Kn,aY as Gn,aZ as Yn,a_ as $r,a2 as Mr,a$ as zr,b0 as Br,b1 as Wr,b2 as qr,b3 as Hr,b4 as He,a7 as Kr,d as Vn,N as Gr,b5 as Yr,aD as ze,a8 as ft,a5 as pt,b6 as Vr,a6 as vt,i as Xn,O as Xr,b7 as Qr,b8 as we,b9 as _e,ba as Zr,bb as Jr,D as Qn,x as bt,ai as ei,h as ti,at as hn,bc as ni,bd as xn,aj as ri,be as ii,bf as oi,bg as ai}from"./index-D8jEuOKc.js";import{T as si}from"./index-BZ5mGJWw.js";import{d as li}from"./ArrowDropDown-ChTH4y6x.js";import{u as Et,C as ie,a as yn}from"./index.esm-D4aSKUKj.js";import{S as pe}from"./switch-control-D6_lOJtw.js";import{d as jt,i as ci}from"./is-path-prefix-equal-DNcDIcWb.js";import{T as G,F as di}from"./TextField-CRqdsKdk.js";import{D as Zn,g as ui}from"./index-UkVmuOk4.js";import{d as Jn}from"./Link-Cl6uWJH_.js";import{d as ke}from"./Delete-DUmhYiAq.js";import{C as Pt}from"./delete-confirm-DSDxj3rA.js";import{I as Ke}from"./index-zAZnE_sV.js";import{s as mi}from"./logo-BKA11TRi.js";import{_ as fi}from"./useLocalStorage-VUDmm0Mk.js";import{L as pi}from"./LoadingButton-Bw0KBLnj.js";import{C as gi,d as er}from"./Public-DTWYgdJa.js";import{d as At}from"./Add-DaKGD4dI.js";import{a as hi,W as Be}from"./url-evaluation-DRU1r0m1.js";import{B as tr,D as vn,R as xi,a as yi}from"./status-BGxv0mkt.js";import{d as vi}from"./CheckCircle-C9wvczio.js";import{d as bi}from"./ExpandMore-DpwumCaI.js";import{d as ji}from"./ChevronRight-D3x_9psV.js";import{d as Ci}from"./MoreVert-DSqbsAYy.js";import{d as nr}from"./Edit-Bxg4cu8b.js";import{d as Si,a as rr}from"./Https-ChBXh5m-.js";import{w as wi}from"./withStyles-DM17B_mO.js";import{S as _i}from"./Slider-ZuZU2f6x.js";import"./index-Cw0JQB9z.js";import"./Select-DsA6mJ7A.js";import"./InputLabel-x5fGAphs.js";import"./useThemeProps-_vPkb6TM.js";import"./index-ZzQVQqI_.js";import"./redux-rfMuaiI1.js";import"./ViewColumn-BCkzYaEc.js";import"./LastPage-CFPei4j4.js";import"./Search-LvG1ITyu.js";import"./index-DK-C26MA.js";import"./click-to-copy-DLjgvWtN.js";import"./shorten-label-CBdfm00-.js";const ge="Dashboard",ir=p.createContext({}),{Provider:Di,Consumer:ds}=ir,bn=[ge,E.DOMAIN_FOR_IP_SITE,E.DOMAIN_FOR_IP_SITE_REGEXP],Ri=(t,n)=>{if(t.name===E.DOMAIN_FOR_DEFAULT_SITE)return-1;if(n.name===E.DOMAIN_FOR_DEFAULT_SITE)return 1;const r=bn.includes(t.name),i=bn.includes(n.name);return r&&i?dn(t.name,n.name):r?-1:i?1:dn(t.name,n.name)},Ti=({sites:t,nodePort:n})=>{const r=window.location.host,o=(t||[]).map(a=>{const{id:l,rules:c=[],corsAllowedOrigins:h=[]}=a;let{domain:d,domainAliases:m}=a;m=m||[],[E.DOMAIN_FOR_IP_SITE,E.DOMAIN_FOR_IP_SITE_REGEXP].includes(d)&&(d=ge,m.find(f=>f.value===r)||m.unshift({protected:!1,value:r}));const g={id:l,name:d,type:"domain",items:[],domainAliases:m,isProtected:a.isProtected,corsAllowedOrigins:h};return(c||[]).forEach(f=>{const{id:y,isProtected:b,from:{pathPrefix:v},to:C}=f;if(C.type===E.ROUTING_RULE_TYPES.BLOCKLET){let T="";Number.parseInt(C.port,10)===Number.parseInt(n,10)?(T="Blocklet Server Dashboard",C.type=E.ROUTING_RULE_TYPES.DAEMON):T=C.did,g.items.push({id:y,name:cn(v||"/"),title:T,type:"rule",isProtected:b,pathPrefix:v,to:C})}else g.items.push({id:y,pathPrefix:v,name:cn(v||"/"),title:"Blocklet Server Dashboard",type:"rule",isProtected:b,to:C})}),g.items=Bn(g.items,f=>f.name),g}).sort(Ri),s=o.reduce((a,l)=>{let{name:c}=l;return c.endsWith(E.BLOCKLET_SITE_GROUP_SUFFIX)&&([c]=c.split(".")),a[c]={...l,rules:l.items},a},{});return{sites:o,siteMap:s}},Ei=({did:t,domain:n,mountPoint:r,siteMap:i,params:o}={})=>{if(!i)return null;const s=i[t];if(!s)return null;const a=n||(s.domainAliases||[])[0];if(!a)return null;let l=r;if(!l){const c=s.rules.filter(h=>!h.name.startsWith(E.WELLKNOWN_PATH_PREFIX))[0];l=c?c.name:"/"}return qe(a.value,l,o)},Pi=({did:t,mountPoint:n,siteMap:r,params:i}={})=>{if(!r)return[];const o=r[t];if(!o)return[];const s=o.domainAliases||[];if(!s.length)return[];let a=n;if(!a){const l=o.rules.filter(c=>!c.name.startsWith(E.WELLKNOWN_PATH_PREFIX))[0];a=l?l.name:"/"}return s.map(l=>qe(l.value,a,i))},Ai=t=>{const n=t.map(i=>i.domain).filter(i=>![E.DOMAIN_FOR_IP_SITE_REGEXP,E.DOMAIN_FOR_DEFAULT_SITE].includes(i));let r=[];return t.forEach(i=>r.push(...i.domainAliases||[])),r=r.map(i=>typeof i=="string"?{value:i,isProtected:!1}:i),{domains:n,domainsAliases:r}};function jn({children:t}){const n=me(),{info:r}=Z(),[i,o]=p.useState([]),[s,a]=p.useState([]),[l,c]=p.useState([]),h=Ie(async()=>{const{sites:w}=await n.getRoutingSites({input:{snapshotHash:""}}),S=w||[];await Promise.all(S.map(async D=>(D.domainAliases=await Er(D.domainAliases,{getIP:Pr}),D)));const I=Ai(S);o(S),a(I.domains),c([window.location.hostname,...I.domains,...I.domainsAliases.map(D=>D.value)])},[r]),d=(w,S)=>{o(I=>I.map(D=>D.id===w?S.domain?S:{...S,domain:D.domain}:D))},m=w=>n.takeRoutingSnapshot({input:{dryRun:!1,message:encodeURIComponent(w)}}),g=async w=>{const S=await n.addRoutingSite({input:w});o(i.concat(S.site))},f=async(w,S)=>{const I=await n.updateRoutingSite({input:{id:w,...S}});if(I.site&&I.site.id){const D=i.findIndex(U=>U.id===I.site.id);D!==-1&&(i.splice(D,1,I.site),o([].concat(i)))}},y=async w=>{await n.deleteRoutingSite({input:{id:w}}),o(i.filter(S=>S.id!==w))},b=async(w,S,I)=>{const D=await n.addDomainAlias({input:{id:w,domainAlias:S,force:I}});d(w,D.site)},v=async(w,S)=>{const I=await n.deleteDomainAlias({input:{id:w,domainAlias:S}});d(w,I.site)},C=async(w,S)=>{const{site:I}=await n.addRoutingRule({input:{id:w,rule:S}});d(w,I)},T=async(w,S)=>{const{site:I}=await n.updateRoutingRule({input:{id:w,rule:S}});d(w,I)},j=async(w,S)=>{const{site:I}=await n.deleteRoutingRule({input:{id:w,ruleId:S}});d(w,I)},x={loading:h.loading,error:h.error,refresh:h.retry,api:n,actions:{addSite:g,updateSite:f,deleteSite:y,addDomainAlias:b,deleteDomainAlias:v,takeSnapshot:m,addRule:C,updateRule:T,deleteRule:j}},{sites:P,siteMap:R}=Ti({sites:i,nodePort:r.port});return x.sites=P,x.siteMap=R,x.domains=s,x.allDomains=l,x.getBlockletUrl=({did:w,domain:S,mountPoint:I,params:D})=>Ei({did:w,domain:S,mountPoint:I,siteMap:x.siteMap,params:D}),x.getBlockletUrls=({did:w,mountPoint:S,params:I})=>Pi({did:w,mountPoint:S,siteMap:x.siteMap,params:I}),e.jsx(Di,{value:{routing:x},children:t})}function se(){const{routing:t}=p.useContext(ir);return t}function It(t){const n=[E.DOMAIN_FOR_IP_SITE_REGEXP,E.DOMAIN_FOR_DEFAULT_SITE,E.DOMAIN_FOR_IP_SITE];return typeof window<"u"&&typeof window.location<"u"&&n.push(window.location.hostname),n.includes(t)}var kt={},Ii=ye;Object.defineProperty(kt,"__esModule",{value:!0});var or=kt.default=void 0,ki=Ii(xe()),Li=e;or=kt.default=(0,ki.default)((0,Li.jsx)("path",{d:"m7 14 5-5 5 5z"}),"ArrowDropUp");function Oi(){return null}function Lt({confirm:t}){const[n,r]=p.useState(null),{t:i}=$(),o=()=>{r(null)},s=async l=>{if(l){let c=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";c==="/"?un.push(`${l.pathname}`):(c.endsWith("/")&&(c=c.substring(0,c.length-1)),un.push(`${c}${l.pathname}`)),window.location.reload()}},a=(l,...c)=>{let h=typeof t=="function"?t(l,...c):t;return h?(typeof h=="string"&&(h={description:h}),r({title:i("common.noticeTitle"),description:i("common.leavePageTip"),confirm:i("common.confirm"),cancel:i("common.cancel"),onConfirm:()=>s(l),onCancel:()=>o(),...h}),!1):!0};return e.jsxs(Fi,{children:[e.jsx(Oi,{message:a}),n&&e.jsx(re,{title:n.title,description:n.description,confirm:n.confirm,cancel:n.cancel,params:n.params,onConfirm:n.onConfirm,onCancel:n.onCancel})]})}Lt.propTypes={confirm:u.oneOfType([u.object,u.string,u.func])};Lt.defaultProps={confirm:null};const Fi=V.div`
|
|
2
2
|
margin-bottom: 24px;
|
|
3
3
|
.top-btns-alert {
|
|
4
4
|
@media (max-width: ${t=>t.theme.breakpoints.values.sm}px) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as y,j as e,g as d3,bl as U,t as K,m as Q,D as X,B as R,C as k,x as ne,K as re,M as t3,P as S,bG as w,n as Z,cb as Y,eB as q,fP as V3,aZ as ae,a_ as ie,a2 as j,ac as F3,E as v,fQ as oe,Q as h,fR as Ae,N as He,b as le,aK as Ee,aL as Ie,H as U3,U as _3,aQ as $3,W as W3,fS as ce,cO as J3,fT as De,fU as Je,eH as j3,eD as ue,eE as b3,fV as de,fW as Fe,eG as pe,eK as fe,fX as Ge,fY as me,w as he,ax as E3,T as ge,f as Be,J as ye,V as C3}from"./index-
|
|
1
|
+
import{r as y,j as e,g as d3,bl as U,t as K,m as Q,D as X,B as R,C as k,x as ne,K as re,M as t3,P as S,bG as w,n as Z,cb as Y,eB as q,fP as V3,aZ as ae,a_ as ie,a2 as j,ac as F3,E as v,fQ as oe,Q as h,fR as Ae,N as He,b as le,aK as Ee,aL as Ie,H as U3,U as _3,aQ as $3,W as W3,fS as ce,cO as J3,fT as De,fU as Je,eH as j3,eD as ue,eE as b3,fV as de,fW as Fe,eG as pe,eK as fe,fX as Ge,fY as me,w as he,ax as E3,T as ge,f as Be,J as ye,V as C3}from"./index-D8jEuOKc.js";import{d as p3}from"./Add-DaKGD4dI.js";import{S as n3}from"./index-cBkUep-u.js";import{d as a3}from"./EditIcon-DZ4AA4ec.js";import{d as Ne}from"./LockIcon-CnkvxSHY.js";import{L as f3,S as G3,d as Oe}from"./list-header-dggL7_n2.js";import{a as z}from"./team-BOnxiYnY.js";import{T as _,F as Te}from"./TextField-CRqdsKdk.js";import{C as Se}from"./Google-ppCuuQRJ.js";import{u as Ce}from"./blocklet-_qJbakx7.js";import{E as m3}from"./index-DK-C26MA.js";import{l as k3}from"./index-B1dhqxPU.js";import{j as xe}from"./index-ikTCZuew.js";import{I as Pe}from"./InputAdornment-I3Qa54dS.js";import{I as Re}from"./InputLabel-x5fGAphs.js";import{T as ve,a as I3}from"./ToggleButtonGroup-AtNMdn7e.js";import{O as Me}from"./Select-DsA6mJ7A.js";import"./ExpandMore-DpwumCaI.js";import"./ButtonGroup-CZh258li.js";import"./getValidReactChildren-DAG74NDJ.js";import"./Search-LvG1ITyu.js";import"./url-evaluation-DRU1r0m1.js";import"./isEqual-Bqorz6b9.js";import"./index-ZG7jWpak.js";var h3={};Object.defineProperty(h3,"__esModule",{value:!0});var s3=h3.default=void 0;Le(y);var x3=e;function Le(a){return a&&a.__esModule?a:{default:a}}function P3(a,l){var o=Object.keys(a);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(a);l&&(A=A.filter(function(c){return Object.getOwnPropertyDescriptor(a,c).enumerable})),o.push.apply(o,A)}return o}function R3(a){for(var l=1;l<arguments.length;l++){var o=arguments[l]!=null?arguments[l]:{};l%2?P3(Object(o),!0).forEach(function(A){Ve(a,A,o[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(o)):P3(Object(o)).forEach(function(A){Object.defineProperty(a,A,Object.getOwnPropertyDescriptor(o,A))})}return a}function Ve(a,l,o){return(l=Ue(l))in a?Object.defineProperty(a,l,{value:o,enumerable:!0,configurable:!0,writable:!0}):a[l]=o,a}function Ue(a){var l=_e(a,"string");return typeof l=="symbol"?l:l+""}function _e(a,l){if(typeof a!="object"||!a)return a;var o=a[Symbol.toPrimitive];if(o!==void 0){var A=o.call(a,l||"default");if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(a)}var g3=function(l){return(0,x3.jsx)("svg",R3(R3({},l),{},{children:(0,x3.jsx)("path",{d:"M8.438 4.313H8.25a.188.188 0 0 0 .188-.188v.188h7.124v-.188c0 .103.085.188.188.188h-.188V6h1.688V4.125c0-.827-.673-1.5-1.5-1.5h-7.5c-.827 0-1.5.673-1.5 1.5V6h1.688V4.312zM20.25 6H3.75a.75.75 0 0 0-.75.75v.75c0 .103.084.188.188.188h1.415l.579 12.257c.038.8.698 1.43 1.498 1.43h10.64c.802 0 1.46-.628 1.498-1.43l.579-12.258h1.416A.188.188 0 0 0 21 7.5v-.75a.75.75 0 0 0-.75-.75zm-3.11 13.688H6.86l-.567-12h11.414l-.567 12z"})}))};g3.defaultProps={width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"};g3.displayName="delete";s3=h3.default=g3;var w3={exports:{}},K3={exports:{}};(function(){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l={rotl:function(o,A){return o<<A|o>>>32-A},rotr:function(o,A){return o<<32-A|o>>>A},endian:function(o){if(o.constructor==Number)return l.rotl(o,8)&16711935|l.rotl(o,24)&4278255360;for(var A=0;A<o.length;A++)o[A]=l.endian(o[A]);return o},randomBytes:function(o){for(var A=[];o>0;o--)A.push(Math.floor(Math.random()*256));return A},bytesToWords:function(o){for(var A=[],c=0,E=0;c<o.length;c++,E+=8)A[E>>>5]|=o[c]<<24-E%32;return A},wordsToBytes:function(o){for(var A=[],c=0;c<o.length*32;c+=8)A.push(o[c>>>5]>>>24-c%32&255);return A},bytesToHex:function(o){for(var A=[],c=0;c<o.length;c++)A.push((o[c]>>>4).toString(16)),A.push((o[c]&15).toString(16));return A.join("")},hexToBytes:function(o){for(var A=[],c=0;c<o.length;c+=2)A.push(parseInt(o.substr(c,2),16));return A},bytesToBase64:function(o){for(var A=[],c=0;c<o.length;c+=3)for(var E=o[c]<<16|o[c+1]<<8|o[c+2],J=0;J<4;J++)c*8+J*6<=o.length*8?A.push(a.charAt(E>>>6*(3-J)&63)):A.push("=");return A.join("")},base64ToBytes:function(o){o=o.replace(/[^A-Z0-9+\/]/ig,"");for(var A=[],c=0,E=0;c<o.length;E=++c%4)E!=0&&A.push((a.indexOf(o.charAt(c-1))&Math.pow(2,-2*E+8)-1)<<E*2|a.indexOf(o.charAt(c))>>>6-E*2);return A}};K3.exports=l})();var We=K3.exports,u3={utf8:{stringToBytes:function(a){return u3.bin.stringToBytes(unescape(encodeURIComponent(a)))},bytesToString:function(a){return decodeURIComponent(escape(u3.bin.bytesToString(a)))}},bin:{stringToBytes:function(a){for(var l=[],o=0;o<a.length;o++)l.push(a.charCodeAt(o)&255);return l},bytesToString:function(a){for(var l=[],o=0;o<a.length;o++)l.push(String.fromCharCode(a[o]));return l.join("")}}},v3=u3;/*!
|
|
2
2
|
* Determine if an object is a Buffer
|
|
3
3
|
*
|
|
4
4
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as We,Y as Ge,n as P,Q as v,Z as Q,j as e,$ as ke,r as x,P as E,t as _,a0 as ue,a1 as be,q as C,a2 as se,a3 as He,E as M,M as K,a4 as qe,m as A,T as Ve,a5 as Ye,B,D as Qe,C as ve,x as Ke,K as Se,a6 as Je,a7 as Ze,a8 as Xe,u as I,f as et,a9 as W,v as te,F as tt,aa as oe,A as je,w as re,ab as st,W as ne,i as J,y as Ce,z as Z,ac as ot,ad as rt,ae as Pe,af as nt,b as D,ag as at,O as it,ah as lt,R as ct,J as Re,ai as dt,aj as pt,ak as Te,al as Ee,am as De,an as Be,ao as Ue,ap as N,aq as Oe,ar as _e,as as Fe,at as ht}from"./index-
|
|
1
|
+
import{g as We,Y as Ge,n as P,Q as v,Z as Q,j as e,$ as ke,r as x,P as E,t as _,a0 as ue,a1 as be,q as C,a2 as se,a3 as He,E as M,M as K,a4 as qe,m as A,T as Ve,a5 as Ye,B,D as Qe,C as ve,x as Ke,K as Se,a6 as Je,a7 as Ze,a8 as Xe,u as I,f as et,a9 as W,v as te,F as tt,aa as oe,A as je,w as re,ab as st,W as ne,i as J,y as Ce,z as Z,ac as ot,ad as rt,ae as Pe,af as nt,b as D,ag as at,O as it,ah as lt,R as ct,J as Re,ai as dt,aj as pt,ak as Te,al as Ee,am as De,an as Be,ao as Ue,ap as N,aq as Oe,ar as _e,as as Fe,at as ht}from"./index-D8jEuOKc.js";import{P as H,L as mt,A as ut,S as Ae,a as Le}from"./index-D8MQ9ZVB.js";import{A as ft,D as ae,u as xt,W as gt,P as wt,L as $e,d as Ne,a as Me}from"./wait-container-BbsYBUX1.js";import{_ as fe}from"./useLocalStorage-VUDmm0Mk.js";import{d as yt}from"./Launch-DawysiT2.js";import{d as kt}from"./DeleteOutline-D5ZTK7Ka.js";import{g as bt,i as vt}from"./spaces-UaG0_4_u.js";import{T as St}from"./TextField-CRqdsKdk.js";import{i as xe}from"./isEqual-Bqorz6b9.js";import{d as jt}from"./MoreVert-DSqbsAYy.js";import{E as Ct}from"./index-DK-C26MA.js";import"./url-join-gOj2D4JC.js";import"./Skeleton-DkInRABR.js";import"./Close-Yb6PTPgZ.js";import"./lottie-C3nxmlxK.js";import"./api-DaQrSR6d.js";import"./Select-DsA6mJ7A.js";import"./InputLabel-x5fGAphs.js";var Pt=Ge;function Rt(t){return Pt(t).toLowerCase()}var Tt=Rt;const Et=We(Tt);function ie({children:t,selected:i}){return e.jsxs(Dt,{children:[t,e.jsx(v,{className:`selected-container ${i?"selected":""}`,children:e.jsx(ke,{className:"selected-icon"})})]})}const Dt=P(v)`
|
|
2
2
|
position: relative;
|
|
3
3
|
|
|
4
4
|
.selected-container {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bP as ve,bQ as me,bK as X,bL as je,bX as He,bM as p,r as d,bR as Se,bO as ae,bT as L,j as u,bU as ge,cX as st,cY as Oe,cZ as Ae,c_ as Xe,bS as se,ai as at,c$ as fe,d0 as it,s as ct,d1 as F,P as z}from"./index-C87i5P5O.js";import{K as dt,a as ut}from"./Delete-I9FOITt6.js";let Y;function _e(){if(Y)return Y;const e=document.createElement("div"),t=document.createElement("div");return t.style.width="10px",t.style.height="1px",e.appendChild(t),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),Y="reverse",e.scrollLeft>0?Y="default":(e.scrollLeft=1,e.scrollLeft===0&&(Y="negative")),document.body.removeChild(e),Y}function bt(e,t){const l=e.scrollLeft;if(t!=="rtl")return l;switch(_e()){case"negative":return e.scrollWidth-e.clientWidth+l;case"reverse":return e.scrollWidth-e.clientWidth-l;default:return l}}function pt(e){return me("MuiTab",e)}const N=ve("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),ft=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],ht=e=>{const{classes:t,textColor:l,fullWidth:s,wrapped:n,icon:a,label:v,selected:h,disabled:b}=e,g={root:["root",a&&v&&"labelIcon",`textColor${He(l)}`,s&&"fullWidth",n&&"wrapped",h&&"selected",b&&"disabled"],iconWrapper:["iconWrapper"]};return ge(g,pt,t)},vt=X(je,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.label&&l.icon&&t.labelIcon,t[`textColor${He(l.textColor)}`],l.fullWidth&&t.fullWidth,l.wrapped&&t.wrapped,{[`& .${N.iconWrapper}`]:t.iconWrapper}]}})(({theme:e,ownerState:t})=>p({},e.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},t.label&&{flexDirection:t.iconPosition==="top"||t.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},t.icon&&t.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${N.iconWrapper}`]:p({},t.iconPosition==="top"&&{marginBottom:6},t.iconPosition==="bottom"&&{marginTop:6},t.iconPosition==="start"&&{marginRight:e.spacing(1)},t.iconPosition==="end"&&{marginLeft:e.spacing(1)})},t.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${N.selected}`]:{opacity:1},[`&.${N.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.textColor==="primary"&&{color:(e.vars||e).palette.text.secondary,[`&.${N.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${N.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.textColor==="secondary"&&{color:(e.vars||e).palette.text.secondary,[`&.${N.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${N.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},t.wrapped&&{fontSize:e.typography.pxToRem(12)})),xe=d.forwardRef(function(t,l){const s=Se({props:t,name:"MuiTab"}),{className:n,disabled:a=!1,disableFocusRipple:v=!1,fullWidth:h,icon:b,iconPosition:g="top",indicator:B,label:y,onChange:m,onClick:w,onFocus:$,selected:T,selectionFollowsFocus:x,textColor:_="inherit",value:I,wrapped:ie=!1}=s,D=ae(s,ft),V=p({},s,{disabled:a,disableFocusRipple:v,selected:T,icon:!!b,iconPosition:g,label:!!y,fullWidth:h,textColor:_,wrapped:ie}),q=ht(V),j=b&&y&&d.isValidElement(b)?d.cloneElement(b,{className:L(q.iconWrapper,b.props.className)}):b,ee=E=>{!T&&m&&m(E,I),w&&w(E)},U=E=>{x&&!T&&m&&m(E,I),$&&$(E)};return u.jsxs(vt,p({focusRipple:!v,className:L(q.root,n),ref:l,role:"tab","aria-selected":T,disabled:a,onClick:ee,onFocus:U,ownerState:V,tabIndex:T?0:-1},D,{children:[g==="top"||g==="start"?u.jsxs(d.Fragment,{children:[j,y]}):u.jsxs(d.Fragment,{children:[y,j]}),B]}))});function mt(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function St(e,t,l,s={},n=()=>{}){const{ease:a=mt,duration:v=300}=s;let h=null;const b=t[e];let g=!1;const B=()=>{g=!0},y=m=>{if(g){n(new Error("Animation cancelled"));return}h===null&&(h=m);const w=Math.min(1,(m-h)/v);if(t[e]=a(w)*(l-b)+b,w>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(y)};return b===l?(n(new Error("Element already at target position")),B):(requestAnimationFrame(y),B)}const gt=["onChange"],xt={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function yt(e){const{onChange:t}=e,l=ae(e,gt),s=d.useRef(),n=d.useRef(null),a=()=>{s.current=n.current.offsetHeight-n.current.clientHeight};return st(()=>{const v=Oe(()=>{const b=s.current;a(),b!==s.current&&t(s.current)}),h=Ae(n.current);return h.addEventListener("resize",v),()=>{v.clear(),h.removeEventListener("resize",v)}},[t]),d.useEffect(()=>{a(),t(s.current)},[t]),u.jsx("div",p({style:xt,ref:n},l))}function Ct(e){return me("MuiTabScrollButton",e)}const Bt=ve("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),wt=["className","slots","slotProps","direction","orientation","disabled"],Tt=e=>{const{classes:t,orientation:l,disabled:s}=e;return ge({root:["root",l,s&&"disabled"]},Ct,t)},Mt=X(je,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.orientation&&t[l.orientation]]}})(({ownerState:e})=>p({width:40,flexShrink:0,opacity:.8,[`&.${Bt.disabled}`]:{opacity:0}},e.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${e.isRtl?-90:90}deg)`}})),Rt=d.forwardRef(function(t,l){var s,n;const a=Se({props:t,name:"MuiTabScrollButton"}),{className:v,slots:h={},slotProps:b={},direction:g}=a,B=ae(a,wt),y=Xe(),m=p({isRtl:y},a),w=Tt(m),$=(s=h.StartScrollButtonIcon)!=null?s:dt,T=(n=h.EndScrollButtonIcon)!=null?n:ut,x=se({elementType:$,externalSlotProps:b.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m}),_=se({elementType:T,externalSlotProps:b.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m});return u.jsx(Mt,p({component:"div",className:L(w.root,v),ref:l,role:null,ownerState:m,tabIndex:null},B,{children:g==="left"?u.jsx($,p({},x)):u.jsx(T,p({},_))}))});function It(e){return me("MuiTabs",e)}const he=ve("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Et=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Ne=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,Le=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,ne=(e,t,l)=>{let s=!1,n=l(e,t);for(;n;){if(n===e.firstChild){if(s)return;s=!0}const a=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||a)n=l(e,n);else{n.focus();return}}},Wt=e=>{const{vertical:t,fixed:l,hideScrollbar:s,scrollableX:n,scrollableY:a,centered:v,scrollButtonsHideMobile:h,classes:b}=e;return ge({root:["root",t&&"vertical"],scroller:["scroller",l&&"fixed",s&&"hideScrollbar",n&&"scrollableX",a&&"scrollableY"],flexContainer:["flexContainer",t&&"flexContainerVertical",v&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",h&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[s&&"hideScrollbar"]},It,b)},zt=X("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${he.scrollButtons}`]:t.scrollButtons},{[`& .${he.scrollButtons}`]:l.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,l.vertical&&t.vertical]}})(({ownerState:e,theme:t})=>p({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},e.vertical&&{flexDirection:"column"},e.scrollButtonsHideMobile&&{[`& .${he.scrollButtons}`]:{[t.breakpoints.down("sm")]:{display:"none"}}})),Pt=X("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.scroller,l.fixed&&t.fixed,l.hideScrollbar&&t.hideScrollbar,l.scrollableX&&t.scrollableX,l.scrollableY&&t.scrollableY]}})(({ownerState:e})=>p({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},e.fixed&&{overflowX:"hidden",width:"100%"},e.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},e.scrollableX&&{overflowX:"auto",overflowY:"hidden"},e.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),kt=X("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.flexContainer,l.vertical&&t.flexContainerVertical,l.centered&&t.centered]}})(({ownerState:e})=>p({display:"flex"},e.vertical&&{flexDirection:"column"},e.centered&&{justifyContent:"center"})),Nt=X("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})(({ownerState:e,theme:t})=>p({position:"absolute",height:2,bottom:0,width:"100%",transition:t.transitions.create()},e.indicatorColor==="primary"&&{backgroundColor:(t.vars||t).palette.primary.main},e.indicatorColor==="secondary"&&{backgroundColor:(t.vars||t).palette.secondary.main},e.vertical&&{height:"100%",width:2,right:0})),Lt=X(yt)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Fe={},ye=d.forwardRef(function(t,l){const s=Se({props:t,name:"MuiTabs"}),n=at(),a=Xe(),{"aria-label":v,"aria-labelledby":h,action:b,centered:g=!1,children:B,className:y,component:m="div",allowScrollButtonsMobile:w=!1,indicatorColor:$="primary",onChange:T,orientation:x="horizontal",ScrollButtonComponent:_=Rt,scrollButtons:I="auto",selectionFollowsFocus:ie,slots:D={},slotProps:V={},TabIndicatorProps:q={},TabScrollButtonProps:j={},textColor:ee="primary",value:U,variant:E="standard",visibleScrollbar:ce=!1}=s,Ue=ae(s,Et),M=E==="scrollable",C=x==="vertical",G=C?"scrollTop":"scrollLeft",te=C?"top":"left",oe=C?"bottom":"right",de=C?"clientHeight":"clientWidth",Q=C?"height":"width",H=p({},s,{component:m,allowScrollButtonsMobile:w,indicatorColor:$,orientation:x,vertical:C,scrollButtons:I,textColor:ee,variant:E,visibleScrollbar:ce,fixed:!M,hideScrollbar:M&&!ce,scrollableX:M&&!C,scrollableY:M&&C,centered:g&&!M,scrollButtonsHideMobile:!w}),P=Wt(H),Ye=se({elementType:D.StartScrollButtonIcon,externalSlotProps:V.startScrollButtonIcon,ownerState:H}),Ke=se({elementType:D.EndScrollButtonIcon,externalSlotProps:V.endScrollButtonIcon,ownerState:H}),[Ce,Ve]=d.useState(!1),[O,Be]=d.useState(Fe),[we,Ge]=d.useState(!1),[Te,Qe]=d.useState(!1),[Me,Ze]=d.useState(!1),[Re,Je]=d.useState({overflow:"hidden",scrollbarWidth:0}),Ie=new Map,W=d.useRef(null),A=d.useRef(null),Ee=()=>{const o=W.current;let r;if(o){const i=o.getBoundingClientRect();r={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:bt(o,a?"rtl":"ltr"),scrollWidth:o.scrollWidth,top:i.top,bottom:i.bottom,left:i.left,right:i.right}}let c;if(o&&U!==!1){const i=A.current.children;if(i.length>0){const f=i[Ie.get(U)];c=f?f.getBoundingClientRect():null}}return{tabsMeta:r,tabMeta:c}},Z=fe(()=>{const{tabsMeta:o,tabMeta:r}=Ee();let c=0,i;if(C)i="top",r&&o&&(c=r.top-o.top+o.scrollTop);else if(i=a?"right":"left",r&&o){const S=a?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;c=(a?-1:1)*(r[i]-o[i]+S)}const f={[i]:c,[Q]:r?r[Q]:0};if(isNaN(O[i])||isNaN(O[Q]))Be(f);else{const S=Math.abs(O[i]-f[i]),R=Math.abs(O[Q]-f[Q]);(S>=1||R>=1)&&Be(f)}}),ue=(o,{animation:r=!0}={})=>{r?St(G,W.current,o,{duration:n.transitions.duration.standard}):W.current[G]=o},We=o=>{let r=W.current[G];C?r+=o:(r+=o*(a?-1:1),r*=a&&_e()==="reverse"?-1:1),ue(r)},ze=()=>{const o=W.current[de];let r=0;const c=Array.from(A.current.children);for(let i=0;i<c.length;i+=1){const f=c[i];if(r+f[de]>o){i===0&&(r=o);break}r+=f[de]}return r},et=()=>{We(-1*ze())},tt=()=>{We(ze())},ot=d.useCallback(o=>{Je({overflow:null,scrollbarWidth:o})},[]),lt=()=>{const o={};o.scrollbarSizeListener=M?u.jsx(Lt,{onChange:ot,className:L(P.scrollableX,P.hideScrollbar)}):null;const c=M&&(I==="auto"&&(we||Te)||I===!0);return o.scrollButtonStart=c?u.jsx(_,p({slots:{StartScrollButtonIcon:D.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Ye},orientation:x,direction:a?"right":"left",onClick:et,disabled:!we},j,{className:L(P.scrollButtons,j.className)})):null,o.scrollButtonEnd=c?u.jsx(_,p({slots:{EndScrollButtonIcon:D.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Ke},orientation:x,direction:a?"left":"right",onClick:tt,disabled:!Te},j,{className:L(P.scrollButtons,j.className)})):null,o},Pe=fe(o=>{const{tabsMeta:r,tabMeta:c}=Ee();if(!(!c||!r)){if(c[te]<r[te]){const i=r[G]+(c[te]-r[te]);ue(i,{animation:o})}else if(c[oe]>r[oe]){const i=r[G]+(c[oe]-r[oe]);ue(i,{animation:o})}}}),le=fe(()=>{M&&I!==!1&&Ze(!Me)});d.useEffect(()=>{const o=Oe(()=>{W.current&&Z()});let r;const c=S=>{S.forEach(R=>{R.removedNodes.forEach(J=>{var k;(k=r)==null||k.unobserve(J)}),R.addedNodes.forEach(J=>{var k;(k=r)==null||k.observe(J)})}),o(),le()},i=Ae(W.current);i.addEventListener("resize",o);let f;return typeof ResizeObserver<"u"&&(r=new ResizeObserver(o),Array.from(A.current.children).forEach(S=>{r.observe(S)})),typeof MutationObserver<"u"&&(f=new MutationObserver(c),f.observe(A.current,{childList:!0})),()=>{var S,R;o.clear(),i.removeEventListener("resize",o),(S=f)==null||S.disconnect(),(R=r)==null||R.disconnect()}},[Z,le]),d.useEffect(()=>{const o=Array.from(A.current.children),r=o.length;if(typeof IntersectionObserver<"u"&&r>0&&M&&I!==!1){const c=o[0],i=o[r-1],f={root:W.current,threshold:.99},S=pe=>{Ge(!pe[0].isIntersecting)},R=new IntersectionObserver(S,f);R.observe(c);const J=pe=>{Qe(!pe[0].isIntersecting)},k=new IntersectionObserver(J,f);return k.observe(i),()=>{R.disconnect(),k.disconnect()}}},[M,I,Me,B==null?void 0:B.length]),d.useEffect(()=>{Ve(!0)},[]),d.useEffect(()=>{Z()}),d.useEffect(()=>{Pe(Fe!==O)},[Pe,O]),d.useImperativeHandle(b,()=>({updateIndicator:Z,updateScrollButtons:le}),[Z,le]);const ke=u.jsx(Nt,p({},q,{className:L(P.indicator,q.className),ownerState:H,style:p({},O,q.style)}));let re=0;const rt=d.Children.map(B,o=>{if(!d.isValidElement(o))return null;const r=o.props.value===void 0?re:o.props.value;Ie.set(r,re);const c=r===U;return re+=1,d.cloneElement(o,p({fullWidth:E==="fullWidth",indicator:c&&!Ce&&ke,selected:c,selectionFollowsFocus:ie,onChange:T,textColor:ee,value:r},re===1&&U===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),nt=o=>{const r=A.current,c=it(r).activeElement;if(c.getAttribute("role")!=="tab")return;let f=x==="horizontal"?"ArrowLeft":"ArrowUp",S=x==="horizontal"?"ArrowRight":"ArrowDown";switch(x==="horizontal"&&a&&(f="ArrowRight",S="ArrowLeft"),o.key){case f:o.preventDefault(),ne(r,c,Le);break;case S:o.preventDefault(),ne(r,c,Ne);break;case"Home":o.preventDefault(),ne(r,null,Ne);break;case"End":o.preventDefault(),ne(r,null,Le);break}},be=lt();return u.jsxs(zt,p({className:L(P.root,y),ownerState:H,ref:l,as:m},Ue,{children:[be.scrollButtonStart,be.scrollbarSizeListener,u.jsxs(Pt,{className:P.scroller,ownerState:H,style:{overflow:Re.overflow,[C?`margin${a?"Left":"Right"}`:"marginBottom"]:ce?void 0:-Re.scrollbarWidth},ref:W,children:[u.jsx(kt,{"aria-label":v,"aria-labelledby":h,"aria-orientation":x==="vertical"?"vertical":null,className:P.flexContainer,ownerState:H,onKeyDown:nt,ref:A,role:"tablist",children:rt}),Ce&&ke]}),be.scrollButtonEnd]}))}),$e="index",K={tabs:`${$e}-tabs`,tab:`${$e}-tab`},Ft=ct(ye)(({theme:e})=>({[`& .${K.tabs}`]:{},[`& .${K.tab}`]:{fontSize:"0.875rem",[e.breakpoints.up("md")]:{fontSize:"1rem"}}}));function De({tabs:e,current:t,onChange:l,...s}){return u.jsx(ye,{scrollButtons:"auto",value:t,onChange:(n,a)=>l(a),...s,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:F.backgroundsBgComponent,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:F.foregroundsFgSubtile,fontSize:"13px",fontWeight:"normal",textTransform:"capitalize",transition:"background-color 0.2s ease","&.Mui-selected, &:hover":{backgroundColor:"white",borderColor:F.lineBorderBase,color:F.foregroundsFgBase}},".MuiTabs-indicator":{display:"none"},...s.sx},children:e.map(n=>u.jsx(xe,{className:K.tab,value:n.value,label:n.label,icon:n.icon||null},n.value))})}De.propTypes={tabs:z.array.isRequired,current:z.string.isRequired,onChange:z.func.isRequired};function qe({tabs:e,current:t,onChange:l,...s}){return u.jsx(ye,{scrollButtons:"auto",value:t,onChange:(n,a)=>l(a),...s,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":{"&::after":{content:'""',display:"block",width:"100%",height:"1px",backgroundColor:F.strokeBorderStrong,bottom:0}},".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:F.foregroundsFgSubtile,fontSize:"14px",fontWeight:500,textTransform:"capitalize",minWidth:"auto","&.Mui-selected, &:hover":{color:F.foregroundsFgBase}},".MuiTabs-indicator":{height:"1px",backgroundColor:F.foregroundsFgBase},...s.sx},children:e.map(n=>u.jsx(xe,{className:K.tab,value:n.value,label:n.label,icon:n.icon||null},n.value))})}qe.propTypes={tabs:z.array.isRequired,current:z.string.isRequired,onChange:z.func.isRequired};function $t({tabs:e,current:t,onChange:l,...s}){return s.variant==="card"?u.jsx(De,{...s,tabs:e,current:t,onChange:l}):s.variant==="line"?u.jsx(qe,{...s,tabs:e,current:t,onChange:l}):u.jsx(Ft,{scrollButtons:"auto",variant:"scrollable",value:t,onChange:(n,a)=>l(a),indicatorColor:"primary",...s,className:[K.tabs,s.className||""].join(" "),children:e.map(n=>u.jsx(xe,{className:K.tab,value:n.value,label:n.label,icon:n.icon||null},n.value))})}$t.propTypes={tabs:z.array.isRequired,current:z.string.isRequired,onChange:z.func.isRequired};export{$t as T,ye as a,xe as b,_e as d,bt as g};
|
|
1
|
+
import{bP as ve,bQ as me,bK as X,bL as je,bX as He,bM as p,r as d,bR as Se,bO as ae,bT as L,j as u,bU as ge,cX as st,cY as Oe,cZ as Ae,c_ as Xe,bS as se,ai as at,c$ as fe,d0 as it,s as ct,d1 as F,P as z}from"./index-D8jEuOKc.js";import{K as dt,a as ut}from"./Delete-DUmhYiAq.js";let Y;function _e(){if(Y)return Y;const e=document.createElement("div"),t=document.createElement("div");return t.style.width="10px",t.style.height="1px",e.appendChild(t),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),Y="reverse",e.scrollLeft>0?Y="default":(e.scrollLeft=1,e.scrollLeft===0&&(Y="negative")),document.body.removeChild(e),Y}function bt(e,t){const l=e.scrollLeft;if(t!=="rtl")return l;switch(_e()){case"negative":return e.scrollWidth-e.clientWidth+l;case"reverse":return e.scrollWidth-e.clientWidth-l;default:return l}}function pt(e){return me("MuiTab",e)}const N=ve("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),ft=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],ht=e=>{const{classes:t,textColor:l,fullWidth:s,wrapped:n,icon:a,label:v,selected:h,disabled:b}=e,g={root:["root",a&&v&&"labelIcon",`textColor${He(l)}`,s&&"fullWidth",n&&"wrapped",h&&"selected",b&&"disabled"],iconWrapper:["iconWrapper"]};return ge(g,pt,t)},vt=X(je,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.label&&l.icon&&t.labelIcon,t[`textColor${He(l.textColor)}`],l.fullWidth&&t.fullWidth,l.wrapped&&t.wrapped,{[`& .${N.iconWrapper}`]:t.iconWrapper}]}})(({theme:e,ownerState:t})=>p({},e.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},t.label&&{flexDirection:t.iconPosition==="top"||t.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},t.icon&&t.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${N.iconWrapper}`]:p({},t.iconPosition==="top"&&{marginBottom:6},t.iconPosition==="bottom"&&{marginTop:6},t.iconPosition==="start"&&{marginRight:e.spacing(1)},t.iconPosition==="end"&&{marginLeft:e.spacing(1)})},t.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${N.selected}`]:{opacity:1},[`&.${N.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.textColor==="primary"&&{color:(e.vars||e).palette.text.secondary,[`&.${N.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${N.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.textColor==="secondary"&&{color:(e.vars||e).palette.text.secondary,[`&.${N.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${N.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},t.wrapped&&{fontSize:e.typography.pxToRem(12)})),xe=d.forwardRef(function(t,l){const s=Se({props:t,name:"MuiTab"}),{className:n,disabled:a=!1,disableFocusRipple:v=!1,fullWidth:h,icon:b,iconPosition:g="top",indicator:B,label:y,onChange:m,onClick:w,onFocus:$,selected:T,selectionFollowsFocus:x,textColor:_="inherit",value:I,wrapped:ie=!1}=s,D=ae(s,ft),V=p({},s,{disabled:a,disableFocusRipple:v,selected:T,icon:!!b,iconPosition:g,label:!!y,fullWidth:h,textColor:_,wrapped:ie}),q=ht(V),j=b&&y&&d.isValidElement(b)?d.cloneElement(b,{className:L(q.iconWrapper,b.props.className)}):b,ee=E=>{!T&&m&&m(E,I),w&&w(E)},U=E=>{x&&!T&&m&&m(E,I),$&&$(E)};return u.jsxs(vt,p({focusRipple:!v,className:L(q.root,n),ref:l,role:"tab","aria-selected":T,disabled:a,onClick:ee,onFocus:U,ownerState:V,tabIndex:T?0:-1},D,{children:[g==="top"||g==="start"?u.jsxs(d.Fragment,{children:[j,y]}):u.jsxs(d.Fragment,{children:[y,j]}),B]}))});function mt(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function St(e,t,l,s={},n=()=>{}){const{ease:a=mt,duration:v=300}=s;let h=null;const b=t[e];let g=!1;const B=()=>{g=!0},y=m=>{if(g){n(new Error("Animation cancelled"));return}h===null&&(h=m);const w=Math.min(1,(m-h)/v);if(t[e]=a(w)*(l-b)+b,w>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(y)};return b===l?(n(new Error("Element already at target position")),B):(requestAnimationFrame(y),B)}const gt=["onChange"],xt={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function yt(e){const{onChange:t}=e,l=ae(e,gt),s=d.useRef(),n=d.useRef(null),a=()=>{s.current=n.current.offsetHeight-n.current.clientHeight};return st(()=>{const v=Oe(()=>{const b=s.current;a(),b!==s.current&&t(s.current)}),h=Ae(n.current);return h.addEventListener("resize",v),()=>{v.clear(),h.removeEventListener("resize",v)}},[t]),d.useEffect(()=>{a(),t(s.current)},[t]),u.jsx("div",p({style:xt,ref:n},l))}function Ct(e){return me("MuiTabScrollButton",e)}const Bt=ve("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),wt=["className","slots","slotProps","direction","orientation","disabled"],Tt=e=>{const{classes:t,orientation:l,disabled:s}=e;return ge({root:["root",l,s&&"disabled"]},Ct,t)},Mt=X(je,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.orientation&&t[l.orientation]]}})(({ownerState:e})=>p({width:40,flexShrink:0,opacity:.8,[`&.${Bt.disabled}`]:{opacity:0}},e.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${e.isRtl?-90:90}deg)`}})),Rt=d.forwardRef(function(t,l){var s,n;const a=Se({props:t,name:"MuiTabScrollButton"}),{className:v,slots:h={},slotProps:b={},direction:g}=a,B=ae(a,wt),y=Xe(),m=p({isRtl:y},a),w=Tt(m),$=(s=h.StartScrollButtonIcon)!=null?s:dt,T=(n=h.EndScrollButtonIcon)!=null?n:ut,x=se({elementType:$,externalSlotProps:b.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m}),_=se({elementType:T,externalSlotProps:b.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m});return u.jsx(Mt,p({component:"div",className:L(w.root,v),ref:l,role:null,ownerState:m,tabIndex:null},B,{children:g==="left"?u.jsx($,p({},x)):u.jsx(T,p({},_))}))});function It(e){return me("MuiTabs",e)}const he=ve("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Et=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Ne=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,Le=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,ne=(e,t,l)=>{let s=!1,n=l(e,t);for(;n;){if(n===e.firstChild){if(s)return;s=!0}const a=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||a)n=l(e,n);else{n.focus();return}}},Wt=e=>{const{vertical:t,fixed:l,hideScrollbar:s,scrollableX:n,scrollableY:a,centered:v,scrollButtonsHideMobile:h,classes:b}=e;return ge({root:["root",t&&"vertical"],scroller:["scroller",l&&"fixed",s&&"hideScrollbar",n&&"scrollableX",a&&"scrollableY"],flexContainer:["flexContainer",t&&"flexContainerVertical",v&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",h&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[s&&"hideScrollbar"]},It,b)},zt=X("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${he.scrollButtons}`]:t.scrollButtons},{[`& .${he.scrollButtons}`]:l.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,l.vertical&&t.vertical]}})(({ownerState:e,theme:t})=>p({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},e.vertical&&{flexDirection:"column"},e.scrollButtonsHideMobile&&{[`& .${he.scrollButtons}`]:{[t.breakpoints.down("sm")]:{display:"none"}}})),Pt=X("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.scroller,l.fixed&&t.fixed,l.hideScrollbar&&t.hideScrollbar,l.scrollableX&&t.scrollableX,l.scrollableY&&t.scrollableY]}})(({ownerState:e})=>p({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},e.fixed&&{overflowX:"hidden",width:"100%"},e.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},e.scrollableX&&{overflowX:"auto",overflowY:"hidden"},e.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),kt=X("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.flexContainer,l.vertical&&t.flexContainerVertical,l.centered&&t.centered]}})(({ownerState:e})=>p({display:"flex"},e.vertical&&{flexDirection:"column"},e.centered&&{justifyContent:"center"})),Nt=X("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})(({ownerState:e,theme:t})=>p({position:"absolute",height:2,bottom:0,width:"100%",transition:t.transitions.create()},e.indicatorColor==="primary"&&{backgroundColor:(t.vars||t).palette.primary.main},e.indicatorColor==="secondary"&&{backgroundColor:(t.vars||t).palette.secondary.main},e.vertical&&{height:"100%",width:2,right:0})),Lt=X(yt)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Fe={},ye=d.forwardRef(function(t,l){const s=Se({props:t,name:"MuiTabs"}),n=at(),a=Xe(),{"aria-label":v,"aria-labelledby":h,action:b,centered:g=!1,children:B,className:y,component:m="div",allowScrollButtonsMobile:w=!1,indicatorColor:$="primary",onChange:T,orientation:x="horizontal",ScrollButtonComponent:_=Rt,scrollButtons:I="auto",selectionFollowsFocus:ie,slots:D={},slotProps:V={},TabIndicatorProps:q={},TabScrollButtonProps:j={},textColor:ee="primary",value:U,variant:E="standard",visibleScrollbar:ce=!1}=s,Ue=ae(s,Et),M=E==="scrollable",C=x==="vertical",G=C?"scrollTop":"scrollLeft",te=C?"top":"left",oe=C?"bottom":"right",de=C?"clientHeight":"clientWidth",Q=C?"height":"width",H=p({},s,{component:m,allowScrollButtonsMobile:w,indicatorColor:$,orientation:x,vertical:C,scrollButtons:I,textColor:ee,variant:E,visibleScrollbar:ce,fixed:!M,hideScrollbar:M&&!ce,scrollableX:M&&!C,scrollableY:M&&C,centered:g&&!M,scrollButtonsHideMobile:!w}),P=Wt(H),Ye=se({elementType:D.StartScrollButtonIcon,externalSlotProps:V.startScrollButtonIcon,ownerState:H}),Ke=se({elementType:D.EndScrollButtonIcon,externalSlotProps:V.endScrollButtonIcon,ownerState:H}),[Ce,Ve]=d.useState(!1),[O,Be]=d.useState(Fe),[we,Ge]=d.useState(!1),[Te,Qe]=d.useState(!1),[Me,Ze]=d.useState(!1),[Re,Je]=d.useState({overflow:"hidden",scrollbarWidth:0}),Ie=new Map,W=d.useRef(null),A=d.useRef(null),Ee=()=>{const o=W.current;let r;if(o){const i=o.getBoundingClientRect();r={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:bt(o,a?"rtl":"ltr"),scrollWidth:o.scrollWidth,top:i.top,bottom:i.bottom,left:i.left,right:i.right}}let c;if(o&&U!==!1){const i=A.current.children;if(i.length>0){const f=i[Ie.get(U)];c=f?f.getBoundingClientRect():null}}return{tabsMeta:r,tabMeta:c}},Z=fe(()=>{const{tabsMeta:o,tabMeta:r}=Ee();let c=0,i;if(C)i="top",r&&o&&(c=r.top-o.top+o.scrollTop);else if(i=a?"right":"left",r&&o){const S=a?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;c=(a?-1:1)*(r[i]-o[i]+S)}const f={[i]:c,[Q]:r?r[Q]:0};if(isNaN(O[i])||isNaN(O[Q]))Be(f);else{const S=Math.abs(O[i]-f[i]),R=Math.abs(O[Q]-f[Q]);(S>=1||R>=1)&&Be(f)}}),ue=(o,{animation:r=!0}={})=>{r?St(G,W.current,o,{duration:n.transitions.duration.standard}):W.current[G]=o},We=o=>{let r=W.current[G];C?r+=o:(r+=o*(a?-1:1),r*=a&&_e()==="reverse"?-1:1),ue(r)},ze=()=>{const o=W.current[de];let r=0;const c=Array.from(A.current.children);for(let i=0;i<c.length;i+=1){const f=c[i];if(r+f[de]>o){i===0&&(r=o);break}r+=f[de]}return r},et=()=>{We(-1*ze())},tt=()=>{We(ze())},ot=d.useCallback(o=>{Je({overflow:null,scrollbarWidth:o})},[]),lt=()=>{const o={};o.scrollbarSizeListener=M?u.jsx(Lt,{onChange:ot,className:L(P.scrollableX,P.hideScrollbar)}):null;const c=M&&(I==="auto"&&(we||Te)||I===!0);return o.scrollButtonStart=c?u.jsx(_,p({slots:{StartScrollButtonIcon:D.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Ye},orientation:x,direction:a?"right":"left",onClick:et,disabled:!we},j,{className:L(P.scrollButtons,j.className)})):null,o.scrollButtonEnd=c?u.jsx(_,p({slots:{EndScrollButtonIcon:D.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Ke},orientation:x,direction:a?"left":"right",onClick:tt,disabled:!Te},j,{className:L(P.scrollButtons,j.className)})):null,o},Pe=fe(o=>{const{tabsMeta:r,tabMeta:c}=Ee();if(!(!c||!r)){if(c[te]<r[te]){const i=r[G]+(c[te]-r[te]);ue(i,{animation:o})}else if(c[oe]>r[oe]){const i=r[G]+(c[oe]-r[oe]);ue(i,{animation:o})}}}),le=fe(()=>{M&&I!==!1&&Ze(!Me)});d.useEffect(()=>{const o=Oe(()=>{W.current&&Z()});let r;const c=S=>{S.forEach(R=>{R.removedNodes.forEach(J=>{var k;(k=r)==null||k.unobserve(J)}),R.addedNodes.forEach(J=>{var k;(k=r)==null||k.observe(J)})}),o(),le()},i=Ae(W.current);i.addEventListener("resize",o);let f;return typeof ResizeObserver<"u"&&(r=new ResizeObserver(o),Array.from(A.current.children).forEach(S=>{r.observe(S)})),typeof MutationObserver<"u"&&(f=new MutationObserver(c),f.observe(A.current,{childList:!0})),()=>{var S,R;o.clear(),i.removeEventListener("resize",o),(S=f)==null||S.disconnect(),(R=r)==null||R.disconnect()}},[Z,le]),d.useEffect(()=>{const o=Array.from(A.current.children),r=o.length;if(typeof IntersectionObserver<"u"&&r>0&&M&&I!==!1){const c=o[0],i=o[r-1],f={root:W.current,threshold:.99},S=pe=>{Ge(!pe[0].isIntersecting)},R=new IntersectionObserver(S,f);R.observe(c);const J=pe=>{Qe(!pe[0].isIntersecting)},k=new IntersectionObserver(J,f);return k.observe(i),()=>{R.disconnect(),k.disconnect()}}},[M,I,Me,B==null?void 0:B.length]),d.useEffect(()=>{Ve(!0)},[]),d.useEffect(()=>{Z()}),d.useEffect(()=>{Pe(Fe!==O)},[Pe,O]),d.useImperativeHandle(b,()=>({updateIndicator:Z,updateScrollButtons:le}),[Z,le]);const ke=u.jsx(Nt,p({},q,{className:L(P.indicator,q.className),ownerState:H,style:p({},O,q.style)}));let re=0;const rt=d.Children.map(B,o=>{if(!d.isValidElement(o))return null;const r=o.props.value===void 0?re:o.props.value;Ie.set(r,re);const c=r===U;return re+=1,d.cloneElement(o,p({fullWidth:E==="fullWidth",indicator:c&&!Ce&&ke,selected:c,selectionFollowsFocus:ie,onChange:T,textColor:ee,value:r},re===1&&U===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),nt=o=>{const r=A.current,c=it(r).activeElement;if(c.getAttribute("role")!=="tab")return;let f=x==="horizontal"?"ArrowLeft":"ArrowUp",S=x==="horizontal"?"ArrowRight":"ArrowDown";switch(x==="horizontal"&&a&&(f="ArrowRight",S="ArrowLeft"),o.key){case f:o.preventDefault(),ne(r,c,Le);break;case S:o.preventDefault(),ne(r,c,Ne);break;case"Home":o.preventDefault(),ne(r,null,Ne);break;case"End":o.preventDefault(),ne(r,null,Le);break}},be=lt();return u.jsxs(zt,p({className:L(P.root,y),ownerState:H,ref:l,as:m},Ue,{children:[be.scrollButtonStart,be.scrollbarSizeListener,u.jsxs(Pt,{className:P.scroller,ownerState:H,style:{overflow:Re.overflow,[C?`margin${a?"Left":"Right"}`:"marginBottom"]:ce?void 0:-Re.scrollbarWidth},ref:W,children:[u.jsx(kt,{"aria-label":v,"aria-labelledby":h,"aria-orientation":x==="vertical"?"vertical":null,className:P.flexContainer,ownerState:H,onKeyDown:nt,ref:A,role:"tablist",children:rt}),Ce&&ke]}),be.scrollButtonEnd]}))}),$e="index",K={tabs:`${$e}-tabs`,tab:`${$e}-tab`},Ft=ct(ye)(({theme:e})=>({[`& .${K.tabs}`]:{},[`& .${K.tab}`]:{fontSize:"0.875rem",[e.breakpoints.up("md")]:{fontSize:"1rem"}}}));function De({tabs:e,current:t,onChange:l,...s}){return u.jsx(ye,{scrollButtons:"auto",value:t,onChange:(n,a)=>l(a),...s,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:F.backgroundsBgComponent,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:F.foregroundsFgSubtile,fontSize:"13px",fontWeight:"normal",textTransform:"capitalize",transition:"background-color 0.2s ease","&.Mui-selected, &:hover":{backgroundColor:"white",borderColor:F.lineBorderBase,color:F.foregroundsFgBase}},".MuiTabs-indicator":{display:"none"},...s.sx},children:e.map(n=>u.jsx(xe,{className:K.tab,value:n.value,label:n.label,icon:n.icon||null},n.value))})}De.propTypes={tabs:z.array.isRequired,current:z.string.isRequired,onChange:z.func.isRequired};function qe({tabs:e,current:t,onChange:l,...s}){return u.jsx(ye,{scrollButtons:"auto",value:t,onChange:(n,a)=>l(a),...s,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":{"&::after":{content:'""',display:"block",width:"100%",height:"1px",backgroundColor:F.strokeBorderStrong,bottom:0}},".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:F.foregroundsFgSubtile,fontSize:"14px",fontWeight:500,textTransform:"capitalize",minWidth:"auto","&.Mui-selected, &:hover":{color:F.foregroundsFgBase}},".MuiTabs-indicator":{height:"1px",backgroundColor:F.foregroundsFgBase},...s.sx},children:e.map(n=>u.jsx(xe,{className:K.tab,value:n.value,label:n.label,icon:n.icon||null},n.value))})}qe.propTypes={tabs:z.array.isRequired,current:z.string.isRequired,onChange:z.func.isRequired};function $t({tabs:e,current:t,onChange:l,...s}){return s.variant==="card"?u.jsx(De,{...s,tabs:e,current:t,onChange:l}):s.variant==="line"?u.jsx(qe,{...s,tabs:e,current:t,onChange:l}):u.jsx(Ft,{scrollButtons:"auto",variant:"scrollable",value:t,onChange:(n,a)=>l(a),indicatorColor:"primary",...s,className:[K.tabs,s.className||""].join(" "),children:e.map(n=>u.jsx(xe,{className:K.tab,value:n.value,label:n.label,icon:n.icon||null},n.value))})}$t.propTypes={tabs:z.array.isRequired,current:z.string.isRequired,onChange:z.func.isRequired};export{$t as T,ye as a,xe as b,_e as d,bt as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hh as W,r as L,hi as z,ck as R,f7 as N,hj as x,hk as P,ci as j,hl as S}from"./index-
|
|
1
|
+
import{hh as W,r as L,hi as z,ck as R,f7 as N,hj as x,hk as P,ci as j,hl as S}from"./index-D8jEuOKc.js";var V=function(r,a){return r===void 0&&(r=[]),a===void 0&&(a=[]),W(r,a)},I=function(r,a,n){var e=L.useRef(),u=L.useRef(0);V(a,e.current)||(u.current+=1),e.current=a,z(r,[u.current],n)},J=/(mac|iphone|ipod|ipad)/i.test(typeof navigator<"u"?navigator==null?void 0:navigator.platform:""),B={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pausebreak:19,capslock:20,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,leftarrow:37,uparrow:38,rightarrow:39,downarrow:40,insert:45,delete:46,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftwindowkey:91,rightwindowkey:92,meta:J?[91,93]:[91,92],selectkey:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,multiply:106,add:107,subtract:109,decimalpoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,semicolon:186,equalsign:187,comma:188,dash:189,period:190,forwardslash:191,graveaccent:192,openbracket:219,backslash:220,closebracket:221,singlequote:222},E={ctrl:function(r){return r.ctrlKey},shift:function(r){return r.shiftKey},alt:function(r){return r.altKey},meta:function(r){return r.type==="keyup"?B.meta.includes(r.keyCode):r.metaKey}};function G(r){return P(r)||j(r)}function Q(r){var a=Object.keys(E).reduce(function(n,e){return E[e](r)?n+1:n},0);return[16,17,18,91,92].includes(r.keyCode)?a:a+1}function T(r,a,n){var e,u;if(!r.key)return!1;if(j(a))return r.keyCode===a?a:!1;var o=a.split("."),s=0;try{for(var l=x(o),c=l.next();!c.done;c=l.next()){var p=c.value,y=E[p],m=B[p.toLowerCase()];(y&&y(r)||m&&m===r.keyCode)&&s++}}catch(k){e={error:k}}finally{try{c&&!c.done&&(u=l.return)&&u.call(l)}finally{if(e)throw e.error}}return n?s===o.length&&Q(r)===o.length?a:!1:s===o.length?a:!1}function U(r,a){return S(r)?r:G(r)?function(n){return T(n,r,a)}:Array.isArray(r)?function(n){return r.find(function(e){return T(n,e,a)})}:function(){return!!r}}var X=["keydown"];function Z(r,a,n){var e=n||{},u=e.events,o=u===void 0?X:u,s=e.target,l=e.exactMatch,c=l===void 0?!1:l,p=e.useCapture,y=p===void 0?!1:p,m=R(a),k=R(r);I(function(){var b,C,K,t=N(s,window);if(t){var q=function(i){var v,g=U(k.current,c),f=g(i),d=G(f)?f:i.key;if(f)return(v=m.current)===null||v===void 0?void 0:v.call(m,i,d)};try{for(var w=x(o),h=w.next();!h.done;h=w.next()){var H=h.value;(K=t==null?void 0:t.addEventListener)===null||K===void 0||K.call(t,H,q,y)}}catch(i){b={error:i}}finally{try{h&&!h.done&&(C=w.return)&&C.call(w)}finally{if(b)throw b.error}}return function(){var i,v,g;try{for(var f=x(o),d=f.next();!d.done;d=f.next()){var M=d.value;(g=t==null?void 0:t.removeEventListener)===null||g===void 0||g.call(t,M,q,y)}}catch(O){i={error:O}}finally{try{d&&!d.done&&(v=f.return)&&v.call(f)}finally{if(i)throw i.error}}}}},[o],s)}export{Z as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as R,j as o,C,aw as F,cz as T,A as b,t as W,ct as D,r,aU as _,k as d,q as x,ak as k,ad as z,y as E,av as O,z as $,bk as q,n as A}from"./index-
|
|
1
|
+
import{u as R,j as o,C,aw as F,cz as T,A as b,t as W,ct as D,r,aU as _,k as d,q as x,ak as k,ad as z,y as E,av as O,z as $,bk as q,n as A}from"./index-D8jEuOKc.js";import{I as K}from"./invitation-Cn2oy3yS.js";import"./index-CNUQDecb.js";import"./index-2il1V33n.js";import"./sdk-BqXPS3TR.js";import"./CheckCircle-C9wvczio.js";import"./wrap-locale-BYabtx-L.js";function M(v){const{api:i,session:f}=F(),{info:s}=R(),c=T(),p=b(),{t:l,locale:m}=W(),{encryptKey:P,decrypt:N}=D(),[S,w]=r.useState(!1),h=r.useMemo(()=>new URLSearchParams(c.search).get("inviteId"),[c]),a=_(async()=>{if(!h)return null;let e;const{data:n}=await i.get("/api/invitation",{params:{inviteId:h}}),t=!!d(s,"ownerNft.did")&&n.role.name==="owner";if(t){const u=new URL(window.location.href);u.pathname=x(k(),"/api/did/invite/token"),u.searchParams.set("_ek_",P),u.searchParams.set("inviteId",h);const{data:j}=await i.get(u.href);e=j}return{invitation:n,nextWorkflow:e,needReceiveNFT:t}}),L=r.useCallback(()=>{w(!0)},[]),y=r.useCallback(()=>{if(a.error)throw a.error;return a.value.invitation},[a]),g=r.useCallback(async e=>{e&&z(N(e.sessionToken));const n=new URLSearchParams(c.search);n.delete("inviteId");const t=n.toString();await f.refresh(),p(`/${t&&`?${t}`}`,{replace:!0})},[c,p,f]);if(a.loading)return o.jsx(C,{});const I=()=>{const e=new URL(window.location.href);e.pathname=x(k(),"/api/did/invite/status"),e.searchParams.set("_t_",a.value.nextWorkflow.token),e.searchParams.set("locale",m);const n=setInterval(async()=>{const{data:t}=await i.get(e.href);t.status==="succeed"&&(clearInterval(n),f.updateConnectedInfo(t),g(t))},2e3)},U=()=>{w(!1)};return o.jsxs(B,{className:"page-invite",children:[d(a,"value.needReceiveNFT")&&o.jsx(E,{action:"login",popup:!0,className:"connect",open:S,locale:m,baseUrl:s.launcher.url,checkFn:O.create({baseURL:s.launcher.url}).get,onSuccess:I,onClose:U,checkTimeout:5*60*1e3,webWalletUrl:$(s),extraParams:{nw:d(a,"value.nextWorkflow.url")},messages:{title:l("invite.transferNFTDialog.title",{name:s.name}),scan:l("invite.transferNFTDialog.scan"),confirm:l("invite.transferNFTDialog.confirm"),success:l("invite.transferNFTDialog.success")},prefix:"/.well-known/service/api/did"}),o.jsx(K,{...v,getDataFn:y,createPassportSvg:e=>q(e,s),checkFn:i.get,onLoginSuccess:g,passportColor:"default",onReceive:d(a,"value.needReceiveNFT")?L:null})]})}const B=A.div`
|
|
2
2
|
width: 100vw;
|
|
3
3
|
height: 100%;
|
|
4
4
|
min-height: 100vh;
|