var D=Object.defineProperty;var n=(d,u)=>D(d,"name",{value:u,configurable:!0});import{defineComponent as y,computed as m,resolveDirective as g,withDirectives as b,openBlock as h,createElementBlock as w,createVNode as _,unref as l,isRef as I,createBlock as $,withCtx as C,createElementVNode as N,normalizeClass as P}from"vue";import{s as S}from"./vendor-vue-BQi1bXU_.js";import T from"primevue/button";import V from"primevue/splitbutton";import{useI18n as E}from"vue-i18n";import"./vendor-other-Co5CJDU0.js";import{c0 as k,u as W,d as B,A as z,G as F,q as K}from"./index-IEXYnpa0.js";import"primevue/message";import"primevue/checkbox";import"primevue/divider";import"primevue/scrollpanel";import"primevue/usetoast";import"primevue/card";import"primevue/listbox";import"primevue/progressbar";import"primevue/floatlabel";import"primevue/inputtext";import"@primevue/forms";import"@primevue/forms/resolvers/zod";import"primevue/password";import"primevue/progressspinner";import"primevue/skeleton";import"primevue/tag";import L from"primevue/inputnumber";import"primevue/tabpanels";import"primevue/tabs";import"primevue/iconfield";import"primevue/inputicon";import"primevue/badge";import"primevue/chip";import"primevue/tabpanel";import"primevue/select";import"primevue/toggleswitch";import"primevue/colorpicker";import"primevue/radiobutton";import"primevue/knob";import"primevue/slider";import"primevue/panel";import"primevue/tabmenu";import"primevue/popover";import"primevue/tab";import"primevue/tablist";import"primevue";import"@primevue/themes";import"@primevue/themes/aura";import"primevue/config";import"primevue/confirmationservice";import"primevue/toastservice";import"primevue/tooltip";import"primevue/multiselect";import"./vendor-xterm-DV1MVhAx.js";import"./vendor-three-zdhtZbSm.js";import"primevue/galleria";import"primevue/contextmenu";import"primevue/tree";import"primevue/toolbar";import"primevue/selectbutton";import"primevue/dialog";import"primevue/confirmdialog";import"primevue/autocomplete";import"primevue/dropdown";import"./vendor-tiptap-CihWyaWo.js";import"primevue/blockui";const R=["aria-label"],j=1,A=y({__name:"BatchCountEdit",setup(d){const u=k(),{batchCount:t}=S(u),f=W(),a=m(()=>f.get("Comfy.QueueButton.BatchCountLimit")),e=n(o=>{let i;if(o){const r=t.value-1;i=Math.min(r*2,a.value)}else{const r=t.value+1;i=Math.floor(r/2)}t.value=i},"handleClick");return(o,i)=>{const r=g("tooltip");return b((h(),w("div",{class:"batch-count","aria-label":o.$t("menu.batchCount")},[_(l(L),{modelValue:l(t),"onUpdate:modelValue":i[0]||(i[0]=v=>I(t)?t.value=v:null),class:"w-14",min:j,max:a.value,fluid:"","show-buttons":"",pt:{incrementButton:{class:"w-6",onmousedown:n(()=>{e(!0)},"onmousedown")},decrementButton:{class:"w-6",onmousedown:n(()=>{e(!1)},"onmousedown")}}},null,8,["modelValue","max","pt"])],8,R)),[[r,{value:o.$t("menu.batchCount"),showDelay:600},void 0,{bottom:!0}]])}}}),G=B(A,[["__scopeId","data-v-19217ad4"]]),O={class:"queue-button-group flex"},U=y({__name:"ComfyQueueButton",setup(d){const u=z(),{mode:t,batchCount:f}=S(k()),{hasMissingNodes:a}=F(),{t:e}=E(),o=m(()=>{const s={disabled:{key:"disabled",label:e("menu.run"),tooltip:e("menu.disabledTooltip"),command:n(()=>{t.value="disabled"},"command")},change:{key:"change",label:`${e("menu.run")} (${e("menu.onChange")})`,tooltip:e("menu.onChangeTooltip"),command:n(()=>{t.value="change"},"command")}};return s.instant={key:"instant",label:`${e("menu.run")} (${e("menu.instant")})`,tooltip:e("menu.instantTooltip"),command:n(()=>{t.value="instant"},"command")},s}),i=m(()=>o.value[t.value]||o.value.disabled),r=m(()=>Object.values(o.value)),v=m(()=>a.value?"icon-[lucide--triangle-alert]":u.shiftDown?"icon-[lucide--list-start]":t.value==="disabled"?"icon-[lucide--play]":t.value==="instant"?"icon-[lucide--fast-forward]":t.value==="change"?"icon-[lucide--step-forward]":"icon-[lucide--play]"),M=m(()=>a.value?e("menu.runWorkflowDisabled"):u.shiftDown?e("menu.runWorkflowFront"):e("menu.runWorkflow")),q=K(),x=n(async s=>{const p="shiftKey"in s&&s.shiftKey?"Comfy.QueuePromptFront":"Comfy.QueuePrompt";f.value>1,await q.execute(p,{metadata:{subscribe_to_run:!1,trigger_source:"button"}})},"queuePrompt");return(s,Q)=>{const p=g("tooltip");return h(),w("div",O,[b((h(),$(l(V),{class:"comfyui-queue-button",label:String(i.value?.label??""),severity:"primary",size:"small",model:r.value,disabled:l(a),"data-testid":"queue-button",onClick:x},{icon:C(()=>[N("i",{class:P(v.value)},null,2)]),item:C(({item:c})=>[b(_(l(T),{label:String(c.label??""),icon:c.icon,severity:c.key===l(t)?"primary":"secondary",size:"small",text:""},null,8,["label","icon","severity"]),[[p,{value:c.tooltip,showDelay:600}]])]),_:1},8,["label","model","disabled"])),[[p,{value:M.value,showDelay:600},void 0,{bottom:!0}]]),_(G)])}}}),re=B(U,[["__scopeId","data-v-fb78d219"]]);export{re as default};
//# sourceMappingURL=ComfyQueueButton-ClS8daHY.js.map
