mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
61 lines
93 KiB
JavaScript
61 lines
93 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('', '', 'dist/AppstoreDiscover-BbuVnQg2.chunk.mjs'),window.OC.filePath('', '', 'dist/preload-helper-BByimXjD.chunk.mjs'),window.OC.filePath('', '', 'dist/mdi-BWzBLGOK.chunk.mjs'),window.OC.filePath('', '', 'dist/ArrowRight-DgB87uF-.chunk.mjs'),window.OC.filePath('', '', 'dist/Web-CSo1f5Mo.chunk.mjs'),window.OC.filePath('', '', 'dist/translation-DoG5ZELJ-CPJIGC2H.chunk.mjs'),window.OC.filePath('', '', 'dist/index-CziSTDUD.chunk.mjs'),window.OC.filePath('', '', 'dist/public-C1mLBHT3.chunk.mjs'),window.OC.filePath('', '', 'dist/common-Web-C_oBIsvc.chunk.css'),window.OC.filePath('', '', 'dist/common-ArrowRight-D7L4ZBkR.chunk.css'),window.OC.filePath('', '', 'dist/common-mdi-Jq77EThs.chunk.css'),window.OC.filePath('', '', 'dist/index-C1xmmKTZ-BhXb8nZF.chunk.mjs'),window.OC.filePath('', '', 'dist/index-B78e9rzX.chunk.mjs'),window.OC.filePath('', '', 'dist/NcModal-kyWZ3UFC-Cl18TGtY.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcModal-kyWZ3UFC-CBh34man.chunk.css'),window.OC.filePath('', '', 'dist/TrashCanOutline-DeYHYTy2.chunk.mjs'),window.OC.filePath('', '', 'dist/common-TrashCanOutline-BYHcrfvW.chunk.css'),window.OC.filePath('', '', 'dist/common-index-DYA_tnKg.chunk.css'),window.OC.filePath('', '', 'dist/NcEmptyContent-CDgWCt_m-BbQM3A2Q.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcEmptyContent-CDgWCt_m-DoZPzs7J.chunk.css'),window.OC.filePath('', '', 'dist/index-COpU9qvO.chunk.mjs'),window.OC.filePath('', '', 'dist/util-BUyb4W9M.chunk.mjs'),window.OC.filePath('', '', 'dist/pinia-CjL5y06H.chunk.mjs'),window.OC.filePath('', '', 'dist/NcContent-D69ktIEB-Do1I3ElW.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcContent-D69ktIEB-Di5xp43u.chunk.css'),window.OC.filePath('', '', 'dist/PencilOutline-Bd3gXgSl.chunk.mjs'),window.OC.filePath('', '', 'dist/common-PencilOutline-DdQinVMt.chunk.css'),window.OC.filePath('', '', 'dist/NcTextArea-CseOD9aM-PEt9mzZE.chunk.mjs'),window.OC.filePath('', '', 'dist/index-C8_Me_Lb.chunk.mjs'),window.OC.filePath('', '', 'dist/common-index-B9mkBKAR.chunk.css'),window.OC.filePath('', '', 'dist/TrayArrowDown-CnFJ32oN.chunk.mjs'),window.OC.filePath('', '', 'dist/common-TrayArrowDown-D79n0IQ6.chunk.css'),window.OC.filePath('', '', 'dist/NcInputField-CPL-a_MM-DbT1N8jl.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcInputField-CPL-a_MM-Bsffit-T.chunk.css'),window.OC.filePath('', '', 'dist/NcAvatar-ruClKRzS-CpNPWscr.chunk.mjs'),window.OC.filePath('', '', 'dist/colors-BfjxNgsx-J-p3roax.chunk.mjs'),window.OC.filePath('', '', 'dist/NcUserStatusIcon-JWiuiAXe-DKCNAxz8.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcUserStatusIcon-JWiuiAXe-Bq_6hmXG.chunk.css'),window.OC.filePath('', '', 'dist/NcDateTime.vue_vue_type_script_setup_true_lang-B4upiZjL-BqrXIjDq.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcDateTime-DS-ziNw6.chunk.css'),window.OC.filePath('', '', 'dist/common-NcAvatar-ruClKRzS-D_G6wUEW.chunk.css'),window.OC.filePath('', '', 'dist/NcBreadcrumbs-5gl8Syfa-1gisCJMA.chunk.mjs'),window.OC.filePath('', '', 'dist/NcPasswordField-BOLzDHBJ-Cz1Mh_NC.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcPasswordField-BOLzDHBJ-DxPSRxK-.chunk.css'),window.OC.filePath('', '', 'dist/NcTextField.vue_vue_type_script_setup_true_lang-B-4HNjYH-B-_jVAzM.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcBreadcrumbs-5gl8Syfa-CtBAA7-7.chunk.css'),window.OC.filePath('', '', 'dist/common-NcTextArea-CseOD9aM-2PqDnzma.chunk.css'),window.OC.filePath('', '', 'dist/NcCheckboxRadioSwitch-D0gFwEVl-CVdipCjx.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcCheckboxRadioSwitch-D0gFwEVl-CQwJiKOs.chunk.css'),window.OC.filePath('', '', 'dist/Plus-BILsvoex.chunk.mjs'),window.OC.filePath('', '', 'dist/common-Plus-Som-mR4B.chunk.css'),window.OC.filePath('', '', 'dist/index-DDZs9KSS.chunk.mjs'),window.OC.filePath('', '', 'dist/common-index-Bwe91UZ7.chunk.css'),window.OC.filePath('', '', 'dist/index-Zww9LWwp.chunk.mjs'),window.OC.filePath('', '', 'dist/common-index--xyrXnuf.chunk.css'),window.OC.filePath('', '', 'dist/NcEmojiPicker-DGgqTnHp-fAGgC6BF.chunk.mjs'),window.OC.filePath('', '', 'dist/emoji-V9hqFgPs-BoVPPNKM.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcEmojiPicker-DGgqTnHp-ChsL0oK6.chunk.css'),window.OC.filePath('', '', 'dist/index-BxkFOOAm.chunk.mjs'),window.OC.filePath('', '', 'dist/common-index--M3XHucY.chunk.css'),window.OC.filePath('', '', 'dist/index-DjvuVPm0.chunk.mjs'),window.OC.filePath('', '', 'dist/common-index-DK2nV6zf.chunk.css'),window.OC.filePath('', '', 'dist/NcSelectTags-B3_tcJAf-CqkSe7YH.chunk.mjs'),window.OC.filePath('', '', 'dist/ContentCopy-dHKMl-yT.chunk.mjs'),window.OC.filePath('', '', 'dist/common-ContentCopy-D7mIRwIy.chunk.css'),window.OC.filePath('', '', 'dist/NcUserBubble-BE6yD-R0-ClcDBpx3.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcUserBubble-BE6yD-R0-f2DD9EAL.chunk.css'),window.OC.filePath('', '', 'dist/index-DHHu-vDL.chunk.mjs'),window.OC.filePath('', '', 'dist/modulepreload-polyfill-BxzAKjcf.chunk.mjs'),window.OC.filePath('', '', 'dist/index-Cogf4PrN.chunk.mjs'),window.OC.filePath('', '', 'dist/appstore-AppstoreDiscover-D5SWaP1O.chunk.css'),window.OC.filePath('', '', 'dist/common-NcActionSeparator-Ct2RnclR-pXJ_-D_I.chunk.css'),window.OC.filePath('', '', 'dist/common-NcGuestContent-j8ai4O1K-D0718NyY.chunk.css'),window.OC.filePath('', '', 'dist/AppstoreSearch-68Yafz1S.chunk.mjs'),window.OC.filePath('', '', 'dist/common-AppstoreSearch-CAiP7JM1.chunk.css'),window.OC.filePath('', '', 'dist/AppstoreBrowse-SP2lBd28.chunk.mjs'),window.OC.filePath('', '', 'dist/appstore-AppstoreBrowse-D_DYi-hc.chunk.css')])))=>i.map(i=>d[i]);
|
|
import{d as ke,c as Vt}from"./pinia-CjL5y06H.chunk.mjs";import{b as B,o as u,f as x,g as _,t as v,i as Wt,y as w,c as D,u as o,N as Xt,w as y,j as q,v as $,F as M,B as j,k,l as E,a9 as dt,p as ht,z as re,h as I,q as Me,a8 as fe,U as Yt,a as Jt,_ as oe,H as Kt,D as ea,r as ta,e as aa}from"./preload-helper-BByimXjD.chunk.mjs";import{t as c,p as na,g as sa}from"./translation-DoG5ZELJ-CPJIGC2H.chunk.mjs";import{N as ie,v as Oe,u as _e,Q as la,T as ra}from"./ArrowRight-DgB87uF-.chunk.mjs";import{N as ia,a as oa}from"./NcContent-D69ktIEB-Do1I3ElW.chunk.mjs";import{c as Ge,f as gt,g as pa,b as K}from"./index-CziSTDUD.chunk.mjs";import{_ as N,l as ee}from"./public-C1mLBHT3.chunk.mjs";import{N as ca}from"./PencilOutline-Bd3gXgSl.chunk.mjs";import{_ as mt,N as L}from"./Web-CSo1f5Mo.chunk.mjs";import{c as ua,d as J,e as da,f as ha,N as ga}from"./NcTextArea-CseOD9aM-PEt9mzZE.chunk.mjs";import{P as ft}from"./NcBreadcrumbs-5gl8Syfa-1gisCJMA.chunk.mjs";import{N as ma,a as fa,_ as ba}from"./NcDateTime.vue_vue_type_script_setup_true_lang-B4upiZjL-BqrXIjDq.chunk.mjs";import{M as ka,a as _a}from"./NcModal-kyWZ3UFC-Cl18TGtY.chunk.mjs";/* empty css */import"./NcAvatar-ruClKRzS-CpNPWscr.chunk.mjs";import{N as Ie}from"./TrashCanOutline-DeYHYTy2.chunk.mjs";import"./NcCheckboxRadioSwitch-D0gFwEVl-CVdipCjx.chunk.mjs";import{N as ya}from"./Plus-BILsvoex.chunk.mjs";import"./index-DDZs9KSS.chunk.mjs";import{N as wa,a as va}from"./TrayArrowDown-CnFJ32oN.chunk.mjs";import"./index-Zww9LWwp.chunk.mjs";import{N as bt,s as kt}from"./index-B78e9rzX.chunk.mjs";import"./index-C8_Me_Lb.chunk.mjs";import"./NcEmojiPicker-DGgqTnHp-fAGgC6BF.chunk.mjs";import{N as Ze}from"./NcEmptyContent-CDgWCt_m-BbQM3A2Q.chunk.mjs";import"./index-BxkFOOAm.chunk.mjs";/* empty css */import"./NcInputField-CPL-a_MM-DbT1N8jl.chunk.mjs";import{J as xa,K as $a,L as Ta,M as Aa,O as Sa,P as Ra,Q as Da,R as za,S as Ia,T as Ca,U as La,w as Ea,V as Ba,D as Se,W as Pa,X as qa,Y as je,y as He,Z as _t,_ as Na,$ as yt,q as wt,a0 as Ma,a1 as Oa,a2 as Ga,a3 as vt,a4 as Za,a5 as ja,a6 as xt,N as at,a7 as Ha,a8 as Qa,a9 as Ua,aa as Fa,ab as Va,ac as Wa,ad as Xa,l as Ya,ae as Ja,af as Ka,v as en,ag as tn}from"./mdi-BWzBLGOK.chunk.mjs";import"./NcPasswordField-BOLzDHBJ-Cz1Mh_NC.chunk.mjs";import"./index-DjvuVPm0.chunk.mjs";import{c as O}from"./index-COpU9qvO.chunk.mjs";import"./NcTextField.vue_vue_type_script_setup_true_lang-B-4HNjYH-B-_jVAzM.chunk.mjs";import"./NcSelectTags-B3_tcJAf-CqkSe7YH.chunk.mjs";import"./ContentCopy-dHKMl-yT.chunk.mjs";import"./NcUserBubble-BE6yD-R0-ClcDBpx3.chunk.mjs";import"./NcUserStatusIcon-JWiuiAXe-DKCNAxz8.chunk.mjs";import"./emoji-V9hqFgPs-BoVPPNKM.chunk.mjs";import"./colors-BfjxNgsx-J-p3roax.chunk.mjs";import{w as an,b as nn,u as sn}from"./index-DHHu-vDL.chunk.mjs";import"./modulepreload-polyfill-BxzAKjcf.chunk.mjs";import{a as be}from"./index-C1xmmKTZ-BhXb8nZF.chunk.mjs";import{a as ln,P as ye,c as Qe}from"./index-Cogf4PrN.chunk.mjs";import"./util-BUyb4W9M.chunk.mjs";const rn={class:"app-navigation-spacer"},on=B({__name:"NcAppNavigationSpacer",setup(e){return(t,n)=>(u(),x("li",rn))}}),pn=mt(on,[["__scopeId","data-v-277fa710"]]),cn={name:"NcAppSidebarTab",inject:["registerTab","unregisterTab","getActiveTab","isTablistShown"],props:{id:{type:String,required:!0},name:{type:String,required:!0},icon:{type:String,default:""},order:{type:Number,default:0}},emits:["bottomReached","scroll"],expose:["id","name","icon","order","renderIcon"],computed:{isActive(){return this.getActiveTab()===this.id}},created(){this.registerTab(this)},beforeUnmount(){this.unregisterTab(this.id)},methods:{onScroll(e){this.$el.scrollHeight-this.$el.scrollTop===this.$el.clientHeight&&this.$emit("bottomReached",e),this.$emit("scroll",e)},renderIcon(){return this.$slots.icon?.()}}},un=["id","aria-hidden","aria-label","aria-labelledby","role","tabindex"],dn={class:"hidden-visually"};function hn(e,t,n,s,a,r){return u(),x("section",{id:`tab-${n.id}`,"aria-hidden":!r.isActive,"aria-label":r.isTablistShown()?void 0:n.name,"aria-labelledby":r.isTablistShown()?`tab-button-${n.id}`:void 0,class:w(["app-sidebar__tab",{"app-sidebar__tab--active":r.isActive}]),role:r.isTablistShown()?"tabpanel":void 0,tabindex:r.isTablistShown()?0:-1,onScroll:t[0]||(t[0]=(...l)=>r.onScroll&&r.onScroll(...l))},[_("h3",dn,v(n.name),1),Wt(e.$slots,"default",{},void 0,!0)],42,un)}const Ce=mt(cn,[["render",hn],["__scopeId","data-v-dba10798"]]),W=Object.freeze({discover:c("appstore","Discover"),installed:c("appstore","Your apps"),enabled:c("appstore","Active apps"),disabled:c("appstore","Disabled apps"),updates:c("appstore","Updates"),bundles:c("appstore","App bundles"),featured:c("appstore","Featured apps"),supported:c("appstore","Supported apps"),search:c("appstore","Search results")}),X=Object.freeze({discover:Oa,installed:Ma,enabled:wt,disabled:yt,bundles:Na,supported:_t,featured:He,updates:je,ai:qa,auth:Pa,customization:Se,dashboard:Ba,files:Ea,games:La,integration:Ca,monitoring:Ia,multimedia:za,office:Da,organization:Ra,search:Sa,security:Aa,social:Ta,tools:$a,workflow:xa}),Ji=["post","showcase","carousel"];ln(O);const te=Ge("apps/appstore/api/v1"),se=Object.freeze({apps:`${te}/apps`,categories:`${te}/apps/categories`,enable:`${te}/apps/enable`,disable:`${te}/apps/disable`,uninstall:`${te}/apps/uninstall`,update:`${te}/apps/update`,bundleEnable:`${te}/bundles/enable`}),we=new ft({concurrency:1});async function nt(e,t=!1,n){return we.add(async()=>{await O.post(se.enable,{appId:e,groups:n,force:t||void 0},{confirmPassword:ye.Strict})})}async function gn(e){return we.add(async()=>{await O.post(se.disable,{appId:e},{confirmPassword:ye.Lax})})}async function mn(e){return we.add(async()=>{await O.post(se.update,{appId:e},{confirmPassword:ye.Strict})})}async function fn(e){return we.add(async()=>{await O.post(se.uninstall,{appId:e},{confirmPassword:ye.Strict})})}async function bn(){const{data:e}=await O.get(se.apps);return e.ocs.data}async function kn(){const{data:e}=await O.get(se.categories);for(const t of e.ocs.data)t.icon=X[t.id]??"";return e.ocs.data}async function _n(e){return we.add(async()=>{await O.post(se.bundleEnable,{bundleId:e},{confirmPassword:ye.Strict})})}async function ge(){const{data:e}=await O.get(Ge("core/navigation/apps?format=json"));e.ocs.meta.statuscode===200&&(gt("nextcloud:app-menu.refresh",{apps:e.ocs.data}),window.dispatchEvent(new Event("resize")))}function pe(e){return e.installed||e.internal?!1:e.missingDependencies===void 0||e.missingDependencies.length===0||!e.isCompatible&&e.missingDependencies.length===1}function $t(e){return e.installed&&e.removable&&!e.active}function Tt(e){return!Rt(e)&&!Dt(e)&&At(e)&&e.isCompatible}function At(e){return!e.active&&(e.installed||pe(e))}function ve(e){return!e.active&&!e.isCompatible}function St(e){return!Rt(e)&&!Dt(e)&&e.active&&!e.internal}function yn(e){return e.update!==void 0}const wn=["filesystem","prelogin","authentication","logging","prevent_group_restriction"];function Ue(e){return!e.active&&!e.installed||!e.active&&ve(e)?!1:e.types?e.types.every(t=>!wn.includes(t)):!0}function Rt(e){return e.app_api&&(e.status.action==="init"||e.status.action==="healthcheck")}function Dt(e){return e.app_api&&e.status.action==="deploy"}const Q=pa().setApp("appstore").detectUser().build(),vn=B({__name:"DaemonSelectionDialogListEntry",props:{daemon:{},isDefault:{type:Boolean}},emits:["selected"],setup(e,{emit:t}){const n=e,s=t,a=$(()=>`${n.daemon.name} - ${n.daemon.display_name}`);return(r,l)=>(u(),D(o(wa),{active:e.isDefault,counterNumber:e.daemon.exAppsCount,counterType:"highlighted",details:e.isDefault?o(c)("appstore","Default"):"",forceDisplayActions:"",name:a.value,onClick:l[0]||(l[0]=Xt(p=>s("selected"),["stop"]))},{subname:y(()=>[q(v(e.daemon.accepts_deploy_id),1)]),_:1},8,["active","counterNumber","details","name"]))}}),xn=["aria-label"],$n=B({__name:"DaemonSelectionDialogList",emits:["selected"],setup(e){const t=xe();return(n,s)=>(u(),x("ul",{class:w(n.$style.DaemonSelectionDialogList),"aria-label":o(c)("appstore","Registered Deploy daemons list")},[(u(!0),x(M,null,j(o(t).dockerDaemons,a=>(u(),D(vn,{key:a.id,daemon:a,isDefault:o(t).defaultDaemon?.name===a.name,onSelected:r=>n.$emit("selected",a)},null,8,["daemon","isDefault","onSelected"]))),128))],10,xn))}}),Tn="_DaemonSelectionDialogList_x38pt_2",An={DaemonSelectionDialogList:Tn},Sn={$style:An},Rn=N($n,[["__cssModules",Sn]]),Dn=B({__name:"DaemonSelectionDialog",props:{app:{}},emits:["close"],setup(e){const t=xe(),n=K("/settings/admin/app_api");return(s,a)=>(u(),D(o(bt),{name:o(c)("appstore","Choose Deploy Daemon for {appName}",{appName:e.app.name}),size:"normal","onUpdate:open":a[1]||(a[1]=r=>r||s.$emit("close"))},{default:y(()=>[o(t).dockerDaemons.length===0?(u(),D(o(Ze),{key:0,class:"daemon-selection-list__empty-content",name:o(c)("appstore","No Deploy daemons configured"),description:o(c)("appstore","Register a custom one or setup from available templates")},{icon:y(()=>[k(o(L),{path:o(Ga)},null,8,["path"])]),action:y(()=>[k(o(ie),{href:o(n)},{default:y(()=>[q(v(o(c)("appstore","Manage Deploy daemons")),1)]),_:1},8,["href"])]),_:1},8,["name","description"])):(u(),D(Rn,{key:1,app:e.app,onSelected:a[0]||(a[0]=r=>s.$emit("close",r))},null,8,["app"]))]),_:1},8,["name"]))}});async function zn(){const{data:e}=await O.get(K("/apps/app_api/apps/list"));return e.apps}async function In(e){const{data:t}=await O.get(K(`/apps/app_api/apps/status/${e}`));return t}async function Be(e,t,n){await Qe(),await O.post(K(`/apps/app_api/apps/enable/${e.id}/${t.name}`),{deployOptions:n})}async function Cn(e){await Qe(),await O.post(K("/apps/app_api/apps/force"),{appId:e})}async function st(e){await Qe(),await O.get(K(`apps/app_api/apps/disable/${e}`))}const xe=ke("external-apps",()=>{const e=ee("appstore","appApiEnabled",!1),t=E([]),n=E(ee("appstore","appstoreExAppUpdateCount",0));let s=null;const a=E(ee("appstore","defaultDaemonConfigAccessible",!1)),r=E(ee("appstore","defaultDaemonConfig",null)),l=E([]),p=$(()=>t.value.filter(m=>m?.status?.action&&m.status.type!==""&&(m?.status?.action==="deploy"||m.status.action==="init"||m.status.action==="healthcheck")));function i(m){return t.value.find(({id:f})=>f===m)??null}async function g(m){const f=i(m);if(!f)throw new Error(`App with id ${m} not found`);f.loading=!0;try{if(l.value.length===1&&f.needsDownload)Be(f,l[0]),f.daemon=l[0];else if(f.needsDownload){const Z=await kt(Dn,{app:f});if(!Z)throw new Error("No daemon selected");await Be(f,Z),f.daemon=Z}else await Be(f,f.daemon);f.installed||(f.needsDownload=!1,f.status={type:"install",action:"deploy",init:0,deploy:0}),f.removable=!0,delete f.error,await T(m)}finally{f.loading=!1}}async function h(m){const f=i(m);if(!f)throw new Error(`App with id ${m} not found`);f.loading=!0;try{await Cn(m),await R(!0),f.active=!1}finally{f.loading=!1}}async function d(m){const f=i(m);if(!f)throw new Error(`App with id ${m} not found`);f.loading=!0;try{await st(m),f.active=!1}finally{f.loading=!1}}async function b(m){const f=i(m);if(!f)throw new Error(`App with id ${m} not found`);f.loading=!0;try{await st(m),f.active=!1,f.needsDownload=!0,f.installed=!1,f.daemon=null,f.status={},f.update!==null&&n.value--,delete f.update,delete f.error}finally{f.loading=!1}}async function S(m){const f=i(m);if(!f)throw new Error(`App with id ${m} not found`);f.loading=!0;try{await O.get(K(`/apps/app_api/apps/update/${m}`)),f.version=f.update||f.version,f.status={type:"update",action:"deploy",init:0,deploy:0},delete f.update,delete f.error,n.value--,await T(m)}catch(Z){Q.error("Failed to update ex app",{appId:m,error:Z}),be(c("appstore","Could not update the app. Please try again later."))}finally{f.loading=!1}}async function R(m=!1){(m||!r.value||!l.value.length)&&await P(),(m||t.value.length===0)&&await Y()}return{isEnabled:e,apps:t,updateCount:n,defaultDaemon:r,dockerDaemons:l,daemonAccessible:a,getById:i,disableApp:d,enableApp:g,forceEnableApp:h,updateApp:S,uninstallApp:b,initialize:R};async function P(){try{const{data:m}=await O.get(K("/apps/app_api/daemons"));r.value=m.daemons.find(f=>f.name===m.default_daemon_config),l.value=m.daemons.filter(f=>f.accepts_deploy_id==="docker-install")}catch(m){return Q.error("[app-api-store] Failed to fetch Docker daemons",{error:m}),!1}return!0}async function Y(){try{t.value=await zn()}catch(m){Q.error("An error occurred while fetching apps",{error:m}),be(c("appstore","An error occurred during the request. Unable to proceed."))}}async function T(m){const f=i(m);if(!f){Q.error("[app-api-store] app not found while fetching status",{appId:m});return}f.loading=!0;try{const Z=await In(m);f.status=Z,Q.debug("[app-api-store] initializingOrDeployingApps after setAppStatus",{initializingOrDeployingApps:p}),p.value.length===0&&(Q.debug("[app-api-store] Clearing interval"),clearInterval(s),s=null),f.status.error&&p.value.length===1&&(clearInterval(s),s=null)}catch(Z){throw A(),Z}finally{f.loading=!1}}function A(){clearInterval(s),p.value.length!==0&&(s=window.setInterval(()=>{Q.debug("[app-api-store] initializingOrDeployingApps",{initializingOrDeployingApps:p});for(const m of p.value)T(m.id)},2e3))}}),H=ke("apps",()=>{const e=xe(),t=E([]),n=E([]),s=dt(ee("appstore","appstoreBundles")),a=E(!1),r=E(!1),l=$(()=>[...t.value,...e.isEnabled?e.apps:[]]);function p(T){return n.value.find(({id:A})=>A===T)??null}function i(T){return l.value.find(({id:A})=>A===T)??null}function g(T){return l.value.filter(A=>[A.category].flat().includes(T))}async function h(T,A=!1){const m=i(T);if(!m)throw new Error(`App with id ${T} not found`);if(m.active||!m.installed&&!pe(m))throw new Error(`App with id ${T} cannot be enabled`);if(!A&&ve(m))throw new Error(`App with id ${T} requires force enable`);m.loading=!0;try{m.app_api?await e.enableApp(T):await nt(T,A),A&&(m.isCompatible=!0),m.active=!0,m.installed=!0,m.removable=!0,await ge()}finally{m.loading=!1}}async function d(T){const A=i(T);if(!A)throw new Error(`App with id ${T} not found`);if(!St(A))throw new Error(`App with id ${T} cannot be disabled`);A.loading=!0;try{A.app_api?await e.disableApp(T):await gn(T),A.active=!1,A.isCompatible=A.missingDependencies===void 0||A.missingDependencies.length===0,await ge()}finally{A.loading=!1}}async function b(T){const A=i(T);if(!A)throw new Error(`App with id ${T} not found`);if(!$t(A))throw new Error(`App with id ${T} cannot be uninstalled`);A.loading=!0;try{A.app_api?await e.uninstallApp(T):await fn(T),A.active=!1,A.installed=!1,await ge()}finally{A.loading=!1}}async function S(T,A){const m=i(T);if(!m)throw new Error(`App with id ${T} not found`);if(!Ue(m))throw new Error(`App with id ${T} cannot be limited to groups`);if(!m.app_api)try{m.loading=!0,await nt(T,!1,A),m.groups=A}finally{m.loading=!1}}async function R(T){const A=s.find(m=>m.id===T);if(!A)throw new Error(`Bundle with id ${T} not found`);try{for(const m of A.appIdentifiers){const f=i(m);f.loading=!0}await _n(A.id);for(const m of A.appIdentifiers){const f=i(m);f.active=!0,f.installed=!0,f.removable=!0,await ge()}}finally{for(const m of A.appIdentifiers){const f=i(m);f.loading=!1}}}async function P(){try{r.value=!0,n.value=await kn()}catch(T){Q.error("Failed to load app categories",{error:T}),be(c("appstore","Could not load app categories. Please try again later."))}finally{r.value=!1}}async function Y(){try{a.value=!0,t.value=await bn()}catch(T){Q.error("Failed to load apps list",{error:T}),be(c("appstore","Could not load apps list. Please try again later."))}finally{a.value=!1}}return Y(),P(),{apps:l,bundles:s,categories:n,isLoadingApps:a,isLoadingCategories:r,disableApp:d,enableApp:h,uninstallApp:b,enableBundle:R,getAppById:i,getAppsByCategory:g,getCategoryById:p,limitAppToGroups:S}}),zt=ke("updates",()=>{const e=xe(),t=E(ee("appstore","appstoreUpdateCount",0)),n=$(()=>t.value+e.updateCount);async function s(a){const r=H().getAppById(a);if(!r)throw new Error(`App with id ${a} not found`);try{"app_api"in r&&r.app_api?await e.updateApp(a):(await mn(a),t.value=Math.max(t.value-1,0)),ge()}catch(l){Q.error("Failed to update app",{appId:a,error:l}),be(c("appstore","Could not update the app. Please try again later."))}}return{updateCount:n,updateApp:s}}),It=ke("userSettings",()=>{const e=E(""),t=E(!1),n=E(!0),s=$(()=>e.value==="m"?"468px":e.value==="l"?"512px":"320px");function a(l){return{...(_e()??{}).query,grid:l??t.value?e.value||null:void 0,compatible:n.value?void 0:null}}return Oe().afterEach(l=>{r(l.query)}),{defaultGridSize:e,gridSizePx:s,isGridView:t,showIncompatible:n,getQuery:a};function r(l){t.value="grid"in l,e.value=[l.grid??""].flat()[0].toLowerCase(),n.value=!("compatible"in l)}}),Ln=B({__name:"AppstoreNavigation",setup(e){const t=ee("settings","appstoreEnabled",!0),n=H(),s=zt(),a=It(),r=$(()=>n.categories),l=$(()=>n.isLoadingCategories),p=_e(),i=Oe(),g=ht("search");ka("f",()=>{g.value?.$refs.inputElement||(gt("toggle-navigation",{open:!0}),window.setTimeout(()=>g.value?.$refs.inputElement?.focus(),400)),g.value?.$refs.inputElement?.focus()},{ctrl:!0,stop:!0,prevent:!0});const h=E("");re(()=>p.query.q,b=>{h.value=[b||""].flat()[0]},{immediate:!0}),an(h,(b,S)=>{if(b.trim()!==S.trim()){if(i.currentRoute.value.name==="apps-discover"||i.currentRoute.value.name==="apps-manage"&&p.params.category==="bundles"){i.push({name:"apps-search",query:{...p.query,q:b.trim()||void 0}});return}i.replace({...p,query:{...p.query,q:b.trim()||void 0}})}},{debounce:500});const d=$(()=>n.apps.find(({level:b})=>b===300)!==void 0);return(b,S)=>(u(),D(o(ua),{"aria-label":o(c)("appstore","Appstore categories")},{search:y(()=>[k(o(da),{ref_key:"search",ref:h,modelValue:h.value,"onUpdate:modelValue":S[0]||(S[0]=R=>h.value=R),label:o(c)("appstore","Search apps…")},null,8,["modelValue","label"])]),list:y(()=>[o(t)?(u(),D(o(J),{key:0,to:{name:"apps-discover"},name:o(W).discover},{icon:y(()=>[k(o(L),{path:o(X).discover},null,8,["path"])]),_:1},8,["name"])):I("",!0),k(o(J),{to:{name:"apps-manage",params:{category:"installed"}},name:o(W).installed},{icon:y(()=>[k(o(L),{path:o(X).installed},null,8,["path"])]),_:1},8,["name"]),k(o(J),{to:{name:"apps-manage",params:{category:"enabled"}},name:o(W).enabled},{icon:y(()=>[k(o(L),{path:o(X).enabled},null,8,["path"])]),_:1},8,["name"]),k(o(J),{to:{name:"apps-manage",params:{category:"disabled"}},name:o(W).disabled},{icon:y(()=>[k(o(L),{path:o(X).disabled},null,8,["path"])]),_:1},8,["name"]),o(s).updateCount>0?(u(),D(o(J),{key:1,to:{name:"apps-manage",params:{category:"updates"}},name:o(W).updates},{counter:y(()=>[k(o(va),{count:o(s).updateCount},null,8,["count"])]),icon:y(()=>[k(o(L),{path:o(X).updates},null,8,["path"])]),_:1},8,["name"])):I("",!0),k(o(J),{to:{name:"apps-bundles"},name:o(W).bundles},{icon:y(()=>[k(o(L),{path:o(X).bundles},null,8,["path"])]),_:1},8,["name"]),k(o(pn)),o(t)&&l.value?(u(),x("li",{key:2,class:w(b.$style.appstoreNavigation__categories_loading)},[k(o(Ie),{size:20,name:o(c)("appstore","Loading categories")},null,8,["name"])],2)):o(t)&&!l.value?(u(),x(M,{key:3},[d.value?(u(),D(o(J),{key:0,id:"app-category-supported",to:{name:"apps-category",params:{category:"supported"},query:o(a).getQuery(!0)},name:o(W).supported},{icon:y(()=>[k(o(L),{path:o(X).supported},null,8,["path"])]),_:1},8,["to","name"])):I("",!0),k(o(J),{id:"app-category-featured",to:{name:"apps-category",params:{category:"featured"},query:o(a).getQuery(!0)},name:o(W).featured},{icon:y(()=>[k(o(L),{path:o(X).featured},null,8,["path"])]),_:1},8,["to","name"]),(u(!0),x(M,null,j(r.value,R=>(u(),D(o(J),{id:`app-category-${R.id}`,key:R.id,name:R.displayName,to:{name:"apps-category",params:{category:R.id},query:o(a).getQuery(!0)}},{icon:y(()=>[k(o(L),{path:R.icon},null,8,["path"])]),_:2},1032,["id","name","to"]))),128))],64)):I("",!0)]),_:1},8,["aria-label"]))}}),En="_appstoreNavigation__categories_loading_1fsn2_2",Bn={appstoreNavigation__categories_loading:En},Pn={$style:Bn},qn=N(Ln,[["__cssModules",Pn]]),Nn=B({__name:"AppActions",props:{app:{},actions:{},maxInlineActions:{default:1},iconOnly:{type:Boolean}},setup(e){const t=$(()=>e.actions.length<=e.maxInlineActions?e.actions:e.actions.filter(s=>s.inline!==!1).slice(0,e.maxInlineActions)),n=$(()=>e.actions.filter(s=>!t.value.includes(s)));return(s,a)=>(u(),x("div",{class:w(s.$style.appActions)},[(u(!0),x(M,null,j(t.value,r=>(u(),D(o(ie),{key:r.id,ariaLabel:e.iconOnly?r.label(e.app):void 0,title:e.iconOnly?r.label(e.app):void 0,variant:r.variant,href:"href"in r?r.href(e.app):void 0,to:"to"in r?r.to(e.app):void 0,target:"href"in r?"_blank":void 0,onClick:l=>"callback"in r&&r.callback(e.app)},Me({icon:y(()=>[k(o(L),{path:r.icon},null,8,["path"])]),_:2},[e.iconOnly?void 0:{name:"default",fn:y(()=>[q(v(r.label(e.app)),1)]),key:"0"}]),1032,["ariaLabel","title","variant","href","to","target","onClick"]))),128)),k(o(_a),{forceMenu:""},{default:y(()=>[(u(!0),x(M,null,j(n.value,r=>(u(),x(M,null,["callback"in r?(u(),D(o(ca),{key:"callback-"+r.id,closeAfterClick:"",variant:r.variant,onClick:l=>r.callback(e.app)},{icon:y(()=>[k(o(L),{path:r.icon},null,8,["path"])]),default:y(()=>[q(" "+v(r.label(e.app)),1)]),_:2},1032,["variant","onClick"])):"href"in r?(u(),D(o(ma),{key:"link-"+r.id,closeAfterClick:"",variant:r.variant,href:r.href(e.app)},{icon:y(()=>[k(o(L),{path:r.icon},null,8,["path"])]),default:y(()=>[q(" "+v(r.label(e.app)),1)]),_:2},1032,["variant","href"])):(u(),D(o(fa),{key:"route-"+r.id,closeAfterClick:"",variant:r.variant,to:r.to(e.app)},{icon:y(()=>[k(o(L),{path:r.icon},null,8,["path"])]),default:y(()=>[q(" "+v(r.label(e.app)),1)]),_:2},1032,["variant","to"]))],64))),256))]),_:1})],2))}}),Mn="_appActions_lrf6h_2",On={appActions:Mn},Gn={$style:On},Ct=N(Nn,[["__cssModules",Gn]]),Zn=B({__name:"AppDeployDaemonTab",props:{app:{}},setup(e){const t=E(e.app?.daemon?.deploy_config?.computeDevice?.id!=="cpu"||!1);return(n,s)=>e.app?.daemon?(u(),D(o(Ce),{key:0,id:"daemon",name:o(c)("appstore","Daemon"),order:5},{icon:y(()=>[k(o(L),{path:o(vt),size:24},null,8,["path"])]),default:y(()=>[_("div",{class:w(n.$style.appDeployDaemonTab)},[_("h4",null,v(o(c)("appstore","Deploy Daemon")),1),_("p",null,[_("b",null,v(o(c)("appstore","Type")),1),q(": "+v(e.app?.daemon.accepts_deploy_id),1)]),_("p",null,[_("b",null,v(o(c)("appstore","Name")),1),q(": "+v(e.app?.daemon.name),1)]),_("p",null,[_("b",null,v(o(c)("appstore","Display Name")),1),q(": "+v(e.app?.daemon.display_name),1)]),_("p",null,[_("b",null,v(o(c)("appstore","GPUs support")),1),q(": "+v(t.value),1)]),_("p",null,[_("b",null,v(o(c)("appstore","Compute device")),1),q(": "+v(e.app?.daemon?.deploy_config?.computeDevice?.label),1)])],2)]),_:1},8,["name"])):I("",!0)}}),jn="_appDeployDaemonTab_1xkhp_2",Hn={appDeployDaemonTab:jn},Qn={$style:Hn},Un=N(Zn,[["__cssModules",Qn]]);function Fe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var le=Fe();function lt(e){le=e}var ne={exec:()=>null};function z(e,t=""){let n=typeof e=="string"?e:e.source,s={replace:(a,r)=>{let l=typeof r=="string"?r:r.source;return l=l.replace(G.caret,"$1"),n=n.replace(a,l),s},getRegex:()=>new RegExp(n,t)};return s}var Fn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),G={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Vn=/^(?:[ \t]*(?:\n|$))+/,Wn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Xn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,$e=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Yn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ve=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Lt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Et=z(Lt).replace(/bull/g,Ve).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Jn=z(Lt).replace(/bull/g,Ve).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),We=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Kn=/^[^\n]+/,Xe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,es=z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Xe).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ts=z(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ve).getRegex(),Le="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ye=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,as=z("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ye).replace("tag",Le).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Bt=z(We).replace("hr",$e).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Le).getRegex(),ns=z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Bt).getRegex(),Je={blockquote:ns,code:Wn,def:es,fences:Xn,heading:Yn,hr:$e,html:as,lheading:Et,list:ts,newline:Vn,paragraph:Bt,table:ne,text:Kn},rt=z("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",$e).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Le).getRegex(),ss={...Je,lheading:Jn,table:rt,paragraph:z(We).replace("hr",$e).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",rt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Le).getRegex()},ls={...Je,html:z(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ye).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ne,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:z(We).replace("hr",$e).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",Et).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,is=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Pt=/^( {2,}|\\)\n(?!\s*$)/,os=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ce=/[\p{P}\p{S}]/u,Ee=/[\s\p{P}\p{S}]/u,Ke=/[^\s\p{P}\p{S}]/u,ps=z(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ee).getRegex(),qt=/(?!~)[\p{P}\p{S}]/u,cs=/(?!~)[\s\p{P}\p{S}]/u,us=/(?:[^\s\p{P}\p{S}]|~)/u,ds=z(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Fn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Nt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,hs=z(Nt,"u").replace(/punct/g,ce).getRegex(),gs=z(Nt,"u").replace(/punct/g,qt).getRegex(),Mt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ms=z(Mt,"gu").replace(/notPunctSpace/g,Ke).replace(/punctSpace/g,Ee).replace(/punct/g,ce).getRegex(),fs=z(Mt,"gu").replace(/notPunctSpace/g,us).replace(/punctSpace/g,cs).replace(/punct/g,qt).getRegex(),bs=z("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ke).replace(/punctSpace/g,Ee).replace(/punct/g,ce).getRegex(),ks=z(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ce).getRegex(),_s="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ys=z(_s,"gu").replace(/notPunctSpace/g,Ke).replace(/punctSpace/g,Ee).replace(/punct/g,ce).getRegex(),ws=z(/\\(punct)/,"gu").replace(/punct/g,ce).getRegex(),vs=z(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),xs=z(Ye).replace("(?:-->|$)","-->").getRegex(),$s=z("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",xs).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Re=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Ts=z(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Re).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ot=z(/^!?\[(label)\]\[(ref)\]/).replace("label",Re).replace("ref",Xe).getRegex(),Gt=z(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xe).getRegex(),As=z("reflink|nolink(?!\\()","g").replace("reflink",Ot).replace("nolink",Gt).getRegex(),it=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,et={_backpedal:ne,anyPunctuation:ws,autolink:vs,blockSkip:ds,br:Pt,code:is,del:ne,delLDelim:ne,delRDelim:ne,emStrongLDelim:hs,emStrongRDelimAst:ms,emStrongRDelimUnd:bs,escape:rs,link:Ts,nolink:Gt,punctuation:ps,reflink:Ot,reflinkSearch:As,tag:$s,text:os,url:ne},Ss={...et,link:z(/^!?\[(label)\]\((.*?)\)/).replace("label",Re).getRegex(),reflink:z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Re).getRegex()},Pe={...et,emStrongRDelimAst:fs,emStrongLDelim:gs,delLDelim:ks,delRDelim:ys,url:z(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",it).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:z(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",it).getRegex()},Rs={...Pe,br:z(Pt).replace("{2,}","*").getRegex(),text:z(Pe.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Te={normal:Je,gfm:ss,pedantic:ls},de={normal:et,gfm:Pe,breaks:Rs,pedantic:Ss},Ds={"&":"&","<":"<",">":">",'"':""","'":"'"},ot=e=>Ds[e];function V(e,t){if(t){if(G.escapeTest.test(e))return e.replace(G.escapeReplace,ot)}else if(G.escapeTestNoEncode.test(e))return e.replace(G.escapeReplaceNoEncode,ot);return e}function pt(e){try{e=encodeURI(e).replace(G.percentDecode,"%")}catch{return null}return e}function ct(e,t){let n=e.replace(G.findPipe,(r,l,p)=>{let i=!1,g=l;for(;--g>=0&&p[g]==="\\";)i=!i;return i?"|":" |"}),s=n.split(G.splitPipe),a=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),t)if(s.length>t)s.splice(t);else for(;s.length<t;)s.push("");for(;a<s.length;a++)s[a]=s[a].trim().replace(G.slashPipe,"|");return s}function he(e,t,n){let s=e.length;if(s===0)return"";let a=0;for(;a<s&&e.charAt(s-a-1)===t;)a++;return e.slice(0,s-a)}function zs(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let s=0;s<e.length;s++)if(e[s]==="\\")s++;else if(e[s]===t[0])n++;else if(e[s]===t[1]&&(n--,n<0))return s;return n>0?-2:-1}function Is(e,t=0){let n=t,s="";for(let a of e)if(a===" "){let r=4-n%4;s+=" ".repeat(r),n+=r}else s+=a,n++;return s}function ut(e,t,n,s,a){let r=t.href,l=t.title||null,p=e[1].replace(a.other.outputLinkReplace,"$1");s.state.inLink=!0;let i={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:r,title:l,text:p,tokens:s.inlineTokens(p)};return s.state.inLink=!1,i}function Cs(e,t,n){let s=e.match(n.other.indentCodeCompensation);if(s===null)return t;let a=s[1];return t.split(`
|
|
`).map(r=>{let l=r.match(n.other.beginningSpace);if(l===null)return r;let[p]=l;return p.length>=a.length?r.slice(a.length):r}).join(`
|
|
`)}var De=class{options;rules;lexer;constructor(e){this.options=e||le}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:he(n,`
|
|
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],s=Cs(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let s=he(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:he(t[0],`
|
|
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=he(t[0],`
|
|
`).split(`
|
|
`),s="",a="",r=[];for(;n.length>0;){let l=!1,p=[],i;for(i=0;i<n.length;i++)if(this.rules.other.blockquoteStart.test(n[i]))p.push(n[i]),l=!0;else if(!l)p.push(n[i]);else break;n=n.slice(i);let g=p.join(`
|
|
`),h=g.replace(this.rules.other.blockquoteSetextReplace,`
|
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
${g}`:g,a=a?`${a}
|
|
${h}`:h;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,r,!0),this.lexer.state.top=d,n.length===0)break;let b=r.at(-1);if(b?.type==="code")break;if(b?.type==="blockquote"){let S=b,R=S.raw+`
|
|
`+n.join(`
|
|
`),P=this.blockquote(R);r[r.length-1]=P,s=s.substring(0,s.length-S.raw.length)+P.raw,a=a.substring(0,a.length-S.text.length)+P.text;break}else if(b?.type==="list"){let S=b,R=S.raw+`
|
|
`+n.join(`
|
|
`),P=this.list(R);r[r.length-1]=P,s=s.substring(0,s.length-b.raw.length)+P.raw,a=a.substring(0,a.length-S.raw.length)+P.raw,n=R.substring(r.at(-1).raw.length).split(`
|
|
`);continue}}return{type:"blockquote",raw:s,tokens:r,text:a}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),s=n.length>1,a={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let r=this.rules.other.listItemRegex(n),l=!1;for(;e;){let i=!1,g="",h="";if(!(t=r.exec(e))||this.rules.block.hr.test(e))break;g=t[0],e=e.substring(g.length);let d=Is(t[2].split(`
|
|
`,1)[0],t[1].length),b=e.split(`
|
|
`,1)[0],S=!d.trim(),R=0;if(this.options.pedantic?(R=2,h=d.trimStart()):S?R=t[1].length+1:(R=d.search(this.rules.other.nonSpaceChar),R=R>4?1:R,h=d.slice(R),R+=t[1].length),S&&this.rules.other.blankLine.test(b)&&(g+=b+`
|
|
`,e=e.substring(b.length+1),i=!0),!i){let P=this.rules.other.nextBulletRegex(R),Y=this.rules.other.hrRegex(R),T=this.rules.other.fencesBeginRegex(R),A=this.rules.other.headingBeginRegex(R),m=this.rules.other.htmlBeginRegex(R),f=this.rules.other.blockquoteBeginRegex(R);for(;e;){let Z=e.split(`
|
|
`,1)[0],ue;if(b=Z,this.options.pedantic?(b=b.replace(this.rules.other.listReplaceNesting," "),ue=b):ue=b.replace(this.rules.other.tabCharGlobal," "),T.test(b)||A.test(b)||m.test(b)||f.test(b)||P.test(b)||Y.test(b))break;if(ue.search(this.rules.other.nonSpaceChar)>=R||!b.trim())h+=`
|
|
`+ue.slice(R);else{if(S||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(d)||A.test(d)||Y.test(d))break;h+=`
|
|
`+b}S=!b.trim(),g+=Z+`
|
|
`,e=e.substring(Z.length+1),d=ue.slice(R)}}a.loose||(l?a.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(l=!0)),a.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),a.raw+=g}let p=a.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let i of a.items){if(this.lexer.state.top=!1,i.tokens=this.lexer.blockTokens(i.text,[]),i.task){if(i.text=i.text.replace(this.rules.other.listReplaceTask,""),i.tokens[0]?.type==="text"||i.tokens[0]?.type==="paragraph"){i.tokens[0].raw=i.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),i.tokens[0].text=i.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}}let g=this.rules.other.listTaskCheckbox.exec(i.raw);if(g){let h={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};i.checked=h.checked,a.loose?i.tokens[0]&&["paragraph","text"].includes(i.tokens[0].type)&&"tokens"in i.tokens[0]&&i.tokens[0].tokens?(i.tokens[0].raw=h.raw+i.tokens[0].raw,i.tokens[0].text=h.raw+i.tokens[0].text,i.tokens[0].tokens.unshift(h)):i.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):i.tokens.unshift(h)}}if(!a.loose){let g=i.tokens.filter(d=>d.type==="space"),h=g.length>0&&g.some(d=>this.rules.other.anyLine.test(d.raw));a.loose=h}}if(a.loose)for(let i of a.items){i.loose=!0;for(let g of i.tokens)g.type==="text"&&(g.type="paragraph")}return a}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:s,title:a}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=ct(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
`):[],r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===s.length){for(let l of s)this.rules.other.tableAlignRight.test(l)?r.align.push("right"):this.rules.other.tableAlignCenter.test(l)?r.align.push("center"):this.rules.other.tableAlignLeft.test(l)?r.align.push("left"):r.align.push(null);for(let l=0;l<n.length;l++)r.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:r.align[l]});for(let l of a)r.rows.push(ct(l,r.header.length).map((p,i)=>({text:p,tokens:this.lexer.inline(p),header:!1,align:r.align[i]})));return r}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let r=he(n.slice(0,-1),"\\");if((n.length-r.length)%2===0)return}else{let r=zs(t[2],"()");if(r===-2)return;if(r>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let s=t[2],a="";if(this.options.pedantic){let r=this.rules.other.pedanticHrefTitle.exec(s);r&&(s=r[1],a=r[3])}else a=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),ut(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=t[s.toLowerCase()];if(!a){let r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return ut(n,a,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!n||this.rules.inline.punctuation.exec(n))){let a=[...s[0]].length-1,r,l,p=a,i=0,g=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(g.lastIndex=0,t=t.slice(-1*e.length+a);(s=g.exec(t))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(l=[...r].length,s[3]||s[4]){p+=l;continue}else if((s[5]||s[6])&&a%3&&!((a+l)%3)){i+=l;continue}if(p-=l,p>0)continue;l=Math.min(l,l+p+i);let h=[...s[0]][0].length,d=e.slice(0,a+s.index+h+l);if(Math.min(a,l)%2){let S=d.slice(1,-1);return{type:"em",raw:d,text:S,tokens:this.lexer.inlineTokens(S)}}let b=d.slice(2,-2);return{type:"strong",raw:d,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let s=this.rules.inline.delLDelim.exec(e);if(s&&(!s[1]||!n||this.rules.inline.punctuation.exec(n))){let a=[...s[0]].length-1,r,l,p=a,i=this.rules.inline.delRDelim;for(i.lastIndex=0,t=t.slice(-1*e.length+a);(s=i.exec(t))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r||(l=[...r].length,l!==a))continue;if(s[3]||s[4]){p+=l;continue}if(p-=l,p>0)continue;l=Math.min(l,l+p);let g=[...s[0]][0].length,h=e.slice(0,a+s.index+g+l),d=h.slice(a,-a);return{type:"del",raw:h,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,s;return t[2]==="@"?(n=t[1],s="mailto:"+n):(n=t[1],s=n),{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,s;if(t[2]==="@")n=t[0],s="mailto:"+n;else{let a;do a=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(a!==t[0]);n=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},U=class qe{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||le,this.options.tokenizer=this.options.tokenizer||new De,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:G,block:Te.normal,inline:de.normal};this.options.pedantic?(n.block=Te.pedantic,n.inline=de.pedantic):this.options.gfm&&(n.block=Te.gfm,this.options.breaks?n.inline=de.breaks:n.inline=de.gfm),this.tokenizer.rules=n}static get rules(){return{block:Te,inline:de}}static lex(t,n){return new qe(n).lex(t)}static lexInline(t,n){return new qe(n).inlineTokens(t)}lex(t){t=t.replace(G.carriageReturn,`
|
|
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],s=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(G.tabCharGlobal," ").replace(G.spaceLine,""));t;){let a;if(this.options.extensions?.block?.some(l=>(a=l.call({lexer:this},t,n))?(t=t.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.space(t)){t=t.substring(a.raw.length);let l=n.at(-1);a.raw.length===1&&l!==void 0?l.raw+=`
|
|
`:n.push(a);continue}if(a=this.tokenizer.code(t)){t=t.substring(a.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
`)?"":`
|
|
`)+a.raw,l.text+=`
|
|
`+a.text,this.inlineQueue.at(-1).src=l.text):n.push(a);continue}if(a=this.tokenizer.fences(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.heading(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.hr(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.blockquote(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.list(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.html(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.def(t)){t=t.substring(a.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
`)?"":`
|
|
`)+a.raw,l.text+=`
|
|
`+a.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},n.push(a));continue}if(a=this.tokenizer.table(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.lheading(t)){t=t.substring(a.raw.length),n.push(a);continue}let r=t;if(this.options.extensions?.startBlock){let l=1/0,p=t.slice(1),i;this.options.extensions.startBlock.forEach(g=>{i=g.call({lexer:this},p),typeof i=="number"&&i>=0&&(l=Math.min(l,i))}),l<1/0&&l>=0&&(r=t.substring(0,l+1))}if(this.state.top&&(a=this.tokenizer.paragraph(r))){let l=n.at(-1);s&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
|
|
`)?"":`
|
|
`)+a.raw,l.text+=`
|
|
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(a),s=r.length!==t.length,t=t.substring(a.raw.length);continue}if(a=this.tokenizer.text(t)){t=t.substring(a.raw.length);let l=n.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
`)?"":`
|
|
`)+a.raw,l.text+=`
|
|
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(a);continue}if(t){let l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){this.tokenizer.lexer=this;let s=t,a=null;if(this.tokens.links){let i=Object.keys(this.tokens.links);if(i.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!==null;)i.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(s))!==null;)s=s.slice(0,a.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let r;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!==null;)r=a[2]?a[2].length:0,s=s.slice(0,a.index+r)+"["+"a".repeat(a[0].length-r-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let l=!1,p="";for(;t;){l||(p=""),l=!1;let i;if(this.options.extensions?.inline?.some(h=>(i=h.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.escape(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.tag(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.link(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(i.raw.length);let h=n.at(-1);i.type==="text"&&h?.type==="text"?(h.raw+=i.raw,h.text+=i.text):n.push(i);continue}if(i=this.tokenizer.emStrong(t,s,p)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.codespan(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.br(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.del(t,s,p)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.autolink(t)){t=t.substring(i.raw.length),n.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(t))){t=t.substring(i.raw.length),n.push(i);continue}let g=t;if(this.options.extensions?.startInline){let h=1/0,d=t.slice(1),b;this.options.extensions.startInline.forEach(S=>{b=S.call({lexer:this},d),typeof b=="number"&&b>=0&&(h=Math.min(h,b))}),h<1/0&&h>=0&&(g=t.substring(0,h+1))}if(i=this.tokenizer.inlineText(g)){t=t.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(p=i.raw.slice(-1)),l=!0;let h=n.at(-1);h?.type==="text"?(h.raw+=i.raw,h.text+=i.text):n.push(i);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return n}},ze=class{options;parser;constructor(e){this.options=e||le}space(e){return""}code({text:e,lang:t,escaped:n}){let s=(t||"").match(G.notSpaceStart)?.[0],a=e.replace(G.endingNewline,"")+`
|
|
`;return s?'<pre><code class="language-'+V(s)+'">'+(n?a:V(a,!0))+`</code></pre>
|
|
`:"<pre><code>"+(n?a:V(a,!0))+`</code></pre>
|
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
${this.parser.parse(e)}</blockquote>
|
|
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
`}hr(e){return`<hr>
|
|
`}list(e){let t=e.ordered,n=e.start,s="";for(let l=0;l<e.items.length;l++){let p=e.items[l];s+=this.listitem(p)}let a=t?"ol":"ul",r=t&&n!==1?' start="'+n+'"':"";return"<"+a+r+`>
|
|
`+s+"</"+a+`>
|
|
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
`}table(e){let t="",n="";for(let a=0;a<e.header.length;a++)n+=this.tablecell(e.header[a]);t+=this.tablerow({text:n});let s="";for(let a=0;a<e.rows.length;a++){let r=e.rows[a];n="";for(let l=0;l<r.length;l++)n+=this.tablecell(r[l]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
<thead>
|
|
`+t+`</thead>
|
|
`+s+`</table>
|
|
`}tablerow({text:e}){return`<tr>
|
|
${e}</tr>
|
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${V(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let s=this.parser.parseInline(n),a=pt(e);if(a===null)return s;e=a;let r='<a href="'+e+'"';return t&&(r+=' title="'+V(t)+'"'),r+=">"+s+"</a>",r}image({href:e,title:t,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let a=pt(e);if(a===null)return V(n);e=a;let r=`<img src="${e}" alt="${V(n)}"`;return t&&(r+=` title="${V(t)}"`),r+=">",r}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:V(e.text)}},tt=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},F=class Ne{options;renderer;textRenderer;constructor(t){this.options=t||le,this.options.renderer=this.options.renderer||new ze,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new tt}static parse(t,n){return new Ne(n).parse(t)}static parseInline(t,n){return new Ne(n).parseInline(t)}parse(t){this.renderer.parser=this;let n="";for(let s=0;s<t.length;s++){let a=t[s];if(this.options.extensions?.renderers?.[a.type]){let l=a,p=this.options.extensions.renderers[l.type].call({parser:this},l);if(p!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=p||"";continue}}let r=a;switch(r.type){case"space":{n+=this.renderer.space(r);break}case"hr":{n+=this.renderer.hr(r);break}case"heading":{n+=this.renderer.heading(r);break}case"code":{n+=this.renderer.code(r);break}case"table":{n+=this.renderer.table(r);break}case"blockquote":{n+=this.renderer.blockquote(r);break}case"list":{n+=this.renderer.list(r);break}case"checkbox":{n+=this.renderer.checkbox(r);break}case"html":{n+=this.renderer.html(r);break}case"def":{n+=this.renderer.def(r);break}case"paragraph":{n+=this.renderer.paragraph(r);break}case"text":{n+=this.renderer.text(r);break}default:{let l='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(t,n=this.renderer){this.renderer.parser=this;let s="";for(let a=0;a<t.length;a++){let r=t[a];if(this.options.extensions?.renderers?.[r.type]){let p=this.options.extensions.renderers[r.type].call({parser:this},r);if(p!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){s+=p||"";continue}}let l=r;switch(l.type){case"escape":{s+=n.text(l);break}case"html":{s+=n.html(l);break}case"link":{s+=n.link(l);break}case"image":{s+=n.image(l);break}case"checkbox":{s+=n.checkbox(l);break}case"strong":{s+=n.strong(l);break}case"em":{s+=n.em(l);break}case"codespan":{s+=n.codespan(l);break}case"br":{s+=n.br(l);break}case"del":{s+=n.del(l);break}case"text":{s+=n.text(l);break}default:{let p='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return s}},me=class{options;block;constructor(e){this.options=e||le}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?U.lex:U.lexInline}provideParser(e=this.block){return e?F.parse:F.parseInline}},Ls=class{defaults=Fe();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=F;Renderer=ze;TextRenderer=tt;Lexer=U;Tokenizer=De;Hooks=me;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let s of e)switch(n=n.concat(t.call(this,s)),s.type){case"table":{let a=s;for(let r of a.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of a.rows)for(let l of r)n=n.concat(this.walkTokens(l.tokens,t));break}case"list":{let a=s;n=n.concat(this.walkTokens(a.items,t));break}default:{let a=s;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(r=>{let l=a[r].flat(1/0);n=n.concat(this.walkTokens(l,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let r=t.renderers[a.name];r?t.renderers[a.name]=function(...l){let p=a.renderer.apply(this,l);return p===!1&&(p=r.apply(this,l)),p}:t.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=t[a.level];r?r.unshift(a.tokenizer):t[a.level]=[a.tokenizer],a.start&&(a.level==="block"?t.startBlock?t.startBlock.push(a.start):t.startBlock=[a.start]:a.level==="inline"&&(t.startInline?t.startInline.push(a.start):t.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(t.childTokens[a.name]=a.childTokens)}),s.extensions=t),n.renderer){let a=this.defaults.renderer||new ze(this.defaults);for(let r in n.renderer){if(!(r in a))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let l=r,p=n.renderer[l],i=a[l];a[l]=(...g)=>{let h=p.apply(a,g);return h===!1&&(h=i.apply(a,g)),h||""}}s.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new De(this.defaults);for(let r in n.tokenizer){if(!(r in a))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let l=r,p=n.tokenizer[l],i=a[l];a[l]=(...g)=>{let h=p.apply(a,g);return h===!1&&(h=i.apply(a,g)),h}}s.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new me;for(let r in n.hooks){if(!(r in a))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let l=r,p=n.hooks[l],i=a[l];me.passThroughHooks.has(r)?a[l]=g=>{if(this.defaults.async&&me.passThroughHooksRespectAsync.has(r))return(async()=>{let d=await p.call(a,g);return i.call(a,d)})();let h=p.call(a,g);return i.call(a,h)}:a[l]=(...g)=>{if(this.defaults.async)return(async()=>{let d=await p.apply(a,g);return d===!1&&(d=await i.apply(a,g)),d})();let h=p.apply(a,g);return h===!1&&(h=i.apply(a,g)),h}}s.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,r=n.walkTokens;s.walkTokens=function(l){let p=[];return p.push(r.call(this,l)),a&&(p=p.concat(a.call(this,l))),p}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return U.lex(e,t??this.defaults)}parser(e,t){return F.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let s={...n},a={...this.defaults,...s},r=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&s.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let l=a.hooks?await a.hooks.preprocess(t):t,p=await(a.hooks?await a.hooks.provideLexer(e):e?U.lex:U.lexInline)(l,a),i=a.hooks?await a.hooks.processAllTokens(p):p;a.walkTokens&&await Promise.all(this.walkTokens(i,a.walkTokens));let g=await(a.hooks?await a.hooks.provideParser(e):e?F.parse:F.parseInline)(i,a);return a.hooks?await a.hooks.postprocess(g):g})().catch(r);try{a.hooks&&(t=a.hooks.preprocess(t));let l=(a.hooks?a.hooks.provideLexer(e):e?U.lex:U.lexInline)(t,a);a.hooks&&(l=a.hooks.processAllTokens(l)),a.walkTokens&&this.walkTokens(l,a.walkTokens);let p=(a.hooks?a.hooks.provideParser(e):e?F.parse:F.parseInline)(l,a);return a.hooks&&(p=a.hooks.postprocess(p)),p}catch(l){return r(l)}}}onError(e,t){return n=>{if(n.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+V(n.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}},ae=new Ls;function C(e,t){return ae.parse(e,t)}C.options=C.setOptions=function(e){return ae.setOptions(e),C.defaults=ae.defaults,lt(C.defaults),C},C.getDefaults=Fe,C.defaults=le,C.use=function(...e){return ae.use(...e),C.defaults=ae.defaults,lt(C.defaults),C},C.walkTokens=function(e,t){return ae.walkTokens(e,t)},C.parseInline=ae.parseInline,C.Parser=F,C.parser=F.parse,C.Renderer=ze,C.TextRenderer=tt,C.Lexer=U,C.lexer=U.lex,C.Tokenizer=De,C.Hooks=me,C.parse=C,C.options,C.setOptions,C.use,C.walkTokens,C.parseInline,F.parse,U.lex;function Es(e,t){const n=new C.Renderer;return n.blockquote=qs,n.link=Bs,n.image=Ps,$(()=>{const s=t?.minHeadingLevel??1;n.heading=Ns(s);const a=fe(e).trim();return na.sanitize(C(a,{async:!1,renderer:n,gfm:!1,breaks:!1,pedantic:!1}),{ALLOWED_TAGS:["h1","h2","h3","h4","h5","h6","strong","p","a","ul","ol","li","em","del","blockquote"]})})}function Bs({href:e,title:t,text:n}){let s;try{s=new URL(e)}catch{return""}if(s.protocol!=="http:"&&s.protocol!=="https:")return"";let a='<a href="'+e+'" rel="noreferrer noopener"';return t&&(a+=' title="'+t+'"'),a+=">"+n.replaceAll(/(?<!\\)\\([^\\])/g,"$1")+"</a>",a}function Ps({title:e,text:t}){return t||(e??"")}function qs({text:e}){return`<blockquote>${e}</blockquote>`}function Ns(e){return({text:t,depth:n})=>(n=Math.min(6,n+(e-1)),`<h${n}>${t}</h${n}>`)}const Ms=["innerHTML"],Os=B({__name:"MarkdownPreview",props:{text:{},minHeadingLevel:{default:1}},setup(e){const t=Es(()=>e.text,{minHeadingLevel:e.minHeadingLevel});return(n,s)=>(u(),x("div",{class:"settings-markdown",innerHTML:o(t)},null,8,Ms))}}),Zt=N(Os,[["__scopeId","data-v-cf1f9874"]]),Gs=B({__name:"AppDescriptionTab",props:{app:{}},setup(e){return(t,n)=>(u(),D(o(Ce),{id:"desc",name:o(c)("appstore","Description"),order:0},{icon:y(()=>[k(o(L),{path:o(Za)},null,8,["path"])]),default:y(()=>[_("div",{class:w(t.$style.appDescriptionTab)},[k(Zt,{text:e.app.description,minHeadingLevel:3},null,8,["text"])],2)]),_:1},8,["name"]))}}),Zs="_appDescriptionTab_118mz_2",js={appDescriptionTab:Zs},Hs={$style:js},Qs=N(Gs,[["__cssModules",Hs]]),Us=["title"],Fs=B({__name:"BadgeAppDaemon",props:{daemon:{}},setup(e){return(t,n)=>e.daemon?(u(),x("span",{key:0,class:w(t.$style.appDaemonBadge),title:e.daemon.name},[k(o(L),{path:o(vt),size:20,inline:""},null,8,["path"]),q(" "+v(e.daemon.display_name),1)],10,Us)):I("",!0)}}),Vs="_appDaemonBadge_1n34s_2",Ws={appDaemonBadge:Vs},Xs={$style:Ws},jt=N(Fs,[["__cssModules",Xs]]),Ys=["title"],Js=B({__name:"BadgeAppLevel",props:{level:{}},setup(e){const t=e,n=$(()=>t.level===300),s=$(()=>t.level===200),a=$(()=>n.value?_t:He),r=$(()=>n.value?c("appstore","Supported"):c("appstore","Featured")),l=$(()=>n.value?c("appstore","This app is supported via your current Nextcloud subscription."):c("appstore","Featured apps are developed by and within the community. They offer central functionality and are ready for production use."));return(p,i)=>n.value||s.value?(u(),x("span",{key:0,class:w([p.$style.appLevelBadge,{[p.$style.appLevelBadge__supported]:n.value}]),title:l.value},[k(o(L),{path:a.value,size:20,inline:""},null,8,["path"]),q(" "+v(r.value),1)],10,Ys)):I("",!0)}}),Ks="_appLevelBadge_q2et3_2",el="_appLevelBadge__supported_q2et3_15",tl={appLevelBadge:Ks,appLevelBadge__supported:el},al={$style:tl},Ht=N(Js,[["__cssModules",al]]),nl=["aria-label","title"],sl=B({__name:"BadgeAppScore",props:{app:{}},setup(e){const t=$(()=>!e.app.shipped&&e.app.ratingNumOverall&&e.app.ratingNumOverall>5),n=$(()=>e.app.ratingOverall??4),s=$(()=>{const p=(n.value*5).toFixed(1);return c("appstore","Community rating: {score}/5",{score:p})}),a=$(()=>Math.floor(n.value*5+.25)),r=$(()=>Math.min(Math.floor((1-n.value)*5+.25),5-a.value)),l=$(()=>a.value+r.value<5);return(p,i)=>t.value?(u(),x("span",{key:0,role:"img","aria-label":s.value,title:s.value,class:w(p.$style.badgeAppScore)},[(u(!0),x(M,null,j(a.value,g=>(u(),D(o(L),{key:`full-star-${g}`,path:o(He),inline:""},null,8,["path"]))),128)),l.value?(u(),D(o(L),{key:0,path:o(ja),inline:""},null,8,["path"])):I("",!0),(u(!0),x(M,null,j(r.value,g=>(u(),D(o(L),{key:`empty-star-${g}`,path:o(xt),inline:""},null,8,["path"]))),128))],10,nl)):I("",!0)}}),ll="_badgeAppScore_1t97c_2",rl={badgeAppScore:ll},il={$style:rl},ol=N(sl,[["__cssModules",il]]),pl=new ft({concurrency:3}),Qt=ke("groups",()=>{const e=E(new Map);async function t(r){return await pl.add(()=>a(r))}async function n(r){const l=Ge("/cloud/groups/details");try{const{data:p}=await O.get(l,{params:{search:r.trim(),limit:10}});for(const i of p.ocs.data.groups)e.value.has(i.id)||e.value.set(i.id,{id:i.id,displayName:i.displayname,isNoUser:!0})}catch(p){Q.error("Failed to search groups",{error:p})}}function s(r){return e.value.get(r)}return{groups:$(()=>Array.from(e.value.values())),searchGroups:n,getGroupById:s,fetchGroupById:t};async function a(r){return e.value.has(r)||await n(r),e.value.get(r)}});function Ut(e){const t=Qt(),n=E([]);return re(()=>fe(e).groups,async()=>{const s=fe(e).groups;if(s===void 0){n.value=[];return}const a=s.map(l=>t.fetchGroupById(l)),r=await Promise.all(a);n.value=r.filter(Boolean)},{immediate:!0}),dt(n)}const cl={class:"app-details"},ul=["aria-label"],dl=["id"],hl=["aria-labelledby"],gl=["title"],ml=["aria-label"],fl=["href"],bl=B({__name:"AppDetailsTab",props:{app:{}},setup(e){const t=H(),n=Yt(),s=$(()=>e.app.releases?.map(d=>d.lastModified).map(d=>Date.parse(d)).sort().at(-1)),a=$(()=>e.app?[e.app.author].flat().map(h).sort((d,b)=>d.split(" ").at(-1).localeCompare(b.split(" ").at(-1))).join(", "):""),r=$(()=>`https://apps.nextcloud.com/apps/${e.app.id}`),l=Ut(()=>e.app),p=$(()=>{const d=[];return e.app.internal||d.push({id:"appstore",href:r.value,label:c("appstore","View in store")}),e.app.website&&d.push({id:"website",href:e.app.website,label:c("appstore","Visit website")}),e.app.documentation&&(e.app.documentation.user&&d.push({id:"doc-user",href:e.app.documentation.user,label:c("appstore","Usage documentation")}),e.app.documentation.admin&&d.push({id:"doc-admin",href:e.app.documentation.admin,label:c("appstore","Admin documentation")}),e.app.documentation.developer&&d.push({id:"doc-developer",href:e.app.documentation.developer,label:c("appstore","Developer documentation")})),d}),i=$(()=>[e.app.category].flat().map(d=>t.getCategoryById(d)?.displayName??d).join(", ")),g=$(()=>e.app.active&&!Ue(e.app));function h(d){return d["@value"]?d["@value"]:d}return(d,b)=>(u(),D(o(Ce),{id:"details",name:o(c)("appstore","Details"),order:1},{icon:y(()=>[k(o(L),{path:o(Ha)},null,8,["path"])]),default:y(()=>[_("div",cl,[_("div",{class:w(d.$style.appstoreDetailsTab__badges)},[k(Ht,{level:e.app.level},null,8,["level"]),e.app.app_api&&e.app.daemon?(u(),D(jt,{key:0,daemon:e.app.daemon},null,8,["daemon"])):I("",!0),k(ol,{app:e.app},null,8,["app"])],2),!e.app.isCompatible&&e.app.missingDependencies&&e.app.missingDependencies.length?(u(),D(o(at),{key:0,type:"error"},{default:y(()=>[q(v(o(c)("appstore","This app cannot be installed because the following dependencies are not fulfilled:"))+" ",1),_("ul",{"aria-label":o(c)("appstore","Missing dependencies"),class:w(d.$style.appstoreDetailsTab__missingDependencies)},[(u(!0),x(M,null,j(e.app.missingDependencies,(S,R)=>(u(),x("li",{key:R},v(S),1))),128))],10,ul)]),_:1})):I("",!0),g.value?(u(),D(o(at),{key:1,type:"info"},{default:y(()=>[q(v(o(c)("appstore","This app cannot be limited to groups because it provides functionality that is executed before group membership is determined.")),1)]),_:1})):I("",!0),o(l).length?(u(),x("div",{key:2,class:w(d.$style.appstoreDetailsTab__section)},[_("h4",{id:o(n)},v(o(c)("appstore","Limited to groups")),9,dl),_("ul",{"aria-labelledby":o(n),class:w(d.$style.appstoreDetailsTab__sectionDetails)},[(u(!0),x(M,null,j(o(l),S=>(u(),x("li",{key:S.id,title:S.id},v(S.displayName),9,gl))),128))],10,hl)],2)):I("",!0),s.value&&!e.app.shipped?(u(),x("div",{key:3,class:w(d.$style.appstoreDetailsTab__section)},[_("h4",null,v(o(c)("appstore","Latest updated")),1),k(o(ba),{class:w(d.$style.appstoreDetailsTab__sectionDetails),timestamp:s.value},null,8,["class","timestamp"])],2)):I("",!0),_("div",{class:w(d.$style.appstoreDetailsTab__section)},[_("h4",null,v(o(c)("appstore","Author")),1),_("p",{class:w(d.$style.appstoreDetailsTab__sectionDetails)},v(a.value),3)],2),_("div",{class:w(d.$style.appstoreDetailsTab__section)},[_("h4",null,v(o(c)("appstore","Categories")),1),_("p",{class:w(d.$style.appstoreDetailsTab__sectionDetails)},v(i.value),3)],2),p.value.length>0?(u(),x("div",{key:4,class:w(d.$style.appstoreDetailsTab__section)},[_("h4",null,v(o(c)("appstore","Resources")),1),_("ul",{class:w(d.$style.appstoreDetailsTab__resources),"aria-label":o(c)("appstore","Documentation resources")},[(u(!0),x(M,null,j(p.value,S=>(u(),x("li",{key:S.id,class:w(d.$style.appstoreDetailsTab__resourcesItem)},[_("a",{class:w(d.$style.appstoreDetailsTab__resourcesLink),href:S.href,target:"_blank",rel:"noreferrer noopener"},v(S.label)+" ↗ ",11,fl)],2))),128))],10,ml)],2)):I("",!0)])]),_:1},8,["name"]))}}),kl="_appstoreDetailsTab__badges_4x76r_2",_l="_appstoreDetailsTab__section_4x76r_8",yl="_appstoreDetailsTab__sectionDetails_4x76r_18",wl="_appstoreDetailsTab__missingDependencies_4x76r_22",vl="_appstoreDetailsTab__resourcesLink_4x76r_28",xl="_appstoreDetailsTab__resourcesItem_4x76r_32",$l={appstoreDetailsTab__badges:kl,appstoreDetailsTab__section:_l,appstoreDetailsTab__sectionDetails:yl,appstoreDetailsTab__missingDependencies:wl,appstoreDetailsTab__resourcesLink:vl,appstoreDetailsTab__resourcesItem:xl},Tl={$style:$l},Al=N(bl,[["__cssModules",Tl]]),Sl=B({__name:"AppReleasesTab",props:{app:{}},setup(e){const t=e,n=$(()=>(t.app.releases??[]).filter(a=>{const r=Object.values(a.translations??{});return r.length>0&&r.some(({changelog:l})=>!!l)}));function s(a){return a.translations[sa()]?.changelog??a.translations.en?.changelog??""}return(a,r)=>n.value.length>0?(u(),D(o(Ce),{key:0,id:"changelog",name:o(c)("appstore","Changelog"),order:2},{icon:y(()=>[k(o(L),{path:o(Qa),size:24},null,8,["path"])]),default:y(()=>[(u(!0),x(M,null,j(n.value,l=>(u(),x("div",{key:l.version,class:w(a.$style.appReleasesTab)},[_("h3",{class:w(a.$style.appReleasesTab__heading)},v(l.version),3),k(Zt,{class:w(a.$style.appReleasesTab__text),minHeadingLevel:3,text:s(l)},null,8,["class","text"])],2))),128))]),_:1},8,["name"])):I("",!0)}}),Rl="_appReleasesTab__heading_9xawz_2",Dl="_appReleasesTab__text_9xawz_7",zl={appReleasesTab__heading:Rl,appReleasesTab__text:Dl},Il={$style:zl},Cl=N(Sl,[["__cssModules",Il]]),Ll={id:"disable",icon:yt,order:10,enabled:St,label:()=>c("appstore","Disable"),async callback(e){await H().disableApp(e.id)}},El={id:"enable",icon:wt,order:1,variant:"primary",enabled(e){return!pe(e)&&Tt(e)},label:()=>c("appstore","Enable"),async callback(e){await H().enableApp(e.id)}},Bl={id:"force-enable",icon:Ua,order:3,inline:!1,variant:"warning",label:()=>c("appstore","Force enable"),enabled(e){return!pe(e)&&At(e)&&ve(e)},async callback(e){await H().enableApp(e.id,!0)}},Pl={id:"install",icon:je,order:5,enabled(e){return pe(e)&&!ve(e)},label:e=>e.app_api?c("appstore","Deploy and enable"):e.needsDownload?c("appstore","Download and enable"):c("appstore","Install and enable"),async callback(e){await H().enableApp(e.id)}},ql={id:"install-forced",icon:je,order:5,inline:!1,enabled(e){return pe(e)&&ve(e)},label:e=>e.app_api?c("appstore","Deploy and force enable"):e.needsDownload?c("appstore","Download and force enable"):c("appstore","Install and force enable"),async callback(e){await H().enableApp(e.id,!0)}},Nl=[{id:"rate",icon:xt,order:30,inline:!1,label:()=>c("appstore","Rate the app"),enabled(e){return!e.shipped},href(e){return`https://apps.nextcloud.com/apps/${encodeURIComponent(e.id)}#comments`}},{id:"report-bug",icon:Fa,order:32,inline:!1,label:()=>c("appstore","Report a bug"),enabled(e){return!!e.bugs},href(e){return e.bugs}},{id:"discussion",icon:Va,order:35,inline:!1,label:()=>c("appstore","Ask questions or discuss the app"),enabled(e){return!!e.discussion},href(e){return e.discussion}},{id:"website",icon:Wa,order:38,inline:!1,label:()=>c("appstore","Visit the website"),enabled(e){return!!e.website},href(e){return e.website}}],Ml=Jt(()=>oe(()=>Promise.resolve().then(()=>br),void 0,import.meta.url)),Ol={id:"limit-to-group",icon:Xa,order:16,inline:!1,label:()=>c("appstore","Limit to groups"),enabled:Ue,async callback(e){await kt(Ml,{app:e})}},Gl={id:"remove",order:20,icon:Ya,variant:"error",inline:!1,enabled:$t,label:()=>c("appstore","Remove"),async callback(e){await H().uninstallApp(e.id)}},Zl={id:"update",icon:Ja,variant:"primary",order:0,enabled(e){return yn(e)?e.app_api?e.daemon&&e.daemon?.accepts_deploy_id==="manual-install"?!0:xe().daemonAccessible:!0:!1},label:e=>c("appstore","Update to {version}",{version:e.update}),async callback(e){await zt().updateApp(e.id)}},jl=[Zl,El,Ll,Bl,Pl,ql,Gl,Ol,...Nl].sort((e,t)=>e.order-t.order);function Ft(e){return $(()=>fe(e)?jl.filter(t=>t.enabled(fe(e))):[])}function Hl(e){const t=E(null),n=$(()=>{let s;return e.value?.app_api?s=Se:s=[e.value?.category??[]].flat().map(a=>X[a]).filter(a=>!!a).at(0)??(e.value?.app_api?Se:Ka),s?`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="${s}" /></svg>`:null});return Kt(async()=>{if(!e.value?.icon)t.value=n.value;else{t.value=null;try{const s=await(await(await window.fetch(e.value.icon)).blob()).text();t.value=s.replaceAll(/fill="#(fff|ffffff)([a-z0-9]{1,2})?"/ig,'fill="currentColor"')}catch(s){t.value=n.value,Q.error("Could not load app icon",{error:s})}}}),{appIcon:t}}const Ql=B({__name:"AppstoreSidebar",setup(e){const t=_e(),n=Oe(),s=H(),a=It(),r=$(()=>[t.params.id].flat()[0]),l=$(()=>s.getAppById(r.value)??null),{appIcon:p}=Hl(l),i=$(()=>l.value?l.value.license?c("appstore","Version {version}, {license}-licensed",{version:l.value.version,license:String(l.value.license).toUpperCase()}):c("appstore","Version {version}",{version:l.value.version}):""),g=E("details");re([l],()=>{g.value="details"});function h(){n.replace({name:t.name,params:{...t.params,id:void 0},query:a.getQuery()})}const d=E(!1),b=$(()=>l.value?.screenshot&&d.value);function S(){if(l.value?.releases&&l.value?.screenshot){const P=new Image;P.onload=()=>{d.value=!0},P.src=l.value.screenshot}}re([l],S),ea(S);const R=Ft(()=>l.value);return(P,Y)=>(u(),D(o(ha),{active:g.value,"onUpdate:active":Y[0]||(Y[0]=T=>g.value=T),class:w([P.$style.appstoreSidebar,{[P.$style.appstoreSidebar_withScreenshot]:b.value}]),background:b.value?l.value.screenshot:void 0,compact:!b.value,name:l.value?.name??r.value,title:l.value?.name??r.value,subname:i.value,subtitle:i.value,onClose:h},Me({default:y(()=>[l.value?(u(),x(M,{key:1},[k(Qs,{app:l.value},null,8,["app"]),k(Cl,{app:l.value},null,8,["app"]),k(Al,{app:l.value},null,8,["app"]),l.value.app_api?(u(),D(Un,{key:0,app:l.value},null,8,["app"])):I("",!0)],64)):(u(),D(o(Ze),{key:0,name:"No such app"}))]),_:2},[b.value?void 0:{name:"header",fn:y(()=>[k(o(L),{class:w(P.$style.appstoreSidebar__fallbackIcon),svg:o(p)??"",size:64},null,8,["class","svg"])]),key:"0"},l.value?{name:"description",fn:y(()=>[k(Ct,{app:l.value,actions:o(R),iconOnly:"",maxInlineActions:6},null,8,["app","actions"])]),key:"1"}:void 0]),1032,["active","class","background","compact","name","title","subname","subtitle"]))}}),Ul="_appstoreSidebar_withScreenshot_1224s_3",Fl="_appstoreSidebar__fallbackIcon_1224s_9",Vl={appstoreSidebar_withScreenshot:Ul,appstoreSidebar__fallbackIcon:Fl},Wl={$style:Vl},Xl=N(Ql,[["__cssModules",Wl]]),Yl=B({__name:"AppstoreApp",setup(e){const t=_e(),n=H(),s=$(()=>t.params.category?[t.params.category].flat()[0]:t.name==="apps-bundles"?"bundles":t.name==="apps-search"?"search":"discover"),a=$(()=>s.value in W?W[s.value]:n.getCategoryById(s.value)?.displayName??s.value),r=$(()=>`${a.value} - ${c("appstore","App store")}`),l=$(()=>!!t.params.id);return(p,i)=>{const g=ta("router-view");return u(),D(o(oa),{appName:"appstore"},{default:y(()=>[k(qn),k(o(ia),{class:w(p.$style.appstoreApp__content),pageHeading:o(c)("appstore","App store"),pageTitle:r.value},{default:y(()=>[a.value?(u(),x("h2",{key:0,class:w(p.$style.appstoreApp__heading)},v(a.value),3)):I("",!0),k(g)]),_:1},8,["class","pageHeading","pageTitle"]),l.value?(u(),D(Xl,{key:0})):I("",!0)]),_:1})}}}),Jl="_appstoreApp__content_1pi7x_2",Kl="_appstoreApp__heading_1pi7x_7",er={appstoreApp__content:Jl,appstoreApp__heading:Kl},tr={$style:er},ar=N(Yl,[["__cssModules",tr]]),nr=ee("appstore","appstoreEnabled",!0),sr=()=>oe(()=>import("./AppstoreDiscover-BbuVnQg2.chunk.mjs"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72]),import.meta.url),lr=()=>oe(()=>import("./AppstoreSearch-68Yafz1S.chunk.mjs").then(e=>e.c),__vite__mapDeps([73,5,6,3,1,4,7,8,9,18,19,15,16,32,33,2,10,25,13,14,26,27,23,24,28,29,30,31,12,17,34,20,21,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,74,71,72]),import.meta.url),rr=()=>oe(()=>Promise.resolve().then(()=>ii),void 0,import.meta.url),ir=()=>oe(()=>import("./AppstoreBrowse-SP2lBd28.chunk.mjs"),__vite__mapDeps([75,5,6,3,1,4,7,8,9,18,19,15,16,73,32,33,2,10,25,13,14,26,27,23,24,28,29,30,31,12,17,34,20,21,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,74,71,72,11,22,68,69,76]),import.meta.url),or=()=>oe(()=>import("./AppstoreSearch-68Yafz1S.chunk.mjs").then(e=>e.d),__vite__mapDeps([73,5,6,3,1,4,7,8,9,18,19,15,16,32,33,2,10,25,13,14,26,27,23,24,28,29,30,31,12,17,34,20,21,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,74,71,72]),import.meta.url),pr=[{path:"/:index(index.php/)?settings/apps",name:"apps",redirect:nr?{name:"apps-discover"}:{name:"apps-manage",params:{category:"installed"}},children:[{path:"discover/:id?",name:"apps-discover",component:sr},{path:"bundles/:id?",name:"apps-bundles",component:rr},{path:":category(installed|enabled|disabled|updates)/:id?",name:"apps-manage",component:lr},{path:":category/:id?",name:"apps-category",component:ir},{path:"search/:id?",name:"apps-search",component:or}]}],cr=la({history:ra(K("")),linkActiveClass:"active",routes:pr}),ur=Vt(),Ae=aa(ar);Ae.config.idPrefix="appstore",Ae.use(ur),Ae.use(cr),Ae.mount("#content");const dr=B({__name:"LimitToGroupDialog",props:{app:{}},emits:["close"],setup(e,{emit:t}){const n=t,s=H(),a=Qt(),r=E(!1),l=E([]);re(()=>e.app,()=>{l.value=(e.app.groups??[]).map(d=>{const b=a.getGroupById(d);return b||a.searchGroups(d),b??{id:d,displayName:d,isNoUser:!0}})},{immediate:!0});const p=$(()=>a.groups.filter(d=>!l.value.includes(d))),i=nn(a.searchGroups,400);async function g(){try{r.value=!0,await s.limitAppToGroups(e.app.id,l.value.map(d=>d.id)),n("close")}finally{r.value=!1}}async function h(){try{r.value=!0,await s.limitAppToGroups(e.app.id,[]),n("close")}finally{r.value=!1}}return(d,b)=>(u(),D(o(bt),{isForm:"",name:o(c)("appstore","Limit to groups"),onSubmit:g,onReset:h},{actions:y(()=>[k(o(ie),{disabled:r.value,type:"reset"},{default:y(()=>[q(v(o(c)("appstore","Reset limitation")),1)]),_:1},8,["disabled"]),k(o(ie),{disabled:r.value,type:"submit",variant:"primary"},Me({default:y(()=>[q(" "+v(o(c)("appstore","Save")),1)]),_:2},[r.value?{name:"icon",fn:y(()=>[k(o(Ie))]),key:"0"}:void 0]),1032,["disabled"])]),default:y(()=>[_("p",null,v(o(c)("appstore","Restrict the usage of {app} to members of the following groups.",{app:e.app.name})),1),k(o(ga),{modelValue:l.value,"onUpdate:modelValue":b[0]||(b[0]=S=>l.value=S),class:w(d.$style.limitToGroupDialog__input),keepOpen:"",labelOutside:"",multiple:"",options:p.value,onSearch:o(i)},null,8,["modelValue","class","options","onSearch"])]),_:1},8,["name"]))}}),hr="_limitToGroupDialog__input_sofp5_2",gr={limitToGroupDialog__input:hr},mr={$style:gr},fr=N(dr,[["__cssModules",mr]]),br=Object.freeze(Object.defineProperty({__proto__:null,default:fr},Symbol.toStringTag,{value:"Module"})),kr=["src","height","width"],_r=B({__name:"AppIcon",props:{app:{},noFallback:{type:Boolean},size:{default:20}},setup(e){const t=$(()=>e.app.icon?.endsWith(".svg")),n=E("");return re(()=>e.app.icon,async()=>{if(n.value="",e.app.icon?.endsWith(".svg")){const s=await fetch(e.app.icon);s.ok&&(n.value=await s.text())}},{immediate:!0}),(s,a)=>(u(),x("span",{class:w(s.$style.appIcon)},[n.value?(u(),D(o(L),{key:0,size:e.size,svg:n.value},null,8,["size","svg"])):e.app.icon&&!t.value?(u(),x("img",{key:1,class:w(s.$style.appIcon__image),alt:"",src:e.app.icon,height:e.size,width:e.size},null,10,kr)):e.noFallback?I("",!0):(u(),D(o(L),{key:2,path:o(Se),size:e.size},null,8,["path","size"]))],2))}}),yr="_appIcon_mcsmb_2",wr="_appIcon__image_mcsmb_7",vr={appIcon:yr,appIcon__image:wr},xr={$style:vr},$r=N(_r,[["__cssModules",xr]]),Tr={key:0,class:"hidden-visually"},Ar={class:"hidden-visually"},Sr={key:0},Rr={key:1},Dr=["title"],zr={key:0,"aria-hidden":"true"},Ir=B({__name:"AppTableRow",props:{app:{},isNarrow:{type:Boolean},isWide:{type:Boolean}},setup(e){const t=_e(),n=$(()=>({...t,params:{...t.params,id:e.app.id},query:{...t.query}})),s=$(()=>({id:"details",order:99,enabled:()=>!0,label:()=>c("appstore","Show details"),icon:en,to:()=>n.value,inline:!1})),a=Ut(()=>e.app),r=Ft(()=>e.app),l=$(()=>[...r.value,s.value]);return(p,i)=>(u(),x("tr",{class:w(p.$style.appTableRow)},[_("td",{class:w(p.$style.appTableRow__nameCell)},[k(o(ie),{alignment:"start",title:o(c)("appstore","Show details"),to:n.value,variant:"tertiary-no-background",wide:""},{icon:y(()=>[e.app.loading?(u(),D(o(Ie),{key:0,size:24})):(u(),D($r,{key:1,app:e.app,size:24},null,8,["app"]))]),default:y(()=>[q(" "+v(e.app.name)+" ",1),e.app.loading?(u(),x("span",Tr,"("+v(o(c)("appstore","is loading…"))+")",1)):I("",!0),_("span",Ar,"("+v(o(c)("appstore","Show details"))+")",1)]),_:1},8,["title","to"])],2),_("td",null,[_("span",{class:w(p.$style.appTableRow__versionCell)},v(e.app.version),3)]),e.isNarrow?I("",!0):(u(),x("td",Sr,[_("div",{class:w(p.$style.appTableRow__levelCell)},[e.app.level?(u(),D(Ht,{key:0,level:e.app.level},null,8,["level"])):I("",!0),"daemon"in e.app&&e.app.daemon?(u(),D(jt,{key:1,daemon:e.app.daemon},null,8,["daemon"])):I("",!0)],2)])),e.isWide?(u(),x("td",Rr,[o(a).length>0?(u(),x("ul",{key:0,class:w(p.$style.appTableRow__groupsCell),title:o(a).map(g=>g.displayName).join(", ")},[(u(!0),x(M,null,j(o(a),(g,h)=>(u(),x(M,{key:g.id},[h===3?(u(),x("li",zr," … ")):I("",!0),_("li",{class:w({"hidden-visually":h>2})},[k(o(ya),{text:g.displayName,noClose:""},null,8,["text"])],2)],64))),128))],10,Dr)):I("",!0)])):I("",!0),_("td",null,[_("div",{class:w(p.$style.appTableRow__actionsCell)},[k(Ct,{class:w(p.$style.appTableRow__actionsCellActions),app:e.app,actions:l.value,iconOnly:e.isNarrow},null,8,["class","app","actions","iconOnly"])],2)])],2))}}),Cr="_appTableRow_yekky_2",Lr="_appTableRow__nameCell_yekky_11",Er="_appTableRow__levelCell_yekky_16",Br="_appTableRow__versionCell_yekky_22",Pr="_appTableRow__groupsCell_yekky_26",qr="_appTableRow__actionsCell_yekky_31",Nr="_appTableRow__actionsCellActions_yekky_37",Mr={appTableRow:Cr,appTableRow__nameCell:Lr,appTableRow__levelCell:Er,appTableRow__versionCell:Br,appTableRow__groupsCell:Pr,appTableRow__actionsCell:qr,appTableRow__actionsCellActions:Nr},Or={$style:Mr},Gr=N(Ir,[["__cssModules",Or]]),Zr={hidden:""},jr={key:0},Hr={key:1},Qr=B({__name:"AppTable",props:{apps:{}},setup(e){const t=ht("table"),{width:n}=sn(t),s=$(()=>n.value<768),a=$(()=>n.value>=1280);return(r,l)=>(u(),x("table",{ref:"table",class:w([r.$style.appTable,{[r.$style.appTable_narrow]:s.value,[r.$style.appTable_wide]:a.value}])},[_("colgroup",null,[_("col",{class:w(r.$style.appTable__colName)},null,2),_("col",{class:w(r.$style.appTable__colVersion)},null,2),s.value?I("",!0):(u(),x("col",{key:0,class:w(r.$style.appTable__colSupport)},null,2)),a.value?(u(),x("col",{key:1,class:w(r.$style.appTable__colGroups)},null,2)):I("",!0),_("col",{class:w(r.$style.appTable__colActions)},null,2)]),_("thead",Zr,[_("tr",null,[_("th",null,v(o(c)("appstore","App name")),1),_("th",null,v(o(c)("appstore","Version")),1),s.value?I("",!0):(u(),x("th",jr,v(o(c)("appstore","Support level")),1)),a.value?(u(),x("th",Hr,v(o(c)("appstore","Groups")),1)):I("",!0),_("th",null,v(o(c)("appstore","Actions")),1)])]),_("tbody",null,[(u(!0),x(M,null,j(e.apps,p=>(u(),D(Gr,{key:p.id,app:p,isNarrow:s.value,isWide:a.value},null,8,["app","isNarrow","isWide"]))),128))])],2))}}),Ur="_appTable_ss46x_2",Fr="_appTable__colName_ss46x_7",Vr="_appTable_narrow_ss46x_11",Wr="_appTable_wide_ss46x_15",Xr="_appTable__colSupport_ss46x_19",Yr="_appTable__colActions_ss46x_27",Jr={appTable:Ur,appTable__colName:Fr,appTable_narrow:Vr,appTable_wide:Wr,appTable__colSupport:Xr,appTable__colActions:Yr},Kr={$style:Jr},ei=N(Qr,[["__cssModules",Kr]]),ti=B({__name:"AppstoreBundles",setup(e){const t=H(),n=$(()=>t.bundles.map(l=>({...l,apps:l.appIdentifiers.map(p=>t.apps.find(i=>i.id===p)).filter(Boolean),isEnabling:!1})));function s(l){return l.appIdentifiers.every(p=>{const i=t.apps.find(g=>g.id===p);return i&&(i.active||Tt(i))})}function a(l){return l.appIdentifiers.every(p=>{const i=t.apps.find(g=>g.id===p);return i&&i.active})}async function r(l){l.isEnabling=!0,await t.enableBundle(l.id),l.isEnabling=!1}return(l,p)=>o(t).isLoadingApps?(u(),D(o(Ze),{key:0,name:o(c)("appstore","Loading app list")},{icon:y(()=>[k(o(Ie),{size:64})]),_:1},8,["name"])):(u(!0),x(M,{key:1},j(n.value,i=>(u(),x("section",{key:i.id},[_("div",{class:w(l.$style.appstoreBundles__header)},[_("h3",null,v(i.name),1),a(i)?I("",!0):(u(),D(o(ie),{key:0,disabled:!s(i),variant:"primary",onClick:g=>r(i)},{icon:y(()=>[k(o(L),{path:o(tn)},null,8,["path"])]),default:y(()=>[q(" "+v(o(c)("appstore","Download and enable all")),1)]),_:1},8,["disabled","onClick"]))],2),k(ei,{class:w(l.$style.appstoreBundles__appTable),apps:i.apps},null,8,["class","apps"])]))),128))}}),ai="_appstoreBundles__header_oplvy_2",ni="_appstoreBundles__appTable_oplvy_11",si={appstoreBundles__header:ai,appstoreBundles__appTable:ni},li={$style:si},ri=N(ti,[["__cssModules",li]]),ii=Object.freeze(Object.defineProperty({__proto__:null,default:ri},Symbol.toStringTag,{value:"Module"}));export{Ji as A,ol as B,St as a,It as b,pe as c,ei as d,Ht as e,jt as f,Q as l,ve as n,H as u};
|
|
//# sourceMappingURL=appstore-main.mjs.map
|