5 lines
75 KiB
JavaScript
5 lines
75 KiB
JavaScript
import{P as Pe,bU as fn,a as te,d as pe,bq as Ze,u as jt,c as p,bV as et,_ as Vt,V as le,a0 as Ue,aj as J,bL as gt,a3 as yt,bo as vn,h as ee,bW as pn,b as hn,ay as mn,bX as gn,a2 as bt,bK as yn,aI as bn,bY as wn,ax as tt,aC as fe,bZ as Sn,b_ as He,e as wt,bz as An,ag as ne,b$ as En,aR as kn,c0 as On,c1 as Cn,aM as nt,am as We,bn as In,c2 as _n,c3 as Pn,c4 as be,c5 as xn,c6 as $n,$ as Q,R as ce,ai as j,U as Ln,c7 as Me,x as N,k as Ne,ah as Mn,c8 as Ut,ar as Z,c9 as it,l as ge,aw as Ht,ap as Be,ca as Nn,cb as St,an as Wt,bQ as At,bP as zn,cc as ke,cd as Tn,aD as Bn,bO as ze,ce as Fn,cf as Dn,cg as X,ch as me,t as xe,as as Et,ci as kt,cj as Qn,L as ie,J as jn,ck as Je,al as we,cl as Vn,cm as Un,cn as Hn,co as Wn,at as Jn,au as Rn,o as M,m as W,cp as Yn,cq as qn,cr as Kn,cs as Gn,ct as Xn,a5 as Zn,y as V,cu as Se,E as q,n as _,z as re,A as $e,cv as Ot,bG as ei,cw as ti,B as ni,N as ye,v as L,r as z,W as Jt,cx as ii,cy as Rt,M as Yt,cz as ri,cA as ai,p as Y,cB as li,X as qt,cC as si,q as oi}from"./index-d9e8fbed.js";import{f as ui,a as ci,t as di,h as Kt}from"./db-ea72b770.js";import{t as Fe,l as de,g as fi}from"./shortcut-9b4bff3d.js";var Gt=function(){return{arrow:{type:[Boolean,Object],default:void 0},trigger:{type:[Array,String]},overlay:Pe.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=fn(),vi=function(){return te(te({},Gt()),{},{type:De.type,size:String,htmlType:De.htmlType,href:String,disabled:{type:Boolean,default:void 0},prefixCls:String,icon:Pe.any,title:String,loading:De.loading,onClick:{type:Function}})},pi=["type","disabled","loading","htmlType","class","overlay","trigger","align","visible","onVisibleChange","placement","href","title","icon","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","onClick","onUpdate:visible"],hi=le.Group;const Le=pe({compatConfig:{MODE:3},name:"ADropdownButton",inheritAttrs:!1,__ANT_BUTTON:!0,props:Ze(vi(),{trigger:"hover",placement:"bottomRight",type:"default"}),slots:["icon","leftButton","rightButton","overlay"],setup:function(t,n){var i=n.slots,r=n.attrs,d=n.emit,f=function(w){d("update:visible",w),d("visibleChange",w)},h=jt("dropdown-button",t),c=h.prefixCls,y=h.direction,k=h.getPopupContainer;return function(){var C,w,m=te(te({},t),r),s=m.type,l=s===void 0?"default":s,a=m.disabled,v=m.loading,g=m.htmlType,u=m.class,o=u===void 0?"":u,b=m.overlay,E=b===void 0?(C=i.overlay)===null||C===void 0?void 0:C.call(i):b,S=m.trigger,P=m.align,T=m.visible;m.onVisibleChange;var I=m.placement,B=I===void 0?y.value==="rtl"?"bottomLeft":"bottomRight":I,O=m.href,x=m.title,U=m.icon,A=U===void 0?((w=i.icon)===null||w===void 0?void 0:w.call(i))||p(et,null,null):U,$=m.mouseEnterDelay,F=m.mouseLeaveDelay,K=m.overlayClassName,H=m.overlayStyle,G=m.destroyPopupOnHide,R=m.onClick;m["onUpdate:visible"];var oe=Vt(m,pi),ue={align:P,disabled:a,trigger:a?[]:S,placement:B,getPopupContainer:k.value,onVisibleChange:f,mouseEnterDelay:$,mouseLeaveDelay:F,visible:T,overlayClassName:K,overlayStyle:H,destroyPopupOnHide:G},ht=p(le,{type:l,disabled:a,loading:v,onClick:R,htmlType:g,href:O,title:x},{default:i.default}),mt=p(le,{type:l,icon:A},null);return p(hi,te(te({},oe),{},{class:Ue(c.value,o)}),{default:function(){return[i.leftButton?i.leftButton({button:ht}):ht,p(se,ue,{default:function(){return[i.rightButton?i.rightButton({button:mt}):mt]},overlay:function(){return E}})]}})}}});var Xt=pe({compatConfig:{MODE:3},name:"ADropdown",inheritAttrs:!1,props:Ze(Gt(),{mouseEnterDelay:.15,mouseLeaveDelay:.1,placement:"bottomLeft",trigger:"hover"}),slots:["overlay"],setup:function(t,n){var i=n.slots,r=n.attrs,d=n.emit,f=jt("dropdown",t),h=f.prefixCls,c=f.rootPrefixCls,y=f.direction,k=f.getPopupContainer,C=J(function(){var l=t.placement,a=l===void 0?"":l,v=t.transitionName;return v!==void 0?v:a.indexOf("top")>=0?"".concat(c.value,"-slide-down"):"".concat(c.value,"-slide-up")}),w=function(){var a,v,g,u=t.overlay||((a=i.overlay)===null||a===void 0?void 0:a.call(i)),o=Array.isArray(u)?u[0]:u;if(!o)return null;var b=o.props||{};gt(!b.mode||b.mode==="vertical","Dropdown",'mode="'.concat(b.mode,`" is not supported for Dropdown's Menu.`));var E=b.selectable,S=E===void 0?!1:E,P=b.expandIcon,T=P===void 0?(v=o.children)===null||v===void 0||(g=v.expandIcon)===null||g===void 0?void 0:g.call(v):P,I=typeof T<"u"&&bt(T)?T:p("span",{class:"".concat(h.value,"-menu-submenu-arrow")},[p(yn,{class:"".concat(h.value,"-menu-submenu-arrow-icon")},null)]),B=bt(o)?yt(o,{mode:"vertical",selectable:S,expandIcon:function(){return I}}):o;return B},m=J(function(){var l=t.placement;if(!l)return y.value==="rtl"?"bottomRight":"bottomLeft";if(l.includes("Center")){var a=l.slice(0,l.indexOf("Center"));return gt(!l.includes("Center"),"Dropdown","You are using '".concat(l,"' placement in Dropdown, which is deprecated. Try to use '").concat(a,"' instead.")),a}return l}),s=function(a){d("update:visible",a),d("visibleChange",a)};return function(){var l,a,v=t.arrow,g=t.trigger,u=t.disabled,o=t.overlayClassName,b=(l=i.default)===null||l===void 0?void 0:l.call(i)[0],E=yt(b,vn({class:Ue(b==null||(a=b.props)===null||a===void 0?void 0:a.class,ee({},"".concat(h.value,"-rtl"),y.value==="rtl"),"".concat(h.value,"-trigger"))},u?{disabled:u}:{})),S=Ue(o,ee({},"".concat(h.value,"-rtl"),y.value==="rtl")),P=u?[]:g,T;P&&P.indexOf("contextmenu")!==-1&&(T=!0);var I=pn({arrowPointAtCenter:hn(v)==="object"&&v.pointAtCenter,autoAdjustOverflow:!0}),B=mn(te(te(te({},t),r),{},{builtinPlacements:I,overlayClassName:S,arrow:v,alignPoint:T,prefixCls:h.value,getPopupContainer:k.value,transitionName:C.value,trigger:P,onVisibleChange:s,placement:m.value}),["overlay","onUpdate:visible"]);return p(gn,B,{default:function(){return[E]},overlay:w})}}});Xt.Button=Le;const se=Xt;se.Button=Le;se.install=function(e){return e.component(se.name,se),e.component(Le.name,Le),e};var mi=["class","style"],gi=function(){return{prefixCls:String,spinning:{type:Boolean,default:void 0},size:String,wrapperClassName:String,tip:Pe.any,delay:Number,indicator:Pe.any}},Oe=null;function yi(e,t){return!!e&&!!t&&!isNaN(Number(t))}function va(e){var t=e.indicator;Oe=typeof t=="function"?t:function(){return p(t,null,null)}}const pa=pe({compatConfig:{MODE:3},name:"ASpin",inheritAttrs:!1,props:Ze(gi(),{size:"default",spinning:!0,wrapperClassName:""}),setup:function(){return{originalUpdateSpinning:null,configProvider:bn("configProvider",wn)}},data:function(){var t=this.spinning,n=this.delay,i=yi(t,n);return{sSpinning:t&&!i}},created:function(){this.originalUpdateSpinning=this.updateSpinning,this.debouncifyUpdateSpinning(this.$props)},mounted:function(){this.updateSpinning()},updated:function(){var t=this;tt(function(){t.debouncifyUpdateSpinning(),t.updateSpinning()})},beforeUnmount:function(){this.cancelExistingSpin()},methods:{debouncifyUpdateSpinning:function(t){var n=t||this.$props,i=n.delay;i&&(this.cancelExistingSpin(),this.updateSpinning=fe(this.originalUpdateSpinning,i))},updateSpinning:function(){var t=this.spinning,n=this.sSpinning;n!==t&&(this.sSpinning=t)},cancelExistingSpin:function(){var t=this.updateSpinning;t&&t.cancel&&t.cancel()},renderIndicator:function(t){var n="".concat(t,"-dot"),i=Sn(this,"indicator");return i===null?null:(Array.isArray(i)&&(i=i.length===1?i[0]:i),He(i)?wt(i,{class:n}):Oe&&He(Oe())?wt(Oe(),{class:n}):p("span",{class:"".concat(n," ").concat(t,"-dot-spin")},[p("i",{class:"".concat(t,"-dot-item")},null),p("i",{class:"".concat(t,"-dot-item")},null),p("i",{class:"".concat(t,"-dot-item")},null),p("i",{class:"".concat(t,"-dot-item")},null)]))}},render:function(){var t,n,i,r=this.$props,d=r.size,f=r.prefixCls,h=r.tip,c=h===void 0?(t=(n=this.$slots).tip)===null||t===void 0?void 0:t.call(n):h,y=r.wrapperClassName,k=this.$attrs,C=k.class,w=k.style,m=Vt(k,mi),s=this.configProvider,l=s.getPrefixCls,a=s.direction,v=l("spin",f),g=this.sSpinning,u=(i={},ee(i,v,!0),ee(i,"".concat(v,"-sm"),d==="small"),ee(i,"".concat(v,"-lg"),d==="large"),ee(i,"".concat(v,"-spinning"),g),ee(i,"".concat(v,"-show-text"),!!c),ee(i,"".concat(v,"-rtl"),a==="rtl"),ee(i,C,!!C),i),o=p("div",te(te({},m),{},{style:w,class:u}),[this.renderIndicator(v),c?p("div",{class:"".concat(v,"-text")},[c]):null]),b=An(this);if(b&&b.length){var E,S=(E={},ee(E,"".concat(v,"-container"),!0),ee(E,"".concat(v,"-blur"),g),E);return p("div",{class:["".concat(v,"-nested-loading"),y]},[g&&p("div",{key:"loading"},[o]),p("div",{class:S,key:"container"},[b])])}return o}});var bi={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 wi=bi;function Ct(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(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),i.forEach(function(r){Si(e,r,n[r])})}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 rt=function(t,n){var i=Ct({},t,n.attrs);return p(ne,Ct({},i,{icon:wi}),null)};rt.displayName="StarFilled";rt.inheritAttrs=!1;const Zt=rt;var Ai={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 Ei=Ai;function It(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(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),i.forEach(function(r){ki(e,r,n[r])})}return e}function ki(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=It({},t,n.attrs);return p(ne,It({},i,{icon:Ei}),null)};at.displayName="FileOutlined";at.inheritAttrs=!1;const Oi=at;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 _t(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(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),i.forEach(function(r){_i(e,r,n[r])})}return e}function _i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var lt=function(t,n){var i=_t({},t,n.attrs);return p(ne,_t({},i,{icon:Ii}),null)};lt.displayName="FolderOpenOutlined";lt.inheritAttrs=!1;const Pi=lt;function xi(e,t,n){if(!En(n))return!1;var i=typeof t;return(i=="number"?kn(n)&&On(t,n.length):i=="string"&&t in n)?Cn(n[t],e):!1}var $i=Math.ceil,Li=Math.max;function Mi(e,t,n,i){for(var r=-1,d=Li($i((t-e)/(n||1)),0),f=Array(d);d--;)f[i?d:++r]=e,e+=n;return f}function Ni(e){return function(t,n,i){return i&&typeof i!="number"&&xi(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),Mi(t,n,i,e)}}var zi=Ni();const en=zi,ve=(...e)=>{document.addEventListener(...e),nt(()=>document.removeEventListener(...e))},Ti="data:image/png;base64,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",Ae=new WeakMap;function Bi(e,t){return{useHookShareState:i=>{const r=Pn();We(r),Ae.has(r)||(Ae.set(r,In(e(r,i??(t==null?void 0:t())))),nt(()=>{Ae.delete(r)}));const d=Ae.get(r);return We(d),{state:d,toRefs(){return _n(d)}}}}}var Fi={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 Di=Fi;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(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),i.forEach(function(r){Qi(e,r,n[r])})}return e}function Qi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var st=function(t,n){var i=Pt({},t,n.attrs);return p(ne,Pt({},i,{icon:Di}),null)};st.displayName="ArrowsAltOutlined";st.inheritAttrs=!1;const ji=st;var Vi={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 Ui=Vi;function xt(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(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),i.forEach(function(r){Hi(e,r,n[r])})}return e}function Hi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ot=function(t,n){var i=xt({},t,n.attrs);return p(ne,xt({},i,{icon:Ui}),null)};ot.displayName="DatabaseOutlined";ot.inheritAttrs=!1;const Wi=ot;var Ji={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 Ri=Ji;function $t(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(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),i.forEach(function(r){Yi(e,r,n[r])})}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 ut=function(t,n){var i=$t({},t,n.attrs);return p(ne,$t({},i,{icon:Ri}),null)};ut.displayName="DragOutlined";ut.inheritAttrs=!1;const qi=ut;var Ki={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 Gi=Ki;function Lt(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(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),i.forEach(function(r){Xi(e,r,n[r])})}return e}function Xi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ct=function(t,n){var i=Lt({},t,n.attrs);return p(ne,Lt({},i,{icon:Gi}),null)};ct.displayName="FullscreenExitOutlined";ct.inheritAttrs=!1;const Zi=ct;var er={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 tr=er;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(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),i.forEach(function(r){nr(e,r,n[r])})}return e}function nr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var dt=function(t,n){var i=Mt({},t,n.attrs);return p(ne,Mt({},i,{icon:tr}),null)};dt.displayName="FullscreenOutlined";dt.inheritAttrs=!1;const ir=dt;var rr={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 ar=rr;function Nt(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(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),i.forEach(function(r){lr(e,r,n[r])})}return e}function lr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ft=function(t,n){var i=Nt({},t,n.attrs);return p(ne,Nt({},i,{icon:ar}),null)};ft.displayName="LeftCircleOutlined";ft.inheritAttrs=!1;const ha=ft;var sr={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 or=sr;function zt(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(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),i.forEach(function(r){ur(e,r,n[r])})}return e}function ur(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vt=function(t,n){var i=zt({},t,n.attrs);return p(ne,zt({},i,{icon:or}),null)};vt.displayName="RightCircleOutlined";vt.inheritAttrs=!1;const ma=vt;var cr={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 dr=cr;function Tt(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(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),i.forEach(function(r){fr(e,r,n[r])})}return e}function fr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pt=function(t,n){var i=Tt({},t,n.attrs);return p(ne,Tt({},i,{icon:dr}),null)};pt.displayName="StarOutlined";pt.inheritAttrs=!1;const tn=pt;const he=async e=>(await be.value.get("/files",{params:{folder_path:e}})).data,vr=async e=>(await be.value.post("/delete_files",{file_paths:e})).data,nn=async(e,t,n)=>(await be.value.post("/move_files",{file_paths:e,dest:t,create_dest_folder:n})).data,pr=async(e,t,n)=>(await be.value.post("/copy_files",{file_paths:e,dest:t,create_dest_folder:n})).data,hr=async e=>{await be.value.post("/mkdirs",{dest_folder:e})};var rn={exports:{}};/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
|
||
* @license MIT */(function(e,t){(function(n,i){e.exports=i})(xn,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(s){var l,a;for(l in s)a=s[l],a!==void 0&&s.hasOwnProperty(l)&&(i[l]=a);return this},n.status=null,n.set=function(s){var l=n.isStarted();s=r(s,i.minimum,1),n.status=s===1?null:s;var a=n.render(!l),v=a.querySelector(i.barSelector),g=i.speed,u=i.easing;return a.offsetWidth,h(function(o){i.positionUsing===""&&(i.positionUsing=n.getPositioningCSS()),c(v,f(s,g,u)),s===1?(c(a,{transition:"none",opacity:1}),a.offsetWidth,setTimeout(function(){c(a,{transition:"all "+g+"ms linear",opacity:0}),setTimeout(function(){n.remove(),o()},g)},g)):setTimeout(o,g)}),this},n.isStarted=function(){return typeof n.status=="number"},n.start=function(){n.status||n.set(0);var s=function(){setTimeout(function(){n.status&&(n.trickle(),s())},i.trickleSpeed)};return i.trickle&&s(),this},n.done=function(s){return!s&&!n.status?this:n.inc(.3+.5*Math.random()).set(1)},n.inc=function(s){var l=n.status;return l?l>1?void 0:(typeof s!="number"&&(l>=0&&l<.2?s=.1:l>=.2&&l<.5?s=.04:l>=.5&&l<.8?s=.02:l>=.8&&l<.99?s=.005:s=0),l=r(l+s,0,.994),n.set(l)):n.start()},n.trickle=function(){return n.inc()},function(){var s=0,l=0;n.promise=function(a){return!a||a.state()==="resolved"?this:(l===0&&n.start(),s++,l++,a.always(function(){l--,l===0?(s=0,n.done()):n.set((s-l)/s)}),this)}}(),n.getElement=function(){var s=n.getParent();if(s){var l=Array.prototype.slice.call(s.querySelectorAll(".nprogress")).filter(function(a){return a.parentElement===s});if(l.length>0)return l[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(s){if(n.isRendered())return n.getElement();k(document.documentElement,"nprogress-busy");var l=document.createElement("div");l.id="nprogress",l.className="nprogress",l.innerHTML=i.template;var a=l.querySelector(i.barSelector),v=s?"-100":d(n.status||0),g=n.getParent(),u;return c(a,{transition:"all 0 linear",transform:"translate3d("+v+"%,0,0)"}),i.showSpinner||(u=l.querySelector(i.spinnerSelector),u&&m(u)),g!=document.body&&k(g,"nprogress-custom-parent"),g.appendChild(l),l},n.remove=function(){n.status=null,C(document.documentElement,"nprogress-busy"),C(n.getParent(),"nprogress-custom-parent");var s=n.getElement();s&&m(s)},n.isRendered=function(){return!!n.getElement()},n.getPositioningCSS=function(){var s=document.body.style,l="WebkitTransform"in s?"Webkit":"MozTransform"in s?"Moz":"msTransform"in s?"ms":"OTransform"in s?"O":"";return l+"Perspective"in s?"translate3d":l+"Transform"in s?"translate":"margin"};function r(s,l,a){return s<l?l:s>a?a:s}function d(s){return(-1+s)*100}function f(s,l,a){var v;return i.positionUsing==="translate3d"?v={transform:"translate3d("+d(s)+"%,0,0)"}:i.positionUsing==="translate"?v={transform:"translate("+d(s)+"%,0)"}:v={"margin-left":d(s)+"%"},v.transition="all "+l+"ms "+a,v}var h=function(){var s=[];function l(){var a=s.shift();a&&a(l)}return function(a){s.push(a),s.length==1&&l()}}(),c=function(){var s=["Webkit","O","Moz","ms"],l={};function a(o){return o.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(b,E){return E.toUpperCase()})}function v(o){var b=document.body.style;if(o in b)return o;for(var E=s.length,S=o.charAt(0).toUpperCase()+o.slice(1),P;E--;)if(P=s[E]+S,P in b)return P;return o}function g(o){return o=a(o),l[o]||(l[o]=v(o))}function u(o,b,E){b=g(b),o.style[b]=E}return function(o,b){var E=arguments,S,P;if(E.length==2)for(S in b)P=b[S],P!==void 0&&b.hasOwnProperty(S)&&u(o,S,P);else u(o,E[1],E[2])}}();function y(s,l){var a=typeof s=="string"?s:w(s);return a.indexOf(" "+l+" ")>=0}function k(s,l){var a=w(s),v=a+l;y(a,l)||(s.className=v.substring(1))}function C(s,l){var a=w(s),v;y(s,l)&&(v=a.replace(" "+l+" "," "),s.className=v.substring(1,v.length-1))}function w(s){return(" "+(s&&s.className||"")+" ").replace(/\s+/gi," ")}function m(s){s&&s.parentNode&&s.parentNode.removeChild(s)}return n})})(rn);var mr=rn.exports;const gr=$n(mr),yr=e=>{const t=Q("");return new Promise(n=>{ce.confirm({title:j("inputFolderName"),content:()=>p(Ln,{value:t.value,"onUpdate:value":i=>t.value=i},null),async onOk(){if(!t.value)return;const i=Me(e,t.value);await hr(i),n()}})})},an=()=>p("p",{style:{background:"var(--zp-secondary-background)",padding:"8px",borderLeft:"4px solid var(--primary-color)"}},[N("Tips: "),j("multiSelectTips")]);function Qe(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!He(e)}const je=new Map,D=Ne(),Bt=Mn(),Ee=new BroadcastChannel("iib-image-transfer-bus"),{eventEmitter:Ce,useEventListen:Re}=Ut(),{useHookShareState:ae}=Bi((e,{images:t})=>{const n=Q({tabIdx:-1,paneIdx:-1}),i=J(()=>de(r.value)),r=Q([]),d=J(()=>{var l;return r.value.map(a=>a.curr).slice((l=D.conf)!=null&&l.is_win?1:0)}),f=J(()=>Me(...d.value)),h=Q(D.defaultSortingMethod),c=J(()=>{var u;if(t.value)return t.value;if(!i.value)return[];const l=((u=i.value)==null?void 0:u.files)??[],a=h.value,{walkFiles:v}=i.value,g=o=>D.onlyFoldersAndImages?o.filter(b=>b.type==="dir"||X(b.name)):o;return n.value.walkModePath?v?v.map(o=>me(g(o),a)).flat():me(g(l),a):me(g(l),a)}),y=Q([]),k=Q(-1),C=Q(!0),w=Q(!1),m=Q(!1),s=()=>D.tabList[n.value.tabIdx].panes[n.value.paneIdx];return{previewing:m,spinning:w,canLoadNext:C,multiSelectedIdxs:y,previewIdx:k,basePath:d,currLocation:f,currPage:i,stack:r,sortMethod:h,sortedFiles:c,scroller:Q(),stackViewEl:Q(),props:n,getPane:s,...Ut()}},()=>({images:Q()}));function ga(e,t){const{previewIdx:n,eventEmitter:i,canLoadNext:r,previewing:d,sortedFiles:f}=ae().toRefs(),{state:h}=ae(),c=J(()=>(t==null?void 0:t.scroller.value)??h.scroller);let y=null;const k=(s,l)=>{var a;d.value=s,y!=null&&!s&&l&&((a=c.value)==null||a.scrollToItem(y),y=null)},C=()=>{e.walkModePath&&!m("next")&&r&&(Z.info(j("loadingNextFolder")),i.value.emit("loadNextDir",!0))};ve("keydown",s=>{var l;if(d.value){let a=n.value;if(["ArrowDown","ArrowRight"].includes(s.key))for(a++;f.value[a]&&!X(f.value[a].name);)a++;else if(["ArrowUp","ArrowLeft"].includes(s.key))for(a--;f.value[a]&&!X(f.value[a].name);)a--;if(X((l=f.value[a])==null?void 0:l.name)??""){n.value=a;const v=c.value;v&&!(a>=v.$_startIndex&&a<=v.$_endIndex)&&(y=a)}C()}});const w=s=>{var a;let l=n.value;if(s==="next")for(l++;f.value[l]&&!X(f.value[l].name);)l++;else if(s==="prev")for(l--;f.value[l]&&!X(f.value[l].name);)l--;if(X((a=f.value[l])==null?void 0:a.name)??""){n.value=l;const v=c.value;v&&!(l>=v.$_startIndex&&l<=v.$_endIndex)&&(y=l)}C()},m=s=>{var a;let l=n.value;if(s==="next")for(l++;f.value[l]&&!X(f.value[l].name);)l++;else if(s==="prev")for(l--;f.value[l]&&!X(f.value[l].name);)l--;return X((a=f.value[l])==null?void 0:a.name)??""};return Re("removeFiles",async()=>{var s;d.value&&!h.sortedFiles[n.value]&&(Z.info(j("manualExitFullScreen"),5),await it(500),(s=document.querySelector(".ant-image-preview-operations-operation .anticon-close"))==null||s.click(),n.value=-1)}),{previewIdx:n,onPreviewVisibleChange:k,previewing:d,previewImgMove:w,canPreview:m}}function ya(e){const t=Q(),{scroller:n,stackViewEl:i,stack:r,currPage:d,currLocation:f,sortMethod:h,useEventListen:c,eventEmitter:y,getPane:k,multiSelectedIdxs:C,sortedFiles:w}=ae().toRefs();ge(()=>r.value.length,fe((A,$)=>{var F;A!==$&&((F=n.value)==null||F.scrollToItem(0))},300));const m=async A=>{if(await g(A),e.walkModePath){await it();const[$]=me(d.value.files,h.value).filter(F=>F.type==="dir");$&&await g($.fullpath),await y.value.emit("loadNextDir")}};Ht(async()=>{var A;if(!r.value.length){const $=await he("/");r.value.push({files:$.files,curr:"/"})}t.value=new gr,t.value.configure({parent:i.value}),e.path&&e.path!=="/"?await m(e.walkModePath??e.path):(A=D.conf)!=null&&A.home&&g(D.conf.home)}),ge(f,fe(A=>{const $=k.value();$.path=A;const F=$.path.split("/").pop(),H=(()=>{var G;if(!e.walkModePath){const R=ke(A);for(const[oe,ue]of Object.entries(D.pathAliasMap))if(R.startsWith(ue))return R.replace(ue,oe);return F}return"Walk: "+(((G=D.quickMovePaths.find(R=>R.dir===$.walkModePath))==null?void 0:G.zh)??F)})();$.name=Be("div",{style:"display:flex;align-items:center"},[Be(Wi),Be("span",{class:"line-clamp-1",style:"max-width: 256px"},H)]),$.nameFallbackStr=H,D.recent=D.recent.filter(G=>G.key!==$.key),D.recent.unshift({path:A,key:$.key}),D.recent.length>20&&(D.recent=D.recent.slice(0,20))},300));const s=()=>xe(f.value),l=async A=>{var $,F;if(A.type==="dir")try{($=t.value)==null||$.start();const{files:K}=await he(A.fullpath);r.value.push({files:K,curr:A.name})}finally{(F=t.value)==null||F.done()}},a=A=>{for(;A<r.value.length-1;)r.value.pop()},v=(A,$)=>(We(D.conf,"global.conf load failed"),D.conf.is_win?A.toLowerCase()==$.toLowerCase():A==$),g=async A=>{var F,K;const $=r.value.slice();try{Nn(A)||(A=Me(((F=D.conf)==null?void 0:F.sd_cwd)??"/",A));const H=St(A),G=r.value.map(R=>R.curr);for(G.shift();G[0]&&H[0]&&v(G[0],H[0]);)G.shift(),H.shift();for(let R=0;R<G.length;R++)r.value.pop();if(!H.length)return u();for(const R of H){const oe=(K=d.value)==null?void 0:K.files.find(ue=>v(ue.name,R));if(!oe)throw console.error({frags:H,frag:R,stack:Wt(r.value)}),new Error(`${R} not found`);await l(oe)}}catch(H){throw Z.error(j("moveFailedCheckPath")+(H instanceof Error?H.message:"")),console.error(A,St(A),d.value),r.value=$,H}},u=At(async()=>{var A,$,F;try{if((A=t.value)==null||A.start(),e.walkModePath)a(0),await m(e.walkModePath);else{const{files:K}=await he(r.value.length===1?"/":f.value);de(r.value).files=K}($=n.value)==null||$.scrollToItem(0),Z.success(j("refreshCompleted"))}finally{(F=t.value)==null||F.done()}});zn("returnToIIB",At(async()=>{var A,$;if(!e.walkModePath)try{(A=t.value)==null||A.start();const{files:F}=await he(r.value.length===1?"/":f.value);de(r.value).files.map(H=>H.date).join()!==F.map(H=>H.date).join()&&(de(r.value).files=F,Z.success(j("autoUpdate")))}finally{($=t.value)==null||$.done()}})),c.value("refresh",u);const o=A=>{e.walkModePath&&(k.value().walkModePath=A),m(A)},b=J(()=>D.quickMovePaths.map(A=>({...A,path:ke(A.dir)}))),E=J(()=>{const A=ke(f.value);return b.value.find(F=>F.path===A)}),S=async()=>{const A=E.value;if(A){if(!A.can_delete)return;await ui(f.value),Z.success(j("removeComplete"))}else await ci(f.value),Z.success(j("addComplete"));Et.emit("searchIndexExpired"),Et.emit("updateGlobalSetting")},P=Q(!1),T=Q(f.value),I=()=>{P.value=!0,T.value=f.value},B=async()=>{await g(T.value),P.value=!1};ve("click",()=>{P.value=!1});const O=()=>{const A=parent.location,$=A.href.substring(0,A.href.length-A.search.length),F=new URLSearchParams(A.search);F.set("action","open"),F.set("path",f.value);const K=`${$}?${F.toString()}`;xe(K,j("copyLocationUrlSuccessMsg"))},x=()=>{console.log(`select all 0 -> ${w.value.length}`),C.value=en(0,w.value.length)};return c.value("selectAll",x),{locInputValue:T,isLocationEditing:P,onLocEditEnter:B,onEditBtnClick:I,addToSearchScanPathAndQuickMove:S,searchPathInfo:E,refresh:u,copyLocation:s,back:a,openNext:l,currPage:d,currLocation:f,to:g,stack:r,scroller:n,share:O,selectAll:x,quickMoveTo:o,onCreateFloderBtnClick:async()=>{await yr(f.value),await u()}}}function ba(e){const{scroller:t,sortedFiles:n,stack:i,sortMethod:r,currLocation:d,currPage:f,stackViewEl:h,canLoadNext:c,previewIdx:y}=ae().toRefs(),{state:k}=ae(),C=Q(!1),w=Q(D.defaultGridCellWidth),m=J(()=>w.value+16),s=44,{width:l}=Tn(h),a=J(()=>~~(l.value/m.value)),v=J(()=>{const E=m.value;return{first:E+(w.value<=160?0:s),second:E}}),g=Q(!1),u=async()=>{var E;if(!(g.value||!e.walkModePath||!c.value))try{g.value=!0;const S=i.value[i.value.length-2],P=me(S.files,r.value),T=P.findIndex(I=>{var B;return I.name===((B=f.value)==null?void 0:B.curr)});if(T!==-1){const I=P[T+1],B=Me(d.value,"../",I.name),O=await he(B),x=f.value;x.curr=I.name,x.walkFiles||(x.walkFiles=[x.files]),x.walkFiles.push(O.files),console.log("curr page files length",(E=f.value)==null?void 0:E.files.length)}}catch(S){console.error("loadNextDir",S),c.value=!1}finally{g.value=!1}},o=async(E=!1)=>{const S=t.value,P=()=>E?y.value:(S==null?void 0:S.$_endIndex)??0;for(;!n.value.length||P()>n.value.length-20&&c.value;)await it(100),await u()};k.useEventListen("loadNextDir",o);const b=fe(()=>o(),300);return{gridItems:a,sortedFiles:n,sortMethodConv:Bn,moreActionsDropdownShow:C,gridSize:m,sortMethod:r,onScroll:b,loadNextDir:u,loadNextDirLoading:g,canLoadNext:c,itemSize:v,cellWidth:w}}function wa(){const{currLocation:e,sortedFiles:t,currPage:n,multiSelectedIdxs:i,eventEmitter:r}=ae().toRefs(),d=()=>{i.value=[]};return ve("click",d),ve("blur",d),ge(n,d),{onFileDragStart:(y,k)=>{const C=Wt(t.value[k]);Bt.fileDragging=!0,console.log("onFileDragStart set drag file ",y,k,C);const w=[C];let m=C.type==="dir";if(i.value.includes(k)){const l=i.value.map(a=>t.value[a]);w.push(...l),m=l.some(a=>a.type==="dir")}const s={includeDir:m,loc:e.value||"search-result",path:kt(w,"fullpath").map(l=>l.fullpath),nodes:kt(w,"fullpath"),__id:"FileTransferData"};y.dataTransfer.setData("text/plain",JSON.stringify(s))},onDrop:async y=>{const k=Qn(y);if(!k)return;const C=e.value;if(k.loc===C)return;const w=ze(),m=async()=>w.pushAction(async()=>{await pr(k.path,C),r.value.emit("refresh"),ce.destroyAll()}),s=()=>w.pushAction(async()=>{await nn(k.path,C),Ce.emit("removeFiles",{paths:k.path,loc:k.loc}),r.value.emit("refresh"),ce.destroyAll()});ce.confirm({title:j("confirm")+"?",width:"60vw",content:()=>{let l,a,v;return p("div",null,[p("div",null,[`${j("moveSelectedFilesTo")}${C}`,p("ol",{style:{maxHeight:"50vh",overflow:"auto"}},[k.path.map(g=>p("li",null,[g.split(/[/\\]/).pop()]))])]),p(an,null,null),p("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end"},class:"actions"},[p(le,{onClick:ce.destroyAll},Qe(l=j("cancel"))?l:{default:()=>[l]}),p(le,{type:"primary",loading:!w.isIdle,onClick:m},Qe(a=j("copy"))?a:{default:()=>[a]}),p(le,{type:"primary",loading:!w.isIdle,onClick:s},Qe(v=j("move"))?v:{default:()=>[v]})])])},maskClosable:!0,wrapClassName:"hidden-antd-btns-modal"})},multiSelectedIdxs:i,onFileDragEnd:()=>{Bt.fileDragging=!1}}}function Sa(e,{openNext:t}){const n=Q(!1),i=Q(""),{sortedFiles:r,previewIdx:d,multiSelectedIdxs:f,stack:h,currLocation:c,spinning:y,previewing:k,stackViewEl:C,eventEmitter:w}=ae().toRefs(),m=ke;Re("removeFiles",({paths:g,loc:u})=>{if(m(u)!==m(c.value))return;const o=de(h.value);o&&(o.files=o.files.filter(b=>!g.includes(b.fullpath)),o.walkFiles&&(o.walkFiles=o.walkFiles.map(b=>b.filter(E=>!g.includes(E.fullpath)))))}),Re("addFiles",({files:g,loc:u})=>{if(m(u)!==m(c.value))return;const o=de(h.value);o&&o.files.unshift(...g)});const s=ze(),l=async(g,u,o)=>{d.value=o,D.fullscreenPreviewInitialUrl=ie(u);const b=f.value.indexOf(o);if(g.shiftKey){if(b!==-1)f.value.splice(b,1);else{f.value.push(o),f.value.sort((P,T)=>P-T);const E=f.value[0],S=f.value[f.value.length-1];f.value=en(E,S+1)}g.stopPropagation()}else g.ctrlKey||g.metaKey?(b!==-1?f.value.splice(b,1):f.value.push(o),g.stopPropagation()):await t(u)},a=async(g,u,o)=>{var T,I,B;const b=ie(u),E=c.value,S=()=>{let O=[];return f.value.includes(o)?O=f.value.map(x=>r.value[x]):O.push(u),O},P=async O=>{if(!y.value)try{y.value=!0,await Un(u.fullpath),Ee.postMessage(JSON.stringify({event:"click_hidden_button",btnEleId:"iib_hidden_img_update_trigger"}));const x=setTimeout(()=>Hn.warn({message:j("long_loading"),duration:20}),5e3);await Wn(),clearTimeout(x),Ee.postMessage(JSON.stringify({event:"click_hidden_button",btnEleId:`iib_hidden_tab_${O}`}))}catch(x){console.error(x),Z.error("发送图像失败,请携带console的错误消息找开发者")}finally{y.value=!1}};if(`${g.key}`.startsWith("toggle-tag-")){const O=+`${g.key}`.split("toggle-tag-")[1],{is_remove:x}=await di({tag_id:O,img_path:u.fullpath}),U=(I=(T=D.conf)==null?void 0:T.all_custom_tags.find(A=>A.id===O))==null?void 0:I.name;Z.success(j(x?"removedTagFromImage":"addedTagToImage",{tag:U}));return}switch(g.key){case"previewInNewWindow":return window.open(b);case"download":return window.open(ie(u,!0));case"copyPreviewUrl":return xe(parent.document.location.origin+b);case"send2txt2img":return P("txt2img");case"send2img2img":return P("img2img");case"send2inpaint":return P("inpaint");case"send2extras":return P("extras");case"send2savedDir":{const O=D.quickMovePaths.find(A=>A.key==="outdir_save");if(!O)return Z.error(j("unknownSavedDir"));const x=Vn(O.dir,(B=D.conf)==null?void 0:B.sd_cwd),U=S();await nn(U.map(A=>A.fullpath),x,!0),Ce.emit("removeFiles",{paths:U.map(A=>A.fullpath),loc:c.value}),Ce.emit("addFiles",{files:U,loc:x});break}case"send2controlnet-img2img":case"send2controlnet-txt2img":{const O=g.key.split("-")[1];Ee.postMessage(JSON.stringify({event:"send_to_control_net",type:O,url:ie(u)}));break}case"send2outpaint":{i.value=await s.pushAction(()=>Je(u.fullpath)).res;const[O,x]=(i.value||"").split(`
|
||
`);Ee.postMessage(JSON.stringify({event:"send_to_outpaint",url:ie(u),prompt:O,negPrompt:x.slice(17)}));break}case"openWithWalkMode":{je.set(E,h.value);const O=D.tabList[e.tabIdx],x={type:"local",key:we(),path:u.fullpath,name:j("local"),stackKey:E,walkModePath:u.fullpath};O.panes.push(x),O.key=x.key;break}case"openInNewTab":{je.set(E,h.value);const O=D.tabList[e.tabIdx],x={type:"local",key:we(),path:u.fullpath,name:j("local"),stackKey:E};O.panes.push(x),O.key=x.key;break}case"openOnTheRight":{je.set(E,h.value);let O=D.tabList[e.tabIdx+1];O||(O={panes:[],key:"",id:we()},D.tabList[e.tabIdx+1]=O);const x={type:"local",key:we(),path:u.fullpath,name:j("local"),stackKey:E};O.panes.push(x),O.key=x.key;break}case"viewGenInfo":{n.value=!0,i.value=await s.pushAction(()=>Je(u.fullpath)).res;break}case"openWithLocalFileBrowser":{await jn(u.fullpath);break}case"deleteFiles":{const O=S();await new Promise(x=>{ce.confirm({title:j("confirmDelete"),maskClosable:!0,width:"60vw",content:p("div",null,[p("ol",{style:{maxHeight:"50vh",overflow:"auto"}},[O.map(U=>p("li",null,[U.fullpath.split(/[/\\]/).pop()]))]),p(an,null,null)]),async onOk(){const U=O.map(A=>A.fullpath);await vr(U),Z.success(j("deleteSuccess")),Ce.emit("removeFiles",{paths:U,loc:c.value}),x()}})});break}}return{}},{isOutside:v}=Fn(C);return ve("keydown",g=>{var o,b,E;const u=fi(g);if(k.value){const S=(o=Object.entries(D.shortcut).find(P=>P[1]===u&&P[1]))==null?void 0:o[0];if(S){g.stopPropagation(),g.preventDefault();const P=d.value,T=r.value[P];switch(S){case"delete":return ie(T)===D.fullscreenPreviewInitialUrl?Z.warn(j("fullscreenRestriction")):a({key:"deleteFiles"},T,P);default:{const I=(b=/^toggle_tag_(.*)$/.exec(S))==null?void 0:b[1],B=(E=D.conf)==null?void 0:E.all_custom_tags.find(O=>O.name===I);return B?a({key:`toggle-tag-${B.id}`},T,P):void 0}}}}else!v.value&&["Ctrl + KeyA","Cmd + KeyA"].includes(u)&&(g.preventDefault(),g.stopPropagation(),w.value.emit("selectAll"))}),{onFileItemClick:l,onContextMenuClick:a,showGenInfo:n,imageGenInfo:i,q:s}}const Aa=()=>{const{stackViewEl:e}=ae().toRefs(),t=Q(-1);return Dn(e,n=>{var r;let i=n.target;for(;i.parentElement;)if(i=i.parentElement,i.tagName.toLowerCase()==="li"&&i.classList.contains("file-item-trigger")){const d=(r=i.dataset)==null?void 0:r.idx;d&&Number.isSafeInteger(+d)&&(t.value=+d);return}}),{showMenuIdx:t}};function br(){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 r=e.indexOf("Edge/");return r>0?parseInt(e.substring(r+5,e.indexOf(".",r)),10):-1}let Ie;function Ye(){Ye.init||(Ye.init=!0,Ie=br()!==-1)}var Te={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){Ye(),tt(()=>{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",Ie&&this.$el.appendChild(e),e.data="about:blank",Ie||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&&(!Ie&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const wr=Yn();Jn("data-v-b329ee4c");const Sr={class:"resize-observer",tabindex:"-1"};Rn();const Ar=wr((e,t,n,i,r,d)=>(M(),W("div",Sr)));Te.render=Ar;Te.__scopeId="data-v-b329ee4c";Te.__file="src/components/ResizeObserver.vue";function _e(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_e=function(t){return typeof t}:_e=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_e(e)}function Er(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ft(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 kr(e,t,n){return t&&Ft(e.prototype,t),n&&Ft(e,n),e}function Dt(e){return Or(e)||Cr(e)||Ir(e)||_r()}function Or(e){if(Array.isArray(e))return qe(e)}function Cr(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Ir(e,t){if(e){if(typeof e=="string")return qe(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 qe(e,t)}}function qe(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 _r(){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 Pr(e){var t;return typeof e=="function"?t={callback:e}:t=e,t}function xr(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,r,d,f=function(c){for(var y=arguments.length,k=new Array(y>1?y-1:0),C=1;C<y;C++)k[C-1]=arguments[C];if(d=k,!(i&&c===r)){var w=n.leading;typeof w=="function"&&(w=w(c,r)),(!i||c!==r)&&w&&e.apply(void 0,[c].concat(Dt(d))),r=c,clearTimeout(i),i=setTimeout(function(){e.apply(void 0,[c].concat(Dt(d))),i=0},t)}};return f._clear=function(){clearTimeout(i),i=null},f}function ln(e,t){if(e===t)return!0;if(_e(e)==="object"){for(var n in e)if(!ln(e[n],t[n]))return!1;return!0}return!1}var $r=function(){function e(t,n,i){Er(this,e),this.el=t,this.observer=null,this.frozen=!1,this.createObserver(n,i)}return kr(e,[{key:"createObserver",value:function(n,i){var r=this;if(this.observer&&this.destroyObserver(),!this.frozen){if(this.options=Pr(n),this.callback=function(h,c){r.options.callback(h,c),h&&r.options.once&&(r.frozen=!0,r.destroyObserver())},this.callback&&this.options.throttle){var d=this.options.throttleOptions||{},f=d.leading;this.callback=xr(this.callback,this.options.throttle,{leading:function(c){return f==="both"||f==="visible"&&c||f==="hidden"&&!c}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(h){var c=h[0];if(h.length>1){var y=h.find(function(C){return C.isIntersecting});y&&(c=y)}if(r.callback){var k=c.isIntersecting&&c.intersectionRatio>=r.threshold;if(k===r.oldResult)return;r.oldResult=k,r.callback(k,c)}},this.options.intersection),tt(function(){r.observer&&r.observer.observe(r.el)})}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&typeof this.options.intersection.threshold=="number"?this.options.intersection.threshold:0}}]),e}();function sn(e,t,n){var i=t.value;if(i)if(typeof IntersectionObserver>"u")console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var r=new $r(e,i,n);e._vue_visibilityState=r}}function Lr(e,t,n){var i=t.value,r=t.oldValue;if(!ln(i,r)){var d=e._vue_visibilityState;if(!i){on(e);return}d?d.createObserver(i,n):sn(e,{value:i},n)}}function on(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var Mr={beforeMount:sn,updated:Lr,unmounted:on},Nr={itemsLimit:1e3},zr=/(auto|scroll)/;function un(e,t){return e.parentNode===null?t:un(e.parentNode,t.concat([e]))}var Ve=function(t,n){return getComputedStyle(t,null).getPropertyValue(n)},Tr=function(t){return Ve(t,"overflow")+Ve(t,"overflow-y")+Ve(t,"overflow-x")},Br=function(t){return zr.test(Tr(t))};function Qt(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var t=un(e.parentNode,[]),n=0;n<t.length;n+=1)if(Br(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 Fr={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 Dr(){return this.items.length&&Ke(this.items[0])!=="object"}var Ge=!1;if(typeof window<"u"){Ge=!1;try{var Qr=Object.defineProperty({},"passive",{get:function(){Ge=!0}});window.addEventListener("test",null,Qr)}catch{}}let jr=0;var cn={name:"RecycleScroller",components:{ResizeObserver:Te},directives:{ObserveVisibility:Mr},props:{...Fr,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 r=1e4,d=0,f;for(let h=0,c=t.length;h<c;h++)f=t[h][n]||i,f<r&&(r=f),d+=f,e[h]={accumulator:d,size:f};return this.$_computedMinItemSize=r,e}return[]},simpleArray:Dr,itemIndexByKey(){const{keyField:e,items:t}=this,n={};for(let i=0,r=t.length;i<r;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,r){const d=qn({id:jr++,index:t,used:!0,key:i,type:r}),f=Kn({item:n,position:0,nr:d});return e.push(f),f},unuseView(e,t=!1){const n=this.$_unusedViews,i=e.nr.type;let r=n.get(i);r||(r=[],n.set(i,r)),r.push(e),t||(e.nr.used=!1,e.position=-9999)},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(e){if(!this.$_scrollDirty){if(this.$_scrollDirty=!0,this.$_updateTimeout)return;const t=()=>requestAnimationFrame(()=>{this.$_scrollDirty=!1;const{continuous:n}=this.updateVisibleItems(!1,!0);n||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,this.updateInterval+100))});t(),this.updateInterval&&(this.$_updateTimeout=setTimeout(()=>{this.$_updateTimeout=0,this.$_scrollDirty&&t()},this.updateInterval))}},handleVisibilityChange(e,t){this.ready&&(e||t.boundingClientRect.width!==0||t.boundingClientRect.height!==0?(this.$emit("visible"),requestAnimationFrame(()=>{this.updateVisibleItems(!1)})):this.$emit("hidden"))},updateVisibleItems(e,t=!1){const n=this.itemSize,i=this.gridItems||1,r=this.itemSecondarySize||n,d=this.$_computedMinItemSize,f=this.typeField,h=this.simpleArray?null:this.keyField,c=this.items,y=c.length,k=this.sizes,C=this.$_views,w=this.$_unusedViews,m=this.pool,s=this.itemIndexByKey;let l,a,v,g,u;if(!y)l=a=g=u=v=0;else if(this.$_prerender)l=g=0,a=u=Math.min(this.prerender,c.length),v=null;else{const I=this.getScroll();if(t){let x=I.start-this.$_lastUpdateScrollPosition;if(x<0&&(x=-x),n===null&&x<d||x<n)return{continuous:!0}}this.$_lastUpdateScrollPosition=I.start;const B=this.buffer;I.start-=B,I.end+=B;let O=0;if(this.$refs.before&&(O=this.$refs.before.scrollHeight,I.start-=O),this.$refs.after){const x=this.$refs.after.scrollHeight;I.end+=x}if(n===null){let x,U=0,A=y-1,$=~~(y/2),F;do F=$,x=k[$].accumulator,x<I.start?U=$:$<y-1&&k[$+1].accumulator>I.start&&(A=$),$=~~((U+A)/2);while($!==F);for($<0&&($=0),l=$,v=k[y-1].accumulator,a=$;a<y&&k[a].accumulator<I.end;a++);for(a===-1?a=c.length-1:(a++,a>y&&(a=y)),g=l;g<y&&O+k[g].accumulator<I.start;g++);for(u=g;u<y&&O+k[u].accumulator<I.end;u++);}else{l=~~(I.start/n*i);const x=l%i;l-=x,a=Math.ceil(I.end/n*i),g=Math.max(0,Math.floor((I.start-O)/n*i)),u=Math.floor((I.end-O)/n*i),l<0&&(l=0),a>y&&(a=y),g<0&&(g=0),u>y&&(u=y),v=Math.ceil(y/i)*n}}a-l>Nr.itemsLimit&&this.itemsLimitError(),this.totalSize=v;let o;const b=l<=this.$_endIndex&&a>=this.$_startIndex;if(b)for(let I=0,B=m.length;I<B;I++)o=m[I],o.nr.used&&(e&&(o.nr.index=s[o.item[h]]),(o.nr.index==null||o.nr.index<l||o.nr.index>=a)&&this.unuseView(o));const E=b?null:new Map;let S,P,T;for(let I=l;I<a;I++){S=c[I];const B=h?S[h]:S;if(B==null)throw new Error(`Key is ${B} on item (keyField is '${h}')`);if(o=C.get(B),!n&&!k[I].size){o&&this.unuseView(o);continue}P=S[f];let O=w.get(P),x=!1;if(!o)b?O&&O.length?o=O.pop():o=this.addView(m,I,S,B,P):(T=E.get(P)||0,(!O||T>=O.length)&&(o=this.addView(m,I,S,B,P),this.unuseView(o,!0),O=w.get(P)),o=O[T],E.set(P,T+1)),C.delete(o.nr.key),o.nr.used=!0,o.nr.index=I,o.nr.key=B,o.nr.type=P,C.set(B,o),x=!0;else if(!o.nr.used&&(o.nr.used=!0,o.nr.index=I,x=!0,O)){const U=O.indexOf(o);U!==-1&&O.splice(U,1)}o.item=S,x&&(I===c.length-1&&this.$emit("scroll-end"),I===0&&this.$emit("scroll-start")),n===null?(o.position=k[I-1].accumulator,o.offset=0):(o.position=Math.floor(I/i)*n,o.offset=I%i*r)}return this.$_startIndex=l,this.$_endIndex=a,this.emitUpdate&&this.$emit("update",l,a,g,u),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:b}},getListenerTarget(){let e=Qt(this.$el);return window.document&&(e===window.document.documentElement||e===window.document.body)&&(e=window),e},getScroll(){const{$el:e,direction:t}=this,n=t==="vertical";let i;if(this.pageMode){const r=e.getBoundingClientRect(),d=n?r.height:r.width;let f=-(n?r.top:r.left),h=n?window.innerHeight:window.innerWidth;f<0&&(h+=f,f=0),f+h>d&&(h=d-f),i={start:f,end:f+h}}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,Ge?{passive:!0}:!1),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem(e){let t;const n=this.gridItems||1;this.itemSize===null?t=e>0?this.sizes[e-1].accumulator:0:t=Math.floor(e/n)*this.itemSize,this.scrollToPosition(t)},scrollToPosition(e){const t=this.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let n,i,r;if(this.pageMode){const d=Qt(this.$el),f=d.tagName==="HTML"?0:d[t.scroll],h=d.getBoundingClientRect(),y=this.$el.getBoundingClientRect()[t.start]-h[t.start];n=d,i=t.scroll,r=e+f+y}else n=this.$el,i=t.scroll,r=e;n[i]=r},itemsLimitError(){throw setTimeout(()=>{console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",this.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")},sortViews(){this.pool.sort((e,t)=>e.nr.index-t.nr.index)}}};const Vr={key:0,ref:"before",class:"vue-recycle-scroller__slot"},Ur={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function Hr(e,t,n,i,r,d){const f=Gn("ResizeObserver"),h=Xn("observe-visibility");return Zn((M(),V("div",{class:ye(["vue-recycle-scroller",{ready:r.ready,"page-mode":n.pageMode,[`direction-${e.direction}`]:!0}]),onScrollPassive:t[0]||(t[0]=(...c)=>d.handleScroll&&d.handleScroll(...c))},[e.$slots.before?(M(),V("div",Vr,[Se(e.$slots,"before")],512)):q("v-if",!0),(M(),W(Ot(n.listTag),{ref:"wrapper",style:ni({[e.direction==="vertical"?"minHeight":"minWidth"]:r.totalSize+"px"}),class:ye(["vue-recycle-scroller__item-wrapper",n.listClass])},{default:_(()=>[(M(!0),V(re,null,$e(r.pool,c=>(M(),W(Ot(n.itemTag),ei({key:c.nr.id,style:r.ready?{transform:`translate${e.direction==="vertical"?"Y":"X"}(${c.position}px) translate${e.direction==="vertical"?"X":"Y"}(${c.offset}px)`,width:n.gridItems?`${e.direction==="vertical"&&n.itemSecondarySize||n.itemSize}px`:void 0,height:n.gridItems?`${e.direction==="horizontal"&&n.itemSecondarySize||n.itemSize}px`:void 0}:null,class:["vue-recycle-scroller__item-view",[n.itemClass,{hover:!n.skipHover&&r.hoverKey===c.nr.key}]]},ti(n.skipHover?{}:{mouseenter:()=>{r.hoverKey=c.nr.key},mouseleave:()=>{r.hoverKey=null}})),{default:_(()=>[Se(e.$slots,"default",{item:c.item,index:c.nr.index,active:c.nr.used})]),_:2},1040,["style","class"]))),128)),Se(e.$slots,"empty")]),_:3},8,["style","class"])),e.$slots.after?(M(),V("div",Ur,[Se(e.$slots,"after")],512)):q("v-if",!0),p(f,{onNotify:d.handleResize},null,8,["onNotify"])],34)),[[h,d.handleVisibilityChange]])}cn.render=Hr;cn.__file="src/components/RecycleScroller.vue";const Xe=pe({__name:"ContextMenu",props:{file:{},idx:{},selectedTag:{},disableDelete:{type:Boolean}},emits:["contextMenuClick"],setup(e,{emit:t}){const n=e,i=Ne(),r=J(()=>{var d;return(((d=i.conf)==null?void 0:d.all_custom_tags)??[]).reduce((f,h)=>[...f,{...h,selected:!!n.selectedTag.find(c=>c.id===h.id)}],[])});return(d,f)=>{const h=Jt,c=ii,y=Rt,k=Yt;return M(),W(k,{onClick:f[0]||(f[0]=C=>t("contextMenuClick",C,d.file,d.idx))},{default:_(()=>{var C;return[p(h,{key:"deleteFiles",disabled:d.disableDelete},{default:_(()=>[N(L(d.$t("deleteSelected")),1)]),_:1},8,["disabled"]),d.file.type==="dir"?(M(),V(re,{key:0},[p(h,{key:"openInNewTab"},{default:_(()=>[N(L(d.$t("openInNewTab")),1)]),_:1}),p(h,{key:"openOnTheRight"},{default:_(()=>[N(L(d.$t("openOnTheRight")),1)]),_:1}),p(h,{key:"openWithWalkMode"},{default:_(()=>[N(L(d.$t("openWithWalkMode")),1)]),_:1})],64)):q("",!0),d.file.type==="file"?(M(),V(re,{key:1},[z(X)(d.file.name)?(M(),V(re,{key:0},[p(h,{key:"viewGenInfo"},{default:_(()=>[N(L(d.$t("viewGenerationInfo")),1)]),_:1}),p(c),((C=z(i).conf)==null?void 0:C.launch_mode)!=="server"?(M(),V(re,{key:0},[p(h,{key:"send2txt2img"},{default:_(()=>[N(L(d.$t("sendToTxt2img")),1)]),_:1}),p(h,{key:"send2img2img"},{default:_(()=>[N(L(d.$t("sendToImg2img")),1)]),_:1}),p(h,{key:"send2inpaint"},{default:_(()=>[N(L(d.$t("sendToInpaint")),1)]),_:1}),p(h,{key:"send2extras"},{default:_(()=>[N(L(d.$t("sendToExtraFeatures")),1)]),_:1}),p(y,{key:"sendToThirdPartyExtension",title:d.$t("sendToThirdPartyExtension")},{default:_(()=>[p(h,{key:"send2controlnet-txt2img"},{default:_(()=>[N("ControlNet - "+L(d.$t("t2i")),1)]),_:1}),p(h,{key:"send2controlnet-img2img"},{default:_(()=>[N("ControlNet - "+L(d.$t("i2i")),1)]),_:1}),p(h,{key:"send2outpaint"},{default:_(()=>[N("Outpaint")]),_:1})]),_:1},8,["title"])],64)):q("",!0),p(h,{key:"send2savedDir"},{default:_(()=>[N(L(d.$t("send2savedDir")),1)]),_:1}),p(c),p(y,{key:"toggle-tag",title:d.$t("toggleTag")},{default:_(()=>[(M(!0),V(re,null,$e(r.value,w=>(M(),W(h,{key:`toggle-tag-${w.id}`},{default:_(()=>[N(L(w.name)+" ",1),w.selected?(M(),W(z(Zt),{key:0})):(M(),W(z(tn),{key:1}))]),_:2},1024))),128))]),_:1},8,["title"]),p(h,{key:"openWithLocalFileBrowser"},{default:_(()=>[N(L(d.$t("openWithLocalFileBrowser")),1)]),_:1})],64)):q("",!0),p(h,{key:"previewInNewWindow"},{default:_(()=>[N(L(d.$t("previewInNewWindow")),1)]),_:1}),p(h,{key:"download"},{default:_(()=>[N(L(d.$t("download")),1)]),_:1}),p(h,{key:"copyPreviewUrl"},{default:_(()=>[N(L(d.$t("copySourceFilePreviewLink")),1)]),_:1})],64)):q("",!0)]}),_:1})}}}),Wr=["data-idx"],Jr={class:"more"},Rr={key:1,class:"preview-icon-wrap"},Yr={key:2,class:"profile"},qr={class:"name line-clamp-1"},Kr={class:"basic-info"},Gr=pe({__name:"FileItem",props:{file:{},idx:{},selected:{type:Boolean,default:!1},showMenuIdx:{},cellWidth:{},fullScreenPreviewImageUrl:{}},emits:["update:showMenuIdx","fileItemClick","dragstart","dragend","previewVisibleChange","contextMenuClick"],setup(e,{emit:t}){const n=e;ri(c=>({"0ff688b3":c.$props.cellWidth+"px"}));const i=Ne(),r=Q([]),d=()=>{var c;((c=n==null?void 0:n.file)==null?void 0:c.type)==="file"&&f.pushAction(()=>Kt(n.file.fullpath)).res.then(y=>{r.value=y})},f=ze(),h=J(()=>{const c=i.gridThumbnailResolution;return i.enableThumbnail?ai(n.file,[c,c].join("x")):ie(n.file)});return(c,y)=>{const k=se,C=li;return M(),W(k,{trigger:["contextmenu"],visible:z(i).longPressOpenContextMenu?typeof c.idx=="number"&&c.showMenuIdx===c.idx:void 0,"onUpdate:visible":y[5]||(y[5]=w=>typeof c.idx=="number"&&t("update:showMenuIdx",w?c.idx:-1))},{overlay:_(()=>[p(Xe,{file:c.file,idx:c.idx,"selected-tag":r.value,onContextMenuClick:y[4]||(y[4]=(w,m,s)=>t("contextMenuClick",w,m,s))},null,8,["file","idx","selected-tag"])]),default:_(()=>[(M(),V("li",{class:ye(["file file-item-trigger grid",{clickable:c.file.type==="dir",selected:c.selected}]),"data-idx":c.idx,key:c.file.name,draggable:"true",onDragstart:y[1]||(y[1]=w=>t("dragstart",w,c.idx)),onDragend:y[2]||(y[2]=w=>t("dragend",w,c.idx)),onContextmenu:d,onClickCapture:y[3]||(y[3]=w=>t("fileItemClick",w,c.file,c.idx))},[Y("div",null,[p(k,null,{overlay:_(()=>[p(Xe,{file:c.file,idx:c.idx,"selected-tag":r.value,onContextMenuClick:y[0]||(y[0]=(w,m,s)=>t("contextMenuClick",w,m,s))},null,8,["file","idx","selected-tag"])]),default:_(()=>[Y("div",Jr,[p(z(et))])]),_:1}),z(X)(c.file.name)?(M(),W(C,{key:c.file.fullpath,class:ye(`idx-${c.idx}`),src:h.value,fallback:z(Ti),preview:{src:c.fullScreenPreviewImageUrl,onVisibleChange:(w,m)=>t("previewVisibleChange",w,m)}},null,8,["class","src","fallback","preview"])):(M(),V("div",Rr,[c.file.type==="file"?(M(),W(z(Oi),{key:0,class:"icon center"})):(M(),W(z(Pi),{key:1,class:"icon center"}))])),c.cellWidth>128?(M(),V("div",Yr,[Y("div",qr,L(c.file.name),1),Y("div",Kr,[Y("div",null,L(c.file.size),1),Y("div",null,L(c.file.date),1)])])):q("",!0)])],42,Wr))]),_:1},8,["visible"])}}});const Ea=qt(Gr,[["__scopeId","data-v-9824eb37"]]);function Xr(e,t,n,i){const r={x:0,y:0};let d=0,f=0,h=typeof(i==null?void 0:i.width)=="number"?i.width:0,c=typeof(i==null?void 0:i.height)=="number"?i.height:0,y=typeof(i==null?void 0:i.left)=="number"?i.left:0,k=typeof(i==null?void 0:i.top)=="number"?i.top:0,C=!1;const w=u=>{u.stopPropagation(),u.preventDefault(),!(!e.value||!t.value)&&(d=u instanceof MouseEvent?u.clientX:u.touches[0].clientX,f=u instanceof MouseEvent?u.clientY:u.touches[0].clientY,h=e.value.offsetWidth,c=e.value.offsetHeight,r.x=t.value.offsetLeft,r.y=t.value.offsetTop,document.documentElement.addEventListener("mousemove",m),document.documentElement.addEventListener("touchmove",m),document.documentElement.addEventListener("mouseup",s),document.documentElement.addEventListener("touchend",s))},m=u=>{if(!e.value||!t.value)return;let o=h+((u instanceof MouseEvent?u.clientX:u.touches[0].clientX)-d),b=c+((u instanceof MouseEvent?u.clientY:u.touches[0].clientY)-f),E=r.x+((u instanceof MouseEvent?u.clientX:u.touches[0].clientX)-d),S=r.y+((u instanceof MouseEvent?u.clientY:u.touches[0].clientY)-f);E+t.value.offsetWidth>window.innerWidth&&(E=window.innerWidth-t.value.offsetWidth),e.value.offsetLeft+o>window.innerWidth&&(o=window.innerWidth-e.value.offsetLeft),S+t.value.offsetHeight>window.innerHeight&&(S=window.innerHeight-t.value.offsetHeight),e.value.offsetTop+b>window.innerHeight&&(b=window.innerHeight-e.value.offsetTop),e.value.style.width=`${o}px`,e.value.style.height=`${b}px`,t.value.style.left=`${E}px`,t.value.style.top=`${S}px`,i!=null&&i.onResize&&i.onResize(o,b)},s=()=>{document.documentElement.removeEventListener("mousemove",m),document.documentElement.removeEventListener("touchmove",m),document.documentElement.removeEventListener("mouseup",s),document.documentElement.removeEventListener("touchend",s)},l=u=>{u.stopPropagation(),u.preventDefault(),!(!e.value||!n.value)&&(C=!0,y=e.value.offsetLeft,k=e.value.offsetTop,d=u instanceof MouseEvent?u.clientX:u.touches[0].clientX,f=u instanceof MouseEvent?u.clientY:u.touches[0].clientY,document.documentElement.addEventListener("mousemove",a),document.documentElement.addEventListener("touchmove",a),document.documentElement.addEventListener("mouseup",v),document.documentElement.addEventListener("touchend",v))},a=u=>{if(!e.value||!n.value||!C)return;const o=y+((u instanceof MouseEvent?u.clientX:u.touches[0].clientX)-d),b=k+((u instanceof MouseEvent?u.clientY:u.touches[0].clientY)-f);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`,b<0?e.value.style.top="0px":b+e.value.offsetHeight>window.innerHeight?e.value.style.top=`${window.innerHeight-e.value.offsetHeight}px`:e.value.style.top=`${b}px`,i!=null&&i.onDrag&&i.onDrag(o,b)},v=()=>{C=!1,document.documentElement.removeEventListener("mousemove",a),document.documentElement.removeEventListener("touchmove",a),document.documentElement.removeEventListener("mouseup",v),document.documentElement.removeEventListener("touchend",v)},g=()=>{if(!e.value||!t.value)return;let u=e.value.offsetLeft,o=e.value.offsetTop,b=e.value.offsetWidth,E=e.value.offsetHeight;u+b>window.innerWidth&&(u=window.innerWidth-b,u<0&&(u=0,b=window.innerWidth)),o+E>window.innerHeight&&(o=window.innerHeight-E,o<0&&(o=0,E=window.innerHeight)),e.value.style.left=`${u}px`,e.value.style.top=`${o}px`,e.value.style.width=`${b}px`,e.value.style.height=`${E}px`};return Ht(()=>{!e.value||!i||(typeof i.width=="number"&&(e.value.style.width=`${i.width}px`),typeof i.height=="number"&&(e.value.style.height=`${i.height}px`),typeof i.left=="number"&&(e.value.style.left=`${i.left}px`),typeof i.top=="number"&&(e.value.style.top=`${i.top}px`),g(),window.addEventListener("resize",g))}),nt(()=>{document.documentElement.removeEventListener("mousemove",m),document.documentElement.removeEventListener("touchmove",m),document.documentElement.removeEventListener("mouseup",s),document.documentElement.removeEventListener("touchend",s),document.documentElement.removeEventListener("mousemove",a),document.documentElement.removeEventListener("touchmove",a),document.documentElement.removeEventListener("mouseup",v),document.documentElement.removeEventListener("touchend",v),window.removeEventListener("resize",g)}),ge(()=>[e.value,t.value,n.value],([u,o,b])=>{u&&o&&(o.addEventListener("mousedown",w),o.addEventListener("touchstart",w)),u&&b&&(b.addEventListener("mousedown",l),b.addEventListener("touchstart",l))}),{handleResizeMouseDown:w,handleDragMouseDown:l}}const Zr={class:"container"},ea={class:"action-bar"},ta={key:0,class:"icon",style:{cursor:"pointer"}},na={key:0,"flex-placeholder":""},ia={key:1,class:"action-bar"},ra={key:0,class:"gen-info"},aa={class:"tags"},la={class:"name"},sa={class:"value"},oa=pe({__name:"fullScreenContextMenu",props:{file:{},idx:{}},emits:["contextMenuClick"],setup(e,{emit:t}){const n=e,i=Ne(),r=Q(),d=Q([]),f=J(()=>{var a;return(((a=i.conf)==null?void 0:a.all_custom_tags)??[]).reduce((v,g)=>[...v,{...g,selected:!!d.value.find(u=>u.id===g.id)}],[])}),h=Q(""),c=ze(),y=Q("");ge(()=>{var a;return(a=n==null?void 0:n.file)==null?void 0:a.fullpath},async a=>{a&&(c.tasks.forEach(v=>v.cancel()),c.pushAction(()=>Je(a)).res.then(v=>{y.value=v}))},{immediate:!0});const k=a=>{a&&c.pushAction(()=>Kt(n.file.fullpath)).res.then(v=>{d.value=v})},C=Q(),w=Q(),m=si("fullScreenContextMenu.vue-drag",{left:100,top:100,width:512,height:384,expanded:!0});Xr(r,C,w,{...m.value,onDrag:fe(function(a,v){m.value={...m.value,left:a,top:v}},300),onResize:fe(function(a,v){m.value={...m.value,width:a,height:v}},300)});function s(a){return a.parentNode}ve("load",a=>{const v=a.target;v.className==="ant-image-preview-img"&&(h.value=`${v.naturalWidth} x ${v.naturalHeight}`)},{capture:!0});const l=J(()=>{const a=[{name:j("fileName"),val:n.file.name},{name:j("fileSize"),val:n.file.size}];return h.value&&a.push({name:j("resolution"),val:h.value}),a});return(a,v)=>{const g=se,u=le,o=Jt,b=Yt,E=Rt;return M(),V("div",{ref_key:"el",ref:r,class:ye(["full-screen-menu",{"unset-size":!z(m).expanded}]),onWheelCapture:v[5]||(v[5]=oi(()=>{},["stop"]))},[Y("div",Zr,[Y("div",ea,[Y("div",{ref_key:"dragHandle",ref:w,class:"icon",style:{cursor:"grab"}},[p(z(qi))],512),Y("div",{class:"icon",style:{cursor:"pointer"},onClick:v[0]||(v[0]=S=>z(m).expanded=!z(m).expanded)},[z(m).expanded?(M(),W(z(Zi),{key:0})):(M(),W(z(ir),{key:1}))]),p(g,{onVisibleChange:k,"get-popup-container":s},{overlay:_(()=>[p(Xe,{file:a.file,idx:a.idx,"selected-tag":d.value,"disable-delete":z(ie)(a.file)===z(i).fullscreenPreviewInitialUrl,onContextMenuClick:v[1]||(v[1]=(S,P,T)=>t("contextMenuClick",S,P,T))},null,8,["file","idx","selected-tag","disable-delete"])]),default:_(()=>[z(m).expanded?q("",!0):(M(),V("div",ta,[p(z(et))]))]),_:1}),z(m).expanded?(M(),V("div",na)):q("",!0),z(m).expanded?(M(),V("div",ia,[p(g,{trigger:["hover"],"get-popup-container":s,onVisibleChange:k},{overlay:_(()=>[p(b,{onClick:v[2]||(v[2]=S=>t("contextMenuClick",S,a.file,a.idx))},{default:_(()=>[(M(!0),V(re,null,$e(f.value,S=>(M(),W(o,{key:`toggle-tag-${S.id}`},{default:_(()=>[N(L(S.name)+" ",1),S.selected?(M(),W(z(Zt),{key:0})):(M(),W(z(tn),{key:1}))]),_:2},1024))),128))]),_:1})]),default:_(()=>[p(u,null,{default:_(()=>[N(L(a.$t("toggleTag")),1)]),_:1})]),_:1}),p(g,{trigger:["hover"],"get-popup-container":s},{overlay:_(()=>[p(b,{onClick:v[3]||(v[3]=S=>t("contextMenuClick",S,a.file,a.idx))},{default:_(()=>{var S;return[((S=z(i).conf)==null?void 0:S.launch_mode)!=="server"?(M(),V(re,{key:0},[p(o,{key:"send2txt2img"},{default:_(()=>[N(L(a.$t("sendToTxt2img")),1)]),_:1}),p(o,{key:"send2img2img"},{default:_(()=>[N(L(a.$t("sendToImg2img")),1)]),_:1}),p(o,{key:"send2inpaint"},{default:_(()=>[N(L(a.$t("sendToInpaint")),1)]),_:1}),p(o,{key:"send2extras"},{default:_(()=>[N(L(a.$t("sendToExtraFeatures")),1)]),_:1}),p(E,{key:"sendToThirdPartyExtension",title:a.$t("sendToThirdPartyExtension")},{default:_(()=>[p(o,{key:"send2controlnet-txt2img"},{default:_(()=>[N("ControlNet - "+L(a.$t("t2i")),1)]),_:1}),p(o,{key:"send2controlnet-img2img"},{default:_(()=>[N("ControlNet - "+L(a.$t("i2i")),1)]),_:1}),p(o,{key:"send2outpaint"},{default:_(()=>[N("Outpaint")]),_:1})]),_:1},8,["title"])],64)):q("",!0),p(o,{key:"send2savedDir"},{default:_(()=>[N(L(a.$t("send2savedDir")),1)]),_:1}),p(o,{key:"deleteFiles",disabled:z(ie)(a.file)===z(i).fullscreenPreviewInitialUrl},{default:_(()=>[N(L(a.$t("deleteSelected")),1)]),_:1},8,["disabled"]),p(o,{key:"previewInNewWindow"},{default:_(()=>[N(L(a.$t("previewInNewWindow")),1)]),_:1}),p(o,{key:"download"},{default:_(()=>[N(L(a.$t("download")),1)]),_:1}),p(o,{key:"copyPreviewUrl"},{default:_(()=>[N(L(a.$t("copySourceFilePreviewLink")),1)]),_:1})]}),_:1})]),default:_(()=>[p(u,null,{default:_(()=>[N(L(z(j)("openContextMenu")),1)]),_:1})]),_:1}),p(u,{onClick:v[4]||(v[4]=S=>z(xe)(y.value))},{default:_(()=>[N(L(a.$t("copyPrompt")),1)]),_:1})])):q("",!0)]),z(m).expanded?(M(),V("div",ra,[Y("div",aa,[(M(!0),V(re,null,$e(l.value,S=>(M(),V("span",{class:"tag",key:S.name},[Y("span",la,L(S.name),1),Y("span",sa,L(S.val),1)]))),128))]),N(" "+L(y.value),1)])):q("",!0)]),z(m).expanded?(M(),V("div",{key:0,class:"mouse-sensor",ref_key:"resizeHandle",ref:C},[p(z(ji))],512)):q("",!0)],34)}}});const ka=qt(oa,[["__scopeId","data-v-38c5e3f9"]]);export{se as D,ha as L,ma as R,pa as S,ya as a,ba as b,wa as c,Sa as d,ga as e,Aa as f,je as g,cn as h,Ea as i,ka as j,Re as k,va as s,ae as u};
|