5 lines
61 KiB
JavaScript
5 lines
61 KiB
JavaScript
var Kt=Object.defineProperty;var qt=(e,t,n)=>t in e?Kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Qe=(e,t,n)=>(qt(e,typeof t!="symbol"?t+"":t,n),n);import{P as xe,ce as Yt,a as te,d as pe,bs as It,u as Me,c as b,c7 as Et,_ as Gt,V as ce,a0 as ye,aj as U,bO as rt,a3 as st,bq as Zt,h as ie,cf as Xt,b as en,aA as tn,cg as nn,a2 as lt,bN as an,ch as rn,ci as sn,$ as L,b2 as ln,z as ne,aC as on,a1 as un,ag as we,cj as cn,aT as dn,ck as fn,cl as vn,aO as _t,am as je,bp as Pt,cm as pn,cn as hn,cc as Ae,co as mn,cp as gn,R as ue,ai as D,U as yn,cq as Ye,x as j,cr as bn,cd as wn,cs as An,ct as Ot,cu as K,k as Ge,c1 as xt,ah as Sn,cv as Tt,ar as X,cw as Ze,l as ve,aE as Te,ay as kn,ap as $e,cx as Cn,cy as ot,an as Bt,bU as ut,bT as In,cz as Ie,cA as En,aF as _n,bR as Nt,cB as Pn,cC as On,t as Ve,au as xn,as as Tn,at as ct,al as he,cD as dt,cb as Bn,L as le,cE as Nn,J as Mn,c5 as ft,cF as zn,c4 as Qn,cG as $n,cH as Fn,cI as Dn,av as Ln,aw as Rn,az as Mt,o as Q,m as q,cJ as jn,cK as Vn,cL as Un,cM as Hn,cN as Jn,a5 as Wn,y as J,cO as Se,C as ee,n as z,A as Xe,cP as vt,bI as Kn,cQ as qn,B as Yn,N as Be,v as R,r as Z,W as Gn,cR as Zn,c8 as Xn,M as ei,cS as ti,cT as ni,p as oe,ae as ii,cU as ai,X as ri}from"./index-872ef657.js";import{t as Fe,l as de,g as si}from"./shortcut-34e39412.js";var zt=function(){return{arrow:{type:[Boolean,Object],default:void 0},trigger:{type:[Array,String]},overlay:xe.any,visible:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},align:{type:Object},getPopupContainer:Function,prefixCls:String,transitionName:String,placement:String,overlayClassName:String,overlayStyle:{type:Object,default:void 0},forceRender:{type:Boolean,default:void 0},mouseEnterDelay:Number,mouseLeaveDelay:Number,openClassName:String,minOverlayWidthMatchTrigger:{type:Boolean,default:void 0},destroyPopupOnHide:{type:Boolean,default:void 0},onVisibleChange:{type:Function},"onUpdate:visible":{type:Function}}},De=Yt(),li=function(){return te(te({},zt()),{},{type:De.type,size:String,htmlType:De.htmlType,href:String,disabled:{type:Boolean,default:void 0},prefixCls:String,icon:xe.any,title:String,loading:De.loading,onClick:{type:Function}})},oi=["type","disabled","loading","htmlType","class","overlay","trigger","align","visible","onVisibleChange","placement","href","title","icon","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","onClick","onUpdate:visible"],ui=ce.Group;const Ne=pe({compatConfig:{MODE:3},name:"ADropdownButton",inheritAttrs:!1,__ANT_BUTTON:!0,props:It(li(),{trigger:"hover",placement:"bottomRight",type:"default"}),slots:["icon","leftButton","rightButton","overlay"],setup:function(t,n){var i=n.slots,a=n.attrs,o=n.emit,p=function(m){o("update:visible",m),o("visibleChange",m)},l=Me("dropdown-button",t),d=l.prefixCls,v=l.direction,E=l.getPopupContainer;return function(){var g,m,f=te(te({},t),a),r=f.type,s=r===void 0?"default":r,u=f.disabled,y=f.loading,S=f.htmlType,h=f.class,c=h===void 0?"":h,C=f.overlay,A=C===void 0?(g=i.overlay)===null||g===void 0?void 0:g.call(i):C,P=f.trigger,_=f.align,T=f.visible;f.onVisibleChange;var I=f.placement,$=I===void 0?v.value==="rtl"?"bottomLeft":"bottomRight":I,B=f.href,k=f.title,x=f.icon,H=x===void 0?((m=i.icon)===null||m===void 0?void 0:m.call(i))||b(Et,null,null):x,F=f.mouseEnterDelay,w=f.mouseLeaveDelay,O=f.overlayClassName,M=f.overlayStyle,Y=f.destroyPopupOnHide,V=f.onClick;f["onUpdate:visible"];var G=Gt(f,oi),W={align:_,disabled:u,trigger:u?[]:P,placement:$,getPopupContainer:E.value,onVisibleChange:p,mouseEnterDelay:F,mouseLeaveDelay:w,visible:T,overlayClassName:O,overlayStyle:M,destroyPopupOnHide:Y},re=b(ce,{type:s,disabled:u,loading:y,onClick:V,htmlType:S,href:B,title:k},{default:i.default}),se=b(ce,{type:s,icon:H},null);return b(ui,te(te({},G),{},{class:ye(d.value,c)}),{default:function(){return[i.leftButton?i.leftButton({button:re}):re,b(fe,W,{default:function(){return[i.rightButton?i.rightButton({button:se}):se]},overlay:function(){return A}})]}})}}});var Qt=pe({compatConfig:{MODE:3},name:"ADropdown",inheritAttrs:!1,props:It(zt(),{mouseEnterDelay:.15,mouseLeaveDelay:.1,placement:"bottomLeft",trigger:"hover"}),slots:["overlay"],setup:function(t,n){var i=n.slots,a=n.attrs,o=n.emit,p=Me("dropdown",t),l=p.prefixCls,d=p.rootPrefixCls,v=p.direction,E=p.getPopupContainer,g=U(function(){var s=t.placement,u=s===void 0?"":s,y=t.transitionName;return y!==void 0?y:u.indexOf("top")>=0?"".concat(d.value,"-slide-down"):"".concat(d.value,"-slide-up")}),m=function(){var u,y,S,h=t.overlay||((u=i.overlay)===null||u===void 0?void 0:u.call(i)),c=Array.isArray(h)?h[0]:h;if(!c)return null;var C=c.props||{};rt(!C.mode||C.mode==="vertical","Dropdown",'mode="'.concat(C.mode,`" is not supported for Dropdown's Menu.`));var A=C.selectable,P=A===void 0?!1:A,_=C.expandIcon,T=_===void 0?(y=c.children)===null||y===void 0||(S=y.expandIcon)===null||S===void 0?void 0:S.call(y):_,I=typeof T<"u"&<(T)?T:b("span",{class:"".concat(l.value,"-menu-submenu-arrow")},[b(an,{class:"".concat(l.value,"-menu-submenu-arrow-icon")},null)]),$=lt(c)?st(c,{mode:"vertical",selectable:P,expandIcon:function(){return I}}):c;return $},f=U(function(){var s=t.placement;if(!s)return v.value==="rtl"?"bottomRight":"bottomLeft";if(s.includes("Center")){var u=s.slice(0,s.indexOf("Center"));return rt(!s.includes("Center"),"Dropdown","You are using '".concat(s,"' placement in Dropdown, which is deprecated. Try to use '").concat(u,"' instead.")),u}return s}),r=function(u){o("update:visible",u),o("visibleChange",u)};return function(){var s,u,y=t.arrow,S=t.trigger,h=t.disabled,c=t.overlayClassName,C=(s=i.default)===null||s===void 0?void 0:s.call(i)[0],A=st(C,Zt({class:ye(C==null||(u=C.props)===null||u===void 0?void 0:u.class,ie({},"".concat(l.value,"-rtl"),v.value==="rtl"),"".concat(l.value,"-trigger"))},h?{disabled:h}:{})),P=ye(c,ie({},"".concat(l.value,"-rtl"),v.value==="rtl")),_=h?[]:S,T;_&&_.indexOf("contextmenu")!==-1&&(T=!0);var I=Xt({arrowPointAtCenter:en(y)==="object"&&y.pointAtCenter,autoAdjustOverflow:!0}),$=tn(te(te(te({},t),a),{},{builtinPlacements:I,overlayClassName:P,arrow:y,alignPoint:T,prefixCls:l.value,getPopupContainer:E.value,transitionName:g.value,trigger:_,onVisibleChange:r,placement:f.value}),["overlay","onUpdate:visible"]);return b(nn,$,{default:function(){return[A]},overlay:m})}}});Qt.Button=Ne;const fe=Qt;var ci=function(){return{prefixCls:String,checked:{type:Boolean,default:void 0},onChange:{type:Function},onClick:{type:Function},"onUpdate:checked":Function}},di=pe({compatConfig:{MODE:3},name:"ACheckableTag",props:ci(),setup:function(t,n){var i=n.slots,a=n.emit,o=Me("tag",t),p=o.prefixCls,l=function(E){var g=t.checked;a("update:checked",!g),a("change",!g),a("click",E)},d=U(function(){var v;return ye(p.value,(v={},ie(v,"".concat(p.value,"-checkable"),!0),ie(v,"".concat(p.value,"-checkable-checked"),t.checked),v))});return function(){var v;return b("span",{class:d.value,onClick:l},[(v=i.default)===null||v===void 0?void 0:v.call(i)])}}});const Ue=di;var fi=new RegExp("^(".concat(rn.join("|"),")(-inverse)?$")),vi=new RegExp("^(".concat(sn.join("|"),")$")),pi=function(){return{prefixCls:String,color:{type:String},closable:{type:Boolean,default:!1},closeIcon:xe.any,visible:{type:Boolean,default:void 0},onClose:{type:Function},"onUpdate:visible":Function,icon:xe.any}},ge=pe({compatConfig:{MODE:3},name:"ATag",props:pi(),slots:["closeIcon","icon"],setup:function(t,n){var i=n.slots,a=n.emit,o=n.attrs,p=Me("tag",t),l=p.prefixCls,d=p.direction,v=L(!0);ln(function(){t.visible!==void 0&&(v.value=t.visible)});var E=function(r){r.stopPropagation(),a("update:visible",!1),a("close",r),!r.defaultPrevented&&t.visible===void 0&&(v.value=!1)},g=U(function(){var f=t.color;return f?fi.test(f)||vi.test(f):!1}),m=U(function(){var f;return ye(l.value,(f={},ie(f,"".concat(l.value,"-").concat(t.color),g.value),ie(f,"".concat(l.value,"-has-color"),t.color&&!g.value),ie(f,"".concat(l.value,"-hidden"),!v.value),ie(f,"".concat(l.value,"-rtl"),d.value==="rtl"),f))});return function(){var f,r,s,u=t.icon,y=u===void 0?(f=i.icon)===null||f===void 0?void 0:f.call(i):u,S=t.color,h=t.closeIcon,c=h===void 0?(r=i.closeIcon)===null||r===void 0?void 0:r.call(i):h,C=t.closable,A=C===void 0?!1:C,P=function(){return A?c?b("span",{class:"".concat(l.value,"-close-icon"),onClick:E},[c]):b(un,{class:"".concat(l.value,"-close-icon"),onClick:E},null):null},_={backgroundColor:S&&!g.value?S:void 0},T=y||null,I=(s=i.default)===null||s===void 0?void 0:s.call(i),$=T?b(ne,null,[T,b("span",null,[I])]):I,B="onClick"in o,k=b("span",{class:m.value,style:_},[$,P()]);return B?b(on,null,{default:function(){return[k]}}):k}}});ge.CheckableTag=Ue;ge.install=function(e){return e.component(ge.name,ge),e.component(Ue.name,Ue),e};const hi=ge;fe.Button=Ne;fe.install=function(e){return e.component(fe.name,fe),e.component(Ne.name,Ne),e};var mi={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 gi=mi;function pt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?Object(arguments[t]):{},i=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),i.forEach(function(a){yi(e,a,n[a])})}return e}function yi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var et=function(t,n){var i=pt({},t,n.attrs);return b(we,pt({},i,{icon:gi}),null)};et.displayName="StarFilled";et.inheritAttrs=!1;const bi=et;var wi={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"};const Ai=wi;function ht(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?Object(arguments[t]):{},i=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),i.forEach(function(a){Si(e,a,n[a])})}return e}function Si(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tt=function(t,n){var i=ht({},t,n.attrs);return b(we,ht({},i,{icon:Ai}),null)};tt.displayName="FileOutlined";tt.inheritAttrs=!1;const ki=tt;var Ci={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"};const Ii=Ci;function mt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?Object(arguments[t]):{},i=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),i.forEach(function(a){Ei(e,a,n[a])})}return e}function Ei(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var nt=function(t,n){var i=mt({},t,n.attrs);return b(we,mt({},i,{icon:Ii}),null)};nt.displayName="FolderOpenOutlined";nt.inheritAttrs=!1;const _i=nt;function Pi(e,t,n){if(!cn(n))return!1;var i=typeof t;return(i=="number"?dn(n)&&fn(t,n.length):i=="string"&&t in n)?vn(n[t],e):!1}function Oi(e){return e&&e.length?e[0]:void 0}var xi=Math.ceil,Ti=Math.max;function Bi(e,t,n,i){for(var a=-1,o=Ti(xi((t-e)/(n||1)),0),p=Array(o);o--;)p[i?o:++a]=e,e+=n;return p}function Ni(e){return function(t,n,i){return i&&typeof i!="number"&&Pi(t,n,i)&&(n=i=void 0),t=Fe(t),n===void 0?(n=t,t=0):n=Fe(n),i=i===void 0?t<n?1:-1:Fe(i),Bi(t,n,i,e)}}var Mi=Ni();const $t=Mi,be=(...e)=>{document.addEventListener(...e),_t(()=>document.removeEventListener(...e))},zi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==",ke=new WeakMap;function Qi(e,t){return{useHookShareState:i=>{const a=hn();je(a),ke.has(a)||(ke.set(a,Pt(e(a,i??(t==null?void 0:t())))),_t(()=>{ke.delete(a)}));const o=ke.get(a);return je(o),{state:o,toRefs(){return pn(o)}}}}}var $i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"};const Fi=$i;function gt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?Object(arguments[t]):{},i=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),i.forEach(function(a){Di(e,a,n[a])})}return e}function Di(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var it=function(t,n){var i=gt({},t,n.attrs);return b(we,gt({},i,{icon:Fi}),null)};it.displayName="DatabaseOutlined";it.inheritAttrs=!1;const Li=it;var Ri={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.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z"}}]},name:"star",theme:"outlined"};const ji=Ri;function yt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?Object(arguments[t]):{},i=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),i.forEach(function(a){Vi(e,a,n[a])})}return e}function Vi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var at=function(t,n){var i=yt({},t,n.attrs);return b(we,yt({},i,{icon:ji}),null)};at.displayName="StarOutlined";at.inheritAttrs=!1;const Ui=at;const me=async e=>(await Ae.value.get("/files",{params:{folder_path:e}})).data,Hi=async e=>(await Ae.value.post("/delete_files",{file_paths:e})).data,Ft=async(e,t,n)=>(await Ae.value.post("/move_files",{file_paths:e,dest:t,create_dest_folder:n})).data,Ji=async(e,t,n)=>(await Ae.value.post("/copy_files",{file_paths:e,dest:t,create_dest_folder:n})).data,Wi=async e=>{await Ae.value.post("/mkdirs",{dest_folder:e})};var Dt={exports:{}};/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
|
||
* @license MIT */(function(e,t){(function(n,i){e.exports=i})(mn,function(){var n={};n.version="0.3.5";var i=n.settings={minimum:.08,easing:"linear",positionUsing:"",speed:200,trickle:!0,trickleSpeed:200,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};n.configure=function(r){var s,u;for(s in r)u=r[s],u!==void 0&&r.hasOwnProperty(s)&&(i[s]=u);return this},n.status=null,n.set=function(r){var s=n.isStarted();r=a(r,i.minimum,1),n.status=r===1?null:r;var u=n.render(!s),y=u.querySelector(i.barSelector),S=i.speed,h=i.easing;return u.offsetWidth,l(function(c){i.positionUsing===""&&(i.positionUsing=n.getPositioningCSS()),d(y,p(r,S,h)),r===1?(d(u,{transition:"none",opacity:1}),u.offsetWidth,setTimeout(function(){d(u,{transition:"all "+S+"ms linear",opacity:0}),setTimeout(function(){n.remove(),c()},S)},S)):setTimeout(c,S)}),this},n.isStarted=function(){return typeof n.status=="number"},n.start=function(){n.status||n.set(0);var r=function(){setTimeout(function(){n.status&&(n.trickle(),r())},i.trickleSpeed)};return i.trickle&&r(),this},n.done=function(r){return!r&&!n.status?this:n.inc(.3+.5*Math.random()).set(1)},n.inc=function(r){var s=n.status;return s?s>1?void 0:(typeof r!="number"&&(s>=0&&s<.2?r=.1:s>=.2&&s<.5?r=.04:s>=.5&&s<.8?r=.02:s>=.8&&s<.99?r=.005:r=0),s=a(s+r,0,.994),n.set(s)):n.start()},n.trickle=function(){return n.inc()},function(){var r=0,s=0;n.promise=function(u){return!u||u.state()==="resolved"?this:(s===0&&n.start(),r++,s++,u.always(function(){s--,s===0?(r=0,n.done()):n.set((r-s)/r)}),this)}}(),n.getElement=function(){var r=n.getParent();if(r){var s=Array.prototype.slice.call(r.querySelectorAll(".nprogress")).filter(function(u){return u.parentElement===r});if(s.length>0)return s[0]}return null},n.getParent=function(){if(i.parent instanceof HTMLElement)return i.parent;if(typeof i.parent=="string")return document.querySelector(i.parent)},n.render=function(r){if(n.isRendered())return n.getElement();E(document.documentElement,"nprogress-busy");var s=document.createElement("div");s.id="nprogress",s.className="nprogress",s.innerHTML=i.template;var u=s.querySelector(i.barSelector),y=r?"-100":o(n.status||0),S=n.getParent(),h;return d(u,{transition:"all 0 linear",transform:"translate3d("+y+"%,0,0)"}),i.showSpinner||(h=s.querySelector(i.spinnerSelector),h&&f(h)),S!=document.body&&E(S,"nprogress-custom-parent"),S.appendChild(s),s},n.remove=function(){n.status=null,g(document.documentElement,"nprogress-busy"),g(n.getParent(),"nprogress-custom-parent");var r=n.getElement();r&&f(r)},n.isRendered=function(){return!!n.getElement()},n.getPositioningCSS=function(){var r=document.body.style,s="WebkitTransform"in r?"Webkit":"MozTransform"in r?"Moz":"msTransform"in r?"ms":"OTransform"in r?"O":"";return s+"Perspective"in r?"translate3d":s+"Transform"in r?"translate":"margin"};function a(r,s,u){return r<s?s:r>u?u:r}function o(r){return(-1+r)*100}function p(r,s,u){var y;return i.positionUsing==="translate3d"?y={transform:"translate3d("+o(r)+"%,0,0)"}:i.positionUsing==="translate"?y={transform:"translate("+o(r)+"%,0)"}:y={"margin-left":o(r)+"%"},y.transition="all "+s+"ms "+u,y}var l=function(){var r=[];function s(){var u=r.shift();u&&u(s)}return function(u){r.push(u),r.length==1&&s()}}(),d=function(){var r=["Webkit","O","Moz","ms"],s={};function u(c){return c.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(C,A){return A.toUpperCase()})}function y(c){var C=document.body.style;if(c in C)return c;for(var A=r.length,P=c.charAt(0).toUpperCase()+c.slice(1),_;A--;)if(_=r[A]+P,_ in C)return _;return c}function S(c){return c=u(c),s[c]||(s[c]=y(c))}function h(c,C,A){C=S(C),c.style[C]=A}return function(c,C){var A=arguments,P,_;if(A.length==2)for(P in C)_=C[P],_!==void 0&&C.hasOwnProperty(P)&&h(c,P,_);else h(c,A[1],A[2])}}();function v(r,s){var u=typeof r=="string"?r:m(r);return u.indexOf(" "+s+" ")>=0}function E(r,s){var u=m(r),y=u+s;v(u,s)||(r.className=y.substring(1))}function g(r,s){var u=m(r),y;v(r,s)&&(y=u.replace(" "+s+" "," "),r.className=y.substring(1,y.length-1))}function m(r){return(" "+(r&&r.className||"")+" ").replace(/\s+/gi," ")}function f(r){r&&r.parentNode&&r.parentNode.removeChild(r)}return n})})(Dt);var Ki=Dt.exports;const qi=gn(Ki),Yi=e=>{const t=L("");return new Promise(n=>{ue.confirm({title:D("inputFolderName"),content:()=>b(yn,{value:t.value,"onUpdate:value":i=>t.value=i},null),async onOk(){if(!t.value)return;const i=Ye(e,t.value);await Wi(i),n()}})})},Lt=()=>b("p",{style:{background:"var(--zp-secondary-background)",padding:"8px",borderLeft:"4px solid var(--primary-color)"}},[j("Tips: "),D("multiSelectTips")]),Gi=bn("useBatchDownloadStore",()=>{const e=L([]);return{selectdFiles:e,addFiles:n=>{e.value=wn([...e.value,...n])}}});class bt{constructor(t,n=An.CREATED_TIME_DESC){Qe(this,"root");Qe(this,"execQueue",[]);this.sortMethod=n,this.root={children:[],info:{name:t,size:"-",bytes:0,created_time:"",is_under_scanned_path:!0,date:"",type:"dir",fullpath:t}},this.fetchChildren(this.root)}reset(){return this.root.children=[],this.fetchChildren(this.root)}get images(){const t=n=>n.children.map(i=>{if(i.info.type==="dir")return t(i);if(K(i.info.name))return i.info}).filter(i=>i).flat(1);return t(this.root)}get isCompleted(){return this.execQueue.length===0}async fetchChildren(t){const{files:n}=await me(t.info.fullpath);return t.children=Ot(n,this.sortMethod).map(i=>({info:i,children:[]})),this.execQueue.shift(),this.execQueue.unshift(...t.children.filter(i=>i.info.type==="dir").map(i=>({fn:()=>this.fetchChildren(i),...i}))),t}async next(){const t=Oi(this.execQueue);if(!t)return null;const n=await t.fn();return this.execQueue=this.execQueue.slice(),this.root={...this.root},n}}function Le(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Qn(e)}const Ee=new Map,N=Ge(),Zi=Gi(),Rt=xt(),wt=Sn(),Ce=new BroadcastChannel("iib-image-transfer-bus"),{eventEmitter:_e,useEventListen:He}=Tt(),{useHookShareState:ae}=Qi((e,{images:t})=>{const n=L({tabIdx:-1,paneIdx:-1}),i=U(()=>de(a.value)),a=L([]),o=U(()=>{var S;return a.value.map(h=>h.curr).slice((S=N.conf)!=null&&S.is_win?1:0)}),p=U(()=>Ye(...o.value)),l=L(N.defaultSortingMethod),d=L(n.value.walkModePath?new bt(n.value.walkModePath,l.value):void 0);ve([()=>n.value.walkModePath,l],()=>{d.value=n.value.walkModePath?new bt(n.value.walkModePath,l.value):void 0});const v=Pt(new Set);ve(i,()=>v.clear());const E=U(()=>{var C;if(t.value)return t.value;if(d.value)return d.value.images.filter(A=>!v.has(A.fullpath));if(!i.value)return[];const S=((C=i.value)==null?void 0:C.files)??[],h=l.value;return Ot((A=>N.onlyFoldersAndImages?A.filter(P=>P.type==="dir"||K(P.name)):A)(S),h).filter(A=>!v.has(A.fullpath))}),g=L([]),m=L(-1),f=U(()=>d.value?!d.value.isCompleted:!1),r=L(!1),s=L(!1),u=()=>{var S,h,c;return(c=(h=(S=N.tabList)==null?void 0:S[n.value.tabIdx])==null?void 0:h.panes)==null?void 0:c[n.value.paneIdx]},y=Tt();return y.useEventListen("selectAll",()=>{console.log(`select all 0 -> ${E.value.length}`),g.value=$t(0,E.value.length)}),{previewing:s,spinning:r,canLoadNext:f,multiSelectedIdxs:g,previewIdx:m,basePath:o,currLocation:p,currPage:i,stack:a,sortMethod:l,sortedFiles:E,scroller:L(),stackViewEl:L(),props:n,getPane:u,walker:d,deletedFiles:v,...y}},()=>({images:L()}));function $a(){const{previewIdx:e,eventEmitter:t,canLoadNext:n,previewing:i,sortedFiles:a,scroller:o,props:p}=ae().toRefs(),{state:l}=ae();let d=null;const v=(f,r)=>{var s;i.value=f,d!=null&&!f&&r&&((s=o.value)==null||s.scrollToItem(d),d=null)},E=()=>{p.value.walkModePath&&!m("next")&&n&&(X.info(D("loadingNextFolder")),t.value.emit("loadNextDir",!0))};be("keydown",f=>{var r;if(i.value){let s=e.value;if(["ArrowDown","ArrowRight"].includes(f.key))for(s++;a.value[s]&&!K(a.value[s].name);)s++;else if(["ArrowUp","ArrowLeft"].includes(f.key))for(s--;a.value[s]&&!K(a.value[s].name);)s--;if(K((r=a.value[s])==null?void 0:r.name)??""){e.value=s;const u=o.value;u&&!(s>=u.$_startIndex&&s<=u.$_endIndex)&&(d=s)}E()}});const g=f=>{var s;let r=e.value;if(f==="next")for(r++;a.value[r]&&!K(a.value[r].name);)r++;else if(f==="prev")for(r--;a.value[r]&&!K(a.value[r].name);)r--;if(K((s=a.value[r])==null?void 0:s.name)??""){e.value=r;const u=o.value;u&&!(r>=u.$_startIndex&&r<=u.$_endIndex)&&(d=r)}E()},m=f=>{var s;let r=e.value;if(f==="next")for(r++;a.value[r]&&!K(a.value[r].name);)r++;else if(f==="prev")for(r--;a.value[r]&&!K(a.value[r].name);)r--;return K((s=a.value[r])==null?void 0:s.name)??""};return He("removeFiles",async()=>{var f;i.value&&!l.sortedFiles[e.value]&&(X.info(D("manualExitFullScreen"),5),await Ze(500),(f=document.querySelector(".ant-image-preview-operations-operation .anticon-close"))==null||f.click(),e.value=-1)}),{previewIdx:e,onPreviewVisibleChange:v,previewing:i,previewImgMove:g,canPreview:m}}function Fa(){const e=L(),{scroller:t,stackViewEl:n,stack:i,currPage:a,currLocation:o,useEventListen:p,eventEmitter:l,getPane:d,props:v,deletedFiles:E,walker:g,sortedFiles:m}=ae().toRefs();ve(()=>i.value.length,Te((w,O)=>{var M;w!==O&&((M=t.value)==null||M.scrollToItem(0))},300));const f=async w=>{var O;await S(w),v.value.walkModePath&&(await Ze(),await((O=g.value)==null?void 0:O.reset()),l.value.emit("loadNextDir"))};kn(async()=>{var w;if(!i.value.length){const O=await me("/");i.value.push({files:O.files,curr:"/"})}e.value=new qi,e.value.configure({parent:n.value}),v.value.path&&v.value.path!=="/"?await f(v.value.walkModePath??v.value.path):(w=N.conf)!=null&&w.home&&S(N.conf.home)}),ve(o,Te(w=>{const O=d.value();if(!O)return;O.path=w;const M=O.path.split("/").pop(),V=(()=>{var G;if(!v.value.walkModePath){const W=Ie(w);for(const[re,se]of Object.entries(N.pathAliasMap))if(W.startsWith(se))return W.replace(se,re);return M}return"Walk: "+(((G=N.quickMovePaths.find(W=>W.dir===O.walkModePath))==null?void 0:G.zh)??M)})();O.name=$e("div",{style:"display:flex;align-items:center"},[$e(Li),$e("span",{class:"line-clamp-1",style:"max-width: 256px"},V)]),O.nameFallbackStr=V,N.recent=N.recent.filter(G=>G.key!==O.key),N.recent.unshift({path:w,key:O.key}),N.recent.length>20&&(N.recent=N.recent.slice(0,20))},300));const r=()=>Ve(o.value),s=async w=>{var O,M;if(w.type==="dir")try{(O=e.value)==null||O.start();const{files:Y}=await me(w.fullpath);i.value.push({files:Y,curr:w.name})}finally{(M=e.value)==null||M.done()}},u=w=>{for(;w<i.value.length-1;)i.value.pop()},y=(w,O)=>(je(N.conf,"global.conf load failed"),N.conf.is_win?w.toLowerCase()==O.toLowerCase():w==O),S=async w=>{var M,Y;const O=i.value.slice();try{Cn(w)||(w=Ye(((M=N.conf)==null?void 0:M.sd_cwd)??"/",w));const V=ot(w),G=i.value.map(W=>W.curr);for(G.shift();G[0]&&V[0]&&y(G[0],V[0]);)G.shift(),V.shift();for(let W=0;W<G.length;W++)i.value.pop();if(!V.length)return h();for(const W of V){const re=(Y=a.value)==null?void 0:Y.files.find(se=>y(se.name,W));if(!re)throw console.error({frags:V,frag:W,stack:Bt(i.value)}),new Error(`${W} not found`);await s(re)}}catch(V){throw X.error(D("moveFailedCheckPath")+(V instanceof Error?V.message:"")),console.error(w,ot(w),a.value),i.value=O,V}},h=ut(async()=>{var w,O,M;try{if((w=e.value)==null||w.start(),g.value)await g.value.reset(),l.value.emit("loadNextDir");else{const{files:Y}=await me(i.value.length===1?"/":o.value);de(i.value).files=Y}E.value.clear(),(O=t.value)==null||O.scrollToItem(0),X.success(D("refreshCompleted"))}finally{(M=e.value)==null||M.done()}});In("returnToIIB",ut(async()=>{var w,O;if(!v.value.walkModePath)try{(w=e.value)==null||w.start();const{files:M}=await me(i.value.length===1?"/":o.value);de(i.value).files.map(V=>V.date).join()!==M.map(V=>V.date).join()&&(de(i.value).files=M,X.success(D("autoUpdate")))}finally{(O=e.value)==null||O.done()}})),p.value("refresh",h);const c=w=>{v.value.walkModePath&&(d.value().walkModePath=w),f(w)},C=U(()=>N.quickMovePaths.map(w=>({...w,path:Ie(w.dir)}))),A=U(()=>{const w=Ie(o.value);return C.value.find(M=>M.path===w)}),P=async()=>{const w=A.value;if(w){if(!w.can_delete)return;await xn(o.value),X.success(D("removeCompleted"))}else await Tn(o.value),X.success(D("addCompleted"));ct.emit("searchIndexExpired"),ct.emit("updateGlobalSetting")},_=L(!1),T=L(o.value),I=()=>{_.value=!0,T.value=o.value},$=async()=>{await S(T.value),_.value=!1};be("click",()=>{_.value=!1});const B=()=>{const w=parent.location,O=w.href.substring(0,w.href.length-w.search.length),M=new URLSearchParams(w.search);M.set("action","open"),g.value&&M.set("walk","1"),M.set("path",o.value);const Y=`${O}?${M.toString()}`;Ve(Y,D("copyLocationUrlSuccessMsg"))},k=()=>l.value.emit("selectAll"),x=async()=>{await Yi(o.value),await h()},H=()=>{const w=o.value;Ee.set(w,i.value);const O=N.tabList[v.value.tabIdx],M={type:"local",key:he(),path:w,name:D("local"),stackKey:w,walkModePath:w};O.panes.push(M),O.key=M.key},F=U(()=>!g.value&&m.value.some(w=>w.type==="dir"));return{locInputValue:T,isLocationEditing:_,onLocEditEnter:$,onEditBtnClick:I,addToSearchScanPathAndQuickMove:P,searchPathInfo:A,refresh:h,copyLocation:r,back:u,openNext:s,currPage:a,currLocation:o,to:S,stack:i,scroller:t,share:B,selectAll:k,quickMoveTo:c,onCreateFloderBtnClick:x,onWalkBtnClick:H,showWalkButton:F}}function Da(){const{scroller:e,sortedFiles:t,sortMethod:n,currLocation:i,stackViewEl:a,canLoadNext:o,previewIdx:p,props:l,walker:d}=ae().toRefs(),{state:v}=ae(),E=L(!1),g=L(N.defaultGridCellWidth),m=U(()=>g.value+16),f=44,{width:r}=En(a),s=U(()=>~~(r.value/m.value)),u=U(()=>{const A=m.value;return{first:A+(g.value<=160?0:f),second:A}}),y=L(!1),S=async()=>{var A;if(!(y.value||!l.value.walkModePath||!o.value))try{y.value=!0,await((A=d.value)==null?void 0:A.next())}finally{y.value=!1}},h=async(A=!1)=>{const P=e.value,_=()=>A?p.value:(P==null?void 0:P.$_endIndex)??0;for(;!t.value.length||_()>t.value.length-20&&o.value;)await Ze(30),await S()};v.useEventListen("loadNextDir",h);const c=()=>{const A=e.value;if(A){const P=t.value.slice(Math.max(A.$_startIndex-10,0),A.$_endIndex+10).filter(_=>_.is_under_scanned_path&&K(_.name)).map(_=>_.fullpath);Rt.fetchImageTags(P)}};ve(i,Te(c,150));const C=Te(()=>{h(),c()},300);return{gridItems:s,sortedFiles:t,sortMethodConv:_n,moreActionsDropdownShow:E,gridSize:m,sortMethod:n,onScroll:C,loadNextDir:S,loadNextDirLoading:y,canLoadNext:o,itemSize:u,cellWidth:g,onViewedImagesChange:c}}function La(){const{currLocation:e,sortedFiles:t,currPage:n,multiSelectedIdxs:i,eventEmitter:a,walker:o}=ae().toRefs(),p=()=>{i.value=[]};return be("click",p),be("blur",p),ve(n,p),{onFileDragStart:(E,g)=>{const m=Bt(t.value[g]);wt.fileDragging=!0,console.log("onFileDragStart set drag file ",E,g,m);const f=[m];let r=m.type==="dir";if(i.value.includes(g)){const u=i.value.map(y=>t.value[y]);f.push(...u),r=u.some(y=>y.type==="dir")}const s={includeDir:r,loc:e.value||"search-result",path:dt(f,"fullpath").map(u=>u.fullpath),nodes:dt(f,"fullpath"),__id:"FileTransferData"};E.dataTransfer.setData("text/plain",JSON.stringify(s))},onDrop:async E=>{if(o.value)return;const g=Bn(E);if(!g)return;const m=e.value;if(g.loc===m)return;const f=Nt(),r=async()=>f.pushAction(async()=>{await Ji(g.path,m),a.value.emit("refresh"),ue.destroyAll()}),s=()=>f.pushAction(async()=>{await Ft(g.path,m),_e.emit("removeFiles",{paths:g.path,loc:g.loc}),a.value.emit("refresh"),ue.destroyAll()});ue.confirm({title:D("confirm")+"?",width:"60vw",content:()=>{let u,y,S;return b("div",null,[b("div",null,[`${D("moveSelectedFilesTo")} ${m}`,b("ol",{style:{maxHeight:"50vh",overflow:"auto"}},[g.path.map(h=>b("li",null,[h.split(/[/\\]/).pop()]))])]),b(Lt,null,null),b("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end"},class:"actions"},[b(ce,{onClick:ue.destroyAll},Le(u=D("cancel"))?u:{default:()=>[u]}),b(ce,{type:"primary",loading:!f.isIdle,onClick:r},Le(y=D("copy"))?y:{default:()=>[y]}),b(ce,{type:"primary",loading:!f.isIdle,onClick:s},Le(S=D("move"))?S:{default:()=>[S]})])])},maskClosable:!0,wrapClassName:"hidden-antd-btns-modal"})},multiSelectedIdxs:i,onFileDragEnd:()=>{wt.fileDragging=!1}}}function Ra({openNext:e}){const t=L(!1),n=L(""),{sortedFiles:i,previewIdx:a,multiSelectedIdxs:o,stack:p,currLocation:l,spinning:d,previewing:v,stackViewEl:E,eventEmitter:g,props:m,deletedFiles:f}=ae().toRefs(),r=Ie;He("removeFiles",({paths:h,loc:c})=>{r(c)!==r(l.value)||!de(p.value)||(h.forEach(A=>f.value.add(A)),h.filter(K).forEach(A=>f.value.add(A.replace(/\.\w+$/,".txt"))))}),He("addFiles",({files:h,loc:c})=>{if(r(c)!==r(l.value))return;const C=de(p.value);C&&C.files.unshift(...h)});const s=Nt(),u=async(h,c,C)=>{a.value=C,N.fullscreenPreviewInitialUrl=le(c);const A=o.value.indexOf(C);if(h.shiftKey){if(A!==-1)o.value.splice(A,1);else{o.value.push(C),o.value.sort((T,I)=>T-I);const P=o.value[0],_=o.value[o.value.length-1];o.value=$t(P,_+1)}h.stopPropagation()}else h.ctrlKey||h.metaKey?(A!==-1?o.value.splice(A,1):o.value.push(C),h.stopPropagation()):await e(c)},y=async(h,c,C)=>{var I,$,B;const A=le(c),P=l.value,_=()=>{let k=[];return o.value.includes(C)?k=o.value.map(x=>i.value[x]):k.push(c),k},T=async k=>{if(!d.value)try{d.value=!0,await $n(c.fullpath),Ce.postMessage(JSON.stringify({event:"click_hidden_button",btnEleId:"iib_hidden_img_update_trigger"}));const x=setTimeout(()=>Fn.warn({message:D("long_loading"),duration:20}),5e3);await Dn(),clearTimeout(x),Ce.postMessage(JSON.stringify({event:"click_hidden_button",btnEleId:`iib_hidden_tab_${k}`}))}catch(x){console.error(x),X.error("发送图像失败,请携带console的错误消息找开发者")}finally{d.value=!1}};if(`${h.key}`.startsWith("toggle-tag-")){const k=+`${h.key}`.split("toggle-tag-")[1],{is_remove:x}=await Nn({tag_id:k,img_path:c.fullpath}),H=($=(I=N.conf)==null?void 0:I.all_custom_tags.find(F=>F.id===k))==null?void 0:$.name;Rt.refreshTags([c.fullpath]),X.success(D(x?"removedTagFromImage":"addedTagToImage",{tag:H}));return}switch(h.key){case"previewInNewWindow":return window.open(A);case"download":return window.open(le(c,!0));case"copyPreviewUrl":return Ve(parent.document.location.origin+A);case"send2txt2img":return T("txt2img");case"send2img2img":return T("img2img");case"send2inpaint":return T("inpaint");case"send2extras":return T("extras");case"send2savedDir":{const k=N.quickMovePaths.find(F=>F.key==="outdir_save");if(!k)return X.error(D("unknownSavedDir"));const x=zn(k.dir,(B=N.conf)==null?void 0:B.sd_cwd),H=_();await Ft(H.map(F=>F.fullpath),x,!0),_e.emit("removeFiles",{paths:H.map(F=>F.fullpath),loc:l.value}),_e.emit("addFiles",{files:H,loc:x});break}case"send2controlnet-img2img":case"send2controlnet-txt2img":{const k=h.key.split("-")[1];Ce.postMessage(JSON.stringify({event:"send_to_control_net",type:k,url:le(c)}));break}case"send2outpaint":{n.value=await s.pushAction(()=>ft(c.fullpath)).res;const[k,x]=(n.value||"").split(`
|
||
`);Ce.postMessage(JSON.stringify({event:"send_to_outpaint",url:le(c),prompt:k,negPrompt:x.slice(17)}));break}case"openWithWalkMode":{Ee.set(P,p.value);const k=N.tabList[m.value.tabIdx],x={type:"local",key:he(),path:c.fullpath,name:D("local"),stackKey:P,walkModePath:c.fullpath};k.panes.push(x),k.key=x.key;break}case"openInNewTab":{Ee.set(P,p.value);const k=N.tabList[m.value.tabIdx],x={type:"local",key:he(),path:c.fullpath,name:D("local"),stackKey:P};k.panes.push(x),k.key=x.key;break}case"openOnTheRight":{Ee.set(P,p.value);let k=N.tabList[m.value.tabIdx+1];k||(k={panes:[],key:"",id:he()},N.tabList[m.value.tabIdx+1]=k);const x={type:"local",key:he(),path:c.fullpath,name:D("local"),stackKey:P};k.panes.push(x),k.key=x.key;break}case"send2BatchDownload":{Zi.addFiles(_());break}case"viewGenInfo":{t.value=!0,n.value=await s.pushAction(()=>ft(c.fullpath)).res;break}case"openWithLocalFileBrowser":{await Mn(c.fullpath);break}case"deleteFiles":{const k=_();await new Promise(x=>{ue.confirm({title:D("confirmDelete"),maskClosable:!0,width:"60vw",content:b("div",null,[b("ol",{style:{maxHeight:"50vh",overflow:"auto"}},[k.map(H=>b("li",null,[H.fullpath.split(/[/\\]/).pop()]))]),b(Lt,null,null)]),async onOk(){const H=k.map(F=>F.fullpath);await Hi(H),X.success(D("deleteSuccess")),_e.emit("removeFiles",{paths:H,loc:l.value}),x()}})});break}}return{}},{isOutside:S}=Pn(E);return be("keydown",h=>{var C,A,P;const c=si(h);if(v.value){const _=(C=Object.entries(N.shortcut).find(T=>T[1]===c&&T[1]))==null?void 0:C[0];if(_){h.stopPropagation(),h.preventDefault();const T=a.value,I=i.value[T];switch(_){case"delete":return le(I)===N.fullscreenPreviewInitialUrl?X.warn(D("fullscreenRestriction")):y({key:"deleteFiles"},I,T);default:{const $=(A=/^toggle_tag_(.*)$/.exec(_))==null?void 0:A[1],B=(P=N.conf)==null?void 0:P.all_custom_tags.find(k=>k.name===$);return B?y({key:`toggle-tag-${B.id}`},I,T):void 0}}}}else!S.value&&["Ctrl + KeyA","Cmd + KeyA"].includes(c)&&(h.preventDefault(),h.stopPropagation(),g.value.emit("selectAll"))}),{onFileItemClick:u,onContextMenuClick:y,showGenInfo:t,imageGenInfo:n,q:s}}const ja=()=>{const{stackViewEl:e}=ae().toRefs(),t=L(-1);return On(e,n=>{var a;let i=n.target;for(;i.parentElement;)if(i=i.parentElement,i.tagName.toLowerCase()==="li"&&i.classList.contains("file-item-trigger")){const o=(a=i.dataset)==null?void 0:a.idx;o&&Number.isSafeInteger(+o)&&(t.value=+o);return}}),{showMenuIdx:t}};function Xi(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)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 a=e.indexOf("Edge/");return a>0?parseInt(e.substring(a+5,e.indexOf(".",a)),10):-1}let Pe;function Je(){Je.init||(Je.init=!0,Pe=Xi()!==-1)}var ze={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){Je(),Mt(()=>{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",Pe&&this.$el.appendChild(e),e.data="about:blank",Pe||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&&(!Pe&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const ea=jn();Ln("data-v-b329ee4c");const ta={class:"resize-observer",tabindex:"-1"};Rn();const na=ea((e,t,n,i,a,o)=>(Q(),q("div",ta)));ze.render=na;ze.__scopeId="data-v-b329ee4c";ze.__file="src/components/ResizeObserver.vue";function Oe(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Oe=function(t){return typeof t}:Oe=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oe(e)}function ia(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function At(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function aa(e,t,n){return t&&At(e.prototype,t),n&&At(e,n),e}function St(e){return ra(e)||sa(e)||la(e)||oa()}function ra(e){if(Array.isArray(e))return We(e)}function sa(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function la(e,t){if(e){if(typeof e=="string")return We(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return We(e,t)}}function We(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function oa(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ua(e){var t;return typeof e=="function"?t={callback:e}:t=e,t}function ca(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,a,o,p=function(d){for(var v=arguments.length,E=new Array(v>1?v-1:0),g=1;g<v;g++)E[g-1]=arguments[g];if(o=E,!(i&&d===a)){var m=n.leading;typeof m=="function"&&(m=m(d,a)),(!i||d!==a)&&m&&e.apply(void 0,[d].concat(St(o))),a=d,clearTimeout(i),i=setTimeout(function(){e.apply(void 0,[d].concat(St(o))),i=0},t)}};return p._clear=function(){clearTimeout(i),i=null},p}function jt(e,t){if(e===t)return!0;if(Oe(e)==="object"){for(var n in e)if(!jt(e[n],t[n]))return!1;return!0}return!1}var da=function(){function e(t,n,i){ia(this,e),this.el=t,this.observer=null,this.frozen=!1,this.createObserver(n,i)}return aa(e,[{key:"createObserver",value:function(n,i){var a=this;if(this.observer&&this.destroyObserver(),!this.frozen){if(this.options=ua(n),this.callback=function(l,d){a.options.callback(l,d),l&&a.options.once&&(a.frozen=!0,a.destroyObserver())},this.callback&&this.options.throttle){var o=this.options.throttleOptions||{},p=o.leading;this.callback=ca(this.callback,this.options.throttle,{leading:function(d){return p==="both"||p==="visible"&&d||p==="hidden"&&!d}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(l){var d=l[0];if(l.length>1){var v=l.find(function(g){return g.isIntersecting});v&&(d=v)}if(a.callback){var E=d.isIntersecting&&d.intersectionRatio>=a.threshold;if(E===a.oldResult)return;a.oldResult=E,a.callback(E,d)}},this.options.intersection),Mt(function(){a.observer&&a.observer.observe(a.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 Vt(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 a=new da(e,i,n);e._vue_visibilityState=a}}function fa(e,t,n){var i=t.value,a=t.oldValue;if(!jt(i,a)){var o=e._vue_visibilityState;if(!i){Ut(e);return}o?o.createObserver(i,n):Vt(e,{value:i},n)}}function Ut(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var va={beforeMount:Vt,updated:fa,unmounted:Ut},pa={itemsLimit:1e3},ha=/(auto|scroll)/;function Ht(e,t){return e.parentNode===null?t:Ht(e.parentNode,t.concat([e]))}var Re=function(t,n){return getComputedStyle(t,null).getPropertyValue(n)},ma=function(t){return Re(t,"overflow")+Re(t,"overflow-y")+Re(t,"overflow-x")},ga=function(t){return ha.test(ma(t))};function kt(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var t=Ht(e.parentNode,[]),n=0;n<t.length;n+=1)if(ga(t[n]))return t[n];return document.scrollingElement||document.documentElement}}function Ke(e){"@babel/helpers - typeof";return Ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ke(e)}var ya={items:{type:Array,required:!0},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:function(t){return["vertical","horizontal"].includes(t)}},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"}};function ba(){return this.items.length&&Ke(this.items[0])!=="object"}var qe=!1;if(typeof window<"u"){qe=!1;try{var wa=Object.defineProperty({},"passive",{get:function(){qe=!0}});window.addEventListener("test",null,wa)}catch{}}let Aa=0;var Jt={name:"RecycleScroller",components:{ResizeObserver:ze},directives:{ObserveVisibility:va},props:{...ya,itemSize:{type:Number,default:null},gridItems:{type:Number,default:void 0},itemSecondarySize:{type:Number,default:void 0},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:"size"},typeField:{type:String,default:"type"},buffer:{type:Number,default:200},pageMode:{type:Boolean,default:!1},prerender:{type:Number,default:0},emitUpdate:{type:Boolean,default:!1},updateInterval:{type:Number,default:0},skipHover:{type:Boolean,default:!1},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},listClass:{type:[String,Object,Array],default:""},itemClass:{type:[String,Object,Array],default:""}},emits:["resize","visible","hidden","update","scroll-start","scroll-end"],data(){return{pool:[],totalSize:0,ready:!1,hoverKey:null}},computed:{sizes(){if(this.itemSize===null){const e={"-1":{accumulator:0}},t=this.items,n=this.sizeField,i=this.minItemSize;let a=1e4,o=0,p;for(let l=0,d=t.length;l<d;l++)p=t[l][n]||i,p<a&&(a=p),o+=p,e[l]={accumulator:o,size:p};return this.$_computedMinItemSize=a,e}return[]},simpleArray:ba,itemIndexByKey(){const{keyField:e,items:t}=this,n={};for(let i=0,a=t.length;i<a;i++)n[t[i][e]]=i;return n}},watch:{items(){this.updateVisibleItems(!0)},pageMode(){this.applyPageMode(),this.updateVisibleItems(!1)},sizes:{handler(){this.updateVisibleItems(!1)},deep:!0},gridItems(){this.updateVisibleItems(!0)},itemSecondarySize(){this.updateVisibleItems(!0)}},created(){this.$_startIndex=0,this.$_endIndex=0,this.$_views=new Map,this.$_unusedViews=new Map,this.$_scrollDirty=!1,this.$_lastUpdateScrollPosition=0,this.prerender&&(this.$_prerender=!0,this.updateVisibleItems(!1)),this.gridItems&&!this.itemSize&&console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems")},mounted(){this.applyPageMode(),this.$nextTick(()=>{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,a){const o=Vn({id:Aa++,index:t,used:!0,key:i,type:a}),p=Un({item:n,position:0,nr:o});return e.push(p),p},unuseView(e,t=!1){const n=this.$_unusedViews,i=e.nr.type;let a=n.get(i);a||(a=[],n.set(i,a)),a.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,a=this.itemSecondarySize||n,o=this.$_computedMinItemSize,p=this.typeField,l=this.simpleArray?null:this.keyField,d=this.items,v=d.length,E=this.sizes,g=this.$_views,m=this.$_unusedViews,f=this.pool,r=this.itemIndexByKey;let s,u,y,S,h;if(!v)s=u=S=h=y=0;else if(this.$_prerender)s=S=0,u=h=Math.min(this.prerender,d.length),y=null;else{const I=this.getScroll();if(t){let k=I.start-this.$_lastUpdateScrollPosition;if(k<0&&(k=-k),n===null&&k<o||k<n)return{continuous:!0}}this.$_lastUpdateScrollPosition=I.start;const $=this.buffer;I.start-=$,I.end+=$;let B=0;if(this.$refs.before&&(B=this.$refs.before.scrollHeight,I.start-=B),this.$refs.after){const k=this.$refs.after.scrollHeight;I.end+=k}if(n===null){let k,x=0,H=v-1,F=~~(v/2),w;do w=F,k=E[F].accumulator,k<I.start?x=F:F<v-1&&E[F+1].accumulator>I.start&&(H=F),F=~~((x+H)/2);while(F!==w);for(F<0&&(F=0),s=F,y=E[v-1].accumulator,u=F;u<v&&E[u].accumulator<I.end;u++);for(u===-1?u=d.length-1:(u++,u>v&&(u=v)),S=s;S<v&&B+E[S].accumulator<I.start;S++);for(h=S;h<v&&B+E[h].accumulator<I.end;h++);}else{s=~~(I.start/n*i);const k=s%i;s-=k,u=Math.ceil(I.end/n*i),S=Math.max(0,Math.floor((I.start-B)/n*i)),h=Math.floor((I.end-B)/n*i),s<0&&(s=0),u>v&&(u=v),S<0&&(S=0),h>v&&(h=v),y=Math.ceil(v/i)*n}}u-s>pa.itemsLimit&&this.itemsLimitError(),this.totalSize=y;let c;const C=s<=this.$_endIndex&&u>=this.$_startIndex;if(C)for(let I=0,$=f.length;I<$;I++)c=f[I],c.nr.used&&(e&&(c.nr.index=r[c.item[l]]),(c.nr.index==null||c.nr.index<s||c.nr.index>=u)&&this.unuseView(c));const A=C?null:new Map;let P,_,T;for(let I=s;I<u;I++){P=d[I];const $=l?P[l]:P;if($==null)throw new Error(`Key is ${$} on item (keyField is '${l}')`);if(c=g.get($),!n&&!E[I].size){c&&this.unuseView(c);continue}_=P[p];let B=m.get(_),k=!1;if(!c)C?B&&B.length?c=B.pop():c=this.addView(f,I,P,$,_):(T=A.get(_)||0,(!B||T>=B.length)&&(c=this.addView(f,I,P,$,_),this.unuseView(c,!0),B=m.get(_)),c=B[T],A.set(_,T+1)),g.delete(c.nr.key),c.nr.used=!0,c.nr.index=I,c.nr.key=$,c.nr.type=_,g.set($,c),k=!0;else if(!c.nr.used&&(c.nr.used=!0,c.nr.index=I,k=!0,B)){const x=B.indexOf(c);x!==-1&&B.splice(x,1)}c.item=P,k&&(I===d.length-1&&this.$emit("scroll-end"),I===0&&this.$emit("scroll-start")),n===null?(c.position=E[I-1].accumulator,c.offset=0):(c.position=Math.floor(I/i)*n,c.offset=I%i*a)}return this.$_startIndex=s,this.$_endIndex=u,this.emitUpdate&&this.$emit("update",s,u,S,h),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:C}},getListenerTarget(){let e=kt(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 a=e.getBoundingClientRect(),o=n?a.height:a.width;let p=-(n?a.top:a.left),l=n?window.innerHeight:window.innerWidth;p<0&&(l+=p,p=0),p+l>o&&(l=o-p),i={start:p,end:p+l}}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,qe?{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,a;if(this.pageMode){const o=kt(this.$el),p=o.tagName==="HTML"?0:o[t.scroll],l=o.getBoundingClientRect(),v=this.$el.getBoundingClientRect()[t.start]-l[t.start];n=o,i=t.scroll,a=e+p+v}else n=this.$el,i=t.scroll,a=e;n[i]=a},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 Sa={key:0,ref:"before",class:"vue-recycle-scroller__slot"},ka={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function Ca(e,t,n,i,a,o){const p=Hn("ResizeObserver"),l=Jn("observe-visibility");return Wn((Q(),J("div",{class:Be(["vue-recycle-scroller",{ready:a.ready,"page-mode":n.pageMode,[`direction-${e.direction}`]:!0}]),onScrollPassive:t[0]||(t[0]=(...d)=>o.handleScroll&&o.handleScroll(...d))},[e.$slots.before?(Q(),J("div",Sa,[Se(e.$slots,"before")],512)):ee("v-if",!0),(Q(),q(vt(n.listTag),{ref:"wrapper",style:Yn({[e.direction==="vertical"?"minHeight":"minWidth"]:a.totalSize+"px"}),class:Be(["vue-recycle-scroller__item-wrapper",n.listClass])},{default:z(()=>[(Q(!0),J(ne,null,Xe(a.pool,d=>(Q(),q(vt(n.itemTag),Kn({key:d.nr.id,style:a.ready?{transform:`translate${e.direction==="vertical"?"Y":"X"}(${d.position}px) translate${e.direction==="vertical"?"X":"Y"}(${d.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&&a.hoverKey===d.nr.key}]]},qn(n.skipHover?{}:{mouseenter:()=>{a.hoverKey=d.nr.key},mouseleave:()=>{a.hoverKey=null}})),{default:z(()=>[Se(e.$slots,"default",{item:d.item,index:d.nr.index,active:d.nr.used})]),_:2},1040,["style","class"]))),128)),Se(e.$slots,"empty")]),_:3},8,["style","class"])),e.$slots.after?(Q(),J("div",ka,[Se(e.$slots,"after")],512)):ee("v-if",!0),b(p,{onNotify:o.handleResize},null,8,["onNotify"])],34)),[[l,o.handleVisibilityChange]])}Jt.render=Ca;Jt.__file="src/components/RecycleScroller.vue";const Ct=pe({__name:"ContextMenu",props:{file:{},idx:{},selectedTag:{},disableDelete:{type:Boolean}},emits:["contextMenuClick"],setup(e,{emit:t}){const n=e,i=Ge(),a=U(()=>{var o;return(((o=i.conf)==null?void 0:o.all_custom_tags)??[]).reduce((p,l)=>[...p,{...l,selected:!!n.selectedTag.find(d=>d.id===l.id)}],[])});return(o,p)=>{const l=Gn,d=Zn,v=Xn,E=ei;return Q(),q(E,{onClick:p[0]||(p[0]=g=>t("contextMenuClick",g,o.file,o.idx))},{default:z(()=>{var g;return[b(l,{key:"deleteFiles",disabled:o.disableDelete},{default:z(()=>[j(R(o.$t("deleteSelected")),1)]),_:1},8,["disabled"]),o.file.type==="dir"?(Q(),J(ne,{key:0},[b(l,{key:"openInNewTab"},{default:z(()=>[j(R(o.$t("openInNewTab")),1)]),_:1}),b(l,{key:"openOnTheRight"},{default:z(()=>[j(R(o.$t("openOnTheRight")),1)]),_:1}),b(l,{key:"openWithWalkMode"},{default:z(()=>[j(R(o.$t("openWithWalkMode")),1)]),_:1})],64)):ee("",!0),o.file.type==="file"?(Q(),J(ne,{key:1},[Z(K)(o.file.name)?(Q(),J(ne,{key:0},[b(l,{key:"viewGenInfo"},{default:z(()=>[j(R(o.$t("viewGenerationInfo")),1)]),_:1}),b(d),((g=Z(i).conf)==null?void 0:g.launch_mode)!=="server"?(Q(),J(ne,{key:0},[b(l,{key:"send2txt2img"},{default:z(()=>[j(R(o.$t("sendToTxt2img")),1)]),_:1}),b(l,{key:"send2img2img"},{default:z(()=>[j(R(o.$t("sendToImg2img")),1)]),_:1}),b(l,{key:"send2inpaint"},{default:z(()=>[j(R(o.$t("sendToInpaint")),1)]),_:1}),b(l,{key:"send2extras"},{default:z(()=>[j(R(o.$t("sendToExtraFeatures")),1)]),_:1}),b(v,{key:"sendToThirdPartyExtension",title:o.$t("sendToThirdPartyExtension")},{default:z(()=>[b(l,{key:"send2controlnet-txt2img"},{default:z(()=>[j("ControlNet - "+R(o.$t("t2i")),1)]),_:1}),b(l,{key:"send2controlnet-img2img"},{default:z(()=>[j("ControlNet - "+R(o.$t("i2i")),1)]),_:1}),b(l,{key:"send2outpaint"},{default:z(()=>[j("openOutpaint")]),_:1})]),_:1},8,["title"])],64)):ee("",!0),b(l,{key:"send2BatchDownload"},{default:z(()=>[j(R(o.$t("sendToBatchDownload")),1)]),_:1}),b(l,{key:"send2savedDir"},{default:z(()=>[j(R(o.$t("send2savedDir")),1)]),_:1}),b(d),b(v,{key:"toggle-tag",title:o.$t("toggleTag")},{default:z(()=>[(Q(!0),J(ne,null,Xe(a.value,m=>(Q(),q(l,{key:`toggle-tag-${m.id}`},{default:z(()=>[j(R(m.name)+" ",1),m.selected?(Q(),q(Z(bi),{key:0})):(Q(),q(Z(Ui),{key:1}))]),_:2},1024))),128))]),_:1},8,["title"]),b(l,{key:"openWithLocalFileBrowser"},{default:z(()=>[j(R(o.$t("openWithLocalFileBrowser")),1)]),_:1})],64)):ee("",!0),b(l,{key:"previewInNewWindow"},{default:z(()=>[j(R(o.$t("previewInNewWindow")),1)]),_:1}),b(l,{key:"download"},{default:z(()=>[j(R(o.$t("download")),1)]),_:1}),b(l,{key:"copyPreviewUrl"},{default:z(()=>[j(R(o.$t("copySourceFilePreviewLink")),1)]),_:1})],64)):ee("",!0)]}),_:1})}}}),Ia=["data-idx"],Ea={class:"more"},_a={key:0,class:"tags-container"},Pa={key:3,class:"preview-icon-wrap"},Oa={key:4,class:"profile"},xa={class:"name line-clamp-1"},Ta={class:"basic-info"},Ba=pe({__name:"FileItem",props:{file:{},idx:{},selected:{type:Boolean,default:!1},showMenuIdx:{},cellWidth:{},fullScreenPreviewImageUrl:{},enableRightClickMenu:{type:Boolean,default:!0},enableCloseIcon:{type:Boolean,default:!1},tags:{}},emits:["update:showMenuIdx","fileItemClick","dragstart","dragend","previewVisibleChange","contextMenuClick","close-icon-click"],setup(e,{emit:t}){const n=e;ti(l=>({"6d64081c":l.$props.cellWidth+"px"}));const i=Ge(),a=xt(),o=U(()=>a.tagMap.get(n.file.fullpath)??[]),p=U(()=>{const l=i.gridThumbnailResolution;return i.enableThumbnail?ni(n.file,[l,l].join("x")):le(n.file)});return(l,d)=>{const v=fe,E=ai,g=hi;return Q(),q(v,{trigger:["contextmenu"],visible:Z(i).longPressOpenContextMenu?typeof l.idx=="number"&&l.showMenuIdx===l.idx:void 0,"onUpdate:visible":d[6]||(d[6]=m=>typeof l.idx=="number"&&t("update:showMenuIdx",m?l.idx:-1))},{overlay:z(()=>[l.enableRightClickMenu?(Q(),q(Ct,{key:0,file:l.file,idx:l.idx,"selected-tag":o.value,onContextMenuClick:d[5]||(d[5]=(m,f,r)=>t("contextMenuClick",m,f,r))},null,8,["file","idx","selected-tag"])):ee("",!0)]),default:z(()=>[(Q(),J("li",{class:Be(["file file-item-trigger grid",{clickable:l.file.type==="dir",selected:l.selected}]),"data-idx":l.idx,key:l.file.name,draggable:"true",onDragstart:d[2]||(d[2]=m=>t("dragstart",m,l.idx)),onDragend:d[3]||(d[3]=m=>t("dragend",m,l.idx)),onClickCapture:d[4]||(d[4]=m=>t("fileItemClick",m,l.file,l.idx))},[oe("div",null,[l.enableCloseIcon?(Q(),J("div",{key:0,class:"close-icon",onClick:d[0]||(d[0]=m=>t("close-icon-click"))},[b(Z(ii))])):ee("",!0),l.enableRightClickMenu?(Q(),q(v,{key:1},{overlay:z(()=>[b(Ct,{file:l.file,idx:l.idx,"selected-tag":o.value,onContextMenuClick:d[1]||(d[1]=(m,f,r)=>t("contextMenuClick",m,f,r))},null,8,["file","idx","selected-tag"])]),default:z(()=>[oe("div",Ea,[b(Z(Et))])]),_:1})):ee("",!0),Z(K)(l.file.name)?(Q(),J("div",{style:{position:"relative"},key:l.file.fullpath,class:Be(`idx-${l.idx}`)},[b(E,{src:p.value,fallback:Z(zi),preview:{src:l.fullScreenPreviewImageUrl,onVisibleChange:(m,f)=>t("previewVisibleChange",m,f)}},null,8,["src","fallback","preview"]),o.value&&l.cellWidth>128?(Q(),J("div",_a,[(Q(!0),J(ne,null,Xe(l.tags??o.value,m=>(Q(),q(g,{key:m.id,color:Z(a).getColor(m.name)},{default:z(()=>[j(R(m.name),1)]),_:2},1032,["color"]))),128))])):ee("",!0)],2)):(Q(),J("div",Pa,[l.file.type==="file"?(Q(),q(Z(ki),{key:0,class:"icon center"})):(Q(),q(Z(_i),{key:1,class:"icon center"}))])),l.cellWidth>128?(Q(),J("div",Oa,[oe("div",xa,R(l.file.name),1),oe("div",Ta,[oe("div",null,R(l.file.size),1),oe("div",null,R(l.file.date),1)])])):ee("",!0)])],42,Ia))]),_:1},8,["visible"])}}});const Va=ri(Ba,[["__scopeId","data-v-3482fc45"]]);export{fe as D,Va as F,Ct as _,Fa as a,Da as b,La as c,Ra as d,$a as e,ja as f,Jt as g,He as h,be as i,Gi as j,Ee as s,ae as u};
|