import{i as e,n as t}from"./rolldown-runtime-BKYq3fBv.js";import{$n as n,Cr as r,H as i,Nn as a,Or as o,Qn as s,Rr as c,V as l,Wr as u,Xn as d,Zn as ee,ai as f,ar as p,er as m,ir as te,mt as h,pt as g,si as _,sr as v,ui as y,zr as b}from"./vendor-primevue-D50rA9nL.js";import{ot as x,st as S}from"./vendor-other-BnH5nyVX.js";import{i as C,r as w}from"./vendor-vue-BAQ5VIVR.js";import{on as T,sn as E}from"./api-z_dXWY_S.js";import{n as D,t as O}from"./Button-DzMg17Os.js";import{Co as k,So as A,at as j,ci as M,co as N,in as P,it as ne,mn as F,on as re,pn as ie,rn as I,sn as L,so as R,ui as z}from"./dialogService-Cr3DyAja.js";import{n as B,t as V}from"./_plugin-vue_export-helper-Ckv1EJQX.js";import{n as H,t as U}from"./graphHasMissingNodes-DpSgWfC3.js";var W,G,K,q=t((()=>{a(),w(),g(),R(),M(),W=[`aria-label`],G=1,K=v({__name:`BatchCountEdit`,setup(e){let{batchCount:t}=C(z()),n=N(),i=d(()=>n.get(`Comfy.QueueButton.BatchCountLimit`)),handleClick=e=>{let n;if(e){let e=t.value-1;n=Math.min(e*2,i.value)}else{let e=t.value+1;n=Math.floor(e/2)}t.value=n};return(e,n)=>{let a=o(`tooltip`);return b((r(),m(`div`,{class:`batch-count`,"aria-label":e.$t(`menu.batchCount`)},[p(f(h),{modelValue:f(t),"onUpdate:modelValue":n[0]||=e=>u(t)?t.value=e:null,class:`w-14`,min:G,max:i.value,fluid:``,"show-buttons":``,pt:{incrementButton:{class:`w-6`,onmousedown:()=>{handleClick(!0)}},decrementButton:{class:`w-6`,onmousedown:()=>{handleClick(!1)}}}},null,8,[`modelValue`,`max`,`pt`])],8,W)),[[a,{value:e.$t(`menu.batchCount`),showDelay:600},void 0,{bottom:!0}]])}}})})),J=t((()=>{})),Y,ae=t((()=>{q(),q(),J(),B(),Y=V(K,[[`__scopeId`,`data-v-19217ad4`]])})),X,Z,Q=t((()=>{a(),w(),l(),x(),D(),T(),I(),j(),A(),re(),M(),ie(),H(),ae(),X={class:`queue-button-group flex`},Z=v({__name:`ComfyQueueButton`,setup(e){let t=F(),{mode:a,batchCount:l}=C(z()),u=L(),h=d(()=>U(ne.rootGraph,u.nodeDefsByName)),{t:g}=S(),v=d(()=>{let e={disabled:{key:`disabled`,label:g(`menu.run`),tooltip:g(`menu.disabledTooltip`),command:()=>{a.value=`disabled`}},change:{key:`change`,label:`${g(`menu.run`)} (${g(`menu.onChange`)})`,tooltip:g(`menu.onChangeTooltip`),command:()=>{P()?.trackUiButtonClicked({button_id:`queue_mode_option_run_on_change_selected`}),a.value=`change`}}};return E||(e.instant={key:`instant`,label:`${g(`menu.run`)} (${g(`menu.instant`)})`,tooltip:g(`menu.instantTooltip`),command:()=>{P()?.trackUiButtonClicked({button_id:`queue_mode_option_run_instant_selected`}),a.value=`instant`}}),e}),x=d(()=>v.value[a.value]||v.value.disabled),w=d(()=>Object.values(v.value)),T=d(()=>h.value?`icon-[lucide--triangle-alert]`:t.shiftDown?`icon-[lucide--list-start]`:a.value===`disabled`?`icon-[lucide--play]`:a.value===`instant`?`icon-[lucide--fast-forward]`:a.value===`change`?`icon-[lucide--step-forward]`:`icon-[lucide--play]`),D=d(()=>h.value?g(`menu.runWorkflowDisabled`):t.shiftDown?g(`menu.runWorkflowFront`):g(`menu.runWorkflow`)),A=k(),queuePrompt=async e=>{let t=`shiftKey`in e&&e.shiftKey?`Comfy.QueuePromptFront`:`Comfy.QueuePrompt`;l.value>1&&P()?.trackUiButtonClicked({button_id:`queue_run_multiple_batches_submitted`}),await A.execute(t,{metadata:{subscribe_to_run:!1,trigger_source:`button`}})};return(e,t)=>{let l=o(`tooltip`);return r(),m(`div`,X,[b((r(),s(f(i),{class:`comfyui-queue-button`,label:String(x.value?.label??``),severity:`primary`,size:`small`,model:w.value,"data-testid":`queue-button`,onClick:queuePrompt},{icon:c(()=>[ee(`i`,{class:_(T.value)},null,2)]),item:c(({item:e})=>[b((r(),s(O,{variant:e.key===f(a)?`primary`:`secondary`,size:`sm`,class:`w-full justify-start`},{default:c(()=>[e.icon?(r(),m(`i`,{key:0,class:_(e.icon)},null,2)):n(``,!0),te(` `+y(String(e.label??``)),1)]),_:2},1032,[`variant`])),[[l,{value:e.tooltip,showDelay:600}]])]),_:1},8,[`label`,`model`])),[[l,{value:D.value,showDelay:600},void 0,{bottom:!0}]]),p(Y)])}}})})),oe=t((()=>{})),$,se=t((()=>{Q(),Q(),oe(),B(),$=V(Z,[[`__scopeId`,`data-v-214102f7`]])}));export{se as n,$ as t};
//# sourceMappingURL=ComfyQueueButton-CJ-SFhpI.js.map