1import{r as o,R as Pt,t as qt,w as Wo,u as No}from"./chunk-BV7QT456-Mn6pmAAC.js";import{R as Do,j as r}from"./index-CXaKbOfb.js";import{d as jn,e as Fo,f as _o,g as Vo,h as Ho,i as un,j as vt,k as Uo,l as Go,m as Ko,n as Yo,o as Zo,p as pt,u as ft,q as On,r as ve,G as qo,s as Oe,b as Be,a as An,c as Xo,t as Jo,v as pn,w as Qo,x as es,M as ts,C as ns}from"./filterSearchParameterHelper-DXDTzfcQ.js";import{s as os,p as ss,C as as,T as fn,c as hn,u as is,a as rs,b as ls,S as zn,m as cs,$ as ds}from"./Stage-B2Zg6VuX.js";import{m as us,g as ps}from"./mergeReactRouterMeta-Cs89yq1R.js";import{aR as Ne,br as Xt,j as oe,i as x,b as h,O as wt,a as Y,F as dt,bO as fs,b4 as hs,ar as gs,av as me,bJ as ms,aS as ge,n as L,I as Bn,p as v,x as Ie,h as Ge,bP as Wn,bQ as bs,ab as qe,u as Ke,bt as Nn,bx as Jt,M as xs,m as ke,w as Ue,a$ as _t,r as kt,R as Dn,bv as Fn,aw as Pe,by as yt,as as Re,b5 as Tt,a3 as ht,bR as vs,bS as ws,bT as _n,be as ks,bU as ys,aY as $t,bV as Qt,bW as $s,bX as Et,bz as Vn,bY as Ss,a4 as Vt,ah as Ce,al as Ht,am as gn,an as mn,bZ as lt,b_ as Hn,af as gt,b$ as Cs,c0 as Un,a8 as Mt,c1 as Gn,c2 as Ls,bc as Kn,ac as et,aG as tt,aH as nt,bs as Is,bF as Rs,c3 as Ps,a9 as Ts,bu as en,bw as Yn,q,bC as De,c4 as Zn,aV as Qe,k as tn,bI as Es,c5 as jt,bH as qn,aK as Ms,X as He,c6 as js,f as nn,c7 as Os,l as As,Z as Ee,e as ut,b7 as zs,c8 as Xn,az as Jn,W as Bs,bD as Ws,c9 as Ns,ca as Qn,aB as eo,N as to,cb as Ds,bq as Fs,cc as _s,b6 as Vs,cd as Hs,ce as Us,b8 as Gs,ae as Ks,aC as Wt,cf as Ys,s as mt,S as no,G as oo,c as St,t as Ut,v as so,o as Gt,a5 as ao,K as Xe,H as Ot,B as Je,E as Kt,bL as ot,cg as io,ch as Zs,V as Yt,L as qs,y as Xs,bG as on,bB as ro,ci as lo,bA as bn,b3 as Js,cj as Qs,ck as ea,z as ct,ak as ta,cl as Nt,cm as na,g as oa}from"./PortfolioSection-CzeLtEw2.js";import{H as sa}from"./HandOff-CKeKsPVH.js";import{S as bt}from"./SectionSpacer-D8UR2ugj.js";import"./LinkGridTile-DaNWwWb3.js";const aa=(e,t)=>e?os:ss,ia=(e,t)=>{let n=0;return Array.isArray(t)?(t?.map(s=>{e.map(a=>{s&&a&&s?.value===a?.value&&n++})}),n===0?!1:n===e.length?!0:void 0):!1},ra=(e,t)=>{const n=t===void 0||t===""?[]:Array.isArray(t)?t:[t],s=i=>{if(typeof i!="string"&&i?.options)a[i?.value??i?.label??i]=ia(i?.options,t),i.options.map(s);else{const c=i;t&&n.find(l=>typeof l=="string"?l===i:l?.value===c?.value)?a[c?.value??i]=!0:a[c?.value??i]=!1}},a={};return e?.map(s),a};var We;(function(e){e.default="default",e.fullWidth="fullWidth"})(We||(We={}));var Ve;(function(e){e.group="group",e.option="option"})(Ve||(Ve={}));const la=(e,t,n=["label"])=>{e=e.toLowerCase();let s=null;return t.find((a,i)=>{const c=n.filter(l=>a[l].toLowerCase().startsWith(e));return s=c.length>0?i:s,c.length>0}),s},it=o.memo(o.forwardRef(({id:e,children:t,value:n,index:s,disabled:a=!1,selected:i,renderOption:c,isGroupOption:l=!1,isGroupLabel:d=!1,isMultiple:p=!1,internal:u=!1,onClick:m,hasNoOptions:g=!1,isFakeFocused:f=!1,spacingVariant:b=We.default,...k},y)=>{const $=Ne("options-list",e),{isKeyboardControlled:A}=Xt(),P=o.useCallback(R=>{R.stopPropagation(),m?.(n)},[m,n]);n&&(a=n?.disabled===!0);const T=p&&u,S=T?oe(dt,{children:[x(as,{checked:i,disabled:a,indeterminate:i===void 0,"aria-hidden":!0,tabIndex:-1,nativeReadOnly:!0,...a||d&&!p?{}:{onClick:P}}),x(Y,{orientation:wt.horizontal,spacing:h.medium})]}):i!==!1&&!d||i!==!1&&d&&p?oe(dt,{children:[x(Y,{orientation:wt.horizontal,spacing:h.small}),x(da,{pairedWithText:!1,icon:i===void 0?hs:gs,size:fs.small,isInternal:u})]}):x(Y,{orientation:wt.horizontal,spacing:me(28/16)});return ms(ca,{...d?{}:ge({disabled:n?.disabled===!0,selected:i,role:"option"}),...k,"data-type":d?"group-label":l?"group-option":"option","data-focus-child":f?"true":void 0,id:$,key:$,ref:y,disabled:a,selected:i||!1,isGroupOption:l,isGroupLabel:d,isMultiple:p,isInternal:u,isKeyboardControlled:A,hasNoOptions:g,isFakeFocused:f,spacingVariant:b,...a||d&&!p?{}:{onClick:P}},T&&S,t,c?c(n,s):n,!T&&S)}));it.displayName="OptionsListOption";const ca=L.button(({theme:e,disabled:t,selected:n,isGroupOption:s,isGroupLabel:a,isMultiple:i,isInternal:c,hasNoOptions:l,spacingVariant:d,isKeyboardControlled:p,isFakeFocused:u})=>{const m=h.small,g={mobile:` 2 ${m} ${h.large} 3 `,tablet:d===We.fullWidth&&` 4 ${m} ${h.medium} 5 `};return v(v` 6 background-color: ${e.optionsList.backgroundColor}; 7 border: none; 8 width: 100%; 9 text-align: start; 10 display: flex; 11 flex-grow: 1; 12 flex-direction: row; 13 align-items: center; 14 justify-content: space-between; 15 position: relative; 16 min-height: ${h.xxLarge}; 17 -webkit-tap-highlight-color: ${e.optionsList.states.hover.backgroundColor}; 18 `,c&&i&&v` 19 justify-content: flex-start; 20 `,!t&&v` 21 cursor: pointer; 22 color: ${e.optionsList.states.enabled.labelColor}; 23 24 ${p&&v` 25 &:focus, 26 &:focus-visible { 27 color: ${e.optionsList.states.active.labelColor}; 28 } 29 `} 30 31 ${p&&u&&v` 32 color: ${e.optionsList.states.active.labelColor}; 33 `} 34 35 @media (hover: hover) { 36 &:hover { 37 color: ${e.optionsList.states.hover.labelColor}; 38 box-shadow: none; 39 background-color: ${e.optionsList.states.hover.backgroundColor}; 40 } 41 } 42 `,a&&v` 43 color: ${e.optionsList.states.enabled.groupLabelColor}; 44 ${Ie({padding:g})};
45 `,a&&s&&!i&&v` 46 &:hover { 47 cursor: default; 48 background-color: transparent; 49 } 50 `,!a&&s&&v` 51 ${Ie({paddingBlockStart:{mobile:m},paddingBlockEnd:{mobile:m},paddingInlineStart:{mobile:me(36/16),tablet:d===We.fullWidth&&me(28/16)},paddingInlineEnd:{mobile:h.large,tablet:d===We.fullWidth&&h.medium}})}; 52 `,!a&&!s&&v` 53 ${Ie({padding:g})} 54 `,a&&!i&&n||a&&!i&&v` 55 cursor: default; 56 `,n&&v` 57 color: ${e.optionsList.states.active.labelColor}; 58 `,t&&v` 59 color: ${e.optionsList.states.disabled.labelColor}; 60 user-select: none; 61 `,l&&v` 62 color: ${e.optionsList.states.noOptions.labelColor}; 63 user-select: none; 64 `)}),da=L(Bn)(({isInternal:e,theme:t})=>e&&v` 65 border-radius: 50%; 66 padding: ${h.xxSmall}; 67 width: ${h.large}; 68 height: ${h.large}; 69 background-color: ${t.optionsList.internalCheckmarkBackground}; 70 color: ${t.optionsList.internalCheckmarkColor}; 71 `),co=o.forwardRef(({value:e,options:t,whitelistedOptionLabels:n,noOptionsText:s="",renderOption:a,selectedIndex:i=0,onKeyUp:c,onChange:l,withBorder:d=!0,multiple:p=!1,internal:u=!1,flatOptions:m=[],fakeFocusIndex:g,spacingVariant:f=We.default,focusParentProps:b,preventFocusScroll:k=!1,...y},$)=>{m.length===0&&(m=t.slice(0));const[A,P]=o.useState(""),T=Ne("options-list",y.id),S=o.useRef(null),R=Ge($,S),{createFocusProps:O,setFocusIndexAndFocus:I}=Wn({ref:S,initialFocusIndex:k||i<0?0:i});o.useEffect(()=>{if(g!==void 0&&g>=0){const w=setTimeout(()=>{const j=document.getElementById(`${T}-${g}`);j&&j.scrollIntoView?.({block:"nearest",inline:"nearest"})},0);return()=>clearTimeout(w)}},[g,T]),o.useEffect(()=>{const w=setTimeout(()=>{A&&P("")},1e3);return()=>clearTimeout(w)},[A]);const B=o.useCallback(w=>{switch(c?.(w),w.key){case" ":case"Enter":case"Tab":case"Shift":case"Esc":case"Backspace":P("");break;default:const j=`${A}${w.key}`;if(P(j),!t.length)return;let U;typeof t[0]=="string"?U=t.findIndex(E=>E.toLowerCase().startsWith(j?.toLowerCase())):U=la(j,m,n),U!==null&&I(U);break}},[c,I,m,A,t,n]),Z=o.useCallback(w=>{l?.(w)},[l]);let M=-1,X=null;const ae=ra(t,e),Q=t?.some(w=>w.type===Ve.group),xe=bs();return u&&!xe&&(console.warn('OptionsList: you are trying to use a property ("internal") that can only be set with internal projects.'),u=!1),x(ua,{...ge({multiselectable:p||void 0}),...y,ref:R,withBorder:d,role:"listbox",hasGroupedItems:Q,multiple:p,onKeyUp:B,children:t&&t.length>0?t.map(w=>{if(w.type===Ve.group){const j=X===Ve.option;X=Ve.group;const U=ae[w?.value??w?.label??w],E=p?++M:-1,ee=w.options.map(ne=>{M++;const z=ae[ne?.value??ne?.label??ne];return x(it,{id:`${T}-${M}`,selected:z,value:ne,index:M,isGroupOption:!0,isMultiple:p,onClick:Z,renderOption:a,isFakeFocused:M===g,...M===g?b:void 0,spacingVariant:f,internal:u,...O(M,{forceTabIndex:M===g,fakeFocus:g!==void 0}),...qe({spacing:-4})},`options-list-option-${M}`)}),D=p?O(E,{forceTabIndex:E===g,fakeFocus:g!==void 0}):{tabIndex:-1};return oe(o.Fragment,{children:[j&&M>1&&x(fa,{...ge({hidden:!0})}),oe(pa,{...ge({labelledby:`${T}-${E}-${M}`}),withBorder:d,children:[x(it,{id:`${T}-${E}-${M}`,value:w,selected:U,index:E,isGroupOption:!0,isGroupLabel:!0,isMultiple:p,onClick:Z,renderOption:a,spacingVariant:f,internal:u,isFakeFocused:E===g,...E===g?b:void 0,...D,...qe({spacing:-4})},`options-list-option-${E}`),ee]})]},`option-group-${M}`)}else{M++;const j=ae[w?.value??w?.label??w];X=Ve.option;const U=O(M,{forceTabIndex:M===g,fakeFocus:g!==void 0}),E=x(it,{id:`${T}-${M}`,selected:j,value:w,index:M,isGroupOption:!1,isMultiple:p,onClick:Z,renderOption:a,isFakeFocused:M===g,...M===g?b:void 0,spacingVariant:f,internal:u,...U,...qe({spacing:-4})},`options-list-option-${M}-${M===g}`);return x(o.Fragment,{children:E},`option-${M}-${M===g}`)}}):x(it,{id:`${T}-errormessage`,index:0,disabled:!0,selected:!1,hasNoOptions:!0,spacingVariant:f,internal:u,...ge({role:"alert",live:"assertive"}),children:s})})});co.displayName="OptionsList";const xn=o.memo(co),ua=L.div(({withBorder:e,theme:t,hasGroupedItems:n,multiple:s})=>v` 72 height: 100%; 73 max-height: ${e?"40vh":"100%"}; 74 background-color: ${t.optionsList.backgroundColor}; 75 border: ${e?`1px solid ${t.optionsList.borderColor}`:"none"}; 76 overflow: auto; 77 overflow-x: hidden; 78 -webkit-overflow-scrolling: touch; 79 overscroll-behavior: contain; 80 width: 100%; 81 82 ${Ie({padding:{mobile:"0 0",tablet:n&&s?void 0:`${h.xxSmall} 0`}})} 83 `),pa=L.div(({withBorder:e})=>v([v` 84 margin: 0; 85 padding: 0; 86 `,!e&&v` 87 &:first-of-type { 88 padding-block-start: 0; 89 } 90 `])),fa=L.div(({theme:e})=>v` 91 display: flex; 92 position: relative; 93 width: 100%; 94 95 &:after { 96 content: ''; 97 width: 100%; 98 height: 1px; 99 background: ${e.optionsList.borderColor}; 100 ${Ie({margin:{mobile:`0 ${h.large}`,tablet:0}})} 101 } 102 `),uo=o.forwardRef(({children:e,label:t,onBack:n,input:s,visible:a=!0,ariaBackButtonLabel:i,...c},l)=>{const d=o.useRef(null),p=Ge(d,l),u=Ke()?.name==="mobile";return o.useEffect(()=>{u&&a&&(window.scrollTo(0,0),setTimeout(()=>window.scrollTo(0,0),100))},[u,a]),Nn({ref:d,open:a,applyInputFix:a&&!!s,closeHandler:o.useCallback(()=>{},[]),skipInert:!0,skipAriaHidden:!0}),oe(Fn,{children:[!u&&x(Jt,{visible:a}),oe(po,{...c,ref:p,visible:a,...a?{}:ge({hidden:!0}),"data-type":"selection-overlay-wrapper",children:[oe(ga,{children:[x(Dn,{mainAxisAlignment:xs.spaceBetween,children:x(ha,{...ge({label:i||""}),icon:kt,onClick:n,variant:_t.transparent,size:Ue.large,alignmentOffset:ke.left})}),t&&x(ba,{children:t}),s&&x(xa,{children:s})]}),x(ma,{"data-type":"selection-overlay",children:e})]})]})});uo.displayName="SelectionOverlay";const po=L("div",Pe(!0,"visible"))(({theme:e,visible:t=!0})=>v` 103 background-color: ${e.selectionOverlay.backgroundColor}; 104 overflow: hidden; 105 position: fixed; 106 display: flex; 107 flex-direction: column; 108 inset-block-start: 0; 109 inset-inline-start: 0; 110 width: 100%; 111 height: 100%; 112 overscroll-behavior: contain; 113 z-index: ${yt.modal+1}; 114 ${!t&&v` 115 visibility: hidden; 116 pointer-events: none; 117 `} 118 `);po.displayName="Container";const ha=L(Tt)(({theme:e})=>v` 119 color: ${e.selectionOverlay.backButtonColor}; 120 `),ga=L(Re)` 121 width: 100%; 122 padding: ${h.small} ${h.large} 0 ${h.large}; 123`,ma=L(Re)` 124 flex: 1; 125 overflow-y: auto; 126`,ba=L(ht)(({theme:e})=>v` 127 padding: ${h.xLarge} 0 ${h.xSmall} 0; 128 border-block-end: 1px solid ${e.selectionOverlay.labelBorderColor}; 129 `),xa=L(ht)` 130 padding-block-start: ${me(20/16)}; 131 padding-block-end: ${h.xSmall}; 132`,va=(e,t)=>{vs(()=>{t?.(e)},[e])};var vn;(function(e){e.contains="contains",e.startsWith="startsWith"})(vn||(vn={}));const wa=e=>{const t=[];return e?.forEach(n=>
132{typeof n!="string"&&n.type===Ve.group&&n.options?t.push(...n.options):t.push(n)}),t},ka=e=>typeof e=="string"?e:e.label||e.value,ya=e=>e,$a=e=>`${e} item${e>1?"s":""}`,Sa=200,Ca=180,La=5e3,Ia=2,Ra=500,fo=o.forwardRef(({value:e="",disabled:t,required:n,requiredText:s,readOnly:a,ariaReadOnlyLabel:i,options:c,name:l,noOptionsText:d,renderOption:p=ka,getOptionLabel:u=ya,onSelect:m,onChange:g,minimumQueryLength:f=1,onClick:b,onFocus:k,onBlur:y,onKeyDown:$,onPopoverToggled:A,ariaClearLabel:P,ariaBackButtonLabel:T,highlightFirst:S=!0,openOnFocus:R=!1,ariaResultsMessage:O=$a,ariaNoResultsMessage:I,...B},Z)=>{const M=Ne("autocomplete-field",B.id),X=`${M}-popover`,ae=`${M}-mobile`,Q=o.useRef(null),xe=Ge(Z,Q),w=o.useRef(null),j=o.useRef(null),U=o.useRef(null),E=o.useRef(null),ee=o.useRef(null),D=o.useRef(""),ne=o.useRef(!1),z=o.useRef(!1),G=()=>{U.current&&(clearTimeout(U.current),U.current=null)},_=()=>{E.current&&(clearTimeout(E.current),E.current=null)},[N,F]=o.useState(-1),[H,ie]=o.useState(!1),[ue,ye]=o.useState(!1),[pe,Le]=o.useState(!1),[Te,fe]=o.useState(""),de=Ke()?.name==="mobile",C=o.useMemo(()=>wa(c),[c]),{forceRender:W}=ws(),{isKeyboardControlled:J,setInteractionMode:se}=Xt(),{focusParentProps:le,focusProps:$e}=_n({id:B.id,spacing:-4});o.useEffect(()=>{let K=null;return H?K=setTimeout(()=>Le(!0),Sa):Le(!1),()=>{K&&clearTimeout(K),G(),_()}},[H]);const Ae=c?.length||0;o.useEffect(()=>{Ae&&H&&W()},[Ae,H,W]);const Ye=N!==-1;o.useEffect(()=>{W()},[Ye,W]),o.useEffect(()=>{if(H&&N>=0){const K=setTimeout(()=>W(),0);return()=>clearTimeout(K)}},[N,H,W]),o.useEffect(()=>{ue&&!H&&ye(!1)},[ue,H]),o.useEffect(()=>{if(de&&H){const K=requestAnimationFrame(()=>{w.current?.focus()});return()=>cancelAnimationFrame(K)}},[de,H]);const Fe=o.useCallback(()=>{J||w?.current?.blur()},[J]),Me=o.useCallback(()=>{ye(!0)},[]),_e=o.useCallback(K=>{g&&K!==e&&g(u(K),l,K),m?.(K,l),F(-1),ie(!1),Q?.current?.focus()},[m,g,e,l,u]),V=o.useCallback(K=>{a||(R&&ie(!0),b?.(K))},[R,b,a]),re=o.useCallback(()=>{if(ne.current){ne.current=!1,k?.(l);return}(e.length>=f||de||R)&&!J&&ie(!0),k?.(l)},[e,l,de,k,f,R,J]),{focusBlurEvents:te}=ks({name:l,fakeFocus:H,onFocus:re,onBlur:y});va(H,A);const he=o.useCallback(()=>{ie(!1),de?ee.current=Date.now():Q?.current?.focus()},[de]),be=o.useCallback(K=>{if(J||se(ys.keyboard),!a){switch(K.key){case"ArrowDown":case"ArrowUp":{if(K.stopPropagation(),$t(K),!H)ie(!0),S&&K.key==="ArrowDown"&&F(0);else{const zt=K.key==="ArrowUp"?-1:1,Bt=(N===-1&&K.key!=="ArrowDown"?0:N)+zt,Ze=Math.min(C.length-1,Math.max(Bt,0));F(Ze)}break}case"Escape":Q?.current?.focus(),ie(!1),F(-1),fe("");break;case"Enter":N>-1&&C[N]?_e(C[N]):ie(!1);break;case"Tab":H&&$t(K),!de&&ie(!1);break}$?.(K)}},[J,a,$,se,H,N,C,de,S,_e]),we=o.useCallback((K,zt)=>{if(z.current||a)return;g?.(K,zt);const dn=D.current,Bt=K.length<dn.length;if(G(),fe(""),D.current=K,de){if(_(),ee.current!==null&&Date.now()-ee.current<La&&K.length<Ia)return;K.length>=f&&!H&&(E.current=setTimeout(()=>{ie(!0),ee.current=null,E.current=null},Ca))}else F(-1),K.length>=f&&setTimeout(()=>ie(!0),0);K.length>=f&&!Bt&&(U.current=setTimeout(()=>{if(D.current===K)try{const Ze=c.length;Ze>0?fe(O(Ze,K)):I&&fe(I(K))}catch(Ze){console.warn("AutocompleteField: Error filtering options",Ze),I&&fe(I(K))}U.current=null},Ra))},[g,a,de,f,H,c,I,O]),ce=o.useCallback(()=>{z.current=!1,we(""),de||Q?.current?.focus()},[we,de]),At=o.useCallback(()=>{ne.current=!0},[]),rn=o.useCallback(()=>{z.current=!0},[]),ln=o.useCallback(K=>{z.current=!1,we(K.currentTarget.value,l)},[we,l]),Oo=e.length>0?x($s,{onClick:ce,onMouseDown:At,disabled:t||a,icon:Qt,...ge({label:P})}):null,cn=B.trailing||Oo,Ao=N===-1,[zo,Bo]=Et();return Vn(j,de&&!t&&H,{index:1}),oe(dt,{children:[x(Jt,{onClose:he,allowScroll:!0,visible:H,withBackground:!1,zIndexBaseValue:yt.formModal}),oe(Pa,{...te,children:[x(fn,{...ge({autocomplete:"list",expanded:pe,describedby:c?.length===0?`${M}-popover-errormessage`:B?.hint||B?.error?`${M}-message`:void 0,role:"combobox",owns:H&&c?.length>0?X:void 0,controls:H&&c?.length>0?X:void 0,activedescendant:H&&N!==null&&N>=0&&c?.length>0?`${X}-${N}`:void 0}),autoComplete:"off",...B,...Ye?$e:{},"data-focus-skip":Ye?!H&&N===-1:!1,"data-focus-skip-parent":de&&H?"[data-type=selection-overlay]":void 0,id:M,name:l,ref:xe,value:e,onClick:V,onChange:we,onCompositionStart:rn,onCompositionEnd:ln,disabled:t,required:n,requiredText:s,readOnly:a,ariaReadOnlyLabel:i,type:"text",onKeyDown:be,trailing:cn,fieldProps:{innerRef:zo,style:H?{zIndex:yt.formModal,position:"relative"}:{},popoverOpen:N>=0}}),x(Ta,{"aria-live":"polite","data-testid":"autocomplete-announcements",id:`${M}-announcements`,children:Te}),!de&&!t&&H&&!a&&x(Ss,{attachTo:Bo,offset:{top:h.xSmall,bottom:h.xSmall},backdropProps:{visible:!1},onPlacementChange:Me,children:x(xn,{id:X,...ge({labelledby:B?.label?`${M}-label`:void 0}),options:c,fakeFocusIndex:ue?N:-1,focusParentProps:le,value:e,onCh
132ange:_e,noOptionsText:d,renderOption:p,spacingVariant:We.fullWidth})},c.length),de&&!t&&!a&&x(uo,{ref:j,visible:H,onBack:he,ariaBackButtonLabel:T,input:x(fn,{id:ae,...ge({labelledby:B?.label?`${M}-label`:void 0,describedby:c?.length===0?`${M}-popover-errormessage`:B?.hint||B?.error?`${M}-message`:void 0}),ref:w,value:e,onChange:we,onCompositionStart:rn,onCompositionEnd:ln,autoComplete:"off",type:"text",onKeyDown:be,...Ao?{}:$e,"data-focus-skip-parent":H?"[data-type=selection-overlay]":void 0,"data-focus-spacing":-4,trailing:cn,fieldProps:{popoverOpen:N>=0}}),...ge({role:"dialog",modal:!0}),children:x(xn,{id:X,...ge({labelledby:!!B?.label&&`${M}-label`}),options:c,fakeFocusIndex:N,focusParentProps:le,value:e,onChange:_e,noOptionsText:d,renderOption:p,withBorder:!1,onScroll:Fe,spacingVariant:We.fullWidth})})]})]})});fo.displayName="AutocompleteField";const Pa=L.div` 133 position: relative; 134`,Ta=L.div` 135 position: absolute !important; 136 height: 1px; 137 width: 1px; 138 overflow: hidden; 139 clip: rect(1px, 1px, 1px, 1px); 140 white-space: nowrap; 141 border: 0; 142 padding: 0; 143 margin: 0; 144`;var Ct;(function(e){e.background="background",e.border="border"})(Ct||(Ct={}));const ho=o.forwardRef(({variant:e=Ct.background,size:t=Ue.medium,emphasis:n=Vt.low,label:s,...a},i)=>x(Ea,{variant:e,emphasis:n,size:t,...a,ref:i,children:s}));ho.displayName="Badge";const Ea=L.div(({theme:e,size:t,variant:n,emphasis:s})=>v` 145 color: ${e.badge.variant[n].emphasis[s].textColor}; 146 background-color: ${e.badge.variant[n].emphasis[s].backgroundColor}; 147 box-shadow: inset 0 0 0 ${Ce(1)} 148 ${e.badge.variant[n].emphasis[s].borderColor}; 149 150 ${t===Ue.medium?v` 151 padding: ${me(7/16)} ${me(12/16)}; 152 font-size: ${Ht(16/16)}; 153 line-height: ${gn(18/16)}; 154 letter-spacing: ${mn(-.3/16)}; 155 `:v` 156 padding: ${me(5/16)} ${me(8/16)}; 157 font-size: ${Ht(12/16)}; 158 line-height: ${gn(14/16)}; 159 letter-spacing: ${mn(-.1/16)}; 160 `}; 161 `),go=Pt.createContext({id:"gallery-x",inGallery:!1,index:lt(0),internalIndex:lt(0),isInView:lt(!1),setIndex:e=>null}),Ma=()=>o.useContext(go),ja=o.createContext({threshold:0}),mo=({onEnter:e,onLeave:t,placeholder:n,children:s,scrollRef:a,offset:i="0px 0px 0px 0px",threshold:c=0,alwaysRenderChildren:l=!1,triggerOnce:d=!1})=>{const[p,u]=Hn({motionValue:!0,triggerOnce:d,root:a?.current,rootMargin:i,threshold:c}),[m,g]=o.useState(l),f=gt(!1),b=Cs(),k=o.useRef(null),y=o.useRef(null);return o.useEffect(()=>{const $=()=>{p.current&&y.current&&k.current&&(p.current.style.height=`${y.current.offsetTop-k.current.offsetTop}px`)};return $(),window.addEventListener("resize",$,Un?{passive:!0}:!1),()=>{window.removeEventListener("resize",$)}},[p,m]),o.useEffect(()=>u.on("change",$=>{f.set($),$?(g(!0),e?.()):t?.()}),[u,e,t,f]),oe(ja.Provider,{value:{threshold:c,inView:f},children:[x(wn,{ref:k,children:x("div",{ref:p,style:{width:1,opacity:0}})}),m?s:!b&&(n??null),b&&x("noscript",{children:s}),x(wn,{ref:y})]})};mo.displayName="InView";const bo=e=>x(mo,{...e,alwaysRenderChildren:!0}),wn=L.div` 162 height: 0 !important; 163 width: 0 !important; 164 pointer-events: none; 165 flex-grow: 0; 166`;var Lt;(function(e){e.enter="cw-motion-enter",e.exit="cw-motion-exit",e.visible="cw-motion-visible"})(Lt||(Lt={}));const xo=o.forwardRef(({selected:e=!1,children:t,showCloseIcon:n=!1,...s},a)=>{const i=Mt();return x(Oa,{ref:a,type:"button",...ge({disabled:s.disabled}),...s,selected:e,...qe({themeType:i}),children:oe(za,{children:[x(Ba,{children:t}),n&&x(Aa,{icon:Qt,topOffset:!1})]})})});xo.displayName="Chip";const Oa=L.button(({theme:e,selected:t,onClick:n,disabled:s})=>v(v` 167 display: inline-block; 168 cursor: pointer; 169 position: relative; 170 padding: 0 ${h.medium}; 171 min-height: ${Ce(40)}; 172 color: ${e.chip.states.enabled.color}; 173 width: auto; 174 background-color: ${e.chip.states.enabled.backgroundColor}; 175 transition: 176 ${et("background-color",nt.default,tt.fast)}, 177 ${et("color",nt.default,tt.fast)}, 178 ${et("border-color",nt.default,tt.fast)}, 179 ${et("box-shadow",nt.default,tt.fast)}, 180 ${et("opacity",nt.default,tt.fast)}; 181 user-select: none; 182 touch-action: manipulation; 183 -webkit-tap-highlight-color: transparent; 184 185 span[aria-hidden='true'] { 186 color: ${e.chip.states.enabled.color}; 187 } 188 `,Kn,n===void 0&&v` 189 pointer-events: none; 190 `,!t&&v` 191 box-shadow: none; 192 border: ${Ce(1)} solid ${e.chip.states.enabled.borderColor}; 193 194 @media (hover: hover) { 195 &:hover { 196 color: ${e.chip.states.hover.color}; 197 background-color: ${e.chip.states.hover.backgroundColor}; 198 box-shadow: none; 199 border: ${e.chip.states.hover.borderColor?`${Ce(1)} solid ${e.chip.states.hover.borderColor}`:"0"}; 200 201 span[aria-hidden='true'] { 202 color: ${e.chip.states.hover.color}; 203 } 204 } 205 } 206 207 &:active { 208 color: ${e.chip.states.selected.color}; 209 background-color: ${e.chip.states.selected.backgroundColor}; 210 box-shadow: none; 211 border: ${e.chip.states.hover.borderColor?`${Ce(1)} solid ${e.chip.states.selected.borderColor}`:"0"}; 212 213 span[aria-hidden='true'] { 214 color: ${e.chip.states.selected.color}; 215 } 216 } 217 `,!s&&t&&v` 218 color: ${e.chip.states.selected.color}; 219 background-color: ${e.chip.states.selected.backgroundColor}; 220 border: ${e.chip.states.selected.borderColor?`${Ce(1)} solid ${e.chip.states.selected.borderColor}`:"0"}; 221 box-shadow: none; 222 223 span[aria-hidden='true'] { 224 color: ${e.chip.states.selected.color}; 225 } 226 227 @media (hover: hover) { 228 &:hover { 229 color: ${e.chip.states.selectedHover.color}; 230 background-color: ${e.chip.states.selectedHover.backgroundColor}; 231 border: ${e.chip.states.selectedHover.borderColor?`${Ce(1)} solid ${e.chip.states.selectedHover.borderColor}`:"0"}; 232 box-shadow: none; 233 234 span[aria-hidden='true'] { 235 color: ${e.chip.states.selectedHover.color}; 236 } 237 } 238 } 239 `,s&&v` 240 pointer-events: none; 241 color: ${e.chip.states.disabled.color}; 242 box-shadow: none; 243 background-color: ${e.chip.states.disabled.backgroundColor}; 244 border: ${e.chip.states.disabled.borderColor?`${Ce(1)} solid ${e.chip.states.disabled.borderColor}`:"0"}; 245 246 span[aria-hidden='true'] { 247 color: ${e.chip.states.disabled.color}; 248 } 249 `)),Aa=L(Bn)(({theme:e})=>v` 250 color: ${e.chip.states.enabled.color}; 251 margin-inline-start: ${me(6/16)}; 252 253 ${Ls}; 254 `),za=L.div` 255 display: flex; 256 flex-direction: row; 257 justify-content: center; 258 align-items: center; 259 max-width: 100%; 260`,Ba=L.span` 261 white-space: nowrap; 262 ${Gn} 263`,vo=o.forwardRef(({children:e,height:t,width:n,withCloseButton:s=!1,isCloseButtonSticky:a=!1,autoFocus:i=!0,closeButtonProps:c,backdropProps:l,detached:d=!0,fullscreen:p=!1,alignment:u=ke.center,open:m=!1,onClose:g,header:f,headerMedia:b,footer
263:k,...y},$)=>{Zn&&(i=!1);const A=o.useRef(null),P=o.useRef(null),T=Ge(A,$);Is(m,{scrollIntoView:!1}),Rs(A,d&&m),Vn(A,d&&m&&i,{index:s&&f?1:0}),d&&!g&&console.warn(`Dialog: no "onClose" provided, this means that the closebutton or backdrop don't close the dialog`);const[S,R]=Et(),O=o.useCallback(()=>{g?.()},[g]);Nn({ref:A,open:m,closeHandler:O});const I=s?x(Wa,{...c,isCloseButtonSticky:a,onClick:O,hasHeaderImage:!!b}):null;b&&f&&(console.warn("Dialog: do not use header and headerMedia at the same time, headerMedia is leading so make a choice."),f=null);const B=x(Ts,{children:oe(Na,{ref:T,width:n,height:t,fullscreen:p,...y,role:"dialog","aria-modal":!0,children:[!!f&&oe(Ha,{children:[f," ",I]}),x(Da,{ref:S,limitWidth:!p&&!n,hasHeader:!!f,isCloseButtonSticky:a,children:oe(Ps.Provider,{value:{scrollElement:R},children:[!f&&a&&I,b&&x(Ga,{children:b}),e,!f&&!a&&I]})}),!!k&&x(Ua,{children:k})]})});return d?oe(Fn,{children:[x(Jt,{visible:m,onClose:O,...l}),x(Yn,{children:m&&x(Va,{ref:P,alignment:u,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:en.default,children:B},"dialog")})]}):B});vo.displayName="Dialog";const Wa=({hasHeaderImage:e=!1,isCloseButtonSticky:t=!1,...n})=>x(Fa,{isCloseButtonSticky:t,children:x(_a,{icon:Qt,...n,isCloseButtonSticky:t,size:e?Ue.medium:Ue.large,variant:e?_t.white:_t.transparent,hasHeaderImage:e})}),Na=L.div(({theme:e,width:t="auto",height:n="auto",fullscreen:s=!1})=>v(v` 264 width: ${s?"100%":t}; 265 height: ${s?"100%":n}; 266 max-width: 100%; 267 268 flex-shrink: 0; 269 display: flex; 270 flex-direction: column; 271 background-color: ${e.dialog.backgroundColor}; 272 273 max-height: calc(100vh - ${h.small}); 274 275 ${q.tablet} { 276 max-height: calc(100vh - ${h.large}); 277 } 278 ${q.desktop} { 279 max-height: calc(100vh - ${h.xLarge}); 280 } 281 ${q.desktopWide} { 282 max-height: calc(100vh - ${h.xxxLarge}); 283 } 284 `)),Da=L("div",Pe(!1,"isCloseButtonSticky","limitWidth","hasHeader"))(({limitWidth:e,hasHeader:t,isCloseButtonSticky:n})=>v` 285 flex: 1; 286 max-width: ${e?"864px":"none"}; 287 overflow: auto; 288 overflow-x: hidden; 289 overscroll-behavior: contain; 290 position: relative; 291 292 ${n?Ie({padding:{mobile:`0 ${h.medium} ${h.large}`,tablet:`0 ${h.xLarge} ${h.large}`}}):Ie({padding:{mobile:`${t?h.medium:h.xxxxLarge} ${h.medium} ${h.large}`,tablet:`${t?h.medium:h.xxxxLarge} ${h.xLarge} ${h.large}`}})}; 293 `),Fa=L("div",Pe(!1,"isCloseButtonSticky"))(({isCloseButtonSticky:e,theme:t})=>v(e&&v(v` 294 position: sticky; 295 inset-block-start: 0; 296 z-index: 1; 297 height: ${h.xxxxLarge}; 298 background-color: ${t.dialog.backgroundColor}; 299 `))),_a=L(Tt,Pe(!1,"isCloseButtonSticky","hasHeaderImage"))(({isCloseButtonSticky:e,hasHeaderImage:t})=>v(v` 300 position: absolute; 301 inset-block-start: ${t?h.medium:h.medium}; 302 `,!e&&Ie({insetInlineEnd:{mobile:h.xSmall,tablet:h.medium}}),e&&Ie({insetInlineEnd:{mobile:`-${h.xSmall}`,tablet:`-${h.medium}`}}))),Va=L(De.div)(({alignment:e})=>v(v` 303 position: fixed; 304 display: flex; 305 justify-content: center; 306 align-items: center; 307 z-index: ${yt.modal}; 308 align-self: center; 309 inset-block-start: 0; 310 inset-inline-end: 0; 311 inset-block-end: 0; 312 inset-inline-start: 0; 313 pointer-events: none; 314 315 > * { 316 pointer-events: auto; 317 } 318 319 ${Ie({margin:{mobile:h.small,tablet:h.large,desktop:h.xLarge},height:{mobile:`calc(100% - ${h.small})`,tablet:`calc(100% - ${h.large})`,desktop:`calc(100% - ${h.xLarge})`}})} 320 `,e===ke.top&&v` 321 align-items: flex-start; 322 `,e===ke.bottom&&v` 323 align-items: flex-end; 324 `,e===ke.left&&v` 325 justify-content: flex-start; 326 `,e===ke.right&&v` 327 justify-content: flex-end; 328 `)),Ha=L.div` 329 position: relative; 330`,Ua=L.div` 331 position: relative; 332`,Ga=L.div` 333 margin: -${h.xxxxLarge} -${h.xLarge} ${h.xLarge} -${h.xLarge}; 334`,wo=o.forwardRef(({activeIndex:e,captions:t,hideIndicator:n,length:s,...a},i)=>{const{isRTL:c}=Qe(),l=("00"+(e+1)).slice(-2),d=("00"+s).slice(-2),u=t.filter(Boolean).length>0;return oe(Xa,{ref:i,...a,children:[s>1&&!n&&x(Ya,{hasCaptions:u,children:c?`${d}/${l}`:`${l}/${d}
334`}),u&&x(Ka,{children:t.map((m,g)=>{const f=g===e;return!!m&&x(Za,{active:f,"aria-hidden":!f,children:x(qa,{children:m})},g)})})]})});wo.displayName="GalleryCaption";const Ka=L.div` 335 display: grid; 336 337 > * { 338 grid-area: 1 / 1; 339 } 340`,Ya=L(tn)(({hasCaptions:e,theme:t})=>v` 341 width: ${h.xxLarge}; 342 min-width: ${h.xLarge}; 343 font-variant-numeric: tabular-nums; 344 flex-shrink: 0; 345 color: ${e?t.gallery.captions.countColor:t.gallery.captions.captionColor}; 346 `),Za=L.div(({active:e})=>e?v` 347 visibility: visible; 348 pointer-events: auto; 349 user-select: text; 350 `:v` 351 visibility: hidden; 352 pointer-events: none; 353 user-select: none; 354 `),qa=L(Es)(({theme:e})=>v` 355 color: ${e.gallery.captions.captionColor}; 356 `),Xa=L.div` 357 position: relative; 358 display: flex; 359 gap: ${h.xxSmall}; 360 width: 100%; 361 padding-block-start: ${h.small}; 362`;var It;(function(e){e.image="image",e.video="video"})(It||(It={}));var kn;(function(e){e.default="default",e.highContrast="highContrast",e.none="none"})(kn||(kn={}));var yn;(function(e){e.squaresInside="squaresInside",e.numbersOutside="numbersOutside",e.none="none"})(yn||(yn={}));var $n;(function(e){e.sideBySide="sidebyside",e.slideOnTop="slideontop",e.parallaxWipe="parallaxwipe"})($n||($n={}));Lt.visible+"",jt.normal;var Sn;(function(e){e[e.forward=1]="forward",e[e.backward=-1]="backward"})(Sn||(Sn={}));const sn=({clampedIndex:e,length:t,captions:n,hideIndicator:s,...a})=>{const[i,c]=o.useState(0),[l,d]=o.useState(1);o.useEffect(()=>{d(0)},[]),o.useEffect(()=>e.on("change",u=>{c(u)}),[e]);const p=qn({...en.default});return x(dt,{children:(n.length>0||!s)&&x(Yn,{children:x(Ja,{children:x(Qa,{initial:{opacity:l},animate:{opacity:1,transition:{delay:jt.fast}},exit:{opacity:0},transition:p,...a,children:x(wo,{captions:n,length:t,activeIndex:i,hideIndicator:s})},i)},"indicator-motion-wrapper")})})};sn.displayName="TextIndicator";const Ja=L.div` 363 position: relative; 364 width: 100%; 365 min-height: ${me(34/16)}; 366`,Qa=L(Ms.div)` 367 position: relative; 368 display: flex; 369 width: 100%; 370`,ei=({length:e,clampedIndex:t,internalIndex:n,memoizedId:s,imageCarousel:a=!1,...i})=>{const c=o.useRef(null),l=o.useRef(null),[d,p]=o.useState(0),u=Mt(),{focusParentProps:m,focusProps:g}=_n({id:s});o.useEffect(()=>t.on("change",y=>{p(y)}),[t]);const f=o.useCallback(y=>{const $=parseInt(y.target.dataset.index);n.set($),a&&(l.current.style.width=document.querySelector?.(`figure[id="${m["data-focus-identifier"]}-${$}"] img`).clientWidth+"px",l.current.style.height=document.querySelector?.(`figure[id="${m["data-focus-identifier"]}-${$}"] img`).clientHeight+"px")},[n,m,a]),{setFocusIndex:b,createFocusProps:k}=Wn({ref:c,initialFocusIndex:d,orientation:wt.horizontal,onFocus:f});return o.useEffect(()=>{b(d)},[d,b]),oe(ti,{ref:c,...ge({role:"tablist"}),...i,...m,children:[a&&x("div",{ref:l,"data-focus-identifier":`${s}-focus-container`,style:{top:0,left:0,right:0,opacity:0},...ge({hidden:!0})}),Array(e).fill(null).map((y,$)=>x("button",{type:"button",...ge({role:"tab",selected:d===$,controls:`${s}-${$}`}),onClick:f,...k($),...g,...qe({themeType:u}),"data-focus-parent":`${s}-focus-container`,children:$+1},$))]})},ti=L.div` 371 position: absolute; 372 pointer-events: none; 373 height: 100%; 374 width: 100%; 375 376 * { 377 position: absolute; 378 inset-block-end: 0; 379 inset-inline-start: 0; 380 opacity: 0; 381 } 382`,ni=({contentLength:e})=>{const t=gt(0),n=He(0),s=o.useCallback(()=>t.get(),[t]),a=o.useCallback(l=>{const d=n.get()%e,p=l%e;if(d!==p){const u=n.get()+(p-d);n.set(u)}},[e,n]),i=o.useCallback(()=>{n.set(n.get()+1)},[n]),c=o.useCallback(()=>{n.set(n.get()-1)},[n]);return o.useMemo(()=>({index:t,internalIndex:n,getIndex:s,setIndex:a,nextSlide:i,previousSlide:c}),[t,n,s,i,c,a])};var Se;(function(e){e.left="left",e.right="right",e.none="none",e.hidden="hidden"})(Se||(Se={}));const ko=o.memo(({onClick:e,canNavigateBackward:t,canNavigateForward:n,onMouseEnter:s,onMouseLeave:a,onMouseUp:i,children:c,...l})=>{const[d,p]=o.useState({left:0,width:0}),[u,m]=Et(),{setIcon:g,setEmpty:f,hide:b,opacity:k,iconOffsetX:y}=js();k?.set(.6);const $=o.useCallback((w=void 0)=>{if(w||m){const{left:j,width:U}=(w||m).getBoundingClientRect();p({left:j,width:U})}},[m]),A=nn(w=>{$(w)},[$]),P=Ge(A,u);o.useEffect(()=>{let w;const j=()=>{w&&clearTimeout(w),w=setTimeout(()=>{$()},200)};return window.addEventListener("resize",j,Un?{passive:!0}:!1),()=>{w&&clearTimeout(w),window.removeEventListener("resize",j)}},[$]);const T=o.useRef(!1),S=He(Se.hidden);o.useEffect(()=>S.on("change",w=>{w===Se.hidden||w===Se.none?b():g(w===Se.left?Os:As)}),[g,S,b,f]);const{navigateRight:R,navigateLeft:O}=o.useMemo(()=>{const w=d.left+d.width/2;return{navigateRight:w,navigateLeft:w}},[d.left,d.width]),I=o.useCallback(w=>{T.current&&(w.target===w.currentTarget?S.set(Se.none):R>w.clientX&&t.get()?(S.set(Se.left),y?.set(-1)):O<w.clientX&&n.get()?(S.set(Se.right),y?.set(1)):S.set(Se.hidden))},[t,n,S,R,O,y]),B=o.useCallback(w=>{T.current=!0,$(w.currentTarget),s?.(w)},[$,s]),Z=o.useCallback(w=>{a?.(w),S.set(Se.hidden),b()},[a,S,b]),M=o.useCallback(()=>{e?.(S.get())},[S,e]),X=o.useCallback(w=>{i?.(w)},[i]),{name:ae}=Ke(),Q=Ee(t,w=>w?"auto":"none"),xe=Ee(n,w=>w?"auto":"none");return x(oi,{ref:P,onMouseEnter:I,onMouseMove:I,onMouseUp:X,onTouchStart:I,onTouchEnd:X,onClick:M,onHoverStart:B,onMouseLeave:Z,...l,children:Zn&&ae===ut.mobile?c:oe(o.Fragment,{children:[x(Cn,{left:!0,style:{pointerEvents:Q}}),c,x(Cn,{style:{pointerEvents:xe}})]})})});ko.displayName="PointerReplace";const oi=L(De.div)(()=>v(v` 383 position: relative; 384 width: 100%; 385 pointer-events: auto; 386 flex: 1; 387 & > * { 388 pointer-events: auto; 389 } 390 `)),Cn=L(De.div)(({left:e})=>v(v` 391 inset-block-start: 0; 392 position: absolute; 393 height: 100%; 394 width: ${100/2}%; 395 z-index: 2; 396 opacity: 0; 397 `,e&&v` 398 inset-inline-start: 0; 399 `,!e&&v` 400 inset-inline-end: 0; 401 `)),Zt=o.memo(({x:e,internalIndex:t,contentOffset:n,contentLoaded:s=!1,content:a,slideWidths:i,initialized:c=!0,percentages:l,dragged:d,isDark:p,startOffset:u,hasNavigated:m,containerWidth:g,...f})=>{const b=Ee(e,P=>l?`${P}%`:`${P}px`),k=gt([]),[y,$]=o.useState(0),A=o.useRef(null);return o.useEffect(()=>{if(!zs){const P=()=>{const O=k.get();let I={width:0,height:1,aspect:0};if(O.forEach(B=>
401{if(!B?.width||!B?.height)return;const Z=B.width/B.height;(B.width>I.width||B.width===I.width&&Z>I.aspect)&&(I={width:B.width,height:B.height,aspect:Z})}),I.width>0&&I.height>0){const B=window.innerWidth-(g||0),Z=window.innerWidth-B,M=Math.min(I.width,Z),X=I.width/I.height,ae=M/X;ae>window.innerHeight*.8&&$(window.innerHeight*.8),$(ae)}};P();const T=k.on("change",P);let S;const R=A.current;return R&&"ResizeObserver"in window&&(S=new window.ResizeObserver(()=>{P()}),S.observe(R)),()=>{T?.(),S&&R&&S.unobserve(R)}}},[g,k]),x(ii,{ref:A,initial:!1,style:{x:b},mobileHeight:y>0?`${y}px`:void 0,initialized:c,contentLoaded:s,clipStart:u&&!m,isRTL:Qe().isRTL,...f,children:a?.map((P,T)=>{const S=P?.sources?.[0]?.srcSet||P.src||"",R=S.lastIndexOf(" "),O=`${T}-${S.substring(S.lastIndexOf("/")+1,R!==-1?R:void 0)}`;return x(si,{x:e,contentLength:a.length/2,index:T,internalIndex:t,percentages:l,contentItemProps:P,slideWidths:i,slideNaturalDimensions:k,slideHeight:y,dragged:d,contentOffset:n,isDark:p,startOffset:u,hasNavigated:m},O)})})});Zt.displayName="GallerySlides";const si=({index:e,internalIndex:t,x:n,contentLength:s,percentages:a,contentOffset:i,slideWidths:c,slideNaturalDimensions:l,slideHeight:d,initialized:p=!0,contentItemProps:u,startOffset:m,hasNavigated:g})=>{const{isRTL:f}=Qe(),b=o.useRef(null);let k;const y=e<s?e:e-s,$=Ee(n,S=>{if(!a)return 0;const R=S/100,O=Math.round(-R)%s,I=O<0?O+s:O;return y===I?0:1-Math.abs(R-Math.round(R))*3});o.useEffect(()=>{const S=b.current;if(S)return S.setAttribute("aria-hidden",e!==hn(t?.get(),s,f)?"true":"false"),t.on("change",R=>{S.setAttribute("aria-hidden",e!==hn(R,s,f)?"true":"false")})},[e,t,s,f]);const{name:A}=Ke(),P=A===ut.mobile||A===ut.tablet,T={height:P&&d>0?`${d}px`:"100%",width:"auto",maxHeight:P&&d>0?`${d}px`:"none"};if(u?.sources!==void 0){const{pictureProps:S,sources:R,source:O,style:I,...B}=u;k=oe(Xn,{...S,stretch:!0,children:[R?.map((Z,M)=>x("source",{...Z},`source${M}`)),x(Ln,{index:e,slideWidths:c,slideNaturalDimensions:l,slideHeight:d,objectPosition:"objectPosition"in u?u.objectPosition:"center center",src:O||"",initialized:p,...B,style:{...I,...T,x:void 0}}),a&&x(Dt,{style:{opacity:$}})]},e)}else{const{style:S,isDark:R,...O}=u;k=oe(Pt.Fragment,{children:[x(Ln,{index:e,slideWidths:c,slideNaturalDimensions:l,slideHeight:d,objectPosition:"objectPosition"in u?u.objectPosition:"center center",initialized:p,...O,style:{...S,...T,x:void 0}}),a&&x(Dt,{style:{opacity:$}})]},e)}if(p)return oe(yo,{role:"tabpanel",ref:b,index:e,contentOffset:i,initialized:p,startOffset:m,hasNavigated:g,children:[k,a&&x(Dt,{style:{opacity:$}})]},e)},yo=o.forwardRef(({index:e,contentOffset:t,initialized:n,children:s,startOffset:a,hasNavigated:i},c)=>{const l=He(0),d=He(0),{id:p}=Ma(),u=Ee([l,t[e]],([k,y])=>`${y-k}px`),m=Ee([l,d],([k,y])=>y||(k?2:1)),{isRTL:g}=Qe(),f=g?t[e].get()>0:t[e].get()<0,b=a&&f;return x(ri,{id:`${p}-${e}`,ref:c,style:{x:u,zIndex:m},initial:b?{opacity:0}:void 0,animate:b?{opacity:i?1:0}:void 0,transition:{opacity:{duration:.4,ease:"easeOut"}},initialized:n,children:s})});yo.displayName="GallerySlide";const Ln=({index:e,slideWidths:t,slideNaturalDimensions:n,initialized:s,...a})=>{const{name:i}=Ke(),c=o.useMemo(()=>i===ut.mobile?8:i===ut.tablet?12:16,[i]),l=nn(p=>{if(p){const u=[...t.get()];u[e]=p.offsetWidth+c,t.set(u)}},[e,t,c]),d=o.useCallback(p=>{const u=p.currentTarget,m=[...n.get()];m[e]={width:u.naturalWidth,height:u.naturalHeight},n.set(m),a.onLoad&&a.onLoad(p)},[e,n,a]);return x(ai,{ref:l,initialized:s,onLoad:d,style:{minWidth:"100%"},...a})},ai=L(Jn,Pe(!1,"initialized"))(({initialized:e})=>!e&&v` 402 flex-shrink: 0; 403 404 ${Ie({marginInlineEnd:{mobile:h.medium,tablet:h.large}})} 405 `),ii=L(De.div,Pe(!1,"initialized","contentLoaded","mobileHeight","clipStart"))(({initialized:e,contentLoaded:t,mobileHeight:n,clipStart:s,isRTL:a})=>v(v` 406 height: ${n||"auto"}; 407 flex: 0; 408 pointer-events: none; 409 410 ${q.desktop} { 411 height: 100%; 412 } 413 `,!t&&v` 414 opacity: 0; 415 `,t&&v` 416 opacity: 1; 417 `,!e&&v` 418 display: flex; 419 flex-wrap: nowrap; 420 `,s&&v` 421 clip-path: ${a?"inset(0 0 0 -100vw)":"inset(0 -100vw 0 0)"}; 422 `)),ri=L(De.figure,Pe(!1,"initialized"))(({initialized:e})=>v(v` 423 height: 100%; 424 width: 100%; 425 flex-shrink: 0; 426 overflow: hidden; 427 position: relative; 428 display: inline-block; 429 pointer-events: none; 430 431 img { 432 user-select: none; 433 pointer-events: auto;
434 -webkit-user-drag: none; 435 } 436 437 > * { 438 pointer-events: none; 439 } 440 `,e&&v` 441 position: absolute; 442 `)),Dt=L(De.div)(({theme:e})=>v` 443 position: absolute; 444 inset-inline-start: 0; 445 inset-inline-end: 0; 446 inset-block-start: 0; 447 inset-block-end: 0; 448 background-color: ${e.gallery.peakOverlayColor}; 449 `);var je;(function(e){e[e.forward=1]="forward",e[e.backward=-1]="backward"})(je||(je={}));const li=.03,ci=[],di=({onChange:e,content:t=ci,clampedIndex:n,internalIndex:s,dragThreshold:a,startOffset:i,containerWidth:c})=>{const{isRTL:l}=Qe(),[d,p]=o.useState(!1),u=t.length,m=o.useMemo(()=>{const C=l?[...t].reverse():t,W=t?.length>1?[...C,...C,...C]:C;return l?[...W.slice(t.length-1),...W.slice(0,t.length-1)]:W},[t,l]),g=m.length,f=o.useMemo(()=>s||Bs(0),[s]),b=o.useMemo(()=>n||lt(0),[n]);o.useEffect(()=>{if(!i||d)return;let C;const W=f.on("change",()=>{C&&clearTimeout(C);const J=f.get()>0,se=f.get()<0;J&&(C=setTimeout(()=>{p(!0)},500)),se&&p(!0)});return()=>{W(),C&&clearTimeout(C)}},[i,f,d]);const k=m[f.get()]?.isDark,[y,$]=o.useState(k||!1);o.useEffect(()=>{const C=m[b.get()]?.isDark;$(C!==void 0?C:!1)},[b,m]),o.useEffect(()=>{b.on("change",C=>{const W=m[C]?.isDark;$(W!==void 0?W:!1)})},[b,m]);const A=o.useRef(0),P=He(0),T=o.useRef(!1),S=o.useRef(!1),{isKeyboardControlled:R}=Xt(),O=Ws(),I=R||O,B=He(0),Z=He(0),M=He(0),[X,ae]=o.useState(!1),[Q,xe]=o.useState(!1),w=gt([]),{createOffsetFromIndex:j,totalOffset:U}=is(w,!0,l),E=Ee([B,P,w],([C,W,J])=>{const se=J.reduce((le,$e)=>le+$e,0);return W-se-C}),ee=!1,D=Ee([Z,f,B,E],([C,W,J,se])=>{const le=l?-J:J;return-1*j(W)+C+le}),ne=Ee([D,B],([C,W])=>!ee),z=Ee([D,E],([C,W])=>!ee),{animatedMotionValue:G,directlySetOnce:_,disableDirectlySetOnce:N}=rs(D,O?{duration:0}:en.largeSurface,S);o.useEffect(()=>{const C=W=>{const J=W.length===g&&W.every(le=>le>0),se=W.length===g&&W.every(le=>le>24);J&&ae(!0),se&&(xe(!0),N()),m.some(le=>le?.type==="video")&&xe(!0)};return C(w.get()),w.on("change",C)},[g,w,N,m]),o.useEffect(()=>{S.current=I},[I]);const F=o.useCallback(C=>{let W=f.get();W+=C*1,f.set(W)},[w,E,ne,z,ee,f,u,l]),H=o.useCallback(C=>{(!("isPrimary"in C)||C?.isPrimary)&&($t(C),P.set(C.currentTarget.clientWidth),S.current=!0)},[P]),ie=o.useCallback((C,W)=>{(!("isPrimary"in C)||C?.isPrimary)&&S.current&&(Z.set(1*W.offset.x),M.set(W.velocity.x))},[Z,M]),ue=o.useCallback(()=>{const C=Z.get(),W=Math.abs(C);S.current=!1,Z.set(0);const J=li*P.get(),se=Math.abs(M.get())/P.get()>.2&&W>J;T.current=W>J||se;const le=a===void 0?.1*P.get():a;(W>le||se)&&F(C<0?l?je.backward:je.forward:l?je.forward:je.backward)},[F,Z,M,P,a,l]),ye=o.useCallback(C=>{if(!X)return Array(g).fill(0);const W=l?C>=0?C%g:g+1+(C-1)%g:C>=0?C%g:g-1+(C+1)%g;b.set(W%u);const J=Math.round(g/2);let se=g-(W+J);se<0&&(se=g+se);const le=(l?se:W+J)%g;return A.current=Math.floor(C/g),ls({slideWidths:w.get(),contentLength:g,currentPage:A.current,splitAt:le,splitOffset:J,percentages:!1,createOffsetFromIndex:j,totalOffset:U(),isRTL:l,isContainedVariant:!0})},[X,g,b,u,w,j,U,l]),pe=o.useMemo(()=>{A.current=0,(f.get()!==0||b.get()!==0)&&_();const C=u-1;return b.get()>C?(f.set(C),b.set(C)):b.get()!==f.get()&&f.set(b.get()),ye(f.get()).map(J=>lt(J))},[f,b,u,ye,_]);o.useEffect(()=>{if(!X)return;const C=se=>{ye(se).forEach(($e,Ae)=>{pe[Ae].set($e)})};C(f.get());const W=f.on("change",se=>{C(se),e?.(b.get())}),J=w.on("change",()=>{C(f.get())});return()=>{W(),J()}},[X,b,pe,ye,f,e,w]);const Le=o.useCallback(C=>{!T.current&&(C===Se.right||C===Se.left)&&F(l?C===Se.right?je.backward:je.forward:C===Se.right?je.forward:je.backward)},[F,l]),{scrollElement:Te}=Ns(),fe=o.useRef(null);o.useEffect(()=>{const C=()=>{if(fe.current){const W=fe.current.getBoundingClientRect(),J=Te?.clientWidth||document.documentElement.clientWidth,se=(Te||document.documentElement).getBoundingClientRect().left,le=Math.min(J,Qn),$e=W.left-se-(J-le)/2;P.set(le),B.set($e),_()}};return C(),window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}},[_,B,Te,P]);const de=Ee(B,C=>`-${C}px`);return oe(dt,{children:[x("div",{ref:fe}),x(ui,{overflow:!0,style:{width:P,insetInlineStart:de},children:m?.length>1?x(ko,{onClick:Le,onPan:ie,onMouseDown:H,onMouseUp:ue,onMouseLeave:ue,onTouchStart:H,onTouchEnd:ue,canNavigateBackward:ne,canNavigateForward:z,children:x(Zt,{x:G,content:m,internalIndex:f,contentOffset:pe,slideWidths:w,initialized:X,contentLoaded:Q,dragged:T,percentages:!1,isDark:y,startOffset:i,hasNavigated:d,containerWidth:c})}):x(Zt,{x:G,content:m,internalIndex:f,contentOffset:pe,slideWidths:w,initialized:X,contentLoaded:Q,dragged:T,percentages:!1,isDark:y,startOffset:i,hasNavigated:d,containerWidth:c})})]})},ui=L(De.div,Pe(!1,"overflow"))(({overflow:e})=>v(v` 450 overflow: hidden; 451 display: flex; 452 453 ${q.tablet} { 454 height: 100%; 455 } 456 `,e&&v` 457 position: relative; 458 `)),$o=({content:e,aspectRatio:t,inBreakoutSection:n,captions:s,showCaption:a,clampedIndex:i,ref:c})=>{const l=e,d={style:{height:"100%",width:"auto",maxWidth:"none"}},{style:p,...u}=d,m=n?eo:Pt.Fragment,g=t?to:fi,f=t?{ratio:t}:{},{pictureProps:b,sources:k,source:y,style:$,...A}=l;
458return x(bo,{offset:"0px 0px -60% 0px",triggerOnce:!0,children:x(pi,{ref:c,children:oe(g,{...f,children:[oe(Xn,{...b,stretch:!0,children:[k?.map((P,T)=>x("source",{...P},`source${T}`)),x(Jn,{src:y||A?.src,alt:A?.alt,...u,...A,style:{...$,...p,x:void 0}})]}),a&&x(m,{children:x(sn,{clampedIndex:i,length:1,captions:s,"data-type":"indicator",hideIndicator:!0})})]})})})};$o.displayName="SingleItem";const pi=L.div` 459 width: 100%; 460 display: flex; 461 position: relative; 462`,fi=L.div` 463 display: flex; 464 flex-direction: column; 465`,hi=[],gi={[Lt.visible]:{transition:{staggerChildren:jt.normal}}},So=o.forwardRef(({onChange:e,content:t=hi,inBreakoutSection:n=!1,hideIndicator:s,controls:a,aspectRatio:i,dragThreshold:c,ariaLabels:l,startOffset:d=!1,...p},u)=>{const m=ni({contentLength:t.length}),{index:g,internalIndex:f,setIndex:b}=a||m,k=t.length,y=Ne("gallery",p.id),$=o.useMemo(()=>t.map(M=>M?.caption).filter(M=>M!==void 0),[t]),A=n?eo:Pt.Fragment,P=gt(!1),T=i?to:o.Fragment,S=i?{ratio:i}:{},R=(t?.length>1||!!t?.[0]?.caption)&&!s;if(t.length===0)return null;if(t.length===1)return x($o,{ref:u,content:t[0],aspectRatio:i,inBreakoutSection:n,captions:$,showCaption:R,clampedIndex:g});
465const O=o.useRef(null),[I,B]=o.useState(void 0),Z=Ge(u,O);return Ds(()=>{function M(){O.current&&B(O.current.getBoundingClientRect().width)}return M(),window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[]),x(bo,{offset:"0px 0px -60% 0px",triggerOnce:!0,children:oe(mi,{ref:Z,sizeToParent:!0,variants:gi,...p,"aria-live":"polite",children:[x(T,{...S,children:x(go.Provider,{value:{id:y,inGallery:!0,index:g,internalIndex:f,isInView:P,setIndex:b},children:x(di,{onChange:e,content:t,internalIndex:f,clampedIndex:g,dragThreshold:c,ariaLabels:l,startOffset:d,containerWidth:I})})}),t?.length>1&&x(ei,{clampedIndex:g,internalIndex:f,length:k,memoizedId:y,imageCarousel:!0}),R&&x(A,{children:x(sn,{clampedIndex:g,length:k,captions:$,"data-type":"indicator",hideIndicator:s})})]})})});So.displayName="Gallery";const mi=L(De.div,Pe(!1,"sizeToParent"))(({sizeToParent:e})=>v(v` 466 display: flex; 467 flex-direction: column; 468 position: relative; 469 z-index: 0; 470 flex: 0; 471 touch-action: pan-y; 472 user-select: none; 473 -webkit-touch-callout: none; 474 -webkit-tap-highlight-color: transparent; 475 width: auto; 476 ${q.desktop} { 477 max-height: 97vw; 478 } 479 `,e&&v` 480 ${q.desktop} { 481 width: 100%; 482 height: 100%; 483 } 484 `)),Co=o.forwardRef(({id:e,parentId:t,label:n,index:s=0,active:a=!1,disabled:i=!1,maxLabelWidth:c=140,minLabelWidth:l,monochrome:d,onClick:p,...u},m)=>{const g=Ne("tab",e),f=Mt(),b=o.useCallback(()=>{p?.(s)},[p,s]);return oe(xi,{...ge({selected:a,role:"tab",disabled:i}),id:g,as:u?.href?"a":"button",...qe({themeType:f}),...u,ref:m,type:"button",active:a,disabled:i,onClick:i||typeof b>"u"?void 0:b,monochrome:d,children:[x(bi,{minLabelWidth:l,maxLabelWidth:c,children:n}),a&&x(vi,{layout:!0,layoutId:t||"active",monochrome:d,transition:qn({duration:jt.slow}),style:{originY:"0px"}})]})});Co.displayName="Tab";const bi=L.span(({maxLabelWidth:e,minLabelWidth:t})=>v(v` 485 display: block; 486 white-space: nowrap; 487 max-width: ${e?typeof e=="number"?`${e}px`:e:"none"}; 488 ${Gn}; 489 `,t&&v` 490 min-width: ${typeof t=="number"?`${t}px`:t}; 491 `)),xi=L("button",Pe(!0,"monochrome"))(({theme:e,active:t,disabled:n,monochrome:s})=>v(v` 492 background: none; 493 border: none; 494 appearance: none; 495 color: ${s?e.tabs.monochrome.color:e.tabs.color}; 496 display: block; 497 padding: ${me(7/16)} 0 ${me(7/16)}; 498 text-decoration: none; 499 transition: ${et("all",nt.default,tt.fast)}; 500 position: relative; 501 text-align: center; 502 cursor: pointer; 503 user-select: none; 504 touch-action: manipulation; 505 -webkit-tap-highlight-color: transparent; 506 507 @media (hover: hover) { 508 &:hover { 509 color: ${s?e.tabs.monochrome.activeColor:e.tabs.activeColor}; 510 } 511 } 512 513 &:active { 514 color: ${s?e.tabs.monochrome.activeColor:e.tabs.activeColor}; 515 } 516 `,Kn,t&&v` 517 color: ${s?e.tabs.monochrome.activeColor:e.tabs.activeColor}; 518 cursor: default; 519 `,n&&v` 520 color: ${s?e.tabs.monochrome.disabledColor:e.tabs.disabledColor}; 521 cursor: default; 522 pointer-events: none; 523 `)),vi=L(De.div)(({theme:e,monochrome:t})=>v` 524 position: absolute; 525 inset: auto 0 0; 526 block-size: ${Ce(2)}; 527 background: ${t?e.tabs.monochrome.borderColorSelected:e.tabs.borderColorSelected}; 528 z-index: 1; 529 530 @media (min-resolution: 2dppx) { 531 block-size: ${Ce(1.5)}; 532 } 533 `);function wi(e=10){const{isRTL:t}=Qe(),[n,s]=o.useState(!t),[a,i]=o.useState(!!t),[c,l]=o.useState(!0),[d,p]=o.useState(!1),u=o.useRef(null),m=o.useCallback((f,b=!1)=>{const k=f.scrollWidth-f.clientWidth-f.scrollLeft,y=f.scrollWidth-f.clientWidth+f.scrollLeft,$=f.scrollHeight-f.clientHeight-f.scrollTop,A=t?f.scrollLeft>-e:k<e;a!=A&&i(A);const P=t?y<e:f.scrollLeft<e;n!=P&&s(P);const T=$<e;d!=T&&p(T);const S=f.scrollTop<e;c!=S&&l(S),b&&f.scrollWidth===f.clientWidth&&(s(!0),i(!0))},[e,t,a,n,d,c]),g=o.useCallback(f=>{m(f.currentTarget)},[m]);return o.useEffect(()=>{u.current!==null&&m(u.current,!0)},[m]),{handleScroll:g,scrollEdgesRef:u,reachedLeft:n,reachedRight:a,reachedBottom:
533d,reachedTop:c}}var at;(function(e){e.default="default",e.condensed="condensed"})(at||(at={}));const Lo=o.forwardRef(({id:e,tabs:t,activeTab:n=0,onTabClick:s,withBorder:a=!1,maxLabelWidth:i=140,minLabelWidth:c,monochrome:l,gap:d=at.default,onWheel:p,...u},m)=>{const g=Ne("tabs",e),[f,b]=Et(),[k,y]=o.useState(n),{handleScroll:$,reachedLeft:A,reachedRight:P}=wi(),[T,S]=Fs(),R=Ge(m,T),{isRTL:O}=Qe(),[I,B]=o.useState(()=>t.map(()=>({node:null,width:-1,offset:0}))),{motion:Z,reset:M,stop:X}=_s(0,b,"scrollLeft"),ae=t.length,Q=o.useMemo(()=>(X(),t.map((z,G)=>_=>{if(_){const N=()=>{B(F=>{const H=[...F];return H[G]={node:_,width:_.clientWidth,offset:_.offsetLeft+_.clientWidth/2},H})};_.clientWidth===0?requestAnimationFrame(N):N()}})),[t,X]),xe=o.useMemo(()=>I.length===t.length&&!I.find(z=>z.width===-1),[I,t]),w=o.useCallback(z=>{const G=b?.scrollLeft||0;let _;if(O){const N=I[z].offset-G>-(S*.2),F=I[z].offset-G<-(S*.8);_=N?Math.round(I[z].offset+S*.1+I[z].width*.5):F?Math.round(I[z].offset+S*.8+I[z].width*.5):G,_>0&&(_=0)}else{const N=G+S*.8<I[z].offset,F=G+S*.2>I[z].offset;_=N?Math.round(I[z].offset-S*.8+I[z].width*.5):F?Math.round(I[z].offset-S*.1-I[z].width*.5):G,_<0&&(_=0)}M(),Z.set(_),s?.(z)},[b?.scrollLeft,S,I,O,M,Z,s]),j=o.useCallback(z=>{X(),p?.(z)},[p,X]),U=o.useCallback((z,G)=>{let _=z;const N=G==="ArrowRight"?1:-1;let F=0;for(;F<ae;){if(_=(_+N+ae)%ae,!t[_].disabled)return _;F++}return z},[t,ae]),E=o.useCallback(z=>{switch(z.key){case"ArrowRight":case"ArrowLeft":const G=z.key;$t(z),y(_=>{const N=U(_,G);return I[N]?.node&&I[N]?.node?.focus(),N});break}},[U,I]),ee=xe&&t.length>0?I[t.length-1].width/2+I[t.length-1].offset:0,D=Math.abs(ee)>S,ne=t.map((z,G)=>`${g}-${G}`);return o.useEffect(()=>{y(n)},[n]),oe(ki,{ref:R,children:[a&&x(Si,{monochrome:l}),x(yi,{id:g,...u,ref:f,onScroll:$,onWheel:j,onKeyDown:E,scrollOverflow:D,startGradientVisible:(O&&!P||!O&&!A)&&D,endGradientVisible:(O&&!A||!O&&!P)&&D,isRTL:O,children:x($i,{gap:d,...ge({role:"tablist",owns:ne.join(" ")}),children:t.map((z,G)=>x(Co,{id:ne[G],parentId:g,ref:Q[G],...z,tabIndex:G===k?0:-1,index:G,active:G===n,onClick:w,maxLabelWidth:i,minLabelWidth:c,monochrome:l,role:"tab"},G))})})]})});Lo.displayName="Tabs";const ki=L.div` 534 position: relative; 535`,In=Ce(8),yi=L.div(({scrollOverflow:e,startGradientVisible:t,endGradientVisible:n,isRTL:s})=>v(v` 536 z-index: 2; 537 position: relative; 538 min-width: 0; 539 540 /* to ensure Tab.tsx can breakout for the hitbox area 541 * without breaking the scroll behaviour 542 */ 543 margin: -${In} 0; 544 padding: ${In} 0; 545 `,e&&v` 546 overflow-x: scroll; 547 -webkit-overflow-scrolling: auto; 548 -ms-overflow-style: none; 549 scrollbar-width: none; 550 551 mask-image: linear-gradient(90deg, transparent 0%, white 10%, white 90%, transparent 100%); 552 mask-position: center; 553 mask-size: 100%; 554 555 &::-webkit-scrollbar {
556 display: none; 557 width: 0 !important; 558 height: 0 !important; 559 } 560 `,e&&t&&!n&&v` 561 mask-size: 110%; 562 mask-position: ${s?"100%":"0%"}; 563 `,e&&n&&!t&&v` 564 mask-size: 110%; 565 mask-position: ${s?"0%":"100%"}; 566 `)),$i=L("div",Pe(!0,"gap"))(({gap:e})=>v(v` 567 list-style: none; 568 position: relative; 569 display: flex; 570 margin: 0; 571 white-space: nowrap; 572 width: 0; 573 z-index: 2; 574 ${Ie({gap:{mobile:e===at.condensed?h.medium:h.large,tablet:e===at.condensed?h.medium:h.large,desktop:e===at.condensed?h.large:h.xLarge}})}; 575 `)),Si=L("div",Pe(!0,"monochrome"))(({theme:e,monochrome:t})=>v` 576 position: absolute; 577 height: ${Ce(3)}; 578 /* Using this technique to create device px border height */ 579 background-image: linear-gradient( 580 to bottom, 581 transparent 50%, 582 ${t?e.tabs.monochrome.borderColor:e.tabs.borderColor} 51% 583 ); 584 background-size: 100% ${Ce(3)}; 585 inset-inline-start: 0; 586 inset-inline-end: 0; 587 inset-block-end: ${Ce(8)}; 588 `),Ci=({kakao:e,map:t,bounds:n,src:s})=>{const a=Ne("kakao-overlay"),[[i,c],l]=o.useState([0,0]);return o.useEffect(()=>{if(e&&t){const d=new e.maps.LatLngBounds(new e.maps.LatLng(n.south,n.west),new e.maps.LatLng(n.north,n.east)),p=new e.maps.Rectangle({bounds:d,fillColor:`url(#${a})`,fillOpacity:1,strokeOpacity:0});return p.setMap(t),()=>{p.setMap(null)}}},[n,a,e,t]),o.useEffect(()=>{const d=new Image;d.addEventListener("load",()=>{l([d.width,d.height])}),d.src=s},[s]),x("svg",{children:x("defs",{children:x("pattern",{id:a,x:"0",y:"0",width:"1",height:"1",viewBox:`0 0 ${i} ${c}`,preserveAspectRatio:"xMidYMid",children:x("image",{href:s,width:i,height:c})})})})},Rn=({children:e,position:{latitude:t,longitude:n},hidden:s=!1,active:a=!1,markerKey:i})=>{const{mapApi:c,map:l}=o.useContext(jn),d=c,p=Ne("kakao-marker",i?`kakao-marker-${i}`:void 0),[u,m]=o.useState(null),g=o.useRef(null);return o.useEffect(()=>{if(!d||!l||s)return;const f=new d.maps.LatLng(t,n),b=document.createElement("div");b.id=p;const k=new d.maps.CustomOverlay({clickable:!0,position:f,content:b,zIndex:a?2:1});return g.current=k,k.setMap(l),m(b),b.parentNode&&(b.parentNode.style.whiteSpace=""),()=>{k.setMap(null)}},[a,s,p,d,t,n,l]),o.useEffect(()=>{g.current&&g.current.setZIndex(a?2:1)},[a]),u&&!s?Do.createPortal(e,u):null},Li="//dapi.kakao.com/v2/maps/sdk.js",Ft=e=>Math.max(20-e,1),Ii=(e,t)=>{const[n,s]=o.useState(null),a=e;return o.useEffect(()=>{const i=()=>window[t];if(i()){s(i());return}const c=document.querySelector(`script[src="${a}"]`),l=p=>{console.error({message:"Could not load map loader script",error:p})},d=()=>{const p=i();p?.maps?p?.maps.load(()=>{s(p)}):s(p)};if(c)c?.addEventListener("load",d),c?.addEventListener("error",l);else{const p=document.createElement("script");return p.src=a,p?.addEventListener("load",d),p?.addEventListener("error",l),document.head.appendChild(p),()=>{document.head.removeChild(p)}}return()=>{c.removeEventListener("load",d),c.removeEventListener("error",l)}},[a,t]),{mapAPI:n}},Ri=[],Pn={},Pi=[],Io=o.forwardRef(({defaultZoom:e=3,minZoom:t=1,maxZoom:n=14,center:s,defaultCenter:a={latitude:33.450701,longitude:126.570667},apiKey:i,kakaoMapOptions:c=Pn,kakaoLibraries:l=Pi,showUserPosition:d=!1,followUser:p=!1,onUserPositionSuccess:u,onUserPositionError:m,markers:g=Ri,onMarkerSelect:f,onMapClick:b,MarkerComponent:k=Uo,ClusterComponent:y=Go,onChange:$,onLoad:A,cluster:P=!0,clusterOptions:T=Pn,draggable:S=!0,controlsProps:R,centerOnActiveMarker:O=!1,indoorMaps:I,children:B,...Z},M)=>{const X=Ne("kakao-map",Z.id),ae=Mt(),Q=o.useRef(null),{apiKey:xe}=Vs("kakaoMap",{}),{mapAPI:w}=Ii(`${Li}?appkey=${i??xe}&autoload=false${l.length>0?`&libraries=${l.join(",")}`:""}`,"kakao"),j=w,U=o.useRef(null),[E,ee]=o.useState(null),D=o.useRef(null),[ne,z]=o.useState(!1),[G,_]=o.useState(1),N=o.useRef(e);o.useEffect(()=>{D.current=E,U.current=j,N.current=e},[E,j,e]);const F=o.useMemo(()=>({getMap:()=>D.current,hasMap:()=>!!D.current,panTo:({latitude:V,longitude:re},{x:te=0,y:he=0}={})=>{if(!U.current)return;const be=F.getZoom()||Ft(3),we=he?Yo(V,he,be):V,ce=te?Zo(re,te,be):re;D.current?.panTo(new U.current.maps.LatLng(we,ce))},panBy:(V,re)=>{D.current?.panBy(V,re)},getBoundingBox:()=>
588{if(!D.current||!D.current?.getBounds())return null;const V=D.current.getBounds();return[V.getSouthWest().getLng(),V.getSouthWest().getLat(),V.getNorthEast().getLng(),V.getNorthEast().getLat()]},setBoundingBox:V=>{if(!D.current||!D.current?.setBounds||!U.current)return null;const re=new U.current.maps.LatLngBounds;V.forEach(te=>{re.extend(new U.current.maps.LatLng(te.latitude,te.longitude))}),D.current?.setBounds(re)},setZoom:V=>D.current?.setLevel(Ft(V)),getZoom:()=>Ft(D.current?.getLevel()||N.current),zoomIn:()=>{D.current?.setLevel(D.current?.getLevel()-1,{animate:!0})},zoomOut:()=>D.current?.setLevel(D.current?.getLevel()+1,{animate:!0})}),[]),{points:H,userPosition:ie,handleChange:ue,handleResize:ye,handleMarkerSelect:pe,handleClusterClick:Le,handleMarkerKeyDown:Te,handleIdle:fe,mapContext:de,defaultCenterOrInitialActiveMarkerPosition:C}=Fo({loaded:ne,markers:g,mapHandlers:F,onChange:$,onMarkerSelect:f,followUser:p,showUserPosition:d,onUserPositionSuccess:u,onUserPositionError:m,cluster:P,clusterOptions:T,center:s,defaultCenter:a,centerOnActiveMarker:O});o.useEffect(()=>{E&&j&&!ne&&(A?.({map:E,kakao:j,helpers:F}),z(!0),_(F.getZoom()||e))},[j,E,F,A,e,ne]);const W=o.useRef(c);W.current=c,o.useEffect(()=>{if(j&&!E&&Q.current){const V=new j.maps.Map(Q.current,{...W.current,center:new j.maps.LatLng(C?.latitude,C?.longitude),level:e,draggable:S});ee(V)}},[j,E,S,C?.latitude,C?.longitude,e]),o.useEffect(()=>{E&&E.setDraggable(S)},[S,E]),o.useEffect(()=>{E&&j&&s?.latitude&&s?.longitude&&E.setCenter(new j.maps.LatLng(s?.latitude,s?.longitude))},[E,j,s?.latitude,s?.longitude]),o.useEffect(()=>{E&&j&&(t&&E.setMinLevel(t),n&&E.setMaxLevel(n))},[E,j,t,n]),o.useEffect(()=>{if(E&&j){const V=re=>{b?.({latitude:re.latLng.getLat(),longitude:re.latLng.getLng()}),f?.()};return j.maps.event.addListener(E,"click",V),()=>{j.maps.event.removeListener(E,"click",V)}}},[j,E,b,f]),o.useEffect(()=>{if(E&&j){const V=()=>{ue(),fe()};return j.maps.event.addListener(E,"idle",V),fe(),()=>{j.maps.event.removeListener(E,"idle",V)}}},[ue,fe,j,E]);const J=nn(V=>{V&&ye(V.clientWidth,V.clientHeight)},[ye],Hs.both);o.useEffect(()=>{E&&ye(E.getNode().clientWidth,E.getNode().clientHeight)},[ye,E]);const se=o.useCallback(()=>{Q.current===null&&(ee(null),z(!1))},[]),le=Ge(M,Q,J,se);o.useEffect(()=>{if(E&&j){const V=()=>{_(F.getZoom()||e)};return j.maps.event.addListener(E,"zoom_changed",V),()=>{j.maps.event.removeListener(E,"zoom_changed",V)}}},[j,E,F,e]);const{name:$e}=Ke(),Ae={...de,breakpointName:$e,loaded:ne,panBy:F.panBy,panTo:F.panTo,centerOnActiveMarker:O,mapType:_o.Kakao,mapApi:j,map:E},Ye=()=>{f?.()},Fe=!!R?.fullscreenOpenProps&&!!R?.fullscreenCloseProps,Me=!!R?.zoomInProps&&!!R?.zoomOutProps,_e=Me&&Fe?{onZoomIn:F.zoomIn,onZoomOut:F.zoomOut,zoomInProps:R?.zoomInProps,zoomOutProps:R?.zoomOutProps,fullscreenOpenProps:R.fullscreenOpenProps,fullscreenCloseProps:R.fullscreenCloseProps,horizontalAlignment:R?.horizontalAlignment}:Me&&!Fe?{onZoomIn:F.zoomIn,onZoomOut:F.zoomOut,zoomInProps:R?.zoomInProps,zoomOutProps:R?.zoomOutProps,horizontalAlignment:R?.horizontalAlignment}:!Me&&Fe?{fullscreenOpenProps:R?.fullscreenOpenProps,fullscreenCloseProps:R?.fullscreenCloseProps,horizontalAlignment:R?.horizontalAlignment}:{};return oe(Ti,{ref:le,id:X,...ne?{"data-ready":!0}:{},...Z,"data-type":"map",children:[x(Us,{}),ne&&x(Vo,{..._e,...ge({controls:X})}),x(jn.Provider,{value:Ae,children:oe(Ei,{children:[!ne&&x(Ho,{width:"100%",height:"100%"}),H.map(({properties:{cluster:V,marker:re,cluster_id:te,point_count:he},geometry:{coordinates:[be,we]}})=>{const ce=re?.variant===un.waypoint?{"data-id":`waypoint-${re?.id}`,"data-type":vt.waypoint}:{"data-id":re?.id,"data-type":vt.marker,onMarkerSelect:pe,onClick:pe,onKeyDown:Te};return re?.variant!==un.waypoint&&k.displayName==="MapMarkerWithTooltip"&&(ce.onTooltipClose=Ye),x(Rn,{markerKey:te||re?.id,position:{latitude:we,longitude:be},active:!V&&re?.active,children:V?x(y,{"data-id":"cluster-"+te,"data-type":vt.cluster,count:he,isStandalone:!1,onClick:Le,onKeyDown:Te,tabIndex:0,"data-map-ready":!0}):x(k,{...re,isStandalone:!1,tabIndex:0,...ce,"data-map-ready":!0,...qe({themeType:ae})})},te||re?.id||re?.key)}),ie?.latitude&&ie?.longitude&&x(Rn,{markerKey:"user-position",position:{latitude:ie.latitude,longitude:ie.longitude},hidden:!ne,children:x(Ko,{})}),I&&ae&&I.map((V,re)=>V.hideFromZoomLevel!=null&&V.hideFromZoomLevel>=G?null:x(Ci,{kakao:j,map:E,bounds:V.bounds,src:typeof V.src=="string"?V.src:V.src[ae]},`indoor-map-${re}`)),B]})})]})});Io.displayName="KakaoMap";const Ti=L.div(({theme:e})=>v` 589 height: 100%; 590 width: 100%; 591 position: relative; 592 593 /* prevent showing more map while loading, use sized in storybook to see this issue */ 594 overflow: hidden; 595 596 & > div > div > div > img { 597 /* prevent rendering grayscale on other images than map items */ 598 filter: grayscale(1) ${e._type===Ks.dark?"invert(1)":""}; 599 } 600 `),Ei=L(Gs)` 601 position: absolute; 602 width: 100%; 603 height: 100%; 604 pointer-events: none; 605 606 > div { 607 pointer-events: none; 608 } 609`,Mi=({slides:e,widths:t})=>{const{name:n}=Ke();return{content:e.map(s=>{if("video"in s){const d="autoplay"in s.video;return{type:It.video,source:s.video.sources.desktop,sources:[{media:`(min-width: ${Wt.desktop}px)`,src:s.video.sources.desktop.url,type:"video/mp4"},{media:`(min-width: ${Wt.tablet}px)`,src:s.video.sources.tablet.url,type:"video/mp4"},{media:`(min-width: ${Wt.mobile}px)`,src:s.video.sources.mobile.url,type:"video/mp4"}],poster:n?s.video.poster?.[n].url:s.video.poster?.desktop.url,caption:s.caption,isDark:s.isDark,controls:!d,autoPlay:d,muted:d,loop:d?s.video.autoplay.loop:void 0}}const{sources:a,src:i,alt:c,objectPosition:l}=Ys({imageSet:s.imageSet,deviceName:n,widths:t});return{type:It.image,source:i,sources:a,objectPosition:l,caption:s.caption,alt:s.alt??c,isDark:s.isDark}})}};var rt=(e=>(e.SERVICE_CONTRACT="service_contract",e.WARRANTY_AND_REPAIR="warranty_and_repair",e.SPACE="space",e.CAR_DISPLAY="car_display",e.TEST_DRIVE="test_drive",e.PRE_OWNED="pre_owned",e.SALES_WHOLESALE="sales_wholesale",e.SALES_NON_GENUINE_AGENCY="sales_non_genuine_agency",e))(rt||{});const ji=(e,t)=>{const n=Object.fromEntries(t.flatMap(a=>a.key?a.key.split(",").map(i=>[i.trim(),a.value]):[])),s=e.flatMap(a=>a in n&&n[a]?n[a]:[]);return Array.from(new Set(s))},Oi=({address:e,postalCode:t,city:n,country:s,state:a},i)=>
609{switch(i){case"us":case"ca":return[e,n,a].filter(Boolean).join(", ")+(t?" "+t:"");case"au":return[e,n,a,t,s].filter(Boolean).join(", ")}return[e,t,n,s].filter(Boolean).join(", ")},Ai=async({googlePlaces:e,value:t,googleSessionToken:n,language:s,region:a,locationBias:i})=>{const c=!a||a==="global",l=c?void 0:a,d=c?void 0:[a];return(await e.AutocompleteSuggestion.fetchAutocompleteSuggestions({input:t,includedPrimaryTypes:["geocode"],sessionToken:n,language:s,region:l,includedRegionCodes:d,locationBias:i?{north:i?.northEastLatitude,east:i?.northEastLongitude,south:i?.southWestLatitude,west:i?.southWestLongitude}:void 0})).suggestions.flatMap(u=>u.placePrediction?(u.optionLabel=u.placePrediction.text.text,u):[])},zi=async({kakaoGeocoder:e,kakaoPlaces:t,value:n})=>(await Promise.all([Bi(e,n),Wi(t,n)])).flat(),Bi=async(e,t)=>await new Promise(n=>{e.addressSearch(t,(s,a)=>{a===kakao.maps.services.Status.OK?n(s.map(i=>({id:i.id,address_name:i.address_name,lat:Number(i.y),lang:Number(i.x),optionLabel:i.address_name}))):n([])})}),Wi=async(e,t)=>await new Promise(n=>{e.keywordSearch(t,(s,a)=>{a===kakao.maps.services.Status.OK?n(s.map(i=>({id:i.id,address_name:i.address_name,lat:Number(i.y),lang:Number(i.x),optionLabel:i.address_name}))):n([])})}),xt=.1,Ro=(e,t)=>({northEastLatitude:e+xt,northEastLongitude:t+xt,southWestLatitude:e-xt,southWestLongitude:t-xt}),Rt=(e,t)=>{const s=e.latitude*Math.PI/180,a=t.latitude*Math.PI/180,i=(t.latitude-e.latitude)*Math.PI/180,c=(t.longitude-e.longitude)*Math.PI/180,l=Math.sin(i/2)*Math.sin(i/2)+Math.cos(s)*Math.cos(a)*Math.sin(c/2)*Math.sin(c/2),d=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return Math.abs(6371*d)},Ni=(e,t,n)=>{const s=t.map(l=>{const d=Rt(e,l);return{latitude:l.latitude,longitude:l.longitude,distance:d}}).sort((l,d)=>l.distance-d.distance),a=Math.min(n,s.length-1),i=s[a].distance,c=Math.log2(38e3*Math.cos(e.latitude*Math.PI/180)/i);return Math.max(Math.min(c,22),0)},Di=(e,t)=>{const{mapVariant:n,kakaoGeocoder:s,kakaoPlaces:a,kakaoServicesLoaded:i,googleMapRef:c}=o.useContext(pt),{setFocusedPlace:l}=ft(),[d,p]=o.useState(!1),u=On("places"),[m,g]=o.useState([]),[f,b]=o.useState();o.useEffect(()=>{n===ve.google&&u&&!f&&b(new u.AutocompleteSessionToken)},[f,u,n]);const[k,y]=o.useState([]),$=o.useMemo(()=>n===ve.google?m:n===ve.kakao?k:[],[n,m,k]),A=o.useMemo(()=>n===ve.google?u!==null:n===ve.kakao?i:!1,[n,u,i]),P=o.useCallback(async(S,R)=>{if(!S){g([]),y([]);return}if(A){if(p(!0),n===ve.google&&u){const O=await Ai({googlePlaces:u,value:S,googleSessionToken:f,language:e,region:t,locationBias:R});g(O)}if(n===ve.kakao&&s.current&&a.current){const O=await zi({kakaoGeocoder:s.current,kakaoPlaces:a.current,value:S});y(O)}p(!1)}},[A,n,u,s,a,f,e,t]);return{isPlacesServiceLoaded:A,isLoadingAutocompleteSuggestions:d,getAutocompleteSuggestions:P,autoCompleteSuggestions:$,handleAutocompleteSuggestionSelection:async(S,R)=>{if(n===ve.google&&u){const I=(await S.placePrediction?.toPlace()?.fetchFields({fields:["viewport","displayName","location"]}))?.place;if(I?.viewport&&I?.location){if(l({displayName:S.optionLabel,coordinates:{longitude:I.location.lng(),latitude:I.location.lat()},bounds:{northEastLatitude:I.viewport.getNorthEast().lat(),northEastLongitude:I.viewport.getNorthEast().lng(),southWestLongitude:I.viewport.getSouthWest
609().lng(),southWestLatitude:I.viewport.getSouthWest().lat()}}),R?.viewportBias){const B=Ni({longitude:I.location.lng(),latitude:I.location.lat()},R.viewportBias.locations,R.viewportBias.count);c.current?.setZoom(B)}b(new u.AutocompleteSessionToken)}}if(n===ve.kakao){const O=S;l({displayName:O.optionLabel,coordinates:{latitude:O.lat,longitude:O.lang},bounds:Ro(O.lat,O.lang)})}}}},Fi=e=>e instanceof Error&&"code"in e&&e.code==="ZERO_RESULTS",_i=e=>{const{mapVariant:t,kakaoServicesLoaded:n}=o.useContext(pt),s=On("geocoding"),a=o.useMemo(()=>t===ve.google?s!==null:t===ve.kakao?n:!1,[t,s,n]),i=o.useCallback(async l=>{if(t===ve.google&&s){const p=(await new s.Geocoder().geocode({language:e,location:{lat:l.latitude,lng:l.longitude}})).results.find(m=>m.types.includes("locality")),u=p?.geometry.viewport;return u?{displayName:p.formatted_address,coordinates:l,bounds:{northEastLatitude:u.getNorthEast().lat(),northEastLongitude:u.getNorthEast().lng(),southWestLatitude:u.getSouthWest().lat(),southWestLongitude:u.getSouthWest().lng()}}:null}return t===ve.kakao?{displayName:"",bounds:Ro(l.latitude,l.longitude),coordinates:l}:null},[t,e,s]),c=o.useCallback(async(l,{country:d,type:p}={})=>{try{if(t===ve.google&&s){const m=(await new s.Geocoder().geocode(p==="postal_code"?{componentRestrictions:{country:d,postalCode:l}}:{address:l,componentRestrictions:{country:d}})).results.find(f=>p?f.types.includes(p):!0);if(!m)return null;const g=m.geometry.location;return{displayName:m.formatted_address,coordinates:{latitude:g.lat(),longitude:g.lng()}}}return null}catch(u){return Fi(u)||console.error("Error during geocoding:",u),null}},[t,e,s]);return{isGeocodingServiceLoaded:a,userPositionToMapPlace:i,geocodeQuery:c}},Vi=({markers:e,onMapClick:t,onMapIdle:n,onMapInteract:s,handleUserPositionSuccess:a,handleMarkerSelect:i,handleMapLoaded:c,centerOnActiveMarker:l,controlsAlignment:d=ke.start,allowFullscreen:p=!0,ariaLabels:u})=>{const{onGoogleMapLoaded:m}=o.useContext(pt),g=o.useRef(void 0),f=o.useRef(void 0),b=o.useRef(void 0),k=y=>{m(y.map),c(),n&&(g.current=y.map.addListener("idle",()=>n())),s&&(b.current=y.map.addListener("drag",()=>s("drag")),f.current=y.map.addListener("zoom_changed",()=>s("zoom")))};return o.useEffect(()=>()=>{g.current?.remove(),b.current?.remove(),f.current?.remove()},[]),r.jsx(qo,{centerOnActiveMarker:l,showUserPosition:!0,markers:e,onUserPositionSuccess:a,onMapClick:t,onMarkerSelect:i,onLoad:k,controlsProps:{zoomInProps:{"aria-label":u.zoomIn},zoomOutProps:{"aria-label":u.zoomOut},fullscreenOpenProps:{"aria-label":u.fullscreenOpen},fullscreenCloseProps:{"aria-label":u.fullscreenClose},horizontalAlignment:d},allowFullscreen:p})},Hi=({markers:e,onMapClick:t,onMapIdle:n,handleUserPositionSuccess:s,handleMarkerSelect:a,handleMapLoaded:i,onMapInteract:c,controlsAlignment:l=ke.start,allowFullscreen:d=!0,ariaLabels:p})=>{const{kakaoMapRef:u,onKakaoMapLoaded:m}=o.useContext(pt),g=o.useRef(void 0),f=o.useRef(void 0),b=o.useRef(void 0),k=y=>{m(y.map),n&&(g.current=()=>{n()},kakao.maps.event.addListener(y.map,"idle",g.current)),c&&(b.current=()=>{c("zoom")},f.current=()=>{c("drag")},kakao.maps.event.addListener(y.map,"zoom_changed",b.current),kakao.maps.event.addListener(y.map,"drag",f.current)),i()};return o.useEffect(()=>()=>{u.current&&(g.current&&kakao.maps.event.removeListener(u.current,"idle",g.current),b.current&&kakao.maps.event.removeListener(u.current,"zoom_changed",b.current),f.current&&kakao.maps.event.removeListener(u.current,"drag",f.current))},[]),r.jsx(Io,{showUserPosition:!0,centerOnActiveMarker:!0,markers:e,kakaoLibraries:["services"],onUserPositionSuccess:s,onMapClick:t,onMarkerSelect:a,onLoad:k,controlsProps:{zoomInProps:{"aria-label":p.zoomIn},zoomOutProps:{"aria-label":p.zoomOut},fullscreenOpenProps:{"aria-label":p.fullscreenOpen},fullscreenCloseProps:{"aria-label":p.fullscreenClose},horizontalAlignment:l},allowFullscreen:d})},Ui=({markers:e,defaultBounds:t,onMapClick:n,onMarkerSelect:s,onMapIdle:a,onMapInteract:i,centerOnActiveMarker:c,controlsAlignment:l,allowFullscreen:d,ariaLabels:p})=>{const{mapVariant:u,focusedPlace:m,setMapBounds:g,userPosition:f,setUserPosition:b}=ft(),k=o.useRef(i);o.useEffect(()=>{k.current=i},[i]);const y=T=>{k.current?.(T)},$=o.useCallback(T=>{f||b(T)},[f,b]),A=T=>{T?.type===vt.marker&&s(T.marker)},P=()=>{m?.bounds?g(m.bounds):t&&g(t)};return u===ve.google?r.jsx(Vi,{centerOnActiveMarker:c,markers:e,handleMarkerSelect:A,handleMapLoaded:P,handleUserPositionSuccess:$,onMapClick:n,onMapIdle:a,onMapInteract:y,controlsAlignment:l,allowFullscreen:d,ariaLabels:p}):u===ve.kakao?r.jsx(Hi,{markers:e,centerOnActiveMarker:c,handleMarkerSelect:A,handleMapLoaded:P,handleUserPositionSuccess:$,onMapClick:n,onMapIdle:a,onMapInteract:i,controlsAlignment:l,allowFullscreen:d,ariaLabels:p}):null},Gi=(e,t)=>{const[n,s]=o.useState(e);return o.useEffect(()=>{const a=setTimeout(()=>{s(e)},t);return()=>{clearTimeout(a)}},[e,t]),n},Ki=["uk","us"],Yi=(e,t)=>{if(!t)return null;const n=Ki.includes(e),s=n?t*.621371:t,a=Math.abs(s-Math.round(s))<.01;return new Intl.NumberFormat(n?"en-US":e,{style:"unit",unit:n?"mile":"kilometer",minimumFractionDigits:a?0:2,maximumFractionDigits:2}).format(s)},Po=async({locale:e,markers:t,allLocationCapabilities:n,useUserPosition:s=!1})=>{const a=new URLSearchParams(t.map(l=>["ids",l.id]));a.append("locale",e);const i=await fetch(`/buying-support/api/location-cards?${a.toString()}`);if(!i.ok)return console.error("Error fetching location cards"),[];const c=(await i.json()).results;return t.flatMap(l=>{const d=c.find(p=>p.locationDetail.mdmId===l.id);return d?[{...d,distance:Yi(e,s&&l.distanceToUserPosition?l.distanceToUserPosition:l.distanceToFocusedPlace),translatedCapabilities:ji(d.locationDetail.capabilities,n)}]:[]})},an=",",Zi=e=>{const t=new Map;for(const n of e){const s=`${n.longitude},${n.latitude}`,a=t.get(s);a?a.push(n):t.set(s,[n])}return Array.from(t.values(),n=>({...n[0],mdmId:n.map(s=>s.mdmId).join(an)}))},qi=(e,t,n)=>[...e].flatMap(s=>{const a=Rt(t.coordinates,s),i=n?Rt(n,s):null;return s.id.split(an).map(c=>({id:c,distanceToFocusedPlace:a,distanceToUserPosition:i}))}).sort((s,a)=>s.distanceToFocusedPlace-a.distanceToFocusedPlace),Xi=5,Ji=({visibleMarkers:e,focusedPlace:t,locale:n,allLocationCapabilities:s,userPosition:a})=>
609{const[i,c]=o.useState([]),[l,d]=o.useState(-1),[p,u]=o.useState([]),[m,g]=o.useState(!1),f=o.useMemo(()=>i.length-1!==l,[l,i]),b=o.useCallback(async()=>{if(!f||m)return;g(!0);const k=l+1,y=Math.min(k+Xi,i.length),$=i.slice(k,y),A=await Po({locale:n,markers:$,allLocationCapabilities:s});u(P=>[...P,...A]),g(!1),d(y-1)},[f,l,i,g,m,u,d,n]);return o.useEffect(()=>{if(!t){c([]),u([]);return}u([]);const k=qi(e,t,a);d(-1),c(k)},[t?.coordinates.latitude,t?.coordinates.longitude,e]),o.useEffect(()=>{i.length!==0&&b()},[i]),{sortedMarkers:i,results:p,isSearchLoading:m,fetchNextBatch:b,moreResultsLeft:f}},Qi=L.div` 610 height: 400px; 611 width: 100%; 612`,er=({title:e,description:t,gallerySlides:n})=>{const{content:s}=Mi({slides:n,widths:{desktopWide:600,desktop:600,tablet:600,mobile:330}}),{pushToDatalayer:a}=mt(),i=o.useRef(0),c=o.useCallback(l=>{const d=i.current,p=n.length-1,u=d===p&&l===0,m=d===0&&l===p,g=l<d&&!u||m?"Previous":"Next";a({event:Be.LOCATIONS,eventInfo:{action:Oe.GALLERY,label:g}}),i.current=l},[n.length,a]);return r.jsxs(no,{"data-testid":"gallery-section",children:[(e||t)&&r.jsxs(r.Fragment,{children:[r.jsxs(oo,{"data-testid":"gallery-section-title-description-wrapper",children:[r.jsx(St,{span:{mobile:4,tablet:4,desktop:4},children:r.jsx(Ut,{level:2,children:e})}),r.jsx(St,{span:{mobile:4,tablet:4,desktop:8},children:r.jsx(so,{children:t})})]}),r.jsx(Y,{spacing:{mobile:h.large,tablet:me(2.5)}})]}),r.jsx(Qi,{children:r.jsx(So,{hideIndicator:!0,content:s,onChange:c})})]})},st="all",To={sales:"sales_wholesale,sales_non_genuine_agency",service:"warranty_and_repair, service_contract"};Object.entries(To).reduce((e,[t,n])=>(e[n]=t,e),{});const tr=L.div(({isActive:e=!1})=>v` 613 gap: ${h.xSmall}; 614 display: flex; 615 616 opacity: ${e?Gt.full:Gt.medium}; 617 pointer-events: ${e?"auto":"none"}; 618 619 ${q.mobile} { 620 overflow-x: scroll; 621 overflow-y: hidden; 622 padding-inline-end: ${h.large}; 623 // 100vw - the section padding. Since we want it to go over the section padding on the right side only. 624 width: calc(100vw - ${h.large}); 625 626 /* Hide scrollbar */ 627 scrollbar-width: none; /* Firefox */ 628 -ms-overflow-style: none; /* IE/Edge */ 629 &::-webkit-scrollbar {
630 display: none; /* Chrome, Safari, Opera */ 631 } 632 mask-image: linear-gradient( 633 to right, 634 black 0, 635 black calc(100% - 60px), 636 transparent 100% 637 ); 638 } 639 ${q.tablet} { 640 padding-inline-end: 0; 641 flex-wrap: wrap; 642 box-sizing: border-box; 643 justify-content: space-between; 644 width: 100%; 645 mask-image: none; 646 } 647 `),nr=L(xo)` 648 ${q.tablet} { 649 flex-grow: 1; 650 min-width: 20%; 651 } 652`,or=({filtersLabel:e,filtersOptions:t,activeFilters:n,onFilterChange:s,isSearchLoading:a})=>{const i=c=>{if(c===st){s([st],c);return}if(!n.includes(c)){s([...n.filter(p=>p!==st),c],c);return}const d=n.filter(p=>p!==c);if(d.length===0){s([st],c);return}s(d,c)};return r.jsxs(r.Fragment,{children:[r.jsx(ht,{children:e}),r.jsx(Y,{spacing:{tablet:h.small,mobile:h.xSmall}}),r.jsx(tr,{isActive:!a,children:t.map(({userFriendlyKey:c,value:l})=>{const d=n.includes(c);return r.jsx(nr,{onClick:()=>i(c),selected:d,"data-selected":d,children:l},c)})}),r.jsx(Y,{spacing:h.medium})]})},sr=L.div(({isListVisible:e=!1})=>v` 653 width: 100%; 654 height: 100%; 655 // only hide the map on mobile when list is visible 656 display: ${e?"none":"grid"}; 657 grid-template-rows: 1fr; 658 > * { 659 grid-area: 1 / 1; 660 } 661 ${q.mobile} { 662 grid-area: 2 / 1; 663 } 664 ${q.tablet} { 665 grid-area: 1 / 1; 666 display: grid; 667 } 668 `),ar=L.div` 669 background: ${ao(Xe.black,.2)}; 670 height: 100%; 671 width: 100%; 672 z-index: 2; 673 pointer-events: none; 674`,ir=()=>{class e extends google.maps.OverlayView{div=null;onAdd(){this.div=document.createElement("div"),this.div.style.position="absolute",this.div.style.top="0",this.div.style.left="0",this.div.style.width="100%",this.div.style.height="100%",this.div.style.background="rgba(0, 0, 0, 0.2)",this.div.style.pointerEvents="none",this.getPanes()?.overlayLayer.appendChild(this.div)}draw(){const n=this.getProjection();if(!n||!this.div)return;const s=this.getMap();if(!s)return;const a=s.getBounds();if(!a)return;
674const i=n.fromLatLngToDivPixel(a.getSouthWest()),c=n.fromLatLngToDivPixel(a.getNorthEast());!i||!c||(this.div.style.left=`${i.x}px`,this.div.style.top=`${c.y}px`,this.div.style.width=`${c.x-i.x}px`,this.div.style.height=`${i.y-c.y}px`)}onRemove(){this.div&&(this.div.parentNode?.removeChild(this.div),this.div=null)}}return e},rr=({defaultMapBounds:e,isListVisible:t,onMarkerSelect:n,markers:s,onMapInteract:a,singleLocationFocused:i,ariaLabels:c})=>{const{mapVariant:l,googleMapRef:d,kakaoMapRef:p}=o.useContext(pt),u=o.useRef(null),m=o.useRef(!1),[g,f]=o.useState(!1);o.useEffect(()=>{try{if(l===ve.google){if(!d.current)return;if(!u.current){const k=ir();u.current=new k}i?u.current.getMap()!==d.current&&u.current.setMap(d.current):u.current.getMap()&&u.current.setMap(null)}else if(l===ve.kakao){if(!p.current)return;const k="overlay";m.current||(kakao.maps.Tileset.add(k,new kakao.maps.Tileset({width:256,height:256,getTile:()=>{const $=document.createElement("div");return $.style.width="256px",$.style.height="256px",$.style.background="rgba(0,0,0,0.2)",$.style.pointerEvents="none",$}})),m.current=!0);const y=kakao.maps.MapTypeId[k];i?p.current.addOverlayMapTypeId(y):p.current.removeOverlayMapTypeId(y)}}catch{f(!0)}},[i,l]);const b=o.useCallback(k=>{n(k.id)},[n]);return r.jsxs(sr,{isListVisible:t,children:[r.jsx(Ui,{defaultBounds:e,markers:s,centerOnActiveMarker:!0,onMarkerSelect:b,onMapInteract:a,controlsAlignment:ke.end,allowFullscreen:!1,ariaLabels:c}),i&&g&&r.jsx(ar,{"data-testid":"backup-overlay"})]})},lr=L(Re)` 675 gap: ${h.medium}; 676 width: 50%; 677 flex-wrap: wrap; 678`,cr=L(Re)` 679 padding: ${h.large} ${h.xLarge}; 680 margin: 0 0 ${h.xLarge}; 681 682 ${q.tablet} { 683 margin: ${h.medium} ${h.xxLarge} ${h.xxLarge}; 684 } 685`,Eo=({buttons:e,open:t,onClose:n,locationName:s})=>{const[a]=qt(),i=o.useMemo(()=>a.toString()?e.map(c=>({...c,url:An(c.url,a)})):e,[e,a]);return r.jsx(vo,{withCloseButton:!0,detached:!0,open:t,onClose:n,role:"dialog",closeButtonProps:{"aria-label":"Close"},"aria-label":"Dialog",children:r.jsxs(cr,{children:[r.jsxs(Ot,{level:2,children:["Off to ",s]}),r.jsx(Y,{spacing:h.large}),r.jsx(tn,{children:"Select your preferred language below:"}),r.jsx(Y,{spacing:h.large}),r.jsx(lr,{children:i.map(c=>r.jsx(Je,{label:c.language,href:c.url,variant:"text",icon:"arrowRight",openInNewTab:!0},c.language))})]})})},dr=["warranty_and_repair","service_contract"],ur=["NL","BE","LU","GB","CH","DK","US","AT","ES"],pr=(e,t,n)=>{const a=`https://${t===zn.Production?"www":"staging"}.polestar.com`,i="login/service-booking",c=new URLSearchParams({servicePartnerId:e.businessPartner?.parmaPartnerCode,servicePartnerMarket:e.country}).toString();return n!=="global"?[{url:`${a}/${n}/${i}?${c}`,language:""}]:aa(!1).filter(l=>l.countryCode.toUpperCase()===e.country.toUpperCase()).map(l=>({url:`${a}/${l.locale}/${i}?${c}`,language:l.languageName}))},fr=({stage:e,serviceBookingLabel:t,dataLayer:n,location:s,locale:a})=>{const{pushToDatalayer:i}=mt(),c=o.useMemo(()=>pr(s,e,a),[s,e,a]),[l,d]=o.useState(!1),p=o.useCallback(()=>{d(!1)},[d]),u=o.useCallback(()=>{i(n),d(!0)},[d,i,n]);return c.length===1?r.jsx(Je,{openInNewTab:!1,href:c[0].url,icon:"arrowRight",variant:Kt.text,label:t,dataLayer:n}):r.jsxs(r.Fragment,{children:[r.jsx(Eo,{buttons:c,locationName:s.name,open:l,onClose:p}),r.jsx(ot,{onClick:u,icon:io,iconPosition:ke.right,"data-testid":"language-selector-dialog-button",children:t})]})},hr=({locale:e,stage:t,location:n,serviceBookingLabel:s,serviceBookingDatalayerEventLabel:a,directionsLabel:i})=>{const c=!!(n.country&&n.businessPartner?.parmaPartnerCode&&n?.capabilities?.includes("digital_workshop_booking")&&ur.includes(n.country)),{mapVariant:l}=ft(),d={event:Be.LOCATIONS,eventInfo:{action:Oe.MAP_LOCATION_CARD,label:a}};if(c)return r.jsxs(r.Fragment,{children:[r.jsx(Y,{spacing:h.medium}),r.jsx(fr,{locale:e,stage:t,location:n,serviceBookingLabel:s,dataLayer:d})]});if(n.serviceBookingUrl)return r.jsxs(r.Fragment,{children:[r.jsx(Y,{spacing:h.medium}),r.jsx(Je,{openInNewTab:!0,href:n.serviceBookingUrl,icon:"externalLink",variant:Kt.text,label:s,dataLayer:d})]});if(n.capabilities.some(p=>dr.includes(p)))return r.jsxs(r.Fragment,{children:[r.jsx(Y,{spacing:h.medium}),r.jsx(Je,{openInNewTab:!0,href:Xo({latitude:Number(n.latitude),longitude:Number(n.longitude)},l),label:i,icon:"externalLink",variant:Kt.text})]})},gr=L.div` 686 gap: ${h.xxSmall}; 687 display: flex; 688 overflow-x: scroll; 689 overflow-y: hidden; 690 padding-inline-end: ${h.small}; 691 692 /* Hide scrollbar */ 693 scrollbar-width: none; /* Firefox */ 694 -ms-overflow-style: none; /* IE/Edge */ 695 &::-webkit-scrollbar {
696 display: none; /* Chrome, Safari, Opera */ 697 } 698 mask-image: linear-gradient( 699 to right, 700 black 0, 701 black calc(100% - 32px), 702 transparent 100% 703 ); 704`,mr=L(ho)` 705 flex-shrink: 0; 706`,br=L(Ot)` 707 color: ${ao(Xe.black,Gt.medium)}; 708`,Tn=(e,t)=>e.length===0?0:t!=="global"?1:e.length>1?2:e[0].language==="English"?1:2,Mo=({locationCardData:e,bookServiceButtonLabel:t,bookServiceButtonDatalayerEventLabel:n,goToLocationPageButtonLabel:s,goToLocationPageButtonDatalayerEventLabel:a,getDirectionLabel:i,comingSoonLabel:c,inList:l,stage:d,market:p})=>{const[u]=qt(),[m,g]=o.useState(!1),f=o.useCallback(()=>{g(!1)},[g]),b=o.useCallback(()=>{g(!0)},[g]),{address:k,city:y,country:$,postalCode:A,state:P}=e.locationDetail,T=Oi({address:k,country:$,state:P,city:y,postalCode:A},p.countryCode),S=o.useMemo(()=>{if(e.locationPageUrls.length===0)return"";const R=e.locationPageUrls[0].url;return An(R,u)},[e.locationPageUrls,u]);return r.jsxs(Re,{"data-testid":"location-card",crossAxisAlignment:Zs.start,children:[r.jsx(Y,{spacing:h.large}),e.translatedCapabilities.length>0&&r.jsxs(r.Fragment,{children:[r.jsx(gr,{"data-testid":"location-card-capabilities",children:e.translatedCapabilities.map(R=>r.jsx(mr,{label:R,size:Ue.small,emphasis:Vt.low,variant:Ct.background},`capability-${R}`))}),r.jsx(Y,{spacing:h.xSmall})]}),e.locationDetail.status!=="open"&&e.locationDetail.capabilities?.some(R=>[rt.SALES_WHOLESALE,rt.SALES_NON_GENUINE_AGENCY,rt.CAR_DISPLAY,rt.TEST_DRIVE].includes(R))&&r.jsx(br,{level:2,children:c}),r.jsx(Ot,{level:2,children:e.locationDetail.name}),r.jsx(Y,{spacing:h.xxSmall}),r.jsx(Yt,{children:T}),e.locationDetail.phoneNumber&&r.jsxs(r.Fragment,{children:[r.jsx(Y,{spacing:h.xxSmall}),r.jsx(qs,{href:`tel:${e.locationDetail.phoneNumber}`,children:r.jsx(tn,{children:e.locationDetail.phoneNumber})})]}),e.distance&&r.jsxs(r.Fragment,{children:[r.jsx(Y,{spacing:h.xxSmall}),r.jsx(ht,{children:e.distance})]}),Tn(e.locationPageUrls,p.locale)===1&&r.jsxs(r.Fragment,{children:[r.jsx(Y,{spacing:h.medium}),r.jsx(Je,{label:s,href:S,variant:"text",icon:"arrowRight",openInNewTab:!1,dataLayer:{event:Be.LOCATIONS,eventInfo:{action:Oe.MAP_LOCATION_CARD,label:a}}})]}),Tn(e.locationPageUrls,p.locale)===2&&r.jsxs(r.Fragment,{children:[r.jsx(Eo,{buttons:e.locationPageUrls,locationName:e.locationDetail.name,open:m,onClose:f}),r.jsx(Y,{spacing:h.medium}),r.jsx(ot,{onClick:b,icon:io,iconPosition:ke.right,"data-testid":"location-detail-dialog-button",children:s})]}),r.jsx(hr,{locale:p.locale,stage:d,serviceBookingLabel:t,serviceBookingDatalayerEventLabel:n,directionsLabel:i,location:e.locationDetail}),l&&r.jsxs(r.Fragment,{children:[r.jsx(Y,{spacing:h.small}
708),r.jsx(Xs,{spacing:h.none,emphasis:Vt.low})]})]})},xr=L(Re)` 709 width: 100%; 710`,jo=({singleLocationData:e,isFetchMarkerLoading:t,getDirectionLabel:n,bookServiceButtonLabel:s,bookServiceButtonDatalayerEventLabel:a,goToLocationPageButtonLabel:i,goToLocationPageButtonDatalayerEventLabel:c,comingSoonLabel:l,market:d,stage:p})=>r.jsxs(xr,{"data-testid":"single-location-container",children:[t&&r.jsx(on,{size:ro.medium}),!t&&r.jsx(r.Fragment,{children:e.map((u,m)=>r.jsx(Mo,{locationCardData:u,getDirectionLabel:n,bookServiceButtonLabel:s,bookServiceButtonDatalayerEventLabel:a,goToLocationPageButtonLabel:i,goToLocationPageButtonDatalayerEventLabel:c,comingSoonLabel:l,market:d,stage:p,inList:e.length-1!==m},`location-${u.locationDetail.mdmId}`))})]}),vr=L.div` 711 z-index: 4; 712 align-self: end; 713 justify-self: stretch; 714 grid-area: 2 / 1; 715 ${q.tablet} { 716 display: none; 717 } 718`,wr=L(Re)` 719 background-color: ${Xe.white}; 720 width: 100%; 721 padding: ${h.medium} ${h.large} ${h.xLarge}; 722`,kr=L(Tt)` 723 height: max-content; 724 width: max-content; 725 align-self: end; 726`,yr=({isFetchMarkerLoading:e,singleLocationData:t,bookServiceButtonLabel:n,bookServiceButtonDatalayerEventLabel:s,goToLocationPageButtonLabel:a,goToLocationPageButtonDatalayerEventLabel:i,getDirectionLabel:c,comingSoonLabel:l,market:d,stage:p,closeAriaLabel:u,hideCard:m})=>r.jsx(vr,{children:r.jsxs(wr,{children:[r.jsx(kr,{icon:lo,onClick:m,"aria-label":u,size:Ue.medium}),r.jsx(jo,{singleLocationData:t,getDirectionLabel:c,isFetchMarkerLoading:e,bookServiceButtonLabel:n,bookServiceButtonDatalayerEventLabel:s,goToLocationPageButtonLabel:a,goToLocationPageButtonDatalayerEventLabel:i,comingSoonLabel:l,market:d,stage:p})]})}),$r=L(Re)` 727 width: 100%; 728`,Sr=L(Re)` 729 width: max-content; 730`,En=({searchInstructionsText:e,noResultsText:t,bookServiceButtonLabel:n,bookServiceButtonDatalayerEventLabel:s,getDirectionLabel:a,backToTopButtonLabel:i,showMoreButtonLabel:c,goToLocationPageButtonLabel:l,goToLocationPageButtonDatalayerEventLabel:d,comingSoonLabel:p,locations:u,isSearchLoading:m,moreResultsLeft:g,fetchNextBatch:f,onScrollToTop:b,stage:k,market:y})=>{const{pushToDatalayer:$}=mt(),A=o.useCallback(()=>{$({event:Be.LOCATIONS,eventInfo:{action:Oe.MAP_SEARCH_LIST,label:"Show more"}}),f()},[f]);return r.jsxs($r,{"data-testid":"locations-list-view",children:[!!e&&r.jsxs(r.Fragment,{children:[r.jsx(Y,{spacing:h.medium}),r.jsx(Yt,{children:e})]}),e===null&&r.jsxs(r.Fragment,{children:[u.length===0&&!m&&r.jsxs(r.Fragment,{children:[r.jsx(Y,{spacing:h.medium}),r.jsx(Yt,{children:t})]}),u.map(P=>r.jsx(Mo,{locationCardData:P,bookServiceButtonLabel:n,bookServiceButtonDatalayerEventLabel:s,goToLocationPageButtonLabel:l,goToLocationPageButtonDatalayerEventLabel:d,getDirectionLabel:a,comingSoonLabel:p,market:y,stage:k,inList:!0},`location-${P.locationDetail.mdmId}`)),m&&r.jsxs(r.Fragment,{children:[r.jsx(Y,{spacing:h.medium}),r.jsx(on,{size:ro.medium})]}),u.length>0&&r.jsxs(Sr,{children:[r.jsx(Y,{spacing:h.xLarge}),g&&!m&&r.jsxs(r.Fragment,{children:[r.jsx(bn,{icon:Js,onClick:A,iconPosition:ke.right,"data-testid":"show-more-button",children:c}),r.jsx(Y,{spacing:h.medium})]}),r.jsx(bn,{icon:Qs,onClick:b,iconPosition:ke.right,"data-testid":"scroll-to-top-button",children:i}),r.jsx(Y,{spacing:{mobile:h.large,tablet:h.none}})]})]})]})},Cr=({label:e,noResultText:t,loadingText:n,searchClearAriaLabel:s,backAriaLabel:a,language:i,region:c,locationBias:l,markers:d})=>{const{isPlacesServiceLoaded:p,isLoadingAutocompleteSuggestions:u,autoCompleteSuggestions:m,getAutocompleteSuggestions:g,handleAutocompleteSuggestionSelection:f}=Di(i,c),[b,k]=o.useState(),y=Gi(b,500),[$,A]=o.useState(),P=T=>{f(T,{viewportBias:{locations:d,count:3}}),A(T.optionLabel)};return o.useEffect(()=>{$===y||$===b||g(y,l)},[y,g,$,b,l]),r.jsx(fo,{disabled:!p,label:e,value:b,options:m,"data-testid":"search-input",trailing:p?void 0:r.jsx(on,{}),getOptionLabel:T=>T.optionLabel,renderOption:T=>T.optionLabel,noOptionsText:u||b!==y?n:t,ariaClearLabel:s,onChange:T=>{k(String(T))},onSelect:P,ariaBackButtonLabel:a})},Lr=L.div` 731 z-index: 5; 732 overflow-y: auto; 733 overflow-x: hidden; 734 735 align-self: start; 736 justify-self: start; 737 738 ${q.mobile} { 739 width: 100%; 740 } 741 ${q.tablet} { 742 width: 347px; 743 margin: ${h.large}; 744 max-height: calc(100% - calc(2 * ${h.large})); 745 } 746 ${q.desktop} { 747 width: 375px; 748 } 749`,Ir=L(Re)` 750 background-color: ${Xe.white}; 751 width: 100%; 752 753 ${q.mobile} { 754 padding: ${h.large} ${h.large} ${h.xSmall}; 755 } 756 ${q.tablet} { 757 padding: ${h.large}; 758 } 759`,Mn=L(Ot)` 760 ${q.mobile} { 761 font-size: ${Ht(1.5)}; 762 } 763 ${q.tablet} { 764 font-size: ${ta.large}; 765 } 766`,Rr=({title:e,search:t,filters:{activeFilters:n,options:s,label:a,onFilterChange:i},listView:{mapViewLabel:c,mapViewDatalayerEventLabel:l,listViewLabel:d,listViewDatalayerEventLabel:p,listEmptyText:u,isListVisible:m,onListVisibilityChange:g,bookServiceButtonLabel:f,bookServiceButtonDatalayerEventLabel:b,goToLocationPageButtonLabel:k,goToLocationPageButtonDatalayerEventLabel:y,backToSearchButtonLabel:$,backToSearchButtonDatalayerEventLabel:A,showMoreButtonLabel:P,backToTopButtonLabel:T,backToTopButtonDatalayerEventLabel:S,getDirectionLabel:R,comingSoonLabel:O},searchResults:{results:I,isSearchLoading:B,moreResultsLeft:Z,fetchNextBatch:M},singleLocationResult:{singleLocationData:X,isFetchMarkerLoading:ae},searchState:Q,setIdleSearchState:xe,setResultsSearchState:w,market:j,stage:U})=>{const{userPosition:E,focusedPlace:ee,setFocusedPlace:D}=ft(),ne=o.useRef(null),{pushToDatalayer:z}=mt(),{isGeocodingServiceLoaded:G,userPositionToMapPlace:_}=_i(j.languageCode),N=o.useCallback(async()=>
766{if(E){const ie=await _(E);ie&&D(ie),z({event:Be.LOCATIONS,eventInfo:{action:Oe.MAP,label:t.currentLocation.dataLayerEventLabel}})}},[E,D,_,t,z]),F=o.useCallback(()=>{Q===ze.singleLocation?w():(z({event:Be.LOCATIONS,eventInfo:{action:Oe.MAP_LOCATION_CARD,label:A}}),xe())},[Q,xe,w]),H=()=>{z({event:Be.LOCATIONS,eventInfo:{action:Oe.MAP_SEARCH_LIST,label:S}}),ne.current?.scrollTo({top:0,behavior:"smooth"}),window.scrollTo({top:0,behavior:"smooth"})};return r.jsx(Lr,{ref:ne,children:r.jsxs(Ir,{children:[Q===ze.idle&&r.jsxs(r.Fragment,{children:[r.jsx(Mn,{level:1,children:e}),r.jsx(Y,{spacing:h.medium}),r.jsx(Cr,{label:t.label,noResultText:t.noResultText,loadingText:t.loadingText,searchClearAriaLabel:t.clearAriaLabel,language:j.languageCode,region:j.countryCode,markers:t.markers,backAriaLabel:t.backAriaLabel}),r.jsx(Y,{spacing:h.medium}),r.jsx(ot,{disabled:!G||!E,icon:ea,iconPosition:ke.left,onClick:()=>{N()},children:t.currentLocation.label}),s.length>1&&r.jsx(Y,{spacing:{mobile:me(1.25),tablet:me(2.5),desktop:h.xLarge}})]}),Q===ze.mapFocus&&r.jsxs(r.Fragment,{children:[r.jsx(ot,{icon:kt,iconPosition:ke.left,onClick:F,children:$}),s.length>1&&r.jsx(Y,{spacing:{mobile:me(1.25),tablet:me(2.5),desktop:h.xLarge}})]}),Q===ze.results&&r.jsxs(r.Fragment,{children:[r.jsx(ot,{icon:kt,iconPosition:ke.left,onClick:F,children:$}),r.jsx(Y,{spacing:h.xSmall}),r.jsx(Mn,{level:2,children:ee?.displayName}),s.length>1&&r.jsx(Y,{spacing:h.medium})]}),Q!==ze.singleLocation&&s.length>1&&r.jsx(r.Fragment,{children:r.jsx(or,{filtersLabel:a,filtersOptions:s,activeFilters:n,onFilterChange:i,isSearchLoading:B})}),r.jsxs(ct,{display:{mobile:"block",tablet:"none",desktop:"none",desktopWide:"none"},children:[r.jsx(Y,{spacing:h.medium}),r.jsx(Lo,{tabs:[{label:c},{label:d}],activeTab:m?1:0,onTabClick:ie=>{z({event:Be.LOCATIONS,eventInfo:{action:Oe.MAP_SEARCH_LIST,label:[l,p][ie]}}),g(ie===1)}}),m&&r.jsx(En,{searchInstructionsText:Q===ze.results?null:u,noResultsText:t.noResultText,locations:I,bookServiceButtonLabel:f,bookServiceButtonDatalayerEventLabel:b,getDirectionLabel:R,goToLocationPageButtonLabel:k,goToLocationPageButtonDatalayerEventLabel:y,moreResultsLeft:Z,isSearchLoading:B,fetchNextBatch:M,showMoreButtonLabel:P,backToTopButtonLabel:T,comingSoonLabel:O,onScrollToTop:H,market:j,stage:U})]}),Q===ze.results&&r.jsx(ct,{display:{mobile:"none",tablet:"block",desktop:"block",desktopWide:"block"},children:r.jsx(En,{searchInstructionsText:null,noResultsText:t.noResultText,locations:I,bookServiceButtonLabel:f,bookServiceButtonDatalayerEventLabel:b,goToLocationPageButtonLabel:k,goToLocationPageButtonDatalayerEventLabel:y,moreResultsLeft:Z,isSearchLoading:B,showMoreButtonLabel:P,fetchNextBatch:M,getDirectionLabel:R,backToTopButtonLabel:T,comingSoonLabel:O,onScrollToTop:H,market:j,stage:U})}),Q===ze.singleLocation&&r.jsxs(ct,{display:{mobile:"none",tablet:"block",desktop:"block",desktopWide:"block"},children:[r.jsx(ot,{icon:kt,iconPosition:ke.left,onClick:F,children:$}),r.jsx(Y,{spacing:h.xSmall}),r.jsx(jo,{isFetchMarkerLoading:ae,singleLocationData:X,bookServiceButtonLabel:f,bookServiceButtonDatalayerEventLabel:b,getDirectionLabel:R,goToLocationPageButtonLabel:k,goToLocationPageButtonDatalayerEventLabel:y,comingSoonLabel:O,market:j,stage:U})]})]})})},Pr=L.div` 767 z-index: 3; 768 margin: ${h.large}; 769 align-self: end; 770 justify-self: start; 771 ${q.onlyMobile} { 772 display: none; 773 } 774 ${q.tablet} { 775 grid-area: 1 / 1; 776 width: 318px; 777 } 778 ${q.desktop} { 779 width: 375px; 780 } 781`,Tr=L(Dn)` 782 background-color: ${Xe.white}; 783 width: 100%; 784 justify-content: space-between; 785 column-gap: ${h.medium}; 786 787 ${q.mobile} { 788 padding: ${h.medium}; 789 } 790 ${q.tablet} { 791 padding: ${h.medium} ${h.small}; 792 } 793 ${q.desktop} { 794 padding: ${h.medium} ${h.medium} ${h.medium} 795 ${h.large}; 796 } 797`,Er=L(Tt)` 798 height: max-content; 799 width: max-content; 800`,Mr=({text:e,button:t,closeAriaLabel:n,hideCard:s})=>r.jsx(Pr,{"data-testid":"service-points-card",children:r.jsxs(Tr,{children:[r.jsxs(Re,{children:[e&&r.jsxs(r.Fragment,{children:[r.jsx(ht,{children:e}),r.jsx(Y,{spacing:{tablet:me(.375),mobile:h.xSmall}})]}),t&&r.jsx(Je,{label:t.label,href:t.href,variant:t.variant,icon:t.icon,openInNewTab:t.openInNewTab,dataLayer:t.dataLayer})]}),r.jsx(Re,{children:r.jsx(Er,{icon:lo,onClick:s,"aria-label":n,size:Ue.medium})})]})}),jr=({visibleMarkers:e,activeMarkerId:t,locale:n,allLocationCapabilities:s,userPosition:a})=>
800{const[i,c]=o.useState([]),[l,d]=o.useState([]),[p,u]=o.useState(!1),m=o.useCallback(async()=>{u(!0);const g=await Po({locale:n,markers:i,allLocationCapabilities:s,useUserPosition:!0});d(g),u(!1)},[i,p,d,u,n]);return o.useEffect(()=>{if(!t){c([]),d([]),u(!1);return}d([]);const g=e.filter(f=>t===f.id).flatMap(f=>{const b=a?Rt(a,f):null;return f.id.split(an).map(k=>({id:k,distanceToUserPosition:b}))});c(g)},[t,e,a]),o.useEffect(()=>{i.length!==0&&m()},[i]),{isFetchMarkerLoading:p,singleLocationData:l}},Or="1024px",Ar=L.div` 801 width: 100%; 802 margin-left: auto; 803 margin-right: auto; 804 display: grid; 805 806 > * { 807 grid-area: 1 / 1; 808 } 809 max-width: ${Qn}px; 810 --dotcom-available-height: calc( 811 100vh - var(${Nt.maxSafeAreaHeight}) 812 ); 813 @supports (height: 100svh) { 814 --dotcom-available-height: calc( 815 100svh - var(${Nt.maxSafeAreaHeight}) 816 ); 817 } 818 scroll-margin-top: var(${Nt.subNavigationHeight}); 819 820 ${q.mobile} { 821 height: auto; 822 min-height: var(--dotcom-available-height); 823 grid-template-rows: auto 1fr; 824 } 825 ${q.tablet} { 826 height: var(--dotcom-available-height); 827 min-height: 30rem; 828 grid-template-rows: 1fr; 829 } 830 ${q.desktopWide} { 831 max-height: ${Or}; 832 } 833`;var ze=(e=>(e[e.idle=0]="idle",e[e.results=1]="results",e[e.singleLocation=2]="singleLocation",e[e.mapFocus=3]="mapFocus",e))(ze||{});const zr=o.forwardRef(({title:e,market:t,stage:n,search:{label:s,loadingText:a,noResultText:i,clearAriaLabel:c,backAriaLabel:l,zoomInAriaLabel:d,zoomOutAriaLabel:p,fullscreenOpenAriaLabel:u,fullscreenCloseAriaLabel:m,currentLocation:g},filters:{label:f,options:b},listView:{backToSearchButtonLabel:k,backToSearchButtonDatalayerEventLabel:y,mapViewLabel:$,mapViewDatalayerEventLabel:A,listViewLabel:P,listViewDatalayerEventLabel:T,listEmptyText:S,bookServiceButtonLabel:R,bookServiceButtonDatalayerEventLabel:O,goToLocationPageButtonLabel:I,goToLocationPageButtonDatalayerEventLabel:B,backToTopButtonLabel:Z,backToTopButtonDatalayerEventLabel:M,showMoreButtonLabel:X,getDirectionLabel:ae,comingSoonLabel:Q},allLocationCapabilities:xe,servicePointsCard:w,defaultMapBounds:j,allGeoPoints:U},E)=>{const[ee,D]=o.useState(0),[ne,z]=qt(),[G,_]=o.useState(!1),[N,F]=o.useState(),[H,ie]=o.useState(!0),[ue,ye]=o.useState([st]),{focusedPlace:pe,setFocusedPlace:Le,userPosition:Te}=ft(),{queryMatches:fe}=Ke(),{pushToDatalayer:de}=mt(),C=o.useMemo(()=>{const te=ue.length===1&&ue[0]===st,he=new Set(te?[]:ue.flatMap(ce=>(To[ce]||ce).split(",")).map(ce=>ce.trim())),be=te?U:U.filter(({capabilities:ce})=>ce.some(At=>he.has(At)));return Zi(be).map(ce=>({...ce,id:ce.mdmId,longitude:Number(ce.longitude),latitude:Number(ce.latitude),active:N===ce.mdmId,"aria-label":ce.name}))},[N,ue]),{results:W,fetchNextBatch:J,moreResultsLeft:se,isSearchLoading:le}=Ji({visibleMarkers:C,focusedPlace:pe,locale:t.locale,allLocationCapabilities:xe,userPosition:Te}),{isFetchMarkerLoading:$e,singleLocationData:Ae}=jr({visibleMarkers:C,activeMarkerId:N,userPosition:Te,locale:t.locale,allLocationCapabilities:xe});o.useEffect(()=>{pe&&ee!==2&&(F(void 0),D(1))},[pe,ee]);const Ye=o.useCallback(te=>{$e&&N||(F(te),D(2),fe.mobile&&ie(!1))},[F,D,fe.mobile,N,$e]),Fe=o.useCallback(()=>{F(void 0),pe?D(1):(Le(null),_(!1),D(0))},[F,D,pe,Le,_]),Me=o.useCallback(()=>{F(void 0),Le(null),_(!1),D(0);const te=Jo(ue);z(te,{replace:!0})},[Le,F,D,ue,z,_]),_e=o.useCallback(te=>{ee===0&&fe.mobile?D(3):ee===2&&te!=="zoom"&&te!=="drag"&&Me()},[ee,D,fe.mobile,Me]),V=o.useCallback(te=>{if(_(te),ee===2&&te&&N){const he=C.find(be=>be.id===N);he&&Le({coordinates:{latitude:Number(he.latitude),longitude:Number(he.longitude)}})}if(pe){const he=pn(ue,pe,te);z(he,{replace:!0})}},[_,N,C,ee,pe,ue,z]);o.useEffect(()=>{ee===3&&!fe.mobile&&Me()},[fe.mobile]),o.useEffect(()=>{const he=Qo(ne).filter(we=>b.some(ce=>ce.userFriendlyKey===we));he.length&&ye(he);const be=es(ne);be.coordinates&&(Le({coordinates:be.coordinates,displayName:be.displayName}),D(1)),be.showListView!==void 0&&_(be.showListView)},[]);const re=o.useCallback((te,he)=>{const be=pn(te,pe||void 0,G);z(be,{replace:!0}),ye(te);const we=b.find(({userFriendlyKey:ce})=>ce===he);we&&te.includes(we.userFriendlyKey)&&de({event:Be.LOCATIONS,eventInfo:{action:ee===1?Oe.MAP_LOCATION_FILTER:Oe.MAP,label:we.dataLayerEventLabel}}
833)},[ye,de,ee,b,z,pe,G]);return r.jsxs(Ar,{ref:E,"data-testid":"map-section",children:[r.jsx(Rr,{title:e,search:{label:s,loadingText:a,noResultText:i,clearAriaLabel:c,backAriaLabel:l,currentLocation:g,markers:C},filters:{label:f,options:b,activeFilters:ue,onFilterChange:re},listView:{mapViewLabel:$,mapViewDatalayerEventLabel:A,listViewLabel:P,listViewDatalayerEventLabel:T,listEmptyText:S,isListVisible:G,backToSearchButtonLabel:k,backToSearchButtonDatalayerEventLabel:y,onListVisibilityChange:V,bookServiceButtonLabel:R,bookServiceButtonDatalayerEventLabel:O,goToLocationPageButtonLabel:I,goToLocationPageButtonDatalayerEventLabel:B,backToTopButtonLabel:Z,backToTopButtonDatalayerEventLabel:M,showMoreButtonLabel:X,getDirectionLabel:ae,comingSoonLabel:Q},searchResults:{results:W,isSearchLoading:le,moreResultsLeft:se,fetchNextBatch:J},singleLocationResult:{isFetchMarkerLoading:$e,singleLocationData:Ae},market:t,stage:n,searchState:ee,setIdleSearchState:Me,setResultsSearchState:Fe}),r.jsx(rr,{markers:C,onMarkerSelect:Ye,isListVisible:G,defaultMapBounds:j,onMapInteract:_e,singleLocationFocused:ee===2,ariaLabels:{zoomIn:d,zoomOut:p,fullscreenOpen:u,fullscreenClose:m}}),(w.text||w.button)&&!G&&H&&r.jsx(Mr,{text:w.text,button:w.button,closeAriaLabel:w.closeAriaLabel,hideCard:()=>{ie(!1)}}),ee===2&&r.jsx(yr,{hideCard:Fe,closeAriaLabel:c,bookServiceButtonLabel:R,bookServiceButtonDatalayerEventLabel:O,getDirectionLabel:ae,goToLocationPageButtonLabel:I,goToLocationPageButtonDatalayerEventLabel:B,comingSoonLabel:Q,isFetchMarkerLoading:$e,singleLocationData:Ae,market:t,stage:n})]})}),Br=L.div` 834 display: flex; 835 flex-direction: column; 836 align-items: flex-start; 837 gap: ${h.medium}; 838 839 ${q.tablet} { 840 flex-direction: row; 841 } 842`,Wr=L(Je)` 843 ${q.onlyMobile} { 844 width: 100%; 845 } 846`,Nr=L(oo)` 847 ${q.tablet} { 848 grid-row-gap: ${h.medium}; 849 } 850 851 ${q.desktop} {
852 grid-row-gap: ${h.xxxxxLarge}; 853 } 854`,Dr=({title:e,body:t,buttons:n})=>r.jsx(no,{"data-testid":"no-location-in-market",children:r.jsxs(Nr,{children:[r.jsx(St,{span:{mobile:4,tablet:4,desktop:3},children:r.jsx(Ut,{level:1,children:e})}),r.jsxs(St,{span:{mobile:4,tablet:8,desktop:6},offset:{mobile:0,desktop:1},children:[r.jsx(ct,{display:{mobile:"block",tablet:"none"},children:r.jsx(so,{as:"h2",children:t})}),r.jsx(ct,{display:{mobile:"none",tablet:"block"},children:r.jsx(Ut,{level:2,children:t})}),r.jsx(Y,{spacing:{mobile:h.medium,desktop:h.large}}),r.jsx(Br,{children:n.map(s=>r.jsx(Wr,{label:s.label,href:s.href,variant:s.variant,icon:s.icon,openInNewTab:s.openInNewTab,dataLayer:s.dataLayer},s.id))})]})]})}),Xr=us(({loaderData:e,location:t})=>{if(!e)return[];const{publishedMarkets:n,seo:{title:s,description:a,image:i,twitterCard:c,noIndex:l}}=e.locationsOverviewPage.meta;return[...oa({title:s,description:a,image:i.url,twitterCard:c,noIndex:l}),...ps(t.pathname,n,e.isChina)]}),Fr=()=>{const{locationsOverviewPage:e,market:t,stage:n}=No(),s=cs(t),[a,i]=Hn({threshold:na.fullyInView});return r.jsxs(r.Fragment,{children:[e.map&&r.jsxs(ts,{locale:t.locale,children:[r.jsx(zr,{ref:a,title:e.map.title,search:{label:e.map.searchLabel,loadingText:e.map.searchLoading,noResultText:e.map.searchNoResultText,clearAriaLabel:e.map.searchClearAriaLabel,backAriaLabel:e.map.searchBackAriaLabel,zoomInAriaLabel:e.map.searchZoomInAriaLabel,zoomOutAriaLabel:e.map.searchZoomOutAriaLabel,fullscreenOpenAriaLabel:e.map.searchFullscreenOpenAriaLabel,fullscreenCloseAriaLabel:e.map.searchFullscreenCloseAriaLabel,currentLocation:e.map.currentLocation},filters:{label:e.map.filtersLabel,options:e.map.filtersOptions},listView:{mapViewLabel:e.map.mapViewLabel,mapViewDatalayerEventLabel:e.map.mapViewDatalayerEventLabel,listViewLabel:e.map.listViewLabel,listViewDatalayerEventLabel:e.map.listViewDatalayerEventLabel,bookServiceButtonLabel:e.map.bookServiceButtonLabel,bookServiceButtonDatalayerEventLabel:e.map.bookServiceButtonDatalayerEventLabel,goToLocationPageButtonLabel:e.map.goToLocationPageButtonLabel,goToLocationPageButtonDatalayerEventLabel:e.map.goToLocationPageButtonDatalayerEventLabel,listEmptyText:e.map.listEmptyText,backToSearchButtonLabel:e.map.backToSearchButtonLabel,backToSearchButtonDatalayerEventLabel:e.map.backToSearchButtonDatalayerEventLabel,backToTopButtonLabel:e.map.backToTopButtonLabel,backToTopButtonDatalayerEventLabel:e.map.backToTopButtonDatalayerEventLabel,showMoreButtonLabel:e.map.showMoreLabel,getDirectionLabel:e.map.getDirectionLabel,comingSoonLabel:e.map.comingSoonLabel},market:t,stage:n,servicePointsCard:e.map.servicePointsCard,defaultMapBounds:e.defaultMapBounds,allLocationCapabilities:e.allCapabilities,allGeoPoints:e.map.geoPoints}),r.jsx(bt,{})]}),e.noLocationInMarket&&!e.map&&r.jsxs(r.Fragment,{children:[r.jsx(Y,{spacing:{mobile:h.large,tablet:h.xLarge,desktop:me(2.5)}}),r.jsx(Dr,{title:e.noLocationInMarket.title,body:e.noLocationInMarket.body,buttons:e.noLocationInMarket.buttons}),r.jsx(Y,{spacing:{mobile:h.large,tablet:h.xLarge,desktop:me(2.5)}})]}),e.handOffTiles&&r.jsxs(r.Fragment,{children:[r.jsx(sa,{tiles:e.handOffTiles}),r.jsx(bt,{})]}),e.cards&&r.jsxs(r.Fragment,{children:[r.jsx(ns,{cards:e.cards,background:e.noLocationInMarket?Xe.white:Xe.lightGrey}),r.jsx(bt,{})]}),e.gallerySection&&r.jsxs(r.Fragment,{children:[r.jsx(er,{title:e.gallerySection.title,description:e.gallerySection.description,gallerySlides:e.gallerySection.gallerySlides}),r.jsx(bt,{})]}),t?.cmsLocale&&s&&r.jsx(ds,{isSupportButtonVisible:!i,locale:t?.cmsLocale,environment:n===zn.Production?"production":"development"})]})},Jr=Wo(Fr);export{Jr as default,Xr as meta};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.