sd-webui-infinite-image-bro.../vue/dist/assets/MultiSelectKeep-0aedd2f1.js

4 lines
30 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import{aR as We,c as i,A as te,v as G,x as L,n as Ye,J as X,k as he,t as Ge,cf as xe,cg as Je,c2 as ye,ad as ae,af as ee,ch as Ke,r as Z,ci as Qe,C as $e,a9 as J,cj as Ze,ck as Re,R as $,a8 as et,cl as pe,I as se,cm as tt,E as me,cn as nt,co as at,ce as lt,cp as st,cq as ot,o as rt,d as Be,W as He,cr as it,B as R,L as Se,cs as Ce,l as Me,N as O,O as S,Q as C,Z as h,X as oe,Y as y,ct as ut,U,T as Q,S as b,a2 as ce,aa as Pe,a1 as ct,a0 as dt,$ as vt,ag as ft,cu as pt,M as mt,cv as gt,cw as ht,aI as yt,aJ as _t,V as Ve}from"./index-333f4d92.js";import{u as ue,e as ge,g as W,f as Ie,h as ie,r as wt,t as de,i as bt,s as ve,j as re,_ as kt}from"./FileItem-064f25fa.js";import{M as Ue,c as Ot,m as qe,l as Fe,b as Lt,d as Et}from"./functionalCallableComp-dc2cf08d.js";import{C as xt,g as $t}from"./shortcut-0854cd7e.js";import{D as St}from"./index-267d1f4e.js";/* empty css */const le=(...e)=>{document.addEventListener(...e),We(()=>document.removeEventListener(...e))};var Ct={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 000 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0013.5-4.7L863.9 169a7.9 7.9 0 00-8.9-8.9zM416.6 562.3a8.03 8.03 0 00-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 00-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"}}]},name:"arrows-alt",theme:"outlined"};const Mt=Ct;function De(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(a).filter(function(s){return Object.getOwnPropertyDescriptor(a,s).enumerable}))),n.forEach(function(s){Pt(e,s,a[s])})}return e}function Pt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var _e=function(t,a){var n=De({},t,a.attrs);return i(te,De({},n,{icon:Mt}),null)};_e.displayName="ArrowsAltOutlined";_e.inheritAttrs=!1;const It=_e;var Ft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.3 506.3L781.7 405.6a7.23 7.23 0 00-11.7 5.7V476H548V254h64.8c6 0 9.4-7 5.7-11.7L517.7 114.7a7.14 7.14 0 00-11.3 0L405.6 242.3a7.23 7.23 0 005.7 11.7H476v222H254v-64.8c0-6-7-9.4-11.7-5.7L114.7 506.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h222v222h-64.8c-6 0-9.4 7-5.7 11.7l100.8 127.5c2.9 3.7 8.5 3.7 11.3 0l100.8-127.5c3.7-4.7.4-11.7-5.7-11.7H548V548h222v64.8c0 6 7 9.4 11.7 5.7l127.5-100.8a7.3 7.3 0 00.1-11.4z"}}]},name:"drag",theme:"outlined"};const Dt=Ft;function Ae(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(a).filter(function(s){return Object.getOwnPropertyDescriptor(a,s).enumerable}))),n.forEach(function(s){At(e,s,a[s])})}return e}function At(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var we=function(t,a){var n=Ae({},t,a.attrs);return i(te,Ae({},n,{icon:Dt}),null)};we.displayName="DragOutlined";we.inheritAttrs=!1;const Tt=we;var zt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 000 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 00391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 00-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"}}]},name:"fullscreen-exit",theme:"outlined"};const Nt=zt;function Te(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(a).filter(function(s){return Object.getOwnPropertyDescriptor(a,s).enumerable}))),n.forEach(function(s){jt(e,s,a[s])})}return e}function jt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var be=function(t,a){var n=Te({},t,a.attrs);return i(te,Te({},n,{icon:Nt}),null)};be.displayName="FullscreenExitOutlined";be.inheritAttrs=!1;const Wt=be;var Bt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M290 236.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0013.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 000 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 00-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"}}]},name:"fullscreen",theme:"outlined"};const Ht=Bt;function ze(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(a).filter(function(s){return Object.getOwnPropertyDescriptor(a,s).enumerable}))),n.forEach(function(s){Vt(e,s,a[s])})}return e}function Vt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var ke=function(t,a){var n=ze({},t,a.attrs);return i(te,ze({},n,{icon:Ht}),null)};ke.displayName="FullscreenOutlined";ke.inheritAttrs=!1;const Ut=ke;var qt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M603.3 327.5l-246 178a7.95 7.95 0 000 12.9l246 178c5.3 3.8 12.7 0 12.7-6.5V643c0-10.2-4.9-19.9-13.2-25.9L457.4 512l145.4-105.2c8.3-6 13.2-15.6 13.2-25.9V334c0-6.5-7.4-10.3-12.7-6.5z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"left-circle",theme:"outlined"};const Xt=qt;function Ne(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(a).filter(function(s){return Object.getOwnPropertyDescriptor(a,s).enumerable}))),n.forEach(function(s){Yt(e,s,a[s])})}return e}function Yt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var Oe=function(t,a){var n=Ne({},t,a.attrs);return i(te,Ne({},n,{icon:Xt}),null)};Oe.displayName="LeftCircleOutlined";Oe.inheritAttrs=!1;const Nn=Oe;var Gt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M666.7 505.5l-246-178A8 8 0 00408 334v46.9c0 10.2 4.9 19.9 13.2 25.9L566.6 512 421.2 617.2c-8.3 6-13.2 15.6-13.2 25.9V690c0 6.5 7.4 10.3 12.7 6.5l246-178c4.4-3.2 4.4-9.8 0-13z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"right-circle",theme:"outlined"};const Jt=Gt;function je(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(a).filter(function(s){return Object.getOwnPropertyDescriptor(a,s).enumerable}))),n.forEach(function(s){Kt(e,s,a[s])})}return e}function Kt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var Le=function(t,a){var n=je({},t,a.attrs);return i(te,je({},n,{icon:Jt}),null)};Le.displayName="RightCircleOutlined";Le.inheritAttrs=!1;const jn=Le,Qt="/infinite_image_browsing/fe-static/assets/fullscreen-7f54b926.svg";function Wn(){const{previewIdx:e,eventEmitter:t,canLoadNext:a,previewing:n,sortedFiles:s,scroller:m,props:x}=ue().toRefs(),{state:M}=ue();let F=null;const z=(p,c)=>{var f;n.value=p,F!=null&&!p&&c&&((f=m.value)==null||f.scrollToItem(F),F=null)},A=()=>{x.value.mode==="walk"&&!_("next")&&a&&(G.info(L("loadingNextFolder")),t.value.emit("loadNextDir",!0))};le("keydown",p=>{var c;if(n.value){let f=e.value;if(["ArrowDown","ArrowRight"].includes(p.key))for(f++;s.value[f]&&!X(s.value[f].name);)f++;else if(["ArrowUp","ArrowLeft"].includes(p.key))for(f--;s.value[f]&&!X(s.value[f].name);)f--;if(X((c=s.value[f])==null?void 0:c.name)??""){e.value=f;const w=m.value;w&&!(f>=w.$_startIndex&&f<=w.$_endIndex)&&(F=f)}A()}});const P=p=>{var f;let c=e.value;if(p==="next")for(c++;s.value[c]&&!X(s.value[c].name);)c++;else if(p==="prev")for(c--;s.value[c]&&!X(s.value[c].name);)c--;if(X((f=s.value[c])==null?void 0:f.name)??""){e.value=c;const w=m.value;w&&!(c>=w.$_startIndex&&c<=w.$_endIndex)&&(F=c)}A()},_=p=>{var f;let c=e.value;if(p==="next")for(c++;s.value[c]&&!X(s.value[c].name);)c++;else if(p==="prev")for(c--;s.value[c]&&!X(s.value[c].name);)c--;return X((f=s.value[c])==null?void 0:f.name)??""};return ge("removeFiles",async()=>{var p;n.value&&!M.sortedFiles[e.value]&&(G.info(L("manualExitFullScreen"),5),await Ye(500),(p=document.querySelector(".ant-image-preview-operations-operation .anticon-close"))==null||p.click(),e.value=-1)}),{previewIdx:e,onPreviewVisibleChange:z,previewing:n,previewImgMove:P,canPreview:_}}function fe(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Ke(e)}function Bn(){const{currLocation:e,sortedFiles:t,currPage:a,multiSelectedIdxs:n,eventEmitter:s,walker:m}=ue().toRefs(),x=()=>{n.value=[]};return le("click",()=>{W.keepMultiSelect||x()}),le("blur",()=>{W.keepMultiSelect||x()}),he(a,x),{onFileDragStart:(A,P)=>{const _=Ge(t.value[P]);Ie.fileDragging=!0,console.log("onFileDragStart set drag file ",A,P,_);const p=[_];let c=_.type==="dir";if(n.value.includes(P)){const w=n.value.map(D=>t.value[D]);p.push(...w),c=w.some(D=>D.type==="dir")}const f={includeDir:c,loc:e.value||"search-result",path:xe(p,"fullpath").map(w=>w.fullpath),nodes:xe(p,"fullpath"),__id:"FileTransferData"};A.dataTransfer.setData("text/plain",JSON.stringify(f))},onDrop:async A=>{if(m.value)return;const P=Je(A);if(!P)return;const _=e.value;if(P.loc===_)return;const p=ye(),c=async()=>p.pushAction(async()=>{await Ot(P.path,_),s.value.emit("refresh"),ae.destroyAll()}),f=()=>p.pushAction(async()=>{await qe(P.path,_),ie.emit("removeFiles",{paths:P.path,loc:P.loc}),s.value.emit("refresh"),ae.destroyAll()});ae.confirm({title:L("confirm")+"?",width:"60vw",content:()=>{let w,D,u;return i("div",null,[i("div",null,[`${L("moveSelectedFilesTo")} ${_}`,i("ol",{style:{maxHeight:"50vh",overflow:"auto"}},[P.path.map(o=>i("li",null,[o.split(/[/\\]/).pop()]))])]),i(Ue,null,null),i("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end"},class:"actions"},[i(ee,{onClick:ae.destroyAll},fe(w=L("cancel"))?w:{default:()=>[w]}),i(ee,{type:"primary",loading:!p.isIdle,onClick:c},fe(D=L("copy"))?D:{default:()=>[D]}),i(ee,{type:"primary",loading:!p.isIdle,onClick:f},fe(u=L("move"))?u:{default:()=>[u]})])])},maskClosable:!0,wrapClassName:"hidden-antd-btns-modal"})},multiSelectedIdxs:n,onFileDragEnd:()=>{Ie.fileDragging=!1}}}function Hn({openNext:e}){const t=Z(!1),a=Z(""),{sortedFiles:n,previewIdx:s,multiSelectedIdxs:m,stack:x,currLocation:M,spinning:F,previewing:z,stackViewEl:A,eventEmitter:P,props:_,deletedFiles:p}=ue().toRefs(),c=$e;ge("removeFiles",({paths:o,loc:r})=>{c(r)!==c(M.value)||!Fe(x.value)||(o.forEach(N=>p.value.add(N)),o.filter(X).forEach(N=>p.value.add(N.replace(/\.\w+$/,".txt"))))}),ge("addFiles",({files:o,loc:r})=>{if(c(r)!==c(M.value))return;const I=Fe(x.value);I&&I.files.unshift(...o)});const f=ye(),w=async(o,r,I)=>{s.value=I,W.fullscreenPreviewInitialUrl=J(r);const N=m.value.indexOf(I);if(o.shiftKey){if(N!==-1)m.value.splice(N,1);else{m.value.push(I),m.value.sort((l,d)=>l-d);const V=m.value[0],q=m.value[m.value.length-1];m.value=wt(V,q+1)}o.stopPropagation()}else o.ctrlKey||o.metaKey?(N!==-1?m.value.splice(N,1):m.value.push(I),o.stopPropagation()):await e(r)},D=async(o,r,I)=>{var H,k,Y;const N=J(r),V=M.value,q={IIB_container_id:parent.IIB_container_id},l=()=>{let v=[];return m.value.includes(I)?v=m.value.map(g=>n.value[g]):v.push(r),v},d=async v=>{if(!F.value)try{F.value=!0,await st(r.fullpath),re.postMessage({...q,event:"click_hidden_button",btnEleId:"iib_hidden_img_update_trigger"}),await ot(),re.postMessage({...q,event:"click_hidden_button",btnEleId:`iib_hidden_tab_${v}`})}catch(g){console.error(g),G.error("发送图像失败请携带console的错误消息找开发者")}finally{F.value=!1}},B=`${o.key}`;if(B.startsWith("toggle-tag-")){const v=+B.split("toggle-tag-")[1],{is_remove:g}=await Ze({tag_id:v,img_path:r.fullpath}),j=(k=(H=W.conf)==null?void 0:H.all_custom_tags.find(T=>T.id===v))==null?void 0:k.name;await de.refreshTags([r.fullpath]),G.success(L(g?"removedTagFromImage":"addedTagToImage",{tag:j}));return}else if(B.startsWith("batch-add-tag-")||B.startsWith("batch-remove-tag-")){const v=+B.split("-tag-")[1],g=B.includes("add")?"add":"remove",j=l().map(T=>T.fullpath);await Re({tag_id:v,img_paths:j,action:g}),await de.refreshTags(j),G.success(L(g==="add"?"addCompleted":"removeCompleted"));return}switch(o.key){case"previewInNewWindow":return window.open(N);case"saveSelectedAsJson":return lt(l());case"openWithDefaultApp":return at(r.fullpath);case"download":{const v=l();nt(v.map(g=>J(g,!0)));break}case"copyPreviewUrl":return me(parent.document.location.origin+N);case"rename":{let v=await Lt(r.fullpath);v=$e(v);const g=de.tagMap;g.set(v,g.get(r.fullpath)??[]),g.delete(r.fullpath),r.fullpath=v,r.name=v.split(/[\\/]/).pop()??"";return}case"send2txt2img":return d("txt2img");case"send2img2img":return d("img2img");case"send2inpaint":return d("inpaint");case"send2extras":return d("extras");case"send2savedDir":{const v=W.quickMovePaths.find(T=>T.key==="outdir_save");if(!v)return G.error(L("unknownSavedDir"));const g=tt(v.dir,(Y=W.conf)==null?void 0:Y.sd_cwd),j=l();await qe(j.map(T=>T.fullpath),g,!0),ie.emit("removeFiles",{paths:j.map(T=>T.fullpath),loc:M.value}),ie.emit("addFiles",{files:j,loc:g});break}case"send2controlnet-img2img":case"send2controlnet-txt2img":{const v=o.key.split("-")[1];re.postMessage({...q,event:"send_to_control_net",type:v,url:J(r)});break}case"send2outpaint":{a.value=await f.pushAction(()=>pe(r.fullpath)).res;const[v,g]=(a.value||"").split(`
`);re.postMessage({...q,event:"send_to_outpaint",url:J(r),prompt:v,negPrompt:g.slice(17)});break}case"openWithWalkMode":{ve.set(V,x.value);const v=W.tabList[_.value.tabIdx],g={type:"local",key:se(),path:r.fullpath,name:L("local"),stackKey:V,mode:"walk"};v.panes.push(g),v.key=g.key;break}case"openInNewTab":{ve.set(V,x.value);const v=W.tabList[_.value.tabIdx],g={type:"local",key:se(),path:r.fullpath,name:L("local"),stackKey:V};v.panes.push(g),v.key=g.key;break}case"openOnTheRight":{ve.set(V,x.value);let v=W.tabList[_.value.tabIdx+1];v||(v={panes:[],key:"",id:se()},W.tabList[_.value.tabIdx+1]=v);const g={type:"local",key:se(),path:r.fullpath,name:L("local"),stackKey:V};v.panes.push(g),v.key=g.key;break}case"send2BatchDownload":{bt.addFiles(l());break}case"viewGenInfo":{t.value=!0,a.value=await f.pushAction(()=>pe(r.fullpath)).res;break}case"openWithLocalFileBrowser":{await et(r.fullpath);break}case"deleteFiles":{const v=l(),g=async()=>{const j=v.map(T=>T.fullpath);await Et(j),G.success(L("deleteSuccess")),ie.emit("removeFiles",{paths:j,loc:M.value})};if(v.length===1&&W.ignoredConfirmActions.deleteOneOnly)return g();await new Promise(j=>{ae.confirm({title:L("confirmDelete"),maskClosable:!0,width:"60vw",content:()=>i("div",null,[i("ol",{style:{maxHeight:"50vh",overflow:"auto"}},[v.map(T=>i("li",null,[T.fullpath.split(/[/\\]/).pop()]))]),i(Ue,null,null),i(xt,{checked:W.ignoredConfirmActions.deleteOneOnly,"onUpdate:checked":T=>W.ignoredConfirmActions.deleteOneOnly=T},{default:()=>[L("deleteOneOnlySkipConfirm"),$(" ("),L("resetOnGlobalSettingsPage"),$(")")]})]),async onOk(){await g(),j()}})});break}}return{}},{isOutside:u}=Qe(A);return le("keydown",o=>{var I,N,V;const r=$t(o);if(z.value){const q=(I=Object.entries(W.shortcut).find(l=>l[1]===r&&l[1]))==null?void 0:I[0];if(q){o.stopPropagation(),o.preventDefault();const l=s.value,d=n.value[l];switch(q){case"delete":return J(d)===W.fullscreenPreviewInitialUrl?G.warn(L("fullscreenRestriction")):D({key:"deleteFiles"},d,l);case"download":return D({key:"download"},d,l);default:{const B=(N=/^toggle_tag_(.*)$/.exec(q))==null?void 0:N[1],H=(V=W.conf)==null?void 0:V.all_custom_tags.find(k=>k.name===B);return H?D({key:`toggle-tag-${H.id}`},d,l):void 0}}}}else!u.value&&["Ctrl + KeyA","Cmd + KeyA"].includes(r)&&(o.preventDefault(),o.stopPropagation(),P.value.emit("selectAll"))}),{onFileItemClick:w,onContextMenuClick:D,showGenInfo:t,imageGenInfo:a,q:f}}function Zt(e,t,a,n){let s=0,m=0,x=typeof(n==null?void 0:n.width)=="number"?n.width:0,M=typeof(n==null?void 0:n.height)=="number"?n.height:0,F=typeof(n==null?void 0:n.left)=="number"?n.left:0,z=typeof(n==null?void 0:n.top)=="number"?n.top:0,A=!1;const P=u=>{u.stopPropagation(),u.preventDefault(),!(!e.value||!t.value)&&(s=u instanceof MouseEvent?u.clientX:u.touches[0].clientX,m=u instanceof MouseEvent?u.clientY:u.touches[0].clientY,x=e.value.offsetWidth,M=e.value.offsetHeight,t.value.offsetLeft,t.value.offsetTop,document.documentElement.addEventListener("mousemove",_),document.documentElement.addEventListener("touchmove",_),document.documentElement.addEventListener("mouseup",p),document.documentElement.addEventListener("touchend",p))},_=u=>{if(!e.value||!t.value)return;let o=x+((u instanceof MouseEvent?u.clientX:u.touches[0].clientX)-s),r=M+((u instanceof MouseEvent?u.clientY:u.touches[0].clientY)-m);e.value.offsetLeft+o>window.innerWidth&&(o=window.innerWidth-e.value.offsetLeft),e.value.offsetTop+r>window.innerHeight&&(r=window.innerHeight-e.value.offsetTop),e.value.style.width=`${o}px`,e.value.style.height=`${r}px`,n!=null&&n.onResize&&n.onResize(o,r)},p=()=>{document.documentElement.removeEventListener("mousemove",_),document.documentElement.removeEventListener("touchmove",_),document.documentElement.removeEventListener("mouseup",p),document.documentElement.removeEventListener("touchend",p)},c=u=>{u.stopPropagation(),u.preventDefault(),!(!e.value||!a.value)&&(A=!0,F=e.value.offsetLeft,z=e.value.offsetTop,s=u instanceof MouseEvent?u.clientX:u.touches[0].clientX,m=u instanceof MouseEvent?u.clientY:u.touches[0].clientY,document.documentElement.addEventListener("mousemove",f),document.documentElement.addEventListener("touchmove",f),document.documentElement.addEventListener("mouseup",w),document.documentElement.addEventListener("touchend",w))},f=u=>{if(!e.value||!a.value||!A)return;const o=F+((u instanceof MouseEvent?u.clientX:u.touches[0].clientX)-s),r=z+((u instanceof MouseEvent?u.clientY:u.touches[0].clientY)-m);o<0?e.value.style.left="0px":o+e.value.offsetWidth>window.innerWidth?e.value.style.left=`${window.innerWidth-e.value.offsetWidth}px`:e.value.style.left=`${o}px`,r<0?e.value.style.top="0px":r+e.value.offsetHeight>window.innerHeight?e.value.style.top=`${window.innerHeight-e.value.offsetHeight}px`:e.value.style.top=`${r}px`,n!=null&&n.onDrag&&n.onDrag(o,r)},w=()=>{A=!1,document.documentElement.removeEventListener("mousemove",f),document.documentElement.removeEventListener("touchmove",f),document.documentElement.removeEventListener("mouseup",w),document.documentElement.removeEventListener("touchend",w)},D=()=>{if(!e.value||!t.value)return;let u=e.value.offsetLeft,o=e.value.offsetTop,r=e.value.offsetWidth,I=e.value.offsetHeight;u+r>window.innerWidth&&(u=window.innerWidth-r,u<0&&(u=0,r=window.innerWidth)),o+I>window.innerHeight&&(o=window.innerHeight-I,o<0&&(o=0,I=window.innerHeight)),e.value.style.left=`${u}px`,e.value.style.top=`${o}px`,e.value.style.width=`${r}px`,e.value.style.height=`${I}px`};return rt(()=>{!e.value||!n||(typeof n.width=="number"&&(e.value.style.width=`${n.width}px`),typeof n.height=="number"&&(e.value.style.height=`${n.height}px`),typeof n.left=="number"&&(e.value.style.left=`${n.left}px`),typeof n.top=="number"&&(e.value.style.top=`${n.top}px`),D(),window.addEventListener("resize",D))}),We(()=>{document.documentElement.removeEventListener("mousemove",_),document.documentElement.removeEventListener("touchmove",_),document.documentElement.removeEventListener("mouseup",p),document.documentElement.removeEventListener("touchend",p),document.documentElement.removeEventListener("mousemove",f),document.documentElement.removeEventListener("touchmove",f),document.documentElement.removeEventListener("mouseup",w),document.documentElement.removeEventListener("touchend",w),window.removeEventListener("resize",D)}),he(()=>[e.value,t.value,a.value],([u,o,r])=>{u&&o&&(o.addEventListener("mousedown",P),o.addEventListener("touchstart",P)),u&&r&&(r.addEventListener("mousedown",c),r.addEventListener("touchstart",c))}),{handleResizeMouseDown:P,handleDragMouseDown:c}}const ne=e=>(yt("data-v-8da693ad"),e=e(),_t(),e),Rt={class:"container"},en={class:"action-bar"},tn=["title"],nn=["title"],an=["title"],ln=["src"],sn={key:0,class:"icon",style:{cursor:"pointer"}},on={key:0,"flex-placeholder":""},rn={key:1,class:"action-bar"},un={key:0,class:"gen-info"},cn={class:"info-tags"},dn={class:"name"},vn={class:"value"},fn={key:0,class:"tags-container"},pn=["onClick"],mn=ne(()=>C("br",null,null,-1)),gn=ne(()=>C("h3",null,"Prompt",-1)),hn=["innerHTML"],yn=ne(()=>C("br",null,null,-1)),_n=ne(()=>C("h3",null,"Negative Prompt",-1)),wn=["innerHTML"],bn=ne(()=>C("br",null,null,-1)),kn=ne(()=>C("h3",null,"Params",-1)),On={style:{"font-weight":"600","text-transform":"capitalize"}},Ln={key:0},En={key:1},xn=["title"],$n=Be({__name:"fullScreenContextMenu",props:{file:{},idx:{}},emits:["contextMenuClick"],setup(e,{emit:t}){const a=e,n=He(),s=it(),m=Z(),x=R(()=>s.tagMap.get(a.file.fullpath)??[]),M=Z(""),F=ye(),z=Z(""),A=R(()=>z.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")),P=R(()=>A.value.split(`
`)),_=R(()=>Se(A.value)),p=R(()=>{let l=Se(A.value);return delete l.prompt,delete l.negativePrompt,l});function c(l){return`${l}`.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'")}he(()=>{var l;return(l=a==null?void 0:a.file)==null?void 0:l.fullpath},async l=>{l&&(F.tasks.forEach(d=>d.cancel()),F.pushAction(()=>pe(l)).res.then(d=>{z.value=d}))},{immediate:!0});const f=Ce("iib@fullScreenContextMenu.prompt-tab","structedData"),w=Z(),D=Z(),u={left:100,top:100,width:512,height:384,expanded:!0},o=Ce("fullScreenContextMenu.vue-drag",u);o.value&&(o.value.left<0||o.value.top<0)&&(o.value={...u}),Zt(m,w,D,{...o.value,onDrag:Me(function(l,d){o.value={...o.value,left:l,top:d}},300),onResize:Me(function(l,d){o.value={...o.value,width:l,height:d}},300)});function r(l){return l.parentNode}function I(l){if(!l)return"";let d="";const B=l.split(/[\n,]+/).map(k=>k.trim()).filter(k=>k);let H=!1;for(let k=0;k<B.length;k++){const Y=B[k];H||(H=Y.includes("(")),d+=`<span class="${H?"has-parentheses":""}">${Y}</span>`,k<B.length-1&&(d+=","),H&&(H=!Y.includes(")"))}return d}le("load",l=>{const d=l.target;d.className==="ant-image-preview-img"&&(M.value=`${d.naturalWidth} x ${d.naturalHeight}`)},{capture:!0});const N=R(()=>{const l=[{name:L("fileName"),val:a.file.name},{name:L("fileSize"),val:a.file.size}];return M.value&&l.push({name:L("resolution"),val:M.value}),l}),V=()=>{const l="Negative prompt:",d=z.value.includes(l)?z.value.split(l)[0]:P.value[0]??"";me(c(d.trim()))},q=()=>document.body.requestFullscreen();return(l,d)=>{var Ee;const B=St,H=ee,k=ft,Y=pt,v=mt,g=ee,j=gt,T=ht;return O(),S("div",{ref_key:"el",ref:m,class:Pe(["full-screen-menu",{"unset-size":!h(o).expanded}]),onWheelCapture:d[6]||(d[6]=vt(()=>{},["stop"]))},[C("div",Rt,[C("div",en,[C("div",{ref_key:"dragHandle",ref:D,class:"icon",style:{cursor:"grab"},title:h(L)("dragToMovePanel")},[i(h(Tt))],8,tn),C("div",{class:"icon",style:{cursor:"pointer"},onClick:d[0]||(d[0]=E=>h(o).expanded=!h(o).expanded),title:h(L)("clickToToggleMaximizeMinimize")},[h(o).expanded?(O(),oe(h(Wt),{key:0})):(O(),oe(h(Ut),{key:1}))],8,nn),C("div",{style:{display:"flex","flex-direction":"column","align-items":"center",cursor:"grab"},class:"icon",title:h(L)("fullscreenview"),onClick:q},[C("img",{src:h(Qt),style:{width:"21px",height:"21px","padding-bottom":"2px"},alt:""},null,8,ln)],8,an),i(B,{"get-popup-container":r},{overlay:y(()=>[i(kt,{file:l.file,idx:l.idx,"selected-tag":x.value,"disable-delete":h(J)(l.file)===h(n).fullscreenPreviewInitialUrl,onContextMenuClick:d[1]||(d[1]=(E,K,Xe)=>t("contextMenuClick",E,K,Xe))},null,8,["file","idx","selected-tag","disable-delete"])]),default:y(()=>[h(o).expanded?U("",!0):(O(),S("div",sn,[i(h(ut))]))]),_:1}),h(o).expanded?(O(),S("div",on)):U("",!0),h(o).expanded?(O(),S("div",rn,[i(B,{trigger:["hover"],"get-popup-container":r},{overlay:y(()=>[i(v,{onClick:d[2]||(d[2]=E=>t("contextMenuClick",E,l.file,l.idx))},{default:y(()=>{var E;return[((E=h(n).conf)==null?void 0:E.launch_mode)!=="server"?(O(),S(Q,{key:0},[i(k,{key:"send2txt2img"},{default:y(()=>[$(b(l.$t("sendToTxt2img")),1)]),_:1}),i(k,{key:"send2img2img"},{default:y(()=>[$(b(l.$t("sendToImg2img")),1)]),_:1}),i(k,{key:"send2inpaint"},{default:y(()=>[$(b(l.$t("sendToInpaint")),1)]),_:1}),i(k,{key:"send2extras"},{default:y(()=>[$(b(l.$t("sendToExtraFeatures")),1)]),_:1}),i(Y,{key:"sendToThirdPartyExtension",title:l.$t("sendToThirdPartyExtension")},{default:y(()=>[i(k,{key:"send2controlnet-txt2img"},{default:y(()=>[$("ControlNet - "+b(l.$t("t2i")),1)]),_:1}),i(k,{key:"send2controlnet-img2img"},{default:y(()=>[$("ControlNet - "+b(l.$t("i2i")),1)]),_:1}),i(k,{key:"send2outpaint"},{default:y(()=>[$("openOutpaint")]),_:1})]),_:1},8,["title"])],64)):U("",!0),i(k,{key:"send2BatchDownload"},{default:y(()=>[$(b(l.$t("sendToBatchDownload")),1)]),_:1}),i(k,{key:"send2savedDir"},{default:y(()=>[$(b(l.$t("send2savedDir")),1)]),_:1}),i(k,{key:"deleteFiles",disabled:h(J)(l.file)===h(n).fullscreenPreviewInitialUrl},{default:y(()=>[$(b(l.$t("deleteSelected")),1)]),_:1},8,["disabled"]),i(k,{key:"previewInNewWindow"},{default:y(()=>[$(b(l.$t("previewInNewWindow")),1)]),_:1}),i(k,{key:"copyPreviewUrl"},{default:y(()=>[$(b(l.$t("copySourceFilePreviewLink")),1)]),_:1})]}),_:1})]),default:y(()=>[i(H,null,{default:y(()=>[$(b(h(L)("openContextMenu")),1)]),_:1})]),_:1}),i(g,{onClick:d[3]||(d[3]=E=>t("contextMenuClick",{key:"download"},a.file,a.idx))},{default:y(()=>[$(b(l.$t("download")),1)]),_:1}),z.value?(O(),oe(H,{key:0,onClick:d[4]||(d[4]=E=>h(me)(z.value))},{default:y(()=>[$(b(l.$t("copyPrompt")),1)]),_:1})):U("",!0),z.value?(O(),oe(H,{key:1,onClick:V},{default:y(()=>[$(b(l.$t("copyPositivePrompt")),1)]),_:1})):U("",!0)])):U("",!0)]),h(o).expanded?(O(),S("div",un,[C("div",cn,[(O(!0),S(Q,null,ce(N.value,E=>(O(),S("span",{class:"info-tag",key:E.name},[C("span",dn,b(E.name),1),C("span",vn,b(E.val),1)]))),128))]),(Ee=h(n).conf)!=null&&Ee.all_custom_tags?(O(),S("div",fn,[(O(!0),S(Q,null,ce(h(n).conf.all_custom_tags,E=>(O(),S("div",{class:Pe(["tag",{selected:x.value.some(K=>K.id===E.id)}]),onClick:K=>t("contextMenuClick",{key:`toggle-tag-${E.id}`},l.file,l.idx),key:E.id,style:ct({"--tag-color":h(s).getColor(E.name)})},b(E.name),15,pn))),128))])):U("",!0),i(T,{activeKey:h(f),"onUpdate:activeKey":d[5]||(d[5]=E=>dt(f)?f.value=E:null)},{default:y(()=>[i(j,{key:"structedData",tab:l.$t("structuredData")},{default:y(()=>[C("div",null,[_.value.prompt?(O(),S(Q,{key:0},[mn,gn,C("code",{innerHTML:I(_.value.prompt??"")},null,8,hn)],64)):U("",!0),_.value.negativePrompt?(O(),S(Q,{key:1},[yn,_n,C("code",{innerHTML:I(_.value.negativePrompt??"")},null,8,wn)],64)):U("",!0)]),Object.keys(p.value).length?(O(),S(Q,{key:0},[bn,kn,C("table",null,[(O(!0),S(Q,null,ce(p.value,(E,K)=>(O(),S("tr",{key:K,class:"gen-info-frag"},[C("td",On,b(K),1),typeof E=="object"?(O(),S("td",Ln,[C("code",null,b(E),1)])):(O(),S("td",En,b(c(E)),1))]))),128))])],64)):U("",!0)]),_:1},8,["tab"]),i(j,{key:"sourceText",tab:l.$t("sourceText")},{default:y(()=>[C("code",null,b(z.value),1)]),_:1},8,["tab"])]),_:1},8,["activeKey"])])):U("",!0)]),h(o).expanded?(O(),S("div",{key:0,class:"mouse-sensor",ref_key:"resizeHandle",ref:w,title:h(L)("dragToResizePanel")},[i(h(It))],8,xn)):U("",!0)],34)}}});const Vn=Ve($n,[["__scopeId","data-v-8da693ad"]]),Sn={key:0,class:"float-panel"},Cn={key:0,class:"select-actions"},Mn={key:1},Pn=Be({__name:"MultiSelectKeep",props:{show:{type:Boolean}},emits:["selectAll","reverseSelect","clearAllSelected"],setup(e,{emit:t}){const a=He(),n=()=>{t("clearAllSelected"),a.keepMultiSelect=!1},s=()=>{a.keepMultiSelect=!0};return(m,x)=>{const M=ee;return m.show?(O(),S("div",Sn,[h(a).keepMultiSelect?(O(),S("div",Cn,[i(M,{size:"small",onClick:x[0]||(x[0]=F=>t("selectAll"))},{default:y(()=>[$(b(m.$t("select-all")),1)]),_:1}),i(M,{size:"small",onClick:x[1]||(x[1]=F=>t("reverseSelect"))},{default:y(()=>[$(b(m.$t("rerverse-select")),1)]),_:1}),i(M,{size:"small",onClick:x[2]||(x[2]=F=>t("clearAllSelected"))},{default:y(()=>[$(b(m.$t("clear-all-selected")),1)]),_:1}),i(M,{size:"small",onClick:n},{default:y(()=>[$(b(m.$t("exit")),1)]),_:1})])):(O(),S("div",Mn,[i(M,{size:"small",type:"primary",onClick:s},{default:y(()=>[$(b(m.$t("keep-multi-selected")),1)]),_:1})]))])):U("",!0)}}});const Un=Ve(Pn,[["__scopeId","data-v-b04c3508"]]);export{Nn as L,Un as M,jn as R,Bn as a,Hn as b,Wn as c,Vn as f,le as u};