import{c as v,A as x,aw as he,ax as ge,x as pe,o as s,B as C,cx as xe,cy as Xe,cz as et,bh as tt,cA as it,bc as Fe,j as d,ah as G,m as h,C as p,F as N,K as M,bi as Ie,bj as nt,cB as st,J as me,V as J,d as ne,p as Re,aj as H,l as m,t as u,E as _,cC as lt,a4 as Ve,ct as ot,cs as rt,M as je,k as l,n as ve,U as at,r as q,G as Le,cD as dt,ce as ut,cE as ft,bm as ct,ay as ht,s as Se,cF as Te,cG as Ce,cH as gt,ck as pt,cI as mt,cJ as vt,cK as le,cL as yt,cM as oe,bk as bt,cN as At,cO as _t,ar as kt,cj as It,cP as St,cQ as Tt,cR as Ct,bO as wt}from"./index-b01f57e3.js";import{D as Z,a as ae}from"./index-482cb1cf.js";Z.Button=ae;Z.install=function(e){return e.component(Z.name,Z),e.component(ae.name,ae),e};var Et={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"}}]},name:"star",theme:"filled"};const Dt=Et;function we(e){for(var t=1;t0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var i=e.indexOf("Trident/");if(i>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var o=e.indexOf("Edge/");return o>0?parseInt(e.substring(o+5,e.indexOf(".",o)),10):-1}let te;function de(){de.init||(de.init=!0,te=Ut()!==-1)}var se={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){de(),pe(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const e=document.createElement("object");this._resizeObject=e,e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex",-1),e.onload=this.addResizeHandlers,e.type="text/html",te&&this.$el.appendChild(e),e.data="about:blank",te||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!te&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const Kt=xe();he("data-v-b329ee4c");const Wt={class:"resize-observer",tabindex:"-1"};ge();const Yt=Kt((e,t,i,n,o,a)=>(s(),C("div",Wt)));se.render=Yt;se.__scopeId="data-v-b329ee4c";se.__file="src/components/ResizeObserver.vue";function ie(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ie=function(t){return typeof t}:ie=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ie(e)}function Gt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qe(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,n=new Array(t);i2&&arguments[2]!==void 0?arguments[2]:{},n,o,a,g=function(y){for(var A=arguments.length,O=new Array(A>1?A-1:0),$=1;$1){var A=f.find(function($){return $.isIntersecting});A&&(y=A)}if(o.callback){var O=y.isIntersecting&&y.intersectionRatio>=o.threshold;if(O===o.oldResult)return;o.oldResult=O,o.callback(O,y)}},this.options.intersection),pe(function(){o.observer&&o.observer.observe(o.el)})}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&typeof this.options.intersection.threshold=="number"?this.options.intersection.threshold:0}}]),e}();function We(e,t,i){var n=t.value;if(n)if(typeof IntersectionObserver>"u")console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var o=new ni(e,n,i);e._vue_visibilityState=o}}function si(e,t,i){var n=t.value,o=t.oldValue;if(!Ke(n,o)){var a=e._vue_visibilityState;if(!n){Ye(e);return}a?a.createObserver(n,i):We(e,{value:n},i)}}function Ye(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var li={beforeMount:We,updated:si,unmounted:Ye},oi={itemsLimit:1e3},ri=/(auto|scroll)/;function Ge(e,t){return e.parentNode===null?t:Ge(e.parentNode,t.concat([e]))}var re=function(t,i){return getComputedStyle(t,null).getPropertyValue(i)},ai=function(t){return re(t,"overflow")+re(t,"overflow-y")+re(t,"overflow-x")},di=function(t){return ri.test(ai(t))};function Be(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var t=Ge(e.parentNode,[]),i=0;i{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0})},activated(){const e=this.$_lastUpdateScrollPosition;typeof e=="number"&&this.$nextTick(()=>{this.scrollToPosition(e)})},beforeUnmount(){this.removeListeners()},methods:{addView(e,t,i,n,o){const a=Xe({id:hi++,index:t,used:!0,key:n,type:o}),g=et({item:i,position:0,nr:a});return e.push(g),g},unuseView(e,t=!1){const i=this.$_unusedViews,n=e.nr.type;let o=i.get(n);o||(o=[],i.set(n,o)),o.push(e),t||(e.nr.used=!1,e.position=-9999)},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(e){if(!this.$_scrollDirty){if(this.$_scrollDirty=!0,this.$_updateTimeout)return;const t=()=>requestAnimationFrame(()=>{this.$_scrollDirty=!1;const{continuous:i}=this.updateVisibleItems(!1,!0);i||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,this.updateInterval+100))});t(),this.updateInterval&&(this.$_updateTimeout=setTimeout(()=>{this.$_updateTimeout=0,this.$_scrollDirty&&t()},this.updateInterval))}},handleVisibilityChange(e,t){this.ready&&(e||t.boundingClientRect.width!==0||t.boundingClientRect.height!==0?(this.$emit("visible"),requestAnimationFrame(()=>{this.updateVisibleItems(!1)})):this.$emit("hidden"))},updateVisibleItems(e,t=!1){const i=this.itemSize,n=this.gridItems||1,o=this.itemSecondarySize||i,a=this.$_computedMinItemSize,g=this.typeField,f=this.simpleArray?null:this.keyField,y=this.items,A=y.length,O=this.sizes,$=this.$_views,T=this.$_unusedViews,U=this.pool,D=this.itemIndexByKey;let S,w,K,B,F;if(!A)S=w=B=F=K=0;else if(this.$_prerender)S=B=0,w=F=Math.min(this.prerender,y.length),K=null;else{const c=this.getScroll();if(t){let Q=c.start-this.$_lastUpdateScrollPosition;if(Q<0&&(Q=-Q),i===null&&Qc.start&&(Y=z),z=~~((L+Y)/2);while(z!==b);for(z<0&&(z=0),S=z,K=O[A-1].accumulator,w=z;wA&&(w=A)),B=S;BA&&(w=A),B<0&&(B=0),F>A&&(F=A),K=Math.ceil(A/n)*i}}w-S>oi.itemsLimit&&this.itemsLimitError(),this.totalSize=K;let k;const W=S<=this.$_endIndex&&w>=this.$_startIndex;if(W)for(let c=0,E=U.length;c=w)&&this.unuseView(k));const X=W?null:new Map;let V,R,r;for(let c=S;c=P.length)&&(k=this.addView(U,c,V,E,R),this.unuseView(k,!0),P=T.get(R)),k=P[r],X.set(R,r+1)),$.delete(k.nr.key),k.nr.used=!0,k.nr.index=c,k.nr.key=E,k.nr.type=R,$.set(E,k),Q=!0;else if(!k.nr.used&&(k.nr.used=!0,k.nr.index=c,Q=!0,P)){const L=P.indexOf(k);L!==-1&&P.splice(L,1)}k.item=V,Q&&(c===y.length-1&&this.$emit("scroll-end"),c===0&&this.$emit("scroll-start")),i===null?(k.position=O[c-1].accumulator,k.offset=0):(k.position=Math.floor(c/n)*i,k.offset=c%n*o)}return this.$_startIndex=S,this.$_endIndex=w,this.emitUpdate&&this.$emit("update",S,w,B,F),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:W}},getListenerTarget(){let e=Be(this.$el);return window.document&&(e===window.document.documentElement||e===window.document.body)&&(e=window),e},getScroll(){const{$el:e,direction:t}=this,i=t==="vertical";let n;if(this.pageMode){const o=e.getBoundingClientRect(),a=i?o.height:o.width;let g=-(i?o.top:o.left),f=i?window.innerHeight:window.innerWidth;g<0&&(f+=g,g=0),g+f>a&&(f=a-g),n={start:g,end:g+f}}else i?n={start:e.scrollTop,end:e.scrollTop+e.clientHeight}:n={start:e.scrollLeft,end:e.scrollLeft+e.clientWidth};return n},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,ce?{passive:!0}:!1),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem(e){let t;const i=this.gridItems||1;this.itemSize===null?t=e>0?this.sizes[e-1].accumulator:0:t=Math.floor(e/i)*this.itemSize,this.scrollToPosition(t)},scrollToPosition(e){const t=this.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let i,n,o;if(this.pageMode){const a=Be(this.$el),g=a.tagName==="HTML"?0:a[t.scroll],f=a.getBoundingClientRect(),A=this.$el.getBoundingClientRect()[t.start]-f[t.start];i=a,n=t.scroll,o=e+g+A}else i=this.$el,n=t.scroll,o=e;i[n]=o},itemsLimitError(){throw setTimeout(()=>{console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",this.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")},sortViews(){this.pool.sort((e,t)=>e.nr.index-t.nr.index)}}};const gi={key:0,ref:"before",class:"vue-recycle-scroller__slot"},pi={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function mi(e,t,i,n,o,a){const g=tt("ResizeObserver"),f=it("observe-visibility");return Fe((s(),d("div",{class:J(["vue-recycle-scroller",{ready:o.ready,"page-mode":i.pageMode,[`direction-${e.direction}`]:!0}]),onScrollPassive:t[0]||(t[0]=(...y)=>a.handleScroll&&a.handleScroll(...y))},[e.$slots.before?(s(),d("div",gi,[G(e.$slots,"before")],512)):h("v-if",!0),(s(),C(Ie(i.listTag),{ref:"wrapper",style:me({[e.direction==="vertical"?"minHeight":"minWidth"]:o.totalSize+"px"}),class:J(["vue-recycle-scroller__item-wrapper",i.listClass])},{default:p(()=>[(s(!0),d(N,null,M(o.pool,y=>(s(),C(Ie(i.itemTag),nt({key:y.nr.id,style:o.ready?{transform:`translate${e.direction==="vertical"?"Y":"X"}(${y.position}px) translate${e.direction==="vertical"?"X":"Y"}(${y.offset}px)`,width:i.gridItems?`${e.direction==="vertical"&&i.itemSecondarySize||i.itemSize}px`:void 0,height:i.gridItems?`${e.direction==="horizontal"&&i.itemSecondarySize||i.itemSize}px`:void 0}:null,class:["vue-recycle-scroller__item-view",[i.itemClass,{hover:!i.skipHover&&o.hoverKey===y.nr.key}]]},st(i.skipHover?{}:{mouseenter:()=>{o.hoverKey=y.nr.key},mouseleave:()=>{o.hoverKey=null}})),{default:p(()=>[G(e.$slots,"default",{item:y.item,index:y.nr.index,active:y.nr.used})]),_:2},1040,["style","class"]))),128)),G(e.$slots,"empty")]),_:3},8,["style","class"])),e.$slots.after?(s(),d("div",pi,[G(e.$slots,"after")],512)):h("v-if",!0),v(g,{onNotify:a.handleResize},null,8,["onNotify"])],34)),[[f,a.handleVisibilityChange]])}qe.render=mi;qe.__file="src/components/RecycleScroller.vue";const Me=ne({__name:"ContextMenu",props:{file:{},idx:{},selectedTag:{},isSelectedMutilFiles:{type:Boolean}},emits:["contextMenuClick"],setup(e,{emit:t}){const i=e,n=Re(),o=H(()=>{var a;return(((a=n.conf)==null?void 0:a.all_custom_tags)??[]).reduce((g,f)=>[...g,{...f,selected:!!i.selectedTag.find(y=>y.id===f.id)}],[])});return(a,g)=>{const f=Ve,y=ot,A=rt,O=je;return s(),C(O,{onClick:g[0]||(g[0]=$=>t("contextMenuClick",$,a.file,a.idx))},{default:p(()=>{var $;return[v(f,{key:"deleteFiles"},{default:p(()=>[m(u(a.$t("deleteSelected")),1)]),_:1}),v(f,{key:"openWithDefaultApp"},{default:p(()=>[m(u(a.$t("openWithDefaultApp")),1)]),_:1}),v(f,{key:"saveSelectedAsJson"},{default:p(()=>[m(u(a.$t("saveSelectedAsJson")),1)]),_:1}),a.file.type==="dir"?(s(),d(N,{key:0},[v(f,{key:"openInNewTab"},{default:p(()=>[m(u(a.$t("openInNewTab")),1)]),_:1}),v(f,{key:"openOnTheRight"},{default:p(()=>[m(u(a.$t("openOnTheRight")),1)]),_:1}),v(f,{key:"openWithWalkMode"},{default:p(()=>[m(u(a.$t("openWithWalkMode")),1)]),_:1})],64)):h("",!0),a.file.type==="file"?(s(),d(N,{key:1},[_(lt)(a.file.name)?(s(),d(N,{key:0},[v(f,{key:"viewGenInfo"},{default:p(()=>[m(u(a.$t("viewGenerationInfo")),1)]),_:1}),v(f,{key:"tiktokView"},{default:p(()=>[m(u(a.$t("tiktokView")),1)]),_:1}),v(y),(($=_(n).conf)==null?void 0:$.launch_mode)!=="server"?(s(),d(N,{key:0},[v(f,{key:"send2txt2img"},{default:p(()=>[m(u(a.$t("sendToTxt2img")),1)]),_:1}),v(f,{key:"send2img2img"},{default:p(()=>[m(u(a.$t("sendToImg2img")),1)]),_:1}),v(f,{key:"send2inpaint"},{default:p(()=>[m(u(a.$t("sendToInpaint")),1)]),_:1}),v(f,{key:"send2extras"},{default:p(()=>[m(u(a.$t("sendToExtraFeatures")),1)]),_:1}),v(A,{key:"sendToThirdPartyExtension",title:a.$t("sendToThirdPartyExtension")},{default:p(()=>[v(f,{key:"send2controlnet-txt2img"},{default:p(()=>[m("ControlNet - "+u(a.$t("t2i")),1)]),_:1}),v(f,{key:"send2controlnet-img2img"},{default:p(()=>[m("ControlNet - "+u(a.$t("i2i")),1)]),_:1}),v(f,{key:"send2outpaint"},{default:p(()=>[m("openOutpaint")]),_:1})]),_:1},8,["title"])],64)):h("",!0),v(f,{key:"send2BatchDownload"},{default:p(()=>[m(u(a.$t("sendToBatchDownload")),1)]),_:1}),v(A,{key:"copy2target",title:a.$t("copyTo")},{default:p(()=>[(s(!0),d(N,null,M(_(n).quickMovePaths,T=>(s(),C(f,{key:`copy-to-${T.dir}`},{default:p(()=>[m(u(T.zh),1)]),_:2},1024))),128))]),_:1},8,["title"]),v(A,{key:"move2target",title:a.$t("moveTo")},{default:p(()=>[(s(!0),d(N,null,M(_(n).quickMovePaths,T=>(s(),C(f,{key:`move-to-${T.dir}`},{default:p(()=>[m(u(T.zh),1)]),_:2},1024))),128))]),_:1},8,["title"]),v(y),a.isSelectedMutilFiles?(s(),d(N,{key:1},[v(A,{key:"batch-add-tag",title:a.$t("batchAddTag")},{default:p(()=>[v(f,{key:"add-custom-tag"},{default:p(()=>[m("+ "+u(a.$t("addNewCustomTag")),1)]),_:1}),(s(!0),d(N,null,M(o.value,T=>(s(),C(f,{key:`batch-add-tag-${T.id}`},{default:p(()=>[m(u(T.name),1)]),_:2},1024))),128))]),_:1},8,["title"]),v(A,{key:"batch-remove-tag",title:a.$t("batchRemoveTag")},{default:p(()=>[(s(!0),d(N,null,M(o.value,T=>(s(),C(f,{key:`batch-remove-tag-${T.id}`},{default:p(()=>[m(u(T.name),1)]),_:2},1024))),128))]),_:1},8,["title"])],64)):(s(),C(A,{key:"toggle-tag",title:a.$t("toggleTag")},{default:p(()=>[v(f,{key:"add-custom-tag"},{default:p(()=>[m("+ "+u(a.$t("addNewCustomTag")),1)]),_:1}),(s(!0),d(N,null,M(o.value,T=>(s(),C(f,{key:`toggle-tag-${T.id}`},{default:p(()=>[m(u(T.name)+" ",1),T.selected?(s(),C(_(Je),{key:0})):(s(),C(_(Ue),{key:1}))]),_:2},1024))),128))]),_:1},8,["title"])),v(y),v(f,{key:"openFileLocationInNewTab"},{default:p(()=>[m(u(a.$t("openFileLocationInNewTab")),1)]),_:1}),v(f,{key:"openWithLocalFileBrowser"},{default:p(()=>[m(u(a.$t("openWithLocalFileBrowser")),1)]),_:1})],64)):h("",!0),v(y),v(f,{key:"rename"},{default:p(()=>[m(u(a.$t("rename")),1)]),_:1}),v(f,{key:"previewInNewWindow"},{default:p(()=>[m(u(a.$t("previewInNewWindow")),1)]),_:1}),v(f,{key:"download"},{default:p(()=>[m(u(a.$t("download")),1)]),_:1}),v(f,{key:"copyPreviewUrl"},{default:p(()=>[m(u(a.$t("copySourceFilePreviewLink")),1)]),_:1}),v(f,{key:"copyFilePath"},{default:p(()=>[m(u(a.$t("copyFilePath")),1)]),_:1})],64)):h("",!0)]}),_:1})}}}),I=e=>(he("data-v-78cd67a3"),e=e(),ge(),e),vi={class:"changeIndicatorWrapper"},yi={key:0,class:"changeIndicatorsLeft changeIndicators"},bi={key:0,class:"promptChangeIndicator changeIndicator"},Ai={key:1,class:"negpromptChangeIndicator changeIndicator"},_i={key:2,class:"seedChangeIndicator changeIndicator"},ki={key:3,class:"stepsChangeIndicator changeIndicator"},Ii={key:4,class:"cfgChangeIndicator changeIndicator"},Si={key:5,class:"sizeChangeIndicator changeIndicator"},Ti={key:6,class:"modelChangeIndicator changeIndicator"},Ci={key:7,class:"samplerChangeIndicator changeIndicator"},wi={key:8,class:"otherChangeIndicator changeIndicator"},Ei={class:"hoverOverlay"},Di=I(()=>l("strong",null,"This file",-1)),Pi=I(()=>l("br",null,null,-1)),Oi=I(()=>l("br",null,null,-1)),$i={key:0},zi=I(()=>l("td",null,[l("span",{class:"promptChangeIndicator"},"+ Prompt")],-1)),Qi={key:1},Ni=I(()=>l("td",null,[l("span",{class:"negpromptChangeIndicator"},"- Prompt")],-1)),Bi={key:2},Mi=I(()=>l("td",null,[l("span",{class:"seedChangeIndicator"},"Seed")],-1)),Fi={key:3},Ri=I(()=>l("td",null,[l("span",{class:"stepsChangeIndicator"},"Steps")],-1)),Vi={key:4},ji=I(()=>l("td",null,[l("span",{class:"cfgChangeIndicator"},"Cfg Scale")],-1)),Li={key:5},Ji=I(()=>l("td",null,[l("span",{class:"sizeChangeIndicator"},"Size")],-1)),Hi={key:6},Ui=I(()=>l("td",null,[l("span",{class:"modelChangeIndicator"},"Model")],-1)),Ki=I(()=>l("br",null,null,-1)),Wi={key:7},Yi=I(()=>l("td",null,[l("span",{class:"samplerChangeIndicator"},"Sampler")],-1)),Gi=I(()=>l("br",null,null,-1)),qi=I(()=>l("br",null,null,-1)),Zi={key:0},xi=I(()=>l("span",{class:"otherChangeIndicator"},"Other",-1)),Xi=I(()=>l("br",null,null,-1)),en=I(()=>l("br",null,null,-1)),tn={key:1,class:"changeIndicatorsRight changeIndicators"},nn={key:0,class:"promptChangeIndicator changeIndicator"},sn={key:1,class:"negpromptChangeIndicator changeIndicator"},ln={key:2,class:"seedChangeIndicator changeIndicator"},on={key:3,class:"stepsChangeIndicator changeIndicator"},rn={key:4,class:"cfgChangeIndicator changeIndicator"},an={key:5,class:"sizeChangeIndicator changeIndicator"},dn={key:6,class:"modelChangeIndicator changeIndicator"},un={key:7,class:"samplerChangeIndicator changeIndicator"},fn={key:8,class:"otherChangeIndicator changeIndicator"},cn={class:"hoverOverlay"},hn=I(()=>l("strong",null,"This file",-1)),gn=I(()=>l("br",null,null,-1)),pn=I(()=>l("br",null,null,-1)),mn={key:0},vn=I(()=>l("td",null,[l("span",{class:"promptChangeIndicator"},"+ Prompt")],-1)),yn={key:1},bn=I(()=>l("td",null,[l("span",{class:"negpromptChangeIndicator"},"- Prompt")],-1)),An={key:2},_n=I(()=>l("td",null,[l("span",{class:"seedChangeIndicator"},"Seed")],-1)),kn={key:3},In=I(()=>l("td",null,[l("span",{class:"stepsChangeIndicator"},"Steps")],-1)),Sn={key:4},Tn=I(()=>l("td",null,[l("span",{class:"cfgChangeIndicator"},"Cfg Scale")],-1)),Cn={key:5},wn=I(()=>l("td",null,[l("span",{class:"sizeChangeIndicator"},"Size")],-1)),En={key:6},Dn=I(()=>l("td",null,[l("span",{class:"modelChangeIndicator"},"Model")],-1)),Pn=I(()=>l("br",null,null,-1)),On={key:7},$n=I(()=>l("td",null,[l("span",{class:"samplerChangeIndicator"},"Sampler")],-1)),zn=I(()=>l("br",null,null,-1)),Qn=I(()=>l("br",null,null,-1)),Nn={key:0},Bn=I(()=>l("span",{class:"otherChangeIndicator"},"Other",-1)),Mn=I(()=>l("br",null,null,-1)),Fn=I(()=>l("br",null,null,-1)),Rn=ne({__name:"ChangeIndicator",props:{genDiffToPrevious:{},genDiffToNext:{},genInfo:{}},setup(e){function t(n){const o=["prompt","negativePrompt","seed","steps","cfgScale","size","Model","others"],a=Object.keys(n).filter(g=>!o.includes(g));return Object.fromEntries(a.map(g=>[g,n[g]]))}function i(n){return Object.keys(t(n)).length>0}return(n,o)=>(s(),d("div",vi,[n.genDiffToPrevious.empty?h("",!0):(s(),d("div",yi,["prompt"in n.genDiffToPrevious.diff?(s(),d("div",bi,"P+")):h("",!0),"negativePrompt"in n.genDiffToPrevious.diff?(s(),d("div",Ai,"P-")):h("",!0),"seed"in n.genDiffToPrevious.diff?(s(),d("div",_i,"Se")):h("",!0),"steps"in n.genDiffToPrevious.diff?(s(),d("div",ki,"St")):h("",!0),"cfgScale"in n.genDiffToPrevious.diff?(s(),d("div",Ii,"Cf")):h("",!0),"size"in n.genDiffToPrevious.diff?(s(),d("div",Si,"Si")):h("",!0),"Model"in n.genDiffToPrevious.diff?(s(),d("div",Ti,"Mo")):h("",!0),"Sampler"in n.genDiffToPrevious.diff?(s(),d("div",Ci,"Sa")):h("",!0),i(n.genDiffToPrevious.diff)?(s(),d("div",wi,"Ot")):h("",!0)])),l("div",Ei,[l("small",null,[v(_(Pe)),Di,m(" vs "+u(n.genDiffToPrevious.otherFile)+" ",1),Pi,Oi,l("table",null,["prompt"in n.genDiffToPrevious.diff?(s(),d("tr",$i,[zi,l("td",null,u(n.genDiffToPrevious.diff.prompt)+" tokens changed",1)])):h("",!0),"negativePrompt"in n.genDiffToPrevious.diff?(s(),d("tr",Qi,[Ni,l("td",null,u(n.genDiffToPrevious.diff.negativePrompt)+" tokens changed",1)])):h("",!0),"seed"in n.genDiffToPrevious.diff?(s(),d("tr",Bi,[Mi,l("td",null,[l("strong",null,u(n.genDiffToPrevious.diff.seed[0]),1),m(" vs "+u(n.genDiffToPrevious.diff.seed[1]),1)])])):h("",!0),"steps"in n.genDiffToPrevious.diff?(s(),d("tr",Fi,[Ri,l("td",null,[l("strong",null,u(n.genDiffToPrevious.diff.steps[0]),1),m(" vs "+u(n.genDiffToPrevious.diff.steps[1]),1)])])):h("",!0),"cfgScale"in n.genDiffToPrevious.diff?(s(),d("tr",Vi,[ji,l("td",null,[l("strong",null,u(n.genDiffToPrevious.diff.cfgScale[0]),1),m(" vs "+u(n.genDiffToPrevious.diff.cfgScale[1]),1)])])):h("",!0),"size"in n.genDiffToPrevious.diff?(s(),d("tr",Li,[Ji,l("td",null,[l("strong",null,u(n.genDiffToPrevious.diff.size[0]),1),m(" vs "+u(n.genDiffToPrevious.diff.size[1]),1)])])):h("",!0),"Model"in n.genDiffToPrevious.diff?(s(),d("tr",Hi,[Ui,l("td",null,[l("strong",null,u(n.genDiffToPrevious.diff.Model[0]),1),Ki,m(" vs "+u(n.genDiffToPrevious.diff.Model[1]),1)])])):h("",!0),"Sampler"in n.genDiffToPrevious.diff?(s(),d("tr",Wi,[Yi,l("td",null,[l("strong",null,u(n.genDiffToPrevious.diff.Sampler[0]),1),Gi,m(" vs "+u(n.genDiffToPrevious.diff.Sampler[1]),1)])])):h("",!0)]),qi,i(n.genDiffToPrevious.diff)?(s(),d("div",Zi,[xi,m(" props that changed:"),Xi,en,l("ul",null,[(s(!0),d(N,null,M(t(n.genDiffToPrevious.diff),(a,g)=>(s(),d("li",null,u(g),1))),256))])])):h("",!0)])]),n.genDiffToNext.empty?h("",!0):(s(),d("div",tn,["prompt"in n.genDiffToNext.diff?(s(),d("div",nn,"P+")):h("",!0),"negativePrompt"in n.genDiffToNext.diff?(s(),d("div",sn,"P-")):h("",!0),"seed"in n.genDiffToNext.diff?(s(),d("div",ln,"Se")):h("",!0),"steps"in n.genDiffToNext.diff?(s(),d("div",on,"St")):h("",!0),"cfgScale"in n.genDiffToNext.diff?(s(),d("div",rn,"Cf")):h("",!0),"size"in n.genDiffToNext.diff?(s(),d("div",an,"Si")):h("",!0),"Model"in n.genDiffToNext.diff?(s(),d("div",dn,"Mo")):h("",!0),"Sampler"in n.genDiffToNext.diff?(s(),d("div",un,"Sa")):h("",!0),i(n.genDiffToNext.diff)?(s(),d("div",fn,"Ot")):h("",!0)])),l("div",cn,[l("small",null,[v(_(Pe)),hn,m(" vs "+u(n.genDiffToNext.otherFile)+" ",1),gn,pn,l("table",null,["prompt"in n.genDiffToNext.diff?(s(),d("tr",mn,[vn,l("td",null,u(n.genDiffToNext.diff.prompt)+" tokens changed",1)])):h("",!0),"negativePrompt"in n.genDiffToNext.diff?(s(),d("tr",yn,[bn,l("td",null,u(n.genDiffToNext.diff.negativePrompt)+" tokens changed",1)])):h("",!0),"seed"in n.genDiffToNext.diff?(s(),d("tr",An,[_n,l("td",null,[l("strong",null,u(n.genDiffToNext.diff.seed[0]),1),m(" vs "+u(n.genDiffToNext.diff.seed[1]),1)])])):h("",!0),"steps"in n.genDiffToNext.diff?(s(),d("tr",kn,[In,l("td",null,[l("strong",null,u(n.genDiffToNext.diff.steps[0]),1),m(" vs "+u(n.genDiffToNext.diff.steps[1]),1)])])):h("",!0),"cfgScale"in n.genDiffToNext.diff?(s(),d("tr",Sn,[Tn,l("td",null,[l("strong",null,u(n.genDiffToNext.diff.cfgScale[0]),1),m(" vs "+u(n.genDiffToNext.diff.cfgScale[1]),1)])])):h("",!0),"size"in n.genDiffToNext.diff?(s(),d("tr",Cn,[wn,l("td",null,[l("strong",null,u(n.genDiffToNext.diff.size[0]),1),m(" vs "+u(n.genDiffToNext.diff.size[1]),1)])])):h("",!0),"Model"in n.genDiffToNext.diff?(s(),d("tr",En,[Dn,l("td",null,[l("strong",null,u(n.genDiffToNext.diff.Model[0]),1),Pn,m(" vs "+u(n.genDiffToNext.diff.Model[1]),1)])])):h("",!0),"Sampler"in n.genDiffToNext.diff?(s(),d("tr",On,[$n,l("td",null,[l("strong",null,u(n.genDiffToNext.diff.Sampler[0]),1),zn,m(" vs "+u(n.genDiffToNext.diff.Sampler[1]),1)])])):h("",!0)]),Qn,i(n.genDiffToNext.diff)?(s(),d("div",Nn,[Bn,m(" props that changed:"),Mn,Fn,l("ul",null,[(s(!0),d(N,null,M(t(n.genDiffToNext.diff),(a,g)=>(s(),d("li",null,u(g),1))),256))])])):h("",!0)])])]))}});const Vn=ve(Rn,[["__scopeId","data-v-78cd67a3"]]),jn=["title"],Ln={class:"default-trigger"},Jn={class:"trigger-text"},Hn=["src","alt"],Un=ne({__name:"DraggableImage",props:{file:{},title:{default:"Drag to transfer image"},size:{}},setup(e){const t=e,i=H(()=>t.file?at(t.file):""),n=q(!1);function o(){n.value=!n.value}const a=()=>{n.value=!1};return(g,f)=>(s(),d("div",{class:"draggable-image-wrapper",onMouseleave:a},[l("div",{class:"trigger-container",title:g.title,onClick:o},[G(g.$slots,"default",{class:"trigger-slot"},()=>[l("div",Ln,[v(_(He),{class:"trigger-icon"}),l("span",Jn,u(g.$t("dragImageToTransfer")),1)])],!0),n.value?(s(),d("img",{key:0,src:i.value,alt:g.file.name,draggable:"true",class:"hover-image",style:me({width:g.size||"256px",height:g.size||"256px"}),onMouseleave:a,onError:f[0]||(f[0]=y=>y.target.style.display="none"),onClick:f[1]||(f[1]=Le(()=>{},["stop"]))},null,44,Hn)):h("",!0)],8,jn)],32))}});const Kn=ve(Un,[["__scopeId","data-v-f32301e7"]]),{eventEmitter:Wn,useEventListen:Yn}=dt(),Gn=e=>(he("data-v-2cda5d16"),e=e(),ge(),e),qn=["data-idx"],Zn={key:1,class:"more"},xn={class:"float-btn-wrap"},Xn={class:"float-btn-wrap"},es={key:1,class:"tags-container"},ts=["url"],is=["src"],ns={class:"inline-play-btn"},ss=["src"],ls={class:"play-text"},os={class:"play-icon"},rs=["src"],as={key:2,class:"tags-container"},ds=Gn(()=>l("div",{class:"audio-icon"},"🎵",-1)),us={key:0,class:"tags-container"},fs={key:5,class:"preview-icon-wrap"},cs={key:1,class:"dir-cover-container"},hs=["src"],gs={key:6,class:"profile"},ps=["title"],ms={class:"basic-info"},vs={style:{"margin-right":"4px"}},ee=160,ys=ne({__name:"FileItem",props:{file:{},idx:{},selected:{type:Boolean,default:!1},showMenuIdx:{},cellWidth:{},fullScreenPreviewImageUrl:{},enableRightClickMenu:{type:Boolean,default:!0},enableCloseIcon:{type:Boolean,default:!1},isSelectedMutilFiles:{type:Boolean},genInfo:{},enableChangeIndicator:{type:Boolean},extraTags:{},coverFiles:{},getGenDiff:{},getGenDiffWatchDep:{}},emits:["update:showMenuIdx","fileItemClick","dragstart","dragend","dropToFolder","previewVisibleChange","contextMenuClick","close-icon-click","tiktokView"],setup(e,{emit:t}){const i=e;ut(r=>({"411028b3":r.$props.cellWidth+"px"}));const{t:n}=ft(),o=Re(),a=ct(),g=q(),f=q(),y=ht(()=>{const{getGenDiff:r,file:c,idx:E}=i;r&&(f.value=r(c.gen_info_obj,E,1,c),g.value=r(c.gen_info_obj,E,-1,c))},200+100*Math.random());Se(()=>{var r;return(r=i.getGenDiffWatchDep)==null?void 0:r.call(i,i.idx)},()=>{y()},{immediate:!0,deep:!0});const A=H(()=>a.tagMap.get(i.file.fullpath)??[]),O=H(()=>{const r=o.gridThumbnailResolution;return o.enableThumbnail?Te(i.file,[r,r].join("x")):Ce(i.file)}),$=H(()=>{var r;return(((r=o.conf)==null?void 0:r.all_custom_tags)??[]).reduce((c,E)=>[...c,{...E,selected:!!A.value.find(P=>P.id===E.id)}],[])}),T=H(()=>$.value.find(r=>r.type==="custom"&&r.name==="like")),U=()=>{kt(T.value),t("contextMenuClick",{key:`toggle-tag-${T.value.id}`},i.file,i.idx)},D=q(!1),S=q(null),w=r=>{console.log("toggleInlinePlay",{event:r,isPlayingInline:D.value,videoRef:S.value}),r.stopPropagation(),D.value||Wn.emit("stopInlinePlay"),D.value=!D.value,D.value?pe(()=>{S.value?(console.log("Playing video",S.value),S.value.play().catch(c=>{console.error("Play failed:",c),D.value=!1})):(console.error("Video ref is null after nextTick"),D.value=!1)}):S.value&&S.value.pause()};Yn("stopInlinePlay",()=>{D.value&&S.value&&(S.value.pause(),D.value=!1)});const B=()=>{D.value=!1},F=H(()=>i.cellWidth>400&&!D.value);Se(()=>i.idx,()=>{D.value&&S.value&&(S.value.pause(),D.value=!1)});const k=r=>{i.file.type==="dir"&&(r.preventDefault(),r.dataTransfer&&(r.dataTransfer.dropEffect="move"))},W=r=>{i.file.type==="dir"&&(r.preventDefault(),r.stopPropagation(),t("dropToFolder",r,i.file,i.idx))},X=r=>{o.magicSwitchTiktokView&&i.file.type==="file"&&le(i.file.name)?(r.stopPropagation(),r.preventDefault(),t("tiktokView",i.file,i.idx),setTimeout(()=>{It()},500)):t("fileItemClick",r,i.file,i.idx)},V=()=>{if(D.value){D.value=!1,S.value&&S.value.pause();return}o.magicSwitchTiktokView?t("tiktokView",i.file,i.idx):St(i.file,r=>t("contextMenuClick",{key:`toggle-tag-${r}`},i.file,i.idx),()=>t("tiktokView",i.file,i.idx))},R=()=>{o.magicSwitchTiktokView?t("tiktokView",i.file,i.idx):Tt(i.file,r=>t("contextMenuClick",{key:`toggle-tag-${r}`},i.file,i.idx),()=>t("tiktokView",i.file,i.idx))};return(r,c)=>{const E=Z,P=Ve,Q=je,L=Ct,Y=wt;return s(),C(E,{trigger:["contextmenu"],visible:_(o).longPressOpenContextMenu?typeof r.idx=="number"&&r.showMenuIdx===r.idx:void 0,"onUpdate:visible":c[8]||(c[8]=z=>typeof r.idx=="number"&&t("update:showMenuIdx",z?r.idx:-1))},{overlay:p(()=>[r.enableRightClickMenu?(s(),C(Me,{key:0,file:r.file,idx:r.idx,"selected-tag":A.value,onContextMenuClick:c[7]||(c[7]=(z,b,j)=>t("contextMenuClick",z,b,j)),"is-selected-mutil-files":r.isSelectedMutilFiles},null,8,["file","idx","selected-tag","is-selected-mutil-files"])):h("",!0)]),default:p(()=>{var z;return[(s(),d("li",{class:J(["file file-item-trigger grid",{clickable:r.file.type==="dir",selected:r.selected}]),"data-idx":r.idx,key:r.file.name,draggable:"true",onDragstart:c[4]||(c[4]=b=>t("dragstart",b,r.idx)),onDragend:c[5]||(c[5]=b=>t("dragend",b,r.idx)),onDragover:k,onDrop:W,onClickCapture:c[6]||(c[6]=b=>X(b))},[l("div",null,[r.enableCloseIcon?(s(),d("div",{key:0,class:"close-icon",onClick:c[0]||(c[0]=b=>t("close-icon-click"))},[v(_(gt))])):h("",!0),r.enableRightClickMenu?(s(),d("div",Zn,[v(E,null,{overlay:p(()=>[v(Me,{file:r.file,idx:r.idx,"selected-tag":A.value,onContextMenuClick:c[1]||(c[1]=(b,j,Ze)=>t("contextMenuClick",b,j,Ze)),"is-selected-mutil-files":r.isSelectedMutilFiles},null,8,["file","idx","selected-tag","is-selected-mutil-files"])]),default:p(()=>[l("div",xn,[v(_(pt))])]),_:1}),r.file.type==="file"?(s(),C(E,{key:0},{overlay:p(()=>[$.value.length>1?(s(),C(Q,{key:0,onClick:c[2]||(c[2]=b=>t("contextMenuClick",b,r.file,r.idx))},{default:p(()=>[(s(!0),d(N,null,M($.value,b=>(s(),C(P,{key:`toggle-tag-${b.id}`},{default:p(()=>[m(u(b.name)+" ",1),b.selected?(s(),C(_(Je),{key:0})):(s(),C(_(Ue),{key:1}))]),_:2},1024))),128))]),_:1})):h("",!0)]),default:p(()=>{var b,j;return[l("div",{class:J(["float-btn-wrap",{"like-selected":(b=T.value)==null?void 0:b.selected}]),onClick:U},[(j=T.value)!=null&&j.selected?(s(),C(_(mt),{key:0})):(s(),C(_(vt),{key:1}))],2)]}),_:1})):h("",!0),r.file.type==="file"&&_(le)(r.file.fullpath)?(s(),C(Kn,{key:1,size:"192px",file:r.file},{default:p(()=>[l("div",Xn,[v(_(He))])]),_:1},8,["file"])):h("",!0)])):h("",!0),_(le)(r.file.name)?(s(),d("div",{key:r.file.fullpath,class:J(`idx-${r.idx} item-content`)},[r.enableChangeIndicator&&f.value&&g.value?(s(),C(Vn,{key:0,"gen-diff-to-next":f.value,"gen-diff-to-previous":g.value},null,8,["gen-diff-to-next","gen-diff-to-previous"])):h("",!0),v(L,{src:O.value,fallback:_(Nt),preview:{src:r.fullScreenPreviewImageUrl,onVisibleChange:(b,j)=>t("previewVisibleChange",b,j)}},null,8,["src","fallback","preview"]),A.value&&r.cellWidth>ee?(s(),d("div",es,[(s(!0),d(N,null,M(r.extraTags??A.value,b=>(s(),C(Y,{key:b.id,color:_(a).getColor(b)},{default:p(()=>[m(u(b.name),1)]),_:2},1032,["color"]))),128))])):h("",!0)],2)):_(yt)(r.file.name)?(s(),d("div",{key:3,class:J([`idx-${r.idx} item-content video`,{"playing-inline":D.value}]),url:_(oe)(r.file),style:me({"background-image":D.value?"none":`url('${r.file.cover_url??_(oe)(r.file)}')`}),onClick:V},[r.cellWidth>400&&D.value?(s(),d("video",{key:0,ref:b=>S.value=b,src:_(Ce)(r.file),class:"inline-video-player",onEnded:B,onClick:c[3]||(c[3]=Le(()=>{},["stop"])),controls:""},null,40,is)):h("",!0),F.value?(s(),d("div",{key:1,class:"inline-play-overlay",onClick:w},[l("div",ns,[l("img",{src:_(ze),class:"play-icon-img"},null,8,ss),l("span",ls,u(_(n)("playInline")),1)])])):h("",!0),Fe(l("div",os,[l("img",{src:_(ze),style:{width:"40px",height:"40px"}},null,8,rs)],512),[[bt,!D.value]]),A.value&&r.cellWidth>ee?(s(),d("div",as,[(s(!0),d(N,null,M(A.value,b=>(s(),C(Y,{key:b.id,color:_(a).getColor(b)},{default:p(()=>[m(u(b.name),1)]),_:2},1032,["color"]))),128))])):h("",!0)],14,ts)):_(At)(r.file.name)?(s(),d("div",{key:4,class:J(`idx-${r.idx} item-content audio`),onClick:R},[ds,A.value&&r.cellWidth>ee?(s(),d("div",us,[(s(!0),d(N,null,M(A.value,b=>(s(),C(Y,{key:b.id,color:_(a).getColor(b)},{default:p(()=>[m(u(b.name),1)]),_:2},1032,["color"]))),128))])):h("",!0)],2)):(s(),d("div",fs,[r.file.type==="file"?(s(),C(_(Qt),{key:0,class:"icon center"})):(z=r.coverFiles)!=null&&z.length&&r.cellWidth>160?(s(),d("div",cs,[(s(!0),d(N,null,M(r.coverFiles,b=>(s(),d("img",{class:"dir-cover-item",src:b.media_type==="image"?_(Te)(b):_(oe)(b),key:b.fullpath},null,8,hs))),128))])):(s(),C(_(_t),{key:2,class:"icon center"}))])),r.cellWidth>ee?(s(),d("div",gs,[l("div",{class:"name line-clamp-1",title:r.file.name},u(r.file.name),9,ps),l("div",ms,[l("div",vs,u(r.file.type)+" "+u(r.file.size),1),l("div",null,u(r.file.date),1)])])):h("",!0)])],42,qn))]}),_:1},8,["visible"])}}});const _s=ve(ys,[["__scopeId","data-v-2cda5d16"]]);export{He as D,_s as F,Me as _,Kn as a,qe as s};