go-proxy-bingai/web/assets/index-aec03a9e.js

1161 lines
232 KiB
JavaScript
Raw Normal View History

import{r as L,w as Ce,o as We,a as Qe,i as Oa,c as F,b as Ma,h as Ba,d as oo,e as Se,f as La,g as Te,j as Ve,k as ie,m as Lr,l as Er,p as Qt,u as Be,n as K,q as Pe,s as Ar,t as Ea,v as vt,x as ln,C as Aa,y as Da,z as Z,A as Dr,B as u,D as Fr,L as io,E as qt,F as er,G as tr,H as Fa,I as Na,J as Nr,K as Ha,M as Je,N as ao,O as Hr,P as jr,Q as mt,R as lo,S as Pr,T as sn,U as ja,V as dn,W as un,X as Kt,Y as Wa,Z as cn,_ as Ua,$ as Va,a0 as Ka,a1 as qa,a2 as Ga,a3 as Xa,a4 as Ya,a5 as so,a6 as Ke,a7 as Oe,a8 as P,a9 as B,aa as H,ab as Ie,ac as re,ad as Fe,ae as fe,af as ne,ag as ze,ah as W,ai as Za,aj as it,ak as $t,al as fn,am as uo,an as hn,ao as pn,ap as Ja,aq as _t,ar as Ye,as as De,at as co,au as vn,av as Qa,aw as he,ax as fo,ay as ce,az as te,aA as Ot,aB as el,aC as gn,aD as ho,aE as po,aF as vo,aG as ht,aH as tl,aI as rl,aJ as nl,aK as go,aL as ol,aM as il,aN as al,aO as Wr,aP as Mt,aQ as Pt,aR as ll,aS as Ur,aT as Gt,aU as mo,aV as sl,aW as dl,aX as mn,aY as ul,aZ as bn,a_ as cl,a$ as kr,b0 as fl,b1 as hl,b2 as bt,b3 as pl,b4 as bo,b5 as yo,b6 as wo,b7 as xo,b8 as Co,b9 as ye,ba as yn,bb as vl,bc as gl,bd as ve,be as Ae,bf as at,bg as Bt,bh as U,bi as je,bj as Q,bk as Y,bl as zt,bm as Ue,bn as ml,bo as So,bp as bl,bq as wn,br as yl,bs as Xt,bt as Po,bu as wl,bv as xl}from"./index-fb0759db.js";let Yt=[];const ko=new WeakMap;function Cl(){Yt.forEach(e=>e(...ko.get(e))),Yt=[]}function $o(e,...t){ko.set(e,t),!Yt.includes(e)&&Yt.push(e)===1&&requestAnimationFrame(Cl)}function xn(e,t){let{target:r}=e;for(;r;){if(r.dataset&&r.dataset[t]!==void 0)return!0;r=r.parentElement}return!1}function Sl(e,t="default",r=[]){const o=e.$slots[t];return o===void 0?r:o()}function Pl(e){return t=>{t?e.value=t.$el:e.value=null}}const kl=/^(\d|\.)+$/,Cn=/(\d|\.)+/;function He(e,{c:t=1,offset:r=0,attachPx:n=!0}={}){if(typeof e=="number"){const o=(e+r)*t;return o===0?"0":`${o}px`}else if(typeof e=="string")if(kl.test(e)){const o=(Number(e)+r)*t;return n?o===0?"0":`${o}px`:`${o}`}else{const o=Cn.exec(e);return o?e.replace(Cn,String((Number(o[0])+r)*t)):e}return e}let dr;function $l(){return dr===void 0&&(dr=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),dr}function zl(e,t,r){if(!t)return e;const n=L(e.value);let o=null;return Ce(e,i=>{o!==null&&window.clearTimeout(o),i===!0?r&&!r.value?n.value=!0:o=window.setTimeout(()=>{n.value=!0},t):n.value=!1}),n}let pt,Tt;const Tl=()=>{var e,t;pt=Oa?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,Tt=!1,pt!==void 0?pt.then(()=>{Tt=!0}):Tt=!0};Tl();function Il(e){if(Tt)return;let t=!1;We(()=>{Tt||pt==null||pt.then(()=>{t||e()})}),Qe(()=>{t=!0})}function rr(e,t){return Ce(e,r=>{r!==void 0&&(t.value=r)}),F(()=>e.value===void 0?t.value:e.value)}function Rl(e,t){return F(()=>{for(const r of t)if(e[r]!==void 0)return e[r];return e[t[t.length-1]]})}function _l(e={},t){const r=Ma({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:n,keyup:o}=e,i=a=>{switch(a.key){case"Control":r.ctrl=!0;break;case"Meta":r.command=!0,r.win=!0;break;case"Shift":r.shift=!0;break;case"Tab":r.tab=!0;break}n!==void 0&&Object.keys(n).forEach(d=>{if(d!==a.key)return;const c=n[d];if(typeof c=="function")c(a);else{const{stop:f=!1,prevent:h=!1}=c;f&&a.stopPropagation(),h&&a.preventDefault(),c.handler(a)}})},l=a=>{switch(a.key){case"Control":r.ctrl=!1;break;case"Meta":r.command=!1,r.win=!1;break;case"Shift":r.shift=!1;break;case"Tab":r.tab=!1;break}o!==void 0&&Object.keys(o).forEach(d=>{if(d!==a.key)return;const c=o[d];if(typeof c=="function")c(a);else{const{stop:f=!1,prevent:h=!1}=c;f&&a.stopPropagation(),h&&a.preventDefault(),c.handler(a)}})},s=()=>{(t===void 0||t.value)&&(Te("keydown",document,i),Te("keyup",document,l)),t!==void 0&&Ce(t,a=>{a?(Te("keydown",document,i),Te("keyup",document,l)):(Se("keydown",document,i),Se("keyup",document,l))})};return Ba()?(oo(s),Qe(()=>{(t===void 0||t.value)&&(Se("keydown",document,i),Se("keyup",document,l))})):s(),La(r)}const Ol=Ve("n-internal-select-menu-body"),zo="__disabled__";function gt(e){const t=ie(Lr,null),r=ie(Er,null),n
display: flex;
flex-direction: column;
align-items: center;
font-size: var(--n-font-size);
`,[B("icon",`
width: var(--n-icon-size);
height: var(--n-icon-size);
font-size: var(--n-icon-size);
line-height: var(--n-icon-size);
color: var(--n-icon-color);
transition:
color .3s var(--n-bezier);
`,[H("+",[B("description",`
margin-top: 8px;
`)])]),B("description",`
transition: color .3s var(--n-bezier);
color: var(--n-text-color);
`),B("extra",`
text-align: center;
transition: color .3s var(--n-bezier);
margin-top: 12px;
color: var(--n-extra-text-color);
`)]),Xc=Object.assign(Object.assign({},re.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),ei=K({name:"Empty",props:Xc,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ie(e),n=re("Empty","-empty",Gc,qc,e,t),{localeRef:o}=Xr("Empty"),i=ie(so,null),l=F(()=>{var c,f,h;return(c=e.description)!==null&&c!==void 0?c:(h=(f=i==null?void 0:i.mergedComponentPropsRef.value)===null||f===void 0?void 0:f.Empty)===null||h===void 0?void 0:h.description}),s=F(()=>{var c,f;return((f=(c=i==null?void 0:i.mergedComponentPropsRef.value)===null||c===void 0?void 0:c.Empty)===null||f===void 0?void 0:f.renderIcon)||(()=>u(uc,null))}),a=F(()=>{const{size:c}=e,{common:{cubicBezierEaseInOut:f},self:{[ne("iconSize",c)]:h,[ne("fontSize",c)]:p,textColor:y,iconColor:C,extraTextColor:m}}=n.value;return{"--n-icon-size":h,"--n-font-size":p,"--n-bezier":f,"--n-text-color":y,"--n-icon-color":C,"--n-extra-text-color":m}}),d=r?Fe("empty",F(()=>{let c="";const{size:f}=e;return c+=f[0],c}),a,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:s,localizedDescription:F(()=>l.value||o.value.description),cssVars:r?void 0:a,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{$slots:e,mergedClsPrefix:t,onRender:r}=this;return r==null||r(),u("div",{class:[`${t}-empty`,this.themeClass],style:this.cssVars},this.showIcon?u("div",{class:`${t}-empty__icon`},e.icon?e.icon():u(fe,{clsPrefix:t},{default:this.mergedRenderIcon})):null,this.showDescription?u("div",{class:`${t}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?u("div",{class:`${t}-empty__extra`},e.extra()):null)}}),Yc={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"},Zc=e=>{const{boxShadow2:t,popoverColor:r,textColor2:n,borderRadius:o,fontSize:i,dividerColor:l}=e;return Object.assign(Object.assign({},Yc),{fontSize:i,borderRadius:o,color:r,dividerColor:l,textColor:n,boxShadow:t})},Jc={name:"Popover",common:Oe,self:Zc},Zr=Jc,mr={top:"bottom",bottom:"top",left:"right",right:"left"},be="var(--n-arrow-height) * 1.414",Qc=H([P("popover",`
transition:
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
position: relative;
font-size: var(--n-font-size);
color: var(--n-text-color);
box-shadow: var(--n-box-shadow);
word-break: break-word;
`,[H(">",[P("scrollbar",`
height: inherit;
max-height: inherit;
`)]),ze("raw",`
background-color: var(--n-color);
border-radius: var(--n-border-radius);
`,[ze("scrollable",[ze("show-header-or-footer","padding: var(--n-padding);")])]),B("header",`
padding: var(--n-padding);
border-bottom: 1px solid var(--n-divider-color);
transition: border-color .3s var(--n-bezier);
`),B("footer",`
padding: var(--n-padding);
border-top: 1px solid var(--n-divider-color);
transition: border-color .3s var(--n-bezier);
`),W("scrollable, show-header-or-footer",[B("content",`
padding: var(--n-padding);
`)])]),P("popover-shared",`
transform-origin: inherit;
`,[P("popover-arrow-wrapper",`
position: absolute;
overflow: hidden;
pointer-events: none;
`,[P("popover-arrow",`
transition: background-color .3s var(--n-bezier);
position: absolute;
display: block;
width: calc(${be});
height: calc(${be});
box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12);
transform: rotate(45deg);
background-color: var(--n-color);
pointer-events: all;
`)]),H("&.popover-transition-enter-from, &.popover-transition-leave-to",`
opacity: 0;
transform: scale(.85);
`),H("&.popover-transition-enter-to, &.popover-transition-leave-from",`
transform: scale(1);
opacity: 1;
`),H("&.popover-transition-enter-active",`
transition:
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier),
color .3s var(--n-bezier),
opacity .15s var(--n-bezier-ease-out),
transform .15s var(--n-bezier-ease-out);
`),H("&.popover-transition-leave-active",`
transition:
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier),
color .3s var(--n-bezier),
opacity .15s var(--n-bezier-ease-in),
transform .15s var(--n-bezier-ease-in);
`)]),Me("top-start",`
top: calc(${be} / -2);
left: calc(${Xe("top-start")} - var(--v-offset-left));
`),Me("top",`
top: calc(${be} / -2);
transform: translateX(calc(${be} / -2)) rotate(45deg);
left: 50%;
`),Me("top-end",`
top: calc(${be} / -2);
right: calc(${Xe("top-end")} + var(--v-offset-left));
`),Me("bottom-start",`
bottom: calc(${be} / -2);
left: calc(${Xe("bottom-start")} - var(--v-offset-left));
`),Me("bottom",`
bottom: calc(${be} / -2);
transform: translateX(calc(${be} / -2)) rotate(45deg);
left: 50%;
`),Me("bottom-end",`
bottom: calc(${be} / -2);
right: calc(${Xe("bottom-end")} + var(--v-offset-left));
`),Me("left-start",`
left: calc(${be} / -2);
top: calc(${Xe("left-start")} - var(--v-offset-top));
`),Me("left",`
left: calc(${be} / -2);
transform: translateY(calc(${be} / -2)) rotate(45deg);
top: 50%;
`),Me("left-end",`
left: calc(${be} / -2);
bottom: calc(${Xe("left-end")} + var(--v-offset-top));
`),Me("right-start",`
right: calc(${be} / -2);
top: calc(${Xe("right-start")} - var(--v-offset-top));
`),Me("right",`
right: calc(${be} / -2);
transform: translateY(calc(${be} / -2)) rotate(45deg);
top: 50%;
`),Me("right-end",`
right: calc(${be} / -2);
bottom: calc(${Xe("right-end")} + var(--v-offset-top));
`),...fu({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(e,t)=>{const r=["right","left"].includes(t),n=r?"width":"height";return e.map(o=>{const i=o.split("-")[1]==="end",s=`calc((${`var(--v-target-${n}, 0px)`} - ${be}) / 2)`,a=Xe(o);return H(`[v-placement="${o}"] >`,[P("popover-shared",[W("center-arrow",[P("popover-arrow",`${t}: calc(max(${s}, ${a}) ${i?"+":"-"} var(--v-offset-${r?"left":"top"}));`)])])])})})]);function Xe(e){return["top","bottom"].includes(e.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function Me(e,t){const r=e.split("-")[0],n=["top","bottom"].includes(r)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return H(`[v-placement="${e}"] >`,[P("popover-shared",`
margin-${mr[r]}: var(--n-space);
`,[W("show-arrow",`
margin-${mr[r]}: var(--n-space-arrow);
`),W("overlap",`
margin: 0;
`),Za("popover-arrow-wrapper",`
right: 0;
left: 0;
top: 0;
bottom: 0;
${r}: 100%;
${mr[r]}: auto;
${n}
`,[P("popover-arrow",t)])])])}const ti=Object.assign(Object.assign({},re.props),{to:gt.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentStyle:[Object,String],headerStyle:[Object,String],footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number}),ri=({arrowStyle:e,clsPrefix:t})=>u("div",{key:"__popover-arrow__",class:`${t}-popover-arrow-wrapper`},u("div",{class:`${t}-popover-arrow`,style:e})),ef=K({name:"PopoverBody",inheritAttrs:!1,props:ti,setup(e,{slots:t,attrs:r}){const{namespaceRef:n,mergedClsPrefixRef:o,inlineThemeDisabled:i}=Ie(e),l=re("Popover","-popover",Qc,Zr,e,o),s=L(null),a=ie("NPopover"),d=L(null),c=L(e.show),f=L(!1);it(()=>{const{show:k}=e;k&&!$l()&&!e.internalDeactivateImmediately&&(f.value=!0)});const h=F(()=>{const{trigger:k,onClickoutside:E}=e,$=[],{positionManuallyRef:{value:S}}=a;return S||(k==="click"&&!E&&$.push([fn,b,void 0,{capture:!0}]),k==="hover"&&$.push([Al,_])),E&&$.push([fn,b,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&f.value)&&$.push([uo,e.show]),$}),p=F(()=>{const k=e.width==="trigger"?void 0:He(e.width),E=[];k&&E.push({width:k});const{maxWidth:$,minWidth:S}=e;return $&&E.push({maxWidth:He($)}),S&&E.push({maxWidth:He(S)}),i||E.push(y.value),E}),y=F(()=>{const{common:{cubicBezierEaseInOut:k,cubicBezierEaseIn:E,cubicBezierEaseOut:$},self:{space:S,spaceArrow:A,padding:M,fontSize:R,textColor:x,dividerColor:z,color:N,boxShadow:D,borderRadius:q,arrowHeight:J,arrowOffset:ae,arrowOffsetVertical:ge}}=l.value;return{"--n-box-shadow":D,"--n-bezier":k,"--n-bezier-ease-in":E,"--n-bezier-ease-out":$,"--n-font-size":R,"--n-text-color":x,"--n-color":N,"--n-divider-color":z,"--n-border-radius":q,"--n-arrow-height":J,"--n-arrow-offset":ae,"--n-arrow-offset-vertical":ge,"--n-padding":M,"--n-space":S,"--n-space-arrow":A}}),C=i?Fe("popover",void 0,y,e):void 0;a.setBodyInstance({syncPosition:m}),Qe(()=>{a.setBodyInstance(null)}),Ce(Z(e,"show"),k=>{e.animated||(k?c.value=!0:c.value=!1)});function m(){var k;(k=s.value)===null||k===void 0||k.syncPosition()}function w(k){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&a.handleMouseEnter(k)}function T(k){e.trigger==="hover"&&e.keepAliveOnHover&&a.handleMouseLeave(k)}function _(k){e.trigger==="hover"&&!g().contains(hn(k))&&a.handleMouseMoveOutside(k)}function b(k){(e.trigger==="click"&&!g().contains(hn(k))||e.onClickoutside)&&a.handleClickOutside(k)}function g(){return a.getTriggerElement()}Pe(Qt,d),Pe(Er,null),Pe(Lr,null);function O(){if(C==null||C.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&f.value))return null;let E;const $=a.internalRenderBodyRef.value,{value:S}=o;if($)E=$([`${S}-popover-shared`,C==null?void 0:C.themeClass.value,e.overlap&&`${S}-popover-shared--overlap`,e.showArrow&&`${S}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${S}-popover-shared--center-arrow`],d,p.value,w,T);else{const{value:A}=a.extraClassRef,{internalTrapFocus:M}=e,R=!pn(t.header)||!pn(t.footer),x=()=>{var z;const N=R?u(De,null,Ye(t.header,J=>J?u("div",{class:`${S}-popover__header`,style:e.headerStyle},J):null),Ye(t.default,J=>J?u("div",{class:`${S}-popover__content`,style:e.contentStyle},t):null),Ye(t.footer,J=>J?u("div",{class:`${S}-popover__footer`,style:e.footerStyle},J):null)):e.scrollable?(z=t.default)===null||z===void 0?void 0:z.call(t):u("div",{class:`${S}-popover__content`,style:e.contentStyle},t),D=e.scrollable?u(co,{contentClass:R?void 0:`${S}-popover__content`,contentStyle:R?void 0:e.contentStyle},{default:()=>N}):N,q=e.showArrow?ri({arrowStyle:e.arrowStyle,clsPrefix:S}):null;return[D,q]};E=u("div",_t({class:[`${S}-popover`,`${S}-popover-shared`,C==null?void 0:C.themeClass.value,A.map(z=>`${S}-${z}`),{[`${S}-popover--scrollable`]:e.scrolla
white-space: nowrap;
position: relative;
box-sizing: border-box;
cursor: default;
display: inline-flex;
align-items: center;
flex-wrap: nowrap;
padding: var(--n-padding);
border-radius: var(--n-border-radius);
color: var(--n-text-color);
background-color: var(--n-color);
transition:
border-color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier),
opacity .3s var(--n-bezier);
line-height: 1;
height: var(--n-height);
font-size: var(--n-font-size);
`,[W("strong",`
font-weight: var(--n-font-weight-strong);
`),B("border",`
pointer-events: none;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
border-radius: inherit;
border: var(--n-border);
transition: border-color .3s var(--n-bezier);
`),B("icon",`
display: flex;
margin: 0 4px 0 0;
color: var(--n-text-color);
transition: color .3s var(--n-bezier);
font-size: var(--n-avatar-size-override);
`),B("avatar",`
display: flex;
margin: 0 6px 0 0;
`),B("close",`
margin: var(--n-close-margin);
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
`),W("round",`
padding: 0 calc(var(--n-height) / 3);
border-radius: calc(var(--n-height) / 2);
`,[B("icon",`
margin: 0 4px 0 calc((var(--n-height) - 8px) / -2);
`),B("avatar",`
margin: 0 6px 0 calc((var(--n-height) - 8px) / -2);
`),W("closable",`
padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3);
`)]),W("icon, avatar",[W("round",`
padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2);
`)]),W("disabled",`
cursor: not-allowed !important;
opacity: var(--n-opacity-disabled);
`),W("checkable",`
cursor: pointer;
box-shadow: none;
color: var(--n-text-color-checkable);
background-color: var(--n-color-checkable);
`,[ze("disabled",[H("&:hover","background-color: var(--n-color-hover-checkable);",[ze("checked","color: var(--n-text-color-hover-checkable);")]),H("&:active","background-color: var(--n-color-pressed-checkable);",[ze("checked","color: var(--n-text-color-pressed-checkable);")])]),W("checked",`
color: var(--n-text-color-checked);
background-color: var(--n-color-checked);
`,[ze("disabled",[H("&:hover","background-color: var(--n-color-checked-hover);"),H("&:active","background-color: var(--n-color-checked-pressed);")])])])]),hf=Object.assign(Object.assign(Object.assign({},re.props),cf),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),pf=Ve("n-tag"),oi=K({name:"Tag",props:hf,setup(e){const t=L(null),{mergedBorderedRef:r,mergedClsPrefixRef:n,inlineThemeDisabled:o,mergedRtlRef:i}=Ie(e),l=re("Tag","-tag",ff,uf,e,n);Pe(pf,{roundRef:Z(e,"round")});function s(p){if(!e.disabled&&e.checkable){const{checked:y,onCheckedChange:C,onUpdateChecked:m,"onUpdate:checked":w}=e;m&&m(!y),w&&w(!y),C&&C(!y)}}function a(p){if(e.triggerClickOnClose||p.stopPropagation(),!e.disabled){const{onClose:y}=e;y&&ce(y,p)}}const d={setTextContent(p){const{value:y}=t;y&&(y.textContent=p)}},c=Ot("Tag",i,n),f=F(()=>{const{type:p,size:y,color:{color:C,textColor:m}={}}=e,{common:{cubicBezierEaseInOut:w},self:{padding:T,closeMargin:_,closeMarginRtl:b,borderRadius:g,opacityDisabled:O,textColorCheckable:k,textColorHoverCheckable:E,textColorPressedCheckable:$,textColorChecked:S,colorCheckable:A,colorHoverCheckable:M,colorPressedCheckable:R,colorChecked:x,colorCheckedHover:z,colorCheckedPressed:N,closeBorderRadius:D,fontWeightStrong:q,[ne("colorBordered",p)]:J,[ne("closeSize",y)]:ae,[ne("closeIconSize",y)]:ge,[ne("fontSize",y)]:me,[ne("height",y)]:Re,[ne("color",p)]:oe,[ne("textColor",p)]:ke,[ne("border",p)]:we,[ne("closeIconColor",p)]:ee,[ne("closeIconColorHover",p)]:Le,[ne("closeIconColorPressed",p)]:qe,[ne("closeColorHover",p)]:Ge,[ne("closeColorPressed",p)]:Ee}}=l.value;return{"--n-font-weight-strong":q,"--n-avatar-size-override":`calc(${Re} - 8px)`,"--n-bezier":w,"--n-border-radius":g,"--n-border":we,"--n-close-icon-size":ge,"--n-close-color-pressed":Ee,"--n-close-color-hover":Ge,"--n-close-border-radius":D,"--n-close-icon-color":ee,"--n-close-icon-color-hover":Le,"--n-close-icon-color-pressed":qe,"--n-close-icon-color-disabled":ee,"--n-close-margin":_,"--n-close-margin-rtl":b,"--n-close-size":ae,"--n-color":C||(r.value?J:oe),"--n-color-checkable":A,"--n-color-checked":x,"--n-color-checked-hover":z,"--n-color-checked-pressed":N,"--n-color-hover-checkable":M,"--n-color-pressed-checkable":R,"--n-font-size":me,"--n-height":Re,"--n-opacity-disabled":O,"--n-padding":T,"--n-text-color":m||ke,"--n-text-color-checkable":k,"--n-text-color-checked":S,"--n-text-color-hover-checkable":E,"--n-text-color-pressed-checkable":$}}),h=o?Fe("tag",F(()=>{let p="";const{type:y,size:C,color:{color:m,textColor:w}={}}=e;return p+=y[0],p+=C[0],m&&(p+=`a${gn(m)}`),w&&(p+=`b${gn(w)}`),r.value&&(p+="c"),p}),f,e):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:c,mergedClsPrefix:n,contentRef:t,mergedBordered:r,handleClick:s,handleCloseClick:a,cssVars:o?void 0:f,themeClass:h==null?void 0:h.themeClass,onRender:h==null?void 0:h.onRender})},render(){var e,t;const{mergedClsPrefix:r,rtlEnabled:n,closable:o,color:{borderColor:i}={},round:l,onRender:s,$slots:a}=this;s==null||s();const d=Ye(a.avatar,f=>f&&u("div",{class:`${r}-tag__avatar`},f)),c=Ye(a.icon,f=>f&&u("div",{class:`${r}-tag__icon`},f));return u("div",{class:[`${r}-tag`,this.themeClass,{[`${r}-tag--rtl`]:n,[`${r}-tag--strong`]:this.strong,[`${r}-tag--disabled`]:this.disabled,[`${r}-tag--checkable`]:this.checkable,[`${r}-tag--checked`]:this.checkable&&this.checked,[`${r}-tag--round`]:l,[`${r}-tag--avatar`]:d,[`${r}-tag--icon`]:c,[`${r}-tag--closable`]:o}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},c||d,u("span",{class:`${r}-tag__content`,ref:"contentRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)),!this.checkable&&o?u(el,{clsPrefix:r,class:`${r}-tag__close`,disabled:this.disabled,onClick:this.handleC
flex-shrink: 0;
height: 1em;
width: 1em;
position: relative;
`,[H(">",[B("clear",`
font-size: var(--n-clear-size);
height: 1em;
width: 1em;
cursor: pointer;
color: var(--n-clear-color);
transition: color .3s var(--n-bezier);
display: flex;
`,[H("&:hover",`
color: var(--n-clear-color-hover)!important;
`),H("&:active",`
color: var(--n-clear-color-pressed)!important;
`)]),B("placeholder",`
display: flex;
`),B("clear, placeholder",`
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
`,[ho({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),_r=K({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return po("-base-clear",vf,Z(e,"clsPrefix")),{handleMouseDown(t){t.preventDefault()}}},render(){const{clsPrefix:e}=this;return u("div",{class:`${e}-base-clear`},u(vo,null,{default:()=>{var t,r;return this.show?u("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},ht(this.$slots.icon,()=>[u(fe,{clsPrefix:e},{default:()=>u(hc,null)})])):u("div",{key:"icon",class:`${e}-base-clear__placeholder`},(r=(t=this.$slots).placeholder)===null||r===void 0?void 0:r.call(t))}}))}}),gf=K({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(e,{slots:t}){return()=>{const{clsPrefix:r}=e;return u(tl,{clsPrefix:r,class:`${r}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?u(_r,{clsPrefix:r,show:e.showClear,onClear:e.onClear},{placeholder:()=>u(fe,{clsPrefix:r,class:`${r}-base-suffix__arrow`},{default:()=>ht(t.default,()=>[u(fc,null)])})}):null})}}}),mf={paddingTiny:"0 8px",paddingSmall:"0 10px",paddingMedium:"0 12px",paddingLarge:"0 14px",clearSize:"16px"},bf=e=>{const{textColor2:t,textColor3:r,textColorDisabled:n,primaryColor:o,primaryColorHover:i,inputColor:l,inputColorDisabled:s,borderColor:a,warningColor:d,warningColorHover:c,errorColor:f,errorColorHover:h,borderRadius:p,lineHeight:y,fontSizeTiny:C,fontSizeSmall:m,fontSizeMedium:w,fontSizeLarge:T,heightTiny:_,heightSmall:b,heightMedium:g,heightLarge:O,actionColor:k,clearColor:E,clearColorHover:$,clearColorPressed:S,placeholderColor:A,placeholderColorDisabled:M,iconColor:R,iconColorDisabled:x,iconColorHover:z,iconColorPressed:N}=e;return Object.assign(Object.assign({},mf),{countTextColorDisabled:n,countTextColor:r,heightTiny:_,heightSmall:b,heightMedium:g,heightLarge:O,fontSizeTiny:C,fontSizeSmall:m,fontSizeMedium:w,fontSizeLarge:T,lineHeight:y,lineHeightTextarea:y,borderRadius:p,iconSize:"16px",groupLabelColor:k,groupLabelTextColor:t,textColor:t,textColorDisabled:n,textDecorationColor:t,caretColor:o,placeholderColor:A,placeholderColorDisabled:M,color:l,colorDisabled:s,colorFocus:l,groupLabelBorder:`1px solid ${a}`,border:`1px solid ${a}`,borderHover:`1px solid ${i}`,borderDisabled:`1px solid ${a}`,borderFocus:`1px solid ${i}`,boxShadowFocus:`0 0 0 2px ${te(o,{alpha:.2})}`,loadingColor:o,loadingColorWarning:d,borderWarning:`1px solid ${d}`,borderHoverWarning:`1px solid ${c}`,colorFocusWarning:l,borderFocusWarning:`1px solid ${c}`,boxShadowFocusWarning:`0 0 0 2px ${te(d,{alpha:.2})}`,caretColorWarning:d,loadingColorError:f,borderError:`1px solid ${f}`,borderHoverError:`1px solid ${h}`,colorFocusError:l,borderFocusError:`1px solid ${h}`,boxShadowFocusError:`0 0 0 2px ${te(f,{alpha:.2})}`,caretColorError:f,clearColor:E,clearColorHover:$,clearColorPressed:S,iconColor:R,iconColorDisabled:x,iconColorHover:z,iconColorPressed:N,suffixTextColor:t})},yf={name:"Input",common:Oe,self:bf},wf=yf,ii=Ve("n-input");function xf(e){let t=0;for(const r of e)t++;return t}function jt(e){return e===""||e==null}function Cf(e){const t=L(null);function r(){const{value:i}=e;if(!(i!=null&&i.focus)){o();return}const{selectionStart:l,selectionEnd:s,value:a}=i;if(l==null||s==null){o();return}t.value={start:l,end:s,beforeText:a.slice(0,l),afterText:a.slice(s)}}function n(){var i;const{value:l}=t,{value:s}=e;if(!l||!s)return;const{value:a}=s,{start:d,beforeText:c,afterText:f}=l;let h=a.length;if(a.endsWith(f))h=a.length-f.length;else if(a.startsWith(c))h=c.length;else{const p=c[d-1],y=a.indexOf(p,d-1);y!==-1&&(h=y+1)}(i=s.setSelectionRange)===null||i===void 0||i.call(s,h,h)}function o(){t.value=null}return Ce(e,o),{recordCursor:r,restoreCursor:n}}const Un=K({name:"InputWordCount",setup(e,{slots:t}){const{mergedValueRef:r,maxlengthRef:n,mergedClsPrefixRef:o,countGraphemes
max-width: 100%;
cursor: text;
line-height: 1.5;
z-index: auto;
outline: none;
box-sizing: border-box;
position: relative;
display: inline-flex;
border-radius: var(--n-border-radius);
background-color: var(--n-color);
transition: background-color .3s var(--n-bezier);
font-size: var(--n-font-size);
--n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2);
`,[B("input, textarea",`
overflow: hidden;
flex-grow: 1;
position: relative;
`),B("input-el, textarea-el, input-mirror, textarea-mirror, separator, placeholder",`
box-sizing: border-box;
font-size: inherit;
line-height: 1.5;
font-family: inherit;
border: none;
outline: none;
background-color: #0000;
text-align: inherit;
transition:
-webkit-text-fill-color .3s var(--n-bezier),
caret-color .3s var(--n-bezier),
color .3s var(--n-bezier),
text-decoration-color .3s var(--n-bezier);
`),B("input-el, textarea-el",`
-webkit-appearance: none;
scrollbar-width: none;
width: 100%;
min-width: 0;
text-decoration-color: var(--n-text-decoration-color);
color: var(--n-text-color);
caret-color: var(--n-caret-color);
background-color: transparent;
`,[H("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",`
width: 0;
height: 0;
display: none;
`),H("&::placeholder",`
color: #0000;
-webkit-text-fill-color: transparent !important;
`),H("&:-webkit-autofill ~",[B("placeholder","display: none;")])]),W("round",[ze("textarea","border-radius: calc(var(--n-height) / 2);")]),B("placeholder",`
pointer-events: none;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
overflow: hidden;
color: var(--n-placeholder-color);
`,[H("span",`
width: 100%;
display: inline-block;
`)]),W("textarea",[B("placeholder","overflow: visible;")]),ze("autosize","width: 100%;"),W("autosize",[B("textarea-el, input-el",`
position: absolute;
top: 0;
left: 0;
height: 100%;
`)]),P("input-wrapper",`
overflow: hidden;
display: inline-flex;
flex-grow: 1;
position: relative;
padding-left: var(--n-padding-left);
padding-right: var(--n-padding-right);
`),B("input-mirror",`
padding: 0;
height: var(--n-height);
line-height: var(--n-height);
overflow: hidden;
visibility: hidden;
position: static;
white-space: pre;
pointer-events: none;
`),B("input-el",`
padding: 0;
height: var(--n-height);
line-height: var(--n-height);
`,[H("+",[B("placeholder",`
display: flex;
align-items: center;
`)])]),ze("textarea",[B("placeholder","white-space: nowrap;")]),B("eye",`
transition: color .3s var(--n-bezier);
`),W("textarea","width: 100%;",[P("input-word-count",`
position: absolute;
right: var(--n-padding-right);
bottom: var(--n-padding-vertical);
`),W("resizable",[P("input-wrapper",`
resize: vertical;
min-height: var(--n-height);
`)]),B("textarea-el, textarea-mirror, placeholder",`
height: 100%;
padding-left: 0;
padding-right: 0;
padding-top: var(--n-padding-vertical);
padding-bottom: var(--n-padding-vertical);
word-break: break-word;
display: inline-block;
vertical-align: bottom;
box-sizing: border-box;
line-height: var(--n-line-height-textarea);
margin: 0;
resize: none;
white-space: pre-wrap;
`),B("textarea-mirror",`
width: 100%;
pointer-events: none;
overflow: hidden;
visibility: hidden;
position: static;
white-space: pre-wrap;
overflow-wrap: break-word;
`)]),W("pair",[B("input-el, placeholder","text-align: center;"),B("separator",`
display: flex;
align-items: center;
transition: color .3s var(--n-bezier);
color: var(--n-text-color);
white-space: nowrap;
`,[P("icon",`
color: var(--n-icon-color);
`),P("base-icon",`
color: var(--n-icon-color);
`)])]),W("disabled",`
cursor: not-allowed;
background-color: var(--n-color-disabled);
`,[B("border","border: var(--n-border-disabled);"),B("input-el, textarea-el",`
cursor: not-allowed;
color: var(--n-text-color-disabled);
text-decoration-color: var(--n-text-color-disabled);
`),B("placeholder","color: var(--n-placeholder-color-disabled);"),B("separator","color: var(--n-text-color-disabled);",[P("icon",`
color: var(--n-icon-color-disabled);
`),P("base-icon",`
color: var(--n-icon-color-disabled);
`)]),P("input-word-count",`
color: var(--n-count-text-color-disabled);
`),B("suffix, prefix","color: var(--n-text-color-disabled);",[P("icon",`
color: var(--n-icon-color-disabled);
`),P("internal-icon",`
color: var(--n-icon-color-disabled);
`)])]),ze("disabled",[B("eye",`
display: flex;
align-items: center;
justify-content: center;
color: var(--n-icon-color);
cursor: pointer;
`,[H("&:hover",`
color: var(--n-icon-color-hover);
`),H("&:active",`
color: var(--n-icon-color-pressed);
`)]),H("&:hover",[B("state-border","border: var(--n-border-hover);")]),W("focus","background-color: var(--n-color-focus);",[B("state-border",`
border: var(--n-border-focus);
box-shadow: var(--n-box-shadow-focus);
`)])]),B("border, state-border",`
box-sizing: border-box;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
pointer-events: none;
border-radius: inherit;
border: var(--n-border);
transition:
box-shadow .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`),B("state-border",`
border-color: #0000;
z-index: 1;
`),B("prefix","margin-right: 4px;"),B("suffix",`
margin-left: 4px;
`),B("suffix, prefix",`
transition: color .3s var(--n-bezier);
flex-wrap: nowrap;
flex-shrink: 0;
line-height: var(--n-height);
white-space: nowrap;
display: inline-flex;
align-items: center;
justify-content: center;
color: var(--n-suffix-text-color);
`,[P("base-loading",`
font-size: var(--n-icon-size);
margin: 0 2px;
color: var(--n-loading-color);
`),P("base-clear",`
font-size: var(--n-icon-size);
`,[B("placeholder",[P("base-icon",`
transition: color .3s var(--n-bezier);
color: var(--n-icon-color);
font-size: var(--n-icon-size);
`)])]),H(">",[P("icon",`
transition: color .3s var(--n-bezier);
color: var(--n-icon-color);
font-size: var(--n-icon-size);
`)]),P("base-icon",`
font-size: var(--n-icon-size);
`)]),P("input-word-count",`
pointer-events: none;
line-height: 1.5;
font-size: .85em;
color: var(--n-count-text-color);
transition: color .3s var(--n-bezier);
margin-left: 4px;
font-variant: tabular-nums;
`),["warning","error"].map(e=>W(`${e}-status`,[ze("disabled",[P("base-loading",`
color: var(--n-loading-color-${e})
`),B("input-el, textarea-el",`
caret-color: var(--n-caret-color-${e});
`),B("state-border",`
border: var(--n-border-${e});
`),H("&:hover",[B("state-border",`
border: var(--n-border-hover-${e});
`)]),H("&:focus",`
background-color: var(--n-color-focus-${e});
`,[B("state-border",`
box-shadow: var(--n-box-shadow-focus-${e});
border: var(--n-border-focus-${e});
`)]),W("focus",`
background-color: var(--n-color-focus-${e});
`,[B("state-border",`
box-shadow: var(--n-box-shadow-focus-${e});
border: var(--n-border-focus-${e});
`)])])]))]),Pf=P("input",[W("disabled",[B("input-el, textarea-el",`
-webkit-text-fill-color: var(--n-text-color-disabled);
`)])]),kf=Object.assign(Object.assign({},re.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:"text"},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:Function,onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:Boolean,showPasswordToggle:Boolean}),kt=K({name:"Input",props:kf,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:r,inlineThemeDisabled:n,mergedRtlRef:o}=Ie(e),i=re("Input","-input",Sf,wf,e,t);nl&&po("-input-safari",Pf,t);const l=L(null),s=L(null),a=L(null),d=L(null),c=L(null),f=L(null),h=L(null),p=Cf(h),y=L(null),{localeRef:C}=Xr("Input"),m=L(e.defaultValue),w=Z(e,"value"),T=rr(w,m),_=go(e),{mergedSizeRef:b,mergedDisabledRef:g,mergedStatusRef:O}=_,k=L(!1),E=L(!1),$=L(!1),S=L(!1);let A=null;const M=F(()=>{const{placeholder:v,pair:I}=e;return I?Array.isArray(v)?v:v===void 0?["",""]:[v,v]:v===void 0?[C.value.placeholder]:[v]}),R=F(()=>{const{value:v}=$,{value:I}=T,{value:G}=M;return!v&&(jt(I)||Array.isArray(I)&&jt(I[0]))&&G[0]}),x=F(()=>{const{value:v}=$,{value:I}=T,{value:G}=M;return!v&&G[1]&&(jt(I)||Array.isArray(I)&&jt(I[1]))}),z=Be(()=>e.internalForceFocus||k.value),N=Be(()=>{if(g.value||e.readonly||!e.clearable||!z.value&&!E.value)return!1;const{value:v}=T,{value:I}=z;return e.pair?!!(Array.isArray(v)&&(v[0]||v[1]))&&(E.value||I):!!v&&(E.value||I)}),D=F(()=>{const{showPasswordOn:v}=e;if(v)return v;if(e.showPasswordToggle)return"click"}),q=L(!1),J=F(()=>{const{textDecoration:v}=e;return v?Array.isArray(v)?v.map(I=>({textDecoration:I})):[{textDecoration:v}]:["",""]}),ae=L(void 0),ge=()=>{var v,I;if(e.type==="textarea"){const{autosize:G}=e;if(G&&(ae.value=(I=(v=y.value)===null||v===void 0?void 0:v.$el)===null||I===void 0?void 0:I.offsetWidth),!s.value||typeof G=="boolean")return;const{paddingTop:ue,paddingBottom:pe,lineHeight:de}=window.getComputedStyle(s.value),et=Number(ue.slice(0,-2)),tt=Number(pe.slice(0,-2)),rt=Number(de.slice(0,-2)),{value:wt}=a;if(!wt)return;if(G.minRows){const xt=Math.max(G.minRows,1),sr=`${et+tt+rt*xt}px`;wt.style.minHeight=sr}if(G.maxRows){const xt=`${et+tt+rt*G.maxRows}px`;wt.style.maxHeight=xt}}},me=F(()=>{const{maxlength:v}=e;return v===void 0?void 0:Number(v)});We(()=>{const{value:v}=T;Array.isArray(v)||lr(v)});const Re=Ar().proxy;function oe(v){const{onUpdateValue:I,"onUpdate:value":G,onInput:ue}=e,{nTriggerFormInput:pe}=_;I&&ce(I,v),G&&ce(G,v),ue&&ce(ue,v),m.value=v,pe()}function ke(v){const{onChange:I}=e,{nTriggerFormChange:G}=_;I&&ce(I,v),m.value=v,G()}function we(v){const{onBlur:I}=e,{nTriggerFormBlur:G}=_;I&&ce(I,v),G()}function ee(v){const{onFocus:I}=e,{nTriggerFormFocus:G}=_;I&&ce(I,v),G()}function Le(v){const{onClear:I}=e;I&&ce(I,v)}function qe(v){const{onInputBlur:I}=e;I&&ce(I,v)}function Ge(v){const{onInputFocus:I}=e;I&&ce(I,v)}function Ee(){const{onDeactivate:v}=e;v&&ce(v)}function j(){const{onActivate:v}=e;v&&ce(v)}function X(v){const{onClick:I}=e;I&&ce(I,v)}function V(v){const{onWrapperFoc
`)}else{const{value:pe}=d;pe&&(v?pe.textContent=v:pe.innerHTML=" ")}}function Ui(){ge()}const on=L({top:"0"});function Vi(v){var I;const{scrollTop:G}=v.target;on.value.top=`${-G}px`,(I=y.value)===null||I===void 0||I.syncUnifiedContainer()}let At=null;it(()=>{const{autosize:v,type:I}=e;v&&I==="textarea"?At=Ce(T,G=>{!Array.isArray(G)&&G!==A&&lr(G)}):At==null||At()});let Dt=null;it(()=>{e.type==="textarea"?Dt=Ce(T,v=>{var I;!Array.isArray(v)&&v!==A&&((I=y.value)===null||I===void 0||I.syncUnifiedContainer())}):Dt==null||Dt()}),Pe(ii,{mergedValueRef:T,maxlengthRef:me,mergedClsPrefixRef:t,countGraphemesRef:Z(e,"countGraphemes")});const Ki={wrapperElRef:l,inputElRef:c,textareaElRef:s,isCompositing:$,focus:nn,blur:Fi,select:Ni,deactivate:ji,activate:Hi,scrollTo:Wi},qi=Ot("Input",o,t),an=F(()=>{const{value:v}=b,{common:{cubicBezierEaseInOut:I},self:{color:G,borderRadius:ue,textColor:pe,caretColor:de,caretColorError:et,caretColorWarning:tt,textDecorationColor:rt,border:wt,borderDisabled:xt,borderHover:sr,borderFocus:Gi,placeholderColor:Xi,placeholderColorDisabled:Yi,lineHeightTextarea:Zi,colorDisabled:Ji,colorFocus:Qi,textColorDisabled:ea,boxShadowFocus:ta,iconSize:ra,colorFocusWarning:na,boxShadowFocusWarning:oa,borderWarning:ia,borderFocusWarning:aa,borderHoverWarning:la,colorFocusError:sa,boxShadowFocusError:da,borderError:ua,borderFocusError:ca,borderHoverError:fa,clearSize:ha,clearColor:pa,clearColorHover:va,clearColorPressed:ga,iconColor:ma,iconColorDisabled:ba,suffixTextColor:ya,countTextColor:wa,countTextColorDisabled:xa,iconColorHover:Ca,iconColorPressed:Sa,loadingColor:Pa,loadingColorError:ka,loadingColorWarning:$a,[ne("padding",v)]:za,[ne("fontSize",v)]:Ta,[ne("height",v)]:Ia}}=i.value,{left:Ra,right:_a}=al(za);return{"--n-bezier":I,"--n-count-text-color":wa,"--n-count-text-color-disabled":xa,"--n-color":G,"--n-font-size":Ta,"--n-border-radius":ue,"--n-height":Ia,"--n-padding-left":Ra,"--n-padding-right":_a,"--n-text-color":pe,"--n-caret-color":de,"--n-text-decoration-color":rt,"--n-border":wt,"--n-border-disabled":xt,"--n-border-hover":sr,"--n-border-focus":Gi,"--n-placeholder-color":Xi,"--n-placeholder-color-disabled":Yi,"--n-icon-size":ra,"--n-line-height-textarea":Zi,"--n-color-disabled":Ji,"--n-color-focus":Qi,"--n-text-color-disabled":ea,"--n-box-shadow-focus":ta,"--n-loading-color":Pa,"--n-caret-color-warning":tt,"--n-color-focus-warning":na,"--n-box-shadow-focus-warning":oa,"--n-border-warning":ia,"--n-border-focus-warning":aa,"--n-border-hover-warning":la,"--n-loading-color-warning":$a,"--n-caret-color-error":et,"--n-color-focus-error":sa,"--n-box-shadow-focus-error":da,"--n-border-error":ua,"--n-border-focus-error":ca,"--n-border-hover-error":fa,"--n-loading-color-error":ka,"--n-clear-color":pa,"--n-clear-size":ha,"--n-clear-color-hover":va,"--n-clear-color-pressed":ga,"--n-icon-color":ma,"--n-icon-color-hover":Ca,"--n-icon-color-pressed":Sa,"--n-icon-color-disabled":ba,"--n-suffix-text-color":ya}}),lt=n?Fe("input",F(()=>{const{value:v}=b;return v[0]}),an,e):void 0;return Object.assign(Object.assign({},Ki),{wrapperElRef:l,inputElRef:c,inputMirrorElRef:d,inputEl2Ref:f,textareaElRef:s,textareaMirrorElRef:a,textareaScrollbarInstRef:y,rtlEnabled:qi,uncontrolledValue:m,mergedValue:T,passwordVisible:q,mergedPlaceholder:M,showPlaceholder1:R,showPlaceholder2:x,mergedFocus:z,isComposing:$,activated:S,showClearButton:N,mergedSize:b,mergedDisabled:g,textDecorationStyle:J,mergedClsPrefix:t,mergedBordered:r,mergedShowPasswordOn:D,placeholderStyle:on,mergedStatus:O,textAreaScrollContainerWidth:ae,handleTextAreaScroll:Vi,handleCompositionStart:se,handleCompositionEnd:$e,handleInput:xe,handleInputBlur:Ne,handleInputFocus:$i,handleWrapperBlur:zi,handleWrapperFocus:Ti,handleMouseEnter:Mi,handleMouseLeave:Bi,handleMouseDown:Oi,handleChange:Ii,handleClick:Ri,handleClear:_i,handlePasswordToggleClick:Li,handlePasswordToggleMousedown:Ei,handleWrapperKeydown:Ai,handleTextAreaMirrorResize:Ui,getTextareaScrollContainer:()=>s.value,mergedTheme:i,cssVars:n?void 0:an,themeClass:lt==null?void 0:lt.themeClass,onRender:lt==null?void 0:
white-space: nowrap;
display: inline-block;
vertical-align: bottom;
max-width: 100%;
`),W("line-clamp",`
display: -webkit-inline-box;
-webkit-box-orient: vertical;
`),W("cursor-pointer",`
cursor: pointer;
`)]);function Vn(e){return`${e}-ellipsis--line-clamp`}function Kn(e,t){return`${e}-ellipsis--cursor-${t}`}const Ff=Object.assign(Object.assign({},re.props),{expandTrigger:String,lineClamp:[Number,String],tooltip:{type:[Boolean,Object],default:!0}}),li=K({name:"Ellipsis",inheritAttrs:!1,props:Ff,setup(e,{slots:t,attrs:r}){const{mergedClsPrefixRef:n}=Ie(e),o=re("Ellipsis","-ellipsis",Df,Of,e,n),i=L(null),l=L(null),s=L(null),a=L(!1),d=F(()=>{const{lineClamp:m}=e,{value:w}=a;return m!==void 0?{textOverflow:"","-webkit-line-clamp":w?"":m}:{textOverflow:w?"":"ellipsis","-webkit-line-clamp":""}});function c(){let m=!1;const{value:w}=a;if(w)return!0;const{value:T}=i;if(T){const{lineClamp:_}=e;if(p(T),_!==void 0)m=T.scrollHeight<=T.offsetHeight;else{const{value:b}=l;b&&(m=b.getBoundingClientRect().width<=T.getBoundingClientRect().width)}y(T,m)}return m}const f=F(()=>e.expandTrigger==="click"?()=>{var m;const{value:w}=a;w&&((m=s.value)===null||m===void 0||m.setShow(!1)),a.value=!w}:void 0);ll(()=>{var m;e.tooltip&&((m=s.value)===null||m===void 0||m.setShow(!1))});const h=()=>u("span",Object.assign({},_t(r,{class:[`${n.value}-ellipsis`,e.lineClamp!==void 0?Vn(n.value):void 0,e.expandTrigger==="click"?Kn(n.value,"pointer"):void 0],style:d.value}),{ref:"triggerRef",onClick:f.value,onMouseenter:e.expandTrigger==="click"?c:void 0}),e.lineClamp?t:u("span",{ref:"triggerInnerRef"},t));function p(m){if(!m)return;const w=d.value,T=Vn(n.value);e.lineClamp!==void 0?C(m,T,"add"):C(m,T,"remove");for(const _ in w)m.style[_]!==w[_]&&(m.style[_]=w[_])}function y(m,w){const T=Kn(n.value,"pointer");e.expandTrigger==="click"&&!w?C(m,T,"add"):C(m,T,"remove")}function C(m,w,T){T==="add"?m.classList.contains(w)||m.classList.add(w):m.classList.contains(w)&&m.classList.remove(w)}return{mergedTheme:o,triggerRef:i,triggerInnerRef:l,tooltipRef:s,handleClick:f,renderTrigger:h,getTooltipDisabled:c}},render(){var e;const{tooltip:t,renderTrigger:r,$slots:n}=this;if(t){const{mergedTheme:o}=this;return u(ai,Object.assign({ref:"tooltipRef",placement:"top"},t,{getDisabled:this.getTooltipDisabled,theme:o.peers.Tooltip,themeOverrides:o.peerOverrides.Tooltip}),{trigger:r,default:(e=n.tooltip)!==null&&e!==void 0?e:n.default})}else return r()}}),si=K({name:"DropdownDivider",props:{clsPrefix:{type:String,required:!0}},render(){return u("div",{class:`${this.clsPrefix}-dropdown-divider`})}}),Nf=e=>{const{textColorBase:t,opacity1:r,opacity2:n,opacity3:o,opacity4:i,opacity5:l}=e;return{color:t,opacity1Depth:r,opacity2Depth:n,opacity3Depth:o,opacity4Depth:i,opacity5Depth:l}},Hf={name:"Icon",common:Oe,self:Nf},jf=Hf,Wf=P("icon",`
height: 1em;
width: 1em;
line-height: 1em;
text-align: center;
display: inline-block;
position: relative;
fill: currentColor;
transform: translateZ(0);
`,[W("color-transition",{transition:"color .3s var(--n-bezier)"}),W("depth",{color:"var(--n-color)"},[H("svg",{opacity:"var(--n-opacity)",transition:"opacity .3s var(--n-bezier)"})]),H("svg",{height:"1em",width:"1em"})]),Uf=Object.assign(Object.assign({},re.props),{depth:[String,Number],size:[Number,String],color:String,component:Object}),Vf=K({_n_icon__:!0,name:"Icon",inheritAttrs:!1,props:Uf,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ie(e),n=re("Icon","-icon",Wf,jf,e,t),o=F(()=>{const{depth:l}=e,{common:{cubicBezierEaseInOut:s},self:a}=n.value;if(l!==void 0){const{color:d,[`opacity${l}Depth`]:c}=a;return{"--n-bezier":s,"--n-color":d,"--n-opacity":c}}return{"--n-bezier":s,"--n-color":"","--n-opacity":""}}),i=r?Fe("icon",F(()=>`${e.depth||"d"}`),o,e):void 0;return{mergedClsPrefix:t,mergedStyle:F(()=>{const{size:l,color:s}=e;return{fontSize:He(l),color:s}}),cssVars:r?void 0:o,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e;const{$parent:t,depth:r,mergedClsPrefix:n,component:o,onRender:i,themeClass:l}=this;return!((e=t==null?void 0:t.$options)===null||e===void 0)&&e._n_icon__&&Ur("icon","don't wrap `n-icon` inside `n-icon`"),i==null||i(),u("i",_t(this.$attrs,{role:"img",class:[`${n}-icon`,l,{[`${n}-icon--depth`]:r,[`${n}-icon--color-transition`]:r!==void 0}],style:[this.cssVars,this.mergedStyle]}),o?u(o):this.$slots)}}),Qr=Ve("n-dropdown-menu"),ir=Ve("n-dropdown"),qn=Ve("n-dropdown-option");function Or(e,t){return e.type==="submenu"||e.type===void 0&&e[t]!==void 0}function Kf(e){return e.type==="group"}function di(e){return e.type==="divider"}function qf(e){return e.type==="render"}const ui=K({name:"DropdownOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null},placement:{type:String,default:"right-start"},props:Object,scrollable:Boolean},setup(e){const t=ie(ir),{hoverKeyRef:r,keyboardKeyRef:n,lastToggledSubmenuKeyRef:o,pendingKeyPathRef:i,activeKeyPathRef:l,animatedRef:s,mergedShowRef:a,renderLabelRef:d,renderIconRef:c,labelFieldRef:f,childrenFieldRef:h,renderOptionRef:p,nodePropsRef:y,menuPropsRef:C}=t,m=ie(qn,null),w=ie(Qr),T=ie(Qt),_=F(()=>e.tmNode.rawNode),b=F(()=>{const{value:D}=h;return Or(e.tmNode.rawNode,D)}),g=F(()=>{const{disabled:D}=e.tmNode;return D}),O=F(()=>{if(!b.value)return!1;const{key:D,disabled:q}=e.tmNode;if(q)return!1;const{value:J}=r,{value:ae}=n,{value:ge}=o,{value:me}=i;return J!==null?me.includes(D):ae!==null?me.includes(D)&&me[me.length-1]!==D:ge!==null?me.includes(D):!1}),k=F(()=>n.value===null&&!s.value),E=zl(O,300,k),$=F(()=>!!(m!=null&&m.enteringSubmenuRef.value)),S=L(!1);Pe(qn,{enteringSubmenuRef:S});function A(){S.value=!0}function M(){S.value=!1}function R(){const{parentKey:D,tmNode:q}=e;q.disabled||a.value&&(o.value=D,n.value=null,r.value=q.key)}function x(){const{tmNode:D}=e;D.disabled||a.value&&r.value!==D.key&&R()}function z(D){if(e.tmNode.disabled||!a.value)return;const{relatedTarget:q}=D;q&&!xn({target:q},"dropdownOption")&&!xn({target:q},"scrollbarRail")&&(r.value=null)}function N(){const{value:D}=b,{tmNode:q}=e;a.value&&!D&&!q.disabled&&(t.doSelect(q.key,q.rawNode),t.doUpdateShow(!1))}return{labelField:f,renderLabel:d,renderIcon:c,siblingHasIcon:w.showIconRef,siblingHasSubmenu:w.hasSubmenuRef,menuProps:C,popoverBody:T,animated:s,mergedShowSubmenu:F(()=>E.value&&!$.value),rawNode:_,hasSubmenu:b,pending:Be(()=>{const{value:D}=i,{key:q}=e.tmNode;return D.includes(q)}),childActive:Be(()=>{const{value:D}=l,{key:q}=e.tmNode,J=D.findIndex(ae=>q===ae);return J===-1?!1:J<D.length-1}),active:Be(()=>{const{value:D}=l,{key:q}=e.tmNode,J=D.findIndex(ae=>q===ae);return J===-1?!1:J===D.length-1}),mergedDisabled:g,renderOption:p,nodeProps:y,handleClick:N,handleMouseMove:x,handleMouseEnter:R,handleMouseLeave:z,handleSubmenuBeforeEnter:A,handleSubmenuAfterEnter:M}},render(){var e,t;const{animated:r,rawNode:n,mergedShowSubmenu:o,clsPrefix:i,siblingHasIcon:l,siblingHasSubmenu:s,renderLabel:a,renderIcon:d,renderOption:c,nodeProps:f,props:h,scrollable:p}=this;let y=null;
transform-origin: var(--v-transform-origin);
background-color: var(--n-color);
border-radius: var(--n-border-radius);
box-shadow: var(--n-box-shadow);
position: relative;
transition:
background-color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier);
`,[mo(),P("dropdown-option",`
position: relative;
`,[H("a",`
text-decoration: none;
color: inherit;
outline: none;
`,[H("&::before",`
content: "";
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
`)]),P("dropdown-option-body",`
display: flex;
cursor: pointer;
position: relative;
height: var(--n-option-height);
line-height: var(--n-option-height);
font-size: var(--n-font-size);
color: var(--n-option-text-color);
transition: color .3s var(--n-bezier);
`,[H("&::before",`
content: "";
position: absolute;
top: 0;
bottom: 0;
left: 4px;
right: 4px;
transition: background-color .3s var(--n-bezier);
border-radius: var(--n-border-radius);
`),ze("disabled",[W("pending",`
color: var(--n-option-text-color-hover);
`,[B("prefix, suffix",`
color: var(--n-option-text-color-hover);
`),H("&::before","background-color: var(--n-option-color-hover);")]),W("active",`
color: var(--n-option-text-color-active);
`,[B("prefix, suffix",`
color: var(--n-option-text-color-active);
`),H("&::before","background-color: var(--n-option-color-active);")]),W("child-active",`
color: var(--n-option-text-color-child-active);
`,[B("prefix, suffix",`
color: var(--n-option-text-color-child-active);
`)])]),W("disabled",`
cursor: not-allowed;
opacity: var(--n-option-opacity-disabled);
`),W("group",`
font-size: calc(var(--n-font-size) - 1px);
color: var(--n-group-header-text-color);
`,[B("prefix",`
width: calc(var(--n-option-prefix-width) / 2);
`,[W("show-icon",`
width: calc(var(--n-option-icon-prefix-width) / 2);
`)])]),B("prefix",`
width: var(--n-option-prefix-width);
display: flex;
justify-content: center;
align-items: center;
color: var(--n-prefix-color);
transition: color .3s var(--n-bezier);
z-index: 1;
`,[W("show-icon",`
width: var(--n-option-icon-prefix-width);
`),P("icon",`
font-size: var(--n-option-icon-size);
`)]),B("label",`
white-space: nowrap;
flex: 1;
z-index: 1;
`),B("suffix",`
box-sizing: border-box;
flex-grow: 0;
flex-shrink: 0;
display: flex;
justify-content: flex-end;
align-items: center;
min-width: var(--n-option-suffix-width);
padding: 0 8px;
transition: color .3s var(--n-bezier);
color: var(--n-suffix-color);
z-index: 1;
`,[W("has-submenu",`
width: var(--n-option-icon-suffix-width);
`),P("icon",`
font-size: var(--n-option-icon-size);
`)]),P("dropdown-menu","pointer-events: all;")]),P("dropdown-offset-container",`
pointer-events: none;
position: absolute;
left: 0;
right: 0;
top: -4px;
bottom: -4px;
`)]),P("dropdown-divider",`
transition: background-color .3s var(--n-bezier);
background-color: var(--n-divider-color);
height: 1px;
margin: 4px 0;
`),P("dropdown-menu-wrapper",`
transform-origin: var(--v-transform-origin);
width: fit-content;
`),H(">",[P("scrollbar",`
height: inherit;
max-height: inherit;
`)]),ze("scrollable",`
padding: var(--n-padding);
`),W("scrollable",[B("content",`
padding: var(--n-padding);
`)])]),Jf={animated:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},size:{type:String,default:"medium"},inverted:Boolean,placement:{type:String,default:"bottom"},onSelect:[Function,Array],options:{type:Array,default:()=>[]},menuProps:Function,showArrow:Boolean,renderLabel:Function,renderIcon:Function,renderOption:Function,nodeProps:Function,labelField:{type:String,default:"label"},keyField:{type:String,default:"key"},childrenField:{type:String,default:"children"},value:[String,Number]},Qf=Object.keys(or),eh=Object.assign(Object.assign(Object.assign({},or),Jf),re.props),Gn=K({name:"Dropdown",inheritAttrs:!1,props:eh,setup(e){const t=L(!1),r=rr(Z(e,"show"),t),n=F(()=>{const{keyField:M,childrenField:R}=e;return Wc(e.options,{getKey(x){return x[M]},getDisabled(x){return x.disabled===!0},getIgnored(x){return x.type==="divider"||x.type==="render"},getChildren(x){return x[R]}})}),o=F(()=>n.value.treeNodes),i=L(null),l=L(null),s=L(null),a=F(()=>{var M,R,x;return(x=(R=(M=i.value)!==null&&M!==void 0?M:l.value)!==null&&R!==void 0?R:s.value)!==null&&x!==void 0?x:null}),d=F(()=>n.value.getPath(a.value).keyPath),c=F(()=>n.value.getPath(e.value).keyPath),f=Be(()=>e.keyboard&&r.value);_l({keydown:{ArrowUp:{prevent:!0,handler:g},ArrowRight:{prevent:!0,handler:b},ArrowDown:{prevent:!0,handler:O},ArrowLeft:{prevent:!0,handler:_},Enter:{prevent:!0,handler:k},Escape:T}},f);const{mergedClsPrefixRef:h,inlineThemeDisabled:p}=Ie(e),y=re("Dropdown","-dropdown",Zf,Ef,e,h);Pe(ir,{labelFieldRef:Z(e,"labelField"),childrenFieldRef:Z(e,"childrenField"),renderLabelRef:Z(e,"renderLabel"),renderIconRef:Z(e,"renderIcon"),hoverKeyRef:i,keyboardKeyRef:l,lastToggledSubmenuKeyRef:s,pendingKeyPathRef:d,activeKeyPathRef:c,animatedRef:Z(e,"animated"),mergedShowRef:r,nodePropsRef:Z(e,"nodeProps"),renderOptionRef:Z(e,"renderOption"),menuPropsRef:Z(e,"menuProps"),doSelect:C,doUpdateShow:m}),Ce(r,M=>{!e.animated&&!M&&w()});function C(M,R){const{onSelect:x}=e;x&&ce(x,M,R)}function m(M){const{"onUpdate:show":R,onUpdateShow:x}=e;R&&ce(R,M),x&&ce(x,M),t.value=M}function w(){i.value=null,l.value=null,s.value=null}function T(){m(!1)}function _(){$("left")}function b(){$("right")}function g(){$("up")}function O(){$("down")}function k(){const M=E();M!=null&&M.isLeaf&&r.value&&(C(M.key,M.rawNode),m(!1))}function E(){var M;const{value:R}=n,{value:x}=a;return!R||x===null?null:(M=R.getNode(x))!==null&&M!==void 0?M:null}function $(M){const{value:R}=a,{value:{getFirstAvailableNode:x}}=n;let z=null;if(R===null){const N=x();N!==null&&(z=N.key)}else{const N=E();if(N){let D;switch(M){case"down":D=N.getNext();break;case"up":D=N.getPrev();break;case"right":D=N.getChild();break;case"left":D=N.getParent();break}D&&(z=D.key)}}z!==null&&(i.value=null,l.value=z)}const S=F(()=>{const{size:M,inverted:R}=e,{common:{cubicBezierEaseInOut:x},self:z}=y.value,{padding:N,dividerColor:D,borderRadius:q,optionOpacityDisabled:J,[ne("optionIconSuffixWidth",M)]:ae,[ne("optionSuffixWidth",M)]:ge,[ne("optionIconPrefixWidth",M)]:me,[ne("optionPrefixWidth",M)]:Re,[ne("fontSize",M)]:oe,[ne("optionHeight",M)]:ke,[ne("optionIconSize",M)]:we}=z,ee={"--n-bezier":x,"--n-font-size":oe,"--n-padding":N,"--n-border-radius":q,"--n-option-height":ke,"--n-option-prefix-width":Re,"--n-option-icon-prefix-width":me,"--n-option-suffix-width":ge,"--n-option-icon-suffix-width":ae,"--n-option-icon-size":we,"--n-divider-color":D,"--n-option-opacity-disabled":J};return R?(ee["--n-color"]=z.colorInverted,ee["--n-option-color-hover"]=z.optionColorHoverInverted,ee["--n-option-color-active"]=z.optionColorActiveInverted,ee["--n-option-text-color"]=z.optionTextColorInverted,ee["--n-option-text-color-hover"]=z.optionTextColorHoverInverted,ee["--n-option-text-color-active"]=z.optionTextColorActiveInverted,ee["--n-option-text-color-child-active"]=z.optionTextColorChildActiveInverted,ee["--n-prefix-color"]=z.prefixColorInverted,ee["--n-suffix-color"]=z.suffixColorInverted,ee["--n-group-header-text-color"]=z.groupHeaderTextColorInverted):(ee["--n-color"]=z.color,ee["--n-option-color-hover"]=z.optionColorHover,ee["--n-option-col
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
`),P("image-preview-overlay",`
z-index: -1;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(0, 0, 0, .3);
`,[bn()]),P("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;
`,[P("base-icon",`
padding: 0 8px;
font-size: 28px;
cursor: pointer;
`),bn()]),P("image-preview-wrapper",`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
pointer-events: none;
`,[mo()]),P("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);
`),P("image",`
display: inline-flex;
max-height: 100%;
max-width: 100%;
`,[ze("preview-disabled",`
cursor: pointer;
`),H("img",`
border-radius: inherit;
`)])]),Wt=32,pi=K({name:"ImagePreview",props:Object.assign(Object.assign({},en),{onNext:Function,onPrev:Function,clsPrefix:{type:String,required:!0}}),setup(e){const t=re("Image","-image",Ph,dh,e,Z(e,"clsPrefix"));let r=null;const n=L(null),o=L(null),i=L(void 0),l=L(!1),s=L(!1),{localeRef:a}=Xr("Image");function d(){const{value:j}=o;if(!r||!j)return;const{style:X}=j,V=r.getBoundingClientRect(),le=V.left+V.width/2,se=V.top+V.height/2;X.transformOrigin=`${le}px ${se}px`}function c(j){var X,V;switch(j.key){case" ":j.preventDefault();break;case"ArrowLeft":(X=e.onPrev)===null||X===void 0||X.call(e);break;case"ArrowRight":(V=e.onNext)===null||V===void 0||V.call(e);break;case"Escape":ke();break}}Ce(l,j=>{j?Te("keydown",document,c):Se("keydown",document,c)}),Qe(()=>{Se("keydown",document,c)});let f=0,h=0,p=0,y=0,C=0,m=0,w=0,T=0,_=!1;function b(j){const{clientX:X,clientY:V}=j;p=X-f,y=V-h,$o(oe)}function g(j){const{mouseUpClientX:X,mouseUpClientY:V,mouseDownClientX:le,mouseDownClientY:se}=j,$e=le-X,xe=se-V,_e=`vertical${xe>0?"Top":"Bottom"}`,Ne=`horizontal${$e>0?"Left":"Right"}`;return{moveVerticalDirection:_e,moveHorizontalDirection:Ne,deltaHorizontal:$e,deltaVertical:xe}}function O(j){const{value:X}=n;if(!X)return{offsetX:0,offsetY:0};const V=X.getBoundingClientRect(),{moveVerticalDirection:le,moveHorizontalDirection:se,deltaHorizontal:$e,deltaVertical:xe}=j||{};let _e=0,Ne=0;return V.width<=window.innerWidth?_e=0:V.left>0?_e=(V.width-window.innerWidth)/2:V.right<window.innerWidth?_e=-(V.width-window.innerWidth)/2:se==="horizontalRight"?_e=Math.min((V.width-window.innerWidth)/2,C-($e??0)):_e=Math.max(-((V.width-window.innerWidth)/2),C-($e??0)),V.height<=window.innerHeight?Ne=0:V.top>0?Ne=(V.height-window.innerHeight)/2:V.bottom<window.innerHeight?Ne=-(V.height-window.innerHeight)/2:le==="verticalBottom"?Ne=Math.min((V.height-window.innerHeight)/2,m-(xe??0)):Ne=Math.max(-((V.height-window.innerHeight)/2),m-(xe??0)),{offsetX:_e,offsetY:Ne}}function k(j){Se("mousemove",document,b),Se("mouseup",document,k);const{clientX:X,clientY:V}=j;_=!1;const le=g({mouseUpClientX:X,mouseUpClientY:V,mouseDownClientX:w,mouseDownClientY:T}),se=O(le);p=se.offsetX,y=se.offsetY,oe()}const E=ie(fi,null);function $(j){var X,V;if((V=(X=E==null?void 0:E.previewedImgPropsRef.value)===null||X===void 0?void 0:X.onMousedown)===null||V===void 0||V.call(X,j),j.button!==0)return;const{clientX:le,clientY:se}=j;_=!0,f=le-p,h=se-y,C=p,m=y,w=le,T=se,oe(),Te("mousemove",document,b),Te("mouseup",document,k)}function S(j){var X,V;(V=(X=E==null?void 0:E.previewedImgPropsRef.value)===null||X===void 0?void 0:X.onDblclick)===null||V===void 0||V.call(X,j);const le=ge();R=R===le?1:le,oe()}const A=1.5;let M=0,R=1,x=0;function z(){R=1,M=0}function N(){var j;z(),x=0,(j=e.onPrev)===null||j===void 0||j.call(e)}function D(){var j;z(),x=0,(j=e.onNext)===null||j===void 0||j.call(e)}function q(){x-=90,oe()}function J(){x+=90,oe()}function ae(){const{value:j}=n;if(!j)return 1;const{innerWidth:X,innerHeight:V}=window,le=Math.max(1,j.naturalHeight/(V-Wt)),se=Math.max(1,j.naturalWidth/(X-Wt));return Math.max(3,le*2,se*2)}function ge(){const{value:j}=n;if(!j)return 1;const{innerWidth:X,innerHeight:V}=window,le=j.naturalHeight/(V-Wt),se=j.naturalWidth/(X-Wt);return le<1&&se<1?1:Math.max(le,se)}function me(){const j=ae();R<j&&(M+=1,R=Math.min(j,Math.pow(A,M)),oe())}function Re(){if(R>.5){const j=R;M-=1,R=Math.max(.5,Math.pow(A,M));const X=j-R;oe(!1);const V=O();R+=X,oe(!1),R-=X,p=V.offsetX,y=V.offsetY,oe()}}function oe(j=!0){var X;const{value:V}=n;if(!V)return;const{style:le}=V,se=cl((X=E==null?void 0:E.previewedImgPropsRef.value)===null||X===void 0?void 0:X.style);let $e="";if(typeof se=="string")$e=se+";";else for(const _e in se)$e+=`${pu(_e)}: ${se[_e]};`;const xe=`transform-origin: center; transform: translateX(${p}px) translateY(${y}px) rotate(${x}deg) scale(${R});`;_?le.cssText=$e+"cursor: grabbing; transition: none;"+xe:le.cssText=$e+"cursor: grab;"+xe+(j?"":"transition: none;"),j||V.offsetHeight}function ke(){l.value=!l.value,s.value=!0}function we(){R=ge(),M=Math.ceil(Math.log(R)/
--n-merged-border-color: var(--n-border-color);
--n-merged-color: var(--n-color);
--n-merged-color-hover: var(--n-color-hover);
margin: 0;
font-size: var(--n-font-size);
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
padding: 0;
list-style-type: none;
color: var(--n-text-color);
background-color: var(--n-merged-color);
`,[W("show-divider",[P("list-item",[H("&:not(:last-child)",[B("divider",`
background-color: var(--n-merged-border-color);
`)])])]),W("clickable",[P("list-item",`
cursor: pointer;
`)]),W("bordered",`
border: 1px solid var(--n-merged-border-color);
border-radius: var(--n-border-radius);
`),W("hoverable",[P("list-item",`
border-radius: var(--n-border-radius);
`,[H("&:hover",`
background-color: var(--n-merged-color-hover);
`,[B("divider",`
background-color: transparent;
`)])])]),W("bordered, hoverable",[P("list-item",`
padding: 12px 20px;
`),B("header, footer",`
padding: 12px 20px;
`)]),B("header, footer",`
padding: 12px 0;
box-sizing: border-box;
transition: border-color .3s var(--n-bezier);
`,[H("&:not(:last-child)",`
border-bottom: 1px solid var(--n-merged-border-color);
`)]),P("list-item",`
position: relative;
padding: 12px 0;
box-sizing: border-box;
display: flex;
flex-wrap: nowrap;
align-items: center;
transition:
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`,[B("prefix",`
margin-right: 20px;
flex: 0;
`),B("suffix",`
margin-left: 20px;
flex: 0;
`),B("main",`
flex: 1;
`),B("divider",`
height: 1px;
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: transparent;
transition: background-color .3s var(--n-bezier);
pointer-events: none;
`)])]),fl(P("list",`
--n-merged-color-hover: var(--n-color-hover-modal);
--n-merged-color: var(--n-color-modal);
--n-merged-border-color: var(--n-border-color-modal);
`)),hl(P("list",`
--n-merged-color-hover: var(--n-color-hover-popover);
--n-merged-color: var(--n-color-popover);
--n-merged-border-color: var(--n-border-color-popover);
`))]),Ih=Object.assign(Object.assign({},re.props),{size:{type:String,default:"medium"},bordered:Boolean,clickable:Boolean,hoverable:Boolean,showDivider:{type:Boolean,default:!0}}),gi=Ve("n-list"),Rh=K({name:"List",props:Ih,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:n}=Ie(e),o=Ot("List",n,t),i=re("List","-list",Th,fh,e,t);Pe(gi,{showDividerRef:Z(e,"showDivider"),mergedClsPrefixRef:t});const l=F(()=>{const{common:{cubicBezierEaseInOut:a},self:{fontSize:d,textColor:c,color:f,colorModal:h,colorPopover:p,borderColor:y,borderColorModal:C,borderColorPopover:m,borderRadius:w,colorHover:T,colorHoverModal:_,colorHoverPopover:b}}=i.value;return{"--n-font-size":d,"--n-bezier":a,"--n-text-color":c,"--n-color":f,"--n-border-radius":w,"--n-border-color":y,"--n-border-color-modal":C,"--n-border-color-popover":m,"--n-color-modal":h,"--n-color-popover":p,"--n-color-hover":T,"--n-color-hover-modal":_,"--n-color-hover-popover":b}}),s=r?Fe("list",void 0,l,e):void 0;return{mergedClsPrefix:t,rtlEnabled:o,cssVars:r?void 0:l,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender}},render(){var e;const{$slots:t,mergedClsPrefix:r,onRender:n}=this;return n==null||n(),u("ul",{class:[`${r}-list`,this.rtlEnabled&&`${r}-list--rtl`,this.bordered&&`${r}-list--bordered`,this.showDivider&&`${r}-list--show-divider`,this.hoverable&&`${r}-list--hoverable`,this.clickable&&`${r}-list--clickable`,this.themeClass],style:this.cssVars},t.header?u("div",{class:`${r}-list__header`},t.header()):null,(e=t.default)===null||e===void 0?void 0:e.call(t),t.footer?u("div",{class:`${r}-list__footer`},t.footer()):null)}}),_h=K({name:"ListItem",setup(){const e=ie(gi,null);return e||bt("list-item","`n-list-item` must be placed in `n-list`."),{showDivider:e.showDividerRef,mergedClsPrefix:e.mergedClsPrefixRef}},render(){const{$slots:e,mergedClsPrefix:t}=this;return u("li",{class:`${t}-list-item`},e.prefix?u("div",{class:`${t}-list-item__prefix`},e.prefix()):null,e.default?u("div",{class:`${t}-list-item__main`},e):null,e.suffix?u("div",{class:`${t}-list-item__suffix`},e.suffix()):null,this.showDivider&&u("div",{class:`${t}-list-item__divider`}))}});function tn(){const e=ie(pl,null);return e===null&&bt("use-message","No outer <n-message-provider /> founded. See prerequisite in https://www.naiveui.com/en-US/os-theme/components/message for more details. If you want to use `useMessage` outside setup, please check https://www.naiveui.com/zh-CN/os-theme/components/message#Q-&-A."),e}const Oh=H([P("progress",{display:"inline-block"},[P("progress-icon",`
color: var(--n-icon-color);
transition: color .3s var(--n-bezier);
`),W("line",`
width: 100%;
display: block;
`,[P("progress-content",`
display: flex;
align-items: center;
`,[P("progress-graph",{flex:1})]),P("progress-custom-content",{marginLeft:"14px"}),P("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);
`,[W("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);
`)])]),W("circle, dashboard",{width:"120px"},[P("progress-custom-content",`
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
`),P("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;
`),P("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);
`)]),W("multiple-circle",`
width: 200px;
color: inherit;
`,[P("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);
`)]),P("progress-content",{position:"relative"}),P("progress-graph",{position:"relative"},[P("progress-graph-circle",[H("svg",{verticalAlign:"bottom"}),P("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);
`,[W("empty",{opacity:0})]),P("progress-graph-circle-rail",`
transition: stroke .3s var(--n-bezier);
overflow: hidden;
stroke: var(--n-rail-color);
`)]),P("progress-graph-line",[W("indicator-inside",[P("progress-graph-line-rail",`
height: 16px;
line-height: 16px;
border-radius: 10px;
`,[P("progress-graph-line-fill",`
height: inherit;
border-radius: 10px;
`),P("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);
`)])]),W("indicator-inside-label",`
height: 16px;
display: flex;
align-items: center;
`,[P("progress-graph-line-rail",`
flex: 1;
transition: background-color .3s var(--n-bezier);
`),P("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);
`)]),P("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);
`,[P("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);
`,[W("processing",[H("&::after",`
content: "";
background-image: var(--n-line-bg-processing);
animation: progress-processing-animation 2s var(--n-bezier) infinite;
`)])])])])])]),H("@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;
}
`)]),Mh={success:u(bo,null),error:u(yo,null),warning:u(wo,null),info:u(xo,null)},Bh=K({name:"ProgressLine",props:{clsPrefix:{type:String,required:!0},percentage:{type:Number,default:0},railColor:String,railStyle:[String,Object],fillColor:String,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:t}){const r=F(()=>He(e.height)),n=F(()=>e.railBorderRadius!==void 0?He(e.railBorderRadius):e.height!==void 0?He(e.height,{c:.5}):""),o=F(()=>e.fillBorderRadius!==void 0?He(e.fillBorderRadius):e.railBorderRadius!==void 0?He(e.railBorderRadius):e.height!==void 0?He(e.height,{c:.5}):"");return()=>{const{indicatorPlacement:i,railColor:l,railStyle:s,percentage:a,unit:d,indicatorTextColor:c,status:f,showIndicator:h,fillColor:p,processing:y,clsPrefix:C}=e;return u("div",{class:`${C}-progress-content`,role:"none"},u("div",{class:`${C}-progress-graph`,"aria-hidden":!0},u("div",{class:[`${C}-progress-graph-line`,{[`${C}-progress-graph-line--indicator-${i}`]:!0}]},u("div",{class:`${C}-progress-graph-line-rail`,style:[{backgroundColor:l,height:r.value,borderRadius:n.value},s]},u("div",{class:[`${C}-progress-graph-line-fill`,y&&`${C}-progress-graph-line-fill--processing`],style:{maxWidth:`${e.percentage}%`,backgroundColor:p,height:r.value,lineHeight:r.value,borderRadius:o.value}},i==="inside"?u("div",{class:`${C}-progress-graph-line-indicator`,style:{color:c}},a,d):null)))),h&&i==="outside"?u("div",null,t.default?u("div",{class:`${C}-progress-custom-content`,style:{color:c},role:"none"},t.default()):f==="default"?u("div",{role:"none",class:`${C}-progress-icon ${C}-progress-icon--as-text`,style:{color:c}},a,d):u("div",{class:`${C}-progress-icon`,"aria-hidden":!0},u(fe,{clsPrefix:C},{default:()=>Mh[f]}))):null)}}}),Lh={success:u(bo,null),error:u(yo,null),warning:u(wo,null),info:u(xo,null)},Eh=K({name:"ProgressCircle",props:{clsPrefix:{type:String,required:!0},status:{type:String,required:!0},strokeWidth:{type:Number,required:!0},fillColor:String,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:t}){function r(n,o,i){const{gapDegree:l,viewBoxWidth:s,strokeWidth:a}=e,d=50,c=0,f=d,h=0,p=2*d,y=50+a/2,C=`M ${y},${y} m ${c},${f}
a ${d},${d} 0 1 1 ${h},${-p}
a ${d},${d} 0 1 1 ${-h},${p}`,m=Math.PI*2*d,w={stroke:i,strokeDasharray:`${n/100*(m-l)}px ${s*8}px`,strokeDashoffset:`-${l/2}px`,transformOrigin:o?"center":void 0,transform:o?`rotate(${o}deg)`:void 0};return{pathString:C,pathStyle:w}}return()=>{const{fillColor:n,railColor:o,strokeWidth:i,offsetDegree:l,status:s,percentage:a,showIndicator:d,indicatorTextColor:c,unit:f,gapOffsetDegree:h,clsPrefix:p}=e,{pathString:y,pathStyle:C}=r(100,0,o),{pathString:m,pathStyle:w}=r(a,l,n),T=100+i;return u("div",{class:`${p}-progress-content`,role:"none"},u("div",{class:`${p}-progress-graph`,"aria-hidden":!0},u("div",{class:`${p}-progress-graph-circle`,style:{transform:h?`rotate(${h}deg)`:void 0}},u("svg",{viewBox:`0 0 ${T} ${T}`},u("g",null,u("path",{class:`${p}-progress-graph-circle-rail`,d:y,"stroke-width":i,"stroke-linecap":"round",fill:"none",style:C})),u("g",null,u("path",{class:[`${p}-progress-graph-circle-fill`,a===0&&`${p}-progress-graph-circle-fill--empty`],d:m,"stroke-width":i,"stroke-linecap":"round",fill:"none",style:w}))))),d?u("div",null,t.default?u("div",{class:`${p}-progress-custom-content`,role:"none"},t.default()):s!=="default"?u("div",{class:`${p}-progress-icon`,"aria-hidden":!0},u(fe,{clsPrefix:p},{default:()=>Lh[s]})):u("div",{class:`${p}-progress-text`,style:{color:c},role:"none"},u("span",{class:`${p}-progress-text__percentage`},a),u("span",{class:`${p}-progress-text__unit`},f))):null)}}});function Xn(e,t,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 Ah=K({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:t}){const r=F(()=>e.percentage.map((o,i)=>`${Math.PI*o/100*(e.viewBoxWidth/2-e.strokeWidth/2*(1+2*i)-e.circleGap*i)*2}, ${e.viewBoxWidth*8}`));return()=>{const{viewBoxWidth:n,strokeWidth:o,circleGap:i,showIndicator:l,fillColor:s,railColor:a,railStyle:d,percentage:c,clsPrefix:f}=e;return u("div",{class:`${f}-progress-content`,role:"none"},u("div",{class:`${f}-progress-graph`,"aria-hidden":!0},u("div",{class:`${f}-progress-graph-circle`},u("svg",{viewBox:`0 0 ${n} ${n}`},c.map((h,p)=>u("g",{key:p},u("path",{class:`${f}-progress-graph-circle-rail`,d:Xn(n/2-o/2*(1+2*p)-i*p,o,n),"stroke-width":o,"stroke-linecap":"round",fill:"none",style:[{strokeDashoffset:0,stroke:a[p]},d[p]]}),u("path",{class:[`${f}-progress-graph-circle-fill`,h===0&&`${f}-progress-graph-circle-fill--empty`],d:Xn(n/2-o/2*(1+2*p)-i*p,o,n),"stroke-width":o,"stroke-linecap":"round",fill:"none",style:{strokeDasharray:r.value[p],strokeDashoffset:0,stroke:s[p]}})))))),l&&t.default?u("div",null,u("div",{class:`${f}-progress-text`},t.default())):null)}}}),Dh=Object.assign(Object.assign({},re.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],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}),Fh=K({name:"Progress",props:Dh,setup(e){const t=F(()=>e.indicatorPlacement||e.indicatorPosition),r=F(()=>{if(e.gapDegree||e.gapDegree===0)return e.gapDegree;if(e.type==="dashboard")return 75}),{mergedClsPrefixRef:n,inlineThemeDisabled:o}=Ie(e),i=re("Progress","-progress",Oh,hi,e,n),l=F(()=>{const{status:a}=e,{common:{cubicBezierEaseInOut:d},self:{fontSize:c,fontSizeCircle:f,railColor:h,railHeight:p,iconSizeCircle:y,iconSizeLine:C,textColorCircle:m,tex
display: flex;
transition: color .3s var(--n-bezier);
font-size: var(--n-font-size);
color: var(--n-text-color);
`,[P("thing-avatar",`
margin-right: 12px;
margin-top: 2px;
`),P("thing-avatar-header-wrapper",`
display: flex;
flex-wrap: nowrap;
`,[P("thing-header-wrapper",`
flex: 1;
`)]),P("thing-main",`
flex-grow: 1;
`,[P("thing-header",`
display: flex;
margin-bottom: 4px;
justify-content: space-between;
align-items: center;
`,[B("title",`
font-size: 16px;
font-weight: var(--n-title-font-weight);
transition: color .3s var(--n-bezier);
color: var(--n-title-text-color);
`)]),B("description",[H("&:not(:last-child)",`
margin-bottom: 4px;
`)]),B("content",[H("&:not(:first-child)",`
margin-top: 12px;
`)]),B("footer",[H("&:not(:first-child)",`
margin-top: 12px;
`)]),B("action",[H("&:not(:first-child)",`
margin-top: 12px;
`)])])]),Hh=Object.assign(Object.assign({},re.props),{title:String,titleExtra:String,description:String,descriptionStyle:[String,Object],content:String,contentStyle:[String,Object],contentIndented:Boolean}),mi=K({name:"Thing",props:Hh,setup(e,{slots:t}){const{mergedClsPrefixRef:r,inlineThemeDisabled:n,mergedRtlRef:o}=Ie(e),i=re("Thing","-thing",Nh,mh,e,r),l=Ot("Thing",o,r),s=F(()=>{const{self:{titleTextColor:d,textColor:c,titleFontWeight:f,fontSize:h},common:{cubicBezierEaseInOut:p}}=i.value;return{"--n-bezier":p,"--n-font-size":h,"--n-text-color":c,"--n-title-font-weight":f,"--n-title-text-color":d}}),a=n?Fe("thing",void 0,s,e):void 0;return()=>{var d;const{value:c}=r,f=l?l.value:!1;return(d=a==null?void 0:a.onRender)===null||d===void 0||d.call(a),u("div",{class:[`${c}-thing`,a==null?void 0:a.themeClass,f&&`${c}-thing--rtl`],style:n?void 0:s.value},t.avatar&&e.contentIndented?u("div",{class:`${c}-thing-avatar`},t.avatar()):null,u("div",{class:`${c}-thing-main`},!e.contentIndented&&(t.header||e.title||t["header-extra"]||e.titleExtra||t.avatar)?u("div",{class:`${c}-thing-avatar-header-wrapper`},t.avatar?u("div",{class:`${c}-thing-avatar`},t.avatar()):null,t.header||e.title||t["header-extra"]||e.titleExtra?u("div",{class:`${c}-thing-header-wrapper`},u("div",{class:`${c}-thing-header`},t.header||e.title?u("div",{class:`${c}-thing-header__title`},t.header?t.header():e.title):null,t["header-extra"]||e.titleExtra?u("div",{class:`${c}-thing-header__extra`},t["header-extra"]?t["header-extra"]():e.titleExtra):null),t.description||e.description?u("div",{class:`${c}-thing-main__description`,style:e.descriptionStyle},t.description?t.description():e.description):null):null):u(De,null,t.header||e.title||t["header-extra"]||e.titleExtra?u("div",{class:`${c}-thing-header`},t.header||e.title?u("div",{class:`${c}-thing-header__title`},t.header?t.header():e.title):null,t["header-extra"]||e.titleExtra?u("div",{class:`${c}-thing-header__extra`},t["header-extra"]?t["header-extra"]():e.titleExtra):null):null,t.description||e.description?u("div",{class:`${c}-thing-main__description`,style:e.descriptionStyle},t.description?t.description():e.description):null),t.default||e.content?u("div",{class:`${c}-thing-main__content`,style:e.contentStyle},t.default?t.default():e.content):null,t.footer?u("div",{class:`${c}-thing-main__footer`},t.footer()):null,t.action?u("div",{class:`${c}-thing-main__action`},t.action()):null))}}}),yt=Ve("n-upload"),bi="__UPLOAD_DRAGGER__",jh=K({name:"UploadDragger",[bi]:!0,setup(e,{slots:t}){const r=ie(yt,null);return r||bt("upload-dragger","`n-upload-dragger` must be placed inside `n-upload`."),()=>{const{mergedClsPrefixRef:{value:n},mergedDisabledRef:{value:o},maxReachedRef:{value:i}}=r;return u("div",{class:[`${n}-upload-dragger`,(o||i)&&`${n}-upload-dragger--disabled`]},t)}}});var yi=globalThis&&globalThis.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(l){l(i)})}return new(r||(r=Promise))(function(i,l){function s(c){try{d(n.next(c))}catch(f){l(f)}}function a(c){try{d(n.throw(c))}catch(f){l(f)}}function d(c){c.done?i(c.value):o(c.value).then(s,a)}d((n=n.apply(e,t||[])).next())})};const wi=e=>e.includes("image/"),Yn=(e="")=>{const t=e.split("/"),n=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[""])[0]},Zn=/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i,xi=e=>{if(e.type)return wi(e.type);const t=Yn(e.name||"");if(Zn.test(t))return!0;const r=e.thumbnailUrl||e.url||"",n=Yn(r);return!!(/^data:image\//.test(r)||Zn.test(n))};function Wh(e){return yi(this,void 0,void 0,function*(){return yield new Promise(t=>{if(!e.type||!wi(e.type)){t("");return}t(window.URL.createObjectURL(e))})})}const Uh=Wr&&window.FileReader&&window.File;function Vh(e){return e.isDirectory}function Kh(e){return e.isFile}function qh(e,t){return yi(this,void 0,void 0,function*(){const r=[];let n,o=0;function i(){o++}function l(){o--,o||n(r)}function s(a){a.forEach(d=>{if(d){if(i(),t&&Vh(d)){const c=d.createReader();i(),c.readEntries(f=>{s(f),l()},()=>{l()})}else Kh(d)&&(i(),d.file(c=>{r.push({file:c,entry:d,
display: block;
`)]),W("drag-over",[P("upload-dragger",`
border: var(--n-dragger-border-hover);
`)])]),P("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);
`,[H("&:hover",`
border: var(--n-dragger-border-hover);
`),W("disabled",`
cursor: not-allowed;
`)]),P("upload-trigger",`
display: inline-block;
box-sizing: border-box;
opacity: 1;
transition: opacity .3s var(--n-bezier);
`,[H("+",[P("upload-file-list","margin-top: 8px;")]),W("disabled",`
opacity: var(--n-item-disabled-opacity);
cursor: not-allowed;
`),W("image-card",`
width: 96px;
height: 96px;
`,[P("base-icon",`
font-size: 24px;
`),P("upload-dragger",`
padding: 0;
height: 100%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
`)])]),P("upload-file-list",`
line-height: var(--n-line-height);
opacity: 1;
transition: opacity .3s var(--n-bezier);
`,[H("a, img","outline: none;"),W("disabled",`
opacity: var(--n-item-disabled-opacity);
cursor: not-allowed;
`,[P("upload-file","cursor: not-allowed;")]),W("grid",`
display: grid;
grid-template-columns: repeat(auto-fill, 96px);
grid-gap: 8px;
margin-top: 0;
`),P("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);
`,[yn(),P("progress",[yn({foldPadding:!0})]),H("&:hover",`
background-color: var(--n-item-color-hover);
`,[P("upload-file-info",[B("action",`
opacity: 1;
`)])]),W("image-type",`
border-radius: var(--n-border-radius);
text-decoration: underline;
text-decoration-color: #0000;
`,[P("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;
`,[P("progress",`
padding: 2px 0;
margin-bottom: 0;
`),B("name",`
padding: 0 8px;
`),B("thumbnail",`
width: 32px;
height: 32px;
font-size: 28px;
display: flex;
justify-content: center;
align-items: center;
`,[H("img",`
width: 100%;
`)])])]),W("text-type",[P("progress",`
box-sizing: border-box;
padding-bottom: 6px;
margin-bottom: 6px;
`)]),W("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;
`,[P("progress",`
position: absolute;
left: 8px;
bottom: 8px;
right: 8px;
width: unset;
`),P("upload-file-info",`
padding: 0;
width: 100%;
height: 100%;
`,[B("thumbnail",`
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 36px;
`,[H("img",`
width: 100%;
`)])]),H("&::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: "";
`),H("&:hover",[H("&::before","opacity: 1;"),P("upload-file-info",[B("thumbnail","opacity: .12;")])])]),W("error-status",[H("&:hover",`
background-color: var(--n-item-color-hover-error);
`),P("upload-file-info",[B("name","color: var(--n-item-text-color-error);"),B("thumbnail","color: var(--n-item-text-color-error);")]),W("image-card-type",`
border: var(--n-item-border-image-card-error);
`)]),W("with-url",`
cursor: pointer;
`,[P("upload-file-info",[B("name",`
color: var(--n-item-text-color-success);
text-decoration-color: var(--n-item-text-color-success);
`,[H("a",`
text-decoration: underline;
`)])])]),P("upload-file-info",`
position: relative;
padding-top: 6px;
padding-bottom: 6px;
display: flex;
flex-wrap: nowrap;
`,[B("thumbnail",`
font-size: 18px;
opacity: 1;
transition: opacity .2s var(--n-bezier);
color: var(--n-item-icon-color);
`,[P("base-icon",`
margin-right: 2px;
vertical-align: middle;
transition: color .3s var(--n-bezier);
`)]),B("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;
`,[P("button",[H("&:not(:last-child)",{marginRight:"4px"}),P("base-icon",[H("svg",[ho()])])]),W("image-type",`
position: relative;
max-width: 80px;
width: auto;
`),W("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;
`)]),B("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);
`,[H("a",`
color: inherit;
text-decoration: underline;
`)])])])]),P("upload-file-input",`
display: block;
width: 0;
height: 0;
opacity: 0;
`)]);var Jn=globalThis&&globalThis.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(l){l(i)})}return new(r||(r=Promise))(function(i,l){function s(c){try{d(n.next(c))}catch(f){l(f)}}function a(c){try{d(n.throw(c))}catch(f){l(f)}}function d(c){c.done?i(c.value):o(c.value).then(s,a)}d((n=n.apply(e,t||[])).next())})};function np(e,t,r){const{doChange:n,xhrMap:o}=e;let i=0;function l(a){var d;let c=Object.assign({},t,{status:"error",percentage:i});o.delete(t.id),c=Rt(((d=e.onError)===null||d===void 0?void 0:d.call(e,{file:c,event:a}))||c),n(c,a)}function s(a){var d;if(e.isErrorState){if(e.isErrorState(r)){l(a);return}}else if(r.status<200||r.status>=300){l(a);return}let c=Object.assign({},t,{status:"finished",percentage:i});o.delete(t.id),c=Rt(((d=e.onFinish)===null||d===void 0?void 0:d.call(e,{file:c,event:a}))||c),n(c,a)}return{handleXHRLoad:s,handleXHRError:l,handleXHRAbort(a){const d=Object.assign({},t,{status:"removed",file:null,percentage:i});o.delete(t.id),n(d,a)},handleXHRProgress(a){const d=Object.assign({},t,{status:"uploading"});if(a.lengthComputable){const c=Math.ceil(a.loaded/a.total*100);d.percentage=c,i=c}n(d,a)}}}function op(e){const{inst:t,file:r,data:n,headers:o,withCredentials:i,action:l,customRequest:s}=e,{doChange:a}=e.inst;let d=0;s({file:r,data:n,headers:o,withCredentials:i,action:l,onProgress(c){const f=Object.assign({},r,{status:"uploading"}),h=c.percent;f.percentage=h,d=h,a(f)},onFinish(){var c;let f=Object.assign({},r,{status:"finished",percentage:d});f=Rt(((c=t.onFinish)===null||c===void 0?void 0:c.call(t,{file:f}))||f),a(f)},onError(){var c;let f=Object.assign({},r,{status:"error",percentage:d});f=Rt(((c=t.onError)===null||c===void 0?void 0:c.call(t,{file:f}))||f),a(f)}})}function ip(e,t,r){const n=np(e,t,r);r.onabort=n.handleXHRAbort,r.onerror=n.handleXHRError,r.onload=n.handleXHRLoad,r.upload&&(r.upload.onprogress=n.handleXHRProgress)}function Si(e,t){return typeof e=="function"?e({file:t}):e||{}}function ap(e,t,r){const n=Si(t,r);n&&Object.keys(n).forEach(o=>{e.setRequestHeader(o,n[o])})}function lp(e,t,r){const n=Si(t,r);n&&Object.keys(n).forEach(o=>{e.append(o,n[o])})}function sp(e,t,r,{method:n,action:o,withCredentials:i,responseType:l,headers:s,data:a}){const d=new XMLHttpRequest;d.responseType=l,e.xhrMap.set(r.id,d),d.withCredentials=i;const c=new FormData;if(lp(c,a,r),c.append(t,r.file),ip(e,r,d),o!==void 0){d.open(n.toUpperCase(),o),ap(d,s,r),d.send(c);const f=Object.assign({},r,{status:"uploading"});e.doChange(f)}}const dp=Object.assign(Object.assign({},re.props),{name:{type:String,default:"file"},accept:String,action:String,customRequest:Function,directory:Boolean,directoryDnd:{type:Boolean,default:void 0},method:{type:String,default:"POST"},multiple:Boolean,showFileList:{type:Boolean,default:!0},data:[Object,Function],headers:[Object,Function],withCredentials:Boolean,responseType:{type:String,default:""},disabled:{type:Boolean,default:void 0},onChange:Function,onRemove:Function,onFinish:Function,onError:Function,onBeforeUpload:Function,isErrorState:Function,onDownload:Function,defaultUpload:{type:Boolean,default:!0},fileList:Array,"onUpdate:fileList":[Function,Array],onUpdateFileList:[Function,Array],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=>Uh?xi(e):!1},createThumbnailUrl:Function,abstract:Boolean,max:Number,showTrigger:{type:Boolean,default:!0},imageGroupProps:Object,inputProps:Object,triggerStyle:[String,Object],renderIcon:Object}),up=K({name:"Upload",props:dp,setup(e){e.abstract&&e.listType==="image-card"&&bt("upload","when the list-type is image-card, abstract is not supported.");const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ie(e),n=re("Upload","-upload",rp,wh,e,t),o=go(e),i=F(()=>{const{max:$}=e;return $!==void
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var dt={FRONT:"FRONT",BEHIND:"BEHIND"},nt={INIT:"INIT",FIXED:"FIXED",DYNAMIC:"DYNAMIC"},ro=2,Rp=function(){function e(t,r){Cp(this,e),this.init(t,r)}return Sp(e,[{key:"init",value:function(r,n){this.param=r,this.callUpdate=n,this.sizes=new Map,this.firstRangeTotalSize=0,this.firstRangeAverageSize=0,this.lastCalcIndex=0,this.fixedSizeValue=0,this.calcType=nt.INIT,this.offset=0,this.direction="",this.range=Object.create(null),r&&this.checkRange(0,r.keeps-1)}},{key:"destroy",value:function(){this.init(null,null)}},{key:"getRange",value:function(){var r=Object.create(null);return r.start=this.range.start,r.end=this.range.end,r.padFront=this.range.padFront,r.padBehind=this.range.padBehind,r}},{key:"isBehind",value:function(){return this.direction===dt.BEHIND}},{key:"isFront",value:function(){return this.direction===dt.FRONT}},{key:"getOffset",value:function(r){return(r<1?0:this.getIndexOffset(r))+this.param.slotHeaderSize}},{key:"updateParam",value:function(r,n){var o=this;this.param&&r in this.param&&(r==="uniqueIds"&&this.sizes.forEach(function(i,l){n.includes(l)||o.sizes.delete(l)}),this.param[r]=n)}},{key:"saveSize",value:function(r,n){this.sizes.set(r,n),this.calcType===nt.INIT?(this.fixedSizeValue=n,this.calcType=nt.FIXED):this.calcType===nt.FIXED&&this.fixedSizeValue!==n&&(this.calcType=nt.DYNAMIC,delete this.fixedSizeValue),this.calcType!==nt.FIXED&&typeof this.firstRangeTotalSize<"u"&&(this.sizes.size<Math.min(this.param.keeps,this.param.uniqueIds.length)?(this.firstRangeTotalSize=kp(this.sizes.values()).reduce(function(o,i){return o+i},0),this.firstRangeAverageSize=Math.round(this.firstRangeTotalSize/this.sizes.size)):delete this.firstRangeTotalSize)}},{key:"handleDataSourcesChange",value:function(){var r=this.range.start;this.isFront()?r=r-ro:this.isBehind()&&(r=r+ro),r=Math.max(r,0),this.updateRange(this.range.start,this.getEndByStart(r))}},{key:"handleSlotSizeChange",value:function(){this.handleDataSourcesChange()}},{key:"handleScroll",value:function(r){this.direction=r<this.offset?dt.FRONT:dt.BEHIND,this.offset=r,this.param&&(this.direction===dt.FRONT?this.handleFront():this.direction===dt.BEHIND&&this.handleBehind())}},{key:"handleFront",value:function(){var r=this.getScrollOvers();if(!(r>this.range.start)){var n=Math.max(r-this.param.buffer,0);this.checkRange(n,this.getEndByStart(n))}}},{key:"handleBehind",value:function(){var r=this.getScrollOvers();r<this.range.start+this.param.buffer||this.checkRange(r,this.getEndByStart(r))}},{key:"getScrollOvers",value:function(){var r=this.offset-this.param.slotHeaderSize;if(r<=0)return 0;if(this.isFixedType())return Math.floor(r/this.fixedSizeValue);for(var n=0,o=0,i=0,l=this.param.uniqueIds.length;n<=l;){if(o=n+Math.floor((l-n)/2),i=this.getIndexOffset(o),i===r)return o;i<r?n=o+1:i>r&&(l=o-1)}return n>0?--n:0}},{key:"getIndexOffset",value:function(r){if(!r)return 0;for(var n=0,o=0,i=0;i<r;i++)o=this.sizes.get(this.param.uniqueIds[i]),n=n+(typeof o=="number"?o:this.getEstimateSize());return this.lastCalcIndex=Math.max(this.lastCalcIndex,r-1),this.lastCalcIndex=Math.min(this.lastCalcIndex,this.getLastIndex()),n}},{key:"isFixedType",value:function(){return this.calcType===nt.FIXED}},{key:"getLastIndex",value:function(){return this.param.uniqueIds.length-1}},{key:"checkRange",value:function(r,n){var o=this.param.keeps,i=this.param.uniqueIds.length;i<=o?(r=0,n=this.getLastIndex()):n-r<o-1&&(r=n-o+1),this.range.start!==r&&this.updateRange(r,n)}},{key:"updateRange",value:function(r,n){this.range.start=r,this.range.end=n,this.range.padFront=this.getPadFront(),this.range.padBehind=this.getPadBehind(),this.callUpdate(this.getRange())}},{key:"getEndByStart",value:function(r){var n=r+this.param.keeps-1,o=Math.min(n,this.getLastIndex());return o}},{key:"getPadFront",value:function(){return this.isFixedType()?this.fixedSizeValue*this.range.start:this.getIndexOffset(this.range.start)}},{key:"getPadBehind",value:function(){var r=this.range.end,n=this.getLastIndex();return this.isFixedType()?(n-r)*thi
`).filter(E=>E).map(E=>{var S;const $=E.split('","');return{act:$[0].slice(1),prompt:(S=$[1])==null?void 0:S.slice(1)}}),b.shift()}else return _.isDownloading=!1,t.error("暂不支持下载此后缀的提示词");_.isDownloading=!1;const g=r.addPrompt(b);g.result?(t.info(`下载文件含 ${b.length} 条数据`),t.success(`成功导入 ${(O=g.data)==null?void 0:O.successCount} 条有效数据`)):t.error(g.msg||"提示词格式有误")};return(_,b)=>(ve(),Ae(De,null,[Y(U(zt),{class:"w-11/12 xl:w-[900px]",show:U(o),"onUpdate:show":b[2]||(b[2]=g=>wn(o)?o.value=g:null),preset:"card",title:"提示词库"},{default:Q(()=>[Ue("div",Ap,[Y(U(kt),{class:"basis-full xl:basis-0 xl:min-w-[300px]",placeholder:"搜索提示词",value:U(l),"onUpdate:value":b[0]||(b[0]=g=>wn(l)?l.value=g:null),clearable:!0},null,8,["value"]),Y(U(ye),{secondary:"",type:"info",onClick:b[1]||(b[1]=g=>d.value=!0)},{default:Q(()=>[he("下载")]),_:1}),Y(U(ye),{secondary:"",type:"info",onClick:h},{default:Q(()=>[he("添加")]),_:1}),Y(U(up),{class:"w-auto",accept:".json","default-upload":!1,"show-file-list":!1,onChange:C},{default:Q(()=>[Y(U(ye),{secondary:"",type:"success",loading:c.value},{default:Q(()=>[he("导入")]),_:1},8,["loading"])]),_:1}),Y(U(ye),{secondary:"",type:"success",onClick:m,loading:f.value},{default:Q(()=>[he("导出")]),_:1},8,["loading"]),Y(U(ye),{secondary:"",type:"error",onClick:w},{default:Q(()=>[he("清空")]),_:1})]),U(s).length>0?(ve(),je(U(ki),{key:0,class:"h-[40vh] xl:h-[60vh] overflow-y-auto","data-key":"prompt","data-sources":U(s),"data-component":Ep,keeps:10},null,8,["data-sources"])):(ve(),je(U(ei),{key:1,class:"h-[60vh] flex justify-center items-center",description:"无数据"}))]),_:1},8,["show"]),Y(U(zt),{class:"w-11/12 xl:w-[600px]",show:U(a).isShow,"onUpdate:show":b[5]||(b[5]=g=>U(a).isShow=g),preset:"card",title:U(a).title},{default:Q(()=>[Y(U(lh),{vertical:""},{default:Q(()=>[he(" 标题 "),Y(U(kt),{placeholder:"请输入标题",value:U(a).newPrompt.act,"onUpdate:value":b[3]||(b[3]=g=>U(a).newPrompt.act=g)},null,8,["value"]),he(" 描述 "),Y(U(kt),{placeholder:"请输入描述",type:"textarea",value:U(a).newPrompt.prompt,"onUpdate:value":b[4]||(b[4]=g=>U(a).newPrompt.prompt=g)},null,8,["value"]),Y(U(ye),{block:"",secondary:"",type:"info",onClick:p},{default:Q(()=>[he("保存")]),_:1})]),_:1})]),_:1},8,["show","title"]),Y(U(zt),{class:"w-11/12 xl:w-[600px]",show:d.value,"onUpdate:show":b[6]||(b[6]=g=>d.value=g),preset:"card",title:"下载提示词"},{default:Q(()=>[Y(U(Rh),{class:"overflow-y-auto rounded-lg",hoverable:"",clickable:""},{default:Q(()=>[(ve(!0),Ae(De,null,yl(U(n),(g,O)=>(ve(),je(U(_h),{key:O},{suffix:Q(()=>[Ue("div",Fp,[g.type===1?(ve(),Ae("a",{key:0,class:"no-underline",href:g.refer,target:"_blank",rel:"noopener noreferrer"},[Y(U(ye),{secondary:""},{default:Q(()=>[he("来源")]),_:1})],8,Np)):Xt("",!0),Y(U(ye),{secondary:"",type:"info",onClick:k=>T(g),loading:g.isDownloading},{default:Q(()=>[he("下载")]),_:2},1032,["onClick","loading"])])]),default:Q(()=>[g.type===1?(ve(),Ae("a",{key:0,class:"no-underline text-blue-500",href:g.url,target:"_blank",rel:"noopener noreferrer"},at(g.name),9,Dp)):g.type===2?(ve(),je(U(kt),{key:1,placeholder:"请输入下载链接,支持 json 及 csv ",value:g.url,"onUpdate:value":k=>g.url=k},null,8,["value","onUpdate:value"])):Xt("",!0)]),_:2},1024))),128))]),_:1})]),_:1},8,["show"])],64))}}),jp=`/* 移除顶部背景遮挡 */\r
.scroller>.top {\r
display: none !important;\r
}\r
\r
/* 移除顶部边距 */\r
.scroller>.scroller-positioner>.content {\r
padding-top: 0 !important;\r
}\r
\r
/* 聊天记录 */\r
.scroller .side-panel {\r
position: fixed;\r
right: 10px;\r
}`,Wp=K({__name:"ChatPromptItem",props:{index:{},source:{}},setup(e){const t=Lt(),{selectedPromptIndex:r,isShowChatPrompt:n,keyword:o}=Bt(t),i=l=>{l&&(o.value="",CIB.vm.actionBar.inputText=l.prompt,CIB.vm.actionBar.input.focus(),n.value=!1)};return(l,s)=>(ve(),je(U(mi),{class:Po(["hover:bg-gray-100 cursor-pointer px-5 h-[130px] flex justify-start items-center",{"bg-gray-100":l.index===U(r)}]),onClick:s[0]||(s[0]=a=>i(l.source))},{description:Q(()=>[Y(U(oi),{type:"info"},{default:Q(()=>[he(at(l.source.act),1)]),_:1})]),default:Q(()=>[Y(U(li),{tooltip:!1,"line-clamp":2},{default:Q(()=>[he(at(l.source.prompt),1)]),_:1})]),_:1},8,["class"]))}}),rn=e=>(wl("data-v-aff729bc"),e=e(),xl(),e),Up=rn(()=>Ue("div",{class:"bounce1"},null,-1)),Vp=rn(()=>Ue("div",{class:"bounce2"},null,-1)),Kp=rn(()=>Ue("div",{class:"bounce3"},null,-1)),qp=[Up,Vp,Kp],Gp=K({__name:"LoadingSpinner",props:{isShow:{type:Boolean}},setup(e){const t=L(!1),r=L();return We(()=>{r.value&&r.value.addEventListener("transitionend",()=>{t.value=!0})}),(n,o)=>t.value?Xt("",!0):(ve(),Ae("div",{key:0,ref_key:"loadingRef",ref:r,class:Po(["loading-spinner",{hidden:!n.isShow}])},qp,2))}});const Xp=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},Yp=Xp(Gp,[["__scopeId","data-v-aff729bc"]]),Zp={key:0,class:"box-border fixed bottom-[110px] w-full flex justify-center px-[14px] md:px-[170px] xl:px-[220px] z-999"},Jp=Ue("div",{class:"w-0 md:w-[60px]"},null,-1),Qp=10,ev="_U",tv="BingAI_Rand_IP",rv=130,nv=K({__name:"ChatPrompt",setup(e){const t=L(!0),r=Lt(),{isShowPromptSotre:n,isShowChatPrompt:o,keyword:i,promptList:l,searchPromptList:s,selectedPromptIndex:a}=Bt(r),d=L(),c=L(!1),f=L(!1);We(async()=>{await h(),SydneyFullScreenConv.initWithWaitlistUpdate({cookLoc:{}},10),t.value=!1,p(),m(),w()});const h=async()=>new Promise((S,A)=>{sj_evt.bind("sydFSC.init",S,!0),sj_evt.fire("showSydFSC")}),p=()=>{ct.get(ev)||C()},y=()=>{const S=new Date;return S.setMinutes(S.getMinutes()+CIB.config.sydney.expiryInMinutes),S},C=async(S=0)=>{var M;if(S>=Qp){console.log(`已重试 ${S} 自动创建停止`);return}const A=await fetch("/turing/conversation/create",{credentials:"include"}).then(R=>R.json()).catch(R=>"error");((M=A==null?void 0:A.result)==null?void 0:M.value)==="Success"?(console.log("成功创建会话ID : ",A.conversationId),CIB.manager.conversation.updateId(A.conversationId,y(),A.clientId,A.conversationSignature)):(await mp(300),S+=1,console.log(`开始第 ${S} 次重试创建会话ID`),ct.set(tv,"",-1),C(S))},m=()=>{var R,x,z,N,D,q,J,ae;location.hostname==="localhost"&&(CIB.config.sydney.hostnamesToBypassSecureConnection=CIB.config.sydney.hostnamesToBypassSecureConnection.filter(ge=>ge!==location.hostname));const S=document.querySelector("cib-serp");S==null||S.setAttribute("alignment","center");const A=(R=S==null?void 0:S.shadowRoot)==null?void 0:R.querySelector("cib-conversation");(D=(N=(z=(x=A==null?void 0:A.shadowRoot)==null?void 0:x.querySelector("cib-welcome-container"))==null?void 0:z.shadowRoot)==null?void 0:N.querySelector(".learn-tog-item"))==null||D.remove(),(J=(q=S==null?void 0:S.shadowRoot)==null?void 0:q.querySelector("cib-serp-feedback"))==null||J.remove();const M=document.createElement("style");M.innerText=jp,(ae=A.shadowRoot)==null||ae.append(M)},w=()=>{var M,R;const S=(R=(M=document.querySelector("#b_sydConvCont > cib-serp"))==null?void 0:M.shadowRoot)==null?void 0:R.querySelector("#cib-action-bar-main"),A=S.handleInputTextKey;S.handleInputTextKey=function(x){if(!(x.key==="Enter"&&o.value))return A.apply(this,[x])},CIB.vm.actionBar.input.addEventListener("compositionstart",T),CIB.vm.actionBar.input.addEventListener("compositionend",_),CIB.vm.actionBar.input.addEventListener("change",b),CIB.vm.actionBar.input.addEventListener("input",b),CIB.vm.actionBar.input.addEventListener("keydown",k),CIB.vm.actionBar.input.addEventListener("focus",g),CIB.vm.actionBar.input.addEventListener("blur",O)},T=S=>{c.value=!0},_=S=>{c.value=!1,b(S)},b=S=>{var A;c.value||(S instanceof InputEvent||S instanceof CompositionEvent)&&S.target instanceof HTMLTextAreaEleme