276 lines
58 KiB
JavaScript
276 lines
58 KiB
JavaScript
import{dA as Ke,co as te,aj as n,d as Q,dB as Qe,ba as ve,bL as ke,b0 as kt,b1 as Et,dC as Bt,bx as U,b6 as b,dD as Ae,c3 as Dt,bT as Ut,bb as S,z as $,b8 as Mt,S as zt,dE as ye,dF as ue,aC as et,bM as ne,a as j,b7 as pe,bd as tt,bW as At,be as M,dG as Ft,cb as Fe,dH as jt,T as Re,U as he,dI as $t,H as Nt,a3 as Vt,cJ as Ht,dJ as Se,bV as Ee,dK as Zt,i as je,cy as Ie,cq as me,cx as Wt,bf as Xt,cM as ot,bN as Yt,B as le,dL as Gt,dM as qt,cA as Jt,by as V,dN as $e,bD as K,dO as Kt,dP as Qt,b9 as eo,bc as to,dQ as oo,bh as Ne,an as no,o as Be,b as nt,e as rt,c as ro,w as Te,f as Ve,g as io,t as ao,h as lo,$ as ge,aA as so,dR as uo,A as He}from"./index-D3rICic-.js";import{_ as co}from"./Progress-BRSG0yYs.js";import{f as it}from"./Grid-CRDcRyPk.js";function fo(e,t,o,r){for(var l=-1,i=e==null?0:e.length;++l<i;)o=t(o,e[l],l,e);return o}function ho(e){return function(t){return e==null?void 0:e[t]}}var go={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},vo=ho(go),po=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mo="\\u0300-\\u036f",wo="\\ufe20-\\ufe2f",bo="\\u20d0-\\u20ff",xo=mo+wo+bo,Co="["+xo+"]",yo=RegExp(Co,"g");function Ro(e){return e=Ke(e),e&&e.replace(po,vo).replace(yo,"")}var To=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function _o(e){return e.match(To)||[]}var Lo=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Oo(e){return Lo.test(e)}var at="\\ud800-\\udfff",So="\\u0300-\\u036f",Io="\\ufe20-\\ufe2f",Po="\\u20d0-\\u20ff",ko=So+Io+Po,lt="\\u2700-\\u27bf",st="a-z\\xdf-\\xf6\\xf8-\\xff",Eo="\\xac\\xb1\\xd7\\xf7",Bo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Do="\\u2000-\\u206f",Uo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",dt="A-Z\\xc0-\\xd6\\xd8-\\xde",Mo="\\ufe0e\\ufe0f",ut=Eo+Bo+Do+Uo,ct="['’]",Ze="["+ut+"]",zo="["+ko+"]",ft="\\d+",Ao="["+lt+"]",ht="["+st+"]",gt="[^"+at+ut+ft+lt+st+dt+"]",Fo="\\ud83c[\\udffb-\\udfff]",jo="(?:"+zo+"|"+Fo+")",$o="[^"+at+"]",vt="(?:\\ud83c[\\udde6-\\uddff]){2}",pt="[\\ud800-\\udbff][\\udc00-\\udfff]",ie="["+dt+"]",No="\\u200d",We="(?:"+ht+"|"+gt+")",Vo="(?:"+ie+"|"+gt+")",Xe="(?:"+ct+"(?:d|ll|m|re|s|t|ve))?",Ye="(?:"+ct+"(?:D|LL|M|RE|S|T|VE))?",mt=jo+"?",wt="["+Mo+"]?",Ho="(?:"+No+"(?:"+[$o,vt,pt].join("|")+")"+wt+mt+")*",Zo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Wo="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Xo=wt+mt+Ho,Yo="(?:"+[Ao,vt,pt].join("|")+")"+Xo,Go=RegExp([ie+"?"+ht+"+"+Xe+"(?="+[Ze,ie,"$"].join("|")+")",Vo+"+"+Ye+"(?="+[Ze,ie+We,"$"].join("|")+")",ie+"?"+We+"+"+Xe,ie+"+"+Ye,Wo,Zo,ft,Yo].join("|"),"g");function qo(e){return e.match(Go)||[]}function Jo(e,t,o){return e=Ke(e),t=t,t===void 0?Oo(e)?qo(e):_o(e):e.match(t)||[]}var Ko="['’]",Qo=RegExp(Ko,"g");function en(e){return function(t){return fo(Jo(Ro(t).replace(Qo,"")),e,"")}}var tn=en(function(e,t,o){return e+(o?"-":"")+t.toLowerCase()});const on=te("attach",n("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},n("g",{fill:"currentColor","fill-rule":"nonzero"},n("path",{d:"M3.25735931,8.70710678 L7.85355339,4.1109127 C8.82986412,3.13460197 10.4127766,3.13460197 11.3890873,4.1109127 C12.365398,5.08722343 12.365398,6.67013588 11.3890873,7.64644661 L6.08578644,12.9497475 C5.69526215,13.3402718 5.06209717,13.3402718 4.67157288,12.9497475 C4.28104858,12.5592232 4.28104858,11.9260582 4.67157288,11.5355339 L9.97487373,6.23223305 C10.1701359,6.0369709 10.1701359,5.72038841 9.97487373,5.52512627 C9.77961159,5.32986412 9.4630291,5.32986412 9.26776695,5.52512627 L3.96446609,10.8284271 C3.18341751,11.6094757 3.18341751,12.8758057 3.96446609,13.6568542 C4.74551468,14.4379028 6.01184464,14.4379028 6.79289322,13.6568542 L12.0961941,8.35355339 C13.4630291,6.98671837 13.4630291,4.77064094 12.0961941,3.40380592 C10.7293591,2.0369709 8.51328163,2.0369709 7.14644661,3.40380592 L2.55025253,8 C2.35499039,8.19526215 2.35499039,8.51184464 2.55025253,8.70710678 C2.74551468,8.90236893 3.06209717,8.90236893 3.25735931,8.70710678 Z"}))))),nn=te("trash",n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},n("path",{d:"M432,144,403.33,419.74A32,32,0,0,1,371.55,448H140.46a32,32,0,0,1-31.78-28.26L80,144",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),n("rect",{x:"32",y:"64",width:"448",height:"80",rx:"16",ry:"16",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),n("line",{x1:"312",y1:"240",x2:"200",y2:"352",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),n("line",{x1:"312",y1:"352",x2:"200",y2:"240",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}))),bt=te("download",n("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},n("g",{fill:"currentColor","fill-rule":"nonzero"},n("path",{d:"M3.5,13 L12.5,13 C12.7761424,13 13,13.2238576 13,13.5 C13,13.7454599 12.8231248,13.9496084 12.5898756,13.9919443 L12.5,14 L3.5,14 C3.22385763,14 3,13.7761424 3,13.5 C3,13.2545401 3.17687516,13.0503916 3.41012437,13.0080557 L3.5,13 L12.5,13 L3.5,13 Z M7.91012437,1.00805567 L8,1 C8.24545989,1 8.44960837,1.17687516 8.49194433,1.41012437 L8.5,1.5 L8.5,10.292 L11.1819805,7.6109127 C11.3555469,7.43734635 11.6249713,7.4180612 11.8198394,7.55305725 L11.8890873,7.6109127 C12.0626536,7.78447906 12.0819388,8.05390346 11.9469427,8.2487716 L11.8890873,8.31801948 L8.35355339,11.8535534 C8.17998704,12.0271197 7.91056264,12.0464049 7.7156945,11.9114088 L7.64644661,11.8535534 L4.1109127,8.31801948 C3.91565056,8.12275734 3.91565056,7.80617485 4.1109127,7.6109127 C4.28447906,7.43734635 4.55390346,7.4180612 4.7487716,7.55305725 L4.81801948,7.6109127 L7.5,10.292 L7.5,1.5 C7.5,1.25454011 7.67687516,1.05039163 7.91012437,1.00805567 L8,1 L7.91012437,1.00805567 Z"}))))),rn=te("cancel",n("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},n("g",{fill:"currentColor","fill-rule":"nonzero"},n("path",{d:"M2.58859116,2.7156945 L2.64644661,2.64644661 C2.82001296,2.47288026 3.08943736,2.45359511 3.2843055,2.58859116 L3.35355339,2.64644661 L8,7.293 L12.6464466,2.64644661 C12.8417088,2.45118446 13.1582912,2.45118446 13.3535534,2.64644661 C13.5488155,2.84170876 13.5488155,3.15829124 13.3535534,3.35355339 L8.707,8 L13.3535534,12.6464466 C13.5271197,12.820013 13.5464049,13.0894374 13.4114088,13.2843055 L13.3535534,13.3535534 C13.179987,13.5271197 12.9105626,13.5464049 12.7156945,13.4114088 L12.6464466,13.3535534 L8,8.707 L3.35355339,13.3535534 C3.15829124,13.5488155 2.84170876,13.5488155 2.64644661,13.3535534 C2.45118446,13.1582912 2.45118446,12.8417088 2.64644661,12.6464466 L7.293,8 L2.64644661,3.35355339 C2.47288026,3.17998704 2.45359511,2.91056264 2.58859116,2.7156945 L2.64644661,2.64644661 L2.58859116,2.7156945 Z"}))))),an=te("retry",n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},n("path",{d:"M320,146s24.36-12-64-12A160,160,0,1,0,416,294",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-miterlimit: 10; stroke-width: 32px;"}),n("polyline",{points:"256 58 336 138 256 218",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}))),ln=te("rotateClockwise",n("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 12.7916 15.3658 15.2026 13 16.3265V14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5V17.5C12 17.7761 12.2239 18 12.5 18H15.5C15.7761 18 16 17.7761 16 17.5C16 17.2239 15.7761 17 15.5 17H13.8758C16.3346 15.6357 18 13.0128 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 10.2761 2.22386 10.5 2.5 10.5C2.77614 10.5 3 10.2761 3 10Z",fill:"currentColor"}),n("path",{d:"M10 12C11.1046 12 12 11.1046 12 10C12 8.89543 11.1046 8 10 8C8.89543 8 8 8.89543 8 10C8 11.1046 8.89543 12 10 12ZM10 11C9.44772 11 9 10.5523 9 10C9 9.44772 9.44772 9 10 9C10.5523 9 11 9.44772 11 10C11 10.5523 10.5523 11 10 11Z",fill:"currentColor"}))),sn=te("rotateClockwise",n("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M17 10C17 6.13401 13.866 3 10 3C6.13401 3 3 6.13401 3 10C3 12.7916 4.63419 15.2026 7 16.3265V14.5C7 14.2239 7.22386 14 7.5 14C7.77614 14 8 14.2239 8 14.5V17.5C8 17.7761 7.77614 18 7.5 18H4.5C4.22386 18 4 17.7761 4 17.5C4 17.2239 4.22386 17 4.5 17H6.12422C3.66539 15.6357 2 13.0128 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10C18 10.2761 17.7761 10.5 17.5 10.5C17.2239 10.5 17 10.2761 17 10Z",fill:"currentColor"}),n("path",{d:"M10 12C8.89543 12 8 11.1046 8 10C8 8.89543 8.89543 8 10 8C11.1046 8 12 8.89543 12 10C12 11.1046 11.1046 12 10 12ZM10 11C10.5523 11 11 10.5523 11 10C11 9.44772 10.5523 9 10 9C9.44772 9 9 9.44772 9 10C9 10.5523 9.44772 11 10 11Z",fill:"currentColor"}))),dn=te("zoomIn",n("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M11.5 8.5C11.5 8.22386 11.2761 8 11 8H9V6C9 5.72386 8.77614 5.5 8.5 5.5C8.22386 5.5 8 5.72386 8 6V8H6C5.72386 8 5.5 8.22386 5.5 8.5C5.5 8.77614 5.72386 9 6 9H8V11C8 11.2761 8.22386 11.5 8.5 11.5C8.77614 11.5 9 11.2761 9 11V9H11C11.2761 9 11.5 8.77614 11.5 8.5Z",fill:"currentColor"}),n("path",{d:"M8.5 3C11.5376 3 14 5.46243 14 8.5C14 9.83879 13.5217 11.0659 12.7266 12.0196L16.8536 16.1464C17.0488 16.3417 17.0488 16.6583 16.8536 16.8536C16.68 17.0271 16.4106 17.0464 16.2157 16.9114L16.1464 16.8536L12.0196 12.7266C11.0659 13.5217 9.83879 14 8.5 14C5.46243 14 3 11.5376 3 8.5C3 5.46243 5.46243 3 8.5 3ZM8.5 4C6.01472 4 4 6.01472 4 8.5C4 10.9853 6.01472 13 8.5 13C10.9853 13 13 10.9853 13 8.5C13 6.01472 10.9853 4 8.5 4Z",fill:"currentColor"}))),un=te("zoomOut",n("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M11 8C11.2761 8 11.5 8.22386 11.5 8.5C11.5 8.77614 11.2761 9 11 9H6C5.72386 9 5.5 8.77614 5.5 8.5C5.5 8.22386 5.72386 8 6 8H11Z",fill:"currentColor"}),n("path",{d:"M14 8.5C14 5.46243 11.5376 3 8.5 3C5.46243 3 3 5.46243 3 8.5C3 11.5376 5.46243 14 8.5 14C9.83879 14 11.0659 13.5217 12.0196 12.7266L16.1464 16.8536L16.2157 16.9114C16.4106 17.0464 16.68 17.0271 16.8536 16.8536C17.0488 16.6583 17.0488 16.3417 16.8536 16.1464L12.7266 12.0196C13.5217 11.0659 14 9.83879 14 8.5ZM4 8.5C4 6.01472 6.01472 4 8.5 4C10.9853 4 13 6.01472 13 8.5C13 10.9853 10.9853 13 8.5 13C6.01472 13 4 10.9853 4 8.5Z",fill:"currentColor"}))),cn=Q({name:"ResizeSmall",render(){return n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},n("g",{fill:"none"},n("path",{d:"M5.5 4A1.5 1.5 0 0 0 4 5.5v1a.5.5 0 0 1-1 0v-1A2.5 2.5 0 0 1 5.5 3h1a.5.5 0 0 1 0 1h-1zM16 5.5A1.5 1.5 0 0 0 14.5 4h-1a.5.5 0 0 1 0-1h1A2.5 2.5 0 0 1 17 5.5v1a.5.5 0 0 1-1 0v-1zm0 9a1.5 1.5 0 0 1-1.5 1.5h-1a.5.5 0 0 0 0 1h1a2.5 2.5 0 0 0 2.5-2.5v-1a.5.5 0 0 0-1 0v1zm-12 0A1.5 1.5 0 0 0 5.5 16h1.25a.5.5 0 0 1 0 1H5.5A2.5 2.5 0 0 1 3 14.5v-1.25a.5.5 0 0 1 1 0v1.25zM8.5 7A1.5 1.5 0 0 0 7 8.5v3A1.5 1.5 0 0 0 8.5 13h3a1.5 1.5 0 0 0 1.5-1.5v-3A1.5 1.5 0 0 0 11.5 7h-3zM8 8.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-3z",fill:"currentColor"})))}}),fn=Qe&&"loading"in document.createElement("img"),hn=(e={})=>{var t;const{root:o=null}=e;return{hash:`${e.rootMargin||"0px 0px 0px 0px"}-${Array.isArray(e.threshold)?e.threshold.join(","):(t=e.threshold)!==null&&t!==void 0?t:"0"}`,options:Object.assign(Object.assign({},e),{root:(typeof o=="string"?document.querySelector(o):o)||document.documentElement})}},_e=new WeakMap,Le=new WeakMap,Oe=new WeakMap,gn=(e,t,o)=>{if(!e)return()=>{};const r=hn(t),{root:l}=r.options;let i;const u=_e.get(l);u?i=u:(i=new Map,_e.set(l,i));let c,d;i.has(r.hash)?(d=i.get(r.hash),d[1].has(e)||(c=d[0],d[1].add(e),c.observe(e))):(c=new IntersectionObserver(f=>{f.forEach(C=>{if(C.isIntersecting){const w=Le.get(C.target),x=Oe.get(C.target);w&&w(),x&&(x.value=!0)}})},r.options),c.observe(e),d=[c,new Set([e])],i.set(r.hash,d));let a=!1;const s=()=>{a||(Le.delete(e),Oe.delete(e),a=!0,d[1].has(e)&&(d[0].unobserve(e),d[1].delete(e)),d[1].size<=0&&i.delete(r.hash),i.size||_e.delete(l))};return Le.set(e,s),Oe.set(e,o),s},De=Object.assign(Object.assign({},ve.props),{onPreviewPrev:Function,onPreviewNext:Function,showToolbar:{type:Boolean,default:!0},showToolbarTooltip:Boolean,renderToolbar:Function}),xt=ke("n-image");function vn(){return{toolbarIconColor:"rgba(255, 255, 255, .9)",toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}const pn=kt({name:"Image",common:Et,peers:{Tooltip:Bt},self:vn}),mn=n("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M6 5C5.75454 5 5.55039 5.17688 5.50806 5.41012L5.5 5.5V14.5C5.5 14.7761 5.72386 15 6 15C6.24546 15 6.44961 14.8231 6.49194 14.5899L6.5 14.5V5.5C6.5 5.22386 6.27614 5 6 5ZM13.8536 5.14645C13.68 4.97288 13.4106 4.9536 13.2157 5.08859L13.1464 5.14645L8.64645 9.64645C8.47288 9.82001 8.4536 10.0894 8.58859 10.2843L8.64645 10.3536L13.1464 14.8536C13.3417 15.0488 13.6583 15.0488 13.8536 14.8536C14.0271 14.68 14.0464 14.4106 13.9114 14.2157L13.8536 14.1464L9.70711 10L13.8536 5.85355C14.0488 5.65829 14.0488 5.34171 13.8536 5.14645Z",fill:"currentColor"})),wn=n("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M13.5 5C13.7455 5 13.9496 5.17688 13.9919 5.41012L14 5.5V14.5C14 14.7761 13.7761 15 13.5 15C13.2545 15 13.0504 14.8231 13.0081 14.5899L13 14.5V5.5C13 5.22386 13.2239 5 13.5 5ZM5.64645 5.14645C5.82001 4.97288 6.08944 4.9536 6.28431 5.08859L6.35355 5.14645L10.8536 9.64645C11.0271 9.82001 11.0464 10.0894 10.9114 10.2843L10.8536 10.3536L6.35355 14.8536C6.15829 15.0488 5.84171 15.0488 5.64645 14.8536C5.47288 14.68 5.4536 14.4106 5.58859 14.2157L5.64645 14.1464L9.79289 10L5.64645 5.85355C5.45118 5.65829 5.45118 5.34171 5.64645 5.14645Z",fill:"currentColor"})),bn=n("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M4.089 4.216l.057-.07a.5.5 0 0 1 .638-.057l.07.057L10 9.293l5.146-5.147a.5.5 0 0 1 .638-.057l.07.057a.5.5 0 0 1 .057.638l-.057.07L10.707 10l5.147 5.146a.5.5 0 0 1 .057.638l-.057.07a.5.5 0 0 1-.638.057l-.07-.057L10 10.707l-5.146 5.147a.5.5 0 0 1-.638.057l-.07-.057a.5.5 0 0 1-.057-.638l.057-.07L9.293 10L4.146 4.854a.5.5 0 0 1-.057-.638l.057-.07l-.057.07z",fill:"currentColor"})),xn=U([U("body >",[b("image-container","position: fixed;")]),b("image-preview-container",`
|
||
position: fixed;
|
||
left: 0;
|
||
right: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
display: flex;
|
||
`),b("image-preview-overlay",`
|
||
z-index: -1;
|
||
position: absolute;
|
||
left: 0;
|
||
right: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
background: rgba(0, 0, 0, .3);
|
||
`,[Ae()]),b("image-preview-toolbar",`
|
||
z-index: 1;
|
||
position: absolute;
|
||
left: 50%;
|
||
transform: translateX(-50%);
|
||
border-radius: var(--n-toolbar-border-radius);
|
||
height: 48px;
|
||
bottom: 40px;
|
||
padding: 0 12px;
|
||
background: var(--n-toolbar-color);
|
||
box-shadow: var(--n-toolbar-box-shadow);
|
||
color: var(--n-toolbar-icon-color);
|
||
transition: color .3s var(--n-bezier);
|
||
display: flex;
|
||
align-items: center;
|
||
`,[b("base-icon",`
|
||
padding: 0 8px;
|
||
font-size: 28px;
|
||
cursor: pointer;
|
||
`),Ae()]),b("image-preview-wrapper",`
|
||
position: absolute;
|
||
left: 0;
|
||
right: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
display: flex;
|
||
pointer-events: none;
|
||
`,[Dt()]),b("image-preview",`
|
||
user-select: none;
|
||
-webkit-user-select: none;
|
||
pointer-events: all;
|
||
margin: auto;
|
||
max-height: calc(100vh - 32px);
|
||
max-width: calc(100vw - 32px);
|
||
transition: transform .3s var(--n-bezier);
|
||
`),b("image",`
|
||
display: inline-flex;
|
||
max-height: 100%;
|
||
max-width: 100%;
|
||
`,[Ut("preview-disabled",`
|
||
cursor: pointer;
|
||
`),U("img",`
|
||
border-radius: inherit;
|
||
`)])]),ce=32,Ct=Q({name:"ImagePreview",props:Object.assign(Object.assign({},De),{onNext:Function,onPrev:Function,clsPrefix:{type:String,required:!0}}),setup(e){const t=ve("Image","-image",xn,pn,e,S(e,"clsPrefix"));let o=null;const r=$(null),l=$(null),i=$(void 0),u=$(!1),c=$(!1),{localeRef:d}=Mt("Image");function a(){const{value:h}=l;if(!o||!h)return;const{style:m}=h,g=o.getBoundingClientRect(),L=g.left+g.width/2,O=g.top+g.height/2;m.transformOrigin=`${L}px ${O}px`}function s(h){var m,g;switch(h.key){case" ":h.preventDefault();break;case"ArrowLeft":(m=e.onPrev)===null||m===void 0||m.call(e);break;case"ArrowRight":(g=e.onNext)===null||g===void 0||g.call(e);break;case"Escape":Ue();break}}zt(u,h=>{h?ye("keydown",document,s):ue("keydown",document,s)}),et(()=>{ue("keydown",document,s)});let f=0,C=0,w=0,x=0,A=0,Z=0,F=0,N=0,X=!1;function I(h){const{clientX:m,clientY:g}=h;w=m-f,x=g-C,Ht(q)}function p(h){const{mouseUpClientX:m,mouseUpClientY:g,mouseDownClientX:L,mouseDownClientY:O}=h,H=L-m,G=O-g,J=`vertical${G>0?"Top":"Bottom"}`,oe=`horizontal${H>0?"Left":"Right"}`;return{moveVerticalDirection:J,moveHorizontalDirection:oe,deltaHorizontal:H,deltaVertical:G}}function y(h){const{value:m}=r;if(!m)return{offsetX:0,offsetY:0};const g=m.getBoundingClientRect(),{moveVerticalDirection:L,moveHorizontalDirection:O,deltaHorizontal:H,deltaVertical:G}=h||{};let J=0,oe=0;return g.width<=window.innerWidth?J=0:g.left>0?J=(g.width-window.innerWidth)/2:g.right<window.innerWidth?J=-(g.width-window.innerWidth)/2:O==="horizontalRight"?J=Math.min((g.width-window.innerWidth)/2,A-(H??0)):J=Math.max(-((g.width-window.innerWidth)/2),A-(H??0)),g.height<=window.innerHeight?oe=0:g.top>0?oe=(g.height-window.innerHeight)/2:g.bottom<window.innerHeight?oe=-(g.height-window.innerHeight)/2:L==="verticalBottom"?oe=Math.min((g.height-window.innerHeight)/2,Z-(G??0)):oe=Math.max(-((g.height-window.innerHeight)/2),Z-(G??0)),{offsetX:J,offsetY:oe}}function R(h){ue("mousemove",document,I),ue("mouseup",document,R);const{clientX:m,clientY:g}=h;X=!1;const L=p({mouseUpClientX:m,mouseUpClientY:g,mouseDownClientX:F,mouseDownClientY:N}),O=y(L);w=O.offsetX,x=O.offsetY,q()}const E=ne(xt,null);function v(h){var m,g;if((g=(m=E==null?void 0:E.previewedImgPropsRef.value)===null||m===void 0?void 0:m.onMousedown)===null||g===void 0||g.call(m,h),h.button!==0)return;const{clientX:L,clientY:O}=h;X=!0,f=L-w,C=O-x,A=w,Z=x,F=L,N=O,q(),ye("mousemove",document,I),ye("mouseup",document,R)}function P(h){var m,g;(g=(m=E==null?void 0:E.previewedImgPropsRef.value)===null||m===void 0?void 0:m.onDblclick)===null||g===void 0||g.call(m,h);const L=de();T=T===L?1:L,q()}const _=1.5;let z=0,T=1,B=0;function D(){T=1,z=0}function k(){var h;D(),B=0,(h=e.onPrev)===null||h===void 0||h.call(e)}function Y(){var h;D(),B=0,(h=e.onNext)===null||h===void 0||h.call(e)}function W(){B-=90,q()}function ee(){B+=90,q()}function we(){const{value:h}=r;if(!h)return 1;const{innerWidth:m,innerHeight:g}=window,L=Math.max(1,h.naturalHeight/(g-ce)),O=Math.max(1,h.naturalWidth/(m-ce));return Math.max(3,L*2,O*2)}function de(){const{value:h}=r;if(!h)return 1;const{innerWidth:m,innerHeight:g}=window,L=h.naturalHeight/(g-ce),O=h.naturalWidth/(m-ce);return L<1&&O<1?1:Math.max(L,O)}function be(){const h=we();T<h&&(z+=1,T=Math.min(h,Math.pow(_,z)),q())}function xe(){if(T>.5){const h=T;z-=1,T=Math.max(.5,Math.pow(_,z));const m=h-T;q(!1);const g=y();T+=m,q(!1),T-=m,w=g.offsetX,x=g.offsetY,q()}}function Ce(){const h=i.value;h&&it(h,void 0)}function q(h=!0){var m;const{value:g}=r;if(!g)return;const{style:L}=g,O=Nt((m=E==null?void 0:E.previewedImgPropsRef.value)===null||m===void 0?void 0:m.style);let H="";if(typeof O=="string")H=O+";";else for(const J in O)H+=`${tn(J)}: ${O[J]};`;const G=`transform-origin: center; transform: translateX(${w}px) translateY(${x}px) rotate(${B}deg) scale(${T});`;X?L.cssText=H+"cursor: grabbing; transition: none;"+G:L.cssText=H+"cursor: grab;"+G+(h?"":"transition: none;"),h||g.offsetHeight}function Ue(){u.value=!u.value,c.value=!0}function St(){T=de(),z=Math.ceil(Math.log(T)/Math.log(_)),w=0,x=0,q()}const It={setPreviewSrc:h=>{i.value=h},setThumbnailEl:h=>{o=h},toggleShow:Ue};function Pt(h,m){if(e.showToolbarTooltip){const{value:g}=t;return n(Vt,{to:!1,theme:g.peers.Tooltip,themeOverrides:g.peerOverrides.Tooltip,keepAliveOnHover:!1},{default:()=>d.value[m],trigger:()=>h})}else return h}const Me=j(()=>{const{common:{cubicBezierEaseInOut:h},self:{toolbarIconColor:m,toolbarBorderRadius:g,toolbarBoxShadow:L,toolbarColor:O}}=t.value;return{"--n-bezier":h,"--n-toolbar-icon-color":m,"--n-toolbar-color":O,"--n-toolbar-border-radius":g,"--n-toolbar-box-shadow":L}}),{inlineThemeDisabled:ze}=pe(),re=ze?tt("image-preview",void 0,Me,e):void 0;return Object.assign({previewRef:r,previewWrapperRef:l,previewSrc:i,show:u,appear:At(),displayed:c,previewedImgProps:E==null?void 0:E.previewedImgPropsRef,handleWheel(h){h.preventDefault()},handlePreviewMousedown:v,handlePreviewDblclick:P,syncTransformOrigin:a,handleAfterLeave:()=>{D(),B=0,c.value=!1},handleDragStart:h=>{var m,g;(g=(m=E==null?void 0:E.previewedImgPropsRef.value)===null||m===void 0?void 0:m.onDragstart)===null||g===void 0||g.call(m,h),h.preventDefault()},zoomIn:be,zoomOut:xe,handleDownloadClick:Ce,rotateCounterclockwise:W,rotateClockwise:ee,handleSwitchPrev:k,handleSwitchNext:Y,withTooltip:Pt,resizeToOrignalImageSize:St,cssVars:ze?void 0:Me,themeClass:re==null?void 0:re.themeClass,onRender:re==null?void 0:re.onRender},It)},render(){var e,t;const{clsPrefix:o,renderToolbar:r,withTooltip:l}=this,i=l(n(M,{clsPrefix:o,onClick:this.handleSwitchPrev},{default:()=>mn}),"tipPrevious"),u=l(n(M,{clsPrefix:o,onClick:this.handleSwitchNext},{default:()=>wn}),"tipNext"),c=l(n(M,{clsPrefix:o,onClick:this.rotateCounterclockwise},{default:()=>n(sn,null)}),"tipCounterclockwise"),d=l(n(M,{clsPrefix:o,onClick:this.rotateClockwise},{default:()=>n(ln,null)}),"tipClockwise"),a=l(n(M,{clsPrefix:o,onClick:this.resizeToOrignalImageSize},{default:()=>n(cn,null)}),"tipOriginalSize"),s=l(n(M,{clsPrefix:o,onClick:this.zoomOut},{default:()=>n(un,null)}),"tipZoomOut"),f=l(n(M,{clsPrefix:o,onClick:this.handleDownloadClick},{default:()=>n(bt,null)}),"tipDownload"),C=l(n(M,{clsPrefix:o,onClick:this.toggleShow},{default:()=>bn}),"tipClose"),w=l(n(M,{clsPrefix:o,onClick:this.zoomIn},{default:()=>n(dn,null)}),"tipZoomIn");return n(he,null,(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e),n(Ft,{show:this.show},{default:()=>{var x;return this.show||this.displayed?((x=this.onRender)===null||x===void 0||x.call(this),Fe(n("div",{class:[`${o}-image-preview-container`,this.themeClass],style:this.cssVars,onWheel:this.handleWheel},n(Re,{name:"fade-in-transition",appear:this.appear},{default:()=>this.show?n("div",{class:`${o}-image-preview-overlay`,onClick:this.toggleShow}):null}),this.showToolbar?n(Re,{name:"fade-in-transition",appear:this.appear},{default:()=>this.show?n("div",{class:`${o}-image-preview-toolbar`},r?r({nodes:{prev:i,next:u,rotateCounterclockwise:c,rotateClockwise:d,resizeToOriginalSize:a,zoomOut:s,zoomIn:w,download:f,close:C}}):n(he,null,this.onPrev?n(he,null,i,u):null,c,d,a,s,w,f,C)):null}):null,n(Re,{name:"fade-in-scale-up-transition",onAfterLeave:this.handleAfterLeave,appear:this.appear,onEnter:this.syncTransformOrigin,onBeforeLeave:this.syncTransformOrigin},{default:()=>{const{previewedImgProps:A={}}=this;return Fe(n("div",{class:`${o}-image-preview-wrapper`,ref:"previewWrapperRef"},n("img",Object.assign({},A,{draggable:!1,onMousedown:this.handlePreviewMousedown,onDblclick:this.handlePreviewDblclick,class:[`${o}-image-preview`,A.class],key:this.previewSrc,src:this.previewSrc,ref:"previewRef",onDragstart:this.handleDragStart}))),[[$t,this.show]])}})),[[jt,{enabled:this.show}]])):null}}))}}),yt=ke("n-image-group"),Cn=De,yn=Q({name:"ImageGroup",props:Cn,setup(e){let t;const{mergedClsPrefixRef:o}=pe(e),r=`c${Se()}`,l=Zt(),i=d=>{var a;t=d,(a=c.value)===null||a===void 0||a.setPreviewSrc(d)};function u(d){var a,s;if(!(l!=null&&l.proxy))return;const C=l.proxy.$el.parentElement.querySelectorAll(`[data-group-id=${r}]:not([data-error=true])`);if(!C.length)return;const w=Array.from(C).findIndex(x=>x.dataset.previewSrc===t);~w?i(C[(w+d+C.length)%C.length].dataset.previewSrc):i(C[0].dataset.previewSrc),d===1?(a=e.onPreviewNext)===null||a===void 0||a.call(e):(s=e.onPreviewPrev)===null||s===void 0||s.call(e)}Ee(yt,{mergedClsPrefixRef:o,setPreviewSrc:i,setThumbnailEl:d=>{var a;(a=c.value)===null||a===void 0||a.setThumbnailEl(d)},toggleShow:()=>{var d;(d=c.value)===null||d===void 0||d.toggleShow()},groupId:r,renderToolbarRef:S(e,"renderToolbar")});const c=$(null);return{mergedClsPrefix:o,previewInstRef:c,next:()=>{u(1)},prev:()=>{u(-1)}}},render(){return n(Ct,{theme:this.theme,themeOverrides:this.themeOverrides,clsPrefix:this.mergedClsPrefix,ref:"previewInstRef",onPrev:this.prev,onNext:this.next,showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip,renderToolbar:this.renderToolbar},this.$slots)}}),Rn=Object.assign({alt:String,height:[String,Number],imgProps:Object,previewedImgProps:Object,lazy:Boolean,intersectionObserverOptions:Object,objectFit:{type:String,default:"fill"},previewSrc:String,fallbackSrc:String,width:[String,Number],src:String,previewDisabled:Boolean,loadDescription:String,onError:Function,onLoad:Function},De),Tn=Q({name:"Image",props:Rn,inheritAttrs:!1,setup(e){const t=$(null),o=$(!1),r=$(null),l=ne(yt,null),{mergedClsPrefixRef:i}=l||pe(e),u={click:()=>{if(e.previewDisabled||o.value)return;const a=e.previewSrc||e.src;if(l){l.setPreviewSrc(a),l.setThumbnailEl(t.value),l.toggleShow();return}const{value:s}=r;s&&(s.setPreviewSrc(a),s.setThumbnailEl(t.value),s.toggleShow())}},c=$(!e.lazy);je(()=>{var a;(a=t.value)===null||a===void 0||a.setAttribute("data-group-id",(l==null?void 0:l.groupId)||"")}),je(()=>{if(e.lazy&&e.intersectionObserverOptions){let a;const s=Ie(()=>{a==null||a(),a=void 0,a=gn(t.value,e.intersectionObserverOptions,c)});et(()=>{s(),a==null||a()})}}),Ie(()=>{var a;e.src||((a=e.imgProps)===null||a===void 0||a.src),o.value=!1});const d=$(!1);return Ee(xt,{previewedImgPropsRef:S(e,"previewedImgProps")}),Object.assign({mergedClsPrefix:i,groupId:l==null?void 0:l.groupId,previewInstRef:r,imageRef:t,showError:o,shouldStartLoading:c,loaded:d,mergedOnClick:a=>{var s,f;u.click(),(f=(s=e.imgProps)===null||s===void 0?void 0:s.onClick)===null||f===void 0||f.call(s,a)},mergedOnError:a=>{if(!c.value)return;o.value=!0;const{onError:s,imgProps:{onError:f}={}}=e;s==null||s(a),f==null||f(a)},mergedOnLoad:a=>{const{onLoad:s,imgProps:{onLoad:f}={}}=e;s==null||s(a),f==null||f(a),d.value=!0}},u)},render(){var e,t;const{mergedClsPrefix:o,imgProps:r={},loaded:l,$attrs:i,lazy:u}=this,c=(t=(e=this.$slots).placeholder)===null||t===void 0?void 0:t.call(e),d=this.src||r.src,a=n("img",Object.assign(Object.assign({},r),{ref:"imageRef",width:this.width||r.width,height:this.height||r.height,src:this.showError?this.fallbackSrc:u&&this.intersectionObserverOptions?this.shouldStartLoading?d:void 0:d,alt:this.alt||r.alt,"aria-label":this.alt||r.alt,onClick:this.mergedOnClick,onError:this.mergedOnError,onLoad:this.mergedOnLoad,loading:fn&&u&&!this.intersectionObserverOptions?"lazy":"eager",style:[r.style||"",c&&!l?{height:"0",width:"0",visibility:"hidden"}:"",{objectFit:this.objectFit}],"data-error":this.showError,"data-preview-src":this.previewSrc||this.src}));return n("div",Object.assign({},i,{role:"none",class:[i.class,`${o}-image`,(this.previewDisabled||this.showError)&&`${o}-image--preview-disabled`]}),this.groupId?a:n(Ct,{theme:this.theme,themeOverrides:this.themeOverrides,clsPrefix:o,ref:"previewInstRef",showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip,renderToolbar:this.renderToolbar},{default:()=>a,toolbar:()=>{var s,f;return(f=(s=this.$slots).toolbar)===null||f===void 0?void 0:f.call(s)}}),!l&&c)}}),ae=ke("n-upload"),Rt="__UPLOAD_DRAGGER__",_n=Q({name:"UploadDragger",[Rt]:!0,setup(e,{slots:t}){const o=ne(ae,null);return o||me("upload-dragger","`n-upload-dragger` must be placed inside `n-upload`."),()=>{const{mergedClsPrefixRef:{value:r},mergedDisabledRef:{value:l},maxReachedRef:{value:i}}=o;return n("div",{class:[`${r}-upload-dragger`,(l||i)&&`${r}-upload-dragger--disabled`]},t)}}});var Pe=function(e,t,o,r){function l(i){return i instanceof o?i:new o(function(u){u(i)})}return new(o||(o=Promise))(function(i,u){function c(s){try{a(r.next(s))}catch(f){u(f)}}function d(s){try{a(r.throw(s))}catch(f){u(f)}}function a(s){s.done?i(s.value):l(s.value).then(c,d)}a((r=r.apply(e,t||[])).next())})};const Tt=e=>e.includes("image/"),Ge=(e="")=>{const t=e.split("/"),r=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(r)||[""])[0]},qe=/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i,_t=e=>{if(e.type)return Tt(e.type);const t=Ge(e.name||"");if(qe.test(t))return!0;const o=e.thumbnailUrl||e.url||"",r=Ge(o);return!!(/^data:image\//.test(o)||qe.test(r))};function Ln(e){return Pe(this,void 0,void 0,function*(){return yield new Promise(t=>{if(!e.type||!Tt(e.type)){t("");return}t(window.URL.createObjectURL(e))})})}const On=Qe&&window.FileReader&&window.File;function Sn(e){return e.isDirectory}function In(e){return e.isFile}function Pn(e,t){return Pe(this,void 0,void 0,function*(){const o=[];function r(l){return Pe(this,void 0,void 0,function*(){for(const i of l)if(i){if(t&&Sn(i)){const u=i.createReader();try{const c=yield new Promise((d,a)=>{u.readEntries(d,a)});yield r(c)}catch{}}else if(In(i))try{const u=yield new Promise((c,d)=>{i.file(c,d)});o.push({file:u,entry:i,source:"dnd"})}catch{}}})}return yield r(e),o})}function se(e){const{id:t,name:o,percentage:r,status:l,url:i,file:u,thumbnailUrl:c,type:d,fullPath:a,batchId:s}=e;return{id:t,name:o,percentage:r??null,status:l,url:i??null,file:u??null,thumbnailUrl:c??null,type:d??null,fullPath:a??null,batchId:s??null}}function kn(e,t,o){return e=e.toLowerCase(),t=t.toLocaleLowerCase(),o=o.toLocaleLowerCase(),o.split(",").map(l=>l.trim()).filter(Boolean).some(l=>{if(l.startsWith(".")){if(e.endsWith(l))return!0}else if(l.includes("/")){const[i,u]=t.split("/"),[c,d]=l.split("/");if((c==="*"||i&&c&&c===i)&&(d==="*"||u&&d&&d===u))return!0}else return!0;return!1})}const Lt=Q({name:"UploadTrigger",props:{abstract:Boolean},setup(e,{slots:t}){const o=ne(ae,null);o||me("upload-trigger","`n-upload-trigger` must be placed inside `n-upload`.");const{mergedClsPrefixRef:r,mergedDisabledRef:l,maxReachedRef:i,listTypeRef:u,dragOverRef:c,openOpenFileDialog:d,draggerInsideRef:a,handleFileAddition:s,mergedDirectoryDndRef:f,triggerClassRef:C,triggerStyleRef:w}=o,x=j(()=>u.value==="image-card");function A(){l.value||i.value||d()}function Z(I){I.preventDefault(),c.value=!0}function F(I){I.preventDefault(),c.value=!0}function N(I){I.preventDefault(),c.value=!1}function X(I){var p;if(I.preventDefault(),!a.value||l.value||i.value){c.value=!1;return}const y=(p=I.dataTransfer)===null||p===void 0?void 0:p.items;y!=null&&y.length?Pn(Array.from(y).map(R=>R.webkitGetAsEntry()),f.value).then(R=>{s(R)}).finally(()=>{c.value=!1}):c.value=!1}return()=>{var I;const{value:p}=r;return e.abstract?(I=t.default)===null||I===void 0?void 0:I.call(t,{handleClick:A,handleDrop:X,handleDragOver:Z,handleDragEnter:F,handleDragLeave:N}):n("div",{class:[`${p}-upload-trigger`,(l.value||i.value)&&`${p}-upload-trigger--disabled`,x.value&&`${p}-upload-trigger--image-card`,C.value],style:w.value,onClick:A,onDrop:X,onDragover:Z,onDragenter:F,onDragleave:N},x.value?n(_n,null,{default:()=>Wt(t.default,()=>[n(M,{clsPrefix:p},{default:()=>n(Xt,null)})])}):t)}}}),En=Q({name:"UploadProgress",props:{show:Boolean,percentage:{type:Number,required:!0},status:{type:String,required:!0}},setup(){return{mergedTheme:ne(ae).mergedThemeRef}},render(){return n(ot,null,{default:()=>this.show?n(co,{type:"line",showIndicator:!1,percentage:this.percentage,status:this.status,height:2,theme:this.mergedTheme.peers.Progress,themeOverrides:this.mergedTheme.peerOverrides.Progress}):null})}}),Bn=n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28"},n("g",{fill:"none"},n("path",{d:"M21.75 3A3.25 3.25 0 0 1 25 6.25v15.5A3.25 3.25 0 0 1 21.75 25H6.25A3.25 3.25 0 0 1 3 21.75V6.25A3.25 3.25 0 0 1 6.25 3h15.5zm.583 20.4l-7.807-7.68a.75.75 0 0 0-.968-.07l-.084.07l-7.808 7.68c.183.065.38.1.584.1h15.5c.204 0 .4-.035.583-.1l-7.807-7.68l7.807 7.68zM21.75 4.5H6.25A1.75 1.75 0 0 0 4.5 6.25v15.5c0 .208.036.408.103.593l7.82-7.692a2.25 2.25 0 0 1 3.026-.117l.129.117l7.82 7.692c.066-.185.102-.385.102-.593V6.25a1.75 1.75 0 0 0-1.75-1.75zm-3.25 3a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5zm0 1.5a1 1 0 1 0 0 2a1 1 0 0 0 0-2z",fill:"currentColor"}))),Dn=n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28"},n("g",{fill:"none"},n("path",{d:"M6.4 2A2.4 2.4 0 0 0 4 4.4v19.2A2.4 2.4 0 0 0 6.4 26h15.2a2.4 2.4 0 0 0 2.4-2.4V11.578c0-.729-.29-1.428-.805-1.944l-6.931-6.931A2.4 2.4 0 0 0 14.567 2H6.4zm-.9 2.4a.9.9 0 0 1 .9-.9H14V10a2 2 0 0 0 2 2h6.5v11.6a.9.9 0 0 1-.9.9H6.4a.9.9 0 0 1-.9-.9V4.4zm16.44 6.1H16a.5.5 0 0 1-.5-.5V4.06l6.44 6.44z",fill:"currentColor"})));var Un=function(e,t,o,r){function l(i){return i instanceof o?i:new o(function(u){u(i)})}return new(o||(o=Promise))(function(i,u){function c(s){try{a(r.next(s))}catch(f){u(f)}}function d(s){try{a(r.throw(s))}catch(f){u(f)}}function a(s){s.done?i(s.value):l(s.value).then(c,d)}a((r=r.apply(e,t||[])).next())})};const fe={paddingMedium:"0 3px",heightMedium:"24px",iconSizeMedium:"18px"},Mn=Q({name:"UploadFile",props:{clsPrefix:{type:String,required:!0},file:{type:Object,required:!0},listType:{type:String,required:!0},index:{type:Number,required:!0}},setup(e){const t=ne(ae),o=$(null),r=$(""),l=j(()=>{const{file:p}=e;return p.status==="finished"?"success":p.status==="error"?"error":"info"}),i=j(()=>{const{file:p}=e;if(p.status==="error")return"error"}),u=j(()=>{const{file:p}=e;return p.status==="uploading"}),c=j(()=>{if(!t.showCancelButtonRef.value)return!1;const{file:p}=e;return["uploading","pending","error"].includes(p.status)}),d=j(()=>{if(!t.showRemoveButtonRef.value)return!1;const{file:p}=e;return["finished"].includes(p.status)}),a=j(()=>{if(!t.showDownloadButtonRef.value)return!1;const{file:p}=e;return["finished"].includes(p.status)}),s=j(()=>{if(!t.showRetryButtonRef.value)return!1;const{file:p}=e;return["error"].includes(p.status)}),f=Yt(()=>r.value||e.file.thumbnailUrl||e.file.url),C=j(()=>{if(!t.showPreviewButtonRef.value)return!1;const{file:{status:p},listType:y}=e;return["finished"].includes(p)&&f.value&&y==="image-card"});function w(){t.submit(e.file.id)}function x(p){p.preventDefault();const{file:y}=e;["finished","pending","error"].includes(y.status)?Z(y):["uploading"].includes(y.status)?N(y):Jt("upload","The button clicked type is unknown.")}function A(p){p.preventDefault(),F(e.file)}function Z(p){const{xhrMap:y,doChange:R,onRemoveRef:{value:E},mergedFileListRef:{value:v}}=t;Promise.resolve(E?E({file:Object.assign({},p),fileList:v,index:e.index}):!0).then(P=>{if(P===!1)return;const _=Object.assign({},p,{status:"removed"});y.delete(p.id),R(_,void 0,{remove:!0})})}function F(p){const{onDownloadRef:{value:y}}=t;Promise.resolve(y?y(Object.assign({},p)):!0).then(R=>{R!==!1&&it(p.url,p.name)})}function N(p){const{xhrMap:y}=t,R=y.get(p.id);R==null||R.abort(),Z(Object.assign({},p))}function X(){const{onPreviewRef:{value:p}}=t;if(p)p(e.file);else if(e.listType==="image-card"){const{value:y}=o;if(!y)return;y.click()}}const I=()=>Un(this,void 0,void 0,function*(){const{listType:p}=e;p!=="image"&&p!=="image-card"||t.shouldUseThumbnailUrlRef.value(e.file)&&(r.value=yield t.getFileThumbnailUrlResolver(e.file))});return Ie(()=>{I()}),{mergedTheme:t.mergedThemeRef,progressStatus:l,buttonType:i,showProgress:u,disabled:t.mergedDisabledRef,showCancelButton:c,showRemoveButton:d,showDownloadButton:a,showRetryButton:s,showPreviewButton:C,mergedThumbnailUrl:f,shouldUseThumbnailUrl:t.shouldUseThumbnailUrlRef,renderIcon:t.renderIconRef,imageRef:o,handleRemoveOrCancelClick:x,handleDownloadClick:A,handleRetryClick:w,handlePreviewClick:X}},render(){const{clsPrefix:e,mergedTheme:t,listType:o,file:r,renderIcon:l}=this;let i;const u=o==="image";u||o==="image-card"?i=!this.shouldUseThumbnailUrl(r)||!this.mergedThumbnailUrl?n("span",{class:`${e}-upload-file-info__thumbnail`},l?l(r):_t(r)?n(M,{clsPrefix:e},{default:()=>Bn}):n(M,{clsPrefix:e},{default:()=>Dn})):n("a",{rel:"noopener noreferer",target:"_blank",href:r.url||void 0,class:`${e}-upload-file-info__thumbnail`,onClick:this.handlePreviewClick},o==="image-card"?n(Tn,{src:this.mergedThumbnailUrl||void 0,previewSrc:r.url||void 0,alt:r.name,ref:"imageRef"}):n("img",{src:this.mergedThumbnailUrl||void 0,alt:r.name})):i=n("span",{class:`${e}-upload-file-info__thumbnail`},l?l(r):n(M,{clsPrefix:e},{default:()=>n(on,null)}));const d=n(En,{show:this.showProgress,percentage:r.percentage||0,status:this.progressStatus}),a=o==="text"||o==="image";return n("div",{class:[`${e}-upload-file`,`${e}-upload-file--${this.progressStatus}-status`,r.url&&r.status!=="error"&&o!=="image-card"&&`${e}-upload-file--with-url`,`${e}-upload-file--${o}-type`]},n("div",{class:`${e}-upload-file-info`},i,n("div",{class:`${e}-upload-file-info__name`},a&&(r.url&&r.status!=="error"?n("a",{rel:"noopener noreferer",target:"_blank",href:r.url||void 0,onClick:this.handlePreviewClick},r.name):n("span",{onClick:this.handlePreviewClick},r.name)),u&&d),n("div",{class:[`${e}-upload-file-info__action`,`${e}-upload-file-info__action--${o}-type`]},this.showPreviewButton?n(le,{key:"preview",quaternary:!0,type:this.buttonType,onClick:this.handlePreviewClick,theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,builtinThemeOverrides:fe},{icon:()=>n(M,{clsPrefix:e},{default:()=>n(Gt,null)})}):null,(this.showRemoveButton||this.showCancelButton)&&!this.disabled&&n(le,{key:"cancelOrTrash",theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,quaternary:!0,builtinThemeOverrides:fe,type:this.buttonType,onClick:this.handleRemoveOrCancelClick},{icon:()=>n(qt,null,{default:()=>this.showRemoveButton?n(M,{clsPrefix:e,key:"trash"},{default:()=>n(nn,null)}):n(M,{clsPrefix:e,key:"cancel"},{default:()=>n(rn,null)})})}),this.showRetryButton&&!this.disabled&&n(le,{key:"retry",quaternary:!0,type:this.buttonType,onClick:this.handleRetryClick,theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,builtinThemeOverrides:fe},{icon:()=>n(M,{clsPrefix:e},{default:()=>n(an,null)})}),this.showDownloadButton?n(le,{key:"download",quaternary:!0,type:this.buttonType,onClick:this.handleDownloadClick,theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,builtinThemeOverrides:fe},{icon:()=>n(M,{clsPrefix:e},{default:()=>n(bt,null)})}):null)),!u&&d)}}),zn=Q({name:"UploadFileList",setup(e,{slots:t}){const o=ne(ae,null);o||me("upload-file-list","`n-upload-file-list` must be placed inside `n-upload`.");const{abstractRef:r,mergedClsPrefixRef:l,listTypeRef:i,mergedFileListRef:u,fileListClassRef:c,fileListStyleRef:d,cssVarsRef:a,themeClassRef:s,maxReachedRef:f,showTriggerRef:C,imageGroupPropsRef:w}=o,x=j(()=>i.value==="image-card"),A=()=>u.value.map((F,N)=>n(Mn,{clsPrefix:l.value,key:F.id,file:F,index:N,listType:i.value})),Z=()=>x.value?n(yn,Object.assign({},w.value),{default:A}):n(ot,{group:!0},{default:A});return()=>{const{value:F}=l,{value:N}=r;return n("div",{class:[`${F}-upload-file-list`,x.value&&`${F}-upload-file-list--grid`,N?s==null?void 0:s.value:void 0,c.value],style:[N&&a?a.value:"",d.value]},Z(),C.value&&!f.value&&x.value&&n(Lt,null,t))}}}),An=U([b("upload","width: 100%;",[V("dragger-inside",[b("upload-trigger",`
|
||
display: block;
|
||
`)]),V("drag-over",[b("upload-dragger",`
|
||
border: var(--n-dragger-border-hover);
|
||
`)])]),b("upload-dragger",`
|
||
cursor: pointer;
|
||
box-sizing: border-box;
|
||
width: 100%;
|
||
text-align: center;
|
||
border-radius: var(--n-border-radius);
|
||
padding: 24px;
|
||
opacity: 1;
|
||
transition:
|
||
opacity .3s var(--n-bezier),
|
||
border-color .3s var(--n-bezier),
|
||
background-color .3s var(--n-bezier);
|
||
background-color: var(--n-dragger-color);
|
||
border: var(--n-dragger-border);
|
||
`,[U("&:hover",`
|
||
border: var(--n-dragger-border-hover);
|
||
`),V("disabled",`
|
||
cursor: not-allowed;
|
||
`)]),b("upload-trigger",`
|
||
display: inline-block;
|
||
box-sizing: border-box;
|
||
opacity: 1;
|
||
transition: opacity .3s var(--n-bezier);
|
||
`,[U("+",[b("upload-file-list","margin-top: 8px;")]),V("disabled",`
|
||
opacity: var(--n-item-disabled-opacity);
|
||
cursor: not-allowed;
|
||
`),V("image-card",`
|
||
width: 96px;
|
||
height: 96px;
|
||
`,[b("base-icon",`
|
||
font-size: 24px;
|
||
`),b("upload-dragger",`
|
||
padding: 0;
|
||
height: 100%;
|
||
width: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
`)])]),b("upload-file-list",`
|
||
line-height: var(--n-line-height);
|
||
opacity: 1;
|
||
transition: opacity .3s var(--n-bezier);
|
||
`,[U("a, img","outline: none;"),V("disabled",`
|
||
opacity: var(--n-item-disabled-opacity);
|
||
cursor: not-allowed;
|
||
`,[b("upload-file","cursor: not-allowed;")]),V("grid",`
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fill, 96px);
|
||
grid-gap: 8px;
|
||
margin-top: 0;
|
||
`),b("upload-file",`
|
||
display: block;
|
||
box-sizing: border-box;
|
||
cursor: default;
|
||
padding: 0px 12px 0 6px;
|
||
transition: background-color .3s var(--n-bezier);
|
||
border-radius: var(--n-border-radius);
|
||
`,[$e(),b("progress",[$e({foldPadding:!0})]),U("&:hover",`
|
||
background-color: var(--n-item-color-hover);
|
||
`,[b("upload-file-info",[K("action",`
|
||
opacity: 1;
|
||
`)])]),V("image-type",`
|
||
border-radius: var(--n-border-radius);
|
||
text-decoration: underline;
|
||
text-decoration-color: #0000;
|
||
`,[b("upload-file-info",`
|
||
padding-top: 0px;
|
||
padding-bottom: 0px;
|
||
width: 100%;
|
||
height: 100%;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
padding: 6px 0;
|
||
`,[b("progress",`
|
||
padding: 2px 0;
|
||
margin-bottom: 0;
|
||
`),K("name",`
|
||
padding: 0 8px;
|
||
`),K("thumbnail",`
|
||
width: 32px;
|
||
height: 32px;
|
||
font-size: 28px;
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
`,[U("img",`
|
||
width: 100%;
|
||
`)])])]),V("text-type",[b("progress",`
|
||
box-sizing: border-box;
|
||
padding-bottom: 6px;
|
||
margin-bottom: 6px;
|
||
`)]),V("image-card-type",`
|
||
position: relative;
|
||
width: 96px;
|
||
height: 96px;
|
||
border: var(--n-item-border-image-card);
|
||
border-radius: var(--n-border-radius);
|
||
padding: 0;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
transition: border-color .3s var(--n-bezier), background-color .3s var(--n-bezier);
|
||
border-radius: var(--n-border-radius);
|
||
overflow: hidden;
|
||
`,[b("progress",`
|
||
position: absolute;
|
||
left: 8px;
|
||
bottom: 8px;
|
||
right: 8px;
|
||
width: unset;
|
||
`),b("upload-file-info",`
|
||
padding: 0;
|
||
width: 100%;
|
||
height: 100%;
|
||
`,[K("thumbnail",`
|
||
width: 100%;
|
||
height: 100%;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 36px;
|
||
`,[U("img",`
|
||
width: 100%;
|
||
`)])]),U("&::before",`
|
||
position: absolute;
|
||
z-index: 1;
|
||
left: 0;
|
||
right: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
border-radius: inherit;
|
||
opacity: 0;
|
||
transition: opacity .2s var(--n-bezier);
|
||
content: "";
|
||
`),U("&:hover",[U("&::before","opacity: 1;"),b("upload-file-info",[K("thumbnail","opacity: .12;")])])]),V("error-status",[U("&:hover",`
|
||
background-color: var(--n-item-color-hover-error);
|
||
`),b("upload-file-info",[K("name","color: var(--n-item-text-color-error);"),K("thumbnail","color: var(--n-item-text-color-error);")]),V("image-card-type",`
|
||
border: var(--n-item-border-image-card-error);
|
||
`)]),V("with-url",`
|
||
cursor: pointer;
|
||
`,[b("upload-file-info",[K("name",`
|
||
color: var(--n-item-text-color-success);
|
||
text-decoration-color: var(--n-item-text-color-success);
|
||
`,[U("a",`
|
||
text-decoration: underline;
|
||
`)])])]),b("upload-file-info",`
|
||
position: relative;
|
||
padding-top: 6px;
|
||
padding-bottom: 6px;
|
||
display: flex;
|
||
flex-wrap: nowrap;
|
||
`,[K("thumbnail",`
|
||
font-size: 18px;
|
||
opacity: 1;
|
||
transition: opacity .2s var(--n-bezier);
|
||
color: var(--n-item-icon-color);
|
||
`,[b("base-icon",`
|
||
margin-right: 2px;
|
||
vertical-align: middle;
|
||
transition: color .3s var(--n-bezier);
|
||
`)]),K("action",`
|
||
padding-top: inherit;
|
||
padding-bottom: inherit;
|
||
position: absolute;
|
||
right: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
width: 80px;
|
||
display: flex;
|
||
align-items: center;
|
||
transition: opacity .2s var(--n-bezier);
|
||
justify-content: flex-end;
|
||
opacity: 0;
|
||
`,[b("button",[U("&:not(:last-child)",{marginRight:"4px"}),b("base-icon",[U("svg",[Kt()])])]),V("image-type",`
|
||
position: relative;
|
||
max-width: 80px;
|
||
width: auto;
|
||
`),V("image-card-type",`
|
||
z-index: 2;
|
||
position: absolute;
|
||
width: 100%;
|
||
height: 100%;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
top: 0;
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
`)]),K("name",`
|
||
color: var(--n-item-text-color);
|
||
flex: 1;
|
||
display: flex;
|
||
justify-content: center;
|
||
text-overflow: ellipsis;
|
||
overflow: hidden;
|
||
flex-direction: column;
|
||
text-decoration-color: #0000;
|
||
font-size: var(--n-font-size);
|
||
transition:
|
||
color .3s var(--n-bezier),
|
||
text-decoration-color .3s var(--n-bezier);
|
||
`,[U("a",`
|
||
color: inherit;
|
||
text-decoration: underline;
|
||
`)])])])]),b("upload-file-input",`
|
||
display: none;
|
||
width: 0;
|
||
height: 0;
|
||
opacity: 0;
|
||
`)]);var Je=function(e,t,o,r){function l(i){return i instanceof o?i:new o(function(u){u(i)})}return new(o||(o=Promise))(function(i,u){function c(s){try{a(r.next(s))}catch(f){u(f)}}function d(s){try{a(r.throw(s))}catch(f){u(f)}}function a(s){s.done?i(s.value):l(s.value).then(c,d)}a((r=r.apply(e,t||[])).next())})};function Fn(e,t,o){const{doChange:r,xhrMap:l}=e;let i=0;function u(d){var a;let s=Object.assign({},t,{status:"error",percentage:i});l.delete(t.id),s=se(((a=e.onError)===null||a===void 0?void 0:a.call(e,{file:s,event:d}))||s),r(s,d)}function c(d){var a;if(e.isErrorState){if(e.isErrorState(o)){u(d);return}}else if(o.status<200||o.status>=300){u(d);return}let s=Object.assign({},t,{status:"finished",percentage:i});l.delete(t.id),s=se(((a=e.onFinish)===null||a===void 0?void 0:a.call(e,{file:s,event:d}))||s),r(s,d)}return{handleXHRLoad:c,handleXHRError:u,handleXHRAbort(d){const a=Object.assign({},t,{status:"removed",file:null,percentage:i});l.delete(t.id),r(a,d)},handleXHRProgress(d){const a=Object.assign({},t,{status:"uploading"});if(d.lengthComputable){const s=Math.ceil(d.loaded/d.total*100);a.percentage=s,i=s}r(a,d)}}}function jn(e){const{inst:t,file:o,data:r,headers:l,withCredentials:i,action:u,customRequest:c}=e,{doChange:d}=e.inst;let a=0;c({file:o,data:r,headers:l,withCredentials:i,action:u,onProgress(s){const f=Object.assign({},o,{status:"uploading"}),C=s.percent;f.percentage=C,a=C,d(f)},onFinish(){var s;let f=Object.assign({},o,{status:"finished",percentage:a});f=se(((s=t.onFinish)===null||s===void 0?void 0:s.call(t,{file:f}))||f),d(f)},onError(){var s;let f=Object.assign({},o,{status:"error",percentage:a});f=se(((s=t.onError)===null||s===void 0?void 0:s.call(t,{file:f}))||f),d(f)}})}function $n(e,t,o){const r=Fn(e,t,o);o.onabort=r.handleXHRAbort,o.onerror=r.handleXHRError,o.onload=r.handleXHRLoad,o.upload&&(o.upload.onprogress=r.handleXHRProgress)}function Ot(e,t){return typeof e=="function"?e({file:t}):e||{}}function Nn(e,t,o){const r=Ot(t,o);r&&Object.keys(r).forEach(l=>{e.setRequestHeader(l,r[l])})}function Vn(e,t,o){const r=Ot(t,o);r&&Object.keys(r).forEach(l=>{e.append(l,r[l])})}function Hn(e,t,o,{method:r,action:l,withCredentials:i,responseType:u,headers:c,data:d}){const a=new XMLHttpRequest;a.responseType=u,e.xhrMap.set(o.id,a),a.withCredentials=i;const s=new FormData;if(Vn(s,d,o),o.file!==null&&s.append(t,o.file),$n(e,o,a),l!==void 0){a.open(r.toUpperCase(),l),Nn(a,c,o),a.send(s);const f=Object.assign({},o,{status:"uploading"});e.doChange(f)}}const Zn=Object.assign(Object.assign({},ve.props),{name:{type:String,default:"file"},accept:String,action:String,customRequest:Function,directory:Boolean,directoryDnd:{type:Boolean,default:void 0},method:{type:String,default:"POST"},multiple:Boolean,showFileList:{type:Boolean,default:!0},data:[Object,Function],headers:[Object,Function],withCredentials:Boolean,responseType:{type:String,default:""},disabled:{type:Boolean,default:void 0},onChange:Function,onRemove:Function,onFinish:Function,onError:Function,onBeforeUpload:Function,isErrorState:Function,onDownload:Function,defaultUpload:{type:Boolean,default:!0},fileList:Array,"onUpdate:fileList":[Function,Array],onUpdateFileList:[Function,Array],fileListClass:String,fileListStyle:[String,Object],defaultFileList:{type:Array,default:()=>[]},showCancelButton:{type:Boolean,default:!0},showRemoveButton:{type:Boolean,default:!0},showDownloadButton:Boolean,showRetryButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},listType:{type:String,default:"text"},onPreview:Function,shouldUseThumbnailUrl:{type:Function,default:e=>On?_t(e):!1},createThumbnailUrl:Function,abstract:Boolean,max:Number,showTrigger:{type:Boolean,default:!0},imageGroupProps:Object,inputProps:Object,triggerClass:String,triggerStyle:[String,Object],renderIcon:Function}),Wn=Q({name:"Upload",props:Zn,setup(e){e.abstract&&e.listType==="image-card"&&me("upload","when the list-type is image-card, abstract is not supported.");const{mergedClsPrefixRef:t,inlineThemeDisabled:o}=pe(e),r=ve("Upload","-upload",An,Qt,e,t),l=eo(e),i=j(()=>{const{max:v}=e;return v!==void 0?w.value.length>=v:!1}),u=$(e.defaultFileList),c=S(e,"fileList"),d=$(null),a={value:!1},s=$(!1),f=new Map,C=to(c,u),w=j(()=>C.value.map(se));function x(){var v;(v=d.value)===null||v===void 0||v.click()}function A(v){const P=v.target;N(P.files?Array.from(P.files).map(_=>({file:_,entry:null,source:"input"})):null,v),P.value=""}function Z(v){const{"onUpdate:fileList":P,onUpdateFileList:_}=e;P&&Ne(P,v),_&&Ne(_,v),u.value=v}const F=j(()=>e.multiple||e.directory);function N(v,P){if(!v||v.length===0)return;const{onBeforeUpload:_}=e;v=F.value?v:[v[0]];const{max:z,accept:T}=e;v=v.filter(({file:D,source:k})=>k==="dnd"&&(T!=null&&T.trim())?kn(D.name,D.type,T):!0),z&&(v=v.slice(0,z-w.value.length));const B=Se();Promise.all(v.map(D=>Je(this,[D],void 0,function*({file:k,entry:Y}){var W;const ee={id:Se(),batchId:B,name:k.name,status:"pending",percentage:0,file:k,url:null,type:k.type,thumbnailUrl:null,fullPath:(W=Y==null?void 0:Y.fullPath)!==null&&W!==void 0?W:`/${k.webkitRelativePath||k.name}`};return!_||(yield _({file:ee,fileList:w.value}))!==!1?ee:null}))).then(D=>Je(this,void 0,void 0,function*(){let k=Promise.resolve();D.forEach(Y=>{k=k.then(no).then(()=>{Y&&I(Y,P,{append:!0})})}),yield k})).then(()=>{e.defaultUpload&&X()})}function X(v){const{method:P,action:_,withCredentials:z,headers:T,data:B,name:D}=e,k=v!==void 0?w.value.filter(W=>W.id===v):w.value,Y=v!==void 0;k.forEach(W=>{const{status:ee}=W;(ee==="pending"||ee==="error"&&Y)&&(e.customRequest?jn({inst:{doChange:I,xhrMap:f,onFinish:e.onFinish,onError:e.onError},file:W,action:_,withCredentials:z,headers:T,data:B,customRequest:e.customRequest}):Hn({doChange:I,xhrMap:f,onFinish:e.onFinish,onError:e.onError,isErrorState:e.isErrorState},D,W,{method:P,action:_,withCredentials:z,responseType:e.responseType,headers:T,data:B}))})}const I=(v,P,_={append:!1,remove:!1})=>{const{append:z,remove:T}=_,B=Array.from(w.value),D=B.findIndex(k=>k.id===v.id);if(z||T||~D){z?B.push(v):T?B.splice(D,1):B.splice(D,1,v);const{onChange:k}=e;k&&k({file:v,fileList:B,event:P}),Z(B)}};function p(v){var P;if(v.thumbnailUrl)return v.thumbnailUrl;const{createThumbnailUrl:_}=e;return _?(P=_(v.file,v))!==null&&P!==void 0?P:v.url||"":v.url?v.url:v.file?Ln(v.file):""}const y=j(()=>{const{common:{cubicBezierEaseInOut:v},self:{draggerColor:P,draggerBorder:_,draggerBorderHover:z,itemColorHover:T,itemColorHoverError:B,itemTextColorError:D,itemTextColorSuccess:k,itemTextColor:Y,itemIconColor:W,itemDisabledOpacity:ee,lineHeight:we,borderRadius:de,fontSize:be,itemBorderImageCardError:xe,itemBorderImageCard:Ce}}=r.value;return{"--n-bezier":v,"--n-border-radius":de,"--n-dragger-border":_,"--n-dragger-border-hover":z,"--n-dragger-color":P,"--n-font-size":be,"--n-item-color-hover":T,"--n-item-color-hover-error":B,"--n-item-disabled-opacity":ee,"--n-item-icon-color":W,"--n-item-text-color":Y,"--n-item-text-color-error":D,"--n-item-text-color-success":k,"--n-line-height":we,"--n-item-border-image-card-error":xe,"--n-item-border-image-card":Ce}}),R=o?tt("upload",void 0,y,e):void 0;Ee(ae,{mergedClsPrefixRef:t,mergedThemeRef:r,showCancelButtonRef:S(e,"showCancelButton"),showDownloadButtonRef:S(e,"showDownloadButton"),showRemoveButtonRef:S(e,"showRemoveButton"),showRetryButtonRef:S(e,"showRetryButton"),onRemoveRef:S(e,"onRemove"),onDownloadRef:S(e,"onDownload"),mergedFileListRef:w,triggerClassRef:S(e,"triggerClass"),triggerStyleRef:S(e,"triggerStyle"),shouldUseThumbnailUrlRef:S(e,"shouldUseThumbnailUrl"),renderIconRef:S(e,"renderIcon"),xhrMap:f,submit:X,doChange:I,showPreviewButtonRef:S(e,"showPreviewButton"),onPreviewRef:S(e,"onPreview"),getFileThumbnailUrlResolver:p,listTypeRef:S(e,"listType"),dragOverRef:s,openOpenFileDialog:x,draggerInsideRef:a,handleFileAddition:N,mergedDisabledRef:l.mergedDisabledRef,maxReachedRef:i,fileListClassRef:S(e,"fileListClass"),fileListStyleRef:S(e,"fileListStyle"),abstractRef:S(e,"abstract"),acceptRef:S(e,"accept"),cssVarsRef:o?void 0:y,themeClassRef:R==null?void 0:R.themeClass,onRender:R==null?void 0:R.onRender,showTriggerRef:S(e,"showTrigger"),imageGroupPropsRef:S(e,"imageGroupProps"),mergedDirectoryDndRef:j(()=>{var v;return(v=e.directoryDnd)!==null&&v!==void 0?v:e.directory})});const E={clear:()=>{u.value=[]},submit:X,openOpenFileDialog:x};return Object.assign({mergedClsPrefix:t,draggerInsideRef:a,inputElRef:d,mergedTheme:r,dragOver:s,mergedMultiple:F,cssVars:o?void 0:y,themeClass:R==null?void 0:R.themeClass,onRender:R==null?void 0:R.onRender,handleFileInputChange:A},E)},render(){var e,t;const{draggerInsideRef:o,mergedClsPrefix:r,$slots:l,directory:i,onRender:u}=this;if(l.default&&!this.abstract){const d=l.default()[0];!((e=d==null?void 0:d.type)===null||e===void 0)&&e[Rt]&&(o.value=!0)}const c=n("input",Object.assign({},this.inputProps,{ref:"inputElRef",type:"file",class:`${r}-upload-file-input`,accept:this.accept,multiple:this.mergedMultiple,onChange:this.handleFileInputChange,webkitdirectory:i||void 0,directory:i||void 0}));return this.abstract?n(he,null,(t=l.default)===null||t===void 0?void 0:t.call(l),n(oo,{to:"body"},c)):(u==null||u(),n("div",{class:[`${r}-upload`,o.value&&`${r}-upload--dragger-inside`,this.dragOver&&`${r}-upload--drag-over`,this.themeClass],style:this.cssVars},c,this.showTrigger&&this.listType!=="image-card"&&n(Lt,null,l),this.showFileList&&n(zn,null,l)))}}),Xn={class:"inline-block",viewBox:"0 0 16 16",width:"1em",height:"1em"},Yn=rt("path",{fill:"currentColor","fill-rule":"evenodd",d:"M11.78 5.841a.75.75 0 0 1-1.06 0l-1.97-1.97v7.379a.75.75 0 0 1-1.5 0V3.871l-1.97 1.97a.75.75 0 0 1-1.06-1.06l3.25-3.25L8 1l.53.53l3.25 3.25a.75.75 0 0 1 0 1.061M2.5 9.75a.75.75 0 0 0-1.5 0V13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9.75a.75.75 0 0 0-1.5 0V13a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5z","clip-rule":"evenodd"},null,-1),Gn=[Yn];function qn(e,t){return Be(),nt("svg",Xn,[...Gn])}const dr={name:"pajamas-export",render:qn},Jn={class:"inline-block",viewBox:"0 0 16 16",width:"1em",height:"1em"},Kn=rt("path",{fill:"currentColor","fill-rule":"evenodd",d:"M11.78 7.159a.75.75 0 0 0-1.06 0l-1.97 1.97V1.75a.75.75 0 0 0-1.5 0v7.379l-1.97-1.97a.75.75 0 0 0-1.06 1.06l3.25 3.25L8 12l.53-.53l3.25-3.25a.75.75 0 0 0 0-1.061M2.5 9.75a.75.75 0 1 0-1.5 0V13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9.75a.75.75 0 0 0-1.5 0V13a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5z","clip-rule":"evenodd"},null,-1),Qn=[Kn];function er(e,t){return Be(),nt("svg",Jn,[...Qn])}const tr={name:"pajamas-import",render:er},ur=Q({name:"FileUpload",__name:"file-upload",props:{accept:{},action:{}},emits:["refresh"],setup(e,{emit:t}){const o=t,r=i=>{var u,c;return((u=i.file.file)==null?void 0:u.type)!=="application/json"?((c=window.$message)==null||c.error(ge("common.checkUploadType")),!1):!0},l=({file:i,data:u,headers:c,withCredentials:d,action:a,onFinish:s,onError:f,onProgress:C})=>{const w=new FormData;u&&Object.keys(u).forEach(x=>{w.append(x,u[x])}),w.append("file",i.file),so({url:a,method:"post",data:w,withCredentials:d,headers:c,onUploadProgress:({progress:x})=>{C({percent:Math.ceil(x)})}}).then(()=>{s(),o("refresh")}).catch(()=>f())};return(i,u)=>{const c=tr,d=le,a=Wn;return Be(),ro(a,{action:i.action,accept:i.accept,"custom-request":l,"show-file-list":!1,onBeforeUpload:r},{default:Te(()=>[Ve(d,{size:"small",ghost:"",type:"primary"},{icon:Te(()=>[Ve(c,{class:"text-icon"})]),default:Te(()=>[io(" "+ao(lo(ge)("common.import")),1)]),_:1})]),_:1},8,["action","accept"])}}});var or={VITE_APP_TITLE:"Snail Job",VITE_APP_DESC:"A flexible, reliable, and fast platform for distributed task retry and distributed task scheduling.",VITE_APP_VERSION:"1.1.0-beta1",VITE_APP_DEFAULT_TOKEN:"SJ_Wyz3dmsdbDOkDujOTSSoBjGQP1BMsVnj",VITE_ICON_PREFIX:"icon",VITE_ICON_LOCAL_PREFIX:"icon-local",VITE_AUTH_ROUTE_MODE:"static",VITE_ROUTE_HOME:"home",VITE_MENU_ICON:"mdi:menu",VITE_HTTP_PROXY:"Y",VITE_ROUTER_HISTORY_MODE:"hash",VITE_SERVICE_SUCCESS_CODE:"1",VITE_SERVICE_LOGOUT_CODES:"8888,8889",VITE_SERVICE_MODAL_LOGOUT_CODES:"5001",VITE_SERVICE_EXPIRED_TOKEN_CODES:"9999,9998",VITE_STATIC_SUPER_ROLE:"R_ADMIN",VITE_SOURCE_MAP:"N",VITE_STORAGE_PREFIX:"",VITE_ICONIFY_URL:"/snail-job/iconify",VITE_UPDATE_NOTIFY:"N",VITE_BASE_URL:"/snail-job",VITE_SERVICE_BASE_URL:"/snail-job",BASE_URL:"/snail-job",MODE:"prod",DEV:!1,PROD:!0,SSR:!1};const{baseURL:nr}=uo(or);function rr(e,t,o=!0){var r,l;try{let i=t;o&&(i=`${t}-${new Date().getTime()}.json`),ir(e,i)}catch{(r=window.$message)==null||r.error(ge("common.downloadFail"))}finally{(l=window.$loading)==null||l.endLoading()}}function ir(e,t){const o=[e],r=new Blob(o,{type:"application/octet-stream"}),l=window.URL.createObjectURL(r),i=document.createElement("a");i.style.display="none",i.href=l,i.setAttribute("download",t),typeof i.download>"u"&&i.setAttribute("target","_blank"),document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(l)}const cr=(e,t,o)=>{var i;(i=window.$loading)==null||i.startLoading();const r=He.get("token"),l=He.get("namespaceId");fetch(`${nr}${e}?t=${new Date().getTime()}`,{method:"post",body:JSON.stringify(t),headers:{"SNAIL-JOB-AUTH":r,"SNAIL-JOB-NAMESPACE-ID":l,"Content-Type":"application/json;charset=utf-8;"}}).then(async u=>u.blob()).then(u=>rr(u,o)).catch(()=>{var u;return(u=window.$message)==null?void 0:u.error(ge("common.downloadFail"))}).finally(()=>{var u;return(u=window.$loading)==null?void 0:u.endLoading()})};export{ur as _,dr as a,cr as d};
|