sober
Version:
Sober is a library of UI components designed with reference to Material You.
1 lines • 144 kB
JavaScript
"use strict";(()=>{var pt=Object.defineProperty;var ht=(s,t)=>{for(var e in t)pt(s,e,{get:t[e],enumerable:!0})};var ot={};ht(ot,{Alert:()=>te,Appbar:()=>oe,Avatar:()=>re,Badge:()=>se,BottomSheet:()=>V,Button:()=>ie,Card:()=>ae,Carousel:()=>Y,CarouselItem:()=>R,Checkbox:()=>le,Chip:()=>ce,CircularProgress:()=>de,Date:()=>he,DatePicker:()=>ue,Dialog:()=>_,Divider:()=>ge,Drawer:()=>fe,Empty:()=>xe,FAB:()=>ve,Field:()=>Ce,Fold:()=>qe,Icon:()=>ye,IconButton:()=>be,LinearProgress:()=>we,Menu:()=>ke,MenuItem:()=>Ee,Navigation:()=>B,NavigationItem:()=>X,Page:()=>Se,Pagination:()=>$e,Picker:()=>N,PickerItem:()=>G,Popup:()=>ze,PopupMenu:()=>Te,PopupMenuItem:()=>Le,RadioButton:()=>Fe,Rate:()=>Me,Ripple:()=>z,ScrollView:()=>me,Search:()=>Ae,SegmentedButton:()=>H,SegmentedButtonItem:()=>Q,Skeleton:()=>Pe,Slider:()=>De,Snackbar:()=>J,Switch:()=>Ne,Tab:()=>I,TabItem:()=>K,Table:()=>He,Tbody:()=>Ie,Td:()=>Ye,TextField:()=>Re,Th:()=>Ve,Thead:()=>je,Tooltip:()=>_e,Tr:()=>We});var P={CSSStyleSheet:!0,CSSContainer:CSS.supports("container-type","size")};try{new CSSStyleSheet}catch{P.CSSStyleSheet=!1}var ut=(s,t)=>{for(let e of t){if(!P.CSSStyleSheet){let a=document.createElement("style");a.textContent=e,s.insertBefore(a,s.firstChild);continue}let r=new CSSStyleSheet;r.replaceSync(e),s.adoptedStyleSheets=[...s.adoptedStyleSheets,r]}},g=s=>{let t={},e={};for(let r in s){let a=s[r],i={key:r,sync:!0,types:[]};r.startsWith("$")&&(i.key=r.slice(1),i.sync=!1),Array.isArray(a)&&(i.types=a,a=i.types[0]),t[i.key]=a,e[i.key]={sync:i.sync,def:a,to:l=>{switch(typeof a){case"string":let n=String(l);return i.types.length>0?i.types.includes(n)?n:i.types[0]:n;case"number":let d=Number(l);return isNaN(d)?a:d;case"boolean":return typeof l=="boolean"?l:l==="true"}}}}return Object.defineProperty(t,"$meta",{value:e}),t},L=s=>s,mt=":host{user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;outline:none}*{outline:none}",h=s=>{let t={observedAttributes:[],upperPropKeys:{},metaProps:s.props?.$meta??{},events:[]};for(let a in t.metaProps??{}){let i=a.toLowerCase();t.observedAttributes.push(i),t.upperPropKeys[i]=a}for(let a in s.events){let i=`on${a}`;t.observedAttributes.push(i),!(i in HTMLElement.prototype)&&t.events.push(i)}let e=new Map;class r extends HTMLElement{static observedAttributes=t.observedAttributes;static define(i){customElements.define(i,this)}constructor(){super();let i=this.attachShadow({mode:"open"});i.innerHTML=s.template??"",ut(i,[mt,...s.style?Array.isArray(s.style)?s.style:[s.style]:[]]);let l={...s.props},n,d={};for(let o in l){let f=this[o];f!==void 0&&(d[o]=f),Object.defineProperty(this,o,{configurable:!0,get:()=>{let x=n?.[o];return!x||typeof x=="function"||!x.get?l[o]:x.get?.(l[o])},set:x=>{let m=t.metaProps[o],p=x===void 0?m.def:m.to(x);if(m.sync){let v=o.toLowerCase(),b=this.getAttribute(v),w=String(p);if(p===m.def&&b!==null)return this.removeAttribute(v);if(p!==m.def&&b!==w)return this.setAttribute(v,w)}if(p===this[o])return;let u=l[o];l[o]=p;let y=n?.[o];if(y)try{typeof y=="function"?y(p,u):y.set?.(p,u)}catch(v){throw l[o]=u,v}}})}let c={};for(let o of t.events){let f=o;typeof this[f]=="function"&&(c[o]=this[f]),Object.defineProperty(this,o,{configurable:!0,get:()=>c[o]??null,set:x=>c[o]=typeof x=="function"?x:void 0}),this.addEventListener(o.slice(2),x=>c[o]&&c[o].bind(this)(x))}n=s.setup?.call(this,i);for(let o in n?.expose??{})Object.defineProperty(this,o,{get:()=>n?.expose?.[o]});for(let o in d)this[o]=d[o];this.connectedCallback=this.disconnectedCallback=this.adoptedCallback=this.attributeChangedCallback=void 0,e.set(this,n)}connectedCallback(){e.get(this)?.onMounted?.()}disconnectedCallback(){e.get(this)?.onUnmounted?.()}adoptedCallback(){e.get(this)?.onAdopted?.()}attributeChangedCallback(i,l,n){if(t.events.includes(i))return this[i]=n?new Function("event",n):null;this[t.upperPropKeys[i]]=n??void 0}}for(let a in s.methods)r[a]=s.methods[a];return r};var gt="s-alert",ft=g({type:["info","success","warning","error"]}),xt=":host{display:inline-flex;padding:8px 16px;align-items:center;line-height:22px;font-size:.875rem;font-weight:500;min-height:48px;box-sizing:border-box;border-radius:4px;color:var(--s-color-on-secondary-container, #354A53);background:var(--s-color-secondary-container, #CFE6F1)}:host([type=success]){color:var(--s-color-on-success-container, #002111);background:var(--s-color-success-container, #92f7bc)}:host([type=warning]){color:var(--s-color-on-warning-container, #221b00);background:var(--s-color-warning-container, #ffe169)}:host([type=error]){color:var(--s-color-on-error-container, #93000A);background:var(--s-color-error-container, #FFDAD6)}svg{width:24px;height:24px;fill:currentColor;margin-right:8px;margin-left:-2px;box-sizing:border-box;flex-shrink:0;display:none}.text{flex-grow:1;min-width:0}:host(:not([type])) .info,:host([type=success]) .success,:host([type=warning]) .warning,:host([type=error]) .error{display:block}::slotted(*){flex-shrink:0}::slotted(:is(svg[slot=start],s-icon[slot=start])){margin-right:8px;margin-left:-2px}::slotted(:is(svg[slot=end],s-icon[slot=end])){margin-right:-2px;margin-left:8px}::slotted(:is(svg,s-icon)){fill:currentColor;color:currentColor;width:24px;height:24px}::slotted(:is(s-button[slot=end],s-icon-button[slot=end])){margin-left:8px;margin-right:-8px;color:currentColor}::slotted(s-button[slot=end]){height:32px;padding:0 12px;border-radius:4px;font-size:.8125rem}::slotted(s-icon-button[slot=end]){width:32px;padding:5px}",vt='<slot name="start"><svg viewBox="0 0 24 24" class="info"><path d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"></path></svg> <svg viewBox="0 0 24 24" class="success"><path d="M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"></path></svg> <svg viewBox="0 0 24 24" class="warning"><path d="M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"></path></svg> <svg viewBox="0 0 24 24" class="error"><path d="M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg></slot><div class="text" part="text"><slot></slot></div><slot name="end"></slot>',te=class extends h({style:xt,template:vt,props:ft}){};te.define(gt);var bt="s-appbar",yt=":host{display:flex;align-items:center;position:relative;padding:0 8px;box-sizing:border-box;container-name:s-appbar;container-type:inline-size;background:var(--s-color-surface-container, #ECEEF0)}::slotted([slot=navigation]){margin-left:4px;flex-shrink:0}::slotted([slot=logo]){margin-left:12px;height:32px;color:var(--s-color-primary, #006782);fill:currentColor;flex-shrink:0}::slotted([slot=headline]){font-size:1.5rem;font-weight:700;overflow:hidden;text-transform:capitalize;text-overflow:ellipsis;white-space:nowrap;margin-left:12px;color:var(--s-color-primary, #006782)}.view{flex-grow:1;min-width:0;height:100%;display:flex;align-items:center;height:64px;max-height:100%;justify-content:flex-end}.view.s-laptop{height:56px}.view.s-tablet ::slotted(s-search[slot=search]){width:auto;flex-grow:1}::slotted([slot=action]){margin:0 4px;flex-shrink:0}::slotted(s-search[slot=search]){flex-shrink:0;margin:0 4px 0 8px}@container s-appbar (max-width: 1024px){.view{height:56px}}@container s-appbar (max-width: 768px){::slotted(s-search[slot=search]){width:auto;flex-grow:1}}",wt='<slot name="start"></slot><slot name="navigation"></slot><slot name="logo"></slot><slot name="headline"></slot><div class="view" part="view"><slot></slot><slot name="search"></slot></div><slot name="action"></slot><slot name="end"></slot>',oe=class extends h({style:yt,template:wt,setup(t){let e=t.querySelector(".view");P.CSSContainer||new ResizeObserver(()=>{e.classList.toggle("s-laptop",this.offsetWidth<=1024),e.classList.toggle("s-tablet",this.offsetWidth<=768)}).observe(this)}}){};oe.define(bt);var kt="s-avatar",Et=g({$src:""}),Ct=":host{display:inline-flex;vertical-align:middle;justify-content:center;align-items:center;aspect-ratio:1;-webkit-aspect-ratio:1;position:relative;font-size:1rem;font-weight:600;width:40px;border-radius:50%;color:var(--s-color-on-tertiary, #ffffff);background:var(--s-color-tertiary, #5C5B7E)}::slotted(:is(svg,s-icon)){color:currentColor;fill:currentColor;width:24px}::slotted([slot=badge]){position:absolute;right:0;bottom:0;box-shadow:0 0 0 2px var(--s-color-surface, #F8F9FB);color:var(--s-color-on-success, #ffffff);background:var(--s-color-success, #006d43)}img{width:100%;height:100%;border-radius:inherit;position:absolute;inset:0}",qt='<slot></slot><slot name="badge"></slot>',re=class extends h({style:Ct,template:qt,props:Et,setup(t){let e=document.createElement("img");return{src:r=>{e.src=r,e.onload=()=>{this.dispatchEvent(new Event("load")),t.insertBefore(e,t.children[0])},e.onerror=()=>{this.dispatchEvent(new ErrorEvent("error")),e.isConnected&&t.removeChild(e)}}}}}){};re.define(kt);var St="s-badge",$t=":host{display:inline-flex;justify-content:center;align-items:center;width:8px;height:8px;border-radius:8px;font-size:.625rem;vertical-align:middle;box-sizing:border-box;background:var(--s-color-error, #BA1A1A);color:var(--s-color-on-error, #ffffff)}:host(:not(:empty)) .text{height:16px;padding:0 5px;display:flex;position:relative;justify-content:center;align-items:center;background:inherit;color:inherit;box-shadow:inherit;border-radius:8px}",zt='<slot class="text" part="text"></slot>',se=class extends h({style:$t,template:zt}){};se.define(St);var k=s=>{let t=s.trim().match(/^([\d\.]+)(s|ms)$/);if(!t)throw new Error;let e=Number(t[1]);return t[2]==="s"?e*1e3:e};var Tt="s-bottom-sheet",Lt=g({showed:!1,disabledGesture:!1}),Ft=L({show:CustomEvent,showed:Event,close:CustomEvent,closed:Event}),Mt=':host{display:inline-block;vertical-align:middle}dialog{top:0;left:0;width:100%;height:100%;background:none;border:none;padding:0;max-width:none;max-height:none;outline:none;justify-content:center;align-items:flex-end;color:inherit;overflow:hidden}dialog::backdrop{background:none}dialog[open]{display:flex}.scrim{position:absolute;inset:0;width:100%;height:100%;opacity:0;backdrop-filter:saturate(180%) blur(2px)}.scrim:before{content:"";display:block;width:100%;height:100%;opacity:.75;background:var(--s-color-scrim, #000000)}dialog.show .scrim{opacity:1}.container{outline:none;position:relative;border-radius:24px 24px 0 0;width:100%;max-height:calc(100% - 56px);display:flex;flex-direction:column;padding-bottom:env(safe-area-inset-bottom);max-width:425px;box-shadow:var(--s-elevation-level1, 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12));background:var(--s-color-surface-container-low, #F2F4F5)}.indicator{width:100%;display:flex;justify-content:center;align-items:center;height:18px;cursor:pointer;flex-shrink:0}.indicator:before{content:"";width:40px;height:4px;border-radius:2px;background:var(--s-color-outline, #70787D);opacity:.4}::slotted([slot=text]){padding:24px;line-height:22px}::slotted(:not([slot])){overscroll-behavior:none}@media (max-width: 768px){.container{max-width:768px}}',At='<slot name="trigger"></slot><dialog part="popup"><div class="scrim" part="scrim"></div><div class="container" part="container"><div class="indicator" part="indicator"></div><slot name="text"></slot><slot id="view"></slot></div></dialog>',Pt=s=>{let t=document.body,e=document.body.firstElementChild;e&&e.tagName==="S-PAGE"&&(t=e);let r=new V,a=document.createElement("div");return a.slot="text",typeof s=="function"||s instanceof HTMLElement?s instanceof HTMLElement?r.appendChild(s):s(r):typeof s=="string"?(a.textContent=s,r.appendChild(a)):(s.root&&(t=s.root),s.disabledGesture&&(r.disabledGesture=s.disabledGesture),typeof s.view=="string"&&(a.textContent=s.view,r.appendChild(a)),s.view instanceof HTMLElement&&r.appendChild(s.view),typeof s.view=="function"&&s.view(r)),r.addEventListener("closed",()=>t.removeChild(r)),r.showed=!0,t.appendChild(r),r},V=class extends h({style:Mt,template:At,props:Lt,events:Ft,methods:{builder:Pt},setup(t){let e=t.querySelector("dialog"),r=t.querySelector(".container"),a=t.querySelector(".scrim"),i=t.querySelector(".indicator"),l=getComputedStyle(this),n=null,d=()=>{let m=l.getPropertyValue("--s-motion-easing-standard")||"cubic-bezier(0.2, 0, 0, 1.0)",p=l.getPropertyValue("--s-motion-duration-medium4")||"400ms";return{easing:m,duration:k(p)}};t.querySelector("#view").onslotchange=m=>{n=m.target.assignedElements()[0]??null},t.querySelector("slot[name=trigger]").onclick=()=>{this.showed||!this.dispatchEvent(new CustomEvent("show",{cancelable:!0,detail:{source:"TRIGGER"}}))||(this.showed=!0)};let c=m=>{!this.showed||!this.dispatchEvent(new CustomEvent("close",{cancelable:!0,detail:{source:m}}))||(this.showed=!1)};a.onclick=()=>c("SCRIM");let o=null;r.addEventListener("touchmove",m=>{let p=m.target;if(this.disabledGesture)return;let u=m.touches[0];if(!o)return o={y:u.pageY,x:u.pageX,disabled:!1,top:0,h:r.offsetHeight,now:Date.now()};if(o.disabled)return;let y=u.pageY-o.y,v=u.pageX-o.x;if(o.top=Math.min(o.h,Math.max(0,y)),p!==i&&n&&n.scrollTop>0||Math.abs(y)<Math.abs(v))return o.disabled=!0;r.style.transform=`translateY(${o.top}px)`},{passive:!1}),r.ontouchend=()=>{if(!o||o.disabled)return o=null;let m=Date.now()-o.now>300?o.h/3:20;if(o.top>m){if(!this.dispatchEvent(new CustomEvent("close",{cancelable:!0,detail:{source:"GESTURE"}})))return;this.showed=!1}else r.animate({transform:[r.style.transform,"translateY(0)"]},d()),r.style.removeProperty("transform");o=null};let f=()=>{if(!this.isConnected||e.open)return;e.showModal(),e.classList.add("show");let m=d();a.animate({opacity:[0,1]},m),r.animate({transform:["translateY(100%)","translateY(0)"],opacity:[0,1]},m).finished.then(()=>this.dispatchEvent(new Event("showed")))},x=()=>{if(!this.isConnected||!e.open)return;e.classList.remove("show");let m=d(),p=r.style.transform;a.animate({opacity:[1,0]},m),r.animate({transform:[p===""?"translateY(0)":p,"translateY(100%)"],opacity:[1,0]},m).finished.then(()=>{e.close(),p&&r.style.removeProperty("transform"),this.dispatchEvent(new Event("closed"))})};return e.onclose=()=>this.showed=!1,{onMounted:()=>this.showed&&!e.open&&f(),showed:m=>m?f():x()}}}){};V.define(Tt);var E={mobileS:matchMedia("(max-width: 320px)"),mobileM:matchMedia("(max-width: 375px)"),mobileL:matchMedia("(max-width: 425px)"),tablet:matchMedia("(max-width: 768px)"),laptop:matchMedia("(max-width: 1024px)"),laptopL:matchMedia("(max-width: 1440px)"),pointerCoarse:matchMedia("(pointer: coarse)"),pointerFine:matchMedia("(pointer: fine)")};var Dt="s-ripple",Zt=g({centered:!1,attached:!1}),Bt=':host{display:inline-block;vertical-align:middle;position:relative;cursor:pointer}:host([attached=true]),.container,.container:before,.ripple{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;border-radius:inherit}.container{overflow:hidden}.container:before{content:"";opacity:0;background:var(--ripple-color, currentColor);transition:opacity var(--s-motion-duration-short4, .1s) var(--s-motion-easing-standard, cubic-bezier(.2, 0, 0, 1))}.container.hover:before{opacity:var(--ripple-hover-opacity, .12)}.ripple{opacity:0;border-radius:50%;background:currentColor;filter:blur(12px) opacity(var(--ripple-opacity, .18))}',Nt='<slot></slot><div class="container" part="container"><div class="ripple"></div></div>',z=class extends h({style:Bt,template:Nt,props:Zt,setup(t){let e=t.querySelector(".container"),r=t.querySelector(".ripple"),a=getComputedStyle(this),i=()=>{let m=a.getPropertyValue("--s-motion-easing-standard")||"cubic-bezier(0.2, 0, 0, 1.0)",p=a.getPropertyValue("--s-motion-duration-long4")||"600ms",u=a.getPropertyValue("--s-motion-duration-short4")||"200ms";return{easing:m,duration:k(p),shortDuration:k(u)}},l=()=>E.pointerFine.matches&&e.classList.add("hover"),n=()=>E.pointerFine.matches&&e.classList.remove("hover"),d={parentNode:null,pressed:!1},c=m=>{let{offsetWidth:p,offsetHeight:u}=this,y=Math.sqrt(p**2+u**2),v={x:"50%",y:"50%"};if(!this.centered){let{left:F,top:Oe}=this.getBoundingClientRect(),ee=m.clientX-F,rt=m.clientY-Oe,st=u/2,it=p/2,ct=(Math.abs(st-rt)+st)*2,dt=(Math.abs(it-ee)+it)*2;y=Math.sqrt(ct**2+dt**2),v.x=`${ee}px`,v.y=`${rt}px`}let b=r,w=()=>{};d.pressed?(b=r.cloneNode(),e.appendChild(b),w=()=>b.remove()):(d.pressed=!0,w=()=>d.pressed=!1);let q=d.parentNode??this,$=i();q.setAttribute("pressed","");let W=b.animate({opacity:[1,1],width:[`${y}px`,`${y}px`],height:[`${y}px`,`${y}px`],transform:["translate(-50%, -50%) scale(0)","translate(-50%, -50%) scale(1)"],left:[v.x,v.x],top:[v.y,v.y]},{...$,fill:"forwards"});return()=>{q.removeAttribute("pressed");let F=Number(W.currentTime),Oe=$.duration-$.shortDuration,ee=F>Oe?$.shortDuration:$.duration-F;b.animate({opacity:[1,0]},{duration:ee,easing:$.easing,fill:"forwards"}).finished.then(w)}},o=async m=>{if(m.button!==0)return;let p={};if(m.pointerType!=="touch"){document.addEventListener("pointerup",c(m),{once:!0});return}let u;p.timer=setTimeout(()=>{u=c(m),document.removeEventListener("touchmove",y),p.upper&&u()},50),document.addEventListener("touchend",()=>{if(!u)return p.upper=!0;u()},{once:!0});let y=()=>clearTimeout(p.timer);document.addEventListener("touchmove",y,{once:!0})},f=m=>{m.addEventListener("mouseenter",l),m.addEventListener("mouseleave",n),m.addEventListener("wheel",n,{passive:!0}),m.addEventListener("pointerdown",o)},x=()=>{d.parentNode&&(d.parentNode.removeEventListener("mouseenter",l),d.parentNode.removeEventListener("mouseleave",n),d.parentNode.removeEventListener("wheel",n),d.parentNode.removeEventListener("pointerdown",o),d.parentNode=null)};return f(this),{onMounted:()=>{this.attached&&this.parentNode&&(d.parentNode=this.parentNode instanceof ShadowRoot?this.parentNode.host:this.parentNode,f(d.parentNode))},onUnmounted:()=>this.attached&&x(),attached:m=>{if(!this.isConnected)return;if(!m)return x();let p=this.parentNode instanceof ShadowRoot?this.parentNode.host:this.parentNode;f(p)}}}}){};z.define(Dt);var Ht="s-button",jt=g({disabled:!1,type:["filled","elevated","filled-tonal","outlined","text"]}),It=":host{justify-content:center;align-items:center;box-sizing:border-box;display:inline-flex;vertical-align:middle;border-radius:20px;padding:0 24px;height:40px;text-transform:capitalize;position:relative;cursor:pointer;font-size:.875rem;font-weight:500;max-width:-moz-available;max-width:-webkit-fill-available;background:var(--s-color-primary, #006782);color:var(--s-color-on-primary, #ffffff);transition:box-shadow var(--s-motion-duration-short4, .2s) var(--s-motion-easing-standard, cubic-bezier(.2, 0, 0, 1));overflow:hidden}:host([disabled=true]){pointer-events:none!important;background:color-mix(in srgb,var(--s-color-on-surface, #191C1E) 12%,transparent)!important;color:color-mix(in srgb,var(--s-color-on-surface, #191C1E) 38%,transparent)!important}:host([type=elevated]){background:var(--s-color-surface-container-low, #F2F4F5);color:var(--s-color-primary, #006782);box-shadow:var(--s-elevation-level1, 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12))}:host([type=elevated][disabled=true]){box-shadow:none!important}:host([type=filled-tonal]){background:var(--s-color-secondary-container, #CFE6F1);color:var(--s-color-on-secondary-container, #354A53)}:host([type=outlined]){border:solid 1px var(--s-color-outline, #70787D);background:none;color:var(--s-color-primary, #006782)}:host([type=outlined][disabled=true]){background:none!important;border-color:color-mix(in srgb,var(--s-color-on-surface, #191C1E) 12%,transparent)!important}:host([type=text]){background:none;color:var(--s-color-primary, #006782);padding:0 16px}:host([type=text][disabled=true]){background:none!important}::slotted(*){flex-shrink:0}::slotted(:is(svg,s-icon,s-circular-progress)){fill:currentColor;color:currentColor;width:20px;height:20px}::slotted(:is(svg[slot=start],s-icon[slot=start])){margin-right:4px;margin-left:-8px}::slotted(:is(svg[slot=end],s-icon[slot=end])){margin-right:-8px;margin-left:4px}::slotted(s-circular-progress[slot=start]){margin-left:-8px;margin-right:8px}::slotted(s-circular-progress[slot=end]){margin-left:8px;margin-right:-8px}:host([type=text]) ::slotted(:is(s-icon[slot=start],svg[slot=start])){margin-left:-4px;margin-right:4px}:host([type=text]) ::slotted(:is(s-icon[slot=end],svg[slot=end])){margin-left:4px;margin-right:-4px}:host(:not([type])[pressed]){box-shadow:var(--s-elevation-level1, 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12))}:host([type=elevated][pressed]){box-shadow:var(--s-elevation-level2, 0 2px 4px -1px rgba(0, 0, 0, .2), 0 4px 5px 0 rgba(0, 0, 0, .14), 0 1px 10px 0 rgba(0, 0, 0, .12))}.text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}@media (pointer: fine){:host(:not([type]):hover){box-shadow:var(--s-elevation-level1, 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12))}:host([type=elevated]:hover){box-shadow:var(--s-elevation-level2, 0 2px 4px -1px rgba(0, 0, 0, .2), 0 4px 5px 0 rgba(0, 0, 0, .14), 0 1px 10px 0 rgba(0, 0, 0, .12))}}@supports not (color: color-mix(in srgb,black,white)){:host([disabled=true]){background:var(--s-color-surface-container-high, #E7E8EA)!important;color:var(--s-color-outline, #70787D)!important}:host([type=outlined][disabled=true]){border-color:var(--s-color-surface-container-highest, #E1E3E4)!important}}",Wt='<slot name="start"></slot><div class="text" part="text"><slot></slot></div><slot name="end"></slot><s-ripple class="ripple" attached="true" part="ripple"></s-ripple>',ie=class extends h({style:It,template:Wt,props:jt}){};ie.define(Ht);var Vt="s-card",Yt=g({type:["elevated","filled","outlined"],clickable:!1}),Rt=":host{display:inline-block;vertical-align:middle;border-radius:12px;position:relative;font-size:.875rem;box-sizing:border-box;max-width:280px;overflow:hidden;color:var(--s-color-on-surface, #191C1E);background:var(--s-color-surface-container-low, #F2F4F5);box-shadow:var(--s-elevation-level1, 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12))}:host([type=filled]){box-shadow:none;background:var(--s-color-surface-container-highest, #E1E3E4)}:host([type=outlined]){box-shadow:none;background:var(--s-color-surface, #F8F9FB);border:solid 1px var(--s-color-outline-variant, #C0C8CC)}:host([clickable=true]){cursor:pointer;transition:box-shadow var(--s-motion-duration-short4, .2s) var(--s-motion-easing-standard, cubic-bezier(.2, 0, 0, 1))}:host([clickable=true]) .ripple{display:block}.action{display:flex;justify-content:flex-end;gap:8px;padding:0 16px}.ripple{display:none;border-radius:0}::slotted([slot=image]){display:block;max-height:160px;min-height:96px;width:100%;object-fit:cover;background:var(--s-color-surface-container, #ECEEF0)}::slotted([slot=headline]){font-size:1.375rem;line-height:22px;margin:12px 16px}::slotted([slot=subhead]){font-size:1rem;margin:-8px 16px 12px}::slotted([slot=text]){line-height:22px;margin:12px 16px;color:var(--s-color-on-surface-variant, #40484C)}::slotted(s-button[slot=action]){margin-bottom:16px}::slotted([slot=headline]+[slot=subhead]){background:red}@media (pointer: fine){:host([clickable=true][type=filled]:hover),:host([clickable=true][type=outlined]:hover){box-shadow:var(--s-elevation-level1, 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12))}:host([clickable=true]:hover){box-shadow:var(--s-elevation-level2, 0 2px 4px -1px rgba(0, 0, 0, .2), 0 4px 5px 0 rgba(0, 0, 0, .14), 0 1px 10px 0 rgba(0, 0, 0, .12))}}",_t='<slot name="start"></slot><slot name="image"></slot><slot name="headline"></slot><slot name="subhead"></slot><slot name="text"></slot><slot></slot><div class="action" part="action"><slot name="action"></slot></div><slot name="end"></slot><s-ripple class="ripple" attached="true" part="ripple"></s-ripple>',ae=class extends h({style:Rt,template:_t,props:Yt,setup(t){let e=t.querySelector("slot[name=action]");e.onpointerdown=r=>r.stopPropagation()}}){};ae.define(Vt);var S=class{list=[];select;selectValue;flag=!1;constructor(t){let{context:e}=t;e.addEventListener(`${e.tagName.toLocaleLowerCase()}:select`,r=>{if(r.stopPropagation(),!(r.target instanceof t.class))return;let a;this.flag=!0,r.target.selected=!0,this.list.forEach(i=>{i!==r.target&&(i.selected&&(a=i),i.selected=!1)}),this.select=r.target,this.flag=!1,e.dispatchEvent(new Event("change")),this.onUpdate?.(a),this.onSelect?.()}),e.addEventListener(`${e.tagName.toLocaleLowerCase()}:update`,r=>{if(r.stopPropagation(),this.flag||this.list.length===0||!(r.target instanceof t.class))return;this.flag=!0;let a;r.target.selected?(this.select=r.target,this.list.forEach(i=>{i!==r.target&&(i.selected&&(a=i),i.selected=!1)})):delete this.select,this.flag=!1,this.onUpdate?.(a)}),t.slot.addEventListener("slotchange",()=>{this.flag=!0,delete this.select,this.list=t.slot.assignedElements().filter(r=>{if(r instanceof t.class){if(this.selectValue!==void 0)r.value===this.selectValue?(this.select=r,r.selected=!0):r.selected=!1;else{if(!this.select&&r.selected)return this.select=r,!0;this.select&&(r.selected=!1)}return!0}}),this.flag=!1,this.onSlotChange?.(),this.onUpdate?.()})}get value(){return this.list[this.list.indexOf(this.select)]?.value??""}set value(t){this.selectValue=t,this.list.length!==0&&(this.flag=!0,this.list.forEach(e=>{if(e.value===t){e.selected=!0,this.select=e;return}e.selected=!1}),this.onUpdate?.(),this.flag=!1)}get selectedIndex(){return this.list.indexOf(this.select)}};var ne="s-carousel",Ot=g({$value:"",$autoplay:!1,$duration:4e3}),Xt=":host{display:flex;align-items:center;position:relative;overflow:hidden;border-radius:8px;cursor:pointer;aspect-ratio:2;-webkit-aspect-ratio:2}.container{display:flex;justify-content:flex-start;height:100%;min-width:100%;transition:transform var(--s-motion-duration-long4, .6s) var(--s-motion-easing-standard, cubic-bezier(.2, 0, 0, 1))}.track{position:absolute;bottom:0;left:0;width:100%;display:flex;gap:8px;align-items:center;justify-content:center;pointer-events:none;padding:12px 0}.track .indicator{width:8px;height:8px;border-radius:4px;background:#fff;opacity:.3;flex-shrink:0;cursor:pointer;pointer-events:auto;box-shadow:var(--s-elevation-level1, 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12))}.track .indicator.checked{opacity:1}",Gt='<div class="container" part="container"><slot></slot></div><div class="track"></div>',Y=class extends h({style:Xt,template:Gt,props:Ot,setup(t){let e=t.querySelector(".container"),r=t.querySelector(".track"),a=t.querySelector("slot"),i=new S({context:this,class:R,slot:a}),l=-1;i.onUpdate=()=>{r.childNodes.forEach(c=>c.classList.remove("checked")),e.style.transform=`translateX(${-i.selectedIndex*100}%)`,i.selectedIndex!==-1&&(r.childNodes[i.selectedIndex].classList.add("checked"),n())};let n=()=>{!this.autoplay||i.list.length===0||!this.isConnected||(d(),l=setTimeout(()=>{let c=i.selectedIndex+1;c>=i.list.length&&(c=0),i.list[c].selected=!0,this.dispatchEvent(new Event("change"))},this.duration))},d=()=>clearInterval(l);return i.onSlotChange=()=>{r.innerHTML="";let c=document.createDocumentFragment();i.list.forEach(o=>{let f=document.createElement("div");f.className="indicator",f.addEventListener("click",()=>o.dispatchEvent(new Event(`${ne}:select`,{bubbles:!0}))),c.appendChild(f)}),r.appendChild(c)},e.onpointerdown=c=>{if(i.list.length<=1)return;d();let o=c.pageX,f=c.pageY,x=e.offsetWidth,m=i.list[i.selectedIndex-1],p=i.list[i.selectedIndex+1],u={now:0,left:0,next:void 0},y=w=>{let q=w instanceof TouchEvent?w.touches[0]:w,$=q.pageX-o,W=q.pageY-f;if(w instanceof TouchEvent&&Math.abs($)<Math.abs(W)&&!u.next)return v();if(u.left=$,u.now===0&&(u.now=Date.now()),m&&(u.left=Math.min(u.left,x)),p&&(u.left=Math.max(u.left,x*-1)),(!m&&u.left>0||!p&&u.left<0)&&(u.left=u.left*.2),u.left<0&&p||u.left>0&&m){let F=Math.abs(u.left)/x*.05;i.select.style.transition="none",i.select.style.transform=`scale(${.05-F+.95})`,u.next=u.left<0?p:m,u.next.style.transition="none",u.next.style.transform=`scale(${F+.95})`}e.style.transition="none",e.style.pointerEvents="none",e.style.transform=`translateX(calc(${-i.selectedIndex*100}% + ${u.left}px))`,w.cancelable&&w.preventDefault()},v=()=>{document.removeEventListener(b.up,v),document.removeEventListener(b.move,y),e.style.removeProperty("pointer-events"),e.style.removeProperty("transition"),i.select.style.removeProperty("transition"),i.select.style.removeProperty("transform"),u.next?.style.removeProperty("transition"),u.next?.style.removeProperty("transform");let w=i.selectedIndex;if(!(w===0&&u.left>0||w===i.list.length-1&&u.left<0)){let q=Date.now()-u.now>300?x/2:20;if(Math.abs(u.left)>q){u.next?.dispatchEvent(new Event(`${ne}:select`,{bubbles:!0}));return}}e.style.transform=`translateX(${-i.selectedIndex*100}%)`,n()},b={move:E.pointerCoarse.matches?"touchmove":"pointermove",up:E.pointerCoarse.matches?"touchend":"pointerup"};document.addEventListener(b.move,y,{passive:!1}),document.addEventListener(b.up,v)},{expose:{get options(){return i.list},get selectedIndex(){return i.selectedIndex},togglePrevious:()=>{let c=i.list[i.selectedIndex-1];c&&(c.selected=!0)},toggleNext:()=>{let c=i.list[i.selectedIndex+1];c&&(c.selected=!0)}},onMounted:n,onUnmounted:d,value:{get:()=>i.value,set:c=>{i.value=c,n()}},autoplay:n}}}){},Ut="s-carousel-item",Qt=g({selected:!1,$value:""}),Jt=":host{user-drag:none;-webkit-user-drag:none;flex-shrink:0;width:100%;height:100%;border-radius:8px;background:var(--s-color-surface-container-high, #E7E8EA);transform:scale(.95);transition:transform var(--s-motion-duration-long4, .6s) var(--s-motion-easing-standard, cubic-bezier(.2, 0, 0, 1));background-repeat:round}:host([selected=true]){transform:scale(1)}",Kt="<slot></slot>",R=class extends h({style:Jt,template:Kt,props:Qt,setup(){return{selected:()=>{this.parentNode instanceof Y&&this.dispatchEvent(new Event(`${ne}:update`,{bubbles:!0}))}}}}){};Y.define(ne),R.define(Ut);var eo="s-checkbox",to=g({disabled:!1,checked:!1,indeterminate:!1}),oo=":host{display:inline-flex;align-items:center;vertical-align:middle;cursor:pointer;position:relative;height:40px;color:var(--s-color-on-surface-variant, #40484C)}:host([checked=true]){color:var(--s-color-primary, #006782)}:host([disabled=true]){pointer-events:none}.container{position:relative;height:100%;aspect-ratio:1;-webkit-aspect-ratio:1;border-radius:50%;overflow:hidden;flex-shrink:0}:host([disabled=true]) .container{color:var(--s-color-on-surface, #191C1E)!important;opacity:.38!important}.unchecked,.checked,.indeterminate{display:flex;align-items:center;justify-content:center;position:absolute;inset:0;width:100%;height:100%}.checked,.indeterminate{position:absolute;transform:scale(.5);opacity:0;transition-property:transform,opacity;transition-timing-function:var(--s-motion-easing-emphasized, cubic-bezier(.2, 0, 0, 1));transition-duration:var(--s-motion-duration-short4, .2s)}:host([indeterminate=true]) .unchecked{opacity:0}:host([checked=true]:not([indeterminate=true])) .checked,:host([indeterminate=true]) .indeterminate{opacity:1;transform:scale(1)}.ripple{aspect-ratio:1;-webkit-aspect-ratio:1;height:100%;width:auto;border-radius:50%}svg,::slotted(:is([slot=checked],[slot=unchecked],[slot=indeterminate])){color:currentColor;fill:currentColor;width:60%;height:60%}",ro='<div class="container" part="container"><slot class="unchecked" name="unchecked"><svg viewBox="0 -960 960 960"><path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Z"></path></svg></slot><slot class="checked" name="checked"><svg viewBox="0 -960 960 960"><path d="m424-312 282-282-56-56-226 226-114-114-56 56 170 170ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"></path></svg></slot><slot class="indeterminate" name="indeterminate"><svg viewBox="0 -960 960 960"><path d="M280-440h400v-80H280v80Zm-80 320q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"></path></svg></slot></div><slot></slot><s-ripple class="ripple" attached="true" part="ripple"></s-ripple>',le=class extends h({style:oo,template:ro,props:to,setup(){this.addEventListener("click",()=>{this.indeterminate&&(this.indeterminate=!1),this.checked=!this.checked,this.dispatchEvent(new Event("change"))})}}){};le.define(eo);var so="s-chip",io=g({type:["filled","outlined"],$value:"",checked:!1,disabled:!1,clickable:!1}),ao=":host{display:inline-flex;align-items:center;vertical-align:middle;padding:0 16px;height:32px;border-radius:16px;box-sizing:border-box;font-size:.8125rem;font-weight:500;position:relative;cursor:pointer;overflow:hidden;background:var(--s-color-surface-container-high, #E7E8EA);color:var(--s-color-on-surface, #191C1E);transition-property:color,background-color,box-shadow;transition-timing-function:var(--s-motion-easing-standard, cubic-bezier(.2, 0, 0, 1));transition-duration:var(--s-motion-duration-short4, .2s)}:host([disabled=true]){pointer-events:none!important;border-color:color-mix(in srgb,var(--s-color-on-surface, #191C1E) 12%,transparent)!important;color:color-mix(in srgb,var(--s-color-on-surface, #191C1E) 38%,transparent)!important;background:color-mix(in srgb,var(--s-color-surface-container-high, #E7E8EA) 38%,transparent)!important}:host([checked=true]){border:none;background:var(--s-color-secondary-container, #CFE6F1);color:var(--s-color-primary, #006782)}:host([type=outlined]){background:none;border:solid 1px var(--s-color-outline-variant, #C0C8CC)}:host([type=outlined][checked=true]){border-color:var(--s-color-primary, #006782)}::slotted(:is(s-icon,svg)){width:18px;height:18px;flex-shrink:0;fill:currentColor;color:currentColor}::slotted(:is(s-icon[slot=start],svg[slot=start])){margin-left:-8px;margin-right:8px}::slotted(:is(s-icon[slot=end],svg[slot=end])){margin-left:8px;margin-right:-8px}::slotted(s-avatar){width:24px;height:24px;font-size:.75rem}::slotted(s-avatar[slot=start]){margin-left:-12px;margin-right:8px}::slotted(s-icon-button[slot=action]){margin:0 -12px 0 8px;width:24px;height:24px;padding:3px;color:currentColor}.text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}:host(:not([clickable=true])) .ripple{display:none}@supports not (color: color-mix()){:host([disabled=true]){background:var(--s-color-surface-container-high, #E7E8EA)!important;color:var(--s-color-outline, #70787D)!important;border-color:var(--s-color-surface-container-highest, #E1E3E4)!important}}",no='<slot name="start"></slot><div class="text" part="text"><slot></slot></div><slot name="end"></slot><slot name="action"></slot><s-ripple class="ripple" attached="true" part="ripple"></s-ripple>',ce=class extends h({style:ao,template:no,props:io,setup(t){let e=t.querySelector("slot[name=action]");e.onclick=r=>r.stopPropagation(),e.onpointerdown=r=>r.stopPropagation(),this.addEventListener("click",()=>{this.clickable&&(this.checked=!this.checked,this.dispatchEvent(new Event("change")))})}}){};ce.define(so);var lo="s-circular-progress",co=g({indeterminate:!1,animated:!1,$max:100,$value:0}),po=":host{display:inline-block;vertical-align:middle;position:relative;width:48px;aspect-ratio:1;-webkit-aspect-ratio:1;color:var(--s-color-primary, #006782)}:host([animated=true]) .known .block{transition-duration:var(--s-motion-duration-medium4, .4s);transition-timing-function:var(--s-motion-easing-emphasized, cubic-bezier(.2, 0, 0, 1));transition-name:stroke-dashoffset,transform}:host([indeterminate=true]) .known,.unknown{display:none}:host([indeterminate=true]) .unknown,.known{display:block}.container{width:100%;height:100%;border-radius:inherit;position:relative}svg{height:inherit;width:inherit;stroke:currentColor}circle{stroke-linecap:round;fill:none;stroke-dasharray:var(--dasharray)}.track{stroke:var(--s-color-secondary-container, #CFE6F1)}.unknown{animation:rotate 1568ms linear infinite}@keyframes stroke{0%{stroke-dashoffset:var(--dasharray)}50%{stroke-dashoffset:calc(var(--dasharray) / 4)}to{stroke-dashoffset:var(--dasharray)}}@keyframes stroke-rotate{0%{transform:rotate(0)}12.5%{transform:rotate(0)}25%{transform:rotate(270deg)}37.5%{transform:rotate(270deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(540deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(810deg)}to{transform:rotate(1080deg)}to{transform:rotate(1080deg)}}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}",C=48,M=4,A=(C-M)*Math.PI,ho=`<div class="container known"><svg viewBox="0 0 48 48" style="transform: rotate(-90deg);--dasharray: ${A}px;"><circle class="track block" cx="${C/2}" cy="${C/2}" r="${(C-M)/2}" style="stroke-width: ${M}px"/><circle class="indicator block" cx="${C/2}" cy="${C/2}" r="${(C-M)/2}" style="stroke-dashoffset: ${A}px;stroke-width: ${M}px"/></svg></div><div class="container unknown"><svg viewBox="0 0 48 48" style="animation: stroke-rotate 5.2s ease-in-out infinite;--dasharray: ${A}px;"><circle transform="rotate(-90, ${C/2}, ${C/2})" cx="${C/2}" cy="${C/2}" r=" ${(C-M)/2}" style="animation: stroke 1.3s ease-in-out infinite;stroke-width: ${M}px"></circle></svg></div>`,de=class extends h({style:po,template:ho,props:co,setup(t){let e=t.querySelector(".known .track"),r=t.querySelector(".known .indicator"),a=()=>{let i=Math.min(this.value,this.max)/this.max*100,l=A-A*(i/100),n=i/100*360;e.style.strokeDashoffset=`${i===0?0:Math.min(A+16-l,A)}px`,e.setAttribute("transform",`rotate(${n+20}, ${C/2}, ${C/2})`),r.style.strokeDashoffset=`${l}px`};return{max:a,value:a}}}){};de.define(lo);var D=(s,t="yyyy-MM-dd")=>{typeof s=="string"&&(s=new Date(s));let e=s.getFullYear(),r=s.getMonth()+1,a=s.getDate();return t.replace("yyyy",e.toString()).replace("MM",r.toString().padStart(2,"0")).replace("dd",a.toString().padStart(2,"0"))};var pe=class{list;locale=navigator.language;updates=new Map;constructor(t){this.list=t}getItem(t){if(t=t||this.locale,t in this.list)return this.list[t];let[e]=t.split("-");return e in this.list?this.list[e]:this.list.zh}addItem(t,e){if(this.list[t])throw new Error(`Locale ${t} already exists`);this.list[t]=e}setLocale(t){this.locale=t??navigator.language,this.updates.forEach(e=>e())}};var T=new pe({});T.list={zh:{display:s=>`${s.getFullYear()}\u5E74${s.getMonth()+1}\u6708${s.getDate()}\u65E5 \u661F\u671F${T.list.zh.displayWeeks[s.getDay()]}`,displayMonth:s=>`${s.getFullYear()}\u5E74`,displayWeeks:["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"]},en:{display:s=>`${["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][s.getDay()]}, Jan ${s.getDate()}`,displayMonth:s=>`${["January","February","March","April","May","June","July","August","September","October","November","December"][s.getMonth()]} ${s.getFullYear()}`,displayWeeks:["S","M","T","W","T","F","S"]}};var uo="s-date",mo=g({$value:"",$locale:"",$max:"2099-12-31",$min:"1900-01-01"}),go=":host{display:inline-block;vertical-align:middle;border-radius:8px;font-size:.875rem;max-width:360px;overflow:hidden;box-sizing:border-box;border:solid 1px var(--s-color-surface-variant, #DCE4E8);background:var(--s-color-surface-container-low, #F2F4F5);color:var(--s-color-on-surface, #191C1E)}.button,.icon-button{display:flex;justify-content:center;align-items:center;height:36px;box-sizing:border-box;font-size:.8125rem;color:var(--s-color-on-surface-variant, #40484C)}.icon-button{width:36px;border-radius:50%}.button{border-radius:18px;height:36px;padding:0 12px}svg{width:24px;fill:currentColor;box-sizing:border-box}.header{padding:24px 24px 16px;font-size:1.25rem;border-bottom:solid 1px var(--s-color-surface-variant, #DCE4E8);background:var(--s-color-surface-container, #ECEEF0)}.container{display:flex;flex-direction:column;position:relative}.action{display:flex;align-items:center;justify-content:space-between;padding:12px 16px}.action>.year>svg{margin:0 -8px 0 2px;padding:1px}.action>.toggle{display:flex}.years{display:flex;flex-wrap:wrap;overflow:auto;gap:4px;column-gap:6px;padding:0 16px 16px;margin-top:-12px;max-height:280px;counter-reset:year-counter 1899}.years>.item{counter-increment:year-counter;flex-grow:1}.years>.item:before{content:counter(year-counter)}.weeks{display:flex;padding:0 16px;font-size:.8125rem;color:var(--s-color-outline, #70787D)}.weeks>.item,.days>.item{width:calc(100% / 7);display:inline-flex;justify-content:center}.days{padding:16px;display:flex;flex-wrap:wrap}.days>.overflow~.item{display:none}.days>.item>s-ripple{margin:2px}.days>.checked>s-ripple,.years>.checked{pointer-events:none;background:var(--s-color-primary, #006782);color:var(--s-color-on-primary, #ffffff)}.container:not(.show-years) .years,.show-years :is(.weeks,.days,.action>.toggle){display:none}",Z={years:[],weeks:[],days:[]};for(let s=0;s<200;s++)s<7&&Z.weeks.push('<div class="item"></div>'),s<31&&Z.days.push(`<div class="item"><s-ripple class="icon-button">${s+1}</s-ripple></div>`),Z.years.push('<s-ripple class="button item"></s-ripple>');var fo=`<div class="header" part="header"><slot name="headline"></slot><span></span></div><div class="container" part="container"><div class="action"><s-ripple class="button year" slot="trigger"><span></span> <svg viewBox="0 -960 960 960"><path d="M480-360 280-560h400L480-360Z"></path></svg></s-ripple><div class="toggle"><s-ripple class="icon-button prev" part="prev-button"><svg viewBox="0 -960 960 960"><path d="M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"></path></svg></s-ripple><s-ripple class="icon-button next" part="next-button"><svg viewBox="0 -960 960 960"><path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"></path></svg></s-ripple></div></div><s-scroll-view class="years">${Z.years.join("")}</s-scroll-view><div class="weeks">${Z.weeks.join("")}</div><div class="days">${Z.days.join("")}</div></div>`,Xe=class{yearSelect;daySelect;dayOverflow;date;min;max;constructor(t,e,r){this.date=typeof t=="string"?new Date(t):t,this.min=new Date(e),this.max=new Date(r)}},at=(s,t)=>{let e=new Date(s,t+1,1);return e.setDate(e.getDate()-1),e.getDate()},xo=(s,t)=>{T.addItem(s,t)},vo=s=>{T.setLocale(s)},he=class extends h({style:go,template:fo,props:mo,methods:{addLocale:xo,setLocale:vo},setup(t){let e=t.querySelector(".container"),r=t.querySelector(".header>span"),a=t.querySelector(".action>.year"),i=t.querySelector(".action>.toggle>.prev"),l=t.querySelector(".action>.toggle>.next"),n=t.querySelector(".years"),d=t.querySelector(".weeks"),c=t.querySelector(".days"),o=new Xe(this.value||new Date,this.min,this.max),f=()=>{let v=T.getItem(this.locale).display;r.textContent=v(o.date);let b=T.getItem(this.locale).displayMonth;a.children[0].textContent=b(o.date)},x=()=>{let v=T.getItem(this.locale).displayWeeks;d.childNodes.forEach((b,w)=>b.textContent=v[w])},m=()=>{let v=new Date(o.date.getFullYear(),o.date.getMonth(),1).getDay();c.children[0].setAttribute("style",`margin-left: calc((100% / 7) * ${v})`);let b=new Date(o.date.getFullYear(),o.date.getMonth()+1,0).getDate();o.dayOverflow?.classList.remove("overflow"),o.dayOverflow=c.children[b-1],o.dayOverflow.classList.add("overflow"),o.yearSelect?.classList.remove("checked"),o.yearSelect=n.children[o.date.getFullYear()-o.min.getFullYear()],o.yearSelect.classList.add("checked"),o.daySelect?.classList.remove("checked"),o.daySelect=c.children[o.date.getDate()-1],o.daySelect.classList.add("checked"),e.style.removeProperty("height")},p=()=>{let v=o.max.getFullYear()-o.min.getFullYear();n.innerHTML="",n.style.counterReset=`year-counter ${o.min.getFullYear()-1}`;let b=document.createDocumentFragment();for(let w=0;w<=v;w++){let q=new z;q.classList.add("button","item"),b.appendChild(q)}n.appendChild(b),m()},u=(v,b,w)=>{this.value=D(new Date(v,b,w)),this.dispatchEvent(new Event("change"))};a.onclick=()=>{let v=e.offsetHeight;if(e.classList.toggle("show-years"),e.classList.contains("show-years")){e.style.height=`${v}px`,o.yearSelect&&n.scrollTo({top:o.yearSelect.offsetTop-n.offsetHeight/2+o.yearSelect.offsetHeight/2});return}},i.onclick=()=>{let v=at(o.date.getFullYear(),o.date.getMonth()-1),b=Math.min(o.date.getDate(),v);u(o.date.getFullYear(),o.date.getMonth()-1,b)},l.onclick=()=>{let v=at(o.date.getFullYear(),o.date.getMonth()+1),b=Math.min(o.date.getDate(),v);u(o.date.getFullYear(),o.date.getMonth()+1,b)},n.onclick=v=>{if(!(v.target instanceof z))return;e.classList.remove("show-years");let b=Array.from(n.children).indexOf(v.target)+o.min.getFullYear();u(b,o.date.getMonth(),o.date.getDate())},c.onclick=v=>{if(!(v.target instanceof z))return;let b=Array.from(c.children).indexOf(v.target.parentElement)+1;u(o.date.getFullYear(),o.date.getMonth(),b)};let y=()=>{f(),x()};return m(),y(),{onMounted:()=>T.updates.set(this,y),onUnmounted:()=>T.updates.delete(this),min:v=>{let b=new Date(v);if(isNaN(b.getTime())||b.getTime()>o.date.getTime())throw Error("invalid min date");o.min=b,p()},max:v=>{let b=new Date(v);if(isNaN(b.getTime())||b.getTime()<o.date.getTime())throw Error("invalid max date");o.max=b,p()},value:{get:()=>D(o.date),set:v=>{let b=new Date(v);if(isNaN(b.getTime())||b.getTime()<o.min.getTime()||b.getTime()>o.max.getTime())throw Error("invalid date");o.date=b,f(),m()}},locale:y}}}){};he.define(uo);var bo="s-date-picker",Ge=g({$value:"",$min:"",$max:"",$label:"",$positiveText:"\u786E\u5B9A",$negativeText:"\u53D6\u6D88",$format:"yyyy-MM-dd",$locale:""}),yo=":host{display:inline-block;vertical-align:middle;font-size:.875rem;--date-picker-border-radius: 4px;--date-picker-border-color: var(--s-color-outline, #70787D);--date-picker-border-width: 1px;--date-picker-padding: 16px;--date-picker-height: 48px}s-dialog{display:block}.field{--field-border-radius: var(--date-picker-border-radius);--field-border-color: var(--date-picker-border-color);--field-border-width: var(--date-picker-border-width);--field-padding: var(--date-picker-padding);height:var(--date-picker-height);position:relative;cursor:pointer}.view{width:100%;padding-top:0;padding-bottom:0;padding:0 var(--date-picker-padding)}svg{width:24px;height:24px;padding:2px;box-sizing:border-box;flex-shrink:0;margin-left:min(0px,calc((var(--date-picker-padding) * -1) + 12px));margin-right:max(0px,calc(var(--date-picker-padding) - 4px));fill:var(--s-color-on-surface-variant, #40484C)}.ripple{border-radius:var(--date-picker-border-radius)}.date{border:none;width:360px;border-radius:0}.positive,.negative{border-radius:20px}",wo=`<s-dialog part="dialog"><slot name="trigger" slot="trigger"><s-field class="field" fixed="false" part="field"><div class="label" part="label" slot="label"></div><div class="view"></div><svg viewBox="0 -960 960 960" slot="end"><path d="M320-400q-17 0-28.5-11.5T280-440q0-17 11.5-28.5T320-480q17 0 28.5 11.5T360-440q0 17-11.5 28.5T320-400Zm160 0q-17 0-28.5-11.5T440-440q0-17 11.5-28.5T480-480q17 0 28.5 11.5T520-440q0 17-11.5 28.5T480-400Zm160 0q-17 0-28.5-11.5T600-440q0-17 11.5-28.5T640-480q17 0 28.5 11.5T680-440q0 17-11.5 28.5T640-400ZM200-80q-33 0-56.5-23.5T120-160v-560q0-33 23.5-56.5T200-800h40v-80h80v80h320v-80h80v80h40q33 0 56.5 23.5T840-720v560q0 33-23.5 56.5T760-80H200Zm0-80h560v-400H200v400Zm0-480h560v-80H200v80Zm0 0v-80 80Z"></path></svg><s-ripple slot="custom" class="ripple" attached="true"></s-ripple></s-field></slot><s-date class="date" part="date"></s-date><s-ripple class="negative" slot="action" part="negative">${Ge.negativeText}</s-ripple><s-ripple class="positive" slot="action" part="positive">${Ge.positiveText}</s-ripple></s-dialog>`,ue=class extends h({style:yo,template:wo,props:Ge,setup(t){let e=t.querySelector("s-dialog"),r=t.querySelector("s-date"),a=t.querySelector(".negative"),i=t.querySelector(".positive"),l=t.querySelector("s-field"),n=t.querySelector(".label"),d=t.querySelector(".view"),c={date:""};return e.addEventListener("show",()=>{l.fixed=!0,l.focused=!0,c.date||(d.textContent=this.label,d.style.opacity="0")}),e.onclose=()=>{l.focused=!1,c.date||(l.fixed=!1)},i.onclick=()=>{this.value=r.value,d.style.removeProperty("opacity"),this.dispatchEvent(new Event("change"))},{value:{get:()=>c.date,set:o=>{if(c.date=o,o===""){r.value=D(new Date),l.fixed=!1,d.textContent="";return}l.fixed=!0,d.textContent=D(o,this.format),r.value=o}},locale:{get:()=>r.locale,set:o=>r.locale=o},min:{get:()=>r.min,set:o=>r.min=o},max:{get:()=>r.max,set:o=>r.max=o},label:o=>n.textContent=o,positiveText:o=>i.textContent=o,negativeText:o=>a.textContent=o}}}){};ue.define(bo);var ko="s-scroll-view",Eo=":host{display:block;overflow:auto}@media (pointer: fine){:host::-webkit-scrollbar{background:transparent;width:6px;height:6px}:host::-webkit-scrollbar-thumb{background:var(--s-color-outline-variant, #C0C8CC);border-radius:3px}@supports not selector(::-webkit-scrollbar){:host{scrollbar-color:var(--s-color-outline-variant, #C0C8CC) transparent}}}",Co="<slot></slot>",me=class extends h({style:Eo,template:Co}){};me.define(ko);var qo="s-dialog",So=g({showed:!1,size:["standard","full"]}),$o=L({show:CustomEvent,showed:Event,close:CustomEvent,closed:Event}),zo=':host{display:inline-block;vertical-align:middle}dialog{inset:0;width:100%;height:100%;background:none;border:none;padding:0;max-width:none;max-height:none;outline:none;color:inherit}dialog::backdrop{background:none}.wrapper{width:100%;height:100%;display:flex;justify-content:center;align-items:center;position:relative;pointer-events:none}.scrim{position:absolute;inset:0;width:100%;height:100%;opacity:0;backdrop-filter:saturate(180%) blur(2px)}.scrim:before{content:"";display:block;width:100%;height:100%;opacity:.75;background:var(