484 lines
95 KiB
JavaScript
484 lines
95 KiB
JavaScript
import{t as Et,d as re,h as t,r as ge,i as At,c as C,a as lt,b as H,e as j,f as le,u as Ce,g as Tr,j as jt,p as We,k as Br,l as ct,m as Vt,n as qe,o as _r,q as Or,s as xe,v as ft,w as yt,x as Lr,N as te,F as Le,L as zr,y as Ct,z as Dr,T as Qe,A as Mr,B as X,C as O,D as gt,E as Ht,G as Fe,H as ce,I as G,J as pt,K as Ur,M as ze,O as Nr,_ as Wt,P as Fr,Q as at,R as Er,S as je,U as st,V as ut,W as Rt,X as qt,Y as Gt,Z as me,$ as Ar,a0 as kt,a1 as be,a2 as Zt,a3 as Xt,a4 as Yt,a5 as Kt,a6 as Jt,a7 as $e,a8 as St,a9 as $t,aa as jr,ab as Ge,ac as Qt,ad as Pt,ae,af as Vr,ag as Hr,ah as Wr,ai as Ve,aj as ht,ak as vt,al as D,am as ee,an as mt,ao as $,ap as Y,aq as De,ar as er,as as qr,at as Gr,au as Zr,av as et,aw as Xr,ax as Yr,ay as Kr}from"./index-DnpM0Ntg.js";import{i as Jr,u as tr,d as rr,_ as bt,E as Qr,a as Ze,b as we,c as He,e as Xe,f as en,g as tn,h as rn,j as nn,k as on}from"./FormItem-DHmVxm6n.js";function ln(e,n,r,o){for(var i=-1,a=e==null?0:e.length;++i<a;)r=n(r,e[i],i,e);return r}function an(e){return function(n){return e==null?void 0:e[n]}}var sn={À:"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"},un=an(sn),dn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,cn="\\u0300-\\u036f",fn="\\ufe20-\\ufe2f",gn="\\u20d0-\\u20ff",pn=cn+fn+gn,hn="["+pn+"]",vn=RegExp(hn,"g");function mn(e){return e=Et(e),e&&e.replace(dn,un).replace(vn,"")}var bn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function wn(e){return e.match(bn)||[]}var xn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function yn(e){return xn.test(e)}var nr="\\ud800-\\udfff",Cn="\\u0300-\\u036f",Rn="\\ufe20-\\ufe2f",kn="\\u20d0-\\u20ff",Sn=Cn+Rn+kn,or="\\u2700-\\u27bf",ir="a-z\\xdf-\\xf6\\xf8-\\xff",$n="\\xac\\xb1\\xd7\\xf7",Pn="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",In="\\u2000-\\u206f",Tn=" \\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",lr="A-Z\\xc0-\\xd6\\xd8-\\xde",Bn="\\ufe0e\\ufe0f",ar=$n+Pn+In+Tn,sr="['’]",It="["+ar+"]",_n="["+Sn+"]",ur="\\d+",On="["+or+"]",dr="["+ir+"]",cr="[^"+nr+ar+ur+or+ir+lr+"]",Ln="\\ud83c[\\udffb-\\udfff]",zn="(?:"+_n+"|"+Ln+")",Dn="[^"+nr+"]",fr="(?:\\ud83c[\\udde6-\\uddff]){2}",gr="[\\ud800-\\udbff][\\udc00-\\udfff]",Te="["+lr+"]",Mn="\\u200d",Tt="(?:"+dr+"|"+cr+")",Un="(?:"+Te+"|"+cr+")",Bt="(?:"+sr+"(?:d|ll|m|re|s|t|ve))?",_t="(?:"+sr+"(?:D|LL|M|RE|S|T|VE))?",pr=zn+"?",hr="["+Bn+"]?",Nn="(?:"+Mn+"(?:"+[Dn,fr,gr].join("|")+")"+hr+pr+")*",Fn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",En="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",An=hr+pr+Nn,jn="(?:"+[On,fr,gr].join("|")+")"+An,Vn=RegExp([Te+"?"+dr+"+"+Bt+"(?="+[It,Te,"$"].join("|")+")",Un+"+"+_t+"(?="+[It,Te+Tt,"$"].join("|")+")",Te+"?"+Tt+"+"+Bt,Te+"+"+_t,En,Fn,ur,jn].join("|"),"g");function Hn(e){return e.match(Vn)||[]}function Wn(e,n,r){return e=Et(e),n=n,n===void 0?yn(e)?Hn(e):wn(e):e.match(n)||[]}var qn="['’]",Gn=RegExp(qn,"g");function Zn(e){return function(n){return ln(Wn(mn(n).replace(Gn,"")),e,"")}}var Xn=Zn(function(e,n,r){return e+(r?"-":"")+n.toLowerCase()});const vr=re({name:"Add",render(){return t("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M256 112V400M400 256H112",stroke:"currentColor","stroke-width":"32","stroke-linecap":"round","stroke-linejoin":"round"}))}}),Yn=ge("attach",()=>t("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},t("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},t("g",{fill:"currentColor","fill-rule":"nonzero"},t("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"}))))),Kn=ge("cancel",()=>t("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},t("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},t("g",{fill:"currentColor","fill-rule":"nonzero"},t("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"}))))),mr=ge("download",()=>t("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},t("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},t("g",{fill:"currentColor","fill-rule":"nonzero"},t("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"}))))),Jn=re({name:"Remove",render(){return t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t("line",{x1:"400",y1:"256",x2:"112",y2:"256",style:`
|
||
fill: none;
|
||
stroke: currentColor;
|
||
stroke-linecap: round;
|
||
stroke-linejoin: round;
|
||
stroke-width: 32px;
|
||
`}))}}),Qn=re({name:"ResizeSmall",render(){return t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},t("g",{fill:"none"},t("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"})))}}),eo=ge("retry",()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t("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;"}),t("polyline",{points:"256 58 336 138 256 218",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}))),to=ge("rotateClockwise",()=>t("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("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"}),t("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"}))),ro=ge("rotateClockwise",()=>t("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("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"}),t("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"}))),no=ge("trash",()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t("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;"}),t("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;"}),t("line",{x1:"312",y1:"240",x2:"200",y2:"352",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),t("line",{x1:"312",y1:"352",x2:"200",y2:"240",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}))),oo=ge("zoomIn",()=>t("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("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"}),t("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"}))),io=ge("zoomOut",()=>t("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("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"}),t("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"}))),lo=At&&"loading"in document.createElement("img");function ao(e={}){var n;const{root:r=null}=e;return{hash:`${e.rootMargin||"0px 0px 0px 0px"}-${Array.isArray(e.threshold)?e.threshold.join(","):(n=e.threshold)!==null&&n!==void 0?n:"0"}`,options:Object.assign(Object.assign({},e),{root:(typeof r=="string"?document.querySelector(r):r)||document.documentElement})}}const tt=new WeakMap,rt=new WeakMap,nt=new WeakMap,so=(e,n,r)=>{if(!e)return()=>{};const o=ao(n),{root:i}=o.options;let a;const l=tt.get(i);l?a=l:(a=new Map,tt.set(i,a));let f,d;a.has(o.hash)?(d=a.get(o.hash),d[1].has(e)||(f=d[0],d[1].add(e),f.observe(e))):(f=new IntersectionObserver(p=>{p.forEach(h=>{if(h.isIntersecting){const v=rt.get(h.target),c=nt.get(h.target);v&&v(),c&&(c.value=!0)}})},o.options),f.observe(e),d=[f,new Set([e])],a.set(o.hash,d));let u=!1;const s=()=>{u||(rt.delete(e),nt.delete(e),u=!0,d[1].has(e)&&(d[0].unobserve(e),d[1].delete(e)),d[1].size<=0&&a.delete(o.hash),a.size||tt.delete(i))};return rt.set(e,s),nt.set(e,r),s},Q="0!important",br="-1px!important";function Pe(e){return H(`${e}-type`,[j("& +",[C("button",{},[H(`${e}-type`,[le("border",{borderLeftWidth:Q}),le("state-border",{left:br})])])])])}function Ie(e){return H(`${e}-type`,[j("& +",[C("button",[H(`${e}-type`,[le("border",{borderTopWidth:Q}),le("state-border",{top:br})])])])])}const uo=C("button-group",`
|
||
flex-wrap: nowrap;
|
||
display: inline-flex;
|
||
position: relative;
|
||
`,[lt("vertical",{flexDirection:"row"},[lt("rtl",[C("button",[j("&:first-child:not(:last-child)",`
|
||
margin-right: ${Q};
|
||
border-top-right-radius: ${Q};
|
||
border-bottom-right-radius: ${Q};
|
||
`),j("&:last-child:not(:first-child)",`
|
||
margin-left: ${Q};
|
||
border-top-left-radius: ${Q};
|
||
border-bottom-left-radius: ${Q};
|
||
`),j("&:not(:first-child):not(:last-child)",`
|
||
margin-left: ${Q};
|
||
margin-right: ${Q};
|
||
border-radius: ${Q};
|
||
`),Pe("default"),H("ghost",[Pe("primary"),Pe("info"),Pe("success"),Pe("warning"),Pe("error")])])])]),H("vertical",{flexDirection:"column"},[C("button",[j("&:first-child:not(:last-child)",`
|
||
margin-bottom: ${Q};
|
||
margin-left: ${Q};
|
||
margin-right: ${Q};
|
||
border-bottom-left-radius: ${Q};
|
||
border-bottom-right-radius: ${Q};
|
||
`),j("&:last-child:not(:first-child)",`
|
||
margin-top: ${Q};
|
||
margin-left: ${Q};
|
||
margin-right: ${Q};
|
||
border-top-left-radius: ${Q};
|
||
border-top-right-radius: ${Q};
|
||
`),j("&:not(:first-child):not(:last-child)",`
|
||
margin: ${Q};
|
||
border-radius: ${Q};
|
||
`),Ie("default"),H("ghost",[Ie("primary"),Ie("info"),Ie("success"),Ie("warning"),Ie("error")])])])]),co={size:{type:String,default:void 0},vertical:Boolean},wr=re({name:"ButtonGroup",props:co,setup(e){const{mergedClsPrefixRef:n,mergedRtlRef:r}=Ce(e);return Tr("-button-group",uo,n),We(Br,e),{rtlEnabled:jt("ButtonGroup",r,n),mergedClsPrefix:n}},render(){const{mergedClsPrefix:e}=this;return t("div",{class:[`${e}-button-group`,this.rtlEnabled&&`${e}-button-group--rtl`,this.vertical&&`${e}-button-group--vertical`],role:"group"},this.$slots)}});function fo(e){const{textColorDisabled:n}=e;return{iconColorDisabled:n}}const go=ct({name:"InputNumber",common:qe,peers:{Button:Vt,Input:Jr},self:fo});function po(e){const{infoColor:n,successColor:r,warningColor:o,errorColor:i,textColor2:a,progressRailColor:l,fontSize:f,fontWeight:d}=e;return{fontSize:f,fontSizeCircle:"28px",fontWeightCircle:d,railColor:l,railHeight:"8px",iconSizeCircle:"36px",iconSizeLine:"18px",iconColor:n,iconColorInfo:n,iconColorSuccess:r,iconColorWarning:o,iconColorError:i,textColorCircle:a,textColorLineInner:"rgb(255, 255, 255)",textColorLineOuter:a,fillColor:n,fillColorInfo:n,fillColorSuccess:r,fillColorWarning:o,fillColorError:i,lineBgProcessing:"linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)"}}const xr={name:"Progress",common:qe,self:po};function ho(e){const{iconColor:n,primaryColor:r,errorColor:o,textColor2:i,successColor:a,opacityDisabled:l,actionColor:f,borderColor:d,hoverColor:u,lineHeight:s,borderRadius:p,fontSize:h}=e;return{fontSize:h,lineHeight:s,borderRadius:p,draggerColor:f,draggerBorder:`1px dashed ${d}`,draggerBorderHover:`1px dashed ${r}`,itemColorHover:u,itemColorHoverError:_r(o,{alpha:.06}),itemTextColor:i,itemTextColorError:o,itemTextColorSuccess:a,itemIconColor:n,itemDisabledOpacity:l,itemBorderImageCardError:`1px solid ${o}`,itemBorderImageCard:`1px solid ${d}`}}const vo=ct({name:"Upload",common:qe,peers:{Button:Vt,Progress:xr},self:ho});function mo(){return{toolbarIconColor:"rgba(255, 255, 255, .9)",toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}const bo=ct({name:"Image",common:qe,peers:{Tooltip:Or},self:mo});function wo(){return t("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("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"}))}function xo(){return t("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("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"}))}function yo(){return t("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("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"}))}const wt=Object.assign(Object.assign({},xe.props),{onPreviewPrev:Function,onPreviewNext:Function,showToolbar:{type:Boolean,default:!0},showToolbarTooltip:Boolean,renderToolbar:Function}),yr=ft("n-image"),Co=j([j("body >",[C("image-container","position: fixed;")]),C("image-preview-container",`
|
||
position: fixed;
|
||
left: 0;
|
||
right: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
display: flex;
|
||
`),C("image-preview-overlay",`
|
||
z-index: -1;
|
||
position: absolute;
|
||
left: 0;
|
||
right: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
background: rgba(0, 0, 0, .3);
|
||
`,[yt()]),C("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;
|
||
`,[C("base-icon",`
|
||
padding: 0 8px;
|
||
font-size: 28px;
|
||
cursor: pointer;
|
||
`),yt()]),C("image-preview-wrapper",`
|
||
position: absolute;
|
||
left: 0;
|
||
right: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
display: flex;
|
||
pointer-events: none;
|
||
`,[Lr()]),C("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);
|
||
`),C("image",`
|
||
display: inline-flex;
|
||
max-height: 100%;
|
||
max-width: 100%;
|
||
`,[lt("preview-disabled",`
|
||
cursor: pointer;
|
||
`),j("img",`
|
||
border-radius: inherit;
|
||
`)])]),Ee=32,Cr=re({name:"ImagePreview",props:Object.assign(Object.assign({},wt),{onNext:Function,onPrev:Function,clsPrefix:{type:String,required:!0}}),setup(e){const n=xe("Image","-image",Co,bo,e,X(e,"clsPrefix"));let r=null;const o=O(null),i=O(null),a=O(void 0),l=O(!1),f=O(!1),{localeRef:d}=tr("Image");function u(){const{value:y}=i;if(!r||!y)return;const{style:P}=y,S=r.getBoundingClientRect(),Z=S.left+S.width/2,g=S.top+S.height/2;P.transformOrigin=`${Z}px ${g}px`}function s(y){var P,S;switch(y.key){case" ":y.preventDefault();break;case"ArrowLeft":(P=e.onPrev)===null||P===void 0||P.call(e);break;case"ArrowRight":(S=e.onNext)===null||S===void 0||S.call(e);break;case"Escape":Re();break}}gt(l,y=>{y?ze("keydown",document,s):Fe("keydown",document,s)}),Ht(()=>{Fe("keydown",document,s)});let p=0,h=0,v=0,c=0,w=0,T=0,U=0,_=0,V=!1;function M(y){const{clientX:P,clientY:S}=y;v=P-p,c=S-h,Fr(N)}function R(y){const{mouseUpClientX:P,mouseUpClientY:S,mouseDownClientX:Z,mouseDownClientY:g}=y,k=Z-P,I=g-S,A=`vertical${I>0?"Top":"Bottom"}`,oe=`horizontal${k>0?"Left":"Right"}`;return{moveVerticalDirection:A,moveHorizontalDirection:oe,deltaHorizontal:k,deltaVertical:I}}function L(y){const{value:P}=o;if(!P)return{offsetX:0,offsetY:0};const S=P.getBoundingClientRect(),{moveVerticalDirection:Z,moveHorizontalDirection:g,deltaHorizontal:k,deltaVertical:I}=y||{};let A=0,oe=0;return S.width<=window.innerWidth?A=0:S.left>0?A=(S.width-window.innerWidth)/2:S.right<window.innerWidth?A=-(S.width-window.innerWidth)/2:g==="horizontalRight"?A=Math.min((S.width-window.innerWidth)/2,w-(k??0)):A=Math.max(-((S.width-window.innerWidth)/2),w-(k??0)),S.height<=window.innerHeight?oe=0:S.top>0?oe=(S.height-window.innerHeight)/2:S.bottom<window.innerHeight?oe=-(S.height-window.innerHeight)/2:Z==="verticalBottom"?oe=Math.min((S.height-window.innerHeight)/2,T-(I??0)):oe=Math.max(-((S.height-window.innerHeight)/2),T-(I??0)),{offsetX:A,offsetY:oe}}function B(y){Fe("mousemove",document,M),Fe("mouseup",document,B);const{clientX:P,clientY:S}=y;V=!1;const Z=R({mouseUpClientX:P,mouseUpClientY:S,mouseDownClientX:U,mouseDownClientY:_}),g=L(Z);v=g.offsetX,c=g.offsetY,N()}const W=ce(yr,null);function b(y){var P,S;if((S=(P=W==null?void 0:W.previewedImgPropsRef.value)===null||P===void 0?void 0:P.onMousedown)===null||S===void 0||S.call(P,y),y.button!==0)return;const{clientX:Z,clientY:g}=y;V=!0,p=Z-v,h=g-c,w=v,T=c,U=Z,_=g,N(),ze("mousemove",document,M),ze("mouseup",document,B)}const q=1.5;let F=0,E=1,K=0;function ne(y){var P,S;(S=(P=W==null?void 0:W.previewedImgPropsRef.value)===null||P===void 0?void 0:P.onDblclick)===null||S===void 0||S.call(P,y);const Z=pe();E=E===Z?1:Z,N()}function J(){E=1,F=0}function x(){var y;J(),K=0,(y=e.onPrev)===null||y===void 0||y.call(e)}function m(){var y;J(),K=0,(y=e.onNext)===null||y===void 0||y.call(e)}function z(){K-=90,N()}function ie(){K+=90,N()}function se(){const{value:y}=o;if(!y)return 1;const{innerWidth:P,innerHeight:S}=window,Z=Math.max(1,y.naturalHeight/(S-Ee)),g=Math.max(1,y.naturalWidth/(P-Ee));return Math.max(3,Z*2,g*2)}function pe(){const{value:y}=o;if(!y)return 1;const{innerWidth:P,innerHeight:S}=window,Z=y.naturalHeight/(S-Ee),g=y.naturalWidth/(P-Ee);return Z<1&&g<1?1:Math.max(Z,g)}function ye(){const y=se();E<y&&(F+=1,E=Math.min(y,Math.pow(q,F)),N())}function ue(){if(E>.5){const y=E;F-=1,E=Math.max(.5,Math.pow(q,F));const P=y-E;N(!1);const S=L();E+=P,N(!1),E-=P,v=S.offsetX,c=S.offsetY,N()}}function de(){const y=a.value;y&&rr(y,void 0)}function N(y=!0){var P;const{value:S}=o;if(!S)return;const{style:Z}=S,g=Nr((P=W==null?void 0:W.previewedImgPropsRef.value)===null||P===void 0?void 0:P.style);let k="";if(typeof g=="string")k=`${g};`;else for(const A in g)k+=`${Xn(A)}: ${g[A]};`;const I=`transform-origin: center; transform: translateX(${v}px) translateY(${c}px) rotate(${K}deg) scale(${E});`;V?Z.cssText=`${k}cursor: grabbing; transition: none;${I}`:Z.cssText=`${k}cursor: grab;${I}${y?"":"transition: none;"}`,y||S.offsetHeight}function Re(){l.value=!l.value,f.value=!0}function ke(){E=pe(),F=Math.ceil(Math.log(E)/Math.log(q)),v=0,c=0,N()}const _e={setPreviewSrc:y=>{a.value=y},setThumbnailEl:y=>{r=y},toggleShow:Re};function Ye(y,P){if(e.showToolbarTooltip){const{value:S}=n;return t(Wt,{to:!1,theme:S.peers.Tooltip,themeOverrides:S.peerOverrides.Tooltip,keepAliveOnHover:!1},{default:()=>d.value[P],trigger:()=>y})}else return y}const Ue=G(()=>{const{common:{cubicBezierEaseInOut:y},self:{toolbarIconColor:P,toolbarBorderRadius:S,toolbarBoxShadow:Z,toolbarColor:g}}=n.value;return{"--n-bezier":y,"--n-toolbar-icon-color":P,"--n-toolbar-color":g,"--n-toolbar-border-radius":S,"--n-toolbar-box-shadow":Z}}),{inlineThemeDisabled:Ne}=Ce(),he=Ne?pt("image-preview",void 0,Ue,e):void 0;return Object.assign({previewRef:o,previewWrapperRef:i,previewSrc:a,show:l,appear:Ur(),displayed:f,previewedImgProps:W==null?void 0:W.previewedImgPropsRef,handleWheel(y){y.preventDefault()},handlePreviewMousedown:b,handlePreviewDblclick:ne,syncTransformOrigin:u,handleAfterLeave:()=>{J(),K=0,f.value=!1},handleDragStart:y=>{var P,S;(S=(P=W==null?void 0:W.previewedImgPropsRef.value)===null||P===void 0?void 0:P.onDragstart)===null||S===void 0||S.call(P,y),y.preventDefault()},zoomIn:ye,zoomOut:ue,handleDownloadClick:de,rotateCounterclockwise:z,rotateClockwise:ie,handleSwitchPrev:x,handleSwitchNext:m,withTooltip:Ye,resizeToOrignalImageSize:ke,cssVars:Ne?void 0:Ue,themeClass:he==null?void 0:he.themeClass,onRender:he==null?void 0:he.onRender},_e)},render(){var e,n;const{clsPrefix:r,renderToolbar:o,withTooltip:i}=this,a=i(t(te,{clsPrefix:r,onClick:this.handleSwitchPrev},{default:wo}),"tipPrevious"),l=i(t(te,{clsPrefix:r,onClick:this.handleSwitchNext},{default:xo}),"tipNext"),f=i(t(te,{clsPrefix:r,onClick:this.rotateCounterclockwise},{default:()=>t(ro,null)}),"tipCounterclockwise"),d=i(t(te,{clsPrefix:r,onClick:this.rotateClockwise},{default:()=>t(to,null)}),"tipClockwise"),u=i(t(te,{clsPrefix:r,onClick:this.resizeToOrignalImageSize},{default:()=>t(Qn,null)}),"tipOriginalSize"),s=i(t(te,{clsPrefix:r,onClick:this.zoomOut},{default:()=>t(io,null)}),"tipZoomOut"),p=i(t(te,{clsPrefix:r,onClick:this.handleDownloadClick},{default:()=>t(mr,null)}),"tipDownload"),h=i(t(te,{clsPrefix:r,onClick:this.toggleShow},{default:yo}),"tipClose"),v=i(t(te,{clsPrefix:r,onClick:this.zoomIn},{default:()=>t(oo,null)}),"tipZoomIn");return t(Le,null,(n=(e=this.$slots).default)===null||n===void 0?void 0:n.call(e),t(zr,{show:this.show},{default:()=>{var c;return this.show||this.displayed?((c=this.onRender)===null||c===void 0||c.call(this),Ct(t("div",{class:[`${r}-image-preview-container`,this.themeClass],style:this.cssVars,onWheel:this.handleWheel},t(Qe,{name:"fade-in-transition",appear:this.appear},{default:()=>this.show?t("div",{class:`${r}-image-preview-overlay`,onClick:this.toggleShow}):null}),this.showToolbar?t(Qe,{name:"fade-in-transition",appear:this.appear},{default:()=>this.show?t("div",{class:`${r}-image-preview-toolbar`},o?o({nodes:{prev:a,next:l,rotateCounterclockwise:f,rotateClockwise:d,resizeToOriginalSize:u,zoomOut:s,zoomIn:v,download:p,close:h}}):t(Le,null,this.onPrev?t(Le,null,a,l):null,f,d,u,s,v,p,h)):null}):null,t(Qe,{name:"fade-in-scale-up-transition",onAfterLeave:this.handleAfterLeave,appear:this.appear,onEnter:this.syncTransformOrigin,onBeforeLeave:this.syncTransformOrigin},{default:()=>{const{previewedImgProps:w={}}=this;return Ct(t("div",{class:`${r}-image-preview-wrapper`,ref:"previewWrapperRef"},t("img",Object.assign({},w,{draggable:!1,onMousedown:this.handlePreviewMousedown,onDblclick:this.handlePreviewDblclick,class:[`${r}-image-preview`,w.class],key:this.previewSrc,src:this.previewSrc,ref:"previewRef",onDragstart:this.handleDragStart}))),[[Mr,this.show]])}})),[[Dr,{enabled:this.show}]])):null}}))}}),Rr=ft("n-image-group"),Ro=wt,ko=re({name:"ImageGroup",props:Ro,setup(e){let n;const{mergedClsPrefixRef:r}=Ce(e),o=`c${at()}`,i=Er(),a=O(null),l=d=>{var u;n=d,(u=a.value)===null||u===void 0||u.setPreviewSrc(d)};function f(d){var u,s;if(!(i!=null&&i.proxy))return;const h=i.proxy.$el.parentElement.querySelectorAll(`[data-group-id=${o}]:not([data-error=true])`);if(!h.length)return;const v=Array.from(h).findIndex(c=>c.dataset.previewSrc===n);~v?l(h[(v+d+h.length)%h.length].dataset.previewSrc):l(h[0].dataset.previewSrc),d===1?(u=e.onPreviewNext)===null||u===void 0||u.call(e):(s=e.onPreviewPrev)===null||s===void 0||s.call(e)}return We(Rr,{mergedClsPrefixRef:r,setPreviewSrc:l,setThumbnailEl:d=>{var u;(u=a.value)===null||u===void 0||u.setThumbnailEl(d)},toggleShow:()=>{var d;(d=a.value)===null||d===void 0||d.toggleShow()},groupId:o,renderToolbarRef:X(e,"renderToolbar")}),{mergedClsPrefix:r,previewInstRef:a,next:()=>{f(1)},prev:()=>{f(-1)}}},render(){return t(Cr,{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)}}),So=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},wt),$o=re({name:"Image",props:So,slots:Object,inheritAttrs:!1,setup(e){const n=O(null),r=O(!1),o=O(null),i=ce(Rr,null),{mergedClsPrefixRef:a}=i||Ce(e),l={click:()=>{if(e.previewDisabled||r.value)return;const u=e.previewSrc||e.src;if(i){i.setPreviewSrc(u),i.setThumbnailEl(n.value),i.toggleShow();return}const{value:s}=o;s&&(s.setPreviewSrc(u),s.setThumbnailEl(n.value),s.toggleShow())}},f=O(!e.lazy);st(()=>{var u;(u=n.value)===null||u===void 0||u.setAttribute("data-group-id",(i==null?void 0:i.groupId)||"")}),st(()=>{if(e.lazy&&e.intersectionObserverOptions){let u;const s=ut(()=>{u==null||u(),u=void 0,u=so(n.value,e.intersectionObserverOptions,f)});Ht(()=>{s(),u==null||u()})}}),ut(()=>{var u;e.src||((u=e.imgProps)===null||u===void 0||u.src),r.value=!1});const d=O(!1);return We(yr,{previewedImgPropsRef:X(e,"previewedImgProps")}),Object.assign({mergedClsPrefix:a,groupId:i==null?void 0:i.groupId,previewInstRef:o,imageRef:n,showError:r,shouldStartLoading:f,loaded:d,mergedOnClick:u=>{var s,p;l.click(),(p=(s=e.imgProps)===null||s===void 0?void 0:s.onClick)===null||p===void 0||p.call(s,u)},mergedOnError:u=>{if(!f.value)return;r.value=!0;const{onError:s,imgProps:{onError:p}={}}=e;s==null||s(u),p==null||p(u)},mergedOnLoad:u=>{const{onLoad:s,imgProps:{onLoad:p}={}}=e;s==null||s(u),p==null||p(u),d.value=!0}},l)},render(){var e,n;const{mergedClsPrefix:r,imgProps:o={},loaded:i,$attrs:a,lazy:l}=this,f=je(this.$slots.error,()=>[]),d=(n=(e=this.$slots).placeholder)===null||n===void 0?void 0:n.call(e),u=this.src||o.src,s=this.showError&&f.length?f:t("img",Object.assign(Object.assign({},o),{ref:"imageRef",width:this.width||o.width,height:this.height||o.height,src:this.showError?this.fallbackSrc:l&&this.intersectionObserverOptions?this.shouldStartLoading?u:void 0:u,alt:this.alt||o.alt,"aria-label":this.alt||o.alt,onClick:this.mergedOnClick,onError:this.mergedOnError,onLoad:this.mergedOnLoad,loading:lo&&l&&!this.intersectionObserverOptions?"lazy":"eager",style:[o.style||"",d&&!i?{height:"0",width:"0",visibility:"hidden"}:"",{objectFit:this.objectFit}],"data-error":this.showError,"data-preview-src":this.previewSrc||this.src}));return t("div",Object.assign({},a,{role:"none",class:[a.class,`${r}-image`,(this.previewDisabled||this.showError)&&`${r}-image--preview-disabled`]}),this.groupId?s:t(Cr,{theme:this.theme,themeOverrides:this.themeOverrides,clsPrefix:r,ref:"previewInstRef",showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip,renderToolbar:this.renderToolbar},{default:()=>s}),!i&&d)}}),Po=j([C("input-number-suffix",`
|
||
display: inline-block;
|
||
margin-right: 10px;
|
||
`),C("input-number-prefix",`
|
||
display: inline-block;
|
||
margin-left: 10px;
|
||
`)]);function Io(e){return e==null||typeof e=="string"&&e.trim()===""?null:Number(e)}function To(e){return e.includes(".")&&(/^(-)?\d+.*(\.|0)$/.test(e)||/^-?\d*$/.test(e))||e==="-"||e==="-0"}function ot(e){return e==null?!0:!Number.isNaN(e)}function Ot(e,n){return typeof e!="number"?"":n===void 0?String(e):e.toFixed(n)}function it(e){if(e===null)return null;if(typeof e=="number")return e;{const n=Number(e);return Number.isNaN(n)?null:n}}const Lt=800,zt=100,Bo=Object.assign(Object.assign({},xe.props),{autofocus:Boolean,loading:{type:Boolean,default:void 0},placeholder:String,defaultValue:{type:Number,default:null},value:Number,step:{type:[Number,String],default:1},min:[Number,String],max:[Number,String],size:String,disabled:{type:Boolean,default:void 0},validator:Function,bordered:{type:Boolean,default:void 0},showButton:{type:Boolean,default:!0},buttonPlacement:{type:String,default:"right"},inputProps:Object,readonly:Boolean,clearable:Boolean,keyboard:{type:Object,default:{}},updateValueOnInput:{type:Boolean,default:!0},round:{type:Boolean,default:void 0},parse:Function,format:Function,precision:Number,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onChange:[Function,Array]}),xt=re({name:"InputNumber",props:Bo,slots:Object,setup(e){const{mergedBorderedRef:n,mergedClsPrefixRef:r,mergedRtlRef:o}=Ce(e),i=xe("InputNumber","-input-number",Po,go,e,r),{localeRef:a}=tr("InputNumber"),l=qt(e),{mergedSizeRef:f,mergedDisabledRef:d,mergedStatusRef:u}=l,s=O(null),p=O(null),h=O(null),v=O(e.defaultValue),c=X(e,"value"),w=Gt(c,v),T=O(""),U=g=>{const k=String(g).split(".")[1];return k?k.length:0},_=g=>{const k=[e.min,e.max,e.step,g].map(I=>I===void 0?0:U(I));return Math.max(...k)},V=me(()=>{const{placeholder:g}=e;return g!==void 0?g:a.value.placeholder}),M=me(()=>{const g=it(e.step);return g!==null?g===0?1:Math.abs(g):1}),R=me(()=>{const g=it(e.min);return g!==null?g:null}),L=me(()=>{const g=it(e.max);return g!==null?g:null}),B=()=>{const{value:g}=w;if(ot(g)){const{format:k,precision:I}=e;k?T.value=k(g):g===null||I===void 0||U(g)>I?T.value=Ot(g,void 0):T.value=Ot(g,I)}else T.value=String(g)};B();const W=g=>{const{value:k}=w;if(g===k){B();return}const{"onUpdate:value":I,onUpdateValue:A,onChange:oe}=e,{nTriggerFormInput:fe,nTriggerFormChange:Se}=l;oe&&be(oe,g),A&&be(A,g),I&&be(I,g),v.value=g,fe(),Se()},b=({offset:g,doUpdateIfValid:k,fixPrecision:I,isInputing:A})=>{const{value:oe}=T;if(A&&To(oe))return!1;const fe=(e.parse||Io)(oe);if(fe===null)return k&&W(null),null;if(ot(fe)){const Se=U(fe),{precision:Oe}=e;if(Oe!==void 0&&Oe<Se&&!I)return!1;let ve=Number.parseFloat((fe+g).toFixed(Oe??_(fe)));if(ot(ve)){const{value:Ke}=L,{value:Je}=R;if(Ke!==null&&ve>Ke){if(!k||A)return!1;ve=Ke}if(Je!==null&&ve<Je){if(!k||A)return!1;ve=Je}return e.validator&&!e.validator(ve)?!1:(k&&W(ve),ve)}}return!1},q=me(()=>b({offset:0,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})===!1),F=me(()=>{const{value:g}=w;if(e.validator&&g===null)return!1;const{value:k}=M;return b({offset:-k,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1}),E=me(()=>{const{value:g}=w;if(e.validator&&g===null)return!1;const{value:k}=M;return b({offset:+k,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1});function K(g){const{onFocus:k}=e,{nTriggerFormFocus:I}=l;k&&be(k,g),I()}function ne(g){var k,I;if(g.target===((k=s.value)===null||k===void 0?void 0:k.wrapperElRef))return;const A=b({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0});if(A!==!1){const Se=(I=s.value)===null||I===void 0?void 0:I.inputElRef;Se&&(Se.value=String(A||"")),w.value===A&&B()}else B();const{onBlur:oe}=e,{nTriggerFormBlur:fe}=l;oe&&be(oe,g),fe(),Zt(()=>{B()})}function J(g){const{onClear:k}=e;k&&be(k,g)}function x(){const{value:g}=E;if(!g){_e();return}const{value:k}=w;if(k===null)e.validator||W(se());else{const{value:I}=M;b({offset:I,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}function m(){const{value:g}=F;if(!g){Re();return}const{value:k}=w;if(k===null)e.validator||W(se());else{const{value:I}=M;b({offset:-I,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}const z=K,ie=ne;function se(){if(e.validator)return null;const{value:g}=R,{value:k}=L;return g!==null?Math.max(0,g):k!==null?Math.min(0,k):0}function pe(g){J(g),W(null)}function ye(g){var k,I,A;!((k=h.value)===null||k===void 0)&&k.$el.contains(g.target)&&g.preventDefault(),!((I=p.value)===null||I===void 0)&&I.$el.contains(g.target)&&g.preventDefault(),(A=s.value)===null||A===void 0||A.activate()}let ue=null,de=null,N=null;function Re(){N&&(window.clearTimeout(N),N=null),ue&&(window.clearInterval(ue),ue=null)}let ke=null;function _e(){ke&&(window.clearTimeout(ke),ke=null),de&&(window.clearInterval(de),de=null)}function Ye(){Re(),N=window.setTimeout(()=>{ue=window.setInterval(()=>{m()},zt)},Lt),ze("mouseup",document,Re,{once:!0})}function Ue(){_e(),ke=window.setTimeout(()=>{de=window.setInterval(()=>{x()},zt)},Lt),ze("mouseup",document,_e,{once:!0})}const Ne=()=>{de||x()},he=()=>{ue||m()};function y(g){var k,I;if(g.key==="Enter"){if(g.target===((k=s.value)===null||k===void 0?void 0:k.wrapperElRef))return;b({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&((I=s.value)===null||I===void 0||I.deactivate())}else if(g.key==="ArrowUp"){if(!E.value||e.keyboard.ArrowUp===!1)return;g.preventDefault(),b({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&x()}else if(g.key==="ArrowDown"){if(!F.value||e.keyboard.ArrowDown===!1)return;g.preventDefault(),b({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&m()}}function P(g){T.value=g,e.updateValueOnInput&&!e.format&&!e.parse&&e.precision===void 0&&b({offset:0,doUpdateIfValid:!0,isInputing:!0,fixPrecision:!1})}gt(w,()=>{B()});const S={focus:()=>{var g;return(g=s.value)===null||g===void 0?void 0:g.focus()},blur:()=>{var g;return(g=s.value)===null||g===void 0?void 0:g.blur()},select:()=>{var g;return(g=s.value)===null||g===void 0?void 0:g.select()}},Z=jt("InputNumber",o,r);return Object.assign(Object.assign({},S),{rtlEnabled:Z,inputInstRef:s,minusButtonInstRef:p,addButtonInstRef:h,mergedClsPrefix:r,mergedBordered:n,uncontrolledValue:v,mergedValue:w,mergedPlaceholder:V,displayedValueInvalid:q,mergedSize:f,mergedDisabled:d,displayedValue:T,addable:E,minusable:F,mergedStatus:u,handleFocus:z,handleBlur:ie,handleClear:pe,handleMouseDown:ye,handleAddClick:Ne,handleMinusClick:he,handleAddMousedown:Ue,handleMinusMousedown:Ye,handleKeyDown:y,handleUpdateDisplayedValue:P,mergedTheme:i,inputThemeOverrides:{paddingSmall:"0 8px 0 10px",paddingMedium:"0 8px 0 12px",paddingLarge:"0 8px 0 14px"},buttonThemeOverrides:G(()=>{const{self:{iconColorDisabled:g}}=i.value,[k,I,A,oe]=Ar(g);return{textColorTextDisabled:`rgb(${k}, ${I}, ${A})`,opacityDisabled:`${oe}`}})})},render(){const{mergedClsPrefix:e,$slots:n}=this,r=()=>t(kt,{text:!0,disabled:!this.minusable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleMinusClick,onMousedown:this.handleMinusMousedown,ref:"minusButtonInstRef"},{icon:()=>je(n["minus-icon"],()=>[t(te,{clsPrefix:e},{default:()=>t(Jn,null)})])}),o=()=>t(kt,{text:!0,disabled:!this.addable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleAddClick,onMousedown:this.handleAddMousedown,ref:"addButtonInstRef"},{icon:()=>je(n["add-icon"],()=>[t(te,{clsPrefix:e},{default:()=>t(vr,null)})])});return t("div",{class:[`${e}-input-number`,this.rtlEnabled&&`${e}-input-number--rtl`]},t(bt,{ref:"inputInstRef",autofocus:this.autofocus,status:this.mergedStatus,bordered:this.mergedBordered,loading:this.loading,value:this.displayedValue,onUpdateValue:this.handleUpdateDisplayedValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,builtinThemeOverrides:this.inputThemeOverrides,size:this.mergedSize,placeholder:this.mergedPlaceholder,disabled:this.mergedDisabled,readonly:this.readonly,round:this.round,textDecoration:this.displayedValueInvalid?"line-through":void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onClear:this.handleClear,clearable:this.clearable,inputProps:this.inputProps,internalLoadingBeforeSuffix:!0},{prefix:()=>{var i;return this.showButton&&this.buttonPlacement==="both"?[r(),Rt(n.prefix,a=>a?t("span",{class:`${e}-input-number-prefix`},a):null)]:(i=n.prefix)===null||i===void 0?void 0:i.call(n)},suffix:()=>{var i;return this.showButton?[Rt(n.suffix,a=>a?t("span",{class:`${e}-input-number-suffix`},a):null),this.buttonPlacement==="right"?r():null,o()]:(i=n.suffix)===null||i===void 0?void 0:i.call(n)}}))}}),_o={success:t(Jt,null),error:t(Kt,null),warning:t(Yt,null),info:t(Xt,null)},Oo=re({name:"ProgressCircle",props:{clsPrefix:{type:String,required:!0},status:{type:String,required:!0},strokeWidth:{type:Number,required:!0},fillColor:[String,Object],railColor:String,railStyle:[String,Object],percentage:{type:Number,default:0},offsetDegree:{type:Number,default:0},showIndicator:{type:Boolean,required:!0},indicatorTextColor:String,unit:String,viewBoxWidth:{type:Number,required:!0},gapDegree:{type:Number,required:!0},gapOffsetDegree:{type:Number,default:0}},setup(e,{slots:n}){function r(i,a,l,f){const{gapDegree:d,viewBoxWidth:u,strokeWidth:s}=e,p=50,h=0,v=p,c=0,w=2*p,T=50+s/2,U=`M ${T},${T} m ${h},${v}
|
||
a ${p},${p} 0 1 1 ${c},-100
|
||
a ${p},${p} 0 1 1 0,${w}`,_=Math.PI*2*p,V={stroke:f==="rail"?l:typeof e.fillColor=="object"?"url(#gradient)":l,strokeDasharray:`${i/100*(_-d)}px ${u*8}px`,strokeDashoffset:`-${d/2}px`,transformOrigin:a?"center":void 0,transform:a?`rotate(${a}deg)`:void 0};return{pathString:U,pathStyle:V}}const o=()=>{const i=typeof e.fillColor=="object",a=i?e.fillColor.stops[0]:"",l=i?e.fillColor.stops[1]:"";return i&&t("defs",null,t("linearGradient",{id:"gradient",x1:"0%",y1:"100%",x2:"100%",y2:"0%"},t("stop",{offset:"0%","stop-color":a}),t("stop",{offset:"100%","stop-color":l})))};return()=>{const{fillColor:i,railColor:a,strokeWidth:l,offsetDegree:f,status:d,percentage:u,showIndicator:s,indicatorTextColor:p,unit:h,gapOffsetDegree:v,clsPrefix:c}=e,{pathString:w,pathStyle:T}=r(100,0,a,"rail"),{pathString:U,pathStyle:_}=r(u,f,i,"fill"),V=100+l;return t("div",{class:`${c}-progress-content`,role:"none"},t("div",{class:`${c}-progress-graph`,"aria-hidden":!0},t("div",{class:`${c}-progress-graph-circle`,style:{transform:v?`rotate(${v}deg)`:void 0}},t("svg",{viewBox:`0 0 ${V} ${V}`},o(),t("g",null,t("path",{class:`${c}-progress-graph-circle-rail`,d:w,"stroke-width":l,"stroke-linecap":"round",fill:"none",style:T})),t("g",null,t("path",{class:[`${c}-progress-graph-circle-fill`,u===0&&`${c}-progress-graph-circle-fill--empty`],d:U,"stroke-width":l,"stroke-linecap":"round",fill:"none",style:_}))))),s?t("div",null,n.default?t("div",{class:`${c}-progress-custom-content`,role:"none"},n.default()):d!=="default"?t("div",{class:`${c}-progress-icon`,"aria-hidden":!0},t(te,{clsPrefix:c},{default:()=>_o[d]})):t("div",{class:`${c}-progress-text`,style:{color:p},role:"none"},t("span",{class:`${c}-progress-text__percentage`},u),t("span",{class:`${c}-progress-text__unit`},h))):null)}}}),Lo={success:t(Jt,null),error:t(Kt,null),warning:t(Yt,null),info:t(Xt,null)},zo=re({name:"ProgressLine",props:{clsPrefix:{type:String,required:!0},percentage:{type:Number,default:0},railColor:String,railStyle:[String,Object],fillColor:[String,Object],status:{type:String,required:!0},indicatorPlacement:{type:String,required:!0},indicatorTextColor:String,unit:{type:String,default:"%"},processing:{type:Boolean,required:!0},showIndicator:{type:Boolean,required:!0},height:[String,Number],railBorderRadius:[String,Number],fillBorderRadius:[String,Number]},setup(e,{slots:n}){const r=G(()=>$e(e.height)),o=G(()=>{var l,f;return typeof e.fillColor=="object"?`linear-gradient(to right, ${(l=e.fillColor)===null||l===void 0?void 0:l.stops[0]} , ${(f=e.fillColor)===null||f===void 0?void 0:f.stops[1]})`:e.fillColor}),i=G(()=>e.railBorderRadius!==void 0?$e(e.railBorderRadius):e.height!==void 0?$e(e.height,{c:.5}):""),a=G(()=>e.fillBorderRadius!==void 0?$e(e.fillBorderRadius):e.railBorderRadius!==void 0?$e(e.railBorderRadius):e.height!==void 0?$e(e.height,{c:.5}):"");return()=>{const{indicatorPlacement:l,railColor:f,railStyle:d,percentage:u,unit:s,indicatorTextColor:p,status:h,showIndicator:v,processing:c,clsPrefix:w}=e;return t("div",{class:`${w}-progress-content`,role:"none"},t("div",{class:`${w}-progress-graph`,"aria-hidden":!0},t("div",{class:[`${w}-progress-graph-line`,{[`${w}-progress-graph-line--indicator-${l}`]:!0}]},t("div",{class:`${w}-progress-graph-line-rail`,style:[{backgroundColor:f,height:r.value,borderRadius:i.value},d]},t("div",{class:[`${w}-progress-graph-line-fill`,c&&`${w}-progress-graph-line-fill--processing`],style:{maxWidth:`${e.percentage}%`,background:o.value,height:r.value,lineHeight:r.value,borderRadius:a.value}},l==="inside"?t("div",{class:`${w}-progress-graph-line-indicator`,style:{color:p}},n.default?n.default():`${u}${s}`):null)))),v&&l==="outside"?t("div",null,n.default?t("div",{class:`${w}-progress-custom-content`,style:{color:p},role:"none"},n.default()):h==="default"?t("div",{role:"none",class:`${w}-progress-icon ${w}-progress-icon--as-text`,style:{color:p}},u,s):t("div",{class:`${w}-progress-icon`,"aria-hidden":!0},t(te,{clsPrefix:w},{default:()=>Lo[h]}))):null)}}});function Dt(e,n,r=100){return`m ${r/2} ${r/2-e} a ${e} ${e} 0 1 1 0 ${2*e} a ${e} ${e} 0 1 1 0 -${2*e}`}const Do=re({name:"ProgressMultipleCircle",props:{clsPrefix:{type:String,required:!0},viewBoxWidth:{type:Number,required:!0},percentage:{type:Array,default:[0]},strokeWidth:{type:Number,required:!0},circleGap:{type:Number,required:!0},showIndicator:{type:Boolean,required:!0},fillColor:{type:Array,default:()=>[]},railColor:{type:Array,default:()=>[]},railStyle:{type:Array,default:()=>[]}},setup(e,{slots:n}){const r=G(()=>e.percentage.map((a,l)=>`${Math.PI*a/100*(e.viewBoxWidth/2-e.strokeWidth/2*(1+2*l)-e.circleGap*l)*2}, ${e.viewBoxWidth*8}`)),o=(i,a)=>{const l=e.fillColor[a],f=typeof l=="object"?l.stops[0]:"",d=typeof l=="object"?l.stops[1]:"";return typeof e.fillColor[a]=="object"&&t("linearGradient",{id:`gradient-${a}`,x1:"100%",y1:"0%",x2:"0%",y2:"100%"},t("stop",{offset:"0%","stop-color":f}),t("stop",{offset:"100%","stop-color":d}))};return()=>{const{viewBoxWidth:i,strokeWidth:a,circleGap:l,showIndicator:f,fillColor:d,railColor:u,railStyle:s,percentage:p,clsPrefix:h}=e;return t("div",{class:`${h}-progress-content`,role:"none"},t("div",{class:`${h}-progress-graph`,"aria-hidden":!0},t("div",{class:`${h}-progress-graph-circle`},t("svg",{viewBox:`0 0 ${i} ${i}`},t("defs",null,p.map((v,c)=>o(v,c))),p.map((v,c)=>t("g",{key:c},t("path",{class:`${h}-progress-graph-circle-rail`,d:Dt(i/2-a/2*(1+2*c)-l*c,a,i),"stroke-width":a,"stroke-linecap":"round",fill:"none",style:[{strokeDashoffset:0,stroke:u[c]},s[c]]}),t("path",{class:[`${h}-progress-graph-circle-fill`,v===0&&`${h}-progress-graph-circle-fill--empty`],d:Dt(i/2-a/2*(1+2*c)-l*c,a,i),"stroke-width":a,"stroke-linecap":"round",fill:"none",style:{strokeDasharray:r.value[c],strokeDashoffset:0,stroke:typeof d[c]=="object"?`url(#gradient-${c})`:d[c]}})))))),f&&n.default?t("div",null,t("div",{class:`${h}-progress-text`},n.default())):null)}}}),Mo=j([C("progress",{display:"inline-block"},[C("progress-icon",`
|
||
color: var(--n-icon-color);
|
||
transition: color .3s var(--n-bezier);
|
||
`),H("line",`
|
||
width: 100%;
|
||
display: block;
|
||
`,[C("progress-content",`
|
||
display: flex;
|
||
align-items: center;
|
||
`,[C("progress-graph",{flex:1})]),C("progress-custom-content",{marginLeft:"14px"}),C("progress-icon",`
|
||
width: 30px;
|
||
padding-left: 14px;
|
||
height: var(--n-icon-size-line);
|
||
line-height: var(--n-icon-size-line);
|
||
font-size: var(--n-icon-size-line);
|
||
`,[H("as-text",`
|
||
color: var(--n-text-color-line-outer);
|
||
text-align: center;
|
||
width: 40px;
|
||
font-size: var(--n-font-size);
|
||
padding-left: 4px;
|
||
transition: color .3s var(--n-bezier);
|
||
`)])]),H("circle, dashboard",{width:"120px"},[C("progress-custom-content",`
|
||
position: absolute;
|
||
left: 50%;
|
||
top: 50%;
|
||
transform: translateX(-50%) translateY(-50%);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
`),C("progress-text",`
|
||
position: absolute;
|
||
left: 50%;
|
||
top: 50%;
|
||
transform: translateX(-50%) translateY(-50%);
|
||
display: flex;
|
||
align-items: center;
|
||
color: inherit;
|
||
font-size: var(--n-font-size-circle);
|
||
color: var(--n-text-color-circle);
|
||
font-weight: var(--n-font-weight-circle);
|
||
transition: color .3s var(--n-bezier);
|
||
white-space: nowrap;
|
||
`),C("progress-icon",`
|
||
position: absolute;
|
||
left: 50%;
|
||
top: 50%;
|
||
transform: translateX(-50%) translateY(-50%);
|
||
display: flex;
|
||
align-items: center;
|
||
color: var(--n-icon-color);
|
||
font-size: var(--n-icon-size-circle);
|
||
`)]),H("multiple-circle",`
|
||
width: 200px;
|
||
color: inherit;
|
||
`,[C("progress-text",`
|
||
font-weight: var(--n-font-weight-circle);
|
||
color: var(--n-text-color-circle);
|
||
position: absolute;
|
||
left: 50%;
|
||
top: 50%;
|
||
transform: translateX(-50%) translateY(-50%);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
transition: color .3s var(--n-bezier);
|
||
`)]),C("progress-content",{position:"relative"}),C("progress-graph",{position:"relative"},[C("progress-graph-circle",[j("svg",{verticalAlign:"bottom"}),C("progress-graph-circle-fill",`
|
||
stroke: var(--n-fill-color);
|
||
transition:
|
||
opacity .3s var(--n-bezier),
|
||
stroke .3s var(--n-bezier),
|
||
stroke-dasharray .3s var(--n-bezier);
|
||
`,[H("empty",{opacity:0})]),C("progress-graph-circle-rail",`
|
||
transition: stroke .3s var(--n-bezier);
|
||
overflow: hidden;
|
||
stroke: var(--n-rail-color);
|
||
`)]),C("progress-graph-line",[H("indicator-inside",[C("progress-graph-line-rail",`
|
||
height: 16px;
|
||
line-height: 16px;
|
||
border-radius: 10px;
|
||
`,[C("progress-graph-line-fill",`
|
||
height: inherit;
|
||
border-radius: 10px;
|
||
`),C("progress-graph-line-indicator",`
|
||
background: #0000;
|
||
white-space: nowrap;
|
||
text-align: right;
|
||
margin-left: 14px;
|
||
margin-right: 14px;
|
||
height: inherit;
|
||
font-size: 12px;
|
||
color: var(--n-text-color-line-inner);
|
||
transition: color .3s var(--n-bezier);
|
||
`)])]),H("indicator-inside-label",`
|
||
height: 16px;
|
||
display: flex;
|
||
align-items: center;
|
||
`,[C("progress-graph-line-rail",`
|
||
flex: 1;
|
||
transition: background-color .3s var(--n-bezier);
|
||
`),C("progress-graph-line-indicator",`
|
||
background: var(--n-fill-color);
|
||
font-size: 12px;
|
||
transform: translateZ(0);
|
||
display: flex;
|
||
vertical-align: middle;
|
||
height: 16px;
|
||
line-height: 16px;
|
||
padding: 0 10px;
|
||
border-radius: 10px;
|
||
position: absolute;
|
||
white-space: nowrap;
|
||
color: var(--n-text-color-line-inner);
|
||
transition:
|
||
right .2s var(--n-bezier),
|
||
color .3s var(--n-bezier),
|
||
background-color .3s var(--n-bezier);
|
||
`)]),C("progress-graph-line-rail",`
|
||
position: relative;
|
||
overflow: hidden;
|
||
height: var(--n-rail-height);
|
||
border-radius: 5px;
|
||
background-color: var(--n-rail-color);
|
||
transition: background-color .3s var(--n-bezier);
|
||
`,[C("progress-graph-line-fill",`
|
||
background: var(--n-fill-color);
|
||
position: relative;
|
||
border-radius: 5px;
|
||
height: inherit;
|
||
width: 100%;
|
||
max-width: 0%;
|
||
transition:
|
||
background-color .3s var(--n-bezier),
|
||
max-width .2s var(--n-bezier);
|
||
`,[H("processing",[j("&::after",`
|
||
content: "";
|
||
background-image: var(--n-line-bg-processing);
|
||
animation: progress-processing-animation 2s var(--n-bezier) infinite;
|
||
`)])])])])])]),j("@keyframes progress-processing-animation",`
|
||
0% {
|
||
position: absolute;
|
||
left: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
right: 100%;
|
||
opacity: 1;
|
||
}
|
||
66% {
|
||
position: absolute;
|
||
left: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
right: 0;
|
||
opacity: 0;
|
||
}
|
||
100% {
|
||
position: absolute;
|
||
left: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
right: 0;
|
||
opacity: 0;
|
||
}
|
||
`)]),Uo=Object.assign(Object.assign({},xe.props),{processing:Boolean,type:{type:String,default:"line"},gapDegree:Number,gapOffsetDegree:Number,status:{type:String,default:"default"},railColor:[String,Array],railStyle:[String,Array],color:[String,Array,Object],viewBoxWidth:{type:Number,default:100},strokeWidth:{type:Number,default:7},percentage:[Number,Array],unit:{type:String,default:"%"},showIndicator:{type:Boolean,default:!0},indicatorPosition:{type:String,default:"outside"},indicatorPlacement:{type:String,default:"outside"},indicatorTextColor:String,circleGap:{type:Number,default:1},height:Number,borderRadius:[String,Number],fillBorderRadius:[String,Number],offsetDegree:Number}),No=re({name:"Progress",props:Uo,setup(e){const n=G(()=>e.indicatorPlacement||e.indicatorPosition),r=G(()=>{if(e.gapDegree||e.gapDegree===0)return e.gapDegree;if(e.type==="dashboard")return 75}),{mergedClsPrefixRef:o,inlineThemeDisabled:i}=Ce(e),a=xe("Progress","-progress",Mo,xr,e,o),l=G(()=>{const{status:d}=e,{common:{cubicBezierEaseInOut:u},self:{fontSize:s,fontSizeCircle:p,railColor:h,railHeight:v,iconSizeCircle:c,iconSizeLine:w,textColorCircle:T,textColorLineInner:U,textColorLineOuter:_,lineBgProcessing:V,fontWeightCircle:M,[St("iconColor",d)]:R,[St("fillColor",d)]:L}}=a.value;return{"--n-bezier":u,"--n-fill-color":L,"--n-font-size":s,"--n-font-size-circle":p,"--n-font-weight-circle":M,"--n-icon-color":R,"--n-icon-size-circle":c,"--n-icon-size-line":w,"--n-line-bg-processing":V,"--n-rail-color":h,"--n-rail-height":v,"--n-text-color-circle":T,"--n-text-color-line-inner":U,"--n-text-color-line-outer":_}}),f=i?pt("progress",G(()=>e.status[0]),l,e):void 0;return{mergedClsPrefix:o,mergedIndicatorPlacement:n,gapDeg:r,cssVars:i?void 0:l,themeClass:f==null?void 0:f.themeClass,onRender:f==null?void 0:f.onRender}},render(){const{type:e,cssVars:n,indicatorTextColor:r,showIndicator:o,status:i,railColor:a,railStyle:l,color:f,percentage:d,viewBoxWidth:u,strokeWidth:s,mergedIndicatorPlacement:p,unit:h,borderRadius:v,fillBorderRadius:c,height:w,processing:T,circleGap:U,mergedClsPrefix:_,gapDeg:V,gapOffsetDegree:M,themeClass:R,$slots:L,onRender:B}=this;return B==null||B(),t("div",{class:[R,`${_}-progress`,`${_}-progress--${e}`,`${_}-progress--${i}`],style:n,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":d,role:e==="circle"||e==="line"||e==="dashboard"?"progressbar":"none"},e==="circle"||e==="dashboard"?t(Oo,{clsPrefix:_,status:i,showIndicator:o,indicatorTextColor:r,railColor:a,fillColor:f,railStyle:l,offsetDegree:this.offsetDegree,percentage:d,viewBoxWidth:u,strokeWidth:s,gapDegree:V===void 0?e==="dashboard"?75:0:V,gapOffsetDegree:M,unit:h},L):e==="line"?t(zo,{clsPrefix:_,status:i,showIndicator:o,indicatorTextColor:r,railColor:a,fillColor:f,railStyle:l,percentage:d,processing:T,indicatorPlacement:p,unit:h,fillBorderRadius:c,railBorderRadius:v,height:w},L):e==="multiple-circle"?t(Do,{clsPrefix:_,strokeWidth:s,railColor:a,fillColor:f,railStyle:l,viewBoxWidth:u,percentage:d,showIndicator:o,circleGap:U},L):null)}}),Be=ft("n-upload"),Fo=j([C("upload","width: 100%;",[H("dragger-inside",[C("upload-trigger",`
|
||
display: block;
|
||
`)]),H("drag-over",[C("upload-dragger",`
|
||
border: var(--n-dragger-border-hover);
|
||
`)])]),C("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);
|
||
`,[j("&:hover",`
|
||
border: var(--n-dragger-border-hover);
|
||
`),H("disabled",`
|
||
cursor: not-allowed;
|
||
`)]),C("upload-trigger",`
|
||
display: inline-block;
|
||
box-sizing: border-box;
|
||
opacity: 1;
|
||
transition: opacity .3s var(--n-bezier);
|
||
`,[j("+",[C("upload-file-list","margin-top: 8px;")]),H("disabled",`
|
||
opacity: var(--n-item-disabled-opacity);
|
||
cursor: not-allowed;
|
||
`),H("image-card",`
|
||
width: 96px;
|
||
height: 96px;
|
||
`,[C("base-icon",`
|
||
font-size: 24px;
|
||
`),C("upload-dragger",`
|
||
padding: 0;
|
||
height: 100%;
|
||
width: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
`)])]),C("upload-file-list",`
|
||
line-height: var(--n-line-height);
|
||
opacity: 1;
|
||
transition: opacity .3s var(--n-bezier);
|
||
`,[j("a, img","outline: none;"),H("disabled",`
|
||
opacity: var(--n-item-disabled-opacity);
|
||
cursor: not-allowed;
|
||
`,[C("upload-file","cursor: not-allowed;")]),H("grid",`
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fill, 96px);
|
||
grid-gap: 8px;
|
||
margin-top: 0;
|
||
`),C("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);
|
||
`,[$t(),C("progress",[$t({foldPadding:!0})]),j("&:hover",`
|
||
background-color: var(--n-item-color-hover);
|
||
`,[C("upload-file-info",[le("action",`
|
||
opacity: 1;
|
||
`)])]),H("image-type",`
|
||
border-radius: var(--n-border-radius);
|
||
text-decoration: underline;
|
||
text-decoration-color: #0000;
|
||
`,[C("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;
|
||
`,[C("progress",`
|
||
padding: 2px 0;
|
||
margin-bottom: 0;
|
||
`),le("name",`
|
||
padding: 0 8px;
|
||
`),le("thumbnail",`
|
||
width: 32px;
|
||
height: 32px;
|
||
font-size: 28px;
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
`,[j("img",`
|
||
width: 100%;
|
||
`)])])]),H("text-type",[C("progress",`
|
||
box-sizing: border-box;
|
||
padding-bottom: 6px;
|
||
margin-bottom: 6px;
|
||
`)]),H("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;
|
||
`,[C("progress",`
|
||
position: absolute;
|
||
left: 8px;
|
||
bottom: 8px;
|
||
right: 8px;
|
||
width: unset;
|
||
`),C("upload-file-info",`
|
||
padding: 0;
|
||
width: 100%;
|
||
height: 100%;
|
||
`,[le("thumbnail",`
|
||
width: 100%;
|
||
height: 100%;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 36px;
|
||
`,[j("img",`
|
||
width: 100%;
|
||
`)])]),j("&::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: "";
|
||
`),j("&:hover",[j("&::before","opacity: 1;"),C("upload-file-info",[le("thumbnail","opacity: .12;")])])]),H("error-status",[j("&:hover",`
|
||
background-color: var(--n-item-color-hover-error);
|
||
`),C("upload-file-info",[le("name","color: var(--n-item-text-color-error);"),le("thumbnail","color: var(--n-item-text-color-error);")]),H("image-card-type",`
|
||
border: var(--n-item-border-image-card-error);
|
||
`)]),H("with-url",`
|
||
cursor: pointer;
|
||
`,[C("upload-file-info",[le("name",`
|
||
color: var(--n-item-text-color-success);
|
||
text-decoration-color: var(--n-item-text-color-success);
|
||
`,[j("a",`
|
||
text-decoration: underline;
|
||
`)])])]),C("upload-file-info",`
|
||
position: relative;
|
||
padding-top: 6px;
|
||
padding-bottom: 6px;
|
||
display: flex;
|
||
flex-wrap: nowrap;
|
||
`,[le("thumbnail",`
|
||
font-size: 18px;
|
||
opacity: 1;
|
||
transition: opacity .2s var(--n-bezier);
|
||
color: var(--n-item-icon-color);
|
||
`,[C("base-icon",`
|
||
margin-right: 2px;
|
||
vertical-align: middle;
|
||
transition: color .3s var(--n-bezier);
|
||
`)]),le("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;
|
||
`,[C("button",[j("&:not(:last-child)",{marginRight:"4px"}),C("base-icon",[j("svg",[jr()])])]),H("image-type",`
|
||
position: relative;
|
||
max-width: 80px;
|
||
width: auto;
|
||
`),H("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;
|
||
`)]),le("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);
|
||
`,[j("a",`
|
||
color: inherit;
|
||
text-decoration: underline;
|
||
`)])])])]),C("upload-file-input",`
|
||
display: none;
|
||
width: 0;
|
||
height: 0;
|
||
opacity: 0;
|
||
`)]),kr="__UPLOAD_DRAGGER__",Eo=re({name:"UploadDragger",[kr]:!0,setup(e,{slots:n}){const r=ce(Be,null);return r||Ge("upload-dragger","`n-upload-dragger` must be placed inside `n-upload`."),()=>{const{mergedClsPrefixRef:{value:o},mergedDisabledRef:{value:i},maxReachedRef:{value:a}}=r;return t("div",{class:[`${o}-upload-dragger`,(i||a)&&`${o}-upload-dragger--disabled`]},n)}}}),Ao=t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28"},t("g",{fill:"none"},t("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"}))),jo=t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28"},t("g",{fill:"none"},t("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"}))),Vo=re({name:"UploadProgress",props:{show:Boolean,percentage:{type:Number,required:!0},status:{type:String,required:!0}},setup(){return{mergedTheme:ce(Be).mergedThemeRef}},render(){return t(Qt,null,{default:()=>this.show?t(No,{type:"line",showIndicator:!1,percentage:this.percentage,status:this.status,height:2,theme:this.mergedTheme.peers.Progress,themeOverrides:this.mergedTheme.peerOverrides.Progress}):null})}});var dt=function(e,n,r,o){function i(a){return a instanceof r?a:new r(function(l){l(a)})}return new(r||(r=Promise))(function(a,l){function f(s){try{u(o.next(s))}catch(p){l(p)}}function d(s){try{u(o.throw(s))}catch(p){l(p)}}function u(s){s.done?a(s.value):i(s.value).then(f,d)}u((o=o.apply(e,n||[])).next())})};function Sr(e){return e.includes("image/")}function Mt(e=""){const n=e.split("/"),o=n[n.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(o)||[""])[0]}const Ut=/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i,$r=e=>{if(e.type)return Sr(e.type);const n=Mt(e.name||"");if(Ut.test(n))return!0;const r=e.thumbnailUrl||e.url||"",o=Mt(r);return!!(/^data:image\//.test(r)||Ut.test(o))};function Ho(e){return dt(this,void 0,void 0,function*(){return yield new Promise(n=>{if(!e.type||!Sr(e.type)){n("");return}n(window.URL.createObjectURL(e))})})}const Wo=At&&window.FileReader&&window.File;function qo(e){return e.isDirectory}function Go(e){return e.isFile}function Zo(e,n){return dt(this,void 0,void 0,function*(){const r=[];function o(i){return dt(this,void 0,void 0,function*(){for(const a of i)if(a){if(n&&qo(a)){const l=a.createReader();let f=[],d;try{do d=yield new Promise((u,s)=>{l.readEntries(u,s)}),f=f.concat(d);while(d.length>0)}catch(u){Pt("upload","error happens when handling directory upload",u)}yield o(f)}else if(Go(a))try{const l=yield new Promise((f,d)=>{a.file(f,d)});r.push({file:l,entry:a,source:"dnd"})}catch(l){Pt("upload","error happens when handling file upload",l)}}})}return yield o(e),r})}function Me(e){const{id:n,name:r,percentage:o,status:i,url:a,file:l,thumbnailUrl:f,type:d,fullPath:u,batchId:s}=e;return{id:n,name:r,percentage:o??null,status:i,url:a??null,file:l??null,thumbnailUrl:f??null,type:d??null,fullPath:u??null,batchId:s??null}}function Xo(e,n,r){return e=e.toLowerCase(),n=n.toLocaleLowerCase(),r=r.toLocaleLowerCase(),r.split(",").map(i=>i.trim()).filter(Boolean).some(i=>{if(i.startsWith(".")){if(e.endsWith(i))return!0}else if(i.includes("/")){const[a,l]=n.split("/"),[f,d]=i.split("/");if((f==="*"||a&&f&&f===a)&&(d==="*"||l&&d&&d===l))return!0}else return!0;return!1})}var Nt=function(e,n,r,o){function i(a){return a instanceof r?a:new r(function(l){l(a)})}return new(r||(r=Promise))(function(a,l){function f(s){try{u(o.next(s))}catch(p){l(p)}}function d(s){try{u(o.throw(s))}catch(p){l(p)}}function u(s){s.done?a(s.value):i(s.value).then(f,d)}u((o=o.apply(e,n||[])).next())})};const Ae={paddingMedium:"0 3px",heightMedium:"24px",iconSizeMedium:"18px"},Yo=re({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 n=ce(Be),r=O(null),o=O(""),i=G(()=>{const{file:R}=e;return R.status==="finished"?"success":R.status==="error"?"error":"info"}),a=G(()=>{const{file:R}=e;if(R.status==="error")return"error"}),l=G(()=>{const{file:R}=e;return R.status==="uploading"}),f=G(()=>{if(!n.showCancelButtonRef.value)return!1;const{file:R}=e;return["uploading","pending","error"].includes(R.status)}),d=G(()=>{if(!n.showRemoveButtonRef.value)return!1;const{file:R}=e;return["finished"].includes(R.status)}),u=G(()=>{if(!n.showDownloadButtonRef.value)return!1;const{file:R}=e;return["finished"].includes(R.status)}),s=G(()=>{if(!n.showRetryButtonRef.value)return!1;const{file:R}=e;return["error"].includes(R.status)}),p=me(()=>o.value||e.file.thumbnailUrl||e.file.url),h=G(()=>{if(!n.showPreviewButtonRef.value)return!1;const{file:{status:R},listType:L}=e;return["finished"].includes(R)&&p.value&&L==="image-card"});function v(){return Nt(this,void 0,void 0,function*(){const R=n.onRetryRef.value;R&&(yield R({file:e.file}))===!1||n.submit(e.file.id)})}function c(R){R.preventDefault();const{file:L}=e;["finished","pending","error"].includes(L.status)?T(L):["uploading"].includes(L.status)?_(L):Hr("upload","The button clicked type is unknown.")}function w(R){R.preventDefault(),U(e.file)}function T(R){const{xhrMap:L,doChange:B,onRemoveRef:{value:W},mergedFileListRef:{value:b}}=n;Promise.resolve(W?W({file:Object.assign({},R),fileList:b,index:e.index}):!0).then(q=>{if(q===!1)return;const F=Object.assign({},R,{status:"removed"});L.delete(R.id),B(F,void 0,{remove:!0})})}function U(R){const{onDownloadRef:{value:L}}=n;Promise.resolve(L?L(Object.assign({},R)):!0).then(B=>{B!==!1&&rr(R.url,R.name)})}function _(R){const{xhrMap:L}=n,B=L.get(R.id);B==null||B.abort(),T(Object.assign({},R))}function V(R){const{onPreviewRef:{value:L}}=n;if(L)L(e.file,{event:R});else if(e.listType==="image-card"){const{value:B}=r;if(!B)return;B.click()}}const M=()=>Nt(this,void 0,void 0,function*(){const{listType:R}=e;R!=="image"&&R!=="image-card"||n.shouldUseThumbnailUrlRef.value(e.file)&&(o.value=yield n.getFileThumbnailUrlResolver(e.file))});return ut(()=>{M()}),{mergedTheme:n.mergedThemeRef,progressStatus:i,buttonType:a,showProgress:l,disabled:n.mergedDisabledRef,showCancelButton:f,showRemoveButton:d,showDownloadButton:u,showRetryButton:s,showPreviewButton:h,mergedThumbnailUrl:p,shouldUseThumbnailUrl:n.shouldUseThumbnailUrlRef,renderIcon:n.renderIconRef,imageRef:r,handleRemoveOrCancelClick:c,handleDownloadClick:w,handleRetryClick:v,handlePreviewClick:V}},render(){const{clsPrefix:e,mergedTheme:n,listType:r,file:o,renderIcon:i}=this;let a;const l=r==="image";l||r==="image-card"?a=!this.shouldUseThumbnailUrl(o)||!this.mergedThumbnailUrl?t("span",{class:`${e}-upload-file-info__thumbnail`},i?i(o):$r(o)?t(te,{clsPrefix:e},{default:Ao}):t(te,{clsPrefix:e},{default:jo})):t("a",{rel:"noopener noreferer",target:"_blank",href:o.url||void 0,class:`${e}-upload-file-info__thumbnail`,onClick:this.handlePreviewClick},r==="image-card"?t($o,{src:this.mergedThumbnailUrl||void 0,previewSrc:o.url||void 0,alt:o.name,ref:"imageRef"}):t("img",{src:this.mergedThumbnailUrl||void 0,alt:o.name})):a=t("span",{class:`${e}-upload-file-info__thumbnail`},i?i(o):t(te,{clsPrefix:e},{default:()=>t(Yn,null)}));const d=t(Vo,{show:this.showProgress,percentage:o.percentage||0,status:this.progressStatus}),u=r==="text"||r==="image";return t("div",{class:[`${e}-upload-file`,`${e}-upload-file--${this.progressStatus}-status`,o.url&&o.status!=="error"&&r!=="image-card"&&`${e}-upload-file--with-url`,`${e}-upload-file--${r}-type`]},t("div",{class:`${e}-upload-file-info`},a,t("div",{class:`${e}-upload-file-info__name`},u&&(o.url&&o.status!=="error"?t("a",{rel:"noopener noreferer",target:"_blank",href:o.url||void 0,onClick:this.handlePreviewClick},o.name):t("span",{onClick:this.handlePreviewClick},o.name)),l&&d),t("div",{class:[`${e}-upload-file-info__action`,`${e}-upload-file-info__action--${r}-type`]},this.showPreviewButton?t(ae,{key:"preview",quaternary:!0,type:this.buttonType,onClick:this.handlePreviewClick,theme:n.peers.Button,themeOverrides:n.peerOverrides.Button,builtinThemeOverrides:Ae},{icon:()=>t(te,{clsPrefix:e},{default:()=>t(Qr,null)})}):null,(this.showRemoveButton||this.showCancelButton)&&!this.disabled&&t(ae,{key:"cancelOrTrash",theme:n.peers.Button,themeOverrides:n.peerOverrides.Button,quaternary:!0,builtinThemeOverrides:Ae,type:this.buttonType,onClick:this.handleRemoveOrCancelClick},{icon:()=>t(Vr,null,{default:()=>this.showRemoveButton?t(te,{clsPrefix:e,key:"trash"},{default:()=>t(no,null)}):t(te,{clsPrefix:e,key:"cancel"},{default:()=>t(Kn,null)})})}),this.showRetryButton&&!this.disabled&&t(ae,{key:"retry",quaternary:!0,type:this.buttonType,onClick:this.handleRetryClick,theme:n.peers.Button,themeOverrides:n.peerOverrides.Button,builtinThemeOverrides:Ae},{icon:()=>t(te,{clsPrefix:e},{default:()=>t(eo,null)})}),this.showDownloadButton?t(ae,{key:"download",quaternary:!0,type:this.buttonType,onClick:this.handleDownloadClick,theme:n.peers.Button,themeOverrides:n.peerOverrides.Button,builtinThemeOverrides:Ae},{icon:()=>t(te,{clsPrefix:e},{default:()=>t(mr,null)})}):null)),!l&&d)}}),Pr=re({name:"UploadTrigger",props:{abstract:Boolean},slots:Object,setup(e,{slots:n}){const r=ce(Be,null);r||Ge("upload-trigger","`n-upload-trigger` must be placed inside `n-upload`.");const{mergedClsPrefixRef:o,mergedDisabledRef:i,maxReachedRef:a,listTypeRef:l,dragOverRef:f,openOpenFileDialog:d,draggerInsideRef:u,handleFileAddition:s,mergedDirectoryDndRef:p,triggerClassRef:h,triggerStyleRef:v}=r,c=G(()=>l.value==="image-card");function w(){i.value||a.value||d()}function T(M){M.preventDefault(),f.value=!0}function U(M){M.preventDefault(),f.value=!0}function _(M){M.preventDefault(),f.value=!1}function V(M){var R;if(M.preventDefault(),!u.value||i.value||a.value){f.value=!1;return}const L=(R=M.dataTransfer)===null||R===void 0?void 0:R.items;L!=null&&L.length?Zo(Array.from(L).map(B=>B.webkitGetAsEntry()),p.value).then(B=>{s(B)}).finally(()=>{f.value=!1}):f.value=!1}return()=>{var M;const{value:R}=o;return e.abstract?(M=n.default)===null||M===void 0?void 0:M.call(n,{handleClick:w,handleDrop:V,handleDragOver:T,handleDragEnter:U,handleDragLeave:_}):t("div",{class:[`${R}-upload-trigger`,(i.value||a.value)&&`${R}-upload-trigger--disabled`,c.value&&`${R}-upload-trigger--image-card`,h.value],style:v.value,onClick:w,onDrop:V,onDragover:T,onDragenter:U,onDragleave:_},c.value?t(Eo,null,{default:()=>je(n.default,()=>[t(te,{clsPrefix:R},{default:()=>t(vr,null)})])}):n)}}}),Ko=re({name:"UploadFileList",setup(e,{slots:n}){const r=ce(Be,null);r||Ge("upload-file-list","`n-upload-file-list` must be placed inside `n-upload`.");const{abstractRef:o,mergedClsPrefixRef:i,listTypeRef:a,mergedFileListRef:l,fileListClassRef:f,fileListStyleRef:d,cssVarsRef:u,themeClassRef:s,maxReachedRef:p,showTriggerRef:h,imageGroupPropsRef:v}=r,c=G(()=>a.value==="image-card"),w=()=>l.value.map((U,_)=>t(Yo,{clsPrefix:i.value,key:U.id,file:U,index:_,listType:a.value})),T=()=>c.value?t(ko,Object.assign({},v.value),{default:w}):t(Qt,{group:!0},{default:w});return()=>{const{value:U}=i,{value:_}=o;return t("div",{class:[`${U}-upload-file-list`,c.value&&`${U}-upload-file-list--grid`,_?s==null?void 0:s.value:void 0,f.value],style:[_&&u?u.value:"",d.value]},T(),h.value&&!p.value&&c.value&&t(Pr,null,n))}}});var Ft=function(e,n,r,o){function i(a){return a instanceof r?a:new r(function(l){l(a)})}return new(r||(r=Promise))(function(a,l){function f(s){try{u(o.next(s))}catch(p){l(p)}}function d(s){try{u(o.throw(s))}catch(p){l(p)}}function u(s){s.done?a(s.value):i(s.value).then(f,d)}u((o=o.apply(e,n||[])).next())})};function Jo(e,n,r){const{doChange:o,xhrMap:i}=e;let a=0;function l(d){var u;let s=Object.assign({},n,{status:"error",percentage:a});i.delete(n.id),s=Me(((u=e.onError)===null||u===void 0?void 0:u.call(e,{file:s,event:d}))||s),o(s,d)}function f(d){var u;if(e.isErrorState){if(e.isErrorState(r)){l(d);return}}else if(r.status<200||r.status>=300){l(d);return}let s=Object.assign({},n,{status:"finished",percentage:a});i.delete(n.id),s=Me(((u=e.onFinish)===null||u===void 0?void 0:u.call(e,{file:s,event:d}))||s),o(s,d)}return{handleXHRLoad:f,handleXHRError:l,handleXHRAbort(d){const u=Object.assign({},n,{status:"removed",file:null,percentage:a});i.delete(n.id),o(u,d)},handleXHRProgress(d){const u=Object.assign({},n,{status:"uploading"});if(d.lengthComputable){const s=Math.ceil(d.loaded/d.total*100);u.percentage=s,a=s}o(u,d)}}}function Qo(e){const{inst:n,file:r,data:o,headers:i,withCredentials:a,action:l,customRequest:f}=e,{doChange:d}=e.inst;let u=0;f({file:r,data:o,headers:i,withCredentials:a,action:l,onProgress(s){const p=Object.assign({},r,{status:"uploading"}),h=s.percent;p.percentage=h,u=h,d(p)},onFinish(){var s;let p=Object.assign({},r,{status:"finished",percentage:u});p=Me(((s=n.onFinish)===null||s===void 0?void 0:s.call(n,{file:p}))||p),d(p)},onError(){var s;let p=Object.assign({},r,{status:"error",percentage:u});p=Me(((s=n.onError)===null||s===void 0?void 0:s.call(n,{file:p}))||p),d(p)}})}function ei(e,n,r){const o=Jo(e,n,r);r.onabort=o.handleXHRAbort,r.onerror=o.handleXHRError,r.onload=o.handleXHRLoad,r.upload&&(r.upload.onprogress=o.handleXHRProgress)}function Ir(e,n){return typeof e=="function"?e({file:n}):e||{}}function ti(e,n,r){const o=Ir(n,r);o&&Object.keys(o).forEach(i=>{e.setRequestHeader(i,o[i])})}function ri(e,n,r){const o=Ir(n,r);o&&Object.keys(o).forEach(i=>{e.append(i,o[i])})}function ni(e,n,r,{method:o,action:i,withCredentials:a,responseType:l,headers:f,data:d}){const u=new XMLHttpRequest;u.responseType=l,e.xhrMap.set(r.id,u),u.withCredentials=a;const s=new FormData;if(ri(s,d,r),r.file!==null&&s.append(n,r.file),ei(e,r,u),i!==void 0){u.open(o.toUpperCase(),i),ti(u,f,r),u.send(s);const p=Object.assign({},r,{status:"uploading"});e.doChange(p)}}const oi=Object.assign(Object.assign({},xe.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,onRetry: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=>Wo?$r(e):!1},createThumbnailUrl:Function,abstract:Boolean,max:Number,showTrigger:{type:Boolean,default:!0},imageGroupProps:Object,inputProps:Object,triggerClass:String,triggerStyle:[String,Object],renderIcon:Function}),ii=re({name:"Upload",props:oi,setup(e){e.abstract&&e.listType==="image-card"&&Ge("upload","when the list-type is image-card, abstract is not supported.");const{mergedClsPrefixRef:n,inlineThemeDisabled:r}=Ce(e),o=xe("Upload","-upload",Fo,vo,e,n),i=qt(e),a=O(e.defaultFileList),l=X(e,"fileList"),f=O(null),d={value:!1},u=O(!1),s=new Map,p=Gt(l,a),h=G(()=>p.value.map(Me)),v=G(()=>{const{max:b}=e;return b!==void 0?h.value.length>=b:!1});function c(){var b;(b=f.value)===null||b===void 0||b.click()}function w(b){const q=b.target;V(q.files?Array.from(q.files).map(F=>({file:F,entry:null,source:"input"})):null,b),q.value=""}function T(b){const{"onUpdate:fileList":q,onUpdateFileList:F}=e;q&&be(q,b),F&&be(F,b),a.value=b}const U=G(()=>e.multiple||e.directory),_=(b,q,F={append:!1,remove:!1})=>{const{append:E,remove:K}=F,ne=Array.from(h.value),J=ne.findIndex(x=>x.id===b.id);if(E||K||~J){E?ne.push(b):K?ne.splice(J,1):ne.splice(J,1,b);const{onChange:x}=e;x&&x({file:b,fileList:ne,event:q}),T(ne)}};function V(b,q){if(!b||b.length===0)return;const{onBeforeUpload:F}=e;b=U.value?b:[b[0]];const{max:E,accept:K}=e;b=b.filter(({file:J,source:x})=>x==="dnd"&&(K!=null&&K.trim())?Xo(J.name,J.type,K):!0),E&&(b=b.slice(0,E-h.value.length));const ne=at();Promise.all(b.map(J=>Ft(this,[J],void 0,function*({file:x,entry:m}){var z;const ie={id:at(),batchId:ne,name:x.name,status:"pending",percentage:0,file:x,url:null,type:x.type,thumbnailUrl:null,fullPath:(z=m==null?void 0:m.fullPath)!==null&&z!==void 0?z:`/${x.webkitRelativePath||x.name}`};return!F||(yield F({file:ie,fileList:h.value}))!==!1?ie:null}))).then(J=>Ft(this,void 0,void 0,function*(){let x=Promise.resolve();J.forEach(m=>{x=x.then(Zt).then(()=>{m&&_(m,q,{append:!0})})}),yield x})).then(()=>{e.defaultUpload&&M()})}function M(b){const{method:q,action:F,withCredentials:E,headers:K,data:ne,name:J}=e,x=b!==void 0?h.value.filter(z=>z.id===b):h.value,m=b!==void 0;x.forEach(z=>{const{status:ie}=z;(ie==="pending"||ie==="error"&&m)&&(e.customRequest?Qo({inst:{doChange:_,xhrMap:s,onFinish:e.onFinish,onError:e.onError},file:z,action:F,withCredentials:E,headers:K,data:ne,customRequest:e.customRequest}):ni({doChange:_,xhrMap:s,onFinish:e.onFinish,onError:e.onError,isErrorState:e.isErrorState},J,z,{method:q,action:F,withCredentials:E,responseType:e.responseType,headers:K,data:ne}))})}function R(b){var q;if(b.thumbnailUrl)return b.thumbnailUrl;const{createThumbnailUrl:F}=e;return F?(q=F(b.file,b))!==null&&q!==void 0?q:b.url||"":b.url?b.url:b.file?Ho(b.file):""}const L=G(()=>{const{common:{cubicBezierEaseInOut:b},self:{draggerColor:q,draggerBorder:F,draggerBorderHover:E,itemColorHover:K,itemColorHoverError:ne,itemTextColorError:J,itemTextColorSuccess:x,itemTextColor:m,itemIconColor:z,itemDisabledOpacity:ie,lineHeight:se,borderRadius:pe,fontSize:ye,itemBorderImageCardError:ue,itemBorderImageCard:de}}=o.value;return{"--n-bezier":b,"--n-border-radius":pe,"--n-dragger-border":F,"--n-dragger-border-hover":E,"--n-dragger-color":q,"--n-font-size":ye,"--n-item-color-hover":K,"--n-item-color-hover-error":ne,"--n-item-disabled-opacity":ie,"--n-item-icon-color":z,"--n-item-text-color":m,"--n-item-text-color-error":J,"--n-item-text-color-success":x,"--n-line-height":se,"--n-item-border-image-card-error":ue,"--n-item-border-image-card":de}}),B=r?pt("upload",void 0,L,e):void 0;We(Be,{mergedClsPrefixRef:n,mergedThemeRef:o,showCancelButtonRef:X(e,"showCancelButton"),showDownloadButtonRef:X(e,"showDownloadButton"),showRemoveButtonRef:X(e,"showRemoveButton"),showRetryButtonRef:X(e,"showRetryButton"),onRemoveRef:X(e,"onRemove"),onDownloadRef:X(e,"onDownload"),mergedFileListRef:h,triggerClassRef:X(e,"triggerClass"),triggerStyleRef:X(e,"triggerStyle"),shouldUseThumbnailUrlRef:X(e,"shouldUseThumbnailUrl"),renderIconRef:X(e,"renderIcon"),xhrMap:s,submit:M,doChange:_,showPreviewButtonRef:X(e,"showPreviewButton"),onPreviewRef:X(e,"onPreview"),getFileThumbnailUrlResolver:R,listTypeRef:X(e,"listType"),dragOverRef:u,openOpenFileDialog:c,draggerInsideRef:d,handleFileAddition:V,mergedDisabledRef:i.mergedDisabledRef,maxReachedRef:v,fileListClassRef:X(e,"fileListClass"),fileListStyleRef:X(e,"fileListStyle"),abstractRef:X(e,"abstract"),acceptRef:X(e,"accept"),cssVarsRef:r?void 0:L,themeClassRef:B==null?void 0:B.themeClass,onRender:B==null?void 0:B.onRender,showTriggerRef:X(e,"showTrigger"),imageGroupPropsRef:X(e,"imageGroupProps"),mergedDirectoryDndRef:G(()=>{var b;return(b=e.directoryDnd)!==null&&b!==void 0?b:e.directory}),onRetryRef:X(e,"onRetry")});const W={clear:()=>{a.value=[]},submit:M,openOpenFileDialog:c};return Object.assign({mergedClsPrefix:n,draggerInsideRef:d,inputElRef:f,mergedTheme:o,dragOver:u,mergedMultiple:U,cssVars:r?void 0:L,themeClass:B==null?void 0:B.themeClass,onRender:B==null?void 0:B.onRender,handleFileInputChange:w},W)},render(){var e,n;const{draggerInsideRef:r,mergedClsPrefix:o,$slots:i,directory:a,onRender:l}=this;if(i.default&&!this.abstract){const d=i.default()[0];!((e=d==null?void 0:d.type)===null||e===void 0)&&e[kr]&&(r.value=!0)}const f=t("input",Object.assign({},this.inputProps,{ref:"inputElRef",type:"file",class:`${o}-upload-file-input`,accept:this.accept,multiple:this.mergedMultiple,onChange:this.handleFileInputChange,webkitdirectory:a||void 0,directory:a||void 0}));return this.abstract?t(Le,null,(n=i.default)===null||n===void 0?void 0:n.call(i),t(Wr,{to:"body"},f)):(l==null||l(),t("div",{class:[`${o}-upload`,r.value&&`${o}-upload--dragger-inside`,this.dragOver&&`${o}-upload--drag-over`,this.themeClass],style:this.cssVars},f,this.showTrigger&&this.listType!=="image-card"&&t(Pr,null,i),this.showFileList&&t(Ko,null,i)))}}),li=re({__name:"ImportDomainDialog",props:{show:{type:Boolean,required:!0},showModifiers:{}},emits:Ve(["success"],["update:show"]),setup(e,{emit:n}){const r=ht(e,"show"),o=n,i=ce("axios"),a=Ze(),l=O(1440),f=O(!0),d=O([]),u=O(null),s={interval:[{type:"number",required:!0,message:"请输入采集间隔",trigger:["blur","change"]},{type:"number",min:1,message:"采集间隔必须大于0",trigger:["blur","change"]}],fileList:[{type:"array",required:!0,message:"请选择文件",trigger:["change"]},{validator:(v,c)=>!c||c.length===0?!1:!!c[0].file,message:"文件无效",trigger:["change"]}]},p=async()=>{var v;try{await((v=u.value)==null?void 0:v.validate())}catch{return}try{const c=new FormData,w=d.value[0].file;if(!w){a.error("文件无效");return}c.append("file",w),c.append("crawl_interval",l.value.toString()),c.append("crawl_now",f.value.toString());const T=await i.post("/api/domain/v1/import",c,{headers:{"Content-Type":"multipart/form-data"}});T.data.code===2e4?(a.success("导入成功"),o("success"),h()):a.error(`导入失败:${T.data.message}`)}catch(c){console.error("导入失败",c),a.error(`导入失败:${c}`)}},h=()=>{var v;l.value=1440,f.value=!0,d.value=[],(v=u.value)==null||v.restoreValidation(),r.value=!1};return(v,c)=>(De(),vt(ee(mt),{show:r.value,"onUpdate:show":c[3]||(c[3]=w=>r.value=w),preset:"card",title:"通过文件导入","mask-closable":!1,style:{width:"600px"}},{action:D(()=>[$(ee(wr),{size:"small"},{default:D(()=>[$(ee(ae),{type:"primary",onClick:p},{default:D(()=>c[6]||(c[6]=[Y("确认")])),_:1}),$(ee(ae),{onClick:h},{default:D(()=>c[7]||(c[7]=[Y("关闭")])),_:1})]),_:1})]),default:D(()=>[$(ee(Xe),{size:"small",ref_key:"formRef",ref:u,model:{interval:l.value,fileList:d.value},rules:s,"label-placement":"left","label-width":"200"},{default:D(()=>[$(ee(we),{path:"interval",label:"采集间隔(分钟)"},{default:D(()=>[$(ee(xt),{value:l.value,"onUpdate:value":c[0]||(c[0]=w=>l.value=w),min:1},null,8,["value"])]),_:1}),$(ee(we),{path:"fileList",label:"选择文件"},{default:D(()=>[$(ee(ii),{"file-list":d.value,"onUpdate:fileList":c[1]||(c[1]=w=>d.value=w),max:1,accept:".txt,.csv"},{default:D(()=>[$(ee(ae),null,{default:D(()=>c[4]||(c[4]=[Y("选择文件")])),_:1})]),_:1},8,["file-list"])]),_:1}),$(ee(we),{label:"采集选项"},{default:D(()=>[$(ee(He),{checked:f.value,"onUpdate:checked":c[2]||(c[2]=w=>f.value=w)},{default:D(()=>c[5]||(c[5]=[Y(" 立即开始采集 ")])),_:1},8,["checked"])]),_:1})]),_:1},8,["model"])]),_:1},8,["show"]))}}),ai=re({__name:"AddDomainDialog",props:{show:{type:Boolean,required:!0},showModifiers:{}},emits:Ve(["success"],["update:show"]),setup(e,{emit:n}){const r=ht(e,"show"),o=n,i=ce("axios"),a=Ze(),l=O(1440),f=O(!0),d=O(""),u=O(null),s={interval:[{required:!0,type:"number",message:"请输入采集间隔",trigger:["blur","change"]},{type:"number",min:1,message:"采集间隔必须大于0",trigger:["blur","change"]}],domains:[{required:!0,message:"请输入域名",trigger:["blur","change"]},{validator:(v,c)=>c.trim()?c.split(/[\n,]/).map(T=>T.trim()).filter(T=>T).length!==0:!0,message:"域名格式不正确",trigger:["blur","change"]}]},p=async()=>{var v;try{await((v=u.value)==null?void 0:v.validate())}catch{return}try{const c=d.value.split(/[\n,]/).map(T=>T.trim()).filter(T=>T),w=await i.post("/api/domain/v1/add",{domains:c,crawl_interval:l.value,crawl_now:f.value});w.data.code===2e4?(a.success("添加成功"),o("success"),h()):a.error(`添加失败:${w.data.message}`)}catch(c){console.error("添加失败",c),a.error(`添加失败:${c}`)}},h=()=>{var v;l.value=1440,f.value=!0,d.value="",(v=u.value)==null||v.restoreValidation(),r.value=!1};return(v,c)=>(De(),vt(ee(mt),{show:r.value,"onUpdate:show":c[3]||(c[3]=w=>r.value=w),preset:"card",title:"手动添加","mask-closable":!1,style:{width:"600px"}},{action:D(()=>[$(ee(wr),{size:"small"},{default:D(()=>[$(ee(ae),{type:"primary",onClick:p},{default:D(()=>c[5]||(c[5]=[Y("确认")])),_:1}),$(ee(ae),{onClick:h},{default:D(()=>c[6]||(c[6]=[Y("关闭")])),_:1})]),_:1})]),default:D(()=>[$(ee(Xe),{size:"small",ref_key:"formRef",ref:u,model:{interval:l.value,domains:d.value},rules:s},{default:D(()=>[$(ee(we),{path:"interval",label:"采集间隔(分钟)"},{default:D(()=>[$(ee(xt),{value:l.value,"onUpdate:value":c[0]||(c[0]=w=>l.value=w),min:1},null,8,["value"])]),_:1}),$(ee(we),{path:"domains",label:"域名列表"},{default:D(()=>[$(ee(bt),{value:d.value,"onUpdate:value":c[1]||(c[1]=w=>d.value=w),type:"textarea",rows:10,placeholder:"请输入域名,支持换行或英文逗号分隔"},null,8,["value"])]),_:1}),$(ee(we),{label:"采集选项"},{default:D(()=>[$(ee(He),{checked:f.value,"onUpdate:checked":c[2]||(c[2]=w=>f.value=w)},{default:D(()=>c[4]||(c[4]=[Y(" 立即开始采集 ")])),_:1},8,["checked"])]),_:1})]),_:1},8,["model"])]),_:1},8,["show"]))}}),si={key:0,class:"mb-4 text-orange-500"},ui=re({__name:"EditDomainDialog",props:Ve({domainIds:{}},{show:{type:Boolean},showModifiers:{}}),emits:Ve(["success","close"],["update:show"]),setup(e,{emit:n}){const r=ht(e,"show"),o=e,i=n,a=ce("axios"),l=Ze(),f=O(null),d=O(!1),u=G(()=>{var v;const h=((v=o.domainIds)==null?void 0:v.length)||0;return h>1?`批量修改 ${h} 个域名的采集间隔`:h===1?"修改域名采集间隔":"修改采集间隔"});gt(r,h=>{h&&(f.value=null)});const s=async()=>{if(f.value===null||f.value<1){l.error("请输入有效的采集间隔(大于等于1的整数)");return}if(!o.domainIds||o.domainIds.length===0){l.error("没有指定要修改的域名");return}try{d.value=!0;const h=(await a.post("/api/domain/v1/update",{domain_ids:o.domainIds,crawl_interval:f.value})).data;if(h.code!==2e4){l.error(`更新失败:${h.message}`);return}l.success("更新成功"),i("success"),r.value=!1}catch(h){console.error("更新失败",h),l.error(`更新失败:${h}`)}finally{d.value=!1}},p=()=>{r.value=!1,i("close")};return(h,v)=>{const c=xt,w=we,T=Xe,U=ae,_=mt;return De(),vt(_,{show:r.value,"onUpdate:show":v[1]||(v[1]=V=>r.value=V),preset:"dialog",title:u.value,loading:d.value,onClose:p},{action:D(()=>[$(U,{onClick:p},{default:D(()=>v[2]||(v[2]=[Y("取消")])),_:1}),$(U,{type:"primary",onClick:s,loading:d.value},{default:D(()=>v[3]||(v[3]=[Y("确定")])),_:1},8,["loading"])]),default:D(()=>{var V,M;return[(((V=h.domainIds)==null?void 0:V.length)||0)>1?(De(),er("div",si," 你正在批量修改 "+Gr((M=h.domainIds)==null?void 0:M.length)+" 个域名的采集间隔。 ",1)):qr("",!0),$(T,null,{default:D(()=>[$(w,{label:"采集间隔(分钟)",required:""},{default:D(()=>[$(c,{value:f.value,"onUpdate:value":v[0]||(v[0]=R=>f.value=R),min:1,step:1,style:{width:"100%"},placeholder:"请输入采集间隔"},null,8,["value"])]),_:1})]),_:1})]}),_:1},8,["show","title","loading"])}}}),di=e=>new Date(e*1e3).toLocaleString(),ci={class:"flex gap-2 mb-4"},fi={class:"flex justify-center mt-4"};function gi(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Kr(e)}const vi=re({__name:"DomainManager",setup(e){const n=ce("axios"),r=Ze(),o=en(),i=Xr(),a=Zr(),l=O({domain:"",status:null}),f=[{label:"全部",value:null},{label:"READY",value:1},{label:"QUEUE",value:2},{label:"CRAWLING",value:3},{label:"PAUSE",value:999}],d=O(!1),u=O(!1),s=O(!1),p=O(null),h=O([]),v=O({page:1,pageSize:50,itemCount:0,showSizePicker:!0,pageSizes:[10,20,50,100,200,500,1e3],onChange:x=>{v.value.page=x,c(),b()},onUpdatePageSize:x=>{v.value.pageSize=x,v.value.page=1,c(),b()}}),c=()=>{a.push({query:{page:v.value.page,size:v.value.pageSize,domain:l.value.domain||void 0,status:l.value.status||void 0}})},w=()=>{const x=Number(i.query.page)||1,m=Number(i.query.size)||50,z=i.query.domain||"",ie=i.query.status?Number(i.query.status):null;v.value.page=x,v.value.pageSize=m,l.value.domain=z,l.value.status=ie},T=[{type:"selection"},{title:"#",key:"id"},{title:"域名",key:"domain"},{title:"状态",key:"status",render:x=>{let m="",z="";switch(x.status){case 1:m="READY",z="success";break;case 2:m="QUENE",z="warning";break;case 3:m="CRAWLING",z="info";break;case 999:m="PAUSE",z="error";break;default:m="UNKNOWN",z="error"}return $(on,{type:z},gi(m)?m:{default:()=>[m]})}},{title:"采集间隔 (分钟)",key:"crawl_interval",render:x=>$(Wt,null,{trigger:()=>$("span",null,[x.crawl_interval]),default:()=>`约 ${x.crawl_interval/60/24} 天`})},{title:"最近采集时间",key:"latest_crawl_time",render:x=>di(x.latest_crawl_time)},{title:"操作",key:"action",render:x=>$("div",{class:"flex gap-2"},[$(ae,{size:"small",type:"primary",onClick:()=>E(x)},{default:()=>[Y("编辑")]}),$(ae,{size:"small",type:"info",onClick:()=>B(x)},{default:()=>[Y("立即采集")]}),$(ae,{size:"small",type:"error",onClick:()=>W(x)},{default:()=>[Y("删除")]})])}],U=O([]),_=G(()=>h.value.length>0),V=x=>{h.value=x},M=()=>{if(!_.value){r.warning("请至少选择一个域名");return}const x=O(!1);o.warning({title:"确认批量删除",content:()=>$("div",null,[$("div",{class:"mb-2"},[Y("确定要删除选中的 "),h.value.length,Y(" 个域名吗?")]),$(He,{checked:x.value,"onUpdate:checked":m=>x.value=m},{default:()=>[Y("同时删除所有关联的 SURL")]})]),positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{try{const m=(await n.post("/api/domain/v1/delete",{domain_ids:h.value,remove_surl:x.value})).data;if(m.code!==2e4){r.error(`批量删除域名失败,错误:${m.message}`);return}r.success("批量删除成功"),h.value=[],b()}catch(m){console.error("批量删除域名失败",m),r.error(`批量删除域名失败,错误:${m}`)}}})},R=()=>{if(!_.value){r.warning("请至少选择一个域名");return}p.value=[...h.value],s.value=!0},L=async()=>{if(!_.value){r.warning("请至少选择一个域名");return}try{const x=(await n.post("/api/domain/v1/crawl",{domain_ids:h.value})).data;if(x.code!==2e4){r.error(`批量触发采集失败:${x.message}`);return}r.success("批量触发采集成功,已加入队列"),h.value=[],b()}catch(x){console.error("批量触发采集失败",x),r.error(`批量触发采集失败:${x}`)}},B=async x=>{try{const m=(await n.post("/api/domain/v1/crawl",{domain_ids:[x.id]})).data;if(m.code!==2e4){r.error(`触发采集失败:${m.message}`);return}r.success(`域名 ${x.domain} 已加入采集队列`),b()}catch(m){console.error("触发采集失败",m),r.error(`触发采集失败:${m}`)}},W=async x=>{const m=O(!1);o.warning({title:"确认删除",content:()=>$("div",null,[$("div",{class:"mb-2"},[Y("确定要删除域名 "),x.domain,Y(" 吗?")]),$(He,{checked:m.value,"onUpdate:checked":z=>m.value=z},{default:()=>[Y("同时删除所有关联的 SURL")]})]),positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{try{const z=(await n.post("/api/domain/v1/delete",{domain_ids:[x.id],remove_surl:m.value})).data;if(z.code!==2e4){r.error(`删除域名失败,错误:${z.message}`);return}r.success("删除成功");const ie=h.value.findIndex(se=>se===x.id);ie>-1&&h.value.splice(ie,1),b()}catch(z){console.error("删除域名失败",z),r.error(`删除域名失败,错误:${z}`)}}})},b=async()=>{try{const x=(await n.get("/api/domain/v1/list",{params:{page:v.value.page,size:v.value.pageSize,domain:l.value.domain||void 0,status:l.value.status||void 0}})).data;if(x.code!==2e4){r.error(`获取域名列表失败,错误:${x.message}`);return}U.value=x.data.rows,v.value.itemCount=x.data.total}catch(x){console.error("获取域名列表失败",x),r.error(`获取域名列表失败,错误:${x}`)}},q=()=>{b()},F=()=>{b()},E=x=>{p.value=[x.id],s.value=!0},K=()=>{var m;b();const x=((m=p.value)==null?void 0:m.length)||0;p.value=null,x>1&&(h.value=[])},ne=()=>{l.value={domain:"",status:null},v.value.page=1,c(),b()},J=()=>{v.value.page=1,c(),b()};return st(async()=>{w(),await b()}),(x,m)=>{const z=ae,ie=bt,se=we,pe=nn,ye=Xe,ue=tn,de=rn;return De(),er(Le,null,[m[16]||(m[16]=et("div",{class:"text-2xl pb-4"},"域名管理",-1)),et("div",ci,[$(z,{type:"primary",onClick:m[0]||(m[0]=N=>d.value=!0)},{default:D(()=>m[9]||(m[9]=[Y("通过文件导入")])),_:1}),$(z,{type:"primary",onClick:m[1]||(m[1]=N=>u.value=!0)},{default:D(()=>m[10]||(m[10]=[Y("手动添加")])),_:1}),$(z,{type:"error",onClick:M,disabled:!_.value},{default:D(()=>m[11]||(m[11]=[Y("批量删除")])),_:1},8,["disabled"]),$(z,{type:"warning",onClick:R,disabled:!_.value},{default:D(()=>m[12]||(m[12]=[Y("修改间隔")])),_:1},8,["disabled"]),$(z,{type:"info",onClick:L,disabled:!_.value},{default:D(()=>m[13]||(m[13]=[Y("立即采集")])),_:1},8,["disabled"])]),$(ye,{inline:"",model:l.value,class:"mb-4 p-4 bg-gray-50 rounded-lg"},{default:D(()=>[$(se,{label:"域名",path:"domain"},{default:D(()=>[$(ie,{value:l.value.domain,"onUpdate:value":m[2]||(m[2]=N=>l.value.domain=N),placeholder:"请输入域名",clearable:"",onKeydown:Yr(J,["enter"])},null,8,["value"])]),_:1}),$(se,{label:"状态",path:"status"},{default:D(()=>[$(pe,{value:l.value.status,"onUpdate:value":m[3]||(m[3]=N=>l.value.status=N),options:f,placeholder:"请选择状态",style:{width:"200px"}},null,8,["value"])]),_:1}),$(se,null,{default:D(()=>[$(z,{type:"primary",onClick:J},{default:D(()=>m[14]||(m[14]=[Y("筛选")])),_:1}),$(z,{class:"ml-2",onClick:ne},{default:D(()=>m[15]||(m[15]=[Y("重置")])),_:1})]),_:1})]),_:1},8,["model"]),$(ue,{columns:T,data:U.value,"row-key":N=>N.id,"checked-row-keys":h.value,"onUpdate:checkedRowKeys":V,size:"small"},null,8,["data","row-key","checked-row-keys"]),et("div",fi,[$(de,{page:v.value.page,"onUpdate:page":[m[4]||(m[4]=N=>v.value.page=N),v.value.onChange],"page-size":v.value.pageSize,"item-count":v.value.itemCount,"show-size-picker":v.value.showSizePicker,"page-sizes":v.value.pageSizes,"onUpdate:pageSize":v.value.onUpdatePageSize},null,8,["page","page-size","item-count","show-size-picker","page-sizes","onUpdate:pageSize","onUpdate:page"])]),$(li,{show:d.value,"onUpdate:show":m[5]||(m[5]=N=>d.value=N),onSuccess:q},null,8,["show"]),$(ai,{show:u.value,"onUpdate:show":m[6]||(m[6]=N=>u.value=N),onSuccess:F},null,8,["show"]),$(ui,{show:s.value,"onUpdate:show":m[7]||(m[7]=N=>s.value=N),"domain-ids":p.value,onSuccess:K,onClose:m[8]||(m[8]=N=>p.value=null)},null,8,["show","domain-ids"])],64)}}});export{vi as default};
|