@abtnode/webapp 1.16.52-beta-20250924-093428-bd3f0d8c → 1.16.52-beta-20250924-135333-541024a8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-BQ6X5ALq.js → AdapterDayjs-CWf9oxHq.js} +1 -1
- package/dist/assets/{Add-DTGe-ZCp.js → Add-DjcYLAPK.js} +1 -1
- package/dist/assets/ArrowDropDown-BPZRFQSr.js +1 -0
- package/dist/assets/{Autocomplete-COrgl8lD.js → Autocomplete-D63iQhUQ.js} +1 -1
- package/dist/assets/{Breadcrumbs-CnuJDEjA.js → Breadcrumbs-D9GaOEOE.js} +1 -1
- package/dist/assets/{ButtonGroup-NHFraP5W.js → ButtonGroup-CzJqsZx8.js} +1 -1
- package/dist/assets/{CSSTransition-C1WKDxhV.js → CSSTransition-BTfwW2gn.js} +1 -1
- package/dist/assets/{CallMerge-C7y141G5.js → CallMerge-BghSCoML.js} +1 -1
- package/dist/assets/{CardContent-CZZD5uxd.js → CardContent-B5K5vKvQ.js} +1 -1
- package/dist/assets/{ChevronLeft-BB-pXpah.js → ChevronLeft-Cbhofxy5.js} +1 -1
- package/dist/assets/{ChevronRight-DHrS44VT.js → ChevronRight-CGSMeAAR.js} +1 -1
- package/dist/assets/{Clear-x8R7nP_3.js → Clear-CfyYd-Do.js} +1 -1
- package/dist/assets/{DeleteOutline-Ck93qCLA.js → DeleteOutline-DYK84p9_.js} +1 -1
- package/dist/assets/{Done-BwdDX1O2.js → Done-BrT3sqXm.js} +1 -1
- package/dist/assets/{Edit-BgTAfG26.js → Edit-AS63Yw8b.js} +1 -1
- package/dist/assets/{ErrorOutline-DCFmKF-T.js → ErrorOutline-BhxFz1Ls.js} +1 -1
- package/dist/assets/{FilterList-CKBf2Vv9.js → FilterList-D1yaw7tY.js} +1 -1
- package/dist/assets/{Google-D7Cw8qDf.js → Google-D_UaivDs.js} +1 -1
- package/dist/assets/{HelpOutline-lBsTb1UP.js → HelpOutline-m7SXfzOy.js} +1 -1
- package/dist/assets/{Launch-3zWvKZty.js → Launch-ow9TQwxE.js} +1 -1
- package/dist/assets/{Link-DIxdmuQI.js → Link-B6iHV97M.js} +1 -1
- package/dist/assets/{ListItemButton-BQsG34ZB.js → ListItemButton-Chhp7U8F.js} +1 -1
- package/dist/assets/{ListSubheader-B7M9oqxC.js → ListSubheader-5RNRDYxp.js} +1 -1
- package/dist/assets/{LoadingButton-C77eMd86.js → LoadingButton-oNHaw4O9.js} +1 -1
- package/dist/assets/{MoreVert-VfUY7lzP.js → MoreVert-D4bCXde_.js} +1 -1
- package/dist/assets/{OpenInNew-xMrJenFO.js → OpenInNew-D1xbr9fL.js} +1 -1
- package/dist/assets/{Refresh-qp15zbM1.js → Refresh-BoV2sxAQ.js} +1 -1
- package/dist/assets/{Search-DCwzmPfi.js → Search-TSAjl9vN.js} +1 -1
- package/dist/assets/{Stepper-CLAbE0Vc.js → Stepper-uxz-9HSh.js} +1 -1
- package/dist/assets/{Switch-1ujfhKkZ.js → Switch-WcceZP-X.js} +1 -1
- package/dist/assets/{TableSearch-CsIYJ-Mc.js → TableSearch-BUnFBfBF.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-Ptog4kG8.js → ToggleButtonGroup-DAcUXe22.js} +1 -1
- package/dist/assets/{Verified-COZ1DW29.js → Verified-D7z2Lkaa.js} +1 -1
- package/dist/assets/{VerifiedUser-ErX6tKMG.js → VerifiedUser-BZNJA6qJ.js} +1 -1
- package/dist/assets/{ViewList-BhhJ-2er.js → ViewList-B3VdisuJ.js} +1 -1
- package/dist/assets/{_createAggregator-uNFm8UBS.js → _createAggregator-B0fXVl1m.js} +1 -1
- package/dist/assets/{actions-rW-FK_P1.js → actions-CLb0GGR8.js} +1 -1
- package/dist/assets/{actions-DYQCHviz.js → actions-g4FlnluU.js} +1 -1
- package/dist/assets/{agreement-DCe8UCmn.js → agreement-D0vqP7_Q.js} +1 -1
- package/dist/assets/api-C4w9OiM_.js +1 -0
- package/dist/assets/{appearance-Bvz7Ih_G.js → appearance-BWFJ57d3.js} +1 -1
- package/dist/assets/{audit-logs-Cls9UmS0.js → audit-logs-B6aSvh4S.js} +1 -1
- package/dist/assets/{base-chart-D-7ZSxC-.js → base-chart-djs2uvDg.js} +1 -1
- package/dist/assets/{blocklet-Ho3KwOsh.js → blocklet-C6bd2myO.js} +1 -1
- package/dist/assets/{chain-8eWVoTb9.js → chain-DuN8rm1R.js} +1 -1
- package/dist/assets/{click-to-copy-Dge9fppM.js → click-to-copy-Clk4tLu_.js} +1 -1
- package/dist/assets/client-D9elRtsr.js +1 -0
- package/dist/assets/cloneDeep-C8fwyhJM.js +1 -0
- package/dist/assets/{collapse-Ccf8f09m.js → collapse-B7_v6nGA.js} +1 -1
- package/dist/assets/{config-navigation-iqzME752.js → config-navigation-R1Hj7Z1G.js} +3 -3
- package/dist/assets/{connect-to-B-eSBX-W.js → connect-to-D65DGbGc.js} +1 -1
- package/dist/assets/{cssMode-K-EHU0PU.js → cssMode-Bk_oYkHg.js} +1 -1
- package/dist/assets/{delete-confirm-C2Bokk_z.js → delete-confirm-BS72K2KN.js} +1 -1
- package/dist/assets/{depsEqual-CDHvTR0w.js → depsEqual-DwyxBTdu.js} +1 -1
- package/dist/assets/{detail-CEyFeMrm.js → detail-CYAMf6mt.js} +3 -3
- package/dist/assets/{domains-CtNDqREN.js → domains-BgArlQU_.js} +1 -1
- package/dist/assets/{download-GWnxmvAC.js → download-emb_r46F.js} +1 -1
- package/dist/assets/{edit.svg-UWFKFe9C.js → edit.svg-BBItHVNp.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-B3UY0bD4.js +1 -0
- package/dist/assets/engine-CSzmMOkC.js +1 -0
- package/dist/assets/{freemarker2-DxLjeCta.js → freemarker2-FUl2pbJ2.js} +1 -1
- package/dist/assets/{get-safe-url-904a-sst.js → get-safe-url-BZPuwo0t.js} +1 -1
- package/dist/assets/getValidReactChildren-Co_911RX.js +1 -0
- package/dist/assets/{graphqlMode-D0Lcd6qY.js → graphqlMode-Dq7u6UpI.js} +2 -2
- package/dist/assets/{handlebars-CGkm6guH.js → handlebars-Bhm_4mju.js} +1 -1
- package/dist/assets/{html-Df1MBhzv.js → html-By-il--L.js} +1 -1
- package/dist/assets/{html-title-CZ5JcCBv.js → html-title-CtlwTzdI.js} +1 -1
- package/dist/assets/{htmlMode-DGZ0WwLc.js → htmlMode-ByKq5tqR.js} +1 -1
- package/dist/assets/{iframe-Brx5OwuI.js → iframe-DaM1qU5Z.js} +1 -1
- package/dist/assets/{index-B_-T0wck.js → index-4kg9HzAY.js} +1 -1
- package/dist/assets/{index-B9ffq1Aq.js → index-5WEUHjm0.js} +2 -2
- package/dist/assets/{index-YDuxnNHU.js → index-B9G82qB1.js} +1 -1
- package/dist/assets/{index-r8P2C1jY.js → index-BSxNuPI0.js} +1 -1
- package/dist/assets/{index-CZJa5rYO.js → index-BYh7vMHV.js} +1 -1
- package/dist/assets/{index-Dczm0ciF.js → index-BgL1dPWt.js} +3 -3
- package/dist/assets/{index-vsYl-Coo.js → index-Blezh-s8.js} +1 -1
- package/dist/assets/{index-Bh1rufH4.js → index-BxYPHYUH.js} +1 -1
- package/dist/assets/{index-Bp5-go9U.js → index-C0MPSQz5.js} +1 -1
- package/dist/assets/{index-D5nLng0M.js → index-C18bceOR.js} +1 -1
- package/dist/assets/{index-DL9WFbI3.js → index-C8qN6OYX.js} +1 -1
- package/dist/assets/{index-t53zoO86.js → index-CDUwF60T.js} +3 -3
- package/dist/assets/{index-DvXF3edn.js → index-CGbAD4Xi.js} +1 -1
- package/dist/assets/{index-COZUVDs_.js → index-CGtSmCPW.js} +1 -1
- package/dist/assets/{index-rgZafSNx.js → index-CI6bkFz-.js} +1 -1
- package/dist/assets/{index-0vNZ7AEu.js → index-CWrCL46N.js} +1 -1
- package/dist/assets/{index-DibtYVCM.js → index-CXfHduhO.js} +1 -1
- package/dist/assets/{index-CI0UsYER.js → index-CXlxISJm.js} +3 -3
- package/dist/assets/{index-zevfx5hg.js → index-CqcPH9rE.js} +1 -1
- package/dist/assets/{index-BYtw5o5b.js → index-CzwSFsHv.js} +1 -1
- package/dist/assets/{index-YcYAmiqY.js → index-D6dDdX1x.js} +3 -3
- package/dist/assets/{index-Lr_zCh3w.js → index-DEQqo1fm.js} +1 -1
- package/dist/assets/{index-CmGtSUKs.js → index-DHOd5gGn.js} +9 -9
- package/dist/assets/{index-BTMZN2df.js → index-DKrszRuJ.js} +1 -1
- package/dist/assets/{index-DC_t5IrF.js → index-DLBc3J_r.js} +1 -1
- package/dist/assets/{index-BC50VoNY.js → index-DNQPJx5x.js} +1 -1
- package/dist/assets/{index-CKMXkLAj.js → index-DUnAi0dd.js} +1 -1
- package/dist/assets/{index-wprZzohw.js → index-DWQO_jps.js} +3 -3
- package/dist/assets/{index-DIlhgeDx.js → index-DbAgyAV9.js} +1 -1
- package/dist/assets/{index-BU51lRJo.js → index-DbkpStQB.js} +1 -1
- package/dist/assets/{index-BGR-_3k-.js → index-Df9Q9jOJ.js} +1 -1
- package/dist/assets/{index-B9jXnde-.js → index-DhQHfnFm.js} +1 -1
- package/dist/assets/{index-B3Oc6om-.js → index-DkXyge_A.js} +1 -1
- package/dist/assets/{index-B4mPHi-Q.js → index-DmsqVYkn.js} +1 -1
- package/dist/assets/{index-CeFaduiH.js → index-DoM0FAgW.js} +1 -1
- package/dist/assets/index-DqicnaQO.js +1 -0
- package/dist/assets/{index-D3pkr7vY.js → index-DuLB6_RW.js} +1 -1
- package/dist/assets/{index-Bn30Hrji.js → index-IafFB28o.js} +1 -1
- package/dist/assets/{index-HLx20Dfh.js → index-JGr5AQiu.js} +1 -1
- package/dist/assets/{index-CKKPbTJM.js → index-KLCSCkKB.js} +1 -1
- package/dist/assets/{index-BwC1WKA0.js → index-KdXwUlEX.js} +1 -1
- package/dist/assets/{index-CrdG-tHx.js → index-b_XOo9t0.js} +1 -1
- package/dist/assets/{index-gbJS2iWq.js → index-jGjR50ot.js} +1 -1
- package/dist/assets/{index-BcBAaNDP.js → index-p7oyunUI.js} +1 -1
- package/dist/assets/{index-CpkDkxbl.js → index-yDWSKKZO.js} +1 -1
- package/dist/assets/{index.esm-BQAoYQrS.js → index.esm-QzmyxCzz.js} +1 -1
- package/dist/assets/{install-from-url-IsaoWEsr.js → install-from-url-BfGKz21p.js} +1 -1
- package/dist/assets/{invitation-C5_UDplP.js → invitation-CzJDHxji.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-BGtI1xmD.js → is-path-prefix-equal-DZPjTGyK.js} +1 -1
- package/dist/assets/{item-DbR_Qonp.js → item-CH_guXBP.js} +1 -1
- package/dist/assets/{javascript-DkXHxlH1.js → javascript-CvcHzTQO.js} +1 -1
- package/dist/assets/{jsonMode-CGwcJxW1.js → jsonMode-tKOp8IX8.js} +1 -1
- package/dist/assets/{liquid-CAttQQg5.js → liquid-Dkktcyjc.js} +1 -1
- package/dist/assets/{list-header-BDHTrIR7.js → list-header-DLL9O6AN.js} +1 -1
- package/dist/assets/{log-YBA0AQwS.js → log-BouQYJgF.js} +1 -1
- package/dist/assets/{lottie-react.esm-BDS-spvg.js → lottie-react.esm-gMikIDvr.js} +1 -1
- package/dist/assets/{mdx-B8IKS0Gi.js → mdx-BlWesxxY.js} +1 -1
- package/dist/assets/{memory-D1vRidmB.js → memory-D-UCct7k.js} +1 -1
- package/dist/assets/{metric-CCZ8GIKv.js → metric--LTkDTx7.js} +1 -1
- package/dist/assets/omit-D8eZ8aBF.js +1 -0
- package/dist/assets/{overview-lwcVaTjE.js → overview-DDxZ02ny.js} +1 -1
- package/dist/assets/{permission-C38ouogl.js → permission-lTvpziGW.js} +1 -1
- package/dist/assets/{preference-A8RbnsFJ.js → preference-DndyNUKO.js} +3 -3
- package/dist/assets/{python-ob3MVBAf.js → python-GaV8-GIJ.js} +1 -1
- package/dist/assets/{raf-schd.esm-Srh73OZ3.js → raf-schd.esm-8MBTnO56.js} +1 -1
- package/dist/assets/{razor-CqXOZHtS.js → razor-C_49aI9H.js} +1 -1
- package/dist/assets/{rotate-session-key-D0BtnLpd.js → rotate-session-key-CaBQj1lt.js} +1 -1
- package/dist/assets/{runtime-D0jvHCY9.js → runtime-CLuKraqz.js} +1 -1
- package/dist/assets/schema-CzQqEHnw.js +1 -0
- package/dist/assets/sdk-CerA241V.js +1 -0
- package/dist/assets/{service-D5pzJKlx.js → service-3yrHELjo.js} +1 -1
- package/dist/assets/{shorten-label-BkkyIh2O.js → shorten-label-CzMFEveB.js} +1 -1
- package/dist/assets/{simple-select-BrcGp9-q.js → simple-select-CLLgxXY7.js} +1 -1
- package/dist/assets/{spaces-DLMhU3hk.js → spaces-BfcMTlVB.js} +1 -1
- package/dist/assets/{status-DjFfQvDr.js → status-B8VK0RE7.js} +1 -1
- package/dist/assets/{status-CJUsFots.js → status-DDKZiXWk.js} +1 -1
- package/dist/assets/{switch-control-BcyytepR.js → switch-control-DAzOmGCO.js} +1 -1
- package/dist/assets/{table-icons-IcqjoaWm.js → table-icons-Cy8dax05.js} +1 -1
- package/dist/assets/{team-95t9JyF5.js → team-DEafDqHZ.js} +1 -1
- package/dist/assets/{toLower-DkUK7eQ7.js → toLower-CxvQMAHz.js} +1 -1
- package/dist/assets/toUpper-Beqe9mQh.js +1 -0
- package/dist/assets/{traffic-Cg41H_Ty.js → traffic-CLBvJjgV.js} +1 -1
- package/dist/assets/{tsMode-B5qT7PQL.js → tsMode-C-OJLRW1.js} +1 -1
- package/dist/assets/{typescript-Cm-WHdsg.js → typescript-DBZ_YKCp.js} +1 -1
- package/dist/assets/{url-evaluation-CtukTo4p.js → url-evaluation-BHSXGj_2.js} +1 -1
- package/dist/assets/{url-join-CaiV3nSu.js → url-join-DIhM9NVK.js} +1 -1
- package/dist/assets/{use-mobile-C4uNTozm.js → use-mobile-BYT7hzgp.js} +1 -1
- package/dist/assets/{use-mobile-DOyOocoE.js → use-mobile-DBs2owXM.js} +1 -1
- package/dist/assets/{useAsync-D1r7tRgT.js → useAsync-Br62Pjfl.js} +1 -1
- package/dist/assets/{useAsyncRetry-DAJQCtzl.js → useAsyncRetry-CDVIje8J.js} +1 -1
- package/dist/assets/{useLocalStorage-DwEccSW6.js → useLocalStorage-BUqQ3nyo.js} +1 -1
- package/dist/assets/{useThemeProps-CsMEzzrN.js → useThemeProps-BPxZAai9.js} +1 -1
- package/dist/assets/{util-BGjS1yxA.js → util-Bbuxw1gA.js} +1 -1
- package/dist/assets/{wait-container-BAhhGuAo.js → wait-container-eH_u0F2e.js} +1 -1
- package/dist/assets/{without-wallet-BJvNbqrr.js → without-wallet-Bw4qLAEh.js} +1 -1
- package/dist/assets/{wrap-locale-DIuDEP17.js → wrap-locale-CEJIDOVi.js} +1 -1
- package/dist/assets/{xml-CL4Ygw15.js → xml-BFp8bmHB.js} +1 -1
- package/dist/assets/{yaml-B3hFV4xP.js → yaml-Dr-14dj4.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-Doc7Mi-x.js +0 -1
- package/dist/assets/api-YN3oror6.js +0 -1
- package/dist/assets/client-BSdzIVHz.js +0 -1
- package/dist/assets/cloneDeep-DRPmP8MR.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-DCbFVNUX.js +0 -1
- package/dist/assets/engine-n_dB0poi.js +0 -1
- package/dist/assets/getValidReactChildren-CuqzhDUA.js +0 -1
- package/dist/assets/index-C35YhCHh.js +0 -1
- package/dist/assets/omit-BKpaopbT.js +0 -1
- package/dist/assets/schema-CjBxKpCX.js +0 -1
- package/dist/assets/sdk-DyID4gpA.js +0 -1
- package/dist/assets/toUpper-CILdyLjF.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cn as g,r as o,g as x,co as r,B as u,j as s,N as m,cp as d}from"./index-
|
|
1
|
+
import{cn as g,r as o,g as x,co as r,B as u,j as s,N as m,cp as d}from"./index-CXlxISJm.js";function P(){const i=g(),{blocklets:c,refresh:l}=i,{t:p}=o.useContext(x),y=r.generateKey(),[a]=u();return o.useEffect(()=>{const n=r.getNotificationQueryParams(y)??{},t=a.get("entityId"),e=a.get("severity"),f={...n,...e?{severity:e==="all"?[]:e.split(","),paging:{...n.paging,page:1}}:{},...t?{entityId:t==="all"?[]:t.split(",")}:{},componentDid:[]};l(f)},[]),s.jsxs(m,{children:[s.jsx("h1",{children:p("notification.title")}),s.jsx(d,{tabType:"line",blocklets:c,context:i,filterType:"entity",type:"server"})]})}export{P as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aG as Kt,j as Q,bd as Gt,s as Ht,r as zt,_ as Wt,fn as we,dd as Zt,g9 as Yt}from"./index-CI0UsYER.js";const Xt=Kt(Q.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2zm-1 7h5.5L14 6.5z"}));var En,$n;function jt(){if($n)return En;$n=1;function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const a=e[t],f=typeof a;(f==="object"||f==="function")&&!Object.isFrozen(a)&&n(a)}),e}class r{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function o(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function c(e,...t){const a=Object.create(null);for(const f in e)a[f]=e[f];return t.forEach(function(f){for(const F in f)a[F]=f[F]}),a}const w="</span>",$=e=>!!e.scope,A=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const a=e.split(".");return[`${t}${a.shift()}`,...a.map((f,F)=>`${f}${"_".repeat(F+1)}`)].join(" ")}return`${t}${e}`};class _{constructor(t,a){this.buffer="",this.classPrefix=a.classPrefix,t.walk(this)}addText(t){this.buffer+=o(t)}openNode(t){if(!$(t))return;const a=A(t.scope,{prefix:this.classPrefix});this.span(a)}closeNode(t){$(t)&&(this.buffer+=w)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const h=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class b{constructor(){this.rootNode=h(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const a=h({scope:t});this.add(a),this.stack.push(a)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,a){return typeof a=="string"?t.addText(a):a.children&&(t.openNode(a),a.children.forEach(f=>this._walk(t,f)),t.closeNode(a)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(a=>typeof a=="string")?t.children=[t.children.join("")]:t.children.forEach(a=>{b._collapse(a)}))}}class S extends b{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,a){const f=t.root;a&&(f.scope=`language:${a}`),this.add(f)}toHTML(){return new _(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function R(e){return e?typeof e=="string"?e:e.source:null}function N(e){return O("(?=",e,")")}function y(e){return O("(?:",e,")*")}function U(e){return O("(?:",e,")?")}function O(...e){return e.map(a=>R(a)).join("")}function P(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function B(...e){return"("+(P(e).capture?"":"?:")+e.map(f=>R(f)).join("|")+")"}function H(e){return new RegExp(e.toString()+"|").exec("").length-1}function Z(e,t){const a=e&&e.exec(t);return a&&a.index===0}const se=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function M(e,{joinWith:t}){let a=0;return e.map(f=>{a+=1;const F=a;let K=R(f),u="";for(;K.length>0;){const l=se.exec(K);if(!l){u+=K;break}u+=K.substring(0,l.index),K=K.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?u+="\\"+String(Number(l[1])+F):(u+=l[0],l[0]==="("&&a++)}return u}).map(f=>`(${f})`).join(t)}const V=/\b\B/,ce="[a-zA-Z]\\w*",te="[a-zA-Z_]\\w*",ae="\\b\\d+(\\.\\d+)?",de="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Ne="\\b(0b[01]+)",Ee="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",he=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=O(t,/.*\b/,e.binary,/\b.*/)),c({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(a,f)=>{a.index!==0&&f.ignoreMatch()}},e)},re={begin:"\\\\[\\s\\S]",relevance:0},Ae={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[re]},be={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[re]},fe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,a={}){const f=c({scope:"comment",begin:e,end:t,contains:[]},a);f.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const F=B("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return f.contains.push({begin:O(/[ ]+/,"(",F,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),f},Y=I("//","$"),ee=I("/\\*","\\*/"),q=I("#","$"),X={scope:"number",begin:ae,relevance:0},_e={scope:"number",begin:de,relevance:0},qe={scope:"number",begin:Ne,relevance:0},Be={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[re,{begin:/\[/,end:/\]/,relevance:0,contains:[re]}]},ve={scope:"title",begin:ce,relevance:0},Je={scope:"title",begin:te,relevance:0},$e={begin:"\\.\\s*"+te,relevance:0};var Oe=Object.freeze({__proto__:null,APOS_STRING_MODE:Ae,BACKSLASH_ESCAPE:re,BINARY_NUMBER_MODE:qe,BINARY_NUMBER_RE:Ne,COMMENT:I,C_BLOCK_COMMENT_MODE:ee,C_LINE_COMMENT_MODE:Y,C_NUMBER_MODE:_e,C_NUMBER_RE:de,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(t,a)=>{a.data._beginMatch=t[1]},"on:end":(t,a)=>{a.data._beginMatch!==t[1]&&a.ignoreMatch()}})},HASH_COMMENT_MODE:q,IDENT_RE:ce,MATCH_NOTHING_RE:V,METHOD_GUARD:$e,NUMBER_MODE:X,NUMBER_RE:ae,PHRASAL_WORDS_MODE:fe,QUOTE_STRING_MODE:be,REGEXP_MODE:Be,RE_STARTERS_RE:Ee,SHEBANG:he,TITLE_MODE:ve,UNDERSCORE_IDENT_RE:te,UNDERSCORE_TITLE_MODE:Je});function Qe(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function en(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function nn(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Qe,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function tn(e,t){Array.isArray(e.illegal)&&(e.illegal=B(...e.illegal))}function sn(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function L(e,t){e.relevance===void 0&&(e.relevance=1)}const Ie=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const a=Object.assign({},e);Object.keys(e).forEach(f=>{delete e[f]}),e.keywords=a.keywords,e.begin=O(a.beforeMatch,N(a.begin)),e.starts={relevance:0,contains:[Object.assign(a,{endsParent:!0})]},e.relevance=0,delete a.beforeMatch},Re=["of","and","for","in","not","or","if","then","parent","list","value"],an="keyword";function mn(e,t,a=an){const f=Object.create(null);return typeof e=="string"?F(a,e.split(" ")):Array.isArray(e)?F(a,e):Object.keys(e).forEach(function(K){Object.assign(f,mn(e[K],t,K))}),f;function F(K,u){t&&(u=u.map(l=>l.toLowerCase())),u.forEach(function(l){const E=l.split("|");f[E[0]]=[K,dt(E[0],E[1])]})}}function dt(e,t){return t?Number(t):Et(e)?0:1}function Et(e){return Re.includes(e.toLowerCase())}const An={},Te=e=>{console.error(e)},Rn=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Me=(e,t)=>{An[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),An[`${e}/${t}`]=!0)},Ue=new Error;function Tn(e,t,{key:a}){let f=0;const F=e[a],K={},u={};for(let l=1;l<=t.length;l++)u[l+f]=F[l],K[l+f]=!0,f+=H(t[l-1]);e[a]=u,e[a]._emit=K,e[a]._multi=!0}function bt(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Te("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ue;if(typeof e.beginScope!="object"||e.beginScope===null)throw Te("beginScope must be object"),Ue;Tn(e,e.begin,{key:"beginScope"}),e.begin=M(e.begin,{joinWith:""})}}function ft(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Te("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ue;if(typeof e.endScope!="object"||e.endScope===null)throw Te("endScope must be object"),Ue;Tn(e,e.end,{key:"endScope"}),e.end=M(e.end,{joinWith:""})}}function _t(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function pt(e){_t(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),bt(e),ft(e)}function Nt(e){function t(u,l){return new RegExp(R(u),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class a{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,E){E.position=this.position++,this.matchIndexes[this.matchAt]=E,this.regexes.push([E,l]),this.matchAt+=H(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(E=>E[1]);this.matcherRe=t(M(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const E=this.matcherRe.exec(l);if(!E)return null;const W=E.findIndex((De,cn)=>cn>0&&De!==void 0),G=this.matchIndexes[W];return E.splice(0,W),Object.assign(E,G)}}class f{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const E=new a;return this.rules.slice(l).forEach(([W,G])=>E.addRule(W,G)),E.compile(),this.multiRegexes[l]=E,E}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,E){this.rules.push([l,E]),E.type==="begin"&&this.count++}exec(l){const E=this.getMatcher(this.regexIndex);E.lastIndex=this.lastIndex;let W=E.exec(l);if(this.resumingScanAtSamePosition()&&!(W&&W.index===this.lastIndex)){const G=this.getMatcher(0);G.lastIndex=this.lastIndex+1,W=G.exec(l)}return W&&(this.regexIndex+=W.position+1,this.regexIndex===this.count&&this.considerAll()),W}}function F(u){const l=new f;return u.contains.forEach(E=>l.addRule(E.begin,{rule:E,type:"begin"})),u.terminatorEnd&&l.addRule(u.terminatorEnd,{type:"end"}),u.illegal&&l.addRule(u.illegal,{type:"illegal"}),l}function K(u,l){const E=u;if(u.isCompiled)return E;[en,sn,pt,Ie].forEach(G=>G(u,l)),e.compilerExtensions.forEach(G=>G(u,l)),u.__beforeBegin=null,[nn,tn,L].forEach(G=>G(u,l)),u.isCompiled=!0;let W=null;return typeof u.keywords=="object"&&u.keywords.$pattern&&(u.keywords=Object.assign({},u.keywords),W=u.keywords.$pattern,delete u.keywords.$pattern),W=W||/\w+/,u.keywords&&(u.keywords=mn(u.keywords,e.case_insensitive)),E.keywordPatternRe=t(W,!0),l&&(u.begin||(u.begin=/\B|\b/),E.beginRe=t(E.begin),!u.end&&!u.endsWithParent&&(u.end=/\B|\b/),u.end&&(E.endRe=t(E.end)),E.terminatorEnd=R(E.end)||"",u.endsWithParent&&l.terminatorEnd&&(E.terminatorEnd+=(u.end?"|":"")+l.terminatorEnd)),u.illegal&&(E.illegalRe=t(u.illegal)),u.contains||(u.contains=[]),u.contains=[].concat(...u.contains.map(function(G){return ht(G==="self"?u:G)})),u.contains.forEach(function(G){K(G,E)}),u.starts&&K(u.starts,l),E.matcher=F(E),E}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=c(e.classNameAliases||{}),K(e)}function yn(e){return e?e.endsWithParent||yn(e.starts):!1}function ht(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return c(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:yn(e)?c(e,{starts:e.starts?c(e.starts):null}):Object.isFrozen(e)?c(e):e}var St="11.11.1";class mt extends Error{constructor(t,a){super(t),this.name="HTMLInjectionError",this.html=a}}const rn=o,On=c,In=Symbol("nomatch"),At=7,Mn=function(e){const t=Object.create(null),a=Object.create(null),f=[];let F=!0;const K="Could not find the language '{}', did you forget to load/include a language module?",u={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:S};function E(s){return l.noHighlightRe.test(s)}function W(s){let d=s.className+" ";d+=s.parentNode?s.parentNode.className:"";const T=l.languageDetectRe.exec(d);if(T){const D=Se(T[1]);return D||(Rn(K.replace("{}",T[1])),Rn("Falling back to no-highlight mode for this block.",s)),D?T[1]:"no-highlight"}return d.split(/\s+/).find(D=>E(D)||Se(D))}function G(s,d,T){let D="",z="";typeof d=="object"?(D=s,T=d.ignoreIllegals,z=d.language):(Me("10.7.0","highlight(lang, code, ...args) has been deprecated."),Me("10.7.0",`Please use highlight(code, options) instead.
|
|
1
|
+
import{aG as Kt,j as Q,bd as Gt,s as Ht,r as zt,_ as Wt,fn as we,dd as Zt,g9 as Yt}from"./index-CXlxISJm.js";const Xt=Kt(Q.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2zm-1 7h5.5L14 6.5z"}));var En,$n;function jt(){if($n)return En;$n=1;function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const a=e[t],f=typeof a;(f==="object"||f==="function")&&!Object.isFrozen(a)&&n(a)}),e}class r{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function o(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function c(e,...t){const a=Object.create(null);for(const f in e)a[f]=e[f];return t.forEach(function(f){for(const F in f)a[F]=f[F]}),a}const w="</span>",$=e=>!!e.scope,A=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const a=e.split(".");return[`${t}${a.shift()}`,...a.map((f,F)=>`${f}${"_".repeat(F+1)}`)].join(" ")}return`${t}${e}`};class _{constructor(t,a){this.buffer="",this.classPrefix=a.classPrefix,t.walk(this)}addText(t){this.buffer+=o(t)}openNode(t){if(!$(t))return;const a=A(t.scope,{prefix:this.classPrefix});this.span(a)}closeNode(t){$(t)&&(this.buffer+=w)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const h=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class b{constructor(){this.rootNode=h(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const a=h({scope:t});this.add(a),this.stack.push(a)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,a){return typeof a=="string"?t.addText(a):a.children&&(t.openNode(a),a.children.forEach(f=>this._walk(t,f)),t.closeNode(a)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(a=>typeof a=="string")?t.children=[t.children.join("")]:t.children.forEach(a=>{b._collapse(a)}))}}class S extends b{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,a){const f=t.root;a&&(f.scope=`language:${a}`),this.add(f)}toHTML(){return new _(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function R(e){return e?typeof e=="string"?e:e.source:null}function N(e){return O("(?=",e,")")}function y(e){return O("(?:",e,")*")}function U(e){return O("(?:",e,")?")}function O(...e){return e.map(a=>R(a)).join("")}function P(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function B(...e){return"("+(P(e).capture?"":"?:")+e.map(f=>R(f)).join("|")+")"}function H(e){return new RegExp(e.toString()+"|").exec("").length-1}function Z(e,t){const a=e&&e.exec(t);return a&&a.index===0}const se=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function M(e,{joinWith:t}){let a=0;return e.map(f=>{a+=1;const F=a;let K=R(f),u="";for(;K.length>0;){const l=se.exec(K);if(!l){u+=K;break}u+=K.substring(0,l.index),K=K.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?u+="\\"+String(Number(l[1])+F):(u+=l[0],l[0]==="("&&a++)}return u}).map(f=>`(${f})`).join(t)}const V=/\b\B/,ce="[a-zA-Z]\\w*",te="[a-zA-Z_]\\w*",ae="\\b\\d+(\\.\\d+)?",de="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Ne="\\b(0b[01]+)",Ee="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",he=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=O(t,/.*\b/,e.binary,/\b.*/)),c({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(a,f)=>{a.index!==0&&f.ignoreMatch()}},e)},re={begin:"\\\\[\\s\\S]",relevance:0},Ae={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[re]},be={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[re]},fe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,a={}){const f=c({scope:"comment",begin:e,end:t,contains:[]},a);f.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const F=B("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return f.contains.push({begin:O(/[ ]+/,"(",F,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),f},Y=I("//","$"),ee=I("/\\*","\\*/"),q=I("#","$"),X={scope:"number",begin:ae,relevance:0},_e={scope:"number",begin:de,relevance:0},qe={scope:"number",begin:Ne,relevance:0},Be={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[re,{begin:/\[/,end:/\]/,relevance:0,contains:[re]}]},ve={scope:"title",begin:ce,relevance:0},Je={scope:"title",begin:te,relevance:0},$e={begin:"\\.\\s*"+te,relevance:0};var Oe=Object.freeze({__proto__:null,APOS_STRING_MODE:Ae,BACKSLASH_ESCAPE:re,BINARY_NUMBER_MODE:qe,BINARY_NUMBER_RE:Ne,COMMENT:I,C_BLOCK_COMMENT_MODE:ee,C_LINE_COMMENT_MODE:Y,C_NUMBER_MODE:_e,C_NUMBER_RE:de,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(t,a)=>{a.data._beginMatch=t[1]},"on:end":(t,a)=>{a.data._beginMatch!==t[1]&&a.ignoreMatch()}})},HASH_COMMENT_MODE:q,IDENT_RE:ce,MATCH_NOTHING_RE:V,METHOD_GUARD:$e,NUMBER_MODE:X,NUMBER_RE:ae,PHRASAL_WORDS_MODE:fe,QUOTE_STRING_MODE:be,REGEXP_MODE:Be,RE_STARTERS_RE:Ee,SHEBANG:he,TITLE_MODE:ve,UNDERSCORE_IDENT_RE:te,UNDERSCORE_TITLE_MODE:Je});function Qe(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function en(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function nn(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Qe,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function tn(e,t){Array.isArray(e.illegal)&&(e.illegal=B(...e.illegal))}function sn(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function L(e,t){e.relevance===void 0&&(e.relevance=1)}const Ie=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const a=Object.assign({},e);Object.keys(e).forEach(f=>{delete e[f]}),e.keywords=a.keywords,e.begin=O(a.beforeMatch,N(a.begin)),e.starts={relevance:0,contains:[Object.assign(a,{endsParent:!0})]},e.relevance=0,delete a.beforeMatch},Re=["of","and","for","in","not","or","if","then","parent","list","value"],an="keyword";function mn(e,t,a=an){const f=Object.create(null);return typeof e=="string"?F(a,e.split(" ")):Array.isArray(e)?F(a,e):Object.keys(e).forEach(function(K){Object.assign(f,mn(e[K],t,K))}),f;function F(K,u){t&&(u=u.map(l=>l.toLowerCase())),u.forEach(function(l){const E=l.split("|");f[E[0]]=[K,dt(E[0],E[1])]})}}function dt(e,t){return t?Number(t):Et(e)?0:1}function Et(e){return Re.includes(e.toLowerCase())}const An={},Te=e=>{console.error(e)},Rn=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Me=(e,t)=>{An[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),An[`${e}/${t}`]=!0)},Ue=new Error;function Tn(e,t,{key:a}){let f=0;const F=e[a],K={},u={};for(let l=1;l<=t.length;l++)u[l+f]=F[l],K[l+f]=!0,f+=H(t[l-1]);e[a]=u,e[a]._emit=K,e[a]._multi=!0}function bt(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Te("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ue;if(typeof e.beginScope!="object"||e.beginScope===null)throw Te("beginScope must be object"),Ue;Tn(e,e.begin,{key:"beginScope"}),e.begin=M(e.begin,{joinWith:""})}}function ft(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Te("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ue;if(typeof e.endScope!="object"||e.endScope===null)throw Te("endScope must be object"),Ue;Tn(e,e.end,{key:"endScope"}),e.end=M(e.end,{joinWith:""})}}function _t(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function pt(e){_t(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),bt(e),ft(e)}function Nt(e){function t(u,l){return new RegExp(R(u),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class a{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,E){E.position=this.position++,this.matchIndexes[this.matchAt]=E,this.regexes.push([E,l]),this.matchAt+=H(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(E=>E[1]);this.matcherRe=t(M(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const E=this.matcherRe.exec(l);if(!E)return null;const W=E.findIndex((De,cn)=>cn>0&&De!==void 0),G=this.matchIndexes[W];return E.splice(0,W),Object.assign(E,G)}}class f{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const E=new a;return this.rules.slice(l).forEach(([W,G])=>E.addRule(W,G)),E.compile(),this.multiRegexes[l]=E,E}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,E){this.rules.push([l,E]),E.type==="begin"&&this.count++}exec(l){const E=this.getMatcher(this.regexIndex);E.lastIndex=this.lastIndex;let W=E.exec(l);if(this.resumingScanAtSamePosition()&&!(W&&W.index===this.lastIndex)){const G=this.getMatcher(0);G.lastIndex=this.lastIndex+1,W=G.exec(l)}return W&&(this.regexIndex+=W.position+1,this.regexIndex===this.count&&this.considerAll()),W}}function F(u){const l=new f;return u.contains.forEach(E=>l.addRule(E.begin,{rule:E,type:"begin"})),u.terminatorEnd&&l.addRule(u.terminatorEnd,{type:"end"}),u.illegal&&l.addRule(u.illegal,{type:"illegal"}),l}function K(u,l){const E=u;if(u.isCompiled)return E;[en,sn,pt,Ie].forEach(G=>G(u,l)),e.compilerExtensions.forEach(G=>G(u,l)),u.__beforeBegin=null,[nn,tn,L].forEach(G=>G(u,l)),u.isCompiled=!0;let W=null;return typeof u.keywords=="object"&&u.keywords.$pattern&&(u.keywords=Object.assign({},u.keywords),W=u.keywords.$pattern,delete u.keywords.$pattern),W=W||/\w+/,u.keywords&&(u.keywords=mn(u.keywords,e.case_insensitive)),E.keywordPatternRe=t(W,!0),l&&(u.begin||(u.begin=/\B|\b/),E.beginRe=t(E.begin),!u.end&&!u.endsWithParent&&(u.end=/\B|\b/),u.end&&(E.endRe=t(E.end)),E.terminatorEnd=R(E.end)||"",u.endsWithParent&&l.terminatorEnd&&(E.terminatorEnd+=(u.end?"|":"")+l.terminatorEnd)),u.illegal&&(E.illegalRe=t(u.illegal)),u.contains||(u.contains=[]),u.contains=[].concat(...u.contains.map(function(G){return ht(G==="self"?u:G)})),u.contains.forEach(function(G){K(G,E)}),u.starts&&K(u.starts,l),E.matcher=F(E),E}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=c(e.classNameAliases||{}),K(e)}function yn(e){return e?e.endsWithParent||yn(e.starts):!1}function ht(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return c(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:yn(e)?c(e,{starts:e.starts?c(e.starts):null}):Object.isFrozen(e)?c(e):e}var St="11.11.1";class mt extends Error{constructor(t,a){super(t),this.name="HTMLInjectionError",this.html=a}}const rn=o,On=c,In=Symbol("nomatch"),At=7,Mn=function(e){const t=Object.create(null),a=Object.create(null),f=[];let F=!0;const K="Could not find the language '{}', did you forget to load/include a language module?",u={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:S};function E(s){return l.noHighlightRe.test(s)}function W(s){let d=s.className+" ";d+=s.parentNode?s.parentNode.className:"";const T=l.languageDetectRe.exec(d);if(T){const D=Se(T[1]);return D||(Rn(K.replace("{}",T[1])),Rn("Falling back to no-highlight mode for this block.",s)),D?T[1]:"no-highlight"}return d.split(/\s+/).find(D=>E(D)||Se(D))}function G(s,d,T){let D="",z="";typeof d=="object"?(D=s,T=d.ignoreIllegals,z=d.language):(Me("10.7.0","highlight(lang, code, ...args) has been deprecated."),Me("10.7.0",`Please use highlight(code, options) instead.
|
|
2
2
|
https://github.com/highlightjs/highlight.js/issues/2277`),z=s,D=d),T===void 0&&(T=!0);const oe={code:D,language:z};Fe("before:highlight",oe);const me=oe.result?oe.result:De(oe.language,oe.code,T);return me.code=oe.code,Fe("after:highlight",me),me}function De(s,d,T,D){const z=Object.create(null);function oe(i,g){return i.keywords[g]}function me(){if(!p.keywords){j.addText(k);return}let i=0;p.keywordPatternRe.lastIndex=0;let g=p.keywordPatternRe.exec(k),m="";for(;g;){m+=k.substring(i,g.index);const C=ue.case_insensitive?g[0].toLowerCase():g[0],J=oe(p,C);if(J){const[pe,Pt]=J;if(j.addText(m),m="",z[C]=(z[C]||0)+1,z[C]<=At&&(He+=Pt),pe.startsWith("_"))m+=g[0];else{const Ft=ue.classNameAliases[pe]||pe;le(g[0],Ft)}}else m+=g[0];i=p.keywordPatternRe.lastIndex,g=p.keywordPatternRe.exec(k)}m+=k.substring(i),j.addText(m)}function Ke(){if(k==="")return;let i=null;if(typeof p.subLanguage=="string"){if(!t[p.subLanguage]){j.addText(k);return}i=De(p.subLanguage,k,!0,Bn[p.subLanguage]),Bn[p.subLanguage]=i._top}else i=on(k,p.subLanguage.length?p.subLanguage:null);p.relevance>0&&(He+=i.relevance),j.__addSublanguage(i._emitter,i.language)}function ie(){p.subLanguage!=null?Ke():me(),k=""}function le(i,g){i!==""&&(j.startScope(g),j.addText(i),j.endScope())}function xn(i,g){let m=1;const C=g.length-1;for(;m<=C;){if(!i._emit[m]){m++;continue}const J=ue.classNameAliases[i[m]]||i[m],pe=g[m];J?le(pe,J):(k=pe,me(),k=""),m++}}function vn(i,g){return i.scope&&typeof i.scope=="string"&&j.openNode(ue.classNameAliases[i.scope]||i.scope),i.beginScope&&(i.beginScope._wrap?(le(k,ue.classNameAliases[i.beginScope._wrap]||i.beginScope._wrap),k=""):i.beginScope._multi&&(xn(i.beginScope,g),k="")),p=Object.create(i,{parent:{value:p}}),p}function Dn(i,g,m){let C=Z(i.endRe,m);if(C){if(i["on:end"]){const J=new r(i);i["on:end"](g,J),J.isMatchIgnored&&(C=!1)}if(C){for(;i.endsParent&&i.parent;)i=i.parent;return i}}if(i.endsWithParent)return Dn(i.parent,g,m)}function Dt(i){return p.matcher.regexIndex===0?(k+=i[0],1):(dn=!0,0)}function kt(i){const g=i[0],m=i.rule,C=new r(m),J=[m.__beforeBegin,m["on:begin"]];for(const pe of J)if(pe&&(pe(i,C),C.isMatchIgnored))return Dt(g);return m.skip?k+=g:(m.excludeBegin&&(k+=g),ie(),!m.returnBegin&&!m.excludeBegin&&(k=g)),vn(m,i),m.returnBegin?0:g.length}function Bt(i){const g=i[0],m=d.substring(i.index),C=Dn(p,i,m);if(!C)return In;const J=p;p.endScope&&p.endScope._wrap?(ie(),le(g,p.endScope._wrap)):p.endScope&&p.endScope._multi?(ie(),xn(p.endScope,i)):J.skip?k+=g:(J.returnEnd||J.excludeEnd||(k+=g),ie(),J.excludeEnd&&(k=g));do p.scope&&j.closeNode(),!p.skip&&!p.subLanguage&&(He+=p.relevance),p=p.parent;while(p!==C.parent);return C.starts&&vn(C.starts,i),J.returnEnd?0:g.length}function $t(){const i=[];for(let g=p;g!==ue;g=g.parent)g.scope&&i.unshift(g.scope);i.forEach(g=>j.openNode(g))}let Ge={};function kn(i,g){const m=g&&g[0];if(k+=i,m==null)return ie(),0;if(Ge.type==="begin"&&g.type==="end"&&Ge.index===g.index&&m===""){if(k+=d.slice(g.index,g.index+1),!F){const C=new Error(`0 width match regex (${s})`);throw C.languageName=s,C.badRule=Ge.rule,C}return 1}if(Ge=g,g.type==="begin")return kt(g);if(g.type==="illegal"&&!T){const C=new Error('Illegal lexeme "'+m+'" for mode "'+(p.scope||"<unnamed>")+'"');throw C.mode=p,C}else if(g.type==="end"){const C=Bt(g);if(C!==In)return C}if(g.type==="illegal"&&m==="")return k+=`
|
|
3
3
|
`,1;if(gn>1e5&&gn>g.index*3)throw new Error("potential infinite loop, way more iterations than matches");return k+=m,m.length}const ue=Se(s);if(!ue)throw Te(K.replace("{}",s)),new Error('Unknown language: "'+s+'"');const Ut=Nt(ue);let un="",p=D||Ut;const Bn={},j=new l.__emitter(l);$t();let k="",He=0,ye=0,gn=0,dn=!1;try{if(ue.__emitTokens)ue.__emitTokens(d,j);else{for(p.matcher.considerAll();;){gn++,dn?dn=!1:p.matcher.considerAll(),p.matcher.lastIndex=ye;const i=p.matcher.exec(d);if(!i)break;const g=d.substring(ye,i.index),m=kn(g,i);ye=i.index+m}kn(d.substring(ye))}return j.finalize(),un=j.toHTML(),{language:s,value:un,relevance:He,illegal:!1,_emitter:j,_top:p}}catch(i){if(i.message&&i.message.includes("Illegal"))return{language:s,value:rn(d),illegal:!0,relevance:0,_illegalBy:{message:i.message,index:ye,context:d.slice(ye-100,ye+100),mode:i.mode,resultSoFar:un},_emitter:j};if(F)return{language:s,value:rn(d),illegal:!1,relevance:0,errorRaised:i,_emitter:j,_top:p};throw i}}function cn(s){const d={value:rn(s),illegal:!1,relevance:0,_top:u,_emitter:new l.__emitter(l)};return d._emitter.addText(s),d}function on(s,d){d=d||l.languages||Object.keys(t);const T=cn(s),D=d.filter(Se).filter(Ln).map(ie=>De(ie,s,!1));D.unshift(T);const z=D.sort((ie,le)=>{if(ie.relevance!==le.relevance)return le.relevance-ie.relevance;if(ie.language&&le.language){if(Se(ie.language).supersetOf===le.language)return 1;if(Se(le.language).supersetOf===ie.language)return-1}return 0}),[oe,me]=z,Ke=oe;return Ke.secondBest=me,Ke}function Rt(s,d,T){const D=d&&a[d]||T;s.classList.add("hljs"),s.classList.add(`language-${D}`)}function ln(s){let d=null;const T=W(s);if(E(T))return;if(Fe("before:highlightElement",{el:s,language:T}),s.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",s);return}if(s.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(s)),l.throwUnescapedHTML))throw new mt("One of your code blocks includes unescaped HTML.",s.innerHTML);d=s;const D=d.textContent,z=T?G(D,{language:T,ignoreIllegals:!0}):on(D);s.innerHTML=z.value,s.dataset.highlighted="yes",Rt(s,T,z.language),s.result={language:z.language,re:z.relevance,relevance:z.relevance},z.secondBest&&(s.secondBest={language:z.secondBest.language,relevance:z.secondBest.relevance}),Fe("after:highlightElement",{el:s,result:z,text:D})}function Tt(s){l=On(l,s)}const yt=()=>{Pe(),Me("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ot(){Pe(),Me("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Cn=!1;function Pe(){function s(){Pe()}if(document.readyState==="loading"){Cn||window.addEventListener("DOMContentLoaded",s,!1),Cn=!0;return}document.querySelectorAll(l.cssSelector).forEach(ln)}function It(s,d){let T=null;try{T=d(e)}catch(D){if(Te("Language definition for '{}' could not be registered.".replace("{}",s)),F)Te(D);else throw D;T=u}T.name||(T.name=s),t[s]=T,T.rawDefinition=d.bind(null,e),T.aliases&&wn(T.aliases,{languageName:s})}function Mt(s){delete t[s];for(const d of Object.keys(a))a[d]===s&&delete a[d]}function Ct(){return Object.keys(t)}function Se(s){return s=(s||"").toLowerCase(),t[s]||t[a[s]]}function wn(s,{languageName:d}){typeof s=="string"&&(s=[s]),s.forEach(T=>{a[T.toLowerCase()]=d})}function Ln(s){const d=Se(s);return d&&!d.disableAutodetect}function wt(s){s["before:highlightBlock"]&&!s["before:highlightElement"]&&(s["before:highlightElement"]=d=>{s["before:highlightBlock"](Object.assign({block:d.el},d))}),s["after:highlightBlock"]&&!s["after:highlightElement"]&&(s["after:highlightElement"]=d=>{s["after:highlightBlock"](Object.assign({block:d.el},d))})}function Lt(s){wt(s),f.push(s)}function xt(s){const d=f.indexOf(s);d!==-1&&f.splice(d,1)}function Fe(s,d){const T=s;f.forEach(function(D){D[T]&&D[T](d)})}function vt(s){return Me("10.7.0","highlightBlock will be removed entirely in v12.0"),Me("10.7.0","Please use highlightElement now."),ln(s)}Object.assign(e,{highlight:G,highlightAuto:on,highlightAll:Pe,highlightElement:ln,highlightBlock:vt,configure:Tt,initHighlighting:yt,initHighlightingOnLoad:Ot,registerLanguage:It,unregisterLanguage:Mt,listLanguages:Ct,getLanguage:Se,registerAliases:wn,autoDetection:Ln,inherit:On,addPlugin:Lt,removePlugin:xt}),e.debugMode=function(){F=!1},e.safeMode=function(){F=!0},e.versionString=St,e.regex={concat:O,lookahead:N,either:B,optional:U,anyNumberOfTimes:y};for(const s in Oe)typeof Oe[s]=="object"&&n(Oe[s]);return Object.assign(e,Oe),e},Ce=Mn({});return Ce.newInstance=()=>Mn({}),En=Ce,Ce.HighlightJS=Ce,Ce.default=Ce,En}var Vt=jt();const v=Gt(Vt),Un="[A-Za-z$_][0-9A-Za-z$_]*",qt=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Jt=["true","false","null","undefined","NaN","Infinity"],Hn=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],zn=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Wn=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Qt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],es=[].concat(Wn,Hn,zn);function pn(n){const r=n.regex,o=(I,{after:Y})=>{const ee="</"+I[0].slice(1);return I.input.indexOf(ee,Y)!==-1},c=Un,w={begin:"<>",end:"</>"},$=/<[A-Za-z0-9\\._:-]+\s*\/>/,A={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(I,Y)=>{const ee=I[0].length+I.index,q=I.input[ee];if(q==="<"||q===","){Y.ignoreMatch();return}q===">"&&(o(I,{after:ee})||Y.ignoreMatch());let X;const _e=I.input.substring(ee);if(X=_e.match(/^\s*=/)){Y.ignoreMatch();return}if((X=_e.match(/^\s+extends\s+/))&&X.index===0){Y.ignoreMatch();return}}},_={$pattern:Un,keyword:qt,literal:Jt,built_in:es,"variable.language":Qt},h="[0-9](_?[0-9])*",b=`\\.(${h})`,S="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",R={className:"number",variants:[{begin:`(\\b(${S})((${b})|\\.)?|(${b}))[eE][+-]?(${h})\\b`},{begin:`\\b(${S})\\b((${b})\\b|\\.)?|(${b})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:_,contains:[]},y={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},U={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,N],subLanguage:"css"}},O={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},P={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,N]},H={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:c+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},Z=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,y,U,O,P,{match:/\$\d+/},R];N.contains=Z.concat({begin:/\{/,end:/\}/,keywords:_,contains:["self"].concat(Z)});const se=[].concat(H,N.contains),M=se.concat([{begin:/(\s*)\(/,end:/\)/,keywords:_,contains:["self"].concat(se)}]),V={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:_,contains:M},ce={variants:[{match:[/class/,/\s+/,c,/\s+/,/extends/,/\s+/,r.concat(c,"(",r.concat(/\./,c),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,c],scope:{1:"keyword",3:"title.class"}}]},te={relevance:0,match:r.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Hn,...zn]}},ae={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},de={variants:[{match:[/function/,/\s+/,c,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[V],illegal:/%/},Ne={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Ee(I){return r.concat("(?!",I.join("|"),")")}const he={match:r.concat(/\b/,Ee([...Wn,"super","import"].map(I=>`${I}\\s*\\(`)),c,r.lookahead(/\s*\(/)),className:"title.function",relevance:0},re={begin:r.concat(/\./,r.lookahead(r.concat(c,/(?![0-9A-Za-z$_(])/))),end:c,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Ae={match:[/get|set/,/\s+/,c,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},V]},be="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",fe={match:[/const|var|let/,/\s+/,c,/\s*/,/=\s*/,/(async\s*)?/,r.lookahead(be)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[V]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:_,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:te},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),ae,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,y,U,O,P,H,{match:/\$\d+/},R,te,{scope:"attr",match:c+r.lookahead(":"),relevance:0},fe,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[H,n.REGEXP_MODE,{className:"function",begin:be,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:_,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:w.begin,end:w.end},{match:$},{begin:A.begin,"on:begin":A.isTrulyOpeningTag,end:A.end}],subLanguage:"xml",contains:[{begin:A.begin,end:A.end,skip:!0,contains:["self"]}]}]},de,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[V,n.inherit(n.TITLE_MODE,{begin:c,className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$"+c,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[V]},he,Ne,ce,Ae,{match:/\$[(.]/}]}}const je="[A-Za-z$_][0-9A-Za-z$_]*",Zn=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Yn=["true","false","null","undefined","NaN","Infinity"],Xn=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],jn=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Vn=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],qn=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Jn=[].concat(Vn,Xn,jn);function ns(n){const r=n.regex,o=(I,{after:Y})=>{const ee="</"+I[0].slice(1);return I.input.indexOf(ee,Y)!==-1},c=je,w={begin:"<>",end:"</>"},$=/<[A-Za-z0-9\\._:-]+\s*\/>/,A={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(I,Y)=>{const ee=I[0].length+I.index,q=I.input[ee];if(q==="<"||q===","){Y.ignoreMatch();return}q===">"&&(o(I,{after:ee})||Y.ignoreMatch());let X;const _e=I.input.substring(ee);if(X=_e.match(/^\s*=/)){Y.ignoreMatch();return}if((X=_e.match(/^\s+extends\s+/))&&X.index===0){Y.ignoreMatch();return}}},_={$pattern:je,keyword:Zn,literal:Yn,built_in:Jn,"variable.language":qn},h="[0-9](_?[0-9])*",b=`\\.(${h})`,S="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",R={className:"number",variants:[{begin:`(\\b(${S})((${b})|\\.)?|(${b}))[eE][+-]?(${h})\\b`},{begin:`\\b(${S})\\b((${b})\\b|\\.)?|(${b})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:_,contains:[]},y={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},U={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,N],subLanguage:"css"}},O={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},P={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,N]},H={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:c+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},Z=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,y,U,O,P,{match:/\$\d+/},R];N.contains=Z.concat({begin:/\{/,end:/\}/,keywords:_,contains:["self"].concat(Z)});const se=[].concat(H,N.contains),M=se.concat([{begin:/(\s*)\(/,end:/\)/,keywords:_,contains:["self"].concat(se)}]),V={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:_,contains:M},ce={variants:[{match:[/class/,/\s+/,c,/\s+/,/extends/,/\s+/,r.concat(c,"(",r.concat(/\./,c),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,c],scope:{1:"keyword",3:"title.class"}}]},te={relevance:0,match:r.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Xn,...jn]}},ae={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},de={variants:[{match:[/function/,/\s+/,c,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[V],illegal:/%/},Ne={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Ee(I){return r.concat("(?!",I.join("|"),")")}const he={match:r.concat(/\b/,Ee([...Vn,"super","import"].map(I=>`${I}\\s*\\(`)),c,r.lookahead(/\s*\(/)),className:"title.function",relevance:0},re={begin:r.concat(/\./,r.lookahead(r.concat(c,/(?![0-9A-Za-z$_(])/))),end:c,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Ae={match:[/get|set/,/\s+/,c,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},V]},be="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",fe={match:[/const|var|let/,/\s+/,c,/\s*/,/=\s*/,/(async\s*)?/,r.lookahead(be)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[V]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:_,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:te},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),ae,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,y,U,O,P,H,{match:/\$\d+/},R,te,{scope:"attr",match:c+r.lookahead(":"),relevance:0},fe,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[H,n.REGEXP_MODE,{className:"function",begin:be,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:_,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:w.begin,end:w.end},{match:$},{begin:A.begin,"on:begin":A.isTrulyOpeningTag,end:A.end}],subLanguage:"xml",contains:[{begin:A.begin,end:A.end,skip:!0,contains:["self"]}]}]},de,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[V,n.inherit(n.TITLE_MODE,{begin:c,className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$"+c,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[V]},he,Ne,ce,Ae,{match:/\$[(.]/}]}}function Nn(n){const r=n.regex,o=ns(n),c=je,w=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],$={begin:[/namespace/,/\s+/,n.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},A={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:w},contains:[o.exports.CLASS_REFERENCE]},_={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},h=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],b={$pattern:je,keyword:Zn.concat(h),literal:Yn,built_in:Jn.concat(w),"variable.language":qn},S={className:"meta",begin:"@"+c},R=(O,P,B)=>{const H=O.contains.findIndex(Z=>Z.label===P);if(H===-1)throw new Error("can not find mode to replace");O.contains.splice(H,1,B)};Object.assign(o.keywords,b),o.exports.PARAMS_CONTAINS.push(S);const N=o.contains.find(O=>O.scope==="attr"),y=Object.assign({},N,{match:r.concat(c,r.lookahead(/\s*\?:/))});o.exports.PARAMS_CONTAINS.push([o.exports.CLASS_REFERENCE,N,y]),o.contains=o.contains.concat([S,$,A,y]),R(o,"shebang",n.SHEBANG()),R(o,"use_strict",_);const U=o.contains.find(O=>O.label==="func.def");return U.relevance=0,Object.assign(o,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),o}function ts(n){const r={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},o={match:/[{}[\],:]/,className:"punctuation",relevance:0},c=["true","false","null"],w={scope:"literal",beginKeywords:c.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:c},contains:[r,o,n.QUOTE_STRING_MODE,w,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function ss(n){const r=n.regex,o="[a-zA-Z_][a-zA-Z0-9_.]*(!|\\?)?",c="[a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",A={$pattern:o,keyword:["after","alias","and","case","catch","cond","defstruct","defguard","do","else","end","fn","for","if","import","in","not","or","quote","raise","receive","require","reraise","rescue","try","unless","unquote","unquote_splicing","use","when","with|0"],literal:["false","nil","true"]},_={className:"subst",begin:/#\{/,end:/\}/,keywords:A},h={className:"number",begin:"(\\b0o[0-7_]+)|(\\b0b[01_]+)|(\\b0x[0-9a-fA-F_]+)|(-?\\b[0-9][0-9_]*(\\.[0-9_]+([eE][-+]?[0-9]+)?)?)",relevance:0},S={match:/\\[\s\S]/,scope:"char.escape",relevance:0},R=`[/|([{<"']`,N=[{begin:/"/,end:/"/},{begin:/'/,end:/'/},{begin:/\//,end:/\//},{begin:/\|/,end:/\|/},{begin:/\(/,end:/\)/},{begin:/\[/,end:/\]/},{begin:/\{/,end:/\}/},{begin:/</,end:/>/}],y=M=>({scope:"char.escape",begin:r.concat(/\\/,M),relevance:0}),U={className:"string",begin:"~[a-z](?="+R+")",contains:N.map(M=>n.inherit(M,{contains:[y(M.end),S,_]}))},O={className:"string",begin:"~[A-Z](?="+R+")",contains:N.map(M=>n.inherit(M,{contains:[y(M.end)]}))},P={className:"regex",variants:[{begin:"~r(?="+R+")",contains:N.map(M=>n.inherit(M,{end:r.concat(M.end,/[uismxfU]{0,7}/),contains:[y(M.end),S,_]}))},{begin:"~R(?="+R+")",contains:N.map(M=>n.inherit(M,{end:r.concat(M.end,/[uismxfU]{0,7}/),contains:[y(M.end)]}))}]},B={className:"string",contains:[n.BACKSLASH_ESCAPE,_],variants:[{begin:/"""/,end:/"""/},{begin:/'''/,end:/'''/},{begin:/~S"""/,end:/"""/,contains:[]},{begin:/~S"/,end:/"/,contains:[]},{begin:/~S'''/,end:/'''/,contains:[]},{begin:/~S'/,end:/'/,contains:[]},{begin:/'/,end:/'/},{begin:/"/,end:/"/}]},H={className:"function",beginKeywords:"def defp defmacro defmacrop",end:/\B\b/,contains:[n.inherit(n.TITLE_MODE,{begin:o,endsParent:!0})]},Z=n.inherit(H,{className:"class",beginKeywords:"defimpl defmodule defprotocol defrecord",end:/\bdo\b|$|;/}),se=[B,P,O,U,n.HASH_COMMENT_MODE,Z,H,{begin:"::"},{className:"symbol",begin:":(?![\\s:])",contains:[B,{begin:c}],relevance:0},{className:"symbol",begin:o+":(?!:)",relevance:0},{className:"title.class",begin:/(\b[A-Z][a-zA-Z0-9_]+)/,relevance:0},h,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))"}];return _.contains=se,{name:"Elixir",aliases:["ex","exs"],keywords:A,contains:se}}var Le="[0-9](_*[0-9])*",ze=`\\.(${Le})`,We="[0-9a-fA-F](_*[0-9a-fA-F])*",Pn={className:"number",variants:[{begin:`(\\b(${Le})((${ze})|\\.)?|(${ze}))[eE][+-]?(${Le})[fFdD]?\\b`},{begin:`\\b(${Le})((${ze})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${ze})[fFdD]?\\b`},{begin:`\\b(${Le})[fFdD]\\b`},{begin:`\\b0[xX]((${We})\\.?|(${We})?\\.(${We}))[pP][+-]?(${Le})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${We})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Qn(n,r,o){return o===-1?"":n.replace(r,c=>Qn(n,r,o-1))}function as(n){const r=n.regex,o="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",c=o+Qn("(?:<"+o+"~~~(?:\\s*,\\s*"+o+"~~~)*>)?",/~~~/g,2),h={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},b={className:"meta",begin:"@"+o,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},S={className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:h,illegal:/<\/|#/,contains:[n.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[n.BACKSLASH_ESCAPE]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,o],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[r.concat(/(?!else)/,o),/\s+/,o,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,o],className:{1:"keyword",3:"title.class"},contains:[S,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+c+"\\s+)",n.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:h,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[b,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,Pn,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},Pn,b]}}function et(n){return n?typeof n=="string"?n:n.source:null}function ke(n){return x("(?=",n,")")}function x(...n){return n.map(o=>et(o)).join("")}function is(n){const r=n[n.length-1];return typeof r=="object"&&r.constructor===Object?(n.splice(n.length-1,1),r):{}}function ne(...n){return"("+(is(n).capture?"":"?:")+n.map(c=>et(c)).join("|")+")"}const hn=n=>x(/\b/,n,/\w$/.test(n)?/\b/:/\B/),rs=["Protocol","Type"].map(hn),Fn=["init","self"].map(hn),cs=["Any","Self"],bn=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Kn=["false","nil","true"],os=["assignment","associativity","higherThan","left","lowerThan","none","right"],ls=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Gn=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],nt=ne(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),tt=ne(nt,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),fn=x(nt,tt,"*"),st=ne(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Ve=ne(st,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ge=x(st,Ve,"*"),Ze=x(/[A-Z]/,Ve,"*"),us=["attached","autoclosure",x(/convention\(/,ne("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",x(/objc\(/,ge,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],gs=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function ds(n){const r={match:/\s+/,relevance:0},o=n.COMMENT("/\\*","\\*/",{contains:["self"]}),c=[n.C_LINE_COMMENT_MODE,o],w={match:[/\./,ne(...rs,...Fn)],className:{2:"keyword"}},$={match:x(/\./,ne(...bn)),relevance:0},A=bn.filter(L=>typeof L=="string").concat(["_|0"]),_=bn.filter(L=>typeof L!="string").concat(cs).map(hn),h={variants:[{className:"keyword",match:ne(..._,...Fn)}]},b={$pattern:ne(/\b\w+/,/#\w+/),keyword:A.concat(ls),literal:Kn},S=[w,$,h],R={match:x(/\./,ne(...Gn)),relevance:0},N={className:"built_in",match:x(/\b/,ne(...Gn),/(?=\()/)},y=[R,N],U={match:/->/,relevance:0},O={className:"operator",relevance:0,variants:[{match:fn},{match:`\\.(\\.|${tt})+`}]},P=[U,O],B="([0-9]_*)+",H="([0-9a-fA-F]_*)+",Z={className:"number",relevance:0,variants:[{match:`\\b(${B})(\\.(${B}))?([eE][+-]?(${B}))?\\b`},{match:`\\b0x(${H})(\\.(${H}))?([pP][+-]?(${B}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},se=(L="")=>({className:"subst",variants:[{match:x(/\\/,L,/[0\\tnr"']/)},{match:x(/\\/,L,/u\{[0-9a-fA-F]{1,8}\}/)}]}),M=(L="")=>({className:"subst",match:x(/\\/,L,/[\t ]*(?:[\r\n]|\r\n)/)}),V=(L="")=>({className:"subst",label:"interpol",begin:x(/\\/,L,/\(/),end:/\)/}),ce=(L="")=>({begin:x(L,/"""/),end:x(/"""/,L),contains:[se(L),M(L),V(L)]}),te=(L="")=>({begin:x(L,/"/),end:x(/"/,L),contains:[se(L),V(L)]}),ae={className:"string",variants:[ce(),ce("#"),ce("##"),ce("###"),te(),te("#"),te("##"),te("###")]},de=[n.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[n.BACKSLASH_ESCAPE]}],Ne={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:de},Ee=L=>{const Ie=x(L,/\//),Re=x(/\//,L);return{begin:Ie,end:Re,contains:[...de,{scope:"comment",begin:`#(?!.*${Re})`,end:/$/}]}},he={scope:"regexp",variants:[Ee("###"),Ee("##"),Ee("#"),Ne]},re={match:x(/`/,ge,/`/)},Ae={className:"variable",match:/\$\d+/},be={className:"variable",match:`\\$${Ve}+`},fe=[re,Ae,be],I={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:gs,contains:[...P,Z,ae]}]}},Y={scope:"keyword",match:x(/@/,ne(...us),ke(ne(/\(/,/\s+/)))},ee={scope:"meta",match:x(/@/,ge)},q=[I,Y,ee],X={match:ke(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:x(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Ve,"+")},{className:"type",match:Ze,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:x(/\s+&\s+/,ke(Ze)),relevance:0}]},_e={begin:/</,end:/>/,keywords:b,contains:[...c,...S,...q,U,X]};X.contains.push(_e);const qe={match:x(ge,/\s*:/),keywords:"_|0",relevance:0},Be={begin:/\(/,end:/\)/,relevance:0,keywords:b,contains:["self",qe,...c,he,...S,...y,...P,Z,ae,...fe,...q,X]},ve={begin:/</,end:/>/,keywords:"repeat each",contains:[...c,X]},Je={begin:ne(ke(x(ge,/\s*:/)),ke(x(ge,/\s+/,ge,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:ge}]},$e={begin:/\(/,end:/\)/,keywords:b,contains:[Je,...c,...S,...P,Z,ae,...q,X,Be],endsParent:!0,illegal:/["']/},Sn={match:[/(func|macro)/,/\s+/,ne(re.match,ge,fn)],className:{1:"keyword",3:"title.function"},contains:[ve,$e,r],illegal:[/\[/,/%/]},Oe={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ve,$e,r],illegal:/\[|%/},Qe={match:[/operator/,/\s+/,fn],className:{1:"keyword",3:"title"}},en={begin:[/precedencegroup/,/\s+/,Ze],className:{1:"keyword",3:"title"},contains:[X],keywords:[...os,...Kn],end:/}/},nn={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},tn={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},sn={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,ge,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:b,contains:[ve,...S,{begin:/:/,end:/\{/,keywords:b,contains:[{scope:"title.class.inherited",match:Ze},...S],relevance:0}]};for(const L of ae.variants){const Ie=L.contains.find(an=>an.label==="interpol");Ie.keywords=b;const Re=[...S,...y,...P,Z,ae,...fe];Ie.contains=[...Re,{begin:/\(/,end:/\)/,contains:["self",...Re]}]}return{name:"Swift",keywords:b,contains:[...c,Sn,Oe,nn,tn,sn,Qe,en,{beginKeywords:"import",end:/$/,contains:[...c],relevance:0},he,...S,...y,...P,Z,ae,...fe,...q,X,Be]}}function at(n){const r={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},o=/[a-zA-Z@][a-zA-Z0-9_]*/,_={"variable.language":["this","super"],$pattern:o,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},h={$pattern:o,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:_,illegal:"</",contains:[r,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,n.C_NUMBER_MODE,n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(n.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+h.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:h,contains:[n.UNDERSCORE_TITLE_MODE]},{begin:"\\."+n.UNDERSCORE_IDENT_RE,relevance:0}]}}var xe="[0-9](_*[0-9])*",Ye=`\\.(${xe})`,Xe="[0-9a-fA-F](_*[0-9a-fA-F])*",Es={className:"number",variants:[{begin:`(\\b(${xe})((${Ye})|\\.)?|(${Ye}))[eE][+-]?(${xe})[fFdD]?\\b`},{begin:`\\b(${xe})((${Ye})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ye})[fFdD]?\\b`},{begin:`\\b(${xe})[fFdD]\\b`},{begin:`\\b0[xX]((${Xe})\\.?|(${Xe})?\\.(${Xe}))[pP][+-]?(${xe})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Xe})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function it(n){const r={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},o={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},c={className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"@"},w={className:"subst",begin:/\$\{/,end:/\}/,contains:[n.C_NUMBER_MODE]},$={className:"variable",begin:"\\$"+n.UNDERSCORE_IDENT_RE},A={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[$,w]},{begin:"'",end:"'",illegal:/\n/,contains:[n.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[n.BACKSLASH_ESCAPE,$,w]}]};w.contains.push(A);const _={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+n.UNDERSCORE_IDENT_RE+")?"},h={className:"meta",begin:"@"+n.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[n.inherit(A,{className:"string"}),"self"]}]},b=Es,S=n.COMMENT("/\\*","\\*/",{contains:[n.C_BLOCK_COMMENT_MODE]}),R={variants:[{className:"type",begin:n.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},N=R;return N.variants[1].contains=[R],R.variants[1].contains=[N],{name:"Kotlin",aliases:["kt","kts"],keywords:r,contains:[n.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),n.C_LINE_COMMENT_MODE,S,o,c,_,h,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:r,relevance:5,contains:[{begin:n.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[n.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:r,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[R,n.C_LINE_COMMENT_MODE,S],relevance:0},n.C_LINE_COMMENT_MODE,S,_,h,A,n.C_NUMBER_MODE]},S]},{begin:[/class|interface|trait/,/\s+/,n.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},n.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},_,h]},A,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
4
4
|
`},b]}}function rt(n){const r=["package","import","option","optional","required","repeated","group","oneof"],o=["double","float","int32","int64","uint32","uint64","sint32","sint64","fixed32","fixed64","sfixed32","sfixed64","bool","string","bytes"],c={match:[/(message|enum|service)\s+/,n.IDENT_RE],scope:{1:"keyword",2:"title.class"}};return{name:"Protocol Buffers",aliases:["proto"],keywords:{keyword:r,type:o,literal:["true","false"]},contains:[n.QUOTE_STRING_MODE,n.NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,c,{className:"function",beginKeywords:"rpc",end:/[{;]/,excludeEnd:!0,keywords:"rpc returns"},{begin:/^\s*[A-Z_]+(?=\s*=[^\n]+;$)/}]}}function ct(n){const r=n.regex,o=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),c=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],_={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:c,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},h={className:"meta",begin:/^(>>>|\.\.\.) /},b={className:"subst",begin:/\{/,end:/\}/,keywords:_,illegal:/#/},S={begin:/\{\{/,relevance:0},R={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,h,S,b]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,h,S,b]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[n.BACKSLASH_ESCAPE,S,b]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,S,b]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},N="[0-9](_?[0-9])*",y=`(\\b(${N}))?\\.(${N})|\\b(${N})\\.`,U=`\\b|${c.join("|")}`,O={className:"number",relevance:0,variants:[{begin:`(\\b(${N})|(${y}))[eE][+-]?(${N})[jJ]?(?=${U})`},{begin:`(${y})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${U})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${U})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${U})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${U})`},{begin:`\\b(${N})[jJ](?=${U})`}]},P={className:"comment",begin:r.lookahead(/# type:/),end:/$/,keywords:_,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},B={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:_,contains:["self",h,O,R,n.HASH_COMMENT_MODE]}]};return b.contains=[R,O,h],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:_,illegal:/(<\/|\?)|=>/,contains:[h,O,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},R,P,n.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,o],scope:{1:"keyword",3:"title.function"},contains:[B]},{variants:[{match:[/\bclass/,/\s+/,o,/\s*/,/\(\s*/,o,/\s*\)/]},{match:[/\bclass/,/\s+/,o]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[O,B,R]}]}}function ot(n){const r="true false yes no null",o="[\\w#;/?:@&=+$,.~*'()[\\]]+",c={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},w={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},$={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},A={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[n.BACKSLASH_ESCAPE,w]},_=n.inherit(A,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),N={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},y={end:",",endsWithParent:!0,excludeEnd:!0,keywords:r,relevance:0},U={begin:/\{/,end:/\}/,contains:[y],illegal:"\\n",relevance:0},O={begin:"\\[",end:"\\]",contains:[y],illegal:"\\n",relevance:0},P=[c,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+o},{className:"type",begin:"!<"+o+">"},{className:"type",begin:"!"+o},{className:"type",begin:"!!"+o},{className:"meta",begin:"&"+n.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+n.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},n.HASH_COMMENT_MODE,{beginKeywords:r,keywords:{literal:r}},N,{className:"number",begin:n.C_NUMBER_RE+"\\b",relevance:0},U,O,$,A],B=[...P];return B.pop(),B.push(_),y.contains=B,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:P}}function lt(n){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function ut(n){const r=n.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:r.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:r.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function gt(n){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function bs(n){const r=n.regex,o={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},c={begin:"^[-\\*]{3,}",end:"$"},w={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},$={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},A={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},_=/[A-Za-z][A-Za-z0-9+.-]*/,h={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:r.concat(/\[.+?\]\(/,_,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},b={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},S={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},R=n.inherit(b,{contains:[]}),N=n.inherit(S,{contains:[]});b.contains.push(N),S.contains.push(R);let y=[o,h];return[b,S,R,N].forEach(B=>{B.contains=B.contains.concat(y)}),y=y.concat(b,S),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:y},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:y}]}]},o,$,b,S,{className:"quote",begin:"^>\\s+",contains:y,end:"$"},w,c,h,A,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}const fs=Ht("div")`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bX as Ge,bW as Fe,r as h,bY as Ke,j as e,b8 as ee,b_ as Ye,cb as J,b$ as $e,bU as He,cd as qe,aG as he,O as q,bn as A,cq as Ce,H as B,Y as V,bf as E,fB as we,aQ as Be,b as N,j1 as Ve,m as D,gz as Qe,o as m,x as Xe,ax as De,y as fe,al as Ze,g as Je,C as U,T as j,i as et,s as tt,f as st,j2 as X,hY as Z,j3 as ot,N as S,aV as G,E as T,L as nt,p as H,dk as at,az as Se,U as K,aF as Y,a9 as $,a5 as rt,dH as it,gp as ct,a$ as lt,v as pe,w as dt,G as be,Z as Ee,by as xe,B as pt}from"./index-CI0UsYER.js";import{T as ut}from"./html-title-CZ5JcCBv.js";import{u as L}from"./blocklet-Ho3KwOsh.js";import{u as mt}from"./use-mobile-DOyOocoE.js";import{c as Ie,d as ft,e as xt,f as gt,g as ue,h as ht,b as St,u as yt,C as bt,D as kt,a as jt}from"./connect-to-B-eSBX-W.js";import"./index-r8P2C1jY.js";import"./index-BojVbZw0.js";import"./api-YN3oror6.js";import{d as Ct,a as wt,g as Bt,i as Dt,e as ge,f as Et,h as It,j as Tt}from"./spaces-DLMhU3hk.js";import{v as Rt}from"./index-BcBAaNDP.js";import{E as zt}from"./index-CeFaduiH.js";import{H as vt}from"./HelpOutline-lBsTb1UP.js";import{H as Pt}from"./index-D3pkr7vY.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Ut}from"./actions-rW-FK_P1.js";import{D as Lt}from"./DeleteOutline-Ck93qCLA.js";import{g as ke}from"./get-safe-url-904a-sst.js";import{S as Ot}from"./switch-control-BcyytepR.js";import{L as je}from"./list-header-BDHTrIR7.js";import"./OpenInNew-xMrJenFO.js";import"./ButtonGroup-NHFraP5W.js";import"./getValidReactChildren-CuqzhDUA.js";import"./FilterList-CKBf2Vv9.js";import"./CSSTransition-C1WKDxhV.js";import"./emotion-cache.browser.esm-DCbFVNUX.js";import"./index-Lr_zCh3w.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-CDHvTR0w.js";import"./index-CKMXkLAj.js";import"./TableSearch-CsIYJ-Mc.js";import"./Search-DCwzmPfi.js";import"./Clear-x8R7nP_3.js";import"./MoreVert-VfUY7lzP.js";import"./useLocalStorage-DwEccSW6.js";import"./url-evaluation-CtukTo4p.js";import"./permission-C38ouogl.js";import"./Switch-1ujfhKkZ.js";function Mt(t){return Ge("MuiIcon",t)}Fe("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:s,fontSize:n,classes:o}=t,r={root:["root",s!=="inherit"&&`color${J(s)}`,`fontSize${J(n)}`]};return $e(r,Mt,o)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${J(n.color)}`],s[`fontSize${J(n.fontSize)}`]]}})(He(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(qe()).map(([s])=>({props:{color:s},style:{color:(t.vars||t).palette[s].main}}))]}))),ye=h.forwardRef(function(s,n){const o=Ke({props:s,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:c="inherit",component:i="span",fontSize:d="medium",...l}=o,p={...o,baseClassName:r,color:c,component:i,fontSize:d},f=Nt(p);return e.jsx(_t,{as:i,className:Ye(r,"notranslate",f.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Gt=he(e.jsx("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"})),Ft=he(e.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}));async function Kt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const r=await Promise.all(n.map(async a=>{let{name:c}=a;const i=await Ct(a.endpoint);return!q(i)&&i!==c&&(c=i,o=!0),{...a,name:c}}));return o&&await Promise.all(r.filter(a=>a.did).map(a=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function Yt({refresh:t}={}){const{blocklet:s}=L(),n=s?.meta?.did,{api:o}=A();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Kt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Te({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:o}=L(),[r,a]=h.useState([]),{api:c}=A(),[i,d]=h.useMemo(()=>n?[E(n).startOf("day").toISOString(),E(n).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[n]),l=we(async()=>{try{if(s(!0),!o){a([]);return}const{backups:p}=await c.getBlockletBackups({input:{did:o.meta.did,startTime:i,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{s(!1)}},1e3);return Be(async()=>{l()},[o?.meta?.did].concat(t)),{backups:r}}function $t({appDid:t}){const{backups:s}=Te(),[n,o]=h.useState({message:"",progress:0,completed:!1}),r=A(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&o(()=>({...c}))},[t]),h.useEffect(()=>{if(s?.length&&Ve(s[0]?.status)){const[c]=s;o(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[s]),n}function Ht({deps:t=[],setLoading:s=()=>{}}={}){const{blocklet:n}=L(),[o,r]=h.useState([]),{api:a}=A(),c=h.useCallback(we(async()=>{if(!a||!n?.meta?.did){r([]);return}try{s(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(V(i)),r([])}finally{s(!1)}},1e3),[]);return Be(async()=>(await c(),()=>{c.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:o}}const Re=h.createContext({}),{Provider:qt,Consumer:$s}=Re;function ze({children:t}){const{t:s}=D(),{api:n}=A(),{blocklet:o}=L(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=Yt({refresh:c}),f=Qe(d),x=$t({appDid:o?.appDid}),u=h.useMemo(()=>wt(o?.environments),[o?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(0),{backups:te}=Te({deps:[y,r],setLoading:w,backupDate:r}),[se,oe]=h.useState(0),{backupSummary:ne}=Ht({deps:[se]}),[_,M]=h.useState(d?.find(g=>g.endpoint===u)),I=o?.settings?.autoBackup,z=()=>{i(g=>!g)},ae=()=>{oe(g=>g+1)},re=()=>{b(g=>g+1)},F=async g=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},ie=async(g,P)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:g}}),u!==P&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:P}]}}),M(g),z(),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===u&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await F({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:g?.did}}),p(P=>{const R=[...P];return R.splice(R.indexOf(g),1),R}),M(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:g.did},spaceGateway:g}}),u!==g.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===u;return e.jsx(qt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:f,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:u,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:m.any.isRequired};function O(){return h.useContext(Re)}function ve({...t}){const{blocklet:s}=L(),{info:n}=A(),{t:o}=D(),r=Ie({blocklet:s}),a=Xe(n),{spaceGateways:c,addSpaceGateway:i}=O(),d={checkFn:De.create({baseURL:fe(window.location.origin,Ze())}).get,webWalletUrl:a,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:f,name:x,did:u})=>{const k=await Bt(f);if(!await Dt(k)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===f)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:u,url:k,endpoint:f},f)},p=async({spaceGateway:f})=>{try{await l(f)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function Vt(){const{api:t}=A(),{blocklet:s}=L(),{data:n,loading:o}=Ce(()=>t.getBlocklet({input:{did:s?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!s?.meta?.did,refreshDeps:[s?.meta?.did]});return{blocklet:n?.blocklet??null,loading:o}}function Pe({...t}){const{t:s}=h.useContext(Je),{blocklet:n,loading:o}=Vt();if(n?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?et(d):"empty"})]}),a=n.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:c.map(i=>e.jsx(Rt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return o?e.jsx(U,{}):e.jsx(j,{children:s("blocklet.diskInfo.empty")})}const Qt=tt(j)``;function Ae(){const{t}=D(),{setBackupDate:s,backupSummary:n}=O(),o=xt({key:"lg"}),r=h.useRef(null),a=st(),c=h.useCallback(l=>{s(l)},[s]),i=h.useMemo(()=>{const l=E().add(1,"day"),p=l.subtract(1,"year"),f=new Map(n.map(u=>[u.date,{date:u.date,successCount:u.successCount,errorCount:u.errorCount}])),x=[];for(let u=p.clone();E(u).isBefore(l);u=u.add(1,"day")){const k=u.format("YYYY-MM-DD");x.push(f.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
|
|
1
|
+
import{bX as Ge,bW as Fe,r as h,bY as Ke,j as e,b8 as ee,b_ as Ye,cb as J,b$ as $e,bU as He,cd as qe,aG as he,O as q,bn as A,cq as Ce,H as B,Y as V,bf as E,fB as we,aQ as Be,b as N,j1 as Ve,m as D,gz as Qe,o as m,x as Xe,ax as De,y as fe,al as Ze,g as Je,C as U,T as j,i as et,s as tt,f as st,j2 as X,hY as Z,j3 as ot,N as S,aV as G,E as T,L as nt,p as H,dk as at,az as Se,U as K,aF as Y,a9 as $,a5 as rt,dH as it,gp as ct,a$ as lt,v as pe,w as dt,G as be,Z as Ee,by as xe,B as pt}from"./index-CXlxISJm.js";import{T as ut}from"./html-title-CtlwTzdI.js";import{u as L}from"./blocklet-C6bd2myO.js";import{u as mt}from"./use-mobile-DBs2owXM.js";import{c as Ie,d as ft,e as xt,f as gt,g as ue,h as ht,b as St,u as yt,C as bt,D as kt,a as jt}from"./connect-to-D65DGbGc.js";import"./index-BSxNuPI0.js";import"./index-BojVbZw0.js";import"./api-C4w9OiM_.js";import{d as Ct,a as wt,g as Bt,i as Dt,e as ge,f as Et,h as It,j as Tt}from"./spaces-BfcMTlVB.js";import{v as Rt}from"./index-p7oyunUI.js";import{E as zt}from"./index-DoM0FAgW.js";import{H as vt}from"./HelpOutline-m7SXfzOy.js";import{H as Pt}from"./index-DuLB6_RW.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Ut}from"./actions-CLb0GGR8.js";import{D as Lt}from"./DeleteOutline-DYK84p9_.js";import{g as ke}from"./get-safe-url-BZPuwo0t.js";import{S as Ot}from"./switch-control-DAzOmGCO.js";import{L as je}from"./list-header-DLL9O6AN.js";import"./OpenInNew-D1xbr9fL.js";import"./ButtonGroup-CzJqsZx8.js";import"./getValidReactChildren-Co_911RX.js";import"./FilterList-D1yaw7tY.js";import"./CSSTransition-BTfwW2gn.js";import"./emotion-cache.browser.esm-B3UY0bD4.js";import"./index-DEQqo1fm.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-DwyxBTdu.js";import"./index-DUnAi0dd.js";import"./TableSearch-BUnFBfBF.js";import"./Search-TSAjl9vN.js";import"./Clear-CfyYd-Do.js";import"./MoreVert-D4bCXde_.js";import"./useLocalStorage-BUqQ3nyo.js";import"./url-evaluation-BHSXGj_2.js";import"./permission-lTvpziGW.js";import"./Switch-WcceZP-X.js";function Mt(t){return Ge("MuiIcon",t)}Fe("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:s,fontSize:n,classes:o}=t,r={root:["root",s!=="inherit"&&`color${J(s)}`,`fontSize${J(n)}`]};return $e(r,Mt,o)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${J(n.color)}`],s[`fontSize${J(n.fontSize)}`]]}})(He(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(qe()).map(([s])=>({props:{color:s},style:{color:(t.vars||t).palette[s].main}}))]}))),ye=h.forwardRef(function(s,n){const o=Ke({props:s,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:c="inherit",component:i="span",fontSize:d="medium",...l}=o,p={...o,baseClassName:r,color:c,component:i,fontSize:d},f=Nt(p);return e.jsx(_t,{as:i,className:Ye(r,"notranslate",f.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Gt=he(e.jsx("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"})),Ft=he(e.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}));async function Kt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const r=await Promise.all(n.map(async a=>{let{name:c}=a;const i=await Ct(a.endpoint);return!q(i)&&i!==c&&(c=i,o=!0),{...a,name:c}}));return o&&await Promise.all(r.filter(a=>a.did).map(a=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function Yt({refresh:t}={}){const{blocklet:s}=L(),n=s?.meta?.did,{api:o}=A();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Kt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Te({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:o}=L(),[r,a]=h.useState([]),{api:c}=A(),[i,d]=h.useMemo(()=>n?[E(n).startOf("day").toISOString(),E(n).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[n]),l=we(async()=>{try{if(s(!0),!o){a([]);return}const{backups:p}=await c.getBlockletBackups({input:{did:o.meta.did,startTime:i,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{s(!1)}},1e3);return Be(async()=>{l()},[o?.meta?.did].concat(t)),{backups:r}}function $t({appDid:t}){const{backups:s}=Te(),[n,o]=h.useState({message:"",progress:0,completed:!1}),r=A(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&o(()=>({...c}))},[t]),h.useEffect(()=>{if(s?.length&&Ve(s[0]?.status)){const[c]=s;o(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[s]),n}function Ht({deps:t=[],setLoading:s=()=>{}}={}){const{blocklet:n}=L(),[o,r]=h.useState([]),{api:a}=A(),c=h.useCallback(we(async()=>{if(!a||!n?.meta?.did){r([]);return}try{s(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(V(i)),r([])}finally{s(!1)}},1e3),[]);return Be(async()=>(await c(),()=>{c.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:o}}const Re=h.createContext({}),{Provider:qt,Consumer:$s}=Re;function ze({children:t}){const{t:s}=D(),{api:n}=A(),{blocklet:o}=L(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=Yt({refresh:c}),f=Qe(d),x=$t({appDid:o?.appDid}),u=h.useMemo(()=>wt(o?.environments),[o?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(0),{backups:te}=Te({deps:[y,r],setLoading:w,backupDate:r}),[se,oe]=h.useState(0),{backupSummary:ne}=Ht({deps:[se]}),[_,M]=h.useState(d?.find(g=>g.endpoint===u)),I=o?.settings?.autoBackup,z=()=>{i(g=>!g)},ae=()=>{oe(g=>g+1)},re=()=>{b(g=>g+1)},F=async g=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},ie=async(g,P)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:g}}),u!==P&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:P}]}}),M(g),z(),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===u&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await F({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:g?.did}}),p(P=>{const R=[...P];return R.splice(R.indexOf(g),1),R}),M(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:g.did},spaceGateway:g}}),u!==g.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===u;return e.jsx(qt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:f,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:u,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:m.any.isRequired};function O(){return h.useContext(Re)}function ve({...t}){const{blocklet:s}=L(),{info:n}=A(),{t:o}=D(),r=Ie({blocklet:s}),a=Xe(n),{spaceGateways:c,addSpaceGateway:i}=O(),d={checkFn:De.create({baseURL:fe(window.location.origin,Ze())}).get,webWalletUrl:a,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:f,name:x,did:u})=>{const k=await Bt(f);if(!await Dt(k)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===f)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:u,url:k,endpoint:f},f)},p=async({spaceGateway:f})=>{try{await l(f)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function Vt(){const{api:t}=A(),{blocklet:s}=L(),{data:n,loading:o}=Ce(()=>t.getBlocklet({input:{did:s?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!s?.meta?.did,refreshDeps:[s?.meta?.did]});return{blocklet:n?.blocklet??null,loading:o}}function Pe({...t}){const{t:s}=h.useContext(Je),{blocklet:n,loading:o}=Vt();if(n?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?et(d):"empty"})]}),a=n.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:c.map(i=>e.jsx(Rt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return o?e.jsx(U,{}):e.jsx(j,{children:s("blocklet.diskInfo.empty")})}const Qt=tt(j)``;function Ae(){const{t}=D(),{setBackupDate:s,backupSummary:n}=O(),o=xt({key:"lg"}),r=h.useRef(null),a=st(),c=h.useCallback(l=>{s(l)},[s]),i=h.useMemo(()=>{const l=E().add(1,"day"),p=l.subtract(1,"year"),f=new Map(n.map(u=>[u.date,{date:u.date,successCount:u.successCount,errorCount:u.errorCount}])),x=[];for(let u=p.clone();E(u).isBefore(l);u=u.add(1,"day")){const k=u.format("YYYY-MM-DD");x.push(f.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
|
|
2
2
|
`)},backgroundColor:a.palette.background.paper,borderColor:a.palette.divider,textStyle:{color:a.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${a.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:X[600]},{min:-9,max:-6,color:X[500]},{min:-6,max:-3,color:X[400]},{min:-3,max:-1,color:X[300]},{min:0,max:0,color:a.palette.grey[200]},{min:1,max:3,color:Z[300]},{min:3,max:6,color:Z[400]},{min:6,max:9,color:Z[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:Z[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:a.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,color:a.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:a.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:a.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[E().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),E().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:i.map(k=>[k.date,k.errorCount?-k.errorCount:k.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:ot[200],color:"inherit"}}}}),[i,t,a]);return e.jsxs(e.Fragment,{children:[e.jsx(S,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(S,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(zt,{option:d,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&c(l.data[0])}}})})}),e.jsx(S,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:o?2:5,mb:2},children:e.jsxs(G,{direction:o?"column":"row",spacing:o?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:o?"flex-start":"center"},children:[e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.failed")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.without")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.succeeded")})]})]})})]})}const Xt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Ue({status:t,message:s="",createdAt:n}){const{t:o}=D(),r=t===T.BACKUPS.STATUS.PROGRESS&&E().diff(n,"hours")>=T.BACKUPS.TIMEOUT_HOURS,a=r&&o("common.timeoutError"),c=t===T.BACKUPS.STATUS.PROGRESS&&!r,i=t===T.BACKUPS.STATUS.SUCCEEDED&&!r;return c?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(U,{sx:{marginRight:"4px"},size:"12px"}),o("common.progress")]}):i?e.jsx(H,{type:"success",children:o("common.succeeded")}):e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"error",children:o("common.failed")}),e.jsx(Se,{style:{display:"flex",alignItems:"center",flexShrink:0},title:s||a,children:e.jsx(ye,{children:e.jsx(vt,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Ue.propTypes={status:m.string.isRequired,message:m.string,createdAt:m.string.isRequired};function Le({metadata:t={}}){const{t:s}=D();if(q(t))return e.jsx(H,{type:"success",children:s("common.succeeded")});const n=t.count||0,o=t.size||0,r=At(o,{iec:!0}),a=e.jsxs(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[s("common.fileCount"),": ",n]}),e.jsxs(j,{variant:"body2",children:[s("common.fileSize"),": ",r]})]});return e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"success",children:s("common.succeeded")}),e.jsx(Xt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(ye,{children:e.jsx(at,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}Le.propTypes={metadata:m.object};function Oe(){const{t,locale:s}=D(),{spaceGateways:n,backups:o,backupsLoading:r}=O(),a=h.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:i=>{const{targetUrl:d,targetName:l,status:p,createdAt:f}=o[i],x=p===T.BACKUPS.STATUS.PROGRESS&&E().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,u=p===T.BACKUPS.STATUS.SUCCEEDED&&!x,k=l||n.find(w=>d?.includes(ge(w?.endpoint)))?.name||"Unknown DID Space";return u?e.jsx(nt,{href:d,target:"_blank",sx:{fontSize:"16px"},children:k}):e.jsx(j,{variant:"body1",sx:{fontSize:"16px"},children:k})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:i=>{const d=t(i===0?"common.auto":"common.manual");return e.jsx(H,{children:d})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:i=>E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:i=>q(i)?"":E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:i=>{const d=o?.[i]??{},{status:l,message:p,createdAt:f,metadata:x}=d,u=l===T.BACKUPS.STATUS.PROGRESS&&E().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,k=l===T.BACKUPS.STATUS.PROGRESS&&!u,w=l===T.BACKUPS.STATUS.SUCCEEDED&&!u;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(U,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(Le,{metadata:x}):e.jsx(Ue,{status:l,message:p,createdAt:f})}}}],[o,n,t]),c=h.useMemo(()=>!o?.length,[o]);return e.jsx(e.Fragment,{children:c?e.jsx(S,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(Pt,{title:"",loading:r,data:o,columns:a,emptyNode:t("storage.spaces.record.emptyData",s),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function Zt(){const{t}=D();return e.jsxs(S,{children:[e.jsxs(S,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(gt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(j,{sx:{my:2,textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(ve,{})]}),e.jsxs(S,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.spaces.backup.records")})}),e.jsx(Ae,{})]})]}),e.jsx(Oe,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function Me({spaceGateway:t,onConfirm:s=()=>{},onCancel:n=()=>{}}){const{t:o}=D(),[r,a]=h.useState(!1),[c,i]=h.useState(!1),d=(f,x)=>{f?.preventDefault(),f?.stopPropagation(),a(x)},l=async f=>{try{f?.stopPropagation(),i(!0),await s?.(t),a(!1)}catch(x){console.error(x),B.error(`${o("storage.space.gateway.delete.failed")}: ${V(x)}`)}finally{a(!1),i(!1)}},p=f=>{d(f,!1),n?.(f)};return e.jsxs(e.Fragment,{children:[e.jsxs(K,{color:"red",onClick:f=>d(f,!0),children:[e.jsx(Y,{style:{minWidth:24,color:"red"},children:e.jsx(Lt,{fontSize:"small"})}),e.jsx($,{style:{color:"red"},children:o("common.disconnect")})]}),e.jsx(rt,{title:o("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:o("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:c}},cancelButton:{text:o("common.cancel"),props:{size:"small",variant:"outlined",disabled:c}},onConfirm:l,onCancel:p,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:o("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}Me.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool}).isRequired,onConfirm:m.func,onCancel:m.func};function Ne({spaceGateway:t,selected:s,onDelete:n=()=>{},onConnect:o=()=>{},enableSwitchToSpace:r=!0,backupInProgress:a=!1,...c}){const{abortBlockletBackup:i}=O(),[d,l]=h.useState(null),{t:p}=D(),[f,x]=h.useState(!1),u=(y,b)=>{y.stopPropagation(),y.preventDefault(),l(b&&y.currentTarget)},k=async y=>{try{x(!0),u(y,!1),await o(t)}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}},w=async y=>{try{x(!0),u(y,!1),await i()}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}};return e.jsxs(e.Fragment,{children:[f||t?.loading?e.jsx(U,{sx:{ml:1},size:"24px"}):e.jsx(it,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:y=>u(y,!0),...c,children:e.jsx(ct,{})}),e.jsxs(lt,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:y=>u(y,!1),children:[e.jsxs(K,{onClick:y=>{u(y,!1),window.open(ke(t.endpoint?Et(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Wt,{fontSize:"small"})}),e.jsx($,{children:p("common.open")})]}),e.jsxs(K,{onClick:y=>{u(y,!1),window.open(ke(It(t.endpoint),{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ft,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.strategy.viewBackupFiles")})]}),!s&&r&&e.jsxs(K,{onClick:k,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Gt,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(K,{onClick:w,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ut,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Me,{spaceGateway:t,onConfirm:async()=>{l(null),await n?.(t)},onCancel:()=>l(null)})]})]})}Ne.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool,endpoint:m.string.isRequired,loading:m.bool}).isRequired,selected:m.bool.isRequired,enableSwitchToSpace:m.bool,onDelete:m.func,onConnect:m.func,backupInProgress:m.bool};const Jt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function _e({spaceGateway:t,spaceStatus:s,selected:n,onConnected:o=()=>{},onDeleted:r=()=>{},onBackedUp:a=()=>{}}){const{t:c,locale:i}=D(),{blocklet:d}=L(),{api:l,info:{did:p}}=A(),{appDid:f,appName:x,appDescription:u,scopes:k,appUrl:w,referrer:y}=Ie({blocklet:d}),{backupProgress:b,updateSpaceGateway:te,deleteSpaceGateway:se,refreshBackupSummary:oe,refreshBackups:ne}=O(),[_,M]=h.useState(!1),[I,z]=h.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:c("storage.spaces.authorize.title",{appName:x},i),scan:c("storage.spaces.authorize.scan",{appName:x},i),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:c("storage.spaces.authorize.success")})},onClose:()=>{z(C=>({...C,open:!1}))}}),ae=n&&!_&&s===ue.DISCONNECTED,re=n&&!_&&!t.loading&&s===ue.CONNECTED,F=n&&_&&s===ue.CONNECTED&&b?.progress>=0,Q=async()=>{try{if(await Tt(t?.endpoint)){await l.configBlocklet({input:{did:[d.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(c("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),o?.(null,t);return}}catch(C){console.error(C),o?.(C,t);return}z(C=>({...C,open:!0,prefix:fe(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:De.create({baseURL:fe(t.url,"space")}).get,extraParams:{appDid:f,appName:x,appDescription:u,scopes:k,appUrl:w,referrer:y,nodeDid:p,spaceDid:t.did}}))},ie=async(C,g)=>{const P=g(C.endpoint),R=ge(P),v=C.space?g(C.space):{};if(t.did&&R!==t.did){z(We=>({...We,open:!1}));const W=c("storage.spaces.gateway.switch.failedForMismatchSpace",{name:v?.name?v.name:""});B.error(W),o?.(new Error(W),t);return}const de={...t,name:v.name??"DID Space",did:v.did??ge(P),endpoint:P};await te(de),z(W=>({...W,open:!1})),o?.(null,de)},ce=async()=>{try{if(_)return;M(!0),await l.backupBlocklet({input:{appDid:d.appDid,to:"spaces"}})}catch(C){console.error(C),B.error(C.message),a?.(C,t)}finally{M(!0)}},le=async()=>{try{await se(t),B.success(c("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r?.(null,t)}catch(C){console.error(C),r?.(C,t)}};return h.useEffect(()=>{b?.completed?(n&&(b?.progress===100?(B.success(c("storage.spaces.backupSuccessfully")),a?.(null,t)):b.message&&a?.(new Error(b?.message),t),b.progress=0,b.message=""),M(!1),oe(),ne()):b.progress&&M(!0)},[b]),e.jsxs(e.Fragment,{children:[e.jsxs(S,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[re&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:c("storage.spaces.strategy.backupNow")}),ae&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:Q,children:c("storage.spaces.disconnected.reconnectNow")}),F&&e.jsx(Jt,{title:b?.message&&e.jsx(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:b.message})}),children:e.jsxs(pe,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(U,{variant:"determinate",value:b?.progress,size:14,sx:{mr:1}}),b?.progress,"%"]})}),e.jsx(dt,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:ie,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:i},"get-endpoint")]}),e.jsx(Ne,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:le,onConnect:Q,enableSwitchToSpace:b?.completed||q(b?.message),backupInProgress:F})]})}_e.propTypes={spaceGateway:m.shape({did:m.string.isRequired,name:m.string.isRequired,url:m.string.isRequired,endpoint:m.string.isRequired,protected:m.bool,loading:m.bool}).isRequired,spaceStatus:m.string.isRequired,selected:m.bool.isRequired,onConnected:m.func,onDeleted:m.func,onBackedUp:m.func};function es({...t}){const{t:s}=D();return e.jsxs(S,{...t,children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("storage.spaces.backup.records")})}),e.jsx(Ae,{}),e.jsx(Oe,{})]})}function ts({...t}){const{t:s}=D(),{autoBackup:n,updateAutoBackup:o}=O(),r=async()=>{try{const a=!n?.enabled;await o({enabled:a}),B.success(s(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){B.error(a.message)}};return e.jsx(Ot,{checked:!!n?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:s("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function ss(){const{t}=D(),{spaceGateways:s,spaceGatewaysLoading:n,spaceGatewayIsSelected:o}=O(),r=n&&!s?.length,a=({spaceGateway:c,spaceStatus:i,selected:d,refresh:l})=>e.jsx(_e,{spaceGateway:c,spaceStatus:i,selected:d,onConnected:()=>l(),onBackedUp:p=>p&&l()});return e.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1},children:t("storage.spaces.connected.title")}),e.jsx(ts,{}),e.jsx(ve,{})]}),e.jsx(S,{sx:{mt:2},children:r?e.jsx(S,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(U,{})}):e.jsx(be,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:s.map(c=>e.jsx(be,{size:{xs:12,md:6},children:e.jsx(ht,{endpoint:c.endpoint,selected:o(c),action:a},c.endpoint)},c.endpoint))})})}),e.jsx(es,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function os(){const{spaceGatewaysFirstLoading:t,spaceGateways:s}=O();return t?e.jsx(Ee,{relative:"parent",children:e.jsx(U,{})}):q(s)?e.jsx(Zt,{}):e.jsx(ss,{})}function ns(){return e.jsx(ze,{children:e.jsx(os,{})})}function as(){const{spaceGateway:t,settingStorageEndpoint:s,updateSpaceGateway:n,hasStorageEndpoint:o,loading:r,storageEndpoint:a}=yt(),c=xe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Ee,{relative:"parent",children:e.jsx(U,{})}):e.jsxs(S,{sx:{maxWidth:"md",position:"relative"},children:[o?e.jsx(bt,{spaceGateway:t,settingStorageEndpoint:s}):e.jsx(kt,{}),e.jsx(S,{sx:c,children:e.jsx(jt,{onConnect:n,storageEndpoint:a})})]})}function rs(){const{t}=D();return e.jsxs(St,{children:[e.jsxs(G,{spacing:1,sx:{marginBottom:2},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.appLevel.title")}),e.jsx(j,{sx:{color:"text.secondary"},children:t("storage.appLevel.description")})]}),e.jsx(as,{})]})}function is({navOrientation:t="vertical",...s}){const{t:n,locale:o}=D(),{blocklet:r}=L(),a=mt({key:"md"}),[c,i]=pt(),d=c.get("tab")||"backup",l=a?"horizontal":t,p=xe(()=>{const w=[{label:n("common.backup"),value:"backup"}],y=r?.capabilities?.didSpace;return(y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:n("common.storage"),value:"storage"}),w},[o,l]),x=xe(()=>({backup:e.jsx(ns,{}),storage:e.jsx(rs,{})}))[d],u=w=>{i(y=>(w==="backup"?y.delete("tab"):y.set("tab",w),y))};if(p.length<=1)return e.jsx(me,{children:x});const k=e.jsx(ut,{tabs:p,current:d,orientation:l,onChange:u,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(S,{...s,children:e.jsxs(G,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(S,{sx:{flexShrink:0},children:e.jsx(je,{left:k})}),e.jsx(S,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:x})})]})});if(l==="horizontal")return e.jsxs(S,{...s,children:[e.jsx(je,{left:k}),e.jsx(me,{sx:{mt:2},children:x})]})}is.propTypes={navOrientation:m.oneOf(["vertical","horizontal"])};const me=ee(S)`
|
|
3
3
|
position: relative;
|
|
4
4
|
min-height: 66vh;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aG as le,j as e,hw as ce,bd as ue,bn as Y,m as Z,fO as ee,f8 as te,aP as re,cr as u,H as E,hx as M,N as R,t as x,hy as V,aU as H,Q as p,az as de,v as N,s as ie,aV as ne,z as me,y as fe,E as he,r as U,g as xe,by as pe}from"./index-CI0UsYER.js";import{T as ve}from"./html-title-CZ5JcCBv.js";import{u as se,C as m}from"./index.esm-BQAoYQrS.js";import{S as h,A as je,a as be,b as ge,c as ye}from"./collapse-Ccf8f09m.js";import{u as ae}from"./blocklet-Ho3KwOsh.js";import{S as $}from"./Switch-1ujfhKkZ.js";const Re=le(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}));var K={exports:{}},O={exports:{}},z={exports:{}},J;function Te(){return J||(J=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=t;function t(d){return d==null}c.exports=s.default,c.exports.default=s.default}(z,z.exports)),z.exports}var Q;function ke(){return Q||(Q=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=S;var t=b(ce()),d=b(Te());function b(n){return n&&n.__esModule?n:{default:n}}var f=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,P=/^[-+]?[0-9]+$/;function S(n,i){(0,t.default)(n),i=i||{};var _=i.allow_leading_zeroes===!1?f:P,q=!i.hasOwnProperty("min")||(0,d.default)(i.min)||n>=i.min,l=!i.hasOwnProperty("max")||(0,d.default)(i.max)||n<=i.max,a=!i.hasOwnProperty("lt")||(0,d.default)(i.lt)||n<i.lt,C=!i.hasOwnProperty("gt")||(0,d.default)(i.gt)||n>i.gt;return _.test(n)&&q&&l&&a&&C}c.exports=s.default,c.exports.default=s.default}(O,O.exports)),O.exports}var G;function we(){return G||(G=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=b;var t=d(ke());function d(f){return f&&f.__esModule?f:{default:f}}function b(f){return(0,t.default)(f,{allow_leading_zeroes:!1,min:0,max:65535})}c.exports=s.default,c.exports.default=s.default}(K,K.exports)),K.exports}var Ee=we();const Se=ue(Ee),B={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Ce(){const{api:c}=Y(),{blocklet:s}=ae(),{t}=Z(),{confirmApi:d,confirmHolder:b}=ee(),f=s?.meta?.did,P=Object.assign({...B},s?.settings?.notification?.email||{}),{handleSubmit:S,control:n,formState:i,watch:_,reset:q}=se({defaultValues:te(P,Object.keys(B))}),l=re({testReceiver:"",testReceiverError:""}),a=_("enabled"),C=u(async(r,g,w=!0)=>{try{const{blocklet:y}=await c.configNotification({input:{did:f,notification:JSON.stringify({email:r})}}),oe=Object.assign({...B},y?.settings?.notification?.email||{});q(oe),w&&E.success(t("oauth.saveSuccess"))}catch(y){if(w)E.error(y.message||t("oauth.saveFailed"));else throw y}}),W=u(async(r,g,w)=>{try{i.isDirty&&await C(r,g,!1),await c.sendEmail({input:{did:f,receiver:w,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification",attachments:[{type:"link",data:{url:"https://community.arcblock.io",title:"Community",image:"https://community.arcblock.io/.well-known/service/blocklet/logo-rect-dark",utm:{campaign:"test-campaign"}}}],utm:{content:"test-email-button"}})}}),E.success(t("notification.email.testSuccess"))}catch(y){E.error(y.message||t("notification.email.testfailed"))}}),A=u((r,g)=>{l.testReceiver=localStorage.getItem("test-receiver")||"",l.testReceiverError="",d.open({title:t("notification.email.testSendEmail"),content:()=>e.jsx(R,{sx:{width:"300px"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.email.inputTestReceiver"),value:l.testReceiver,onChange:w=>{l.testReceiver=w.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(w){const y=l.testReceiver?.trim();if(!y){l.testReceiverError=t("notification.email.receiverRequired");return}if(!M(y)){l.testReceiverError=t("notification.email.receiverInvalid");return}l.testReceiverError="",await W(r,g,y),w()}})}),F=u(r=>{const g=r?.trim();return g?M(g)?!0:t("notification.email.fromInvalid"):t("notification.email.fromRequired")}),L=u(r=>{const g=r?.trim();return g?V(g,{require_host:!1,protocols:[]})?!0:t("notification.email.hostInvalid"):t("notification.email.hostRequired")}),o=u(r=>r?Se(r)?!0:t("notification.email.portInvalid"):t("notification.email.portRequired")),T=u(r=>r?.trim()?!0:t("notification.email.userRequired")),v=u(r=>r?.trim()?!0:t("notification.email.passwordRequired")),k=u(r=>r?.trim()&&!V(r,{protocols:["http","https"],require_protocol:!0})?t("notification.email.linkInvalid"):!0),I=u(r=>r?.trim()&&!M(r)?t("notification.email.emailInvalid"):!0),j=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(Pe,{component:"form",onSubmit:S(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.email.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:r})=>e.jsx(H,{control:e.jsx($,{checked:r.value,...r})})})}),e.jsx(h,{title:t("notification.email.from"),children:e.jsx(m,{name:"from",control:n,rules:{validate:a?F:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,label:t("notification.email.from"),error:!!i.errors[r.name],helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.host"),children:e.jsx(m,{name:"host",control:n,rules:{validate:a?L:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.host"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.port"),children:e.jsx(m,{name:"port",control:n,rules:{validate:a?o:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"number",error:!!i.errors[r.name],label:t("notification.email.port"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.user"),children:e.jsx(m,{name:"user",control:n,rules:{validate:a?T:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.user"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.password"),children:e.jsx(m,{name:"password",control:n,rules:{validate:a?v:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"password",error:!!i.errors[r.name],label:t("notification.email.password"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.secure"),children:e.jsx(m,{name:"secure",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(H,{control:e.jsx($,{checked:r.value,...r,disabled:!a})})})})}),e.jsxs(je,{children:[e.jsxs(be,{expandIcon:e.jsx(ge,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[t("notification.email.signature"),e.jsx(de,{title:t("notification.email.signatureTooltip"),children:e.jsx(Re,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(ye,{children:[e.jsx(h,{title:t("notification.email.companyName"),children:e.jsx(m,{name:"companyName",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyName"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.companyLink"),children:e.jsx(m,{name:"companyLink",control:n,rules:{validate:a?k:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyLink"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.companyAddress"),children:e.jsx(m,{name:"companyAddress",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyAddress"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.supportEmail"),children:e.jsx(m,{name:"supportEmail",control:n,rules:{validate:a?I:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",type:"email",error:!!i.errors[r.name],label:t("notification.email.supportEmail"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})})]})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(N,{variant:"outlined",color:"warning",onClick:S(A),disabled:!a,children:t("oauth.runTest")}),e.jsx(N,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const Pe=ie(ne)``,D={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function _e(){const{api:c}=Y(),{blocklet:s}=ae(),{t}=Z(),{confirmApi:d,confirmHolder:b}=ee(),f=s?.meta?.did,P=Object.assign({...D},s?.settings?.notification?.pushKit||{}),{handleSubmit:S,control:n,formState:i,watch:_,reset:q}=se({defaultValues:te(P,Object.keys(D))}),l=re({testReceiver:"",testReceiverError:""}),a=_("enabled"),C=u(async(o,T,v=!0)=>{try{const{blocklet:k}=await c.configNotification({input:{did:f,notification:JSON.stringify({pushKit:o})}}),I=Object.assign({...D},k?.settings?.notification?.pushKit||{});q(I),v&&E.success(t("oauth.saveSuccess"))}catch(k){if(v)E.error(k.message||t("oauth.saveFailed"));else throw k}}),W=u(async(o,T)=>{try{i.isDirty&&await C(o,T,!1);const v=(s?.configs||[]).find(j=>j.key==="BLOCKLET_APP_URL")?.value,k=me(fe(v,he.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:s?.meta?.version,t:new Date(s?.updatedAt||0).getTime()}),I={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:s?.appDid,fullName:s?.meta?.title,avatar:k}}}};await c.sendPush({input:{did:f,receiver:l.testReceiver,notification:JSON.stringify(I)}}),E.success(t("notification.pushKit.testSuccess"))}catch(v){E.error(v.message||t("notification.pushKit.testfailed"))}}),A=u((o,T)=>{l.testReceiverError="",d.open({title:t("notification.pushKit.testSend"),content:()=>e.jsx(R,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.pushKit.inputTestReceiver"),value:l.testReceiver,onChange:v=>{l.testReceiver=v.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(v){if(!l.testReceiver?.trim()){l.testReceiverError=t("notification.pushKit.receiverRequired");return}l.testReceiverError="",await W(o,T),v()}})}),F=u(o=>{const T=o?.trim();return T?V(T)?!0:t("notification.pushKit.endpointInvalid"):t("notification.pushKit.endpointRequired")}),L=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(qe,{component:"form",onSubmit:S(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.pushKit.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:o})=>e.jsx(H,{control:e.jsx($,{checked:o.value,...o})})})}),e.jsx(h,{title:t("notification.pushKit.endpoint"),children:e.jsx(m,{name:"endpoint",control:n,rules:{validate:a?F:L},render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",required:!0,label:t("notification.pushKit.endpoint"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})})}),e.jsxs(h,{title:t("notification.pushKit.customOptions"),children:[e.jsx(m,{name:"did",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.did"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})}),e.jsx(m,{name:"pushPath",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.pushPath"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(N,{variant:"outlined",color:"warning",onClick:S(A),disabled:!a,children:t("oauth.runTest")}),e.jsx(N,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const qe=ie(ne)``,X=[{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Email"}),value:"email"},{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Push Kit"}),value:"pushKit"}];function Ae(){const[c,s]=U.useState(X[0].value),{locale:t}=U.useContext(xe),d=pe(()=>({email:e.jsx(Ce,{}),pushKit:e.jsx(_e,{})}),[t]),b=U.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(R,{children:[e.jsx(ve,{tabs:X,current:c,onChange:s}),e.jsx(R,{style:b,children:d[c]})]})}export{Ae as B};
|
|
1
|
+
import{aG as le,j as e,hw as ce,bd as ue,bn as Y,m as Z,fO as ee,f8 as te,aP as re,cr as u,H as E,hx as M,N as R,t as x,hy as V,aU as H,Q as p,az as de,v as N,s as ie,aV as ne,z as me,y as fe,E as he,r as U,g as xe,by as pe}from"./index-CXlxISJm.js";import{T as ve}from"./html-title-CtlwTzdI.js";import{u as se,C as m}from"./index.esm-QzmyxCzz.js";import{S as h,A as je,a as be,b as ge,c as ye}from"./collapse-B7_v6nGA.js";import{u as ae}from"./blocklet-C6bd2myO.js";import{S as $}from"./Switch-WcceZP-X.js";const Re=le(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}));var K={exports:{}},O={exports:{}},z={exports:{}},J;function Te(){return J||(J=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=t;function t(d){return d==null}c.exports=s.default,c.exports.default=s.default}(z,z.exports)),z.exports}var Q;function ke(){return Q||(Q=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=S;var t=b(ce()),d=b(Te());function b(n){return n&&n.__esModule?n:{default:n}}var f=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,P=/^[-+]?[0-9]+$/;function S(n,i){(0,t.default)(n),i=i||{};var _=i.allow_leading_zeroes===!1?f:P,q=!i.hasOwnProperty("min")||(0,d.default)(i.min)||n>=i.min,l=!i.hasOwnProperty("max")||(0,d.default)(i.max)||n<=i.max,a=!i.hasOwnProperty("lt")||(0,d.default)(i.lt)||n<i.lt,C=!i.hasOwnProperty("gt")||(0,d.default)(i.gt)||n>i.gt;return _.test(n)&&q&&l&&a&&C}c.exports=s.default,c.exports.default=s.default}(O,O.exports)),O.exports}var G;function we(){return G||(G=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=b;var t=d(ke());function d(f){return f&&f.__esModule?f:{default:f}}function b(f){return(0,t.default)(f,{allow_leading_zeroes:!1,min:0,max:65535})}c.exports=s.default,c.exports.default=s.default}(K,K.exports)),K.exports}var Ee=we();const Se=ue(Ee),B={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Ce(){const{api:c}=Y(),{blocklet:s}=ae(),{t}=Z(),{confirmApi:d,confirmHolder:b}=ee(),f=s?.meta?.did,P=Object.assign({...B},s?.settings?.notification?.email||{}),{handleSubmit:S,control:n,formState:i,watch:_,reset:q}=se({defaultValues:te(P,Object.keys(B))}),l=re({testReceiver:"",testReceiverError:""}),a=_("enabled"),C=u(async(r,g,w=!0)=>{try{const{blocklet:y}=await c.configNotification({input:{did:f,notification:JSON.stringify({email:r})}}),oe=Object.assign({...B},y?.settings?.notification?.email||{});q(oe),w&&E.success(t("oauth.saveSuccess"))}catch(y){if(w)E.error(y.message||t("oauth.saveFailed"));else throw y}}),W=u(async(r,g,w)=>{try{i.isDirty&&await C(r,g,!1),await c.sendEmail({input:{did:f,receiver:w,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification",attachments:[{type:"link",data:{url:"https://community.arcblock.io",title:"Community",image:"https://community.arcblock.io/.well-known/service/blocklet/logo-rect-dark",utm:{campaign:"test-campaign"}}}],utm:{content:"test-email-button"}})}}),E.success(t("notification.email.testSuccess"))}catch(y){E.error(y.message||t("notification.email.testfailed"))}}),A=u((r,g)=>{l.testReceiver=localStorage.getItem("test-receiver")||"",l.testReceiverError="",d.open({title:t("notification.email.testSendEmail"),content:()=>e.jsx(R,{sx:{width:"300px"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.email.inputTestReceiver"),value:l.testReceiver,onChange:w=>{l.testReceiver=w.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(w){const y=l.testReceiver?.trim();if(!y){l.testReceiverError=t("notification.email.receiverRequired");return}if(!M(y)){l.testReceiverError=t("notification.email.receiverInvalid");return}l.testReceiverError="",await W(r,g,y),w()}})}),F=u(r=>{const g=r?.trim();return g?M(g)?!0:t("notification.email.fromInvalid"):t("notification.email.fromRequired")}),L=u(r=>{const g=r?.trim();return g?V(g,{require_host:!1,protocols:[]})?!0:t("notification.email.hostInvalid"):t("notification.email.hostRequired")}),o=u(r=>r?Se(r)?!0:t("notification.email.portInvalid"):t("notification.email.portRequired")),T=u(r=>r?.trim()?!0:t("notification.email.userRequired")),v=u(r=>r?.trim()?!0:t("notification.email.passwordRequired")),k=u(r=>r?.trim()&&!V(r,{protocols:["http","https"],require_protocol:!0})?t("notification.email.linkInvalid"):!0),I=u(r=>r?.trim()&&!M(r)?t("notification.email.emailInvalid"):!0),j=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(Pe,{component:"form",onSubmit:S(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.email.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:r})=>e.jsx(H,{control:e.jsx($,{checked:r.value,...r})})})}),e.jsx(h,{title:t("notification.email.from"),children:e.jsx(m,{name:"from",control:n,rules:{validate:a?F:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,label:t("notification.email.from"),error:!!i.errors[r.name],helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.host"),children:e.jsx(m,{name:"host",control:n,rules:{validate:a?L:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.host"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.port"),children:e.jsx(m,{name:"port",control:n,rules:{validate:a?o:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"number",error:!!i.errors[r.name],label:t("notification.email.port"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.user"),children:e.jsx(m,{name:"user",control:n,rules:{validate:a?T:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.user"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.password"),children:e.jsx(m,{name:"password",control:n,rules:{validate:a?v:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"password",error:!!i.errors[r.name],label:t("notification.email.password"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.secure"),children:e.jsx(m,{name:"secure",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(H,{control:e.jsx($,{checked:r.value,...r,disabled:!a})})})})}),e.jsxs(je,{children:[e.jsxs(be,{expandIcon:e.jsx(ge,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[t("notification.email.signature"),e.jsx(de,{title:t("notification.email.signatureTooltip"),children:e.jsx(Re,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(ye,{children:[e.jsx(h,{title:t("notification.email.companyName"),children:e.jsx(m,{name:"companyName",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyName"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.companyLink"),children:e.jsx(m,{name:"companyLink",control:n,rules:{validate:a?k:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyLink"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.companyAddress"),children:e.jsx(m,{name:"companyAddress",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyAddress"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.supportEmail"),children:e.jsx(m,{name:"supportEmail",control:n,rules:{validate:a?I:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",type:"email",error:!!i.errors[r.name],label:t("notification.email.supportEmail"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})})]})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(N,{variant:"outlined",color:"warning",onClick:S(A),disabled:!a,children:t("oauth.runTest")}),e.jsx(N,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const Pe=ie(ne)``,D={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function _e(){const{api:c}=Y(),{blocklet:s}=ae(),{t}=Z(),{confirmApi:d,confirmHolder:b}=ee(),f=s?.meta?.did,P=Object.assign({...D},s?.settings?.notification?.pushKit||{}),{handleSubmit:S,control:n,formState:i,watch:_,reset:q}=se({defaultValues:te(P,Object.keys(D))}),l=re({testReceiver:"",testReceiverError:""}),a=_("enabled"),C=u(async(o,T,v=!0)=>{try{const{blocklet:k}=await c.configNotification({input:{did:f,notification:JSON.stringify({pushKit:o})}}),I=Object.assign({...D},k?.settings?.notification?.pushKit||{});q(I),v&&E.success(t("oauth.saveSuccess"))}catch(k){if(v)E.error(k.message||t("oauth.saveFailed"));else throw k}}),W=u(async(o,T)=>{try{i.isDirty&&await C(o,T,!1);const v=(s?.configs||[]).find(j=>j.key==="BLOCKLET_APP_URL")?.value,k=me(fe(v,he.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:s?.meta?.version,t:new Date(s?.updatedAt||0).getTime()}),I={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:s?.appDid,fullName:s?.meta?.title,avatar:k}}}};await c.sendPush({input:{did:f,receiver:l.testReceiver,notification:JSON.stringify(I)}}),E.success(t("notification.pushKit.testSuccess"))}catch(v){E.error(v.message||t("notification.pushKit.testfailed"))}}),A=u((o,T)=>{l.testReceiverError="",d.open({title:t("notification.pushKit.testSend"),content:()=>e.jsx(R,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.pushKit.inputTestReceiver"),value:l.testReceiver,onChange:v=>{l.testReceiver=v.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(v){if(!l.testReceiver?.trim()){l.testReceiverError=t("notification.pushKit.receiverRequired");return}l.testReceiverError="",await W(o,T),v()}})}),F=u(o=>{const T=o?.trim();return T?V(T)?!0:t("notification.pushKit.endpointInvalid"):t("notification.pushKit.endpointRequired")}),L=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(qe,{component:"form",onSubmit:S(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.pushKit.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:o})=>e.jsx(H,{control:e.jsx($,{checked:o.value,...o})})})}),e.jsx(h,{title:t("notification.pushKit.endpoint"),children:e.jsx(m,{name:"endpoint",control:n,rules:{validate:a?F:L},render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",required:!0,label:t("notification.pushKit.endpoint"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})})}),e.jsxs(h,{title:t("notification.pushKit.customOptions"),children:[e.jsx(m,{name:"did",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.did"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})}),e.jsx(m,{name:"pushPath",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.pushPath"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(N,{variant:"outlined",color:"warning",onClick:S(A),disabled:!a,children:t("oauth.runTest")}),e.jsx(N,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const qe=ie(ne)``,X=[{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Email"}),value:"email"},{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Push Kit"}),value:"pushKit"}];function Ae(){const[c,s]=U.useState(X[0].value),{locale:t}=U.useContext(xe),d=pe(()=>({email:e.jsx(Ce,{}),pushKit:e.jsx(_e,{})}),[t]),b=U.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(R,{children:[e.jsx(ve,{tabs:X,current:c,onChange:s}),e.jsx(R,{style:b,children:d[c]})]})}export{Ae as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ey as k}from"./index-
|
|
1
|
+
import{ey as k}from"./index-CXlxISJm.js";var m,C;function S(){if(C)return m;C=1;function v(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,f=-1,t=0,n,l=0;l<=o.length;++l){if(l<o.length)n=o.charCodeAt(l);else{if(n===47)break;n=47}if(n===47){if(!(f===l-1||t===1))if(f!==l-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),f=l,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,f=l,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(f+1,l):r=o.slice(f+1,l),i=l-f-1;f=l,t=0}else n===46&&t!==-1?++t:t=-1}return r}function b(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,f=arguments.length-1;f>=-1&&!r;f--){var t;f>=0?t=arguments[f]:(i===void 0&&(i=k.cwd()),t=i),v(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(v(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return v(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];v(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(v(e),v(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var f=e.length,t=f-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var l=r.length,s=l-n,c=t<s?t:s,u=-1,a=0;a<=c;++a){if(a===c){if(s>c){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>c&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var h=e.charCodeAt(i+a),y=r.charCodeAt(n+a);if(h!==y)break;h===47&&(u=a)}var d="";for(a=i+u+1;a<=f;++a)(a===f||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(v(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,f=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){f=n;break}}else t=!1;return f===-1?i?"/":".":i&&f===1?"//":e.slice(0,f)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');v(e);var i=0,f=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var l=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(c===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),l>=0&&(c===r.charCodeAt(l)?--l===-1&&(f=n):(l=-1,f=s))}return i===f?f=s:f===-1&&(f=e.length),e.slice(i,f)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else f===-1&&(t=!1,f=n+1);return f===-1?"":e.slice(i,f)}},extname:function(e){v(e);for(var r=-1,i=0,f=-1,t=!0,n=0,l=e.length-1;l>=0;--l){var s=e.charCodeAt(l);if(s===47){if(!t){i=l+1;break}continue}f===-1&&(t=!1,f=l+1),s===46?r===-1?r=l:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||f===-1||n===0||n===1&&r===f-1&&r===i+1?"":e.slice(r,f)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return b("/",e)},parse:function(e){v(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),f=i===47,t;f?(r.root="/",t=1):t=0;for(var n=-1,l=0,s=-1,c=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!c){l=u+1;break}continue}s===-1&&(c=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===l+1?s!==-1&&(l===0&&f?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(l,s)):(l===0&&f?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(l,n),r.base=e.slice(l,s)),r.ext=e.slice(n,s)),l>0?r.dir=e.slice(0,l-1):f&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return g.posix=g,m=g,m}export{S as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o,T as i,dl as d,dm as x,dd as f}from"./index-
|
|
1
|
+
import{j as o,T as i,dl as d,dm as x,dd as f}from"./index-CXlxISJm.js";function w({name:t,nameFormatter:r=e=>typeof e=="string"?e.split(" ").map(c=>d(x(c))).join(" "):e,layout:n="horizontal",children:a,valueComponent:l="div",nameWidth:m=90,...s}){return o.jsxs(p,{layout:n,width:m,...s,children:[o.jsx(i,{color:"textSecondary",className:"info-row__name",children:r(t)}),a&&o.jsx(i,{color:"textPrimary",component:l,className:"info-row__value",children:a})]})}const p=f("div")`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: ${t=>t.layout==="vertical"?"column":"row"};
|
|
4
4
|
justify-content: flex-start;
|