@yoyaflow/yoya-ui 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +407 -124
- package/README.zh-CN.md +375 -131
- package/dist/yoya.core.chunk.js +4275 -0
- package/dist/yoya.core.chunk.min.js +9 -0
- package/dist/yoya.core.js +3 -1779
- package/dist/yoya.core.min.js +1 -0
- package/dist/yoya.devtools.js +3 -0
- package/dist/yoya.devtools.min.js +1 -0
- package/dist/yoya.echart.js +182 -592
- package/dist/yoya.echart.min.js +1 -0
- package/dist/yoya.router.full.js +5271 -0
- package/dist/yoya.router.full.min.js +43 -0
- package/dist/yoya.router.js +1330 -0
- package/dist/yoya.router.min.js +35 -0
- package/dist/yoya.three.js +360 -0
- package/dist/yoya.three.min.js +1 -0
- package/dist/yoya.ui-router.full.js +21843 -0
- package/dist/yoya.ui-router.full.min.js +43 -0
- package/dist/yoya.ui-router.umd.js +43 -0
- package/dist/yoya.ui-router.umd.min.js +43 -0
- package/dist/yoya.ui.css +80 -0
- package/dist/yoya.ui.full.js +20169 -0
- package/dist/yoya.ui.full.min.js +1 -0
- package/dist/yoya.ui.js +12227 -9083
- package/dist/yoya.ui.min.js +1 -0
- package/package.json +27 -11
- package/types/core.d.ts +122 -1
- package/types/data-display.d.ts +44 -2
- package/types/devtools.d.ts +156 -0
- package/types/feedback.d.ts +13 -0
- package/types/form.d.ts +1 -1
- package/types/index.d.ts +1 -1
- package/types/ssr.d.ts +27 -7
- package/types/three.d.ts +77 -0
- package/types/yoya.devtools.d.ts +5 -0
- package/types/yoya.router.d.ts +7 -0
- package/types/yoya.three.d.ts +4 -0
- package/types/yoya.ui-router.d.ts +19 -0
- package/types/yoya.ui.d.ts +2 -7
- package/dist/yoya-ui.umd.js +0 -35
- package/dist/yoya.ssr.js +0 -2856
- package/types/yoya.ssr.d.ts +0 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,Ai as t,Br as n,C as r,D as i,E as a,Ei as o,I as s,Ir as c,K as l,L as u,Mi as d,N as f,O as p,Pi as m,S as h,St as g,T as _,Ti as v,Tt as y,Ur as ee,_ as b,_i as x,b as S,d as te,dt as C,f as w,ft as ne,g as T,h as E,j as D,k as O,lt as k,m as A,p as j,u as M,ui as re,v as N,vi as P,w as F,wi as I,wt as L,x as R,xt as z,y as ie,yt as B}from"./yoya.core.chunk.min.js";var V=class extends y{constructor(e=null,t=null,n=null){super(`div`,null),this.className(E,`yoya-vsplit-panel`),this.styles({boxSizing:`border-box`,display:`flex`,minHeight:`0`,minWidth:`0`,overflow:`hidden`,width:`100%`}),this._direction=`horizontal`,this._firstSize=`50%`,this._minSize=40,this._drag=null,this._dragMove=null,this._dragUp=null,this._first=new y(`div`).className(`yoya-vsplit-panel-first`).attr(`data-vsplit-first`,`true`).styles({boxSizing:`border-box`,minHeight:`0`,minWidth:`0`,overflow:`auto`}),this._second=new y(`div`).className(`yoya-vsplit-panel-second`).attr(`data-vsplit-second`,`true`).styles({boxSizing:`border-box`,flex:`1 1 auto`,minHeight:`0`,minWidth:`0`,overflow:`auto`}),this._divider=new y(`div`).className(`yoya-vsplit-panel-divider`).attr({"aria-orientation":`horizontal`,"data-vsplit-divider":`true`,role:`separator`,tabindex:`0`,title:`拖拽调整面板大小,双击恢复 50%`}).styles({background:`transparent`,boxSizing:`border-box`,flex:`0 0 auto`}).on(`mousedown`,e=>this._startDrag(e)).on(`dblclick`,()=>this.reset()).on(`keydown`,e=>this._handleKeydown(e)).on(`mouseenter`,()=>this._hoverDivider(!0)).on(`mouseleave`,()=>this._hoverDivider(!1)),this.child(this._first,this._divider,this._second),this._sync(),this._setupSplitPanel(e),w(this,t,n)}direction(e){return e===void 0?this._direction:(this._direction=e===`vertical`?`vertical`:`horizontal`,this._sync(),this)}size(e){return e===void 0?this._firstSize:(this._firstSize=ae(e),this._sync(),this)}minSize(e){if(e===void 0)return this._minSize;let t=Number(e);return this._minSize=Number.isFinite(t)?Math.max(0,t):this._minSize,this}reset(){return this.size(`50%`)}first(e){return a(this._first,[]),typeof e==`function`?e(this._first):a(this._first,S(e)),this}second(e){return a(this._second,[]),typeof e==`function`?e(this._second):a(this._second,S(e)),this}destroy(){return this._endDrag(),super.destroy()}_sync(){let e=this._direction===`horizontal`;return this.style(`flexDirection`,e?`row`:`column`),this._first.styles({flex:`0 0 auto`,height:e?`100%`:this._firstSize,width:e?this._firstSize:`100%`}),this._divider.styles(e?{cursor:`col-resize`,height:`100%`,width:`6px`}:{cursor:`row-resize`,height:`6px`,width:`100%`}),this._divider.attr(`aria-orientation`,e?`horizontal`:`vertical`),this}_hoverDivider(e){this._divider.style(`background`,e?D(`color-primary-subtle`,`#eff6ff`):`transparent`)}_startDrag(e){if(e.button!==0||!this._el)return;e.preventDefault();let t=this._direction===`horizontal`,n=this._first._el.getBoundingClientRect(),r=t?e.clientX:e.clientY,i=t?n.width:n.height,a=t?this._el.offsetWidth:this._el.offsetHeight;this._drag={containerSize:a,start:r,startSize:i},this._dragMove=e=>this._onDrag(e),this._dragUp=()=>this._endDrag(),this._dragUnbindMove=x(`mousemove`,this._dragMove),this._dragUnbindUp=x(`mouseup`,this._dragUp)}_onDrag(e){if(!this._drag)return;let t=(this._direction===`horizontal`?e.clientX:e.clientY)-this._drag.start,n=oe(this._drag.startSize+t,this._minSize,this._drag.containerSize-this._minSize);this._firstSize=`${Math.round(n)}px`,this._sync()}_handleKeydown(e){let t=e.key===`ArrowLeft`||e.key===`ArrowUp`?-16:e.key===`ArrowRight`||e.key===`ArrowDown`?16:0;if(!t||!this._el)return;e.preventDefault();let n=this._direction===`horizontal`?this._el.offsetWidth:this._el.offsetHeight,r=oe((Number.parseFloat(this._firstSize)||0)+t,this._minSize,n-this._minSize);this._firstSize=`${Math.round(r)}px`,this._sync()}_endDrag(){this._dragMove&&(this._dragUnbindMove?.(),this._dragMove=null,this._dragUnbindMove=null),this._dragUp&&(this._dragUnbindUp?.(),this._dragUp=null,this._dragUnbindUp=null),this._drag=null}_setupSplitPanel(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{direction:t,first:n,minSize:r,second:i,size:a,...o}=e;Object.keys(o).length>0&&this.setup(o),t!==void 0&&this.direction(t),a!==void 0&&this.size(a),r!==void 0&&this.minSize(r),n!==void 0&&this.first(n),i!==void 0&&this.second(i);return}this.first(e)}}};function H(e=null,t=null,n=null){return T(V,e,t,n)}d(y,{vSplitPanel:H});function ae(e){return typeof e==`number`?`${e}px`:e}function oe(e,t,n){return Number.isNaN(e)?t:Math.min(Math.max(e,t),Math.max(n,t))}var se=class extends y{constructor(e=null){super(`div`,null),this._columns=3,this._gap=16,this._minColumnWidth=null,this.className(E,`yoya-vmasonry`),this.attr({"data-columns":`3`}),this.styles({boxSizing:`border-box`,columnCount:`3`,columnGap:`16px`,width:`100%`}),this._setupMasonry(e),this._syncLayout()}columns(e){if(e===void 0)return this._columns;let t=Math.floor(Number(e));return this._columns=Number.isFinite(t)&&t>=1?t:3,this.attr(`data-columns`,String(this._columns)),this._syncLayout(),this}gap(e){if(e===void 0)return this._gap;let t=Number(e);return this._gap=Number.isFinite(t)&&t>=0?t:16,this._syncLayout(),this}minColumnWidth(e){if(e===void 0)return this._minColumnWidth;let t=Number(e);return this._minColumnWidth=Number.isFinite(t)&&t>0?t:null,this._syncLayout(),this}_syncLayout(){this._minColumnWidth?(this.style(`columnCount`,`auto`),this.style(`columnWidth`,`${this._minColumnWidth}px`),this.attr(`data-column-mode`,`responsive`)):(this.style(`columnCount`,String(this._columns)),this.style(`columnWidth`,`auto`),this.attr(`data-column-mode`,null)),this.style(`columnGap`,`${this._gap}px`),this.style(`--yoya-masonry-gap`,`${this._gap}px`)}_setupMasonry(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{columns:t,gap:n,minColumnWidth:r,...i}=e;Object.keys(i).length>0&&this.setup(i),t!==void 0&&this.columns(t),n!==void 0&&this.gap(n),r!==void 0&&this.minColumnWidth(r)}}}};function U(e=null,t=null,n=null){return T(se,e,t,n)}var ce=class extends y{constructor(e=null){super(`div`,null),this.className(`yoya-component`,`yoya-vtheme-shell`),this.styles({background:D(`color-surface`,`#ffffff`),border:`1px solid ${D(`color-border`,`#d8dee8`)}`,borderRadius:D(`radius-md`,`6px`),boxSizing:`border-box`,color:D(`color-text`,`#172033`),minWidth:`0`}),j(this,e)}_requireSingleShellChild(){let e=this.children();if(e.length!==1)throw TypeError(`vThemeShell virtual mode requires exactly one child`);return e[0]}_virtualTarget(){let e=this._requireSingleShellChild();return typeof e._resolve==`function`?e._resolve():e}_syncShellStyles(e){!e||typeof e.styles!=`function`||e.styles({background:this._styles.background,border:this._styles.border,borderColor:this._styles.borderColor,borderRadius:this._styles.borderRadius,boxSizing:this._styles.boxSizing,color:this._styles.color,minWidth:this._styles.minWidth,overflow:this._styles.overflow})}virtual(e=!0){return this._virtualMode=!!e,this}renderDom(){if(this._deleted)return null;if(this._virtualMode){let e=this._requireSingleShellChild(),t=this._virtualTarget();return this._syncShellStyles(t),e.renderDom()}return super.renderDom()}toHTML(){return this._deleted?``:this._virtualMode?this._requireSingleShellChild().toHTML():super.toHTML()}background(e){return e===void 0?this._styles.background:e===null?this:(this._styles.background=String(e),this._el&&(this._el.style.background=String(e)),this)}backgroundOpacity(e){let t=this.background()||D(`color-surface`,`#ffffff`),n=Math.max(0,Math.min(1,Number(e)||0));return this.background(`color-mix(in srgb, ${t} ${Math.round(n*100)}%, transparent)`)}radius(e){return e===void 0?this._styles.borderRadius:this.styles({borderRadius:e===null?void 0:String(e)})}border(e){return e===void 0?this._styles.border:this.styles({border:e===null?void 0:String(e)})}borderColor(e){return e===void 0?this._styles.borderColor:this.styles({borderColor:e===null?void 0:String(e)})}scrollable(e=!0){return this.styles({overflow:e?`auto`:`visible`})}};function W(e=null,t=null,n=null){return T(ce,e,t,n)}d(I,{vThemeShell:W});const le=new Set(`align.areas.asideWidth.autoFlow.breakpoint.columns.direction.drawer.gutter.offset.pull.push.span.xs.sm.md.lg.xl.gap.justify.maxWidth.minColumnWidth.mobileDirection.mobileGap.orientation.padding.paddingInline.rows.safeArea.size.breakpoints.viewport.wrap`.split(`.`)),ue=new Set([`height`,`width`]);function de(e=null,t=null,n=null){return G(`flex`,{display:`flex`},e,Ie,t,n)}function fe(e=null,t=null,n=null){return G(`stack`,{display:`flex`,flexDirection:`column`},e,Ie,t,n)}function pe(e=null,t=null,n=null){return G(`vstack`,{display:`flex`,flexDirection:`column`},e,Ie,t,n)}function me(e=null,t=null,n=null){return G(`hstack`,{display:`flex`,flexDirection:`row`},e,Ie,t,n)}function he(e=null,t=null,n=null){return G(`center`,{display:`flex`,alignItems:`center`,justifyContent:`center`},e,Ie,t,n)}function ge(e=null,t=null,n=null){let r=R(e,t,n),i=new y(`div`);i.className(`yoya-layout`,`yoya-vrow`),i.styles({boxSizing:`border-box`,display:`flex`,flexWrap:`wrap`,width:`100%`}),i._gutter=null,i.gutter=e=>e===void 0?i._gutter:(i._gutter=q(e),Ue(i),i),i.justify=e=>e===void 0?i.style(`justifyContent`):(i.style(`justifyContent`,e),i),i.align=e=>e===void 0?i.style(`alignItems`):(i.style(`alignItems`,e),i),i.wrap=e=>e===void 0?i.style(`flexWrap`):(i.style(`flexWrap`,e===!1?`nowrap`:ft(e??!0)),i);let a=i.child.bind(i);return i.child=(...e)=>(a(...e),Ue(i),i),Fe(i,r.first,We),Ue(i),w(i,r.options,r.callback)}function _e(e=null,t=null,n=null){let r=R(e,t,n),i=new y(`div`);return i.className(`yoya-layout`,`yoya-vcol`),i.styles({boxSizing:`border-box`,minWidth:`0`}),i._baseCol=qe({}),i._responsiveCols=[],i._gutter=null,i.refresh=i._refreshCol=()=>{let e=typeof window>`u`?null:window.innerWidth,t=(e===null?null:i._responsiveCols.filter(t=>e>=t.minWidth).at(-1))?.props??i._baseCol;return i.style(`boxSizing`,`border-box`),i.style(`flex`,`0 0 auto`),i.style(`left`,t.push?`${Xe(t.push)}%`:null),i.style(`marginLeft`,t.offset?`${Xe(t.offset)}%`:null),i.style(`paddingLeft`,i._gutter?Ze(i._gutter):null),i.style(`paddingRight`,i._gutter?Ze(i._gutter):null),i.style(`position`,t.push||t.pull?`relative`:null),i.style(`right`,t.pull?`${Xe(t.pull)}%`:null),i.style(`width`,`${Xe(t.span)}%`),i},i.span=e=>e===void 0?i._baseCol.span:(i._baseCol.span=K(e),i._refreshCol(),i),i.offset=e=>e===void 0?i._baseCol.offset:(i._baseCol.offset=K(e),i._refreshCol(),i),i.push=e=>e===void 0?i._baseCol.push:(i._baseCol.push=K(e),i._refreshCol(),i),i.pull=e=>e===void 0?i._baseCol.pull:(i._baseCol.pull=K(e),i._refreshCol(),i),i.gutter=e=>e===void 0?i._gutter:(i._gutter=q(e),i._refreshCol(),i),Fe(i,r.first,Ge),i._refreshCol(),i._responsiveCols.length&&(i._colResize=()=>i._refreshCol(),i._colResizeUnbind=P(`resize`,i._colResize),Qe(i)),w(i,r.options,r.callback)}function ve(e=null,t=null,n=null){return G(`grid`,{display:`grid`},e,Le,t,n)}function ye(e=null,t=null,n=null){let r=R(e,t,n),i=G(`responsive-grid`,{display:`grid`},r.first,Re,r.options,r.callback),a=ht(r.first)?r.first:{};return i._responsiveGridBreakpoints=dt(a.breakpoints),i._responsiveGridMinColumnWidth=ut(a.minColumnWidth),i._responsiveGridRefresh=()=>{let e=typeof window>`u`?null:window.innerWidth,t=e===null?null:i._responsiveGridBreakpoints.filter(t=>e>=t.minWidth).at(-1);return i.style(`gridTemplateColumns`,t?`repeat(${t.columns}, minmax(0, 1fr))`:`repeat(auto-fit, minmax(${i._responsiveGridMinColumnWidth}, 1fr))`),i},i.refresh=i._responsiveGridRefresh,i.minColumnWidth=e=>e===void 0?i._responsiveGridMinColumnWidth:(i._responsiveGridMinColumnWidth=ut(e),i._responsiveGridRefresh(),i),i.breakpoints=e=>e===void 0?i._responsiveGridBreakpoints:(i._responsiveGridBreakpoints=dt(e),i._responsiveGridBreakpoints.length&&!i._responsiveGridResize&&!i._responsiveGridResizeUnbind&&(i._responsiveGridResize=()=>i._responsiveGridRefresh(),i._responsiveGridResizeUnbind=P(`resize`,i._responsiveGridResize),Se(i)),i._responsiveGridRefresh(),i),i._responsiveGridRefresh(),i._responsiveGridBreakpoints.length&&(i._responsiveGridResize=()=>i._responsiveGridRefresh(),i._responsiveGridResizeUnbind=P(`resize`,i._responsiveGridResize),Se(i)),i}function be(e=null,t=null,n=null){let r=R(e,t,n),i=new y(`div`),a=new y(`div`).className(`yoya-vbody-content`),o=i.child.bind(i);return i.className(`yoya-layout`,`yoya-vbody`),i.attr(`data-page-body`,`true`),i.styles({background:D(`color-bg`,`#f9f9f9`),boxSizing:`border-box`,color:D(`color-text`,`#0d0d0d`),fontFamily:D(`font-family`,`ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif`),fontSize:D(`font-size`,`14px`),lineHeight:D(`line-height`,`1.5`),minHeight:`100%`,padding:`clamp(16px, 3vw, 32px)`,width:`100%`}),a.styles({display:`grid`,gap:`24px`,marginLeft:`auto`,marginRight:`auto`,maxWidth:`1120px`,width:`100%`}),o(a),i.background=e=>e===void 0?i.style(`background`):(i.style(`background`,e),i),i.maxWidth=e=>e===void 0?a.style(`maxWidth`):(a.style(`maxWidth`,q(e)),i),i.padding=e=>e===void 0?i.style(`padding`):(i.style(`padding`,q(e)),i),i.gap=e=>e===void 0?a.style(`gap`):(a.style(`gap`,q(e)),i),i.minHeight=e=>e===void 0?i.style(`minHeight`):(i.style(`minHeight`,q(e)),i),i.content=e=>e===void 0?a:(typeof e==`function`?e(a):a.child(e),i),i.child=(...e)=>(a.child(...e),i),ze(i,r.first),w(i,r.options,r.callback)}function xe(e=null,t=null){let n=be(e);return typeof document<`u`&&n.bindTo(t||document.body),n}function Se(e){if(e._responsiveGridDestroyWrapped)return;e._responsiveGridDestroyWrapped=!0;let t=e.destroy.bind(e);e.destroy=()=>(e._responsiveGridResizeUnbind?.(),t())}function Ce(e=null,t=null,n=null){return G(`container`,{width:`100%`,maxWidth:`1120px`,marginLeft:`auto`,marginRight:`auto`,paddingLeft:`16px`,paddingRight:`16px`},e,Be,t,n)}function we(e=null,t=null,n=null){let r=R(e,t,n),i=new y(`div`);i.className(`yoya-layout`,`yoya-vcontainer`),i.styles({boxSizing:`border-box`,display:`flex`,minWidth:`0`,width:`100%`}),i._direction=null,i._viewport=!1,i._fill=!1,i._scrollable=!1,i.viewport=(e=!0)=>e===void 0?i._viewport:(i._viewport=!!e,i.styles({height:i._viewport?`100dvh`:null,minHeight:i._viewport?`100vh`:null,overflow:i._viewport?`hidden`:null}),i),i.fill=(e=!0)=>e===void 0?i._fill:(i._fill=!!e,i.styles({flex:i._fill?`1 1 auto`:null,height:i._fill?`auto`:null,minHeight:i._fill?`0`:null,minWidth:i._fill?`0`:null,overflow:i._fill?`hidden`:null}),i),i.scrollable=(e=!0)=>e===void 0?i._scrollable:(i._scrollable=!!e,i.styles({height:i._scrollable?`100%`:null,minHeight:i._scrollable?`0`:null,overflow:i._scrollable?`auto`:null,overscrollBehavior:i._scrollable?`contain`:null}),i),i._autoDirection=()=>i.children().some(e=>rt(e))?`column`:`row`,i._syncContainerDirection=()=>(i.style(`flexDirection`,i._direction||i._autoDirection()),i),i.direction=e=>e===void 0?i._direction||i._autoDirection():(i._direction=e,i._syncContainerDirection(),i);let a=i.child.bind(i);return i.child=(...e)=>(a(...e),i._syncContainerDirection(),i),Fe(i,r.first,it),i._syncContainerDirection(),w(i,r.options,r.callback)}function Te(e=null,t=null,n=null){let r=R(e,t,n),i=new y(`div`);i.className(`yoya-layout`,`yoya-mobile-layout`,`yoya-vmobile-layout`),i.attr(`data-mobile-layout`,`false`),i.styles({boxSizing:`border-box`,display:`flex`,minWidth:`0`,width:`100%`}),i._breakpoint=768,i._desktopDirection=`row`,i._mobileDirection=`column`,i._desktopGap=0,i._mobileGap=12,i._asideWidth=280,i._safeArea=!1,i._safeAreaApplied=!1,i._viewport=!1,i._mobile=!1,i._drawerEnabled=!0,i._asideOpen=!1,i._asideBackdrop=new y(`div`).className(`yoya-vmobile-layout-backdrop`).attr(`aria-hidden`,`true`).style(`display`,`none`).on(`click`,()=>i.closeAside()),i._asideToggle=new y(`button`).className(`yoya-vmobile-layout-toggle`).attr({type:`button`,"aria-label":`打开导航`,"aria-expanded":`false`}).style(`display`,`none`).child(k().styles({height:`18px`,width:`18px`})).on(`click`,()=>i.toggleAside()),i._refreshMobileLayout=()=>{let e=typeof window>`u`?null:window.innerWidth,t=e!==null&&e<=i._breakpoint;return i._mobile=t,t||(i._asideOpen=!1),i.attr(`data-mobile-layout`,t?`true`:`false`),i.attr(`data-aside-open`,t&&i._asideOpen?`true`:null),i.styles({flexDirection:t?i._mobileDirection:i._desktopDirection,gap:t?i._mobileGap:i._desktopGap,height:i._viewport?`100dvh`:null,minHeight:i._viewport?`100vh`:null,overflow:i._viewport?`hidden`:null}),i._safeArea?(i._safeAreaApplied=!0,i.style(`paddingLeft`,t?`max(env(safe-area-inset-left), 0px)`:null),i.style(`paddingRight`,t?`max(env(safe-area-inset-right), 0px)`:null),i.style(`paddingTop`,t?`max(env(safe-area-inset-top), 0px)`:null),i.style(`paddingBottom`,t?`max(env(safe-area-inset-bottom), 0px)`:null)):i._safeAreaApplied&&(i._safeAreaApplied=!1,i.style(`paddingLeft`,null),i.style(`paddingRight`,null),i.style(`paddingTop`,null),i.style(`paddingBottom`,null)),i.children().forEach(e=>et(i,e)),tt(i),i},i.refresh=i._refreshMobileLayout,i.breakpoint=e=>e===void 0?i._breakpoint:(i._breakpoint=Number(e),(!Number.isFinite(i._breakpoint)||i._breakpoint<=0)&&(i._breakpoint=768),i._refreshMobileLayout(),i),i.direction=(e,t)=>e===void 0?i._desktopDirection:(i._desktopDirection=e||`row`,t!==void 0&&(i._mobileDirection=t||`column`),i._refreshMobileLayout(),i),i.mobileDirection=e=>e===void 0?i._mobileDirection:(i._mobileDirection=e||`column`,i._refreshMobileLayout(),i),i.gap=(e,t)=>e===void 0?i._desktopGap:(i._desktopGap=q(e),t!==void 0&&(i._mobileGap=q(t)),i._refreshMobileLayout(),i),i.mobileGap=e=>e===void 0?i._mobileGap:(i._mobileGap=q(e),i._refreshMobileLayout(),i),i.asideWidth=e=>e===void 0?i._asideWidth:(i._asideWidth=q(e),i._refreshMobileLayout(),i),i.viewport=(e=!0)=>e===void 0?i._viewport:(i._viewport=!!e,i._refreshMobileLayout(),i),i.safeArea=(e=!0)=>e===void 0?i._safeArea:(i._safeArea=!!e,i._refreshMobileLayout(),i),i.drawer=(e=!0)=>e===void 0?i._drawerEnabled:(i._drawerEnabled=!!e,i._drawerEnabled||(i._asideOpen=!1),i._refreshMobileLayout(),i),i.asideOpen=e=>e===void 0?i._asideOpen:(i._asideOpen=!!e,i._refreshMobileLayout(),i),i.openAside=()=>i.asideOpen(!0),i.closeAside=()=>i.asideOpen(!1),i.toggleAside=()=>i.asideOpen(!i._asideOpen),i.mobile=()=>i._mobile;let a=i.child.bind(i);return i.child=(...e)=>(a(...e),i._refreshMobileLayout(),i),Fe(i,r.first,at),i.child(i._asideBackdrop,i._asideToggle),i._mobileLayoutResize=()=>i._refreshMobileLayout(),i._mobileLayoutResizeUnbind=P(`resize`,i._mobileLayoutResize),$e(i),i._refreshMobileLayout(),w(i,r.options,r.callback)}const Ee=Te;function De(e=null,t=null,n=null){return G(`vheader`,{boxSizing:`border-box`,flex:`0 0 auto`,height:`60px`,width:`100%`},e,ot,t,n,`header`,ue,Ne)}function Oe(e=null,t=null,n=null){return G(`vaside`,{boxSizing:`border-box`,flex:`0 0 auto`,minWidth:`0`,width:`300px`},e,st,t,n,`aside`,ue,Pe)}function ke(e=null,t=null,n=null){return G(`vmain`,{boxSizing:`border-box`,flex:`1 1 auto`,minHeight:`0`,minWidth:`0`,overflow:`auto`},e,ct,t,n,`main`,ue,Pe)}function Ae(e=null,t=null,n=null){return G(`vfooter`,{boxSizing:`border-box`,flex:`0 0 auto`,height:`60px`,width:`100%`},e,ot,t,n,`footer`,ue,Ne)}function je(e=null,t=null,n=null){let r=G(`spacer`,{flexGrow:1,minWidth:0,minHeight:0},e,Ve,t,n);return r.attr(`aria-hidden`,`true`),r}function Me(e=null,t=null,n=null){let r=G(`divider`,{},e,He,t,n);return r.attr(`role`,`separator`),r.attr(`aria-orientation`)||r.attr(`aria-orientation`,`horizontal`),r}d(y,{vAside:Oe,vCol:_e,vContainer:we,vFooter:Ae,vHeader:De,vMain:ke,vMasonry:U,vRow:ge,vSplitPanel:H,center:he,container:Ce,divider:Me,flex:de,grid:ve,mobileLayout:Te,responsiveGrid:ye,vMobileLayout:Ee,vBody:be,hstack:me,spacer:je,stack:fe,vstack:pe});function G(e,t,n,r,i,a,o=`div`,s=null,c=null){let l=R(n,i,a),u=new y(o);return u.className(`yoya-layout`,`yoya-${e}`),u.styles(t),c&&c(u),Fe(u,l.first,r,s),w(u,l.options,l.callback)}function Ne(e){e.sticky=(t=!0)=>{if(t===void 0)return e.style(`position`)===`sticky`;let n=!!t;return e.styles({position:n?`sticky`:null,top:n?`0`:null,zIndex:n?`20`:null}),e}}function Pe(e){e.scrollable=(t=!0)=>{if(t===void 0)return e.style(`overflow`)===`auto`;let n=!!t;return e.styles({height:n?`100%`:null,minHeight:n?`0`:null,overflow:n?`auto`:null,overscrollBehavior:n?`contain`:null}),e}}function Fe(e,t,n,r=null){if(t==null)return n(e,{}),e;if(!ht(t))return n(e,{}),e.setup(t);n(e,t);let i=pt(t,r);return Object.keys(i).length>0&&e.setup(i),e}function Ie(e,t){e.styles(mt({alignItems:t.align,flexDirection:t.direction,flexWrap:ft(t.wrap),gap:t.gap,justifyContent:t.justify}))}function Le(e,t){e.styles(mt({gap:t.gap,gridAutoFlow:t.autoFlow,gridTemplateAreas:t.areas,gridTemplateColumns:lt(t.columns),gridTemplateRows:lt(t.rows)}))}function Re(e,t){e.style(`gap`,t.gap),e.style(`gridTemplateColumns`,`repeat(auto-fit, minmax(${ut(t.minColumnWidth)}, 1fr))`)}function ze(e,t){if(t==null)return e;if(typeof t==`function`)return t(e),e;if(!ht(t))return e.child(t),e;let{background:n,children:r,content:i,gap:a,maxWidth:o,minHeight:s,padding:c,...l}=t;Object.keys(l).length&&e.setup(l),n!==void 0&&e.background(n),o!==void 0&&e.maxWidth(o),c!==void 0&&e.padding(c),a!==void 0&&e.gap(a),s!==void 0&&e.minHeight(s);let u=i??r;return u!==void 0&&e.content(u),e}function Be(e,t){let n=t.paddingInline??t.padding;e.styles(mt({maxWidth:t.maxWidth,paddingLeft:n,paddingRight:n}))}function Ve(e,t){e.styles(mt({flexBasis:t.size,height:t.orientation===`vertical`?t.size:void 0,width:t.orientation===`horizontal`?t.size:void 0}))}function He(e,t){let n=t.orientation===`vertical`?`vertical`:`horizontal`;if(e.attr(`aria-orientation`,n),n===`vertical`){e.styles({alignSelf:`stretch`,background:`currentColor`,opacity:.2,width:`1px`});return}e.styles({background:`currentColor`,height:`1px`,opacity:.2,width:`100%`})}function Ue(e){e.children().forEach(t=>{let n=t?._resolved??t?._resolve?.()??t;n&&typeof n.gutter==`function`&&n.gutter(e._gutter)})}function We(e,t){t.gutter!==void 0&&e.gutter(t.gutter),e.styles(mt({alignItems:t.align,flexWrap:t.wrap===void 0||t.wrap===null?`wrap`:t.wrap===!1?`nowrap`:ft(t.wrap),justifyContent:t.justify}))}function Ge(e,t){e._baseCol=qe(t),e._responsiveCols=Je(t),t.gutter!==void 0&&e.gutter(t.gutter)}const Ke=[[`xs`,0],[`sm`,768],[`md`,992],[`lg`,1200],[`xl`,1920]];function qe(e={}){return{span:K(e.span??24),offset:K(e.offset??0),push:K(e.push??0),pull:K(e.pull??0)}}function Je(e={}){return Ke.filter(([t])=>e[t]!==void 0).map(([t,n])=>({minWidth:n,props:Ye(e[t])}))}function Ye(e){return typeof e==`number`?qe({span:e}):ht(e)?qe(e):qe({})}function K(e){let t=Number(e);return Number.isFinite(t)?Math.min(24,Math.max(0,Math.round(t))):0}function Xe(e){return e/24*100}function Ze(e){if(typeof e==`number`)return`${e/2}px`;let t=String(e).match(/^(-?(?:\d+\.?\d*|\.\d+))([a-z%]+)$/i);return t?`${Number(t[1])/2}${t[2]}`:`calc(${e} * 0.5)`}function Qe(e){if(e._colDestroyWrapped)return;e._colDestroyWrapped=!0;let t=e.destroy.bind(e);e.destroy=()=>(e._colResizeUnbind?.(),t())}function $e(e){if(e._mobileLayoutDestroyWrapped)return;e._mobileLayoutDestroyWrapped=!0;let t=e.destroy.bind(e);e.destroy=()=>(e._mobileLayoutResizeUnbind?.(),t())}function et(e,t){let n=t?._resolved??t?._resolve?.()??t;if(!n||typeof n.styles!=`function`)return;let r=n._classes;if(r?.has(`yoya-vaside`)&&e._mobile&&e._drawerEnabled){n.styles({bottom:`0`,boxShadow:e._asideOpen?`0 12px 36px rgba(15, 23, 42, 0.28)`:`none`,display:`flex`,flexDirection:`column`,height:`100dvh`,left:`0`,maxWidth:`84vw`,minHeight:`100vh`,minWidth:`0`,pointerEvents:e._asideOpen?`auto`:`none`,position:`fixed`,top:`0`,transform:e._asideOpen?`translateX(0)`:`translateX(-100%)`,transition:`transform 180ms ease, box-shadow 180ms ease, visibility 180ms ease`,visibility:e._asideOpen?`visible`:`hidden`,width:`320px`,zIndex:`40`}),n.attr(`aria-hidden`,e._asideOpen?null:`true`),n._mobileDrawerAriaHiddenApplied=!0,n._mobileDrawerStylesApplied=!0,n._mobileDrawerClickBound||(n._mobileDrawerClickBound=!0,n.on(`click`,t=>{t.target?.closest?.(`.yoya-vmenu-item`)&&!t.target.closest?.(`.yoya-vsubmenu-trigger`)&&e.closeAside()}));return}if(r?.has(`yoya-vaside`)){n._mobileDrawerStylesApplied&&(n._mobileDrawerStylesApplied=!1,n.styles({bottom:null,boxShadow:null,display:null,height:null,left:null,minHeight:null,minWidth:null,pointerEvents:null,position:null,top:null,transform:null,transition:null,visibility:null,zIndex:null})),n._mobileDrawerAriaHiddenApplied&&(n._mobileDrawerAriaHiddenApplied=!1,n.attr(`aria-hidden`,null));let t=e._mobile?`100%`:q(e._asideWidth);n.styles({flex:`0 0 auto`,maxWidth:t,width:t});return}r?.has(`yoya-vmain`)&&(n.styles({flex:`1 1 auto`,minHeight:`0`,minWidth:`0`}),e._mobile&&e._drawerEnabled?(n.styles({maxWidth:`100%`,width:`100%`}),n._mobileDrawerMainStylesApplied=!0):n._mobileDrawerMainStylesApplied&&(n._mobileDrawerMainStylesApplied=!1,n.styles({maxWidth:null,width:null})))}function tt(e){let t=e._mobile&&e._drawerEnabled&&nt(e),n=t&&e._asideOpen,r=e._asideBackdrop,i=e._asideToggle;i&&i.attr(`aria-expanded`,n?`true`:`false`).attr(`aria-label`,n?`关闭导航`:`打开导航`).styles({alignItems:`center`,background:`var(--yoya-color-surface, #ffffff)`,border:`0`,borderRadius:`10px`,boxShadow:t?`0 2px 10px rgba(15, 23, 42, 0.18)`:`none`,color:`#172033`,cursor:`pointer`,display:t?`inline-flex`:`none`,height:`38px`,justifyContent:`center`,left:`12px`,padding:`0`,position:`fixed`,top:`max(env(safe-area-inset-top), 10px)`,width:`38px`,zIndex:`45`}),r&&r.styles({background:n?`rgba(15, 23, 42, 0.42)`:null,display:n?`block`:`none`,inset:`0`,position:`fixed`,zIndex:n?`35`:null})}function nt(e){return e.children().some(e=>!!(e?._resolved??e?._resolve?.()??e)?._classes?.has(`yoya-vaside`))}function rt(e){let t=(e?._resolved??e?._resolve?.()??e)?._classes;return!!(t?.has(`yoya-vheader`)||t?.has(`yoya-vfooter`))}function it(e,t){t.direction!==void 0&&e.direction(t.direction),e.styles(mt({gap:t.gap}))}function at(e,t){e.styles(mt({alignItems:t.align,flexWrap:ft(t.wrap),justifyContent:t.justify})),t.direction===void 0?t.mobileDirection!==void 0&&e.mobileDirection(t.mobileDirection):e.direction(t.direction,t.mobileDirection),t.gap===void 0?t.mobileGap!==void 0&&e.mobileGap(t.mobileGap):e.gap(t.gap,t.mobileGap),t.breakpoint!==void 0&&e.breakpoint(t.breakpoint),t.asideWidth!==void 0&&e.asideWidth(t.asideWidth),t.drawer!==void 0&&e.drawer(t.drawer),t.viewport!==void 0&&e.viewport(t.viewport),t.safeArea!==void 0&&e.safeArea(t.safeArea)}function ot(e,t){e.style(`height`,q(t.height??t.size??60)),e.style(`width`,`100%`)}function st(e,t){e.style(`width`,q(t.width??t.size??300))}function ct(e,t={}){t.height!==void 0&&e.style(`height`,q(t.height))}function lt(e){if(e!=null&&e!==!1)return typeof e==`number`?`repeat(${e}, minmax(0, 1fr))`:String(e)}function ut(e){return typeof e==`number`?`${e}px`:e||`240px`}function q(e){return typeof e==`number`?`${e}px`:e}function dt(e){return e?(Array.isArray(e)?e:Object.entries(e).map(([e,t])=>({minWidth:e,columns:t}))).map(e=>({columns:Number(e.columns),minWidth:Number.parseInt(e.minWidth,10)})).filter(({columns:e,minWidth:t})=>Number.isFinite(t)&&e>0).sort((e,t)=>e.minWidth-t.minWidth):[]}function ft(e){if(e===!0)return`wrap`;if(e!==!1&&e!=null)return String(e)}function pt(e,t=null){let n=t||le;return Object.fromEntries(Object.entries(e).filter(([e])=>!n.has(e)))}function mt(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!=null&&e!==!1))}function ht(e){return Object.prototype.toString.call(e)===`[object Object]`}var J=class extends y{constructor(e=null,t=null,n=null){super(`button`,null),this._variant=`secondary`,this._size=`medium`,this._focused=!1,this._hovered=!1,this._pressed=!1,this._labelBox=new y(`span`).className(`yoya-vbutton-label`),this._loadingBox=new y(`span`).className(`yoya-vbutton-spinner`).attr(`aria-hidden`,`true`),this.className(E,`yoya-vbutton`),this.attr(`type`,`button`),this.child(this._loadingBox,this._labelBox),this._bindInteractionEffects(),this.type(this._variant),this.size(this._size);let r=R(e,t,n);this._setupButton(r.first),w(this,r.options,r.callback)}label(e){return a(this._labelBox,S(e)),this}content(e){return this.label(e)}type(e){return e===void 0?this._variant:(this._variant=e||`secondary`,this.attr(`data-variant`,this._variant),this._syncInteractionStyles(),this)}variant(e){return this.type(e)}_applyAccessState(e){e===`readonly`?(this._accessDisabled=!0,this.disabled(!0)):this._accessDisabled&&(this._accessDisabled=!1,this.disabled(!1))}formType(e){if(e===void 0)return this.attr(`type`);let t=new Set([`button`,`submit`,`reset`]);return this.attr(`type`,t.has(e)?e:`button`)}size(e){return e===void 0?this._size:(this._size=e||`medium`,this.attr(`data-size`,this._size),this)}disabled(e){return this.setState(`disabled`,!!e),this.attr(`disabled`,e?!0:null),e&&(this._hovered=!1,this._pressed=!1),this._syncInteractionStyles(),this}loading(e){let t=!!e;return this.setState(`loading`,t),this.attr(`aria-busy`,t?`true`:null),this.attr(`data-loading`,t?`true`:null),this._loadingBox.textContent(t?`...`:``),this._syncInteractionStyles(),this}_bindInteractionEffects(){this.on(`mouseenter`,()=>{this.getBooleanState(`disabled`)||(this._hovered=!0,this._syncInteractionStyles())}),this.on(`mouseleave`,()=>{this._hovered=!1,this._pressed=!1,this._syncInteractionStyles()}),this.on(`mousedown`,e=>{!this.getBooleanState(`disabled`)&&e.button===0&&(this._pressed=!0,this._syncInteractionStyles())}),this.on(`mouseup`,()=>{this._pressed=!1,this._syncInteractionStyles()}),this.on(`focus`,()=>{this.getBooleanState(`disabled`)||(this._focused=!0,this._syncInteractionStyles())}),this.on(`blur`,()=>{this._focused=!1,this._pressed=!1,this._syncInteractionStyles()}),this.on(`keydown`,e=>{!this.getBooleanState(`disabled`)&&[`Enter`,` `,`Spacebar`].includes(e.key)&&(this._pressed=!0,this._syncInteractionStyles())}),this.on(`keyup`,e=>{[`Enter`,` `,`Spacebar`].includes(e.key)&&(this._pressed=!1,this._syncInteractionStyles())})}_interactionState(){return this.getBooleanState(`disabled`)?`disabled`:this._pressed?`active`:this._focused?`focus`:this._hovered?`hover`:`rest`}_syncInteractionStyles(){let e=this._interactionState();return this.attr(`data-interaction`,e===`rest`?null:e),this}_setupButton(e){if(typeof e==`function`)e(this);else if(N(e)){let{children:t,label:n,text:r,variant:i,type:a,formType:o,size:s,disabled:c,loading:l,attrs:u,style:d,...f}=e;Object.keys(f).length>0&&this.setup(f),A(this,{attrs:u,style:d}),n===void 0?r===void 0?t!==void 0&&this.label(t):this.label(r):this.label(n),i===void 0?a!==void 0&&this.type(a):this.variant(i),s!==void 0&&this.size(s),o!==void 0&&this.formType(o),c!==void 0&&this.disabled(c),l!==void 0&&this.loading(l)}else e!=null&&this.label(e)}};function gt(e=null,t=null,n=null){return new J(e,t,n)}const _t=new WeakMap;var vt=class extends y{constructor(e=null,t=null,n=null){super(`div`,null),this._variant=`secondary`,this._size=`medium`,this._selectable=!1,this._value=null,this._buttons=[],this._changeHandler=null,this.className(E,`yoya-vbuttons`),this.attr(`role`,`group`),this.styles({display:`inline-flex`,flexWrap:`wrap`,gap:`8px`,minWidth:`0`,verticalAlign:`middle`});let r=R(e,t,n);this._setupButtons(r.first),w(this,r.options,r.callback)}child(...e){return e.flat(1/0).forEach(e=>{if(e==null)return;let n=t(e);n instanceof J&&this._registerButton(n),super.child(n)}),this}variant(e){if(e===void 0)return this._variant;let t=this._variant;return this._variant=e||`secondary`,this._buttons.forEach(e=>{_t.get(e)===t&&_t.set(e,this._variant)}),this._syncSelection(),this}size(e){return e===void 0?this._size:(this._size=e||`medium`,this._buttons.forEach(e=>e.size(this._size)),this)}selectable(e=!0){return this._selectable=!!e,this._syncSelection(),this}value(e){return e===void 0?this._value:(this._value=e,this._syncSelection(),this)}change(e){return e===void 0?this._changeHandler:(this._changeHandler=typeof e==`function`?e:null,this)}joined(e=!0){return this._joined=!!e,this._applyJoinedLayout(),this}disabled(e){return this._buttons.forEach(t=>t.disabled(!!e)),this}options(e){return e===void 0?this._buttons.slice():(this._buttons=[],a(this,(Array.isArray(e)?e:[e]).map(e=>this._createButton(e))),this._applyJoinedLayout(),this)}_createButton(e){if(e instanceof J)return e;let t=new J;if(t.variant(this._variant),t.size(this._size),typeof e==`string`||typeof e==`number`)return t.label(e),_t.set(t,this._variant),t;if(N(e)){let{children:n,disabled:r,label:a,size:o,text:s,value:c,variant:l,...u}=e;return Object.keys(u).length>0&&t.setup(u),a===void 0?s===void 0?n!==void 0&&t.label(n):t.label(s):t.label(a),l!==void 0&&t.variant(l),o!==void 0&&t.size(o),c!==void 0&&t.attr(`data-value`,i(c)),r!==void 0&&t.disabled(r),_t.set(t,l||this._variant),t}return _t.set(t,this._variant),t}_registerButton(e){this._buttons.includes(e)||(_t.has(e)||_t.set(e,e.type()||this._variant),e.size(this._size),e.on(`click`,()=>{if(!this._selectable)return;let t=this._buttonValue(e);t!==this._value&&(this.value(t),typeof this._changeHandler==`function`&&this._changeHandler(t,this))}),this._buttons.push(e),this._applyJoinedLayout())}_buttonValue(e){let t=e.attr(`data-value`);return String(t??e._labelBox?.textContent()??``)}_syncSelection(){return this._buttons.forEach(e=>{let t=this._selectable&&this._buttonValue(e)===this._value;e.variant(t?`primary`:_t.get(e)||this._variant),e.attr(`aria-pressed`,t?`true`:null),e.attr(`data-selected`,t?`true`:null),e.style(`zIndex`,this._joined&&t?`1`:null)}),this}_applyJoinedLayout(){return this.style(`gap`,this._joined?`0`:`8px`),this.style(`flexWrap`,this._joined?`nowrap`:`wrap`),this._buttons.forEach((e,t)=>{if(!this._joined){e.style(`borderRadius`,null),e.style(`marginLeft`,null);return}let n=this._joinedRadius(t);e.style(`borderRadius`,n),e.style(`marginLeft`,t===0?null:`-1px`)}),this._syncSelection(),this}_joinedRadius(e){let t=this._buttons.length;return t<=1?null:e===0?`var(--yoya-radius-md, 6px) 0 0 var(--yoya-radius-md, 6px)`:e===t-1?`0 var(--yoya-radius-md, 6px) var(--yoya-radius-md, 6px) 0`:`0`}_setupButtons(e){if(typeof e==`function`){e(this);return}if(N(e)){let{attrs:t,change:n,children:r,disabled:i,joined:a,options:o,selectable:s,size:c,style:l,value:u,variant:d,...f}=e;Object.keys(f).length>0&&this.setup(f),A(this,{attrs:t,style:l}),d!==void 0&&this.variant(d),c!==void 0&&this.size(c),s!==void 0&&this.selectable(s),u!==void 0&&this.value(u),n!==void 0&&this.change(n),i!==void 0&&this.disabled(i),a!==void 0&&this.joined(a),o!==void 0&&this.options(o),r!==void 0&&this.child(r);return}if(Array.isArray(e)){this.options(e);return}e!=null&&this.options([e])}};function yt(e=null,t=null,n=null){return new vt(e,t,n)}var bt=class extends y{constructor(e=null){super(`div`,null),this.className(E,`yoya-vmenu`),this.orientation(`vertical`),this.on(`focusin`,e=>this._handleFocusin(e)),this.on(`keydown`,e=>this._handleKeydown(e)),this.on(`yoya:menuitem-statechange`,()=>this._syncTabStops()),this._setupMenu(e)}orientation(e=`vertical`){let t=e===`horizontal`?`horizontal`:`vertical`;return this.attr(`data-orientation`,t),this.attr(`role`,t===`horizontal`?`menubar`:`menu`),this.attr(`aria-orientation`,t),this.children().forEach(e=>{Tt(e,t)}),this}child(...e){super.child(...e);let t=this.attr(`data-orientation`)||`vertical`;return this.children().forEach(e=>{Tt(e,t)}),this._el&&this._syncTabStops(),this._sidebarContentChangeCallback?.(),this}horizontal(){return this.orientation(`horizontal`)}vertical(){return this.orientation(`vertical`)}renderDom(){let e=super.renderDom();return this._syncTabStops(),e}_enabledMenuItems(){return this._el?this._menuItems().filter(e=>!e.disabled):[]}_menuItems(){return this._el?Array.from(this._el.querySelectorAll(`.yoya-vmenu-item`)).filter(e=>e.closest(`.yoya-vmenu`)===this._el):[]}_syncTabStops(e=null){if(!this._el)return this;let t=this._menuItems(),n=t.filter(e=>!e.disabled),r=n.includes(e)?e:n.find(e=>e.tabIndex===0)||n[0];return t.forEach(e=>{e.tabIndex=e===r?0:-1}),this}_handleKeydown(e){if(e.target.closest?.(`.yoya-vmenu`)!==this._el)return;let t=(this.attr(`data-orientation`)||`vertical`)===`vertical`?{ArrowDown:1,ArrowUp:-1}:{ArrowLeft:-1,ArrowRight:1},n=this._enabledMenuItems(),r=e.target.closest?.(`.yoya-vmenu-item`);if(n.length===0||!t[e.key]&&e.key!==`Home`&&e.key!==`End`)return;e.preventDefault();let i;i=e.key===`Home`?0:e.key===`End`?n.length-1:(Math.max(0,n.indexOf(r))+t[e.key]+n.length)%n.length;let a=n[i];this._syncTabStops(a),a.focus()}_handleFocusin(e){if(e.target.closest?.(`.yoya-vmenu`)!==this._el)return;let t=e.target.closest?.(`.yoya-vmenu-item`);t&&!t.disabled&&this._syncTabStops(t)}_setupMenu(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{children:t,orientation:n,horizontal:r,...i}=e;Object.keys(i).length>0&&this.setup(i),n===void 0?r!==void 0&&this.orientation(r?`horizontal`:`vertical`):this.orientation(n),t!==void 0&&this.child(t);return}j(this,e)}}},xt=class extends y{constructor(e=null){super(`button`,null),this._iconBox=new y(`span`).className(`yoya-vmenu-item-icon`).attr(`aria-hidden`,`true`).style(`display`,`none`),this._labelBox=new y(`span`).className(`yoya-vmenu-item-label`),this._shortcutBox=new y(`span`).className(`yoya-vmenu-item-shortcut`).attr(`aria-hidden`,`true`).style(`display`,`none`),this.className(E,`yoya-vmenu-item`),this.attr({role:`menuitem`,type:`button`}),this.child(this._iconBox,this._labelBox,this._shortcutBox),this.on(`mouseenter`,()=>this._setHover(!0)),this.on(`mouseleave`,()=>this._setHover(!1)),this._setupMenuItem(e)}text(e){return a(this._labelBox,S(e)),this}label(e){return this.text(e)}content(e){return this.text(e)}icon(e){return a(this._iconBox,S(e)),this._iconBox.style(`display`,e==null||e===``?`none`:null),this}shortcut(e){return a(this._shortcutBox,S(e)),this._shortcutBox.style(`display`,e==null||e===``?`none`:null),this}active(e=!0){let t=!!e;return this.setState(`active`,t),this.attr(`data-active`,t?`true`:null),this.attr(`aria-current`,t?`page`:null),this}danger(e=!0){let t=!!e;return this.setState(`danger`,t),this.attr(`data-danger`,t?`true`:null),this}_setHover(e){return this.attr(`data-hovered`,e?`true`:null),this}disabled(e){let t=!!e;if(this.setState(`disabled`,t),this.attr(`disabled`,t?!0:null),this.attr(`aria-disabled`,t?`true`:null),this._el){let e=this._el.ownerDocument.defaultView.Event;this._el.dispatchEvent(new e(`yoya:menuitem-statechange`,{bubbles:!0}))}return this}hoverable(e=!0){return this.attr(`data-hoverable`,e?`true`:null),this}_menuOrientation(e){return this.attr(`data-orientation`,e),this}_setupMenuItem(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{active:t,children:n,content:r,danger:i,disabled:a,icon:o,label:s,shortcut:c,text:l,...u}=e;Object.keys(u).length>0&&this.setup(u),s===void 0?l===void 0?r===void 0?n!==void 0&&this.text(n):this.content(r):this.text(l):this.label(s),o!==void 0&&this.icon(o),c!==void 0&&this.shortcut(c),t!==void 0&&this.active(t),i!==void 0&&this.danger(i),a!==void 0&&this.disabled(a);return}this.text(e)}}},St=class extends y{constructor(e=null){super(`div`,null),this.className(E,`yoya-vmenu-divider`),this.attr(`role`,`separator`),this._menuOrientation(`vertical`),j(this,e)}_menuOrientation(e){let t=e===`horizontal`;return this.attr(`aria-orientation`,t?`vertical`:`horizontal`),this.attr(`data-orientation`,e),this}},Ct=class extends y{constructor(e=null){super(`div`,null);let t=M(`yoya-vmenu-group-label`);this._orientation=`vertical`,this._labelBox=new y(`div`).className(`yoya-vmenu-group-label`).id(t),this.className(E,`yoya-vmenu-group`),this.attr({"aria-labelledby":t,role:`group`}),super.child(this._labelBox),this._setupMenuGroup(e)}label(e){return a(this._labelBox,S(e)),this}title(e){return this.label(e)}child(...e){if(super.child(...e),this.children().forEach(e=>Tt(e,this._orientation)),this._el){let e=this._el.ownerDocument.defaultView.Event;this._el.dispatchEvent(new e(`yoya:menuitem-statechange`,{bubbles:!0}))}return this._sidebarContentChangeCallback?.(),this}_menuOrientation(e){return this._orientation=e===`horizontal`?`horizontal`:`vertical`,this.attr(`data-orientation`,this._orientation),this.children().forEach(e=>Tt(e,this._orientation)),this}_setupMenuGroup(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{children:t,label:n,title:r,...i}=e;Object.keys(i).length>0&&this.setup(i),n===void 0?r!==void 0&&this.title(r):this.label(n),t!==void 0&&this.child(t);return}this.label(e)}}},wt=class e extends y{constructor(e=null){super(`div`,null);let t=M(`yoya-vsubmenu-panel`);this._globalCloseCleanup=null,this._trigger=new xt().className(`yoya-vsubmenu-trigger`).attr({"aria-controls":t,"aria-expanded":`false`,"aria-haspopup":`menu`}).shortcut(`›`).on(`click`,e=>{e.preventDefault(),this.getBooleanState(`disabled`)||this.toggle()}),this._menu=new bt().className(`yoya-vsubmenu-content`),this._menu.on(`click`,e=>{let t=e.target?.closest?.(`.yoya-vmenu-item`);t&&!t.disabled&&!t.classList.contains(`yoya-vsubmenu-trigger`)&&(this._inline?this._selectInlineItem(t):this.close())}),this._panel=new y(`div`).id(t).className(`yoya-vsubmenu-panel`).child(this._menu),this.className(E,`yoya-vsubmenu`),this.on(`keydown`,e=>this._handleKeydown(e)),this.child(this._trigger,this._panel),this._setupSubMenu(e)}trigger(e){return e===void 0?this._trigger:(typeof e==`function`?e(this._trigger):this._trigger._setupMenuItem(e),this)}label(e){return this._trigger.label(e),this}text(e){return this.label(e)}menuContent(e){return e===void 0?this._menu:(O(this._menu,e),this)}inline(e=!0){return this._inline=!!e,this.attr(`data-inline`,this._inline?`true`:null),this._trigger.shortcut(this._inline?this.getBooleanState(`open`)?`▾`:`▸`:`›`),this}disabled(e=!0){let t=!!e;return this.setState(`disabled`,t),this.attr(`data-disabled`,t?`true`:null),this._trigger.disabled(t),t&&this.close(),this}open(e=!0){let t=!!e&&!this.getBooleanState(`disabled`);return this.setState(`open`,t),this.attr(`data-open`,t?`true`:null),this._trigger.attr(`aria-expanded`,t?`true`:`false`),this._inline&&this._trigger.shortcut(t?`▾`:`▸`),t?this._bindGlobalCloseHandlers():(this._closeDescendantSubMenus(),this._releaseGlobalCloseHandlers()),this}close(){return this.open(!1)}toggle(){return this.open(!this.getBooleanState(`open`))}_selectInlineItem(e){let t=n=>{n.forEach(n=>{n instanceof xt?n.active(n.renderDom()===e):typeof n.children==`function`&&t(n.children())})};t(this._menu.children())}destroy(){return this.close(),super.destroy()}_menuOrientation(e){return this.attr(`data-orientation`,e),this._trigger._menuOrientation(e),this}_handleKeydown(e){let t=e.target.closest?.(`.yoya-vsubmenu`),n=e.target.closest?.(`.yoya-vsubmenu-trigger`),r=[`ArrowRight`,`Enter`,` `,`Spacebar`],i=e.key===`ArrowLeft`||e.key===`Escape`;if(t===this._el&&n===this._trigger._el&&r.includes(e.key)){if(this.getBooleanState(`disabled`))return;e.preventDefault(),e.stopPropagation(),this.open();let t=this._menu._enabledMenuItems()[0];t&&(this._menu._syncTabStops(t),t.focus());return}if(t===this._el&&n===this._trigger._el&&i&&this.getBooleanState(`open`)){e.preventDefault(),e.stopPropagation(),this.close(),this._trigger._el?.focus();return}i&&(t===this._el&&n!==this._trigger._el||t!==this._el&&this._menu._el?.contains(e.target))&&(e.preventDefault(),e.stopPropagation(),this.close(),this._trigger._el?.focus())}_closeDescendantSubMenus(){let t=n=>{n.children().forEach(n=>{n instanceof e?n.close():typeof n.children==`function`&&t(n)})};t(this._menu)}_bindGlobalCloseHandlers(){if(this._globalCloseCleanup)return;let e=[];this._inline||e.push(x(`click`,e=>{this._el?.contains(e.target)||this.close()})),e.push(x(`keydown`,e=>{e.key===`Escape`&&this.close()})),this._globalCloseCleanup=()=>{e.forEach(e=>e()),this._globalCloseCleanup=null}}_releaseGlobalCloseHandlers(){this._globalCloseCleanup&&this._globalCloseCleanup()}_setupSubMenu(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{children:t,content:n,disabled:r,inline:i,label:a,menu:o,menuContent:s,open:c,text:l,trigger:u,...d}=e;Object.keys(d).length>0&&super._setupObject(d),u===void 0?a===void 0?l!==void 0&&this.text(l):this.label(a):this.trigger(u),i!==void 0&&this.inline(i);let f=s??o??n??t;f!==void 0&&this.menuContent(f),r!==void 0&&this.disabled(r),c!==void 0&&this.open(c);return}this.label(e)}}};function Tt(e,t){(e instanceof xt||e instanceof St||e instanceof Ct||e instanceof wt)&&e._menuOrientation(t)}var Et=class extends y{constructor(e=null){super(`aside`,null);let t=M(`yoya-vsidebar-menu`);this._responsiveCleanup=null,this._collapsible=!0,this._titleBox=new y(`strong`).className(`yoya-vsidebar-title`),this._toggle=new J(`‹`).className(`yoya-vsidebar-toggle`).attr({"aria-controls":t,"aria-expanded":`true`,"aria-label":`收起侧边导航`}).on(`click`,()=>this.toggle()),this._header=new y(`div`).className(`yoya-vsidebar-header`).child(this._titleBox,this._toggle),this._menu=new bt().id(t).className(`yoya-vsidebar-menu`).attr(`aria-label`,`侧边导航菜单`),this._menu._sidebarContentChangeCallback=()=>Dt(this._menu,this.getBooleanState(`collapsed`),this),this._menu.on(`yoya:menuitem-statechange`,this._menu._sidebarContentChangeCallback),this._menu.on(`click`,e=>{let t=e.target?.closest?.(`.yoya-vmenu-item`);t&&!t.disabled&&!t.classList.contains(`yoya-vsubmenu-trigger`)&&this._activateMenuItem(t)}),this.className(E,`yoya-vsidebar`),this.attr(`aria-label`,`侧边导航`),this.on(`keydown`,e=>{!this._collapsible||e.key!==`Escape`||e.defaultPrevented||this.getBooleanState(`collapsed`)||(e.preventDefault(),e.stopPropagation(),this.collapsed(!0),this._toggle._el?.focus())}),this.child(this._header,this._menu),this._setupSidebar(e)}_activateMenuItem(e){let t=n=>{n.forEach(n=>{n instanceof xt?n.active(n.renderDom()===e):typeof n.children==`function`&&t(n.children())})};t(this._menu.children())}title(e){return a(this._titleBox,S(e)),this}ariaLabel(e){let t=i(e)||`侧边导航`;return this.attr(`aria-label`,t),this._menu.attr(`aria-label`,`${t}菜单`),this}menuContent(e){return e===void 0?this._menu:(O(this._menu,e),Dt(this._menu,this.getBooleanState(`collapsed`),this),this)}collapsed(e=!0){if(!this._collapsible&&e)return this;let t=!!e;return this.setState(`collapsed`,t),this.attr(`data-collapsed`,t?`true`:null),this._toggle.label(t?`›`:`‹`).attr(`aria-expanded`,t?`false`:`true`).attr(`aria-label`,t?`展开侧边导航`:`收起侧边导航`),Dt(this._menu,t,this),kt(this._titleBox,t),this}collapsible(e=!0){return this._collapsible=!!e,this._toggle.style(`display`,this._collapsible?null:`none`),this}toggle(){return this.collapsed(!this.getBooleanState(`collapsed`))}responsive(e=`(max-width: 768px)`){if(this._releaseResponsiveListener(),e===!1)return this.attr({"data-responsive":null,"data-responsive-query":null}),this;let t=typeof e==`string`&&e?e:`(max-width: 768px)`;if(this.attr({"data-responsive":`true`,"data-responsive-query":t}),typeof window>`u`||typeof window.matchMedia!=`function`)return this;let n=window.matchMedia(t),r=e=>this.collapsed(e.matches);return typeof n.addEventListener==`function`?(n.addEventListener(`change`,r),this._responsiveCleanup=()=>n.removeEventListener(`change`,r)):typeof n.addListener==`function`&&(n.addListener(r),this._responsiveCleanup=()=>n.removeListener(r)),this.collapsed(n.matches),this}destroy(){return this._releaseResponsiveListener(),super.destroy()}_releaseResponsiveListener(){this._responsiveCleanup&&=(this._responsiveCleanup(),null)}_setupSidebar(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{ariaLabel:t,children:n,collapsible:r,content:i,menu:a,menuContent:o,title:s,...c}=e;Object.keys(c).length>0&&super._setupObject(c),s!==void 0&&this.title(s),t!==void 0&&this.ariaLabel(t),r!==void 0&&this.collapsible(r);let l=o??a??i??n;l!==void 0&&this.menuContent(l);return}this.title(e)}}};function Dt(e,t,n){let r=n?._menu._sidebarContentChangeCallback,i=(e,{preserveShortcut:a=!1}={})=>{if((e instanceof bt||e instanceof Ct)&&r&&(e._sidebarContentChangeCallback=r),e instanceof xt){kt(e._labelBox,t),kt(e._shortcutBox,t&&!a);return}if(e instanceof wt){if(Ot(e,n),t){let t=e._panel._el?.ownerDocument.activeElement;t&&e._panel._el.contains(t)&&e._trigger._el?.focus(),e.close()}i(e._trigger,{preserveShortcut:!0}),i(e._menu);return}e instanceof Ct&&kt(e._labelBox,t),typeof e.children==`function`&&e.children().forEach(i)};i(e)}function Ot(e,t){if(!t||e._sidebarExpandOwner===t)return;e._sidebarExpandOwner=t;let n=e.open.bind(e);e.open=r=>{let i=n(r);return r&&!e.getBooleanState(`disabled`)&&t.getBooleanState(`collapsed`)&&t.collapsed(!1),t.style(`overflow`,e.getBooleanState(`open`)&&!e._inline?`visible`:`hidden`),i},e.getBooleanState(`open`)&&t.style(`overflow`,e._inline?`hidden`:`visible`),e._trigger.on(`keydown`,n=>{!e.getBooleanState(`disabled`)&&t.getBooleanState(`collapsed`)&&[`ArrowRight`,`Enter`,` `,`Spacebar`].includes(n.key)&&t.collapsed(!1)})}function kt(e,t){let n={clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:`1px`,overflow:`hidden`,position:`absolute`,whiteSpace:`nowrap`,width:`1px`};if(t){e._sidebarVisibleStyles||=Object.fromEntries(Object.keys(n).map(t=>[t,e.style(t)??null])),e.styles(n);return}e._sidebarVisibleStyles&&=(e.styles(e._sidebarVisibleStyles),null)}function At(e=null,t=null,n=null){return T(bt,e,t,n)}function jt(e=null,t=null,n=null){return T(xt,e,t,n)}function Mt(e=null,t=null,n=null){return T(St,e,t,n)}function Nt(e=null,t=null,n=null){return T(Ct,e,t,n)}function Pt(e=null,t=null,n=null){return T(wt,e,t,n)}function Ft(e=null,t=null,n=null){return T(Et,e,t,n)}var It=class extends y{constructor(e=null){super(`div`,null),this._closeOnSelect=!0,this._globalCloseCleanup=null,this._target=new y(`div`).className(`yoya-vcontext-target`).on(`contextmenu`,e=>{e.preventDefault(),this.openAt(e)}),this._menu=new bt().className(`yoya-vcontext-content`),this._panel=new y(`div`).className(`yoya-vcontext-panel`).child(this._menu),this.className(E,`yoya-vcontext-menu`),this._menu.on(`click`,e=>{let t=e.target?.closest?.(`.yoya-vmenu-item`);this._closeOnSelect&&t&&!t.disabled&&!t.classList.contains(`yoya-vsubmenu-trigger`)&&this.close()}),this.child(this._target,this._panel),this._setupContextMenu(e)}target(e){return e===void 0?this._target:(O(this._target,e),this)}menuContent(e){return e===void 0?this._menu:(O(this._menu,e),this)}closeOnSelect(e=!0){return this._closeOnSelect=!!e,this}openAt(e=0,t=0){let n=r(e,t);return this._panel.styles({left:`${n.x}px`,top:`${n.y}px`}),this.open(!0)}open(e=!0){let t=!!e;return this.setState(`open`,t),this.attr(`data-open`,t?`true`:null),t?this._bindGlobalCloseHandlers():this._releaseGlobalCloseHandlers(),this}close(){return this.open(!1)}destroy(){return this.close(),super.destroy()}_bindGlobalCloseHandlers(){if(this._globalCloseCleanup)return;let e=e=>{this._el?.contains(e.target)||this.close()},t=e=>{e.key===`Escape`&&this.close()},n=x(`click`,e),r=x(`keydown`,t);this._globalCloseCleanup=()=>{n(),r(),this._globalCloseCleanup=null}}_releaseGlobalCloseHandlers(){this._globalCloseCleanup&&this._globalCloseCleanup()}_setupContextMenu(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{children:t,closeOnSelect:n,content:r,menu:i,menuContent:a,open:o,target:s,x:c,y:l,...u}=e;Object.keys(u).length>0&&super._setupObject(u),s!==void 0&&this.target(s);let d=a??i??r??t;d!==void 0&&this.menuContent(d),n!==void 0&&this.closeOnSelect(n),o!==void 0&&(o?this.openAt(c??0,l??0):this.close());return}this.target(e)}}};function Lt(e=null,t=null,n=null){return T(It,e,t,n)}var Rt=class extends y{constructor(e=null){super(`div`,null),this._closeOnSelect=!0,this._globalCloseCleanup=null,this._panelId=M(`yoya-vdropdown-panel`),this._trigger=new J(`操作`).className(`yoya-vdropdown-trigger`).attr({"aria-controls":this._panelId,"aria-expanded":`false`,"aria-haspopup":`menu`}).on(`click`,e=>{e.preventDefault(),this._trigger.getBooleanState(`disabled`)||this.toggle()}),this._trigger.on(`keydown`,e=>this._handleTriggerKeydown(e)),this._menu=new bt().className(`yoya-vdropdown-content`),this._panel=new y(`div`).id(this._panelId).className(`yoya-vdropdown-panel`).attr(`aria-hidden`,`true`).child(this._menu),this.className(E,`yoya-vdropdown-menu`),this._menu.on(`click`,e=>{let t=e.target?.closest?.(`.yoya-vmenu-item`);this._closeOnSelect&&t&&!t.disabled&&!t.classList.contains(`yoya-vsubmenu-trigger`)&&(this.close(),this._focusTrigger())}),this.child(this._trigger,this._panel),this.placement(`bottom-start`),this._setupDropdownMenu(e)}trigger(e){return e===void 0?this._trigger:(p(this._trigger,e),this)}menuContent(e){return e===void 0?this._menu:(O(this._menu,e),this)}placement(e){if(e===void 0)return this.attr(`data-placement`);let t=e||`bottom-start`;return this.attr(`data-placement`,t),this._panel.styles(b(t)),this}closeOnSelect(e=!0){return this._closeOnSelect=!!e,this}open(e=!0){let t=!!e;return this.setState(`open`,t),this.attr(`data-open`,t?`true`:null),this._trigger.attr(`aria-expanded`,t?`true`:`false`),this._panel.attr(`aria-hidden`,t?`false`:`true`),t?(this._bindGlobalCloseHandlers(),this._focusFirstEnabledItem()):this._releaseGlobalCloseHandlers(),this}close(){return this.open(!1)}toggle(){return this.open(!this.getBooleanState(`open`))}destroy(){return this.close(),super.destroy()}_bindGlobalCloseHandlers(){if(this._globalCloseCleanup)return;let e=e=>{this._el?.contains(e.target)||this.close()},t=e=>{if(e.key===`Escape`){let t=this._el?.contains(e.target);this.close(),t&&this._focusTrigger()}},n=x(`click`,e),r=x(`keydown`,t);this._globalCloseCleanup=()=>{n(),r(),this._globalCloseCleanup=null}}_releaseGlobalCloseHandlers(){this._globalCloseCleanup&&this._globalCloseCleanup()}_handleTriggerKeydown(e){if(!this._trigger.getBooleanState(`disabled`)&&[`ArrowDown`,`ArrowUp`,`Enter`,` `,`Spacebar`].includes(e.key)){if(e.preventDefault(),e.key===`ArrowUp`){this.open(),this._focusLastEnabledItem();return}this.open()}}_focusFirstEnabledItem(){this._menu._enabledMenuItems()[0]?.focus?.()}_focusLastEnabledItem(){let e=this._menu._enabledMenuItems();e[e.length-1]?.focus?.()}_focusTrigger(){this._trigger._el?.focus()}_setupDropdownMenu(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{children:t,closeOnSelect:n,content:r,label:i,menu:a,menuContent:o,open:s,placement:c,text:l,trigger:u,...d}=e;Object.keys(d).length>0&&super._setupObject(d),u===void 0?i===void 0?l!==void 0&&this.trigger(l):this.trigger(i):this.trigger(u);let f=o??a??r??t;f!==void 0&&this.menuContent(f),c!==void 0&&this.placement(c),n!==void 0&&this.closeOnSelect(n),s!==void 0&&this.open(s);return}this.trigger(e)}}};function zt(e=null,t=null,n=null){return T(Rt,e,t,n)}const Bt={"bottom-left":{bottom:`24px`,left:`24px`},"bottom-right":{bottom:`24px`,right:`24px`},"top-left":{left:`24px`,top:`24px`},"top-right":{right:`24px`,top:`24px`}},Vt={large:{height:`56px`,minWidth:`56px`},medium:{height:`48px`,minWidth:`48px`},small:{height:`36px`,minWidth:`36px`}};var Ht=class extends y{constructor(e=null,t=null,n=null){super(`button`,null),this._variant=`primary`,this._size=`medium`,this._fixed=!1,this._position=null,this._iconBox=new y(`span`).className(`yoya-vfloat-button-icon`),this._labelBox=new y(`span`).className(`yoya-vfloat-button-label`),this.className(E,`yoya-vfloat-button`),this.attr(`type`,`button`),this.styles({alignItems:`center`,borderRadius:`9999px`,boxSizing:`border-box`,cursor:`pointer`,display:`inline-flex`,font:`inherit`,gap:`6px`,justifyContent:`center`,lineHeight:`1`,padding:`0`,userSelect:`none`}),this.child(this._iconBox,this._labelBox),this._syncIconVisibility(),this._syncLabelVisibility(),this.variant(this._variant),this.size(this._size);let r=R(e,t,n);this._setupFloatButton(r.first),w(this,r.options,r.callback)}icon(e){return a(this._iconBox,S(e)),this._syncIconVisibility(),this}label(e){return a(this._labelBox,S(e)),this._syncLabelVisibility(),this}content(e){return this.label(e)}text(e){return this.label(e)}variant(t){if(t===void 0)return this._variant;this._variant=t||`primary`,this.attr(`data-variant`,this._variant);let n=this._variant===`primary`;return this.styles({background:D(n?`color-primary`:`color-surface`,n?`#2563eb`:`#ffffff`),border:n?`none`:e(`color-border-strong`,`#cbd5e1`),boxShadow:`0 6px 16px rgba(15, 23, 42, 0.16)`,color:D(n?`color-text-inverse`:`color-text`,n?`#ffffff`:`#172033`)}),this}type(e){return this.variant(e)}size(e){if(e===void 0)return this._size;this._size=e||`medium`,this.attr(`data-size`,this._size);let t=Vt[this._size]||Vt.medium;return this.style(`height`,t.height),this.style(`minWidth`,t.minWidth),this}disabled(e){return this.attr(`disabled`,e?!0:null),this.attr(`aria-disabled`,e?`true`:null),this.style(`cursor`,e?`not-allowed`:`pointer`),this.style(`opacity`,e?`0.56`:null),this}fixed(e=!0){return this._fixed=!!e,this._syncPosition(),this}position(e){return e===void 0?this._position:(this._position=Bt[e]?e:null,this._syncPosition(),this)}_syncPosition(){let e=this._fixed&&this._position?Bt[this._position]:null;return this.style(`position`,this._fixed?`fixed`:null),this.style(`zIndex`,this._fixed?`100`:null),this.style(`bottom`,e?.bottom??null),this.style(`left`,e?.left??null),this.style(`right`,e?.right??null),this.style(`top`,e?.top??null),this}_syncIconVisibility(){let e=this._iconBox.children().length>0||this._iconBox.textContent()!==``;return this.attr(`data-icon`,e?`true`:null),this._iconBox.style(`display`,e?null:`none`),this}_syncLabelVisibility(){let e=this._labelBox.children().length>0||this._labelBox.textContent()!==``;return this.attr(`data-label`,e?`true`:null),this.style(`paddingLeft`,e?`18px`:null),this.style(`paddingRight`,e?`18px`:null),this._labelBox.style(`display`,e?null:`none`),this}_setupFloatButton(e){if(typeof e==`function`){e(this);return}if(N(e)){let{attrs:t,children:n,disabled:r,fixed:i,icon:a,label:o,position:s,size:c,style:l,text:u,variant:d,...f}=e;Object.keys(f).length>0&&this.setup(f),A(this,{attrs:t,style:l}),a!==void 0&&this.icon(a),o===void 0?u===void 0?n!==void 0&&this.label(n):this.label(u):this.label(o),d!==void 0&&this.variant(d),c!==void 0&&this.size(c),r!==void 0&&this.disabled(r),i!==void 0&&this.fixed(i),s!==void 0&&this.position(s);return}e!=null&&this.label(e)}};function Ut(e=null,t=null,n=null){return new Ht(e,t,n)}var Wt=class extends y{constructor(e=null,t=null,n=null){super(`button`,null),this.className(E,`yoya-vsymbol-button`),this.attr(`type`,`button`),this.styles({alignItems:`center`,background:`transparent`,border:`0`,borderRadius:`6px`,boxShadow:`none`,boxSizing:`border-box`,color:`inherit`,cursor:`pointer`,display:`inline-flex`,flexShrink:`0`,justifyContent:`center`,lineHeight:`1`,margin:`0`,outline:`none`,padding:`4px`}),this.on(`mouseenter`,()=>{this.style(`background`,D(`color-surface-hover`,`rgba(15, 23, 42, 0.06)`))}),this.on(`mouseleave`,()=>{this.style(`background`,null)}),this._setupSymbolButton(e),w(this,t,n)}icon(e){return a(this,S(e)),this}ariaLabel(e){return e===void 0?this.attr(`aria-label`):this.attr(`aria-label`,e)}_setupSymbolButton(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{ariaLabel:t,icon:n,title:r,...i}=e;Object.keys(i).length>0&&this.setup(i),t!==void 0&&this.ariaLabel(t),r!==void 0&&this.attr(`title`,r),n!==void 0&&this.icon(n);return}this.icon(e)}}};function Gt(e=null,t=null,n=null){return T(Wt,e,t,n)}d(y,{vButton:gt,vButtons:yt,vContextMenu:Lt,vDropdownMenu:zt,vFloatButton:Ut,vSymbolButton:Gt});var Kt=class extends y{constructor(e=null){super(`nav`,null),this._activeHref=null,this._offset=80,this._target=null,this._trackingBound=!1,this._list=new y(`ul`).className(`yoya-vanchor-list`),this.className(E,`yoya-vanchor`),this.attr({"aria-label":`页面锚点`,"data-offset":`80`}),this.on(`click`,e=>this._handleAnchorClick(e)),super.child(this._list),this._setupAnchor(e),this._syncItems()}ariaLabel(e){let t=i(e)||`页面锚点`;return this.attr(`aria-label`,t),this}offset(e){return e===void 0?this._offset:(this._offset=Math.max(0,Number(i(e))||0),this.attr(`data-offset`,String(this._offset)),this)}target(e){return e===void 0?this._target:(this._target=e||null,this)}items(e){return e===void 0?this._list.children():(a(this._list,[]),Array.isArray(e)&&e.forEach(e=>{this._list.child(Xt(e))}),this._syncItems(),this)}child(...e){return this._list.child(...e),this._syncItems(),this}active(e){return e===void 0?this._activeHref:(this._activeHref=e||null,this._syncActiveState(),this)}activeHref(e){return this.active(e)}renderDom(){let e=super.renderDom();return this._bindScrollTracking(),e}destroy(){return this._trackingBound=!1,super.destroy()}_syncItems(){let e=this._list.children().filter(e=>e instanceof qt);return this.attr(`data-item-count`,String(e.length)),this._syncActiveState(),this}_syncActiveState(){let e=this._activeHref;this.attr(`data-active-href`,e||null);let t=n=>{n.forEach(n=>{n instanceof qt&&(n.active(n.href()===e),t(n._childrenBox.children()))})};return t(this._list.children()),this}_handleAnchorClick(e){let t=e.target.closest?.(`.yoya-vanchor-link`);if(!t||!this._list.renderDom().contains(t))return;let n=t.getAttribute(`href`);!n||!n.startsWith(`#`)||(e.preventDefault(),this._scrollToTarget(n))}_scrollToTarget(e){let t=this._resolveTargetElement(e);t&&this._scrollElementIntoView(t),typeof history<`u`&&typeof history.replaceState==`function`&&history.replaceState(null,``,e),this.active(e)}_scrollElementIntoView(e){let t=this._resolveScrollContainer(),n=this._targetTop(e);if(t===window||t===null){typeof window<`u`&&typeof window.scrollTo==`function`&&window.scrollTo({behavior:`smooth`,top:n});return}typeof t.scrollTo==`function`?t.scrollTo({behavior:`smooth`,top:n}):t.scrollTop=n}_resolveScrollContainer(){return this._target&&Zt(this._target)||(typeof window>`u`?null:window)}_resolveTargetElement(e){let t=String(e).replace(/^#/,``);if(!t)return null;let n=this._target?Zt(this._target):document;return n?typeof n.getElementById==`function`?n.getElementById(t):n.querySelector(`#${Qt(t)}`):null}_targetTop(e){let t=this._resolveScrollContainer(),n=this._offset||0;if(!t||t===window)return(typeof window<`u`&&(window.scrollY||document.documentElement?.scrollTop)||0)+e.getBoundingClientRect().top-n;let r=t.getBoundingClientRect();return t.scrollTop+e.getBoundingClientRect().top-r.top-n}_syncActiveFromScroll(){let e=this._resolveScrollContainer(),t=e&&e!==window&&typeof e.getBoundingClientRect==`function`?e.getBoundingClientRect():null,n=this._offset||0,r=[],i=e=>{e.forEach(e=>{e instanceof qt&&(r.push(e),i(e._childrenBox.children()))})};i(this._list.children());let a=null,o=!1;r.forEach(e=>{let r=e.href();if(!r)return;let i=this._resolveTargetElement(r);if(!i)return;o=!0;let s=i.getBoundingClientRect();(t?s.top-t.top:s.top)-n<=0&&(a=r)}),o&&a!==this._activeHref&&this.active(a)}_bindScrollTracking(){if(this._trackingBound)return;this._trackingBound=!0;let e=()=>this._syncActiveFromScroll(),t={capture:!0,passive:!0},n=P(`scroll`,e,t),r=x(`scroll`,e,t);this._cleanup.push(()=>{n(),r()}),this._syncActiveFromScroll()}_setupAnchor(e){if(e!=null){if(typeof e==`function`){e(this);return}if(Array.isArray(e)){this.items(e);return}if(N(e)){let{activeHref:t,ariaLabel:n,children:r,items:i,offset:a,target:o,...s}=e;Object.keys(s).length>0&&this.setup(s),n!==void 0&&this.ariaLabel(n),a!==void 0&&this.offset(a),o!==void 0&&this.target(o),i===void 0?r!==void 0&&this.items(r):this.items(i),t!==void 0&&this.active(t);return}this.items([e])}}},qt=class extends y{constructor(e=null,t=void 0){super(`li`,null),this._href=null,this._title=``,this._active=!1,this._linkBox=new y(`a`).className(`yoya-vanchor-link`),this._childrenBox=new y(`ul`).className(`yoya-vanchor-children`),this.className(`yoya-vanchor-item`),this.child(this._linkBox,this._childrenBox),this._setupAnchorItem(e),t!==void 0&&this.href(t),this._syncAnchorItem()}title(e){return e===void 0?this._title:(this._title=e,a(this._linkBox,S(e??``)),this)}text(e){return this.title(e)}label(e){return this.title(e)}href(e){return e===void 0?this._href:(this._href=e==null?null:String(i(e)),this._syncAnchorItem(),this)}nested(e){return e===void 0?this._childrenBox.children():(Array.isArray(e)?(a(this._childrenBox,[]),e.forEach(e=>{this._childrenBox.child(Xt(e))})):O(this._childrenBox,e),this._syncAnchorItem(),this)}subItems(e){return this.nested(e)}active(e=!0){return this._active=!!e,this.attr(`data-active`,this._active?`true`:null),this.attr(`aria-current`,this._active?`true`:null),this._syncAnchorItem(),this}_setupAnchorItem(e){if(e!=null){if(typeof e==`function`){e(this);return}if(Array.isArray(e)&&e.length>=2){this.title(e[0]),this.href(e[1]);return}if(N(e)){let{active:t,children:n,content:r,href:i,items:a,label:o,nested:s,text:c,title:l,...u}=e;Object.keys(u).length>0&&this.setup(u),l===void 0?o===void 0?c===void 0?r!==void 0&&this.text(r):this.text(c):this.label(o):this.title(l),i!==void 0&&this.href(i);let d=s??a??n;d!==void 0&&this.nested(d),t!==void 0&&this.active(t);return}this.title(e)}}_syncAnchorItem(){let e=this._childrenBox.children().length>0;return this._linkBox.attr(`href`,this._href||null),this._childrenBox.style(`display`,e?null:`none`),this.attr(`data-has-children`,e?`true`:null),this}};function Jt(e=null,t=null,n=null){return T(Kt,e,t,n)}function Yt(e=null,t=void 0){return e instanceof qt&&t===void 0?e:new qt(e,t)}function Xt(e){return e instanceof qt?e:Array.isArray(e)&&e.length>=2?Yt(e[0],e[1]):Yt(e)}function Zt(e){return typeof Element<`u`&&e instanceof Element?e:typeof e==`string`&&typeof document<`u`?document.querySelector(e):e||null}function Qt(e){return typeof CSS<`u`&&typeof CSS.escape==`function`?CSS.escape(e):e}var $t=class extends y{constructor(e=null){super(`nav`,null),this._separator=`›`,this._list=new y(`ol`).className(`yoya-vbreadcrumb-list`),this.className(E,`yoya-vbreadcrumb`),this.attr({"aria-label":`面包屑`,"data-separator":this._separator}),super.child(this._list),this._setupBreadcrumb(e),this._syncItems()}ariaLabel(e){let t=i(e)||`面包屑`;return this.attr(`aria-label`,t),this}separator(e){return e===void 0?this._separator:(this._separator=e===null||e===``?`›`:e,this.attr(`data-separator`,i(this._separator)),this._syncItems(),this)}items(e){return e===void 0?this._list.children():(a(this._list,[]),Array.isArray(e)&&e.forEach(e=>{this._list.child(rn(e))}),this._syncItems(),this)}child(...e){return this._list.child(...e),this._syncItems(),this}_syncItems(){let e=this._list.children().filter(e=>e instanceof en);return this.attr(`data-item-count`,String(e.length)),e.forEach((t,n)=>{t._breadcrumbIndex=n,t._breadcrumbTotal=e.length,t._breadcrumbSeparator=this._separator,t._syncBreadcrumbItem()}),this}_setupBreadcrumb(e){if(e!=null){if(typeof e==`function`){e(this);return}if(Array.isArray(e)){this.items(e);return}if(N(e)){let{ariaLabel:t,children:n,items:r,separator:i,...a}=e;Object.keys(a).length>0&&this.setup(a),t!==void 0&&this.ariaLabel(t),i!==void 0&&this.separator(i),r===void 0?n!==void 0&&this.items(n):this.items(r);return}this.items([e])}}},en=class extends y{constructor(e=null,t=void 0){super(`li`,null),this._href=null,this._active=!1,this._breadcrumbIndex=0,this._breadcrumbTotal=1,this._breadcrumbSeparator=`›`,this._linkBox=new y(`a`).className(`yoya-vbreadcrumb-link`),this._currentBox=new y(`span`).className(`yoya-vbreadcrumb-current`),this._separatorBox=new y(`span`).className(`yoya-vbreadcrumb-separator`).attr(`aria-hidden`,`true`),this.className(`yoya-vbreadcrumb-item`),this.child(this._linkBox,this._currentBox,this._separatorBox),this._setupBreadcrumbItem(e),t!==void 0&&this.href(t),this._syncBreadcrumbItem()}label(e){return e===void 0?this._currentBox.textContent():(a(this._linkBox,S(e)),a(this._currentBox,S(e)),this)}text(e){return this.label(e)}content(e){return this.label(e)}href(e){return e===void 0?this._href:(this._href=e==null?null:String(i(e)),this._syncBreadcrumbItem(),this)}to(e){return this.href(e)}active(e=!0){return this._active=!!e,this._syncBreadcrumbItem(),this}current(e=!0){return this.active(e)}_setupBreadcrumbItem(e){if(e!=null){if(typeof e==`function`){e(this);return}if(Array.isArray(e)&&e.length>=2){this.label(e[0]),this.href(e[1]);return}if(N(e)){let{active:t,children:n,content:r,current:i,href:a,label:o,text:s,to:c,...l}=e;Object.keys(l).length>0&&this.setup(l),o===void 0?s===void 0?r===void 0?n!==void 0&&this.label(n):this.content(r):this.text(s):this.label(o),a===void 0?c!==void 0&&this.href(c):this.href(a),t===void 0?i!==void 0&&this.active(i):this.active(t);return}this.label(e)}}_syncBreadcrumbItem(){let e=!this._active&&!!this._href,t=!e;return this.attr(`data-current`,this._active?`true`:null),this.attr(`aria-current`,this._active?`page`:null),this._linkBox.attr(`href`,this._href||null),this._linkBox.style(`display`,e?null:`none`),this._currentBox.style(`display`,t?null:`none`),this._separatorBox.style(`display`,this._breadcrumbIndex>=this._breadcrumbTotal-1?`none`:null),a(this._separatorBox,S(this._breadcrumbSeparator)),this}};function tn(e=null,t=null,n=null){return T($t,e,t,n)}function nn(e=null,t=void 0){return e instanceof en&&t===void 0?e:new en(e,t)}function rn(e){return e instanceof en?e:Array.isArray(e)&&e.length>=2?nn(e[0],e[1]):nn(e)}var an=class extends y{constructor(e=null){super(`nav`,null);let t=M(`yoya-vnavbar-menu`);this._brandTitle=new y(`strong`).className(`yoya-vnavbar-brand-title`),this._brandSubtitle=new y(`span`).className(`yoya-vnavbar-brand-subtitle`),this._brandDefault=new y(`div`).className(`yoya-vnavbar-brand-default`).child(this._brandTitle,this._brandSubtitle),this._brandCustom=new y(`div`).className(`yoya-vnavbar-brand-custom`),this._brandBox=new y(`div`).className(`yoya-vnavbar-brand`).child(this._brandDefault,this._brandCustom),this._menu=new bt().id(t).className(`yoya-vnavbar-menu`).attr(`aria-label`,`导航菜单`),this._menu.horizontal(),this._menuWrapper=new y(`div`).className(`yoya-vnavbar-menu-slot`).styles({boxSizing:`border-box`,minWidth:`0`,overflowX:`auto`}).child(this._menu),this._actionsBox=new y(`div`).className(`yoya-vnavbar-actions`),this.className(E,`yoya-vnavbar`),this.attr({"aria-label":`导航栏`,role:`navigation`}),this.child(this._brandBox,this._menuWrapper,this._actionsBox),this._setupNavbar(e)}ariaLabel(e){let t=i(e)||`导航栏`;return this.attr(`aria-label`,t),this._menu.attr(`aria-label`,`${t}菜单`),this}sticky(e=!0){if(e===void 0)return this.style(`position`)===`sticky`;let t=!!e;return this.styles({position:t?`sticky`:null,top:t?`0`:null,zIndex:t?`20`:null}),this}title(e){return this._showDefaultBrand(),a(this._brandTitle,S(e)),this._brandTitle.style(`display`,i(e)?null:`none`),this._syncBrandDivider(),this}subtitle(e){return this._showDefaultBrand(),a(this._brandSubtitle,S(e)),this._brandSubtitle.style(`display`,i(e)?null:`none`),this._syncBrandDivider(),this}brand(e){return e===void 0?this._brandBox:e===null?(this._showDefaultBrand(),this._syncBrandDivider(),this):(this._showCustomBrand(),O(this._brandCustom,e),this._syncBrandDivider(),this)}menuContent(e){return e===void 0?this._menu:(O(this._menu,e),this)}actions(e){return e===void 0?this._actionsBox:(O(this._actionsBox,e),this)}_showDefaultBrand(){return O(this._brandCustom,null),this._brandCustom.style(`display`,`none`),this._brandDefault.style(`display`,null),this}_showCustomBrand(){return this._brandDefault.style(`display`,`none`),this._brandCustom.style(`display`,`grid`),this}_syncBrandDivider(){let t=!!(this._brandDefault.textContent().trim()||this._brandCustom.textContent().trim());return this._brandBox.styles({borderRight:t?e(`color-border-faint`,`#e2e8f0`):null,paddingRight:t?`14px`:null}),this}_setupNavbar(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{actions:t,ariaLabel:n,brand:r,children:i,content:a,menu:o,menuContent:s,sticky:c,subtitle:l,title:u,...d}=e;Object.keys(d).length>0&&super._setupObject(d);let f=r!=null;r===void 0?u!==void 0&&this.title(u):this.brand(r),l!==void 0&&!f&&this.subtitle(l);let p=s??o??a??i;p!==void 0&&this.menuContent(p),t!==void 0&&this.actions(t),n!==void 0&&this.ariaLabel(n),c!==void 0&&this.sticky(c);return}j(this,e)}}};function on(e=null,t=null,n=null){return T(an,e,t,n)}var sn=class extends y{constructor(e=null){super(`ol`,null),this._current=0,this._status=`process`,this._direction=`horizontal`,this._size=`default`,this.className(E,`yoya-vsteps`),this.attr({"data-current":`0`,"data-direction":`horizontal`,"data-size":`default`,"data-status":`process`,role:`list`}),this._setupSteps(e),this._syncSteps()}current(e){return e===void 0?this._current:(this._current=Math.max(0,Number(e)||0),this.attr(`data-current`,String(this._current)),this._syncSteps(),this)}status(e){return e===void 0?this._status:(this._status=[`error`,`finish`,`process`].includes(e)?e:`process`,this.attr(`data-status`,this._status),this._syncSteps(),this)}direction(e){return e===void 0?this._direction:(this._direction=e===`vertical`?`vertical`:`horizontal`,this.attr(`data-direction`,this._direction),this._syncSteps(),this)}size(e){return e===void 0?this._size:(this._size=e===`small`?`small`:`default`,this.attr(`data-size`,this._size),this._syncSteps(),this)}items(e){return e===void 0?this.children().filter(e=>e instanceof cn):(a(this,[]),Array.isArray(e)&&e.forEach(e=>{this.child(dn(e))}),this)}next(){let e=this.items();return this._current<e.length-1&&this.current(this._current+1),this}prev(){return this._current>0&&this.current(this._current-1),this}child(...e){return super.child(...e),this._syncSteps(),this}_setupSteps(e){if(e!=null){if(typeof e==`function`){e(this);return}if(Array.isArray(e)){this.items(e);return}if(N(e)){let{children:t,current:n,direction:r,items:i,size:a,status:o,...s}=e;Object.keys(s).length>0&&this.setup(s),n!==void 0&&this.current(n),o!==void 0&&this.status(o),r!==void 0&&this.direction(r),a!==void 0&&this.size(a),i===void 0?t!==void 0&&this.items(t):this.items(i);return}this.items([e])}}_syncSteps(){let e=this.children().filter(e=>e instanceof cn);return this.attr(`data-step-count`,String(e.length)),e.forEach((t,n)=>{t._index=n,t._total=e.length,t._stepsCurrent=this._current,t._stepsStatus=this._status,t._stepsDirection=this._direction,t._stepsSize=this._size,t._syncStepState()}),this}},cn=class extends y{constructor(e=null){super(`li`,null),this._title=``,this._description=``,this._icon=null,this._status=null,this._index=0,this._total=1,this._stepsCurrent=0,this._stepsStatus=`process`,this._stepsDirection=`horizontal`,this._stepsSize=`default`,this._indicatorBox=new y(`span`).className(`yoya-vsteps-indicator`),this._titleBox=new y(`div`).className(`yoya-vsteps-title`),this._descriptionBox=new y(`div`).className(`yoya-vsteps-description`),this._contentBox=new y(`div`).className(`yoya-vsteps-content`),this._connector=new y(`span`).className(`yoya-vsteps-connector`),this.className(E,`yoya-vstep`),this.attr(`role`,`listitem`),this._contentBox.className(`yoya-vsteps-content`),this._titleBox.className(`yoya-vsteps-title`),this._descriptionBox.className(`yoya-vsteps-description`),this._connector.className(`yoya-vsteps-connector`),this.child(this._indicatorBox,this._contentBox,this._connector),this._contentBox.child(this._titleBox,this._descriptionBox),this._setupStep(e),this._syncStepState()}title(e){return e===void 0?this._title:(this._title=e,a(this._titleBox,S(e??``)),this)}text(e){return this.title(e)}description(e){return e===void 0?this._description:(this._description=e,a(this._descriptionBox,S(e??``)),this)}desc(e){return this.description(e)}icon(e){return e===void 0?this._icon:(this._icon=e,this._syncStepState(),this)}status(e){return e===void 0?this._status:(this._status=e||null,this._syncStepState(),this)}_setupStep(e){if(e!=null){if(typeof e==`function`){e(this);return}if(Array.isArray(e)&&e.length>=2){this.title(e[0]),this.description(e[1]);return}if(N(e)){let{children:t,desc:n,description:r,icon:i,status:a,text:o,title:s,...c}=e;Object.keys(c).length>0&&this.setup(c),i!==void 0&&this.icon(i),a!==void 0&&this.status(a),s===void 0?o!==void 0&&this.title(o):this.title(s),r===void 0?n===void 0?t!==void 0&&this.description(t):this.description(n):this.description(r);return}this.title(e)}}_effectiveStatus(){return this._status?this._status:this._index<this._stepsCurrent?`finish`:this._index===this._stepsCurrent?this._stepsStatus||`process`:`wait`}_syncStepState(){let e=this._effectiveStatus(),t=this._stepsSize,n=t===`small`?`24px`:`30px`,r=t===`small`?`11px`:`14px`,i=t===`small`?`12px`:`15px`;return this.attr(`data-status`,e),this.attr(`aria-current`,this._index===this._stepsCurrent?`step`:null),this._descriptionBox.style(`display`,this._descriptionBox.children().length>0?null:`none`),this._icon!==null&&this._icon!==void 0?a(this._indicatorBox,S(this._icon)):a(this._indicatorBox,S(fn(e,this._index))),this._connector.style(`display`,this._index<this._total-1?`block`:`none`),this._stepsDirection===`vertical`?(this.style(`gridTemplateColumns`,`auto minmax(0, 1fr)`),this.style(`gap`,`10px`),this._contentBox.style(`paddingTop`,`3px`),this._connector.styles({bottom:`-12px`,height:`auto`,left:i,right:null,top:n,width:`2px`})):(this.style(`gridTemplateColumns`,`minmax(0, 1fr)`),this.style(`gap`,`0`),this._contentBox.style(`paddingTop`,`6px`),this._connector.styles({bottom:null,height:`2px`,left:n,right:`0`,top:r,width:`auto`})),this}};function ln(e=null,t=null,n=null){return T(sn,e,t,n)}function un(e=null,t=null,n=null){return T(cn,e,t,n)}function dn(e){return e instanceof cn?e:un(e)}function fn(e,t){return e===`finish`?`✓`:e===`error`?`!`:String(t+1)}var pn=class extends o{constructor(e=null){super(null),this._active=!1,this._disabled=!1,this._index=0,this._key=null,this._parent=null;let t=te();this._tabId=`yoya-vtab-trigger-${t}`,this._panelId=`yoya-vtab-panel-${t}`,this._iconBox=new y(`span`).className(`yoya-vtab-icon`).attr(`aria-hidden`,`true`).style(`display`,`none`),this._labelBox=new y(`span`).className(`yoya-vtab-label`),this._trigger=new y(`button`).className(E,`yoya-vtab-trigger`).attr({"aria-controls":this._panelId,id:this._tabId,role:`tab`,tabindex:`-1`,type:`button`}),this._trigger.child(this._iconBox,this._labelBox),this._panel=new y(`section`).className(`yoya-vtab-panel`).attr({"aria-labelledby":this._tabId,hidden:!0,id:this._panelId,role:`tabpanel`,tabindex:`-1`}),this._setupTab(e),this._syncTab()}key(e){return e===void 0?this._key:(this._key=e==null?null:String(i(e)),this)}value(e){return this.key(e)}label(e){return e===void 0?this._labelBox.textContent():(a(this._labelBox,S(e)),this)}text(e){return this.label(e)}title(e){return this.label(e)}icon(e){return a(this._iconBox,S(e)),this._iconBox.style(`display`,e==null||e===``?`none`:null),this}content(e){return O(this._panel,e),this}disabled(e){return e===void 0?this._disabled:(this._disabled=!!e,this._trigger.attr({"aria-disabled":this._disabled?`true`:null,disabled:this._disabled?!0:null}),this._syncTab(),this)}active(e){return e===void 0?this._active:(this._active=!!e,this._syncTab(),this)}textContent(){return this._trigger.textContent()}destroy(){return this._trigger.destroy(),this._panel.destroy(),super.destroy()}_setupTab(e){if(e!=null){if(typeof e==`function`){e(this);return}if(Array.isArray(e)){e.length>0&&this.label(e[0]),e.length>1&&this.content(e[1]);return}if(N(e)){let{children:t,content:n,disabled:r,icon:i,key:a,label:o,text:s,title:c,value:l,...u}=e;Object.keys(u).length>0&&this._trigger.setup(u),o===void 0?s===void 0?c!==void 0&&this.label(c):this.label(s):this.label(o),n===void 0?t!==void 0&&this.content(t):this.content(n),i!==void 0&&this.icon(i),a===void 0?l!==void 0&&this.key(l):this.key(a),r!==void 0&&this.disabled(r);return}this.label(e)}}_syncTab(){let e=this._active&&!this._disabled;return this._trigger.attr({"aria-selected":e?`true`:`false`,"data-active":e?`true`:null,tabindex:e?`0`:`-1`}),this._panel.attr({"data-active":e?`true`:null,hidden:!e||null,tabindex:e?`0`:`-1`}),this}},mn=class extends y{constructor(e=null){super(`div`,null),this._tabs=[],this._activeIndex=0,this._orientation=`horizontal`,this._variant=`line`,this._size=`default`,this._changeHandler=null,this._nav=new y(`div`).className(`yoya-vtabs-nav`).attr({"aria-label":`标签页`,"aria-orientation":`horizontal`,role:`tablist`}),this._panels=new y(`div`).className(`yoya-vtabs-panels`),this.className(E,`yoya-vtabs`),this.attr({"data-active-index":`0`,"data-orientation":`horizontal`,"data-size":`default`,"data-variant":`line`}),this._nav.on(`click`,e=>this._handleNavClick(e)),this._nav.on(`keydown`,e=>this._handleKeydown(e)),y.prototype.child.call(this,this._nav,this._panels),this._setupTabs(e),this._syncTabs()}children(){return[...this._tabs]}items(e){return e===void 0?this.children():(a(this._nav,[]),a(this._panels,[]),this._tabs=[],Array.isArray(e)&&e.forEach(e=>this.child(_n(e))),this._syncTabs(),this)}child(...e){return e.flat(1/0).forEach(e=>{if(e!=null){if(e instanceof pn){this._tabs.includes(e)||(this._tabs.push(e),e._parent=this,this._nav.child(e._trigger),this._panels.child(e._panel));return}super.child(e)}}),this._syncTabs(),this}active(e){if(e===void 0){let e=this._tabs[this._activeIndex];return e?e.key()??this._activeIndex:null}return this._selectIndex(this._resolveIndex(e),!1),this}activeIndex(e){return e===void 0?this._activeIndex:(this._selectIndex(e,!1),this)}ariaLabel(e){return e===void 0?this._nav.attr(`aria-label`):(this._nav.attr(`aria-label`,i(e)||`标签页`),this)}orientation(e){return e===void 0?this._orientation:(this._orientation=e===`vertical`?`vertical`:`horizontal`,this.attr(`data-orientation`,this._orientation),this._nav.attr(`aria-orientation`,this._orientation),this)}variant(e){return e===void 0?this._variant:(this._variant=[`card`,`line`,`pills`].includes(e)?e:`line`,this.attr(`data-variant`,this._variant),this)}size(e){return e===void 0?this._size:(this._size=[`default`,`large`,`small`].includes(e)?e:`default`,this.attr(`data-size`,this._size),this)}change(e){return e===void 0?this._changeHandler:(this._changeHandler=typeof e==`function`?e:null,this)}onChange(e){return this.change(e)}next(){let e=this._nextEnabledIndex(1);return e>=0&&this._selectIndex(e,!0),this}prev(){let e=this._nextEnabledIndex(-1);return e>=0&&this._selectIndex(e,!0),this}renderDom(){let e=super.renderDom();return this._syncTabs(),e}_setupTabs(e){if(e!=null){if(typeof e==`function`){e(this);return}if(e instanceof pn){this.child(e);return}if(Array.isArray(e)){this.items(e);return}if(N(e)){let{active:t,ariaLabel:n,change:r,children:i,items:a,onChange:o,onTabChange:s,orientation:c,size:l,variant:u,...d}=e;Object.keys(d).length>0&&this.setup(d),n!==void 0&&this.ariaLabel(n),c!==void 0&&this.orientation(c),u!==void 0&&this.variant(u),l!==void 0&&this.size(l),typeof r==`function`?this.change(r):typeof o==`function`?this.change(o):typeof s==`function`&&this.change(s),a===void 0?i!==void 0&&this.items(i):this.items(a),t!==void 0&&this.active(t);return}this.items([e])}}_syncTabs(){let e=this._tabs;if(e.length>0&&e[this._activeIndex]?.disabled()){let t=e.findIndex(e=>!e.disabled());t>=0&&(this._activeIndex=t)}let t=e[this._activeIndex];return this.attr(`data-active-index`,String(this._activeIndex)),this.attr(`data-tab-count`,String(e.length)),this.attr(`data-active-key`,t?.key()==null?null:String(t.key())),e.forEach((e,t)=>{e._parent=this,e._index=t,e.active(t===this._activeIndex&&!e.disabled())}),this}_selectTab(e){let t=this._tabs.indexOf(e);return t<0||e.disabled()?this:this._selectIndex(t,!0)}_selectIndex(e,t=!0){let n=this._tabs;if(n.length===0)return this._activeIndex=0,this._syncTabs(),this;let r=this._clampIndex(e);if(n[r]?.disabled()){let e=n.findIndex(e=>!e.disabled());r=e>=0?e:this._activeIndex}let i=r!==this._activeIndex;if(this._activeIndex=r>=0?r:this._activeIndex,this._syncTabs(),t&&i&&typeof this._changeHandler==`function`){let e=n[this._activeIndex];this._changeHandler({active:e.key()??this._activeIndex,index:this._activeIndex,item:e,key:e.key()})}return this}_resolveIndex(e){let t=this._tabs;if(typeof e==`number`)return this._clampIndex(e);let n=i(e),r=t.findIndex(e=>String(e.key())===String(n));if(r>=0)return r;let a=Number(n);return this._clampIndex(Number.isFinite(a)?a:0)}_clampIndex(e){if(!Number.isFinite(Number(e)))return 0;let t=Math.max(0,Math.floor(Number(e)));return this._tabs.length===0?0:Math.min(t,this._tabs.length-1)}_handleNavClick(e){let t=e.target.closest?.(`.yoya-vtab-trigger`);if(!t||t.closest(`.yoya-vtabs-nav`)!==this._nav._el)return;let n=this._tabs.find(e=>e._trigger._el===t);n&&!n.disabled()&&this._selectTab(n)}_handleKeydown(e){let t=e.target.closest?.(`.yoya-vtab-trigger`);if(!t||t.closest(`.yoya-vtabs-nav`)!==this._nav._el)return;let n=this._tabs.findIndex(e=>e._trigger._el===t);if(n<0)return;if(e.key===`Enter`||e.key===` `){e.preventDefault(),this._selectTab(this._tabs[n]);return}let r=this._orientation===`vertical`?{ArrowDown:1,ArrowUp:-1}:{ArrowLeft:-1,ArrowRight:1},i=this._enabledTabs();if(i.length===0||!r[e.key]&&e.key!==`Home`&&e.key!==`End`)return;e.preventDefault();let a;a=e.key===`Home`?0:e.key===`End`?i.length-1:(Math.max(0,i.indexOf(this._tabs[n]))+r[e.key]+i.length)%i.length;let o=i[a];if(!o)return;let s=this._tabs.indexOf(o);this._selectIndex(s,!0),o._trigger._el?.focus()}_enabledTabs(){return this._tabs.filter(e=>!e.disabled())}_nextEnabledIndex(e){let t=this._enabledTabs();if(t.length===0)return-1;let n=Math.max(0,t.indexOf(this._tabs[this._activeIndex]));return this._tabs.indexOf(t[(n+e+t.length)%t.length])}};function hn(e=null,t=null,n=null){return T(mn,e,t,n)}function gn(e=null,t=null,n=null){return T(pn,e,t,n)}function _n(e){return e instanceof pn?e:gn(e)}d(y,{vAnchor:Jt,vAnchorItem:Yt,vBreadcrumb:tn,vBreadcrumbItem:nn,vMenu:At,vMenuDivider:Mt,vMenuGroup:Nt,vMenuItem:jt,vNavbar:on,vSidebar:Ft,vStep:un,vSteps:ln,vSubMenu:Pt,vTabs:hn}),d(mn,{vTab:gn});const vn=[`success`,`error`,`warning`,`info`];var yn=class extends y{constructor(t=null){super(`div`,null),this._closeHandlers=[],this._countdownDuration=0,this._countdownTimer=null,this._contentBox=new y(`span`).className(`yoya-vmessage-content`),this._countdownBox=new y(`span`).className(`yoya-vmessage-countdown`).attr(`aria-hidden`,`true`).styles({color:`inherit`,flexShrink:`0`,fontVariantNumeric:`tabular-nums`,fontSize:`12px`,opacity:`0.65`}).style(`display`,`none`),this._countdownText=m(``),this._countdownBox.child(this._countdownText),this._closeButton=new y(`span`).className(`yoya-vmessage-close`).attr({role:`button`,tabindex:`0`,"aria-label":`关闭消息`}).styles({alignItems:`center`,background:`transparent`,border:`0`,borderRadius:`50%`,color:`inherit`,cursor:`pointer`,display:`inline-flex`,flexShrink:`0`,height:`20px`,justifyContent:`center`,marginLeft:`auto`,opacity:`0.72`,padding:`0`,width:`20px`}).style(`display`,`none`).child(l().styles({height:`14px`,width:`14px`})).on(`click`,()=>this.close()).on(`keydown`,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.close())}),this._progressBar=new y(`span`).className(`yoya-vmessage-countdown-bar`).attr(`aria-hidden`,`true`).styles({background:`currentColor`,bottom:`0`,height:`2px`,left:`0`,opacity:`0`,position:`absolute`,width:`100%`}),this.className(E,`yoya-vmessage`),this.attr(`role`,`status`),this.styles({alignItems:`center`,background:D(`color-info-subtle`,`#eff6ff`),border:e(`color-info-border`,`#bfdbfe`),borderRadius:`6px`,color:D(`color-info-text`,`#1e3a8a`),display:`flex`,gap:`10px`,lineHeight:`1.4`,overflow:`hidden`,padding:`10px 12px`,position:`relative`}),this.child(this._contentBox,this._countdownBox,this._closeButton,this._progressBar),this.type(`info`),this._setupMessage(t)}content(e){return a(this._contentBox,S(e)),this}type(e){if(e===void 0)return this.attr(`data-type`);let t=vn.includes(e)?e:`info`;return this.attr(`data-type`,t),this.styles(ie(t)),this}closable(e=!0){return this._closeButton.style(`display`,e?null:`none`),this}countdown(e,t=!0){if(e===void 0)return this._countdownDuration;this._clearCountdown(),this._countdownDuration=Number(e)||0;let n=!!t&&this._countdownDuration>0;if(this._countdownBox.style(`display`,n?null:`none`),this._progressBar.style(`opacity`,n?`0.45`:`0`),!n)return this;this._countdownText.textContent(`${Math.ceil(this._countdownDuration/1e3)}s`),this._progressBar.style(`width`,`100%`);let r=Date.now();return this._countdownTimer=setInterval(()=>{let e=Math.max(0,this._countdownDuration-(Date.now()-r));this._countdownText.textContent(`${Math.ceil(e/1e3)}s`),this._progressBar.style(`width`,`${Math.max(0,e/this._countdownDuration*100)}%`),e<=0&&this._clearCountdown()},100),this}onClose(e){return typeof e==`function`&&this._closeHandlers.push(e),this}close(){return this._deleted?this:(this._closeHandlers.forEach(e=>e(this)),this.destroy())}destroy(){return this._clearCountdown(),super.destroy()}_clearCountdown(){this._countdownTimer&&=(clearInterval(this._countdownTimer),null)}_setupMessage(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{children:t,closable:n,content:r,countdown:i,duration:a,text:o,type:s,...c}=e;Object.keys(c).length>0&&this.setup(c),r===void 0?o===void 0?t!==void 0&&this.content(t):this.content(o):this.content(r),s!==void 0&&this.type(s),n!==void 0&&this.closable(n),a!==void 0&&this.countdown(a,i!==!1);return}this.content(e)}}},bn=class extends y{constructor(e=null){super(`div`,null),this._nextId=1,this._messages=new Map,this._inline=!1,this.className(E,`yoya-vmessage-container`),this.attr({"aria-live":`polite`,"data-placement":`top-right`}),this.styles({display:`flex`,flexDirection:`column`,gap:`8px`,maxWidth:`360px`,position:`fixed`,right:`16px`,top:`16px`,zIndex:`1000`}),this._setupContainer(e)}placement(e){return e===void 0?this.attr(`data-placement`):(this.attr(`data-placement`,e||`top-right`),this.styles(F(e||`top-right`)),this)}inline(e=!0){return this._inline=!!e,this._inline?(this.styles({bottom:null,left:null,maxWidth:`none`,position:`static`,right:null,top:null,transform:null,width:`100%`,zIndex:null}),this):(this.styles({display:`flex`,flexDirection:`column`,gap:`8px`,maxWidth:`360px`,position:`fixed`,zIndex:`1000`}),this.placement(this.placement()||`top-right`),this)}show(e,t={}){let n=h(t),r=n.id||`message-${this._nextId++}`;this._messages.has(r)&&this.close(r);let i=xn(e).type(n.type||`info`).closable(n.closable??!0).onClose(()=>{let e=this._messages.get(r);e?.timer&&clearTimeout(e.timer),_(this,i),this._messages.delete(r)});if(this._messages.set(r,{message:i,timer:null}),this.child(i),n.duration!==0){let e=n.duration??3e3;i.countdown(e,n.countdown!==!1);let t=setTimeout(()=>this.close(r),e);this._messages.set(r,{message:i,timer:t})}return r}success(e,t={}){return this.show(e,{...h(t),type:`success`})}error(e,t={}){return this.show(e,{...h(t),type:`error`})}warning(e,t={}){return this.show(e,{...h(t),type:`warning`})}info(e,t={}){return this.show(e,{...h(t),type:`info`})}close(e){let t=this._messages.get(e);return t?(t.timer&&clearTimeout(t.timer),t.message.close(),this._messages.delete(e),this):this}clear(){return[...this._messages.keys()].forEach(e=>this.close(e)),this}destroy(){return this.clear(),super.destroy()}_setupContainer(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{inline:t,placement:n,...r}=e;Object.keys(r).length>0&&this.setup(r),n!==void 0&&this.placement(n),t!==void 0&&this.inline(t)}}}};function xn(e=null,t=null,n=null){return T(yn,e,t,n)}function Sn(e=null,t=null,n=null){return T(bn,e,t,n)}const Cn={_container:null,use(e){return this._container=e,this},container(){return this._container||(this._container=Sn(),typeof document<`u`&&document.body&&this._container.bindTo(document.body)),this._container},show(e,t={}){return this.container().show(e,t)},success(e,t={}){return this.container().success(e,t)},error(e,t={}){return this.container().error(e,t)},warning(e,t={}){return this.container().warning(e,t)},info(e,t={}){return this.container().info(e,t)},close(e){return this.container().close(e)},clear(){return this.container().clear()}};var wn=class extends y{constructor(e=null){super(`dialog`,null),this.className(E,`yoya-vdialog`),this.styles({background:D(`color-surface`,`#ffffff`),border:`none`,borderRadius:`10px`,boxSizing:`border-box`,color:D(`color-text`,`#172033`),maxWidth:`min(92vw, 680px)`,padding:`16px`,boxShadow:`0 24px 72px rgba(15, 23, 42, 0.2)`,position:`relative`,width:`100%`}),this.attr(`aria-modal`,`true`),this.attr(`role`,`dialog`),this._pendingOpenSync=!1,this._closable=!0,this._closeHandler=null,this._closeButton=new y(`button`).className(`yoya-vdialog-close`).attr({type:`button`,"aria-label":`关闭`}).styles({alignItems:`center`,background:`transparent`,border:`0`,borderRadius:`50%`,boxSizing:`border-box`,color:D(`color-text-secondary`,`#57606a`),cursor:`pointer`,display:`inline-flex`,font:`inherit`,height:`28px`,justifyContent:`center`,lineHeight:`1`,marginBottom:`4px`,marginLeft:`auto`,padding:`0`,width:`28px`}).text(`×`).on(`click`,()=>this.close()),this._header=new y(`div`).className(`yoya-vdialog-header`).styles({alignItems:`center`,display:`flex`}),this._header.child(this._closeButton),this._content=new y(`div`).className(`yoya-vdialog-content`),this.child(this._header,this._content),this.on(`cancel`,e=>{e.preventDefault(),this.close()}),this.on(`close`,()=>{this.setState(`open`,!1),this.attr(`data-open`,null),this.attr(`open`,null)}),this._setupDialog(e)}content(e){return a(this._content,[]),typeof e==`function`?(e(this._content),this):(a(this._content,S(e)),this)}open(e=!0){let t=!!e,n=this.getBooleanState(`open`);return this.setState(`open`,t),this.attr(`data-open`,t?`true`:null),t?this._openElement():(n&&typeof this._closeHandler==`function`&&this._closeHandler(),this._closeElement()),this}close(){return this.open(!1)}onClose(e){return e===void 0?this._closeHandler:(this._closeHandler=typeof e==`function`?e:null,this)}closable(e=!0){return this._closable=!!e,this._header.style(`display`,this._closable?null:`none`),this}renderDom(){let e=super.renderDom();return this.getBooleanState(`open`)&&this._scheduleOpenSync(),e}_setupDialog(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{children:t,closable:n,content:r,onClose:i,open:a,...o}=e;Object.keys(o).length>0&&this.setup(o),r===void 0?t!==void 0&&this.content(t):this.content(r),n!==void 0&&this.closable(n),i!==void 0&&this.onClose(i),a!==void 0&&this.open(a);return}this.content(e)}}_openElement({defer:e=!0}={}){if(this.style(`display`,null),!this._el){this.attr(`open`,null);return}if(typeof this._el.showModal!=`function`){this.attr(`open`,!0);return}if(!this._el.isConnected){this.attr(`open`,null),e&&this._scheduleOpenSync();return}try{this._el.open&&!this._isModal()&&this.attr(`open`,null),this._el.open||this._el.showModal(),this.attr(`open`,!0)}catch{this.attr(`open`,!0)}}_closeElement(){if(this._el&&typeof this._el.close==`function`)try{this._el.open&&this._el.close()}catch{}this.attr(`open`,null),this._el&&typeof this._el.showModal!=`function`?this.style(`display`,`none`):this.style(`display`,null)}_scheduleOpenSync(){this._pendingOpenSync||(this._pendingOpenSync=!0,queueMicrotask(()=>{this._pendingOpenSync=!1,this.getBooleanState(`open`)&&this._openElement({defer:!1})}))}_isModal(){if(!this._el||typeof this._el.matches!=`function`)return!1;try{return this._el.matches(`:modal`)}catch{return!1}}};function Tn(e=null,t=null,n=null){return T(wn,e,t,n)}const En={bottom:{left:`50%`,top:`calc(100% + 8px)`,transform:`translateX(-50%)`},"bottom-end":{right:`0`,top:`calc(100% + 8px)`},"bottom-start":{left:`0`,top:`calc(100% + 8px)`},left:{right:`calc(100% + 8px)`,top:`50%`,transform:`translateY(-50%)`},"left-end":{right:`calc(100% + 8px)`,top:`0`},"left-start":{bottom:`0`,right:`calc(100% + 8px)`},right:{left:`calc(100% + 8px)`,top:`50%`,transform:`translateY(-50%)`},"right-end":{left:`calc(100% + 8px)`,top:`0`},"right-start":{bottom:`0`,left:`calc(100% + 8px)`},top:{bottom:`calc(100% + 8px)`,left:`50%`,transform:`translateX(-50%)`},"top-end":{bottom:`calc(100% + 8px)`,right:`0`},"top-start":{bottom:`calc(100% + 8px)`,left:`0`}},Dn={bottom:null,left:null,right:null,top:null,transform:null},On={"bottom-left":`bottom-start`,bottomLeft:`bottom-start`,"bottom-right":`bottom-end`,bottomRight:`bottom-end`,"left-bottom":`left-end`,leftBottom:`left-end`,"left-top":`left-start`,leftTop:`left-start`,"right-bottom":`right-end`,rightBottom:`right-end`,"right-top":`right-start`,rightTop:`right-start`,"top-left":`top-start`,topLeft:`top-start`,"top-right":`top-end`,topRight:`top-end`},kn=[`click`,`focus`,`manual`];var An=class extends y{constructor(e=null){super(`div`,null),this._triggerMode=`hover`,this._globalCloseCleanup=null,this._panelId=M(`yoya-vtooltip-panel`),this._target=new y(`span`).className(`yoya-vtooltip-target`).attr(`aria-describedby`,this._panelId).on(`mouseenter`,()=>this._handleHoverEnter()).on(`mouseleave`,()=>this._handleHoverLeave()).on(`focusin`,()=>this._handleFocusEnter()).on(`focusout`,e=>this._handleFocusLeave(e)).on(`click`,e=>this._handleTargetClick(e)),this._panel=new y(`div`).id(this._panelId).className(`yoya-vtooltip-panel`).attr({"aria-hidden":`true`,role:`tooltip`}),this.className(E,`yoya-vtooltip`),this.child(this._target,this._panel),this.placement(`top`),this.trigger(`hover`),this._setupTooltip(e)}target(e){return e===void 0?this._target:(O(this._target,e),this)}content(e){return e===void 0?this._panel.children():(O(this._panel,e),this)}placement(e){if(e===void 0)return this.attr(`data-placement`);let t=e||`top`,n=On[t]||t;return this.attr(`data-placement`,n),this._panel.styles(Mn(n)),this}trigger(e){if(e===void 0)return this._triggerMode;let t=String(e||`hover`);return this._triggerMode=kn.includes(t)?t:`hover`,this.attr(`data-trigger`,this._triggerMode),this}open(e=!0){let t=!!e;return this.setState(`open`,t),this.attr(`data-open`,t?`true`:null),this._panel.attr(`aria-hidden`,t?`false`:`true`),t?this._bindGlobalCloseHandlers():this._releaseGlobalCloseHandlers(),this}close(){return this.open(!1)}toggle(){return this.open(!this.getBooleanState(`open`))}destroy(){return this.close(),super.destroy()}_bindGlobalCloseHandlers(){if(this._globalCloseCleanup)return;let e=!1,t=()=>{},n=e=>{this._el?.contains(e.target)||this.close()},r=e=>{if(e.key!==`Escape`)return;let t=!!this._el?.contains(e.target);this.close(),t&&this._focusTarget()};this._triggerMode===`click`&&(t=x(`click`,n),e=!0);let i=x(`keydown`,r);this._globalCloseCleanup=()=>{e&&t(),i(),this._globalCloseCleanup=null}}_releaseGlobalCloseHandlers(){this._globalCloseCleanup&&this._globalCloseCleanup()}_handleHoverEnter(){this._triggerMode===`hover`&&this.open(!0)}_handleHoverLeave(){this._triggerMode===`hover`&&this.close()}_handleFocusEnter(){(this._triggerMode===`hover`||this._triggerMode===`focus`)&&this.open(!0)}_handleFocusLeave(e){(this._triggerMode===`hover`||this._triggerMode===`focus`)&&(e.relatedTarget&&this._target._el?.contains(e.relatedTarget)||this.close())}_handleTargetClick(){this._triggerMode===`click`&&this.toggle()}_focusTarget(){(this._target._el?.querySelector?.(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)||this._target._el)?.focus?.()}_setupTooltip(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{children:t,content:n,open:r,placement:i,target:a,trigger:o,...s}=e;Object.keys(s).length>0&&this.setup(s),a===void 0?t!==void 0&&this.target(t):this.target(a),n!==void 0&&this.content(n),i!==void 0&&this.placement(i),o!==void 0&&this.trigger(o),r!==void 0&&this.open(r);return}this.target(e)}}};function jn(e=null,t=null,n=null){return T(An,e,t,n)}function Mn(e){return{...Dn,...En[e]||En.top}}var Nn=class extends o{constructor(e=null){super(),this._container=e instanceof bn?e:e&&typeof e==`object`&&e.container instanceof bn?e.container:Sn(e),this._destroyed=!1}container(){return this._container}bindTo(e){return this._destroyed||this._container.bindTo(e),this}renderDom(){return this._destroyed?null:this._container.renderDom()}toHTML(){return this._destroyed?``:this._container.toHTML()}show(e,t={}){return this._destroyed?null:this._container.show(e,t)}success(e,t={}){return this._showType(`success`,e,t)}error(e,t={}){return this._showType(`error`,e,t)}warning(e,t={}){return this._showType(`warning`,e,t)}info(e,t={}){return this._showType(`info`,e,t)}close(e){return this._destroyed||this._container.close(e),this}clear(){return this._destroyed||this._container.clear(),this}destroy(){return this._destroyed||(this._destroyed=!0,this._container.destroy(),super.destroy()),this}_showType(e,t,n){return this._destroyed?null:this._container[e](t,n)}};function Pn(e=null,t=null,n=null){let r=R(e,t,n),i=r.first instanceof Nn?r.first:new Nn(r.first);return w(i,r.options,r.callback)}function Fn(e={}){let{title:t,content:n=``,confirmText:r=`确定`,cancelText:i=`取消`,danger:a=!1,onConfirm:o=null,onCancel:s=null}=e||{};return typeof document>`u`?Promise.resolve(!1):new Promise(e=>{let c=!1,l=!1,u=t=>{c||(c=!0,g.destroy(),h.close(),h.destroy(),t&&typeof o==`function`&&o(),!t&&typeof s==`function`&&s(),e(t))},d=gt(r,e=>{e.variant(a?`danger`:`primary`),e.on(`click`,()=>{if(l||c)return;let t=!o||o();if(t&&typeof t.then==`function`)l=!0,e.loading(!0),Promise.resolve(t).then(t=>{l=!1,e.loading(!1),t!==!1&&u(!0)});else if(t===!1)return;else u(!0)})}),f=gt(i,e=>{e.variant(`secondary`),e.on(`click`,()=>u(!1))}),p=new y(`div`).className(`yoya-vconfirm-content`).child(t?new y(`div`).className(`yoya-vconfirm-title`).text(t):null).child(new y(`div`).className(`yoya-vconfirm-message`).text(n)),m=pe({direction:`row`,gap:`8px`,justify:`flex-end`},e=>{e.child(d,f)}),h=Tn(e=>{e.content(pe({gap:`14px`}).child(p,m)),e.onClose(()=>u(!1))});h.bindTo(document.body),h.open(!0);let g=ee(h.renderDom(),{onEscape:()=>u(!1)});g.activate()})}d(y,{vDialog:Tn,vMessage:xn,vMessageContainer:Sn,vTooltip:jn});var Y=class extends y{constructor(e=null){super(`div`,null),this._allowClear=!0,this._allowHalf=!1,this._character=`★`,this._count=5,this._disabled=!1,this._error=!1,this._focused=!1,this._hoverValue=0,this._name=``,this._readonly=!1,this._required=!1,this._size=22,this._stars=null,this._value=0,this._input=new y(`input`).className(`yoya-vrate-input`).attr({"aria-hidden":`true`,max:`5`,min:`0`,step:`1`,tabindex:`-1`,type:`range`}).style(`display`,`none`),this._starsBox=new y(`div`).className(`yoya-vrate-stars`).attr({"aria-label":`评分`,role:`radiogroup`,tabindex:`0`}).styles({alignItems:`center`,borderRadius:`8px`,display:`inline-flex`,gap:`2px`,minWidth:`0`,outline:`none`,padding:`4px`,transition:`box-shadow 120ms ease`}),this.className(E,`yoya-vrate`),this.styles({display:`inline-grid`,gap:`6px`,minWidth:`0`}),this.child(this._input,this._starsBox),this._starsBox.on(`keydown`,e=>this._handleKeydown(e)),this._starsBox.on(`focusin`,()=>this._setFocused(!0)),this._starsBox.on(`focusout`,()=>this._setFocused(!1)),this._setupRate(e),this._sync()}value(e){if(e===void 0)return this._value;let t=this._normalizeValue(e);return t!==this._value&&(this._value=t,this._sync()),this}count(e){if(e===void 0)return this._count;let t=Math.max(1,Math.trunc(Number(e))||1);return t!==this._count&&(this._count=t,this._value=this._normalizeValue(this._value),this._sync()),this}max(e){return this.count(e)}allowHalf(e){if(e===void 0)return this._allowHalf;let t=!!e;return t!==this._allowHalf&&(this._allowHalf=t,this._value=this._normalizeValue(this._value),this._sync()),this}allowClear(e){return e===void 0?this._allowClear:(this._allowClear=!!e,this.attr(`data-allow-clear`,this._allowClear?`true`:null),this)}clearable(e){return this.allowClear(e)}character(e){return e===void 0?this._character:(this._character=i(e)||`★`,this._renderStars(),this)}size(e){return e===void 0?this._size:(this._size=Math.max(12,Number(e)||22),this._renderStars(),this)}name(e){return e===void 0?this._name:(this._name=i(e),this._input.attr(`name`,this._name||null),this.attr(`data-name`,this._name||null),this)}disabled(e){return e===void 0?this._disabled:(this._disabled=!!e,this._syncState(),this)}readonly(e){return e===void 0?this._readonly:(this._readonly=!!e,this._syncState(),this)}required(e){return e===void 0?this._required:(this._required=!!e,this._input.attr(`required`,this._required?!0:null),this.attr(`data-required`,this._required?`true`:null),this)}error(e){return e===void 0?this._error:(this._error=!!e,this._syncState(),this)}clear(){return this._value!==0&&!this._disabled&&!this._readonly&&this._setValue(0,!0),this}_sync(){return this._syncInput(),this._syncState(),!this._stars||this._stars.length!==this._count?this._renderStars():this._syncStars(),this}_syncInput(){return this._input.attr({max:String(this._count),min:`0`,step:this._allowHalf?`0.5`:`1`,value:String(this._value)}),this}_syncState(){return this.attr(`data-value`,String(this._value)),this.attr(`data-count`,String(this._count)),this.attr(`data-allow-half`,this._allowHalf?`true`:null),this.attr(`data-allow-clear`,this._allowClear?`true`:null),this.attr(`data-disabled`,this._disabled?`true`:null),this.attr(`data-readonly`,this._readonly?`true`:null),this.attr(`data-error`,this._error?`true`:null),this.attr(`data-hover-value`,this._hoverValue>0?String(this._hoverValue):null),this._input.attr(`disabled`,this._disabled?!0:null),this._starsBox.attr(`aria-disabled`,this._disabled?`true`:null),this._starsBox.attr(`aria-invalid`,this._error?`true`:null),this._starsBox.attr(`aria-readonly`,this._readonly?`true`:null),this._starsBox.attr(`tabindex`,this._disabled?`-1`:`0`),this.style(`opacity`,this._disabled?`0.64`:`1`),this._starsBox.style(`boxShadow`,this._error?`0 0 0 1px ${D(`color-danger-ring`,`rgba(220, 38, 38, 0.2)`)}`:this._focused?`0 0 0 3px ${D(`color-primary-ring`,`rgba(37, 99, 235, 0.22)`)}`:null),this}_renderStars(){a(this._starsBox,[]),this._stars=[];for(let e=1;e<=this._count;e+=1){let t=this._createStar(e);this._stars.push(t),this._starsBox.child(t)}return this._syncStars(),this}_createStar(e){let t=new y(`button`).className(`yoya-vrate-star`).attr({"aria-checked":`false`,"aria-label":`${e} 分`,"data-value":String(e),role:`radio`,tabindex:`-1`,type:`button`}).styles({alignItems:`center`,background:`transparent`,border:`none`,borderRadius:`4px`,boxSizing:`border-box`,display:`inline-flex`,flex:`0 0 auto`,fontSize:`${this._size}px`,height:`${this._size+8}px`,justifyContent:`center`,lineHeight:`1`,margin:`0`,padding:`0`,position:`relative`,width:`${this._size+8}px`}),n=new y(`span`).className(`yoya-vrate-star-base`).styles({alignItems:`center`,color:D(`color-border-muted`,`#94a3b8`),display:`flex`,inset:`0`,justifyContent:`center`,lineHeight:`1`,position:`absolute`}).text(this._character),r=new y(`span`).className(`yoya-vrate-star-fill`).styles({alignItems:`center`,clipPath:`inset(0 100% 0 0)`,color:D(`color-warning`,`#f59e0b`),display:`flex`,inset:`0`,justifyContent:`center`,lineHeight:`1`,overflow:`hidden`,position:`absolute`,WebkitClipPath:`inset(0 100% 0 0)`}).text(this._character);return t.child(n,r),t.on(`click`,t=>{t.preventDefault(),this._selectStar(e,t)}),t.on(`mouseenter`,t=>this._setHover(e,t)),t.on(`mouseleave`,()=>this._setHover(0)),t}_syncStars(){let e=this._hoverValue>0?this._hoverValue:this._value,t=this._allowHalf&&this._value%1!=0?Math.ceil(this._value):Math.round(this._value);return this._stars.forEach((n,r)=>{let i=r+1,a=this._starFillRatio(i,e),o=this._value===i||this._allowHalf&&this._value===i-.5,s=n.children()[1];n.attr(`aria-checked`,o?`true`:`false`),n.attr(`data-filled`,a>0?`true`:null),n.attr(`data-half`,a>0&&a<1?`true`:null),n.attr(`tabindex`,i===t?`0`:`-1`),n.style(`cursor`,this._disabled?`not-allowed`:this._readonly?`default`:`pointer`);let c=`${Math.round((1-a)*100)}%`;s.style(`clipPath`,`inset(0 ${c} 0 0)`),s.style(`WebkitClipPath`,`inset(0 ${c} 0 0)`),s.style(`color`,a>0?D(`color-warning`,`#f59e0b`):`transparent`)}),this}_starFillRatio(e,t){return t>=e?1:this._allowHalf&&t===e-.5?.5:0}_normalizeValue(e){let t=Number(e);return Number.isFinite(t)||(t=0),t=this._allowHalf?Math.round(t*2)/2:Math.round(t),Math.max(0,Math.min(this._count,t))}_selectStar(e,t){if(this._disabled||this._readonly)return;let n=this._pointerValue(e,t);this._allowClear&&n===this._value&&(n=0),this._setValue(n,!0)}_setHover(e,t){this._disabled||this._readonly||(this._hoverValue=e>0?this._pointerValue(e,t):0,this._syncStars(),this.attr(`data-hover-value`,this._hoverValue>0?String(this._hoverValue):null))}_pointerValue(e,t){if(!this._allowHalf||!t)return e;let n=t.currentTarget?.getBoundingClientRect?.();return n?.width&&t.offsetX<n.width/2?e-.5:e}_setValue(e,t){let n=this._normalizeValue(e);return this._hoverValue=0,n!==this._value&&(this._value=n,this._sync(),t&&this._emitChange()),this}_handleKeydown(e){if(this._disabled||this._readonly)return;let t=this._allowHalf?.5:1,n=null;if(e.key===`ArrowRight`||e.key===`ArrowUp`)n=this._value+t;else if(e.key===`ArrowLeft`||e.key===`ArrowDown`)n=this._value-t;else if(e.key===`Home`)n=this._allowHalf?.5:1;else if(e.key===`End`)n=this._count;else if(e.key===`Enter`||e.key===` `){this._hoverValue>0?this._selectStar(this._hoverValue):this._allowClear&&this._value>0&&this._setValue(0,!0),e.preventDefault();return}n!==null&&(e.preventDefault(),this._setValue(n,!0))}_setFocused(e){this._focused=e,this.attr(`data-focused`,e?`true`:null),this._syncState()}_emitChange(){if(!this._el)return;let e=this._el.ownerDocument?.defaultView?.CustomEvent||CustomEvent;this._el.dispatchEvent(new e(`change`,{bubbles:!0,detail:this._value}))}_setupRate(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{allowClear:t,allowHalf:n,character:r,clearable:i,count:a,disabled:o,error:s,max:c,name:l,readonly:u,required:d,size:f,value:p,...m}=e;Object.keys(m).length>0&&this.setup(m),(a!==void 0||c!==void 0)&&this.count(a??c),n!==void 0&&this.allowHalf(n),r!==void 0&&this.character(r),f!==void 0&&this.size(f),p!==void 0&&this.value(p),l!==void 0&&this.name(l),d!==void 0&&this.required(d),u!==void 0&&this.readonly(u),o!==void 0&&this.disabled(o),s!==void 0&&this.error(s),i===void 0?t!==void 0&&this.allowClear(t):this.allowClear(i);return}this.value(e)}}};function In(e=null,t=null,n=null){return T(Y,e,t,n)}d(y,{vRate:In});var Ln=class extends y{constructor(e=null,t=null,n=null){super(`div`,null),this.className(E,`yoya-vslider`),this.styles({alignItems:`center`,boxSizing:`border-box`,display:`flex`,gap:`10px`,minWidth:`0`,width:`100%`}),this._min=0,this._max=100,this._step=1,this._value=0,this._showValue=!0,this._vertical=!1,this._changeHandlers=[],this._input=new y(`input`).className(`yoya-vslider-input`).attr({"data-vslider-input":`true`,max:`100`,min:`0`,step:`1`,type:`range`,value:`0`}).styles({flex:`1 1 auto`,minWidth:`0`}).on(`input`,e=>this.value(Number(e.target.value))),this._valueText=m(`0`),this._valueLabel=new y(`span`).className(`yoya-vslider-value`).attr(`data-vslider-value`,`true`).styles({color:D(`color-text-muted`,`#64748b`),fontVariantNumeric:`tabular-nums`,minWidth:`36px`,textAlign:`right`}).child(this._valueText),this.child(this._input,this._valueLabel),this._sync(),this._setupSlider(e),w(this,t,n)}value(e){return e===void 0?this._value:(this._setValue(e,!0),this)}min(e){return e===void 0?this._min:(this._min=Number(e)||0,this._input.attr(`min`,String(this._min)),this._setValue(this._value,!1),this)}max(e){return e===void 0?this._max:(this._max=Number(e)||0,this._input.attr(`max`,String(this._max)),this._setValue(this._value,!1),this)}step(e){return e===void 0?this._step:(this._step=Number(e)||1,this._input.attr(`step`,String(this._step)),this._setValue(this._value,!1),this)}showValue(e){return e===void 0?this._showValue:(this._showValue=!!e,this._valueLabel.style(`display`,this._showValue?null:`none`),this)}vertical(e){return e===void 0?this._vertical:(this._vertical=!!e,this.attr(`data-vertical`,this._vertical?`true`:null),this.styles({flexDirection:this._vertical?`column`:`row`,height:this._vertical?`180px`:null,width:this._vertical?null:`100%`}),this._input.styles({direction:this._vertical?`rtl`:null,height:this._vertical?`100%`:null,minHeight:this._vertical?`0`:null,minWidth:this._vertical?null:`0`,writingMode:this._vertical?`vertical-lr`:null}),this._valueLabel.styles({minWidth:this._vertical?null:`36px`,textAlign:this._vertical?`center`:`right`}),this)}disabled(e){if(e===void 0)return this.getBooleanState(`disabled`);let t=!!e;return this.setState(`disabled`,t),this.attr(`data-disabled`,t?`true`:null),this._input.attr(`disabled`,t?!0:null),this}name(e){return e===void 0?this.attr(`data-name`)||``:(this.attr(`data-name`,e?String(e):null),this._input.attr(`name`,e?String(e):null),this)}required(e){return e===void 0?this.getBooleanState(`required`):(this.setState(`required`,!!e),this.attr(`data-required`,e?`true`:null),this._input.attr(`required`,e?!0:null),this)}change(e){return e===void 0?this._changeHandlers.slice():(this._changeHandlers=[e],this)}onChange(e){return this.change(e)}_collectValue(){return this._value}_sync(){return this._input.attr(`value`,String(this._value)),this._valueText.textContent(String(this._value)),this}_setValue(e,t){let n=Number(e);return this._value=Number.isFinite(n)?zn(n,this._min,this._max,this._step):this._min,this._sync(),t&&this._changeHandlers.forEach(e=>e(this._value,this)),this}_setupSlider(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{change:t,disabled:n,max:r,min:i,name:a,onChange:o,required:s,showValue:c,step:l,value:u,vertical:d,...f}=e;Object.keys(f).length>0&&this.setup(f),i!==void 0&&this.min(i),r!==void 0&&this.max(r),l!==void 0&&this.step(l),u!==void 0&&this.value(u),c!==void 0&&this.showValue(c),d!==void 0&&this.vertical(d),n!==void 0&&this.disabled(n),a!==void 0&&this.name(a),s!==void 0&&this.required(s),t===void 0?o!==void 0&&this.onChange(o):this.change(t);return}this.value(e)}}};function Rn(e=null,t=null,n=null){return T(Ln,e,t,n)}d(y,{vSlider:Rn});function zn(e,t,n,r){let i=Math.min(Math.max(e,t),n);return r>0?Math.round(i/r)*r:i}var Bn=class extends y{constructor(e=null,t=null,n=null){super(`div`,null),this.className(E,`yoya-vcascader`),this.styles({position:`relative`}),this._options=[],this._value=[],this._activePath=[],this._placeholder=`请选择`,this._changeHandlers=[],this._open=!1,this._outsideListener=null,this._repositionListener=null,this._triggerText=m(this._placeholder),this._trigger=new y(`button`).className(`yoya-vcascader-trigger`).attr({"aria-expanded":`false`,"aria-haspopup":`listbox`,"data-vcascader-trigger":`true`,title:`选择`,type:`button`}).styles({alignItems:`center`,background:`var(--yoya-color-surface, #ffffff)`,border:`1px solid var(--yoya-color-border, #d8dee8)`,borderRadius:`6px`,boxSizing:`border-box`,color:`inherit`,cursor:`pointer`,display:`inline-flex`,font:`inherit`,gap:`8px`,justifyContent:`space-between`,minHeight:`var(--yoya-control-height-md, 34px)`,padding:`0 10px`,width:`100%`}).child(this._triggerText,new y(`span`).styles({color:D(`color-text-muted`,`#64748b`),fontSize:`12px`}).text(`▾`)).on(`click`,()=>this.toggle()),this._columns=new y(`div`).className(`yoya-vcascader-columns`).attr(`data-vcascader-columns`,`true`).styles({display:`flex`,minWidth:`0`}),this._panel=new y(`div`).className(`yoya-vcascader-panel`).attr(`data-vcascader-panel`,`true`).styles({background:`var(--yoya-color-surface, #ffffff)`,border:`1px solid var(--yoya-color-border, #d8dee8)`,borderRadius:`8px`,boxShadow:`var(--yoya-shadow-md, 0 8px 18px rgba(15, 23, 42, 0.1))`,boxSizing:`border-box`,display:`none`,left:`0`,maxHeight:`260px`,overflow:`auto`,padding:`4px`,position:`absolute`,top:`calc(100% + 6px)`,width:`100%`,zIndex:`110`}).child(this._columns),this.child(this._trigger,this._panel),this._setupCascader(e),w(this,t,n)}options(e){return e===void 0?Un(this._options):(this._options=Hn(e),this._syncTrigger(),this._open&&this._renderColumns(),this)}value(e){if(e===void 0)return[...this._value];let t=Array.isArray(e)?e:e==null?[]:[e],n=Wn(this._options,t);return this._value=n.map(e=>e.value),this._activePath=n,this._syncTrigger(),this}disabled(e){if(e===void 0)return this.getBooleanState(`disabled`);let t=!!e;return this.setState(`disabled`,t),this.attr(`data-disabled`,t?`true`:null),this._trigger.attr(`disabled`,t?!0:null),this}name(e){return e===void 0?this.attr(`data-name`)||``:(this.attr(`data-name`,e?String(e):null),this)}required(e){return e===void 0?this.getBooleanState(`required`):(this.setState(`required`,!!e),this.attr(`data-required`,e?`true`:null),this)}placeholder(e){return e===void 0?this._placeholder:(this._placeholder=String(e),this._syncTrigger(),this)}open(e=!0){return this._open=!!e,this._trigger.attr(`aria-expanded`,this._open?`true`:`false`),this._open?(this._renderColumns(),this._panel.style(`display`,null),this._positionPanel()):this._panel.style(`display`,`none`),this._bindOutsideClose(this._open),this._bindReposition(this._open),this}close(){return this.open(!1)}toggle(){return this.open(!this._open)}change(e){return e===void 0?this._changeHandlers.slice():(this._changeHandlers=[e],this)}onChange(e){return this.change(e)}renderDom(){let e=super.renderDom();return this._open&&this._positionPanel(),e}destroy(){return this._bindOutsideClose(!1),this._bindReposition(!1),super.destroy()}_collectValue(){return[...this._value]}_renderColumns(){a(this._columns,[]);let e=[],t=this._options;this._activePath.forEach(n=>{e.push(t);let r=t.find(e=>e.value===n.value);t=r?r.children:[]}),(this._activePath.length===0||t.length>0)&&e.push(t),e.forEach((t,n)=>{let r=this._activePath[n]||null,i=new y(`div`).className(`yoya-vcascader-column`).styles({borderRight:n<e.length-1?`1px solid var(--yoya-color-border-faint, #efefef)`:`0`,boxSizing:`border-box`,minWidth:`120px`,padding:`2px`});t.forEach(e=>{let t=new y(`div`).className(`yoya-vcascader-option`).attr({"data-vcascader-option":e.value,role:`option`}).styles({alignItems:`center`,borderRadius:`4px`,boxSizing:`border-box`,cursor:`pointer`,display:`flex`,gap:`6px`,justifyContent:`space-between`,padding:`4px 8px`}).on(`mouseenter`,()=>{t.styles({background:D(`color-surface-hover`,`#f1f5f9`)})}).on(`mouseleave`,()=>{t.style(`background`,null)}).on(`click`,()=>this._selectOption(n,e));r!==null&&r.value===e.value&&t.styles({background:D(`color-primary-subtle`,`#eff6ff`),color:D(`color-primary-hover`,`#1d4ed8`)}),t.child(new y(`span`).styles({flex:`1 1 auto`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`}).text(e.label),e.children.length>0?new y(`span`).styles({color:D(`color-text-muted`,`#64748b`),fontSize:`12px`}).text(`›`):null),i.child(t)}),this._columns.child(i)})}_selectOption(e,t){let n=this._activePath.slice(0,e);if(n.push(t),this._activePath=n,t.children.length>0){this._value=n.map(e=>e.value),this._syncTrigger(),this._changeHandlers.forEach(e=>e([...this._value],this)),this._renderColumns();return}this._value=n.map(e=>e.value),this._syncTrigger(),this._changeHandlers.forEach(e=>e([...this._value],this)),this.close()}_syncTrigger(){if(this._value.length===0){this._triggerText.textContent(this._placeholder);return}let e=Wn(this._options,this._value).map(e=>e.label);this._triggerText.textContent(e.length>0?e.join(` / `):this._value.join(` / `))}_bindOutsideClose(e){if(e&&!this._outsideUnbind){this._outsideListener=e=>{(!this._el||!this._el.contains(e.target))&&this.close()},this._outsideUnbind=x(`mousedown`,this._outsideListener);return}!e&&this._outsideUnbind&&(this._outsideUnbind(),this._outsideListener=null,this._outsideUnbind=null)}_bindReposition(e){if(e&&!this._repositionUnbind){this._repositionListener=()=>this._positionPanel();let e=P(`scroll`,this._repositionListener,!0),t=P(`resize`,this._repositionListener);this._repositionUnbind=()=>{e(),t()};return}!e&&this._repositionUnbind&&(this._repositionUnbind(),this._repositionListener=null,this._repositionUnbind=null)}_positionPanel(){if(typeof window>`u`||typeof document>`u`||!this._el||!this._trigger._el)return;let e=this._trigger._el.getBoundingClientRect(),t=this._panel._el;if(!t)return;let n=t.offsetHeight||240,r=e.bottom+6;r+n>window.innerHeight-8&&(r=Math.max(8,e.top-n-6)),this._panel.styles({left:`${e.left}px`,position:`fixed`,top:`${r}px`})}_setupCascader(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{change:t,disabled:n,name:r,onChange:i,options:a,placeholder:o,required:s,value:c,...l}=e;Object.keys(l).length>0&&this.setup(l),a!==void 0&&this.options(a),o!==void 0&&this.placeholder(o),c!==void 0&&this.value(c),n!==void 0&&this.disabled(n),r!==void 0&&this.name(r),s!==void 0&&this.required(s),t===void 0?i!==void 0&&this.onChange(i):this.change(t);return}this.options(e)}}};function Vn(e=null,t=null,n=null){return T(Bn,e,t,n)}d(y,{vCascader:Vn});function Hn(e){return(Array.isArray(e)?e:[]).map(e=>({children:Hn(e.children),label:String(e.label??e.value??``),value:e.value??e.label??``}))}function Un(e){return e.map(e=>({children:Un(e.children),label:e.label,value:e.value}))}function Wn(e,t){let n=[],r=e;for(let e of t){let t=r.find(t=>t.value===e);if(!t)break;n.push(t),r=t.children}return n}var Gn=class extends y{constructor(e=null,t=null,n=null){super(`div`,null),this.className(E,`yoya-vtags-input`),this.styles({alignItems:`center`,background:`var(--yoya-color-surface, #ffffff)`,border:`1px solid var(--yoya-color-border, #d8dee8)`,borderRadius:`6px`,boxSizing:`border-box`,display:`flex`,flexWrap:`wrap`,gap:`6px`,minHeight:`var(--yoya-control-height-md, 34px)`,padding:`4px 8px`,width:`100%`}),this._value=[],this._placeholder=`输入后回车添加`,this._changeHandlers=[],this._chips=new y(`div`).className(`yoya-vtags-input-chips`).attr(`data-vtags-chips`,`true`).styles({alignItems:`center`,display:`flex`,flexWrap:`wrap`,gap:`6px`}),this._input=new y(`input`).className(`yoya-vtags-input-field`).attr({"data-vtags-input":`true`,placeholder:this._placeholder,type:`text`}).styles({background:`transparent`,border:`0`,boxSizing:`border-box`,flex:`1 1 120px`,font:`inherit`,minWidth:`80px`,outline:`none`,padding:`2px 0`}).on(`keydown`,e=>this._handleKeydown(e)),this.child(this._chips,this._input),this._renderChips(),this._setupTagsInput(e),w(this,t,n)}value(e){return e===void 0?[...this._value]:(this._value=(Array.isArray(e)?e:[]).map(e=>String(e)).filter(Boolean),this._renderChips(),this._changeHandlers.forEach(e=>e([...this._value],this)),this)}disabled(e){if(e===void 0)return this.getBooleanState(`disabled`);let t=!!e;return this.setState(`disabled`,t),this.attr(`data-disabled`,t?`true`:null),this._input.attr(`disabled`,t?!0:null),this}name(e){return e===void 0?this.attr(`data-name`)||``:(this.attr(`data-name`,e?String(e):null),this)}required(e){return e===void 0?this.getBooleanState(`required`):(this.setState(`required`,!!e),this.attr(`data-required`,e?`true`:null),this)}placeholder(e){return e===void 0?this._placeholder:(this._placeholder=String(e),this._input.attr(`placeholder`,this._placeholder),this)}change(e){return e===void 0?this._changeHandlers.slice():(this._changeHandlers=[e],this)}onChange(e){return this.change(e)}_collectValue(){return[...this._value]}_addTag(e){let t=String(e).trim();!t||this._value.includes(t)||(this._value.push(t),this._renderChips(),this._changeHandlers.forEach(e=>e([...this._value],this)))}_removeTag(e){e<0||e>=this._value.length||(this._value.splice(e,1),this._renderChips(),this._changeHandlers.forEach(e=>e([...this._value],this)))}_handleKeydown(e){if(e.key===`Enter`||e.key===`,`){e.preventDefault(),this._addTag(this._currentInputValue()),this._input.attr(`value`,``);return}e.key===`Backspace`&&!this._currentInputValue()&&this._value.length>0&&this._removeTag(this._value.length-1)}_currentInputValue(){return this._input._el?.value??this._input.attr(`value`)??``}_renderChips(){a(this._chips,this._value.map((e,t)=>new y(`span`).className(`yoya-vtags-input-tag`).attr(`data-vtags-tag`,e).styles({alignItems:`center`,background:D(`color-surface-muted`,`#f1f5f9`),border:`1px solid var(--yoya-color-border-faint, #efefef)`,borderRadius:`4px`,boxSizing:`border-box`,display:`inline-flex`,fontSize:`13px`,gap:`4px`,padding:`1px 6px`}).child(new y(`span`).text(e),new y(`button`).attr({"aria-label":`移除 ${e}`,"data-vtags-remove":`true`,title:`移除`,type:`button`}).styles({background:`transparent`,border:`0`,color:D(`color-text-muted`,`#64748b`),cursor:`pointer`,fontSize:`12px`,lineHeight:`1`,padding:`0`}).text(`×`).on(`click`,()=>this._removeTag(t)))))}_setupTagsInput(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{change:t,disabled:n,name:r,onChange:i,placeholder:a,required:o,value:s,...c}=e;Object.keys(c).length>0&&this.setup(c),s!==void 0&&this.value(s),a!==void 0&&this.placeholder(a),n!==void 0&&this.disabled(n),r!==void 0&&this.name(r),o!==void 0&&this.required(o),t===void 0?i!==void 0&&this.onChange(i):this.change(t);return}this.value(e)}}};function Kn(e=null,t=null,n=null){return T(Gn,e,t,n)}d(y,{vTagsInput:Kn});var qn=class extends y{constructor(e=null,t=null,n=null){super(`div`,null),this.className(E,`yoya-vautocomplete`),this.styles({position:`relative`,width:`100%`}),this._value=``,this._source=[],this._limit=8,this._placeholder=`输入以搜索`,this._changeHandlers=[],this._open=!1,this._highlight=-1,this._suggestions=[],this._optionNodes=[],this._outsideListener=null,this._repositionListener=null,this._input=new y(`input`).className(`yoya-vautocomplete-input`).attr({autocomplete:`off`,"data-vautocomplete-input":`true`,placeholder:this._placeholder,type:`text`}).styles({background:`var(--yoya-color-surface, #ffffff)`,border:`1px solid var(--yoya-color-border, #d8dee8)`,borderRadius:`6px`,boxSizing:`border-box`,color:`inherit`,font:`inherit`,minHeight:`var(--yoya-control-height-md, 34px)`,outline:`none`,padding:`0 10px`,width:`100%`}).on(`input`,e=>this._handleInput(e.target.value)).on(`keydown`,e=>this._handleKeydown(e)).on(`focus`,()=>this._openSuggestions()).on(`click`,()=>this._openSuggestions()),this._list=new y(`div`).className(`yoya-vautocomplete-list`).attr(`data-vautocomplete-list`,`true`).styles({background:`var(--yoya-color-surface, #ffffff)`,border:`1px solid var(--yoya-color-border, #d8dee8)`,borderRadius:`8px`,boxShadow:`var(--yoya-shadow-md, 0 8px 18px rgba(15, 23, 42, 0.1))`,boxSizing:`border-box`,display:`none`,maxHeight:`240px`,overflow:`auto`,padding:`4px`,position:`fixed`,zIndex:`110`}),this.child(this._input,this._list),this._setupAutocomplete(e),w(this,t,n)}value(e){return e===void 0?this._value:(this._value=String(e??``),this._input.attr(`value`,this._value),this._changeHandlers.forEach(e=>e(this._value,this)),this)}source(e){return e===void 0?this._source:(this._source=e,this)}options(e){return this.source(e)}limit(e){return e===void 0?this._limit:(this._limit=Math.max(1,Number(e)||8),this)}disabled(e){if(e===void 0)return this.getBooleanState(`disabled`);let t=!!e;return this.setState(`disabled`,t),this.attr(`data-disabled`,t?`true`:null),this._input.attr(`disabled`,t?!0:null),this}name(e){return e===void 0?this.attr(`data-name`)||``:(this.attr(`data-name`,e?String(e):null),this._input.attr(`name`,e?String(e):null),this)}required(e){return e===void 0?this.getBooleanState(`required`):(this.setState(`required`,!!e),this.attr(`data-required`,e?`true`:null),this._input.attr(`required`,e?!0:null),this)}placeholder(e){return e===void 0?this._placeholder:(this._placeholder=String(e),this._input.attr(`placeholder`,this._placeholder),this)}change(e){return e===void 0?this._changeHandlers.slice():(this._changeHandlers=[e],this)}onChange(e){return this.change(e)}close(){return this._open=!1,this._list.style(`display`,`none`),this._bindOutsideClose(!1),this._bindReposition(!1),this}destroy(){return this.close(),super.destroy()}renderDom(){let e=super.renderDom();return this._open&&this._positionList(),e}_collectValue(){return this._value}_resolveSuggestions(e){let t=this._source;return typeof t==`function`?Promise.resolve(t(e)).then(e=>Yn(e)):Promise.resolve(Yn(t)).then(t=>e?t.filter(t=>t.label.toLowerCase().includes(String(e).toLowerCase())):t)}_handleInput(e){this.value(e),this._openSuggestions()}_openSuggestions(){this.getBooleanState(`disabled`)||this._resolveSuggestions(this._value).then(e=>{this._suggestions=e.slice(0,this._limit),this._highlight=this._suggestions.length>0?0:-1,this._renderList(),this._open=this._suggestions.length>0,this._list.style(`display`,this._open?null:`none`),this._open&&(this._bindOutsideClose(!0),this._bindReposition(!0),this._positionList())})}_handleKeydown(e){if(!(!this._open||this._suggestions.length===0)){if(e.key===`ArrowDown`)e.preventDefault(),this._highlight=(this._highlight+1)%this._suggestions.length,this._setHighlight(this._highlight);else if(e.key===`ArrowUp`)e.preventDefault(),this._highlight=(this._highlight-1+this._suggestions.length)%this._suggestions.length,this._setHighlight(this._highlight);else if(e.key===`Enter`){e.preventDefault();let t=this._suggestions[this._highlight];t&&this._select(t)}else e.key===`Escape`&&this.close()}}_select(e){this.value(e.value),this.close()}_renderList(){return this._optionNodes=[],a(this._list,this._suggestions.map((e,t)=>{let n=new y(`div`).className(`yoya-vautocomplete-option`).attr({"data-vautocomplete-option":e.value,role:`option`}).styles({borderRadius:`4px`,boxSizing:`border-box`,cursor:`pointer`,overflow:`hidden`,padding:`5px 8px`,textOverflow:`ellipsis`,whiteSpace:`nowrap`}).on(`mousedown`,t=>{t.preventDefault(),this._select(e)}).on(`mouseenter`,()=>this._setHighlight(t)).text(e.label);return this._optionNodes.push(n),n})),this._setHighlight(this._highlight),this}_setHighlight(e){return this._highlight=e,(this._optionNodes||[]).forEach((t,n)=>{t.styles(n===e?{background:D(`color-primary-subtle`,`#eff6ff`)}:{background:null})}),this}_bindOutsideClose(e){if(e&&!this._outsideUnbind){this._outsideListener=e=>{(!this._el||!this._el.contains(e.target))&&this.close()},this._outsideUnbind=x(`mousedown`,this._outsideListener);return}!e&&this._outsideUnbind&&(this._outsideUnbind(),this._outsideListener=null,this._outsideUnbind=null)}_bindReposition(e){if(e&&!this._repositionUnbind){this._repositionListener=()=>this._positionList();let e=P(`scroll`,this._repositionListener,!0),t=P(`resize`,this._repositionListener);this._repositionUnbind=()=>{e(),t()};return}!e&&this._repositionUnbind&&(this._repositionUnbind(),this._repositionListener=null,this._repositionUnbind=null)}_positionList(){if(typeof window>`u`||typeof document>`u`||!this._input._el||!this._list._el)return;let e=this._input._el.getBoundingClientRect(),t=this._list._el.offsetHeight||240,n=e.bottom+6;n+t>window.innerHeight-8&&(n=Math.max(8,e.top-t-6)),this._list.styles({left:`${e.left}px`,top:`${n}px`,width:`${Math.max(e.width,180)}px`})}_setupAutocomplete(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{change:t,disabled:n,limit:r,name:i,onChange:a,options:o,placeholder:s,required:c,source:l,value:u,...d}=e;Object.keys(d).length>0&&this.setup(d),l===void 0?o!==void 0&&this.options(o):this.source(l),r!==void 0&&this.limit(r),u!==void 0&&this.value(u),s!==void 0&&this.placeholder(s),n!==void 0&&this.disabled(n),i!==void 0&&this.name(i),c!==void 0&&this.required(c),t===void 0?a!==void 0&&this.onChange(a):this.change(t);return}this.options(e)}}};function Jn(e=null,t=null,n=null){return T(qn,e,t,n)}d(y,{vAutocomplete:Jn});function Yn(e){return(Array.isArray(e)?e:[]).map(e=>typeof e==`string`||typeof e==`number`?{label:String(e),value:String(e)}:{label:String(e.label??e.value??``),value:e.value??e.label??``})}function Xn(e,t={}){return new y(`button`).className(e,`yoya-control-clear`).attr({type:`button`,"aria-label":`清空`,title:`清空`}).styles({alignItems:`center`,background:`transparent`,border:`none`,borderRadius:`4px`,boxSizing:`border-box`,color:D(`color-text-muted`,`#64748b`),cursor:`pointer`,display:`inline-flex`,flexShrink:`0`,fontFamily:`inherit`,fontSize:`16px`,fontWeight:`700`,height:`18px`,justifyContent:`center`,lineHeight:`1`,margin:`0`,padding:`0`,position:`absolute`,width:`18px`,zIndex:`1`,...t}).text(`×`)}function Zn(e,t,n){let r=t._el?.value??e.value(),i=Array.isArray(r)?r.length>0:r!==``&&r!=null,a=e._clearable&&i&&!e.getBooleanState(`disabled`)&&!e.getBooleanState(`readonly`);n.style(`display`,a?null:`none`)}var Qn=class extends y{constructor(t=null){super(`div`,null),this._value=``,this._clearable=!0,this._clearButton=Xn(`yoya-vinput-clear`,{right:`6px`,top:`50%`,transform:`translateY(-50%)`}),this._input=new y(`input`).className(E,`yoya-vinput`).attr(`type`,`text`).styles({background:D(`color-surface`,`#ffffff`),border:e(`color-border-strong`,`#cbd5e1`),borderRadius:`6px`,boxSizing:`border-box`,color:D(`color-text`,`#172033`),font:`inherit`,minHeight:`var(--yoya-control-height-md, 34px)`,outline:`none`,padding:`0 12px`,width:`100%`}),this._addRootClass(E,`yoya-vinput-wrap`),this.styles({minWidth:`0`,position:`relative`,width:`100%`}),this._clearButton.on(`click`,e=>{e.preventDefault(),e.stopPropagation(),this.clear(),this._input._el?.focus()}),this._input.on(`input`,()=>this._syncClear()),this._input.on(`change`,()=>this._syncClear()),this.child(this._input,this._clearButton),this._setupInput(t),this._syncClearPadding(),this._syncClear()}_addRootClass(...e){return super.className(...e),this}className(...e){return e.length===0?this._input.className():(this._input.className(...e),this)}attr(e,t){return e&&typeof e==`object`?(Object.entries(e).forEach(([e,t])=>this.attr(e,t)),this):e===`value`?t===void 0?this.value():this.value(t):t===void 0?this._input.attr(e):(this._input.attr(e,t),this)}on(e,t,n){return this._input&&(e===`focus`||e===`blur`)?(this._input.on(e,t,n),this):super.on(e,t,n)}id(e){return e===void 0?this._input.id():(this._input.id(e),this)}name(e){return e===void 0?this._input.name():(this._input.name(e),this)}textContent(){return this._input.textContent()}type(e){return e===void 0?this._input.attr(`type`):(this._input.attr(`type`,e||`text`),this)}value(e){if(e===void 0)return this._input._el?.value??this._value??this._input.attr(`value`)??``;let t=i(e);return this._value=t,this._input.attr(`value`,t),this._syncClear(),this}hydrateSnapshot(){return this._input._el&&this.value(this._input._el.value),this}text(e){return this.value(e)}content(e){return this.value(e)}placeholder(e){if(e===void 0)return this._input.attr(`placeholder`);let t=i(e);return this._input.attr(`placeholder`,t||null),this}disabled(e){if(e===void 0)return this.getBooleanState(`disabled`);let t=!!e;return this.setState(`disabled`,t),this._input.attr(`disabled`,t?!0:null),this._input.style(`cursor`,t?`not-allowed`:`text`),this._input.style(`opacity`,t?`0.64`:`1`),this._syncClear(),this}readonly(e){if(e===void 0)return this.getBooleanState(`readonly`);let t=!!e;return this.setState(`readonly`,t),this._input.attr(`readonly`,t?!0:null),this._syncClear(),this}required(e){if(e===void 0)return this.getBooleanState(`required`);let t=!!e;return this.setState(`required`,t),this._input.attr(`required`,t?!0:null),this}error(e){if(e===void 0)return this.getBooleanState(`error`);let t=!!e;return this.setState(`error`,t),this._input.attr(`data-error`,t?`true`:null),this._input.style(`borderColor`,t?D(`color-danger`,`#dc2626`):D(`color-border-strong`,`#cbd5e1`)),this._input.style(`boxShadow`,t?`0 0 0 1px ${D(`color-danger-ring`,`rgba(220, 38, 38, 0.2)`)}`:null),this}clearable(e){return e===void 0?this._clearable:(this._clearable=!!e,this._input.attr(`data-clearable`,this._clearable?`true`:null),this._syncClearPadding(),this._syncClear(),this)}clear(){return this.value(``),this._input._el&&(this._input._el.dispatchEvent(new Event(`input`,{bubbles:!0})),this._input._el.dispatchEvent(new Event(`change`,{bubbles:!0}))),this}_syncClear(){return Zn(this,this._input,this._clearButton),this}_syncClearPadding(){return this._input.style(`paddingRight`,this._clearable?`34px`:`12px`),this}_applyAccessState(e){e===`readonly`?(this._accessDisabled=!0,this.disabled(!0)):this._accessDisabled&&(this._accessDisabled=!1,this.disabled(!1))}_setupInput(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{clearable:t,children:n,content:r,disabled:i,error:a,placeholder:o,readonly:s,required:c,text:l,type:u,value:d,...f}=e;Object.keys(f).length>0&&this.setup(f),u!==void 0&&this.type(u),o!==void 0&&this.placeholder(o),d===void 0?l===void 0?r===void 0?n!==void 0&&this.value(n):this.value(r):this.value(l):this.value(d),c!==void 0&&this.required(c),s!==void 0&&this.readonly(s),i!==void 0&&this.disabled(i),a!==void 0&&this.error(a),t!==void 0&&this.clearable(t);return}this.placeholder(e)}}},$n=class extends Qn{constructor(e=null){super(null),this.className(`yoya-vtimer`),this._clearButton.className(`yoya-vtimer-clear`),this._addRootClass(`yoya-vtimer-wrap`),this.mode(`date`),this._setupTimer(e)}mode(e){if(e===void 0)return this.attr(`type`);let t=new Set([`date`,`datetime-local`,`time`]);return this.attr(`type`,t.has(e)?e:`date`),this}type(e){return e===void 0?this.mode():this.mode(e)}_setupTimer(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{mode:t,type:n,...r}=e;this._setupInput(r),t===void 0?n!==void 0&&this.mode(n):this.mode(t);return}this.value(e)}}},er=class extends y{constructor(e=null){super(`div`,null);let t=M(`yoya-vtimer-range-error`);this._name=``,this._startTimer=hr().className(`yoya-vtimer-range-start`).attr(`aria-label`,`开始值`).attr(`aria-describedby`,t),this._endTimer=hr().className(`yoya-vtimer-range-end`).attr(`aria-label`,`结束值`).attr(`aria-describedby`,t),this._errorText=new v(``),this._errorMessage=new y(`span`).className(`yoya-vtimer-range-error`).id(t).attr(`aria-live`,`polite`).style(`color`,D(`color-danger`,`#dc2626`)).style(`fontSize`,`0.875rem`).style(`gridColumn`,`1 / -1`).child(this._errorText),this.className(E,`yoya-vtimer-range`).attr(`role`,`group`),this.styles({alignItems:`center`,display:`grid`,gap:`8px`,gridTemplateColumns:`minmax(0, 1fr) minmax(0, 1fr)`}),this._startTimer.on(`change`,e=>this._handleTimerChange(e)),this._endTimer.on(`change`,e=>this._handleTimerChange(e)),this.child(this._startTimer,this._endTimer,this._errorMessage),this._setupTimerRange(e)}mode(e){return e===void 0?this._startTimer.mode():(this._startTimer.mode(e),this._endTimer.mode(e),this)}name(e){return e===void 0?this._name:(this._name=i(e),this._startTimer.attr(`name`,this._name?`${this._name}Start`:null),this._endTimer.attr(`name`,this._name?`${this._name}End`:null),this)}start(e){return e===void 0?this._startTimer.value():(this._startTimer.value(e),this._validate(),this)}end(e){return e===void 0?this._endTimer.value():(this._endTimer.value(e),this._validate(),this)}value(e){if(e===void 0)return{start:this.start(),end:this.end()};let[t,n]=Array.isArray(e)?e:[e?.start??``,e?.end??``];return this.start(t),this.end(n),this}disabled(e){return e===void 0?this._startTimer.disabled():(this._startTimer.disabled(e),this._endTimer.disabled(e),this)}readonly(e){return e===void 0?this._startTimer.readonly():(this._startTimer.readonly(e),this._endTimer.readonly(e),this)}required(e){return e===void 0?this._startTimer.required():(this._startTimer.required(e),this._endTimer.required(e),this)}_setupTimerRange(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{disabled:t,end:n,mode:r,name:i,readonly:a,required:o,start:s,value:c,...l}=e;Object.keys(l).length>0&&this.setup(l),r!==void 0&&this.mode(r),i!==void 0&&this.name(i),c===void 0?this.value({start:s,end:n}):this.value(c),o!==void 0&&this.required(o),a!==void 0&&this.readonly(a),t!==void 0&&this.disabled(t);return}this.value(e)}}_handleTimerChange(e){if(e.stopPropagation(),this._validate(),this._el){let e=this._el.ownerDocument.defaultView.CustomEvent;this._el.dispatchEvent(new e(`change`,{bubbles:!0,detail:this.value()}))}}hydrateSnapshot(){return this._startTimer.hydrateSnapshot?.(),this._endTimer.hydrateSnapshot?.(),this._validate(),this}_validate(){let{start:e,end:t}=this.value(),n=!!(e&&t&&t<e);return this.attr(`data-error`,n?`true`:null),this.attr(`data-invalid`,n?`true`:null),this.attr(`aria-invalid`,n?`true`:null),this._startTimer.error(n),this._endTimer.error(n),this._startTimer.attr(`aria-invalid`,n?`true`:null),this._endTimer.attr(`aria-invalid`,n?`true`:null),this._errorText.textContent(n?`结束值不能早于开始值`:``),!n}},tr=class extends y{constructor(t=null){super(`div`,null),this._value=``,this._clearable=!0,this._clearButton=Xn(`yoya-vtextarea-clear`,{right:`6px`,top:`6px`}),this._input=new y(`textarea`).className(E,`yoya-vtextarea`).styles({background:D(`color-surface`,`#ffffff`),border:e(`color-border-strong`,`#cbd5e1`),borderRadius:`6px`,boxSizing:`border-box`,color:D(`color-text`,`#172033`),font:`inherit`,minHeight:`88px`,outline:`none`,padding:`10px 12px`,resize:`vertical`,width:`100%`}),this._addRootClass(E,`yoya-vtextarea-wrap`),this.styles({minWidth:`0`,position:`relative`,width:`100%`}),this._clearButton.on(`click`,e=>{e.preventDefault(),e.stopPropagation(),this.clear(),this._input._el?.focus()}),this._input.on(`input`,()=>this._syncClear()),this._input.on(`change`,()=>this._syncClear()),this.child(this._input,this._clearButton),this._setupTextarea(t),this._syncClearPadding(),this._syncClear()}_addRootClass(...e){return super.className(...e),this}className(...e){return e.length===0?this._input.className():(this._input.className(...e),this)}attr(e,t){return e&&typeof e==`object`?(Object.entries(e).forEach(([e,t])=>this.attr(e,t)),this):e===`value`?t===void 0?this.value():this.value(t):t===void 0?this._input.attr(e):(this._input.attr(e,t),this)}on(e,t,n){return this._input&&(e===`focus`||e===`blur`)?(this._input.on(e,t,n),this):super.on(e,t,n)}id(e){return e===void 0?this._input.id():(this._input.id(e),this)}name(e){return e===void 0?this._input.name():(this._input.name(e),this)}textContent(){return this._input.textContent()}value(e){if(e===void 0)return this._input._el?.value??this._value??this._input.textContent();let t=i(e);return this._value=t,a(this._input,t?S(t):[]),this._input._el&&(this._input._el.value=t),this._syncClear(),this}hydrateSnapshot(){return this._input._el&&this.value(this._input._el.value),this}text(e){return this.value(e)}content(e){return this.value(e)}placeholder(e){if(e===void 0)return this._input.attr(`placeholder`);let t=i(e);return this._input.attr(`placeholder`,t||null),this}disabled(e){if(e===void 0)return this.getBooleanState(`disabled`);let t=!!e;return this.setState(`disabled`,t),this._input.attr(`disabled`,t?!0:null),this._input.style(`cursor`,t?`not-allowed`:`text`),this._input.style(`opacity`,t?`0.64`:`1`),this._syncClear(),this}readonly(e){if(e===void 0)return this.getBooleanState(`readonly`);let t=!!e;return this.setState(`readonly`,t),this._input.attr(`readonly`,t?!0:null),this._syncClear(),this}required(e){if(e===void 0)return this.getBooleanState(`required`);let t=!!e;return this.setState(`required`,t),this._input.attr(`required`,t?!0:null),this}error(e){if(e===void 0)return this.getBooleanState(`error`);let t=!!e;return this.setState(`error`,t),this._input.attr(`data-error`,t?`true`:null),this._input.style(`borderColor`,t?D(`color-danger`,`#dc2626`):D(`color-border-strong`,`#cbd5e1`)),this._input.style(`boxShadow`,t?`0 0 0 1px ${D(`color-danger-ring`,`rgba(220, 38, 38, 0.2)`)}`:null),this}rows(e){return e===void 0?this._input.attr(`rows`):(this._input.attr(`rows`,e),this)}clearable(e){return e===void 0?this._clearable:(this._clearable=!!e,this._input.attr(`data-clearable`,this._clearable?`true`:null),this._syncClearPadding(),this._syncClear(),this)}clear(){return this.value(``),this._input._el&&(this._input._el.dispatchEvent(new Event(`input`,{bubbles:!0})),this._input._el.dispatchEvent(new Event(`change`,{bubbles:!0}))),this}_syncClear(){return Zn(this,this._input,this._clearButton),this}_syncClearPadding(){return this._input.style(`paddingRight`,this._clearable?`34px`:`12px`),this}_setupTextarea(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{clearable:t,children:n,content:r,disabled:i,error:a,placeholder:o,readonly:s,required:c,rows:l,text:u,value:d,...f}=e;Object.keys(f).length>0&&this.setup(f),l!==void 0&&this.rows(l),o!==void 0&&this.placeholder(o),d===void 0?u===void 0?r===void 0?n!==void 0&&this.value(n):this.value(r):this.value(u):this.value(d),c!==void 0&&this.required(c),s!==void 0&&this.readonly(s),i!==void 0&&this.disabled(i),a!==void 0&&this.error(a),t!==void 0&&this.clearable(t);return}this.value(e)}}},nr=class extends y{constructor(t=null){super(`div`,null),this._options=[],this._placeholder=``,this._value=``,this._clearable=!0,this._clearButton=Xn(`yoya-vselect-clear`,{right:`30px`,top:`50%`,transform:`translateY(-50%)`}),this._input=new y(`select`).className(E,`yoya-vselect`).styles({background:D(`color-surface`,`#ffffff`),border:e(`color-border-strong`,`#cbd5e1`),borderRadius:`6px`,boxSizing:`border-box`,color:D(`color-text`,`#172033`),cursor:`pointer`,font:`inherit`,minHeight:`var(--yoya-control-height-md, 34px)`,outline:`none`,padding:`0 32px 0 12px`,width:`100%`}),this._addRootClass(E,`yoya-vselect-wrap`),this.styles({minWidth:`0`,position:`relative`,width:`100%`}),this._clearButton.on(`click`,e=>{e.preventDefault(),e.stopPropagation(),this.clear(),this._input._el?.focus()}),this._input.on(`change`,()=>this._syncClear()),this.child(this._input,this._clearButton),this._setupSelect(t),this._syncClearPadding(),this._syncClear()}_addRootClass(...e){return super.className(...e),this}className(...e){return e.length===0?this._input.className():(this._input.className(...e),this)}attr(e,t){return e&&typeof e==`object`?(Object.entries(e).forEach(([e,t])=>this.attr(e,t)),this):e===`value`?t===void 0?this.value():this.value(t):t===void 0?this._input.attr(e):(this._input.attr(e,t),this)}on(e,t,n){return this._input&&(e===`focus`||e===`blur`)?(this._input.on(e,t,n),this):super.on(e,t,n)}id(e){return e===void 0?this._input.id():(this._input.id(e),this)}name(e){return e===void 0?this._input.name():(this._input.name(e),this)}textContent(){return this._input.textContent()}value(e){return e===void 0?this._input._el?.value??this._value??``:(this._value=i(e),this._renderOptions(),this._syncClear(),this)}hydrateSnapshot(){return this._input._el&&this.value(this._input._el.value),this}text(e){return this.value(e)}content(e){return this.value(e)}placeholder(e){return e===void 0?this._placeholder:(this._placeholder=i(e),this._renderOptions(),this)}options(e){return e===void 0?this._options.slice():(this._options=Array.isArray(e)?e.slice():[],this._renderOptions(),this)}disabled(e){if(e===void 0)return this.getBooleanState(`disabled`);let t=!!e;return this.setState(`disabled`,t),this._input.attr(`disabled`,t?!0:null),this._input.style(`cursor`,t?`not-allowed`:`pointer`),this._input.style(`opacity`,t?`0.64`:`1`),this._syncClear(),this}required(e){if(e===void 0)return this.getBooleanState(`required`);let t=!!e;return this.setState(`required`,t),this._input.attr(`required`,t?!0:null),this}error(e){if(e===void 0)return this.getBooleanState(`error`);let t=!!e;return this.setState(`error`,t),this._input.attr(`data-error`,t?`true`:null),this._input.style(`borderColor`,t?D(`color-danger`,`#dc2626`):D(`color-border-strong`,`#cbd5e1`)),this._input.style(`boxShadow`,t?`0 0 0 1px ${D(`color-danger-ring`,`rgba(220, 38, 38, 0.2)`)}`:null),this}clearable(e){return e===void 0?this._clearable:(this._clearable=!!e,this._input.attr(`data-clearable`,this._clearable?`true`:null),this._renderOptions(),this._syncClearPadding(),this._syncClear(),this)}clear(){return this.value(``),this._input._el&&this._input._el.dispatchEvent(new Event(`change`,{bubbles:!0})),this}_syncClear(){return Zn(this,this._input,this._clearButton),this}_syncClearPadding(){return this._input.style(`paddingRight`,this._clearable?`52px`:`32px`),this}_renderOptions(){let e=[],t=i(this._value);if(this._placeholder){let n=new y(`option`).className(`yoya-vselect-option`);n.attr({disabled:!0,value:``}),n.attr(`selected`,!t||null),n.styles({color:D(`color-border-muted`,`#94a3b8`)}),a(n,S(this._placeholder)),e.push(n)}else if(this._clearable&&!t){let t=new y(`option`).className(`yoya-vselect-option`).attr({selected:!0,value:``}).styles({color:D(`color-border-muted`,`#94a3b8`)});e.push(t)}this._options.forEach((n,r)=>{e.push(Ar(n,t,r))}),a(this._input,e),this._input._el&&(this._input._el.value=t)}_setupSelect(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{clearable:t,children:n,content:r,disabled:i,error:a,options:o,placeholder:s,required:c,text:l,value:u,...d}=e;Object.keys(d).length>0&&this.setup(d),s!==void 0&&this.placeholder(s),o!==void 0&&this.options(o),u===void 0?l===void 0?r===void 0?n!==void 0&&this.value(n):this.value(r):this.value(l):this.value(u),c!==void 0&&this.required(c),i!==void 0&&this.disabled(i),a!==void 0&&this.error(a),t!==void 0&&this.clearable(t);return}this.value(e)}}},rr=class extends y{constructor(e){super(`label`,null),this._kind=e,this._optionValue=`on`,this._input=new y(`input`).className(`yoya-v${e}-input`),this._visualBox=new y(`span`).className(`yoya-v${e}-visual`),this._contentBox=new y(`span`).className(`yoya-v${e}-content`),this._labelBox=new y(`span`).className(`yoya-v${e}-label`),this._descriptionBox=new y(`span`).className(`yoya-v${e}-description`).style(`display`,`none`),this.className(E,`yoya-v${e}`),this.styles({alignItems:`center`,cursor:`pointer`,display:`inline-grid`,gap:`10px`,gridTemplateColumns:`auto minmax(0, 1fr)`,position:`relative`}),this._input.attr(`type`,`checkbox`),this._input.styles({height:`1px`,margin:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,width:`1px`}),this._contentBox.styles({display:`grid`,gap:`2px`,minWidth:`0`}),this._labelBox.styles({color:D(`color-text`,`#172033`),fontWeight:`600`,lineHeight:`1.35`}),this._descriptionBox.styles({color:D(`color-text-muted`,`#64748b`),fontSize:`12px`,lineHeight:`1.45`}),this._contentBox.child(this._labelBox,this._descriptionBox),this.child(this._visualBox,this._input,this._contentBox),this._input.on(`change`,e=>{this.getBooleanState(`disabled`)||this.checked(!!e.target?.checked)})}label(e){return e===void 0?this._labelBox.textContent():(a(this._labelBox,S(e)),this)}text(e){return this.label(e)}content(e){return this.label(e)}description(e){if(e===void 0)return this._descriptionBox.textContent();let t=e!=null&&e!==``;return this._descriptionBox.style(`display`,t?null:`none`),a(this._descriptionBox,t?S(e):[]),this}checked(e){if(e===void 0)return this.getBooleanState(`checked`);let t=!!e;return this.setState(`checked`,t),this.attr(`data-checked`,t?`true`:null),this._input.attr(`checked`,t?!0:null),this._syncVisual(t),this}value(e){return e===void 0?this.checked():this.checked(e)}optionValue(e){return e===void 0?this._optionValue:(this._optionValue=i(e)||`on`,this._input.attr(`value`,this._optionValue),this)}name(e){return e===void 0?this._input.name():(this._input.name(e),this.attr(`data-name`,e??null),this)}disabled(e){if(e===void 0)return this.getBooleanState(`disabled`);let t=!!e;return this.setState(`disabled`,t),this._input.attr(`disabled`,t?!0:null),this.attr(`aria-disabled`,t?`true`:null),this.style(`opacity`,t?`0.64`:`1`),this}required(e){if(e===void 0)return this.getBooleanState(`required`);let t=!!e;return this.setState(`required`,t),this._input.attr(`required`,t?!0:null),this}indeterminate(e){if(e===void 0)return this.getBooleanState(`indeterminate`);let t=!!e;return this.setState(`indeterminate`,t),this._input._el&&(this._input._el.indeterminate=t),this}hydrateSnapshot(){return this._input._el&&this.checked(this._input._el.checked),this}_setupBoolean(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{checked:t,children:n,content:r,description:i,disabled:a,label:o,name:s,optionValue:c,required:l,text:u,value:d,...f}=e;Object.keys(f).length>0&&this.setup(f),o===void 0?u===void 0?r===void 0?n!==void 0&&this.label(n):this.content(r):this.text(u):this.label(o),i!==void 0&&this.description(i),s!==void 0&&this.name(s),c===void 0?d!==void 0&&typeof d!=`boolean`&&this.optionValue(d):this.optionValue(c),t===void 0?d!==void 0&&typeof d==`boolean`&&this.checked(d):this.checked(t),l!==void 0&&this.required(l),a!==void 0&&this.disabled(a);return}if(e instanceof o||Array.isArray(e)||typeof e==`string`||typeof e==`number`){this.label(e);return}this.label(e)}}_syncVisual(){}},X=class extends rr{constructor(t=null){super(`checkbox`),this._visualBox.styles({alignItems:`center`,background:D(`color-surface`,`#ffffff`),border:e(`color-border-strong`,`#cbd5e1`),borderRadius:`4px`,boxSizing:`border-box`,color:D(`color-text-inverse`,`#ffffff`),display:`inline-flex`,height:`16px`,justifyContent:`center`,lineHeight:`1`,transition:`background 120ms ease, border-color 120ms ease`,width:`16px`}),this._syncVisual(!1),this._setupBoolean(t)}_syncVisual(e){this._visualBox.styles({background:e?D(`color-primary`,`#2563eb`):D(`color-surface`,`#ffffff`),borderColor:e?D(`color-primary`,`#2563eb`):D(`color-border-strong`,`#cbd5e1`),color:e?D(`color-text-inverse`,`#ffffff`):`transparent`}),a(this._visualBox,e?S(`✓`):[])}},ir=class extends rr{constructor(t=null){super(`switch`),this._thumbBox=new y(`span`).className(`yoya-vswitch-thumb`),this._visualBox.styles({background:D(`color-border-strong`,`#cbd5e1`),border:e(`color-border-strong`,`#cbd5e1`),borderRadius:`999px`,boxSizing:`border-box`,display:`inline-flex`,height:`22px`,padding:`2px`,position:`relative`,transition:`background 120ms ease, border-color 120ms ease`,width:`40px`}),this._thumbBox.styles({background:D(`color-surface`,`#ffffff`),borderRadius:`999px`,boxShadow:`0 1px 2px rgba(15, 23, 42, 0.18)`,height:`16px`,transform:`translateX(0)`,transition:`transform 120ms ease`,width:`16px`}),this._visualBox.child(this._thumbBox),this._syncVisual(!1),this._setupBoolean(t)}_syncVisual(e){this._visualBox.styles({background:e?D(`color-primary`,`#2563eb`):D(`color-border-strong`,`#cbd5e1`),borderColor:e?D(`color-primary`,`#2563eb`):D(`color-border-strong`,`#cbd5e1`)}),this._thumbBox.style(`transform`,e?`translateX(18px)`:`translateX(0)`)}},ar=class extends y{constructor(e=null){super(`div`,null),this._name=``,this._multiple=!0,this._required=!1,this._items=[],this._options=[],this._columns=null,this.className(E,`yoya-vcheckboxes`),this.styles({display:`grid`,gap:`8px`,minWidth:`0`}),this._setupCheckboxes(e)}name(e){return e===void 0?this._name:(this._name=i(e),this.attr(`data-name`,this._name||null),this)}multiple(e){if(e===void 0)return this._multiple;let t=this.value();return this._multiple=!!e,this._multiple||(Array.isArray(t)?this.value(t[0]??null):this.value(t)),this}required(e){return e===void 0?this._required:(this._required=!!e,this.attr(`data-required`,this._required?`true`:null),this)}disabled(e){if(e===void 0)return this.getBooleanState(`disabled`);let t=!!e;return this.setState(`disabled`,t),this.attr(`aria-disabled`,t?`true`:null),this.style(`opacity`,t?`0.64`:`1`),this._items.forEach(e=>e.disabled(t)),this}options(e){return e===void 0?this._options.slice():(this._options=Array.isArray(e)?e.slice():[],this._renderOptions(),this)}value(e){if(e===void 0){let e=this._items.filter(e=>e.checked()).map(e=>e.optionValue());return this._multiple?e:e[0]??null}let t=Or(e),n=this._multiple?t:t.slice(0,1);return this._items.forEach(e=>{let t=i(e.optionValue());e.checked(n.includes(t))}),this}checkedValues(e){return e===void 0?this.value():this.value(e)}clear(){return this.value(this._multiple?[]:null)}columns(e){return e===void 0?this._columns:(this._columns=Number(e)>=1?Number(e):null,this.style(`gridTemplateColumns`,this._columns?`repeat(`+this._columns+`, minmax(0, 1fr))`:null),this)}_renderOptions(){let e=this._options.map((e,t)=>Mr(e,t));this._items=e,a(this,e),this._items.forEach(e=>{e.on(`change`,()=>this._handleItemChange(e)),this._name&&e.attr(`data-group-name`,this._name)}),this.value(this.value())}_handleItemChange(e){!this._multiple&&e.checked()&&this._items.forEach(t=>{t!==e&&t.checked(!1)})}_setupCheckboxes(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{children:t,disabled:n,multiple:r,name:i,options:a,required:o,value:s,columns:c,...l}=e;Object.keys(l).length>0&&this.setup(l),i!==void 0&&this.name(i),r!==void 0&&this.multiple(r),a===void 0?t!==void 0&&this.options(t):this.options(a),c!==void 0&&this.columns(c),o!==void 0&&this.required(o),n!==void 0&&this.disabled(n),s!==void 0&&this.value(s);return}if(Array.isArray(e)){this.options(e);return}this.options([e])}}},Z=class extends rr{constructor(t=null){super(`radio`),this._input.attr(`type`,`radio`),this._visualBox.styles({alignItems:`center`,background:D(`color-surface`,`#ffffff`),border:e(`color-border-strong`,`#cbd5e1`),borderRadius:`999px`,boxSizing:`border-box`,display:`inline-flex`,height:`16px`,justifyContent:`center`,lineHeight:`1`,transition:`background 120ms ease, border-color 120ms ease`,width:`16px`}),this._syncVisual(!1),this._setupBoolean(t),sr(this)}name(e){if(e===void 0)return super.name();cr(this);let t=super.name(e);return sr(this),t}checked(e){return e!==void 0&&e&&this.name()&&or.get(this.name())?.forEach(e=>{e!==this&&e.checked()&&e.checked(!1)}),super.checked(e)}destroy(){return cr(this),super.destroy()}_syncVisual(e){this._visualBox.styles({borderColor:e?D(`color-primary`,`#2563eb`):D(`color-border-strong`,`#cbd5e1`)}),a(this._visualBox,e?[lr()]:[])}};const or=new Map;function sr(e){let t=e.name();if(!t)return;let n=or.get(t);n||(n=new Set,or.set(t,n)),n.add(e)}function cr(e){let t=e.name();if(!t)return;let n=or.get(t);n?.delete(e),n&&n.size===0&&or.delete(t)}function lr(){return new y(`span`).className(`yoya-vradio-dot`).styles({background:D(`color-primary`,`#2563eb`),borderRadius:`999px`,height:`8px`,width:`8px`})}var ur=class extends y{constructor(e=null){super(`div`,null),this._name=``,this._required=!1,this._changeHandler=null,this._items=[],this._options=[],this.className(E,`yoya-vradios`),this.styles({display:`grid`,gap:`8px`,minWidth:`0`}),this._setupRadios(e)}name(e){return e===void 0?this._name:(this._name=i(e),this.attr(`data-name`,this._name||null),this._items.forEach(e=>e.name(this._name)),this)}required(e){return e===void 0?this._required:(this._required=!!e,this.attr(`data-required`,this._required?`true`:null),this)}disabled(e){if(e===void 0)return this.getBooleanState(`disabled`);let t=!!e;return this.setState(`disabled`,t),this.attr(`aria-disabled`,t?`true`:null),this.style(`opacity`,t?`0.64`:`1`),this._items.forEach(e=>e.disabled(t)),this}change(e){return e===void 0?this._changeHandler:(this._changeHandler=typeof e==`function`?e:null,this)}options(e){return e===void 0?this._options.slice():(this._options=Array.isArray(e)?e.slice():[],this._renderOptions(),this)}value(e){if(e===void 0){let e=this._items.find(e=>e.checked());return e?e.optionValue():null}let t=e==null?null:String(i(e));return this._items.forEach(e=>{e.checked(String(e.optionValue())===t)}),this}checkedValue(e){return this.value(e)}clear(){return this.value(null)}_renderOptions(){let e=this._options.map((e,t)=>Pr(e,t));this._items=e,a(this,e),this._items.forEach(e=>{e.on(`change`,()=>this._handleItemChange(e)),this._name&&e.name(this._name)}),this.value(this.value())}_handleItemChange(e){e.checked()&&(this._items.forEach(t=>{t!==e&&t.checked(!1)}),typeof this._changeHandler==`function`&&this._changeHandler(e.optionValue(),this))}_setupRadios(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{children:t,change:n,disabled:r,name:i,options:a,required:o,value:s,...c}=e;Object.keys(c).length>0&&this.setup(c),i!==void 0&&this.name(i),n!==void 0&&this.change(n),a===void 0?t!==void 0&&this.options(t):this.options(a),o!==void 0&&this.required(o),r!==void 0&&this.disabled(r),s!==void 0&&this.value(s);return}if(Array.isArray(e)){this.options(e);return}this.options([e])}}},dr=class extends y{constructor(t=null){super(`div`,null),this._mode=`view`,this._control=null,this._hintVisible=!1,this._hovered=!1,this._headerBox=new y(`div`).className(`yoya-vfield-header`),this._displayBox=new y(`div`).className(`yoya-vfield-display`),this._editorBox=new y(`div`).className(`yoya-vfield-editor`).style(`display`,`none`),this._labelBox=new y(`div`).className(`yoya-vfield-label`),this._hintBox=new y(`div`).className(`yoya-vfield-hint`).style(`display`,`none`),this._errorBox=new y(`div`).className(`yoya-vfield-error`).style(`display`,`none`),this._actionButton=new J(`✎`).className(`yoya-vfield-action`).size(`small`).variant(`secondary`).attr({tabindex:`-1`,"aria-hidden":`true`}).on(`click`,e=>{e.preventDefault(),e.stopPropagation(),this.mode(this._mode===`edit`?`view`:`edit`)}),this._confirmButton=new y(`button`).className(`yoya-vfield-confirm`).attr({type:`button`,"aria-label":`确认`,title:`确认`}).text(`✓`).styles({background:`transparent`,border:`0`,color:D(`color-primary`,`#1f6feb`),cursor:`pointer`,font:`inherit`,fontWeight:`700`,lineHeight:`1.35`,opacity:`0`,padding:`0 4px`,pointerEvents:`none`}).on(`click`,()=>this.view()),this._cancelButton=new y(`button`).className(`yoya-vfield-cancel`).attr({type:`button`,"aria-label":`取消`,title:`取消`}).text(`✕`).styles({background:`transparent`,border:`0`,color:D(`color-text-secondary`,`#6f6f6f`),cursor:`pointer`,font:`inherit`,fontWeight:`700`,lineHeight:`1.35`,opacity:`0`,padding:`0 4px`,pointerEvents:`none`}).on(`click`,()=>this.cancel()),this.className(E,`yoya-vfield`),this.styles({display:`grid`,gap:`8px`,minWidth:`0`,position:`relative`}),this._headerBox.styles({alignItems:`center`,display:`flex`,gap:`8px`,justifyContent:`space-between`,minWidth:`0`}),this._labelBox.styles({color:D(`color-text-strong`,`#111827`),flex:`1 1 auto`,fontWeight:`700`,lineHeight:`1.35`}),this._displayBox.styles({alignItems:`center`,border:e(`color-border`,`#d8dee8`),borderRadius:`6px`,boxSizing:`border-box`,color:D(`color-text`,`#172033`),display:`flex`,minHeight:`var(--yoya-control-height-md, 34px)`,padding:`0 12px`,width:`100%`}),this._editorBox.styles({background:D(`color-surface`,`#ffffff`),borderRadius:`6px`,boxShadow:`0 6px 20px rgba(0, 0, 0, 0.18)`,boxSizing:`border-box`,left:`0`,minHeight:`var(--yoya-control-height-md, 34px)`,minWidth:`0`,padding:`0`,position:`absolute`,top:`0`,width:`100%`,zIndex:`var(--yoya-z-overlay, 1200)`}),this._hintBox.styles({color:D(`color-text-muted`,`#64748b`),fontSize:`12px`,lineHeight:`1.45`}),this._errorBox.styles({color:D(`color-text-danger`,`#b91c1c`),fontSize:`12px`,lineHeight:`1.45`}),this._actionButton.styles({flexShrink:`0`,gap:`0`,minWidth:`32px`,opacity:`0`,pointerEvents:`none`,transition:`opacity 120ms ease`}),this._headerBox.child(this._labelBox,this._actionButton,this._confirmButton,this._cancelButton),this.child(this._headerBox,this._displayBox,this._editorBox,this._hintBox,this._errorBox),this.on(`mouseenter`,()=>{this._hovered=!0,this._syncActionButton()}),this.on(`mouseleave`,()=>{this._hovered=!1,this._syncActionButton()}),this._setupField(t),this._syncActionButton(),this.on(`dblclick`,e=>{e.defaultPrevented||this._mode===`view`&&this.control()&&this.edit()})}renderDom(){let e=super.renderDom();return this._mode===`edit`&&(this._positionEditor(),this._focusEditor()),e}_syncEditorSurface(){let e=this.control();return!e||!e._input||e._input._tagName!==`textarea`?this:(e._input.style(`border`,`0`),e._input.style(`boxShadow`,null),e._input.style(`background`,`transparent`),this)}_positionEditor(){if(!this._el)return this;let e=this._displayBox._el||this._el,t=this._el.getBoundingClientRect(),n=e.getBoundingClientRect();return this._editorBox.styles({left:n.left-t.left+`px`,minHeight:n.height+`px`,top:n.top-t.top+`px`,width:n.width+`px`}),this}_focusEditor(){if(!this._editorBox._el)return this;let e=this._editorBox._el.querySelector(`input, textarea, select`);return e&&typeof e.focus==`function`&&e.focus(),this}label(e){return e===void 0?this._labelBox.textContent():(a(this._labelBox,S(e)),this)}hint(e){if(e===void 0)return this._hintBox.textContent();let t=e!=null&&e!==``;return this._hintVisible=t,this._hintBox.style(`display`,this._hintVisible?null:`none`),a(this._hintBox,t?S(e):[]),this}error(e){if(e===void 0)return this._errorBox.textContent();let t=e!=null&&e!==``;return this._errorBox.style(`display`,t?null:`none`),this.attr(`data-error`,t?`true`:null),this._hintBox.style(`display`,t?`none`:this._hintVisible?null:`none`),a(this._errorBox,t?S(e):[]),this}display(e){return e===void 0?this._displayBox.textContent():typeof e==`function`?(O(this._displayBox,e),this):(a(this._displayBox,S(e)),this)}formatter(e){return e===void 0?this._formatter:(this._formatter=typeof e==`function`?e:null,this._mode===`view`&&this._syncDisplayFromControl(),this)}displayClass(...e){return e.length===0?this._displayBox.className():(this._displayBox.className(...e),this)}displayStyle(e){return e===void 0?this._displayBox.styles():(this._displayBox.styles(e),this)}control(e){return e===void 0?this._control??Hr(this._editorBox):(O(this._editorBox,e),this._control=Hr(this._editorBox),this._syncEditorSurface(),this._mode===`view`&&this._syncDisplayFromControl(),this._syncActionButton(),this)}editor(e){return this.control(e)}value(e){let t=this.control();return e===void 0?t?Q(t):this._displayBox.textContent():(t?Ir(t,e):this.display(e),this._mode===`view`&&this._syncDisplayFromControl(),this)}mode(e){return e===void 0?this._mode:(this._mode=e===`edit`?`edit`:`view`,this.attr(`data-mode`,this._mode),this._mode===`edit`?(this._editSnapshot=this.control()?Q(this.control()):null,this._displayBox.style(`visibility`,`hidden`),this._editorBox.style(`display`,null),this._positionEditor(),this._focusEditor()):(this._editorBox.style(`display`,`none`),this._displayBox.style(`visibility`,null),this._syncDisplayFromControl()),this._syncActionButton(),this)}view(){return this.mode(`view`)}edit(){return this.mode(`edit`)}cancel(){let e=this.control();return e&&this._editSnapshot!==null&&this._editSnapshot!==void 0&&Ir(e,this._editSnapshot),this._editSnapshot=null,this.view()}_syncDisplayFromControl(){let e=this.control();if(!e)return this;let t=Q(e),n=this._formatter?this._formatter(t,this):Dr(t);return a(this._displayBox,S(n??t)),this}_syncActionButton(){if(!this._actionButton)return this;let e=!!this.control(),t=this._mode===`edit`,n=e&&!t&&this._hovered;return this._actionButton.label(`✎`),this._actionButton.attr({"aria-hidden":n?null:`true`,"aria-label":`编辑`,title:`编辑`}),this._actionButton.attr(`tabindex`,n?null:`-1`),this._actionButton.style(`opacity`,n?`1`:`0`),this._actionButton.style(`pointerEvents`,n?null:`none`),[this._confirmButton,this._cancelButton].forEach(e=>{if(!e)return;let n=e===this._confirmButton?`确认`:`取消`;e.attr({"aria-hidden":t?null:`true`,"aria-label":n,title:n}),e.attr(`tabindex`,t?null:`-1`),e.style(`opacity`,t?`1`:`0`),e.style(`pointerEvents`,t?null:`none`)}),this}_setupField(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{children:t,control:n,display:r,displayClass:i,displayStyle:a,editor:o,error:s,formatter:c,hint:l,label:u,mode:d,value:f,...p}=e;Object.keys(p).length>0&&this.setup(p),u!==void 0&&this.label(u),l!==void 0&&this.hint(l),r!==void 0&&this.display(r),c!==void 0&&this.formatter(c),i!==void 0&&this.displayClass(...Array.isArray(i)?i:[i]),a!==void 0&&this.displayStyle(a),o===void 0?n===void 0?t!==void 0&&this.editor(t):this.control(n):this.editor(o),f!==void 0&&this.value(f),s!==void 0&&this.error(s),d!==void 0&&this.mode(d);return}this.display(e)}}},fr=class extends y{constructor(e=null){super(`div`,null),this._collectValue=null,this._fallbackMessage=`校验未通过`,this._hintVisible=!1,this._name=``,this._required=!1,this._requiredIndicatorContent=null,this._requiredMessage=`该项为必填`,this._validators=[],this._labelBox=new y(`label`).className(`yoya-vform-item-label`),this._requiredIndicator=new y(`span`).className(`yoya-vform-item-required-indicator`).style(`display`,`none`),this._labelRow=new y(`div`).className(`yoya-vform-item-label-row`),this._editorBox=new y(`div`).className(`yoya-vform-item-editor`),this._hintBox=new y(`div`).className(`yoya-vform-item-hint`).style(`display`,`none`),this._errorBox=new y(`div`).className(`yoya-vform-item-error`).style(`display`,`none`),this.className(E,`yoya-vform-item`),this.styles({display:`grid`,gap:`6px`,minWidth:`0`}),this._labelBox.styles({color:D(`color-text-strong`,`#111827`),fontWeight:`700`,lineHeight:`1.35`}),this._requiredIndicator.styles({color:D(`color-danger`,`#dc2626`),fontWeight:`700`,lineHeight:`1.35`}),this._labelRow.styles({alignItems:`center`,display:`flex`,gap:`4px`,minWidth:`0`}),this._editorBox.styles({minWidth:`0`}),this._hintBox.styles({color:D(`color-text-muted`,`#64748b`),fontSize:`12px`,lineHeight:`1.45`}),this._errorBox.styles({color:D(`color-text-danger`,`#b91c1c`),fontSize:`12px`,lineHeight:`1.45`}),this._labelRow.child(this._requiredIndicator,this._labelBox),this.child(this._labelRow,this._editorBox,this._hintBox,this._errorBox),this._editorBox.collectValue=e=>e===void 0?this._collectValue:(this._collectValue=typeof e==`function`?e:null,this._editorBox._collectValue=this._collectValue,this._editorBox),this._editorBox.on(`input`,()=>this.error(``)),this._editorBox.on(`change`,()=>this.error(``)),this._setupFormItem(e)}name(e){return e===void 0?this._name:(this._name=i(e),this)}label(e){return e===void 0?this._labelBox.textContent():(a(this._labelBox,S(e)),this)}hint(e){if(e===void 0)return this._hintBox.textContent();let t=e!=null&&e!==``;return this._hintVisible=t,this._hintBox.style(`display`,this._hintVisible?null:`none`),a(this._hintBox,t?S(e):[]),this}error(e){if(e===void 0)return this._errorBox.textContent();let t=e!=null&&e!==``;return this._errorBox.style(`display`,t?null:`none`),this.attr(`data-error`,t?`true`:null),this._hintBox.style(`display`,t?`none`:this._hintVisible?null:`none`),a(this._errorBox,t?S(e):[]),this}control(e){return e===void 0?this._editorBox:(O(this._editorBox,e),this)}editor(e){return this.control(e)}required(e=!0,t){if(e===void 0)return this._required;let n=null;return typeof e==`string`?(this._required=!0,this._requiredMessage=e,N(t)?n=t.indicator??null:t!==void 0&&(n=t)):N(e)?(this._required=!0,e.message!==void 0&&(this._requiredMessage=i(e.message)),n=e.indicator??null):(this._required=!!e,N(t)?(t.message!==void 0&&(this._requiredMessage=i(t.message)),n=t.indicator??null):t!==void 0&&(n=t)),this._requiredIndicatorContent=n??null,this._syncRequiredIndicator(),this.attr(`data-required`,this._required?`true`:null),this}_syncRequiredIndicator(){let e=this._requiredIndicatorContent!==null&&this._requiredIndicatorContent!==void 0&&this._requiredIndicatorContent!==``;return this._requiredIndicator.style(`display`,e?null:`none`),a(this._requiredIndicator,e?S(this._requiredIndicatorContent):[]),this}validate(e){return e===void 0?this._validators.slice():(typeof e==`function`&&this._validators.push(e),this)}rules(e){return Array.isArray(e)&&e.forEach(e=>this.validate(e)),this}value(e){return e===void 0?Q(this._editorBox):(Ir(this._editorBox,e),this)}_validate(e){let t=Hr(this._editorBox),n=this.value();if(this._required&&kr(n,t))return this.error(this._requiredMessage),!1;for(let t of this._validators){let r=t(n,e,this);if(typeof r==`string`&&r)return this.error(r),!1;if(r===!1)return this.error(this._fallbackMessage),!1}return this.error(``),!0}_setupFormItem(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{children:t,control:n,editor:r,error:i,hint:a,label:o,name:s,required:c,rules:l,validate:u,value:d,...f}=e;Object.keys(f).length>0&&this.setup(f),s!==void 0&&this.name(s),o!==void 0&&this.label(o),a!==void 0&&this.hint(a),r===void 0?n===void 0?t!==void 0&&this.editor(t):this.control(n):this.editor(r),c!==void 0&&this.required(c),u!==void 0&&this.validate(u),l!==void 0&&this.rules(l),d!==void 0&&this.value(d),i!==void 0&&this.error(i);return}this.label(e)}}},pr=class extends y{constructor(e=null){super(`form`,null),this.className(E,`yoya-vform`),this.styles({display:`grid`,gap:`16px`,minWidth:`0`}),this._setupForm(e)}values(e){if(e===void 0){let e={};return Lr(this,e),e}return N(e)&&Rr(this,e),this}value(e){return this.values(e)}validate(){let e=this.values();return zr(this,e)}reset(){return this._el?.reset&&this._el.reset(),this}submit(){return this._el?.requestSubmit?this._el.requestSubmit():this._el?.dispatchEvent&&this._el.dispatchEvent(new Event(`submit`,{bubbles:!0,cancelable:!0})),this}_setupForm(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{children:t,values:n,...r}=e;Object.keys(r).length>0&&this.setup(r),t!==void 0&&j(this,t),n!==void 0&&this.values(n);return}this.child(e)}}};function mr(e=null,t=null,n=null){return T(Qn,e,t,n)}function hr(e=null,t=null,n=null){return T($n,e,t,n)}function gr(e=null,t=null,n=null){return T(er,e,t,n)}function _r(e=null,t=null,n=null){return T(tr,e,t,n)}function vr(e=null,t=null,n=null){return T(nr,e,t,n)}function yr(e=null,t=null,n=null){return T(X,e,t,n)}function br(e=null,t=null,n=null){return T(ir,e,t,n)}function xr(e=null,t=null,n=null){return T(ar,e,t,n)}function Sr(e=null,t=null,n=null){return T(Z,e,t,n)}function Cr(e=null,t=null,n=null){return T(ur,e,t,n)}function wr(e=null,t=null,n=null){return T(dr,e,t,n)}function Tr(e=null,t=null,n=null){return T(fr,e,t,n)}function Er(e=null,t=null,n=null){return T(pr,e,t,n)}d(y,{vCheckbox:yr,vCheckboxes:xr,vField:wr,vForm:Er,vFormItem:Tr,vInput:mr,vRadio:Sr,vRadios:Cr,vSelect:vr,vSwitch:br,vTimer:hr,vTimerRange:gr,vTextarea:_r});function Dr(e){return Array.isArray(e)?e.map(e=>i(e)).join(`, `):typeof e==`boolean`?e?`true`:`false`:i(e)}function Or(e){return e==null||e===``?[]:Array.isArray(e)?e.map(e=>i(e)):[i(e)]}function kr(e,t=null){return t instanceof Y&&e===0||e==null||e===``?!0:Array.isArray(e)?e.length===0:!1}function Ar(e,t,n){if(e instanceof y&&e.tagName?.()===`option`){let n=e;return n.attr(`selected`,i(n.attr(`value`))===t||null),n}let r=jr(e,n),o=new y(`option`).className(`yoya-vselect-option`),s=r.value===t;return o.attr(`value`,r.value),o.attr(`selected`,s?!0:null),r.disabled&&o.attr(`disabled`,!0),s&&o.styles({color:D(`color-text`,`#172033`)}),a(o,S(r.label)),o}function jr(e,t){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`){let t=i(e);return{label:t,value:t}}if(Array.isArray(e)&&e.length>0){let[t,n=t]=e;return{label:n??t??``,value:i(t)}}if(e instanceof o)return{label:e,value:e.textContent()};if(N(e)){let n=e.value??e.key??e.id??e.label??e.text??e.title??`option-${t}`,r=e.label??e.text??e.content??e.title??n;return{disabled:!!e.disabled,label:r,value:i(n)}}let n=i(e);return{label:n,value:n}}function Mr(e,t){if(e instanceof X)return e;if(e instanceof o&&!(e instanceof y))return yr(e);let n=Nr(e,t);return new X({checked:n.checked,description:n.description,disabled:n.disabled,label:n.label,optionValue:n.value,required:n.required})}function Nr(e,t){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`){let t=i(e);return{label:t,value:t}}if(Array.isArray(e)&&e.length>0){let[t,n=t]=e;return{label:n??t??``,value:i(t)}}if(e instanceof X)return{checked:e.checked(),description:e.description(),disabled:e.disabled(),label:e.label(),required:e.required(),value:e.optionValue()};if(e instanceof o)return{label:e,value:e.textContent()};if(N(e)){let n=e.value??e.key??e.id??e.label??e.text??`option-${t}`,r=e.label??e.text??e.content??e.title??n;return{checked:!!e.checked,description:e.description,disabled:!!e.disabled,label:r,required:!!e.required,value:i(n)}}let n=i(e);return{label:n,value:n}}function Pr(e,t){if(e instanceof Z)return e;if(e instanceof o&&!(e instanceof y))return Sr(e);let n=Fr(e,t);return new Z({checked:n.checked,description:n.description,disabled:n.disabled,label:n.label,optionValue:n.value,required:n.required})}function Fr(e,t){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`){let t=i(e);return{label:t,value:t}}if(Array.isArray(e)&&e.length>0){let[t,n=t]=e;return{label:n??t??``,value:i(t)}}if(e instanceof Z)return{checked:e.checked(),description:e.description(),disabled:e.disabled(),label:e.label(),required:e.required(),value:e.optionValue()};if(e instanceof o)return{label:e,value:e.textContent()};if(N(e)){let n=e.value??e.key??e.id??e.label??e.text??`option-${t}`,r=e.label??e.text??e.content??e.title??n;return{checked:!!e.checked,description:e.description,disabled:!!e.disabled,label:r,required:!!e.required,value:i(n)}}let n=i(e);return{label:n,value:n}}function Q(e){if(!e)return;if(typeof e._collectValue==`function`)return e._collectValue();if(e instanceof ar||e instanceof ur||e instanceof Y||e instanceof Ln||e instanceof Bn||e instanceof Gn||e instanceof qn||e instanceof X||e instanceof ir||e instanceof Z||e instanceof Qn||e instanceof nr||e instanceof tr)return e.value();let t=typeof e.tagName==`function`?e.tagName():``;if(t===`input`){let t=i(e.attr(`type`)||`text`).toLowerCase();return t===`checkbox`||t===`radio`?e._el?.checked??!!e.attr(`checked`):e._el?.value??e.attr(`value`)??``}if(t===`select`)return e._el?.value??e.attr(`value`)??``;if(t===`textarea`)return e._el?.value??e.textContent();if(typeof e.value==`function`)try{return e.value()}catch{return}if(typeof e.children==`function`)for(let t of e.children()){let e=Q(t);if(e!==void 0)return e}}function Ir(e,t){if(!e)return;if(e instanceof ar){e.value(t);return}if(e instanceof ur){e.value(t);return}if(e instanceof Y){e.value(t);return}if(e instanceof Ln||e instanceof Bn||e instanceof Gn||e instanceof qn){e.value(t);return}if(e instanceof X||e instanceof ir||e instanceof Z){e.value(t);return}if(e instanceof Qn||e instanceof nr||e instanceof tr){e.value(t);return}let n=typeof e.tagName==`function`?e.tagName():``;if(n===`textarea`){a(e,S(i(t))),e._el&&(e._el.value=i(t));return}if(n===`select`||n===`input`){let r=n===`input`?i(e.attr(`type`)||`text`).toLowerCase():``;r===`checkbox`||r===`radio`?e.attr(`checked`,t?!0:null):e.attr(`value`,i(Array.isArray(t)?t[0]:t));return}if(typeof e.value==`function`){e.value(t);return}if(typeof e.children==`function`){for(let n of e.children())if(Q(n)!==void 0||typeof n.value==`function`){Ir(n,t);return}}}function Lr(e,t){if(!e||typeof e!=`object`)return t;if(e instanceof pr||e instanceof dr)return e.children().forEach(e=>Lr(e,t)),t;if(e instanceof fr){let n=e.name();return n&&Ur(t,n,e.value()),t}if(e instanceof ar){let n=e.name();return n&&Ur(t,n,e.value()),t}if(e instanceof ur){let n=e.name();return n&&Ur(t,n,e.value()),t}if(e instanceof Qn||e instanceof nr||e instanceof tr||e instanceof X||e instanceof Z||e instanceof ir||e instanceof Y||e instanceof Ln||e instanceof Bn||e instanceof Gn||e instanceof qn){let n=e.name();return n&&Ur(t,n,Q(e)),t}let n=typeof e.tagName==`function`?e.tagName():``;if(n===`input`||n===`select`||n===`textarea`){let n=typeof e.name==`function`?e.name():e.attr?.(`name`);return n&&Ur(t,n,Q(e)),t}return typeof e.children==`function`&&e.children().forEach(e=>Lr(e,t)),t}function Rr(e,t){if(!e||typeof e!=`object`||!N(t))return e;function n(e){if(!e||typeof e!=`object`)return;if(e instanceof dr||e instanceof pr){e.children().forEach(e=>n(e));return}if(e instanceof fr){let n=e.name();n&&Object.prototype.hasOwnProperty.call(t,n)&&e.value(t[n]);return}let r=typeof e.name==`function`?e.name():e.attr?.(`name`);if(r&&Object.prototype.hasOwnProperty.call(t,r)){Ir(e,t[r]);return}typeof e.children==`function`&&e.children().forEach(e=>n(e))}return n(e),e}function zr(e,t={}){let n=!0;function r(e){if(e){if(e instanceof fr){e._validate(t)||(n=!1);return}if(e instanceof pr||e instanceof dr){e.children().forEach(e=>r(e));return}if(e instanceof ar||e instanceof ur||e instanceof Qn||e instanceof nr||e instanceof tr||e instanceof X||e instanceof Z||e instanceof ir||e instanceof Y||e instanceof Ln||e instanceof Bn||e instanceof Gn||e instanceof qn||typeof e.tagName==`function`&&[`input`,`select`,`textarea`].includes(e.tagName())){if(!Vr(e)&&Br(e)){let t=Q(e);if(e instanceof Y&&t===0){n=!1;return}n=Array.isArray(t)?t.length>0:typeof t==`boolean`?t:t!=null&&String(t).length>0}return}typeof e.children==`function`&&e.children().forEach(e=>r(e))}}return r(e),n}function Br(e){if(!e)return!1;if(typeof e.required==`function`)try{return!!e.required()}catch{return!1}return!!e.attr?.(`required`)}function Vr(e){if(!e)return!1;if(typeof e.disabled==`function`)try{return!!e.disabled()}catch{return!1}return!!e.attr?.(`disabled`)}function Hr(e){if(!e||typeof e!=`object`)return null;if(e instanceof Qn||e instanceof nr||e instanceof tr||e instanceof ar||e instanceof ur||e instanceof X||e instanceof Z||e instanceof ir||e instanceof Y||e instanceof Ln||e instanceof Bn||e instanceof Gn||e instanceof qn)return e;if(typeof e.children!=`function`)return null;for(let t of e.children()){let e=Hr(t);if(e)return e}return null}function Ur(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)){let r=e[t];if(Array.isArray(r)){Array.isArray(n)?e[t]=r.concat(n):r.push(n);return}e[t]=Array.isArray(n)?[r].concat(n):[r,n];return}e[t]=n}var Wr=class extends y{constructor(e=null){super(`div`,null),this._accept=``,this._disabled=!1,this._multiple=!1,this._name=``,this._files=[],this._input=new y(`input`).attr({tabindex:`-1`,type:`file`}).style(`display`,`none`),this._dropZone=new y(`div`).className(`yoya-vupload-dropzone`).attr({role:`button`,tabindex:`0`}),this._list=new y(`ul`).className(`yoya-vupload-list`),this.className(E,`yoya-vupload`),this.styles({display:`grid`,gap:`10px`,minWidth:`0`,width:`100%`}),this.child(this._input,this._dropZone,this._list),this._input.on(`change`,()=>this._handleInputChange()),this._dropZone.on(`click`,()=>this._openPicker()),this._dropZone.on(`keydown`,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this._openPicker())}),this._dropZone.on(`dragenter`,e=>{e.preventDefault(),this._setDragging(!0)}),this._dropZone.on(`dragover`,e=>{e.preventDefault(),this._setDragging(!0)}),this._dropZone.on(`dragleave`,()=>this._setDragging(!1)),this._dropZone.on(`drop`,e=>this._handleDrop(e)),this._setupUpload(e),this._sync()}name(e){return e===void 0?this._name:(this._name=i(e),this)}accept(e){return e===void 0?this._accept:(this._accept=e?String(e):``,this._input.attr(`accept`,this._accept||null),this.attr(`data-accept`,this._accept||null),this)}multiple(e){if(e===void 0)return this._multiple;let t=!!e;return this._multiple=t,this._input.attr(`multiple`,t?!0:null),this.attr(`data-multiple`,t?`true`:null),this}disabled(e){if(e===void 0)return this._disabled;let t=!!e;return this._disabled=t,this.attr(`data-disabled`,t?`true`:null),this._dropZone.attr(`aria-disabled`,t?`true`:null),this._dropZone.attr(`tabindex`,t?`-1`:`0`),this._input.attr(`disabled`,t?!0:null),this._sync(),this}files(e){return e===void 0?this._files.map(e=>e.file):(this._files=Kr(e),this._sync(),this._emitChange(),this)}items(e){return e===void 0?this._files.slice():this.files(e)}value(e){return this.files(e)}addFiles(e){if(!e||this._disabled)return this;let t=Array.from(e).filter(e=>this._acceptsFile(e));return t.length===0?this:(this._multiple||(this._files=[]),t.forEach(e=>{this._files.push({file:e,name:e.name,progress:0,size:e.size,status:`ready`})}),this._sync(),this._emitChange(),this)}remove(e){let t=Number.isInteger(e)?e:this._files.findIndex(t=>t.name===e);return t>=0&&t<this._files.length&&(this._files.splice(t,1),this._sync(),this._emitChange()),this}clear(){return this._files.length>0&&(this._files=[],this._sync(),this._emitChange()),this}status(e,t){let n=this._files[e];return n&&t!==void 0&&(n.status=i(t),this._sync()),n?n.status:null}progress(e,t){let n=this._files[e];return n&&t!==void 0&&(n.progress=Math.max(0,Math.min(100,Number(t)||0)),this._sync()),n?n.progress:null}dropZone(e){return e===void 0?this._dropZone:(O(this._dropZone,e),this)}_openPicker(){this._disabled||this._input._el?.click()}_handleInputChange(){this._input._el?.files&&this.addFiles(this._input._el.files),this._input._el&&(this._input._el.value=``)}_handleDrop(e){e.preventDefault(),this._setDragging(!1),!this._disabled&&e.dataTransfer?.files&&this.addFiles(e.dataTransfer.files)}_setDragging(e){this._dropZone.attr(`data-dragging`,e?`true`:null)}_acceptsFile(e){if(!this._accept)return!0;let t=this._accept.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean),n=(e.type||``).toLowerCase(),r=(e.name||``).toLowerCase();return t.some(e=>e===`*`||e===`*/*`?!0:e.startsWith(`.`)?r.endsWith(e):e.endsWith(`/*`)?n.startsWith(e.slice(0,-1)):n===e)}_sync(){return this.attr(`data-count`,String(this._files.length)),this._dropZone.attr(`data-disabled`,this._disabled?`true`:null),this._dropZone.children().length===0&&this._dropZone.child(z().styles({color:D(`color-primary`,`#2563eb`),height:`28px`,width:`28px`}),new y(`span`).className(`yoya-vupload-dropzone-title`).text(`点击或拖拽文件到此处`),new y(`span`).className(`yoya-vupload-dropzone-hint`).text(this._multiple?`支持选择多个文件`:`支持选择单个文件`)),a(this._list,this._files.map((e,t)=>this._createItem(e,t))),this}_createItem(e,t){let n=new y(`li`).className(`yoya-vupload-item`).attr({"data-file-index":String(t)}),r=new y(`div`).className(`yoya-vupload-item-info`),i=new y(`strong`).className(`yoya-vupload-item-name`).text(e.name),a=new y(`span`).className(`yoya-vupload-item-meta`).text(`${qr(e.size)} · ${e.status}`),o=new y(`div`).className(`yoya-vupload-progress`).attr(`data-status`,e.status).style(`display`,e.status===`uploading`?null:`none`),s=new y(`span`).className(`yoya-vupload-progress-bar`).style(`width`,`${e.progress}%`),c=new y(`button`).className(`yoya-vupload-remove`).attr({"aria-label":`删除 ${e.name}`,title:`删除`,type:`button`}).on(`click`,()=>this.remove(t));return o.child(s),r.child(i,a,o),c.child(l().styles({height:`12px`,width:`12px`})),n.child(r,c),n}_emitChange(){if(!this._el)return;let e=this._el.ownerDocument?.defaultView?.Event||Event;this._el.dispatchEvent(new e(`change`,{bubbles:!0}))}_setupUpload(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{accept:t,children:n,disabled:r,dropZone:i,files:a,items:o,multiple:s,name:c,...l}=e;Object.keys(l).length>0&&this.setup(l),c!==void 0&&this.name(c),t!==void 0&&this.accept(t),s!==void 0&&this.multiple(s),r!==void 0&&this.disabled(r),i===void 0?n!==void 0&&this.dropZone(n):this.dropZone(i);let u=o??a;u!==void 0&&this.files(u);return}this.dropZone(e)}}};function Gr(e=null,t=null,n=null){return T(Wr,e,t,n)}d(y,{vUpload:Gr});function Kr(e){return Array.isArray(e)?e.map(e=>e instanceof File?{file:e,name:e.name,progress:0,size:e.size,status:`ready`}:e&&typeof e==`object`&&e.file?{file:e.file,name:e.name??e.file.name,progress:Number(e.progress)||0,size:e.size??e.file.size,status:e.status??`ready`}:null).filter(Boolean):[]}function qr(e){let t=Number(e)||0;return t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`}var Jr=class extends y{constructor(e=null){super(`div`,null),this._accept=`image/*`,this._disabled=!1,this._name=``,this._objectUrl=null,this._shape=`circle`,this._size=96,this._value=null,this._input=new y(`input`).attr({accept:`image/*`,tabindex:`-1`,type:`file`}).style(`display`,`none`),this._preview=new y(`div`).className(`yoya-vavatar-upload-preview`).attr({role:`button`,tabindex:`0`}),this._remove=new y(`button`).className(`yoya-vavatar-upload-remove`).attr({"aria-label":`移除头像`,title:`移除`,type:`button`}).child(l().styles({height:`12px`,width:`12px`})).style(`display`,`none`),this.className(E,`yoya-vavatar-upload`),this.styles({display:`inline-grid`,gap:`8px`,justifyItems:`center`,minWidth:`0`}),this.child(this._input,this._preview,this._remove),this._input.on(`change`,()=>this._handleInputChange()),this._preview.on(`click`,()=>this._openPicker()),this._preview.on(`keydown`,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this._openPicker())}),this._preview.on(`dragenter`,e=>{e.preventDefault(),this._setDragging(!0)}),this._preview.on(`dragover`,e=>{e.preventDefault(),this._setDragging(!0)}),this._preview.on(`dragleave`,()=>this._setDragging(!1)),this._preview.on(`drop`,e=>this._handleDrop(e)),this._remove.on(`click`,e=>{e.stopPropagation(),this.remove()}),this._setupAvatarUpload(e),this._sync()}name(e){return e===void 0?this._name:(this._name=i(e),this)}accept(e){return e===void 0?this._accept:(this._accept=e?String(e):`image/*`,this._input.attr(`accept`,this._accept),this.attr(`data-accept`,this._accept),this)}shape(e){return e===void 0?this._shape:(this._shape=e===`square`?`square`:`circle`,this.attr(`data-shape`,this._shape),this._syncPreviewSize(),this)}size(e){return e===void 0?this._size:(this._size=Math.max(32,Number(e)||96),this.attr(`data-size`,String(this._size)),this._syncPreviewSize(),this)}disabled(e){return e===void 0?this._disabled:(this._disabled=!!e,this.attr(`data-disabled`,this._disabled?`true`:null),this._preview.attr(`aria-disabled`,this._disabled?`true`:null),this._preview.attr(`tabindex`,this._disabled?`-1`:`0`),this._input.attr(`disabled`,this._disabled?!0:null),this._sync(),this)}value(e){return e===void 0?this._value:(this._value=e instanceof File?e:null,this._sync(),this._emitChange(),this)}files(e){if(e===void 0)return this._value?[this._value]:[];let t=Array.isArray(e)?e[0]:e;return this.value(t)}items(e){return this.files(e)}addFiles(e){if(!e||this._disabled)return this;let t=Array.from(e).find(e=>this._acceptsFile(e));return t&&this.value(t),this}remove(){return this._value&&this.value(null),this}clear(){return this.remove()}destroy(){return this._releaseObjectUrl(),super.destroy()}_openPicker(){this._disabled||this._input._el?.click()}_handleInputChange(){this._input._el?.files&&this.addFiles(this._input._el.files),this._input._el&&(this._input._el.value=``)}_handleDrop(e){e.preventDefault(),this._setDragging(!1),!this._disabled&&e.dataTransfer?.files&&this.addFiles(e.dataTransfer.files)}_setDragging(e){this._preview.attr(`data-dragging`,e?`true`:null)}_acceptsFile(e){let t=this._accept.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean),n=(e.type||``).toLowerCase(),r=(e.name||``).toLowerCase();return t.some(e=>e===`*`||e===`*/*`?!0:e.startsWith(`.`)?r.endsWith(e):e.endsWith(`/*`)?n.startsWith(e.slice(0,-1)):n===e)}_sync(){return this._releaseObjectUrl(),a(this._preview,[]),this.attr(`data-has-value`,this._value?`true`:null),this._remove.style(`display`,this._value?null:`none`),this._value?(typeof URL<`u`&&typeof URL.createObjectURL==`function`&&(this._objectUrl=URL.createObjectURL(this._value)),this._preview.child(new y(`img`).className(`yoya-vavatar-upload-image`).attr({alt:`头像预览`,src:this._objectUrl||``}))):this._preview.child(new y(`div`).className(`yoya-vavatar-upload-fallback`).child(g().styles({color:D(`color-text-muted`,`#64748b`),height:`28px`,width:`28px`}),new y(`span`).className(`yoya-vavatar-upload-hint`).text(`点击上传头像`))),this._syncPreviewSize(),this}_syncPreviewSize(){this._preview.styles({borderRadius:this._shape===`square`?`10px`:`50%`,height:`${this._size}px`,width:`${this._size}px`})}_releaseObjectUrl(){this._objectUrl&&typeof URL<`u`&&typeof URL.revokeObjectURL==`function`&&URL.revokeObjectURL(this._objectUrl),this._objectUrl=null}_emitChange(){if(!this._el)return;let e=this._el.ownerDocument?.defaultView?.Event||Event;this._el.dispatchEvent(new e(`change`,{bubbles:!0}))}_setupAvatarUpload(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{accept:t,disabled:n,files:r,name:i,shape:a,size:o,value:s,...c}=e;Object.keys(c).length>0&&this.setup(c),i!==void 0&&this.name(i),t!==void 0&&this.accept(t),a!==void 0&&this.shape(a),o!==void 0&&this.size(o),n!==void 0&&this.disabled(n);let l=s??r?.[0];l!==void 0&&this.value(l);return}this.child(e)}}};function Yr(e=null,t=null,n=null){return T(Jr,e,t,n)}d(y,{vAvatarUpload:Yr});const Xr=`#f8fafc.#f1f5f9.#e2e8f0.#cbd5e1.#94a3b8.#64748b.#334155.#0f172a.#fee2e2.#fed7aa.#fef3c7.#dcfce7.#ccfbf1.#cffafe.#dbeafe.#e0e7ff.#f3e8ff.#fce7f3.#f87171.#fb923c.#facc15.#4ade80.#2dd4bf.#22d3ee.#60a5fa.#818cf8.#a78bfa.#f472b6.#ef4444.#f97316.#eab308.#22c55e.#14b8a6.#06b6d4.#3b82f6.#6366f1.#a855f7.#ec4899.#b91c1c.#b45309.#a16207.#15803d.#0f766e.#0891b2.#1d4ed8.#4338ca.#7e22ce.#be185d`.split(`.`);var Zr=class extends y{constructor(e=null,t=null,n=null){super(`div`,null),this.className(E,`yoya-vcolor-picker`),this.styles({position:`relative`}),this._value=null,this._alpha=100,this._presetColors=Xr.slice(),this._changeHandlers=[],this._open=!1,this._outsideListener=null,this._repositionListener=null,this._buildStructure(),this._setupColorPicker(e),w(this,t,n)}_buildStructure(){this._triggerPreview=new y(`span`).className(`yoya-vcolor-picker-trigger-preview`).attr(`data-vcolor-trigger-preview`,`true`).styles({border:`1px solid var(--yoya-color-border, #d8dee8)`,borderRadius:`4px`,boxSizing:`border-box`,display:`inline-block`,height:`16px`,width:`16px`}),this._triggerTextNode=m(``),this._triggerText=new y(`span`).className(`yoya-vcolor-picker-trigger-text`).attr(`data-vcolor-trigger-text`,`true`).child(this._triggerTextNode),this._trigger=new y(`button`).className(`yoya-vcolor-picker-trigger`).attr({"aria-expanded":`false`,"aria-haspopup":`true`,"data-vcolor-trigger":`true`,title:`选择颜色`,type:`button`}).styles({alignItems:`center`,background:`var(--yoya-color-surface, #ffffff)`,border:`1px solid var(--yoya-color-border, #d8dee8)`,borderRadius:`6px`,color:`inherit`,cursor:`pointer`,display:`inline-flex`,gap:`8px`,padding:`5px 10px`}).child(this._triggerPreview,this._triggerText).on(`click`,()=>this.toggle()),this._selected=new y(`div`).className(`yoya-vcolor-picker-selected`).attr(`data-vcolor-selected`,`true`).styles({alignItems:`center`,background:`var(--yoya-color-surface-hover, #f3f3f3)`,borderRadius:`6px`,display:`flex`,gap:`8px`,justifyContent:`space-between`,padding:`6px 8px`}),this._selectedPreview=new y(`span`).className(`yoya-vcolor-picker-selected-preview`).attr(`data-vcolor-selected-preview`,`true`).styles({border:`1px solid var(--yoya-color-border, #d8dee8)`,borderRadius:`4px`,boxSizing:`border-box`,display:`inline-block`,height:`18px`,width:`18px`}),this._selectedTextNode=m(``),this._selectedText=new y(`span`).className(`yoya-vcolor-picker-selected-text`).attr(`data-vcolor-selected-text`,`true`).child(this._selectedTextNode),this._clearSelectedButton=new y(`button`).className(`yoya-vcolor-picker-clear-selected`).attr({"aria-label":`清除已选颜色`,"data-vcolor-clear-selected":`true`,title:`清除已选颜色`,type:`button`}).styles({background:`transparent`,border:`0`,color:D(`color-text-muted`,`#64748b`),cursor:`pointer`,fontSize:`12px`,padding:`0`}).text(`清除`).on(`click`,()=>this.clearValue()),this._selected.child(this._selectedPreview,this._selectedText,this._clearSelectedButton),this._paletteBox=new y(`div`).className(`yoya-vcolor-picker-palette`).attr(`data-vcolor-palette`,`true`).styles({display:`grid`,gap:`5px`,gridTemplateColumns:`repeat(8, 18px)`}),this._alphaTextNode=m(`100%`),this._alphaInput=new y(`input`).attr({"data-vcolor-alpha":`true`,max:`100`,min:`0`,type:`range`,value:`100`}).styles({direction:`rtl`,height:`84px`,margin:`0`,writingMode:`vertical-lr`}).on(`input`,e=>this.alpha(Number(e.target.value))),this._alphaText=new y(`span`).className(`yoya-vcolor-picker-alpha-text`).attr(`data-vcolor-alpha-text`,`true`).styles({color:D(`color-text-muted`,`#64748b`),fontSize:`12px`,minWidth:`34px`,textAlign:`right`}).child(this._alphaTextNode),this._effectFill=new y(`div`).attr(`data-vcolor-effect-fill`,`true`).styles({borderRadius:`5px`,height:`100%`,width:`100%`}),this._effectBox=new y(`div`).className(`yoya-vcolor-picker-effect`).attr(`data-vcolor-effect`,`true`).styles({backgroundImage:`conic-gradient(#d3d3d3 25%, #ffffff 0 50%, #d3d3d3 0 75%, #ffffff 0)`,backgroundSize:`12px 12px`,border:`1px solid var(--yoya-color-border, #d8dee8)`,borderRadius:`6px`,boxSizing:`border-box`,height:`28px`,width:`28px`}).child(this._effectFill),this._sidePanel=new y(`div`).className(`yoya-vcolor-picker-side`).styles({alignItems:`center`,display:`flex`,flexDirection:`column`,gap:`8px`,minWidth:`28px`}).child(this._effectBox,this._alphaInput,this._alphaText),this._panel=new y(`div`).className(`yoya-vcolor-picker-popup`).attr(`data-vcolor-popup`,`true`).styles({background:`var(--yoya-color-surface, #ffffff)`,border:`1px solid var(--yoya-color-border, #d8dee8)`,borderRadius:`8px`,boxShadow:`var(--yoya-shadow-md, 0 8px 18px rgba(15, 23, 42, 0.1))`,boxSizing:`border-box`,display:`none`,left:`0`,minWidth:`250px`,padding:`10px`,position:`absolute`,top:`calc(100% + 6px)`,zIndex:`110`}).child(this._selected,new y(`div`).styles({display:`flex`,gap:`12px`,marginTop:`10px`}).child(this._paletteBox,this._sidePanel)),this.child(this._trigger,this._panel),this._renderPalette(),this._sync()}value(e){if(e===void 0)return this._value;if(e===null)return this.clearValue();let t=$r(e);return t?(this._value=t,this._sync(),this._notifyChange(),this):this}alpha(e){if(e===void 0)return this._alpha;let t=Number(e);return this._alpha=Number.isFinite(t)?Math.min(100,Math.max(0,Math.round(t))):100,this._sync(),this._notifyChange(),this}rgba(){if(!this._value)return null;let e=this._value.slice(1);return`rgba(${parseInt(e.slice(0,2),16)}, ${parseInt(e.slice(2,4),16)}, ${parseInt(e.slice(4,6),16)}, ${Math.round(this._alpha/100*1e3)/1e3})`}clearValue(){return this._value=null,this._sync(),this._notifyChange(),this}open(e=!0){return this._open=!!e,this._trigger.attr(`aria-expanded`,this._open?`true`:`false`),this._open?(this._panel.style(`display`,null),this._positionPanel()):this._panel.style(`display`,`none`),this._bindOutsideClose(this._open),this._bindReposition(this._open),this}close(){return this.open(!1)}toggle(){return this.open(!this._open)}palette(e){return e===void 0?[...this._presetColors]:(this._presetColors=ei(e),this._renderPalette(),this)}change(e){return e===void 0?this._changeHandlers.slice():(this._changeHandlers=[e],this)}onChange(e){return this.change(e)}renderDom(){let e=super.renderDom();return this._open&&this._positionPanel(),e}destroy(){return this._bindOutsideClose(!1),this._bindReposition(!1),super.destroy()}_bindOutsideClose(e){if(e&&!this._outsideUnbind){this._outsideListener=e=>{(!this._el||!this._el.contains(e.target))&&this.close()},this._outsideUnbind=x(`mousedown`,this._outsideListener);return}!e&&this._outsideUnbind&&(this._outsideUnbind(),this._outsideListener=null,this._outsideUnbind=null)}_bindReposition(e){if(e&&!this._repositionUnbind){this._repositionListener=()=>this._positionPanel();let e=P(`scroll`,this._repositionListener,!0),t=P(`resize`,this._repositionListener);this._repositionUnbind=()=>{e(),t()};return}!e&&this._repositionUnbind&&(this._repositionUnbind(),this._repositionListener=null,this._repositionUnbind=null)}_positionPanel(){if(typeof window>`u`||typeof document>`u`||!this._el||!this._trigger._el)return;let e=this._trigger._el.getBoundingClientRect(),t=this._panel._el;if(!t)return;let n=t.offsetWidth||250,r=t.offsetHeight||280,i=e.left;i+n>window.innerWidth-8&&(i=Math.max(8,window.innerWidth-n-8));let a=e.bottom+6;a+r>window.innerHeight-8&&(a=Math.max(8,e.top-r-6)),this._panel.styles({left:`${i}px`,position:`fixed`,top:`${a}px`})}_sync(){let e=this._value,t=this.rgba(),n=e?`${e} ${this._alpha}%`:`选择颜色`;return this._triggerPreview.style(`background`,t||`transparent`),this._triggerTextNode.textContent(n),this._selectedPreview.style(`background`,t||`transparent`),this._selectedTextNode.textContent(e?n:`未选择`),this._alphaInput.attr(`value`,String(this._alpha)),this._alphaTextNode.textContent(`${this._alpha}%`),this._effectFill.style(`background`,t||`transparent`),this}_notifyChange(){this._changeHandlers.forEach(e=>e(this._value,this._alpha,this))}_renderPalette(){return a(this._paletteBox,this._presetColors.map(e=>this._createSwatch(e))),this}_createSwatch(e){return new y(`button`).className(`yoya-vcolor-picker-swatch`).attr({"aria-label":`选择颜色 ${e}`,"data-vcolor-swatch":e,title:e,type:`button`}).styles({background:e,border:`1px solid var(--yoya-color-border, #d8dee8)`,borderRadius:`4px`,boxSizing:`border-box`,cursor:`pointer`,height:`18px`,padding:`0`,width:`18px`}).on(`click`,()=>this.value(e))}_setupColorPicker(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{alpha:t,change:n,color:r,onChange:i,open:a,palette:o,value:s,...c}=e;Object.keys(c).length>0&&this.setup(c),o!==void 0&&this.palette(o),s===void 0?r!==void 0&&this.value(r):this.value(s),t!==void 0&&this.alpha(t),n===void 0?i!==void 0&&this.onChange(i):this.change(n),a!==void 0&&this.open(a);return}this.value(e)}}};function Qr(e=null,t=null,n=null){return T(Zr,e,t,n)}d(y,{vColorPicker:Qr});function $r(e){if(e==null)return null;let t=String(e).trim(),n=/^#([0-9a-f]{3})$/i.exec(t);return n?`#${n[1].split(``).map(e=>e+e).join(``).toLowerCase()}`:/^#[0-9a-f]{6}$/i.test(t)?t.toLowerCase():null}function ei(e){return Array.isArray(e)?e.map(e=>$r(e)).filter(e=>e!==null):[]}function ti(){return Object.keys(L).filter(e=>/^[A-Z].*Outlined$/.test(e)&&typeof L[e]==`function`).sort()}var ni=class extends y{constructor(e=null,t=null,n=null){super(`div`,null),this.className(E,`yoya-vsvg-icon-picker`),this.styles({position:`relative`}),this._value=null,this._iconEntries=ti().map(e=>({factory:L[e],name:e})),this._changeHandlers=[],this._fillPending=!1,this._grid=null,this._renderedCount=0,this._triggerIcon=null,this._triggerText=null,this._buildStructure(),this._setupSvgIconPicker(e),w(this,t,n)}_buildStructure(){this._triggerIcon=new y(`span`).className(`yoya-vsvg-icon-picker-trigger-icon`).styles({alignItems:`center`,display:`inline-flex`,height:`16px`,justifyContent:`center`,width:`16px`}),this._triggerText=m(`选择图标`),this._trigger=new y(`button`).className(`yoya-vsvg-icon-picker-trigger`).attr({"aria-expanded":`false`,"aria-haspopup":`dialog`,"data-vsvg-icon-trigger":`true`,title:`选择图标`,type:`button`}).styles({alignItems:`center`,background:`var(--yoya-color-surface, #ffffff)`,border:`1px solid var(--yoya-color-border, #d8dee8)`,borderRadius:`6px`,boxSizing:`border-box`,color:`inherit`,cursor:`pointer`,display:`inline-flex`,gap:`8px`,minHeight:`34px`,padding:`5px 10px`}).child(this._triggerIcon,this._triggerText).on(`click`,()=>this.toggle()),this._dialog=Tn({open:!1,onClose:()=>this._trigger.attr(`aria-expanded`,`false`)}),this._dialog.className(`yoya-vsvg-icon-picker-dialog`),this._dialog.styles({maxWidth:`min(92vw, 760px)`}),this._dialog.content(e=>{e.div(e=>{e.className(`yoya-vsvg-icon-picker-dialog-title`),e.styles({color:D(`color-text`,`#172033`),fontSize:`15px`,fontWeight:`600`,marginBottom:`12px`}),e.text(`选择图标`)}),this._grid=new y(`div`).className(`yoya-vsvg-icon-picker-grid`).styles({boxSizing:`border-box`,display:`grid`,gap:`8px`,gridTemplateColumns:`repeat(auto-fill, minmax(56px, 1fr))`,height:`360px`,overflowY:`auto`,padding:`2px`}).on(`scroll`,()=>this._maybeLoadMoreIcons()),e.child(this._grid)}),this._renderGrid(),this.child(this._trigger,this._dialog)}_renderGrid(){this._grid&&(this._renderedCount===0&&(this._renderedCount=Math.min(24,this._iconEntries.length)),a(this._grid,[]),this._iconEntries.slice(0,this._renderedCount).forEach(e=>{this._grid.child(this._createCell(e))}))}_createCell(e){let{factory:t,name:n}=e,r=this._value===n,i=new y(`button`).className(`yoya-vsvg-icon-picker-cell`).attr({"aria-label":n,"aria-pressed":r?`true`:`false`,"data-icon-name":n,title:n,type:`button`}).styles({alignItems:`center`,background:r?D(`color-primary-subtle`,`#eff6ff`):`transparent`,border:r?`1px solid ${D(`color-primary`,`#2563eb`)}`:`1px solid ${D(`color-border-faint`,`#eef1f4`)}`,borderRadius:`8px`,boxSizing:`border-box`,color:`inherit`,cursor:`pointer`,display:`flex`,height:`56px`,justifyContent:`center`,padding:`0`,width:`100%`});return i.on(`mouseenter`,()=>{r||i.style(`background`,D(`color-surface-hover`,`#f0f2f5`))}),i.on(`mouseleave`,()=>{i.style(`background`,r?D(`color-primary-subtle`,`#eff6ff`):`transparent`)}),i.on(`click`,()=>{this.value(n),this.close()}),i.child(t().styles({height:`22px`,width:`22px`})),i}_renderMoreIcons(){if(!this._grid)return;let e=Math.min(this._iconEntries.length,this._renderedCount+24);for(;this._renderedCount<e;)this._grid.child(this._createCell(this._iconEntries[this._renderedCount])),this._renderedCount+=1}_maybeLoadMoreIcons(){if(!this._grid||this._renderedCount>=this._iconEntries.length)return;let e=this._grid._el;e&&e.scrollHeight-e.scrollTop-(e.clientHeight||0)<=120&&this._renderMoreIcons()}_fillViewport(){if(!this._grid)return;let e=this._grid._el;if(!e)return;let t=0;for(;this._renderedCount<this._iconEntries.length&&t<200&&!(e.scrollHeight>(e.clientHeight||0));)this._renderMoreIcons(),t+=1}_scheduleFill(){this._fillPending||(this._fillPending=!0,setTimeout(()=>{this._fillPending=!1,this._dialog.getBooleanState(`open`)&&this._fillViewport()},0))}_sync(){a(this._triggerIcon,[]);let e=this._iconEntries.find(e=>e.name===this._value);e?(this._triggerIcon.child(e.factory().styles({height:`16px`,width:`16px`})),this._triggerText.textContent(e.name)):this._triggerText.textContent(`选择图标`);let t=this._iconEntries.findIndex(e=>e.name===this._value);t>=this._renderedCount&&(this._renderedCount=t+1),this._renderGrid()}value(e){return e===void 0?this._value:e===null?this.clearValue():this._iconEntries.some(t=>t.name===e)?(this._value=e,this._sync(),this._notifyChange(),this):this}clearValue(){return this._value=null,this._sync(),this._notifyChange(),this}_collectValue(){return this._value}disabled(e){if(e===void 0)return this.getBooleanState(`disabled`);let t=!!e;return this.setState(`disabled`,t),this.attr(`data-disabled`,t?`true`:null),this._trigger.attr(`disabled`,t?!0:null),this}name(e){return e===void 0?this.attr(`data-name`)||``:(this.attr(`data-name`,e?String(e):null),this)}required(e){if(e===void 0)return this.getBooleanState(`required`);let t=!!e;return this.setState(`required`,t),this.attr(`data-required`,t?`true`:null),this}icons(e){if(e===void 0)return this._iconEntries.map(e=>e.name);let t=[];return(Array.isArray(e)?e:[e]).forEach(e=>{typeof e==`string`?typeof L[e]==`function`&&t.push({factory:L[e],name:e}):e&&typeof e.name==`string`&&typeof e.icon==`function`&&t.push({factory:e.icon,name:e.name})}),this._iconEntries=t,this._value!==null&&!t.some(e=>e.name===this._value)&&(this._value=null),this._renderedCount=0,this._sync(),this}open(e=!0){return this._trigger.attr(`aria-expanded`,e?`true`:`false`),this._dialog.open(e),e&&this._scheduleFill(),this}close(){return this.open(!1)}toggle(){return this._dialog.getBooleanState(`open`)?this.close():this.open()}change(e){return e===void 0?this._changeHandlers.slice():(this._changeHandlers=[e],this)}onChange(e){return this.change(e)}_notifyChange(){this._changeHandlers.forEach(e=>e(this._value,this))}_setupSvgIconPicker(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{change:t,disabled:n,icons:r,name:i,onChange:a,open:o,required:s,value:c,...l}=e;Object.keys(l).length>0&&this.setup(l),r!==void 0&&this.icons(r),c!==void 0&&this.value(c),t===void 0?a!==void 0&&this.onChange(a):this.change(t),n!==void 0&&this.disabled(n),i!==void 0&&this.name(i),s!==void 0&&this.required(s),o!==void 0&&this.open(o);return}this.value(e)}}};function ri(e=null,t=null,n=null){return T(ni,e,t,n)}d(y,{vSvgIconPicker:ri});var ii=class extends y{constructor(e=null){super(`span`,null),this._color=null,this._status=null,this._imageBox=new y(`img`).className(`yoya-vavatar-image`).attr(`alt`,``),this._contentBox=new y(`span`).className(`yoya-vavatar-content`),this._statusDot=new y(`span`).className(`yoya-vavatar-status`).attr(`aria-hidden`,`true`),this.className(E,`yoya-vavatar`),this.attr({role:`img`,"data-shape":`circle`,"data-size":`medium`}),this.child(this._imageBox,this._contentBox,this._statusDot),this._setupAvatar(e),this._syncAvatar()}text(e){return a(this._contentBox,S(e??``)),this.attr(`data-image`,null),this.attr(`aria-label`,oi(e,this.attr(`aria-label`))),this}content(e){return this.text(e)}icon(e){return a(this._contentBox,S(e??``)),this.attr(`data-image`,null),this.attr(`aria-label`,oi(e,this.attr(`aria-label`))),this}src(e){return e===void 0?this._imageBox.attr(`src`):e==null||e===``?(this._imageBox.attr(`src`,null),this.attr(`data-image`,null),this):(this._imageBox.attr(`src`,e),this.attr(`data-image`,`true`),this)}alt(e){if(e===void 0)return this._imageBox.attr(`alt`);let t=e??``;return this._imageBox.attr(`alt`,t),t&&this.attr(`aria-label`,t),this}size(e){if(e===void 0)return this.attr(`data-size`);let t=[`small`,`medium`,`large`,`xlarge`].includes(e)?e:`medium`;return this.attr(`data-size`,t),this}shape(e){return e===void 0?this.attr(`data-shape`):(this.attr(`data-shape`,e===`square`?`square`:`circle`),this)}color(e){return e===void 0?this._color:(this._color=e||null,this.attr(`data-color`,this._color||null),this.style(`background`,this._color||null),this.style(`color`,this._color?`var(--yoya-color-text-inverse, #ffffff)`:null),this)}status(e){return e===void 0?this._status:(this._status=e||null,this.attr(`data-status`,this._status||null),this)}_syncAvatar(){let e=!!this._imageBox.attr(`src`);return this.attr(`data-image`,e?`true`:null),this.attr(`aria-label`)||this.attr(`aria-label`,this._imageBox.attr(`alt`)||this._contentBox.textContent()||``),this}_setupAvatar(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{alt:t,children:n,color:r,content:i,icon:a,shape:o,size:s,src:c,status:l,text:u,...d}=e;Object.keys(d).length>0&&this.setup(d),c!==void 0&&this.src(c),t!==void 0&&this.alt(t),u===void 0?i===void 0?a===void 0?n!==void 0&&this.text(n):this.icon(a):this.content(i):this.text(u),s!==void 0&&this.size(s),o!==void 0&&this.shape(o),r!==void 0&&this.color(r),l!==void 0&&this.status(l);return}this.text(e)}}};function ai(e=null,t=null,n=null){return T(ii,e,t,n)}function oi(e,t){return e==null||e===``?t||``:typeof e.textContent==`function`?e.textContent():String(e)}const si={danger:D(`color-danger`,`#dc2626`),neutral:D(`color-text-secondary`,`#64748b`),primary:D(`color-primary`,`#2563eb`),success:D(`color-success`,`#16a34a`),warning:D(`color-warning`,`#d97706`)},ci=new Set(Object.keys(si));var li=class extends y{constructor(e=null){super(`div`,null),this._columns=null,this.className(E,`yoya-vdigital-board`),this.styles({boxSizing:`border-box`,display:`grid`,gap:`16px`,gridTemplateColumns:`repeat(auto-fit, minmax(220px, 1fr))`}),j(this,e)}columns(e){if(e===void 0)return this._columns;this._columns=e;let t=Number(e);return this.style(`gridTemplateColumns`,Number.isFinite(t)&&t>0?`repeat(${t}, minmax(0, 1fr))`:`repeat(auto-fit, minmax(220px, 1fr))`),this}},ui=class extends y{constructor(t=null){super(`div`,null),this._tone=`primary`,this._trendUp=!0,this._accent=new y(`div`).className(`yoya-vdigital-board-item-accent`),this._iconBox=new y(`div`).className(`yoya-vdigital-board-item-icon`),this._labelNode=m(``),this._valueNode=m(``),this._unitNode=m(``),this._trendNode=m(``),this._accent.styles({bottom:`0`,left:`0`,position:`absolute`,top:`0`,width:`4px`}),this._iconBox.styles({alignItems:`center`,display:`none`,flexShrink:`0`,fontSize:`22px`,height:`28px`,justifyContent:`center`,width:`28px`});let n=new y(`div`).className(`yoya-vdigital-board-item-label`).styles({color:D(`color-text-secondary`,`#475569`),fontSize:`13px`,lineHeight:`1.4`}).child(this._labelNode),r=new y(`div`).className(`yoya-vdigital-board-item-top`).styles({alignItems:`center`,display:`flex`,gap:`10px`}).child(this._iconBox,n),i=new y(`span`).className(`yoya-vdigital-board-item-unit`).styles({color:D(`color-text-secondary`,`#64748b`),fontSize:`13px`,fontWeight:`400`,lineHeight:`1`}).child(this._unitNode),a=new y(`div`).className(`yoya-vdigital-board-item-value-box`).styles({alignItems:`baseline`,display:`flex`,gap:`6px`,fontSize:`28px`,fontWeight:`700`,lineHeight:`1.2`,marginTop:`6px`}).child(this._valueNode,i);this._trendBox=new y(`div`).className(`yoya-vdigital-board-item-trend`).styles({fontSize:`13px`,lineHeight:`1.4`,marginTop:`8px`}).child(this._trendNode),this._unitBox=i;let o=new y(`div`).className(`yoya-vdigital-board-item-body`).styles({boxSizing:`border-box`,display:`flex`,flexDirection:`column`,minWidth:`0`}).child(r,a,this._trendBox);this.className(E,`yoya-vdigital-board-item`),this.styles({background:D(`color-surface`,`#ffffff`),border:e(`color-border`,`#e2e8f0`),borderRadius:`10px`,boxSizing:`border-box`,display:`flex`,minWidth:`0`,overflow:`hidden`,padding:`16px 16px 16px 20px`,position:`relative`}),this.child(this._accent,o),this._applyTone(),j(this,t)}label(e){return e===void 0?this._labelNode.textContent():(this._labelNode.textContent(e),this)}value(e){return e===void 0?this._valueNode.textContent():(this._valueNode.textContent(e),this)}unit(e){return e===void 0?this._unitNode.textContent():(this._unitNode.textContent(e),this._unitBox.style(`display`,e?`inline-block`:`none`),this)}trend(e){return e===void 0?this._trendNode.textContent():(this._trendNode.textContent(e),this._trendBox.style(`display`,e?`block`:`none`),this._applyTrendColor(),this)}trendUp(e){return e===void 0?this._trendUp:(this._trendUp=!!e,this._applyTrendColor(),this)}tone(e){return e===void 0?this._tone:(this._tone=ci.has(e)?e:`primary`,this._applyTone(),this)}icon(e){let t=e!=null&&e!==``;return this._iconBox.style(`display`,t?`flex`:`none`),a(this._iconBox,t?S(e):[]),this}_applyTone(){let e=si[this._tone];this._accent.style(`background`,e),this._iconBox.style(`color`,e),this._applyTrendColor()}_applyTrendColor(){this._trendBox.style(`color`,this._trendUp?D(`color-success`,`#16a34a`):D(`color-danger`,`#dc2626`))}};function di(e=null,t=null,n=null){return T(li,e,t,n)}function fi(e=null,t=null,n=null){return T(ui,e,t,n)}const pi={default:D(`color-text-muted`,`#8c8c8c`),error:D(`color-danger`,`#f5222d`),processing:D(`color-info`,`#1677ff`),success:D(`color-success`,`#52c41a`),warning:D(`color-warning`,`#faad14`)};var mi=class extends y{constructor(e=null){super(`span`,null),this._count=null,this._overflowCount=99,this._showZero=!1,this._dot=!1,this._status=null,this._color=null,this._offsetX=0,this._offsetY=0,this._textContent=null,this._contentBox=new y(`span`).className(`yoya-vbadge-content`).styles({alignItems:`center`,display:`inline-flex`,minWidth:`0`}),this._badgeBox=new y(`span`).className(`yoya-vbadge-count`).styles({alignItems:`center`,background:D(`color-danger`,`#ff4d4f`),borderRadius:`10px`,boxSizing:`border-box`,color:D(`color-text-inverse`,`#ffffff`),display:`none`,fontSize:`12px`,fontWeight:`700`,height:`18px`,justifyContent:`center`,lineHeight:`1`,minWidth:`18px`,padding:`0 6px`,position:`absolute`,right:`0`,textAlign:`center`,top:`0`,transform:`translate(50%, -50%)`,whiteSpace:`nowrap`,zIndex:`1`}),this._textBox=new y(`span`).className(`yoya-vbadge-text`).styles({color:D(`color-text-secondary`,`#475569`),display:`none`,fontSize:`12px`,lineHeight:`1`}),this.className(E,`yoya-vbadge`),this.styles({alignItems:`center`,boxSizing:`border-box`,display:`inline-flex`,gap:`6px`,lineHeight:`1`,position:`relative`,verticalAlign:`middle`}),super.child(this._contentBox,this._badgeBox,this._textBox),this._setupBadge(e),this._syncBadge()}child(...e){return this._contentBox.child(...e),this._syncBadge(),this}content(e){return e===void 0?this._contentBox.children():(a(this._contentBox,S(e)),this._syncBadge(),this)}count(e){return e===void 0?this._count:(this._count=e==null||e===``?null:e,this.attr(`data-count`,this._count===null?null:String(this._count)),this._syncBadge(),this)}overflowCount(e){if(e===void 0)return this._overflowCount;let t=Number(e);return this._overflowCount=Number.isFinite(t)?t:99,this.attr(`data-overflow-count`,String(this._overflowCount)),this._syncBadge(),this}showZero(e){return e===void 0?this._showZero:(this._showZero=!!e,this.attr(`data-show-zero`,this._showZero?`true`:null),this._syncBadge(),this)}dot(e){return e===void 0?this._dot:(this._dot=!!e,this.attr(`data-dot`,this._dot?`true`:null),this._syncBadge(),this)}status(e){return e===void 0?this._status:(this._status=e||null,this.attr(`data-status`,this._status),this._syncBadge(),this)}color(e){return e===void 0?this._color:(this._color=e||null,this.attr(`data-color`,this._color),this._syncBadge(),this)}text(e){return e===void 0?this._textContent:(this._textContent=e??null,this._textContent===null?a(this._textBox,[]):a(this._textBox,S(this._textContent)),this._syncBadge(),this)}label(e){return this.text(e)}title(e){return e===void 0?this._badgeBox.attr(`title`):(this._badgeBox.attr(`title`,e??null),this)}offset(e){if(e===void 0)return{x:this._offsetX,y:this._offsetY};let t=Number(e?.x??0),n=Number(e?.y??0);return this._offsetX=Number.isFinite(t)?t:0,this._offsetY=Number.isFinite(n)?n:0,this._syncBadge(),this}_setupBadge(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{children:t,color:n,content:r,count:i,dot:a,label:o,offset:s,overflowCount:c,showZero:l,status:u,text:d,title:f,...p}=e;Object.keys(p).length>0&&this.setup(p),c!==void 0&&this.overflowCount(c),l!==void 0&&this.showZero(l),i!==void 0&&this.count(i),a!==void 0&&this.dot(a),u!==void 0&&this.status(u),n!==void 0&&this.color(n),s!==void 0&&this.offset(s),f!==void 0&&this.title(f),d===void 0?o!==void 0&&this.text(o):this.text(d),t===void 0?r!==void 0&&this.child(r):this.child(t);return}if(typeof e==`number`||typeof e==`string`&&e.trim()!==``&&!Number.isNaN(Number(e))){this.count(e);return}this.child(e)}}_syncBadge(){let e=this._contentBox.children().length>0,t=this._status,n=!!(t||this._dot),r=n||this._countVisible(),i=this._color||(t?pi[t]:D(`color-danger`,`#ff4d4f`));return this._contentBox.style(`display`,e?`inline-flex`:`none`),this._textBox.style(`display`,this._textContent!==null&&this._textContent!==``?`inline-flex`:`none`),this._badgeBox.style(`display`,r?`inline-flex`:`none`),this._badgeBox.style(`background`,r?i:null),this._badgeBox.style(`position`,e?`absolute`:`static`),this._badgeBox.style(`transform`,e?`translate(calc(50% + ${this._offsetX}px), calc(-50% + ${this._offsetY}px))`:null),this._badgeBox.attr(`aria-label`,r?n?this._status||`通知`:this._badgeText():null),n?(this._badgeBox.styles({borderRadius:`999px`,height:`8px`,lineHeight:`1`,minWidth:`8px`,padding:`0`,width:`8px`}),a(this._badgeBox,[])):(this._badgeBox.styles({borderRadius:`10px`,height:`18px`,lineHeight:`1`,minWidth:`18px`,padding:`0 6px`,width:null}),a(this._badgeBox,S(this._badgeText()))),this.attr(`data-standalone`,e?null:`true`),this}_countVisible(){if(this._count===null||this._count===void 0||this._count===``)return!1;let e=Number(this._count);return Number.isFinite(e)&&e===0?!!this._showZero:!0}_badgeText(){let e=Number(this._count);if(Number.isFinite(e)&&this._count!==``){let t=Number(this._overflowCount)||99;return e>t?`${t}+`:String(this._count)}return String(this._count)}};function hi(e=null,t=null,n=null){return T(mi,e,t,n)}var gi=class extends y{constructor(e=null){super(`div`,null),this._activeIndex=0,this._itemsData=[],this._renderItem=null,this._autoplay=!1,this._interval=3500,this._loop=!0,this._showArrows=!0,this._showDots=!0,this._height=null,this._timer=null,this._paused=!1,this._viewport=new y(`div`).className(`yoya-vcarousel-viewport`),this._track=new y(`div`).className(`yoya-vcarousel-track`),this._prevButton=new y(`button`).className(`yoya-vcarousel-arrow yoya-vcarousel-arrow--prev`).attr({"aria-label":`上一项`,type:`button`}).child(s()).on(`click`,()=>this.prev()),this._nextButton=new y(`button`).className(`yoya-vcarousel-arrow yoya-vcarousel-arrow--next`).attr({"aria-label":`下一项`,type:`button`}).child(u()).on(`click`,()=>this.next()),this._swipeStart=null,this._swipeCleanup=null,this._viewport.style(`touchAction`,`pan-y`).on(`pointerdown`,e=>this._swipeDown(e)).on(`mousedown`,e=>this._swipeDown(e)).on(`touchstart`,e=>this._swipeDown(e)),this._dots=new y(`div`).className(`yoya-vcarousel-dots`).attr({"aria-label":`轮播指示`,role:`tablist`}),this._viewport.child(this._track),this.className(E,`yoya-vcarousel`),this.attr({"aria-label":`走马灯,第 1 / 0 项`,"aria-roledescription":`carousel`,"data-active":`0`,"data-count":`0`,"data-loop":`true`,role:`region`,tabindex:`0`}),this.styles({boxSizing:`border-box`,display:`grid`,gridTemplateRows:`minmax(0, 1fr) auto`,minWidth:`0`,position:`relative`}),this.child(this._viewport,this._prevButton,this._nextButton,this._dots),this.on(`keydown`,e=>this._handleKeydown(e)),this.on(`mouseenter`,()=>this._pause()),this.on(`mouseleave`,()=>this._resume()),this.on(`focusin`,()=>this._pause()),this.on(`focusout`,e=>{(!e.relatedTarget||!this._el?.contains(e.relatedTarget))&&this._resume()}),this._setupCarousel(e),this._syncState()}slides(e,t=null){return e===void 0?this._itemsData.slice():(typeof t==`function`&&(this._renderItem=t),this._itemsData=Array.isArray(e)?e.slice():[e],this._activeIndex=0,this._renderSlides(),this._renderDots(),this._syncState(),this)}items(e,t=null){return this.slides(e,t)}renderItem(e){return e===void 0?this._renderItem:(this._renderItem=typeof e==`function`?e:null,this._itemsData.length>0&&this._renderSlides(),this)}active(e){if(e===void 0)return this._activeIndex;let t=this._itemsData.length,n=Math.floor(Number(e));return Number.isFinite(n)||(n=0),t===0?(this._activeIndex=0,this._syncState(),this):(this._activeIndex=this._loop?(n%t+t)%t:Math.max(0,Math.min(t-1,n)),this._syncState(),this)}goTo(e){return this.active(e)}next(){return this._itemsData.length===0?this:this._loop?this.active(this._activeIndex+1):this.active(Math.min(this._activeIndex+1,this._itemsData.length-1))}prev(){return this._itemsData.length===0?this:this._loop?this.active(this._activeIndex-1):this.active(Math.max(0,this._activeIndex-1))}loop(e){return e===void 0?this._loop:(this._loop=!!e,this.attr(`data-loop`,this._loop?`true`:null),this._syncState(),this)}autoplay(e){return e===void 0?this._autoplay:(this._autoplay=!!e,this.attr(`data-autoplay`,this._autoplay?`true`:null),this._syncPlayback(),this)}start(){return this.autoplay(!0)}stop(){return this.autoplay(!1)}interval(e){if(e===void 0)return this._interval;let t=Number(e);return this._interval=Number.isFinite(t)&&t>0?t:3500,this._autoplay&&(this._clearTimer(),this._startTimer()),this}arrows(e){return e===void 0?this._showArrows:(this._showArrows=!!e,this.attr(`data-arrows`,this._showArrows?`true`:null),this._prevButton.style(`display`,this._showArrows?null:`none`),this._nextButton.style(`display`,this._showArrows?null:`none`),this)}dots(e){return e===void 0?this._showDots:(this._showDots=!!e,this.attr(`data-dots`,this._showDots?`true`:null),this._dots.style(`display`,this._showDots?null:`none`),this)}height(e){return e===void 0?this._height:(this._height=e||null,this.style(`height`,this._height),this.style(`minHeight`,this._height),this)}destroy(){return this._clearTimer(),this._swipeCleanup&&=(this._swipeCleanup(),null),super.destroy()}renderDom(){let e=super.renderDom();if(!this._swipeCleanup){let e=e=>this._swipeUp(e),t=x(`pointerup`,e),n=x(`mouseup`,e),r=x(`touchend`,e);this._swipeCleanup=()=>{t(),n(),r()}}return e}_handleKeydown(e){e.key===`ArrowLeft`?(e.preventDefault(),this.prev()):e.key===`ArrowRight`?(e.preventDefault(),this.next()):e.key===`Home`?(e.preventDefault(),this.active(0)):e.key===`End`&&(e.preventDefault(),this.active(this._itemsData.length-1))}_swipeDown(e){if(this._swipeStart)return;let t=this._resolvePoint(e);t&&(this._swipeStart=t,this._pause())}_swipeUp(e){if(!this._swipeStart)return;let t=this._resolvePoint(e),n=this._swipeStart;if(this._swipeStart=null,this._resume(),!t)return;let r=t.x-n.x,i=t.y-n.y;Math.abs(r)<40||Math.abs(r)<=Math.abs(i)||(r<0?this.next():this.prev())}_resolvePoint(e){let t=e.touches?.[0]??e.changedTouches?.[0],n=t?.clientX??e.clientX,r=t?.clientY??e.clientY;return typeof n!=`number`||typeof r!=`number`?null:{x:n,y:r}}_renderSlides(){let e=this._itemsData.length;a(this._track,this._itemsData.map((t,n)=>{let r=new y(`div`).className(`yoya-vcarousel-slide`).attr({"aria-label":`${n+1} / ${e}`,"aria-roledescription":`slide`,role:`group`});return r.child(this._renderItem?this._renderItem(t,n,this):t),r}))}_renderDots(){a(this._dots,this._itemsData.map((e,t)=>new y(`button`).className(`yoya-vcarousel-dot`).attr({"aria-label":`跳转到第 ${t+1} 项`,role:`tab`,tabindex:`-1`,type:`button`}).on(`click`,()=>this.active(t))))}_syncState(){let e=this._itemsData.length;return this.attr(`data-active`,String(this._activeIndex)),this.attr(`data-count`,String(e)),this.attr(`aria-label`,`走马灯,第 ${this._activeIndex+1} / ${e} 项`),this._track.style(`transform`,e>0?this._activeIndex===0?`translateX(0%)`:`translateX(-${this._activeIndex*100}%)`:null),this._dots.children().forEach((e,t)=>{e.attr(`aria-selected`,t===this._activeIndex?`true`:null),e.attr(`tabindex`,t===this._activeIndex?`0`:`-1`)}),this._syncArrows(),this._syncPlayback(),this._emitChange(),this}_syncArrows(){let e=this._itemsData.length,t=e>1&&(this._loop||this._activeIndex>0),n=e>1&&(this._loop||this._activeIndex<e-1);this._prevButton.attr(`disabled`,!t||null),this._nextButton.attr(`disabled`,!n||null),this._prevButton.attr(`aria-disabled`,t?null:`true`),this._nextButton.attr(`aria-disabled`,n?null:`true`)}_syncPlayback(){this._autoplay&&!this._paused&&this._itemsData.length>1?this._startTimer():this._clearTimer()}_startTimer(){this._timer||!this._autoplay||this._paused||this._itemsData.length<2||(this._timer=setInterval(()=>this.next(),this._interval))}_clearTimer(){this._timer&&=(clearInterval(this._timer),null)}_pause(){this._autoplay&&(this._paused=!0,this.attr(`data-paused`,`true`),this._clearTimer())}_emitChange(){this._el&&this._el.dispatchEvent(new CustomEvent(`change`,{bubbles:!1,detail:{count:this._itemsData.length,index:this._activeIndex}}))}_resume(){this._autoplay&&(this._paused=!1,this.attr(`data-paused`,null),this._startTimer())}_setupCarousel(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{active:t,arrows:n,autoplay:r,children:i,dots:a,height:o,interval:s,items:c,loop:l,renderItem:u,slides:d,...f}=e;Object.keys(f).length>0&&this.setup(f),u!==void 0&&this.renderItem(u);let p=d??c??i;p!==void 0&&this.slides(p),t!==void 0&&this.active(t),l!==void 0&&this.loop(l),r!==void 0&&this.autoplay(r),s!==void 0&&this.interval(s),n!==void 0&&this.arrows(n),a!==void 0&&this.dots(a),o!==void 0&&this.height(o);return}this.slides(e)}}};function _i(e=null,t=null,n=null){return T(gi,e,t,n)}var vi=class extends y{constructor(t=null){super(`div`,null),this._languageBadge=new y(`span`).className(`yoya-vcode-language`).style(`display`,`none`),this._copyButton=new y(`button`).className(`yoya-vcode-copy`).attr({"aria-label":`复制代码`,type:`button`}).on(`click`,()=>{this.copy()}),this._toolbar=new y(`div`).className(`yoya-vcode-toolbar`),this._codeBox=new y(`code`).className(`yoya-vcode-content`),this._preBox=new y(`pre`).className(`yoya-vcode-pre`).child(this._codeBox),this.className(E,`yoya-vcode`),this.styles({background:D(`color-surface`,`#ffffff`),border:e(`color-border`,`#d8dee8`),borderRadius:`8px`,color:D(`color-text`,`#172033`),overflow:`hidden`}),this._toolbar.styles({alignItems:`center`,background:D(`color-code-header`,`#f8fafc`),display:`flex`,gap:`8px`,justifyContent:`space-between`,padding:`10px 12px`}),this._languageBadge.styles({background:D(`color-code-badge`,`#e2e8f0`),borderRadius:`999px`,color:D(`color-code-badge-text`,`#334155`),fontSize:`12px`,fontWeight:`700`,lineHeight:`1`,padding:`4px 8px`}),this._preBox.styles({background:D(`color-code-bg`,`#fbfcfe`),margin:`0`,overflow:`auto`,padding:`14px 16px`}),this._codeBox.styles({display:`block`,fontFamily:`"Cascadia Code", "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace`,fontSize:`13px`,lineHeight:`1.55`,minWidth:`max-content`,whiteSpace:`pre`}),this.copyLabel(`复制`),this.copyable(!0),this._toolbar.child(this._languageBadge,this._copyButton),this.child(this._toolbar,this._preBox),this._setupCode(t)}content(e){return a(this._codeBox,S(e)),this}text(e){return this.content(e)}language(e){if(e===void 0)return this.attr(`data-language`);let t=e==null?``:String(e);return this.attr(`data-language`,t||null),this._languageBadge.style(`display`,t?null:`none`),a(this._languageBadge,t?S(t):[]),this}copyable(e=void 0){if(e===void 0)return this.getBooleanState(`copyable`);let t=!!e;return this.setState(`copyable`,t),this.attr(`data-copyable`,t?`true`:null),this._copyButton.style(`display`,t?null:`none`),this}copyLabel(e){return e===void 0?this._copyButton.textContent():(a(this._copyButton,S(e??`复制`)),this)}async copy(){let e=this._codeBox.textContent();try{typeof navigator<`u`&&navigator.clipboard?.writeText&&await navigator.clipboard.writeText(e)}catch{}return e}_setupCode(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{children:t,content:n,copyLabel:r,copyable:i,language:a,text:o,...s}=e;Object.keys(s).length>0&&this.setup(s),a!==void 0&&this.language(a),r!==void 0&&this.copyLabel(r),i!==void 0&&this.copyable(i),n===void 0?o===void 0?t!==void 0&&this.content(t):this.content(o):this.content(n);return}this.content(e)}}};function yi(e=null,t=null,n=null){return T(vi,e,t,n)}var bi=class extends y{constructor(t=null){super(`dl`,null),this._columns=3,this.className(E,`yoya-vdetail`),this.styles({border:e(`color-border`,`#d8dee8`),borderRadius:`8px`,display:`grid`,gap:`0`,margin:`0`,overflow:`hidden`}),this.columns(this._columns),this._setupDetail(t)}columns(e){return e===void 0?this._columns:(this._columns=Ti(e),this.attr(`data-columns`,String(this._columns)),this.style(`gridTemplateColumns`,`repeat(${this._columns}, minmax(0, 1fr))`),this)}column(e){return this.columns(e)}items(e){return e===void 0?this.children():(a(this,[]),Array.isArray(e)&&e.forEach(e=>{this.child(wi(e))}),this)}_setupDetail(e){if(e!=null){if(typeof e==`function`){e(this);return}if(Array.isArray(e)){this.items(e);return}if(N(e)){this.setup(e);return}this.child(e)}}},xi=class extends y{constructor(e=null,t=void 0){super(`div`,null),this._labelBox=new y(`dt`).className(`yoya-vdetail-label`),this._valueBox=new y(`dd`).className(`yoya-vdetail-value`),this.className(`yoya-vdetail-item`),this.styles({alignItems:`start`,display:`grid`,gap:`12px`,gridTemplateColumns:`minmax(96px, 1fr) minmax(0, 1.5fr)`,padding:`12px 16px`}),this._labelBox.styles({color:D(`color-text-secondary`,`#475569`),fontWeight:`700`,margin:`0`,wordBreak:`break-word`}),this._valueBox.styles({color:D(`color-text-strong`,`#111827`),margin:`0`,wordBreak:`break-word`}),this.child(this._labelBox,this._valueBox),this._setupDetailItem(e,t),this._syncLabelPresence()}label(e){if(e===void 0)return this._labelBox.textContent();let t=e!=null&&e!==``;return a(this._labelBox,t?S(e):[]),this._syncLabelPresence(),this}value(e){return e===void 0?this._valueBox.textContent():(a(this._valueBox,S(e)),this)}content(e){return this.value(e)}_syncLabelPresence(){let e=this._labelBox.children().length>0;return this.style(`gridTemplateColumns`,e?`minmax(96px, 1fr) minmax(0, 1.5fr)`:`minmax(0, 1fr)`),this._labelBox.style(`display`,e?null:`none`),this.attr(`data-label-visible`,e?`true`:null),this}_setupDetailItem(e,t){if(e!=null){if(typeof e==`function`){e(this);return}if(Array.isArray(e)&&t===void 0&&e.length>=2){this.label(e[0]),this.value(e[1]);return}if(N(e)){let{children:t,content:n,label:r,text:i,value:a,...o}=e;Object.keys(o).length>0&&this.setup(o),r!==void 0&&this.label(r),a===void 0?n===void 0?i===void 0?t!==void 0&&this.value(t):this.value(i):this.value(n):this.value(a);return}if(t!==void 0){this.label(e),this.value(t);return}this.value(e)}}};function Si(e=null,t=null,n=null){return T(bi,e,t,n)}function Ci(e=null,t=void 0){return e instanceof xi&&t===void 0?e:new xi(e,t)}function wi(e){return e instanceof xi?e:Array.isArray(e)&&e.length>=2?Ci(e[0],e[1]):e instanceof o?Ci({value:e}):N(e)?Ci(e):Ci({value:e})}function Ti(e){let t=Number(e);return!Number.isFinite(t)||t<1?1:Math.max(1,Math.floor(t))}function Ei(t=null,n=null,r=null){let s=R(t,n,r),c=te(),l={ariaLabel:`分页`,page:1,pageSize:10,pageSizes:[],total:0,totalPages:1},u=null,d=null,f=`yoya-vpagination-${c}`,p=`yoya-vpagination-page-${c}`,m=`yoya-vpagination-size-${c}`,h=new v(`共 0 条`),g=new v(`第 1 / 1 页`),_=new y(`div`).className(`yoya-vpagination-summary`).attr(`aria-live`,`polite`).styles({display:`grid`,gap:`2px`}),ee=new y(`div`).className(`yoya-vpagination-controls`).styles({alignItems:`center`,display:`flex`,flexWrap:`wrap`,gap:`8px`}),b=new y(`div`).className(`yoya-vpagination-jump`).styles({alignItems:`center`,display:`inline-flex`,gap:`6px`}),x=new y(`div`).className(`yoya-vpagination-size`).styles({alignItems:`center`,display:`inline-flex`,gap:`6px`}),C=L(`first`,`首页`),ne=L(`previous`,`上一页`),T=L(`next`,`下一页`),O=L(`last`,`尾页`),k=L(`jump`,`前往`),A=new y(`input`).className(`yoya-vpagination-page-input`).attr({"aria-label":`跳转页码`,"data-role":`page-input`,id:p,inputmode:`numeric`,min:`1`,step:`1`,type:`number`,value:`1`}).styles({boxSizing:`border-box`,minWidth:`72px`,width:`72px`}),j=new y(`label`).className(`yoya-vpagination-jump-label`).attr(`for`,p).styles({color:D(`color-text-secondary`,`#475569`),fontSize:`12px`,fontWeight:`600`}),M=new y(`span`).className(`yoya-vpagination-jump-suffix`).styles({color:D(`color-text-muted`,`#64748b`),fontSize:`12px`}).text(`页`),re=new y(`label`).className(`yoya-vpagination-size-label`).attr(`for`,m).styles({color:D(`color-text-secondary`,`#475569`),fontSize:`12px`,fontWeight:`600`}),P=new y(`select`).className(`yoya-vpagination-page-size`).attr({"aria-label":`每页条数`,"data-role":`page-size`,id:m}).styles({boxSizing:`border-box`,minWidth:`92px`,width:`auto`});u=new y(`nav`).className(E,`yoya-vpagination`).attr({"aria-label":l.ariaLabel,id:f}).styles({alignItems:`center`,display:`flex`,flexWrap:`wrap`,gap:`12px`,justifyContent:`space-between`,minWidth:`0`,padding:`4px 0`}),u.child(_,ee,x),_.child(h,g),ee.child(C,ne,b,T,O),b.child(j,A,M,k),x.child(re,P),A.on(`keydown`,e=>{e.key===`Enter`&&(e.preventDefault(),ue())}),k.on(`click`,()=>ue()),C.on(`click`,()=>W(1,!0)),ne.on(`click`,()=>W(l.page-1,!0)),T.on(`click`,()=>W(l.page+1,!0)),O.on(`click`,()=>W(l.totalPages,!0)),P.on(`change`,()=>{let e=z(P._el?.value??P.attr(`value`));e!==null&&le(e,!0)});let F={change(e){return e===void 0?d:(d=typeof e==`function`?e:null,F)},onChange(e){return F.change(e)},page(e){return e===void 0?l.page:(W(e,!1),F)},pageSize(e){return e===void 0?l.pageSize:(le(e,!1),F)},pageSizes(e){return e===void 0?l.pageSizes.slice():(l.pageSizes=H(e),U(),F)},total(e){return e===void 0?l.total:(l.total=ie(e),l.totalPages=l.total===0?1:Math.max(1,Math.ceil(l.total/l.pageSize)),U(),F)},totalPages(e){return e===void 0?l.totalPages:(l.totalPages=B(e),U(),F)},update(e={}){if(N(e)){let{page:t,pageSize:n,pageSizes:r,total:i,totalPages:a}=e;r!==void 0&&(l.pageSizes=H(r)),n!==void 0&&(l.pageSize=z(n)??l.pageSize),i!==void 0&&(l.total=ie(i)),a===void 0?l.totalPages=l.total>0?Math.max(1,Math.ceil(l.total/l.pageSize)):1:l.totalPages=B(a),t!==void 0&&(l.page=V(t)),l.total===0?l.page=1:l.page=oe(l.page)}return U(),F},render(){return U(),u}};return I(s.first),U(),w(F,s.options,s.callback),F;function I(e){if(e!=null){if(typeof e==`function`){e(F);return}if(N(e)){let{ariaLabel:t,change:n,children:r,className:a,onChange:o,page:s,pageSize:c,pageSizes:f,total:p,totalPages:m,...h}=e;Object.keys(h).length>0&&u.setup(h),a!==void 0&&u.className(a),t!==void 0&&(l.ariaLabel=i(t)||l.ariaLabel),f!==void 0&&(l.pageSizes=H(f)),p!==void 0&&(l.total=ie(p)),c!==void 0&&(l.pageSize=z(c)??l.pageSize),m!==void 0&&(l.totalPages=B(m)),s!==void 0&&(l.page=V(s)),m===void 0&&l.total>0&&(l.totalPages=Math.max(1,Math.ceil(l.total/l.pageSize))),typeof n==`function`?d=n:typeof o==`function`&&(d=o),r!==void 0&&u.child(r);return}}}function L(t,n){let r=new y(`button`).className(`yoya-vpagination-button`).attr({"data-action":t,type:`button`}).styles({background:D(`color-surface`,`#ffffff`),border:e(`color-border-strong`,`#cbd5e1`),borderRadius:`6px`,color:D(`color-text`,`#172033`),cursor:`pointer`,font:`inherit`,lineHeight:`1`,padding:`6px 10px`,whiteSpace:`nowrap`});return a(r,S(n)),r}function z(e){let t=Number(i(e));return!Number.isFinite(t)||t<=0?null:Math.max(1,Math.floor(t))}function ie(e){let t=Number(i(e));return!Number.isFinite(t)||t<0?0:Math.floor(t)}function B(e){let t=Number(i(e));return!Number.isFinite(t)||t<=0?1:Math.max(1,Math.floor(t))}function V(e){let t=Number(i(e));return!Number.isFinite(t)||t<=0?1:Math.floor(t)}function H(e){return Array.isArray(e)?e.map((e,t)=>{if(Array.isArray(e)&&e.length>0){let[n,r=void 0]=e,a=i(n);return{disabled:!1,label:r??`${a} / 页`,value:a||`page-size-${t}`}}if(e instanceof o)return{disabled:!1,label:e,value:e.textContent()||`page-size-${t}`};if(N(e)){let n=e.value??e.key??e.id??e.label??e.text??e.title??`page-size-${t}`,r=i(n);return{disabled:!!e.disabled,label:e.label??e.text??e.content??e.title??`${r} / 页`,value:r||`page-size-${t}`}}let n=i(e);return{disabled:!1,label:`${n} / 页`,value:n||`page-size-${t}`}}).filter(e=>e.value!==``):[]}function ae(){let e=H(l.pageSizes);if(e.length===0){x.style(`display`,`none`),a(P,[]);return}let t=String(l.pageSize),n=e.some(e=>e.value===t)?e:[{disabled:!1,label:`${t} / 页`,value:t}].concat(e);x.style(`display`,null),a(P,n.map((e,n)=>{let r=new y(`option`).className(`yoya-vpagination-page-size-option`);return r.attr({disabled:e.disabled?!0:null,selected:e.value===t||null,value:e.value}),a(r,S(e.label)),r.attr(`data-option-index`,String(n)),r})),P.attr(`value`,t)}function oe(e){if(l.total===0)return 1;let t=Math.max(1,l.totalPages);return Math.min(Math.max(1,V(e)),t)}function se(e,t){e.attr(`disabled`,t?!0:null),e.attr(`aria-disabled`,t?`true`:null),e.style(`cursor`,t?`not-allowed`:`pointer`),e.style(`opacity`,t?`0.56`:`1`)}function U(){return l.total=ie(l.total),l.pageSize=z(l.pageSize)??1,l.totalPages=l.total===0?1:Math.max(1,B(l.totalPages)),l.page=l.total===0?1:oe(l.page),u.attr(`aria-label`,l.ariaLabel||`分页`),u.attr(`data-empty`,l.total===0?`true`:null),u.attr(`data-page`,String(l.page)),u.attr(`data-page-size`,String(l.pageSize)),u.attr(`data-total`,String(l.total)),u.attr(`data-total-pages`,String(l.totalPages)),h.textContent(`共 ${l.total} 条`),g.textContent(`第 ${l.page} / ${l.totalPages} 页`),A.attr({disabled:l.total===0||null,max:String(l.totalPages),min:`1`,value:String(l.page)}),A.attr(`aria-disabled`,l.total===0?`true`:null),k.attr(`disabled`,l.total===0||null),k.attr(`aria-disabled`,l.total===0?`true`:null),se(C,l.total===0||l.page<=1),se(ne,l.total===0||l.page<=1),se(T,l.total===0||l.page>=l.totalPages),se(O,l.total===0||l.page>=l.totalPages),ae(),F}function ce(){typeof d==`function`&&d({page:l.page,pageSize:l.pageSize})}function W(e,t=!1){if(l.total===0)return U(),F;let n=oe(e);return n===l.page?(U(),F):(l.page=n,U(),t&&ce(),F)}function le(e,t=!1){let n=z(e);if(n===null)return U(),F;let r=n!==l.pageSize;return r&&(l.pageSize=n,l.page=1,l.totalPages=l.total===0?1:Math.max(1,Math.ceil(l.total/l.pageSize))),U(),t&&r&&ce(),F}function ue(){if(l.total===0)return F;let e=V(A._el?.value??A.attr(`value`));return e<=0?F:W(e,!0)}}function Di(e=null,t=null,n=null){let r=R(e,t,n);return r.first&&typeof r.first.render==`function`&&typeof r.first.update==`function`?w(r.first,r.options,r.callback):w(Ei(r.first),r.options,r.callback)}const Oi={error:D(`color-danger`,`#dc2626`),normal:D(`color-primary`,`#2563eb`),processing:D(`color-info`,`#0284c7`),success:D(`color-success`,`#16a34a`),warning:D(`color-warning`,`#f59e0b`)};var ki=class extends y{constructor(e=null){super(`div`,null),this._value=0,this._max=100,this._percent=0,this._showText=!0,this._status=`normal`,this._size=`default`,this._strokeColor=null,this._indeterminate=!1,this._format=null,this._textContent=null,this._ariaLabel=null,this._labelBox=new y(`span`).className(`yoya-vprogress-label`).attr(`aria-hidden`,`true`).style(`display`,`none`),this._track=new y(`div`).className(`yoya-vprogress-track`),this._bar=new y(`span`).className(`yoya-vprogress-bar`),this._textBox=new y(`span`).className(`yoya-vprogress-text`),this._track.child(this._bar),this.className(E,`yoya-vprogress`),this.attr({"aria-valuemax":`100`,"aria-valuemin":`0`,"aria-valuenow":`0`,"data-percent":`0`,"data-size":`default`,"data-status":`normal`,"data-value":`0`,role:`progressbar`}),super.child(this._labelBox,this._track,this._textBox),this._setupProgress(e),this._syncProgress()}value(e){if(e===void 0)return this._value;let t=Number(e);return Number.isFinite(t)&&(this._value=Math.max(0,Math.min(this._max,t))),this._syncProgress(),this}max(e){if(e===void 0)return this._max;let t=Number(e);return this._max=Number.isFinite(t)&&t>0?t:100,this._value>this._max&&(this._value=this._max),this._syncProgress(),this}percent(e){if(e===void 0)return this._percent;let t=Number(e);return Number.isFinite(t)&&(this._value=this._max*Math.max(0,Math.min(100,t))/100),this._syncProgress(),this}showText(e){return e===void 0?this._showText:(this._showText=!!e,this.attr(`data-show-text`,this._showText?`true`:null),this._syncProgress(),this)}label(e){return e===void 0?this._labelBox.textContent():(a(this._labelBox,S(e)),this._syncProgress(),this)}text(e){return e===void 0?this._textContent:(this._textContent=e??null,this._syncProgress(),this)}format(e){return e===void 0?this._format:(this._format=typeof e==`function`?e:null,this._syncProgress(),this)}status(e){return e===void 0?this._status:(this._status=[`error`,`normal`,`processing`,`success`,`warning`].includes(e)?e:`normal`,this.attr(`data-status`,this._status),this._syncProgress(),this)}size(e){return e===void 0?this._size:(this._size=[`default`,`large`,`small`].includes(e)?e:`default`,this.attr(`data-size`,this._size),this)}strokeColor(e){return e===void 0?this._strokeColor:(this._strokeColor=e||null,this._syncProgress(),this)}indeterminate(e){return e===void 0?this._indeterminate:(this._indeterminate=!!e,this._syncProgress(),this)}active(e){return this.indeterminate(e)}ariaLabel(e){return e===void 0?this._ariaLabel:(this._ariaLabel=e==null?null:String(e),this._syncProgress(),this)}_setupProgress(e){if(e!=null){if(typeof e==`function`){e(this);return}if(typeof e==`number`||typeof e==`string`&&!Number.isNaN(Number(e))){this.value(e);return}if(N(e)){let{active:t,ariaLabel:n,children:r,format:i,indeterminate:a,label:o,max:s,percent:c,showText:l,size:u,status:d,strokeColor:f,text:p,value:m,...h}=e;Object.keys(h).length>0&&this.setup(h),n!==void 0&&this.ariaLabel(n),o!==void 0&&this.label(o),s!==void 0&&this.max(s),m!==void 0&&this.value(m),c!==void 0&&this.percent(c),l!==void 0&&this.showText(l),d!==void 0&&this.status(d),u!==void 0&&this.size(u),f!==void 0&&this.strokeColor(f),i!==void 0&&this.format(i),p===void 0?r!==void 0&&this.text(r):this.text(p),a===void 0?t!==void 0&&this.indeterminate(t):this.indeterminate(a);return}this.label(e)}}_syncProgress(){let e=this._max>0?this._value/this._max*100:0;this._percent=Number.isFinite(e)?Math.max(0,Math.min(100,e)):0;let t=this._strokeColor||Oi[this._status]||Oi.normal;if(this.attr(`aria-label`,this._ariaLabel),this.attr(`aria-valuemax`,String(this._max)),this.attr(`aria-valuenow`,this._indeterminate?null:String(this._value)),this.attr(`data-indeterminate`,this._indeterminate?`true`:null),this.attr(`data-percent`,String(Number(this._percent.toFixed(2)))),this.attr(`data-value`,String(this._value)),this.attr(`data-has-label`,this._labelBox.children().length>0?`true`:null),this._labelBox.style(`display`,this._labelBox.children().length>0?`inline-flex`:`none`),this._bar.style(`background`,t),this._indeterminate?this._bar.styles({animation:`yoya-vprogress-indeterminate 1.2s ease-in-out infinite`,width:`100%`}):this._bar.styles({animation:null,width:`${this._percent}%`}),this._showText){let e=this._textContent;e??=this._indeterminate?`处理中`:this._format?this._format(this._value,this._percent):`${Math.round(this._percent)}%`,this._textBox.style(`display`,`inline-flex`),a(this._textBox,S(e))}else this._textBox.style(`display`,`none`);return this}};function Ai(e=null,t=null,n=null){return T(ki,e,t,n)}var ji=class extends y{constructor(t=null){super(`div`,null),this.className(E,`yoya-vcard`),this.styles({background:D(`color-surface`,`#ffffff`),border:e(`color-border`,`#d8dee8`),borderRadius:`8px`,boxShadow:`0 1px 2px rgba(15, 23, 42, 0.05)`,color:D(`color-text-strong`,`#111827`),overflow:`hidden`}),j(this,t)}},Mi=class extends y{constructor(t=null){super(`div`,null),this.className(`yoya-vcard-header`),this.styles({borderBottom:e(`color-border-faint`,`#e5e7eb`),fontWeight:`700`,padding:`12px 16px`}),j(this,t)}},Ni=class extends y{constructor(e=null){super(`div`,null),this.className(`yoya-vcard-body`),this.styles({padding:`16px`}),j(this,e)}},Pi=class extends y{constructor(t=null){super(`div`,null),this.className(`yoya-vcard-footer`),this.styles({alignItems:`center`,background:D(`color-surface-hover`,`#f8fafc`),borderTop:e(`color-border-faint`,`#e5e7eb`),display:`flex`,gap:`8px`,justifyContent:`flex-end`,padding:`12px 16px`}),j(this,t)}};function Fi(e=null,t=null,n=null){return T(ji,e,t,n)}function Ii(e=null,t=null,n=null){return T(Mi,e,t,n)}function Li(e=null,t=null,n=null){return T(Ni,e,t,n)}function Ri(e=null,t=null,n=null){return T(Pi,e,t,n)}var zi=class extends y{constructor(t=null){super(`div`,null),this._columns=[],this._rows=[],this._emptyContent=`暂无数据`,this._hasDeclarativeSections=!1,this._captionBox=new y(`caption`).className(`yoya-vtable-caption`),this._head=new y(`thead`).className(`yoya-vtable-head`),this._body=new y(`tbody`).className(`yoya-vtable-body`),this._table=new y(`table`).className(`yoya-vtable-table`),this._scroll=new y(`div`).className(`yoya-vtable-scroll`),this.className(E,`yoya-vtable`),this.styles({display:`block`,minWidth:`0`}),this._scroll.styles({background:D(`color-surface`,`#ffffff`),border:e(`color-border`,`#d8dee8`),borderRadius:`8px`,overflowX:`auto`}),this._table.styles({borderCollapse:`collapse`,color:D(`color-text`,`#172033`),width:`100%`}),this._captionBox.styles({captionSide:`top`,color:D(`color-text-strong`,`#111827`),fontWeight:`700`,padding:`0 0 12px`,textAlign:`left`}),this._captionBox.style(`display`,`none`),this._scroll.child(this._table),this._table.child(this._captionBox,this._head,this._body),this.child(this._scroll),this._setupTable(t)}caption(e){if(e===void 0)return this._captionBox.textContent();let t=e!=null&&e!==``;return this._captionBox.style(`display`,t?null:`none`),a(this._captionBox,t?S(e):[]),this}columns(e){return e===void 0?this._columns.slice():(this._columns=$i(e),this._renderTable(),this)}rows(e){return e===void 0?this._rows.slice():(this._rows=Array.isArray(e)?e.slice():[],this._renderTable(),this)}empty(e){return e===void 0?this._emptyContent:(this._emptyContent=e,this._renderTable(),this)}emptyText(e){return e===void 0?this._emptyContent:this.empty(e)}data(e){if(e===void 0)return{caption:this.caption(),columns:this.columns(),emptyText:this.emptyText(),rows:this.rows()};if(Array.isArray(e))return this.rows(e),this;if(N(e)){let{caption:t,columns:n,empty:r,emptyText:i,rows:a}=e;t!==void 0&&this.caption(t),n!==void 0&&this.columns(n),a!==void 0&&this.rows(a),i===void 0?r!==void 0&&this.emptyText(r):this.emptyText(i)}return this}child(...e){return e.flat(1/0).forEach(e=>{if(e instanceof Vi||e instanceof Ui||e instanceof Gi){this._addDeclarativeSection(e);return}if(e instanceof qi){this.vTr(e);return}super.child(e)}),this}vThead(e){return this._addDeclarativeSection(e instanceof Vi?e:Hi(e))}vTbody(e){return this._addDeclarativeSection(e instanceof Ui?e:Wi(e))}vTfoot(e){return this._addDeclarativeSection(e instanceof Gi?e:Ki(e))}vTr(e){let t=e instanceof qi?e:Ji(e);if(this._hasDeclarativeSections){let e=this._table.children().find(e=>e instanceof Ui);return e?e.child(t):this.vTbody(e=>e.child(t)),this}return this._body.child(t),this}_addDeclarativeSection(e){return this._hasDeclarativeSections||(this._hasDeclarativeSections=!0,this._detachAutoSections()),this._table.child(e),this}_detachAutoSections(){this._table._children=this._table._children.filter(e=>e!==this._head&&e!==this._body),this._table._childrenDirty=!0,this._table._el&&(this._head._el?.remove(),this._body._el?.remove())}_resetTableShell(){this._table._children.filter(e=>e instanceof Vi||e instanceof Ui||e instanceof Gi).forEach(e=>e.destroy()),this._table._children=[this._captionBox,this._head,this._body],this._table._childrenDirty=!0,this._table._el&&this._table._el.replaceChildren(this._captionBox.renderDom(),this._head.renderDom(),this._body.renderDom()),this._hasDeclarativeSections=!1}_renderTable(){this._resetTableShell();let e=this._columns.length>0?this._columns:ea(this._rows),t=e.length>0?e:[{key:`__value`,label:``}];if(a(this._head,[]),a(this._body,[]),e.length>0){let t=new y(`tr`).className(`yoya-vtable-head-row`);e.forEach((e,n)=>{let r=new y(`th`).className(`yoya-vtable-head-cell`),i=e.key??`column-${n}`;r.attr(`scope`,`col`),r.attr(`data-key`,i),ra(r,e,`head`),na(r,e.label??e.title??e.key??``),t.child(r)}),this._head.child(t)}if(this._rows.length>0)this._rows.forEach((e,n)=>{let r=new y(`tr`).className(`yoya-vtable-row`);r.attr(`data-row-index`,String(n)),t.forEach((t,i)=>{let a=new y(`td`).className(`yoya-vtable-cell`),o=t.key??`column-${i}`;a.attr(`data-key`,o),ra(a,t,`body`),na(a,ta(t,e,n)),r.child(a)}),this._body.child(r)});else{let t=new y(`tr`).className(`yoya-vtable-empty-row`),n=new y(`td`).className(`yoya-vtable-empty`);n.attr(`colspan`,String(Math.max(e.length,1))),n.styles({color:D(`color-text-muted`,`#64748b`),padding:`var(--yoya-space-4, 16px) var(--yoya-space-3, 12px)`,textAlign:`center`}),na(n,this._emptyContent),t.child(n),this._body.child(t)}}_setupTable(e){if(e!=null){if(e instanceof Vi||e instanceof Ui||e instanceof Gi){this._addDeclarativeSection(e);return}if(e instanceof qi){this.vTr(e);return}if(typeof e==`function`){e(this);return}if(Array.isArray(e)){this.rows(e);return}if(N(e)){this.setup(e);return}this.caption(e)}}};function Bi(e=null,t=null,n=null){return T(zi,e,t,n)}var Vi=class extends y{constructor(e=null){super(`thead`,null),this.className(`yoya-vtable-head`),j(this,e)}};function Hi(e=null,t=null,n=null){return T(Vi,e,t,n)}var Ui=class extends y{constructor(e=null){super(`tbody`,null),this.className(`yoya-vtable-body`),j(this,e)}};function Wi(e=null,t=null,n=null){return T(Ui,e,t,n)}var Gi=class extends y{constructor(e=null){super(`tfoot`,null),this.className(`yoya-vtable-foot`),j(this,e)}};function Ki(e=null,t=null,n=null){return T(Gi,e,t,n)}var qi=class extends y{constructor(e=null){super(`tr`,null),this.className(`yoya-vtable-row`),this._setupTr(e)}_setupTr(e){if(Array.isArray(e)){e.forEach(e=>this.child(Qi(e)));return}j(this,e)}};function Ji(e=null,t=null,n=null){return T(qi,e,t,n)}var Yi=class extends y{constructor(e=null){super(`th`,null),this.className(`yoya-vtable-head-cell`),this.attr(`scope`,`col`),ra(this,{},`head`),j(this,e)}};function Xi(e=null,t=null,n=null){return T(Yi,e,t,n)}var Zi=class extends y{constructor(e=null){super(`td`,null),this.className(`yoya-vtable-cell`),ra(this,{},`body`),j(this,e)}};function Qi(e=null,t=null,n=null){return T(Zi,e,t,n)}d(Vi,{vTr:Ji}),d(Ui,{vTr:Ji}),d(Gi,{vTr:Ji}),d(qi,{vTh:Xi,vTd:Qi});function $i(e){return Array.isArray(e)?e.map((e,t)=>{if(typeof e==`string`||typeof e==`number`){let t=String(e);return{key:t,label:t}}if(Array.isArray(e)&&e.length>0){let[n,r=n]=e;return{key:n??`column-${t}`,label:r??n??``}}if(N(e)){let n=e.key??e.field??e.name??e.label??e.title??`column-${t}`;return{...e,key:n,label:e.label??e.title??e.name??n}}return{key:`column-${t}`,label:String(e??``)}}):[]}function ea(e){if(!Array.isArray(e))return[];let t=e.find(e=>e&&typeof e==`object`&&!Array.isArray(e)&&!(e instanceof o));return t?Object.keys(t).map(e=>({key:e,label:e})):[]}function ta(e,t,n){return typeof e.render==`function`?e.render(t,n,e):typeof e.value==`function`?e.value(t,n,e):e.key===`__value`?t:e.value===void 0?e.key&&t&&typeof t==`object`&&!Array.isArray(t)?t[e.key]:t:e.value}function na(e,t){return t!=null&&e.child(t),e}function ra(t,n,r){let i=r===`head`;t.styles({borderBottom:e(`color-border-faint`,`#e2e8f0`),fontWeight:i?`700`:`400`,padding:`var(--yoya-space-3, 12px) var(--yoya-space-3, 12px)`,textAlign:n.align||`left`,verticalAlign:`top`,whiteSpace:n.wrap===!1?`nowrap`:`normal`}),i?(t.style(`background`,D(`color-surface-hover`,`#f8fafc`)),t.style(`color`,D(`color-text-secondary`,`#334155`))):t.style(`color`,D(`color-text`,`#172033`)),n.className!==void 0&&t.className(n.className),n.style!==void 0&&t.styles(n.style),n.width!==void 0&&t.style(`width`,typeof n.width==`number`?`${n.width}px`:n.width),n.minWidth!==void 0&&t.style(`minWidth`,typeof n.minWidth==`number`?`${n.minWidth}px`:n.minWidth),n.maxWidth!==void 0&&t.style(`maxWidth`,typeof n.maxWidth==`number`?`${n.maxWidth}px`:n.maxWidth)}var ia=class extends o{constructor(e){super(),this._html=e}renderDom(){if(!this._el){let e=document.createElement(`template`);e.innerHTML=this._html,this._el=e.content.firstElementChild}return this._el}toHTML(){return this._html}},aa=class extends y{constructor(e=!1){super(`input`),this._treeIndeterminate=!!e}renderDom(){let e=super.renderDom();return e.indeterminate=this._treeIndeterminate,e}},oa=class e{constructor(t=null){this._children=[],this._state={actions:null,checked:!1,disabled:!1,expandable:!1,expanded:!1,icon:null,id:M(`tree-node`),label:``,selected:!1},this.vTreeNode=t=>{let n=t instanceof e?t:new e(t);return this._children.push(n),n},this.node=this.vTreeNode,this.child=(...t)=>(t.flat(1/0).forEach(t=>{this._children.push(t instanceof e?t:new e(t))}),this),this._setup(t)}id(e){return e===void 0?this._state.id:(this._state.id=String(i(e)),this)}key(e){return this.id(e)}label(e){return e===void 0?this._state.label:(this._state.label=e,this)}text(e){return this.label(e)}content(e){return this.label(e)}title(e){return this.label(e)}actions(e){return e===void 0?this._state.actions:(this._state.actions=e??null,this)}icon(e){return e===void 0?this._state.icon:(this._state.icon=e??null,this)}expanded(e){return e===void 0?this._state.expanded:(this._state.expanded=!!e,this)}expandable(e){return e===void 0?this._state.expandable:(this._state.expandable=!!e,this)}selected(e){return e===void 0?this._state.selected:(this._state.selected=!!e,this)}checked(e){return e===void 0?this._state.checked:(this._state.checked=!!e,this)}disabled(e){return e===void 0?this._state.disabled:(this._state.disabled=!!e,this)}toData(){return{actions:this._state.actions,checked:this._state.checked,children:this._children.map(e=>e.toData()),disabled:this._state.disabled,expandable:this._state.expandable,expanded:this._state.expanded,icon:this._state.icon,id:this._state.id,label:this._state.label,selected:this._state.selected}}_setup(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{actions:t,checked:n,children:r,disabled:i,expandable:a,expanded:o,icon:s,id:c,label:l,selected:u,text:d,title:f}=e;c!==void 0&&this.id(c),l===void 0?d===void 0?f!==void 0&&this.label(f):this.label(d):this.label(l),s!==void 0&&this.icon(s),t!==void 0&&this.actions(t),o!==void 0&&this.expanded(o),a!==void 0&&this.expandable(a),u!==void 0&&this.selected(u),n!==void 0&&this.checked(n),i!==void 0&&this.disabled(i),r!==void 0&&this.child(r);return}this.label(e)}}};function sa(t=null,n=null,r=null){let o=R(t,n,r),s={ariaLabel:`树形控件`,building:!0,builderNodes:[],checkable:!1,checkedKeys:new Set,emptyText:`暂无数据`,expandedKeys:new Set,multiple:!1,nodes:[],rowsDirty:!1,selectable:!0,selectedKeys:new Set,toggleIcon:null,treeDirty:!0,visibleNodes:[]},c=null,l=null,u=null,d=null,f=new y(`div`).className(E,`yoya-vtree`).attr({"aria-label":s.ariaLabel,"data-tree":`true`,id:M(`yoya-vtree`),role:`tree`}).styles({background:D(`color-surface`,`#ffffff`),border:e(`color-border`,`#d8dee8`),borderRadius:`8px`,boxSizing:`border-box`,minWidth:`0`,padding:`6px`,width:`100%`}),p=new y(`div`).className(`yoya-vtree-list`).styles({display:`grid`,gap:`2px`,minWidth:`0`}),m=new y(`div`).className(`yoya-vtree-empty`).attr(`role`,`status`).styles({color:D(`color-text-muted`,`#64748b`),display:`none`,fontSize:`0.88rem`,padding:`18px 10px`,textAlign:`center`});f.child(p,m),f.on(`keydown`,ie);let h={ariaLabel(e){return e===void 0?s.ariaLabel:(s.ariaLabel=i(e)||`树形控件`,f.attr(`aria-label`,s.ariaLabel),g(),h)},change(e){return e===void 0?c:(c=typeof e==`function`?e:null,h)},onChange(e){return h.change(e)},checked(e){return e===void 0?h.checkedKeys():Array.isArray(e)?h.checkedKeys(e):s.checkedKeys.has(String(e))},checkedKeys(e){return e===void 0?[...s.checkedKeys]:(s.checkedKeys=new Set(pa(e)),g(),h)},check(e,t=void 0){let n=ma(s.nodes,e);return!n||n.disabled?h:(H(n,t===void 0?!s.checkedKeys.has(n.id):!!t),g(),V(`check`,n),h)},checkable(e){return e===void 0?s.checkable:(s.checkable=!!e,s.treeDirty=!0,g(),h)},checkAll(e=!0){let t=!!e,n=[];return _a(s.nodes,e=>{e.disabled||n.push(e.id)}),t?n.forEach(e=>s.checkedKeys.add(e)):n.forEach(e=>s.checkedKeys.delete(e)),g(),V(`check`,null),h},collapseAll(){return s.expandedKeys.clear(),s.treeDirty=!0,g(),h},collapseNode(e){return h.expandNode(e,!1)},data(e){return h.nodes(e)},emptyText(e){return e===void 0?s.emptyText:(s.emptyText=e,g(),h)},expandAll(){let e=[];return _a(s.nodes,t=>{$(t)&&e.push(t.id)}),s.expandedKeys=new Set(e),s.treeDirty=!0,g(),h},expandedKeys(e){return e===void 0?[...s.expandedKeys]:(s.expandedKeys=new Set(pa(e)),s.treeDirty=!0,g(),h)},expandNode(e,t=!0){let n=ma(s.nodes,e);if(!n||!$(n))return h;let r=!!t;return s.expandedKeys.has(n.id)===r?h:(r?s.expandedKeys.add(n.id):s.expandedKeys.delete(n.id),s.treeDirty=!0,g(),V(`expand`,n),h)},multiple(e){return e===void 0?s.multiple:(s.multiple=!!e,g(),h)},nodes(e){return e===void 0?s.nodes.slice():(s.builderNodes=Array.isArray(e)?e:[e],s.nodes=s.builderNodes.map((e,t)=>da(e,t)),s.expandedKeys=new Set,s.selectedKeys=new Set,s.checkedKeys=new Set,fa(s,s.nodes),ga(s.nodes),s.treeDirty=!0,g(),h)},vTreeNode(e){let t=e instanceof oa?e:new oa(e);return s.builderNodes.push(t),s.nodes=s.builderNodes.map((e,t)=>da(e,t)),fa(s,s.nodes),ga(s.nodes),s.treeDirty=!0,g(),t},node(e){return h.vTreeNode(e)},addNode(e){return h.vTreeNode(e)},onCheck(e){return e===void 0?l:(l=typeof e==`function`?e:null,h)},onSelect(e){return e===void 0?u:(u=typeof e==`function`?e:null,h)},onToggle(e){return e===void 0?d:(d=typeof e==`function`?e:null,h)},render(){return v(),f},select(e,t=void 0){let n=ma(s.nodes,e);if(!n||n.disabled)return h;let r=s.selectedKeys.has(n.id),i=t===void 0?!s.multiple||!r:!!t;return i?s.selectedKeys=s.multiple?new Set([...s.selectedKeys,n.id]):new Set([n.id]):s.selectedKeys.delete(n.id),r===i?(g(),h):(g(),V(`select`,n),h)},selectable(e){return e===void 0?s.selectable:(s.selectable=!!e,s.rowsDirty=!0,g(),h)},selected(e){return e===void 0?va(s.nodes,s.selectedKeys):Array.isArray(e)?h.selectedKeys(e):s.selectedKeys.has(String(e))},selectedKeys(e){return e===void 0?[...s.selectedKeys]:(s.selectedKeys=new Set(pa(e)),g(),h)},toggleNode(e){let t=ma(s.nodes,e);return!t||!$(t)?h:h.expandNode(e,!s.expandedKeys.has(e))},toggleIcon(e,t){return e===void 0&&t===void 0?s.toggleIcon:(t===void 0?N(e)&&`collapsed`in e?s.toggleIcon={collapsed:ua(e.collapsed),expanded:ua(e.expanded)}:s.toggleIcon=ua(e):s.toggleIcon={collapsed:ua(e),expanded:ua(t)},s.treeDirty=!0,g(),h)},update(e){return s.building=!0,_(e),s.building=!1,v(),h},destroy(){return f.destroy(),h}};return _(o.first),s.building=!1,v(),w(h,o.options,o.callback),h;function g(){s.building||v()}function _(e){if(e==null)return;if(typeof e==`function`){e(h);return}if(Array.isArray(e)){h.nodes(e);return}if(!N(e))return;let{ariaLabel:t,change:n,checked:r,checkedKeys:i,checkable:a,children:o,className:s,data:c,emptyText:l,expandAll:u,expandedKeys:d,multiple:p,nodes:m,onCheck:g,onChange:_,onSelect:v,onToggle:y,selectable:ee,selected:b,selectedKeys:x,toggleIcon:S,...te}=e;Object.keys(te).length>0&&f.setup(te),s!==void 0&&f.className(s),t!==void 0&&h.ariaLabel(t),a!==void 0&&h.checkable(a),p!==void 0&&h.multiple(p),ee!==void 0&&h.selectable(ee),S!==void 0&&h.toggleIcon(S),l!==void 0&&h.emptyText(l);let C=m??c??o;C!==void 0&&h.nodes(C),d!==void 0&&h.expandedKeys(d),x===void 0?b!==void 0&&h.selectedKeys(b):h.selectedKeys(x),i===void 0?r!==void 0&&h.checkedKeys(r):h.checkedKeys(i),u===!0&&h.expandAll(),typeof n==`function`?h.change(n):typeof _==`function`&&h.change(_),typeof v==`function`&&h.onSelect(v),typeof y==`function`&&h.onToggle(y),typeof g==`function`&&h.onCheck(g)}function v(){let e=s.nodes.length>0;f.attr(`aria-label`,s.ariaLabel),f.attr(`data-checkable`,s.checkable?`true`:null),f.attr(`data-checked-count`,String(s.checkedKeys.size)),f.attr(`data-empty`,e?null:`true`),f.attr(`data-expanded-count`,String(s.expandedKeys.size)),f.attr(`data-multiple`,s.multiple?`true`:null),f.attr(`data-selected-count`,String(s.selectedKeys.size)),e?(m.style(`display`,`none`),a(m,[])):(m.style(`display`,null),a(m,S(s.emptyText))),ne(),s.treeDirty||s.visibleNodes.length===0?(ee(),s.treeDirty=!1,s.rowsDirty=!1):(b(s.rowsDirty),s.rowsDirty=!1),I(0)}function ee(){s.visibleNodes=[],a(p,[]),s.nodes.length>0&&s.nodes.forEach(e=>T(e,0,null))}function b(e=!1){s.visibleNodes.forEach(t=>{let{checkbox:n,node:r,row:i,toggle:a}=t,o=s.selectedKeys.has(r.id),c=$(r)&&s.expandedKeys.has(r.id);if((t.selected!==o||e)&&(x(i,r,o,t.level),t.selected=o),a&&t.expanded!==c&&(te(t,c),i.attr(`aria-expanded`,String(c)),t.expanded=c),n){let e=s.checkedKeys.has(r.id),i=F(r);(t.checked!==e||t.indeterminate!==i)&&(C(n,r,e,i),t.checked=e,t.indeterminate=i)}})}function x(e,t,n,r){e.styles(k(t,n,r)),e.attr(`aria-selected`,s.selectable?String(n):null)}function te(e,t){let{iconBox:n,node:r,toggle:o}=e,c=i(r.label)||r.id;if(o.attr(`aria-expanded`,String(t)),o.attr(`aria-label`,t?`收起 ${c}`:`展开 ${c}`),s.toggleIcon){let e=N(s.toggleIcon)?t?s.toggleIcon.expanded:s.toggleIcon.collapsed:s.toggleIcon;if(a(n,[]),typeof e==`function`){let r=e(n,t);r&&r!==n&&n.child(r)}else typeof e==`string`?n.child(new ia(e)):a(n,S(e))}else a(o,S(t?`▾`:`▸`))}function C(e,t,n,r){e.attr(`checked`,n?!0:null),e.attr(`aria-checked`,r?`mixed`:n?`true`:`false`),e._treeIndeterminate=r,e._el&&(e._el.indeterminate=r)}function ne(){let e=t=>{t.forEach(t=>{t.checked=s.checkedKeys.has(t.id),t.selected=s.selectedKeys.has(t.id),t.expanded=s.expandedKeys.has(t.id),e(t.children)})};e(s.nodes)}function T(e,t,n){let r=$(e)&&s.expandedKeys.has(e.id),{checkbox:i,iconBox:a,row:o,toggle:c}=O(e,t,r);s.visibleNodes.push({checked:s.checkedKeys.has(e.id),checkbox:i,expanded:r,iconBox:a,indeterminate:F(e),level:t,node:e,parentId:n,row:o,selected:s.selectedKeys.has(e.id),toggle:c}),p.child(o),r&&e.children.forEach(n=>T(n,t+1,e.id))}function O(e,t,n){let r=s.selectedKeys.has(e.id),i=new y(`div`).className(`yoya-vtree-node`).attr({"aria-disabled":e.disabled?`true`:null,"aria-expanded":$(e)?String(s.expandedKeys.has(e.id)):null,"aria-level":String(t+1),"aria-selected":s.selectable?String(r):null,"data-node-id":e.id,role:`treeitem`,tabindex:`-1`}).styles(k(e,r,t));i.on(`click`,()=>{e.disabled||!s.selectable||(h.select(e.id),z(e.id))}),i.on(`mouseenter`,()=>{if(e.disabled)return;let t=s.selectedKeys.has(e.id);i.styles({background:t?D(`color-primary-active-subtle`,`#dbeafe`):D(`color-surface-hover`,`#f1f5f9`),borderColor:t?D(`color-primary-border`,`#93c5fd`):D(`color-border-faint`,`#e2e8f0`)})}),i.on(`mouseleave`,()=>{let n=s.selectedKeys.has(e.id);i.styles(k(e,n,t))});let o=null,c=null,l=null;if($(e)){let t=A(e,n);l=t.toggle,c=t.iconBox,i.child(l)}else i.child(new y(`span`).className(`yoya-vtree-indent`).styles({display:`inline-block`,flex:`0 0 auto`,width:`20px`}));s.checkable&&(o=j(e),i.child(o)),e.icon!==null&&e.icon!==void 0&&i.child(re(e.icon));let u=new y(`span`).className(`yoya-vtree-label`).styles({flex:`1 1 auto`,minWidth:`0`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`});return a(u,S(e.label)),i.child(u),e.actions!==null&&e.actions!==void 0&&i.child(P(e)),{checkbox:o,iconBox:c,row:i,toggle:l}}function k(t,n,r){return{alignItems:`center`,background:n?D(`color-primary-subtle`,`#eff6ff`):`transparent`,border:n?e(`color-primary-border`,`#bfdbfe`):`1px solid transparent`,borderRadius:`6px`,boxSizing:`border-box`,color:n?D(`color-primary-hover`,`#1d4ed8`):t.disabled?D(`color-text-muted`,`#94a3b8`):D(`color-text`,`#172033`),cursor:s.selectable&&!t.disabled?`pointer`:`default`,display:`flex`,gap:`4px`,minHeight:`var(--yoya-tree-row-height, 34px)`,minWidth:`0`,padding:`2px 8px 2px ${8+r*18}px`,transition:`background 120ms ease, border-color 120ms ease`,width:`100%`}}function A(e,t){let n=i(e.label)||e.id,r=new y(`button`).className(`yoya-vtree-toggle`).attr({"aria-expanded":String(t),"aria-label":t?`收起 ${n}`:`展开 ${n}`,tabindex:`-1`,type:`button`}).styles({alignItems:`center`,background:`transparent`,border:`0`,borderRadius:`4px`,color:D(`color-text-secondary`,`#475569`),cursor:`pointer`,display:`inline-flex`,flex:`0 0 auto`,font:`inherit`,height:`var(--yoya-tree-toggle-size, 20px)`,justifyContent:`center`,lineHeight:`1`,padding:`0`,width:`var(--yoya-tree-toggle-size, 20px)`}),o=null;if(s.toggleIcon){o=new y(`span`).className(`yoya-vtree-toggle-icon`).styles({alignItems:`center`,display:`inline-flex`,justifyContent:`center`,lineHeight:`1`});let e=N(s.toggleIcon)?t?s.toggleIcon.expanded:s.toggleIcon.collapsed:s.toggleIcon;if(typeof e==`function`){let n=e(o,t);n&&n!==o&&o.child(n)}else typeof e==`string`?o.child(new ia(e)):a(o,S(e));r.child(o)}else r.text(t?`▾`:`▸`);return r.on(`click`,t=>{t.stopPropagation(),h.toggleNode(e.id),z(e.id)}),{iconBox:o,toggle:r}}function j(e){let t=s.checkedKeys.has(e.id),n=F(e),r=new aa(n).className(`yoya-vtree-checkbox`).attr({"aria-checked":n?`mixed`:t?`true`:`false`,"aria-label":`选择 ${i(e.label)||e.id}`,checked:t?!0:null,disabled:e.disabled?!0:null,tabindex:`-1`,type:`checkbox`}).styles({flex:`0 0 auto`,height:`16px`,margin:`0`,width:`16px`});return r.on(`click`,e=>e.stopPropagation()),r.on(`change`,()=>{h.check(e.id,r._el?.checked??!1)}),r}function re(e){let t=new y(`span`).className(`yoya-vtree-icon`).styles({alignItems:`center`,color:D(`color-text-muted`,`#64748b`),display:`inline-flex`,flex:`0 0 auto`,fontSize:`0.82rem`,justifyContent:`center`,minWidth:`18px`});if(typeof e==`function`){let n=e(t);n&&n!==t&&t.child(n)}else a(t,S(e));return t}function P(e){let t=new y(`span`).className(`yoya-vtree-node-actions`).styles({alignItems:`center`,display:`inline-flex`,flex:`0 0 auto`,gap:`4px`,marginLeft:`auto`});if(t.on(`click`,e=>e.stopPropagation()),typeof e.actions==`function`){let n=e.actions(t,e);n&&n!==t&&t.child(n)}else a(t,S(e.actions));return t}function F(e){if(!s.checkable||e.children.length===0)return!1;let t=e.ids||ha(e),n=t.some(e=>s.checkedKeys.has(e)),r=t.every(e=>s.checkedKeys.has(e));return n&&!r}function I(e){s.visibleNodes.forEach((t,n)=>{let r=!t.node.disabled;t.row.attr(`tabindex`,r&&n===e?`0`:`-1`)})}function L(e){let t=s.visibleNodes[e];!t||t.node.disabled||(I(e),t.row._el?.focus())}function z(e){let t=s.visibleNodes.findIndex(t=>t.node.id===e);t>=0&&L(t)}function ie(e){let t=e.target.closest?.(`.yoya-vtree-node`);if(!t||t.closest(`.yoya-vtree`)!==f._el)return;let n=s.visibleNodes.findIndex(e=>e.row._el===t);if(n===-1||!new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Enter`,`Home`,` `,`Spacebar`]).has(e.key))return;e.preventDefault();let r=s.visibleNodes[n];switch(e.key){case`ArrowDown`:B(n,1);break;case`ArrowUp`:B(n,-1);break;case`Home`:B(-1,1);break;case`End`:B(s.visibleNodes.length,-1);break;case`ArrowRight`:$(r.node)&&(s.expandedKeys.has(r.node.id)?n+1<s.visibleNodes.length&&L(n+1):(h.expandNode(r.node.id),z(r.node.id)));break;case`ArrowLeft`:if($(r.node)&&s.expandedKeys.has(r.node.id))h.collapseNode(r.node.id),z(r.node.id);else{let e=-1;for(let t=n-1;t>=0;--t)if(s.visibleNodes[t].node.id===r.parentId){e=t;break}e>=0&&L(e)}break;case`Enter`:case` `:case`Spacebar`:s.selectable&&!r.node.disabled&&(h.select(r.node.id),z(r.node.id))}}function B(e,t){let n=s.visibleNodes.length;for(let r=e+t;r>=0&&r<n;r+=t)if(!s.visibleNodes[r].node.disabled){L(r);return}}function V(e,t){let n={checkedKeys:h.checkedKeys(),expandedKeys:h.expandedKeys(),id:t?.id??null,key:t?.id??null,label:t?.label??null,node:t??null,selectedKeys:h.selectedKeys(),type:e};c?.(n),e===`check`?l?.(n):e===`expand`?d?.(n):e===`select`&&u?.(n)}function H(e,t){ha(e).forEach(e=>{t?s.checkedKeys.add(e):s.checkedKeys.delete(e)})}}function ca(e=null,t=null,n=null){let r=R(e,t,n);return r.first&&typeof r.first.render==`function`&&typeof r.first.nodes==`function`?w(r.first,r.options,r.callback):sa(e,t,n)}function la(e=null){return e instanceof oa?e:new oa(e)}function ua(e){return e&&typeof e.toHTML==`function`?e.toHTML():e}function da(e,t,n=null){let r=n?`${n}-${t}`:`tree-node-${t}`;if(e instanceof oa)return da(e.toData(),t,n);if(e instanceof o||typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return{actions:null,checked:!1,children:[],disabled:!1,expandable:!1,expanded:!1,icon:null,id:r,label:e,selected:!1};if(Array.isArray(e)&&e.length>=2)return da({children:e[1],id:e[0],label:e[0]},t,n);if(N(e)){let t=e.id??e.key??e.value??r,n=String(i(t)),a=e.label??e.text??e.title??e.content??n,o=Array.isArray(e.children)?e.children.map((e,t)=>da(e,t,n)):[];return{actions:e.actions??null,checked:!!e.checked,children:o,disabled:!!e.disabled,expandable:!!e.expandable,expanded:!!e.expanded,icon:e.icon??null,id:n,label:a,selected:!!e.selected}}return{actions:null,checked:!1,children:[],disabled:!1,expandable:!1,expanded:!1,icon:null,id:r,label:String(e??``),selected:!1}}function fa(e,t){t.forEach(t=>{t.expanded&&e.expandedKeys.add(t.id),t.selected&&e.selectedKeys.add(t.id),t.checked&&e.checkedKeys.add(t.id),fa(e,t.children)})}function pa(e){return e==null?[]:Array.isArray(e)?e.map(e=>String(i(e))).filter(e=>e!==``):[String(i(e))].filter(e=>e!==``)}function ma(e,t){for(let n of e){if(n.id===t)return n;let e=ma(n.children,t);if(e)return e}return null}function ha(e,t=[]){return t.push(e.id),e.children.forEach(e=>ha(e,t)),t}function ga(e){e.forEach(e=>{e.ids=ha(e),ga(e.children)})}function _a(e,t){e.forEach(e=>{t(e),_a(e.children,t)})}function $(e){return e.children.length>0||!!e.expandable}function va(e,t){let n=[],r=e=>{e.forEach(e=>{t.has(e.id)&&n.push(e),r(e.children)})};return r(e),n}function ya(e,t){return typeof e==`string`||typeof e==`number`?{key:String(e),title:String(e),dataIndex:String(e)}:{key:String(e?.key??t),...e}}function ba(e,t){let n=t?.dataIndex??t?.key;return e?.[n]}function xa(e,t){return e?.id??t}var Sa=class extends y{constructor(e=null){super(`div`,null),this.className(E,`yoya-vtreetable`),this._columns=[],this._nodes=[],this._rowKey=xa,this._selection=!1,this._expanded=new Set,this._checked=new Set,this._lazyLoad=null,this._flat=[],this._applySetup(e),this._rebuild()}columns(e){return e===void 0?this._columns.slice():(this._columns=Array.isArray(e)?e.map(ya):[],this._rebuild(),this)}nodes(e){return e===void 0?this._nodes.slice():(this._nodes=Array.isArray(e)?e:[],this._rebuild(),this)}rowKey(e){return e===void 0?this._rowKey:(this._rowKey=typeof e==`function`?e:xa,this)}rowSelection(e){return e===void 0?this._selection:(this._selection=!!e,this._rebuild(),this)}lazyLoad(e){return e===void 0?this._lazyLoad:(this._lazyLoad=typeof e==`function`?e:null,this)}expandedKeys(e){return e===void 0?Array.from(this._expanded):(this._expanded=new Set(Array.isArray(e)?e:[]),this._rebuild(),this)}expandKeys(e){return this.expandedKeys(e)}checkedKeys(e){return e===void 0?Array.from(this._checked):(this._checked=new Set(Array.isArray(e)?e:[]),this._rebuild(),this)}expandAll(){let e=t=>{t.forEach(t=>{let n=String(this._nodeKey(t));this._hasChildren(t)&&(this._expanded.add(n),e(this._childNodes(t)))})};return e(this._nodes),this._rebuild(),this}collapseAll(){return this._expanded.clear(),this._rebuild(),this}visibleRowCount(){return this._flat.length}_nodeKey(e,t=0){return this._rowKey(e,t)}_hasChildren(e){return!!e&&(!!e.hasChildren||Array.isArray(e.children)&&e.children.length>0)}_childNodes(e){return Array.isArray(e.children)?e.children:[]}_applySetup(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{columns:t,expandedKeys:n,lazyLoad:r,nodes:i,rowKey:a,rowSelection:o,...s}=e;Object.keys(s).forEach(e=>{s[e]!==void 0&&this.attr(e,s[e])}),t!==void 0&&this.columns(t),a!==void 0&&this.rowKey(a),i!==void 0&&this.nodes(i),o!==void 0&&this.rowSelection(o),r!==void 0&&this.lazyLoad(r),n!==void 0&&this.expandedKeys(n)}}}_flatten(){let e=[],t=0,n=(r,i)=>{r.forEach(r=>{let a=String(this._nodeKey(r,t));t+=1;let o=this._hasChildren(r);e.push({node:r,key:a,depth:i,hasChildren:o}),o&&this._expanded.has(a)&&n(this._childNodes(r),i+1)})};n(this._nodes,0),this._flat=e}_descendantKeys(e){let t=[],n=e=>{e.forEach(e=>{let r=String(this._nodeKey(e,0));this._hasChildren(e)?n(this._childNodes(e)):t.push(r)})};return n(this._childNodes(e)),t}_stateForNode(e){let t=this._descendantKeys(e);if(t.length===0){let t=String(this._nodeKey(e,0));return{checked:this._checked.has(t),indeterminate:!1}}let n=t.filter(e=>this._checked.has(e)).length;return{checked:n===t.length,indeterminate:n>0&&n<t.length}}_toggleExpand(e){let{key:t,node:n,hasChildren:r}=e;if(r){if(this._expanded.has(t)){this._expanded.delete(t),this._rebuild();return}if(this._childNodes(n).length===0&&typeof this._lazyLoad==`function`){Promise.resolve(this._lazyLoad(n)).then(e=>{n.children=Array.isArray(e)?e:[],this._expanded.add(t),this._rebuild()});return}this._expanded.add(t),this._rebuild()}}_toggleSelect(e){let{node:t}=e,n=String(this._nodeKey(t,0)),r=this._descendantKeys(t);if(r.length===0)this._checked.has(n)?this._checked.delete(n):this._checked.add(n);else{let e=r.every(e=>this._checked.has(e));r.forEach(t=>{e?this._checked.delete(t):this._checked.add(t)})}this._rebuild()}_rebuild(){this._flatten();let e=new y(`tr`),t=new y(`th`).attr(`data-role`,`structure`);this._selection&&t.text(`选择`),e.child(t),this._columns.forEach(t=>e.child(new y(`th`).attr(`data-key`,t.key).text(t.title??t.label??t.key??``)));let n=this._flat.map((e,t)=>this._renderRow(e,t)),r=new y(`table`).className(`yoya-vtreetable-table`).child(new y(`thead`).child(e),new y(`tbody`).child(...n));return a(this,[r]),this}_renderRow(e,t){let{node:n,key:r,depth:i,hasChildren:a}=e,o=new y(`tr`).attr(`data-row-key`,r),s=new y(`td`).attr(`data-depth`,String(i)).child(this._selection?this._renderCheckbox(e):null);if(a){let t=this._expanded.has(r);s.child(new y(`button`).className(`yoya-vtreetable-expand`).attr({type:`button`,"data-role":`expand`,"aria-expanded":t?`true`:`false`}).style(`marginLeft`,`${i*16}px`).text(t?`▾`:`▸`).on(`click`,()=>this._toggleExpand(e)))}else s.child(new y(`span`).style(`display`,`inline-block`).style(`width`,`${i*16+16}px`));return o.child(s),this._columns.forEach(e=>{let r=ba(n,e),i=typeof e.render==`function`?e.render(r,n,t):String(r??``);o.child(new y(`td`).attr(`data-key`,e.key).child(i))}),o}_renderCheckbox(e){let{node:t}=e,n=this._stateForNode(t);return new y(`input`).className(`yoya-vtreetable-select`).attr({type:`checkbox`,checked:n.checked?!0:null,"data-indeterminate":n.indeterminate?`true`:null}).on(`change`,()=>this._toggleSelect(e))}};function Ca(e=null,t=null,n=null){return T(Sa,e,t,n)}const wa={danger:D(`color-danger`,`#dc2626`),neutral:D(`color-text-secondary`,`#64748b`),primary:D(`color-primary`,`#2563eb`),success:D(`color-success`,`#16a34a`),warning:D(`color-warning`,`#d97706`)};var Ta=class extends y{constructor(e=null){super(`div`,null),this._value=0,this._max=100,this._unit=``,this._tone=`primary`,this._size=220,this._svg=new f(`svg`),this._track=new f(`path`),this._arc=new f(`path`),this._needle=new f(`polygon`),this._hub=new f(`circle`),this._hubInner=new f(`circle`),this._valueText=new f(`text`),this._minText=new f(`text`),this._maxText=new f(`text`),this.className(E,`yoya-vgauge`),this.styles({boxSizing:`border-box`,position:`relative`}),this.child(this._svg.child(this._track,this._arc,this._needle,this._hub,this._hubInner,this._valueText,this._minText,this._maxText)),this._render(),j(this,e),this._render()}value(e){return e===void 0?this._value:(this._value=Number(e)||0,this._render(),this)}max(e){return e===void 0?this._max:(this._max=Number(e)||100,this._render(),this)}unit(e){return e===void 0?this._unit:(this._unit=e,this._render(),this)}tone(e){return e===void 0?this._tone:(this._tone=e,this._render(),this)}_render(){let e=this._max>0?Math.min(100,Math.max(0,this._value/this._max*100)):0,t=Math.PI*(1+e/100),n=100+80*Math.cos(t),r=100+80*Math.sin(t),i=-90+e/100*180;this.style(`width`,`${this._size}px`),this.style(`height`,`${Math.round(this._size/2)}px`),this._svg.attr({preserveAspectRatio:`none`,viewBox:`0 0 200 110`}).styles({display:`block`,height:`100%`,width:`100%`}),this._track.attr({d:`M 20 100 A 80 80 0 0 1 180 100`,fill:`none`,"stroke-linecap":`round`,"stroke-width":12}).style(`stroke`,D(`color-border-faint`,`#e5e7eb`)),this._arc.attr({d:`M 20 100 A 80 80 0 0 1 ${n.toFixed(2)} ${r.toFixed(2)}`,fill:`none`,"stroke-linecap":`round`,"stroke-width":12}).style(`stroke`,wa[this._tone]||this._tone),this._needle.attr({points:`96,108 104,108 100,42`,transform:`rotate(${i.toFixed(2)} 100 100)`}).styles({fill:D(`color-text`,`#24292f`),stroke:D(`color-text`,`#24292f`),strokeLinejoin:`round`,strokeWidth:`1`}),this._hub.attr({cx:100,cy:100,r:8}).style(`fill`,D(`color-text`,`#24292f`)),this._hubInner.attr({cx:100,cy:100,r:3.5}).style(`fill`,D(`color-surface`,`#ffffff`)),this._valueText.attr({"text-anchor":`middle`,x:100,y:72}).styles({fill:D(`color-text`,`#24292f`),fontSize:`20px`,fontWeight:`700`}).clearChildren().text(`${this._value}${this._unit}`),this._minText.attr({"text-anchor":`start`,x:20,y:106}).styles({fill:D(`color-text-secondary`,`#64748b`),fontSize:`10px`}).clearChildren().text(`0`),this._maxText.attr({"text-anchor":`end`,x:180,y:106}).styles({fill:D(`color-text-secondary`,`#64748b`),fontSize:`10px`}).clearChildren().text(String(this._max))}};function Ea(e=null,t=null,n=null){return T(Ta,e,t,n)}const Da={danger:D(`color-danger`,`#dc2626`),neutral:D(`color-text-secondary`,`#64748b`),primary:D(`color-primary`,`#2563eb`),success:D(`color-success`,`#16a34a`),warning:D(`color-warning`,`#d97706`)};var Oa=class extends y{constructor(e=null){super(`div`,null),this._percent=0,this._size=120,this._strokeWidth=10,this._tone=`primary`,this._valueExplicit=!1,this._valueNode=m(``),this._labelNode=m(``),this._svg=new f(`svg`),this._circle=new f(`circle`),this._track=new f(`circle`);let t=new y(`div`).className(`yoya-vring-stat-center`).styles({alignItems:`center`,display:`flex`,flexDirection:`column`,inset:`0`,justifyContent:`center`,position:`absolute`}),n=new y(`div`).className(`yoya-vring-stat-value`).styles({fontSize:`22px`,fontWeight:`700`,lineHeight:`1.2`}).child(this._valueNode),r=new y(`div`).className(`yoya-vring-stat-label`).styles({color:D(`color-text-secondary`,`#64748b`),fontSize:`12px`,lineHeight:`1.4`,marginTop:`2px`}).child(this._labelNode);t.child(n,r),this.className(E,`yoya-vring-stat`),this.styles({boxSizing:`border-box`,position:`relative`}),this._svg.child(this._track,this._circle),this.child(this._svg,t),this._applyTone(),this._render(),j(this,e),this._render()}percent(e){return e===void 0?this._percent:(this._percent=Math.min(100,Math.max(0,Number(e)||0)),this._render(),this)}value(e){return e===void 0?this._valueNode.textContent():(this._valueExplicit=!0,this._valueNode.textContent(e),this)}label(e){return e===void 0?this._labelNode.textContent():(this._labelNode.textContent(e),this)}size(e){return e===void 0?this._size:(this._size=Number(e)||120,this._render(),this)}strokeWidth(e){return e===void 0?this._strokeWidth:(this._strokeWidth=Number(e)||10,this._render(),this)}tone(e){return e===void 0?this._tone:(this._tone=e,this._applyTone(),this)}_applyTone(){let e=Da[this._tone]||this._tone;this._circle.style(`stroke`,e)}_render(){let e=this._size,t=e/2-this._strokeWidth/2-2,n=2*Math.PI*t,r=e/2;this.style(`width`,`${e}px`),this.style(`height`,`${e}px`),this._valueExplicit||this._valueNode.textContent(`${Math.round(this._percent)}%`),this._svg.attr({viewBox:`0 0 ${e} ${e}`}).styles({display:`block`,height:`${e}px`,width:`${e}px`}),this._track.attr({cx:r,cy:r,fill:`none`,r:t,"stroke-width":this._strokeWidth}).style(`stroke`,D(`color-border-faint`,`#e5e7eb`)),this._circle.attr({cx:r,cy:r,fill:`none`,r:t,"stroke-dasharray":String(n),"stroke-dashoffset":String(n*(1-this._percent/100)),"stroke-linecap":`round`,"stroke-width":this._strokeWidth,transform:`rotate(-90 ${r} ${r})`}).style(`stroke`,Da[this._tone]||this._tone)}};function ka(e=null,t=null,n=null){return T(Oa,e,t,n)}const Aa={danger:D(`color-danger`,`#dc2626`),neutral:D(`color-text-secondary`,`#64748b`),primary:D(`color-primary`,`#2563eb`),success:D(`color-success`,`#16a34a`),warning:D(`color-warning`,`#d97706`)};var ja=class extends f{constructor(e=null){super(`svg`),this._values=[],this._fill=!1,this._strokeWidth=2,this._tone=`primary`,this.className(`yoya-vsparkline`),this.attr({preserveAspectRatio:`none`,viewBox:`0 0 100 30`}),this.styles({display:`block`,height:`32px`,width:`100%`}),this._area=new f(`path`).styles({fillOpacity:`0.14`,pointerEvents:`none`}),this._line=new f(`polyline`).styles({fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`}),this.child(this._area,this._line),this._applyTone(),this._render(),j(this,e),this._render()}data(e){return e===void 0?this._values:(this._values=Array.isArray(e)?e.slice():[],this._render(),this)}fill(e){return e===void 0?this._fill:(this._fill=!!e,this._render(),this)}strokeWidth(e){return e===void 0?this._strokeWidth:(this._strokeWidth=Number(e)||2,this._line.style(`strokeWidth`,String(this._strokeWidth)),this)}tone(e){return e===void 0?this._tone:(this._tone=e,this._applyTone(),this)}_applyTone(){let e=Aa[this._tone]||this._tone;this._line.style(`stroke`,e),this._area.style(`fill`,e)}_render(){let e=this._values.filter(e=>Number.isFinite(e));if(e.length===0){this._line.attr(`points`,``),this._area.attr(`d`,``),this._area.style(`display`,`none`);return}let t=Math.min(...e),n=Math.max(...e)-t||1,r=e.length>1?96/(e.length-1):0,i=e.map((e,i)=>{let a=2+i*r,o=28-(e-t)/n*26;return`${a.toFixed(2)},${o.toFixed(2)}`});if(this._line.attr(`points`,i.join(` `)),this._area.style(`display`,this._fill?`block`:`none`),this._fill){let e=i[i.length-1].split(`,`)[0];this._area.attr(`d`,`M ${i[0]} L ${i.slice(1).join(` L `)} L ${e} 28 L 2 28 Z`)}else this._area.attr(`d`,``)}};function Ma(e=null,t=null,n=null){return T(ja,e,t,n)}const Na={danger:D(`color-danger`,`#dc2626`),default:D(`color-text-secondary`,`#94a3b8`),processing:D(`color-info`,`#1677ff`),success:D(`color-success`,`#16a34a`),warning:D(`color-warning`,`#d97706`)},Pa=new Set(Object.keys(Na));var Fa=class extends y{constructor(e=null){super(`div`,null),this.className(E,`yoya-vtimeline`),this.styles({position:`relative`}),this._line=new y(`div`).className(`yoya-vtimeline-line`).styles({background:D(`color-border`,`#e2e8f0`),bottom:`16px`,left:`11px`,position:`absolute`,top:`8px`,width:`2px`}),this._line.style(`zIndex`,`0`),this.child(this._line),j(this,e)}},Ia=class extends y{constructor(e=null){super(`div`,null),this._status=`default`,this._titleNode=m(``),this._timeNode=m(``),this._dot=new y(`div`).className(`yoya-vtimeline-item-dot`),this._indicator=new y(`div`).className(`yoya-vtimeline-item-indicator`).styles({alignItems:`center`,display:`flex`,flexDirection:`column`,flexShrink:`0`,paddingTop:`6px`,width:`24px`}).child(this._dot);let t=new y(`div`).className(`yoya-vtimeline-item-title`).styles({fontSize:`14px`,fontWeight:`600`,lineHeight:`1.4`}).child(this._titleNode),n=new y(`div`).className(`yoya-vtimeline-item-time`).styles({color:D(`color-text-secondary`,`#64748b`),fontSize:`12px`,lineHeight:`1.4`,marginTop:`2px`}).child(this._timeNode);this._contentBox=new y(`div`).className(`yoya-vtimeline-item-content`).styles({color:D(`color-text-secondary`,`#475569`),fontSize:`13px`,lineHeight:`1.6`,marginTop:`6px`});let r=new y(`div`).className(`yoya-vtimeline-item-body`).styles({display:`flex`,flexDirection:`column`,minWidth:`0`,paddingBottom:`20px`}).child(t,n,this._contentBox);this.className(E,`yoya-vtimeline-item`),this.styles({display:`flex`,gap:`12px`}),this._indicator.style(`zIndex`,`1`),this.child(this._indicator,r),this._applyStatus(),j(this,e)}status(e){return e===void 0?this._status:(this._status=Pa.has(e)?e:`default`,this._applyStatus(),this)}title(e){return e===void 0?this._titleNode.textContent():(this._titleNode.textContent(e),this)}time(e){return e===void 0?this._timeNode.textContent():(this._timeNode.textContent(e),this)}content(e){return e===void 0?this._contentBox:(O(this._contentBox,e),this)}_applyStatus(){let e=Na[this._status];this._dot.styles({background:e,border:`2px solid `+D(`color-surface`,`#ffffff`),borderRadius:`50%`,height:`10px`,width:`10px`})}};function La(e=null,t=null,n=null){return T(Fa,e,t,n)}function Ra(e=null,t=null,n=null){return T(Ia,e,t,n)}var za=class extends y{constructor(t=null){super(`div`,null),this._up=!0,this._titleNode=m(``),this._valueNode=m(``),this._unitNode=m(``),this._deltaNode=m(``),this._sparkline=Ma(),this._sparkline.style(`height`,`26px`);let n=new y(`div`).className(`yoya-vtrend-card-title`).styles({color:D(`color-text-secondary`,`#475569`),fontSize:`13px`,lineHeight:`1.4`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`}).child(this._titleNode),r=new y(`span`).className(`yoya-vtrend-card-unit`).styles({color:D(`color-text-secondary`,`#64748b`),fontSize:`13px`,fontWeight:`400`,lineHeight:`1`}).child(this._unitNode),i=new y(`div`).className(`yoya-vtrend-card-value`).styles({alignItems:`baseline`,display:`flex`,gap:`6px`,fontSize:`26px`,fontWeight:`700`,lineHeight:`1.2`,marginTop:`6px`}).child(this._valueNode,r);this._delta=new y(`div`).className(`yoya-vtrend-card-delta`).styles({fontSize:`13px`,fontWeight:`600`,lineHeight:`1.4`,marginLeft:`12px`,whiteSpace:`nowrap`}).child(this._deltaNode);let a=new y(`div`).className(`yoya-vtrend-card-footer`).styles({alignItems:`flex-end`,display:`flex`,marginTop:`8px`}).child(this._sparkline,this._delta);this.className(E,`yoya-vtrend-card`),this.styles({background:D(`color-surface`,`#ffffff`),border:e(`color-border`,`#e2e8f0`),borderRadius:`10px`,boxSizing:`border-box`,display:`flex`,flexDirection:`column`,minWidth:`0`,padding:`16px`}),this.child(n,i,a),this._applyDeltaColor(),j(this,t)}title(e){return e===void 0?this._titleNode.textContent():(this._titleNode.textContent(e),this)}value(e){return e===void 0?this._valueNode.textContent():(this._valueNode.textContent(e),this)}unit(e){return e===void 0?this._unitNode.textContent():(this._unitNode.textContent(e),this)}delta(e){return e===void 0?this._deltaNode.textContent():(this._deltaNode.textContent(e),this)}up(e){return e===void 0?this._up:(this._up=!!e,this._applyDeltaColor(),this)}data(e){return this._sparkline.data(e),this}tone(e){return this._sparkline.tone(e),this}_applyDeltaColor(){this._delta.style(`color`,this._up?D(`color-success`,`#16a34a`):D(`color-danger`,`#dc2626`))}};function Ba(e=null,t=null,n=null){return T(za,e,t,n)}var Va=class extends y{constructor(e=null){super(`div`,null),this._blocked=!1,this._loading=!1,this._loop=!1,this._page=0,this._threshold=80,this._checkScheduled=!1,this._loadMoreHandler=null,this._renderItem=null,this._itemsData=[],this._virtual=null,this._itemHeight=48,this._overscan=5,this._resizeObserver=null,this._loadingContent=`加载中…`,this._endContent=`没有更多了`,this._list=new y(`div`).className(`yoya-vscroll-list`),this._statusBox=new y(`span`).className(`yoya-vscroll-status`),this._footer=new y(`div`).className(`yoya-vscroll-footer`).child(this._statusBox),this.className(E,`yoya-vscroll`),this.attr({"aria-busy":`false`,"aria-live":`polite`,"data-item-height":`48`,"data-overscan":`5`,"data-page":`0`,"data-threshold":`80`,role:`feed`}),this.styles({boxSizing:`border-box`,minWidth:`0`,overflowY:`auto`,overscrollBehavior:`contain`,position:`relative`}),this.child(this._list,this._footer),this.on(`scroll`,()=>this._handleScroll()),this._setupScroll(e),this._syncVirtualState(),this._syncFooter()}content(e){return e===void 0?this._list.children():(this._itemsData=[],this._renderItem=null,O(this._list,e),this._syncVirtualState(),this._scheduleCheck(),this)}items(e,t=null){return e===void 0?this._itemsData.slice():(typeof t==`function`&&(this._renderItem=t),this._itemsData=Array.isArray(e)?e.slice():[e],this._renderItems(),this._scheduleCheck(),this)}append(e,t=null){let n=Array.isArray(e)?e:[e];return typeof t==`function`&&(this._renderItem=t),this._itemsData=this._itemsData.concat(n),this._renderItems(),n.length>0&&this._scheduleCheck(),this}renderItem(e){return e===void 0?this._renderItem:(this._renderItem=typeof e==`function`?e:null,this._itemsData.length>0&&this._renderItems(),this)}loadMore(e){return e===void 0?this._loadMoreHandler:(this._loadMoreHandler=typeof e==`function`?e:null,this._loadMoreHandler&&this._scheduleCheck(),this)}onLoadMore(e){return this.loadMore(e)}loop(e){return e===void 0?this._loop:(this._loop=!!e,this._loop&&(this._blocked=!1),this.attr(`data-loop`,this._loop?`true`:null),this.attr(`data-blocked`,this._blocked?`true`:null),this._syncFooter(),this)}block(e){return e===void 0?this._blocked:(this._blocked=!!e,this._blocked&&(this._loop=!1),this.attr(`data-blocked`,this._blocked?`true`:null),this.attr(`data-loop`,this._loop?`true`:null),this._syncFooter(),this)}blocked(e){return this.block(e)}loading(e){return e===void 0?this._loading:(this._loading=!!e,this.attr(`data-loading`,this._loading?`true`:null),this.attr(`aria-busy`,this._loading?`true`:`false`),this._syncFooter(),this)}threshold(e){if(e===void 0)return this._threshold;let t=Number(e);return this._threshold=Number.isFinite(t)&&t>=0?t:80,this.attr(`data-threshold`,String(this._threshold)),this}virtual(e){return e===void 0?this._isVirtualEnabled():(this._virtual=!!e,this._syncVirtualState(),this._itemsData.length>0&&this._renderItems(),this)}virtualize(e){return this.virtual(e)}itemHeight(e){if(e===void 0)return this._itemHeight;let t=Number(e);return this._itemHeight=Number.isFinite(t)&&t>0?Math.max(1,t):48,this.attr(`data-item-height`,String(this._itemHeight)),this._itemsData.length>0&&this._renderItems(),this}overscan(e){if(e===void 0)return this._overscan;let t=Number(e);return this._overscan=Number.isFinite(t)&&t>=0?Math.floor(t):5,this.attr(`data-overscan`,String(this._overscan)),this._itemsData.length>0&&this._renderItems(),this}page(e){if(e===void 0)return this._page;let t=Number(e);return this._page=Number.isFinite(t)&&t>=0?Math.floor(t):0,this.attr(`data-page`,String(this._page)),this}loadingText(e){return e===void 0?this._loadingContent:(this._loadingContent=e,this._syncFooter(),this)}endText(e){return e===void 0?this._endContent:(this._endContent=e,this._syncFooter(),this)}reset(){return this._itemsData=[],this._renderItem=null,this._page=0,this._blocked=!1,this._loading=!1,this.attr(`data-blocked`,null),this.attr(`data-loading`,null),this.attr(`data-page`,`0`),this.attr(`aria-busy`,`false`),a(this._list,[]),this._syncVirtualState(),this._syncFooter(),this}clear(){return this.reset()}load(){if(this._deleted||this._loading||this._blocked||typeof this._loadMoreHandler!=`function`)return Promise.resolve(!1);this.page(this._page+1),this.loading(!0);let e={append:(e,t)=>this.append(e,t),block:(e=!0)=>this.block(e),done:()=>this.block(!0),page:this._page,scroll:this},t;try{t=this._loadMoreHandler(e)}catch(e){return this.loading(!1),Promise.reject(e)}return t&&typeof t.then==`function`?Promise.resolve(t).then(e=>(e!=null&&this.append(e),this.loading(!1),!0),e=>{throw this.loading(!1),e}):(t!=null&&this.append(t),this.loading(!1),Promise.resolve(!0))}check(){return this._checkLoad()}toHTML(){if(!this._isVirtualEnabled()||this._itemsData.length===0)return super.toHTML();let e=this._itemsData.length,{end:t,start:n}=this._visibleRange(e),r=[];for(let i=n;i<t;i+=1){let t=this._renderItem?this._renderItem(this._itemsData[i],i,this):this._itemsData[i];r.push(this._createVirtualItem(t,i,e))}let i=this._list._children;this._list._children=r,this._list.style(`height`,`${this._virtualListHeight(e)}px`);try{return super.toHTML()}finally{this._list._children=i}}renderDom(){let e=super.renderDom();return this._isVirtualEnabled()&&this._itemsData.length>0&&(this._renderItems(),this._observeSize()),this._scheduleCheck(),e}destroy(){return this._disconnectSizeObserver(),super.destroy()}_renderItems(){this._syncVirtualState();let e=this._itemsData.length;if(!this._isVirtualEnabled()||e===0)return a(this._list,this._itemsData.map((e,t)=>this._renderItem?this._renderItem(e,t,this):e)),this;let{end:t,start:n}=this._visibleRange(e),r=[];for(let i=n;i<t;i+=1){let t=this._renderItem?this._renderItem(this._itemsData[i],i,this):this._itemsData[i];r.push(this._createVirtualItem(t,i,e))}return a(this._list,r),this._list.style(`height`,`${this._virtualListHeight(e)}px`),this}_handleScroll(){this._isVirtualEnabled()&&this._itemsData.length>0&&this._renderItems(),this._checkLoad()}_visibleRange(e){let t=this._itemHeight+8,n=this._el&&Number(this._el.scrollTop)||0,r=this._el&&Number(this._el.clientHeight)||0,i=Math.max(0,Math.floor((n-12)/t)-this._overscan);return{end:Math.min(e,Math.max(0,Math.ceil((n+r-12)/t)+this._overscan)),start:i}}_createVirtualItem(e,t,n){let r=12+t*(this._itemHeight+8);return new y(`div`).className(`yoya-vscroll-virtual-item`).attr({"aria-posinset":String(t+1),"aria-setsize":String(n),"data-index":String(t)}).styles({boxSizing:`border-box`,height:`${this._itemHeight}px`,left:`0`,minWidth:`0`,overflow:`visible`,position:`absolute`,right:`0`,top:`${r}px`,width:`100%`}).child(e)}_virtualListHeight(e){return e===0?0:24+e*this._itemHeight+(e-1)*8}_syncVirtualState(){let e=this._isVirtualEnabled()&&this._itemsData.length>0;return this.attr(`data-virtual`,e?`true`:null),e?(this._list.styles({display:`block`,gap:`0`,padding:`0`,position:`relative`}),this._observeSize()):(this._list.styles({display:null,gap:null,height:null,padding:null,position:null}),this._disconnectSizeObserver()),this}_isVirtualEnabled(){return this._virtual===!0||this._virtual===null&&this._itemsData.length>=100}_observeSize(){!this._el||typeof ResizeObserver!=`function`||this._resizeObserver||(this._resizeObserver=new ResizeObserver(()=>{this._deleted||!this._isVirtualEnabled()||this._itemsData.length===0||this._renderItems()}),this._resizeObserver.observe(this._el))}_disconnectSizeObserver(){this._resizeObserver&&=(this._resizeObserver.disconnect(),null)}_checkLoad(){return this._loading||this._blocked||!this._el||(this._el.scrollHeight||0)-(this._el.scrollTop||0)-(this._el.clientHeight||0)<=this._threshold&&this.load(),this}_scheduleCheck(){return this._checkScheduled||this._deleted||typeof queueMicrotask!=`function`?this:(this._checkScheduled=!0,queueMicrotask(()=>{this._checkScheduled=!1,this._checkLoad()}),this)}_syncFooter(){return this._loading?(a(this._statusBox,S(this._loadingContent)),this._footer.style(`display`,`flex`),this):this._blocked?(a(this._statusBox,S(this._endContent)),this._footer.style(`display`,`flex`),this):(a(this._statusBox,[]),this._footer.style(`display`,`none`),this)}_setupScroll(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{block:t,blocked:n,children:r,content:i,endText:a,itemHeight:o,items:s,loadMore:c,loading:l,loadingText:u,loop:d,onLoadMore:f,overscan:p,page:m,renderItem:h,reset:g,threshold:_,virtual:v,...y}=e;Object.keys(y).length>0&&this.setup(y),h!==void 0&&this.renderItem(h),v!==void 0&&this.virtual(v),o!==void 0&&this.itemHeight(o),p!==void 0&&this.overscan(p),i===void 0?r!==void 0&&this.content(r):this.content(i),s!==void 0&&this.items(s),c===void 0?f!==void 0&&this.loadMore(f):this.loadMore(c),d!==void 0&&this.loop(d),t===void 0?n!==void 0&&this.block(n):this.block(t),l!==void 0&&this.loading(l),_!==void 0&&this.threshold(_),m!==void 0&&this.page(m),u!==void 0&&this.loadingText(u),a!==void 0&&this.endText(a),g!==void 0&&g&&this.reset();return}this.content(e)}}};function Ha(e=null,t=null,n=null){return T(Va,e,t,n)}function Ua(e=null,t=null,n=null){let r=R(e,t,n),o={ariaLabel:`多列浏览器`,columns:[],visibleColumns:3,itemHeight:30,overscan:6,minSize:180,levels:[],loadingText:`加载中…`,emptyText:`暂无数据`},s=null,c=null,l=[],u=null,d={ariaLabel(e){return e===void 0?o.ariaLabel:(o.ariaLabel=i(e)||`多列浏览器`,s?.attr(`aria-label`,o.ariaLabel),d)},columns(e){return e===void 0?o.columns.slice():(o.columns=Array.isArray(e)?e:[e],p(),b(),M(0),d)},visibleColumns(e){if(e===void 0)return o.visibleColumns;let t=Number(e);return o.visibleColumns=Number.isFinite(t)&&t>0?Math.floor(t):3,d},itemHeight(e){if(e===void 0)return o.itemHeight;let t=Number(e);return o.itemHeight=Number.isFinite(t)&&t>0?Math.max(1,t):30,d},overscan(e){if(e===void 0)return o.overscan;let t=Number(e);return o.overscan=Number.isFinite(t)&&t>=0?Math.floor(t):6,d},minSize(e){if(e===void 0)return o.minSize;let t=Number(e);return o.minSize=Number.isFinite(t)&&t>0?t:180,d},selectedKeys(){return o.levels.map(e=>e.selected)},selectedItems(){return o.levels.map(e=>e.selectedItem).filter(Boolean)},current(){return o.levels.length-1},back(){return o.levels.length>1&&(o.levels.pop(),b(),f(`back`)),d},reload(){return p(),b(),M(0),d},refresh(){return o.levels.forEach(e=>{e.error=null,e.hasMore=!1,e.items=[],e.loaded=!1,e.loading=!1,e.page=0}),b(),d},render(){return s||(s=new y(`div`).className(E,`yoya-vtreeranger`).attr({role:`group`,"aria-label":o.ariaLabel}).styles({boxSizing:`border-box`,display:`flex`,flexDirection:`column`,height:`100%`,minWidth:`0`}),s.on(`keydown`,e=>L(e)),s.attr(`tabindex`,`0`),_()),b(),s},change(e){return e===void 0?u:(u=typeof e==`function`?e:null,d)},onChange(e){return d.change(e)}};function f(e,t=null){typeof u==`function`&&u({current:d.current(),detail:t,selections:d.selectedItems(),type:e})}function p(){o.levels=[],o.columns.forEach((e,t)=>{o.levels.push(m(e,t))})}function m(e,t){return{config:e??h(t),hasMore:!1,items:[],loaded:!1,page:0,selected:null,selectedItem:null,focus:null,loading:!1,error:null}}function h(e){return o.columns[e]??o.columns[o.columns.length-1]}function g(){return Math.max(0,o.levels.length-o.visibleColumns)}function _(){l.length=0;for(let e=0;e<o.visibleColumns;e+=1)l.push(ee(e));c=T(),s.clearChildren(),s.child(c),s.child(v(0))}function v(e){return e+1>=l.length?l[e].columnRoot:H({direction:`horizontal`,style:e===0?{flex:`1 1 auto`,minHeight:`0`,width:`100%`}:{height:`100%`,minHeight:`0`,width:`100%`},size:e===0?`25%`:`33%`,minSize:o.minSize,first:l[e].columnRoot,second:v(e+1)})}function ee(e){let t=new y(`div`).className(`yoya-vtreeranger-column-status`).styles({boxSizing:`border-box`,color:D(`color-text-muted`,`#8b949e`),flex:`0 0 auto`,fontSize:`12px`,lineHeight:`1.4`,padding:`6px 10px`}),n=new y(`div`).className(`yoya-vtreeranger-viewport`).styles({boxSizing:`border-box`,minHeight:`100%`,position:`relative`}),r=new y(`div`).className(`yoya-vtreeranger-list`).styles({boxSizing:`border-box`,flex:`1 1 auto`,minHeight:`0`,overflowY:`auto`,overscrollBehavior:`contain`,position:`relative`,scrollbarWidth:`none`});r.child(n),r.on(`scroll`,()=>{let t=l[e];S(t),F(t)});let i=new y(`div`).className(`yoya-vtreeranger-column`).attr(`data-column`,String(e)).styles({boxSizing:`border-box`,display:`flex`,flexDirection:`column`,height:`100%`,minHeight:`0`,minWidth:`0`,width:`100%`});return i.child(r,t),{boundLevel:null,columnRoot:i,list:r,slot:e,status:t,viewport:n}}function b(){if(!s)return;let e=g();l.forEach((t,n)=>{let r=e+n;t.boundLevel=r<o.levels.length?r:null,x(t),S(t)}),O();for(let t=e;t<o.levels.length;t+=1){let e=o.levels[t];!e.loaded&&!e.loading&&M(t)}}function x(e){let t=e.boundLevel===null?null:o.levels[e.boundLevel];if(!t){a(e.status,[o.emptyText]),e.status.style(`display`,null);return}t.loading?(a(e.status,[o.loadingText]),e.status.style(`display`,null)):t.error?(a(e.status,[t.error?.message??`加载失败`]),e.status.style(`display`,null)):t.items.length===0?(a(e.status,[o.emptyText]),e.status.style(`display`,null)):(a(e.status,[]),e.status.style(`display`,`none`))}function S(e){let t=e.boundLevel===null?null:o.levels[e.boundLevel];if(!t){a(e.viewport,[]),e.viewport.style(`height`,`100%`);return}let n=t.items.length;if(n===0){a(e.viewport,[]),e.viewport.style(`height`,`100%`);return}let r=o.itemHeight+4,i=e.list._el&&Number(e.list._el.scrollTop)||0,s=e.list._el&&Number(e.list._el.clientHeight)||0,c=Math.max(0,Math.floor((i-6)/r)-o.overscan),l=Math.min(n,Math.max(0,Math.ceil((i+s-6)/r)+o.overscan)),u=[];for(let t=c;t<l;t+=1)u.push(te(e,t));a(e.viewport,u),e.viewport.style(`height`,`${C(n)}px`)}function te(e,t){let n=o.levels[e.boundLevel],r=n.items[t],i=w(e.boundLevel,r),a=n.selected===i,s=n.focus===i,c=new y(`div`).className(`yoya-vtreeranger-row`).attr({"aria-selected":a?`true`:`false`,"data-key":String(i),"data-index":String(t),role:`option`,tabindex:s?`0`:`-1`}).styles({alignItems:`center`,background:a?D(`color-primary-subtle`,`#eff6ff`):`transparent`,borderLeft:a?`2px solid ${D(`color-primary`,`#2563eb`)}`:`2px solid transparent`,borderBottom:`1px solid ${D(`color-border-faint`,`#eef1f4`)}`,boxSizing:`border-box`,cursor:`pointer`,display:`flex`,fontSize:`13px`,height:`${o.itemHeight}px`,lineHeight:`1.2`,overflow:`hidden`,padding:`0 10px`,position:`absolute`,top:`${6+t*(o.itemHeight+4)}px`,whiteSpace:`nowrap`,width:`100%`});c.on(`mouseenter`,()=>{a||c.style(`background`,D(`color-surface-hover`,`#f0f2f5`))}),c.on(`mouseleave`,()=>{c.style(`background`,a?D(`color-primary-subtle`,`#eff6ff`):`transparent`)}),c.on(`click`,t=>{t.stopPropagation(),I(e.boundLevel,r)}),c.on(`keydown`,t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),I(e.boundLevel,r))});let l=h(e.boundLevel),u=l&&typeof l.icon==`function`?l.icon(r,t):null;if(u!=null){let e=new y(`span`).className(`yoya-vtreeranger-icon`).styles({flex:`0 0 auto`,fontSize:`12px`,marginRight:`6px`,opacity:`0.75`});e.child(u),c.child(e)}let d=l&&typeof l.renderItem==`function`?l.renderItem(r,t):String(r);return c.child(d),c}function C(e){return e===0?0:12+e*o.itemHeight+(e-1)*4}function w(e,t){let n=h(e);return n&&typeof n.itemKey==`function`?n.itemKey(t):t?.id??t?.key??t}function ne(e){let t=h(e)?.title;return typeof t==`function`?t(e,d.selectedItems().slice(0,e)):t??`列 ${e+1}`}function T(){return new y(`div`).className(`yoya-vtreeranger-crumbs`).attr({"aria-label":`当前路径`}).styles({alignItems:`center`,background:D(`color-surface-hover`,`#f6f8fa`),borderBottom:`1px solid ${D(`color-border`,`#d0d7de`)}`,boxSizing:`border-box`,display:`flex`,flex:`0 0 auto`,fontSize:`12px`,gap:`6px`,lineHeight:`1.4`,minHeight:`32px`,overflow:`hidden`,padding:`6px 10px`,whiteSpace:`nowrap`})}function O(){if(!c)return;a(c,[]);let e=[{levelIndex:0,text:ne(0),canJump:o.levels.length>1}];for(let t=1;t<o.levels.length;t+=1){let n=o.levels[t-1].selectedItem;n!=null&&e.push({canJump:t<o.levels.length-1,levelIndex:t-1,text:j(t-1,n)})}e.forEach((t,n)=>{if(n>0){let e=new y(`span`).className(`yoya-vtreeranger-crumb-separator`).styles({color:D(`color-text-muted`,`#8b949e`),flex:`0 0 auto`,opacity:`0.7`});e.text(`/`),c.child(e)}c.child(k(t,n===e.length-1))})}function k(e,t){let n={role:e.canJump?`button`:`text`};e.canJump&&(n.tabindex=`0`);let r=new y(`span`).className(`yoya-vtreeranger-crumb`).attr(n).styles({color:t?D(`color-text`,`#1f2328`):D(`color-text-secondary`,`#57606a`),cursor:e.canJump?`pointer`:`default`,flex:`0 0 auto`,fontWeight:t?`600`:`400`,maxWidth:`240px`,overflow:`hidden`,textOverflow:`ellipsis`});return r.text(e.text),e.canJump&&(r.on(`click`,()=>A(e.levelIndex)),r.on(`keydown`,t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),A(e.levelIndex))})),r}function A(e){let t=Math.max(0,Math.min(e,o.levels.length-1));t>=o.levels.length-1||(o.levels=o.levels.slice(0,t+1),b(),f(`crumb`))}function j(e,t){let n=h(e);return n&&typeof n.itemText==`function`?n.itemText(t):typeof t==`string`||typeof t==`number`?String(t):t?.name??t?.label??t?.id??String(t)}async function M(e,t=`initial`){let n=o.levels[e],r=h(e);if(!n||n.loading||typeof r?.load!=`function`||t===`more`&&!n.hasMore)return;n.loading=!0,b();let i=t===`more`?n.page+1:1,a=r.pageSize??200,s={column:e,offset:(i-1)*a,page:i,pageSize:a,selection:d.selectedItems().slice(0,e),selections:d.selectedItems().slice(0,e)};try{let{items:o,hasMore:c}=re(await r.load(s),a);n.items=t===`more`?P(e,n.items,o):o,n.hasMore=c,n.page=i,n.loaded=!0}catch(e){n.error=e,n.loaded=!0}finally{n.loading=!1,b()}}function re(e,t){if(Array.isArray(e))return{hasMore:!1,items:e};let n=Array.isArray(e?.items)?e.items:[];return{hasMore:typeof e?.hasMore==`boolean`?e.hasMore:n.length>=(e?.pageSize??t),items:n}}function P(e,t,n){let r=new Set(t.map(t=>String(w(e,t))));return[...t,...n.filter(t=>!r.has(String(w(e,t))))]}function F(e){let t=e.boundLevel,n=t===null?null:o.levels[t];if(!n||n.loading||!n.hasMore||!e.list._el)return;let r=e.list._el;r.scrollHeight-r.scrollTop-(r.clientHeight||0)<=200&&M(t,`more`)}function I(e,t){let n=o.levels[e];if(!n)return;n.selected=w(e,t),n.selectedItem=t,n.focus=n.selected,o.levels=o.levels.slice(0,e+1);let r=e+1;(r<o.columns.length||o.columns.length>0)&&o.levels.push(m(null,r)),b(),r<o.levels.length&&M(r),f(`select`,t)}function L(e){let t=o.levels.length-1,n=o.levels[t];if(n){if(e.key===`ArrowRight`){if(e.preventDefault(),n.selected!==null){let e=n.items.find(e=>w(t,e)===n.selected);e&&I(t,e)}return}if(e.key===`ArrowLeft`||e.key===`Backspace`){e.preventDefault(),d.back();return}(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault(),z(t,e.key===`ArrowUp`?-1:1))}}function z(e,t){let n=o.levels[e];if(!n||n.items.length===0)return;let r=n.items.findIndex(t=>w(e,t)===(n.focus??n.selected)),i=Math.min(n.items.length-1,Math.max(0,(r<0?-t:r)+t));n.focus=w(e,n.items[i]),b()}return ie(r.first),r.options&&Object.assign(o,r.options),typeof r.callback==`function`&&r.callback(d),d;function ie(e){if(e!=null){if(typeof e==`function`){e(d);return}if(N(e)){let{ariaLabel:t,change:n,columns:r,emptyText:i,itemHeight:a,loadingText:s,minSize:c,onChange:l,overscan:u,visibleColumns:f}=e;t!==void 0&&d.ariaLabel(t),a!==void 0&&d.itemHeight(a),u!==void 0&&d.overscan(u),c!==void 0&&d.minSize(c),f!==void 0&&d.visibleColumns(f),s!==void 0&&(o.loadingText=s),i!==void 0&&(o.emptyText=i),n!==void 0&&d.change(n),l!==void 0&&d.change(l),r!==void 0&&d.columns(r);return}d.columns(e)}}}const Wa=Ua;function Ga(e=null){return e}var Ka=class extends y{constructor(e=null){super(`div`,null),this._src=null,this._alt=``,this._defer=!1,this._state=`loading`,this._observer=null,this._img=new y(`img`).attr({loading:`lazy`}),this._placeholder=new y(`span`).className(`yoya-vlazyimage-placeholder`),this._retryButton=new y(`button`).className(`yoya-vlazyimage-retry`).attr({type:`button`}).text(`加载失败,点击重试`).on(`click`,()=>this.retry()),this.className(E,`yoya-vlazyimage`),this.attr({"data-state":`loading`,role:`img`}),this.styles({boxSizing:`border-box`,display:`inline-block`,maxWidth:`100%`,minWidth:`48px`,minHeight:`48px`,overflow:`hidden`,position:`relative`}),this.child(this._placeholder,this._img,this._retryButton),this._setupLazyImage(e),this._syncState()}src(e){return e===void 0?this._src:(this._src=e==null?null:String(e),this._src&&!this._defer?this._img.attr(`src`,this._src):this._img.attr(`src`,null),this)}alt(e){return e===void 0?this._alt:(this._alt=String(e??``),this._img.attr(`alt`,this._alt||null),this.attr(`aria-label`,this._alt||null),this)}defer(e){return e===void 0?this._defer:(this._defer=!!e,this._defer?this._img.attr(`src`,null):this._src&&this._img.attr(`src`,this._src),this)}state(){return this._state}retry(){return this._src?(this._setState(`loading`),this._img.attr(`src`,this._src),this):this}renderDom(){let e=super.renderDom();return this._img.on(`load`,()=>this._setState(`loaded`)),this._img.on(`error`,()=>this._setState(`error`)),this._observe(),e}destroy(){return this._observer&&=(this._observer.disconnect(),null),super.destroy()}_observe(){if(!(!this._defer||!this._src)){if(typeof IntersectionObserver>`u`){this._img.attr(`src`,this._src);return}this._observer=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&(this._img.attr(`src`,this._src),this._observer&&=(this._observer.disconnect(),null))})}),this._el&&this._observer.observe(this._el)}}_setState(e){this._state=e,this._syncState()}_syncState(){let e=this._state===`loaded`;this.attr(`data-state`,this._state),this._img.style(`opacity`,e?`1`:`0`),this._placeholder.style(`display`,this._state===`loading`?null:`none`),this._retryButton.style(`display`,this._state===`error`?`inline-flex`:`none`)}_setupLazyImage(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{alt:t,defer:n,src:r,...i}=e;Object.keys(i).length>0&&this.setup(i),t!==void 0&&this.alt(t),n!==void 0&&this.defer(n),r!==void 0&&this.src(r)}}}};function qa(e=null,t=null,n=null){return T(Ka,e,t,n)}var Ja=class extends y{constructor(e=null){super(`div`,null),this._src=null,this._thumb=null,this._alt=``,this._zoom=1,this._panX=0,this._panY=0,this._open=!1,this._overlay=null,this._stage=null,this._escHandler=null,this._drag=null,this._onPanMove=null,this._onPanEnd=null,this._thumbImg=new y(`img`).attr({loading:`lazy`}),this.className(E,`yoya-vimagepreview`),this.attr({"data-open":null}),this.styles({boxSizing:`border-box`,cursor:`zoom-in`,display:`inline-block`,lineHeight:`0`}),this.child(this._thumbImg),this.on(`click`,()=>this.open()),this._setupImagePreview(e),this._syncThumb()}src(e){return e===void 0?this._src:(this._src=e==null?null:String(e),this._syncThumb(),this._open&&this._lazy&&this._lazy.src(this._src),this)}thumb(e){return e===void 0?this._thumb:(this._thumb=e==null?null:String(e),this._syncThumb(),this)}alt(e){return e===void 0?this._alt:(this._alt=String(e??``),this._syncThumb(),this._open&&this._lazy&&this._lazy.alt(this._alt),this)}zoom(e){if(e===void 0)return this._zoom;let t=Number(e);return this._zoom=Number.isFinite(t)?Math.min(5,Math.max(1,t)):1,this._zoom===1&&(this._panX=0,this._panY=0),this._syncStage(),this}resetZoom(){return this._zoom=1,this._panX=0,this._panY=0,this._syncStage(),this}state(){return this._open?`open`:`closed`}open(){return this._open||!this._src||!this._el?this:(this._open=!0,this.attr(`data-open`,`true`),this._buildOverlay(),this._escHandler=e=>{e.key===`Escape`&&this.close()},this._escUnbind=x(`keydown`,this._escHandler),this)}close(){return this._open?(this._open=!1,this.attr(`data-open`,null),this._endPan(),this._escHandler&&(this._escUnbind?.(),this._escHandler=null,this._escUnbind=null),this._overlay&&=(this._overlay.destroy(),null),this._stage=null,this._lazy=null,this):this}toggle(){return this._open?this.close():this.open()}destroy(){return this.close(),super.destroy()}_syncThumb(){this._thumbImg.attr(`src`,this._thumb||this._src),this._thumbImg.attr(`alt`,this._alt||null)}_buildOverlay(){let e=new Ka().src(this._src).alt(this._alt);this._lazy=e;let t=new y(`div`).className(`yoya-vimagepreview-stage`).styles({display:`flex`,maxHeight:`86vh`,maxWidth:`90vw`,position:`relative`}).on(`mousedown`,e=>this._startPan(e));t.child(e),this._stage=t;let n=new y(`button`).className(`yoya-vimagepreview-close`).attr({"aria-label":`关闭预览`,type:`button`}).text(`×`).on(`click`,()=>this.close()),r=new y(`button`).className(`yoya-vimagepreview-tool`).attr({"aria-label":`缩小`,type:`button`}).text(`−`).on(`click`,()=>this.zoom(this._zoom-.5)),i=new y(`button`).className(`yoya-vimagepreview-tool`).attr({"aria-label":`重置缩放`,type:`button`}).text(`1:1`).on(`click`,()=>this.resetZoom()),a=new y(`button`).className(`yoya-vimagepreview-tool`).attr({"aria-label":`放大`,type:`button`}).text(`+`).on(`click`,()=>this.zoom(this._zoom+.5)),o=new y(`div`).className(`yoya-vimagepreview-toolbar`).child(r,i,a),s=new y(`div`).className(`yoya-vimagepreview-backdrop`).on(`click`,()=>this.close()),c=new y(`div`).className(E,`yoya-vimagepreview-overlay`).styles({alignItems:`center`,display:`flex`,inset:`0`,justifyContent:`center`,position:`fixed`,zIndex:`1000`}).child(s,t,n,o);this._overlay=c,c.bindTo(document.body),this._syncStage()}_syncStage(){this._stage&&this._stage.style(`transform`,`scale(${this._zoom}) translate(${this._panX}px, ${this._panY}px)`)}_startPan(e){this._zoom<=1||(this._drag={panX:this._panX,panY:this._panY,startX:e.clientX,startY:e.clientY},this._onPanMove=e=>this._panMove(e),this._onPanEnd=()=>this._endPan(),this._panMoveUnbind=x(`mousemove`,this._onPanMove),this._panEndUnbind=x(`mouseup`,this._onPanEnd))}_panMove(e){this._drag&&(this._panX=this._drag.panX+(e.clientX-this._drag.startX),this._panY=this._drag.panY+(e.clientY-this._drag.startY),this._syncStage())}_endPan(){this._drag=null,this._onPanMove&&(this._panMoveUnbind?.(),this._onPanMove=null,this._panMoveUnbind=null),this._onPanEnd&&(this._panEndUnbind?.(),this._onPanEnd=null,this._panEndUnbind=null)}_setupImagePreview(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{alt:t,src:n,thumb:r,...i}=e;Object.keys(i).length>0&&this.setup(i),t!==void 0&&this.alt(t),r!==void 0&&this.thumb(r),n!==void 0&&this.src(n)}}}};function Ya(e=null,t=null,n=null){return T(Ja,e,t,n)}var Xa=class extends vi{constructor(e=null){super(e),this.className(`yoya-vcode-block`)}};function Za(e=null,t=null,n=null){return T(Xa,e,t,n)}d(I,{codeBlock:Za});var Qa=class extends y{constructor(e=null){super(`div`),this._adapter=null,this._instance=null,this._initialized=!1,this._data=void 0,this._options={},this._width=void 0,this._height=void 0,this._destroyed=!1,this.className(`yoya-vchart`),this.styles({display:`block`,width:`100%`}),this._setupChart(e)}adapter(e){return e===void 0?this._adapter:this._destroyed?this:(this._initialized&&this._destroyAdapter(),this._adapter=e||null,this._el&&this._adapter&&this._initializeAdapter(),this)}data(e){return e===void 0?this._data:(this._data=e,this._updateAdapter(),this)}options(e){return e===void 0?this._options:(this._options=e||{},this._updateAdapter(),this)}width(e){return e===void 0?this._width:(this._width=e,this.style(`width`,e===null?`100%`:eo(e)),this._resizeAdapter(),this)}height(e){return e===void 0?this._height:(this._height=e,this.style(`height`,e===null?null:eo(e)),this._resizeAdapter(),this)}resize(e=this._width,t=this._height){return this._width=e,this._height=t,e!==void 0&&this.style(`width`,eo(e)),t!==void 0&&this.style(`height`,eo(t)),this._resizeAdapter(),this}renderDom(){let e=super.renderDom();return e&&!this._destroyed&&this._initializeAdapter(),e}destroy(){return this._destroyed?this:(this._destroyed=!0,this._destroyAdapter(),super.destroy())}_setupChart(e){if(!e||typeof e!=`object`)return;let{adapter:t,data:n,height:r,options:i,width:a,...o}=e;Object.keys(o).length>0&&this.setup(o),this._data=n,this._options=i||{},this._width=a,this._height=r,a!==void 0&&this.width(a),r!==void 0&&this.height(r),t&&(this._adapter=t)}_context(){return{chart:this,data:this._data,height:this._height,host:this._el,options:this._options,width:this._width}}_initializeAdapter(){if(!(!this._adapter||this._initialized||!this._el||this._destroyed)){if(typeof this._adapter.init==`function`)this._instance=this._adapter.init(this._el,this._context());else if(typeof this._adapter==`function`)this._instance=this._adapter(this._el,this._context());else throw TypeError(`Chart adapter must provide an init(host, context) function`);this._initialized=!0}}_updateAdapter(){this._instance===null||!this._adapter||typeof this._adapter.update!=`function`||this._adapter.update(this._instance,this._context())}_resizeAdapter(){this._instance===null||!this._adapter||typeof this._adapter.resize!=`function`||this._adapter.resize(this._instance,this._context())}_destroyAdapter(){this._initialized&&=(this._adapter&&typeof this._adapter.destroy==`function`&&this._adapter.destroy(this._instance,this._context()),this._instance=null,!1)}};function $a(e=null,t=null,n=null){return T(Qa,e,t,n)}function eo(e){return typeof e==`number`?`${e}px`:e}d(y,{vAvatar:ai,vDigitalBoard:di,vDigitalBoardItem:fi,vGauge:Ea,vRingStat:ka,vSparkline:Ma,vTimeline:La,vTimelineItem:Ra,vTrendCard:Ba,vBadge:hi,vCarousel:_i,vCard:Fi,vCardBody:Li,vCardFooter:Ri,vCardHeader:Ii,vCode:yi,vDetail:Si,vDetailItem:Ci,vImagePreview:Ya,vPagination:Di,vProgress:Ai,vScroll:Ha,vTable:Bi,vTree:ca,vTreeRanger:Ua,vTreeTable:Ca});const to=new Set([`paragraph`,`avatar`,`block`]);var no=class extends y{constructor(e=null){super(`div`,null),this._variant=`paragraph`,this._rows=3,this._barHeight=20,this._gap=10,this._avatarSize=40,this._active=!0,this._motion=`auto`,this.className(E,`yoya-vskeleton`),this.attr({"aria-hidden":`true`,"data-active":`true`,"data-motion":`auto`,"data-variant":`paragraph`}),this.styles({boxSizing:`border-box`,display:`flex`,flexDirection:`column`,gap:`10px`,maxWidth:`100%`,width:`100%`}),this._setupSkeleton(e),this._syncContent()}variant(e){return e===void 0?this._variant:(this._variant=to.has(e)?e:`paragraph`,this.attr(`data-variant`,this._variant),this._syncContent(),this)}rows(e){if(e===void 0)return this._rows;let t=Math.floor(Number(e));return this._rows=Number.isFinite(t)&&t>=0?t:3,this._syncContent(),this}barHeight(e){if(e===void 0)return this._barHeight;let t=Number(e);return this._barHeight=Number.isFinite(t)&&t>0?t:20,this._syncContent(),this}gap(e){if(e===void 0)return this._gap;let t=Number(e);return this._gap=Number.isFinite(t)&&t>=0?t:10,this.style(`gap`,`${this._gap}px`),this}avatarSize(e){if(e===void 0)return this._avatarSize;let t=Number(e);return this._avatarSize=Number.isFinite(t)&&t>0?t:40,this._syncContent(),this}active(e){return e===void 0?this._active:(this._active=!!e,this.attr(`data-active`,this._active?`true`:`false`),this.attr(`aria-hidden`,this._active?`true`:null),this._syncContent(),this)}motion(e){return e===void 0?this._motion:(this._motion=e===`always`?`always`:`auto`,this.attr(`data-motion`,this._motion),this)}_syncContent(){if(!this._active){this.children().forEach(e=>{typeof e.className==`function`&&e.className().includes(`yoya-vskeleton-`)&&e.destroy()});return}a(this,this._buildPlaceholders())}_buildPlaceholders(){return this._variant===`avatar`?[new y(`span`).className(`yoya-vskeleton-avatar`).style(`height`,`${this._avatarSize}px`).style(`width`,`${this._avatarSize}px`)]:this._variant===`block`?[new y(`span`).className(`yoya-vskeleton-block`)]:Array.from({length:this._rows},(e,t)=>{let n=t===this._rows-1;return new y(`span`).className(`yoya-vskeleton-bar`).style(`height`,`${this._barHeight}px`).style(`width`,n?`60%`:`100%`)})}_setupSkeleton(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{active:t,avatarSize:n,barHeight:r,gap:i,motion:a,rows:o,variant:s,...c}=e;Object.keys(c).length>0&&this.setup(c),s!==void 0&&this.variant(s),o!==void 0&&this.rows(o),r!==void 0&&this.barHeight(r),i!==void 0&&this.gap(i),n!==void 0&&this.avatarSize(n),a!==void 0&&this.motion(a),t!==void 0&&this.active(t)}}}};function ro(e=null,t=null,n=null){return T(no,e,t,n)}const io=new Map,ao={error:e=>`加载失败:${e.message}`,loaded:()=>``,loading:()=>`加载中…`,pending:()=>`等待加载`};function oo(e={},t=null,n=null){let r=R(e,t,n),i=so(r.first),a=new I(`div`);A(a,r.first);let o=`pending`,s=null,c=null,l=0;a.className(`yoya-vdynamic-loader`),a.attr({"aria-live":`polite`,"data-loader-state":o}),a.status=()=>o,a.state=()=>o,a.module=()=>s,a.value=()=>s,a.loadError=()=>c,a.error=()=>c,a.load=()=>{if(a._deleted)return Promise.resolve(s);let e=++l;return d(`loading`),Promise.resolve().then(()=>uo(i.cacheKey,i.loader)).then(t=>e!==l||a._deleted?t:(s=t,c=null,d(`loaded`,t),t),t=>{throw e!==l||a._deleted?t:(c=t,d(`error`,t),t)})},a.retry=()=>a.load(),a.preload=()=>a._deleted?Promise.resolve(s):uo(i.cacheKey,i.loader),a.clearCache=()=>(lo(i.cacheKey),a);let u=a.destroy.bind(a);a.destroy=()=>(l+=1,u());function d(e,t){o=e,a.attr(`data-loader-state`,o),fo(a,i.views,o,t),i.onStateChange?.(o,t,a)}return fo(a,i.views,o),i.auto&&queueMicrotask(()=>{a._deleted||a.load().catch(()=>{})}),w(a,r.options,r.callback)}function so(e){let t=typeof e==`function`?{loader:e}:{...e};if(typeof t.loader!=`function`)throw TypeError(`vDynamicLoader requires a loader function`);return{auto:t.auto!==!1,cacheKey:t.cacheKey??null,loader:t.loader,onStateChange:t.onStateChange,views:{...ao,...t.views||{}}}}function co(e,t){if(e==null||e===``)throw TypeError(`preloadDynamicModule requires a cache key`);if(typeof t!=`function`)throw TypeError(`preloadDynamicModule requires a loader function`);return uo(e,t)}function lo(e){e===void 0?io.clear():io.delete(e)}function uo(e,t){if(e==null||e===``)return Promise.resolve().then(t);if(io.has(e))return io.get(e);let n=Promise.resolve().then(t);return io.set(e,n),n.catch(()=>{io.get(e)===n&&io.delete(e)}),n}function fo(e,t,n,r){e.children().forEach(e=>e.destroy()),e._children=[],e._el&&e._el.replaceChildren();let i=t[n],a=typeof i==`function`?i(r,e):i;e.child(a??m(``))}d(I,{vDynamicLoader:oo}),d(y,{vLazyImage:qa,vSkeleton:ro});const po=Object.freeze([{label:`中文`,value:`zh-CN`},{label:`English`,value:`en`}]);function mo(e=null){let t={ariaLabel:`切换语言`,locale:re,languages:po,onChange:null,size:`medium`,variant:`secondary`},n=null,r=zt({closeOnSelect:!0,placement:`bottom-start`}).className(E,`yoya-vlanguage-switch`),a={activeLanguage(){return t.locale?.getLanguage?.()},ariaLabel(e){return e===void 0?t.ariaLabel:(t.ariaLabel=i(e)||t.ariaLabel,u(),a)},change(e){return a.onChange(e)},destroy(){return n&&=(n(),null),r.destroy()},languages(e){return e===void 0?t.languages.map(e=>({...e})):(t.languages=go(e),u(),a)},locale(e){return e===void 0?t.locale:(l(e),u(),a)},onChange(e){return e===void 0?t.onChange:(t.onChange=typeof e==`function`?e:null,a)},render(){return u(),r},size(e){return e===void 0?t.size:(t.size=_o(e),u(),a)},variant(e){return e===void 0?t.variant:(t.variant=vo(e),u(),a)}},o=r.destroy.bind(r);return r.destroy=()=>(n&&=(n(),null),o()),l(t.locale),typeof e==`function`?e(a):s(e),u(),a;function s(e){if(!N(e))return;let{ariaLabel:n,attrs:a,className:o,languages:s,locale:c,onChange:u,size:d,style:f,variant:p,...m}=e;Object.keys(m).length>0&&r.setup(m),a&&A(r,{attrs:a}),f&&A(r,{style:f}),o!==void 0&&r.className(o),n!==void 0&&(t.ariaLabel=i(n)||t.ariaLabel),c!==void 0&&l(c),s!==void 0&&(t.languages=go(s)),u!==void 0&&(t.onChange=typeof u==`function`?u:null),d!==void 0&&(t.size=_o(d)),p!==void 0&&(t.variant=vo(p))}function c(e){e.disabled||!t.locale||e.value===t.locale.getLanguage()||(t.locale.setLanguage(e.value),r.close(),u(),typeof t.onChange==`function`&&t.onChange(e,t.locale))}function l(e){!e||typeof e.setLanguage!=`function`||e===t.locale||(n&&n(),t.locale=e,n=e.subscribe(()=>u()))}function u(){let e=t.locale?.getLanguage?.()||``,n=t.languages.find(t=>t.value===e)||{label:e,value:e};return r.attr(`aria-label`,t.ariaLabel||`切换语言`),r.attr(`data-language`,e),r.attr(`data-size`,t.size),r.attr(`data-variant`,t.variant),r.trigger(r=>{r.label(n.label),r.size(t.size),r.variant(t.variant),r.attr(`aria-label`,t.ariaLabel||`切换语言`),r.attr(`data-language`,e)}),r.menuContent(n=>{t.languages.forEach(t=>{let r=jt(n=>{n.label(t.label),n.active(t.value===e),n.attr({"data-language":t.value,"data-language-option":`true`}),t.disabled&&n.disabled(!0)});t.disabled||r.on(`click`,()=>c(t)),n.child(r)})}),a}}function ho(e=null,t=null,n=null){let r=R(e,t,n);return r.first&&typeof r.first.render==`function`&&typeof r.first.locale==`function`?w(r.first,r.options,r.callback):w(mo(r.first),r.options,r.callback)}d(y,{vLanguageSwitch:ho});function go(e){return(Array.isArray(e)&&e.length>0?e:po).map((e,t)=>{if(Array.isArray(e)){let[n,r]=e,a=i(n);return{disabled:!1,label:r??a,value:a||`language-${t}`}}if(e instanceof o)return{disabled:!1,label:e,value:e.textContent()||`language-${t}`};if(N(e)){let n=e.value??e.key??e.id??e.label??e.text??e.title??`language-${t}`,r=i(n);return{disabled:!!e.disabled,label:e.label??e.text??e.content??e.title??r,value:r||`language-${t}`}}let n=i(e);return{disabled:!1,label:n,value:n}}).filter(e=>e.value!==``)}function _o(e){return[`small`,`medium`,`large`].includes(e)?e:`medium`}function vo(e){return[`primary`,`secondary`].includes(e)?e:`secondary`}const yo=[{mode:`light`,label:`浅色`,icon:B},{mode:`dark`,label:`深色`,icon:ne},{mode:`system`,label:`跟随系统`,icon:C}],bo={light:`浅色`,dark:`深色`,system:`跟随系统`},xo={light:B,dark:ne,system:C};function So(e){return e.map(e=>typeof e==`string`?{mode:e,label:bo[e]||e,icon:xo[e]}:e)}var Co=class extends y{constructor(e=null){super(`div`,null),this.className(`yoya-component`,`yoya-vtheme-mode-switch`),this._persist=!0,this._modes=yo,this._buttons=new Map,this.styles({alignItems:`center`,display:`inline-flex`,flexWrap:`wrap`,gap:`8px`}),typeof e==`function`?e(this):e&&typeof e==`object`&&(Array.isArray(e.modes)&&(this._modes=So(e.modes)),e.persist!==void 0&&(this._persist=!!e.persist)),this._rebuildButtons()}modes(e){if(e===void 0)return this._modes.map(e=>e.mode);if(!Array.isArray(e))throw TypeError(`VThemeModeSwitch modes must be an array of mode names`);return this._modes=So(e),this._rebuildButtons(),this}persist(e){return e===void 0?this._persist:(this._persist=!!e,this)}_rebuildButtons(){this.clearChildren(),this._buttons.clear(),this._modes.forEach(({mode:e,label:t,icon:r})=>{let i=r||xo[e]||null,a=i?i():null;a&&a.styles({height:`16px`,width:`16px`});let o=gt(a||t).attr(`data-theme-mode`,e).attr(`aria-label`,t).attr(`title`,t).styles({borderRadius:`50%`,flex:`0 0 auto`,height:`32px`,padding:`0`,width:`32px`});o.on(`click`,()=>{n(e,{persist:this._persist}),this.sync()}),this._buttons.set(e,o),this.child(o)}),this.sync()}sync(){let e=c();return this._buttons.forEach((t,n)=>{let r=n===e;t.styles(r?{background:D(`color-primary-subtle`,`#eff6ff`),borderColor:D(`color-primary-border`,`#bfdbfe`),color:D(`color-text-active`,`#1d4ed8`)}:{background:`transparent`,borderColor:`transparent`,color:D(`color-text-secondary`,`#6f6f6f`)}),t.attr(`data-active`,r?`true`:null)}),this}};function wo(e=null,t=null,n=null){let r=R(e,t,n),i=new Co(r.first);return r.options?.modes!==void 0&&i.modes(r.options.modes),r.options?.persist!==void 0&&i.persist(r.options.persist),w(i,r.options,r.callback)}d(I,{vThemeModeSwitch:wo});const To={direction:`ltr`,motion:`auto`,play:`auto`,ripple:`on`,speed:`normal`,strength:`strong`},Eo={direction:new Set([`ltr`,`rtl`]),motion:new Set([`auto`,`always`]),play:new Set([`auto`,`hover`,`off`]),ripple:new Set([`on`,`off`]),speed:new Set([`slow`,`normal`,`fast`]),strength:new Set([`soft`,`strong`])};var Do=class extends J{constructor(e=null,t=null,n=null){super(e,t,n),this.className(E,`yoya-vglow-button`),Object.entries(To).forEach(([e,t])=>{this.attr(`data-glow-${e}`)===void 0&&this.attr(`data-glow-${e}`,t)}),this._bindRipple()}glow(e){if(e===void 0)return{direction:this.direction(),motion:this.motion(),play:this.play(),ripple:this.ripple(),speed:this.speed(),strength:this.strength()};if(e&&typeof e==`object`){let{direction:t,motion:n,play:r,ripple:i,speed:a,strength:o}=e;n!==void 0&&this.motion(n),r!==void 0&&this.play(r),i!==void 0&&this.ripple(i),a!==void 0&&this.speed(a),t!==void 0&&this.direction(t),o!==void 0&&this.strength(o)}return this}play(e){return e===void 0?this.attr(`data-glow-play`):this.attr(`data-glow-play`,Eo.play.has(e)?e:`auto`)}speed(e){return e===void 0?this.attr(`data-glow-speed`):this.attr(`data-glow-speed`,Eo.speed.has(e)?e:`normal`)}direction(e){return e===void 0?this.attr(`data-glow-direction`):this.attr(`data-glow-direction`,Eo.direction.has(e)?e:`ltr`)}strength(e){return e===void 0?this.attr(`data-glow-strength`):this.attr(`data-glow-strength`,Eo.strength.has(e)?e:`strong`)}motion(e){return e===void 0?this.attr(`data-glow-motion`):this.attr(`data-glow-motion`,Eo.motion.has(e)?e:`auto`)}ripple(e){return e===void 0?this.attr(`data-glow-ripple`):this.attr(`data-glow-ripple`,Eo.ripple.has(e)?e:`on`)}_bindRipple(){this.on(`click`,e=>{if(this.attr(`data-glow-ripple`)===`off`||this.getBooleanState(`disabled`))return;let t=this._el?.getBoundingClientRect?.(),n=Math.max(t?.width||120,t?.height||40),r=e.clientX||0,i=e.clientY||0,a=r===0&&i===0,o=`${n/2}px`,s=a?`calc(50% - ${o})`:`${r-(t?.left||0)-n/2}px`,c=a?`calc(50% - ${o})`:`${i-(t?.top||0)-n/2}px`,l=new y(`span`).className(`yoya-vglow-button-ripple`).attr(`aria-hidden`,`true`).style({height:`${n}px`,left:s,top:c,width:`${n}px`});l.on(`animationend`,()=>{let e=this._children.indexOf(l);e>=0&&this._children.splice(e,1),l.destroy()}),this.child(l)})}};function Oo(e=null,t=null,n=null){return new Do(e,t,n)}var ko=class extends y{constructor(e=null){super(`div`,null),this._shown=!0,this._motion=`auto`,this._duration=240,this._waapiAnim=null,this.className(E,`yoya-vtransition`),this.attr({"data-motion":`auto`,"data-state":`enter`}),this.styles({boxSizing:`border-box`}),this._setupTransition(e),this._syncTransition()}show(e){return e===void 0?this._shown:(this._shown=!!e,this._syncTransition(),this)}enter(){return this.show(!0)}leave(){return this.show(!1)}toggle(){return this.show(!this._shown)}motion(e){return e===void 0?this._motion:(this._motion=e===`always`?`always`:`auto`,this.attr(`data-motion`,this._motion),this._syncTransition(),this)}duration(e){if(e===void 0)return this._duration;let t=Number(e);return this._duration=Number.isFinite(t)&&t>=0?t:240,this.attr(`data-duration`,String(this._duration)),this.style(`--yoya-vtransition-duration`,`${this._duration}ms`),this}renderDom(){let e=super.renderDom();return e.addEventListener(`animationend`,()=>{!this._shown&&this._motion!==`always`&&this.style(`display`,`none`)}),this._motion===`always`&&this._runWaapi(this._shown?`enter`:`leave`),e}destroy(){return this._waapiAnim&&=(this._waapiAnim.cancel(),null),super.destroy()}_syncTransition(){let e=this._motion===`auto`&&typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,t=this._shown?`enter`:`leave`,n=this._motion===`always`||e?null:this._shown?`yoya-vtransition--enter`:`yoya-vtransition--leave`;this.attr(`data-state`,t),this.className(E,`yoya-vtransition`,n),this._shown?this.style(`display`,null):this._motion!==`always`&&e&&this.style(`display`,`none`),this._motion===`always`&&this._runWaapi(t)}_runWaapi(e){let t=this._el;if(!t||typeof t.animate!=`function`)return;this._waapiAnim&&this._waapiAnim.cancel();let n=e===`enter`,r=t.animate(n?[{opacity:0,transform:`translateY(12px) scale(0.98)`},{opacity:1,transform:`none`}]:[{opacity:1,transform:`none`},{opacity:0,transform:`translateY(-12px) scale(0.98)`}],{duration:this._duration,easing:`ease`,fill:`both`});this._waapiAnim=r,r.onfinish=()=>{this._shown||this.style(`display`,`none`)}}_setupTransition(e){if(e!=null){if(typeof e==`function`){e(this);return}if(N(e)){let{duration:t,motion:n,shown:r,...i}=e;Object.keys(i).length>0&&this.setup(i),t!==void 0&&this.duration(t),n!==void 0&&this.motion(n),r!==void 0&&this.show(r)}}}};function Ao(e=null,t=null,n=null){return T(ko,e,t,n)}d(y,{vGlowButton:Oo,vTransition:Ao});export{Xa as CodeBlock,mo as LanguageSwitch,Kt as VAnchor,qt as VAnchorItem,qn as VAutocomplete,ii as VAvatar,Jr as VAvatarUpload,mi as VBadge,$t as VBreadcrumb,en as VBreadcrumbItem,J as VButton,vt as VButtons,ji as VCard,Ni as VCardBody,Pi as VCardFooter,Mi as VCardHeader,gi as VCarousel,Bn as VCascader,Qa as VChart,X as VCheckbox,ar as VCheckboxes,vi as VCode,Zr as VColorPicker,It as VContextMenu,bi as VDetail,xi as VDetailItem,wn as VDialog,li as VDigitalBoard,ui as VDigitalBoardItem,Rt as VDropdownMenu,dr as VField,Ht as VFloatButton,pr as VForm,fr as VFormItem,Ta as VGauge,Do as VGlowButton,Ja as VImagePreview,Qn as VInput,Ka as VLazyImage,se as VMasonry,bt as VMenu,St as VMenuDivider,Ct as VMenuGroup,xt as VMenuItem,yn as VMessage,bn as VMessageContainer,Nn as VMessageManager,an as VNavbar,Ei as VPagination,ki as VProgress,Z as VRadio,ur as VRadios,Y as VRate,Oa as VRingStat,Va as VScroll,nr as VSelect,Et as VSidebar,no as VSkeleton,Ln as VSlider,ja as VSparkline,V as VSplitPanel,cn as VStep,sn as VSteps,wt as VSubMenu,ni as VSvgIconPicker,ir as VSwitch,Wt as VSymbolButton,pn as VTab,zi as VTable,mn as VTabs,Gn as VTagsInput,Ui as VTbody,Zi as VTd,tr as VTextarea,Gi as VTfoot,Yi as VTh,Vi as VThead,Co as VThemeModeSwitch,ce as VThemeShell,Fa as VTimeline,Ia as VTimelineItem,$n as VTimer,er as VTimerRange,An as VTooltip,qi as VTr,ko as VTransition,sa as VTree,oa as VTreeNode,Sa as VTreeTable,za as VTrendCard,Wr as VUpload,he as center,lo as clearDynamicModuleCache,Za as codeBlock,Ce as container,xe as createVBodyPage,Me as divider,de as flex,ve as grid,me as hstack,Te as mobileLayout,co as preloadDynamicModule,ye as responsiveGrid,je as spacer,fe as stack,Cn as toast,Wa as treeRanger,Jt as vAnchor,Yt as vAnchorItem,Oe as vAside,Jn as vAutocomplete,ai as vAvatar,Yr as vAvatarUpload,hi as vBadge,be as vBody,tn as vBreadcrumb,nn as vBreadcrumbItem,gt as vButton,yt as vButtons,Fi as vCard,Li as vCardBody,Ri as vCardFooter,Ii as vCardHeader,_i as vCarousel,Vn as vCascader,$a as vChart,yr as vCheckbox,xr as vCheckboxes,yi as vCode,_e as vCol,Qr as vColorPicker,Fn as vConfirm,we as vContainer,Lt as vContextMenu,Si as vDetail,Ci as vDetailItem,Tn as vDialog,di as vDigitalBoard,fi as vDigitalBoardItem,zt as vDropdownMenu,oo as vDynamicLoader,wr as vField,Ut as vFloatButton,Ae as vFooter,Er as vForm,Tr as vFormItem,Ea as vGauge,Oo as vGlowButton,De as vHeader,Ya as vImagePreview,mr as vInput,ho as vLanguageSwitch,qa as vLazyImage,ke as vMain,U as vMasonry,At as vMenu,Mt as vMenuDivider,Nt as vMenuGroup,jt as vMenuItem,xn as vMessage,Sn as vMessageContainer,Pn as vMessageManager,Ee as vMobileLayout,on as vNavbar,Di as vPagination,Ai as vProgress,Sr as vRadio,Cr as vRadios,In as vRate,ka as vRingStat,ge as vRow,Ha as vScroll,vr as vSelect,Ft as vSidebar,ro as vSkeleton,Rn as vSlider,Ma as vSparkline,H as vSplitPanel,un as vStep,ln as vSteps,Pt as vSubMenu,ri as vSvgIconPicker,br as vSwitch,Gt as vSymbolButton,gn as vTab,Bi as vTable,hn as vTabs,Kn as vTagsInput,Wi as vTbody,Qi as vTd,_r as vTextarea,Ki as vTfoot,Xi as vTh,Hi as vThead,wo as vThemeModeSwitch,W as vThemeShell,La as vTimeline,Ra as vTimelineItem,hr as vTimer,gr as vTimerRange,jn as vTooltip,Ji as vTr,Ao as vTransition,ca as vTree,la as vTreeNode,Ua as vTreeRanger,Ga as vTreeRangerColumn,Ca as vTreeTable,Ba as vTrendCard,Gr as vUpload,pe as vstack};
|