import{c as y,A as Z,at as re,au as ae,aH as De,o as s,v as S,cs as Le,ct as Je,cu as He,bf as Ue,cv as Ke,ba as We,j as d,ad as W,m as h,x as p,F as Q,G as $,bg as me,bh as Ye,cw as Ge,E as ze,Q as j,d as de,p as Qe,af as H,l as m,t as f,y as I,cx as qe,a0 as Pe,co as Ze,cn as xe,M as Oe,k as o,n as $e,cb as Xe,bk as et,r as ve,av as tt,s as it,cy as ye,O as nt,cz as st,ch as ot,cA as lt,cB as rt,cC as be,cD as at,cE as ee,cF as dt,cG as ut,ao as ft,cg as ct,cH as ht,cI as gt,cJ as pt,bO as mt}from"./index-0cf80cdf.js";import{D as U,a as ie}from"./index-5acf9bcb.js";U.Button=ie;U.install=function(e){return e.component(U.name,U),e.component(ie.name,ie),e};var vt={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 yt=vt;function Ae(e){for(var t=1;t0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var n=e.indexOf("Trident/");if(n>0){var i=e.indexOf("rv:");return parseInt(e.substring(i+3,e.indexOf(".",i)),10)}var r=e.indexOf("Edge/");return r>0?parseInt(e.substring(r+5,e.indexOf(".",r)),10):-1}let G;function ne(){ne.init||(ne.init=!0,G=Pt()!==-1)}var x={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){ne(),De(()=>{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",G&&this.$el.appendChild(e),e.data="about:blank",G||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&&(!G&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const Ot=Le();re("data-v-b329ee4c");const $t={class:"resize-observer",tabindex:"-1"};ae();const Nt=Ot((e,t,n,i,r,a)=>(s(),S("div",$t)));x.render=Nt;x.__scopeId="data-v-b329ee4c";x.__file="src/components/ResizeObserver.vue";function q(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?q=function(t){return typeof t}:q=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q(e)}function Bt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Te(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:{},i,r,a,v=function(g){for(var _=arguments.length,E=new Array(_>1?_-1:0),D=1;D<_;D++)E[D-1]=arguments[D];if(a=E,!(i&&g===r)){var T=n.leading;typeof T=="function"&&(T=T(g,r)),(!i||g!==r)&&T&&e.apply(void 0,[g].concat(Ce(a))),r=g,clearTimeout(i),i=setTimeout(function(){e.apply(void 0,[g].concat(Ce(a))),i=0},t)}};return v._clear=function(){clearTimeout(i),i=null},v}function Me(e,t){if(e===t)return!0;if(q(e)==="object"){for(var n in e)if(!Me(e[n],t[n]))return!1;return!0}return!1}var Ht=function(){function e(t,n,i){Bt(this,e),this.el=t,this.observer=null,this.frozen=!1,this.createObserver(n,i)}return Mt(e,[{key:"createObserver",value:function(n,i){var r=this;if(this.observer&&this.destroyObserver(),!this.frozen){if(this.options=Lt(n),this.callback=function(c,g){r.options.callback(c,g),c&&r.options.once&&(r.frozen=!0,r.destroyObserver())},this.callback&&this.options.throttle){var a=this.options.throttleOptions||{},v=a.leading;this.callback=Jt(this.callback,this.options.throttle,{leading:function(g){return v==="both"||v==="visible"&&g||v==="hidden"&&!g}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(c){var g=c[0];if(c.length>1){var _=c.find(function(D){return D.isIntersecting});_&&(g=_)}if(r.callback){var E=g.isIntersecting&&g.intersectionRatio>=r.threshold;if(E===r.oldResult)return;r.oldResult=E,r.callback(E,g)}},this.options.intersection),De(function(){r.observer&&r.observer.observe(r.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 Fe(e,t,n){var i=t.value;if(i)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 r=new Ht(e,i,n);e._vue_visibilityState=r}}function Ut(e,t,n){var i=t.value,r=t.oldValue;if(!Me(i,r)){var a=e._vue_visibilityState;if(!i){Re(e);return}a?a.createObserver(i,n):Fe(e,{value:i},n)}}function Re(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var Kt={beforeMount:Fe,updated:Ut,unmounted:Re},Wt={itemsLimit:1e3},Yt=/(auto|scroll)/;function Ve(e,t){return e.parentNode===null?t:Ve(e.parentNode,t.concat([e]))}var te=function(t,n){return getComputedStyle(t,null).getPropertyValue(n)},Gt=function(t){return te(t,"overflow")+te(t,"overflow-y")+te(t,"overflow-x")},qt=function(t){return Yt.test(Gt(t))};function Ee(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var t=Ve(e.parentNode,[]),n=0;n{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,n,i,r){const a=Je({id:ei++,index:t,used:!0,key:i,type:r}),v=He({item:n,position:0,nr:a});return e.push(v),v},unuseView(e,t=!1){const n=this.$_unusedViews,i=e.nr.type;let r=n.get(i);r||(r=[],n.set(i,r)),r.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:n}=this.updateVisibleItems(!1,!0);n||(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 n=this.itemSize,i=this.gridItems||1,r=this.itemSecondarySize||n,a=this.$_computedMinItemSize,v=this.typeField,c=this.simpleArray?null:this.keyField,g=this.items,_=g.length,E=this.sizes,D=this.$_views,T=this.$_unusedViews,L=this.pool,X=this.itemIndexByKey;let P,C,V,l,A;if(!_)P=C=l=A=V=0;else if(this.$_prerender)P=l=0,C=A=Math.min(this.prerender,g.length),V=null;else{const u=this.getScroll();if(t){let O=u.start-this.$_lastUpdateScrollPosition;if(O<0&&(O=-O),n===null&&Ou.start&&(ge=B),B=~~((J+ge)/2);while(B!==pe);for(B<0&&(B=0),P=B,V=E[_-1].accumulator,C=B;C<_&&E[C].accumulator_&&(C=_)),l=P;l<_&&z+E[l].accumulator_&&(C=_),l<0&&(l=0),A>_&&(A=_),V=Math.ceil(_/i)*n}}C-P>Wt.itemsLimit&&this.itemsLimitError(),this.totalSize=V;let b;const R=P<=this.$_endIndex&&C>=this.$_startIndex;if(R)for(let u=0,w=L.length;u=C)&&this.unuseView(b));const K=R?null:new Map;let F,N,M;for(let u=P;u=z.length)&&(b=this.addView(L,u,F,w,N),this.unuseView(b,!0),z=T.get(N)),b=z[M],K.set(N,M+1)),D.delete(b.nr.key),b.nr.used=!0,b.nr.index=u,b.nr.key=w,b.nr.type=N,D.set(w,b),O=!0;else if(!b.nr.used&&(b.nr.used=!0,b.nr.index=u,O=!0,z)){const J=z.indexOf(b);J!==-1&&z.splice(J,1)}b.item=F,O&&(u===g.length-1&&this.$emit("scroll-end"),u===0&&this.$emit("scroll-start")),n===null?(b.position=E[u-1].accumulator,b.offset=0):(b.position=Math.floor(u/i)*n,b.offset=u%i*r)}return this.$_startIndex=P,this.$_endIndex=C,this.emitUpdate&&this.$emit("update",P,C,l,A),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:R}},getListenerTarget(){let e=Ee(this.$el);return window.document&&(e===window.document.documentElement||e===window.document.body)&&(e=window),e},getScroll(){const{$el:e,direction:t}=this,n=t==="vertical";let i;if(this.pageMode){const r=e.getBoundingClientRect(),a=n?r.height:r.width;let v=-(n?r.top:r.left),c=n?window.innerHeight:window.innerWidth;v<0&&(c+=v,v=0),v+c>a&&(c=a-v),i={start:v,end:v+c}}else n?i={start:e.scrollTop,end:e.scrollTop+e.clientHeight}:i={start:e.scrollLeft,end:e.scrollLeft+e.clientWidth};return i},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,le?{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 n=this.gridItems||1;this.itemSize===null?t=e>0?this.sizes[e-1].accumulator:0:t=Math.floor(e/n)*this.itemSize,this.scrollToPosition(t)},scrollToPosition(e){const t=this.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let n,i,r;if(this.pageMode){const a=Ee(this.$el),v=a.tagName==="HTML"?0:a[t.scroll],c=a.getBoundingClientRect(),_=this.$el.getBoundingClientRect()[t.start]-c[t.start];n=a,i=t.scroll,r=e+v+_}else n=this.$el,i=t.scroll,r=e;n[i]=r},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 ti={key:0,ref:"before",class:"vue-recycle-scroller__slot"},ii={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function ni(e,t,n,i,r,a){const v=Ue("ResizeObserver"),c=Ke("observe-visibility");return We((s(),d("div",{class:j(["vue-recycle-scroller",{ready:r.ready,"page-mode":n.pageMode,[`direction-${e.direction}`]:!0}]),onScrollPassive:t[0]||(t[0]=(...g)=>a.handleScroll&&a.handleScroll(...g))},[e.$slots.before?(s(),d("div",ti,[W(e.$slots,"before")],512)):h("v-if",!0),(s(),S(me(n.listTag),{ref:"wrapper",style:ze({[e.direction==="vertical"?"minHeight":"minWidth"]:r.totalSize+"px"}),class:j(["vue-recycle-scroller__item-wrapper",n.listClass])},{default:p(()=>[(s(!0),d(Q,null,$(r.pool,g=>(s(),S(me(n.itemTag),Ye({key:g.nr.id,style:r.ready?{transform:`translate${e.direction==="vertical"?"Y":"X"}(${g.position}px) translate${e.direction==="vertical"?"X":"Y"}(${g.offset}px)`,width:n.gridItems?`${e.direction==="vertical"&&n.itemSecondarySize||n.itemSize}px`:void 0,height:n.gridItems?`${e.direction==="horizontal"&&n.itemSecondarySize||n.itemSize}px`:void 0}:null,class:["vue-recycle-scroller__item-view",[n.itemClass,{hover:!n.skipHover&&r.hoverKey===g.nr.key}]]},Ge(n.skipHover?{}:{mouseenter:()=>{r.hoverKey=g.nr.key},mouseleave:()=>{r.hoverKey=null}})),{default:p(()=>[W(e.$slots,"default",{item:g.item,index:g.nr.index,active:g.nr.used})]),_:2},1040,["style","class"]))),128)),W(e.$slots,"empty")]),_:3},8,["style","class"])),e.$slots.after?(s(),d("div",ii,[W(e.$slots,"after")],512)):h("v-if",!0),y(v,{onNotify:a.handleResize},null,8,["onNotify"])],34)),[[c,a.handleVisibilityChange]])}je.render=ni;je.__file="src/components/RecycleScroller.vue";const we=de({__name:"ContextMenu",props:{file:{},idx:{},selectedTag:{},isSelectedMutilFiles:{type:Boolean}},emits:["contextMenuClick"],setup(e,{emit:t}){const n=e,i=Qe(),r=H(()=>{var a;return(((a=i.conf)==null?void 0:a.all_custom_tags)??[]).reduce((v,c)=>[...v,{...c,selected:!!n.selectedTag.find(g=>g.id===c.id)}],[])});return(a,v)=>{const c=Pe,g=Ze,_=xe,E=Oe;return s(),S(E,{onClick:v[0]||(v[0]=D=>t("contextMenuClick",D,a.file,a.idx))},{default:p(()=>{var D;return[y(c,{key:"deleteFiles"},{default:p(()=>[m(f(a.$t("deleteSelected")),1)]),_:1}),y(c,{key:"openWithDefaultApp"},{default:p(()=>[m(f(a.$t("openWithDefaultApp")),1)]),_:1}),y(c,{key:"saveSelectedAsJson"},{default:p(()=>[m(f(a.$t("saveSelectedAsJson")),1)]),_:1}),a.file.type==="dir"?(s(),d(Q,{key:0},[y(c,{key:"openInNewTab"},{default:p(()=>[m(f(a.$t("openInNewTab")),1)]),_:1}),y(c,{key:"openOnTheRight"},{default:p(()=>[m(f(a.$t("openOnTheRight")),1)]),_:1}),y(c,{key:"openWithWalkMode"},{default:p(()=>[m(f(a.$t("openWithWalkMode")),1)]),_:1})],64)):h("",!0),a.file.type==="file"?(s(),d(Q,{key:1},[I(qe)(a.file.name)?(s(),d(Q,{key:0},[y(c,{key:"viewGenInfo"},{default:p(()=>[m(f(a.$t("viewGenerationInfo")),1)]),_:1}),y(c,{key:"tiktokView"},{default:p(()=>[m(f(a.$t("tiktokView")),1)]),_:1}),y(g),((D=I(i).conf)==null?void 0:D.launch_mode)!=="server"?(s(),d(Q,{key:0},[y(c,{key:"send2txt2img"},{default:p(()=>[m(f(a.$t("sendToTxt2img")),1)]),_:1}),y(c,{key:"send2img2img"},{default:p(()=>[m(f(a.$t("sendToImg2img")),1)]),_:1}),y(c,{key:"send2inpaint"},{default:p(()=>[m(f(a.$t("sendToInpaint")),1)]),_:1}),y(c,{key:"send2extras"},{default:p(()=>[m(f(a.$t("sendToExtraFeatures")),1)]),_:1}),y(_,{key:"sendToThirdPartyExtension",title:a.$t("sendToThirdPartyExtension")},{default:p(()=>[y(c,{key:"send2controlnet-txt2img"},{default:p(()=>[m("ControlNet - "+f(a.$t("t2i")),1)]),_:1}),y(c,{key:"send2controlnet-img2img"},{default:p(()=>[m("ControlNet - "+f(a.$t("i2i")),1)]),_:1}),y(c,{key:"send2outpaint"},{default:p(()=>[m("openOutpaint")]),_:1})]),_:1},8,["title"])],64)):h("",!0),y(c,{key:"send2BatchDownload"},{default:p(()=>[m(f(a.$t("sendToBatchDownload")),1)]),_:1}),y(_,{key:"copy2target",title:a.$t("copyTo")},{default:p(()=>[(s(!0),d(Q,null,$(I(i).quickMovePaths,T=>(s(),S(c,{key:`copy-to-${T.dir}`},{default:p(()=>[m(f(T.zh),1)]),_:2},1024))),128))]),_:1},8,["title"]),y(_,{key:"move2target",title:a.$t("moveTo")},{default:p(()=>[(s(!0),d(Q,null,$(I(i).quickMovePaths,T=>(s(),S(c,{key:`move-to-${T.dir}`},{default:p(()=>[m(f(T.zh),1)]),_:2},1024))),128))]),_:1},8,["title"]),y(g),a.isSelectedMutilFiles?(s(),d(Q,{key:1},[y(_,{key:"batch-add-tag",title:a.$t("batchAddTag")},{default:p(()=>[y(c,{key:"add-custom-tag"},{default:p(()=>[m("+ "+f(a.$t("addNewCustomTag")),1)]),_:1}),(s(!0),d(Q,null,$(r.value,T=>(s(),S(c,{key:`batch-add-tag-${T.id}`},{default:p(()=>[m(f(T.name),1)]),_:2},1024))),128))]),_:1},8,["title"]),y(_,{key:"batch-remove-tag",title:a.$t("batchRemoveTag")},{default:p(()=>[(s(!0),d(Q,null,$(r.value,T=>(s(),S(c,{key:`batch-remove-tag-${T.id}`},{default:p(()=>[m(f(T.name),1)]),_:2},1024))),128))]),_:1},8,["title"])],64)):(s(),S(_,{key:"toggle-tag",title:a.$t("toggleTag")},{default:p(()=>[y(c,{key:"add-custom-tag"},{default:p(()=>[m("+ "+f(a.$t("addNewCustomTag")),1)]),_:1}),(s(!0),d(Q,null,$(r.value,T=>(s(),S(c,{key:`toggle-tag-${T.id}`},{default:p(()=>[m(f(T.name)+" ",1),T.selected?(s(),S(I(Ne),{key:0})):(s(),S(I(Be),{key:1}))]),_:2},1024))),128))]),_:1},8,["title"])),y(g),y(c,{key:"openFileLocationInNewTab"},{default:p(()=>[m(f(a.$t("openFileLocationInNewTab")),1)]),_:1}),y(c,{key:"openWithLocalFileBrowser"},{default:p(()=>[m(f(a.$t("openWithLocalFileBrowser")),1)]),_:1})],64)):h("",!0),y(g),y(c,{key:"rename"},{default:p(()=>[m(f(a.$t("rename")),1)]),_:1}),y(c,{key:"previewInNewWindow"},{default:p(()=>[m(f(a.$t("previewInNewWindow")),1)]),_:1}),y(c,{key:"download"},{default:p(()=>[m(f(a.$t("download")),1)]),_:1}),y(c,{key:"copyPreviewUrl"},{default:p(()=>[m(f(a.$t("copySourceFilePreviewLink")),1)]),_:1}),y(c,{key:"copyFilePath"},{default:p(()=>[m(f(a.$t("copyFilePath")),1)]),_:1})],64)):h("",!0)]}),_:1})}}}),k=e=>(re("data-v-4ea1ffe2"),e=e(),ae(),e),si={class:"changeIndicatorWrapper"},oi={key:0,class:"changeIndicatorsLeft changeIndicators"},li={key:0,class:"promptChangeIndicator changeIndicator"},ri={key:1,class:"negpromptChangeIndicator changeIndicator"},ai={key:2,class:"seedChangeIndicator changeIndicator"},di={key:3,class:"stepsChangeIndicator changeIndicator"},ui={key:4,class:"cfgChangeIndicator changeIndicator"},fi={key:5,class:"sizeChangeIndicator changeIndicator"},ci={key:6,class:"modelChangeIndicator changeIndicator"},hi={key:7,class:"samplerChangeIndicator changeIndicator"},gi={key:8,class:"otherChangeIndicator changeIndicator"},pi={class:"hoverOverlay"},mi=k(()=>o("strong",null,"This file",-1)),vi=k(()=>o("br",null,null,-1)),yi=k(()=>o("br",null,null,-1)),bi={key:0},Ai=k(()=>o("td",null,[o("span",{class:"promptChangeIndicator"},"+ Prompt")],-1)),ki={key:1},_i=k(()=>o("td",null,[o("span",{class:"negpromptChangeIndicator"},"- Prompt")],-1)),Ii={key:2},Si=k(()=>o("td",null,[o("span",{class:"seedChangeIndicator"},"Seed")],-1)),Ti={key:3},Ci=k(()=>o("td",null,[o("span",{class:"stepsChangeIndicator"},"Steps")],-1)),Ei={key:4},wi=k(()=>o("td",null,[o("span",{class:"cfgChangeIndicator"},"Cfg Scale")],-1)),Di={key:5},zi=k(()=>o("td",null,[o("span",{class:"sizeChangeIndicator"},"Size")],-1)),Qi={key:6},Pi=k(()=>o("td",null,[o("span",{class:"modelChangeIndicator"},"Model")],-1)),Oi=k(()=>o("br",null,null,-1)),$i={key:7},Ni=k(()=>o("td",null,[o("span",{class:"samplerChangeIndicator"},"Sampler")],-1)),Bi=k(()=>o("br",null,null,-1)),Mi=k(()=>o("br",null,null,-1)),Fi={key:0},Ri=k(()=>o("span",{class:"otherChangeIndicator"},"Other",-1)),Vi=k(()=>o("br",null,null,-1)),ji=k(()=>o("br",null,null,-1)),Li={key:1,class:"changeIndicatorsRight changeIndicators"},Ji={key:0,class:"promptChangeIndicator changeIndicator"},Hi={key:1,class:"negpromptChangeIndicator changeIndicator"},Ui={key:2,class:"seedChangeIndicator changeIndicator"},Ki={key:3,class:"stepsChangeIndicator changeIndicator"},Wi={key:4,class:"cfgChangeIndicator changeIndicator"},Yi={key:5,class:"sizeChangeIndicator changeIndicator"},Gi={key:6,class:"modelChangeIndicator changeIndicator"},qi={key:7,class:"samplerChangeIndicator changeIndicator"},Zi={key:8,class:"otherChangeIndicator changeIndicator"},xi={class:"hoverOverlay"},Xi=k(()=>o("strong",null,"This file",-1)),en=k(()=>o("br",null,null,-1)),tn=k(()=>o("br",null,null,-1)),nn={key:0},sn=k(()=>o("td",null,[o("span",{class:"promptChangeIndicator"},"+ Prompt")],-1)),on={key:1},ln=k(()=>o("td",null,[o("span",{class:"negpromptChangeIndicator"},"- Prompt")],-1)),rn={key:2},an=k(()=>o("td",null,[o("span",{class:"seedChangeIndicator"},"Seed")],-1)),dn={key:3},un=k(()=>o("td",null,[o("span",{class:"stepsChangeIndicator"},"Steps")],-1)),fn={key:4},cn=k(()=>o("td",null,[o("span",{class:"cfgChangeIndicator"},"Cfg Scale")],-1)),hn={key:5},gn=k(()=>o("td",null,[o("span",{class:"sizeChangeIndicator"},"Size")],-1)),pn={key:6},mn=k(()=>o("td",null,[o("span",{class:"modelChangeIndicator"},"Model")],-1)),vn=k(()=>o("br",null,null,-1)),yn={key:7},bn=k(()=>o("td",null,[o("span",{class:"samplerChangeIndicator"},"Sampler")],-1)),An=k(()=>o("br",null,null,-1)),kn=k(()=>o("br",null,null,-1)),_n={key:0},In=k(()=>o("span",{class:"otherChangeIndicator"},"Other",-1)),Sn=k(()=>o("br",null,null,-1)),Tn=k(()=>o("br",null,null,-1)),Cn=de({__name:"ChangeIndicator",props:{genDiffToPrevious:{},genDiffToNext:{},genInfo:{}},setup(e){function t(i){const r=["prompt","negativePrompt","seed","steps","cfgScale","size","Model","others"],a=Object.keys(i).filter(v=>!r.includes(v));return Object.fromEntries(a.map(v=>[v,i[v]]))}function n(i){return Object.keys(t(i)).length>0}return(i,r)=>(s(),d("div",si,[i.genDiffToPrevious.empty?h("",!0):(s(),d("div",oi,["prompt"in i.genDiffToPrevious.diff?(s(),d("div",li,"P+")):h("",!0),"negativePrompt"in i.genDiffToPrevious.diff?(s(),d("div",ri,"P-")):h("",!0),"seed"in i.genDiffToPrevious.diff?(s(),d("div",ai,"Se")):h("",!0),"steps"in i.genDiffToPrevious.diff?(s(),d("div",di,"St")):h("",!0),"cfgScale"in i.genDiffToPrevious.diff?(s(),d("div",ui,"Cf")):h("",!0),"size"in i.genDiffToPrevious.diff?(s(),d("div",fi,"Si")):h("",!0),"Model"in i.genDiffToPrevious.diff?(s(),d("div",ci,"Mo")):h("",!0),"Sampler"in i.genDiffToPrevious.diff?(s(),d("div",hi,"Sa")):h("",!0),n(i.genDiffToPrevious.diff)?(s(),d("div",gi,"Ot")):h("",!0)])),o("div",pi,[o("small",null,[y(I(Ie)),mi,m(" vs "+f(i.genDiffToPrevious.otherFile)+" ",1),vi,yi,o("table",null,["prompt"in i.genDiffToPrevious.diff?(s(),d("tr",bi,[Ai,o("td",null,f(i.genDiffToPrevious.diff.prompt)+" tokens changed",1)])):h("",!0),"negativePrompt"in i.genDiffToPrevious.diff?(s(),d("tr",ki,[_i,o("td",null,f(i.genDiffToPrevious.diff.negativePrompt)+" tokens changed",1)])):h("",!0),"seed"in i.genDiffToPrevious.diff?(s(),d("tr",Ii,[Si,o("td",null,[o("strong",null,f(i.genDiffToPrevious.diff.seed[0]),1),m(" vs "+f(i.genDiffToPrevious.diff.seed[1]),1)])])):h("",!0),"steps"in i.genDiffToPrevious.diff?(s(),d("tr",Ti,[Ci,o("td",null,[o("strong",null,f(i.genDiffToPrevious.diff.steps[0]),1),m(" vs "+f(i.genDiffToPrevious.diff.steps[1]),1)])])):h("",!0),"cfgScale"in i.genDiffToPrevious.diff?(s(),d("tr",Ei,[wi,o("td",null,[o("strong",null,f(i.genDiffToPrevious.diff.cfgScale[0]),1),m(" vs "+f(i.genDiffToPrevious.diff.cfgScale[1]),1)])])):h("",!0),"size"in i.genDiffToPrevious.diff?(s(),d("tr",Di,[zi,o("td",null,[o("strong",null,f(i.genDiffToPrevious.diff.size[0]),1),m(" vs "+f(i.genDiffToPrevious.diff.size[1]),1)])])):h("",!0),"Model"in i.genDiffToPrevious.diff?(s(),d("tr",Qi,[Pi,o("td",null,[o("strong",null,f(i.genDiffToPrevious.diff.Model[0]),1),Oi,m(" vs "+f(i.genDiffToPrevious.diff.Model[1]),1)])])):h("",!0),"Sampler"in i.genDiffToPrevious.diff?(s(),d("tr",$i,[Ni,o("td",null,[o("strong",null,f(i.genDiffToPrevious.diff.Sampler[0]),1),Bi,m(" vs "+f(i.genDiffToPrevious.diff.Sampler[1]),1)])])):h("",!0)]),Mi,n(i.genDiffToPrevious.diff)?(s(),d("div",Fi,[Ri,m(" props that changed:"),Vi,ji,o("ul",null,[(s(!0),d(Q,null,$(t(i.genDiffToPrevious.diff),(a,v)=>(s(),d("li",null,f(v),1))),256))])])):h("",!0)])]),i.genDiffToNext.empty?h("",!0):(s(),d("div",Li,["prompt"in i.genDiffToNext.diff?(s(),d("div",Ji,"P+")):h("",!0),"negativePrompt"in i.genDiffToNext.diff?(s(),d("div",Hi,"P-")):h("",!0),"seed"in i.genDiffToNext.diff?(s(),d("div",Ui,"Se")):h("",!0),"steps"in i.genDiffToNext.diff?(s(),d("div",Ki,"St")):h("",!0),"cfgScale"in i.genDiffToNext.diff?(s(),d("div",Wi,"Cf")):h("",!0),"size"in i.genDiffToNext.diff?(s(),d("div",Yi,"Si")):h("",!0),"Model"in i.genDiffToNext.diff?(s(),d("div",Gi,"Mo")):h("",!0),"Sampler"in i.genDiffToNext.diff?(s(),d("div",qi,"Sa")):h("",!0),n(i.genDiffToNext.diff)?(s(),d("div",Zi,"Ot")):h("",!0)])),o("div",xi,[o("small",null,[y(I(Ie)),Xi,m(" vs "+f(i.genDiffToNext.otherFile)+" ",1),en,tn,o("table",null,["prompt"in i.genDiffToNext.diff?(s(),d("tr",nn,[sn,o("td",null,f(i.genDiffToNext.diff.prompt)+" tokens changed",1)])):h("",!0),"negativePrompt"in i.genDiffToNext.diff?(s(),d("tr",on,[ln,o("td",null,f(i.genDiffToNext.diff.negativePrompt)+" tokens changed",1)])):h("",!0),"seed"in i.genDiffToNext.diff?(s(),d("tr",rn,[an,o("td",null,[o("strong",null,f(i.genDiffToNext.diff.seed[0]),1),m(" vs "+f(i.genDiffToNext.diff.seed[1]),1)])])):h("",!0),"steps"in i.genDiffToNext.diff?(s(),d("tr",dn,[un,o("td",null,[o("strong",null,f(i.genDiffToNext.diff.steps[0]),1),m(" vs "+f(i.genDiffToNext.diff.steps[1]),1)])])):h("",!0),"cfgScale"in i.genDiffToNext.diff?(s(),d("tr",fn,[cn,o("td",null,[o("strong",null,f(i.genDiffToNext.diff.cfgScale[0]),1),m(" vs "+f(i.genDiffToNext.diff.cfgScale[1]),1)])])):h("",!0),"size"in i.genDiffToNext.diff?(s(),d("tr",hn,[gn,o("td",null,[o("strong",null,f(i.genDiffToNext.diff.size[0]),1),m(" vs "+f(i.genDiffToNext.diff.size[1]),1)])])):h("",!0),"Model"in i.genDiffToNext.diff?(s(),d("tr",pn,[mn,o("td",null,[o("strong",null,f(i.genDiffToNext.diff.Model[0]),1),vn,m(" vs "+f(i.genDiffToNext.diff.Model[1]),1)])])):h("",!0),"Sampler"in i.genDiffToNext.diff?(s(),d("tr",yn,[bn,o("td",null,[o("strong",null,f(i.genDiffToNext.diff.Sampler[0]),1),An,m(" vs "+f(i.genDiffToNext.diff.Sampler[1]),1)])])):h("",!0)]),kn,n(i.genDiffToNext.diff)?(s(),d("div",_n,[In,m(" props that changed:"),Sn,Tn,o("ul",null,[(s(!0),d(Q,null,$(t(i.genDiffToNext.diff),(a,v)=>(s(),d("li",null,f(v),1))),256))])])):h("",!0)])])]))}});const En=$e(Cn,[["__scopeId","data-v-4ea1ffe2"]]),wn=e=>(re("data-v-27cbce0c"),e=e(),ae(),e),Dn=["data-idx"],zn={key:1,class:"more"},Qn={class:"float-btn-wrap"},Pn={key:1,class:"tags-container"},On=["url"],$n={class:"play-icon"},Nn=["src"],Bn={key:0,class:"tags-container"},Mn=wn(()=>o("div",{class:"audio-icon"},"🎵",-1)),Fn={key:0,class:"tags-container"},Rn={key:5,class:"preview-icon-wrap"},Vn={key:1,class:"dir-cover-container"},jn=["src"],Ln={key:6,class:"profile"},Jn=["title"],Hn={class:"basic-info"},Un={style:{"margin-right":"4px"}},Y=160,Kn=de({__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 n=e;Xe(l=>({"0163f23c":l.$props.cellWidth+"px"}));const i=Qe(),r=et(),a=ve(),v=ve(),c=tt(()=>{const{getGenDiff:l,file:A,idx:b}=n;l&&(v.value=l(A.gen_info_obj,b,1,A),a.value=l(A.gen_info_obj,b,-1,A))},200+100*Math.random());it(()=>{var l;return(l=n.getGenDiffWatchDep)==null?void 0:l.call(n,n.idx)},()=>{c()},{immediate:!0,deep:!0});const g=H(()=>r.tagMap.get(n.file.fullpath)??[]),_=H(()=>{const l=i.gridThumbnailResolution;return i.enableThumbnail?ye(n.file,[l,l].join("x")):nt(n.file)}),E=H(()=>{var l;return(((l=i.conf)==null?void 0:l.all_custom_tags)??[]).reduce((A,b)=>[...A,{...b,selected:!!g.value.find(R=>R.id===b.id)}],[])}),D=H(()=>E.value.find(l=>l.type==="custom"&&l.name==="like")),T=()=>{ft(D.value),t("contextMenuClick",{key:`toggle-tag-${D.value.id}`},n.file,n.idx)},L=l=>{n.file.type==="dir"&&(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect="move"))},X=l=>{n.file.type==="dir"&&(l.preventDefault(),l.stopPropagation(),t("dropToFolder",l,n.file,n.idx))},P=l=>{i.magicSwitchTiktokView&&n.file.type==="file"&&be(n.file.name)?(l.stopPropagation(),l.preventDefault(),t("tiktokView",n.file,n.idx),setTimeout(()=>{ct()},500)):t("fileItemClick",l,n.file,n.idx)},C=()=>{i.magicSwitchTiktokView?t("tiktokView",n.file,n.idx):ht(n.file,l=>t("contextMenuClick",{key:`toggle-tag-${l}`},n.file,n.idx),()=>t("tiktokView",n.file,n.idx))},V=()=>{i.magicSwitchTiktokView?t("tiktokView",n.file,n.idx):gt(n.file,l=>t("contextMenuClick",{key:`toggle-tag-${l}`},n.file,n.idx),()=>t("tiktokView",n.file,n.idx))};return(l,A)=>{const b=U,R=Pe,K=Oe,F=pt,N=mt;return s(),S(b,{trigger:["contextmenu"],visible:I(i).longPressOpenContextMenu?typeof l.idx=="number"&&l.showMenuIdx===l.idx:void 0,"onUpdate:visible":A[7]||(A[7]=M=>typeof l.idx=="number"&&t("update:showMenuIdx",M?l.idx:-1))},{overlay:p(()=>[l.enableRightClickMenu?(s(),S(we,{key:0,file:l.file,idx:l.idx,"selected-tag":g.value,onContextMenuClick:A[6]||(A[6]=(M,u,w)=>t("contextMenuClick",M,u,w)),"is-selected-mutil-files":l.isSelectedMutilFiles},null,8,["file","idx","selected-tag","is-selected-mutil-files"])):h("",!0)]),default:p(()=>{var M;return[(s(),d("li",{class:j(["file file-item-trigger grid",{clickable:l.file.type==="dir",selected:l.selected}]),"data-idx":l.idx,key:l.file.name,draggable:"true",onDragstart:A[3]||(A[3]=u=>t("dragstart",u,l.idx)),onDragend:A[4]||(A[4]=u=>t("dragend",u,l.idx)),onDragover:L,onDrop:X,onClickCapture:A[5]||(A[5]=u=>P(u))},[o("div",null,[l.enableCloseIcon?(s(),d("div",{key:0,class:"close-icon",onClick:A[0]||(A[0]=u=>t("close-icon-click"))},[y(I(st))])):h("",!0),l.enableRightClickMenu?(s(),d("div",zn,[y(b,null,{overlay:p(()=>[y(we,{file:l.file,idx:l.idx,"selected-tag":g.value,onContextMenuClick:A[1]||(A[1]=(u,w,z)=>t("contextMenuClick",u,w,z)),"is-selected-mutil-files":l.isSelectedMutilFiles},null,8,["file","idx","selected-tag","is-selected-mutil-files"])]),default:p(()=>[o("div",Qn,[y(I(ot))])]),_:1}),l.file.type==="file"?(s(),S(b,{key:0},{overlay:p(()=>[E.value.length>1?(s(),S(K,{key:0,onClick:A[2]||(A[2]=u=>t("contextMenuClick",u,l.file,l.idx))},{default:p(()=>[(s(!0),d(Q,null,$(E.value,u=>(s(),S(R,{key:`toggle-tag-${u.id}`},{default:p(()=>[m(f(u.name)+" ",1),u.selected?(s(),S(I(Ne),{key:0})):(s(),S(I(Be),{key:1}))]),_:2},1024))),128))]),_:1})):h("",!0)]),default:p(()=>{var u,w;return[o("div",{class:j(["float-btn-wrap",{"like-selected":(u=D.value)==null?void 0:u.selected}]),onClick:T},[(w=D.value)!=null&&w.selected?(s(),S(I(lt),{key:0})):(s(),S(I(rt),{key:1}))],2)]}),_:1})):h("",!0)])):h("",!0),I(be)(l.file.name)?(s(),d("div",{key:l.file.fullpath,class:j(`idx-${l.idx} item-content`)},[l.enableChangeIndicator&&v.value&&a.value?(s(),S(En,{key:0,"gen-diff-to-next":v.value,"gen-diff-to-previous":a.value},null,8,["gen-diff-to-next","gen-diff-to-previous"])):h("",!0),y(F,{src:_.value,fallback:I(St),preview:{src:l.fullScreenPreviewImageUrl,onVisibleChange:(u,w)=>t("previewVisibleChange",u,w)}},null,8,["src","fallback","preview"]),g.value&&l.cellWidth>Y?(s(),d("div",Pn,[(s(!0),d(Q,null,$(l.extraTags??g.value,u=>(s(),S(N,{key:u.id,color:I(r).getColor(u)},{default:p(()=>[m(f(u.name),1)]),_:2},1032,["color"]))),128))])):h("",!0)],2)):I(at)(l.file.name)?(s(),d("div",{key:3,class:j(`idx-${l.idx} item-content video`),url:I(ee)(l.file),style:ze({"background-image":`url('${l.file.cover_url??I(ee)(l.file)}')`}),onClick:C},[o("div",$n,[o("img",{src:I(Qt),style:{width:"40px",height:"40px"}},null,8,Nn)]),g.value&&l.cellWidth>Y?(s(),d("div",Bn,[(s(!0),d(Q,null,$(g.value,u=>(s(),S(N,{key:u.id,color:I(r).getColor(u)},{default:p(()=>[m(f(u.name),1)]),_:2},1032,["color"]))),128))])):h("",!0)],14,On)):I(dt)(l.file.name)?(s(),d("div",{key:4,class:j(`idx-${l.idx} item-content audio`),onClick:V},[Mn,g.value&&l.cellWidth>Y?(s(),d("div",Fn,[(s(!0),d(Q,null,$(g.value,u=>(s(),S(N,{key:u.id,color:I(r).getColor(u)},{default:p(()=>[m(f(u.name),1)]),_:2},1032,["color"]))),128))])):h("",!0)],2)):(s(),d("div",Rn,[l.file.type==="file"?(s(),S(I(It),{key:0,class:"icon center"})):(M=l.coverFiles)!=null&&M.length&&l.cellWidth>160?(s(),d("div",Vn,[(s(!0),d(Q,null,$(l.coverFiles,u=>(s(),d("img",{class:"dir-cover-item",src:u.media_type==="image"?I(ye)(u):I(ee)(u),key:u.fullpath},null,8,jn))),128))])):(s(),S(I(ut),{key:2,class:"icon center"}))])),l.cellWidth>Y?(s(),d("div",Ln,[o("div",{class:"name line-clamp-1",title:l.file.name},f(l.file.name),9,Jn),o("div",Hn,[o("div",Un,f(l.file.type)+" "+f(l.file.size),1),o("div",null,f(l.file.date),1)])])):h("",!0)])],42,Dn))]}),_:1},8,["visible"])}}});const Gn=$e(Kn,[["__scopeId","data-v-27cbce0c"]]);export{Gn as F,we as _,je as s};