@dk-address/web 0.0.0-stage → 0.1.3
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/LICENSE +21 -0
- package/README.md +41 -2
- package/dist/dk-address.js +5 -0
- package/dist/dk-address.js.map +113 -0
- package/dist/elements.d.ts +71 -0
- package/dist/elements.js +402 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +2 -0
- package/package.json +64 -4
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var Wd=Object.defineProperty;var Vd=(e)=>e;function qd(e,t){this[e]=Vd.bind(null,t)}var Hd=(e,t)=>{for(var n in t)Wd(e,n,{get:t[n],enumerable:!0,configurable:!0,set:qd.bind(t,n)})};var be=(e,t,n)=>()=>{if(e)try{t=e(e=0)}catch(r){n=[r]}if(n)throw n[0];return t};function at(){return Ee&&(/iP(hone|ad|od)/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function ws(){return Ee&&/Android/i.test(navigator.userAgent)}function Mn(e){return!!e&&Ee&&getComputedStyle(e).direction==="rtl"}var Ee;var Ve=be(()=>{Ee=typeof window<"u"&&typeof document<"u"});function Ne(e,t,n){let r=e.style.getPropertyValue(t),o=e.style.getPropertyPriority(t);e.style.setProperty(t,n);let i=e.style.getPropertyValue(t);return()=>{if(e.style.getPropertyValue(t)!==i)return;if(r)e.style.setProperty(t,r,o);else e.style.removeProperty(t)}}function po(e){if(typeof CSS>"u"||!CSS.registerProperty)return;for(let t of e){if(ia.has(t))continue;ia.add(t);try{CSS.registerProperty({name:t,syntax:"*",inherits:!1})}catch{}}}function aa(e){if(uo.has(e))return uo.get(e);let t;for(let r=e;r&&!t;r=r.defaultView?.frameElement?.ownerDocument)t=r.head?.querySelector('meta[property="csp-nonce"]');let n=t?t.nonce||t.getAttribute("nonce")||"":null;return uo.set(e,n),n}function Te(e,t,n){if(!e.head)return;let r=e.defaultView;if(aa(e)===""&&r&&"adoptedStyleSheets"in e)Df(e,r,t,n);else Tf(e,t,n)}function Tf(e,t,n){let r=e.getElementById(t);if(r){if(fo.get(r)===n)return;if(r.textContent!==n)r.textContent=n;fo.set(r,n);return}let o=e.createElement("style");o.id=t;let i=aa(e);if(i)o.nonce=i;o.textContent=n,fo.set(o,n);let s=e.head.querySelectorAll(':scope > style[id^="ui-sdk-"]');if(s.length)s[s.length-1].after(o);else e.head.prepend(o)}function Df(e,t,n,r){let o=sa().get(e);if(!o)sa().set(e,o=new Map);let i=o.get(n);if(!i)o.set(n,i={sheet:new t.CSSStyleSheet,css:""});if(i.css!==r)i.sheet.replaceSync(r),i.css=r;if(!e.adoptedStyleSheets.includes(i.sheet))e.adoptedStyleSheets=[...e.adoptedStyleSheets,i.sheet]}function mo(e){Te(e,"ui-sdk-hidden",'@layer ui-sdk { :where([data-slot][hidden]:not([hidden="until-found"])) { display: none !important } }')}function Gt(e){if(typeof window>"u")return;if(!performance.getEntriesByType("paint").length)e();else if(Xt)Xt.push(e);else Xt=[e],(window.requestIdleCallback??setTimeout)(()=>{let t=Xt;Xt=void 0,t.forEach((n)=>n())})}function la(e){let t,n=requestAnimationFrame(()=>{t=setTimeout(e)});return()=>{cancelAnimationFrame(n),clearTimeout(t)}}var ia,sa=()=>globalThis[Symbol.for("ui-sdk.styles@1")]??=new WeakMap,uo,fo,Xt,At;var De=be(()=>{ia=new Set;uo=new WeakMap;fo=new WeakMap;At=new WeakSet});function qf(e,t){let n=ka.get(e);if(!n)ka.set(e,n={});let r=n[t];if(r?.isConnected)return r;let o=e.createElement("div");return o.setAttribute("role",t==="assertive"?"alert":"status"),o.setAttribute("aria-live",t),o.setAttribute("aria-atomic","true"),o.setAttribute("data-ui-sdk-announcer",t==="assertive"?"assertive":""),o.style.cssText="position:fixed;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap",e.body.append(o),n[t]=o,o}function Ca(e,{priority:t="polite",doc:n=typeof document>"u"?void 0:document}={}){if(!e)return;if(Aa)return Aa(e,t);if(!n?.body)return;let r=qf(n,t);r.textContent="",clearTimeout(Ea[t]),Ea[t]=setTimeout(()=>{r.textContent=e},100)}var ka,Aa,Ea;var Ma=be(()=>{ka=new WeakMap,Ea={}});function se(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function Ct(e){let t="nativeEvent"in e?e.nativeEvent:e;return t.isComposing===!0||t.keyCode===229}var Pe=()=>{};function cr(e){if(!e.towardMore)return e.scrollAtStart?"sheet":"scroll";return!e.atLargest&&e.expandOnScroll?"sheet":"scroll"}var Ko=()=>{};function Jp(e,t){return e*t/(1-t)}function Bo(e){let{extent:t,velocity:n,candidates:r}=e;if(Math.abs(n)<e.minFlingVelocity)return Ye(r,t);let o=t+Jp(n,e.rate),i=Zp(r,t,Math.sign(n)),s=Ye(r,o);if((n>0?r[s]<=t+0.5:r[s]>=t-0.5)&&i!==-1)s=i;if(!e.skipSnapPoints&&i!==-1)s=n>0?Math.min(s,i):Math.max(s,i);return s}function Ye(e,t){let n=0;for(let r=1;r<e.length;r++)if(Math.abs(e[r]-t)<Math.abs(e[n]-t))n=r;return n}function Zp(e,t,n){if(n>0)return e.findIndex((r)=>r>t+0.5);for(let r=e.length-1;r>=0;r--)if(e[r]<t-0.5)return r;return-1}var ur=()=>{};function _o(e,t,n=zo){if(e<=0)return 0;return(1-1/(e*n/t+1))*t}function dr(e,t,n=zo){if(e<=0)return 0;return(1/(1-Math.min(e/t,0.999999))-1)*t/n}function nc(e,t,n=zo){if(e<=0)return 1;let r=e*n/t+1;return n/(r*r)}var zo=0.55;var rc=()=>{};function It(e,t,n,r){let o=2*Math.PI/(e*1000),i=t;if(Math.abs(i-1)<0.000001)return tm(o,n,r);if(i<1)return em(o,i,n,r);return nm(o,i,n,r)}function em(e,t,n,r){let o=t*e,i=e*Math.sqrt(1-t*t),s=(r+o*n)/i;return{position:(a)=>Math.exp(-o*a)*(n*Math.cos(i*a)+s*Math.sin(i*a)),velocity:(a)=>{let l=Math.cos(i*a),c=Math.sin(i*a);return Math.exp(-o*a)*((s*i-o*n)*l-(n*i+o*s)*c)}}}function tm(e,t,n){let r=n+e*t;return{position:(o)=>Math.exp(-e*o)*(t+r*o),velocity:(o)=>Math.exp(-e*o)*(r-e*(t+r*o))}}function nm(e,t,n,r){let o=Math.sqrt(t*t-1),i=-e*(t+o),s=-e*(t-o),a=(r-i*n)/(s-i),l=n-a;return{position:(c)=>a*Math.exp(s*c)+l*Math.exp(i*c),velocity:(c)=>a*s*Math.exp(s*c)+l*i*Math.exp(i*c)}}function fr(e,{positionTolerance:t=0.5,velocityTolerance:n=0.02,step:r=1,limit:o=1e4}={}){for(let i=0;i<=o;i+=r)if(Math.abs(e.position(i))<=t&&Math.abs(e.velocity(i))<=n)return i;return o}function pr(e,t,n,r,o=8.333333333333334){let i=n-t;if(Math.abs(i)<0.000001)return"linear";let s=[];for(let a=0;a<r;a+=o)s.push(rm(1+e.position(a)/i));return s.push("1"),`linear(${s.join(", ")})`}function rm(e){return String(Math.round(e*1e4)/1e4)}var mr=()=>{};function Ce(e,t){return{phase:"idle",extent:e,restingIndex:t}}function hr(e,t,n){switch(t.type){case"down":return im(e,t,n);case"move":return sm(e,t,n);case"up":return cm(e,t,n);case"settled":return um(e);case"rest":return dm(e,t,n);case"snap-to":return fm(e,t,n);case"nudge":return pm(e,t,n);case"close":return ht(e,n,{targetIndex:-1,motion:Uo(e,t.time),time:t.time,reason:"imperative",outcome:{type:"dismiss",reason:"imperative"}})}}function Uo(e,t){if(e.phase!=="settling")return{extent:e.extent,velocity:0};let n=It(e.response,e.dampingRatio,e.from-e.to,e.velocity),r=Math.max(0,t-e.startTime);return{extent:e.to+n.position(r),velocity:n.velocity(r)}}function im(e,t,n){let r=t.pointer==="mouse"?n.physics.mouseSlop:n.physics.touchSlop;if(e.phase==="idle"&&e.restingIndex>=0)return{state:{...e,phase:"pending",originX:t.x,originY:t.y,slop:r},effects:Ie};if(e.phase!=="settling")return{state:e,effects:Ie};let{extent:o}=Uo(e,t.time);return{state:{phase:"dragging",extent:o,restingIndex:e.restingIndex,anchorY:t.y,anchorExtent:mm(o,n),lastY:t.y,isScrollingContent:!1},effects:[{type:"move",extent:o}]}}function sm(e,t,n){if(e.phase==="pending")return am(e,t,n);if(e.phase==="scrolling"&&n.contentScroll)return n.contentScroll.move(e,t);if(e.phase==="dragging")return lm(e,t,n);return{state:e,effects:Ie}}function am(e,t,n){let r=t.x-e.originX,o=t.y-e.originY;if(Math.max(Math.abs(r),Math.abs(o))<e.slop)return{state:e,effects:Ie};if(Math.abs(r)>Math.abs(o))return{state:Ce(e.extent,e.restingIndex),effects:Ie};let i=n.contentScroll?.claim(e,t,o<0,n);if(i)return{state:i,effects:Ie};let s={...Yo(e,e.originY+Math.sign(o)*e.slop),lastY:t.y},a=oc(s.anchorExtent+(s.anchorY-t.y),n);return{state:{...s,extent:a},effects:[{type:"move",extent:a}]}}function Yo(e,t){return{phase:"dragging",extent:e.extent,restingIndex:e.restingIndex,anchorY:t,anchorExtent:e.extent,lastY:t,isScrollingContent:!1}}function lm(e,t,n){let r=e.lastY-t.y,o=e.isScrollingContent?{anchorY:e.lastY,anchorExtent:e.extent}:e,i=o.anchorExtent+(o.anchorY-t.y),s=n.contentScroll?.drag(e,t,r,i,n);if(s)return s;let a=oc(i,n);return{state:{...e,anchorY:o.anchorY,anchorExtent:o.anchorExtent,extent:a,lastY:t.y,isScrollingContent:!1},effects:[{type:"move",extent:a}]}}function cm(e,t,n){if(e.phase==="pending"||e.phase==="scrolling")return{state:Ce(e.extent,e.restingIndex),effects:Ie};if(e.phase!=="dragging")return{state:e,effects:Ie};let r=n.contentScroll?.release(e,t,n);if(r)return r;let o=-t.velocity*hm(e.extent,n),i=[0,...ic(n)],s=n.physics,a={candidates:i,rate:s.projectionRate,minFlingVelocity:s.minFlingVelocity,skipSnapPoints:s.skipSnapPoints},l=Bo({...a,extent:e.extent,velocity:o}),c={motion:{extent:e.extent,velocity:o},time:t.time,reason:"swipe"};if(n.dismissible){if(l>0)return ht(e,n,{...c,targetIndex:l-1});return ht(e,n,{...c,targetIndex:-1,outcome:{type:"dismiss",reason:"swipe"}})}let f=e.anchorExtent+(e.anchorY-e.lastY),p=Bo({...a,extent:f,velocity:-t.velocity})===0,u=Math.max(0,l-1);if(!p)return ht(e,n,{...c,targetIndex:u});return ht(e,n,{...c,targetIndex:0,outcome:{type:"attempt-dismiss",reason:"swipe"}})}function um(e){if(e.phase!=="settling")return{state:e,effects:Ie};return{state:Ce(e.to,e.targetIndex),effects:Ie}}function dm(e,t,n){if(t.extent<1&&n.dismissible)return{state:Ce(0,-1),effects:[{type:"dismiss",reason:"swipe"}]};let r=Ye(ic(n),t.extent),o=r===e.restingIndex?[]:[{type:"snap",id:n.snapPoints[r].id,reason:"swipe"}];return{state:Ce(t.extent,r),effects:o}}function fm(e,t,n){let r=n.snapPoints.findIndex((o)=>o.id===t.id);if(r===-1||e.phase==="dragging")return{state:e,effects:Ie};return ht(e,n,{targetIndex:r,motion:Uo(e,t.time),time:t.time,reason:t.reason})}function pm(e,t,n){if(e.phase!=="idle"||e.restingIndex<0)return{state:e,effects:Ie};return ht(e,n,{targetIndex:e.restingIndex,motion:{extent:e.extent,velocity:-om},time:t.time,reason:"imperative"})}function ht(e,t,n){let{targetIndex:r,motion:o,time:i,reason:s}=n,a=t.physics,l=r<0?0:t.snapPoints[r].extent,f=Math.abs(o.velocity)>=a.minFlingVelocity?a.momentumDampingRatio:a.dampingRatio,p={phase:"settling",extent:o.extent,restingIndex:e.restingIndex,targetIndex:r,from:o.extent,to:l,velocity:o.velocity,response:a.response,dampingRatio:f,startTime:i},u=[{type:"settle",from:o.extent,to:l,velocity:o.velocity,response:a.response,dampingRatio:f}];if(r>=0&&r!==e.restingIndex)u.push({type:"snap",id:t.snapPoints[r].id,reason:s});if(n.outcome)u.push(n.outcome);return{state:p,effects:u}}function oc(e,t){let n=Lt(t),{coefficient:r,dimension:o}=Xo(t);if(e>n)return n+_o(e-n,o,r);if(t.dismissible)return Math.max(0,e);let i=t.snapPoints[0].extent;if(e<i)return i-_o(i-e,o,r);return e}function mm(e,t){let n=Lt(t),{coefficient:r,dimension:o}=Xo(t);if(e>n)return n+dr(e-n,o,r);let i=t.snapPoints[0].extent;if(!t.dismissible&&e<i)return i-dr(i-e,o,r);return e}function Xo(e){return{coefficient:e.physics.rubberBand,dimension:e.physics.rubberBandDimension??e.dimension}}function hm(e,t){let{coefficient:n,dimension:r}=Xo(t),o=Lt(t),i=t.snapPoints[0].extent,s=e>o?e-o:!t.dismissible&&e<i?i-e:0;if(s<=0)return 1;return nc(dr(s,r,n),r,n)}function Lt(e){return e.snapPoints[e.snapPoints.length-1].extent}function ic(e){return e.snapPoints.map((t)=>t.extent)}var Ie,om=1;var gr=be(()=>{ur();rc();mr();Ie=[]});var sc,ac;var lc=be(()=>{Ko();gr();sc=[],ac={claim(e,t,n,r){if(!t.scroll)return;if(cr({towardMore:n,scrollAtStart:t.scroll.atStart,atLargest:e.extent>=Lt(r)-0.5,expandOnScroll:r.expandOnScroll})!=="scroll")return;return{phase:"scrolling",extent:e.extent,restingIndex:e.restingIndex,lastY:t.y}},move(e,t){if(t.y>e.lastY&&t.scroll?.atStart)return{state:Yo(e,t.y),effects:sc};return{state:{...e,lastY:t.y},effects:sc}},drag(e,t,n,r,o){let i=t.scroll;if(!i)return;if(e.isScrollingContent&&(n>0?!i.atEnd:!i.atStart)){let c=[{type:"scroll",delta:n}];return{state:{...e,lastY:t.y},effects:c}}let s=Lt(o);if(!(n>0&&r>s&&e.extent<=s&&!i.atEnd))return;let a=[{type:"scroll",delta:r-s}];if(e.extent!==s)a.unshift({type:"move",extent:s});return{state:{...e,extent:s,anchorY:t.y,anchorExtent:s,lastY:t.y,isScrollingContent:!0},effects:a}},release(e,t,n){if(!e.isScrollingContent)return;let r=n.snapPoints.length-1,o=[{type:"fling-scroll",velocity:-t.velocity}];if(e.restingIndex!==r)o.push({type:"snap",id:n.snapPoints[r].id,reason:"swipe"});return{state:Ce(e.extent,r),effects:o}}}});var yr;var cc=be(()=>{yr={ios:{response:0.34,dampingRatio:1,momentumDampingRatio:0.88,projectionRate:0.99,minFlingVelocity:0.5,skipSnapPoints:!0,rubberBand:1.9,rubberBandDimension:24,touchSlop:8,mouseSlop:4,dim:0.2,velocityHorizon:70}}});function gm(e){return String(e)}function ym(e,t){if(typeof e==="number")return e<=1?e*t.container:e;if(e==="content")return t.content;let n=parseFloat(e);if(e.endsWith("rem"))return n*t.rootFontSize;if(e.endsWith("%"))return n/100*t.container;if(e.endsWith("px"))return n;return NaN}function uc(e,t){let n=e.map((o,i)=>({value:o,index:i,extent:Math.min(ym(o,t),t.content)})).filter((o)=>o.extent>0).sort((o,i)=>o.extent-i.extent||o.index-i.index),r=[];for(let o of n){let i=gm(o.value),s=r[r.length-1];if(s&&o.extent-s.extent<1){if(s.ids.push(i),o.index>s.index)Object.assign(s,{id:i,value:o.value,index:o.index});s.extent=Math.max(s.extent,o.extent);continue}r.push({id:i,value:o.value,extent:Math.round(o.extent*100)/100,ids:[i],index:o.index})}return r.map(({index:o,...i})=>i)}function gt(e,t){if(t===null||t===void 0)return-1;let n=String(t);return e.findIndex((r)=>r.ids.includes(n))}function dc(e,t,n){let r=gt(e,n),o=gt(e,t);return r>=0&&o>=0&&o<=r}var fc=()=>{};function bm(e,t,n){let r=Math.max(0,t.layoutHeight-t.offsetTop-t.height);if(Math.abs(t.height-t.layoutHeight)<=1)pc.set(e,t.scale);if(n>0)return Math.round(Math.min(n,r));return t.scale>(pc.get(e)??1)+0.01?0:Math.round(r)}function mc(e,t){let n=e.ownerDocument.defaultView,r=n?.visualViewport;if(!n||!r)return()=>{};let o=null,i=(l)=>{let c=bm(n,l,0),f=o!==null&&c!==o;if(o=c,f)t?.before();if(e.style.setProperty("--keyboard-inset",`${c}px`),e.style.setProperty("--visual-viewport-height",`${Math.round(l.height)}px`),c>0)e.setAttribute("data-keyboard","");else e.removeAttribute("data-keyboard");if(f)t?.after()},s=xm.get(n);i(s&&s.layoutHeight-s.offsetTop-s.height<=1?s:hc(n,r));let a=wm(n,r,i);return()=>{a(),e.style.removeProperty("--keyboard-inset"),e.style.removeProperty("--visual-viewport-height"),e.removeAttribute("data-keyboard")}}function hc(e,t){return{width:t.width,layoutHeight:e.innerHeight,height:t.height,offsetTop:t.offsetTop,scale:t.scale}}function vm(e,t){let n=new Set,r=(s)=>{let a=hc(e,t);for(let l of n)l(a,s)};t.addEventListener("resize",r),t.addEventListener("scroll",r);let i={followers:n,stop:()=>{t.removeEventListener("resize",r),t.removeEventListener("scroll",r),Go.delete(t)}};return Go.set(t,i),i}function wm(e,t,n){let{followers:r,stop:o}=Go.get(t)??vm(e,t);return r.add(n),()=>{if(r.delete(n)&&!r.size)o()}}var pc,Go,xm;var gc=be(()=>{pc=new WeakMap;Go=new WeakMap;xm=new WeakMap});function an(e,t=!1){if(e==="start")return t?"right":"left";if(e==="end")return t?"left":"right";return e}var br;var vr=be(()=>{br={top:"bottom",bottom:"top",left:"right",right:"left"}});function Qo(e,t){return an(e,e==="start"||e==="end"?Mn(t):!1)}function yt(e,t,n,r){let o=Ke(e);return r.y=(o?n:t)*yc(e),r.x=o?t:n,r}function ln(e,t){let n=`${Math.round(t*yc(e)*100)/100}px`;return Ke(e)?`0 ${n}`:`${n} 0`}function bc(e,t){return Ke(t)?e.offsetHeight:e.offsetWidth}function vc(e,t,n){let r=Jo(e,t,n);if(!r)return null;let{start:o,end:i}=km(r,n);return{atStart:o,atEnd:i,area:r}}function Jo(e,t,n){let r=t.ownerDocument.defaultView;if(!r||!(e instanceof Element)||!t.contains(e))return null;let o=Ke(n);for(let i=e;i&&i!==t.parentElement;i=i.parentElement){if(!(o?i.scrollHeight>i.clientHeight+1:i.scrollWidth>i.clientWidth+1)||!(i instanceof HTMLElement))continue;let a=o?r.getComputedStyle(i).overflowY:r.getComputedStyle(i).overflowX;if(/auto|scroll/.test(a))return i}return null}function Sm(e,t){if(Ke(t)){let i=e.scrollHeight-e.clientHeight;return{position:t==="bottom"?e.scrollTop:i-e.scrollTop,max:i}}let n=e.scrollWidth-e.clientWidth,r=Math.abs(e.scrollLeft),o=Mn(e)?n-r:r;return{position:t==="right"?o:n-o,max:n}}function km(e,t){let{position:n,max:r}=Sm(e,t);return{start:n<=0.5,end:n>=r-1}}function Zo(e,t,n){if(Ke(t))e.scrollTop+=t==="bottom"?n:-n;else{let r=t==="right"?n:-n;e.scrollLeft+=Mn(e)?-r:r}}var Ke=(e)=>e==="bottom"||e==="top",yc=(e)=>e==="bottom"||e==="right"?1:-1;var ei=be(()=>{Ve();vr()});function xr(e,t){e.requestAnimationFrame(()=>e.requestAnimationFrame(t))}function Sr(e){return e==="bottom"?-Be:-32}function kr(e,t){let n=[];for(let r=0;r<e.duration;r+=16.666666666666668)n.push(t(e.extentAt(r)));return n.push(t(e.extentAt(e.duration))),n}function bt(e,t){let n=Object.entries(t).map(([r,o])=>Ne(e,r,o));return()=>n.forEach((r)=>r())}var wr=1000,Be=120,wc=200,xc=150;var Ar=be(()=>{De()});function Sc(e,t,n=-1){let r=n<0?0:t[n],o=n<0?t[0]:t[n+1];if(o===void 0||o<=r)return e>r?1:0;return ti((e-r)/(o-r))}function kc(e,t){let n=t[t.length-1],r=t.length>1?t[t.length-2]:0;if(n<=r)return e>=n?1:0;return ti((e-r)/(n-r))}function Ac(e,t){let n=t[t.length-1];return n>0?ti(e/n):0}var ti=(e)=>Math.max(0,Math.min(1,e));var Ec=()=>{};function Tc(e){let t=e.defaultView?.CSS;if(ri.has(e)||!t?.registerProperty)return;ri.add(e);for(let n of ni)try{t.registerProperty({name:n,syntax:"<number>",inherits:!1,initialValue:"0"})}catch{}}function Dc(){if(typeof document<"u"&&!ri.has(document))Gt(()=>Tc(document))}function Ic(e){Tc(e.sheet.ownerDocument);let t=[1],n=-1,r=[],o=new Map,i={dim:0,progress:0,expand:0},s;function a(F){t=F.snapExtents.length?F.snapExtents:[1],n=F.undimmedIndex}function l(F,H=i){return H.dim=Er(Sc(F,t,n)),H.progress=Er(Ac(F,t)),H.expand=Er(kc(F,t)),H}let c=!1;function f(F,{rest:H=!1}={}){if(c)return;T(),l(F),p(i.dim),g(e.sheet,i),m(i.progress);for(let U of e.outlets())if(g(U.el,i),U.keyframes)A(U,i.expand,H);if(H)e.themeColor?.(i.dim)}function p(F){let H=e.backdrop();if(H)H.style.opacity=String(F);let U=u();if(U)U.currentTime=F*1000}function u(){if(!e.dimmed||s)return s;return s=e.dimmed.animate({opacity:[0,1]},{...Mc,duration:1000,fill:"both"}),s.pause(),s.currentTime=0,s}function m(F){let H=e.ancestors();for(let U=0;U<H.length;U++)H[U].style.setProperty("--drawer-stack",String(U+F))}function g(F,{dim:H,progress:U,expand:te}){F.style.setProperty("--drawer-progress",String(U)),F.style.setProperty("--drawer-dim",String(H)),F.style.setProperty("--drawer-expand",String(te))}function A(F,H,U){let te=o.get(F.el);if(!te)te=F.el.animate(Pc(F.keyframes),{duration:1000,fill:"both"}),te.pause(),o.set(F.el,te);if(te.currentTime=H*1000,!U)return;te.commitStyles?.(),te.cancel(),o.delete(F.el)}function d(F){if(c)return;if(T(),B(),!cn())return f(F.type==="settle"?F.extentAt(F.duration):0,{rest:!0});let H=y(F);u();let U=F.type==="settle"?{duration:Math.max(1,F.duration),fill:"both"}:{timeline:F.timeline,fill:"both"},te=(ae,q,x,S)=>{let M=ae.animate(q,{...U,...S,easing:Am(x)});if(F.type==="settle")M.startTime=F.startTime;r.push(M)},Z=e.backdrop();if(Z)te(Z,{opacity:[0,1]},H.dim);if(e.dimmed)te(e.dimmed,{opacity:[0,1]},H.dim,Mc);b(e.sheet,H,te),e.ancestors().forEach((ae,q)=>te(ae,{"--drawer-stack":[q,q+1]},H.progress));for(let ae of e.outlets())if(b(ae.el,H,te),ae.keyframes)te(ae.el,Pc(ae.keyframes),H.expand);if(F.type!=="settle")return;let re=F.extentAt(F.duration);v(re);let ce=r;if(ce[0])ce[0].onfinish=()=>r===ce&&T()}function b(F,H,U){U(F,{"--drawer-progress":[0,1]},H.progress),U(F,{"--drawer-dim":[0,1]},H.dim),U(F,{"--drawer-expand":[0,1]},H.expand)}function v(F){let H=l(F,{dim:0,progress:0,expand:0});p(H.dim),g(e.sheet,H),m(H.progress);for(let U of e.outlets()){if(g(U.el,H),!U.keyframes)continue;for(let[te,Z]of Object.entries(U.keyframes)){let re=Z[H.expand>=0.5?Z.length-1:0];U.el.style.setProperty(Oc(te),String(re))}}e.themeColor?.(H.dim)}function y(F){let H={dim:[],progress:[],expand:[]},U={dim:0,progress:0,expand:0},te=F.type==="settle"?Math.max(2,Math.ceil(F.duration/Cc)+1):61;for(let Z=0;Z<te;Z++){let re=Z/(te-1),ce=F.type==="settle"?F.extentAt(Math.min(F.duration,Z*Cc)):F.extentAt(re);l(ce,U),H.dim.push(U.dim),H.progress.push(U.progress),H.expand.push(U.expand)}return H}function I(F){for(let H of r)H.startTime=F}function T(){if(!r.length)return;for(let F of r)F.cancel();r=[]}function B(){for(let F of o.values())F.cancel();o.clear()}function X(){c=!0,T(),B(),e.backdrop()?.style.removeProperty("opacity"),s?.cancel();for(let F of ni.slice(0,3))e.sheet.style.removeProperty(F);for(let F of e.outlets()){for(let H of ni.slice(0,3))F.el.style.removeProperty(H);for(let H of Object.keys(F.keyframes??{}))F.el.style.removeProperty(Oc(H))}}return{configure:a,compute:l,apply:f,play:d,sync:I,follow:d,stop:T,destroy:X}}function Am(e){return`linear(${e.map(Er).join(", ")})`}function Oc(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}var Cc=16.666666666666668,ni,ri,cn=()=>typeof CSS<"u"&&CSS.supports("animation-timing-function","linear(0, 1)"),Er=(e)=>Math.round(e*1e4)/1e4,Mc,Pc=(e)=>e;var un=be(()=>{Ec();De();ni=["--drawer-progress","--drawer-dim","--drawer-expand","--drawer-stack"],ri=new WeakSet;Mc={pseudoElement:"::backdrop"}});function Cm(e,t,n=0,r=e.length){let o=r-n;if(o<2)return 0;let i=e[r-1];if(o<4)return Lc(e,t,n,r);let s=0,a=0,l=0,c=0,f=0,p=0,u=0,m=0;for(let d=n;d<r;d++){let b=e[d]-i,v=t[d],y=b*b;s+=1,a+=b,l+=y,c+=y*b,f+=y*y,p+=v,u+=v*b,m+=v*y}let g=s*(l*f-c*c)-a*(a*f-c*l)+l*(a*c-l*l);if(Math.abs(g)<0.000000001)return Lc(e,t,n,r);return(s*(u*f-c*m)-p*(a*f-c*l)+l*(a*m-u*l))/g}function Lc(e,t,n,r){let o=0,i=0,s=r-n;for(let c=n;c<r;c++)o+=e[c]/s,i+=t[c]/s;let a=0,l=0;for(let c=n;c<r;c++){let f=e[c]-o;a+=f*(t[c]-i),l+=f*f}return l>0?a/l:0}function Fc(e={}){let{horizon:t,staleAfter:n,maxSpeed:r,capacity:o}={...Em,...e},i=new Float64Array(o),s=new Float64Array(o),a=new Float64Array(o),l=new Float64Array(o),c=0,f=-1;function p(g,A){if(c>0&&g<=i[f])return;f=(f+1)%o,i[f]=g,s[f]=A,c=Math.min(c+1,o)}function u(g){if(c<2)return 0;let A=i[f];if(g-A>n)return 0;let d=0;for(let v=c-1;v>=0;v--){let y=(f-v+o)%o;if(A-i[y]>t)continue;a[d]=i[y],l[d]=s[y],d++}let b=Cm(a,l,0,d);return Math.max(-r,Math.min(r,b))}function m(){c=0,f=-1}return{add:p,velocity:u,reset:m}}var Em;var Rc=be(()=>{Em={horizon:70,staleAfter:40,maxSpeed:8,capacity:20}});function $c(e,t=!1,n){let r=e.defaultView??window,o=(c)=>n===void 0||!("pointerId"in c)||c.pointerId===n,i=(c)=>{if(!o(c))return;c.preventDefault(),c.stopPropagation(),e.removeEventListener("click",i,!0)},s=()=>{e.removeEventListener("click",i,!0),e.removeEventListener("pointerdown",a,!0),e.removeEventListener("pointerup",l,!0),e.removeEventListener("pointercancel",l,!0)},a=(c)=>o(c)&&s(),l=(c)=>o(c)&&r.setTimeout(s);if(e.addEventListener("click",i,!0),e.addEventListener("pointerdown",a,!0),!t)return r.setTimeout(s);e.addEventListener("pointerup",l,!0),e.addEventListener("pointercancel",l,!0)}var Mm,Cr=(e)=>Mm.has(e);var Nc=be(()=>{Mm=new WeakSet});function Wc(e){let{sheet:t}=e,n=t.ownerDocument,r=n.defaultView??window,o=Ce(0,-1),i=0,s=null,a=0,l=0,c=null,f=null,p=null,u=null,m=null,g=null,A=null,d=!1,b=!1,v=null,y=null,I=null,T={x:0,y:0},B=Fc({horizon:e.config().physics.velocityHorizon}),X=[se(n,"touchstart",Q,{capture:!0,passive:!0}),se(n,"touchmove",ne,{capture:!0,passive:!1}),se(n,"touchend",fe,{capture:!0,passive:!0}),se(n,"touchcancel",fe,{capture:!0,passive:!0}),se(t,"pointerdown",le)],F=!1;function H(w){if(F)return;t.style.translate=ln(e.side(),e.size()-w),i=w}function U(w,O){if(F)return;let P=hr(o,w,e.config());o=P.state;let R="time"in w?w.time:performance.now();for(let J of P.effects)te(J,R,O);let K=o.phase==="dragging";if(K===d)return;d=K,e.onDragChange(d)}function te(w,O,P){switch(w.type){case"move":if(c)ae(),H(w.extent),e.onFrame(w.extent);else s=w.extent,x();return;case"settle":return Z(w,O);case"scroll":return a+=w.delta,x();case"fling-scroll":if(m)u={velocity:w.velocity,startTime:O,startScroll:0,area:m};return x();case"snap":return y=w.id,e.onSnap(w.id,w.reason,P);case"dismiss":if(w.reason!=="swipe")return;return p="swipe",e.onDismiss(P);case"attempt-dismiss":return e.onDismissAttempt(P)}}function Z(w,O){ae(),s=null;let P=e.closedExtent(),R=w.from<=0?P:w.from,K=w.to<=0?P:w.to,J=e.reducedMotion()&&(R===P||K===P),oe=e.reducedMotion()?ce(R,K,J):re(R,K,w);if(H(J?Math.max(K,0):K),Math.abs(K-R)<0.5&&w.velocity===0||oe.duration===0)return q();let ie=e.size(),de=e.side();if(c=J?t.animate({opacity:R===P?[0,1]:[1,0]},{duration:oe.duration,fill:"both"}):Math.abs(K-R)<1||!cn()?t.animate({translate:kr(oe,(E)=>ln(de,ie-E))},{duration:oe.duration,fill:"backwards"}):t.animate({translate:[ln(de,ie-R),ln(de,ie-K)]},{duration:oe.duration,easing:oe.easing,fill:"backwards"}),J)f=c;let h=c;c.onfinish=()=>{if(c===h)q()},c.startTime=O,e.onMotion({type:"settle",extentAt:oe.extentAt,startTime:O,duration:oe.duration})}function re(w,O,P){let R=It(P.response,P.dampingRatio,w-O,P.velocity),K=fr(R);return{duration:K,easing:pr(R,w,O,K),extentAt:(J)=>O+R.position(J)}}function ce(w,O,P){let R=P?xc:wc,K=(J)=>1-(1-J)**3;return{duration:R,easing:"cubic-bezier(0.33, 1, 0.68, 1)",extentAt:(J)=>w+(O-w)*K(Math.min(1,J/R))}}function ae(){if(c?.cancel(),c=null,f)f.cancel(),f=null}function q(){if(ae(),U({type:"settled"}),o.phase!=="idle")return;if(o.restingIndex<0)return p=null,y=null,e.onRest(null);y=e.config().snapPoints[o.restingIndex].id,e.onRest(y)}function x(){l||=r.requestAnimationFrame(S)}function S(w){if(l=0,a&&m)Zo(m,e.side(),a),a=0;if(u)M(w);if(s===null)return;H(s),s=null,e.onFrame(i)}function M(w){if(!u)return;let O=Math.max(0,w-u.startTime),P=u.velocity*(oi**O-1)/Math.log(oi);if(Zo(u.area,e.side(),P-u.startScroll),u.startScroll=P,Math.abs(u.velocity*oi**O)<0.01)u=null;else x()}function _(w){return w instanceof Element&&w.closest(Pm)!==null}function N(w){let O=vc(w,t,e.side());return m=O?.area??null,O&&{atStart:O.atStart,atEnd:O.atEnd}}function Q(w){let O=v!==null&&Cr(v);if(v=null,g||w.touches.length>1||p||O)return;if(!e.owns(w.target)||_(w.target))return;let P=w.changedTouches[0];g={id:P.identifier,originX:P.clientX,originY:P.clientY},u=null,B.reset(),yt(e.side(),P.clientX,P.clientY,T),B.add(w.timeStamp,T.y),U({type:"down",time:w.timeStamp,x:T.x,y:T.y,pointer:"touch"},w)}function ne(w){let O=ue(w.changedTouches);if(!O)return;yt(e.side(),O.clientX,O.clientY,T),B.add(w.timeStamp,T.y);let P=o.phase==="dragging",R=N(w.target);if(U({type:"move",time:w.timeStamp,x:T.x,y:T.y,scroll:R},w),o.phase==="pending")return ee(w,O,R);if(o.phase!=="dragging")return;if(w.cancelable)w.preventDefault();else if(!P&&m)m.style.overscrollBehavior="none"}function ee(w,O,P){if(!w.cancelable||!g)return;let R=yt(e.side(),g.originX,g.originY,{x:0,y:0});if(Math.abs(T.y-R.y)<Math.abs(T.x-R.x))return;let K=e.config().snapPoints.at(-1)?.extent??0;if((P?cr({towardMore:T.y<R.y,scrollAtStart:P.atStart,atLargest:i>=K-0.5,expandOnScroll:e.config().expandOnScroll}):"sheet")==="sheet")w.preventDefault()}function fe(w){if(!ue(w.changedTouches))return;if(g=null,m)m.style.removeProperty("overscroll-behavior");let O=w.type==="touchcancel"?0:B.velocity(w.timeStamp);U({type:"up",time:w.timeStamp,velocity:O},w)}function ue(w){if(!g)return null;for(let O=0;O<w.length;O++)if(w[O].identifier===g.id)return w[O];return null}function le(w){if(v=w,w.pointerType==="touch"||w.button!==0||A!==null||p)return;let O=w.target;if(!e.owns(O)||_(O)||!(O instanceof Element)||!e.canMouseDrag(O))return;A=w.pointerId,b=!1,I=o.phase==="settling"&&o.targetIndex>=0?y:null,u=null,B.reset(),yt(e.side(),w.clientX,w.clientY,T),B.add(w.timeStamp,T.y),z=[se(n,"pointermove",k,{capture:!0}),se(n,"pointerup",L,{capture:!0}),se(n,"pointercancel",L,{capture:!0})];let P=w.pointerType==="pen"?"pen":"mouse";U({type:"down",time:w.timeStamp,x:T.x,y:T.y,pointer:P},w)}let z=[];function k(w){if(w.pointerId!==A)return;if(v&&Cr(v))return D(w,0,I);let O=w.getCoalescedEvents?.();for(let P of O?.length?O:[w])B.add(P.timeStamp,yt(e.side(),P.clientX,P.clientY,T).y);if(yt(e.side(),w.clientX,w.clientY,T),U({type:"move",time:w.timeStamp,x:T.x,y:T.y,scroll:N(w.target)},w),o.phase!=="dragging"||b)return;b=!0,n.getSelection()?.removeAllRanges(),t.style.userSelect="none";try{t.setPointerCapture(w.pointerId)}catch{}}function L(w){if(w.pointerId!==A)return;if(v&&Cr(v))return D(w,0,I);D(w,w.type==="pointercancel"?0:B.velocity(w.timeStamp))}function D(w,O,P=null){A=null,v=null,z.forEach((J)=>J()),z=[],t.style.removeProperty("user-select");let R=w.timeStamp,K=e.config().snapPoints.findIndex((J)=>J.id===P);if(P!==null&&K>=0)o=Ce(o.extent,K),U({type:"snap-to",time:R,id:P,reason:"imperative"});else U({type:"up",time:R,velocity:O},w);if(b)$c(n)}return{open(w,O){p=null,y=w,ae();let P=e.config().snapPoints.findIndex((K)=>K.id===w);if(!O&&P>=0)return o=Ce(e.config().snapPoints[P].extent,P),H(o.extent),e.onRest(w);o=Ce(0,-1),H(e.closedExtent()),U({type:"snap-to",time:performance.now()+wr,id:w,reason:"imperative"});let R=c;if(!R)return;xr(r,(K)=>{if(c!==R||o.phase!=="settling")return;R.startTime=K,o={...o,startTime:K},e.onMotionStart(K)})},close(){let w=p;if(p="close",!w)U({type:"close",time:performance.now()})},snapTo(w,O){if(p==="close")return;if(p=null,U({type:"snap-to",time:performance.now(),id:w,reason:O}),o.phase==="settling")y=e.config().snapPoints[o.targetIndex]?.id??y},nudge(){if(!p&&!e.reducedMotion())U({type:"nudge",time:performance.now()})},relayout(w,O){let P=e.config().snapPoints;if(p||y===null||o.phase==="dragging"||o.phase==="pending")return H(i);let R=P.findIndex((de)=>de.id===y),K=P.findIndex((de)=>de.id===O),J=R>=0?R:K>=0?K:Ye(P.map((de)=>de.extent),i),{id:oe,extent:ie}=P[J];if(o.phase==="idle"){let de=Math.min(i,e.size());if(o=Ce(de,R),w||Math.abs(ie-de)<0.5){if(o=Ce(ie,J),H(ie),!w&&oe===y){e.onFrame(ie);return}if(oe!==y)te({type:"snap",id:oe,reason:"content-resize"},performance.now());return e.onRest(oe)}}U({type:"snap-to",time:performance.now(),id:oe,reason:"content-resize"})},target:()=>p?null:y,isMoving:()=>o.phase!=="idle",destroy(){if(F=!0,ae(),l)r.cancelAnimationFrame(l);if(X.forEach((w)=>w()),z.forEach((w)=>w()),d)e.onDragChange(!1);for(let w of["translate","user-select","opacity"])t.style.removeProperty(w)}}}var oi=0.998,Pm='input, textarea, select, [contenteditable]:not([contenteditable="false"]), [data-drawer-no-drag]';var Vc=be(()=>{Ko();gr();ur();mr();Rc();Pe();Nc();ei();Ar();un()});function Hc(e){let{sheet:t,host:n}=e,r=t.ownerDocument,o=r.defaultView??window,i=Ce(0,-1),s=0,a=[],l=null,c=!1,f=!1,p=!1,u=null,m,g=0,A=0,d=null,b=new Map,v=new Map,y=null,I=bt(n,{inset:`0 0 calc(var(--keyboard-inset, 0px) - ${Be}px) 0`,display:"block","overflow-y":"scroll","overflow-x":"hidden","scroll-snap-type":"y mandatory","scrollbar-width":"none","overscroll-behavior":"contain","pointer-events":"auto"}),T=bt(t,{position:"absolute",left:"0",right:"0"}),B="onscrollend"in n,X=o.ScrollTimeline,F=[se(n,"scroll",x,{passive:!0}),...B?[se(n,"scrollend",N)]:[],se(n,"touchstart",()=>{if(c=!0,f=!1,l&&!u)ee()},{passive:!0}),se(n,"touchend",M,{passive:!0}),se(n,"touchcancel",M,{passive:!0})],H=at()?1:Be+1,U=new IntersectionObserver(Q,{root:n,rootMargin:`0px 0px -${H}px 0px`,threshold:0});U.observe(t);let te=()=>e.config().dimension,Z=()=>e.config().snapPoints.at(-1)?.extent??0,re=()=>Z()+Om-s,ce=()=>Math.min(n.scrollTop+s,Z());function ae(){let D=e.config();s=D.dismissible?-Be:D.snapPoints[0].extent,t.style.top=`${te()-s}px`;for(let P of a)P.remove();let w=D.snapPoints.map((P)=>P.extent);a=(D.dismissible?[s,...w]:w).map((P)=>q(P-s,"start")),a.push(q(re()+n.clientHeight-1,"none")),n.append(...a);for(let P of b.keys())if(!t.contains(P))b.delete(P),v.delete(P);for(let P of Im(t)){if(!b.has(P))b.set(P,[P.style.getPropertyValue("overflow-y"),P.style.getPropertyPriority("overflow-y")]);if(!v.has(P)&&!Dm(P,t))v.set(P,Ne(P,"overscroll-behavior","auto"))}}function q(D,w){let O=r.createElement("div");return O.setAttribute("aria-hidden","true"),O.style.cssText=`position:absolute;left:0;width:1px;height:1px;top:${D}px;scroll-snap-align:${w};pointer-events:none`,O}function x(){if(l||u)return;if(y&&c&&Math.abs(n.scrollTop-y.offsetTop)>1)fe();if(c&&!p)_(!0);if(!X)A||=o.requestAnimationFrame(S);if(o.clearTimeout(g),!B&&!c)g=o.setTimeout(N,qc)}function S(){A=0,e.onFrame(ce())}function M(){if(c=!1,_(!1),y){fe();let D=e.config().snapPoints,w=Ye(D.map((O)=>O.extent),ce());return L(D[w].id,"swipe")}if(!e.config().dismissible&&n.scrollTop<-2)e.onDismissAttempt();if(f||!B)g=o.setTimeout(N,qc);f=!1}function _(D){if(p===D)return;p=D,e.onDragChange(D)}function N(){if(c){f=!0;return}if(l||u)return;let D=e.config();if(D.dismissible&&d!==null&&n.scrollTop+s<=Tm-Be)return ne();let w=hr(i,{type:"rest",extent:ce()},D);i=w.state;for(let O of w.effects)if(O.type==="snap")d=O.id,e.onSnap(O.id,O.reason);if(i.restingIndex>=0)z(D.snapPoints[i.restingIndex].id)}function Q(D){if(D[D.length-1].isIntersecting||l||u||d===null||!e.config().dismissible)return;ne()}function ne(){u="swipe",d=null,e.onDismiss()}function ee(){if(!l)return;let D=Math.max(0,l.extentAt(performance.now()-l.startTime)-s);le(),y=q(D,"start"),n.append(y),n.scrollTop=D,S(),k()}function fe(){y?.remove(),y=null}function ue(D,w,O,P){le();let R=e.config().physics,K=It(R.response,R.dampingRatio,w-D,0),J=Math.max(1,fr(K)),oe=Math.max(s,D);n.scrollTop=oe-s;let ie=(C)=>D+K.position(Math.max(0,C)),de=Math.abs(D-w)<0.5,h=!de&&!cn(),E=t.animate({translate:h?kr({duration:J,extentAt:ie},(C)=>`0 ${oe-C}px`):[`0 ${oe-w}px`,`0 ${oe-D}px`]},{duration:J,easing:de||h?"linear":pr(K,w,D,J),fill:"both"});E.startTime=O,l={animation:E,to:D,extentAt:ie,startTime:O},e.onMotion({type:"settle",extentAt:ie,startTime:O,duration:J}),E.onfinish=()=>{if(l?.animation!==E)return;if(l=null,P(),E.cancel(),at()){let{minHeight:C}=t.style;t.style.minHeight=`${t.offsetHeight+1}px`,n.scrollHeight,t.style.minHeight=C}}}function le(){l?.animation.cancel(),l=null}function z(D){let w=e.config(),O=w.snapPoints.findIndex((R)=>R.id===D);i=Ce(w.snapPoints[O].extent,O),d=D,n.style.pointerEvents=e.isInteractive(D)?"none":"auto";let P=O===w.snapPoints.length-1;for(let[R,[K,J]]of b)if(P)R.style.setProperty("overflow-y",K,J);else R.style.overflowY="hidden";e.onRest(D),k()}function k(){if(!X)return;let D=re(),w=new X({source:n,axis:"block"});e.onMotion({type:"timeline",timeline:w,extentAt:(O)=>Math.min(Z(),O*D+s)})}function L(D,w){let O=e.config().snapPoints.find((R)=>R.id===D);if(!O||u==="close")return;if(u=null,D!==d)d=D,e.onSnap(D,w);let P=l?l.extentAt(performance.now()-l.startTime):ce();ue(O.extent,P,performance.now(),()=>z(D))}return{open(D,w){u=null,m?.(),d=D,ae();let O=e.config().snapPoints.find((R)=>R.id===D);if(!O)return;if(!w)return n.scrollTop=O.extent-s,z(D);ue(O.extent,-Be,performance.now()+wr,()=>z(D));let P=l;xr(o,(R)=>{if(!P||l!==P)return;P.animation.startTime=R,P.startTime=R,e.onMotionStart(R)})},close(){let D=u;if(u="close",D)return;d=null,m=Ne(n,"overflow-y","hidden");let w=l?l.extentAt(performance.now()-l.startTime):ce();ue(-Be,w,performance.now(),()=>e.onRest(null))},snapTo:L,nudge(){if(u||e.reducedMotion()||d===null)return;let D=e.config().snapPoints.find((w)=>w.id===d);if(D)ue(D.extent,D.extent-20,performance.now(),()=>z(D.id))},relayout(D,w){if(u||c)return;let O=e.config().snapPoints,P=O.findIndex((ie)=>ie.id===d),R=O.findIndex((ie)=>ie.id===w),K=P>=0?P:R>=0?R:Ye(O.map((ie)=>ie.extent),ce()),J=s;ae();let oe=O[K];if(oe.id!==d)d=oe.id,e.onSnap(oe.id,"content-resize");if(l){let ie=l,de=performance.now();if(ie.to!==oe.extent||s!==J)ue(oe.extent,ie.extentAt(de-ie.startTime),Math.max(de,ie.startTime),()=>z(oe.id)),l=Object.assign(ie,l);return}n.scrollTop=oe.extent-s,z(oe.id)},target:()=>u?null:d,isMoving:()=>!!l||p,destroy(){if(le(),fe(),o.clearTimeout(g),A)o.cancelAnimationFrame(A);U.disconnect(),F.forEach((D)=>D());for(let D of a)D.remove();for(let[D,[w,O]]of b)D.style.setProperty("overflow-y",w,O);if(v.forEach((D)=>D()),p)e.onDragChange(!1);t.style.removeProperty("top"),m?.(),T(),I()}}}function Dm(e,t){let n=e.closest("[popover]");return!!n&&n!==t&&t.contains(n)}function Im(e){let t=e.ownerDocument.defaultView??window;return Array.from(e.querySelectorAll("*")).filter((n)=>/auto|scroll/.test(t.getComputedStyle(n).overflowY))}var qc=120,Om=24,Tm=2;var jc=be(()=>{gr();ur();mr();Pe();Ve();De();Ar();un()});function Lm(e){let t=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/.exec(e);return t?[t[1],t[2],t[3]].map(Number):null}function Kc(e,t){let n=Array.from(e.querySelectorAll('meta[name="theme-color"]')),r=n.map((l)=>l.content),o=r.map((l)=>Lm(Fm(e,l))),i=-1;function s(l){let c=Math.round(l*t*100)/100;if(c===i)return;i=c,n.forEach((f,p)=>{let u=o[p];if(!u)return;f.content=c?`rgb(${u.map((m)=>Math.round(m*(1-c))).join(" ")})`:r[p]})}function a(){n.forEach((l,c)=>l.content=r[c]),i=-1}return{write:s,restore:a}}function Fm(e,t){let n=e.createElement("span");n.style.color=t,n.style.display="none",e.body.append(n);let r=e.defaultView?.getComputedStyle(n).color??t;return n.remove(),r}var Bc=()=>{};function Nm(e){return{side:()=>"bottom",snapPoints:()=>["content"],snapPoint:()=>null,dismissible:()=>!0,modalAbove:()=>{return},driver:()=>"auto",expandOnScroll:()=>!0,physics:()=>{return},backdrop:()=>{return},hostBackdrop:!1,outlets:()=>[],parent:()=>{return},themeColor:()=>!1,preventEdgeSwipe:()=>!1,canMouseDrag:$m,onSnap:dn,onRest:dn,onDismissAttempt:dn,onDragChange:dn,onLayout:dn,...Wm(e)}}function Wm(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}function Yc(e){for(let t=e.parent;t;t=t.parent){let n=Mr.get(t);if(n)return n}}function Vm(e){for(let t=e instanceof Element?e:null;t;){if(ii.has(t))return t;let n=t.getRootNode();t=t.parentElement??(n instanceof ShadowRoot?n.host:null)}return null}function qm(e,t){let n=e.closest("[popover]");return!!n&&n!==t&&t.contains(n)}function Hm(e,t){let n=t.driver();if(n!=="auto")return n==="scroll-snap";return t.modalAbove()===void 0&&t.expandOnScroll()&&!!e.matchMedia?.("(hover: none) and (pointer: coarse)").matches}function Xc(e,t){let n=Nm(t),{host:r}=n,o=e.ownerDocument,i=o.defaultView??window,s=i.matchMedia?.("(prefers-reduced-motion: reduce)"),a=Qo(n.side(),e),l=[],c=0,f,p=yr.ios,u,m,g={snapPoints:[],dimension:0,dismissible:!0,expandOnScroll:!0,physics:p,contentScroll:ac},A=a==="bottom"&&Hm(i,n);ii.add(e);let d=_c(r,a,e),b=[Uc(r,a,d),Km(e,A)],v=[],y=Ic({sheet:e,backdrop:n.backdrop,dimmed:n.hostBackdrop?r:void 0,outlets:n.outlets,ancestors:()=>v,themeColor:(z)=>u?.write(z)});function I(){let z=n.physics();if(z!==f)f=z,p=z?{...yr.ios,...z}:yr.ios;return g.physics=p,g.dismissible=n.dismissible(),g.expandOnScroll=n.expandOnScroll(),g}let T=!1;function B(){T=!0;let z=Qo(n.side(),e),k=_c(r,z,e);if(z!==a||k!==d)a=z,d=k,b[0](),b[0]=Uc(r,a,d);let L=r.clientHeight-(A?Be:0),D=r.clientWidth,w=Ke(a)?L:D;e.style.setProperty("--available-height",`${L}px`),e.style.setProperty("--available-width",`${D}px`),ae??=i.visualViewport?.height,c=bc(e,a);let O=parseFloat(i.getComputedStyle(o.documentElement).fontSize)||16,P=uc(n.snapPoints(),{container:w,content:c,rootFontSize:O});if(!P.length)P.push({id:"content",value:"content",extent:c,ids:["content"]});let R=w!==g.dimension||P.length!==l.length||P.some((K,J)=>K.id!==l[J].id||Math.abs(K.extent-l[J].extent)>=0.5);if(l=P,g.dimension=w,g.snapPoints=l.map(({id:K,extent:J})=>({id:K,extent:J})),y.configure({snapExtents:g.snapPoints.map((K)=>K.extent),undimmedIndex:gt(l,n.modalAbove())}),R)te();return R}let X=!1,F=(z)=>z===null?null:l.find((k)=>k.id===z)?.value??null,H={sheet:e,host:r,side:()=>a,config:I,size:()=>c,closedExtent:()=>Sr(a),reducedMotion:()=>!!s?.matches,owns:(z)=>Vm(z)===e,canMouseDrag:n.canMouseDrag,onSnap:(z,k,L)=>{let D=F(z);if(D!==null)n.onSnap(D,k,L)},onRest(z){if(X)return;let k=l.find((L)=>L.id===z);if(y.apply(k?.extent??Sr(a),{rest:!0}),n.onRest(F(z)),Q&&z!==null)ee();Q=!1},onDismiss:n.onDismiss,onDismissAttempt:n.onDismissAttempt,onDragChange:n.onDragChange,isInteractive:(z)=>le.isInteractiveAt(F(z)),onFrame:(z)=>X||y.apply(z),onMotion:(z)=>X||y.play(z),onMotionStart:(z)=>X||y.sync(z)},U=!0;function te(){if(!U)return n.onLayout({side:a,snapPoints:l});queueMicrotask(()=>X||n.onLayout({side:a,snapPoints:l}))}I();let Z=A?Hc(H):Wc(H);e.setAttribute("data-driver",A?"scroll-snap":"pointer"),U=!1;let re=new ResizeObserver(()=>{fe(!1)});re.observe(e),re.observe(r);let ce=0,ae,q=null,S=[mc(r,{before:()=>ce=e.getBoundingClientRect().top,after:M}),...n.preventEdgeSwipe()?[se(o,"touchstart",_,{capture:!0,passive:!1})]:[],...at()?[se(o,"touchend",N,{capture:!0,passive:!1})]:[],se(e,"focusin",ne)];function M(){fe(!0),ee();let z=i.visualViewport?.height;if(z===ae)return;ae=z,q?.cancel(),q=null;let k=ce-e.getBoundingClientRect().top;if(Math.abs(k)<1||s?.matches)return;q=r.animate({translate:[`0 ${k}px`,"0 0"]},jm)}function _(z){if(!z.cancelable)return;let k=z.touches[0];if(!k||k.clientX>zc&&k.clientX<i.innerWidth-zc)return;let L=z.target;if(L&&(r.contains(L)||n.backdrop()?.contains(L)))z.preventDefault()}function N(z){let k=z.target;if(!(k instanceof HTMLInputElement||k instanceof HTMLTextAreaElement))return;if(!e.contains(k)||k===o.activeElement||Z.isMoving()||!z.cancelable)return;z.preventDefault(),k.focus({preventScroll:!0})}let Q=!1;function ne(){if(Z.isMoving())Q=!0;else ee()}function ee(){let z=o.activeElement;if(!(z instanceof HTMLElement)||!e.contains(z)||z===e||qm(z,e))return;let k=Jo(z,e,"bottom");if(!k)return;let L=i.visualViewport,D=Math.min(k.getBoundingClientRect().bottom,L?L.offsetTop+L.height:i.innerHeight),{top:w,bottom:O}=z.getBoundingClientRect(),P=16,R=k.getBoundingClientRect().top,K=O+P>D?O+P-D:w-P<R?w-P-R:0;if(K)k.scrollBy({top:K,behavior:s?.matches?"instant":"smooth"})}function fe(z){let k=!T;if(B()&&!k)Z.relayout(z,l[gt(l,n.snapPoint())]?.id)}function ue(z){let k=gt(l,z);return l[k>=0?k:0]?.id}let le={element:e,parent:n.parent,open(z){if(X)return;v=[];for(let L=n.parent();L;L=L.parent())v.push(L.element);if(B(),I(),n.themeColor())u??=Kc(o,p.dim);if(z)y.apply(Sr(a));m?.();let k=n.backdrop();m=k&&bt(k,{"will-change":"opacity"}),Z.open(ue(n.snapPoint()),z)},close:()=>X||Z.close(),snapTo(z,k){let L=gt(l,z);if(L>=0&&l[L].id!==Z.target())Z.snapTo(l[L].id,k)},nudge:()=>Z.nudge(),snapPoints:()=>l,target:()=>F(Z.target()),isInteractiveAt:(z)=>dc(l,z,n.modalAbove()),refresh(){fe(!1)},destroy(){X=!0,re.disconnect(),q?.cancel(),S.forEach((z)=>z()),Z.destroy(),y.destroy(),m?.(),u?.restore(),b.forEach((z)=>z()),e.style.removeProperty("--available-height"),e.style.removeProperty("--available-width"),e.removeAttribute("data-driver"),ii.delete(e)}};return le}function Uc(e,t,n){let r=Ke(t);return bt(e,{position:"fixed",inset:"0 0 var(--keyboard-inset, 0px) 0",width:"auto",height:"auto","max-width":"none","max-height":"none",margin:"0",padding:"0",border:"0",background:"transparent",color:"inherit",overflow:"visible",display:"flex","flex-direction":r?"column":"row","justify-content":n?"flex-end":"flex-start","pointer-events":"none"})}function Km(e,t){return bt(e,{"pointer-events":"auto","overscroll-behavior":t?"auto":"contain","will-change":"translate"})}var Rm='a[href], button, label, summary, [role="button"], [role="link"], [role="slider"], [tabindex]:not([tabindex="-1"])',$m=(e)=>!e.closest(Rm),dn=()=>{},ii,Mr,zc=24,jm,_c=(e,t,n)=>Ke(t)?t==="bottom":t==="right"!==(n.ownerDocument.defaultView?.getComputedStyle(e).direction==="rtl");var Gc=be(()=>{lc();cc();fc();Pe();gc();Ve();ei();Ar();un();Vc();jc();Bc();ii=new WeakSet,Mr=new WeakMap;jm={duration:250,easing:"cubic-bezier(0.38, 0.7, 0.125, 1)"}});var Qc={};Hd(Qc,{prepareVariables:()=>Dc,presentSheet:()=>Um});function Bm(e){let t=e.getAttribute("data-slot");if(!t)return;Te(e.ownerDocument,`ui-sdk-sheet-${t}`,`@layer ui-sdk { :where([data-slot="${t}"])::backdrop { background: var(--sheet-backdrop, rgb(0 0 0 / 0.2)); pointer-events: auto } }`)}function zm(e,t){let n=[],r=(o)=>{for(let i of Array.from(o.children)){if(t.includes(i))continue;if(t.some((s)=>s&&i.contains(s)))r(i);else if(i instanceof HTMLElement)n.push(Ne(i,"display","none"))}};return r(e),()=>n.forEach((o)=>o())}function _m(e,t,n){let r,o=t.bind(e,{...n,position:void 0,inline:!0,onShow(){let[i,s]=n.drillIn();if(i)r=zm(i,[e,s]);return()=>r?.()},onClose(){r?.(),r=Ne(e,"display","none")}});return()=>{o(),r?.()}}function Um(e,t,n){if(n.drillIn)return _m(e,t,n);let r=e.parentElement;if(!r)return;Bm(r);let o;return t.bind(e,{...n,position:void 0,host:()=>r,onShow(i){let s=Ym(e,r,t,n,i);return o=s.sheet,()=>{s.hide(),o=void 0}},onClose:()=>o?.close()})}function Ym(e,t,n,r,o){let i=null,s=Yc(o),a=!r.backdrop?.(),l=Xc(e,{host:t,snapPoints:()=>r.snapPoints??["content"],snapPoint:()=>i,backdrop:r.backdrop,hostBackdrop:a,dismissible:r.dismissible,onDismissAttempt:r.onDismissAttempt,parent:()=>s?.(),onSnap:(p)=>i=p,onDismiss(p){n.requestClose("swipe",p),requestAnimationFrame(()=>{let u=i??l.snapPoints()[0]?.value;if(o.active()&&u!==void 0)l.snapTo(u,"imperative")})}});Mr.set(o,()=>l),r.onSheet?.(l);let c=se(e,"focusin",(p)=>{let u=l.snapPoints().at(-1);if(u&&l.snapPoints().length>1&&p.target.matches("input, textarea"))l.snapTo(u.value,"imperative")}),f=a?getComputedStyle(e).getPropertyValue("--sheet-backdrop"):"transparent";if(f)t.style.setProperty("--sheet-backdrop",f);if(o.active())l.open(n.opener()!=="initial");return{sheet:l,hide(){c(),Mr.delete(o),l.destroy(),r.onSheet?.(void 0),t.style.removeProperty("--sheet-backdrop")}}}var Jc=be(()=>{Pe();De();Gc();un()});class xt extends Error{name="AdressevaelgerError";status;url;constructor(e,t){super(e);this.status=t.status,this.url=jd(t.url)}}function jd(e){return e.replace(/([?&]token=)[^&]*/i,"$1***")}function Ht(e){return e instanceof Error&&e.name==="AbortError"}function Vr(e){let t=e.vejnavn??e.vejNavn??"",n=e.husnummer??e.husNummer??"";switch(e.type){case"vejnavn":return{type:"streetName",label:e.titel,streetName:t||e.titel};case"vejnavnhusnummer":return{type:"streetNameNumber",label:e.titel,streetName:t,houseNumber:n};case"navngivenvejpostnummer":if(!e.id)return null;return{type:"street",id:e.id,label:e.titel,streetName:t,postalCode:e.postnr??"",postalDistrict:e.postdistrikt??"",accessAddressCount:e.antal_husnumre??0};case"husnummer":if(!e.id)return null;return{type:"accessAddress",id:e.id,label:e.titel,streetName:t,houseNumber:n};case"adresse":if(!e.id)return null;return{type:"address",id:e.id,label:e.titel,accessAddressId:e.husnummerId??""};default:return null}}function Vi(e){return{validFrom:e.virkningfra,validTo:e.virkningtil,registeredFrom:e.registreringfra,registeredTo:e.registreringtil}}function St(e){let t=e.adgangspunkt?.koordinater??null;return{type:"accessAddress",id:e.id_lokalid,label:e.adgangsadressebetegnelse,houseNumber:e.husnummertekst,streetName:e.vejnavn,statusCode:e.status,position:t?{x:t.x,y:t.y,crs:"EPSG:25832"}:null,postalCode:{id:e.postnummer.id_lokalid,code:e.postnummer.postnr,name:e.postnummer.navn},municipalityCode:e.navngivenvejkommunedel?.kommune??null,roadCode:e.navngivenvejkommunedel?.vejkode??null,streetId:e.navngivenvejpostnummer?.id_lokalid??null,namedRoadId:e.navngivenvej?.id_lokalid??null,supplementaryTownName:e.supplerendebynavn?.navn??null,...Vi(e),raw:e}}function jt(e){return{type:"address",id:e.id_lokalid,label:e.adressebetegnelse,floor:e.etagebetegnelse,door:e.doerbetegnelse,statusCode:e.status,accessAddress:St(e.husnummer),...Vi(e),raw:e}}function qr(e){return{type:"street",id:e.id,label:e.titel,streetName:e.vejnavn,postalCode:e.postnr,postalDistrict:e.postdistrikt,postalCodeId:e.postnummer,accessAddressCount:e.antal_husnumre,geometry:e.geometri?{type:"MultiLineString",coordinates:e.geometri.coordinates,crs:"EPSG:25832"}:null,raw:e}}function Kt(e){return"id"in e?`${e.type}:${e.id}`:`${e.type}:${e.label}`}var Kd=/[^\p{L}\p{N}\s.,'-]/gu;function ot(e){return e.replace(Kd," ").replace(/\s+/g," ").trim().slice(0,73).trimEnd()}function Hr(e){let t=String(e).trim();if(!/^\d{1,4}$/.test(t))throw RangeError(`Municipality code must be 1 to 4 digits, got "${t}"`);return t.padStart(4,"0")}var qi="adressevaelger123",Hi="https://adressevaelger.dk",jr=200;function Sn(e={}){let t=e.token??qi,n=(e.baseUrl??Hi).replace(/\/+$/,""),r=e.fetch??((s,a)=>globalThis.fetch(s,a));async function o(s,a,l){let f=[...a,["token",t]].map(([d,b])=>`${d}=${encodeURIComponent(b)}`).join("&"),p=`${n}/${s}?${f}`,u=await r(p,{signal:l,headers:{accept:"application/json"}});if(u.status===404)return null;let m=await u.text();if(!u.ok)throw new xt(m.trim()||u.statusText||`HTTP ${u.status}`,{status:u.status,url:p});let g;try{g=JSON.parse(m)}catch{throw new xt(`Expected JSON from KDS, got: ${m.slice(0,200)}`,{status:u.status,url:p})}if(g.status==="fejl"){let d=g.beskrivelse;throw new xt(typeof d==="string"?d:"KDS returned an error",{status:u.status,url:p})}return g}function i(s,a){let l=new Map(s.map((c)=>[c.id,c]));return a.flatMap((c)=>l.get(c)??[])}return{async search(s,a={}){let l=ot(s);if(!l)return[];let c=[["tekst",l]];if(a.limit!==void 0){let{limit:u}=a;if(!Number.isInteger(u)||u<1||u>jr)throw RangeError(`limit must be an integer from 1 to ${jr}, got ${u}`);c.push(["maksimum",String(u)])}if(a.municipalityCodes?.length)c.push(["kommunekode",a.municipalityCodes.map(Hr).join(",")]);if(a.includeProvisional)c.push(["medtagforeloebige","true"]);let f=(a.kind??"address")==="address"?"adresser":"husnumre";return((await o(`${f}/soeg`,c,a.signal))?.fund??[]).flatMap((u)=>Vr(u)??[])},async getAddress(s,a={}){let l=await o(`adresser/${encodeURIComponent(s)}`,[],a.signal);return l?jt(l.adresse):null},async getAddresses(s,a={}){if(s.length===0)return[];let l=await o("adresser",[["id_lokalids",s.join(",")]],a.signal);return i((l?.adresser??[]).map(jt),s)},async getAccessAddress(s,a={}){let l=await o(`husnumre/${encodeURIComponent(s)}`,[],a.signal);return l?St(l.husnummer):null},async getAccessAddresses(s,a={}){if(s.length===0)return[];let l=await o("husnumre",[["id_lokalids",s.join(",")]],a.signal);return i((l?.husnumre??[]).map(St),s)},async getAccessAddressUnits(s,a={}){return((await o(`husnumre/${encodeURIComponent(s)}/adresser`,[],a.signal))?.adresser??[]).map(jt)},async getStreet(s,a={}){let l=await o(`navngivenvejpostnumre/${encodeURIComponent(s)}`,[],a.signal);return l?qr(l.navngivenvejpostnummer):null},async getStreetAccessAddresses(s,a={}){return((await o(`navngivenvejpostnumre/${encodeURIComponent(s)}/husnumre`,[],a.signal))?.husnumre??[]).map(St)}}}var Bd=new Intl.Collator("da",{numeric:!0,sensitivity:"base"});function ji(e,t){let n=t.trim().toLowerCase();if(!n)return[];return e.filter((r)=>r.houseNumber.toLowerCase().startsWith(n)).toSorted((r,o)=>Bd.compare(r.houseNumber,o.houseNumber)).map((r)=>({type:"accessAddress",id:r.id,label:r.label,streetName:r.streetName,houseNumber:r.houseNumber}))}function Ki(e,t,n){let r=new Set;for(let i of e){if("id"in i)r.add(i.id);if(i.type==="address")r.add(i.accessAddressId)}let o=t.filter((i)=>!("id"in i)||!r.has(i.id));return[...e,...o].slice(0,n)}function Bi(e,t,n,r){return{action:"refine",value:e+t,caret:e.length,template:r?{before:e,after:t,kind:n,streetId:r}:{before:e,after:t,kind:n}}}function Kr(e){return{action:"refine",value:e,caret:e.length,template:null}}function zi(e){return{action:"complete",value:e,caret:e.length}}function _i(e,t){switch(e.type){case"streetName":return Kr(`${e.streetName} `);case"streetNameNumber":return Kr(e.label);case"street":return Bi(`${e.streetName} `,`, ${e.postalCode} ${e.postalDistrict}`,"houseNumber",e.id);case"accessAddress":{if(t==="accessAddress")return zi(e.label);let n=`${e.streetName} ${e.houseNumber}, `;if(!e.label.startsWith(n))return Kr(e.label);return Bi(n,`, ${e.label.slice(n.length)}`,"unit")}case"address":return zi(e.label)}}function Br(e,t){let{before:n,after:r}=t;if(e.length<n.length+r.length)return null;if(!e.startsWith(n)||!e.endsWith(r))return null;let o=n.length,i=e.length-r.length;return{start:o,end:i,kind:t.kind,text:e.slice(o,i)}}var zd=100,Ui={value:"",caret:null,slot:null,suggestions:[],status:"idle",error:null,open:!1,selection:null,fields:{},expanded:!1};function zr(e,t={}){return Object.fromEntries((e?.fields??[]).map(({name:n})=>[n,t[n]??""]))}function _d(e){return(e.type==="address"?e.accessAddress:e).postalCode.code}function _r(e={}){let t=e,n,r=()=>t.client??(n??=Sn()),o=()=>t.kind??"address",i=()=>t.fields,s=()=>t.fields?t.searchField:void 0,a={...Ui,fields:zr(t.fields)},l=null,c=new Set,f=null,p=[],u=null,m,g,A,d=0,b=0,v=new Map;function y(q){a={...a,...q};let x=s();if(x!==void 0&&a.fields[x]!==a.value)a={...a,fields:{...a.fields,[x]:a.value}};for(let S of c)S()}function I(q){let x=s();if(l&&x!==void 0)return l.fields[x]===q;return a.selection?.suggestion.label===q}function T(q,x){let S=x.format(q);l={fields:S,postalCode:_d(q)};let M=s(),_=M===void 0?void 0:S[M];return _===void 0?{fields:S,expanded:!0}:{fields:S,expanded:!0,value:_,caret:X(_.length)}}function B(q){let x=s();if(!l||x===void 0||/\b\d{4}\b/.test(q))return q;let S=i()?.fields.find((M)=>M.parts.includes("postalCode"));if(!S||S.name===x)return q;if(a.fields[S.name]!==l.fields[S.name])return q;return`${q}, ${l.postalCode}`}function X(q){return b+=1,{position:q,revision:b}}function F(q){if(t.houseNumberPrefix===!1||q?.kind!=="houseNumber"||!f?.streetId)return[];let x=v.get(f.streetId);return Array.isArray(x)?ji(x,q.text):[]}function H(){let q=u===a.value?p:[];return Ki(q,F(a.slot),t.limit??zd)}function U(q){if(v.has(q))return;v.set(q,"loading"),r().getStreetAccessAddresses(q).then((x)=>{if(v.set(q,x),f?.streetId===q&&a.slot?.kind==="houseNumber")y({suggestions:H()})},()=>{v.delete(q)})}function te(){clearTimeout(m),m=void 0,g?.abort(),g=void 0,d+=1}function Z(q){clearTimeout(m),m=void 0;let x=a.value;if(!ot(x)){te(),p=[],u=x,y({suggestions:[],status:"idle",error:null,open:!1});return}let S=t.debounceMs??100;if(q||S<=0)re(x);else m=setTimeout(()=>void re(x),S)}async function re(q){m=void 0,g?.abort();let x=new AbortController;g=x,d+=1;let S=d;y({status:"loading",error:null});try{let M=await r().search(B(q),{kind:o(),limit:t.limit,municipalityCodes:t.municipalityCodes,includeProvisional:t.includeProvisional,signal:x.signal});if(S!==d||q!==a.value)return;p=M,u=q,y({status:"success",suggestions:H()})}catch(M){if(S!==d||Ht(M)||q!==a.value)return;p=[],u=q,y({status:"error",error:M,suggestions:H(),expanded:a.expanded||i()!==void 0})}finally{if(g===x)g=void 0}}async function ce(q){A?.abort();let x=new AbortController;A=x;let S=()=>!x.signal.aborted&&a.selection?.suggestion===q;try{let M=q.type==="address"?await r().getAddress(q.id,{signal:x.signal}):await r().getAccessAddress(q.id,{signal:x.signal});if(!S())return;if(!M){y({selection:{suggestion:q,status:"error",details:null,error:Error(`KDS has no ${q.type} with id ${q.id}`)},expanded:a.expanded||i()!==void 0});return}let _={suggestion:q,status:"success",details:M,error:null},N=i();y({selection:_,...N&&T(M,N)}),t.onSelect?.(_)}catch(M){if(!S()||Ht(M))return;y({selection:{suggestion:q,status:"error",details:null,error:M},expanded:a.expanded||i()!==void 0})}}let ae={getState:()=>a,subscribe(q){return c.add(q),()=>c.delete(q)},setInput(q){if(q===a.value)return;let x=null;if(f){if(x=Br(q,f),!x)f=null}let S=I(q)?a.selection:null;if(!S)A?.abort();if(y({value:q,caret:null,slot:x,selection:S,open:ot(q)!==""}),F(x).length>0)y({suggestions:H()});Z(!1)},async select(q){let x=_i(q,o());if(x.action==="refine"){if(f=x.template,f?.streetId&&t.houseNumberPrefix!==!1)U(f.streetId);A?.abort(),y({value:x.value,caret:X(x.caret),slot:f?Br(x.value,f):null,selection:null,open:!0}),Z(!0);return}if(q.type!=="address"&&q.type!=="accessAddress")return;te(),f=null,l=null;let S=t.fetchDetails!==!1,M={suggestion:q,status:S?"loading":"success",details:null,error:null};if(y({value:x.value,caret:X(x.caret),slot:null,open:!1,selection:M}),S)await ce(q);else{if(i())y({expanded:!0});t.onSelect?.(M)}},async selectById(q){te(),f=null,A?.abort();let x=new AbortController;A=x;let S=x.signal;try{let M=o()==="address"?await r().getAddress(q,{signal:S}):await r().getAccessAddress(q,{signal:S});if(S.aborted||!M)return null;let N={suggestion:M.type==="address"?{type:"address",id:M.id,label:M.label,accessAddressId:M.accessAddress.id}:{type:"accessAddress",id:M.id,label:M.label,streetName:M.streetName,houseNumber:M.houseNumber},status:"success",details:M,error:null};p=[],u=null,l=null;let Q=i();return y({value:M.label,caret:X(M.label.length),slot:null,suggestions:[],status:"idle",error:null,open:!1,selection:N,...Q&&T(M,Q)}),t.onSelect?.(N),N}catch(M){if(S.aborted||Ht(M))return null;return y({status:"error",error:M}),null}},setOpen(q){if(q!==a.open)y({open:q})},setOptions(q){let x=t;t={...t,...q};let S=(x.kind??"address")!==o(),M=S||x.limit!==t.limit||x.includeProvisional!==t.includeProvisional||String(x.municipalityCodes??"")!==String(t.municipalityCodes??"");if(S)f=null,A?.abort(),y({slot:null,selection:null});if(JSON.stringify(x.fields?.fields)!==JSON.stringify(t.fields?.fields)){let _=t.fields,N=a.selection?.details;if(_&&N)y(T(N,_));else l=null,y({fields:zr(_,a.fields),expanded:_?a.expanded:!1})}if(M&&ot(a.value))u=null,y({open:!0}),Z(!0)},setField(q,x){if(q===s()){ae.setInput(x);return}if(!(q in a.fields)||a.fields[q]===x)return;let S=a.selection&&l?.fields[q]===x?a.selection:null;if(!S)A?.abort();y({fields:{...a.fields,[q]:x},selection:S})},expand(){if(!a.expanded)y({expanded:!0})},clear(){te(),A?.abort(),f=null,l=null,p=[],u=null,y({...Ui,fields:zr(i()),caret:X(0)})},destroy(){te(),A?.abort()}};return ae}var he=!1;function We(e){}function Ae(e,t,n){}function Yi(e,t){return e}function Xi(e,t){}function Gi(e,t,n,r,o,i){}function Qi(e,t,n,r){}function Ji(e,t,n){}function Zi(e){}function es(e,t){}function ts(e){e()}var ns=()=>!1;function rs(e,t,n){}function os(e,t,n,r){}function Ur(e,t,n){}var kn=new Set,Bt=!1;function Xe(e){if(kn.add(e),!Bt)Bt=!0,queueMicrotask(is)}function is(){Bt=!1;try{for(let e of kn)kn.delete(e),e()}finally{if(kn.size&&!Bt)Bt=!0,queueMicrotask(is)}}var Ud='input, textarea, select, [contenteditable]:not([contenteditable="false"])';function ss(e,{el:t}){let n=e.target.closest(Ud);if(n&&!n.contains(t??null))return;e.preventDefault()}var it={pointerdown:ss,mousedown:ss};var as;function ls(e){let t=as?.get(e);return as?.delete(e),t}var Yd=4,Fe=(e,t)=>!!(e.compareDocumentPosition(t)&Yd),Yr=(e,t)=>Fe(e,t)?-1:1,Xd=16,cs=32;function st(e){let t=e.length;if(t<=1)return e;let n=e[0].el.parentNode;if(n){let o=!0,i=!0;for(let s=1;s<t;s++){let a=e[s].el;if(a.parentNode!==n){o=!1;break}if(i&&e[s-1].el.nextElementSibling!==a)i=!1}if(o){if(i)return e;if("firstElementChild"in n){let s=new Map;for(let c=0;c<t;c++)s.set(e[c].el,e[c]);let a=[],l=t*cs;for(let c=n.firstElementChild;c&&l--;c=c.nextElementSibling){let f=s.get(c);if(f&&a.push(f)===t)return a}}}}let r=t<Xd?null:n;while(r){let o=!0;for(let i=0;i<t;i++)if(!r.contains(e[i].el)){o=!1;break}if(o)break;r=r.parentNode}if(r){let o=new Map;for(let l=0;l<t;l++)o.set(e[l].el,e[l]);let i=[],s=e[0].el.ownerDocument.createTreeWalker(r,1),a=t*cs;for(let l=r;l&&a--;l=s.nextNode()){let c=o.get(l);if(c&&i.push(c)===t)return i}}return e.sort((o,i)=>Yr(o.el,i.el))}function us(){let e=new Map,t,n=[],r=!1,o,i=new Set,s=(f)=>e.get(f.key)===f;function a(f,p){o??=new MutationObserver(()=>t=void 0);let u=p[p.length-1]?.el;for(let{el:m}of f)for(let g=m.parentNode;g&&!i.has(g);g=g.parentNode)if(i.add(g),o.observe(g,{childList:!0}),g.contains(u))break}function l(){let f=[];for(let u of e.values())if(u.el.isConnected)f.push(u);let p=st(f);if(p.length<e.size)return p;if(typeof MutationObserver<"u")o?.disconnect(),i.clear(),a(p,p);return t=p}function c(f){let p=n.filter(s);if(p.some((m)=>!m.el.isConnected))return;let u=f.filter(s);if(p.length*Math.log2(u.length+2)>u.length)return;for(let m of p){let g=0,A=u.length;while(g<A){let d=g+A>>1;if(Fe(u[d].el,m.el))g=d+1;else A=d}u.splice(g,0,m)}if(o)a(p,u);return u}return{list(){if(o?.takeRecords().length)t=void 0;if(t&&(n.length||r))t=c(t);return n=[],r=!1,t??l()},add(f){if(t&&e.has(f.key))r=!0;if(e.set(f.key,f),t)n.push(f);return()=>{if(!s(f))return;if(e.delete(f.key),r=!0,!e.size)o?.disconnect(),i.clear(),t=void 0}},get:(f)=>e.get(f),size:()=>e.size}}var An=(e)=>e.isTrusted;function ds(e,t){setTimeout(()=>{if(!e.defaultPrevented)t()})}var Xr=new Set;function Gr(e,t){if(Xr.has(e))return t();Xr.add(e);try{t()}finally{Xr.delete(e)}}function fs(e,t){return e!==void 0&&t===void 0}var Gd=new WeakMap,En=new WeakMap;function ps(e,t){return En.set(e,t),()=>{if(En.get(e)===t)En.delete(e)}}function Qd(e){let t=En.get(e);if(t)t();else e.focus()}var Qr=new WeakSet;function ms(e,t){let n=t??e.ownerDocument;if(Qr.has(n))return;Qr.add(n),setTimeout(()=>Qr.delete(n)),Qd(e)}function Zr(e,t,n){Gd.set(e,{internals:t,bind:n})}var Jd=new Set;function zt(e){Jd.forEach((t)=>t(e))}var Zd=new Set(["text","search","url","tel","email","password","date","month","week","time","datetime-local","number"]),ef=new WeakSet;var tf=(e)=>Array.from(e.getRootNode().querySelectorAll("button, input[type=submit], input[type=image]")).find((t)=>t.form===e&&(t.type==="submit"||t.type==="image")),nf=(e)=>e.filter((t)=>t instanceof HTMLInputElement&&Zd.has(t.type));function hs(e){if(!e)return;let t=tf(e);if(t){if(!t.disabled)t.click();return}if(nf(Array.from(e.elements)).filter((n)=>!ef.has(n)).length<=1)e.requestSubmit()}function gs(e){for(let t=e.parentElement;t;t=t.parentElement){if(!(t instanceof HTMLFieldSetElement)||!t.disabled)continue;if(!t.querySelector(":scope > legend")?.contains(e))return!0}return!1}var Jr=new WeakMap;function ys(e,t){let n,r,o=!0,i=()=>{let a=null,l=!1;for(let c=e.parentElement;c;c=c.parentElement)if(c instanceof HTMLFieldSetElement){if(a=c,!l&&c.disabled){if(!c.querySelector(":scope > legend")?.contains(e))l=!0}}if(a&&typeof MutationObserver<"u"){r??=new MutationObserver(i),r.disconnect();for(let c=e.parentElement;c;c=c.parentElement)if(r.observe(c,{childList:!0,attributeFilter:["disabled"]}),c===a)break}else r?.disconnect();if(l!==n)t(n=l)},s=()=>{if(!o)return;i(),Jr.set(e,i)};if(e.isConnected)s();else queueMicrotask(s);return()=>{o=!1,r?.disconnect(),Jr.delete(e)}}var eo=(e)=>Jr.get(e)?.(),Re=(e)=>e.disabled||e.formDisabled;var rf=globalThis[Symbol.for("ui-sdk.label-ids@1")]??={count:0};function Cn(e){let t=[],n=e.closest("label");if(n?.control===e)t.push(n);if(e.id)e.getRootNode().querySelectorAll(`label[for="${CSS.escape(e.id)}"]`).forEach((o)=>{if(o!==n&&o.control===e)t.push(o)});return t.sort(Yr)}function bs(e,t,n=e){let r,o=()=>{let i=e.getAttribute("aria-labelledby");if(e.hasAttribute("aria-label")||i!==null&&i!==r)return;let s=t();for(let l of s)if(!l.id)l.id=`ui-sdk-native-label-${++rf.count}`;let a=s.map((l)=>l.id).join(" ");if(!a){if(r!==void 0)e.removeAttribute("aria-labelledby");r=void 0;return}if(r=a,i!==a)e.setAttribute("aria-labelledby",a)};return queueMicrotask(o),n.addEventListener("focusin",o),()=>n.removeEventListener("focusin",o)}function vs(e,t,n){let r=()=>e.value!==e.defaultValue&&!t().includes(e.value),o=ls(e);if(r()){n();return}if(o===void 0)return;queueMicrotask(()=>{if(e.isConnected&&!r()){if(e.value=o,r())n()}})}Ve();function Pn(){return Ee&&typeof HTMLElement.prototype.showPopover==="function"}function to(e){if(e)return e;if(Ee&&!Pn())return document.body;return null}function we(e=document){let t=e.activeElement;while(t?.shadowRoot?.activeElement)t=t.shadowRoot.activeElement;return t}function On(e){let t=[e],n=e;while(n){let r=n.assignedSlot??n.parentNode??n.host;if(r&&r!==n.parentNode)t.push(r);n=r}return t}function Me(e,t){return On(t).some((n)=>e.contains(n))}var xs;var of;function _t(){if(xs)return xs==="apple";return of??=Ee&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}function sf(e){try{return Intl.getCanonicalLocales(e?e.split(/[.@]/)[0].replaceAll("_","-"):[])[0]}catch{}}function Ss(){if(typeof navigator>"u")return;return sf(navigator.languages?.[0]??navigator.language)}var af="abcdefghijklmnopqrstuvwxyz",lf=/\p{Diacritic}/gu,cf=/\p{Script=Latin}/u,uf=/^[\u0000-\u007f]*$/,df=/^(tr|az|lt)\b/i;function ff(e){let t=new Intl.Collator(e,{sensitivity:"base",usage:"search"}),n=df.test(e??"")?(a)=>a.toLocaleLowerCase(e):(a)=>a.toLowerCase(),r=new Map,o=new Map;function i(a){let l=r.get(a);if(l!==void 0)return l;let c=n(a);if(a<"")return r.set(a,c),c;let f=n(a.normalize("NFD").replace(lf,""));if(f.length===a.length&&f!==c&&t.compare(a,f)===0)l=f;else if(cf.test(a))l=[...af].find((p)=>t.compare(a,p)===0);return l??=c.length===a.length?c:a,r.set(a,l),l}function s(a){let l=o.get(a);if(l!==void 0)return l;if(uf.test(a))l=n(a);else{l="";for(let c of a)l+=i(c)}if(o.size>50000)o.clear();return o.set(a,l),l}return{locale:e,fold:s}}var Ut,no=0,ks=!1;function pf(){if(Ut)return Ut;if(!ks&&typeof window<"u"&&typeof window.addEventListener==="function")ks=!0,window.addEventListener("languagechange",()=>{no++,Ut=void 0});return no++,Ut=ff(Ss())}var As=()=>no,_e=(e)=>(Ut??pf()).fold(e);function ro(e){let t=0;while(t<e.length&&e.charCodeAt(t)<=32)t++;return t}var mf=(()=>{let e=new Uint8Array(128);for(let t of" -_/.:,()[]@#")e[t.charCodeAt(0)]=1;return e})(),Tn=(e,t)=>t===0||mf[e.charCodeAt(t-1)]===1;function Es(e,t,n){let r=_e(t.trim());if(!r)return[];let o=_e(e),i=o.indexOf(r);if(n==="startsWith"){let s=ro(o);return o.startsWith(r,s)?[{start:s,end:s+r.length}]:[]}if(i!==-1){let s=n==="fuzzy"?hf(o,r,i):i;return[{start:s,end:s+r.length}]}return n==="fuzzy"?gf(o,r):[]}function hf(e,t,n){for(let r=n;r!==-1;r=e.indexOf(t,r+1))if(Tn(e,r))return r;return n}function gf(e,t){let n=[],r=0;for(let o of t){if(o===" ")continue;let i=e.indexOf(o,r);if(i===-1)return[];let s=n.at(-1);if(s&&s.end===i)s.end=i+1;else n.push({start:i,end:i+1});r=i+1}return n}function Cs(e,t){if(!t.length)return[{text:e,match:!1}];let n=[],r=0;for(let{start:o,end:i}of t){if(o>r)n.push({text:e.slice(r,o),match:!1});n.push({text:e.slice(o,i),match:!0}),r=i}if(r<e.length)n.push({text:e.slice(r),match:!1});return n}function $e(e){let t=_e(e),n=t.length;if(!n)return t;let r=t.charCodeAt(0),o=t.charCodeAt(n-1);if(r>32&&r<127&&o>32&&o<127)return t;return t.trim()}function Ps(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function Os(e){let t="";for(let n=e.firstChild;n;n=n.nextSibling)if(n.nodeType===3)t+=n.nodeValue;else if(n.nodeType===1){let r=n;if(r.hasAttribute("hidden")||r.hasAttribute("aria-hidden")&&r.getAttribute("aria-hidden")==="true")continue;t+=r.firstElementChild?Os(r):r.textContent??""}return t}function yf(e){if(e.hasAttribute("aria-hidden")&&e.getAttribute("aria-hidden")==="true")return"";if(!e.firstElementChild)return e.textContent??"";return Os(e)}function Ts(e){return yf(e).replace(/\s+/g," ").trim()||(e.getAttribute("aria-label")??"")}function Ms(e,t){return t.length===1?e+1:Math.max(e,0)}function Ds(e=500){let t="",n="",r=!1,o;function i(){t="",n="",r=!1,clearTimeout(o)}function s(l,c,f){let p=l.length;for(let u=0;u<p;u++){let m=((f+u)%p+p)%p;if($e(l[m]).startsWith(c))return m}return-1}function a(l,c,f){if(l.length!==1||l===" "&&!t)return-1;clearTimeout(o),o=setTimeout(i,e);let p=$e(l)||l;if(r=p===n&&(r||t.length===1),n=p,t+=p,r){let u=s(c,t,Math.max(f,0));return u!==-1?u:s(c,p,Ms(f,p))}return s(c,t,Ms(f,t))}return Object.assign(a,{reset:i,active:()=>t.length>0})}var Is=(e,t)=>0.09*e.length/t.length;function bf(e,t,n){for(let r=n;r!==-1;r=e.indexOf(t,r+1))if(Tn(e,r))return r;return-1}function vf(e,t){let n=0,r=-2,o=0,i=0;for(let s=0;s<t.length;s++){let a=t.charCodeAt(s);if(a===32)continue;let l=a>=55296&&a<=56319&&s+1<t.length?t.slice(s,++s+1):t[s],c=e.indexOf(l,n);if(c===-1)return 0;if(i++,Tn(e,c))o+=1;if(c===r+1)o+=1;r=c,n=c+1}if(!i)return 0;return 0.1+0.4*o/(2*i)}function Ls(e,t){if(e===t)return 1;let n=e.indexOf(t);if(n===0)return 0.9+Is(t,e);if(n>0)return(bf(e,t,n)!==-1?0.75:0.6)+Is(t,e);return vf(e,t)}var Fs,Rs=-1,$s="";function wf(e){let t=As();if(e!==Fs||t!==Rs)Fs=e,Rs=t,$s=$e(e);return $s}function Ns(e,t){let n=wf(t);if(!n)return 1;let r=Ls($e(e.label),n),o=e.keywords;if(o)for(let i=0;i<o.length;i++){let s=Ls($e(o[i]),n)*0.95;if(s>r)r=s}return r}function Dn(e,t,n,r){if(t==="first")return 0;if(t==="last")return n-1;let o=e+t;if(r)return(o%n+n)%n;return Math.max(0,Math.min(n-1,o))}function Ws(e,t,n,r,o=0,i=0){if(n-o<e)return Math.max(0,n-o);if(n+r+i>e+t)return Math.max(0,n+r+i-t);return e}function kt(e){return typeof e==="string"?{value:e,label:e}:e}var In=(e)=>typeof e==="object"&&("type"in e)&&e.type==="group",Ln=(e)=>typeof e==="object"&&("type"in e)&&e.type==="separator";function Vs(e,t){for(let n=e.parentElement;n;n=n.parentElement){let r=getComputedStyle(n);if(/(auto|scroll)/.test(r.overflowY)&&n.scrollHeight>n.clientHeight){let o=n.getBoundingClientRect(),i=n.offsetHeight,s=i>0&&o.height>0&&Math.abs(i-o.height)>0.5?i/o.height:1,a=(e.getBoundingClientRect().top-o.top)*s-n.clientTop+n.scrollTop,l=parseFloat(r.scrollPaddingTop)||0,c=parseFloat(r.scrollPaddingBottom)||0,f=Ws(n.scrollTop,n.clientHeight,a,e.offsetHeight,l,c),p=Math.min(f,n.scrollHeight-n.clientHeight);if(p!==n.scrollTop)n.scrollTop=p;return}if(n===t)return}}function qs(e,t){let{store:n}=e,r=typeof e.focus==="function"?e.focus:()=>e.focus,o=us(),i=new Map,s=Ds(),a=new Set,l,c,f,p,u=0,m=0,g=(h,E)=>{let C=e.toKey(h.value),j=!!h.disabled;return{key:C,value:h.value,label:h.label,keywords:h.keywords,get disabled(){return j||!!o.get(C)?.meta().disabled},group:E}};function A(h){let E=[];for(let C=0;C<h.length;C++){let j=h[C];if(Ln(j))continue;if(In(j)){let Y=`group-${C}`;for(let G=0;G<j.items.length;G++)E.push(g(kt(j.items[G]),Y));continue}E.push(g(kt(j)))}return E}let d=(h,E)=>{if(E?.data===h)return E;let C=A(h),j=new Map;for(let Y=0;Y<C.length;Y++)j.set(C[Y].key,C[Y]);return{data:h,flat:C,byKey:j}},b,v;function y(h,E){if(b!==h){b=h,v=new Map;for(let C=0;C<h.length;C++){let j=h[C].key;if(!v.has(j))v.set(j,C)}}return v.get(E)??-1}function I(){let h=e.items();if(!h)return;return l=d(h,l)}function T(){let h=e.emptyItems?.();return h&&(c=d(h,c))}function B(){if(!e.items()||!(e.showEmpty?.()??!e.query().trim()))return;return T()}function X(h){return I()?.byKey.get(h)??T()?.byKey.get(h)}function F(){let h=B()??I();if(!h)return;let E=e.query(),C=e.filter(),j=e.rank?.()??!1;if(f?.data!==h.data||f.query!==E||f.filter!==C||f.rank!==j){let Y=t.data(h.data,E,C,{rank:j});f={data:h.data,query:E,filter:C,rank:j,list:Y,flat:Y===h.data?h.flat:A(Y)}}return f}function H(h,E){let C=o.get(h)?.el;if(!C||C===E||!C.isConnected)return;let j=E.getAttribute("data-slot")??"";Ae(`Two items have the value "${h}". Give each item its own value, or arrow keys skip one and choosing it picks the other.`,{component:j.replace(/-item$/,"")||"listbox"})}function U(h,E){let C=E.meta(),j=C.label??Ts(E.el);if(C.pinned)return j;let Y=i.get(h);if(Y?.label!==j)i.set(h,{...Y,label:j,value:C.value}),u++;return j}function te(h,E){let C=E.meta();return{key:h,value:C.value,label:U(h,E),keywords:C.keywords,get disabled(){return!!E.meta().disabled},group:C.group,pinned:C.pinned}}let Z=new Map,re=new Set,ce=new Set,ae=(h,E)=>!!I()||x(h,E);function q(h,E){if(Z.set(h,E),E.index!==void 0)re.add(h);else if(re.size)re.delete(h);let C=ae(h,E);if(!C)ce.add(h);else if(ce.size)ce.delete(h);return C}function x(h,E){let C=o.get(h),j=E.label??(C?U(h,C):i.get(h)?.label)??(typeof E.value==="string"?E.value:"");return t.matches({value:E.value,label:j,keywords:E.keywords},e.query(),e.filter())}function S(h){if(!a.size)return h;let E=h.length?o.get(h[0].key)?.el:void 0,C=[],j=[];for(let Y of a){let G=o.get(Y);if(!G?.el.isConnected)continue;(!!E?.isConnected&&Fe(G.el,E)?C:j).push(te(Y,G))}return C.length||j.length?[...C,...h,...j]:h}function M(){let h=o.list(),E=e.query(),C=e.filter();if(p?.order===h&&p.query===E&&p.filter===C&&p.version===u)return p.list;let j=C!==!1&&C!==void 0&&!!E.trim(),Y=[];for(let G=0;G<h.length;G++){let pe=h[G],ye=te(pe.key,pe);if(!j||ye.pinned||t.matches({value:ye.value,label:ye.label,keywords:ye.keywords},E,C))Y.push(ye)}return p={order:h,query:E,filter:C,version:u,list:Y},Y}function _(){let h=F();if(h)return S(h.flat);return M()}let N=(h)=>h.disabled||!!e.blocked?.(h);function Q(h){if(h===null)return;let E=X(h);if(E)return E;let C=o.get(h);if(C)return te(h,C);let j=i.get(h);if(j)return{key:h,value:j.value,label:j.label,disabled:!1}}function ne(h,E){if(r()==="real"&&E&&e.active())h.focus({preventScroll:!0});if(e.keepInView?.()!==!1)Vs(h,(e.scrollRoot??e.container)?.())}let ee=null;function fe(h,{focus:E=!0,event:C}={}){if(n.set({highlighted:h}),e.onHighlight||e.onLastReached){let Y=_(),G=h===null?-1:y(Y,h);if(e.onHighlight?.(h,G,C),e.onLastReached&&G!==-1){let pe=Y.length-1;if(e.skipDisabled)while(pe>0&&Y[pe].disabled)pe--;if(G===pe)e.onLastReached()}}if(h===null)return;let j=o.get(h)?.el;if(j?.isConnected)ee=h,ne(j,E)}function ue(h,{loop:E=e.loop()&&Math.abs(Number(h))===1}={}){let C=_(),j=C.length;if(!j)return;let Y=n.get().highlighted;if(!e.skipDisabled){let V=Y===null?-1:y(C,Y);if(V!==-1||typeof h!=="number")return C[Dn(V,h,j,E)].key;return C[h>0?0:j-1].key}if(h==="first"){for(let V=0;V<j;V++)if(!C[V].disabled)return C[V].key;return}if(h==="last"){for(let V=j-1;V>=0;V--)if(!C[V].disabled)return C[V].key;return}let G=Y===null?-1:y(C,Y);if(G===-1){if(h>0){for(let V=0;V<j;V++)if(!C[V].disabled)return C[V].key}else for(let V=j-1;V>=0;V--)if(!C[V].disabled)return C[V].key;return}if(h===1){for(let V=G+1;V<j;V++)if(!C[V].disabled)return C[V].key;if(E){for(let V=0;V<=G;V++)if(!C[V].disabled)return C[V].key;return}if(!C[G].disabled)return C[G].key;for(let V=0;V<G;V++)if(!C[V].disabled)return C[G].key;return}if(h===-1){for(let V=G-1;V>=0;V--)if(!C[V].disabled)return C[V].key;if(E){for(let V=j-1;V>=G;V--)if(!C[V].disabled)return C[V].key;return}if(!C[G].disabled)return C[G].key;for(let V=G+1;V<j;V++)if(!C[V].disabled)return C[G].key;return}let pe=[],ye=-1,W=0;for(let V=0;V<j;V++)if(!C[V].disabled){if(V===G)ye=pe.length;else if(V<G)W++;pe.push(C[V])}if(!pe.length)return;if(ye!==-1)return pe[Dn(ye,h,pe.length,E)].key;if(!E&&W===(h>0?pe.length:0))return C[G].key;return pe[Dn(h>0?W-1:W,h,pe.length,E)].key}function le(h,E){let C=ue(h);if(C!==void 0)fe(C,{event:E})}function z(h,E){let C=_().filter((Y)=>!Y.pinned),j=s(h,C.map((Y)=>N(Y)?"":Y.label),C.findIndex((Y)=>Y.key===E));return j===-1?void 0:C[j]}function k(h){let E=h.ownerDocument;return!E.activeElement||E.activeElement===E.body}let L,D;function w(h){if(typeof MutationObserver>"u")return;if(!L)L=new MutationObserver(O);if(!D)D=new WeakSet;if(!D.has(h))D.add(h),L.observe(h,{childList:!0})}function O(){let h=n.get().highlighted,E=h===null?void 0:o.get(h)?.el;if(E?.isConnected&&k(E))ne(E,!0)}let P,R;function K(){let h=P;if(P=void 0,!h)return;for(let E=0;E<h.length;E++){let C=h[E];if(o.get(C.key)!==C||!C.el.isConnected)continue;if(U(C.key,C),n.get().highlighted===C.key&&ee!==C.key)ee=C.key,ne(C.el,!1);if(C.el.parentNode)w(C.el.parentNode)}}function J(){let h=R;if(R=void 0,!h)return;for(let E=0;E<h.length;E++)de(h[E][0],h[E][1])}function oe(h,E){let C=()=>n.get().highlighted===h&&e.active();if(r()!=="real"||!C()||E.ownerDocument.activeElement===E)return;queueMicrotask(()=>{if(C()&&E.isConnected)ne(E,!0)})}function ie(h,E,C){if(m++,he)H(h,E);let j={key:h,el:E,meta:C},Y=o.add(j),G=C();if(G.index!==void 0)re.add(h);if(G.pinned)a.add(h);else{let pe=i.get(h);if(G.label!==void 0&&pe?.label!==G.label)u++;i.set(h,{...pe,label:G.label??pe?.label??"",value:G.value,keywords:G.keywords,group:G.group})}if(!P)P=[j],queueMicrotask(K);else P.push(j);return e.onRegister?.(h),oe(h,E),()=>{if(o.get(h)!==j)return;if(Y(),m++,a.delete(h),!o.size())L?.disconnect(),D=void 0;if(e.onRegister?.(h),!R)R=[[h,E]],queueMicrotask(J);else R.push([h,E])}}function de(h,E){if(o.get(h)||X(h)||n.get().highlighted!==h)return;if(n.set({highlighted:null}),e.onHighlight?.(null,-1),r()==="real"&&e.active()&&k(E))e.container?.()?.focus({preventScroll:!0})}return{entries:_,visibleData:F,dataItems:()=>I()?.flat,find:Q,disabled:N,isItemDisabled:(h)=>!!Q(h)?.disabled,highlight:fe,move:le,stepKey:ue,firstEnabled:()=>_().find((h)=>!h.pinned&&!N(h))?.key,search:z,register:ie,typing:()=>s.active(),resetTyping:()=>s.reset(),labelOf(h){let E=X(h);if(E)return E.label;let C=o.get(h);if(C)return U(h,C);return i.get(h)?.label},valueOf(h){let E=X(h);if(E)return E.value;return o.get(h)?.meta().value??i.get(h)?.value},matches:q,listing(h,E,C){let j=!I()&&!!e.query().trim();if(!j&&(!h||E!==void 0)){if(!re.size&&(!E||!E.length))return xf;let ge={};if(re.size){let me=String(_().length),Se=E?.length?new Set(E):void 0;for(let ke of re)if((Z.get(ke)??o.get(ke)?.meta())?.index!==void 0)ge[ke]=Se?.has(ke)?`${me}s`:me;else re.delete(ke)}if(E)for(let me=0;me<E.length;me++){let Se=E[me];if(typeof ge[Se]!=="string")ge[Se]="s"}return ge}let Y={},G=new Set,pe,ye=j?new Set(M().map((ge)=>ge.key)):void 0,W=(ge,me,Se)=>{if(G.has(ge))return;G.add(ge);let ke=o.get(ge),Le=Se?me:ke?.meta()??me,xn=!ye||ye.has(ge)||!ke?.el.isConnected&&x(ge,Le)?"":"-";if(Le.index!==void 0)xn+=pe??=_().length;if(h)xn+=h(ge,Le.value);if(xn||ce.size&&ce.delete(ge)&&typeof C?.[ge]!=="string")Y[ge]=xn};for(let[ge,me]of Z)W(ge,me,!0);for(let[ge,me]of i)W(ge,me,!1);let V=I()?.flat;if(V)for(let ge=0;ge<V.length;ge++){let me=V[ge];W(me.key,me,!1)}let ve=T()?.flat;if(ve)for(let ge=0;ge<ve.length;ge++){let me=ve[ge];W(me.key,me,!1)}return Y},listingInputs:()=>[e.items()?a.size:m,e.items()?0:u,e.query(),e.filter(),e.items(),e.emptyItems?.(),e.showEmpty?.(),e.rank?.()],selectable(h){let E=[];for(let C of _()){if(C.pinned||C.disabled)continue;if(h!==void 0&&(o.get(C.key)?.meta().group??C.group)!==h)continue;E.push(C.key)}return E},count(){let h=0;for(let E of _())if(!E.pinned)h++;return h},groupMatches(h){if(I()||!e.query().trim())return!0;return o.list().some((E)=>E.meta().group===h&&x(E.key,E.meta()))},element:(h)=>o.get(h)?.el,labelsVersion:()=>u,remember(h,E,C,j){let Y=i.get(h),G=Y?.keywords,pe=Y?.label===E&&(!j||G?.length===j.length&&j.every((ye,W)=>ye===G[W]));if(Y&&pe){if(Y.value!==C)i.set(h,{...Y,value:C});return}i.set(h,{...Y,label:E,value:C,...j&&{keywords:j}}),u++}}}var xf=Object.freeze({}),Hs=(e,t)=>e.entries().find((n)=>n.key===t&&!n.pinned&&!e.disabled(n));function oo(e,t,n){if(t===n||t!==null&&!Hs(e,t))return!1;return e.highlight(t),!0}function io(e,t){let n=e.find(t);return n&&!n.pinned?n.value??null:null}function Fn(e,t,n){let r=_e(e);return n==="startsWith"?r.startsWith(t,ro(r)):r.includes(t)}function so(e,t,n){if(Fn(e.label,t,n))return!0;let r=e.keywords;if(r){for(let o=0;o<r.length;o++)if(Fn(r[o],t,n))return!0}return!1}function Sf(e,t,n){if(n===!1||n===void 0||!t.trim())return 1;if(typeof n==="function"){let o=n(e,t);return typeof o==="number"?Math.max(0,o):o?1:0}let r=_e(t.trim());return!r||so(e,r,n)?1:0}function kf(e,t,n){return Sf(e,t,n)>0}function Af(e,t,n,{rank:r=!1}={}){if(n===!1||n===void 0)return e;let o=t.trim();if(!o)return e;if(r)return Ef(e,t,o,n);let i=typeof n==="function"?"":_e(o);if(typeof n!=="function"&&!i)return e;let s=(f)=>{if(typeof n==="function"){let p=n(kt(f),t);return typeof p==="number"?p>0:!!p}return typeof f==="string"?Fn(f,i,n):so(f,i,n)},a=[],l,c=(f)=>{if(l&&a.length)a.push(l);l=void 0,a.push(f)};for(let f=0;f<e.length;f++){let p=e[f];if(Ln(p)){l=p;continue}if(In(p)){let u=[];for(let m=0;m<p.items.length;m++){let g=p.items[m];if(s(g))u.push(g)}if(u.length)c({...p,items:u});continue}if(s(p))c(p)}return a}var js=(e,t)=>t.score-e.score;function Ef(e,t,n,r){let o=typeof r==="function"?"":_e(n),i=(u)=>{if(typeof r==="function"){let m=r(kt(u),t);return typeof m==="number"?Math.max(0,m):m?1:0}if(!o)return 1;return(typeof u==="string"?Fn(u,o,r):so(u,o,r))?1:0},s=[],a=!0,l=1/0,c,f=(u,m)=>{if(m>l)a=!1;l=m,s.push({entry:u,score:m,separator:s.length?c:void 0}),c=void 0};for(let u=0;u<e.length;u++){let m=e[u];if(Ln(m)){c=m;continue}if(In(m)){let A=[],d=!0,b=1/0;for(let y=0;y<m.items.length;y++){let I=m.items[y],T=i(I);if(T>0){if(T>b)d=!1;b=T,A.push({entry:I,score:T})}}if(!A.length)continue;if(!d)A.sort(js);let v=[];for(let y=0;y<A.length;y++)v.push(A[y].entry);f({...m,items:v},A[0].score);continue}let g=i(m);if(g>0)f(m,g)}if(!a){s.sort(js);let u=[];for(let m=0;m<s.length;m++)u.push(s[m].entry);return u}let p=[];for(let u=0;u<s.length;u++){let m=s[u];if(m.separator)p.push(m.separator);p.push(m.entry)}return p}var Cf={data:Af,matches:kf};function Ks(e){return qs(e,Cf)}function Bs(e,t){return(n)=>{if(n===null)return;if(n==="false")return!1;return e.includes(n)?n:t}}var zs=10;function ao(e,{apple:t}){let{key:n}=e;if(n==="ArrowDown")return e.metaKey?"last":1;if(n==="ArrowUp")return e.metaKey?"first":-1;if(n==="PageDown")return zs;if(n==="PageUp")return-zs;let r=t&&e.ctrlKey&&!e.metaKey&&!e.altKey&&!e.shiftKey;if(r&&n==="n")return 1;if(r&&n==="p")return-1}function _s(e,{listbox:t,highlighted:n,choose:r,focusInput:o}){let i=e.key==="Home"?"first":e.key==="End"?"last":ao(e,{apple:_t()});if(i!==void 0)return e.preventDefault(),t.move(i,e);if(e.key==="Enter"||e.key===" "){if(e.preventDefault(),n===null)return;let s=t.element(n);if(e.key==="Enter"&&s?.matches("a[href]"))return s.click();return r(n,e)}if(Ps(e))o()}var Rn=new WeakMap;function Us(e,t){let n=Rn.get(e);if(!n)Rn.set(e,n=[]);n.push(t)}function lt(e,t,n){Us(e.store,{from:"options",keys:t,derive:n})}function Ys(e,t,n,{live:r=!0}={}){let{store:o}=e;Us(o,{from:"state",keys:t,derive:n}),o.subscribe((i)=>{if(i&&!r)return;let s=n(o.get());if(s)o.set(s)})}function Xs(e,t,n,r){let o=Rn.get(e);if(!o)return n;let i=n??{},s=!n,a=!!n;for(let l=0;l<o.length;l++){let c=o[l];if(!n&&c.from==="state")continue;let f=a?{...r,...i}:r,p=c.from==="state"?e.view(f,()=>c.derive(f)):c.derive(i,r,t);if(!p&&c.from==="options")continue;if(!s)i={...i},s=!0;for(let u=0;u<c.keys.length;u++){let m=c.keys[u];if(p&&m in p)i[m]=p[m],a=!0;else if(c.from==="state")i[m]=f[m],a=!0}}return a?i:void 0}var Gs=(e)=>Rn.has(e);var Qs=new WeakSet;function Oe(e,t){if(Object.is(e,t))return!0;if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;if(Qs.has(e)||Qs.has(t))return!1;return e.every((n,r)=>Object.is(n,t[r]))}function Js(e,t){let n=e,r,o,i=!1,s,a=new Set,l=new Map,c,f={state:e,renders:0,writes:0,touch:()=>m([],n,!1,!1),skipping:l},p={get(){return s??u()},set(g,A=!1){if(r&&!A&&!i){let y=u();if(y!==n){let I={...y};for(let T in g)delete I[T];p.set(I,!0)}}let d;for(let y in g)if(!Oe(n[y],g[y]))(d??=[]).push(y);if(!d)return;let b=n;n={...n,...g},f.state=n;let v=t.length>0;if(v){for(let y=0;y<d.length;y++)if(!t.includes(d[y])){v=!1;break}}m(d,b,v,A)},subscribe(g){return a.add(g),()=>{a.delete(g)}},setFanout(g){c=g},follow(g){r=g},view(g,A){let d=s;s=g;try{return A()}finally{s=d}}};function u(){if(!r||i)return n;i=!0;let g;try{g=r(n)}finally{i=!1}if(!g)return n;if(o?.state===n&&o.over===g)return o.result;let A=n;for(let d in g)if(!Oe(n[d],g[d])){A={...n,...g};break}return o={state:n,over:g,result:A},A}function m(g,A,d,b){if(!d)f.renders++;if(!b)f.writes++;for(let v of a)v(d,b,g);for(let[v,y]of l){let I=!g.length;if(!I){for(let T=0;T<g.length;T++)if(!Object.hasOwn(v,g[T])){I=!0;break}}if(I)for(let T of y)T(d,b,g)}c?.(g,A,d,b)}return ct.set(p,f),p}var ct=new WeakMap;function $n(e,t,n){return Mf(ct.get(e).skipping,t,n)}function Mf(e,t,n){let r=e.get(t);if(!r)e.set(t,r=new Set);return r.add(n),()=>{if(r.delete(n),!r.size&&e.get(t)===r)e.delete(t)}}var Yt=(e)=>ct.get(e).state;var Nn=(e)=>ct.get(e).renders,Zs=(e,t)=>{ct.set(e,ct.get(t))},ea=(e)=>ct.get(e).touch();var ta={};function na(e,t,n){let r;Ys({store:e},["listing"],(o)=>{let i=[...t.listingInputs(),...n?.inputs()??[]];if(!r||!Oe(i,r.inputs)){let s=t.listing(n?.entry,n?.selectedKeys?.(),o.listing);r={inputs:i,listing:Pf(o.listing,s)?o.listing:s}}return{listing:r.listing}},{live:!1})}function Pf(e,t){for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(typeof e[n]!=="string")return!1;return!0}var lo=new WeakMap;function Wn(e,t){let n=lo.get(e);if(n)return void n.push(t);let r=[t];lo.set(e,r),Xe(()=>{lo.delete(e);let o={};for(let i of r)i(o);e.set(o)})}function ra(e,t,n){let r=(s)=>Wn(e,(a)=>{a[t]=s(a[t]??e.get()[t])}),o=!0,i=!1;return r((s)=>{if(!o)return s;return i=!0,[...s,n]}),()=>{o=!1,r((s)=>{if(!i)return s;let a=s.indexOf(n);return a===-1?s:s.filter((l,c)=>c!==a)})}}function Vn(e,t,{now:n=!1}={}){let r=(o)=>n?e.set({[t]:o}):Wn(e,(i)=>i[t]=o);return r(!0),()=>r(!1)}function Of(e,t){let n=e.getAttribute("aria-labelledby");if(n&&n!==`${t}-label`)return{labelledBy:n};let r=[...e.labels??[]].map((i)=>i.id).filter(Boolean);if(r.length)return{labelledBy:r.join(" ")};let o=e.getAttribute("aria-label");return o?{label:o}:null}function oa(e,t,n){Wn(t,(r)=>{let o=Of(e,n);if(JSON.stringify(o)!==JSON.stringify(t.get().fieldName))r.fieldName=o})}function co(e,t){let n=e.labeled?null:e.fieldName;return{"aria-labelledby":e.labeled?`${t}-label`:n&&("label"in n)?void 0:n?.labelledBy??`${t}-input`,"aria-label":n&&"label"in n?n.label:void 0}}Ve();De();var qn=new WeakMap;function Hn(e,t){qn.get(e)?.();let n=At.delete(e)?[]:e.getAnimations?.({subtree:!0}).filter(ca),r=n?.every((a)=>ho(a)!==e);if(e.setAttribute("data-starting-style",""),n&&r){for(let a of e.getAnimations?.({subtree:!0})??[])if(ca(a)&&!n.some((l)=>If(a,l)))a.finish()}let o,i,s=requestAnimationFrame(()=>i=setTimeout(()=>{if(e.removeAttribute("data-starting-style"),t)o=fa(e,t)}));return()=>{cancelAnimationFrame(s),clearTimeout(i),o?.(),e.removeAttribute("data-starting-style")}}var ca=(e)=>("transitionProperty"in e),ho=(e)=>e.effect?.target,If=(e,t)=>ho(e)===ho(t)&&e.transitionProperty===t.transitionProperty;function ua(e){return e.split(",").map((t)=>{let n=parseFloat(t)||0;return t.trim().endsWith("ms")?n/1000:n})}function Lf(e){return Math.max(da(getComputedStyle(e)),da(getComputedStyle(e,"::backdrop")))}function da(e){let t=(n,r,o="1")=>{let i=ua(n),s=ua(r),a=o.split(",").map((l)=>l.trim()==="infinite"?1:parseFloat(l)||1);return i.map((l,c)=>(l*(a[c%a.length]??1)+(s[c%s.length]??0))*1000)};return Math.max(0,...t(e.transitionDuration,e.transitionDelay),...t(e.animationDuration,e.animationDelay,e.animationIterationCount))}function Ff(e){let t=0;for(let n of e){let r=n.effect?.getComputedTiming(),o=Number(r?.endTime);if(!r||!Number.isFinite(o))continue;t=Math.max(t,o-(Number(r.localTime)||0))}return t}var Rf=(e)=>!e.timeline||!("source"in e.timeline);function fa(e,t){let n=!1,r=e.getAnimations({subtree:!0}).filter(Rf),o=()=>{if(n)return;n=!0,clearTimeout(i),t()},i=r.length?setTimeout(o,Math.max(Lf(e),Ff(r))+50):void 0;if(!r.length)ts(o);else Promise.allSettled(r.map((s)=>s.finished)).then(o);return()=>{n=!0,clearTimeout(i)}}function go(e,t){e.toggleAttribute("data-open",t),e.toggleAttribute("data-closed",!t)}function pa(e,t){let n=e.length,r=!1,o=[],i=e.map((s)=>$f(s,(a,l)=>{if(o.push(a),r||=l,--n>0)return;o.forEach((c)=>c(r)),t()}));return()=>i.forEach((s)=>s())}function $f(e,t){qn.get(e)?.(),e.removeAttribute("data-starting-style"),e.setAttribute("data-ending-style","");let n=e.hasAttribute("inert");e.setAttribute("inert","");let r=e.ownerDocument?.defaultView?.MutationObserver,o=!1,i=r&&new r(()=>o=!0);i?.observe(e,{attributeFilter:["inert"]});let s=0,a=()=>{if(cancelAnimationFrame(s),qn.delete(e),e.removeAttribute("data-ending-style"),o||=!!i?.takeRecords().length,i?.disconnect(),!o)e.toggleAttribute("inert",n)},l=(p)=>{if(!p)return a();qn.set(e,a),s=requestAnimationFrame(()=>{s=requestAnimationFrame(a)})},c=!1,f=fa(e,()=>t(l,c));return c=!0,()=>{f(),a()}}function ut(e){return{"data-open":e?"":void 0,"data-closed":e?void 0:""}}var Nf=/[\s%]/;function Et(e){return Nf.test(e)?e.replace(/[\s%]/g,encodeURIComponent):e}var jn=["ArrowDown","ArrowUp","PageDown","PageUp","ctrl+n","ctrl+p"],Kn=(e)=>Re(e)||e.readOnly,Bn=(e)=>({"data-disabled":Re(e)?"":void 0,"data-readonly":e.readOnly?"":void 0,"data-required":e.required?"":void 0});function Wf(e,t,n){let r=e.ownerDocument.createDocumentFragment(),o=()=>{if(t()&&r.childNodes.length)e.append(r);else if(!t()&&e.childNodes.length)r.append(...Array.from(e.childNodes))};o();let i=n(o);return()=>{if(i(),r.childNodes.length)e.append(r)}}function ma(e,t,n,r=()=>!1){if(!Ee)return;setTimeout(()=>{if(!e.isConnected||r()||e.getAttribute("aria-labelledby")||e.getAttribute("aria-label")||Cn(e).length)return;Ae(t,n)},300)}function ha(e,t){if(e===void 0)return{};return{"aria-posinset":String(e+1),"aria-setsize":String(t.entries().length)}}function ga(e,{api:t,key:n,props:r}){return t.internal.listbox.register(n,e,()=>{let o=t.internal.itemProps(n)??r;return{value:o.value,label:o.label,keywords:o.keywords,disabled:o.disabled,group:o.group,index:o.index}})}function ya(){return{props:{id:"id"},role:"group",attrs:(e,{id:t,key:n,api:r})=>({"aria-labelledby":Vf(e,t,n),hidden:r.internal.listbox.groupMatches(n)?void 0:""})}}var Vf=(e,t,n)=>e.groupLabels.includes(n)?`${t}-group-${Et(n)}`:void 0;function ba(){return{role:"none",attrs:(e,{api:t})=>({"aria-hidden":"true",hidden:t.internal.filterQuery()&&!e.items?"":void 0})}}function va(){let e=(t,n)=>n.internal.isEmpty(t);return{props:{stash:"boolean"},state:(t,{api:n})=>({loading:t.status==="loading",empty:e(t,n),query:t.query}),role:"status",attrs:(t,{api:n})=>({"aria-live":"polite","aria-atomic":"true","data-empty":e(t,n)?"":void 0,"data-loading":t.status==="loading"?"":void 0}),bind(t,{api:n,store:r,props:o}){if(o.stash)return Wf(t,()=>e(r.get(),n),r.subscribe)}}}function wa(){return{state:(e,{api:t})=>({status:e.status,loading:e.status==="loading",count:t.internal.itemCount()}),role:"status",attrs:(e)=>({"aria-live":"polite","aria-atomic":"true","data-loading":e.status==="loading"?"":void 0})}}function xa(){return{props:{id:{kind:"string",from:"group.id",required:!0},group:{kind:"string",from:"group.id",required:!0}},attrs:(e,{id:t,props:n})=>({id:`${t}-group-${Et(n.group)}`}),bind:(e,{store:t,props:n})=>ra(t,"groupLabels",n.group)}}function Sa(){return{state:(e)=>({open:e.open}),attrs:(e)=>({"aria-hidden":"true",...ut(e.open)}),bind(e,{api:t}){t.internal.popup.checkPlacement()}}}Ma();var vo="pointer",yo=!1,Pa=!1,Oa=!1,Ta=!1,wo=!1,Qt="mouse",bo=!1,Hf=()=>bo=!1,zn=null,jf=()=>zn=null;function La(e){if(e.key!=="Enter"&&e.key!==" ")return;zn=e.target,setTimeout(jf)}function Kf(e){La(e),wo=!1;let t=e.metaKey||e.ctrlKey||e.altKey||/^(Meta|Control|Alt|Shift)$/.test(e.key);if(e.key==="Tab"||!t)vo="keyboard"}function Da(e){if(vo="pointer",wo=!1,!("pointerType"in e)){if(!bo)Qt="touch";return}bo=!0,setTimeout(Hf);let t=e.pointerType;Qt=Fa(e)?"virtual":t==="touch"||t==="pen"?t:"mouse"}function _n(){if(yo||typeof document>"u")return;yo=!0,document.addEventListener("keydown",Kf,!0),document.addEventListener("keyup",La,!0),document.addEventListener("pointerdown",Da,!0),document.addEventListener("touchstart",Da,{capture:!0,passive:!0}),window.addEventListener("blur",(e)=>{if(e.target===window)wo=!0})}function Un(){if(yo||Pa)return;Pa=!0,queueMicrotask(_n)}function Fa(e){if(e.type==="pointermove")return!1;if(e.width===0&&e.height===0&&e.pressure===0)return!0;return e.pointerType==="mouse"&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0}function Bf(e){if(e.detail>0)return Qt;return!!zn&&zn.contains(e.target)?"keyboard":"virtual"}var Ia=()=>vo==="keyboard"?"keyboard":Qt;function Ge(e){if(_n(),!e)return Ia();if(!An(e))return"programmatic";if(e.type.startsWith("key"))return"keyboard";if(e.type.startsWith("touch"))return"touch";if(e.type==="click")return Bf(e);let t=e.pointerType;if(t==="mouse"||t==="touch"||t==="pen")return Fa(e)?"virtual":t;if("button"in e)return Qt;return Ia()}function Yn(e){_n(),Oa=!0;try{e.focus({preventScroll:!0})}finally{Oa=!1}}function xo(e){_n(),Ta=!0;try{e.focus({preventScroll:!0})}finally{Ta=!1}}var Ra=(e)=>e==="pointer"||e==="touch"?"pointer":"keyboard";function $a(e,t,n=()=>[]){let r=t,o,i=(f)=>{if(r=f,e.getAttribute("data-modality")!==f)e.setAttribute("data-modality",f)};i(t);let s=(f)=>{if(f.metaKey||f.ctrlKey||/^(Meta|Control|Alt|Shift)$/.test(f.key))return;i("keyboard")},a=()=>i("pointer"),l=(f)=>{let p={x:f.clientX,y:f.clientY},u=o&&Math.hypot(p.x-o.x,p.y-o.y)>2;if(o=p,u&&r!=="pointer")i("pointer")},c=[e,...n().filter((f)=>!!f)];for(let f of c)f.addEventListener("keydown",s,!0);return e.addEventListener("pointerdown",a,!0),e.addEventListener("pointermove",l,!0),()=>{for(let f of c)f.removeEventListener("keydown",s,!0);e.removeEventListener("pointerdown",a,!0),e.removeEventListener("pointermove",l,!0),e.removeAttribute("data-modality")}}function zf(e){if(e.type==="removed")return`${e.label} removed`;if(e.loading)return"Loading";if(!e.count)return"No results";return e.count===1?"1 result":`${e.count} results`}function Na(e){return e==="contains"||e==="startsWith"||e==="fuzzy"?e:void 0}var _f=(e)=>({segments:[{text:e,match:!1}],matched:!1});function Wa(){let e=new WeakMap,t=(n,r,o)=>{let{matchQuery:i,matchMode:s}=n.internal,a=s()?i():"",l=e.get(n);if(!l)e.set(n,l=new Map);let c=l.get(r);if(c&&c.text===o&&c.query===a)return c.state;let f=a.trim()?Es(o,a,s()):[],p=f.length?{segments:Cs(o,f),matched:!0}:c&&!c.state.matched&&c.text===o?c.state:_f(o);return l.set(r,{text:o,query:a,state:p}),p};return{props:{text:"string",write:"boolean",id:"id"},state:(n,{api:r,key:o,props:i})=>t(r,o,i.text),attrs:(n,{api:r,key:o,props:i})=>({"data-matched":t(r,o,i.text).matched?"":void 0}),bind(n,{api:r,key:o,props:i,store:s}){if(!i.write)return;let a,l=()=>{let f=t(r,o,i.text);if(f===a)return;a=f,n.replaceChildren(...f.segments.map(({text:p,match:u})=>{if(!u)return p;let m=n.ownerDocument.createElement("mark");return m.textContent=p,m}))};l();let c=s.subscribe(l);return()=>{c(),n.textContent=i.text}}}}var Va=(e)=>!!e&&An(e)&&Ge(e)==="virtual",Uf=500;function qa({store:e,query:t,count:n,loading:r,shown:o,silent:i,announcement:s}){let a,l=t(),c=r(),f=!1,p=()=>{if(a=void 0,!o()||i()||!t().trim())return;let u={type:"results",count:n(),query:t(),loading:r()},m=(s()??zf)(u);if(m)Ca(m);f=u.loading};e.subscribe(()=>{let u=t(),m=r(),g=u!==l,A=c&&!m&&f;if(l=u,c=m,!g&&!A)return;clearTimeout(a),a=setTimeout(p,Uf)})}function Ha({count:e,status:t,onLoadMore:n}){let r=-1;function o(){let s=n(),a=t();if(!s||a==="loading")return;if(e()===r&&a!=="error")return;r=e(),s()}function i(s){let a=(l)=>{let c=l.target;if(!(c instanceof HTMLElement))return;if(c.scrollTop+c.clientHeight>=c.scrollHeight-40)o()};return s.addEventListener("scroll",a,{capture:!0,passive:!0}),()=>s.removeEventListener("scroll",a,{capture:!0})}return{reached:o,bind:i}}De();Pe();var Xn=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e),ja=new WeakMap;function Yf(e){let t=ja.get(e);if(t)return t;let n={selectors:new Map,selecting:new Map};return ja.set(e,n),e.setFanout((r,o,i,s)=>{let a=e.get(),l=r,c,f=(p)=>{let u=c?.get(String(p));if(typeof u==="function")u(i,s,l);else if(u)for(let m of u)m(i,s,l)};for(let p=0;p<r.length;p++){let u=r[p],m=n.selecting.get(u);if(!m)continue;c=n.selectors.get(u);let g=o[u];for(let[A,{naming:d}]of m)if(A(g,a[u],f)===!0)for(let b of d)b(i,s,l)}}),n}function Xf(e){if(typeof e==="string")return`s${e.length}:${e}`;if(typeof e==="number")return`n:${e}`;if(typeof e==="boolean")return e?"t":"f";if(e===null)return"0";if(e===void 0)return"u";return`o:${String(e)}`}function Ba(e){let t=Object.entries(e).filter(([,s])=>Xn(s)||typeof s==="function"||s.length>0),n=(s,a)=>Xn(s)?s.values(a):typeof s==="function"?s(a):s,r=(s)=>{let a=e[s];return Xn(a)?a.moved:So},o=(s)=>{let a=`${s.length}:`;for(let l=0;l<s.length;l++){if(l)a+=",";a+=Xf(s[l])}return a},i=!t.length?"":t.every(([,s])=>Array.isArray(s))?t.map(([s,a])=>`${String(s)}=${o(a)}`).join("|"):void 0;return{reading(s,a,l){let c=Object.hasOwn(e,l)?e[l]:void 0;if(c===void 0||Xn(c))return;let f=typeof c==="function"?c(qe(s,a)):c;return f},selection(s,a){if(i!==void 0)return i;let l=qe(s,a),c="";for(let f=0;f<t.length;f++){let[p,u]=t[f];if(f)c+="|";c+=`${String(p)}=${o(n(u,l))}`}return c},subscribe(s,a,l){let{store:c}=s,f=$n(c,e,a);if(!t.length)return f;let p=Yf(c),u=qe(s,l),m=[];for(let A=0;A<t.length;A++){let[d,b]=t[A],v=n(b,u),y=r(d);m.push([d,v,y]);for(let I=0;I<v.length;I++)Gf(p,d,v[I],a,y);if(y!==So)za(p,d,y,a)}let g=!0;return()=>{if(!g)return;g=!1,f();for(let A=0;A<m.length;A++){let[d,b,v]=m[A];for(let y=0;y<b.length;y++)Qf(p,d,b[y],a,v);if(v!==So)_a(p,d,v,a)}}}}}function Gf(e,t,n,r,o){za(e,t,o);let i=e.selectors.get(t);if(!i)e.selectors.set(t,i=new Map);let s=String(n),a=i.get(s);if(!a)i.set(s,r);else if(typeof a==="function"){if(a!==r)i.set(s,new Set([a,r]))}else a.add(r)}function Qf(e,t,n,r,o){let i=e.selectors.get(t),s=String(n),a=i?.get(s);if(a===r)i.delete(s);else if(typeof a==="object"){if(a.delete(r),!a.size)i.delete(s)}if(i&&!i.size)e.selectors.delete(t);_a(e,t,o)}function za({selecting:e},t,n,r){let o=e.get(t);if(!o)e.set(t,o=new Map);let i=o.get(n);if(!i)o.set(n,i={held:0,naming:new Set});if(i.held++,r)i.naming.add(r)}function _a({selecting:e},t,n,r){let o=e.get(t),i=o?.get(n);if(!o||!i)return;if(r)i.naming.delete(r);if(--i.held)return;if(o.delete(n),!o.size)e.delete(t)}function So(e,t,n){if(e==null)e=Ka(t,e);else if(t==null)t=Ka(e,t);if(ko(e)&&ko(t)){for(let i in e)if(!Object.hasOwn(t,i)||!Object.is(e[i],t[i]))n(i);for(let i in t)if(!Object.hasOwn(e,i))n(i);return}if(!Array.isArray(e)||!Array.isArray(t)){n(e),n(t);return}let r=0,o=0;while(r<e.length&&e[r]===t[r])r++;while(o<e.length-r&&o<t.length-r&&e[e.length-1-o]===t[t.length-1-o])o++;for(let i=r;i<e.length-o;i++)n(e[i]);for(let i=r;i<t.length-o;i++)n(t[i])}var ko=(e)=>!!e&&Object.getPrototypeOf(e)===Object.prototype,Jf=[],Zf={},Ka=(e,t)=>Array.isArray(e)?Jf:ko(e)?Zf:t;var xb=Object.freeze({}),ep=Object.freeze({}),tp=Object.freeze({}),Ao=Symbol(),en=(e)=>e.owner,He=(e)=>en(e).slots[e.slot],Ga=class{slot;key;mapKey;id;store;props;el=void 0;owner;leases=0;constructor(e,t,n,r,o,i,s){this.slot=e,this.key=t,this.mapKey=n,this.id=r,this.store=o,this.props=i,this.owner=s}get api(){return this.owner.api}},np=class{id;key;props;[Ao];constructor(e,t){this.id=e.id,this.key=e.key,this.props=t,this[Ao]=e}get api(){return rl(this[Ao])}},rp=class{el;id;key;props;store;#e;constructor(e,t){this.el=e.el,this.id=e.id,this.key=e.key,this.props=t,this.store=e.store,this.#e=e}get api(){return rl(this.#e)}};function qe(e,t){let n=e;if(n.owner.sleeping)return new np(n,t);let r=n.view;if(r&&r.props===t&&r.api===e.api)return r;let o={id:e.id,key:e.key,props:t,api:e.api};if(t===e.props)n.view=o;return o}var Ua=(e,t=e.props)=>en(e).sleeping?new rp(e,t):{el:e.el,id:e.id,key:e.key,props:t,store:e.store,api:e.api};function Qa(e){if(e.dropped&&!e.owner.parts.has(e.mapKey))Jn(e),e.dropped=!1;e.leases++;let t=!0;return()=>{if(!t)return;if(t=!1,--e.leases)return;let{owner:n}=e;if(!n.released)n.released=[e],queueMicrotask(()=>Za(n));else n.released.push(e)}}function Ja(e){let{owner:t}=e;if(!t.released)t.released=[e],queueMicrotask(()=>Za(t));else t.released.push(e)}function Za(e){let t=e.released;if(!t)return;e.released=void 0;for(let n=0;n<t.length;n++){let r=t[n];if(!r.leases&&e.parts.get(r.mapKey)===r){e.parts.delete(r.mapKey);let o=e.keyed.get(r.slot);if(o===r)e.keyed.delete(r.slot);else if(o instanceof Map&&o.get(r.key)===r)o.delete(r.key);r.dropped=!0}}}function Eo(e){let{parts:t}=e;if(e.unordered){e.unordered=!1;let n=0,r=!0;for(let o of t.values()){if(o.rank<n){r=!1;break}n=o.rank}if(!r){let o=[...t.values()].sort((i,s)=>i.rank-s.rank);t.clear();for(let i of o)t.set(i.mapKey,i)}}return t}function Jn(e){let{owner:t}=e,{parts:n,keyed:r}=t;e.rank=++t.rank,n.set(e.mapKey,e);let o=r.get(e.slot);if(!o)r.set(e.slot,e);else if(o instanceof Map)o.set(e.key,e);else if(o.key===e.key)r.set(e.slot,e);else{let i=new Map;i.set(o.key,o),i.set(e.key,e),r.set(e.slot,i)}}function ft(e,t=e.props,n=e.store.get()){let r=en(e),o=r.slots[e.slot],i=o.role,s=o.attrs||typeof i==="function"||he&&o.live?qe(e,t):void 0,a=o.attrs?.(n,s),l=typeof i==="function"?i(n,s):i;if(he)Gi(o,e.slot,a,l,{component:r.label,id:e.id},o.live?.read(n,s));if(a){let u=Zt.get(o);if(u===void 0)Zt.set(o,("hidden"in a?Po:0)|("id"in a?Jt:0));else if(!(u&Jt)&&"id"in a)Zt.set(o,u|Jt)}let c=t.id;e.made=c===void 0||a?.id!==c?a?.id??null:void 0;let f=r.slotNames[e.slot]??(r.slotNames[e.slot]=e.slot==="root"?r.name:`${r.name}-${e.slot}`),p=i===void 0?{"data-slot":f,...a}:{"data-slot":f,role:l,...a};if(i!==void 0)p.role=l;return sl(e,p)}var pt=new Set(["aria-label","aria-labelledby","aria-description","title","autocomplete","autocapitalize","autocorrect","spellcheck","inputmode","enterkeyhint"]);function Co(e,t){let n;for(let r in e)if(e[r]!==void 0&&pt.has(r)&&t(r))(n??={...e})[r]=void 0;return n??e}var Zn=(e)=>typeof e==="string"&&e.split(/\s+/).every((t)=>t.startsWith("ui-sdk-"));function er(e,t=e.props,n=e.store.get()){let r=He(e).present;return r?r(n,qe(e,t)):!0}function Mo(e){return He(e).present!==void 0}function el(e,t=e.props){let n=He(e).live;return n?sl(e,n.read(e.store.get(),qe(e,t))):ep}var tr=(e,t=e.props)=>He(e).selects?.selection(e,t)??"";var op={};function Pt(e,t,n=e.props){let r=He(e).selects,o=Qa(e),i=r?r.subscribe(e,t,n):$n(e.store,op,t);return()=>{o(),i()}}function tl(e){let t=e,n=He(e);if(t.handlersFor===n&&t.handlers)return t.handlers;let{on:r,press:o}=n;if(!r&&typeof o!=="function")return t.handlersFor=n,t.handlers=tp;let i={};for(let s in r){let a=r[s];i[s]=(l)=>{if(l.defaultPrevented||mp(l))return;a(l,Ua(e))}}if(typeof o==="function"&&!i.click)i.click=(s)=>{if(!s.defaultPrevented)t.owner.sleeping?.wake(),o(Ua(e),s)};return t.handlersFor=n,t.handlers=i}function nl(e){e.propsListeners?.forEach((t)=>t())}function rl(e){return en(e).sleeping?.wake(),e.api}function ol(e,t){let n=e.propsListeners??=new Set;return n.add(t),()=>{n.delete(t)}}var Po=1,Jt=2,Zt=new WeakMap,Ya=new WeakMap;function ip(e){let t=Ya.get(e);if(!t)t=new Set(e),Ya.set(e,t);return t}function sp(e){let t=He(e),n=Zt.get(t);if(n===void 0){let r=t.attrs?.(e.store.get(),qe(e,e.props));n=r?("hidden"in r?Po:0)|("id"in r?Jt:0):0,Zt.set(t,n)}return n}function Oo(e,t,n={by:"core"}){let r=e,{owner:o}=r,i=e.el?r:o.parts.get(r.mapKey);if(!i)Jn(r);else if(!e.el&&i===r&&r.rank!==o.rank)r.rank=++o.rank,o.unordered=!0;let s=He(e);if(he){ap(e,e.el,t);let{focus:u}=s;Qi(typeof u==="function"?u(e.store.get(),qe(e,e.props)):u,e.slot,t,{component:o.label,id:e.id})}let a={};e.el=t,r.binding=a;let l=[Qa(r)],c=sp(e);if(c&Po)mo(t.ownerDocument);if((n.by==="core"||n.attaches!=="all")&&(s.on||typeof s.press==="function")){let u=n.by==="framework"&&n.attaches!=="all"?ip(n.attaches):void 0,m=n.by==="core";if(u){for(let g in s.on)if(!u.has(g)){m=!0;break}if(!m&&typeof s.press==="function"&&!u.has("click"))m=!0}if(m){let g=tl(e);for(let A in g)if(!u||!u.has(A))l.push(se(t,A,g[A]))}}if(s.live)l.push(s.live.attach(e,t));if(n.by==="framework"&&s.direct)l.push(s.direct.attach(e,t));let f=s.asleep?.(t,e);if(f)l.push(f);let{sleeping:p}=o;if(p&&s.bind){let u=()=>{let m=s.bind?.(t,e);if(m)l.push(m)};p.binds.add(u),l.push(()=>p.binds.delete(u))}else if(s.bind){let u=s.bind(t,e);if(u)l.push(u)}if(c&Jt&&typeof MutationObserver<"u")l.push(cp(r,t));return()=>{for(let u=0;u<l.length;u++)l[u]();if(r.binding!==a)return;if(e.el=r.binding=void 0,r.own!==void 0)Qn(r)}}function ap(e,t,n){if(!e.key||!t||t===n)return;queueMicrotask(()=>{if(e.el!==n||!t.isConnected||!n.isConnected)return;let{parts:r,label:o}=en(e);for(let i of r.values())if(i.el===t)return;Ae(`two "${e.slot}" parts share the key "${e.key}". Give each an id or a unique value.`,{component:o,id:e.id})})}var To=(e,t)=>He(e).connect?.(t)??(()=>{}),Gn=["aria-activedescendant","aria-controls","aria-describedby","aria-details","aria-errormessage","aria-flowto","aria-labelledby","aria-owns","for","headers"],il=(e)=>He(e).attrs?.(e.store.get(),qe(e,{...e.props,id:void 0})).id;function sl(e,t){let{owner:n}=e;if(!n.named?.size||!Gn.some((i)=>t[i]))return t;let r=lp(n,e.store);if(!r.size)return t;let o={...t};for(let i of Gn){let s=o[i];if(s)o[i]=s.split(" ").map((a)=>r.get(a)??a).join(" ")}return o}function lp(e,t){let n=Nn(t);if(e.aliases?.version===n)return e.aliases.map;let r=new Map;for(let o of e.named){let i=il(o);if(i!==void 0&&i!==o.own)r.set(i,o.own)}return e.aliases={version:n,map:r},r}function cp(e,t){let n=al(t);if(e.own!==void 0||n&&n!==e.made)Qn(e);let r=dt.get(t);if(!r)dt.set(t,e),dp().observe(t,up);else if(r instanceof Set)r.add(e);else if(r!==e)dt.set(t,new Set([r,e]));Xa++;let o=!0;return()=>{if(!o)return;o=!1;let i=dt.get(t);if(i===e)dt.delete(t);else if(i instanceof Set){if(i.delete(e),!i.size)dt.delete(t)}if(!--Xa&&Mt)Mt.disconnect(),Mt=void 0}}var up={attributeFilter:["id"]},dt=new WeakMap,Mt,Xa=0;function dp(){if(!Mt)Mt=new MutationObserver((e)=>{for(let{target:t}of e){let n=dt.get(t);if(n instanceof Set)for(let r of n)Qn(r);else if(n)Qn(n)}});return Mt}function Qn(e){let{owner:t}=e;if(!t.unread)t.unread=new Set,Xe(()=>fp(t,e.store));t.unread.add(e)}function fp(e,t){let n=e.unread;e.unread=void 0;let r=e.renamed===!0;e.renamed=void 0;for(let o of n)r=pp(o,o.el&&al(o.el))||r;if(r)ea(t)}function al(e){let t=e.id;return t&&typeof t==="object"?e.getAttribute("id"):t}function pp(e,t){let n=il(e),r=t&&t!==n?t:void 0;if(r===e.own)return!1;let{owner:o}=e;if(e.own=r,o.named??=new Set,r===void 0)o.named.delete(e);else o.named.add(e);return o.aliases=void 0,n!==void 0}function mp(e){return(e.type==="keydown"||e.type==="keyup")&&(typeof e.key!=="string"||Ct(e))}function Io(e){return{read:e,attach(t,n){let r=`live:${t.id}`,o=()=>tn(n,el(t),r);o();let i=Pt(t,o);return()=>{i(),tn(n,{},r)}}}}function ll(e){let t=new WeakMap;return{names:e,attach:(n,r)=>{let o=ft(n),i=t.get(r);if(i){for(let[a,l]of i)if(o[a]===void 0&&r.getAttribute(a)===l)r.removeAttribute(a);i.clear()}let s=(a)=>{for(let l=0;l<e.length;l++){let c=e[l],f=a[c];if(f===void 0){if(o[c]!==void 0&&r.getAttribute(c)===o[c])r.removeAttribute(c);continue}let p=r.getAttribute(c);if(p===f)continue;if(pt.has(c)&&p!==null&&p!==o[c])continue;if(r.setAttribute(c,f),!i)t.set(r,i=new Map);i.set(c,f)}o=a};return s(o),Pt(n,()=>s(ft(n)))}}}var rr=new WeakMap,mt=new WeakMap,nr;function tn(e,t,n="render"){cl(e,t,n,!1)}function Lo(e,t){cl(e,{},t,!0)}function nn(e,t){if(e===nr)return;for(let n of Object.values(rr.get(e)??{}))n.delete(t);for(let n of Object.values(mt.get(e)??{}))n.delete(t)}function cl(e,t,n,r){let o=nr;nr=e;try{hp(e,t,n,r)}finally{nr=o}}function hp(e,t,n,r){let o=rr.get(e);if(!o&&!r){gp(e,t,n);return}yp(e,t,n,r,o)}function gp(e,t,n){let r=new Map;if(t.style!==void 0){for(let[o,i]of fl(t.style))if(r.set(`style:${o}`,i),e.style.getPropertyValue(o)!==i)e.style.setProperty(o,i)}for(let[o,i]of Object.entries(t)){if(i===void 0||o==="style")continue;let s=e.getAttribute(o);if(o==="id"&&ul(s,{},n))continue;if(s!==null&&s!==i&&pt.has(o)&&!(o==="aria-labelledby"&&Zn(s)))continue;if(r.set(o,i),s!==null)Do(e,n,o,s);if(s===i)continue;if(o==="value"&&dl(e)&&e.value!==i)e.value=i;e.setAttribute(o,i)}rr.set(e,{[n]:r})}function yp(e,t,n,r,o){let i=o?.[n],s=!1,a=!1;for(let g in t)if(t[g]!==void 0){if(s=!0,pt.has(g))a=!0}if(!i&&!s){if(r)delete mt.get(e)?.[n];return}if(!o)rr.set(e,o={});let l=new Map,c=t.style===void 0?void 0:fl(t.style);if(c)for(let g=0;g<c.length;g++)l.set(`style:${c[g][0]}`,c[g][1]);for(let g in t){let A=t[g];if(A!==void 0&&g!=="style")l.set(g,A)}let f=l.has("id")||i?.has("id")?e.getAttribute("id"):null,p=ul(f,o,n);if(p)l.delete("id");if(!a&&i){for(let g of i.keys())if(pt.has(g)){a=!0;break}}let u,m;if(a){u=new Set,m=new Map;let g=(A)=>{if(!pt.has(A)||m.has(A))return;let d=e.getAttribute(A);if(m.set(A,d),d===null||d===l.get(A)||A==="aria-labelledby"&&Zn(d))return;for(let b in o)if(o[b].get(A)===d)return;u.add(A)};for(let A of l.keys())g(A);if(i)for(let A of i.keys())g(A);for(let A of u)l.delete(A)}if(i)for(let g of i.keys()){if(l.has(g)||u?.has(g)||g==="id"&&p)continue;if(g.startsWith("style:")){e.style.removeProperty(g.slice(6));continue}if(!r){e.removeAttribute(g),Do(e,n,g,null);continue}let A=e.getAttribute(g);if(A!==i.get(g))continue;let d=mt.get(e)?.[n]?.get(g);if(d===void 0)e.removeAttribute(g);else if(A!==d)e.setAttribute(g,d)}if(c)for(let g=0;g<c.length;g++){let[A,d]=c[g];if(e.style.getPropertyValue(A)!==d)e.style.setProperty(A,d)}for(let g in t){let A=t[g];if(A===void 0||!l.has(g))continue;let d=g==="id"?f:m?.has(g)?m.get(g):e.getAttribute(g);if(d!==(i?.get(g)??null))Do(e,n,g,d);if(d===A)continue;if(g==="value"&&dl(e)&&e.value!==A)e.value=A;e.setAttribute(g,A)}if(l.size)o[n]=l;else delete o[n];if(r)delete mt.get(e)?.[n]}function Do(e,t,n,r){let o=r==null||n==="id"?void 0:Gn.includes(n)?bp(r):r;if(o===void 0)return void mt.get(e)?.[t]?.delete(n);let i=mt.get(e);if(!i)mt.set(e,i={});(i[t]??=new Map).set(n,o)}var bp=(e)=>e.split(/\s+/).filter((t)=>t&&!t.startsWith("ui-sdk-")).join(" ")||void 0;function ul(e,t,n){if(e===null||e===t[n]?.get("id"))return!1;if(!e.startsWith("ui-sdk-"))return!0;for(let r in t)if(t[r].get("id")===e)return!0;return!1}var dl=(e)=>e.localName==="textarea"||e.localName==="input"&&e.type!=="file";function fl(e){let t=[];for(let n of e.split(";")){let r=n.indexOf(":");if(r>0)t.push([n.slice(0,r).trim(),n.slice(r+1).trim()])}return t}function Qe(e,t){let n=[...e.parts()].filter((r)=>r.slot===t&&!!r.el?.isConnected);return st(n).map(({el:r,key:o,props:i})=>({el:r,key:o,props:i}))}var vp=(e)=>e==="fuzzy"?Ns:e;function pl(e,t){let{id:n,store:r,options:o}=e,i=!1,s=null,a,l=()=>a??t.query(),c,f=Ha({count:()=>p.count(),status:()=>r.get().status,onLoadMore:()=>o().onLoadMore}),p=Ks({store:r,focus:()=>r.get().focusInList?"real":"virtual",items:t.items,emptyItems:t.emptyItems,toKey:(y)=>String(y??""),filter:()=>vp(t.filter()),rank:()=>t.filter()==="fuzzy"||typeof t.filter()==="function",query:l,loop:()=>o().loop??!0,skipDisabled:!0,active:()=>r.get().open,onHighlight:t.onHighlight,onLastReached:f.reached,container:t.container,scrollRoot:t.scrollRoot,onRegister(){if(i)return;i=!0,Xe(()=>{i=!1,r.set({mounts:r.get().mounts+1})})}});na(r,p);let u=(y)=>e.props("item",y);function m(y){let{highlighted:I,settled:T}=r.get();if(!t.items()&&!T)return I;let B=t.autoHighlight(),X=B==="always"||B==="typing"&&l()!=="",F=I!==null&&p.entries().some((U)=>U.key===I),H=X?t.preferred?.(p)??p.firstEnabled()??null:null;return y&&X?H:F?I:H}function g(y,I){let T=m(y);if(T!==r.get().highlighted)t.highlight(T,I)}function A(y){let I=ao(y,{apple:_t()});if(I===void 0||y.altKey&&y.key==="ArrowUp")return!1;if(!r.get().open){if(!t.open||I!==1&&I!==-1)return!1;return y.preventDefault(),t.open(y,I===-1?"last":"first"),!0}y.preventDefault();let T=p.stepKey(I);if(T!==void 0)t.highlight(T,{reason:"list-navigation",event:y});return!0}let d=t.query(),b=r.get();r.subscribe(()=>{let y=r.get(),I=b;b=y;let T=t.query();if(T!==d){d=T;let B=s??{reason:"imperative"};s=null,g(!0,B)}else if(y.mounts!==I.mounts&&!t.settlesMount?.()||y.items!==I.items||y.settled!==I.settled){let B=I.highlighted===null?null:{reason:"item-removed"};if(y.highlighted!==I.highlighted)t.highlight(y.highlighted,B);else g(!1,B)}}),e.onOptions(()=>{if(c===void 0)return;let y=c,I=s;c=void 0,queueMicrotask(()=>{if(t.query()===y)g(!0,I)})});let v=t.autoHighlight();return e.onOptions(()=>{let y=t.autoHighlight();if(y===v)return;v=y,queueMicrotask(()=>g(!1,{reason:"imperative"}))}),qa({store:r,query:t.query,count:()=>p.count(),loading:()=>r.get().status==="loading",shown:()=>r.get().open,silent:()=>Qe(e,"status").length>0,announcement:()=>o().announcement}),{listbox:p,itemProps:u,settledHighlight:m,settle:g,navigate:A,loadMore:f,matchQuery:t.query,matchMode:()=>Na(t.filter()),cause(y,I){s={reason:y,event:I}},settleFor(y){c=t.query(),a=y;try{g(!0,s)}finally{a=void 0}},hover(y,I){if(I.pointerType==="touch"||!r.get().open||u(y)?.disabled)return;if(r.get().highlighted!==y)t.highlight(y,{reason:"item-hover",event:I})},isEmpty:(y)=>(!!t.items()||y.settled)&&p.count()===0,itemCount:()=>p.count(),filterQuery:t.query,activeDescendant(y){let{highlighted:I}=y;if(!y.open||y.focusInList||I===null)return;if(!p.element(I)?.isConnected)return;return`${n}-option-${Et(I)}`}}}function ml(){let e=(t,n)=>t.internal.text(n);return{role:"combobox",focus:"native",keys:jn,attrs:(t,{id:n,api:r})=>({id:`${n}-input`,value:e(r,t),autocomplete:"off",autocapitalize:"none",spellcheck:"false","aria-expanded":String(t.open)}),live:Io((t,{api:n})=>({"aria-activedescendant":n.internal.activeDescendant(t)})),on:{input:(t,{api:n,el:r})=>n.internal.typed(r,t),compositionend:(t,{api:n,el:r})=>n.internal.onCompositionEnd(r,t),keydown:(t,{api:n})=>n.internal.onInputKeyDown(t)},bind(t,{api:n,id:r,store:o}){oa(t,o,r);let i=t,s,a=()=>{let l=e(n,o.get());if(l===s)return;if(s=l,i.value!==l)i.value=l};return vs(i,()=>[e(n,o.get())],()=>n.internal.typed(i)),a(),o.subscribe(a)}}}function hl(){return{props:{value:"string",label:"string",keywords:"list",disabled:"boolean",index:"number",group:{kind:"string",from:"group.id"}},role:"option",focus:"active-descendant",attrs:(e,{id:t,key:n,props:r,api:o})=>({id:`${t}-option-${Et(n)}`,tabindex:e.focusInList?"-1":void 0,"aria-disabled":r.disabled?"true":void 0,"aria-selected":void 0,...ha(r.index,o.internal.listbox),hidden:o.internal.listbox.matches(n,r)?void 0:"","data-disabled":r.disabled?"":void 0}),direct:ll(["hidden"]),live:Io((e,{key:t})=>({"aria-selected":e.highlighted===t?"true":"false","data-highlighted":e.highlighted===t?"":void 0})),on:{...it,pointermove:(e,{api:t,key:n})=>t.internal.hover(n,e)},press:({api:e,key:t},n)=>e.internal.press(t,n),bind(e,{api:t,key:n,props:r}){let o=ga(e,{api:t,key:n,props:r});return()=>{o(),e.removeAttribute("data-highlighted"),e.setAttribute("aria-selected","false")}}}}var rn=new WeakMap,Je,wp=!1,gl=0;function bl(e){gl++;try{e()}finally{gl--}}function vl(e){let t=Je,n={starts:[]};Je=n;let r;try{r=e()}finally{Je=t}if(rn.set(r,n),t)t.starts.push(()=>(yl(r),()=>xl(r)));else if(!wp&&typeof document<"u")yl(r);return r}function Ot(e){if(Je)Je.starts.push(e);else if(he)Ae("`whenKept` runs only while an instance is made, so this work never starts.")}function wl(e,t){let n=Je,r={starts:[]};Je=r;try{t()}finally{Je=n}let o=rn.get(e);if(!o)return;o.starts.push(...r.starts);for(let i of o.stops?r.starts:[]){let s=i();if(s)o.stops.push(s)}}function yl(e){let t=rn.get(e);if(!t||t.stops)return;let n=t.stops=[];for(let r of t.starts){let o=r();if(o)n.push(o)}}function xl(e){let t=rn.get(e),n=t?.stops;if(!n)return;t.stops=void 0,n.forEach((r)=>r())}function Sl(e){xl(e),rn.delete(e)}var xp=Symbol.for("ui-sdk.controller.attach"),Sp=Symbol.for("ui-sdk.controller.detach");function kl(e,t){e?.[xp]?.(t)}function Al(e,t){e?.[Sp]?.(t)}function El(e,t){let n=e.options().controller,r=!1;Ot(()=>(r=!0,kl(n,t),()=>{r=!1,Al(n,t)})),e.onOptions(({controller:o})=>{if(o===n)return;if(Al(n,t),n=o,r)kl(o,t)})}Pe();Pe();function kp(e,t){let{x:n,y:r}=e,{borders:o}=t,i=n>=o.left&&n<t.width-o.right&&r>=o.top&&r<t.height-o.bottom,s=n>=t.clientLeft&&n<t.clientLeft+t.clientWidth&&r>=t.clientTop&&r<t.clientTop+t.clientHeight;return i&&!s}function Cl(e,t){if(!(t instanceof Element))return!1;let n=t.ownerDocument;if(t===n.documentElement)return e.clientX>=t.clientWidth||e.clientY>=t.clientHeight;if(t.clientWidth===0&&t.clientHeight===0)return!1;let r=t.getBoundingClientRect(),o=getComputedStyle(t);return kp({x:e.clientX-r.left,y:e.clientY-r.top},{width:r.width,height:r.height,clientLeft:t.clientLeft,clientTop:t.clientTop,clientWidth:t.clientWidth,clientHeight:t.clientHeight,borders:{top:parseFloat(o.borderTopWidth)||0,right:parseFloat(o.borderRightWidth)||0,bottom:parseFloat(o.borderBottomWidth)||0,left:parseFloat(o.borderLeftWidth)||0}})}var xe=globalThis[Symbol.for("ui-sdk.layers@2")]??={stack:[],listening:new Map};function Pl(){return xe.persistent??=new Set}function Ap(e){for(let t of Pl())if(Me(t,e))return!0;return!1}function Ol(){return[...Pl()].filter((e)=>e.isConnected)}function Tl(){return xe.pushed??0}function Fo(e){return Tt().some((t)=>(t.order??0)>e)}function Tt(){return xe.stack.filter((e)=>e.active())}function ir(){return Tt()}function Dl(){return xe.escapeAt??-1/0}function or(e,t,n){return Il(e,On(t),n)}function Il(e,t,n){if(t.some((r)=>e.contains(r,n)))return!0;return Tt().some((r)=>r.parent===e&&(t.some((o)=>r.covers?.(o))||Il(r,t,n)))}function Ep(e,t){let n=!1,r,o;function i(u,m,g){let A=[],d=!1;if(Ap(m))return{dismissed:A,consume:d};for(let b of[...xe.stack].reverse())if(b.active()){if(or(b,m,u))break;if(b.modal!==!1)d=!0;if(A.push(b),b.shield)break}else if(b.exiting?.()){if(or(b,m,u))break;if(b.modal===!1)continue;if(b.overBackdrop?.(g.x,g.y))d=!0;break}return{dismissed:A,consume:d}}function s(u,m,g){let{dismissed:A,consume:d}=i(u,m,g);for(let b of A)b.onOutsidePress?.(u);return d}let a=se(t,"pointerdown",(u)=>{n=!1;let m=u.composedPath()[0];if(u.pointerType==="touch"){r={x:u.clientX,y:u.clientY,target:m};return}if(r=void 0,o=void 0,Cl(u,m))return;let g={x:u.clientX,y:u.clientY},{dismissed:A,consume:d}=i(u,m,g);if(A[0]?.outsidePress==="click"){if(u.button!==0)return;if(o={layer:A[0],target:m,point:g},d)u.preventDefault(),n=!0;return}if(d)u.preventDefault(),n=!0;for(let b of A)b.onOutsidePress?.(u)},{capture:!0}),l=se(t,"pointerup",(u)=>{let m=o;if(o=void 0,!m||!m.layer.active())return;if(or(m.layer,u.composedPath()[0],u))return;s(u,m.target,m.point)},{capture:!0}),c=se(t,"click",(u)=>{if(n&&u.detail){n=!1,u.preventDefault(),u.stopPropagation();return}if(n=!1,!r)return;let m=r;if(r=void 0,Math.hypot(u.clientX-m.x,u.clientY-m.y)>10)return;if(s(u,m.target,{x:m.x,y:m.y}))u.preventDefault(),u.stopPropagation()},{capture:!0}),f=se(e,"keydown",(u)=>Fl(e,u)),p=se(t,"blur",(u)=>{for(let m of Tt().reverse())m.onBlur?.(u)});return()=>{if(a(),l(),f(),p(),!n)return c();let u=()=>(c(),m(),g()),m=se(t,"pointerdown",u,{capture:!0}),g=se(t,"click",u,{capture:!0})}}function on(e,t){return or(e,t)}function sn(e){let t=On(e);return Tt().reverse().find((n)=>t.some((r)=>n.contains(r)))}function Ll(e){xe.closed=e,setTimeout(()=>{if(xe.closed===e)xe.closed=void 0})}function Ro(){return xe.closed}function Ml(){if(!he)return;We({type:"layers",stack:xe.stack.map((e)=>({component:e.component??"popup",id:e.id??"",modal:e.modal,blocking:!!e.blocking,el:e.el}))})}function Cp(e){let t=e.defaultView;if(!t)return()=>{};let n=xe.listening.get(e);if(!n)xe.listening.set(e,n={layers:0,stop:Ep(e,t)});let r=n;return r.layers++,()=>{if(--r.layers>0)return;xe.listening.delete(e),r.stop()}}function $o(e){return e.el?.ownerDocument??document}function Fl(e,t,n){if(t.key!=="Escape"||t.defaultPrevented||Ct(t))return;let r=Tt().filter((o)=>$o(o)===e).at(-1);if(!r?.onEscape||r.takesEscape?.()===!1||n&&r!==n)return;xe.escapeAt=performance.now(),r.onEscape(t)}function Rl(e,t){Fl($o(e),t,e)}function $l(e){xe.pushed=(xe.pushed??0)+1,e.order=xe.pushed,xe.stack.push(e);let t=Cp($o(e));Ml();let n=!1;return()=>{if(n)return;n=!0;let r=xe.stack.indexOf(e);if(r!==-1)xe.stack.splice(r,1);t(),Ml()}}Pe();Ve();De();var je=globalThis[Symbol.for("ui-sdk.modal@2")]??={holders:new WeakMap,thaw:new WeakMap,inert:new WeakMap};function Vl(e=document,t){let n={},r=je.holders.get(e);if(!r)je.holders.set(e,r=new Set);if(!r.size)je.thaw.set(e,Pp(e));r.add(n);let o=t&&at()?Wp(t):void 0;return()=>{if(!r.delete(n))return;if(o?.(),r.size)return;je.thaw.get(e)?.(),je.thaw.delete(e)}}function Mp({scrollbar:e,gutter:t,padding:n}){let r={overflow:"hidden","scroll-behavior":"auto"};if(e>0)if(t)r["scrollbar-gutter"]="stable";else r["padding-right"]=`${n+e}px`;return r}function Pp(e){let{scroller:t,gutter:n,padding:r}=Op.get(e)??Tp(e),o=Mp({scrollbar:n,gutter:typeof CSS<"u"&&CSS.supports("scrollbar-gutter","stable"),padding:r}),i=Object.entries(o).map(([s,a])=>Ne(t,s,a));if(n>0)i.push(Ne(e.documentElement,"--scrollbar-width",`${n}px`));return()=>i.forEach((s)=>s())}var Op=new WeakMap;function Tp(e){let t=e.defaultView??window,n=Dp(e,t),r=t.getComputedStyle(n);return{scroller:n,gutter:Ip(n,e,t,r),padding:parseFloat(r.paddingRight)||0}}function Dp(e,t){let{body:n,documentElement:r}=e;if(!n||t.getComputedStyle(r).overflowY==="visible")return r;return/auto|scroll/.test(t.getComputedStyle(n).overflowY)?n:r}function Ip(e,t,n,r){if(e===t.documentElement)return n.innerWidth-e.clientWidth;let o=(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0);return e.offsetWidth-e.clientWidth-o}function Lp(e,t){let n=t.getComputedStyle(e),r=/auto|scroll/.test(n.overflowY)&&e.scrollHeight>e.clientHeight,o=/auto|scroll/.test(n.overflowX)&&e.scrollWidth>e.clientWidth;return r||o}function Fp(e,t){let{body:n,documentElement:r}=e.ownerDocument;for(let o=e;o&&o!==n&&o!==r;o=o.parentElement)if(Lp(o,t))return!0;return!1}function Rp(e){if(e.fingers>1||e.zoomed)return"browser";if(e.scroller||e.slider||e.selecting)return"element";return"page"}var $p="@layer ui-sdk { [data-scroll-guard], [data-scroll-guard] * { overscroll-behavior: contain } }",Np=8;function Wp(e){let t=e.ownerDocument,n=t.defaultView??window;Te(t,"ui-sdk-scroll-guard",$p);let r=!e.hasAttribute("data-scroll-guard");if(r)e.setAttribute("data-scroll-guard","");let o="browser",i={x:0,y:0},s=!1,a=!0,l=se(t,"touchstart",(p)=>{let u=p.target instanceof Element?p.target:null,m=p.touches[0];i={x:m?.clientX??0,y:m?.clientY??0},s=!1,a=!0,o=Rp({fingers:p.touches.length,zoomed:(n.visualViewport?.scale??1)!==1,scroller:!!u&&Fp(u,n),slider:!!u?.closest('input[type="range"]'),selecting:t.getSelection()?.type==="Range"})},{capture:!0,passive:!0}),c=se(t,"touchmove",(p)=>{let u=p.touches[0];if(!u||Math.hypot(u.clientX-i.x,u.clientY-i.y)>Np)a=!1;if(o==="page"&&p.cancelable)p.preventDefault(),s=!0},{passive:!1}),f=se(t,"touchend",(p)=>{let u=p.target;if(p.defaultPrevented||!s||!a||!p.cancelable||!(u instanceof n.Element))return;if(p.preventDefault(),u.closest("input, textarea, select, [contenteditable]")?.focus(),u instanceof n.HTMLElement)u.click();else u.dispatchEvent(new n.MouseEvent("click",{bubbles:!0,cancelable:!0,composed:!0}))},{passive:!1});return()=>{if(l(),c(),f(),r)e.removeAttribute("data-scroll-guard")}}var Vp='[aria-live]:not([aria-live="off"]):not([data-slot="carousel-content"]),[role="status"],[role="alert"],[role="log"],output';function Nl(e){let t=e.parentNode;return t instanceof ShadowRoot?t.host:t}function Wl(e){let t=e[0]?.ownerDocument??document,n=[...e,...Array.from(t.querySelectorAll(Vp)),...Ol()],r=n.filter((s)=>!n.some((a)=>a!==s&&a.contains(s))),o=new Set;for(let s of r)for(let a=s;a;a=Nl(a))o.add(a);let i=[];for(let s of r)for(let a=s;a&&a!==t.body;a=Nl(a))for(let l of Array.from(a.parentNode?.children??[])){if(o.has(l)||!(l instanceof HTMLElement))continue;let c=je.inert.get(l)??(l.inert?1/0:0);if(c===0)l.inert=!0;if(c!==1/0)je.inert.set(l,c+1);i.push(l)}return()=>{for(let s of i){let a=je.inert.get(s);if(a===void 0)continue;if(a<=1)s.inert=!1,je.inert.delete(s);else je.inert.set(s,a-1)}}}function ql(e){let t=e,n=Wl(t),r=!1,o=(i)=>{let s=n;t=i,n=Wl(i),s()};return Object.assign(()=>{if(r)return;r=!0,n()},{keep(i){if(r)return()=>{};return o([...t,i]),()=>{if(!r)o(t.filter((s)=>s!==i))}}})}Ve();De();var Ue={tab:"close",blur:"always",outsidePress:"pointerdown",shield:!1,keepTrigger:!0,focusOnMount:!1,dismissOnFocusLoss:!0,closeWatcher:!1,blocking:!1,movesFocus:!0},Hl=(e)=>e.trapFocus?"trap":"flow",qp={menu:Ue,select:Ue,combobox:{...Ue,tab:"native"},popover:{...Ue,tab:Hl,blur:"iframe"},dialog:{...Ue,tab:Hl,blur:"never",outsidePress:"click",shield:!0,keepTrigger:!1,focusOnMount:!0,dismissOnFocusLoss:!1,closeWatcher:!0,blocking:(e)=>e.inertAndLock},tooltip:{...Ue,tab:"native",movesFocus:!1},hoverCard:{...Ue,tab:"flow"},navigationMenu:{...Ue,tab:"flow",blur:"never"}};function jl(e,t){let n={...qp[e]};for(let r of Object.keys(Ue)){let o=t[r];if(o!==void 0)Object.assign(n,{[r]:o})}return n}var Hp=()=>globalThis[Symbol.for("ui-sdk.popup-elements@1")]??=new WeakMap;function Dt(e){let t=Hp();t.set(e,(t.get(e)??0)+1);let n=!1;return()=>{if(n)return;n=!0;let r=(t.get(e)??1)-1;if(r>0)t.set(e,r);else t.delete(e)}}Pe();var Kl=["a[href]","area[href]","button","input:not([type='hidden'])","select","textarea","iframe","summary","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])","[tabindex]"].join(",");function No(e){if(!(e instanceof HTMLElement)||e.tabIndex<0)return!1;if(e.matches(":disabled")||e.closest("[inert]"))return!1;if((e.checked?[]:Wo(e)).some((n)=>n.checked&&No(n)))return!1;if(typeof e.checkVisibility==="function")return e.checkVisibility({visibilityProperty:!0});return e.getClientRects().length>0&&getComputedStyle(e).visibility!=="hidden"}function Wo(e){if(!(e instanceof HTMLInputElement)||e.type!=="radio"||!e.name)return[];return(e.form?Array.from(e.form.elements):Array.from(e.getRootNode().querySelectorAll(`input[name="${CSS.escape(e.name)}"]`))).filter((n)=>n instanceof HTMLInputElement&&n.type==="radio"&&n.name===e.name&&n.form===e.form)}function Ze(e){return Array.from(e.querySelectorAll(Kl)).filter(No)}function Vo(e){let t=(o)=>[...o.filter((i)=>i.index>0).sort((i,s)=>i.index-s.index),...o.filter((i)=>i.index<=0)].flatMap((i)=>i.stops),n=(o,i)=>{for(let s of o){let a=s.hasAttribute("tabindex")?s.tabIndex:0;if(s.hasAttribute("inert")||s.shadowRoot&&a<0)continue;let l=s.matches(Kl)&&!s.shadowRoot?.delegatesFocus&&No(s)?[s]:[],c=s instanceof HTMLSlotElement?s.assignedElements():[];if(s.shadowRoot||c.length){let f=[];n(s.shadowRoot?.children??c,f),i.push({index:a,stops:[...l,...t(f)]})}else i.push({index:a,stops:l}),n(s.children,i)}},r=[];return n(e.children,r),r.flatMap((o)=>o.stops)}function Bl(e,t){let n=(r)=>{for(let o=r;o&&o!==t;o=o.parentElement)if(o.assignedSlot)return!0;return!1};return e.filter((r)=>r.tabIndex>0&&!n(r)).sort((r,o)=>r.tabIndex-o.tabIndex)}function zl(e,t){let n=e.ownerDocument??document;return Ze(n.body).find((r)=>!r.contains(e)&&!t?.contains(r)&&Fe(e,r))}var jp="position:fixed;width:1px;height:1px;opacity:0;pointer-events:none;outline:none";function _l(e,t){let n=e.ownerDocument,r,o=[],i=()=>{o.forEach((u)=>u.remove()),o=[],r=void 0},s=()=>{let u=n.createElement("span");return u.tabIndex=0,u.setAttribute("aria-hidden","true"),u.style.cssText=jp,u},a=()=>{let u=n.activeElement;if(o.length||!t()||!(u instanceof HTMLIFrameElement)||!e.contains(u))return;r=u,o=[s(),s()],u.before(o[0]),u.after(o[1])},l=()=>{a(),setTimeout(a)},c=se(n.defaultView??window,"blur",l),f=se(n,"focusout",l),p=se(n,"focusin",(u)=>{let m=o.indexOf(u.target),g=r;if(i(),m<0||!g)return;let A=Ze(e),d=m===0?-1:1;(A.at((A.indexOf(g)+d)%A.length)??e).focus({preventScroll:!0})});return()=>{c(),f(),p(),i()}}function lr(e){return{consumeOutsidePress:e===!0||e==="pointer",trapFocus:e===!0||e==="trap-focus",inertAndLock:e===!0}}var Kp={mouse:"pointer",pen:"pointer",touch:"touch",keyboard:"keyboard",virtual:"keyboard",programmatic:"imperative",agent:"imperative"},Zl=(e)=>e?Kp[Ge(e)]:"imperative",Bp=new Set;function zp(e){if(e==="initial"||e==="hover")return"none";if(e==="touch")return"popup";return"auto"}function _p(e){if(e.focusable&&!e.consumed)return!1;return e.type==="pointerdown"?"later":!0}var Up=new Set(["text","search","url","tel","email","password"]);function Yp(e){if(e.localName==="input"&&Up.has(e.type)&&e.value&&e.getAttribute("aria-expanded")!=="true")e.select()}function Ul(e,t){for(let n of e){let r=n();if(r&&t(r))return r}}function jo(e,t,n){lt(e,t,(r,o)=>("open"in r)&&r.open!==o.open?n(!!r.open,o):void 0)}function ec(e,t){return{id:`${t}-content`,tabindex:"-1",hidden:e.mounted?void 0:"",...ut(e.open)}}var Xp="a[href],button,input,select,textarea,summary,[tabindex],[contenteditable]";function Gp(e,t){if(typeof e==="function")return e()??void 0;if(typeof e==="string")return t.querySelector(e)??void 0;return e}function sr(e){return e.isConnected&&!e.closest("[inert]")}function Yl(e){let t=e.getRangeAt(0).cloneRange(),n=!t.collapsed&&e.anchorNode===t.endContainer&&e.anchorOffset===t.endOffset;return{range:t,backward:n}}function qo(){let e=we();return!e||e===e.ownerDocument.body||!sr(e)||e.checkVisibility?.()===!1}function Ho(e,t){return e.x<t.left||e.x>t.right||e.y<t.top||e.y>t.bottom}function Xl(e){return e.getRootNode().activeElement}function Qp(e){let t=globalThis.CloseWatcher;if(!t||!/Android/.test(navigator.userAgent))return;let n;try{n=new t}catch{return}return n.addEventListener("close",(r)=>{if(performance.now()-Dl()<100)return;e(r)}),()=>n?.destroy()}var Gl=new WeakMap,ar=new WeakSet,Ql=new WeakMap;function Jl(e,t){for(let n=e;n;n=n.parent)if(n===t||ar.has(n)&&(n.order??0)>(t.order??0))return!0;return!1}function tc(e){let t=jl(e.preset,e),n=()=>typeof t.tab==="function"?t.tab(e.modal()):t.tab,{store:r}=e,o,i,s,a=!1,l,c,f,p=r.get().open?"initial":"imperative",u=t.focusOnMount&&r.get().open,m=!1,g=!1,A=!1,d=!0,b=!1,v,y=!1,I,T=r.get().open,B=()=>{return},X=[],F=e.returnTrigger??e.trigger,H,U,te,Z,re=(k,L)=>e.onOpenChangeComplete?.(k,L),ce=(k)=>k||!!i?.el&&Ee;jo({store:r},["mounted"],(k)=>ce(k)===k?{mounted:k}:void 0);function ae(k){v=k;let L=k?.isContentEditable?k.ownerDocument.getSelection():null;I=L?.rangeCount&&k.contains(L.anchorNode)?Yl(L):void 0;let D=v&&sn(v),w=D?void 0:Ro();B=D?.returnTarget??(()=>w)}let q=r.get().open;r.subscribe(()=>{let{open:k}=r.get();if(k===q)return;if(q=k,k){if(Z?.(!0),e.onOpenChange?.(!0),l?.(),l=void 0,i){for(let V of[i.el,i.backdrop])if(V)go(V,!0)}let G=e.trigger();b=p==="imperative"&&!!G&&Bp.has(G),u=!b,m=!0,d=!0;let pe=Ee?we():null;ae(pe&&pe!==pe.ownerDocument.body?pe:void 0);let ye=F();T=p==="imperative"||A&&!!v&&!sn(v)&&!Ro()&&!(ye&&Me(ye,v));let W=!!i;if(r.set({mounted:!0}),o){if(W)le();ee()}else if(!Ee)m=!1,re(!0);return}let L=t.movesFocus&&!b&&d;d=!0,u=!1,m=!1,p="imperative",A=!1;let D=Z?.(!1);a=D?.reason==="outside-press";let w=i?.el;if(s)Ll(M());let O=B,P=I;if(I=void 0,!w||!Ee){e.onOpenChange?.(!1,D),r.set({mounted:!1}),re(!1,D);return}let R=we(),K=e.trigger(),J=!R||R===w.ownerDocument.body||Me(w,R)||!!s&&on(s,R)&&!(K&&Me(K,R));e.onOpenChange?.(!1,D),o?.config.onClose?.();let oe=Tl(),ie=e.finalFocus?.()??"trigger",de=[w,...i?.backdrop?[i.backdrop]:[]];de.forEach((G)=>go(G,!1));let h=!1,E=pa(de,()=>{h=!0,l=void 0,r.set({mounted:!1}),le(),re(!1,D)});if(!h)l=E;if(c?.(),c=void 0,f?.(),f=void 0,!L||!J)return;if(L===!0){N(w,O,!1,P,ie);let G=we();setTimeout(()=>{if(G&&!G.isConnected&&qo()&&!Fo(oe))N(w,O,!1,void 0,ie)});return}if(L==="unless-moved"){queueMicrotask(()=>{let G=we();if(!(!!G&&G!==w.ownerDocument.body&&!Me(w,G))&&!Fo(oe))N(w,O,!1,P,ie)});return}let C=()=>{j(),clearTimeout(Y),setTimeout(()=>{let G=we();if(!G||G===w.ownerDocument.body)N(w,O,!1,P,ie)})},j=se(window,"pointerup",C,{capture:!0}),Y=setTimeout(C,1000)});function x(k,L,D=B,w=!1){let O=()=>D(L,w),P=()=>_(k,w);return T?[()=>v,O,F,P,e.trigger]:[F,()=>v,O,P,e.trigger]}let S=!1;function M(k=sr,L=!1){if(S)return;S=!0;try{return Ul(x(i?.el,k,B,L),k)}finally{S=!1}}function _(k,L=!1){let D=X[0]?.node;if(D?.isConnected&&!k?.contains(D)){for(let h of[...X.slice(1).map((E)=>E.node),D.ownerDocument.body]){let E=Ze(h).filter((j)=>!k?.contains(j)),C=E.find((j)=>Fe(D,j)&&!D.contains(j))??E.filter((j)=>Fe(j,D)).pop();if(C)return C}return}let w=X.findIndex((h,E)=>!h.node.isConnected&&X[E+1]?.node.isConnected);if(w===-1)return;let O=X[w],P=O.next?.deref(),R=O.previous?.deref(),K=X[w+1].node,J=(h)=>!!h?.isConnected&&h.parentNode===K,oe=J(P)?P.previousElementSibling===(O.previous?R:null):!O.next&&(O.previous?J(R)&&!R.nextElementSibling:!K.firstElementChild);if(L&&!oe)return;let ie=(h,E)=>h.contains(E)||Fe(h,E),de=J(P)?(h)=>ie(P,h):J(R)?(h)=>Fe(R,h)&&!R.contains(h):(h)=>ie(K,h);for(let{node:h}of X.slice(w+1)){let E=Ze(h).filter((Y)=>!k?.contains(Y)),C=J(R)?E.filter((Y)=>!ie(R,Y)||R.contains(Y)).pop():void 0,j=E.find(de)??C??E[0];if(j)return j}}function N(k,L,D=!1,w,O=e.finalFocus?.()??"trigger"){if(O==="none")return;let P=(K)=>{if(!sr(K)||k.contains(K))return!1;let J=K.ownerDocument.getSelection(),oe=w&&K===v?J?.rangeCount&&K.contains(J.anchorNode)?Yl(J):w:void 0;if(Yn(K),we()!==K)return!1;if(oe&&K.contains(oe.range.startContainer)){let{startContainer:ie,startOffset:de,endContainer:h,endOffset:E}=oe.range;if(oe.backward)J?.setBaseAndExtent(h,E,ie,de);else J?.setBaseAndExtent(ie,de,h,E)}return!0},R=x(k,P,L,D);if(O!=="trigger")R.unshift(()=>Gp(O,k.ownerDocument));Ul(R,P)}function Q(k,L){if(!u||!i||!r.get().open||!t.movesFocus)return;u=!1;let D=zp(p),w=p==="initial"&&t.focusOnMount||D==="popup"&&L?.()?"auto":D;if(w==="none")return;let O=()=>{if(!i||!r.get().open)return;let P=w==="popup"?i.el:k?.();if(!P)return;if(xo(P),!i||!r.get().open)return;let R=we();if(!R||!Me(P,R)&&!Me(i.el,R)){xo(i.el);return}Yp(P)};if(g)requestAnimationFrame(()=>{let P=we();if(!i||!P||!Me(i.el,P))O()});else O()}function ne(k,L,D){let w=[],O=e.trigger(),P=L.host?.()??k;if(p==="initial"&&!v){let W=we();ae(W&&W!==W.ownerDocument.body&&!Me(k,W)?W:void 0)}k.removeAttribute("hidden"),P.removeAttribute("hidden");let R=i?.backdrop;if(R){let W=fe(R,L.inline);w.push(()=>{W(),ue(R)})}if(!L.inline){P.setAttribute("popover","manual");try{P.showPopover()}catch{}}if(D)At.add(k);if(L.position&&e.position){let W=e.position(()=>L.anchor?.()??e.trigger(),k,L.position,()=>e.close("anchor-hidden",{focus:!1}));if(H=W.place,U=W.follow,w.push(W,()=>H=U=void 0),L.rendered)w.push(L.rendered(W.follow))}if(!L.inline&&!Pn()&&!P.style.zIndex)P.style.zIndex="2147483000";w.push(Hn(k,m?()=>{m=!1,re(!0)}:void 0)),Un();let K=b?lr(!1):e.modal(),J=t.blur,oe=e.persistent?.()??[],ie=(W,V)=>W===k&&!!V&&("clientX"in V)&&Ho({x:V.clientX,y:V.clientY},k.getBoundingClientRect()),de=F()??(!O&&v?.isConnected?v:void 0);if(de||!O)X=[];for(let W=de??null;W&&W!==k.ownerDocument.body;W=W.parentElement){let{nextElementSibling:V,previousElementSibling:ve}=W;X.push({node:W,next:V&&new WeakRef(V),previous:ve&&new WeakRef(ve)})}let h={parent:e.parent?.()??(O&&sn(O)),active:()=>r.get().open,exiting:()=>!r.get().open&&r.get().mounted,modal:K.consumeOutsidePress,blocking:typeof t.blocking==="function"?t.blocking(K):t.blocking,outsidePress:t.outsidePress,shield:t.shield,component:e.owner?.component,id:e.owner?.id,el:k,covers:(W)=>P.contains(W),contains:(W,V)=>k.contains(W)&&!ie(W,V)||oe.some((ve)=>ve.contains(W))||(e.contains?e.contains(W,V):!!e.trigger()?.contains(W)),overBackdrop:(W,V)=>a&&!!i?.backdrop&&!Ho({x:W,y:V},i.backdrop.getBoundingClientRect())&&Ho({x:W,y:V},k.getBoundingClientRect()),returnTarget:M,onOutsidePress:(W)=>{let V=W.composedPath()[0];e.close("outside-press",{event:W,focus:_p({type:W.type,focusable:!!V?.closest?.(Xp),consumed:K.consumeOutsidePress})})},takesEscape:e.takesEscape,onEscape:(W)=>{if(W.preventDefault(),e.onEscape)e.onEscape(W);else e.close("escape-key",{event:W,focus:!0})},onBlur:J==="never"?void 0:J==="always"?(W)=>e.close("window-blur",{event:W,focus:!1}):(W)=>setTimeout(()=>{let V=Xl(k)??k.ownerDocument.activeElement;if(V?.tagName==="IFRAME"&&!k.contains(V))e.close("focus-out",{event:W,focus:!1})})};if(s=h,Gl.set(h,[k,...R?[R]:[]]),w.push($l(h)),Ql.set(h,{inside:(W)=>W.contains(k)||!!O&&W.contains(O),again:()=>{let W=we();le();for(let V of[P,R])try{V?.hidePopover()}catch{}if(ee(),W&&W!==we())W.focus({preventScroll:!0})}}),K.inertAndLock)ar.add(h);for(let W of[e.onShow,L.onShow]){let V=W?.(h);if(V)w.push(V)}let E,C,j,Y=()=>{let W=[k,...i?.backdrop?[i.backdrop]:[],...oe];if(O&&t.keepTrigger)W.push(O);for(let ve of ir())if(ve!==h&&Jl(ve,h))W.push(...Gl.get(ve)??[]);E=Vl(k.ownerDocument,k);let V=ql(W);h.keep=V.keep,c=C=V},G=()=>{if(j?.(),C?.(),E?.(),c===C)c=void 0;C=E=h.keep=void 0};if(K.inertAndLock)j=la(()=>{if(j=void 0,!r.get().open)return;let W=we();if(Y(),n()==="trap"&&W&&!sr(W))u=!0,Q(L.initialFocus,L.chosenFocus)});te=()=>{let W=b?lr(!1):e.modal();if(h.modal=W.consumeOutsidePress,h.blocking=typeof t.blocking==="function"?t.blocking(W):t.blocking,W.inertAndLock)ar.add(h);else ar.delete(h);if(W.inertAndLock&&!K.inertAndLock&&r.get().open)Y();else if(!W.inertAndLock&&K.inertAndLock)G();K=W},w.push(G,()=>te=void 0);let pe=new Set(ir());for(let W=h.parent;W;W=W.parent)pe.add(W);pe.delete(h);for(let W of pe)if(W.keep&&Jl(h,W))for(let V of[k,...R?[R]:[]])w.push(W.keep(V));if(n()==="flow"&&t.dismissOnFocusLoss){let W;w.push(se(k.ownerDocument,"mousedown",(V)=>{W=V,y=!1,setTimeout(()=>{if(W===V)W=void 0})},{capture:!0}),se(k.ownerDocument,"focusin",(V)=>{y=!1;let ve=Xl(k)??V.target;if(!r.get().open||on(h,ve))return;if(W&&h.contains(ve,W))return;e.close("focus-out",{event:V,focus:!1})}),se(k,"focusout",(V)=>{if(!y||V.relatedTarget)return;setTimeout(()=>{let ve=we(k.ownerDocument);if(r.get().open&&!(ve&&on(h,ve)))e.close("focus-out",{event:V,focus:!1})})}))}if(w.push(_l(k,()=>n()==="trap")),t.closeWatcher){let W=Qp((V)=>e.close("back",{event:V,focus:!0}));if(W)f=W,w.push(()=>{if(W(),f===W)f=void 0})}let ye=(W)=>{let{target:V,submitter:ve}=W;if((ve?.getAttribute("formmethod")??V.getAttribute("method"))?.toLowerCase()!=="dialog"||sn(V)!==h)return;W.preventDefault(),e.close("close-press",{event:W,focus:!0,returnValue:ve?.value||void 0})};if(k.addEventListener("submit",ye),w.push(()=>k.removeEventListener("submit",ye)),r.get().open&&!u&&n()==="trap"&&qo())u=!0;for(let W of ir()){let V=Ql.get(W);if(W!==h&&V?.inside(k))V.again()}return queueMicrotask(()=>Q(L.initialFocus,L.chosenFocus)),()=>{if(w.forEach((W)=>W()),s===h)s=void 0;if(!r.get().mounted&&!L.inline)try{P.hidePopover()}catch{}}}function ee(k=!1){if(!o||i)return;let{el:L,config:D}=o;i={el:L,cleanup:()=>{},backdrop:D.backdrop?.()},i.cleanup=ne(L,D,k)}function fe(k,L=!1){if(k.removeAttribute("hidden"),L)return Hn(k);k.setAttribute("popover","manual");try{k.showPopover()}catch{}if(!Pn()&&!k.style.zIndex)k.style.zIndex="2147483000";return Hn(k)}function ue(k){if(!r.get().mounted)try{k.hidePopover()}catch{}}function le(){if(!i)return;let{cleanup:k}=i;i=void 0,k()}function z(k){if(y=k.key==="Tab",k.key==="Escape"&&s)return Rl(s,k);let L=i?.el;if(k.key!=="Tab"||!L)return;let D=n();if(D==="native")return;if(D==="close")return e.close("focus-out",{event:k,focus:!1});let w=Ze(L),O=Vo(L),P=O[0],R=O.at(-1),K=we(),J=!P||K===P||K===L,oe=!R||K===R,ie=D==="trap"?Bl(w,L):[];if(ie.length){let h=[...ie,...w.filter((pe)=>!ie.includes(pe))],E=h.indexOf(K),C=K===L?h.at(k.shiftKey?-1:0):h.at((E+(k.shiftKey?-1:1))%h.length),j=ie.includes(K)||!!C&&ie.includes(C),Y=K?.shadowRoot,G=!k.shiftKey&&!!Y&&Ze(Y).length>0;if(K!==L&&(E<0||!j||G))return;k.preventDefault(),C?.focus({preventScroll:!0});return}if(D==="trap"){if(k.shiftKey?J:oe){k.preventDefault(),((k.shiftKey?R:P)??L).focus({preventScroll:!0});return}let h=w.indexOf(K),E=h<0?void 0:w[h+(k.shiftKey?-1:1)],C=E&&!E.checked?Wo(E):[];if(C.some((j)=>j.checked)&&!C.includes(K)){k.preventDefault(),E?.focus({preventScroll:!0});return}setTimeout(()=>{let j=we(L.ownerDocument);if(i?.el===L&&!(j&&(Me(L,j)||!!s&&on(s,j))))((k.shiftKey?R:P)??L).focus({preventScroll:!0})});return}let de=e.trigger()??(v?.isConnected?v:void 0);if(!de)return;if(k.shiftKey&&J)k.preventDefault(),de.focus({preventScroll:!0});else if(!k.shiftKey&&oe){let h=zl(de,L);if(!h)return;k.preventDefault(),h.focus()}}return{bind(k,L={}){let D=!1,w=Dt(k),O=()=>{if(o={el:k,config:L},r.get().mounted){if(i&&i.el!==k)le();ee(!0)}};if(k.isConnected)O();else queueMicrotask(()=>{if(!D&&k.isConnected)O()});return()=>{D=!0;let P=e.finalFocus?.()??"trigger";if(w(),o?.el!==k)return;if(o=void 0,i?.el===k){let R=we(),K=r.get().open&&t.movesFocus&&!b&&(!R||R===k.ownerDocument.body||Me(k,R)),J=B;if(le(),K){let oe=I;I=void 0,queueMicrotask(()=>{if(!o&&!k.isConnected&&qo())N(k,J,!0,oe,P)})}}}},keydown:z,triggerKeydown(k){let L=i?.el;if(k.key!=="Tab"||k.shiftKey||!L||!r.get().open)return;if(n()!=="flow")return;k.preventDefault(),(Vo(L)[0]??L).focus({preventScroll:!0})},opening(k,L){p=k,g=L?.type==="pointerdown",A=L?.type==="keydown"},opener:()=>p,observe(k){Z=k},requestClose:(k,L)=>e.close(k,{event:L,focus:!0}),returnFocus(k){d=k},initialFocus:Q,place:()=>H?.(),checkPlacement:()=>U?.(),updateModal:()=>te?.(),layer:()=>s,element:()=>i?.el,mountedAs:ce,backdrop(k){if(!i||i.backdrop===k)return()=>{};let{el:L}=i,D=o?.config.host?.()??L,w=!!o?.config.inline;i.backdrop=k;let O=fe(k,w),P=we();if(!w)try{D.hidePopover(),D.showPopover()}catch{}if(P&&P!==we())P.focus({preventScroll:!0});let R=s?.keep?.(k);return()=>{if(R?.(),O(),i?.backdrop===k)i.backdrop=void 0;ue(k)}}}}Pe();Ve();var tu,Zc=()=>tu??=Promise.resolve().then(() => (Jc(),Qc)),eu=(e)=>Ee&&typeof matchMedia==="function"&&matchMedia(e).matches;function nu(e,t,n,r,o){let i=()=>{let l=n(),c=l==="auto"&&eu("(max-width: 640px) and (pointer: coarse)");return l==="sheet"||c?"sheet":r},s=()=>e.set({presentation:i()}),a=n();if(a==="sheet")s();if(Ee&&!tu&&(a==="sheet"||a==="auto"&&eu("(pointer: coarse)")))(window.requestIdleCallback??setTimeout)(()=>Zc().then((l)=>l.prepareVariables()));return{open:s,resolve:i,bind(l,c){let f=t();if(n()==="auto"&&f.opener()==="initial"&&e.get().open)queueMicrotask(s);if(e.get().presentation!=="sheet")return f.bind(l,c);let p,u=!1,m=()=>l.hidden||(l.hidden=!0),g=new MutationObserver(m),A=(b)=>{if(g.disconnect(),!u)p=b()};Zc().then(({presentSheet:b})=>A(()=>b(l,f,{...o?.sheet,...c})),()=>A(()=>f.bind(l,c))),m(),g.observe(l,{attributeFilter:["hidden"]});let d=Dt(l);return()=>{u=!0,g.disconnect(),d(),p?.()}}}}var ru=[0.5,1];function ou(e,t){let{store:n}=t;if(fn.get(n)&&n.get().presentation==="sheet"&&Ge()!=="touch")queueMicrotask(()=>e.isConnected&&e.focus({preventScroll:!0}));fn.delete(n);let r=[se(e,"touchend",(o)=>{if(n.get().open||!o.cancelable||t.presentation.resolve()!=="sheet")return;o.preventDefault(),t.open(o)},{passive:!1}),se(e,"focus",()=>fn.set(n,!0)),se(e,"blur",(o)=>o.relatedTarget&&fn.set(n,!1))];return()=>{if(r.forEach((o)=>o()),e.ownerDocument.activeElement===e)fn.set(n,!0)}}var fn=new WeakMap;vr();var iu;function Xm(){return iu??=typeof CSS<"u"&&typeof CSS.supports==="function"&&["position-anchor: --a","position-try-fallbacks: flip-y","position-visibility: always"].every((e)=>CSS.supports(e)),iu}var ai=(e)=>{let t=document.documentElement;return!e.x&&!e.y&&Math.abs(e.width-t.clientWidth)<1&&Math.abs(e.height-t.clientHeight)<1};function su(e,t,n,r,o){if(!Xm()||e.getRootNode()!==n.getRootNode()||!(t.width||t.height)||!ai(o))return!1;let i=(s)=>s.split(",").some((a)=>parseFloat(a)>0);return!i(r.transitionDuration)&&(r.animationName==="none"||!i(r.animationDuration))}function au(e,t,n,r,o){let{sideOffset:i,alignOffset:s,collisionPadding:a}=r,l=t==="top"||t==="bottom",[c,f]=l?["left","right"]:["top","bottom"],p=l?o.width:o.height,u=n==="start"?`anchor(${c}) + ${s}px`:n==="end"?`anchor(${f}) - ${p+s}px`:`anchor(center) - ${p/2-s}px`,m=br[t];return{[m]:`round(anchor(${t}), 1px)`,[t]:"auto",[`margin-${m}`]:`${i}px`,[`margin-${t}`]:`${a}px`,[c]:`round(min(max(${u}, min(${a}px, anchor(${f}))), max(100% - ${p+a}px, anchor(${c}) - ${p}px)), 1px)`,"position-anchor":e,"position-try-fallbacks":l?"flip-y":"flip-x","position-visibility":"always"}}var si=new WeakMap,Gm=globalThis[Symbol.for("ui-sdk.anchor-names@1")]??={count:0};function li(e){let t=si.get(e);if(!t)t=`--ui-anchor-${++Gm.count}`,si.set(e,t);if(!e.style.getPropertyValue("anchor-name").split(",").some((r)=>r.trim()===t)){let r=getComputedStyle(e).getPropertyValue("anchor-name");e.style.setProperty("anchor-name",r&&r!=="none"?`${r}, ${t}`:t)}return t}function lu(e){let t=si.get(e),n=e.style.getPropertyValue("anchor-name").split(",").map((r)=>r.trim()).filter((r)=>r&&r!==t);if(n.length)e.style.setProperty("anchor-name",n.join(", "));else e.style.removeProperty("anchor-name");if(!e.getAttribute("style"))e.removeAttribute("style")}var Ft=new Map,cu=()=>{},ci=cu,uu=(e)=>Ft.forEach((t,n)=>e.target instanceof Node&&t?.contains(e.target)||n()),du=(e)=>Ft.forEach((t,n)=>e.some((r)=>r.attributeName!="aria-activedescendant"&&!t?.contains(r.target))&&n());function Qm(){let e=new AbortController,t={capture:!0,passive:!0,signal:e.signal},n=[[document,["scroll","load","input","pointermove","focusin","transitionstart","animationstart"]],[window,["resize"]],[window.visualViewport,["resize","scroll"]],[document.fonts,["loadingdone"]]];for(let[o,i]of n)for(let s of i)o?.addEventListener(s,uu,t);let r=new MutationObserver(du);return r.observe(document,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),()=>{e.abort(),r.disconnect()}}var Pr=new Map;function Jm(e){let t=new AbortController,n={capture:!0,passive:!0,signal:t.signal};for(let o of["scroll","load","transitionstart","animationstart"])e.addEventListener(o,uu,n);let r=new MutationObserver(du);return r.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),()=>{t.abort(),r.disconnect()}}function fu(e){let t=[];for(let n=e;n;)if(n.nodeType===11&&"host"in n)t.push(n),n=n.host;else n=n.assignedSlot??n.parentNode;return t}function pu(e){let t=[...e];for(let n of t){let r=Pr.get(n)??{count:0,stop:Jm(n)};r.count++,Pr.set(n,r)}return()=>{for(let n of t.splice(0)){let r=Pr.get(n);if(--r.count)continue;r.stop(),Pr.delete(n)}}}function mu(e,t){if(!Ft.size)ci=Qm();let n=typeof ResizeObserver=="function"?new ResizeObserver(e):void 0;if(t)n?.observe(t);return Ft.set(e,n&&t),()=>{if(n?.disconnect(),Ft.delete(e),Ft.size)return;ci(),ci=cu}}vr();De();function Zm(e){let t=e;if(!e.getClientRects().length){if(getComputedStyle(e).display!=="contents")return;if(t=e.ownerDocument.createRange(),t.selectNodeContents(e),!t.getClientRects().length)return}let{x:n,y:r,width:o,height:i}=t.getBoundingClientRect();return{x:n,y:r,width:o,height:i}}function eh(e){let t="getBoundingClientRect"in e?e.getBoundingClientRect():{width:0,height:0,...e};return{x:t.x,y:t.y,width:t.width,height:t.height,left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height}}var Rt=(e)=>e==="top"||e==="bottom";function hu(e,t,n,r,o){let{sideOffset:i,alignOffset:s}=o,a=n==="top"||n==="bottom",l=0,c=0;if(n==="bottom")c=e.y+e.height+i;if(n==="top")c=e.y-t.height-i;if(n==="right")l=e.x+e.width+i;if(n==="left")l=e.x-t.width-i;if(a){if(r==="start")l=e.x+s;if(r==="center")l=e.x+e.width/2-t.width/2+s;if(r==="end")l=e.x+e.width-t.width-s}else{if(r==="start")c=e.y+s;if(r==="center")c=e.y+e.height/2-t.height/2+s;if(r==="end")c=e.y+e.height-t.height-s}return{x:l,y:c}}function ui(e,t,n,r,o){if(e==="bottom")return t.y+n.height-(r.y+r.height-o);if(e==="top")return r.y+o-t.y;if(e==="right")return t.x+n.width-(r.x+r.width-o);return r.x+o-t.x}function th(e,t,n,r){let{sideOffset:o,collisionPadding:i}=r,s=e==="bottom"?n.y+n.height-i-(t.y+t.height+o):e==="top"?t.y-o-i-n.y:n.height-i*2,a=e==="right"?n.x+n.width-i-(t.x+t.width+o):e==="left"?t.x-o-i-n.x:n.width-i*2;return{width:Math.max(0,a),height:Math.max(0,s)}}var wu=(e,t,n=!1)=>n&&Rt(e)&&t!=="center"?t==="start"?"end":"start":t,et=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n));function gu(e,t,n,r){let o={x:0,y:0,...n},i={...r,side:an(r.side,r.rtl)},s=wu(i.side,i.align,i.rtl),a=i.side,l=hu(e,t,a,s,i),c=ui(a,l,t,o,i.collisionPadding);if(c>0){let m=br[a],g=hu(e,t,m,s,i);if(ui(m,g,t,o,i.collisionPadding)<c)a=m,l=g}let f=i.collisionPadding,p=th(a,e,o,i),u=!1;if(ui(a,l,t,o,f)>0){if((a==="top"||a==="bottom")&&t.height&&(e.height>=t.height||i.inside))u=!0,l.y=et(et(l.y,o.y+f,o.y+o.height-t.height-f),e.y,e.y+e.height-t.height),p.height=Math.max(0,o.height-f*2);else if((a==="left"||a==="right")&&t.width&&(e.width>=t.width||i.inside))u=!0,l.x=et(et(l.x,o.x+f,o.x+o.width-t.width-f),e.x,e.x+e.width-t.width),p.width=Math.max(0,o.width-f*2)}if(a==="top"||a==="bottom"){let m=et(l.x,o.x+f,o.x+o.width-t.width-f);l.x=m===l.x?m:et(m,e.x-t.width,e.x+e.width)}else{let m=et(l.y,o.y+f,o.y+o.height-t.height-f);l.y=m===l.y?m:et(m,e.y-t.height,e.y+e.height)}return{...l,side:a,align:i.align,available:p,inside:u}}var nh=3,rh=500,xu=["--available-height","--available-width"],yu=!1;function Su(){if(yu)return;yu=!0,Gt(()=>po(xu))}function bu(e){let t=new Map,n=(r,o)=>{if(t.get(r)===o)return!1;return t.set(r,o),!0};return{style(r,o){if(n(`style:${r}`,o))e.style.setProperty(r,o)},attribute(r,o){if(!n(r,o))return;if(o===null)e.removeAttribute(r);else e.setAttribute(r,o)},reset:()=>t.clear()}}function oh(){let e=window.visualViewport;return{x:e?.offsetLeft??0,y:e?.offsetTop??0,width:e?.width??document.documentElement.clientWidth,height:e?.height??document.documentElement.clientHeight}}function ku(e,t,n={},r){let o=()=>typeof n==="function"?n():n,i=()=>typeof e==="function"?e():e,s=(_)=>({side:_.side??"bottom",align:_.align??"start",sideOffset:Number(_.sideOffset??4),alignOffset:Number(_.alignOffset??0),collisionPadding:Number(_.collisionPadding??8)});po(xu),Object.assign(t.style,{position:"fixed",inset:"auto",margin:"0",left:"0",top:"0"});let a=bu(t),l=getComputedStyle(t),c,f="",p="",u=!1,m,g=!1,A=!1,d=[],b=()=>{},v=!1,y,I={left:"0",top:"0"},T,B=new Set;function X(_={left:"0",top:"0"}){if(y)lu(y.anchor);y=void 0;for(let N of B)a.style(N,"");B.clear(),f="",a.style("inset","auto"),a.style("margin","0"),a.style("left",_.left),a.style("top",_.top)}function F(){if(A)return!1;let _=o(),N=s(_),Q=Number(_.arrowPadding??6),ne=i();if(!ne)return!1;let ee="nodeType"in ne?ne:void 0,fe=ee&&Zm(ee);if(ee&&u&&(!ee.isConnected||!fe)){if(y)X(I);if(ee.isConnected&&m===ee)m=void 0,r?.();return!1}m=fe?ee:void 0;let ue=ee?fu(ee):[];if(ue.length!==d.length||ue.some((me,Se)=>me!==d[Se]))b(),d=ue,b=pu(ue);g=!ee&&"getBoundingClientRect"in ne;let le=oh();if(y&&(ee!==y.anchor||!ai(le)))X();if(!v){if(v=!0,ee&&fe&&su(ee,fe,t,l,le))y={anchor:ee,name:li(ee)};else for(let me of ih)if(t.style.getPropertyValue(me))t.style.removeProperty(me)}else if(y)li(y.anchor);let z=!u,k=z&&At.has(t),L=t.style.transition;if(z&&!k)t.style.transition="none";let D=eh(fe??ne),w={width:t.offsetWidth,height:t.offsetHeight},O=di(_),P=O?{width:O.offsetWidth,height:O.offsetHeight}:void 0,R=`${D.x},${D.y},${D.width},${D.height},${le.x},${le.y},${le.width},${le.height},${N.side},${N.align},${N.sideOffset},${N.alignOffset},${N.collisionPadding}`,K=`${R},${w.width},${w.height},${P?.width??""},${P?.height??""},${Q}`;if(K===f&&(!O||O===c?.el))return!1;f=K;let J={left:t.clientLeft,top:t.clientTop,width:t.clientWidth,height:t.clientHeight},oe=l.direction==="rtl",ie=sh(l,w);if(y){let me=an(N.side,oe),Se=au(y.name,me,wu(me,N.align,oe),N,ie);for(let[ke,Le]of Object.entries(Se))B.add(ke),a.style(ke,Le)}let de=lh(t.getBoundingClientRect(),ie,l),{scale:h}=de,E={width:ie.width*h.x,height:ie.height*h.y},C={...N,inside:p===R,sideOffset:N.sideOffset*(Rt(N.side)?h.y:h.x),alignOffset:N.alignOffset*(Rt(N.side)?h.x:h.y),rtl:oe},j={x:D.x,y:D.y,width:D.width,height:D.height},Y=gu(j,E,le,C);p=Y.inside?R:"";let G=T;T=j;let pe=(me)=>Math.abs(de.x-me.x)<=1&&Math.abs(de.y-me.y)<=1;if(y){let me=pe(Y),Se=!me&&!!G&&pe(gu(G,E,le,C));if(!me&&!Se){if(X(),!k)t.style.transition=L;return F()}if(Se)f="";I={left:`${parseFloat(l.left)+parseFloat(l.marginLeft)}px`,top:`${parseFloat(l.top)+parseFloat(l.marginTop)}px`}}else{let me={x:de.x-(parseFloat(l.left)||0)*h.x,y:de.y-(parseFloat(l.top)||0)*h.y},Se=t.ownerDocument.defaultView?.devicePixelRatio||1,ke=(Le)=>Math.round(Le*Se)/Se;a.style("left",`${ke((Y.x-me.x)/h.x)}px`),a.style("top",`${ke((Y.y-me.y)/h.y)}px`)}let ye=Rt(Y.side)?h.x:h.y;if(z){if(u=!0,!k)l.left,t.style.transition=L}a.attribute("data-side",Y.side),a.attribute("data-align",Y.align),a.style("--available-height",`${Y.available.height/h.y}px`),a.style("--available-width",`${Y.available.width/h.x}px`),a.style("--anchor-width",`${D.width/h.x}px`),a.style("--anchor-height",`${D.height/h.y}px`);let[W,V]=dh(Y.side,Y.align,oe,D,E,Y);a.style("--transform-origin",`${Math.round(W/h.x)}px ${Math.round(V/h.y)}px`);let ve={x:Y.x+J.left*h.x,y:Y.y+J.top*h.y,width:J.width*h.x,height:J.height*h.y},ge=uh(D,ve,Y.side,Q*ye);if(a.style("--arrow-offset",`${Math.round(ge/ye)}px`),O&&P){let me={...ve,...E},Se={width:P.width*h.x,height:P.height*h.y},ke=ch(D,me,Se,Y.side,Q*ye),Le=Math.round(ke.offset/ye);if(c?.el!==O)c={el:O,write:bu(O)};let{write:rt}=c;rt.style("position","absolute"),rt.style("left",Rt(Y.side)?`${Le}px`:""),rt.style("top",Rt(Y.side)?"":`${Le}px`),rt.attribute("data-side",Y.side),rt.attribute("data-align",Y.align),rt.attribute("data-arrow-clamped",ke.clamped?"":null)}return!0}let H=0,U=0;function te(){if(H=0,U=F()?0:U+1,U<nh||g)H=requestAnimationFrame(te)}function Z(){U=0,H||=requestAnimationFrame(te)}let re=mu(Z,t),ce=setInterval(()=>H||F()&&Z(),rh);F(),Z();let ae=()=>{cancelAnimationFrame(H),clearInterval(ce),re(),b(),d=[],A=!0},q=o(),x=vu(q),S=di(q);function M(){let _=o(),N=vu(_),Q=di(_);if(N===x&&Q===S)return;x=N,S=Q,Z()}return Object.assign(ae,{follow:M,place(){u=!1,f="",a.reset(),c?.write.reset(),F()}})}var ih=["position-anchor","position-try-fallbacks","position-visibility"],di=(e)=>typeof e.arrow==="function"?e.arrow():e.arrow,vu=(e)=>[e.side,e.align,e.sideOffset,e.alignOffset,e.collisionPadding,e.arrowPadding].join();function sh(e,t){let n=(a)=>parseFloat(e.getPropertyValue(a))||0,r=(a,l)=>e.boxSizing==="border-box"?0:n(`padding-${a}`)+n(`padding-${l}`)+n(`border-${a}-width`)+n(`border-${l}-width`),o=parseFloat(e.width)+r("left","right"),i=parseFloat(e.height)+r("top","bottom"),s={width:Math.abs(o-t.width)<1,height:Math.abs(i-t.height)<1};return{width:s.width?o:t.width,height:s.height?i:t.height,exact:s}}var ah=(e)=>{let t=parseFloat(e)||0;if(e.endsWith("turn"))return t*2*Math.PI;if(e.endsWith("grad"))return t*Math.PI/200;if(e.endsWith("rad"))return t;return t*Math.PI/180},Or=(e,t,n=!1)=>t>0.01&&Math.abs(e-t)>=(n?0.05:1)?e/t:1;function lh(e,t,n){let r=!!n.translate&&n.translate!=="none",o=!!n.rotate&&n.rotate!=="none",i=!!n.scale&&n.scale!=="none",s=!!n.transform&&n.transform!=="none";if(!r&&!o&&!i&&!s)return{x:e.x,y:e.y,scale:{x:Or(e.width,t.width,t.exact?.width),y:Or(e.height,t.height,t.exact?.height)}};let[a=0,l=0]=n.transformOrigin.split(" ").map((L)=>parseFloat(L)||0),c=(L,D)=>!L?0:L.endsWith("%")?parseFloat(L)/100*D:parseFloat(L)||0,f=r?n.translate.split(" "):[],p=c(f[0],t.width),u=c(f[1],t.height),m=o?n.rotate.split(" "):[],g={x:[1,0,0],y:[0,1,0],z:[0,0,1]}[m[0]],[A,d,b]=g??(m.length===4?m.slice(0,3).map(parseFloat):[0,0,1]),v=Math.hypot(A,d,b)||1,[y,I,T]=[A/v,d/v,b/v],B=m.length?ah(m[m.length-1]):0,[X,F]=[Math.cos(B),Math.sin(B)],H=[X+(1-X)*y*y,(1-X)*y*I-F*T,(1-X)*y*I+F*T,X+(1-X)*I*I],[U=1,te=U]=i?n.scale.split(" ").map(parseFloat):[],Z=s?/^matrix(3d)?\((.*)\)$/.exec(n.transform):null,re=Z?.[2].split(",").map(parseFloat)??[],[ce,ae,q,x,S,M,_,N,Q]=!Z?[1,0,0,1,0,0,0,0,1]:Z[1]?[re[0],re[1],re[4],re[5],re[12],re[13],re[3],re[7],re[15]]:[...re,0,0,1],ne=(L,D)=>{let[w,O]=[L-a,D-l],P=_*w+N*O+Q||1,R=U*(ce*w+q*O+S)/P,K=te*(ae*w+x*O+M)/P;return[a+p+H[0]*R+H[1]*K,l+u+H[2]*R+H[3]*K]},ee=[ne(0,0),ne(t.width,0),ne(0,t.height),ne(t.width,t.height)],fe=ee.map(([L])=>L),ue=ee.map(([,L])=>L),le=Math.min(...fe),z=Math.min(...ue),k={x:Or(e.width,Math.max(...fe)-le,t.exact?.width),y:Or(e.height,Math.max(...ue)-z,t.exact?.height)};return{x:e.x-k.x*le,y:e.y-k.y*z,scale:k}}function ch(e,t,n,r,o){let i=r==="top"||r==="bottom",s=i?n.width:n.height,l=(i?e.x+e.width/2-t.x:e.y+e.height/2-t.y)-s/2,c=(i?t.width:t.height)-s-o,f=Math.max(o,Math.min(l,c));return{offset:Math.round(f),clamped:Math.abs(f-l)>0.5}}function uh(e,t,n,r){let o=n==="top"||n==="bottom",i=o?e.x+e.width/2-t.x:e.y+e.height/2-t.y,s=o?t.width:t.height;return Math.round(Math.min(Math.max(i,r),Math.max(r,s-r)))}function dh(e,t,n,r,o,i){if(e==="top"||e==="bottom"){let a=n?r.right-i.x:r.left-i.x,l=n?r.left-i.x:r.right-i.x;return[t==="center"?r.left+r.width/2-i.x:t==="start"?a:l,e==="bottom"?0:o.height]}let s=t==="center"?r.top+r.height/2-i.y:t==="start"?r.top-i.y:r.bottom-i.y;return[e==="right"?0:o.width,s]}function fi(e,t,n){if(typeof t!=="string")return t??n();let r=e.getRootNode();return(r===e.ownerDocument?null:r.querySelector(t))??e.ownerDocument.querySelector(t)}function pi(e,t,n){return{side:e.side??t.side??"bottom",align:e.align??t.align,sideOffset:e.sideOffset??t.sideOffset??4,alignOffset:e.alignOffset??t.alignOffset??0,collisionPadding:e.collisionPadding,arrow:n,arrowPadding:e.arrowPadding}}var Au={position:ku,prepare:()=>Ot(Su),anchor:fi,options:pi};var mi=(e)=>({open:e.open,disabled:Re(e),readOnly:e.readOnly,required:e.required}),hi=(e,t)=>`${t}-${e.listed?"list":"content"}`,fh={"aria-labelledby":void 0,"aria-label":void 0};function Eu(){return{props:{side:"string",align:"string",sideOffset:"number",alignOffset:"number",collisionPadding:"number",arrowPadding:"number",container:"value",anchor:"string",keepMounted:"boolean"},connect:Dt,present:(e,{props:t})=>e.mounted||!!t.keepMounted||!!e.prepared,role:(e)=>e.listed?"presentation":"listbox",roles:["presentation","listbox"],keys:[...jn,"Home","End","Enter"," ","typeahead"],attrs:(e,{id:t})=>({...ec(e,t),"aria-multiselectable":!e.listed&&e.multiple?"true":void 0,...e.listed?fh:co(e,t),"aria-busy":!e.listed&&e.status==="loading"?"true":void 0,"data-presentation":e.presentation}),on:{...it,keydown:(e,{api:t})=>t.internal.onListKeyDown(e)},bind:(e,t)=>ph(e,t.key,t.store,t.api.internal,{part:t,anchor:t.api.internal.anchorElement,snapPoints:ru})}}function ph(e,t,n,r,o){let{aligned:i}=o,s=!0;Xe(()=>s&&n.set({settled:!0}));let a=r.loadMore.bind(e),l=r.presentation.bind(e,{snapPoints:o.snapPoints,anchor:()=>fi(e,r.contentProps(t).anchor,()=>i?.()||o.anchor()),position:()=>{let c=r.contentProps(t),f=i?.()?{...c,side:"bottom",align:"start",sideOffset:0}:c;return pi(f,{align:"start"},r.arrowElement())},rendered:(c)=>ol(o.part,c),initialFocus:r.initialFocus});return()=>{s=!1,a(),l(),n.set({settled:!1})}}function Cu(){return{role:"listbox",keys:{none:"The field's input handles them, or the content around the list once focus is in it."},attrs:(e,{id:t})=>({id:`${t}-list`,"aria-multiselectable":e.multiple?"true":void 0,...co(e,t),"aria-busy":e.status==="loading"?"true":void 0}),bind:(e,{store:t})=>Vn(t,"listed")}}function Mu(e,t,n){}De();var Pu=new WeakMap;function Ou(e,t){let n=Pu.get(e);if(!n)Pu.set(e,n={});if(n[t]=(n[t]??0)+1,n[t]===1)e.setAttribute(t,"");return()=>{if(n[t]--,n[t]===0)e.removeAttribute(t)}}function mh(e){Te(e,"ui-sdk-mirror","@layer ui-sdk{:where([data-mirror][aria-hidden]){display:inline-block}:where([data-mirror][aria-hidden]:dir(rtl)){scale:-1 1}}")}function hh(e,t,n,r){let o,i,s,a=!0,l=()=>{let f=e.parentElement?.closest(t.item);if(!f)return!1;if(!o)o=Ou(f,"data-has-icon"),r(f);if(!t.list)return!0;let p=f.parentElement?.closest(t.list);if(p)i=Ou(p,"data-has-icons");return!!p},c=()=>{if(!l())return;s?.(),s=void 0};if(!l())queueMicrotask(()=>{if(a&&!l())s=n(c)});return()=>{a=!1,s?.(),o?.(),i?.()}}function Tu(e){return{props:{mirror:"boolean",id:"id",item:{kind:"string",from:"item.value"}},state:(t,{props:n})=>({mirror:!!n.mirror}),attrs:(t,{props:n})=>({"aria-hidden":"true","data-mirror":n.mirror?"":void 0}),bind(t,{api:n,props:r,id:o,store:i}){mh(t.ownerDocument);let s=(p)=>he&&queueMicrotask(()=>{if(p.isConnected)Mu(p,"An item with only an icon",{component:e.component,id:o})}),a=e.subscribe?.(n),c=hh(t,e,(p)=>{let u=[i.subscribe(p),a?.(p)];return()=>u.forEach((m)=>m?.())},s),f=e.register?.(t,{api:n,props:r});return()=>{c(),f?.()}}}}var Du={item:'[role="option"]',list:'[role="listbox"]'};var gh=[];function Iu(e,{api:t}){return{open:e.open,presentation:e.presentation,status:e.status,items:t.internal.listbox.visibleData()?.list??gh}}var pn=ml(),yh={open:[],mounted:[],value:[],query:[],composingFrom:[],initial:[],items:[],status:[],listed:[],labeled:[],inline:[],disabled:[],formDisabled:[],readOnly:[],required:[],name:[],form:[],mounts:[],settled:[],groupLabels:[],fieldName:[],presentation:[],trigger:[],payload:[],titled:[],named:[],described:[],modal:[]},Lu=(e)=>({label:e({attrs:(t,{id:n})=>({id:`${n}-label`,for:`${n}-input`,...Bn(t)}),press({api:t,el:n}){if(n instanceof HTMLLabelElement&&n.control)return;t.focus()},bind:(t,{store:n})=>Vn(n,"labeled")}),input:e({...pn,keys:(t)=>[...pn.keys,"Enter","Escape","Tab",...t.inline?["ArrowRight","End"]:[]],state:mi,attrs:(t,n)=>({...pn.attrs(t,n),name:t.name,form:t.form,"aria-autocomplete":t.inline?"both":"list","aria-controls":t.mounted?hi(t,n.id):void 0,"aria-labelledby":t.labeled?`${n.id}-label`:void 0,required:t.required?"":void 0,readonly:t.readOnly?"":void 0,disabled:t.disabled?"":void 0,...ut(t.open),...Bn(t)}),on:{...pn.on,focusin(t,{api:n,store:r}){if(n.internal.options().openOnFocus&&!r.get().open)n.internal.show({event:t,by:"keyboard",reason:"trigger-focus"})},focusout(t,{api:n,store:r}){let o=t.relatedTarget;if(!r.get().open)return;if(!o&&r.get().presentation==="sheet")return;if(o&&(n.internal.ownsElement(o)||n.internal.contentElement()?.contains(o)))return;if(!o&&!document.hasFocus())return;n.internal.hide({reason:"focus-out",event:t})}},press({api:t,store:n},r){if(n.get().open||!t.internal.options().openOnFocus)return;t.internal.show({event:r,by:Zl(r),reason:"trigger-press"})},bind(t,n){let{api:r,id:o}=n,i=t;if(he)ma(t,"The field has no accessible name. Add an AutocompleteLabel, a Field label or an aria-label.",{component:"autocomplete",id:o});let s=[pn.bind(t,n),r.internal.bindReset(i),ys(i,r.internal.setFormDisabled),ou(t,{store:n.store,presentation:r.internal.presentation,open:(a)=>r.internal.show({event:a,by:"touch",reason:"trigger-press"})})];return()=>s.forEach((a)=>a())}}),trigger:e({state:mi,attrs:(t,{id:n})=>({type:"button",tabindex:"-1","aria-expanded":String(t.open),"aria-controls":t.mounted?hi(t,n):void 0,disabled:Re(t)?"":void 0,...ut(t.open),...Bn(t)}),on:it,press({api:t,store:n},r){if(t.internal.inputElement()?.focus({preventScroll:!0}),n.get().open)t.internal.hide({reason:"trigger-press",event:r});else t.internal.show({event:r,by:"pointer",reason:"trigger-press"})}}),clear:e({props:{keepMounted:"boolean"},present:(t,{props:n})=>!!n.keepMounted||t.value!==""&&!Kn(t),state:(t)=>({disabled:Kn(t)}),attrs:(t)=>({type:"button",tabindex:"-1",disabled:Re(t)?"":void 0,"data-disabled":Kn(t)?"":void 0}),on:it,press({api:t}){t.clear({reason:"clear-press"}),t.internal.inputElement()?.focus({preventScroll:!0})}}),content:e({...Eu(),state:Iu}),viewport:e({present:(t)=>t.presentation==="sheet"}),header:e({present:(t)=>t.presentation==="sheet"&&t.open}),list:e({...Cu(),state:Iu}),item:e({...hl(),selects:Ba({highlighted:({key:t})=>[t],listing:({key:t})=>[t],...yh}),state:(t,{key:n,props:r})=>({highlighted:t.highlighted===n,disabled:!!r.disabled})}),"item-text":e(Wa()),"item-icon":e(Tu({component:"autocomplete",...Du})),group:e(ya()),"group-label":e(xa()),separator:e(ba()),empty:e(va()),status:e(wa()),arrow:e(Sa())});var bh=["escape-key","outside-press","focus-out","window-blur","back","swipe"];function Fu(e){return bh.includes(e)}var vh=new Set(["image-load","image-error","imperative","item-removed","unmount","reset","restore","timeout","resize","page-hide"]),tt;function Tr(e,t){if(tt==="agent")return tt;if(vh.has(e))return"programmatic";if(t){let n=t();return n==="programmatic"&&tt?tt:n}return tt??"programmatic"}function mn(e,t){let n=tt;tt=e;try{return t()}finally{tt=n}}function hn(e,t,n=!0){if(!n)return{...e,source:t};let r=!1;return{...e,source:t,cancel:()=>{r=!0},get canceled(){return r}}}var wh=(e)=>`${e[0].toUpperCase()}${e.slice(1)}`,Dr=(e,t)=>`on${wh(e)}${t}`;var $t={},gn=new Set,xh=new WeakMap;function Ru(e,t,n,r){Ot(()=>{let o,i,s;if($t.add)o=$t.add(e,t,n,r);else if(typeof document<"u"){if(gn.add(i=new WeakRef(e)),s={parts:t,definition:n,options:r},xh.set(e,s),gn.size%1000===0){for(let a of gn)if(!a.deref())gn.delete(a)}}return()=>{if((o??s?.unwatch)?.(),o=void 0,s)s.unwatch=void 0;if(i)gn.delete(i),i=void 0}})}function $u(e,t,n,r,o){if(he&&e.options().debug)console.debug(`[ui-sdk] ${e.label}#${e.id} ${t}: ${String(n)} (${r}, ${o})`)}function Nu(e,t){let{store:n,options:r}=e,o=new Map,i=new Map,s=new Map;if(e.onOptions((a,l)=>{if(he)es(o,a);if(!l)return;let c;for(let[f,p]of o){if(!(f in l))continue;if(Oe(l[f],p.value))c=p.source;o.delete(f)}return c}),he)e.onDestroy(()=>Zi(o));return(a,l,c)=>{if(s.has(a)&&Oe(s.get(a),l))return!1;let f=(i.get(a)??0)+1;i.set(a,f);let p=n.get()[a];if(Oe(p,l))return!1;let{reason:u,event:m}=c,g=hn(c,c.source??t(u,m));if(he)rs(u,m,{component:e.label,id:e.id});$u(e,a,l,u,g.source);let A=r(),d=A[a]!==void 0,b=s.has(a),v=s.get(a);s.set(a,l);try{mn(g.source,()=>{let y=Dr(a,"Change"),I=A[y];if(typeof I==="function"){let B=he&&!!m?.defaultPrevented;if(I(l,g),he)os(y,B,g,{component:e.label,id:e.id})}let T=i.get(a)!==f;if(!g.canceled&&!d&&!T)n.set({[a]:l})})}finally{if(b)s.set(a,v);else s.delete(a)}if(he)We({type:"change",component:e.label,id:e.id,key:a,value:l,reason:u,source:g.source,canceled:g.canceled,controlled:d});if(g.canceled)return!1;if($t.change?.(e.id,a,l,g,p),d){if(o.set(a,{value:l,source:g.source}),he)Ji(o,{component:e.label,id:e.id,key:a,value:l,reason:u,source:g.source},()=>r()[a])}return!0}}function Wu(e,t,n,r){let o=r.source??Tr(r.reason);if(he)We({type:"change",component:e.label,id:e.id,key:t,value:n,reason:r.reason,source:o,canceled:!1,controlled:!1});$u(e,t,n,r.reason,o)}var Nt=(e,t)=>Tr(e,t&&(()=>Ge(t)));function Sh(){return Un(),Nt}function Ir(e,t=Sh()){return Nu(e,t)}var kh=new WeakSet,gi=(e)=>(kh.add(e),e);function Vu(e,t){return gi(Promise.resolve({reason:e,source:Nt(e,t)}))}function qu(e){let{popup:t,store:n,rules:r={}}=e,o="imperative",i="trigger-press",s,a,l;t.observe((b)=>{let v=b?void 0:a??{reason:"imperative",source:"programmatic"};if(a=void 0,!v)return;return s?.resolve(v),s=void 0,v}),e.onDestroy(()=>{s?.resolve({reason:"unmount",source:"programmatic"}),s=void 0});function c(b){if(!s){let v;s={promise:gi(new Promise((I)=>v=I)),resolve:v}}if(b&&!b.aborted){let v=()=>t.requestClose("imperative");b.addEventListener("abort",v,{once:!0}),s.promise.then(()=>b.removeEventListener("abort",v))}return s.promise}let f,p=(b,v)=>{let y=f;f=b;try{return e.change(b,v)}finally{f=y}};function u(b={},v){return m(b,v).result}function m(b,v){let{event:y,signal:I}=b;if(I?.aborted)return{opened:!1,result:Vu("imperative")};let T=b.reason??(y?"trigger-press":"imperative"),B=v??T,X={...b,reason:B,payloadReason:T},F=!1,H=(U=b.by??"imperative")=>{l=b.anchor;let te=e.payload?.opening(b.trigger,b.payload,{reason:T,event:y});if(t.opening(U,y),F=p(!0,{reason:B,event:y}),!F)te?.();return F};if(n.get().open){if(t.opener()==="hover"&&b.by!=="hover")t.opening(b.by??"imperative",y);if(b.trigger===void 0&&e.payload?.reopening(b,{reason:T})&&b.anchor)l=b.anchor;return r.reopen?.(X,H),{opened:F,result:c(I)}}if(r.open)r.open(X,H);else H();return{opened:F,result:F?c(I):Vu(B,y)}}function g(b={}){if(!n.get().open)return!1;let{event:v,returnValue:y}=b,I=b.reason??"imperative";if(e.dismissal&&!e.dismissal.allows(I,v))return!1;let T=!1,B=()=>{a={reason:I,source:Nt(I,v),returnValue:y},t.returnFocus(b.focus??e.returnFocus??!0);let X=p(!1,{reason:I,event:v,...y!==void 0&&{returnValue:y}});if(!X)t.returnFocus(!0),a=void 0;return T=X,X};if(r.close)r.close({...b,reason:I},B);else B();return T}function A({trigger:b,payload:v,anchor:y,reason:I,event:T}){l=y,e.payload?.handOver(b,v,{reason:I,event:T})}let d=(b,v)=>m({reason:"imperative",event:v},b).opened;return{api:{isOpen:()=>n.get().open,setOpen:(b,{reason:v,event:y}={})=>b!==(f??n.get().open)&&(b?d(v,y):g({reason:v,event:y})),open:(b={})=>u({...b,reason:b.reason??"imperative"}),close:({reason:b,event:v,returnValue:y}={})=>g({reason:b,event:v,returnValue:y}),toggle:({reason:b,event:v}={})=>n.get().open?g({reason:b,event:v}):d(b,v)},show:u,attempt:m,hide:g,takeOver:A,result:c,anchor:()=>l}}function Hu(e,t){let n=e,{store:r,element:o,options:i}=n,{preset:s}=t,a=t.slot??"content",l=t.trigger??"trigger",c=Ir(n),f=(S)=>S!==void 0&&n.props(a,S)||Qe(n,a)[0]?.props||n.props(a)||{},p=()=>{if(v?.trigger)return v.trigger();let S=r.get().trigger;return S!==null&&o(l,S)||o(l)},u=null,m,g=()=>{let S=r.get().trigger;if(v?.trigger||S===null||S===u)return p();let M=m??Qe(n,l).length<=1;return o(l,S)??(M?o(l):void 0)},A=r.get().open;r.subscribe(()=>{let{open:S,trigger:M}=r.get();if(S===A)return;if(A=S,!S)return;u=M!==null&&!o(l,M)?M:null,m=Qe(n,l).length<=1});function d(S){for(let M of n.parts())if(M.slot===l&&M.key!==S&&M.el?.isConnected)return M.key}let b={label:n.label,role:t.role??s.role,store:r,options:i,onOptions:n.onOptions,onDestroy:n.onDestroy,element:o,parts:n.parts,preset:s,get popup(){return re},get control(){return ce},triggerElement:p,triggerSlot:l,nextTrigger:d,firstTrigger(){for(let S of n.parts())if(S.slot===l)return d()??S.key},triggerDisabled:(S)=>!!n.props(l,S)?.disabled,contentProps:f},v=b.rules=t.rules?.(b),y=s.dismissal?.(i,v),I=s.presentation?.(b,y),T=s.press?.(b),B=s.group?.(b),X=s.hover?.(b,B),F=s.focus?.(b),H=s.triggerName?.(b);s.resetStyles?.prepare(n.label,a),s.placement?.prepare();function U(S,M){if(s.modal===void 0)return;return{modal:S.modal??(M.presentation==="sheet"?!0:s.modal)}}function te(){let S=U(i(),r.get());if(S)r.set(S)}function Z(S,M){if(v?.dismiss)v.dismiss(S,M);else ce.hide({reason:S,...M})}let re=tc({...t.behavior,preset:s.behavior,position:s.placement?.position,owner:{component:n.label,id:n.id},store:r,trigger:p,returnTrigger:g,contains:(S,M)=>v?.contains?v.contains(S,M):!!p()?.contains(S)||!!T?.contains(S,M),close:Z,modal:()=>v?.modal?.()??lr(r.get().modal),parent:()=>v?.parent?.(),persistent:()=>v?.persistent?.()??[],finalFocus:()=>f().finalFocus,takesEscape:v?.takesEscape,onEscape:(S)=>v?.onEscape?v.onEscape(S):Z("escape-key",{event:S,focus:!0}),onShow:(S)=>v?.onShow?.(S),onOpenChange(S,M){if(v?.onOpenChange?.(S,M),B?.change(S),S){I?.open(),te();return}X?.clear(),F?.clear()},onOpenChangeComplete(S,M){v?.onOpenChangeComplete?.(S,M),i().onOpenChangeComplete?.(S)}}),ce=qu({dismissal:y,popup:re,store:r,payload:s.payload?.(r,(S,M)=>c("payload",S,M)),change:(S,M)=>c("open",S,{...M,...v?.details?.()}),onDestroy:n.onDestroy,get returnFocus(){return v?.returnFocus},rules:{open(S,M){if(X?.clear(),B?.opening(S.event),v?.open)v.open(S,M);else M()},reopen(S){if(X?.clear(),v?.reopen)return v.reopen(S);let{trigger:M,payload:_,payloadReason:N,event:Q}=S;if(M!==void 0&&M!==r.get().trigger)ce.takeOver({trigger:M,payload:_,reason:N,event:Q})},close:(S,M)=>v?.close?v.close(S,M):M()}});te(),lt(n,["modal"],(S,M,_)=>U(_,{...M,...S}));let ae=r.get().modal;r.subscribe(()=>{let{modal:S}=r.get();if(S===ae)return;ae=S,re.updateModal()});let q={dismissal:y,presentation:I,press:T,group:B,hover:X,focus:F,triggerName:H,rules:v};return{...{...ce.api,getPayload:()=>r.get().payload,focus:()=>p()?.focus()},internal:Object.assign(b,q)}}function ju(e){let t=e.open??e.defaultOpen??!1;return{open:t,mounted:t,trigger:null,payload:void 0,titled:null,described:!1,modal:!1,presentation:"popover"}}function Ku(e,t={}){let n=()=>e().dismissible!==!1,r=(o,i)=>e().onDismissAttempt?.({reason:o,event:i});return{allows(o,i){let s=t.refusal?.(o)??(Fu(o)&&!n()?"attempt":void 0);if(!s)return!0;if(s==="attempt"&&o!=="focus-out"&&o!=="window-blur")r(o,i),t.refused?.(o);return!1},sheet:{dismissible:n,onDismissAttempt:(o)=>r("swipe",o)}}}function Ah(e,t){let n=e.preset.behavior==="dialog";if(n)e.store.set({presentation:"dialog"});return nu(e.store,()=>e.popup,()=>e.rules?.presentation?e.rules.presentation():e.options().presentation,n?"dialog":"popover",t)}var Bu={behavior:"combobox",modal:!1,dismissal:Ku,placement:Au,presentation:Ah};Pe();Pe();Ve();var Eh=/[\u1100-\u11ff\u3130-\u318f\uac00-\ud7af]/;function zu(e,t,n){let r=!!t&&Ct(t)&&!ws()&&!Eh.test(t.data??""),o=e.get().composingFrom!==null;if(r&&!o)e.set({composingFrom:n()});else if(!r&&o)e.set({composingFrom:null});return r}function _u(e,t,n,r,o){if(t.get().composingFrom===null)return;t.set({composingFrom:null});let i=hn({reason:"input-change",event:o,composing:!1},Nt("input-change",o));Wu(e,n,r,i);let s=e.options()[Dr(n,"Change")];if(typeof s==="function")s(r,i);$t.change?.(e.id,n,r,i,r)}var Ch=["input","trigger","clear","label"];function Uu(e){let t=e.value??e.defaultValue??"";return{...ju(e),value:t,query:t,composingFrom:null,initial:e.defaultValue??"",highlighted:null,items:e.items,status:e.status??"idle",listed:!1,labeled:!1,fieldName:null,inline:!!e.inlineComplete,disabled:!!e.disabled,formDisabled:!1,readOnly:!!e.readOnly,required:!!e.required,name:e.name,form:e.form,mounts:0,settled:!1,focusInList:!1,groupLabels:[],presentation:"popover",listing:ta}}function Yu(e){return{items:e.items,status:e.status??"idle",inline:!!e.inlineComplete,disabled:!!e.disabled,readOnly:!!e.readOnly,required:!!e.required,name:e.name,form:e.form,...e.defaultValue===void 0?{}:{initial:e.defaultValue},...e.open===void 0?{}:{open:e.open},...e.value===void 0?{}:{value:e.value}}}function Mh(e){let{id:t,store:n,options:r,element:o}=e;jo(e,["highlighted","focusInList"],(x)=>x?void 0:{highlighted:null,focusInList:!1});let i=Ir(e),s=n.get().value,a="imperative",l=null,c=()=>o("input"),f=()=>v.element()??o("content"),p=()=>{let x=n.get();return!Re(x)&&!x.readOnly},u=()=>!!r().inlineComplete;function m(x,S){let M=$e(x);if(!M)return;return S.entries().find((_)=>!S.disabled(_)&&$e(_.label).startsWith(M))}let g=pl(e,{query:()=>n.get().composingFrom??n.get().query,items:()=>n.get().items,emptyItems:()=>r().emptyItems,filter:()=>r().filter??"contains",autoHighlight:()=>r().autoHighlight||u()?"typing":!1,preferred:(x)=>u()?m(n.get().query,x)?.key:void 0,highlight(x,S){if(g.listbox.highlight(x,{event:S?.event}),x!==null&&u()&&S?.reason==="list-navigation")F(x,S.event)},open(x,S){if(!x.altKey)l=S;I({event:x,by:"keyboard"})},onHighlight:(x,S,M)=>r().onHighlight?.(x,{index:S,event:M}),container:()=>o("list")??f(),scrollRoot:f});lt(e,["highlighted"],(x,S)=>{if(x.items===S.items)return;return{highlighted:n.view({...S,...x},()=>g.settledHighlight(!1))}});let A=(x)=>Ch.some((S)=>Qe(e,S).some(({el:M})=>M.contains(x))),d=Hu(e,{preset:Bu,rules:()=>({trigger:c,returnFocus:!1,dismiss:(x,{event:S})=>T({reason:x,event:S}),contains:A,onOpenChange(x){if(x)return;l=null,n.set({highlighted:null,focusInList:!1})},onShow(){let x=o("content");if(x)return $a(x,Ra(a),()=>[c()])},open({event:x,by:S},M){if(!p())return;a=S==="touch"&&y.resolve()!=="sheet"?"pointer":S??"imperative",n.set({focusInList:Va(x)&&x?.target!==c()}),M(a)},close(x,S){let M=n.get().focusInList&&!!f()?.contains(document.activeElement);S();let _=c();if(M&&_&&!n.get().open)Yn(_)}})}),{control:b,popup:v}=d.internal,y=d.internal.presentation,{show:I,hide:T}=b;function B(x,S,{event:M,query:_=x,item:N,composing:Q=!1}={}){let ne=n.get();if((Re(ne)||ne.readOnly)&&S!=="reset")return!1;if(s=x,g.cause(S,M),x===ne.value||i("value",x,{reason:S,event:M,composing:Q,...N&&{item:N}})){if(s===x)n.set({query:_});return!0}let ee=c();if(ee&&ee.value!==ne.value)ee.value=ne.value;return!1}function X(x,S){if(!p())return;let M=x.value,_=S,Q=u()&&!_?.isComposing&&!!_?.inputType?.startsWith("insert")&&_.inputType!=="insertReplacementText"&&x.selectionEnd===M.length?m(M,g.listbox):void 0,ne=Q?M+Q.label.slice(M.length):M,ee=zu(n,S,()=>n.get().query);if(!B(ne,"input-change",{event:S,query:M,composing:ee}))return;if(Q&&ne!==M)x.value=ne,x.setSelectionRange(M.length,ne.length);if(!n.get().open&&(S||x.matches(":focus"))){if(M)l="first";I({event:S,by:"keyboard",reason:"input-change"})}}function F(x,S){let M=g.listbox.find(x)?.label,_=c(),{query:N}=n.get();if(M===void 0||!B(M,"list-navigation",{event:S,query:N}))return;if(!_)return;_.value=M;let Q=$e(M).startsWith($e(N))?N.length:M.length;_.setSelectionRange(Q,M.length)}function H(x){return r().onSubmit?.(n.get().value,{event:x}),!x?.defaultPrevented}function U(x,S){let M=g.listbox.find(x);if(!M||g.listbox.disabled(M)||!p())return!1;B(M.label,"item-press",{event:S,item:{value:M.key,label:M.label}});let _=c();if(_&&_.value!==n.get().value)_.value=n.get().value;return T({reason:"item-press",event:S}),!0}function te(x,S){if(!U(x,S)||!r().submitOnSelect)return;if(H(S))hs(c()?.form)}function Z(x){let{open:S,highlighted:M}=n.get();if(S&&M!==null){let _=g.listbox.element(M);if(_?.matches("a[href]"))return x.preventDefault(),_.click();if(!U(M,x))return x.preventDefault();if(!r().submitOnSelect||!H(x))x.preventDefault();return}if(S)T({reason:"input-commit",event:x});if(!H(x))x.preventDefault()}function re(x){if(g.navigate(x))return;let{open:S,value:M,query:_}=n.get();switch(x.key){case"ArrowUp":if(x.altKey&&S)x.preventDefault(),T({reason:"escape-key",event:x});return;case"ArrowDown":if(x.altKey&&!S)x.preventDefault(),I({event:x,by:"keyboard"});return;case"Enter":return Z(x);case"ArrowRight":case"End":if(u()&&M!==_&&!x.shiftKey)g.cause("input-change",x),n.set({query:M});return;case"Escape":if(S&&M!==_&&B(_,"escape-key",{event:x})){let N=c();if(N)N.value=_}return;case"Tab":if(S)T({reason:"focus-out",event:x})}}function ce(x){return se(x.ownerDocument,"reset",(S)=>{if(S.target!==x.form||fs(r().value,r().defaultValue))return;ds(S,()=>{let{initial:M}=n.get();if(B(M,"reset"),x.value!==n.get().value)x.value=n.get().value})},{capture:!0})}let ae={id:t,isOpen:d.isOpen,setOpen:d.setOpen,open:d.open,close:d.close,toggle:d.toggle,getValue:()=>n.get().value,setValue:(x,{reason:S="imperative",event:M}={})=>x!==n.get().value&&B(x,S,{event:M}),clear:({reason:x="imperative",event:S}={})=>n.get().value!==""&&B("",x,{event:S}),getHighlighted:()=>io(g.listbox,n.get().highlighted),highlight:(x)=>n.get().open&&oo(g.listbox,x===null?null:String(x),n.get().highlighted),focus:()=>c()?.focus(),internal:{...g,options:r,popup:v,presentation:y,show:I,hide:T,press:te,typed:X,onCompositionEnd:(x,S)=>{if(x.value===n.get().value)_u(e,n,"value",x.value,S);else X(x,S)},onInputKeyDown:re,ownsElement:A,bindReset:ce,inputElement:c,anchorElement:c,contentElement:f,arrowElement:()=>o("arrow"),text:(x)=>x.value,itemProps:(x)=>e.props("item",x),setFormDisabled:(x)=>n.set({formDisabled:x}),initialFocus(){let x=l;if(l=null,n.get().focusInList){let S=g.listbox.firstEnabled();if(S===void 0)return f();return g.listbox.highlight(S,{focus:!1}),g.listbox.element(S)??f()}if(x==="first"&&n.get().query)g.settle(!0,null);else if(x)g.listbox.highlight(g.listbox.stepKey(x)??null);return n.get().presentation==="sheet"?c():void 0},onListKeyDown(x){if(!n.get().focusInList||x.target===c())return;_s(x,{listbox:g.listbox,highlighted:n.get().highlighted,choose:te,focusInput(){n.set({focusInList:!1}),c()?.focus({preventScroll:!0})}})},contentProps:(x)=>d.internal.contentProps(x)}};lt(e,["query"],(x,S)=>("value"in x)&&x.value!==S.value&&x.value!==s?{query:x.value}:void 0);let q=n.get().value;return n.subscribe(()=>{let{value:x}=n.get();if(x===q)return;if(q=x,x===s)return;s=x,n.set({query:x})}),ae}var Xu=Mh;function Gu(e){if(e===null)return;if(e==="false")return!1;if(e==="pointer")return"pointer";return!0}function Ju(e){let t=e.slots((a)=>a),n=e.name,r=e.label??n,o={};for(let a in t)o[a]=a==="root"?n:`${n}-${a}`;if(he)Xi(t,{component:r});let i=(a)=>{let l=a,c=a.id,f=e.state(l),p=e.sync?.(l),u=p?{...f,...p}:f,m=Js(u,e.live??Oh),g,A,d=he?{component:r,id:c}:void 0,b=he?(e.controlled??["open","value","checked"]).filter((N)=>(N in m.get())):Th;if(he)Ur(d,b,l);let v=he?Yi(t,d):t,y;function I(N){if(y?.has(N))return;if(!y)y=new Set,T.slots=Object.create(v);y.add(N),Object.assign(T.slots,N.slots),ae(),N.extend?.(Z)}let T={name:n,label:r,slots:v,slotNames:o,parts:new Map,keyed:new Map,rank:0},{parts:B}=T;function X(N={}){return N.id??(N.value==null?"":String(N.value))}let F;function H(N,Q={},ne=!1){let ee=X(Q),fe=T.keyed.get(N),ue=fe instanceof Map?fe.get(ee):fe?.key===ee?fe:void 0;if(!ue){let le=`${N}:${ee}`;if(ue=T.sleeping?new Ga(N,ee,le,c,m,Q,T):{slot:N,key:ee,mapKey:le,id:c,api:Z,store:m,props:Q,el:void 0,owner:T,leases:0},Jn(ue),ne)Ja(ue)}else if(ne)return ue;return ue.props=Q,nl(ue),ue}function U(N,Q){if(Q===void 0){for(let ee of Eo(T).values())if(ee.slot===N&&ee.el?.isConnected)return ee.el;return}let ne=B.get(`${N}:${Q}`)?.el;return ne?.isConnected?ne:void 0}let te={id:c,label:r,store:m,options:()=>l,onOptions:(N)=>{(A??=[]).push(N)},onDestroy:(N)=>{(g??=[]).push(N)},parts:()=>Eo(T).values(),element:U,props:(N,Q="")=>{let ne=F?.[N];return ne&&X(ne)===Q?ne:B.get(`${N}:${Q}`)?.props}},Z=void 0;function re(){if(Z=e.api(te),T.api=Z,El(te,Z),he){for(let N of e.agent?.actions??[])if(typeof Z[N]!=="function")Ae(`lists \`${N}\` in \`agent.actions\`, but its api has no such method.`,d)}}let ce=!1;function ae(){let{sleeping:N}=T;if(!N||ce)return;ce=!0,wl(_,re),T.sleeping=void 0;for(let Q of[...N.binds])Q()}if(e.asleep?.(l))T.sleeping={wake:ae,binds:new Set};else re();let q=!1,x=!1,S=!1,M=(N,Q)=>Xs(m,N,e.sync?.(N),Q),_={types:void 0,name:n,id:c,get:m.get,subscribe:m.subscribe,get api(){return ae(),Z},part:H,use:I,preview(N){let Q=M({...N,id:c},m.get()),ne=m.get();for(let ee in Q)if(!Oe(ne[ee],Q[ee]))return{...ne,...Q}},get derives(){return Gs(m)},view(N,Q,ne){let ee=F;F=ne;try{return m.view(N,Q)}finally{F=ee}},setOptions(N){let Q=Yt(m),ne=N.id===c?N:{...N,id:c},ee=he&&x?M(ne,Q):void 0;if(l=ne,he)Ur(d,b,l);if(T.sleeping&&!e.asleep(l))ae();let fe=M(l,Q);if(he&&ee){let le=Ph(ee,fe,Q);if(le.length)We({type:"relay",...d,keys:le})}let ue;q=!0;try{if(A)for(let z of A)ue=z(l,fe)??ue;let le=Yt(m)===Q?fe:M(l,Yt(m));if(le)mn(ue,()=>m.set(le,!0))}finally{q=!1}},startState:(N)=>e.state({...N,id:c}),follow(N){x=!0;let Q,ne,ee=(fe=Yt(m),ue)=>{if(ue)return M({...ue,id:c},fe);if(S)return ne;let le=N();if(Q?.options!==le||Q.state!==fe)Q={options:le,state:fe},ne=M({...le,id:c},fe);return ne};if(m.follow(ee),he)m.subscribe((fe,ue,le)=>{if(q&&!ue&&!ns())We({type:"relay",...d,keys:[...le]})});return ee},destroy(){if(S)return;if(S=!0,Sl(_),g)bl(()=>{for(let N=0;N<g.length;N++)g[N]()});if(he)We({type:"instance",action:"destroy",...d,controlled:b})}};if(Zs(_,m),Ru(_,B,e,te.options),he)We({type:"instance",action:"create",...d,controlled:b});return _},s=(a)=>vl(()=>i(a));return Object.defineProperty(s,"name",{value:n}),Object.assign(s,{options:e.options,slots:t})}function Ph(e,t,n){let r=e,o=t??{},i=n;return[...new Set([...Object.keys(r),...Object.keys(o)])].filter((a)=>!Oe(a in r?r[a]:i[a],a in o?o[a]:i[a]))}var Oh=[],Th=[],Qu=new WeakMap;function yi(e){let t=Qu.get(e);if(!t){let{options:n,slots:r={}}=e;t={options:{debug:"boolean",...n},slots:Object.fromEntries(Object.entries(r).map(([o,i])=>[o,i.props??{}]))},Qu.set(e,t)}return t}var yn=(e)=>Nn(e);var Dh=Ju({name:"autocomplete",options:{container:"value",value:"string",defaultValue:"string",onValueChange:"callback",open:"boolean",defaultOpen:"boolean",onOpenChange:"callback",onOpenChangeComplete:"callback",onSubmit:"callback",items:"value",emptyItems:"value",filter:Bs(["contains","startsWith","fuzzy"],"contains"),inlineComplete:"boolean",autoHighlight:"boolean",openOnFocus:"boolean",submitOnSelect:"boolean",status:"string",onHighlight:"callback",onLoadMore:"callback",announcement:"value",loop:"boolean",modal:Gu,presentation:"string",disabled:"boolean",readOnly:"boolean",required:"boolean",name:"string",form:"string",controller:"value",dismissible:"boolean",onDismissAttempt:"callback"},state:Uu,live:["highlighted"],controlled:["open","value"],sync:Yu,api:Xu,slots:(e)=>Lu(e),agent:{actions:["setOpen","setValue","clear"]}}),Zu=Dh;var bi=new WeakMap,ed=new WeakMap;function Wt(e,t,...n){if(t==="customValidity")ed.set(e,n[0]);let r=bi.get(e)?.[t];return r?.(...n),!!r}function vi(e,t,n){let r="",o=()=>{let c=n.value();if(c instanceof FormData)t.setFormValue(c,n.state());else if(Array.isArray(c)){let m=new FormData,g=n.name?.();if(g)for(let A of c)m.append(g,A);t.setFormValue(m,n.state())}else t.setFormValue(c,n.state());let f=n.valueMissing(),p=ed.get(e),u=n.invalid?.();if(p)t.setValidity({customError:!0},p,n.anchor?.()??e);else if(u)t.setValidity(u.flags,u.message,u.anchor??n.anchor?.()??e);else if(f)t.setValidity({valueMissing:!0},n.message(),n.anchor?.()??e);else t.setValidity({});if((u?.message??"")===r)return;r=u?.message??"",zt(e)};o();let i=n.subscribe(o),s=n.focus?ps(e,n.focus):()=>{};if(gs(e))n.disabled(!0);bi.set(e,{reset:()=>{n.reset(),o()},disabled:(c)=>n.disabled(c),restore:(c)=>{if(typeof c==="string")n.restore(c)},customValidity:o});let a=bs(e,()=>Cn(e)),l=()=>{if(n.focus)ms(e,t.form)};return e.addEventListener("invalid",l),()=>{e.removeEventListener("invalid",l),i(),a(),bi.delete(e),s()}}De();function td(){let e=[],t=!0;return{waitUntil:(o)=>{if(!t)throw new DOMException("waitUntil() can only be called while the event dispatches.","InvalidStateError");e.push(o)},done:()=>(t=!1,e)}}var wi=new WeakMap,fd=0,nd=new Set;function pd(e){if(typeof customElements>"u"||nd.has(e))return!1;if(customElements.get(e))return Ae(`<${e}> is already defined by another library or another copy of ui-sdk. This one is skipped.`),!1;return nd.add(e),!0}function Ei(e){if(!wi.has(e))wi.set(e,`auto-${++fd}`);return wi.get(e)}var md=(e)=>!!e.closest("[data-drag-preview]");function Li(e){return e.querySelector(":scope > button, :scope > a, :scope > ui-button > button, :scope > ui-button > a")??e.firstElementChild}var Fi=(e)=>(t)=>t.querySelector(`:scope > ${e}`)??t.firstElementChild;function vt(e,t){if(t)return t(e);return e.hasAttribute("as-child")?e.firstElementChild:e}var hd=(e,t)=>e.id!==t.id||e.value!==t.value,Ri=(e)=>e.replace(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`),Rr=["role","aria-disabled"];function gd(e,t){if(t===null)return;if(typeof e==="function")return e(t);if(e==="boolean")return t!=="false";if(e==="number"){let n=Number(t);return t.trim()===""||Number.isNaN(n)?void 0:n}if(e==="list")return t.split(",").map((n)=>n.trim()).filter(Boolean);return t}var yd=new Set(["disabled","required"]);function bd(e){return Object.entries(e).map(([t,n])=>[t,Ri(t),n,n==="boolean"&&yd.has(t)])}function vd(e,t,n,r){let o=e.getAttribute(t);if(r)return o===null?void 0:!0;return gd(n,o)}function wd(e,t,n){return vd(e,Ri(t),n,n==="boolean"&&yd.has(t))}function xd(e,t){let n={};if(!t.length||!e.hasAttributes())return n;for(let[r,o,i,s]of t){let a=vd(e,o,i,s);if(a!==void 0)n[r]=a}return n}var rd=(e,t)=>typeof t==="function"?t(e):t;function Sd(e,t,n={},r=[]){for(let[o,i]of Object.entries(t)){if(o in e)continue;let s=Ri(o);Object.defineProperty(e,o,{configurable:!0,get(){return wd(this,o,i)??rd(this,n[o])??(i==="boolean"?!1:void 0)},set(a){let l=a===!1&&i==="boolean"&&!r.includes(o)&&!rd(this,n[o]);if(a==null||l)this.removeAttribute(s);else this.setAttribute(s,a===!0?"":Array.isArray(a)?a.join(","):String(a))}})}}function kd(e,t){for(let n of t){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let r=e[n];delete e[n],e[n]=r}}var nt=new Set;function Ad(e,t,n){nt.add(e);try{return Wt(e,"restore",t,n)}finally{nt.delete(e)}}var wt=new Map;function Ci(e){for(let t of wt.keys())if(t.contains(e))wt.delete(t)}function Ed(e,t,n){let r={};wt.set(e,r),queueMicrotask(()=>{if(wt.get(e)!==r)return;wt.delete(e),Ad(e,t,n)})}function Ih(e){let t=Vt.get(e);if(nt.has(e)||!!t&&nt.has(t))return!0;for(let n of nt)if(e.contains(n))return!0;return!1}function Lh(e,t){return t===void 0&&!!e&&typeof e==="object"&&"reason"in e&&!(typeof Event<"u"&&e instanceof Event)}var Mi=[],Fh={};function Pi(e,t,n=Mi,r=Mi,o=Fh){let i;return new Proxy(t,{get(s,a){if(a in s||typeof a!=="string"||!/^on[A-Z]/.test(a))return s[a];if(n.length&&n.includes(a))return;if(i&&a in i)return i[a];let l=o[a]??a.slice(2).toLowerCase(),c=a.endsWith("ChangeComplete"),f=r.length>0&&r.includes(a),p=(u,m)=>{if(Ih(e)&&!c)return;let g=Lh(u,m),{cancel:A,canceled:d,...b}=(g?u:m)??{},v=g?b:{...b,value:u},y=f?td():void 0;if(y)v.waitUntil=y.waitUntil;let I=new CustomEvent(l,{detail:v,bubbles:!1,cancelable:typeof A==="function"||typeof u?.preventDefault==="function",composed:!0}),T=e.dispatchEvent(I),B=y?.done()??[];if(!T){if(typeof A==="function")A();else if(u&&typeof u.preventDefault==="function")u.preventDefault()}return B.length>1?Promise.all(B).then((X)=>X.at(-1)):B[0]};return(i??={})[a]=p,p}})}var Fr=new WeakMap;function Rh(e){return e?Fr.get(e):void 0}var $h=/^(?:get|is|can)[A-Z]|^focus$/;function Nh(e,t,n){let r={};for(let o of n){let i=t[o];if(typeof i==="function")r[o]=(...s)=>{if(!$h.test(o))Ci(e);return i.apply(t,s)}}return Object.freeze(r)}var Cd=new Map,Md=new Set,xi;function Pd(){if(xi)return xi;let e=globalThis,t=Symbol.for("ui-sdk.web-styles@1");return e[t]=(e[t]??0)+1,xi=`ui-sdk-web-${e[t]}`}var $r="",bn=0,od=new WeakMap;function Od(e,t,n=!1){if(n)Md.add(e);if(!t&&!n)return;if(t)Cd.set(e,t);$r=Td(),Te(document,Pd(),$r),bn++}function Td(){return["@layer ui-sdk {",' :where([data-slot][hidden]:not([hidden="until-found"])) { display: none !important }',...[...Cd].map(([e,t])=>` :where(${e}:not([hidden]), ${e}[hidden="until-found"]) { display: ${t} }`),...[...Md].map((e)=>` :where(${e}[align]) { text-align: inherit }`)," :where([as-child]) { display: contents }","}"].join(`
|
|
2
|
+
`)}function Oi(e){let t=e.getRootNode();if(!Wh(t))return qh(e.ownerDocument);let n=Vh(t.ownerDocument);if(!n||t.adoptedStyleSheets.includes(n))return;t.adoptedStyleSheets=[n,...t.adoptedStyleSheets]}var Wh=(e)=>e.nodeType===11&&("host"in e);function Vh(e){let t=e.defaultView;if(!t)return;let n=od.get(e);if(!n)od.set(e,n={sheet:new t.CSSStyleSheet,version:-1});if(n.version!==bn)n.sheet.replaceSync(Td()),n.version=bn;return n.sheet}var id=new WeakMap;function qh(e){if(!$r)return;let t=id.get(e);if(t&&t.version===bn&&t.el?.isConnected)return;let n=Pd();Te(e,n,$r),id.set(e,{el:e.getElementById(n),version:bn})}function Hh(e,t){if(!e)return!1;let n=0;for(let o in e){if(e[o]===void 0)continue;if(n++,t[o]!==e[o])return!1}let r=0;for(let o in t){if(t[o]===void 0)continue;r++}return n===r}function jh(e,t){let n;return Co(t,(r)=>((n??=[]).push([r,e.getAttribute(r)]),!1)),n}function Kh(e){if(!e.authored)return!0;for(let[t,n]of e.authored)if(e.el.getAttribute(t)!==n)return!1;return!0}var Ti=new Set;function sd(e){for(let t of Ti)if(t!==e&&e.contains(t))t.reconfigure()}var Di=new WeakMap;var Vt=new WeakMap,qt=new WeakMap;function Bh(e,t){for(let n=e.el;n&&n!==t;n=n.parentElement){let r=qt.get(n);if(r===e)return;if(r?.el===e.el&&vn.has(r))return r}}function zh(e){e.dataSlot=void 0;let t=[];for(let n=e.el;n;n=n.parentElement){let r=qt.get(n);if(r&&r!==e&&r.el===e.el&&vn.has(r))t.push(r)}if(!t.length)return;e.el.removeAttribute("data-slot"),nn(e.el,"data-slot");for(let n of t)n.lastAttrs=void 0,n.sync?.()}var vn=new WeakSet,Si=[],Nr;function ad(e){for(let t of e)try{t()}catch(n){queueMicrotask(()=>{throw n})}}function _h(e){if(!Si.length)queueMicrotask(()=>{let t=Nr=[];ad(Si.splice(0)),Nr=void 0,ad(t)});Si.push(e)}var Ii=new WeakMap,Dd=(e)=>e.value!==void 0&&typeof e.value!=="string";function Uh(e,t,n){for(let r=e.parentElement;r;r=r.parentElement){let o=qt.get(r);if(o?.slot!==t||Vt.get(r)!==n)continue;return o.keyed&&Dd(o.props)?{...o.props,value:o.props.id}:o.props}}var ld=new Map,Yh=/^[a-z][a-z0-9-]*$/;function Xh(e){let t=ld.get(e);if(t)return t;let n=e.split(",").map((r)=>r.trim());if(n.every((r)=>Yh.test(r)))if(n.length===1){let r=n[0];t=(o)=>o.localName===r}else{let r=new Set(n);t=(o)=>r.has(o.localName)}else t=(r)=>r.matches(e);return ld.set(e,t),t}function Lr(e,t){let n=Xh(t),r=e.getAttribute("for");if(r){let o=e.getRootNode(),i="getElementById"in o?o.getElementById(r):null;if(i&&n(i))return i}for(let o=e.parentElement;o;o=o.parentElement){if(n(o))return o;let i=Vt.get(o);if(i&&n(i))return i}}function Id(e,t){queueMicrotask(()=>{if(!e.isConnected)t()})}var Ld=new WeakMap,Gh=(e,t,n)=>(Ld.set(e,n.state),vi(e,t,n));function Fd(e){return class extends e{static formAssociated=!0;#e;constructor(){super();this.#e=this.attachInternals(),Zr(this,this.#e,Gh)}get form(){return this.#e.form}get labels(){return this.#e.labels}get name(){return this.getAttribute("name")??""}set name(t){this.setAttribute("name",t)}get validity(){return this.#e.validity}get validationMessage(){return this.#e.validationMessage}get willValidate(){return this.#e.willValidate}checkValidity(){return this.#e.checkValidity()}reportValidity(){return this.#e.reportValidity()}setCustomValidity(t){if(!Wt(this,"customValidity",t))this.#e.setValidity(t?{customError:!0}:{},t)}formResetCallback(){wt.delete(this),Wt(this,"reset")}formDisabledCallback(t){Wt(this,"disabled",t)}formStateRestoreCallback(t,n){if(wt.delete(this),!Ad(this,t,n))Ed(this,t,n)}}}var ki=(e)=>`default${e[0].toUpperCase()}${e.slice(1)}`;function Qh(e,t,n){if(!pd(e))return;let r={debug:"boolean",...n.attributes},o=bd(r);Od(e,n.display,"align"in r);let i=n.state??{},s=Object.entries(i),a=s.map(([A])=>A),l=a.map(ki),c=Object.entries(n.host??{}),f=Object.entries(n.children??{}),p=[...a,...n.properties??[],...o.map(([A])=>A)],u=`ui-sdk-${e.replace(/^ui-/,"")}-`,m=!!n.options&&n.options.length>0,g=(A,d,b)=>{let v=xd(A,o);if(b.size)for(let I of b)delete v[I];for(let I in d){let T=d[I];if(T!==void 0)v[I]=T}for(let I=0;I<a.length;I++){let T=a[I];if(!(T in v))continue;let B=l[I];if(!(B in v))v[B]=v[T];delete v[T]}let y=n.options?.(A);if(y)Object.assign(v,y);return v};customElements.define(e,class A extends(n.formAssociated?Fd(HTMLElement):HTMLElement){static observedAttributes=[...o.map(([,d])=>d),...Rr];#e;#t;get#n(){return Fr.get(this)}get api(){if(!this.#n)return;return this.#e??=Nh(this,this.#n.api,n.api??[])}#o=new Set;#r=new Set;#i=!1;#c=!1;#p=new Set;#b=new Set;#x=new Set;#u=!1;#d={};#f={};#v;static{for(let[d,{get:b,set:v}]of s)Object.defineProperty(A.prototype,d,{get(){if(d in this.#f)return this.#f[d];return this.#n?b(this.#n.api):void 0},set(y){if(Ci(this),this.#n&&!this.#u)this.#S(()=>v(this.#n.api,y));else this.#f[d]=y}});for(let d of n.properties??[])Object.defineProperty(A.prototype,d,{get(){return this.#d[d]},set(b){if(Object.is(this.#d[d],b))return;if(this.#d[d]=b,!this.#i)return;this.#s(),this.#k()}});Sd(A.prototype,r,n.defaults)}#s(d){this.#n?.setOptions(Pi(this,{...g(this,this.#d,this.#p),...d,id:this.#n.id},n.silent,n.actions,n.events))}attributeChangedCallback(d,b,v){if(nn(this,d),Rr.includes(d))return;let y=d.replace(/-(\w)/g,(B,X)=>X.toUpperCase());if(y in i&&v!==b&&!this.#c)Ci(this);if(!this.#c||v===null)this.#p.delete(y);else if(b===null)this.#p.add(y);if(!this.#i)return;if(this.#s(),sd(this),!(y in i)||v===b)return;let I=r[y],T=I==="boolean"?!1:I==="list"?[]:null;this.#S(()=>i[y].set(this.#n.api,v===null?T:gd(I,v)))}#S(d){let b=nt.has(this);nt.add(this);try{Gr(this,d)}finally{if(!b)nt.delete(this),zt(this)}}connectedCallback(){if(Oi(this),md(this))return;if(this.#i){for(let T of this.#o)eo(T.el);if(n.options)this.#s();return}kd(this,p);for(let[T,B]of c)if(!this.hasAttribute(T))this.setAttribute(T,B);let d=Object.keys(this.#f).length>0,b=this.#u&&!d?this.#v:void 0,v={},y=!1;if(this.#u&&b===void 0)for(let[T,{get:B}]of s)v[T]=B(this.#n.api),y=!0;if(d)Object.assign(v,this.#f),this.#f={},y=!0;if(this.#u)Fr.delete(this),this.#e=void 0,this.#u=!1,this.#v=void 0;let I=this.#n;if(I)this.#s();else{let T=g(this,this.#d,this.#p);if(y)for(let B in v)T[ki(B)]=v[B];T.id=this.id||(this.#t??=`${u}${++fd}`),I=t(Pi(this,T,n.silent,n.actions,n.events)),Fr.set(this,I)}if(n.formAssociated&&y){let T=I.startState(g(this,this.#d,this.#p)),B={};for(let X in v)B[ki(X)]=T[X];this.#s(B)}if(this.#i=!0,m)Ti.add(this);if(n.self){let T=vt(this,n.target);if(T)this.#A(T);else Ae(`<${e}> needs an element inside it.`)}for(let[T,B]of f){let X=B(this);if(X)this.#E(T,X);else if(!n.optionalChildren?.includes(T))Ae(`<${e}> needs its native element inside it for "${T}".`)}if(n.children||n.target)this.#y=new MutationObserver(()=>{this.#I(),this.#D()}),this.#y.observe(this,{childList:!0});if(this.#k(),this.id){let T=this.getRootNode();for(let B of T.querySelectorAll(`[for="${CSS.escape(this.id)}"]`))Ii.get(B)?.()}if(b!==void 0)Ed(this,b,"restore")}#h;#k(){this.#h?.(),this.#h=n.render?.(this,this.#n)||void 0}reconfigure(){if(this.#i)this.#s()}#g=new Map;#y;#a;#A(d){if(this.#a={slot:n.self,el:d,props:{}},d!==this)qt.set(this,this.#a);this.register(this.#a)}#D(){if(!n.self||!n.target)return;let d=vt(this,n.target);if(d===this.#a?.el)return;if(this.#a)this.unregister(this.#a);if(this.#a=void 0,this.#s(),d)this.#A(d)}#E(d,b){let v={slot:d,el:b,props:n.childProps?.read?.(b)??{}};if(n.childProps)v.observer=new MutationObserver(()=>{v.props=n.childProps.read?.(b)??{},this.#s(),this.update(v,!1)}),v.observer.observe(b,{attributeFilter:n.childProps.attributes});this.#g.set(d,v),this.register(v)}#I(){for(let[d,b]of Object.entries(n.children??{})){let v=b(this),y=this.#g.get(d);if(y?.el===v)continue;if(y)this.unregister(y),this.#g.delete(d);if(v)this.#E(d,v)}}disconnectedCallback(){Id(this,()=>{this.#v=Ld.get(this)?.(),this.#h?.(),this.#h=void 0,this.#y?.disconnect(),this.#y=void 0,this.#g.clear(),this.#a=void 0,this.#i=!1,Ti.delete(this);for(let d of this.#o)this.unregister(d);this.#n?.destroy(),this.#u=!0})}register(d){if(this.#o.add(d),vn.add(d),d.sync=()=>this.#r.has(d)||this.#l(d),!this.#r.size)_h(()=>this.#L());this.#r.add(d)}#L(){let d=this.#r.size>1?st([...this.#r]):[...this.#r];this.#r.clear();for(let b of d){if(!this.#o.has(b))continue;if(b.reread)b.props=b.reread();if(b.feature)this.#n.use(b.feature);this.#C(b),this.#l(b)}}#C(d){let b=this.#n;d.unwatch?.();let v=b.part(d.slot,d.props);d.record=v,d.selected=tr(v),d.version=yn(b),d.unwatch=Pt(v,(y)=>{if(er(v)!==d.shown)return d.version=yn(b),this.#l(d);if(y)return;let I=yn(b);if(I===d.version)return;d.version=I,this.#l(d)})}unregister(d){d.unwatch?.(),d.unwatch=void 0,d.observer?.disconnect(),d.observer=void 0,this.#m(d),Lo(d.el,this.#T),d.record=void 0,d.lastAttrs=void 0,d.disconnect?.(),d.disconnect=void 0,this.#w(d),this.#o.delete(d),vn.delete(d),this.#r.delete(d),zh(d)}rebind(){let d=st([...this.#o].filter((b)=>!this.#r.has(b)));for(let b of d)this.#m(b),b.record=void 0,b.lastAttrs=void 0;for(let b of d)this.#l(b)}update(d,b){if(this.#r.has(d))return;this.#M(d,b),this.#l(d);for(let v of this.#o){if(v===d||this.#r.has(v))continue;if(v.reread){let y=v.props;v.props=v.reread(),this.#M(v,hd(y,v.props))}this.#l(v)}sd(d.el)}#M(d,b){if(b)this.#m(d),d.lastAttrs=void 0;let v=this.#n.part(d.slot,d.props),y=v!==d.record||tr(v)!==d.selected;if(d.record=v,y)this.#C(d)}#l(d){if(this.#b.has(d))return void this.#x.add(d);Oi(d.el);let b=this.#n,v=b.part(d.slot,d.props);if(d.record=v,d.disconnect??=To(v,d.el),d.shown=er(v),d.shown){let y=this.#F(d);if(y!==void 0&&this.#R(d,y))this.#m(d),this.#$(d,y);let I=ft(v);if(I.hidden===void 0&&(Mo(v)||("hidden"in I)))d.el.removeAttribute("hidden");if(this.#O(d,I),Nr)Nr.push(()=>{if(!d.unbind&&d.shown&&this.#o.has(d))this.#P(d,d.record??this.#n.part(d.slot,d.props))});else if(!d.unbind)this.#P(d,v)}else{if(d.unbind)this.#O(d,ft(v)),this.#m(d);if(d.lastAttrs=void 0,!d.el.hasAttribute("hidden"))d.el.setAttribute("hidden","");if(!d.el.hasAttribute("data-slot"))d.el.setAttribute("data-slot",d.slot==="root"?b.name:`${b.name}-${d.slot}`);this.#w(d)}}#P(d,b){let v,y=!1;if(d.unbind=()=>{y=!0,v?.()},v=Oo(b,d.el),y)v()}#m(d){let b=d.unbind;d.unbind=void 0,b?.()}#F(d){if(!n.portal?.slots.includes(d.slot))return;return to(n.portal.container(this,d))}#R(d,b){return b?d.el.parentNode!==b:!!d.placeholder}#$(d,b){if(this.#w(d),!b)return;d.placeholder=document.createComment(`${e} ${d.slot}`),d.el.replaceWith(d.placeholder),b.appendChild(d.el),Di.set(d.el,b)}#O(d,b){let v=Bh(d,this);if(v?.dataSlot)b={...b,"data-slot":v.dataSlot};if(Hh(d.lastAttrs,b)&&Kh(d))return;d.lastAttrs=b,d.dataSlot=b["data-slot"];let y=this.#c;this.#c=d.el===this,this.#b.add(d);try{tn(d.el,b,this.#T),d.authored=jh(d.el,b)}finally{this.#c=y,this.#b.delete(d)}if(this.#x.delete(d))this.#l(d)}get#T(){return`render:${Ei(this)}`}#w(d){if(!d.placeholder)return;d.placeholder.replaceWith(d.el),d.placeholder=void 0,Di.delete(d.el)}})}var Jh=new Set(["payload"]);function Zh(e,t){if(!pd(e))return;let n=t.props??{},r=bd(n),o=t.properties??[],i=o.filter((f)=>Jh.has(f)),s=new Set(i),a=Object.entries(t.from??{}),l=t.ids??[],c=[...o,...r.map(([f])=>f)];Od(e,t.display,"align"in n),customElements.define(e,class f extends(t.formAssociated?Fd(HTMLElement):HTMLElement){static observedAttributes=[...r.map(([,p])=>p),...i,"for",...Rr];#e;#t;#n;static{for(let p of o){let u=s.has(p);Object.defineProperty(f.prototype,p,{get(){let m=this.#n?.[p];if(u)return m!==void 0?m:this.getAttribute(p)??void 0;return m??(n[p]&&wd(this,p,n[p]))},set(m){(this.#n??={})[p]=m,this.attributeChangedCallback("")}})}Sd(f.prototype,n,t.defaults,a.map(([p])=>p))}#o(){let p=xd(this,r);if(t.context){let u=t.context(this);for(let m in u)if(!(m in p))p[m]=u[m]}for(let u of o){let m=this.#n?.[u];if(m!==void 0)p[u]=m;else if(s.has(u)&&this.hasAttribute(u))p[u]=this.getAttribute(u)}for(let[u,{slot:m,prop:g}]of a)p[u]??=Uh(this,m,this.#e)?.[g];for(let u of l)p[u]??=Ei(this);if(p.value===void 0&&p.id===void 0)p.id=Ei(this);if(t.keyed&&Dd(p))p.id??=Rh(this.#e)?.api.internal.keyOf(p.value);return Pi(this,p,Mi,t.actions)}#r;connectedCallback(){if(md(this))return;if(kd(this,c),Oi(this),(t.target||this.hasAttribute("as-child"))&&!this.#r)this.#r=new MutationObserver(()=>this.#c()),this.#r.observe(this,{childList:!0});let p=Lr(this,t.owner)??this.#e;if(!p)return queueMicrotask(()=>this.#i());if(!("register"in p)){customElements.whenDefined(p.localName).then(()=>this.isConnected&&this.connectedCallback());return}if(p===this.#e&&this.#t&&vn.has(this.#t))return;if(this.#e&&this.#t)this.#e.unregister(this.#t);let u=vt(this,t.target);if(!u)return queueMicrotask(()=>{if(this.isConnected&&!this.#t&&!vt(this,t.target))Ae(`<${e}> needs an element inside it.`)});if(!this.#t){if(t.render?.(this),this.#t)return}this.#e=p;let m=Boolean(t.context||t.from);this.#t={slot:t.slot,feature:t.feature,el:u,props:m?{}:this.#o(),reread:m?()=>this.#o():void 0,keyed:t.keyed},Vt.set(this,p),qt.set(this,this.#t),p.register(this.#t)}#i(){if(!this.isConnected||this.#e)return;if(Lr(this,t.owner))this.connectedCallback();else if(t.alone)t.alone(vt(this,t.target)??this,this);else if(!this.hasAttribute("for"))Ae(`<${e}> must be inside ${t.owner}.`)}#c(){let p=this.#t?.el;if(!this.isConnected||p&&Di.has(p))return;let u=vt(this,t.target);if(u===(p??null))return;if(this.#e&&this.#t)this.#e.unregister(this.#t);if(this.#e=void 0,this.#t=void 0,u)this.connectedCallback()}disconnectedCallback(){Id(this,()=>{if(this.#r?.disconnect(),this.#r=void 0,this.#e&&this.#t)this.#e.unregister(this.#t);Vt.delete(this),qt.delete(this),this.#e=void 0,this.#t=void 0})}attributeChangedCallback(p){if(nn(this,p),Rr.includes(p))return;if(p==="for"){if(this.hasAttribute("for")&&!Ii.has(this))Ii.set(this,()=>{if(this.isConnected)this.connectedCallback()});if(!this.isConnected)return;if(!Lr(this,t.owner)&&this.#e&&this.#t)this.#e.unregister(this.#t),this.#e=void 0,Vt.delete(this);this.connectedCallback();return}if(!this.#e||!this.#t){if(t.alone&&this.isConnected&&!Lr(this,t.owner))t.alone(vt(this,t.target)??this,this);return}let u=this.#t.props;this.#t.props=this.#o();let m=this.#t.props,g=hd(u,m)||!!t.rebind?.some((A)=>u[A]!==m[A]);this.#e.update(this.#t,g),t.changed?.(this)}})}var Ai=new WeakMap;function cd(e,t,n={},r=!1){let o={},i=[],s=[],a=[],l=!1,c={};for(let[f,p]of Object.entries({...e,...n})){if(!p)continue;if(typeof p==="object"){let[m,g=f]=p.from.split(".");if(m in t.slots)c[f]={slot:m,prop:g};if(!(r&&(m in t.slots))&&!(f in n))continue}let u=typeof p==="object"?p.kind:p;if(u==="value")i.push(f);else if(u==="action")a.push(f);else if(u==="id")s.push(f);else if(u==="key")l=!0;if(u==="value"||u==="action"||u==="callback")continue;if(f!=="id"||f in n)o[f]=u==="id"||u==="key"?"string":u}return{attributes:o,properties:i,ids:s,actions:a,keyed:l,from:Object.keys(c).length?c:void 0}}var eg=["anchor","initialFocus","finalFocus"],ud=(e)=>typeof e==="string"?{tag:e}:e;function dd(e,t,n,r,o=!1){let i=yi(e);if(t==="root"){let{tag:b,self:v,kinds:y,properties:I=[],...T}=ud(n);Ai.set(e,[...new Set([...Ai.get(e)??[],b])]);let{debug:B,...X}=i.options,F=cd(X,i,y),H={...T,self:v??("root"in i.slots&&!T.children?.root?"root":void 0),attributes:F.attributes,properties:[...new Set([...F.properties,...I])].filter((U)=>!T.state?.[U]),actions:F.actions};return{kind:"owner",key:t,tagName:b,config:H}}let{tag:s,slot:a=t,owners:l=[],kinds:c,properties:f=[],...p}=ud(n),u=Ai.get(e);if(!u)throw Error(`<${s}> is a part of ${e.name}: define its root first.`);let m=i.slots[a]??(p.feature?.slots[a]&&(p.feature.slots[a].props??{}));if(!m)throw Error(`<${s}>: ${e.name} has no ${a} slot.`);let{attributes:g,...A}=cd(m,i,c,o),d={...p,slot:a,owner:[...new Set([...r?[r]:[],...u,...l])].join(", "),props:g,...A,properties:[...new Set([...A.properties,...f,...eg.filter((b)=>(b in m))])]};return{kind:"part",key:t,tagName:s,config:d}}function tg(e,t,n=!1){let{root:r,...o}=t,i=dd(e,"root",r,void 0,n);return[i,...Object.entries(o).flatMap(([s,a])=>a?[dd(e,s,a,i.tagName,n)]:[])]}function ng(e,t){if(t.kind==="owner")Qh(t.tagName,e,t.config);else Zh(t.tagName,t.config)}var rg=(e)=>e.replace(/(^|-)(\w)/g,(t,n,r)=>r.toUpperCase());function og(e,t,n=!1){let r={};for(let o of tg(e,t,n))ng(e,o),r[rg(o.key)]=typeof customElements>"u"?void 0:customElements.get(o.tagName);return r}function $i(e,t){return og(e,t,!0)}var ze=new WeakMap,wn=new WeakMap;function Wr(e,t){let{state:n,store:r}=e;if(!t){if(e.wantedId="",n.value||n.selection)r.clear();return}if(t===e.wantedId||t===n.selection?.suggestion.id)return;e.wantedId=t,r.selectById(t)}var ig={kind:"string",municipalityCodes:"list",limit:"number",debounceMs:"number",includeProvisional:"boolean",houseNumberPrefix:"boolean",fetchDetails:"boolean",defaultAddressId:"string",idName:"string",defaultValue:null,defaultOpen:null,filter:null,items:null,emptyItems:null,inlineComplete:null,openOnFocus:null,submitOnSelect:null,controller:null},sg=["kind","municipality-codes","limit","debounce-ms","include-provisional","house-number-prefix","fetch-details"];function ag(e){return e.open&&e.status!=="idle"}function Wi(e){return{client:e.client,kind:e.kind==="accessAddress"?"accessAddress":"address",municipalityCodes:e.municipalityCodes?.length?e.municipalityCodes:void 0,limit:e.limit??void 0,debounceMs:e.debounceMs??void 0,includeProvisional:e.includeProvisional,houseNumberPrefix:e.houseNumberPrefix,fetchDetails:e.fetchDetails}}function lg(e,t){let n=new Map;for(let o of e.children)if(o.localName==="dk-address-item")n.set(o.getAttribute("value")??"",o);let r=t.map((o)=>{let i=Kt(o),s=n.get(i);if(n.delete(i),!s)s=document.createElement("dk-address-item"),s.setAttribute("value",i),s.setAttribute("label",o.label),s.dataset.type=o.type,s.textContent=o.label;return s});for(let o of n.values())o.remove();r.forEach((o,i)=>{if(e.children[i]!==o)e.insertBefore(o,e.children[i]??null)})}var Ni=new WeakMap;function cg(e,t){let n=Ni.get(e);if(t&&n)e.append(n),Ni.delete(e);else if(!t&&!n){let r=document.createDocumentFragment();r.append(...e.childNodes),Ni.set(e,r)}}var Rd=new WeakSet,ug=0;function dg(e,t){for(let n of e.querySelectorAll("dk-address-popup")){if(n.hasAttribute("anchor")&&!Rd.has(n))continue;if(!t.id)t.id=`dk-address-control-${++ug}`;let r=`#${CSS.escape(t.id)}`;if(n.getAttribute("anchor")!==r)n.setAttribute("anchor",r);Rd.add(n)}}function fg(e,t){let n=e.querySelector(":scope > input[type=hidden][data-dk-address-id]");if(!e.idName){n?.remove();return}if(!n)n=document.createElement("input"),n.type="hidden",n.dataset.dkAddressId="",e.append(n);n.name=e.idName;let r=e.getAttribute("form");if(r)n.setAttribute("form",r);else n.removeAttribute("form");n.value=t?.suggestion.id??""}function $d(e,t){let{state:n}=t,r=ag(n),o=e;if(o.value!==n.value)o.value=n.value;let i=n.status==="success"?"idle":n.status;if(o.status!==i)o.status=i;let s=r?"true":"false";if(e.getAttribute("open")!==s)e.setAttribute("open",s);for(let c of e.querySelectorAll("dk-address-list"))lg(c,n.suggestions);let a=n.status==="success"&&n.suggestions.length===0;for(let c of e.querySelectorAll("dk-address-empty"))cg(c,a);let l=e.querySelector("dk-address-control");if(l?.toggleAttribute("data-open",r),l?.toggleAttribute("data-loading",n.status==="loading"),l)dg(e,l);fg(e,n.selection),pg(e,t)}function pg(e,t){let{caret:n,value:r}=t.state;if(!n||n.revision===t.caretRevision)return;t.caretRevision=n.revision;let o=e.querySelector("dk-address-input input"),i=()=>{if(!o||o.ownerDocument.activeElement!==o||o.value!==r)return;o.setSelectionRange(n.position,n.position)};i(),requestAnimationFrame(i)}function mg(e){let t=_r({...Wi(e),onSelect:(c)=>{e.dispatchEvent(new CustomEvent("addressselect",{detail:c,bubbles:!0}))}}),n=new AbortController,{signal:r}=n,o={store:t,state:t.getState(),byKey:new Map,pickHandled:!1,caretRevision:null,id:"",wantedId:"",stop:()=>{}},i=(c)=>{let f=c?o.byKey.get(c):void 0;if(f)t.select(f)},s=t.subscribe(()=>{let c=t.getState();if(c.suggestions!==o.state.suggestions)o.byKey=new Map(c.suggestions.map((p)=>[Kt(p),p]));o.state=c,$d(e,o),e.dispatchEvent(new CustomEvent("statechange",{detail:c}));let f=c.selection?.suggestion.id??"";if(f!==o.id)o.id=f,o.wantedId=f,e.dispatchEvent(new CustomEvent("addressidchange",{detail:{value:f,selection:c.selection},bubbles:!0}))});e.addEventListener("valuechange",(c)=>{let{detail:f}=c;switch(f.reason){case"imperative":return;case"item-press":c.preventDefault(),o.pickHandled=!0,i(f.item?.value);return;case"clear-press":t.clear();return;case"escape-key":c.preventDefault();return;default:t.setInput(f.value)}},{signal:r}),e.addEventListener("openchange",(c)=>{let{detail:f}=c;if(f.reason==="imperative")return;if(f.reason==="item-press"){let p=f.event?.target,m=((p instanceof Element?p.closest("dk-address-item"):null)??e.querySelector("dk-address-item[data-highlighted]"))?.getAttribute("value");queueMicrotask(()=>{if(!o.pickHandled)i(m);o.pickHandled=!1}),c.preventDefault();return}t.setOpen(f.value)},{signal:r}),e.ownerDocument.addEventListener("reset",(c)=>{let f=e.querySelector("dk-address-input input")?.form;if(!f||c.target!==f)return;setTimeout(()=>{if(t.clear(),e.defaultAddressId)Wr(o,e.defaultAddressId)})},{signal:r});let a=new MutationObserver((c)=>{let f=new Set(c.map((p)=>p.attributeName));if(f.delete("address-id"))Wr(o,e.getAttribute("address-id")??"");if(f.size>0)t.setOptions(Wi(e))});if(a.observe(e,{attributeFilter:[...sg,"address-id"]}),o.stop=()=>{s(),n.abort(),a.disconnect(),t.destroy()},$d(e,o),Object.hasOwn(e,"addressId")){let c=e.addressId;delete e.addressId,wn.set(e,typeof c==="string"?c:"")}let l=wn.get(e)??e.getAttribute("address-id")??e.defaultAddressId;if(wn.delete(e),l)Wr(o,l);return o}var hg=$i(Zu,{root:{tag:"dk-address",display:"block",kinds:ig,defaults:{houseNumberPrefix:!0,fetchDetails:!0},properties:["client"],options:()=>({filter:!1}),render:(e)=>{let t=e,n=ze.get(t);if(n)n.store.setOptions(Wi(t));else ze.set(t,mg(t));return()=>{queueMicrotask(()=>{if(t.isConnected)return;ze.get(t)?.stop(),ze.delete(t)})}}},label:"dk-address-label",input:{tag:"dk-address-input",target:Fi("input"),display:"contents"},clear:{tag:"dk-address-clear",target:Li,display:"contents"},content:{tag:"dk-address-popup",display:"block"},status:{tag:"dk-address-status",display:"block"},empty:{tag:"dk-address-empty",display:"block"},list:{tag:"dk-address-list",display:"block"},item:{tag:"dk-address-item",display:"block"}});if(typeof customElements<"u"&&!customElements.get("dk-address-control")){customElements.define("dk-address-control",class extends HTMLElement{});let e=document.createElement("style");e.textContent=":where(dk-address-control) { display: block; }",document.head.append(e)}var Nd=hg.Root;if(Nd)Object.defineProperties(Nd.prototype,{state:{get(){return ze.get(this)?.state??null}},selection:{get(){return ze.get(this)?.state.selection??null}},addressId:{get(){let e=ze.get(this);return e?e.id:wn.get(this)??""},set(e){let t=typeof e==="string"?e:"",n=ze.get(this);if(n)Wr(n,t);else wn.set(this,t)}},selectById:{value(e){let t=ze.get(this);return t?t.store.selectById(e):Promise.resolve(null)}},clear:{value(){ze.get(this)?.store.clear()}}});export{Sn as createClient,Kt as suggestionKey};
|
|
3
|
+
|
|
4
|
+
//# debugId=48A2AB57E2EAA4A764756E2164756E21
|
|
5
|
+
//# sourceMappingURL=dk-address.js.map
|