1import{u as ae,d as ne,c as se,l as oe,t as ie,_ as re,f as le}from"./index-mGgJqOFQ.js";import{d as me,y as ue,S as pe,bo as de,bn as ce,E as P,r as _e,at as fe,o as s,c as u,u as e,F as D,g as l,t as o,a as h,w as c,b as p,q as $,j as i,au as T,a4 as ve,$ as he,m as ge,p as ke,a1 as ye,z as be,f as we,I as $e,bk as Ie,bz as qe,bl as E,V as Ae,bI as Ve,bB as L,U as Se,bL as Ce,_ as Be}from"./core-Cu1dlvv4.js";import{a as De}from"./configPanels-QFHoDkb6.js";import{u as Ne}from"./useAutoModal-CaK8mTFj.js";import{_ as Fe}from"./DomainForm.vue_vue_type_script_setup_true_lang-Bppg_2GX.js";import{a as Pe,f as Te,b as Ee,c as Le}from"./appData-B2bTUKZe.js";import{_ as Re}from"./_AppIntegrationAndLinks.vue_vue_type_script_setup_true_lang-Blkei5hr.js";const je={class:"p-3 mb-4"},Oe={class:"d-md-flex align-items-center mb-4"},Ue={class:"mb-3 mb-md-0"},ze={class:"text-secondary"},xe={class:"d-block mb-2"},Me={class:"antifeatures"},We={class:"d-inline"},Ye={class:"d-inline"},Ge={key:1},Ke={key:0},Qe={key:1},He={key:2},Je={key:0},Xe={key:1},Ze=me({__name:"AppInstall",props:{id:{}},async setup(Q){let q,R;const j=Q,{t:_}=ue(),H=pe(),O=Ne(),[t,m,U]=([q,R]=de(()=>E.fetchAll([{uri:"apps/catalog?full&with_categories&with_antifeatures"},{uri:`apps/manifest?app=${j.id}&with_screenshot`}]).then(([n,a])=>{var x,M;const g=Object.fromEntries(n.antifeatures.map(v=>[v.id,v])),{id:k,name:d,version:y,screenshot:f,requirements:b}=a,I=Te(a.quality),V=L((x=a.notifications.PRE_INSTALL)==null?void 0:x.main),S=(M=a.antifeatures)!=null&&M.length?a.antifeatures.map(v=>{var G,K;const W=g[v],Y=(K=(G=n.apps[k])==null?void 0:G.manifest.antifeatures)==null?void 0:K[v];return Y&&(W.description=L(Y)),W}):null,C=I.variant==="danger"||!b.ram.passed,w=Se(b).every(v=>v==="ram"||b[v].passed),r={id:k,name:d,alternativeTo:Ce(a.potential_alternative_to),description:L(a.doc.DESCRIPTION||a.description),screenshot:f,demo:a.upstream.demo,version:y,license:a.upstream.license,integration:Le(a.integration,a.packaging_format),links:Ee(a),preInstall:V,antifeatures:S,quality:I,requirements:b,hasWarning:!!V||S||I.variant==="warning",hasDanger:C,hasSupport:w,canInstall:w&&!C},{form:F,fields:B}=De([{type:"string",id:"label",ask:_("label_for_manifestname",{name:d}),default:d,help:_("label_for_manifestname_help"),optional:!1},...a.install]);return[r,F,B]})),q=await q,R(),q),{domainsAsChoices:J}=ce(),{v:X,onSubmit:Z}=ae(m,U),N=P(!1),A=P(!1),z=P(""),ee=Z(async n=>{if("path"in m.value&&m.value.path==="/"&&!await O(_("confirm_install_domain_root",{domain:m.value.domain})))return;const{label:a,...g}=await Ie(m,{removeNullish:!0}),k={app:j.id,label:a,args:Object.entries(g).length?qe(g):void 0};E.post({uri:"apps",data:k}).then(async d=>{const y=Pe(d.notifications);if(y){const f=_("app.install.notifs.post.alert")+` 2 3`+y;await O(f,{title:_("app.install.notifs.post.title",{name:t.name})},{markdown:!0,cancelable:!1})}H.push({name:"app-list"})}).catch(n)});function te(n){E.post({uri:"domains",cachePath:`domains.${n.domain}`,data:n}).then(()=>{m.value.domain=n.domain,A.value=!1}).catch(a=>{if(!(a instanceof Ae))throw a;z.value=a.message})}return(n,a)=>{const g=ne,k=we,d=_e("VueShowdown"),y=Ve,f=re,b=se,I=ie,V=ye,S=oe,C=le,w=fe("t");return s(),u("div",null,[e(t)?(s(),u(D,{key:0},[l("section",je,[l("div",Oe,[l("h1",Ue,o(e(t).name),1),e(t).demo?(s(),h(k,{key:0,href:e(t).demo,target:"_blank",variant:"primary",class:"ms-auto"},{default:c(()=>[p(g,{iname:"external-link"}),$(" "+o(n.$t("app.install.try_demo")),1)]),_:1},8,["href"])):i("",!0)]),l("p",ze,[$(o(n.$t("app.install.version",{version:e(t).version})),1),a[5]||(a[5]=l("br",null,null,-1)),e(t).alternativeTo?(s(),u(D,{key:0},[$(o(n.$t("app.potential_alternative_to"))+" "+o(e(t).alternativeTo),1)],64)):i("",!0)]),p(d,{markdown:e(t).description},null,8,["markdown"]),e(t).screenshot?(s(),h(y,{key:0,src:e(t).screenshot,"aria-hidden":"true",class:"d-block",fluid:""},null,8,["src"])):i("",!0)]),p(Re,{integration:e(t).integration,links:e(t).links},null,8,["integration","links"]),e(t).hasWarning?(s(),h(f,{key:0,variant:"warning",class:"my-4"},{default:c(()=>[l("h2",null,o(n.$t("app.install.notifs.pre.warning")),1),e(t).antifeatures?(s(),u(D,{key:0},[T(l("strong",xe,null,512),[[w,"app.antifeatures"]]),l("dl",Me,[(s(!0),u(D,null,ve(e(t).antifeatures,r=>(s(),u("div",{key:r.id},[l("dt",We,[p(g,{iname:r.icon,class:"md me-1"},null,8,["iname"]),$(" "+o(r.title)+": ",1)]),l("dd",Ye,o(r.description),1)]))),128))])],64)):i("",!0),e(t).quality.state==="lowquality"?(s(),u("div",Ge,[T(l("p",null,null,512),[[w,"app.install.problems.lowquality"]]),p(d,{class:"mb-3",markdown:e(_)("app.upvote",{id:n.id})},null,8,["markdown"])])):i("",!0),e(t).preInstall?(s(),h(d,{key:2,markdown:e(t).preInstall},null,8,["markdown"])):i("",!0)]),_:1})):i("",!0),e(t).hasSupport?e(t).hasDanger?(s(),h(f,{key:2,variant:"danger",class:"my-4"},{default:c(()=>[l("h2",null,o(n.$t("app.install.notifs.pre.danger")),1),["inprogress","broken","thirdparty"].includes(e(t).quality.state)?(s(),u("div",Je,[T(l("p",null,null,512),[[w,"app.install.problems."+e(t).quality.state]]),p(d,{class:"mb-3",markdown:e(_)("app.upvote",{id:n.id})},null,8,["markdown"])])):i("",!0),e(t).requirements.ram.passed?i("",!0):(s(),u("p",Xe,o(e(t).requirements.ram.error),1)),p(b,{id:"force-install",modelValue:N.value,"onUpdate:modelValue":a[0]||(a[0]=r=>N.value=r),label:n.$t("app.install.problems.ignore")},null,8,["modelValue","label"])]),_:1})):i("",!0):(s(),h(f,{key:1,variant:"danger",icon:"warning",class:"my-4"},{default:c(()=>[l("h2",null,o(n.$t("app.install.notifs.pre.critical")),1),e(t).requirements.ar
3ch.passed?i("",!0):(s(),u("p",Ke,o(e(t).requirements.arch.error),1)),e(t).requirements.install.passed?i("",!0):(s(),u("p",Qe,o(e(t).requirements.install.error),1)),e(t).requirements.required_yunohost_version.passed?i("",!0):(s(),u("p",He,o(e(t).requirements.required_yunohost_version.error),1))]),_:1})),e(t).canInstall||N.value?(s(),h(C,{key:3,modelValue:e(m),"onUpdate:modelValue":a[3]||(a[3]=r=>$e(m)?m.value=r:null),fields:e(U),title:n.$t("app_install_parameters"),icon:"cog","submit-text":n.$t("install"),validations:e(X),onSubmit:e(ee)},he({_:2},[e(m).domain?{name:"field:domain",fn:c(r=>[p(S,ge(ke(r)),{default:c(F=>[p(V,null,{default:c(()=>[p(I,be(F,{modelValue:e(m).domain,"onUpdate:modelValue":a[1]||(a[1]=B=>e(m).domain=B),options:e(J)}),null,16,["modelValue","options"]),p(k,{variant:"primary",onClick:a[2]||(a[2]=B=>A.value=!0)},{default:c(()=>[$(o(e(_)("domain_add")),1)]),_:1})]),_:2},1024)]),_:2},1040)]),key:"0"}:void 0]),1032,["modelValue","fields","title","submit-text","validations","onSubmit"])):i("",!0)],64)):i("",!0),p(Fe,{show:A.value,"onUpdate:show":a[4]||(a[4]=r=>A.value=r),modal:"","submit-text":n.$t("add"),"server-error":z.value,title:n.$t("domain_add"),onSubmit:te},null,8,["show","submit-text","server-error","title"]),e(t)===null?(s(),h(f,{key:1,alert:"",icon:"exclamation-triangle",variant:"warning"},{default:c(()=>[$(o(n.$t("app_install_custom_no_manifest")),1)]),_:1})):i("",!0)])}}}),rt=Be(Ze,[["__scopeId","data-v-c47eaa79"]]);export{rt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.