(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,616448,e=>{"use strict";var t=e.i(699173),r=e.i(592121),n=e.i(747961);let l=(0,r.forwardRef)(({title:e,titleId:r,desc:n,descId:l,...i},a)=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",ref:a,"aria-labelledby":r,"aria-describedby":l,...i,children:[n?(0,t.jsx)("desc",{id:l,children:n}):null,void 0===e?(0,t.jsx)("title",{id:r,children:"Current Location"}):e?(0,t.jsx)("title",{id:r,children:e}):null,(0,t.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"m7.885 8.115 1.593 3.983 3.186-8.763-8.762 3.186zM2.329 6.029l11-4a.5.5 0 0 1 .641.641l-4 11a.5.5 0 0 1-.462.33H9.5a.5.5 0 0 1-.464-.315l-1.92-4.8-4.801-1.921a.5.5 0 0 1 .014-.935m7.635 7.285",clipRule:"evenodd"})]})),i=r.default.forwardRef((e,r)=>(0,t.jsx)(n.BaseIcon,{ref:r,icon:l,...e}));i.displayName="CurrentLocation",e.s(["CurrentLocation",0,i])},75430,77323,e=>{"use strict";var t=e.i(546446),r=e.i(579310),n=e.i(528600),l=e.i(935807),i=e.i(335355),a=e.i(592121),o=e.i(919101),s=e.i(310847);function u(){let e=(0,t.useAtomValue)(r.userLocationsGetAtom),u=(0,t.useAtomValue)(i.userLocaleAtom),c=u?.slice(3)||"US",{user:d}=(0,n.useUser)(),f=d.isUserLoggedIn,h=(0,t.useAtomValue)(s.wxuUserRecentAddressesAtom);return(0,a.useMemo)(()=>({getLocationName:(t,r)=>(0,l.getLocationName)((0,o.getAddressForLocationData)(t,h),e,f,c,r),getLocationContext:(t,r)=>(0,l.getLocationContext)((0,o.getAddressForLocationData)(t,h),e,f,c,r),getLocationPresentationName:t=>(0,l.getLocationPresentationName)((0,o.getAddressForLocationData)(t,h),e,f,c)}),[e,f,c,h])}e.s(["usePresentationName",0,u],77323),e.s(["useBuildSearchItem",0,()=>{let{getLocationName:e,getLocationContext:r,getLocationPresentationName:n}=u(),l=(0,t.useAtomValue)(s.wxuUserRecentAddressesAtom);return{buildSearchItem:(0,a.useCallback)(t=>{let i=(0,o.getAddressForLocationData)(t,l);return{placeId:i.placeId,featureId:i.featureId,temperature:0,iconCode:44,geocode:`${i.latitude},${i.longitude}`,presentationName:n(i),name:e(i),nameContext:r(i),displayName:i.displayName,address:i.address,type:i.type}},[r,e,n,l])}}],75430)},879499,189816,929776,e=>{"use strict";let t;var r,n,l,i,a,o,s,u,c,d,f,h,p,g,m,v,b,x,y,w=e.i(592121),C=e.i(798973);function S(){for(var e=arguments.length,t=Array(e),r=0;re=>{t.forEach(t=>t(e))},t)}let D="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function I(e){let t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function R(e){return"nodeType"in e}function L(e){var t,r;return e?I(e)?e:R(e)&&null!=(t=null==(r=e.ownerDocument)?void 0:r.defaultView)?t:window:window}function j(e){let{Document:t}=L(e);return e instanceof t}function E(e){return!I(e)&&e instanceof L(e).HTMLElement}function N(e){return e instanceof L(e).SVGElement}function M(e){return e?I(e)?e.document:R(e)?j(e)?e:E(e)||N(e)?e.ownerDocument:document:document:document}let k=D?w.useLayoutEffect:w.useEffect;function T(e){let t=(0,w.useRef)(e);return k(()=>{t.current=e}),(0,w.useCallback)(function(){for(var e=arguments.length,r=Array(e),n=0;n{e.current=setInterval(t,r)},[]),(0,w.useCallback)(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}function B(e,t){void 0===t&&(t=[e]);let r=(0,w.useRef)(e);return k(()=>{r.current!==e&&(r.current=e)},t),r}function O(e,t){let r=(0,w.useRef)();return(0,w.useMemo)(()=>{let t=e(r.current);return r.current=t,t},[...t])}function P(e){let t=T(e),r=(0,w.useRef)(null),n=(0,w.useCallback)(e=>{e!==r.current&&(null==t||t(e,r.current)),r.current=e},[]);return[r,n]}function F(e){let t=(0,w.useRef)();return(0,w.useEffect)(()=>{t.current=e},[e]),t.current}let z={};function U(e,t){return(0,w.useMemo)(()=>{if(t)return t;let r=null==z[e]?0:z[e]+1;return z[e]=r,e+"-"+r},[e,t])}function K(e){return function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),l=1;l{for(let[n,l]of Object.entries(r)){let r=t[n];null!=r&&(t[n]=r+e*l)}return t},{...t})}}let W=K(1),_=K(-1);function H(e){if(!e)return!1;let{KeyboardEvent:t}=L(e.target);return t&&e instanceof t}function X(e){if(function(e){if(!e)return!1;let{TouchEvent:t}=L(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return"clientX"in e&&"clientY"in e?{x:e.clientX,y:e.clientY}:null}let Y=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Y.Translate.toString(e),Y.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),V="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function G(e){return e.matches(V)?e:e.querySelector(V)}e.s(["CSS",0,Y,"add",0,W,"canUseDOM",0,D,"findFirstFocusableNode",0,G,"getEventCoordinates",0,X,"getOwnerDocument",0,M,"getWindow",0,L,"isDocument",0,j,"isHTMLElement",0,E,"isKeyboardEvent",0,H,"isNode",0,R,"isSVGElement",0,N,"isWindow",0,I,"subtract",0,_,"useCombinedRefs",0,S,"useEvent",0,T,"useInterval",0,A,"useIsomorphicLayoutEffect",0,k,"useLatestValue",0,B,"useLazyMemo",0,O,"useNodeRef",0,P,"usePrevious",0,F,"useUniqueId",0,U],189816);let q={display:"none"};function J(e){let{id:t,value:r}=e;return w.default.createElement("div",{id:t,style:q},r)}function $(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;return w.default.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":n,"aria-atomic":!0},r)}let Q=(0,w.createContext)(null),Z={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},ee={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function et(e){var t;let r,{announcements:n=ee,container:l,hiddenTextDescribedById:i,screenReaderInstructions:a=Z}=e,{announce:o,announcement:s}=function(){let[e,t]=(0,w.useState)("");return{announce:(0,w.useCallback)(e=>{null!=e&&t(e)},[]),announcement:e}}(),u=U("DndLiveRegion"),[c,d]=(0,w.useState)(!1);if((0,w.useEffect)(()=>{d(!0)},[]),t=(0,w.useMemo)(()=>({onDragStart(e){let{active:t}=e;o(n.onDragStart({active:t}))},onDragMove(e){let{active:t,over:r}=e;n.onDragMove&&o(n.onDragMove({active:t,over:r}))},onDragOver(e){let{active:t,over:r}=e;o(n.onDragOver({active:t,over:r}))},onDragEnd(e){let{active:t,over:r}=e;o(n.onDragEnd({active:t,over:r}))},onDragCancel(e){let{active:t,over:r}=e;o(n.onDragCancel({active:t,over:r}))}}),[o,n]),r=(0,w.useContext)(Q),(0,w.useEffect)(()=>{if(!r)throw Error("useDndMonitor must be used within a children of ");return r(t)},[t,r]),!c)return null;let f=w.default.createElement(w.default.Fragment,null,w.default.createElement(J,{id:i,value:a.draggable}),w.default.createElement($,{id:u,announcement:s}));return l?(0,C.createPortal)(f,l):f}function er(){}(r=d||(d={})).DragStart="dragStart",r.DragMove="dragMove",r.DragEnd="dragEnd",r.DragCancel="dragCancel",r.DragOver="dragOver",r.RegisterDroppable="registerDroppable",r.SetDroppableDisabled="setDroppableDisabled",r.UnregisterDroppable="unregisterDroppable";let en=Object.freeze({x:0,y:0});function el(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ei(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function ea(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function eo(e){let{left:t,top:r,height:n,width:l}=e;return[{x:t,y:r},{x:t+l,y:r},{x:t,y:r+n},{x:t+l,y:r+n}]}function es(e,t){if(!e||0===e.length)return null;let[r]=e;return t?r[t]:r}function eu(e,t,r){return void 0===t&&(t=e.left),void 0===r&&(r=e.top),{x:t+.5*e.width,y:r+.5*e.height}}let ec=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e,l=eo(t),i=[];for(let e of n){let{id:t}=e,n=r.get(t);if(n){let r=eo(n),a=Number((l.reduce((e,t,n)=>e+el(r[n],t),0)/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:a}})}}return i.sort(ei)},ed=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e,l=[];for(let e of n){let{id:n}=e,i=r.get(n);if(i){let r=function(e,t){let r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),l=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height);if(n0&&l.push({id:n,data:{droppableContainer:e,value:r}})}}return l.sort(ea)};function ef(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:en}let eh=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n({...e,top:e.top+ +t.y,bottom:e.bottom+ +t.y,left:e.left+ +t.x,right:e.right+ +t.x}),{...e})},ep={ignoreTransform:!1};function eg(e,t){void 0===t&&(t=ep);let r=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:n}=L(e).getComputedStyle(e);t&&(r=function(e,t,r){let n=function(e){if(e.startsWith("matrix3d(")){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!n)return e;let{scaleX:l,scaleY:i,x:a,y:o}=n,s=e.left-a-(1-l)*parseFloat(r),u=e.top-o-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),c=l?e.width/l:e.width,d=i?e.height/i:e.height;return{width:c,height:d,top:u,right:s+c,bottom:u+d,left:s}}(r,t,n))}let{top:n,left:l,width:i,height:a,bottom:o,right:s}=r;return{top:n,left:l,width:i,height:a,bottom:o,right:s}}function em(e){return eg(e,{ignoreTransform:!0})}function ev(e,t){let r=[];return e?function n(l){var i,a;let o;if(null!=t&&r.length>=t||!l)return r;if(j(l)&&null!=l.scrollingElement&&!r.includes(l.scrollingElement))return r.push(l.scrollingElement),r;if(!E(l)||N(l)||r.includes(l))return r;let s=L(e).getComputedStyle(l);return(l!==e&&(void 0===(i=s)&&(i=L(l).getComputedStyle(l)),o=/(auto|scroll|overlay)/,["overflow","overflowX","overflowY"].some(e=>{let t=i[e];return"string"==typeof t&&o.test(t)}))&&r.push(l),void 0===(a=s)&&(a=L(l).getComputedStyle(l)),"fixed"===a.position)?r:n(l.parentNode)}(e):r}function eb(e){let[t]=ev(e,1);return null!=t?t:null}function ex(e){return D&&e?I(e)?e:R(e)?j(e)||e===M(e).scrollingElement?window:E(e)?e:null:null:null}function ey(e){return I(e)?e.scrollX:e.scrollLeft}function ew(e){return I(e)?e.scrollY:e.scrollTop}function eC(e){return{x:ey(e),y:ew(e)}}function eS(e){return!!D&&!!e&&e===document.scrollingElement}function eD(e){let t={x:0,y:0},r=eS(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},l=e.scrollTop=n.y,isRight:e.scrollLeft>=n.x,maxScroll:n,minScroll:t}}(n=f||(f={}))[n.Forward=1]="Forward",n[n.Backward=-1]="Backward";let eI={x:.2,y:.2};function eR(e){return e.reduce((e,t)=>W(e,eC(t)),en)}let eL=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+ey(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+ew(t),0)}]];class ej{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=ev(t),n=eR(r);for(const[t,l,i]of(this.rect={...e},this.width=e.width,this.height=e.height,eL))for(const e of l)Object.defineProperty(this,e,{get:()=>{let l=i(r),a=n[t]-l;return this.rect[e]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class eE{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,r){var n;null==(n=this.target)||n.addEventListener(e,t,r),this.listeners.push([e,t,r])}}function eN(e,t){let r=Math.abs(e.x),n=Math.abs(e.y);return"number"==typeof t?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t&&n>t.y}function eM(e){e.preventDefault()}function ek(e){e.stopPropagation()}(l=h||(h={})).Click="click",l.DragStart="dragstart",l.Keydown="keydown",l.ContextMenu="contextmenu",l.Resize="resize",l.SelectionChange="selectionchange",l.VisibilityChange="visibilitychange",(i=p||(p={})).Space="Space",i.Down="ArrowDown",i.Right="ArrowRight",i.Left="ArrowLeft",i.Up="ArrowUp",i.Esc="Escape",i.Enter="Enter",i.Tab="Tab";let eT={start:[p.Space,p.Enter],cancel:[p.Esc],end:[p.Space,p.Enter,p.Tab]},eA=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case p.Right:return{...r,x:r.x+25};case p.Left:return{...r,x:r.x-25};case p.Down:return{...r,y:r.y+25};case p.Up:return{...r,y:r.y-25}}};class eB{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new eE(M(t)),this.windowListeners=new eE(L(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(h.Resize,this.handleCancel),this.windowListeners.add(h.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(h.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,r=e.node.current;r&&function(e,t){if(void 0===t&&(t=eg),!e)return;let{top:r,left:n,bottom:l,right:i}=t(e);eb(e)&&(l=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(r),t(en)}handleKeyDown(e){if(H(e)){let{active:t,context:r,options:n}=this.props,{keyboardCodes:l=eT,coordinateGetter:i=eA,scrollBehavior:a="smooth"}=n,{code:o}=e;if(l.end.includes(o))return void this.handleEnd(e);if(l.cancel.includes(o))return void this.handleCancel(e);let{collisionRect:s}=r.current,u=s?{x:s.left,y:s.top}:en;this.referenceCoordinates||(this.referenceCoordinates=u);let c=i(e,{active:t,context:r.current,currentCoordinates:u});if(c){let t=_(c,u),n={x:0,y:0},{scrollableAncestors:l}=r.current;for(let r of l){let l=e.code,{isTop:i,isRight:o,isLeft:s,isBottom:u,maxScroll:d,minScroll:f}=eD(r),h=function(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:r,right:n,bottom:l}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:l,width:e.clientWidth,height:e.clientHeight}}(r),g={x:Math.min(l===p.Right?h.right-h.width/2:h.right,Math.max(l===p.Right?h.left:h.left+h.width/2,c.x)),y:Math.min(l===p.Down?h.bottom-h.height/2:h.bottom,Math.max(l===p.Down?h.top:h.top+h.height/2,c.y))},m=l===p.Right&&!o||l===p.Left&&!s,v=l===p.Down&&!u||l===p.Up&&!i;if(m&&g.x!==c.x){let e=r.scrollLeft+t.x,i=l===p.Right&&e=f.x;if(i&&!t.y)return void r.scrollTo({left:e,behavior:a});i?n.x=r.scrollLeft-e:n.x=l===p.Right?r.scrollLeft-d.x:r.scrollLeft-f.x,n.x&&r.scrollBy({left:-n.x,behavior:a});break}if(v&&g.y!==c.y){let e=r.scrollTop+t.y,i=l===p.Down&&e=f.y;if(i&&!t.x)return void r.scrollTo({top:e,behavior:a});i?n.y=r.scrollTop-e:n.y=l===p.Down?r.scrollTop-d.y:r.scrollTop-f.y,n.y&&r.scrollBy({top:-n.y,behavior:a});break}}this.handleMove(e,W(_(c,this.referenceCoordinates),n))}}}handleMove(e,t){let{onMove:r}=this.props;e.preventDefault(),r(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function eO(e){return!!(e&&"distance"in e)}function eP(e){return!!(e&&"delay"in e)}eB.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=eT,onActivation:l}=t,{active:i}=r,{code:a}=e.nativeEvent;if(n.start.includes(a)){let t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==l||l({event:e.nativeEvent}),!0)}return!1}}];class eF{constructor(e,t,r){var n;void 0===r&&(r=function(e){let{EventTarget:t}=L(e);return e instanceof t?e:M(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:l}=e,{target:i}=l;this.props=e,this.events=t,this.document=M(i),this.documentListeners=new eE(this.document),this.listeners=new eE(r),this.windowListeners=new eE(L(i)),this.initialCoordinates=null!=(n=X(l))?n:en,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(h.Resize,this.handleCancel),this.windowListeners.add(h.DragStart,eM),this.windowListeners.add(h.VisibilityChange,this.handleCancel),this.windowListeners.add(h.ContextMenu,eM),this.documentListeners.add(h.Keydown,this.handleKeydown),t){if(null!=r&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(eP(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(eO(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:r,onPending:n}=this.props;n(r,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(h.Click,ek,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(h.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;let{activated:r,initialCoordinates:n,props:l}=this,{onMove:i,options:{activationConstraint:a}}=l;if(!n)return;let o=null!=(t=X(e))?t:en,s=_(n,o);if(!r&&a){if(eO(a)){if(null!=a.tolerance&&eN(s,a.tolerance))return this.handleCancel();if(eN(s,a.distance))return this.handleStart()}return eP(a)&&eN(s,a.tolerance)?this.handleCancel():void this.handlePending(a,s)}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===p.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}let ez={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class eU extends eF{constructor(e){const{event:t}=e;super(e,ez,M(t.target))}}eU.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!!r.isPrimary&&0===r.button&&(null==n||n({event:r}),!0)}}];(a=g||(g={}))[a.RightClick=2]="RightClick";(o=m||(m={}))[o.Pointer=0]="Pointer",o[o.DraggableRect=1]="DraggableRect",(s=v||(v={}))[s.TreeOrder=0]="TreeOrder",s[s.ReversedTreeOrder=1]="ReversedTreeOrder";let eK={x:{[f.Backward]:!1,[f.Forward]:!1},y:{[f.Backward]:!1,[f.Forward]:!1}};(u=b||(b={}))[u.Always=0]="Always",u[u.BeforeDragging=1]="BeforeDragging",u[u.WhileDragging=2]="WhileDragging",(x||(x={})).Optimized="optimized";let eW=new Map;function e_(e,t){return O(r=>e?r||("function"==typeof t?t(e):e):null,[t,e])}function eH(e){let{callback:t,disabled:r}=e,n=T(t),l=(0,w.useMemo)(()=>{if(r||"u"()=>null==l?void 0:l.disconnect(),[l]),l}function eX(e){return new ej(eg(e),e)}function eY(e,t,r){void 0===t&&(t=eX);let[n,l]=(0,w.useState)(null);function i(){l(n=>{if(!e)return null;if(!1===e.isConnected){var l;return null!=(l=null!=n?n:r)?l:null}let i=t(e);return JSON.stringify(n)===JSON.stringify(i)?n:i})}let a=function(e){let{callback:t,disabled:r}=e,n=T(t),l=(0,w.useMemo)(()=>{if(r||"u"()=>null==l?void 0:l.disconnect(),[l]),l}({callback(t){if(e)for(let r of t){let{type:t,target:n}=r;if("childList"===t&&n instanceof HTMLElement&&n.contains(e)){i();break}}}}),o=eH({callback:i});return k(()=>{i(),e?(null==o||o.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==o||o.disconnect(),null==a||a.disconnect())},[e]),n}let eV=[];function eG(e,t){void 0===t&&(t=[]);let r=(0,w.useRef)(null);return(0,w.useEffect)(()=>{r.current=null},t),(0,w.useEffect)(()=>{let t=e!==en;t&&!r.current&&(r.current=e),!t&&r.current&&(r.current=null)},[e]),r.current?_(e,r.current):en}function eq(e){return(0,w.useMemo)(()=>{let t,r;return e?(t=e.innerWidth,{top:0,left:0,right:t,bottom:r=e.innerHeight,width:t,height:r}):null},[e])}let eJ=[],e$=[{sensor:eU,options:{}},{sensor:eB,options:{}}],eQ={current:{}},eZ={draggable:{measure:em},droppable:{measure:em,strategy:b.WhileDragging,frequency:x.Optimized},dragOverlay:{measure:eg}};class e0 extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,r;return null!=(t=null==(r=this.get(e))?void 0:r.node.current)?t:void 0}}let e1={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new e0,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:er},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:eZ,measureDroppableContainers:er,windowRect:null,measuringScheduled:!1},e5={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:er,draggableNodes:new Map,over:null,measureDroppableContainers:er},e2=(0,w.createContext)(e5),e3=(0,w.createContext)(e1);function e4(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new e0}}}function e7(e,t){switch(t.type){case d.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case d.DragMove:if(null==e.draggable.active)return e;return{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case d.DragEnd:case d.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case d.RegisterDroppable:{let{element:r}=t,{id:n}=r,l=new e0(e.droppable.containers);return l.set(n,r),{...e,droppable:{...e.droppable,containers:l}}}case d.SetDroppableDisabled:{let{id:r,key:n,disabled:l}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;let a=new e0(e.droppable.containers);return a.set(r,{...i,disabled:l}),{...e,droppable:{...e.droppable,containers:a}}}case d.UnregisterDroppable:{let{id:r,key:n}=t,l=e.droppable.containers.get(r);if(!l||n!==l.key)return e;let i=new e0(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function e6(e){let{disabled:t}=e,{active:r,activatorEvent:n,draggableNodes:l}=(0,w.useContext)(e2),i=F(n),a=F(null==r?void 0:r.id);return(0,w.useEffect)(()=>{if(!t&&!n&&i&&null!=a){if(!H(i)||document.activeElement===i.target)return;let e=l.get(a);if(!e)return;let{activatorNode:t,node:r}=e;(t.current||r.current)&&requestAnimationFrame(()=>{for(let e of[t.current,r.current]){if(!e)continue;let t=G(e);if(t){t.focus();break}}})}},[n,t,l,a,i]),null}let e8=(0,w.createContext)({...en,scaleX:1,scaleY:1});(c=y||(y={}))[c.Uninitialized=0]="Uninitialized",c[c.Initializing=1]="Initializing",c[c.Initialized=2]="Initialized";let e9=(0,w.memo)(function(e){var t,r,n,l,i,a,o,s;let u,c,h,p,g,x,S,I,{id:R,accessibility:j,autoScroll:N=!0,children:M,sensors:T=e$,collisionDetection:z=ed,measuring:K,modifiers:_,...H}=e,[Y,V]=(0,w.useReducer)(e7,void 0,e4),[G,q]=function(){let[e]=(0,w.useState)(()=>new Set),t=(0,w.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,w.useCallback)(t=>{let{type:r,event:n}=t;e.forEach(e=>{var t;return null==(t=e[r])?void 0:t.call(e,n)})},[e]),t]}(),[J,$]=(0,w.useState)(y.Uninitialized),Z=J===y.Initialized,{draggable:{active:ee,nodes:er,translate:el},droppable:{containers:ei}}=Y,ea=null!=ee?er.get(ee):null,eo=(0,w.useRef)({initial:null,translated:null}),eu=(0,w.useMemo)(()=>{var e;return null!=ee?{id:ee,data:null!=(e=null==ea?void 0:ea.data)?e:eQ,rect:eo}:null},[ee,ea]),ec=(0,w.useRef)(null),[ep,em]=(0,w.useState)(null),[ey,ew]=(0,w.useState)(null),eL=B(H,Object.values(H)),eE=U("DndDescribedBy",R),eN=(0,w.useMemo)(()=>ei.getEnabled(),[ei]),eM=(0,w.useMemo)(()=>({draggable:{...eZ.draggable,...null==K?void 0:K.draggable},droppable:{...eZ.droppable,...null==K?void 0:K.droppable},dragOverlay:{...eZ.dragOverlay,...null==K?void 0:K.dragOverlay}}),[null==K?void 0:K.draggable,null==K?void 0:K.droppable,null==K?void 0:K.dragOverlay]),{droppableRects:ek,measureDroppableContainers:eT,measuringScheduled:eA}=function(e,t){let{dragging:r,dependencies:n,config:l}=t,[i,a]=(0,w.useState)(null),{frequency:o,measure:s,strategy:u}=l,c=(0,w.useRef)(e),d=function(){switch(u){case b.Always:return!1;case b.BeforeDragging:return r;default:return!r}}(),f=B(d),h=(0,w.useCallback)(function(e){void 0===e&&(e=[]),f.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),p=(0,w.useRef)(null),g=O(t=>{if(d&&!r)return eW;if(!t||t===eW||c.current!==e||null!=i){let t=new Map;for(let r of e){if(!r)continue;if(i&&i.length>0&&!i.includes(r.id)&&r.rect.current){t.set(r.id,r.rect.current);continue}let e=r.node.current,n=e?new ej(s(e),e):null;r.rect.current=n,n&&t.set(r.id,n)}return t}return t},[e,i,r,d,s]);return(0,w.useEffect)(()=>{c.current=e},[e]),(0,w.useEffect)(()=>{d||h()},[r,d]),(0,w.useEffect)(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),(0,w.useEffect)(()=>{d||"number"!=typeof o||null!==p.current||(p.current=setTimeout(()=>{h(),p.current=null},o))},[o,d,h,...n]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:null!=i}}(eN,{dragging:Z,dependencies:[el.x,el.y],config:eM.droppable}),eB=O(e=>{var t;return null==ee?null:null!=(t=null!=g?g:e)?t:null},[g=(p=null!=ee?er.get(ee):void 0)?p.node.current:null,ee]),eO=(0,w.useMemo)(()=>ey?X(ey):null,[ey]),eP=(u=(null==ep?void 0:ep.autoScrollEnabled)===!1,c="object"==typeof N?!1===N.enabled:!1===N,h=Z&&!u&&!c,"object"==typeof N?{...N,enabled:h}:{enabled:h}),eF=e_(eB,eM.draggable.measure);!function(e){let{activeNode:t,measure:r,initialRect:n,config:l=!0}=e,i=(0,w.useRef)(!1),{x:a,y:o}="boolean"==typeof l?{x:l,y:l}:l;k(()=>{if(!a&&!o||!t){i.current=!1;return}if(i.current||!n)return;let e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;let l=ef(r(e),n);if(a||(l.x=0),o||(l.y=0),i.current=!0,Math.abs(l.x)>0||Math.abs(l.y)>0){let t=eb(e);t&&t.scrollBy({top:l.y,left:l.x})}},[t,a,o,n,r])}({activeNode:null!=ee?er.get(ee):null,config:eP.layoutShiftCompensation,initialRect:eF,measure:eM.draggable.measure});let ez=eY(eB,eM.draggable.measure,eF),eU=eY(eB?eB.parentElement:null),eX=(0,w.useRef)({activatorEvent:null,active:null,activeNode:eB,collisionRect:null,collisions:null,droppableRects:ek,draggableNodes:er,draggingNode:null,draggingNodeRect:null,droppableContainers:ei,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),e0=ei.getNodeFor(null==(t=eX.current.over)?void 0:t.id),e1=function(e){let{measure:t}=e,[r,n]=(0,w.useState)(null),l=eH({callback:(0,w.useCallback)(e=>{for(let{target:r}of e)if(E(r)){n(e=>{let n=t(r);return e?{...e,width:n.width,height:n.height}:n});break}},[t])}),[i,a]=P((0,w.useCallback)(e=>{let r=function(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return E(t)?t:e}(e);null==l||l.disconnect(),r&&(null==l||l.observe(r)),n(r?t(r):null)},[t,l]));return(0,w.useMemo)(()=>({nodeRef:i,rect:r,setRef:a}),[r,i,a])}({measure:eM.dragOverlay.measure}),e5=null!=(r=e1.nodeRef.current)?r:eB,e9=Z?null!=(n=e1.rect)?n:ez:null,te=!!(e1.nodeRef.current&&e1.rect),tt=(x=e_(i=te?null:ez),ef(i,x)),tr=eq(e5?L(e5):null),tn=(a=Z?null!=e0?e0:eB:null,S=(0,w.useRef)(a),I=O(e=>a?e&&e!==eV&&a&&S.current&&a.parentNode===S.current.parentNode?e:ev(a):eV,[a]),(0,w.useEffect)(()=>{S.current=a},[a]),I),tl=function(e,t){void 0===t&&(t=eg);let[r]=e,n=eq(r?L(r):null),[l,i]=(0,w.useState)(eJ);function a(){i(()=>e.length?e.map(e=>eS(e)?n:new ej(t(e),e)):eJ)}let o=eH({callback:a});return k(()=>{null==o||o.disconnect(),a(),e.forEach(e=>null==o?void 0:o.observe(e))},[e]),l}(tn),ti=function(e,t){let{transform:r,...n}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...n}),r):r}(_,{transform:{x:el.x-tt.x,y:el.y-tt.y,scaleX:1,scaleY:1},activatorEvent:ey,active:eu,activeNodeRect:ez,containerNodeRect:eU,draggingNodeRect:e9,over:eX.current.over,overlayNodeRect:e1.rect,scrollableAncestors:tn,scrollableAncestorRects:tl,windowRect:tr}),ta=eO?W(eO,el):null,to=function(e){let[t,r]=(0,w.useState)(null),n=(0,w.useRef)(e),l=(0,w.useCallback)(e=>{let t=ex(e.target);t&&r(e=>e?(e.set(t,eC(t)),new Map(e)):null)},[]);return(0,w.useEffect)(()=>{let t=n.current;if(e!==t){i(t);let a=e.map(e=>{let t=ex(e);return t?(t.addEventListener("scroll",l,{passive:!0}),[t,eC(t)]):null}).filter(e=>null!=e);r(a.length?new Map(a):null),n.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{let t=ex(e);null==t||t.removeEventListener("scroll",l)})}},[l,e]),(0,w.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>W(e,t),en):eR(e):en,[e,t])}(tn),ts=eG(to),tu=eG(to,[ez]),tc=W(ti,ts),td=e9?eh(e9,ti):null,tf=eu&&td?z({active:eu,collisionRect:td,droppableRects:ek,droppableContainers:eN,pointerCoordinates:ta}):null,th=es(tf,"id"),[tp,tg]=(0,w.useState)(null),tm=(o=te?ti:W(ti,tu),s=null!=(l=null==tp?void 0:tp.rect)?l:null,{...o,scaleX:s&&ez?s.width/ez.width:1,scaleY:s&&ez?s.height/ez.height:1}),tv=(0,w.useRef)(null),tb=(0,w.useCallback)((e,t)=>{let{sensor:r,options:n}=t;if(null==ec.current)return;let l=er.get(ec.current);if(!l)return;let i=e.nativeEvent,a=new r({active:ec.current,activeNode:l,event:i,options:n,context:eX,onAbort(e){if(!er.get(e))return;let{onDragAbort:t}=eL.current,r={id:e};null==t||t(r),G({type:"onDragAbort",event:r})},onPending(e,t,r,n){if(!er.get(e))return;let{onDragPending:l}=eL.current,i={id:e,constraint:t,initialCoordinates:r,offset:n};null==l||l(i),G({type:"onDragPending",event:i})},onStart(e){let t=ec.current;if(null==t)return;let r=er.get(t);if(!r)return;let{onDragStart:n}=eL.current,l={activatorEvent:i,active:{id:t,data:r.data,rect:eo}};(0,C.unstable_batchedUpdates)(()=>{null==n||n(l),$(y.Initializing),V({type:d.DragStart,initialCoordinates:e,active:t}),G({type:"onDragStart",event:l}),em(tv.current),ew(i)})},onMove(e){V({type:d.DragMove,coordinates:e})},onEnd:o(d.DragEnd),onCancel:o(d.DragCancel)});function o(e){return async function(){let{active:t,collisions:r,over:n,scrollAdjustedTranslate:l}=eX.current,a=null;if(t&&l){let{cancelDrop:o}=eL.current;a={activatorEvent:i,active:t,collisions:r,delta:l,over:n},e===d.DragEnd&&"function"==typeof o&&await Promise.resolve(o(a))&&(e=d.DragCancel)}ec.current=null,(0,C.unstable_batchedUpdates)(()=>{V({type:e}),$(y.Uninitialized),tg(null),em(null),ew(null),tv.current=null;let t=e===d.DragEnd?"onDragEnd":"onDragCancel";if(a){let e=eL.current[t];null==e||e(a),G({type:t,event:a})}})}}tv.current=a},[er]),tx=(0,w.useCallback)((e,t)=>(r,n)=>{let l=r.nativeEvent,i=er.get(n);null!==ec.current||!i||l.dndKit||l.defaultPrevented||!0===e(r,t.options,{active:i})&&(l.dndKit={capturedBy:t.sensor},ec.current=n,tb(r,t))},[er,tb]),ty=(0,w.useMemo)(()=>T.reduce((e,t)=>{let{sensor:r}=t;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:tx(e.handler,t)}))]},[]),[T,tx]);(0,w.useEffect)(()=>{if(!D)return;let e=T.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(let t of e)null==t||t()}},T.map(e=>{let{sensor:t}=e;return t})),k(()=>{ez&&J===y.Initializing&&$(y.Initialized)},[ez,J]),(0,w.useEffect)(()=>{let{onDragMove:e}=eL.current,{active:t,activatorEvent:r,collisions:n,over:l}=eX.current;if(!t||!r)return;let i={active:t,activatorEvent:r,collisions:n,delta:{x:tc.x,y:tc.y},over:l};(0,C.unstable_batchedUpdates)(()=>{null==e||e(i),G({type:"onDragMove",event:i})})},[tc.x,tc.y]),(0,w.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:r,droppableContainers:n,scrollAdjustedTranslate:l}=eX.current;if(!e||null==ec.current||!t||!l)return;let{onDragOver:i}=eL.current,a=n.get(th),o=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,s={active:e,activatorEvent:t,collisions:r,delta:{x:l.x,y:l.y},over:o};(0,C.unstable_batchedUpdates)(()=>{tg(o),null==i||i(s),G({type:"onDragOver",event:s})})},[th]),k(()=>{eX.current={activatorEvent:ey,active:eu,activeNode:eB,collisionRect:td,collisions:tf,droppableRects:ek,draggableNodes:er,draggingNode:e5,draggingNodeRect:e9,droppableContainers:ei,over:tp,scrollableAncestors:tn,scrollAdjustedTranslate:tc},eo.current={initial:e9,translated:td}},[eu,eB,tf,td,er,e5,e9,ek,ei,tp,tn,tc]),function(e){let{acceleration:t,activator:r=m.Pointer,canScroll:n,draggingRect:l,enabled:i,interval:a=5,order:o=v.TreeOrder,pointerCoordinates:s,scrollableAncestors:u,scrollableAncestorRects:c,delta:d,threshold:h}=e,p=function(e){let{delta:t,disabled:r}=e,n=F(t);return O(e=>{if(r||!n||!e)return eK;let l={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[f.Backward]:e.x[f.Backward]||-1===l.x,[f.Forward]:e.x[f.Forward]||1===l.x},y:{[f.Backward]:e.y[f.Backward]||-1===l.y,[f.Forward]:e.y[f.Forward]||1===l.y}}},[r,t,n])}({delta:d,disabled:!i}),[g,b]=A(),x=(0,w.useRef)({x:0,y:0}),y=(0,w.useRef)({x:0,y:0}),C=(0,w.useMemo)(()=>{switch(r){case m.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case m.DraggableRect:return l}},[r,l,s]),S=(0,w.useRef)(null),D=(0,w.useCallback)(()=>{let e=S.current;if(!e)return;let t=x.current.x*y.current.x,r=x.current.y*y.current.y;e.scrollBy(t,r)},[]),I=(0,w.useMemo)(()=>o===v.TreeOrder?[...u].reverse():u,[o,u]);(0,w.useEffect)(()=>{if(!i||!u.length||!C)return void b();for(let e of I){if((null==n?void 0:n(e))===!1)continue;let r=c[u.indexOf(e)];if(!r)continue;let{direction:l,speed:i}=function(e,t,r,n,l){let{top:i,left:a,right:o,bottom:s}=r;void 0===n&&(n=10),void 0===l&&(l=eI);let{isTop:u,isBottom:c,isLeft:d,isRight:h}=eD(e),p={x:0,y:0},g={x:0,y:0},m={height:t.height*l.y,width:t.width*l.x};return!u&&i=t.bottom-m.height&&(p.y=f.Forward,g.y=n*Math.abs((t.bottom-m.height-s)/m.height)),!h&&o>=t.right-m.width?(p.x=f.Forward,g.x=n*Math.abs((t.right-m.width-o)/m.width)):!d&&a0||i.y>0){b(),S.current=e,g(D,a),x.current=i,y.current=l;return}}x.current={x:0,y:0},y.current={x:0,y:0},b()},[t,D,n,b,i,a,JSON.stringify(C),JSON.stringify(p),g,u,I,c,JSON.stringify(h)])}({...eP,delta:el,draggingRect:td,pointerCoordinates:ta,scrollableAncestors:tn,scrollableAncestorRects:tl});let tw=(0,w.useMemo)(()=>({active:eu,activeNode:eB,activeNodeRect:ez,activatorEvent:ey,collisions:tf,containerNodeRect:eU,dragOverlay:e1,draggableNodes:er,droppableContainers:ei,droppableRects:ek,over:tp,measureDroppableContainers:eT,scrollableAncestors:tn,scrollableAncestorRects:tl,measuringConfiguration:eM,measuringScheduled:eA,windowRect:tr}),[eu,eB,ez,ey,tf,eU,e1,er,ei,ek,tp,eT,tn,tl,eM,eA,tr]),tC=(0,w.useMemo)(()=>({activatorEvent:ey,activators:ty,active:eu,activeNodeRect:ez,ariaDescribedById:{draggable:eE},dispatch:V,draggableNodes:er,over:tp,measureDroppableContainers:eT}),[ey,ty,eu,ez,V,eE,er,tp,eT]);return w.default.createElement(Q.Provider,{value:q},w.default.createElement(e2.Provider,{value:tC},w.default.createElement(e3.Provider,{value:tw},w.default.createElement(e8.Provider,{value:tm},M)),w.default.createElement(e6,{disabled:(null==j?void 0:j.restoreFocus)===!1})),w.default.createElement(et,{...j,hiddenTextDescribedById:eE}))}),te=(0,w.createContext)(null),tt="button";function tr(e){let{id:t,data:r,disabled:n=!1,attributes:l}=e,i=U("Draggable"),{activators:a,activatorEvent:o,active:s,activeNodeRect:u,ariaDescribedById:c,draggableNodes:d,over:f}=(0,w.useContext)(e2),{role:h=tt,roleDescription:p="draggable",tabIndex:g=0}=null!=l?l:{},m=(null==s?void 0:s.id)===t,v=(0,w.useContext)(m?e8:te),[b,x]=P(),[y,C]=P(),S=(0,w.useMemo)(()=>a.reduce((e,r)=>{let{eventName:n,handler:l}=r;return e[n]=e=>{l(e,t)},e},{}),[a,t]),D=B(r);return k(()=>(d.set(t,{id:t,key:i,node:b,activatorNode:y,data:D}),()=>{let e=d.get(t);e&&e.key===i&&d.delete(t)}),[d,t]),{active:s,activatorEvent:o,activeNodeRect:u,attributes:(0,w.useMemo)(()=>({role:h,tabIndex:g,"aria-disabled":n,"aria-pressed":!!m&&h===tt||void 0,"aria-roledescription":p,"aria-describedby":c.draggable}),[n,h,g,m,p,c.draggable]),isDragging:m,listeners:n?void 0:S,node:b,over:f,setNodeRef:x,setActivatorNodeRef:C,transform:v}}function tn(){return(0,w.useContext)(e3)}let tl={timeout:25};function ti(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:l}=e,i=U("Droppable"),{active:a,dispatch:o,over:s,measureDroppableContainers:u}=(0,w.useContext)(e2),c=(0,w.useRef)({disabled:r}),f=(0,w.useRef)(!1),h=(0,w.useRef)(null),p=(0,w.useRef)(null),{disabled:g,updateMeasurementsFor:m,timeout:v}={...tl,...l},b=B(null!=m?m:n),x=eH({callback:(0,w.useCallback)(()=>{if(!f.current){f.current=!0;return}null!=p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(b.current)?b.current:[b.current]),p.current=null},v)},[v]),disabled:g||!a}),[y,C]=P((0,w.useCallback)((e,t)=>{x&&(t&&(x.unobserve(t),f.current=!1),e&&x.observe(e))},[x])),S=B(t);return(0,w.useEffect)(()=>{x&&y.current&&(x.disconnect(),f.current=!1,x.observe(y.current))},[y,x]),(0,w.useEffect)(()=>(o({type:d.RegisterDroppable,element:{id:n,key:i,disabled:r,node:y,rect:h,data:S}}),()=>o({type:d.UnregisterDroppable,key:i,id:n})),[n]),(0,w.useEffect)(()=>{r!==c.current.disabled&&(o({type:d.SetDroppableDisabled,id:n,key:i,disabled:r}),c.current.disabled=r)},[n,i,r,o]),{active:a,rect:h,isOver:(null==s?void 0:s.id)===n,node:y,over:s,setNodeRef:C}}let ta={position:"fixed",touchAction:"none"},to=e=>H(e)?"transform 250ms ease":void 0;function ts(e,t,r){let n=e.slice();return n.splice(r=0}t={styles:{active:{opacity:"0"}}},e.s(["DndContext",0,e9,"KeyboardCode",0,p,"KeyboardSensor",0,eB,"PointerSensor",0,eU,"closestCenter",0,e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e,l=eu(t,t.left,t.top),i=[];for(let e of n){let{id:t}=e,n=r.get(t);if(n){let r=el(eu(n),l);i.push({id:t,data:{droppableContainer:e,value:r}})}}return i.sort(ei)},"closestCorners",0,ec,"getClientRect",0,eg,"getFirstCollision",0,es,"getScrollableAncestors",0,ev,"useDndContext",0,tn,"useDraggable",0,tr,"useDroppable",0,ti,"useSensor",0,function(e,t){return(0,w.useMemo)(()=>({sensor:e,options:null!=t?t:{}}),[e,t])},"useSensors",0,function(){for(var e=arguments.length,t=Array(e),r=0;r[...t].filter(e=>null!=e),[...t])}],879499);let tc=e=>{let{rects:t,activeIndex:r,overIndex:n,index:l}=e,i=ts(t,n,r),a=t[l],o=i[l];return o&&a?{x:o.left-a.left,y:o.top-a.top,scaleX:o.width/a.width,scaleY:o.height/a.height}:null},td={scaleX:1,scaleY:1},tf="Sortable",th=w.default.createContext({activeIndex:-1,containerId:tf,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:tc,disabled:{draggable:!1,droppable:!1}}),tp=e=>{let{id:t,items:r,activeIndex:n,overIndex:l}=e;return ts(r,n,l).indexOf(t)},tg=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:l,items:i,newIndex:a,previousItems:o,previousContainerId:s,transition:u}=e;return!!u&&!!n&&(o===i||l!==a)&&(!!r||a!==l&&t===s)},tm={duration:200,easing:"ease"},tv="transform",tb=Y.Transition.toString({property:tv,duration:0,easing:"linear"}),tx={roleDescription:"sortable"};function ty(e){if(!e)return!1;let t=e.data.current;return!!t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable}let tw=[p.Down,p.Right,p.Up,p.Left];function tC(e,t){return!!ty(e)&&!!ty(t)&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}e.s(["SortableContext",0,function(e){let{children:t,id:r,items:n,strategy:l=tc,disabled:i=!1}=e,{active:a,dragOverlay:o,droppableRects:s,over:u,measureDroppableContainers:c}=tn(),d=U(tf,r),f=null!==o.rect,h=(0,w.useMemo)(()=>n.map(e=>"object"==typeof e&&"id"in e?e.id:e),[n]),p=null!=a,g=a?h.indexOf(a.id):-1,m=u?h.indexOf(u.id):-1,v=(0,w.useRef)(h),b=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r{b&&p&&c(h)},[b,h,p,c]),(0,w.useEffect)(()=>{v.current=h},[h]);let C=(0,w.useMemo)(()=>({activeIndex:g,containerId:d,disabled:y,disableTransforms:x,items:h,overIndex:m,useDragOverlay:f,sortedRects:h.reduce((e,t,r)=>{let n=s.get(t);return n&&(e[r]=n),e},Array(h.length)),strategy:l}),[g,d,y.draggable,y.droppable,x,h,m,s,f,l]);return w.default.createElement(th.Provider,{value:C},t)},"arrayMove",0,ts,"sortableKeyboardCoordinates",0,(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:l,droppableContainers:i,over:a,scrollableAncestors:o}}=t;if(tw.includes(e.code)){if(e.preventDefault(),!r||!n)return;let t=[];i.getEnabled().forEach(r=>{if(!r||null!=r&&r.disabled)return;let i=l.get(r.id);if(i)switch(e.code){case p.Down:n.topi.top&&t.push(r);break;case p.Left:n.left>i.left&&t.push(r);break;case p.Right:n.left1&&(d=c[1].id),null!=d){let e=i.get(r.id),t=i.get(d),a=t?l.get(t.id):null,c=null==t?void 0:t.node.current;if(c&&a&&e&&t){var s,u;let r=ev(c).some((e,t)=>o[t]!==e),l=tC(e,t),i=(s=e,u=t,!!ty(s)&&!!ty(u)&&!!tC(s,u)&&s.data.current.sortable.index({sortable:{containerId:g,index:R,items:p},...s}),[g,s,R,p]),j=(0,w.useMemo)(()=>p.slice(p.indexOf(c)),[p,c]),{rect:E,node:N,isOver:M,setNodeRef:T}=ti({id:c,data:L,disabled:I.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...f}}),{active:A,activatorEvent:B,activeNodeRect:O,attributes:P,setNodeRef:F,listeners:z,isDragging:U,over:K,setActivatorNodeRef:W,transform:_}=tr({id:c,data:L,attributes:{...tx,...a},disabled:I.draggable}),X=S(T,F),V=!!A,G=V&&!b&&tu(m)&&tu(y),q=!C&&U,J=q&&G?_:null,$=G?null!=J?J:(null!=d?d:D)({rects:x,activeNodeRect:O,activeIndex:m,overIndex:y,index:R}):null,Q=tu(m)&&tu(y)?u({id:c,items:p,activeIndex:m,overIndex:y}):R,Z=null==A?void 0:A.id,ee=(0,w.useRef)({activeId:Z,items:p,newIndex:Q,containerId:g}),et=p!==ee.current.items,er=i({active:A,containerId:g,isDragging:U,isSorting:V,id:c,index:R,items:p,newIndex:ee.current.newIndex,previousItems:ee.current.items,previousContainerId:ee.current.containerId,transition:h,wasDragging:null!=ee.current.activeId}),en=function(e){let{disabled:t,index:r,node:n,rect:l}=e,[i,a]=(0,w.useState)(null),o=(0,w.useRef)(r);return k(()=>{if(!t&&r!==o.current&&n.current){let e=l.current;if(e){let t=eg(n.current,{ignoreTransform:!0}),r={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(r.x||r.y)&&a(r)}}r!==o.current&&(o.current=r)},[t,r,n,l]),(0,w.useEffect)(()=>{i&&a(null)},[i]),i}({disabled:!er,index:R,node:N,rect:E});return(0,w.useEffect)(()=>{V&&ee.current.newIndex!==Q&&(ee.current.newIndex=Q),g!==ee.current.containerId&&(ee.current.containerId=g),p!==ee.current.items&&(ee.current.items=p)},[V,Q,g,p]),(0,w.useEffect)(()=>{if(Z===ee.current.activeId)return;if(null!=Z&&null==ee.current.activeId){ee.current.activeId=Z;return}let e=setTimeout(()=>{ee.current.activeId=Z},50);return()=>clearTimeout(e)},[Z]),{active:A,activeIndex:m,attributes:P,data:L,rect:E,index:R,newIndex:Q,items:p,isOver:M,isSorting:V,isDragging:U,listeners:z,node:N,overIndex:y,over:K,setNodeRef:X,setActivatorNodeRef:W,setDroppableNodeRef:T,setDraggableNodeRef:F,transform:null!=en?en:$,transition:en||et&&ee.current.newIndex===R?tb:(!q||H(B))&&h&&(V||er)?Y.Transition.toString({...h,property:tv}):void 0}},"verticalListSortingStrategy",0,e=>{var t,r,n,l;let i,a,o,{activeIndex:s,activeNodeRect:u,index:c,rects:d,overIndex:f}=e,h=null!=(t=d[s])?t:u;if(!h)return null;if(c===s){let e=d[f];return e?{x:0,y:ss&&c=f?{x:0,y:h.height+p,...td}:{x:0,y:0,...td}}],929776)},143884,441667,544361,803586,e=>{"use strict";var t=e.i(699173),r=e.i(592121),n=e.i(929776),l=e.i(189816),i=e.i(925209),a=e.i(226602),o=e.i(683903),s=e.i(368847),u=e.i(632137),c=e.i(75430),d=e.i(747961);let f=(0,r.forwardRef)(({title:e,titleId:r,desc:n,descId:l,...i},a)=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",ref:a,"aria-labelledby":r,"aria-describedby":l,...i,children:[n?(0,t.jsx)("desc",{id:l,children:n}):null,void 0===e?(0,t.jsx)("title",{id:r,children:"Star"}):e?(0,t.jsx)("title",{id:r,children:e}):null,(0,t.jsx)("path",{fill:"currentColor",d:"m8 3.26 1.38 2.79.23.5.5.075 3.08.445L11 9.22l-.374.365.09.5.525 3.065-2.755-1.445L8 11.5l-.465.245L4.78 13.17l.5-3.065.09-.5L5 9.22 2.79 7.045 5.87 6.6l.5-.075.23-.5zM8 1 5.727 5.61.64 6.345l3.68 3.59L3.45 15 8 12.61 12.55 15l-.87-5.065 3.68-3.585-5.085-.74z"})]})),h=r.default.forwardRef((e,r)=>(0,t.jsx)(d.BaseIcon,{ref:r,icon:f,...e}));h.displayName="Star";let p=(0,r.forwardRef)(({title:e,titleId:r,desc:n,descId:l,...i},a)=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",ref:a,"aria-labelledby":r,"aria-describedby":l,...i,children:[n?(0,t.jsx)("desc",{id:l,children:n}):null,void 0===e?(0,t.jsx)("title",{id:r,children:"Star"}):e?(0,t.jsx)("title",{id:r,children:e}):null,(0,t.jsx)("path",{fill:"currentColor",d:"M8 1 5.727 5.61.64 6.345l3.68 3.59L3.45 15 8 12.61 12.55 15l-.87-5.065 3.68-3.585-5.085-.74z"})]})),g=r.default.forwardRef((e,r)=>(0,t.jsx)(d.BaseIcon,{ref:r,icon:p,...e}));function m({isFavorite:e,onClick:r}){let n=(0,o.useTranslations)("Header");return(0,t.jsxs)("div",{className:"group/favorite flex shrink-0 items-center",children:[(0,t.jsx)("span",{className:(0,u.cn)("w-0 overflow-hidden pl-2 text-xs text-nowrap capitalize opacity-0 transition-all group-hover/favorite:opacity-100",{"group-hover/favorite:w-22":!e,"group-hover/favorite:w-26.5":e}),children:n(e?"removeLocation":"saveLocation")}),(0,t.jsx)("button",{onClick:r,className:"flex cursor-pointer items-center justify-center p-1",children:e?(0,t.jsx)(g,{className:"size-6 text-[#fdc107]",title:n("removeLocation")}):(0,t.jsx)(h,{className:"size-6 text-inherit hover:text-[#fdc107]",title:"Favorite"})})]})}g.displayName="StarFilled";var v=e.i(316078),b=e.i(180193),x=e.i(546446),y=e.i(381477),w=e.i(889951),C=e.i(726249),S=e.i(674885),D=e.i(617874),I=e.i(942400);let R=e=>{let t=(0,x.useAtomValue)(S.userUnitPreferenceAtom),r=(0,D.unitsSystemByName)(t)?.code,n=(0,I.usePageLocale)(),l=e?(0,C.formatGeocode)(e):null,{data:i}=(0,y.default)(l?["currentObservations",l,r,n]:null,async([,e,t,r])=>(0,w.getCurrentObservations)({geocode:e,units:t,language:r}),{revalidateIfStale:!0,revalidateOnFocus:!0,dedupingInterval:3e5});return i};function L({search:e}){let r=R(e.geocode),n=r?.iconCode??e.iconCode,l=r?r.temperature:e.temperature;return(0,t.jsxs)("div",{className:"flex items-center gap-1","data-testid":"location-search-weather",children:[(0,t.jsx)("div",{className:"flex items-center justify-center text-gray-400",children:(0,t.jsx)(v.WxIcon,{iconCode:n,className:"lightBG h-5 w-5",iconTheme:"lightBG"})}),(0,t.jsx)("div",{className:"text-l min-w-9 text-inherit",children:(0,t.jsx)(b.Temperature,{value:l})})]})}e.s(["useLocationWeather",0,R],441667),e.s(["WeatherDisplay",0,L],544361);var j=e.i(586754),E=e.i(525936),N=e.i(671525),M=e.i(145651),k=e.i(249725),T=e.i(292980),A=e.i(310847);function B({placeId:e,locationData:n,featureId:l,onSelect:d,onToggleSave:f,onRemove:h,disabledFavorites:p,isFavorite:g,showWeather:v,attributes:b,isFocused:y,isSelected:w,isSortable:C,firstItemActionRef:S}){let D=(0,o.useTranslations)("Header"),R=(0,I.usePageLocale)(),{addRecentLocation:O}=(0,M.default)(),{recordFeatureId:P}=(0,k.useLocationFeatureIds)(),{recordDetails:F}=(0,T.useRecentLocationDetails)(),{navigate:z}=(0,N.default)(),U=n?.featureId??l,K=(0,j.useGetLocationById)(n?.nameContext?null:e,R),{isGeolocationLoading:W,resolvePath:_}=(0,E.default)(e,{defer:!0,featureId:U}),[H,X]=(0,r.useState)(!1),{buildSearchItem:Y}=(0,c.useBuildSearchItem)(),V=(0,r.useRef)(null),[,G]=(0,x.useAtom)(A.wxuUserRecentAddressesAtom),q=(0,r.useCallback)(e=>{"address"===e.type&&G(t=>{let r={address:e?.address?.split(",")[0]?.trim()||e.displayName,placeId:e?.placeId,type:e?.type},n=t?.filter(e=>e.placeId!==r.placeId)||[];return[r,...n].slice(0,5)})},[G]),J=(0,r.useMemo)(()=>n||(K?Y(K):null),[Y,K,n]);(0,r.useEffect)(()=>{let e=V.current;return y&&e?.focus(),()=>e?.blur()},[y]);let $=(0,r.useCallback)(async()=>{J&&(O(e),q(J),n&&(F(e,{name:n.name,nameContext:n.nameContext,geocode:n.geocode,featureId:n.featureId,type:n.type,presentationName:n.presentationName,displayName:n.displayName,address:n.address}),n.featureId&&P({placeId:e,geocode:n.geocode},n.featureId)),z(await _()),d?.())},[J,O,q,e,n,F,P,_,z,d]);(0,r.useEffect)(()=>{H&&!W&&J&&(X(!1),$())},[H,W,J,$]);let Q=(0,r.useCallback)(()=>{if(J){if(W)return void X(!0);$()}},[J,W,$]);return((0,r.useEffect)(()=>{if(S)return S.current=Q,()=>{S.current=null}},[S,Q]),J)?(0,t.jsxs)("div",{className:(0,u.cn)("group flex h-16 w-full flex-1 items-center rounded-2xl px-4 transition-colors","hover:bg-gray-100",(y||w)&&"bg-gray-100"),children:[(0,t.jsxs)("div",{role:"button",tabIndex:0,"aria-current":w?"true":void 0,...b,"data-testid":"location-search-result","data-selected":String(!!w),ref:V,className:(0,u.cn)("flex min-w-0 flex-1 shrink-1 cursor-pointer items-center gap-3 md:gap-4",y&&"outline-0",b?.className),onClick:Q,onKeyDown:e=>{b?.onKeyDown?.(e),("Enter"===e.key||" "===e.key)&&(" "!==e.key||!C)&&J&&(e.preventDefault(),Q())},children:[v?(0,t.jsx)(L,{search:J}):(0,t.jsx)(i.Location,{className:"size-4 shrink-0 text-current md:size-6","aria-hidden":"true",title:""}),(0,t.jsxs)("div",{className:"text-left",children:[(0,t.jsx)(s.default,{variant:"Body.M",className:(0,u.cn)("text-inherit",w&&"text-blue-500"),lineClamp:1,children:J.name}),(0,t.jsx)(s.default,{variant:"Body.S",color:"secondary",className:"pb-0",lineClamp:1,children:J.nameContext})]})]}),!p&&(0,t.jsx)(m,{isFavorite:g,onClick:()=>f?.(J)}),h&&(0,t.jsx)("button",{type:"button","aria-label":D("removeLocation"),"data-testid":"location-search-remove",onClick:t=>{t.stopPropagation(),h(e)},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&e.stopPropagation()},className:"flex shrink-0 cursor-pointer items-center justify-center rounded-full p-1 text-gray-400 transition-colors hover:text-gray-700 focus-visible:ring-2 focus-visible:ring-gray-400 focus-visible:ring-offset-2 focus-visible:outline-none",children:(0,t.jsx)(a.Close,{className:"size-5","aria-hidden":"true",title:""})})]}):null}e.s(["LocationItem",0,B],803586),e.s(["SortableFavoriteItem",0,function({location:e,onSelect:i,onToggleSave:a,isFocused:o=!1,isSelected:s=!1,firstItemActionRef:u}){let d=(0,I.usePageLocale)(),{buildSearchItem:f}=(0,c.useBuildSearchItem)(),h=(0,j.useGetLocationById)(e.placeID||null,d),p=(0,r.useMemo)(()=>h?f(h):null,[f,h]),{attributes:g,listeners:m,setNodeRef:v,transform:b,transition:x,isDragging:y}=(0,n.useSortable)({id:e.placeID||""}),w={transform:l.CSS.Transform.toString(b),transition:x};return p?(0,t.jsx)("div",{ref:v,style:w,className:y?"relative z-10 bg-gray-50 opacity-50 shadow-lg":void 0,children:(0,t.jsx)(B,{placeId:e.placeID,locationData:p,disabledFavorites:!1,onSelect:i,onToggleSave:a,showWeather:!0,isFavorite:!0,attributes:{...g,...m},isFocused:o,isSelected:s,firstItemActionRef:u,isSortable:!0})}):null}],143884)},24959,686557,e=>{"use strict";var t=e.i(699173),r=e.i(592121),n=e.i(683903),l=e.i(985542),i=e.i(381477),a=e.i(612977),o=e.i(75430),s=e.i(498076),u=e.i(935331),c=e.i(879499),d=e.i(929776),f=e.i(776169),h=e.i(343277),p=e.i(143884),g=e.i(803586),m=e.i(64412),v=e.i(262453),b=e.i(214008),x=e.i(352711),y=e.i(616448),w=e.i(526456),C=e.i(747961);let S=(0,r.forwardRef)(({title:e,titleId:r,desc:n,descId:l,...i},a)=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 12 12",ref:a,"aria-labelledby":r,"aria-describedby":l,...i,children:[n?(0,t.jsx)("desc",{id:l,children:n}):null,e?(0,t.jsx)("title",{id:r,children:e}):null,(0,t.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M6 4.125a1.875 1.875 0 1 1 0 3.75 1.875 1.875 0 0 1 0-3.75m0 .75a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25",clipRule:"evenodd"}),(0,t.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.375 1.893a4.125 4.125 0 0 1 3.732 3.732h1.143v.75h-1.143a4.124 4.124 0 0 1-3.732 3.732v1.143h-.75v-1.143a4.124 4.124 0 0 1-3.732-3.732H.75v-.75h1.143a4.125 4.125 0 0 1 3.732-3.732V.75h.75zM6 2.625a3.375 3.375 0 1 0 0 6.75 3.375 3.375 0 0 0 0-6.75",clipRule:"evenodd"})]})),D=r.default.forwardRef((e,r)=>(0,t.jsx)(C.BaseIcon,{ref:r,icon:S,...e}));D.displayName="Crosshair";var I=e.i(368847),R=e.i(632137),L=e.i(671525),j=e.i(145651),E=e.i(525936),N=e.i(544361);function M({onSelect:e,onImprovePrecision:l}){let i=(0,n.useTranslations)("Header"),{location:a}=(0,m.useLocation)("geolocation"),{location:o}=(0,m.useLocation)(),s=(0,v.usePreciseGeocode)(),u=(0,x.useImprovePrecisionFlow)({unavailableTitle:i("locationUnavailable"),unavailableBody:i("locationUnavailableHelp")}),{navigate:c}=(0,L.default)(),{addRecentLocation:d}=(0,j.default)(),f=a?.placeId,{isGeolocationLoading:h,resolvePath:p}=(0,E.default)(f??"",{defer:!0}),[g,C]=(0,r.useState)(!1),S=!s,k=(0,b.isSameLocation)(a,o),T=(0,r.useMemo)(()=>a?.placeId?{placeId:a.placeId,geocode:a.geocode,name:a.city||a.displayName,nameContext:a.adminDistrict,displayName:a.displayName,temperature:0,iconCode:44,address:"",type:a.type??""}:null,[a]),A=(0,r.useCallback)(async()=>{f&&(d(f),c(await p()),e())},[f,d,p,c,e]);(0,r.useEffect)(()=>{g&&!h&&f&&(C(!1),A())},[g,h,f,A]);let B=(0,r.useCallback)(()=>{if(f){if(h)return void C(!0);A()}},[f,h,A]),O=(0,r.useCallback)(e=>{e.target===e.currentTarget&&("Enter"===e.key||" "===e.key)&&(e.preventDefault(),B())},[B]),P=(0,r.useCallback)(e=>{e.stopPropagation(),l?.(),u()},[l,u]);return a?.placeId&&T?(0,t.jsx)("div",{className:(0,R.cn)("flex w-full flex-col gap-2 rounded-2xl p-4 transition-colors",k?"bg-gray-100":"hover:bg-gray-100"),"data-testid":"detected-location-row","data-selected":String(k),children:(0,t.jsxs)("div",{className:"flex items-center gap-3 md:gap-4",children:[(0,t.jsxs)("div",{role:"button",tabIndex:0,onClick:B,onKeyDown:O,"aria-label":T.name,"aria-current":k?"true":void 0,"data-testid":"detected-location-navigate",className:"flex min-w-0 flex-1 cursor-pointer items-center gap-3 text-left focus-visible:outline-none md:gap-4",children:[(0,t.jsx)(N.WeatherDisplay,{search:T}),(0,t.jsxs)("div",{className:"grow-1",children:[(0,t.jsx)(I.default,{variant:"Body.M.Bold",className:(0,R.cn)("pb-0 text-inherit",k&&"text-blue-500"),lineClamp:1,children:T.name}),(0,t.jsx)(I.default,{variant:"Body.S",color:"secondary",lineClamp:1,className:"pb-0",children:T.nameContext}),S&&(0,t.jsxs)("button",{type:"button",onClick:P,"data-testid":"improve-precision-cta",className:"mt-2 flex cursor-pointer items-center gap-1.5 self-start rounded-md text-xs font-medium text-gray-700 transition-colors hover:text-gray-900 hover:underline focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:outline-none",children:[(0,t.jsx)(D,{className:"size-3 shrink-0","aria-hidden":"true",title:""}),i("improvePrecision")]})]})]}),S?(0,t.jsx)("button",{type:"button",onClick:P,"aria-label":i("improvePrecision"),className:"flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-full bg-transparent transition-all duration-150 ease-in-out hover:bg-gray-200 active:bg-gray-300 active:duration-100",children:(0,t.jsx)(y.CurrentLocation,{className:"size-4 shrink-0 text-gray-500","aria-hidden":"true",title:""})}):(0,t.jsx)("span",{"data-testid":"detected-location-precise-indicator",className:"flex size-8 shrink-0 items-center justify-center",children:(0,t.jsx)(w.CurrentLocationFilled,{className:"size-4 shrink-0 text-gray-900","aria-hidden":"true",title:""})})]})}):null}var k=e.i(942400),T=e.i(611540),A=e.i(919101),B=e.i(546446),O=e.i(310847),P=e.i(249725),F=e.i(292980),z=e.i(77323),U=e.i(439766);function K({title:e,onClearAll:r,testId:l}){let i=(0,n.useTranslations)("Header");return(0,t.jsxs)("div",{className:"flex h-10 items-center justify-between px-4","data-testid":l,children:[(0,t.jsx)(I.default,{elementType:"h2",variant:"Body.S.Bold",children:e}),r&&(0,t.jsx)("button",{onClick:r,className:"cursor-pointer text-sm font-medium",children:i("clearEntries")})]})}function W({searches:e,searching:l,onSelectSearch:i,showFavorites:a=!0,recentLocations:o=[],favoriteLocations:s,isUserLoggedIn:u,firstItemActionRef:v,onClearRecentLocations:x,onRemoveRecentSearchLocation:y,focusedIndex:w=-1}){let C=(0,n.useTranslations)("Header"),{updatePreferences:S}=(0,f.usePreferences)(),{navigate:D}=(0,L.default)(),{addFavoriteLocation:R,deleteLocation:E}=(0,j.default)(),{resolveFeatureId:N,recordFeatureId:_}=(0,P.useLocationFeatureIds)(),{resolveDetails:H,recordDetails:X}=(0,F.useRecentLocationDetails)(),Y=(0,B.useAtomValue)(U.activeLocationAtom),V=(0,B.useSetAtom)(U.activeLocationAtom),{location:G}=(0,m.useLocation)(),{location:q}=(0,m.useLocation)("geolocation"),J=q?.placeId,{getLocationName:$}=(0,z.usePresentationName)(),Q=(0,k.usePageLocale)(),Z=(0,T.interpolateUrl)(T.URLS.memberSignup,{locale:Q}),[ee,et]=(0,B.useAtom)(O.wxuUserRecentAddressesAtom),er=(0,r.useMemo)(()=>u&&s?.map(e=>({...e,geocode:e.coordinate,placeId:e.placeID})).sort((e,t)=>(e.position||0)-(t.position||0))||[],[u,s]),en=(0,r.useMemo)(()=>o.filter(e=>!er.some(t=>t.placeID===e)),[o,er]),el=(0,c.useSensors)((0,c.useSensor)(c.PointerSensor,{activationConstraint:{distance:8}}),(0,c.useSensor)(c.KeyboardSensor,{coordinateGetter:d.sortableKeyboardCoordinates})),ei=e=>{let{active:t,over:r}=e;if(r&&t.id!==r.id){let e=er.findIndex(e=>e.placeID===t.id),n=er.findIndex(e=>e.placeID===r.id);S({locations:(0,d.arrayMove)([...er],e,n)})}},ea=async e=>{if(!u)return void D(Z);if(er.some(t=>t.placeID===e.placeId))E(e.placeId),Y?.placeId===e.placeId&&V(null);else{let t=e.geocode,r=e.name;if(!t)try{let n=e.featureId?await (0,h.getLocationPointByFeatureId)(e.featureId,"en-US"):e.placeId?await (0,h.getLocationPointByPlaceId)(e.placeId,"en-US"):null;if(n?.location){let e=(0,A.getAddressForLocationData)(n.location,ee);t=`${e.latitude},${e.longitude}`,r=$(e)}}catch(e){console.error("Failed to fetch location data for favoriting:",e)}if(t)R({placeID:e.placeId,coordinate:t,name:r,..."address"===e.type&&e.address?{streetAddress:e.address}:{}}),e.featureId&&(_({placeId:e.placeId,geocode:t},e.featureId),X(e.placeId,{name:r,nameContext:e.nameContext,geocode:t,featureId:e.featureId,type:e.type,presentationName:e.presentationName,displayName:e.displayName,address:e.address})),"address"===e.type&&"address"===e.type&&et(t=>{let r={address:e?.address?.split(",")[0]?.trim()||e.displayName,placeId:e?.placeId,type:e?.type},n=t?.filter(e=>e.placeId!==r.placeId)||[];return[r,...n].slice(0,5)});else console.debug("Unable to get geocode for location:",e.name||e.placeId)}};return(0,t.jsx)("div",{"data-testid":"location-search-results-dropdown",className:"overflow-x-hidden",children:l?(0,t.jsx)(I.default,{className:"p-6 text-center",children:C("loadingResults")}):a?J||0!==er.length||0!==o.length?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(K,{title:C("favoritesTitle"),testId:"location-search-favorites-header"}),(0,t.jsx)(M,{onSelect:i}),er.length>0&&(0,t.jsx)(c.DndContext,{sensors:el,collisionDetection:c.closestCenter,onDragEnd:ei,children:(0,t.jsx)(d.SortableContext,{items:er.map(e=>e.placeID||""),children:(0,t.jsx)("div",{"data-testid":"location-search-favorites-list",children:er.map((e,r)=>(0,t.jsx)(p.SortableFavoriteItem,{location:e,onToggleSave:ea,onSelect:i,isFocused:r===w,isSelected:(0,b.isSameLocation)({placeId:e.placeID,featureId:N({placeId:e.placeID})},G),firstItemActionRef:0===r?v:void 0},e.placeID))})})}),en.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(K,{title:C("recentLocationsTitle"),onClearAll:x,testId:"location-search-recent-header"}),(0,t.jsx)("div",{"data-testid":"location-search-recent-list",children:en.map((e,r)=>{let n=er.length+r,l=H(e),a=l?{placeId:e,featureId:l.featureId,geocode:l.geocode,presentationName:l.presentationName,name:l.name,nameContext:l.nameContext,displayName:l.displayName??l.name,type:l.type,address:l.address??""}:void 0;return(0,t.jsx)(g.LocationItem,{placeId:e,locationData:a,featureId:N({placeId:e}),onSelect:i,onToggleSave:ea,onRemove:y,isFocused:n===w,isSelected:(0,b.isSameLocation)({placeId:e,featureId:a?.featureId,geocode:a?.geocode},G),firstItemActionRef:0===n?v:void 0},e)})})]})]}):(0,t.jsx)("div",{className:"p-6 text-center text-gray-500","data-testid":"location-search-empty-message",children:C("noRecentLocations")}):0===e.length?(0,t.jsx)(I.default,{children:C("noResults")}):(0,t.jsx)("div",{"data-testid":"location-search-results-list",children:e.map((e,r)=>{let n=er.some(t=>t.placeID===e.placeId);return(0,t.jsx)(g.LocationItem,{placeId:e.placeId,locationData:e,onSelect:i,onToggleSave:ea,isFavorite:n,isFocused:r===w,firstItemActionRef:0===r?v:void 0},e.placeId)})})})}var _=e.i(274432),H=e.i(877957),X=e.i(523084);let Y=(0,r.forwardRef)(({title:e,titleId:r,desc:n,descId:l,...i},a)=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",ref:a,"aria-labelledby":r,"aria-describedby":l,...i,children:[n?(0,t.jsx)("desc",{id:l,children:n}):null,void 0===e?(0,t.jsx)("title",{id:r,children:"Close"}):e?(0,t.jsx)("title",{id:r,children:e}):null,(0,t.jsx)("path",{fill:"currentColor",d:"M8 1C4.1 1 1 4.1 1 8s3.1 7 7 7 7-3.1 7-7-3.1-7-7-7m2.7 10.5L8 8.8l-2.7 2.7-.8-.8L7.2 8 4.5 5.3l.8-.8L8 7.2l2.7-2.7.8.8L8.8 8l2.7 2.7z"})]})),V=r.default.forwardRef((e,r)=>(0,t.jsx)(C.BaseIcon,{ref:r,icon:Y,...e}));V.displayName="CloseFilled";var G=e.i(528600),q=e.i(909232),J=e.i(870393);let $=(0,r.memo)(({recentLocationsLength:e})=>{let r=(0,n.useTranslations)("Header"),{navigate:l}=(0,L.default)(),i=(0,k.usePageLocale)(),a=((0,q.useClientMobileMedia)(),(0,T.interpolateUrl)(T.URLS.memberSignup,{locale:i})),{user:{isUserLoggedIn:o}}=(0,G.useUser)();return o||e{l(a)},children:[(0,t.jsxs)("div",{className:"items-center justify-between",children:[(0,t.jsx)(I.Text,{variant:"Body.M.Bold",children:r(`upsellTitle${e>=4?"2":"1"}`)}),(0,t.jsx)(I.Text,{variant:"Body.S",children:r(`upsellSubtitle${e>=4?"2":"1"}`)})]}),(0,t.jsx)(J.ChevronRight,{className:"size-5"})]})});function Q({className:e,searchContainerRef:n,searchInputRef:l,searchQuery:i,placeholderText:a,searchOpen:o,isMobile:s,canSearch:c,showFavorites:d,searching:f,recentSearches:h,recentLocations:p,favoriteLocations:g,isUserLoggedIn:m=!1,setSearchQuery:v,onSearchOpen:b,onSelectSearch:x,onClearRecentLocations:y,onRemoveRecentSearchLocation:w}){let[C,S]=(0,r.useState)(-1),[D,I]=(0,r.useState)(!1),L=(0,r.useRef)(null),j=(0,r.useMemo)(()=>{if(!d)return h.length;let e=m&&g?.length||0,t=new Set(g?.map(e=>e.placeID));return e+(p?.filter(e=>!t.has(e)).length||0)},[d,h.length,m,g,p]);(0,r.useEffect)(()=>{S(-1)},[i,o,j]);let E=(0,r.useCallback)(e=>{o&&0!==j&&("ArrowDown"===e.key?(e.preventDefault(),S(e=>{if(-1===e)return 0;let t=e+1;return t>=j?j-1:t})):"ArrowUp"===e.key&&(e.preventDefault(),S(e=>{let t=e-1;return t{v(""),b(!1),S(-1)},[b,v]),M=(0,r.useCallback)(e=>{"Enter"===e.key&&o&&L.current?(e.preventDefault(),L.current()):"Escape"===e.key&&(e.stopPropagation(),N())},[o,N]);return((0,r.useEffect)(()=>{o&&!s&&l?.current?.focus()},[o,s,l]),(0,r.useEffect)(()=>{if(!o)return;let e=e=>{"ArrowDown"===e.key||"ArrowUp"===e.key?(I(!1),E(e)):"Tab"===e.key?I(!0):"Escape"===e.key&&N()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[o,E,N]),o)?(0,t.jsxs)("div",{ref:n,className:(0,R.cn)("z-110 w-full bg-white text-gray-800",s&&"fixed top-0 right-0 bottom-0 left-0 h-full overflow-auto",!s&&"rounded-3xl shadow-[0_4px_16px_0_rgba(0,0,0,0.10),0_0_32px_0_rgba(0,0,0,0.10)]",e),"data-testid":"header-search",children:[(0,t.jsxs)("div",{className:(0,R.cn)("flex w-full items-center gap-2",s?"p-3 pt-4":"p-2"),children:[s&&(0,t.jsx)(H.Button,{variant:"ghostUI",className:"m-0 p-1",onClick:()=>b(!1),"aria-label":"Close search",children:(0,t.jsx)(X.ChevronLeft,{className:"size-6"})}),(0,t.jsxs)("div",{className:"relative grow",children:[(0,t.jsx)(u.Input,{ref:l,value:i,placeholder:a,"data-testid":"location-search-input",onChange:e=>v(e.target.value),onKeyDown:M,className:(0,R.cn)("relative box-border h-12 rounded-3xl border-2 border-transparent bg-white! ps-9.5 pe-10 shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_0_32px_0_rgba(0,0,0,0.12)] transition-all placeholder:text-gray-900 placeholder:transition-all hover:border-blue-500 focus:placeholder:text-gray-400 focus-visible:border-blue-500")}),(0,t.jsx)(_.Search,{className:"pointer-events-none absolute start-4 top-1/2 flex size-4 -translate-y-1/2 transform items-center text-gray-900"}),(0,t.jsx)("button",{className:(0,R.cn)("absolute end-3.5 top-1/2 flex -translate-y-1/2 transform items-center opacity-0 transition-all",{"cursor-pointer opacity-100":!!i}),onClick:()=>v(""),disabled:!i,"aria-label":"Clear search",children:(0,t.jsx)(V,{className:"size-5 text-gray-900"})})]})]}),(c||d)&&(0,t.jsxs)("div",{className:(0,R.cn)("px-2 pb-2",s?"overflow-auto":"max-h-130 overflow-y-auto"),children:[(0,t.jsx)(W,{searches:h,searching:f,showFavorites:d,recentLocations:p,onClearAll:()=>v(""),favoriteLocations:g||[],isUserLoggedIn:m,firstItemActionRef:L,onSelectSearch:x,onClearRecentLocations:y,onRemoveRecentSearchLocation:w,focusedIndex:D?-1:C}),d&&(0,t.jsx)($,{recentLocationsLength:p?.length??0})]})]}):null}var Z=e.i(800462);e.s([],24959),e.s(["Search",0,function({locale:e,className:u,open:c,onOpenChange:d}){let[f,h]=(0,r.useState)(""),p=(0,a.useDebounce)(f,300),g=(0,s.useIsMobile)(),m=(0,r.useRef)(null),v=(0,r.useRef)(null),b=(0,n.useTranslations)("Header"),{recentLocations:x,favoriteLocations:y,clearRecentLocations:w,removeRecentLocation:C,removeRecentAddress:S}=(0,j.default)(),{user:D}=(0,G.useUser)(),{isUserLoggedIn:I}=D,R=(0,B.useSetAtom)(Z.fromSearchResultAtom),L=b("searchPlaceholderText"),E=p.length>=3,N=!p,{data:M,isLoading:k}=(0,i.default)(E?["locations",p,"city,locality,neighborhood,postal,airport,address",e]:null,([e,t,r,n])=>(0,l.getLocationsByQueryAndType)(t,r,n),{revalidateOnFocus:!1,dedupingInterval:2e3}),{buildSearchItem:T}=(0,o.useBuildSearchItem)(),A=(0,r.useMemo)(()=>M?M.map(e=>T(e)):[],[T,M]);(0,r.useEffect)(()=>(document.body.style.overflow=g&&c?"hidden":"",g&&c&&v.current?.focus(),()=>{document.body.style.overflow=""}),[g,c]),(0,r.useEffect)(()=>{c||h("")},[c]);let O=(0,r.useCallback)(e=>{C(e),S(e)},[C,S]),P=(0,r.useCallback)(()=>{d(!1),R(f)},[d,R,f]);return(0,t.jsx)(Q,{className:u,searchContainerRef:m,searchInputRef:v,searchQuery:f,placeholderText:L,searchOpen:c,isMobile:g,canSearch:E,showFavorites:N,searching:k,recentSearches:A,recentLocations:x,favoriteLocations:y,isUserLoggedIn:I,setSearchQuery:h,onSearchOpen:d,onSelectSearch:P,onClearRecentLocations:w,onRemoveRecentSearchLocation:O})}],686557)}]);