import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import"./vendor-primevue-DOcVZxnt.js";import"./vendor-firebase-yTFzdAQf.js";import{A as t,D as n,Dt as r,F as i,I as a,It as o,O as s,R as c,Vt as l,_t as u,et as d,g as f,gt as p,it as m,j as h,k as g,pt as _,q as v}from"./vendor-vue-core-CvBSzfTV.js";import"./vendor-other-ZVm7XS8K.js";import{t as y}from"./types-Bc3W4AWd.js";import"./useFeatureFlags-CMK9o9Rw.js";import{Et as b}from"./api-OgmjiUkn.js";import"./colorUtil-C9tyO6rZ.js";import{n as x}from"./vendor-i18n-B2MApQxA.js";import"./i18n-S80A-Sy1.js";import"./vendor-reka-ui-EFkcZtPy.js";import{t as S}from"./Button-C-kbn1lh.js";import{Rn as C,a as w}from"./dialogService-Dp405gae.js";import"./systemStatsStore-BAnEcJS2.js";import"./useErrorHandling-DfKSzlg9.js";import{t as T}from"./dialogStore-BDXSs8Ic.js";import"./userStore-C5cqCkur.js";import"./useCopyToClipboard-_eFTtqIy.js";import"./vendor-tiptap-BZCaYoPl.js";import"./vendor-markdown-Gcn_JH9N.js";import"./markdownRendererUtil-BD0lrBqH.js";import"./useExternalLink-CZSEXO8Q.js";import{a as E,d as D,n as O,o as k,s as A}from"./useConflictDetection-BhlqIkng.js";var j={class:`flex w-full flex-col gap-2 py-2 px-4`},M={class:`flex flex-col gap-1 text-sm text-muted-foreground`},N={class:`flex items-center gap-1`},P={for:`doNotAskAgainNodes`},F={key:0,class:`flex w-full items-center justify-between gap-2`},I={key:1,class:`flex justify-end gap-1`},L=c({__name:`MissingNodesFooter`,setup(e){let c=T(),{t:L}=x(),R=r(!1);_(R,e=>{w().set(`Comfy.Workflow.ShowMissingNodesWarning`,!e)});let handleGotItClick=()=>{c.closeDialog({key:`global-missing-nodes`})};function openShowMissingNodesSetting(){c.closeDialog({key:`global-missing-nodes`}),C().show(void 0,`Comfy.Workflow.ShowMissingNodesWarning`)}let{missingNodePacks:z,isLoading:B,error:V}=k(),H=O(),U=E(),W=n(()=>z.value?.length?z.value.some(e=>H.isPackInstalling(e.id)):!1),G=n(()=>U.shouldShowManagerButtons.value),K=n(()=>U.shouldShowInstallButton.value),openManager=async()=>{await U.openManager({initialTab:A.Missing,showToastOnLegacyError:!0})};return _(n(()=>!B.value&&!W.value&&z.value?.length===0),async e=>{!y&&e&&K.value&&(await v(),c.closeDialog({key:`global-missing-nodes`}),b().add({severity:`success`,summary:L(`g.success`),detail:L(`manager.allMissingNodesInstalled`),life:3e3}))}),(e,n)=>{let r=m(`i18n-t`);return d(),h(`div`,j,[s(`div`,M,[s(`div`,N,[u(s(`input`,{id:`doNotAskAgainNodes`,"onUpdate:modelValue":n[0]||=e=>R.value=e,type:`checkbox`,class:`h-4 w-4 cursor-pointer`},null,512),[[f,R.value]]),s(`label`,P,l(e.$t(`missingModelsDialog.doNotAskAgain`)),1)]),R.value?(d(),g(r,{key:0,keypath:`missingModelsDialog.reEnableInSettings`,tag:`span`,class:`text-sm text-muted-foreground ml-6`},{link:p(()=>[a(S,{variant:`textonly`,class:`underline cursor-pointer p-0 text-sm text-muted-foreground hover:bg-transparent`,onClick:openShowMissingNodesSetting},{default:p(()=>[i(l(e.$t(`missingModelsDialog.reEnableInSettingsLink`)),1)]),_:1})]),_:1})):t(``,!0)]),o(y)?(d(),h(`div`,F,[a(S,{variant:`textonly`,size:`sm`,as:`a`,href:`https://www.comfy.org/cloud`,target:`_blank`,rel:`noopener noreferrer`},{default:p(()=>[n[1]||=s(`i`,{class:`icon-[lucide--info]`},null,-1),s(`span`,null,l(e.$t(`missingNodes.cloud.learnMore`)),1)]),_:1}),a(S,{variant:`secondary`,size:`md`,onClick:handleGotItClick},{default:p(()=>[i(l(e.$t(`missingNodes.cloud.gotIt`)),1)]),_:1})])):G.value?(d(),h(`div`,I,[a(S,{variant:`textonly`,onClick:openManager},{default:p(()=>[i(l(e.$t(`g.openManager`)),1)]),_:1}),K.value?(d(),g(D,{key:0,type:`secondary`,size:`md`,disabled:o(B)||!!o(V)||o(z).length===0||W.value,"is-loading":o(B),"node-packs":o(z),label:o(B)?e.$t(`manager.gettingInfo`):e.$t(`manager.installAllMissingNodes`)},null,8,[`disabled`,`is-loading`,`node-packs`,`label`])):t(``,!0)])):t(``,!0)])}}});export{L as default};
//# sourceMappingURL=MissingNodesFooter-D4oQwJ3v.js.map